@kora-platform/cli 0.7.0-rc1 → 0.8.0-rc1

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.
Files changed (38) hide show
  1. package/README.md +21 -0
  2. package/dist/api-client.d.ts +250 -93
  3. package/dist/api-client.js +187 -163
  4. package/dist/api-types.d.ts +280 -162
  5. package/dist/artifact-api-client.d.ts +28 -1
  6. package/dist/artifact-api-client.js +33 -0
  7. package/dist/artifact-commands.d.ts +5 -0
  8. package/dist/artifact-commands.js +172 -1
  9. package/dist/audit-commands.d.ts +12 -0
  10. package/dist/audit-commands.js +74 -0
  11. package/dist/auth-commands.d.ts +1 -0
  12. package/dist/auth-commands.js +116 -29
  13. package/dist/command-builders.d.ts +1 -0
  14. package/dist/command-builders.js +1 -0
  15. package/dist/command-groups.js +10 -12
  16. package/dist/command-registry.js +548 -243
  17. package/dist/commands.js +652 -602
  18. package/dist/environment-context.d.ts +9 -0
  19. package/dist/environment-context.js +32 -0
  20. package/dist/{integration-commands.d.ts → extension-commands.d.ts} +3 -2
  21. package/dist/extension-commands.js +446 -0
  22. package/dist/files.d.ts +33 -0
  23. package/dist/files.js +247 -12
  24. package/dist/format.d.ts +5 -0
  25. package/dist/format.js +78 -1
  26. package/dist/runner.js +14 -5
  27. package/dist/schema-registry-data.d.ts +272 -569
  28. package/dist/schema-registry-data.js +307 -700
  29. package/dist/session.d.ts +1 -0
  30. package/dist/transport.d.ts +10 -0
  31. package/dist/transport.js +22 -0
  32. package/dist/types.d.ts +2 -1
  33. package/dist/workspace-source.d.ts +1 -0
  34. package/dist/workspace-source.js +13 -0
  35. package/package.json +2 -1
  36. package/dist/integration-api-client.d.ts +0 -29
  37. package/dist/integration-api-client.js +0 -50
  38. package/dist/integration-commands.js +0 -208
@@ -8,6 +8,7 @@ export function createPlatformApiClient(input) {
8
8
  getAuthSettings: transport.getAuthSettings,
9
9
  login: transport.login,
10
10
  refreshSession: transport.refreshSession,
11
+ signup: transport.signup,
11
12
  async getMe(session) {
12
13
  return transport.requestJson({
13
14
  path: "/api/v1/auth/me",
@@ -65,19 +66,11 @@ export function createPlatformApiClient(input) {
65
66
  session
66
67
  });
67
68
  },
68
- async importProject(session, orgId, inputData) {
69
+ async testWorkflowNode(session, orgId, workflowName, nodeId, inputData) {
69
70
  return transport.requestJson({
70
71
  body: inputData,
71
72
  method: "POST",
72
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/project/import`,
73
- session
74
- });
75
- },
76
- async getProjectWorkspace(session, orgId, releaseId) {
77
- return transport.requestJson({
78
- path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/project`, {
79
- releaseId
80
- }),
73
+ path: `/api/v1/orgs/${encodeURIComponent(orgId)}/tests/workflow-nodes/${encodeURIComponent(workflowName)}/${encodeURIComponent(nodeId)}`,
81
74
  session
82
75
  });
83
76
  },
@@ -88,236 +81,240 @@ export function createPlatformApiClient(input) {
88
81
  session
89
82
  });
90
83
  },
91
- async listRuntimeVariables(session, orgId) {
84
+ async listRuntimeVariables(session, orgId, inputData = {}) {
92
85
  return transport.requestJson({
93
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/runtime-variables`,
86
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/runtime-variables`, inputData),
94
87
  session
95
88
  });
96
89
  },
97
90
  async replaceRuntimeVariables(session, orgId, inputData) {
91
+ const { environment, ...body } = inputData;
98
92
  return transport.requestJson({
99
- body: inputData,
93
+ body,
100
94
  method: "PUT",
101
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/runtime-variables`,
95
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/runtime-variables`, { environment }),
102
96
  session
103
97
  });
104
98
  },
105
99
  async importRuntimeVariables(session, orgId, inputData) {
100
+ const { environment, ...body } = inputData;
106
101
  return transport.requestJson({
107
- body: inputData,
102
+ body,
108
103
  method: "POST",
109
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/runtime-variables/import`,
104
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/runtime-variables/import`, { environment }),
110
105
  session
111
106
  });
