@go-mondo/identity-sdk 0.0.2-beta.37 → 0.0.2-beta.39

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.
Files changed (45) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/.tsbuildinfo/cjs.json +1 -1
  3. package/.tsbuildinfo/esm.json +1 -1
  4. package/CHANGELOG.md +15 -0
  5. package/dist/cjs/app/authorization/schema.d.ts +3 -3
  6. package/dist/cjs/authentication/settings/schema.test.js +380 -0
  7. package/dist/cjs/authentication/strategies/schema/base.d.ts +1 -0
  8. package/dist/cjs/authentication/strategies/schema/base.d.ts.map +1 -1
  9. package/dist/cjs/authentication/strategies/schema/base.js +1 -0
  10. package/dist/cjs/authentication/strategies/schema/schema.d.ts +3 -0
  11. package/dist/cjs/authentication/strategies/schema/schema.d.ts.map +1 -1
  12. package/dist/cjs/authentication/strategies/schema/types/email.d.ts +1 -0
  13. package/dist/cjs/authentication/strategies/schema/types/email.d.ts.map +1 -1
  14. package/dist/cjs/authentication/strategies/schema/types/email.test.js +1 -0
  15. package/dist/cjs/authentication/strategies/schema/types/password.d.ts +1 -0
  16. package/dist/cjs/authentication/strategies/schema/types/password.d.ts.map +1 -1
  17. package/dist/cjs/authentication/strategies/schema/types/totp.d.ts +1 -0
  18. package/dist/cjs/authentication/strategies/schema/types/totp.d.ts.map +1 -1
  19. package/dist/cjs/common/schema/sets.d.ts +2 -2
  20. package/dist/cjs/common/schema/sets.d.ts.map +1 -1
  21. package/dist/cjs/common/schema/sets.js +2 -2
  22. package/dist/cjs/common/schema/url.d.ts +7 -0
  23. package/dist/cjs/common/schema/url.d.ts.map +1 -1
  24. package/dist/cjs/common/schema/url.js +43 -0
  25. package/dist/esm/app/authorization/schema.d.ts +3 -3
  26. package/dist/esm/authentication/settings/schema.test.js +380 -0
  27. package/dist/esm/authentication/strategies/schema/base.d.ts +1 -0
  28. package/dist/esm/authentication/strategies/schema/base.d.ts.map +1 -1
  29. package/dist/esm/authentication/strategies/schema/base.js +1 -0
  30. package/dist/esm/authentication/strategies/schema/schema.d.ts +3 -0
  31. package/dist/esm/authentication/strategies/schema/schema.d.ts.map +1 -1
  32. package/dist/esm/authentication/strategies/schema/types/email.d.ts +1 -0
  33. package/dist/esm/authentication/strategies/schema/types/email.d.ts.map +1 -1
  34. package/dist/esm/authentication/strategies/schema/types/email.test.js +1 -0
  35. package/dist/esm/authentication/strategies/schema/types/password.d.ts +1 -0
  36. package/dist/esm/authentication/strategies/schema/types/password.d.ts.map +1 -1
  37. package/dist/esm/authentication/strategies/schema/types/totp.d.ts +1 -0
  38. package/dist/esm/authentication/strategies/schema/types/totp.d.ts.map +1 -1
  39. package/dist/esm/common/schema/sets.d.ts +2 -2
  40. package/dist/esm/common/schema/sets.d.ts.map +1 -1
  41. package/dist/esm/common/schema/sets.js +2 -2
  42. package/dist/esm/common/schema/url.d.ts +7 -0
  43. package/dist/esm/common/schema/url.d.ts.map +1 -1
  44. package/dist/esm/common/schema/url.js +9 -0
  45. package/package.json +1 -1
@@ -1,6 +1,41 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.UrlStringSchema = exports.UrlObjectSchema = void 0;
3
37
  exports.appendSearchParams = appendSearchParams;
