@go-mondo/identity-sdk 0.0.2-beta.21 → 0.0.2-beta.23
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 +14 -0
- package/dist/cjs/app/authorization/schema.d.ts +6 -6
- package/dist/cjs/app/authorization/schema.d.ts.map +1 -1
- package/dist/cjs/app/authorization/schema.js +8 -26
- package/dist/cjs/authentication/sessions/schema.d.ts +1 -3
- package/dist/cjs/authentication/sessions/schema.d.ts.map +1 -1
- package/dist/cjs/authentication/sessions/schema.js +13 -6
- package/dist/cjs/authorization/permissions/schema.d.ts +1 -1
- package/dist/cjs/authorization/permissions/schema.d.ts.map +1 -1
- package/dist/cjs/authorization/permissions/schema.js +1 -1
- package/dist/cjs/authorization/roles/schema.d.ts +1 -1
- package/dist/cjs/authorization/roles/schema.d.ts.map +1 -1
- package/dist/cjs/authorization/roles/schema.js +1 -1
- package/dist/cjs/common/schema/sets.d.ts +4 -2
- package/dist/cjs/common/schema/sets.d.ts.map +1 -1
- package/dist/cjs/common/schema/sets.js +22 -9
- package/dist/cjs/oauth/authorize/schema/grants/authorization-code.d.ts +1 -0
- package/dist/cjs/oauth/authorize/schema/grants/authorization-code.d.ts.map +1 -1
- package/dist/cjs/oauth/authorize/schema/grants/authorization-code.js +3 -3
- package/dist/esm/app/authorization/schema.d.ts +6 -6
- package/dist/esm/app/authorization/schema.d.ts.map +1 -1
- package/dist/esm/app/authorization/schema.js +8 -26
- package/dist/esm/authentication/sessions/schema.d.ts +1 -3
- package/dist/esm/authentication/sessions/schema.d.ts.map +1 -1
- package/dist/esm/authentication/sessions/schema.js +12 -5
- package/dist/esm/authorization/permissions/schema.d.ts +1 -1
- package/dist/esm/authorization/permissions/schema.d.ts.map +1 -1
- package/dist/esm/authorization/permissions/schema.js +2 -2
- package/dist/esm/authorization/roles/schema.d.ts +1 -1
- package/dist/esm/authorization/roles/schema.d.ts.map +1 -1
- package/dist/esm/authorization/roles/schema.js +2 -2
- package/dist/esm/common/schema/sets.d.ts +4 -2
- package/dist/esm/common/schema/sets.d.ts.map +1 -1
- package/dist/esm/common/schema/sets.js +21 -8
- package/dist/esm/oauth/authorize/schema/grants/authorization-code.d.ts +1 -0
- package/dist/esm/oauth/authorize/schema/grants/authorization-code.d.ts.map +1 -1
- package/dist/esm/oauth/authorize/schema/grants/authorization-code.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/common/schema/sets.test.d.ts +0 -2
- package/dist/cjs/common/schema/sets.test.d.ts.map +0 -1
- package/dist/cjs/common/schema/sets.test.js +0 -93
- package/dist/esm/common/schema/sets.test.d.ts +0 -2
- package/dist/esm/common/schema/sets.test.d.ts.map +0 -1
- package/dist/esm/common/schema/sets.test.js +0 -91
- package/src/common/schema/sets.test.ts.bak +0 -108
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.2-beta.23](https://github.com/go-mondo/identity-node-sdk/compare/identity-sdk-v0.0.2-beta.22...identity-sdk-v0.0.2-beta.23) (2025-08-29)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* auth schema ([464c4d0](https://github.com/go-mondo/identity-node-sdk/commit/464c4d01cdc24dac8229cce548f08f4b38c49ed3))
|
|
9
|
+
|
|
10
|
+
## [0.0.2-beta.22](https://github.com/go-mondo/identity-node-sdk/compare/identity-sdk-v0.0.2-beta.21...identity-sdk-v0.0.2-beta.22) (2025-08-29)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* session set ([c58f7a2](https://github.com/go-mondo/identity-node-sdk/commit/c58f7a21b10f88d205fca5bf2b3426ea642ea6a5))
|
|
16
|
+
|
|
3
17
|
## [0.0.2-beta.21](https://github.com/go-mondo/identity-node-sdk/compare/identity-sdk-v0.0.2-beta.20...identity-sdk-v0.0.2-beta.21) (2025-08-29)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -5,8 +5,8 @@ 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.ZodArray<z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<Set<URL> | undefined, Set<URL> | URL[] | undefined>>>;
|
|
9
|
-
availableAudiences: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.
|
|
8
|
+
callbackUrls: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>>, z.ZodTransform<URL[], URL[]>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<Set<URL> | undefined, Set<URL> | URL[] | undefined>>>;
|
|
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";
|
|
12
12
|
authorization_code: "authorization_code";
|
|
@@ -38,8 +38,8 @@ export declare const AuthorizationPayloadSchema: z.ZodObject<{
|
|
|
38
38
|
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>>>;
|
|
39
39
|
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>>>;
|
|
40
40
|
loginUri: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodUndefined]>>;
|
|
41
|
-
callbackUrls: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<URL[] | undefined, Set<URL> | URL[] | undefined>>>;
|
|
42
|
-
availableAudiences: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.
|
|
41
|
+
callbackUrls: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>>, z.ZodTransform<URL[], URL[]>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<URL[] | undefined, Set<URL> | URL[] | undefined>>>;
|
|
42
|
+
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>>>;
|
|
43
43
|
availableGrants: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodEnum<{
|
|
44
44
|
client_credentials: "client_credentials";
|
|
45
45
|
authorization_code: "authorization_code";
|
|
@@ -68,8 +68,8 @@ export type AuthorizationPayload = z.output<typeof AuthorizationPayloadSchema>;
|
|
|
68
68
|
export declare const UpsertAuthorizationPayloadSchema: z.ZodObject<{
|
|
69
69
|
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>>>;
|
|
70
70
|
loginUri: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodUndefined]>>;
|
|
71
|
-
callbackUrls: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<URL[] | undefined, Set<URL> | URL[] | undefined>>>;
|
|
72
|
-
availableAudiences: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.
|
|
71
|
+
callbackUrls: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>>, z.ZodTransform<URL[], URL[]>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<URL[] | undefined, Set<URL> | URL[] | undefined>>>;
|
|
72
|
+
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>>>;
|
|
73
73
|
availableGrants: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodEnum<{
|
|
74
74
|
client_credentials: "client_credentials";
|
|
75
75
|
authorization_code: "authorization_code";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/app/authorization/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/app/authorization/schema.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,OAAO,EAAE,KAAK,YAAY,EAAa,MAAM,8BAA8B,CAAC;AAgC5E,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAW9B,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAWrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE/E,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQ3C,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"}
|
|
@@ -1,34 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UpsertAuthorizationPayloadSchema = exports.AuthorizationPayloadSchema = exports.AuthorizationSchema = void 0;
|
|
4
|
+
const sets_js_1 = require("src/common/schema/sets.js");
|
|
4
5
|
const zod_1 = require("zod");
|
|
5
6
|
const dates_js_1 = require("../../common/schema/dates.js");
|
|
6
7
|
const metadata_js_1 = require("../../common/schema/metadata.js");
|
|
7
8
|
const schema_js_1 = require("../../oauth/common/schema.js");
|
|
8
9
|
const schema_js_2 = require("../../workspace/authorization/schema.js");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const StringSchema = zod_1.z
|
|
14
|
-
.array(zod_1.z.string())
|
|
15
|
-
.pipe(zod_1.z.transform((v) => v?.filter((i) => !!i)));
|
|
16
|
-
// const CallbackUrlsSchema = type('undefined')
|
|
17
|
-
// .or(UrlArrayScheama)
|
|
18
|
-
// .or(UrlSetSchema)
|
|
19
|
-
// .pipe((v) => (v instanceof Set ? Array.from(v.values()) : v));
|
|
20
|
-
const CallbackUrlArraySchema = zod_1.z
|
|
21
|
-
.union([zod_1.z.undefined(), UrlArrayScheama, UrlSetSchema])
|
|
22
|
-
.pipe(zod_1.z.transform((v) => (v instanceof Set ? Array.from(v.values()) : v)));
|
|
23
|
-
const CallbackUrlSetSchema = zod_1.z
|
|
24
|
-
.union([zod_1.z.undefined(), UrlArrayScheama, UrlSetSchema])
|
|
25
|
-
.pipe(zod_1.z.transform((v) => (!v || v instanceof Set ? v : new Set(v))));
|
|
26
|
-
const AvailableAudienceArraySchema = zod_1.z
|
|
27
|
-
.union([zod_1.z.undefined(), StringSchema, StringSetSchema])
|
|
28
|
-
.pipe(zod_1.z.transform((v) => (v instanceof Set ? Array.from(v.values()) : v)));
|
|
29
|
-
const AvailableAudienceSetSchema = zod_1.z
|
|
30
|
-
.union([zod_1.z.undefined(), StringSchema, StringSetSchema])
|
|
31
|
-
.pipe(zod_1.z.transform((v) => (!v || v instanceof Set ? v : new Set(v))));
|
|
10
|
+
const CallbackUrlArraySchema = sets_js_1.UniqueUrlArraySchema;
|
|
11
|
+
const CallbackUrlSetSchema = sets_js_1.UniqueUrlSetSchema;
|
|
12
|
+
const AudienceArraySchema = sets_js_1.UniqueStringArraySchema;
|
|
13
|
+
const AudienceSetSchema = sets_js_1.UniqueStringSetSchema;
|
|
32
14
|
const GrantSetSchema = zod_1.z.instanceof((Set));
|
|
33
15
|
const GrantArraySchema = zod_1.z.array(zod_1.z.enum([
|
|
34
16
|
schema_js_1.GrantType.AUTHORIZATION_CODE,
|
|
@@ -51,7 +33,7 @@ exports.AuthorizationSchema = zod_1.z.object({
|
|
|
51
33
|
...BaseAuthorization.shape,
|
|
52
34
|
loginUri: zod_1.z.union([zod_1.z.url(), zod_1.z.undefined()]).optional(),
|
|
53
35
|
callbackUrls: CallbackUrlSetSchema.optional(),
|
|
54
|
-
availableAudiences:
|
|
36
|
+
availableAudiences: AudienceSetSchema.optional(),
|
|
55
37
|
availableGrants: AvailableGrantSetSchema.optional(),
|
|
56
38
|
defaultAudience: zod_1.z.union([zod_1.z.string(), zod_1.z.undefined()]).optional(),
|
|
57
39
|
updatedAt: dates_js_1.OptionalDateSchema,
|
|
@@ -63,7 +45,7 @@ exports.AuthorizationPayloadSchema = zod_1.z.object({
|
|
|
63
45
|
...BaseAuthorization.shape,
|
|
64
46
|
loginUri: zod_1.z.union([zod_1.z.url(), zod_1.z.undefined()]).optional(),
|
|
65
47
|
callbackUrls: CallbackUrlArraySchema.optional(),
|
|
66
|
-
availableAudiences:
|
|
48
|
+
availableAudiences: AudienceArraySchema.optional(),
|
|
67
49
|
availableGrants: AvailableGrantArraySchema.optional(),
|
|
68
50
|
defaultAudience: zod_1.z.union([zod_1.z.string(), zod_1.z.undefined()]).optional(),
|
|
69
51
|
updatedAt: dates_js_1.OptionalDatePayloadSchema,
|
|
@@ -75,7 +57,7 @@ exports.UpsertAuthorizationPayloadSchema = zod_1.z.object({
|
|
|
75
57
|
...BaseAuthorization.shape,
|
|
76
58
|
loginUri: zod_1.z.union([zod_1.z.url(), zod_1.z.undefined()]).optional(),
|
|
77
59
|
callbackUrls: CallbackUrlArraySchema.optional(),
|
|
78
|
-
availableAudiences:
|
|
60
|
+
availableAudiences: AudienceArraySchema.optional(),
|
|
79
61
|
availableGrants: AvailableGrantArraySchema.optional(),
|
|
80
62
|
defaultAudience: zod_1.z.union([zod_1.z.string(), zod_1.z.undefined()]).optional(),
|
|
81
63
|
...metadata_js_1.UpsertMetadataPropertyPayloadSchema.shape,
|
|
@@ -27,12 +27,11 @@ export declare const SessionAuthenticationFactorSchema: z.ZodObject<{
|
|
|
27
27
|
state: z.ZodOptional<z.ZodString>;
|
|
28
28
|
}, z.core.$strip>;
|
|
29
29
|
export type SessionAuthenticationFactor = z.output<typeof SessionAuthenticationFactorSchema>;
|
|
30
|
-
export declare const SessionAuthenticationFactorHistorySchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodString>, z.ZodCustom<Set<string>, Set<string>>]>, z.ZodTransform<Set<string> | string[] | undefined, Set<string> | string[] | undefined>>;
|
|
31
|
-
export type SessionAuthenticationFactorHistory = z.output<typeof SessionAuthenticationFactorHistorySchema>;
|
|
32
30
|
export declare const SessionSchema: z.ZodObject<{
|
|
33
31
|
metadata: 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<Map<string, string | number | boolean>, Record<string, string | number | boolean> | Map<string, string | number | boolean> | null | undefined>>;
|
|
34
32
|
deactivatedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>;
|
|
35
33
|
deletedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>;
|
|
34
|
+
factorHistory: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodString>, z.ZodCustom<Set<string>, Set<string>>]>, z.ZodTransform<Set<string> | undefined, Set<string> | string[] | undefined>>>;
|
|
36
35
|
redirectTo: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodCustom<URL, URL>]>, z.ZodTransform<string | URL, string | URL>>>;
|
|
37
36
|
updatedAt: z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>;
|
|
38
37
|
createdAt: z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>;
|
|
@@ -55,7 +54,6 @@ export declare const SessionSchema: z.ZodObject<{
|
|
|
55
54
|
settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
56
55
|
state: z.ZodOptional<z.ZodString>;
|
|
57
56
|
}, z.core.$strip>>, z.ZodUndefined]>>;
|
|
58
|
-
factorHistory: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodString>, z.ZodCustom<Set<string>, Set<string>>]>, z.ZodTransform<Set<string> | string[] | undefined, Set<string> | string[] | undefined>>>;
|
|
59
57
|
id: z.ZodString;
|
|
60
58
|
}, z.core.$strip>;
|
|
61
59
|
export type SessionProperties = z.input<typeof SessionSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/authentication/sessions/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyBxB,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAErD,eAAO,MAAM,eAAe,aAAuC,CAAC;AACpE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC;AAEzD,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEzE,eAAO,MAAM,mBAAmB;;;;EAIrB,CAAC;AAEZ,eAAO,MAAM,iCAAiC;;;;;;;;;iBAK5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAChD,OAAO,iCAAiC,CACzC,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/authentication/sessions/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyBxB,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAErD,eAAO,MAAM,eAAe,aAAuC,CAAC;AACpE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC;AAEzD,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEzE,eAAO,MAAM,mBAAmB;;;;EAIrB,CAAC;AAEZ,eAAO,MAAM,iCAAiC;;;;;;;;;iBAK5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAChD,OAAO,iCAAiC,CACzC,CAAC;AA0CF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAaxB,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC9D,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC;AAErD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAY/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEnE,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;iBAW5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAChD,OAAO,iCAAiC,CACzC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SessionAssociationReferenceSchema = exports.SessionPayloadSchema = exports.SessionSchema = exports.
|
|
3
|
+
exports.SessionAssociationReferenceSchema = exports.SessionPayloadSchema = exports.SessionSchema = exports.SessionAuthenticationFactorSchema = exports.SessionStatusSchema = exports.SessionIdPropertySchema = exports.SessionIdSchema = exports.SessionStatus = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const dates_js_1 = require("../../common/schema/dates.js");
|
|
6
6
|
const id_js_1 = require("../../common/schema/id.js");
|
|
@@ -30,13 +30,19 @@ exports.SessionAuthenticationFactorSchema = zod_1.z.object({
|
|
|
30
30
|
});
|
|
31
31
|
const AuthenticationFactorHistoryArraySchema = zod_1.z.array(base_js_1.StrategyIdSchema);
|
|
32
32
|
const AuthenticationFactorHistorySetSchema = zod_1.z.instanceof((Set));
|
|
33
|
-
|
|
34
|
-
.union([
|
|
33
|
+
const SessionAuthenticationFactorHistoryInput = zod_1.z.union([
|
|
35
34
|
zod_1.z.undefined(),
|
|
36
35
|
AuthenticationFactorHistoryArraySchema,
|
|
37
36
|
AuthenticationFactorHistorySetSchema,
|
|
38
|
-
])
|
|
39
|
-
|
|
37
|
+
]);
|
|
38
|
+
const SessionAuthenticationFactorHistoryArraySchema = SessionAuthenticationFactorHistoryInput.pipe(zod_1.z.transform((s) => (s instanceof Set ? Array.from(s) : s)?.length ? s : undefined));
|
|
39
|
+
// type SessionAuthenticationFactorArrayHistory = z.output<
|
|
40
|
+
// typeof SessionAuthenticationFactorHistoryArraySchema
|
|
41
|
+
// >;
|
|
42
|
+
const SessionAuthenticationFactorHistorySetSchema = SessionAuthenticationFactorHistoryInput.pipe(zod_1.z.transform((s) => (!s || s instanceof Set ? s : new Set(s))));
|
|
43
|
+
// type SessionAuthenticationFactorSetHistory = z.output<
|
|
44
|
+
// typeof SessionAuthenticationFactorHistorySetSchema
|
|
45
|
+
// >;
|
|
40
46
|
const BaseSchema = zod_1.z.object({
|
|
41
47
|
...exports.SessionIdPropertySchema.shape,
|
|
42
48
|
status: exports.SessionStatusSchema,
|
|
@@ -46,13 +52,14 @@ const BaseSchema = zod_1.z.object({
|
|
|
46
52
|
factors: zod_1.z
|
|
47
53
|
.union([zod_1.z.array(exports.SessionAuthenticationFactorSchema), zod_1.z.undefined()])
|
|
48
54
|
.optional(),
|
|
49
|
-
factorHistory:
|
|
55
|
+
factorHistory: SessionAuthenticationFactorHistoryArraySchema.optional(),
|
|
50
56
|
});
|
|
51
57
|
exports.SessionSchema = zod_1.z.object({
|
|
52
58
|
...BaseSchema.shape,
|
|
53
59
|
expiresAt: dates_js_1.RequiredDateSchema,
|
|
54
60
|
...dates_js_1.CreatedAtPropertySchema.shape,
|
|
55
61
|
...dates_js_1.UpdatedAtPropertySchema.shape,
|
|
62
|
+
factorHistory: SessionAuthenticationFactorHistorySetSchema.optional(),
|
|
56
63
|
redirectTo: zod_1.z
|
|
57
64
|
.union([zod_1.z.string(), zod_1.z.instanceof(URL)])
|
|
58
65
|
.pipe(zod_1.z.transform((v) => (!v || v instanceof URL ? v : new URL(v))))
|
|
@@ -67,7 +67,7 @@ export declare const InsertPermissionPayloadSchema: z.ZodObject<{
|
|
|
67
67
|
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>>>;
|
|
68
68
|
apps: z.ZodOptional<z.ZodUnion<[z.ZodUndefined, z.ZodArray<z.ZodString>]>>;
|
|
69
69
|
roles: z.ZodOptional<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodString>]>>;
|
|
70
|
-
id: z.
|
|
70
|
+
id: z.ZodOptional<z.ZodString>;
|
|
71
71
|
name: z.ZodString;
|
|
72
72
|
status: z.ZodDefault<z.ZodEnum<{
|
|
73
73
|
enabled: "enabled";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/authorization/permissions/schema.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/authorization/permissions/schema.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,gBAAgB;;;CAGnB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAC7B,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAE3D,eAAO,MAAM,0BAA0B;;iBAErC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAO/E,eAAO,MAAM,4BAA4B;;;iBAGvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAC3C,OAAO,4BAA4B,CACpC,CAAC;AASF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;iBAS3B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AACpE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3D,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;iBASlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;iBAOxC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CACzC,OAAO,6BAA6B,CACrC,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAC5C,OAAO,6BAA6B,CACrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;iBAKxC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CACzC,OAAO,6BAA6B,CACrC,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAC5C,OAAO,6BAA6B,CACrC,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,oCAAoC;;;;;;;;iBAK/C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CACnD,OAAO,oCAAoC,CAC5C,CAAC"}
|
|
@@ -52,7 +52,7 @@ exports.PermissionPayloadSchema = zod_1.z.object({
|
|
|
52
52
|
* Insert
|
|
53
53
|
*/
|
|
54
54
|
exports.InsertPermissionPayloadSchema = zod_1.z.object({
|
|
55
|
-
id: schema_js_2.PermissionIdSchema.
|
|
55
|
+
id: schema_js_2.PermissionIdSchema.optional(),
|
|
56
56
|
name: zod_1.z.string(),
|
|
57
57
|
status: PermissionStatusSchema.default(exports.PermissionStatus.ENABLED),
|
|
58
58
|
description: zod_1.z.string().optional(),
|
|
@@ -77,7 +77,7 @@ export declare const InsertRolePayloadSchema: z.ZodObject<{
|
|
|
77
77
|
apps: z.ZodOptional<z.ZodUnion<[z.ZodUndefined, z.ZodArray<z.ZodString>]>>;
|
|
78
78
|
permissions: z.ZodOptional<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodString>]>>;
|
|
79
79
|
users: z.ZodOptional<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodString>]>>;
|
|
80
|
-
id: z.
|
|
80
|
+
id: z.ZodOptional<z.ZodString>;
|
|
81
81
|
name: z.ZodString;
|
|
82
82
|
status: z.ZodDefault<z.ZodEnum<{
|
|
83
83
|
enabled: "enabled";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/schema.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/schema.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,UAAU;;;CAGb,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAEzE,eAAO,MAAM,oBAAoB;;iBAE/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAInE,eAAO,MAAM,sBAAsB;;;;iBAIjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAYvE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;iBAOrB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AACxD,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/C,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;iBAO5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;iBAOlC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;iBAKlC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;iBAKzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAC7C,OAAO,8BAA8B,CACtC,CAAC"}
|
|
@@ -50,7 +50,7 @@ exports.RolePayloadSchema = zod_1.z.object({
|
|
|
50
50
|
* Insert
|
|
51
51
|
*/
|
|
52
52
|
exports.InsertRolePayloadSchema = zod_1.z.object({
|
|
53
|
-
id: schema_js_3.RoleIdSchema.
|
|
53
|
+
id: schema_js_3.RoleIdSchema.optional(),
|
|
54
54
|
name: zod_1.z.string(),
|
|
55
55
|
status: StatusSchema.default(exports.RoleStatus.ENABLED),
|
|
56
56
|
description: zod_1.z.string().optional(),
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
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
|
+
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.ZodArray<z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>>, 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.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>>, z.ZodTransform<URL[], URL[]>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<Set<URL> | undefined, Set<URL> | URL[] | undefined>>;
|
|
4
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,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"sets.d.ts","sourceRoot":"","sources":["../../../../src/common/schema/sets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,uBAAuB,2NAEwC,CAAC;AAE7E,eAAO,MAAM,qBAAqB,8NAEoC,CAAC;AAOvE,eAAO,MAAM,oBAAoB,2PAE2C,CAAC;AAE7E,eAAO,MAAM,kBAAkB,8PAEuC,CAAC"}
|
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.UniqueUrlSetSchema = exports.UniqueUrlArraySchema = exports.UniqueStringSetSchema = exports.UniqueStringArraySchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
])
|
|
12
|
-
|
|
5
|
+
const StringSetTypeSchema = zod_1.z.set(zod_1.z.string());
|
|
6
|
+
// const UrlStringSchema = type('string.url[]').pipe((v) => v?.filter((i) => !!i));
|
|
7
|
+
const StringArrayTypeSchema = zod_1.z
|
|
8
|
+
.array(zod_1.z.string())
|
|
9
|
+
.pipe(zod_1.z.transform((v) => v?.filter((i) => !!i)));
|
|
10
|
+
exports.UniqueStringArraySchema = zod_1.z
|
|
11
|
+
.union([zod_1.z.undefined(), StringArrayTypeSchema, StringSetTypeSchema])
|
|
12
|
+
.pipe(zod_1.z.transform((v) => (v instanceof Set ? Array.from(v.values()) : v)));
|
|
13
|
+
exports.UniqueStringSetSchema = zod_1.z
|
|
14
|
+
.union([zod_1.z.undefined(), StringArrayTypeSchema, StringSetTypeSchema])
|
|
15
|
+
.pipe(zod_1.z.transform((v) => (!v || v instanceof Set ? v : new Set(v))));
|
|
16
|
+
const UrlSetTypeSchema = zod_1.z.instanceof((Set));
|
|
17
|
+
const UrlArrayTypeScheama = zod_1.z
|
|
18
|
+
.array(zod_1.z.url().pipe(zod_1.z.transform((url) => new URL(url))))
|
|
19
|
+
.pipe(zod_1.z.transform((v) => v?.filter((i) => !!i)));
|
|
20
|
+
exports.UniqueUrlArraySchema = zod_1.z
|
|
21
|
+
.union([zod_1.z.undefined(), UrlArrayTypeScheama, UrlSetTypeSchema])
|
|
22
|
+
.pipe(zod_1.z.transform((v) => (v instanceof Set ? Array.from(v.values()) : v)));
|
|
23
|
+
exports.UniqueUrlSetSchema = zod_1.z
|
|
24
|
+
.union([zod_1.z.undefined(), UrlArrayTypeScheama, UrlSetTypeSchema])
|
|
25
|
+
.pipe(zod_1.z.transform((v) => (!v || v instanceof Set ? v : new Set(v))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-code.d.ts","sourceRoot":"","sources":["../../../../../../src/oauth/authorize/schema/grants/authorization-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"authorization-code.d.ts","sourceRoot":"","sources":["../../../../../../src/oauth/authorize/schema/grants/authorization-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,eAAO,MAAM,mBAAmB,aAKmC,CAAC;AAmCpE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBhC,CAAC;AACL,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AuthorizationCodeSchema = void 0;
|
|
3
|
+
exports.AuthorizationCodeSchema = exports.CodeChallengeSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const schema_js_1 = require("../../../../app/schema.js");
|
|
6
6
|
const schema_js_2 = require("../../../common/schema.js");
|
|
@@ -9,7 +9,7 @@ const schema_js_2 = require("../../../common/schema.js");
|
|
|
9
9
|
* @see https://openid.net/specs/openid-connect-core-1_0.html#rfc.section.3.1.2.1
|
|
10
10
|
*/
|
|
11
11
|
const ResponseTypeSchema = zod_1.z.enum([schema_js_2.ResponseType.CODE]);
|
|
12
|
-
|
|
12
|
+
exports.CodeChallengeSchema = zod_1.z
|
|
13
13
|
.string()
|
|
14
14
|
.min(43, 'Code challenge must be at least 43 characters long.')
|
|
15
15
|
.max(128, 'Code challenge must be at most 128 characters long.')
|
|
@@ -51,7 +51,7 @@ exports.AuthorizationCodeSchema = zod_1.z
|
|
|
51
51
|
...OIDCSchema.shape,
|
|
52
52
|
...schema_js_2.OptionalSchema.shape,
|
|
53
53
|
code_challenge_method: schema_js_2.CodeChallengeMethodSchema.optional(),
|
|
54
|
-
code_challenge: CodeChallengeSchema.optional(),
|
|
54
|
+
code_challenge: exports.CodeChallengeSchema.optional(),
|
|
55
55
|
})
|
|
56
56
|
.superRefine((data, ctx) => {
|
|
57
57
|
// If one is present, the other must also be present
|
|
@@ -5,8 +5,8 @@ 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.ZodArray<z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<Set<URL> | undefined, Set<URL> | URL[] | undefined>>>;
|
|
9
|
-
availableAudiences: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.
|
|
8
|
+
callbackUrls: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>>, z.ZodTransform<URL[], URL[]>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<Set<URL> | undefined, Set<URL> | URL[] | undefined>>>;
|
|
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";
|
|
12
12
|
authorization_code: "authorization_code";
|
|
@@ -38,8 +38,8 @@ export declare const AuthorizationPayloadSchema: z.ZodObject<{
|
|
|
38
38
|
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>>>;
|
|
39
39
|
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>>>;
|
|
40
40
|
loginUri: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodUndefined]>>;
|
|
41
|
-
callbackUrls: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<URL[] | undefined, Set<URL> | URL[] | undefined>>>;
|
|
42
|
-
availableAudiences: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.
|
|
41
|
+
callbackUrls: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>>, z.ZodTransform<URL[], URL[]>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<URL[] | undefined, Set<URL> | URL[] | undefined>>>;
|
|
42
|
+
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>>>;
|
|
43
43
|
availableGrants: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodEnum<{
|
|
44
44
|
client_credentials: "client_credentials";
|
|
45
45
|
authorization_code: "authorization_code";
|
|
@@ -68,8 +68,8 @@ export type AuthorizationPayload = z.output<typeof AuthorizationPayloadSchema>;
|
|
|
68
68
|
export declare const UpsertAuthorizationPayloadSchema: z.ZodObject<{
|
|
69
69
|
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>>>;
|
|
70
70
|
loginUri: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodUndefined]>>;
|
|
71
|
-
callbackUrls: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<URL[] | undefined, Set<URL> | URL[] | undefined>>>;
|
|
72
|
-
availableAudiences: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.
|
|
71
|
+
callbackUrls: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodPipe<z.ZodArray<z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>>, z.ZodTransform<URL[], URL[]>>, z.ZodCustom<Set<URL>, Set<URL>>]>, z.ZodTransform<URL[] | undefined, Set<URL> | URL[] | undefined>>>;
|
|
72
|
+
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>>>;
|
|
73
73
|
availableGrants: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodEnum<{
|
|
74
74
|
client_credentials: "client_credentials";
|
|
75
75
|
authorization_code: "authorization_code";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/app/authorization/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/app/authorization/schema.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,OAAO,EAAE,KAAK,YAAY,EAAa,MAAM,8BAA8B,CAAC;AAgC5E,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAW9B,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAWrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE/E,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQ3C,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"}
|
|
@@ -1,31 +1,13 @@
|
|
|
1
|
+
import { UniqueStringArraySchema, UniqueStringSetSchema, UniqueUrlArraySchema, UniqueUrlSetSchema, } from 'src/common/schema/sets.js';
|
|
1
2
|
import { z } from 'zod';
|
|
2
3
|
import { DeactivatedAtPropertyPayloadSchema, DeactivatedAtPropertySchema, DeletedAtPropertyPayloadSchema, DeletedAtPropertySchema, OptionalDatePayloadSchema, OptionalDateSchema, } from '../../common/schema/dates.js';
|
|
3
4
|
import { MetadataMapPropertySchema, MetadataPayloadPropertySchema, UpsertMetadataPropertyPayloadSchema, } from '../../common/schema/metadata.js';
|
|
4
5
|
import { GrantType } from '../../oauth/common/schema.js';
|
|
5
6
|
import { AuthorizationPayloadSchema as WorkspaceAuthorizationPayloadSchema } from '../../workspace/authorization/schema.js';
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const StringSchema = z
|
|
11
|
-
.array(z.string())
|
|
12
|
-
.pipe(z.transform((v) => v?.filter((i) => !!i)));
|
|
13
|
-
// const CallbackUrlsSchema = type('undefined')
|
|
14
|
-
// .or(UrlArrayScheama)
|
|
15
|
-
// .or(UrlSetSchema)
|
|
16
|
-
// .pipe((v) => (v instanceof Set ? Array.from(v.values()) : v));
|
|
17
|
-
const CallbackUrlArraySchema = z
|
|
18
|
-
.union([z.undefined(), UrlArrayScheama, UrlSetSchema])
|
|
19
|
-
.pipe(z.transform((v) => (v instanceof Set ? Array.from(v.values()) : v)));
|
|
20
|
-
const CallbackUrlSetSchema = z
|
|
21
|
-
.union([z.undefined(), UrlArrayScheama, UrlSetSchema])
|
|
22
|
-
.pipe(z.transform((v) => (!v || v instanceof Set ? v : new Set(v))));
|
|
23
|
-
const AvailableAudienceArraySchema = z
|
|
24
|
-
.union([z.undefined(), StringSchema, StringSetSchema])
|
|
25
|
-
.pipe(z.transform((v) => (v instanceof Set ? Array.from(v.values()) : v)));
|
|
26
|
-
const AvailableAudienceSetSchema = z
|
|
27
|
-
.union([z.undefined(), StringSchema, StringSetSchema])
|
|
28
|
-
.pipe(z.transform((v) => (!v || v instanceof Set ? v : new Set(v))));
|
|
7
|
+
const CallbackUrlArraySchema = UniqueUrlArraySchema;
|
|
8
|
+
const CallbackUrlSetSchema = UniqueUrlSetSchema;
|
|
9
|
+
const AudienceArraySchema = UniqueStringArraySchema;
|
|
10
|
+
const AudienceSetSchema = UniqueStringSetSchema;
|
|
29
11
|
const GrantSetSchema = z.instanceof((Set));
|
|
30
12
|
const GrantArraySchema = z.array(z.enum([
|
|
31
13
|
GrantType.AUTHORIZATION_CODE,
|
|
@@ -48,7 +30,7 @@ export const AuthorizationSchema = z.object({
|
|
|
48
30
|
...BaseAuthorization.shape,
|
|
49
31
|
loginUri: z.union([z.url(), z.undefined()]).optional(),
|
|
50
32
|
callbackUrls: CallbackUrlSetSchema.optional(),
|
|
51
|
-
availableAudiences:
|
|
33
|
+
availableAudiences: AudienceSetSchema.optional(),
|
|
52
34
|
availableGrants: AvailableGrantSetSchema.optional(),
|
|
53
35
|
defaultAudience: z.union([z.string(), z.undefined()]).optional(),
|
|
54
36
|
updatedAt: OptionalDateSchema,
|
|
@@ -60,7 +42,7 @@ export const AuthorizationPayloadSchema = z.object({
|
|
|
60
42
|
...BaseAuthorization.shape,
|
|
61
43
|
loginUri: z.union([z.url(), z.undefined()]).optional(),
|
|
62
44
|
callbackUrls: CallbackUrlArraySchema.optional(),
|
|
63
|
-
availableAudiences:
|
|
45
|
+
availableAudiences: AudienceArraySchema.optional(),
|
|
64
46
|
availableGrants: AvailableGrantArraySchema.optional(),
|
|
65
47
|
defaultAudience: z.union([z.string(), z.undefined()]).optional(),
|
|
66
48
|
updatedAt: OptionalDatePayloadSchema,
|
|
@@ -72,7 +54,7 @@ export const UpsertAuthorizationPayloadSchema = z.object({
|
|
|
72
54
|
...BaseAuthorization.shape,
|
|
73
55
|
loginUri: z.union([z.url(), z.undefined()]).optional(),
|
|
74
56
|
callbackUrls: CallbackUrlArraySchema.optional(),
|
|
75
|
-
availableAudiences:
|
|
57
|
+
availableAudiences: AudienceArraySchema.optional(),
|
|
76
58
|
availableGrants: AvailableGrantArraySchema.optional(),
|
|
77
59
|
defaultAudience: z.union([z.string(), z.undefined()]).optional(),
|
|
78
60
|
...UpsertMetadataPropertyPayloadSchema.shape,
|
|
@@ -27,12 +27,11 @@ export declare const SessionAuthenticationFactorSchema: z.ZodObject<{
|
|
|
27
27
|
state: z.ZodOptional<z.ZodString>;
|
|
28
28
|
}, z.core.$strip>;
|
|
29
29
|
export type SessionAuthenticationFactor = z.output<typeof SessionAuthenticationFactorSchema>;
|
|
30
|
-
export declare const SessionAuthenticationFactorHistorySchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodString>, z.ZodCustom<Set<string>, Set<string>>]>, z.ZodTransform<Set<string> | string[] | undefined, Set<string> | string[] | undefined>>;
|
|
31
|
-
export type SessionAuthenticationFactorHistory = z.output<typeof SessionAuthenticationFactorHistorySchema>;
|
|
32
30
|
export declare const SessionSchema: z.ZodObject<{
|
|
33
31
|
metadata: 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<Map<string, string | number | boolean>, Record<string, string | number | boolean> | Map<string, string | number | boolean> | null | undefined>>;
|
|
34
32
|
deactivatedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>;
|
|
35
33
|
deletedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>;
|
|
34
|
+
factorHistory: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodString>, z.ZodCustom<Set<string>, Set<string>>]>, z.ZodTransform<Set<string> | undefined, Set<string> | string[] | undefined>>>;
|
|
36
35
|
redirectTo: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodCustom<URL, URL>]>, z.ZodTransform<string | URL, string | URL>>>;
|
|
37
36
|
updatedAt: z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>;
|
|
38
37
|
createdAt: z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>;
|
|
@@ -55,7 +54,6 @@ export declare const SessionSchema: z.ZodObject<{
|
|
|
55
54
|
settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
56
55
|
state: z.ZodOptional<z.ZodString>;
|
|
57
56
|
}, z.core.$strip>>, z.ZodUndefined]>>;
|
|
58
|
-
factorHistory: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodString>, z.ZodCustom<Set<string>, Set<string>>]>, z.ZodTransform<Set<string> | string[] | undefined, Set<string> | string[] | undefined>>>;
|
|
59
57
|
id: z.ZodString;
|
|
60
58
|
}, z.core.$strip>;
|
|
61
59
|
export type SessionProperties = z.input<typeof SessionSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/authentication/sessions/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyBxB,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAErD,eAAO,MAAM,eAAe,aAAuC,CAAC;AACpE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC;AAEzD,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEzE,eAAO,MAAM,mBAAmB;;;;EAIrB,CAAC;AAEZ,eAAO,MAAM,iCAAiC;;;;;;;;;iBAK5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAChD,OAAO,iCAAiC,CACzC,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/authentication/sessions/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyBxB,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAErD,eAAO,MAAM,eAAe,aAAuC,CAAC;AACpE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC;AAEzD,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEzE,eAAO,MAAM,mBAAmB;;;;EAIrB,CAAC;AAEZ,eAAO,MAAM,iCAAiC;;;;;;;;;iBAK5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAChD,OAAO,iCAAiC,CACzC,CAAC;AA0CF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAaxB,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC9D,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC;AAErD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAY/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEnE,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;iBAW5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAChD,OAAO,iCAAiC,CACzC,CAAC"}
|
|
@@ -27,13 +27,19 @@ export const SessionAuthenticationFactorSchema = z.object({
|
|
|
27
27
|
});
|
|
28
28
|
const AuthenticationFactorHistoryArraySchema = z.array(StrategyIdSchema);
|
|
29
29
|
const AuthenticationFactorHistorySetSchema = z.instanceof((Set));
|
|
30
|
-
|
|
31
|
-
.union([
|
|
30
|
+
const SessionAuthenticationFactorHistoryInput = z.union([
|
|
32
31
|
z.undefined(),
|
|
33
32
|
AuthenticationFactorHistoryArraySchema,
|
|
34
33
|
AuthenticationFactorHistorySetSchema,
|
|
35
|
-
])
|
|
36
|
-
|
|
34
|
+
]);
|
|
35
|
+
const SessionAuthenticationFactorHistoryArraySchema = SessionAuthenticationFactorHistoryInput.pipe(z.transform((s) => (s instanceof Set ? Array.from(s) : s)?.length ? s : undefined));
|
|
36
|
+
// type SessionAuthenticationFactorArrayHistory = z.output<
|
|
37
|
+
// typeof SessionAuthenticationFactorHistoryArraySchema
|
|
38
|
+
// >;
|
|
39
|
+
const SessionAuthenticationFactorHistorySetSchema = SessionAuthenticationFactorHistoryInput.pipe(z.transform((s) => (!s || s instanceof Set ? s : new Set(s))));
|
|
40
|
+
// type SessionAuthenticationFactorSetHistory = z.output<
|
|
41
|
+
// typeof SessionAuthenticationFactorHistorySetSchema
|
|
42
|
+
// >;
|
|
37
43
|
const BaseSchema = z.object({
|
|
38
44
|
...SessionIdPropertySchema.shape,
|
|
39
45
|
status: SessionStatusSchema,
|
|
@@ -43,13 +49,14 @@ const BaseSchema = z.object({
|
|
|
43
49
|
factors: z
|
|
44
50
|
.union([z.array(SessionAuthenticationFactorSchema), z.undefined()])
|
|
45
51
|
.optional(),
|
|
46
|
-
factorHistory:
|
|
52
|
+
factorHistory: SessionAuthenticationFactorHistoryArraySchema.optional(),
|
|
47
53
|
});
|
|
48
54
|
export const SessionSchema = z.object({
|
|
49
55
|
...BaseSchema.shape,
|
|
50
56
|
expiresAt: RequiredDateSchema,
|
|
51
57
|
...CreatedAtPropertySchema.shape,
|
|
52
58
|
...UpdatedAtPropertySchema.shape,
|
|
59
|
+
factorHistory: SessionAuthenticationFactorHistorySetSchema.optional(),
|
|
53
60
|
redirectTo: z
|
|
54
61
|
.union([z.string(), z.instanceof(URL)])
|
|
55
62
|
.pipe(z.transform((v) => (!v || v instanceof URL ? v : new URL(v))))
|
|
@@ -67,7 +67,7 @@ export declare const InsertPermissionPayloadSchema: z.ZodObject<{
|
|
|
67
67
|
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>>>;
|
|
68
68
|
apps: z.ZodOptional<z.ZodUnion<[z.ZodUndefined, z.ZodArray<z.ZodString>]>>;
|
|
69
69
|
roles: z.ZodOptional<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodString>]>>;
|
|
70
|
-
id: z.
|
|
70
|
+
id: z.ZodOptional<z.ZodString>;
|
|
71
71
|
name: z.ZodString;
|
|
72
72
|
status: z.ZodDefault<z.ZodEnum<{
|
|
73
73
|
enabled: "enabled";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/authorization/permissions/schema.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/authorization/permissions/schema.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,gBAAgB;;;CAGnB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAC7B,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAE3D,eAAO,MAAM,0BAA0B;;iBAErC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAO/E,eAAO,MAAM,4BAA4B;;;iBAGvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAC3C,OAAO,4BAA4B,CACpC,CAAC;AASF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;iBAS3B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AACpE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3D,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;iBASlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;iBAOxC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CACzC,OAAO,6BAA6B,CACrC,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAC5C,OAAO,6BAA6B,CACrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;iBAKxC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CACzC,OAAO,6BAA6B,CACrC,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAC5C,OAAO,6BAA6B,CACrC,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,oCAAoC;;;;;;;;iBAK/C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CACnD,OAAO,oCAAoC,CAC5C,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { z } from 'zod';
|
|
|
3
3
|
import { AppIdAssociationsSchema } from '../../app/schema.js';
|
|
4
4
|
import { AggregateSchema } from '../../common/schema/aggregate.js';
|
|
5
5
|
import { MetadataMapPropertySchema, MetadataPayloadPropertySchema, UpsertMetadataPropertyPayloadSchema, } from '../../common/schema/metadata.js';
|
|
6
|
-
import { PermissionIdSchema, RoleIdAssociationsSchema
|
|
6
|
+
import { PermissionIdSchema, RoleIdAssociationsSchema } from '../schema.js';
|
|
7
7
|
export const PermissionStatus = {
|
|
8
8
|
ENABLED: 'enabled',
|
|
9
9
|
DISABLED: 'disabled',
|
|
@@ -49,7 +49,7 @@ export const PermissionPayloadSchema = z.object({
|
|
|
49
49
|
* Insert
|
|
50
50
|
*/
|
|
51
51
|
export const InsertPermissionPayloadSchema = z.object({
|
|
52
|
-
id: PermissionIdSchema.
|
|
52
|
+
id: PermissionIdSchema.optional(),
|
|
53
53
|
name: z.string(),
|
|
54
54
|
status: PermissionStatusSchema.default(PermissionStatus.ENABLED),
|
|
55
55
|
description: z.string().optional(),
|