112
107
  },
113
- async listOrgSecrets(session, orgId) {
108
+ async listOrgSecrets(session, orgId, inputData = {}) {
114
109
  return transport.requestJson({
115
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/secrets`,
110
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/secrets`, inputData),
116
111
  session
117
112
  });
118
113
  },
119
114
  async upsertOrgSecret(session, orgId, inputData) {
115
+ const { environment, ...body } = inputData;
120
116
  return transport.requestJson({
121
- body: inputData,
117
+ body,
122
118
  method: "PUT",
123
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/secrets`,
119
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/secrets`, { environment }),
124
120
  session
125
121
  });
126
122
  },
127
- async deleteOrgSecret(session, orgId, name) {
123
+ async deleteOrgSecret(session, orgId, name, inputData) {
128
124
  return transport.requestJson({
129
125
  method: "DELETE",
130
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/secrets/${encodeURIComponent(name)}`,
126
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/secrets/${encodeURIComponent(name)}`, inputData),
131
127
  session
132
128
  });
133
129
  },
134
- async listWorkflows(session, orgId, releaseId) {
130
+ async validateExtensionPackage(session, orgId, inputData) {
135
131
  return transport.requestJson({
136
- path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/processes`, {
137
- releaseId
138
- }),
139
- session
140
- });
141
- },
142
- async getWorkflow(session, orgId, name, releaseId) {
143
- return transport.requestJson({
144
- path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/processes/${encodeURIComponent(name)}`, { releaseId }),
145
- session
146
- });
147
- },
148
- async getWorkflowVersion(session, orgId, name, version, releaseId) {
149
- return transport.requestJson({
150
- path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/processes/${encodeURIComponent(name)}/versions/${String(version)}`, { releaseId }),
132
+ body: inputData,
133
+ method: "POST",
134
+ path: `/api/v1/orgs/${encodeURIComponent(orgId)}/extensions/packages/validate`,
151
135
  session
152
136
  });
153
137
  },
154
- async getWorkflowDependencies(session, orgId, name, version, releaseId) {
138
+ async validateExtensionPackageArchive(session, orgId, archive, inputData = {}) {
155
139
  return transport.requestJson({
156
- path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/processes/${encodeURIComponent(name)}/versions/${String(version)}/dependencies`, { releaseId }),
140
+ headers: { "content-type": "application/zip" },
141
+ method: "POST",
142
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/extensions/packages/validate.zip`, inputData),
143
+ rawBody: archive,
157
144
  session
158
145
  });
159
146
  },
160
- async getWorkflowContext(session, orgId, releaseId) {
147
+ async publishExtensionPackage(session, orgId, inputData) {
161
148
  return transport.requestJson({
162
- path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/workflows/context`, {
163
- releaseId
164
- }),
149
+ body: inputData,
150
+ method: "POST",
151
+ path: `/api/v1/orgs/${encodeURIComponent(orgId)}/extensions/packages`,
165
152
  session
166
153
  });
167
154
  },
168
- async startWorkflow(session, orgId, name, inputData) {
155
+ async publishExtensionPackageArchive(session, orgId, archive, inputData = {}) {
169
156
  return transport.requestJson({
170
- ...(inputData ? { body: inputData } : {}),
157
+ headers: { "content-type": "application/zip" },
171
158
  method: "POST",
172
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/processes/${encodeURIComponent(name)}/start`,
159
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/extensions/packages.zip`, inputData),
160
+ rawBody: archive,
173
161
  session
174
162
  });
175
163
  },
176
- async getOrganizationManagementContext(session, orgId) {
164
+ async exportExtensionPackage(session, orgId, inputData) {
177
165
  return transport.requestJson({
178
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/organization/management`,
166
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/extensions/packages/export`, inputData),
179
167
  session
180
168
  });
181
169
  },
182
- async getCapabilityEditor(session, orgId, name) {
183
- return transport.requestJson({
184
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/capabilities/editor/${encodeURIComponent(name)}`,
170
+ async exportExtensionPackageArchive(session, orgId, inputData) {
171
+ return transport.requestBytes({
172
+ method: "GET",
173
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/extensions/packages/export.zip`, inputData),
185
174
  session
186
175
  });
187
176
  },
