diff --git a/.npmignore b/.npmignore index a69e2f9..9fd99a1 100644 --- a/.npmignore +++ b/.npmignore @@ -9,4 +9,5 @@ docs/ node_modules/ jest.config.js tsconfig.json -.eslintrc.json \ No newline at end of file +.eslintrc.json +.prettierrc.json \ No newline at end of file diff --git a/README.md b/README.md index 84981db..c1e1b2d 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Furthermore, events can be even stored in Alert Notification storage and pulled ### Installation ```bash -$ npm i alert-notification-client +$ npm i @sap_oss/alert-notification-client ``` ## Getting Started @@ -37,7 +37,7 @@ import { RegionUtils, Severity, Category -} from 'alert-notification-node-client'; +} from '@sap_oss/alert-notification-client'; const client = new AlertNotificationClient({ authentication: new BasicAuthentication({ diff --git a/docs/authentication/basic-authentication.md b/docs/authentication/basic-authentication.md index 0080063..f14900b 100644 --- a/docs/authentication/basic-authentication.md +++ b/docs/authentication/basic-authentication.md @@ -40,7 +40,7 @@ BasicAuthentication is a class in the context of Alert Notification's node clien ## @Example ```js -import { BasicAuthentication } from 'alert-notification-client'; +import { BasicAuthentication } from '@sap_oss/alert-notification-client'; const basicAuthentication = new BasicAuthentication({ username: 'test-username', diff --git a/docs/authentication/oauth-authentication.md b/docs/authentication/oauth-authentication.md index 6f963fa..c58f7b9 100644 --- a/docs/authentication/oauth-authentication.md +++ b/docs/authentication/oauth-authentication.md @@ -42,7 +42,7 @@ _**Note**_: Grant type query parameter will be added automatically by the client ## @Example ```js -import { OAuthAuthentication } from 'alert-notification-client'; +import { OAuthAuthentication } from '@sap_oss/alert-notification-client'; const oAuthAuthentication = new OAuthAuthentication({ username: 'test-username', diff --git a/docs/common-objects/region-utils.md b/docs/common-objects/region-utils.md index 721a502..341ba88 100644 --- a/docs/common-objects/region-utils.md +++ b/docs/common-objects/region-utils.md @@ -62,7 +62,7 @@ Platform is an enum representing the environment on which Alert Notification is ### @Example ```js -import { RegionUtils } from 'alert-notification-client'; +import { RegionUtils } from '@sap_oss/alert-notification-client'; console.log(RegionUtils.Platform.CF); // will print 'CF' console.log(RegionUtils.Platform.NEO); // will print 'NEO' @@ -140,7 +140,7 @@ RegionUtils contains exported constants which represent predefined regions, on w ### @Example ```js -import { RegionUtils } from 'alert-notification-client'; +import { RegionUtils } from '@sap_oss/alert-notification-client'; console.log(RegionUtils.EU10); // will print EU10 region instance ``` \ No newline at end of file diff --git a/docs/configuration-api/action.md b/docs/configuration-api/action.md index c4a671a..a740b51 100644 --- a/docs/configuration-api/action.md +++ b/docs/configuration-api/action.md @@ -32,7 +32,7 @@ Action is an entity which represents the destination on which Alert Notification _**@Example:**_ ```js -import { State } from 'alert-notification-client'; +import { State } from '@sap_oss/alert-notification-client'; const action = { name: 'to-my-email', diff --git a/docs/configuration-api/condition.md b/docs/configuration-api/condition.md index 06f3113..f317697 100644 --- a/docs/configuration-api/condition.md +++ b/docs/configuration-api/condition.md @@ -32,7 +32,7 @@ Condition is an entity which defines a condition in the context of the Alert Not ## Example ```js -import { Predicate } from 'alert-notification-client'; +import { Predicate } from '@sap_oss/alert-notification-client'; const condition = { name: 'event-type-contains-HighCpu', @@ -70,7 +70,7 @@ Predicate is an enum value representing a matching criteria for a condition. #### Example ```js -import { Predicate } from 'alert-notification-client'; +import { Predicate } from '@sap_oss/alert-notification-client'; console.log(Predicate.CONTAINS); // will print 'CONTAINS' ``` \ No newline at end of file diff --git a/docs/configuration-api/configuration.md b/docs/configuration-api/configuration.md index 4e1e395..f51b681 100644 --- a/docs/configuration-api/configuration.md +++ b/docs/configuration-api/configuration.md @@ -32,7 +32,7 @@ Configuration represents the assembly of actions, conditions and subscriptions _**@Example:**_ ```js -import { State, Predicate } from 'alert-notification-client'; +import { State, Predicate } from '@sap_oss/alert-notification-client'; const configuration = { diff --git a/docs/configuration-api/entity-type.md b/docs/configuration-api/entity-type.md index ddf4fd9..6012e3c 100644 --- a/docs/configuration-api/entity-type.md +++ b/docs/configuration-api/entity-type.md @@ -32,7 +32,7 @@ EntityType is an enum which helps deduce what type of entity you are trying to m ## @Example ```js -import { EntityType } from 'alert-notification-client'; +import { EntityType } from '@sap_oss/alert-notification-client'; console.log(EntityType.ACTION); // will print 'ACTION' console.log(EntityType.CONDITION); // will print 'CONDITION' diff --git a/docs/configuration-api/state.md b/docs/configuration-api/state.md index a2a0230..17bbc0c 100644 --- a/docs/configuration-api/state.md +++ b/docs/configuration-api/state.md @@ -31,7 +31,7 @@ State is an enum holding a value for enablement and disablement of an entity ## Example ```js -import { State } from 'alert-notification-client'; +import { State } from '@sap_oss/alert-notification-client'; console.log(State.ENABLED); // will print ENABLED console.log(State.DISABLED); // will print DISABLED diff --git a/docs/configuration-api/subscription.md b/docs/configuration-api/subscription.md index 4b04e1b..a815a19 100644 --- a/docs/configuration-api/subscription.md +++ b/docs/configuration-api/subscription.md @@ -32,7 +32,7 @@ Subscription is the aggregation of actions and conditions. When an event is rece ## Example ```js -import { State } from 'alert-notification-client'; +import { State } from '@sap_oss/alert-notification-client'; const subscription = { name: 'event-with-eventType-HighCpu-to-mail', diff --git a/docs/event-api-objects/category.md b/docs/event-api-objects/category.md index 5757a09..76da348 100644 --- a/docs/event-api-objects/category.md +++ b/docs/event-api-objects/category.md @@ -32,7 +32,7 @@ Represents the category of the event. ## @Example ```js -import { Category } from 'alert-notification-client'; +import { Category } from '@sap_oss/alert-notification-client'; console.log(Category.ALERT); // will print 'ALERT' console.log(Category.EXCEPTION); // will print 'EXCEPTION' diff --git a/docs/event-api-objects/consumer-event.md b/docs/event-api-objects/consumer-event.md index cad65b9..3373c8a 100644 --- a/docs/event-api-objects/consumer-event.md +++ b/docs/event-api-objects/consumer-event.md @@ -34,7 +34,7 @@ Received when requesting Undelivered or Matched APIs. Represents a stored event _**@Example:**_ ```js -import { Severity, Category } from 'alert-notification-client'; +import { Severity, Category } from '@sap_oss/alert-notification-client'; const consumerEvent = { id: 'matched-or-undelivered-event-id', @@ -106,7 +106,7 @@ An enum which shows the status of an event. If the event was not delivered its s #### @Example ```js -import { DeliveryStatus } from 'alert-notification-client'; +import { DeliveryStatus } from '@sap_oss/alert-notification-client'; console.log(DeliveryStatus.UNDELIVERED); // will print 'UNDELIVERED' console.log(DeliveryStatus.MATCHED); // will print 'MATCHED' diff --git a/docs/event-api-objects/resource-event.md b/docs/event-api-objects/resource-event.md index ef2194f..5886681 100644 --- a/docs/event-api-objects/resource-event.md +++ b/docs/event-api-objects/resource-event.md @@ -33,7 +33,7 @@ Object to use when you want to ingest an event in Alert Notification to alert/no ## @Example ```js -import { Severity, Category } from 'alert-notification-client'; +import { Severity, Category } from '@sap_oss/alert-notification-client'; const resourceEvent = { body: 'Your test-resource has been', diff --git a/docs/event-api-objects/severity.md b/docs/event-api-objects/severity.md index fd217a6..c85c205 100644 --- a/docs/event-api-objects/severity.md +++ b/docs/event-api-objects/severity.md @@ -35,7 +35,7 @@ Represents the event impact in the context of the affected resource. ## @Example ```js -import { Severity } from 'alert-notification-client'; +import { Severity } from '@sap_oss/alert-notification-client'; console.log(Severity.NOTICE); // will print 'NOTICE' ``` diff --git a/docs/examples/create-and-get.md b/docs/examples/create-and-get.md index cb9fc69..5348525 100644 --- a/docs/examples/create-and-get.md +++ b/docs/examples/create-and-get.md @@ -34,7 +34,7 @@ import { BasicAuthentication, RegionUtils, State -} from 'alert-notification-client'; +} from '@sap_oss/alert-notification-client'; const client = new AlertNotificationClient({ authentication: new BasicAuthentication({ diff --git a/docs/examples/exporting-and-importing-config.md b/docs/examples/exporting-and-importing-config.md index edf766a..ce1d494 100644 --- a/docs/examples/exporting-and-importing-config.md +++ b/docs/examples/exporting-and-importing-config.md @@ -33,7 +33,7 @@ import { EntityType, BasicAuthentication, RegionUtils -} from 'alert-notification-client'; +} from '@sap_oss/alert-notification-client'; const eu10Client = new AlertNotificationClient({ authentication: new BasicAuthentication({ diff --git a/docs/examples/import-configuration-and-send.md b/docs/examples/import-configuration-and-send.md index 8d0ce08..15e5714 100644 --- a/docs/examples/import-configuration-and-send.md +++ b/docs/examples/import-configuration-and-send.md @@ -35,7 +35,7 @@ import { Category, State, Predicate -} from 'alert-notification-client'; +} from '@sap_oss/alert-notification-client'; const client = new AlertNotificationClient({ authentication: new BasicAuthentication({ diff --git a/docs/examples/send-event-and-consume.md b/docs/examples/send-event-and-consume.md index 756ad38..64999ab 100644 --- a/docs/examples/send-event-and-consume.md +++ b/docs/examples/send-event-and-consume.md @@ -33,7 +33,7 @@ import { RegionUtils, State, Predicate -} from 'alert-notification-client'; +} from '@sap_oss/alert-notification-client'; const client = new AlertNotificationClient({ authentication: new BasicAuthentication({ diff --git a/docs/examples/setup-authentication.md b/docs/examples/setup-authentication.md index d54f90d..740743f 100644 --- a/docs/examples/setup-authentication.md +++ b/docs/examples/setup-authentication.md @@ -30,7 +30,7 @@ import { AlertNotificationClient, BasicAuthentication, RegionUtils -} from 'alert-notification-client'; +} from '@sap_oss/alert-notification-client'; const client = new AlertNotificationClient({ authentication: new BasicAuthentication({ @@ -54,7 +54,7 @@ import { AlertNotificationClient, OAuthAuthentication, RegionUtils -} from 'alert-notification-client'; +} from '@sap_oss/alert-notification-client'; const client = new AlertNotificationClient({ authentication: new OAuthAuthentication({ diff --git a/docs/examples/setup-retriability.md b/docs/examples/setup-retriability.md index 41fb6e2..63105ed 100644 --- a/docs/examples/setup-retriability.md +++ b/docs/examples/setup-retriability.md @@ -30,7 +30,7 @@ import { AlertNotificationClient, BasicAuthentication, RegionUtils -} from 'alert-notification-client'; +} from '@sap_oss/alert-notification-client'; const client = new AlertNotificationClient({ authentication: new BasicAuthentication({ diff --git a/docs/overview.md b/docs/overview.md index e96575d..a0c7af6 100644 --- a/docs/overview.md +++ b/docs/overview.md @@ -37,7 +37,7 @@ Furthermore, events can even be stored in Alert Notification storage and pulled Node package manager will be used in order to install SAP Cloud Platform Alert Notification client: ```bash -$ npm i alert-notification-client +$ npm i @sap_oss/alert-notification-client ``` ## Usage @@ -45,7 +45,7 @@ $ npm i alert-notification-client In order to use the client you will first have to import it and create an instance: ```js -import { AlertNotificationClient, RegionUtils, BasicAuthentication } from 'alert-notification-client'; +import { AlertNotificationClient, RegionUtils, BasicAuthentication } from '@sap_oss/alert-notification-client'; const client = new AlertNotificationClient({ authentication: new BasicAuthentication({ diff --git a/package-lock.json b/package-lock.json index 6b4fd97..e5d3ac8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "alert-notification-client", + "name": "@sap_oss/alert-notification-client", "version": "1.0.0", "lockfileVersion": 1, "requires": true, @@ -1623,9 +1623,9 @@ "dev": true }, "axios": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.20.0.tgz", - "integrity": "sha512-ANA4rr2BDcmmAQLOKft2fufrtuvlqR+cXNNinUmvfeSNCOF98PZL+7M/v1zIdGo7OLjEA9J2gXJL+j4zGsl0bA==", + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", "requires": { "follow-redirects": "^1.10.0" } @@ -3391,9 +3391,9 @@ "dev": true }, "follow-redirects": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz", - "integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==" + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.1.tgz", + "integrity": "sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==" }, "for-in": { "version": "1.0.2", diff --git a/package.json b/package.json index d95b355..fa70158 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "alert-notification-client", + "name": "@sap_oss/alert-notification-client", "version": "1.0.0", "description": "SAP Cloud Platform Alert Notification Node.js API client", "main": "dist/index.js", @@ -7,7 +7,7 @@ "scripts": { "test": "jest", "test:watch": "jest --watch", - "prepublishOnly": "npm run test && tsc", + "prepublishOnly": "npm run test && npm run lint && tsc", "lint": "eslint --ext .ts src/**", "lint:fix": "eslint --ext .ts --fix src/**" }, @@ -20,7 +20,7 @@ } }, "dependencies": { - "axios": "^0.20.0" + "axios": "^0.21.1" }, "devDependencies": { "@types/jest": "^26.0.14",