@jupiterone/integration-sdk-http-client 8.13.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/LICENSE ADDED
@@ -0,0 +1,373 @@
1
+ Mozilla Public License Version 2.0
2
+ ==================================
3
+
4
+ 1. Definitions
5
+ --------------
6
+
7
+ 1.1. "Contributor"
8
+ means each individual or legal entity that creates, contributes to
9
+ the creation of, or owns Covered Software.
10
+
11
+ 1.2. "Contributor Version"
12
+ means the combination of the Contributions of others (if any) used
13
+ by a Contributor and that particular Contributor's Contribution.
14
+
15
+ 1.3. "Contribution"
16
+ means Covered Software of a particular Contributor.
17
+
18
+ 1.4. "Covered Software"
19
+ means Source Code Form to which the initial Contributor has attached
20
+ the notice in Exhibit A, the Executable Form of such Source Code
21
+ Form, and Modifications of such Source Code Form, in each case
22
+ including portions thereof.
23
+
24
+ 1.5. "Incompatible With Secondary Licenses"
25
+ means
26
+
27
+ (a) that the initial Contributor has attached the notice described
28
+ in Exhibit B to the Covered Software; or
29
+
30
+ (b) that the Covered Software was made available under the terms of
31
+ version 1.1 or earlier of the License, but not also under the
32
+ terms of a Secondary License.
33
+
34
+ 1.6. "Executable Form"
35
+ means any form of the work other than Source Code Form.
36
+
37
+ 1.7. "Larger Work"
38
+ means a work that combines Covered Software with other material, in
39
+ a separate file or files, that is not Covered Software.
40
+
41
+ 1.8. "License"
42
+ means this document.
43
+
44
+ 1.9. "Licensable"
45
+ means having the right to grant, to the maximum extent possible,
46
+ whether at the time of the initial grant or subsequently, any and
47
+ all of the rights conveyed by this License.
48
+
49
+ 1.10. "Modifications"
50
+ means any of the following:
51
+
52
+ (a) any file in Source Code Form that results from an addition to,
53
+ deletion from, or modification of the contents of Covered
54
+ Software; or
55
+
56
+ (b) any new file in Source Code Form that contains any Covered
57
+ Software.
58
+
59
+ 1.11. "Patent Claims" of a Contributor
60
+ means any patent claim(s), including without limitation, method,
61
+ process, and apparatus claims, in any patent Licensable by such
62
+ Contributor that would be infringed, but for the grant of the
63
+ License, by the making, using, selling, offering for sale, having
64
+ made, import, or transfer of either its Contributions or its
65
+ Contributor Version.
66
+
67
+ 1.12. "Secondary License"
68
+ means either the GNU General Public License, Version 2.0, the GNU
69
+ Lesser General Public License, Version 2.1, the GNU Affero General
70
+ Public License, Version 3.0, or any later versions of those
71
+ licenses.
72
+
73
+ 1.13. "Source Code Form"
74
+ means the form of the work preferred for making modifications.
75
+
76
+ 1.14. "You" (or "Your")
77
+ means an individual or a legal entity exercising rights under this
78
+ License. For legal entities, "You" includes any entity that
79
+ controls, is controlled by, or is under common control with You. For
80
+ purposes of this definition, "control" means (a) the power, direct
81
+ or indirect, to cause the direction or management of such entity,
82
+ whether by contract or otherwise, or (b) ownership of more than
83
+ fifty percent (50%) of the outstanding shares or beneficial
84
+ ownership of such entity.
85
+
86
+ 2. License Grants and Conditions
87
+ --------------------------------
88
+
89
+ 2.1. Grants
90
+
91
+ Each Contributor hereby grants You a world-wide, royalty-free,
92
+ non-exclusive license:
93
+
94
+ (a) under intellectual property rights (other than patent or trademark)
95
+ Licensable by such Contributor to use, reproduce, make available,
96
+ modify, display, perform, distribute, and otherwise exploit its
97
+ Contributions, either on an unmodified basis, with Modifications, or
98
+ as part of a Larger Work; and
99
+
100
+ (b) under Patent Claims of such Contributor to make, use, sell, offer
101
+ for sale, have made, import, and otherwise transfer either its
102
+ Contributions or its Contributor Version.
103
+
104
+ 2.2. Effective Date
105
+
106
+ The licenses granted in Section 2.1 with respect to any Contribution
107
+ become effective for each Contribution on the date the Contributor first
108
+ distributes such Contribution.
109
+
110
+ 2.3. Limitations on Grant Scope
111
+
112
+ The licenses granted in this Section 2 are the only rights granted under
113
+ this License. No additional rights or licenses will be implied from the
114
+ distribution or licensing of Covered Software under this License.
115
+ Notwithstanding Section 2.1(b) above, no patent license is granted by a
116
+ Contributor:
117
+
118
+ (a) for any code that a Contributor has removed from Covered Software;
119
+ or
120
+
121
+ (b) for infringements caused by: (i) Your and any other third party's
122
+ modifications of Covered Software, or (ii) the combination of its
123
+ Contributions with other software (except as part of its Contributor
124
+ Version); or
125
+
126
+ (c) under Patent Claims infringed by Covered Software in the absence of
127
+ its Contributions.
128
+
129
+ This License does not grant any rights in the trademarks, service marks,
130
+ or logos of any Contributor (except as may be necessary to comply with
131
+ the notice requirements in Section 3.4).
132
+
133
+ 2.4. Subsequent Licenses
134
+
135
+ No Contributor makes additional grants as a result of Your choice to
136
+ distribute the Covered Software under a subsequent version of this
137
+ License (see Section 10.2) or under the terms of a Secondary License (if
138
+ permitted under the terms of Section 3.3).
139
+
140
+ 2.5. Representation
141
+
142
+ Each Contributor represents that the Contributor believes its
143
+ Contributions are its original creation(s) or it has sufficient rights
144
+ to grant the rights to its Contributions conveyed by this License.
145
+
146
+ 2.6. Fair Use
147
+
148
+ This License is not intended to limit any rights You have under
149
+ applicable copyright doctrines of fair use, fair dealing, or other
150
+ equivalents.
151
+
152
+ 2.7. Conditions
153
+
154
+ Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
155
+ in Section 2.1.
156
+
157
+ 3. Responsibilities
158
+ -------------------
159
+
160
+ 3.1. Distribution of Source Form
161
+
162
+ All distribution of Covered Software in Source Code Form, including any
163
+ Modifications that You create or to which You contribute, must be under
164
+ the terms of this License. You must inform recipients that the Source
165
+ Code Form of the Covered Software is governed by the terms of this
166
+ License, and how they can obtain a copy of this License. You may not
167
+ attempt to alter or restrict the recipients' rights in the Source Code
168
+ Form.
169
+
170
+ 3.2. Distribution of Executable Form
171
+
172
+ If You distribute Covered Software in Executable Form then:
173
+
174
+ (a) such Covered Software must also be made available in Source Code
175
+ Form, as described in Section 3.1, and You must inform recipients of
176
+ the Executable Form how they can obtain a copy of such Source Code
177
+ Form by reasonable means in a timely manner, at a charge no more
178
+ than the cost of distribution to the recipient; and
179
+
180
+ (b) You may distribute such Executable Form under the terms of this
181
+ License, or sublicense it under different terms, provided that the
182
+ license for the Executable Form does not attempt to limit or alter
183
+ the recipients' rights in the Source Code Form under this License.
184
+
185
+ 3.3. Distribution of a Larger Work
186
+
187
+ You may create and distribute a Larger Work under terms of Your choice,
188
+ provided that You also comply with the requirements of this License for
189
+ the Covered Software. If the Larger Work is a combination of Covered
190
+ Software with a work governed by one or more Secondary Licenses, and the
191
+ Covered Software is not Incompatible With Secondary Licenses, this
192
+ License permits You to additionally distribute such Covered Software
193
+ under the terms of such Secondary License(s), so that the recipient of
194
+ the Larger Work may, at their option, further distribute the Covered
195
+ Software under the terms of either this License or such Secondary
196
+ License(s).
197
+
198
+ 3.4. Notices
199
+
200
+ You may not remove or alter the substance of any license notices
201
+ (including copyright notices, patent notices, disclaimers of warranty,
202
+ or limitations of liability) contained within the Source Code Form of
203
+ the Covered Software, except that You may alter any license notices to
204
+ the extent required to remedy known factual inaccuracies.
205
+
206
+ 3.5. Application of Additional Terms
207
+
208
+ You may choose to offer, and to charge a fee for, warranty, support,
209
+ indemnity or liability obligations to one or more recipients of Covered
210
+ Software. However, You may do so only on Your own behalf, and not on
211
+ behalf of any Contributor. You must make it absolutely clear that any
212
+ such warranty, support, indemnity, or liability obligation is offered by
213
+ You alone, and You hereby agree to indemnify every Contributor for any
214
+ liability incurred by such Contributor as a result of warranty, support,
215
+ indemnity or liability terms You offer. You may include additional
216
+ disclaimers of warranty and limitations of liability specific to any
217
+ jurisdiction.
218
+
219
+ 4. Inability to Comply Due to Statute or Regulation
220
+ ---------------------------------------------------
221
+
222
+ If it is impossible for You to comply with any of the terms of this
223
+ License with respect to some or all of the Covered Software due to
224
+ statute, judicial order, or regulation then You must: (a) comply with
225
+ the terms of this License to the maximum extent possible; and (b)
226
+ describe the limitations and the code they affect. Such description must
227
+ be placed in a text file included with all distributions of the Covered
228
+ Software under this License. Except to the extent prohibited by statute
229
+ or regulation, such description must be sufficiently detailed for a
230
+ recipient of ordinary skill to be able to understand it.
231
+
232
+ 5. Termination
233
+ --------------
234
+
235
+ 5.1. The rights granted under this License will terminate automatically
236
+ if You fail to comply with any of its terms. However, if You become
237
+ compliant, then the rights granted under this License from a particular
238
+ Contributor are reinstated (a) provisionally, unless and until such
239
+ Contributor explicitly and finally terminates Your grants, and (b) on an
240
+ ongoing basis, if such Contributor fails to notify You of the
241
+ non-compliance by some reasonable means prior to 60 days after You have
242
+ come back into compliance. Moreover, Your grants from a particular
243
+ Contributor are reinstated on an ongoing basis if such Contributor
244
+ notifies You of the non-compliance by some reasonable means, this is the
245
+ first time You have received notice of non-compliance with this License
246
+ from such Contributor, and You become compliant prior to 30 days after
247
+ Your receipt of the notice.
248
+
249
+ 5.2. If You initiate litigation against any entity by asserting a patent
250
+ infringement claim (excluding declaratory judgment actions,
251
+ counter-claims, and cross-claims) alleging that a Contributor Version
252
+ directly or indirectly infringes any patent, then the rights granted to
253
+ You by any and all Contributors for the Covered Software under Section
254
+ 2.1 of this License shall terminate.
255
+
256
+ 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
257
+ end user license agreements (excluding distributors and resellers) which
258
+ have been validly granted by You or Your distributors under this License
259
+ prior to termination shall survive termination.
260
+
261
+ ************************************************************************
262
+ * *
263
+ * 6. Disclaimer of Warranty *
264
+ * ------------------------- *
265
+ * *
266
+ * Covered Software is provided under this License on an "as is" *
267
+ * basis, without warranty of any kind, either expressed, implied, or *
268
+ * statutory, including, without limitation, warranties that the *
269
+ * Covered Software is free of defects, merchantable, fit for a *
270
+ * particular purpose or non-infringing. The entire risk as to the *
271
+ * quality and performance of the Covered Software is with You. *
272
+ * Should any Covered Software prove defective in any respect, You *
273
+ * (not any Contributor) assume the cost of any necessary servicing, *
274
+ * repair, or correction. This disclaimer of warranty constitutes an *
275
+ * essential part of this License. No use of any Covered Software is *
276
+ * authorized under this License except under this disclaimer. *
277
+ * *
278
+ ************************************************************************
279
+
280
+ ************************************************************************
281
+ * *
282
+ * 7. Limitation of Liability *
283
+ * -------------------------- *
284
+ * *
285
+ * Under no circumstances and under no legal theory, whether tort *
286
+ * (including negligence), contract, or otherwise, shall any *
287
+ * Contributor, or anyone who distributes Covered Software as *
288
+ * permitted above, be liable to You for any direct, indirect, *
289
+ * special, incidental, or consequential damages of any character *
290
+ * including, without limitation, damages for lost profits, loss of *
291
+ * goodwill, work stoppage, computer failure or malfunction, or any *
292
+ * and all other commercial damages or losses, even if such party *
293
+ * shall have been informed of the possibility of such damages. This *
294
+ * limitation of liability shall not apply to liability for death or *
295
+ * personal injury resulting from such party's negligence to the *
296
+ * extent applicable law prohibits such limitation. Some *
297
+ * jurisdictions do not allow the exclusion or limitation of *
298
+ * incidental or consequential damages, so this exclusion and *
299
+ * limitation may not apply to You. *
300
+ * *
301
+ ************************************************************************
302
+
303
+ 8. Litigation
304
+ -------------
305
+
306
+ Any litigation relating to this License may be brought only in the
307
+ courts of a jurisdiction where the defendant maintains its principal
308
+ place of business and such litigation shall be governed by laws of that
309
+ jurisdiction, without reference to its conflict-of-law provisions.
310
+ Nothing in this Section shall prevent a party's ability to bring
311
+ cross-claims or counter-claims.
312
+
313
+ 9. Miscellaneous
314
+ ----------------
315
+
316
+ This License represents the complete agreement concerning the subject
317
+ matter hereof. If any provision of this License is held to be
318
+ unenforceable, such provision shall be reformed only to the extent
319
+ necessary to make it enforceable. Any law or regulation which provides
320
+ that the language of a contract shall be construed against the drafter
321
+ shall not be used to construe this License against a Contributor.
322
+
323
+ 10. Versions of the License
324
+ ---------------------------
325
+
326
+ 10.1. New Versions
327
+
328
+ Mozilla Foundation is the license steward. Except as provided in Section
329
+ 10.3, no one other than the license steward has the right to modify or
330
+ publish new versions of this License. Each version will be given a
331
+ distinguishing version number.
332
+
333
+ 10.2. Effect of New Versions
334
+
335
+ You may distribute the Covered Software under the terms of the version
336
+ of the License under which You originally received the Covered Software,
337
+ or under the terms of any subsequent version published by the license
338
+ steward.
339
+
340
+ 10.3. Modified Versions
341
+
342
+ If you create software not governed by this License, and you want to
343
+ create a new license for such software, you may create and use a
344
+ modified version of this License if you rename the license and remove
345
+ any references to the name of the license steward (except to note that
346
+ such modified license differs from this License).
347
+
348
+ 10.4. Distributing Source Code Form that is Incompatible With Secondary
349
+ Licenses
350
+
351
+ If You choose to distribute Source Code Form that is Incompatible With
352
+ Secondary Licenses under the terms of this version of the License, the
353
+ notice described in Exhibit B of this License must be attached.
354
+
355
+ Exhibit A - Source Code Form License Notice
356
+ -------------------------------------------
357
+
358
+ This Source Code Form is subject to the terms of the Mozilla Public
359
+ License, v. 2.0. If a copy of the MPL was not distributed with this
360
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
361
+
362
+ If it is not possible or desirable to put the notice in a particular
363
+ file, then You may include the notice in a location (such as a LICENSE
364
+ file in a relevant directory) where a recipient would be likely to look
365
+ for such a notice.
366
+
367
+ You may add additional accurate notices of copyright ownership.
368
+
369
+ Exhibit B - "Incompatible With Secondary Licenses" Notice
370
+ ---------------------------------------------------------
371
+
372
+ This Source Code Form is "Incompatible With Secondary Licenses", as
373
+ defined by the Mozilla Public License, v. 2.0.
package/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # @jupiterone/integration-sdk-http-client
2
+
3
+ This package contains the default HTTP Client used to interact with API
4
+ providers.
5
+
6
+ ### HTTP Client Features
7
+
8
+ The following checked items are implemented. Future features are listed but
9
+ unchecked.
10
+
11
+ - [x] v1 rate limit logic
12
+ - [ ] pagination
13
+ - [ ] error handling retries
14
+
15
+ ## Installation
16
+
17
+ ```
18
+ npm install @jupiterone/integration-sdk-http-client
19
+
20
+ # or
21
+
22
+ yarn add @jupiterone/integration-sdk-http-client
23
+ ```
@@ -0,0 +1,11 @@
1
+ export interface APIErrorParams {
2
+ message: string;
3
+ code: number;
4
+ }
5
+ export declare class APIError extends Error {
6
+ /**
7
+ * Code associated with the error.
8
+ */
9
+ readonly code: number;
10
+ constructor(config: APIErrorParams);
11
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.APIError = void 0;
4
+ class APIError extends Error {
5
+ constructor(config) {
6
+ super(config.message);
7
+ this.code = config.code;
8
+ }
9
+ }
10
+ exports.APIError = APIError;
11
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":";;;AAMA,MAAa,QAAS,SAAQ,KAAK;IAMjC,YAAY,MAAsB;QAChC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IAC1B,CAAC;CACF;AAVD,4BAUC"}
@@ -0,0 +1,14 @@
1
+ import { RateLimitConfig, APIResponse, APIRequest } from './types';
2
+ export declare const DEFAULT_RATE_LIMIT_CONFIG: RateLimitConfig;
3
+ export declare type APIResourceIterationCallback<T> = (resources: T[]) => boolean | void | Promise<boolean | void>;
4
+ export declare class APIClient {
5
+ private rateLimitConfig;
6
+ private rateLimitState;
7
+ executeAPIRequest(request: APIRequest): Promise<APIResponse>;
8
+ /**
9
+ * Get rate limit info, sleep, and then loop to retry
10
+ *
11
+ * @param headers
12
+ */
13
+ private handleRateLimitError;
14
+ }
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.APIClient = exports.DEFAULT_RATE_LIMIT_CONFIG = void 0;
7
+ const node_fetch_1 = __importDefault(require("node-fetch"));
8
+ const util_1 = require("./util");
9
+ const errors_1 = require("./errors");
10
+ exports.DEFAULT_RATE_LIMIT_CONFIG = {
11
+ maxAttempts: 5,
12
+ reserveLimit: 30,
13
+ cooldownPeriod: 1000,
14
+ sleepAdditionalSeconds: 0,
15
+ };
16
+ class APIClient {
17
+ constructor() {
18
+ // TODO (adam-in-ict) make rateLimitConfig configurable and only use the default values when none are provided
19
+ this.rateLimitConfig = exports.DEFAULT_RATE_LIMIT_CONFIG;
20
+ }
21
+ async executeAPIRequest(request) {
22
+ let attempts = 0;
23
+ do {
24
+ const response = await (0, node_fetch_1.default)(request.url, request);
25
+ if ((0, util_1.isNonRetryableError)(response.status)) {
26
+ const err = new errors_1.APIError({
27
+ message: `API request error for ${request.url}: ${response.status} ${response.statusText}`,
28
+ code: response.status,
29
+ });
30
+ throw err;
31
+ }
32
+ // TODO (adam-in-ict) make rate limit error configurable for instances where an API isn't using the default of 429
33
+ if (response.status === 429) {
34
+ await this.handleRateLimitError(response.headers);
35
+ }
36
+ else {
37
+ // Successful response, so return
38
+ return {
39
+ data: await response.json(),
40
+ headers: response.headers,
41
+ status: response.status,
42
+ statusText: response.statusText,
43
+ };
44
+ }
45
+ attempts += 1;
46
+ } while (attempts < this.rateLimitConfig.maxAttempts);
47
+ throw new errors_1.APIError({
48
+ message: `Could not complete request within ${attempts} attempts!`,
49
+ code: 429,
50
+ });
51
+ }
52
+ //TODO (adam-in-ict) abstract out which Header values we're grabbing for rate limiting.
53
+ /**
54
+ * Get rate limit info, sleep, and then loop to retry
55
+ *
56
+ * @param headers
57
+ */
58
+ async handleRateLimitError(headers) {
59
+ this.rateLimitState = {
60
+ limitRemaining: Number(headers.get('X-RateLimit-Remaining')),
61
+ perMinuteLimit: Number(headers.get('X-RateLimit-Limit')),
62
+ retryAfter: headers.get('X-RateLimit-RetryAfter') &&
63
+ Number(headers.get('X-RateLimit-RetryAfter')),
64
+ };
65
+ const unixTimeNow = (0, util_1.getUnixTimeNow)();
66
+ const timeToSleepInSeconds = this.rateLimitState.retryAfter
67
+ ? Math.max(this.rateLimitState.retryAfter +
68
+ this.rateLimitConfig.sleepAdditionalSeconds -
69
+ unixTimeNow, 0)
70
+ : 0;
71
+ await (0, util_1.sleep)(timeToSleepInSeconds * 1000);
72
+ if (this.rateLimitState.limitRemaining &&
73
+ this.rateLimitState.limitRemaining <= this.rateLimitConfig.reserveLimit) {
74
+ await (0, util_1.sleep)(this.rateLimitConfig.cooldownPeriod);
75
+ }
76
+ }
77
+ }
78
+ exports.APIClient = APIClient;
79
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA+B;AAC/B,iCAAoE;AAOpE,qCAAoC;AAEvB,QAAA,yBAAyB,GAAoB;IACxD,WAAW,EAAE,CAAC;IACd,YAAY,EAAE,EAAE;IAChB,cAAc,EAAE,IAAI;IACpB,sBAAsB,EAAE,CAAC;CAC1B,CAAC;AAMF,MAAa,SAAS;IAAtB;QACE,8GAA8G;QACtG,oBAAe,GAAoB,iCAAyB,CAAC;IAuEvE,CAAC;IApEC,KAAK,CAAC,iBAAiB,CAAC,OAAmB;QACzC,IAAI,QAAQ,GAAG,CAAC,CAAC;QAEjB,GAAG;YACD,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAK,EAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;YAEnD,IAAI,IAAA,0BAAmB,EAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;gBACxC,MAAM,GAAG,GAAG,IAAI,iBAAQ,CAAC;oBACvB,OAAO,EAAE,yBAAyB,OAAO,CAAC,GAAG,KAAK,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,EAAE;oBAC1F,IAAI,EAAE,QAAQ,CAAC,MAAM;iBACtB,CAAC,CAAC;gBACH,MAAM,GAAG,CAAC;aACX;YAED,kHAAkH;YAClH,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE;gBAC3B,MAAM,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;aACnD;iBAAM;gBACL,iCAAiC;gBACjC,OAAO;oBACL,IAAI,EAAE,MAAM,QAAQ,CAAC,IAAI,EAAE;oBAC3B,OAAO,EAAE,QAAQ,CAAC,OAAO;oBACzB,MAAM,EAAE,QAAQ,CAAC,MAAM;oBACvB,UAAU,EAAE,QAAQ,CAAC,UAAU;iBAChC,CAAC;aACH;YAED,QAAQ,IAAI,CAAC,CAAC;SACf,QAAQ,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE;QAEtD,MAAM,IAAI,iBAAQ,CAAC;YACjB,OAAO,EAAE,qCAAqC,QAAQ,YAAY;YAClE,IAAI,EAAE,GAAG;SACV,CAAC,CAAC;IACL,CAAC;IAED,uFAAuF;IACvF;;;;OAIG;IACK,KAAK,CAAC,oBAAoB,CAAC,OAAO;QACxC,IAAI,CAAC,cAAc,GAAG;YACpB,cAAc,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;YAC5D,cAAc,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;YACxD,UAAU,EACR,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC;gBACrC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;SAChD,CAAC;QAEF,MAAM,WAAW,GAAG,IAAA,qBAAc,GAAE,CAAC;QACrC,MAAM,oBAAoB,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU;YACzD,CAAC,CAAC,IAAI,CAAC,GAAG,CACN,IAAI,CAAC,cAAc,CAAC,UAAU;gBAC5B,IAAI,CAAC,eAAe,CAAC,sBAAsB;gBAC3C,WAAW,EACb,CAAC,CACF;YACH,CAAC,CAAC,CAAC,CAAC;QACN,MAAM,IAAA,YAAK,EAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;QACzC,IACE,IAAI,CAAC,cAAc,CAAC,cAAc;YAClC,IAAI,CAAC,cAAc,CAAC,cAAc,IAAI,IAAI,CAAC,eAAe,CAAC,YAAY,EACvE;YACA,MAAM,IAAA,YAAK,EAAC,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;SAClD;IACH,CAAC;CACF;AAzED,8BAyEC"}
@@ -0,0 +1,132 @@
1
+ export declare type APIRequest = {
2
+ url: string;
3
+ method: string;
4
+ headers: Object;
5
+ };
6
+ export declare type APIResponse = {
7
+ data: any;
8
+ headers: any;
9
+ status: number;
10
+ statusText: string;
11
+ };
12
+ declare type PaginationState = {
13
+ /**
14
+ * Fetch limit, will be URL encoded as value of `limit` GET parameter.
15
+ */
16
+ limit?: number;
17
+ /**
18
+ * Total number of objects reported in API response. The number is affected by
19
+ * the filter, if any.
20
+ */
21
+ total?: number;
22
+ /**
23
+ * Fetch offset, a number to start from or a cursor, depending on API.
24
+ */
25
+ offset?: number | string;
26
+ /**
27
+ * Offset cursor expiration time, only present for cursor based API.
28
+ */
29
+ expiresAt?: number;
30
+ /**
31
+ * Similar to "offset", a value to start from aka a cursor.
32
+ */
33
+ after?: number | string;
34
+ /**
35
+ * Number of resources returned through pagination to the point of offset.
36
+ */
37
+ seen: number;
38
+ /**
39
+ * Number of pages returned through pagination to the point of offset.
40
+ */
41
+ pages: number;
42
+ /**
43
+ * Pagination has completed according to provided pagination parameters.
44
+ */
45
+ finished: boolean;
46
+ };
47
+ export declare type PaginationParams = Partial<PaginationState>;
48
+ export declare type QueryParams = {
49
+ filter?: string;
50
+ [name: string]: string | undefined;
51
+ };
52
+ export declare type RateLimitConfig = {
53
+ /**
54
+ * The limit remaining value at which the client should slow down. This
55
+ * prevents the client from consuming all available requests.
56
+ */
57
+ reserveLimit: number;
58
+ /**
59
+ * A recommended period of time in milliseconds to wait between requests when
60
+ * the `reserveLimit` is reached.
61
+ *
62
+ * This can be a value representing the refill rate of a "leaky bucket" or
63
+ * just a guess about how soon another request can be made. Ideally there will
64
+ * be enough information in the response headers to calculate a better value.
65
+ */
66
+ cooldownPeriod: number;
67
+ /**
68
+ * Maximum number of times to retry a request that continues to receive 429
69
+ * responses.
70
+ *
71
+ * The client will respect `x-ratelimit-retryafter`, but should it end up in a
72
+ * battle to get the next allowed request, it will give up after this many
73
+ * tries.
74
+ */
75
+ maxAttempts: number;
76
+ /**
77
+ * Optional number of additional seconds to sleep in the event of a rate limit
78
+ * event.
79
+ */
80
+ sleepAdditionalSeconds: number;
81
+ };
82
+ /**
83
+ * The last seen values from rate limit response headers.
84
+ */
85
+ export declare type RateLimitState = {
86
+ /**
87
+ * Maximum number of requests per minute that can be made by all API clients
88
+ * in a customer account. Initial value assumes the published default of 100.
89
+ */
90
+ perMinuteLimit: number;
91
+ /**
92
+ * Number of requests that remain in the account's rate limiting pool. The
93
+ * total number available is not known.
94
+ */
95
+ limitRemaining: number;
96
+ /**
97
+ * The next time when an account's rate limit pool will have at least one
98
+ * request available.
99
+ */
100
+ retryAfter?: number;
101
+ };
102
+ /**
103
+ * Metadata in API responses indicating the pagination state.
104
+ */
105
+ export declare type PaginationMeta = {
106
+ limit: number;
107
+ total: number;
108
+ offset: number | string;
109
+ expires_at?: number;
110
+ };
111
+ declare type ResponseMeta = {
112
+ trace_id: string;
113
+ pagination?: PaginationMeta;
114
+ };
115
+ declare type ResponseError = {
116
+ code: number;
117
+ message: string;
118
+ };
119
+ export declare type ResourcesResponse<T> = {
120
+ meta: ResponseMeta;
121
+ errors: ResponseError[];
122
+ resources: T[];
123
+ };
124
+ export declare type APIClientRateLimitConfig = {
125
+ limitHeader: string;
126
+ limitRemainingHeader: string;
127
+ retryAfterHeader: string;
128
+ };
129
+ export declare type APIClientConfiguration = {
130
+ rateLimitConfig: APIClientRateLimitConfig;
131
+ };
132
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ export declare function getUnixTimeNow(): number;
2
+ export declare function sleep(ms: number): Promise<unknown>;
3
+ /**
4
+ * Returns true when we have a status code that is an error but not retryable.
5
+ * @param statusCode
6
+ * @returns boolean
7
+ */
8
+ export declare function isNonRetryableError(statusCode: number): boolean;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isNonRetryableError = exports.sleep = exports.getUnixTimeNow = void 0;
4
+ function getUnixTimeNow() {
5
+ return Date.now() / 1000;
6
+ }
7
+ exports.getUnixTimeNow = getUnixTimeNow;
8
+ async function sleep(ms) {
9
+ return new Promise((resolve) => setTimeout(resolve, ms));
10
+ }
11
+ exports.sleep = sleep;
12
+ /**
13
+ * Returns true when we have a status code that is an error but not retryable.
14
+ * @param statusCode
15
+ * @returns boolean
16
+ */
17
+ function isNonRetryableError(statusCode) {
18
+ // TODO (adam-in-ict) make range of retryable error codes configurable
19
+ if (statusCode !== 429 && statusCode >= 400) {
20
+ return true;
21
+ }
22
+ return false;
23
+ }
24
+ exports.isNonRetryableError = isNonRetryableError;
25
+ //# sourceMappingURL=util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":";;;AAAA,SAAgB,cAAc;IAC5B,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAC3B,CAAC;AAFD,wCAEC;AAEM,KAAK,UAAU,KAAK,CAAC,EAAU;IACpC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAFD,sBAEC;AAED;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,UAAkB;IACpD,sEAAsE;IACtE,IAAI,UAAU,KAAK,GAAG,IAAI,UAAU,IAAI,GAAG,EAAE;QAC3C,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAND,kDAMC"}
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../src/errors.ts","../src/util.ts","../src/types.ts","../src/index.ts","../../../node_modules/@babel/types/lib/index.d.ts","../../../node_modules/@types/babel__generator/index.d.ts","../../../node_modules/@babel/parser/typings/babel-parser.d.ts","../../../node_modules/@types/babel__template/index.d.ts","../../../node_modules/@types/babel__traverse/index.d.ts","../../../node_modules/@types/babel__core/index.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@types/fs-extra/index.d.ts","../../../node_modules/@types/graceful-fs/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/istanbul-lib-report/index.d.ts","../../../node_modules/@types/istanbul-reports/index.d.ts","../../../node_modules/jest-diff/build/cleanupSemantic.d.ts","../../../node_modules/pretty-format/build/types.d.ts","../../../node_modules/pretty-format/build/index.d.ts","../../../node_modules/jest-diff/build/types.d.ts","../../../node_modules/jest-diff/build/diffLines.d.ts","../../../node_modules/jest-diff/build/printDiffs.d.ts","../../../node_modules/jest-diff/build/index.d.ts","../../../node_modules/@types/jest/index.d.ts","../../../node_modules/@types/js-yaml/index.d.ts","../../../node_modules/@types/json-diff/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/json2csv/JSON2CSVBase.d.ts","../../../node_modules/@types/json2csv/JSON2CSVParser.d.ts","../../../node_modules/@types/json2csv/JSON2CSVTransform.d.ts","../../../node_modules/@types/json2csv/JSON2CSVAsyncParser.d.ts","../../../node_modules/@types/json2csv/transforms/flatten.d.ts","../../../node_modules/@types/json2csv/transforms/unwind.d.ts","../../../node_modules/@types/json2csv/index.d.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/minimist/index.d.ts","../../../node_modules/@types/normalize-package-data/index.d.ts","../../../node_modules/@types/parse-json/index.d.ts","../../../node_modules/@types/prettier/index.d.ts","../../../node_modules/@types/set-cookie-parser/index.d.ts","../../../node_modules/@types/stack-utils/index.d.ts","../../../node_modules/@types/traverse/index.d.ts","../../../node_modules/@types/uuid/interfaces.d.ts","../../../node_modules/@types/uuid/index.d.ts","../../../node_modules/moment/ts3.1-typings/moment.d.ts","../../../node_modules/@types/vis/index.d.ts","../../../node_modules/@types/yargs-parser/index.d.ts","../../../node_modules/@types/yargs/index.d.ts"],"fileInfos":[{"version":"89f78430e422a0f06d13019d60d5a45b37ec2d28e67eb647f73b1b0d19a46b72","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06",{"version":"abba1071bfd89e55e88a054b0c851ea3e8a494c340d0f3fab19eb18f6afb0c9e","affectsGlobalScope":true},{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"4378fc8122ec9d1a685b01eb66c46f62aba6b239ca7228bb6483bcf8259ee493","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"10bbdc1981b8d9310ee75bfac28ee0477bb2353e8529da8cff7cb26c409cb5e8","affectsGlobalScope":true},"4d22a2d745893004c26903093386d3e33c682d2ef87942a68289a841baf17f01","570045bdd15445c9684931fb7f382ffd8e098e9f64f3435aaa324aed28f67ff2","5f8eead5f65b963631d7de327ee19758287bb755b0d87843f1b131854527952b","a1a442b9845baaa22190dbfe97493a06b1ae7650559cfe442d3376d33cfdf1cc","2ff9995137f3e5d68971388ec58af0c79721626323884513f9f5e2e996ac1fdd","cc957354aa3c94c9961ebf46282cfde1e81d107fc5785a61f62c67f1dd3ac2eb","29afd3970c68fdcbf3168de0f855d7cd84135c436050793b0584e1a904affe2d","93de1c6dab503f053efe8d304cb522bb3a89feab8c98f307a674a4fae04773e9","3b043cf9a81854a72963fdb57d1884fc4da1cf5be69b5e0a4c5b751e58cb6d88","dd5647a9ccccb2b074dca8a02b00948ac293091ebe73fdf2e6e98f718819f669","4c2c4f53e8eedd970f8afa369d7371544fb6231bf95e659f8602e09abe74d5a5",{"version":"e71aa3dcef67c4e22d57a8ff085806b986818c27d515a6c548547dbb06153c01","affectsGlobalScope":true},"64e2803203b14d7f104f570f2152fde13abb6edc17b2ddb33d81ad86cf43d494","3143a5add0467b83150961ecd33773b561a1207aec727002aa1d70333068eb1b","9b2a8f604e7c0482a9061755f00b287cc99bd8718dc82d8207dd74c599b6dc43","d0fc76a91c828fbe3f0be5d683273634b7b101068333ceed975a8a9ac464137b",{"version":"1a048ff164b8d9609f5de3139d4e37f6e8a82af82087ac414b9208f52ef8aac7","affectsGlobalScope":true},"3111079f3cb5f2b9c812ca3f46161562bce5bfb355e915f46ed46c41714dc1c3","64576aba4ff801004122056ccd049f0597aa471dcfd7670a6a0b877ee8dd97c0","b32b6b16cb0bda68199582ad6f22242d07ee75fac9b1f28a98cd838afc5eea45","4441ee4119824bfaebc49308559edd7545978f9cb41a40f115074e1031dde75f",{"version":"60693a88462d0e97900123b5bf7c73e146ce0cc94da46a61fe6775b430d2ff05","affectsGlobalScope":true},{"version":"588c69eda58b9202676ec7ca11a72c3762819b46a0ed72462c769846153c447c","affectsGlobalScope":true},"cc829932ffaf5c49092f878bec18af1fa5d8591b45a45e2b7f757f793cb3b4ed","47db10fdc4e76c4f4598cf7c91ba6bfde6cf6d8082c51860fe751643bf359739","53d2c24a3cbc00a88ebaf8ab8e1b6e206bc3a6647d544f877241684ea3d484e3","3be5ff21956db30c674bf2a98eb348e4ce7b4635cd9673413d86fbce761b77d8","0ce99c641ea20b0c0c09d093fc28f18f5ab31dc80033707a1ac3154399de2559","f0c33a0b325d3499cc9aded7d32886f998c9a27b465097c6cc136944d0aafdaa","44e42ed6ec9c4451ebe89524e80ac8564e9dd0988c56e6c58f393c810730595d","d4a0c39ece1e7c99d701e9c02a7dde8e3b75e03405f78d58d48dfea797ddbbac","1606ea615c0a5ea9f5c1376a33e34c0e1112e8dee31a5b3b8a74ce781893aa6f","9fef9de633d01cb7f01f68195626a890ededd25cf96a1e785617d08c8668230d","4455c78d226d061b1203c7614c6c6eb5f4f9db5f00d44ff47d0112de8766fbc4",{"version":"ec369bb9d97c4dc09dd2a4093b7ca3ba69ad284831fccac8a1977785e9e38ce5","affectsGlobalScope":true},"4465a636f5f6e9665a90e30691862c9e0a3ac2edc0e66296704f10865e924f2a","9af781f03d44f5635ed7844be0ce370d9d595d4b4ec67cad88f0fac03255257e","f9fd4c3ef6de27fa0e256f4e75b61711c4be05a3399f7714621d3edc832e36b0","e49290b7a927995c0d7e6b2b9c8296284b68a9036d9966531de65185269258d7","c3689f70ce7563c2299f2dcb3c72efdf6f87ae510e7456fa6223c767d0ca99fc","874ca809b79276460011480a2829f4c8d4db29416dd411f71efbf8f497f0ac09","82e1723b20fa0b15a7da0d1a03fec88348f82f640f7a2f308d6c0fac780cfc7c","605c24042a348b033b30121cff64380eb5d6d82853c5608f1f94ef72385cf5c9","23a28f834a078986bbf58f4e3705956983ff81c3c2493f3db3e5f0e8a9507779","4febdf7f3ec92706c58e0b4e8159cd6de718284ef384260b07c9641c13fc70ce",{"version":"8e94ca83455f043dc6ad5bf1b217e1d97fe2bed88bfa8486db02337ab3fce9f2","affectsGlobalScope":true},"7335933d9f30dcfd2c4b6080a8b78e81912a7fcefb1dafccb67ca4cb4b3ac23d","a6bfe9de9adef749010c118104b071d14943802ff0614732b47ce4f1c3e383cd","4c3d0e10396646db4a1e917fb852077ee77ae62e512913bef9cccc2bb0f8bd0e","3b220849d58140dcc6718f5b52dcd29fdb79c45bc28f561cbd29eb1cac6cce13","0ee22fce41f7417a24c808d266e91b850629113c104713a35854393d55994beb","22d1b1d965baba05766613e2e6c753bb005d4386c448cafd72c309ba689e8c24",{"version":"2708349d5a11a5c2e5f3a0765259ebe7ee00cdcc8161cb9990cb4910328442a1","affectsGlobalScope":true},"79d679a1d56574cc5cef92be1f0e5e8fb4af62fb55933b236670a0e0a23c83f6","ed19da84b7dbf00952ad0b98ce5c194f1903bcf7c94d8103e8e0d63b271543ae","3ebae8c00411116a66fca65b08228ea0cf0b72724701f9b854442100aab55aba","8b06ac3faeacb8484d84ddb44571d8f410697f98d7bfa86c0fda60373a9f5215","7eb06594824ada538b1d8b48c3925a83e7db792f47a081a62cf3e5c4e23cf0ee","f5638f7c2f12a9a1a57b5c41b3c1ea7db3876c003bab68e6a57afd6bcc169af0","d8aab31ba8e618cc3eea10b0945de81cb93b7e8150a013a482332263b9305322","462bccdf75fcafc1ae8c30400c9425e1a4681db5d605d1a0edb4f990a54d8094","5923d8facbac6ecf7c84739a5c701a57af94a6f6648d6229a6c768cf28f0f8cb","7adecb2c3238794c378d336a8182d4c3dd2c4fa6fa1785e2797a3db550edea62","dc12dc0e5aa06f4e1a7692149b78f89116af823b9e1f1e4eae140cd3e0e674e6","1bfc6565b90c8771615cd8cfcf9b36efc0275e5e83ac7d9181307e96eb495161","8a8a96898906f065f296665e411f51010b51372fa260d5373bf9f64356703190",{"version":"6ff2ca51e2c9d88d6d904c481879b12ec0cad2a69b88e220859a52207444773b","affectsGlobalScope":true},"686e548ae30250d62532c8cacb43fccc922b693408371bd3503563c4a0f28eed","270e729660d8df5baf58aa6b0dc1724de4ac41f8cf4a47b0ff51cb713eae9f61","0359682c54e487c4cab2b53b2b4d35cc8dea4d9914bc6abcdb5701f8b8e745a4","ee36efce86beeb8f4a34974891f3fe3c6c5774802089a633c07ed2dd4d308762","0e87eb9c7868f42dc605c98f557f818c70281232f8bc91ca72694ca8c1d94543","994a0590d6759e482925ec45ffeb2fc3045a1bcda25b4110c4870f52213eb210","1e8a489fd4a5523a91b72a00e360ee667ef9346e829359adb8f5ce08c11a8116","39d5cb0690a46e19d898e4581dea409979916f6bfa07c3115979888641bf404e","f0f17d3ab8ff023fab88b061c947853c774bf3f230b13eeb8b7c605085181525","fc75bcb3b1eb2cc497993423e70676b2b99881181bae55292db62a66b1ea06a0","675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","fe4a2042d087990ebfc7dc0142d5aaf5a152e4baea86b45f283f103ec1e871ea","d88a479cccf787b4aa82362150fbeba5211a32dbfafa7b92ba6995ecaf9a1a89","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","c24ad9be9adf28f0927e3d9d9e9cec1c677022356f241ccbbfb97bfe8fb3d1a1","0ec0998e2d085e8ea54266f547976ae152c9dd6cdb9ac4d8a520a230f5ebae84","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","ae9930989ed57478eb03b9b80ad3efa7a3eacdfeff0f78ecf7894c4963a64f93","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3e59f00ab03c33717b3130066d4debb272da90eeded4935ff0604c2bc25a5cae","6ac6f24aff52e62c3950461aa17eab26e3a156927858e6b654baef0058b4cd1e",{"version":"0714e2046df66c0e93c3330d30dbc0565b3e8cd3ee302cf99e4ede6220e5fec8","affectsGlobalScope":true},"8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","209e814e8e71aec74f69686a9506dd7610b97ab59dcee9446266446f72a76d05","6fa0008bf91a4cc9c8963bace4bba0bd6865cbfa29c3e3ccc461155660fb113a","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","6209c901f30cc321f4b86800d11fad3d67e73a3308f19946b1bc642af0280298","e5d49212b03abccc8df5098d379dc8350755b9ba53b515da4b1980494486ba78","b0d10e46cfe3f6c476b69af02eaa38e4ccc7430221ce3109ae84bb9fb8282298","97cad055446113b65658aa07fac62e03dee7645dafec7f8e1e627500d5d8ee6d","045334b3d5ad607b12489d4a0e73b5491542b776f1e371d3aacaff5291e730e0","9473ee1ca40f9a3d7727087ec6e4976923583878763b789636026b26f7f6cd3c","4051f6311deb0ce6052329eeb1cd4b1b104378fe52f882f483130bea75f92197","efdffb306ef0a6c0ac375064d190bc93c7c2108004064529ca7d5e7f38d71285","f7e133b20ee2669b6c0e5d7f0cd510868c57cd64b283e68c7f598e30ce9d76d2","6ba73232c9d3267ca36ddb83e335d474d2c0e167481e3dec416c782894e11438"],"options":{"composite":true,"declaration":true,"esModuleInterop":true,"module":1,"noImplicitThis":true,"noUnusedLocals":true,"outDir":"./","sourceMap":true,"strictNullChecks":true,"target":5},"fileIdsList":[[33],[33,34,35,36,37],[33,35],[52,82],[85],[86],[90,94],[68,99,101],[105],[99],[68,105],[68,82,100,101,102,103,104],[106,108,109,110,111,112,113,114,115,116,117,118],[106,107,109,110,111,112,113,114,115,116,117,118],[107,108,109,110,111,112,113,114,115,116,117,118],[106,107,108,110,111,112,113,114,115,116,117,118],[106,107,108,109,111,112,113,114,115,116,117,118],[106,107,108,109,110,112,113,114,115,116,117,118],[106,107,108,109,110,111,113,114,115,116,117,118],[106,107,108,109,110,111,112,114,115,116,117,118],[106,107,108,109,110,111,112,113,115,116,117,118],[106,107,108,109,110,111,112,113,114,116,117,118],[106,107,108,109,110,111,112,113,114,115,117,118],[106,107,108,109,110,111,112,113,114,115,116,118],[106,107,108,109,110,111,112,113,114,115,116,117],[39],[41],[42,47],[43,51,52,59,68],[43,44,51,59],[45,75],[46,47,52,60],[47,68],[48,49,51,59],[49],[50,51],[51],[51,52,53,68,74],[52,53],[54,59,68,74],[51,52,54,55,59,68,71,74],[54,56,68,71,74],[39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81],[51,57],[58,74],[49,51,59,68],[60],[61],[41,62],[63,73],[64],[65],[51,66],[66,67,75,77],[51,68],[69],[70],[59,68,71],[72],[59,73],[65,74],[75],[68,76],[77],[78],[51,53,68,74,77,79],[68,80],[54,82],[127],[129],[131],[88,91],[88,91,92,93],[90],[89],[29,30,31]],"referencedMap":[[35,1],[38,2],[34,1],[36,3],[37,1],[83,4],[84,4],[86,5],[87,6],[95,7],[102,8],[99,9],[100,10],[101,11],[105,12],[103,9],[104,9],[107,13],[108,14],[106,15],[109,16],[110,17],[111,18],[112,19],[113,20],[114,21],[115,22],[116,23],[117,24],[118,25],[39,26],[41,27],[42,28],[43,29],[44,30],[45,31],[46,32],[47,33],[48,34],[49,35],[50,36],[51,37],[52,38],[53,39],[54,40],[55,41],[56,42],[82,43],[57,44],[58,45],[59,46],[60,47],[61,48],[62,49],[63,50],[64,51],[65,52],[66,53],[67,54],[68,55],[69,56],[70,57],[71,58],[72,59],[73,60],[74,61],[75,62],[76,63],[77,64],[78,65],[79,66],[80,67],[124,68],[128,69],[130,70],[132,71],[92,72],[94,73],[93,72],[91,74],[90,75],[32,76]],"exportedModulesMap":[[35,1],[38,2],[34,1],[36,3],[37,1],[83,4],[84,4],[86,5],[87,6],[95,7],[102,8],[99,9],[100,10],[101,11],[105,12],[103,9],[104,9],[107,13],[108,14],[106,15],[109,16],[110,17],[111,18],[112,19],[113,20],[114,21],[115,22],[116,23],[117,24],[118,25],[39,26],[41,27],[42,28],[43,29],[44,30],[45,31],[46,32],[47,33],[48,34],[49,35],[50,36],[51,37],[52,38],[53,39],[54,40],[55,41],[56,42],[82,43],[57,44],[58,45],[59,46],[60,47],[61,48],[62,49],[63,50],[64,51],[65,52],[66,53],[67,54],[68,55],[69,56],[70,57],[71,58],[72,59],[73,60],[74,61],[75,62],[76,63],[77,64],[78,65],[79,66],[80,67],[124,68],[128,69],[130,70],[132,71],[92,72],[94,73],[93,72],[91,74],[90,75],[32,76]],"semanticDiagnosticsPerFile":[35,33,38,34,36,37,83,84,85,86,87,95,96,97,98,102,99,100,101,105,103,104,107,108,106,109,110,111,112,113,114,115,116,117,118,119,120,39,41,42,43,44,45,46,47,48,49,50,51,52,53,40,81,54,55,56,82,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,121,122,123,124,125,126,128,127,130,131,132,88,92,94,93,91,129,90,89,6,8,7,2,9,10,11,12,13,14,15,16,3,4,20,17,18,19,21,22,23,5,24,25,26,27,1,28,29,32,31,30]},"version":"4.5.5"}
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@jupiterone/integration-sdk-http-client",
3
+ "version": "8.13.0",
4
+ "description": "The HTTP client for use in JupiterOne integrations",
5
+ "main": "dist/src/index.js",
6
+ "types": "dist/src/index.d.ts",
7
+ "repository": "git@github.com:JupiterOne/sdk.git",
8
+ "author": "JupiterOne <dev@jupiterone.io>",
9
+ "license": "MPL-2.0",
10
+ "files": [
11
+ "dist"
12
+ ],
13
+ "engines": {
14
+ "node": "14.x"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "scripts": {
20
+ "test": "jest",
21
+ "test:event-handlers": "ts-node ./test/index.ts",
22
+ "prebuild:dist": "rm -rf dist && mkdir dist",
23
+ "build:dist": "tsc -p tsconfig.dist.json --declaration",
24
+ "prepack": "yarn build:dist"
25
+ },
26
+ "dependencies": {
27
+ "node-fetch": "^2.6.0"
28
+ },
29
+ "devDependencies": {
30
+ "@jupiterone/integration-sdk-dev-tools": "^8.13.0",
31
+ "@jupiterone/integration-sdk-private-test-utils": "^8.13.0",
32
+ "fetch-mock-jest": "^1.5.1"
33
+ },
34
+ "bugs": {
35
+ "url": "https://github.com/JupiterOne/sdk/issues"
36
+ },
37
+ "homepage": "https://github.com/JupiterOne/sdk#readme",
38
+ "gitHead": "cc1e9409501f353a7dbaaf491315b6eadfbe0b97"
39
+ }