@stackframe/stack-shared 2.5.24 → 2.5.27

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 CHANGED
@@ -1,5 +1,28 @@
1
1
  # @stackframe/stack-shared
2
2
 
3
+ ## 2.5.27
4
+
5
+ ### Patch Changes
6
+
7
+ - Bugfixes
8
+ - Updated dependencies
9
+ - @stackframe/stack-sc@2.5.27
10
+
11
+ ## 2.5.26
12
+
13
+ ### Patch Changes
14
+
15
+ - Bugfixes
16
+ - Updated dependencies
17
+ - @stackframe/stack-sc@2.5.26
18
+
19
+ ## 2.5.25
20
+
21
+ ### Patch Changes
22
+
23
+ - GitLab OAuth provider
24
+ - @stackframe/stack-sc@2.5.25
25
+
3
26
  ## 2.5.24
4
27
 
5
28
  ### Patch Changes
@@ -154,6 +154,7 @@ export declare const currentUserCrud: import("../../crud").CrudSchemaFromOptions
154
154
  }, "">;
155
155
  clientUpdateSchema: import("yup").ObjectSchema<{
156
156
  display_name: string | null | undefined;
157
+ profile_image_url: string | null | undefined;
157
158
  client_metadata: {} | null | undefined;
158
159
  totp_secret_base64: string | null | undefined;
159
160
  selected_team_id: string | null | undefined;
@@ -172,7 +173,7 @@ export declare const currentUserCrud: import("../../crud").CrudSchemaFromOptions
172
173
  }, "">;
