@lucaapp/service-utils 5.43.1 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/api/types/utils.d.ts +2 -2
- package/dist/lib/errorReporting/index.d.ts +2 -1
- package/dist/lib/errorReporting/index.js +51 -5
- package/dist/lib/jobs/schemas.d.ts +32 -188
- package/dist/lib/jobs/schemas.js +1 -1
- package/dist/lib/pgBoss/controller/routes.schema.d.ts +21 -159
- package/dist/lib/pgBoss/controller/routes.schema.js +6 -6
- package/dist/lib/serviceIdentity/serviceIdentity.d.ts +5 -15
- package/dist/lib/serviceIdentity/serviceIdentity.js +1 -1
- package/dist/lib/validation.d.ts +348 -311
- package/dist/lib/validation.js +2 -2
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ZodObject, ZodPipe, z } from 'zod';
|
|
2
2
|
export type ArrayToUnion<T> = T[keyof T];
|
|
3
3
|
export type ExtractZodOutput<T> = T extends {
|
|
4
4
|
status: infer Z;
|
|
@@ -7,7 +7,7 @@ export type ExtractZodOutput<T> = T extends {
|
|
|
7
7
|
status: Z;
|
|
8
8
|
body: V;
|
|
9
9
|
} : never;
|
|
10
|
-
export type ZodObjectSchemaOrUndefined = ZodObject<any, any
|
|
10
|
+
export type ZodObjectSchemaOrUndefined = ZodObject<any, any> | ZodPipe<ZodObject<any, any>, any> | undefined;
|
|
11
11
|
export type ZodSchemaOuput<T> = T extends z.ZodSchema<any> ? z.infer<T> : undefined;
|
|
12
12
|
export type ExtractZodOutputFromMiddleware<T> = T extends {
|
|
13
13
|
options: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Sentry from '@sentry/node';
|
|
2
|
-
import type { ErrorRequestHandler } from 'express';
|
|
2
|
+
import type { ErrorRequestHandler, RequestHandler } from 'express';
|
|
3
3
|
export type ErrorReportingOptions = {
|
|
4
4
|
dsn?: string;
|
|
5
5
|
serviceName: string;
|
|
@@ -20,5 +20,6 @@ export declare const isErrorReportingEnabled: () => boolean;
|
|
|
20
20
|
export declare const statusOf: (error: unknown) => number;
|
|
21
21
|
export declare const captureServerError: (error: unknown, context?: ServerErrorContext) => void;
|
|
22
22
|
export declare const errorReportingHandler: ErrorRequestHandler;
|
|
23
|
+
export declare const errorReportingMiddleware: RequestHandler;
|
|
23
24
|
export declare const exitAfterReport: (error: unknown) => void;
|
|
24
25
|
export declare const closeErrorReporting: () => Promise<void>;
|
|
@@ -33,14 +33,29 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.closeErrorReporting = exports.exitAfterReport = exports.errorReportingHandler = exports.captureServerError = exports.statusOf = exports.isErrorReportingEnabled = exports.initErrorReporting = exports.scrubEvent = exports.scrubValue = exports.scrubString = void 0;
|
|
36
|
+
exports.closeErrorReporting = exports.exitAfterReport = exports.errorReportingMiddleware = exports.errorReportingHandler = exports.captureServerError = exports.statusOf = exports.isErrorReportingEnabled = exports.initErrorReporting = exports.scrubEvent = exports.scrubValue = exports.scrubString = void 0;
|
|
37
37
|
const Sentry = __importStar(require("@sentry/node"));
|
|
38
38
|
const boom_1 = require("@hapi/boom");
|
|
39
39
|
const DEFAULT_FLUSH_TIMEOUT_MS = 800;
|
|
40
40
|
const MAX_DEPTH = 8;
|
|
41
|
+
// Bounds regex backtracking in beforeSend.
|
|
42
|
+
const MAX_STRING_LENGTH = 4096;
|
|
41
43
|
const FILTERED = '[Filtered]';
|
|
42
|
-
const SENSITIVE_KEY = /auth|cookie|token|secret|passw|passcode|^pin$|session|e-?mail|phone|iban|card|(^|_)pan($|_|number)|cvc|cvv|shopper|reservation|booking|confirmation|(^|_)name$|surname|(first|last|full|guest|holder)_?name|address|birth
|
|
44
|
+
const SENSITIVE_KEY = /auth|cookie|token|secret|passw|passcode|^pin$|session|e-?mail|phone|iban|card|(^|_)pan($|_|number)|cvc|cvv|shopper|reservation|booking|confirmation|(^|_)name$|surname|(first|last|full|guest|holder|given|family)_?name|address|birth|^dob$|^ip$|passport|signature|tax_?id|vat|api_?key/i;
|
|
43
45
|
const digitCount = (value) => value.replaceAll(/\D/g, '').length;
|
|
46
|
+
const isLuhnValid = (digits) => {
|
|
47
|
+
let sum = 0;
|
|
48
|
+
for (let index = 0; index < digits.length; index += 1) {
|
|
49
|
+
let digit = Number(digits[digits.length - 1 - index]);
|
|
50
|
+
if (index % 2 === 1) {
|
|
51
|
+
digit *= 2;
|
|
52
|
+
if (digit > 9)
|
|
53
|
+
digit -= 9;
|
|
54
|
+
}
|
|
55
|
+
sum += digit;
|
|
56
|
+
}
|
|
57
|
+
return sum % 10 === 0;
|
|
58
|
+
};
|
|
44
59
|
const STRING_PATTERNS = [
|
|
45
60
|
[/eyJ[\w-]+\.[\w-]+\.[\w-]+(?:\.[\w-]+\.[\w-]+)?/g, () => '[jwt]'],
|
|
46
61
|
[
|
|
@@ -55,15 +70,17 @@ const STRING_PATTERNS = [
|
|
|
55
70
|
[
|
|
56
71
|
/\d[\d -]{11,}\d/g,
|
|
57
72
|
match => {
|
|
58
|
-
const digits =
|
|
59
|
-
return digits >= 13 && digits <= 19
|
|
73
|
+
const digits = match.replaceAll(/\D/g, '');
|
|
74
|
+
return digits.length >= 13 && digits.length <= 19 && isLuhnValid(digits)
|
|
75
|
+
? '[number]'
|
|
76
|
+
: match;
|
|
60
77
|
},
|
|
61
78
|
],
|
|
62
79
|
];
|
|
63
80
|
let enabled = false;
|
|
64
81
|
let flushTimeoutMs = DEFAULT_FLUSH_TIMEOUT_MS;
|
|
65
82
|
const scrubString = (value) => {
|
|
66
|
-
let result = value;
|
|
83
|
+
let result = value.slice(0, MAX_STRING_LENGTH);
|
|
67
84
|
for (const [pattern, replacement] of STRING_PATTERNS) {
|
|
68
85
|
result = result.replace(pattern, replacement);
|
|
69
86
|
}
|
|
@@ -137,6 +154,7 @@ const initErrorReporting = (options) => {
|
|
|
137
154
|
release: options.release,
|
|
138
155
|
serverName: options.serviceName,
|
|
139
156
|
sendDefaultPii: false,
|
|
157
|
+
sendClientReports: false,
|
|
140
158
|
skipOpenTelemetrySetup: true,
|
|
141
159
|
defaultIntegrations: false,
|
|
142
160
|
integrations: [
|
|
@@ -193,6 +211,34 @@ const errorReportingHandler = (error, request, _response, next) => {
|
|
|
193
211
|
next(error);
|
|
194
212
|
};
|
|
195
213
|
exports.errorReportingHandler = errorReportingHandler;
|
|
214
|
+
// Mount first: service-utils endpoints answer 5xx themselves and only set
|
|
215
|
+
// response.err, so the decision is made on the status actually sent.
|
|
216
|
+
const errorReportingMiddleware = (request, response, next) => {
|
|
217
|
+
if (enabled) {
|
|
218
|
+
let reported = false;
|
|
219
|
+
const report = () => {
|
|
220
|
+
if (reported || response.statusCode < 500)
|
|
221
|
+
return;
|
|
222
|
+
reported = true;
|
|
223
|
+
try {
|
|
224
|
+
Sentry.captureException(response.err ??
|
|
225
|
+
new Error(`HTTP ${response.statusCode} ${request.method} ${routeOf(request)}`), {
|
|
226
|
+
tags: {
|
|
227
|
+
method: request.method,
|
|
228
|
+
status: String(response.statusCode),
|
|
229
|
+
route: routeOf(request),
|
|
230
|
+
...(request.id !== undefined && { reqId: String(request.id) }),
|
|
231
|
+
},
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
catch { }
|
|
235
|
+
};
|
|
236
|
+
response.once('finish', report);
|
|
237
|
+
response.once('close', report);
|
|
238
|
+
}
|
|
239
|
+
next();
|
|
240
|
+
};
|
|
241
|
+
exports.errorReportingMiddleware = errorReportingMiddleware;
|
|
196
242
|
const exitAfterReport = (error) => {
|
|
197
243
|
if (enabled) {
|
|
198
244
|
try {
|
|
@@ -5,28 +5,18 @@ import { z } from 'zod';
|
|
|
5
5
|
export declare const parametersSchema: z.ZodObject<{
|
|
6
6
|
job: z.ZodString;
|
|
7
7
|
method: z.ZodString;
|
|
8
|
-
},
|
|
9
|
-
job: string;
|
|
10
|
-
method: string;
|
|
11
|
-
}, {
|
|
12
|
-
job: string;
|
|
13
|
-
method: string;
|
|
14
|
-
}>;
|
|
8
|
+
}, z.core.$strip>;
|
|
15
9
|
/**
|
|
16
10
|
* Schema for job ID parameters
|
|
17
11
|
*/
|
|
18
12
|
export declare const jobIdParametersSchema: z.ZodObject<{
|
|
19
13
|
jobId: z.ZodString;
|
|
20
|
-
},
|
|
21
|
-
jobId: string;
|
|
22
|
-
}, {
|
|
23
|
-
jobId: string;
|
|
24
|
-
}>;
|
|
14
|
+
}, z.core.$strip>;
|
|
25
15
|
/**
|
|
26
16
|
* Schema for JSON request/response bodies
|
|
27
17
|
* Allows any object structure to pass through
|
|
28
18
|
*/
|
|
29
|
-
export declare const jsonSchema: z.ZodObject<{},
|
|
19
|
+
export declare const jsonSchema: z.ZodObject<{}, z.core.$loose>;
|
|
30
20
|
export type JsonSchema = z.infer<typeof jsonSchema>;
|
|
31
21
|
/**
|
|
32
22
|
* Schema for running job information
|
|
@@ -35,223 +25,77 @@ export declare const runningJobSchema: z.ZodObject<{
|
|
|
35
25
|
jobId: z.ZodString;
|
|
36
26
|
jobName: z.ZodString;
|
|
37
27
|
method: z.ZodString;
|
|
38
|
-
status: z.ZodEnum<
|
|
28
|
+
status: z.ZodEnum<{
|
|
29
|
+
completed: "completed";
|
|
30
|
+
failed: "failed";
|
|
31
|
+
running: "running";
|
|
32
|
+
}>;
|
|
39
33
|
startedAt: z.ZodString;
|
|
40
34
|
completedAt: z.ZodOptional<z.ZodString>;
|
|
41
35
|
duration: z.ZodOptional<z.ZodNumber>;
|
|
42
36
|
error: z.ZodOptional<z.ZodString>;
|
|
43
|
-
},
|
|
44
|
-
jobId: string;
|
|
45
|
-
jobName: string;
|
|
46
|
-
method: string;
|
|
47
|
-
status: "completed" | "failed" | "running";
|
|
48
|
-
startedAt: string;
|
|
49
|
-
completedAt?: string | undefined;
|
|
50
|
-
duration?: number | undefined;
|
|
51
|
-
error?: string | undefined;
|
|
52
|
-
}, {
|
|
53
|
-
jobId: string;
|
|
54
|
-
jobName: string;
|
|
55
|
-
method: string;
|
|
56
|
-
status: "completed" | "failed" | "running";
|
|
57
|
-
startedAt: string;
|
|
58
|
-
completedAt?: string | undefined;
|
|
59
|
-
duration?: number | undefined;
|
|
60
|
-
error?: string | undefined;
|
|
61
|
-
}>;
|
|
37
|
+
}, z.core.$strip>;
|
|
62
38
|
/**
|
|
63
39
|
* Schema for job completion information
|
|
64
40
|
*/
|
|
65
41
|
export declare const jobCompletionSchema: z.ZodObject<{
|
|
66
42
|
completedAt: z.ZodString;
|
|
67
|
-
status: z.ZodEnum<
|
|
43
|
+
status: z.ZodEnum<{
|
|
44
|
+
completed: "completed";
|
|
45
|
+
failed: "failed";
|
|
46
|
+
}>;
|
|
68
47
|
error: z.ZodOptional<z.ZodString>;
|
|
69
|
-
},
|
|
70
|
-
completedAt: string;
|
|
71
|
-
status: "completed" | "failed";
|
|
72
|
-
error?: string | undefined;
|
|
73
|
-
}, {
|
|
74
|
-
completedAt: string;
|
|
75
|
-
status: "completed" | "failed";
|
|
76
|
-
error?: string | undefined;
|
|
77
|
-
}>;
|
|
48
|
+
}, z.core.$strip>;
|
|
78
49
|
/**
|
|
79
50
|
* Schema for job metadata (path and methods)
|
|
80
51
|
*/
|
|
81
52
|
export declare const jobMetadataSchema: z.ZodObject<{
|
|
82
53
|
path: z.ZodString;
|
|
83
|
-
methods: z.ZodArray<z.ZodString
|
|
54
|
+
methods: z.ZodArray<z.ZodString>;
|
|
84
55
|
lastExecution: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
85
56
|
startedAt: z.ZodString;
|
|
86
57
|
completedAt: z.ZodString;
|
|
87
58
|
duration: z.ZodNumber;
|
|
88
59
|
error: z.ZodNullable<z.ZodString>;
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
completedAt: string;
|
|
92
|
-
duration: number;
|
|
93
|
-
error: string | null;
|
|
94
|
-
}, {
|
|
95
|
-
startedAt: string;
|
|
96
|
-
completedAt: string;
|
|
97
|
-
duration: number;
|
|
98
|
-
error: string | null;
|
|
99
|
-
}>>>;
|
|
100
|
-
}, "strip", z.ZodTypeAny, {
|
|
101
|
-
path: string;
|
|
102
|
-
methods: string[];
|
|
103
|
-
lastExecution?: {
|
|
104
|
-
startedAt: string;
|
|
105
|
-
completedAt: string;
|
|
106
|
-
duration: number;
|
|
107
|
-
error: string | null;
|
|
108
|
-
} | null | undefined;
|
|
109
|
-
}, {
|
|
110
|
-
path: string;
|
|
111
|
-
methods: string[];
|
|
112
|
-
lastExecution?: {
|
|
113
|
-
startedAt: string;
|
|
114
|
-
completedAt: string;
|
|
115
|
-
duration: number;
|
|
116
|
-
error: string | null;
|
|
117
|
-
} | null | undefined;
|
|
118
|
-
}>;
|
|
60
|
+
}, z.core.$strip>>>;
|
|
61
|
+
}, z.core.$strip>;
|
|
119
62
|
/**
|
|
120
63
|
* Schema for the complete jobs response
|
|
121
64
|
*/
|
|
122
65
|
export declare const jobsSchema: z.ZodObject<{
|
|
123
66
|
jobs: z.ZodArray<z.ZodObject<{
|
|
124
67
|
path: z.ZodString;
|
|
125
|
-
methods: z.ZodArray<z.ZodString
|
|
68
|
+
methods: z.ZodArray<z.ZodString>;
|
|
126
69
|
lastExecution: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
127
70
|
startedAt: z.ZodString;
|
|
128
71
|
completedAt: z.ZodString;
|
|
129
72
|
duration: z.ZodNumber;
|
|
130
73
|
error: z.ZodNullable<z.ZodString>;
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
completedAt: string;
|
|
134
|
-
duration: number;
|
|
135
|
-
error: string | null;
|
|
136
|
-
}, {
|
|
137
|
-
startedAt: string;
|
|
138
|
-
completedAt: string;
|
|
139
|
-
duration: number;
|
|
140
|
-
error: string | null;
|
|
141
|
-
}>>>;
|
|
142
|
-
}, "strip", z.ZodTypeAny, {
|
|
143
|
-
path: string;
|
|
144
|
-
methods: string[];
|
|
145
|
-
lastExecution?: {
|
|
146
|
-
startedAt: string;
|
|
147
|
-
completedAt: string;
|
|
148
|
-
duration: number;
|
|
149
|
-
error: string | null;
|
|
150
|
-
} | null | undefined;
|
|
151
|
-
}, {
|
|
152
|
-
path: string;
|
|
153
|
-
methods: string[];
|
|
154
|
-
lastExecution?: {
|
|
155
|
-
startedAt: string;
|
|
156
|
-
completedAt: string;
|
|
157
|
-
duration: number;
|
|
158
|
-
error: string | null;
|
|
159
|
-
} | null | undefined;
|
|
160
|
-
}>, "many">;
|
|
74
|
+
}, z.core.$strip>>>;
|
|
75
|
+
}, z.core.$strip>>;
|
|
161
76
|
runningJobs: z.ZodArray<z.ZodObject<{
|
|
162
77
|
jobId: z.ZodString;
|
|
163
78
|
jobName: z.ZodString;
|
|
164
79
|
method: z.ZodString;
|
|
165
|
-
status: z.ZodEnum<
|
|
80
|
+
status: z.ZodEnum<{
|
|
81
|
+
completed: "completed";
|
|
82
|
+
failed: "failed";
|
|
83
|
+
running: "running";
|
|
84
|
+
}>;
|
|
166
85
|
startedAt: z.ZodString;
|
|
167
86
|
completedAt: z.ZodOptional<z.ZodString>;
|
|
168
87
|
duration: z.ZodOptional<z.ZodNumber>;
|
|
169
88
|
error: z.ZodOptional<z.ZodString>;
|
|
170
|
-
},
|
|
171
|
-
jobId: string;
|
|
172
|
-
jobName: string;
|
|
173
|
-
method: string;
|
|
174
|
-
status: "completed" | "failed" | "running";
|
|
175
|
-
startedAt: string;
|
|
176
|
-
completedAt?: string | undefined;
|
|
177
|
-
duration?: number | undefined;
|
|
178
|
-
error?: string | undefined;
|
|
179
|
-
}, {
|
|
180
|
-
jobId: string;
|
|
181
|
-
jobName: string;
|
|
182
|
-
method: string;
|
|
183
|
-
status: "completed" | "failed" | "running";
|
|
184
|
-
startedAt: string;
|
|
185
|
-
completedAt?: string | undefined;
|
|
186
|
-
duration?: number | undefined;
|
|
187
|
-
error?: string | undefined;
|
|
188
|
-
}>, "many">;
|
|
89
|
+
}, z.core.$strip>>;
|
|
189
90
|
jobCompletions: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
190
91
|
completedAt: z.ZodString;
|
|
191
|
-
status: z.ZodEnum<
|
|
92
|
+
status: z.ZodEnum<{
|
|
93
|
+
completed: "completed";
|
|
94
|
+
failed: "failed";
|
|
95
|
+
}>;
|
|
192
96
|
error: z.ZodOptional<z.ZodString>;
|
|
193
|
-
},
|
|
194
|
-
|
|
195
|
-
status: "completed" | "failed";
|
|
196
|
-
error?: string | undefined;
|
|
197
|
-
}, {
|
|
198
|
-
completedAt: string;
|
|
199
|
-
status: "completed" | "failed";
|
|
200
|
-
error?: string | undefined;
|
|
201
|
-
}>>;
|
|
202
|
-
}, "strip", z.ZodTypeAny, {
|
|
203
|
-
jobs: {
|
|
204
|
-
path: string;
|
|
205
|
-
methods: string[];
|
|
206
|
-
lastExecution?: {
|
|
207
|
-
startedAt: string;
|
|
208
|
-
completedAt: string;
|
|
209
|
-
duration: number;
|
|
210
|
-
error: string | null;
|
|
211
|
-
} | null | undefined;
|
|
212
|
-
}[];
|
|
213
|
-
runningJobs: {
|
|
214
|
-
jobId: string;
|
|
215
|
-
jobName: string;
|
|
216
|
-
method: string;
|
|
217
|
-
status: "completed" | "failed" | "running";
|
|
218
|
-
startedAt: string;
|
|
219
|
-
completedAt?: string | undefined;
|
|
220
|
-
duration?: number | undefined;
|
|
221
|
-
error?: string | undefined;
|
|
222
|
-
}[];
|
|
223
|
-
jobCompletions: Record<string, {
|
|
224
|
-
completedAt: string;
|
|
225
|
-
status: "completed" | "failed";
|
|
226
|
-
error?: string | undefined;
|
|
227
|
-
}>;
|
|
228
|
-
}, {
|
|
229
|
-
jobs: {
|
|
230
|
-
path: string;
|
|
231
|
-
methods: string[];
|
|
232
|
-
lastExecution?: {
|
|
233
|
-
startedAt: string;
|
|
234
|
-
completedAt: string;
|
|
235
|
-
duration: number;
|
|
236
|
-
error: string | null;
|
|
237
|
-
} | null | undefined;
|
|
238
|
-
}[];
|
|
239
|
-
runningJobs: {
|
|
240
|
-
jobId: string;
|
|
241
|
-
jobName: string;
|
|
242
|
-
method: string;
|
|
243
|
-
status: "completed" | "failed" | "running";
|
|
244
|
-
startedAt: string;
|
|
245
|
-
completedAt?: string | undefined;
|
|
246
|
-
duration?: number | undefined;
|
|
247
|
-
error?: string | undefined;
|
|
248
|
-
}[];
|
|
249
|
-
jobCompletions: Record<string, {
|
|
250
|
-
completedAt: string;
|
|
251
|
-
status: "completed" | "failed";
|
|
252
|
-
error?: string | undefined;
|
|
253
|
-
}>;
|
|
254
|
-
}>;
|
|
97
|
+
}, z.core.$strip>>;
|
|
98
|
+
}, z.core.$strip>;
|
|
255
99
|
export type JobsSchema = z.infer<typeof jobsSchema>;
|
|
256
100
|
export type RunningJobSchema = z.infer<typeof runningJobSchema>;
|
|
257
101
|
export type JobCompletionSchema = z.infer<typeof jobCompletionSchema>;
|
package/dist/lib/jobs/schemas.js
CHANGED
|
@@ -63,5 +63,5 @@ exports.jobMetadataSchema = zod_1.z.object({
|
|
|
63
63
|
exports.jobsSchema = zod_1.z.object({
|
|
64
64
|
jobs: zod_1.z.array(exports.jobMetadataSchema),
|
|
65
65
|
runningJobs: zod_1.z.array(exports.runningJobSchema),
|
|
66
|
-
jobCompletions: zod_1.z.record(exports.jobCompletionSchema),
|
|
66
|
+
jobCompletions: zod_1.z.record(zod_1.z.string(), exports.jobCompletionSchema),
|
|
67
67
|
});
|
|
@@ -1,129 +1,45 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const queueNameParamsSchema: z.ZodObject<{
|
|
3
3
|
name: z.ZodString;
|
|
4
|
-
},
|
|
5
|
-
name: string;
|
|
6
|
-
}, {
|
|
7
|
-
name: string;
|
|
8
|
-
}>;
|
|
4
|
+
}, z.core.$strip>;
|
|
9
5
|
export declare const queueJobParamsSchema: z.ZodObject<{
|
|
10
6
|
queue: z.ZodString;
|
|
11
7
|
id: z.ZodString;
|
|
12
|
-
},
|
|
13
|
-
queue: string;
|
|
14
|
-
id: string;
|
|
15
|
-
}, {
|
|
16
|
-
queue: string;
|
|
17
|
-
id: string;
|
|
18
|
-
}>;
|
|
8
|
+
}, z.core.$strip>;
|
|
19
9
|
export declare const scheduleNameParamsSchema: z.ZodObject<{
|
|
20
10
|
name: z.ZodString;
|
|
21
|
-
},
|
|
22
|
-
name: string;
|
|
23
|
-
}, {
|
|
24
|
-
name: string;
|
|
25
|
-
}>;
|
|
11
|
+
}, z.core.$strip>;
|
|
26
12
|
export declare const warningsQuerySchema: z.ZodObject<{
|
|
27
|
-
limit: z.ZodDefault<z.ZodOptional<z.
|
|
28
|
-
},
|
|
29
|
-
limit: number;
|
|
30
|
-
}, {
|
|
31
|
-
limit?: number | undefined;
|
|
32
|
-
}>;
|
|
13
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
14
|
+
}, z.core.$strip>;
|
|
33
15
|
export declare const listJobsQuerySchema: z.ZodObject<{
|
|
34
|
-
limit: z.ZodDefault<z.ZodOptional<z.
|
|
35
|
-
offset: z.ZodDefault<z.ZodOptional<z.
|
|
36
|
-
},
|
|
37
|
-
limit: number;
|
|
38
|
-
offset: number;
|
|
39
|
-
}, {
|
|
40
|
-
limit?: number | undefined;
|
|
41
|
-
offset?: number | undefined;
|
|
42
|
-
}>;
|
|
16
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
17
|
+
offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
18
|
+
}, z.core.$strip>;
|
|
43
19
|
export declare const enqueueBodySchema: z.ZodObject<{
|
|
44
20
|
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
45
21
|
options: z.ZodOptional<z.ZodObject<{
|
|
46
22
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
47
|
-
startAfter: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodDate]>>;
|
|
23
|
+
startAfter: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodDate]>>;
|
|
48
24
|
singletonKey: z.ZodOptional<z.ZodString>;
|
|
49
25
|
singletonSeconds: z.ZodOptional<z.ZodNumber>;
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
startAfter?: string | number | Date | undefined;
|
|
53
|
-
singletonKey?: string | undefined;
|
|
54
|
-
singletonSeconds?: number | undefined;
|
|
55
|
-
}, {
|
|
56
|
-
priority?: number | undefined;
|
|
57
|
-
startAfter?: string | number | Date | undefined;
|
|
58
|
-
singletonKey?: string | undefined;
|
|
59
|
-
singletonSeconds?: number | undefined;
|
|
60
|
-
}>>;
|
|
61
|
-
}, "strip", z.ZodTypeAny, {
|
|
62
|
-
data?: Record<string, unknown> | undefined;
|
|
63
|
-
options?: {
|
|
64
|
-
priority?: number | undefined;
|
|
65
|
-
startAfter?: string | number | Date | undefined;
|
|
66
|
-
singletonKey?: string | undefined;
|
|
67
|
-
singletonSeconds?: number | undefined;
|
|
68
|
-
} | undefined;
|
|
69
|
-
}, {
|
|
70
|
-
data?: Record<string, unknown> | undefined;
|
|
71
|
-
options?: {
|
|
72
|
-
priority?: number | undefined;
|
|
73
|
-
startAfter?: string | number | Date | undefined;
|
|
74
|
-
singletonKey?: string | undefined;
|
|
75
|
-
singletonSeconds?: number | undefined;
|
|
76
|
-
} | undefined;
|
|
77
|
-
}>;
|
|
26
|
+
}, z.core.$strict>>;
|
|
27
|
+
}, z.core.$strip>;
|
|
78
28
|
export declare const scheduleBodySchema: z.ZodObject<{
|
|
79
29
|
name: z.ZodString;
|
|
80
30
|
cron: z.ZodString;
|
|
81
31
|
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
82
32
|
options: z.ZodOptional<z.ZodObject<{
|
|
83
33
|
tz: z.ZodOptional<z.ZodString>;
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
}, {
|
|
87
|
-
tz?: string | undefined;
|
|
88
|
-
}>>;
|
|
89
|
-
}, "strip", z.ZodTypeAny, {
|
|
90
|
-
name: string;
|
|
91
|
-
cron: string;
|
|
92
|
-
data?: Record<string, unknown> | undefined;
|
|
93
|
-
options?: {
|
|
94
|
-
tz?: string | undefined;
|
|
95
|
-
} | undefined;
|
|
96
|
-
}, {
|
|
97
|
-
name: string;
|
|
98
|
-
cron: string;
|
|
99
|
-
data?: Record<string, unknown> | undefined;
|
|
100
|
-
options?: {
|
|
101
|
-
tz?: string | undefined;
|
|
102
|
-
} | undefined;
|
|
103
|
-
}>;
|
|
34
|
+
}, z.core.$strict>>;
|
|
35
|
+
}, z.core.$strip>;
|
|
104
36
|
export declare const updateScheduleBodySchema: z.ZodObject<{
|
|
105
37
|
cron: z.ZodString;
|
|
106
38
|
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
107
39
|
options: z.ZodOptional<z.ZodObject<{
|
|
108
40
|
tz: z.ZodOptional<z.ZodString>;
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
}, {
|
|
112
|
-
tz?: string | undefined;
|
|
113
|
-
}>>;
|
|
114
|
-
}, "strip", z.ZodTypeAny, {
|
|
115
|
-
cron: string;
|
|
116
|
-
data?: Record<string, unknown> | undefined;
|
|
117
|
-
options?: {
|
|
118
|
-
tz?: string | undefined;
|
|
119
|
-
} | undefined;
|
|
120
|
-
}, {
|
|
121
|
-
cron: string;
|
|
122
|
-
data?: Record<string, unknown> | undefined;
|
|
123
|
-
options?: {
|
|
124
|
-
tz?: string | undefined;
|
|
125
|
-
} | undefined;
|
|
126
|
-
}>;
|
|
41
|
+
}, z.core.$strict>>;
|
|
42
|
+
}, z.core.$strip>;
|
|
127
43
|
export declare const queueStatsSchema: z.ZodObject<{
|
|
128
44
|
name: z.ZodString;
|
|
129
45
|
policy: z.ZodOptional<z.ZodString>;
|
|
@@ -135,29 +51,7 @@ export declare const queueStatsSchema: z.ZodObject<{
|
|
|
135
51
|
queuedCount: z.ZodNumber;
|
|
136
52
|
activeCount: z.ZodNumber;
|
|
137
53
|
totalCount: z.ZodNumber;
|
|
138
|
-
},
|
|
139
|
-
name: string;
|
|
140
|
-
policy?: string | undefined;
|
|
141
|
-
retryLimit?: number | undefined;
|
|
142
|
-
retryDelay?: number | undefined;
|
|
143
|
-
retryBackoff?: boolean | undefined;
|
|
144
|
-
expireInSeconds?: number | undefined;
|
|
145
|
-
deadLetter?: string | null | undefined;
|
|
146
|
-
queuedCount: number;
|
|
147
|
-
activeCount: number;
|
|
148
|
-
totalCount: number;
|
|
149
|
-
}, {
|
|
150
|
-
name: string;
|
|
151
|
-
policy?: string | undefined;
|
|
152
|
-
retryLimit?: number | undefined;
|
|
153
|
-
retryDelay?: number | undefined;
|
|
154
|
-
retryBackoff?: boolean | undefined;
|
|
155
|
-
expireInSeconds?: number | undefined;
|
|
156
|
-
deadLetter?: string | null | undefined;
|
|
157
|
-
queuedCount: number;
|
|
158
|
-
activeCount: number;
|
|
159
|
-
totalCount: number;
|
|
160
|
-
}>;
|
|
54
|
+
}, z.core.$strip>;
|
|
161
55
|
export declare const queueStatsArraySchema: z.ZodArray<z.ZodObject<{
|
|
162
56
|
name: z.ZodString;
|
|
163
57
|
policy: z.ZodOptional<z.ZodString>;
|
|
@@ -169,48 +63,16 @@ export declare const queueStatsArraySchema: z.ZodArray<z.ZodObject<{
|
|
|
169
63
|
queuedCount: z.ZodNumber;
|
|
170
64
|
activeCount: z.ZodNumber;
|
|
171
65
|
totalCount: z.ZodNumber;
|
|
172
|
-
},
|
|
173
|
-
name: string;
|
|
174
|
-
policy?: string | undefined;
|
|
175
|
-
retryLimit?: number | undefined;
|
|
176
|
-
retryDelay?: number | undefined;
|
|
177
|
-
retryBackoff?: boolean | undefined;
|
|
178
|
-
expireInSeconds?: number | undefined;
|
|
179
|
-
deadLetter?: string | null | undefined;
|
|
180
|
-
queuedCount: number;
|
|
181
|
-
activeCount: number;
|
|
182
|
-
totalCount: number;
|
|
183
|
-
}, {
|
|
184
|
-
name: string;
|
|
185
|
-
policy?: string | undefined;
|
|
186
|
-
retryLimit?: number | undefined;
|
|
187
|
-
retryDelay?: number | undefined;
|
|
188
|
-
retryBackoff?: boolean | undefined;
|
|
189
|
-
expireInSeconds?: number | undefined;
|
|
190
|
-
deadLetter?: string | null | undefined;
|
|
191
|
-
queuedCount: number;
|
|
192
|
-
activeCount: number;
|
|
193
|
-
totalCount: number;
|
|
194
|
-
}>, "many">;
|
|
66
|
+
}, z.core.$strip>>;
|
|
195
67
|
export declare const jobDetailSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
196
|
-
export declare const jobArraySchema: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown
|
|
68
|
+
export declare const jobArraySchema: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
197
69
|
export declare const scheduleSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
198
|
-
export declare const scheduleArraySchema: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown
|
|
70
|
+
export declare const scheduleArraySchema: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
199
71
|
export declare const warningSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
200
|
-
export declare const warningArraySchema: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown
|
|
72
|
+
export declare const warningArraySchema: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
201
73
|
export declare const successResponseSchema: z.ZodObject<{
|
|
202
74
|
success: z.ZodBoolean;
|
|
203
75
|
jobId: z.ZodOptional<z.ZodString>;
|
|
204
76
|
deleted: z.ZodOptional<z.ZodString>;
|
|
205
77
|
name: z.ZodOptional<z.ZodString>;
|
|
206
|
-
},
|
|
207
|
-
success: boolean;
|
|
208
|
-
jobId?: string | undefined;
|
|
209
|
-
deleted?: string | undefined;
|
|
210
|
-
name?: string | undefined;
|
|
211
|
-
}, {
|
|
212
|
-
success: boolean;
|
|
213
|
-
jobId?: string | undefined;
|
|
214
|
-
deleted?: string | undefined;
|
|
215
|
-
name?: string | undefined;
|
|
216
|
-
}>;
|
|
78
|
+
}, z.core.$strip>;
|
|
@@ -42,18 +42,18 @@ const scheduleOptionsSchema = zod_1.z
|
|
|
42
42
|
})
|
|
43
43
|
.strict();
|
|
44
44
|
exports.enqueueBodySchema = zod_1.z.object({
|
|
45
|
-
data: zod_1.z.record(zod_1.z.unknown()).optional(),
|
|
45
|
+
data: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
|
|
46
46
|
options: enqueueOptionsSchema.optional(),
|
|
47
47
|
});
|
|
48
48
|
exports.scheduleBodySchema = zod_1.z.object({
|
|
49
49
|
name: zod_1.z.string(),
|
|
50
50
|
cron: zod_1.z.string(),
|
|
51
|
-
data: zod_1.z.record(zod_1.z.unknown()).optional(),
|
|
51
|
+
data: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
|
|
52
52
|
options: scheduleOptionsSchema.optional(),
|
|
53
53
|
});
|
|
54
54
|
exports.updateScheduleBodySchema = zod_1.z.object({
|
|
55
55
|
cron: zod_1.z.string(),
|
|
56
|
-
data: zod_1.z.record(zod_1.z.unknown()).optional(),
|
|
56
|
+
data: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
|
|
57
57
|
options: scheduleOptionsSchema.optional(),
|
|
58
58
|
});
|
|
59
59
|
// ── Response schemas ─────────────────────────────────────────────────
|
|
@@ -70,11 +70,11 @@ exports.queueStatsSchema = zod_1.z.object({
|
|
|
70
70
|
totalCount: zod_1.z.number(),
|
|
71
71
|
});
|
|
72
72
|
exports.queueStatsArraySchema = zod_1.z.array(exports.queueStatsSchema);
|
|
73
|
-
exports.jobDetailSchema = zod_1.z.record(zod_1.z.unknown());
|
|
73
|
+
exports.jobDetailSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.unknown());
|
|
74
74
|
exports.jobArraySchema = zod_1.z.array(exports.jobDetailSchema);
|
|
75
|
-
exports.scheduleSchema = zod_1.z.record(zod_1.z.unknown());
|
|
75
|
+
exports.scheduleSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.unknown());
|
|
76
76
|
exports.scheduleArraySchema = zod_1.z.array(exports.scheduleSchema);
|
|
77
|
-
exports.warningSchema = zod_1.z.record(zod_1.z.unknown());
|
|
77
|
+
exports.warningSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.unknown());
|
|
78
78
|
exports.warningArraySchema = zod_1.z.array(exports.warningSchema);
|
|
79
79
|
exports.successResponseSchema = zod_1.z.object({
|
|
80
80
|
success: zod_1.z.boolean(),
|