@stackframe/stack-shared 2.8.56 → 2.8.59
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/apps/apps-config.d.mts +6 -0
- package/dist/apps/apps-config.d.ts +6 -0
- package/dist/apps/apps-config.js +6 -0
- package/dist/apps/apps-config.js.map +1 -1
- package/dist/config/migrate-catalogs-to-product-lines.d.mts +12 -0
- package/dist/config/migrate-catalogs-to-product-lines.d.ts +12 -0
- package/dist/config/migrate-catalogs-to-product-lines.js +211 -0
- package/dist/config/migrate-catalogs-to-product-lines.js.map +1 -0
- package/dist/config/schema-fuzzer.test.js +20 -6
- package/dist/config/schema-fuzzer.test.js.map +1 -1
- package/dist/config/schema.d.mts +296 -224
- package/dist/config/schema.d.ts +296 -224
- package/dist/config/schema.js +46 -8
- package/dist/config/schema.js.map +1 -1
- package/dist/esm/apps/apps-config.js +6 -0
- package/dist/esm/apps/apps-config.js.map +1 -1
- package/dist/esm/config/migrate-catalogs-to-product-lines.js +186 -0
- package/dist/esm/config/migrate-catalogs-to-product-lines.js.map +1 -0
- package/dist/esm/config/schema-fuzzer.test.js +20 -6
- package/dist/esm/config/schema-fuzzer.test.js.map +1 -1
- package/dist/esm/config/schema.js +47 -9
- package/dist/esm/config/schema.js.map +1 -1
- package/dist/esm/interface/admin-interface.js +49 -1
- package/dist/esm/interface/admin-interface.js.map +1 -1
- package/dist/esm/interface/client-interface.js +124 -25
- package/dist/esm/interface/client-interface.js.map +1 -1
- package/dist/esm/interface/crud/current-user.js +5 -2
- package/dist/esm/interface/crud/current-user.js.map +1 -1
- package/dist/esm/interface/crud/email-outbox.js +204 -0
- package/dist/esm/interface/crud/email-outbox.js.map +1 -0
- package/dist/esm/interface/crud/emails.js +0 -2
- package/dist/esm/interface/crud/emails.js.map +1 -1
- package/dist/esm/interface/crud/products.js +12 -1
- package/dist/esm/interface/crud/products.js.map +1 -1
- package/dist/esm/interface/crud/projects.js +3 -1
- package/dist/esm/interface/crud/projects.js.map +1 -1
- package/dist/esm/interface/crud/users.js +9 -2
- package/dist/esm/interface/crud/users.js.map +1 -1
- package/dist/esm/interface/server-interface.js +54 -0
- package/dist/esm/interface/server-interface.js.map +1 -1
- package/dist/esm/known-errors.js +69 -1
- package/dist/esm/known-errors.js.map +1 -1
- package/dist/esm/schema-fields.js +27 -3
- package/dist/esm/schema-fields.js.map +1 -1
- package/dist/esm/sessions.js +72 -8
- package/dist/esm/sessions.js.map +1 -1
- package/dist/esm/utils/env.js +13 -2
- package/dist/esm/utils/env.js.map +1 -1
- package/dist/esm/utils/esbuild.js +50 -21
- package/dist/esm/utils/esbuild.js.map +1 -1
- package/dist/esm/utils/globals.js +12 -0
- package/dist/esm/utils/globals.js.map +1 -1
- package/dist/esm/utils/paginated-lists.js +153 -23
- package/dist/esm/utils/paginated-lists.js.map +1 -1
- package/dist/esm/utils/paginated-lists.test.js +842 -0
- package/dist/esm/utils/paginated-lists.test.js.map +1 -0
- package/dist/esm/utils/proxies.js +28 -1
- package/dist/esm/utils/proxies.js.map +1 -1
- package/dist/esm/utils/react.js +7 -3
- package/dist/esm/utils/react.js.map +1 -1
- package/dist/esm/utils/results.js.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/interface/admin-interface.d.mts +26 -3
- package/dist/interface/admin-interface.d.ts +26 -3
- package/dist/interface/admin-interface.js +49 -1
- package/dist/interface/admin-interface.js.map +1 -1
- package/dist/interface/client-interface.d.mts +36 -0
- package/dist/interface/client-interface.d.ts +36 -0
- package/dist/interface/client-interface.js +124 -25
- package/dist/interface/client-interface.js.map +1 -1
- package/dist/interface/crud/current-user.d.mts +23 -6
- package/dist/interface/crud/current-user.d.ts +23 -6
- package/dist/interface/crud/current-user.js +5 -2
- package/dist/interface/crud/current-user.js.map +1 -1
- package/dist/interface/crud/email-outbox.d.mts +1075 -0
- package/dist/interface/crud/email-outbox.d.ts +1075 -0
- package/dist/interface/crud/email-outbox.js +241 -0
- package/dist/interface/crud/email-outbox.js.map +1 -0
- package/dist/interface/crud/emails.d.mts +0 -34
- package/dist/interface/crud/emails.d.ts +0 -34
- package/dist/interface/crud/emails.js +0 -2
- package/dist/interface/crud/emails.js.map +1 -1
- package/dist/interface/crud/products.d.mts +77 -0
- package/dist/interface/crud/products.d.ts +77 -0
- package/dist/interface/crud/products.js +12 -1
- package/dist/interface/crud/products.js.map +1 -1
- package/dist/interface/crud/project-api-keys.d.mts +1 -1
- package/dist/interface/crud/project-api-keys.d.ts +1 -1
- package/dist/interface/crud/projects.d.mts +70 -66
- package/dist/interface/crud/projects.d.ts +70 -66
- package/dist/interface/crud/projects.js +3 -1
- package/dist/interface/crud/projects.js.map +1 -1
- package/dist/interface/crud/team-member-profiles.d.mts +28 -12
- package/dist/interface/crud/team-member-profiles.d.ts +28 -12
- package/dist/interface/crud/users.d.mts +38 -6
- package/dist/interface/crud/users.d.ts +38 -6
- package/dist/interface/crud/users.js +9 -2
- package/dist/interface/crud/users.js.map +1 -1
- package/dist/interface/server-interface.d.mts +52 -0
- package/dist/interface/server-interface.d.ts +52 -0
- package/dist/interface/server-interface.js +54 -0
- package/dist/interface/server-interface.js.map +1 -1
- package/dist/interface/webhooks.d.mts +18 -2
- package/dist/interface/webhooks.d.ts +18 -2
- package/dist/known-errors.d.mts +20 -1
- package/dist/known-errors.d.ts +20 -1
- package/dist/known-errors.js +69 -1
- package/dist/known-errors.js.map +1 -1
- package/dist/schema-fields.d.mts +38 -5
- package/dist/schema-fields.d.ts +38 -5
- package/dist/schema-fields.js +33 -3
- package/dist/schema-fields.js.map +1 -1
- package/dist/sessions.d.mts +35 -4
- package/dist/sessions.d.ts +35 -4
- package/dist/sessions.js +72 -8
- package/dist/sessions.js.map +1 -1
- package/dist/utils/env.d.mts +2 -1
- package/dist/utils/env.d.ts +2 -1
- package/dist/utils/env.js +13 -1
- package/dist/utils/env.js.map +1 -1
- package/dist/utils/esbuild.js +49 -20
- package/dist/utils/esbuild.js.map +1 -1
- package/dist/utils/globals.d.mts +6 -1
- package/dist/utils/globals.d.ts +6 -1
- package/dist/utils/globals.js +13 -0
- package/dist/utils/globals.js.map +1 -1
- package/dist/utils/paginated-lists.d.mts +269 -12
- package/dist/utils/paginated-lists.d.ts +269 -12
- package/dist/utils/paginated-lists.js +153 -23
- package/dist/utils/paginated-lists.js.map +1 -1
- package/dist/utils/paginated-lists.test.d.mts +2 -0
- package/dist/utils/paginated-lists.test.d.ts +2 -0
- package/dist/utils/paginated-lists.test.js +844 -0
- package/dist/utils/paginated-lists.test.js.map +1 -0
- package/dist/utils/proxies.d.mts +8 -1
- package/dist/utils/proxies.d.ts +8 -1
- package/dist/utils/proxies.js +30 -2
- package/dist/utils/proxies.js.map +1 -1
- package/dist/utils/react.d.mts +1 -1
- package/dist/utils/react.d.ts +1 -1
- package/dist/utils/react.js +7 -3
- package/dist/utils/react.js.map +1 -1
- package/dist/utils/results.d.mts +5 -5
- package/dist/utils/results.d.ts +5 -5
- package/dist/utils/results.js.map +1 -1
- package/package.json +5 -4
- package/CHANGELOG.md +0 -1354
- package/dist/esm/interface/crud/config.js +0 -40
- package/dist/esm/interface/crud/config.js.map +0 -1
- package/dist/interface/crud/config.d.mts +0 -49
- package/dist/interface/crud/config.d.ts +0 -49
- package/dist/interface/crud/config.js +0 -79
- package/dist/interface/crud/config.js.map +0 -1
package/dist/schema-fields.d.mts
CHANGED
|
@@ -73,7 +73,28 @@ declare const dayIntervalOrNeverSchema: yup.MixedSchema<"never" | DayInterval, y
|
|
|
73
73
|
/**
|
|
74
74
|
* This schema is useful for fields where the user can specify the ID, such as price IDs. It is particularly common
|
|
75
75
|
* for IDs in the config schema.
|
|
76
|
+
*
|
|
77
|
+
* Valid IDs:
|
|
78
|
+
* - Must contain only letters, numbers, underscores, and hyphens
|
|
79
|
+
* - Must not start with a hyphen
|
|
80
|
+
* - Maximum length of 63 characters
|
|
81
|
+
*/
|
|
82
|
+
declare const USER_SPECIFIED_ID_PATTERN: RegExp;
|
|
83
|
+
declare const USER_SPECIFIED_ID_MAX_LENGTH = 63;
|
|
84
|
+
/**
|
|
85
|
+
* Checks if the given string is a valid user-specified ID.
|
|
86
|
+
*/
|
|
87
|
+
declare function isValidUserSpecifiedId(id: string): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Gets the error message for an invalid user-specified ID.
|
|
90
|
+
*/
|
|
91
|
+
declare function getUserSpecifiedIdErrorMessage(idName: `${string}Id`): string;
|
|
92
|
+
/**
|
|
93
|
+
* Sanitizes user input to create a valid user-specified ID.
|
|
94
|
+
* Converts to lowercase and replaces invalid characters with hyphens.
|
|
95
|
+
* Strips leading hyphens.
|
|
76
96
|
*/
|
|
97
|
+
declare function sanitizeUserSpecifiedId(input: string): string;
|
|
77
98
|
declare const userSpecifiedIdSchema: (idName: `${string}Id`) => yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
78
99
|
declare const moneyAmountSchema: (currency: Currency) => yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
79
100
|
/**
|
|
@@ -172,7 +193,7 @@ declare const priceOrIncludeByDefaultSchema: yup.MixedSchema<"include-by-default
|
|
|
172
193
|
}> | undefined, yup.AnyObject, undefined, "">;
|
|
173
194
|
declare const productSchema: yup.ObjectSchema<{
|
|
174
195
|
displayName: string | undefined;
|
|
175
|
-
|
|
196
|
+
productLineId: string | undefined;
|
|
176
197
|
isAddOnTo: false | Record<string, true> | undefined;
|
|
177
198
|
customerType: "user" | "team" | "custom";
|
|
178
199
|
freeTrial: DayInterval | undefined;
|
|
@@ -197,7 +218,7 @@ declare const productSchema: yup.ObjectSchema<{
|
|
|
197
218
|
}>;
|
|
198
219
|
}, yup.AnyObject, {
|
|
199
220
|
displayName: undefined;
|
|
200
|
-
|
|
221
|
+
productLineId: undefined;
|
|
201
222
|
isAddOnTo: undefined;
|
|
202
223
|
customerType: undefined;
|
|
203
224
|
freeTrial: undefined;
|
|
@@ -211,7 +232,7 @@ declare const productClientReadOnlyMetadataSchema: yup.MixedSchema<{} | null, yu
|
|
|
211
232
|
declare const productServerMetadataSchema: yup.MixedSchema<{} | null, yup.AnyObject, undefined, "">;
|
|
212
233
|
declare const productSchemaWithMetadata: yup.ObjectSchema<{
|
|
213
234
|
displayName: string | undefined;
|
|
214
|
-
|
|
235
|
+
productLineId: string | undefined;
|
|
215
236
|
isAddOnTo: false | Record<string, true> | undefined;
|
|
216
237
|
customerType: "user" | "team" | "custom";
|
|
217
238
|
freeTrial: DayInterval | undefined;
|
|
@@ -240,7 +261,7 @@ declare const productSchemaWithMetadata: yup.ObjectSchema<{
|
|
|
240
261
|
serverMetadata: {} | null | undefined;
|
|
241
262
|
}, yup.AnyObject, {
|
|
242
263
|
displayName: undefined;
|
|
243
|
-
|
|
264
|
+
productLineId: undefined;
|
|
244
265
|
isAddOnTo: undefined;
|
|
245
266
|
customerType: undefined;
|
|
246
267
|
freeTrial: undefined;
|
|
@@ -322,9 +343,12 @@ declare const userHasPasswordSchema: yup.BooleanSchema<boolean | undefined, yup.
|
|
|
322
343
|
declare const userPasswordMutationSchema: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, "">;
|
|
323
344
|
declare const userPasswordHashMutationSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
324
345
|
declare const userTotpSecretMutationSchema: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, "">;
|
|
346
|
+
declare const restrictedReasonTypes: readonly ["anonymous", "email_not_verified"];
|
|
347
|
+
type RestrictedReasonType = typeof restrictedReasonTypes[number];
|
|
325
348
|
declare const accessTokenPayloadSchema: yup.ObjectSchema<{
|
|
326
349
|
sub: string;
|
|
327
350
|
exp: number | undefined;
|
|
351
|
+
iat: number;
|
|
328
352
|
iss: string;
|
|
329
353
|
aud: string;
|
|
330
354
|
project_id: string;
|
|
@@ -336,9 +360,14 @@ declare const accessTokenPayloadSchema: yup.ObjectSchema<{
|
|
|
336
360
|
email_verified: boolean;
|
|
337
361
|
selected_team_id: string | null;
|
|
338
362
|
is_anonymous: boolean;
|
|
363
|
+
is_restricted: boolean;
|
|
364
|
+
restricted_reason: {
|
|
365
|
+
type: "anonymous" | "email_not_verified";
|
|
366
|
+
} | null;
|
|
339
367
|
}, yup.AnyObject, {
|
|
340
368
|
sub: undefined;
|
|
341
369
|
exp: undefined;
|
|
370
|
+
iat: undefined;
|
|
342
371
|
iss: undefined;
|
|
343
372
|
aud: undefined;
|
|
344
373
|
project_id: undefined;
|
|
@@ -350,6 +379,10 @@ declare const accessTokenPayloadSchema: yup.ObjectSchema<{
|
|
|
350
379
|
email_verified: undefined;
|
|
351
380
|
selected_team_id: undefined;
|
|
352
381
|
is_anonymous: undefined;
|
|
382
|
+
is_restricted: undefined;
|
|
383
|
+
restricted_reason: {
|
|
384
|
+
type: undefined;
|
|
385
|
+
};
|
|
353
386
|
}, "">;
|
|
354
387
|
declare const signInEmailSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
355
388
|
declare const emailOtpSignInCallbackUrlSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
@@ -402,4 +435,4 @@ declare const neonAuthorizationHeaderSchema: yup.StringSchema<string | undefined
|
|
|
402
435
|
declare function yupDefinedWhen<S extends yup.AnyObject>(schema: S, triggers: Record<string, any>): S;
|
|
403
436
|
declare function yupDefinedAndNonEmptyWhen<S extends yup.StringSchema>(schema: S, triggers: Record<string, any>): S;
|
|
404
437
|
|
|
405
|
-
export { ReplaceFieldWithOwnUserId, StackAdaptSentinel, accessTokenPayloadSchema, accessTokenResponseSchema, adaptSchema, adminAuthTypeSchema, base64Schema, basicAuthorizationHeaderSchema, clientOrHigherAuthTypeSchema, contactChannelIdSchema, contactChannelIsPrimarySchema, contactChannelIsVerifiedSchema, contactChannelTypeSchema, contactChannelUsedForAuthSchema, contactChannelValueSchema, containedPermissionIdsSchema, customPermissionDefinitionIdSchema, customerTypeSchema, dayIntervalOrNeverSchema, dayIntervalSchema, emailHostSchema, emailOtpSignInCallbackUrlSchema, emailPasswordSchema, emailPortSchema, emailSchema, emailSenderEmailSchema, emailSenderNameSchema, emailTemplateListSchema, emailThemeListSchema, emailThemeSchema, emailTypeSchema, emailUsernameSchema, emailVerificationCallbackUrlSchema, ensureObjectSchema, handlerPathSchema, inlineProductSchema, intervalOrNeverSchema, intervalSchema, jsonSchema, jsonStringOrEmptySchema, jsonStringSchema, moneyAmountSchema, neonAuthorizationHeaderSchema, oauthAccountMergeStrategySchema, oauthClientIdSchema, oauthClientSecretSchema, oauthEnabledSchema, oauthFacebookConfigIdSchema, oauthIdSchema, oauthMicrosoftTenantIdSchema, oauthProviderAccountIdSchema, oauthProviderAllowConnectedAccountsSchema, oauthProviderAllowSignInSchema, oauthProviderEmailSchema, oauthProviderIdSchema, oauthProviderProviderConfigIdSchema, oauthProviderTypeSchema, oauthTypeSchema, passwordSchema, permissionDefinitionIdSchema, priceOrIncludeByDefaultSchema, primaryEmailAuthEnabledSchema, primaryEmailSchema, primaryEmailVerifiedSchema, productClientMetadataSchema, productClientReadOnlyMetadataSchema, productPriceSchema, productSchema, productSchemaWithMetadata, productServerMetadataSchema, profileImageUrlSchema, projectAllowLocalhostSchema, projectBranchIdSchema, projectClientTeamCreationEnabledSchema, projectClientUserDeletionEnabledSchema, projectConfigIdSchema, projectCreateTeamOnSignUpSchema, projectCreatedAtMillisSchema, projectCredentialEnabledSchema, projectDescriptionSchema, projectDisplayNameSchema, projectIdSchema, projectIsProductionModeSchema, projectLogoDarkModeUrlSchema, projectLogoFullDarkModeUrlSchema, projectLogoFullUrlSchema, projectLogoUrlSchema, projectMagicLinkEnabledSchema, projectPasskeyEnabledSchema, projectSignUpEnabledSchema, refreshTokenResponseSchema, selectedTeamIdSchema, serverOrHigherAuthTypeSchema, signInEmailSchema, signInResponseSchema, signedUpAtMillisSchema, strictEmailSchema, teamClientMetadataSchema, teamClientReadOnlyMetadataSchema, teamCreatedAtMillisSchema, teamCreatorUserIdSchema, teamDisplayNameSchema, teamIdSchema, teamInvitationCallbackUrlSchema, teamInvitationEmailSchema, teamMemberDisplayNameSchema, teamMemberProfileImageUrlSchema, teamPermissionDescriptionSchema, teamProfileImageUrlSchema, teamServerMetadataSchema, teamSystemPermissions, templateThemeIdSchema, urlSchema, userClientMetadataSchema, userClientReadOnlyMetadataSchema, userDisplayNameSchema, userHasPasswordSchema, userIdOrMeSchema, userIdSchema, userLastActiveAtMillisSchema, userOAuthProviderSchema, userOtpAuthEnabledMutationSchema, userOtpAuthEnabledSchema, userPasskeyAuthEnabledSchema, userPasswordHashMutationSchema, userPasswordMutationSchema, userServerMetadataSchema, userSpecifiedIdSchema, userTotpSecretMutationSchema, wildcardProtocolAndDomainSchema, wildcardUrlSchema, yupArray, yupBoolean, yupDate, yupDefinedAndNonEmptyWhen, yupDefinedWhen, yupMixed, yupNever, yupNumber, yupObject, yupObjectWithAutoDefault, yupRecord, yupString, yupTuple, yupUnion, yupValidate };
|
|
438
|
+
export { ReplaceFieldWithOwnUserId, type RestrictedReasonType, StackAdaptSentinel, USER_SPECIFIED_ID_MAX_LENGTH, USER_SPECIFIED_ID_PATTERN, accessTokenPayloadSchema, accessTokenResponseSchema, adaptSchema, adminAuthTypeSchema, base64Schema, basicAuthorizationHeaderSchema, clientOrHigherAuthTypeSchema, contactChannelIdSchema, contactChannelIsPrimarySchema, contactChannelIsVerifiedSchema, contactChannelTypeSchema, contactChannelUsedForAuthSchema, contactChannelValueSchema, containedPermissionIdsSchema, customPermissionDefinitionIdSchema, customerTypeSchema, dayIntervalOrNeverSchema, dayIntervalSchema, emailHostSchema, emailOtpSignInCallbackUrlSchema, emailPasswordSchema, emailPortSchema, emailSchema, emailSenderEmailSchema, emailSenderNameSchema, emailTemplateListSchema, emailThemeListSchema, emailThemeSchema, emailTypeSchema, emailUsernameSchema, emailVerificationCallbackUrlSchema, ensureObjectSchema, getUserSpecifiedIdErrorMessage, handlerPathSchema, inlineProductSchema, intervalOrNeverSchema, intervalSchema, isValidUserSpecifiedId, jsonSchema, jsonStringOrEmptySchema, jsonStringSchema, moneyAmountSchema, neonAuthorizationHeaderSchema, oauthAccountMergeStrategySchema, oauthClientIdSchema, oauthClientSecretSchema, oauthEnabledSchema, oauthFacebookConfigIdSchema, oauthIdSchema, oauthMicrosoftTenantIdSchema, oauthProviderAccountIdSchema, oauthProviderAllowConnectedAccountsSchema, oauthProviderAllowSignInSchema, oauthProviderEmailSchema, oauthProviderIdSchema, oauthProviderProviderConfigIdSchema, oauthProviderTypeSchema, oauthTypeSchema, passwordSchema, permissionDefinitionIdSchema, priceOrIncludeByDefaultSchema, primaryEmailAuthEnabledSchema, primaryEmailSchema, primaryEmailVerifiedSchema, productClientMetadataSchema, productClientReadOnlyMetadataSchema, productPriceSchema, productSchema, productSchemaWithMetadata, productServerMetadataSchema, profileImageUrlSchema, projectAllowLocalhostSchema, projectBranchIdSchema, projectClientTeamCreationEnabledSchema, projectClientUserDeletionEnabledSchema, projectConfigIdSchema, projectCreateTeamOnSignUpSchema, projectCreatedAtMillisSchema, projectCredentialEnabledSchema, projectDescriptionSchema, projectDisplayNameSchema, projectIdSchema, projectIsProductionModeSchema, projectLogoDarkModeUrlSchema, projectLogoFullDarkModeUrlSchema, projectLogoFullUrlSchema, projectLogoUrlSchema, projectMagicLinkEnabledSchema, projectPasskeyEnabledSchema, projectSignUpEnabledSchema, refreshTokenResponseSchema, restrictedReasonTypes, sanitizeUserSpecifiedId, selectedTeamIdSchema, serverOrHigherAuthTypeSchema, signInEmailSchema, signInResponseSchema, signedUpAtMillisSchema, strictEmailSchema, teamClientMetadataSchema, teamClientReadOnlyMetadataSchema, teamCreatedAtMillisSchema, teamCreatorUserIdSchema, teamDisplayNameSchema, teamIdSchema, teamInvitationCallbackUrlSchema, teamInvitationEmailSchema, teamMemberDisplayNameSchema, teamMemberProfileImageUrlSchema, teamPermissionDescriptionSchema, teamProfileImageUrlSchema, teamServerMetadataSchema, teamSystemPermissions, templateThemeIdSchema, urlSchema, userClientMetadataSchema, userClientReadOnlyMetadataSchema, userDisplayNameSchema, userHasPasswordSchema, userIdOrMeSchema, userIdSchema, userLastActiveAtMillisSchema, userOAuthProviderSchema, userOtpAuthEnabledMutationSchema, userOtpAuthEnabledSchema, userPasskeyAuthEnabledSchema, userPasswordHashMutationSchema, userPasswordMutationSchema, userServerMetadataSchema, userSpecifiedIdSchema, userTotpSecretMutationSchema, wildcardProtocolAndDomainSchema, wildcardUrlSchema, yupArray, yupBoolean, yupDate, yupDefinedAndNonEmptyWhen, yupDefinedWhen, yupMixed, yupNever, yupNumber, yupObject, yupObjectWithAutoDefault, yupRecord, yupString, yupTuple, yupUnion, yupValidate };
|
package/dist/schema-fields.d.ts
CHANGED
|
@@ -73,7 +73,28 @@ declare const dayIntervalOrNeverSchema: yup.MixedSchema<"never" | DayInterval, y
|
|
|
73
73
|
/**
|
|
74
74
|
* This schema is useful for fields where the user can specify the ID, such as price IDs. It is particularly common
|
|
75
75
|
* for IDs in the config schema.
|
|
76
|
+
*
|
|
77
|
+
* Valid IDs:
|
|
78
|
+
* - Must contain only letters, numbers, underscores, and hyphens
|
|
79
|
+
* - Must not start with a hyphen
|
|
80
|
+
* - Maximum length of 63 characters
|
|
81
|
+
*/
|
|
82
|
+
declare const USER_SPECIFIED_ID_PATTERN: RegExp;
|
|
83
|
+
declare const USER_SPECIFIED_ID_MAX_LENGTH = 63;
|
|
84
|
+
/**
|
|
85
|
+
* Checks if the given string is a valid user-specified ID.
|
|
86
|
+
*/
|
|
87
|
+
declare function isValidUserSpecifiedId(id: string): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Gets the error message for an invalid user-specified ID.
|
|
90
|
+
*/
|
|
91
|
+
declare function getUserSpecifiedIdErrorMessage(idName: `${string}Id`): string;
|
|
92
|
+
/**
|
|
93
|
+
* Sanitizes user input to create a valid user-specified ID.
|
|
94
|
+
* Converts to lowercase and replaces invalid characters with hyphens.
|
|
95
|
+
* Strips leading hyphens.
|
|
76
96
|
*/
|
|
97
|
+
declare function sanitizeUserSpecifiedId(input: string): string;
|
|
77
98
|
declare const userSpecifiedIdSchema: (idName: `${string}Id`) => yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
78
99
|
declare const moneyAmountSchema: (currency: Currency) => yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
79
100
|
/**
|
|
@@ -172,7 +193,7 @@ declare const priceOrIncludeByDefaultSchema: yup.MixedSchema<"include-by-default
|
|
|
172
193
|
}> | undefined, yup.AnyObject, undefined, "">;
|
|
173
194
|
declare const productSchema: yup.ObjectSchema<{
|
|
174
195
|
displayName: string | undefined;
|
|
175
|
-
|
|
196
|
+
productLineId: string | undefined;
|
|
176
197
|
isAddOnTo: false | Record<string, true> | undefined;
|
|
177
198
|
customerType: "user" | "team" | "custom";
|
|
178
199
|
freeTrial: DayInterval | undefined;
|
|
@@ -197,7 +218,7 @@ declare const productSchema: yup.ObjectSchema<{
|
|
|
197
218
|
}>;
|
|
198
219
|
}, yup.AnyObject, {
|
|
199
220
|
displayName: undefined;
|
|
200
|
-
|
|
221
|
+
productLineId: undefined;
|
|
201
222
|
isAddOnTo: undefined;
|
|
202
223
|
customerType: undefined;
|
|
203
224
|
freeTrial: undefined;
|
|
@@ -211,7 +232,7 @@ declare const productClientReadOnlyMetadataSchema: yup.MixedSchema<{} | null, yu
|
|
|
211
232
|
declare const productServerMetadataSchema: yup.MixedSchema<{} | null, yup.AnyObject, undefined, "">;
|
|
212
233
|
declare const productSchemaWithMetadata: yup.ObjectSchema<{
|
|
213
234
|
displayName: string | undefined;
|
|
214
|
-
|
|
235
|
+
productLineId: string | undefined;
|
|
215
236
|
isAddOnTo: false | Record<string, true> | undefined;
|
|
216
237
|
customerType: "user" | "team" | "custom";
|
|
217
238
|
freeTrial: DayInterval | undefined;
|
|
@@ -240,7 +261,7 @@ declare const productSchemaWithMetadata: yup.ObjectSchema<{
|
|
|
240
261
|
serverMetadata: {} | null | undefined;
|
|
241
262
|
}, yup.AnyObject, {
|
|
242
263
|
displayName: undefined;
|
|
243
|
-
|
|
264
|
+
productLineId: undefined;
|
|
244
265
|
isAddOnTo: undefined;
|
|
245
266
|
customerType: undefined;
|
|
246
267
|
freeTrial: undefined;
|
|
@@ -322,9 +343,12 @@ declare const userHasPasswordSchema: yup.BooleanSchema<boolean | undefined, yup.
|
|
|
322
343
|
declare const userPasswordMutationSchema: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, "">;
|
|
323
344
|
declare const userPasswordHashMutationSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
324
345
|
declare const userTotpSecretMutationSchema: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, "">;
|
|
346
|
+
declare const restrictedReasonTypes: readonly ["anonymous", "email_not_verified"];
|
|
347
|
+
type RestrictedReasonType = typeof restrictedReasonTypes[number];
|
|
325
348
|
declare const accessTokenPayloadSchema: yup.ObjectSchema<{
|
|
326
349
|
sub: string;
|
|
327
350
|
exp: number | undefined;
|
|
351
|
+
iat: number;
|
|
328
352
|
iss: string;
|
|
329
353
|
aud: string;
|
|
330
354
|
project_id: string;
|
|
@@ -336,9 +360,14 @@ declare const accessTokenPayloadSchema: yup.ObjectSchema<{
|
|
|
336
360
|
email_verified: boolean;
|
|
337
361
|
selected_team_id: string | null;
|
|
338
362
|
is_anonymous: boolean;
|
|
363
|
+
is_restricted: boolean;
|
|
364
|
+
restricted_reason: {
|
|
365
|
+
type: "anonymous" | "email_not_verified";
|
|
366
|
+
} | null;
|
|
339
367
|
}, yup.AnyObject, {
|
|
340
368
|
sub: undefined;
|
|
341
369
|
exp: undefined;
|
|
370
|
+
iat: undefined;
|
|
342
371
|
iss: undefined;
|
|
343
372
|
aud: undefined;
|
|
344
373
|
project_id: undefined;
|
|
@@ -350,6 +379,10 @@ declare const accessTokenPayloadSchema: yup.ObjectSchema<{
|
|
|
350
379
|
email_verified: undefined;
|
|
351
380
|
selected_team_id: undefined;
|
|
352
381
|
is_anonymous: undefined;
|
|
382
|
+
is_restricted: undefined;
|
|
383
|
+
restricted_reason: {
|
|
384
|
+
type: undefined;
|
|
385
|
+
};
|
|
353
386
|
}, "">;
|
|
354
387
|
declare const signInEmailSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
355
388
|
declare const emailOtpSignInCallbackUrlSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
@@ -402,4 +435,4 @@ declare const neonAuthorizationHeaderSchema: yup.StringSchema<string | undefined
|
|
|
402
435
|
declare function yupDefinedWhen<S extends yup.AnyObject>(schema: S, triggers: Record<string, any>): S;
|
|
403
436
|
declare function yupDefinedAndNonEmptyWhen<S extends yup.StringSchema>(schema: S, triggers: Record<string, any>): S;
|
|
404
437
|
|
|
405
|
-
export { ReplaceFieldWithOwnUserId, StackAdaptSentinel, accessTokenPayloadSchema, accessTokenResponseSchema, adaptSchema, adminAuthTypeSchema, base64Schema, basicAuthorizationHeaderSchema, clientOrHigherAuthTypeSchema, contactChannelIdSchema, contactChannelIsPrimarySchema, contactChannelIsVerifiedSchema, contactChannelTypeSchema, contactChannelUsedForAuthSchema, contactChannelValueSchema, containedPermissionIdsSchema, customPermissionDefinitionIdSchema, customerTypeSchema, dayIntervalOrNeverSchema, dayIntervalSchema, emailHostSchema, emailOtpSignInCallbackUrlSchema, emailPasswordSchema, emailPortSchema, emailSchema, emailSenderEmailSchema, emailSenderNameSchema, emailTemplateListSchema, emailThemeListSchema, emailThemeSchema, emailTypeSchema, emailUsernameSchema, emailVerificationCallbackUrlSchema, ensureObjectSchema, handlerPathSchema, inlineProductSchema, intervalOrNeverSchema, intervalSchema, jsonSchema, jsonStringOrEmptySchema, jsonStringSchema, moneyAmountSchema, neonAuthorizationHeaderSchema, oauthAccountMergeStrategySchema, oauthClientIdSchema, oauthClientSecretSchema, oauthEnabledSchema, oauthFacebookConfigIdSchema, oauthIdSchema, oauthMicrosoftTenantIdSchema, oauthProviderAccountIdSchema, oauthProviderAllowConnectedAccountsSchema, oauthProviderAllowSignInSchema, oauthProviderEmailSchema, oauthProviderIdSchema, oauthProviderProviderConfigIdSchema, oauthProviderTypeSchema, oauthTypeSchema, passwordSchema, permissionDefinitionIdSchema, priceOrIncludeByDefaultSchema, primaryEmailAuthEnabledSchema, primaryEmailSchema, primaryEmailVerifiedSchema, productClientMetadataSchema, productClientReadOnlyMetadataSchema, productPriceSchema, productSchema, productSchemaWithMetadata, productServerMetadataSchema, profileImageUrlSchema, projectAllowLocalhostSchema, projectBranchIdSchema, projectClientTeamCreationEnabledSchema, projectClientUserDeletionEnabledSchema, projectConfigIdSchema, projectCreateTeamOnSignUpSchema, projectCreatedAtMillisSchema, projectCredentialEnabledSchema, projectDescriptionSchema, projectDisplayNameSchema, projectIdSchema, projectIsProductionModeSchema, projectLogoDarkModeUrlSchema, projectLogoFullDarkModeUrlSchema, projectLogoFullUrlSchema, projectLogoUrlSchema, projectMagicLinkEnabledSchema, projectPasskeyEnabledSchema, projectSignUpEnabledSchema, refreshTokenResponseSchema, selectedTeamIdSchema, serverOrHigherAuthTypeSchema, signInEmailSchema, signInResponseSchema, signedUpAtMillisSchema, strictEmailSchema, teamClientMetadataSchema, teamClientReadOnlyMetadataSchema, teamCreatedAtMillisSchema, teamCreatorUserIdSchema, teamDisplayNameSchema, teamIdSchema, teamInvitationCallbackUrlSchema, teamInvitationEmailSchema, teamMemberDisplayNameSchema, teamMemberProfileImageUrlSchema, teamPermissionDescriptionSchema, teamProfileImageUrlSchema, teamServerMetadataSchema, teamSystemPermissions, templateThemeIdSchema, urlSchema, userClientMetadataSchema, userClientReadOnlyMetadataSchema, userDisplayNameSchema, userHasPasswordSchema, userIdOrMeSchema, userIdSchema, userLastActiveAtMillisSchema, userOAuthProviderSchema, userOtpAuthEnabledMutationSchema, userOtpAuthEnabledSchema, userPasskeyAuthEnabledSchema, userPasswordHashMutationSchema, userPasswordMutationSchema, userServerMetadataSchema, userSpecifiedIdSchema, userTotpSecretMutationSchema, wildcardProtocolAndDomainSchema, wildcardUrlSchema, yupArray, yupBoolean, yupDate, yupDefinedAndNonEmptyWhen, yupDefinedWhen, yupMixed, yupNever, yupNumber, yupObject, yupObjectWithAutoDefault, yupRecord, yupString, yupTuple, yupUnion, yupValidate };
|
|
438
|
+
export { ReplaceFieldWithOwnUserId, type RestrictedReasonType, StackAdaptSentinel, USER_SPECIFIED_ID_MAX_LENGTH, USER_SPECIFIED_ID_PATTERN, accessTokenPayloadSchema, accessTokenResponseSchema, adaptSchema, adminAuthTypeSchema, base64Schema, basicAuthorizationHeaderSchema, clientOrHigherAuthTypeSchema, contactChannelIdSchema, contactChannelIsPrimarySchema, contactChannelIsVerifiedSchema, contactChannelTypeSchema, contactChannelUsedForAuthSchema, contactChannelValueSchema, containedPermissionIdsSchema, customPermissionDefinitionIdSchema, customerTypeSchema, dayIntervalOrNeverSchema, dayIntervalSchema, emailHostSchema, emailOtpSignInCallbackUrlSchema, emailPasswordSchema, emailPortSchema, emailSchema, emailSenderEmailSchema, emailSenderNameSchema, emailTemplateListSchema, emailThemeListSchema, emailThemeSchema, emailTypeSchema, emailUsernameSchema, emailVerificationCallbackUrlSchema, ensureObjectSchema, getUserSpecifiedIdErrorMessage, handlerPathSchema, inlineProductSchema, intervalOrNeverSchema, intervalSchema, isValidUserSpecifiedId, jsonSchema, jsonStringOrEmptySchema, jsonStringSchema, moneyAmountSchema, neonAuthorizationHeaderSchema, oauthAccountMergeStrategySchema, oauthClientIdSchema, oauthClientSecretSchema, oauthEnabledSchema, oauthFacebookConfigIdSchema, oauthIdSchema, oauthMicrosoftTenantIdSchema, oauthProviderAccountIdSchema, oauthProviderAllowConnectedAccountsSchema, oauthProviderAllowSignInSchema, oauthProviderEmailSchema, oauthProviderIdSchema, oauthProviderProviderConfigIdSchema, oauthProviderTypeSchema, oauthTypeSchema, passwordSchema, permissionDefinitionIdSchema, priceOrIncludeByDefaultSchema, primaryEmailAuthEnabledSchema, primaryEmailSchema, primaryEmailVerifiedSchema, productClientMetadataSchema, productClientReadOnlyMetadataSchema, productPriceSchema, productSchema, productSchemaWithMetadata, productServerMetadataSchema, profileImageUrlSchema, projectAllowLocalhostSchema, projectBranchIdSchema, projectClientTeamCreationEnabledSchema, projectClientUserDeletionEnabledSchema, projectConfigIdSchema, projectCreateTeamOnSignUpSchema, projectCreatedAtMillisSchema, projectCredentialEnabledSchema, projectDescriptionSchema, projectDisplayNameSchema, projectIdSchema, projectIsProductionModeSchema, projectLogoDarkModeUrlSchema, projectLogoFullDarkModeUrlSchema, projectLogoFullUrlSchema, projectLogoUrlSchema, projectMagicLinkEnabledSchema, projectPasskeyEnabledSchema, projectSignUpEnabledSchema, refreshTokenResponseSchema, restrictedReasonTypes, sanitizeUserSpecifiedId, selectedTeamIdSchema, serverOrHigherAuthTypeSchema, signInEmailSchema, signInResponseSchema, signedUpAtMillisSchema, strictEmailSchema, teamClientMetadataSchema, teamClientReadOnlyMetadataSchema, teamCreatedAtMillisSchema, teamCreatorUserIdSchema, teamDisplayNameSchema, teamIdSchema, teamInvitationCallbackUrlSchema, teamInvitationEmailSchema, teamMemberDisplayNameSchema, teamMemberProfileImageUrlSchema, teamPermissionDescriptionSchema, teamProfileImageUrlSchema, teamServerMetadataSchema, teamSystemPermissions, templateThemeIdSchema, urlSchema, userClientMetadataSchema, userClientReadOnlyMetadataSchema, userDisplayNameSchema, userHasPasswordSchema, userIdOrMeSchema, userIdSchema, userLastActiveAtMillisSchema, userOAuthProviderSchema, userOtpAuthEnabledMutationSchema, userOtpAuthEnabledSchema, userPasskeyAuthEnabledSchema, userPasswordHashMutationSchema, userPasswordMutationSchema, userServerMetadataSchema, userSpecifiedIdSchema, userTotpSecretMutationSchema, wildcardProtocolAndDomainSchema, wildcardUrlSchema, yupArray, yupBoolean, yupDate, yupDefinedAndNonEmptyWhen, yupDefinedWhen, yupMixed, yupNever, yupNumber, yupObject, yupObjectWithAutoDefault, yupRecord, yupString, yupTuple, yupUnion, yupValidate };
|
package/dist/schema-fields.js
CHANGED
|
@@ -31,6 +31,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var schema_fields_exports = {};
|
|
32
32
|
__export(schema_fields_exports, {
|
|
33
33
|
ReplaceFieldWithOwnUserId: () => ReplaceFieldWithOwnUserId,
|
|
34
|
+
USER_SPECIFIED_ID_MAX_LENGTH: () => USER_SPECIFIED_ID_MAX_LENGTH,
|
|
35
|
+
USER_SPECIFIED_ID_PATTERN: () => USER_SPECIFIED_ID_PATTERN,
|
|
34
36
|
accessTokenPayloadSchema: () => accessTokenPayloadSchema,
|
|
35
37
|
accessTokenResponseSchema: () => accessTokenResponseSchema,
|
|
36
38
|
adaptSchema: () => adaptSchema,
|
|
@@ -63,10 +65,12 @@ __export(schema_fields_exports, {
|
|
|
63
65
|
emailUsernameSchema: () => emailUsernameSchema,
|
|
64
66
|
emailVerificationCallbackUrlSchema: () => emailVerificationCallbackUrlSchema,
|
|
65
67
|
ensureObjectSchema: () => ensureObjectSchema,
|
|
68
|
+
getUserSpecifiedIdErrorMessage: () => getUserSpecifiedIdErrorMessage,
|
|
66
69
|
handlerPathSchema: () => handlerPathSchema,
|
|
67
70
|
inlineProductSchema: () => inlineProductSchema,
|
|
68
71
|
intervalOrNeverSchema: () => intervalOrNeverSchema,
|
|
69
72
|
intervalSchema: () => intervalSchema,
|
|
73
|
+
isValidUserSpecifiedId: () => isValidUserSpecifiedId,
|
|
70
74
|
jsonSchema: () => jsonSchema,
|
|
71
75
|
jsonStringOrEmptySchema: () => jsonStringOrEmptySchema,
|
|
72
76
|
jsonStringSchema: () => jsonStringSchema,
|
|
@@ -120,6 +124,8 @@ __export(schema_fields_exports, {
|
|
|
120
124
|
projectPasskeyEnabledSchema: () => projectPasskeyEnabledSchema,
|
|
121
125
|
projectSignUpEnabledSchema: () => projectSignUpEnabledSchema,
|
|
122
126
|
refreshTokenResponseSchema: () => refreshTokenResponseSchema,
|
|
127
|
+
restrictedReasonTypes: () => restrictedReasonTypes,
|
|
128
|
+
sanitizeUserSpecifiedId: () => sanitizeUserSpecifiedId,
|
|
123
129
|
selectedTeamIdSchema: () => selectedTeamIdSchema,
|
|
124
130
|
serverOrHigherAuthTypeSchema: () => serverOrHigherAuthTypeSchema,
|
|
125
131
|
signInEmailSchema: () => signInEmailSchema,
|
|
@@ -478,7 +484,19 @@ var intervalSchema = yupTuple([yupNumber().min(0).integer().defined(), yupString
|
|
|
478
484
|
var dayIntervalSchema = yupTuple([yupNumber().min(0).integer().defined(), yupString().oneOf(["day", "week", "month", "year"]).defined()]);
|
|
479
485
|
var intervalOrNeverSchema = yupUnion(intervalSchema.defined(), yupString().oneOf(["never"]).defined());
|
|
480
486
|
var dayIntervalOrNeverSchema = yupUnion(dayIntervalSchema.defined(), yupString().oneOf(["never"]).defined());
|
|
481
|
-
var
|
|
487
|
+
var USER_SPECIFIED_ID_PATTERN = /^[a-zA-Z0-9_][a-zA-Z0-9_-]*$/;
|
|
488
|
+
var USER_SPECIFIED_ID_MAX_LENGTH = 63;
|
|
489
|
+
function isValidUserSpecifiedId(id) {
|
|
490
|
+
return id.length > 0 && id.length <= USER_SPECIFIED_ID_MAX_LENGTH && USER_SPECIFIED_ID_PATTERN.test(id);
|
|
491
|
+
}
|
|
492
|
+
function getUserSpecifiedIdErrorMessage(idName) {
|
|
493
|
+
return `${idName} must contain only letters, numbers, underscores, and hyphens, and not start with a hyphen`;
|
|
494
|
+
}
|
|
495
|
+
function sanitizeUserSpecifiedId(input) {
|
|
496
|
+
const sanitized = input.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9_-]/g, "");
|
|
497
|
+
return sanitized.replace(/^-+/, "");
|
|
498
|
+
}
|
|
499
|
+
var userSpecifiedIdSchema = (idName) => yupString().max(USER_SPECIFIED_ID_MAX_LENGTH).matches(USER_SPECIFIED_ID_PATTERN, getUserSpecifiedIdErrorMessage(idName));
|
|
482
500
|
var moneyAmountSchema = (currency) => yupString().test("money-amount", "Invalid money amount", (value, context) => {
|
|
483
501
|
if (value == null) return true;
|
|
484
502
|
const regex = /^([0-9]+)(\.([0-9]+))?$/;
|
|
@@ -575,7 +593,7 @@ var priceOrIncludeByDefaultSchema = yupUnion(
|
|
|
575
593
|
);
|
|
576
594
|
var productSchema = yupObject({
|
|
577
595
|
displayName: yupString(),
|
|
578
|
-
|
|
596
|
+
productLineId: userSpecifiedIdSchema("productLineId").optional().meta({ openapiField: { description: "The ID of the product line this product belongs to. Within a product line, all products are mutually exclusive unless they are an add-on to another product in the product line.", exampleValue: "product-line-id" } }),
|
|
579
597
|
isAddOnTo: yupUnion(
|
|
580
598
|
yupBoolean().isFalse(),
|
|
581
599
|
yupRecord(
|
|
@@ -672,9 +690,11 @@ var userHasPasswordSchema = yupBoolean().meta({ openapiField: { hidden: true, de
|
|
|
672
690
|
var userPasswordMutationSchema = passwordSchema.nullable().meta({ openapiField: { description: "Sets the user's password. Doing so revokes all current sessions.", exampleValue: "my-new-password" } }).max(70);
|
|
673
691
|
var userPasswordHashMutationSchema = yupString().nonEmpty().meta({ openapiField: { description: "If `password` is not given, sets the user's password hash to the given string in Modular Crypt Format (ex.: `$2a$10$VIhIOofSMqGdGlL4wzE//e.77dAQGqNtF/1dT7bqCrVtQuInWy2qi`). Doing so revokes all current sessions." } });
|
|
674
692
|
var userTotpSecretMutationSchema = base64Schema.nullable().meta({ openapiField: { description: "Enables 2FA and sets a TOTP secret for the user. Set to null to disable 2FA.", exampleValue: "dG90cC1zZWNyZXQ=" } });
|
|
693
|
+
var restrictedReasonTypes = ["anonymous", "email_not_verified"];
|
|
675
694
|
var accessTokenPayloadSchema = yupObject({
|
|
676
695
|
sub: yupString().defined(),
|
|
677
696
|
exp: yupNumber().optional(),
|
|
697
|
+
iat: yupNumber().defined(),
|
|
678
698
|
iss: yupString().defined(),
|
|
679
699
|
aud: yupString().defined(),
|
|
680
700
|
project_id: yupString().defined(),
|
|
@@ -685,7 +705,11 @@ var accessTokenPayloadSchema = yupObject({
|
|
|
685
705
|
email: yupString().defined().nullable(),
|
|
686
706
|
email_verified: yupBoolean().defined(),
|
|
687
707
|
selected_team_id: yupString().defined().nullable(),
|
|
688
|
-
is_anonymous: yupBoolean().defined()
|
|
708
|
+
is_anonymous: yupBoolean().defined(),
|
|
709
|
+
is_restricted: yupBoolean().defined(),
|
|
710
|
+
restricted_reason: yupObject({
|
|
711
|
+
type: yupString().oneOf(restrictedReasonTypes).defined()
|
|
712
|
+
}).defined().nullable()
|
|
689
713
|
});
|
|
690
714
|
var signInEmailSchema = strictEmailSchema(void 0).meta({ openapiField: { description: "The email to sign in with.", exampleValue: "johndoe@example.com" } });
|
|
691
715
|
var emailOtpSignInCallbackUrlSchema = urlSchema.meta({ openapiField: { description: "The base callback URL to construct the magic link from. A query parameter `code` with the verification code will be appended to it. The page should then make a request to the `/auth/otp/sign-in` endpoint.", exampleValue: "https://example.com/handler/magic-link-callback" } });
|
|
@@ -775,6 +799,8 @@ function yupDefinedAndNonEmptyWhen(schema, triggers) {
|
|
|
775
799
|
// Annotate the CommonJS export names for ESM import in node:
|
|
776
800
|
0 && (module.exports = {
|
|
777
801
|
ReplaceFieldWithOwnUserId,
|
|
802
|
+
USER_SPECIFIED_ID_MAX_LENGTH,
|
|
803
|
+
USER_SPECIFIED_ID_PATTERN,
|
|
778
804
|
accessTokenPayloadSchema,
|
|
779
805
|
accessTokenResponseSchema,
|
|
780
806
|
adaptSchema,
|
|
@@ -807,10 +833,12 @@ function yupDefinedAndNonEmptyWhen(schema, triggers) {
|
|
|
807
833
|
emailUsernameSchema,
|
|
808
834
|
emailVerificationCallbackUrlSchema,
|
|
809
835
|
ensureObjectSchema,
|
|
836
|
+
getUserSpecifiedIdErrorMessage,
|
|
810
837
|
handlerPathSchema,
|
|
811
838
|
inlineProductSchema,
|
|
812
839
|
intervalOrNeverSchema,
|
|
813
840
|
intervalSchema,
|
|
841
|
+
isValidUserSpecifiedId,
|
|
814
842
|
jsonSchema,
|
|
815
843
|
jsonStringOrEmptySchema,
|
|
816
844
|
jsonStringSchema,
|
|
@@ -864,6 +892,8 @@ function yupDefinedAndNonEmptyWhen(schema, triggers) {
|
|
|
864
892
|
projectPasskeyEnabledSchema,
|
|
865
893
|
projectSignUpEnabledSchema,
|
|
866
894
|
refreshTokenResponseSchema,
|
|
895
|
+
restrictedReasonTypes,
|
|
896
|
+
sanitizeUserSpecifiedId,
|
|
867
897
|
selectedTeamIdSchema,
|
|
868
898
|
serverOrHigherAuthTypeSchema,
|
|
869
899
|
signInEmailSchema,
|