@arrowsphere/api-client 3.81.1 → 3.82.0-rc-zss.1

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.
@@ -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
  }
@@ -40,3 +40,4 @@ export * from './licenseRequestClient';
40
40
  export * from './licensesClient';
41
41
  export * from './entities/license/securityFindResult';
42
42
  export * from './licensesEventClient';
43
+ export * from './types/bulkArguments';
@@ -56,4 +56,5 @@ __exportStar(require("./licenseRequestClient"), exports);
56
56
  __exportStar(require("./licensesClient"), exports);
57
57
  __exportStar(require("./entities/license/securityFindResult"), exports);
58
58
  __exportStar(require("./licensesEventClient"), exports);
59
+ __exportStar(require("./types/bulkArguments"), exports);
59
60
  //# sourceMappingURL=index.js.map
@@ -21,6 +21,7 @@ import { LicenseConversionSkuResult } from './entities/license/licenseConversion
21
21
  import { CredentialsResult } from './entities/license/credentialsResult';
22
22
  import { ScheduleTasksResult } from './entities/schedule/scheduleTasksResult';
23
23
  import { GetPricingRateResult, RateTypeEnum } from './entities/pricingRate/getPricingRateResult';
24
+ import { BulkBodyArgument, BulkSetRateBody, BulkAutoRenewBody } from './types/bulkArguments';
24
25
  /**
25
26
  * Parameters passable to the request for refining search.
26
27
  */
@@ -295,6 +296,10 @@ export declare class LicensesClient extends AbstractRestfulClient {
295
296
  * The path to get/set pricing rate on a license
296
297
  */
297
298
  private PRICING_RATE_PATH;
299
+ /**
300
+ * The path to apply bulk action on license(s)
301
+ */
302
+ private BULK_PATH;
298
303
  /**
299
304
  * Returns the raw result from the find endpoint call
300
305
  *
@@ -319,6 +324,7 @@ export declare class LicensesClient extends AbstractRestfulClient {
319
324
  getConfigsRaw(reference: string): Promise<FindConfig>;
320
325
  getConfigs(reference: string): AsyncGenerator<ConfigFindResultData>;
321
326
  updateConfigRaw(reference: string, config: ConfigFindResult): Promise<ConfigFindResultData>;
327
+ bulkAction(bulkData: BulkBodyArgument): Promise<BulkSetRateBody | BulkAutoRenewBody>;
322
328
  updateConfig(reference: string, config: ConfigFindResult): Promise<ConfigFindResult>;
323
329
  getLicense(licenseReference: string, parameters?: Parameters): Promise<GetResult<GetLicenseResult>>;
324
330
  updateSeats(licenseReference: string, putData: UpdateSeatsData, parameters?: Parameters): Promise<void>;
@@ -16,6 +16,7 @@ const licenseConversionSkuResult_1 = require("./entities/license/licenseConversi
16
16
  const credentialsResult_1 = require("./entities/license/credentialsResult");
17
17
  const scheduleTasksResult_1 = require("./entities/schedule/scheduleTasksResult");
18
18
  const getPricingRateResult_1 = require("./entities/pricingRate/getPricingRateResult");
19
+ const bulkArguments_1 = require("./types/bulkArguments");
19
20
  /**
20
21
  * Parameters passable to the request for refining search.
21
22
  */
@@ -119,6 +120,7 @@ var SaveBillingCommentsInputFields;
119
120
  SaveBillingCommentsInputFields["COLUMN_COMMENT_ONE"] = "comment1";
120
121
  SaveBillingCommentsInputFields["COLUMN_COMMENT_TWO"] = "comment2";
121
122
  })(SaveBillingCommentsInputFields = exports.SaveBillingCommentsInputFields || (exports.SaveBillingCommentsInputFields = {}));
