@stackframe/stack-shared 2.5.32 → 2.5.35

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,26 @@
1
1
  # @stackframe/stack-shared
2
2
 
3
+ ## 2.5.35
4
+
5
+ ### Patch Changes
6
+
7
+ - Doc improvements
8
+ - @stackframe/stack-sc@2.5.35
9
+
10
+ ## 2.5.34
11
+
12
+ ### Patch Changes
13
+
14
+ - Internationalization
15
+ - @stackframe/stack-sc@2.5.34
16
+
17
+ ## 2.5.33
18
+
19
+ ### Patch Changes
20
+
21
+ - Team membership webhooks
22
+ - @stackframe/stack-sc@2.5.33
23
+
3
24
  ## 2.5.32
4
25
 
5
26
  ### Patch Changes
@@ -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" | 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" | 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" | 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" | undefined>;
126
126
  id: string;
127
127
  provider_user_id: string;
128
128
  };
@@ -19,11 +19,11 @@ export declare const projectsCrudAdminReadSchema: import("yup").ObjectSchema<{
19
19
  facebook_config_id?: string | undefined;
20
20
  microsoft_tenant_id?: string | undefined;
21
21
  type: NonNullable<"shared" | "standard" | undefined>;
22
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
22
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | undefined>;
23
23
  enabled: NonNullable<boolean | undefined>;
24
24
  }[];
25
25
  enabled_oauth_providers: {
26
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
26
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | undefined>;
27
27
  }[];
