@stackframe/stack-shared 2.8.2 → 2.8.5
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 +18 -0
- package/dist/config/format.d.ts +38 -0
- package/dist/config/format.js +224 -0
- package/dist/config/schema.d.ts +721 -0
- package/dist/config/schema.js +185 -0
- package/dist/crud.js +1 -1
- package/dist/interface/adminInterface.d.ts +7 -7
- package/dist/interface/adminInterface.js +7 -7
- package/dist/interface/clientInterface.d.ts +46 -4
- package/dist/interface/clientInterface.js +66 -2
- package/dist/interface/crud/current-user.d.ts +2 -2
- package/dist/interface/crud/{api-keys.d.ts → internal-api-keys.d.ts} +7 -7
- package/dist/interface/crud/{api-keys.js → internal-api-keys.js} +10 -10
- package/dist/interface/crud/project-api-keys.d.ts +188 -0
- package/dist/interface/crud/project-api-keys.js +76 -0
- package/dist/interface/crud/projects.d.ts +53 -20
- package/dist/interface/crud/projects.js +15 -5
- package/dist/interface/crud/team-member-profiles.d.ts +4 -4
- package/dist/interface/crud/users.d.ts +8 -8
- package/dist/interface/serverInterface.d.ts +2 -1
- package/dist/interface/serverInterface.js +4 -0
- package/dist/interface/webhooks.d.ts +2 -2
- package/dist/known-errors.d.ts +35 -1
- package/dist/known-errors.js +42 -4
- package/dist/schema-fields.d.ts +6 -5
- package/dist/schema-fields.js +36 -3
- package/dist/utils/api-keys.d.ts +23 -0
- package/dist/utils/api-keys.js +76 -0
- package/dist/utils/bytes.d.ts +3 -0
- package/dist/utils/bytes.js +55 -6
- package/dist/utils/caches.d.ts +10 -10
- package/dist/utils/hashes.d.ts +1 -1
- package/dist/utils/hashes.js +1 -3
- package/dist/utils/objects.d.ts +35 -2
- package/dist/utils/objects.js +128 -0
- package/dist/utils/promises.d.ts +1 -1
- package/dist/utils/promises.js +9 -10
- package/dist/utils/stores.d.ts +6 -6
- package/dist/utils/types.d.ts +17 -0
- package/package.json +2 -1
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import * as yup from "yup";
|
|
2
|
+
import { CrudTypeOf } from "../../crud";
|
|
3
|
+
export declare const userApiKeysCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
4
|
+
clientReadSchema: yup.ObjectSchema<{
|
|
5
|
+
id: string;
|
|
6
|
+
description: string;
|
|
7
|
+
expires_at_millis: number | undefined;
|
|
8
|
+
manually_revoked_at_millis: number | undefined;
|
|
9
|
+
created_at_millis: number;
|
|
10
|
+
is_public: boolean;
|
|
11
|
+
value: {
|
|
12
|
+
last_four: string;
|
|
13
|
+
};
|
|
14
|
+
type: "user";
|
|
15
|
+
user_id: string;
|
|
16
|
+
}, yup.AnyObject, {
|
|
17
|
+
id: undefined;
|
|
18
|
+
description: undefined;
|
|
19
|
+
expires_at_millis: undefined;
|
|
20
|
+
manually_revoked_at_millis: undefined;
|
|
21
|
+
created_at_millis: undefined;
|
|
22
|
+
is_public: undefined;
|
|
23
|
+
value: {
|
|
24
|
+
last_four: undefined;
|
|
25
|
+
};
|
|
26
|
+
type: undefined;
|
|
27
|
+
user_id: undefined;
|
|
28
|
+
}, "">;
|
|
29
|
+
clientUpdateSchema: yup.ObjectSchema<{
|
|
30
|
+
description: string | undefined;
|
|
31
|
+
revoked: boolean | undefined;
|
|
32
|
+
}, yup.AnyObject, {
|
|
33
|
+
description: undefined;
|
|
34
|
+
revoked: undefined;
|
|
35
|
+
}, "">;
|
|
36
|
+
docs: {
|
|
37
|
+
clientCreate: {
|
|
38
|
+
description: string;
|
|
39
|
+
displayName: string;
|
|
40
|
+
summary: string;
|
|
41
|
+
};
|
|
42
|
+
clientList: {
|
|
43
|
+
description: string;
|
|
44
|
+
displayName: string;
|
|
45
|
+
summary: string;
|
|
46
|
+
};
|
|
47
|
+
clientRead: {
|
|
48
|
+
description: string;
|
|
49
|
+
displayName: string;
|
|
50
|
+
summary: string;
|
|
51
|
+
};
|
|
52
|
+
clientUpdate: {
|
|
53
|
+
description: string;
|
|
54
|
+
displayName: string;
|
|
55
|
+
summary: string;
|
|
56
|
+
};
|
|
57
|
+
serverDelete: {
|
|
58
|
+
description: string;
|
|
59
|
+
displayName: string;
|
|
60
|
+
summary: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
}>, userApiKeysCreateInputSchema: yup.ObjectSchema<{
|
|
64
|
+
description: string;
|
|
65
|
+
expires_at_millis: number | null;
|
|
66
|
+
is_public: boolean | undefined;
|
|
67
|
+
user_id: string;
|
|
68
|
+
}, yup.AnyObject, {
|
|
69
|
+
description: undefined;
|
|
70
|
+
expires_at_millis: undefined;
|
|
71
|
+
is_public: undefined;
|
|
72
|
+
user_id: undefined;
|
|
73
|
+
}, "">, userApiKeysCreateOutputSchema: yup.ObjectSchema<{
|
|
74
|
+
id: string;
|
|
75
|
+
type: "user";
|
|
76
|
+
description: string;
|
|
77
|
+
created_at_millis: number;
|
|
78
|
+
expires_at_millis: number | undefined;
|
|
79
|
+
manually_revoked_at_millis: number | undefined;
|
|
80
|
+
user_id: string;
|
|
81
|
+
is_public: boolean;
|
|
82
|
+
} & {
|
|
83
|
+
value: string;
|
|
84
|
+
}, yup.AnyObject, {
|
|
85
|
+
id: undefined;
|
|
86
|
+
description: undefined;
|
|
87
|
+
expires_at_millis: undefined;
|
|
88
|
+
manually_revoked_at_millis: undefined;
|
|
89
|
+
created_at_millis: undefined;
|
|
90
|
+
is_public: undefined;
|
|
91
|
+
value: undefined;
|
|
92
|
+
type: undefined;
|
|
93
|
+
user_id: undefined;
|
|
94
|
+
}, "">;
|
|
95
|
+
export type UserApiKeysCrud = CrudTypeOf<typeof userApiKeysCrud>;
|
|
96
|
+
export declare const teamApiKeysCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
97
|
+
clientReadSchema: yup.ObjectSchema<{
|
|
98
|
+
id: string;
|
|
99
|
+
description: string;
|
|
100
|
+
expires_at_millis: number | undefined;
|
|
101
|
+
manually_revoked_at_millis: number | undefined;
|
|
102
|
+
created_at_millis: number;
|
|
103
|
+
is_public: boolean;
|
|
104
|
+
value: {
|
|
105
|
+
last_four: string;
|
|
106
|
+
};
|
|
107
|
+
type: "team";
|
|
108
|
+
team_id: string;
|
|
109
|
+
}, yup.AnyObject, {
|
|
110
|
+
id: undefined;
|
|
111
|
+
description: undefined;
|
|
112
|
+
expires_at_millis: undefined;
|
|
113
|
+
manually_revoked_at_millis: undefined;
|
|
114
|
+
created_at_millis: undefined;
|
|
115
|
+
is_public: undefined;
|
|
116
|
+
value: {
|
|
117
|
+
last_four: undefined;
|
|
118
|
+
};
|
|
119
|
+
type: undefined;
|
|
120
|
+
team_id: undefined;
|
|
121
|
+
}, "">;
|
|
122
|
+
clientUpdateSchema: yup.ObjectSchema<{
|
|
123
|
+
description: string | undefined;
|
|
124
|
+
revoked: boolean | undefined;
|
|
125
|
+
}, yup.AnyObject, {
|
|
126
|
+
description: undefined;
|
|
127
|
+
revoked: undefined;
|
|
128
|
+
}, "">;
|
|
129
|
+
docs: {
|
|
130
|
+
clientCreate: {
|
|
131
|
+
description: string;
|
|
132
|
+
displayName: string;
|
|
133
|
+
summary: string;
|
|
134
|
+
};
|
|
135
|
+
clientList: {
|
|
136
|
+
description: string;
|
|
137
|
+
displayName: string;
|
|
138
|
+
summary: string;
|
|
139
|
+
};
|
|
140
|
+
clientRead: {
|
|
141
|
+
description: string;
|
|
142
|
+
displayName: string;
|
|
143
|
+
summary: string;
|
|
144
|
+
};
|
|
145
|
+
clientUpdate: {
|
|
146
|
+
description: string;
|
|
147
|
+
displayName: string;
|
|
148
|
+
summary: string;
|
|
149
|
+
};
|
|
150
|
+
serverDelete: {
|
|
151
|
+
description: string;
|
|
152
|
+
displayName: string;
|
|
153
|
+
summary: string;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
}>, teamApiKeysCreateInputSchema: yup.ObjectSchema<{
|
|
157
|
+
description: string;
|
|
158
|
+
expires_at_millis: number | null;
|
|
159
|
+
is_public: boolean | undefined;
|
|
160
|
+
team_id: string;
|
|
161
|
+
}, yup.AnyObject, {
|
|
162
|
+
description: undefined;
|
|
163
|
+
expires_at_millis: undefined;
|
|
164
|
+
is_public: undefined;
|
|
165
|
+
team_id: undefined;
|
|
166
|
+
}, "">, teamApiKeysCreateOutputSchema: yup.ObjectSchema<{
|
|
167
|
+
id: string;
|
|
168
|
+
type: "team";
|
|
169
|
+
description: string;
|
|
170
|
+
created_at_millis: number;
|
|
171
|
+
expires_at_millis: number | undefined;
|
|
172
|
+
manually_revoked_at_millis: number | undefined;
|
|
173
|
+
team_id: string;
|
|
174
|
+
is_public: boolean;
|
|
175
|
+
} & {
|
|
176
|
+
value: string;
|
|
177
|
+
}, yup.AnyObject, {
|
|
178
|
+
id: undefined;
|
|
179
|
+
description: undefined;
|
|
180
|
+
expires_at_millis: undefined;
|
|
181
|
+
manually_revoked_at_millis: undefined;
|
|
182
|
+
created_at_millis: undefined;
|
|
183
|
+
is_public: undefined;
|
|
184
|
+
value: undefined;
|
|
185
|
+
type: undefined;
|
|
186
|
+
team_id: undefined;
|
|
187
|
+
}, "">;
|
|
188
|
+
export type TeamApiKeysCrud = CrudTypeOf<typeof teamApiKeysCrud>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { createCrud } from "../../crud";
|
|
2
|
+
import { userIdOrMeSchema, yupBoolean, yupNumber, yupObject, yupString } from "../../schema-fields";
|
|
3
|
+
import { typedFromEntries } from "../../utils/objects";
|
|
4
|
+
function createApiKeyCrud(type, idFieldName, idSchema) {
|
|
5
|
+
const projectApiKeysReadSchema = yupObject({
|
|
6
|
+
id: yupString().defined(),
|
|
7
|
+
description: yupString().defined(),
|
|
8
|
+
expires_at_millis: yupNumber().optional(),
|
|
9
|
+
manually_revoked_at_millis: yupNumber().optional(),
|
|
10
|
+
created_at_millis: yupNumber().defined(),
|
|
11
|
+
is_public: yupBoolean().defined(),
|
|
12
|
+
value: yupObject({
|
|
13
|
+
last_four: yupString().defined(),
|
|
14
|
+
}).defined(),
|
|
15
|
+
type: yupString().oneOf([type]).defined(),
|
|
16
|
+
...typedFromEntries([[idFieldName, idSchema]]),
|
|
17
|
+
});
|
|
18
|
+
const projectApiKeysUpdateSchema = yupObject({
|
|
19
|
+
description: yupString().optional(),
|
|
20
|
+
revoked: yupBoolean().oneOf([true]).optional(),
|
|
21
|
+
}).defined();
|
|
22
|
+
const projectApiKeysCrud = createCrud({
|
|
23
|
+
clientReadSchema: projectApiKeysReadSchema,
|
|
24
|
+
clientUpdateSchema: projectApiKeysUpdateSchema,
|
|
25
|
+
docs: {
|
|
26
|
+
clientCreate: {
|
|
27
|
+
description: "Create a new API key",
|
|
28
|
+
displayName: "Create API Key",
|
|
29
|
+
summary: "Create API key",
|
|
30
|
+
},
|
|
31
|
+
clientList: {
|
|
32
|
+
description: "List all API keys for the project",
|
|
33
|
+
displayName: "List API Keys",
|
|
34
|
+
summary: "List API keys",
|
|
35
|
+
},
|
|
36
|
+
clientRead: {
|
|
37
|
+
description: "Get details of a specific API key",
|
|
38
|
+
displayName: "Get API Key",
|
|
39
|
+
summary: "Get API key details",
|
|
40
|
+
},
|
|
41
|
+
clientUpdate: {
|
|
42
|
+
description: "Update an API key",
|
|
43
|
+
displayName: "Update API Key",
|
|
44
|
+
summary: "Update API key",
|
|
45
|
+
},
|
|
46
|
+
serverDelete: {
|
|
47
|
+
description: "Delete an API key",
|
|
48
|
+
displayName: "Delete API Key",
|
|
49
|
+
summary: "Delete API key",
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
// Used for the result of the create endpoint
|
|
54
|
+
const projectApiKeysCreateInputSchema = yupObject({
|
|
55
|
+
description: yupString().defined(),
|
|
56
|
+
expires_at_millis: yupNumber().nullable().defined(),
|
|
57
|
+
is_public: yupBoolean().optional(),
|
|
58
|
+
/*
|
|
59
|
+
prefix: yupString().optional().nonEmpty().test("prefix", "Prefix must contain only alphanumeric characters and underscores", (value) => {
|
|
60
|
+
if (!value) return true;
|
|
61
|
+
return /^[a-zA-Z0-9_]+$/.test(value);
|
|
62
|
+
}),
|
|
63
|
+
*/
|
|
64
|
+
...typedFromEntries([[idFieldName, idSchema]]),
|
|
65
|
+
});
|
|
66
|
+
const projectApiKeysCreateOutputSchema = projectApiKeysReadSchema.omit(["value"]).concat(yupObject({
|
|
67
|
+
value: yupString().defined(),
|
|
68
|
+
}));
|
|
69
|
+
return {
|
|
70
|
+
crud: projectApiKeysCrud,
|
|
71
|
+
createInputSchema: projectApiKeysCreateInputSchema,
|
|
72
|
+
createOutputSchema: projectApiKeysCreateOutputSchema,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export const { crud: userApiKeysCrud, createInputSchema: userApiKeysCreateInputSchema, createOutputSchema: userApiKeysCreateOutputSchema, } = createApiKeyCrud("user", "user_id", userIdOrMeSchema.defined());
|
|
76
|
+
export const { crud: teamApiKeysCrud, createInputSchema: teamApiKeysCreateInputSchema, createOutputSchema: teamApiKeysCreateOutputSchema, } = createApiKeyCrud("team", "team_id", yupString().defined());
|
|
@@ -48,17 +48,19 @@ export declare const projectsCrudAdminReadSchema: import("yup").ObjectSchema<{
|
|
|
48
48
|
passkey_enabled: boolean;
|
|
49
49
|
client_team_creation_enabled: boolean;
|
|
50
50
|
client_user_deletion_enabled: boolean;
|
|
51
|
+
allow_user_api_keys: boolean;
|
|
52
|
+
allow_team_api_keys: boolean;
|
|
51
53
|
oauth_providers: {
|
|
52
54
|
client_id?: string | undefined;
|
|
53
55
|
client_secret?: string | undefined;
|
|
54
56
|
facebook_config_id?: string | undefined;
|
|
55
57
|
microsoft_tenant_id?: string | undefined;
|
|
58
|
+
id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
|
|
56
59
|
type: "shared" | "standard";
|
|
57
|
-
id: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x";
|
|
58
60
|
enabled: boolean;
|
|
59
61
|
}[];
|
|
60
62
|
enabled_oauth_providers: {
|
|
61
|
-
id: "
|
|
63
|
+
id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
|
|
62
64
|
}[];
|
|
63
65
|
domains: {
|
|
64
66
|
domain: string;
|
|
@@ -101,6 +103,8 @@ export declare const projectsCrudAdminReadSchema: import("yup").ObjectSchema<{
|
|
|
101
103
|
passkey_enabled: undefined;
|
|
102
104
|
client_team_creation_enabled: undefined;
|
|
103
105
|
client_user_deletion_enabled: undefined;
|
|
106
|
+
allow_user_api_keys: undefined;
|
|
107
|
+
allow_team_api_keys: undefined;
|
|
104
108
|
oauth_providers: undefined;
|
|
105
109
|
enabled_oauth_providers: undefined;
|
|
106
110
|
domains: undefined;
|
|
@@ -130,8 +134,10 @@ export declare const projectsCrudClientReadSchema: import("yup").ObjectSchema<{
|
|
|
130
134
|
passkey_enabled: boolean;
|
|
131
135
|
client_team_creation_enabled: boolean;
|
|
132
136
|
client_user_deletion_enabled: boolean;
|
|
137
|
+
allow_user_api_keys: boolean;
|
|
138
|
+
allow_team_api_keys: boolean;
|
|
133
139
|
enabled_oauth_providers: {
|
|
134
|
-
id: "
|
|
140
|
+
id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
|
|
135
141
|
}[];
|
|
136
142
|
};
|
|
137
143
|
}, import("yup").AnyObject, {
|
|
@@ -144,6 +150,8 @@ export declare const projectsCrudClientReadSchema: import("yup").ObjectSchema<{
|
|
|
144
150
|
passkey_enabled: undefined;
|
|
145
151
|
client_team_creation_enabled: undefined;
|
|
146
152
|
client_user_deletion_enabled: undefined;
|
|
153
|
+
allow_user_api_keys: undefined;
|
|
154
|
+
allow_team_api_keys: undefined;
|
|
147
155
|
enabled_oauth_providers: undefined;
|
|
148
156
|
};
|
|
149
157
|
}, "">;
|
|
@@ -159,13 +167,15 @@ export declare const projectsCrudAdminUpdateSchema: import("yup").ObjectSchema<{
|
|
|
159
167
|
passkey_enabled?: boolean | undefined;
|
|
160
168
|
client_team_creation_enabled?: boolean | undefined;
|
|
161
169
|
client_user_deletion_enabled?: boolean | undefined;
|
|
170
|
+
allow_user_api_keys?: boolean | undefined;
|
|
171
|
+
allow_team_api_keys?: boolean | undefined;
|
|
162
172
|
oauth_providers?: {
|
|
163
173
|
client_id?: string | undefined;
|
|
164
174
|
client_secret?: string | undefined;
|
|
165
175
|
facebook_config_id?: string | undefined;
|
|
166
176
|
microsoft_tenant_id?: string | undefined;
|
|
177
|
+
id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
|
|
167
178
|
type: "shared" | "standard";
|
|
168
|
-
id: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x";
|
|
169
179
|
enabled: boolean;
|
|
170
180
|
}[] | undefined;
|
|
171
181
|
domains?: {
|
|
@@ -211,13 +221,15 @@ export declare const projectsCrudAdminCreateSchema: import("yup").ObjectSchema<{
|
|
|
211
221
|
passkey_enabled?: boolean | undefined;
|
|
212
222
|
client_team_creation_enabled?: boolean | undefined;
|
|
213
223
|
client_user_deletion_enabled?: boolean | undefined;
|
|
224
|
+
allow_user_api_keys?: boolean | undefined;
|
|
225
|
+
allow_team_api_keys?: boolean | undefined;
|
|
214
226
|
oauth_providers?: {
|
|
215
227
|
client_id?: string | undefined;
|
|
216
228
|
client_secret?: string | undefined;
|
|
217
229
|
facebook_config_id?: string | undefined;
|
|
218
230
|
microsoft_tenant_id?: string | undefined;
|
|
231
|
+
id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
|
|
219
232
|
type: "shared" | "standard";
|
|
220
|
-
id: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x";
|
|
221
233
|
enabled: boolean;
|
|
222
234
|
}[] | undefined;
|
|
223
235
|
domains?: {
|
|
@@ -254,7 +266,7 @@ export declare const projectsCrudAdminCreateSchema: import("yup").ObjectSchema<{
|
|
|
254
266
|
config: undefined;
|
|
255
267
|
}, "">;
|
|
256
268
|
export declare const projectsCrudAdminDeleteSchema: import("yup").MixedSchema<{} | undefined, import("yup").AnyObject, undefined, "">;
|
|
257
|
-
export declare const
|
|
269
|
+
export declare const clientProjectsCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
258
270
|
clientReadSchema: import("yup").ObjectSchema<{
|
|
259
271
|
id: string;
|
|
260
272
|
display_name: string;
|
|
@@ -265,8 +277,10 @@ export declare const projectsCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
|
265
277
|
passkey_enabled: boolean;
|
|
266
278
|
client_team_creation_enabled: boolean;
|
|
267
279
|
client_user_deletion_enabled: boolean;
|
|
280
|
+
allow_user_api_keys: boolean;
|
|
281
|
+
allow_team_api_keys: boolean;
|
|
268
282
|
enabled_oauth_providers: {
|
|
269
|
-
id: "
|
|
283
|
+
id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
|
|
270
284
|
}[];
|
|
271
285
|
};
|
|
272
286
|
}, import("yup").AnyObject, {
|
|
@@ -279,9 +293,21 @@ export declare const projectsCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
|
279
293
|
passkey_enabled: undefined;
|
|
280
294
|
client_team_creation_enabled: undefined;
|
|
281
295
|
client_user_deletion_enabled: undefined;
|
|
296
|
+
allow_user_api_keys: undefined;
|
|
297
|
+
allow_team_api_keys: undefined;
|
|
282
298
|
enabled_oauth_providers: undefined;
|
|
283
299
|
};
|
|
284
300
|
}, "">;
|
|
301
|
+
docs: {
|
|
302
|
+
clientRead: {
|
|
303
|
+
summary: string;
|
|
304
|
+
description: string;
|
|
305
|
+
tags: string[];
|
|
306
|
+
};
|
|
307
|
+
};
|
|
308
|
+
}>;
|
|
309
|
+
export type ClientProjectsCrud = CrudTypeOf<typeof clientProjectsCrud>;
|
|
310
|
+
export declare const projectsCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
285
311
|
adminReadSchema: import("yup").ObjectSchema<{
|
|
286
312
|
id: string;
|
|
287
313
|
display_name: string;
|
|
@@ -298,17 +324,19 @@ export declare const projectsCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
|
298
324
|
passkey_enabled: boolean;
|
|
299
325
|
client_team_creation_enabled: boolean;
|
|
300
326
|
client_user_deletion_enabled: boolean;
|
|
327
|
+
allow_user_api_keys: boolean;
|
|
328
|
+
allow_team_api_keys: boolean;
|
|
301
329
|
oauth_providers: {
|
|
302
330
|
client_id?: string | undefined;
|
|
303
331
|
client_secret?: string | undefined;
|
|
304
332
|
facebook_config_id?: string | undefined;
|
|
305
333
|
microsoft_tenant_id?: string | undefined;
|
|
334
|
+
id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
|
|
306
335
|
type: "shared" | "standard";
|
|
307
|
-
id: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x";
|
|
308
336
|
enabled: boolean;
|
|
309
337
|
}[];
|
|
310
338
|
enabled_oauth_providers: {
|
|
311
|
-
id: "
|
|
339
|
+
id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
|
|
312
340
|
}[];
|
|
313
341
|
domains: {
|
|
314
342
|
domain: string;
|
|
@@ -351,6 +379,8 @@ export declare const projectsCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
|
351
379
|
passkey_enabled: undefined;
|
|
352
380
|
client_team_creation_enabled: undefined;
|
|
353
381
|
client_user_deletion_enabled: undefined;
|
|
382
|
+
allow_user_api_keys: undefined;
|
|
383
|
+
allow_team_api_keys: undefined;
|
|
354
384
|
oauth_providers: undefined;
|
|
355
385
|
enabled_oauth_providers: undefined;
|
|
356
386
|
domains: undefined;
|
|
@@ -382,13 +412,15 @@ export declare const projectsCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
|
382
412
|
passkey_enabled?: boolean | undefined;
|
|
383
413
|
client_team_creation_enabled?: boolean | undefined;
|
|
384
414
|
client_user_deletion_enabled?: boolean | undefined;
|
|
415
|
+
allow_user_api_keys?: boolean | undefined;
|
|
416
|
+
allow_team_api_keys?: boolean | undefined;
|
|
385
417
|
oauth_providers?: {
|
|
386
418
|
client_id?: string | undefined;
|
|
387
419
|
client_secret?: string | undefined;
|
|
388
420
|
facebook_config_id?: string | undefined;
|
|
389
421
|
microsoft_tenant_id?: string | undefined;
|
|
422
|
+
id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
|
|
390
423
|
type: "shared" | "standard";
|
|
391
|
-
id: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x";
|
|
392
424
|
enabled: boolean;
|
|
393
425
|
}[] | undefined;
|
|
394
426
|
domains?: {
|
|
@@ -424,11 +456,6 @@ export declare const projectsCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
|
424
456
|
}, "">;
|
|
425
457
|
adminDeleteSchema: import("yup").MixedSchema<{} | undefined, import("yup").AnyObject, undefined, "">;
|
|
426
458
|
docs: {
|
|
427
|
-
clientRead: {
|
|
428
|
-
summary: string;
|
|
429
|
-
description: string;
|
|
430
|
-
tags: string[];
|
|
431
|
-
};
|
|
432
459
|
adminRead: {
|
|
433
460
|
summary: string;
|
|
434
461
|
description: string;
|
|
@@ -447,7 +474,7 @@ export declare const projectsCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
|
447
474
|
};
|
|
448
475
|
}>;
|
|
449
476
|
export type ProjectsCrud = CrudTypeOf<typeof projectsCrud>;
|
|
450
|
-
export declare const
|
|
477
|
+
export declare const adminUserProjectsCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
451
478
|
clientReadSchema: import("yup").ObjectSchema<{
|
|
452
479
|
id: string;
|
|
453
480
|
display_name: string;
|
|
@@ -464,17 +491,19 @@ export declare const internalProjectsCrud: import("../../crud").CrudSchemaFromOp
|
|
|
464
491
|
passkey_enabled: boolean;
|
|
465
492
|
client_team_creation_enabled: boolean;
|
|
466
493
|
client_user_deletion_enabled: boolean;
|
|
494
|
+
allow_user_api_keys: boolean;
|
|
495
|
+
allow_team_api_keys: boolean;
|
|
467
496
|
oauth_providers: {
|
|
468
497
|
client_id?: string | undefined;
|
|
469
498
|
client_secret?: string | undefined;
|
|
470
499
|
facebook_config_id?: string | undefined;
|
|
471
500
|
microsoft_tenant_id?: string | undefined;
|
|
501
|
+
id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
|
|
472
502
|
type: "shared" | "standard";
|
|
473
|
-
id: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x";
|
|
474
503
|
enabled: boolean;
|
|
475
504
|
}[];
|
|
476
505
|
enabled_oauth_providers: {
|
|
477
|
-
id: "
|
|
506
|
+
id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
|
|
478
507
|
}[];
|
|
479
508
|
domains: {
|
|
480
509
|
domain: string;
|
|
@@ -517,6 +546,8 @@ export declare const internalProjectsCrud: import("../../crud").CrudSchemaFromOp
|
|
|
517
546
|
passkey_enabled: undefined;
|
|
518
547
|
client_team_creation_enabled: undefined;
|
|
519
548
|
client_user_deletion_enabled: undefined;
|
|
549
|
+
allow_user_api_keys: undefined;
|
|
550
|
+
allow_team_api_keys: undefined;
|
|
520
551
|
oauth_providers: undefined;
|
|
521
552
|
enabled_oauth_providers: undefined;
|
|
522
553
|
domains: undefined;
|
|
@@ -548,13 +579,15 @@ export declare const internalProjectsCrud: import("../../crud").CrudSchemaFromOp
|
|
|
548
579
|
passkey_enabled?: boolean | undefined;
|
|
549
580
|
client_team_creation_enabled?: boolean | undefined;
|
|
550
581
|
client_user_deletion_enabled?: boolean | undefined;
|
|
582
|
+
allow_user_api_keys?: boolean | undefined;
|
|
583
|
+
allow_team_api_keys?: boolean | undefined;
|
|
551
584
|
oauth_providers?: {
|
|
552
585
|
client_id?: string | undefined;
|
|
553
586
|
client_secret?: string | undefined;
|
|
554
587
|
facebook_config_id?: string | undefined;
|
|
555
588
|
microsoft_tenant_id?: string | undefined;
|
|
589
|
+
id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
|
|
556
590
|
type: "shared" | "standard";
|
|
557
|
-
id: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x";
|
|
558
591
|
enabled: boolean;
|
|
559
592
|
}[] | undefined;
|
|
560
593
|
domains?: {
|
|
@@ -599,4 +632,4 @@ export declare const internalProjectsCrud: import("../../crud").CrudSchemaFromOp
|
|
|
599
632
|
};
|
|
600
633
|
};
|
|
601
634
|
}>;
|
|
602
|
-
export type
|
|
635
|
+
export type AdminUserProjectsCrud = CrudTypeOf<typeof adminUserProjectsCrud>;
|
|
@@ -68,6 +68,8 @@ export const projectsCrudAdminReadSchema = yupObject({
|
|
|
68
68
|
// TODO: remove this
|
|
69
69
|
client_team_creation_enabled: schemaFields.projectClientTeamCreationEnabledSchema.defined(),
|
|
70
70
|
client_user_deletion_enabled: schemaFields.projectClientUserDeletionEnabledSchema.defined(),
|
|
71
|
+
allow_user_api_keys: schemaFields.yupBoolean().defined(),
|
|
72
|
+
allow_team_api_keys: schemaFields.yupBoolean().defined(),
|
|
71
73
|
oauth_providers: yupArray(oauthProviderSchema.defined()).defined(),
|
|
72
74
|
enabled_oauth_providers: yupArray(enabledOAuthProviderSchema.defined()).defined().meta({ openapiField: { hidden: true } }),
|
|
73
75
|
domains: yupArray(domainSchema.defined()).defined(),
|
|
@@ -89,6 +91,8 @@ export const projectsCrudClientReadSchema = yupObject({
|
|
|
89
91
|
passkey_enabled: schemaFields.projectPasskeyEnabledSchema.defined(),
|
|
90
92
|
client_team_creation_enabled: schemaFields.projectClientTeamCreationEnabledSchema.defined(),
|
|
91
93
|
client_user_deletion_enabled: schemaFields.projectClientUserDeletionEnabledSchema.defined(),
|
|
94
|
+
allow_user_api_keys: schemaFields.yupBoolean().defined(),
|
|
95
|
+
allow_team_api_keys: schemaFields.yupBoolean().defined(),
|
|
92
96
|
enabled_oauth_providers: yupArray(enabledOAuthProviderSchema.defined()).defined().meta({ openapiField: { hidden: true } }),
|
|
93
97
|
}).defined(),
|
|
94
98
|
}).defined();
|
|
@@ -104,6 +108,8 @@ export const projectsCrudAdminUpdateSchema = yupObject({
|
|
|
104
108
|
client_team_creation_enabled: schemaFields.projectClientTeamCreationEnabledSchema.optional(),
|
|
105
109
|
client_user_deletion_enabled: schemaFields.projectClientUserDeletionEnabledSchema.optional(),
|
|
106
110
|
allow_localhost: schemaFields.projectAllowLocalhostSchema.optional(),
|
|
111
|
+
allow_user_api_keys: schemaFields.yupBoolean().optional(),
|
|
112
|
+
allow_team_api_keys: schemaFields.yupBoolean().optional(),
|
|
107
113
|
email_config: emailConfigSchema.optional().default(undefined),
|
|
108
114
|
domains: yupArray(domainSchema.defined()).optional().default(undefined),
|
|
109
115
|
oauth_providers: yupArray(oauthProviderSchema.defined()).optional().default(undefined),
|
|
@@ -118,17 +124,21 @@ export const projectsCrudAdminCreateSchema = projectsCrudAdminUpdateSchema.conca
|
|
|
118
124
|
display_name: schemaFields.projectDisplayNameSchema.defined(),
|
|
119
125
|
}).defined());
|
|
120
126
|
export const projectsCrudAdminDeleteSchema = schemaFields.yupMixed();
|
|
121
|
-
export const
|
|
127
|
+
export const clientProjectsCrud = createCrud({
|
|
122
128
|
clientReadSchema: projectsCrudClientReadSchema,
|
|
123
|
-
adminReadSchema: projectsCrudAdminReadSchema,
|
|
124
|
-
adminUpdateSchema: projectsCrudAdminUpdateSchema,
|
|
125
|
-
adminDeleteSchema: projectsCrudAdminDeleteSchema,
|
|
126
129
|
docs: {
|
|
127
130
|
clientRead: {
|
|
128
131
|
summary: 'Get the current project',
|
|
129
132
|
description: 'Get the current project information including display name, OAuth providers and authentication methods. Useful for display the available login options to the user.',
|
|
130
133
|
tags: ['Projects'],
|
|
131
134
|
},
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
export const projectsCrud = createCrud({
|
|
138
|
+
adminReadSchema: projectsCrudAdminReadSchema,
|
|
139
|
+
adminUpdateSchema: projectsCrudAdminUpdateSchema,
|
|
140
|
+
adminDeleteSchema: projectsCrudAdminDeleteSchema,
|
|
141
|
+
docs: {
|
|
132
142
|
adminRead: {
|
|
133
143
|
summary: 'Get the current project',
|
|
134
144
|
description: 'Get the current project information and configuration including display name, OAuth providers, email configuration, etc.',
|
|
@@ -146,7 +156,7 @@ export const projectsCrud = createCrud({
|
|
|
146
156
|
},
|
|
147
157
|
},
|
|
148
158
|
});
|
|
149
|
-
export const
|
|
159
|
+
export const adminUserProjectsCrud = createCrud({
|
|
150
160
|
clientReadSchema: projectsCrudAdminReadSchema,
|
|
151
161
|
clientCreateSchema: projectsCrudAdminCreateSchema,
|
|
152
162
|
docs: {
|
|
@@ -17,7 +17,6 @@ export declare const teamMemberProfilesCrudServerReadSchema: import("yup").Objec
|
|
|
17
17
|
profile_image_url: string | null;
|
|
18
18
|
} & {
|
|
19
19
|
user: {
|
|
20
|
-
primary_email: string | null;
|
|
21
20
|
id: string;
|
|
22
21
|
display_name: string | null;
|
|
23
22
|
oauth_providers: {
|
|
@@ -29,6 +28,7 @@ export declare const teamMemberProfilesCrudServerReadSchema: import("yup").Objec
|
|
|
29
28
|
client_metadata: {} | null;
|
|
30
29
|
client_read_only_metadata: {} | null;
|
|
31
30
|
server_metadata: {} | null;
|
|
31
|
+
primary_email: string | null;
|
|
32
32
|
primary_email_verified: boolean;
|
|
33
33
|
primary_email_auth_enabled: boolean;
|
|
34
34
|
passkey_auth_enabled: boolean;
|
|
@@ -40,8 +40,8 @@ export declare const teamMemberProfilesCrudServerReadSchema: import("yup").Objec
|
|
|
40
40
|
client_read_only_metadata?: {} | null | undefined;
|
|
41
41
|
server_metadata?: {} | null | undefined;
|
|
42
42
|
id: string;
|
|
43
|
-
created_at_millis: number;
|
|
44
43
|
display_name: string;
|
|
44
|
+
created_at_millis: number;
|
|
45
45
|
profile_image_url: string | null;
|
|
46
46
|
} | null;
|
|
47
47
|
signed_up_at_millis: number;
|
|
@@ -112,7 +112,6 @@ export declare const teamMemberProfilesCrud: import("../../crud").CrudSchemaFrom
|
|
|
112
112
|
profile_image_url: string | null;
|
|
113
113
|
} & {
|
|
114
114
|
user: {
|
|
115
|
-
primary_email: string | null;
|
|
116
115
|
id: string;
|
|
117
116
|
display_name: string | null;
|
|
118
117
|
oauth_providers: {
|
|
@@ -124,6 +123,7 @@ export declare const teamMemberProfilesCrud: import("../../crud").CrudSchemaFrom
|
|
|
124
123
|
client_metadata: {} | null;
|
|
125
124
|
client_read_only_metadata: {} | null;
|
|
126
125
|
server_metadata: {} | null;
|
|
126
|
+
primary_email: string | null;
|
|
127
127
|
primary_email_verified: boolean;
|
|
128
128
|
primary_email_auth_enabled: boolean;
|
|
129
129
|
passkey_auth_enabled: boolean;
|
|
@@ -135,8 +135,8 @@ export declare const teamMemberProfilesCrud: import("../../crud").CrudSchemaFrom
|
|
|
135
135
|
client_read_only_metadata?: {} | null | undefined;
|
|
136
136
|
server_metadata?: {} | null | undefined;
|
|
137
137
|
id: string;
|
|
138
|
-
created_at_millis: number;
|
|
139
138
|
display_name: string;
|
|
139
|
+
created_at_millis: number;
|
|
140
140
|
profile_image_url: string | null;
|
|
141
141
|
} | null;
|
|
142
142
|
signed_up_at_millis: number;
|