polarity-integration-utils 2.0.8 → 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/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/index.d.ts +4 -1
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/index.docs.d.ts +1 -0
- package/dist/dts/index.docs.d.ts.map +1 -1
- 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/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/{tsdoc-metadata.json → dts/tsdoc-metadata.json} +1 -1
- package/dist/dts/types.d.ts +50 -53
- package/dist/dts/types.d.ts.map +1 -1
- 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/context/integration-context.js +2 -0
- package/dist/es/{errors → lib/errors}/network-error.js +1 -1
- package/dist/es/{index.docs.js → lib/index.docs.js} +1 -0
- package/dist/es/{index.js → lib/index.js} +9 -1
- 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/network-error.js +1 -1
- package/dist/lib/index.docs.js +1 -0
- package/dist/lib/index.js +9 -1
- 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 +3 -0
- package/dist/lib/zod-types.js +206 -0
- package/dist/polarity-integration-utils.d.ts +461 -54
- package/package.json +30 -9
- /package/dist/es/{types.js → lib/context/cache.js} +0 -0
- /package/dist/es/{errors → lib/errors}/api-request-error.js +0 -0
- /package/dist/es/{errors → lib/errors}/auth-request-error.js +0 -0
- /package/dist/es/{errors → lib/errors}/index.js +0 -0
- /package/dist/es/{errors → lib/errors}/integration-error.js +0 -0
- /package/dist/es/{errors → lib/errors}/library-usage-error.js +0 -0
- /package/dist/es/{errors → lib/errors}/parse-error-to-readable-json.js +0 -0
- /package/dist/es/{errors → lib/errors}/retry-request-error.js +0 -0
- /package/dist/es/{internal → lib/internal}/helpers/parallel-limit.js +0 -0
- /package/dist/es/{internal → lib/internal}/helpers/sanitize-object.js +0 -0
- /package/dist/es/{logging → lib/logging}/index.js +0 -0
- /package/dist/es/{logging → lib/logging}/logger.js +0 -0
- /package/dist/es/{requests → lib/requests}/index.js +0 -0
- /package/dist/es/{requests → lib/requests}/polarity-request.js +0 -0
- /package/dist/es/{requests → lib/requests}/sanitize-request-options.js +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Bottleneck from 'bottleneck';
|
|
2
|
+
import { z } from 'zod';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* API error for REST requests
|
|
@@ -18,6 +19,24 @@ export declare class AuthRequestError extends IntegrationError {
|
|
|
18
19
|
constructor(message: string, properties?: IntegrationErrorProperties);
|
|
19
20
|
}
|
|
20
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Cache operation options
|
|
24
|
+
*/
|
|
25
|
+
export declare interface CacheOptions {
|
|
26
|
+
/** Time-to-live in seconds. If not specified, uses default TTL */
|
|
27
|
+
ttl?: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
export declare type Channel = z.infer<typeof ChannelSchema>;
|
|
34
|
+
|
|
35
|
+
declare const ChannelSchema: z.ZodObject<{
|
|
36
|
+
channel_name: z.ZodString;
|
|
37
|
+
id: z.ZodNumber;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
|
|
21
40
|
/**
|
|
22
41
|
* @public
|
|
23
42
|
*/
|
|
@@ -31,6 +50,11 @@ export declare type ConfigRequestProxyOptions = {
|
|
|
31
50
|
json?: undefined | boolean;
|
|
32
51
|
};
|
|
33
52
|
|
|
53
|
+
/**
|
|
54
|
+
* @public
|
|
55
|
+
*/
|
|
56
|
+
export declare type DoLookupResult<TDetails = unknown> = Result<TDetails>[];
|
|
57
|
+
|
|
34
58
|
/**
|
|
35
59
|
* User options object passed into the integration's `doLookup` method.
|
|
36
60
|
*
|
|
@@ -52,17 +76,25 @@ export declare type ConfigRequestProxyOptions = {
|
|
|
52
76
|
* ```
|
|
53
77
|
* @public
|
|
54
78
|
*/
|
|
55
|
-
export declare type DoLookupUserOptions =
|
|
56
|
-
|
|
57
|
-
|
|
79
|
+
export declare type DoLookupUserOptions = z.infer<typeof DoLookupUserOptionsSchema>;
|
|
80
|
+
|
|
81
|
+
declare const DoLookupUserOptionsSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUndefined, z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
82
|
+
display: z.ZodString;
|
|
83
|
+
value: z.ZodString;
|
|
84
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
85
|
+
display: z.ZodString;
|
|
86
|
+
value: z.ZodString;
|
|
87
|
+
}, z.core.$strip>>]>>;
|
|
58
88
|
|
|
59
89
|
/**
|
|
60
90
|
* @public
|
|
61
91
|
*/
|
|
62
|
-
export declare type DropdownUserOptionValue =
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
92
|
+
export declare type DropdownUserOptionValue = z.infer<typeof DropdownUserOptionValueSchema>;
|
|
93
|
+
|
|
94
|
+
declare const DropdownUserOptionValueSchema: z.ZodObject<{
|
|
95
|
+
display: z.ZodString;
|
|
96
|
+
value: z.ZodString;
|
|
97
|
+
}, z.core.$strip>;
|
|
66
98
|
|
|
67
99
|
/**
|
|
68
100
|
* Represents a Polarity Entity object which is passed to an integration's
|
|
@@ -70,41 +102,48 @@ export declare type DropdownUserOptionValue = {
|
|
|
70
102
|
*
|
|
71
103
|
* @public
|
|
72
104
|
*/
|
|
73
|
-
export declare type Entity =
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
105
|
+
export declare type Entity = z.infer<typeof EntitySchema>;
|
|
106
|
+
|
|
107
|
+
declare const EntitySchema: z.ZodObject<{
|
|
108
|
+
value: z.ZodString;
|
|
109
|
+
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}`>]>>;
|
|
110
|
+
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}`>]>;
|
|
111
|
+
requestContext: z.ZodObject<{
|
|
112
|
+
requestType: z.ZodLiteral<"onDemand">;
|
|
113
|
+
isUserInitiated: z.ZodBoolean;
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
longitude: z.ZodNumber;
|
|
116
|
+
latitude: z.ZodNumber;
|
|
117
|
+
isURL: z.ZodBoolean;
|
|
118
|
+
isSHA512: z.ZodBoolean;
|
|
119
|
+
isSHA256: z.ZodBoolean;
|
|
120
|
+
isSHA1: z.ZodBoolean;
|
|
121
|
+
isPrivateIP: z.ZodBoolean;
|
|
122
|
+
isMD5: z.ZodBoolean;
|
|
123
|
+
isIPv6: z.ZodBoolean;
|
|
124
|
+
isIPv4: z.ZodBoolean;
|
|
125
|
+
isIP: z.ZodBoolean;
|
|
126
|
+
isHex: z.ZodBoolean;
|
|
127
|
+
isHash: z.ZodBoolean;
|
|
128
|
+
isHTMLTag: z.ZodBoolean;
|
|
129
|
+
isEmail: z.ZodBoolean;
|
|
130
|
+
isDomain: z.ZodBoolean;
|
|
131
|
+
hashType: z.ZodUnion<readonly [z.ZodLiteral<"md5">, z.ZodLiteral<"sha1">, z.ZodLiteral<"sha256">, z.ZodLiteral<"sha512">, z.ZodLiteral<"">]>;
|
|
132
|
+
displayValue: z.ZodString;
|
|
133
|
+
channels: z.ZodArray<z.ZodObject<{
|
|
134
|
+
channel_name: z.ZodString;
|
|
135
|
+
id: z.ZodNumber;
|
|
136
|
+
}, z.core.$strip>>;
|
|
137
|
+
IPType: z.ZodUnion<readonly [z.ZodLiteral<"IPv4">, z.ZodLiteral<"IPv6">, z.ZodLiteral<"">]>;
|
|
138
|
+
}, z.core.$strip>;
|
|
102
139
|
|
|
103
140
|
/**
|
|
104
141
|
* Entity Types including custom types
|
|
105
142
|
* @public
|
|
106
143
|
*/
|
|
107
|
-
export declare type EntityType =
|
|
144
|
+
export declare type EntityType = z.infer<typeof EntityTypeSchema>;
|
|
145
|
+
|
|
146
|
+
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}`>]>;
|
|
108
147
|
|
|
109
148
|
/**
|
|
110
149
|
* @public
|
|
@@ -141,6 +180,39 @@ export declare type ErrorMeta = {
|
|
|
141
180
|
*/
|
|
142
181
|
export declare const getLogger: () => Logger;
|
|
143
182
|
|
|
183
|
+
/**
|
|
184
|
+
* Global cache operations - shared across all integrations and users
|
|
185
|
+
* Use for system-wide statistics, feature flags, or shared configuration
|
|
186
|
+
*/
|
|
187
|
+
export declare interface GlobalCache {
|
|
188
|
+
/**
|
|
189
|
+
* Get a value from global cache
|
|
190
|
+
* @param key - The cache key
|
|
191
|
+
* @returns Promise that resolves to the cached value or null if not found
|
|
192
|
+
* @example
|
|
193
|
+
* const totalLookups = await cache.global.get('total_lookups') || 0;
|
|
194
|
+
*/
|
|
195
|
+
get(key: string): Promise<unknown>;
|
|
196
|
+
/**
|
|
197
|
+
* Set a value in global cache
|
|
198
|
+
* @param key - The cache key
|
|
199
|
+
* @param value - The value to cache (must be JSON serializable)
|
|
200
|
+
* @param options - Cache options including TTL
|
|
201
|
+
* @returns Promise that resolves when the operation completes
|
|
202
|
+
* @example
|
|
203
|
+
* await cache.global.set('total_lookups', count + 1, \{ ttl: 86400 \});
|
|
204
|
+
*/
|
|
205
|
+
set(key: string, value: unknown, options?: CacheOptions): Promise<void>;
|
|
206
|
+
/**
|
|
207
|
+
* Delete a value from global cache
|
|
208
|
+
* @param key - The cache key to delete
|
|
209
|
+
* @returns Promise that resolves when the operation completes
|
|
210
|
+
* @example
|
|
211
|
+
* await cache.global.delete('feature_flags');
|
|
212
|
+
*/
|
|
213
|
+
delete(key: string): Promise<void>;
|
|
214
|
+
}
|
|
215
|
+
|
|
144
216
|
export declare type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
|
|
145
217
|
|
|
146
218
|
/**
|
|
@@ -274,6 +346,178 @@ export declare type HttpRequestResponse = {
|
|
|
274
346
|
[key: string]: unknown;
|
|
275
347
|
};
|
|
276
348
|
|
|
349
|
+
export declare interface Integration<TStartupResult = unknown, TDetails = unknown> {
|
|
350
|
+
startup: (logger: Logger) => Promise<TStartupResult>;
|
|
351
|
+
doLookup: (entities: Entity[], options: DoLookupUserOptions, context: IntegrationContext) => Promise<DoLookupResult<TDetails> | IntegrationError | null | void>;
|
|
352
|
+
onMessage?: (payload: unknown, options: DoLookupUserOptions, context: IntegrationContext) => Promise<unknown>;
|
|
353
|
+
onDetails?: (lookupObject: Result<TDetails>, options: DoLookupUserOptions, context: IntegrationContext) => Promise<unknown>;
|
|
354
|
+
validateOptions: (options: ValidateOptionsUserOptions, context: IntegrationContext) => IntegrationError[];
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Integration-scoped cache operations - shared across all users of a specific integration
|
|
359
|
+
* Use for API responses, configuration, or data that's the same for all users
|
|
360
|
+
*/
|
|
361
|
+
export declare interface IntegrationCache {
|
|
362
|
+
/**
|
|
363
|
+
* Get a value from integration cache
|
|
364
|
+
* @param key - The cache key
|
|
365
|
+
* @returns Promise that resolves to the cached value or null if not found
|
|
366
|
+
* @example
|
|
367
|
+
* const config = await cache.integration.get('api_config');
|
|
368
|
+
*/
|
|
369
|
+
get(key: string): Promise<unknown>;
|
|
370
|
+
/**
|
|
371
|
+
* Set a value in integration cache
|
|
372
|
+
* @param key - The cache key
|
|
373
|
+
* @param value - The value to cache (must be JSON serializable)
|
|
374
|
+
* @param options - Cache options including TTL
|
|
375
|
+
* @returns Promise that resolves when the operation completes
|
|
376
|
+
* @example
|
|
377
|
+
* await cache.integration.set('lookup_ip_1.1.1.1', result, \{ ttl: 300 \});
|
|
378
|
+
*/
|
|
379
|
+
set(key: string, value: unknown, options?: CacheOptions): Promise<void>;
|
|
380
|
+
/**
|
|
381
|
+
* Delete a value from integration cache
|
|
382
|
+
* @param key - The cache key to delete
|
|
383
|
+
* @returns Promise that resolves when the operation completes
|
|
384
|
+
* @example
|
|
385
|
+
* await cache.integration.delete('expired_config');
|
|
386
|
+
*/
|
|
387
|
+
delete(key: string): Promise<void>;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* @public
|
|
392
|
+
*/
|
|
393
|
+
export declare type IntegrationConfig = z.infer<typeof IntegrationConfigSchema>;
|
|
394
|
+
|
|
395
|
+
declare const IntegrationConfigSchema: z.ZodObject<{
|
|
396
|
+
polarityIntegrationUuid: z.ZodUUID;
|
|
397
|
+
name: z.ZodString;
|
|
398
|
+
acronym: z.ZodString;
|
|
399
|
+
description: z.ZodOptional<z.ZodString>;
|
|
400
|
+
defaultColor: z.ZodOptional<z.ZodString>;
|
|
401
|
+
entityTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
402
|
+
dataTypes: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
403
|
+
type: z.ZodOptional<z.ZodLiteral<"custom">>;
|
|
404
|
+
name: z.ZodOptional<z.ZodString>;
|
|
405
|
+
description: z.ZodOptional<z.ZodString>;
|
|
406
|
+
key: z.ZodString;
|
|
407
|
+
regex: z.ZodString;
|
|
408
|
+
editable: z.ZodOptional<z.ZodBoolean>;
|
|
409
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
410
|
+
}, z.core.$strip>]>>>;
|
|
411
|
+
customTypes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
412
|
+
type: z.ZodOptional<z.ZodLiteral<"custom">>;
|
|
413
|
+
name: z.ZodOptional<z.ZodString>;
|
|
414
|
+
description: z.ZodOptional<z.ZodString>;
|
|
415
|
+
key: z.ZodString;
|
|
416
|
+
regex: z.ZodString;
|
|
417
|
+
editable: z.ZodOptional<z.ZodBoolean>;
|
|
418
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
419
|
+
}, z.core.$strip>>>;
|
|
420
|
+
supportsAdditionalCustomTypes: z.ZodOptional<z.ZodBoolean>;
|
|
421
|
+
styles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
422
|
+
block: z.ZodObject<{
|
|
423
|
+
component: z.ZodObject<{
|
|
424
|
+
file: z.ZodString;
|
|
425
|
+
}, z.core.$strip>;
|
|
426
|
+
template: z.ZodObject<{
|
|
427
|
+
file: z.ZodString;
|
|
428
|
+
}, z.core.$strip>;
|
|
429
|
+
}, z.core.$strip>;
|
|
430
|
+
summary: z.ZodOptional<z.ZodObject<{
|
|
431
|
+
component: z.ZodObject<{
|
|
432
|
+
file: z.ZodString;
|
|
433
|
+
}, z.core.$strip>;
|
|
434
|
+
template: z.ZodObject<{
|
|
435
|
+
file: z.ZodString;
|
|
436
|
+
}, z.core.$strip>;
|
|
437
|
+
}, z.core.$strip>>;
|
|
438
|
+
onDemandOnly: z.ZodOptional<z.ZodBoolean>;
|
|
439
|
+
copyOnDemand: z.ZodOptional<z.ZodBoolean>;
|
|
440
|
+
logging: z.ZodOptional<z.ZodObject<{
|
|
441
|
+
level: z.ZodEnum<{
|
|
442
|
+
error: "error";
|
|
443
|
+
debug: "debug";
|
|
444
|
+
info: "info";
|
|
445
|
+
trace: "trace";
|
|
446
|
+
warn: "warn";
|
|
447
|
+
fatal: "fatal";
|
|
448
|
+
}>;
|
|
449
|
+
}, z.core.$strip>>;
|
|
450
|
+
request: z.ZodOptional<z.ZodObject<{
|
|
451
|
+
cert: z.ZodOptional<z.ZodString>;
|
|
452
|
+
key: z.ZodOptional<z.ZodString>;
|
|
453
|
+
passphrase: z.ZodOptional<z.ZodString>;
|
|
454
|
+
ca: z.ZodOptional<z.ZodString>;
|
|
455
|
+
proxy: z.ZodOptional<z.ZodString>;
|
|
456
|
+
rejectUnauthorized: z.ZodOptional<z.ZodBoolean>;
|
|
457
|
+
}, z.core.$strip>>;
|
|
458
|
+
options: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
459
|
+
type: z.ZodEnum<{
|
|
460
|
+
text: "text";
|
|
461
|
+
password: "password";
|
|
462
|
+
}>;
|
|
463
|
+
key: z.ZodString;
|
|
464
|
+
name: z.ZodString;
|
|
465
|
+
description: z.ZodOptional<z.ZodString>;
|
|
466
|
+
default: z.ZodNullable<z.ZodString>;
|
|
467
|
+
userCanEdit: z.ZodOptional<z.ZodBoolean>;
|
|
468
|
+
adminOnly: z.ZodOptional<z.ZodBoolean>;
|
|
469
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
470
|
+
type: z.ZodLiteral<"boolean">;
|
|
471
|
+
key: z.ZodString;
|
|
472
|
+
name: z.ZodString;
|
|
473
|
+
description: z.ZodOptional<z.ZodString>;
|
|
474
|
+
default: z.ZodNullable<z.ZodBoolean>;
|
|
475
|
+
userCanEdit: z.ZodOptional<z.ZodBoolean>;
|
|
476
|
+
adminOnly: z.ZodOptional<z.ZodBoolean>;
|
|
477
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
478
|
+
type: z.ZodLiteral<"number">;
|
|
479
|
+
key: z.ZodString;
|
|
480
|
+
name: z.ZodString;
|
|
481
|
+
description: z.ZodOptional<z.ZodString>;
|
|
482
|
+
default: z.ZodNullable<z.ZodNumber>;
|
|
483
|
+
userCanEdit: z.ZodOptional<z.ZodBoolean>;
|
|
484
|
+
adminOnly: z.ZodOptional<z.ZodBoolean>;
|
|
485
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
486
|
+
type: z.ZodLiteral<"select">;
|
|
487
|
+
key: z.ZodString;
|
|
488
|
+
name: z.ZodString;
|
|
489
|
+
description: z.ZodOptional<z.ZodString>;
|
|
490
|
+
default: z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
491
|
+
value: z.ZodString;
|
|
492
|
+
display: z.ZodString;
|
|
493
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
494
|
+
value: z.ZodString;
|
|
495
|
+
display: z.ZodString;
|
|
496
|
+
}, z.core.$strip>>, z.ZodString]>>;
|
|
497
|
+
options: z.ZodArray<z.ZodObject<{
|
|
498
|
+
value: z.ZodString;
|
|
499
|
+
display: z.ZodString;
|
|
500
|
+
}, z.core.$strip>>;
|
|
501
|
+
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
502
|
+
userCanEdit: z.ZodBoolean;
|
|
503
|
+
adminOnly: z.ZodBoolean;
|
|
504
|
+
}, z.core.$strip>], "type">>>;
|
|
505
|
+
}, z.core.$strip>;
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Integration context provided to integration functions
|
|
509
|
+
*/
|
|
510
|
+
export declare interface IntegrationContext {
|
|
511
|
+
/** Cache client for hierarchical caching operations */
|
|
512
|
+
cache: PolarityCache;
|
|
513
|
+
/** Integration identifier */
|
|
514
|
+
integrationId: string;
|
|
515
|
+
/** User identifier */
|
|
516
|
+
userId?: string;
|
|
517
|
+
/** Logger instance */
|
|
518
|
+
logger: Logger;
|
|
519
|
+
}
|
|
520
|
+
|
|
277
521
|
/**
|
|
278
522
|
* @public
|
|
279
523
|
*/
|
|
@@ -422,7 +666,7 @@ export declare class LibraryUsageError extends IntegrationError {
|
|
|
422
666
|
/**
|
|
423
667
|
* @public
|
|
424
668
|
*/
|
|
425
|
-
|
|
669
|
+
declare type Logger = {
|
|
426
670
|
child?(arg: unknown): Logger;
|
|
427
671
|
info(...args: unknown[]): void;
|
|
428
672
|
debug(...args: unknown[]): void;
|
|
@@ -431,6 +675,8 @@ export declare type Logger = {
|
|
|
431
675
|
error(...args: unknown[]): void;
|
|
432
676
|
fatal(...args: unknown[]): void;
|
|
433
677
|
};
|
|
678
|
+
export { Logger }
|
|
679
|
+
export { Logger as PolarityLogger }
|
|
434
680
|
|
|
435
681
|
/**
|
|
436
682
|
* @public
|
|
@@ -455,6 +701,52 @@ export declare class NetworkError extends IntegrationError {
|
|
|
455
701
|
*/
|
|
456
702
|
export declare const parseErrorToReadableJson: (error: Error_2) => any;
|
|
457
703
|
|
|
704
|
+
/**
|
|
705
|
+
* Main cache interface providing hierarchical caching with three scopes
|
|
706
|
+
*
|
|
707
|
+
* Cache Hierarchy:
|
|
708
|
+
* - Global: System-wide data shared across all integrations
|
|
709
|
+
* - Integration: Data shared among all users of a specific integration
|
|
710
|
+
* - User: User-specific data within an integration context
|
|
711
|
+
*
|
|
712
|
+
* Best Practices:
|
|
713
|
+
* - Use appropriate TTL values to prevent stale data
|
|
714
|
+
* - Handle cache misses gracefully (operations may return null)
|
|
715
|
+
* - Wrap cache operations in try/catch blocks
|
|
716
|
+
* - Use descriptive keys that won't conflict with other data
|
|
717
|
+
*
|
|
718
|
+
* @example
|
|
719
|
+
* ```javascript
|
|
720
|
+
* // In your integration functions:
|
|
721
|
+
* async function doLookup(entities, options, context) {
|
|
722
|
+
* const cache = context?.cache;
|
|
723
|
+
* if (!cache) return generateFreshData();
|
|
724
|
+
*
|
|
725
|
+
* try {
|
|
726
|
+
* // Check integration cache first
|
|
727
|
+
* const cached = await cache.integration.get(`lookup_${entity.value}`);
|
|
728
|
+
* if (cached) return cached;
|
|
729
|
+
*
|
|
730
|
+
* // Generate and cache new data
|
|
731
|
+
* const result = await apiCall(entity);
|
|
732
|
+
* await cache.integration.set(`lookup_${entity.value}`, result, { ttl: 300 });
|
|
733
|
+
* return result;
|
|
734
|
+
* } catch (error) {
|
|
735
|
+
* console.error('Cache error:', error);
|
|
736
|
+
* return generateFreshData(); // Fallback
|
|
737
|
+
* }
|
|
738
|
+
* }
|
|
739
|
+
* ```
|
|
740
|
+
*/
|
|
741
|
+
export declare interface PolarityCache {
|
|
742
|
+
/** Global cache operations - shared across all integrations and users */
|
|
743
|
+
global: GlobalCache;
|
|
744
|
+
/** Integration-scoped cache operations - shared across all users of a specific integration */
|
|
745
|
+
integration: IntegrationCache;
|
|
746
|
+
/** User-scoped cache operations - specific to individual users */
|
|
747
|
+
user: UserCache;
|
|
748
|
+
}
|
|
749
|
+
|
|
458
750
|
/**
|
|
459
751
|
* A utility class for making HTTP requests
|
|
460
752
|
* @public
|
|
@@ -657,7 +949,15 @@ export declare class PolarityRequest {
|
|
|
657
949
|
/**
|
|
658
950
|
* @public
|
|
659
951
|
*/
|
|
660
|
-
export declare type PossibleUserOptionValue =
|
|
952
|
+
export declare type PossibleUserOptionValue = z.infer<typeof PossibleUserOptionValueSchema>;
|
|
953
|
+
|
|
954
|
+
declare const PossibleUserOptionValueSchema: z.ZodUnion<readonly [z.ZodUndefined, z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
955
|
+
display: z.ZodString;
|
|
956
|
+
value: z.ZodString;
|
|
957
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
958
|
+
display: z.ZodString;
|
|
959
|
+
value: z.ZodString;
|
|
960
|
+
}, z.core.$strip>>]>;
|
|
661
961
|
|
|
662
962
|
/**
|
|
663
963
|
* @public
|
|
@@ -687,6 +987,56 @@ export declare class PolarityRequest {
|
|
|
687
987
|
*/
|
|
688
988
|
export declare type PreprocessRequestOptions = (requestOptions: HttpRequestOptions, userOptions: DoLookupUserOptions) => Promise<HttpRequestOptions> | never | undefined;
|
|
689
989
|
|
|
990
|
+
/**
|
|
991
|
+
* @public
|
|
992
|
+
*/
|
|
993
|
+
export declare type Result<TDetails = unknown> = Omit<z.infer<typeof ResultSchema>, 'data'> & {
|
|
994
|
+
data: {
|
|
995
|
+
summary: string[];
|
|
996
|
+
details: TDetails;
|
|
997
|
+
};
|
|
998
|
+
};
|
|
999
|
+
|
|
1000
|
+
declare const ResultSchema: z.ZodObject<{
|
|
1001
|
+
entity: z.ZodObject<{
|
|
1002
|
+
value: z.ZodString;
|
|
1003
|
+
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}`>]>>;
|
|
1004
|
+
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}`>]>;
|
|
1005
|
+
requestContext: z.ZodObject<{
|
|
1006
|
+
requestType: z.ZodLiteral<"onDemand">;
|
|
1007
|
+
isUserInitiated: z.ZodBoolean;
|
|
1008
|
+
}, z.core.$strip>;
|
|
1009
|
+
longitude: z.ZodNumber;
|
|
1010
|
+
latitude: z.ZodNumber;
|
|
1011
|
+
isURL: z.ZodBoolean;
|
|
1012
|
+
isSHA512: z.ZodBoolean;
|
|
1013
|
+
isSHA256: z.ZodBoolean;
|
|
1014
|
+
isSHA1: z.ZodBoolean;
|
|
1015
|
+
isPrivateIP: z.ZodBoolean;
|
|
1016
|
+
isMD5: z.ZodBoolean;
|
|
1017
|
+
isIPv6: z.ZodBoolean;
|
|
1018
|
+
isIPv4: z.ZodBoolean;
|
|
1019
|
+
isIP: z.ZodBoolean;
|
|
1020
|
+
isHex: z.ZodBoolean;
|
|
1021
|
+
isHash: z.ZodBoolean;
|
|
1022
|
+
isHTMLTag: z.ZodBoolean;
|
|
1023
|
+
isEmail: z.ZodBoolean;
|
|
1024
|
+
isDomain: z.ZodBoolean;
|
|
1025
|
+
hashType: z.ZodUnion<readonly [z.ZodLiteral<"md5">, z.ZodLiteral<"sha1">, z.ZodLiteral<"sha256">, z.ZodLiteral<"sha512">, z.ZodLiteral<"">]>;
|
|
1026
|
+
displayValue: z.ZodString;
|
|
1027
|
+
channels: z.ZodArray<z.ZodObject<{
|
|
1028
|
+
channel_name: z.ZodString;
|
|
1029
|
+
id: z.ZodNumber;
|
|
1030
|
+
}, z.core.$strip>>;
|
|
1031
|
+
IPType: z.ZodUnion<readonly [z.ZodLiteral<"IPv4">, z.ZodLiteral<"IPv6">, z.ZodLiteral<"">]>;
|
|
1032
|
+
}, z.core.$strip>;
|
|
1033
|
+
displayValue: z.ZodOptional<z.ZodString>;
|
|
1034
|
+
data: z.ZodObject<{
|
|
1035
|
+
summary: z.ZodArray<z.ZodString>;
|
|
1036
|
+
details: z.ZodUnknown;
|
|
1037
|
+
}, z.core.$strip>;
|
|
1038
|
+
}, z.core.$strip>;
|
|
1039
|
+
|
|
690
1040
|
/**
|
|
691
1041
|
* Thrown by authenticated request method for any HTTP status codes where we want to allow
|
|
692
1042
|
* the user to retry their lookup.
|
|
@@ -821,32 +1171,89 @@ export declare class PolarityRequest {
|
|
|
821
1171
|
* List of supported entity type values
|
|
822
1172
|
* @public
|
|
823
1173
|
*/
|
|
824
|
-
export declare type StandardEntityType =
|
|
1174
|
+
export declare type StandardEntityType = z.infer<typeof StandardEntityTypeSchema>;
|
|
1175
|
+
|
|
1176
|
+
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">]>;
|
|
1177
|
+
|
|
1178
|
+
/**
|
|
1179
|
+
* User-scoped cache operations - specific to individual users
|
|
1180
|
+
* Use for user preferences, recent activity, or personalized data
|
|
1181
|
+
*/
|
|
1182
|
+
export declare interface UserCache {
|
|
1183
|
+
/**
|
|
1184
|
+
* Get a value from user cache
|
|
1185
|
+
* @param key - The cache key
|
|
1186
|
+
* @returns Promise that resolves to the cached value or null if not found
|
|
1187
|
+
* @example
|
|
1188
|
+
* const preferences = await cache.user.get('preferences');
|
|
1189
|
+
*/
|
|
1190
|
+
get(key: string): Promise<unknown>;
|
|
1191
|
+
/**
|
|
1192
|
+
* Set a value in user cache
|
|
1193
|
+
* @param key - The cache key
|
|
1194
|
+
* @param value - The value to cache (must be JSON serializable)
|
|
1195
|
+
* @param options - Cache options including TTL
|
|
1196
|
+
* @returns Promise that resolves when the operation completes
|
|
1197
|
+
* @example
|
|
1198
|
+
* await cache.user.set('recent_lookups', lookups, \{ ttl: 3600 \});
|
|
1199
|
+
*/
|
|
1200
|
+
set(key: string, value: unknown, options?: CacheOptions): Promise<void>;
|
|
1201
|
+
/**
|
|
1202
|
+
* Delete a value from user cache
|
|
1203
|
+
* @param key - The cache key to delete
|
|
1204
|
+
* @returns Promise that resolves when the operation completes
|
|
1205
|
+
* @example
|
|
1206
|
+
* await cache.user.delete('preferences');
|
|
1207
|
+
*/
|
|
1208
|
+
delete(key: string): Promise<void>;
|
|
1209
|
+
}
|
|
825
1210
|
|
|
826
1211
|
/**
|
|
827
1212
|
* @public
|
|
828
1213
|
*/
|
|
829
|
-
export declare type ValidateOptionsUserOption =
|
|
830
|
-
integration_id?: string;
|
|
831
|
-
key: string;
|
|
832
|
-
value: PossibleUserOptionValue;
|
|
833
|
-
user_can_edit?: boolean;
|
|
834
|
-
admin_only?: boolean;
|
|
835
|
-
};
|
|
1214
|
+
export declare type ValidateOptionsUserOption = z.infer<typeof ValidateOptionsUserOptionSchema>;
|
|
836
1215
|
|
|
837
1216
|
/**
|
|
838
1217
|
* @public
|
|
839
1218
|
*/
|
|
840
|
-
export declare type ValidateOptionsUserOptions =
|
|
841
|
-
|
|
842
|
-
|
|
1219
|
+
export declare type ValidateOptionsUserOptions = z.infer<typeof ValidateOptionsUserOptionsSchema>;
|
|
1220
|
+
|
|
1221
|
+
declare const ValidateOptionsUserOptionSchema: z.ZodObject<{
|
|
1222
|
+
integration_id: z.ZodOptional<z.ZodString>;
|
|
1223
|
+
key: z.ZodString;
|
|
1224
|
+
value: z.ZodUnion<readonly [z.ZodUndefined, z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
1225
|
+
display: z.ZodString;
|
|
1226
|
+
value: z.ZodString;
|
|
1227
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
1228
|
+
display: z.ZodString;
|
|
1229
|
+
value: z.ZodString;
|
|
1230
|
+
}, z.core.$strip>>]>;
|
|
1231
|
+
user_can_edit: z.ZodOptional<z.ZodBoolean>;
|
|
1232
|
+
admin_only: z.ZodOptional<z.ZodBoolean>;
|
|
1233
|
+
}, z.core.$strip>;
|
|
1234
|
+
|
|
1235
|
+
declare const ValidateOptionsUserOptionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1236
|
+
integration_id: z.ZodOptional<z.ZodString>;
|
|
1237
|
+
key: z.ZodString;
|
|
1238
|
+
value: z.ZodUnion<readonly [z.ZodUndefined, z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
1239
|
+
display: z.ZodString;
|
|
1240
|
+
value: z.ZodString;
|
|
1241
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
1242
|
+
display: z.ZodString;
|
|
1243
|
+
value: z.ZodString;
|
|
1244
|
+
}, z.core.$strip>>]>;
|
|
1245
|
+
user_can_edit: z.ZodOptional<z.ZodBoolean>;
|
|
1246
|
+
admin_only: z.ZodOptional<z.ZodBoolean>;
|
|
1247
|
+
}, z.core.$strip>>;
|
|
843
1248
|
|
|
844
1249
|
/**
|
|
845
1250
|
* @public
|
|
846
1251
|
*/
|
|
847
|
-
export declare type ValidationError =
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
1252
|
+
export declare type ValidationError = z.infer<typeof ValidationErrorSchema>;
|
|
1253
|
+
|
|
1254
|
+
declare const ValidationErrorSchema: z.ZodObject<{
|
|
1255
|
+
key: z.ZodString;
|
|
1256
|
+
message: z.ZodString;
|
|
1257
|
+
}, z.core.$strip>;
|
|
851
1258
|
|
|
852
1259
|
export { }
|