@arrowsphere/api-client 3.88.0-rc.fdi.1 → 3.88.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,10 +3,10 @@
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.88.0] - 2024.01.09
6
+ ## [3.88.0] - 2024.01.08
7
7
 
8
8
  ### Added
9
- - [Organization Unit] add countLicenses fields to get List organization unit
9
+ - [license] add bulk action on licenses
10
10
 
11
11
  ## [3.87.0] - 2024.01.08
12
12
 
@@ -321,6 +321,9 @@ class AbstractRestfulClient extends AbstractHttpClient_1.AbstractHttpClient {
321
321
  ? ParameterKeys.PER_PAGE_CAMEL
322
322
  : ParameterKeys.PER_PAGE] = `${this.perPage}`;
323
323
  }
324
+ // to keep client stateless
325
+ this.page = 1;
326
+ this.perPage = 0;
324
327
  return params;
325
328
  }
326
329
  }
@@ -41,3 +41,4 @@ export * from './licenseRequestClient';
41
41
  export * from './licensesClient';
42
42
  export * from './entities/license/securityFindResult';
43
43
  export * from './licensesEventClient';
44
+ export * from './types/bulkArguments';
@@ -57,4 +57,5 @@ __exportStar(require("./licenseRequestClient"), exports);
57
57
  __exportStar(require("./licensesClient"), exports);
58
58
  __exportStar(require("./entities/license/securityFindResult"), exports);
59
59
  __exportStar(require("./licensesEventClient"), exports);
60
+ __exportStar(require("./types/bulkArguments"), exports);
60
61
  //# sourceMappingURL=index.js.map
@@ -22,6 +22,7 @@ import { CredentialsResult } from './entities/license/credentialsResult';
22
22
  import { ScheduleTasksResult } from './entities/schedule/scheduleTasksResult';
23
23
  import { GetPricingRateResult, RateTypeEnum } from './entities/pricingRate/getPricingRateResult';
24
24
  import { PartialResponse } from '../partialResponse';
25
+ import { BulkBodyArgument } from './types/bulkArguments';
25
26
  /**
26
27
  * Parameters passable to the request for refining search.
27
28
  */
