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 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../lib/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ValidationErrorSchema: z.ZodObject<{
|
|
3
|
+
key: z.ZodString;
|
|
4
|
+
message: z.ZodString;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export declare const DropdownUserOptionValueSchema: z.ZodObject<{
|
|
7
|
+
display: z.ZodString;
|
|
8
|
+
value: z.ZodString;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export declare const PossibleUserOptionValueSchema: z.ZodUnion<readonly [z.ZodUndefined, z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
11
|
+
display: z.ZodString;
|
|
12
|
+
value: z.ZodString;
|
|
13
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
14
|
+
display: z.ZodString;
|
|
15
|
+
value: z.ZodString;
|
|
16
|
+
}, z.core.$strip>>]>;
|
|
17
|
+
export declare const DoLookupUserOptionsSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUndefined, z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
18
|
+
display: z.ZodString;
|
|
19
|
+
value: z.ZodString;
|
|
20
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
21
|
+
display: z.ZodString;
|
|
22
|
+
value: z.ZodString;
|
|
23
|
+
}, z.core.$strip>>]>>;
|
|
24
|
+
export declare const ValidateOptionsUserOptionSchema: z.ZodObject<{
|
|
25
|
+
integration_id: z.ZodOptional<z.ZodString>;
|
|
26
|
+
key: z.ZodString;
|
|
27
|
+
value: z.ZodUnion<readonly [z.ZodUndefined, z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
28
|
+
display: z.ZodString;
|
|
29
|
+
value: z.ZodString;
|
|
30
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
31
|
+
display: z.ZodString;
|
|
32
|
+
value: z.ZodString;
|
|
33
|
+
}, z.core.$strip>>]>;
|
|
34
|
+
user_can_edit: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
admin_only: z.ZodOptional<z.ZodBoolean>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export declare const ValidateOptionsUserOptionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
38
|
+
integration_id: z.ZodOptional<z.ZodString>;
|
|
39
|
+
key: z.ZodString;
|
|
40
|
+
value: z.ZodUnion<readonly [z.ZodUndefined, z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
41
|
+
display: z.ZodString;
|
|
42
|
+
value: z.ZodString;
|
|
43
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
44
|
+
display: z.ZodString;
|
|
45
|
+
value: z.ZodString;
|
|
46
|
+
}, z.core.$strip>>]>;
|
|
47
|
+
user_can_edit: z.ZodOptional<z.ZodBoolean>;
|
|
48
|
+
admin_only: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
+
}, z.core.$strip>>;
|
|
50
|
+
export declare const ChannelSchema: z.ZodObject<{
|
|
51
|
+
channel_name: z.ZodString;
|
|
52
|
+
id: z.ZodNumber;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
export declare const StandardEntityTypeSchema: z.ZodUnion<readonly [z.ZodLiteral<"IP">, z.ZodLiteral<"IPv4">, z.ZodLiteral<"IPv4CIDR">, z.ZodLiteral<"IPv6">, z.ZodLiteral<"MAC">, z.ZodLiteral<"MD5">, z.ZodLiteral<"SHA1">, z.ZodLiteral<"SHA256">, z.ZodLiteral<"cve">, z.ZodLiteral<"domain">, z.ZodLiteral<"email">, z.ZodLiteral<"hash">, z.ZodLiteral<"string">, z.ZodLiteral<"url">]>;
|
|
55
|
+
export declare const EntityTypeSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"IP">, z.ZodLiteral<"IPv4">, z.ZodLiteral<"IPv4CIDR">, z.ZodLiteral<"IPv6">, z.ZodLiteral<"MAC">, z.ZodLiteral<"MD5">, z.ZodLiteral<"SHA1">, z.ZodLiteral<"SHA256">, z.ZodLiteral<"cve">, z.ZodLiteral<"domain">, z.ZodLiteral<"email">, z.ZodLiteral<"hash">, z.ZodLiteral<"string">, z.ZodLiteral<"url">]>, z.ZodLiteral<"*">, z.ZodLiteral<"custom">, z.ZodCustom<`custom.${string}`, `custom.${string}`>]>;
|
|
56
|
+
export declare const EntitySchema: z.ZodObject<{
|
|
57
|
+
value: z.ZodString;
|
|
58
|
+
types: z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"IP">, z.ZodLiteral<"IPv4">, z.ZodLiteral<"IPv4CIDR">, z.ZodLiteral<"IPv6">, z.ZodLiteral<"MAC">, z.ZodLiteral<"MD5">, z.ZodLiteral<"SHA1">, z.ZodLiteral<"SHA256">, z.ZodLiteral<"cve">, z.ZodLiteral<"domain">, z.ZodLiteral<"email">, z.ZodLiteral<"hash">, z.ZodLiteral<"string">, z.ZodLiteral<"url">]>, z.ZodLiteral<"*">, z.ZodLiteral<"custom">, z.ZodCustom<`custom.${string}`, `custom.${string}`>]>>;
|
|
59
|
+
type: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"IP">, z.ZodLiteral<"IPv4">, z.ZodLiteral<"IPv4CIDR">, z.ZodLiteral<"IPv6">, z.ZodLiteral<"MAC">, z.ZodLiteral<"MD5">, z.ZodLiteral<"SHA1">, z.ZodLiteral<"SHA256">, z.ZodLiteral<"cve">, z.ZodLiteral<"domain">, z.ZodLiteral<"email">, z.ZodLiteral<"hash">, z.ZodLiteral<"string">, z.ZodLiteral<"url">]>, z.ZodLiteral<"*">, z.ZodLiteral<"custom">, z.ZodCustom<`custom.${string}`, `custom.${string}`>]>;
|
|
60
|
+
requestContext: z.ZodObject<{
|
|
61
|
+
requestType: z.ZodLiteral<"onDemand">;
|
|
62
|
+
isUserInitiated: z.ZodBoolean;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
longitude: z.ZodNumber;
|
|
65
|
+
latitude: z.ZodNumber;
|
|
66
|
+
isURL: z.ZodBoolean;
|
|
67
|
+
isSHA512: z.ZodBoolean;
|
|
68
|
+
isSHA256: z.ZodBoolean;
|
|
69
|
+
isSHA1: z.ZodBoolean;
|
|
70
|
+
isPrivateIP: z.ZodBoolean;
|
|
71
|
+
isMD5: z.ZodBoolean;
|
|
72
|
+
isIPv6: z.ZodBoolean;
|
|
73
|
+
isIPv4: z.ZodBoolean;
|
|
74
|
+
isIP: z.ZodBoolean;
|
|
75
|
+
isHex: z.ZodBoolean;
|
|
76
|
+
isHash: z.ZodBoolean;
|
|
77
|
+
isHTMLTag: z.ZodBoolean;
|
|
78
|
+
isEmail: z.ZodBoolean;
|
|
79
|
+
isDomain: z.ZodBoolean;
|
|
80
|
+
hashType: z.ZodUnion<readonly [z.ZodLiteral<"md5">, z.ZodLiteral<"sha1">, z.ZodLiteral<"sha256">, z.ZodLiteral<"sha512">, z.ZodLiteral<"">]>;
|
|
81
|
+
displayValue: z.ZodString;
|
|
82
|
+
channels: z.ZodArray<z.ZodObject<{
|
|
83
|
+
channel_name: z.ZodString;
|
|
84
|
+
id: z.ZodNumber;
|
|
85
|
+
}, z.core.$strip>>;
|
|
86
|
+
IPType: z.ZodUnion<readonly [z.ZodLiteral<"IPv4">, z.ZodLiteral<"IPv6">, z.ZodLiteral<"">]>;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
export declare const ResultSchema: z.ZodObject<{
|
|
89
|
+
entity: z.ZodObject<{
|
|
90
|
+
value: z.ZodString;
|
|
91
|
+
types: z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"IP">, z.ZodLiteral<"IPv4">, z.ZodLiteral<"IPv4CIDR">, z.ZodLiteral<"IPv6">, z.ZodLiteral<"MAC">, z.ZodLiteral<"MD5">, z.ZodLiteral<"SHA1">, z.ZodLiteral<"SHA256">, z.ZodLiteral<"cve">, z.ZodLiteral<"domain">, z.ZodLiteral<"email">, z.ZodLiteral<"hash">, z.ZodLiteral<"string">, z.ZodLiteral<"url">]>, z.ZodLiteral<"*">, z.ZodLiteral<"custom">, z.ZodCustom<`custom.${string}`, `custom.${string}`>]>>;
|
|
92
|
+
type: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"IP">, z.ZodLiteral<"IPv4">, z.ZodLiteral<"IPv4CIDR">, z.ZodLiteral<"IPv6">, z.ZodLiteral<"MAC">, z.ZodLiteral<"MD5">, z.ZodLiteral<"SHA1">, z.ZodLiteral<"SHA256">, z.ZodLiteral<"cve">, z.ZodLiteral<"domain">, z.ZodLiteral<"email">, z.ZodLiteral<"hash">, z.ZodLiteral<"string">, z.ZodLiteral<"url">]>, z.ZodLiteral<"*">, z.ZodLiteral<"custom">, z.ZodCustom<`custom.${string}`, `custom.${string}`>]>;
|
|
93
|
+
requestContext: z.ZodObject<{
|
|
94
|
+
requestType: z.ZodLiteral<"onDemand">;
|
|
95
|
+
isUserInitiated: z.ZodBoolean;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
longitude: z.ZodNumber;
|
|
98
|
+
latitude: z.ZodNumber;
|
|
99
|
+
isURL: z.ZodBoolean;
|
|
100
|
+
isSHA512: z.ZodBoolean;
|
|
101
|
+
isSHA256: z.ZodBoolean;
|
|
102
|
+
isSHA1: z.ZodBoolean;
|
|
103
|
+
isPrivateIP: z.ZodBoolean;
|
|
104
|
+
isMD5: z.ZodBoolean;
|
|
105
|
+
isIPv6: z.ZodBoolean;
|
|
106
|
+
isIPv4: z.ZodBoolean;
|
|
107
|
+
isIP: z.ZodBoolean;
|
|
108
|
+
isHex: z.ZodBoolean;
|
|
109
|
+
isHash: z.ZodBoolean;
|
|
110
|
+
isHTMLTag: z.ZodBoolean;
|
|
111
|
+
isEmail: z.ZodBoolean;
|
|
112
|
+
isDomain: z.ZodBoolean;
|
|
113
|
+
hashType: z.ZodUnion<readonly [z.ZodLiteral<"md5">, z.ZodLiteral<"sha1">, z.ZodLiteral<"sha256">, z.ZodLiteral<"sha512">, z.ZodLiteral<"">]>;
|
|
114
|
+
displayValue: z.ZodString;
|
|
115
|
+
channels: z.ZodArray<z.ZodObject<{
|
|
116
|
+
channel_name: z.ZodString;
|
|
117
|
+
id: z.ZodNumber;
|
|
118
|
+
}, z.core.$strip>>;
|
|
119
|
+
IPType: z.ZodUnion<readonly [z.ZodLiteral<"IPv4">, z.ZodLiteral<"IPv6">, z.ZodLiteral<"">]>;
|
|
120
|
+
}, z.core.$strip>;
|
|
121
|
+
displayValue: z.ZodOptional<z.ZodString>;
|
|
122
|
+
data: z.ZodObject<{
|
|
123
|
+
summary: z.ZodArray<z.ZodString>;
|
|
124
|
+
details: z.ZodUnknown;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
}, z.core.$strip>;
|
|
127
|
+
export declare const DoLookupResultSchema: z.ZodArray<z.ZodObject<{
|
|
128
|
+
entity: z.ZodObject<{
|
|
129
|
+
value: z.ZodString;
|
|
130
|
+
types: z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"IP">, z.ZodLiteral<"IPv4">, z.ZodLiteral<"IPv4CIDR">, z.ZodLiteral<"IPv6">, z.ZodLiteral<"MAC">, z.ZodLiteral<"MD5">, z.ZodLiteral<"SHA1">, z.ZodLiteral<"SHA256">, z.ZodLiteral<"cve">, z.ZodLiteral<"domain">, z.ZodLiteral<"email">, z.ZodLiteral<"hash">, z.ZodLiteral<"string">, z.ZodLiteral<"url">]>, z.ZodLiteral<"*">, z.ZodLiteral<"custom">, z.ZodCustom<`custom.${string}`, `custom.${string}`>]>>;
|
|
131
|
+
type: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"IP">, z.ZodLiteral<"IPv4">, z.ZodLiteral<"IPv4CIDR">, z.ZodLiteral<"IPv6">, z.ZodLiteral<"MAC">, z.ZodLiteral<"MD5">, z.ZodLiteral<"SHA1">, z.ZodLiteral<"SHA256">, z.ZodLiteral<"cve">, z.ZodLiteral<"domain">, z.ZodLiteral<"email">, z.ZodLiteral<"hash">, z.ZodLiteral<"string">, z.ZodLiteral<"url">]>, z.ZodLiteral<"*">, z.ZodLiteral<"custom">, z.ZodCustom<`custom.${string}`, `custom.${string}`>]>;
|
|
132
|
+
requestContext: z.ZodObject<{
|
|
133
|
+
requestType: z.ZodLiteral<"onDemand">;
|
|
134
|
+
isUserInitiated: z.ZodBoolean;
|
|
135
|
+
}, z.core.$strip>;
|
|
136
|
+
longitude: z.ZodNumber;
|
|
137
|
+
latitude: z.ZodNumber;
|
|
138
|
+
isURL: z.ZodBoolean;
|
|
139
|
+
isSHA512: z.ZodBoolean;
|
|
140
|
+
isSHA256: z.ZodBoolean;
|
|
141
|
+
isSHA1: z.ZodBoolean;
|
|
142
|
+
isPrivateIP: z.ZodBoolean;
|
|
143
|
+
isMD5: z.ZodBoolean;
|
|
144
|
+
isIPv6: z.ZodBoolean;
|
|
145
|
+
isIPv4: z.ZodBoolean;
|
|
146
|
+
isIP: z.ZodBoolean;
|
|
147
|
+
isHex: z.ZodBoolean;
|
|
148
|
+
isHash: z.ZodBoolean;
|
|
149
|
+
isHTMLTag: z.ZodBoolean;
|
|
150
|
+
isEmail: z.ZodBoolean;
|
|
151
|
+
isDomain: z.ZodBoolean;
|
|
152
|
+
hashType: z.ZodUnion<readonly [z.ZodLiteral<"md5">, z.ZodLiteral<"sha1">, z.ZodLiteral<"sha256">, z.ZodLiteral<"sha512">, z.ZodLiteral<"">]>;
|
|
153
|
+
displayValue: z.ZodString;
|
|
154
|
+
channels: z.ZodArray<z.ZodObject<{
|
|
155
|
+
channel_name: z.ZodString;
|
|
156
|
+
id: z.ZodNumber;
|
|
157
|
+
}, z.core.$strip>>;
|
|
158
|
+
IPType: z.ZodUnion<readonly [z.ZodLiteral<"IPv4">, z.ZodLiteral<"IPv6">, z.ZodLiteral<"">]>;
|
|
159
|
+
}, z.core.$strip>;
|
|
160
|
+
displayValue: z.ZodOptional<z.ZodString>;
|
|
161
|
+
data: z.ZodObject<{
|
|
162
|
+
summary: z.ZodArray<z.ZodString>;
|
|
163
|
+
details: z.ZodUnknown;
|
|
164
|
+
}, z.core.$strip>;
|
|
165
|
+
}, z.core.$strip>>;
|
|
166
|
+
export declare const IntegrationConfigSchema: z.ZodObject<{
|
|
167
|
+
polarityIntegrationUuid: z.ZodUUID;
|
|
168
|
+
name: z.ZodString;
|
|
169
|
+
acronym: z.ZodString;
|
|
170
|
+
description: z.ZodOptional<z.ZodString>;
|
|
171
|
+
defaultColor: z.ZodOptional<z.ZodString>;
|
|
172
|
+
entityTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
173
|
+
dataTypes: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
174
|
+
type: z.ZodOptional<z.ZodLiteral<"custom">>;
|
|
175
|
+
name: z.ZodOptional<z.ZodString>;
|
|
176
|
+
description: z.ZodOptional<z.ZodString>;
|
|
177
|
+
key: z.ZodString;
|
|
178
|
+
regex: z.ZodString;
|
|
179
|
+
editable: z.ZodOptional<z.ZodBoolean>;
|
|
180
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
181
|
+
}, z.core.$strip>]>>>;
|
|
182
|
+
customTypes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
183
|
+
type: z.ZodOptional<z.ZodLiteral<"custom">>;
|
|
184
|
+
name: z.ZodOptional<z.ZodString>;
|
|
185
|
+
description: z.ZodOptional<z.ZodString>;
|
|
186
|
+
key: z.ZodString;
|
|
187
|
+
regex: z.ZodString;
|
|
188
|
+
editable: z.ZodOptional<z.ZodBoolean>;
|
|
189
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
190
|
+
}, z.core.$strip>>>;
|
|
191
|
+
supportsAdditionalCustomTypes: z.ZodOptional<z.ZodBoolean>;
|
|
192
|
+
styles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
193
|
+
block: z.ZodObject<{
|
|
194
|
+
component: z.ZodObject<{
|
|
195
|
+
file: z.ZodString;
|
|
196
|
+
}, z.core.$strip>;
|
|
197
|
+
template: z.ZodObject<{
|
|
198
|
+
file: z.ZodString;
|
|
199
|
+
}, z.core.$strip>;
|
|
200
|
+
}, z.core.$strip>;
|
|
201
|
+
summary: z.ZodOptional<z.ZodObject<{
|
|
202
|
+
component: z.ZodObject<{
|
|
203
|
+
file: z.ZodString;
|
|
204
|
+
}, z.core.$strip>;
|
|
205
|
+
template: z.ZodObject<{
|
|
206
|
+
file: z.ZodString;
|
|
207
|
+
}, z.core.$strip>;
|
|
208
|
+
}, z.core.$strip>>;
|
|
209
|
+
onDemandOnly: z.ZodOptional<z.ZodBoolean>;
|
|
210
|
+
copyOnDemand: z.ZodOptional<z.ZodBoolean>;
|
|
211
|
+
logging: z.ZodOptional<z.ZodObject<{
|
|
212
|
+
level: z.ZodEnum<{
|
|
213
|
+
error: "error";
|
|
214
|
+
debug: "debug";
|
|
215
|
+
info: "info";
|
|
216
|
+
trace: "trace";
|
|
217
|
+
warn: "warn";
|
|
218
|
+
fatal: "fatal";
|
|
219
|
+
}>;
|
|
220
|
+
}, z.core.$strip>>;
|
|
221
|
+
request: z.ZodOptional<z.ZodObject<{
|
|
222
|
+
cert: z.ZodOptional<z.ZodString>;
|
|
223
|
+
key: z.ZodOptional<z.ZodString>;
|
|
224
|
+
passphrase: z.ZodOptional<z.ZodString>;
|
|
225
|
+
ca: z.ZodOptional<z.ZodString>;
|
|
226
|
+
proxy: z.ZodOptional<z.ZodString>;
|
|
227
|
+
rejectUnauthorized: z.ZodOptional<z.ZodBoolean>;
|
|
228
|
+
}, z.core.$strip>>;
|
|
229
|
+
options: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
230
|
+
type: z.ZodEnum<{
|
|
231
|
+
text: "text";
|
|
232
|
+
password: "password";
|
|
233
|
+
}>;
|
|
234
|
+
key: z.ZodString;
|
|
235
|
+
name: z.ZodString;
|
|
236
|
+
description: z.ZodOptional<z.ZodString>;
|
|
237
|
+
default: z.ZodNullable<z.ZodString>;
|
|
238
|
+
userCanEdit: z.ZodOptional<z.ZodBoolean>;
|
|
239
|
+
adminOnly: z.ZodOptional<z.ZodBoolean>;
|
|
240
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
241
|
+
type: z.ZodLiteral<"boolean">;
|
|
242
|
+
key: z.ZodString;
|
|
243
|
+
name: z.ZodString;
|
|
244
|
+
description: z.ZodOptional<z.ZodString>;
|
|
245
|
+
default: z.ZodNullable<z.ZodBoolean>;
|
|
246
|
+
userCanEdit: z.ZodOptional<z.ZodBoolean>;
|
|
247
|
+
adminOnly: z.ZodOptional<z.ZodBoolean>;
|
|
248
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
249
|
+
type: z.ZodLiteral<"number">;
|
|
250
|
+
key: z.ZodString;
|
|
251
|
+
name: z.ZodString;
|
|
252
|
+
description: z.ZodOptional<z.ZodString>;
|
|
253
|
+
default: z.ZodNullable<z.ZodNumber>;
|
|
254
|
+
userCanEdit: z.ZodOptional<z.ZodBoolean>;
|
|
255
|
+
adminOnly: z.ZodOptional<z.ZodBoolean>;
|
|
256
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
257
|
+
type: z.ZodLiteral<"select">;
|
|
258
|
+
key: z.ZodString;
|
|
259
|
+
name: z.ZodString;
|
|
260
|
+
description: z.ZodOptional<z.ZodString>;
|
|
261
|
+
default: z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
262
|
+
value: z.ZodString;
|
|
263
|
+
display: z.ZodString;
|
|
264
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
265
|
+
value: z.ZodString;
|
|
266
|
+
display: z.ZodString;
|
|
267
|
+
}, z.core.$strip>>, z.ZodString]>>;
|
|
268
|
+
options: z.ZodArray<z.ZodObject<{
|
|
269
|
+
value: z.ZodString;
|
|
270
|
+
display: z.ZodString;
|
|
271
|
+
}, z.core.$strip>>;
|
|
272
|
+
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
273
|
+
userCanEdit: z.ZodBoolean;
|
|
274
|
+
adminOnly: z.ZodBoolean;
|
|
275
|
+
}, z.core.$strip>], "type">>>;
|
|
276
|
+
}, z.core.$strip>;
|
|
277
|
+
export type IntegrationConfig = z.infer<typeof IntegrationConfigSchema>;
|
|
278
|
+
//# sourceMappingURL=zod-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod-types.d.ts","sourceRoot":"","sources":["../../lib/zod-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,qBAAqB;;;iBAGhC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;iBAGxC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;oBAOxC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;qBAGrC,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;iBAM1C,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;kBAG5C,CAAC;AAEF,eAAO,MAAM,aAAa;;;iBAGxB,CAAC;AAEH,eAAO,MAAM,wBAAwB,gVAenC,CAAC;AAEH,eAAO,MAAM,gBAAgB,ucAK3B,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkCvB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAOvB,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAwB,CAAC;AAyE1D,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoClC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
__exportStar(require("./cache"), exports);
|
|
18
|
+
__exportStar(require("./integration-context"), exports);
|
|
@@ -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;
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
__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);
|