@arrowsphere/api-client 2.1.2 → 2.4.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.4.0] - 2022-02-11
7
+
8
+ ### Added
9
+
10
+ - Add endpoint reactivate license
11
+
12
+ ## [2.3.0] - 2022-02-11
13
+
14
+ ### Added
15
+
16
+ - Add endpoint suspend license
17
+
18
+ ## [2.2.1] - 2022-02-10
19
+
20
+ ### Added
21
+
22
+ - Fixed Class GetResult
23
+ - Add Class GetLicenseResult for intermediate level between GetResult Class and LicenseGetResult
24
+ - Refactoring of Units Tests
25
+ - Refactoring names of variable in class LicenseGetResult
26
+
27
+ ## [2.2.0] - 2022-01-04
28
+
29
+ ### Added
30
+
31
+ - Add endpoint update seats
32
+
6
33
  ## [2.1.2] - 2022-02-01
7
34
 
8
35
  ### Changed
@@ -109,6 +109,7 @@ export declare abstract class AbstractClient {
109
109
  * @param headers - Headers to be sent in the request
110
110
  */
111
111
  protected post(payload?: Payload, parameters?: Parameters, headers?: Headers, options?: Options): Promise<AxiosResponse['data']>;
112
+ protected put(payload?: Payload, parameters?: Parameters, headers?: Headers, options?: Options): Promise<void>;
112
113
  /**
113
114
  * Generates the full url for request
114
115
  * @param parameters - Parameters to serialize
@@ -149,6 +149,12 @@ class AbstractClient {
149
149
  });
150
150
  return this.getResponse(response);
151
151
  }
152
+ async put(payload = {}, parameters = {}, headers = {}, options = {}) {
153
+ const response = await this.client.put(this.generateUrl(parameters, options), payload, {
154
+ headers: this.prepareHeaders(headers),
155
+ });
156
+ return this.getResponse(response);
157
+ }
152
158
  /**
153
159
  * Generates the full url for request
154
160
  * @param parameters - Parameters to serialize
@@ -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,7 +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
+ import { LicenseGetFields } from './entities/getLicense/licenseGetResult';
16
+ import { GetLicenseResult } from './entities/getResult/getLicenseResult';
15
17
  /**
16
18
  * Parameters passable to the request for refining search.
17
19
  */
@@ -179,6 +181,9 @@ export declare type LicenseFindRawPayload = {
179
181
  };
180
182
  [LicenseFindParameters.DATA_HIGHLIGHT]?: boolean;
181
183
  };
184
+ export declare type UpdateSeatsData = {
185
+ [LicenseGetFields.COLUMN_SEATS]: number;
186
+ };
182
187
  export declare class LicensesClient extends AbstractClient {
183
188
  /**
184
189
  * The base path of the Licenses API
@@ -196,6 +201,18 @@ export declare class LicensesClient extends AbstractClient {
196
201
  * The path of the Configs endpoint
197
202
  */
198
203
  private CONFIGS_PATH;
204
+ /**
205
+ * The path of the Seats endpoint
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;
199
216
  /**
200
217
  * Returns the raw result from the find endpoint call
201
218
  *
@@ -221,5 +238,8 @@ export declare class LicensesClient extends AbstractClient {
221
238
  getConfigs(reference: string): AsyncGenerator<ConfigFindResultData>;
222
239
  updateConfigRaw(reference: string, config: ConfigFindResult): Promise<ConfigFindResultData>;
223
240
  updateConfig(reference: string, config: ConfigFindResult): Promise<ConfigFindResult>;
224
- getLicense(licenseReference: string, parameters?: Parameters): Promise<GetData<LicenseGet>>;
241
+ getLicense(licenseReference: string, parameters?: Parameters): Promise<GetResult<GetLicenseResult>>;
242
+ updateSeats(licenseReference: string, putData: UpdateSeatsData, parameters?: Parameters): Promise<void>;
243
+ suspendLicense(licenseReference: string, parameters?: Parameters): Promise<void>;
244
+ reactivateLicense(licenseReference: string, parameters?: Parameters): Promise<void>;
225
245
  }
@@ -8,6 +8,8 @@ const abstractClient_1 = require("../abstractClient");
8
8
  const findResult_1 = require("./entities/findResult");
9
9
  const configFindResult_1 = require("./entities/license/configFindResult");
10
10
  const getResult_1 = require("./entities/getResult");
11
+ const licenseGetResult_1 = require("./entities/getLicense/licenseGetResult");
12
+ const getLicenseResult_1 = require("./entities/getResult/getLicenseResult");
11
13
  /**
12
14
  * Parameters passable to the request for refining search.
13
15
  */
@@ -121,6 +123,18 @@ class LicensesClient extends abstractClient_1.AbstractClient {
121
123
  * The path of the Configs endpoint
122
124
  */
123
125
  this.CONFIGS_PATH = '/configs';
126
+ /**
127
+ * The path of the Seats endpoint
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';
124
138
  }
125
139
  /**
126
140
  * Returns the raw result from the find endpoint call
@@ -220,7 +234,19 @@ class LicensesClient extends abstractClient_1.AbstractClient {
220
234
  }
221
235
  async getLicense(licenseReference, parameters = {}) {
222
236
  this.path = licenseReference;
223
- return new getResult_1.GetResult(await this.get(parameters)).toJSON();
237
+ return new getResult_1.GetResult(getLicenseResult_1.GetLicenseResult, await this.get(parameters));
238
+ }
239
+ updateSeats(licenseReference, putData, parameters = {}) {
240
+ this.path = licenseReference + this.SEATS_PATH;
241
+ return this.put(putData, parameters);
242
+ }
243
+ suspendLicense(licenseReference, parameters = {}) {
244
+ this.path = licenseReference + this.SUSPEND_PATH;
245
+ return this.put(undefined, parameters);
246
+ }
247
+ reactivateLicense(licenseReference, parameters = {}) {
248
+ this.path = licenseReference + this.REACTIVATE_PATH;
249
+ return this.put(undefined, parameters);
224
250
  }
225
251
  }
226
252
  exports.LicensesClient = LicensesClient;
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.1.2",
7
+ "version": "2.4.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",