npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@sematext/sematext-api-client

v0.5.0

Published

Client library for https://sematext.com/docs/api/

Downloads

0

Readme

  sematext-api-client-javascript

A Sematext Cloud API client, for interaction with Sematext Cloud solution monitoring, alerting and log shipping.

License

Contents

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Installation

Node.js

Install via:

npm install @sematext/sematext-api-client --save
const Stcloud = require("@sematext/sematext-api-client")

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Authentication

This client code requires a Sematext API Access token to function. You can find this by logging into your Sematext Cloud Account

Please follow the installation instruction and execute the following JS code:

var SematextApiClientJavascript = require('sematext-api-client-javascript')

var defaultClient = SematextApiClientJavascript.ApiClient.instance

// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key']
api_key.apiKey = 'YOUR API KEY'
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix['Authorization'] = "Token"

var api = new SematextApiClientJavascript.AlertNotificationsApi()

var appId = 789 // {Number} appId

var timeInterval = new SematextApiClientJavascript.AlertNotificationRequest() // {AlertNotificationRequest} Time Interval

api.getAlertNotificationsForAppUsingPOST(appId, timeInterval).then(
  function (data) {
    console.log('API called successfully. Returned data: ' + data)
  },
  function (error) {
    console.error(error)
  }
)

Testing

Note: Tests are currently inhibited by a Mocha dependancy on Yargs. This client is generated code so this should have litle impact. Marking as a pre-release until this is resolved upstream.

Documentation for API Endpoints

All URIs are relative to https://localhost