188
- async getConnectorsEditor(session, orgId) {
177
+ async installExtension(session, orgId, inputData) {
178
+ const { environment, ...body } = inputData;
189
179
  return transport.requestJson({
190
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/connectors/editor`,
180
+ body,
181
+ method: "POST",
182
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/extensions/installs`, { environment }),
191
183
  session
192
184
  });
193
185
  },
194
- async getMcpServersEditor(session, orgId) {
186
+ async listBuiltInExtensions(session, orgId, inputData = {}) {
195
187
  return transport.requestJson({
196
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/mcp-servers/editor`,
188
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/extensions/built-ins`, inputData),
197
189
  session
198
190
  });
199
191
  },
200
- async listOrgMcpServers(session, orgId) {
192
+ async installBuiltInExtension(session, orgId, builtInSlug, inputData) {
193
+ const { environment, ...body } = inputData;
201
194
  return transport.requestJson({
202
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/mcp`,
195
+ body,
196
+ method: "POST",
197
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/extensions/built-ins/${encodeURIComponent(builtInSlug)}/install`, { environment }),
203
198
  session
204
199
  });
205
200
  },
206
- async createOrgMcpServer(session, orgId, inputData) {
201
+ async listExtensionInstalls(session, orgId, inputData = {}) {
207
202
  return transport.requestJson({
208
- body: inputData,
209
- method: "POST",
210
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/mcp`,
203
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/extensions`, inputData),
211
204
  session
212
205
  });
213
206
  },
214
- async getOrgMcpServer(session, orgId, serverRef) {
207
+ async getExtensionInstall(session, orgId, installRef, inputData) {
215
208
  return transport.requestJson({
216
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/mcp/${encodeURIComponent(serverRef)}`,
209
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/extensions/${encodeURIComponent(installRef)}`, inputData),
217
210
  session
218
211
  });
219
212
  },
220
- async updateOrgMcpServer(session, orgId, serverRef, inputData) {
213
+ async getExtensionInstallDetail(session, orgId, installRef, inputData) {
221
214
  return transport.requestJson({
222
- body: inputData,
223
- method: "PATCH",
224
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/mcp/${encodeURIComponent(serverRef)}`,
215
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/extensions/${encodeURIComponent(installRef)}/detail`, inputData),
225
216
  session
226
217
  });
227
218
  },
228
- async deleteOrgMcpServer(session, orgId, serverRef) {
219
+ async grantExtensionPermissions(session, orgId, installRef, inputData) {
220
+ const { environment, ...body } = inputData;
229
221
  return transport.requestJson({
230
- method: "DELETE",
231
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/mcp/${encodeURIComponent(serverRef)}`,
222
+ body,
223
+ method: "PATCH",
224
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/extensions/${encodeURIComponent(installRef)}/grants`, { environment }),
232
225
  session
233
226
  });
234
227
  },
235
- async testOrgMcpServer(session, orgId, serverRef) {
228
+ async planExtensionInstallUpdate(session, orgId, installRef, inputData) {
229
+ const { environment, ...body } = inputData;
236
230
  return transport.requestJson({
231
+ body,
237
232
  method: "POST",
238
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/mcp/${encodeURIComponent(serverRef)}/test`,
233
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/extensions/${encodeURIComponent(installRef)}/update-plan`, { environment }),
239
234
  session
240
235
  });
241
236
  },
242
- async discoverOrgMcpServerTools(session, orgId, serverRef) {
237
+ async updateExtensionInstall(session, orgId, installRef, inputData) {
238
+ const { environment, ...body } = inputData;
243
239
  return transport.requestJson({
244
- method: "POST",
245
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/mcp/${encodeURIComponent(serverRef)}/discover-tools`,
240
+ body,
241
+ method: "PATCH",
242
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/extensions/${encodeURIComponent(installRef)}`, { environment }),
246
243
  session
247
244
  });
248
245
  },
249
- async connectOrgMcpServerOAuth(session, orgId, serverRef) {
246
+ async disableExtensionInstall(session, orgId, installRef, inputData) {
250
247
  return transport.requestJson({
251
248
  method: "POST",
252
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/mcp/${encodeURIComponent(serverRef)}/oauth/connect`,
249
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/extensions/${encodeURIComponent(installRef)}/disable`, inputData),
253
250
  session
254
251
  });
255
252
  },
