@schemavaults/auth-common 0.8.2 → 0.8.7
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/AccessTokenCookieNames.d.ts +3 -0
- package/dist/AccessTokenCookieNames.js +7 -0
- package/dist/AccessTokenCookieNames.js.map +1 -0
- package/dist/MaximumBrowserCookieSize.d.ts +3 -0
- package/dist/MaximumBrowserCookieSize.js +4 -0
- package/dist/MaximumBrowserCookieSize.js.map +1 -0
- package/dist/RefreshTokenCookieNames.d.ts +3 -0
- package/dist/RefreshTokenCookieNames.js +7 -0
- package/dist/RefreshTokenCookieNames.js.map +1 -0
- package/dist/audience-schema.d.ts +2 -2
- package/dist/auth_acquire_tokens_grant_types.d.ts +4 -4
- package/dist/index.d.ts +5 -2
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/organizations/index.d.ts +3 -0
- package/dist/organizations/index.js +2 -0
- package/dist/organizations/index.js.map +1 -1
- package/dist/organizations/organization_constants.d.ts +2 -1
- package/dist/organizations/organization_constants.js +2 -1
- package/dist/organizations/organization_constants.js.map +1 -1
- package/dist/organizations/organization_invitation.d.ts +87 -0
- package/dist/organizations/organization_invitation.js +24 -0
- package/dist/organizations/organization_invitation.js.map +1 -0
- package/dist/request_tokens_result.d.ts +2 -2
- package/package.json +30 -3
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ApiServerId } from "@schemavaults/app-definitions";
|
|
2
|
+
export declare function AccessTokenCookieName(api_server_id: ApiServerId): `access_token_${ApiServerId}`;
|
|
3
|
+
export declare function AccessTokenExpiryCookieName(api_server_id: ApiServerId): `access_token_expiry_${ApiServerId}`;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function AccessTokenCookieName(api_server_id) {
|
|
2
|
+
return `access_token_${api_server_id}`;
|
|
3
|
+
}
|
|
4
|
+
export function AccessTokenExpiryCookieName(api_server_id) {
|
|
5
|
+
return `access_token_expiry_${api_server_id}`;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=AccessTokenCookieNames.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccessTokenCookieNames.js","sourceRoot":"","sources":["../src/AccessTokenCookieNames.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,qBAAqB,CACnC,aAA0B;IAE1B,OAAO,gBAAgB,aAAa,EAAE,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,2BAA2B,CACzC,aAA0B;IAE1B,OAAO,uBAAuB,aAAa,EAAE,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MaximumBrowserCookieSize.js","sourceRoot":"","sources":["../src/MaximumBrowserCookieSize.ts"],"names":[],"mappings":"AAAA,MAAM,wBAAwB,GAAG,IAAI,CAAC,CAAC,MAAM;AAE7C,OAAO,EAAE,wBAAwB,EAAE,CAAC;AACpC,eAAe,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefreshTokenCookieNames.js","sourceRoot":"","sources":["../src/RefreshTokenCookieNames.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,sBAAsB,CACpC,MAAa;IAEb,OAAO,iBAAiB,MAAM,EAAE,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,MAAa;IAEb,OAAO,wBAAwB,MAAM,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const audienceRefSchema: z.ZodUnion<[z.ZodString, z.
|
|
3
|
-
export declare const audienceSchema: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.
|
|
2
|
+
export declare const audienceRefSchema: z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, "schemavaults-auth" | "schemavaults-mail" | "schemavaults-registry", string>]>;
|
|
3
|
+
export declare const audienceSchema: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, "schemavaults-auth" | "schemavaults-mail" | "schemavaults-registry", string>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, "schemavaults-auth" | "schemavaults-mail" | "schemavaults-registry", string>]>, "many">]>;
|
|
@@ -4,7 +4,7 @@ export declare const authorizationCodePOSTbody: z.ZodObject<{
|
|
|
4
4
|
code: z.ZodEffects<z.ZodString, string, string>;
|
|
5
5
|
challenge_time: z.ZodNumber;
|
|
6
6
|
code_verifier: z.ZodEffects<z.ZodString, string, string>;
|
|
7
|
-
audience: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.
|
|
7
|
+
audience: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, "schemavaults-auth" | "schemavaults-mail" | "schemavaults-registry", string>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, "schemavaults-auth" | "schemavaults-mail" | "schemavaults-registry", string>]>, "many">]>;
|
|
8
8
|
client_app_id: z.ZodUnion<readonly [z.ZodString, z.ZodEffects<z.ZodString, "schemavaults-auth" | "schemavaults-mail" | "schemavaults-web" | "schemavaults-cli", string>]>;
|
|
9
9
|
grant_type: z.ZodLiteral<"authorization_code">;
|
|
10
10
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -23,7 +23,7 @@ export declare const authorizationCodePOSTbody: z.ZodObject<{
|
|
|
23
23
|
grant_type: "authorization_code";
|
|
24
24
|
}>;
|
|
25
25
|
export declare const refreshTokenPOSTbody: z.ZodObject<{
|
|
26
|
-
audience: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.
|
|
26
|
+
audience: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, "schemavaults-auth" | "schemavaults-mail" | "schemavaults-registry", string>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, "schemavaults-auth" | "schemavaults-mail" | "schemavaults-registry", string>]>, "many">]>;
|
|
27
27
|
client_app_id: z.ZodUnion<readonly [z.ZodString, z.ZodEffects<z.ZodString, "schemavaults-auth" | "schemavaults-mail" | "schemavaults-web" | "schemavaults-cli", string>]>;
|
|
28
28
|
grant_type: z.ZodLiteral<"refresh_token">;
|
|
29
29
|
replaceRefreshToo: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -43,7 +43,7 @@ export declare const grantTypePOSTbodySchemaMap: {
|
|
|
43
43
|
code: z.ZodEffects<z.ZodString, string, string>;
|
|
44
44
|
challenge_time: z.ZodNumber;
|
|
45
45
|
code_verifier: z.ZodEffects<z.ZodString, string, string>;
|
|
46
|
-
audience: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.
|
|
46
|
+
audience: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, "schemavaults-auth" | "schemavaults-mail" | "schemavaults-registry", string>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, "schemavaults-auth" | "schemavaults-mail" | "schemavaults-registry", string>]>, "many">]>;
|
|
47
47
|
client_app_id: z.ZodUnion<readonly [z.ZodString, z.ZodEffects<z.ZodString, "schemavaults-auth" | "schemavaults-mail" | "schemavaults-web" | "schemavaults-cli", string>]>;
|
|
48
48
|
grant_type: z.ZodLiteral<"authorization_code">;
|
|
49
49
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -62,7 +62,7 @@ export declare const grantTypePOSTbodySchemaMap: {
|
|
|
62
62
|
grant_type: "authorization_code";
|
|
63
63
|
}>;
|
|
64
64
|
readonly refresh_token: z.ZodObject<{
|
|
65
|
-
audience: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.
|
|
65
|
+
audience: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, "schemavaults-auth" | "schemavaults-mail" | "schemavaults-registry", string>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, "schemavaults-auth" | "schemavaults-mail" | "schemavaults-registry", string>]>, "many">]>;
|
|
66
66
|
client_app_id: z.ZodUnion<readonly [z.ZodString, z.ZodEffects<z.ZodString, "schemavaults-auth" | "schemavaults-mail" | "schemavaults-web" | "schemavaults-cli", string>]>;
|
|
67
67
|
grant_type: z.ZodLiteral<"refresh_token">;
|
|
68
68
|
replaceRefreshToo: z.ZodOptional<z.ZodBoolean>;
|
package/dist/index.d.ts
CHANGED
|
@@ -17,5 +17,8 @@ export { appIdSchema } from "@schemavaults/app-definitions";
|
|
|
17
17
|
export { audienceSchema, audienceRefSchema } from "./audience-schema";
|
|
18
18
|
export { inviteCodeFormatSchema, inviteCodeDefinitionSchema, } from "./invite-code";
|
|
19
19
|
export type { InviteCode, InviteCodeDefinition } from "./invite-code";
|
|
20
|
-
export { organizationIdSchema, isValidOrganizationID, organizationDefinitionSchema, hardcodedOrgs, SCHEMAVAULTS_ORGANIZATION_ID, inviteMemberInputModes, inviteMemberFormSchema, } from "./organizations";
|
|
21
|
-
export type { OrganizationID, OrganizationDefinition, InviteMemberInputMode, InviteMemberFormValues, InviteMemberSubmitData, } from "./organizations";
|
|
20
|
+
export { organizationIdSchema, isValidOrganizationID, organizationDefinitionSchema, hardcodedOrgs, SCHEMAVAULTS_ORGANIZATION_ID, MAXIMUM_USER_ORGANIZATIONS, MINIMUM_ORGANIZATION_ID_LENGTH, MAXIMUM_ORGANIZATION_ID_LENGTH, inviteMemberInputModes, inviteMemberFormSchema, organizationInvitationStatusTypes, organizationInvitationStatusSchema, organizationInvitationSchema, } from "./organizations";
|
|
21
|
+
export type { OrganizationID, OrganizationDefinition, InviteMemberInputMode, InviteMemberFormValues, InviteMemberSubmitData, OrganizationInvitationStatus, OrganizationInvitation, UserPendingInvitation, OrganizationInvitationWithUserData, } from "./organizations";
|
|
22
|
+
export { MaximumBrowserCookieSize } from "./MaximumBrowserCookieSize";
|
|
23
|
+
export { RefreshTokenCookieName, RefreshTokenExpiryCookieName, } from "./RefreshTokenCookieNames";
|
|
24
|
+
export { AccessTokenCookieName, AccessTokenExpiryCookieName, } from "./AccessTokenCookieNames";
|
package/dist/index.js
CHANGED
|
@@ -11,5 +11,8 @@ export { PRODUCTION_AUTH_SERVER_URL } from "@schemavaults/app-definitions";
|
|
|
11
11
|
export { appIdSchema } from "@schemavaults/app-definitions";
|
|
12
12
|
export { audienceSchema, audienceRefSchema } from "./audience-schema";
|
|
13
13
|
export { inviteCodeFormatSchema, inviteCodeDefinitionSchema, } from "./invite-code";
|
|
14
|
-
export { organizationIdSchema, isValidOrganizationID, organizationDefinitionSchema, hardcodedOrgs, SCHEMAVAULTS_ORGANIZATION_ID, inviteMemberInputModes, inviteMemberFormSchema, } from "./organizations";
|
|
14
|
+
export { organizationIdSchema, isValidOrganizationID, organizationDefinitionSchema, hardcodedOrgs, SCHEMAVAULTS_ORGANIZATION_ID, MAXIMUM_USER_ORGANIZATIONS, MINIMUM_ORGANIZATION_ID_LENGTH, MAXIMUM_ORGANIZATION_ID_LENGTH, inviteMemberInputModes, inviteMemberFormSchema, organizationInvitationStatusTypes, organizationInvitationStatusSchema, organizationInvitationSchema, } from "./organizations";
|
|
15
|
+
export { MaximumBrowserCookieSize } from "./MaximumBrowserCookieSize";
|
|
16
|
+
export { RefreshTokenCookieName, RefreshTokenExpiryCookieName, } from "./RefreshTokenCookieNames";
|
|
17
|
+
export { AccessTokenCookieName, AccessTokenExpiryCookieName, } from "./AccessTokenCookieNames";
|
|
15
18
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,aAAa,CAAC;AAE5D,cAAc,eAAe,CAAC;AAG9B,mBAAmB;AACnB,cAAc,cAAc,CAAC;AAM7B,cAAc,cAAc,CAAC;AAG7B,cAAc,QAAQ,CAAC;AAGvB,OAAO,EACL,wBAAwB,GAEzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,yBAAyB,EAEzB,uCAAuC,GAExC,MAAM,yBAAyB,CAAC;AAEjC,cAAc,mCAAmC,CAAC;AAGlD,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtE,OAAO,EACL,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,4BAA4B,EAC5B,aAAa,EACb,4BAA4B,EAC5B,sBAAsB,EACtB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,aAAa,CAAC;AAE5D,cAAc,eAAe,CAAC;AAG9B,mBAAmB;AACnB,cAAc,cAAc,CAAC;AAM7B,cAAc,cAAc,CAAC;AAG7B,cAAc,QAAQ,CAAC;AAGvB,OAAO,EACL,wBAAwB,GAEzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,yBAAyB,EAEzB,uCAAuC,GAExC,MAAM,yBAAyB,CAAC;AAEjC,cAAc,mCAAmC,CAAC;AAGlD,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtE,OAAO,EACL,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,4BAA4B,EAC5B,aAAa,EACb,4BAA4B,EAC5B,0BAA0B,EAC1B,8BAA8B,EAC9B,8BAA8B,EAC9B,sBAAsB,EACtB,sBAAsB,EACtB,iCAAiC,EACjC,kCAAkC,EAClC,4BAA4B,GAC7B,MAAM,iBAAiB,CAAC;AAazB,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EACL,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,0BAA0B,CAAC"}
|
|
@@ -4,5 +4,8 @@ export { organizationDefinitionSchema } from "./organization_definition";
|
|
|
4
4
|
export type { OrganizationDefinition } from "./organization_definition";
|
|
5
5
|
export { SCHEMAVAULTS_ORGANIZATION_ID } from "./schemavaults_org_id";
|
|
6
6
|
export { hardcodedOrgs } from "./hardcoded_orgs";
|
|
7
|
+
export { MAXIMUM_USER_ORGANIZATIONS, MINIMUM_ORGANIZATION_ID_LENGTH, MAXIMUM_ORGANIZATION_ID_LENGTH, } from "./organization_constants";
|
|
7
8
|
export { inviteMemberInputModes, inviteMemberFormSchema, } from "./invite_member_form";
|
|
8
9
|
export type { InviteMemberInputMode, InviteMemberFormValues, InviteMemberSubmitData, } from "./invite_member_form";
|
|
10
|
+
export { organizationInvitationStatusTypes, organizationInvitationStatusSchema, organizationInvitationSchema, } from "./organization_invitation";
|
|
11
|
+
export type { OrganizationInvitationStatus, OrganizationInvitation, UserPendingInvitation, OrganizationInvitationWithUserData, } from "./organization_invitation";
|
|
@@ -2,5 +2,7 @@ export { organizationIdSchema, isValidOrganizationID } from "./organization_id";
|
|
|
2
2
|
export { organizationDefinitionSchema } from "./organization_definition";
|
|
3
3
|
export { SCHEMAVAULTS_ORGANIZATION_ID } from "./schemavaults_org_id";
|
|
4
4
|
export { hardcodedOrgs } from "./hardcoded_orgs";
|
|
5
|
+
export { MAXIMUM_USER_ORGANIZATIONS, MINIMUM_ORGANIZATION_ID_LENGTH, MAXIMUM_ORGANIZATION_ID_LENGTH, } from "./organization_constants";
|
|
5
6
|
export { inviteMemberInputModes, inviteMemberFormSchema, } from "./invite_member_form";
|
|
7
|
+
export { organizationInvitationStatusTypes, organizationInvitationStatusSchema, organizationInvitationSchema, } from "./organization_invitation";
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/organizations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAGhF,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAGzE,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EACL,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/organizations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAGhF,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAGzE,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,EAC9B,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAO9B,OAAO,EACL,iCAAiC,EACjC,kCAAkC,EAClC,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const MINIMUM_ORGANIZATION_ID_LENGTH: 4;
|
|
2
|
-
export declare const MAXIMUM_ORGANIZATION_ID_LENGTH:
|
|
2
|
+
export declare const MAXIMUM_ORGANIZATION_ID_LENGTH: 32;
|
|
3
3
|
export declare const MINIMUM_ORGANIZATION_NAME_LENGTH: 1;
|
|
4
4
|
export declare const MAXIMUM_ORGANIZATION_NAME_LENGTH: 64;
|
|
5
|
+
export declare const MAXIMUM_USER_ORGANIZATIONS: 10;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export const MINIMUM_ORGANIZATION_ID_LENGTH = 4;
|
|
2
|
-
export const MAXIMUM_ORGANIZATION_ID_LENGTH =
|
|
2
|
+
export const MAXIMUM_ORGANIZATION_ID_LENGTH = 32;
|
|
3
3
|
export const MINIMUM_ORGANIZATION_NAME_LENGTH = 1;
|
|
4
4
|
export const MAXIMUM_ORGANIZATION_NAME_LENGTH = 64;
|
|
5
|
+
export const MAXIMUM_USER_ORGANIZATIONS = 10;
|
|
5
6
|
//# sourceMappingURL=organization_constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization_constants.js","sourceRoot":"","sources":["../../src/organizations/organization_constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAA2B,CAAC;AAC1E,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAA4B,CAAC;AAE3E,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAA2B,CAAC;AAC5E,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"organization_constants.js","sourceRoot":"","sources":["../../src/organizations/organization_constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAA2B,CAAC;AAC1E,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAA4B,CAAC;AAE3E,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAA2B,CAAC;AAC5E,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAA4B,CAAC;AAE7E,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAA4B,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type OrganizationID } from "./organization_id";
|
|
3
|
+
export declare const organizationInvitationStatusTypes: readonly ["pending", "accepted", "declined", "revoked", "expired"];
|
|
4
|
+
export type OrganizationInvitationStatus = (typeof organizationInvitationStatusTypes)[number];
|
|
5
|
+
export declare const organizationInvitationStatusSchema: z.ZodEnum<["pending", "accepted", "declined", "revoked", "expired"]>;
|
|
6
|
+
/**
|
|
7
|
+
* Organization invitation as returned by the API for display in the UI.
|
|
8
|
+
* Includes display fields like organization_name and inviter_email.
|
|
9
|
+
*/
|
|
10
|
+
export interface OrganizationInvitation {
|
|
11
|
+
invitation_id: string;
|
|
12
|
+
organization_id: OrganizationID;
|
|
13
|
+
organization_name?: string;
|
|
14
|
+
inviter_uid: string;
|
|
15
|
+
inviter_email?: string;
|
|
16
|
+
invitee_uid: string;
|
|
17
|
+
invitee_email?: string;
|
|
18
|
+
status: OrganizationInvitationStatus;
|
|
19
|
+
created_at: number;
|
|
20
|
+
expires_at: number;
|
|
21
|
+
responded_at?: number | null;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Pending invitation for a user, with display fields for the account page.
|
|
25
|
+
*/
|
|
26
|
+
export interface UserPendingInvitation {
|
|
27
|
+
invitation_id: string;
|
|
28
|
+
organization_id: OrganizationID;
|
|
29
|
+
organization_name: string;
|
|
30
|
+
inviter_uid: string;
|
|
31
|
+
inviter_email: string;
|
|
32
|
+
status: OrganizationInvitationStatus;
|
|
33
|
+
created_at: number;
|
|
34
|
+
expires_at: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Invitation with user data, for displaying in the organization's sent invitations list.
|
|
38
|
+
*/
|
|
39
|
+
export interface OrganizationInvitationWithUserData {
|
|
40
|
+
invitation_id: string;
|
|
41
|
+
organization_id: OrganizationID;
|
|
42
|
+
inviter_uid: string;
|
|
43
|
+
inviter_email: string;
|
|
44
|
+
invitee_uid: string;
|
|
45
|
+
invitee_email: string;
|
|
46
|
+
status: OrganizationInvitationStatus;
|
|
47
|
+
created_at: number;
|
|
48
|
+
expires_at: number;
|
|
49
|
+
responded_at?: number | null;
|
|
50
|
+
}
|
|
51
|
+
export declare const organizationInvitationSchema: z.ZodObject<{
|
|
52
|
+
invitation_id: z.ZodString;
|
|
53
|
+
organization_id: z.ZodEffects<z.ZodString, string, string>;
|
|
54
|
+
organization_name: z.ZodOptional<z.ZodString>;
|
|
55
|
+
inviter_uid: z.ZodString;
|
|
56
|
+
inviter_email: z.ZodOptional<z.ZodString>;
|
|
57
|
+
invitee_uid: z.ZodString;
|
|
58
|
+
invitee_email: z.ZodOptional<z.ZodString>;
|
|
59
|
+
status: z.ZodEnum<["pending", "accepted", "declined", "revoked", "expired"]>;
|
|
60
|
+
created_at: z.ZodNumber;
|
|
61
|
+
expires_at: z.ZodNumber;
|
|
62
|
+
responded_at: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
63
|
+
}, "strip", z.ZodTypeAny, {
|
|
64
|
+
status: "pending" | "accepted" | "declined" | "revoked" | "expired";
|
|
65
|
+
expires_at: number;
|
|
66
|
+
organization_id: string;
|
|
67
|
+
created_at: number;
|
|
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
|
+
organization_id: string;
|
|
79
|
+
created_at: number;
|
|
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
|
+
}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { organizationIdSchema } from "./organization_id";
|
|
3
|
+
export const organizationInvitationStatusTypes = [
|
|
4
|
+
"pending",
|
|
5
|
+
"accepted",
|
|
6
|
+
"declined",
|
|
7
|
+
"revoked",
|
|
8
|
+
"expired",
|
|
9
|
+
];
|
|
10
|
+
export const organizationInvitationStatusSchema = z.enum(organizationInvitationStatusTypes);
|
|
11
|
+
export const organizationInvitationSchema = z.object({
|
|
12
|
+
invitation_id: z.string().uuid(),
|
|
13
|
+
organization_id: organizationIdSchema,
|
|
14
|
+
organization_name: z.string().optional(),
|
|
15
|
+
inviter_uid: z.string().uuid(),
|
|
16
|
+
inviter_email: z.string().email().optional(),
|
|
17
|
+
invitee_uid: z.string().uuid(),
|
|
18
|
+
invitee_email: z.string().email().optional(),
|
|
19
|
+
status: organizationInvitationStatusSchema,
|
|
20
|
+
created_at: z.number().positive(),
|
|
21
|
+
expires_at: z.number().positive(),
|
|
22
|
+
responded_at: z.number().positive().nullable().optional(),
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=organization_invitation.js.map
|
|
@@ -0,0 +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,MAAM,EAAE,CAAC,IAAI,EAAE;IAChC,eAAe,EAAE,oBAAoB;IACrC,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC9B,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IAC5C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC9B,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IAC5C,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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const successfullyGeneratedTokensRecordSchema: z.ZodObject<{
|
|
3
|
-
access: z.ZodOptional<z.ZodRecord<z.ZodUnion<[z.ZodString, z.
|
|
3
|
+
access: z.ZodOptional<z.ZodRecord<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, "schemavaults-auth" | "schemavaults-mail" | "schemavaults-registry", string>]>, z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
|
|
4
4
|
type: z.ZodUnion<[z.ZodLiteral<"refresh">, z.ZodLiteral<"access">]>;
|
|
5
5
|
uid: z.ZodString;
|
|
6
6
|
iat: z.ZodNumber;
|
|
@@ -112,7 +112,7 @@ export declare const requestTokensResultSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
112
112
|
success: z.ZodLiteral<true>;
|
|
113
113
|
error: z.ZodLiteral<false>;
|
|
114
114
|
tokens: z.ZodOptional<z.ZodObject<{
|
|
115
|
-
access: z.ZodOptional<z.ZodRecord<z.ZodUnion<[z.ZodString, z.
|
|
115
|
+
access: z.ZodOptional<z.ZodRecord<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, "schemavaults-auth" | "schemavaults-mail" | "schemavaults-registry", string>]>, z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
|
|
116
116
|
type: z.ZodUnion<[z.ZodLiteral<"refresh">, z.ZodLiteral<"access">]>;
|
|
117
117
|
uid: z.ZodString;
|
|
118
118
|
iat: z.ZodNumber;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schemavaults/auth-common",
|
|
3
3
|
"description": "Types and utility functions for authentication and authorization",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.7",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"private": false,
|
|
7
7
|
"repository": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"types": "dist/index.d.ts",
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"zod": "3.23.8",
|
|
17
|
-
"@schemavaults/app-definitions": "0.6.
|
|
17
|
+
"@schemavaults/app-definitions": "0.6.14",
|
|
18
18
|
"crypto-js": "4.2.0"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
@@ -40,5 +40,32 @@
|
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
|
-
"packageManager": "bun@1.3.6"
|
|
43
|
+
"packageManager": "bun@1.3.6",
|
|
44
|
+
"exports": {
|
|
45
|
+
".": {
|
|
46
|
+
"types": "./dist/index.d.ts",
|
|
47
|
+
"import": "./dist/index.js",
|
|
48
|
+
"require": "./dist/index.js"
|
|
49
|
+
},
|
|
50
|
+
"./*": {
|
|
51
|
+
"types": "./dist/*",
|
|
52
|
+
"import": "./dist/*",
|
|
53
|
+
"require": "./dist/*"
|
|
54
|
+
},
|
|
55
|
+
"./dist/*": {
|
|
56
|
+
"types": "./dist/*",
|
|
57
|
+
"import": "./dist/*",
|
|
58
|
+
"require": "./dist/*"
|
|
59
|
+
},
|
|
60
|
+
"./RefreshTokenCookieNames": {
|
|
61
|
+
"types": "./dist/RefreshTokenCookieNames.d.ts",
|
|
62
|
+
"import": "./dist/RefreshTokenCookieNames.js",
|
|
63
|
+
"require": "./dist/RefreshTokenCookieNames.js"
|
|
64
|
+
},
|
|
65
|
+
"./AccessTokenCookieNames": {
|
|
66
|
+
"types": "./dist/AccessTokenCookieNames.d.ts",
|
|
67
|
+
"import": "./dist/AccessTokenCookieNames.js",
|
|
68
|
+
"require": "./dist/AccessTokenCookieNames.js"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
44
71
|
}
|