@stackframe/stack-shared 2.8.39 → 2.8.41
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/CHANGELOG.md +12 -0
- package/dist/esm/interface/client-interface.js +1 -1
- package/dist/esm/interface/client-interface.js.map +1 -1
- package/dist/esm/schema-fields.js +17 -1
- package/dist/esm/schema-fields.js.map +1 -1
- package/dist/esm/sessions.js +34 -12
- package/dist/esm/sessions.js.map +1 -1
- package/dist/esm/utils/paginated-lists.js +230 -0
- package/dist/esm/utils/paginated-lists.js.map +1 -0
- package/dist/helpers/password.d.mts +3 -3
- package/dist/helpers/password.d.ts +3 -3
- package/dist/index.d.mts +4 -5
- package/dist/index.d.ts +4 -5
- package/dist/interface/admin-interface.d.mts +4 -5
- package/dist/interface/admin-interface.d.ts +4 -5
- package/dist/interface/client-interface.d.mts +0 -1
- package/dist/interface/client-interface.d.ts +0 -1
- package/dist/interface/client-interface.js +1 -1
- package/dist/interface/client-interface.js.map +1 -1
- package/dist/interface/crud/current-user.d.mts +4 -4
- package/dist/interface/crud/current-user.d.ts +4 -4
- package/dist/interface/crud/oauth-providers.d.mts +4 -4
- package/dist/interface/crud/oauth-providers.d.ts +4 -4
- package/dist/interface/crud/project-api-keys.d.mts +2 -2
- package/dist/interface/crud/project-api-keys.d.ts +2 -2
- package/dist/interface/crud/projects.d.mts +12 -12
- package/dist/interface/crud/projects.d.ts +12 -12
- package/dist/interface/crud/team-member-profiles.d.mts +6 -6
- package/dist/interface/crud/team-member-profiles.d.ts +6 -6
- package/dist/interface/crud/transactions.d.mts +1 -1
- package/dist/interface/crud/transactions.d.ts +1 -1
- package/dist/interface/crud/users.d.mts +6 -6
- package/dist/interface/crud/users.d.ts +6 -6
- package/dist/interface/server-interface.d.mts +0 -1
- package/dist/interface/server-interface.d.ts +0 -1
- package/dist/known-errors.d.mts +3 -3
- package/dist/known-errors.d.ts +3 -3
- package/dist/schema-fields.d.mts +36 -7
- package/dist/schema-fields.d.ts +36 -7
- package/dist/schema-fields.js +19 -2
- package/dist/schema-fields.js.map +1 -1
- package/dist/sessions.d.mts +28 -5
- package/dist/sessions.d.ts +28 -5
- package/dist/sessions.js +33 -11
- package/dist/sessions.js.map +1 -1
- package/dist/utils/paginated-lists.d.mts +176 -0
- package/dist/utils/paginated-lists.d.ts +176 -0
- package/dist/utils/paginated-lists.js +256 -0
- package/dist/utils/paginated-lists.js.map +1 -0
- package/dist/utils/stores.d.mts +6 -6
- package/dist/utils/stores.d.ts +6 -6
- package/package.json +1 -1
package/dist/schema-fields.d.mts
CHANGED
|
@@ -104,7 +104,7 @@ declare const projectClientTeamCreationEnabledSchema: yup.BooleanSchema<boolean
|
|
|
104
104
|
declare const projectClientUserDeletionEnabledSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
|
|
105
105
|
declare const projectSignUpEnabledSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
|
|
106
106
|
declare const projectCredentialEnabledSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
|
|
107
|
-
declare const oauthIdSchema: yup.StringSchema<"
|
|
107
|
+
declare const oauthIdSchema: yup.StringSchema<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | "twitch" | undefined, yup.AnyObject, undefined, "">;
|
|
108
108
|
declare const oauthEnabledSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
|
|
109
109
|
declare const oauthTypeSchema: yup.StringSchema<"shared" | "standard" | undefined, yup.AnyObject, undefined, "">;
|
|
110
110
|
declare const oauthClientIdSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
@@ -131,7 +131,7 @@ declare const emailTemplateListSchema: yup.MixedSchema<Record<string, {
|
|
|
131
131
|
displayName: string;
|
|
132
132
|
tsxSource: string;
|
|
133
133
|
}>, yup.AnyObject, undefined, "">;
|
|
134
|
-
declare const customerTypeSchema: yup.StringSchema<"
|
|
134
|
+
declare const customerTypeSchema: yup.StringSchema<"user" | "team" | "custom" | undefined, yup.AnyObject, undefined, "">;
|
|
135
135
|
declare const offerPriceSchema: yup.ObjectSchema<{
|
|
136
136
|
interval: DayInterval | undefined;
|
|
137
137
|
serverOnly: boolean | undefined;
|
|
@@ -171,7 +171,7 @@ declare const offerSchema: yup.ObjectSchema<{
|
|
|
171
171
|
displayName: string | undefined;
|
|
172
172
|
groupId: string | undefined;
|
|
173
173
|
isAddOnTo: false | Record<string, true> | undefined;
|
|
174
|
-
customerType: "
|
|
174
|
+
customerType: "user" | "team" | "custom";
|
|
175
175
|
freeTrial: DayInterval | undefined;
|
|
176
176
|
serverOnly: boolean | undefined;
|
|
177
177
|
stackable: boolean | undefined;
|
|
@@ -205,7 +205,7 @@ declare const offerSchema: yup.ObjectSchema<{
|
|
|
205
205
|
}, "">;
|
|
206
206
|
declare const inlineOfferSchema: yup.ObjectSchema<{
|
|
207
207
|
display_name: string;
|
|
208
|
-
customer_type: "
|
|
208
|
+
customer_type: "user" | "team" | "custom";
|
|
209
209
|
free_trial: DayInterval | undefined;
|
|
210
210
|
server_only: boolean;
|
|
211
211
|
prices: Record<string, {
|
|
@@ -250,7 +250,7 @@ declare const userClientReadOnlyMetadataSchema: yup.MixedSchema<{} | null, yup.A
|
|
|
250
250
|
declare const userServerMetadataSchema: yup.MixedSchema<{} | null, yup.AnyObject, undefined, "">;
|
|
251
251
|
declare const userOAuthProviderSchema: yup.ObjectSchema<{
|
|
252
252
|
id: string;
|
|
253
|
-
type: "
|
|
253
|
+
type: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | "twitch";
|
|
254
254
|
provider_user_id: string;
|
|
255
255
|
}, yup.AnyObject, {
|
|
256
256
|
id: undefined;
|
|
@@ -265,6 +265,35 @@ declare const userHasPasswordSchema: yup.BooleanSchema<boolean | undefined, yup.
|
|
|
265
265
|
declare const userPasswordMutationSchema: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, "">;
|
|
266
266
|
declare const userPasswordHashMutationSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
267
267
|
declare const userTotpSecretMutationSchema: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, "">;
|
|
268
|
+
declare const accessTokenPayloadSchema: yup.ObjectSchema<{
|
|
269
|
+
sub: string;
|
|
270
|
+
exp: number | undefined;
|
|
271
|
+
iss: string;
|
|
272
|
+
aud: string;
|
|
273
|
+
project_id: string;
|
|
274
|
+
branch_id: string;
|
|
275
|
+
refresh_token_id: string;
|
|
276
|
+
role: "authenticated";
|
|
277
|
+
name: string | null;
|
|
278
|
+
email: string | null;
|
|
279
|
+
email_verified: boolean;
|
|
280
|
+
selected_team_id: string | null;
|
|
281
|
+
is_anonymous: boolean;
|
|
282
|
+
}, yup.AnyObject, {
|
|
283
|
+
sub: undefined;
|
|
284
|
+
exp: undefined;
|
|
285
|
+
iss: undefined;
|
|
286
|
+
aud: undefined;
|
|
287
|
+
project_id: undefined;
|
|
288
|
+
branch_id: undefined;
|
|
289
|
+
refresh_token_id: undefined;
|
|
290
|
+
role: undefined;
|
|
291
|
+
name: undefined;
|
|
292
|
+
email: undefined;
|
|
293
|
+
email_verified: undefined;
|
|
294
|
+
selected_team_id: undefined;
|
|
295
|
+
is_anonymous: undefined;
|
|
296
|
+
}, "">;
|
|
268
297
|
declare const signInEmailSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
269
298
|
declare const emailOtpSignInCallbackUrlSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
270
299
|
declare const emailVerificationCallbackUrlSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
@@ -306,7 +335,7 @@ declare const contactChannelIsVerifiedSchema: yup.BooleanSchema<boolean | undefi
|
|
|
306
335
|
declare const contactChannelIsPrimarySchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
|
|
307
336
|
declare const oauthProviderIdSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
308
337
|
declare const oauthProviderEmailSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
309
|
-
declare const oauthProviderTypeSchema: yup.StringSchema<"
|
|
338
|
+
declare const oauthProviderTypeSchema: yup.StringSchema<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | "twitch" | undefined, yup.AnyObject, undefined, "">;
|
|
310
339
|
declare const oauthProviderAllowSignInSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
|
|
311
340
|
declare const oauthProviderAllowConnectedAccountsSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
|
|
312
341
|
declare const oauthProviderAccountIdSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
@@ -316,4 +345,4 @@ declare const neonAuthorizationHeaderSchema: yup.StringSchema<string | undefined
|
|
|
316
345
|
declare function yupDefinedWhen<S extends yup.AnyObject>(schema: S, triggers: Record<string, any>): S;
|
|
317
346
|
declare function yupDefinedAndNonEmptyWhen<S extends yup.StringSchema>(schema: S, triggers: Record<string, any>): S;
|
|
318
347
|
|
|
319
|
-
export { ReplaceFieldWithOwnUserId, StackAdaptSentinel, 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, inlineOfferSchema, intervalOrNeverSchema, intervalSchema, jsonSchema, jsonStringOrEmptySchema, jsonStringSchema, moneyAmountSchema, neonAuthorizationHeaderSchema, oauthAccountMergeStrategySchema, oauthClientIdSchema, oauthClientSecretSchema, oauthEnabledSchema, oauthFacebookConfigIdSchema, oauthIdSchema, oauthMicrosoftTenantIdSchema, oauthProviderAccountIdSchema, oauthProviderAllowConnectedAccountsSchema, oauthProviderAllowSignInSchema, oauthProviderEmailSchema, oauthProviderIdSchema, oauthProviderProviderConfigIdSchema, oauthProviderTypeSchema, oauthTypeSchema, offerPriceSchema, offerSchema, passwordSchema, permissionDefinitionIdSchema, priceOrIncludeByDefaultSchema, primaryEmailAuthEnabledSchema, primaryEmailSchema, primaryEmailVerifiedSchema, profileImageUrlSchema, projectAllowLocalhostSchema, projectBranchIdSchema, projectClientTeamCreationEnabledSchema, projectClientUserDeletionEnabledSchema, projectConfigIdSchema, projectCreateTeamOnSignUpSchema, projectCreatedAtMillisSchema, projectCredentialEnabledSchema, projectDescriptionSchema, projectDisplayNameSchema, projectFullLogoUrlSchema, projectIdSchema, projectIsProductionModeSchema, 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, wildcardUrlSchema, yupArray, yupBoolean, yupDate, yupDefinedAndNonEmptyWhen, yupDefinedWhen, yupMixed, yupNever, yupNumber, yupObject, yupObjectWithAutoDefault, yupRecord, yupString, yupTuple, yupUnion, yupValidate };
|
|
348
|
+
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, inlineOfferSchema, intervalOrNeverSchema, intervalSchema, jsonSchema, jsonStringOrEmptySchema, jsonStringSchema, moneyAmountSchema, neonAuthorizationHeaderSchema, oauthAccountMergeStrategySchema, oauthClientIdSchema, oauthClientSecretSchema, oauthEnabledSchema, oauthFacebookConfigIdSchema, oauthIdSchema, oauthMicrosoftTenantIdSchema, oauthProviderAccountIdSchema, oauthProviderAllowConnectedAccountsSchema, oauthProviderAllowSignInSchema, oauthProviderEmailSchema, oauthProviderIdSchema, oauthProviderProviderConfigIdSchema, oauthProviderTypeSchema, oauthTypeSchema, offerPriceSchema, offerSchema, passwordSchema, permissionDefinitionIdSchema, priceOrIncludeByDefaultSchema, primaryEmailAuthEnabledSchema, primaryEmailSchema, primaryEmailVerifiedSchema, profileImageUrlSchema, projectAllowLocalhostSchema, projectBranchIdSchema, projectClientTeamCreationEnabledSchema, projectClientUserDeletionEnabledSchema, projectConfigIdSchema, projectCreateTeamOnSignUpSchema, projectCreatedAtMillisSchema, projectCredentialEnabledSchema, projectDescriptionSchema, projectDisplayNameSchema, projectFullLogoUrlSchema, projectIdSchema, projectIsProductionModeSchema, 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, wildcardUrlSchema, yupArray, yupBoolean, yupDate, yupDefinedAndNonEmptyWhen, yupDefinedWhen, yupMixed, yupNever, yupNumber, yupObject, yupObjectWithAutoDefault, yupRecord, yupString, yupTuple, yupUnion, yupValidate };
|
package/dist/schema-fields.d.ts
CHANGED
|
@@ -104,7 +104,7 @@ declare const projectClientTeamCreationEnabledSchema: yup.BooleanSchema<boolean
|
|
|
104
104
|
declare const projectClientUserDeletionEnabledSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
|
|
105
105
|
declare const projectSignUpEnabledSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
|
|
106
106
|
declare const projectCredentialEnabledSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
|
|
107
|
-
declare const oauthIdSchema: yup.StringSchema<"
|
|
107
|
+
declare const oauthIdSchema: yup.StringSchema<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | "twitch" | undefined, yup.AnyObject, undefined, "">;
|
|
108
108
|
declare const oauthEnabledSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
|
|
109
109
|
declare const oauthTypeSchema: yup.StringSchema<"shared" | "standard" | undefined, yup.AnyObject, undefined, "">;
|
|
110
110
|
declare const oauthClientIdSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
@@ -131,7 +131,7 @@ declare const emailTemplateListSchema: yup.MixedSchema<Record<string, {
|
|
|
131
131
|
displayName: string;
|
|
132
132
|
tsxSource: string;
|
|
133
133
|
}>, yup.AnyObject, undefined, "">;
|
|
134
|
-
declare const customerTypeSchema: yup.StringSchema<"
|
|
134
|
+
declare const customerTypeSchema: yup.StringSchema<"user" | "team" | "custom" | undefined, yup.AnyObject, undefined, "">;
|
|
135
135
|
declare const offerPriceSchema: yup.ObjectSchema<{
|
|
136
136
|
interval: DayInterval | undefined;
|
|
137
137
|
serverOnly: boolean | undefined;
|
|
@@ -171,7 +171,7 @@ declare const offerSchema: yup.ObjectSchema<{
|
|
|
171
171
|
displayName: string | undefined;
|
|
172
172
|
groupId: string | undefined;
|
|
173
173
|
isAddOnTo: false | Record<string, true> | undefined;
|
|
174
|
-
customerType: "
|
|
174
|
+
customerType: "user" | "team" | "custom";
|
|
175
175
|
freeTrial: DayInterval | undefined;
|
|
176
176
|
serverOnly: boolean | undefined;
|
|
177
177
|
stackable: boolean | undefined;
|
|
@@ -205,7 +205,7 @@ declare const offerSchema: yup.ObjectSchema<{
|
|
|
205
205
|
}, "">;
|
|
206
206
|
declare const inlineOfferSchema: yup.ObjectSchema<{
|
|
207
207
|
display_name: string;
|
|
208
|
-
customer_type: "
|
|
208
|
+
customer_type: "user" | "team" | "custom";
|
|
209
209
|
free_trial: DayInterval | undefined;
|
|
210
210
|
server_only: boolean;
|
|
211
211
|
prices: Record<string, {
|
|
@@ -250,7 +250,7 @@ declare const userClientReadOnlyMetadataSchema: yup.MixedSchema<{} | null, yup.A
|
|
|
250
250
|
declare const userServerMetadataSchema: yup.MixedSchema<{} | null, yup.AnyObject, undefined, "">;
|
|
251
251
|
declare const userOAuthProviderSchema: yup.ObjectSchema<{
|
|
252
252
|
id: string;
|
|
253
|
-
type: "
|
|
253
|
+
type: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | "twitch";
|
|
254
254
|
provider_user_id: string;
|
|
255
255
|
}, yup.AnyObject, {
|
|
256
256
|
id: undefined;
|
|
@@ -265,6 +265,35 @@ declare const userHasPasswordSchema: yup.BooleanSchema<boolean | undefined, yup.
|
|
|
265
265
|
declare const userPasswordMutationSchema: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, "">;
|
|
266
266
|
declare const userPasswordHashMutationSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
267
267
|
declare const userTotpSecretMutationSchema: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, "">;
|
|
268
|
+
declare const accessTokenPayloadSchema: yup.ObjectSchema<{
|
|
269
|
+
sub: string;
|
|
270
|
+
exp: number | undefined;
|
|
271
|
+
iss: string;
|
|
272
|
+
aud: string;
|
|
273
|
+
project_id: string;
|
|
274
|
+
branch_id: string;
|
|
275
|
+
refresh_token_id: string;
|
|
276
|
+
role: "authenticated";
|
|
277
|
+
name: string | null;
|
|
278
|
+
email: string | null;
|
|
279
|
+
email_verified: boolean;
|
|
280
|
+
selected_team_id: string | null;
|
|
281
|
+
is_anonymous: boolean;
|
|
282
|
+
}, yup.AnyObject, {
|
|
283
|
+
sub: undefined;
|
|
284
|
+
exp: undefined;
|
|
285
|
+
iss: undefined;
|
|
286
|
+
aud: undefined;
|
|
287
|
+
project_id: undefined;
|
|
288
|
+
branch_id: undefined;
|
|
289
|
+
refresh_token_id: undefined;
|
|
290
|
+
role: undefined;
|
|
291
|
+
name: undefined;
|
|
292
|
+
email: undefined;
|
|
293
|
+
email_verified: undefined;
|
|
294
|
+
selected_team_id: undefined;
|
|
295
|
+
is_anonymous: undefined;
|
|
296
|
+
}, "">;
|
|
268
297
|
declare const signInEmailSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
269
298
|
declare const emailOtpSignInCallbackUrlSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
270
299
|
declare const emailVerificationCallbackUrlSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
@@ -306,7 +335,7 @@ declare const contactChannelIsVerifiedSchema: yup.BooleanSchema<boolean | undefi
|
|
|
306
335
|
declare const contactChannelIsPrimarySchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
|
|
307
336
|
declare const oauthProviderIdSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
308
337
|
declare const oauthProviderEmailSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
309
|
-
declare const oauthProviderTypeSchema: yup.StringSchema<"
|
|
338
|
+
declare const oauthProviderTypeSchema: yup.StringSchema<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | "twitch" | undefined, yup.AnyObject, undefined, "">;
|
|
310
339
|
declare const oauthProviderAllowSignInSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
|
|
311
340
|
declare const oauthProviderAllowConnectedAccountsSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
|
|
312
341
|
declare const oauthProviderAccountIdSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
@@ -316,4 +345,4 @@ declare const neonAuthorizationHeaderSchema: yup.StringSchema<string | undefined
|
|
|
316
345
|
declare function yupDefinedWhen<S extends yup.AnyObject>(schema: S, triggers: Record<string, any>): S;
|
|
317
346
|
declare function yupDefinedAndNonEmptyWhen<S extends yup.StringSchema>(schema: S, triggers: Record<string, any>): S;
|
|
318
347
|
|
|
319
|
-
export { ReplaceFieldWithOwnUserId, StackAdaptSentinel, 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, inlineOfferSchema, intervalOrNeverSchema, intervalSchema, jsonSchema, jsonStringOrEmptySchema, jsonStringSchema, moneyAmountSchema, neonAuthorizationHeaderSchema, oauthAccountMergeStrategySchema, oauthClientIdSchema, oauthClientSecretSchema, oauthEnabledSchema, oauthFacebookConfigIdSchema, oauthIdSchema, oauthMicrosoftTenantIdSchema, oauthProviderAccountIdSchema, oauthProviderAllowConnectedAccountsSchema, oauthProviderAllowSignInSchema, oauthProviderEmailSchema, oauthProviderIdSchema, oauthProviderProviderConfigIdSchema, oauthProviderTypeSchema, oauthTypeSchema, offerPriceSchema, offerSchema, passwordSchema, permissionDefinitionIdSchema, priceOrIncludeByDefaultSchema, primaryEmailAuthEnabledSchema, primaryEmailSchema, primaryEmailVerifiedSchema, profileImageUrlSchema, projectAllowLocalhostSchema, projectBranchIdSchema, projectClientTeamCreationEnabledSchema, projectClientUserDeletionEnabledSchema, projectConfigIdSchema, projectCreateTeamOnSignUpSchema, projectCreatedAtMillisSchema, projectCredentialEnabledSchema, projectDescriptionSchema, projectDisplayNameSchema, projectFullLogoUrlSchema, projectIdSchema, projectIsProductionModeSchema, 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, wildcardUrlSchema, yupArray, yupBoolean, yupDate, yupDefinedAndNonEmptyWhen, yupDefinedWhen, yupMixed, yupNever, yupNumber, yupObject, yupObjectWithAutoDefault, yupRecord, yupString, yupTuple, yupUnion, yupValidate };
|
|
348
|
+
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, inlineOfferSchema, intervalOrNeverSchema, intervalSchema, jsonSchema, jsonStringOrEmptySchema, jsonStringSchema, moneyAmountSchema, neonAuthorizationHeaderSchema, oauthAccountMergeStrategySchema, oauthClientIdSchema, oauthClientSecretSchema, oauthEnabledSchema, oauthFacebookConfigIdSchema, oauthIdSchema, oauthMicrosoftTenantIdSchema, oauthProviderAccountIdSchema, oauthProviderAllowConnectedAccountsSchema, oauthProviderAllowSignInSchema, oauthProviderEmailSchema, oauthProviderIdSchema, oauthProviderProviderConfigIdSchema, oauthProviderTypeSchema, oauthTypeSchema, offerPriceSchema, offerSchema, passwordSchema, permissionDefinitionIdSchema, priceOrIncludeByDefaultSchema, primaryEmailAuthEnabledSchema, primaryEmailSchema, primaryEmailVerifiedSchema, profileImageUrlSchema, projectAllowLocalhostSchema, projectBranchIdSchema, projectClientTeamCreationEnabledSchema, projectClientUserDeletionEnabledSchema, projectConfigIdSchema, projectCreateTeamOnSignUpSchema, projectCreatedAtMillisSchema, projectCredentialEnabledSchema, projectDescriptionSchema, projectDisplayNameSchema, projectFullLogoUrlSchema, projectIdSchema, projectIsProductionModeSchema, 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, 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,7 @@ 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
|
+
accessTokenPayloadSchema: () => accessTokenPayloadSchema,
|
|
34
35
|
accessTokenResponseSchema: () => accessTokenResponseSchema,
|
|
35
36
|
adaptSchema: () => adaptSchema,
|
|
36
37
|
adminAuthTypeSchema: () => adminAuthTypeSchema,
|
|
@@ -170,7 +171,7 @@ __export(schema_fields_exports, {
|
|
|
170
171
|
});
|
|
171
172
|
module.exports = __toCommonJS(schema_fields_exports);
|
|
172
173
|
var yup = __toESM(require("yup"));
|
|
173
|
-
var
|
|
174
|
+
var import_known_errors = require("./known-errors.js");
|
|
174
175
|
var import_bytes = require("./utils/bytes.js");
|
|
175
176
|
var import_currency_constants = require("./utils/currency-constants.js");
|
|
176
177
|
var import_errors = require("./utils/errors.js");
|
|
@@ -234,7 +235,7 @@ async function yupValidate(schema, obj, options) {
|
|
|
234
235
|
} catch (error) {
|
|
235
236
|
if (error instanceof ReplaceFieldWithOwnUserId) {
|
|
236
237
|
const currentUserId = options?.currentUserId;
|
|
237
|
-
if (!currentUserId) throw new
|
|
238
|
+
if (!currentUserId) throw new import_known_errors.KnownErrors.CannotGetOwnUserWithoutUser();
|
|
238
239
|
let pathRemaining = error.path;
|
|
239
240
|
const fieldPath = [];
|
|
240
241
|
while (pathRemaining.length > 0) {
|
|
@@ -634,6 +635,21 @@ var userHasPasswordSchema = yupBoolean().meta({ openapiField: { hidden: true, de
|
|
|
634
635
|
var userPasswordMutationSchema = passwordSchema.nullable().meta({ openapiField: { description: "Sets the user's password. Doing so revokes all current sessions.", exampleValue: "my-new-password" } }).max(70);
|
|
635
636
|
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." } });
|
|
636
637
|
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=" } });
|
|
638
|
+
var accessTokenPayloadSchema = yupObject({
|
|
639
|
+
sub: yupString().defined(),
|
|
640
|
+
exp: yupNumber().optional(),
|
|
641
|
+
iss: yupString().defined(),
|
|
642
|
+
aud: yupString().defined(),
|
|
643
|
+
project_id: yupString().defined(),
|
|
644
|
+
branch_id: yupString().defined(),
|
|
645
|
+
refresh_token_id: yupString().defined(),
|
|
646
|
+
role: yupString().oneOf(["authenticated"]).defined(),
|
|
647
|
+
name: yupString().defined().nullable(),
|
|
648
|
+
email: yupString().defined().nullable(),
|
|
649
|
+
email_verified: yupBoolean().defined(),
|
|
650
|
+
selected_team_id: yupString().defined().nullable(),
|
|
651
|
+
is_anonymous: yupBoolean().defined()
|
|
652
|
+
});
|
|
637
653
|
var signInEmailSchema = strictEmailSchema(void 0).meta({ openapiField: { description: "The email to sign in with.", exampleValue: "johndoe@example.com" } });
|
|
638
654
|
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" } });
|
|
639
655
|
var emailVerificationCallbackUrlSchema = urlSchema.meta({ openapiField: { description: "The base callback URL to construct a verification link for the verification e-mail. A query parameter `code` with the verification code will be appended to it. The page should then make a request to the `/contact-channels/verify` endpoint.", exampleValue: "https://example.com/handler/email-verification" } });
|
|
@@ -722,6 +738,7 @@ function yupDefinedAndNonEmptyWhen(schema, triggers) {
|
|
|
722
738
|
// Annotate the CommonJS export names for ESM import in node:
|
|
723
739
|
0 && (module.exports = {
|
|
724
740
|
ReplaceFieldWithOwnUserId,
|
|
741
|
+
accessTokenPayloadSchema,
|
|
725
742
|
accessTokenResponseSchema,
|
|
726
743
|
adaptSchema,
|
|
727
744
|
adminAuthTypeSchema,
|