28
28
  domains: {
29
29
  domain: string;
@@ -86,7 +86,7 @@ export declare const projectsCrudClientReadSchema: import("yup").ObjectSchema<{
86
86
  magic_link_enabled: NonNullable<boolean | undefined>;
87
87
  client_team_creation_enabled: NonNullable<boolean | undefined>;
88
88
  enabled_oauth_providers: {
89
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
89
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | undefined>;
90
90
  }[];
91
91
  };
92
92
  }, import("yup").AnyObject, {
@@ -116,7 +116,7 @@ export declare const projectsCrudAdminUpdateSchema: import("yup").ObjectSchema<{
116
116
  facebook_config_id?: string | undefined;
117
117
  microsoft_tenant_id?: string | undefined;
118
118
  type: NonNullable<"shared" | "standard" | undefined>;
119
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
119
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | undefined>;
120
120
  enabled: NonNullable<boolean | undefined>;
121
121
  }[] | undefined;
122
122
  domains?: {
@@ -162,7 +162,7 @@ export declare const projectsCrudAdminCreateSchema: import("yup").ObjectSchema<{
162
162
  facebook_config_id?: string | undefined;
163
163
  microsoft_tenant_id?: string | undefined;
164
164
  type: NonNullable<"shared" | "standard" | undefined>;
165
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
165
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | undefined>;
166
166
  enabled: NonNullable<boolean | undefined>;
167
167
  }[] | undefined;
168
168
  domains?: {
@@ -205,7 +205,7 @@ export declare const projectsCrud: import("../../crud").CrudSchemaFromOptions<{
205
205
  magic_link_enabled: NonNullable<boolean | undefined>;
206
206
  client_team_creation_enabled: NonNullable<boolean | undefined>;
207
207
  enabled_oauth_providers: {
208
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
208
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | undefined>;
209
209
  }[];
210
210
  };
211
211
  }, import("yup").AnyObject, {
@@ -239,11 +239,11 @@ export declare const projectsCrud: import("../../crud").CrudSchemaFromOptions<{
239
239
  facebook_config_id?: string | undefined;
240
240
  microsoft_tenant_id?: string | undefined;
241
241
  type: NonNullable<"shared" | "standard" | undefined>;
242
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
242
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | undefined>;
243
243
  enabled: NonNullable<boolean | undefined>;
244
244
  }[];
245
245
  enabled_oauth_providers: {
246
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
246
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | undefined>;
247
247
  }[];
248
248
  domains: {
249
249
  domain: string;
@@ -313,7 +313,7 @@ export declare const projectsCrud: import("../../crud").CrudSchemaFromOptions<{
313
313
  facebook_config_id?: string | undefined;
314
314
  microsoft_tenant_id?: string | undefined;
315
315
  type: NonNullable<"shared" | "standard" | undefined>;
316
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
316
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | undefined>;
317
317
  enabled: NonNullable<boolean | undefined>;
318
318
  }[] | undefined;
319
319
  domains?: {
@@ -389,11 +389,11 @@ export declare const internalProjectsCrud: import("../../crud").CrudSchemaFromOp
389
389
  facebook_config_id?: string | undefined;
390
390
  microsoft_tenant_id?: string | undefined;
391
391
  type: NonNullable<"shared" | "standard" | undefined>;
392
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
392
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | undefined>;
393
393
  enabled: NonNullable<boolean | undefined>;
394
394
  }[];
395
395
  enabled_oauth_providers: {
396
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
396
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | undefined>;
397
397
  }[];
398
398
  domains: {
399
399
  domain: string;
@@ -463,7 +463,7 @@ export declare const internalProjectsCrud: import("../../crud").CrudSchemaFromOp
463
463
  facebook_config_id?: string | undefined;
464
464
  microsoft_tenant_id?: string | undefined;
465
465
  type: NonNullable<"shared" | "standard" | undefined>;
466
- id: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
466
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | undefined>;
467
467
  enabled: NonNullable<boolean | undefined>;
468
468
  }[] | undefined;
469
469
  domains?: {
@@ -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" | 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" | 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" | 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" | undefined>;
182
182
  id: string;
183
183
  provider_user_id: string;
184
184
  };
@@ -1,9 +1,21 @@
1
1
  import { CrudTypeOf } from "../../crud";
2
- export declare const teamMembershipsCrudClientReadSchema: import("yup").ObjectSchema<{}, import("yup").AnyObject, {}, "">;
2
+ export declare const teamMembershipsCrudClientReadSchema: import("yup").ObjectSchema<{
3
+ team_id: string;
4
+ user_id: string;
5
+ }, import("yup").AnyObject, {
6
+ team_id: undefined;
7
+ user_id: undefined;
8
+ }, "">;
3
9
  export declare const teamMembershipsCrudServerCreateSchema: import("yup").ObjectSchema<{}, import("yup").AnyObject, {}, "">;
4
10
  export declare const teamMembershipsCrudClientDeleteSchema: import("yup").MixedSchema<{} | undefined, import("yup").AnyObject, undefined, "">;
5
11
  export declare const teamMembershipsCrud: import("../../crud").CrudSchemaFromOptions<{
6
- clientReadSchema: import("yup").ObjectSchema<{}, import("yup").AnyObject, {}, "">;
12
+ clientReadSchema: import("yup").ObjectSchema<{
13
+ team_id: string;
14
+ user_id: string;
15
+ }, import("yup").AnyObject, {
16
+ team_id: undefined;
17
+ user_id: undefined;
18
+ }, "">;
7
19
  clientDeleteSchema: import("yup").MixedSchema<{} | undefined, import("yup").AnyObject, undefined, "">;
8
20
  serverCreateSchema: import("yup").ObjectSchema<{}, import("yup").AnyObject, {}, "">;
9
21
  docs: {
@@ -25,3 +37,33 @@ export declare const teamMembershipsCrud: import("../../crud").CrudSchemaFromOpt
25
37
  };
26
38
  }>;
27
39
  export type TeamMembershipsCrud = CrudTypeOf<typeof teamMembershipsCrud>;
40
+ export declare const teamMembershipCreatedWebhookEvent: {
41
+ type: string;
42
+ schema: import("yup").ObjectSchema<{
43
+ team_id: string;
44
+ user_id: string;
45
+ }, import("yup").AnyObject, {
46
+ team_id: undefined;
47
+ user_id: undefined;
48
+ }, "">;
49
+ metadata: {
50
+ summary: string;
51
+ description: string;
52
+ tags: string[];
53
+ };
54
+ };
55
+ export declare const teamMembershipDeletedWebhookEvent: {
56
+ type: string;
57
+ schema: import("yup").ObjectSchema<{
58
+ team_id: string;
59
+ user_id: string;
60
+ }, import("yup").AnyObject, {
61
+ team_id: undefined;
62
+ user_id: undefined;
63
+ }, "">;
64
+ metadata: {
65
+ summary: string;
66
+ description: string;
67
+ tags: string[];
68
+ };
69
+ };
@@ -1,6 +1,9 @@
1
1
  import { createCrud } from "../../crud";
2
- import { yupMixed, yupObject } from "../../schema-fields";
3
- export const teamMembershipsCrudClientReadSchema = yupObject({}).required();
2
+ import { yupMixed, yupObject, yupString } from "../../schema-fields";
3
+ export const teamMembershipsCrudClientReadSchema = yupObject({
4
+ team_id: yupString().required(),
5
+ user_id: yupString().required(),
6
+ }).required();
4
7
  export const teamMembershipsCrudServerCreateSchema = yupObject({}).required();
5
8
  export const teamMembershipsCrudClientDeleteSchema = yupMixed();
6
9
  export const teamMembershipsCrud = createCrud({
@@ -27,3 +30,21 @@ export const teamMembershipsCrud = createCrud({
27
30
  },
28
31
  },
29
32
  });
33
+ export const teamMembershipCreatedWebhookEvent = {
34
+ type: "team_membership.created",
35
+ schema: teamMembershipsCrud.server.readSchema,
36
+ metadata: {
37
+ summary: "Team Membership Created",
38
+ description: "This event is triggered when a user is added to a team.",
39
+ tags: ["Teams"],
40
+ },
41
+ };
42
+ export const teamMembershipDeletedWebhookEvent = {
43
+ type: "team_membership.deleted",
44
+ schema: teamMembershipsCrud.server.readSchema,
45
+ metadata: {
46
+ summary: "Team Membership Deleted",
47
+ description: "This event is triggered when a user is removed from a team.",
48
+ tags: ["Teams"],
49
+ },
50
+ };
@@ -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" | 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" | 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" | 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" | 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" | 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" | 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" | 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" | undefined>;
450
448
  id: string;
451
449
  provider_user_id: string;
452
450
  };
@@ -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(),
@@ -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" | "gitlab" | "bitbucket" | undefined>;
18
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | 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" | "gitlab" | "bitbucket" | undefined>;
75
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | 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" | "gitlab" | "bitbucket" | undefined>;
99
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | 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" | "gitlab" | "bitbucket" | undefined>;
141
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | 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" | "gitlab" | "bitbucket" | undefined>;
181
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | 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" | "gitlab" | "bitbucket" | undefined>;
209
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | 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" | "gitlab" | "bitbucket" | undefined>;
271
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | 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" | "gitlab" | "bitbucket" | undefined>;
337
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | 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" | "gitlab" | "bitbucket" | undefined>;
399
+ id: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | undefined>;
400
400
  enabled: NonNullable<boolean | undefined>;
401
401
  }[] | undefined;
402
402
  domains?: {
@@ -56,15 +56,14 @@ export declare const usersCrudServerReadSchema: import("yup").ObjectSchema<{
56
56
  server_metadata: undefined;
57
57
  }, "">;
58
58
  export declare const usersCrudServerCreateSchema: import("yup").ObjectSchema<{
59
+ password: string | null | undefined;
59
60
  display_name: string | null | undefined;
61
+ primary_email: string | null | undefined;
60
62
  profile_image_url: string | undefined;
61
63
  client_metadata: {} | null | undefined;
62
64
  server_metadata: {} | null | undefined;
63
- primary_email: string | null | undefined;
64
65
  primary_email_verified: boolean | undefined;
65
66
  primary_email_auth_enabled: boolean | undefined;
66
- password: string | null | undefined;
67
- selected_team_id: string | null | undefined;
68
67
  } & {
69
68
  oauth_providers: {
70
69
  email: string | null;
@@ -142,15 +141,14 @@ export declare const usersCrud: import("../../crud").CrudSchemaFromOptions<{
142
141
  selected_team_id: undefined;
143
142
  }, "">;
144
143
  serverCreateSchema: import("yup").ObjectSchema<{
144
+ password: string | null | undefined;
145
145
  display_name: string | null | undefined;
146
+ primary_email: string | null | undefined;
146
147
  profile_image_url: string | undefined;
147
148
  client_metadata: {} | null | undefined;
148
149
  server_metadata: {} | null | undefined;
149
- primary_email: string | null | undefined;
150
150
  primary_email_verified: boolean | undefined;
151
151
  primary_email_auth_enabled: boolean | undefined;
152
- password: string | null | undefined;
153
- selected_team_id: string | null | undefined;
154
152
  } & {
155
153
  oauth_providers: {
156
154
  email: string | null;
@@ -32,7 +32,7 @@ export const usersCrudServerReadSchema = fieldSchema.yupObject({
32
32
  client_metadata: fieldSchema.userClientMetadataSchema,
33
33
  server_metadata: fieldSchema.userServerMetadataSchema,
34
34
  }).required();
35
- export const usersCrudServerCreateSchema = usersCrudServerUpdateSchema.concat(fieldSchema.yupObject({
35
+ export const usersCrudServerCreateSchema = usersCrudServerUpdateSchema.omit(['selected_team_id']).concat(fieldSchema.yupObject({
36
36
  oauth_providers: fieldSchema.yupArray(fieldSchema.yupObject({
37
37
  provider_id: fieldSchema.yupString().required(),
38
38
  account_id: fieldSchema.yupString().required(),
@@ -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" | 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" | 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" | 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" | undefined>;
148
148
  id: string;
149
149
  provider_user_id: string;
150
150
  };
@@ -260,4 +260,32 @@ export declare const webhookEvents: readonly [{
260
260
  description: string;
261
261
  tags: string[];
262
262
  };
263
+ }, {
264
+ type: string;
265
+ schema: yup.ObjectSchema<{
266
+ team_id: string;
267
+ user_id: string;
268
+ }, yup.AnyObject, {
269
+ team_id: undefined;
270
+ user_id: undefined;
271
+ }, "">;
272
+ metadata: {
273
+ summary: string;
274
+ description: string;
275
+ tags: string[];
276
+ };
277
+ }, {
278
+ type: string;
279
+ schema: yup.ObjectSchema<{
280
+ team_id: string;
281
+ user_id: string;
282
+ }, yup.AnyObject, {
283
+ team_id: undefined;
284
+ user_id: undefined;
285
+ }, "">;
286
+ metadata: {
287
+ summary: string;
288
+ description: string;
289
+ tags: string[];
290
+ };
263
291
  }];
@@ -1,3 +1,4 @@
1
+ import { teamMembershipCreatedWebhookEvent, teamMembershipDeletedWebhookEvent } from "./crud/team-memberships";
1
2
  import { teamCreatedWebhookEvent, teamDeletedWebhookEvent, teamUpdatedWebhookEvent } from "./crud/teams";
2
3
  import { userCreatedWebhookEvent, userDeletedWebhookEvent, userUpdatedWebhookEvent } from "./crud/users";
3
4
  export const webhookEvents = [
@@ -7,4 +8,6 @@ export const webhookEvents = [
7
8
  teamCreatedWebhookEvent,
8
9
  teamUpdatedWebhookEvent,
9
10
  teamDeletedWebhookEvent,
11
+ teamMembershipCreatedWebhookEvent,
12
+ teamMembershipDeletedWebhookEvent,
10
13
  ];
@@ -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" | "gitlab" | "bitbucket" | undefined, yup.AnyObject, undefined, "">;
42
+ export declare const oauthIdSchema: yup.StringSchema<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | 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, "">;
@@ -70,7 +70,7 @@ export declare const userClientReadOnlyMetadataSchema: yup.MixedSchema<{} | null
70
70
  export declare const userServerMetadataSchema: yup.MixedSchema<{} | null, yup.AnyObject, undefined, "">;
71
71
  export declare const userOAuthProviderSchema: yup.ObjectSchema<{
72
72
  id: string;
73
- type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
73
+ type: NonNullable<"google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | undefined>;
74
74
  provider_user_id: string;
75
75
  }, yup.AnyObject, {
76
76
  id: undefined;
@@ -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"];
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"];
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"];
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;
@@ -79,6 +79,16 @@ export function pending(promise, options = {}) {
79
79
  res.status = "pending";
80
80
  return res;
81
81
  }
82
+ /**
83
+ * Should be used to wrap Promises that are not immediately awaited, so they don't throw an unhandled promise rejection
84
+ * error.
85
+ *
86
+ * Vercel kills serverless functions on unhandled promise rejection errors, so this is important.
87
+ */
88
+ export function ignoreUnhandledRejection(promise) {
89
+ promise.catch(() => { });
90
+ return promise;
91
+ }
82
92
  export async function wait(ms) {
83
93
  return await new Promise(resolve => setTimeout(resolve, ms));
84
94
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackframe/stack-shared",
3
- "version": "2.5.32",
3
+ "version": "2.5.35",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [
@@ -37,7 +37,7 @@
37
37
  "jose": "^5.2.2",
38
38
  "oauth4webapi": "^2.10.3",
39
39
  "uuid": "^9.0.1",
40
- "@stackframe/stack-sc": "2.5.32"
40
+ "@stackframe/stack-sc": "2.5.35"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/bcrypt": "^5.0.2",