@stackframe/stack-shared 2.5.33 → 2.5.37

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/interface/clientInterface.d.ts +1 -0
  3. package/dist/interface/clientInterface.js +5 -0
  4. package/dist/interface/crud/current-user.d.ts +5 -5
  5. package/dist/interface/crud/current-user.js +2 -2
  6. package/dist/interface/crud/projects.d.ts +26 -12
  7. package/dist/interface/crud/projects.js +3 -0
  8. package/dist/interface/crud/team-member-profiles.d.ts +4 -4
  9. package/dist/interface/crud/users.d.ts +16 -14
  10. package/dist/interface/crud/users.js +4 -1
  11. package/dist/interface/webhooks.d.ts +8 -4
  12. package/dist/schema-fields.d.ts +3 -2
  13. package/dist/schema-fields.js +1 -0
  14. package/dist/utils/oauth.d.ts +3 -3
  15. package/dist/utils/oauth.js +3 -3
  16. package/dist/utils/promises.d.ts +7 -0
  17. package/dist/utils/promises.js +10 -0
  18. package/package.json +2 -2
  19. package/dist/interface/crud-deprecated/api-keys.d.ts +0 -134
  20. package/dist/interface/crud-deprecated/api-keys.js +0 -61
  21. package/dist/interface/crud-deprecated/current-user.d.ts +0 -127
  22. package/dist/interface/crud-deprecated/current-user.js +0 -49
  23. package/dist/interface/crud-deprecated/email-templates.d.ts +0 -75
  24. package/dist/interface/crud-deprecated/email-templates.js +0 -41
  25. package/dist/interface/crud-deprecated/oauth.d.ts +0 -24
  26. package/dist/interface/crud-deprecated/oauth.js +0 -12
  27. package/dist/interface/crud-deprecated/projects.d.ts +0 -440
  28. package/dist/interface/crud-deprecated/projects.js +0 -109
  29. package/dist/interface/crud-deprecated/team-memberships.d.ts +0 -22
  30. package/dist/interface/crud-deprecated/team-memberships.js +0 -22
  31. package/dist/interface/crud-deprecated/team-permissions.d.ts +0 -129
  32. package/dist/interface/crud-deprecated/team-permissions.js +0 -83
  33. package/dist/interface/crud-deprecated/teams.d.ts +0 -126
  34. package/dist/interface/crud-deprecated/teams.js +0 -78
  35. package/dist/interface/crud-deprecated/users.d.ts +0 -201
  36. package/dist/interface/crud-deprecated/users.js +0 -75
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @stackframe/stack-shared
2
2
 
3
+ ## 2.5.37
4
+
5
+ ### Patch Changes
6
+
7
+ - client side account deletion; new account setting style;
8
+ - @stackframe/stack-sc@2.5.37
9
+
10
+ ## 2.5.36
11
+
12
+ ### Patch Changes
13
+
14
+ - added apple oauth
15
+ - Updated dependencies
16
+ - @stackframe/stack-sc@2.5.36
17
+
18
+ ## 2.5.35
19
+
20
+ ### Patch Changes
21
+
22
+ - Doc improvements
23
+ - @stackframe/stack-sc@2.5.35
24
+
25
+ ## 2.5.34
26
+
27
+ ### Patch Changes
28
+
29
+ - Internationalization
30
+ - @stackframe/stack-sc@2.5.34
31
+
3
32
  ## 2.5.33
4
33
 
5
34
  ### Patch Changes
@@ -155,4 +155,5 @@ export declare class StackClientInterface {
155
155
  createProject(project: InternalProjectsCrud['Client']['Create'], session: InternalSession): Promise<InternalProjectsCrud['Client']['Read']>;
156
156
  createProviderAccessToken(provider: string, scope: string, session: InternalSession): Promise<ConnectedAccountAccessTokenCrud['Client']['Read']>;
157
157
  createTeamForCurrentUser(data: TeamsCrud['Client']['Create'], session: InternalSession): Promise<TeamsCrud['Client']['Read']>;
158
+ deleteCurrentUser(session: InternalSession): Promise<void>;
158
159
  }
@@ -728,4 +728,9 @@ export class StackClientInterface {
728
728
  }, session);
