@arrowsphere/api-client 3.45.0-rc.ckh.1 → 3.45.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,11 +3,11 @@
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.45.0] - 2023-07-14
6
+ ## [3.45.0] - 2023-07-11
7
7
 
8
8
  ### Changed
9
9
 
10
- - Add consumption download request
10
+ - Any client can retry calls if error handle is defined
11
11
 
12
12
  ## [3.44.0] - 2023-07-10
13
13
 
@@ -101,9 +101,11 @@ class AbstractHttpClient {
101
101
  const output = { mustRetry: false };
102
102
  for (const handler of appropriateHandlers) {
103
103
  const res = await handler.handle(error, {
104
- setToken: this.setToken,
104
+ setToken: this.setToken.bind(this),
105
105
  });
106
- output.mustRetry = res.mustRetry;
106
+ if (res.mustRetry) {
107
+ output.mustRetry = true;
108
+ }
107
109
  }
108
110
  return output;
109
111
  }
@@ -15,6 +15,7 @@ export declare abstract class AbstractGraphQLClient extends AbstractHttpClient {
15
15
  private getClientInstance;
16
16
  setOptions(options: Options): this;
17
17
  protected post<GraphQLResponseTypes>(query: string): Promise<GraphQLResponseTypes>;
18
+ private applyHeaders;
18
19
  private generateUrl;
19
20
  protected stringifyQuery(query: any): string;
20
21
  }
@@ -42,12 +42,26 @@ class AbstractGraphQLClient extends AbstractHttpClient_1.AbstractHttpClient {
42
42
  return this;
43
43
  }
44
44
  async post(query) {
45
+ try {
46
+ this.applyHeaders();
47
+ return await this.getClientInstance().request(query);
48
+ }
49
+ catch (error) {
50
+ const exception = this.mapToPublicApiException(error);
51
+ const { mustRetry } = await this.handleError(exception);
52
+ if (mustRetry) {
53
+ this.applyHeaders();
54
+ return await this.getClientInstance().request(query);
55
+ }
56
+ throw error;
57
+ }
58
+ }
59
+ applyHeaders() {
45
60
  const headers = {
46
61
  authorization: this.token,
47
62
  ...this.headers,
48
63
  };
49
64
  this.getClientInstance().setHeaders(headers);
50
- return await this.getClientInstance().request(query);
51
65
  }
