@arrowsphere/api-client 2.5.0 → 2.8.0

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 (45) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/build/abstractClient.js +2 -2
  3. package/build/abstractGraphQLClient.d.ts +27 -0
  4. package/build/abstractGraphQLClient.js +57 -0
  5. package/build/catalog/catalogGraphQLClient.d.ts +17 -0
  6. package/build/catalog/catalogGraphQLClient.js +28 -0
  7. package/build/catalog/index.d.ts +2 -0
  8. package/build/catalog/index.js +15 -0
  9. package/build/catalog/types/catalogGraphQLTypes.d.ts +224 -0
  10. package/build/catalog/types/catalogGraphQLTypes.js +3 -0
  11. package/build/customers/customersClient.d.ts +10 -0
  12. package/build/customers/customersClient.js +21 -0
  13. package/build/customers/entities/customers/contact/contact.d.ts +28 -0
  14. package/build/customers/entities/customers/contact/contact.js +77 -0
  15. package/build/customers/entities/customers/customer.d.ts +72 -0
  16. package/build/customers/entities/customers/customer.js +175 -0
  17. package/build/customers/entities/customers/details/details.d.ts +28 -0
  18. package/build/customers/entities/customers/details/details.js +75 -0
  19. package/build/customers/entities/dataCustomers.d.ts +14 -0
  20. package/build/customers/entities/dataCustomers.js +41 -0
  21. package/build/customers/index.d.ts +5 -0
  22. package/build/customers/index.js +18 -0
  23. package/build/exception/entityValidationException.d.ts +3 -1
  24. package/build/exception/entityValidationException.js +3 -1
  25. package/build/exception/notFoundException.d.ts +3 -1
  26. package/build/exception/notFoundException.js +3 -1
  27. package/build/exception/publicApiClientException.d.ts +3 -1
  28. package/build/exception/publicApiClientException.js +3 -1
  29. package/build/{licenses/entities/getResult.d.ts → getResult.d.ts} +7 -3
  30. package/build/{licenses/entities/getResult.js → getResult.js} +16 -5
  31. package/build/index.d.ts +5 -0
  32. package/build/index.js +5 -0
  33. package/build/licenses/entities/getLicense/licenseGetResult.d.ts +12 -0
  34. package/build/licenses/entities/getLicense/licenseGetResult.js +30 -2
  35. package/build/licenses/index.d.ts +0 -1
  36. package/build/licenses/index.js +0 -1
  37. package/build/licenses/licensesClient.d.ts +9 -1
  38. package/build/licenses/licensesClient.js +9 -1
  39. package/build/pagination.d.ts +28 -0
  40. package/build/pagination.js +75 -0
  41. package/build/publicApiClient.d.ts +6 -0
  42. package/build/publicApiClient.js +10 -0
  43. package/build/publicGraphQLClient.d.ts +5 -0
  44. package/build/publicGraphQLClient.js +12 -0
  45. package/package.json +3 -1
@@ -21,4 +21,3 @@ export * from '../licenses/entities/getLicense/licensePriceGetResult';
21
21
  export * from '../licenses/entities/getLicense/orderGetResult';
22
22
  export * from './entities/filterFindResult';
23
23
  export * from './entities/findResult';
