@stackframe/stack-shared 2.5.31 → 2.5.33
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 +14 -0
- package/dist/interface/crud/current-user.d.ts +8 -4
- package/dist/interface/crud/projects.js +1 -1
- package/dist/interface/crud/team-member-profiles.d.ts +8 -4
- package/dist/interface/crud/team-memberships.d.ts +44 -2
- package/dist/interface/crud/team-memberships.js +23 -2
- package/dist/interface/crud/users.d.ts +16 -8
- package/dist/interface/crud-deprecated/projects.js +1 -1
- package/dist/interface/webhooks.d.ts +36 -4
- package/dist/interface/webhooks.js +3 -0
- package/dist/schema-fields.d.ts +4 -2
- package/dist/schema-fields.js +5 -4
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @stackframe/stack-shared
|
|
2
2
|
|
|
3
|
+
## 2.5.33
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Team membership webhooks
|
|
8
|
+
- @stackframe/stack-sc@2.5.33
|
|
9
|
+
|
|
10
|
+
## 2.5.32
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Improved connected account performance
|
|
15
|
+
- @stackframe/stack-sc@2.5.32
|
|
16
|
+
|
|
3
17
|
## 2.5.31
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -30,14 +30,16 @@ export declare const currentUserCrud: import("../../crud").CrudSchemaFromOptions
|
|
|
30
30
|
} | {
|
|
31
31
|
type: "oauth";
|
|
32
32
|
provider: {
|
|
33
|
-
type:
|
|
33
|
+
type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
|
|
34
|
+
id: string;
|
|
34
35
|
provider_user_id: string;
|
|
35
36
|
};
|
|
36
37
|
})[];
|
|
37
38
|
connected_accounts: {
|
|
38
39
|
type: "oauth";
|
|
39
40
|
provider: {
|
|
40
|
-
type:
|
|
41
|
+
type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
|
|
42
|
+
id: string;
|
|
41
43
|
provider_user_id: string;
|
|
42
44
|
};
|
|
43
45
|
}[];
|
|
@@ -112,14 +114,16 @@ export declare const currentUserCrud: import("../../crud").CrudSchemaFromOptions
|
|
|
112
114
|
} | {
|
|
113
115
|
type: "oauth";
|
|
114
116
|
provider: {
|
|
115
|
-
type:
|
|
117
|
+
type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
|
|
118
|
+
id: string;
|
|
116
119
|
provider_user_id: string;
|
|
117
120
|
};
|
|
118
121
|
})[];
|
|
119
122
|
connected_accounts: {
|
|
120
123
|
type: "oauth";
|
|
121
124
|
provider: {
|
|
122
|
-
type:
|
|
125
|
+
type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
|
|
126
|
+
id: string;
|
|
123
127
|
provider_user_id: string;
|
|
124
128
|
};
|
|
125
129
|
}[];
|
|
@@ -27,7 +27,7 @@ const emailConfigSchema = yupObject({
|
|
|
27
27
|
sender_email: yupRequiredWhen(schemaFields.emailSenderEmailSchema, 'type', 'standard'),
|
|
28
28
|
});
|
|
29
29
|
const domainSchema = yupObject({
|
|
30
|
-
domain: schemaFields.
|
|
30
|
+
domain: schemaFields.projectTrustedDomainSchema.required(),
|
|
31
31
|
handler_path: schemaFields.handlerPathSchema.required(),
|
|
32
32
|
});
|
|
33
33
|
export const projectsCrudAdminReadSchema = yupObject({
|
|
@@ -56,14 +56,16 @@ export declare const teamMemberProfilesCrudServerReadSchema: import("yup").Objec
|
|
|
56
56
|
} | {
|
|
57
57
|
type: "oauth";
|
|
58
58
|
provider: {
|
|
59
|
-
type:
|
|
59
|
+
type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
|
|
60
|
+
id: string;
|
|
60
61
|
provider_user_id: string;
|
|
61
62
|
};
|
|
62
63
|
})[];
|
|
63
64
|
connected_accounts: {
|
|
64
65
|
type: "oauth";
|
|
65
66
|
provider: {
|
|
66
|
-
type:
|
|
67
|
+
type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
|
|
68
|
+
id: string;
|
|
67
69
|
provider_user_id: string;
|
|
68
70
|
};
|
|
69
71
|
}[];
|
|
@@ -168,14 +170,16 @@ export declare const teamMemberProfilesCrud: import("../../crud").CrudSchemaFrom
|
|
|
168
170
|
} | {
|
|
169
171
|
type: "oauth";
|
|
170
172
|
provider: {
|
|
171
|
-
type:
|
|
173
|
+
type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
|
|
174
|
+
id: string;
|
|
172
175
|
provider_user_id: string;
|
|
173
176
|
};
|
|
174
177
|
})[];
|
|
175
178
|
connected_accounts: {
|
|
176
179
|
type: "oauth";
|
|
177
180
|
provider: {
|
|
178
|
-
type:
|
|
181
|
+
type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
|
|
182
|
+
id: string;
|
|
179
183
|
provider_user_id: string;
|
|
180
184
|
};
|
|
181
185
|
}[];
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import { CrudTypeOf } from "../../crud";
|
|
2
|
-
export declare const teamMembershipsCrudClientReadSchema: import("yup").ObjectSchema<{
|
|
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<{
|
|
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({
|
|
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,14 +61,16 @@ export declare const usersCrudServerReadSchema: import("yup").ObjectSchema<{
|
|
|
61
61
|
} | {
|
|
62
62
|
type: "oauth";
|
|
63
63
|
provider: {
|
|
64
|
-
type:
|
|
64
|
+
type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
|
|
65
|
+
id: string;
|
|
65
66
|
provider_user_id: string;
|
|
66
67
|
};
|
|
67
68
|
})[];
|
|
68
69
|
connected_accounts: {
|
|
69
70
|
type: "oauth";
|
|
70
71
|
provider: {
|
|
71
|
-
type:
|
|
72
|
+
type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
|
|
73
|
+
id: string;
|
|
72
74
|
provider_user_id: string;
|
|
73
75
|
};
|
|
74
76
|
}[];
|
|
@@ -175,14 +177,16 @@ export declare const usersCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
|
175
177
|
} | {
|
|
176
178
|
type: "oauth";
|
|
177
179
|
provider: {
|
|
178
|
-
type:
|
|
180
|
+
type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
|
|
181
|
+
id: string;
|
|
179
182
|
provider_user_id: string;
|
|
180
183
|
};
|
|
181
184
|
})[];
|
|
182
185
|
connected_accounts: {
|
|
183
186
|
type: "oauth";
|
|
184
187
|
provider: {
|
|
185
|
-
type:
|
|
188
|
+
type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
|
|
189
|
+
id: string;
|
|
186
190
|
provider_user_id: string;
|
|
187
191
|
};
|
|
188
192
|
}[];
|
|
@@ -344,14 +348,16 @@ export declare const userCreatedWebhookEvent: {
|
|
|
344
348
|
} | {
|
|
345
349
|
type: "oauth";
|
|
346
350
|
provider: {
|
|
347
|
-
type:
|
|
351
|
+
type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
|
|
352
|
+
id: string;
|
|
348
353
|
provider_user_id: string;
|
|
349
354
|
};
|
|
350
355
|
})[];
|
|
351
356
|
connected_accounts: {
|
|
352
357
|
type: "oauth";
|
|
353
358
|
provider: {
|
|
354
|
-
type:
|
|
359
|
+
type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
|
|
360
|
+
id: string;
|
|
355
361
|
provider_user_id: string;
|
|
356
362
|
};
|
|
357
363
|
}[];
|
|
@@ -432,14 +438,16 @@ export declare const userUpdatedWebhookEvent: {
|
|
|
432
438
|
} | {
|
|
433
439
|
type: "oauth";
|
|
434
440
|
provider: {
|
|
435
|
-
type:
|
|
441
|
+
type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
|
|
442
|
+
id: string;
|
|
436
443
|
provider_user_id: string;
|
|
437
444
|
};
|
|
438
445
|
})[];
|
|
439
446
|
connected_accounts: {
|
|
440
447
|
type: "oauth";
|
|
441
448
|
provider: {
|
|
442
|
-
type:
|
|
449
|
+
type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
|
|
450
|
+
id: string;
|
|
443
451
|
provider_user_id: string;
|
|
444
452
|
};
|
|
445
453
|
}[];
|
|
@@ -21,7 +21,7 @@ const emailConfigSchema = yupObject({
|
|
|
21
21
|
sender_email: yupRequiredWhen(schemaFields.emailSenderEmailSchema, 'type', 'standard'),
|
|
22
22
|
});
|
|
23
23
|
const domainSchema = yupObject({
|
|
24
|
-
domain: schemaFields.
|
|
24
|
+
domain: schemaFields.projectTrustedDomainSchema.required(),
|
|
25
25
|
handler_path: schemaFields.handlerPathSchema.required(),
|
|
26
26
|
});
|
|
27
27
|
export const projectsCrudAdminReadSchema = yupObject({
|
|
@@ -47,14 +47,16 @@ export declare const webhookEvents: readonly [{
|
|
|
47
47
|
} | {
|
|
48
48
|
type: "oauth";
|
|
49
49
|
provider: {
|
|
50
|
-
type:
|
|
50
|
+
type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
|
|
51
|
+
id: string;
|
|
51
52
|
provider_user_id: string;
|
|
52
53
|
};
|
|
53
54
|
})[];
|
|
54
55
|
connected_accounts: {
|
|
55
56
|
type: "oauth";
|
|
56
57
|
provider: {
|
|
57
|
-
type:
|
|
58
|
+
type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
|
|
59
|
+
id: string;
|
|
58
60
|
provider_user_id: string;
|
|
59
61
|
};
|
|
60
62
|
}[];
|
|
@@ -134,14 +136,16 @@ export declare const webhookEvents: readonly [{
|
|
|
134
136
|
} | {
|
|
135
137
|
type: "oauth";
|
|
136
138
|
provider: {
|
|
137
|
-
type:
|
|
139
|
+
type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
|
|
140
|
+
id: string;
|
|
138
141
|
provider_user_id: string;
|
|
139
142
|
};
|
|
140
143
|
})[];
|
|
141
144
|
connected_accounts: {
|
|
142
145
|
type: "oauth";
|
|
143
146
|
provider: {
|
|
144
|
-
type:
|
|
147
|
+
type: NonNullable<"google" | "github" | "facebook" | "microsoft" | "spotify" | "discord" | "gitlab" | "bitbucket" | undefined>;
|
|
148
|
+
id: string;
|
|
145
149
|
provider_user_id: string;
|
|
146
150
|
};
|
|
147
151
|
}[];
|
|
@@ -256,4 +260,32 @@ export declare const webhookEvents: readonly [{
|
|
|
256
260
|
description: string;
|
|
257
261
|
tags: string[];
|
|
258
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
|
+
};
|
|
259
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
|
];
|
package/dist/schema-fields.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export declare const emailPortSchema: yup.NumberSchema<number | undefined, yup.A
|
|
|
51
51
|
export declare const emailUsernameSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
52
52
|
export declare const emailSenderEmailSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
53
53
|
export declare const emailPasswordSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
54
|
-
export declare const
|
|
54
|
+
export declare const projectTrustedDomainSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
55
55
|
export declare const handlerPathSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
56
56
|
export declare class ReplaceFieldWithOwnUserId extends Error {
|
|
57
57
|
readonly path: string;
|
|
@@ -69,9 +69,11 @@ export declare const userClientMetadataSchema: yup.MixedSchema<{} | null, yup.An
|
|
|
69
69
|
export declare const userClientReadOnlyMetadataSchema: yup.MixedSchema<{} | null, yup.AnyObject, undefined, "">;
|
|
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
74
|
provider_user_id: string;
|
|
74
75
|
}, yup.AnyObject, {
|
|
76
|
+
id: undefined;
|
|
75
77
|
type: undefined;
|
|
76
78
|
provider_user_id: undefined;
|
|
77
79
|
}, "">;
|
package/dist/schema-fields.js
CHANGED
|
@@ -168,7 +168,7 @@ export const emailUsernameSchema = yupString().meta({ openapiField: { descriptio
|
|
|
168
168
|
export const emailSenderEmailSchema = emailSchema.meta({ openapiField: { description: 'Email sender email. Needs to be specified when using type="standard"', exampleValue: 'example@your-domain.com' } });
|
|
169
169
|
export const emailPasswordSchema = yupString().meta({ openapiField: { description: 'Email password. Needs to be specified when using type="standard"', exampleValue: 'your-email-password' } });
|
|
170
170
|
// Project domain config
|
|
171
|
-
export const
|
|
171
|
+
export const projectTrustedDomainSchema = yupString().test('is-https', 'Trusted domain must start with https://', (value) => value?.startsWith('https://')).meta({ openapiField: { description: 'Your domain URL. Make sure you own and trust this domain. Needs to start with https://', exampleValue: 'https://example.com' } });
|
|
172
172
|
export const handlerPathSchema = yupString().test('is-handler-path', 'Handler path must start with /', (value) => value?.startsWith('/')).meta({ openapiField: { description: 'Handler path. If you did not setup a custom handler path, it should be "/handler" by default. It needs to start with /', exampleValue: '/handler' } });
|
|
173
173
|
// Users
|
|
174
174
|
export class ReplaceFieldWithOwnUserId extends Error {
|
|
@@ -199,7 +199,8 @@ export const userClientMetadataSchema = jsonSchema.meta({ openapiField: { descri
|
|
|
199
199
|
export const userClientReadOnlyMetadataSchema = jsonSchema.meta({ openapiField: { description: _clientReadOnlyMetaDataDescription('user'), exampleValue: { key: 'value' } } });
|
|
200
200
|
export const userServerMetadataSchema = jsonSchema.meta({ openapiField: { description: _serverMetaDataDescription('user'), exampleValue: { key: 'value' } } });
|
|
201
201
|
export const userOAuthProviderSchema = yupObject({
|
|
202
|
-
|
|
202
|
+
id: yupString().required(),
|
|
203
|
+
type: yupString().oneOf(allProviders).required(),
|
|
203
204
|
provider_user_id: yupString().required(),
|
|
204
205
|
});
|
|
205
206
|
export const userLastActiveAtMillisSchema = yupNumber().nullable().meta({ openapiField: { description: _lastActiveAtMillisDescription, exampleValue: 1630000000000 } });
|
|
@@ -207,8 +208,8 @@ export const userLastActiveAtMillisSchema = yupNumber().nullable().meta({ openap
|
|
|
207
208
|
export const signInEmailSchema = emailSchema.meta({ openapiField: { description: 'The email to sign in with.', exampleValue: 'johndoe@example.com' } });
|
|
208
209
|
export const emailOtpSignInCallbackUrlSchema = urlSchema.meta({ openapiField: { description: 'The base callback URL to construct the magic link from. A query argument `code` with the verification code will be appended to it. The page should then make a request to the `/auth/otp/sign-in` endpoint.', exampleValue: 'https://example.com/handler/magic-link-callback' } });
|
|
209
210
|
export const emailVerificationCallbackUrlSchema = 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' } });
|
|
210
|
-
export const accessTokenResponseSchema = yupString().meta({ openapiField: { description: 'Short-lived access token that can be used to authenticate the user', exampleValue: '
|
|
211
|
-
export const refreshTokenResponseSchema = yupString().meta({ openapiField: { description: 'Long-lived refresh token that can be used to obtain a new access token', exampleValue: '
|
|
211
|
+
export const accessTokenResponseSchema = yupString().meta({ openapiField: { description: 'Short-lived access token that can be used to authenticate the user', exampleValue: 'eyJhmMiJB2TO...diI4QT' } });
|
|
212
|
+
export const refreshTokenResponseSchema = yupString().meta({ openapiField: { description: 'Long-lived refresh token that can be used to obtain a new access token', exampleValue: 'i8ns3aq2...14y' } });
|
|
212
213
|
export const signInResponseSchema = yupObject({
|
|
213
214
|
refresh_token: refreshTokenResponseSchema.required(),
|
|
214
215
|
access_token: accessTokenResponseSchema.required(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackframe/stack-shared",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.33",
|
|
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.
|
|
40
|
+
"@stackframe/stack-sc": "2.5.33"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/bcrypt": "^5.0.2",
|