729
729
  return await response.json();
730
730
  }
731
+ async deleteCurrentUser(session) {
732
+ await this.sendClientRequest("/users/me", {
733
+ method: "DELETE",
734
+ }, session);
735
+ }
731
736
  }
@@ -30,7 +30,7 @@ export declare const currentUserCrud: import("../../crud").CrudSchemaFromOptions
30
30
  } | {
31
31
  type: "oauth";
32
32
  provider: {
33
- type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
33
+ type: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
34
34
  id: string;
35
35
  provider_user_id: string;
36
36
  };
@@ -38,7 +38,7 @@ export declare const currentUserCrud: import("../../crud").CrudSchemaFromOptions
38
38
  connected_accounts: {
39
39
  type: "oauth";
40
40
  provider: {
41
- type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
41
+ type: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
42
42
  id: string;
43
43
  provider_user_id: string;
44
44
  };
@@ -114,7 +114,7 @@ export declare const currentUserCrud: import("../../crud").CrudSchemaFromOptions
114
114
  } | {
115
115
  type: "oauth";
116
116
  provider: {
117
- type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
117
+ type: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
118
118
  id: string;
119
119
  provider_user_id: string;
120
120
  };
@@ -122,7 +122,7 @@ export declare const currentUserCrud: import("../../crud").CrudSchemaFromOptions
122
122
  connected_accounts: {
123
123
  type: "oauth";
124
124
  provider: {
125
- type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
125
+ type: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
126
126
  id: string;
127
127
  provider_user_id: string;
128
128
  };
@@ -203,7 +203,7 @@ export declare const currentUserCrud: import("../../crud").CrudSchemaFromOptions
203
203
  totp_secret_base64: undefined;
204
204
  selected_team_id: undefined;
205
205
  }, "">;
206
- serverDeleteSchema: import("yup").MixedSchema<{} | undefined, import("yup").AnyObject, undefined, "">;
206
+ clientDeleteSchema: import("yup").MixedSchema<{} | undefined, import("yup").AnyObject, undefined, "">;
207
207
  docs: {
208
208
  clientRead: {
209
209
  summary: string;
@@ -31,13 +31,13 @@ const clientReadSchema = usersCrudServerReadSchema.pick([
31
31
  })).nullable().defined(); // TODO: next-release: make required
32
32
  // TODO: next-release: make required
33
33
  const serverReadSchema = usersCrudServerReadSchema.nullable().defined();
34
- const serverDeleteSchema = usersCrudServerDeleteSchema;
34
+ const clientDeleteSchema = usersCrudServerDeleteSchema;
35
35
  export const currentUserCrud = createCrud({
36
36
  clientReadSchema,
37
37
  serverReadSchema,
38
38
  clientUpdateSchema,
39
39
  serverUpdateSchema,
40
- serverDeleteSchema,
40
+ clientDeleteSchema,
41
41
  docs: {
42
42
  clientRead: {
43
43
  summary: 'Get current user',
@@ -13,17 +13,18 @@ export declare const projectsCrudAdminReadSchema: import("yup").ObjectSchema<{
13
13
  credential_enabled: NonNullable<boolean | undefined>;
14
14
  magic_link_enabled: NonNullable<boolean | undefined>;
15
15
  client_team_creation_enabled: NonNullable<boolean | undefined>;
16
+ client_user_deletion_enabled: NonNullable<boolean | undefined>;
16
17
  oauth_providers: {
17
18
  client_id?: string | undefined;
18
19
  client_secret?: string | undefined;
19
20
  facebook_config_id?: string | undefined;
20
21
  microsoft_tenant_id?: string | undefined;
21
22
  type: NonNullable<"shared" | "standard" | undefined>;
22
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
23
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
23
24
  enabled: NonNullable<boolean | undefined>;
24
25
  }[];
25
26
  enabled_oauth_providers: {
26
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
27
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
27
28
  }[];
28
29
  domains: {
29
30
  domain: string;
@@ -60,6 +61,7 @@ export declare const projectsCrudAdminReadSchema: import("yup").ObjectSchema<{
60
61
  credential_enabled: undefined;
61
62
  magic_link_enabled: undefined;
62
63
  client_team_creation_enabled: undefined;
64
+ client_user_deletion_enabled: undefined;
63
65
  oauth_providers: undefined;
64
66
  enabled_oauth_providers: undefined;
65
67
  domains: undefined;
@@ -85,8 +87,9 @@ export declare const projectsCrudClientReadSchema: import("yup").ObjectSchema<{
85
87
  credential_enabled: NonNullable<boolean | undefined>;
86
88
  magic_link_enabled: NonNullable<boolean | undefined>;
87
89
  client_team_creation_enabled: NonNullable<boolean | undefined>;
90
+ client_user_deletion_enabled: NonNullable<boolean | undefined>;
88
91
  enabled_oauth_providers: {
89
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
92
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
90
93
  }[];
91
94
  };
92
95
  }, import("yup").AnyObject, {
@@ -97,6 +100,7 @@ export declare const projectsCrudClientReadSchema: import("yup").ObjectSchema<{
97
100
  credential_enabled: undefined;
98
101
  magic_link_enabled: undefined;
99
102
  client_team_creation_enabled: undefined;
103
+ client_user_deletion_enabled: undefined;
100
104
  enabled_oauth_providers: undefined;
101
105
  };
102
106
  }, "">;
@@ -110,13 +114,14 @@ export declare const projectsCrudAdminUpdateSchema: import("yup").ObjectSchema<{
110
114
  credential_enabled?: boolean | undefined;
111
115
  magic_link_enabled?: boolean | undefined;
112
116
  client_team_creation_enabled?: boolean | undefined;
117
+ client_user_deletion_enabled?: boolean | undefined;
113
118
  oauth_providers?: {
114
119
  client_id?: string | undefined;
115
120
  client_secret?: string | undefined;
116
121
  facebook_config_id?: string | undefined;
117
122
  microsoft_tenant_id?: string | undefined;
118
123
  type: NonNullable<"shared" | "standard" | undefined>;
119
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
124
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
120
125
  enabled: NonNullable<boolean | undefined>;
121
126
  }[] | undefined;
122
127
  domains?: {
@@ -156,13 +161,14 @@ export declare const projectsCrudAdminCreateSchema: import("yup").ObjectSchema<{
156
161
  credential_enabled?: boolean | undefined;
157
162
  magic_link_enabled?: boolean | undefined;
158
163
  client_team_creation_enabled?: boolean | undefined;
164
+ client_user_deletion_enabled?: boolean | undefined;
159
165
  oauth_providers?: {
160
166
  client_id?: string | undefined;
161
167
  client_secret?: string | undefined;
162
168
  facebook_config_id?: string | undefined;
163
169
  microsoft_tenant_id?: string | undefined;
164
170
  type: NonNullable<"shared" | "standard" | undefined>;
165
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
171
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
166
172
  enabled: NonNullable<boolean | undefined>;
167
173
  }[] | undefined;
168
174
  domains?: {
@@ -204,8 +210,9 @@ export declare const projectsCrud: import("../../crud").CrudSchemaFromOptions<{
204
210
  credential_enabled: NonNullable<boolean | undefined>;
205
211
  magic_link_enabled: NonNullable<boolean | undefined>;
206
212
  client_team_creation_enabled: NonNullable<boolean | undefined>;
213
+ client_user_deletion_enabled: NonNullable<boolean | undefined>;
207
214
  enabled_oauth_providers: {
208
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
215
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
209
216
  }[];
210
217
  };
211
218
  }, import("yup").AnyObject, {
@@ -216,6 +223,7 @@ export declare const projectsCrud: import("../../crud").CrudSchemaFromOptions<{
216
223
  credential_enabled: undefined;
217
224
  magic_link_enabled: undefined;
218
225
  client_team_creation_enabled: undefined;
226
+ client_user_deletion_enabled: undefined;
219
227
  enabled_oauth_providers: undefined;
220
228
  };
221
229
  }, "">;
@@ -233,17 +241,18 @@ export declare const projectsCrud: import("../../crud").CrudSchemaFromOptions<{
233
241
  credential_enabled: NonNullable<boolean | undefined>;
234
242
  magic_link_enabled: NonNullable<boolean | undefined>;
235
243
  client_team_creation_enabled: NonNullable<boolean | undefined>;
244
+ client_user_deletion_enabled: NonNullable<boolean | undefined>;
236
245
  oauth_providers: {
237
246
  client_id?: string | undefined;
238
247
  client_secret?: string | undefined;
239
248
  facebook_config_id?: string | undefined;
240
249
  microsoft_tenant_id?: string | undefined;
241
250
  type: NonNullable<"shared" | "standard" | undefined>;
242
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
251
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
243
252
  enabled: NonNullable<boolean | undefined>;
244
253
  }[];
245
254
  enabled_oauth_providers: {
246
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
255
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
247
256
  }[];
248
257
  domains: {
249
258
  domain: string;
@@ -280,6 +289,7 @@ export declare const projectsCrud: import("../../crud").CrudSchemaFromOptions<{
280
289
  credential_enabled: undefined;
281
290
  magic_link_enabled: undefined;
282
291
  client_team_creation_enabled: undefined;
292
+ client_user_deletion_enabled: undefined;
283
293
  oauth_providers: undefined;
284
294
  enabled_oauth_providers: undefined;
285
295
  domains: undefined;
@@ -307,13 +317,14 @@ export declare const projectsCrud: import("../../crud").CrudSchemaFromOptions<{
307
317
  credential_enabled?: boolean | undefined;
308
318
  magic_link_enabled?: boolean | undefined;
309
319
  client_team_creation_enabled?: boolean | undefined;
320
+ client_user_deletion_enabled?: boolean | undefined;
310
321
  oauth_providers?: {
311
322
  client_id?: string | undefined;
312
323
  client_secret?: string | undefined;
313
324
  facebook_config_id?: string | undefined;
314
325
  microsoft_tenant_id?: string | undefined;
315
326
  type: NonNullable<"shared" | "standard" | undefined>;
316
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
327
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
317
328
  enabled: NonNullable<boolean | undefined>;
318
329
  }[] | undefined;
319
330
  domains?: {
@@ -383,17 +394,18 @@ export declare const internalProjectsCrud: import("../../crud").CrudSchemaFromOp
383
394
  credential_enabled: NonNullable<boolean | undefined>;
384
395
  magic_link_enabled: NonNullable<boolean | undefined>;
385
396
  client_team_creation_enabled: NonNullable<boolean | undefined>;
397
+ client_user_deletion_enabled: NonNullable<boolean | undefined>;
386
398
  oauth_providers: {
387
399
  client_id?: string | undefined;
388
400
  client_secret?: string | undefined;
389
401
  facebook_config_id?: string | undefined;
390
402
  microsoft_tenant_id?: string | undefined;
391
403
  type: NonNullable<"shared" | "standard" | undefined>;
392
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
404
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
393
405
  enabled: NonNullable<boolean | undefined>;
394
406
  }[];
395
407
  enabled_oauth_providers: {
396
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
408
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
397
409
  }[];
398
410
  domains: {
399
411
  domain: string;
@@ -430,6 +442,7 @@ export declare const internalProjectsCrud: import("../../crud").CrudSchemaFromOp
430
442
  credential_enabled: undefined;
431
443
  magic_link_enabled: undefined;
432
444
  client_team_creation_enabled: undefined;
445
+ client_user_deletion_enabled: undefined;
433
446
  oauth_providers: undefined;
434
447
  enabled_oauth_providers: undefined;
435
448
  domains: undefined;
@@ -457,13 +470,14 @@ export declare const internalProjectsCrud: import("../../crud").CrudSchemaFromOp
457
470
  credential_enabled?: boolean | undefined;
458
471
  magic_link_enabled?: boolean | undefined;
459
472
  client_team_creation_enabled?: boolean | undefined;
473
+ client_user_deletion_enabled?: boolean | undefined;
460
474
  oauth_providers?: {
461
475
  client_id?: string | undefined;
462
476
  client_secret?: string | undefined;
463
477
  facebook_config_id?: string | undefined;
464
478
  microsoft_tenant_id?: string | undefined;
465
479
  type: NonNullable<"shared" | "standard" | undefined>;
466
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
480
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
467
481
  enabled: NonNullable<boolean | undefined>;
468
482
  }[] | undefined;
469
483
  domains?: {
@@ -44,6 +44,7 @@ export const projectsCrudAdminReadSchema = yupObject({
44
44
  credential_enabled: schemaFields.projectCredentialEnabledSchema.required(),
45
45
  magic_link_enabled: schemaFields.projectMagicLinkEnabledSchema.required(),
46
46
  client_team_creation_enabled: schemaFields.projectClientTeamCreationEnabledSchema.required(),
47
+ client_user_deletion_enabled: schemaFields.projectClientUserDeletionEnabledSchema.required(),
47
48
  oauth_providers: yupArray(oauthProviderSchema.required()).required(),
48
49
  enabled_oauth_providers: yupArray(enabledOAuthProviderSchema.required()).required(),
49
50
  domains: yupArray(domainSchema.required()).required(),
@@ -61,6 +62,7 @@ export const projectsCrudClientReadSchema = yupObject({
61
62
  credential_enabled: schemaFields.projectCredentialEnabledSchema.required(),
62
63
  magic_link_enabled: schemaFields.projectMagicLinkEnabledSchema.required(),
63
64
  client_team_creation_enabled: schemaFields.projectClientTeamCreationEnabledSchema.required(),
65
+ client_user_deletion_enabled: schemaFields.projectClientUserDeletionEnabledSchema.required(),
64
66
  enabled_oauth_providers: yupArray(enabledOAuthProviderSchema.required()).required(),
65
67
  }).required(),
66
68
  }).required();
@@ -73,6 +75,7 @@ export const projectsCrudAdminUpdateSchema = yupObject({
73
75
  credential_enabled: schemaFields.projectCredentialEnabledSchema.optional(),
74
76
  magic_link_enabled: schemaFields.projectMagicLinkEnabledSchema.optional(),
75
77
  client_team_creation_enabled: schemaFields.projectClientTeamCreationEnabledSchema.optional(),
78
+ client_user_deletion_enabled: schemaFields.projectClientUserDeletionEnabledSchema.optional(),
76
79
  allow_localhost: schemaFields.projectAllowLocalhostSchema.optional(),
77
80
  email_config: emailConfigSchema.optional().default(undefined),
78
81
  domains: yupArray(domainSchema.required()).optional().default(undefined),
@@ -56,7 +56,7 @@ export declare const teamMemberProfilesCrudServerReadSchema: import("yup").Objec
56
56
  } | {
57
57
  type: "oauth";
58
58
  provider: {
59
- type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
59
+ type: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
60
60
  id: string;
61
61
  provider_user_id: string;
62
62
  };
@@ -64,7 +64,7 @@ export declare const teamMemberProfilesCrudServerReadSchema: import("yup").Objec
64
64
  connected_accounts: {
65
65
  type: "oauth";
66
66
  provider: {
67
- type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
67
+ type: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
68
68
  id: string;
69
69
  provider_user_id: string;
70
70
  };
@@ -170,7 +170,7 @@ export declare const teamMemberProfilesCrud: import("../../crud").CrudSchemaFrom
170
170
  } | {
171
171
  type: "oauth";
172
172
  provider: {
173
- type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
173
+ type: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
174
174
  id: string;
175
175
  provider_user_id: string;
176
176
  };
@@ -178,7 +178,7 @@ export declare const teamMemberProfilesCrud: import("../../crud").CrudSchemaFrom
178
178
  connected_accounts: {
179
179
  type: "oauth";
180
180
  provider: {
181
- type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
181
+ type: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
182
182
  id: string;
183
183
  provider_user_id: string;
184
184
  };
@@ -61,7 +61,7 @@ export declare const usersCrudServerReadSchema: import("yup").ObjectSchema<{
61
61
  } | {
62
62
  type: "oauth";
63
63
  provider: {
64
- type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
64
+ type: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
65
65
  id: string;
66
66
  provider_user_id: string;
67
67
  };
@@ -69,7 +69,7 @@ export declare const usersCrudServerReadSchema: import("yup").ObjectSchema<{
69
69
  connected_accounts: {
70
70
  type: "oauth";
71
71
  provider: {
72
- type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
72
+ type: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
73
73
  id: string;
74
74
  provider_user_id: string;
75
75
  };
@@ -107,17 +107,16 @@ export declare const usersCrudServerReadSchema: import("yup").ObjectSchema<{
107
107
  last_active_at_millis: undefined;
108
108
  }, "">;
109
109
  export declare const usersCrudServerCreateSchema: import("yup").ObjectSchema<{
110
+ password: string | null | undefined;
110
111
  display_name: string | null | undefined;
112
+ primary_email: string | null | undefined;
111
113
  profile_image_url: string | null | undefined;
112
114
  client_metadata: {} | null | undefined;
113
115
  client_read_only_metadata: {} | null | undefined;
114
116
  server_metadata: {} | null | undefined;
115
- primary_email: string | null | undefined;
116
117
  primary_email_verified: boolean | undefined;
117
118
  primary_email_auth_enabled: boolean | undefined;
118
- password: string | null | undefined;
119
119
  totp_secret_base64: string | null | undefined;
120
- selected_team_id: string | null | undefined;
121
120
  } & {
122
121
  oauth_providers: {
123
122
  id: string;
@@ -177,7 +176,7 @@ export declare const usersCrud: import("../../crud").CrudSchemaFromOptions<{
177
176
  } | {
178
177
  type: "oauth";
179
178
  provider: {
180
- type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
179
+ type: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
181
180
  id: string;
182
181
  provider_user_id: string;
183
182
  };
@@ -185,7 +184,7 @@ export declare const usersCrud: import("../../crud").CrudSchemaFromOptions<{
185
184
  connected_accounts: {
186
185
  type: "oauth";
187
186
  provider: {
188
- type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
187
+ type: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
189
188
  id: string;
190
189
  provider_user_id: string;
191
190
  };
@@ -248,17 +247,16 @@ export declare const usersCrud: import("../../crud").CrudSchemaFromOptions<{
248
247
  selected_team_id: undefined;
249
248
  }, "">;
250
249
  serverCreateSchema: import("yup").ObjectSchema<{
250
+ password: string | null | undefined;
251
251
  display_name: string | null | undefined;
252
+ primary_email: string | null | undefined;
252
253
  profile_image_url: string | null | undefined;
253
254
  client_metadata: {} | null | undefined;
254
255
  client_read_only_metadata: {} | null | undefined;
255
256
  server_metadata: {} | null | undefined;
256
- primary_email: string | null | undefined;
257
257
  primary_email_verified: boolean | undefined;
258
258
  primary_email_auth_enabled: boolean | undefined;
259
- password: string | null | undefined;
260
259
  totp_secret_base64: string | null | undefined;
261
- selected_team_id: string | null | undefined;
262
260
  } & {
263
261
  oauth_providers: {
264
262
  id: string;
@@ -348,7 +346,7 @@ export declare const userCreatedWebhookEvent: {
348
346
  } | {
349
347
  type: "oauth";
350
348
  provider: {
351
- type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
349
+ type: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
352
350
  id: string;
353
351
  provider_user_id: string;
354
352
  };
@@ -356,7 +354,7 @@ export declare const userCreatedWebhookEvent: {
356
354
  connected_accounts: {
357
355
  type: "oauth";
358
356
  provider: {
359
- type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
357
+ type: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
360
358
  id: string;
361
359
  provider_user_id: string;
362
360
  };
@@ -438,7 +436,7 @@ export declare const userUpdatedWebhookEvent: {
438
436
  } | {
439
437
  type: "oauth";
440
438
  provider: {
441
- type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
439
+ type: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
442
440
  id: string;
443
441
  provider_user_id: string;
444
442
  };
@@ -446,7 +444,7 @@ export declare const userUpdatedWebhookEvent: {
446
444
  connected_accounts: {
447
445
  type: "oauth";
448
446
  provider: {
449
- type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
447
+ type: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
450
448
  id: string;
451
449
  provider_user_id: string;
452
450
  };
@@ -493,8 +491,12 @@ export declare const userDeletedWebhookEvent: {
493
491
  type: string;
494
492
  schema: import("yup").ObjectSchema<{
495
493
  id: string;
494
+ teams: {
495
+ id: string;
496
+ }[];
496
497
  }, import("yup").AnyObject, {
497
498
  id: undefined;
499
+ teams: undefined;
498
500
  }, "">;
499
501
  metadata: {
500
502
  summary: string;
@@ -62,7 +62,7 @@ export const usersCrudServerReadSchema = fieldSchema.yupObject({
62
62
  server_metadata: fieldSchema.userServerMetadataSchema,
63
63
  last_active_at_millis: fieldSchema.userLastActiveAtMillisSchema.required(),
64
64
  }).required();
65
- export const usersCrudServerCreateSchema = usersCrudServerUpdateSchema.concat(fieldSchema.yupObject({
65
+ export const usersCrudServerCreateSchema = usersCrudServerUpdateSchema.omit(['selected_team_id']).concat(fieldSchema.yupObject({
66
66
  oauth_providers: fieldSchema.yupArray(fieldSchema.yupObject({
67
67
  id: fieldSchema.yupString().required(),
68
68
  account_id: fieldSchema.yupString().required(),
@@ -123,6 +123,9 @@ export const userUpdatedWebhookEvent = {
123
123
  };
124
124
  const webhookUserDeletedSchema = fieldSchema.yupObject({
125
125
  id: fieldSchema.userIdSchema.required(),
126
+ teams: fieldSchema.yupArray(fieldSchema.yupObject({
127
+ id: fieldSchema.yupString().required(),
128
+ })).required(),
126
129
  }).required();
127
130
  export const userDeletedWebhookEvent = {
128
131
  type: "user.deleted",
@@ -47,7 +47,7 @@ export declare const webhookEvents: readonly [{
47
47
  } | {
48
48
  type: "oauth";
49
49
  provider: {
50
- type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
50
+ type: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
51
51
  id: string;
52
52
  provider_user_id: string;
53
53
  };
@@ -55,7 +55,7 @@ export declare const webhookEvents: readonly [{
55
55
  connected_accounts: {
56
56
  type: "oauth";
57
57
  provider: {
58
- type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
58
+ type: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
59
59
  id: string;
60
60
  provider_user_id: string;
61
61
  };
@@ -136,7 +136,7 @@ export declare const webhookEvents: readonly [{
136
136
  } | {
137
137
  type: "oauth";
138
138
  provider: {
139
- type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
139
+ type: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
140
140
  id: string;
141
141
  provider_user_id: string;
142
142
  };
@@ -144,7 +144,7 @@ export declare const webhookEvents: readonly [{
144
144
  connected_accounts: {
145
145
  type: "oauth";
146
146
  provider: {
147
- type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
147
+ type: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
148
148
  id: string;
149
149
  provider_user_id: string;
150
150
  };
@@ -190,8 +190,12 @@ export declare const webhookEvents: readonly [{
190
190
  type: string;
191
191
  schema: yup.ObjectSchema<{
192
192
  id: string;
193
+ teams: {
194
+ id: string;
195
+ }[];
193
196
  }, yup.AnyObject, {
194
197
  id: undefined;
198
+ teams: undefined;
195
199
  }, "">;
196
200
  metadata: {
197
201
  summary: string;
@@ -37,9 +37,10 @@ export declare const projectAllowLocalhostSchema: yup.BooleanSchema<boolean | un
37
37
  export declare const projectCreateTeamOnSignUpSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
38
38
  export declare const projectMagicLinkEnabledSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
39
39
  export declare const projectClientTeamCreationEnabledSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
40
+ export declare const projectClientUserDeletionEnabledSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
40
41
  export declare const projectSignUpEnabledSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
41
42
  export declare const projectCredentialEnabledSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
42
- export declare const oauthIdSchema: yup.StringSchema<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined, yup.AnyObject, undefined, "">;
43
+ export declare const oauthIdSchema: yup.StringSchema<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined, yup.AnyObject, undefined, "">;
43
44
  export declare const oauthEnabledSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
44
45
  export declare const oauthTypeSchema: yup.StringSchema<"shared" | "standard" | undefined, yup.AnyObject, undefined, "">;
45
46
  export declare const oauthClientIdSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
@@ -70,7 +71,7 @@ export declare const userClientReadOnlyMetadataSchema: yup.MixedSchema<{} | null
70
71
  export declare const userServerMetadataSchema: yup.MixedSchema<{} | null, yup.AnyObject, undefined, "">;
71
72
  export declare const userOAuthProviderSchema: yup.ObjectSchema<{
72
73
  id: string;
73
- type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
74
+ type: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | undefined>;
74
75
  provider_user_id: string;
75
76
  }, yup.AnyObject, {
76
77
  id: undefined;
@@ -151,6 +151,7 @@ export const projectAllowLocalhostSchema = yupBoolean().meta({ openapiField: { d
151
151
  export const projectCreateTeamOnSignUpSchema = yupBoolean().meta({ openapiField: { description: 'Whether a team should be created for each user that signs up', exampleValue: true } });
152
152
  export const projectMagicLinkEnabledSchema = yupBoolean().meta({ openapiField: { description: 'Whether magic link authentication is enabled for this project', exampleValue: true } });
153
153
  export const projectClientTeamCreationEnabledSchema = yupBoolean().meta({ openapiField: { description: 'Whether client users can create teams', exampleValue: true } });
154
+ export const projectClientUserDeletionEnabledSchema = yupBoolean().meta({ openapiField: { description: 'Whether client users can delete their own account from the client', exampleValue: true } });
154
155
  export const projectSignUpEnabledSchema = yupBoolean().meta({ openapiField: { description: 'Whether users can sign up new accounts, or whether they are only allowed to sign in to existing accounts. Regardless of this option, the server API can always create new users with the `POST /users` endpoint.', exampleValue: true } });
155
156
  export const projectCredentialEnabledSchema = yupBoolean().meta({ openapiField: { description: 'Whether email password authentication is enabled for this project', exampleValue: true } });
156
157
  // Project OAuth config
@@ -1,6 +1,6 @@
1
- export declare const standardProviders: readonly ["google", "github", "facebook", "microsoft", "spotify", "discord", "gitlab", "bitbucket"];
2
- export declare const sharedProviders: readonly ["google", "github", "facebook", "microsoft", "spotify"];
3
- export declare const allProviders: readonly ["google", "github", "facebook", "microsoft", "spotify", "discord", "gitlab", "bitbucket"];
1
+ export declare const standardProviders: readonly ["google", "github", "microsoft", "spotify", "facebook", "discord", "gitlab", "bitbucket", "linkedin", "apple"];
2
+ export declare const sharedProviders: readonly ["google", "github", "microsoft", "spotify"];
3
+ export declare const allProviders: readonly ["google", "github", "microsoft", "spotify", "facebook", "discord", "gitlab", "bitbucket", "linkedin", "apple"];
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", "gitlab", "bitbucket"];
1
+ export const standardProviders = ["google", "github", "microsoft", "spotify", "facebook", "discord", "gitlab", "bitbucket", "linkedin", "apple"];
2
2
  // No more shared providers should be added except for special cases
3
- export const sharedProviders = ["google", "github", "facebook", "microsoft", "spotify"];
4
- export const allProviders = ["google", "github", "facebook", "microsoft", "spotify", "discord", "gitlab", "bitbucket"];
3
+ export const sharedProviders = ["google", "github", "microsoft", "spotify"];
4
+ export const allProviders = standardProviders;
@@ -25,6 +25,13 @@ export declare function neverResolve(): ReactPromise<never>;
25
25
  export declare function pending<T>(promise: Promise<T>, options?: {
26
26
  disableErrorWrapping?: boolean;
27
27
  }): ReactPromise<T>;
28
+ /**
29
+ * Should be used to wrap Promises that are not immediately awaited, so they don't throw an unhandled promise rejection
30
+ * error.
31
+ *
32
+ * Vercel kills serverless functions on unhandled promise rejection errors, so this is important.
33
+ */
34
+ export declare function ignoreUnhandledRejection<T extends Promise<any>>(promise: T): T;
28
35
  export declare function wait(ms: number): Promise<void>;
29
36
  export declare function waitUntil(date: Date): Promise<void>;
30
37
  export declare function runAsynchronouslyWithAlert(...args: Parameters<typeof runAsynchronously>): void;