@arrowsphere/api-client 3.43.0-rc.ckh.1 → 3.43.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.
package/CHANGELOG.md CHANGED
@@ -3,11 +3,17 @@
3
3
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4
4
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
5
 
6
- ## [3.43.0] - 2023-06-30
6
+ ## [3.43.0] - 2023-07-04
7
7
 
8
8
  ### Changed
9
9
 
10
- - Add consumption download request
10
+ - Add arrowsphere price band sku
11
+
12
+ ## [3.42.0] - 2023-06-27
13
+
14
+ ### Changed
15
+
16
+ - Refactor url generation to allow complex origin url
11
17
 
12
18
  ## [3.41.0] - 2023-06-23
13
19
 
@@ -50,7 +50,11 @@ class AbstractGraphQLClient extends AbstractHttpClient_1.AbstractHttpClient {
50
50
  return await this.getClientInstance().request(query);
51
51
  }
52
52
  generateUrl() {
53
- const url = new URL(`${this.options.isAdmin ? path.join('admin', this.basePath) : this.basePath}${this.path}`, this.url);
53
+ const baseUrl = this.url.replace(new RegExp('/$'), '');
54
+ const basePath = this.options.isAdmin
55
+ ? path.join('/admin', this.basePath)
56
+ : this.basePath;
57
+ const url = new URL(`${baseUrl}${basePath}${this.path}`);
54
58
  return url.toString();
55
59
  }
