@miosa/sdk 1.2.8 → 1.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +53 -1
- package/dist/index.js +428 -339
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -22,10 +22,10 @@ var MiosaError = class _MiosaError extends Error {
|
|
|
22
22
|
this.details = details;
|
|
23
23
|
this.requestId = requestId;
|
|
24
24
|
}
|
|
25
|
-
static fromResponse(status,
|
|
26
|
-
const message =
|
|
27
|
-
const code =
|
|
28
|
-
const details =
|
|
25
|
+
static fromResponse(status, body3, requestId) {
|
|
26
|
+
const message = body3.error?.message ?? body3.message ?? `HTTP ${status}`;
|
|
27
|
+
const code = body3.error?.code ?? body3.code ?? "UNKNOWN_ERROR";
|
|
28
|
+
const details = body3.error?.details;
|
|
29
29
|
if (status === 401 || status === 403) {
|
|
30
30
|
return new AuthError(message, status, code, details, requestId);
|
|
31
31
|
}
|
|
@@ -145,10 +145,10 @@ var HttpClient = class {
|
|
|
145
145
|
this.timeout = config.timeout ?? DEFAULT_TIMEOUT;
|
|
146
146
|
this.maxRetries = config.maxRetries ?? DEFAULT_MAX_RETRIES;
|
|
147
147
|
}
|
|
148
|
-
buildUrl(path,
|
|
148
|
+
buildUrl(path, query2) {
|
|
149
149
|
const url = new URL(`${this.baseUrl}${path}`);
|
|
150
|
-
if (
|
|
151
|
-
for (const [key, value] of Object.entries(
|
|
150
|
+
if (query2) {
|
|
151
|
+
for (const [key, value] of Object.entries(query2)) {
|
|
152
152
|
if (value !== void 0) {
|
|
153
153
|
url.searchParams.set(key, String(value));
|
|
154
154
|
}
|
|
@@ -167,7 +167,7 @@ var HttpClient = class {
|
|
|
167
167
|
async request(path, options = {}) {
|
|
168
168
|
const {
|
|
169
169
|
method = "GET",
|
|
170
|
-
body:
|
|
170
|
+
body: body3,
|
|
171
171
|
formData,
|
|
172
172
|
binary = false,
|
|
173
173
|
timeout = this.timeout
|
|
@@ -176,9 +176,9 @@ var HttpClient = class {
|
|
|
176
176
|
let fetchBody;
|
|
177
177
|
if (formData) {
|
|
178
178
|
fetchBody = formData;
|
|
179
|
-
} else if (
|
|
179
|
+
} else if (body3 !== void 0) {
|
|
180
180
|
headers = { ...headers, "Content-Type": "application/json" };
|
|
181
|
-
fetchBody = JSON.stringify(
|
|
181
|
+
fetchBody = JSON.stringify(body3);
|
|
182
182
|
}
|
|
183
183
|
let lastError;
|
|
184
184
|
for (let attempt = 0; attempt <= this.maxRetries; attempt++) {
|
|
@@ -248,11 +248,11 @@ var HttpClient = class {
|
|
|
248
248
|
}
|
|
249
249
|
throw lastError ?? new MiosaError("Max retries exceeded", 0, "MAX_RETRIES_EXCEEDED");
|
|
250
250
|
}
|
|
251
|
-
async get(path,
|
|
251
|
+
async get(path, query2) {
|
|
252
252
|
let fullPath = path;
|
|
253
|
-
if (
|
|
253
|
+
if (query2) {
|
|
254
254
|
const params = new URLSearchParams();
|
|
255
|
-
for (const [k, v] of Object.entries(
|
|
255
|
+
for (const [k, v] of Object.entries(query2)) {
|
|
256
256
|
if (v !== void 0 && v !== null) params.set(k, String(v));
|
|
257
257
|
}
|
|
258
258
|
const qs = params.toString();
|
|
@@ -260,17 +260,17 @@ var HttpClient = class {
|
|
|
260
260
|
}
|
|
261
261
|
return this.request(fullPath, { method: "GET" });
|
|
262
262
|
}
|
|
263
|
-
async post(path,
|
|
264
|
-
return this.request(path, { method: "POST", body:
|
|
263
|
+
async post(path, body3) {
|
|
264
|
+
return this.request(path, { method: "POST", body: body3 });
|
|
265
265
|
}
|
|
266
|
-
async patch(path,
|
|
267
|
-
return this.request(path, { method: "PATCH", body:
|
|
266
|
+
async patch(path, body3) {
|
|
267
|
+
return this.request(path, { method: "PATCH", body: body3 });
|
|
268
268
|
}
|
|
269
|
-
async put(path,
|
|
270
|
-
return this.request(path, { method: "PUT", body:
|
|
269
|
+
async put(path, body3) {
|
|
270
|
+
return this.request(path, { method: "PUT", body: body3 });
|
|
271
271
|
}
|
|
272
|
-
async delete(path,
|
|
273
|
-
return this.request(path, { method: "DELETE", body:
|
|
272
|
+
async delete(path, body3) {
|
|
273
|
+
return this.request(path, { method: "DELETE", body: body3 });
|
|
274
274
|
}
|
|
275
275
|
async getBinary(path) {
|
|
276
276
|
return this.request(path, { method: "GET", binary: true });
|
|
@@ -288,10 +288,10 @@ var HttpClient = class {
|
|
|
288
288
|
Accept: "text/event-stream",
|
|
289
289
|
...options.headers
|
|
290
290
|
});
|
|
291
|
-
let
|
|
291
|
+
let body3 = null;
|
|
292
292
|
if (options.body !== void 0) {
|
|
293
293
|
headers = { ...headers, "Content-Type": "application/json" };
|
|
294
|
-
|
|
294
|
+
body3 = JSON.stringify(options.body);
|
|
295
295
|
}
|
|
296
296
|
const controller = new AbortController();
|
|
297
297
|
let response;
|
|
@@ -299,7 +299,7 @@ var HttpClient = class {
|
|
|
299
299
|
response = await fetch(`${this.baseUrl}${path}`, {
|
|
300
300
|
method,
|
|
301
301
|
headers,
|
|
302
|
-
body:
|
|
302
|
+
body: body3,
|
|
303
303
|
signal: controller.signal
|
|
304
304
|
});
|
|
305
305
|
} catch (err) {
|
|
@@ -368,10 +368,10 @@ var Admin = class {
|
|
|
368
368
|
this.http = http;
|
|
369
369
|
}
|
|
370
370
|
/** Escape hatch — call any admin endpoint by method + path. */
|
|
371
|
-
async request(method, path,
|
|
372
|
-
const fullPath =
|
|
371
|
+
async request(method, path, body3, query2) {
|
|
372
|
+
const fullPath = query2 ? (() => {
|
|
373
373
|
const qs = new URLSearchParams();
|
|
374
|
-
for (const [k, v] of Object.entries(
|
|
374
|
+
for (const [k, v] of Object.entries(query2)) {
|
|
375
375
|
if (v !== void 0) qs.set(k, String(v));
|
|
376
376
|
}
|
|
377
377
|
const s = qs.toString();
|
|
@@ -381,13 +381,13 @@ var Admin = class {
|
|
|
381
381
|
case "GET":
|
|
382
382
|
return this.http.get(fullPath);
|
|
383
383
|
case "POST":
|
|
384
|
-
return this.http.post(fullPath,
|
|
384
|
+
return this.http.post(fullPath, body3);
|
|
385
385
|
case "PUT":
|
|
386
|
-
return this.http.put(fullPath,
|
|
386
|
+
return this.http.put(fullPath, body3);
|
|
387
387
|
case "PATCH":
|
|
388
|
-
return this.http.patch(fullPath,
|
|
388
|
+
return this.http.patch(fullPath, body3);
|
|
389
389
|
case "DELETE":
|
|
390
|
-
return this.http.delete(fullPath,
|
|
390
|
+
return this.http.delete(fullPath, body3);
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
393
|
// ── Overview ────────────────────────────────────────────────
|
|
@@ -612,6 +612,7 @@ function body(params) {
|
|
|
612
612
|
return Object.fromEntries(
|
|
613
613
|
Object.entries({
|
|
614
614
|
workspace_id: params.workspaceId ?? params.workspace_id,
|
|
615
|
+
project_id: params.projectId ?? params.project_id,
|
|
615
616
|
name: params.name,
|
|
616
617
|
runtime: params.runtime,
|
|
617
618
|
description: params.description,
|
|
@@ -631,12 +632,14 @@ function normalize(profile) {
|
|
|
631
632
|
};
|
|
632
633
|
const tenantId = profile.tenantId ?? profile.tenant_id;
|
|
633
634
|
const workspaceId2 = profile.workspaceId ?? profile.workspace_id;
|
|
635
|
+
const projectId = profile.projectId ?? profile.project_id;
|
|
634
636
|
const appliesTo = profile.appliesTo ?? profile.applies_to;
|
|
635
637
|
const isDefault = profile.isDefault ?? profile.is_default;
|
|
636
638
|
const createdAt = profile.createdAt ?? profile.created_at;
|
|
637
639
|
const updatedAt = profile.updatedAt ?? profile.updated_at;
|
|
638
640
|
if (tenantId !== void 0) normalized.tenantId = tenantId;
|
|
639
641
|
if (workspaceId2 !== void 0) normalized.workspaceId = workspaceId2;
|
|
642
|
+
if (projectId !== void 0) normalized.projectId = projectId;
|
|
640
643
|
if (appliesTo !== void 0) normalized.appliesTo = appliesTo;
|
|
641
644
|
if (isDefault !== void 0) normalized.isDefault = isDefault;
|
|
642
645
|
if (createdAt !== void 0) normalized.createdAt = createdAt;
|
|
@@ -651,7 +654,10 @@ var AgentRuntimeProfiles = class {
|
|
|
651
654
|
async list(params = {}) {
|
|
652
655
|
const response = await this.http.get(
|
|
653
656
|
"/agent-runtime-profiles",
|
|
654
|
-
{
|
|
657
|
+
{
|
|
658
|
+
workspace_id: params.workspaceId ?? params.workspace_id,
|
|
659
|
+
project_id: params.projectId ?? params.project_id
|
|
660
|
+
}
|
|
655
661
|
);
|
|
656
662
|
return unwrap(response).map(normalize);
|
|
657
663
|
}
|
|
@@ -731,7 +737,7 @@ var AgentRuns = class {
|
|
|
731
737
|
);
|
|
732
738
|
}
|
|
733
739
|
async run(params) {
|
|
734
|
-
const
|
|
740
|
+
const body3 = stripUndefined({
|
|
735
741
|
prompt: params.prompt,
|
|
736
742
|
target_kind: params.targetKind,
|
|
737
743
|
target_id: params.targetId,
|
|
@@ -749,7 +755,7 @@ var AgentRuns = class {
|
|
|
749
755
|
skip_agent_runtime_profile: params.skipAgentRuntimeProfile,
|
|
750
756
|
metadata: params.metadata
|
|
751
757
|
});
|
|
752
|
-
return unwrap2(await this.http.post("/agent-runs",
|
|
758
|
+
return unwrap2(await this.http.post("/agent-runs", body3));
|
|
753
759
|
}
|
|
754
760
|
async cancel(id) {
|
|
755
761
|
return unwrap2(
|
|
@@ -783,14 +789,14 @@ var Analytics = class {
|
|
|
783
789
|
http;
|
|
784
790
|
/** Get the platform analytics overview. */
|
|
785
791
|
async overview(filters = {}) {
|
|
786
|
-
const
|
|
787
|
-
const data = await this.http.get("/analytics/overview",
|
|
792
|
+
const query2 = stripUndefined2(filters);
|
|
793
|
+
const data = await this.http.get("/analytics/overview", query2);
|
|
788
794
|
return unwrap3(data);
|
|
789
795
|
}
|
|
790
796
|
/** Get a timeseries for a metric over a period. */
|
|
791
797
|
async timeseries(params = {}) {
|
|
792
|
-
const
|
|
793
|
-
const data = await this.http.get("/analytics/timeseries",
|
|
798
|
+
const query2 = stripUndefined2(params);
|
|
799
|
+
const data = await this.http.get("/analytics/timeseries", query2);
|
|
794
800
|
return unwrap3(data);
|
|
795
801
|
}
|
|
796
802
|
};
|
|
@@ -824,32 +830,32 @@ var ApiKeys = class {
|
|
|
824
830
|
}
|
|
825
831
|
http;
|
|
826
832
|
async list(params = {}) {
|
|
827
|
-
const
|
|
828
|
-
const data = await this.http.get("/api-keys",
|
|
833
|
+
const query2 = stripUndefined3({ ...params });
|
|
834
|
+
const data = await this.http.get("/api-keys", query2);
|
|
829
835
|
return listItems(data);
|
|
830
836
|
}
|
|
831
837
|
async create(params) {
|
|
832
838
|
const { idempotencyKey: ikey, expiresAt, ...rest } = params;
|
|
833
|
-
const
|
|
839
|
+
const body3 = stripUndefined3({
|
|
834
840
|
...rest,
|
|
835
841
|
expires_at: expiresAt ?? rest.expires_at
|
|
836
842
|
});
|
|
837
843
|
const data = await this.http.request("/api-keys", {
|
|
838
844
|
method: "POST",
|
|
839
|
-
body:
|
|
845
|
+
body: body3,
|
|
840
846
|
headers: { "Idempotency-Key": idempotencyKey(ikey) }
|
|
841
847
|
});
|
|
842
848
|
return unwrap4(data);
|
|
843
849
|
}
|
|
844
850
|
/** POST /api/v1/api-keys/scoped — L2 delegation token bound to one external user. */
|
|
845
851
|
async createScoped(params) {
|
|
846
|
-
const
|
|
852
|
+
const body3 = stripUndefined3({
|
|
847
853
|
external_user_id: params.externalUserId,
|
|
848
854
|
scopes: params.scopes,
|
|
849
855
|
expires_at: params.expiresAt
|
|
850
856
|
});
|
|
851
857
|
return unwrap4(
|
|
852
|
-
await this.http.post("/api-keys/scoped",
|
|
858
|
+
await this.http.post("/api-keys/scoped", body3)
|
|
853
859
|
);
|
|
854
860
|
}
|
|
855
861
|
async delete(keyId) {
|
|
@@ -879,8 +885,8 @@ var AuditLog = class {
|
|
|
879
885
|
http;
|
|
880
886
|
/** List audit-log events with optional filters. */
|
|
881
887
|
async list(params = {}) {
|
|
882
|
-
const
|
|
883
|
-
const data = await this.http.get("/audit-log",
|
|
888
|
+
const query2 = stripUndefined4(params);
|
|
889
|
+
const data = await this.http.get("/audit-log", query2);
|
|
884
890
|
const result = unwrap5(data);
|
|
885
891
|
if (Array.isArray(result)) return result;
|
|
886
892
|
return [];
|
|
@@ -913,10 +919,10 @@ var Benchmarks = class {
|
|
|
913
919
|
}
|
|
914
920
|
http;
|
|
915
921
|
async list(filters = {}) {
|
|
916
|
-
const
|
|
922
|
+
const query2 = Object.fromEntries(
|
|
917
923
|
Object.entries(filters).filter(([, v]) => v !== void 0)
|
|
918
924
|
);
|
|
919
|
-
const data = await this.http.get("/admin/benchmarks",
|
|
925
|
+
const data = await this.http.get("/admin/benchmarks", query2);
|
|
920
926
|
return unwrapList(data);
|
|
921
927
|
}
|
|
922
928
|
async get(benchmarkId) {
|
|
@@ -926,10 +932,10 @@ var Benchmarks = class {
|
|
|
926
932
|
}
|
|
927
933
|
/** Start a new benchmark run — pass kind and run-specific options. */
|
|
928
934
|
async create(params) {
|
|
929
|
-
const
|
|
935
|
+
const body3 = Object.fromEntries(
|
|
930
936
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
931
937
|
);
|
|
932
|
-
return unwrap6(await this.http.post("/admin/benchmarks",
|
|
938
|
+
return unwrap6(await this.http.post("/admin/benchmarks", body3));
|
|
933
939
|
}
|
|
934
940
|
async cancel(benchmarkId) {
|
|
935
941
|
return unwrap6(
|
|
@@ -938,22 +944,22 @@ var Benchmarks = class {
|
|
|
938
944
|
}
|
|
939
945
|
/** Return per-iteration timing samples for a benchmark run. */
|
|
940
946
|
async samples(benchmarkId, filters = {}) {
|
|
941
|
-
const
|
|
947
|
+
const query2 = Object.fromEntries(
|
|
942
948
|
Object.entries(filters).filter(([, v]) => v !== void 0)
|
|
943
949
|
);
|
|
944
950
|
const data = await this.http.get(
|
|
945
951
|
`/admin/benchmarks/${benchmarkId}/samples`,
|
|
946
|
-
|
|
952
|
+
query2
|
|
947
953
|
);
|
|
948
954
|
return unwrapList(data);
|
|
949
955
|
}
|
|
950
956
|
/** Compare two benchmark runs. */
|
|
951
957
|
async compare(params) {
|
|
952
|
-
const
|
|
958
|
+
const body3 = Object.fromEntries(
|
|
953
959
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
954
960
|
);
|
|
955
961
|
return unwrap6(
|
|
956
|
-
await this.http.post("/admin/benchmarks/compare",
|
|
962
|
+
await this.http.post("/admin/benchmarks/compare", body3)
|
|
957
963
|
);
|
|
958
964
|
}
|
|
959
965
|
};
|
|
@@ -984,8 +990,8 @@ var BuilderSessions = class {
|
|
|
984
990
|
}
|
|
985
991
|
http;
|
|
986
992
|
async list(params = {}) {
|
|
987
|
-
const
|
|
988
|
-
return unwrapList2(await this.http.get("/builder/sessions",
|
|
993
|
+
const query2 = { limit: 50, ...params };
|
|
994
|
+
return unwrapList2(await this.http.get("/builder/sessions", query2));
|
|
989
995
|
}
|
|
990
996
|
/**
|
|
991
997
|
* Get a single session. The platform router only exposes index +
|
|
@@ -1034,8 +1040,8 @@ var Channels = class {
|
|
|
1034
1040
|
http;
|
|
1035
1041
|
/** List all channels for the tenant. */
|
|
1036
1042
|
async list(params = {}) {
|
|
1037
|
-
const
|
|
1038
|
-
const data = await this.http.get("/channels",
|
|
1043
|
+
const query2 = stripUndefined5(params);
|
|
1044
|
+
const data = await this.http.get("/channels", query2);
|
|
1039
1045
|
const result = unwrap8(data);
|
|
1040
1046
|
if (Array.isArray(result)) return result;
|
|
1041
1047
|
return [];
|
|
@@ -1047,14 +1053,14 @@ var Channels = class {
|
|
|
1047
1053
|
}
|
|
1048
1054
|
/** Create a new channel. */
|
|
1049
1055
|
async create(params) {
|
|
1050
|
-
const
|
|
1051
|
-
const data = await this.http.post("/channels",
|
|
1056
|
+
const body3 = stripUndefObj(params);
|
|
1057
|
+
const data = await this.http.post("/channels", body3);
|
|
1052
1058
|
return unwrap8(data);
|
|
1053
1059
|
}
|
|
1054
1060
|
/** Update a channel. */
|
|
1055
1061
|
async update(channelId, params) {
|
|
1056
|
-
const
|
|
1057
|
-
const data = await this.http.patch(`/channels/${channelId}`,
|
|
1062
|
+
const body3 = stripUndefObj(params);
|
|
1063
|
+
const data = await this.http.patch(`/channels/${channelId}`, body3);
|
|
1058
1064
|
return unwrap8(data);
|
|
1059
1065
|
}
|
|
1060
1066
|
/** Delete a channel. */
|
|
@@ -1069,8 +1075,8 @@ var Channels = class {
|
|
|
1069
1075
|
}
|
|
1070
1076
|
/** Update notification preferences. */
|
|
1071
1077
|
async updateNotifications(params) {
|
|
1072
|
-
const
|
|
1073
|
-
const data = await this.http.put("/channels/notifications",
|
|
1078
|
+
const body3 = stripUndefObj(params);
|
|
1079
|
+
const data = await this.http.put("/channels/notifications", body3);
|
|
1074
1080
|
return unwrap8(data);
|
|
1075
1081
|
}
|
|
1076
1082
|
/** Enable a channel. */
|
|
@@ -1174,21 +1180,21 @@ var Community = class {
|
|
|
1174
1180
|
http;
|
|
1175
1181
|
// ── Agents ────────────────────────────────────────────────────────────
|
|
1176
1182
|
async listAgents(filters = {}) {
|
|
1177
|
-
const
|
|
1183
|
+
const query2 = Object.fromEntries(
|
|
1178
1184
|
Object.entries(filters).filter(([, v]) => v !== void 0)
|
|
1179
1185
|
);
|
|
1180
|
-
return unwrapList4(await this.http.get("/community/agents",
|
|
1186
|
+
return unwrapList4(await this.http.get("/community/agents", query2));
|
|
1181
1187
|
}
|
|
1182
1188
|
async getAgent(agentId) {
|
|
1183
1189
|
return unwrap10(await this.http.get(`/community/agents/${agentId}`));
|
|
1184
1190
|
}
|
|
1185
1191
|
// ── Templates ─────────────────────────────────────────────────────────
|
|
1186
1192
|
async listTemplates(filters = {}) {
|
|
1187
|
-
const
|
|
1193
|
+
const query2 = Object.fromEntries(
|
|
1188
1194
|
Object.entries(filters).filter(([, v]) => v !== void 0)
|
|
1189
1195
|
);
|
|
1190
1196
|
return unwrapList4(
|
|
1191
|
-
await this.http.get("/community/templates",
|
|
1197
|
+
await this.http.get("/community/templates", query2)
|
|
1192
1198
|
);
|
|
1193
1199
|
}
|
|
1194
1200
|
async getTemplate(templateId) {
|
|
@@ -1198,19 +1204,19 @@ var Community = class {
|
|
|
1198
1204
|
}
|
|
1199
1205
|
/** Install a community template into the caller's tenant. */
|
|
1200
1206
|
async installTemplate(templateId, opts = {}) {
|
|
1201
|
-
const
|
|
1207
|
+
const body3 = Object.fromEntries(
|
|
1202
1208
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
1203
1209
|
);
|
|
1204
1210
|
return unwrap10(
|
|
1205
1211
|
await this.http.post(
|
|
1206
1212
|
`/community/templates/${templateId}/install`,
|
|
1207
|
-
|
|
1213
|
+
body3
|
|
1208
1214
|
)
|
|
1209
1215
|
);
|
|
1210
1216
|
}
|
|
1211
1217
|
/** Rate a community template (1–5). */
|
|
1212
1218
|
async rateTemplate(templateId, rating, opts = {}) {
|
|
1213
|
-
const
|
|
1219
|
+
const body3 = {
|
|
1214
1220
|
rating,
|
|
1215
1221
|
...Object.fromEntries(
|
|
1216
1222
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
@@ -1219,7 +1225,7 @@ var Community = class {
|
|
|
1219
1225
|
return unwrap10(
|
|
1220
1226
|
await this.http.post(
|
|
1221
1227
|
`/community/templates/${templateId}/rate`,
|
|
1222
|
-
|
|
1228
|
+
body3
|
|
1223
1229
|
)
|
|
1224
1230
|
);
|
|
1225
1231
|
}
|
|
@@ -1245,24 +1251,24 @@ var Completions = class {
|
|
|
1245
1251
|
}
|
|
1246
1252
|
http;
|
|
1247
1253
|
create(params) {
|
|
1248
|
-
const
|
|
1254
|
+
const body3 = buildBody(params);
|
|
1249
1255
|
if (params.stream === true) {
|
|
1250
1256
|
return this.http.stream(
|
|
1251
1257
|
"/intelligence/completions",
|
|
1252
|
-
{ method: "POST", body:
|
|
1258
|
+
{ method: "POST", body: body3 }
|
|
1253
1259
|
);
|
|
1254
1260
|
}
|
|
1255
|
-
return this.http.post("/intelligence/completions",
|
|
1261
|
+
return this.http.post("/intelligence/completions", body3).then(unwrap11);
|
|
1256
1262
|
}
|
|
1257
1263
|
chat(params) {
|
|
1258
|
-
const
|
|
1264
|
+
const body3 = buildBody(params);
|
|
1259
1265
|
if (params.stream === true) {
|
|
1260
1266
|
return this.http.stream(
|
|
1261
1267
|
"/intelligence/chat/completions",
|
|
1262
|
-
{ method: "POST", body:
|
|
1268
|
+
{ method: "POST", body: body3 }
|
|
1263
1269
|
);
|
|
1264
1270
|
}
|
|
1265
|
-
return this.http.post("/intelligence/chat/completions",
|
|
1271
|
+
return this.http.post("/intelligence/chat/completions", body3).then(unwrap11);
|
|
1266
1272
|
}
|
|
1267
1273
|
};
|
|
1268
1274
|
|
|
@@ -1493,11 +1499,11 @@ var ComputerLogs = class {
|
|
|
1493
1499
|
computerId;
|
|
1494
1500
|
/** Fetch the most recent log snapshot. */
|
|
1495
1501
|
async get(params = {}) {
|
|
1496
|
-
const
|
|
1502
|
+
const query2 = Object.fromEntries(
|
|
1497
1503
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
1498
1504
|
);
|
|
1499
1505
|
return unwrap14(
|
|
1500
|
-
await this.http.get(`/computers/${this.computerId}/logs`,
|
|
1506
|
+
await this.http.get(`/computers/${this.computerId}/logs`, query2)
|
|
1501
1507
|
);
|
|
1502
1508
|
}
|
|
1503
1509
|
/** Stream live log events as SSE dicts `{type, data, id}`. */
|
|
@@ -1527,7 +1533,7 @@ var ComputerOsa = class {
|
|
|
1527
1533
|
computerId;
|
|
1528
1534
|
/** Submit a free-form task to the in-VM OSA agent. */
|
|
1529
1535
|
async submitTask(task, params = {}) {
|
|
1530
|
-
const
|
|
1536
|
+
const body3 = {
|
|
1531
1537
|
task,
|
|
1532
1538
|
...Object.fromEntries(
|
|
1533
1539
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
@@ -1536,7 +1542,7 @@ var ComputerOsa = class {
|
|
|
1536
1542
|
return unwrap15(
|
|
1537
1543
|
await this.http.post(
|
|
1538
1544
|
`/computers/${this.computerId}/osa/task`,
|
|
1539
|
-
|
|
1545
|
+
body3
|
|
1540
1546
|
)
|
|
1541
1547
|
);
|
|
1542
1548
|
}
|
|
@@ -1554,13 +1560,13 @@ var ComputerOsa = class {
|
|
|
1554
1560
|
}
|
|
1555
1561
|
/** Update OSA runtime configuration (model, tools, secrets, etc.). */
|
|
1556
1562
|
async configure(config) {
|
|
1557
|
-
const
|
|
1563
|
+
const body3 = Object.fromEntries(
|
|
1558
1564
|
Object.entries(config).filter(([, v]) => v !== void 0)
|
|
1559
1565
|
);
|
|
1560
1566
|
return unwrap15(
|
|
1561
1567
|
await this.http.post(
|
|
1562
1568
|
`/computers/${this.computerId}/osa/configure`,
|
|
1563
|
-
|
|
1569
|
+
body3
|
|
1564
1570
|
)
|
|
1565
1571
|
);
|
|
1566
1572
|
}
|
|
@@ -1606,21 +1612,21 @@ var ComputerPorts = class {
|
|
|
1606
1612
|
}
|
|
1607
1613
|
/** Expose port with the given visibility options. */
|
|
1608
1614
|
async create(port, opts = {}) {
|
|
1609
|
-
const
|
|
1615
|
+
const body3 = {
|
|
1610
1616
|
port,
|
|
1611
1617
|
...Object.fromEntries(
|
|
1612
1618
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
1613
1619
|
)
|
|
1614
1620
|
};
|
|
1615
|
-
return unwrap16(await this.http.post(this.base(),
|
|
1621
|
+
return unwrap16(await this.http.post(this.base(), body3));
|
|
1616
1622
|
}
|
|
1617
1623
|
/** Patch visibility / auth options for port. */
|
|
1618
1624
|
async update(port, opts) {
|
|
1619
|
-
const
|
|
1625
|
+
const body3 = Object.fromEntries(
|
|
1620
1626
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
1621
1627
|
);
|
|
1622
1628
|
return unwrap16(
|
|
1623
|
-
await this.http.patch(`${this.base()}/${port}`,
|
|
1629
|
+
await this.http.patch(`${this.base()}/${port}`, body3)
|
|
1624
1630
|
);
|
|
1625
1631
|
}
|
|
1626
1632
|
/** Stop exposing port. */
|
|
@@ -1639,12 +1645,12 @@ var ComputerTerminal = class {
|
|
|
1639
1645
|
computerId;
|
|
1640
1646
|
/** Open a new PTY session. Returns the server payload (session id, etc.). */
|
|
1641
1647
|
async create(params = {}) {
|
|
1642
|
-
const
|
|
1648
|
+
const body3 = Object.fromEntries(
|
|
1643
1649
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
1644
1650
|
);
|
|
1645
1651
|
const raw = await this.http.post(
|
|
1646
1652
|
`/computers/${this.computerId}/terminal`,
|
|
1647
|
-
|
|
1653
|
+
body3
|
|
1648
1654
|
);
|
|
1649
1655
|
return unwrap17(raw);
|
|
1650
1656
|
}
|
|
@@ -2088,12 +2094,12 @@ var EgressNetwork = class {
|
|
|
2088
2094
|
}
|
|
2089
2095
|
/** List allowlist rules. */
|
|
2090
2096
|
async rules(params = {}) {
|
|
2091
|
-
const
|
|
2097
|
+
const query2 = stripUndefined7({
|
|
2092
2098
|
policy_id: pickFirst2(params.policyId, params.policy_id),
|
|
2093
2099
|
resource_id: pickFirst2(params.resourceId, params.resource_id),
|
|
2094
2100
|
resource_type: pickFirst2(params.resourceType, params.resource_type)
|
|
2095
2101
|
});
|
|
2096
|
-
const data = await this.http.get("/egress/allowlist",
|
|
2102
|
+
const data = await this.http.get("/egress/allowlist", query2);
|
|
2097
2103
|
return unwrapList9(data);
|
|
2098
2104
|
}
|
|
2099
2105
|
/** Delete an allowlist rule by id. */
|
|
@@ -2103,16 +2109,16 @@ var EgressNetwork = class {
|
|
|
2103
2109
|
// ── policies ──────────────────────────────────────────────────────────────
|
|
2104
2110
|
/** List egress policies. */
|
|
2105
2111
|
async policies(params = {}) {
|
|
2106
|
-
const
|
|
2112
|
+
const query2 = stripUndefined7({
|
|
2107
2113
|
resource_id: pickFirst2(params.resourceId, params.resource_id),
|
|
2108
2114
|
resource_type: pickFirst2(params.resourceType, params.resource_type)
|
|
2109
2115
|
});
|
|
2110
|
-
const data = await this.http.get("/egress/policies",
|
|
2116
|
+
const data = await this.http.get("/egress/policies", query2);
|
|
2111
2117
|
return unwrapList9(data);
|
|
2112
2118
|
}
|
|
2113
2119
|
/** Create an egress policy. */
|
|
2114
2120
|
async createPolicy(params) {
|
|
2115
|
-
const
|
|
2121
|
+
const body3 = stripUndefined7({
|
|
2116
2122
|
name: params.name,
|
|
2117
2123
|
mode: params.mode ?? "enforce",
|
|
2118
2124
|
default_effect: pickFirst2(
|
|
@@ -2126,13 +2132,13 @@ var EgressNetwork = class {
|
|
|
2126
2132
|
});
|
|
2127
2133
|
const data = await this.http.post(
|
|
2128
2134
|
"/egress/policies",
|
|
2129
|
-
|
|
2135
|
+
body3
|
|
2130
2136
|
);
|
|
2131
2137
|
return unwrap20(data);
|
|
2132
2138
|
}
|
|
2133
2139
|
/** Update an egress policy by id. */
|
|
2134
2140
|
async updatePolicy(policyId, params) {
|
|
2135
|
-
const
|
|
2141
|
+
const body3 = stripUndefined7({
|
|
2136
2142
|
mode: params.mode,
|
|
2137
2143
|
default_effect: pickFirst2(params.defaultEffect, params.default_effect),
|
|
2138
2144
|
name: params.name,
|
|
@@ -2140,7 +2146,7 @@ var EgressNetwork = class {
|
|
|
2140
2146
|
});
|
|
2141
2147
|
const data = await this.http.patch(
|
|
2142
2148
|
`/egress/policies/${policyId}`,
|
|
2143
|
-
|
|
2149
|
+
body3
|
|
2144
2150
|
);
|
|
2145
2151
|
return unwrap20(data);
|
|
2146
2152
|
}
|
|
@@ -2160,28 +2166,28 @@ var EgressNetwork = class {
|
|
|
2160
2166
|
if (policyId) {
|
|
2161
2167
|
return this.updatePolicy(policyId, { mode });
|
|
2162
2168
|
}
|
|
2163
|
-
const
|
|
2169
|
+
const body3 = resourceId !== void 0 && resourceType !== void 0 ? stripUndefined7({
|
|
2164
2170
|
mode,
|
|
2165
2171
|
resource_id: resourceId,
|
|
2166
2172
|
resource_type: resourceType
|
|
2167
2173
|
}) : { mode };
|
|
2168
2174
|
const data = await this.http.patch(
|
|
2169
2175
|
"/egress/policies",
|
|
2170
|
-
|
|
2176
|
+
body3
|
|
2171
2177
|
);
|
|
2172
2178
|
return unwrap20(data);
|
|
2173
2179
|
}
|
|
2174
2180
|
// ── suggestions ───────────────────────────────────────────────────────────
|
|
2175
2181
|
/** AI-generated allowlist suggestions from recent denied egress. */
|
|
2176
2182
|
async suggestions(params = {}) {
|
|
2177
|
-
const
|
|
2183
|
+
const query2 = stripUndefined7({
|
|
2178
2184
|
resource_id: pickFirst2(params.resourceId, params.resource_id),
|
|
2179
2185
|
resource_type: pickFirst2(params.resourceType, params.resource_type),
|
|
2180
2186
|
since: params.since ?? "7d"
|
|
2181
2187
|
});
|
|
2182
2188
|
const data = await this.http.get(
|
|
2183
2189
|
"/egress/audit/suggestions",
|
|
2184
|
-
|
|
2190
|
+
query2
|
|
2185
2191
|
);
|
|
2186
2192
|
return unwrapList9(data);
|
|
2187
2193
|
}
|
|
@@ -2225,28 +2231,28 @@ var SandboxNetwork = class {
|
|
|
2225
2231
|
return this.delegate.removeRule(ruleId);
|
|
2226
2232
|
}
|
|
2227
2233
|
lockdown(params = {}) {
|
|
2228
|
-
const
|
|
2234
|
+
const body3 = {
|
|
2229
2235
|
resource_id: this.resourceId,
|
|
2230
2236
|
resource_type: this.resourceType
|
|
2231
2237
|
};
|
|
2232
|
-
if (params.policyId !== void 0)
|
|
2233
|
-
return this.delegate.lockdown(
|
|
2238
|
+
if (params.policyId !== void 0) body3.policyId = params.policyId;
|
|
2239
|
+
return this.delegate.lockdown(body3);
|
|
2234
2240
|
}
|
|
2235
2241
|
observe(params = {}) {
|
|
2236
|
-
const
|
|
2242
|
+
const body3 = {
|
|
2237
2243
|
resource_id: this.resourceId,
|
|
2238
2244
|
resource_type: this.resourceType
|
|
2239
2245
|
};
|
|
2240
|
-
if (params.policyId !== void 0)
|
|
2241
|
-
return this.delegate.observe(
|
|
2246
|
+
if (params.policyId !== void 0) body3.policyId = params.policyId;
|
|
2247
|
+
return this.delegate.observe(body3);
|
|
2242
2248
|
}
|
|
2243
2249
|
suggestions(params = {}) {
|
|
2244
|
-
const
|
|
2250
|
+
const body3 = {
|
|
2245
2251
|
resource_id: this.resourceId,
|
|
2246
2252
|
resource_type: this.resourceType
|
|
2247
2253
|
};
|
|
2248
|
-
if (params.since !== void 0)
|
|
2249
|
-
return this.delegate.suggestions(
|
|
2254
|
+
if (params.since !== void 0) body3.since = params.since;
|
|
2255
|
+
return this.delegate.suggestions(body3);
|
|
2250
2256
|
}
|
|
2251
2257
|
policies() {
|
|
2252
2258
|
return this.delegate.policies({
|
|
@@ -2447,10 +2453,10 @@ var EgressSecrets = class {
|
|
|
2447
2453
|
}
|
|
2448
2454
|
/** Rotate the secret's value. */
|
|
2449
2455
|
async rotate(id, params) {
|
|
2450
|
-
const
|
|
2456
|
+
const body3 = typeof params === "string" ? rotateBody({ newValue: params }) : rotateBody(params);
|
|
2451
2457
|
const data = await this.http.patch(
|
|
2452
2458
|
`/egress/secrets/${id}`,
|
|
2453
|
-
|
|
2459
|
+
body3
|
|
2454
2460
|
);
|
|
2455
2461
|
return unwrap21(data);
|
|
2456
2462
|
}
|
|
@@ -3062,12 +3068,12 @@ var ComputerInbox = class {
|
|
|
3062
3068
|
return unwrapData(raw);
|
|
3063
3069
|
}
|
|
3064
3070
|
async update(fields) {
|
|
3065
|
-
const
|
|
3071
|
+
const body3 = Object.fromEntries(
|
|
3066
3072
|
Object.entries(fields).filter(([, v]) => v !== void 0)
|
|
3067
3073
|
);
|
|
3068
3074
|
const raw = await this.http.patch(
|
|
3069
3075
|
`/computers/${this.computerId}/inbox`,
|
|
3070
|
-
|
|
3076
|
+
body3
|
|
3071
3077
|
);
|
|
3072
3078
|
return unwrapData(raw);
|
|
3073
3079
|
}
|
|
@@ -3366,12 +3372,12 @@ var Computer = class _Computer {
|
|
|
3366
3372
|
}
|
|
3367
3373
|
/** Clone this computer into a new one. */
|
|
3368
3374
|
async clone(opts = {}) {
|
|
3369
|
-
const
|
|
3375
|
+
const body3 = Object.fromEntries(
|
|
3370
3376
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
3371
3377
|
);
|
|
3372
3378
|
const raw = await this.http.post(
|
|
3373
3379
|
`/computers/${this.id}/clone`,
|
|
3374
|
-
|
|
3380
|
+
body3
|
|
3375
3381
|
);
|
|
3376
3382
|
const data = unwrapData(raw);
|
|
3377
3383
|
return new _Computer(this.http, data);
|
|
@@ -3387,12 +3393,12 @@ var Computer = class _Computer {
|
|
|
3387
3393
|
}
|
|
3388
3394
|
/** Move the computer to a different region or host. */
|
|
3389
3395
|
async move(opts) {
|
|
3390
|
-
const
|
|
3396
|
+
const body3 = Object.fromEntries(
|
|
3391
3397
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
3392
3398
|
);
|
|
3393
3399
|
const updated = await this.http.post(
|
|
3394
3400
|
`/computers/${this.id}/move`,
|
|
3395
|
-
|
|
3401
|
+
body3
|
|
3396
3402
|
);
|
|
3397
3403
|
this.data = updated;
|
|
3398
3404
|
return this;
|
|
@@ -3474,12 +3480,12 @@ var Computers = class {
|
|
|
3474
3480
|
agentRuntimeProfileId,
|
|
3475
3481
|
agentProfileId,
|
|
3476
3482
|
skipAgentRuntimeProfile,
|
|
3477
|
-
...
|
|
3483
|
+
...body3
|
|
3478
3484
|
} = params;
|
|
3479
3485
|
const data = await this.http.post("/computers", {
|
|
3480
3486
|
template_type: "miosa-desktop",
|
|
3481
3487
|
size: "small",
|
|
3482
|
-
...
|
|
3488
|
+
...body3,
|
|
3483
3489
|
agent_runtime_profile_id: agentRuntimeProfileId ?? params.agent_runtime_profile_id ?? agentProfileId ?? params.agent_profile_id,
|
|
3484
3490
|
skip_agent_runtime_profile: skipAgentRuntimeProfile ?? params.skip_agent_runtime_profile
|
|
3485
3491
|
});
|
|
@@ -3489,14 +3495,14 @@ var Computers = class {
|
|
|
3489
3495
|
* List all computers for the authenticated tenant.
|
|
3490
3496
|
*/
|
|
3491
3497
|
async list(params) {
|
|
3492
|
-
const
|
|
3498
|
+
const query2 = {
|
|
3493
3499
|
page: params?.page,
|
|
3494
3500
|
per_page: params?.per_page,
|
|
3495
3501
|
status: params?.status
|
|
3496
3502
|
};
|
|
3497
3503
|
const response = await this.http.get(
|
|
3498
3504
|
"/computers",
|
|
3499
|
-
|
|
3505
|
+
query2
|
|
3500
3506
|
);
|
|
3501
3507
|
return response.data.map((d) => new Computer(this.http, d));
|
|
3502
3508
|
}
|
|
@@ -3537,13 +3543,13 @@ var Credits = class {
|
|
|
3537
3543
|
}
|
|
3538
3544
|
/** List credit transactions (purchases, deductions). */
|
|
3539
3545
|
async transactions(params) {
|
|
3540
|
-
const
|
|
3546
|
+
const query2 = {
|
|
3541
3547
|
page: params?.page,
|
|
3542
3548
|
per_page: params?.per_page
|
|
3543
3549
|
};
|
|
3544
3550
|
return this.http.get(
|
|
3545
3551
|
"/credits/transactions",
|
|
3546
|
-
|
|
3552
|
+
query2
|
|
3547
3553
|
);
|
|
3548
3554
|
}
|
|
3549
3555
|
/** Get aggregated credit usage for the current billing period. */
|
|
@@ -3581,8 +3587,8 @@ var CronJobs = class {
|
|
|
3581
3587
|
}
|
|
3582
3588
|
http;
|
|
3583
3589
|
async list(params = {}) {
|
|
3584
|
-
const
|
|
3585
|
-
const data = await this.http.get("/cron-jobs",
|
|
3590
|
+
const query2 = stripUndefined9({ ...params });
|
|
3591
|
+
const data = await this.http.get("/cron-jobs", query2);
|
|
3586
3592
|
return listItems2(data);
|
|
3587
3593
|
}
|
|
3588
3594
|
async get(jobId) {
|
|
@@ -3591,17 +3597,17 @@ var CronJobs = class {
|
|
|
3591
3597
|
}
|
|
3592
3598
|
async create(params) {
|
|
3593
3599
|
const { idempotencyKey: ikey, ...rest } = params;
|
|
3594
|
-
const
|
|
3600
|
+
const body3 = stripUndefined9(rest);
|
|
3595
3601
|
const data = await this.http.request("/cron-jobs", {
|
|
3596
3602
|
method: "POST",
|
|
3597
|
-
body:
|
|
3603
|
+
body: body3,
|
|
3598
3604
|
headers: { "Idempotency-Key": idempotencyKey2(ikey) }
|
|
3599
3605
|
});
|
|
3600
3606
|
return unwrap22(data);
|
|
3601
3607
|
}
|
|
3602
3608
|
async update(jobId, params) {
|
|
3603
|
-
const
|
|
3604
|
-
const data = await this.http.patch(`/cron-jobs/${jobId}`,
|
|
3609
|
+
const body3 = stripUndefined9(params);
|
|
3610
|
+
const data = await this.http.patch(`/cron-jobs/${jobId}`, body3);
|
|
3605
3611
|
return unwrap22(data);
|
|
3606
3612
|
}
|
|
3607
3613
|
async delete(jobId) {
|
|
@@ -3699,8 +3705,8 @@ var Databases = class {
|
|
|
3699
3705
|
}
|
|
3700
3706
|
http;
|
|
3701
3707
|
async list(params = {}) {
|
|
3702
|
-
const
|
|
3703
|
-
const data = await this.http.get("/databases",
|
|
3708
|
+
const query2 = stripUndefined10({ ...params });
|
|
3709
|
+
const data = await this.http.get("/databases", query2);
|
|
3704
3710
|
return listItems3(data);
|
|
3705
3711
|
}
|
|
3706
3712
|
async get(databaseId) {
|
|
@@ -3716,13 +3722,13 @@ var Databases = class {
|
|
|
3716
3722
|
size: _deprecatedSize,
|
|
3717
3723
|
...rest
|
|
3718
3724
|
} = params;
|
|
3719
|
-
const
|
|
3725
|
+
const body3 = stripUndefined10({
|
|
3720
3726
|
...rest,
|
|
3721
3727
|
engine_version: engine_version ?? version
|
|
3722
3728
|
});
|
|
3723
3729
|
const data = await this.http.request("/databases", {
|
|
3724
3730
|
method: "POST",
|
|
3725
|
-
body:
|
|
3731
|
+
body: body3,
|
|
3726
3732
|
headers: {
|
|
3727
3733
|
"Idempotency-Key": idempotencyKey3(
|
|
3728
3734
|
camelIdempotencyKey ?? snakeIdempotencyKey
|
|
@@ -3759,13 +3765,13 @@ var Databases = class {
|
|
|
3759
3765
|
return unwrap24(data);
|
|
3760
3766
|
}
|
|
3761
3767
|
async logs(databaseId, params = {}) {
|
|
3762
|
-
const
|
|
3768
|
+
const query2 = stripUndefined10({
|
|
3763
3769
|
lines: params.lines,
|
|
3764
3770
|
since: params.since
|
|
3765
3771
|
});
|
|
3766
3772
|
const data = await this.http.get(
|
|
3767
3773
|
`/databases/${databaseId}/logs`,
|
|
3768
|
-
|
|
3774
|
+
query2
|
|
3769
3775
|
);
|
|
3770
3776
|
return data;
|
|
3771
3777
|
}
|
|
@@ -3857,7 +3863,7 @@ var DeploymentVersions = class {
|
|
|
3857
3863
|
http;
|
|
3858
3864
|
deploymentId;
|
|
3859
3865
|
async list(params = {}) {
|
|
3860
|
-
const
|
|
3866
|
+
const query2 = stripUndefined11({
|
|
3861
3867
|
state: params.state,
|
|
3862
3868
|
limit: params.limit,
|
|
3863
3869
|
cursor: params.cursor,
|
|
@@ -3865,7 +3871,7 @@ var DeploymentVersions = class {
|
|
|
3865
3871
|
});
|
|
3866
3872
|
const data = await this.http.get(
|
|
3867
3873
|
`/deployments/${this.deploymentId}/versions`,
|
|
3868
|
-
|
|
3874
|
+
query2
|
|
3869
3875
|
);
|
|
3870
3876
|
return listItems4(data);
|
|
3871
3877
|
}
|
|
@@ -3876,12 +3882,12 @@ var DeploymentVersions = class {
|
|
|
3876
3882
|
return unwrap25(data);
|
|
3877
3883
|
}
|
|
3878
3884
|
async promote(versionId, opts = {}) {
|
|
3879
|
-
const
|
|
3885
|
+
const body3 = stripUndefined11({ environment: opts.environment });
|
|
3880
3886
|
const data = await this.http.request(
|
|
3881
3887
|
`/deployments/${this.deploymentId}/versions/${versionId}/promote`,
|
|
3882
3888
|
{
|
|
3883
3889
|
method: "POST",
|
|
3884
|
-
body:
|
|
3890
|
+
body: body3,
|
|
3885
3891
|
headers: { "Idempotency-Key": idempotencyKey4(opts.idempotencyKey) }
|
|
3886
3892
|
}
|
|
3887
3893
|
);
|
|
@@ -3954,7 +3960,7 @@ var DeploymentDomains = class {
|
|
|
3954
3960
|
http;
|
|
3955
3961
|
deploymentId;
|
|
3956
3962
|
async add(domain, params = {}) {
|
|
3957
|
-
const
|
|
3963
|
+
const body3 = {
|
|
3958
3964
|
domain,
|
|
3959
3965
|
redirect_policy: params.redirectPolicy ?? params.redirect_policy,
|
|
3960
3966
|
...attributionBody(params)
|
|
@@ -3963,7 +3969,7 @@ var DeploymentDomains = class {
|
|
|
3963
3969
|
`/deployments/${this.deploymentId}/domains`,
|
|
3964
3970
|
{
|
|
3965
3971
|
method: "POST",
|
|
3966
|
-
body: stripUndefined11(
|
|
3972
|
+
body: stripUndefined11(body3),
|
|
3967
3973
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
3968
3974
|
}
|
|
3969
3975
|
);
|
|
@@ -3995,7 +4001,7 @@ var Deployments = class {
|
|
|
3995
4001
|
http;
|
|
3996
4002
|
async list(params = {}) {
|
|
3997
4003
|
const projectId = params.projectId ?? params.project_id;
|
|
3998
|
-
const
|
|
4004
|
+
const query2 = stripUndefined11({
|
|
3999
4005
|
project_id: projectId,
|
|
4000
4006
|
state: params.state,
|
|
4001
4007
|
limit: params.limit,
|
|
@@ -4004,7 +4010,7 @@ var Deployments = class {
|
|
|
4004
4010
|
});
|
|
4005
4011
|
const data = await this.http.get(
|
|
4006
4012
|
"/deployments",
|
|
4007
|
-
|
|
4013
|
+
query2
|
|
4008
4014
|
);
|
|
4009
4015
|
return listItems4(data);
|
|
4010
4016
|
}
|
|
@@ -4013,7 +4019,7 @@ var Deployments = class {
|
|
|
4013
4019
|
return unwrap25(data);
|
|
4014
4020
|
}
|
|
4015
4021
|
async create(params) {
|
|
4016
|
-
const
|
|
4022
|
+
const body3 = stripUndefined11({
|
|
4017
4023
|
name: params.name,
|
|
4018
4024
|
repo_url: params.repoUrl ?? params.repo_url,
|
|
4019
4025
|
branch: params.branch,
|
|
@@ -4026,7 +4032,7 @@ var Deployments = class {
|
|
|
4026
4032
|
});
|
|
4027
4033
|
const data = await this.http.request("/deployments", {
|
|
4028
4034
|
method: "POST",
|
|
4029
|
-
body:
|
|
4035
|
+
body: body3,
|
|
4030
4036
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
4031
4037
|
});
|
|
4032
4038
|
return unwrap25(data);
|
|
@@ -4176,7 +4182,7 @@ var Deployments = class {
|
|
|
4176
4182
|
};
|
|
4177
4183
|
}
|
|
4178
4184
|
async update(deploymentId, params) {
|
|
4179
|
-
const
|
|
4185
|
+
const body3 = stripUndefined11({
|
|
4180
4186
|
name: params.name,
|
|
4181
4187
|
branch: params.branch,
|
|
4182
4188
|
build_command: params.buildCommand ?? params.build_command,
|
|
@@ -4185,7 +4191,7 @@ var Deployments = class {
|
|
|
4185
4191
|
});
|
|
4186
4192
|
const data = await this.http.patch(
|
|
4187
4193
|
`/deployments/${deploymentId}`,
|
|
4188
|
-
|
|
4194
|
+
body3
|
|
4189
4195
|
);
|
|
4190
4196
|
return unwrap25(data);
|
|
4191
4197
|
}
|
|
@@ -4193,7 +4199,7 @@ var Deployments = class {
|
|
|
4193
4199
|
await this.http.delete(`/deployments/${deploymentId}`);
|
|
4194
4200
|
}
|
|
4195
4201
|
async publish(deploymentId, params) {
|
|
4196
|
-
const
|
|
4202
|
+
const body3 = stripUndefined11({
|
|
4197
4203
|
source_sandbox_id: params.sourceSandboxId ?? params.source_sandbox_id,
|
|
4198
4204
|
output_path: params.outputPath ?? params.output_path,
|
|
4199
4205
|
entrypoint: params.entrypoint,
|
|
@@ -4203,7 +4209,7 @@ var Deployments = class {
|
|
|
4203
4209
|
`/deployments/${deploymentId}/publish`,
|
|
4204
4210
|
{
|
|
4205
4211
|
method: "POST",
|
|
4206
|
-
body:
|
|
4212
|
+
body: body3,
|
|
4207
4213
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
4208
4214
|
}
|
|
4209
4215
|
);
|
|
@@ -4215,7 +4221,7 @@ var Deployments = class {
|
|
|
4215
4221
|
* phase. Prefer `publish()` once Phase 2B/3 lands.
|
|
4216
4222
|
*/
|
|
4217
4223
|
async publishFromSandbox(sandboxId, params = {}) {
|
|
4218
|
-
const
|
|
4224
|
+
const body3 = stripUndefined11({
|
|
4219
4225
|
name: params.name,
|
|
4220
4226
|
deployment_id: params.deploymentId ?? params.deployment_id,
|
|
4221
4227
|
output_path: params.outputPath ?? params.output_path,
|
|
@@ -4228,21 +4234,21 @@ var Deployments = class {
|
|
|
4228
4234
|
`/sandboxes/${sandboxId}/deploy`,
|
|
4229
4235
|
{
|
|
4230
4236
|
method: "POST",
|
|
4231
|
-
body:
|
|
4237
|
+
body: body3,
|
|
4232
4238
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
4233
4239
|
}
|
|
4234
4240
|
);
|
|
4235
4241
|
return unwrap25(data);
|
|
4236
4242
|
}
|
|
4237
4243
|
async rollback(deploymentId, params = {}) {
|
|
4238
|
-
const
|
|
4244
|
+
const body3 = stripUndefined11({
|
|
4239
4245
|
version_id: params.versionId ?? params.version_id
|
|
4240
4246
|
});
|
|
4241
4247
|
const data = await this.http.request(
|
|
4242
4248
|
`/deployments/${deploymentId}/rollback`,
|
|
4243
4249
|
{
|
|
4244
4250
|
method: "POST",
|
|
4245
|
-
body:
|
|
4251
|
+
body: body3,
|
|
4246
4252
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
4247
4253
|
}
|
|
4248
4254
|
);
|
|
@@ -4267,10 +4273,10 @@ var Deployments = class {
|
|
|
4267
4273
|
return listItems4(data);
|
|
4268
4274
|
}
|
|
4269
4275
|
async setEnv(deploymentId, vars, opts = {}) {
|
|
4270
|
-
const
|
|
4276
|
+
const body3 = stripUndefined11({ env: vars, environment: opts.environment });
|
|
4271
4277
|
const data = await this.http.post(
|
|
4272
4278
|
`/deployments/${deploymentId}/env`,
|
|
4273
|
-
|
|
4279
|
+
body3
|
|
4274
4280
|
);
|
|
4275
4281
|
return listItems4(data);
|
|
4276
4282
|
}
|
|
@@ -4296,12 +4302,12 @@ function workspaceId(params) {
|
|
|
4296
4302
|
return params?.workspace_id ?? params?.workspaceId;
|
|
4297
4303
|
}
|
|
4298
4304
|
function ensureBody(params) {
|
|
4299
|
-
const
|
|
4305
|
+
const body3 = {};
|
|
4300
4306
|
const id = params.workspace_id ?? params.workspaceId;
|
|
4301
4307
|
const externalId = params.external_workspace_id ?? params.externalWorkspaceId;
|
|
4302
|
-
if (id)
|
|
4303
|
-
if (externalId)
|
|
4304
|
-
return
|
|
4308
|
+
if (id) body3.workspace_id = id;
|
|
4309
|
+
if (externalId) body3.external_workspace_id = externalId;
|
|
4310
|
+
return body3;
|
|
4305
4311
|
}
|
|
4306
4312
|
function unwrapHost(response) {
|
|
4307
4313
|
const host = response.data ?? response.host;
|
|
@@ -4546,12 +4552,12 @@ var Embeddings = class {
|
|
|
4546
4552
|
* `{ object: "list", data: [...], model, usage }`.
|
|
4547
4553
|
*/
|
|
4548
4554
|
async create(params) {
|
|
4549
|
-
const
|
|
4555
|
+
const body3 = Object.fromEntries(
|
|
4550
4556
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
4551
4557
|
);
|
|
4552
4558
|
return this.http.post(
|
|
4553
4559
|
"/intelligence/embeddings",
|
|
4554
|
-
|
|
4560
|
+
body3
|
|
4555
4561
|
);
|
|
4556
4562
|
}
|
|
4557
4563
|
};
|
|
@@ -4585,8 +4591,8 @@ var ExternalKeys = class {
|
|
|
4585
4591
|
}
|
|
4586
4592
|
/** Create / register an external provider key. */
|
|
4587
4593
|
async create(params) {
|
|
4588
|
-
const
|
|
4589
|
-
const data = await this.http.post("/external-keys",
|
|
4594
|
+
const body3 = stripUndefined12(params);
|
|
4595
|
+
const data = await this.http.post("/external-keys", body3);
|
|
4590
4596
|
return unwrap27(data);
|
|
4591
4597
|
}
|
|
4592
4598
|
/** Resolve (preview) the stored key for a provider. */
|
|
@@ -4634,8 +4640,8 @@ var FlatCustomDomains = class {
|
|
|
4634
4640
|
}
|
|
4635
4641
|
http;
|
|
4636
4642
|
async list(params = {}) {
|
|
4637
|
-
const
|
|
4638
|
-
const data = await this.http.get("/custom-domains",
|
|
4643
|
+
const query2 = stripUndefined13({ ...params });
|
|
4644
|
+
const data = await this.http.get("/custom-domains", query2);
|
|
4639
4645
|
return listItems5(data);
|
|
4640
4646
|
}
|
|
4641
4647
|
async create(params) {
|
|
@@ -4646,7 +4652,7 @@ var FlatCustomDomains = class {
|
|
|
4646
4652
|
redirectPolicy,
|
|
4647
4653
|
...rest
|
|
4648
4654
|
} = params;
|
|
4649
|
-
const
|
|
4655
|
+
const body3 = stripUndefined13({
|
|
4650
4656
|
...rest,
|
|
4651
4657
|
resource_type: resourceType ?? rest.resource_type,
|
|
4652
4658
|
resource_id: resourceId ?? rest.resource_id,
|
|
@@ -4654,7 +4660,7 @@ var FlatCustomDomains = class {
|
|
|
4654
4660
|
});
|
|
4655
4661
|
const data = await this.http.request("/custom-domains", {
|
|
4656
4662
|
method: "POST",
|
|
4657
|
-
body:
|
|
4663
|
+
body: body3,
|
|
4658
4664
|
headers: { "Idempotency-Key": idempotencyKey5(ikey) }
|
|
4659
4665
|
});
|
|
4660
4666
|
return unwrap28(data);
|
|
@@ -4693,8 +4699,8 @@ var Functions = class {
|
|
|
4693
4699
|
}
|
|
4694
4700
|
http;
|
|
4695
4701
|
async list(params = {}) {
|
|
4696
|
-
const
|
|
4697
|
-
const data = await this.http.get("/functions",
|
|
4702
|
+
const query2 = stripUndefined14({ ...params });
|
|
4703
|
+
const data = await this.http.get("/functions", query2);
|
|
4698
4704
|
return listItems6(data);
|
|
4699
4705
|
}
|
|
4700
4706
|
async get(functionId) {
|
|
@@ -4703,28 +4709,28 @@ var Functions = class {
|
|
|
4703
4709
|
}
|
|
4704
4710
|
async create(params) {
|
|
4705
4711
|
const { idempotencyKey: ikey, memoryMb, timeoutSec, ...rest } = params;
|
|
4706
|
-
const
|
|
4712
|
+
const body3 = stripUndefined14({
|
|
4707
4713
|
...rest,
|
|
4708
4714
|
memory_mb: memoryMb ?? rest.memory_mb,
|
|
4709
4715
|
timeout_sec: timeoutSec ?? rest.timeout_sec
|
|
4710
4716
|
});
|
|
4711
4717
|
const data = await this.http.request("/functions", {
|
|
4712
4718
|
method: "POST",
|
|
4713
|
-
body:
|
|
4719
|
+
body: body3,
|
|
4714
4720
|
headers: { "Idempotency-Key": idempotencyKey6(ikey) }
|
|
4715
4721
|
});
|
|
4716
4722
|
return unwrap29(data);
|
|
4717
4723
|
}
|
|
4718
4724
|
async update(functionId, params) {
|
|
4719
4725
|
const { memoryMb, timeoutSec, ...rest } = params;
|
|
4720
|
-
const
|
|
4726
|
+
const body3 = stripUndefined14({
|
|
4721
4727
|
...rest,
|
|
4722
4728
|
memory_mb: memoryMb ?? rest.memory_mb,
|
|
4723
4729
|
timeout_sec: timeoutSec ?? rest.timeout_sec
|
|
4724
4730
|
});
|
|
4725
4731
|
const data = await this.http.patch(
|
|
4726
4732
|
`/functions/${functionId}`,
|
|
4727
|
-
|
|
4733
|
+
body3
|
|
4728
4734
|
);
|
|
4729
4735
|
return unwrap29(data);
|
|
4730
4736
|
}
|
|
@@ -4777,8 +4783,8 @@ var HealthChecks = class {
|
|
|
4777
4783
|
}
|
|
4778
4784
|
http;
|
|
4779
4785
|
async list(params = {}) {
|
|
4780
|
-
const
|
|
4781
|
-
const data = await this.http.get("/health-checks",
|
|
4786
|
+
const query2 = stripUndefined15({ ...params });
|
|
4787
|
+
const data = await this.http.get("/health-checks", query2);
|
|
4782
4788
|
return listItems7(data);
|
|
4783
4789
|
}
|
|
4784
4790
|
async get(checkId) {
|
|
@@ -4793,7 +4799,7 @@ var HealthChecks = class {
|
|
|
4793
4799
|
expectedStatus,
|
|
4794
4800
|
...rest
|
|
4795
4801
|
} = params;
|
|
4796
|
-
const
|
|
4802
|
+
const body3 = stripUndefined15({
|
|
4797
4803
|
...rest,
|
|
4798
4804
|
interval_sec: intervalSec ?? rest.interval_sec,
|
|
4799
4805
|
timeout_sec: timeoutSec ?? rest.timeout_sec,
|
|
@@ -4801,14 +4807,14 @@ var HealthChecks = class {
|
|
|
4801
4807
|
});
|
|
4802
4808
|
const data = await this.http.request("/health-checks", {
|
|
4803
4809
|
method: "POST",
|
|
4804
|
-
body:
|
|
4810
|
+
body: body3,
|
|
4805
4811
|
headers: { "Idempotency-Key": idempotencyKey7(ikey) }
|
|
4806
4812
|
});
|
|
4807
4813
|
return unwrap30(data);
|
|
4808
4814
|
}
|
|
4809
4815
|
async update(checkId, params) {
|
|
4810
4816
|
const { intervalSec, timeoutSec, expectedStatus, ...rest } = params;
|
|
4811
|
-
const
|
|
4817
|
+
const body3 = stripUndefined15({
|
|
4812
4818
|
...rest,
|
|
4813
4819
|
interval_sec: intervalSec ?? rest.interval_sec,
|
|
4814
4820
|
timeout_sec: timeoutSec ?? rest.timeout_sec,
|
|
@@ -4816,7 +4822,7 @@ var HealthChecks = class {
|
|
|
4816
4822
|
});
|
|
4817
4823
|
const data = await this.http.patch(
|
|
4818
4824
|
`/health-checks/${checkId}`,
|
|
4819
|
-
|
|
4825
|
+
body3
|
|
4820
4826
|
);
|
|
4821
4827
|
return unwrap30(data);
|
|
4822
4828
|
}
|
|
@@ -4892,19 +4898,19 @@ var Integrations = class {
|
|
|
4892
4898
|
// ── Test hooks ─────────────────────────────────────────────────────────────
|
|
4893
4899
|
/** Send a test message to the connected Slack channel. */
|
|
4894
4900
|
async slackSendTest(params = {}) {
|
|
4895
|
-
const
|
|
4901
|
+
const body3 = stripUndefined16(params);
|
|
4896
4902
|
const data = await this.http.post(
|
|
4897
4903
|
"/integrations/slack/send-test",
|
|
4898
|
-
|
|
4904
|
+
body3
|
|
4899
4905
|
);
|
|
4900
4906
|
return unwrap31(data);
|
|
4901
4907
|
}
|
|
4902
4908
|
/** Send a test message to the connected Discord channel. */
|
|
4903
4909
|
async discordSendTest(params = {}) {
|
|
4904
|
-
const
|
|
4910
|
+
const body3 = stripUndefined16(params);
|
|
4905
4911
|
const data = await this.http.post(
|
|
4906
4912
|
"/integrations/discord/send-test",
|
|
4907
|
-
|
|
4913
|
+
body3
|
|
4908
4914
|
);
|
|
4909
4915
|
return unwrap31(data);
|
|
4910
4916
|
}
|
|
@@ -4916,10 +4922,10 @@ var Integrations = class {
|
|
|
4916
4922
|
}
|
|
4917
4923
|
/** Create a Linear issue via the connected workspace. */
|
|
4918
4924
|
async linearCreateIssue(params = {}) {
|
|
4919
|
-
const
|
|
4925
|
+
const body3 = stripUndefined16(params);
|
|
4920
4926
|
const data = await this.http.post(
|
|
4921
4927
|
"/integrations/linear/create-issue",
|
|
4922
|
-
|
|
4928
|
+
body3
|
|
4923
4929
|
);
|
|
4924
4930
|
return unwrap31(data);
|
|
4925
4931
|
}
|
|
@@ -4947,10 +4953,10 @@ var Mcp = class {
|
|
|
4947
4953
|
http;
|
|
4948
4954
|
/** Send a JSON-RPC request to the MCP endpoint. */
|
|
4949
4955
|
async dispatch(params = {}) {
|
|
4950
|
-
const
|
|
4956
|
+
const body3 = stripUndefined17(params);
|
|
4951
4957
|
const data = await this.http.post(
|
|
4952
4958
|
"/mcp",
|
|
4953
|
-
Object.keys(
|
|
4959
|
+
Object.keys(body3).length > 0 ? body3 : void 0
|
|
4954
4960
|
);
|
|
4955
4961
|
return unwrap32(data);
|
|
4956
4962
|
}
|
|
@@ -4988,10 +4994,10 @@ var Models = class {
|
|
|
4988
4994
|
http;
|
|
4989
4995
|
/** List all models available to the calling tenant (OpenAI-compatible shape). */
|
|
4990
4996
|
async list(filters = {}) {
|
|
4991
|
-
const
|
|
4997
|
+
const query2 = Object.fromEntries(
|
|
4992
4998
|
Object.entries(filters).filter(([, v]) => v !== void 0)
|
|
4993
4999
|
);
|
|
4994
|
-
const data = await this.http.get("/intelligence/models",
|
|
5000
|
+
const data = await this.http.get("/intelligence/models", query2);
|
|
4995
5001
|
return unwrap33(data);
|
|
4996
5002
|
}
|
|
4997
5003
|
/**
|
|
@@ -5677,8 +5683,8 @@ var ProjectAuth = class {
|
|
|
5677
5683
|
}
|
|
5678
5684
|
/** Enable project auth. */
|
|
5679
5685
|
async enable(params) {
|
|
5680
|
-
const
|
|
5681
|
-
const data = await this.http.post("/project-auth/enable",
|
|
5686
|
+
const body3 = requestBody(params);
|
|
5687
|
+
const data = await this.http.post("/project-auth/enable", body3);
|
|
5682
5688
|
return unwrap34(data);
|
|
5683
5689
|
}
|
|
5684
5690
|
/** Disable project auth. */
|
|
@@ -5691,8 +5697,8 @@ var ProjectAuth = class {
|
|
|
5691
5697
|
}
|
|
5692
5698
|
/** Update project-auth configuration. */
|
|
5693
5699
|
async update(params) {
|
|
5694
|
-
const
|
|
5695
|
-
const data = await this.http.patch("/project-auth/config",
|
|
5700
|
+
const body3 = requestBody(params);
|
|
5701
|
+
const data = await this.http.patch("/project-auth/config", body3);
|
|
5696
5702
|
return unwrap34(data);
|
|
5697
5703
|
}
|
|
5698
5704
|
};
|
|
@@ -5729,8 +5735,8 @@ var ProjectIntegrations = class {
|
|
|
5729
5735
|
http;
|
|
5730
5736
|
/** List project integrations. */
|
|
5731
5737
|
async list(params = {}) {
|
|
5732
|
-
const
|
|
5733
|
-
const data = await this.http.get("/project-integrations",
|
|
5738
|
+
const query2 = stripUndefined19(params);
|
|
5739
|
+
const data = await this.http.get("/project-integrations", query2);
|
|
5734
5740
|
return listItems9(data);
|
|
5735
5741
|
}
|
|
5736
5742
|
/** List supported providers and their schemas. */
|
|
@@ -5747,16 +5753,16 @@ var ProjectIntegrations = class {
|
|
|
5747
5753
|
}
|
|
5748
5754
|
/** Create a project integration. */
|
|
5749
5755
|
async create(params) {
|
|
5750
|
-
const
|
|
5751
|
-
const data = await this.http.post("/project-integrations",
|
|
5756
|
+
const body3 = stripUndefObj2(params);
|
|
5757
|
+
const data = await this.http.post("/project-integrations", body3);
|
|
5752
5758
|
return unwrap35(data);
|
|
5753
5759
|
}
|
|
5754
5760
|
/** Update a project integration. */
|
|
5755
5761
|
async update(integrationId, params) {
|
|
5756
|
-
const
|
|
5762
|
+
const body3 = stripUndefObj2(params);
|
|
5757
5763
|
const data = await this.http.patch(
|
|
5758
5764
|
`/project-integrations/${integrationId}`,
|
|
5759
|
-
|
|
5765
|
+
body3
|
|
5760
5766
|
);
|
|
5761
5767
|
return unwrap35(data);
|
|
5762
5768
|
}
|
|
@@ -5796,11 +5802,11 @@ var ProviderDefaults = class {
|
|
|
5796
5802
|
}
|
|
5797
5803
|
/** Replace the fleet-wide defaults (PUT /admin/provider-defaults). */
|
|
5798
5804
|
async update(opts) {
|
|
5799
|
-
const
|
|
5805
|
+
const body3 = Object.fromEntries(
|
|
5800
5806
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
5801
5807
|
);
|
|
5802
5808
|
return unwrap36(
|
|
5803
|
-
await this.http.put("/admin/provider-defaults",
|
|
5809
|
+
await this.http.put("/admin/provider-defaults", body3)
|
|
5804
5810
|
);
|
|
5805
5811
|
}
|
|
5806
5812
|
// ── Per-tenant overrides ────────────────────────────────────────────────
|
|
@@ -5812,13 +5818,13 @@ var ProviderDefaults = class {
|
|
|
5812
5818
|
);
|
|
5813
5819
|
}
|
|
5814
5820
|
async setTenant(tenantId, opts) {
|
|
5815
|
-
const
|
|
5821
|
+
const body3 = Object.fromEntries(
|
|
5816
5822
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
5817
5823
|
);
|
|
5818
5824
|
return unwrap36(
|
|
5819
5825
|
await this.http.put(
|
|
5820
5826
|
`/admin/tenants/${tenantId}/provider-config`,
|
|
5821
|
-
|
|
5827
|
+
body3
|
|
5822
5828
|
)
|
|
5823
5829
|
);
|
|
5824
5830
|
}
|
|
@@ -5883,6 +5889,86 @@ var Regions = class {
|
|
|
5883
5889
|
}
|
|
5884
5890
|
};
|
|
5885
5891
|
|
|
5892
|
+
// src/resources/runtime-env.ts
|
|
5893
|
+
function unwrap38(payload) {
|
|
5894
|
+
if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
|
|
5895
|
+
return payload.data;
|
|
5896
|
+
}
|
|
5897
|
+
return payload;
|
|
5898
|
+
}
|
|
5899
|
+
function body2(params) {
|
|
5900
|
+
return Object.fromEntries(
|
|
5901
|
+
Object.entries({
|
|
5902
|
+
scope: params.scope,
|
|
5903
|
+
workspace_id: params.workspaceId ?? params.workspace_id,
|
|
5904
|
+
project_id: params.projectId ?? params.project_id,
|
|
5905
|
+
target: params.target,
|
|
5906
|
+
name: params.name,
|
|
5907
|
+
value: params.value,
|
|
5908
|
+
enabled: params.enabled,
|
|
5909
|
+
metadata: params.metadata
|
|
5910
|
+
}).filter(([, value]) => value !== void 0)
|
|
5911
|
+
);
|
|
5912
|
+
}
|
|
5913
|
+
function query(params) {
|
|
5914
|
+
return {
|
|
5915
|
+
scope: params.scope,
|
|
5916
|
+
workspace_id: params.workspaceId ?? params.workspace_id,
|
|
5917
|
+
project_id: params.projectId ?? params.project_id,
|
|
5918
|
+
target: params.target
|
|
5919
|
+
};
|
|
5920
|
+
}
|
|
5921
|
+
function normalize2(row) {
|
|
5922
|
+
const tenantId = row.tenantId ?? row.tenant_id;
|
|
5923
|
+
const workspaceId2 = row.workspaceId ?? row.workspace_id;
|
|
5924
|
+
const projectId = row.projectId ?? row.project_id;
|
|
5925
|
+
const createdAt = row.createdAt ?? row.created_at;
|
|
5926
|
+
const updatedAt = row.updatedAt ?? row.updated_at;
|
|
5927
|
+
return {
|
|
5928
|
+
...row,
|
|
5929
|
+
...tenantId !== void 0 ? { tenantId } : {},
|
|
5930
|
+
...workspaceId2 !== void 0 ? { workspaceId: workspaceId2 } : {},
|
|
5931
|
+
...projectId !== void 0 ? { projectId } : {},
|
|
5932
|
+
...createdAt !== void 0 ? { createdAt } : {},
|
|
5933
|
+
...updatedAt !== void 0 ? { updatedAt } : {}
|
|
5934
|
+
};
|
|
5935
|
+
}
|
|
5936
|
+
var RuntimeEnv = class {
|
|
5937
|
+
constructor(http) {
|
|
5938
|
+
this.http = http;
|
|
5939
|
+
}
|
|
5940
|
+
http;
|
|
5941
|
+
async list(params = {}) {
|
|
5942
|
+
const response = await this.http.get(
|
|
5943
|
+
"/runtime-env",
|
|
5944
|
+
query(params)
|
|
5945
|
+
);
|
|
5946
|
+
return unwrap38(response).map(normalize2);
|
|
5947
|
+
}
|
|
5948
|
+
async get(id) {
|
|
5949
|
+
return normalize2(
|
|
5950
|
+
unwrap38(
|
|
5951
|
+
await this.http.get(
|
|
5952
|
+
`/runtime-env/${encodeURIComponent(id)}`
|
|
5953
|
+
)
|
|
5954
|
+
)
|
|
5955
|
+
);
|
|
5956
|
+
}
|
|
5957
|
+
async set(params) {
|
|
5958
|
+
return normalize2(
|
|
5959
|
+
unwrap38(
|
|
5960
|
+
await this.http.post(
|
|
5961
|
+
"/runtime-env",
|
|
5962
|
+
body2(params)
|
|
5963
|
+
)
|
|
5964
|
+
)
|
|
5965
|
+
);
|
|
5966
|
+
}
|
|
5967
|
+
async delete(id) {
|
|
5968
|
+
await this.http.delete(`/runtime-env/${encodeURIComponent(id)}`);
|
|
5969
|
+
}
|
|
5970
|
+
};
|
|
5971
|
+
|
|
5886
5972
|
// src/resources/sandboxes.ts
|
|
5887
5973
|
function encodeContent(content) {
|
|
5888
5974
|
const bytes = typeof content === "string" ? new TextEncoder().encode(content) : content;
|
|
@@ -5897,7 +5983,7 @@ var AGENT_WORKSPACE_TIMEOUT_SEC = 86400;
|
|
|
5897
5983
|
var AGENT_WORKSPACE_IDLE_TIMEOUT_SEC = 1800;
|
|
5898
5984
|
var AGENT_WORKSPACE_SNAPSHOT_EXPIRATION_DAYS = 30;
|
|
5899
5985
|
var AGENT_WORKSPACE_KEEP_LAST_SNAPSHOTS = 1;
|
|
5900
|
-
function
|
|
5986
|
+
function unwrap39(payload) {
|
|
5901
5987
|
if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
|
|
5902
5988
|
return payload.data;
|
|
5903
5989
|
}
|
|
@@ -6120,11 +6206,11 @@ var SandboxTerminal = class {
|
|
|
6120
6206
|
}
|
|
6121
6207
|
sandbox;
|
|
6122
6208
|
async create(params = {}) {
|
|
6123
|
-
const
|
|
6209
|
+
const body3 = Object.fromEntries(
|
|
6124
6210
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
6125
6211
|
);
|
|
6126
|
-
const response =
|
|
6127
|
-
await this.sandbox.http.post(`/sandboxes/${this.sandbox.id}/terminal`,
|
|
6212
|
+
const response = unwrap39(
|
|
6213
|
+
await this.sandbox.http.post(`/sandboxes/${this.sandbox.id}/terminal`, body3)
|
|
6128
6214
|
);
|
|
6129
6215
|
return response;
|
|
6130
6216
|
}
|
|
@@ -6166,21 +6252,21 @@ var SandboxPreviews = class {
|
|
|
6166
6252
|
return [];
|
|
6167
6253
|
}
|
|
6168
6254
|
async create(port, opts = {}) {
|
|
6169
|
-
const
|
|
6255
|
+
const body3 = {
|
|
6170
6256
|
port,
|
|
6171
6257
|
...Object.fromEntries(
|
|
6172
6258
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
6173
6259
|
)
|
|
6174
6260
|
};
|
|
6175
|
-
return
|
|
6261
|
+
return unwrap39(
|
|
6176
6262
|
await this.http.post(
|
|
6177
6263
|
`/sandboxes/${this.sandbox.id}/previews`,
|
|
6178
|
-
|
|
6264
|
+
body3
|
|
6179
6265
|
)
|
|
6180
6266
|
);
|
|
6181
6267
|
}
|
|
6182
6268
|
async get(previewId) {
|
|
6183
|
-
return
|
|
6269
|
+
return unwrap39(
|
|
6184
6270
|
await this.http.get(
|
|
6185
6271
|
`/sandboxes/${this.sandbox.id}/previews/${previewId}`
|
|
6186
6272
|
)
|
|
@@ -6193,7 +6279,7 @@ var SandboxPreviews = class {
|
|
|
6193
6279
|
}
|
|
6194
6280
|
/** Mint a share token for previewId. */
|
|
6195
6281
|
async share(previewId, opts = {}) {
|
|
6196
|
-
return
|
|
6282
|
+
return unwrap39(
|
|
6197
6283
|
await this.http.post(
|
|
6198
6284
|
`/sandboxes/${this.sandbox.id}/previews/${previewId}/share`,
|
|
6199
6285
|
{ ttl_seconds: opts.ttl_seconds ?? opts.expires_in_sec ?? 3600 }
|
|
@@ -6262,7 +6348,7 @@ var SandboxTags = class {
|
|
|
6262
6348
|
sandbox;
|
|
6263
6349
|
/** Replace the full tag list with tags. */
|
|
6264
6350
|
async set(tags) {
|
|
6265
|
-
return
|
|
6351
|
+
return unwrap39(
|
|
6266
6352
|
await this.sandbox.http.patch(`/sandboxes/${this.sandbox.id}/tags`, { tags })
|
|
6267
6353
|
);
|
|
6268
6354
|
}
|
|
@@ -6330,14 +6416,14 @@ var Sandbox = class _Sandbox {
|
|
|
6330
6416
|
return this.data.template_id ?? this.data.image_id ?? "";
|
|
6331
6417
|
}
|
|
6332
6418
|
async refresh() {
|
|
6333
|
-
this.data =
|
|
6419
|
+
this.data = unwrap39(
|
|
6334
6420
|
await this.http.get(`/sandboxes/${this.id}`)
|
|
6335
6421
|
);
|
|
6336
6422
|
return this;
|
|
6337
6423
|
}
|
|
6338
6424
|
async runExec(command, options) {
|
|
6339
6425
|
this.assertRunning("exec");
|
|
6340
|
-
const response =
|
|
6426
|
+
const response = unwrap39(
|
|
6341
6427
|
await this.http.post(
|
|
6342
6428
|
`/sandboxes/${this.id}/exec`,
|
|
6343
6429
|
execBody(command, options)
|
|
@@ -6381,25 +6467,25 @@ var Sandbox = class _Sandbox {
|
|
|
6381
6467
|
);
|
|
6382
6468
|
}
|
|
6383
6469
|
async createExport(params) {
|
|
6384
|
-
const
|
|
6385
|
-
const response =
|
|
6470
|
+
const body3 = typeof params === "string" ? { path: params } : Array.isArray(params) ? { paths: params } : params;
|
|
6471
|
+
const response = unwrap39(
|
|
6386
6472
|
await this.http.post(
|
|
6387
6473
|
`/sandboxes/${this.id}/exports`,
|
|
6388
|
-
|
|
6474
|
+
body3
|
|
6389
6475
|
)
|
|
6390
6476
|
);
|
|
6391
6477
|
return normalizeExport(response);
|
|
6392
6478
|
}
|
|
6393
6479
|
async downloadExport(paths, options = {}) {
|
|
6394
|
-
const
|
|
6480
|
+
const query2 = new URLSearchParams();
|
|
6395
6481
|
if (Array.isArray(paths)) {
|
|
6396
|
-
for (const path of paths)
|
|
6482
|
+
for (const path of paths) query2.append("paths[]", path);
|
|
6397
6483
|
} else {
|
|
6398
|
-
|
|
6484
|
+
query2.set("path", paths);
|
|
6399
6485
|
}
|
|
6400
|
-
if (options.filename)
|
|
6486
|
+
if (options.filename) query2.set("filename", options.filename);
|
|
6401
6487
|
return this.http.getBinary(
|
|
6402
|
-
`/sandboxes/${this.id}/exports/download?${
|
|
6488
|
+
`/sandboxes/${this.id}/exports/download?${query2.toString()}`
|
|
6403
6489
|
);
|
|
6404
6490
|
}
|
|
6405
6491
|
async readFile(path) {
|
|
@@ -6407,7 +6493,7 @@ var Sandbox = class _Sandbox {
|
|
|
6407
6493
|
}
|
|
6408
6494
|
async listFiles(path = "/workspace") {
|
|
6409
6495
|
this.assertRunning("files.list");
|
|
6410
|
-
const response =
|
|
6496
|
+
const response = unwrap39(
|
|
6411
6497
|
await this.http.get(
|
|
6412
6498
|
`/sandboxes/${this.id}/files`,
|
|
6413
6499
|
{ path }
|
|
@@ -6417,7 +6503,7 @@ var Sandbox = class _Sandbox {
|
|
|
6417
6503
|
}
|
|
6418
6504
|
async statFile(path) {
|
|
6419
6505
|
this.assertRunning("files.stat");
|
|
6420
|
-
return
|
|
6506
|
+
return unwrap39(
|
|
6421
6507
|
await this.http.post(
|
|
6422
6508
|
`/sandboxes/${this.id}/files/stat`,
|
|
6423
6509
|
{ path }
|
|
@@ -6426,7 +6512,7 @@ var Sandbox = class _Sandbox {
|
|
|
6426
6512
|
}
|
|
6427
6513
|
async expose(port) {
|
|
6428
6514
|
this.assertRunning("expose");
|
|
6429
|
-
const response =
|
|
6515
|
+
const response = unwrap39(
|
|
6430
6516
|
await this.http.post(
|
|
6431
6517
|
`/sandboxes/${this.id}/expose`,
|
|
6432
6518
|
port === void 0 ? {} : { port }
|
|
@@ -6436,7 +6522,7 @@ var Sandbox = class _Sandbox {
|
|
|
6436
6522
|
}
|
|
6437
6523
|
async startTemplate(options = {}) {
|
|
6438
6524
|
this.assertRunning("startTemplate");
|
|
6439
|
-
return
|
|
6525
|
+
return unwrap39(
|
|
6440
6526
|
await this.http.post(
|
|
6441
6527
|
`/sandboxes/${this.id}/template/start`,
|
|
6442
6528
|
options
|
|
@@ -6444,7 +6530,7 @@ var Sandbox = class _Sandbox {
|
|
|
6444
6530
|
);
|
|
6445
6531
|
}
|
|
6446
6532
|
async getArtifacts() {
|
|
6447
|
-
return
|
|
6533
|
+
return unwrap39(
|
|
6448
6534
|
await this.http.get(
|
|
6449
6535
|
`/sandboxes/${this.id}/artifacts`
|
|
6450
6536
|
)
|
|
@@ -6455,7 +6541,7 @@ var Sandbox = class _Sandbox {
|
|
|
6455
6541
|
`/sandboxes/${this.id}/logs`,
|
|
6456
6542
|
{ lines }
|
|
6457
6543
|
);
|
|
6458
|
-
return
|
|
6544
|
+
return unwrap39(response);
|
|
6459
6545
|
}
|
|
6460
6546
|
streamLogs() {
|
|
6461
6547
|
return this.http.stream(
|
|
@@ -6464,7 +6550,7 @@ var Sandbox = class _Sandbox {
|
|
|
6464
6550
|
}
|
|
6465
6551
|
async createSnapshot(comment) {
|
|
6466
6552
|
this.assertRunning("snapshots.create");
|
|
6467
|
-
return
|
|
6553
|
+
return unwrap39(
|
|
6468
6554
|
await this.http.post(
|
|
6469
6555
|
`/sandboxes/${this.id}/snapshots`,
|
|
6470
6556
|
comment ? { comment } : {}
|
|
@@ -6472,14 +6558,14 @@ var Sandbox = class _Sandbox {
|
|
|
6472
6558
|
);
|
|
6473
6559
|
}
|
|
6474
6560
|
async listSnapshots() {
|
|
6475
|
-
return
|
|
6561
|
+
return unwrap39(
|
|
6476
6562
|
await this.http.get(
|
|
6477
6563
|
`/sandboxes/${this.id}/snapshots`
|
|
6478
6564
|
)
|
|
6479
6565
|
);
|
|
6480
6566
|
}
|
|
6481
6567
|
async restoreSnapshot(snapshotId) {
|
|
6482
|
-
const data =
|
|
6568
|
+
const data = unwrap39(
|
|
6483
6569
|
await this.http.post(
|
|
6484
6570
|
`/sandboxes/${this.id}/restore/${snapshotId}`,
|
|
6485
6571
|
{}
|
|
@@ -6496,13 +6582,13 @@ var Sandbox = class _Sandbox {
|
|
|
6496
6582
|
*/
|
|
6497
6583
|
async fork(opts = {}) {
|
|
6498
6584
|
this.assertRunning("fork");
|
|
6499
|
-
const
|
|
6500
|
-
if (opts.name !== void 0)
|
|
6501
|
-
if (opts.metadata !== void 0)
|
|
6502
|
-
const data =
|
|
6585
|
+
const body3 = {};
|
|
6586
|
+
if (opts.name !== void 0) body3.name = opts.name;
|
|
6587
|
+
if (opts.metadata !== void 0) body3.metadata = opts.metadata;
|
|
6588
|
+
const data = unwrap39(
|
|
6503
6589
|
await this.http.post(
|
|
6504
6590
|
`/sandboxes/${this.id}/fork`,
|
|
6505
|
-
|
|
6591
|
+
body3
|
|
6506
6592
|
)
|
|
6507
6593
|
);
|
|
6508
6594
|
return new _Sandbox(this.http, data);
|
|
@@ -6521,7 +6607,7 @@ var Sandbox = class _Sandbox {
|
|
|
6521
6607
|
if (keepLastSnapshots !== void 0) {
|
|
6522
6608
|
metadata.keep_last_snapshots = keepLastSnapshots;
|
|
6523
6609
|
}
|
|
6524
|
-
const
|
|
6610
|
+
const body3 = stripUndefined20({
|
|
6525
6611
|
name: params.name,
|
|
6526
6612
|
slug: params.slug,
|
|
6527
6613
|
tags: params.tags,
|
|
@@ -6530,17 +6616,17 @@ var Sandbox = class _Sandbox {
|
|
|
6530
6616
|
timeout_sec: params.timeout_sec ?? params.timeoutSec,
|
|
6531
6617
|
idle_timeout_sec: params.idle_timeout_sec ?? params.idleTimeoutSec
|
|
6532
6618
|
});
|
|
6533
|
-
const data =
|
|
6619
|
+
const data = unwrap39(
|
|
6534
6620
|
await this.http.patch(
|
|
6535
6621
|
`/sandboxes/${this.id}`,
|
|
6536
|
-
|
|
6622
|
+
body3
|
|
6537
6623
|
)
|
|
6538
6624
|
);
|
|
6539
6625
|
this.data = data;
|
|
6540
6626
|
return this;
|
|
6541
6627
|
}
|
|
6542
6628
|
async extend(timeoutSec) {
|
|
6543
|
-
const data =
|
|
6629
|
+
const data = unwrap39(
|
|
6544
6630
|
await this.http.post(
|
|
6545
6631
|
`/sandboxes/${this.id}/extend`,
|
|
6546
6632
|
{ timeout_sec: timeoutSec }
|
|
@@ -6563,7 +6649,7 @@ var Sandbox = class _Sandbox {
|
|
|
6563
6649
|
return raw;
|
|
6564
6650
|
}
|
|
6565
6651
|
async pause() {
|
|
6566
|
-
const data =
|
|
6652
|
+
const data = unwrap39(
|
|
6567
6653
|
await this.http.post(
|
|
6568
6654
|
`/sandboxes/${this.id}/pause`,
|
|
6569
6655
|
{}
|
|
@@ -6573,7 +6659,7 @@ var Sandbox = class _Sandbox {
|
|
|
6573
6659
|
return this;
|
|
6574
6660
|
}
|
|
6575
6661
|
async resume() {
|
|
6576
|
-
const data =
|
|
6662
|
+
const data = unwrap39(
|
|
6577
6663
|
await this.http.post(
|
|
6578
6664
|
`/sandboxes/${this.id}/resume`,
|
|
6579
6665
|
{}
|
|
@@ -6609,7 +6695,7 @@ var Sandbox = class _Sandbox {
|
|
|
6609
6695
|
if (idempotencyKey11) {
|
|
6610
6696
|
requestOptions.headers = { "Idempotency-Key": idempotencyKey11 };
|
|
6611
6697
|
}
|
|
6612
|
-
return
|
|
6698
|
+
return unwrap39(
|
|
6613
6699
|
await this.http.request(
|
|
6614
6700
|
`/sandboxes/${this.id}/deploy`,
|
|
6615
6701
|
requestOptions
|
|
@@ -6621,7 +6707,7 @@ var Sandbox = class _Sandbox {
|
|
|
6621
6707
|
}
|
|
6622
6708
|
/** Check readiness of the sandbox (GET /sandboxes/:id/readiness). */
|
|
6623
6709
|
async readiness() {
|
|
6624
|
-
return
|
|
6710
|
+
return unwrap39(
|
|
6625
6711
|
await this.http.get(
|
|
6626
6712
|
`/sandboxes/${this.id}/readiness`
|
|
6627
6713
|
)
|
|
@@ -6789,7 +6875,7 @@ var Sandboxes = class {
|
|
|
6789
6875
|
if (idempotencyKey11) {
|
|
6790
6876
|
requestOptions.headers = { "Idempotency-Key": idempotencyKey11 };
|
|
6791
6877
|
}
|
|
6792
|
-
const data =
|
|
6878
|
+
const data = unwrap39(
|
|
6793
6879
|
await this.http.request(
|
|
6794
6880
|
"/sandboxes",
|
|
6795
6881
|
requestOptions
|
|
@@ -6808,7 +6894,7 @@ var Sandboxes = class {
|
|
|
6808
6894
|
return listItems11(data).map((item) => new Sandbox(this.http, item));
|
|
6809
6895
|
}
|
|
6810
6896
|
async get(id) {
|
|
6811
|
-
const data =
|
|
6897
|
+
const data = unwrap39(
|
|
6812
6898
|
await this.http.get(`/sandboxes/${id}`)
|
|
6813
6899
|
);
|
|
6814
6900
|
return new Sandbox(this.http, data);
|
|
@@ -6817,7 +6903,7 @@ var Sandboxes = class {
|
|
|
6817
6903
|
return this.get(id);
|
|
6818
6904
|
}
|
|
6819
6905
|
async getByName(name) {
|
|
6820
|
-
const data =
|
|
6906
|
+
const data = unwrap39(
|
|
6821
6907
|
await this.http.get(
|
|
6822
6908
|
`/sandboxes/by-name/${encodeURIComponent(name)}`
|
|
6823
6909
|
)
|
|
@@ -6882,7 +6968,7 @@ var Sandboxes = class {
|
|
|
6882
6968
|
metadata: params.metadata
|
|
6883
6969
|
})
|
|
6884
6970
|
);
|
|
6885
|
-
return
|
|
6971
|
+
return unwrap39(response);
|
|
6886
6972
|
}
|
|
6887
6973
|
async createTemplateBuild(templateId, params = {}) {
|
|
6888
6974
|
const response = await this.http.post(
|
|
@@ -6892,19 +6978,19 @@ var Sandboxes = class {
|
|
|
6892
6978
|
metadata: params.metadata
|
|
6893
6979
|
})
|
|
6894
6980
|
);
|
|
6895
|
-
return
|
|
6981
|
+
return unwrap39(response);
|
|
6896
6982
|
}
|
|
6897
6983
|
async listTemplateBuilds(templateId) {
|
|
6898
6984
|
const response = await this.http.get(
|
|
6899
6985
|
`/sandbox-templates/${templateId}/builds`
|
|
6900
6986
|
);
|
|
6901
|
-
return
|
|
6987
|
+
return unwrap39(response);
|
|
6902
6988
|
}
|
|
6903
6989
|
async getTemplateBuild(buildId) {
|
|
6904
6990
|
const response = await this.http.get(
|
|
6905
6991
|
`/sandbox-template-builds/${buildId}`
|
|
6906
6992
|
);
|
|
6907
|
-
return
|
|
6993
|
+
return unwrap39(response);
|
|
6908
6994
|
}
|
|
6909
6995
|
};
|
|
6910
6996
|
function toBase642(bytes) {
|
|
@@ -6916,7 +7002,7 @@ function toBase642(bytes) {
|
|
|
6916
7002
|
}
|
|
6917
7003
|
return btoa(binary);
|
|
6918
7004
|
}
|
|
6919
|
-
function
|
|
7005
|
+
function unwrap40(payload) {
|
|
6920
7006
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
6921
7007
|
return payload.data;
|
|
6922
7008
|
}
|
|
@@ -6947,8 +7033,8 @@ var SandboxTemplates = class {
|
|
|
6947
7033
|
http;
|
|
6948
7034
|
async list(params = {}) {
|
|
6949
7035
|
const includeAliases = params.includeAliases ?? params.include_aliases ?? false;
|
|
6950
|
-
const
|
|
6951
|
-
const data = await this.http.get("/sandbox-templates",
|
|
7036
|
+
const query2 = includeAliases ? { include_aliases: true } : void 0;
|
|
7037
|
+
const data = await this.http.get("/sandbox-templates", query2);
|
|
6952
7038
|
return listItems12(data, [
|
|
6953
7039
|
"data",
|
|
6954
7040
|
"templates",
|
|
@@ -6959,7 +7045,7 @@ var SandboxTemplates = class {
|
|
|
6959
7045
|
const data = await this.http.get(
|
|
6960
7046
|
`/sandbox-templates/${templateId}`
|
|
6961
7047
|
);
|
|
6962
|
-
return
|
|
7048
|
+
return unwrap40(data);
|
|
6963
7049
|
}
|
|
6964
7050
|
async create(params) {
|
|
6965
7051
|
const {
|
|
@@ -6969,17 +7055,17 @@ var SandboxTemplates = class {
|
|
|
6969
7055
|
name,
|
|
6970
7056
|
...rest
|
|
6971
7057
|
} = params;
|
|
6972
|
-
const
|
|
7058
|
+
const body3 = stripUndefined21({
|
|
6973
7059
|
name,
|
|
6974
7060
|
build_spec: buildSpec ?? build_spec,
|
|
6975
7061
|
...rest
|
|
6976
7062
|
});
|
|
6977
7063
|
const data = await this.http.request("/sandbox-templates", {
|
|
6978
7064
|
method: "POST",
|
|
6979
|
-
body:
|
|
7065
|
+
body: body3,
|
|
6980
7066
|
headers: { "Idempotency-Key": idempotencyKey8(ikey) }
|
|
6981
7067
|
});
|
|
6982
|
-
return
|
|
7068
|
+
return unwrap40(data);
|
|
6983
7069
|
}
|
|
6984
7070
|
async buildSpecSchema() {
|
|
6985
7071
|
const data = await this.http.get("/sandbox-templates/build-spec");
|
|
@@ -7003,21 +7089,21 @@ var SandboxTemplates = class {
|
|
|
7003
7089
|
}
|
|
7004
7090
|
async createBuild(templateId, params = {}) {
|
|
7005
7091
|
const { idempotencyKey: ikey, ...rest } = params;
|
|
7006
|
-
const
|
|
7092
|
+
const body3 = stripUndefined21(rest);
|
|
7007
7093
|
const data = await this.http.request(
|
|
7008
7094
|
`/sandbox-templates/${templateId}/builds`,
|
|
7009
7095
|
{
|
|
7010
7096
|
method: "POST",
|
|
7011
|
-
body:
|
|
7097
|
+
body: body3,
|
|
7012
7098
|
headers: { "Idempotency-Key": idempotencyKey8(ikey) }
|
|
7013
7099
|
}
|
|
7014
7100
|
);
|
|
7015
|
-
return
|
|
7101
|
+
return unwrap40(data);
|
|
7016
7102
|
}
|
|
7017
7103
|
};
|
|
7018
7104
|
|
|
7019
7105
|
// src/resources/settings.ts
|
|
7020
|
-
function
|
|
7106
|
+
function unwrap41(payload) {
|
|
7021
7107
|
if (payload && typeof payload === "object") {
|
|
7022
7108
|
const p = payload;
|
|
7023
7109
|
for (const k of [
|
|
@@ -7033,7 +7119,7 @@ function unwrap40(payload) {
|
|
|
7033
7119
|
return payload;
|
|
7034
7120
|
}
|
|
7035
7121
|
function listItems13(payload) {
|
|
7036
|
-
const result =
|
|
7122
|
+
const result = unwrap41(payload);
|
|
7037
7123
|
if (Array.isArray(result)) return result;
|
|
7038
7124
|
return [];
|
|
7039
7125
|
}
|
|
@@ -7050,46 +7136,46 @@ var Settings = class {
|
|
|
7050
7136
|
/** Get the current tenant settings. */
|
|
7051
7137
|
async get() {
|
|
7052
7138
|
const data = await this.http.get("/settings");
|
|
7053
|
-
return
|
|
7139
|
+
return unwrap41(data);
|
|
7054
7140
|
}
|
|
7055
7141
|
/** Update tenant settings. */
|
|
7056
7142
|
async update(params) {
|
|
7057
|
-
const
|
|
7058
|
-
const data = await this.http.put("/settings",
|
|
7059
|
-
return
|
|
7143
|
+
const body3 = stripUndefined22(params);
|
|
7144
|
+
const data = await this.http.put("/settings", body3);
|
|
7145
|
+
return unwrap41(data);
|
|
7060
7146
|
}
|
|
7061
7147
|
// ── Branding ──────────────────────────────────────────────────────────────
|
|
7062
7148
|
/** Get tenant branding (logo, colors, custom wordmark). */
|
|
7063
7149
|
async getBranding() {
|
|
7064
7150
|
const data = await this.http.get("/settings/branding");
|
|
7065
|
-
return
|
|
7151
|
+
return unwrap41(data);
|
|
7066
7152
|
}
|
|
7067
7153
|
/** Update tenant branding. */
|
|
7068
7154
|
async updateBranding(params) {
|
|
7069
|
-
const
|
|
7070
|
-
const data = await this.http.put("/settings/branding",
|
|
7071
|
-
return
|
|
7155
|
+
const body3 = stripUndefined22(params);
|
|
7156
|
+
const data = await this.http.put("/settings/branding", body3);
|
|
7157
|
+
return unwrap41(data);
|
|
7072
7158
|
}
|
|
7073
7159
|
// ── Read-only reference data ───────────────────────────────────────────────
|
|
7074
7160
|
/** Get tenant-scoped compute pricing. */
|
|
7075
7161
|
async computePricing() {
|
|
7076
7162
|
const data = await this.http.get("/settings/compute-pricing");
|
|
7077
|
-
return
|
|
7163
|
+
return unwrap41(data);
|
|
7078
7164
|
}
|
|
7079
7165
|
/** Get tenant-scoped GPU pricing. */
|
|
7080
7166
|
async gpuPricing() {
|
|
7081
7167
|
const data = await this.http.get("/settings/gpu-pricing");
|
|
7082
|
-
return
|
|
7168
|
+
return unwrap41(data);
|
|
7083
7169
|
}
|
|
7084
7170
|
/** List models available to this tenant. */
|
|
7085
7171
|
async availableModels() {
|
|
7086
7172
|
const data = await this.http.get("/settings/available-models");
|
|
7087
|
-
return
|
|
7173
|
+
return unwrap41(data);
|
|
7088
7174
|
}
|
|
7089
7175
|
/** List regions enabled for this tenant. */
|
|
7090
7176
|
async regions() {
|
|
7091
7177
|
const data = await this.http.get("/settings/regions");
|
|
7092
|
-
return
|
|
7178
|
+
return unwrap41(data);
|
|
7093
7179
|
}
|
|
7094
7180
|
// ── BYOK provider keys ────────────────────────────────────────────────────
|
|
7095
7181
|
/** List tenant-level BYOK provider keys (Anthropic, OpenAI, etc.). */
|
|
@@ -7099,12 +7185,12 @@ var Settings = class {
|
|
|
7099
7185
|
}
|
|
7100
7186
|
/** Create or update a BYOK provider key. */
|
|
7101
7187
|
async upsertProviderKey(provider, params) {
|
|
7102
|
-
const
|
|
7188
|
+
const body3 = stripUndefined22(params);
|
|
7103
7189
|
const data = await this.http.put(
|
|
7104
7190
|
`/settings/provider-keys/${provider}`,
|
|
7105
|
-
|
|
7191
|
+
body3
|
|
7106
7192
|
);
|
|
7107
|
-
return
|
|
7193
|
+
return unwrap41(data);
|
|
7108
7194
|
}
|
|
7109
7195
|
/** Delete a BYOK provider key. */
|
|
7110
7196
|
async deleteProviderKey(provider) {
|
|
@@ -7113,7 +7199,7 @@ var Settings = class {
|
|
|
7113
7199
|
};
|
|
7114
7200
|
|
|
7115
7201
|
// src/resources/snapshots-standalone.ts
|
|
7116
|
-
function
|
|
7202
|
+
function unwrap42(data) {
|
|
7117
7203
|
if (data && typeof data === "object") {
|
|
7118
7204
|
const d = data;
|
|
7119
7205
|
for (const k of ["data", "snapshots", "items"]) {
|
|
@@ -7138,20 +7224,20 @@ var SnapshotsStandalone = class {
|
|
|
7138
7224
|
}
|
|
7139
7225
|
http;
|
|
7140
7226
|
async list(filters = {}) {
|
|
7141
|
-
const
|
|
7227
|
+
const query2 = Object.fromEntries(
|
|
7142
7228
|
Object.entries(filters).filter(([, v]) => v !== void 0)
|
|
7143
7229
|
);
|
|
7144
|
-
return unwrapList12(await this.http.get("/admin/snapshots",
|
|
7230
|
+
return unwrapList12(await this.http.get("/admin/snapshots", query2));
|
|
7145
7231
|
}
|
|
7146
7232
|
async get(snapshotId) {
|
|
7147
|
-
return
|
|
7233
|
+
return unwrap42(
|
|
7148
7234
|
await this.http.get(`/admin/snapshots/${snapshotId}`)
|
|
7149
7235
|
);
|
|
7150
7236
|
}
|
|
7151
7237
|
};
|
|
7152
7238
|
|
|
7153
7239
|
// src/resources/storage.ts
|
|
7154
|
-
function
|
|
7240
|
+
function unwrap43(payload) {
|
|
7155
7241
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
7156
7242
|
return payload.data;
|
|
7157
7243
|
}
|
|
@@ -7184,31 +7270,31 @@ var Storage = class {
|
|
|
7184
7270
|
}
|
|
7185
7271
|
async createBucket(params) {
|
|
7186
7272
|
const { name, public: isPublic, visibility, ...rest } = params;
|
|
7187
|
-
const
|
|
7273
|
+
const body3 = stripUndefined23({
|
|
7188
7274
|
name,
|
|
7189
7275
|
visibility: visibility ?? (isPublic === void 0 ? void 0 : isPublic ? "public" : "private"),
|
|
7190
7276
|
...rest
|
|
7191
7277
|
});
|
|
7192
|
-
const data = await this.http.post("/storage/buckets",
|
|
7193
|
-
return
|
|
7278
|
+
const data = await this.http.post("/storage/buckets", body3);
|
|
7279
|
+
return unwrap43(data);
|
|
7194
7280
|
}
|
|
7195
7281
|
async getBucket(bucketId) {
|
|
7196
7282
|
const data = await this.http.get(`/storage/buckets/${bucketId}`);
|
|
7197
|
-
return
|
|
7283
|
+
return unwrap43(data);
|
|
7198
7284
|
}
|
|
7199
7285
|
async deleteBucket(bucketId) {
|
|
7200
7286
|
await this.http.delete(`/storage/buckets/${bucketId}`);
|
|
7201
7287
|
}
|
|
7202
7288
|
// ── Objects ────────────────────────────────────────────────────────────────
|
|
7203
7289
|
async listObjects(bucketId, params = {}) {
|
|
7204
|
-
const
|
|
7290
|
+
const query2 = stripUndefined23({
|
|
7205
7291
|
prefix: params.prefix,
|
|
7206
7292
|
max_keys: params.max_keys ?? params.maxKeys ?? params.limit,
|
|
7207
7293
|
marker: params.marker ?? params.cursor
|
|
7208
7294
|
});
|
|
7209
7295
|
const data = await this.http.get(
|
|
7210
7296
|
`/storage/buckets/${bucketId}/objects`,
|
|
7211
|
-
|
|
7297
|
+
query2
|
|
7212
7298
|
);
|
|
7213
7299
|
return listItems14(data, ["data", "objects", "items"]);
|
|
7214
7300
|
}
|
|
@@ -7235,16 +7321,16 @@ var Storage = class {
|
|
|
7235
7321
|
// ── Presigned URLs ─────────────────────────────────────────────────────────
|
|
7236
7322
|
async presign(bucketId, params) {
|
|
7237
7323
|
const operationMethod = params.operation === "put" ? "PUT" : params.operation === "get" ? "GET" : void 0;
|
|
7238
|
-
const
|
|
7324
|
+
const body3 = stripUndefined23({
|
|
7239
7325
|
key: params.key,
|
|
7240
7326
|
method: params.method ?? operationMethod ?? "GET",
|
|
7241
7327
|
expires_in: params.expiresIn ?? params.expires_in ?? params.expiresInSec ?? params.expires_in_sec ?? 3600
|
|
7242
7328
|
});
|
|
7243
7329
|
const data = await this.http.post(
|
|
7244
7330
|
`/storage/buckets/${bucketId}/presign`,
|
|
7245
|
-
|
|
7331
|
+
body3
|
|
7246
7332
|
);
|
|
7247
|
-
return
|
|
7333
|
+
return unwrap43(data);
|
|
7248
7334
|
}
|
|
7249
7335
|
};
|
|
7250
7336
|
|
|
@@ -7334,7 +7420,7 @@ var OrgInvites = class {
|
|
|
7334
7420
|
};
|
|
7335
7421
|
|
|
7336
7422
|
// src/resources/tenant.ts
|
|
7337
|
-
function
|
|
7423
|
+
function unwrap44(payload) {
|
|
7338
7424
|
if (payload && typeof payload === "object") {
|
|
7339
7425
|
const p = payload;
|
|
7340
7426
|
for (const k of ["data", "tenant", "branding", "items"]) {
|
|
@@ -7356,14 +7442,14 @@ var PreviewDomain = class {
|
|
|
7356
7442
|
/** Get the tenant's white-label preview domain settings. */
|
|
7357
7443
|
async get() {
|
|
7358
7444
|
const data = await this.http.get("/tenant/preview-domain");
|
|
7359
|
-
return
|
|
7445
|
+
return unwrap44(data);
|
|
7360
7446
|
}
|
|
7361
7447
|
/** Set the tenant's white-label preview domain. */
|
|
7362
7448
|
async set(domain) {
|
|
7363
7449
|
const data = await this.http.put("/tenant/preview-domain", {
|
|
7364
7450
|
preview_domain: domain
|
|
7365
7451
|
});
|
|
7366
|
-
return
|
|
7452
|
+
return unwrap44(data);
|
|
7367
7453
|
}
|
|
7368
7454
|
/** Re-run DNS verification for the configured preview domain. */
|
|
7369
7455
|
async verify() {
|
|
@@ -7371,7 +7457,7 @@ var PreviewDomain = class {
|
|
|
7371
7457
|
"/tenant/preview-domain/verify",
|
|
7372
7458
|
{}
|
|
7373
7459
|
);
|
|
7374
|
-
return
|
|
7460
|
+
return unwrap44(data);
|
|
7375
7461
|
}
|
|
7376
7462
|
/** Remove the tenant's custom preview domain. */
|
|
7377
7463
|
async delete() {
|
|
@@ -7386,14 +7472,14 @@ var Branding = class {
|
|
|
7386
7472
|
/** Get tenant branding used by white-label hosted surfaces. */
|
|
7387
7473
|
async get() {
|
|
7388
7474
|
const data = await this.http.get("/tenant/branding");
|
|
7389
|
-
return
|
|
7475
|
+
return unwrap44(data);
|
|
7390
7476
|
}
|
|
7391
7477
|
/** Update tenant branding used by white-label hosted surfaces. */
|
|
7392
7478
|
async set(params) {
|
|
7393
7479
|
const data = await this.http.put("/tenant/branding", {
|
|
7394
7480
|
branding: stripUndefined24(params)
|
|
7395
7481
|
});
|
|
7396
|
-
return
|
|
7482
|
+
return unwrap44(data);
|
|
7397
7483
|
}
|
|
7398
7484
|
/** Reset tenant branding to platform defaults. */
|
|
7399
7485
|
async delete() {
|
|
@@ -7415,7 +7501,7 @@ var Tenant = class {
|
|
|
7415
7501
|
/** Get the current tenant's plan, limits, and live usage counters. */
|
|
7416
7502
|
async current() {
|
|
7417
7503
|
const data = await this.http.get("/tenant/plan");
|
|
7418
|
-
return
|
|
7504
|
+
return unwrap44(data);
|
|
7419
7505
|
}
|
|
7420
7506
|
/** Convenience alias for `tenant.branding.get()`. */
|
|
7421
7507
|
async getBranding() {
|
|
@@ -7432,7 +7518,7 @@ var Tenant = class {
|
|
|
7432
7518
|
};
|
|
7433
7519
|
|
|
7434
7520
|
// src/resources/usage.ts
|
|
7435
|
-
function
|
|
7521
|
+
function unwrap45(payload) {
|
|
7436
7522
|
if (payload && typeof payload === "object") {
|
|
7437
7523
|
const p = payload;
|
|
7438
7524
|
for (const k of ["data", "usage", "sessions", "summary", "items"]) {
|
|
@@ -7454,24 +7540,24 @@ var Usage = class {
|
|
|
7454
7540
|
/** Get the current period usage summary. */
|
|
7455
7541
|
async current() {
|
|
7456
7542
|
const data = await this.http.get("/usage/summary");
|
|
7457
|
-
return
|
|
7543
|
+
return unwrap45(data);
|
|
7458
7544
|
}
|
|
7459
7545
|
/** List per-session metering events. */
|
|
7460
7546
|
async sessions(params = {}) {
|
|
7461
|
-
const
|
|
7462
|
-
const data = await this.http.get("/usage/sessions",
|
|
7463
|
-
const result =
|
|
7547
|
+
const query2 = stripUndefined25(params);
|
|
7548
|
+
const data = await this.http.get("/usage/sessions", query2);
|
|
7549
|
+
const result = unwrap45(data);
|
|
7464
7550
|
if (Array.isArray(result)) return result;
|
|
7465
7551
|
return [];
|
|
7466
7552
|
}
|
|
7467
7553
|
/** Get a usage report for a period. */
|
|
7468
7554
|
async report(params = {}) {
|
|
7469
|
-
const
|
|
7470
|
-
const data = await this.http.get("/usage/summary",
|
|
7471
|
-
return
|
|
7555
|
+
const query2 = stripUndefined25(params);
|
|
7556
|
+
const data = await this.http.get("/usage/summary", query2);
|
|
7557
|
+
return unwrap45(data);
|
|
7472
7558
|
}
|
|
7473
7559
|
};
|
|
7474
|
-
function
|
|
7560
|
+
function unwrap46(payload) {
|
|
7475
7561
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
7476
7562
|
return payload.data;
|
|
7477
7563
|
}
|
|
@@ -7501,32 +7587,32 @@ var Volumes = class {
|
|
|
7501
7587
|
}
|
|
7502
7588
|
http;
|
|
7503
7589
|
async list(params = {}) {
|
|
7504
|
-
const
|
|
7505
|
-
const data = await this.http.get("/volumes",
|
|
7590
|
+
const query2 = stripUndefined26({ ...params });
|
|
7591
|
+
const data = await this.http.get("/volumes", query2);
|
|
7506
7592
|
return listItems15(data);
|
|
7507
7593
|
}
|
|
7508
7594
|
async get(volumeId) {
|
|
7509
7595
|
const data = await this.http.get(`/volumes/${volumeId}`);
|
|
7510
|
-
return
|
|
7596
|
+
return unwrap46(data);
|
|
7511
7597
|
}
|
|
7512
7598
|
async create(params) {
|
|
7513
7599
|
const { idempotencyKey: ikey, sizeGb, ...rest } = params;
|
|
7514
|
-
const
|
|
7600
|
+
const body3 = stripUndefined26({
|
|
7515
7601
|
...rest,
|
|
7516
7602
|
size_gb: sizeGb ?? rest.size_gb
|
|
7517
7603
|
});
|
|
7518
7604
|
const data = await this.http.request("/volumes", {
|
|
7519
7605
|
method: "POST",
|
|
7520
|
-
body:
|
|
7606
|
+
body: body3,
|
|
7521
7607
|
headers: { "Idempotency-Key": idempotencyKey9(ikey) }
|
|
7522
7608
|
});
|
|
7523
|
-
return
|
|
7609
|
+
return unwrap46(data);
|
|
7524
7610
|
}
|
|
7525
7611
|
async delete(volumeId) {
|
|
7526
7612
|
await this.http.delete(`/volumes/${volumeId}`);
|
|
7527
7613
|
}
|
|
7528
7614
|
};
|
|
7529
|
-
function
|
|
7615
|
+
function unwrap47(payload) {
|
|
7530
7616
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
7531
7617
|
return payload.data;
|
|
7532
7618
|
}
|
|
@@ -7550,12 +7636,12 @@ function stripUndefined27(input) {
|
|
|
7550
7636
|
function idempotencyKey10(key) {
|
|
7551
7637
|
return key ?? randomUUID();
|
|
7552
7638
|
}
|
|
7553
|
-
function bodyBuffer(
|
|
7554
|
-
if (Buffer.isBuffer(
|
|
7555
|
-
if (typeof
|
|
7556
|
-
return Buffer.from(
|
|
7639
|
+
function bodyBuffer(body3) {
|
|
7640
|
+
if (Buffer.isBuffer(body3)) return body3;
|
|
7641
|
+
if (typeof body3 === "string") return Buffer.from(body3, "utf8");
|
|
7642
|
+
return Buffer.from(body3);
|
|
7557
7643
|
}
|
|
7558
|
-
function verifySignature(
|
|
7644
|
+
function verifySignature(body3, header, secret, toleranceSec = 300) {
|
|
7559
7645
|
const parts = Object.fromEntries(
|
|
7560
7646
|
header.split(",").map((chunk) => chunk.split("=", 2)).filter(([key, value]) => key && value)
|
|
7561
7647
|
);
|
|
@@ -7568,7 +7654,7 @@ function verifySignature(body2, header, secret, toleranceSec = 300) {
|
|
|
7568
7654
|
if (ageSec > toleranceSec) {
|
|
7569
7655
|
throw new Error("webhook timestamp too old");
|
|
7570
7656
|
}
|
|
7571
|
-
const rawBody = bodyBuffer(
|
|
7657
|
+
const rawBody = bodyBuffer(body3);
|
|
7572
7658
|
const signed = Buffer.concat([Buffer.from(`${timestamp}.`), rawBody]);
|
|
7573
7659
|
const expected = createHmac("sha256", secret).update(signed).digest("hex");
|
|
7574
7660
|
try {
|
|
@@ -7587,28 +7673,28 @@ var Webhooks = class {
|
|
|
7587
7673
|
http;
|
|
7588
7674
|
static verifySignature = verifySignature;
|
|
7589
7675
|
async list(params = {}) {
|
|
7590
|
-
const
|
|
7591
|
-
const data = await this.http.get("/webhooks",
|
|
7676
|
+
const query2 = stripUndefined27({ ...params });
|
|
7677
|
+
const data = await this.http.get("/webhooks", query2);
|
|
7592
7678
|
return listItems16(data);
|
|
7593
7679
|
}
|
|
7594
7680
|
async get(webhookId) {
|
|
7595
7681
|
const data = await this.http.get(`/webhooks/${webhookId}`);
|
|
7596
|
-
return
|
|
7682
|
+
return unwrap47(data);
|
|
7597
7683
|
}
|
|
7598
7684
|
async create(params) {
|
|
7599
7685
|
const { idempotencyKey: ikey, ...rest } = params;
|
|
7600
|
-
const
|
|
7686
|
+
const body3 = stripUndefined27(rest);
|
|
7601
7687
|
const data = await this.http.request("/webhooks", {
|
|
7602
7688
|
method: "POST",
|
|
7603
|
-
body:
|
|
7689
|
+
body: body3,
|
|
7604
7690
|
headers: { "Idempotency-Key": idempotencyKey10(ikey) }
|
|
7605
7691
|
});
|
|
7606
|
-
return
|
|
7692
|
+
return unwrap47(data);
|
|
7607
7693
|
}
|
|
7608
7694
|
async update(webhookId, params) {
|
|
7609
|
-
const
|
|
7610
|
-
const data = await this.http.patch(`/webhooks/${webhookId}`,
|
|
7611
|
-
return
|
|
7695
|
+
const body3 = stripUndefined27(params);
|
|
7696
|
+
const data = await this.http.patch(`/webhooks/${webhookId}`, body3);
|
|
7697
|
+
return unwrap47(data);
|
|
7612
7698
|
}
|
|
7613
7699
|
async delete(webhookId) {
|
|
7614
7700
|
await this.http.delete(`/webhooks/${webhookId}`);
|
|
@@ -7621,7 +7707,7 @@ var Webhooks = class {
|
|
|
7621
7707
|
headers: { "Idempotency-Key": idempotencyKey10(opts.idempotencyKey) }
|
|
7622
7708
|
}
|
|
7623
7709
|
);
|
|
7624
|
-
return
|
|
7710
|
+
return unwrap47(data);
|
|
7625
7711
|
}
|
|
7626
7712
|
async deliveries(webhookId) {
|
|
7627
7713
|
const data = await this.http.get(
|
|
@@ -7832,6 +7918,8 @@ var Miosa = class {
|
|
|
7832
7918
|
agentRuns;
|
|
7833
7919
|
/** Agent runtime profiles — tenant/workspace defaults for sandbox/computer agents. */
|
|
7834
7920
|
agentRuntimeProfiles;
|
|
7921
|
+
/** Inherited runtime env — tenant/workspace/project defaults for agent runtimes. */
|
|
7922
|
+
runtimeEnv;
|
|
7835
7923
|
/** Computer management — create, list, get, delete. */
|
|
7836
7924
|
computers;
|
|
7837
7925
|
/** Sandboxes — native code-execution environments under `/sandboxes`. */
|
|
@@ -7936,6 +8024,7 @@ var Miosa = class {
|
|
|
7936
8024
|
this.mcp = new Mcp(this.http);
|
|
7937
8025
|
this.agentRuns = new AgentRuns(this.http);
|
|
7938
8026
|
this.agentRuntimeProfiles = new AgentRuntimeProfiles(this.http);
|
|
8027
|
+
this.runtimeEnv = new RuntimeEnv(this.http);
|
|
7939
8028
|
this.computers = new Computers(this.http);
|
|
7940
8029
|
this.sandboxes = new Sandboxes(this.http);
|
|
7941
8030
|
this.deployments = new Deployments(this.http);
|
|
@@ -8057,8 +8146,8 @@ var AppAuth = class {
|
|
|
8057
8146
|
}
|
|
8058
8147
|
});
|
|
8059
8148
|
if (!resp.ok) {
|
|
8060
|
-
const
|
|
8061
|
-
throw new Error(`AppAuth me failed (${resp.status}): ${
|
|
8149
|
+
const body3 = await resp.text();
|
|
8150
|
+
throw new Error(`AppAuth me failed (${resp.status}): ${body3}`);
|
|
8062
8151
|
}
|
|
8063
8152
|
return unwrapSession(await resp.json());
|
|
8064
8153
|
}
|
|
@@ -8110,12 +8199,12 @@ var AppAuth = class {
|
|
|
8110
8199
|
return payload;
|
|
8111
8200
|
}
|
|
8112
8201
|
// ── Private ──────────────────────────────────────────────────────────────────
|
|
8113
|
-
async _post(action,
|
|
8202
|
+
async _post(action, body3) {
|
|
8114
8203
|
const url = `${this.baseUrl}/app-auth/${this.resourceType}/${this.resourceId}/${action}`;
|
|
8115
8204
|
const resp = await fetch(url, {
|
|
8116
8205
|
method: "POST",
|
|
8117
8206
|
headers: { "Content-Type": "application/json" },
|
|
8118
|
-
body: JSON.stringify(
|
|
8207
|
+
body: JSON.stringify(body3)
|
|
8119
8208
|
});
|
|
8120
8209
|
if (!resp.ok) {
|
|
8121
8210
|
const text = await resp.text();
|
|
@@ -8125,6 +8214,6 @@ var AppAuth = class {
|
|
|
8125
8214
|
}
|
|
8126
8215
|
};
|
|
8127
8216
|
|
|
8128
|
-
export { Admin, AgentRuns, AgentRuntimeProfiles, Analytics, ApiKeys, AppAuth, AuditLog, AuthError, Benchmarks, BuilderSessions, Channels, Checkpoints, CommandCenter, Community, Completions, Computer, ComputerAudit, ComputerAutoStop, ComputerEnv, ComputerInbox, ComputerLogs, ComputerNetwork, ComputerOsa, ComputerPorts, ComputerSecrets, ComputerTerminal, ComputerVolumes, Computers, Credits, CronJobs, Dashboard, Databases, DeploymentDomains, DeploymentReleases, DeploymentRuntimeInstances, DeploymentVersions, Deployments, Desktop, DockerDeploy, EgressAudit, EgressNetwork, EgressSecrets, Email, EmailCampaigns, EmailInbox, EmailTemplates, Embeddings, Exec, ExternalKeys, Files, FlatCustomDomains, Functions, HealthChecks, InsufficientCreditsError, Integrations, Mcp, Miosa, MiosaError, Models, NetworkError, NetworkPolicy, NotFoundError, OAuthFlow, OpenComputers, OrgInvites, ProjectAuth, ProjectIntegrations, ProviderDefaults, RateLimitError, Regions, SANDBOX_TEMPLATE, Sandbox, SandboxArtifacts, SandboxAudit, SandboxCommands, SandboxEnv, SandboxEvents, SandboxFiles, SandboxNetwork, SandboxPreview, SandboxPreviews, SandboxSecrets, SandboxTags, SandboxTemplates, SandboxTerminal, Sandboxes, ScopedFs, Settings, SnapshotsStandalone, Storage, Tenant, TimeoutError, Usage, ValidationError, Volumes, Webhooks, WorkspaceInvites, WorkspaceMembers, verifySignature };
|
|
8217
|
+
export { Admin, AgentRuns, AgentRuntimeProfiles, Analytics, ApiKeys, AppAuth, AuditLog, AuthError, Benchmarks, BuilderSessions, Channels, Checkpoints, CommandCenter, Community, Completions, Computer, ComputerAudit, ComputerAutoStop, ComputerEnv, ComputerInbox, ComputerLogs, ComputerNetwork, ComputerOsa, ComputerPorts, ComputerSecrets, ComputerTerminal, ComputerVolumes, Computers, Credits, CronJobs, Dashboard, Databases, DeploymentDomains, DeploymentReleases, DeploymentRuntimeInstances, DeploymentVersions, Deployments, Desktop, DockerDeploy, EgressAudit, EgressNetwork, EgressSecrets, Email, EmailCampaigns, EmailInbox, EmailTemplates, Embeddings, Exec, ExternalKeys, Files, FlatCustomDomains, Functions, HealthChecks, InsufficientCreditsError, Integrations, Mcp, Miosa, MiosaError, Models, NetworkError, NetworkPolicy, NotFoundError, OAuthFlow, OpenComputers, OrgInvites, ProjectAuth, ProjectIntegrations, ProviderDefaults, RateLimitError, Regions, RuntimeEnv, SANDBOX_TEMPLATE, Sandbox, SandboxArtifacts, SandboxAudit, SandboxCommands, SandboxEnv, SandboxEvents, SandboxFiles, SandboxNetwork, SandboxPreview, SandboxPreviews, SandboxSecrets, SandboxTags, SandboxTemplates, SandboxTerminal, Sandboxes, ScopedFs, Settings, SnapshotsStandalone, Storage, Tenant, TimeoutError, Usage, ValidationError, Volumes, Webhooks, WorkspaceInvites, WorkspaceMembers, verifySignature };
|
|
8129
8218
|
//# sourceMappingURL=index.js.map
|
|
8130
8219
|
//# sourceMappingURL=index.js.map
|