@adaptic/lumic-utils 1.0.8 → 1.0.9
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/{index-Cstek604.js → index-CcXQeJz8.js} +22 -182
- package/dist/index-CcXQeJz8.js.map +1 -0
- package/dist/{index-DZZCd-1T.js → index-CcgbRft2.js} +22 -182
- package/dist/index-CcgbRft2.js.map +1 -0
- package/dist/index.cjs +11417 -122
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +11399 -39
- package/dist/index.mjs.map +1 -1
- package/dist/test.cjs +7 -24
- package/dist/test.cjs.map +1 -1
- package/dist/test.mjs +7 -24
- package/dist/test.mjs.map +1 -1
- package/dist/types/aws-types.ts +1 -1
- package/dist/types/functions/aws-lambda.d.ts +1 -1
- package/dist/types/functions/aws-s3-utils.d.ts +2 -2
- package/dist/types/functions/google-sheets.d.ts +4 -4
- package/dist/types/functions/json-llm-tools.d.ts +3 -25
- package/dist/types/functions/llm-call.d.ts +2 -2
- package/dist/types/functions/llm-deepseek.d.ts +1 -1
- package/dist/types/functions/llm-openai.d.ts +2 -3
- package/dist/types/functions/llm-utils.d.ts +1 -24
- package/dist/types/functions/slack-utils.d.ts +4 -3
- package/dist/types/functions/utils.d.ts +14 -2
- package/dist/types/functions/zip-utils.d.ts +10 -12
- package/dist/types/google-types.ts +3 -6
- package/dist/types/index.d.ts +0 -30
- package/dist/types/index.ts +1 -1
- package/dist/types/openai-types.ts +6 -165
- package/dist/types/types/aws-types.d.ts +1 -1
- package/dist/types/types/google-types.d.ts +3 -5
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/types/openai-types.d.ts +3 -149
- package/dist/types/utils/aws-initialise.d.ts +1 -6
- package/package.json +3 -2
- package/dist/apollo-client.client-DE7JUXjy.js +0 -3693
- package/dist/apollo-client.client-DE7JUXjy.js.map +0 -1
- package/dist/apollo-client.client-DlG4HsFm.js +0 -3704
- package/dist/apollo-client.client-DlG4HsFm.js.map +0 -1
- package/dist/apollo-client.server-D1QJea5_.js +0 -16319
- package/dist/apollo-client.server-D1QJea5_.js.map +0 -1
- package/dist/apollo-client.server-uqalq3yp.js +0 -16321
- package/dist/apollo-client.server-uqalq3yp.js.map +0 -1
- package/dist/index-Bd84zcTQ.js +0 -74944
- package/dist/index-Bd84zcTQ.js.map +0 -1
- package/dist/index-CZKOqrJ4.js +0 -75137
- package/dist/index-CZKOqrJ4.js.map +0 -1
- package/dist/index-CsKfs4nG.js +0 -12108
- package/dist/index-CsKfs4nG.js.map +0 -1
- package/dist/index-Cstek604.js.map +0 -1
- package/dist/index-DZZCd-1T.js.map +0 -1
- package/dist/index-aP9ow8_W.js +0 -12271
- package/dist/index-aP9ow8_W.js.map +0 -1
- package/dist/types/config/__tests__/secrets.test.d.ts +0 -1
- package/dist/types/config/secrets.d.ts +0 -186
- package/dist/types/errors/__tests__/errors.test.d.ts +0 -1
- package/dist/types/errors/index.d.ts +0 -77
- package/dist/types/functions/__tests__/aws-lambda.test.d.ts +0 -1
- package/dist/types/functions/__tests__/aws-s3-utils.test.d.ts +0 -1
- package/dist/types/functions/__tests__/json-llm-tools.test.d.ts +0 -1
- package/dist/types/functions/__tests__/json-tools.test.d.ts +0 -1
- package/dist/types/functions/__tests__/slack-utils.test.d.ts +0 -1
- package/dist/types/schemas/aws-schemas.d.ts +0 -210
- package/dist/types/schemas/google-sheets-schemas.d.ts +0 -32
- package/dist/types/schemas/index.d.ts +0 -17
- package/dist/types/schemas/openai-schemas.d.ts +0 -834
- package/dist/types/schemas/perplexity-schemas.d.ts +0 -338
- package/dist/types/schemas/validation-helpers.d.ts +0 -33
- package/dist/types/utils/__tests__/circuit-breaker.test.d.ts +0 -1
- package/dist/types/utils/__tests__/correlation.test.d.ts +0 -1
- package/dist/types/utils/__tests__/input-validator.test.d.ts +0 -1
- package/dist/types/utils/__tests__/llm-cost-tracker.test.d.ts +0 -1
- package/dist/types/utils/__tests__/logger.test.d.ts +0 -1
- package/dist/types/utils/__tests__/metrics.test.d.ts +0 -1
- package/dist/types/utils/__tests__/retry.test.d.ts +0 -1
- package/dist/types/utils/__tests__/sanitizer.test.d.ts +0 -1
- package/dist/types/utils/__tests__/timeouts.test.d.ts +0 -1
- package/dist/types/utils/circuit-breaker.d.ts +0 -99
- package/dist/types/utils/correlation.d.ts +0 -43
- package/dist/types/utils/health-check.d.ts +0 -50
- package/dist/types/utils/input-validator.d.ts +0 -51
- package/dist/types/utils/llm-cost-tracker.d.ts +0 -174
- package/dist/types/utils/logger.d.ts +0 -8
- package/dist/types/utils/metrics.d.ts +0 -61
- package/dist/types/utils/rate-limiter.d.ts +0 -85
- package/dist/types/utils/retry.d.ts +0 -58
- package/dist/types/utils/sanitizer.d.ts +0 -30
- package/dist/types/utils/timeouts.d.ts +0 -44
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Zod schema for all environment variables used across lumic-utils.
|
|
4
|
-
* Required fields will cause a validation error if missing.
|
|
5
|
-
* Optional fields will default to undefined.
|
|
6
|
-
*/
|
|
7
|
-
declare const lumicSecretsSchema: z.ZodObject<{
|
|
8
|
-
openai: z.ZodObject<{
|
|
9
|
-
apiKey: z.ZodOptional<z.ZodString>;
|
|
10
|
-
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
apiKey?: string | undefined;
|
|
12
|
-
}, {
|
|
13
|
-
apiKey?: string | undefined;
|
|
14
|
-
}>;
|
|
15
|
-
deepseek: z.ZodObject<{
|
|
16
|
-
apiKey: z.ZodOptional<z.ZodString>;
|
|
17
|
-
}, "strip", z.ZodTypeAny, {
|
|
18
|
-
apiKey?: string | undefined;
|
|
19
|
-
}, {
|
|
20
|
-
apiKey?: string | undefined;
|
|
21
|
-
}>;
|
|
22
|
-
perplexity: z.ZodObject<{
|
|
23
|
-
apiKey: z.ZodOptional<z.ZodString>;
|
|
24
|
-
}, "strip", z.ZodTypeAny, {
|
|
25
|
-
apiKey?: string | undefined;
|
|
26
|
-
}, {
|
|
27
|
-
apiKey?: string | undefined;
|
|
28
|
-
}>;
|
|
29
|
-
aws: z.ZodObject<{
|
|
30
|
-
region: z.ZodOptional<z.ZodString>;
|
|
31
|
-
accessKeyId: z.ZodOptional<z.ZodString>;
|
|
32
|
-
secretAccessKey: z.ZodOptional<z.ZodString>;
|
|
33
|
-
myRegion: z.ZodOptional<z.ZodString>;
|
|
34
|
-
myAccessKeyId: z.ZodOptional<z.ZodString>;
|
|
35
|
-
mySecretAccessKey: z.ZodOptional<z.ZodString>;
|
|
36
|
-
lambdaFunctionName: z.ZodOptional<z.ZodString>;
|
|
37
|
-
}, "strip", z.ZodTypeAny, {
|
|
38
|
-
region?: string | undefined;
|
|
39
|
-
accessKeyId?: string | undefined;
|
|
40
|
-
secretAccessKey?: string | undefined;
|
|
41
|
-
myRegion?: string | undefined;
|
|
42
|
-
myAccessKeyId?: string | undefined;
|
|
43
|
-
mySecretAccessKey?: string | undefined;
|
|
44
|
-
lambdaFunctionName?: string | undefined;
|
|
45
|
-
}, {
|
|
46
|
-
region?: string | undefined;
|
|
47
|
-
accessKeyId?: string | undefined;
|
|
48
|
-
secretAccessKey?: string | undefined;
|
|
49
|
-
myRegion?: string | undefined;
|
|
50
|
-
myAccessKeyId?: string | undefined;
|
|
51
|
-
mySecretAccessKey?: string | undefined;
|
|
52
|
-
lambdaFunctionName?: string | undefined;
|
|
53
|
-
}>;
|
|
54
|
-
slack: z.ZodObject<{
|
|
55
|
-
botToken: z.ZodOptional<z.ZodString>;
|
|
56
|
-
}, "strip", z.ZodTypeAny, {
|
|
57
|
-
botToken?: string | undefined;
|
|
58
|
-
}, {
|
|
59
|
-
botToken?: string | undefined;
|
|
60
|
-
}>;
|
|
61
|
-
googleSheets: z.ZodObject<{
|
|
62
|
-
clientEmail: z.ZodOptional<z.ZodString>;
|
|
63
|
-
privateKey: z.ZodOptional<z.ZodString>;
|
|
64
|
-
}, "strip", z.ZodTypeAny, {
|
|
65
|
-
clientEmail?: string | undefined;
|
|
66
|
-
privateKey?: string | undefined;
|
|
67
|
-
}, {
|
|
68
|
-
clientEmail?: string | undefined;
|
|
69
|
-
privateKey?: string | undefined;
|
|
70
|
-
}>;
|
|
71
|
-
openweather: z.ZodObject<{
|
|
72
|
-
apiKey: z.ZodOptional<z.ZodString>;
|
|
73
|
-
}, "strip", z.ZodTypeAny, {
|
|
74
|
-
apiKey?: string | undefined;
|
|
75
|
-
}, {
|
|
76
|
-
apiKey?: string | undefined;
|
|
77
|
-
}>;
|
|
78
|
-
config: z.ZodObject<{
|
|
79
|
-
aiModel: z.ZodOptional<z.ZodString>;
|
|
80
|
-
perplexityModel: z.ZodOptional<z.ZodString>;
|
|
81
|
-
lumicDebug: z.ZodDefault<z.ZodBoolean>;
|
|
82
|
-
allowedUploadPaths: z.ZodDefault<z.ZodString>;
|
|
83
|
-
}, "strip", z.ZodTypeAny, {
|
|
84
|
-
lumicDebug: boolean;
|
|
85
|
-
allowedUploadPaths: string;
|
|
86
|
-
aiModel?: string | undefined;
|
|
87
|
-
perplexityModel?: string | undefined;
|
|
88
|
-
}, {
|
|
89
|
-
aiModel?: string | undefined;
|
|
90
|
-
perplexityModel?: string | undefined;
|
|
91
|
-
lumicDebug?: boolean | undefined;
|
|
92
|
-
allowedUploadPaths?: string | undefined;
|
|
93
|
-
}>;
|
|
94
|
-
}, "strip", z.ZodTypeAny, {
|
|
95
|
-
openai: {
|
|
96
|
-
apiKey?: string | undefined;
|
|
97
|
-
};
|
|
98
|
-
deepseek: {
|
|
99
|
-
apiKey?: string | undefined;
|
|
100
|
-
};
|
|
101
|
-
perplexity: {
|
|
102
|
-
apiKey?: string | undefined;
|
|
103
|
-
};
|
|
104
|
-
aws: {
|
|
105
|
-
region?: string | undefined;
|
|
106
|
-
accessKeyId?: string | undefined;
|
|
107
|
-
secretAccessKey?: string | undefined;
|
|
108
|
-
myRegion?: string | undefined;
|
|
109
|
-
myAccessKeyId?: string | undefined;
|
|
110
|
-
mySecretAccessKey?: string | undefined;
|
|
111
|
-
lambdaFunctionName?: string | undefined;
|
|
112
|
-
};
|
|
113
|
-
slack: {
|
|
114
|
-
botToken?: string | undefined;
|
|
115
|
-
};
|
|
116
|
-
googleSheets: {
|
|
117
|
-
clientEmail?: string | undefined;
|
|
118
|
-
privateKey?: string | undefined;
|
|
119
|
-
};
|
|
120
|
-
openweather: {
|
|
121
|
-
apiKey?: string | undefined;
|
|
122
|
-
};
|
|
123
|
-
config: {
|
|
124
|
-
lumicDebug: boolean;
|
|
125
|
-
allowedUploadPaths: string;
|
|
126
|
-
aiModel?: string | undefined;
|
|
127
|
-
perplexityModel?: string | undefined;
|
|
128
|
-
};
|
|
129
|
-
}, {
|
|
130
|
-
openai: {
|
|
131
|
-
apiKey?: string | undefined;
|
|
132
|
-
};
|
|
133
|
-
deepseek: {
|
|
134
|
-
apiKey?: string | undefined;
|
|
135
|
-
};
|
|
136
|
-
perplexity: {
|
|
137
|
-
apiKey?: string | undefined;
|
|
138
|
-
};
|
|
139
|
-
aws: {
|
|
140
|
-
region?: string | undefined;
|
|
141
|
-
accessKeyId?: string | undefined;
|
|
142
|
-
secretAccessKey?: string | undefined;
|
|
143
|
-
myRegion?: string | undefined;
|
|
144
|
-
myAccessKeyId?: string | undefined;
|
|
145
|
-
mySecretAccessKey?: string | undefined;
|
|
146
|
-
lambdaFunctionName?: string | undefined;
|
|
147
|
-
};
|
|
148
|
-
slack: {
|
|
149
|
-
botToken?: string | undefined;
|
|
150
|
-
};
|
|
151
|
-
googleSheets: {
|
|
152
|
-
clientEmail?: string | undefined;
|
|
153
|
-
privateKey?: string | undefined;
|
|
154
|
-
};
|
|
155
|
-
openweather: {
|
|
156
|
-
apiKey?: string | undefined;
|
|
157
|
-
};
|
|
158
|
-
config: {
|
|
159
|
-
aiModel?: string | undefined;
|
|
160
|
-
perplexityModel?: string | undefined;
|
|
161
|
-
lumicDebug?: boolean | undefined;
|
|
162
|
-
allowedUploadPaths?: string | undefined;
|
|
163
|
-
};
|
|
164
|
-
}>;
|
|
165
|
-
/**
|
|
166
|
-
* Type definition inferred from the Zod schema
|
|
167
|
-
*/
|
|
168
|
-
export type LumicSecrets = z.infer<typeof lumicSecretsSchema>;
|
|
169
|
-
/**
|
|
170
|
-
* Returns the validated secrets singleton.
|
|
171
|
-
* Loads from process.env on first call and caches the result.
|
|
172
|
-
* @returns Validated LumicSecrets object
|
|
173
|
-
*/
|
|
174
|
-
export declare function getSecrets(): LumicSecrets;
|
|
175
|
-
/**
|
|
176
|
-
* Resets the cached secrets. Useful for testing or when env vars change.
|
|
177
|
-
*/
|
|
178
|
-
export declare function resetSecrets(): void;
|
|
179
|
-
/**
|
|
180
|
-
* Validates that a specific secret is present. Throws if missing.
|
|
181
|
-
* @param key - Dot-notation path to the secret (e.g., 'openai.apiKey')
|
|
182
|
-
* @param serviceName - Human-readable service name for error messages
|
|
183
|
-
* @returns The secret value
|
|
184
|
-
*/
|
|
185
|
-
export declare function requireSecret(key: string, serviceName: string): string;
|
|
186
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base error class for all Lumic utilities errors
|
|
3
|
-
* Provides standardized error handling across all external service integrations
|
|
4
|
-
*/
|
|
5
|
-
export declare class LumicError extends Error {
|
|
6
|
-
readonly code: string;
|
|
7
|
-
readonly service: string;
|
|
8
|
-
readonly isRetryable: boolean;
|
|
9
|
-
readonly cause?: unknown | undefined;
|
|
10
|
-
name: string;
|
|
11
|
-
constructor(message: string, code: string, service: string, isRetryable?: boolean, cause?: unknown | undefined);
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Error class for Slack API operations
|
|
15
|
-
* Marks errors as retryable by default since Slack issues are often transient
|
|
16
|
-
*/
|
|
17
|
-
export declare class SlackError extends LumicError {
|
|
18
|
-
constructor(message: string, code?: string, cause?: unknown);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Error class for LLM (Language Learning Model) operations
|
|
22
|
-
* Includes model information for better debugging
|
|
23
|
-
* Marks rate limit errors as retryable
|
|
24
|
-
*/
|
|
25
|
-
export declare class LLMError extends LumicError {
|
|
26
|
-
readonly model?: string | undefined;
|
|
27
|
-
constructor(message: string, code?: string, model?: string | undefined, cause?: unknown);
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Error class for AWS Lambda function invocations
|
|
31
|
-
* Marks throttled errors as retryable
|
|
32
|
-
*/
|
|
33
|
-
export declare class AWSLambdaError extends LumicError {
|
|
34
|
-
constructor(message: string, code?: string, cause?: unknown);
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Error class for AWS S3 operations
|
|
38
|
-
* Marks errors as retryable by default since S3 issues are often transient
|
|
39
|
-
*/
|
|
40
|
-
export declare class AWSS3Error extends LumicError {
|
|
41
|
-
constructor(message: string, code?: string, cause?: unknown);
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Error class for Google Sheets API operations
|
|
45
|
-
* Marks quota exceeded errors as retryable
|
|
46
|
-
*/
|
|
47
|
-
export declare class GoogleSheetsError extends LumicError {
|
|
48
|
-
constructor(message: string, code?: string, cause?: unknown);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Error class for Perplexity API operations
|
|
52
|
-
* Marks errors as retryable by default
|
|
53
|
-
*/
|
|
54
|
-
export declare class PerplexityError extends LumicError {
|
|
55
|
-
constructor(message: string, code?: string, cause?: unknown);
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Error class for JSON parsing operations
|
|
59
|
-
* Not retryable since malformed JSON won't fix itself
|
|
60
|
-
*/
|
|
61
|
-
export declare class JsonParseError extends LumicError {
|
|
62
|
-
constructor(message: string, cause?: unknown);
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Error class for PDF operations
|
|
66
|
-
* Not retryable since PDF generation issues are typically configuration or content related
|
|
67
|
-
*/
|
|
68
|
-
export declare class PDFError extends LumicError {
|
|
69
|
-
constructor(message: string, cause?: unknown);
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Error class for Zip file operations
|
|
73
|
-
* Not retryable since file system issues are typically configuration or permission related
|
|
74
|
-
*/
|
|
75
|
-
export declare class ZipError extends LumicError {
|
|
76
|
-
constructor(message: string, cause?: unknown);
|
|
77
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Zod schema for an S3 ListObjectsV2 response.
|
|
4
|
-
* Validates the core fields used by lumic-utils S3 operations.
|
|
5
|
-
*/
|
|
6
|
-
export declare const s3ListObjectsSchema: z.ZodObject<{
|
|
7
|
-
Contents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
8
|
-
Key: z.ZodOptional<z.ZodString>;
|
|
9
|
-
LastModified: z.ZodOptional<z.ZodUnion<[z.ZodDate, z.ZodString]>>;
|
|
10
|
-
ETag: z.ZodOptional<z.ZodString>;
|
|
11
|
-
Size: z.ZodOptional<z.ZodNumber>;
|
|
12
|
-
StorageClass: z.ZodOptional<z.ZodString>;
|
|
13
|
-
}, "strip", z.ZodTypeAny, {
|
|
14
|
-
Key?: string | undefined;
|
|
15
|
-
StorageClass?: string | undefined;
|
|
16
|
-
LastModified?: string | Date | undefined;
|
|
17
|
-
ETag?: string | undefined;
|
|
18
|
-
Size?: number | undefined;
|
|
19
|
-
}, {
|
|
20
|
-
Key?: string | undefined;
|
|
21
|
-
StorageClass?: string | undefined;
|
|
22
|
-
LastModified?: string | Date | undefined;
|
|
23
|
-
ETag?: string | undefined;
|
|
24
|
-
Size?: number | undefined;
|
|
25
|
-
}>, "many">>;
|
|
26
|
-
KeyCount: z.ZodOptional<z.ZodNumber>;
|
|
27
|
-
MaxKeys: z.ZodOptional<z.ZodNumber>;
|
|
28
|
-
Name: z.ZodOptional<z.ZodString>;
|
|
29
|
-
Prefix: z.ZodOptional<z.ZodString>;
|
|
30
|
-
IsTruncated: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
-
NextContinuationToken: z.ZodOptional<z.ZodString>;
|
|
32
|
-
ContinuationToken: z.ZodOptional<z.ZodString>;
|
|
33
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
34
|
-
Contents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
35
|
-
Key: z.ZodOptional<z.ZodString>;
|
|
36
|
-
LastModified: z.ZodOptional<z.ZodUnion<[z.ZodDate, z.ZodString]>>;
|
|
37
|
-
ETag: z.ZodOptional<z.ZodString>;
|
|
38
|
-
Size: z.ZodOptional<z.ZodNumber>;
|
|
39
|
-
StorageClass: z.ZodOptional<z.ZodString>;
|
|
40
|
-
}, "strip", z.ZodTypeAny, {
|
|
41
|
-
Key?: string | undefined;
|
|
42
|
-
StorageClass?: string | undefined;
|
|
43
|
-
LastModified?: string | Date | undefined;
|
|
44
|
-
ETag?: string | undefined;
|
|
45
|
-
Size?: number | undefined;
|
|
46
|
-
}, {
|
|
47
|
-
Key?: string | undefined;
|
|
48
|
-
StorageClass?: string | undefined;
|
|
49
|
-
LastModified?: string | Date | undefined;
|
|
50
|
-
ETag?: string | undefined;
|
|
51
|
-
Size?: number | undefined;
|
|
52
|
-
}>, "many">>;
|
|
53
|
-
KeyCount: z.ZodOptional<z.ZodNumber>;
|
|
54
|
-
MaxKeys: z.ZodOptional<z.ZodNumber>;
|
|
55
|
-
Name: z.ZodOptional<z.ZodString>;
|
|
56
|
-
Prefix: z.ZodOptional<z.ZodString>;
|
|
57
|
-
IsTruncated: z.ZodOptional<z.ZodBoolean>;
|
|
58
|
-
NextContinuationToken: z.ZodOptional<z.ZodString>;
|
|
59
|
-
ContinuationToken: z.ZodOptional<z.ZodString>;
|
|
60
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
61
|
-
Contents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
62
|
-
Key: z.ZodOptional<z.ZodString>;
|
|
63
|
-
LastModified: z.ZodOptional<z.ZodUnion<[z.ZodDate, z.ZodString]>>;
|
|
64
|
-
ETag: z.ZodOptional<z.ZodString>;
|
|
65
|
-
Size: z.ZodOptional<z.ZodNumber>;
|
|
66
|
-
StorageClass: z.ZodOptional<z.ZodString>;
|
|
67
|
-
}, "strip", z.ZodTypeAny, {
|
|
68
|
-
Key?: string | undefined;
|
|
69
|
-
StorageClass?: string | undefined;
|
|
70
|
-
LastModified?: string | Date | undefined;
|
|
71
|
-
ETag?: string | undefined;
|
|
72
|
-
Size?: number | undefined;
|
|
73
|
-
}, {
|
|
74
|
-
Key?: string | undefined;
|
|
75
|
-
StorageClass?: string | undefined;
|
|
76
|
-
LastModified?: string | Date | undefined;
|
|
77
|
-
ETag?: string | undefined;
|
|
78
|
-
Size?: number | undefined;
|
|
79
|
-
}>, "many">>;
|
|
80
|
-
KeyCount: z.ZodOptional<z.ZodNumber>;
|
|
81
|
-
MaxKeys: z.ZodOptional<z.ZodNumber>;
|
|
82
|
-
Name: z.ZodOptional<z.ZodString>;
|
|
83
|
-
Prefix: z.ZodOptional<z.ZodString>;
|
|
84
|
-
IsTruncated: z.ZodOptional<z.ZodBoolean>;
|
|
85
|
-
NextContinuationToken: z.ZodOptional<z.ZodString>;
|
|
86
|
-
ContinuationToken: z.ZodOptional<z.ZodString>;
|
|
87
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
88
|
-
/**
|
|
89
|
-
* Zod schema for an S3 GetObject response body metadata.
|
|
90
|
-
* The actual body is a stream and is not validated here.
|
|
91
|
-
*/
|
|
92
|
-
export declare const s3GetObjectSchema: z.ZodObject<{
|
|
93
|
-
ContentLength: z.ZodOptional<z.ZodNumber>;
|
|
94
|
-
ContentType: z.ZodOptional<z.ZodString>;
|
|
95
|
-
ETag: z.ZodOptional<z.ZodString>;
|
|
96
|
-
LastModified: z.ZodOptional<z.ZodUnion<[z.ZodDate, z.ZodString]>>;
|
|
97
|
-
Body: z.ZodUnknown;
|
|
98
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
99
|
-
ContentLength: z.ZodOptional<z.ZodNumber>;
|
|
100
|
-
ContentType: z.ZodOptional<z.ZodString>;
|
|
101
|
-
ETag: z.ZodOptional<z.ZodString>;
|
|
102
|
-
LastModified: z.ZodOptional<z.ZodUnion<[z.ZodDate, z.ZodString]>>;
|
|
103
|
-
Body: z.ZodUnknown;
|
|
104
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
105
|
-
ContentLength: z.ZodOptional<z.ZodNumber>;
|
|
106
|
-
ContentType: z.ZodOptional<z.ZodString>;
|
|
107
|
-
ETag: z.ZodOptional<z.ZodString>;
|
|
108
|
-
LastModified: z.ZodOptional<z.ZodUnion<[z.ZodDate, z.ZodString]>>;
|
|
109
|
-
Body: z.ZodUnknown;
|
|
110
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
111
|
-
/**
|
|
112
|
-
* Zod schema for an AWS Lambda Invoke response.
|
|
113
|
-
*/
|
|
114
|
-
export declare const lambdaInvokeResponseSchema: z.ZodObject<{
|
|
115
|
-
StatusCode: z.ZodNumber;
|
|
116
|
-
FunctionError: z.ZodOptional<z.ZodString>;
|
|
117
|
-
LogResult: z.ZodOptional<z.ZodString>;
|
|
118
|
-
Payload: z.ZodOptional<z.ZodUnknown>;
|
|
119
|
-
ExecutedVersion: z.ZodOptional<z.ZodString>;
|
|
120
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
121
|
-
StatusCode: z.ZodNumber;
|
|
122
|
-
FunctionError: z.ZodOptional<z.ZodString>;
|
|
123
|
-
LogResult: z.ZodOptional<z.ZodString>;
|
|
124
|
-
Payload: z.ZodOptional<z.ZodUnknown>;
|
|
125
|
-
ExecutedVersion: z.ZodOptional<z.ZodString>;
|
|
126
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
127
|
-
StatusCode: z.ZodNumber;
|
|
128
|
-
FunctionError: z.ZodOptional<z.ZodString>;
|
|
129
|
-
LogResult: z.ZodOptional<z.ZodString>;
|
|
130
|
-
Payload: z.ZodOptional<z.ZodUnknown>;
|
|
131
|
-
ExecutedVersion: z.ZodOptional<z.ZodString>;
|
|
132
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
133
|
-
/** Type inferred from S3 ListObjects schema */
|
|
134
|
-
export type S3ListObjectsResponse = z.infer<typeof s3ListObjectsSchema>;
|
|
135
|
-
/** Type inferred from Lambda Invoke schema */
|
|
136
|
-
export type LambdaInvokeResponse = z.infer<typeof lambdaInvokeResponseSchema>;
|
|
137
|
-
/** Strict validator for S3 ListObjectsV2 responses. Throws on failure. */
|
|
138
|
-
export declare const validateS3ListObjects: (data: unknown) => z.objectInputType<{
|
|
139
|
-
Contents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
140
|
-
Key: z.ZodOptional<z.ZodString>;
|
|
141
|
-
LastModified: z.ZodOptional<z.ZodUnion<[z.ZodDate, z.ZodString]>>;
|
|
142
|
-
ETag: z.ZodOptional<z.ZodString>;
|
|
143
|
-
Size: z.ZodOptional<z.ZodNumber>;
|
|
144
|
-
StorageClass: z.ZodOptional<z.ZodString>;
|
|
145
|
-
}, "strip", z.ZodTypeAny, {
|
|
146
|
-
Key?: string | undefined;
|
|
147
|
-
StorageClass?: string | undefined;
|
|
148
|
-
LastModified?: string | Date | undefined;
|
|
149
|
-
ETag?: string | undefined;
|
|
150
|
-
Size?: number | undefined;
|
|
151
|
-
}, {
|
|
152
|
-
Key?: string | undefined;
|
|
153
|
-
StorageClass?: string | undefined;
|
|
154
|
-
LastModified?: string | Date | undefined;
|
|
155
|
-
ETag?: string | undefined;
|
|
156
|
-
Size?: number | undefined;
|
|
157
|
-
}>, "many">>;
|
|
158
|
-
KeyCount: z.ZodOptional<z.ZodNumber>;
|
|
159
|
-
MaxKeys: z.ZodOptional<z.ZodNumber>;
|
|
160
|
-
Name: z.ZodOptional<z.ZodString>;
|
|
161
|
-
Prefix: z.ZodOptional<z.ZodString>;
|
|
162
|
-
IsTruncated: z.ZodOptional<z.ZodBoolean>;
|
|
163
|
-
NextContinuationToken: z.ZodOptional<z.ZodString>;
|
|
164
|
-
ContinuationToken: z.ZodOptional<z.ZodString>;
|
|
165
|
-
}, z.ZodTypeAny, "passthrough">;
|
|
166
|
-
/** Safe validator for S3 ListObjectsV2 responses. Never throws. */
|
|
167
|
-
export declare const safeValidateS3ListObjects: (data: unknown) => import("./validation-helpers").ValidationResult<z.objectInputType<{
|
|
168
|
-
Contents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
169
|
-
Key: z.ZodOptional<z.ZodString>;
|
|
170
|
-
LastModified: z.ZodOptional<z.ZodUnion<[z.ZodDate, z.ZodString]>>;
|
|
171
|
-
ETag: z.ZodOptional<z.ZodString>;
|
|
172
|
-
Size: z.ZodOptional<z.ZodNumber>;
|
|
173
|
-
StorageClass: z.ZodOptional<z.ZodString>;
|
|
174
|
-
}, "strip", z.ZodTypeAny, {
|
|
175
|
-
Key?: string | undefined;
|
|
176
|
-
StorageClass?: string | undefined;
|
|
177
|
-
LastModified?: string | Date | undefined;
|
|
178
|
-
ETag?: string | undefined;
|
|
179
|
-
Size?: number | undefined;
|
|
180
|
-
}, {
|
|
181
|
-
Key?: string | undefined;
|
|
182
|
-
StorageClass?: string | undefined;
|
|
183
|
-
LastModified?: string | Date | undefined;
|
|
184
|
-
ETag?: string | undefined;
|
|
185
|
-
Size?: number | undefined;
|
|
186
|
-
}>, "many">>;
|
|
187
|
-
KeyCount: z.ZodOptional<z.ZodNumber>;
|
|
188
|
-
MaxKeys: z.ZodOptional<z.ZodNumber>;
|
|
189
|
-
Name: z.ZodOptional<z.ZodString>;
|
|
190
|
-
Prefix: z.ZodOptional<z.ZodString>;
|
|
191
|
-
IsTruncated: z.ZodOptional<z.ZodBoolean>;
|
|
192
|
-
NextContinuationToken: z.ZodOptional<z.ZodString>;
|
|
193
|
-
ContinuationToken: z.ZodOptional<z.ZodString>;
|
|
194
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
195
|
-
/** Strict validator for Lambda Invoke responses. Throws on failure. */
|
|
196
|
-
export declare const validateLambdaResponse: (data: unknown) => z.objectInputType<{
|
|
197
|
-
StatusCode: z.ZodNumber;
|
|
198
|
-
FunctionError: z.ZodOptional<z.ZodString>;
|
|
199
|
-
LogResult: z.ZodOptional<z.ZodString>;
|
|
200
|
-
Payload: z.ZodOptional<z.ZodUnknown>;
|
|
201
|
-
ExecutedVersion: z.ZodOptional<z.ZodString>;
|
|
202
|
-
}, z.ZodTypeAny, "passthrough">;
|
|
203
|
-
/** Safe validator for Lambda Invoke responses. Never throws. */
|
|
204
|
-
export declare const safeValidateLambdaResponse: (data: unknown) => import("./validation-helpers").ValidationResult<z.objectInputType<{
|
|
205
|
-
StatusCode: z.ZodNumber;
|
|
206
|
-
FunctionError: z.ZodOptional<z.ZodString>;
|
|
207
|
-
LogResult: z.ZodOptional<z.ZodString>;
|
|
208
|
-
Payload: z.ZodOptional<z.ZodUnknown>;
|
|
209
|
-
ExecutedVersion: z.ZodOptional<z.ZodString>;
|
|
210
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Zod schema for a Google Sheets ValueRange response.
|
|
4
|
-
* This is the standard response when reading cells from a spreadsheet.
|
|
5
|
-
*/
|
|
6
|
-
export declare const googleSheetsValueRangeSchema: z.ZodObject<{
|
|
7
|
-
range: z.ZodString;
|
|
8
|
-
majorDimension: z.ZodOptional<z.ZodEnum<["ROWS", "COLUMNS"]>>;
|
|
9
|
-
values: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, "many">, "many">>;
|
|
10
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
11
|
-
range: z.ZodString;
|
|
12
|
-
majorDimension: z.ZodOptional<z.ZodEnum<["ROWS", "COLUMNS"]>>;
|
|
13
|
-
values: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, "many">, "many">>;
|
|
14
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
15
|
-
range: z.ZodString;
|
|
16
|
-
majorDimension: z.ZodOptional<z.ZodEnum<["ROWS", "COLUMNS"]>>;
|
|
17
|
-
values: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, "many">, "many">>;
|
|
18
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
19
|
-
/** Type inferred from the ValueRange schema */
|
|
20
|
-
export type GoogleSheetsValueRange = z.infer<typeof googleSheetsValueRangeSchema>;
|
|
21
|
-
/** Strict validator for Google Sheets ValueRange responses. Throws on failure. */
|
|
22
|
-
export declare const validateGoogleSheetsResponse: (data: unknown) => z.objectInputType<{
|
|
23
|
-
range: z.ZodString;
|
|
24
|
-
majorDimension: z.ZodOptional<z.ZodEnum<["ROWS", "COLUMNS"]>>;
|
|
25
|
-
values: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, "many">, "many">>;
|
|
26
|
-
}, z.ZodTypeAny, "passthrough">;
|
|
27
|
-
/** Safe validator for Google Sheets ValueRange responses. Never throws. */
|
|
28
|
-
export declare const safeValidateGoogleSheetsResponse: (data: unknown) => import("./validation-helpers").ValidationResult<z.objectInputType<{
|
|
29
|
-
range: z.ZodString;
|
|
30
|
-
majorDimension: z.ZodOptional<z.ZodEnum<["ROWS", "COLUMNS"]>>;
|
|
31
|
-
values: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, "many">, "many">>;
|
|
32
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* API Response Validation Schemas for lumic-utils external service integrations.
|
|
3
|
-
*
|
|
4
|
-
* These Zod schemas validate responses from external APIs (OpenAI, Perplexity,
|
|
5
|
-
* Google Sheets, AWS) to catch breaking changes early and provide type-safe
|
|
6
|
-
* response handling.
|
|
7
|
-
*
|
|
8
|
-
* Usage:
|
|
9
|
-
* import { validateOpenAIResponse, validatePerplexityResponse } from './schemas';
|
|
10
|
-
* const parsed = validateOpenAIResponse(rawResponse);
|
|
11
|
-
*/
|
|
12
|
-
export { openAIChatCompletionSchema, openAIImageResponseSchema, validateOpenAIChatCompletion, safeValidateOpenAIChatCompletion, } from './openai-schemas';
|
|
13
|
-
export { perplexityResponseSchema, validatePerplexityResponse, safeValidatePerplexityResponse, } from './perplexity-schemas';
|
|
14
|
-
export { googleSheetsValueRangeSchema, validateGoogleSheetsResponse, safeValidateGoogleSheetsResponse, } from './google-sheets-schemas';
|
|
15
|
-
export { s3ListObjectsSchema, s3GetObjectSchema, lambdaInvokeResponseSchema, validateS3ListObjects, safeValidateS3ListObjects, validateLambdaResponse, safeValidateLambdaResponse, } from './aws-schemas';
|
|
16
|
-
export type { ValidationResult } from './validation-helpers';
|
|
17
|
-
export { createValidator, createSafeValidator } from './validation-helpers';
|