@arrowsphere/api-client 3.17.0-rc.1 → 3.17.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/build/abstractClient.js +27 -0
  2. package/build/index.d.ts +2 -1
  3. package/build/index.js +2 -1
  4. package/build/publicApiClient.d.ts +4 -2
  5. package/build/publicApiClient.js +9 -2
  6. package/build/security/index.d.ts +2 -0
  7. package/build/security/index.js +15 -0
  8. package/build/security/register/entity/registrationLink.d.ts +13 -0
  9. package/build/security/register/entity/registrationLink.js +40 -0
  10. package/build/security/register/index.d.ts +2 -0
  11. package/build/security/register/index.js +15 -0
  12. package/build/security/register/registerClient.d.ts +13 -0
  13. package/build/security/register/registerClient.js +33 -0
  14. package/build/{standards → security/standards}/entities/checks/checks.d.ts +1 -1
  15. package/build/{standards → security/standards}/entities/checks/checks.js +1 -1
  16. package/build/{standards → security/standards}/entities/checks/securityChecks.d.ts +1 -1
  17. package/build/{standards → security/standards}/entities/checks/securityChecks.js +1 -1
  18. package/build/{standards → security/standards}/entities/resources/resources.d.ts +1 -1
  19. package/build/{standards → security/standards}/entities/resources/resources.js +1 -1
  20. package/build/{standards → security/standards}/entities/resources/securityResources.d.ts +1 -1
  21. package/build/{standards → security/standards}/entities/resources/securityResources.js +1 -1
  22. package/build/{standards → security/standards}/entities/standards/securityStandards.d.ts +1 -1
  23. package/build/{standards → security/standards}/entities/standards/securityStandards.js +1 -1
  24. package/build/{standards → security/standards}/entities/standards/standards.d.ts +1 -1
  25. package/build/{standards → security/standards}/entities/standards/standards.js +1 -1
  26. package/build/{standards → security/standards}/index.d.ts +0 -0
  27. package/build/{standards → security/standards}/index.js +0 -0
  28. package/build/{standards → security/standards}/standardsClient.d.ts +2 -2
  29. package/build/{standards → security/standards}/standardsClient.js +2 -2
  30. package/package.json +1 -1
@@ -63,6 +63,14 @@ class AbstractClient {
63
63
  this.client = client !== null && client !== void 0 ? client : axios_1.default.create();
64
64
  // Prevent axios from throwing its own errors, let us do that
65
65
  this.client.defaults.validateStatus = null;
66
+ this.client.interceptors.request.use((request) => {
67
+ console.log('AXIOS - Starting Request : ', JSON.stringify(request, null, 2));
68
+ return request;
69
+ });
70
+ this.client.interceptors.response.use((response) => {
71
+ console.log('AXIOS - Response : ', JSON.stringify(response, null, 2));
72
+ return response;
73
+ });
66
74
  }
67
75
  /**
68
76
  * Sets the Client ArrowSphere API key
@@ -124,9 +132,13 @@ class AbstractClient {
124
132
  * @returns Promise\<AxiosResponse['data']\>
125
133
  */
126
134
  async get(parameters = {}, headers = {}, options = {}) {
135
+ console.log('GET parameters', parameters);
136
+ console.log('GET options', options);
137
+ console.log('GET Header', headers);
127
138
  const response = await this.client.get(this.generateUrl(parameters, options), {
128
139
  headers: this.prepareHeaders(headers),
129
140
  });
141
+ console.log('GET Response', response);
130
142
  return this.getResponse(response);
131
143
  }
132
144
  /**
@@ -165,9 +177,14 @@ class AbstractClient {
165
177
  * @param options - Options to send
166
178
  */
167
179
  async post(payload = {}, parameters = {}, headers = {}, options = {}) {
180
+ console.log('POST parameters', parameters);
181
+ console.log('POST options', options);
182
+ console.log('POST payload', payload);
183
+ console.log('POST Header', headers);
168
184
  const response = await this.client.post(this.generateUrl(parameters, options), payload, {
169
185
  headers: this.prepareHeaders(headers),
170
186
  });
187
+ console.log('POST Response', response);
171
188
  return this.getResponse(response);
172
189
  }
