@lucaapp/service-utils 5.22.0 → 5.23.1
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/http/axios.d.ts +2 -2
- package/dist/lib/iso3166/iso3166Mapping.d.ts +1 -1
- package/dist/lib/jobs/jobTracker.d.ts +1 -1
- package/dist/lib/jobs/schemas.d.ts +36 -36
- package/dist/lib/kafka/metrics.d.ts +4 -4
- package/dist/lib/pgBoss/controller/routes.schema.d.ts +26 -26
- package/dist/lib/pgBoss/service/manageJob.d.ts +1 -1
- package/dist/lib/serviceIdentity/serviceIdentity.d.ts +2 -2
- package/dist/lib/sessionRevocation/sessionRevocation.d.ts +2 -1
- package/dist/lib/sessionRevocation/sessionRevocation.js +23 -1
- package/dist/lib/sessionRevocation/types.d.ts +7 -0
- package/dist/lib/validation.d.ts +246 -246
- package/dist/utils/normalizePath.d.ts +1 -1
- package/package.json +11 -9
package/dist/lib/http/axios.d.ts
CHANGED
|
@@ -30,8 +30,8 @@ export declare const handleAxiosError: (axiosError: AxiosError, logger: AxiosLog
|
|
|
30
30
|
* @returns Object containing request and response interceptors
|
|
31
31
|
*/
|
|
32
32
|
export declare const createLoggingInterceptors: (name: string, logger: AxiosLogger) => {
|
|
33
|
-
request: Parameters<AxiosInterceptorManager<InternalAxiosRequestConfig>[
|
|
34
|
-
response: Parameters<AxiosInterceptorManager<AxiosResponse>[
|
|
33
|
+
request: Parameters<AxiosInterceptorManager<InternalAxiosRequestConfig>['use']>;
|
|
34
|
+
response: Parameters<AxiosInterceptorManager<AxiosResponse>['use']>;
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
37
37
|
* Create a configured axios client with optional logging
|
|
@@ -198,7 +198,7 @@ export type LanguageCode = keyof typeof ENGLISH_LANGUAGE_NAMES;
|
|
|
198
198
|
* getLanguageName('fr') // returns 'French'
|
|
199
199
|
* ```
|
|
200
200
|
*/
|
|
201
|
-
export declare const getLanguageName: (lang: LanguageCode) =>
|
|
201
|
+
export declare const getLanguageName: (lang: LanguageCode) => typeof ENGLISH_LANGUAGE_NAMES[LanguageCode];
|
|
202
202
|
/**
|
|
203
203
|
* Comprehensive mapping of language codes to their native names
|
|
204
204
|
* Includes currently supported languages and potential future additions
|
|
@@ -23,7 +23,7 @@ export declare const createJobTracker: (logger: Logger, redis: RedisClient) => {
|
|
|
23
23
|
getAllRunningJobs: () => Promise<JobStatus[]>;
|
|
24
24
|
getLatestCompletions: () => Promise<Record<string, {
|
|
25
25
|
completedAt: string;
|
|
26
|
-
status:
|
|
26
|
+
status: 'completed' | 'failed';
|
|
27
27
|
error?: string;
|
|
28
28
|
}>>;
|
|
29
29
|
};
|
|
@@ -6,11 +6,11 @@ export declare const parametersSchema: z.ZodObject<{
|
|
|
6
6
|
job: z.ZodString;
|
|
7
7
|
method: z.ZodString;
|
|
8
8
|
}, "strip", z.ZodTypeAny, {
|
|
9
|
-
method: string;
|
|
10
9
|
job: string;
|
|
11
|
-
}, {
|
|
12
10
|
method: string;
|
|
11
|
+
}, {
|
|
13
12
|
job: string;
|
|
13
|
+
method: string;
|
|
14
14
|
}>;
|
|
15
15
|
/**
|
|
16
16
|
* Schema for job ID parameters
|
|
@@ -41,23 +41,23 @@ export declare const runningJobSchema: z.ZodObject<{
|
|
|
41
41
|
duration: z.ZodOptional<z.ZodNumber>;
|
|
42
42
|
error: z.ZodOptional<z.ZodString>;
|
|
43
43
|
}, "strip", z.ZodTypeAny, {
|
|
44
|
-
status: "running" | "completed" | "failed";
|
|
45
|
-
method: string;
|
|
46
44
|
jobId: string;
|
|
47
45
|
jobName: string;
|
|
46
|
+
method: string;
|
|
47
|
+
status: "completed" | "failed" | "running";
|
|
48
48
|
startedAt: string;
|
|
49
|
-
error?: string | undefined;
|
|
50
49
|
completedAt?: string | undefined;
|
|
51
50
|
duration?: number | undefined;
|
|
51
|
+
error?: string | undefined;
|
|
52
52
|
}, {
|
|
53
|
-
status: "running" | "completed" | "failed";
|
|
54
|
-
method: string;
|
|
55
53
|
jobId: string;
|
|
56
54
|
jobName: string;
|
|
55
|
+
method: string;
|
|
56
|
+
status: "completed" | "failed" | "running";
|
|
57
57
|
startedAt: string;
|
|
58
|
-
error?: string | undefined;
|
|
59
58
|
completedAt?: string | undefined;
|
|
60
59
|
duration?: number | undefined;
|
|
60
|
+
error?: string | undefined;
|
|
61
61
|
}>;
|
|
62
62
|
/**
|
|
63
63
|
* Schema for job completion information
|
|
@@ -67,12 +67,12 @@ export declare const jobCompletionSchema: z.ZodObject<{
|
|
|
67
67
|
status: z.ZodEnum<["completed", "failed"]>;
|
|
68
68
|
error: z.ZodOptional<z.ZodString>;
|
|
69
69
|
}, "strip", z.ZodTypeAny, {
|
|
70
|
-
status: "completed" | "failed";
|
|
71
70
|
completedAt: string;
|
|
71
|
+
status: "completed" | "failed";
|
|
72
72
|
error?: string | undefined;
|
|
73
73
|
}, {
|
|
74
|
-
status: "completed" | "failed";
|
|
75
74
|
completedAt: string;
|
|
75
|
+
status: "completed" | "failed";
|
|
76
76
|
error?: string | undefined;
|
|
77
77
|
}>;
|
|
78
78
|
/**
|
|
@@ -87,33 +87,33 @@ export declare const jobMetadataSchema: z.ZodObject<{
|
|
|
87
87
|
duration: z.ZodNumber;
|
|
88
88
|
error: z.ZodNullable<z.ZodString>;
|
|
89
89
|
}, "strip", z.ZodTypeAny, {
|
|
90
|
-
error: string | null;
|
|
91
90
|
startedAt: string;
|
|
92
91
|
completedAt: string;
|
|
93
92
|
duration: number;
|
|
94
|
-
}, {
|
|
95
93
|
error: string | null;
|
|
94
|
+
}, {
|
|
96
95
|
startedAt: string;
|
|
97
96
|
completedAt: string;
|
|
98
97
|
duration: number;
|
|
98
|
+
error: string | null;
|
|
99
99
|
}>>>;
|
|
100
100
|
}, "strip", z.ZodTypeAny, {
|
|
101
101
|
path: string;
|
|
102
102
|
methods: string[];
|
|
103
103
|
lastExecution?: {
|
|
104
|
-
error: string | null;
|
|
105
104
|
startedAt: string;
|
|
106
105
|
completedAt: string;
|
|
107
106
|
duration: number;
|
|
107
|
+
error: string | null;
|
|
108
108
|
} | null | undefined;
|
|
109
109
|
}, {
|
|
110
110
|
path: string;
|
|
111
111
|
methods: string[];
|
|
112
112
|
lastExecution?: {
|
|
113
|
-
error: string | null;
|
|
114
113
|
startedAt: string;
|
|
115
114
|
completedAt: string;
|
|
116
115
|
duration: number;
|
|
116
|
+
error: string | null;
|
|
117
117
|
} | null | undefined;
|
|
118
118
|
}>;
|
|
119
119
|
/**
|
|
@@ -129,33 +129,33 @@ export declare const jobsSchema: z.ZodObject<{
|
|
|
129
129
|
duration: z.ZodNumber;
|
|
130
130
|
error: z.ZodNullable<z.ZodString>;
|
|
131
131
|
}, "strip", z.ZodTypeAny, {
|
|
132
|
-
error: string | null;
|
|
133
132
|
startedAt: string;
|
|
134
133
|
completedAt: string;
|
|
135
134
|
duration: number;
|
|
136
|
-
}, {
|
|
137
135
|
error: string | null;
|
|
136
|
+
}, {
|
|
138
137
|
startedAt: string;
|
|
139
138
|
completedAt: string;
|
|
140
139
|
duration: number;
|
|
140
|
+
error: string | null;
|
|
141
141
|
}>>>;
|
|
142
142
|
}, "strip", z.ZodTypeAny, {
|
|
143
143
|
path: string;
|
|
144
144
|
methods: string[];
|
|
145
145
|
lastExecution?: {
|
|
146
|
-
error: string | null;
|
|
147
146
|
startedAt: string;
|
|
148
147
|
completedAt: string;
|
|
149
148
|
duration: number;
|
|
149
|
+
error: string | null;
|
|
150
150
|
} | null | undefined;
|
|
151
151
|
}, {
|
|
152
152
|
path: string;
|
|
153
153
|
methods: string[];
|
|
154
154
|
lastExecution?: {
|
|
155
|
-
error: string | null;
|
|
156
155
|
startedAt: string;
|
|
157
156
|
completedAt: string;
|
|
158
157
|
duration: number;
|
|
158
|
+
error: string | null;
|
|
159
159
|
} | null | undefined;
|
|
160
160
|
}>, "many">;
|
|
161
161
|
runningJobs: z.ZodArray<z.ZodObject<{
|
|
@@ -168,35 +168,35 @@ export declare const jobsSchema: z.ZodObject<{
|
|
|
168
168
|
duration: z.ZodOptional<z.ZodNumber>;
|
|
169
169
|
error: z.ZodOptional<z.ZodString>;
|
|
170
170
|
}, "strip", z.ZodTypeAny, {
|
|
171
|
-
status: "running" | "completed" | "failed";
|
|
172
|
-
method: string;
|
|
173
171
|
jobId: string;
|
|
174
172
|
jobName: string;
|
|
173
|
+
method: string;
|
|
174
|
+
status: "completed" | "failed" | "running";
|
|
175
175
|
startedAt: string;
|
|
176
|
-
error?: string | undefined;
|
|
177
176
|
completedAt?: string | undefined;
|
|
178
177
|
duration?: number | undefined;
|
|
178
|
+
error?: string | undefined;
|
|
179
179
|
}, {
|
|
180
|
-
status: "running" | "completed" | "failed";
|
|
181
|
-
method: string;
|
|
182
180
|
jobId: string;
|
|
183
181
|
jobName: string;
|
|
182
|
+
method: string;
|
|
183
|
+
status: "completed" | "failed" | "running";
|
|
184
184
|
startedAt: string;
|
|
185
|
-
error?: string | undefined;
|
|
186
185
|
completedAt?: string | undefined;
|
|
187
186
|
duration?: number | undefined;
|
|
187
|
+
error?: string | undefined;
|
|
188
188
|
}>, "many">;
|
|
189
189
|
jobCompletions: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
190
190
|
completedAt: z.ZodString;
|
|
191
191
|
status: z.ZodEnum<["completed", "failed"]>;
|
|
192
192
|
error: z.ZodOptional<z.ZodString>;
|
|
193
193
|
}, "strip", z.ZodTypeAny, {
|
|
194
|
-
status: "completed" | "failed";
|
|
195
194
|
completedAt: string;
|
|
195
|
+
status: "completed" | "failed";
|
|
196
196
|
error?: string | undefined;
|
|
197
197
|
}, {
|
|
198
|
-
status: "completed" | "failed";
|
|
199
198
|
completedAt: string;
|
|
199
|
+
status: "completed" | "failed";
|
|
200
200
|
error?: string | undefined;
|
|
201
201
|
}>>;
|
|
202
202
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -204,25 +204,25 @@ export declare const jobsSchema: z.ZodObject<{
|
|
|
204
204
|
path: string;
|
|
205
205
|
methods: string[];
|
|
206
206
|
lastExecution?: {
|
|
207
|
-
error: string | null;
|
|
208
207
|
startedAt: string;
|
|
209
208
|
completedAt: string;
|
|
210
209
|
duration: number;
|
|
210
|
+
error: string | null;
|
|
211
211
|
} | null | undefined;
|
|
212
212
|
}[];
|
|
213
213
|
runningJobs: {
|
|
214
|
-
status: "running" | "completed" | "failed";
|
|
215
|
-
method: string;
|
|
216
214
|
jobId: string;
|
|
217
215
|
jobName: string;
|
|
216
|
+
method: string;
|
|
217
|
+
status: "completed" | "failed" | "running";
|
|
218
218
|
startedAt: string;
|
|
219
|
-
error?: string | undefined;
|
|
220
219
|
completedAt?: string | undefined;
|
|
221
220
|
duration?: number | undefined;
|
|
221
|
+
error?: string | undefined;
|
|
222
222
|
}[];
|
|
223
223
|
jobCompletions: Record<string, {
|
|
224
|
-
status: "completed" | "failed";
|
|
225
224
|
completedAt: string;
|
|
225
|
+
status: "completed" | "failed";
|
|
226
226
|
error?: string | undefined;
|
|
227
227
|
}>;
|
|
228
228
|
}, {
|
|
@@ -230,25 +230,25 @@ export declare const jobsSchema: z.ZodObject<{
|
|
|
230
230
|
path: string;
|
|
231
231
|
methods: string[];
|
|
232
232
|
lastExecution?: {
|
|
233
|
-
error: string | null;
|
|
234
233
|
startedAt: string;
|
|
235
234
|
completedAt: string;
|
|
236
235
|
duration: number;
|
|
236
|
+
error: string | null;
|
|
237
237
|
} | null | undefined;
|
|
238
238
|
}[];
|
|
239
239
|
runningJobs: {
|
|
240
|
-
status: "running" | "completed" | "failed";
|
|
241
|
-
method: string;
|
|
242
240
|
jobId: string;
|
|
243
241
|
jobName: string;
|
|
242
|
+
method: string;
|
|
243
|
+
status: "completed" | "failed" | "running";
|
|
244
244
|
startedAt: string;
|
|
245
|
-
error?: string | undefined;
|
|
246
245
|
completedAt?: string | undefined;
|
|
247
246
|
duration?: number | undefined;
|
|
247
|
+
error?: string | undefined;
|
|
248
248
|
}[];
|
|
249
249
|
jobCompletions: Record<string, {
|
|
250
|
-
status: "completed" | "failed";
|
|
251
250
|
completedAt: string;
|
|
251
|
+
status: "completed" | "failed";
|
|
252
252
|
error?: string | undefined;
|
|
253
253
|
}>;
|
|
254
254
|
}>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { metricsClient } from '../metrics';
|
|
2
2
|
declare const messageProducedSizeCounter: metricsClient.Histogram<"topic">;
|
|
3
3
|
declare const messageProduceError: metricsClient.Counter<"topic">;
|
|
4
|
-
declare const messageConsumedCounter: metricsClient.Counter<"
|
|
5
|
-
declare const messageConsumedErrorCounter: metricsClient.Counter<"
|
|
6
|
-
declare const messageAcknowledgedCounter: metricsClient.Counter<"
|
|
7
|
-
declare const messageSkippedForeignEnvCounter: metricsClient.Counter<"
|
|
4
|
+
declare const messageConsumedCounter: metricsClient.Counter<"groupId" | "topic">;
|
|
5
|
+
declare const messageConsumedErrorCounter: metricsClient.Counter<"groupId" | "topic">;
|
|
6
|
+
declare const messageAcknowledgedCounter: metricsClient.Counter<"groupId" | "topic">;
|
|
7
|
+
declare const messageSkippedForeignEnvCounter: metricsClient.Counter<"groupId" | "topic">;
|
|
8
8
|
export { messageProducedSizeCounter, messageProduceError, messageConsumedCounter, messageConsumedErrorCounter, messageAcknowledgedCounter, messageSkippedForeignEnvCounter, };
|
|
@@ -10,11 +10,11 @@ export declare const queueJobParamsSchema: z.ZodObject<{
|
|
|
10
10
|
queue: z.ZodString;
|
|
11
11
|
id: z.ZodString;
|
|
12
12
|
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
id: string;
|
|
14
13
|
queue: string;
|
|
15
|
-
}, {
|
|
16
14
|
id: string;
|
|
15
|
+
}, {
|
|
17
16
|
queue: string;
|
|
17
|
+
id: string;
|
|
18
18
|
}>;
|
|
19
19
|
export declare const scheduleNameParamsSchema: z.ZodObject<{
|
|
20
20
|
name: z.ZodString;
|
|
@@ -59,21 +59,21 @@ export declare const enqueueBodySchema: z.ZodObject<{
|
|
|
59
59
|
singletonSeconds?: number | undefined;
|
|
60
60
|
}>>;
|
|
61
61
|
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
data?: Record<string, unknown> | undefined;
|
|
62
63
|
options?: {
|
|
63
64
|
priority?: number | undefined;
|
|
64
65
|
startAfter?: string | number | Date | undefined;
|
|
65
66
|
singletonKey?: string | undefined;
|
|
66
67
|
singletonSeconds?: number | undefined;
|
|
67
68
|
} | undefined;
|
|
68
|
-
data?: Record<string, unknown> | undefined;
|
|
69
69
|
}, {
|
|
70
|
+
data?: Record<string, unknown> | undefined;
|
|
70
71
|
options?: {
|
|
71
72
|
priority?: number | undefined;
|
|
72
73
|
startAfter?: string | number | Date | undefined;
|
|
73
74
|
singletonKey?: string | undefined;
|
|
74
75
|
singletonSeconds?: number | undefined;
|
|
75
76
|
} | undefined;
|
|
76
|
-
data?: Record<string, unknown> | undefined;
|
|
77
77
|
}>;
|
|
78
78
|
export declare const scheduleBodySchema: z.ZodObject<{
|
|
79
79
|
name: z.ZodString;
|
|
@@ -89,17 +89,17 @@ export declare const scheduleBodySchema: z.ZodObject<{
|
|
|
89
89
|
}, "strip", z.ZodTypeAny, {
|
|
90
90
|
name: string;
|
|
91
91
|
cron: string;
|
|
92
|
+
data?: Record<string, unknown> | undefined;
|
|
92
93
|
options?: {
|
|
93
94
|
tz?: string | undefined;
|
|
94
95
|
} | undefined;
|
|
95
|
-
data?: Record<string, unknown> | undefined;
|
|
96
96
|
}, {
|
|
97
97
|
name: string;
|
|
98
98
|
cron: string;
|
|
99
|
+
data?: Record<string, unknown> | undefined;
|
|
99
100
|
options?: {
|
|
100
101
|
tz?: string | undefined;
|
|
101
102
|
} | undefined;
|
|
102
|
-
data?: Record<string, unknown> | undefined;
|
|
103
103
|
}>;
|
|
104
104
|
export declare const updateScheduleBodySchema: z.ZodObject<{
|
|
105
105
|
cron: z.ZodString;
|
|
@@ -113,16 +113,16 @@ export declare const updateScheduleBodySchema: z.ZodObject<{
|
|
|
113
113
|
}>>;
|
|
114
114
|
}, "strip", z.ZodTypeAny, {
|
|
115
115
|
cron: string;
|
|
116
|
+
data?: Record<string, unknown> | undefined;
|
|
116
117
|
options?: {
|
|
117
118
|
tz?: string | undefined;
|
|
118
119
|
} | undefined;
|
|
119
|
-
data?: Record<string, unknown> | undefined;
|
|
120
120
|
}, {
|
|
121
121
|
cron: string;
|
|
122
|
+
data?: Record<string, unknown> | undefined;
|
|
122
123
|
options?: {
|
|
123
124
|
tz?: string | undefined;
|
|
124
125
|
} | undefined;
|
|
125
|
-
data?: Record<string, unknown> | undefined;
|
|
126
126
|
}>;
|
|
127
127
|
export declare const queueStatsSchema: z.ZodObject<{
|
|
128
128
|
name: z.ZodString;
|
|
@@ -137,26 +137,26 @@ export declare const queueStatsSchema: z.ZodObject<{
|
|
|
137
137
|
totalCount: z.ZodNumber;
|
|
138
138
|
}, "strip", z.ZodTypeAny, {
|
|
139
139
|
name: string;
|
|
140
|
-
queuedCount: number;
|
|
141
|
-
activeCount: number;
|
|
142
|
-
totalCount: number;
|
|
143
|
-
retryDelay?: number | undefined;
|
|
144
140
|
policy?: string | undefined;
|
|
145
141
|
retryLimit?: number | undefined;
|
|
142
|
+
retryDelay?: number | undefined;
|
|
146
143
|
retryBackoff?: boolean | undefined;
|
|
147
144
|
expireInSeconds?: number | undefined;
|
|
148
145
|
deadLetter?: string | null | undefined;
|
|
149
|
-
}, {
|
|
150
|
-
name: string;
|
|
151
146
|
queuedCount: number;
|
|
152
147
|
activeCount: number;
|
|
153
148
|
totalCount: number;
|
|
154
|
-
|
|
149
|
+
}, {
|
|
150
|
+
name: string;
|
|
155
151
|
policy?: string | undefined;
|
|
156
152
|
retryLimit?: number | undefined;
|
|
153
|
+
retryDelay?: number | undefined;
|
|
157
154
|
retryBackoff?: boolean | undefined;
|
|
158
155
|
expireInSeconds?: number | undefined;
|
|
159
156
|
deadLetter?: string | null | undefined;
|
|
157
|
+
queuedCount: number;
|
|
158
|
+
activeCount: number;
|
|
159
|
+
totalCount: number;
|
|
160
160
|
}>;
|
|
161
161
|
export declare const queueStatsArraySchema: z.ZodArray<z.ZodObject<{
|
|
162
162
|
name: z.ZodString;
|
|
@@ -171,26 +171,26 @@ export declare const queueStatsArraySchema: z.ZodArray<z.ZodObject<{
|
|
|
171
171
|
totalCount: z.ZodNumber;
|
|
172
172
|
}, "strip", z.ZodTypeAny, {
|
|
173
173
|
name: string;
|
|
174
|
-
queuedCount: number;
|
|
175
|
-
activeCount: number;
|
|
176
|
-
totalCount: number;
|
|
177
|
-
retryDelay?: number | undefined;
|
|
178
174
|
policy?: string | undefined;
|
|
179
175
|
retryLimit?: number | undefined;
|
|
176
|
+
retryDelay?: number | undefined;
|
|
180
177
|
retryBackoff?: boolean | undefined;
|
|
181
178
|
expireInSeconds?: number | undefined;
|
|
182
179
|
deadLetter?: string | null | undefined;
|
|
183
|
-
}, {
|
|
184
|
-
name: string;
|
|
185
180
|
queuedCount: number;
|
|
186
181
|
activeCount: number;
|
|
187
182
|
totalCount: number;
|
|
188
|
-
|
|
183
|
+
}, {
|
|
184
|
+
name: string;
|
|
189
185
|
policy?: string | undefined;
|
|
190
186
|
retryLimit?: number | undefined;
|
|
187
|
+
retryDelay?: number | undefined;
|
|
191
188
|
retryBackoff?: boolean | undefined;
|
|
192
189
|
expireInSeconds?: number | undefined;
|
|
193
190
|
deadLetter?: string | null | undefined;
|
|
191
|
+
queuedCount: number;
|
|
192
|
+
activeCount: number;
|
|
193
|
+
totalCount: number;
|
|
194
194
|
}>, "many">;
|
|
195
195
|
export declare const jobDetailSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
196
196
|
export declare const jobArraySchema: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
|
|
@@ -205,12 +205,12 @@ export declare const successResponseSchema: z.ZodObject<{
|
|
|
205
205
|
name: z.ZodOptional<z.ZodString>;
|
|
206
206
|
}, "strip", z.ZodTypeAny, {
|
|
207
207
|
success: boolean;
|
|
208
|
-
name?: string | undefined;
|
|
209
|
-
deleted?: string | undefined;
|
|
210
208
|
jobId?: string | undefined;
|
|
209
|
+
deleted?: string | undefined;
|
|
210
|
+
name?: string | undefined;
|
|
211
211
|
}, {
|
|
212
212
|
success: boolean;
|
|
213
|
-
name?: string | undefined;
|
|
214
|
-
deleted?: string | undefined;
|
|
215
213
|
jobId?: string | undefined;
|
|
214
|
+
deleted?: string | undefined;
|
|
215
|
+
name?: string | undefined;
|
|
216
216
|
}>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PgBoss } from 'pg-boss';
|
|
2
2
|
import type { Logger } from 'pino';
|
|
3
|
-
export declare const manageJob: (boss: PgBoss, logger: Logger, action:
|
|
3
|
+
export declare const manageJob: (boss: PgBoss, logger: Logger, action: 'retry' | 'cancel' | 'delete', queueName: string, jobId: string) => Promise<void>;
|
|
@@ -64,11 +64,11 @@ declare class ServiceIdentity {
|
|
|
64
64
|
payload: z.ZodAny;
|
|
65
65
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">, z.ZodUndefined]>>>;
|
|
66
66
|
}, "strip", z.ZodTypeAny, {
|
|
67
|
-
params?: Record<string, string | number | (string | number)[] | undefined> | undefined;
|
|
68
67
|
payload?: any;
|
|
69
|
-
}, {
|
|
70
68
|
params?: Record<string, string | number | (string | number)[] | undefined> | undefined;
|
|
69
|
+
}, {
|
|
71
70
|
payload?: any;
|
|
71
|
+
params?: Record<string, string | number | (string | number)[] | undefined> | undefined;
|
|
72
72
|
}>>;
|
|
73
73
|
identityJWKSRoute: RequestHandler;
|
|
74
74
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { IsOperatorTokenRevokedParams, IsRevokedOperatorJwtParams, RevokeOperatorTokensParams } from './types';
|
|
1
|
+
import { CheckRevocationRedisSafetyParams, IsOperatorTokenRevokedParams, IsRevokedOperatorJwtParams, RevokeOperatorTokensParams } from './types';
|
|
2
2
|
export declare const OPERATOR_REVOCATION_KEY_PREFIX = "revoked:operator:";
|
|
3
3
|
export declare const OPERATOR_REVOCATION_TTL_SECONDS: number;
|
|
4
4
|
export declare const buildOperatorRevocationKey: (operatorUuid: string) => string;
|
|
5
5
|
export declare const revokeOperatorTokens: ({ redis, logger, operatorUuid, }: RevokeOperatorTokensParams) => Promise<void>;
|
|
6
6
|
export declare const isOperatorTokenRevoked: ({ redis, logger, operatorUuid, issuedAtSeconds, }: IsOperatorTokenRevokedParams) => Promise<boolean>;
|
|
7
7
|
export declare const isRevokedOperatorJwt: ({ redis, logger, payload, operatorRole, }: IsRevokedOperatorJwtParams) => Promise<boolean>;
|
|
8
|
+
export declare const checkRevocationRedisSafety: ({ redis, logger, }: CheckRevocationRedisSafetyParams) => Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isRevokedOperatorJwt = exports.isOperatorTokenRevoked = exports.revokeOperatorTokens = exports.buildOperatorRevocationKey = exports.OPERATOR_REVOCATION_TTL_SECONDS = exports.OPERATOR_REVOCATION_KEY_PREFIX = void 0;
|
|
3
|
+
exports.checkRevocationRedisSafety = exports.isRevokedOperatorJwt = exports.isOperatorTokenRevoked = exports.revokeOperatorTokens = exports.buildOperatorRevocationKey = exports.OPERATOR_REVOCATION_TTL_SECONDS = exports.OPERATOR_REVOCATION_KEY_PREFIX = void 0;
|
|
4
4
|
exports.OPERATOR_REVOCATION_KEY_PREFIX = 'revoked:operator:';
|
|
5
5
|
exports.OPERATOR_REVOCATION_TTL_SECONDS = 24 * 60 * 60;
|
|
6
6
|
const REDIS_GET_TIMEOUT_MS = 50;
|
|
@@ -68,3 +68,25 @@ const isRevokedOperatorJwt = async ({ redis, logger, payload, operatorRole, }) =
|
|
|
68
68
|
});
|
|
69
69
|
};
|
|
70
70
|
exports.isRevokedOperatorJwt = isRevokedOperatorJwt;
|
|
71
|
+
const readMaxMemoryPolicy = (raw) => {
|
|
72
|
+
if (Array.isArray(raw) && raw.length >= 2 && typeof raw[1] === 'string') {
|
|
73
|
+
return raw[1];
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
};
|
|
77
|
+
const checkRevocationRedisSafety = async ({ redis, logger, }) => {
|
|
78
|
+
try {
|
|
79
|
+
const policy = readMaxMemoryPolicy(await redis.config('GET', 'maxmemory-policy'));
|
|
80
|
+
if (policy === null) {
|
|
81
|
+
logger.warn('could not read operator token revocation redis maxmemory-policy');
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (policy !== 'noeviction') {
|
|
85
|
+
logger.error({ policy }, 'operator token revocation redis uses evicting maxmemory-policy');
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
logger.warn(error, 'operator token revocation redis maxmemory-policy check unavailable');
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
exports.checkRevocationRedisSafety = checkRevocationRedisSafety;
|
|
@@ -25,3 +25,10 @@ export interface IsRevokedOperatorJwtParams {
|
|
|
25
25
|
payload: RevocableJwtPayload;
|
|
26
26
|
operatorRole: string;
|
|
27
27
|
}
|
|
28
|
+
export interface MaxMemoryPolicyReader {
|
|
29
|
+
config(subcommand: 'GET', parameter: string): Promise<unknown>;
|
|
30
|
+
}
|
|
31
|
+
export interface CheckRevocationRedisSafetyParams {
|
|
32
|
+
redis: MaxMemoryPolicyReader;
|
|
33
|
+
logger: Pick<Logger, 'warn' | 'error'>;
|
|
34
|
+
}
|
package/dist/lib/validation.d.ts
CHANGED
|
@@ -4,218 +4,8 @@ import { Money } from '../lib/money/money';
|
|
|
4
4
|
export declare const preprocessArrayFromQueryString: (input: unknown) => unknown[] | undefined;
|
|
5
5
|
export declare const preprocessNumberFromQueryString: (input: unknown) => number | unknown;
|
|
6
6
|
export declare const preprocessBooleanFromQueryString: (input: unknown) => boolean | unknown;
|
|
7
|
-
export declare const preprocessBooleanFromString:
|
|
7
|
+
export declare const preprocessBooleanFromString: typeof preprocessBooleanFromQueryString;
|
|
8
8
|
declare const z: {
|
|
9
|
-
string: () => ZodString;
|
|
10
|
-
safeString: () => ZodString;
|
|
11
|
-
safeText: () => ZodString;
|
|
12
|
-
safeBusinessStringForOnboarding: () => zod.ZodEffects<zod.ZodString, string, string>;
|
|
13
|
-
safeNameForOnboarding: () => zod.ZodEffects<zod.ZodString, string, string>;
|
|
14
|
-
nonemptyString: () => zod.ZodString;
|
|
15
|
-
alphaNumericString: () => zod.ZodString;
|
|
16
|
-
tableId: () => zod.ZodString;
|
|
17
|
-
uuid: () => ZodString;
|
|
18
|
-
uuidv4: () => zod.ZodEffects<zod.ZodString, string, string>;
|
|
19
|
-
email: () => ZodEffects<ZodString>;
|
|
20
|
-
phoneNumber: () => ZodEffects<ZodEffects<ZodString>>;
|
|
21
|
-
nullablePhoneNumber: () => zod.ZodEffects<zod.ZodEffects<zod.ZodString, string, string>, string | null, string>;
|
|
22
|
-
strongPassword: () => zod.ZodEffects<zod.ZodString, string, string>;
|
|
23
|
-
zipCode: (locale?: validator.PostalCodeLocale) => ZodEffects<ZodString, string>;
|
|
24
|
-
countryCode: () => zod.ZodString;
|
|
25
|
-
moneyDecimalString: (locale?: string) => zod.ZodEffects<zod.ZodString, string, string>;
|
|
26
|
-
moneyFromFloat: () => ZodEffects<ZodEffects<ZodNumber>, Money>;
|
|
27
|
-
moneyFromInt: () => ZodEffects<ZodNumber, Money>;
|
|
28
|
-
convertMoneyFieldsToCurrency: <T extends ZodObject<Record<string, ZodTypeAny>>>(schema: T) => ZodEffects<T>;
|
|
29
|
-
unixTimestamp: () => zod.ZodNumber;
|
|
30
|
-
integerString: (options?: {
|
|
31
|
-
maxLength?: number;
|
|
32
|
-
lt?: number;
|
|
33
|
-
gt?: number;
|
|
34
|
-
transform?: boolean;
|
|
35
|
-
}) => zod.ZodEffects<zod.ZodEffects<zod.ZodType<string, zod.ZodTypeDef, string>, string, string>, number, string>;
|
|
36
|
-
integerStringRaw: (options?: {
|
|
37
|
-
maxLength?: number;
|
|
38
|
-
lt?: number;
|
|
39
|
-
gt?: number;
|
|
40
|
-
transform?: boolean;
|
|
41
|
-
}) => typeof options.transform extends true ? ZodEffects<ZodType<number>> : ZodEffects<ZodType<string>>;
|
|
42
|
-
bigIntegerString: () => zod.ZodEffects<zod.ZodString, string, string>;
|
|
43
|
-
floatString: (options?: {
|
|
44
|
-
maxLength?: number;
|
|
45
|
-
lt: number;
|
|
46
|
-
gt: number;
|
|
47
|
-
}) => zod.ZodEffects<zod.ZodEffects<zod.ZodString, string, string>, number, string>;
|
|
48
|
-
hex: ({ min, max, length, rawLength, }?: {
|
|
49
|
-
min?: number;
|
|
50
|
-
max?: number;
|
|
51
|
-
length?: number;
|
|
52
|
-
rawLength?: number;
|
|
53
|
-
}) => zod.ZodEffects<zod.ZodString, string, string>;
|
|
54
|
-
sha256: () => zod.ZodEffects<zod.ZodString, string, string>;
|
|
55
|
-
base64: ({ min, max, length, rawLength, isBase64Url, }?: {
|
|
56
|
-
min?: number;
|
|
57
|
-
max?: number;
|
|
58
|
-
length?: number;
|
|
59
|
-
rawLength?: number;
|
|
60
|
-
isBase64Url?: boolean;
|
|
61
|
-
}) => ZodEffects<ZodString>;
|
|
62
|
-
bearerToken: () => ZodEffects<ZodEffects<ZodString>>;
|
|
63
|
-
jwt: ({ max }: {
|
|
64
|
-
max: number;
|
|
65
|
-
}) => ZodEffects<ZodString>;
|
|
66
|
-
ecPublicKey: () => zod.ZodEffects<zod.ZodString, string, string>;
|
|
67
|
-
ecCompressedPublicKey: () => zod.ZodEffects<zod.ZodString, string, string>;
|
|
68
|
-
uncompressedECPublicKey: () => zod.ZodEffects<zod.ZodString, string, string>;
|
|
69
|
-
ecSignature: () => zod.ZodEffects<zod.ZodString, string, string>;
|
|
70
|
-
iv: () => zod.ZodEffects<zod.ZodString, string, string>;
|
|
71
|
-
mac: () => zod.ZodEffects<zod.ZodString, string, string>;
|
|
72
|
-
traceId: () => zod.ZodEffects<zod.ZodString, string, string>;
|
|
73
|
-
isoDateString: () => ZodEffects<ZodString, string>;
|
|
74
|
-
rfc3339String: () => ZodEffects<ZodString, string>;
|
|
75
|
-
iso8601Date: () => zod.ZodEffects<zod.ZodString, string, string>;
|
|
76
|
-
urlHttpsString: () => zod.ZodEffects<zod.ZodString, string, string>;
|
|
77
|
-
urlHttpOrHttpsString: () => zod.ZodEffects<zod.ZodString, string, string>;
|
|
78
|
-
language: () => ZodTypeAny;
|
|
79
|
-
dsgcPayload: () => zod.ZodObject<{
|
|
80
|
-
certificates: zod.ZodArray<zod.ZodObject<{
|
|
81
|
-
certificateType: zod.ZodString;
|
|
82
|
-
country: zod.ZodString;
|
|
83
|
-
kid: zod.ZodString;
|
|
84
|
-
rawData: zod.ZodString;
|
|
85
|
-
signature: zod.ZodString;
|
|
86
|
-
thumbprint: zod.ZodString;
|
|
87
|
-
timestamp: zod.ZodString;
|
|
88
|
-
}, "strip", zod.ZodTypeAny, {
|
|
89
|
-
timestamp: string;
|
|
90
|
-
kid: string;
|
|
91
|
-
signature: string;
|
|
92
|
-
certificateType: string;
|
|
93
|
-
country: string;
|
|
94
|
-
rawData: string;
|
|
95
|
-
thumbprint: string;
|
|
96
|
-
}, {
|
|
97
|
-
timestamp: string;
|
|
98
|
-
kid: string;
|
|
99
|
-
signature: string;
|
|
100
|
-
certificateType: string;
|
|
101
|
-
country: string;
|
|
102
|
-
rawData: string;
|
|
103
|
-
thumbprint: string;
|
|
104
|
-
}>, "many">;
|
|
105
|
-
}, "strip", zod.ZodTypeAny, {
|
|
106
|
-
certificates: {
|
|
107
|
-
timestamp: string;
|
|
108
|
-
kid: string;
|
|
109
|
-
signature: string;
|
|
110
|
-
certificateType: string;
|
|
111
|
-
country: string;
|
|
112
|
-
rawData: string;
|
|
113
|
-
thumbprint: string;
|
|
114
|
-
}[];
|
|
115
|
-
}, {
|
|
116
|
-
certificates: {
|
|
117
|
-
timestamp: string;
|
|
118
|
-
kid: string;
|
|
119
|
-
signature: string;
|
|
120
|
-
certificateType: string;
|
|
121
|
-
country: string;
|
|
122
|
-
rawData: string;
|
|
123
|
-
thumbprint: string;
|
|
124
|
-
}[];
|
|
125
|
-
}>;
|
|
126
|
-
dccListPayload: () => zod.ZodArray<zod.ZodObject<{
|
|
127
|
-
identifier: zod.ZodString;
|
|
128
|
-
version: zod.ZodString;
|
|
129
|
-
country: zod.ZodString;
|
|
130
|
-
hash: zod.ZodString;
|
|
131
|
-
}, "strip", zod.ZodTypeAny, {
|
|
132
|
-
version: string;
|
|
133
|
-
country: string;
|
|
134
|
-
identifier: string;
|
|
135
|
-
hash: string;
|
|
136
|
-
}, {
|
|
137
|
-
version: string;
|
|
138
|
-
country: string;
|
|
139
|
-
identifier: string;
|
|
140
|
-
hash: string;
|
|
141
|
-
}>, "many">;
|
|
142
|
-
dccRulePayload: () => zod.ZodObject<{
|
|
143
|
-
Identifier: zod.ZodString;
|
|
144
|
-
Type: zod.ZodString;
|
|
145
|
-
Country: zod.ZodString;
|
|
146
|
-
Version: zod.ZodString;
|
|
147
|
-
SchemaVersion: zod.ZodString;
|
|
148
|
-
Engine: zod.ZodString;
|
|
149
|
-
EngineVersion: zod.ZodString;
|
|
150
|
-
CertificateType: zod.ZodString;
|
|
151
|
-
Description: zod.ZodArray<zod.ZodObject<{
|
|
152
|
-
lang: zod.ZodString;
|
|
153
|
-
desc: zod.ZodString;
|
|
154
|
-
}, "strip", zod.ZodTypeAny, {
|
|
155
|
-
lang: string;
|
|
156
|
-
desc: string;
|
|
157
|
-
}, {
|
|
158
|
-
lang: string;
|
|
159
|
-
desc: string;
|
|
160
|
-
}>, "many">;
|
|
161
|
-
ValidFrom: zod.ZodString;
|
|
162
|
-
ValidTo: zod.ZodString;
|
|
163
|
-
AffectedFields: zod.ZodArray<zod.ZodString, "many">;
|
|
164
|
-
Logic: zod.ZodAny;
|
|
165
|
-
}, "strip", zod.ZodTypeAny, {
|
|
166
|
-
Identifier: string;
|
|
167
|
-
Type: string;
|
|
168
|
-
Country: string;
|
|
169
|
-
Version: string;
|
|
170
|
-
SchemaVersion: string;
|
|
171
|
-
Engine: string;
|
|
172
|
-
EngineVersion: string;
|
|
173
|
-
CertificateType: string;
|
|
174
|
-
Description: {
|
|
175
|
-
lang: string;
|
|
176
|
-
desc: string;
|
|
177
|
-
}[];
|
|
178
|
-
ValidFrom: string;
|
|
179
|
-
ValidTo: string;
|
|
180
|
-
AffectedFields: string[];
|
|
181
|
-
Logic?: any;
|
|
182
|
-
}, {
|
|
183
|
-
Identifier: string;
|
|
184
|
-
Type: string;
|
|
185
|
-
Country: string;
|
|
186
|
-
Version: string;
|
|
187
|
-
SchemaVersion: string;
|
|
188
|
-
Engine: string;
|
|
189
|
-
EngineVersion: string;
|
|
190
|
-
CertificateType: string;
|
|
191
|
-
Description: {
|
|
192
|
-
lang: string;
|
|
193
|
-
desc: string;
|
|
194
|
-
}[];
|
|
195
|
-
ValidFrom: string;
|
|
196
|
-
ValidTo: string;
|
|
197
|
-
AffectedFields: string[];
|
|
198
|
-
Logic?: any;
|
|
199
|
-
}>;
|
|
200
|
-
setErrorMap(map: zod.ZodErrorMap): void;
|
|
201
|
-
getErrorMap(): zod.ZodErrorMap;
|
|
202
|
-
defaultErrorMap: zod.ZodErrorMap;
|
|
203
|
-
addIssueToContext(ctx: zod.ParseContext, issueData: zod.IssueData): void;
|
|
204
|
-
makeIssue: (params: {
|
|
205
|
-
data: any;
|
|
206
|
-
path: (string | number)[];
|
|
207
|
-
errorMaps: zod.ZodErrorMap[];
|
|
208
|
-
issueData: zod.IssueData;
|
|
209
|
-
}) => zod.ZodIssue;
|
|
210
|
-
EMPTY_PATH: zod.ParsePath;
|
|
211
|
-
ParseStatus: typeof zod.ParseStatus;
|
|
212
|
-
INVALID: zod.INVALID;
|
|
213
|
-
DIRTY: <T>(value: T) => zod.DIRTY<T>;
|
|
214
|
-
OK: <T>(value: T) => zod.OK<T>;
|
|
215
|
-
isAborted: (x: zod.ParseReturnType<any>) => x is zod.INVALID;
|
|
216
|
-
isDirty: <T>(x: zod.ParseReturnType<T>) => x is zod.OK<T> | zod.DIRTY<T>;
|
|
217
|
-
isValid: <T>(x: zod.ParseReturnType<T>) => x is zod.OK<T>;
|
|
218
|
-
isAsync: <T>(x: zod.ParseReturnType<T>) => x is zod.AsyncParseReturnType<T>;
|
|
219
9
|
util: typeof zod.util;
|
|
220
10
|
objectUtil: typeof zod.objectUtil;
|
|
221
11
|
ZodParsedType: {
|
|
@@ -241,19 +31,53 @@ declare const z: {
|
|
|
241
31
|
set: "set";
|
|
242
32
|
};
|
|
243
33
|
getParsedType: (data: any) => zod.ZodParsedType;
|
|
34
|
+
ZodIssueCode: {
|
|
35
|
+
invalid_type: "invalid_type";
|
|
36
|
+
invalid_literal: "invalid_literal";
|
|
37
|
+
custom: "custom";
|
|
38
|
+
invalid_union: "invalid_union";
|
|
39
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
40
|
+
invalid_enum_value: "invalid_enum_value";
|
|
41
|
+
unrecognized_keys: "unrecognized_keys";
|
|
42
|
+
invalid_arguments: "invalid_arguments";
|
|
43
|
+
invalid_return_type: "invalid_return_type";
|
|
44
|
+
invalid_date: "invalid_date";
|
|
45
|
+
invalid_string: "invalid_string";
|
|
46
|
+
too_small: "too_small";
|
|
47
|
+
too_big: "too_big";
|
|
48
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
49
|
+
not_multiple_of: "not_multiple_of";
|
|
50
|
+
not_finite: "not_finite";
|
|
51
|
+
};
|
|
52
|
+
quotelessJson: (obj: any) => string;
|
|
53
|
+
ZodError: typeof zod.ZodError;
|
|
54
|
+
defaultErrorMap: zod.ZodErrorMap;
|
|
55
|
+
setErrorMap(map: zod.ZodErrorMap): void;
|
|
56
|
+
getErrorMap(): zod.ZodErrorMap;
|
|
57
|
+
makeIssue: (params: {
|
|
58
|
+
data: any;
|
|
59
|
+
path: (string | number)[];
|
|
60
|
+
errorMaps: zod.ZodErrorMap[];
|
|
61
|
+
issueData: zod.IssueData;
|
|
62
|
+
}) => zod.ZodIssue;
|
|
63
|
+
EMPTY_PATH: zod.ParsePath;
|
|
64
|
+
addIssueToContext(ctx: zod.ParseContext, issueData: zod.IssueData): void;
|
|
65
|
+
ParseStatus: typeof zod.ParseStatus;
|
|
66
|
+
INVALID: zod.INVALID;
|
|
67
|
+
DIRTY: <T>(value: T) => zod.DIRTY<T>;
|
|
68
|
+
OK: <T>(value: T) => zod.OK<T>;
|
|
69
|
+
isAborted: (x: zod.ParseReturnType<any>) => x is zod.INVALID;
|
|
70
|
+
isDirty: <T>(x: zod.ParseReturnType<T>) => x is zod.OK<T> | zod.DIRTY<T>;
|
|
71
|
+
isValid: <T>(x: zod.ParseReturnType<T>) => x is zod.OK<T>;
|
|
72
|
+
isAsync: <T>(x: zod.ParseReturnType<T>) => x is zod.AsyncParseReturnType<T>;
|
|
73
|
+
ZodType: typeof ZodType;
|
|
244
74
|
datetimeRegex(args: {
|
|
245
75
|
precision?: number | null;
|
|
246
76
|
offset?: boolean;
|
|
247
77
|
local?: boolean;
|
|
248
78
|
}): RegExp;
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}) | ((input: any) => Partial<zod.util.Omit<zod.ZodCustomIssue, "code">> & {
|
|
252
|
-
fatal?: boolean;
|
|
253
|
-
}), fatal?: boolean): ZodType<T, zod.ZodTypeDef, T>;
|
|
254
|
-
ZodType: typeof zod.ZodType;
|
|
255
|
-
ZodString: typeof zod.ZodString;
|
|
256
|
-
ZodNumber: typeof zod.ZodNumber;
|
|
79
|
+
ZodString: typeof ZodString;
|
|
80
|
+
ZodNumber: typeof ZodNumber;
|
|
257
81
|
ZodBigInt: typeof zod.ZodBigInt;
|
|
258
82
|
ZodBoolean: typeof zod.ZodBoolean;
|
|
259
83
|
ZodDate: typeof zod.ZodDate;
|
|
@@ -265,7 +89,7 @@ declare const z: {
|
|
|
265
89
|
ZodNever: typeof zod.ZodNever;
|
|
266
90
|
ZodVoid: typeof zod.ZodVoid;
|
|
267
91
|
ZodArray: typeof zod.ZodArray;
|
|
268
|
-
ZodObject: typeof
|
|
92
|
+
ZodObject: typeof ZodObject;
|
|
269
93
|
ZodUnion: typeof zod.ZodUnion;
|
|
270
94
|
ZodDiscriminatedUnion: typeof zod.ZodDiscriminatedUnion;
|
|
271
95
|
ZodIntersection: typeof zod.ZodIntersection;
|
|
@@ -279,8 +103,8 @@ declare const z: {
|
|
|
279
103
|
ZodEnum: typeof zod.ZodEnum;
|
|
280
104
|
ZodNativeEnum: typeof zod.ZodNativeEnum;
|
|
281
105
|
ZodPromise: typeof zod.ZodPromise;
|
|
282
|
-
ZodEffects: typeof
|
|
283
|
-
ZodTransformer: typeof
|
|
106
|
+
ZodEffects: typeof ZodEffects;
|
|
107
|
+
ZodTransformer: typeof ZodEffects;
|
|
284
108
|
ZodOptional: typeof zod.ZodOptional;
|
|
285
109
|
ZodNullable: typeof zod.ZodNullable;
|
|
286
110
|
ZodDefault: typeof zod.ZodDefault;
|
|
@@ -290,8 +114,13 @@ declare const z: {
|
|
|
290
114
|
ZodBranded: typeof zod.ZodBranded;
|
|
291
115
|
ZodPipeline: typeof zod.ZodPipeline;
|
|
292
116
|
ZodReadonly: typeof zod.ZodReadonly;
|
|
293
|
-
|
|
294
|
-
|
|
117
|
+
custom<T>(check?: (data: any) => any, params?: string | (Partial<zod.util.Omit<zod.ZodCustomIssue, "code">> & {
|
|
118
|
+
fatal?: boolean;
|
|
119
|
+
}) | ((input: any) => Partial<zod.util.Omit<zod.ZodCustomIssue, "code">> & {
|
|
120
|
+
fatal?: boolean;
|
|
121
|
+
}), fatal?: boolean): ZodType<T, zod.ZodTypeDef, T>;
|
|
122
|
+
Schema: typeof ZodType;
|
|
123
|
+
ZodSchema: typeof ZodType;
|
|
295
124
|
late: {
|
|
296
125
|
object: <T extends zod.ZodRawShape>(shape: () => T, params?: zod.RawCreateParams) => ZodObject<T, "strip">;
|
|
297
126
|
};
|
|
@@ -337,7 +166,7 @@ declare const z: {
|
|
|
337
166
|
intersection: <T extends ZodTypeAny, U extends ZodTypeAny>(left: T, right: U, params?: zod.RawCreateParams) => zod.ZodIntersection<T, U>;
|
|
338
167
|
lazy: <T extends ZodTypeAny>(getter: () => T, params?: zod.RawCreateParams) => zod.ZodLazy<T>;
|
|
339
168
|
literal: <T extends zod.Primitive>(value: T, params?: zod.RawCreateParams) => zod.ZodLiteral<T>;
|
|
340
|
-
map: <Key extends ZodTypeAny =
|
|
169
|
+
map: <Key extends ZodTypeAny = ZodTypeAny, Value extends ZodTypeAny = ZodTypeAny>(keyType: Key, valueType: Value, params?: zod.RawCreateParams) => zod.ZodMap<Key, Value>;
|
|
341
170
|
nan: (params?: zod.RawCreateParams) => zod.ZodNaN;
|
|
342
171
|
nativeEnum: <T extends zod.EnumLike>(values: T, params?: zod.RawCreateParams) => zod.ZodNativeEnum<T>;
|
|
343
172
|
never: (params?: zod.RawCreateParams) => zod.ZodNever;
|
|
@@ -355,7 +184,7 @@ declare const z: {
|
|
|
355
184
|
preprocess: <I extends ZodTypeAny>(preprocess: (arg: unknown, ctx: zod.RefinementCtx) => unknown, schema: I, params?: zod.RawCreateParams) => ZodEffects<I, I["_output"], unknown>;
|
|
356
185
|
promise: <T extends ZodTypeAny>(schema: T, params?: zod.RawCreateParams) => zod.ZodPromise<T>;
|
|
357
186
|
record: typeof zod.ZodRecord.create;
|
|
358
|
-
set: <Value extends ZodTypeAny =
|
|
187
|
+
set: <Value extends ZodTypeAny = ZodTypeAny>(valueType: Value, params?: zod.RawCreateParams) => zod.ZodSet<Value>;
|
|
359
188
|
strictObject: <T extends zod.ZodRawShape>(shape: T, params?: zod.RawCreateParams) => ZodObject<T, "strict">;
|
|
360
189
|
symbol: (params?: zod.RawCreateParams) => zod.ZodSymbol;
|
|
361
190
|
transformer: <I extends ZodTypeAny>(schema: I, effect: zod.Effect<I["_output"]>, params?: zod.RawCreateParams) => ZodEffects<I, I["_output"]>;
|
|
@@ -365,26 +194,197 @@ declare const z: {
|
|
|
365
194
|
unknown: (params?: zod.RawCreateParams) => zod.ZodUnknown;
|
|
366
195
|
void: (params?: zod.RawCreateParams) => zod.ZodVoid;
|
|
367
196
|
NEVER: never;
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
197
|
+
string: () => ZodString;
|
|
198
|
+
safeString: () => ZodString;
|
|
199
|
+
safeText: () => ZodString;
|
|
200
|
+
safeBusinessStringForOnboarding: () => ZodEffects<ZodString, string, string>;
|
|
201
|
+
safeNameForOnboarding: () => ZodEffects<ZodString, string, string>;
|
|
202
|
+
nonemptyString: () => ZodString;
|
|
203
|
+
alphaNumericString: () => ZodString;
|
|
204
|
+
tableId: () => ZodString;
|
|
205
|
+
uuid: () => ZodString;
|
|
206
|
+
uuidv4: () => ZodEffects<ZodString, string, string>;
|
|
207
|
+
email: () => ZodEffects<ZodString>;
|
|
208
|
+
phoneNumber: () => ZodEffects<ZodEffects<ZodString>>;
|
|
209
|
+
nullablePhoneNumber: () => ZodEffects<ZodEffects<ZodString, string, string>, string | null, string>;
|
|
210
|
+
strongPassword: () => ZodEffects<ZodString, string, string>;
|
|
211
|
+
zipCode: (locale?: validator.PostalCodeLocale) => ZodEffects<ZodString, string>;
|
|
212
|
+
countryCode: () => ZodString;
|
|
213
|
+
moneyDecimalString: (locale?: string) => ZodEffects<ZodString, string, string>;
|
|
214
|
+
moneyFromFloat: () => ZodEffects<ZodEffects<ZodNumber>, Money>;
|
|
215
|
+
moneyFromInt: () => ZodEffects<ZodNumber, Money>;
|
|
216
|
+
convertMoneyFieldsToCurrency: <T extends ZodObject<Record<string, ZodTypeAny>>>(schema: T) => ZodEffects<T>;
|
|
217
|
+
unixTimestamp: () => ZodNumber;
|
|
218
|
+
integerString: (options?: {
|
|
219
|
+
maxLength?: number;
|
|
220
|
+
lt?: number;
|
|
221
|
+
gt?: number;
|
|
222
|
+
transform?: boolean;
|
|
223
|
+
}) => ZodEffects<ZodEffects<ZodType<string, zod.ZodTypeDef, string>, string, string>, number, string>;
|
|
224
|
+
integerStringRaw: (options?: {
|
|
225
|
+
maxLength?: number;
|
|
226
|
+
lt?: number;
|
|
227
|
+
gt?: number;
|
|
228
|
+
transform?: boolean;
|
|
229
|
+
}) => typeof options.transform extends true ? ZodEffects<ZodType<number>> : ZodEffects<ZodType<string>>;
|
|
230
|
+
bigIntegerString: () => ZodEffects<ZodString, string, string>;
|
|
231
|
+
floatString: (options?: {
|
|
232
|
+
maxLength?: number;
|
|
233
|
+
lt: number;
|
|
234
|
+
gt: number;
|
|
235
|
+
}) => ZodEffects<ZodEffects<ZodString, string, string>, number, string>;
|
|
236
|
+
hex: ({ min, max, length, rawLength, }?: {
|
|
237
|
+
min?: number;
|
|
238
|
+
max?: number;
|
|
239
|
+
length?: number;
|
|
240
|
+
rawLength?: number;
|
|
241
|
+
}) => ZodEffects<ZodString, string, string>;
|
|
242
|
+
sha256: () => ZodEffects<ZodString, string, string>;
|
|
243
|
+
base64: ({ min, max, length, rawLength, isBase64Url, }?: {
|
|
244
|
+
min?: number;
|
|
245
|
+
max?: number;
|
|
246
|
+
length?: number;
|
|
247
|
+
rawLength?: number;
|
|
248
|
+
isBase64Url?: boolean;
|
|
249
|
+
}) => ZodEffects<ZodString>;
|
|
250
|
+
bearerToken: () => ZodEffects<ZodEffects<ZodString>>;
|
|
251
|
+
jwt: ({ max }: {
|
|
252
|
+
max: number;
|
|
253
|
+
}) => ZodEffects<ZodString>;
|
|
254
|
+
ecPublicKey: () => ZodEffects<ZodString, string, string>;
|
|
255
|
+
ecCompressedPublicKey: () => ZodEffects<ZodString, string, string>;
|
|
256
|
+
uncompressedECPublicKey: () => ZodEffects<ZodString, string, string>;
|
|
257
|
+
ecSignature: () => ZodEffects<ZodString, string, string>;
|
|
258
|
+
iv: () => ZodEffects<ZodString, string, string>;
|
|
259
|
+
mac: () => ZodEffects<ZodString, string, string>;
|
|
260
|
+
traceId: () => ZodEffects<ZodString, string, string>;
|
|
261
|
+
isoDateString: () => ZodEffects<ZodString, string>;
|
|
262
|
+
rfc3339String: () => ZodEffects<ZodString, string>;
|
|
263
|
+
iso8601Date: () => ZodEffects<ZodString, string, string>;
|
|
264
|
+
urlHttpsString: () => ZodEffects<ZodString, string, string>;
|
|
265
|
+
urlHttpOrHttpsString: () => ZodEffects<ZodString, string, string>;
|
|
266
|
+
language: () => ZodTypeAny;
|
|
267
|
+
dsgcPayload: () => ZodObject<{
|
|
268
|
+
certificates: zod.ZodArray<ZodObject<{
|
|
269
|
+
certificateType: ZodString;
|
|
270
|
+
country: ZodString;
|
|
271
|
+
kid: ZodString;
|
|
272
|
+
rawData: ZodString;
|
|
273
|
+
signature: ZodString;
|
|
274
|
+
thumbprint: ZodString;
|
|
275
|
+
timestamp: ZodString;
|
|
276
|
+
}, "strip", ZodTypeAny, {
|
|
277
|
+
certificateType: string;
|
|
278
|
+
country: string;
|
|
279
|
+
kid: string;
|
|
280
|
+
rawData: string;
|
|
281
|
+
signature: string;
|
|
282
|
+
thumbprint: string;
|
|
283
|
+
timestamp: string;
|
|
284
|
+
}, {
|
|
285
|
+
certificateType: string;
|
|
286
|
+
country: string;
|
|
287
|
+
kid: string;
|
|
288
|
+
rawData: string;
|
|
289
|
+
signature: string;
|
|
290
|
+
thumbprint: string;
|
|
291
|
+
timestamp: string;
|
|
292
|
+
}>, "many">;
|
|
293
|
+
}, "strip", ZodTypeAny, {
|
|
294
|
+
certificates: {
|
|
295
|
+
certificateType: string;
|
|
296
|
+
country: string;
|
|
297
|
+
kid: string;
|
|
298
|
+
rawData: string;
|
|
299
|
+
signature: string;
|
|
300
|
+
thumbprint: string;
|
|
301
|
+
timestamp: string;
|
|
302
|
+
}[];
|
|
303
|
+
}, {
|
|
304
|
+
certificates: {
|
|
305
|
+
certificateType: string;
|
|
306
|
+
country: string;
|
|
307
|
+
kid: string;
|
|
308
|
+
rawData: string;
|
|
309
|
+
signature: string;
|
|
310
|
+
thumbprint: string;
|
|
311
|
+
timestamp: string;
|
|
312
|
+
}[];
|
|
313
|
+
}>;
|
|
314
|
+
dccListPayload: () => zod.ZodArray<ZodObject<{
|
|
315
|
+
identifier: ZodString;
|
|
316
|
+
version: ZodString;
|
|
317
|
+
country: ZodString;
|
|
318
|
+
hash: ZodString;
|
|
319
|
+
}, "strip", ZodTypeAny, {
|
|
320
|
+
identifier: string;
|
|
321
|
+
version: string;
|
|
322
|
+
country: string;
|
|
323
|
+
hash: string;
|
|
324
|
+
}, {
|
|
325
|
+
identifier: string;
|
|
326
|
+
version: string;
|
|
327
|
+
country: string;
|
|
328
|
+
hash: string;
|
|
329
|
+
}>, "many">;
|
|
330
|
+
dccRulePayload: () => ZodObject<{
|
|
331
|
+
Identifier: ZodString;
|
|
332
|
+
Type: ZodString;
|
|
333
|
+
Country: ZodString;
|
|
334
|
+
Version: ZodString;
|
|
335
|
+
SchemaVersion: ZodString;
|
|
336
|
+
Engine: ZodString;
|
|
337
|
+
EngineVersion: ZodString;
|
|
338
|
+
CertificateType: ZodString;
|
|
339
|
+
Description: zod.ZodArray<ZodObject<{
|
|
340
|
+
lang: ZodString;
|
|
341
|
+
desc: ZodString;
|
|
342
|
+
}, "strip", ZodTypeAny, {
|
|
343
|
+
lang: string;
|
|
344
|
+
desc: string;
|
|
345
|
+
}, {
|
|
346
|
+
lang: string;
|
|
347
|
+
desc: string;
|
|
348
|
+
}>, "many">;
|
|
349
|
+
ValidFrom: ZodString;
|
|
350
|
+
ValidTo: ZodString;
|
|
351
|
+
AffectedFields: zod.ZodArray<ZodString, "many">;
|
|
352
|
+
Logic: zod.ZodAny;
|
|
353
|
+
}, "strip", ZodTypeAny, {
|
|
354
|
+
Identifier: string;
|
|
355
|
+
Type: string;
|
|
356
|
+
Country: string;
|
|
357
|
+
Version: string;
|
|
358
|
+
SchemaVersion: string;
|
|
359
|
+
Engine: string;
|
|
360
|
+
EngineVersion: string;
|
|
361
|
+
CertificateType: string;
|
|
362
|
+
Description: {
|
|
363
|
+
lang: string;
|
|
364
|
+
desc: string;
|
|
365
|
+
}[];
|
|
366
|
+
ValidFrom: string;
|
|
367
|
+
ValidTo: string;
|
|
368
|
+
AffectedFields: string[];
|
|
369
|
+
Logic?: any;
|
|
370
|
+
}, {
|
|
371
|
+
Identifier: string;
|
|
372
|
+
Type: string;
|
|
373
|
+
Country: string;
|
|
374
|
+
Version: string;
|
|
375
|
+
SchemaVersion: string;
|
|
376
|
+
Engine: string;
|
|
377
|
+
EngineVersion: string;
|
|
378
|
+
CertificateType: string;
|
|
379
|
+
Description: {
|
|
380
|
+
lang: string;
|
|
381
|
+
desc: string;
|
|
382
|
+
}[];
|
|
383
|
+
ValidFrom: string;
|
|
384
|
+
ValidTo: string;
|
|
385
|
+
AffectedFields: string[];
|
|
386
|
+
Logic?: any;
|
|
387
|
+
}>;
|
|
388
388
|
};
|
|
389
389
|
export * from 'zod';
|
|
390
390
|
export { z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lucaapp/service-utils",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.23.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"@types/response-time": "^2.3.9",
|
|
32
32
|
"@types/swagger-ui-express": "4.1.8",
|
|
33
33
|
"@types/validator": "13.7.1",
|
|
34
|
-
"axios": "1.
|
|
34
|
+
"axios": "1.18.0",
|
|
35
35
|
"axios-rate-limit": "^1.4.0",
|
|
36
36
|
"axios-retry": "^4.5.0",
|
|
37
|
-
"body-parser": "1.20.
|
|
37
|
+
"body-parser": "1.20.6",
|
|
38
38
|
"busboy": "^1.6.0",
|
|
39
39
|
"cls-rtracer": "^2.6.3",
|
|
40
40
|
"express": "4.22.1",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"sequelize": "6.37.8",
|
|
54
54
|
"sqlite3": "6.0.1",
|
|
55
55
|
"swagger-ui-express": "5.0.1",
|
|
56
|
-
"tar": "7.5.
|
|
56
|
+
"tar": "7.5.19",
|
|
57
57
|
"url-value-parser": "^2.2.0",
|
|
58
58
|
"uuid": "^14.0.0",
|
|
59
59
|
"validator": "13.15.23",
|
|
@@ -79,12 +79,14 @@
|
|
|
79
79
|
"semantic-release": "^25.0.3",
|
|
80
80
|
"semantic-release-monorepo": "8.0.2",
|
|
81
81
|
"supertest": "6.3.4",
|
|
82
|
-
"typescript": "
|
|
82
|
+
"@typescript/native": "npm:typescript@7.0.2",
|
|
83
|
+
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
83
84
|
"vite-tsconfig-paths": "4.3.2",
|
|
84
85
|
"vitest": "4.1.1"
|
|
85
86
|
},
|
|
86
87
|
"resolutions": {
|
|
87
|
-
"tar": "7.5.
|
|
88
|
+
"tar": "7.5.19",
|
|
89
|
+
"body-parser": "1.20.6",
|
|
88
90
|
"lodash": "^4.18.1",
|
|
89
91
|
"qs": "6.15.2",
|
|
90
92
|
"dottie": "2.0.7",
|
|
@@ -97,13 +99,13 @@
|
|
|
97
99
|
"node-forge": "1.4.0",
|
|
98
100
|
"uuid": "^14.0.0",
|
|
99
101
|
"follow-redirects": "^1.16.0",
|
|
100
|
-
"axios": "1.
|
|
102
|
+
"axios": "1.18.0",
|
|
101
103
|
"path-to-regexp": "0.1.13",
|
|
102
104
|
"ip-address": "10.1.1",
|
|
103
105
|
"fast-xml-builder": "^1.1.7",
|
|
104
|
-
"brace-expansion": "2.
|
|
106
|
+
"brace-expansion": "2.1.2",
|
|
105
107
|
"form-data": "4.0.6",
|
|
106
|
-
"js-yaml": "4.
|
|
108
|
+
"js-yaml": "4.3.0",
|
|
107
109
|
"@opentelemetry/core": "2.8.0"
|
|
108
110
|
}
|
|
109
111
|
}
|