@schemavaults/auth-common 0.25.0 → 0.26.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/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/endpoints.d.ts +32 -0
- package/dist/oidc/endpoints.js +42 -0
- package/dist/oidc/endpoints.js.map +1 -0
- package/dist/oidc/index.d.ts +6 -0
- package/dist/oidc/index.js +3 -0
- package/dist/oidc/index.js.map +1 -1
- package/dist/oidc/provider-metadata.d.ts +51 -0
- package/dist/oidc/provider-metadata.js +94 -0
- package/dist/oidc/provider-metadata.js.map +1 -0
- package/dist/oidc/token-endpoint-extensions.d.ts +58 -0
- package/dist/oidc/token-endpoint-extensions.js +69 -0
- package/dist/oidc/token-endpoint-extensions.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 +54 -524
- 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/user_data.d.ts +7 -71
- package/dist/user_data/user_data.js +3 -3
- package/dist/user_data/user_data.js.map +1 -1
- package/dist/user_data/user_profile.d.ts +4 -58
- package/package.json +3 -3
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token-endpoint request/response parameters used by the SchemaVaults
|
|
3
|
+
* SDKs on top of the standard OIDC token endpoint (`/api/oidc/token`).
|
|
4
|
+
*
|
|
5
|
+
* The platform's SDK clients need two things a plain OIDC relying party
|
|
6
|
+
* does not:
|
|
7
|
+
*
|
|
8
|
+
* 1. Access tokens for arbitrary registered API servers (the platform's
|
|
9
|
+
* authorization model is audience-based). This uses the STANDARD
|
|
10
|
+
* RFC 8707 `resource` parameter: the token endpoint mints the
|
|
11
|
+
* response's `access_token` for that audience instead of the
|
|
12
|
+
* reserved `oidc-userinfo` audience. Exactly one `resource` per
|
|
13
|
+
* token request (the platform issues one encrypted access token per
|
|
14
|
+
* audience, so it "only supports issuing an access token with a
|
|
15
|
+
* single audience" in RFC 8707 §2 terms).
|
|
16
|
+
*
|
|
17
|
+
* 2. Refresh tokens kept out of JavaScript for browser clients. This
|
|
18
|
+
* is a platform extension: the `refresh_token_delivery` request
|
|
19
|
+
* parameter asks the endpoint to set the refresh token as an
|
|
20
|
+
* HTTP-only cookie (scoped to the client app, on the auth server's
|
|
21
|
+
* domain) and OMIT `refresh_token` from the JSON body. RFC 6749
|
|
22
|
+
* §5.1 makes `refresh_token` OPTIONAL in the response, so
|
|
23
|
+
* spec-compliant client libraries (e.g. `openid-client`) accept
|
|
24
|
+
* such responses unchanged. The response always carries the
|
|
25
|
+
* extension field `refresh_token_expires_in` (seconds) so the client
|
|
26
|
+
* can track the session lifetime either way.
|
|
27
|
+
*
|
|
28
|
+
* Relying parties that send neither parameter get the plain OIDC
|
|
29
|
+
* behavior (userinfo-audience access token, refresh token inlined).
|
|
30
|
+
*/
|
|
31
|
+
import { z } from "zod";
|
|
32
|
+
/** RFC 8707 Resource Indicators request parameter name. */
|
|
33
|
+
export const OIDC_TOKEN_RESOURCE_PARAM = "resource";
|
|
34
|
+
/** Platform extension: how the refresh token is delivered to the client. */
|
|
35
|
+
export const OIDC_TOKEN_REFRESH_TOKEN_DELIVERY_PARAM = "refresh_token_delivery";
|
|
36
|
+
export const OIDC_REFRESH_TOKEN_DELIVERY_MODES = [
|
|
37
|
+
/** RFC 6749 §5.1 default: `refresh_token` inlined in the JSON body. */
|
|
38
|
+
"inline",
|
|
39
|
+
/**
|
|
40
|
+
* Refresh token set as an HTTP-only cookie (`refresh_token_<client_id>`
|
|
41
|
+
* plus the JS-readable `refresh_token_expiry_<client_id>` marker) and
|
|
42
|
+
* omitted from the JSON body.
|
|
43
|
+
*/
|
|
44
|
+
"http_only_cookie",
|
|
45
|
+
];
|
|
46
|
+
export const oidcRefreshTokenDeliveryModeSchema = z.enum(OIDC_REFRESH_TOKEN_DELIVERY_MODES);
|
|
47
|
+
export const DEFAULT_OIDC_REFRESH_TOKEN_DELIVERY_MODE = "inline";
|
|
48
|
+
/**
|
|
49
|
+
* Platform extension response field: seconds until the (possibly
|
|
50
|
+
* cookie-delivered) refresh token expires. Named after the widely used
|
|
51
|
+
* non-standard field of the same name (GitHub, Keycloak's
|
|
52
|
+
* `refresh_expires_in`, ...).
|
|
53
|
+
*/
|
|
54
|
+
export const OIDC_TOKEN_REFRESH_TOKEN_EXPIRES_IN_FIELD = "refresh_token_expires_in";
|
|
55
|
+
/**
|
|
56
|
+
* Shape of the extension fields the SDK reads off a token response.
|
|
57
|
+
* `refresh_token_expires_in` is emitted by the auth server on every
|
|
58
|
+
* successful response whose grant issued a refresh token.
|
|
59
|
+
*/
|
|
60
|
+
export const oidcTokenResponseExtensionsSchema = z
|
|
61
|
+
.object({
|
|
62
|
+
[OIDC_TOKEN_REFRESH_TOKEN_EXPIRES_IN_FIELD]: z
|
|
63
|
+
.number()
|
|
64
|
+
.int()
|
|
65
|
+
.positive()
|
|
66
|
+
.optional(),
|
|
67
|
+
})
|
|
68
|
+
.loose();
|
|
69
|
+
//# sourceMappingURL=token-endpoint-extensions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-endpoint-extensions.js","sourceRoot":"","sources":["../../src/oidc/token-endpoint-extensions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,2DAA2D;AAC3D,MAAM,CAAC,MAAM,yBAAyB,GAAG,UAAmB,CAAC;AAE7D,4EAA4E;AAC5E,MAAM,CAAC,MAAM,uCAAuC,GAClD,wBAAiC,CAAC;AAEpC,MAAM,CAAC,MAAM,iCAAiC,GAAG;IAC/C,uEAAuE;IACvE,QAAQ;IACR;;;;OAIG;IACH,kBAAkB;CACV,CAAC;AAEX,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,IAAI,CACtD,iCAAiC,CAClC,CAAC;AAMF,MAAM,CAAC,MAAM,wCAAwC,GACnD,QAAwD,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yCAAyC,GACpD,0BAAmC,CAAC;AAEtC;;;;GAIG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC;IACN,CAAC,yCAAyC,CAAC,EAAE,CAAC;SAC3C,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,QAAQ,EAAE;CACd,CAAC;KACD,KAAK,EAAE,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,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAuB,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,OAAO,EAAE,KAAK,CAAU,CAAC;AAGhE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC;KACpC,MAAM,CAAC;IACN,eAAe,EAAE,oBAAoB;IACrC,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC;IAC1C,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"invite_member_form.js","sourceRoot":"","sources":["../../src/organizations/invite_member_form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAuB,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,OAAO,EAAE,KAAK,CAAU,CAAC;AAGhE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC;KACpC,MAAM,CAAC;IACN,eAAe,EAAE,oBAAoB;IACrC,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC;IAC1C,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;CAC3C,CAAC;KACD,QAAQ,CAAC;IACR,eAAe,EAAE,IAAI;IACrB,UAAU,EAAE,IAAI;IAChB,UAAU,EAAE,IAAI;CACjB,CAAC;KACD,MAAM,EAAE;KACR,WAAW,CAAC,CAAC,IAAI,EAAE,GAAoB,EAAE,EAAE;IAC1C,IAAI,IAAI,CAAC,UAAU,KAAK,KAAK,EAAE,CAAC;QAC9B,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,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;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,IAAI,EAAE;IACvB,eAAe,EAAE,oBAAoB;IACrC,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,WAAW,EAAE,CAAC,CAAC,IAAI,EAAE;IACrB,aAAa,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IACnC,WAAW,EAAE,CAAC,CAAC,IAAI,EAAE;IACrB,aAAa,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IACnC,MAAM,EAAE,kCAAkC;IAC1C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC1D,CAAC,CAAC"}
|
|
@@ -23,22 +23,10 @@ export interface OrganizationMembershipRoleDetails {
|
|
|
23
23
|
joined_at: number;
|
|
24
24
|
}
|
|
25
25
|
export declare const organizationMembershipRoleDetailsSchema: z.ZodObject<{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
created_at: number;
|
|
33
|
-
organization_id: string;
|
|
34
|
-
organization_name: string;
|
|
35
|
-
joined_at: number;
|
|
36
|
-
role: "admin" | "owner" | "member";
|
|
37
|
-
}, {
|
|
38
|
-
created_at: number;
|
|
39
|
-
organization_id: string;
|
|
40
|
-
organization_name: string;
|
|
41
|
-
joined_at: number;
|
|
42
|
-
role: "admin" | "owner" | "member";
|
|
43
|
-
}>;
|
|
26
|
+
organization_id: z.ZodNonOptional<z.ZodString>;
|
|
27
|
+
organization_name: z.ZodNonOptional<z.ZodString>;
|
|
28
|
+
role: z.ZodNonOptional<z.ZodType<"admin" | "owner" | "member", unknown, z.core.$ZodTypeInternals<"admin" | "owner" | "member", unknown>>>;
|
|
29
|
+
created_at: z.ZodNonOptional<z.ZodNumber>;
|
|
30
|
+
joined_at: z.ZodNonOptional<z.ZodNumber>;
|
|
31
|
+
}, z.core.$strict>;
|
|
44
32
|
export declare function isValidOrganizationMembershipRoleDetails(value: unknown): value is OrganizationMembershipRoleDetails;
|
package/dist/pagination.d.ts
CHANGED
|
@@ -4,12 +4,6 @@ export declare const DEFAULT_PAGINATION_PAGE_INDEX: 0;
|
|
|
4
4
|
export declare const paginationOptionsSchema: z.ZodObject<{
|
|
5
5
|
page_index: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
6
6
|
page_size: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
7
|
-
},
|
|
8
|
-
page_index?: number | undefined;
|
|
9
|
-
page_size?: number | undefined;
|
|
10
|
-
}, {
|
|
11
|
-
page_index?: number | undefined;
|
|
12
|
-
page_size?: number | undefined;
|
|
13
|
-
}>;
|
|
7
|
+
}, z.core.$strict>;
|
|
14
8
|
export type PaginationOptions = z.infer<typeof paginationOptionsSchema>;
|
|
15
9
|
export declare function isValidPaginationOptions(val: unknown): val is PaginationOptions;
|
|
@@ -9,21 +9,13 @@ export interface CreateCodeChallengeInputOptions {
|
|
|
9
9
|
sha256: (code_verifier: string) => Promise<string>;
|
|
10
10
|
}
|
|
11
11
|
export declare function create_code_challenge(verifier_opts: CreateCodeChallengeInputOptions): Promise<CodeChallengeWithDetails>;
|
|
12
|
-
export declare const codeChallengeSchema: z.
|
|
12
|
+
export declare const codeChallengeSchema: z.ZodString;
|
|
13
13
|
export type CodeChallenge = z.infer<typeof codeChallengeSchema>;
|
|
14
14
|
export declare const codeChallengeWithDetailsSchema: z.ZodObject<{
|
|
15
|
-
code_challenge: z.
|
|
16
|
-
code_challenge_method: z.ZodLiteral<"S256"
|
|
17
|
-
challenge_time: z.ZodNumber
|
|
18
|
-
},
|
|
19
|
-
challenge_time: number;
|
|
20
|
-
code_challenge: string;
|
|
21
|
-
code_challenge_method: "S256";
|
|
22
|
-
}, {
|
|
23
|
-
challenge_time: number;
|
|
24
|
-
code_challenge: string;
|
|
25
|
-
code_challenge_method: "S256";
|
|
26
|
-
}>;
|
|
15
|
+
code_challenge: z.ZodNonOptional<z.ZodString>;
|
|
16
|
+
code_challenge_method: z.ZodNonOptional<z.ZodLiteral<"S256">>;
|
|
17
|
+
challenge_time: z.ZodNonOptional<z.ZodNumber>;
|
|
18
|
+
}, z.core.$strict>;
|
|
27
19
|
export type CodeChallengeWithDetails = {
|
|
28
20
|
code_challenge: CodeChallenge;
|
|
29
21
|
code_challenge_method: typeof code_challenge_method;
|
|
@@ -6,22 +6,12 @@ export interface CreateCodeVerifierInputOptions {
|
|
|
6
6
|
debug?: boolean;
|
|
7
7
|
}
|
|
8
8
|
export declare function create_code_verifier({ challenge_time, generateRandomCodeVerifier, debug, }: CreateCodeVerifierInputOptions): CodeVerifierWithDetails;
|
|
9
|
-
export declare const codeVerifierSchema: z.
|
|
9
|
+
export declare const codeVerifierSchema: z.ZodString;
|
|
10
10
|
export type CodeVerifier = z.infer<typeof codeVerifierSchema>;
|
|
11
11
|
export declare const codeVerifierWithDetailsSchema: z.ZodObject<{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
expires_at: z.ZodNumber
|
|
15
|
-
max_age: z.ZodNumber
|
|
16
|
-
},
|
|
17
|
-
challenge_time: number;
|
|
18
|
-
code_verifier: string;
|
|
19
|
-
expires_at: number;
|
|
20
|
-
max_age: number;
|
|
21
|
-
}, {
|
|
22
|
-
challenge_time: number;
|
|
23
|
-
code_verifier: string;
|
|
24
|
-
expires_at: number;
|
|
25
|
-
max_age: number;
|
|
26
|
-
}>;
|
|
12
|
+
code_verifier: z.ZodNonOptional<z.ZodString>;
|
|
13
|
+
challenge_time: z.ZodNonOptional<z.ZodNumber>;
|
|
14
|
+
expires_at: z.ZodNonOptional<z.ZodNumber>;
|
|
15
|
+
max_age: z.ZodNonOptional<z.ZodNumber>;
|
|
16
|
+
}, z.core.$strict>;
|
|
27
17
|
export type CodeVerifierWithDetails = z.infer<typeof codeVerifierWithDetailsSchema>;
|
package/dist/pkce/pkce.d.ts
CHANGED
|
@@ -29,37 +29,19 @@ export declare class PKCE_ProofKeyManager {
|
|
|
29
29
|
getCodeChallenge(): Promise<CodeChallengeWithDetails>;
|
|
30
30
|
get challenge_time(): number;
|
|
31
31
|
get expiry_time(): number;
|
|
32
|
-
static get codeVerifierSchema(): import("zod").
|
|
32
|
+
static get codeVerifierSchema(): import("zod").ZodString;
|
|
33
33
|
static get codeVerifierWithDetailsSchema(): import("zod").ZodObject<{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
expires_at: import("zod").ZodNumber
|
|
37
|
-
max_age: import("zod").ZodNumber
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
code_verifier: string;
|
|
41
|
-
expires_at: number;
|
|
42
|
-
max_age: number;
|
|
43
|
-
}, {
|
|
44
|
-
challenge_time: number;
|
|
45
|
-
code_verifier: string;
|
|
46
|
-
expires_at: number;
|
|
47
|
-
max_age: number;
|
|
48
|
-
}>;
|
|
49
|
-
static get codeChallengeSchema(): import("zod").ZodEffects<import("zod").ZodString, string, string>;
|
|
34
|
+
code_verifier: import("zod").ZodNonOptional<import("zod").ZodString>;
|
|
35
|
+
challenge_time: import("zod").ZodNonOptional<import("zod").ZodNumber>;
|
|
36
|
+
expires_at: import("zod").ZodNonOptional<import("zod").ZodNumber>;
|
|
37
|
+
max_age: import("zod").ZodNonOptional<import("zod").ZodNumber>;
|
|
38
|
+
}, import("zod/v4/core").$strict>;
|
|
39
|
+
static get codeChallengeSchema(): import("zod").ZodString;
|
|
50
40
|
static get codeChallengeWithOptionsSchema(): import("zod").ZodObject<{
|
|
51
|
-
code_challenge: import("zod").
|
|
52
|
-
code_challenge_method: import("zod").ZodLiteral<"S256"
|
|
53
|
-
challenge_time: import("zod").ZodNumber
|
|
54
|
-
},
|
|
55
|
-
challenge_time: number;
|
|
56
|
-
code_challenge: string;
|
|
57
|
-
code_challenge_method: "S256";
|
|
58
|
-
}, {
|
|
59
|
-
challenge_time: number;
|
|
60
|
-
code_challenge: string;
|
|
61
|
-
code_challenge_method: "S256";
|
|
62
|
-
}>;
|
|
41
|
+
code_challenge: import("zod").ZodNonOptional<import("zod").ZodString>;
|
|
42
|
+
code_challenge_method: import("zod").ZodNonOptional<import("zod").ZodLiteral<"S256">>;
|
|
43
|
+
challenge_time: import("zod").ZodNonOptional<import("zod").ZodNumber>;
|
|
44
|
+
}, import("zod/v4/core").$strict>;
|
|
63
45
|
static get max_age(): number;
|
|
64
46
|
static get codeChallengeMethod(): typeof code_challenge_method;
|
|
65
47
|
static isValidCodeVerifierFormat(maybe_code_verifier: unknown): maybe_code_verifier is CodeVerifierWithDetails;
|