52
66
  generateUrl() {
53
67
  const baseUrl = this.url.replace(new RegExp('/$'), '');
@@ -104,10 +104,27 @@ class AbstractRestfulClient extends AbstractHttpClient_1.AbstractHttpClient {
104
104
  * @returns Promise\<AxiosResponse['data']\>
105
105
  */
106
106
  async get(parameters = {}, headers = {}, options = {}) {
107
- const response = await this.client.get(this.generateUrl(parameters, options), {
107
+ const url = this.generateUrl(parameters, options);
108
+ const config = {
108
109
  headers: this.prepareHeaders(headers),
109
- });
110
- return this.getResponse(response);
110
+ };
111
+ try {
112
+ const response = await this.client.get(url, config);
113
+ return this.getResponse(response);
114
+ }
115
+ catch (error) {
116
+ if (error instanceof exception_1.PublicApiClientException) {
117
+ const { mustRetry } = await this.handleError(error);
118
+ if (mustRetry) {
119
+ const config = {
120
+ headers: this.prepareHeaders(headers),
121
+ };
122
+ const response = await this.client.get(url, config);
123
+ return this.getResponse(response);
124
+ }
125
+ }
126
+ throw error;
127
+ }
111
128
  }
112
129
  /**
113
130
  * Processes and returns the Axios response data
@@ -148,10 +165,27 @@ class AbstractRestfulClient extends AbstractHttpClient_1.AbstractHttpClient {
148
165
  * @param options - Options to send
149
166
  */
150
167
  async post(payload = {}, parameters = {}, headers = {}, options = {}) {
151
- const response = await this.client.post(this.generateUrl(parameters, options), payload, {
168
+ const url = this.generateUrl(parameters, options);
169
+ const config = {
152
170
  headers: this.prepareHeaders(headers),
153
- });
154
- return this.getResponse(response);
171
+ };
172
+ try {
173
+ const response = await this.client.post(url, payload, config);
174
+ return this.getResponse(response);
175
+ }
176
+ catch (error) {
177
+ if (error instanceof exception_1.PublicApiClientException) {
178
+ const { mustRetry } = await this.handleError(error);
179
+ if (mustRetry) {
180
+ const config = {
181
+ headers: this.prepareHeaders(headers),
182
+ };
183
+ const response = await this.client.post(url, payload, config);
184
+ return this.getResponse(response);
185
+ }
186
+ }
187
+ throw error;
188
+ }
155
189
  }
156
190
  /**
157
191
  * Sends a PUT request
@@ -162,10 +196,27 @@ class AbstractRestfulClient extends AbstractHttpClient_1.AbstractHttpClient {
162
196
  * @returns Promise\<void\>
163
197
  */
164
198
  async put(payload = {}, parameters = {}, headers = {}, options = {}) {
165
- const response = await this.client.put(this.generateUrl(parameters, options), payload, {
199
+ const url = this.generateUrl(parameters, options);
200
+ const config = {
166
201
  headers: this.prepareHeaders(headers),
167
- });
168
- return this.getResponse(response);
202
+ };
203
+ try {
204
+ const response = await this.client.put(url, payload, config);
205
+ return this.getResponse(response);
206
+ }
207
+ catch (error) {
208
+ if (error instanceof exception_1.PublicApiClientException) {
209
+ const { mustRetry } = await this.handleError(error);
210
+ if (mustRetry) {
211
+ const config = {
212
+ headers: this.prepareHeaders(headers),
213
+ };
214
+ const response = await this.client.put(url, payload, config);
215
+ return this.getResponse(response);
216
+ }
217
+ }
218
+ throw error;
219
+ }
169
220
  }
170
221
  /**
171
222
  * Sends a PATCH request
@@ -176,10 +227,27 @@ class AbstractRestfulClient extends AbstractHttpClient_1.AbstractHttpClient {
176
227
  * @returns Promise\<T\>
177
228
  */
178
229
  async patch(payload = {}, parameters = {}, headers = {}, options = {}) {
179
- const response = await this.client.patch(this.generateUrl(parameters, options), payload, {
230
+ const url = this.generateUrl(parameters, options);
231
+ const config = {
180
232
  headers: this.prepareHeaders(headers),
181
- });
182
- return this.getResponse(response);
233
+ };
234
+ try {
235
+ const response = await this.client.patch(url, payload, config);
236
+ return this.getResponse(response);
237
+ }
238
+ catch (error) {
239
+ if (error instanceof exception_1.PublicApiClientException) {
240
+ const { mustRetry } = await this.handleError(error);
241
+ if (mustRetry) {
242
+ const config = {
243
+ headers: this.prepareHeaders(headers),
244
+ };
245
+ const response = await this.client.patch(url, payload, config);
246
+ return this.getResponse(response);
247
+ }
248
+ }
249
+ throw error;
250
+ }
183
251
  }
184
252
  /**
185
253
  * Sends a DELETE request
@@ -190,10 +258,27 @@ class AbstractRestfulClient extends AbstractHttpClient_1.AbstractHttpClient {
190
258
  * @returns Promise\<T\>
191
259
  */
192
260
  async delete(parameters = {}, headers = {}, options = {}) {
193
- const response = await this.client.delete(this.generateUrl(parameters, options), {
261
+ const url = this.generateUrl(parameters, options);
262
+ const config = {
194
263
  headers: this.prepareHeaders(headers),
195
- });
196
- return this.getResponse(response);
264
+ };
265
+ try {
266
+ const response = await this.client.delete(url, config);
267
+ return this.getResponse(response);
268
+ }
269
+ catch (error) {
270
+ if (error instanceof exception_1.PublicApiClientException) {
271
+ const { mustRetry } = await this.handleError(error);
272
+ if (mustRetry) {
273
+ const config = {
274
+ headers: this.prepareHeaders(headers),
275
+ };
276
+ const response = await this.client.delete(url, config);
277
+ return this.getResponse(response);
278
+ }
279
+ }
280
+ throw error;
281
+ }
197
282
  }
198
283
  /**
199
284
  * Generates the full url for request
@@ -28,13 +28,8 @@ class CatalogGraphQLClient extends abstractGraphQLClient_1.AbstractGraphQLClient
28
28
  return await this.find(queryStr);
29
29
  }
30
30
  catch (error) {
31
- const exception = this.mapToPublicApiException(error);
32
- const { mustRetry } = await this.handleError(exception);
33
- if (mustRetry) {
34
- return await this.find(queryStr);
35
- }
31
+ return null;
36
32
  }
37
- return null;
38
33
  }
39
34
  async findProductsByQuery(query) {
40
35
  const queryStr = this.stringifyQuery(query);
@@ -42,13 +37,8 @@ class CatalogGraphQLClient extends abstractGraphQLClient_1.AbstractGraphQLClient
42
37
  return await this.find(queryStr);
43
38
  }
44
39
  catch (error) {
45
- const exception = this.mapToPublicApiException(error);
46
- const { mustRetry } = await this.handleError(exception);
47
- if (mustRetry) {
48
- return await this.find(queryStr);
49
- }
40
+ return null;
50
41
  }
51
- return null;
52
42
  }
53
43
  async findOneProductByQuery(query) {
54
44
  this.path = this.GRAPHQL;
@@ -57,13 +47,8 @@ class CatalogGraphQLClient extends abstractGraphQLClient_1.AbstractGraphQLClient
57
47
  return await this.post(queryStr);
58
48
  }
59
49
  catch (error) {
60
- const exception = this.mapToPublicApiException(error);
61
- const { mustRetry } = await this.handleError(exception);
62
- if (mustRetry) {
63
- return await this.post(queryStr);
64
- }
50
+ return null;
65
51
  }
66
- return null;
67
52
  }
68
53
  async findOnePriceBandByQuery(query) {
69
54
  this.path = this.GRAPHQL;
@@ -72,13 +57,8 @@ class CatalogGraphQLClient extends abstractGraphQLClient_1.AbstractGraphQLClient
72
57
  return await this.post(queryStr);
73
58
  }
74
59
  catch (error) {
75
- const exception = this.mapToPublicApiException(error);
76
- const { mustRetry } = await this.handleError(exception);
77
- if (mustRetry) {
78
- return await this.post(queryStr);
79
- }
60
+ return null;
80
61
  }
81
- return null;
82
62
  }
83
63
  }
84
64
  exports.CatalogGraphQLClient = CatalogGraphQLClient;
@@ -2,15 +2,6 @@ import { AbstractRestfulClient, Parameters } from '../abstractRestfulClient';
2
2
  import { ConsumptionBI } from './entities/bi/consumptionBI';
3
3
  import { GetResult } from '../getResult';
4
4
  import { Consumption } from './entities/consumption/consumption';
5
- import { ConsumptionDownloadRequest } from './entities/consumption/consumptionDownloadRequest';
6
- export declare type ConsumptionDownloadRequestPayload = {
7
- customer: string;
8
- licenseRef: string;
9
- dateStart: string;
10
- dateEnd: string;
11
- columns: Array<string>;
12
- callbackURL: string;
13
- };
14
5
  export declare class ConsumptionClient extends AbstractRestfulClient {
15
6
  /**
16
7
  * The base path of the API
@@ -19,5 +10,4 @@ export declare class ConsumptionClient extends AbstractRestfulClient {
19
10
  getMonthlyConsumption(licenseReference: string, parameters: Parameters): Promise<GetResult<Consumption>>;
20
11
  getDailyConsumption(licenseReference: string, parameters: Parameters): Promise<GetResult<Consumption>>;
21
12
  getBIConsumption(parameters: Parameters): Promise<GetResult<ConsumptionBI>>;
22
- consumptionDownloadRequest(payload: ConsumptionDownloadRequestPayload): Promise<ConsumptionDownloadRequest>;
23
13
  }
@@ -5,7 +5,6 @@ const abstractRestfulClient_1 = require("../abstractRestfulClient");
5
5
  const consumptionBI_1 = require("./entities/bi/consumptionBI");
6
6
  const getResult_1 = require("../getResult");
7
7
  const consumption_1 = require("./entities/consumption/consumption");
8
- const consumptionDownloadRequest_1 = require("./entities/consumption/consumptionDownloadRequest");
9
8
  class ConsumptionClient extends abstractRestfulClient_1.AbstractRestfulClient {
10
9
  constructor() {
11
10
  super(...arguments);
@@ -26,10 +25,6 @@ class ConsumptionClient extends abstractRestfulClient_1.AbstractRestfulClient {
26
25
  this.path = '/bi/top/monthly';
27
26
  return new getResult_1.GetResult(consumptionBI_1.ConsumptionBI, await this.get(parameters));
28
27
  }
29
- async consumptionDownloadRequest(payload) {
30
- this.path = '/v2/downloadRequest';
31
- return new consumptionDownloadRequest_1.ConsumptionDownloadRequest(await this.post(payload));
32
- }
33
28
  }
34
29
  exports.ConsumptionClient = ConsumptionClient;
35
30
  //# sourceMappingURL=consumptionClient.js.map
@@ -2,5 +2,4 @@ export * from './entities/consumption/consumption';
2
2
  export * from './entities/bi/period/period';
3
3
  export * from './entities/bi/top/top';
4
4
  export * from './entities/bi/consumptionBI';
5
- export * from './entities/consumption/consumptionDownloadRequest';
6
5
  export * from './consumptionClient';
@@ -18,6 +18,5 @@ __exportStar(require("./entities/consumption/consumption"), exports);
18
18
  __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
- __exportStar(require("./entities/consumption/consumptionDownloadRequest"), exports);
22
21
  __exportStar(require("./consumptionClient"), exports);
23
22
  //# sourceMappingURL=index.js.map
@@ -19,6 +19,7 @@ import { NotificationsClient } from './notifications';
19
19
  */
20
20
  export declare class PublicApiClient extends AbstractRestfulClient {
21
21
  constructor();
22
+ private applyConfig;
22
23
  /**
23
24
  * Creates a new {@link CustomersClient} instance and returns it
24
25
  * @returns {@link CustomersClient}
@@ -24,149 +24,125 @@ class PublicApiClient extends abstractRestfulClient_1.AbstractRestfulClient {
24
24
  constructor() {
25
25
  super();
26
26
  }
27
+ applyConfig(client) {
28
+ return client
29
+ .setUrl(this.url)
30
+ .setSecurity(this.security)
31
+ .setApiKey(this.apiKey)
32
+ .setHeaders(this.headers)
33
+ .setHttpExceptionHandlers(this.httpExceptionHandlers);
34
+ }
27
35
  /**
28
36
  * Creates a new {@link CustomersClient} instance and returns it
29
37
  * @returns {@link CustomersClient}
30
38
  */
31
39
  getCustomersClient(configuration) {
32
- return new customers_1.CustomersClient(configuration)
33
- .setUrl(this.url)
34
- .setApiKey(this.apiKey)
35
- .setHeaders(this.headers)
36
- .setHttpExceptionHandlers(this.httpExceptionHandlers);
40
+ const client = new customers_1.CustomersClient(configuration);
41
+ this.applyConfig(client);
42
+ return client;
37
43
  }
38
44
  /**
39
45
  * Creates a new {@link WhoAmIClient} instance and returns it
40
46
  * @returns {@link WhoAmIClient}
41
47
  */
42
48
  getWhoamiClient(configuration) {
43
- return new general_1.WhoAmIClient(configuration)
44
- .setUrl(this.url)
45
- .setApiKey(this.apiKey)
46
- .setHeaders(this.headers)
47
- .setHttpExceptionHandlers(this.httpExceptionHandlers);
49
+ const client = new general_1.WhoAmIClient(configuration);
50
+ this.applyConfig(client);
51
+ return client;
48
52
  }
49
53
  /**
50
54
  * Creates a new {@link LicensesClient} instance and returns it
51
55
  * @returns {@link LicensesClient}
52
56
  */
53
57
  getLicensesClient(configuration) {
54
- return new licenses_1.LicensesClient(configuration)
55
- .setUrl(this.url)
56
- .setApiKey(this.apiKey)
57
- .setHeaders(this.headers)
58
- .setHttpExceptionHandlers(this.httpExceptionHandlers);
58
+ const client = new licenses_1.LicensesClient(configuration);
59
+ this.applyConfig(client);
60
+ return client;
59
61
  }
60
62
  /**
61
63
  * Creates a new {@link CheckDomainClient} instance and returns it
62
64
  * @returns {@link CheckDomainClient}
63
65
  */
64
66
  getCheckDomainClient(configuration) {
65
- return new general_1.CheckDomainClient(configuration)
66
- .setUrl(this.url)
67
- .setApiKey(this.apiKey)
68
- .setHeaders(this.headers)
69
- .setHttpExceptionHandlers(this.httpExceptionHandlers);
67
+ const client = new general_1.CheckDomainClient(configuration);
68
+ this.applyConfig(client);
69
+ return client;
70
70
  }
71
71
  /**
72
72
  * Creates a new {@link SubscriptionsClient} instance and returns it
73
73
  * @returns {@link SubscriptionsClient}
74
74
  */
75
75
  getSubscriptionsClient(configuration) {
76
- return new subscriptions_1.SubscriptionsClient(configuration)
77
- .setUrl(this.url)
78
- .setApiKey(this.apiKey)
79
- .setHeaders(this.headers)
80
- .setHttpExceptionHandlers(this.httpExceptionHandlers);
76
+ const client = new subscriptions_1.SubscriptionsClient(configuration);
77
+ this.applyConfig(client);
78
+ return client;
81
79
  }
82
80
  /**
83
81
  * Creates a new {@link OrdersClient} instance and returns it
84
82
  * @returns {@link OrdersClient}
85
83
  */
86
84
  getOrdersClient(configuration) {
87
- return new orders_1.OrdersClient(configuration)
88
- .setUrl(this.url)
89
- .setApiKey(this.apiKey)
90
- .setHeaders(this.headers)
91
- .setHttpExceptionHandlers(this.httpExceptionHandlers);
85
+ const client = new orders_1.OrdersClient(configuration);
86
+ this.applyConfig(client);
87
+ return client;
92
88
  }
93
89
  /**
94
90
  * Creates a new {@link ContactClient} instance and returns it
95
91
  * @returns {@link ContactClient}
96
92
  */
97
93
  getContactClient(configuration) {
98
- return new contact_1.ContactClient(configuration)
99
- .setUrl(this.url)
100
- .setApiKey(this.apiKey)
101
- .setHeaders(this.headers)
102
- .setHttpExceptionHandlers(this.httpExceptionHandlers);
94
+ const client = new contact_1.ContactClient(configuration);
95
+ this.applyConfig(client);
96
+ return client;
103
97
  }
104
98
  /**
105
99
  * Creates a new {@link ContactClient} instance and returns it
106
100
  * @returns {@link ContactClient}
107
101
  */
108
102
  getCampaignClient(configuration) {
109
- return new campaign_1.CampaignClient(configuration)
110
- .setUrl(this.url)
111
- .setApiKey(this.apiKey)
112
- .setHeaders(this.headers)
113
- .setHttpExceptionHandlers(this.httpExceptionHandlers);
103
+ const client = new campaign_1.CampaignClient(configuration);
104
+ this.applyConfig(client);
105
+ return client;
114
106
  }
115
107
  getConsumptionClient(configuration) {
116
- return new consumption_1.ConsumptionClient(configuration)
117
- .setUrl(this.url)
118
- .setApiKey(this.apiKey)
119
- .setHeaders(this.headers)
120
- .setHttpExceptionHandlers(this.httpExceptionHandlers);
108
+ const client = new consumption_1.ConsumptionClient(configuration);
109
+ this.applyConfig(client);
110
+ return client;
121
111
  }
122
112
  getSecurityStandardsClient(configuration) {
123
- return new standardsClient_1.StandardsClient(configuration)
124
- .setUrl(this.url)
125
- .setApiKey(this.apiKey)
126
- .setHeaders(this.headers)
127
- .setHttpExceptionHandlers(this.httpExceptionHandlers);
113
+ const client = new standardsClient_1.StandardsClient(configuration);
114
+ this.applyConfig(client);
115
+ return client;
128
116
  }
129
117
  getSecurityRegisterClient(configuration) {
130
- return new security_1.RegisterClient(configuration)
131
- .setUrl(this.url)
132
- .setApiKey(this.apiKey)
133
- .setHeaders(this.headers)
134
- .setHttpExceptionHandlers(this.httpExceptionHandlers);
118
+ const client = new security_1.RegisterClient(configuration);
119
+ this.applyConfig(client);
120
+ return client;
135
121
  }
136
122
  getCartClient(configuration) {
137
- return new cartClient_1.CartClient(configuration)
138
- .setUrl(this.url)
139
- .setApiKey(this.apiKey)
140
- .setHeaders(this.headers)
141
- .setHttpExceptionHandlers(this.httpExceptionHandlers);
123
+ const client = new cartClient_1.CartClient(configuration);
124
+ this.applyConfig(client);
125
+ return client;
142
126
  }
143
127
  getSupportCenterClient(configuration) {
144
- return new supportCenter_1.SupportCenterClient(configuration)
145
- .setUrl(this.url)
146
- .setApiKey(this.apiKey)
147
- .setHeaders(this.headers)
148
- .setHttpExceptionHandlers(this.httpExceptionHandlers);
128
+ const client = new supportCenter_1.SupportCenterClient(configuration);
129
+ this.applyConfig(client);
130
+ return client;
149
131
  }
150
132
  getCatalogClient(configuration) {
151
- return new catalog_1.CatalogClient(configuration)
152
- .setUrl(this.url)
153
- .setApiKey(this.apiKey)
154
- .setHeaders(this.headers)
155
- .setHttpExceptionHandlers(this.httpExceptionHandlers);
133
+ const client = new catalog_1.CatalogClient(configuration);
134
+ this.applyConfig(client);
135
+ return client;
156
136
  }
157
137
  getUserClient(configuration) {
158
- return new user_1.UserClient(configuration)
159
- .setUrl(this.url)
160
- .setApiKey(this.apiKey)
161
- .setHeaders(this.headers)
162
- .setHttpExceptionHandlers(this.httpExceptionHandlers);
138
+ const client = new user_1.UserClient(configuration);
139
+ this.applyConfig(client);
140
+ return client;
163
141
  }
164
142
  getNotificationsClient(configuration) {
165
- return new notifications_1.NotificationsClient(configuration)
166
- .setUrl(this.url)
167
- .setToken(this.token)
168
- .setHeaders(this.headers)
169
- .setHttpExceptionHandlers(this.httpExceptionHandlers);
143
+ const client = new notifications_1.NotificationsClient(configuration);
144
+ this.applyConfig(client);
145
+ return client;
170
146
  }
171
147
  }
172
148
  exports.PublicApiClient = PublicApiClient;
@@ -25,13 +25,8 @@ class SecurityScoreGraphQLClient extends abstractGraphQLClient_1.AbstractGraphQL
25
25
  return await this.post(request);
26
26
  }
27
27
  catch (error) {
28
- const exception = this.mapToPublicApiException(error);
29
- const { mustRetry } = await this.handleError(exception);
30
- if (mustRetry) {
31
- return await this.post(request);
32
- }
28
+ return null;
33
29
  }
34
- return null;
35
30
  }