256
- async disconnectOrgMcpServerOAuth(session, orgId, serverRef) {
253
+ async enableExtensionInstall(session, orgId, installRef, inputData) {
257
254
  return transport.requestJson({
258
255
  method: "POST",
259
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/mcp/${encodeURIComponent(serverRef)}/oauth/disconnect`,
256
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/extensions/${encodeURIComponent(installRef)}/enable`, inputData),
260
257
  session
261
258
  });
262
259
  },
263
- async getOrgMcpServerOAuthSession(session, orgId, serverRef, oauthSessionId) {
260
+ async deleteExtensionInstall(session, orgId, installRef, inputData) {
264
261
  return transport.requestJson({
265
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/mcp/${encodeURIComponent(serverRef)}/oauth/sessions/${encodeURIComponent(oauthSessionId)}`,
262
+ method: "DELETE",
263
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/extensions/${encodeURIComponent(installRef)}`, inputData),
266
264
  session
267
265
  });
268
266
  },
269
- async getOrgMcpServerOAuthStatus(session, orgId, serverRef) {
267
+ async listWorkflows(session, orgId, releaseId) {
270
268
  return transport.requestJson({
271
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/mcp/${encodeURIComponent(serverRef)}/oauth/status`,
269
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/processes`, {
270
+ releaseId
271
+ }),
272
272
  session
273
273
  });
274
274
  },
275
- async listOrgSkillPackages(session, orgId) {
275
+ async getWorkflow(session, orgId, name, releaseId) {
276
276
  return transport.requestJson({
277
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/skills`,
277
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/processes/${encodeURIComponent(name)}`, { releaseId }),
278
278
  session
279
279
  });
280
280
  },
281
- async createOrgSkillPackage(session, orgId, inputData) {
281
+ async getWorkflowVersion(session, orgId, name, version, releaseId) {
282
282
  return transport.requestJson({
283
- body: inputData,
284
- method: "POST",
285
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/skills`,
283
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/processes/${encodeURIComponent(name)}/versions/${String(version)}`, { releaseId }),
286
284
  session
287
285
  });
288
286
  },
289
- async getOrgSkillPackage(session, orgId, skillRef) {
287
+ async getWorkflowDependencies(session, orgId, name, version, releaseId) {
290
288
  return transport.requestJson({
291
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/skills/${encodeURIComponent(skillRef)}`,
289
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/processes/${encodeURIComponent(name)}/versions/${String(version)}/dependencies`, { releaseId }),
292
290
  session
293
291
  });
294
292
  },
295
- async updateOrgSkillPackage(session, orgId, skillRef, inputData) {
293
+ async getWorkflowContext(session, orgId, releaseId) {
296
294
  return transport.requestJson({
297
- body: inputData,
298
- method: "PATCH",
299
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/skills/${encodeURIComponent(skillRef)}`,
295
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/workflows/context`, {
296
+ releaseId
297
+ }),
300
298
  session
301
299
  });
302
300
  },
