polarity-integration-utils 0.1.0 → 3.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -2
- package/dist/dts/context/cache.d.ts +149 -0
- package/dist/dts/context/cache.d.ts.map +1 -0
- package/dist/dts/context/index.d.ts +3 -0
- package/dist/dts/context/index.d.ts.map +1 -0
- package/dist/dts/context/integration-context.d.ts +16 -0
- package/dist/dts/context/integration-context.d.ts.map +1 -0
- package/dist/dts/errors/api-request-error.d.ts +10 -0
- package/dist/dts/errors/api-request-error.d.ts.map +1 -0
- package/dist/dts/errors/auth-request-error.d.ts +10 -0
- package/dist/dts/errors/auth-request-error.d.ts.map +1 -0
- package/dist/dts/errors/index.d.ts +8 -0
- package/dist/dts/errors/index.d.ts.map +1 -0
- package/dist/dts/errors/integration-error.d.ts +189 -0
- package/dist/dts/errors/integration-error.d.ts.map +1 -0
- package/dist/dts/errors/library-usage-error.d.ts +12 -0
- package/dist/dts/errors/library-usage-error.d.ts.map +1 -0
- package/dist/dts/errors/network-error.d.ts +11 -0
- package/dist/dts/errors/network-error.d.ts.map +1 -0
- package/dist/dts/errors/parse-error-to-readable-json.d.ts +7 -0
- package/dist/dts/errors/parse-error-to-readable-json.d.ts.map +1 -0
- package/dist/dts/errors/retry-request-error.d.ts +11 -0
- package/dist/dts/errors/retry-request-error.d.ts.map +1 -0
- package/dist/dts/index.d.ts +8 -0
- package/dist/dts/index.d.ts.map +1 -0
- package/dist/dts/index.docs.d.ts +10 -0
- package/dist/dts/index.docs.d.ts.map +1 -0
- package/dist/dts/internal/helpers/parallel-limit.d.ts +9 -0
- package/dist/dts/internal/helpers/parallel-limit.d.ts.map +1 -0
- package/dist/dts/internal/helpers/sanitize-object.d.ts +11 -0
- package/dist/dts/internal/helpers/sanitize-object.d.ts.map +1 -0
- package/dist/dts/lib/context/cache.d.ts +149 -0
- package/dist/dts/lib/context/cache.d.ts.map +1 -0
- package/dist/dts/lib/context/index.d.ts +3 -0
- package/dist/dts/lib/context/index.d.ts.map +1 -0
- package/dist/dts/lib/context/integration-context.d.ts +16 -0
- package/dist/dts/lib/context/integration-context.d.ts.map +1 -0
- package/dist/dts/lib/errors/api-request-error.d.ts +10 -0
- package/dist/dts/lib/errors/api-request-error.d.ts.map +1 -0
- package/dist/dts/lib/errors/auth-request-error.d.ts +10 -0
- package/dist/dts/lib/errors/auth-request-error.d.ts.map +1 -0
- package/dist/dts/lib/errors/index.d.ts +8 -0
- package/dist/dts/lib/errors/index.d.ts.map +1 -0
- package/dist/dts/lib/errors/integration-error.d.ts +189 -0
- package/dist/dts/lib/errors/integration-error.d.ts.map +1 -0
- package/dist/dts/lib/errors/library-usage-error.d.ts +12 -0
- package/dist/dts/lib/errors/library-usage-error.d.ts.map +1 -0
- package/dist/dts/lib/errors/network-error.d.ts +11 -0
- package/dist/dts/lib/errors/network-error.d.ts.map +1 -0
- package/dist/dts/lib/errors/parse-error-to-readable-json.d.ts +7 -0
- package/dist/dts/lib/errors/parse-error-to-readable-json.d.ts.map +1 -0
- package/dist/dts/lib/errors/retry-request-error.d.ts +11 -0
- package/dist/dts/lib/errors/retry-request-error.d.ts.map +1 -0
- package/dist/dts/lib/index.d.ts +8 -0
- package/dist/dts/lib/index.d.ts.map +1 -0
- package/dist/dts/lib/index.docs.d.ts +10 -0
- package/dist/dts/lib/index.docs.d.ts.map +1 -0
- package/dist/dts/lib/internal/helpers/parallel-limit.d.ts +9 -0
- package/dist/dts/lib/internal/helpers/parallel-limit.d.ts.map +1 -0
- package/dist/dts/lib/internal/helpers/sanitize-object.d.ts +11 -0
- package/dist/dts/lib/internal/helpers/sanitize-object.d.ts.map +1 -0
- package/dist/dts/lib/logging/index.d.ts +2 -0
- package/dist/dts/lib/logging/index.d.ts.map +1 -0
- package/dist/dts/lib/logging/logger.d.ts +49 -0
- package/dist/dts/lib/logging/logger.d.ts.map +1 -0
- package/dist/dts/lib/requests/index.d.ts +3 -0
- package/dist/dts/lib/requests/index.d.ts.map +1 -0
- package/dist/dts/lib/requests/polarity-request.d.ts +411 -0
- package/dist/dts/lib/requests/polarity-request.d.ts.map +1 -0
- package/dist/dts/lib/requests/sanitize-request-options.d.ts +20 -0
- package/dist/dts/lib/requests/sanitize-request-options.d.ts.map +1 -0
- package/dist/dts/lib/testing/enhanced-utils/create-entity.d.ts +3 -0
- package/dist/dts/lib/testing/enhanced-utils/create-entity.d.ts.map +1 -0
- package/dist/dts/lib/testing/enhanced-utils/create-mock-integration-context.d.ts +3 -0
- package/dist/dts/lib/testing/enhanced-utils/create-mock-integration-context.d.ts.map +1 -0
- package/dist/dts/lib/testing/enhanced-utils/mock-request.d.ts +14 -0
- package/dist/dts/lib/testing/enhanced-utils/mock-request.d.ts.map +1 -0
- package/dist/dts/lib/testing/enhanced-utils/validate-integration.d.ts +8 -0
- package/dist/dts/lib/testing/enhanced-utils/validate-integration.d.ts.map +1 -0
- package/dist/dts/lib/testing/index.d.ts +6 -0
- package/dist/dts/lib/testing/index.d.ts.map +1 -0
- package/dist/dts/lib/testing/test-factory/create-integration-tests.d.ts +6 -0
- package/dist/dts/lib/testing/test-factory/create-integration-tests.d.ts.map +1 -0
- package/dist/dts/lib/testing/test-factory/test-do-lookup.d.ts +7 -0
- package/dist/dts/lib/testing/test-factory/test-do-lookup.d.ts.map +1 -0
- package/dist/dts/lib/testing/test-factory/test-on-message.d.ts +8 -0
- package/dist/dts/lib/testing/test-factory/test-on-message.d.ts.map +1 -0
- package/dist/dts/lib/types.d.ts +101 -0
- package/dist/dts/lib/types.d.ts.map +1 -0
- package/dist/dts/lib/zod-types.d.ts +278 -0
- package/dist/dts/lib/zod-types.d.ts.map +1 -0
- package/dist/dts/logging/index.d.ts +2 -0
- package/dist/dts/logging/index.d.ts.map +1 -0
- package/dist/dts/logging/logger.d.ts +49 -0
- package/dist/dts/logging/logger.d.ts.map +1 -0
- package/dist/dts/requests/index.d.ts +3 -0
- package/dist/dts/requests/index.d.ts.map +1 -0
- package/dist/dts/requests/polarity-request.d.ts +411 -0
- package/dist/dts/requests/polarity-request.d.ts.map +1 -0
- package/dist/dts/requests/sanitize-request-options.d.ts +20 -0
- package/dist/dts/requests/sanitize-request-options.d.ts.map +1 -0
- package/dist/dts/testing/enhanced-utils/create-entity.d.ts +3 -0
- package/dist/dts/testing/enhanced-utils/create-entity.d.ts.map +1 -0
- package/dist/dts/testing/enhanced-utils/create-mock-integration-context.d.ts +3 -0
- package/dist/dts/testing/enhanced-utils/create-mock-integration-context.d.ts.map +1 -0
- package/dist/dts/testing/enhanced-utils/mock-request.d.ts +14 -0
- package/dist/dts/testing/enhanced-utils/mock-request.d.ts.map +1 -0
- package/dist/dts/testing/enhanced-utils/validate-integration.d.ts +8 -0
- package/dist/dts/testing/enhanced-utils/validate-integration.d.ts.map +1 -0
- package/dist/dts/testing/index.d.ts +6 -0
- package/dist/dts/testing/index.d.ts.map +1 -0
- package/dist/dts/testing/test-factory/create-integration-tests.d.ts +6 -0
- package/dist/dts/testing/test-factory/create-integration-tests.d.ts.map +1 -0
- package/dist/dts/testing/test-factory/test-do-lookup.d.ts +7 -0
- package/dist/dts/testing/test-factory/test-do-lookup.d.ts.map +1 -0
- package/dist/dts/testing/test-factory/test-on-message.d.ts +8 -0
- package/dist/dts/testing/test-factory/test-on-message.d.ts.map +1 -0
- package/dist/dts/tsdoc-metadata.json +11 -0
- package/dist/dts/types.d.ts +101 -0
- package/dist/dts/types.d.ts.map +1 -0
- package/dist/dts/zod-types.d.ts +278 -0
- package/dist/dts/zod-types.d.ts.map +1 -0
- package/dist/es/lib/context/index.js +18 -0
- package/dist/es/lib/errors/api-request-error.js +15 -0
- package/dist/es/lib/errors/auth-request-error.js +15 -0
- package/dist/es/lib/errors/index.js +23 -0
- package/dist/es/lib/errors/integration-error.js +116 -0
- package/dist/es/lib/errors/library-usage-error.js +17 -0
- package/dist/es/lib/errors/network-error.js +88 -0
- package/dist/es/lib/errors/parse-error-to-readable-json.js +9 -0
- package/dist/es/lib/errors/retry-request-error.js +16 -0
- package/dist/es/lib/index.docs.js +25 -0
- package/dist/es/lib/index.js +50 -0
- package/dist/es/lib/internal/helpers/parallel-limit.js +36 -0
- package/dist/es/lib/internal/helpers/sanitize-object.js +37 -0
- package/dist/es/lib/logging/index.js +17 -0
- package/dist/es/lib/logging/logger.js +53 -0
- package/dist/es/lib/requests/index.js +18 -0
- package/dist/es/lib/requests/polarity-request.js +426 -0
- package/dist/es/lib/requests/sanitize-request-options.js +50 -0
- package/dist/es/lib/testing/enhanced-utils/create-entity.js +37 -0
- package/dist/es/lib/testing/enhanced-utils/create-mock-integration-context.js +36 -0
- package/dist/es/lib/testing/enhanced-utils/mock-request.js +22 -0
- package/dist/es/lib/testing/enhanced-utils/validate-integration.js +159 -0
- package/dist/es/lib/testing/index.js +21 -0
- package/dist/es/lib/testing/test-factory/create-integration-tests.js +53 -0
- package/dist/es/lib/testing/test-factory/test-do-lookup.js +24 -0
- package/dist/es/lib/testing/test-factory/test-on-message.js +24 -0
- package/dist/es/lib/types.js +5 -0
- package/dist/es/lib/zod-types.js +206 -0
- package/dist/lib/context/cache.js +2 -0
- package/dist/lib/context/index.js +18 -0
- package/dist/lib/context/integration-context.js +2 -0
- package/dist/lib/errors/api-request-error.js +15 -0
- package/dist/lib/errors/auth-request-error.js +15 -0
- package/dist/lib/errors/index.js +20 -8
- package/dist/lib/errors/integration-error.js +116 -0
- package/dist/lib/errors/library-usage-error.js +17 -0
- package/dist/lib/errors/network-error.js +88 -0
- package/dist/lib/errors/parse-error-to-readable-json.js +9 -0
- package/dist/lib/errors/retry-request-error.js +16 -0
- package/dist/lib/index.docs.js +25 -0
- package/dist/lib/index.js +47 -13
- package/dist/lib/internal/helpers/parallel-limit.js +36 -0
- package/dist/lib/internal/helpers/sanitize-object.js +37 -0
- package/dist/lib/logging/index.js +15 -2
- package/dist/lib/logging/logger.js +41 -5
- package/dist/lib/requests/index.js +15 -8
- package/dist/lib/requests/polarity-request.js +426 -0
- package/dist/lib/requests/sanitize-request-options.js +50 -0
- package/dist/lib/testing/enhanced-utils/create-entity.js +37 -0
- package/dist/lib/testing/enhanced-utils/create-mock-integration-context.js +36 -0
- package/dist/lib/testing/enhanced-utils/mock-request.js +22 -0
- package/dist/lib/testing/enhanced-utils/validate-integration.js +159 -0
- package/dist/lib/testing/index.js +21 -0
- package/dist/lib/testing/test-factory/create-integration-tests.js +53 -0
- package/dist/lib/testing/test-factory/test-do-lookup.js +24 -0
- package/dist/lib/testing/test-factory/test-on-message.js +24 -0
- package/dist/lib/types.js +5 -0
- package/dist/lib/zod-types.js +206 -0
- package/dist/polarity-integration-utils.d.ts +1259 -0
- package/package.json +81 -11
- package/dist/es/errors/RequestError.js +0 -12
- package/dist/es/errors/index.js +0 -11
- package/dist/es/errors/parseErrorToReadableJson.js +0 -4
- package/dist/es/helpers/async/index.js +0 -9
- package/dist/es/helpers/async/parallelLimit.js +0 -33
- package/dist/es/helpers/encodings/decodeBase64.js +0 -4
- package/dist/es/helpers/encodings/encodeBase64.js +0 -4
- package/dist/es/helpers/encodings/index.js +0 -11
- package/dist/es/helpers/index.js +0 -10
- package/dist/es/helpers/json/and.js +0 -4
- package/dist/es/helpers/json/filterObjectsContainingString.js +0 -10
- package/dist/es/helpers/json/index.js +0 -17
- package/dist/es/helpers/json/mapOverObject.js +0 -24
- package/dist/es/helpers/json/or.js +0 -4
- package/dist/es/helpers/json/transpose2dArray.js +0 -8
- package/dist/es/helpers/time/index.js +0 -11
- package/dist/es/helpers/time/millisecondsToHoursMinutesAndSeconds.js +0 -18
- package/dist/es/helpers/time/sleep.js +0 -13
- package/dist/es/index.js +0 -16
- package/dist/es/logging/index.js +0 -4
- package/dist/es/logging/logger.js +0 -17
- package/dist/es/requests/createRequestWithDefaults.js +0 -166
- package/dist/es/requests/createRequestsInParallel.js +0 -40
- package/dist/es/requests/index.js +0 -11
- package/dist/es/user-options/index.js +0 -9
- package/dist/es/user-options/validateUrlOption.js +0 -77
- package/dist/lib/errors/RequestError.js +0 -12
- package/dist/lib/errors/parseErrorToReadableJson.js +0 -4
- package/dist/lib/helpers/async/index.js +0 -9
- package/dist/lib/helpers/async/parallelLimit.js +0 -33
- package/dist/lib/helpers/encodings/decodeBase64.js +0 -4
- package/dist/lib/helpers/encodings/encodeBase64.js +0 -4
- package/dist/lib/helpers/encodings/index.js +0 -11
- package/dist/lib/helpers/index.js +0 -10
- package/dist/lib/helpers/json/and.js +0 -4
- package/dist/lib/helpers/json/filterObjectsContainingString.js +0 -10
- package/dist/lib/helpers/json/index.js +0 -17
- package/dist/lib/helpers/json/mapOverObject.js +0 -24
- package/dist/lib/helpers/json/or.js +0 -4
- package/dist/lib/helpers/json/transpose2dArray.js +0 -8
- package/dist/lib/helpers/time/index.js +0 -11
- package/dist/lib/helpers/time/millisecondsToHoursMinutesAndSeconds.js +0 -18
- package/dist/lib/helpers/time/sleep.js +0 -13
- package/dist/lib/requests/createRequestWithDefaults.js +0 -166
- package/dist/lib/requests/createRequestsInParallel.js +0 -40
- package/dist/lib/user-options/index.js +0 -9
- package/dist/lib/user-options/validateUrlOption.js +0 -77
- /package/dist/es/{requests/requestTypes.js → lib/context/cache.js} +0 -0
- /package/dist/{lib/requests/requestTypes.js → es/lib/context/integration-context.js} +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiRequestError = void 0;
|
|
4
|
+
const integration_error_1 = require("./integration-error");
|
|
5
|
+
/**
|
|
6
|
+
* API error for REST requests
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
class ApiRequestError extends integration_error_1.IntegrationError {
|
|
11
|
+
constructor(message, properties = {}) {
|
|
12
|
+
super(message, properties);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.ApiRequestError = ApiRequestError;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthRequestError = void 0;
|
|
4
|
+
const integration_error_1 = require("./integration-error");
|
|
5
|
+
/**
|
|
6
|
+
* Thrown by generateAccessToken method if there is a failure to fetch a token
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
class AuthRequestError extends integration_error_1.IntegrationError {
|
|
11
|
+
constructor(message, properties = {}) {
|
|
12
|
+
super(message, properties);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.AuthRequestError = AuthRequestError;
|
package/dist/lib/errors/index.js
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
4
15
|
};
|
|
5
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
17
|
+
__exportStar(require("./parse-error-to-readable-json"), exports);
|
|
18
|
+
__exportStar(require("./integration-error"), exports);
|
|
19
|
+
__exportStar(require("./api-request-error"), exports);
|
|
20
|
+
__exportStar(require("./auth-request-error"), exports);
|
|
21
|
+
__exportStar(require("./network-error"), exports);
|
|
22
|
+
__exportStar(require("./retry-request-error"), exports);
|
|
23
|
+
__exportStar(require("./library-usage-error"), exports);
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IntegrationError = void 0;
|
|
4
|
+
const parse_error_to_readable_json_1 = require("./parse-error-to-readable-json");
|
|
5
|
+
const sanitize_request_options_1 = require("../requests/sanitize-request-options");
|
|
6
|
+
/**
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
class IntegrationError extends Error {
|
|
10
|
+
/**
|
|
11
|
+
* a short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of
|
|
12
|
+
* the problem except for purposes of localization.
|
|
13
|
+
*/
|
|
14
|
+
title;
|
|
15
|
+
/**
|
|
16
|
+
* a human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be
|
|
17
|
+
* localized
|
|
18
|
+
*/
|
|
19
|
+
detail;
|
|
20
|
+
/**
|
|
21
|
+
* a meta object containing non-standard meta-information about the error.
|
|
22
|
+
*/
|
|
23
|
+
meta;
|
|
24
|
+
/**
|
|
25
|
+
* The HTTP status code applicable to this error, expressed as a string value.
|
|
26
|
+
*/
|
|
27
|
+
status;
|
|
28
|
+
/**
|
|
29
|
+
* an application-specific error code, expressed as a string value.
|
|
30
|
+
*/
|
|
31
|
+
code;
|
|
32
|
+
/**
|
|
33
|
+
* The `cause` property is used to specify the `cause` of the error. Typically,
|
|
34
|
+
* this property is used to pass through a related Error instance.
|
|
35
|
+
*/
|
|
36
|
+
cause;
|
|
37
|
+
/**
|
|
38
|
+
* Additional details related to the error that may help the user troubleshoot the issue. If set by the user
|
|
39
|
+
* via the Error constructor, the user provided value will override any automated help message set by the
|
|
40
|
+
* Error class.
|
|
41
|
+
*/
|
|
42
|
+
help;
|
|
43
|
+
/**
|
|
44
|
+
* Relevant for integration errors involving a network call, the `requestOptions` property
|
|
45
|
+
* details the request options that resulted in the specified error. The `requestOptions` property will automatically
|
|
46
|
+
* have sensitive authentication headers stripped.
|
|
47
|
+
*/
|
|
48
|
+
requestOptions;
|
|
49
|
+
/**
|
|
50
|
+
* Construct a new IntegrationError object.
|
|
51
|
+
* @param message - A string description of the error which is used as the `detail` property on the
|
|
52
|
+
* serialized error.
|
|
53
|
+
* @param properties - Optional properties for the error.
|
|
54
|
+
*/
|
|
55
|
+
constructor(message, properties = {}) {
|
|
56
|
+
super(message);
|
|
57
|
+
this.title = properties.title || this.constructor.name;
|
|
58
|
+
this.detail = message;
|
|
59
|
+
this.name = this.constructor.name;
|
|
60
|
+
if (typeof properties.code !== 'undefined') {
|
|
61
|
+
this.code = properties.code;
|
|
62
|
+
}
|
|
63
|
+
if (typeof properties.status !== 'undefined') {
|
|
64
|
+
this.status = properties.status;
|
|
65
|
+
}
|
|
66
|
+
if (properties.cause && properties.cause instanceof Error) {
|
|
67
|
+
this.cause = properties.cause;
|
|
68
|
+
}
|
|
69
|
+
if (typeof properties.requestOptions !== 'undefined') {
|
|
70
|
+
this.requestOptions = (0, sanitize_request_options_1.sanitizeRequestOptions)(properties.requestOptions, properties.requestOptionsToSanitize ? properties.requestOptionsToSanitize : []);
|
|
71
|
+
}
|
|
72
|
+
if (typeof properties.help !== 'undefined') {
|
|
73
|
+
this.help = properties.help;
|
|
74
|
+
}
|
|
75
|
+
if (typeof properties.meta !== 'undefined') {
|
|
76
|
+
this.meta = {
|
|
77
|
+
...properties.meta
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Serializes the error's properties into a POJO. The order of the
|
|
83
|
+
* properties is preserved when serialized.
|
|
84
|
+
* @returns JSON representation of the error
|
|
85
|
+
*/
|
|
86
|
+
toJSON() {
|
|
87
|
+
const props = {
|
|
88
|
+
name: this.name,
|
|
89
|
+
detail: this.detail,
|
|
90
|
+
title: this.title
|
|
91
|
+
};
|
|
92
|
+
if (this.stack) {
|
|
93
|
+
props.stack = this.stack;
|
|
94
|
+
}
|
|
95
|
+
if (this.code) {
|
|
96
|
+
props.code = this.code;
|
|
97
|
+
}
|
|
98
|
+
if (this.status) {
|
|
99
|
+
props.status = this.status;
|
|
100
|
+
}
|
|
101
|
+
if (this.help) {
|
|
102
|
+
props.help = this.help;
|
|
103
|
+
}
|
|
104
|
+
if (this.cause) {
|
|
105
|
+
props.cause = (0, parse_error_to_readable_json_1.parseErrorToReadableJson)(this.cause);
|
|
106
|
+
}
|
|
107
|
+
if (this.requestOptions) {
|
|
108
|
+
props.requestOptions = this.requestOptions;
|
|
109
|
+
}
|
|
110
|
+
if (this.meta && Object.keys(this.meta).length > 0) {
|
|
111
|
+
props.meta = this.meta;
|
|
112
|
+
}
|
|
113
|
+
return props;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
exports.IntegrationError = IntegrationError;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LibraryUsageError = void 0;
|
|
4
|
+
const integration_error_1 = require("./integration-error");
|
|
5
|
+
/**
|
|
6
|
+
* Thrown when the polarity-integration-utils library is used incorrectly. For example,
|
|
7
|
+
* if a method is called with incorrect or missing parameters, or a required initialization
|
|
8
|
+
* method is not called. This Error class should not be used directly by integrations.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
class LibraryUsageError extends integration_error_1.IntegrationError {
|
|
13
|
+
constructor(message, properties = {}) {
|
|
14
|
+
super(message, properties);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.LibraryUsageError = LibraryUsageError;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NetworkError = void 0;
|
|
4
|
+
const integration_error_1 = require("./integration-error");
|
|
5
|
+
// The following is a list of NodeJS error codes that are related
|
|
6
|
+
// to TLS/SSL certificate errors. These can be encountered when attempting to connect
|
|
7
|
+
// to a server/API/endpoint that has an invalid or untrusted TLS certificate.
|
|
8
|
+
//
|
|
9
|
+
// These codes were taken from this github issue:
|
|
10
|
+
// https://github.com/nodejs/node/issues/29342
|
|
11
|
+
const SSL_ERROR_CODES = new Set([
|
|
12
|
+
'UNABLE_TO_GET_ISSUER_CERT',
|
|
13
|
+
'UNABLE_TO_GET_CRL',
|
|
14
|
+
'UNABLE_TO_DECRYPT_CERT_SIGNATURE',
|
|
15
|
+
'UNABLE_TO_DECRYPT_CRL_SIGNATURE',
|
|
16
|
+
'UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY',
|
|
17
|
+
'CERT_SIGNATURE_FAILURE',
|
|
18
|
+
'CRL_SIGNATURE_FAILURE',
|
|
19
|
+
'CERT_NOT_YET_VALID',
|
|
20
|
+
'CERT_HAS_EXPIRED',
|
|
21
|
+
'CRL_NOT_YET_VALID',
|
|
22
|
+
'CRL_HAS_EXPIRED',
|
|
23
|
+
'ERROR_IN_CERT_NOT_BEFORE_FIELD',
|
|
24
|
+
'ERROR_IN_CERT_NOT_AFTER_FIELD',
|
|
25
|
+
'ERROR_IN_CRL_LAST_UPDATE_FIELD',
|
|
26
|
+
'ERROR_IN_CRL_NEXT_UPDATE_FIELD',
|
|
27
|
+
'OUT_OF_MEM',
|
|
28
|
+
'DEPTH_ZERO_SELF_SIGNED_CERT',
|
|
29
|
+
'SELF_SIGNED_CERT_IN_CHAIN',
|
|
30
|
+
'UNABLE_TO_GET_ISSUER_CERT_LOCALLY',
|
|
31
|
+
'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
|
|
32
|
+
'CERT_CHAIN_TOO_LONG',
|
|
33
|
+
'CERT_REVOKED',
|
|
34
|
+
'INVALID_CA',
|
|
35
|
+
'PATH_LENGTH_EXCEEDED',
|
|
36
|
+
'INVALID_PURPOSE',
|
|
37
|
+
'CERT_UNTRUSTED',
|
|
38
|
+
'CERT_REJECTED'
|
|
39
|
+
]);
|
|
40
|
+
// The following is a list of NodeJS error codes that are related to network connectivity issues
|
|
41
|
+
const NETWORK_CONNECTION_ERROR_CODES = new Set([
|
|
42
|
+
'ECONNRESET',
|
|
43
|
+
'ENOTFOUND',
|
|
44
|
+
'ETIMEDOUT',
|
|
45
|
+
'ECONNREFUSED',
|
|
46
|
+
'EHOSTUNREACH'
|
|
47
|
+
]);
|
|
48
|
+
/**
|
|
49
|
+
* Generic network error for REST requests.
|
|
50
|
+
* https://betterstack.com/community/guides/scaling-nodejs/nodejs-errors/#4-econnrefused
|
|
51
|
+
*
|
|
52
|
+
* @public
|
|
53
|
+
*/
|
|
54
|
+
class NetworkError extends integration_error_1.IntegrationError {
|
|
55
|
+
constructor(message, properties = {}) {
|
|
56
|
+
super(message, properties);
|
|
57
|
+
// Check if we are wrapping an original error
|
|
58
|
+
if (properties.cause instanceof Error) {
|
|
59
|
+
const originalError = properties.cause;
|
|
60
|
+
const code = originalError.code?.toString();
|
|
61
|
+
if (code && SSL_ERROR_CODES.has(code)) {
|
|
62
|
+
// @ts-expect-error work around due to typescript preventing readonly properties from
|
|
63
|
+
// parent constructor from being modified in subclass constructor
|
|
64
|
+
this.help =
|
|
65
|
+
'SSL errors are typically caused by an untrusted SSL certificate in the HTTPS request chain (e.g., ' +
|
|
66
|
+
'an internal server that is being queried directly, or a web proxy for external requests). You can temporarily ' +
|
|
67
|
+
'ignore SSL validation errors by enabling the integration setting "Allow Insecure TLS/SSL Connections". In most ' +
|
|
68
|
+
"cases, you will need to add your organization's Certificate Authority to the Polarity Server to resolve the " +
|
|
69
|
+
'issue permanently.';
|
|
70
|
+
}
|
|
71
|
+
else if (code && code === 'ENOTFOUND') {
|
|
72
|
+
// @ts-expect-error work around due to typescript preventing readonly properties from
|
|
73
|
+
// parent constructor from being modified in subclass constructor
|
|
74
|
+
this.help =
|
|
75
|
+
'The ENOTFOUND exception arises when the integration is unable to establish a connection to a domain due to a DNS error. It is commonly caused by incorrect host values or a typo in the domain name the integration is attempting to reach. This error can also be caused by a misconfigured proxy or firewall rule';
|
|
76
|
+
}
|
|
77
|
+
else if (code && NETWORK_CONNECTION_ERROR_CODES.has(code)) {
|
|
78
|
+
// @ts-expect-error work around due to typescript preventing readonly properties from
|
|
79
|
+
// parent constructor from being modified in subclass constructor
|
|
80
|
+
this.help =
|
|
81
|
+
'Network connection issues are typically caused by a misconfigured proxy or firewall rule. You may ' +
|
|
82
|
+
'need to add a proxy configuration to the integration and/or confirm that connectivity between the Polarity ' +
|
|
83
|
+
'Server and the intended host is available.';
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.NetworkError = NetworkError;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseErrorToReadableJson = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @public
|
|
6
|
+
* @param error - Error instance to parse into a plain old javascript object
|
|
7
|
+
*/
|
|
8
|
+
const parseErrorToReadableJson = (error) => JSON.parse(JSON.stringify(error, Object.getOwnPropertyNames(error)));
|
|
9
|
+
exports.parseErrorToReadableJson = parseErrorToReadableJson;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RetryRequestError = void 0;
|
|
4
|
+
const integration_error_1 = require("./integration-error");
|
|
5
|
+
/**
|
|
6
|
+
* Thrown by authenticated request method for any HTTP status codes where we want to allow
|
|
7
|
+
* the user to retry their lookup.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
class RetryRequestError extends integration_error_1.IntegrationError {
|
|
12
|
+
constructor(message, properties = {}) {
|
|
13
|
+
super(message, properties);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.RetryRequestError = RetryRequestError;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* API Docs index. This is used by api-extractor given our package.json exports.
|
|
19
|
+
* Monitoring: https://github.com/microsoft/rushstack/issues/3557
|
|
20
|
+
*/
|
|
21
|
+
__exportStar(require("./errors"), exports);
|
|
22
|
+
__exportStar(require("./requests"), exports);
|
|
23
|
+
__exportStar(require("./logging"), exports);
|
|
24
|
+
__exportStar(require("./types"), exports);
|
|
25
|
+
__exportStar(require("./context"), exports);
|
package/dist/lib/index.js
CHANGED
|
@@ -1,16 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
const
|
|
8
|
-
exports.errors =
|
|
9
|
-
const
|
|
10
|
-
exports.
|
|
11
|
-
const
|
|
12
|
-
exports.
|
|
13
|
-
const
|
|
14
|
-
exports.
|
|
15
|
-
const
|
|
16
|
-
exports.
|
|
39
|
+
exports.types = exports.context = exports.logging = exports.requests = exports.errors = void 0;
|
|
40
|
+
const errors = __importStar(require("./errors"));
|
|
41
|
+
exports.errors = errors;
|
|
42
|
+
const requests = __importStar(require("./requests"));
|
|
43
|
+
exports.requests = requests;
|
|
44
|
+
const logging = __importStar(require("./logging"));
|
|
45
|
+
exports.logging = logging;
|
|
46
|
+
const context = __importStar(require("./context"));
|
|
47
|
+
exports.context = context;
|
|
48
|
+
const types = __importStar(require("./types"));
|
|
49
|
+
exports.types = types;
|
|
50
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parallelLimit = parallelLimit;
|
|
4
|
+
const errors_1 = require("../../errors");
|
|
5
|
+
/**
|
|
6
|
+
* Execute an array of async tasks while ensuring that no more than `limit`
|
|
7
|
+
* tasks are running at the same time. Results preserve task order.
|
|
8
|
+
*
|
|
9
|
+
* @param tasks - Array of thunked async tasks (`() => Promise<T>`).
|
|
10
|
+
* @param limit - Maximum number of concurrent tasks (positive integer).
|
|
11
|
+
*/
|
|
12
|
+
async function parallelLimit(tasks, limit) {
|
|
13
|
+
// ─── Validation ──────────────────────────────────────────────────────────────
|
|
14
|
+
if (!Array.isArray(tasks)) {
|
|
15
|
+
throw new errors_1.LibraryUsageError('parallelLimit: `tasks` must be an array');
|
|
16
|
+
}
|
|
17
|
+
if (tasks.length === 0)
|
|
18
|
+
return [];
|
|
19
|
+
if (typeof limit !== 'number' ||
|
|
20
|
+
!Number.isInteger(limit) ||
|
|
21
|
+
limit <= 0) {
|
|
22
|
+
throw new errors_1.LibraryUsageError('parallelLimit: `limit` must be a positive integer');
|
|
23
|
+
}
|
|
24
|
+
const results = new Array(tasks.length);
|
|
25
|
+
let next = 0;
|
|
26
|
+
async function worker() {
|
|
27
|
+
while (true) {
|
|
28
|
+
const current = next++;
|
|
29
|
+
if (current >= tasks.length)
|
|
30
|
+
break;
|
|
31
|
+
results[current] = await tasks[current]();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
await Promise.all(Array.from({ length: Math.min(limit, tasks.length) }, () => worker()));
|
|
35
|
+
return results;
|
|
36
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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.sanitizeObject = sanitizeObject;
|
|
7
|
+
/** @internal */
|
|
8
|
+
const set_js_1 = __importDefault(require("lodash/set.js"));
|
|
9
|
+
const has_js_1 = __importDefault(require("lodash/has.js"));
|
|
10
|
+
/**
|
|
11
|
+
* Sanitizes the specified paths in an object by setting their values to a mask.
|
|
12
|
+
* This function returns a **new** object (deep clone) and does **not** mutate the original.
|
|
13
|
+
*
|
|
14
|
+
* @param obj - An object to sanitize (or nullish, which is returned directly).
|
|
15
|
+
* @param paths - An array of dot/bracket-notation paths to mask.
|
|
16
|
+
* @param mask - A replacement string. Defaults to "******".
|
|
17
|
+
* @returns A new object that has specified paths overwritten by `mask`.
|
|
18
|
+
*/
|
|
19
|
+
function sanitizeObject(obj, paths = [], mask = '******') {
|
|
20
|
+
// If not an object (null, undefined, etc.), return as-is.
|
|
21
|
+
if (!obj || typeof obj !== 'object') {
|
|
22
|
+
return obj;
|
|
23
|
+
}
|
|
24
|
+
// If paths is not a valid array, return as-is.
|
|
25
|
+
if (!Array.isArray(paths)) {
|
|
26
|
+
return obj;
|
|
27
|
+
}
|
|
28
|
+
// Create a deep clone so we do NOT mutate the original object
|
|
29
|
+
const clonedObj = structuredClone(obj);
|
|
30
|
+
// Replace each path's value with `mask`
|
|
31
|
+
for (const path of paths) {
|
|
32
|
+
if (typeof path === 'string' && (0, has_js_1.default)(clonedObj, path)) {
|
|
33
|
+
(0, set_js_1.default)(clonedObj, path, mask);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return clonedObj;
|
|
37
|
+
}
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
exports.default = { getLogger: logger_1.getLogger, setLogger: logger_1.setLogger };
|
|
17
|
+
__exportStar(require("./logger"), exports);
|
|
@@ -5,13 +5,49 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getLogger = exports.setLogger = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const fp_1 = require("lodash/fp");
|
|
9
8
|
const loggingLevels = ['info', 'debug', 'trace', 'warn', 'error', 'fatal'];
|
|
10
9
|
const writeToDevRunnerResults = (loggingLevel) => (...content) => fs_1.default.appendFileSync('devRunnerResults.json', '\n' + JSON.stringify({ SOURCE: `Logger.${loggingLevel}`, content }, null, 2));
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const defaultLogger = loggingLevels.reduce((agg, level) => ({
|
|
11
|
+
...agg,
|
|
12
|
+
[level]: writeToDevRunnerResults(level)
|
|
13
|
+
}), {});
|
|
14
|
+
let _logger = defaultLogger;
|
|
15
|
+
/**
|
|
16
|
+
* Set the logger object used by the integration.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* Example of setting the logger within the integration's startup method:
|
|
20
|
+
* ```js
|
|
21
|
+
* const { setLogger } = require('polarity-integration-utils/logger');
|
|
22
|
+
*
|
|
23
|
+
* function startup(logger){
|
|
24
|
+
* setLogger(logger);
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* You can now use {@link getLogger} to get the logger object anywhere within your integration codebase.
|
|
29
|
+
*
|
|
30
|
+
* @public
|
|
31
|
+
* @param logger - the integration logger object passed into the `startup` method
|
|
32
|
+
*/
|
|
33
|
+
const setLogger = (logger) => {
|
|
34
|
+
_logger = logger;
|
|
14
35
|
};
|
|
15
36
|
exports.setLogger = setLogger;
|
|
16
|
-
|
|
37
|
+
/**
|
|
38
|
+
* return the logger object set via the {@link setLogger} method.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* Example of using the integration's logging object:
|
|
42
|
+
* ```js
|
|
43
|
+
* const { getLogger } = require('polarity-integration-utils/logger');
|
|
44
|
+
*
|
|
45
|
+
* const logger = getLogger();
|
|
46
|
+
* logger.trace('this is a trace message');
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @public
|
|
50
|
+
* @returns the integration's logger object
|
|
51
|
+
*/
|
|
52
|
+
const getLogger = () => _logger;
|
|
17
53
|
exports.getLogger = getLogger;
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
4
15
|
};
|
|
5
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.default = {
|
|
9
|
-
createRequestWithDefaults: createRequestWithDefaults_1.default,
|
|
10
|
-
createRequestsInParallel: createRequestsInParallel_1.default
|
|
11
|
-
};
|
|
17
|
+
__exportStar(require("./polarity-request"), exports);
|
|
18
|
+
__exportStar(require("./sanitize-request-options"), exports);
|