@schemavaults/auth-common 0.24.0 → 0.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/audience-schema.d.ts +2 -2
- package/dist/audience-schema.js +0 -1
- package/dist/audience-schema.js.map +1 -1
- package/dist/auth_acquire_tokens_grant_types.d.ts +12 -42
- package/dist/auth_acquire_tokens_grant_types.js +1 -1
- package/dist/auth_acquire_tokens_grant_types.js.map +1 -1
- package/dist/authenticate_result.d.ts +29 -144
- package/dist/authenticate_result.js +2 -2
- package/dist/authenticate_result.js.map +1 -1
- package/dist/authorize-client-application-form-type.d.ts +2 -6
- package/dist/credentials/email_credentials.d.ts +3 -9
- package/dist/credentials/normalize-email.d.ts +1 -1
- package/dist/credentials/normalize-email.js +5 -1
- package/dist/credentials/normalize-email.js.map +1 -1
- package/dist/credentials/password_requirements.d.ts +1 -1
- package/dist/credentials/register_credentials.d.ts +6 -26
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/invite-code/invite-code-definition.d.ts +5 -17
- package/dist/invite-code/invite-code-definition.js +1 -1
- package/dist/invite-code/invite-code-definition.js.map +1 -1
- package/dist/mfa/mfa-challenge.d.ts +2 -8
- package/dist/mfa/mfa-challenge.js +1 -1
- package/dist/mfa/mfa-challenge.js.map +1 -1
- package/dist/mfa/mfa-factor-type.d.ts +4 -1
- package/dist/mfa/mfa-verify-body.d.ts +57 -315
- package/dist/mfa/mfa-verify-body.js +9 -9
- package/dist/mfa/mfa-verify-body.js.map +1 -1
- package/dist/mfa/webauthn.d.ts +21 -145
- package/dist/mfa/webauthn.js +3 -3
- package/dist/mfa/webauthn.js.map +1 -1
- package/dist/middleware/auth-middleware-error.d.ts +1 -1
- package/dist/middleware/middleware-rules.d.ts +11 -15
- package/dist/oidc/index.d.ts +2 -0
- package/dist/oidc/index.js +1 -0
- package/dist/oidc/index.js.map +1 -1
- package/dist/oidc/profile-claims.d.ts +34 -0
- package/dist/oidc/profile-claims.js +45 -0
- package/dist/oidc/profile-claims.js.map +1 -0
- package/dist/organizations/invite_member_form.d.ts +8 -21
- package/dist/organizations/invite_member_form.js +5 -5
- package/dist/organizations/invite_member_form.js.map +1 -1
- package/dist/organizations/organization-membership-role-type.d.ts +1 -1
- package/dist/organizations/organization_definition.d.ts +5 -15
- package/dist/organizations/organization_definition.js +1 -1
- package/dist/organizations/organization_definition.js.map +1 -1
- package/dist/organizations/organization_invitation.d.ts +21 -33
- package/dist/organizations/organization_invitation.js +5 -5
- package/dist/organizations/organization_invitation.js.map +1 -1
- package/dist/organizations/organization_membership_role_details.d.ts +6 -18
- package/dist/pagination.d.ts +1 -7
- package/dist/pkce/code_challenge.d.ts +5 -13
- package/dist/pkce/code_verifier.d.ts +6 -16
- package/dist/pkce/pkce.d.ts +11 -29
- package/dist/request_tokens_result.d.ts +58 -493
- package/dist/token-data/token-data.d.ts +23 -73
- package/dist/token-data/token-data.js +1 -1
- package/dist/token-data/token-data.js.map +1 -1
- package/dist/user_data/index.d.ts +1 -0
- package/dist/user_data/index.js +1 -0
- package/dist/user_data/index.js.map +1 -1
- package/dist/user_data/user_data.d.ts +11 -50
- package/dist/user_data/user_data.js +13 -3
- package/dist/user_data/user_data.js.map +1 -1
- package/dist/user_data/user_profile.d.ts +65 -0
- package/dist/user_data/user_profile.js +79 -0
- package/dist/user_data/user_profile.js.map +1 -0
- package/package.json +3 -3
package/dist/mfa/webauthn.d.ts
CHANGED
|
@@ -2,181 +2,57 @@ import { z } from "zod";
|
|
|
2
2
|
export declare const webauthnRegistrationResponseSchema: z.ZodObject<{
|
|
3
3
|
id: z.ZodString;
|
|
4
4
|
rawId: z.ZodString;
|
|
5
|
-
response: z.ZodObject<{},
|
|
5
|
+
response: z.ZodObject<{}, z.core.$loose>;
|
|
6
6
|
authenticatorAttachment: z.ZodOptional<z.ZodString>;
|
|
7
|
-
clientExtensionResults: z.ZodOptional<z.ZodObject<{},
|
|
7
|
+
clientExtensionResults: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
8
8
|
type: z.ZodString;
|
|
9
|
-
},
|
|
10
|
-
id: z.ZodString;
|
|
11
|
-
rawId: z.ZodString;
|
|
12
|
-
response: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
|
|
13
|
-
authenticatorAttachment: z.ZodOptional<z.ZodString>;
|
|
14
|
-
clientExtensionResults: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
15
|
-
type: z.ZodString;
|
|
16
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
17
|
-
id: z.ZodString;
|
|
18
|
-
rawId: z.ZodString;
|
|
19
|
-
response: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
|
|
20
|
-
authenticatorAttachment: z.ZodOptional<z.ZodString>;
|
|
21
|
-
clientExtensionResults: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
22
|
-
type: z.ZodString;
|
|
23
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
9
|
+
}, z.core.$loose>;
|
|
24
10
|
export type WebauthnRegistrationResponse = z.infer<typeof webauthnRegistrationResponseSchema>;
|
|
25
11
|
export declare const webauthnAuthenticationResponseSchema: z.ZodObject<{
|
|
26
12
|
id: z.ZodString;
|
|
27
13
|
rawId: z.ZodString;
|
|
28
|
-
response: z.ZodObject<{},
|
|
29
|
-
authenticatorAttachment: z.ZodOptional<z.ZodString>;
|
|
30
|
-
clientExtensionResults: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
31
|
-
type: z.ZodString;
|
|
32
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
33
|
-
id: z.ZodString;
|
|
34
|
-
rawId: z.ZodString;
|
|
35
|
-
response: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
|
|
14
|
+
response: z.ZodObject<{}, z.core.$loose>;
|
|
36
15
|
authenticatorAttachment: z.ZodOptional<z.ZodString>;
|
|
37
|
-
clientExtensionResults: z.ZodOptional<z.ZodObject<{},
|
|
16
|
+
clientExtensionResults: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
38
17
|
type: z.ZodString;
|
|
39
|
-
}, z.
|
|
40
|
-
id: z.ZodString;
|
|
41
|
-
rawId: z.ZodString;
|
|
42
|
-
response: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
|
|
43
|
-
authenticatorAttachment: z.ZodOptional<z.ZodString>;
|
|
44
|
-
clientExtensionResults: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
45
|
-
type: z.ZodString;
|
|
46
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
18
|
+
}, z.core.$loose>;
|
|
47
19
|
export type WebauthnAuthenticationResponse = z.infer<typeof webauthnAuthenticationResponseSchema>;
|
|
48
20
|
export declare const webauthnLabelSchema: z.ZodString;
|
|
49
21
|
export declare const webauthnEnrollOptionsResponseSchema: z.ZodObject<{
|
|
50
|
-
factor_id: z.
|
|
51
|
-
options: z.ZodObject<{},
|
|
52
|
-
},
|
|
53
|
-
options: {} & {
|
|
54
|
-
[k: string]: unknown;
|
|
55
|
-
};
|
|
56
|
-
factor_id: string;
|
|
57
|
-
}, {
|
|
58
|
-
options: {} & {
|
|
59
|
-
[k: string]: unknown;
|
|
60
|
-
};
|
|
61
|
-
factor_id: string;
|
|
62
|
-
}>;
|
|
22
|
+
factor_id: z.ZodGUID;
|
|
23
|
+
options: z.ZodObject<{}, z.core.$loose>;
|
|
24
|
+
}, z.core.$strict>;
|
|
63
25
|
export type WebauthnEnrollOptionsResponse = z.infer<typeof webauthnEnrollOptionsResponseSchema>;
|
|
64
26
|
export declare const webauthnVerifyEnrollmentBodySchema: z.ZodObject<{
|
|
65
|
-
factor_id: z.
|
|
27
|
+
factor_id: z.ZodGUID;
|
|
66
28
|
label: z.ZodOptional<z.ZodString>;
|
|
67
29
|
attestation: z.ZodObject<{
|
|
68
30
|
id: z.ZodString;
|
|
69
31
|
rawId: z.ZodString;
|
|
70
|
-
response: z.ZodObject<{},
|
|
71
|
-
authenticatorAttachment: z.ZodOptional<z.ZodString>;
|
|
72
|
-
clientExtensionResults: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
73
|
-
type: z.ZodString;
|
|
74
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
75
|
-
id: z.ZodString;
|
|
76
|
-
rawId: z.ZodString;
|
|
77
|
-
response: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
|
|
78
|
-
authenticatorAttachment: z.ZodOptional<z.ZodString>;
|
|
79
|
-
clientExtensionResults: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
80
|
-
type: z.ZodString;
|
|
81
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
82
|
-
id: z.ZodString;
|
|
83
|
-
rawId: z.ZodString;
|
|
84
|
-
response: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
|
|
32
|
+
response: z.ZodObject<{}, z.core.$loose>;
|
|
85
33
|
authenticatorAttachment: z.ZodOptional<z.ZodString>;
|
|
86
|
-
clientExtensionResults: z.ZodOptional<z.ZodObject<{},
|
|
34
|
+
clientExtensionResults: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
87
35
|
type: z.ZodString;
|
|
88
|
-
}, z.
|
|
89
|
-
},
|
|
90
|
-
factor_id: string;
|
|
91
|
-
attestation: {
|
|
92
|
-
type: string;
|
|
93
|
-
id: string;
|
|
94
|
-
rawId: string;
|
|
95
|
-
response: {} & {
|
|
96
|
-
[k: string]: unknown;
|
|
97
|
-
};
|
|
98
|
-
authenticatorAttachment?: string | undefined;
|
|
99
|
-
clientExtensionResults?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
100
|
-
} & {
|
|
101
|
-
[k: string]: unknown;
|
|
102
|
-
};
|
|
103
|
-
label?: string | undefined;
|
|
104
|
-
}, {
|
|
105
|
-
factor_id: string;
|
|
106
|
-
attestation: {
|
|
107
|
-
type: string;
|
|
108
|
-
id: string;
|
|
109
|
-
rawId: string;
|
|
110
|
-
response: {} & {
|
|
111
|
-
[k: string]: unknown;
|
|
112
|
-
};
|
|
113
|
-
authenticatorAttachment?: string | undefined;
|
|
114
|
-
clientExtensionResults?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
115
|
-
} & {
|
|
116
|
-
[k: string]: unknown;
|
|
117
|
-
};
|
|
118
|
-
label?: string | undefined;
|
|
119
|
-
}>;
|
|
36
|
+
}, z.core.$loose>;
|
|
37
|
+
}, z.core.$strict>;
|
|
120
38
|
export type WebauthnVerifyEnrollmentBody = z.infer<typeof webauthnVerifyEnrollmentBodySchema>;
|
|
121
39
|
export declare const webauthnAuthenticationOptionsResponseSchema: z.ZodObject<{
|
|
122
|
-
options: z.ZodObject<{},
|
|
123
|
-
},
|
|
124
|
-
options: {} & {
|
|
125
|
-
[k: string]: unknown;
|
|
126
|
-
};
|
|
127
|
-
}, {
|
|
128
|
-
options: {} & {
|
|
129
|
-
[k: string]: unknown;
|
|
130
|
-
};
|
|
131
|
-
}>;
|
|
40
|
+
options: z.ZodObject<{}, z.core.$loose>;
|
|
41
|
+
}, z.core.$strict>;
|
|
132
42
|
export type WebauthnAuthenticationOptionsResponse = z.infer<typeof webauthnAuthenticationOptionsResponseSchema>;
|
|
133
43
|
export declare const webauthnCredentialSummarySchema: z.ZodObject<{
|
|
134
|
-
factor_id: z.
|
|
44
|
+
factor_id: z.ZodGUID;
|
|
135
45
|
label: z.ZodNullable<z.ZodString>;
|
|
136
46
|
created_at: z.ZodNumber;
|
|
137
47
|
last_used_at: z.ZodNullable<z.ZodNumber>;
|
|
138
|
-
},
|
|
139
|
-
factor_id: string;
|
|
140
|
-
last_used_at: number | null;
|
|
141
|
-
created_at: number;
|
|
142
|
-
label: string | null;
|
|
143
|
-
}, {
|
|
144
|
-
factor_id: string;
|
|
145
|
-
last_used_at: number | null;
|
|
146
|
-
created_at: number;
|
|
147
|
-
label: string | null;
|
|
148
|
-
}>;
|
|
48
|
+
}, z.core.$strict>;
|
|
149
49
|
export type WebauthnCredentialSummary = z.infer<typeof webauthnCredentialSummarySchema>;
|
|
150
50
|
export declare const webauthnCredentialListResponseSchema: z.ZodObject<{
|
|
151
51
|
credentials: z.ZodArray<z.ZodObject<{
|
|
152
|
-
factor_id: z.
|
|
52
|
+
factor_id: z.ZodGUID;
|
|
153
53
|
label: z.ZodNullable<z.ZodString>;
|
|
154
54
|
created_at: z.ZodNumber;
|
|
155
55
|
last_used_at: z.ZodNullable<z.ZodNumber>;
|
|
156
|
-
},
|
|
157
|
-
|
|
158
|
-
last_used_at: number | null;
|
|
159
|
-
created_at: number;
|
|
160
|
-
label: string | null;
|
|
161
|
-
}, {
|
|
162
|
-
factor_id: string;
|
|
163
|
-
last_used_at: number | null;
|
|
164
|
-
created_at: number;
|
|
165
|
-
label: string | null;
|
|
166
|
-
}>, "many">;
|
|
167
|
-
}, "strict", z.ZodTypeAny, {
|
|
168
|
-
credentials: {
|
|
169
|
-
factor_id: string;
|
|
170
|
-
last_used_at: number | null;
|
|
171
|
-
created_at: number;
|
|
172
|
-
label: string | null;
|
|
173
|
-
}[];
|
|
174
|
-
}, {
|
|
175
|
-
credentials: {
|
|
176
|
-
factor_id: string;
|
|
177
|
-
last_used_at: number | null;
|
|
178
|
-
created_at: number;
|
|
179
|
-
label: string | null;
|
|
180
|
-
}[];
|
|
181
|
-
}>;
|
|
56
|
+
}, z.core.$strict>>;
|
|
57
|
+
}, z.core.$strict>;
|
|
182
58
|
export type WebauthnCredentialListResponse = z.infer<typeof webauthnCredentialListResponseSchema>;
|
package/dist/mfa/webauthn.js
CHANGED
|
@@ -41,7 +41,7 @@ export const webauthnLabelSchema = z
|
|
|
41
41
|
// enrollment will be confirmed against.
|
|
42
42
|
export const webauthnEnrollOptionsResponseSchema = z
|
|
43
43
|
.object({
|
|
44
|
-
factor_id: z.
|
|
44
|
+
factor_id: z.guid(),
|
|
45
45
|
// PublicKeyCredentialCreationOptionsJSON — opaque to us, handed to the
|
|
46
46
|
// browser verbatim.
|
|
47
47
|
options: z.object({}).passthrough(),
|
|
@@ -50,7 +50,7 @@ export const webauthnEnrollOptionsResponseSchema = z
|
|
|
50
50
|
// Body for POST /api/user/mfa/webauthn/verify-enrollment.
|
|
51
51
|
export const webauthnVerifyEnrollmentBodySchema = z
|
|
52
52
|
.object({
|
|
53
|
-
factor_id: z.
|
|
53
|
+
factor_id: z.guid(),
|
|
54
54
|
label: webauthnLabelSchema.optional(),
|
|
55
55
|
attestation: webauthnRegistrationResponseSchema,
|
|
56
56
|
})
|
|
@@ -66,7 +66,7 @@ export const webauthnAuthenticationOptionsResponseSchema = z
|
|
|
66
66
|
// A single enrolled passkey as surfaced to the account settings UI.
|
|
67
67
|
export const webauthnCredentialSummarySchema = z
|
|
68
68
|
.object({
|
|
69
|
-
factor_id: z.
|
|
69
|
+
factor_id: z.guid(),
|
|
70
70
|
label: z.string().nullable(),
|
|
71
71
|
created_at: z.number().int().positive(),
|
|
72
72
|
last_used_at: z.number().int().positive().nullable(),
|
package/dist/mfa/webauthn.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webauthn.js","sourceRoot":"","sources":["../../src/mfa/webauthn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wEAAwE;AACxE,wEAAwE;AACxE,2EAA2E;AAC3E,0EAA0E;AAC1E,yEAAyE;AACzE,4EAA4E;AAC5E,6EAA6E;AAC7E,iDAAiD;AAEjD,8DAA8D;AAC9D,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC;KAChD,MAAM,CAAC;IACN,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE;IACpC,uBAAuB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9C,sBAAsB,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IAC7D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACxB,CAAC;KACD,WAAW,EAAE,CAAC;AAM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AE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const AuthMiddlewareErrorTypes: readonly ["Unauthorized", "Forbidden"];
|
|
3
3
|
export type AuthMiddlewareError = (typeof AuthMiddlewareErrorTypes)[number];
|
|
4
|
-
export declare const authMiddlewareErrorTypesSchema: z.
|
|
4
|
+
export declare const authMiddlewareErrorTypesSchema: z.ZodString & z.ZodType<"Unauthorized" | "Forbidden", string, z.core.$ZodTypeInternals<"Unauthorized" | "Forbidden", string>>;
|
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
import type { SchemaVaultsAppEnvironment } from "@schemavaults/app-definitions";
|
|
2
2
|
import type { NavigationPath } from "./parse-navigation-path";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
export declare const pageSecurityLevelSchema: z.ZodEnum<
|
|
4
|
+
export declare const pageSecurityLevelSchema: z.ZodEnum<{
|
|
5
|
+
admin: "admin";
|
|
6
|
+
public: "public";
|
|
7
|
+
unauthed: "unauthed";
|
|
8
|
+
authed: "authed";
|
|
9
|
+
api: "api";
|
|
10
|
+
}>;
|
|
5
11
|
type PageSecurityLevel = z.infer<typeof pageSecurityLevelSchema>;
|
|
6
12
|
export type AuthMiddlewareRules = Record<PageSecurityLevel, NavigationPath[]>;
|
|
7
13
|
export declare const authenticationStatusSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
8
|
-
status: z.ZodLiteral<"logged-in"
|
|
14
|
+
status: z.ZodNonOptional<z.ZodLiteral<"logged-in">>;
|
|
9
15
|
admin: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
-
},
|
|
11
|
-
status: "logged-
|
|
12
|
-
|
|
13
|
-
}, {
|
|
14
|
-
status: "logged-in";
|
|
15
|
-
admin?: boolean | undefined;
|
|
16
|
-
}>, z.ZodObject<{
|
|
17
|
-
status: z.ZodLiteral<"logged-out">;
|
|
18
|
-
}, "strict", z.ZodTypeAny, {
|
|
19
|
-
status: "logged-out";
|
|
20
|
-
}, {
|
|
21
|
-
status: "logged-out";
|
|
22
|
-
}>]>;
|
|
16
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
17
|
+
status: z.ZodNonOptional<z.ZodLiteral<"logged-out">>;
|
|
18
|
+
}, z.core.$strict>]>;
|
|
23
19
|
export type AuthenticationStatus = z.infer<typeof authenticationStatusSchema>;
|
|
24
20
|
type AuthMiddlewareResult = readonly [
|
|
25
21
|
AuthenticationStatus["status"],
|
package/dist/oidc/index.d.ts
CHANGED
|
@@ -3,3 +3,5 @@ export type { OidcSupportedScope, OidcScope, ParsedOidcScopes, } from "./scope";
|
|
|
3
3
|
export { oidcNonceSchema, OIDC_NONCE_VSCHAR_REGEX, parseOidcNonce, OidcNonceValidationError, } from "./nonce";
|
|
4
4
|
export type { OidcNonce } from "./nonce";
|
|
5
5
|
export { OIDC_SUB_CLAIM_DELIMITER, formatOidcSubClaim, parseOidcSubClaim, } from "./sub-claim";
|
|
6
|
+
export { buildOidcProfileClaims } from "./profile-claims";
|
|
7
|
+
export type { OidcProfileClaims, OidcProfileClaimsSource, } from "./profile-claims";
|
package/dist/oidc/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { OIDC_OPENID_SCOPE, OIDC_SUPPORTED_SCOPES, DEFAULT_AUTH_SCOPE, OIDC_SCOPE_REGEX, oidcScopeSchema, parseAndGrantScopes, serializeOidcScopes, } from "./scope";
|
|
2
2
|
export { oidcNonceSchema, OIDC_NONCE_VSCHAR_REGEX, parseOidcNonce, OidcNonceValidationError, } from "./nonce";
|
|
3
3
|
export { OIDC_SUB_CLAIM_DELIMITER, formatOidcSubClaim, parseOidcSubClaim, } from "./sub-claim";
|
|
4
|
+
export { buildOidcProfileClaims } from "./profile-claims";
|
|
4
5
|
//# sourceMappingURL=index.js.map
|
package/dist/oidc/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/oidc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,SAAS,CAAC;AAOjB,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,cAAc,EACd,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/oidc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,SAAS,CAAC;AAOjB,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,cAAc,EACd,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OIDC Core §5.1 standard claims gated by the `profile` scope, built
|
|
3
|
+
* from the user's stored profile name fields. Shared by every surface
|
|
4
|
+
* that emits profile claims — the id_token (`generateIdToken` in
|
|
5
|
+
* @schemavaults/jwt) and GET/POST /api/oidc/userinfo — so the two
|
|
6
|
+
* always agree for the same user.
|
|
7
|
+
*/
|
|
8
|
+
/** The profile name fields the claims are derived from (all optional). */
|
|
9
|
+
export interface OidcProfileClaimsSource {
|
|
10
|
+
username?: string;
|
|
11
|
+
first_name?: string;
|
|
12
|
+
middle_name?: string;
|
|
13
|
+
last_name?: string;
|
|
14
|
+
display_name?: string;
|
|
15
|
+
}
|
|
16
|
+
/** The OIDC Core §5.1 claims emitted under the `profile` scope. */
|
|
17
|
+
export interface OidcProfileClaims {
|
|
18
|
+
/**
|
|
19
|
+
* The user's full name in displayable form: the public display name
|
|
20
|
+
* when set, otherwise the joined first/middle/last name parts.
|
|
21
|
+
*/
|
|
22
|
+
name?: string;
|
|
23
|
+
given_name?: string;
|
|
24
|
+
middle_name?: string;
|
|
25
|
+
family_name?: string;
|
|
26
|
+
preferred_username?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Builds the `profile`-scoped claim set from a user's stored name
|
|
30
|
+
* fields. Claims without a stored value are omitted entirely (OIDC Core
|
|
31
|
+
* §5.3.2 — absent, not null/empty). Callers are responsible for only
|
|
32
|
+
* emitting the result when the `profile` scope was actually granted.
|
|
33
|
+
*/
|
|
34
|
+
export declare function buildOidcProfileClaims(user: OidcProfileClaimsSource): OidcProfileClaims;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OIDC Core §5.1 standard claims gated by the `profile` scope, built
|
|
3
|
+
* from the user's stored profile name fields. Shared by every surface
|
|
4
|
+
* that emits profile claims — the id_token (`generateIdToken` in
|
|
5
|
+
* @schemavaults/jwt) and GET/POST /api/oidc/userinfo — so the two
|
|
6
|
+
* always agree for the same user.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Builds the `profile`-scoped claim set from a user's stored name
|
|
10
|
+
* fields. Claims without a stored value are omitted entirely (OIDC Core
|
|
11
|
+
* §5.3.2 — absent, not null/empty). Callers are responsible for only
|
|
12
|
+
* emitting the result when the `profile` scope was actually granted.
|
|
13
|
+
*/
|
|
14
|
+
export function buildOidcProfileClaims(user) {
|
|
15
|
+
const claims = {};
|
|
16
|
+
const joined_name_parts = [
|
|
17
|
+
user.first_name,
|
|
18
|
+
user.middle_name,
|
|
19
|
+
user.last_name,
|
|
20
|
+
]
|
|
21
|
+
.filter((part) => typeof part === "string" && part.length > 0)
|
|
22
|
+
.join(" ");
|
|
23
|
+
const full_name = user.display_name && user.display_name.length > 0
|
|
24
|
+
? user.display_name
|
|
25
|
+
: joined_name_parts.length > 0
|
|
26
|
+
? joined_name_parts
|
|
27
|
+
: undefined;
|
|
28
|
+
if (full_name) {
|
|
29
|
+
claims.name = full_name;
|
|
30
|
+
}
|
|
31
|
+
if (user.first_name) {
|
|
32
|
+
claims.given_name = user.first_name;
|
|
33
|
+
}
|
|
34
|
+
if (user.middle_name) {
|
|
35
|
+
claims.middle_name = user.middle_name;
|
|
36
|
+
}
|
|
37
|
+
if (user.last_name) {
|
|
38
|
+
claims.family_name = user.last_name;
|
|
39
|
+
}
|
|
40
|
+
if (user.username) {
|
|
41
|
+
claims.preferred_username = user.username;
|
|
42
|
+
}
|
|
43
|
+
return claims;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=profile-claims.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-claims.js","sourceRoot":"","sources":["../../src/oidc/profile-claims.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAwBH;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CACpC,IAA6B;IAE7B,MAAM,MAAM,GAAsB,EAAE,CAAC;IAErC,MAAM,iBAAiB,GAAW;QAChC,IAAI,CAAC,UAAU;QACf,IAAI,CAAC,WAAW;QAChB,IAAI,CAAC,SAAS;KACf;SACE,MAAM,CACL,CAAC,IAAI,EAAkB,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CACtE;SACA,IAAI,CAAC,GAAG,CAAC,CAAC;IACb,MAAM,SAAS,GACb,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC;QAC/C,CAAC,CAAC,IAAI,CAAC,YAAY;QACnB,CAAC,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC;YAC5B,CAAC,CAAC,iBAAiB;YACnB,CAAC,CAAC,SAAS,CAAC;IAElB,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,CAAC,IAAI,GAAG,SAAS,CAAC;IAC1B,CAAC;IACD,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACtC,CAAC;IACD,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;QACrB,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;IACxC,CAAC;IACD,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;QACnB,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC;IACtC,CAAC;IACD,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QAClB,MAAM,CAAC,kBAAkB,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC5C,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -2,27 +2,14 @@ import { z } from "zod";
|
|
|
2
2
|
import { type OrganizationID } from "./organization_id";
|
|
3
3
|
export declare const inviteMemberInputModes: readonly ["email", "uid"];
|
|
4
4
|
export type InviteMemberInputMode = (typeof inviteMemberInputModes)[number];
|
|
5
|
-
export declare const inviteMemberFormSchema: z.
|
|
6
|
-
organization_id: z.
|
|
7
|
-
input_mode: z.ZodEnum<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}, {
|
|
14
|
-
organization_id: string;
|
|
15
|
-
input_mode: "uid" | "email";
|
|
16
|
-
identifier: string;
|
|
17
|
-
}>, {
|
|
18
|
-
organization_id: string;
|
|
19
|
-
input_mode: "uid" | "email";
|
|
20
|
-
identifier: string;
|
|
21
|
-
}, {
|
|
22
|
-
organization_id: string;
|
|
23
|
-
input_mode: "uid" | "email";
|
|
24
|
-
identifier: string;
|
|
25
|
-
}>;
|
|
5
|
+
export declare const inviteMemberFormSchema: z.ZodObject<{
|
|
6
|
+
organization_id: z.ZodNonOptional<z.ZodString>;
|
|
7
|
+
input_mode: z.ZodNonOptional<z.ZodEnum<{
|
|
8
|
+
uid: "uid";
|
|
9
|
+
email: "email";
|
|
10
|
+
}>>;
|
|
11
|
+
identifier: z.ZodNonOptional<z.ZodUnion<readonly [z.ZodGUID, z.ZodEmail]>>;
|
|
12
|
+
}, z.core.$strict>;
|
|
26
13
|
export type InviteMemberFormValues = z.infer<typeof inviteMemberFormSchema>;
|
|
27
14
|
export interface InviteMemberSubmitData {
|
|
28
15
|
organization_id: OrganizationID;
|
|
@@ -5,7 +5,7 @@ export const inviteMemberFormSchema = z
|
|
|
5
5
|
.object({
|
|
6
6
|
organization_id: organizationIdSchema,
|
|
7
7
|
input_mode: z.enum(inviteMemberInputModes),
|
|
8
|
-
identifier: z.union([z.
|
|
8
|
+
identifier: z.union([z.guid(), z.email()]),
|
|
9
9
|
})
|
|
10
10
|
.required({
|
|
11
11
|
organization_id: true,
|
|
@@ -15,18 +15,18 @@ export const inviteMemberFormSchema = z
|
|
|
15
15
|
.strict()
|
|
16
16
|
.superRefine((data, ctx) => {
|
|
17
17
|
if (data.input_mode === "uid") {
|
|
18
|
-
if (!z.
|
|
18
|
+
if (!z.guid().safeParse(data.identifier).success) {
|
|
19
19
|
ctx.addIssue({
|
|
20
|
-
code:
|
|
20
|
+
code: "custom",
|
|
21
21
|
message: "Must be a valid UUID",
|
|
22
22
|
path: ["identifier"],
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
else if (data.input_mode === "email") {
|
|
27
|
-
if (!z.
|
|
27
|
+
if (!z.email().safeParse(data.identifier).success) {
|
|
28
28
|
ctx.addIssue({
|
|
29
|
-
code:
|
|
29
|
+
code: "custom",
|
|
30
30
|
message: "Must be a valid email address",
|
|
31
31
|
path: ["identifier"],
|
|
32
32
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invite_member_form.js","sourceRoot":"","sources":["../../src/organizations/invite_member_form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,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CAAC;YACjD,GAAG,CAAC,QAAQ,CAAC;gBACX,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,sBAAsB;gBAC/B,IAAI,EAAE,CAAC,YAAY,CAAC;aACrB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;SAAM,IAAI,IAAI,CAAC,UAAU,KAAK,OAAO,EAAE,CAAC;QACvC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC;YAClD,GAAG,CAAC,QAAQ,CAAC;gBACX,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,+BAA+B;gBACxC,IAAI,EAAE,CAAC,YAAY,CAAC;aACrB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const organizationMembershipRoleTypes: readonly ["owner", "admin", "member"];
|
|
3
3
|
export type OrganizationMembershipRoleType = (typeof organizationMembershipRoleTypes)[number];
|
|
4
|
-
export declare const organizationMembershipRoleTypeSchema: z.
|
|
4
|
+
export declare const organizationMembershipRoleTypeSchema: z.ZodString & z.ZodType<"admin" | "owner" | "member", string, z.core.$ZodTypeInternals<"admin" | "owner" | "member", string>>;
|
|
5
5
|
export declare function isValidOrganizationMembershipRoleType(role: string): role is OrganizationMembershipRoleType;
|
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const organizationDefinitionSchema: z.ZodObject<{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
created_by: z.ZodNullable<z.ZodOptional<z.
|
|
7
|
-
},
|
|
8
|
-
created_at: number;
|
|
9
|
-
organization_id: string;
|
|
10
|
-
name: string;
|
|
11
|
-
created_by?: string | null | undefined;
|
|
12
|
-
}, {
|
|
13
|
-
created_at: number;
|
|
14
|
-
organization_id: string;
|
|
15
|
-
name: string;
|
|
16
|
-
created_by?: string | null | undefined;
|
|
17
|
-
}>;
|
|
3
|
+
organization_id: z.ZodNonOptional<z.ZodString>;
|
|
4
|
+
name: z.ZodNonOptional<z.ZodString>;
|
|
5
|
+
created_at: z.ZodNonOptional<z.ZodNumber>;
|
|
6
|
+
created_by: z.ZodNullable<z.ZodOptional<z.ZodGUID>>;
|
|
7
|
+
}, z.core.$strict>;
|
|
18
8
|
export type OrganizationDefinition = z.infer<typeof organizationDefinitionSchema>;
|
|
@@ -6,7 +6,7 @@ export const organizationDefinitionSchema = z
|
|
|
6
6
|
organization_id: organizationIdSchema,
|
|
7
7
|
name: organizationNameSchema,
|
|
8
8
|
created_at: z.number().positive(),
|
|
9
|
-
created_by: z.
|
|
9
|
+
created_by: z.guid().optional().nullable(),
|
|
10
10
|
})
|
|
11
11
|
.required({
|
|
12
12
|
organization_id: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization_definition.js","sourceRoot":"","sources":["../../src/organizations/organization_definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC;KAC1C,MAAM,CAAC;IACN,eAAe,EAAE,oBAAoB;IACrC,IAAI,EAAE,sBAAsB;IAC5B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,UAAU,EAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"organization_definition.js","sourceRoot":"","sources":["../../src/organizations/organization_definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC;KAC1C,MAAM,CAAC;IACN,eAAe,EAAE,oBAAoB;IACrC,IAAI,EAAE,sBAAsB;IAC5B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,UAAU,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC3C,CAAC;KACD,QAAQ,CAAC;IACR,eAAe,EAAE,IAAI;IACrB,IAAI,EAAE,IAAI;IACV,UAAU,EAAE,IAAI;CACjB,CAAC;KACD,MAAM,EAAE,CAAC"}
|
|
@@ -2,7 +2,13 @@ import { z } from "zod";
|
|
|
2
2
|
import { type OrganizationID } from "./organization_id";
|
|
3
3
|
export declare const organizationInvitationStatusTypes: readonly ["pending", "accepted", "declined", "revoked", "expired"];
|
|
4
4
|
export type OrganizationInvitationStatus = (typeof organizationInvitationStatusTypes)[number];
|
|
5
|
-
export declare const organizationInvitationStatusSchema: z.ZodEnum<
|
|
5
|
+
export declare const organizationInvitationStatusSchema: z.ZodEnum<{
|
|
6
|
+
pending: "pending";
|
|
7
|
+
accepted: "accepted";
|
|
8
|
+
declined: "declined";
|
|
9
|
+
revoked: "revoked";
|
|
10
|
+
expired: "expired";
|
|
11
|
+
}>;
|
|
6
12
|
/**
|
|
7
13
|
* Organization invitation as returned by the API for display in the UI.
|
|
8
14
|
* Includes display fields like organization_name and inviter_email.
|
|
@@ -49,39 +55,21 @@ export interface OrganizationInvitationWithUserData {
|
|
|
49
55
|
responded_at?: number | null;
|
|
50
56
|
}
|
|
51
57
|
export declare const organizationInvitationSchema: z.ZodObject<{
|
|
52
|
-
invitation_id: z.
|
|
53
|
-
organization_id: z.
|
|
58
|
+
invitation_id: z.ZodGUID;
|
|
59
|
+
organization_id: z.ZodString;
|
|
54
60
|
organization_name: z.ZodOptional<z.ZodString>;
|
|
55
|
-
inviter_uid: z.
|
|
56
|
-
inviter_email: z.ZodOptional<z.
|
|
57
|
-
invitee_uid: z.
|
|
58
|
-
invitee_email: z.ZodOptional<z.
|
|
59
|
-
status: z.ZodEnum<
|
|
61
|
+
inviter_uid: z.ZodGUID;
|
|
62
|
+
inviter_email: z.ZodOptional<z.ZodEmail>;
|
|
63
|
+
invitee_uid: z.ZodGUID;
|
|
64
|
+
invitee_email: z.ZodOptional<z.ZodEmail>;
|
|
65
|
+
status: z.ZodEnum<{
|
|
66
|
+
pending: "pending";
|
|
67
|
+
accepted: "accepted";
|
|
68
|
+
declined: "declined";
|
|
69
|
+
revoked: "revoked";
|
|
70
|
+
expired: "expired";
|
|
71
|
+
}>;
|
|
60
72
|
created_at: z.ZodNumber;
|
|
61
73
|
expires_at: z.ZodNumber;
|
|
62
74
|
responded_at: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
63
|
-
},
|
|
64
|
-
status: "pending" | "accepted" | "declined" | "revoked" | "expired";
|
|
65
|
-
expires_at: number;
|
|
66
|
-
created_at: number;
|
|
67
|
-
organization_id: string;
|
|
68
|
-
invitation_id: string;
|
|
69
|
-
inviter_uid: string;
|
|
70
|
-
invitee_uid: string;
|
|
71
|
-
organization_name?: string | undefined;
|
|
72
|
-
inviter_email?: string | undefined;
|
|
73
|
-
invitee_email?: string | undefined;
|
|
74
|
-
responded_at?: number | null | undefined;
|
|
75
|
-
}, {
|
|
76
|
-
status: "pending" | "accepted" | "declined" | "revoked" | "expired";
|
|
77
|
-
expires_at: number;
|
|
78
|
-
created_at: number;
|
|
79
|
-
organization_id: string;
|
|
80
|
-
invitation_id: string;
|
|
81
|
-
inviter_uid: string;
|
|
82
|
-
invitee_uid: string;
|
|
83
|
-
organization_name?: string | undefined;
|
|
84
|
-
inviter_email?: string | undefined;
|
|
85
|
-
invitee_email?: string | undefined;
|
|
86
|
-
responded_at?: number | null | undefined;
|
|
87
|
-
}>;
|
|
75
|
+
}, z.core.$strip>;
|
|
@@ -9,13 +9,13 @@ export const organizationInvitationStatusTypes = [
|
|
|
9
9
|
];
|
|
10
10
|
export const organizationInvitationStatusSchema = z.enum(organizationInvitationStatusTypes);
|
|
11
11
|
export const organizationInvitationSchema = z.object({
|
|
12
|
-
invitation_id: z.
|
|
12
|
+
invitation_id: z.guid(),
|
|
13
13
|
organization_id: organizationIdSchema,
|
|
14
14
|
organization_name: z.string().optional(),
|
|
15
|
-
inviter_uid: z.
|
|
16
|
-
inviter_email: z.
|
|
17
|
-
invitee_uid: z.
|
|
18
|
-
invitee_email: z.
|
|
15
|
+
inviter_uid: z.guid(),
|
|
16
|
+
inviter_email: z.email().optional(),
|
|
17
|
+
invitee_uid: z.guid(),
|
|
18
|
+
invitee_email: z.email().optional(),
|
|
19
19
|
status: organizationInvitationStatusSchema,
|
|
20
20
|
created_at: z.number().positive(),
|
|
21
21
|
expires_at: z.number().positive(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization_invitation.js","sourceRoot":"","sources":["../../src/organizations/organization_invitation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAuB,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9E,MAAM,CAAC,MAAM,iCAAiC,GAAG;IAC/C,SAAS;IACT,UAAU;IACV,UAAU;IACV,SAAS;IACT,SAAS;CACD,CAAC;AAKX,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;AAkD5F,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,aAAa,EAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"organization_invitation.js","sourceRoot":"","sources":["../../src/organizations/organization_invitation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAuB,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9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