@arrowsphere/api-client 3.239.0 → 3.240.0-rc-jpb.3

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.
@@ -0,0 +1,22 @@
1
+ import { AbstractEntity } from '../../../abstractEntity';
2
+ export declare enum GetLicenseAttachmentResultFields {
3
+ COLUMN_NAME = "name",
4
+ COLUMN_LAST_MODIFIED = "lastModified",
5
+ COLUMN_URL = "url",
6
+ COLUMN_METADATA = "metadata"
7
+ }
8
+ export declare type GetLicenseAttachmentResultData = {
9
+ [GetLicenseAttachmentResultFields.COLUMN_NAME]: string;
10
+ [GetLicenseAttachmentResultFields.COLUMN_LAST_MODIFIED]: string;
11
+ [GetLicenseAttachmentResultFields.COLUMN_URL]: string;
12
+ [GetLicenseAttachmentResultFields.COLUMN_METADATA]?: Record<string, string>;
13
+ };
14
+ export declare class GetLicenseAttachmentResult extends AbstractEntity<GetLicenseAttachmentResultData> {
15
+ #private;
16
+ constructor(input: GetLicenseAttachmentResultData);
17
+ get name(): string;
18
+ get lastModified(): string;
19
+ get url(): string;
20
+ get metadata(): Record<string, string> | undefined;
21
+ toJSON(): GetLicenseAttachmentResultData;
22
+ }
@@ -0,0 +1,60 @@
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 _GetLicenseAttachmentResult_name, _GetLicenseAttachmentResult_lastModified, _GetLicenseAttachmentResult_url, _GetLicenseAttachmentResult_metadata;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.GetLicenseAttachmentResult = exports.GetLicenseAttachmentResultFields = void 0;
16
+ const abstractEntity_1 = require("../../../abstractEntity");
17
+ var GetLicenseAttachmentResultFields;
18
+ (function (GetLicenseAttachmentResultFields) {
19
+ GetLicenseAttachmentResultFields["COLUMN_NAME"] = "name";
20
+ GetLicenseAttachmentResultFields["COLUMN_LAST_MODIFIED"] = "lastModified";
21
+ GetLicenseAttachmentResultFields["COLUMN_URL"] = "url";
22
+ GetLicenseAttachmentResultFields["COLUMN_METADATA"] = "metadata";
23
+ })(GetLicenseAttachmentResultFields = exports.GetLicenseAttachmentResultFields || (exports.GetLicenseAttachmentResultFields = {}));
24
+ class GetLicenseAttachmentResult extends abstractEntity_1.AbstractEntity {
25
+ constructor(input) {
26
+ super(input);
27
+ _GetLicenseAttachmentResult_name.set(this, void 0);
28
+ _GetLicenseAttachmentResult_lastModified.set(this, void 0);
29
+ _GetLicenseAttachmentResult_url.set(this, void 0);
30
+ _GetLicenseAttachmentResult_metadata.set(this, void 0);
31
+ __classPrivateFieldSet(this, _GetLicenseAttachmentResult_name, input[GetLicenseAttachmentResultFields.COLUMN_NAME], "f");
32
+ __classPrivateFieldSet(this, _GetLicenseAttachmentResult_lastModified, input[GetLicenseAttachmentResultFields.COLUMN_LAST_MODIFIED], "f");
33
+ __classPrivateFieldSet(this, _GetLicenseAttachmentResult_url, input[GetLicenseAttachmentResultFields.COLUMN_URL], "f");
34
+ __classPrivateFieldSet(this, _GetLicenseAttachmentResult_metadata, input[GetLicenseAttachmentResultFields.COLUMN_METADATA], "f");
35
+ }
36
+ get name() {
37
+ return __classPrivateFieldGet(this, _GetLicenseAttachmentResult_name, "f");
38
+ }
39
+ get lastModified() {
40
+ return __classPrivateFieldGet(this, _GetLicenseAttachmentResult_lastModified, "f");
41
+ }
42
+ get url() {
43
+ return __classPrivateFieldGet(this, _GetLicenseAttachmentResult_url, "f");
44
+ }
45
+ get metadata() {
46
+ return __classPrivateFieldGet(this, _GetLicenseAttachmentResult_metadata, "f");
47
+ }
48
+ toJSON() {
49
+ return {
50
+ [GetLicenseAttachmentResultFields.COLUMN_NAME]: this.name,
51
+ [GetLicenseAttachmentResultFields.COLUMN_LAST_MODIFIED]: this
52
+ .lastModified,
53
+ [GetLicenseAttachmentResultFields.COLUMN_URL]: this.url,
54
+ [GetLicenseAttachmentResultFields.COLUMN_METADATA]: this.metadata,
55
+ };
56
+ }
57
+ }
58
+ exports.GetLicenseAttachmentResult = GetLicenseAttachmentResult;
59
+ _GetLicenseAttachmentResult_name = new WeakMap(), _GetLicenseAttachmentResult_lastModified = new WeakMap(), _GetLicenseAttachmentResult_url = new WeakMap(), _GetLicenseAttachmentResult_metadata = new WeakMap();
60
+ //# sourceMappingURL=GetLicenseAttachmentResult.js.map
@@ -0,0 +1,14 @@
1
+ import { AbstractEntity } from '../../../abstractEntity';
2
+ import { GetLicenseAttachmentResult, GetLicenseAttachmentResultData } from './GetLicenseAttachmentResult';
3
+ export declare enum GetLicenseAttachmentsResultFields {
4
+ COLUMN_ATTACHMENTS = "attachements"
5
+ }
6
+ export declare type GetLicenseAttachmentsResultData = {
7
+ [GetLicenseAttachmentsResultFields.COLUMN_ATTACHMENTS]: GetLicenseAttachmentResultData[];
8
+ };
9
+ export declare class GetLicenseAttachmentsResult extends AbstractEntity<GetLicenseAttachmentsResultData> {
10
+ #private;
11
+ constructor(input: GetLicenseAttachmentsResultData);
12
+ getLicenseAttachments(): GetLicenseAttachmentResult[];
13
+ toJSON(): GetLicenseAttachmentsResultData;
14
+ }
@@ -0,0 +1,39 @@
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 _GetLicenseAttachmentsResult_attachments;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.GetLicenseAttachmentsResult = exports.GetLicenseAttachmentsResultFields = void 0;
16
+ const abstractEntity_1 = require("../../../abstractEntity");
17
+ const GetLicenseAttachmentResult_1 = require("./GetLicenseAttachmentResult");
18
+ var GetLicenseAttachmentsResultFields;
19
+ (function (GetLicenseAttachmentsResultFields) {
20
+ GetLicenseAttachmentsResultFields["COLUMN_ATTACHMENTS"] = "attachements";
21
+ })(GetLicenseAttachmentsResultFields = exports.GetLicenseAttachmentsResultFields || (exports.GetLicenseAttachmentsResultFields = {}));
22
+ class GetLicenseAttachmentsResult extends abstractEntity_1.AbstractEntity {
23
+ constructor(input) {
24
+ super(input);
25
+ _GetLicenseAttachmentsResult_attachments.set(this, void 0);
26
+ __classPrivateFieldSet(this, _GetLicenseAttachmentsResult_attachments, input[GetLicenseAttachmentsResultFields.COLUMN_ATTACHMENTS].map((result) => new GetLicenseAttachmentResult_1.GetLicenseAttachmentResult(result)), "f");
27
+ }
28
+ getLicenseAttachments() {
29
+ return __classPrivateFieldGet(this, _GetLicenseAttachmentsResult_attachments, "f");
30
+ }
31
+ toJSON() {
32
+ return {
33
+ [GetLicenseAttachmentsResultFields.COLUMN_ATTACHMENTS]: __classPrivateFieldGet(this, _GetLicenseAttachmentsResult_attachments, "f").map((result) => result.toJSON()),
34
+ };
35
+ }
36
+ }
37
+ exports.GetLicenseAttachmentsResult = GetLicenseAttachmentsResult;
38
+ _GetLicenseAttachmentsResult_attachments = new WeakMap();
39
+ //# sourceMappingURL=GetLicenseAttachmentsResult.js.map
@@ -28,6 +28,7 @@ import { ConsumptionDailyPrediction } from '../consumption';
28
28
  import { GetScheduledTasksResult } from './entities/schedule/getScheduledTasksResult';
