@converge.ai/a13n 0.0.3-rc.1 → 0.0.90
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/README.md +110 -39
- package/dist/client.d.ts +15 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +18 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +26 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +56 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +12 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/resources/base.d.ts +47 -0
- package/dist/resources/base.d.ts.map +1 -0
- package/dist/resources/base.js +220 -0
- package/dist/resources/base.js.map +1 -0
- package/dist/resources/generated.d.ts +4130 -0
- package/dist/resources/generated.d.ts.map +1 -0
- package/dist/resources/generated.js +3301 -0
- package/dist/resources/generated.js.map +1 -0
- package/dist/resources/interaction.d.ts +22 -0
- package/dist/resources/interaction.d.ts.map +1 -0
- package/dist/resources/interaction.js +54 -0
- package/dist/resources/interaction.js.map +1 -0
- package/dist/schema.d.ts +13660 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +2 -0
- package/dist/schema.js.map +1 -0
- package/dist/semantic.d.ts +270 -0
- package/dist/semantic.d.ts.map +1 -0
- package/dist/semantic.js +331 -0
- package/dist/semantic.js.map +1 -0
- package/dist/streams/sse.d.ts +13 -0
- package/dist/streams/sse.d.ts.map +1 -0
- package/dist/streams/sse.js +92 -0
- package/dist/streams/sse.js.map +1 -0
- package/dist/streams/thread-stream.d.ts +55 -0
- package/dist/streams/thread-stream.d.ts.map +1 -0
- package/dist/streams/thread-stream.js +116 -0
- package/dist/streams/thread-stream.js.map +1 -0
- package/dist/transport.d.ts +35 -0
- package/dist/transport.d.ts.map +1 -0
- package/dist/transport.js +172 -0
- package/dist/transport.js.map +1 -0
- package/dist/workspace-scope.d.ts +2 -0
- package/dist/workspace-scope.d.ts.map +1 -0
- package/dist/workspace-scope.js +166 -0
- package/dist/workspace-scope.js.map +1 -0
- package/openapi.json +29533 -0
- package/package.json +18 -9
|
@@ -0,0 +1,3301 @@
|
|
|
1
|
+
import { jsonRequest, uploadRequest, binaryRequest, multipartBody, selector, snapshot, withCursor, PageIterator, flattenPages, } from "./base.js";
|
|
2
|
+
export class ServiceResources {
|
|
3
|
+
transport;
|
|
4
|
+
constructor(transport) {
|
|
5
|
+
this.transport = transport;
|
|
6
|
+
}
|
|
7
|
+
/** POST /api/v1/agent-composer. Preserves response metadata; mutations are not replayed. */
|
|
8
|
+
agentComposer(options = {}) {
|
|
9
|
+
return jsonRequest(this.transport, "POST", "/api/v1/agent-composer", undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
10
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
11
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
12
|
+
}
|
|
13
|
+
get agents() {
|
|
14
|
+
return new AgentsResource(this.transport, "/api/v1/agents");
|
|
15
|
+
}
|
|
16
|
+
get assets() {
|
|
17
|
+
return new AssetsResource(this.transport, "/api/v1/assets");
|
|
18
|
+
}
|
|
19
|
+
get auth() {
|
|
20
|
+
return new AuthResource(this.transport, "/api/v1/auth");
|
|
21
|
+
}
|
|
22
|
+
get connections() {
|
|
23
|
+
return new ConnectionsResource(this.transport, "/api/v1/connections");
|
|
24
|
+
}
|
|
25
|
+
get connectorProviders() {
|
|
26
|
+
return new ConnectorProvidersResource(this.transport, "/api/v1/connector-providers");
|
|
27
|
+
}
|
|
28
|
+
get environmentProviders() {
|
|
29
|
+
return new EnvironmentProvidersResource(this.transport, "/api/v1/environment-providers");
|
|
30
|
+
}
|
|
31
|
+
get environmentTemplates() {
|
|
32
|
+
return new EnvironmentTemplatesResource(this.transport, "/api/v1/environment-templates");
|
|
33
|
+
}
|
|
34
|
+
get environments() {
|
|
35
|
+
return new EnvironmentsResource(this.transport, "/api/v1/environments");
|
|
36
|
+
}
|
|
37
|
+
get invitations() {
|
|
38
|
+
return new InvitationsResource(this.transport, "/api/v1/invitations");
|
|
39
|
+
}
|
|
40
|
+
get mcpServers() {
|
|
41
|
+
return new McpServersResource(this.transport, "/api/v1/mcp-servers");
|
|
42
|
+
}
|
|
43
|
+
get mediaUnderstandingDefaults() {
|
|
44
|
+
return new MediaUnderstandingDefaultsResource(this.transport, "/api/v1/media-understanding-defaults");
|
|
45
|
+
}
|
|
46
|
+
get memories() {
|
|
47
|
+
return new MemoriesResource(this.transport, "/api/v1/memories");
|
|
48
|
+
}
|
|
49
|
+
get memoryProviders() {
|
|
50
|
+
return new MemoryProvidersResource(this.transport, "/api/v1/memory-providers");
|
|
51
|
+
}
|
|
52
|
+
get modelCatalog() {
|
|
53
|
+
return new ModelCatalogResource(this.transport, "/api/v1/model-catalog");
|
|
54
|
+
}
|
|
55
|
+
get modelProviders() {
|
|
56
|
+
return new ModelProvidersResource(this.transport, "/api/v1/model-providers");
|
|
57
|
+
}
|
|
58
|
+
get models() {
|
|
59
|
+
return new ModelsResource(this.transport, "/api/v1/models");
|
|
60
|
+
}
|
|
61
|
+
get organizations() {
|
|
62
|
+
return new OrganizationsResource(this.transport, "/api/v1/organizations");
|
|
63
|
+
}
|
|
64
|
+
get providerTypes() {
|
|
65
|
+
return new ProviderTypesResource(this.transport, "/api/v1/provider-types");
|
|
66
|
+
}
|
|
67
|
+
get runs() {
|
|
68
|
+
return new RunsResource(this.transport, "/api/v1/runs");
|
|
69
|
+
}
|
|
70
|
+
get sessions() {
|
|
71
|
+
return new SessionsResource(this.transport, "/api/v1/sessions");
|
|
72
|
+
}
|
|
73
|
+
get skills() {
|
|
74
|
+
return new SkillsResource(this.transport, "/api/v1/skills");
|
|
75
|
+
}
|
|
76
|
+
get subscriptions() {
|
|
77
|
+
return new SubscriptionsResource(this.transport, "/api/v1/subscriptions");
|
|
78
|
+
}
|
|
79
|
+
get threads() {
|
|
80
|
+
return new ThreadsResource(this.transport, "/api/v1/threads");
|
|
81
|
+
}
|
|
82
|
+
get toolsets() {
|
|
83
|
+
return new ToolsetsResource(this.transport, "/api/v1/toolsets");
|
|
84
|
+
}
|
|
85
|
+
get traceBackend() {
|
|
86
|
+
return new TraceBackendResource(this.transport, "/api/v1/trace-backend");
|
|
87
|
+
}
|
|
88
|
+
get traces() {
|
|
89
|
+
return new TracesResource(this.transport, "/api/v1/traces");
|
|
90
|
+
}
|
|
91
|
+
get uploads() {
|
|
92
|
+
return new UploadsResource(this.transport, "/api/v1/uploads");
|
|
93
|
+
}
|
|
94
|
+
get usage() {
|
|
95
|
+
return new UsageResource(this.transport, "/api/v1/usage");
|
|
96
|
+
}
|
|
97
|
+
get users() {
|
|
98
|
+
return new UsersResource(this.transport, "/api/v1/users");
|
|
99
|
+
}
|
|
100
|
+
get webProviders() {
|
|
101
|
+
return new WebProvidersResource(this.transport, "/api/v1/web-providers");
|
|
102
|
+
}
|
|
103
|
+
get workspaces() {
|
|
104
|
+
return new WorkspacesResource(this.transport, "/api/v1/workspaces");
|
|
105
|
+
}
|
|
106
|
+
get healthz() {
|
|
107
|
+
return new HealthzResource(this.transport, "/healthz");
|
|
108
|
+
}
|
|
109
|
+
get readyz() {
|
|
110
|
+
return new ReadyzResource(this.transport, "/readyz");
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
export class AgentsResource {
|
|
114
|
+
transport;
|
|
115
|
+
path;
|
|
116
|
+
constructor(transport, path) {
|
|
117
|
+
this.transport = transport;
|
|
118
|
+
this.path = path;
|
|
119
|
+
}
|
|
120
|
+
/** GET /api/v1/agents. Preserves response metadata; mutations are not replayed. */
|
|
121
|
+
list(options = {}) {
|
|
122
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
123
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
124
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
125
|
+
}
|
|
126
|
+
pages(options = {}) {
|
|
127
|
+
const query = snapshot(options.query ?? {});
|
|
128
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
129
|
+
}
|
|
130
|
+
items(options = {}) {
|
|
131
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
132
|
+
}
|
|
133
|
+
/** POST /api/v1/agents. Preserves response metadata; mutations are not replayed. */
|
|
134
|
+
create(body, options = {}) {
|
|
135
|
+
return jsonRequest(this.transport, "POST", this.path, body, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
136
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
137
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
138
|
+
}
|
|
139
|
+
/** POST /api/v1/agents/validate. Preserves response metadata; mutations are not replayed. */
|
|
140
|
+
validate(body, options = {}) {
|
|
141
|
+
return jsonRequest(this.transport, "POST", this.path + "/validate", body, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
142
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
143
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
144
|
+
}
|
|
145
|
+
ref(value) {
|
|
146
|
+
return new AgentsAgentIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
export class AgentsAgentIdResource {
|
|
150
|
+
transport;
|
|
151
|
+
path;
|
|
152
|
+
constructor(transport, path) {
|
|
153
|
+
this.transport = transport;
|
|
154
|
+
this.path = path;
|
|
155
|
+
}
|
|
156
|
+
/** GET /api/v1/agents/{agent_id}. Preserves response metadata; mutations are not replayed. */
|
|
157
|
+
get(options = {}) {
|
|
158
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
159
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
160
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
161
|
+
}
|
|
162
|
+
/** PATCH /api/v1/agents/{agent_id}. Preserves response metadata; mutations are not replayed. */
|
|
163
|
+
update(body, options) {
|
|
164
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, Object.fromEntries(Object.entries({
|
|
165
|
+
"If-Match": options.ifMatch,
|
|
166
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
167
|
+
})
|
|
168
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
169
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
170
|
+
}
|
|
171
|
+
/** POST /api/v1/agents/{agent_id}/archive. Preserves response metadata; mutations are not replayed. */
|
|
172
|
+
archive(options) {
|
|
173
|
+
return jsonRequest(this.transport, "POST", this.path + "/archive", undefined, Object.fromEntries(Object.entries({
|
|
174
|
+
"If-Match": options.ifMatch,
|
|
175
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
176
|
+
})
|
|
177
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
178
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
179
|
+
}
|
|
180
|
+
get avatar() {
|
|
181
|
+
return new AgentsAgentIdAvatarResource(this.transport, this.path + "/avatar");
|
|
182
|
+
}
|
|
183
|
+
/** POST /api/v1/agents/{agent_id}/duplicate. Preserves response metadata; mutations are not replayed. */
|
|
184
|
+
duplicate(body, options = {}) {
|
|
185
|
+
return jsonRequest(this.transport, "POST", this.path + "/duplicate", body, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
186
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
187
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
188
|
+
}
|
|
189
|
+
get revisions() {
|
|
190
|
+
return new AgentsAgentIdRevisionsResource(this.transport, this.path + "/revisions");
|
|
191
|
+
}
|
|
192
|
+
/** POST /api/v1/agents/{agent_id}/unarchive. Preserves response metadata; mutations are not replayed. */
|
|
193
|
+
unarchive(options) {
|
|
194
|
+
return jsonRequest(this.transport, "POST", this.path + "/unarchive", undefined, Object.fromEntries(Object.entries({
|
|
195
|
+
"If-Match": options.ifMatch,
|
|
196
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
197
|
+
})
|
|
198
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
199
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
export class AgentsAgentIdAvatarResource {
|
|
203
|
+
transport;
|
|
204
|
+
path;
|
|
205
|
+
constructor(transport, path) {
|
|
206
|
+
this.transport = transport;
|
|
207
|
+
this.path = path;
|
|
208
|
+
}
|
|
209
|
+
/** DELETE /api/v1/agents/{agent_id}/avatar. Preserves response metadata; mutations are not replayed. */
|
|
210
|
+
delete(options) {
|
|
211
|
+
return jsonRequest(this.transport, "DELETE", this.path, undefined, Object.fromEntries(Object.entries({
|
|
212
|
+
"If-Match": options.ifMatch,
|
|
213
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
214
|
+
})
|
|
215
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
216
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
217
|
+
}
|
|
218
|
+
/** GET /api/v1/agents/{agent_id}/avatar. Caller owns and closes the unbuffered body. */
|
|
219
|
+
get(options = {}) {
|
|
220
|
+
return binaryRequest(this.transport, this.path, {
|
|
221
|
+
...{ signal: options.signal },
|
|
222
|
+
headers: Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
223
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
224
|
+
.map(([key, value]) => [key, String(value)])),
|
|
225
|
+
accept: "image/jpeg, image/png, image/webp",
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
/** PUT /api/v1/agents/{agent_id}/avatar. Preserves response metadata; mutations are not replayed. */
|
|
229
|
+
replace(body, options) {
|
|
230
|
+
return uploadRequest(this.transport, "PUT", this.path, body, options.contentType, Object.fromEntries(Object.entries({
|
|
231
|
+
"If-Match": options.ifMatch,
|
|
232
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
233
|
+
})
|
|
234
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
235
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
export class AgentsAgentIdRevisionsResource {
|
|
239
|
+
transport;
|
|
240
|
+
path;
|
|
241
|
+
constructor(transport, path) {
|
|
242
|
+
this.transport = transport;
|
|
243
|
+
this.path = path;
|
|
244
|
+
}
|
|
245
|
+
/** GET /api/v1/agents/{agent_id}/revisions. Preserves response metadata; mutations are not replayed. */
|
|
246
|
+
list(options = {}) {
|
|
247
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
248
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
249
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
250
|
+
}
|
|
251
|
+
pages(options = {}) {
|
|
252
|
+
const query = snapshot(options.query ?? {});
|
|
253
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
254
|
+
}
|
|
255
|
+
items(options = {}) {
|
|
256
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
257
|
+
}
|
|
258
|
+
/** POST /api/v1/agents/{agent_id}/revisions. Preserves response metadata; mutations are not replayed. */
|
|
259
|
+
create(body, options) {
|
|
260
|
+
return jsonRequest(this.transport, "POST", this.path, body, Object.fromEntries(Object.entries({
|
|
261
|
+
"If-Match": options.ifMatch,
|
|
262
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
263
|
+
})
|
|
264
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
265
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
266
|
+
}
|
|
267
|
+
ref(value) {
|
|
268
|
+
return new AgentsAgentIdRevisionsRevisionIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
export class AgentsAgentIdRevisionsRevisionIdResource {
|
|
272
|
+
transport;
|
|
273
|
+
path;
|
|
274
|
+
constructor(transport, path) {
|
|
275
|
+
this.transport = transport;
|
|
276
|
+
this.path = path;
|
|
277
|
+
}
|
|
278
|
+
/** GET /api/v1/agents/{agent_id}/revisions/{revision_id}. Preserves response metadata; mutations are not replayed. */
|
|
279
|
+
get(options = {}) {
|
|
280
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
281
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
282
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
283
|
+
}
|
|
284
|
+
/** POST /api/v1/agents/{agent_id}/revisions/{revision_id}/set-default. Preserves response metadata; mutations are not replayed. */
|
|
285
|
+
setDefault(options) {
|
|
286
|
+
return jsonRequest(this.transport, "POST", this.path + "/set-default", undefined, Object.fromEntries(Object.entries({
|
|
287
|
+
"If-Match": options.ifMatch,
|
|
288
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
289
|
+
})
|
|
290
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
291
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
export class AssetsResource {
|
|
295
|
+
transport;
|
|
296
|
+
path;
|
|
297
|
+
constructor(transport, path) {
|
|
298
|
+
this.transport = transport;
|
|
299
|
+
this.path = path;
|
|
300
|
+
}
|
|
301
|
+
/** GET /api/v1/assets. Preserves response metadata; mutations are not replayed. */
|
|
302
|
+
list(options = {}) {
|
|
303
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
304
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
305
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
306
|
+
}
|
|
307
|
+
pages(options = {}) {
|
|
308
|
+
const query = snapshot(options.query ?? {});
|
|
309
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
310
|
+
}
|
|
311
|
+
items(options = {}) {
|
|
312
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
313
|
+
}
|
|
314
|
+
/** POST /api/v1/assets. Preserves response metadata; mutations are not replayed. */
|
|
315
|
+
create(body, options = {}) {
|
|
316
|
+
return jsonRequest(this.transport, "POST", this.path, body, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
317
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
318
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
319
|
+
}
|
|
320
|
+
ref(value) {
|
|
321
|
+
return new AssetsAssetIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
export class AssetsAssetIdResource {
|
|
325
|
+
transport;
|
|
326
|
+
path;
|
|
327
|
+
constructor(transport, path) {
|
|
328
|
+
this.transport = transport;
|
|
329
|
+
this.path = path;
|
|
330
|
+
}
|
|
331
|
+
/** DELETE /api/v1/assets/{asset_id}. Preserves response metadata; mutations are not replayed. */
|
|
332
|
+
delete(options) {
|
|
333
|
+
return jsonRequest(this.transport, "DELETE", this.path, undefined, Object.fromEntries(Object.entries({
|
|
334
|
+
"If-Match": options.ifMatch,
|
|
335
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
336
|
+
})
|
|
337
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
338
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
339
|
+
}
|
|
340
|
+
/** GET /api/v1/assets/{asset_id}. Preserves response metadata; mutations are not replayed. */
|
|
341
|
+
get(options = {}) {
|
|
342
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
343
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
344
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
345
|
+
}
|
|
346
|
+
get content() {
|
|
347
|
+
return new AssetsAssetIdContentResource(this.transport, this.path + "/content");
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
export class AssetsAssetIdContentResource {
|
|
351
|
+
transport;
|
|
352
|
+
path;
|
|
353
|
+
constructor(transport, path) {
|
|
354
|
+
this.transport = transport;
|
|
355
|
+
this.path = path;
|
|
356
|
+
}
|
|
357
|
+
/** GET /api/v1/assets/{asset_id}/content. Caller owns and closes the unbuffered body. */
|
|
358
|
+
get(options = {}) {
|
|
359
|
+
return binaryRequest(this.transport, this.path, {
|
|
360
|
+
...{ signal: options.signal },
|
|
361
|
+
headers: Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
362
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
363
|
+
.map(([key, value]) => [key, String(value)])),
|
|
364
|
+
accept: "*/*",
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
export class AuthResource {
|
|
369
|
+
transport;
|
|
370
|
+
path;
|
|
371
|
+
constructor(transport, path) {
|
|
372
|
+
this.transport = transport;
|
|
373
|
+
this.path = path;
|
|
374
|
+
}
|
|
375
|
+
/** POST /api/v1/auth/bootstrap. Preserves response metadata; mutations are not replayed. */
|
|
376
|
+
bootstrap(body, options = {}) {
|
|
377
|
+
return jsonRequest(this.transport, "POST", this.path + "/bootstrap", body, undefined, { signal: options.signal });
|
|
378
|
+
}
|
|
379
|
+
get configuration() {
|
|
380
|
+
return new AuthConfigurationResource(this.transport, this.path + "/configuration");
|
|
381
|
+
}
|
|
382
|
+
get emailChange() {
|
|
383
|
+
return new AuthEmailChangeResource(this.transport, this.path + "/email-change");
|
|
384
|
+
}
|
|
385
|
+
/** POST /api/v1/auth/login. Preserves response metadata; mutations are not replayed. */
|
|
386
|
+
login(body, options = {}) {
|
|
387
|
+
return jsonRequest(this.transport, "POST", this.path + "/login", body, undefined, { signal: options.signal });
|
|
388
|
+
}
|
|
389
|
+
/** POST /api/v1/auth/logout. Preserves response metadata; mutations are not replayed. */
|
|
390
|
+
logout(options = {}) {
|
|
391
|
+
return jsonRequest(this.transport, "POST", this.path + "/logout", undefined, undefined, { signal: options.signal });
|
|
392
|
+
}
|
|
393
|
+
get passwordReset() {
|
|
394
|
+
return new AuthPasswordResetResource(this.transport, this.path + "/password-reset");
|
|
395
|
+
}
|
|
396
|
+
get session() {
|
|
397
|
+
return new AuthSessionResource(this.transport, this.path + "/session");
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
export class AuthConfigurationResource {
|
|
401
|
+
transport;
|
|
402
|
+
path;
|
|
403
|
+
constructor(transport, path) {
|
|
404
|
+
this.transport = transport;
|
|
405
|
+
this.path = path;
|
|
406
|
+
}
|
|
407
|
+
/** GET /api/v1/auth/configuration. Preserves response metadata; mutations are not replayed. */
|
|
408
|
+
get(options = {}) {
|
|
409
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
410
|
+
signal: options.signal,
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
export class AuthEmailChangeResource {
|
|
415
|
+
transport;
|
|
416
|
+
path;
|
|
417
|
+
constructor(transport, path) {
|
|
418
|
+
this.transport = transport;
|
|
419
|
+
this.path = path;
|
|
420
|
+
}
|
|
421
|
+
/** POST /api/v1/auth/email-change/confirm. Preserves response metadata; mutations are not replayed. */
|
|
422
|
+
confirm(body, options = {}) {
|
|
423
|
+
return jsonRequest(this.transport, "POST", this.path + "/confirm", body, undefined, { signal: options.signal });
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
export class AuthPasswordResetResource {
|
|
427
|
+
transport;
|
|
428
|
+
path;
|
|
429
|
+
constructor(transport, path) {
|
|
430
|
+
this.transport = transport;
|
|
431
|
+
this.path = path;
|
|
432
|
+
}
|
|
433
|
+
/** POST /api/v1/auth/password-reset. Preserves response metadata; mutations are not replayed. */
|
|
434
|
+
create(body, options = {}) {
|
|
435
|
+
return jsonRequest(this.transport, "POST", this.path, body, undefined, {
|
|
436
|
+
signal: options.signal,
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
/** POST /api/v1/auth/password-reset/confirm. Preserves response metadata; mutations are not replayed. */
|
|
440
|
+
confirm(body, options = {}) {
|
|
441
|
+
return jsonRequest(this.transport, "POST", this.path + "/confirm", body, undefined, { signal: options.signal });
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
export class AuthSessionResource {
|
|
445
|
+
transport;
|
|
446
|
+
path;
|
|
447
|
+
constructor(transport, path) {
|
|
448
|
+
this.transport = transport;
|
|
449
|
+
this.path = path;
|
|
450
|
+
}
|
|
451
|
+
/** GET /api/v1/auth/session. Preserves response metadata; mutations are not replayed. */
|
|
452
|
+
get(options = {}) {
|
|
453
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
454
|
+
signal: options.signal,
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
export class ConnectionsResource {
|
|
459
|
+
transport;
|
|
460
|
+
path;
|
|
461
|
+
constructor(transport, path) {
|
|
462
|
+
this.transport = transport;
|
|
463
|
+
this.path = path;
|
|
464
|
+
}
|
|
465
|
+
/** GET /api/v1/connections. Preserves response metadata; mutations are not replayed. */
|
|
466
|
+
list(options = {}) {
|
|
467
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
468
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
469
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
470
|
+
}
|
|
471
|
+
pages(options = {}) {
|
|
472
|
+
const query = snapshot(options.query ?? {});
|
|
473
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
474
|
+
}
|
|
475
|
+
items(options = {}) {
|
|
476
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
477
|
+
}
|
|
478
|
+
/** POST /api/v1/connections. Preserves response metadata; mutations are not replayed. */
|
|
479
|
+
create(body, options = {}) {
|
|
480
|
+
return jsonRequest(this.transport, "POST", this.path, body, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
481
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
482
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
483
|
+
}
|
|
484
|
+
get callback() {
|
|
485
|
+
return new ConnectionsCallbackResource(this.transport, this.path + "/callback");
|
|
486
|
+
}
|
|
487
|
+
get redirectUri() {
|
|
488
|
+
return new ConnectionsRedirectUriResource(this.transport, this.path + "/redirect-uri");
|
|
489
|
+
}
|
|
490
|
+
ref(value) {
|
|
491
|
+
return new ConnectionsConnectionIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
export class ConnectionsCallbackResource {
|
|
495
|
+
transport;
|
|
496
|
+
path;
|
|
497
|
+
constructor(transport, path) {
|
|
498
|
+
this.transport = transport;
|
|
499
|
+
this.path = path;
|
|
500
|
+
}
|
|
501
|
+
/** GET /api/v1/connections/callback. Preserves response metadata; mutations are not replayed. */
|
|
502
|
+
get(options) {
|
|
503
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
504
|
+
signal: options.signal,
|
|
505
|
+
query: options.query,
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
export class ConnectionsRedirectUriResource {
|
|
510
|
+
transport;
|
|
511
|
+
path;
|
|
512
|
+
constructor(transport, path) {
|
|
513
|
+
this.transport = transport;
|
|
514
|
+
this.path = path;
|
|
515
|
+
}
|
|
516
|
+
/** GET /api/v1/connections/redirect-uri. Preserves response metadata; mutations are not replayed. */
|
|
517
|
+
get(options = {}) {
|
|
518
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
519
|
+
signal: options.signal,
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
export class ConnectionsConnectionIdResource {
|
|
524
|
+
transport;
|
|
525
|
+
path;
|
|
526
|
+
constructor(transport, path) {
|
|
527
|
+
this.transport = transport;
|
|
528
|
+
this.path = path;
|
|
529
|
+
}
|
|
530
|
+
/** GET /api/v1/connections/{connection_id}. Preserves response metadata; mutations are not replayed. */
|
|
531
|
+
get(options = {}) {
|
|
532
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
533
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
534
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
535
|
+
}
|
|
536
|
+
/** PATCH /api/v1/connections/{connection_id}. Preserves response metadata; mutations are not replayed. */
|
|
537
|
+
update(body, options) {
|
|
538
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, Object.fromEntries(Object.entries({
|
|
539
|
+
"If-Match": options.ifMatch,
|
|
540
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
541
|
+
})
|
|
542
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
543
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
544
|
+
}
|
|
545
|
+
/** POST /api/v1/connections/{connection_id}/authorize. Preserves response metadata; mutations are not replayed. */
|
|
546
|
+
authorize(body, options) {
|
|
547
|
+
return jsonRequest(this.transport, "POST", this.path + "/authorize", body, Object.fromEntries(Object.entries({
|
|
548
|
+
"If-Match": options.ifMatch,
|
|
549
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
550
|
+
})
|
|
551
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
552
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
553
|
+
}
|
|
554
|
+
/** POST /api/v1/connections/{connection_id}/revoke. Preserves response metadata; mutations are not replayed. */
|
|
555
|
+
revoke(options) {
|
|
556
|
+
return jsonRequest(this.transport, "POST", this.path + "/revoke", undefined, Object.fromEntries(Object.entries({
|
|
557
|
+
"If-Match": options.ifMatch,
|
|
558
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
559
|
+
})
|
|
560
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
561
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
562
|
+
}
|
|
563
|
+
/** POST /api/v1/connections/{connection_id}/test. Preserves response metadata; mutations are not replayed. */
|
|
564
|
+
test(options = {}) {
|
|
565
|
+
return jsonRequest(this.transport, "POST", this.path + "/test", undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
566
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
567
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
568
|
+
}
|
|
569
|
+
get tools() {
|
|
570
|
+
return new ConnectionsConnectionIdToolsResource(this.transport, this.path + "/tools");
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
export class ConnectionsConnectionIdToolsResource {
|
|
574
|
+
transport;
|
|
575
|
+
path;
|
|
576
|
+
constructor(transport, path) {
|
|
577
|
+
this.transport = transport;
|
|
578
|
+
this.path = path;
|
|
579
|
+
}
|
|
580
|
+
/** GET /api/v1/connections/{connection_id}/tools. Preserves response metadata; mutations are not replayed. */
|
|
581
|
+
list(options = {}) {
|
|
582
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
583
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
584
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
export class ConnectorProvidersResource {
|
|
588
|
+
transport;
|
|
589
|
+
path;
|
|
590
|
+
constructor(transport, path) {
|
|
591
|
+
this.transport = transport;
|
|
592
|
+
this.path = path;
|
|
593
|
+
}
|
|
594
|
+
/** GET /api/v1/connector-providers. Preserves response metadata; mutations are not replayed. */
|
|
595
|
+
list(options = {}) {
|
|
596
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
597
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
598
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
599
|
+
}
|
|
600
|
+
pages(options = {}) {
|
|
601
|
+
const query = snapshot(options.query ?? {});
|
|
602
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
603
|
+
}
|
|
604
|
+
items(options = {}) {
|
|
605
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
606
|
+
}
|
|
607
|
+
/** POST /api/v1/connector-providers. Preserves response metadata; mutations are not replayed. */
|
|
608
|
+
create(body, options = {}) {
|
|
609
|
+
return jsonRequest(this.transport, "POST", this.path, body, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
610
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
611
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
612
|
+
}
|
|
613
|
+
ref(value) {
|
|
614
|
+
return new ConnectorProvidersProviderIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
export class ConnectorProvidersProviderIdResource {
|
|
618
|
+
transport;
|
|
619
|
+
path;
|
|
620
|
+
constructor(transport, path) {
|
|
621
|
+
this.transport = transport;
|
|
622
|
+
this.path = path;
|
|
623
|
+
}
|
|
624
|
+
/** GET /api/v1/connector-providers/{provider_id}. Preserves response metadata; mutations are not replayed. */
|
|
625
|
+
get(options = {}) {
|
|
626
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
627
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
628
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
629
|
+
}
|
|
630
|
+
/** PATCH /api/v1/connector-providers/{provider_id}. Preserves response metadata; mutations are not replayed. */
|
|
631
|
+
update(body, options) {
|
|
632
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, Object.fromEntries(Object.entries({
|
|
633
|
+
"If-Match": options.ifMatch,
|
|
634
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
635
|
+
})
|
|
636
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
637
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
638
|
+
}
|
|
639
|
+
get apps() {
|
|
640
|
+
return new ConnectorProvidersProviderIdAppsResource(this.transport, this.path + "/apps");
|
|
641
|
+
}
|
|
642
|
+
/** POST /api/v1/connector-providers/{provider_id}/test. Preserves response metadata; mutations are not replayed. */
|
|
643
|
+
test(options = {}) {
|
|
644
|
+
return jsonRequest(this.transport, "POST", this.path + "/test", undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
645
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
646
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
export class ConnectorProvidersProviderIdAppsResource {
|
|
650
|
+
transport;
|
|
651
|
+
path;
|
|
652
|
+
constructor(transport, path) {
|
|
653
|
+
this.transport = transport;
|
|
654
|
+
this.path = path;
|
|
655
|
+
}
|
|
656
|
+
/** GET /api/v1/connector-providers/{provider_id}/apps. Preserves response metadata; mutations are not replayed. */
|
|
657
|
+
list(options = {}) {
|
|
658
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
659
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
660
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
661
|
+
}
|
|
662
|
+
pages(options = {}) {
|
|
663
|
+
const query = snapshot(options.query ?? {});
|
|
664
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
665
|
+
}
|
|
666
|
+
items(options = {}) {
|
|
667
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
668
|
+
}
|
|
669
|
+
ref(value) {
|
|
670
|
+
return new ConnectorProvidersProviderIdAppsAppResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
export class ConnectorProvidersProviderIdAppsAppResource {
|
|
674
|
+
transport;
|
|
675
|
+
path;
|
|
676
|
+
constructor(transport, path) {
|
|
677
|
+
this.transport = transport;
|
|
678
|
+
this.path = path;
|
|
679
|
+
}
|
|
680
|
+
/** GET /api/v1/connector-providers/{provider_id}/apps/{app}. Preserves response metadata; mutations are not replayed. */
|
|
681
|
+
get(options = {}) {
|
|
682
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
683
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
684
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
685
|
+
}
|
|
686
|
+
get actions() {
|
|
687
|
+
return new ConnectorProvidersProviderIdAppsAppActionsResource(this.transport, this.path + "/actions");
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
export class ConnectorProvidersProviderIdAppsAppActionsResource {
|
|
691
|
+
transport;
|
|
692
|
+
path;
|
|
693
|
+
constructor(transport, path) {
|
|
694
|
+
this.transport = transport;
|
|
695
|
+
this.path = path;
|
|
696
|
+
}
|
|
697
|
+
/** GET /api/v1/connector-providers/{provider_id}/apps/{app}/actions. Preserves response metadata; mutations are not replayed. */
|
|
698
|
+
list(options = {}) {
|
|
699
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
700
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
701
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
export class EnvironmentProvidersResource {
|
|
705
|
+
transport;
|
|
706
|
+
path;
|
|
707
|
+
constructor(transport, path) {
|
|
708
|
+
this.transport = transport;
|
|
709
|
+
this.path = path;
|
|
710
|
+
}
|
|
711
|
+
/** GET /api/v1/environment-providers. Preserves response metadata; mutations are not replayed. */
|
|
712
|
+
list(options = {}) {
|
|
713
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
714
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
715
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
716
|
+
}
|
|
717
|
+
pages(options = {}) {
|
|
718
|
+
const query = snapshot(options.query ?? {});
|
|
719
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
720
|
+
}
|
|
721
|
+
items(options = {}) {
|
|
722
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
723
|
+
}
|
|
724
|
+
/** POST /api/v1/environment-providers. Preserves response metadata; mutations are not replayed. */
|
|
725
|
+
create(body, options = {}) {
|
|
726
|
+
return jsonRequest(this.transport, "POST", this.path, body, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
727
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
728
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
729
|
+
}
|
|
730
|
+
ref(value) {
|
|
731
|
+
return new EnvironmentProvidersProviderIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
export class EnvironmentProvidersProviderIdResource {
|
|
735
|
+
transport;
|
|
736
|
+
path;
|
|
737
|
+
constructor(transport, path) {
|
|
738
|
+
this.transport = transport;
|
|
739
|
+
this.path = path;
|
|
740
|
+
}
|
|
741
|
+
/** GET /api/v1/environment-providers/{provider_id}. Preserves response metadata; mutations are not replayed. */
|
|
742
|
+
get(options = {}) {
|
|
743
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
744
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
745
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
746
|
+
}
|
|
747
|
+
/** PATCH /api/v1/environment-providers/{provider_id}. Preserves response metadata; mutations are not replayed. */
|
|
748
|
+
update(body, options) {
|
|
749
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, Object.fromEntries(Object.entries({
|
|
750
|
+
"If-Match": options.ifMatch,
|
|
751
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
752
|
+
})
|
|
753
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
754
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
755
|
+
}
|
|
756
|
+
/** POST /api/v1/environment-providers/{provider_id}/test. Preserves response metadata; mutations are not replayed. */
|
|
757
|
+
test(options = {}) {
|
|
758
|
+
return jsonRequest(this.transport, "POST", this.path + "/test", undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
759
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
760
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
export class EnvironmentTemplatesResource {
|
|
764
|
+
transport;
|
|
765
|
+
path;
|
|
766
|
+
constructor(transport, path) {
|
|
767
|
+
this.transport = transport;
|
|
768
|
+
this.path = path;
|
|
769
|
+
}
|
|
770
|
+
/** GET /api/v1/environment-templates. Preserves response metadata; mutations are not replayed. */
|
|
771
|
+
list(options = {}) {
|
|
772
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
773
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
774
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
775
|
+
}
|
|
776
|
+
pages(options = {}) {
|
|
777
|
+
const query = snapshot(options.query ?? {});
|
|
778
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
779
|
+
}
|
|
780
|
+
items(options = {}) {
|
|
781
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
782
|
+
}
|
|
783
|
+
/** POST /api/v1/environment-templates. Preserves response metadata; mutations are not replayed. */
|
|
784
|
+
create(body, options = {}) {
|
|
785
|
+
return jsonRequest(this.transport, "POST", this.path, body, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
786
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
787
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
788
|
+
}
|
|
789
|
+
ref(value) {
|
|
790
|
+
return new EnvironmentTemplatesTemplateIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
export class EnvironmentTemplatesTemplateIdResource {
|
|
794
|
+
transport;
|
|
795
|
+
path;
|
|
796
|
+
constructor(transport, path) {
|
|
797
|
+
this.transport = transport;
|
|
798
|
+
this.path = path;
|
|
799
|
+
}
|
|
800
|
+
/** GET /api/v1/environment-templates/{template_id}. Preserves response metadata; mutations are not replayed. */
|
|
801
|
+
get(options = {}) {
|
|
802
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
803
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
804
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
805
|
+
}
|
|
806
|
+
/** PATCH /api/v1/environment-templates/{template_id}. Preserves response metadata; mutations are not replayed. */
|
|
807
|
+
update(body, options) {
|
|
808
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, Object.fromEntries(Object.entries({
|
|
809
|
+
"If-Match": options.ifMatch,
|
|
810
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
811
|
+
})
|
|
812
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
813
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
export class EnvironmentsResource {
|
|
817
|
+
transport;
|
|
818
|
+
path;
|
|
819
|
+
constructor(transport, path) {
|
|
820
|
+
this.transport = transport;
|
|
821
|
+
this.path = path;
|
|
822
|
+
}
|
|
823
|
+
/** GET /api/v1/environments. Preserves response metadata; mutations are not replayed. */
|
|
824
|
+
list(options = {}) {
|
|
825
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
826
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
827
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
828
|
+
}
|
|
829
|
+
pages(options = {}) {
|
|
830
|
+
const query = snapshot(options.query ?? {});
|
|
831
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
832
|
+
}
|
|
833
|
+
items(options = {}) {
|
|
834
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
835
|
+
}
|
|
836
|
+
/** POST /api/v1/environments. Preserves response metadata; mutations are not replayed. */
|
|
837
|
+
create(body, options = {}) {
|
|
838
|
+
return jsonRequest(this.transport, "POST", this.path, body, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
839
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
840
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
841
|
+
}
|
|
842
|
+
ref(value) {
|
|
843
|
+
return new EnvironmentsEnvironmentIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
export class EnvironmentsEnvironmentIdResource {
|
|
847
|
+
transport;
|
|
848
|
+
path;
|
|
849
|
+
constructor(transport, path) {
|
|
850
|
+
this.transport = transport;
|
|
851
|
+
this.path = path;
|
|
852
|
+
}
|
|
853
|
+
/** DELETE /api/v1/environments/{environment_id}. Preserves response metadata; mutations are not replayed. */
|
|
854
|
+
delete(options) {
|
|
855
|
+
return jsonRequest(this.transport, "DELETE", this.path, undefined, Object.fromEntries(Object.entries({
|
|
856
|
+
"If-Match": options.ifMatch,
|
|
857
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
858
|
+
})
|
|
859
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
860
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
861
|
+
}
|
|
862
|
+
/** GET /api/v1/environments/{environment_id}. Preserves response metadata; mutations are not replayed. */
|
|
863
|
+
get(options = {}) {
|
|
864
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
865
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
866
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
867
|
+
}
|
|
868
|
+
/** PATCH /api/v1/environments/{environment_id}. Preserves response metadata; mutations are not replayed. */
|
|
869
|
+
update(body, options) {
|
|
870
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, Object.fromEntries(Object.entries({
|
|
871
|
+
"If-Match": options.ifMatch,
|
|
872
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
873
|
+
})
|
|
874
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
875
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
876
|
+
}
|
|
877
|
+
/** POST /api/v1/environments/{environment_id}/stop. Preserves response metadata; mutations are not replayed. */
|
|
878
|
+
stop(options) {
|
|
879
|
+
return jsonRequest(this.transport, "POST", this.path + "/stop", undefined, Object.fromEntries(Object.entries({
|
|
880
|
+
"If-Match": options.ifMatch,
|
|
881
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
882
|
+
})
|
|
883
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
884
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
export class InvitationsResource {
|
|
888
|
+
transport;
|
|
889
|
+
path;
|
|
890
|
+
constructor(transport, path) {
|
|
891
|
+
this.transport = transport;
|
|
892
|
+
this.path = path;
|
|
893
|
+
}
|
|
894
|
+
ref(value) {
|
|
895
|
+
return new InvitationsInvitationIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
export class InvitationsInvitationIdResource {
|
|
899
|
+
transport;
|
|
900
|
+
path;
|
|
901
|
+
constructor(transport, path) {
|
|
902
|
+
this.transport = transport;
|
|
903
|
+
this.path = path;
|
|
904
|
+
}
|
|
905
|
+
/** POST /api/v1/invitations/{invitation_id}/accept. Preserves response metadata; mutations are not replayed. */
|
|
906
|
+
accept(body, options = {}) {
|
|
907
|
+
return jsonRequest(this.transport, "POST", this.path + "/accept", body, undefined, { signal: options.signal });
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
export class McpServersResource {
|
|
911
|
+
transport;
|
|
912
|
+
path;
|
|
913
|
+
constructor(transport, path) {
|
|
914
|
+
this.transport = transport;
|
|
915
|
+
this.path = path;
|
|
916
|
+
}
|
|
917
|
+
/** GET /api/v1/mcp-servers. Preserves response metadata; mutations are not replayed. */
|
|
918
|
+
list(options = {}) {
|
|
919
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
920
|
+
signal: options.signal,
|
|
921
|
+
query: options.query,
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
pages(options = {}) {
|
|
925
|
+
const query = snapshot(options.query ?? {});
|
|
926
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
927
|
+
}
|
|
928
|
+
items(options = {}) {
|
|
929
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
export class MediaUnderstandingDefaultsResource {
|
|
933
|
+
transport;
|
|
934
|
+
path;
|
|
935
|
+
constructor(transport, path) {
|
|
936
|
+
this.transport = transport;
|
|
937
|
+
this.path = path;
|
|
938
|
+
}
|
|
939
|
+
/** GET /api/v1/media-understanding-defaults. Preserves response metadata; mutations are not replayed. */
|
|
940
|
+
get(options = {}) {
|
|
941
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
942
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
943
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
944
|
+
}
|
|
945
|
+
/** PUT /api/v1/media-understanding-defaults. Preserves response metadata; mutations are not replayed. */
|
|
946
|
+
replace(body, options) {
|
|
947
|
+
return jsonRequest(this.transport, "PUT", this.path, body, Object.fromEntries(Object.entries({
|
|
948
|
+
"If-Match": options.ifMatch,
|
|
949
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
950
|
+
})
|
|
951
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
952
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
export class MemoriesResource {
|
|
956
|
+
transport;
|
|
957
|
+
path;
|
|
958
|
+
constructor(transport, path) {
|
|
959
|
+
this.transport = transport;
|
|
960
|
+
this.path = path;
|
|
961
|
+
}
|
|
962
|
+
/** GET /api/v1/memories. Preserves response metadata; mutations are not replayed. */
|
|
963
|
+
list(options = {}) {
|
|
964
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
965
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
966
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
967
|
+
}
|
|
968
|
+
pages(options = {}) {
|
|
969
|
+
const query = snapshot(options.query ?? {});
|
|
970
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
971
|
+
}
|
|
972
|
+
items(options = {}) {
|
|
973
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
974
|
+
}
|
|
975
|
+
/** POST /api/v1/memories. Preserves response metadata; mutations are not replayed. */
|
|
976
|
+
create(body, options = {}) {
|
|
977
|
+
return jsonRequest(this.transport, "POST", this.path, body, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
978
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
979
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
980
|
+
}
|
|
981
|
+
ref(value) {
|
|
982
|
+
return new MemoriesMemoryIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
export class MemoriesMemoryIdResource {
|
|
986
|
+
transport;
|
|
987
|
+
path;
|
|
988
|
+
constructor(transport, path) {
|
|
989
|
+
this.transport = transport;
|
|
990
|
+
this.path = path;
|
|
991
|
+
}
|
|
992
|
+
/** DELETE /api/v1/memories/{memory_id}. Preserves response metadata; mutations are not replayed. */
|
|
993
|
+
delete(options) {
|
|
994
|
+
return jsonRequest(this.transport, "DELETE", this.path, undefined, Object.fromEntries(Object.entries({
|
|
995
|
+
"If-Match": options.ifMatch,
|
|
996
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
997
|
+
})
|
|
998
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
999
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1000
|
+
}
|
|
1001
|
+
/** GET /api/v1/memories/{memory_id}. Preserves response metadata; mutations are not replayed. */
|
|
1002
|
+
get(options = {}) {
|
|
1003
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1004
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1005
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1006
|
+
}
|
|
1007
|
+
/** PATCH /api/v1/memories/{memory_id}. Preserves response metadata; mutations are not replayed. */
|
|
1008
|
+
update(body, options) {
|
|
1009
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, Object.fromEntries(Object.entries({
|
|
1010
|
+
"If-Match": options.ifMatch,
|
|
1011
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
1012
|
+
})
|
|
1013
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1014
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1015
|
+
}
|
|
1016
|
+
get files() {
|
|
1017
|
+
return new MemoriesMemoryIdFilesResource(this.transport, this.path + "/files");
|
|
1018
|
+
}
|
|
1019
|
+
get records() {
|
|
1020
|
+
return new MemoriesMemoryIdRecordsResource(this.transport, this.path + "/records");
|
|
1021
|
+
}
|
|
1022
|
+
get revisions() {
|
|
1023
|
+
return new MemoriesMemoryIdRevisionsResource(this.transport, this.path + "/revisions");
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
export class MemoriesMemoryIdFilesResource {
|
|
1027
|
+
transport;
|
|
1028
|
+
path;
|
|
1029
|
+
constructor(transport, path) {
|
|
1030
|
+
this.transport = transport;
|
|
1031
|
+
this.path = path;
|
|
1032
|
+
}
|
|
1033
|
+
/** GET /api/v1/memories/{memory_id}/files. Preserves response metadata; mutations are not replayed. */
|
|
1034
|
+
list(options = {}) {
|
|
1035
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1036
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1037
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
1038
|
+
}
|
|
1039
|
+
pages(options = {}) {
|
|
1040
|
+
const query = snapshot(options.query ?? {});
|
|
1041
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
1042
|
+
}
|
|
1043
|
+
items(options = {}) {
|
|
1044
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
1045
|
+
}
|
|
1046
|
+
/** POST /api/v1/memories/{memory_id}/files. Preserves response metadata; mutations are not replayed. */
|
|
1047
|
+
create(body, options = {}) {
|
|
1048
|
+
return jsonRequest(this.transport, "POST", this.path, body, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1049
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1050
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1051
|
+
}
|
|
1052
|
+
/** POST /api/v1/memories/{memory_id}/files/move. Preserves response metadata; mutations are not replayed. */
|
|
1053
|
+
move(body, options) {
|
|
1054
|
+
return jsonRequest(this.transport, "POST", this.path + "/move", body, Object.fromEntries(Object.entries({
|
|
1055
|
+
"If-Match": options.ifMatch,
|
|
1056
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
1057
|
+
})
|
|
1058
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1059
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1060
|
+
}
|
|
1061
|
+
ref(value) {
|
|
1062
|
+
return new MemoriesMemoryIdFilesPathResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
export class MemoriesMemoryIdFilesPathResource {
|
|
1066
|
+
transport;
|
|
1067
|
+
path;
|
|
1068
|
+
constructor(transport, path) {
|
|
1069
|
+
this.transport = transport;
|
|
1070
|
+
this.path = path;
|
|
1071
|
+
}
|
|
1072
|
+
/** DELETE /api/v1/memories/{memory_id}/files/{path}. Preserves response metadata; mutations are not replayed. */
|
|
1073
|
+
delete(options) {
|
|
1074
|
+
return jsonRequest(this.transport, "DELETE", this.path, undefined, Object.fromEntries(Object.entries({
|
|
1075
|
+
"If-Match": options.ifMatch,
|
|
1076
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
1077
|
+
})
|
|
1078
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1079
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1080
|
+
}
|
|
1081
|
+
/** GET /api/v1/memories/{memory_id}/files/{path}. Preserves response metadata; mutations are not replayed. */
|
|
1082
|
+
get(options = {}) {
|
|
1083
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1084
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1085
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1086
|
+
}
|
|
1087
|
+
/** PUT /api/v1/memories/{memory_id}/files/{path}. Preserves response metadata; mutations are not replayed. */
|
|
1088
|
+
replace(body, options) {
|
|
1089
|
+
return jsonRequest(this.transport, "PUT", this.path, body, Object.fromEntries(Object.entries({
|
|
1090
|
+
"If-Match": options.ifMatch,
|
|
1091
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
1092
|
+
})
|
|
1093
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1094
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
export class MemoriesMemoryIdRecordsResource {
|
|
1098
|
+
transport;
|
|
1099
|
+
path;
|
|
1100
|
+
constructor(transport, path) {
|
|
1101
|
+
this.transport = transport;
|
|
1102
|
+
this.path = path;
|
|
1103
|
+
}
|
|
1104
|
+
/** GET /api/v1/memories/{memory_id}/records. Preserves response metadata; mutations are not replayed. */
|
|
1105
|
+
list(options = {}) {
|
|
1106
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1107
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1108
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
1109
|
+
}
|
|
1110
|
+
pages(options = {}) {
|
|
1111
|
+
const query = snapshot(options.query ?? {});
|
|
1112
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
1113
|
+
}
|
|
1114
|
+
items(options = {}) {
|
|
1115
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
1116
|
+
}
|
|
1117
|
+
/** POST /api/v1/memories/{memory_id}/records. Preserves response metadata; mutations are not replayed. */
|
|
1118
|
+
create(body, options = {}) {
|
|
1119
|
+
return jsonRequest(this.transport, "POST", this.path, body, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1120
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1121
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1122
|
+
}
|
|
1123
|
+
/** POST /api/v1/memories/{memory_id}/records/search. Preserves response metadata; mutations are not replayed. */
|
|
1124
|
+
search(body, options = {}) {
|
|
1125
|
+
return jsonRequest(this.transport, "POST", this.path + "/search", body, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1126
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1127
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1128
|
+
}
|
|
1129
|
+
ref(value) {
|
|
1130
|
+
return new MemoriesMemoryIdRecordsRecordIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
export class MemoriesMemoryIdRecordsRecordIdResource {
|
|
1134
|
+
transport;
|
|
1135
|
+
path;
|
|
1136
|
+
constructor(transport, path) {
|
|
1137
|
+
this.transport = transport;
|
|
1138
|
+
this.path = path;
|
|
1139
|
+
}
|
|
1140
|
+
/** DELETE /api/v1/memories/{memory_id}/records/{record_id}. Preserves response metadata; mutations are not replayed. */
|
|
1141
|
+
delete(options = {}) {
|
|
1142
|
+
return jsonRequest(this.transport, "DELETE", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1143
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1144
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1145
|
+
}
|
|
1146
|
+
/** PUT /api/v1/memories/{memory_id}/records/{record_id}. Preserves response metadata; mutations are not replayed. */
|
|
1147
|
+
replace(body, options = {}) {
|
|
1148
|
+
return jsonRequest(this.transport, "PUT", this.path, body, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1149
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1150
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
export class MemoriesMemoryIdRevisionsResource {
|
|
1154
|
+
transport;
|
|
1155
|
+
path;
|
|
1156
|
+
constructor(transport, path) {
|
|
1157
|
+
this.transport = transport;
|
|
1158
|
+
this.path = path;
|
|
1159
|
+
}
|
|
1160
|
+
/** DELETE /api/v1/memories/{memory_id}/revisions. Preserves response metadata; mutations are not replayed. */
|
|
1161
|
+
delete(options) {
|
|
1162
|
+
return jsonRequest(this.transport, "DELETE", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1163
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1164
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
1165
|
+
}
|
|
1166
|
+
/** GET /api/v1/memories/{memory_id}/revisions. Preserves response metadata; mutations are not replayed. */
|
|
1167
|
+
list(options = {}) {
|
|
1168
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1169
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1170
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
1171
|
+
}
|
|
1172
|
+
pages(options = {}) {
|
|
1173
|
+
const query = snapshot(options.query ?? {});
|
|
1174
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
1175
|
+
}
|
|
1176
|
+
items(options = {}) {
|
|
1177
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
1178
|
+
}
|
|
1179
|
+
ref(value) {
|
|
1180
|
+
return new MemoriesMemoryIdRevisionsSeqResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
export class MemoriesMemoryIdRevisionsSeqResource {
|
|
1184
|
+
transport;
|
|
1185
|
+
path;
|
|
1186
|
+
constructor(transport, path) {
|
|
1187
|
+
this.transport = transport;
|
|
1188
|
+
this.path = path;
|
|
1189
|
+
}
|
|
1190
|
+
/** GET /api/v1/memories/{memory_id}/revisions/{seq}. Preserves response metadata; mutations are not replayed. */
|
|
1191
|
+
get(options = {}) {
|
|
1192
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1193
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1194
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1195
|
+
}
|
|
1196
|
+
/** POST /api/v1/memories/{memory_id}/revisions/{seq}/restore. Preserves response metadata; mutations are not replayed. */
|
|
1197
|
+
restore(options = {}) {
|
|
1198
|
+
return jsonRequest(this.transport, "POST", this.path + "/restore", undefined, Object.fromEntries(Object.entries({
|
|
1199
|
+
"If-Match": options.ifMatch,
|
|
1200
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
1201
|
+
})
|
|
1202
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1203
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
export class MemoryProvidersResource {
|
|
1207
|
+
transport;
|
|
1208
|
+
path;
|
|
1209
|
+
constructor(transport, path) {
|
|
1210
|
+
this.transport = transport;
|
|
1211
|
+
this.path = path;
|
|
1212
|
+
}
|
|
1213
|
+
/** GET /api/v1/memory-providers. Preserves response metadata; mutations are not replayed. */
|
|
1214
|
+
list(options = {}) {
|
|
1215
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1216
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1217
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
1218
|
+
}
|
|
1219
|
+
pages(options = {}) {
|
|
1220
|
+
const query = snapshot(options.query ?? {});
|
|
1221
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
1222
|
+
}
|
|
1223
|
+
items(options = {}) {
|
|
1224
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
1225
|
+
}
|
|
1226
|
+
/** POST /api/v1/memory-providers. Preserves response metadata; mutations are not replayed. */
|
|
1227
|
+
create(body, options = {}) {
|
|
1228
|
+
return jsonRequest(this.transport, "POST", this.path, body, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1229
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1230
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1231
|
+
}
|
|
1232
|
+
ref(value) {
|
|
1233
|
+
return new MemoryProvidersProviderIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
export class MemoryProvidersProviderIdResource {
|
|
1237
|
+
transport;
|
|
1238
|
+
path;
|
|
1239
|
+
constructor(transport, path) {
|
|
1240
|
+
this.transport = transport;
|
|
1241
|
+
this.path = path;
|
|
1242
|
+
}
|
|
1243
|
+
/** GET /api/v1/memory-providers/{provider_id}. Preserves response metadata; mutations are not replayed. */
|
|
1244
|
+
get(options = {}) {
|
|
1245
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1246
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1247
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1248
|
+
}
|
|
1249
|
+
/** PATCH /api/v1/memory-providers/{provider_id}. Preserves response metadata; mutations are not replayed. */
|
|
1250
|
+
update(body, options) {
|
|
1251
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, Object.fromEntries(Object.entries({
|
|
1252
|
+
"If-Match": options.ifMatch,
|
|
1253
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
1254
|
+
})
|
|
1255
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1256
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1257
|
+
}
|
|
1258
|
+
/** POST /api/v1/memory-providers/{provider_id}/test. Preserves response metadata; mutations are not replayed. */
|
|
1259
|
+
test(options = {}) {
|
|
1260
|
+
return jsonRequest(this.transport, "POST", this.path + "/test", undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1261
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1262
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
export class ModelCatalogResource {
|
|
1266
|
+
transport;
|
|
1267
|
+
path;
|
|
1268
|
+
constructor(transport, path) {
|
|
1269
|
+
this.transport = transport;
|
|
1270
|
+
this.path = path;
|
|
1271
|
+
}
|
|
1272
|
+
/** GET /api/v1/model-catalog. Preserves response metadata; mutations are not replayed. */
|
|
1273
|
+
list(options = {}) {
|
|
1274
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
1275
|
+
signal: options.signal,
|
|
1276
|
+
});
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
export class ModelProvidersResource {
|
|
1280
|
+
transport;
|
|
1281
|
+
path;
|
|
1282
|
+
constructor(transport, path) {
|
|
1283
|
+
this.transport = transport;
|
|
1284
|
+
this.path = path;
|
|
1285
|
+
}
|
|
1286
|
+
/** GET /api/v1/model-providers. Preserves response metadata; mutations are not replayed. */
|
|
1287
|
+
list(options = {}) {
|
|
1288
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1289
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1290
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
1291
|
+
}
|
|
1292
|
+
pages(options = {}) {
|
|
1293
|
+
const query = snapshot(options.query ?? {});
|
|
1294
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
1295
|
+
}
|
|
1296
|
+
items(options = {}) {
|
|
1297
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
1298
|
+
}
|
|
1299
|
+
/** POST /api/v1/model-providers. Preserves response metadata; mutations are not replayed. */
|
|
1300
|
+
create(body, options = {}) {
|
|
1301
|
+
return jsonRequest(this.transport, "POST", this.path, body, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1302
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1303
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1304
|
+
}
|
|
1305
|
+
ref(value) {
|
|
1306
|
+
return new ModelProvidersProviderIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
export class ModelProvidersProviderIdResource {
|
|
1310
|
+
transport;
|
|
1311
|
+
path;
|
|
1312
|
+
constructor(transport, path) {
|
|
1313
|
+
this.transport = transport;
|
|
1314
|
+
this.path = path;
|
|
1315
|
+
}
|
|
1316
|
+
/** GET /api/v1/model-providers/{provider_id}. Preserves response metadata; mutations are not replayed. */
|
|
1317
|
+
get(options = {}) {
|
|
1318
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1319
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1320
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1321
|
+
}
|
|
1322
|
+
/** PATCH /api/v1/model-providers/{provider_id}. Preserves response metadata; mutations are not replayed. */
|
|
1323
|
+
update(body, options) {
|
|
1324
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, Object.fromEntries(Object.entries({
|
|
1325
|
+
"If-Match": options.ifMatch,
|
|
1326
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
1327
|
+
})
|
|
1328
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1329
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1330
|
+
}
|
|
1331
|
+
/** POST /api/v1/model-providers/{provider_id}/test. Preserves response metadata; mutations are not replayed. */
|
|
1332
|
+
test(options = {}) {
|
|
1333
|
+
return jsonRequest(this.transport, "POST", this.path + "/test", undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1334
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1335
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
export class ModelsResource {
|
|
1339
|
+
transport;
|
|
1340
|
+
path;
|
|
1341
|
+
constructor(transport, path) {
|
|
1342
|
+
this.transport = transport;
|
|
1343
|
+
this.path = path;
|
|
1344
|
+
}
|
|
1345
|
+
/** GET /api/v1/models. Preserves response metadata; mutations are not replayed. */
|
|
1346
|
+
list(options = {}) {
|
|
1347
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1348
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1349
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
1350
|
+
}
|
|
1351
|
+
pages(options = {}) {
|
|
1352
|
+
const query = snapshot(options.query ?? {});
|
|
1353
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
1354
|
+
}
|
|
1355
|
+
items(options = {}) {
|
|
1356
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
1357
|
+
}
|
|
1358
|
+
/** POST /api/v1/models. Preserves response metadata; mutations are not replayed. */
|
|
1359
|
+
create(body, options = {}) {
|
|
1360
|
+
return jsonRequest(this.transport, "POST", this.path, body, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1361
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1362
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1363
|
+
}
|
|
1364
|
+
ref(value) {
|
|
1365
|
+
return new ModelsKeyResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
export class ModelsKeyResource {
|
|
1369
|
+
transport;
|
|
1370
|
+
path;
|
|
1371
|
+
constructor(transport, path) {
|
|
1372
|
+
this.transport = transport;
|
|
1373
|
+
this.path = path;
|
|
1374
|
+
}
|
|
1375
|
+
/** GET /api/v1/models/{key}. Preserves response metadata; mutations are not replayed. */
|
|
1376
|
+
get(options = {}) {
|
|
1377
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1378
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1379
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1380
|
+
}
|
|
1381
|
+
/** PATCH /api/v1/models/{key}. Preserves response metadata; mutations are not replayed. */
|
|
1382
|
+
update(body, options) {
|
|
1383
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, Object.fromEntries(Object.entries({
|
|
1384
|
+
"If-Match": options.ifMatch,
|
|
1385
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
1386
|
+
})
|
|
1387
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1388
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
export class OrganizationsResource {
|
|
1392
|
+
transport;
|
|
1393
|
+
path;
|
|
1394
|
+
constructor(transport, path) {
|
|
1395
|
+
this.transport = transport;
|
|
1396
|
+
this.path = path;
|
|
1397
|
+
}
|
|
1398
|
+
/** GET /api/v1/organizations. Preserves response metadata; mutations are not replayed. */
|
|
1399
|
+
list(options = {}) {
|
|
1400
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
1401
|
+
signal: options.signal,
|
|
1402
|
+
query: options.query,
|
|
1403
|
+
});
|
|
1404
|
+
}
|
|
1405
|
+
pages(options = {}) {
|
|
1406
|
+
const query = snapshot(options.query ?? {});
|
|
1407
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
1408
|
+
}
|
|
1409
|
+
items(options = {}) {
|
|
1410
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
1411
|
+
}
|
|
1412
|
+
ref(value) {
|
|
1413
|
+
return new OrganizationsOrganizationIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
export class OrganizationsOrganizationIdResource {
|
|
1417
|
+
transport;
|
|
1418
|
+
path;
|
|
1419
|
+
constructor(transport, path) {
|
|
1420
|
+
this.transport = transport;
|
|
1421
|
+
this.path = path;
|
|
1422
|
+
}
|
|
1423
|
+
/** GET /api/v1/organizations/{organization_id}. Preserves response metadata; mutations are not replayed. */
|
|
1424
|
+
get(options = {}) {
|
|
1425
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
1426
|
+
signal: options.signal,
|
|
1427
|
+
});
|
|
1428
|
+
}
|
|
1429
|
+
/** PATCH /api/v1/organizations/{organization_id}. Preserves response metadata; mutations are not replayed. */
|
|
1430
|
+
update(body, options) {
|
|
1431
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, Object.fromEntries(Object.entries({ "If-Match": options.ifMatch })
|
|
1432
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1433
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1434
|
+
}
|
|
1435
|
+
get auditEvents() {
|
|
1436
|
+
return new OrganizationsOrganizationIdAuditEventsResource(this.transport, this.path + "/audit-events");
|
|
1437
|
+
}
|
|
1438
|
+
get grants() {
|
|
1439
|
+
return new OrganizationsOrganizationIdGrantsResource(this.transport, this.path + "/grants");
|
|
1440
|
+
}
|
|
1441
|
+
get icon() {
|
|
1442
|
+
return new OrganizationsOrganizationIdIconResource(this.transport, this.path + "/icon");
|
|
1443
|
+
}
|
|
1444
|
+
get invitations() {
|
|
1445
|
+
return new OrganizationsOrganizationIdInvitationsResource(this.transport, this.path + "/invitations");
|
|
1446
|
+
}
|
|
1447
|
+
get members() {
|
|
1448
|
+
return new OrganizationsOrganizationIdMembersResource(this.transport, this.path + "/members");
|
|
1449
|
+
}
|
|
1450
|
+
get workspaces() {
|
|
1451
|
+
return new OrganizationsOrganizationIdWorkspacesResource(this.transport, this.path + "/workspaces");
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
export class OrganizationsOrganizationIdAuditEventsResource {
|
|
1455
|
+
transport;
|
|
1456
|
+
path;
|
|
1457
|
+
constructor(transport, path) {
|
|
1458
|
+
this.transport = transport;
|
|
1459
|
+
this.path = path;
|
|
1460
|
+
}
|
|
1461
|
+
/** GET /api/v1/organizations/{organization_id}/audit-events. Preserves response metadata; mutations are not replayed. */
|
|
1462
|
+
list(options = {}) {
|
|
1463
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
1464
|
+
signal: options.signal,
|
|
1465
|
+
query: options.query,
|
|
1466
|
+
});
|
|
1467
|
+
}
|
|
1468
|
+
pages(options = {}) {
|
|
1469
|
+
const query = snapshot(options.query ?? {});
|
|
1470
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
1471
|
+
}
|
|
1472
|
+
items(options = {}) {
|
|
1473
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
export class OrganizationsOrganizationIdGrantsResource {
|
|
1477
|
+
transport;
|
|
1478
|
+
path;
|
|
1479
|
+
constructor(transport, path) {
|
|
1480
|
+
this.transport = transport;
|
|
1481
|
+
this.path = path;
|
|
1482
|
+
}
|
|
1483
|
+
/** GET /api/v1/organizations/{organization_id}/grants. Preserves response metadata; mutations are not replayed. */
|
|
1484
|
+
list(options = {}) {
|
|
1485
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
1486
|
+
signal: options.signal,
|
|
1487
|
+
query: options.query,
|
|
1488
|
+
});
|
|
1489
|
+
}
|
|
1490
|
+
pages(options = {}) {
|
|
1491
|
+
const query = snapshot(options.query ?? {});
|
|
1492
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
1493
|
+
}
|
|
1494
|
+
items(options = {}) {
|
|
1495
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
1496
|
+
}
|
|
1497
|
+
/** POST /api/v1/organizations/{organization_id}/grants. Preserves response metadata; mutations are not replayed. */
|
|
1498
|
+
create(body, options = {}) {
|
|
1499
|
+
return jsonRequest(this.transport, "POST", this.path, body, undefined, {
|
|
1500
|
+
signal: options.signal,
|
|
1501
|
+
});
|
|
1502
|
+
}
|
|
1503
|
+
ref(value) {
|
|
1504
|
+
return new OrganizationsOrganizationIdGrantsGrantIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
export class OrganizationsOrganizationIdGrantsGrantIdResource {
|
|
1508
|
+
transport;
|
|
1509
|
+
path;
|
|
1510
|
+
constructor(transport, path) {
|
|
1511
|
+
this.transport = transport;
|
|
1512
|
+
this.path = path;
|
|
1513
|
+
}
|
|
1514
|
+
/** DELETE /api/v1/organizations/{organization_id}/grants/{grant_id}. Preserves response metadata; mutations are not replayed. */
|
|
1515
|
+
delete(options = {}) {
|
|
1516
|
+
return jsonRequest(this.transport, "DELETE", this.path, undefined, undefined, { signal: options.signal });
|
|
1517
|
+
}
|
|
1518
|
+
/** PATCH /api/v1/organizations/{organization_id}/grants/{grant_id}. Preserves response metadata; mutations are not replayed. */
|
|
1519
|
+
update(body, options = {}) {
|
|
1520
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, undefined, {
|
|
1521
|
+
signal: options.signal,
|
|
1522
|
+
});
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
export class OrganizationsOrganizationIdIconResource {
|
|
1526
|
+
transport;
|
|
1527
|
+
path;
|
|
1528
|
+
constructor(transport, path) {
|
|
1529
|
+
this.transport = transport;
|
|
1530
|
+
this.path = path;
|
|
1531
|
+
}
|
|
1532
|
+
/** DELETE /api/v1/organizations/{organization_id}/icon. Preserves response metadata; mutations are not replayed. */
|
|
1533
|
+
delete(options) {
|
|
1534
|
+
return jsonRequest(this.transport, "DELETE", this.path, undefined, Object.fromEntries(Object.entries({ "If-Match": options.ifMatch })
|
|
1535
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1536
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1537
|
+
}
|
|
1538
|
+
/** GET /api/v1/organizations/{organization_id}/icon. Caller owns and closes the unbuffered body. */
|
|
1539
|
+
get(options = {}) {
|
|
1540
|
+
return binaryRequest(this.transport, this.path, {
|
|
1541
|
+
...{ signal: options.signal },
|
|
1542
|
+
headers: undefined,
|
|
1543
|
+
accept: "image/jpeg, image/png, image/webp",
|
|
1544
|
+
});
|
|
1545
|
+
}
|
|
1546
|
+
/** PUT /api/v1/organizations/{organization_id}/icon. Preserves response metadata; mutations are not replayed. */
|
|
1547
|
+
replace(body, options) {
|
|
1548
|
+
return uploadRequest(this.transport, "PUT", this.path, body, options.contentType, Object.fromEntries(Object.entries({ "If-Match": options.ifMatch })
|
|
1549
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1550
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
export class OrganizationsOrganizationIdInvitationsResource {
|
|
1554
|
+
transport;
|
|
1555
|
+
path;
|
|
1556
|
+
constructor(transport, path) {
|
|
1557
|
+
this.transport = transport;
|
|
1558
|
+
this.path = path;
|
|
1559
|
+
}
|
|
1560
|
+
/** GET /api/v1/organizations/{organization_id}/invitations. Preserves response metadata; mutations are not replayed. */
|
|
1561
|
+
list(options = {}) {
|
|
1562
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
1563
|
+
signal: options.signal,
|
|
1564
|
+
query: options.query,
|
|
1565
|
+
});
|
|
1566
|
+
}
|
|
1567
|
+
pages(options = {}) {
|
|
1568
|
+
const query = snapshot(options.query ?? {});
|
|
1569
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
1570
|
+
}
|
|
1571
|
+
items(options = {}) {
|
|
1572
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
1573
|
+
}
|
|
1574
|
+
/** POST /api/v1/organizations/{organization_id}/invitations. Preserves response metadata; mutations are not replayed. */
|
|
1575
|
+
create(body, options = {}) {
|
|
1576
|
+
return jsonRequest(this.transport, "POST", this.path, body, undefined, {
|
|
1577
|
+
signal: options.signal,
|
|
1578
|
+
});
|
|
1579
|
+
}
|
|
1580
|
+
ref(value) {
|
|
1581
|
+
return new OrganizationsOrganizationIdInvitationsInvitationIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1584
|
+
export class OrganizationsOrganizationIdInvitationsInvitationIdResource {
|
|
1585
|
+
transport;
|
|
1586
|
+
path;
|
|
1587
|
+
constructor(transport, path) {
|
|
1588
|
+
this.transport = transport;
|
|
1589
|
+
this.path = path;
|
|
1590
|
+
}
|
|
1591
|
+
/** POST /api/v1/organizations/{organization_id}/invitations/{invitation_id}/resend. Preserves response metadata; mutations are not replayed. */
|
|
1592
|
+
resend(options) {
|
|
1593
|
+
return jsonRequest(this.transport, "POST", this.path + "/resend", undefined, Object.fromEntries(Object.entries({ "If-Match": options.ifMatch })
|
|
1594
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1595
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1596
|
+
}
|
|
1597
|
+
/** POST /api/v1/organizations/{organization_id}/invitations/{invitation_id}/revoke. Preserves response metadata; mutations are not replayed. */
|
|
1598
|
+
revoke(options) {
|
|
1599
|
+
return jsonRequest(this.transport, "POST", this.path + "/revoke", undefined, Object.fromEntries(Object.entries({ "If-Match": options.ifMatch })
|
|
1600
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1601
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
export class OrganizationsOrganizationIdMembersResource {
|
|
1605
|
+
transport;
|
|
1606
|
+
path;
|
|
1607
|
+
constructor(transport, path) {
|
|
1608
|
+
this.transport = transport;
|
|
1609
|
+
this.path = path;
|
|
1610
|
+
}
|
|
1611
|
+
/** GET /api/v1/organizations/{organization_id}/members. Preserves response metadata; mutations are not replayed. */
|
|
1612
|
+
list(options = {}) {
|
|
1613
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
1614
|
+
signal: options.signal,
|
|
1615
|
+
query: options.query,
|
|
1616
|
+
});
|
|
1617
|
+
}
|
|
1618
|
+
pages(options = {}) {
|
|
1619
|
+
const query = snapshot(options.query ?? {});
|
|
1620
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
1621
|
+
}
|
|
1622
|
+
items(options = {}) {
|
|
1623
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
export class OrganizationsOrganizationIdWorkspacesResource {
|
|
1627
|
+
transport;
|
|
1628
|
+
path;
|
|
1629
|
+
constructor(transport, path) {
|
|
1630
|
+
this.transport = transport;
|
|
1631
|
+
this.path = path;
|
|
1632
|
+
}
|
|
1633
|
+
/** GET /api/v1/organizations/{organization_id}/workspaces. Preserves response metadata; mutations are not replayed. */
|
|
1634
|
+
list(options = {}) {
|
|
1635
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
1636
|
+
signal: options.signal,
|
|
1637
|
+
query: options.query,
|
|
1638
|
+
});
|
|
1639
|
+
}
|
|
1640
|
+
pages(options = {}) {
|
|
1641
|
+
const query = snapshot(options.query ?? {});
|
|
1642
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
1643
|
+
}
|
|
1644
|
+
items(options = {}) {
|
|
1645
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
1646
|
+
}
|
|
1647
|
+
/** POST /api/v1/organizations/{organization_id}/workspaces. Preserves response metadata; mutations are not replayed. */
|
|
1648
|
+
create(body, options = {}) {
|
|
1649
|
+
return jsonRequest(this.transport, "POST", this.path, body, undefined, {
|
|
1650
|
+
signal: options.signal,
|
|
1651
|
+
});
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
export class ProviderTypesResource {
|
|
1655
|
+
transport;
|
|
1656
|
+
path;
|
|
1657
|
+
constructor(transport, path) {
|
|
1658
|
+
this.transport = transport;
|
|
1659
|
+
this.path = path;
|
|
1660
|
+
}
|
|
1661
|
+
ref(value) {
|
|
1662
|
+
return new ProviderTypesKindResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
export class ProviderTypesKindResource {
|
|
1666
|
+
transport;
|
|
1667
|
+
path;
|
|
1668
|
+
constructor(transport, path) {
|
|
1669
|
+
this.transport = transport;
|
|
1670
|
+
this.path = path;
|
|
1671
|
+
}
|
|
1672
|
+
/** GET /api/v1/provider-types/{kind}. Preserves response metadata; mutations are not replayed. */
|
|
1673
|
+
list(options = {}) {
|
|
1674
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
1675
|
+
signal: options.signal,
|
|
1676
|
+
});
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
export class RunsResource {
|
|
1680
|
+
transport;
|
|
1681
|
+
path;
|
|
1682
|
+
constructor(transport, path) {
|
|
1683
|
+
this.transport = transport;
|
|
1684
|
+
this.path = path;
|
|
1685
|
+
}
|
|
1686
|
+
ref(value) {
|
|
1687
|
+
return new RunsRunIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
export class RunsRunIdResource {
|
|
1691
|
+
transport;
|
|
1692
|
+
path;
|
|
1693
|
+
constructor(transport, path) {
|
|
1694
|
+
this.transport = transport;
|
|
1695
|
+
this.path = path;
|
|
1696
|
+
}
|
|
1697
|
+
/** GET /api/v1/runs/{run_id}. Preserves response metadata; mutations are not replayed. */
|
|
1698
|
+
get(options = {}) {
|
|
1699
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1700
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1701
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1702
|
+
}
|
|
1703
|
+
/** PATCH /api/v1/runs/{run_id}. Preserves response metadata; mutations are not replayed. */
|
|
1704
|
+
update(body, options) {
|
|
1705
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, Object.fromEntries(Object.entries({
|
|
1706
|
+
"If-Match": options.ifMatch,
|
|
1707
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
1708
|
+
})
|
|
1709
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1710
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1711
|
+
}
|
|
1712
|
+
get attempts() {
|
|
1713
|
+
return new RunsRunIdAttemptsResource(this.transport, this.path + "/attempts");
|
|
1714
|
+
}
|
|
1715
|
+
/** POST /api/v1/runs/{run_id}/fork. Preserves response metadata; mutations are not replayed. */
|
|
1716
|
+
fork(body, options) {
|
|
1717
|
+
return jsonRequest(this.transport, "POST", this.path + "/fork", body, Object.fromEntries(Object.entries({
|
|
1718
|
+
"Idempotency-Key": options.idempotencyKey,
|
|
1719
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
1720
|
+
})
|
|
1721
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1722
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1723
|
+
}
|
|
1724
|
+
/** POST /api/v1/runs/{run_id}/interrupt. Preserves response metadata; mutations are not replayed. */
|
|
1725
|
+
interrupt(options = {}) {
|
|
1726
|
+
return jsonRequest(this.transport, "POST", this.path + "/interrupt", undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1727
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1728
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1729
|
+
}
|
|
1730
|
+
get items() {
|
|
1731
|
+
return new RunsRunIdItemsResource(this.transport, this.path + "/items");
|
|
1732
|
+
}
|
|
1733
|
+
get lineage() {
|
|
1734
|
+
return new RunsRunIdLineageResource(this.transport, this.path + "/lineage");
|
|
1735
|
+
}
|
|
1736
|
+
/** POST /api/v1/runs/{run_id}/resume. Preserves response metadata; mutations are not replayed. */
|
|
1737
|
+
resume(body, options) {
|
|
1738
|
+
return jsonRequest(this.transport, "POST", this.path + "/resume", body, Object.fromEntries(Object.entries({
|
|
1739
|
+
"Idempotency-Key": options.idempotencyKey,
|
|
1740
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
1741
|
+
})
|
|
1742
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1743
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
export class RunsRunIdAttemptsResource {
|
|
1747
|
+
transport;
|
|
1748
|
+
path;
|
|
1749
|
+
constructor(transport, path) {
|
|
1750
|
+
this.transport = transport;
|
|
1751
|
+
this.path = path;
|
|
1752
|
+
}
|
|
1753
|
+
/** GET /api/v1/runs/{run_id}/attempts. Preserves response metadata; mutations are not replayed. */
|
|
1754
|
+
list(options = {}) {
|
|
1755
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1756
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1757
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1758
|
+
}
|
|
1759
|
+
ref(value) {
|
|
1760
|
+
return new RunsRunIdAttemptsAttemptIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
export class RunsRunIdAttemptsAttemptIdResource {
|
|
1764
|
+
transport;
|
|
1765
|
+
path;
|
|
1766
|
+
constructor(transport, path) {
|
|
1767
|
+
this.transport = transport;
|
|
1768
|
+
this.path = path;
|
|
1769
|
+
}
|
|
1770
|
+
get trace() {
|
|
1771
|
+
return new RunsRunIdAttemptsAttemptIdTraceResource(this.transport, this.path + "/trace");
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
export class RunsRunIdAttemptsAttemptIdTraceResource {
|
|
1775
|
+
transport;
|
|
1776
|
+
path;
|
|
1777
|
+
constructor(transport, path) {
|
|
1778
|
+
this.transport = transport;
|
|
1779
|
+
this.path = path;
|
|
1780
|
+
}
|
|
1781
|
+
/** GET /api/v1/runs/{run_id}/attempts/{attempt_id}/trace. Preserves response metadata; mutations are not replayed. */
|
|
1782
|
+
list(options = {}) {
|
|
1783
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1784
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1785
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
1786
|
+
}
|
|
1787
|
+
pages(options = {}) {
|
|
1788
|
+
const query = snapshot(options.query ?? {});
|
|
1789
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
1790
|
+
}
|
|
1791
|
+
items(options = {}) {
|
|
1792
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
1793
|
+
}
|
|
1794
|
+
}
|
|
1795
|
+
export class RunsRunIdItemsResource {
|
|
1796
|
+
transport;
|
|
1797
|
+
path;
|
|
1798
|
+
constructor(transport, path) {
|
|
1799
|
+
this.transport = transport;
|
|
1800
|
+
this.path = path;
|
|
1801
|
+
}
|
|
1802
|
+
/** GET /api/v1/runs/{run_id}/items. Preserves response metadata; mutations are not replayed. */
|
|
1803
|
+
get(options = {}) {
|
|
1804
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1805
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1806
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
export class RunsRunIdLineageResource {
|
|
1810
|
+
transport;
|
|
1811
|
+
path;
|
|
1812
|
+
constructor(transport, path) {
|
|
1813
|
+
this.transport = transport;
|
|
1814
|
+
this.path = path;
|
|
1815
|
+
}
|
|
1816
|
+
/** GET /api/v1/runs/{run_id}/lineage. Preserves response metadata; mutations are not replayed. */
|
|
1817
|
+
list(options = {}) {
|
|
1818
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1819
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1820
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
1821
|
+
}
|
|
1822
|
+
pages(options = {}) {
|
|
1823
|
+
const query = snapshot(options.query ?? {});
|
|
1824
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
1825
|
+
}
|
|
1826
|
+
items(options = {}) {
|
|
1827
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
export class SessionsResource {
|
|
1831
|
+
transport;
|
|
1832
|
+
path;
|
|
1833
|
+
constructor(transport, path) {
|
|
1834
|
+
this.transport = transport;
|
|
1835
|
+
this.path = path;
|
|
1836
|
+
}
|
|
1837
|
+
/** GET /api/v1/sessions. Preserves response metadata; mutations are not replayed. */
|
|
1838
|
+
list(options = {}) {
|
|
1839
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1840
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1841
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
1842
|
+
}
|
|
1843
|
+
pages(options = {}) {
|
|
1844
|
+
const query = snapshot(options.query ?? {});
|
|
1845
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
1846
|
+
}
|
|
1847
|
+
items(options = {}) {
|
|
1848
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
1849
|
+
}
|
|
1850
|
+
/** POST /api/v1/sessions. Preserves response metadata; mutations are not replayed. */
|
|
1851
|
+
create(body, options = {}) {
|
|
1852
|
+
return jsonRequest(this.transport, "POST", this.path, body, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1853
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1854
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1855
|
+
}
|
|
1856
|
+
ref(value) {
|
|
1857
|
+
return new SessionsSessionIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
1858
|
+
}
|
|
1859
|
+
}
|
|
1860
|
+
export class SessionsSessionIdResource {
|
|
1861
|
+
transport;
|
|
1862
|
+
path;
|
|
1863
|
+
constructor(transport, path) {
|
|
1864
|
+
this.transport = transport;
|
|
1865
|
+
this.path = path;
|
|
1866
|
+
}
|
|
1867
|
+
/** GET /api/v1/sessions/{session_id}. Preserves response metadata; mutations are not replayed. */
|
|
1868
|
+
get(options = {}) {
|
|
1869
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1870
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1871
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1872
|
+
}
|
|
1873
|
+
/** PATCH /api/v1/sessions/{session_id}. Preserves response metadata; mutations are not replayed. */
|
|
1874
|
+
update(body, options) {
|
|
1875
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, Object.fromEntries(Object.entries({
|
|
1876
|
+
"If-Match": options.ifMatch,
|
|
1877
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
1878
|
+
})
|
|
1879
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1880
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
export class SkillsResource {
|
|
1884
|
+
transport;
|
|
1885
|
+
path;
|
|
1886
|
+
constructor(transport, path) {
|
|
1887
|
+
this.transport = transport;
|
|
1888
|
+
this.path = path;
|
|
1889
|
+
}
|
|
1890
|
+
/** GET /api/v1/skills. Preserves response metadata; mutations are not replayed. */
|
|
1891
|
+
list(options = {}) {
|
|
1892
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1893
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1894
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
1895
|
+
}
|
|
1896
|
+
pages(options = {}) {
|
|
1897
|
+
const query = snapshot(options.query ?? {});
|
|
1898
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
1899
|
+
}
|
|
1900
|
+
items(options = {}) {
|
|
1901
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
1902
|
+
}
|
|
1903
|
+
/** POST /api/v1/skills. Preserves response metadata; mutations are not replayed. */
|
|
1904
|
+
create(body, options = {}) {
|
|
1905
|
+
return jsonRequest(this.transport, "POST", this.path, body, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1906
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1907
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1908
|
+
}
|
|
1909
|
+
/** POST /api/v1/skills/validate. Preserves response metadata; mutations are not replayed. */
|
|
1910
|
+
validate(body, options = {}) {
|
|
1911
|
+
return jsonRequest(this.transport, "POST", this.path + "/validate", body, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1912
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1913
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1914
|
+
}
|
|
1915
|
+
ref(value) {
|
|
1916
|
+
return new SkillsSkillIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1919
|
+
export class SkillsSkillIdResource {
|
|
1920
|
+
transport;
|
|
1921
|
+
path;
|
|
1922
|
+
constructor(transport, path) {
|
|
1923
|
+
this.transport = transport;
|
|
1924
|
+
this.path = path;
|
|
1925
|
+
}
|
|
1926
|
+
/** GET /api/v1/skills/{skill_id}. Preserves response metadata; mutations are not replayed. */
|
|
1927
|
+
get(options = {}) {
|
|
1928
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1929
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1930
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1931
|
+
}
|
|
1932
|
+
/** PATCH /api/v1/skills/{skill_id}. Preserves response metadata; mutations are not replayed. */
|
|
1933
|
+
update(body, options) {
|
|
1934
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, Object.fromEntries(Object.entries({
|
|
1935
|
+
"If-Match": options.ifMatch,
|
|
1936
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
1937
|
+
})
|
|
1938
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1939
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1940
|
+
}
|
|
1941
|
+
/** POST /api/v1/skills/{skill_id}/archive. Preserves response metadata; mutations are not replayed. */
|
|
1942
|
+
archive(options) {
|
|
1943
|
+
return jsonRequest(this.transport, "POST", this.path + "/archive", undefined, Object.fromEntries(Object.entries({
|
|
1944
|
+
"If-Match": options.ifMatch,
|
|
1945
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
1946
|
+
})
|
|
1947
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1948
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1949
|
+
}
|
|
1950
|
+
get revisions() {
|
|
1951
|
+
return new SkillsSkillIdRevisionsResource(this.transport, this.path + "/revisions");
|
|
1952
|
+
}
|
|
1953
|
+
/** POST /api/v1/skills/{skill_id}/unarchive. Preserves response metadata; mutations are not replayed. */
|
|
1954
|
+
unarchive(options) {
|
|
1955
|
+
return jsonRequest(this.transport, "POST", this.path + "/unarchive", undefined, Object.fromEntries(Object.entries({
|
|
1956
|
+
"If-Match": options.ifMatch,
|
|
1957
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
1958
|
+
})
|
|
1959
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1960
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
export class SkillsSkillIdRevisionsResource {
|
|
1964
|
+
transport;
|
|
1965
|
+
path;
|
|
1966
|
+
constructor(transport, path) {
|
|
1967
|
+
this.transport = transport;
|
|
1968
|
+
this.path = path;
|
|
1969
|
+
}
|
|
1970
|
+
/** GET /api/v1/skills/{skill_id}/revisions. Preserves response metadata; mutations are not replayed. */
|
|
1971
|
+
list(options = {}) {
|
|
1972
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
1973
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1974
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
1975
|
+
}
|
|
1976
|
+
pages(options = {}) {
|
|
1977
|
+
const query = snapshot(options.query ?? {});
|
|
1978
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
1979
|
+
}
|
|
1980
|
+
items(options = {}) {
|
|
1981
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
1982
|
+
}
|
|
1983
|
+
/** POST /api/v1/skills/{skill_id}/revisions. Preserves response metadata; mutations are not replayed. */
|
|
1984
|
+
create(body, options) {
|
|
1985
|
+
return jsonRequest(this.transport, "POST", this.path, body, Object.fromEntries(Object.entries({
|
|
1986
|
+
"If-Match": options.ifMatch,
|
|
1987
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
1988
|
+
})
|
|
1989
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
1990
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
1991
|
+
}
|
|
1992
|
+
ref(value) {
|
|
1993
|
+
return new SkillsSkillIdRevisionsRevisionIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
export class SkillsSkillIdRevisionsRevisionIdResource {
|
|
1997
|
+
transport;
|
|
1998
|
+
path;
|
|
1999
|
+
constructor(transport, path) {
|
|
2000
|
+
this.transport = transport;
|
|
2001
|
+
this.path = path;
|
|
2002
|
+
}
|
|
2003
|
+
/** GET /api/v1/skills/{skill_id}/revisions/{revision_id}. Preserves response metadata; mutations are not replayed. */
|
|
2004
|
+
get(options = {}) {
|
|
2005
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2006
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2007
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2008
|
+
}
|
|
2009
|
+
get content() {
|
|
2010
|
+
return new SkillsSkillIdRevisionsRevisionIdContentResource(this.transport, this.path + "/content");
|
|
2011
|
+
}
|
|
2012
|
+
get files() {
|
|
2013
|
+
return new SkillsSkillIdRevisionsRevisionIdFilesResource(this.transport, this.path + "/files");
|
|
2014
|
+
}
|
|
2015
|
+
/** POST /api/v1/skills/{skill_id}/revisions/{revision_id}/set-default. Preserves response metadata; mutations are not replayed. */
|
|
2016
|
+
setDefault(options) {
|
|
2017
|
+
return jsonRequest(this.transport, "POST", this.path + "/set-default", undefined, Object.fromEntries(Object.entries({
|
|
2018
|
+
"If-Match": options.ifMatch,
|
|
2019
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
2020
|
+
})
|
|
2021
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2022
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
export class SkillsSkillIdRevisionsRevisionIdContentResource {
|
|
2026
|
+
transport;
|
|
2027
|
+
path;
|
|
2028
|
+
constructor(transport, path) {
|
|
2029
|
+
this.transport = transport;
|
|
2030
|
+
this.path = path;
|
|
2031
|
+
}
|
|
2032
|
+
/** GET /api/v1/skills/{skill_id}/revisions/{revision_id}/content. Caller owns and closes the unbuffered body. */
|
|
2033
|
+
get(options = {}) {
|
|
2034
|
+
return binaryRequest(this.transport, this.path, {
|
|
2035
|
+
...{ signal: options.signal },
|
|
2036
|
+
headers: Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2037
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2038
|
+
.map(([key, value]) => [key, String(value)])),
|
|
2039
|
+
accept: "application/zip",
|
|
2040
|
+
});
|
|
2041
|
+
}
|
|
2042
|
+
}
|
|
2043
|
+
export class SkillsSkillIdRevisionsRevisionIdFilesResource {
|
|
2044
|
+
transport;
|
|
2045
|
+
path;
|
|
2046
|
+
constructor(transport, path) {
|
|
2047
|
+
this.transport = transport;
|
|
2048
|
+
this.path = path;
|
|
2049
|
+
}
|
|
2050
|
+
ref(value) {
|
|
2051
|
+
return new SkillsSkillIdRevisionsRevisionIdFilesPathResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
2054
|
+
export class SkillsSkillIdRevisionsRevisionIdFilesPathResource {
|
|
2055
|
+
transport;
|
|
2056
|
+
path;
|
|
2057
|
+
constructor(transport, path) {
|
|
2058
|
+
this.transport = transport;
|
|
2059
|
+
this.path = path;
|
|
2060
|
+
}
|
|
2061
|
+
/** GET /api/v1/skills/{skill_id}/revisions/{revision_id}/files/{path}. Caller owns and closes the unbuffered body. */
|
|
2062
|
+
get(options = {}) {
|
|
2063
|
+
return binaryRequest(this.transport, this.path, {
|
|
2064
|
+
...{ signal: options.signal },
|
|
2065
|
+
headers: Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2066
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2067
|
+
.map(([key, value]) => [key, String(value)])),
|
|
2068
|
+
accept: "application/octet-stream",
|
|
2069
|
+
});
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
export class SubscriptionsResource {
|
|
2073
|
+
transport;
|
|
2074
|
+
path;
|
|
2075
|
+
constructor(transport, path) {
|
|
2076
|
+
this.transport = transport;
|
|
2077
|
+
this.path = path;
|
|
2078
|
+
}
|
|
2079
|
+
/** GET /api/v1/subscriptions. Preserves response metadata; mutations are not replayed. */
|
|
2080
|
+
list(options = {}) {
|
|
2081
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2082
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2083
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
2084
|
+
}
|
|
2085
|
+
pages(options = {}) {
|
|
2086
|
+
const query = snapshot(options.query ?? {});
|
|
2087
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
2088
|
+
}
|
|
2089
|
+
items(options = {}) {
|
|
2090
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
2091
|
+
}
|
|
2092
|
+
/** POST /api/v1/subscriptions. Preserves response metadata; mutations are not replayed. */
|
|
2093
|
+
create(body, options = {}) {
|
|
2094
|
+
return jsonRequest(this.transport, "POST", this.path, body, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2095
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2096
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2097
|
+
}
|
|
2098
|
+
ref(value) {
|
|
2099
|
+
return new SubscriptionsSubscriptionIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
export class SubscriptionsSubscriptionIdResource {
|
|
2103
|
+
transport;
|
|
2104
|
+
path;
|
|
2105
|
+
constructor(transport, path) {
|
|
2106
|
+
this.transport = transport;
|
|
2107
|
+
this.path = path;
|
|
2108
|
+
}
|
|
2109
|
+
/** DELETE /api/v1/subscriptions/{subscription_id}. Preserves response metadata; mutations are not replayed. */
|
|
2110
|
+
delete(options) {
|
|
2111
|
+
return jsonRequest(this.transport, "DELETE", this.path, undefined, Object.fromEntries(Object.entries({
|
|
2112
|
+
"If-Match": options.ifMatch,
|
|
2113
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
2114
|
+
})
|
|
2115
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2116
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2117
|
+
}
|
|
2118
|
+
/** GET /api/v1/subscriptions/{subscription_id}. Preserves response metadata; mutations are not replayed. */
|
|
2119
|
+
get(options = {}) {
|
|
2120
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2121
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2122
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2123
|
+
}
|
|
2124
|
+
/** PATCH /api/v1/subscriptions/{subscription_id}. Preserves response metadata; mutations are not replayed. */
|
|
2125
|
+
update(body, options) {
|
|
2126
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, Object.fromEntries(Object.entries({
|
|
2127
|
+
"If-Match": options.ifMatch,
|
|
2128
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
2129
|
+
})
|
|
2130
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2131
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2132
|
+
}
|
|
2133
|
+
get deliveries() {
|
|
2134
|
+
return new SubscriptionsSubscriptionIdDeliveriesResource(this.transport, this.path + "/deliveries");
|
|
2135
|
+
}
|
|
2136
|
+
}
|
|
2137
|
+
export class SubscriptionsSubscriptionIdDeliveriesResource {
|
|
2138
|
+
transport;
|
|
2139
|
+
path;
|
|
2140
|
+
constructor(transport, path) {
|
|
2141
|
+
this.transport = transport;
|
|
2142
|
+
this.path = path;
|
|
2143
|
+
}
|
|
2144
|
+
/** GET /api/v1/subscriptions/{subscription_id}/deliveries. Preserves response metadata; mutations are not replayed. */
|
|
2145
|
+
list(options = {}) {
|
|
2146
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2147
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2148
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
2149
|
+
}
|
|
2150
|
+
pages(options = {}) {
|
|
2151
|
+
const query = snapshot(options.query ?? {});
|
|
2152
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
2153
|
+
}
|
|
2154
|
+
items(options = {}) {
|
|
2155
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
2156
|
+
}
|
|
2157
|
+
ref(value) {
|
|
2158
|
+
return new SubscriptionsSubscriptionIdDeliveriesDeliveryIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
2159
|
+
}
|
|
2160
|
+
}
|
|
2161
|
+
export class SubscriptionsSubscriptionIdDeliveriesDeliveryIdResource {
|
|
2162
|
+
transport;
|
|
2163
|
+
path;
|
|
2164
|
+
constructor(transport, path) {
|
|
2165
|
+
this.transport = transport;
|
|
2166
|
+
this.path = path;
|
|
2167
|
+
}
|
|
2168
|
+
/** POST /api/v1/subscriptions/{subscription_id}/deliveries/{delivery_id}/redeliver. Preserves response metadata; mutations are not replayed. */
|
|
2169
|
+
redeliver(options = {}) {
|
|
2170
|
+
return jsonRequest(this.transport, "POST", this.path + "/redeliver", undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2171
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2172
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2173
|
+
}
|
|
2174
|
+
}
|
|
2175
|
+
export class ThreadsResource {
|
|
2176
|
+
transport;
|
|
2177
|
+
path;
|
|
2178
|
+
constructor(transport, path) {
|
|
2179
|
+
this.transport = transport;
|
|
2180
|
+
this.path = path;
|
|
2181
|
+
}
|
|
2182
|
+
/** GET /api/v1/threads. Preserves response metadata; mutations are not replayed. */
|
|
2183
|
+
list(options = {}) {
|
|
2184
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2185
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2186
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
2187
|
+
}
|
|
2188
|
+
pages(options = {}) {
|
|
2189
|
+
const query = snapshot(options.query ?? {});
|
|
2190
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
2191
|
+
}
|
|
2192
|
+
items(options = {}) {
|
|
2193
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
2194
|
+
}
|
|
2195
|
+
/** POST /api/v1/threads. Preserves response metadata; mutations are not replayed. */
|
|
2196
|
+
create(body, options) {
|
|
2197
|
+
return jsonRequest(this.transport, "POST", this.path, body, Object.fromEntries(Object.entries({
|
|
2198
|
+
"Idempotency-Key": options.idempotencyKey,
|
|
2199
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
2200
|
+
})
|
|
2201
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2202
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2203
|
+
}
|
|
2204
|
+
ref(value) {
|
|
2205
|
+
return new ThreadsThreadIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
2206
|
+
}
|
|
2207
|
+
}
|
|
2208
|
+
export class ThreadsThreadIdResource {
|
|
2209
|
+
transport;
|
|
2210
|
+
path;
|
|
2211
|
+
constructor(transport, path) {
|
|
2212
|
+
this.transport = transport;
|
|
2213
|
+
this.path = path;
|
|
2214
|
+
}
|
|
2215
|
+
/** GET /api/v1/threads/{thread_id}. Preserves response metadata; mutations are not replayed. */
|
|
2216
|
+
get(options = {}) {
|
|
2217
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2218
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2219
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2220
|
+
}
|
|
2221
|
+
/** PATCH /api/v1/threads/{thread_id}. Preserves response metadata; mutations are not replayed. */
|
|
2222
|
+
update(body, options) {
|
|
2223
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, Object.fromEntries(Object.entries({
|
|
2224
|
+
"If-Match": options.ifMatch,
|
|
2225
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
2226
|
+
})
|
|
2227
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2228
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2229
|
+
}
|
|
2230
|
+
/** POST /api/v1/threads/{thread_id}/archive. Preserves response metadata; mutations are not replayed. */
|
|
2231
|
+
archive(options) {
|
|
2232
|
+
return jsonRequest(this.transport, "POST", this.path + "/archive", undefined, Object.fromEntries(Object.entries({
|
|
2233
|
+
"If-Match": options.ifMatch,
|
|
2234
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
2235
|
+
})
|
|
2236
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2237
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2238
|
+
}
|
|
2239
|
+
get environments() {
|
|
2240
|
+
return new ThreadsThreadIdEnvironmentsResource(this.transport, this.path + "/environments");
|
|
2241
|
+
}
|
|
2242
|
+
get inbox() {
|
|
2243
|
+
return new ThreadsThreadIdInboxResource(this.transport, this.path + "/inbox");
|
|
2244
|
+
}
|
|
2245
|
+
get memories() {
|
|
2246
|
+
return new ThreadsThreadIdMemoriesResource(this.transport, this.path + "/memories");
|
|
2247
|
+
}
|
|
2248
|
+
get runs() {
|
|
2249
|
+
return new ThreadsThreadIdRunsResource(this.transport, this.path + "/runs");
|
|
2250
|
+
}
|
|
2251
|
+
get stream() {
|
|
2252
|
+
return new ThreadsThreadIdStreamResource(this.transport, this.path + "/stream");
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
export class ThreadsThreadIdEnvironmentsResource {
|
|
2256
|
+
transport;
|
|
2257
|
+
path;
|
|
2258
|
+
constructor(transport, path) {
|
|
2259
|
+
this.transport = transport;
|
|
2260
|
+
this.path = path;
|
|
2261
|
+
}
|
|
2262
|
+
/** GET /api/v1/threads/{thread_id}/environments. Preserves response metadata; mutations are not replayed. */
|
|
2263
|
+
list(options = {}) {
|
|
2264
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2265
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2266
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2267
|
+
}
|
|
2268
|
+
/** POST /api/v1/threads/{thread_id}/environments. Preserves response metadata; mutations are not replayed. */
|
|
2269
|
+
create(body, options) {
|
|
2270
|
+
return jsonRequest(this.transport, "POST", this.path, body, Object.fromEntries(Object.entries({
|
|
2271
|
+
"If-Match": options.ifMatch,
|
|
2272
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
2273
|
+
})
|
|
2274
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2275
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2276
|
+
}
|
|
2277
|
+
ref(value) {
|
|
2278
|
+
return new ThreadsThreadIdEnvironmentsNameResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
export class ThreadsThreadIdEnvironmentsNameResource {
|
|
2282
|
+
transport;
|
|
2283
|
+
path;
|
|
2284
|
+
constructor(transport, path) {
|
|
2285
|
+
this.transport = transport;
|
|
2286
|
+
this.path = path;
|
|
2287
|
+
}
|
|
2288
|
+
/** DELETE /api/v1/threads/{thread_id}/environments/{name}. Preserves response metadata; mutations are not replayed. */
|
|
2289
|
+
delete(options) {
|
|
2290
|
+
return jsonRequest(this.transport, "DELETE", this.path, undefined, Object.fromEntries(Object.entries({
|
|
2291
|
+
"If-Match": options.ifMatch,
|
|
2292
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
2293
|
+
})
|
|
2294
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2295
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2296
|
+
}
|
|
2297
|
+
}
|
|
2298
|
+
export class ThreadsThreadIdInboxResource {
|
|
2299
|
+
transport;
|
|
2300
|
+
path;
|
|
2301
|
+
constructor(transport, path) {
|
|
2302
|
+
this.transport = transport;
|
|
2303
|
+
this.path = path;
|
|
2304
|
+
}
|
|
2305
|
+
/** GET /api/v1/threads/{thread_id}/inbox. Preserves response metadata; mutations are not replayed. */
|
|
2306
|
+
list(options = {}) {
|
|
2307
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2308
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2309
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
2310
|
+
}
|
|
2311
|
+
pages(options = {}) {
|
|
2312
|
+
const query = snapshot(options.query ?? {});
|
|
2313
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
2314
|
+
}
|
|
2315
|
+
items(options = {}) {
|
|
2316
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
2317
|
+
}
|
|
2318
|
+
/** POST /api/v1/threads/{thread_id}/inbox. Preserves response metadata; mutations are not replayed. */
|
|
2319
|
+
create(body, options) {
|
|
2320
|
+
return jsonRequest(this.transport, "POST", this.path, body, Object.fromEntries(Object.entries({
|
|
2321
|
+
"Idempotency-Key": options.idempotencyKey,
|
|
2322
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
2323
|
+
})
|
|
2324
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2325
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2326
|
+
}
|
|
2327
|
+
get order() {
|
|
2328
|
+
return new ThreadsThreadIdInboxOrderResource(this.transport, this.path + "/order");
|
|
2329
|
+
}
|
|
2330
|
+
ref(value) {
|
|
2331
|
+
return new ThreadsThreadIdInboxEntryIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
2332
|
+
}
|
|
2333
|
+
}
|
|
2334
|
+
export class ThreadsThreadIdInboxOrderResource {
|
|
2335
|
+
transport;
|
|
2336
|
+
path;
|
|
2337
|
+
constructor(transport, path) {
|
|
2338
|
+
this.transport = transport;
|
|
2339
|
+
this.path = path;
|
|
2340
|
+
}
|
|
2341
|
+
/** PUT /api/v1/threads/{thread_id}/inbox/order. Preserves response metadata; mutations are not replayed. */
|
|
2342
|
+
replace(body, options) {
|
|
2343
|
+
return jsonRequest(this.transport, "PUT", this.path, body, Object.fromEntries(Object.entries({
|
|
2344
|
+
"If-Match": options.ifMatch,
|
|
2345
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
2346
|
+
})
|
|
2347
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2348
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2349
|
+
}
|
|
2350
|
+
}
|
|
2351
|
+
export class ThreadsThreadIdInboxEntryIdResource {
|
|
2352
|
+
transport;
|
|
2353
|
+
path;
|
|
2354
|
+
constructor(transport, path) {
|
|
2355
|
+
this.transport = transport;
|
|
2356
|
+
this.path = path;
|
|
2357
|
+
}
|
|
2358
|
+
/** DELETE /api/v1/threads/{thread_id}/inbox/{entry_id}. Preserves response metadata; mutations are not replayed. */
|
|
2359
|
+
delete(options) {
|
|
2360
|
+
return jsonRequest(this.transport, "DELETE", this.path, undefined, Object.fromEntries(Object.entries({
|
|
2361
|
+
"If-Match": options.ifMatch,
|
|
2362
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
2363
|
+
})
|
|
2364
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2365
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2366
|
+
}
|
|
2367
|
+
/** GET /api/v1/threads/{thread_id}/inbox/{entry_id}. Preserves response metadata; mutations are not replayed. */
|
|
2368
|
+
get(options = {}) {
|
|
2369
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2370
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2371
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2372
|
+
}
|
|
2373
|
+
/** PATCH /api/v1/threads/{thread_id}/inbox/{entry_id}. Preserves response metadata; mutations are not replayed. */
|
|
2374
|
+
update(body, options) {
|
|
2375
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, Object.fromEntries(Object.entries({
|
|
2376
|
+
"If-Match": options.ifMatch,
|
|
2377
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
2378
|
+
})
|
|
2379
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2380
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2381
|
+
}
|
|
2382
|
+
}
|
|
2383
|
+
export class ThreadsThreadIdMemoriesResource {
|
|
2384
|
+
transport;
|
|
2385
|
+
path;
|
|
2386
|
+
constructor(transport, path) {
|
|
2387
|
+
this.transport = transport;
|
|
2388
|
+
this.path = path;
|
|
2389
|
+
}
|
|
2390
|
+
/** GET /api/v1/threads/{thread_id}/memories. Preserves response metadata; mutations are not replayed. */
|
|
2391
|
+
list(options = {}) {
|
|
2392
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2393
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2394
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2395
|
+
}
|
|
2396
|
+
/** POST /api/v1/threads/{thread_id}/memories. Preserves response metadata; mutations are not replayed. */
|
|
2397
|
+
create(body, options) {
|
|
2398
|
+
return jsonRequest(this.transport, "POST", this.path, body, Object.fromEntries(Object.entries({
|
|
2399
|
+
"If-Match": options.ifMatch,
|
|
2400
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
2401
|
+
})
|
|
2402
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2403
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2404
|
+
}
|
|
2405
|
+
ref(value) {
|
|
2406
|
+
return new ThreadsThreadIdMemoriesNameResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
2407
|
+
}
|
|
2408
|
+
}
|
|
2409
|
+
export class ThreadsThreadIdMemoriesNameResource {
|
|
2410
|
+
transport;
|
|
2411
|
+
path;
|
|
2412
|
+
constructor(transport, path) {
|
|
2413
|
+
this.transport = transport;
|
|
2414
|
+
this.path = path;
|
|
2415
|
+
}
|
|
2416
|
+
/** DELETE /api/v1/threads/{thread_id}/memories/{name}. Preserves response metadata; mutations are not replayed. */
|
|
2417
|
+
delete(options) {
|
|
2418
|
+
return jsonRequest(this.transport, "DELETE", this.path, undefined, Object.fromEntries(Object.entries({
|
|
2419
|
+
"If-Match": options.ifMatch,
|
|
2420
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
2421
|
+
})
|
|
2422
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2423
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2424
|
+
}
|
|
2425
|
+
/** PATCH /api/v1/threads/{thread_id}/memories/{name}. Preserves response metadata; mutations are not replayed. */
|
|
2426
|
+
update(body, options) {
|
|
2427
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, Object.fromEntries(Object.entries({
|
|
2428
|
+
"If-Match": options.ifMatch,
|
|
2429
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
2430
|
+
})
|
|
2431
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2432
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2433
|
+
}
|
|
2434
|
+
}
|
|
2435
|
+
export class ThreadsThreadIdRunsResource {
|
|
2436
|
+
transport;
|
|
2437
|
+
path;
|
|
2438
|
+
constructor(transport, path) {
|
|
2439
|
+
this.transport = transport;
|
|
2440
|
+
this.path = path;
|
|
2441
|
+
}
|
|
2442
|
+
/** GET /api/v1/threads/{thread_id}/runs. Preserves response metadata; mutations are not replayed. */
|
|
2443
|
+
list(options = {}) {
|
|
2444
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2445
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2446
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
2447
|
+
}
|
|
2448
|
+
pages(options = {}) {
|
|
2449
|
+
const query = snapshot(options.query ?? {});
|
|
2450
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
2451
|
+
}
|
|
2452
|
+
items(options = {}) {
|
|
2453
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
2454
|
+
}
|
|
2455
|
+
}
|
|
2456
|
+
export class ThreadsThreadIdStreamResource {
|
|
2457
|
+
transport;
|
|
2458
|
+
path;
|
|
2459
|
+
constructor(transport, path) {
|
|
2460
|
+
this.transport = transport;
|
|
2461
|
+
this.path = path;
|
|
2462
|
+
}
|
|
2463
|
+
/** GET /api/v1/threads/{thread_id}/stream. Caller owns and closes the unbuffered body. */
|
|
2464
|
+
get(options = {}) {
|
|
2465
|
+
return binaryRequest(this.transport, this.path, {
|
|
2466
|
+
...{ signal: options.signal },
|
|
2467
|
+
headers: Object.fromEntries(Object.entries({
|
|
2468
|
+
"Last-Event-ID": options.lastEventId,
|
|
2469
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
2470
|
+
})
|
|
2471
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2472
|
+
.map(([key, value]) => [key, String(value)])),
|
|
2473
|
+
accept: "text/event-stream",
|
|
2474
|
+
});
|
|
2475
|
+
}
|
|
2476
|
+
}
|
|
2477
|
+
export class ToolsetsResource {
|
|
2478
|
+
transport;
|
|
2479
|
+
path;
|
|
2480
|
+
constructor(transport, path) {
|
|
2481
|
+
this.transport = transport;
|
|
2482
|
+
this.path = path;
|
|
2483
|
+
}
|
|
2484
|
+
/** GET /api/v1/toolsets. Preserves response metadata; mutations are not replayed. */
|
|
2485
|
+
list(options = {}) {
|
|
2486
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2487
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2488
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2489
|
+
}
|
|
2490
|
+
}
|
|
2491
|
+
export class TraceBackendResource {
|
|
2492
|
+
transport;
|
|
2493
|
+
path;
|
|
2494
|
+
constructor(transport, path) {
|
|
2495
|
+
this.transport = transport;
|
|
2496
|
+
this.path = path;
|
|
2497
|
+
}
|
|
2498
|
+
/** GET /api/v1/trace-backend. Preserves response metadata; mutations are not replayed. */
|
|
2499
|
+
get(options = {}) {
|
|
2500
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2501
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2502
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
export class TracesResource {
|
|
2506
|
+
transport;
|
|
2507
|
+
path;
|
|
2508
|
+
constructor(transport, path) {
|
|
2509
|
+
this.transport = transport;
|
|
2510
|
+
this.path = path;
|
|
2511
|
+
}
|
|
2512
|
+
/** GET /api/v1/traces. Preserves response metadata; mutations are not replayed. */
|
|
2513
|
+
list(options = {}) {
|
|
2514
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2515
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2516
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
2517
|
+
}
|
|
2518
|
+
pages(options = {}) {
|
|
2519
|
+
const query = snapshot(options.query ?? {});
|
|
2520
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
2521
|
+
}
|
|
2522
|
+
items(options = {}) {
|
|
2523
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
2524
|
+
}
|
|
2525
|
+
ref(value) {
|
|
2526
|
+
return new TracesTraceIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
2527
|
+
}
|
|
2528
|
+
}
|
|
2529
|
+
export class TracesTraceIdResource {
|
|
2530
|
+
transport;
|
|
2531
|
+
path;
|
|
2532
|
+
constructor(transport, path) {
|
|
2533
|
+
this.transport = transport;
|
|
2534
|
+
this.path = path;
|
|
2535
|
+
}
|
|
2536
|
+
/** GET /api/v1/traces/{trace_id}. Preserves response metadata; mutations are not replayed. */
|
|
2537
|
+
get(options = {}) {
|
|
2538
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2539
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2540
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2541
|
+
}
|
|
2542
|
+
get spans() {
|
|
2543
|
+
return new TracesTraceIdSpansResource(this.transport, this.path + "/spans");
|
|
2544
|
+
}
|
|
2545
|
+
}
|
|
2546
|
+
export class TracesTraceIdSpansResource {
|
|
2547
|
+
transport;
|
|
2548
|
+
path;
|
|
2549
|
+
constructor(transport, path) {
|
|
2550
|
+
this.transport = transport;
|
|
2551
|
+
this.path = path;
|
|
2552
|
+
}
|
|
2553
|
+
/** GET /api/v1/traces/{trace_id}/spans. Preserves response metadata; mutations are not replayed. */
|
|
2554
|
+
list(options = {}) {
|
|
2555
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2556
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2557
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
2558
|
+
}
|
|
2559
|
+
pages(options = {}) {
|
|
2560
|
+
const query = snapshot(options.query ?? {});
|
|
2561
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
2562
|
+
}
|
|
2563
|
+
items(options = {}) {
|
|
2564
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
2565
|
+
}
|
|
2566
|
+
}
|
|
2567
|
+
export class UploadsResource {
|
|
2568
|
+
transport;
|
|
2569
|
+
path;
|
|
2570
|
+
constructor(transport, path) {
|
|
2571
|
+
this.transport = transport;
|
|
2572
|
+
this.path = path;
|
|
2573
|
+
}
|
|
2574
|
+
/** POST /api/v1/uploads. Preserves response metadata; mutations are not replayed. */
|
|
2575
|
+
create(body, options) {
|
|
2576
|
+
return uploadRequest(this.transport, "POST", this.path, multipartBody(body), undefined, Object.fromEntries(Object.entries({
|
|
2577
|
+
"Idempotency-Key": options.idempotencyKey,
|
|
2578
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
2579
|
+
})
|
|
2580
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2581
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2582
|
+
}
|
|
2583
|
+
}
|
|
2584
|
+
export class UsageResource {
|
|
2585
|
+
transport;
|
|
2586
|
+
path;
|
|
2587
|
+
constructor(transport, path) {
|
|
2588
|
+
this.transport = transport;
|
|
2589
|
+
this.path = path;
|
|
2590
|
+
}
|
|
2591
|
+
/** GET /api/v1/usage. Preserves response metadata; mutations are not replayed. */
|
|
2592
|
+
get(options = {}) {
|
|
2593
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2594
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2595
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
2596
|
+
}
|
|
2597
|
+
get agents() {
|
|
2598
|
+
return new UsageAgentsResource(this.transport, this.path + "/agents");
|
|
2599
|
+
}
|
|
2600
|
+
get models() {
|
|
2601
|
+
return new UsageModelsResource(this.transport, this.path + "/models");
|
|
2602
|
+
}
|
|
2603
|
+
get overview() {
|
|
2604
|
+
return new UsageOverviewResource(this.transport, this.path + "/overview");
|
|
2605
|
+
}
|
|
2606
|
+
}
|
|
2607
|
+
export class UsageAgentsResource {
|
|
2608
|
+
transport;
|
|
2609
|
+
path;
|
|
2610
|
+
constructor(transport, path) {
|
|
2611
|
+
this.transport = transport;
|
|
2612
|
+
this.path = path;
|
|
2613
|
+
}
|
|
2614
|
+
/** GET /api/v1/usage/agents. Preserves response metadata; mutations are not replayed. */
|
|
2615
|
+
list(options) {
|
|
2616
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2617
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2618
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
2619
|
+
}
|
|
2620
|
+
pages(options) {
|
|
2621
|
+
const query = snapshot(options.query ?? {});
|
|
2622
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
2623
|
+
}
|
|
2624
|
+
items(options) {
|
|
2625
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
2626
|
+
}
|
|
2627
|
+
}
|
|
2628
|
+
export class UsageModelsResource {
|
|
2629
|
+
transport;
|
|
2630
|
+
path;
|
|
2631
|
+
constructor(transport, path) {
|
|
2632
|
+
this.transport = transport;
|
|
2633
|
+
this.path = path;
|
|
2634
|
+
}
|
|
2635
|
+
/** GET /api/v1/usage/models. Preserves response metadata; mutations are not replayed. */
|
|
2636
|
+
list(options) {
|
|
2637
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2638
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2639
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
2640
|
+
}
|
|
2641
|
+
pages(options) {
|
|
2642
|
+
const query = snapshot(options.query ?? {});
|
|
2643
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
2644
|
+
}
|
|
2645
|
+
items(options) {
|
|
2646
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
2647
|
+
}
|
|
2648
|
+
}
|
|
2649
|
+
export class UsageOverviewResource {
|
|
2650
|
+
transport;
|
|
2651
|
+
path;
|
|
2652
|
+
constructor(transport, path) {
|
|
2653
|
+
this.transport = transport;
|
|
2654
|
+
this.path = path;
|
|
2655
|
+
}
|
|
2656
|
+
/** GET /api/v1/usage/overview. Preserves response metadata; mutations are not replayed. */
|
|
2657
|
+
get(options) {
|
|
2658
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2659
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2660
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
2661
|
+
}
|
|
2662
|
+
}
|
|
2663
|
+
export class UsersResource {
|
|
2664
|
+
transport;
|
|
2665
|
+
path;
|
|
2666
|
+
constructor(transport, path) {
|
|
2667
|
+
this.transport = transport;
|
|
2668
|
+
this.path = path;
|
|
2669
|
+
}
|
|
2670
|
+
get me() {
|
|
2671
|
+
return new UsersMeResource(this.transport, this.path + "/me");
|
|
2672
|
+
}
|
|
2673
|
+
ref(value) {
|
|
2674
|
+
return new UsersUserIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
export class UsersMeResource {
|
|
2678
|
+
transport;
|
|
2679
|
+
path;
|
|
2680
|
+
constructor(transport, path) {
|
|
2681
|
+
this.transport = transport;
|
|
2682
|
+
this.path = path;
|
|
2683
|
+
}
|
|
2684
|
+
/** GET /api/v1/users/me. Preserves response metadata; mutations are not replayed. */
|
|
2685
|
+
get(options = {}) {
|
|
2686
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
2687
|
+
signal: options.signal,
|
|
2688
|
+
});
|
|
2689
|
+
}
|
|
2690
|
+
/** PATCH /api/v1/users/me. Preserves response metadata; mutations are not replayed. */
|
|
2691
|
+
update(body, options) {
|
|
2692
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, Object.fromEntries(Object.entries({ "If-Match": options.ifMatch })
|
|
2693
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2694
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2695
|
+
}
|
|
2696
|
+
get auditEvents() {
|
|
2697
|
+
return new UsersMeAuditEventsResource(this.transport, this.path + "/audit-events");
|
|
2698
|
+
}
|
|
2699
|
+
get avatar() {
|
|
2700
|
+
return new UsersMeAvatarResource(this.transport, this.path + "/avatar");
|
|
2701
|
+
}
|
|
2702
|
+
/** POST /api/v1/users/me/disable. Preserves response metadata; mutations are not replayed. */
|
|
2703
|
+
disable(body, options = {}) {
|
|
2704
|
+
return jsonRequest(this.transport, "POST", this.path + "/disable", body, undefined, { signal: options.signal });
|
|
2705
|
+
}
|
|
2706
|
+
get keys() {
|
|
2707
|
+
return new UsersMeKeysResource(this.transport, this.path + "/keys");
|
|
2708
|
+
}
|
|
2709
|
+
get loginSessions() {
|
|
2710
|
+
return new UsersMeLoginSessionsResource(this.transport, this.path + "/login-sessions");
|
|
2711
|
+
}
|
|
2712
|
+
/** POST /api/v1/users/me/password. Preserves response metadata; mutations are not replayed. */
|
|
2713
|
+
password(body, options = {}) {
|
|
2714
|
+
return jsonRequest(this.transport, "POST", this.path + "/password", body, undefined, { signal: options.signal });
|
|
2715
|
+
}
|
|
2716
|
+
}
|
|
2717
|
+
export class UsersMeAuditEventsResource {
|
|
2718
|
+
transport;
|
|
2719
|
+
path;
|
|
2720
|
+
constructor(transport, path) {
|
|
2721
|
+
this.transport = transport;
|
|
2722
|
+
this.path = path;
|
|
2723
|
+
}
|
|
2724
|
+
/** GET /api/v1/users/me/audit-events. Preserves response metadata; mutations are not replayed. */
|
|
2725
|
+
list(options = {}) {
|
|
2726
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
2727
|
+
signal: options.signal,
|
|
2728
|
+
query: options.query,
|
|
2729
|
+
});
|
|
2730
|
+
}
|
|
2731
|
+
pages(options = {}) {
|
|
2732
|
+
const query = snapshot(options.query ?? {});
|
|
2733
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
2734
|
+
}
|
|
2735
|
+
items(options = {}) {
|
|
2736
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
2737
|
+
}
|
|
2738
|
+
}
|
|
2739
|
+
export class UsersMeAvatarResource {
|
|
2740
|
+
transport;
|
|
2741
|
+
path;
|
|
2742
|
+
constructor(transport, path) {
|
|
2743
|
+
this.transport = transport;
|
|
2744
|
+
this.path = path;
|
|
2745
|
+
}
|
|
2746
|
+
/** DELETE /api/v1/users/me/avatar. Preserves response metadata; mutations are not replayed. */
|
|
2747
|
+
delete(options) {
|
|
2748
|
+
return jsonRequest(this.transport, "DELETE", this.path, undefined, Object.fromEntries(Object.entries({ "If-Match": options.ifMatch })
|
|
2749
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2750
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2751
|
+
}
|
|
2752
|
+
/** PUT /api/v1/users/me/avatar. Preserves response metadata; mutations are not replayed. */
|
|
2753
|
+
replace(body, options) {
|
|
2754
|
+
return uploadRequest(this.transport, "PUT", this.path, body, options.contentType, Object.fromEntries(Object.entries({ "If-Match": options.ifMatch })
|
|
2755
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2756
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2757
|
+
}
|
|
2758
|
+
}
|
|
2759
|
+
export class UsersMeKeysResource {
|
|
2760
|
+
transport;
|
|
2761
|
+
path;
|
|
2762
|
+
constructor(transport, path) {
|
|
2763
|
+
this.transport = transport;
|
|
2764
|
+
this.path = path;
|
|
2765
|
+
}
|
|
2766
|
+
/** GET /api/v1/users/me/keys. Preserves response metadata; mutations are not replayed. */
|
|
2767
|
+
list(options = {}) {
|
|
2768
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
2769
|
+
signal: options.signal,
|
|
2770
|
+
query: options.query,
|
|
2771
|
+
});
|
|
2772
|
+
}
|
|
2773
|
+
pages(options = {}) {
|
|
2774
|
+
const query = snapshot(options.query ?? {});
|
|
2775
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
2776
|
+
}
|
|
2777
|
+
items(options = {}) {
|
|
2778
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
2779
|
+
}
|
|
2780
|
+
/** POST /api/v1/users/me/keys. Preserves response metadata; mutations are not replayed. */
|
|
2781
|
+
create(body, options = {}) {
|
|
2782
|
+
return jsonRequest(this.transport, "POST", this.path, body, undefined, {
|
|
2783
|
+
signal: options.signal,
|
|
2784
|
+
});
|
|
2785
|
+
}
|
|
2786
|
+
ref(value) {
|
|
2787
|
+
return new UsersMeKeysKeyIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
2788
|
+
}
|
|
2789
|
+
}
|
|
2790
|
+
export class UsersMeKeysKeyIdResource {
|
|
2791
|
+
transport;
|
|
2792
|
+
path;
|
|
2793
|
+
constructor(transport, path) {
|
|
2794
|
+
this.transport = transport;
|
|
2795
|
+
this.path = path;
|
|
2796
|
+
}
|
|
2797
|
+
/** DELETE /api/v1/users/me/keys/{key_id}. Preserves response metadata; mutations are not replayed. */
|
|
2798
|
+
delete(options) {
|
|
2799
|
+
return jsonRequest(this.transport, "DELETE", this.path, undefined, Object.fromEntries(Object.entries({ "If-Match": options.ifMatch })
|
|
2800
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2801
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2802
|
+
}
|
|
2803
|
+
}
|
|
2804
|
+
export class UsersMeLoginSessionsResource {
|
|
2805
|
+
transport;
|
|
2806
|
+
path;
|
|
2807
|
+
constructor(transport, path) {
|
|
2808
|
+
this.transport = transport;
|
|
2809
|
+
this.path = path;
|
|
2810
|
+
}
|
|
2811
|
+
/** GET /api/v1/users/me/login-sessions. Preserves response metadata; mutations are not replayed. */
|
|
2812
|
+
list(options = {}) {
|
|
2813
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
2814
|
+
signal: options.signal,
|
|
2815
|
+
query: options.query,
|
|
2816
|
+
});
|
|
2817
|
+
}
|
|
2818
|
+
pages(options = {}) {
|
|
2819
|
+
const query = snapshot(options.query ?? {});
|
|
2820
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
2821
|
+
}
|
|
2822
|
+
items(options = {}) {
|
|
2823
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
2824
|
+
}
|
|
2825
|
+
ref(value) {
|
|
2826
|
+
return new UsersMeLoginSessionsSessionIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
2827
|
+
}
|
|
2828
|
+
}
|
|
2829
|
+
export class UsersMeLoginSessionsSessionIdResource {
|
|
2830
|
+
transport;
|
|
2831
|
+
path;
|
|
2832
|
+
constructor(transport, path) {
|
|
2833
|
+
this.transport = transport;
|
|
2834
|
+
this.path = path;
|
|
2835
|
+
}
|
|
2836
|
+
/** DELETE /api/v1/users/me/login-sessions/{session_id}. Preserves response metadata; mutations are not replayed. */
|
|
2837
|
+
delete(options = {}) {
|
|
2838
|
+
return jsonRequest(this.transport, "DELETE", this.path, undefined, undefined, { signal: options.signal });
|
|
2839
|
+
}
|
|
2840
|
+
}
|
|
2841
|
+
export class UsersUserIdResource {
|
|
2842
|
+
transport;
|
|
2843
|
+
path;
|
|
2844
|
+
constructor(transport, path) {
|
|
2845
|
+
this.transport = transport;
|
|
2846
|
+
this.path = path;
|
|
2847
|
+
}
|
|
2848
|
+
get avatar() {
|
|
2849
|
+
return new UsersUserIdAvatarResource(this.transport, this.path + "/avatar");
|
|
2850
|
+
}
|
|
2851
|
+
}
|
|
2852
|
+
export class UsersUserIdAvatarResource {
|
|
2853
|
+
transport;
|
|
2854
|
+
path;
|
|
2855
|
+
constructor(transport, path) {
|
|
2856
|
+
this.transport = transport;
|
|
2857
|
+
this.path = path;
|
|
2858
|
+
}
|
|
2859
|
+
/** GET /api/v1/users/{user_id}/avatar. Caller owns and closes the unbuffered body. */
|
|
2860
|
+
get(options = {}) {
|
|
2861
|
+
return binaryRequest(this.transport, this.path, {
|
|
2862
|
+
...{ signal: options.signal },
|
|
2863
|
+
headers: undefined,
|
|
2864
|
+
accept: "image/jpeg, image/png, image/webp",
|
|
2865
|
+
});
|
|
2866
|
+
}
|
|
2867
|
+
}
|
|
2868
|
+
export class WebProvidersResource {
|
|
2869
|
+
transport;
|
|
2870
|
+
path;
|
|
2871
|
+
constructor(transport, path) {
|
|
2872
|
+
this.transport = transport;
|
|
2873
|
+
this.path = path;
|
|
2874
|
+
}
|
|
2875
|
+
/** GET /api/v1/web-providers. Preserves response metadata; mutations are not replayed. */
|
|
2876
|
+
list(options = {}) {
|
|
2877
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2878
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2879
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal, query: options.query });
|
|
2880
|
+
}
|
|
2881
|
+
pages(options = {}) {
|
|
2882
|
+
const query = snapshot(options.query ?? {});
|
|
2883
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
2884
|
+
}
|
|
2885
|
+
items(options = {}) {
|
|
2886
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
2887
|
+
}
|
|
2888
|
+
/** POST /api/v1/web-providers. Preserves response metadata; mutations are not replayed. */
|
|
2889
|
+
create(body, options = {}) {
|
|
2890
|
+
return jsonRequest(this.transport, "POST", this.path, body, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2891
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2892
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2893
|
+
}
|
|
2894
|
+
ref(value) {
|
|
2895
|
+
return new WebProvidersProviderIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
2896
|
+
}
|
|
2897
|
+
}
|
|
2898
|
+
export class WebProvidersProviderIdResource {
|
|
2899
|
+
transport;
|
|
2900
|
+
path;
|
|
2901
|
+
constructor(transport, path) {
|
|
2902
|
+
this.transport = transport;
|
|
2903
|
+
this.path = path;
|
|
2904
|
+
}
|
|
2905
|
+
/** GET /api/v1/web-providers/{provider_id}. Preserves response metadata; mutations are not replayed. */
|
|
2906
|
+
get(options = {}) {
|
|
2907
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2908
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2909
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2910
|
+
}
|
|
2911
|
+
/** PATCH /api/v1/web-providers/{provider_id}. Preserves response metadata; mutations are not replayed. */
|
|
2912
|
+
update(body, options) {
|
|
2913
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, Object.fromEntries(Object.entries({
|
|
2914
|
+
"If-Match": options.ifMatch,
|
|
2915
|
+
"X-Workspace-ID": options.xWorkspaceId,
|
|
2916
|
+
})
|
|
2917
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2918
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2919
|
+
}
|
|
2920
|
+
/** POST /api/v1/web-providers/{provider_id}/test. Preserves response metadata; mutations are not replayed. */
|
|
2921
|
+
test(options = {}) {
|
|
2922
|
+
return jsonRequest(this.transport, "POST", this.path + "/test", undefined, Object.fromEntries(Object.entries({ "X-Workspace-ID": options.xWorkspaceId })
|
|
2923
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2924
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2925
|
+
}
|
|
2926
|
+
}
|
|
2927
|
+
export class WorkspacesResource {
|
|
2928
|
+
transport;
|
|
2929
|
+
path;
|
|
2930
|
+
constructor(transport, path) {
|
|
2931
|
+
this.transport = transport;
|
|
2932
|
+
this.path = path;
|
|
2933
|
+
}
|
|
2934
|
+
/** GET /api/v1/workspaces. Preserves response metadata; mutations are not replayed. */
|
|
2935
|
+
list(options = {}) {
|
|
2936
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
2937
|
+
signal: options.signal,
|
|
2938
|
+
query: options.query,
|
|
2939
|
+
});
|
|
2940
|
+
}
|
|
2941
|
+
pages(options = {}) {
|
|
2942
|
+
const query = snapshot(options.query ?? {});
|
|
2943
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
2944
|
+
}
|
|
2945
|
+
items(options = {}) {
|
|
2946
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
2947
|
+
}
|
|
2948
|
+
ref(value) {
|
|
2949
|
+
return new WorkspacesWorkspaceIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
2950
|
+
}
|
|
2951
|
+
}
|
|
2952
|
+
export class WorkspacesWorkspaceIdResource {
|
|
2953
|
+
transport;
|
|
2954
|
+
path;
|
|
2955
|
+
constructor(transport, path) {
|
|
2956
|
+
this.transport = transport;
|
|
2957
|
+
this.path = path;
|
|
2958
|
+
}
|
|
2959
|
+
/** GET /api/v1/workspaces/{workspace_id}. Preserves response metadata; mutations are not replayed. */
|
|
2960
|
+
get(options = {}) {
|
|
2961
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
2962
|
+
signal: options.signal,
|
|
2963
|
+
});
|
|
2964
|
+
}
|
|
2965
|
+
/** PATCH /api/v1/workspaces/{workspace_id}. Preserves response metadata; mutations are not replayed. */
|
|
2966
|
+
update(body, options) {
|
|
2967
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, Object.fromEntries(Object.entries({ "If-Match": options.ifMatch })
|
|
2968
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2969
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2970
|
+
}
|
|
2971
|
+
/** POST /api/v1/workspaces/{workspace_id}/archive. Preserves response metadata; mutations are not replayed. */
|
|
2972
|
+
archive(options) {
|
|
2973
|
+
return jsonRequest(this.transport, "POST", this.path + "/archive", undefined, Object.fromEntries(Object.entries({ "If-Match": options.ifMatch })
|
|
2974
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
2975
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
2976
|
+
}
|
|
2977
|
+
get auditEvents() {
|
|
2978
|
+
return new WorkspacesWorkspaceIdAuditEventsResource(this.transport, this.path + "/audit-events");
|
|
2979
|
+
}
|
|
2980
|
+
get grants() {
|
|
2981
|
+
return new WorkspacesWorkspaceIdGrantsResource(this.transport, this.path + "/grants");
|
|
2982
|
+
}
|
|
2983
|
+
get icon() {
|
|
2984
|
+
return new WorkspacesWorkspaceIdIconResource(this.transport, this.path + "/icon");
|
|
2985
|
+
}
|
|
2986
|
+
get invitations() {
|
|
2987
|
+
return new WorkspacesWorkspaceIdInvitationsResource(this.transport, this.path + "/invitations");
|
|
2988
|
+
}
|
|
2989
|
+
get keys() {
|
|
2990
|
+
return new WorkspacesWorkspaceIdKeysResource(this.transport, this.path + "/keys");
|
|
2991
|
+
}
|
|
2992
|
+
get serviceAccounts() {
|
|
2993
|
+
return new WorkspacesWorkspaceIdServiceAccountsResource(this.transport, this.path + "/service-accounts");
|
|
2994
|
+
}
|
|
2995
|
+
}
|
|
2996
|
+
export class WorkspacesWorkspaceIdAuditEventsResource {
|
|
2997
|
+
transport;
|
|
2998
|
+
path;
|
|
2999
|
+
constructor(transport, path) {
|
|
3000
|
+
this.transport = transport;
|
|
3001
|
+
this.path = path;
|
|
3002
|
+
}
|
|
3003
|
+
/** GET /api/v1/workspaces/{workspace_id}/audit-events. Preserves response metadata; mutations are not replayed. */
|
|
3004
|
+
list(options = {}) {
|
|
3005
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
3006
|
+
signal: options.signal,
|
|
3007
|
+
query: options.query,
|
|
3008
|
+
});
|
|
3009
|
+
}
|
|
3010
|
+
pages(options = {}) {
|
|
3011
|
+
const query = snapshot(options.query ?? {});
|
|
3012
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
3013
|
+
}
|
|
3014
|
+
items(options = {}) {
|
|
3015
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
3016
|
+
}
|
|
3017
|
+
}
|
|
3018
|
+
export class WorkspacesWorkspaceIdGrantsResource {
|
|
3019
|
+
transport;
|
|
3020
|
+
path;
|
|
3021
|
+
constructor(transport, path) {
|
|
3022
|
+
this.transport = transport;
|
|
3023
|
+
this.path = path;
|
|
3024
|
+
}
|
|
3025
|
+
/** GET /api/v1/workspaces/{workspace_id}/grants. Preserves response metadata; mutations are not replayed. */
|
|
3026
|
+
list(options = {}) {
|
|
3027
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
3028
|
+
signal: options.signal,
|
|
3029
|
+
query: options.query,
|
|
3030
|
+
});
|
|
3031
|
+
}
|
|
3032
|
+
pages(options = {}) {
|
|
3033
|
+
const query = snapshot(options.query ?? {});
|
|
3034
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
3035
|
+
}
|
|
3036
|
+
items(options = {}) {
|
|
3037
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
3038
|
+
}
|
|
3039
|
+
/** POST /api/v1/workspaces/{workspace_id}/grants. Preserves response metadata; mutations are not replayed. */
|
|
3040
|
+
create(body, options = {}) {
|
|
3041
|
+
return jsonRequest(this.transport, "POST", this.path, body, undefined, {
|
|
3042
|
+
signal: options.signal,
|
|
3043
|
+
});
|
|
3044
|
+
}
|
|
3045
|
+
ref(value) {
|
|
3046
|
+
return new WorkspacesWorkspaceIdGrantsGrantIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
3047
|
+
}
|
|
3048
|
+
}
|
|
3049
|
+
export class WorkspacesWorkspaceIdGrantsGrantIdResource {
|
|
3050
|
+
transport;
|
|
3051
|
+
path;
|
|
3052
|
+
constructor(transport, path) {
|
|
3053
|
+
this.transport = transport;
|
|
3054
|
+
this.path = path;
|
|
3055
|
+
}
|
|
3056
|
+
/** DELETE /api/v1/workspaces/{workspace_id}/grants/{grant_id}. Preserves response metadata; mutations are not replayed. */
|
|
3057
|
+
delete(options = {}) {
|
|
3058
|
+
return jsonRequest(this.transport, "DELETE", this.path, undefined, undefined, { signal: options.signal });
|
|
3059
|
+
}
|
|
3060
|
+
/** PATCH /api/v1/workspaces/{workspace_id}/grants/{grant_id}. Preserves response metadata; mutations are not replayed. */
|
|
3061
|
+
update(body, options = {}) {
|
|
3062
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, undefined, {
|
|
3063
|
+
signal: options.signal,
|
|
3064
|
+
});
|
|
3065
|
+
}
|
|
3066
|
+
}
|
|
3067
|
+
export class WorkspacesWorkspaceIdIconResource {
|
|
3068
|
+
transport;
|
|
3069
|
+
path;
|
|
3070
|
+
constructor(transport, path) {
|
|
3071
|
+
this.transport = transport;
|
|
3072
|
+
this.path = path;
|
|
3073
|
+
}
|
|
3074
|
+
/** DELETE /api/v1/workspaces/{workspace_id}/icon. Preserves response metadata; mutations are not replayed. */
|
|
3075
|
+
delete(options) {
|
|
3076
|
+
return jsonRequest(this.transport, "DELETE", this.path, undefined, Object.fromEntries(Object.entries({ "If-Match": options.ifMatch })
|
|
3077
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
3078
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
3079
|
+
}
|
|
3080
|
+
/** GET /api/v1/workspaces/{workspace_id}/icon. Caller owns and closes the unbuffered body. */
|
|
3081
|
+
get(options = {}) {
|
|
3082
|
+
return binaryRequest(this.transport, this.path, {
|
|
3083
|
+
...{ signal: options.signal },
|
|
3084
|
+
headers: undefined,
|
|
3085
|
+
accept: "image/jpeg, image/png, image/webp",
|
|
3086
|
+
});
|
|
3087
|
+
}
|
|
3088
|
+
/** PUT /api/v1/workspaces/{workspace_id}/icon. Preserves response metadata; mutations are not replayed. */
|
|
3089
|
+
replace(body, options) {
|
|
3090
|
+
return uploadRequest(this.transport, "PUT", this.path, body, options.contentType, Object.fromEntries(Object.entries({ "If-Match": options.ifMatch })
|
|
3091
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
3092
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
3093
|
+
}
|
|
3094
|
+
}
|
|
3095
|
+
export class WorkspacesWorkspaceIdInvitationsResource {
|
|
3096
|
+
transport;
|
|
3097
|
+
path;
|
|
3098
|
+
constructor(transport, path) {
|
|
3099
|
+
this.transport = transport;
|
|
3100
|
+
this.path = path;
|
|
3101
|
+
}
|
|
3102
|
+
/** GET /api/v1/workspaces/{workspace_id}/invitations. Preserves response metadata; mutations are not replayed. */
|
|
3103
|
+
list(options = {}) {
|
|
3104
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
3105
|
+
signal: options.signal,
|
|
3106
|
+
query: options.query,
|
|
3107
|
+
});
|
|
3108
|
+
}
|
|
3109
|
+
pages(options = {}) {
|
|
3110
|
+
const query = snapshot(options.query ?? {});
|
|
3111
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
3112
|
+
}
|
|
3113
|
+
items(options = {}) {
|
|
3114
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
3115
|
+
}
|
|
3116
|
+
/** POST /api/v1/workspaces/{workspace_id}/invitations. Preserves response metadata; mutations are not replayed. */
|
|
3117
|
+
create(body, options = {}) {
|
|
3118
|
+
return jsonRequest(this.transport, "POST", this.path, body, undefined, {
|
|
3119
|
+
signal: options.signal,
|
|
3120
|
+
});
|
|
3121
|
+
}
|
|
3122
|
+
ref(value) {
|
|
3123
|
+
return new WorkspacesWorkspaceIdInvitationsInvitationIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
3124
|
+
}
|
|
3125
|
+
}
|
|
3126
|
+
export class WorkspacesWorkspaceIdInvitationsInvitationIdResource {
|
|
3127
|
+
transport;
|
|
3128
|
+
path;
|
|
3129
|
+
constructor(transport, path) {
|
|
3130
|
+
this.transport = transport;
|
|
3131
|
+
this.path = path;
|
|
3132
|
+
}
|
|
3133
|
+
/** POST /api/v1/workspaces/{workspace_id}/invitations/{invitation_id}/resend. Preserves response metadata; mutations are not replayed. */
|
|
3134
|
+
resend(options) {
|
|
3135
|
+
return jsonRequest(this.transport, "POST", this.path + "/resend", undefined, Object.fromEntries(Object.entries({ "If-Match": options.ifMatch })
|
|
3136
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
3137
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
3138
|
+
}
|
|
3139
|
+
/** POST /api/v1/workspaces/{workspace_id}/invitations/{invitation_id}/revoke. Preserves response metadata; mutations are not replayed. */
|
|
3140
|
+
revoke(options) {
|
|
3141
|
+
return jsonRequest(this.transport, "POST", this.path + "/revoke", undefined, Object.fromEntries(Object.entries({ "If-Match": options.ifMatch })
|
|
3142
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
3143
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
3144
|
+
}
|
|
3145
|
+
}
|
|
3146
|
+
export class WorkspacesWorkspaceIdKeysResource {
|
|
3147
|
+
transport;
|
|
3148
|
+
path;
|
|
3149
|
+
constructor(transport, path) {
|
|
3150
|
+
this.transport = transport;
|
|
3151
|
+
this.path = path;
|
|
3152
|
+
}
|
|
3153
|
+
/** GET /api/v1/workspaces/{workspace_id}/keys. Preserves response metadata; mutations are not replayed. */
|
|
3154
|
+
list(options = {}) {
|
|
3155
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
3156
|
+
signal: options.signal,
|
|
3157
|
+
query: options.query,
|
|
3158
|
+
});
|
|
3159
|
+
}
|
|
3160
|
+
pages(options = {}) {
|
|
3161
|
+
const query = snapshot(options.query ?? {});
|
|
3162
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
3163
|
+
}
|
|
3164
|
+
items(options = {}) {
|
|
3165
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
3166
|
+
}
|
|
3167
|
+
ref(value) {
|
|
3168
|
+
return new WorkspacesWorkspaceIdKeysKeyIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
3169
|
+
}
|
|
3170
|
+
}
|
|
3171
|
+
export class WorkspacesWorkspaceIdKeysKeyIdResource {
|
|
3172
|
+
transport;
|
|
3173
|
+
path;
|
|
3174
|
+
constructor(transport, path) {
|
|
3175
|
+
this.transport = transport;
|
|
3176
|
+
this.path = path;
|
|
3177
|
+
}
|
|
3178
|
+
/** DELETE /api/v1/workspaces/{workspace_id}/keys/{key_id}. Preserves response metadata; mutations are not replayed. */
|
|
3179
|
+
delete(options) {
|
|
3180
|
+
return jsonRequest(this.transport, "DELETE", this.path, undefined, Object.fromEntries(Object.entries({ "If-Match": options.ifMatch })
|
|
3181
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
3182
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
3183
|
+
}
|
|
3184
|
+
}
|
|
3185
|
+
export class WorkspacesWorkspaceIdServiceAccountsResource {
|
|
3186
|
+
transport;
|
|
3187
|
+
path;
|
|
3188
|
+
constructor(transport, path) {
|
|
3189
|
+
this.transport = transport;
|
|
3190
|
+
this.path = path;
|
|
3191
|
+
}
|
|
3192
|
+
/** GET /api/v1/workspaces/{workspace_id}/service-accounts. Preserves response metadata; mutations are not replayed. */
|
|
3193
|
+
list(options = {}) {
|
|
3194
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
3195
|
+
signal: options.signal,
|
|
3196
|
+
query: options.query,
|
|
3197
|
+
});
|
|
3198
|
+
}
|
|
3199
|
+
pages(options = {}) {
|
|
3200
|
+
const query = snapshot(options.query ?? {});
|
|
3201
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
3202
|
+
}
|
|
3203
|
+
items(options = {}) {
|
|
3204
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
3205
|
+
}
|
|
3206
|
+
/** POST /api/v1/workspaces/{workspace_id}/service-accounts. Preserves response metadata; mutations are not replayed. */
|
|
3207
|
+
create(body, options = {}) {
|
|
3208
|
+
return jsonRequest(this.transport, "POST", this.path, body, undefined, {
|
|
3209
|
+
signal: options.signal,
|
|
3210
|
+
});
|
|
3211
|
+
}
|
|
3212
|
+
ref(value) {
|
|
3213
|
+
return new WorkspacesWorkspaceIdServiceAccountsAccountIdResource(this.transport, this.path + "/" + encodeURIComponent(selector(String(value))));
|
|
3214
|
+
}
|
|
3215
|
+
}
|
|
3216
|
+
export class WorkspacesWorkspaceIdServiceAccountsAccountIdResource {
|
|
3217
|
+
transport;
|
|
3218
|
+
path;
|
|
3219
|
+
constructor(transport, path) {
|
|
3220
|
+
this.transport = transport;
|
|
3221
|
+
this.path = path;
|
|
3222
|
+
}
|
|
3223
|
+
/** DELETE /api/v1/workspaces/{workspace_id}/service-accounts/{account_id}. Preserves response metadata; mutations are not replayed. */
|
|
3224
|
+
delete(options) {
|
|
3225
|
+
return jsonRequest(this.transport, "DELETE", this.path, undefined, Object.fromEntries(Object.entries({ "If-Match": options.ifMatch })
|
|
3226
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
3227
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
3228
|
+
}
|
|
3229
|
+
/** GET /api/v1/workspaces/{workspace_id}/service-accounts/{account_id}. Preserves response metadata; mutations are not replayed. */
|
|
3230
|
+
get(options = {}) {
|
|
3231
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
3232
|
+
signal: options.signal,
|
|
3233
|
+
});
|
|
3234
|
+
}
|
|
3235
|
+
/** PATCH /api/v1/workspaces/{workspace_id}/service-accounts/{account_id}. Preserves response metadata; mutations are not replayed. */
|
|
3236
|
+
update(body, options) {
|
|
3237
|
+
return jsonRequest(this.transport, "PATCH", this.path, body, Object.fromEntries(Object.entries({ "If-Match": options.ifMatch })
|
|
3238
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
3239
|
+
.map(([key, value]) => [key, String(value)])), { signal: options.signal });
|
|
3240
|
+
}
|
|
3241
|
+
get keys() {
|
|
3242
|
+
return new WorkspacesWorkspaceIdServiceAccountsAccountIdKeysResource(this.transport, this.path + "/keys");
|
|
3243
|
+
}
|
|
3244
|
+
}
|
|
3245
|
+
export class WorkspacesWorkspaceIdServiceAccountsAccountIdKeysResource {
|
|
3246
|
+
transport;
|
|
3247
|
+
path;
|
|
3248
|
+
constructor(transport, path) {
|
|
3249
|
+
this.transport = transport;
|
|
3250
|
+
this.path = path;
|
|
3251
|
+
}
|
|
3252
|
+
/** GET /api/v1/workspaces/{workspace_id}/service-accounts/{account_id}/keys. Preserves response metadata; mutations are not replayed. */
|
|
3253
|
+
list(options = {}) {
|
|
3254
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
3255
|
+
signal: options.signal,
|
|
3256
|
+
query: options.query,
|
|
3257
|
+
});
|
|
3258
|
+
}
|
|
3259
|
+
pages(options = {}) {
|
|
3260
|
+
const query = snapshot(options.query ?? {});
|
|
3261
|
+
return new PageIterator(query.cursor, (cursor) => this.list({ ...options, query: withCursor(query, cursor) }), (value) => value);
|
|
3262
|
+
}
|
|
3263
|
+
items(options = {}) {
|
|
3264
|
+
return flattenPages(this.pages(options), (value) => value);
|
|
3265
|
+
}
|
|
3266
|
+
/** POST /api/v1/workspaces/{workspace_id}/service-accounts/{account_id}/keys. Preserves response metadata; mutations are not replayed. */
|
|
3267
|
+
create(body, options = {}) {
|
|
3268
|
+
return jsonRequest(this.transport, "POST", this.path, body, undefined, {
|
|
3269
|
+
signal: options.signal,
|
|
3270
|
+
});
|
|
3271
|
+
}
|
|
3272
|
+
}
|
|
3273
|
+
export class HealthzResource {
|
|
3274
|
+
transport;
|
|
3275
|
+
path;
|
|
3276
|
+
constructor(transport, path) {
|
|
3277
|
+
this.transport = transport;
|
|
3278
|
+
this.path = path;
|
|
3279
|
+
}
|
|
3280
|
+
/** GET /healthz. Preserves response metadata; mutations are not replayed. */
|
|
3281
|
+
get(options = {}) {
|
|
3282
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
3283
|
+
signal: options.signal,
|
|
3284
|
+
});
|
|
3285
|
+
}
|
|
3286
|
+
}
|
|
3287
|
+
export class ReadyzResource {
|
|
3288
|
+
transport;
|
|
3289
|
+
path;
|
|
3290
|
+
constructor(transport, path) {
|
|
3291
|
+
this.transport = transport;
|
|
3292
|
+
this.path = path;
|
|
3293
|
+
}
|
|
3294
|
+
/** GET /readyz. Preserves response metadata; mutations are not replayed. */
|
|
3295
|
+
get(options = {}) {
|
|
3296
|
+
return jsonRequest(this.transport, "GET", this.path, undefined, undefined, {
|
|
3297
|
+
signal: options.signal,
|
|
3298
|
+
});
|
|
3299
|
+
}
|
|
3300
|
+
}
|
|
3301
|
+
//# sourceMappingURL=generated.js.map
|