56
60
  stringifyQuery(query) {
@@ -203,7 +203,11 @@ class AbstractRestfulClient extends AbstractHttpClient_1.AbstractHttpClient {
203
203
  */
204
204
  generateUrl(parameters, options) {
205
205
  const params = { ...parameters, ...this.generatePagination() };
206
- const url = new URL(`${options.isAdmin ? path_1.default.join('admin', this.basePath) : this.basePath}${this.path}`, this.url);
206
+ const baseUrl = this.url.replace(new RegExp('/$'), '');
207
+ const basePath = options.isAdmin
208
+ ? path_1.default.join('/admin', this.basePath)
209
+ : this.basePath;
210
+ const url = new URL(`${baseUrl}${basePath}${this.path}`);
207
211
  if (Object.values(params).length) {
208
212
  url.search = querystring_1.default.stringify(params);
209
213
  }
@@ -8,11 +8,11 @@ class CatalogGraphQLClient extends abstractGraphQLClient_1.AbstractGraphQLClient
8
8
  /**
9
9
  * The base path of the API
10
10
  */
11
- this.basePath = 'catalog/';
11
+ this.basePath = '/catalog';
12
12
  /**
13
13
  * The Path of graphql catalog API
14
14
  */
15
- this.GRAPHQL = 'graphql';
15
+ this.GRAPHQL = '/graphql';
16
16
  }
17
17
  async find(request) {
18
18
  this.path = this.GRAPHQL;
@@ -2,15 +2,6 @@ import { AbstractRestfulClient, Parameters } from '../abstractRestfulClient';
2
2
  import { ConsumptionBI } from './entities/bi/consumptionBI';
3
3
  import { GetResult } from '../getResult';
4
4
  import { Consumption } from './entities/consumption/consumption';
5
- import { ConsumptionDownloadRequest } from './entities/consumption/consumptionDownloadRequest';
6
- declare type ConsumptionDownloadRequestPayload = {
7
- customer: string;
8
- licenseRef: string;
9
- dateStart: string;
10
- dateEnd: string;
11
- columns: Array<string>;
12
- callbackURL: string;
13
- };
14
5
  export declare class ConsumptionClient extends AbstractRestfulClient {
15
6
  /**
16
7
  * The base path of the API
@@ -19,6 +10,4 @@ export declare class ConsumptionClient extends AbstractRestfulClient {
19
10
  getMonthlyConsumption(licenseReference: string, parameters: Parameters): Promise<GetResult<Consumption>>;
20
11
  getDailyConsumption(licenseReference: string, parameters: Parameters): Promise<GetResult<Consumption>>;
21
12
  getBIConsumption(parameters: Parameters): Promise<GetResult<ConsumptionBI>>;
22
- consumptionDownloadRequest(payload: ConsumptionDownloadRequestPayload): Promise<GetResult<ConsumptionDownloadRequest>>;
23
13
  }
24
- export {};
@@ -5,7 +5,6 @@ const abstractRestfulClient_1 = require("../abstractRestfulClient");
5
5
  const consumptionBI_1 = require("./entities/bi/consumptionBI");
6
6
  const getResult_1 = require("../getResult");
7
7
  const consumption_1 = require("./entities/consumption/consumption");
8
- const consumptionDownloadRequest_1 = require("./entities/consumption/consumptionDownloadRequest");
9
8
  class ConsumptionClient extends abstractRestfulClient_1.AbstractRestfulClient {
10
9
  constructor() {
11
10
  super(...arguments);
@@ -26,10 +25,6 @@ class ConsumptionClient extends abstractRestfulClient_1.AbstractRestfulClient {
26
25
  this.path = '/bi/top/monthly';
27
26
  return new getResult_1.GetResult(consumptionBI_1.ConsumptionBI, await this.get(parameters));
28
27
  }
29
- async consumptionDownloadRequest(payload) {
30
- this.path = '/v2/downloadRequest';
31
- return new getResult_1.GetResult(consumptionDownloadRequest_1.ConsumptionDownloadRequest, await this.post(payload));
32
- }
33
28
  }
34
29
  exports.ConsumptionClient = ConsumptionClient;
35
30
  //# sourceMappingURL=consumptionClient.js.map
@@ -2,5 +2,4 @@ export * from './entities/consumption/consumption';
2
2
  export * from './entities/bi/period/period';
3
3
  export * from './entities/bi/top/top';
4
4
  export * from './entities/bi/consumptionBI';
5
- export * from './entities/consumption/consumptionDownloadRequest';
6
5
  export * from './consumptionClient';
@@ -18,6 +18,5 @@ __exportStar(require("./entities/consumption/consumption"), exports);
18
18
  __exportStar(require("./entities/bi/period/period"), exports);
19
19
  __exportStar(require("./entities/bi/top/top"), exports);
20
20
  __exportStar(require("./entities/bi/consumptionBI"), exports);
21
- __exportStar(require("./entities/consumption/consumptionDownloadRequest"), exports);
22
21
  __exportStar(require("./consumptionClient"), exports);
23
22
  //# sourceMappingURL=index.js.map
@@ -115,11 +115,11 @@ class LicensesClient extends abstractRestfulClient_1.AbstractRestfulClient {
115
115
  /**
116
116
  * The base path of the API
117
117
  */
118
- this.basePath = '/licenses/';
118
+ this.basePath = '/licenses';
119
119
  /**
120
120
  * The path of the Find endpoint
121
121
  */
122
- this.FIND_PATH = 'v2/find';
122
+ this.FIND_PATH = '/v2/find';
123
123
  /**
124
124
  * The path of the Configs endpoint
125
125
  */
@@ -244,7 +244,7 @@ class LicensesClient extends abstractRestfulClient_1.AbstractRestfulClient {
244
244
  return new findResult_1.FindResult(response, this, rawLicensePayload, parameters);
245
245
  }
246
246
  getConfigsRaw(reference) {
247
- this.path = reference + this.CONFIGS_PATH;
247
+ this.path = `/${reference}${this.CONFIGS_PATH}`;
248
248
  return this.get();
249
249
  }
250
250
  async *getConfigs(reference) {
@@ -254,7 +254,7 @@ class LicensesClient extends abstractRestfulClient_1.AbstractRestfulClient {
254
254
  }
255
255
  }
256
256
  async updateConfigRaw(reference, config) {
257
- this.path = reference + this.CONFIGS_PATH;
257
+ this.path = `/${reference}${this.CONFIGS_PATH}`;
258
258
  const postData = {
259
259
  [configFindResult_1.ConfigFindResultFields.COLUMN_NAME]: config.name,
260
260
  [configFindResult_1.ConfigFindResultFields.COLUMN_SCOPE]: config.scope,
@@ -267,39 +267,39 @@ class LicensesClient extends abstractRestfulClient_1.AbstractRestfulClient {
267
267
  return new configFindResult_1.ConfigFindResult(rawResponse);
268
268
  }
269
269
  async getLicense(licenseReference, parameters = {}) {
270
- this.path = licenseReference;
270
+ this.path = `/${licenseReference}`;
271
271
  return new getResult_1.GetResult(getLicenseResult_1.GetLicenseResult, await this.get(parameters));
272
272
  }
273
273
  updateSeats(licenseReference, putData, parameters = {}) {
274
- this.path = licenseReference + this.SEATS_PATH;
274
+ this.path = `/${licenseReference}${this.SEATS_PATH}`;
275
275
  return this.put(putData, parameters);
276
276
  }
277
277
  suspendLicense(licenseReference, payload, parameters = {}) {
278
- this.path = licenseReference + this.SUSPEND_PATH;
278
+ this.path = `/${licenseReference}${this.SUSPEND_PATH}`;
279
279
  return this.put(payload, parameters);
280
280
  }
281
281
  reactivateLicense(licenseReference, payload, parameters = {}) {
282
- this.path = licenseReference + this.REACTIVATE_PATH;
282
+ this.path = `/${licenseReference}${this.REACTIVATE_PATH}`;
283
283
  return this.put(payload, parameters);
284
284
  }
285
285
  cancelLicense(licenseReference, payload, parameters = {}) {
286
- this.path = licenseReference + this.CANCEL_PATH;
286
+ this.path = `/${licenseReference}${this.CANCEL_PATH}`;
287
287
  return this.put(payload, parameters);
288
288
  }
289
289
  async updateFriendlyName(licenseReference, putData, parameters = {}) {
290
- this.path = licenseReference + this.UPDATE_FRIENDLYNAME_PATH;
290
+ this.path = `/${licenseReference}${this.UPDATE_FRIENDLYNAME_PATH}`;
291
291
  return await this.put(putData, parameters);
292
292
  }
293
293
  async getHistory(licenseReference, parameters = {}) {
294
- this.path = licenseReference + this.GET_LICENSE_HISTORY_PATH;
294
+ this.path = `/${licenseReference}${this.GET_LICENSE_HISTORY_PATH}`;
295
295
  return new getResult_1.GetResult(licenceHistoryResult_1.LicenceHistoryResult, await this.get(parameters));
296
296
  }
297
297
  async cancelAutoRenew(licenseReference, payload, parameters = {}) {
298
- this.path = licenseReference + this.CANCEL_AUTO_RENEW_PATH;
298
+ this.path = `/${licenseReference}${this.CANCEL_AUTO_RENEW_PATH}`;
299
299
  return await this.put(payload, parameters);
300
300
  }
301
301
  async reactivateAutoRenew(licenseReference, payload, parameters = {}) {
302
- this.path = licenseReference + this.REACTIVATE_AUTO_RENEW_PATH;
302
+ this.path = `/${licenseReference}${this.REACTIVATE_AUTO_RENEW_PATH}`;
303
303
  return await this.put(payload, parameters);
304
304
  }
305
305
  }
@@ -7,6 +7,7 @@ export declare enum CreateOrderInputFields {
7
7
  COLUMN_REFERENCE = "reference",
8
8
  COLUMN_PO_NUMBER = "ponumber",
9
9
  COLUMN_PRODUCTS = "products",
10
+ COLUMN_ARROW_SPHERE_PRICE_BAND_SKU = "arrowSpherePriceBandSku",
10
11
  COLUMN_SKU = "sku",
11
12
  COLUMN_QUANTITY = "quantity",
12
13
  COLUMN_SUBSCRIPTION = "subscription",
@@ -49,6 +50,7 @@ export declare type CreateOrderInputType = {
49
50
  [CreateOrderInputFields.COLUMN_SCENARIO]?: scenarioType;
50
51
  [CreateOrderInputFields.COLUMN_SCHEDULE_DATE]?: string;
51
52
  [CreateOrderInputFields.COLUMN_PRODUCTS]: Array<{
53
+ [CreateOrderInputFields.COLUMN_ARROW_SPHERE_PRICE_BAND_SKU]: string;
52
54
  [CreateOrderInputFields.COLUMN_SKU]: string;
53
55
  [CreateOrderInputFields.COLUMN_QUANTITY]: number;
54
56
  [CreateOrderInputFields.COLUMN_SUBSCRIPTION]?: {
@@ -11,6 +11,7 @@ var CreateOrderInputFields;
11
11
  CreateOrderInputFields["COLUMN_REFERENCE"] = "reference";
12
12
  CreateOrderInputFields["COLUMN_PO_NUMBER"] = "ponumber";
13
13
  CreateOrderInputFields["COLUMN_PRODUCTS"] = "products";
14
+ CreateOrderInputFields["COLUMN_ARROW_SPHERE_PRICE_BAND_SKU"] = "arrowSpherePriceBandSku";
14
15
  CreateOrderInputFields["COLUMN_SKU"] = "sku";
15
16
  CreateOrderInputFields["COLUMN_QUANTITY"] = "quantity";
16
17
  CreateOrderInputFields["COLUMN_SUBSCRIPTION"] = "subscription";
@@ -52,7 +53,7 @@ class OrdersClient extends abstractRestfulClient_1.AbstractRestfulClient {
52
53
  /**
53
54
  * The base path of the API
54
55
  */
55
- this.basePath = '/index.php/api/orders';
56
+ this.basePath = '/orders';
56
57
  }
57
58
  async create(postData, parameters = {}) {
58
59
  return new getResult_1.GetResult(referenceLink_1.ReferenceLink, await this.post(postData, parameters));
@@ -13,11 +13,11 @@ class SecurityScoreGraphQLClient extends abstractGraphQLClient_1.AbstractGraphQL
13
13
  /**
14
14
  * The base path of the API
15
15
  */
16
- this.basePath = 'security/';
16
+ this.basePath = '/security';
17
17
  /**
18
18
  * The Path of graphql catalog API
19
19
  */
20
- this.GRAPHQL = 'graphql/score';
20
+ this.GRAPHQL = '/graphql/score';
21
21
  }
22
22
  async find(request) {
23
23
  this.path = this.GRAPHQL;
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.43.0-rc.ckh.1",
7
+ "version": "3.43.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",
@@ -1,19 +0,0 @@
1
- import { AbstractEntity } from '../../../abstractEntity';
2
- export declare enum ConsumptionDownloadRequestFields {
3
- COLUMN_REF = "ref",
4
- COLUMN_LINK = "link",
5
- COLUMN_LINK_EXPIRATION_DATE = "linkExpirationDate"
6
- }
7
- export declare type ConsumptionDownloadRequestType = {
8
- [ConsumptionDownloadRequestFields.COLUMN_REF]: string;
9
- [ConsumptionDownloadRequestFields.COLUMN_LINK]: Array<string>;
10
- [ConsumptionDownloadRequestFields.COLUMN_LINK_EXPIRATION_DATE]: string;
11
- };
12
- export declare class ConsumptionDownloadRequest extends AbstractEntity<ConsumptionDownloadRequestType> {
13
- #private;
14
- constructor(consumptionResponse: ConsumptionDownloadRequestType);
15
- get ref(): string;
16
- get link(): Array<string>;
17
- get linkExpirationDate(): string;
18
- toJSON(): ConsumptionDownloadRequestType;
19
- }
@@ -1,53 +0,0 @@
1
- "use strict";
2
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
- if (kind === "m") throw new TypeError("Private method is not writable");
4
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
- };
8
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
- };
13
- var _ConsumptionDownloadRequest_ref, _ConsumptionDownloadRequest_link, _ConsumptionDownloadRequest_linkExpirationDate;
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.ConsumptionDownloadRequest = exports.ConsumptionDownloadRequestFields = void 0;
16
- const abstractEntity_1 = require("../../../abstractEntity");
17
- var ConsumptionDownloadRequestFields;
18
- (function (ConsumptionDownloadRequestFields) {
19
- ConsumptionDownloadRequestFields["COLUMN_REF"] = "ref";
20
- ConsumptionDownloadRequestFields["COLUMN_LINK"] = "link";
21
- ConsumptionDownloadRequestFields["COLUMN_LINK_EXPIRATION_DATE"] = "linkExpirationDate";
22
- })(ConsumptionDownloadRequestFields = exports.ConsumptionDownloadRequestFields || (exports.ConsumptionDownloadRequestFields = {}));
23
- class ConsumptionDownloadRequest extends abstractEntity_1.AbstractEntity {
24
- constructor(consumptionResponse) {
25
- super(consumptionResponse);
26
- _ConsumptionDownloadRequest_ref.set(this, void 0);
27
- _ConsumptionDownloadRequest_link.set(this, void 0);
28
- _ConsumptionDownloadRequest_linkExpirationDate.set(this, void 0);
29
- __classPrivateFieldSet(this, _ConsumptionDownloadRequest_ref, consumptionResponse[ConsumptionDownloadRequestFields.COLUMN_REF], "f");
30
- __classPrivateFieldSet(this, _ConsumptionDownloadRequest_link, consumptionResponse[ConsumptionDownloadRequestFields.COLUMN_LINK], "f");
31
- __classPrivateFieldSet(this, _ConsumptionDownloadRequest_linkExpirationDate, consumptionResponse[ConsumptionDownloadRequestFields.COLUMN_LINK_EXPIRATION_DATE], "f");
32
- }
33
- get ref() {
34
- return __classPrivateFieldGet(this, _ConsumptionDownloadRequest_ref, "f");
35
- }
36
- get link() {
37
- return __classPrivateFieldGet(this, _ConsumptionDownloadRequest_link, "f");
38
- }
39
- get linkExpirationDate() {
40
- return __classPrivateFieldGet(this, _ConsumptionDownloadRequest_linkExpirationDate, "f");
41
- }
42
- toJSON() {
43
- return {
44
- [ConsumptionDownloadRequestFields.COLUMN_REF]: this.ref,
45
- [ConsumptionDownloadRequestFields.COLUMN_LINK]: this.link,
46
- [ConsumptionDownloadRequestFields.COLUMN_LINK_EXPIRATION_DATE]: this
47
- .linkExpirationDate,
48
- };
49
- }
50
- }
51
- exports.ConsumptionDownloadRequest = ConsumptionDownloadRequest;
52
- _ConsumptionDownloadRequest_ref = new WeakMap(), _ConsumptionDownloadRequest_link = new WeakMap(), _ConsumptionDownloadRequest_linkExpirationDate = new WeakMap();
53
- //# sourceMappingURL=consumptionDownloadRequest.js.map