@treeseed/sdk 0.13.0-rc.40 → 0.13.0-rc.42
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/dist/operator-contracts/catalog/admin-account-team-operations.d.ts +36 -0
- package/dist/operator-contracts/catalog/admin-account-team-operations.js +52 -0
- package/dist/operator-contracts/control-plane-operations.d.ts +32 -0
- package/dist/operator-contracts/control-plane-operations.js +5 -2
- package/package.json +1 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const adminAccountOperations: {
|
|
2
|
+
readonly publicProfile: import("../control-plane-operation.js").ControlPlaneOperationBinding<{
|
|
3
|
+
username: string;
|
|
4
|
+
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
5
|
+
readonly updateUsername: import("../control-plane-operation.js").ControlPlaneOperationBinding<{}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
6
|
+
readonly notificationPreferences: import("../control-plane-operation.js").ControlPlaneOperationBinding<{}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
7
|
+
readonly updateNotificationPreferences: import("../control-plane-operation.js").ControlPlaneOperationBinding<{}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
8
|
+
readonly themes: import("../control-plane-operation.js").ControlPlaneOperationBinding<{}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
9
|
+
readonly createTheme: import("../control-plane-operation.js").ControlPlaneOperationBinding<{}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
10
|
+
readonly updateTheme: import("../control-plane-operation.js").ControlPlaneOperationBinding<{
|
|
11
|
+
themeId: string;
|
|
12
|
+
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
13
|
+
readonly deleteTheme: import("../control-plane-operation.js").ControlPlaneOperationBinding<{
|
|
14
|
+
themeId: string;
|
|
15
|
+
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
16
|
+
readonly unlinkProvider: import("../control-plane-operation.js").ControlPlaneOperationBinding<{
|
|
17
|
+
identityId: string;
|
|
18
|
+
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
19
|
+
};
|
|
20
|
+
export declare const adminTeamOperations: {
|
|
21
|
+
readonly revokeInvite: import("../control-plane-operation.js").ControlPlaneOperationBinding<{
|
|
22
|
+
teamId: string;
|
|
23
|
+
inviteId: string;
|
|
24
|
+
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
25
|
+
readonly resendInvite: import("../control-plane-operation.js").ControlPlaneOperationBinding<{
|
|
26
|
+
teamId: string;
|
|
27
|
+
inviteId: string;
|
|
28
|
+
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
29
|
+
readonly memberRemovalBlockers: import("../control-plane-operation.js").ControlPlaneOperationBinding<{
|
|
30
|
+
teamId: string;
|
|
31
|
+
membershipId: string;
|
|
32
|
+
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
33
|
+
readonly remove: import("../control-plane-operation.js").ControlPlaneOperationBinding<{
|
|
34
|
+
teamId: string;
|
|
35
|
+
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
36
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineOperation } from "../operation-builder.js";
|
|
3
|
+
const empty = z.object({}).strict();
|
|
4
|
+
const none = z.undefined();
|
|
5
|
+
const record = z.record(z.unknown());
|
|
6
|
+
function operation(operationId, method, path, pathShape, options) {
|
|
7
|
+
const read = method === "GET";
|
|
8
|
+
const riskClass = options.risk ?? "ordinary";
|
|
9
|
+
return defineOperation({
|
|
10
|
+
operationId,
|
|
11
|
+
description: `${read ? "Read" : "Apply"} ${operationId}.`,
|
|
12
|
+
rest: { method, path },
|
|
13
|
+
...Object.keys(pathShape).length ? { parameters: `treeseed.${operationId}.parameters/v1` } : {},
|
|
14
|
+
capability: options.capability,
|
|
15
|
+
authentication: options.authentication ?? "oauth",
|
|
16
|
+
oauthScopes: options.authentication === "anonymous" ? [] : [read ? "treeseed:read" : "treeseed:projects:write"],
|
|
17
|
+
kind: read ? "read" : "mutation",
|
|
18
|
+
riskClass,
|
|
19
|
+
confirmation: riskClass === "ordinary" ? "never" : "input_required",
|
|
20
|
+
surfaces: options.surfaces ?? ["rest"],
|
|
21
|
+
cacheScope: options.cacheScope ?? (read ? "principal" : "none"),
|
|
22
|
+
pagination: options.pagination ?? "none",
|
|
23
|
+
concurrencyRequired: options.concurrency,
|
|
24
|
+
redactedPaths: options.redactedPaths
|
|
25
|
+
}, {
|
|
26
|
+
path: z.object(pathShape).strict(),
|
|
27
|
+
query: read ? record : empty,
|
|
28
|
+
body: read ? none : record,
|
|
29
|
+
output: record
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const adminAccountOperations = {
|
|
33
|
+
publicProfile: operation("accounts.profile.public.show", "GET", "/v1/users/by-username/{username}/profile", { username: z.string().min(1) }, { capability: "accounts.public.read", authentication: "anonymous", cacheScope: "public", surfaces: ["rest", "mcp_resource"] }),
|
|
34
|
+
updateUsername: operation("accounts.username.update", "PATCH", "/v1/auth/web/username", {}, { capability: "accounts.write", concurrency: true }),
|
|
35
|
+
notificationPreferences: operation("accounts.notification.preferences.show", "GET", "/v1/auth/web/notifications/preferences", {}, { capability: "accounts.read" }),
|
|
36
|
+
updateNotificationPreferences: operation("accounts.notification.preferences.update", "PUT", "/v1/auth/web/notifications/preferences", {}, { capability: "accounts.write", concurrency: true }),
|
|
37
|
+
themes: operation("accounts.themes.list", "GET", "/v1/auth/web/themes", {}, { capability: "accounts.read", pagination: "cursor" }),
|
|
38
|
+
createTheme: operation("accounts.themes.create", "POST", "/v1/auth/web/themes", {}, { capability: "accounts.write" }),
|
|
39
|
+
updateTheme: operation("accounts.themes.update", "PUT", "/v1/auth/web/themes/{themeId}", { themeId: z.string().min(1) }, { capability: "accounts.write", concurrency: true }),
|
|
40
|
+
deleteTheme: operation("accounts.themes.delete", "DELETE", "/v1/auth/web/themes/{themeId}", { themeId: z.string().min(1) }, { capability: "accounts.write", risk: "destructive", concurrency: true }),
|
|
41
|
+
unlinkProvider: operation("accounts.providers.unlink", "DELETE", "/v1/auth/web/providers/{identityId}", { identityId: z.string().min(1) }, { capability: "accounts.write", risk: "credential" })
|
|
42
|
+
};
|
|
43
|
+
const adminTeamOperations = {
|
|
44
|
+
revokeInvite: operation("teams.invites.revoke", "DELETE", "/v1/teams/{teamId}/invites/{inviteId}", { teamId: z.string().min(1), inviteId: z.string().min(1) }, { capability: "teams.write", risk: "destructive", concurrency: true }),
|
|
45
|
+
resendInvite: operation("teams.invites.resend", "POST", "/v1/teams/{teamId}/invites/{inviteId}/resend", { teamId: z.string().min(1), inviteId: z.string().min(1) }, { capability: "teams.write" }),
|
|
46
|
+
memberRemovalBlockers: operation("teams.members.removal.blockers", "GET", "/v1/teams/{teamId}/members/{membershipId}/removal-blockers", { teamId: z.string().min(1), membershipId: z.string().min(1) }, { capability: "teams.read" }),
|
|
47
|
+
remove: operation("teams.delete", "DELETE", "/v1/teams/{teamId}/permanent-delete", { teamId: z.string().min(1) }, { capability: "teams.delete", risk: "irreversible", concurrency: true, redactedPaths: ["body.confirmation", "body.currentPassword", "body.reauthenticationGrantId"] })
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
adminAccountOperations,
|
|
51
|
+
adminTeamOperations
|
|
52
|
+
};
|
|
@@ -82,6 +82,23 @@ export declare const CONTROL_PLANE_OPERATIONS: {
|
|
|
82
82
|
readonly readNotification: ControlPlaneOperationBinding<{
|
|
83
83
|
notificationId: string;
|
|
84
84
|
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
85
|
+
readonly publicProfile: ControlPlaneOperationBinding<{
|
|
86
|
+
username: string;
|
|
87
|
+
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
88
|
+
readonly updateUsername: ControlPlaneOperationBinding<{}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
89
|
+
readonly notificationPreferences: ControlPlaneOperationBinding<{}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
90
|
+
readonly updateNotificationPreferences: ControlPlaneOperationBinding<{}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
91
|
+
readonly themes: ControlPlaneOperationBinding<{}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
92
|
+
readonly createTheme: ControlPlaneOperationBinding<{}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
93
|
+
readonly updateTheme: ControlPlaneOperationBinding<{
|
|
94
|
+
themeId: string;
|
|
95
|
+
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
96
|
+
readonly deleteTheme: ControlPlaneOperationBinding<{
|
|
97
|
+
themeId: string;
|
|
98
|
+
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
99
|
+
readonly unlinkProvider: ControlPlaneOperationBinding<{
|
|
100
|
+
identityId: string;
|
|
101
|
+
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
85
102
|
};
|
|
86
103
|
readonly teams: {
|
|
87
104
|
readonly list: ControlPlaneOperationBinding<{}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
@@ -133,6 +150,21 @@ export declare const CONTROL_PLANE_OPERATIONS: {
|
|
|
133
150
|
readonly leave: ControlPlaneOperationBinding<{
|
|
134
151
|
teamId: string;
|
|
135
152
|
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
153
|
+
readonly revokeInvite: ControlPlaneOperationBinding<{
|
|
154
|
+
teamId: string;
|
|
155
|
+
inviteId: string;
|
|
156
|
+
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
157
|
+
readonly resendInvite: ControlPlaneOperationBinding<{
|
|
158
|
+
teamId: string;
|
|
159
|
+
inviteId: string;
|
|
160
|
+
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
161
|
+
readonly memberRemovalBlockers: ControlPlaneOperationBinding<{
|
|
162
|
+
teamId: string;
|
|
163
|
+
membershipId: string;
|
|
164
|
+
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
165
|
+
readonly remove: ControlPlaneOperationBinding<{
|
|
166
|
+
teamId: string;
|
|
167
|
+
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
136
168
|
};
|
|
137
169
|
readonly discussions: {
|
|
138
170
|
readonly list: ControlPlaneOperationBinding<{}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { defineOperation as define, defineTreeDxProxyOperation as treedxProxy } from "./operation-builder.js";
|
|
3
3
|
import { communicationOperations, providerDiscussionResponseOperation } from "./catalog/communication-operations.js";
|
|
4
|
+
import { adminAccountOperations, adminTeamOperations } from "./catalog/admin-account-team-operations.js";
|
|
4
5
|
const empty = z.object({}).strict();
|
|
5
6
|
const none = z.undefined();
|
|
6
7
|
const record = z.record(z.unknown());
|
|
@@ -88,7 +89,7 @@ function resource(operationId, method, path, pathShape, options = { capability:
|
|
|
88
89
|
riskClass,
|
|
89
90
|
confirmation: riskClass === "ordinary" ? "never" : "input_required",
|
|
90
91
|
surfaces: options.surfaces ?? ["rest"],
|
|
91
|
-
cacheScope: kind === "read" ? "principal" : "none",
|
|
92
|
+
cacheScope: options.cacheScope ?? (kind === "read" ? "principal" : "none"),
|
|
92
93
|
pagination: options.pagination ?? "none",
|
|
93
94
|
concurrencyRequired: options.concurrency,
|
|
94
95
|
redactedPaths: options.redactedPaths
|
|
@@ -130,6 +131,7 @@ const CONTROL_PLANE_OPERATIONS = {
|
|
|
130
131
|
updateRepositoryTopology: resource("projects.repository.update", "PUT", "/v1/projects/{projectId}/repository-topology", { projectId: z.string().min(1) }, { capability: "repositories.write", concurrency: true })
|
|
131
132
|
},
|
|
132
133
|
accounts: {
|
|
134
|
+
...adminAccountOperations,
|
|
133
135
|
current: resource("accounts.current.show", "GET", "/v1/me", {}, { capability: "accounts.read", surfaces: ["rest", "cli", "mcp_resource"] }),
|
|
134
136
|
register: resource("accounts.register", "POST", "/v1/auth/web/sign-up", {}, { capability: "accounts.register", scopes: [], redactedPaths: ["body.password"] }),
|
|
135
137
|
confirmEmail: resource("accounts.email.confirm", "POST", "/v1/auth/web/confirm-email", {}, { capability: "accounts.register", scopes: [], redactedPaths: ["body.token"] }),
|
|
@@ -153,9 +155,10 @@ const CONTROL_PLANE_OPERATIONS = {
|
|
|
153
155
|
readNotification: resource("accounts.notifications.read", "POST", "/v1/auth/web/notifications/{notificationId}/read", { notificationId: z.string().min(1) }, { capability: "accounts.write" })
|
|
154
156
|
},
|
|
155
157
|
teams: {
|
|
158
|
+
...adminTeamOperations,
|
|
156
159
|
list: resource("teams.list", "GET", "/v1/teams", {}, { capability: "teams.read", surfaces: ["rest", "cli", "mcp_tool"], pagination: "cursor" }),
|
|
157
160
|
create: resource("teams.create", "POST", "/v1/teams", {}, { capability: "teams.write", surfaces: ["rest", "cli", "mcp_tool"] }),
|
|
158
|
-
profile: resource("teams.profile.show", "GET", "/v1/teams/by-name/{name}/profile", { name: z.string().min(1) }, { capability: "teams.read", surfaces: ["rest", "mcp_resource"] }),
|
|
161
|
+
profile: resource("teams.profile.show", "GET", "/v1/teams/by-name/{name}/profile", { name: z.string().min(1) }, { capability: "teams.read", scopes: [], authentication: "anonymous", cacheScope: "public", surfaces: ["rest", "mcp_resource"] }),
|
|
159
162
|
update: resource("teams.update", "PATCH", "/v1/teams/{teamId}", { teamId: z.string().min(1) }, { capability: "teams.write", concurrency: true }),
|
|
160
163
|
access: resource("teams.access.show", "GET", "/v1/teams/{teamId}/access", { teamId: z.string().min(1) }, { capability: "teams.read" }),
|
|
161
164
|
members: resource("teams.members.list", "GET", "/v1/teams/{teamId}/members", { teamId: z.string().min(1) }, { capability: "teams.read", pagination: "cursor" }),
|