29
29
  import { GetScheduleTaskResult } from './entities/schedule/getScheduleTaskResult';
30
30
  import { LicenceCouponCodeHistoryResult } from './entities/history/licenceCouponCodeHistoryResult';
31
+ import { GetLicenseAttachmentsResult } from './entities/attachment/GetLicenseAttachmentsResult';
31
32
  /**
32
33
  * Parameters passable to the request for refining search.
33
34
  */
@@ -138,6 +139,10 @@ export declare type BaseParameters<LicenseType, OfferType, endCustomerOrganizati
138
139
  offer?: OfferType;
139
140
  endCustomerOrganizationUnit?: endCustomerOrganizationUnitType;
140
141
  };
142
+ export declare type AttachFileToLicenseParameters = {
143
+ name: string;
144
+ fileEncoded: string;
145
+ };
141
146
  export declare type LicenseSortParameters = BaseParameters<LicenceFindDataSortParameters, OfferFindResultDataSortParameters, EndCustomerOrganizationUnitSortParameters>;
142
147
  export declare type LicenseCompareParameters = {
143
148
  [field: string]: unknown;
@@ -397,6 +402,10 @@ export declare class LicensesClient extends AbstractRestfulClient {
397
402
  *
398
403
  */
399
404
  find(postData?: LicenseFindPayload, perPage?: number, page?: number, parameters?: Parameters): Promise<FindResult>;
405
+ findAttachments(licenseReference: string, perPage?: number, page?: number, parameters?: Parameters): Promise<GetResult<GetLicenseAttachmentsResult>>;
406
+ attachFileToLicense(licenseReference: string, parameters: AttachFileToLicenseParameters): Promise<any>;
407
+ removeLicenseAttachment(licenseReference: string, documentName: string): Promise<void>;
408
+ getScheduledTasks(licenseReference: string, parameters?: Parameters): Promise<GetResult<GetScheduledTasksResult>>;
400
409
  getConfigsRaw(reference: string): Promise<FindConfig>;
401
410
  getConfigs(reference: string): AsyncGenerator<ConfigFindResultData>;
402
411
  /**
@@ -424,7 +433,6 @@ export declare class LicensesClient extends AbstractRestfulClient {
424
433
  getCredentials(licenseReference: string, parameters?: Parameters): Promise<GetResult<CredentialsResult>>;
425
434
  setPricingRate(licenseReference: string, payload: LicensePricingRate, parameters?: Parameters): Promise<void>;
426
435
  scheduleTasks(licenseReference: string, payload: ScheduleTasks, parameters?: Parameters): Promise<GetResult<ScheduleTasksResult>>;
427
- getScheduledTasks(licenseReference: string, parameters?: Parameters): Promise<GetResult<GetScheduledTasksResult>>;
428
436
  updateScheduledTask(licenseReference: string, scheduledTaskId: number, payload: UpdateScheduledTaskRequestType, parameters?: Parameters): Promise<void>;
429
437
  getScheduledTask(licenseReference: string, scheduledTaskId: number, parameters?: Parameters): Promise<GetResult<GetScheduleTaskResult>>;
430
438
  deleteScheduledTask(licenseReference: string, scheduledTaskId: number, parameters?: Parameters, payload?: DeleteScheduledTaskType): Promise<void>;
@@ -22,6 +22,7 @@ const consumption_1 = require("../consumption");
22
22
  const getScheduledTasksResult_1 = require("./entities/schedule/getScheduledTasksResult");
23
23
  const getScheduleTaskResult_1 = require("./entities/schedule/getScheduleTaskResult");
24
24
  const licenceCouponCodeHistoryResult_1 = require("./entities/history/licenceCouponCodeHistoryResult");
25
+ const GetLicenseAttachmentsResult_1 = require("./entities/attachment/GetLicenseAttachmentsResult");
25
26
  /**
26
27
  * Parameters passable to the request for refining search.
27
28
  */
@@ -316,6 +317,25 @@ class LicensesClient extends abstractRestfulClient_1.AbstractRestfulClient {
316
317
  const response = await this.findRaw(rawLicensePayload, parameters);
317
318
  return new findResult_1.FindResult(response, this, rawLicensePayload, parameters);
318
319
  }
320
+ async findAttachments(licenseReference, perPage = 100, page = 1, parameters = {}) {
321
+ this.setPerPage(perPage);
322
+ this.setPage(page);
323
+ this.path = `/${licenseReference}/attachment`;
324
+ return new getResult_1.GetResult(GetLicenseAttachmentsResult_1.GetLicenseAttachmentsResult, await this.get(parameters));
325
+ }
326
+ async attachFileToLicense(licenseReference, parameters) {
327
+ this.path = `/${licenseReference}/attachment`;
328
+ return await this.post(parameters);
329
+ }
330
+ async removeLicenseAttachment(licenseReference, documentName) {
331
+ this.path = `/${licenseReference}/attachment/${documentName}`;
332
+ return await this.delete();
333
+ }
334
+ async getScheduledTasks(licenseReference, parameters = {}) {
335
+ this.path = `/${licenseReference}${this.SCHEDULE_TASKS_PATH}`;
336
+ const response = await this.get(parameters);
337
+ return new getResult_1.GetResult(getScheduledTasksResult_1.GetScheduledTasksResult, response);
338
+ }
319
339
  getConfigsRaw(reference) {
320
340
  this.path = `/${reference}${this.CONFIGS_PATH}`;
321
341
  return this.get();
@@ -474,11 +494,6 @@ class LicensesClient extends abstractRestfulClient_1.AbstractRestfulClient {
474
494
  this.path = `/${licenseReference}${this.SCHEDULE_TASKS_PATH}`;
475
495
  return new getResult_1.GetResult(scheduleTasksResult_1.ScheduleTasksResult, await this.post(payload, parameters));
476
496
  }
477
- async getScheduledTasks(licenseReference, parameters = {}) {
478
- this.path = `/${licenseReference}${this.SCHEDULE_TASKS_PATH}`;
479
- const response = await this.get(parameters);
480
- return new getResult_1.GetResult(getScheduledTasksResult_1.GetScheduledTasksResult, response);
481
- }
482
497
  async updateScheduledTask(licenseReference, scheduledTaskId, payload, parameters = {}) {
483
498
  this.path = `/${licenseReference}${this.SCHEDULE_TASKS_PATH}/${scheduledTaskId}`;
484
499
  return await this.patch(payload, parameters);
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.239.0",
7
+ "version": "3.240.0-rc-jpb.3",
8
8
  "description": "Node.js client for ArrowSphere's public API",
9
9
  "main": "build/index.js",
10
10
  "types": "build/index.d.ts",