@stackframe/stack-shared 2.4.23 → 2.4.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/crud.d.ts +2 -2
- package/dist/interface/clientInterface.d.ts +4 -0
- package/dist/interface/clientInterface.js +10 -0
- package/dist/interface/crud/current-user.d.ts +94 -152
- package/dist/interface/crud/current-user.js +1 -0
- package/dist/interface/crud/email-templates.d.ts +27 -86
- package/dist/interface/crud/fields.d.ts +11 -0
- package/dist/interface/crud/fields.js +12 -0
- package/dist/interface/crud/oauth.d.ts +12 -48
- package/dist/interface/crud/users.d.ts +60 -121
- package/dist/interface/crud/users.js +24 -25
- package/dist/interface/serverInterface.d.ts +3 -1
- package/dist/known-errors.d.ts +3 -0
- package/dist/known-errors.js +5 -0
- package/dist/utils/react.js +6 -6
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @stackframe/stack-shared
|
|
2
2
|
|
|
3
|
+
## 2.4.25
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Docs update
|
|
8
|
+
- @stackframe/stack-sc@2.4.25
|
|
9
|
+
|
|
10
|
+
## 2.4.24
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Team switcher
|
|
15
|
+
- @stackframe/stack-sc@2.4.24
|
|
16
|
+
|
|
3
17
|
## 2.4.23
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/crud.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type CrudSchema<ClientSchema extends InnerCrudSchema = InnerCrudSchema, S
|
|
|
16
16
|
hasUpdate: boolean;
|
|
17
17
|
hasDelete: boolean;
|
|
18
18
|
};
|
|
19
|
-
type CrudSchemaCreationOptions = {
|
|
19
|
+
export type CrudSchemaCreationOptions = {
|
|
20
20
|
clientCreateSchema?: yup.Schema<any>;
|
|
21
21
|
clientReadSchema?: yup.Schema<any>;
|
|
22
22
|
clientUpdateSchema?: yup.Schema<any>;
|
|
@@ -49,7 +49,7 @@ type FillInOptionalsStep<O extends FillInOptionalsPrepareStep<CrudSchemaCreation
|
|
|
49
49
|
};
|
|
50
50
|
type FillInOptionals<O extends CrudSchemaCreationOptions> = FillInOptionalsStep<FillInOptionalsStep<FillInOptionalsStep<FillInOptionalsPrepareStep<O>>>>;
|
|
51
51
|
type CrudSchemaFromOptionsInner<O extends FillInOptionals<any>> = CrudSchema<InnerCrudSchema<O['clientCreateSchema'], O['clientReadSchema'], O['clientUpdateSchema'], O['clientDeleteSchema']>, InnerCrudSchema<O['serverCreateSchema'], O['serverReadSchema'], O['serverUpdateSchema'], O['serverDeleteSchema']>, InnerCrudSchema<O['adminCreateSchema'], O['adminReadSchema'], O['adminUpdateSchema'], O['adminDeleteSchema']>>;
|
|
52
|
-
type CrudSchemaFromOptions<O extends CrudSchemaCreationOptions> = CrudSchemaFromOptionsInner<FillInOptionals<O>>;
|
|
52
|
+
export type CrudSchemaFromOptions<O extends CrudSchemaCreationOptions> = CrudSchemaFromOptionsInner<FillInOptionals<O>>;
|
|
53
53
|
type InnerCrudTypeOf<S extends InnerCrudSchema> = (S['createSchema'] extends {} ? {
|
|
54
54
|
Create: yup.InferType<S['createSchema']>;
|
|
55
55
|
} : {}) & (S['readSchema'] extends {} ? {
|
|
@@ -25,6 +25,7 @@ export type UserJson = UserCustomizableJson & {
|
|
|
25
25
|
authWithEmail: boolean;
|
|
26
26
|
oauthProviders: string[];
|
|
27
27
|
selectedTeamId: string | null;
|
|
28
|
+
selectedTeam: TeamJson | null;
|
|
28
29
|
};
|
|
29
30
|
export type UserUpdateJson = Partial<UserCustomizableJson>;
|
|
30
31
|
export type ClientProjectJson = {
|
|
@@ -143,6 +144,9 @@ export declare class StackClientInterface {
|
|
|
143
144
|
}, InstanceType<E>>>;
|
|
144
145
|
private sendClientRequestInner;
|
|
145
146
|
private _processResponse;
|
|
147
|
+
checkFeatureSupport(options: {
|
|
148
|
+
featureName?: string;
|
|
149
|
+
} & ReadonlyJson): Promise<never>;
|
|
146
150
|
sendForgotPasswordEmail(email: string, redirectUrl: string): Promise<KnownErrors["UserNotFound"] | undefined>;
|
|
147
151
|
sendVerificationEmail(emailVerificationRedirectUrl: string, session: InternalSession): Promise<KnownErrors["EmailAlreadyVerified"] | undefined>;
|
|
148
152
|
sendMagicLinkEmail(email: string, redirectUrl: string): Promise<KnownErrors["RedirectUrlNotWhitelisted"] | undefined>;
|
|
@@ -231,6 +231,16 @@ export class StackClientInterface {
|
|
|
231
231
|
}
|
|
232
232
|
return Result.ok(res);
|
|
233
233
|
}
|
|
234
|
+
async checkFeatureSupport(options) {
|
|
235
|
+
const res = await this.sendClientRequest("/check-feature-support", {
|
|
236
|
+
method: "POST",
|
|
237
|
+
headers: {
|
|
238
|
+
"Content-Type": "application/json",
|
|
239
|
+
},
|
|
240
|
+
body: JSON.stringify(options),
|
|
241
|
+
}, null);
|
|
242
|
+
throw new StackAssertionError(await res.text());
|
|
243
|
+
}
|
|
234
244
|
async sendForgotPasswordEmail(email, redirectUrl) {
|
|
235
245
|
const res = await this.sendClientRequestAndCatchKnownError("/auth/forgot-password", {
|
|
236
246
|
method: "POST",
|
|
@@ -1,155 +1,97 @@
|
|
|
1
1
|
import { CrudTypeOf } from "../../crud";
|
|
2
2
|
import * as yup from "yup";
|
|
3
|
-
export declare const currentUserCrud: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}, "">;
|
|
98
|
-
deleteSchema: undefined;
|
|
99
|
-
};
|
|
100
|
-
admin: {
|
|
101
|
-
createSchema: undefined;
|
|
102
|
-
readSchema: yup.ObjectSchema<{
|
|
103
|
-
projectId: string;
|
|
104
|
-
id: string;
|
|
105
|
-
primaryEmail: string | null;
|
|
106
|
-
primaryEmailVerified: NonNullable<boolean | undefined>;
|
|
107
|
-
displayName: string | null;
|
|
108
|
-
clientMetadata: {} | null;
|
|
109
|
-
selectedTeamId: string | null;
|
|
110
|
-
profileImageUrl: string | null;
|
|
111
|
-
signedUpAtMillis: number;
|
|
112
|
-
authMethod: NonNullable<"credential" | "oauth" | undefined>;
|
|
113
|
-
hasPassword: NonNullable<boolean | undefined>;
|
|
114
|
-
authWithEmail: NonNullable<boolean | undefined>;
|
|
115
|
-
oauthProviders: string[];
|
|
116
|
-
serverMetadata: {} | null;
|
|
117
|
-
} | null, yup.AnyObject, {
|
|
118
|
-
projectId: undefined;
|
|
119
|
-
id: undefined;
|
|
120
|
-
primaryEmail: undefined;
|
|
121
|
-
primaryEmailVerified: undefined;
|
|
122
|
-
displayName: undefined;
|
|
123
|
-
clientMetadata: undefined;
|
|
124
|
-
selectedTeamId: undefined;
|
|
125
|
-
profileImageUrl: undefined;
|
|
126
|
-
signedUpAtMillis: undefined;
|
|
127
|
-
authMethod: undefined;
|
|
128
|
-
hasPassword: undefined;
|
|
129
|
-
authWithEmail: undefined;
|
|
130
|
-
oauthProviders: undefined;
|
|
131
|
-
serverMetadata: undefined;
|
|
132
|
-
}, "">;
|
|
133
|
-
updateSchema: yup.ObjectSchema<{
|
|
134
|
-
displayName: string | undefined;
|
|
135
|
-
clientMetadata: {} | undefined;
|
|
136
|
-
serverMetadata: {} | undefined;
|
|
137
|
-
primaryEmail: string | undefined;
|
|
138
|
-
primaryEmailVerified: boolean | undefined;
|
|
139
|
-
selectedTeamId: string | null | undefined;
|
|
140
|
-
}, yup.AnyObject, {
|
|
141
|
-
displayName: undefined;
|
|
142
|
-
clientMetadata: {};
|
|
143
|
-
serverMetadata: {};
|
|
144
|
-
primaryEmail: undefined;
|
|
145
|
-
primaryEmailVerified: undefined;
|
|
146
|
-
selectedTeamId: undefined;
|
|
147
|
-
}, "">;
|
|
148
|
-
deleteSchema: undefined;
|
|
149
|
-
};
|
|
150
|
-
hasCreate: boolean;
|
|
151
|
-
hasRead: boolean;
|
|
152
|
-
hasUpdate: boolean;
|
|
153
|
-
hasDelete: boolean;
|
|
154
|
-
};
|
|
3
|
+
export declare const currentUserCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
4
|
+
clientReadSchema: yup.ObjectSchema<{
|
|
5
|
+
displayName: string | null;
|
|
6
|
+
id: string;
|
|
7
|
+
projectId: string;
|
|
8
|
+
clientMetadata: {} | null;
|
|
9
|
+
primaryEmail: string | null;
|
|
10
|
+
primaryEmailVerified: NonNullable<boolean | undefined>;
|
|
11
|
+
selectedTeamId: string | null;
|
|
12
|
+
selectedTeam: {} | null;
|
|
13
|
+
profileImageUrl: string | null;
|
|
14
|
+
signedUpAtMillis: number;
|
|
15
|
+
authMethod: NonNullable<"credential" | "oauth" | undefined>;
|
|
16
|
+
hasPassword: NonNullable<boolean | undefined>;
|
|
17
|
+
authWithEmail: NonNullable<boolean | undefined>;
|
|
18
|
+
oauthProviders: string[];
|
|
19
|
+
} | null, yup.AnyObject, {
|
|
20
|
+
projectId: undefined;
|
|
21
|
+
id: undefined;
|
|
22
|
+
primaryEmail: undefined;
|
|
23
|
+
primaryEmailVerified: undefined;
|
|
24
|
+
displayName: undefined;
|
|
25
|
+
selectedTeam: undefined;
|
|
26
|
+
selectedTeamId: undefined;
|
|
27
|
+
profileImageUrl: undefined;
|
|
28
|
+
signedUpAtMillis: undefined;
|
|
29
|
+
authMethod: undefined;
|
|
30
|
+
hasPassword: undefined;
|
|
31
|
+
authWithEmail: undefined;
|
|
32
|
+
oauthProviders: undefined;
|
|
33
|
+
clientMetadata: undefined;
|
|
34
|
+
serverMetadata: undefined;
|
|
35
|
+
}, "">;
|
|
36
|
+
serverReadSchema: yup.ObjectSchema<{
|
|
37
|
+
projectId: string;
|
|
38
|
+
id: string;
|
|
39
|
+
primaryEmail: string | null;
|
|
40
|
+
primaryEmailVerified: NonNullable<boolean | undefined>;
|
|
41
|
+
displayName: string | null;
|
|
42
|
+
selectedTeam: {} | null;
|
|
43
|
+
selectedTeamId: string | null;
|
|
44
|
+
profileImageUrl: string | null;
|
|
45
|
+
signedUpAtMillis: number;
|
|
46
|
+
authMethod: NonNullable<"credential" | "oauth" | undefined>;
|
|
47
|
+
hasPassword: NonNullable<boolean | undefined>;
|
|
48
|
+
authWithEmail: NonNullable<boolean | undefined>;
|
|
49
|
+
oauthProviders: string[];
|
|
50
|
+
clientMetadata: {} | null;
|
|
51
|
+
serverMetadata: {} | null;
|
|
52
|
+
} | null, yup.AnyObject, {
|
|
53
|
+
projectId: undefined;
|
|
54
|
+
id: undefined;
|
|
55
|
+
primaryEmail: undefined;
|
|
56
|
+
primaryEmailVerified: undefined;
|
|
57
|
+
displayName: undefined;
|
|
58
|
+
selectedTeam: undefined;
|
|
59
|
+
selectedTeamId: undefined;
|
|
60
|
+
profileImageUrl: undefined;
|
|
61
|
+
signedUpAtMillis: undefined;
|
|
62
|
+
authMethod: undefined;
|
|
63
|
+
hasPassword: undefined;
|
|
64
|
+
authWithEmail: undefined;
|
|
65
|
+
oauthProviders: undefined;
|
|
66
|
+
clientMetadata: undefined;
|
|
67
|
+
serverMetadata: undefined;
|
|
68
|
+
}, "">;
|
|
69
|
+
clientUpdateSchema: yup.ObjectSchema<{
|
|
70
|
+
displayName: string | undefined;
|
|
71
|
+
clientMetadata: {} | null | undefined;
|
|
72
|
+
selectedTeamId: string | null | undefined;
|
|
73
|
+
}, yup.AnyObject, {
|
|
74
|
+
displayName: undefined;
|
|
75
|
+
clientMetadata: undefined;
|
|
76
|
+
serverMetadata: undefined;
|
|
77
|
+
primaryEmail: undefined;
|
|
78
|
+
primaryEmailVerified: undefined;
|
|
79
|
+
selectedTeamId: undefined;
|
|
80
|
+
}, "">;
|
|
81
|
+
serverUpdateSchema: yup.ObjectSchema<{
|
|
82
|
+
displayName: string | undefined;
|
|
83
|
+
clientMetadata: {} | null | undefined;
|
|
84
|
+
serverMetadata: {} | null | undefined;
|
|
85
|
+
primaryEmail: string | null | undefined;
|
|
86
|
+
primaryEmailVerified: boolean | undefined;
|
|
87
|
+
selectedTeamId: string | null | undefined;
|
|
88
|
+
}, yup.AnyObject, {
|
|
89
|
+
displayName: undefined;
|
|
90
|
+
clientMetadata: undefined;
|
|
91
|
+
serverMetadata: undefined;
|
|
92
|
+
primaryEmail: undefined;
|
|
93
|
+
primaryEmailVerified: undefined;
|
|
94
|
+
selectedTeamId: undefined;
|
|
95
|
+
}, "">;
|
|
96
|
+
}>;
|
|
155
97
|
export type CurrentUserCrud = CrudTypeOf<typeof currentUserCrud>;
|
|
@@ -20,6 +20,7 @@ const clientReadSchema = usersCrudServerReadSchema.pick([
|
|
|
20
20
|
"authWithEmail",
|
|
21
21
|
"oauthProviders",
|
|
22
22
|
"selectedTeamId",
|
|
23
|
+
"selectedTeam",
|
|
23
24
|
]).nullable().defined();
|
|
24
25
|
const serverReadSchema = usersCrudServerReadSchema.nullable().defined();
|
|
25
26
|
export const currentUserCrud = createCrud({
|
|
@@ -16,58 +16,25 @@ export declare const emailTemplateCrudServerUpdateSchema: yup.ObjectSchema<{
|
|
|
16
16
|
content: undefined;
|
|
17
17
|
subject: undefined;
|
|
18
18
|
}, "">;
|
|
19
|
-
export declare const emailTemplateCrud: {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
content: {};
|
|
39
|
-
subject: string;
|
|
40
|
-
}, yup.AnyObject, {
|
|
41
|
-
content: undefined;
|
|
42
|
-
subject: undefined;
|
|
43
|
-
}, "">;
|
|
44
|
-
deleteSchema: yup.MixedSchema<{} | undefined, yup.AnyObject, undefined, "">;
|
|
45
|
-
};
|
|
46
|
-
admin: {
|
|
47
|
-
createSchema: undefined;
|
|
48
|
-
readSchema: yup.ObjectSchema<{
|
|
49
|
-
type: NonNullable<"EMAIL_VERIFICATION" | "PASSWORD_RESET" | "MAGIC_LINK" | undefined>;
|
|
50
|
-
subject: string;
|
|
51
|
-
content: {};
|
|
52
|
-
}, yup.AnyObject, {
|
|
53
|
-
type: undefined;
|
|
54
|
-
subject: undefined;
|
|
55
|
-
content: undefined;
|
|
56
|
-
}, "">;
|
|
57
|
-
updateSchema: yup.ObjectSchema<{
|
|
58
|
-
content: {};
|
|
59
|
-
subject: string;
|
|
60
|
-
}, yup.AnyObject, {
|
|
61
|
-
content: undefined;
|
|
62
|
-
subject: undefined;
|
|
63
|
-
}, "">;
|
|
64
|
-
deleteSchema: yup.MixedSchema<{} | undefined, yup.AnyObject, undefined, "">;
|
|
65
|
-
};
|
|
66
|
-
hasCreate: boolean;
|
|
67
|
-
hasRead: boolean;
|
|
68
|
-
hasUpdate: boolean;
|
|
69
|
-
hasDelete: boolean;
|
|
70
|
-
};
|
|
19
|
+
export declare const emailTemplateCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
20
|
+
serverReadSchema: yup.ObjectSchema<{
|
|
21
|
+
type: NonNullable<"EMAIL_VERIFICATION" | "PASSWORD_RESET" | "MAGIC_LINK" | undefined>;
|
|
22
|
+
subject: string;
|
|
23
|
+
content: {};
|
|
24
|
+
}, yup.AnyObject, {
|
|
25
|
+
type: undefined;
|
|
26
|
+
subject: undefined;
|
|
27
|
+
content: undefined;
|
|
28
|
+
}, "">;
|
|
29
|
+
serverUpdateSchema: yup.ObjectSchema<{
|
|
30
|
+
content: {};
|
|
31
|
+
subject: string;
|
|
32
|
+
}, yup.AnyObject, {
|
|
33
|
+
content: undefined;
|
|
34
|
+
subject: undefined;
|
|
35
|
+
}, "">;
|
|
36
|
+
serverDeleteSchema: yup.MixedSchema<{} | undefined, yup.AnyObject, undefined, "">;
|
|
37
|
+
}>;
|
|
71
38
|
export type EmailTemplateCrud = CrudTypeOf<typeof emailTemplateCrud>;
|
|
72
39
|
export declare const listEmailTemplatesReadSchema: yup.ArraySchema<{
|
|
73
40
|
type: NonNullable<"EMAIL_VERIFICATION" | "PASSWORD_RESET" | "MAGIC_LINK" | undefined>;
|
|
@@ -82,38 +49,12 @@ export declare const emailTemplateCrudServerCreateSchema: yup.ObjectSchema<{
|
|
|
82
49
|
type: undefined;
|
|
83
50
|
content: undefined;
|
|
84
51
|
}, "">;
|
|
85
|
-
export declare const listEmailTemplatesCrud: {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
createSchema: undefined;
|
|
94
|
-
readSchema: yup.ArraySchema<{
|
|
95
|
-
type: NonNullable<"EMAIL_VERIFICATION" | "PASSWORD_RESET" | "MAGIC_LINK" | undefined>;
|
|
96
|
-
default: NonNullable<boolean | undefined>;
|
|
97
|
-
subject: string;
|
|
98
|
-
content: {};
|
|
99
|
-
}[], yup.AnyObject, "", "">;
|
|
100
|
-
updateSchema: undefined;
|
|
101
|
-
deleteSchema: undefined;
|
|
102
|
-
};
|
|
103
|
-
admin: {
|
|
104
|
-
createSchema: undefined;
|
|
105
|
-
readSchema: yup.ArraySchema<{
|
|
106
|
-
type: NonNullable<"EMAIL_VERIFICATION" | "PASSWORD_RESET" | "MAGIC_LINK" | undefined>;
|
|
107
|
-
default: NonNullable<boolean | undefined>;
|
|
108
|
-
subject: string;
|
|
109
|
-
content: {};
|
|
110
|
-
}[], yup.AnyObject, "", "">;
|
|
111
|
-
updateSchema: undefined;
|
|
112
|
-
deleteSchema: undefined;
|
|
113
|
-
};
|
|
114
|
-
hasCreate: boolean;
|
|
115
|
-
hasRead: boolean;
|
|
116
|
-
hasUpdate: boolean;
|
|
117
|
-
hasDelete: boolean;
|
|
118
|
-
};
|
|
52
|
+
export declare const listEmailTemplatesCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
53
|
+
serverReadSchema: yup.ArraySchema<{
|
|
54
|
+
type: NonNullable<"EMAIL_VERIFICATION" | "PASSWORD_RESET" | "MAGIC_LINK" | undefined>;
|
|
55
|
+
default: NonNullable<boolean | undefined>;
|
|
56
|
+
subject: string;
|
|
57
|
+
content: {};
|
|
58
|
+
}[], yup.AnyObject, "", "">;
|
|
59
|
+
}>;
|
|
119
60
|
export type ListEmailTemplatesCrud = CrudTypeOf<typeof listEmailTemplatesCrud>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as yup from "yup";
|
|
2
|
+
export declare const projectIdSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
3
|
+
export declare const userIdSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
4
|
+
export declare const primaryEmailSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
5
|
+
export declare const primaryEmailVerifiedSchema: yup.BooleanSchema<boolean | undefined, yup.AnyObject, undefined, "">;
|
|
6
|
+
export declare const userDisplayNameSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
7
|
+
export declare const selectedTeamIdSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
8
|
+
export declare const profileImageUrlSchema: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
|
|
9
|
+
export declare const signedUpAtMillisSchema: yup.NumberSchema<number | undefined, yup.AnyObject, undefined, "">;
|
|
10
|
+
export declare const userClientMetadataSchema: yup.MixedSchema<{} | null, yup.AnyObject, undefined, "">;
|
|
11
|
+
export declare const userServerMetadataSchema: yup.MixedSchema<{} | null, yup.AnyObject, undefined, "">;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as yup from "yup";
|
|
2
|
+
import { yupJson } from "../../utils/yup";
|
|
3
|
+
export const projectIdSchema = yup.string().meta({ description: 'Stack dashboard project ID', example: 'project-id' });
|
|
4
|
+
export const userIdSchema = yup.string().meta({ description: 'Unique user identifier', example: 'user-id' });
|
|
5
|
+
export const primaryEmailSchema = yup.string().meta({ description: 'Primary email', example: 'johndoe@email.com' });
|
|
6
|
+
export const primaryEmailVerifiedSchema = yup.boolean().meta({ description: 'Primary email verified', example: true });
|
|
7
|
+
export const userDisplayNameSchema = yup.string().meta({ description: 'User display name', example: 'John Doe' });
|
|
8
|
+
export const selectedTeamIdSchema = yup.string().meta({ description: 'Selected team ID', example: 'team-id' });
|
|
9
|
+
export const profileImageUrlSchema = yup.string().meta({ description: 'Profile image URL', example: 'https://example.com/image.jpg' });
|
|
10
|
+
export const signedUpAtMillisSchema = yup.number().meta({ description: 'Signed up at milliseconds', example: 1630000000000 });
|
|
11
|
+
export const userClientMetadataSchema = yupJson.meta({ description: 'Client metadata. Used as a data store, accessible from the client side', example: { key: 'value' } });
|
|
12
|
+
export const userServerMetadataSchema = yupJson.meta({ description: 'Server metadata. Used as a data store, only accessible from the server side', example: { key: 'value' } });
|
|
@@ -10,52 +10,16 @@ export declare const accessTokenCreateSchema: yup.ObjectSchema<{
|
|
|
10
10
|
}, yup.AnyObject, {
|
|
11
11
|
scope: undefined;
|
|
12
12
|
}, "">;
|
|
13
|
-
export declare const accessTokenCrud: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
updateSchema: undefined;
|
|
26
|
-
deleteSchema: undefined;
|
|
27
|
-
};
|
|
28
|
-
server: {
|
|
29
|
-
createSchema: yup.ObjectSchema<{
|
|
30
|
-
scope: string | undefined;
|
|
31
|
-
}, yup.AnyObject, {
|
|
32
|
-
scope: undefined;
|
|
33
|
-
}, "">;
|
|
34
|
-
readSchema: yup.ObjectSchema<{
|
|
35
|
-
accessToken: string;
|
|
36
|
-
}, yup.AnyObject, {
|
|
37
|
-
accessToken: undefined;
|
|
38
|
-
}, "">;
|
|
39
|
-
updateSchema: undefined;
|
|
40
|
-
deleteSchema: undefined;
|
|
41
|
-
};
|
|
42
|
-
admin: {
|
|
43
|
-
createSchema: yup.ObjectSchema<{
|
|
44
|
-
scope: string | undefined;
|
|
45
|
-
}, yup.AnyObject, {
|
|
46
|
-
scope: undefined;
|
|
47
|
-
}, "">;
|
|
48
|
-
readSchema: yup.ObjectSchema<{
|
|
49
|
-
accessToken: string;
|
|
50
|
-
}, yup.AnyObject, {
|
|
51
|
-
accessToken: undefined;
|
|
52
|
-
}, "">;
|
|
53
|
-
updateSchema: undefined;
|
|
54
|
-
deleteSchema: undefined;
|
|
55
|
-
};
|
|
56
|
-
hasCreate: boolean;
|
|
57
|
-
hasRead: boolean;
|
|
58
|
-
hasUpdate: boolean;
|
|
59
|
-
hasDelete: boolean;
|
|
60
|
-
};
|
|
13
|
+
export declare const accessTokenCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
14
|
+
clientReadSchema: yup.ObjectSchema<{
|
|
15
|
+
accessToken: string;
|
|
16
|
+
}, yup.AnyObject, {
|
|
17
|
+
accessToken: undefined;
|
|
18
|
+
}, "">;
|
|
19
|
+
clientCreateSchema: yup.ObjectSchema<{
|
|
20
|
+
scope: string | undefined;
|
|
21
|
+
}, yup.AnyObject, {
|
|
22
|
+
scope: undefined;
|
|
23
|
+
}, "">;
|
|
24
|
+
}>;
|
|
61
25
|
export type AccessTokenCrud = CrudTypeOf<typeof accessTokenCrud>;
|
|
@@ -2,15 +2,15 @@ import { CrudTypeOf } from "../../crud";
|
|
|
2
2
|
import * as yup from "yup";
|
|
3
3
|
export declare const usersCrudServerUpdateSchema: yup.ObjectSchema<{
|
|
4
4
|
displayName: string | undefined;
|
|
5
|
-
clientMetadata: {} | undefined;
|
|
6
|
-
serverMetadata: {} | undefined;
|
|
7
|
-
primaryEmail: string | undefined;
|
|
5
|
+
clientMetadata: {} | null | undefined;
|
|
6
|
+
serverMetadata: {} | null | undefined;
|
|
7
|
+
primaryEmail: string | null | undefined;
|
|
8
8
|
primaryEmailVerified: boolean | undefined;
|
|
9
9
|
selectedTeamId: string | null | undefined;
|
|
10
10
|
}, yup.AnyObject, {
|
|
11
11
|
displayName: undefined;
|
|
12
|
-
clientMetadata:
|
|
13
|
-
serverMetadata:
|
|
12
|
+
clientMetadata: undefined;
|
|
13
|
+
serverMetadata: undefined;
|
|
14
14
|
primaryEmail: undefined;
|
|
15
15
|
primaryEmailVerified: undefined;
|
|
16
16
|
selectedTeamId: undefined;
|
|
@@ -21,7 +21,7 @@ export declare const usersCrudServerReadSchema: yup.ObjectSchema<{
|
|
|
21
21
|
primaryEmail: string | null;
|
|
22
22
|
primaryEmailVerified: NonNullable<boolean | undefined>;
|
|
23
23
|
displayName: string | null;
|
|
24
|
-
|
|
24
|
+
selectedTeam: {} | null;
|
|
25
25
|
selectedTeamId: string | null;
|
|
26
26
|
profileImageUrl: string | null;
|
|
27
27
|
signedUpAtMillis: number;
|
|
@@ -29,6 +29,7 @@ export declare const usersCrudServerReadSchema: yup.ObjectSchema<{
|
|
|
29
29
|
hasPassword: NonNullable<boolean | undefined>;
|
|
30
30
|
authWithEmail: NonNullable<boolean | undefined>;
|
|
31
31
|
oauthProviders: string[];
|
|
32
|
+
clientMetadata: {} | null;
|
|
32
33
|
serverMetadata: {} | null;
|
|
33
34
|
}, yup.AnyObject, {
|
|
34
35
|
projectId: undefined;
|
|
@@ -36,7 +37,7 @@ export declare const usersCrudServerReadSchema: yup.ObjectSchema<{
|
|
|
36
37
|
primaryEmail: undefined;
|
|
37
38
|
primaryEmailVerified: undefined;
|
|
38
39
|
displayName: undefined;
|
|
39
|
-
|
|
40
|
+
selectedTeam: undefined;
|
|
40
41
|
selectedTeamId: undefined;
|
|
41
42
|
profileImageUrl: undefined;
|
|
42
43
|
signedUpAtMillis: undefined;
|
|
@@ -44,120 +45,58 @@ export declare const usersCrudServerReadSchema: yup.ObjectSchema<{
|
|
|
44
45
|
hasPassword: undefined;
|
|
45
46
|
authWithEmail: undefined;
|
|
46
47
|
oauthProviders: undefined;
|
|
48
|
+
clientMetadata: undefined;
|
|
47
49
|
serverMetadata: undefined;
|
|
48
50
|
}, "">;
|
|
49
|
-
export declare const usersCrud: {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
primaryEmail: undefined;
|
|
101
|
-
primaryEmailVerified: undefined;
|
|
102
|
-
selectedTeamId: undefined;
|
|
103
|
-
}, "">;
|
|
104
|
-
deleteSchema: yup.MixedSchema<{} | undefined, yup.AnyObject, undefined, "">;
|
|
105
|
-
}; /**
|
|
106
|
-
* not used anymore, for backwards compatibility
|
|
107
|
-
*/
|
|
108
|
-
admin: {
|
|
109
|
-
createSchema: undefined;
|
|
110
|
-
readSchema: yup.ObjectSchema<{
|
|
111
|
-
projectId: string;
|
|
112
|
-
id: string;
|
|
113
|
-
primaryEmail: string | null;
|
|
114
|
-
primaryEmailVerified: NonNullable<boolean | undefined>;
|
|
115
|
-
displayName: string | null;
|
|
116
|
-
clientMetadata: {} | null;
|
|
117
|
-
selectedTeamId: string | null;
|
|
118
|
-
profileImageUrl: string | null;
|
|
119
|
-
signedUpAtMillis: number;
|
|
120
|
-
authMethod: NonNullable<"credential" | "oauth" | undefined>;
|
|
121
|
-
hasPassword: NonNullable<boolean | undefined>;
|
|
122
|
-
authWithEmail: NonNullable<boolean | undefined>;
|
|
123
|
-
oauthProviders: string[];
|
|
124
|
-
serverMetadata: {} | null;
|
|
125
|
-
}, yup.AnyObject, {
|
|
126
|
-
projectId: undefined;
|
|
127
|
-
id: undefined;
|
|
128
|
-
primaryEmail: undefined;
|
|
129
|
-
primaryEmailVerified: undefined;
|
|
130
|
-
displayName: undefined;
|
|
131
|
-
clientMetadata: undefined;
|
|
132
|
-
selectedTeamId: undefined;
|
|
133
|
-
profileImageUrl: undefined;
|
|
134
|
-
signedUpAtMillis: undefined;
|
|
135
|
-
authMethod: undefined;
|
|
136
|
-
hasPassword: undefined;
|
|
137
|
-
authWithEmail: undefined;
|
|
138
|
-
oauthProviders: undefined;
|
|
139
|
-
serverMetadata: undefined;
|
|
140
|
-
}, "">;
|
|
141
|
-
updateSchema: yup.ObjectSchema<{
|
|
142
|
-
displayName: string | undefined;
|
|
143
|
-
clientMetadata: {} | undefined;
|
|
144
|
-
serverMetadata: {} | undefined;
|
|
145
|
-
primaryEmail: string | undefined;
|
|
146
|
-
primaryEmailVerified: boolean | undefined;
|
|
147
|
-
selectedTeamId: string | null | undefined;
|
|
148
|
-
}, yup.AnyObject, {
|
|
149
|
-
displayName: undefined;
|
|
150
|
-
clientMetadata: {};
|
|
151
|
-
serverMetadata: {};
|
|
152
|
-
primaryEmail: undefined;
|
|
153
|
-
primaryEmailVerified: undefined;
|
|
154
|
-
selectedTeamId: undefined;
|
|
155
|
-
}, "">;
|
|
156
|
-
deleteSchema: yup.MixedSchema<{} | undefined, yup.AnyObject, undefined, "">;
|
|
157
|
-
};
|
|
158
|
-
hasCreate: boolean;
|
|
159
|
-
hasRead: boolean;
|
|
160
|
-
hasUpdate: boolean;
|
|
161
|
-
hasDelete: boolean;
|
|
162
|
-
};
|
|
51
|
+
export declare const usersCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
52
|
+
serverReadSchema: yup.ObjectSchema<{
|
|
53
|
+
projectId: string;
|
|
54
|
+
id: string;
|
|
55
|
+
primaryEmail: string | null;
|
|
56
|
+
primaryEmailVerified: NonNullable<boolean | undefined>;
|
|
57
|
+
displayName: string | null;
|
|
58
|
+
selectedTeam: {} | null;
|
|
59
|
+
selectedTeamId: string | null;
|
|
60
|
+
profileImageUrl: string | null;
|
|
61
|
+
signedUpAtMillis: number;
|
|
62
|
+
authMethod: NonNullable<"credential" | "oauth" | undefined>;
|
|
63
|
+
hasPassword: NonNullable<boolean | undefined>;
|
|
64
|
+
authWithEmail: NonNullable<boolean | undefined>;
|
|
65
|
+
oauthProviders: string[];
|
|
66
|
+
clientMetadata: {} | null;
|
|
67
|
+
serverMetadata: {} | null;
|
|
68
|
+
}, yup.AnyObject, {
|
|
69
|
+
projectId: undefined;
|
|
70
|
+
id: undefined;
|
|
71
|
+
primaryEmail: undefined;
|
|
72
|
+
primaryEmailVerified: undefined;
|
|
73
|
+
displayName: undefined;
|
|
74
|
+
selectedTeam: undefined;
|
|
75
|
+
selectedTeamId: undefined;
|
|
76
|
+
profileImageUrl: undefined;
|
|
77
|
+
signedUpAtMillis: undefined;
|
|
78
|
+
authMethod: undefined;
|
|
79
|
+
hasPassword: undefined;
|
|
80
|
+
authWithEmail: undefined;
|
|
81
|
+
oauthProviders: undefined;
|
|
82
|
+
clientMetadata: undefined;
|
|
83
|
+
serverMetadata: undefined;
|
|
84
|
+
}, "">;
|
|
85
|
+
serverUpdateSchema: yup.ObjectSchema<{
|
|
86
|
+
displayName: string | undefined;
|
|
87
|
+
clientMetadata: {} | null | undefined;
|
|
88
|
+
serverMetadata: {} | null | undefined;
|
|
89
|
+
primaryEmail: string | null | undefined;
|
|
90
|
+
primaryEmailVerified: boolean | undefined;
|
|
91
|
+
selectedTeamId: string | null | undefined;
|
|
92
|
+
}, yup.AnyObject, {
|
|
93
|
+
displayName: undefined;
|
|
94
|
+
clientMetadata: undefined;
|
|
95
|
+
serverMetadata: undefined;
|
|
96
|
+
primaryEmail: undefined;
|
|
97
|
+
primaryEmailVerified: undefined;
|
|
98
|
+
selectedTeamId: undefined;
|
|
99
|
+
}, "">;
|
|
100
|
+
serverDeleteSchema: yup.MixedSchema<{} | undefined, yup.AnyObject, undefined, "">;
|
|
101
|
+
}>;
|
|
163
102
|
export type UsersCrud = CrudTypeOf<typeof usersCrud>;
|
|
@@ -1,36 +1,35 @@
|
|
|
1
1
|
import { createCrud } from "../../crud";
|
|
2
2
|
import * as yup from "yup";
|
|
3
|
-
import
|
|
3
|
+
import * as fieldSchema from "./fields";
|
|
4
4
|
export const usersCrudServerUpdateSchema = yup.object({
|
|
5
|
-
displayName:
|
|
6
|
-
clientMetadata:
|
|
7
|
-
serverMetadata:
|
|
8
|
-
primaryEmail:
|
|
9
|
-
primaryEmailVerified:
|
|
10
|
-
selectedTeamId:
|
|
5
|
+
displayName: fieldSchema.userDisplayNameSchema.optional(),
|
|
6
|
+
clientMetadata: fieldSchema.userClientMetadataSchema.optional(),
|
|
7
|
+
serverMetadata: fieldSchema.userServerMetadataSchema.optional(),
|
|
8
|
+
primaryEmail: fieldSchema.primaryEmailSchema.nullable().optional(),
|
|
9
|
+
primaryEmailVerified: fieldSchema.primaryEmailVerifiedSchema.optional(),
|
|
10
|
+
selectedTeamId: fieldSchema.selectedTeamIdSchema.nullable().optional(),
|
|
11
11
|
}).required();
|
|
12
12
|
export const usersCrudServerReadSchema = yup.object({
|
|
13
|
-
projectId:
|
|
14
|
-
id:
|
|
15
|
-
primaryEmail:
|
|
16
|
-
primaryEmailVerified:
|
|
17
|
-
displayName:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
serverMetadata: yupJson,
|
|
13
|
+
projectId: fieldSchema.projectIdSchema.required(),
|
|
14
|
+
id: fieldSchema.userIdSchema.required(),
|
|
15
|
+
primaryEmail: fieldSchema.primaryEmailSchema.nullable().defined(),
|
|
16
|
+
primaryEmailVerified: fieldSchema.primaryEmailVerifiedSchema.required(),
|
|
17
|
+
displayName: fieldSchema.userDisplayNameSchema.nullable().defined(),
|
|
18
|
+
// TODO give this one the type of an actual team
|
|
19
|
+
selectedTeam: yup.mixed().nullable().defined(),
|
|
20
|
+
selectedTeamId: fieldSchema.selectedTeamIdSchema.nullable().defined(),
|
|
21
|
+
profileImageUrl: fieldSchema.profileImageUrlSchema.nullable().defined(),
|
|
22
|
+
signedUpAtMillis: fieldSchema.signedUpAtMillisSchema.required(),
|
|
23
|
+
authMethod: yup.string().oneOf(["credential", "oauth"]).required().meta({ hide: true }), // not used anymore, for backwards compatibility
|
|
24
|
+
hasPassword: yup.boolean().required().meta({ description: 'Whether the user has a password', example: true }),
|
|
25
|
+
authWithEmail: yup.boolean().required().meta({ description: 'Whether the user can authenticate with email (email/password and magic link, depending on the project setting on the dashboard)', example: true }),
|
|
26
|
+
oauthProviders: yup.array(yup.string().required()).required().meta({ description: 'All the OAuth providers connected to this account', example: ['google', 'github'] }),
|
|
27
|
+
clientMetadata: fieldSchema.userClientMetadataSchema,
|
|
28
|
+
serverMetadata: fieldSchema.userServerMetadataSchema,
|
|
30
29
|
}).required();
|
|
31
30
|
const serverDeleteSchema = yup.mixed();
|
|
32
31
|
export const usersCrud = createCrud({
|
|
33
32
|
serverReadSchema: usersCrudServerReadSchema,
|
|
34
33
|
serverUpdateSchema: usersCrudServerUpdateSchema,
|
|
35
|
-
serverDeleteSchema,
|
|
34
|
+
serverDeleteSchema: serverDeleteSchema,
|
|
36
35
|
});
|
|
@@ -15,7 +15,9 @@ export type ServerOrglikeCustomizableJson = Pick<ServerOrglikeJson, "displayName
|
|
|
15
15
|
export type ServerOrglikeJson = OrglikeJson & {};
|
|
16
16
|
export type ServerTeamCustomizableJson = ServerOrglikeCustomizableJson;
|
|
17
17
|
export type ServerTeamJson = ServerOrglikeJson;
|
|
18
|
-
export type ServerTeamMemberJson = TeamMemberJson
|
|
18
|
+
export type ServerTeamMemberJson = TeamMemberJson & {
|
|
19
|
+
user: ServerUserJson;
|
|
20
|
+
};
|
|
19
21
|
export type ServerPermissionDefinitionCustomizableJson = {
|
|
20
22
|
readonly id: string;
|
|
21
23
|
readonly description?: string;
|
package/dist/known-errors.d.ts
CHANGED
|
@@ -263,5 +263,8 @@ export declare const KnownErrors: {
|
|
|
263
263
|
UserAlreadyConnectedToAnotherOAuthConnection: KnownErrorConstructor<KnownError & KnownErrorBrand<"USER_ALREADY_CONNECTED_TO_ANOTHER_OAUTH_CONNECTION">, []> & {
|
|
264
264
|
errorCode: "USER_ALREADY_CONNECTED_TO_ANOTHER_OAUTH_CONNECTION";
|
|
265
265
|
};
|
|
266
|
+
OuterOAuthTimeout: KnownErrorConstructor<KnownError & KnownErrorBrand<"OUTER_OAUTH_TIMEOUT">, []> & {
|
|
267
|
+
errorCode: "OUTER_OAUTH_TIMEOUT";
|
|
268
|
+
};
|
|
266
269
|
};
|
|
267
270
|
export {};
|
package/dist/known-errors.js
CHANGED
|
@@ -365,6 +365,10 @@ const UserAlreadyConnectedToAnotherOAuthConnection = createKnownErrorConstructor
|
|
|
365
365
|
400,
|
|
366
366
|
"The user is already connected to another OAuth account. Did you maybe selected the wrong account?",
|
|
367
367
|
], () => []);
|
|
368
|
+
const OuterOAuthTimeout = createKnownErrorConstructor(KnownError, "OUTER_OAUTH_TIMEOUT", () => [
|
|
369
|
+
408,
|
|
370
|
+
"The OAuth flow has timed out. Please sign in again.",
|
|
371
|
+
], () => []);
|
|
368
372
|
export const KnownErrors = {
|
|
369
373
|
UnsupportedError,
|
|
370
374
|
BodyParsingError,
|
|
@@ -439,6 +443,7 @@ export const KnownErrors = {
|
|
|
439
443
|
OAuthExtraScopeNotAvailableWithSharedOAuthKeys,
|
|
440
444
|
OAuthAccessTokenNotAvailableWithSharedOAuthKeys,
|
|
441
445
|
UserAlreadyConnectedToAnotherOAuthConnection,
|
|
446
|
+
OuterOAuthTimeout,
|
|
442
447
|
};
|
|
443
448
|
// ensure that all known error codes are unique
|
|
444
449
|
const knownErrorCodes = new Set();
|
package/dist/utils/react.js
CHANGED
|
@@ -41,12 +41,12 @@ export function suspendIfSsr(caller) {
|
|
|
41
41
|
2. The component is rendered in the root (outermost) layout.tsx or template.tsx file. Next.js does not wrap those files in a Suspense boundary, even if there is a loading.tsx file in the same folder. To fix it, wrap your layout inside a route group like this:
|
|
42
42
|
|
|
43
43
|
- app
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
- - layout.tsx // contains <html> and <body>, alongside providers and other components that don't need ${caller ?? "this code path"}
|
|
45
|
+
- - loading.tsx // required for suspense
|
|
46
|
+
- - (main)
|
|
47
|
+
- - - layout.tsx // contains the main layout of your app, like a sidebar or a header, and can use ${caller ?? "this code path"}
|
|
48
|
+
- - - route.tsx // your actual main page
|
|
49
|
+
- - - the rest of your app
|
|
50
50
|
|
|
51
51
|
For more information on this approach, see Next's documentation on route groups: https://nextjs.org/docs/app/building-your-application/routing/route-groups
|
|
52
52
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackframe/stack-shared",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.25",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"jose": "^5.2.2",
|
|
37
37
|
"oauth4webapi": "^2.10.3",
|
|
38
38
|
"uuid": "^9.0.1",
|
|
39
|
-
"@stackframe/stack-sc": "2.4.
|
|
39
|
+
"@stackframe/stack-sc": "2.4.25"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"rimraf": "^5.0.5",
|