123
+ //export type BulkArguments = BulkBodyArgument;
122
124
  class LicensesClient extends abstractRestfulClient_1.AbstractRestfulClient {
123
125
  constructor() {
124
126
  super(...arguments);
@@ -194,6 +196,10 @@ class LicensesClient extends abstractRestfulClient_1.AbstractRestfulClient {
194
196
  * The path to get/set pricing rate on a license
195
197
  */
196
198
  this.PRICING_RATE_PATH = '/pricing-rate';
199
+ /**
200
+ * The path to apply bulk action on license(s)
201
+ */
202
+ this.BULK_PATH = '/bulk';
197
203
  }
198
204
  /**
199
205
  * Returns the raw result from the find endpoint call
@@ -275,6 +281,30 @@ class LicensesClient extends abstractRestfulClient_1.AbstractRestfulClient {
275
281
  };
276
282
  return await this.post(postData);
277
283
  }
284
+ async bulkAction(bulkData) {
285
+ this.path = this.BULK_PATH;
286
+ let postData = {
287
+ [bulkArguments_1.BulkBodyFields.ACTION_TYPE]: bulkData.actionType,
288
+ [bulkArguments_1.BulkBodyFields.LICENSES]: bulkData.licenses,
289
+ };
290
+ if (bulkData.actionType == bulkArguments_1.ActionTypes.AUTO_RENEW) {
291
+ const postAutoRenewData = {
292
+ ...postData,
293
+ [bulkArguments_1.BulkBodyFields.AUTO_RENEW_STATUS]: bulkData.autoRenewStatus,
294
+ };
295
+ postData = postAutoRenewData;
296
+ }
297
+ else if (bulkData.actionType == bulkArguments_1.ActionTypes.SET_RATE) {
298
+ const postSetRateData = {
299
+ ...postData,
300
+ [bulkArguments_1.BulkBodyFields.SPECIAL_PRICE_RATE_TYPE]: bulkData.specialPriceRateType,
301
+ [bulkArguments_1.BulkBodyFields.SPECIAL_PRICE_RATE_VALUE]: bulkData.specialPriceRateValue,
302
+ [bulkArguments_1.BulkBodyFields.SPECIAL_RATE_EFFECTIVE_APPLICATION_DATE]: bulkData.specialRateEffectiveApplicationDate,
303
+ };
304
+ postData = postSetRateData;
305
+ }
306
+ return await this.post(postData);
307
+ }
278
308
  async updateConfig(reference, config) {
279
309
  const rawResponse = await this.updateConfigRaw(reference, config);
280
310
  return new configFindResult_1.ConfigFindResult(rawResponse);
@@ -0,0 +1,31 @@
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 SpecialPriceRateTypes {
7
+ DISCOUNT = "discount",
8
+ UPLIFT = "uplift"
9
+ }
10
+ export declare enum SpecialRateEffectiveApplicationDate {
11
+ APPLY_IMMEDIATELY = "apply immediately",
12
+ APPLY_ON_NEXT_BILLING_PERIOD = "apply on next billing period"
13
+ }
14
+ export declare enum BulkBodyFields {
15
+ ACTION_TYPE = "actionType",
16
+ AUTO_RENEW_STATUS = "autoRenewStatus",
17
+ LICENSES = "licenses",
18
+ SPECIAL_PRICE_RATE_TYPE = "specialPriceRateType",
19
+ SPECIAL_PRICE_RATE_VALUE = "specialPriceRateValue",
20
+ SPECIAL_RATE_EFFECTIVE_APPLICATION_DATE = "specialRateEffectiveApplicationDate"
21
+ }
22
+ export declare type BulkBodyArgument = {
23
+ [BulkBodyFields.ACTION_TYPE]: ActionTypes;
24
+ [BulkBodyFields.LICENSES]: string[];
25
+ [BulkBodyFields.AUTO_RENEW_STATUS]?: boolean;
26
+ [BulkBodyFields.SPECIAL_PRICE_RATE_TYPE]?: SpecialPriceRateTypes;
27
+ [BulkBodyFields.SPECIAL_PRICE_RATE_VALUE]?: string;
28
+ [BulkBodyFields.SPECIAL_RATE_EFFECTIVE_APPLICATION_DATE]?: SpecialRateEffectiveApplicationDate;
29
+ };
30
+ export declare type BulkAutoRenewBody = Except<BulkBodyArgument, BulkBodyFields.SPECIAL_PRICE_RATE_TYPE & BulkBodyFields.SPECIAL_PRICE_RATE_VALUE & BulkBodyFields.SPECIAL_RATE_EFFECTIVE_APPLICATION_DATE>;
31
+ export declare type BulkSetRateBody = Except<BulkBodyArgument, BulkBodyFields.AUTO_RENEW_STATUS>;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BulkBodyFields = exports.SpecialRateEffectiveApplicationDate = exports.SpecialPriceRateTypes = 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 SpecialPriceRateTypes;
10
+ (function (SpecialPriceRateTypes) {
11
+ SpecialPriceRateTypes["DISCOUNT"] = "discount";
12
+ SpecialPriceRateTypes["UPLIFT"] = "uplift";
13
+ })(SpecialPriceRateTypes = exports.SpecialPriceRateTypes || (exports.SpecialPriceRateTypes = {}));
14
+ var SpecialRateEffectiveApplicationDate;
15
+ (function (SpecialRateEffectiveApplicationDate) {
16
+ SpecialRateEffectiveApplicationDate["APPLY_IMMEDIATELY"] = "apply immediately";
17
+ SpecialRateEffectiveApplicationDate["APPLY_ON_NEXT_BILLING_PERIOD"] = "apply on next billing period";
18
+ })(SpecialRateEffectiveApplicationDate = exports.SpecialRateEffectiveApplicationDate || (exports.SpecialRateEffectiveApplicationDate = {}));
19
+ var BulkBodyFields;
20
+ (function (BulkBodyFields) {
21
+ BulkBodyFields["ACTION_TYPE"] = "actionType";
22
+ BulkBodyFields["AUTO_RENEW_STATUS"] = "autoRenewStatus";
23
+ BulkBodyFields["LICENSES"] = "licenses";
24
+ BulkBodyFields["SPECIAL_PRICE_RATE_TYPE"] = "specialPriceRateType";
25
+ BulkBodyFields["SPECIAL_PRICE_RATE_VALUE"] = "specialPriceRateValue";
26
+ BulkBodyFields["SPECIAL_RATE_EFFECTIVE_APPLICATION_DATE"] = "specialRateEffectiveApplicationDate";
27
+ })(BulkBodyFields = exports.BulkBodyFields || (exports.BulkBodyFields = {}));
28
+ /*export type BulkAutoRenewBody = {
29
+ [BulkBodyFields.ACTION_TYPE]: ActionTypes;
30
+ [BulkBodyFields.LICENSES]: string[];
31
+ [BulkBodyFields.AUTO_RENEW_STATUS]: boolean;
32
+ };
33
+
34
+ export type BulkSetRateBody = {
35
+ [BulkBodyFields.ACTION_TYPE]: ActionTypes;
36
+ [BulkBodyFields.LICENSES]: string[];
37
+ [BulkBodyFields.SPECIAL_PRICE_RATE_TYPE]: SpecialPriceRateTypes;
38
+ [BulkBodyFields.SPECIAL_PRICE_RATE_VALUE]: string;
39
+ [BulkBodyFields.SPECIAL_RATE_EFFECTIVE_APPLICATION_DATE]: SpecialRateEffectiveApplicationDate;
40
+ };*/
41
+ //# sourceMappingURL=bulkArguments.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.81.1",
7
+ "version": "3.82.0-rc-zss.1",
8
8
  "description": "Node.js client for ArrowSphere's public API",
9
9
  "main": "build/index.js",
10
10
  "types": "build/index.d.ts",