@stackframe/stack-shared 2.5.35 → 2.6.0
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 +26 -0
- package/dist/interface/clientInterface.d.ts +14 -11
- package/dist/interface/clientInterface.js +35 -16
- package/dist/interface/crud/current-user.d.ts +6 -6
- package/dist/interface/crud/current-user.js +2 -2
- package/dist/interface/crud/projects.d.ts +26 -12
- package/dist/interface/crud/projects.js +3 -0
- package/dist/interface/crud/team-member-profiles.d.ts +6 -6
- package/dist/interface/crud/users.d.ts +16 -12
- package/dist/interface/crud/users.js +3 -0
- package/dist/interface/webhooks.d.ts +8 -4
- package/dist/known-errors.d.ts +8 -0
- package/dist/known-errors.js +10 -0
- package/dist/schema-fields.d.ts +6 -2
- package/dist/schema-fields.js +63 -5
- package/dist/utils/jwt.d.ts +1 -1
- package/dist/utils/jwt.js +2 -2
- package/dist/utils/oauth.d.ts +2 -2
- package/dist/utils/oauth.js +1 -1
- package/package.json +4 -2
- package/dist/interface/crud-deprecated/api-keys.d.ts +0 -134
- package/dist/interface/crud-deprecated/api-keys.js +0 -61
- package/dist/interface/crud-deprecated/current-user.d.ts +0 -127
- package/dist/interface/crud-deprecated/current-user.js +0 -49
- package/dist/interface/crud-deprecated/email-templates.d.ts +0 -75
- package/dist/interface/crud-deprecated/email-templates.js +0 -41
- package/dist/interface/crud-deprecated/oauth.d.ts +0 -24
- package/dist/interface/crud-deprecated/oauth.js +0 -12
- package/dist/interface/crud-deprecated/projects.d.ts +0 -440
- package/dist/interface/crud-deprecated/projects.js +0 -109
- package/dist/interface/crud-deprecated/team-memberships.d.ts +0 -22
- package/dist/interface/crud-deprecated/team-memberships.js +0 -22
- package/dist/interface/crud-deprecated/team-permissions.d.ts +0 -129
- package/dist/interface/crud-deprecated/team-permissions.js +0 -83
- package/dist/interface/crud-deprecated/teams.d.ts +0 -126
- package/dist/interface/crud-deprecated/teams.js +0 -78
- package/dist/interface/crud-deprecated/users.d.ts +0 -199
- package/dist/interface/crud-deprecated/users.js +0 -75
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { CrudTypeOf } from "../../crud";
|
|
2
|
-
export declare const teamPermissionsCrudClientReadSchema: import("yup").ObjectSchema<{
|
|
3
|
-
id: string;
|
|
4
|
-
user_id: string;
|
|
5
|
-
team_id: string;
|
|
6
|
-
}, import("yup").AnyObject, {
|
|
7
|
-
id: undefined;
|
|
8
|
-
user_id: undefined;
|
|
9
|
-
team_id: undefined;
|
|
10
|
-
}, "">;
|
|
11
|
-
export declare const teamPermissionsCrudServerCreateSchema: import("yup").ObjectSchema<{}, import("yup").AnyObject, {}, "">;
|
|
12
|
-
export declare const teamPermissionsCrudServerDeleteSchema: import("yup").MixedSchema<{} | undefined, import("yup").AnyObject, undefined, "">;
|
|
13
|
-
export declare const teamPermissionsCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
14
|
-
clientReadSchema: import("yup").ObjectSchema<{
|
|
15
|
-
id: string;
|
|
16
|
-
user_id: string;
|
|
17
|
-
team_id: string;
|
|
18
|
-
}, import("yup").AnyObject, {
|
|
19
|
-
id: undefined;
|
|
20
|
-
user_id: undefined;
|
|
21
|
-
team_id: undefined;
|
|
22
|
-
}, "">;
|
|
23
|
-
serverCreateSchema: import("yup").ObjectSchema<{}, import("yup").AnyObject, {}, "">;
|
|
24
|
-
serverDeleteSchema: import("yup").MixedSchema<{} | undefined, import("yup").AnyObject, undefined, "">;
|
|
25
|
-
docs: {
|
|
26
|
-
clientList: {
|
|
27
|
-
summary: string;
|
|
28
|
-
description: string;
|
|
29
|
-
tags: string[];
|
|
30
|
-
};
|
|
31
|
-
serverList: {
|
|
32
|
-
summary: string;
|
|
33
|
-
description: string;
|
|
34
|
-
tags: string[];
|
|
35
|
-
};
|
|
36
|
-
serverCreate: {
|
|
37
|
-
summary: string;
|
|
38
|
-
description: string;
|
|
39
|
-
tags: string[];
|
|
40
|
-
};
|
|
41
|
-
serverDelete: {
|
|
42
|
-
summary: string;
|
|
43
|
-
description: string;
|
|
44
|
-
tags: string[];
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
}>;
|
|
48
|
-
export type TeamPermissionsCrud = CrudTypeOf<typeof teamPermissionsCrud>;
|
|
49
|
-
export declare const teamPermissionDefinitionsCrudServerReadSchema: import("yup").ObjectSchema<{
|
|
50
|
-
id: string;
|
|
51
|
-
description: string | undefined;
|
|
52
|
-
contained_permission_ids: string[];
|
|
53
|
-
}, import("yup").AnyObject, {
|
|
54
|
-
id: undefined;
|
|
55
|
-
description: undefined;
|
|
56
|
-
contained_permission_ids: undefined;
|
|
57
|
-
}, "">;
|
|
58
|
-
export declare const teamPermissionDefinitionsCrudServerCreateSchema: import("yup").ObjectSchema<{
|
|
59
|
-
id: string;
|
|
60
|
-
description: string | undefined;
|
|
61
|
-
contained_permission_ids: string[] | undefined;
|
|
62
|
-
}, import("yup").AnyObject, {
|
|
63
|
-
id: undefined;
|
|
64
|
-
description: undefined;
|
|
65
|
-
contained_permission_ids: undefined;
|
|
66
|
-
}, "">;
|
|
67
|
-
export declare const teamPermissionDefinitionsCrudServerUpdateSchema: import("yup").ObjectSchema<{
|
|
68
|
-
id: string;
|
|
69
|
-
description: string | undefined;
|
|
70
|
-
contained_permission_ids: string[] | undefined;
|
|
71
|
-
}, import("yup").AnyObject, {
|
|
72
|
-
id: undefined;
|
|
73
|
-
description: undefined;
|
|
74
|
-
contained_permission_ids: undefined;
|
|
75
|
-
}, "">;
|
|
76
|
-
export declare const teamPermissionDefinitionsCrudServerDeleteSchema: import("yup").MixedSchema<{} | undefined, import("yup").AnyObject, undefined, "">;
|
|
77
|
-
export declare const teamPermissionDefinitionsCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
78
|
-
serverReadSchema: import("yup").ObjectSchema<{
|
|
79
|
-
id: string;
|
|
80
|
-
description: string | undefined;
|
|
81
|
-
contained_permission_ids: string[];
|
|
82
|
-
}, import("yup").AnyObject, {
|
|
83
|
-
id: undefined;
|
|
84
|
-
description: undefined;
|
|
85
|
-
contained_permission_ids: undefined;
|
|
86
|
-
}, "">;
|
|
87
|
-
serverCreateSchema: import("yup").ObjectSchema<{
|
|
88
|
-
id: string;
|
|
89
|
-
description: string | undefined;
|
|
90
|
-
contained_permission_ids: string[] | undefined;
|
|
91
|
-
}, import("yup").AnyObject, {
|
|
92
|
-
id: undefined;
|
|
93
|
-
description: undefined;
|
|
94
|
-
contained_permission_ids: undefined;
|
|
95
|
-
}, "">;
|
|
96
|
-
serverUpdateSchema: import("yup").ObjectSchema<{
|
|
97
|
-
id: string;
|
|
98
|
-
description: string | undefined;
|
|
99
|
-
contained_permission_ids: string[] | undefined;
|
|
100
|
-
}, import("yup").AnyObject, {
|
|
101
|
-
id: undefined;
|
|
102
|
-
description: undefined;
|
|
103
|
-
contained_permission_ids: undefined;
|
|
104
|
-
}, "">;
|
|
105
|
-
serverDeleteSchema: import("yup").MixedSchema<{} | undefined, import("yup").AnyObject, undefined, "">;
|
|
106
|
-
docs: {
|
|
107
|
-
serverList: {
|
|
108
|
-
summary: string;
|
|
109
|
-
description: string;
|
|
110
|
-
tags: string[];
|
|
111
|
-
};
|
|
112
|
-
serverCreate: {
|
|
113
|
-
summary: string;
|
|
114
|
-
description: string;
|
|
115
|
-
tags: string[];
|
|
116
|
-
};
|
|
117
|
-
serverUpdate: {
|
|
118
|
-
summary: string;
|
|
119
|
-
description: string;
|
|
120
|
-
tags: string[];
|
|
121
|
-
};
|
|
122
|
-
serverDelete: {
|
|
123
|
-
summary: string;
|
|
124
|
-
description: string;
|
|
125
|
-
tags: string[];
|
|
126
|
-
};
|
|
127
|
-
};
|
|
128
|
-
}>;
|
|
129
|
-
export type TeamPermissionDefinitionsCrud = CrudTypeOf<typeof teamPermissionDefinitionsCrud>;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { createCrud } from "../../crud";
|
|
2
|
-
import * as schemaFields from "../../schema-fields";
|
|
3
|
-
import { yupMixed, yupObject } from "../../schema-fields";
|
|
4
|
-
// Team permissions
|
|
5
|
-
export const teamPermissionsCrudClientReadSchema = yupObject({
|
|
6
|
-
id: schemaFields.teamPermissionDefinitionIdSchema.required(),
|
|
7
|
-
user_id: schemaFields.userIdSchema.required(),
|
|
8
|
-
team_id: schemaFields.teamIdSchema.required(),
|
|
9
|
-
}).required();
|
|
10
|
-
export const teamPermissionsCrudServerCreateSchema = yupObject({}).required();
|
|
11
|
-
export const teamPermissionsCrudServerDeleteSchema = yupMixed();
|
|
12
|
-
export const teamPermissionsCrud = createCrud({
|
|
13
|
-
clientReadSchema: teamPermissionsCrudClientReadSchema,
|
|
14
|
-
serverCreateSchema: teamPermissionsCrudServerCreateSchema,
|
|
15
|
-
serverDeleteSchema: teamPermissionsCrudServerDeleteSchema,
|
|
16
|
-
docs: {
|
|
17
|
-
clientList: {
|
|
18
|
-
summary: "List team permissions of the current user",
|
|
19
|
-
description: "user_id=me needs to be set",
|
|
20
|
-
tags: ["Permissions"],
|
|
21
|
-
},
|
|
22
|
-
serverList: {
|
|
23
|
-
summary: "List team permissions of a user",
|
|
24
|
-
description: "Query and filter the permission with team_id, user_id, and permission_id",
|
|
25
|
-
tags: ["Permissions"],
|
|
26
|
-
},
|
|
27
|
-
serverCreate: {
|
|
28
|
-
summary: "Grant a team permission to a user",
|
|
29
|
-
description: "Grant a team permission to a user (the team permission must be created first on the Stack dashboard)",
|
|
30
|
-
tags: ["Permissions"],
|
|
31
|
-
},
|
|
32
|
-
serverDelete: {
|
|
33
|
-
summary: "Revoke a team permission from a user",
|
|
34
|
-
description: "Revoke a team permission from a user",
|
|
35
|
-
tags: ["Permissions"],
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
// Team permission definitions
|
|
40
|
-
export const teamPermissionDefinitionsCrudServerReadSchema = yupObject({
|
|
41
|
-
id: schemaFields.teamPermissionDefinitionIdSchema.required(),
|
|
42
|
-
description: schemaFields.teamPermissionDescriptionSchema.optional(),
|
|
43
|
-
contained_permission_ids: schemaFields.containedPermissionIdsSchema.required()
|
|
44
|
-
}).required();
|
|
45
|
-
export const teamPermissionDefinitionsCrudServerCreateSchema = yupObject({
|
|
46
|
-
id: schemaFields.customTeamPermissionDefinitionIdSchema.required(),
|
|
47
|
-
description: schemaFields.teamPermissionDescriptionSchema.optional(),
|
|
48
|
-
contained_permission_ids: schemaFields.containedPermissionIdsSchema.optional()
|
|
49
|
-
}).required();
|
|
50
|
-
export const teamPermissionDefinitionsCrudServerUpdateSchema = yupObject({
|
|
51
|
-
id: schemaFields.customTeamPermissionDefinitionIdSchema.required(),
|
|
52
|
-
description: schemaFields.teamPermissionDescriptionSchema.optional(),
|
|
53
|
-
contained_permission_ids: schemaFields.containedPermissionIdsSchema.optional()
|
|
54
|
-
}).required();
|
|
55
|
-
export const teamPermissionDefinitionsCrudServerDeleteSchema = yupMixed();
|
|
56
|
-
export const teamPermissionDefinitionsCrud = createCrud({
|
|
57
|
-
serverReadSchema: teamPermissionDefinitionsCrudServerReadSchema,
|
|
58
|
-
serverCreateSchema: teamPermissionDefinitionsCrudServerCreateSchema,
|
|
59
|
-
serverUpdateSchema: teamPermissionDefinitionsCrudServerUpdateSchema,
|
|
60
|
-
serverDeleteSchema: teamPermissionDefinitionsCrudServerDeleteSchema,
|
|
61
|
-
docs: {
|
|
62
|
-
serverList: {
|
|
63
|
-
summary: "List team permission definitions",
|
|
64
|
-
description: "Query and filter the permission with team_id, user_id, and permission_id (the equivalent of listing permissions on the Stack dashboard)",
|
|
65
|
-
tags: ["Permissions"],
|
|
66
|
-
},
|
|
67
|
-
serverCreate: {
|
|
68
|
-
summary: "Create a new team permission definition",
|
|
69
|
-
description: "Create a new permission definition (the equivalent of creating a new permission on the Stack dashboard)",
|
|
70
|
-
tags: ["Permissions"],
|
|
71
|
-
},
|
|
72
|
-
serverUpdate: {
|
|
73
|
-
summary: "Update a team permission definition",
|
|
74
|
-
description: "Update a permission definition (the equivalent of updating a permission on the Stack dashboard)",
|
|
75
|
-
tags: ["Permissions"],
|
|
76
|
-
},
|
|
77
|
-
serverDelete: {
|
|
78
|
-
summary: "Delete a team permission definition",
|
|
79
|
-
description: "Delete a permission definition (the equivalent of deleting a permission on the Stack dashboard)",
|
|
80
|
-
tags: ["Permissions"],
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
});
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { CrudTypeOf } from "../../crud";
|
|
2
|
-
export declare const teamsCrudClientReadSchema: import("yup").ObjectSchema<{
|
|
3
|
-
id: string;
|
|
4
|
-
display_name: string;
|
|
5
|
-
}, import("yup").AnyObject, {
|
|
6
|
-
id: undefined;
|
|
7
|
-
display_name: undefined;
|
|
8
|
-
}, "">;
|
|
9
|
-
export declare const teamsCrudServerReadSchema: import("yup").ObjectSchema<{
|
|
10
|
-
id: string;
|
|
11
|
-
display_name: string;
|
|
12
|
-
} & {
|
|
13
|
-
created_at_millis: number;
|
|
14
|
-
}, import("yup").AnyObject, {
|
|
15
|
-
id: undefined;
|
|
16
|
-
display_name: undefined;
|
|
17
|
-
created_at_millis: undefined;
|
|
18
|
-
}, "">;
|
|
19
|
-
export declare const teamsCrudClientUpdateSchema: import("yup").ObjectSchema<{
|
|
20
|
-
display_name: string | undefined;
|
|
21
|
-
}, import("yup").AnyObject, {
|
|
22
|
-
display_name: undefined;
|
|
23
|
-
}, "">;
|
|
24
|
-
export declare const teamsCrudServerUpdateSchema: import("yup").ObjectSchema<{
|
|
25
|
-
display_name: string | undefined;
|
|
26
|
-
} & {}, import("yup").AnyObject, {
|
|
27
|
-
display_name: undefined;
|
|
28
|
-
}, "">;
|
|
29
|
-
export declare const teamsCrudClientCreateSchema: import("yup").ObjectSchema<{
|
|
30
|
-
display_name: string;
|
|
31
|
-
} & {
|
|
32
|
-
display_name: string;
|
|
33
|
-
}, import("yup").AnyObject, {
|
|
34
|
-
display_name: undefined;
|
|
35
|
-
}, "">;
|
|
36
|
-
export declare const teamsCrudServerCreateSchema: import("yup").ObjectSchema<{
|
|
37
|
-
display_name: string;
|
|
38
|
-
} & {
|
|
39
|
-
display_name: string;
|
|
40
|
-
}, import("yup").AnyObject, {
|
|
41
|
-
display_name: undefined;
|
|
42
|
-
}, "">;
|
|
43
|
-
export declare const teamsCrudClientDeleteSchema: import("yup").MixedSchema<{} | undefined, import("yup").AnyObject, undefined, "">;
|
|
44
|
-
export declare const teamsCrudServerDeleteSchema: import("yup").MixedSchema<{} | undefined, import("yup").AnyObject, undefined, "">;
|
|
45
|
-
export declare const teamsCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
46
|
-
clientReadSchema: import("yup").ObjectSchema<{
|
|
47
|
-
id: string;
|
|
48
|
-
display_name: string;
|
|
49
|
-
}, import("yup").AnyObject, {
|
|
50
|
-
id: undefined;
|
|
51
|
-
display_name: undefined;
|
|
52
|
-
}, "">;
|
|
53
|
-
clientCreateSchema: import("yup").ObjectSchema<{
|
|
54
|
-
display_name: string;
|
|
55
|
-
} & {
|
|
56
|
-
display_name: string;
|
|
57
|
-
}, import("yup").AnyObject, {
|
|
58
|
-
display_name: undefined;
|
|
59
|
-
}, "">;
|
|
60
|
-
serverReadSchema: import("yup").ObjectSchema<{
|
|
61
|
-
id: string;
|
|
62
|
-
display_name: string;
|
|
63
|
-
} & {
|
|
64
|
-
created_at_millis: number;
|
|
65
|
-
}, import("yup").AnyObject, {
|
|
66
|
-
id: undefined;
|
|
67
|
-
display_name: undefined;
|
|
68
|
-
created_at_millis: undefined;
|
|
69
|
-
}, "">;
|
|
70
|
-
serverUpdateSchema: import("yup").ObjectSchema<{
|
|
71
|
-
display_name: string | undefined;
|
|
72
|
-
} & {}, import("yup").AnyObject, {
|
|
73
|
-
display_name: undefined;
|
|
74
|
-
}, "">;
|
|
75
|
-
serverCreateSchema: import("yup").ObjectSchema<{
|
|
76
|
-
display_name: string;
|
|
77
|
-
} & {
|
|
78
|
-
display_name: string;
|
|
79
|
-
}, import("yup").AnyObject, {
|
|
80
|
-
display_name: undefined;
|
|
81
|
-
}, "">;
|
|
82
|
-
serverDeleteSchema: import("yup").MixedSchema<{} | undefined, import("yup").AnyObject, undefined, "">;
|
|
83
|
-
docs: {
|
|
84
|
-
clientList: {
|
|
85
|
-
summary: string;
|
|
86
|
-
description: string;
|
|
87
|
-
tags: string[];
|
|
88
|
-
};
|
|
89
|
-
clientCreate: {
|
|
90
|
-
summary: string;
|
|
91
|
-
description: string;
|
|
92
|
-
tags: string[];
|
|
93
|
-
};
|
|
94
|
-
clientRead: {
|
|
95
|
-
summary: string;
|
|
96
|
-
description: string;
|
|
97
|
-
tags: string[];
|
|
98
|
-
};
|
|
99
|
-
serverCreate: {
|
|
100
|
-
summary: string;
|
|
101
|
-
description: string;
|
|
102
|
-
tags: string[];
|
|
103
|
-
};
|
|
104
|
-
serverList: {
|
|
105
|
-
summary: string;
|
|
106
|
-
description: string;
|
|
107
|
-
tags: string[];
|
|
108
|
-
};
|
|
109
|
-
serverRead: {
|
|
110
|
-
summary: string;
|
|
111
|
-
description: string;
|
|
112
|
-
tags: string[];
|
|
113
|
-
};
|
|
114
|
-
serverUpdate: {
|
|
115
|
-
summary: string;
|
|
116
|
-
description: string;
|
|
117
|
-
tags: string[];
|
|
118
|
-
};
|
|
119
|
-
serverDelete: {
|
|
120
|
-
summary: string;
|
|
121
|
-
description: string;
|
|
122
|
-
tags: string[];
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
}>;
|
|
126
|
-
export type TeamsCrud = CrudTypeOf<typeof teamsCrud>;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { createCrud } from "../../crud";
|
|
2
|
-
import * as fieldSchema from "../../schema-fields";
|
|
3
|
-
import { yupMixed, yupObject } from "../../schema-fields";
|
|
4
|
-
// Read
|
|
5
|
-
export const teamsCrudClientReadSchema = yupObject({
|
|
6
|
-
id: fieldSchema.teamIdSchema.required(),
|
|
7
|
-
display_name: fieldSchema.teamDisplayNameSchema.required(),
|
|
8
|
-
}).required();
|
|
9
|
-
export const teamsCrudServerReadSchema = teamsCrudClientReadSchema.concat(yupObject({
|
|
10
|
-
created_at_millis: fieldSchema.teamCreatedAtMillisSchema.required(),
|
|
11
|
-
}).required());
|
|
12
|
-
// Update
|
|
13
|
-
export const teamsCrudClientUpdateSchema = yupObject({
|
|
14
|
-
display_name: fieldSchema.teamDisplayNameSchema.optional(),
|
|
15
|
-
}).required();
|
|
16
|
-
export const teamsCrudServerUpdateSchema = teamsCrudClientUpdateSchema.concat(yupObject({}).required());
|
|
17
|
-
// Create
|
|
18
|
-
export const teamsCrudClientCreateSchema = teamsCrudClientUpdateSchema.concat(yupObject({
|
|
19
|
-
display_name: fieldSchema.teamDisplayNameSchema.required(),
|
|
20
|
-
}).required());
|
|
21
|
-
export const teamsCrudServerCreateSchema = teamsCrudServerUpdateSchema.concat(yupObject({
|
|
22
|
-
display_name: fieldSchema.teamDisplayNameSchema.required(),
|
|
23
|
-
}).required());
|
|
24
|
-
// Delete
|
|
25
|
-
export const teamsCrudClientDeleteSchema = yupMixed();
|
|
26
|
-
export const teamsCrudServerDeleteSchema = teamsCrudClientDeleteSchema;
|
|
27
|
-
export const teamsCrud = createCrud({
|
|
28
|
-
clientReadSchema: teamsCrudClientReadSchema,
|
|
29
|
-
// clientUpdateSchema: teamsCrudClientUpdateSchema,
|
|
30
|
-
clientCreateSchema: teamsCrudClientCreateSchema,
|
|
31
|
-
// clientDeleteSchema: teamsCrudClientDeleteSchema,
|
|
32
|
-
serverReadSchema: teamsCrudServerReadSchema,
|
|
33
|
-
serverUpdateSchema: teamsCrudServerUpdateSchema,
|
|
34
|
-
serverCreateSchema: teamsCrudServerCreateSchema,
|
|
35
|
-
serverDeleteSchema: teamsCrudServerDeleteSchema,
|
|
36
|
-
docs: {
|
|
37
|
-
clientList: {
|
|
38
|
-
summary: "List teams",
|
|
39
|
-
description: "List all the teams that the current user is a member of.",
|
|
40
|
-
tags: ["Teams"],
|
|
41
|
-
},
|
|
42
|
-
clientCreate: {
|
|
43
|
-
summary: "Create a team",
|
|
44
|
-
description: "Create a new team and add the current user as a member.",
|
|
45
|
-
tags: ["Teams"],
|
|
46
|
-
},
|
|
47
|
-
clientRead: {
|
|
48
|
-
summary: "Get a team",
|
|
49
|
-
description: "Get a team that the current user is a member of.",
|
|
50
|
-
tags: ["Teams"],
|
|
51
|
-
},
|
|
52
|
-
serverCreate: {
|
|
53
|
-
summary: "Create a team",
|
|
54
|
-
description: "Create a new team and add the current user as a member.",
|
|
55
|
-
tags: ["Teams"],
|
|
56
|
-
},
|
|
57
|
-
serverList: {
|
|
58
|
-
summary: "List teams",
|
|
59
|
-
description: "List all the teams in the project.",
|
|
60
|
-
tags: ["Teams"],
|
|
61
|
-
},
|
|
62
|
-
serverRead: {
|
|
63
|
-
summary: "Get a team",
|
|
64
|
-
description: "Get a team by ID.",
|
|
65
|
-
tags: ["Teams"],
|
|
66
|
-
},
|
|
67
|
-
serverUpdate: {
|
|
68
|
-
summary: "Update a team",
|
|
69
|
-
description: "Update a team by ID.",
|
|
70
|
-
tags: ["Teams"],
|
|
71
|
-
},
|
|
72
|
-
serverDelete: {
|
|
73
|
-
summary: "Delete a team",
|
|
74
|
-
description: "Delete a team by ID.",
|
|
75
|
-
tags: ["Teams"],
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
});
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import { CrudTypeOf } from "../../crud";
|
|
2
|
-
export declare const usersCrudServerUpdateSchema: import("yup").ObjectSchema<{
|
|
3
|
-
display_name: string | null | undefined;
|
|
4
|
-
profile_image_url: string | undefined;
|
|
5
|
-
client_metadata: {} | null | undefined;
|
|
6
|
-
server_metadata: {} | null | undefined;
|
|
7
|
-
primary_email: string | null | undefined;
|
|
8
|
-
primary_email_verified: boolean | undefined;
|
|
9
|
-
primary_email_auth_enabled: boolean | undefined;
|
|
10
|
-
password: string | null | undefined;
|
|
11
|
-
selected_team_id: string | null | undefined;
|
|
12
|
-
}, import("yup").AnyObject, {
|
|
13
|
-
display_name: undefined;
|
|
14
|
-
profile_image_url: undefined;
|
|
15
|
-
client_metadata: undefined;
|
|
16
|
-
server_metadata: undefined;
|
|
17
|
-
primary_email: undefined;
|
|
18
|
-
primary_email_verified: undefined;
|
|
19
|
-
primary_email_auth_enabled: undefined;
|
|
20
|
-
password: undefined;
|
|
21
|
-
selected_team_id: undefined;
|
|
22
|
-
}, "">;
|
|
23
|
-
export declare const usersCrudServerReadSchema: import("yup").ObjectSchema<{
|
|
24
|
-
project_id: string;
|
|
25
|
-
id: string;
|
|
26
|
-
primary_email: string | null;
|
|
27
|
-
primary_email_verified: NonNullable<boolean | undefined>;
|
|
28
|
-
display_name: string | null;
|
|
29
|
-
selected_team: {} | null;
|
|
30
|
-
selected_team_id: string | null;
|
|
31
|
-
profile_image_url: string | null;
|
|
32
|
-
signed_up_at_millis: number;
|
|
33
|
-
has_password: NonNullable<boolean | undefined>;
|
|
34
|
-
auth_with_email: NonNullable<boolean | undefined>;
|
|
35
|
-
oauth_providers: {
|
|
36
|
-
email?: string | null | undefined;
|
|
37
|
-
provider_id: string;
|
|
38
|
-
account_id: string;
|
|
39
|
-
}[];
|
|
40
|
-
client_metadata: {} | null;
|
|
41
|
-
server_metadata: {} | null;
|
|
42
|
-
}, import("yup").AnyObject, {
|
|
43
|
-
project_id: undefined;
|
|
44
|
-
id: undefined;
|
|
45
|
-
primary_email: undefined;
|
|
46
|
-
primary_email_verified: undefined;
|
|
47
|
-
display_name: undefined;
|
|
48
|
-
selected_team: undefined;
|
|
49
|
-
selected_team_id: undefined;
|
|
50
|
-
profile_image_url: undefined;
|
|
51
|
-
signed_up_at_millis: undefined;
|
|
52
|
-
has_password: undefined;
|
|
53
|
-
auth_with_email: undefined;
|
|
54
|
-
oauth_providers: undefined;
|
|
55
|
-
client_metadata: undefined;
|
|
56
|
-
server_metadata: undefined;
|
|
57
|
-
}, "">;
|
|
58
|
-
export declare const usersCrudServerCreateSchema: import("yup").ObjectSchema<{
|
|
59
|
-
password: string | null | undefined;
|
|
60
|
-
display_name: string | null | undefined;
|
|
61
|
-
primary_email: string | null | undefined;
|
|
62
|
-
profile_image_url: string | undefined;
|
|
63
|
-
client_metadata: {} | null | undefined;
|
|
64
|
-
server_metadata: {} | null | undefined;
|
|
65
|
-
primary_email_verified: boolean | undefined;
|
|
66
|
-
primary_email_auth_enabled: boolean | undefined;
|
|
67
|
-
} & {
|
|
68
|
-
oauth_providers: {
|
|
69
|
-
email: string | null;
|
|
70
|
-
provider_id: string;
|
|
71
|
-
account_id: string;
|
|
72
|
-
}[] | undefined;
|
|
73
|
-
}, import("yup").AnyObject, {
|
|
74
|
-
display_name: undefined;
|
|
75
|
-
profile_image_url: undefined;
|
|
76
|
-
client_metadata: undefined;
|
|
77
|
-
server_metadata: undefined;
|
|
78
|
-
primary_email: undefined;
|
|
79
|
-
primary_email_verified: undefined;
|
|
80
|
-
primary_email_auth_enabled: undefined;
|
|
81
|
-
password: undefined;
|
|
82
|
-
selected_team_id: undefined;
|
|
83
|
-
oauth_providers: undefined;
|
|
84
|
-
}, "">;
|
|
85
|
-
export declare const usersCrudServerDeleteSchema: import("yup").MixedSchema<{} | undefined, import("yup").AnyObject, undefined, "">;
|
|
86
|
-
export declare const usersCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
87
|
-
serverReadSchema: import("yup").ObjectSchema<{
|
|
88
|
-
project_id: string;
|
|
89
|
-
id: string;
|
|
90
|
-
primary_email: string | null;
|
|
91
|
-
primary_email_verified: NonNullable<boolean | undefined>;
|
|
92
|
-
display_name: string | null;
|
|
93
|
-
selected_team: {} | null;
|
|
94
|
-
selected_team_id: string | null;
|
|
95
|
-
profile_image_url: string | null;
|
|
96
|
-
signed_up_at_millis: number;
|
|
97
|
-
has_password: NonNullable<boolean | undefined>;
|
|
98
|
-
auth_with_email: NonNullable<boolean | undefined>;
|
|
99
|
-
oauth_providers: {
|
|
100
|
-
email?: string | null | undefined;
|
|
101
|
-
provider_id: string;
|
|
102
|
-
account_id: string;
|
|
103
|
-
}[];
|
|
104
|
-
client_metadata: {} | null;
|
|
105
|
-
server_metadata: {} | null;
|
|
106
|
-
}, import("yup").AnyObject, {
|
|
107
|
-
project_id: undefined;
|
|
108
|
-
id: undefined;
|
|
109
|
-
primary_email: undefined;
|
|
110
|
-
primary_email_verified: undefined;
|
|
111
|
-
display_name: undefined;
|
|
112
|
-
selected_team: undefined;
|
|
113
|
-
selected_team_id: undefined;
|
|
114
|
-
profile_image_url: undefined;
|
|
115
|
-
signed_up_at_millis: undefined;
|
|
116
|
-
has_password: undefined;
|
|
117
|
-
auth_with_email: undefined;
|
|
118
|
-
oauth_providers: undefined;
|
|
119
|
-
client_metadata: undefined;
|
|
120
|
-
server_metadata: undefined;
|
|
121
|
-
}, "">;
|
|
122
|
-
serverUpdateSchema: import("yup").ObjectSchema<{
|
|
123
|
-
display_name: string | null | undefined;
|
|
124
|
-
profile_image_url: string | undefined;
|
|
125
|
-
client_metadata: {} | null | undefined;
|
|
126
|
-
server_metadata: {} | null | undefined;
|
|
127
|
-
primary_email: string | null | undefined;
|
|
128
|
-
primary_email_verified: boolean | undefined;
|
|
129
|
-
primary_email_auth_enabled: boolean | undefined;
|
|
130
|
-
password: string | null | undefined;
|
|
131
|
-
selected_team_id: string | null | undefined;
|
|
132
|
-
}, import("yup").AnyObject, {
|
|
133
|
-
display_name: undefined;
|
|
134
|
-
profile_image_url: undefined;
|
|
135
|
-
client_metadata: undefined;
|
|
136
|
-
server_metadata: undefined;
|
|
137
|
-
primary_email: undefined;
|
|
138
|
-
primary_email_verified: undefined;
|
|
139
|
-
primary_email_auth_enabled: undefined;
|
|
140
|
-
password: undefined;
|
|
141
|
-
selected_team_id: undefined;
|
|
142
|
-
}, "">;
|
|
143
|
-
serverCreateSchema: import("yup").ObjectSchema<{
|
|
144
|
-
password: string | null | undefined;
|
|
145
|
-
display_name: string | null | undefined;
|
|
146
|
-
primary_email: string | null | undefined;
|
|
147
|
-
profile_image_url: string | undefined;
|
|
148
|
-
client_metadata: {} | null | undefined;
|
|
149
|
-
server_metadata: {} | null | undefined;
|
|
150
|
-
primary_email_verified: boolean | undefined;
|
|
151
|
-
primary_email_auth_enabled: boolean | undefined;
|
|
152
|
-
} & {
|
|
153
|
-
oauth_providers: {
|
|
154
|
-
email: string | null;
|
|
155
|
-
provider_id: string;
|
|
156
|
-
account_id: string;
|
|
157
|
-
}[] | undefined;
|
|
158
|
-
}, import("yup").AnyObject, {
|
|
159
|
-
display_name: undefined;
|
|
160
|
-
profile_image_url: undefined;
|
|
161
|
-
client_metadata: undefined;
|
|
162
|
-
server_metadata: undefined;
|
|
163
|
-
primary_email: undefined;
|
|
164
|
-
primary_email_verified: undefined;
|
|
165
|
-
primary_email_auth_enabled: undefined;
|
|
166
|
-
password: undefined;
|
|
167
|
-
selected_team_id: undefined;
|
|
168
|
-
oauth_providers: undefined;
|
|
169
|
-
}, "">;
|
|
170
|
-
serverDeleteSchema: import("yup").MixedSchema<{} | undefined, import("yup").AnyObject, undefined, "">;
|
|
171
|
-
docs: {
|
|
172
|
-
serverCreate: {
|
|
173
|
-
tags: string[];
|
|
174
|
-
summary: string;
|
|
175
|
-
description: string;
|
|
176
|
-
};
|
|
177
|
-
serverRead: {
|
|
178
|
-
tags: string[];
|
|
179
|
-
summary: string;
|
|
180
|
-
description: string;
|
|
181
|
-
};
|
|
182
|
-
serverUpdate: {
|
|
183
|
-
tags: string[];
|
|
184
|
-
summary: string;
|
|
185
|
-
description: string;
|
|
186
|
-
};
|
|
187
|
-
serverDelete: {
|
|
188
|
-
tags: string[];
|
|
189
|
-
summary: string;
|
|
190
|
-
description: string;
|
|
191
|
-
};
|
|
192
|
-
serverList: {
|
|
193
|
-
tags: string[];
|
|
194
|
-
summary: string;
|
|
195
|
-
description: string;
|
|
196
|
-
};
|
|
197
|
-
};
|
|
198
|
-
}>;
|
|
199
|
-
export type UsersCrud = CrudTypeOf<typeof usersCrud>;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { createCrud } from "../../crud";
|
|
2
|
-
import * as fieldSchema from "../../schema-fields";
|
|
3
|
-
export const usersCrudServerUpdateSchema = fieldSchema.yupObject({
|
|
4
|
-
display_name: fieldSchema.userDisplayNameSchema.optional(),
|
|
5
|
-
profile_image_url: fieldSchema.profileImageUrlSchema.optional(),
|
|
6
|
-
client_metadata: fieldSchema.userClientMetadataSchema.optional(),
|
|
7
|
-
server_metadata: fieldSchema.userServerMetadataSchema.optional(),
|
|
8
|
-
primary_email: fieldSchema.primaryEmailSchema.nullable().optional(),
|
|
9
|
-
primary_email_verified: fieldSchema.primaryEmailVerifiedSchema.optional(),
|
|
10
|
-
primary_email_auth_enabled: fieldSchema.yupBoolean().optional().meta({ openapiField: { description: "Whether the primary email can be used to sign into this user's account", exampleValue: true } }),
|
|
11
|
-
password: fieldSchema.yupString().nullable().meta({ openapiField: { description: 'A new password for the user, overwriting the old one (if it exists).', exampleValue: 'password' } }),
|
|
12
|
-
selected_team_id: fieldSchema.selectedTeamIdSchema.nullable().optional(),
|
|
13
|
-
}).required();
|
|
14
|
-
export const usersCrudServerReadSchema = fieldSchema.yupObject({
|
|
15
|
-
project_id: fieldSchema.projectIdSchema.required(),
|
|
16
|
-
id: fieldSchema.userIdSchema.required(),
|
|
17
|
-
primary_email: fieldSchema.primaryEmailSchema.nullable().defined(),
|
|
18
|
-
primary_email_verified: fieldSchema.primaryEmailVerifiedSchema.required(),
|
|
19
|
-
display_name: fieldSchema.userDisplayNameSchema.nullable().defined(),
|
|
20
|
-
// TODO give this one the type of an actual team
|
|
21
|
-
selected_team: fieldSchema.yupMixed().nullable().defined(),
|
|
22
|
-
selected_team_id: fieldSchema.selectedTeamIdSchema.nullable().defined(),
|
|
23
|
-
profile_image_url: fieldSchema.profileImageUrlSchema.nullable().defined(),
|
|
24
|
-
signed_up_at_millis: fieldSchema.signedUpAtMillisSchema.required(),
|
|
25
|
-
has_password: fieldSchema.yupBoolean().required().meta({ openapiField: { description: 'Whether the user has a password associated with their account', exampleValue: true } }),
|
|
26
|
-
auth_with_email: fieldSchema.yupBoolean().required().meta({ openapiField: { description: 'Whether the user can authenticate with their primary e-mail. If set to true, the user can log-in with credentials and/or magic link, if enabled in the project settings.', exampleValue: true } }),
|
|
27
|
-
oauth_providers: fieldSchema.yupArray(fieldSchema.yupObject({
|
|
28
|
-
provider_id: fieldSchema.yupString().required(),
|
|
29
|
-
account_id: fieldSchema.yupString().required(),
|
|
30
|
-
email: fieldSchema.yupString().nullable(),
|
|
31
|
-
}).required()).required().meta({ openapiField: { description: 'A list of OAuth providers connected to this account', exampleValue: ['google', 'github'] } }),
|
|
32
|
-
client_metadata: fieldSchema.userClientMetadataSchema,
|
|
33
|
-
server_metadata: fieldSchema.userServerMetadataSchema,
|
|
34
|
-
}).required();
|
|
35
|
-
export const usersCrudServerCreateSchema = usersCrudServerUpdateSchema.omit(['selected_team_id']).concat(fieldSchema.yupObject({
|
|
36
|
-
oauth_providers: fieldSchema.yupArray(fieldSchema.yupObject({
|
|
37
|
-
provider_id: fieldSchema.yupString().required(),
|
|
38
|
-
account_id: fieldSchema.yupString().required(),
|
|
39
|
-
email: fieldSchema.yupString().nullable().defined().default(null),
|
|
40
|
-
}).required()).optional(),
|
|
41
|
-
}).required());
|
|
42
|
-
export const usersCrudServerDeleteSchema = fieldSchema.yupMixed();
|
|
43
|
-
export const usersCrud = createCrud({
|
|
44
|
-
serverReadSchema: usersCrudServerReadSchema,
|
|
45
|
-
serverUpdateSchema: usersCrudServerUpdateSchema,
|
|
46
|
-
serverCreateSchema: usersCrudServerCreateSchema,
|
|
47
|
-
serverDeleteSchema: usersCrudServerDeleteSchema,
|
|
48
|
-
docs: {
|
|
49
|
-
serverCreate: {
|
|
50
|
-
tags: ["Users"],
|
|
51
|
-
summary: 'Create user',
|
|
52
|
-
description: 'Creates a new user. E-mail authentication is always enabled, and no password is set, meaning the only way to authenticate the newly created user is through magic link.',
|
|
53
|
-
},
|
|
54
|
-
serverRead: {
|
|
55
|
-
tags: ["Users"],
|
|
56
|
-
summary: 'Get user',
|
|
57
|
-
description: 'Gets a user by user ID.',
|
|
58
|
-
},
|
|
59
|
-
serverUpdate: {
|
|
60
|
-
tags: ["Users"],
|
|
61
|
-
summary: 'Update user',
|
|
62
|
-
description: 'Updates a user. Only the values provided will be updated.',
|
|
63
|
-
},
|
|
64
|
-
serverDelete: {
|
|
65
|
-
tags: ["Users"],
|
|
66
|
-
summary: 'Delete user',
|
|
67
|
-
description: 'Deletes a user. Use this with caution.',
|
|
68
|
-
},
|
|
69
|
-
serverList: {
|
|
70
|
-
tags: ["Users"],
|
|
71
|
-
summary: 'List users',
|
|
72
|
-
description: 'Lists all the users in the project.',
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
});
|