@stackframe/stack-shared 2.6.23 → 2.6.25
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/clientInterface.js +2 -2
- package/dist/interface/crud/api-keys.d.ts +3 -3
- package/dist/interface/crud/api-keys.js +14 -14
- package/dist/interface/crud/contact-channels.d.ts +10 -10
- package/dist/interface/crud/contact-channels.js +14 -14
- package/dist/interface/crud/current-user.d.ts +13 -13
- package/dist/interface/crud/current-user.js +1 -1
- package/dist/interface/crud/email-templates.d.ts +10 -10
- package/dist/interface/crud/email-templates.js +10 -10
- package/dist/interface/crud/oauth.js +3 -3
- package/dist/interface/crud/projects.d.ts +75 -75
- package/dist/interface/crud/projects.js +59 -59
- package/dist/interface/crud/svix-token.js +3 -3
- package/dist/interface/crud/team-invitation-details.js +3 -3
- package/dist/interface/crud/team-member-profiles.d.ts +18 -18
- package/dist/interface/crud/team-member-profiles.js +6 -6
- package/dist/interface/crud/team-memberships.js +4 -4
- package/dist/interface/crud/team-permissions.js +11 -11
- package/dist/interface/crud/teams.js +13 -13
- package/dist/interface/crud/users.d.ts +28 -28
- package/dist/interface/crud/users.js +23 -23
- package/dist/interface/webhooks.d.ts +14 -14
- package/dist/schema-fields.d.ts +11 -3
- package/dist/schema-fields.js +28 -13
- package/dist/utils/ips.d.ts +4 -0
- package/dist/utils/ips.js +9 -0
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @stackframe/stack-shared
|
|
2
2
|
|
|
3
|
+
## 2.6.25
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Translation overrides
|
|
8
|
+
- @stackframe/stack-sc@2.6.25
|
|
9
|
+
|
|
10
|
+
## 2.6.24
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Bugfixes
|
|
15
|
+
- @stackframe/stack-sc@2.6.24
|
|
16
|
+
|
|
3
17
|
## 2.6.23
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -76,9 +76,9 @@ export class StackClientInterface {
|
|
|
76
76
|
throw new Error("Failed to send Stack network request. It seems like you are offline. (window.navigator.onLine is falsy)", { cause: retriedResult.error });
|
|
77
77
|
}
|
|
78
78
|
throw new Error(deindent `
|
|
79
|
-
Stack is unable to connect to the server. Please check your internet connection and try again.
|
|
79
|
+
Stack Auth is unable to connect to the server. Please check your internet connection and try again.
|
|
80
80
|
|
|
81
|
-
If the problem persists, please contact
|
|
81
|
+
If the problem persists, please contact support and provide a screenshot of your entire browser console.
|
|
82
82
|
|
|
83
83
|
${retriedResult.error}
|
|
84
84
|
|
|
@@ -2,9 +2,9 @@ import { CrudTypeOf } from "../../crud";
|
|
|
2
2
|
export declare const apiKeysCreateInputSchema: import("yup").ObjectSchema<{
|
|
3
3
|
description: string;
|
|
4
4
|
expires_at_millis: number;
|
|
5
|
-
has_publishable_client_key:
|
|
6
|
-
has_secret_server_key:
|
|
7
|
-
has_super_secret_admin_key:
|
|
5
|
+
has_publishable_client_key: boolean;
|
|
6
|
+
has_secret_server_key: boolean;
|
|
7
|
+
has_super_secret_admin_key: boolean;
|
|
8
8
|
}, import("yup").AnyObject, {
|
|
9
9
|
description: undefined;
|
|
10
10
|
expires_at_millis: undefined;
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
import { createCrud } from "../../crud";
|
|
2
2
|
import { yupBoolean, yupMixed, yupNumber, yupObject, yupString } from "../../schema-fields";
|
|
3
3
|
const baseApiKeysReadSchema = yupObject({
|
|
4
|
-
id: yupString().
|
|
5
|
-
description: yupString().
|
|
6
|
-
expires_at_millis: yupNumber().
|
|
4
|
+
id: yupString().defined(),
|
|
5
|
+
description: yupString().defined(),
|
|
6
|
+
expires_at_millis: yupNumber().defined(),
|
|
7
7
|
manually_revoked_at_millis: yupNumber().optional(),
|
|
8
|
-
created_at_millis: yupNumber().
|
|
8
|
+
created_at_millis: yupNumber().defined(),
|
|
9
9
|
});
|
|
10
10
|
// Used for the result of the create endpoint
|
|
11
11
|
export const apiKeysCreateInputSchema = yupObject({
|
|
12
|
-
description: yupString().
|
|
13
|
-
expires_at_millis: yupNumber().
|
|
14
|
-
has_publishable_client_key: yupBoolean().
|
|
15
|
-
has_secret_server_key: yupBoolean().
|
|
16
|
-
has_super_secret_admin_key: yupBoolean().
|
|
12
|
+
description: yupString().defined(),
|
|
13
|
+
expires_at_millis: yupNumber().defined(),
|
|
14
|
+
has_publishable_client_key: yupBoolean().defined(),
|
|
15
|
+
has_secret_server_key: yupBoolean().defined(),
|
|
16
|
+
has_super_secret_admin_key: yupBoolean().defined(),
|
|
17
17
|
});
|
|
18
18
|
export const apiKeysCreateOutputSchema = baseApiKeysReadSchema.concat(yupObject({
|
|
19
19
|
publishable_client_key: yupString().optional(),
|
|
20
20
|
secret_server_key: yupString().optional(),
|
|
21
21
|
super_secret_admin_key: yupString().optional(),
|
|
22
|
-
}).
|
|
22
|
+
}).defined());
|
|
23
23
|
// Used for list, read and update endpoints after the initial creation
|
|
24
24
|
export const apiKeysCrudAdminObfuscatedReadSchema = baseApiKeysReadSchema.concat(yupObject({
|
|
25
25
|
publishable_client_key: yupObject({
|
|
26
|
-
last_four: yupString().
|
|
26
|
+
last_four: yupString().defined(),
|
|
27
27
|
}).optional(),
|
|
28
28
|
secret_server_key: yupObject({
|
|
29
|
-
last_four: yupString().
|
|
29
|
+
last_four: yupString().defined(),
|
|
30
30
|
}).optional(),
|
|
31
31
|
super_secret_admin_key: yupObject({
|
|
32
|
-
last_four: yupString().
|
|
32
|
+
last_four: yupString().defined(),
|
|
33
33
|
}).optional(),
|
|
34
34
|
}));
|
|
35
35
|
export const apiKeysCrudAdminUpdateSchema = yupObject({
|
|
36
36
|
description: yupString().optional(),
|
|
37
37
|
revoked: yupBoolean().oneOf([true]).optional(),
|
|
38
|
-
}).
|
|
38
|
+
}).defined();
|
|
39
39
|
export const apiKeysCrudAdminDeleteSchema = yupMixed();
|
|
40
40
|
export const apiKeysCrud = createCrud({
|
|
41
41
|
adminReadSchema: apiKeysCrudAdminObfuscatedReadSchema,
|
|
@@ -4,9 +4,9 @@ export declare const contactChannelsClientReadSchema: import("yup").ObjectSchema
|
|
|
4
4
|
id: string;
|
|
5
5
|
value: string;
|
|
6
6
|
type: "email";
|
|
7
|
-
used_for_auth:
|
|
8
|
-
is_verified:
|
|
9
|
-
is_primary:
|
|
7
|
+
used_for_auth: boolean;
|
|
8
|
+
is_verified: boolean;
|
|
9
|
+
is_primary: boolean;
|
|
10
10
|
}, import("yup").AnyObject, {
|
|
11
11
|
user_id: undefined;
|
|
12
12
|
id: undefined;
|
|
@@ -45,7 +45,7 @@ export declare const contactChannelsCrudClientCreateSchema: import("yup").Object
|
|
|
45
45
|
user_id: string;
|
|
46
46
|
value: string;
|
|
47
47
|
type: "email";
|
|
48
|
-
used_for_auth:
|
|
48
|
+
used_for_auth: boolean;
|
|
49
49
|
is_primary: boolean | undefined;
|
|
50
50
|
}, import("yup").AnyObject, {
|
|
51
51
|
user_id: undefined;
|
|
@@ -58,7 +58,7 @@ export declare const contactChannelsCrudServerCreateSchema: import("yup").Object
|
|
|
58
58
|
user_id: string;
|
|
59
59
|
value: string;
|
|
60
60
|
type: "email";
|
|
61
|
-
used_for_auth:
|
|
61
|
+
used_for_auth: boolean;
|
|
62
62
|
is_primary: boolean | undefined;
|
|
63
63
|
} & {
|
|
64
64
|
is_verified: boolean | undefined;
|
|
@@ -77,9 +77,9 @@ export declare const contactChannelsCrud: import("../../crud").CrudSchemaFromOpt
|
|
|
77
77
|
id: string;
|
|
78
78
|
value: string;
|
|
79
79
|
type: "email";
|
|
80
|
-
used_for_auth:
|
|
81
|
-
is_verified:
|
|
82
|
-
is_primary:
|
|
80
|
+
used_for_auth: boolean;
|
|
81
|
+
is_verified: boolean;
|
|
82
|
+
is_primary: boolean;
|
|
83
83
|
}, import("yup").AnyObject, {
|
|
84
84
|
user_id: undefined;
|
|
85
85
|
id: undefined;
|
|
@@ -104,7 +104,7 @@ export declare const contactChannelsCrud: import("../../crud").CrudSchemaFromOpt
|
|
|
104
104
|
user_id: string;
|
|
105
105
|
value: string;
|
|
106
106
|
type: "email";
|
|
107
|
-
used_for_auth:
|
|
107
|
+
used_for_auth: boolean;
|
|
108
108
|
is_primary: boolean | undefined;
|
|
109
109
|
}, import("yup").AnyObject, {
|
|
110
110
|
user_id: undefined;
|
|
@@ -132,7 +132,7 @@ export declare const contactChannelsCrud: import("../../crud").CrudSchemaFromOpt
|
|
|
132
132
|
user_id: string;
|
|
133
133
|
value: string;
|
|
134
134
|
type: "email";
|
|
135
|
-
used_for_auth:
|
|
135
|
+
used_for_auth: boolean;
|
|
136
136
|
is_primary: boolean | undefined;
|
|
137
137
|
} & {
|
|
138
138
|
is_verified: boolean | undefined;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { createCrud } from "../../crud";
|
|
2
2
|
import { contactChannelIdSchema, contactChannelIsPrimarySchema, contactChannelIsVerifiedSchema, contactChannelTypeSchema, contactChannelUsedForAuthSchema, contactChannelValueSchema, userIdOrMeSchema, userIdSchema, yupMixed, yupObject } from "../../schema-fields";
|
|
3
3
|
export const contactChannelsClientReadSchema = yupObject({
|
|
4
|
-
user_id: userIdSchema.
|
|
5
|
-
id: contactChannelIdSchema.
|
|
6
|
-
value: contactChannelValueSchema.
|
|
7
|
-
type: contactChannelTypeSchema.
|
|
8
|
-
used_for_auth: contactChannelUsedForAuthSchema.
|
|
9
|
-
is_verified: contactChannelIsVerifiedSchema.
|
|
10
|
-
is_primary: contactChannelIsPrimarySchema.
|
|
11
|
-
}).
|
|
4
|
+
user_id: userIdSchema.defined(),
|
|
5
|
+
id: contactChannelIdSchema.defined(),
|
|
6
|
+
value: contactChannelValueSchema.defined(),
|
|
7
|
+
type: contactChannelTypeSchema.defined(),
|
|
8
|
+
used_for_auth: contactChannelUsedForAuthSchema.defined(),
|
|
9
|
+
is_verified: contactChannelIsVerifiedSchema.defined(),
|
|
10
|
+
is_primary: contactChannelIsPrimarySchema.defined(),
|
|
11
|
+
}).defined();
|
|
12
12
|
export const contactChannelsCrudClientUpdateSchema = yupObject({
|
|
13
13
|
value: contactChannelValueSchema.optional(),
|
|
14
14
|
type: contactChannelTypeSchema.optional(),
|
|
15
15
|
used_for_auth: contactChannelUsedForAuthSchema.optional(),
|
|
16
16
|
is_primary: contactChannelIsPrimarySchema.optional(),
|
|
17
|
-
}).
|
|
17
|
+
}).defined();
|
|
18
18
|
export const contactChannelsCrudServerUpdateSchema = contactChannelsCrudClientUpdateSchema.concat(yupObject({
|
|
19
19
|
is_verified: contactChannelIsVerifiedSchema.optional(),
|
|
20
20
|
}));
|
|
21
21
|
export const contactChannelsCrudClientCreateSchema = yupObject({
|
|
22
|
-
user_id: userIdOrMeSchema.
|
|
23
|
-
value: contactChannelValueSchema.
|
|
24
|
-
type: contactChannelTypeSchema.
|
|
25
|
-
used_for_auth: contactChannelUsedForAuthSchema.
|
|
22
|
+
user_id: userIdOrMeSchema.defined(),
|
|
23
|
+
value: contactChannelValueSchema.defined(),
|
|
24
|
+
type: contactChannelTypeSchema.defined(),
|
|
25
|
+
used_for_auth: contactChannelUsedForAuthSchema.defined(),
|
|
26
26
|
is_primary: contactChannelIsPrimarySchema.optional(),
|
|
27
|
-
}).
|
|
27
|
+
}).defined();
|
|
28
28
|
export const contactChannelsCrudServerCreateSchema = contactChannelsCrudClientCreateSchema.concat(yupObject({
|
|
29
29
|
is_verified: contactChannelIsVerifiedSchema.optional(),
|
|
30
30
|
}));
|
|
@@ -12,14 +12,14 @@ export declare const currentUserCrud: import("../../crud").CrudSchemaFromOptions
|
|
|
12
12
|
profile_image_url: string | null;
|
|
13
13
|
client_metadata: {} | null;
|
|
14
14
|
client_read_only_metadata: {} | null;
|
|
15
|
-
primary_email_verified:
|
|
16
|
-
passkey_auth_enabled:
|
|
17
|
-
otp_auth_enabled:
|
|
15
|
+
primary_email_verified: boolean;
|
|
16
|
+
passkey_auth_enabled: boolean;
|
|
17
|
+
otp_auth_enabled: boolean;
|
|
18
18
|
selected_team_id: string | null;
|
|
19
19
|
signed_up_at_millis: number;
|
|
20
|
-
has_password:
|
|
21
|
-
auth_with_email:
|
|
22
|
-
requires_totp_mfa:
|
|
20
|
+
has_password: boolean;
|
|
21
|
+
auth_with_email: boolean;
|
|
22
|
+
requires_totp_mfa: boolean;
|
|
23
23
|
} & {
|
|
24
24
|
selected_team: {
|
|
25
25
|
client_metadata?: {} | null | undefined;
|
|
@@ -58,8 +58,8 @@ export declare const currentUserCrud: import("../../crud").CrudSchemaFromOptions
|
|
|
58
58
|
serverReadSchema: import("yup").ObjectSchema<{
|
|
59
59
|
id: string;
|
|
60
60
|
primary_email: string | null;
|
|
61
|
-
primary_email_verified:
|
|
62
|
-
primary_email_auth_enabled:
|
|
61
|
+
primary_email_verified: boolean;
|
|
62
|
+
primary_email_auth_enabled: boolean;
|
|
63
63
|
display_name: string | null;
|
|
64
64
|
selected_team: {
|
|
65
65
|
client_metadata?: {} | null | undefined;
|
|
@@ -73,9 +73,9 @@ export declare const currentUserCrud: import("../../crud").CrudSchemaFromOptions
|
|
|
73
73
|
selected_team_id: string | null;
|
|
74
74
|
profile_image_url: string | null;
|
|
75
75
|
signed_up_at_millis: number;
|
|
76
|
-
has_password:
|
|
77
|
-
otp_auth_enabled:
|
|
78
|
-
passkey_auth_enabled:
|
|
76
|
+
has_password: boolean;
|
|
77
|
+
otp_auth_enabled: boolean;
|
|
78
|
+
passkey_auth_enabled: boolean;
|
|
79
79
|
client_metadata: {} | null;
|
|
80
80
|
client_read_only_metadata: {} | null;
|
|
81
81
|
server_metadata: {} | null;
|
|
@@ -85,8 +85,8 @@ export declare const currentUserCrud: import("../../crud").CrudSchemaFromOptions
|
|
|
85
85
|
id: string;
|
|
86
86
|
account_id: string;
|
|
87
87
|
}[];
|
|
88
|
-
auth_with_email:
|
|
89
|
-
requires_totp_mfa:
|
|
88
|
+
auth_with_email: boolean;
|
|
89
|
+
requires_totp_mfa: boolean;
|
|
90
90
|
} | null, import("yup").AnyObject, {
|
|
91
91
|
id: undefined;
|
|
92
92
|
primary_email: undefined;
|
|
@@ -10,7 +10,7 @@ const clientUpdateSchema = usersCrudServerUpdateSchema.pick([
|
|
|
10
10
|
"totp_secret_base64",
|
|
11
11
|
"otp_auth_enabled",
|
|
12
12
|
"passkey_auth_enabled",
|
|
13
|
-
]).
|
|
13
|
+
]).defined();
|
|
14
14
|
const serverUpdateSchema = usersCrudServerUpdateSchema;
|
|
15
15
|
const clientReadSchema = usersCrudServerReadSchema.pick([
|
|
16
16
|
"id",
|
|
@@ -2,10 +2,10 @@ import { CrudTypeOf } from "../../crud";
|
|
|
2
2
|
export type EmailTemplateType = typeof emailTemplateTypes[number];
|
|
3
3
|
export declare const emailTemplateTypes: readonly ["email_verification", "password_reset", "magic_link", "team_invitation"];
|
|
4
4
|
export declare const emailTemplateAdminReadSchema: import("yup").ObjectSchema<{
|
|
5
|
-
type:
|
|
5
|
+
type: "email_verification" | "password_reset" | "magic_link" | "team_invitation";
|
|
6
6
|
subject: string;
|
|
7
|
-
content: {};
|
|
8
|
-
is_default:
|
|
7
|
+
content: {} | null;
|
|
8
|
+
is_default: boolean;
|
|
9
9
|
}, import("yup").AnyObject, {
|
|
10
10
|
type: undefined;
|
|
11
11
|
subject: undefined;
|
|
@@ -21,8 +21,8 @@ export declare const emailTemplateCrudAdminUpdateSchema: import("yup").ObjectSch
|
|
|
21
21
|
}, "">;
|
|
22
22
|
export declare const emailTemplateCrudAdminDeleteSchema: import("yup").MixedSchema<{} | undefined, import("yup").AnyObject, undefined, "">;
|
|
23
23
|
export declare const emailTemplateCrudAdminCreateSchema: import("yup").ObjectSchema<{
|
|
24
|
-
type:
|
|
25
|
-
content: {};
|
|
24
|
+
type: "email_verification" | "password_reset" | "magic_link" | "team_invitation";
|
|
25
|
+
content: {} | null;
|
|
26
26
|
subject: string;
|
|
27
27
|
}, import("yup").AnyObject, {
|
|
28
28
|
type: undefined;
|
|
@@ -31,10 +31,10 @@ export declare const emailTemplateCrudAdminCreateSchema: import("yup").ObjectSch
|
|
|
31
31
|
}, "">;
|
|
32
32
|
export declare const emailTemplateCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
33
33
|
adminReadSchema: import("yup").ObjectSchema<{
|
|
34
|
-
type:
|
|
34
|
+
type: "email_verification" | "password_reset" | "magic_link" | "team_invitation";
|
|
35
35
|
subject: string;
|
|
36
|
-
content: {};
|
|
37
|
-
is_default:
|
|
36
|
+
content: {} | null;
|
|
37
|
+
is_default: boolean;
|
|
38
38
|
}, import("yup").AnyObject, {
|
|
39
39
|
type: undefined;
|
|
40
40
|
subject: undefined;
|
|
@@ -49,8 +49,8 @@ export declare const emailTemplateCrud: import("../../crud").CrudSchemaFromOptio
|
|
|
49
49
|
subject: undefined;
|
|
50
50
|
}, "">;
|
|
51
51
|
adminCreateSchema: import("yup").ObjectSchema<{
|
|
52
|
-
type:
|
|
53
|
-
content: {};
|
|
52
|
+
type: "email_verification" | "password_reset" | "magic_link" | "team_invitation";
|
|
53
|
+
content: {} | null;
|
|
54
54
|
subject: string;
|
|
55
55
|
}, import("yup").AnyObject, {
|
|
56
56
|
type: undefined;
|
|
@@ -2,21 +2,21 @@ import { createCrud } from "../../crud";
|
|
|
2
2
|
import { jsonSchema, yupBoolean, yupMixed, yupObject, yupString } from "../../schema-fields";
|
|
3
3
|
export const emailTemplateTypes = ['email_verification', 'password_reset', 'magic_link', 'team_invitation'];
|
|
4
4
|
export const emailTemplateAdminReadSchema = yupObject({
|
|
5
|
-
type: yupString().oneOf(emailTemplateTypes).
|
|
6
|
-
subject: yupString().
|
|
7
|
-
content: jsonSchema.
|
|
8
|
-
is_default: yupBoolean().
|
|
9
|
-
}).
|
|
5
|
+
type: yupString().oneOf(emailTemplateTypes).defined(),
|
|
6
|
+
subject: yupString().defined(),
|
|
7
|
+
content: jsonSchema.defined(),
|
|
8
|
+
is_default: yupBoolean().defined(),
|
|
9
|
+
}).defined();
|
|
10
10
|
export const emailTemplateCrudAdminUpdateSchema = yupObject({
|
|
11
11
|
content: jsonSchema.nonNullable().optional(),
|
|
12
12
|
subject: yupString().optional(),
|
|
13
|
-
}).
|
|
13
|
+
}).defined();
|
|
14
14
|
export const emailTemplateCrudAdminDeleteSchema = yupMixed();
|
|
15
15
|
export const emailTemplateCrudAdminCreateSchema = yupObject({
|
|
16
|
-
type: yupString().oneOf(emailTemplateTypes).
|
|
17
|
-
content: jsonSchema.
|
|
18
|
-
subject: yupString().
|
|
19
|
-
}).
|
|
16
|
+
type: yupString().oneOf(emailTemplateTypes).defined(),
|
|
17
|
+
content: jsonSchema.defined(),
|
|
18
|
+
subject: yupString().defined(),
|
|
19
|
+
}).defined();
|
|
20
20
|
export const emailTemplateCrud = createCrud({
|
|
21
21
|
adminReadSchema: emailTemplateAdminReadSchema,
|
|
22
22
|
adminUpdateSchema: emailTemplateCrudAdminUpdateSchema,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createCrud } from "../../crud";
|
|
2
2
|
import { yupObject, yupString } from "../../schema-fields";
|
|
3
3
|
export const connectedAccountAccessTokenReadSchema = yupObject({
|
|
4
|
-
access_token: yupString().
|
|
5
|
-
}).
|
|
4
|
+
access_token: yupString().defined(),
|
|
5
|
+
}).defined();
|
|
6
6
|
export const connectedAccountAccessTokenCreateSchema = yupObject({
|
|
7
7
|
scope: yupString().optional(),
|
|
8
|
-
}).
|
|
8
|
+
}).defined();
|
|
9
9
|
export const connectedAccountAccessTokenCrud = createCrud({
|
|
10
10
|
clientReadSchema: connectedAccountAccessTokenReadSchema,
|
|
11
11
|
clientCreateSchema: connectedAccountAccessTokenCreateSchema,
|