24
- export * from './entities/getResult';
@@ -33,5 +33,4 @@ __exportStar(require("../licenses/entities/getLicense/licensePriceGetResult"), e
33
33
  __exportStar(require("../licenses/entities/getLicense/orderGetResult"), exports);
34
34
  __exportStar(require("./entities/filterFindResult"), exports);
35
35
  __exportStar(require("./entities/findResult"), exports);
36
- __exportStar(require("./entities/getResult"), exports);
37
36
  //# sourceMappingURL=index.js.map
@@ -11,7 +11,7 @@ import { PriceFindResultDataKeywords, PriceFindResutDataSortParameters } from '.
11
11
  import { OfferFindResultDataFiltersParameters, OfferFindResultDataKeywords, OfferFindResultDataSortParameters } from './entities/offer/offerFindResult';
12
12
  import { ActionFlagsFindResultDataKeywords, ActionFlagsFindResultDataSortParameters } from './entities/offer/actionFlagsFindResult';
13
13
  import { PriceBandFindResultDataKeywords, PriceBandFindResultDataSortParameters } from './entities/offer/priceBandFindResult';
14
- import { GetResult } from './entities/getResult';
14
+ import { GetResult } from '../getResult';
15
15
  import { LicenseGetFields } from './entities/getLicense/licenseGetResult';
16
16
  import { GetLicenseResult } from './entities/getResult/getLicenseResult';
17
17
  /**
@@ -184,6 +184,9 @@ export declare type LicenseFindRawPayload = {
184
184
  export declare type UpdateSeatsData = {
185
185
  [LicenseGetFields.COLUMN_SEATS]: number;
186
186
  };
187
+ export declare type PutFriendlyName = {
188
+ [LicenseGetFields.COLUMN_FRIENDLY_NAME]: string;
189
+ };
187
190
  export declare class LicensesClient extends AbstractClient {
188
191
  /**
189
192
  * The base path of the Licenses API
@@ -217,6 +220,10 @@ export declare class LicensesClient extends AbstractClient {
217
220
  * The path of cancel endpoint
218
221
  */
219
222
  private CANCEL_PATH;
223
+ /**
224
+ * The path of update friendlyName endpoint
225
+ */
226
+ private UPDATE_FRIENDLYNAME;
220
227
  /**
221
228
  * Returns the raw result from the find endpoint call
222
229
  *
@@ -247,4 +254,5 @@ export declare class LicensesClient extends AbstractClient {
247
254
  suspendLicense(licenseReference: string, parameters?: Parameters): Promise<void>;
248
255
  reactivateLicense(licenseReference: string, parameters?: Parameters): Promise<void>;
249
256
  cancelLicense(licenseReference: string, parameters?: Parameters): Promise<void>;
257
+ updateFriendlyName(licenseReference: string, putData: PutFriendlyName, parameters?: Parameters): Promise<void>;
250
258
  }
@@ -7,7 +7,7 @@ exports.LicensesClient = exports.LicenseFindParameters = void 0;
7
7
  const abstractClient_1 = require("../abstractClient");
8
8
  const findResult_1 = require("./entities/findResult");
9
9
  const configFindResult_1 = require("./entities/license/configFindResult");
10
- const getResult_1 = require("./entities/getResult");
10
+ const getResult_1 = require("../getResult");
11
11
  const licenseGetResult_1 = require("./entities/getLicense/licenseGetResult");
12
12
  const getLicenseResult_1 = require("./entities/getResult/getLicenseResult");
13
13
  /**
@@ -139,6 +139,10 @@ class LicensesClient extends abstractClient_1.AbstractClient {
139
139
  * The path of cancel endpoint
140
140
  */
141
141
  this.CANCEL_PATH = '/cancel';
142
+ /**
143
+ * The path of update friendlyName endpoint
144
+ */
145
+ this.UPDATE_FRIENDLYNAME = '/friendlyName';
142
146
  }