173
174
  serverUpdateSchema: import("yup").ObjectSchema<{
174
175
  display_name: string | null | undefined;
175
- profile_image_url: string | undefined;
176
+ profile_image_url: string | null | undefined;
176
177
  client_metadata: {} | null | undefined;
177
178
  client_read_only_metadata: {} | null | undefined;
178
179
  server_metadata: {} | null | undefined;
@@ -4,6 +4,7 @@ import { teamsCrudClientReadSchema } from "./teams";
4
4
  import { usersCrudServerDeleteSchema, usersCrudServerReadSchema, usersCrudServerUpdateSchema } from "./users";
5
5
  const clientUpdateSchema = usersCrudServerUpdateSchema.pick([
6
6
  "display_name",
7
+ "profile_image_url",
7
8
  "client_metadata",
8
9
  "selected_team_id",
9
10
  "totp_secret_base64",
@@ -18,11 +18,11 @@ export declare const projectsCrudAdminReadSchema: import("yup").ObjectSchema<{
18
18
  client_secret?: string | undefined;
19
19
  facebook_config_id?: string | undefined;
20
20
  type: NonNullable<"shared" | "standard" | undefined>;
21
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | undefined>;
21
+ id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | undefined>;
22
22
  enabled: NonNullable<boolean | undefined>;
23
23
  }[];
24
24
  enabled_oauth_providers: {
25
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | undefined>;
25
+ id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | undefined>;
26
26
  }[];
27
27
  domains: {
28
28
  domain: string;
@@ -85,7 +85,7 @@ export declare const projectsCrudClientReadSchema: import("yup").ObjectSchema<{
85
85
  magic_link_enabled: NonNullable<boolean | undefined>;
86
86
  client_team_creation_enabled: NonNullable<boolean | undefined>;
87
87
  enabled_oauth_providers: {
88
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | undefined>;
88
+ id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | undefined>;
89
89
  }[];
90
90
  };
91
91
  }, import("yup").AnyObject, {
@@ -114,7 +114,7 @@ export declare const projectsCrudAdminUpdateSchema: import("yup").ObjectSchema<{
114
114
  client_secret?: string | undefined;
115
115
  facebook_config_id?: string | undefined;
116
116
  type: NonNullable<"shared" | "standard" | undefined>;
117
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | undefined>;
117
+ id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | undefined>;
118
118
  enabled: NonNullable<boolean | undefined>;
119
119
  }[] | undefined;
120
120
  domains?: {
@@ -159,7 +159,7 @@ export declare const projectsCrudAdminCreateSchema: import("yup").ObjectSchema<{
159
159
  client_secret?: string | undefined;
160
160
  facebook_config_id?: string | undefined;
161
161
  type: NonNullable<"shared" | "standard" | undefined>;
162
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | undefined>;
162
+ id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | undefined>;
163
163
  enabled: NonNullable<boolean | undefined>;
164
164
  }[] | undefined;
165
165
  domains?: {
@@ -202,7 +202,7 @@ export declare const projectsCrud: import("../../crud").CrudSchemaFromOptions<{
202
202
  magic_link_enabled: NonNullable<boolean | undefined>;
203
203
  client_team_creation_enabled: NonNullable<boolean | undefined>;
204
204
  enabled_oauth_providers: {
205
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | undefined>;
205
+ id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | undefined>;
206
206
  }[];
207
207
  };
208
208
  }, import("yup").AnyObject, {
@@ -235,11 +235,11 @@ export declare const projectsCrud: import("../../crud").CrudSchemaFromOptions<{
235
235
  client_secret?: string | undefined;
236
236
  facebook_config_id?: string | undefined;
237
237
  type: NonNullable<"shared" | "standard" | undefined>;
238
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | undefined>;
238
+ id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | undefined>;
239
239
  enabled: NonNullable<boolean | undefined>;
240
240
  }[];
241
241
  enabled_oauth_providers: {
242
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | undefined>;
242
+ id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | undefined>;
243
243
  }[];
244
244
  domains: {
245
245
  domain: string;
@@ -308,7 +308,7 @@ export declare const projectsCrud: import("../../crud").CrudSchemaFromOptions<{
308
308
  client_secret?: string | undefined;
309
309
  facebook_config_id?: string | undefined;
310
310
  type: NonNullable<"shared" | "standard" | undefined>;
311
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | undefined>;
311
+ id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | undefined>;
312
312
  enabled: NonNullable<boolean | undefined>;
313
313
  }[] | undefined;
314
314
  domains?: {
@@ -383,11 +383,11 @@ export declare const internalProjectsCrud: import("../../crud").CrudSchemaFromOp
383
383
  client_secret?: string | undefined;
384
384
  facebook_config_id?: string | undefined;
385
385
  type: NonNullable<"shared" | "standard" | undefined>;
386
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | undefined>;
386
+ id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | undefined>;
387
387
  enabled: NonNullable<boolean | undefined>;
388
388
  }[];
389
389
  enabled_oauth_providers: {
390
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | undefined>;
390
+ id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | undefined>;
391
391
  }[];
392
392
  domains: {
393
393
  domain: string;
@@ -456,7 +456,7 @@ export declare const internalProjectsCrud: import("../../crud").CrudSchemaFromOp
456
456
  client_secret?: string | undefined;
457
457
  facebook_config_id?: string | undefined;
458
458
  type: NonNullable<"shared" | "standard" | undefined>;
459
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | undefined>;
459
+ id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | undefined>;
460
460
  enabled: NonNullable<boolean | undefined>;
461
461
  }[] | undefined;
462
462
  domains?: {
@@ -1,7 +1,7 @@
1
1
  import { CrudTypeOf } from "../../crud";
2
2
  export declare const usersCrudServerUpdateSchema: import("yup").ObjectSchema<{
3
3
  display_name: string | null | undefined;
4
- profile_image_url: string | undefined;
4
+ profile_image_url: string | null | undefined;
5
5
  client_metadata: {} | null | undefined;
6
6
  client_read_only_metadata: {} | null | undefined;
7
7
  server_metadata: {} | null | undefined;
@@ -104,7 +104,7 @@ export declare const usersCrudServerReadSchema: import("yup").ObjectSchema<{
104
104
  }, "">;
105
105
  export declare const usersCrudServerCreateSchema: import("yup").ObjectSchema<{
106
106
  display_name: string | null | undefined;
107
- profile_image_url: string | undefined;
107
+ profile_image_url: string | null | undefined;
108
108
  client_metadata: {} | null | undefined;
109
109
  client_read_only_metadata: {} | null | undefined;
110
110
  server_metadata: {} | null | undefined;
@@ -216,7 +216,7 @@ export declare const usersCrud: import("../../crud").CrudSchemaFromOptions<{
216
216
  }, "">;
217
217
  serverUpdateSchema: import("yup").ObjectSchema<{
218
218
  display_name: string | null | undefined;
219
- profile_image_url: string | undefined;
219
+ profile_image_url: string | null | undefined;
220
220
  client_metadata: {} | null | undefined;
221
221
  client_read_only_metadata: {} | null | undefined;
222
222
  server_metadata: {} | null | undefined;
@@ -241,7 +241,7 @@ export declare const usersCrud: import("../../crud").CrudSchemaFromOptions<{
241
241
  }, "">;
242
242
  serverCreateSchema: import("yup").ObjectSchema<{
243
243
  display_name: string | null | undefined;
244
- profile_image_url: string | undefined;
244
+ profile_image_url: string | null | undefined;
245
245
  client_metadata: {} | null | undefined;
246
246
  client_read_only_metadata: {} | null | undefined;
247
247
  server_metadata: {} | null | undefined;
@@ -3,7 +3,7 @@ import * as fieldSchema from "../../schema-fields";
3
3
  import { teamsCrudServerReadSchema } from "./teams";
4
4
  export const usersCrudServerUpdateSchema = fieldSchema.yupObject({
5
5
  display_name: fieldSchema.userDisplayNameSchema.optional(),
6
- profile_image_url: fieldSchema.profileImageUrlSchema.optional(),
6
+ profile_image_url: fieldSchema.profileImageUrlSchema.nullable().optional(),
7
7
  client_metadata: fieldSchema.userClientMetadataSchema.optional(),
8
8
  client_read_only_metadata: fieldSchema.userClientReadOnlyMetadataSchema.optional(),
9
9
  server_metadata: fieldSchema.userServerMetadataSchema.optional(),
@@ -15,7 +15,7 @@ export declare const projectsCrudAdminReadSchema: import("yup").ObjectSchema<{
15
15
  client_id?: string | undefined;
16
16
  client_secret?: string | undefined;
17
17
  type: NonNullable<"shared" | "standard" | undefined>;
18
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | undefined>;
18
+ id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | undefined>;
19
19
  enabled: NonNullable<boolean | undefined>;
20
20
  }[];
21
21
  domains: {
@@ -72,7 +72,7 @@ export declare const projectsCrudClientReadSchema: import("yup").ObjectSchema<{
72
72
  credential_enabled: NonNullable<boolean | undefined>;
73
73
  magic_link_enabled: NonNullable<boolean | undefined>;
74
74
  oauth_providers: {
75
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | undefined>;
75
+ id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | undefined>;
76
76
  }[];
77
77
  };
78
78
  }, import("yup").AnyObject, {
@@ -96,7 +96,7 @@ export declare const projectsCrudAdminUpdateSchema: import("yup").ObjectSchema<{
96
96
  client_id?: string | undefined;
97
97
  client_secret?: string | undefined;
98
98
  type: NonNullable<"shared" | "standard" | undefined>;
99
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | undefined>;
99
+ id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | undefined>;
100
100
  enabled: NonNullable<boolean | undefined>;
101
101
  }[] | undefined;
102
102
  domains?: {
@@ -138,7 +138,7 @@ export declare const projectsCrudAdminCreateSchema: import("yup").ObjectSchema<{
138
138
  client_id?: string | undefined;
139
139
  client_secret?: string | undefined;
140
140
  type: NonNullable<"shared" | "standard" | undefined>;
141
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | undefined>;
141
+ id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | undefined>;
142
142
  enabled: NonNullable<boolean | undefined>;
143
143
  }[] | undefined;
144
144
  domains?: {
@@ -178,7 +178,7 @@ export declare const projectsCrud: import("../../crud").CrudSchemaFromOptions<{
178
178
  credential_enabled: NonNullable<boolean | undefined>;
179
179
  magic_link_enabled: NonNullable<boolean | undefined>;
180
180
  oauth_providers: {
181
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | undefined>;
181
+ id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | undefined>;
182
182
  }[];
183
183
  };
184
184
  }, import("yup").AnyObject, {
@@ -206,7 +206,7 @@ export declare const projectsCrud: import("../../crud").CrudSchemaFromOptions<{
206
206
  client_id?: string | undefined;
207
207
  client_secret?: string | undefined;
208
208
  type: NonNullable<"shared" | "standard" | undefined>;
209
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | undefined>;
209
+ id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | undefined>;
210
210
  enabled: NonNullable<boolean | undefined>;
211
211
  }[];
212
212
  domains: {
@@ -268,7 +268,7 @@ export declare const projectsCrud: import("../../crud").CrudSchemaFromOptions<{
268
268
  client_id?: string | undefined;
269
269
  client_secret?: string | undefined;
270
270
  type: NonNullable<"shared" | "standard" | undefined>;
271
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | undefined>;
271
+ id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | undefined>;
272
272
  enabled: NonNullable<boolean | undefined>;
273
273
  }[] | undefined;
274
274
  domains?: {
@@ -334,7 +334,7 @@ export declare const internalProjectsCrud: import("../../crud").CrudSchemaFromOp
334
334
  client_id?: string | undefined;
335
335
  client_secret?: string | undefined;
336
336
  type: NonNullable<"shared" | "standard" | undefined>;
337
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | undefined>;
337
+ id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | undefined>;
338
338
  enabled: NonNullable<boolean | undefined>;
339
339
  }[];
340
340
  domains: {
@@ -396,7 +396,7 @@ export declare const internalProjectsCrud: import("../../crud").CrudSchemaFromOp
396
396
  client_id?: string | undefined;
397
397
  client_secret?: string | undefined;
398
398
  type: NonNullable<"shared" | "standard" | undefined>;
399
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | undefined>;
399
+ id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | undefined>;
400
400
  enabled: NonNullable<boolean | undefined>;
401
401
  }[] | undefined;
402
402
  domains?: {
@@ -39,7 +39,7 @@ export declare const projectMagicLinkEnabledSchema: yup.BooleanSchema<boolean |
39
39
  export declare const projectClientTeamCreationEnabledSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
40
40
  export declare const projectSignUpEnabledSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
41
41
  export declare const projectCredentialEnabledSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
42
- export declare const oauthIdSchema: yup.StringSchema<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | undefined, yup.AnyObject, undefined, "">;
42
+ export declare const oauthIdSchema: yup.StringSchema<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | undefined, yup.AnyObject, undefined, "">;
43
43
  export declare const oauthEnabledSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
44
44
  export declare const oauthTypeSchema: yup.StringSchema<"shared" | "standard" | undefined, yup.AnyObject, undefined, "">;
45
45
  export declare const oauthClientIdSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
@@ -7,7 +7,7 @@ const _idDescription = (identify) => `The unique identifier of this ${identify}`
7
7
  const _displayNameDescription = (identify) => `Human-readable ${identify} display name. This is not a unique identifier.`;
8
8
  const _clientMetaDataDescription = (identify) => `Client metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client.`;
9
9
  const _clientReadOnlyMetaDataDescription = (identify) => `Client read-only, server-writable metadata. Used as a data store, accessible from the client side. Do not store information that should not be exposed to the client. The client can read this data, but cannot modify it. This is useful for things like subscription status.`;
10
- const _profileImageUrlDescription = (identify) => `URL of the profile image for ${identify}. Can be a Base64 encoded image. Please compress and crop to a square before passing in.`;
10
+ const _profileImageUrlDescription = (identify) => `URL of the profile image for ${identify}. Can be a Base64 encoded image. Must be smaller than 100KB. Please compress and crop to a square before passing in.`;
11
11
  const _serverMetaDataDescription = (identify) => `Server metadata. Used as a data store, only accessible from the server side. You can store secret information related to the ${identify} here.`;
12
12
  const _atMillisDescription = (identify) => `(the number of milliseconds since epoch, January 1, 1970, UTC)`;
13
13
  const _createdAtMillisDescription = (identify) => `The time the ${identify} was created ${_atMillisDescription(identify)}`;
@@ -93,7 +93,7 @@ export const urlSchema = yupString().test({
93
93
  name: 'url',
94
94
  message: 'Invalid URL',
95
95
  test: (value) => {
96
- if (value === undefined)
96
+ if (!value)
97
97
  return true;
98
98
  try {
99
99
  new URL(value);
@@ -192,7 +192,7 @@ export const primaryEmailSchema = emailSchema.meta({ openapiField: { description
192
192
  export const primaryEmailVerifiedSchema = yupBoolean().meta({ openapiField: { description: 'Whether the primary email has been verified to belong to this user', exampleValue: true } });
193
193
  export const userDisplayNameSchema = yupString().nullable().meta({ openapiField: { description: _displayNameDescription('user'), exampleValue: 'John Doe' } });
194
194
  export const selectedTeamIdSchema = yupString().uuid().meta({ openapiField: { description: 'ID of the team currently selected by the user', exampleValue: 'team-id' } });
195
- export const profileImageUrlSchema = yupString().meta({ openapiField: { description: _profileImageUrlDescription('user'), exampleValue: 'https://example.com/image.jpg' } });
195
+ export const profileImageUrlSchema = urlSchema.max(1000000).meta({ openapiField: { description: _profileImageUrlDescription('user'), exampleValue: 'https://example.com/image.jpg' } });
196
196
  export const signedUpAtMillisSchema = yupNumber().meta({ openapiField: { description: _signedUpAtMillisDescription, exampleValue: 1630000000000 } });
197
197
  export const userClientMetadataSchema = jsonSchema.meta({ openapiField: { description: _clientMetaDataDescription('user'), exampleValue: { key: 'value' } } });
198
198
  export const userClientReadOnlyMetadataSchema = jsonSchema.meta({ openapiField: { description: _clientReadOnlyMetaDataDescription('user'), exampleValue: { key: 'value' } } });
@@ -240,7 +240,7 @@ export const containedPermissionIdsSchema = yupArray(teamPermissionDefinitionIdS
240
240
  // Teams
241
241
  export const teamIdSchema = yupString().uuid().meta({ openapiField: { description: _idDescription('team'), exampleValue: 'ad962777-8244-496a-b6a2-e0c6a449c79e' } });
242
242
  export const teamDisplayNameSchema = yupString().meta({ openapiField: { description: _displayNameDescription('team'), exampleValue: 'My Team' } });
243
- export const teamProfileImageUrlSchema = yupString().meta({ openapiField: { description: _profileImageUrlDescription('team'), exampleValue: 'https://example.com/image.jpg' } });
243
+ export const teamProfileImageUrlSchema = urlSchema.max(1000000).meta({ openapiField: { description: _profileImageUrlDescription('team'), exampleValue: 'https://example.com/image.jpg' } });
244
244
  export const teamClientMetadataSchema = jsonSchema.meta({ openapiField: { description: _clientMetaDataDescription('team'), exampleValue: { key: 'value' } } });
245
245
  export const teamClientReadOnlyMetadataSchema = jsonSchema.meta({ openapiField: { description: _clientReadOnlyMetaDataDescription('team'), exampleValue: { key: 'value' } } });
246
246
  export const teamServerMetadataSchema = jsonSchema.meta({ openapiField: { description: _serverMetaDataDescription('team'), exampleValue: { key: 'value' } } });
@@ -249,7 +249,7 @@ export const teamInvitationEmailSchema = emailSchema.meta({ openapiField: { desc
249
249
  export const teamInvitationCallbackUrlSchema = urlSchema.meta({ openapiField: { description: 'The base callback URL to construct a verification link for the verification e-mail. A query argument `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' } });
250
250
  // Team member profiles
251
251
  export const teamMemberDisplayNameSchema = yupString().meta({ openapiField: { description: _displayNameDescription('team member') + ' Note that this is separate from the display_name of the user.', exampleValue: 'John Doe' } });
252
- export const teamMemberProfileImageUrlSchema = yupString().meta({ openapiField: { description: _profileImageUrlDescription('team member'), exampleValue: 'https://example.com/image.jpg' } });
252
+ export const teamMemberProfileImageUrlSchema = urlSchema.max(1000000).meta({ openapiField: { description: _profileImageUrlDescription('team member'), exampleValue: 'https://example.com/image.jpg' } });
253
253
  // Utils
254
254
  export function yupRequiredWhen(schema, triggerName, isValue) {
255
255
  return schema.when(triggerName, {
@@ -0,0 +1,2 @@
1
+ export declare function fileToBase64(file: File): Promise<string>;
2
+ export declare function validateBase64Image(base64: string): boolean;
@@ -0,0 +1,12 @@
1
+ export function fileToBase64(file) {
2
+ return new Promise((resolve, reject) => {
3
+ const reader = new FileReader();
4
+ reader.readAsDataURL(file);
5
+ reader.onload = () => resolve(reader.result);
6
+ reader.onerror = error => reject(error);
7
+ });
8
+ }
9
+ export function validateBase64Image(base64) {
10
+ const base64ImageRegex = /^data:image\/(png|jpg|jpeg|gif|bmp|webp);base64,[A-Za-z0-9+/]+={0,2}$|^[A-Za-z0-9+/]+={0,2}$/;
11
+ return base64ImageRegex.test(base64);
12
+ }
@@ -1,6 +1,6 @@
1
- export declare const standardProviders: readonly ["google", "github", "facebook", "microsoft", "spotify", "discord"];
1
+ export declare const standardProviders: readonly ["google", "github", "facebook", "microsoft", "spotify", "discord", "gitlab"];
2
2
  export declare const sharedProviders: readonly ["google", "github", "facebook", "microsoft", "spotify"];
3
- export declare const allProviders: readonly ["google", "github", "facebook", "microsoft", "spotify", "discord"];
3
+ export declare const allProviders: readonly ["google", "github", "facebook", "microsoft", "spotify", "discord", "gitlab"];
4
4
  export type ProviderType = typeof allProviders[number];
5
5
  export type StandardProviderType = typeof standardProviders[number];
6
6
  export type SharedProviderType = typeof sharedProviders[number];
@@ -1,4 +1,4 @@
1
- export const standardProviders = ["google", "github", "facebook", "microsoft", "spotify", "discord"];
1
+ export const standardProviders = ["google", "github", "facebook", "microsoft", "spotify", "discord", "gitlab"];
2
2
  // No more shared providers should be added except for special cases
3
3
  export const sharedProviders = ["google", "github", "facebook", "microsoft", "spotify"];
4
- export const allProviders = ["google", "github", "facebook", "microsoft", "spotify", "discord"];
4
+ export const allProviders = ["google", "github", "facebook", "microsoft", "spotify", "discord", "gitlab"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackframe/stack-shared",
3
- "version": "2.5.24",
3
+ "version": "2.5.27",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [
@@ -36,7 +36,7 @@
36
36
  "jose": "^5.2.2",
37
37
  "oauth4webapi": "^2.10.3",
38
38
  "uuid": "^9.0.1",
39
- "@stackframe/stack-sc": "2.5.24"
39
+ "@stackframe/stack-sc": "2.5.27"
40
40
  },
41
41
  "devDependencies": {
42
42
  "rimraf": "^5.0.5",