173
190
  /**
@@ -179,9 +196,14 @@ class AbstractClient {
179
196
  * @returns Promise\<void\>
180
197
  */
181
198
  async put(payload = {}, parameters = {}, headers = {}, options = {}) {
199
+ console.log('PUT parameters', parameters);
200
+ console.log('PUT options', options);
201
+ console.log('PUT payload', payload);
202
+ console.log('PUT Header', headers);
182
203
  const response = await this.client.put(this.generateUrl(parameters, options), payload, {
183
204
  headers: this.prepareHeaders(headers),
184
205
  });
206
+ console.log('PUT Response', response);
185
207
  return this.getResponse(response);
186
208
  }
187
209
  /**
@@ -193,9 +215,14 @@ class AbstractClient {
193
215
  * @returns Promise\<T\>
194
216
  */
195
217
  async patch(payload = {}, parameters = {}, headers = {}, options = {}) {
218
+ console.log('PATCH parameters', parameters);
219
+ console.log('PATCH options', options);
220
+ console.log('PATCH payload', payload);
221
+ console.log('PATCH Header', headers);
196
222
  const response = await this.client.patch(this.generateUrl(parameters, options), payload, {
197
223
  headers: this.prepareHeaders(headers),
198
224
  });
225
+ console.log('PATCH Response', response);
199
226
  return this.getResponse(response);
200
227
  }
201
228
  /**
package/build/index.d.ts CHANGED
@@ -8,12 +8,13 @@ export * from './customers/';
8
8
  export * from './exception/';
9
9
  export * from './general/';
10
10
  export * from './getResult';
11
+ export * from './pagination';
11
12
  export * from './licenses/';
12
13
  export * from './orders/';
13
14
  export * from './publicApiClient';
14
15
  export * from './publicGraphQLClient';
15
16
  export * from './shared/';
16
- export * from './standards/';
17
+ export * from './security/';
17
18
  export * from './subscriptions/';
18
19
  export { ContactInformation };
19
20
  import * as ContactInformation from './contact';
package/build/index.js CHANGED
@@ -33,12 +33,13 @@ __exportStar(require("./customers/"), exports);
33
33
  __exportStar(require("./exception/"), exports);
34
34
  __exportStar(require("./general/"), exports);
35
35
  __exportStar(require("./getResult"), exports);
36
+ __exportStar(require("./pagination"), exports);
36
37
  __exportStar(require("./licenses/"), exports);
37
38
  __exportStar(require("./orders/"), exports);
38
39
  __exportStar(require("./publicApiClient"), exports);
39
40
  __exportStar(require("./publicGraphQLClient"), exports);
40
41
  __exportStar(require("./shared/"), exports);
41
- __exportStar(require("./standards/"), exports);
42
+ __exportStar(require("./security/"), exports);
42
43
  __exportStar(require("./subscriptions/"), exports);
43
44
  const ContactInformation = __importStar(require("./contact"));
44
45
  exports.ContactInformation = ContactInformation;
@@ -7,7 +7,8 @@ import { OrdersClient } from './orders';
7
7
  import { ContactClient } from './contact';
8
8
  import { CampaignClient } from './campaign';
9
9
  import { ConsumptionClient } from './consumption';
10
- import { StandardsClient } from './standards/standardsClient';
10
+ import { StandardsClient } from './security/standards/standardsClient';
11
+ import { RegisterClient } from './security';
11
12
  /**
12
13
  * Public API Client class, should be the main entry point for your calls
13
14
  */
@@ -54,6 +55,7 @@ export declare class PublicApiClient extends AbstractClient {
54
55
  */
55
56
  getCampaignClient(): CampaignClient;
56
57
  getConsumptionClient(): ConsumptionClient;
57
- getStandardsClient(): StandardsClient;
58
+ getSecurityStandardsClient(): StandardsClient;
59
+ getSecurityRegisterClient(): RegisterClient;
58
60
  }
59
61
  export default PublicApiClient;
@@ -10,7 +10,8 @@ const orders_1 = require("./orders");
10
10
  const contact_1 = require("./contact");
11
11
  const campaign_1 = require("./campaign");