143
147
  /**
144
148
  * Returns the raw result from the find endpoint call
@@ -256,6 +260,10 @@ class LicensesClient extends abstractClient_1.AbstractClient {
256
260
  this.path = licenseReference + this.CANCEL_PATH;
257
261
  return this.put(undefined, parameters);
258
262
  }
263
+ async updateFriendlyName(licenseReference, putData, parameters = {}) {
264
+ this.path = licenseReference + this.UPDATE_FRIENDLYNAME;
265
+ return await this.put(putData, parameters);
266
+ }
259
267
  }
260
268
  exports.LicensesClient = LicensesClient;
261
269
  //# sourceMappingURL=licensesClient.js.map
@@ -0,0 +1,28 @@
1
+ import { AbstractEntity } from './abstractEntity';
2
+ export declare enum PaginationFields {
3
+ COLUMN_PER_PAGE = "per_page",
4
+ COLUMN_CURRENT_PAGE = "current_page",
5
+ COLUMN_TOTAL_PAGE = "total_page",
6
+ COLUMN_TOTAL = "total",
7
+ COLUMN_NEXT = "next",
8
+ COLUMN_PREVIOUS = "previous"
9
+ }
10
+ export declare type PaginationData = {
11
+ [PaginationFields.COLUMN_PER_PAGE]: number;
12
+ [PaginationFields.COLUMN_CURRENT_PAGE]: number;
13
+ [PaginationFields.COLUMN_TOTAL_PAGE]: number;
14
+ [PaginationFields.COLUMN_TOTAL]: number;
15
+ [PaginationFields.COLUMN_NEXT]: string | null;
16
+ [PaginationFields.COLUMN_PREVIOUS]: string | null;
17
+ };
18
+ export declare class Pagination extends AbstractEntity<PaginationData> {
19
+ #private;
20
+ constructor(paginationDataInput: PaginationData);
21
+ get perPage(): number;
22
+ get currentPage(): number;
23
+ get totalPage(): number;
24
+ get total(): number;
25
+ get next(): string | null;
26
+ get previous(): string | null;
27
+ toJSON(): PaginationData;
28
+ }
@@ -0,0 +1,75 @@
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 _perPage, _currentPage, _totalPage, _total, _next, _previous;
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Pagination = exports.PaginationFields = void 0;
18
+ const abstractEntity_1 = require("./abstractEntity");
19
+ var PaginationFields;
20
+ (function (PaginationFields) {
21
+ PaginationFields["COLUMN_PER_PAGE"] = "per_page";
22
+ PaginationFields["COLUMN_CURRENT_PAGE"] = "current_page";
23
+ PaginationFields["COLUMN_TOTAL_PAGE"] = "total_page";
24
+ PaginationFields["COLUMN_TOTAL"] = "total";
25
+ PaginationFields["COLUMN_NEXT"] = "next";
26
+ PaginationFields["COLUMN_PREVIOUS"] = "previous";
27
+ })(PaginationFields = exports.PaginationFields || (exports.PaginationFields = {}));
28
+ class Pagination extends abstractEntity_1.AbstractEntity {
29
+ constructor(paginationDataInput) {
30
+ super(paginationDataInput);
31
+ _perPage.set(this, void 0);
32
+ _currentPage.set(this, void 0);
33
+ _totalPage.set(this, void 0);
34
+ _total.set(this, void 0);
35
+ _next.set(this, void 0);
36
+ _previous.set(this, void 0);
37
+ __classPrivateFieldSet(this, _perPage, paginationDataInput[PaginationFields.COLUMN_PER_PAGE]);
38
+ __classPrivateFieldSet(this, _currentPage, paginationDataInput[PaginationFields.COLUMN_CURRENT_PAGE]);
39
+ __classPrivateFieldSet(this, _totalPage, paginationDataInput[PaginationFields.COLUMN_TOTAL_PAGE]);
40
+ __classPrivateFieldSet(this, _total, paginationDataInput[PaginationFields.COLUMN_TOTAL]);
41
+ __classPrivateFieldSet(this, _next, paginationDataInput[PaginationFields.COLUMN_NEXT]);
42
+ __classPrivateFieldSet(this, _previous, paginationDataInput[PaginationFields.COLUMN_PREVIOUS]);
43
+ }
44
+ get perPage() {
45
+ return __classPrivateFieldGet(this, _perPage);
46
+ }
47
+ get currentPage() {
48
+ return __classPrivateFieldGet(this, _currentPage);
49
+ }
50
+ get totalPage() {
51
+ return __classPrivateFieldGet(this, _totalPage);
52
+ }
53
+ get total() {
54
+ return __classPrivateFieldGet(this, _total);
55
+ }
56
+ get next() {
57
+ return __classPrivateFieldGet(this, _next);
58
+ }
59
+ get previous() {
60
+ return __classPrivateFieldGet(this, _previous);
61
+ }
62
+ toJSON() {
63
+ return {
64
+ [PaginationFields.COLUMN_PER_PAGE]: this.perPage,
65
+ [PaginationFields.COLUMN_CURRENT_PAGE]: this.currentPage,
66
+ [PaginationFields.COLUMN_TOTAL_PAGE]: this.totalPage,
67
+ [PaginationFields.COLUMN_TOTAL]: this.total,
68
+ [PaginationFields.COLUMN_NEXT]: this.next,
69
+ [PaginationFields.COLUMN_PREVIOUS]: this.previous,
70
+ };
71
+ }
72
+ }
73
+ exports.Pagination = Pagination;
74
+ _perPage = new WeakMap(), _currentPage = new WeakMap(), _totalPage = new WeakMap(), _total = new WeakMap(), _next = new WeakMap(), _previous = new WeakMap();
75
+ //# sourceMappingURL=pagination.js.map
@@ -2,11 +2,17 @@ import { AbstractClient } from './abstractClient';
2
2
  import { CheckDomainClient, WhoAmIClient } from './general';
3
3
  import { LicensesClient } from './licenses/licensesClient';
4
4
  import { SubscriptionsClient } from './subscriptions/subscriptionsClient';
5
+ import { CustomersClient } from './customers/customersClient';
5
6
  /**
6
7
  * Public API Client class, should be the main entry point for your calls
7
8
  */
