@arrowsphere/api-client 3.99.0 → 3.100.0-rc.bdj.2

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.
@@ -3,6 +3,7 @@ import { ConsumptionBI } from './entities/bi/consumptionBI';
3
3
  import { GetResult } from '../getResult';
4
4
  import { Consumption } from './entities/consumption/consumption';
5
5
  import { ConsumptionDownloadRequest } from './entities/consumption/consumptionDownloadRequest';
6
+ import { ConsumptionBudget, ConsumptionBudgetType } from './entities/consumption/consumptionBudget';
6
7
  export declare type ConsumptionDownloadRequestPayload = {
7
8
  customer: string;
8
9
  licenseRef: string;
@@ -20,4 +21,6 @@ export declare class ConsumptionClient extends AbstractRestfulClient {
20
21
  getDailyConsumption(licenseReference: string, parameters: Parameters): Promise<GetResult<Consumption>>;
21
22
  getBIConsumption(parameters: Parameters): Promise<GetResult<ConsumptionBI>>;
22
23
  consumptionDownloadRequest(payload: ConsumptionDownloadRequestPayload): Promise<ConsumptionDownloadRequest>;
24
+ updateBudgetSettings(licenseReference: string, payload: ConsumptionBudgetType, parameters?: Parameters): Promise<void | ConsumptionBudget>;
25
+ getBudgetSettings(licenseReference: string, parameters?: Parameters): Promise<GetResult<ConsumptionBudget>>;
23
26
  }
@@ -6,6 +6,7 @@ const consumptionBI_1 = require("./entities/bi/consumptionBI");
6
6
  const getResult_1 = require("../getResult");
7
7
  const consumption_1 = require("./entities/consumption/consumption");
8
8
  const consumptionDownloadRequest_1 = require("./entities/consumption/consumptionDownloadRequest");
9
+ const consumptionBudget_1 = require("./entities/consumption/consumptionBudget");
9
10
  class ConsumptionClient extends abstractRestfulClient_1.AbstractRestfulClient {
10
11
  constructor() {
11
12
  super(...arguments);
@@ -30,6 +31,14 @@ class ConsumptionClient extends abstractRestfulClient_1.AbstractRestfulClient {
30
31
  this.path = '/v2/downloadRequest';
31
32
  return new consumptionDownloadRequest_1.ConsumptionDownloadRequest(await this.post(payload));
32
33
  }
34
+ async updateBudgetSettings(licenseReference, payload, parameters = {}) {
35
+ this.path = `/license/${licenseReference}/budget`;
36
+ return await this.patch(payload, parameters);
37
+ }
38
+ async getBudgetSettings(licenseReference, parameters = {}) {
39
+ this.path = `/license/${licenseReference}/budget`;
40
+ return new getResult_1.GetResult(consumptionBudget_1.ConsumptionBudget, await this.get(parameters));
41
+ }
33
42
  }
34
43
  exports.ConsumptionClient = ConsumptionClient;
35
44
  //# sourceMappingURL=consumptionClient.js.map
@@ -0,0 +1,22 @@
1
+ import { AbstractEntity } from '../../../abstractEntity';
2
+ export declare enum ConsumptionBudgetFields {
3
+ COLUMN_BUDGET_TYPE = "budgetType",
4
+ COLUMN_NOTIFICATIONS = "notifications",
5
+ COLUMN_SEND_NOTIFICATION = "sendNotification",
6
+ COLUMN_THRESHOLD = "threshold"
7
+ }
8
+ export declare type ConsumptionBudgetType = {
9
+ [ConsumptionBudgetFields.COLUMN_BUDGET_TYPE]: string;
10
+ [ConsumptionBudgetFields.COLUMN_NOTIFICATIONS]?: number[];
11
+ [ConsumptionBudgetFields.COLUMN_SEND_NOTIFICATION]: boolean;
12
+ [ConsumptionBudgetFields.COLUMN_THRESHOLD]: number;
13
+ };
14
+ export declare class ConsumptionBudget extends AbstractEntity<ConsumptionBudgetType> {
15
+ #private;
16
+ constructor(consumptionBudgetResponse: ConsumptionBudgetType);
17
+ get budgetType(): string;
18
+ get threshold(): number;
19
+ get sendNotification(): boolean;
20
+ get notifications(): number[] | undefined;
21
+ toJSON(): ConsumptionBudgetType;
22
+ }
@@ -0,0 +1,59 @@
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 _ConsumptionBudget_budgetType, _ConsumptionBudget_notifications, _ConsumptionBudget_sendNotification, _ConsumptionBudget_threshold;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.ConsumptionBudget = exports.ConsumptionBudgetFields = void 0;
16
+ const abstractEntity_1 = require("../../../abstractEntity");
17
+ var ConsumptionBudgetFields;
18
+ (function (ConsumptionBudgetFields) {
19
+ ConsumptionBudgetFields["COLUMN_BUDGET_TYPE"] = "budgetType";
20
+ ConsumptionBudgetFields["COLUMN_NOTIFICATIONS"] = "notifications";
21
+ ConsumptionBudgetFields["COLUMN_SEND_NOTIFICATION"] = "sendNotification";
22
+ ConsumptionBudgetFields["COLUMN_THRESHOLD"] = "threshold";
23
+ })(ConsumptionBudgetFields = exports.ConsumptionBudgetFields || (exports.ConsumptionBudgetFields = {}));
24
+ class ConsumptionBudget extends abstractEntity_1.AbstractEntity {
25
+ constructor(consumptionBudgetResponse) {
26
+ super(consumptionBudgetResponse);
27
+ _ConsumptionBudget_budgetType.set(this, void 0);
28
+ _ConsumptionBudget_notifications.set(this, void 0);
29
+ _ConsumptionBudget_sendNotification.set(this, void 0);
30
+ _ConsumptionBudget_threshold.set(this, void 0);
31
+ __classPrivateFieldSet(this, _ConsumptionBudget_budgetType, consumptionBudgetResponse[ConsumptionBudgetFields.COLUMN_BUDGET_TYPE], "f");
32
+ __classPrivateFieldSet(this, _ConsumptionBudget_notifications, consumptionBudgetResponse[ConsumptionBudgetFields.COLUMN_NOTIFICATIONS], "f");
33
+ __classPrivateFieldSet(this, _ConsumptionBudget_sendNotification, consumptionBudgetResponse[ConsumptionBudgetFields.COLUMN_SEND_NOTIFICATION], "f");
34
+ __classPrivateFieldSet(this, _ConsumptionBudget_threshold, consumptionBudgetResponse[ConsumptionBudgetFields.COLUMN_THRESHOLD], "f");
35
+ }
36
+ get budgetType() {
37
+ return __classPrivateFieldGet(this, _ConsumptionBudget_budgetType, "f");
38
+ }
39
+ get threshold() {
40
+ return __classPrivateFieldGet(this, _ConsumptionBudget_threshold, "f");
41
+ }
42
+ get sendNotification() {
43
+ return __classPrivateFieldGet(this, _ConsumptionBudget_sendNotification, "f");
44
+ }
45
+ get notifications() {
46
+ return __classPrivateFieldGet(this, _ConsumptionBudget_notifications, "f");
47
+ }
48
+ toJSON() {
49
+ return {
50
+ [ConsumptionBudgetFields.COLUMN_BUDGET_TYPE]: this.budgetType,
51
+ [ConsumptionBudgetFields.COLUMN_NOTIFICATIONS]: this.notifications,
52
+ [ConsumptionBudgetFields.COLUMN_SEND_NOTIFICATION]: this.sendNotification,
53
+ [ConsumptionBudgetFields.COLUMN_THRESHOLD]: this.threshold,
54
+ };
55
+ }
56
+ }
57
+ exports.ConsumptionBudget = ConsumptionBudget;
58
+ _ConsumptionBudget_budgetType = new WeakMap(), _ConsumptionBudget_notifications = new WeakMap(), _ConsumptionBudget_sendNotification = new WeakMap(), _ConsumptionBudget_threshold = new WeakMap();
59
+ //# sourceMappingURL=consumptionBudget.js.map
@@ -3,4 +3,5 @@ export * from './entities/bi/period/period';
3
3
  export * from './entities/bi/top/top';
4
4
  export * from './entities/bi/consumptionBI';
5
5
  export * from './entities/consumption/consumptionDownloadRequest';
6
+ export * from './entities/consumption/consumptionBudget';
6
7
  export * from './consumptionClient';
@@ -19,5 +19,6 @@ __exportStar(require("./entities/bi/period/period"), exports);
19
19
  __exportStar(require("./entities/bi/top/top"), exports);
20
20
  __exportStar(require("./entities/bi/consumptionBI"), exports);
21
21
  __exportStar(require("./entities/consumption/consumptionDownloadRequest"), exports);
22
+ __exportStar(require("./entities/consumption/consumptionBudget"), exports);
22
23
  __exportStar(require("./consumptionClient"), exports);
23
24
  //# sourceMappingURL=index.js.map
@@ -3,6 +3,7 @@ export * from './types/graphqlApiSchemas';
3
3
  export * from './types/entities/contact';
4
4
  export * from './types/entities/company';
5
5
  export * from './types/entities/country';
6
+ export * from './types/entities/licenseBudget';
6
7
  export * from './types/entities/order';
7
8
  export * from './types/entities/partnertag';
8
9
  export * from './types/entities/subscription';
@@ -19,6 +19,7 @@ __exportStar(require("./types/graphqlApiSchemas"), exports);
19
19
  __exportStar(require("./types/entities/contact"), exports);
20
20
  __exportStar(require("./types/entities/company"), exports);
21
21
  __exportStar(require("./types/entities/country"), exports);
22
+ __exportStar(require("./types/entities/licenseBudget"), exports);
22
23
  __exportStar(require("./types/entities/order"), exports);
23
24
  __exportStar(require("./types/entities/partnertag"), exports);
24
25
  __exportStar(require("./types/entities/subscription"), exports);
@@ -0,0 +1,11 @@
1
+ export declare type LicenseBudgetType = {
2
+ id?: number;
3
+ licenseId?: number;
4
+ notifications?: LicenseBudgetNotificationType[];
5
+ threshold?: number;
6
+ type?: string;
7
+ };
8
+ export declare type LicenseBudgetNotificationType = {
9
+ id?: number;
10
+ name?: string;
11
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=licenseBudget.js.map
@@ -1,5 +1,6 @@
1
1
  import { ArrowCompanyType, EndCustomerType, PartnerType } from './entities/company';
2
2
  import { ContinentType, CountryType } from './entities/country';
3
+ import { LicenseBudgetType } from './entities/licenseBudget';
3
4
  import { PartnertagType } from './entities/partnertag';
4
5
  import { SubscribedProgramType } from './entities/program';
5
6
  import { SubscriptionType } from './entities/subscription';
@@ -113,6 +114,7 @@ export declare enum SelectDataField {
113
114
  CONTINENT = "continent",
114
115
  COUNTRY = "country",
115
116
  END_CUSTOMER = "endCustomer",
117
+ LICENSE_BUDGET = "licenseBudget",
116
118
  PARTNER = "partner",
117
119
  PARTNERTAG = "partnertag",
118
120
  SUBSCRIBED_PROGRAM = "subscribedProgram",
@@ -131,6 +133,7 @@ export declare type SelectAllResponseDataType = {
131
133
  [SelectDataField.CONTINENT]?: ContinentType[];
132
134
  [SelectDataField.COUNTRY]?: CountryType[];
133
135
  [SelectDataField.END_CUSTOMER]?: EndCustomerType[];
136
+ [SelectDataField.LICENSE_BUDGET]?: LicenseBudgetType[];
134
137
  [SelectDataField.PARTNER]?: PartnerType[];
135
138
  [SelectDataField.PARTNERTAG]?: PartnertagType[];
136
139
  [SelectDataField.SUBSCRIBED_PROGRAM]?: SubscribedProgramType[];
@@ -175,6 +178,7 @@ export declare type SelectOneResponseDataType = {
175
178
  [SelectDataField.CONTINENT]?: ContinentType;
176
179
  [SelectDataField.COUNTRY]?: CountryType;
177
180
  [SelectDataField.END_CUSTOMER]?: EndCustomerType;
181
+ [SelectDataField.LICENSE_BUDGET]?: LicenseBudgetType;
178
182
  [SelectDataField.PARTNER]?: PartnerType;
179
183
  [SelectDataField.PARTNERTAG]?: PartnertagType;
180
184
  [SelectDataField.SUBSCRIBED_PROGRAM]?: SubscribedProgramType;
@@ -94,6 +94,7 @@ var SelectDataField;
94
94
  SelectDataField["CONTINENT"] = "continent";
95
95
  SelectDataField["COUNTRY"] = "country";
96
96
  SelectDataField["END_CUSTOMER"] = "endCustomer";
97
+ SelectDataField["LICENSE_BUDGET"] = "licenseBudget";
97
98
  SelectDataField["PARTNER"] = "partner";
98
99
  SelectDataField["PARTNERTAG"] = "partnertag";
99
100
  SelectDataField["SUBSCRIBED_PROGRAM"] = "subscribedProgram";
@@ -11,6 +11,7 @@ import { SpecialPriceRateType } from './entities/specialPriceRate';
11
11
  import { OrderItemsType, OrdersType } from './entities/order';
12
12
  import { VendorsType } from './entities/vendor';
13
13
  import { SubscribedProgramType } from './entities/program';
14
+ import { LicenseBudgetNotificationType, LicenseBudgetType } from './entities/licenseBudget';
14
15
  export declare type PartnertagSchema = Schema<PartnertagType, boolean>;
15
16
  declare type MissingFieldsOfCompanySchema = {
16
17
  contacts?: ContactsSchema;
@@ -38,6 +39,10 @@ declare type MissingFieldsOfOrderItemSchema = {
38
39
  declare type MissingFieldsOfOrdersSchema = {
39
40
  items?: OrderItemsSchema;
40
41
  };
42
+ declare type MissingFieldsOfLicenseBudgetSchema = {
43
+ notifications?: LicenseBudgetNotificationSchema;
44
+ };
45
+ export declare type LicenseBudgetSchema = Merge<Schema<LicenseBudgetType, boolean>, MissingFieldsOfLicenseBudgetSchema>;
41
46
  export declare type OrderItemsSchema = Merge<Schema<OrderItemsType, boolean>, MissingFieldsOfOrderItemSchema>;
42
47
  export declare type OrdersSchema = Merge<Schema<OrdersType, boolean>, MissingFieldsOfOrdersSchema>;
43
48
  export declare type EndCustomerSchema = Merge<Schema<EndCustomerType, boolean>, MissingFieldsOfEndCustomerSchema>;
@@ -48,6 +53,7 @@ export declare type ContactsSchema = Schema<ContactsType, boolean>;
48
53
  export declare type ContinentSchema = Schema<ContinentType, boolean>;
49
54
  export declare type CountrySchema = Schema<CountryType, boolean>;
50
55
  export declare type ErrorsSchema = Schema<ErrorsType, boolean>;
56
+ export declare type LicenseBudgetNotificationSchema = Schema<LicenseBudgetNotificationType, boolean>;
51
57
  export declare type PageSchema = Schema<PageType, boolean>;
52
58
  export declare type ProgramSchema = Schema<ProgramType, boolean>;
53
59
  export declare type SpecialPriceRateSchema = Schema<SpecialPriceRateType, boolean>;
@@ -65,6 +71,7 @@ export declare type SelectAllResponseDataSchema = {
65
71
  [SelectDataField.CONTINENT]?: ContinentSchema;
66
72
  [SelectDataField.COUNTRY]?: CountrySchema;
67
73
  [SelectDataField.END_CUSTOMER]?: EndCustomerSchema;
74
+ [SelectDataField.LICENSE_BUDGET]?: LicenseBudgetSchema;
68
75
  [SelectDataField.PARTNER]?: PartnerSchema;
69
76
  [SelectDataField.PARTNERTAG]?: PartnertagSchema;
70
77
  [SelectDataField.SUBSCRIBED_PROGRAM]?: SubscribedProgramSchema;
@@ -80,6 +87,7 @@ export declare type SelectOneResponseDataSchema = {
80
87
  [SelectDataField.CONTINENT]?: ContinentSchema;
81
88
  [SelectDataField.COUNTRY]?: CountrySchema;
82
89
  [SelectDataField.END_CUSTOMER]?: EndCustomerSchema;
90
+ [SelectDataField.LICENSE_BUDGET]?: LicenseBudgetSchema;
83
91
  [SelectDataField.PARTNER]?: PartnerSchema;
84
92
  [SelectDataField.PARTNERTAG]?: PartnertagSchema;
85
93
  [SelectDataField.SUBSCRIBED_PROGRAM]?: SubscribedProgramSchema;
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.99.0",
7
+ "version": "3.100.0-rc.bdj.2",
8
8
  "description": "Node.js client for ArrowSphere's public API",
9
9
  "main": "build/index.js",
10
10
  "types": "build/index.d.ts",