303
- async deleteOrgSkillPackage(session, orgId, skillRef) {
301
+ async startWorkflow(session, orgId, name, inputData) {
304
302
  return transport.requestJson({
305
- method: "DELETE",
306
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/skills/${encodeURIComponent(skillRef)}`,
303
+ ...(inputData ? { body: inputData } : {}),
304
+ method: "POST",
305
+ path: `/api/v1/orgs/${encodeURIComponent(orgId)}/processes/${encodeURIComponent(name)}/start`,
307
306
  session
308
307
  });
309
308
  },
310
- async uploadOrgSkillPackageRevision(session, orgId, skillRef, inputData) {
309
+ async getOrganizationManagementContext(session, orgId) {
311
310
  return transport.requestJson({
312
- body: inputData,
313
- method: "POST",
314
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/skills/${encodeURIComponent(skillRef)}/revisions`,
311
+ path: `/api/v1/orgs/${encodeURIComponent(orgId)}/organization/management`,
315
312
  session
316
313
  });
317
314
  },
318
- async getOrgSkillPackageRevision(session, orgId, skillRef, revision) {
315
+ async getCapabilityEditor(session, orgId, name) {
319
316
  return transport.requestJson({
320
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/skills/${encodeURIComponent(skillRef)}/revisions/${encodeURIComponent(String(revision))}`,
317
+ path: `/api/v1/orgs/${encodeURIComponent(orgId)}/capabilities/editor/${encodeURIComponent(name)}`,
321
318
  session
322
319
  });
323
320
  },
@@ -345,6 +342,18 @@ export function createPlatformApiClient(input) {
345
342
  session
346
343
  });
347
344
  },
345
+ async listAuditEvents(session, orgId, filters) {
346
+ return transport.requestJson({
347
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/audit/events`, filters),
348
+ session
349
+ });
350
+ },
351
+ async getAuditEvent(session, orgId, eventId) {
352
+ return transport.requestJson({
353
+ path: `/api/v1/orgs/${encodeURIComponent(orgId)}/audit/events/${encodeURIComponent(eventId)}`,
354
+ session
355
+ });
356
+ },
348
357
  async listRuns(session, orgId, filters) {
349
358
  return transport.requestJson({
350
359
  path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/runs`, filters),
@@ -398,64 +407,111 @@ export function createPlatformApiClient(input) {
398
407
  session
399
408
  });
400
409
  },
401
- async getDeployment(session, orgId, deploymentId) {
410
+ async listEnvironmentDeployments(session, orgId, filters = {}) {
402
411
  return transport.requestJson({
403
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/deployments/${encodeURIComponent(deploymentId)}`,
412
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/environment-deployments`, filters),
404
413
  session
405
414
  });
406
415
  },
407
- async listReleases(session, orgId, filters) {
416
+ async getEnvironmentDeployment(session, orgId, deploymentId, filters = {}) {
408
417
  return transport.requestJson({
409
- path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/releases`, filters),
418
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/environment-deployments/${encodeURIComponent(deploymentId)}`, filters),
410
419
  session
411
420
  });
412
421
  },
413
- async getRelease(session, orgId, releaseId) {
422
+ async listEnvironments(session, orgId) {
414
423
  return transport.requestJson({
415
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/releases/${encodeURIComponent(releaseId)}`,
424
+ path: `/api/v1/orgs/${encodeURIComponent(orgId)}/environments`,
416
425
  session
417
426
  });
418
427
  },
