@arrowsphere/api-client 3.14.0 → 3.15.0-rc.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.
@@ -49,6 +49,10 @@ export declare abstract class AbstractClient {
49
49
  * Defines whether the pagination options are camel cased or not
50
50
  */
51
51
  protected isCamelPagination: boolean;
52
+ /**
53
+ * Defines header information for axios call
54
+ */
55
+ protected headers: Headers;
52
56
  /**
53
57
  * AbstractClient constructor.
54
58
  * @param client - Pre-existing Axios instance that will be used for calls
@@ -84,10 +88,17 @@ export declare abstract class AbstractClient {
84
88
  * @returns AbstractClient
85
89
  */
86
90
  setPage(page: number): this;
91
+ /**
92
+ * Sets Header Information
93
+ * @param headers - Header axios information
94
+ * @returns AbstractClient
95
+ */
96
+ setHeaders(headers: Record<string, string>): this;
87
97
  /**
88
98
  * Sends a GET request and returns the response
89
99
  * @param parameters - Query parameters to send
90
100
  * @param headers - Headers to send
101
+ * @param options - Options to send
91
102
  * @returns Promise\<AxiosResponse['data']\>
92
103
  */
93
104
  protected get<T = AxiosResponse['data']>(parameters?: Parameters, headers?: Headers, options?: Options): Promise<T>;
@@ -109,13 +120,31 @@ export declare abstract class AbstractClient {
109
120
  * @param payload - Payload to be sent in the POST body
110
121
  * @param parameters - Query parameters to be sent in the request
111
122
  * @param headers - Headers to be sent in the request
123
+ * @param options - Options to send
112
124
  */
113
125
  protected post(payload?: Payload, parameters?: Parameters, headers?: Headers, options?: Options): Promise<AxiosResponse['data']>;
126
+ /**
127
+ * Sends a PUT request
128
+ * @param payload - Payload to be sent in the POST body
129
+ * @param parameters - Query parameters to be sent in the request
130
+ * @param headers - Headers to be sent in the request
131
+ * @param options - Options to send
132
+ * @returns Promise\<void\>
133
+ */
114
134
  protected put(payload?: Payload, parameters?: Parameters, headers?: Headers, options?: Options): Promise<void>;
135
+ /**
136
+ * Sends a PATCH request
137
+ * @param payload - Payload to be sent in the POST body
138
+ * @param parameters - Query parameters to be sent in the request
139
+ * @param headers - Headers to be sent in the request
140
+ * @param options - Options to send
141
+ * @returns Promise\<T\>
142
+ */
115
143
  protected patch<T>(payload?: Payload, parameters?: Parameters, headers?: Headers, options?: Options): Promise<T>;
116
144
  /**
117
145
  * Generates the full url for request
118
146
  * @param parameters - Parameters to serialize
147
+ * @param options - Options to send
119
148
  * @returns string
120
149
  */
121
150
  protected generateUrl(parameters: Parameters, options: Options): string;
@@ -56,6 +56,10 @@ class AbstractClient {
56
56
  * Defines whether the pagination options are camel cased or not
57
57
  */
58
58
  this.isCamelPagination = false;
59
+ /**
60
+ * Defines header information for axios call
61
+ */
62
+ this.headers = {};
59
63
  this.client = client !== null && client !== void 0 ? client : axios_1.default.create();
60
64
  // Prevent axios from throwing its own errors, let us do that
61
65
  this.client.defaults.validateStatus = null;
@@ -103,10 +107,20 @@ class AbstractClient {
103
107
  this.page = page;
104
108
  return this;
105
109
  }
110
+ /**
111
+ * Sets Header Information
112
+ * @param headers - Header axios information
113
+ * @returns AbstractClient
114
+ */
115
+ setHeaders(headers) {
116
+ this.headers = headers;
117
+ return this;
118
+ }
106
119
  /**
107
120
  * Sends a GET request and returns the response
108
121
  * @param parameters - Query parameters to send
109
122
  * @param headers - Headers to send
123
+ * @param options - Options to send
110
124
  * @returns Promise\<AxiosResponse['data']\>
111
125
  */
112
126
  async get(parameters = {}, headers = {}, options = {}) {
@@ -136,7 +150,11 @@ class AbstractClient {
136
150
  * @returns {@link Headers}
137
151
  */
138
152
  prepareHeaders(headers) {
139
- return { ...headers, [ParameterKeys.API_KEY]: this.apiKey };
153
+ return {
154
+ ...headers,
155
+ [ParameterKeys.API_KEY]: this.apiKey,
156
+ ...this.headers,
157
+ };
140
158
  }
141
159
  /**
142
160
  * Sends a POST request and returns the response
@@ -144,6 +162,7 @@ class AbstractClient {
144
162
  * @param payload - Payload to be sent in the POST body
145
163
  * @param parameters - Query parameters to be sent in the request
146
164
  * @param headers - Headers to be sent in the request
165
+ * @param options - Options to send
147
166
  */
148
167
  async post(payload = {}, parameters = {}, headers = {}, options = {}) {
149
168
  const response = await this.client.post(this.generateUrl(parameters, options), payload, {
@@ -151,12 +170,28 @@ class AbstractClient {
151
170
  });
152
171
  return this.getResponse(response);
153
172
  }
173
+ /**
174
+ * Sends a PUT request
175
+ * @param payload - Payload to be sent in the POST body
176
+ * @param parameters - Query parameters to be sent in the request
177
+ * @param headers - Headers to be sent in the request
178
+ * @param options - Options to send
179
+ * @returns Promise\<void\>
180
+ */
154
181
  async put(payload = {}, parameters = {}, headers = {}, options = {}) {
155
182
  const response = await this.client.put(this.generateUrl(parameters, options), payload, {
156
183
  headers: this.prepareHeaders(headers),
157
184
  });
158
185
  return this.getResponse(response);
159
186
  }
187
+ /**
188
+ * Sends a PATCH request
189
+ * @param payload - Payload to be sent in the POST body
190
+ * @param parameters - Query parameters to be sent in the request
191
+ * @param headers - Headers to be sent in the request
192
+ * @param options - Options to send
193
+ * @returns Promise\<T\>
194
+ */
160
195
  async patch(payload = {}, parameters = {}, headers = {}, options = {}) {
161
196
  const response = await this.client.patch(this.generateUrl(parameters, options), payload, {
162
197
  headers: this.prepareHeaders(headers),
@@ -166,6 +201,7 @@ class AbstractClient {
166
201
  /**
167
202
  * Generates the full url for request
168
203
  * @param parameters - Parameters to serialize
204
+ * @param options - Options to send
169
205
  * @returns string
170
206
  */
171
207
  generateUrl(parameters, options) {
@@ -0,0 +1,32 @@
1
+ import { AbstractEntity } from '../../../abstractEntity';
2
+ export declare enum HistoryNotesFields {
3
+ COLUMN_BEFORE = "before",
4
+ COLUMN_AFTER = "after",
5
+ COLUMN_EXTRA_INFORMATION = "extra_information"
6
+ }
7
+ export declare type HistoryNotesGetData = {
8
+ [HistoryNotesFields.COLUMN_BEFORE]: Record<string, unknown>;
9
+ [HistoryNotesFields.COLUMN_AFTER]: Record<string, unknown>;
10
+ [HistoryNotesFields.COLUMN_EXTRA_INFORMATION]: Record<string, unknown>;
11
+ };
12
+ export declare enum ActionHistoryResultFields {
13
+ COLUMN_ACTION = "action",
14
+ COLUMN_NOTES = "notes",
15
+ COLUMN_CREATED_AT = "created_at",
16
+ COLUMN_UPDATED_AT = "updated_at"
17
+ }
18
+ export declare type ActionHistoryResultData = {
19
+ [ActionHistoryResultFields.COLUMN_ACTION]: string;
20
+ [ActionHistoryResultFields.COLUMN_NOTES]: HistoryNotesGetData;
21
+ [ActionHistoryResultFields.COLUMN_CREATED_AT]: string;
22
+ [ActionHistoryResultFields.COLUMN_UPDATED_AT]: string;
23
+ };
24
+ export declare class ActionHistoryResult extends AbstractEntity<ActionHistoryResultData> {
25
+ #private;
26
+ constructor(licenseHistoryGetDataInput: ActionHistoryResultData);
27
+ get action(): string;
28
+ get notes(): HistoryNotesGetData;
29
+ get createdAt(): string;
30
+ get updatedAt(): string;
31
+ toJSON(): ActionHistoryResultData;
32
+ }
@@ -14,7 +14,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
14
14
  };
15
15
  var _action, _notes, _created_at, _updated_at;
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.LicenseHistoryResult = exports.LicenseHistoryGetFields = exports.HistoryNotesFields = void 0;
17
+ exports.ActionHistoryResult = exports.ActionHistoryResultFields = exports.HistoryNotesFields = void 0;
18
18
  const abstractEntity_1 = require("../../../abstractEntity");
19
19
  var HistoryNotesFields;
20
20
  (function (HistoryNotesFields) {
@@ -22,24 +22,24 @@ var HistoryNotesFields;
22
22
  HistoryNotesFields["COLUMN_AFTER"] = "after";
23
23
  HistoryNotesFields["COLUMN_EXTRA_INFORMATION"] = "extra_information";
24
24
  })(HistoryNotesFields = exports.HistoryNotesFields || (exports.HistoryNotesFields = {}));
25
- var LicenseHistoryGetFields;
26
- (function (LicenseHistoryGetFields) {
27
- LicenseHistoryGetFields["COLUMN_LICENSE_HISTORY_ACTION"] = "action";
28
- LicenseHistoryGetFields["COLUMN_LICENSE_HISTORY_NOTES"] = "notes";
29
- LicenseHistoryGetFields["COLUMN_LICENSE_HISTORY_CREATED_AT"] = "created_at";
30
- LicenseHistoryGetFields["COLUMN_LICENSE_HISTORY_UPDATED_AT"] = "updated_at";
31
- })(LicenseHistoryGetFields = exports.LicenseHistoryGetFields || (exports.LicenseHistoryGetFields = {}));
32
- class LicenseHistoryResult extends abstractEntity_1.AbstractEntity {
25
+ var ActionHistoryResultFields;
26
+ (function (ActionHistoryResultFields) {
27
+ ActionHistoryResultFields["COLUMN_ACTION"] = "action";
28
+ ActionHistoryResultFields["COLUMN_NOTES"] = "notes";
29
+ ActionHistoryResultFields["COLUMN_CREATED_AT"] = "created_at";
30
+ ActionHistoryResultFields["COLUMN_UPDATED_AT"] = "updated_at";
31
+ })(ActionHistoryResultFields = exports.ActionHistoryResultFields || (exports.ActionHistoryResultFields = {}));
32
+ class ActionHistoryResult extends abstractEntity_1.AbstractEntity {
33
33
  constructor(licenseHistoryGetDataInput) {
34
34
  super(licenseHistoryGetDataInput);
35
35
  _action.set(this, void 0);
36
36
  _notes.set(this, void 0);
37
37
  _created_at.set(this, void 0);
38
38
  _updated_at.set(this, void 0);
39
- __classPrivateFieldSet(this, _action, licenseHistoryGetDataInput[LicenseHistoryGetFields.COLUMN_LICENSE_HISTORY_ACTION]);
40
- __classPrivateFieldSet(this, _notes, licenseHistoryGetDataInput[LicenseHistoryGetFields.COLUMN_LICENSE_HISTORY_NOTES]);
41
- __classPrivateFieldSet(this, _created_at, licenseHistoryGetDataInput[LicenseHistoryGetFields.COLUMN_LICENSE_HISTORY_CREATED_AT]);
42
- __classPrivateFieldSet(this, _updated_at, licenseHistoryGetDataInput[LicenseHistoryGetFields.COLUMN_LICENSE_HISTORY_UPDATED_AT]);
39
+ __classPrivateFieldSet(this, _action, licenseHistoryGetDataInput[ActionHistoryResultFields.COLUMN_ACTION]);
40
+ __classPrivateFieldSet(this, _notes, licenseHistoryGetDataInput[ActionHistoryResultFields.COLUMN_NOTES]);
41
+ __classPrivateFieldSet(this, _created_at, licenseHistoryGetDataInput[ActionHistoryResultFields.COLUMN_CREATED_AT]);
42
+ __classPrivateFieldSet(this, _updated_at, licenseHistoryGetDataInput[ActionHistoryResultFields.COLUMN_UPDATED_AT]);
43
43
  }
44
44
  get action() {
45
45
  return __classPrivateFieldGet(this, _action);
@@ -55,15 +55,13 @@ class LicenseHistoryResult extends abstractEntity_1.AbstractEntity {
55
55
  }
56
56
  toJSON() {
57
57
  return {
58
- [LicenseHistoryGetFields.COLUMN_LICENSE_HISTORY_ACTION]: this.action,
59
- [LicenseHistoryGetFields.COLUMN_LICENSE_HISTORY_NOTES]: this.notes,
60
- [LicenseHistoryGetFields.COLUMN_LICENSE_HISTORY_CREATED_AT]: this
61
- .createdAt,
62
- [LicenseHistoryGetFields.COLUMN_LICENSE_HISTORY_UPDATED_AT]: this
63
- .updatedAt,
58
+ [ActionHistoryResultFields.COLUMN_ACTION]: this.action,
59
+ [ActionHistoryResultFields.COLUMN_NOTES]: this.notes,
60
+ [ActionHistoryResultFields.COLUMN_CREATED_AT]: this.createdAt,
61
+ [ActionHistoryResultFields.COLUMN_UPDATED_AT]: this.updatedAt,
64
62
  };
65
63
  }
66
64
  }
67
- exports.LicenseHistoryResult = LicenseHistoryResult;
65
+ exports.ActionHistoryResult = ActionHistoryResult;
68
66
  _action = new WeakMap(), _notes = new WeakMap(), _created_at = new WeakMap(), _updated_at = new WeakMap();
69
- //# sourceMappingURL=getLicenseHistoryResult.js.map
67
+ //# sourceMappingURL=actionHistoryResult.js.map
@@ -0,0 +1,14 @@
1
+ import { AbstractEntity } from '../../../abstractEntity';
2
+ import { ActionHistoryResult, ActionHistoryResultData } from './actionHistoryResult';
3
+ export declare enum LicenceHistoryResultFields {
4
+ COLUMN_ACTIONS = "actions"
5
+ }
6
+ export declare type LicenceHistoryResultData = {
7
+ [LicenceHistoryResultFields.COLUMN_ACTIONS]: ActionHistoryResultData[];
8
+ };
9
+ export declare class LicenceHistoryResult extends AbstractEntity<LicenceHistoryResultData> {
10
+ #private;
11
+ constructor(getLicenseHistoryResultDataInput: LicenceHistoryResultData);
12
+ get licenseHistory(): ActionHistoryResult[];
13
+ toJSON(): LicenceHistoryResultData;
14
+ }
@@ -14,28 +14,28 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
14
14
  };
15
15
  var _licenseHistory;
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.GetLicenceHistoryResult = exports.GetLicenceHistoryResultFields = void 0;
17
+ exports.LicenceHistoryResult = exports.LicenceHistoryResultFields = void 0;
18
18
  const abstractEntity_1 = require("../../../abstractEntity");
19
- const getLicenseHistoryResult_1 = require("../history/getLicenseHistoryResult");
20
- var GetLicenceHistoryResultFields;
21
- (function (GetLicenceHistoryResultFields) {
22
- GetLicenceHistoryResultFields["COLUMN_LICENSE_HISTORY"] = "actions";
23
- })(GetLicenceHistoryResultFields = exports.GetLicenceHistoryResultFields || (exports.GetLicenceHistoryResultFields = {}));
24
- class GetLicenceHistoryResult extends abstractEntity_1.AbstractEntity {
19
+ const actionHistoryResult_1 = require("./actionHistoryResult");
20
+ var LicenceHistoryResultFields;
21
+ (function (LicenceHistoryResultFields) {
22
+ LicenceHistoryResultFields["COLUMN_ACTIONS"] = "actions";
23
+ })(LicenceHistoryResultFields = exports.LicenceHistoryResultFields || (exports.LicenceHistoryResultFields = {}));
24
+ class LicenceHistoryResult extends abstractEntity_1.AbstractEntity {
25
25
  constructor(getLicenseHistoryResultDataInput) {
26
26
  super(getLicenseHistoryResultDataInput);
27
27
  _licenseHistory.set(this, void 0);
28
- __classPrivateFieldSet(this, _licenseHistory, getLicenseHistoryResultDataInput[GetLicenceHistoryResultFields.COLUMN_LICENSE_HISTORY].map((result) => new getLicenseHistoryResult_1.LicenseHistoryResult(result)));
28
+ __classPrivateFieldSet(this, _licenseHistory, getLicenseHistoryResultDataInput[LicenceHistoryResultFields.COLUMN_ACTIONS].map((result) => new actionHistoryResult_1.ActionHistoryResult(result)));
29
29
  }
30
30
  get licenseHistory() {
31
31
  return __classPrivateFieldGet(this, _licenseHistory);
32
32
  }
33
33
  toJSON() {
34
34
  return {
35
- [GetLicenceHistoryResultFields.COLUMN_LICENSE_HISTORY]: this.licenseHistory.map((result) => result.toJSON()),
35
+ [LicenceHistoryResultFields.COLUMN_ACTIONS]: this.licenseHistory.map((result) => result.toJSON()),
36
36
  };
37
37
  }
38
38
  }
39
- exports.GetLicenceHistoryResult = GetLicenceHistoryResult;
39
+ exports.LicenceHistoryResult = LicenceHistoryResult;
40
40
  _licenseHistory = new WeakMap();
41
41
  //# sourceMappingURL=licenceHistoryResult.js.map
@@ -7,6 +7,8 @@ export * from './entities/getLicense/licenseGetResult';
7
7
  export * from './entities/getLicense/licensePriceGetResult';
8
8
  export * from './entities/getLicense/orderGetResult';
9
9
  export * from './entities/getResult/getLicenseResult';
10
+ export * from './entities/history/actionHistoryResult';
11
+ export * from './entities/history/licenceHistoryResult';
10
12
  export * from './entities/license/activeSeatsFindResult';
11
13
  export * from './entities/license/configFindResult';
12
14
  export * from './entities/license/licenseFindResult';
@@ -19,6 +19,8 @@ __exportStar(require("./entities/getLicense/licenseGetResult"), exports);
19
19
  __exportStar(require("./entities/getLicense/licensePriceGetResult"), exports);
20
20
  __exportStar(require("./entities/getLicense/orderGetResult"), exports);
21
21
  __exportStar(require("./entities/getResult/getLicenseResult"), exports);
22
+ __exportStar(require("./entities/history/actionHistoryResult"), exports);
23
+ __exportStar(require("./entities/history/licenceHistoryResult"), exports);
22
24
  __exportStar(require("./entities/license/activeSeatsFindResult"), exports);
23
25
  __exportStar(require("./entities/license/configFindResult"), exports);
24
26
  __exportStar(require("./entities/license/licenseFindResult"), exports);
@@ -14,7 +14,7 @@ import { PriceBandFindResultDataKeywords, PriceBandFindResultDataSortParameters
14
14
  import { GetResult } from '../getResult';
15
15
  import { LicenseGetFields } from './entities/getLicense/licenseGetResult';
16
16
  import { GetLicenseResult } from './entities/getResult/getLicenseResult';
17
- import { GetLicenceHistoryResult } from './entities/getLicense/licenceHistoryResult';
17
+ import { LicenceHistoryResult } from './entities/history/licenceHistoryResult';
18
18
  /**
19
19
  * Parameters passable to the request for refining search.
20
20
  */
@@ -262,5 +262,5 @@ export declare class LicensesClient extends AbstractClient {
262
262
  reactivateLicense(licenseReference: string, parameters?: Parameters): Promise<void>;
263
263
  cancelLicense(licenseReference: string, parameters?: Parameters): Promise<void>;
264
264
  updateFriendlyName(licenseReference: string, putData: PutFriendlyName, parameters?: Parameters): Promise<void>;
265
- getHistory(licenseReference: string, parameters?: Parameters): Promise<GetResult<GetLicenceHistoryResult>>;
265
+ getHistory(licenseReference: string, parameters?: Parameters): Promise<GetResult<LicenceHistoryResult>>;
266
266
  }
@@ -10,7 +10,7 @@ const configFindResult_1 = require("./entities/license/configFindResult");
10
10
  const getResult_1 = require("../getResult");
11
11
  const licenseGetResult_1 = require("./entities/getLicense/licenseGetResult");
12
12
  const getLicenseResult_1 = require("./entities/getResult/getLicenseResult");
13
- const licenceHistoryResult_1 = require("./entities/getLicense/licenceHistoryResult");
13
+ const licenceHistoryResult_1 = require("./entities/history/licenceHistoryResult");
14
14
  /**
15
15
  * Parameters passable to the request for refining search.
16
16
  */
@@ -284,7 +284,7 @@ class LicensesClient extends abstractClient_1.AbstractClient {
284
284
  }
285
285
  async getHistory(licenseReference, parameters = {}) {
286
286
  this.path = licenseReference + this.GET_LICENSE_HISTORY_PATH;
287
- return new getResult_1.GetResult(licenceHistoryResult_1.GetLicenceHistoryResult, await this.get(parameters));
287
+ return new getResult_1.GetResult(licenceHistoryResult_1.LicenceHistoryResult, await this.get(parameters));
288
288
  }
289
289
  }
290
290
  exports.LicensesClient = LicensesClient;
@@ -1,12 +1,12 @@
1
1
  import { AbstractClient } from './abstractClient';
2
2
  import { CheckDomainClient, WhoAmIClient } from './general';
3
- import { LicensesClient } from './licenses/licensesClient';
4
- import { SubscriptionsClient } from './subscriptions/subscriptionsClient';
5
- import { CustomersClient } from './customers/customersClient';
3
+ import { LicensesClient } from './licenses';
4
+ import { SubscriptionsClient } from './subscriptions';
5
+ import { CustomersClient } from './customers';
6
6
  import { OrdersClient } from './orders';
7
- import { ContactClient } from './contact/contactClient';
7
+ import { ContactClient } from './contact';
8
8
  import { CampaignClient } from './campaign';
9
- import { ConsumptionClient } from './consumption/consumptionClient';
9
+ import { ConsumptionClient } from './consumption';
10
10
  /**
11
11
  * Public API Client class, should be the main entry point for your calls
12
12
  */
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PublicApiClient = void 0;
4
4
  const abstractClient_1 = require("./abstractClient");
5
5
  const general_1 = require("./general");
6
- const licensesClient_1 = require("./licenses/licensesClient");
7
- const subscriptionsClient_1 = require("./subscriptions/subscriptionsClient");
8
- const customersClient_1 = require("./customers/customersClient");
6
+ const licenses_1 = require("./licenses");
7
+ const subscriptions_1 = require("./subscriptions");
8
+ const customers_1 = require("./customers");
9
9
  const orders_1 = require("./orders");
10
- const contactClient_1 = require("./contact/contactClient");
10
+ const contact_1 = require("./contact");
11
11
  const campaign_1 = require("./campaign");
12
- const consumptionClient_1 = require("./consumption/consumptionClient");
12
+ const consumption_1 = require("./consumption");
13
13
  /**
14
14
  * Public API Client class, should be the main entry point for your calls
15
15
  */
@@ -22,9 +22,10 @@ class PublicApiClient extends abstractClient_1.AbstractClient {
22
22
  * @returns {@link CustomersClient}
23
23
  */
24
24
  getCustomersClient() {
25
- return new customersClient_1.CustomersClient(this.client)
25
+ return new customers_1.CustomersClient(this.client)
26
26
  .setUrl(this.url)
27
- .setApiKey(this.apiKey);
27
+ .setApiKey(this.apiKey)
28
+ .setHeaders(this.headers);
28
29
  }
29
30
  /**
30
31
  * Creates a new {@link WhoAmIClient} instance and returns it
@@ -33,16 +34,18 @@ class PublicApiClient extends abstractClient_1.AbstractClient {
33
34
  getWhoamiClient() {
34
35
  return new general_1.WhoAmIClient(this.client)
35
36
  .setUrl(this.url)
36
- .setApiKey(this.apiKey);
37
+ .setApiKey(this.apiKey)
38
+ .setHeaders(this.headers);
37
39
  }
38
40
  /**
39
41
  * Creates a new {@link LicensesClient} instance and returns it
40
42
  * @returns {@link LicensesClient}
41
43
  */
42
44
  getLicensesClient() {
43
- return new licensesClient_1.LicensesClient(this.client)
45
+ return new licenses_1.LicensesClient(this.client)
44
46
  .setUrl(this.url)
45
- .setApiKey(this.apiKey);
47
+ .setApiKey(this.apiKey)
48
+ .setHeaders(this.headers);
46
49
  }
47
50
  /**
48
51
  * Creates a new {@link CheckDomainClient} instance and returns it
@@ -51,16 +54,18 @@ class PublicApiClient extends abstractClient_1.AbstractClient {
51
54
  getCheckDomainClient() {
52
55
  return new general_1.CheckDomainClient(this.client)
53
56
  .setUrl(this.url)
54
- .setApiKey(this.apiKey);
57
+ .setApiKey(this.apiKey)
58
+ .setHeaders(this.headers);
55
59
  }
56
60
  /**
57
61
  * Creates a new {@link SubscriptionsClient} instance and returns it
58
62
  * @returns {@link SubscriptionsClient}
59
63
  */
60
64
  getSubscriptionsClient() {
61
- return new subscriptionsClient_1.SubscriptionsClient(this.client)
65
+ return new subscriptions_1.SubscriptionsClient(this.client)
62
66
  .setUrl(this.url)
63
- .setApiKey(this.apiKey);
67
+ .setApiKey(this.apiKey)
68
+ .setHeaders(this.headers);
64
69
  }
65
70
  /**
66
71
  * Creates a new {@link OrdersClient} instance and returns it
@@ -69,16 +74,18 @@ class PublicApiClient extends abstractClient_1.AbstractClient {
69
74
  getOrdersClient() {
70
75
  return new orders_1.OrdersClient(this.client)
71
76
  .setUrl(this.url)
72
- .setApiKey(this.apiKey);
77
+ .setApiKey(this.apiKey)
78
+ .setHeaders(this.headers);
73
79
  }
74
80
  /**
75
81
  * Creates a new {@link ContactClient} instance and returns it
76
82
  * @returns {@link ContactClient}
77
83
  */
78
84
  getContactClient() {
79
- return new contactClient_1.ContactClient(this.client)
85
+ return new contact_1.ContactClient(this.client)
80
86
  .setUrl(this.url)
81
- .setApiKey(this.apiKey);
87
+ .setApiKey(this.apiKey)
88
+ .setHeaders(this.headers);
82
89
  }
83
90
  /**
84
91
  * Creates a new {@link ContactClient} instance and returns it
@@ -87,12 +94,14 @@ class PublicApiClient extends abstractClient_1.AbstractClient {
87
94
  getCampaignClient() {
88
95
  return new campaign_1.CampaignClient(this.client)
89
96
  .setUrl(this.url)
90
- .setApiKey(this.apiKey);
97
+ .setApiKey(this.apiKey)
98
+ .setHeaders(this.headers);
91
99
  }
92
100
  getConsumptionClient() {
93
- return new consumptionClient_1.ConsumptionClient(this.client)
101
+ return new consumption_1.ConsumptionClient(this.client)
94
102
  .setUrl(this.url)
95
- .setApiKey(this.apiKey);
103
+ .setApiKey(this.apiKey)
104
+ .setHeaders(this.headers);
96
105
  }
97
106
  }
98
107
  exports.PublicApiClient = PublicApiClient;
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.14.0",
7
+ "version": "3.15.0-rc.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",
@@ -1,14 +0,0 @@
1
- import { AbstractEntity } from '../../../abstractEntity';
2
- import { LicenseHistoryGetData, LicenseHistoryResult } from '../history/getLicenseHistoryResult';
3
- export declare enum GetLicenceHistoryResultFields {
4
- COLUMN_LICENSE_HISTORY = "actions"
5
- }
6
- export declare type GetLicenceHistoryResultData = {
7
- [GetLicenceHistoryResultFields.COLUMN_LICENSE_HISTORY]: LicenseHistoryGetData[];
8
- };
9
- export declare class GetLicenceHistoryResult extends AbstractEntity<GetLicenceHistoryResultData> {
10
- #private;
11
- constructor(getLicenseHistoryResultDataInput: GetLicenceHistoryResultData);
12
- get licenseHistory(): LicenseHistoryResult[];
13
- toJSON(): GetLicenceHistoryResultData;
14
- }
@@ -1,32 +0,0 @@
1
- import { AbstractEntity } from '../../../abstractEntity';
2
- export declare enum HistoryNotesFields {
3
- COLUMN_BEFORE = "before",
4
- COLUMN_AFTER = "after",
5
- COLUMN_EXTRA_INFORMATION = "extra_information"
6
- }
7
- export declare type HistoryNotesGetData = {
8
- [HistoryNotesFields.COLUMN_BEFORE]: Record<string, unknown>;
9
- [HistoryNotesFields.COLUMN_AFTER]: Record<string, unknown>;
10
- [HistoryNotesFields.COLUMN_EXTRA_INFORMATION]: Record<string, unknown>;
11
- };
12
- export declare enum LicenseHistoryGetFields {
13
- COLUMN_LICENSE_HISTORY_ACTION = "action",
14
- COLUMN_LICENSE_HISTORY_NOTES = "notes",
15
- COLUMN_LICENSE_HISTORY_CREATED_AT = "created_at",
16
- COLUMN_LICENSE_HISTORY_UPDATED_AT = "updated_at"
17
- }
18
- export declare type LicenseHistoryGetData = {
19
- [LicenseHistoryGetFields.COLUMN_LICENSE_HISTORY_ACTION]: string;
20
- [LicenseHistoryGetFields.COLUMN_LICENSE_HISTORY_NOTES]: HistoryNotesGetData;
21
- [LicenseHistoryGetFields.COLUMN_LICENSE_HISTORY_CREATED_AT]: string;
22
- [LicenseHistoryGetFields.COLUMN_LICENSE_HISTORY_UPDATED_AT]: string;
23
- };
24
- export declare class LicenseHistoryResult extends AbstractEntity<LicenseHistoryGetData> {
25
- #private;
26
- constructor(licenseHistoryGetDataInput: LicenseHistoryGetData);
27
- get action(): string;
28
- get notes(): HistoryNotesGetData;
29
- get createdAt(): string;
30
- get updatedAt(): string;
31
- toJSON(): LicenseHistoryGetData;
32
- }