@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.
- package/.release-please-manifest.json +1 -1
- package/.tsbuildinfo/cjs.json +1 -1
- package/.tsbuildinfo/esm.json +1 -1
- package/CHANGELOG.md +15 -0
- package/dist/cjs/app/authorization/schema.d.ts +3 -3
- package/dist/cjs/authentication/settings/schema.test.js +380 -0
- package/dist/cjs/authentication/strategies/schema/base.d.ts +1 -0
- package/dist/cjs/authentication/strategies/schema/base.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/schema/base.js +1 -0
- package/dist/cjs/authentication/strategies/schema/schema.d.ts +3 -0
- package/dist/cjs/authentication/strategies/schema/schema.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/schema/types/email.d.ts +1 -0
- package/dist/cjs/authentication/strategies/schema/types/email.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/schema/types/email.test.js +1 -0
- package/dist/cjs/authentication/strategies/schema/types/password.d.ts +1 -0
- package/dist/cjs/authentication/strategies/schema/types/password.d.ts.map +1 -1
- package/dist/cjs/authentication/strategies/schema/types/totp.d.ts +1 -0
- package/dist/cjs/authentication/strategies/schema/types/totp.d.ts.map +1 -1
- package/dist/cjs/common/schema/sets.d.ts +2 -2
- package/dist/cjs/common/schema/sets.d.ts.map +1 -1
- package/dist/cjs/common/schema/sets.js +2 -2
- package/dist/cjs/common/schema/url.d.ts +7 -0
- package/dist/cjs/common/schema/url.d.ts.map +1 -1
- package/dist/cjs/common/schema/url.js +43 -0
- package/dist/esm/app/authorization/schema.d.ts +3 -3
- package/dist/esm/authentication/settings/schema.test.js +380 -0
- package/dist/esm/authentication/strategies/schema/base.d.ts +1 -0
- package/dist/esm/authentication/strategies/schema/base.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/schema/base.js +1 -0
- package/dist/esm/authentication/strategies/schema/schema.d.ts +3 -0
- package/dist/esm/authentication/strategies/schema/schema.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/schema/types/email.d.ts +1 -0
- package/dist/esm/authentication/strategies/schema/types/email.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/schema/types/email.test.js +1 -0
- package/dist/esm/authentication/strategies/schema/types/password.d.ts +1 -0
- package/dist/esm/authentication/strategies/schema/types/password.d.ts.map +1 -1
- package/dist/esm/authentication/strategies/schema/types/totp.d.ts +1 -0
- package/dist/esm/authentication/strategies/schema/types/totp.d.ts.map +1 -1
- package/dist/esm/common/schema/sets.d.ts +2 -2
- package/dist/esm/common/schema/sets.d.ts.map +1 -1
- package/dist/esm/common/schema/sets.js +2 -2
- package/dist/esm/common/schema/url.d.ts +7 -0
- package/dist/esm/common/schema/url.d.ts.map +1 -1
- package/dist/esm/common/schema/url.js +9 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.2-beta.39](https://github.com/go-mondo/identity-node-sdk/compare/identity-sdk-v0.0.2-beta.38...identity-sdk-v0.0.2-beta.39) (2025-11-01)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* auth strategy ([b33449c](https://github.com/go-mondo/identity-node-sdk/commit/b33449cf88470cdca7a7e781cf68aafddaff1a21))
|
|
9
|
+
|
|
10
|
+
## [0.0.2-beta.38](https://github.com/go-mondo/identity-node-sdk/compare/identity-sdk-v0.0.2-beta.37...identity-sdk-v0.0.2-beta.38) (2025-10-31)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* url schemas ([b990b8a](https://github.com/go-mondo/identity-node-sdk/commit/b990b8a0532d11783f9bfadfd8358fe17c7540f6))
|
|
16
|
+
* url sets ([cad2821](https://github.com/go-mondo/identity-node-sdk/commit/cad28212526f1336724406adf10040a0813d2589))
|
|
17
|
+
|
|
3
18
|
## [0.0.2-beta.37](https://github.com/go-mondo/identity-node-sdk/compare/identity-sdk-v0.0.2-beta.36...identity-sdk-v0.0.2-beta.37) (2025-10-19)
|
|
4
19
|
|
|
5
20
|
|
|
@@ -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.
|
|
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.
|
|
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.
|
|
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,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const vitest_1 = require("vitest");
|
|
4
|
+
const utils_js_1 = require("../utils.js");
|
|
4
5
|
const schema_js_1 = require("./schema.js");
|
|
5
6
|
(0, vitest_1.describe)('Authentication Settings - Schema', () => {
|
|
6
7
|
(0, vitest_1.describe)('SettingsSchema', () => {
|
|
@@ -22,6 +23,156 @@ const schema_js_1 = require("./schema.js");
|
|
|
22
23
|
const result = schema_js_1.SettingsSchema.safeParse(settings);
|
|
23
24
|
(0, vitest_1.expect)(result.success).toBe(false);
|
|
24
25
|
});
|
|
26
|
+
(0, vitest_1.test)('should accept settings with factors', () => {
|
|
27
|
+
const settings = {
|
|
28
|
+
factors: [
|
|
29
|
+
{
|
|
30
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
updatedAt: new Date(),
|
|
34
|
+
metadata: {},
|
|
35
|
+
};
|
|
36
|
+
const result = schema_js_1.SettingsSchema.safeParse(settings);
|
|
37
|
+
(0, vitest_1.expect)(result.success).toBe(true);
|
|
38
|
+
if (result.success) {
|
|
39
|
+
(0, vitest_1.expect)(result.data.factors).toHaveLength(1);
|
|
40
|
+
(0, vitest_1.expect)(result.data.factors?.[0].id).toMatch(/^stg_[A-Za-z0-9]+$/);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
(0, vitest_1.test)('should accept settings with nested factors', () => {
|
|
44
|
+
const settings = {
|
|
45
|
+
factors: [
|
|
46
|
+
{
|
|
47
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
48
|
+
nextFactors: [
|
|
49
|
+
{
|
|
50
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
updatedAt: new Date(),
|
|
56
|
+
metadata: {},
|
|
57
|
+
};
|
|
58
|
+
const result = schema_js_1.SettingsSchema.safeParse(settings);
|
|
59
|
+
(0, vitest_1.expect)(result.success).toBe(true);
|
|
60
|
+
if (result.success) {
|
|
61
|
+
(0, vitest_1.expect)(result.data.factors?.[0].nextFactors).toHaveLength(1);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
(0, vitest_1.test)('should accept settings with undefined factors', () => {
|
|
65
|
+
const settings = {
|
|
66
|
+
factors: undefined,
|
|
67
|
+
updatedAt: new Date(),
|
|
68
|
+
metadata: {},
|
|
69
|
+
};
|
|
70
|
+
const result = schema_js_1.SettingsSchema.safeParse(settings);
|
|
71
|
+
(0, vitest_1.expect)(result.success).toBe(true);
|
|
72
|
+
if (result.success) {
|
|
73
|
+
(0, vitest_1.expect)(result.data.factors).toBeUndefined();
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
(0, vitest_1.test)('should accept settings with null factors (transforms to undefined)', () => {
|
|
77
|
+
const settings = {
|
|
78
|
+
factors: null,
|
|
79
|
+
updatedAt: new Date(),
|
|
80
|
+
metadata: {},
|
|
81
|
+
};
|
|
82
|
+
const result = schema_js_1.SettingsSchema.safeParse(settings);
|
|
83
|
+
(0, vitest_1.expect)(result.success).toBe(true);
|
|
84
|
+
if (result.success) {
|
|
85
|
+
(0, vitest_1.expect)(result.data.factors).toBeUndefined();
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
(0, vitest_1.test)('should accept settings with multiple factors', () => {
|
|
89
|
+
const settings = {
|
|
90
|
+
factors: [
|
|
91
|
+
{ id: (0, utils_js_1.generateStrategyId)() },
|
|
92
|
+
{ id: (0, utils_js_1.generateStrategyId)() },
|
|
93
|
+
{ id: (0, utils_js_1.generateStrategyId)() },
|
|
94
|
+
],
|
|
95
|
+
updatedAt: new Date(),
|
|
96
|
+
metadata: {},
|
|
97
|
+
};
|
|
98
|
+
const result = schema_js_1.SettingsSchema.safeParse(settings);
|
|
99
|
+
(0, vitest_1.expect)(result.success).toBe(true);
|
|
100
|
+
if (result.success) {
|
|
101
|
+
(0, vitest_1.expect)(result.data.factors).toHaveLength(3);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
(0, vitest_1.test)('should accept settings with deeply nested factors', () => {
|
|
105
|
+
const settings = {
|
|
106
|
+
factors: [
|
|
107
|
+
{
|
|
108
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
109
|
+
nextFactors: [
|
|
110
|
+
{
|
|
111
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
112
|
+
nextFactors: [
|
|
113
|
+
{
|
|
114
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
updatedAt: new Date(),
|
|
122
|
+
metadata: {},
|
|
123
|
+
};
|
|
124
|
+
const result = schema_js_1.SettingsSchema.safeParse(settings);
|
|
125
|
+
(0, vitest_1.expect)(result.success).toBe(true);
|
|
126
|
+
if (result.success) {
|
|
127
|
+
(0, vitest_1.expect)(result.data.factors?.[0].nextFactors?.[0].nextFactors).toHaveLength(1);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
(0, vitest_1.test)('should reject settings with invalid factor id', () => {
|
|
131
|
+
const settings = {
|
|
132
|
+
factors: [
|
|
133
|
+
{
|
|
134
|
+
id: 'invalid-id',
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
updatedAt: new Date(),
|
|
138
|
+
metadata: {},
|
|
139
|
+
};
|
|
140
|
+
const result = schema_js_1.SettingsSchema.safeParse(settings);
|
|
141
|
+
(0, vitest_1.expect)(result.success).toBe(false);
|
|
142
|
+
});
|
|
143
|
+
(0, vitest_1.test)('should reject settings with factors as object instead of array', () => {
|
|
144
|
+
const settings = {
|
|
145
|
+
factors: { id: (0, utils_js_1.generateStrategyId)() },
|
|
146
|
+
updatedAt: new Date(),
|
|
147
|
+
metadata: {},
|
|
148
|
+
};
|
|
149
|
+
const result = schema_js_1.SettingsSchema.safeParse(settings);
|
|
150
|
+
(0, vitest_1.expect)(result.success).toBe(false);
|
|
151
|
+
});
|
|
152
|
+
(0, vitest_1.test)('should accept settings with deletedAt', () => {
|
|
153
|
+
const settings = {
|
|
154
|
+
updatedAt: new Date(),
|
|
155
|
+
deletedAt: new Date(),
|
|
156
|
+
metadata: {},
|
|
157
|
+
};
|
|
158
|
+
const result = schema_js_1.SettingsSchema.safeParse(settings);
|
|
159
|
+
(0, vitest_1.expect)(result.success).toBe(true);
|
|
160
|
+
if (result.success) {
|
|
161
|
+
(0, vitest_1.expect)(result.data.deletedAt).toBeDefined();
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
(0, vitest_1.test)('should accept settings with deactivatedAt', () => {
|
|
165
|
+
const settings = {
|
|
166
|
+
updatedAt: new Date(),
|
|
167
|
+
deactivatedAt: new Date(),
|
|
168
|
+
metadata: {},
|
|
169
|
+
};
|
|
170
|
+
const result = schema_js_1.SettingsSchema.safeParse(settings);
|
|
171
|
+
(0, vitest_1.expect)(result.success).toBe(true);
|
|
172
|
+
if (result.success) {
|
|
173
|
+
(0, vitest_1.expect)(result.data.deactivatedAt).toBeDefined();
|
|
174
|
+
}
|
|
175
|
+
});
|
|
25
176
|
});
|
|
26
177
|
(0, vitest_1.describe)('SettingsPayloadSchema', () => {
|
|
27
178
|
(0, vitest_1.test)('should accept minimal payload', () => {
|
|
@@ -52,6 +203,90 @@ const schema_js_1 = require("./schema.js");
|
|
|
52
203
|
// Parse succeeds for valid data
|
|
53
204
|
(0, vitest_1.expect)(result.success).toBe(true);
|
|
54
205
|
});
|
|
206
|
+
(0, vitest_1.test)('should accept payload with factors', () => {
|
|
207
|
+
const payload = {
|
|
208
|
+
factors: [
|
|
209
|
+
{
|
|
210
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
211
|
+
},
|
|
212
|
+
],
|
|
213
|
+
metadata: {},
|
|
214
|
+
};
|
|
215
|
+
const result = schema_js_1.SettingsPayloadSchema.safeParse(payload);
|
|
216
|
+
(0, vitest_1.expect)(result.success).toBe(true);
|
|
217
|
+
if (result.success) {
|
|
218
|
+
(0, vitest_1.expect)(result.data.factors).toHaveLength(1);
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
(0, vitest_1.test)('should accept payload with nested factors', () => {
|
|
222
|
+
const payload = {
|
|
223
|
+
factors: [
|
|
224
|
+
{
|
|
225
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
226
|
+
nextFactors: [
|
|
227
|
+
{
|
|
228
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
229
|
+
nextFactors: [
|
|
230
|
+
{
|
|
231
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
232
|
+
},
|
|
233
|
+
],
|
|
234
|
+
},
|
|
235
|
+
],
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
metadata: {},
|
|
239
|
+
};
|
|
240
|
+
const result = schema_js_1.SettingsPayloadSchema.safeParse(payload);
|
|
241
|
+
(0, vitest_1.expect)(result.success).toBe(true);
|
|
242
|
+
if (result.success) {
|
|
243
|
+
(0, vitest_1.expect)(result.data.factors?.[0].nextFactors).toBeDefined();
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
(0, vitest_1.test)('should accept payload with null factors (transforms to undefined)', () => {
|
|
247
|
+
const payload = {
|
|
248
|
+
factors: null,
|
|
249
|
+
metadata: {},
|
|
250
|
+
};
|
|
251
|
+
const result = schema_js_1.SettingsPayloadSchema.safeParse(payload);
|
|
252
|
+
(0, vitest_1.expect)(result.success).toBe(true);
|
|
253
|
+
if (result.success) {
|
|
254
|
+
(0, vitest_1.expect)(result.data.factors).toBeUndefined();
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
(0, vitest_1.test)('should accept payload with undefined factors', () => {
|
|
258
|
+
const payload = {
|
|
259
|
+
factors: undefined,
|
|
260
|
+
metadata: {},
|
|
261
|
+
};
|
|
262
|
+
const result = schema_js_1.SettingsPayloadSchema.safeParse(payload);
|
|
263
|
+
(0, vitest_1.expect)(result.success).toBe(true);
|
|
264
|
+
if (result.success) {
|
|
265
|
+
(0, vitest_1.expect)(result.data.factors).toBeUndefined();
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
(0, vitest_1.test)('should reject payload with invalid factor structure', () => {
|
|
269
|
+
const payload = {
|
|
270
|
+
factors: [{ id: 123 }],
|
|
271
|
+
metadata: {},
|
|
272
|
+
};
|
|
273
|
+
const result = schema_js_1.SettingsPayloadSchema.safeParse(payload);
|
|
274
|
+
(0, vitest_1.expect)(result.success).toBe(false);
|
|
275
|
+
});
|
|
276
|
+
(0, vitest_1.test)('should accept payload with deletedAt and deactivatedAt', () => {
|
|
277
|
+
const payload = {
|
|
278
|
+
updatedAt: new Date().toISOString(),
|
|
279
|
+
deletedAt: new Date().toISOString(),
|
|
280
|
+
deactivatedAt: new Date().toISOString(),
|
|
281
|
+
metadata: {},
|
|
282
|
+
};
|
|
283
|
+
const result = schema_js_1.SettingsPayloadSchema.safeParse(payload);
|
|
284
|
+
(0, vitest_1.expect)(result.success).toBe(true);
|
|
285
|
+
if (result.success) {
|
|
286
|
+
(0, vitest_1.expect)(result.data.deletedAt).toBeDefined();
|
|
287
|
+
(0, vitest_1.expect)(result.data.deactivatedAt).toBeDefined();
|
|
288
|
+
}
|
|
289
|
+
});
|
|
55
290
|
});
|
|
56
291
|
(0, vitest_1.describe)('UpsertSettingsPayloadSchema', () => {
|
|
57
292
|
(0, vitest_1.test)('should accept empty upsert payload', () => {
|
|
@@ -78,5 +313,150 @@ const schema_js_1 = require("./schema.js");
|
|
|
78
313
|
const result = schema_js_1.UpsertSettingsPayloadSchema.safeParse(payload);
|
|
79
314
|
(0, vitest_1.expect)(result.success).toBe(false);
|
|
80
315
|
});
|
|
316
|
+
(0, vitest_1.test)('should accept upsert with factors array', () => {
|
|
317
|
+
const payload = {
|
|
318
|
+
factors: [
|
|
319
|
+
{
|
|
320
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
321
|
+
},
|
|
322
|
+
],
|
|
323
|
+
};
|
|
324
|
+
const result = schema_js_1.UpsertSettingsPayloadSchema.safeParse(payload);
|
|
325
|
+
(0, vitest_1.expect)(result.success).toBe(true);
|
|
326
|
+
if (result.success) {
|
|
327
|
+
(0, vitest_1.expect)(result.data.factors).toHaveLength(1);
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
(0, vitest_1.test)('should accept upsert with nested factors', () => {
|
|
331
|
+
const payload = {
|
|
332
|
+
factors: [
|
|
333
|
+
{
|
|
334
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
335
|
+
nextFactors: [
|
|
336
|
+
{
|
|
337
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
338
|
+
},
|
|
339
|
+
],
|
|
340
|
+
},
|
|
341
|
+
],
|
|
342
|
+
};
|
|
343
|
+
const result = schema_js_1.UpsertSettingsPayloadSchema.safeParse(payload);
|
|
344
|
+
(0, vitest_1.expect)(result.success).toBe(true);
|
|
345
|
+
if (result.success) {
|
|
346
|
+
(0, vitest_1.expect)(result.data.factors?.[0].nextFactors).toHaveLength(1);
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
(0, vitest_1.test)('should accept upsert with multiple top-level factors', () => {
|
|
350
|
+
const payload = {
|
|
351
|
+
factors: [{ id: (0, utils_js_1.generateStrategyId)() }, { id: (0, utils_js_1.generateStrategyId)() }],
|
|
352
|
+
};
|
|
353
|
+
const result = schema_js_1.UpsertSettingsPayloadSchema.safeParse(payload);
|
|
354
|
+
(0, vitest_1.expect)(result.success).toBe(true);
|
|
355
|
+
if (result.success) {
|
|
356
|
+
(0, vitest_1.expect)(result.data.factors).toHaveLength(2);
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
(0, vitest_1.test)('should accept upsert with null factors', () => {
|
|
360
|
+
const payload = {
|
|
361
|
+
factors: null,
|
|
362
|
+
};
|
|
363
|
+
const result = schema_js_1.UpsertSettingsPayloadSchema.safeParse(payload);
|
|
364
|
+
(0, vitest_1.expect)(result.success).toBe(true);
|
|
365
|
+
});
|
|
366
|
+
(0, vitest_1.test)('should accept upsert with undefined factors', () => {
|
|
367
|
+
const payload = {
|
|
368
|
+
factors: undefined,
|
|
369
|
+
};
|
|
370
|
+
const result = schema_js_1.UpsertSettingsPayloadSchema.safeParse(payload);
|
|
371
|
+
(0, vitest_1.expect)(result.success).toBe(true);
|
|
372
|
+
});
|
|
373
|
+
(0, vitest_1.test)('should accept upsert with deeply nested factors', () => {
|
|
374
|
+
const payload = {
|
|
375
|
+
factors: [
|
|
376
|
+
{
|
|
377
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
378
|
+
nextFactors: [
|
|
379
|
+
{
|
|
380
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
381
|
+
nextFactors: [
|
|
382
|
+
{
|
|
383
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
384
|
+
nextFactors: [
|
|
385
|
+
{
|
|
386
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
387
|
+
},
|
|
388
|
+
],
|
|
389
|
+
},
|
|
390
|
+
],
|
|
391
|
+
},
|
|
392
|
+
],
|
|
393
|
+
},
|
|
394
|
+
],
|
|
395
|
+
};
|
|
396
|
+
const result = schema_js_1.UpsertSettingsPayloadSchema.safeParse(payload);
|
|
397
|
+
(0, vitest_1.expect)(result.success).toBe(true);
|
|
398
|
+
if (result.success) {
|
|
399
|
+
const firstFactor = result.data.factors?.[0];
|
|
400
|
+
(0, vitest_1.expect)(firstFactor?.nextFactors?.[0].nextFactors?.[0].nextFactors).toHaveLength(1);
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
(0, vitest_1.test)('should reject upsert with invalid factor id type', () => {
|
|
404
|
+
const payload = {
|
|
405
|
+
factors: [
|
|
406
|
+
{
|
|
407
|
+
id: 12345,
|
|
408
|
+
},
|
|
409
|
+
],
|
|
410
|
+
};
|
|
411
|
+
const result = schema_js_1.UpsertSettingsPayloadSchema.safeParse(payload);
|
|
412
|
+
(0, vitest_1.expect)(result.success).toBe(false);
|
|
413
|
+
});
|
|
414
|
+
(0, vitest_1.test)('should reject upsert with factors as single object', () => {
|
|
415
|
+
const payload = {
|
|
416
|
+
factors: {
|
|
417
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
418
|
+
},
|
|
419
|
+
};
|
|
420
|
+
const result = schema_js_1.UpsertSettingsPayloadSchema.safeParse(payload);
|
|
421
|
+
(0, vitest_1.expect)(result.success).toBe(false);
|
|
422
|
+
});
|
|
423
|
+
(0, vitest_1.test)('should reject upsert with invalid nextFactors type', () => {
|
|
424
|
+
const payload = {
|
|
425
|
+
factors: [
|
|
426
|
+
{
|
|
427
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
428
|
+
nextFactors: 'invalid',
|
|
429
|
+
},
|
|
430
|
+
],
|
|
431
|
+
};
|
|
432
|
+
const result = schema_js_1.UpsertSettingsPayloadSchema.safeParse(payload);
|
|
433
|
+
(0, vitest_1.expect)(result.success).toBe(false);
|
|
434
|
+
});
|
|
435
|
+
(0, vitest_1.test)('should accept upsert with factors and metadata together', () => {
|
|
436
|
+
const payload = {
|
|
437
|
+
factors: [
|
|
438
|
+
{
|
|
439
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
440
|
+
},
|
|
441
|
+
],
|
|
442
|
+
metadata: { key: 'value' },
|
|
443
|
+
};
|
|
444
|
+
const result = schema_js_1.UpsertSettingsPayloadSchema.safeParse(payload);
|
|
445
|
+
(0, vitest_1.expect)(result.success).toBe(true);
|
|
446
|
+
if (result.success) {
|
|
447
|
+
(0, vitest_1.expect)(result.data.factors).toHaveLength(1);
|
|
448
|
+
(0, vitest_1.expect)(result.data.metadata).toEqual({ key: 'value' });
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
(0, vitest_1.test)('should accept upsert with empty factors array', () => {
|
|
452
|
+
const payload = {
|
|
453
|
+
factors: [],
|
|
454
|
+
};
|
|
455
|
+
const result = schema_js_1.UpsertSettingsPayloadSchema.safeParse(payload);
|
|
456
|
+
(0, vitest_1.expect)(result.success).toBe(true);
|
|
457
|
+
if (result.success) {
|
|
458
|
+
(0, vitest_1.expect)(result.data.factors).toHaveLength(0);
|
|
459
|
+
}
|
|
460
|
+
});
|
|
81
461
|
});
|
|
82
462
|
});
|
|
@@ -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,wBAAwB,CAAC,CAAC;AAE3E,eAAO,MAAM,oBAAoB;;;EAGtB,CAAC;AACZ,eAAO,MAAM,kBAAkB;;;;EAIpB,CAAC;AACZ,eAAO,MAAM,mBAAmB,aAAa,CAAC;AAE9C,eAAO,MAAM,kBAAkB;;;;;;;;;;;;iBAS7B,CAAC;AAEH,eAAO,MAAM,yBAAyB
|
|
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,wBAAwB,CAAC,CAAC;AAE3E,eAAO,MAAM,oBAAoB;;;EAGtB,CAAC;AACZ,eAAO,MAAM,kBAAkB;;;;EAIpB,CAAC;AACZ,eAAO,MAAM,mBAAmB,aAAa,CAAC;AAE9C,eAAO,MAAM,kBAAkB;;;;;;;;;;;;iBAS7B,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;iBASpC,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;;;iBAK1C,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;;iBAI1C,CAAC"}
|
|
@@ -73,6 +73,7 @@ exports.BaseStrategySchema = z.object({
|
|
|
73
73
|
...metadata_js_1.MetadataMapPropertySchema.shape,
|
|
74
74
|
});
|
|
75
75
|
exports.BaseStrategyPayloadSchema = z.object({
|
|
76
|
+
id: exports.StrategyIdSchema,
|
|
76
77
|
status: exports.StrategyStatusSchema,
|
|
77
78
|
label: exports.StrategyLabelSchema,
|
|
78
79
|
...dates_js_1.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,CAC1C,OAAO,2BAA2B,C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BAAgB,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
|
|
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"}
|
|
@@ -42,6 +42,7 @@ const email_js_1 = require("./email.js");
|
|
|
42
42
|
(0, vitest_1.describe)('EmailStrategyPayloadSchema', () => {
|
|
43
43
|
(0, vitest_1.test)('should accept complete payload', () => {
|
|
44
44
|
const payload = {
|
|
45
|
+
id: (0, utils_js_1.generateStrategyId)(),
|
|
45
46
|
type: 'email',
|
|
46
47
|
label: 'Test',
|
|
47
48
|
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
|
|
1
|
+
{"version":3,"file":"password.d.ts","sourceRoot":"","sources":["../../../../../../src/authentication/strategies/schema/types/password.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CA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Union<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;;;;;;;;;;;CAWzB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAKrD,eAAO,MAAM,0BAA0B;;;;;;iBA0BrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE/E,eAAO,MAAM,kCAAkC;;;;;;;;iBAE7C,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CACjD,OAAO,kCAAkC,CAC1C,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;iBAI7B,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACxE,MAAM,MAAM,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,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAC9C,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.
|
|
5
|
-
export declare const UniqueUrlSetSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.
|
|
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;
|
|
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"}
|
|
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.UniqueUrlSetSchema = exports.UniqueUrlArraySchema = exports.UniqueStringSetSchema = exports.UniqueStringArraySchema = void 0;
|
|
37
37
|
const z = __importStar(require("zod/v4"));
|
|
38
|
+
const url_js_1 = require("./url.js");
|
|
38
39
|
const StringSetTypeSchema = z.set(z.string());
|
|
39
40
|
// const UrlStringSchema = type('string.url[]').pipe((v) => v?.filter((i) => !!i));
|
|
40
41
|
const StringArrayTypeSchema = z
|
|
@@ -48,8 +49,7 @@ exports.UniqueStringSetSchema = z
|
|
|
48
49
|
.pipe(z.transform((v) => (!v || v instanceof Set ? v : new Set(v))));
|
|
49
50
|
const UrlSetTypeSchema = z.instanceof((Set));
|
|
50
51
|
const UrlArrayTypeScheama = z
|
|
51
|
-
.array(
|
|
52
|
-
.or(z.array(z.instanceof(URL)))
|
|
52
|
+
.array(url_js_1.UrlObjectSchema)
|
|
53
53
|
.pipe(z.transform((v) => v?.filter((i) => !!i)));
|
|
54
54
|
exports.UniqueUrlArraySchema = z
|
|
55
55
|
.union([z.undefined(), UrlArrayTypeScheama, UrlSetTypeSchema])
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
1
2
|
export declare function appendSearchParams(path: string, params: Map<string, string | undefined | null> | URLSearchParams): string;
|
|
3
|
+
export declare const UrlObjectSchema: z.ZodUnion<[z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>, z.ZodCustom<URL, URL>]>;
|
|
4
|
+
export type UrlObjectInput = z.input<typeof UrlObjectSchema>;
|
|
5
|
+
export type UrlObject = z.output<typeof UrlObjectSchema>;
|
|
6
|
+
export declare const UrlStringSchema: z.ZodUnion<[z.ZodPipe<z.ZodCustom<URL, URL>, z.ZodTransform<string, URL>>, z.ZodURL]>;
|
|
7
|
+
export type UrlStringInput = z.input<typeof UrlStringSchema>;
|
|
8
|
+
export type UrlString = z.output<typeof UrlStringSchema>;
|
|
2
9
|
//# sourceMappingURL=url.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../../src/common/schema/url.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,eAAe,GAC/D,MAAM,CAUR"}
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../../src/common/schema/url.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,eAAe,GAC/D,MAAM,CAUR;AAED,eAAO,MAAM,eAAe,uFAGJ,CAAC;AACzB,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC7D,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC;AAEzD,eAAO,MAAM,eAAe,uFAGd,CAAC;AACf,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC7D,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC"}
|