419
- async getDraftChanges(session, orgId) {
428
+ async getEnvironment(session, orgId, environment) {
420
429
  return transport.requestJson({
421
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/releases/draft/changes`,
430
+ path: `/api/v1/orgs/${encodeURIComponent(orgId)}/environments/${encodeURIComponent(environment)}`,
422
431
  session
423
432
  });
424
433
  },
425
- async publishRelease(session, orgId, publishReason) {
434
+ async createEnvironment(session, orgId, inputData) {
426
435
  return transport.requestJson({
427
- body: publishReason ? { publishReason } : {},
436
+ body: inputData,
428
437
  method: "POST",
429
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/releases/publish`,
438
+ path: `/api/v1/orgs/${encodeURIComponent(orgId)}/environments`,
430
439
  session
431
440
  });
432
441
  },
433
- async retryReleasePublication(session, orgId, releaseId) {
442
+ async renameEnvironment(session, orgId, environment, inputData) {
443
+ return transport.requestJson({
444
+ body: inputData,
445
+ method: "PATCH",
446
+ path: `/api/v1/orgs/${encodeURIComponent(orgId)}/environments/${encodeURIComponent(environment)}`,
447
+ session
448
+ });
449
+ },
450
+ async archiveEnvironment(session, orgId, environment) {
434
451
  return transport.requestJson({
435
452
  method: "POST",
436
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/releases/${encodeURIComponent(releaseId)}/retry-publish`,
453
+ path: `/api/v1/orgs/${encodeURIComponent(orgId)}/environments/${encodeURIComponent(environment)}/archive`,
437
454
  session
438
455
  });
439
456
  },
440
- async discardDraft(session, orgId) {
457
+ async deployEnvironment(session, orgId, environment, inputData) {
441
458
  return transport.requestJson({
459
+ body: inputData,
442
460
  method: "POST",
443
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/releases/discard`,
461
+ path: `/api/v1/orgs/${encodeURIComponent(orgId)}/environments/${encodeURIComponent(environment)}/deploy`,
444
462
  session
445
463
  });
446
464
  },
447
- async restoreRelease(session, orgId, releaseId) {
465
+ async undeployEnvironment(session, orgId, environment, inputData = {}) {
448
466
  return transport.requestJson({
467
+ body: inputData,
449
468
  method: "POST",
450
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/releases/${encodeURIComponent(releaseId)}/restore`,
469
+ path: `/api/v1/orgs/${encodeURIComponent(orgId)}/environments/${encodeURIComponent(environment)}/undeploy`,
470
+ session
471
+ });
472
+ },
473
+ async listReleases(session, orgId, filters) {
474
+ return transport.requestJson({
475
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/releases`, filters),
476
+ session
477
+ });
478
+ },
479
+ async getRelease(session, orgId, releaseId) {
480
+ return transport.requestJson({
481
+ path: `/api/v1/orgs/${encodeURIComponent(orgId)}/releases/${encodeURIComponent(releaseId)}`,
451
482
  session
452
483
  });
453
484
  },
454
- async deactivateRelease(session, orgId, releaseId, policy) {
485
+ async getReleaseSource(session, orgId, releaseId) {
455
486
  return transport.requestJson({
456
- ...(policy ? { body: { policy } } : {}),
487
+ path: `/api/v1/orgs/${encodeURIComponent(orgId)}/releases/${encodeURIComponent(releaseId)}/source`,
488
+ session
489
+ });
490
+ },
491
+ async createRelease(session, orgId, inputData) {
492
+ return transport.requestJson({
493
+ body: inputData,
457
494
  method: "POST",
458
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/releases/${encodeURIComponent(releaseId)}/deactivate`,
495
+ path: `/api/v1/orgs/${encodeURIComponent(orgId)}/releases`,
496
+ session
497
+ });
498
+ },
499
+ async createReleaseArchive(session, orgId, archive, inputData = {}) {
500
+ return transport.requestJson({
501
+ headers: { "content-type": "application/zip" },
502
+ method: "POST",
503
+ path: withQuery(`/api/v1/orgs/${encodeURIComponent(orgId)}/releases.zip`, inputData),
504
+ rawBody: archive,
505
+ session
506
+ });
507
+ },
508
+ async validateRelease(session, orgId, inputData) {
509
+ const orgPath = `/api/v1/orgs/${encodeURIComponent(orgId)}`;
510
+ return transport.requestJson({
511
+ path: withQuery(`${orgPath}/releases/validate`, {
512
+ releaseId: inputData.releaseId,
513
+ ...(inputData.environment ? { environment: inputData.environment } : {})
514
+ }),
459
515
  session
460
516
  });
461
517
  },
@@ -528,6 +584,12 @@ export function createPlatformApiClient(input) {
528
584
  session
529
585
  });
530
586
  },
587
+ async getAgentUsage(session, orgId, inputData = {}) {
588
+ return transport.requestJson({
589
+ path: withQuery(`/admin/v1/orgs/${encodeURIComponent(orgId)}/agent-usage`, inputData),
590
+ session
591
+ });
592
+ },
531
593
  async listChatSessions(session, orgId) {
532
594
  return transport.requestJson({
533
595
  path: `/api/v1/orgs/${encodeURIComponent(orgId)}/chat/sessions`,
@@ -547,44 +609,6 @@ export function createPlatformApiClient(input) {
547
609
  session
548
610
  });
549
611
  },
550
- async getChatChanges(session, orgId, sessionId) {
551
- return transport.requestJson({
552
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/chat/sessions/${encodeURIComponent(sessionId)}/changes`,
553
- session
554
- });
555
- },
556
- async getChatValidation(session, orgId, sessionId) {
557
- return transport.requestJson({
558
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/chat/sessions/${encodeURIComponent(sessionId)}/validation`,
559
- session
560
- });
561
- },
562
- async getChatDraft(session, orgId, sessionId) {
563
- return transport.requestJson({
564
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/chat/sessions/${encodeURIComponent(sessionId)}/draft`,
565
- session
566
- });
567
- },
568
- async applyChatDraft(session, orgId, sessionId) {
569
- return transport.requestJson({
570
- method: "POST",
571
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/chat/sessions/${encodeURIComponent(sessionId)}/draft/apply`,
572
- session
573
- });
574
- },
575
- async refreshChatDraft(session, orgId, sessionId) {
576
- return transport.requestJson({
577
- method: "POST",
578
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/chat/sessions/${encodeURIComponent(sessionId)}/draft/refresh`,
579
- session
580
- });
581
- },
582
- async getChatWorkspaceState(session, orgId, sessionId) {
583
- return transport.requestJson({
584
- path: `/api/v1/orgs/${encodeURIComponent(orgId)}/chat/sessions/${encodeURIComponent(sessionId)}/workspace-state`,
585
- session
586
- });
587
- },
588
612
  async listDeletedOrganizations(session) {
589
613
  return transport.requestJson({
590
614
  path: "/admin/v1/orgs/deleted",