| Class | Method | HTTP request | Description | | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | | SematextApiClientJavascript.AlertNotificationsApi | getAlertNotificationsForAppUsingPOST | POST /users-web/api/v3/apps/{appId}/notifications/alerts | Get alert notifications for an app | | SematextApiClientJavascript.AlertNotificationsApi | getAlertNotificationsForUserUsingPOST1 | POST /users-web/api/v3/notifications/alerts | Get alert notifications for a user | | SematextApiClientJavascript.AlertsApi | createAlertUsingPOST | POST /users-web/api/v3/alerts | Create alert rule | | SematextApiClientJavascript.AlertsApi | deleteAlertRuleUsingDELETE | DELETE /users-web/api/v3/alerts/{updateableAlertId} | Delete alert rule | | SematextApiClientJavascript.AlertsApi | disableAlertRuleUsingPUT | PUT /users-web/api/v3/alerts/{updateableAlertId}/disable | Disable alert rule | | SematextApiClientJavascript.AlertsApi | enableAlertRuleUsingPUT1 | PUT /users-web/api/v3/alerts/{updateableAlertId}/enable | Enable alert rule | | SematextApiClientJavascript.AlertsApi | getAlertRulesForAppUsingGET | GET /users-web/api/v3/apps/{appId}/alerts | Get alert rules for an app | | SematextApiClientJavascript.AppsApi | deleteUsingDELETE | DELETE /users-web/api/v3/apps/{anyStateAppId} | delete | | SematextApiClientJavascript.AppsApi | getAppTypesUsingGET1 | GET /users-web/api/v3/apps/types | Get all App types supported for the account identified with apiKey | | SematextApiClientJavascript.AppsApi | getUsingGET | GET /users-web/api/v3/apps/{anyStateAppId} | Gets defails for one particular App | | SematextApiClientJavascript.AppsApi | inviteAppGuestsUsingPOST | POST /users-web/api/v3/apps/guests | Invite guests to an app | | SematextApiClientJavascript.AppsApi | listAppsUsersUsingGET1 | GET /users-web/api/v3/apps/users | Get all users of apps accessible to this account | | SematextApiClientJavascript.AppsApi | listUsingGET1 | GET /users-web/api/v3/apps | Get all apps accessible by account identified with apiKey | | SematextApiClientJavascript.AppsApi | updateDescriptionUsingPUT1 | PUT /users-web/api/v3/apps/{anyStateAppId}/description | Update description of the app | | SematextApiClientJavascript.AppsApi | updateUsingPUT2 | PUT /users-web/api/v3/apps/{anyStateAppId} | Update app | | SematextApiClientJavascript.AwsSettingsControllerApi | updateUsingPUT | PUT /users-web/api/v3/apps/{appId}/aws | Update App's AWS CloudWatch settings | | SematextApiClientJavascript.BillingApi | getDetailedInvoiceUsingGET | GET /users-web/api/v3/billing/invoice/{service}/{year}/{month} | Get invoice details | | SematextApiClientJavascript.BillingApi | listAvailablePlansUsingGET1 | GET /users-web/api/v3/billing/availablePlans | Get available plans | | SematextApiClientJavascript.BillingApi | updatePlanUsingPUT1 | PUT /users-web/api/v3/billing/info/{appId} | Update plan for an app | | SematextApiClientJavascript.LogsAppApi | createLogseneApplication | POST /logsene-reports/api/v3/apps | Create Logs App | | SematextApiClientJavascript.MonitoringAppApi | createSpmApplication1 | POST /spm-reports/api/v3/apps | Create Monitoring App | | SematextApiClientJavascript.ResetPasswordApi | resetPasswordUsingPOST | POST /users-web/api/v3/account/password/reset | Reset Password | | SematextApiClientJavascript.SubscriptionsApi | createForAppUsingPOST | POST /users-web/api/v3/apps/{appId}/subscription | Create App subscription | | SematextApiClientJavascript.SubscriptionsApi | createForDashUsingPOST1 | POST /users-web/api/v3/dashboards/{dashId}/subscription | Create dashboard subscription | | SematextApiClientJavascript.SubscriptionsApi | deleteUsingDELETE2 | DELETE /users-web/api/v3/subscriptions/{updateableSubscriptionId} | Delete subscription | | SematextApiClientJavascript.SubscriptionsApi | listUsingGET3 | GET /users-web/api/v3/apps/{appId}/subscriptions | Get subscriptions for an App | | SematextApiClientJavascript.SubscriptionsApi | listUsingGET4 | GET /users-web/api/v3/subscriptions | Get current account's subscriptions | | SematextApiClientJavascript.SubscriptionsApi | sendAppReportUsingPOST1 | POST /users-web/api/v3/apps/{appId}/report/send | Email an App report | | SematextApiClientJavascript.SubscriptionsApi | sendDashReportUsingPOST | POST /users-web/api/v3/dashboards/{dashId}/report/send | Email a dashboard report | | SematextApiClientJavascript.SubscriptionsApi | toggleEnabledUsingPUT1 | PUT /users-web/api/v3/subscriptions/{updateableSubscriptionId} | Toggle subscription status | | SematextApiClientJavascript.SubscriptionsApi | updateForAppUsingPUT | PUT /users-web/api/v3/apps/{appId}/subscription | Update App subscription | | SematextApiClientJavascript.SubscriptionsApi | updateForDashUsingPUT1 | PUT /users-web/api/v3/dashboards/{dashId}/subscription | Update dashboard subscription | | SematextApiClientJavascript.TagApiControllerApi | getTagNamesUsingGET1 | GET /spm-reports/api/v3/apps/{appIds}/tagNames | Gets tag names for the given application identifiers appearing in the given time frame. | | SematextApiClientJavascript.TagApiControllerApi | getUsingGET1 | GET /spm-reports/api/v3/apps/{appIds}/tags | Gets values for specified tags for the given application identifiers appearing in the given time frame. | | SematextApiClientJavascript.TagApiControllerApi | getUsingGET2 | GET /spm-reports/api/v3/apps/{appIds}/metrics/filters | Gets values for specified tags for the given application identifiers appearing in the given time frame. | | SematextApiClientJavascript.TokensApiControllerApi | createAppToken1 | POST /users-web/api/v3/apps/{appId}/tokens | Create new app token | | SematextApiClientJavascript.TokensApiControllerApi | deleteAppToken1 | DELETE /users-web/api/v3/apps/{appId}/tokens/{tokenId} | Delete app token | | SematextApiClientJavascript.TokensApiControllerApi | getAppTokens | GET /users-web/api/v3/apps/{appId}/tokens | Get app available tokens | | SematextApiClientJavascript.TokensApiControllerApi | regenerateAppToken | POST /users-web/api/v3/apps/{appId}/tokens/{tokenId}/regenerate | Regenerate app token) | | SematextApiClientJavascript.TokensApiControllerApi | updateAppToken1 | PUT /users-web/api/v3/apps/{appId}/tokens/{tokenId} | Update app token (enable/disable or name) |

Documentation for Models