38
+ const z = __importStar(require("zod/v4"));
4
39
  function appendSearchParams(path, params) {
5
40
  const vals = Array.from(params.entries()).reduce((result, [key, val]) => {
6
41
  if (val) {
@@ -10,3 +45,11 @@ function appendSearchParams(path, params) {
10
45
  }, []);
11
46
  return [path, vals.filter(Boolean).join('&')].filter(Boolean).join('?');
12
47
  }
48
+ exports.UrlObjectSchema = z
49
+ .url()
50
+ .pipe(z.transform((url) => new URL(url)))
51
+ .or(z.instanceof(URL));
52
+ exports.UrlStringSchema = z
53
+ .instanceof(URL)
54
+ .pipe(z.transform((url) => url.toString()))
55
+ .or(z.url());
@@ -5,7 +5,7 @@ export declare const AuthorizationSchema: z.ZodObject<{
5
5
  deactivatedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>;
6
6
  deletedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>;
7
7
  loginUri: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodUndefined]>>;
8
- callbackUrls: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodUnion<[z.ZodArray<z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>>, z.ZodArray<z.ZodCustom<URL, URL>>]>, z.ZodTransform<URL[], URL[]>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<Set<URL> | undefined, Set<URL> | URL[] | undefined>>>;
8
+ callbackUrls: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodUnion<[z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>, z.ZodCustom<URL, URL>]>>, z.ZodTransform<URL[], URL[]>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<Set<URL> | undefined, Set<URL> | URL[] | undefined>>>;
9
9
  availableAudiences: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.ZodSet<z.ZodString>]>, z.ZodTransform<Set<string> | undefined, Set<string> | string[] | undefined>>>;
10
10
  availableGrants: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodEnum<{
11
11
  client_credentials: "client_credentials";
@@ -39,7 +39,7 @@ export declare const AuthorizationPayloadSchema: z.ZodObject<{
39
39
  deactivatedAt: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>, z.ZodTransform<string | undefined, Date | undefined>>>;
40
40
  deletedAt: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>, z.ZodTransform<string | undefined, Date | undefined>>>;
41
41
  loginUri: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodUndefined]>>;
42
- callbackUrls: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodUnion<[z.ZodArray<z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>>, z.ZodArray<z.ZodCustom<URL, URL>>]>, z.ZodTransform<URL[], URL[]>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<URL[] | undefined, Set<URL> | URL[] | undefined>>>;
42
+ callbackUrls: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodUnion<[z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>, z.ZodCustom<URL, URL>]>>, z.ZodTransform<URL[], URL[]>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<URL[] | undefined, Set<URL> | URL[] | undefined>>>;
43
43
  availableAudiences: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.ZodSet<z.ZodString>]>, z.ZodTransform<string[] | undefined, Set<string> | string[] | undefined>>>;
44
44
  availableGrants: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodEnum<{
45
45
  client_credentials: "client_credentials";
@@ -70,7 +70,7 @@ export type AuthorizationPayload = z.output<typeof AuthorizationPayloadSchema>;
70
70
  export declare const UpsertAuthorizationPayloadSchema: z.ZodObject<{
71
71
  metadata: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodNull, z.ZodCustom<Map<string, string | number | boolean>, Map<string, string | number | boolean>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>, z.ZodTransform<Record<string, string | number | boolean> | null | undefined, Record<string, string | number | boolean> | Map<string, string | number | boolean> | null | undefined>>>;
72
72
  loginUri: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodUndefined]>>;
73
- callbackUrls: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodUnion<[z.ZodArray<z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>>, z.ZodArray<z.ZodCustom<URL, URL>>]>, z.ZodTransform<URL[], URL[]>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<URL[] | undefined, Set<URL> | URL[] | undefined>>>;
73
+ callbackUrls: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodUnion<[z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>, z.ZodCustom<URL, URL>]>>, z.ZodTransform<URL[], URL[]>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<URL[] | undefined, Set<URL> | URL[] | undefined>>>;
74
74
  availableAudiences: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.ZodSet<z.ZodString>]>, z.ZodTransform<string[] | undefined, Set<string> | string[] | undefined>>>;
75
75
  availableGrants: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodEnum<{
76
76
  client_credentials: "client_credentials";
@@ -1,4 +1,5 @@
1
1
  import { describe, expect, test } from 'vitest';
2
+ import { generateStrategyId } from '../utils.js';
2
3
  import { SettingsSchema, SettingsPayloadSchema, UpsertSettingsPayloadSchema, } from './schema.js';
3
4
  describe('Authentication Settings - Schema', () => {
4
5
  describe('SettingsSchema', () => {
@@ -20,6 +21,156 @@ describe('Authentication Settings - Schema', () => {
20
21
  const result = SettingsSchema.safeParse(settings);
21
22
  expect(result.success).toBe(false);
22
23
  });
24
+ test('should accept settings with factors', () => {
25
+ const settings = {
26
+ factors: [
27
+ {
28
+ id: generateStrategyId(),
29
+ },
30
+ ],
31
+ updatedAt: new Date(),
32
+ metadata: {},
33
+ };
34
+ const result = SettingsSchema.safeParse(settings);
35
+ expect(result.success).toBe(true);
36
+ if (result.success) {
37
+ expect(result.data.factors).toHaveLength(1);
38
+ expect(result.data.factors?.[0].id).toMatch(/^stg_[A-Za-z0-9]+$/);
39
+ }
40
+ });
41
+ test('should accept settings with nested factors', () => {
42
+ const settings = {
43
+ factors: [
44
+ {
45
+ id: generateStrategyId(),
46
+ nextFactors: [
47
+ {
48
+ id: generateStrategyId(),
49
+ },
50
+ ],
51
+ },
52
+ ],
53
+ updatedAt: new Date(),
54
+ metadata: {},
55
+ };
56
+ const result = SettingsSchema.safeParse(settings);
57
+ expect(result.success).toBe(true);
58
+ if (result.success) {
59
+ expect(result.data.factors?.[0].nextFactors).toHaveLength(1);
60
+ }
61
+ });
62
+ test('should accept settings with undefined factors', () => {
63
+ const settings = {
64
+ factors: undefined,
65
+ updatedAt: new Date(),
66
+ metadata: {},
67
+ };
68
+ const result = SettingsSchema.safeParse(settings);
69
+ expect(result.success).toBe(true);
70
+ if (result.success) {
71
+ expect(result.data.factors).toBeUndefined();
72
+ }
73
+ });
74
+ test('should accept settings with null factors (transforms to undefined)', () => {
75
+ const settings = {
76
+ factors: null,
77
+ updatedAt: new Date(),
78
+ metadata: {},
79
+ };
80
+ const result = SettingsSchema.safeParse(settings);
81
+ expect(result.success).toBe(true);
82
+ if (result.success) {
83
+ expect(result.data.factors).toBeUndefined();
84
+ }
85
+ });
86
+ test('should accept settings with multiple factors', () => {
87
+ const settings = {
88
+ factors: [
89
+ { id: generateStrategyId() },
90
+ { id: generateStrategyId() },
91
+ { id: generateStrategyId() },
92
+ ],
93
+ updatedAt: new Date(),
94
+ metadata: {},
95
+ };
96
+ const result = SettingsSchema.safeParse(settings);
97
+ expect(result.success).toBe(true);
98
+ if (result.success) {
99
+ expect(result.data.factors).toHaveLength(3);
100
+ }
101
+ });
102
+ test('should accept settings with deeply nested factors', () => {
103
+ const settings = {
104
+ factors: [
105
+ {
106
+ id: generateStrategyId(),
107
+ nextFactors: [
108
+ {
109
+ id: generateStrategyId(),
110
+ nextFactors: [
111
+ {
112
+ id: generateStrategyId(),
113
+ },
114
+ ],
115
+ },
116
+ ],
117
+ },
118
+ ],
119
+ updatedAt: new Date(),
120
+ metadata: {},
121
+ };
122
+ const result = SettingsSchema.safeParse(settings);
123
+ expect(result.success).toBe(true);
124
+ if (result.success) {
125
+ expect(result.data.factors?.[0].nextFactors?.[0].nextFactors).toHaveLength(1);
126
+ }
127
+ });
128
+ test('should reject settings with invalid factor id', () => {
129
+ const settings = {
130
+ factors: [
131
+ {
132
+ id: 'invalid-id',
133
+ },
134
+ ],
135
+ updatedAt: new Date(),
136
+ metadata: {},
137
+ };
138
+ const result = SettingsSchema.safeParse(settings);
139
+ expect(result.success).toBe(false);
140
+ });
141
+ test('should reject settings with factors as object instead of array', () => {
142
+ const settings = {
143
+ factors: { id: generateStrategyId() },
144
+ updatedAt: new Date(),
145
+ metadata: {},
146
+ };
147
+ const result = SettingsSchema.safeParse(settings);
148
+ expect(result.success).toBe(false);
149
+ });
150
+ test('should accept settings with deletedAt', () => {
151
+ const settings = {
152
+ updatedAt: new Date(),
153
+ deletedAt: new Date(),
154
+ metadata: {},
155
+ };
156
+ const result = SettingsSchema.safeParse(settings);
157
+ expect(result.success).toBe(true);
158
+ if (result.success) {
159
+ expect(result.data.deletedAt).toBeDefined();
160
+ }
161
+ });
162
+ test('should accept settings with deactivatedAt', () => {
163
+ const settings = {
164
+ updatedAt: new Date(),
165
+ deactivatedAt: new Date(),
166
+ metadata: {},
167
+ };
168
+ const result = SettingsSchema.safeParse(settings);
169
+ expect(result.success).toBe(true);
170
+ if (result.success) {
171
+ expect(result.data.deactivatedAt).toBeDefined();
172
+ }
173
+ });
23
174
  });
24
175
  describe('SettingsPayloadSchema', () => {
25
176
  test('should accept minimal payload', () => {
@@ -50,6 +201,90 @@ describe('Authentication Settings - Schema', () => {
50
201
  // Parse succeeds for valid data
51
202
  expect(result.success).toBe(true);
52
203
  });
204
+ test('should accept payload with factors', () => {
205
+ const payload = {
206
+ factors: [
207
+ {
208
+ id: generateStrategyId(),
209
+ },
210
+ ],
211
+ metadata: {},
212
+ };
213
+ const result = SettingsPayloadSchema.safeParse(payload);
214
+ expect(result.success).toBe(true);
215
+ if (result.success) {
216
+ expect(result.data.factors).toHaveLength(1);
217
+ }
218
+ });
219
+ test('should accept payload with nested factors', () => {
220
+ const payload = {
221
+ factors: [
222
+ {
223
+ id: generateStrategyId(),
224
+ nextFactors: [
225
+ {
226
+ id: generateStrategyId(),
227
+ nextFactors: [
228
+ {
229
+ id: generateStrategyId(),
230
+ },
231
+ ],
232
+ },
233
+ ],
234
+ },
235
+ ],
236
+ metadata: {},
237
+ };
238
+ const result = SettingsPayloadSchema.safeParse(payload);
239
+ expect(result.success).toBe(true);
240
+ if (result.success) {
241
+ expect(result.data.factors?.[0].nextFactors).toBeDefined();
242
+ }
243
+ });
244
+ test('should accept payload with null factors (transforms to undefined)', () => {
245
+ const payload = {
246
+ factors: null,
247
+ metadata: {},
248
+ };
249
+ const result = SettingsPayloadSchema.safeParse(payload);
250
+ expect(result.success).toBe(true);
251
+ if (result.success) {
252
+ expect(result.data.factors).toBeUndefined();
253
+ }
254
+ });
255
+ test('should accept payload with undefined factors', () => {
256
+ const payload = {
257
+ factors: undefined,
258
+ metadata: {},
259
+ };
260
+ const result = SettingsPayloadSchema.safeParse(payload);
261
+ expect(result.success).toBe(true);
262
+ if (result.success) {
263
+ expect(result.data.factors).toBeUndefined();
264
+ }
265
+ });
266
+ test('should reject payload with invalid factor structure', () => {
267
+ const payload = {
268
+ factors: [{ id: 123 }],
269
+ metadata: {},
270
+ };
271
+ const result = SettingsPayloadSchema.safeParse(payload);
272
+ expect(result.success).toBe(false);
273
+ });
274
+ test('should accept payload with deletedAt and deactivatedAt', () => {
275
+ const payload = {
276
+ updatedAt: new Date().toISOString(),
277
+ deletedAt: new Date().toISOString(),
278
+ deactivatedAt: new Date().toISOString(),
279
+ metadata: {},
280
+ };
281
+ const result = SettingsPayloadSchema.safeParse(payload);
282
+ expect(result.success).toBe(true);
283
+ if (result.success) {
284
+ expect(result.data.deletedAt).toBeDefined();
285
+ expect(result.data.deactivatedAt).toBeDefined();
286
+ }
287
+ });
53
288
  });
54
289
  describe('UpsertSettingsPayloadSchema', () => {
55
290
  test('should accept empty upsert payload', () => {
@@ -76,5 +311,150 @@ describe('Authentication Settings - Schema', () => {
76
311
  const result = UpsertSettingsPayloadSchema.safeParse(payload);
77
312
  expect(result.success).toBe(false);
78
313
  });
314
+ test('should accept upsert with factors array', () => {
315
+ const payload = {
316
+ factors: [
317
+ {
318
+ id: generateStrategyId(),
319
+ },
320
+ ],
321
+ };
322
+ const result = UpsertSettingsPayloadSchema.safeParse(payload);
323
+ expect(result.success).toBe(true);
324
+ if (result.success) {
325
+ expect(result.data.factors).toHaveLength(1);
326
+ }
327
+ });
328
+ test('should accept upsert with nested factors', () => {
329
+ const payload = {
330
+ factors: [
331
+ {
332
+ id: generateStrategyId(),
333
+ nextFactors: [
334
+ {
335
+ id: generateStrategyId(),
336
+ },
337
+ ],
338
+ },
339
+ ],
340
+ };
341
+ const result = UpsertSettingsPayloadSchema.safeParse(payload);
342
+ expect(result.success).toBe(true);
343
+ if (result.success) {
344
+ expect(result.data.factors?.[0].nextFactors).toHaveLength(1);
345
+ }
346
+ });
347
+ test('should accept upsert with multiple top-level factors', () => {
348
+ const payload = {
349
+ factors: [{ id: generateStrategyId() }, { id: generateStrategyId() }],
350
+ };
351
+ const result = UpsertSettingsPayloadSchema.safeParse(payload);
352
+ expect(result.success).toBe(true);
353
+ if (result.success) {
354
+ expect(result.data.factors).toHaveLength(2);
355
+ }
356
+ });
357
+ test('should accept upsert with null factors', () => {
358
+ const payload = {
359
+ factors: null,
360
+ };
361
+ const result = UpsertSettingsPayloadSchema.safeParse(payload);
362
+ expect(result.success).toBe(true);
363
+ });
364
+ test('should accept upsert with undefined factors', () => {
365
+ const payload = {
366
+ factors: undefined,
367
+ };
368
+ const result = UpsertSettingsPayloadSchema.safeParse(payload);
369
+ expect(result.success).toBe(true);
370
+ });
371
+ test('should accept upsert with deeply nested factors', () => {
372
+ const payload = {
373
+ factors: [
374
+ {
375
+ id: generateStrategyId(),
376
+ nextFactors: [
377
+ {
378
+ id: generateStrategyId(),
379
+ nextFactors: [
380
+ {
381
+ id: generateStrategyId(),
382
+ nextFactors: [
383
+ {
384
+ id: generateStrategyId(),
385
+ },
386
+ ],
387
+ },
388
+ ],
389
+ },
390
+ ],
391
+ },
392
+ ],
393
+ };
394
+ const result = UpsertSettingsPayloadSchema.safeParse(payload);
395
+ expect(result.success).toBe(true);
396
+ if (result.success) {
397
+ const firstFactor = result.data.factors?.[0];
398
+ expect(firstFactor?.nextFactors?.[0].nextFactors?.[0].nextFactors).toHaveLength(1);
399
+ }
400
+ });
401
+ test('should reject upsert with invalid factor id type', () => {
402
+ const payload = {
403
+ factors: [
404
+ {
405
+ id: 12345,
406
+ },
407
+ ],
408
+ };
409
+ const result = UpsertSettingsPayloadSchema.safeParse(payload);
410
+ expect(result.success).toBe(false);
411
+ });
412
+ test('should reject upsert with factors as single object', () => {
413
+ const payload = {
414
+ factors: {
415
+ id: generateStrategyId(),
416
+ },
417
+ };
418
+ const result = UpsertSettingsPayloadSchema.safeParse(payload);
419
+ expect(result.success).toBe(false);
420
+ });
421
+ test('should reject upsert with invalid nextFactors type', () => {
422
+ const payload = {
423
+ factors: [
424
+ {
425
+ id: generateStrategyId(),
426
+ nextFactors: 'invalid',
427
+ },
428
+ ],
429
+ };
430
+ const result = UpsertSettingsPayloadSchema.safeParse(payload);
431
+ expect(result.success).toBe(false);
432
+ });
433
+ test('should accept upsert with factors and metadata together', () => {
434
+ const payload = {
435
+ factors: [
436
+ {
437
+ id: generateStrategyId(),
438
+ },
439
+ ],
440
+ metadata: { key: 'value' },
441
+ };
442
+ const result = UpsertSettingsPayloadSchema.safeParse(payload);
443
+ expect(result.success).toBe(true);
444
+ if (result.success) {
445
+ expect(result.data.factors).toHaveLength(1);
446
+ expect(result.data.metadata).toEqual({ key: 'value' });
447
+ }
448
+ });
449
+ test('should accept upsert with empty factors array', () => {
450
+ const payload = {
451
+ factors: [],
452
+ };
453
+ const result = UpsertSettingsPayloadSchema.safeParse(payload);
454
+ expect(result.success).toBe(true);
455
+ if (result.success) {
456
+ expect(result.data.factors).toHaveLength(0);
457
+ }
458
+ });
79
459
  });
80
460
  });
@@ -45,6 +45,7 @@ export declare const BaseStrategyPayloadSchema: z.ZodObject<{
45
45
  deletedAt: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>, z.ZodTransform<string | undefined, Date | undefined>>>;
46
46
  updatedAt: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
47
47
  createdAt: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
48
+ id: z.ZodString;
48
49
  status: z.ZodEnum<{
49
50
  enabled: "enabled";
50
51
  disabled: "disabled";
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../../src/authentication/strategies/schema/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAkB5B,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE/E,eAAO,MAAM,cAAc;;;CAGjB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAC3B,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEvD,eAAO,MAAM,gBAAgB,aAAwC,CAAC;AACtE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3D,eAAO,MAAM,wBAAwB;;iBAEnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,wBAA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O,MAAM,+BAA+B;;;;;;;;iBAK1C,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;;iBAI1C,CAAC"}
@@ -37,6 +37,7 @@ export const BaseStrategySchema = z.object({
37
37
  ...MetadataMapPropertySchema.shape,
38
38
  });
39
39
  export const BaseStrategyPayloadSchema = z.object({
40
+ id: StrategyIdSchema,
40
41
  status: StrategyStatusSchema,
41
42
  label: StrategyLabelSchema,
42
43
  ...CreatedAtPropertyPayloadSchema.shape,
@@ -110,6 +110,7 @@ export declare const StrategyPayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject
110
110
  deletedAt: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>, z.ZodTransform<string | undefined, Date | undefined>>>;
111
111
  updatedAt: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
112
112
  createdAt: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
113
+ id: z.ZodString;
113
114
  status: z.ZodEnum<{
114
115
  enabled: "enabled";
115
116
  disabled: "disabled";
@@ -122,6 +123,7 @@ export declare const StrategyPayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject
122
123
  deletedAt: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>, z.ZodTransform<string | undefined, Date | undefined>>>;
123
124
  updatedAt: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
124
125
  createdAt: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
126
+ id: z.ZodString;
125
127
  status: z.ZodEnum<{
126
128
  enabled: "enabled";
127
129
  disabled: "disabled";
@@ -141,6 +143,7 @@ export declare const StrategyPayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject
141
143
  deletedAt: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>, z.ZodTransform<string | undefined, Date | undefined>>>;
142
144
  updatedAt: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
143
145
  createdAt: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
146
+ id: z.ZodString;
144
147
  status: z.ZodEnum<{
145
148
  enabled: "enabled";
146
149
  disabled: "disabled";
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../../src/authentication/strategies/schema/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAqB5B;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAItC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAC9E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAC1C,OAAO,2BAA2B,CACnC,CAAC;AAEF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAItC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAC9E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAItC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAC9E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAC1C,OAAO,2BAA2B,CACnC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAIhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAIzB,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAChE,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC;AAEvD,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,+BAA+B,EAC/B,wBAAwB,EACxB,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,kBAAkB,GACxB,MAAM,WAAW,CAAC;AACnB,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC"}
@@ -22,6 +22,7 @@ export declare const EmailStrategyPayloadSchema: z.ZodObject<{
22
22
  deletedAt: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>, z.ZodTransform<string | undefined, Date | undefined>>>;
23
23
  updatedAt: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
24
24
  createdAt: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
25
+ id: z.ZodString;
25
26
  status: z.ZodEnum<{
26
27
  enabled: "enabled";
27
28
  disabled: "disabled";
@@ -1 +1 @@
1
- {"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../../../../../src/authentication/strategies/schema/types/email.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAa5B,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;iBAG9B,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAC1E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEjE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;iBAGrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE/E,eAAO,MAAM,gCAAgC;;;;;;;;;iBAG3C,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,gCAAgC,CACxC,CAAC;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAC/C,OAAO,gCAAgC,CACxC,CAAC;AAEF,eAAO,MAAM,gCAAgC;;;;;;;;iBAG3C,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,gCAAgC,CACxC,CAAC;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAC/C,OAAO,gCAAgC,CACxC,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;iBAG5B,CAAC;AAEH,eAAO,MAAM,+BAA+B;;iBAE1C,CAAC"}
1
+ {"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../../../../../src/authentication/strategies/schema/types/email.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAa5B,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;iBAG9B,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAC1E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEjE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;iBAGrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE/E,eAAO,MAAM,gCAAgC;;;;;;;;;iBAG3C,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,gCAAgC,CACxC,CAAC;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAC/C,OAAO,gCAAgC,CACxC,CAAC;AAEF,eAAO,MAAM,gCAAgC;;;;;;;;iBAG3C,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,gCAAgC,CACxC,CAAC;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAC/C,OAAO,gCAAgC,CACxC,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;iBAG5B,CAAC;AAEH,eAAO,MAAM,+BAA+B;;iBAE1C,CAAC"}
@@ -40,6 +40,7 @@ describe('Authentication Strategies - Email', () => {
40
40
  describe('EmailStrategyPayloadSchema', () => {
41
41
  test('should accept complete payload', () => {
42
42
  const payload = {
43
+ id: generateStrategyId(),
43
44
  type: 'email',
44
45
  label: 'Test',
45
46
  status: 'enabled',
@@ -70,6 +70,7 @@ export declare const PasswordStrategyPayloadSchema: z.ZodObject<{
70
70
  deletedAt: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>, z.ZodTransform<string | undefined, Date | undefined>>>;
71
71
  updatedAt: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
72
72
  createdAt: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
73
+ id: z.ZodString;
73
74
  status: z.ZodEnum<{
74
75
  enabled: "enabled";
75
76
  disabled: "disabled";
@@ -1 +1 @@
1
- {"version":3,"file":"password.d.ts","sourceRoot":"","sources":["../../../../../../src/authentication/strategies/schema/types/password.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAU5B,eAAO,MAAM,sBAAsB;;;;;;;CAOlC,CAAC;AAMF,eAAO,MAAM,oBAAoB;;;;;;;iBAO/B,CAAC;AAMH,eAAO,MAAM,sCAAsC;;;;;;;;;;;iBAEjD,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;iBAIjC,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAChF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEvE,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;iBAIxC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAC5C,OAAO,6BAA6B,CACrC,CAAC;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;iBAI9C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,mCAAmC,CAC3C,CAAC;AACF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAClD,OAAO,mCAAmC,CAC3C,CAAC;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;iBAI9C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,mCAAmC,CAC3C,CAAC;AACF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAClD,OAAO,mCAAmC,CAC3C,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;iBAG/B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;iBAI/B,CAAC"}
1
+ {"version":3,"file":"password.d.ts","sourceRoot":"","sources":["../../../../../../src/authentication/strategies/schema/types/password.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAU5B,eAAO,MAAM,sBAAsB;;;;;;;CAOlC,CAAC;AAMF,eAAO,MAAM,oBAAoB;;;;;;;iBAO/B,CAAC;AAMH,eAAO,MAAM,sCAAsC;;;;;;;;;;;iBAEjD,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;iBAIjC,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAChF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEvE,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;iBAIxC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAC5C,OAAO,6BAA6B,CACrC,CAAC;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;iBAI9C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,mCAAmC,CAC3C,CAAC;AACF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAClD,OAAO,mCAAmC,CAC3C,CAAC;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;iBAI9C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,mCAAmC,CAC3C,CAAC;AACF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAClD,OAAO,mCAAmC,CAC3C,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;iBAG/B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;iBAI/B,CAAC"}
@@ -69,6 +69,7 @@ export declare const TOTPStrategyPayloadSchema: z.ZodObject<{
69
69
  deletedAt: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>, z.ZodTransform<string | undefined, Date | undefined>>>;
70
70
  updatedAt: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
71
71
  createdAt: z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>, z.ZodTransform<string, Date>>;
72
+ id: z.ZodString;
72
73
  status: z.ZodEnum<{
73
74
  enabled: "enabled";
74
75
  disabled: "disabled";
@@ -1 +1 @@
1
- {"version":3,"file":"totp.d.ts","sourceRoot":"","sources":["../../../../../../src/authentication/strategies/schema/types/totp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAS5B,eAAO,MAAM,cAAc,IAAI,CAAC;AAChC,eAAO,MAAM,cAAc,KAAK,CAAC;AAMjC,eAAO,MAAM,aAAa;;;;;;;;;;;CA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C,OAAO,+BAA+B,CACvC,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;iBAI1C,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,+BAA+B,CACvC,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAC9C,OAAO,+BAA+B,CACvC,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;iBAG7B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;iBAE3B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import * as z from 'zod/v4';
2
2
  export declare const UniqueStringArraySchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.ZodSet<z.ZodString>]>, z.ZodTransform<string[] | undefined, Set<string> | string[] | undefined>>;
3
3
  export declare const UniqueStringSetSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.ZodSet<z.ZodString>]>, z.ZodTransform<Set<string> | undefined, Set<string> | string[] | undefined>>;
4
- export declare const UniqueUrlArraySchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodUnion<[z.ZodArray<z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>>, z.ZodArray<z.ZodCustom<URL, URL>>]>, z.ZodTransform<URL[], URL[]>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<URL[] | undefined, Set<URL> | URL[] | undefined>>;
5
- export declare const UniqueUrlSetSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodUnion<[z.ZodArray<z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>>, z.ZodArray<z.ZodCustom<URL, URL>>]>, z.ZodTransform<URL[], URL[]>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<Set<URL> | undefined, Set<URL> | URL[] | undefined>>;
4
+ export declare const UniqueUrlArraySchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodUnion<[z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>, z.ZodCustom<URL, URL>]>>, z.ZodTransform<URL[], URL[]>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<URL[] | undefined, Set<URL> | URL[] | undefined>>;
5
+ export declare const UniqueUrlSetSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodUnion<[z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>, z.ZodCustom<URL, URL>]>>, z.ZodTransform<URL[], URL[]>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<Set<URL> | undefined, Set<URL> | URL[] | undefined>>;
6
6
  //# sourceMappingURL=sets.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sets.d.ts","sourceRoot":"","sources":["../../../../src/common/schema/sets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAQ5B,eAAO,MAAM,uBAAuB,2NAEwC,CAAC;AAE7E,eAAO,MAAM,qBAAqB,8NAEoC,CAAC;AAQvE,eAAO,MAAM,oBAAoB,4SAE2C,CAAC;AAE7E,eAAO,MAAM,kBAAkB,+SAEuC,CAAC"}
1
+ {"version":3,"file":"sets.d.ts","sourceRoot":"","sources":["../../../../src/common/schema/sets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAU5B,eAAO,MAAM,uBAAuB,2NAEwC,CAAC;AAE7E,eAAO,MAAM,qBAAqB,8NAEoC,CAAC;AAOvE,eAAO,MAAM,oBAAoB,gSAE2C,CAAC;AAE7E,eAAO,MAAM,kBAAkB,mSAEuC,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import * as z from 'zod/v4';
2
+ import { UrlObjectSchema } from './url.js';
2
3
  const StringSetTypeSchema = z.set(z.string());
3
4
  // const UrlStringSchema = type('string.url[]').pipe((v) => v?.filter((i) => !!i));
4
5
  const StringArrayTypeSchema = z
@@ -12,8 +13,7 @@ export const UniqueStringSetSchema = z
12
13
  .pipe(z.transform((v) => (!v || v instanceof Set ? v : new Set(v))));
13
14
  const UrlSetTypeSchema = z.instanceof((Set));
14
15
  const UrlArrayTypeScheama = z
15
- .array(z.url().pipe(z.transform((url) => new URL(url))))
16
- .or(z.array(z.instanceof(URL)))
16
+ .array(UrlObjectSchema)
17
17
  .pipe(z.transform((v) => v?.filter((i) => !!i)));
18
18
  export const UniqueUrlArraySchema = z
19
19
  .union([z.undefined(), UrlArrayTypeScheama, UrlSetTypeSchema])