8
9
  export declare class PublicApiClient extends AbstractClient {
9
10
  constructor();
11
+ /**
12
+ * Creates a new {@link CustomersClient} instance and returns it
13
+ * @returns {@link CustomersClient}
14
+ */
15
+ getCustomersClient(): CustomersClient;
10
16
  /**
11
17
  * Creates a new {@link WhoAmIClient} instance and returns it
12
18
  * @returns {@link WhoAmIClient}
@@ -5,6 +5,7 @@ const abstractClient_1 = require("./abstractClient");
5
5
  const general_1 = require("./general");
6
6
  const licensesClient_1 = require("./licenses/licensesClient");
7
7
  const subscriptionsClient_1 = require("./subscriptions/subscriptionsClient");
8
+ const customersClient_1 = require("./customers/customersClient");
8
9
  /**
9
10
  * Public API Client class, should be the main entry point for your calls
10
11
  */
@@ -12,6 +13,15 @@ class PublicApiClient extends abstractClient_1.AbstractClient {
12
13
  constructor() {
13
14
  super();
14
15
  }
16
+ /**
17
+ * Creates a new {@link CustomersClient} instance and returns it
18
+ * @returns {@link CustomersClient}
19
+ */
20
+ getCustomersClient() {
21
+ return new customersClient_1.CustomersClient(this.client)
22
+ .setUrl(this.url)
23
+ .setApiKey(this.apiKey);
24
+ }
15
25
  /**
16
26
  * Creates a new {@link WhoAmIClient} instance and returns it
17
27
  * @returns {@link WhoAmIClient}
@@ -0,0 +1,5 @@
1
+ import { CatalogGraphQLClient } from './catalog/catalogGraphQLClient';
2
+ import { AbstractGraphQLClient } from './abstractGraphQLClient';
3
+ export declare class PublicGraphQLClient extends AbstractGraphQLClient {
4
+ getCatalogGraphQLClient(): CatalogGraphQLClient;
5
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PublicGraphQLClient = void 0;
4
+ const catalogGraphQLClient_1 = require("./catalog/catalogGraphQLClient");
5
+ const abstractGraphQLClient_1 = require("./abstractGraphQLClient");
6
+ class PublicGraphQLClient extends abstractGraphQLClient_1.AbstractGraphQLClient {
7
+ getCatalogGraphQLClient() {
8
+ return new catalogGraphQLClient_1.CatalogGraphQLClient().setUrl(this.url).setToken(this.token);
9
+ }
10
+ }
11
+ exports.PublicGraphQLClient = PublicGraphQLClient;
12
+ //# sourceMappingURL=publicGraphQLClient.js.map
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": "2.5.0",
7
+ "version": "2.8.0",
8
8
  "description": "Node.js client for ArrowSphere's public API",
9
9
  "main": "build/index.js",
10
10
  "types": "build/index.d.ts",
@@ -80,6 +80,8 @@
80
80
  "dependencies": {
81
81
  "@types/validatorjs": "3.15.0",
82
82
  "axios": "0.21.1",
83
+ "graphql": "^16.3.0",
84
+ "graphql-request": "^4.0.0",
83
85
  "validatorjs": "3.22.1"
84
86
  }
85
87
  }