12
12
  const consumption_1 = require("./consumption");
13
- const standardsClient_1 = require("./standards/standardsClient");
13
+ const standardsClient_1 = require("./security/standards/standardsClient");
14
+ const security_1 = require("./security");
14
15
  /**
15
16
  * Public API Client class, should be the main entry point for your calls
16
17
  */
@@ -104,12 +105,18 @@ class PublicApiClient extends abstractClient_1.AbstractClient {
104
105
  .setApiKey(this.apiKey)
105
106
  .setHeaders(this.headers);
106
107
  }
107
- getStandardsClient() {
108
+ getSecurityStandardsClient() {
108
109
  return new standardsClient_1.StandardsClient(this.client)
109
110
  .setUrl(this.url)
110
111
  .setApiKey(this.apiKey)
111
112
  .setHeaders(this.headers);
112
113
  }
114
+ getSecurityRegisterClient() {
115
+ return new security_1.RegisterClient(this.client)
116
+ .setUrl(this.url)
117
+ .setApiKey(this.apiKey)
118
+ .setHeaders(this.headers);
119
+ }
113
120
  }
114
121
  exports.PublicApiClient = PublicApiClient;
115
122
  exports.default = PublicApiClient;
@@ -0,0 +1,2 @@
1
+ export * from './register';
2
+ export * from './standards';
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./register"), exports);
14
+ __exportStar(require("./standards"), exports);
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,13 @@
1
+ import { AbstractEntity } from '../../../abstractEntity';
2
+ export declare enum RegistrationLinkFields {
3
+ COLUMN_REGISTRATION_LINK = "registrationLink"
4
+ }
5
+ export declare type RegistrationLinkType = {
6
+ [RegistrationLinkFields.COLUMN_REGISTRATION_LINK]: string;
7
+ };
8
+ export declare class RegistrationLink extends AbstractEntity<RegistrationLinkType> {
9
+ #private;
10
+ constructor(registrationLinkInput: RegistrationLinkType);
11
+ get registrationLink(): string;
12
+ toJSON(): RegistrationLinkType;
13
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
3
+ if (!privateMap.has(receiver)) {
4
+ throw new TypeError("attempted to set private field on non-instance");
5
+ }
6
+ privateMap.set(receiver, value);
7
+ return value;
8
+ };
9
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
10
+ if (!privateMap.has(receiver)) {
11
+ throw new TypeError("attempted to get private field on non-instance");
12
+ }
13
+ return privateMap.get(receiver);
14
+ };
15
+ var _registrationLink;
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.RegistrationLink = exports.RegistrationLinkFields = void 0;
18
+ const abstractEntity_1 = require("../../../abstractEntity");
19
+ var RegistrationLinkFields;
20
+ (function (RegistrationLinkFields) {
21
+ RegistrationLinkFields["COLUMN_REGISTRATION_LINK"] = "registrationLink";
22
+ })(RegistrationLinkFields = exports.RegistrationLinkFields || (exports.RegistrationLinkFields = {}));
23
+ class RegistrationLink extends abstractEntity_1.AbstractEntity {
24
+ constructor(registrationLinkInput) {
25
+ super(registrationLinkInput);
26
+ _registrationLink.set(this, void 0);
27
+ __classPrivateFieldSet(this, _registrationLink, registrationLinkInput[RegistrationLinkFields.COLUMN_REGISTRATION_LINK]);
28
+ }
29
+ get registrationLink() {
30
+ return __classPrivateFieldGet(this, _registrationLink);
31
+ }
32
+ toJSON() {
33
+ return {
34
+ [RegistrationLinkFields.COLUMN_REGISTRATION_LINK]: this.registrationLink,
35
+ };
36
+ }
37
+ }
38
+ exports.RegistrationLink = RegistrationLink;
39
+ _registrationLink = new WeakMap();
40
+ //# sourceMappingURL=registrationLink.js.map
@@ -0,0 +1,2 @@
1
+ export * from './entity/registrationLink';
2
+ export * from './registerClient';
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./entity/registrationLink"), exports);
14
+ __exportStar(require("./registerClient"), exports);
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,13 @@
1
+ import { AbstractClient, Parameters } from '../../abstractClient';
2
+ import { GetResult } from '../../getResult';
3
+ import { RegistrationLink } from './entity/registrationLink';
4
+ export declare class RegisterClient extends AbstractClient {
5
+ /**
6
+ * The base path of the API
7
+ */
8
+ protected basePath: string;
9
+ register(subscriptionReference: string, parameters?: Parameters): Promise<GetResult<RegistrationLink>>;
10
+ deregister(subscriptionReference: string, parameters?: Parameters): Promise<void>;
11
+ checkRegister(subscriptionReference: string, parameters?: Parameters): Promise<void>;
12
+ triggerAsynchronousUpdate(subscriptionReference: string, parameters?: Parameters): Promise<void>;
13
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RegisterClient = void 0;
4
+ const abstractClient_1 = require("../../abstractClient");
5
+ const getResult_1 = require("../../getResult");
6
+ const registrationLink_1 = require("./entity/registrationLink");
7
+ class RegisterClient extends abstractClient_1.AbstractClient {
8
+ constructor() {
9
+ super(...arguments);
10
+ /**
11
+ * The base path of the API
12
+ */
13
+ this.basePath = '/security';
14
+ }
15
+ async register(subscriptionReference, parameters = {}) {
16
+ this.path = `/${subscriptionReference}/register`;
17
+ return new getResult_1.GetResult(registrationLink_1.RegistrationLink, await this.post(parameters));
18
+ }
19
+ async deregister(subscriptionReference, parameters = {}) {
20
+ this.path = `/${subscriptionReference}/deregister`;
21
+ return await this.post(parameters);
22
+ }
23
+ async checkRegister(subscriptionReference, parameters = {}) {
24
+ this.path = `/${subscriptionReference}/register/check`;
25
+ return await this.get(parameters);
26
+ }
27
+ async triggerAsynchronousUpdate(subscriptionReference, parameters = {}) {
28
+ this.path = `/${subscriptionReference}/update`;
29
+ return await this.post(parameters);
30
+ }
31
+ }
32
+ exports.RegisterClient = RegisterClient;
33
+ //# sourceMappingURL=registerClient.js.map
@@ -1,4 +1,4 @@
1
- import { AbstractEntity } from '../../../abstractEntity';
1
+ import { AbstractEntity } from '../../../../abstractEntity';
2
2
  import { SecurityChecks, SecurityChecksType } from './securityChecks';
3
3
  export declare enum ChecksFields {
4
4
  COLUMN_CHECKS = "checks",
@@ -15,7 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
15
15
  var _checks, _updatedAt;
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.Checks = exports.ChecksFields = void 0;
18
- const abstractEntity_1 = require("../../../abstractEntity");
18
+ const abstractEntity_1 = require("../../../../abstractEntity");
19
19
  const securityChecks_1 = require("./securityChecks");
20
20
  var ChecksFields;
21
21
  (function (ChecksFields) {
@@ -1,4 +1,4 @@
1
- import { AbstractEntity } from '../../../abstractEntity';
1
+ import { AbstractEntity } from '../../../../abstractEntity';
2
2
  export declare enum SecurityChecksFields {
3
3
  COLUMN_DESCRIPTION = "description",
4
4
  COLUMN_FLAGGED = "flagged",
@@ -15,7 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
15
15
  var _description, _flagged, _isFailed, _metadata, _name, _processed, _reference, _score, _severity;
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.SecurityChecks = exports.SecurityChecksFields = void 0;
18
- const abstractEntity_1 = require("../../../abstractEntity");
18
+ const abstractEntity_1 = require("../../../../abstractEntity");
19
19
  var SecurityChecksFields;
20
20
  (function (SecurityChecksFields) {
21
21
  SecurityChecksFields["COLUMN_DESCRIPTION"] = "description";
@@ -1,4 +1,4 @@
1
- import { AbstractEntity } from '../../../abstractEntity';
1
+ import { AbstractEntity } from '../../../../abstractEntity';
2
2
  import { SecurityResources, SecurityResourcesType } from './securityResources';
3
3
  export declare enum ResourcesFields {
4
4
  COLUMN_DESCRIPTION = "description",
@@ -15,7 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
15
15
  var _description, _metadata, _name, _resources, _updatedAt;
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.Resources = exports.ResourcesFields = void 0;
18
- const abstractEntity_1 = require("../../../abstractEntity");
18
+ const abstractEntity_1 = require("../../../../abstractEntity");
19
19
  const securityResources_1 = require("./securityResources");
20
20
  var ResourcesFields;
21
21
  (function (ResourcesFields) {
@@ -1,4 +1,4 @@
1
- import { AbstractEntity } from '../../../abstractEntity';
1
+ import { AbstractEntity } from '../../../../abstractEntity';
2
2
  export declare enum SecurityResourcesFields {
3
3
  COLUMN_STATUS = "status",
4
4
  COLUMN_VALUES = "values"
@@ -15,7 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
15
15
  var _status, _values;
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.SecurityResources = exports.SecurityResourcesFields = void 0;
18
- const abstractEntity_1 = require("../../../abstractEntity");
18
+ const abstractEntity_1 = require("../../../../abstractEntity");
19
19
  var SecurityResourcesFields;
20
20
  (function (SecurityResourcesFields) {
21
21
  SecurityResourcesFields["COLUMN_STATUS"] = "status";
@@ -1,4 +1,4 @@
1
- import { AbstractEntity } from '../../../abstractEntity';
1
+ import { AbstractEntity } from '../../../../abstractEntity';
2
2
  export declare enum SecurityStandardsFields {
3
3
  COLUMN_FAILED = "failed",
4
4
  COLUMN_NAME = "name",
@@ -15,7 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
15
15
  var _failed, _name, _passed, _reference, _score, _total;
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.SecurityStandards = exports.SecurityStandardsFields = void 0;
18
- const abstractEntity_1 = require("../../../abstractEntity");
18
+ const abstractEntity_1 = require("../../../../abstractEntity");
19
19
  var SecurityStandardsFields;
20
20
  (function (SecurityStandardsFields) {
21
21
  SecurityStandardsFields["COLUMN_FAILED"] = "failed";
@@ -1,4 +1,4 @@
1
- import { AbstractEntity } from '../../../abstractEntity';
1
+ import { AbstractEntity } from '../../../../abstractEntity';
2
2
  import { SecurityStandards, SecurityStandardsType } from './securityStandards';
3
3
  export declare enum StandardsFields {
4
4
  COLUMN_STANDARDS = "standards",
@@ -15,7 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
15
15
  var _standards, _updatedAt;
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.Standards = exports.StandardsFields = void 0;
18
- const abstractEntity_1 = require("../../../abstractEntity");
18
+ const abstractEntity_1 = require("../../../../abstractEntity");
19
19
  const securityStandards_1 = require("./securityStandards");
20
20
  var StandardsFields;
21
21
  (function (StandardsFields) {
File without changes
@@ -1,6 +1,6 @@
1
- import { AbstractClient, Parameters } from '../abstractClient';
1
+ import { AbstractClient, Parameters } from '../../abstractClient';
2
2
  import { Standards } from './entities/standards/standards';
3
- import { GetResult } from '../getResult';
3
+ import { GetResult } from '../../getResult';
4
4
  import { Checks } from './entities/checks/checks';
5
5
  import { Resources } from './entities/resources/resources';
6
6
  export declare class StandardsClient extends AbstractClient {
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StandardsClient = void 0;
4
- const abstractClient_1 = require("../abstractClient");
4
+ const abstractClient_1 = require("../../abstractClient");
5
5
  const standards_1 = require("./entities/standards/standards");
6
- const getResult_1 = require("../getResult");
6
+ const getResult_1 = require("../../getResult");
7
7
  const checks_1 = require("./entities/checks/checks");
8
8
  const resources_1 = require("./entities/resources/resources");
9
9
  class StandardsClient extends abstractClient_1.AbstractClient {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/ArrowSphere/nodejs-api-client.git"
6
6
  },
7
- "version": "3.17.0-rc.1",
7
+ "version": "3.17.0-rc.2",
8
8
  "description": "Node.js client for ArrowSphere's public API",
9
9
  "main": "build/index.js",
10
10
  "types": "build/index.d.ts",