@arrowsphere/api-client 2.2.0 → 2.5.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,6 +3,33 @@
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
+ ## [2.5.0] - 2022-02-14
7
+
8
+ ### Added
9
+
10
+ - Add endpoint cancel license
11
+
12
+ ## [2.4.0] - 2022-02-11
13
+
14
+ ### Added
15
+
16
+ - Add endpoint reactivate license
17
+
18
+ ## [2.3.0] - 2022-02-11
19
+
20
+ ### Added
21
+
22
+ - Add endpoint suspend license
23
+
24
+ ## [2.2.1] - 2022-02-10
25
+
26
+ ### Added
27
+
28
+ - Fixed Class GetResult
29
+ - Add Class GetLicenseResult for intermediate level between GetResult Class and LicenseGetResult
30
+ - Refactoring of Units Tests
31
+ - Refactoring names of variable in class LicenseGetResult
32
+
6
33
  ## [2.2.0] - 2022-01-04
7
34
 
8
35
  ### Added
@@ -3,6 +3,7 @@ import { ErrorMessages, Rules } from 'validatorjs';
3
3
  * Class AbstractEntity
4
4
  */
5
5
  export declare abstract class AbstractEntity<T> {
6
+ #private;
6
7
  protected VALIDATION_RULES: Rules;
7
8
  protected VALIDATION_MESSAGES: ErrorMessages;
8
9
  /**
@@ -14,6 +15,7 @@ export declare abstract class AbstractEntity<T> {
14
15
  * @param data - Data that will be used in the Entity
15
16
  */
16
17
  protected constructor(data: T);
18
+ get entityDataInput(): T;
17
19
  /**
18
20
  * Checks whether or not the entity data passes the validation rules
19
21
  * @param data - Data to validate
@@ -1,7 +1,21 @@
1
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
+ };
2
15
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
16
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
17
  };
18
+ var _entityDataInput;
5
19
  Object.defineProperty(exports, "__esModule", { value: true });
6
20
  exports.AbstractEntity = void 0;
7
21
  const validatorjs_1 = __importDefault(require("validatorjs"));
@@ -15,6 +29,7 @@ class AbstractEntity {
15
29
  * @param data - Data that will be used in the Entity
16
30
  */
17
31
  constructor(data) {
32
+ _entityDataInput.set(this, void 0);
18
33
  this.VALIDATION_RULES = {};
19
34
  this.VALIDATION_MESSAGES = {};
20
35
  /**
@@ -22,6 +37,10 @@ class AbstractEntity {
22
37
  */
23
38
  this.enableValidation = false;
24
39
  this.validate(data);
40
+ __classPrivateFieldSet(this, _entityDataInput, data);
41
+ }
42
+ get entityDataInput() {
43
+ return __classPrivateFieldGet(this, _entityDataInput);
25
44
  }
26
45
  /**
27
46
  * Checks whether or not the entity data passes the validation rules
@@ -49,4 +68,5 @@ class AbstractEntity {
49
68
  }
50
69
  }
51
70
  exports.AbstractEntity = AbstractEntity;
71
+ _entityDataInput = new WeakMap();
52
72
  //# sourceMappingURL=abstractEntity.js.map
@@ -62,7 +62,7 @@ export declare type LicenseGetData = {
62
62
  };
63
63
  export declare class LicenseGetResult extends AbstractEntity<LicenseGetData> {
64
64
  #private;
65
- constructor(data: LicenseGetData);
65
+ constructor(licenseGetDataInput: LicenseGetData);
66
66
  get id(): string;
67
67
  get parentLicenseId(): string | null;
68
68
  get friendlyName(): string | null;
@@ -51,9 +51,9 @@ var LicenseGetFields;
51
51
  LicenseGetFields["COLUMN_ARROW_SUB_CATEGORIES"] = "arrowSubCategories";
52
52
  })(LicenseGetFields = exports.LicenseGetFields || (exports.LicenseGetFields = {}));
53
53
  class LicenseGetResult extends abstractEntity_1.AbstractEntity {
54
- constructor(data) {
54
+ constructor(licenseGetDataInput) {
55
55
  var _a;
56
- super(data);
56
+ super(licenseGetDataInput);
57
57
  _license_id.set(this, void 0);
58
58
  _parent_license_id.set(this, void 0);
59
59
  _friendlyName.set(this, void 0);
@@ -80,34 +80,34 @@ class LicenseGetResult extends abstractEntity_1.AbstractEntity {
80
80
  _associatedSubscriptionProgram.set(this, void 0);
81
81
  _price.set(this, void 0);
82
82
  _arrowSubCategories.set(this, void 0);
83
- __classPrivateFieldSet(this, _license_id, data[LicenseGetFields.COLUMN_LICENSE_ID]);
84
- __classPrivateFieldSet(this, _parent_license_id, data[LicenseGetFields.COLUMN_PARENT_LICENSE_ID]);
85
- __classPrivateFieldSet(this, _friendlyName, data[LicenseGetFields.COLUMN_FRIENDLY_NAME]);
86
- __classPrivateFieldSet(this, _customer_ref, data[LicenseGetFields.COLUMN_CUSTOMER_REF]);
87
- __classPrivateFieldSet(this, _state, data[LicenseGetFields.COLUMN_STATE]);
88
- __classPrivateFieldSet(this, _service_ref, data[LicenseGetFields.COLUMN_SERVICE_REF]);
89
- __classPrivateFieldSet(this, _sku, data[LicenseGetFields.COLUMN_SKU]);
90
- __classPrivateFieldSet(this, _name, data[LicenseGetFields.COLUMN_NAME]);
91
- __classPrivateFieldSet(this, _seats, data[LicenseGetFields.COLUMN_SEATS]);
92
- __classPrivateFieldSet(this, _activeSeats, new activeSeatsFindResult_1.ActiveSeatsFindResult(data[LicenseGetFields.COLUMN_ACTIVE_SEATS]));
93
- __classPrivateFieldSet(this, _activation_datetime, data[LicenseGetFields.COLUMN_ACTIVATION_DATETIME]);
94
- __classPrivateFieldSet(this, _expiry_datetime, data[LicenseGetFields.COLUMN_EXPIRY_DATETIME]);
95
- __classPrivateFieldSet(this, _autoRenew, data[LicenseGetFields.COLUMN_AUTO_RENEW]);
96
- __classPrivateFieldSet(this, _message, data[LicenseGetFields.COLUMN_MESSAGE]);
97
- __classPrivateFieldSet(this, _actions, data[LicenseGetFields.COLUMN_ACTIONS]
98
- ? new actionsGetResult_1.ActionsGetResult(data[LicenseGetFields.COLUMN_ACTIONS])
83
+ __classPrivateFieldSet(this, _license_id, licenseGetDataInput[LicenseGetFields.COLUMN_LICENSE_ID]);
84
+ __classPrivateFieldSet(this, _parent_license_id, licenseGetDataInput[LicenseGetFields.COLUMN_PARENT_LICENSE_ID]);
85
+ __classPrivateFieldSet(this, _friendlyName, licenseGetDataInput[LicenseGetFields.COLUMN_FRIENDLY_NAME]);
86
+ __classPrivateFieldSet(this, _customer_ref, licenseGetDataInput[LicenseGetFields.COLUMN_CUSTOMER_REF]);
87
+ __classPrivateFieldSet(this, _state, licenseGetDataInput[LicenseGetFields.COLUMN_STATE]);
88
+ __classPrivateFieldSet(this, _service_ref, licenseGetDataInput[LicenseGetFields.COLUMN_SERVICE_REF]);
89
+ __classPrivateFieldSet(this, _sku, licenseGetDataInput[LicenseGetFields.COLUMN_SKU]);
90
+ __classPrivateFieldSet(this, _name, licenseGetDataInput[LicenseGetFields.COLUMN_NAME]);
91
+ __classPrivateFieldSet(this, _seats, licenseGetDataInput[LicenseGetFields.COLUMN_SEATS]);
92
+ __classPrivateFieldSet(this, _activeSeats, new activeSeatsFindResult_1.ActiveSeatsFindResult(licenseGetDataInput[LicenseGetFields.COLUMN_ACTIVE_SEATS]));
93
+ __classPrivateFieldSet(this, _activation_datetime, licenseGetDataInput[LicenseGetFields.COLUMN_ACTIVATION_DATETIME]);
94
+ __classPrivateFieldSet(this, _expiry_datetime, licenseGetDataInput[LicenseGetFields.COLUMN_EXPIRY_DATETIME]);
95
+ __classPrivateFieldSet(this, _autoRenew, licenseGetDataInput[LicenseGetFields.COLUMN_AUTO_RENEW]);
96
+ __classPrivateFieldSet(this, _message, licenseGetDataInput[LicenseGetFields.COLUMN_MESSAGE]);
97
+ __classPrivateFieldSet(this, _actions, licenseGetDataInput[LicenseGetFields.COLUMN_ACTIONS]
98
+ ? new actionsGetResult_1.ActionsGetResult(licenseGetDataInput[LicenseGetFields.COLUMN_ACTIONS])
99
99
  : undefined);
100
- __classPrivateFieldSet(this, _actionMessages, (_a = data[LicenseGetFields.COLUMN_ACTION_MESSAGES]) === null || _a === void 0 ? void 0 : _a.map((result) => new actionMessagesGetResult_1.ActionMessagesGetResult(result)));
101
- __classPrivateFieldSet(this, _order_reference, data[LicenseGetFields.COLUMN_ORDER_REFERENCE]);
102
- __classPrivateFieldSet(this, _order, new orderGetResult_1.OrderGetResult(data[LicenseGetFields.COLUMN_ORDER]));
103
- __classPrivateFieldSet(this, _vendor_license_id, data[LicenseGetFields.COLUMN_VENDOR_LICENSE_ID]);
104
- __classPrivateFieldSet(this, _periodicity, data[LicenseGetFields.COLUMN_PERIODICITY]);
105
- __classPrivateFieldSet(this, _term, data[LicenseGetFields.COLUMN_TERM]);
106
- __classPrivateFieldSet(this, _category, data[LicenseGetFields.COLUMN_CATEGORY]);
107
- __classPrivateFieldSet(this, _program, data[LicenseGetFields.COLUMN_PROGRAM]);
108
- __classPrivateFieldSet(this, _associatedSubscriptionProgram, data[LicenseGetFields.COLUMN_ASSOCIATED_SUBSCRIPTION_PROGRAM]);
109
- __classPrivateFieldSet(this, _price, new licensePriceGetResult_1.LicensePriceGetResult(data[LicenseGetFields.COLUMN_PRICE]));
110
- __classPrivateFieldSet(this, _arrowSubCategories, data[LicenseGetFields.COLUMN_ARROW_SUB_CATEGORIES]);
100
+ __classPrivateFieldSet(this, _actionMessages, (_a = licenseGetDataInput[LicenseGetFields.COLUMN_ACTION_MESSAGES]) === null || _a === void 0 ? void 0 : _a.map((result) => new actionMessagesGetResult_1.ActionMessagesGetResult(result)));
101
+ __classPrivateFieldSet(this, _order_reference, licenseGetDataInput[LicenseGetFields.COLUMN_ORDER_REFERENCE]);
102
+ __classPrivateFieldSet(this, _order, new orderGetResult_1.OrderGetResult(licenseGetDataInput[LicenseGetFields.COLUMN_ORDER]));
103
+ __classPrivateFieldSet(this, _vendor_license_id, licenseGetDataInput[LicenseGetFields.COLUMN_VENDOR_LICENSE_ID]);
104
+ __classPrivateFieldSet(this, _periodicity, licenseGetDataInput[LicenseGetFields.COLUMN_PERIODICITY]);
105
+ __classPrivateFieldSet(this, _term, licenseGetDataInput[LicenseGetFields.COLUMN_TERM]);
106
+ __classPrivateFieldSet(this, _category, licenseGetDataInput[LicenseGetFields.COLUMN_CATEGORY]);
107
+ __classPrivateFieldSet(this, _program, licenseGetDataInput[LicenseGetFields.COLUMN_PROGRAM]);
108
+ __classPrivateFieldSet(this, _associatedSubscriptionProgram, licenseGetDataInput[LicenseGetFields.COLUMN_ASSOCIATED_SUBSCRIPTION_PROGRAM]);
109
+ __classPrivateFieldSet(this, _price, new licensePriceGetResult_1.LicensePriceGetResult(licenseGetDataInput[LicenseGetFields.COLUMN_PRICE]));
110
+ __classPrivateFieldSet(this, _arrowSubCategories, licenseGetDataInput[LicenseGetFields.COLUMN_ARROW_SUB_CATEGORIES]);
111
111
  }
112
112
  get id() {
113
113
  return __classPrivateFieldGet(this, _license_id);
@@ -0,0 +1,14 @@
1
+ import { AbstractEntity } from '../../../abstractEntity';
2
+ import { LicenseGetData, LicenseGetResult } from '../getLicense/licenseGetResult';
3
+ export declare enum GetLicenseResultFields {
4
+ COLUMN_LICENSE = "license"
5
+ }
6
+ export declare type GetLicenseResultData = {
7
+ [GetLicenseResultFields.COLUMN_LICENSE]: LicenseGetData;
8
+ };
9
+ export declare class GetLicenseResult extends AbstractEntity<GetLicenseResultData> {
10
+ #private;
11
+ constructor(getLicenseResultDataInput: GetLicenseResultData);
12
+ get license(): LicenseGetResult;
13
+ toJSON(): GetLicenseResultData;
14
+ }
@@ -0,0 +1,41 @@
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 _license;
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.GetLicenseResult = exports.GetLicenseResultFields = void 0;
18
+ const abstractEntity_1 = require("../../../abstractEntity");
19
+ const licenseGetResult_1 = require("../getLicense/licenseGetResult");
20
+ var GetLicenseResultFields;
21
+ (function (GetLicenseResultFields) {
22
+ GetLicenseResultFields["COLUMN_LICENSE"] = "license";
23
+ })(GetLicenseResultFields = exports.GetLicenseResultFields || (exports.GetLicenseResultFields = {}));
24
+ class GetLicenseResult extends abstractEntity_1.AbstractEntity {
25
+ constructor(getLicenseResultDataInput) {
26
+ super(getLicenseResultDataInput);
27
+ _license.set(this, void 0);
28
+ __classPrivateFieldSet(this, _license, new licenseGetResult_1.LicenseGetResult(getLicenseResultDataInput[GetLicenseResultFields.COLUMN_LICENSE]));
29
+ }
30
+ get license() {
31
+ return __classPrivateFieldGet(this, _license);
32
+ }
33
+ toJSON() {
34
+ return {
35
+ [GetLicenseResultFields.COLUMN_LICENSE]: this.license.toJSON(),
36
+ };
37
+ }
38
+ }
39
+ exports.GetLicenseResult = GetLicenseResult;
40
+ _license = new WeakMap();
41
+ //# sourceMappingURL=getLicenseResult.js.map
@@ -1,22 +1,34 @@
1
1
  import { LicenseGetData } from './getLicense/licenseGetResult';
2
2
  import { AbstractEntity } from '../../abstractEntity';
3
+ export declare enum GetResultFields {
4
+ COLUMN_STATUS = "status",
5
+ COLUMN_DATA = "data"
6
+ }
3
7
  /**
4
- * For future get endpoint, create type like LicenseGet
5
- * and add this type to TypesGet type
8
+ * @deprecated please use GetLicenseResultData for license
6
9
  */
7
10
  export declare type LicenseGet = {
8
11
  license: LicenseGetData;
9
12
  };
10
- declare type TypesGet = LicenseGet;
11
- export declare type GetData<TypesGet> = {
12
- status: number;
13
- data: TypesGet;
13
+ export declare type GetData<Entity> = {
14
+ [GetResultFields.COLUMN_STATUS]: number;
15
+ [GetResultFields.COLUMN_DATA]: Entity;
14
16
  };
15
- export declare class GetResult extends AbstractEntity<GetData<TypesGet>> {
17
+ /**
18
+ * This interface is use toJSON function in objects (data properties) you want to use
19
+ */
20
+ interface AbstractEntityGet<Entity extends AbstractEntityGet<Entity>> extends AbstractEntity<Entity['entityDataInput']> {
21
+ toJSON: () => Entity['entityDataInput'];
22
+ }
23
+ /**
24
+ * WARNING: use this class only when the Entity in data properties is an object not an array or other type
25
+ * Use this class for get call when the response of API is a type of GetData<Entity>
26
+ */
27
+ export declare class GetResult<Entity extends AbstractEntityGet<Entity>> extends AbstractEntity<GetData<Entity['entityDataInput']>> {
16
28
  #private;
17
- constructor(data: GetData<TypesGet>);
29
+ constructor(cls: new (data: Entity['entityDataInput']) => Entity, getResultDataInput: GetData<Entity['entityDataInput']>);
18
30
  get status(): number;
19
- get data(): TypesGet;
20
- toJSON(): GetData<TypesGet>;
31
+ get data(): Entity;
32
+ toJSON(): GetData<Entity['entityDataInput']>;
21
33
  }
22
34
  export {};
@@ -14,15 +14,24 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
14
14
  };
15
15
  var _status, _data;
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.GetResult = void 0;
17
+ exports.GetResult = exports.GetResultFields = void 0;
18
18
  const abstractEntity_1 = require("../../abstractEntity");
19
+ var GetResultFields;
20
+ (function (GetResultFields) {
21
+ GetResultFields["COLUMN_STATUS"] = "status";
22
+ GetResultFields["COLUMN_DATA"] = "data";
23
+ })(GetResultFields = exports.GetResultFields || (exports.GetResultFields = {}));
24
+ /**
25
+ * WARNING: use this class only when the Entity in data properties is an object not an array or other type
26
+ * Use this class for get call when the response of API is a type of GetData<Entity>
27
+ */
19
28
  class GetResult extends abstractEntity_1.AbstractEntity {
20
- constructor(data) {
21
- super(data);
29
+ constructor(cls, getResultDataInput) {
30
+ super(getResultDataInput);
22
31
  _status.set(this, void 0);
23
32
  _data.set(this, void 0);
24
- __classPrivateFieldSet(this, _status, data.status);
25
- __classPrivateFieldSet(this, _data, data.data);
33
+ __classPrivateFieldSet(this, _status, getResultDataInput.status);
34
+ __classPrivateFieldSet(this, _data, new cls(getResultDataInput.data));
26
35
  }
27
36
  get status() {
28
37
  return __classPrivateFieldGet(this, _status);
@@ -31,10 +40,10 @@ class GetResult extends abstractEntity_1.AbstractEntity {
31
40
  return __classPrivateFieldGet(this, _data);
32
41
  }
33
42
  toJSON() {
34
- return {
35
- status: this.status,
36
- data: this.data,
37
- };
43
+ return JSON.parse(JSON.stringify({
44
+ [GetResultFields.COLUMN_STATUS]: this.status,
45
+ [GetResultFields.COLUMN_DATA]: this.data.toJSON(),
46
+ }));
38
47
  }
39
48
  }
40
49
  exports.GetResult = GetResult;
@@ -11,8 +11,9 @@ 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 { GetData, LicenseGet } from './entities/getResult';
14
+ import { GetResult } from './entities/getResult';
15
15
  import { LicenseGetFields } from './entities/getLicense/licenseGetResult';
16
+ import { GetLicenseResult } from './entities/getResult/getLicenseResult';
16
17
  /**
17
18
  * Parameters passable to the request for refining search.
18
19
  */
@@ -204,6 +205,18 @@ export declare class LicensesClient extends AbstractClient {
204
205
  * The path of the Seats endpoint
205
206
  */
206
207
  private SEATS_PATH;
208
+ /**
209
+ * The path of suspend endpoint
210
+ */
211
+ private SUSPEND_PATH;
212
+ /**
213
+ * The path of reactivate endpoint
214
+ */
215
+ private REACTIVATE_PATH;
216
+ /**
217
+ * The path of cancel endpoint
218
+ */
219
+ private CANCEL_PATH;
207
220
  /**
208
221
  * Returns the raw result from the find endpoint call
209
222
  *
@@ -229,6 +242,9 @@ export declare class LicensesClient extends AbstractClient {
229
242
  getConfigs(reference: string): AsyncGenerator<ConfigFindResultData>;
230
243
  updateConfigRaw(reference: string, config: ConfigFindResult): Promise<ConfigFindResultData>;
231
244
  updateConfig(reference: string, config: ConfigFindResult): Promise<ConfigFindResult>;
232
- getLicense(licenseReference: string, parameters?: Parameters): Promise<GetData<LicenseGet>>;
245
+ getLicense(licenseReference: string, parameters?: Parameters): Promise<GetResult<GetLicenseResult>>;
233
246
  updateSeats(licenseReference: string, putData: UpdateSeatsData, parameters?: Parameters): Promise<void>;
247
+ suspendLicense(licenseReference: string, parameters?: Parameters): Promise<void>;
248
+ reactivateLicense(licenseReference: string, parameters?: Parameters): Promise<void>;
249
+ cancelLicense(licenseReference: string, parameters?: Parameters): Promise<void>;
234
250
  }
@@ -9,6 +9,7 @@ const findResult_1 = require("./entities/findResult");
9
9
  const configFindResult_1 = require("./entities/license/configFindResult");
10
10
  const getResult_1 = require("./entities/getResult");
11
11
  const licenseGetResult_1 = require("./entities/getLicense/licenseGetResult");
12
+ const getLicenseResult_1 = require("./entities/getResult/getLicenseResult");
12
13
  /**
13
14
  * Parameters passable to the request for refining search.
14
15
  */
@@ -126,6 +127,18 @@ class LicensesClient extends abstractClient_1.AbstractClient {
126
127
  * The path of the Seats endpoint
127
128
  */
128
129
  this.SEATS_PATH = '/seats';
130
+ /**
131
+ * The path of suspend endpoint
132
+ */
133
+ this.SUSPEND_PATH = '/suspend';
134
+ /**
135
+ * The path of reactivate endpoint
136
+ */
137
+ this.REACTIVATE_PATH = '/reactivate';
138
+ /**
139
+ * The path of cancel endpoint
140
+ */
141
+ this.CANCEL_PATH = '/cancel';
129
142
  }
130
143
  /**
131
144
  * Returns the raw result from the find endpoint call
@@ -225,12 +238,24 @@ class LicensesClient extends abstractClient_1.AbstractClient {
225
238
  }
226
239
  async getLicense(licenseReference, parameters = {}) {
227
240
  this.path = licenseReference;
228
- return new getResult_1.GetResult(await this.get(parameters)).toJSON();
241
+ return new getResult_1.GetResult(getLicenseResult_1.GetLicenseResult, await this.get(parameters));
229
242
  }
230
243
  updateSeats(licenseReference, putData, parameters = {}) {
231
244
  this.path = licenseReference + this.SEATS_PATH;
232
245
  return this.put(putData, parameters);
233
246
  }
247
+ suspendLicense(licenseReference, parameters = {}) {
248
+ this.path = licenseReference + this.SUSPEND_PATH;
249
+ return this.put(undefined, parameters);
250
+ }
251
+ reactivateLicense(licenseReference, parameters = {}) {
252
+ this.path = licenseReference + this.REACTIVATE_PATH;
253
+ return this.put(undefined, parameters);
254
+ }
255
+ cancelLicense(licenseReference, parameters = {}) {
256
+ this.path = licenseReference + this.CANCEL_PATH;
257
+ return this.put(undefined, parameters);
258
+ }
234
259
  }
235
260
  exports.LicensesClient = LicensesClient;
236
261
  //# sourceMappingURL=licensesClient.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.2.0",
7
+ "version": "2.5.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",