@@ -301,6 +302,10 @@ export declare class LicensesClient extends AbstractRestfulClient {
301
302
  * The path to get/set pricing rate on a license
302
303
  */
303
304
  private PRICING_RATE_PATH;
305
+ /**
306
+ * The path to apply bulk action on license(s)
307
+ */
308
+ private BULK_PATH;
304
309
  /**
305
310
  * Returns the raw result from the find endpoint call
306
311
  *
@@ -325,6 +330,7 @@ export declare class LicensesClient extends AbstractRestfulClient {
325
330
  getConfigsRaw(reference: string): Promise<FindConfig>;
326
331
  getConfigs(reference: string): AsyncGenerator<ConfigFindResultData>;
327
332
  updateConfigRaw(reference: string, config: ConfigFindResult): Promise<ConfigFindResultData>;
333
+ bulkAction(bulkData: BulkBodyArgument): Promise<void>;
328
334
  updateConfig(reference: string, config: ConfigFindResult): Promise<ConfigFindResult>;
329
335
  getLicense(licenseReference: string, parameters?: Parameters): Promise<GetResult<GetLicenseResult>>;
330
336
  updateLicense(licenseReference: string, payload: UpdateLicenseData, parameters?: Parameters): Promise<void | PartialResponse>;
@@ -18,6 +18,7 @@ const scheduleTasksResult_1 = require("./entities/schedule/scheduleTasksResult")
18
18
  const getPricingRateResult_1 = require("./entities/pricingRate/getPricingRateResult");
19
19
  const partialResponse_1 = require("../partialResponse");
20
20
  const http2_1 = require("http2");
21
+ const bulkArguments_1 = require("./types/bulkArguments");
21
22
  /**
22
23
  * Parameters passable to the request for refining search.
23
24
  */
@@ -196,6 +197,10 @@ class LicensesClient extends abstractRestfulClient_1.AbstractRestfulClient {
196
197
  * The path to get/set pricing rate on a license
197
198
  */
198
199
  this.PRICING_RATE_PATH = '/pricing-rate';
200
+ /**
201
+ * The path to apply bulk action on license(s)
202
+ */
203
+ this.BULK_PATH = '/bulk';
199
204
  }
200
205
  /**
201
206
  * Returns the raw result from the find endpoint call
@@ -277,6 +282,30 @@ class LicensesClient extends abstractRestfulClient_1.AbstractRestfulClient {
277
282
  };
278
283
  return await this.post(postData);
279
284
  }
285
+ async bulkAction(bulkData) {
286
+ this.path = this.BULK_PATH;
287
+ let postData = {
288
+ [bulkArguments_1.BulkBodyFields.ACTION_TYPE]: bulkData.actionType,
289
+ [bulkArguments_1.BulkBodyFields.LICENSES]: bulkData.licenses,
290
+ };
291
+ if (bulkData.actionType == bulkArguments_1.ActionTypes.AUTO_RENEW) {
292
+ const postAutoRenewData = {
293
+ ...postData,
294
+ [bulkArguments_1.BulkBodyFields.AUTO_RENEW_STATUS]: bulkData.autoRenewStatus,
295
+ };
296
+ postData = postAutoRenewData;
297
+ }
298
+ else if (bulkData.actionType == bulkArguments_1.ActionTypes.SET_RATE) {
299
+ const postSetRateData = {
300
+ ...postData,
301
+ [bulkArguments_1.BulkBodyFields.SPECIAL_PRICE_RATE_TYPE]: bulkData.specialPriceRateType,
302
+ [bulkArguments_1.BulkBodyFields.SPECIAL_PRICE_RATE_VALUE]: bulkData.specialPriceRateValue,
303
+ [bulkArguments_1.BulkBodyFields.SPECIAL_RATE_EFFECTIVE_APPLICATION_DATE]: bulkData.specialRateEffectiveApplicationDate,
304
+ };
305
+ postData = postSetRateData;
306
+ }
307
+ return await this.post(postData);
308
+ }
280
309
  async updateConfig(reference, config) {
281
310
  const rawResponse = await this.updateConfigRaw(reference, config);
282
311
  return new configFindResult_1.ConfigFindResult(rawResponse);
@@ -0,0 +1,35 @@
1
+ import type { Except } from 'type-fest';
2
+ export declare enum ActionTypes {
3
+ SET_RATE = "setRate",
4
+ AUTO_RENEW = "autoRenew"
5
+ }
6
+ export declare enum AutoRenewStatuses {
7
+ OFF = "off",
8
+ ON = "on"
9
+ }
10
+ export declare enum SpecialPriceRateTypes {
11
+ DISCOUNT = "discount",
12
+ UPLIFT = "uplift"
13
+ }
14
+ export declare enum SpecialRateEffectiveApplicationDate {
15
+ APPLY_IMMEDIATELY = "apply immediately",
16
+ APPLY_ON_NEXT_BILLING_PERIOD = "apply on next billing period"
17
+ }
18
+ export declare enum BulkBodyFields {
19
+ ACTION_TYPE = "actionType",
20
+ AUTO_RENEW_STATUS = "autoRenewStatus",
21
+ LICENSES = "licenses",
22
+ SPECIAL_PRICE_RATE_TYPE = "specialPriceRateType",
23
+ SPECIAL_PRICE_RATE_VALUE = "specialPriceRateValue",
24
+ SPECIAL_RATE_EFFECTIVE_APPLICATION_DATE = "specialRateEffectiveApplicationDate"
25
+ }
26
+ export declare type BulkBodyArgument = {
27
+ [BulkBodyFields.ACTION_TYPE]: ActionTypes;
28
+ [BulkBodyFields.LICENSES]: string[];
29
+ [BulkBodyFields.AUTO_RENEW_STATUS]?: AutoRenewStatuses;
30
+ [BulkBodyFields.SPECIAL_PRICE_RATE_TYPE]?: SpecialPriceRateTypes;
31
+ [BulkBodyFields.SPECIAL_PRICE_RATE_VALUE]?: string;
32
+ [BulkBodyFields.SPECIAL_RATE_EFFECTIVE_APPLICATION_DATE]?: SpecialRateEffectiveApplicationDate;
33
+ };
34
+ export declare type BulkAutoRenewBody = Except<BulkBodyArgument, BulkBodyFields.SPECIAL_PRICE_RATE_TYPE & BulkBodyFields.SPECIAL_PRICE_RATE_VALUE & BulkBodyFields.SPECIAL_RATE_EFFECTIVE_APPLICATION_DATE>;
35
+ export declare type BulkSetRateBody = Except<BulkBodyArgument, BulkBodyFields.AUTO_RENEW_STATUS>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BulkBodyFields = exports.SpecialRateEffectiveApplicationDate = exports.SpecialPriceRateTypes = exports.AutoRenewStatuses = exports.ActionTypes = void 0;
4
+ var ActionTypes;
5
+ (function (ActionTypes) {
6
+ ActionTypes["SET_RATE"] = "setRate";
7
+ ActionTypes["AUTO_RENEW"] = "autoRenew";
8
+ })(ActionTypes = exports.ActionTypes || (exports.ActionTypes = {}));
9
+ var AutoRenewStatuses;
10
+ (function (AutoRenewStatuses) {
11
+ AutoRenewStatuses["OFF"] = "off";
12
+ AutoRenewStatuses["ON"] = "on";
13
+ })(AutoRenewStatuses = exports.AutoRenewStatuses || (exports.AutoRenewStatuses = {}));
14
+ var SpecialPriceRateTypes;
15
+ (function (SpecialPriceRateTypes) {
16
+ SpecialPriceRateTypes["DISCOUNT"] = "discount";
17
+ SpecialPriceRateTypes["UPLIFT"] = "uplift";
18
+ })(SpecialPriceRateTypes = exports.SpecialPriceRateTypes || (exports.SpecialPriceRateTypes = {}));
19
+ var SpecialRateEffectiveApplicationDate;
20
+ (function (SpecialRateEffectiveApplicationDate) {
21
+ SpecialRateEffectiveApplicationDate["APPLY_IMMEDIATELY"] = "apply immediately";
22
+ SpecialRateEffectiveApplicationDate["APPLY_ON_NEXT_BILLING_PERIOD"] = "apply on next billing period";
23
+ })(SpecialRateEffectiveApplicationDate = exports.SpecialRateEffectiveApplicationDate || (exports.SpecialRateEffectiveApplicationDate = {}));
24
+ var BulkBodyFields;
25
+ (function (BulkBodyFields) {
26
+ BulkBodyFields["ACTION_TYPE"] = "actionType";
27
+ BulkBodyFields["AUTO_RENEW_STATUS"] = "autoRenewStatus";
28
+ BulkBodyFields["LICENSES"] = "licenses";
29
+ BulkBodyFields["SPECIAL_PRICE_RATE_TYPE"] = "specialPriceRateType";
30
+ BulkBodyFields["SPECIAL_PRICE_RATE_VALUE"] = "specialPriceRateValue";
31
+ BulkBodyFields["SPECIAL_RATE_EFFECTIVE_APPLICATION_DATE"] = "specialRateEffectiveApplicationDate";
32
+ })(BulkBodyFields = exports.BulkBodyFields || (exports.BulkBodyFields = {}));
33
+ //# sourceMappingURL=bulkArguments.js.map
@@ -4,8 +4,7 @@ export declare enum OrganizationUnitFields {
4
4
  COLUMN_COMPANY_REF = "companyRef",
5
5
  COLUMN_NAME = "name",
6
6
  COLUMN_COUNT_USERS = "countUsers",
7
- COLUMN_COUNT_CUSTOMERS = "countCustomers",
8
- COLUMN_COUNT_LICENSES = "countLicenses"
7
+ COLUMN_COUNT_CUSTOMERS = "countCustomers"
9
8
  }
10
9
  export declare type OrganizationUnitType = {
11
10
  [OrganizationUnitFields.COLUMN_ORGANIZATION_UNIT_REF]: string;
@@ -13,7 +12,6 @@ export declare type OrganizationUnitType = {
13
12
  [OrganizationUnitFields.COLUMN_NAME]: string;
14
13
  [OrganizationUnitFields.COLUMN_COUNT_USERS]?: number;
15
14
  [OrganizationUnitFields.COLUMN_COUNT_CUSTOMERS]?: number;
16
- [OrganizationUnitFields.COLUMN_COUNT_LICENSES]?: number;
17
15
  };
18
16
  export declare class OrganizationUnit extends AbstractEntity<OrganizationUnitType> {
19
17
  #private;
@@ -23,6 +21,5 @@ export declare class OrganizationUnit extends AbstractEntity<OrganizationUnitTyp
23
21
  get name(): string;
24
22
  get countUsers(): number | undefined;
25
23
  get countCustomers(): number | undefined;
26
- get countLicenses(): number | undefined;
27
24
  toJSON(): OrganizationUnitType;
28
25
  }
@@ -10,7 +10,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
10
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
11
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
12
  };
13
- var _OrganizationUnit_organizationUnitRef, _OrganizationUnit_companyRef, _OrganizationUnit_name, _OrganizationUnit_countUsers, _OrganizationUnit_countCustomers, _OrganizationUnit_countLicenses;
13
+ var _OrganizationUnit_organizationUnitRef, _OrganizationUnit_companyRef, _OrganizationUnit_name, _OrganizationUnit_countUsers, _OrganizationUnit_countCustomers;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.OrganizationUnit = exports.OrganizationUnitFields = void 0;
16
16
  const abstractEntity_1 = require("../../abstractEntity");
@@ -21,7 +21,6 @@ var OrganizationUnitFields;
21
21
  OrganizationUnitFields["COLUMN_NAME"] = "name";
22
22
  OrganizationUnitFields["COLUMN_COUNT_USERS"] = "countUsers";
23
23
  OrganizationUnitFields["COLUMN_COUNT_CUSTOMERS"] = "countCustomers";
24
- OrganizationUnitFields["COLUMN_COUNT_LICENSES"] = "countLicenses";
25
24
  })(OrganizationUnitFields = exports.OrganizationUnitFields || (exports.OrganizationUnitFields = {}));
26
25
  class OrganizationUnit extends abstractEntity_1.AbstractEntity {
27
26
  constructor(organizationUnitInput) {
@@ -31,13 +30,11 @@ class OrganizationUnit extends abstractEntity_1.AbstractEntity {
31
30
  _OrganizationUnit_name.set(this, void 0);
32
31
  _OrganizationUnit_countUsers.set(this, void 0);
33
32
  _OrganizationUnit_countCustomers.set(this, void 0);
34
- _OrganizationUnit_countLicenses.set(this, void 0);
35
33
  __classPrivateFieldSet(this, _OrganizationUnit_organizationUnitRef, organizationUnitInput[OrganizationUnitFields.COLUMN_ORGANIZATION_UNIT_REF], "f");
36
34
  __classPrivateFieldSet(this, _OrganizationUnit_companyRef, organizationUnitInput[OrganizationUnitFields.COLUMN_COMPANY_REF], "f");
37
35
  __classPrivateFieldSet(this, _OrganizationUnit_name, organizationUnitInput[OrganizationUnitFields.COLUMN_NAME], "f");
38
36
  __classPrivateFieldSet(this, _OrganizationUnit_countUsers, organizationUnitInput[OrganizationUnitFields.COLUMN_COUNT_USERS], "f");
39
37
  __classPrivateFieldSet(this, _OrganizationUnit_countCustomers, organizationUnitInput[OrganizationUnitFields.COLUMN_COUNT_CUSTOMERS], "f");
40
- __classPrivateFieldSet(this, _OrganizationUnit_countLicenses, organizationUnitInput[OrganizationUnitFields.COLUMN_COUNT_LICENSES], "f");
41
38
  }
42
39
  get organizationUnitRef() {
43
40
  return __classPrivateFieldGet(this, _OrganizationUnit_organizationUnitRef, "f");
@@ -54,9 +51,6 @@ class OrganizationUnit extends abstractEntity_1.AbstractEntity {
54
51
  get countCustomers() {
55
52
  return __classPrivateFieldGet(this, _OrganizationUnit_countCustomers, "f");
56
53
  }
57
- get countLicenses() {
58
- return __classPrivateFieldGet(this, _OrganizationUnit_countLicenses, "f");
59
- }
60
54
  toJSON() {
61
55
  return {
62
56
  [OrganizationUnitFields.COLUMN_ORGANIZATION_UNIT_REF]: this
@@ -65,10 +59,9 @@ class OrganizationUnit extends abstractEntity_1.AbstractEntity {
65
59
  [OrganizationUnitFields.COLUMN_NAME]: this.name,
66
60
  [OrganizationUnitFields.COLUMN_COUNT_USERS]: this.countUsers,
67
61
  [OrganizationUnitFields.COLUMN_COUNT_CUSTOMERS]: this.countCustomers,
68
- [OrganizationUnitFields.COLUMN_COUNT_LICENSES]: this.countLicenses,
69
62
  };
70
63
  }
71
64
  }
72
65
  exports.OrganizationUnit = OrganizationUnit;
73
- _OrganizationUnit_organizationUnitRef = new WeakMap(), _OrganizationUnit_companyRef = new WeakMap(), _OrganizationUnit_name = new WeakMap(), _OrganizationUnit_countUsers = new WeakMap(), _OrganizationUnit_countCustomers = new WeakMap(), _OrganizationUnit_countLicenses = new WeakMap();
66
+ _OrganizationUnit_organizationUnitRef = new WeakMap(), _OrganizationUnit_companyRef = new WeakMap(), _OrganizationUnit_name = new WeakMap(), _OrganizationUnit_countUsers = new WeakMap(), _OrganizationUnit_countCustomers = new WeakMap();
74
67
  //# sourceMappingURL=organizationUnit.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": "3.88.0-rc.fdi.1",
7
+ "version": "3.88.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",