36
31
  async getPartnerData(getPartnerDataQuery) {
37
32
  const queryStr = this.stringifyQuery(getPartnerDataQuery);
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.45.0-rc.ckh.1",
7
+ "version": "3.45.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",
@@ -1,19 +0,0 @@
1
- import { AbstractEntity } from '../../../abstractEntity';
2
- export declare enum ConsumptionDownloadRequestFields {
3
- COLUMN_REF = "ref",
4
- COLUMN_LINK = "link",
5
- COLUMN_LINK_EXPIRATION_DATE = "linkExpirationDate"
6
- }
7
- export declare type ConsumptionDownloadRequestType = {
8
- [ConsumptionDownloadRequestFields.COLUMN_REF]: string;
9
- [ConsumptionDownloadRequestFields.COLUMN_LINK]?: Array<string>;
10
- [ConsumptionDownloadRequestFields.COLUMN_LINK_EXPIRATION_DATE]?: string;
11
- };
12
- export declare class ConsumptionDownloadRequest extends AbstractEntity<ConsumptionDownloadRequestType> {
13
- #private;
14
- constructor(consumptionResponse: ConsumptionDownloadRequestType);
15
- get ref(): string;
16
- get link(): Array<string> | undefined;
17
- get linkExpirationDate(): string | undefined;
18
- toJSON(): ConsumptionDownloadRequestType;
19
- }
@@ -1,53 +0,0 @@
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 _ConsumptionDownloadRequest_ref, _ConsumptionDownloadRequest_link, _ConsumptionDownloadRequest_linkExpirationDate;
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.ConsumptionDownloadRequest = exports.ConsumptionDownloadRequestFields = void 0;
16
- const abstractEntity_1 = require("../../../abstractEntity");
17
- var ConsumptionDownloadRequestFields;
18
- (function (ConsumptionDownloadRequestFields) {
19
- ConsumptionDownloadRequestFields["COLUMN_REF"] = "ref";
20
- ConsumptionDownloadRequestFields["COLUMN_LINK"] = "link";
21
- ConsumptionDownloadRequestFields["COLUMN_LINK_EXPIRATION_DATE"] = "linkExpirationDate";
22
- })(ConsumptionDownloadRequestFields = exports.ConsumptionDownloadRequestFields || (exports.ConsumptionDownloadRequestFields = {}));
23
- class ConsumptionDownloadRequest extends abstractEntity_1.AbstractEntity {
24
- constructor(consumptionResponse) {
25
- super(consumptionResponse);
26
- _ConsumptionDownloadRequest_ref.set(this, void 0);
27
- _ConsumptionDownloadRequest_link.set(this, void 0);
28
- _ConsumptionDownloadRequest_linkExpirationDate.set(this, void 0);
29
- __classPrivateFieldSet(this, _ConsumptionDownloadRequest_ref, consumptionResponse[ConsumptionDownloadRequestFields.COLUMN_REF], "f");
30
- __classPrivateFieldSet(this, _ConsumptionDownloadRequest_link, consumptionResponse[ConsumptionDownloadRequestFields.COLUMN_LINK], "f");
31
- __classPrivateFieldSet(this, _ConsumptionDownloadRequest_linkExpirationDate, consumptionResponse[ConsumptionDownloadRequestFields.COLUMN_LINK_EXPIRATION_DATE], "f");
32
- }
33
- get ref() {
34
- return __classPrivateFieldGet(this, _ConsumptionDownloadRequest_ref, "f");
35
- }
36
- get link() {
37
- return __classPrivateFieldGet(this, _ConsumptionDownloadRequest_link, "f");
38
- }
39
- get linkExpirationDate() {
40
- return __classPrivateFieldGet(this, _ConsumptionDownloadRequest_linkExpirationDate, "f");
41
- }
42
- toJSON() {
43
- return {
44
- [ConsumptionDownloadRequestFields.COLUMN_REF]: this.ref,
45
- [ConsumptionDownloadRequestFields.COLUMN_LINK]: this.link,
46
- [ConsumptionDownloadRequestFields.COLUMN_LINK_EXPIRATION_DATE]: this
47
- .linkExpirationDate,
48
- };
49
- }
50
- }
51
- exports.ConsumptionDownloadRequest = ConsumptionDownloadRequest;
52
- _ConsumptionDownloadRequest_ref = new WeakMap(), _ConsumptionDownloadRequest_link = new WeakMap(), _ConsumptionDownloadRequest_linkExpirationDate = new WeakMap();
53
- //# sourceMappingURL=consumptionDownloadRequest.js.map