@vm0/cli 9.82.1 → 9.82.2
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/{chunk-2KN52BP2.js → chunk-2RXB3R33.js} +279 -160
- package/chunk-2RXB3R33.js.map +1 -0
- package/index.js +92 -452
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/zero.js +42 -18
- package/zero.js.map +1 -1
- package/chunk-2KN52BP2.js.map +0 -1
|
@@ -47,7 +47,7 @@ if (DSN) {
|
|
|
47
47
|
Sentry.init({
|
|
48
48
|
dsn: DSN,
|
|
49
49
|
environment: process.env.SENTRY_ENVIRONMENT ?? "production",
|
|
50
|
-
release: "9.82.
|
|
50
|
+
release: "9.82.2",
|
|
51
51
|
sendDefaultPii: false,
|
|
52
52
|
tracesSampleRate: 0,
|
|
53
53
|
shutdownTimeout: 500,
|
|
@@ -66,7 +66,7 @@ if (DSN) {
|
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
Sentry.setContext("cli", {
|
|
69
|
-
version: "9.82.
|
|
69
|
+
version: "9.82.2",
|
|
70
70
|
command: process.argv.slice(2).join(" ")
|
|
71
71
|
});
|
|
72
72
|
Sentry.setContext("runtime", {
|
|
@@ -165,6 +165,29 @@ import { homedir } from "os";
|
|
|
165
165
|
import { join } from "path";
|
|
166
166
|
import { readFile, writeFile, mkdir, unlink } from "fs/promises";
|
|
167
167
|
import { existsSync } from "fs";
|
|
168
|
+
|
|
169
|
+
// src/lib/api/cli-token.ts
|
|
170
|
+
function decodeCliTokenPayload(token) {
|
|
171
|
+
const raw = token ?? void 0;
|
|
172
|
+
if (!raw) return void 0;
|
|
173
|
+
const prefix = "vm0_sandbox_";
|
|
174
|
+
if (!raw.startsWith(prefix)) return void 0;
|
|
175
|
+
const jwt = raw.slice(prefix.length);
|
|
176
|
+
const parts = jwt.split(".");
|
|
177
|
+
if (parts.length !== 3) return void 0;
|
|
178
|
+
try {
|
|
179
|
+
const payload = JSON.parse(
|
|
180
|
+
Buffer.from(parts[1], "base64url").toString()
|
|
181
|
+
);
|
|
182
|
+
if (payload.scope === "cli" && payload.orgId && payload.userId) {
|
|
183
|
+
return payload;
|
|
184
|
+
}
|
|
185
|
+
} catch {
|
|
186
|
+
}
|
|
187
|
+
return void 0;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// src/lib/api/config.ts
|
|
168
191
|
function getConfigDir() {
|
|
169
192
|
return join(homedir(), ".vm0");
|
|
170
193
|
}
|
|
@@ -211,6 +234,9 @@ async function getApiUrl() {
|
|
|
211
234
|
async function getActiveOrg() {
|
|
212
235
|
const zeroPayload = decodeZeroTokenPayload();
|
|
213
236
|
if (zeroPayload) return zeroPayload.orgId;
|
|
237
|
+
const token = await getToken();
|
|
238
|
+
const cliPayload = decodeCliTokenPayload(token);
|
|
239
|
+
if (cliPayload) return cliPayload.orgId;
|
|
214
240
|
if (process.env.VM0_ACTIVE_ORG) {
|
|
215
241
|
return process.env.VM0_ACTIVE_ORG;
|
|
216
242
|
}
|
|
@@ -5385,6 +5411,32 @@ var imgurFirewall = {
|
|
|
5385
5411
|
]
|
|
5386
5412
|
};
|
|
5387
5413
|
|
|
5414
|
+
// ../../packages/core/src/firewalls/instagram.generated.ts
|
|
5415
|
+
var instagramFirewall = {
|
|
5416
|
+
name: "instagram",
|
|
5417
|
+
description: "Instagram Graph API",
|
|
5418
|
+
placeholders: {
|
|
5419
|
+
INSTAGRAM_ACCESS_TOKEN: "vm0placeholderInstagramAccessToken00000000000000000000a"
|
|
5420
|
+
},
|
|
5421
|
+
apis: [
|
|
5422
|
+
{
|
|
5423
|
+
base: "https://graph.instagram.com",
|
|
5424
|
+
auth: {
|
|
5425
|
+
headers: {
|
|
5426
|
+
Authorization: "Bearer ${{ secrets.INSTAGRAM_ACCESS_TOKEN }}"
|
|
5427
|
+
}
|
|
5428
|
+
},
|
|
5429
|
+
permissions: [
|
|
5430
|
+
{
|
|
5431
|
+
name: "unrestricted",
|
|
5432
|
+
description: "Allow all Instagram Graph API endpoints",
|
|
5433
|
+
rules: ["ANY /{path*}"]
|
|
5434
|
+
}
|
|
5435
|
+
]
|
|
5436
|
+
}
|
|
5437
|
+
]
|
|
5438
|
+
};
|
|
5439
|
+
|
|
5388
5440
|
// ../../packages/core/src/firewalls/instantly.generated.ts
|
|
5389
5441
|
var instantlyFirewall = {
|
|
5390
5442
|
name: "instantly",
|
|
@@ -6349,6 +6401,32 @@ var mercuryFirewall = {
|
|
|
6349
6401
|
]
|
|
6350
6402
|
};
|
|
6351
6403
|
|
|
6404
|
+
// ../../packages/core/src/firewalls/meta-ads.generated.ts
|
|
6405
|
+
var metaAdsFirewall = {
|
|
6406
|
+
name: "meta-ads",
|
|
6407
|
+
description: "Meta Ads (Facebook Graph) API",
|
|
6408
|
+
placeholders: {
|
|
6409
|
+
META_ADS_TOKEN: "vm0placeholderMetaAdsToken0000000000000000000000000000a"
|
|
6410
|
+
},
|
|
6411
|
+
apis: [
|
|
6412
|
+
{
|
|
6413
|
+
base: "https://graph.facebook.com",
|
|
6414
|
+
auth: {
|
|
6415
|
+
headers: {
|
|
6416
|
+
Authorization: "Bearer ${{ secrets.META_ADS_TOKEN }}"
|
|
6417
|
+
}
|
|
6418
|
+
},
|
|
6419
|
+
permissions: [
|
|
6420
|
+
{
|
|
6421
|
+
name: "unrestricted",
|
|
6422
|
+
description: "Allow all Meta Ads API endpoints",
|
|
6423
|
+
rules: ["ANY /{path*}"]
|
|
6424
|
+
}
|
|
6425
|
+
]
|
|
6426
|
+
}
|
|
6427
|
+
]
|
|
6428
|
+
};
|
|
6429
|
+
|
|
6352
6430
|
// ../../packages/core/src/firewalls/minimax.generated.ts
|
|
6353
6431
|
var minimaxFirewall = {
|
|
6354
6432
|
name: "minimax",
|
|
@@ -6546,6 +6624,58 @@ var openaiFirewall = {
|
|
|
6546
6624
|
]
|
|
6547
6625
|
};
|
|
6548
6626
|
|
|
6627
|
+
// ../../packages/core/src/firewalls/outlook-calendar.generated.ts
|
|
6628
|
+
var outlookCalendarFirewall = {
|
|
6629
|
+
name: "outlook-calendar",
|
|
6630
|
+
description: "Microsoft Graph API (Outlook Calendar)",
|
|
6631
|
+
placeholders: {
|
|
6632
|
+
OUTLOOK_CALENDAR_TOKEN: "vm0placeholderOutlookCalendarToken00000000000000000000a"
|
|
6633
|
+
},
|
|
6634
|
+
apis: [
|
|
6635
|
+
{
|
|
6636
|
+
base: "https://graph.microsoft.com",
|
|
6637
|
+
auth: {
|
|
6638
|
+
headers: {
|
|
6639
|
+
Authorization: "Bearer ${{ secrets.OUTLOOK_CALENDAR_TOKEN }}"
|
|
6640
|
+
}
|
|
6641
|
+
},
|
|
6642
|
+
permissions: [
|
|
6643
|
+
{
|
|
6644
|
+
name: "unrestricted",
|
|
6645
|
+
description: "Allow all Microsoft Graph API endpoints",
|
|
6646
|
+
rules: ["ANY /{path*}"]
|
|
6647
|
+
}
|
|
6648
|
+
]
|
|
6649
|
+
}
|
|
6650
|
+
]
|
|
6651
|
+
};
|
|
6652
|
+
|
|
6653
|
+
// ../../packages/core/src/firewalls/outlook-mail.generated.ts
|
|
6654
|
+
var outlookMailFirewall = {
|
|
6655
|
+
name: "outlook-mail",
|
|
6656
|
+
description: "Microsoft Graph API (Outlook Mail)",
|
|
6657
|
+
placeholders: {
|
|
6658
|
+
OUTLOOK_MAIL_TOKEN: "vm0placeholderOutlookMailToken0000000000000000000000a"
|
|
6659
|
+
},
|
|
6660
|
+
apis: [
|
|
6661
|
+
{
|
|
6662
|
+
base: "https://graph.microsoft.com",
|
|
6663
|
+
auth: {
|
|
6664
|
+
headers: {
|
|
6665
|
+
Authorization: "Bearer ${{ secrets.OUTLOOK_MAIL_TOKEN }}"
|
|
6666
|
+
}
|
|
6667
|
+
},
|
|
6668
|
+
permissions: [
|
|
6669
|
+
{
|
|
6670
|
+
name: "unrestricted",
|
|
6671
|
+
description: "Allow all Microsoft Graph API endpoints",
|
|
6672
|
+
rules: ["ANY /{path*}"]
|
|
6673
|
+
}
|
|
6674
|
+
]
|
|
6675
|
+
}
|
|
6676
|
+
]
|
|
6677
|
+
};
|
|
6678
|
+
|
|
6549
6679
|
// ../../packages/core/src/firewalls/pdf4me.generated.ts
|
|
6550
6680
|
var pdf4meFirewall = {
|
|
6551
6681
|
name: "pdf4me",
|
|
@@ -6769,6 +6899,32 @@ var productlaneFirewall = {
|
|
|
6769
6899
|
]
|
|
6770
6900
|
};
|
|
6771
6901
|
|
|
6902
|
+
// ../../packages/core/src/firewalls/prisma-postgres.generated.ts
|
|
6903
|
+
var prismaPostgresFirewall = {
|
|
6904
|
+
name: "prisma-postgres",
|
|
6905
|
+
description: "Prisma Postgres Management API",
|
|
6906
|
+
placeholders: {
|
|
6907
|
+
PRISMA_POSTGRES_TOKEN: "vm0placeholderPrismaPostgresToken0000000000000000000a"
|
|
6908
|
+
},
|
|
6909
|
+
apis: [
|
|
6910
|
+
{
|
|
6911
|
+
base: "https://api.prisma.io",
|
|
6912
|
+
auth: {
|
|
6913
|
+
headers: {
|
|
6914
|
+
Authorization: "Bearer ${{ secrets.PRISMA_POSTGRES_TOKEN }}"
|
|
6915
|
+
}
|
|
6916
|
+
},
|
|
6917
|
+
permissions: [
|
|
6918
|
+
{
|
|
6919
|
+
name: "unrestricted",
|
|
6920
|
+
description: "Allow all Prisma Postgres API endpoints",
|
|
6921
|
+
rules: ["ANY /{path*}"]
|
|
6922
|
+
}
|
|
6923
|
+
]
|
|
6924
|
+
}
|
|
6925
|
+
]
|
|
6926
|
+
};
|
|
6927
|
+
|
|
6772
6928
|
// ../../packages/core/src/firewalls/pushinator.generated.ts
|
|
6773
6929
|
var pushinatorFirewall = {
|
|
6774
6930
|
name: "pushinator",
|
|
@@ -8964,6 +9120,7 @@ var builtinFirewalls = {
|
|
|
8964
9120
|
"hugging-face": huggingFaceFirewall,
|
|
8965
9121
|
hume: humeFirewall,
|
|
8966
9122
|
imgur: imgurFirewall,
|
|
9123
|
+
instagram: instagramFirewall,
|
|
8967
9124
|
instantly: instantlyFirewall,
|
|
8968
9125
|
intercom: intercomFirewall,
|
|
8969
9126
|
"intervals-icu": intervalsIcuFirewall,
|
|
@@ -8975,11 +9132,14 @@ var builtinFirewalls = {
|
|
|
8975
9132
|
loops: loopsFirewall,
|
|
8976
9133
|
mailsac: mailsacFirewall,
|
|
8977
9134
|
mercury: mercuryFirewall,
|
|
9135
|
+
"meta-ads": metaAdsFirewall,
|
|
8978
9136
|
minimax: minimaxFirewall,
|
|
8979
9137
|
monday: mondayFirewall,
|
|
8980
9138
|
neon: neonFirewall,
|
|
8981
9139
|
notion: notionFirewall,
|
|
8982
9140
|
openai: openaiFirewall,
|
|
9141
|
+
"outlook-calendar": outlookCalendarFirewall,
|
|
9142
|
+
"outlook-mail": outlookMailFirewall,
|
|
8983
9143
|
pdf4me: pdf4meFirewall,
|
|
8984
9144
|
pdfco: pdfcoFirewall,
|
|
8985
9145
|
pdforge: pdforgeFirewall,
|
|
@@ -8988,6 +9148,7 @@ var builtinFirewalls = {
|
|
|
8988
9148
|
podchaser: podchaserFirewall,
|
|
8989
9149
|
posthog: posthogFirewall,
|
|
8990
9150
|
productlane: productlaneFirewall,
|
|
9151
|
+
"prisma-postgres": prismaPostgresFirewall,
|
|
8991
9152
|
pushinator: pushinatorFirewall,
|
|
8992
9153
|
qiita: qiitaFirewall,
|
|
8993
9154
|
reddit: redditFirewall,
|
|
@@ -16462,6 +16623,30 @@ var zeroBillingAutoRechargeContract = c29.router({
|
|
|
16462
16623
|
summary: "Update auto-recharge configuration"
|
|
16463
16624
|
}
|
|
16464
16625
|
});
|
|
16626
|
+
var invoiceSchema = z36.object({
|
|
16627
|
+
id: z36.string(),
|
|
16628
|
+
number: z36.string().nullable(),
|
|
16629
|
+
date: z36.number(),
|
|
16630
|
+
amount: z36.number(),
|
|
16631
|
+
status: z36.string().nullable(),
|
|
16632
|
+
hostedInvoiceUrl: z36.string().nullable()
|
|
16633
|
+
});
|
|
16634
|
+
var billingInvoicesResponseSchema = z36.object({
|
|
16635
|
+
invoices: z36.array(invoiceSchema)
|
|
16636
|
+
});
|
|
16637
|
+
var zeroBillingInvoicesContract = c29.router({
|
|
16638
|
+
get: {
|
|
16639
|
+
method: "GET",
|
|
16640
|
+
path: "/api/zero/billing/invoices",
|
|
16641
|
+
headers: authHeadersSchema,
|
|
16642
|
+
responses: {
|
|
16643
|
+
200: billingInvoicesResponseSchema,
|
|
16644
|
+
401: apiErrorSchema,
|
|
16645
|
+
500: apiErrorSchema
|
|
16646
|
+
},
|
|
16647
|
+
summary: "Get invoices for current org"
|
|
16648
|
+
}
|
|
16649
|
+
});
|
|
16465
16650
|
|
|
16466
16651
|
// ../../packages/core/src/contracts/zero-usage.ts
|
|
16467
16652
|
import { z as z37 } from "zod";
|
|
@@ -16846,10 +17031,12 @@ async function getClientConfig() {
|
|
|
16846
17031
|
baseHeaders,
|
|
16847
17032
|
jsonQuery: false,
|
|
16848
17033
|
api: async (args) => {
|
|
16849
|
-
const
|
|
16850
|
-
|
|
16851
|
-
|
|
17034
|
+
const [pathPart, queryPart] = args.path.split("?");
|
|
17035
|
+
const params = new URLSearchParams(queryPart ?? "");
|
|
17036
|
+
if (!params.has("org")) {
|
|
17037
|
+
params.set("org", activeOrg);
|
|
16852
17038
|
}
|
|
17039
|
+
args.path = params.toString() ? `${pathPart}?${params.toString()}` : pathPart;
|
|
16853
17040
|
return tsRestFetchApi(args);
|
|
16854
17041
|
}
|
|
16855
17042
|
};
|
|
@@ -16869,8 +17056,13 @@ function withErrorHandler(fn) {
|
|
|
16869
17056
|
} catch (error) {
|
|
16870
17057
|
if (error instanceof ApiRequestError) {
|
|
16871
17058
|
if (error.code === "UNAUTHORIZED") {
|
|
16872
|
-
|
|
16873
|
-
|
|
17059
|
+
if (process.env.ZERO_TOKEN) {
|
|
17060
|
+
console.error(chalk.red("\u2717 Authentication failed"));
|
|
17061
|
+
console.error(chalk.dim(" ZERO_TOKEN is invalid or expired"));
|
|
17062
|
+
} else {
|
|
17063
|
+
console.error(chalk.red("\u2717 Not authenticated"));
|
|
17064
|
+
console.error(chalk.dim(" Run: vm0 auth login"));
|
|
17065
|
+
}
|
|
16874
17066
|
} else {
|
|
16875
17067
|
const guidance = RUN_ERROR_GUIDANCE[error.code];
|
|
16876
17068
|
if (guidance) {
|
|
@@ -16967,80 +17159,19 @@ async function updateZeroUserPreferences(body) {
|
|
|
16967
17159
|
handleError(result, "Failed to update user preferences");
|
|
16968
17160
|
}
|
|
16969
17161
|
|
|
16970
|
-
// src/lib/api/core/http.ts
|
|
16971
|
-
async function appendOrgParam(path) {
|
|
16972
|
-
const activeOrg = await getActiveOrg();
|
|
16973
|
-
if (!activeOrg) {
|
|
16974
|
-
throw new Error(
|
|
16975
|
-
"No active organization configured. Run: zero org use <slug>"
|
|
16976
|
-
);
|
|
16977
|
-
}
|
|
16978
|
-
const queryStart = path.indexOf("?");
|
|
16979
|
-
if (queryStart !== -1) {
|
|
16980
|
-
const params = new URLSearchParams(path.slice(queryStart));
|
|
16981
|
-
if (params.has("org")) {
|
|
16982
|
-
return path;
|
|
16983
|
-
}
|
|
16984
|
-
return `${path}&org=${encodeURIComponent(activeOrg)}`;
|
|
16985
|
-
}
|
|
16986
|
-
return `${path}?org=${encodeURIComponent(activeOrg)}`;
|
|
16987
|
-
}
|
|
16988
|
-
async function getRawHeaders() {
|
|
16989
|
-
const token = await getActiveToken();
|
|
16990
|
-
if (!token) {
|
|
16991
|
-
throw new Error("Not authenticated. Run: vm0 auth login");
|
|
16992
|
-
}
|
|
16993
|
-
const headers = {
|
|
16994
|
-
Authorization: `Bearer ${token}`
|
|
16995
|
-
};
|
|
16996
|
-
const bypassSecret = process.env.VERCEL_AUTOMATION_BYPASS_SECRET;
|
|
16997
|
-
if (bypassSecret) {
|
|
16998
|
-
headers["x-vercel-protection-bypass"] = bypassSecret;
|
|
16999
|
-
}
|
|
17000
|
-
return headers;
|
|
17001
|
-
}
|
|
17002
|
-
async function httpPost(path, body) {
|
|
17003
|
-
const baseUrl = await getBaseUrl();
|
|
17004
|
-
const headers = await getRawHeaders();
|
|
17005
|
-
const orgPath = await appendOrgParam(path);
|
|
17006
|
-
return fetch(`${baseUrl}${orgPath}`, {
|
|
17007
|
-
method: "POST",
|
|
17008
|
-
headers: {
|
|
17009
|
-
...headers,
|
|
17010
|
-
"Content-Type": "application/json"
|
|
17011
|
-
},
|
|
17012
|
-
body: JSON.stringify(body)
|
|
17013
|
-
});
|
|
17014
|
-
}
|
|
17015
|
-
|
|
17016
17162
|
// src/lib/api/domains/skills.ts
|
|
17163
|
+
import { initClient as initClient3 } from "@ts-rest/core";
|
|
17017
17164
|
import chalk2 from "chalk";
|
|
17018
|
-
function isResolveSkillsResponse(value) {
|
|
17019
|
-
if (typeof value !== "object" || value === null) return false;
|
|
17020
|
-
const obj = value;
|
|
17021
|
-
return typeof obj.resolved === "object" && obj.resolved !== null && Array.isArray(obj.unresolved);
|
|
17022
|
-
}
|
|
17023
17165
|
async function resolveSkills(skillUrls) {
|
|
17024
17166
|
try {
|
|
17025
|
-
const
|
|
17026
|
-
|
|
17027
|
-
});
|
|
17028
|
-
if (
|
|
17029
|
-
|
|
17030
|
-
|
|
17031
|
-
|
|
17032
|
-
|
|
17033
|
-
}
|
|
17034
|
-
const body = await response.json();
|
|
17035
|
-
if (!isResolveSkillsResponse(body)) {
|
|
17036
|
-
console.error(
|
|
17037
|
-
chalk2.dim(
|
|
17038
|
-
" Skill resolve returned unexpected format, downloading all skills"
|
|
17039
|
-
)
|
|
17040
|
-
);
|
|
17041
|
-
return { resolved: {}, unresolved: skillUrls };
|
|
17042
|
-
}
|
|
17043
|
-
return body;
|
|
17167
|
+
const config = await getClientConfig();
|
|
17168
|
+
const client = initClient3(skillsResolveContract, config);
|
|
17169
|
+
const result = await client.resolve({ body: { skills: skillUrls } });
|
|
17170
|
+
if (result.status === 200) return result.body;
|
|
17171
|
+
console.error(
|
|
17172
|
+
chalk2.dim(" Skill resolve unavailable, downloading all skills")
|
|
17173
|
+
);
|
|
17174
|
+
return { resolved: {}, unresolved: skillUrls };
|
|
17044
17175
|
} catch {
|
|
17045
17176
|
console.error(
|
|
17046
17177
|
chalk2.dim(" Skill resolve unavailable, downloading all skills")
|
|
@@ -17050,12 +17181,12 @@ async function resolveSkills(skillUrls) {
|
|
|
17050
17181
|
}
|
|
17051
17182
|
|
|
17052
17183
|
// src/lib/api/domains/zero-orgs.ts
|
|
17053
|
-
import { initClient as
|
|
17184
|
+
import { initClient as initClient4 } from "@ts-rest/core";
|
|
17054
17185
|
async function getUserTokenClientConfig() {
|
|
17055
17186
|
const baseUrl = await getBaseUrl();
|
|
17056
17187
|
const token = await getToken();
|
|
17057
17188
|
if (!token) {
|
|
17058
|
-
throw new
|
|
17189
|
+
throw new ApiRequestError("Not authenticated", "UNAUTHORIZED", 401);
|
|
17059
17190
|
}
|
|
17060
17191
|
const headers = {
|
|
17061
17192
|
Authorization: `Bearer ${token}`
|
|
@@ -17068,7 +17199,7 @@ async function getUserTokenClientConfig() {
|
|
|
17068
17199
|
}
|
|
17069
17200
|
async function getZeroOrg() {
|
|
17070
17201
|
const config = await getClientConfig();
|
|
17071
|
-
const client =
|
|
17202
|
+
const client = initClient4(zeroOrgContract, config);
|
|
17072
17203
|
const result = await client.get({ headers: {} });
|
|
17073
17204
|
if (result.status === 200) {
|
|
17074
17205
|
return result.body;
|
|
@@ -17077,7 +17208,7 @@ async function getZeroOrg() {
|
|
|
17077
17208
|
}
|
|
17078
17209
|
async function updateZeroOrg(body) {
|
|
17079
17210
|
const config = await getClientConfig();
|
|
17080
|
-
const client =
|
|
17211
|
+
const client = initClient4(zeroOrgContract, config);
|
|
17081
17212
|
const result = await client.update({ body });
|
|
17082
17213
|
if (result.status === 200) {
|
|
17083
17214
|
return result.body;
|
|
@@ -17086,7 +17217,7 @@ async function updateZeroOrg(body) {
|
|
|
17086
17217
|
}
|
|
17087
17218
|
async function listZeroOrgs() {
|
|
17088
17219
|
const config = await getUserTokenClientConfig();
|
|
17089
|
-
const client =
|
|
17220
|
+
const client = initClient4(zeroOrgListContract, config);
|
|
17090
17221
|
const result = await client.list({ headers: {} });
|
|
17091
17222
|
if (result.status === 200) {
|
|
17092
17223
|
return result.body;
|
|
@@ -17095,7 +17226,7 @@ async function listZeroOrgs() {
|
|
|
17095
17226
|
}
|
|
17096
17227
|
async function getZeroOrgMembers() {
|
|
17097
17228
|
const config = await getClientConfig();
|
|
17098
|
-
const client =
|
|
17229
|
+
const client = initClient4(zeroOrgMembersContract, config);
|
|
17099
17230
|
const result = await client.members({ headers: {} });
|
|
17100
17231
|
if (result.status === 200) {
|
|
17101
17232
|
return result.body;
|
|
@@ -17104,7 +17235,7 @@ async function getZeroOrgMembers() {
|
|
|
17104
17235
|
}
|
|
17105
17236
|
async function inviteZeroOrgMember(email) {
|
|
17106
17237
|
const config = await getClientConfig();
|
|
17107
|
-
const client =
|
|
17238
|
+
const client = initClient4(zeroOrgInviteContract, config);
|
|
17108
17239
|
const result = await client.invite({
|
|
17109
17240
|
body: { email }
|
|
17110
17241
|
});
|
|
@@ -17115,7 +17246,7 @@ async function inviteZeroOrgMember(email) {
|
|
|
17115
17246
|
}
|
|
17116
17247
|
async function removeZeroOrgMember(email) {
|
|
17117
17248
|
const config = await getClientConfig();
|
|
17118
|
-
const client =
|
|
17249
|
+
const client = initClient4(zeroOrgMembersContract, config);
|
|
17119
17250
|
const result = await client.removeMember({
|
|
17120
17251
|
body: { email }
|
|
17121
17252
|
});
|
|
@@ -17126,7 +17257,7 @@ async function removeZeroOrgMember(email) {
|
|
|
17126
17257
|
}
|
|
17127
17258
|
async function leaveZeroOrg() {
|
|
17128
17259
|
const config = await getClientConfig();
|
|
17129
|
-
const client =
|
|
17260
|
+
const client = initClient4(zeroOrgLeaveContract, config);
|
|
17130
17261
|
const result = await client.leave({
|
|
17131
17262
|
body: {}
|
|
17132
17263
|
});
|
|
@@ -17137,7 +17268,7 @@ async function leaveZeroOrg() {
|
|
|
17137
17268
|
}
|
|
17138
17269
|
async function deleteZeroOrg(slug) {
|
|
17139
17270
|
const config = await getClientConfig();
|
|
17140
|
-
const client =
|
|
17271
|
+
const client = initClient4(zeroOrgDeleteContract, config);
|
|
17141
17272
|
const result = await client.delete({
|
|
17142
17273
|
body: { slug }
|
|
17143
17274
|
});
|
|
@@ -17148,10 +17279,10 @@ async function deleteZeroOrg(slug) {
|
|
|
17148
17279
|
}
|
|
17149
17280
|
|
|
17150
17281
|
// src/lib/api/domains/zero-secrets.ts
|
|
17151
|
-
import { initClient as
|
|
17282
|
+
import { initClient as initClient5 } from "@ts-rest/core";
|
|
17152
17283
|
async function listZeroSecrets() {
|
|
17153
17284
|
const config = await getClientConfig();
|
|
17154
|
-
const client =
|
|
17285
|
+
const client = initClient5(zeroSecretsContract, config);
|
|
17155
17286
|
const result = await client.list({ headers: {} });
|
|
17156
17287
|
if (result.status === 200) {
|
|
17157
17288
|
return result.body;
|
|
@@ -17160,7 +17291,7 @@ async function listZeroSecrets() {
|
|
|
17160
17291
|
}
|
|
17161
17292
|
async function setZeroSecret(body) {
|
|
17162
17293
|
const config = await getClientConfig();
|
|
17163
|
-
const client =
|
|
17294
|
+
const client = initClient5(zeroSecretsContract, config);
|
|
17164
17295
|
const result = await client.set({ body });
|
|
17165
17296
|
if (result.status === 200 || result.status === 201) {
|
|
17166
17297
|
return result.body;
|
|
@@ -17169,7 +17300,7 @@ async function setZeroSecret(body) {
|
|
|
17169
17300
|
}
|
|
17170
17301
|
async function deleteZeroSecret(name) {
|
|
17171
17302
|
const config = await getClientConfig();
|
|
17172
|
-
const client =
|
|
17303
|
+
const client = initClient5(zeroSecretsByNameContract, config);
|
|
17173
17304
|
const result = await client.delete({
|
|
17174
17305
|
params: { name }
|
|
17175
17306
|
});
|
|
@@ -17180,10 +17311,10 @@ async function deleteZeroSecret(name) {
|
|
|
17180
17311
|
}
|
|
17181
17312
|
|
|
17182
17313
|
// src/lib/api/domains/zero-variables.ts
|
|
17183
|
-
import { initClient as
|
|
17314
|
+
import { initClient as initClient6 } from "@ts-rest/core";
|
|
17184
17315
|
async function listZeroVariables() {
|
|
17185
17316
|
const config = await getClientConfig();
|
|
17186
|
-
const client =
|
|
17317
|
+
const client = initClient6(zeroVariablesContract, config);
|
|
17187
17318
|
const result = await client.list({ headers: {} });
|
|
17188
17319
|
if (result.status === 200) {
|
|
17189
17320
|
return result.body;
|
|
@@ -17192,7 +17323,7 @@ async function listZeroVariables() {
|
|
|
17192
17323
|
}
|
|
17193
17324
|
async function setZeroVariable(body) {
|
|
17194
17325
|
const config = await getClientConfig();
|
|
17195
|
-
const client =
|
|
17326
|
+
const client = initClient6(zeroVariablesContract, config);
|
|
17196
17327
|
const result = await client.set({ body });
|
|
17197
17328
|
if (result.status === 200 || result.status === 201) {
|
|
17198
17329
|
return result.body;
|
|
@@ -17201,7 +17332,7 @@ async function setZeroVariable(body) {
|
|
|
17201
17332
|
}
|
|
17202
17333
|
async function deleteZeroVariable(name) {
|
|
17203
17334
|
const config = await getClientConfig();
|
|
17204
|
-
const client =
|
|
17335
|
+
const client = initClient6(zeroVariablesByNameContract, config);
|
|
17205
17336
|
const result = await client.delete({
|
|
17206
17337
|
params: { name }
|
|
17207
17338
|
});
|
|
@@ -17212,10 +17343,10 @@ async function deleteZeroVariable(name) {
|
|
|
17212
17343
|
}
|
|
17213
17344
|
|
|
17214
17345
|
// src/lib/api/domains/zero-connectors.ts
|
|
17215
|
-
import { initClient as
|
|
17346
|
+
import { initClient as initClient7 } from "@ts-rest/core";
|
|
17216
17347
|
async function listZeroConnectors() {
|
|
17217
17348
|
const config = await getClientConfig();
|
|
17218
|
-
const client =
|
|
17349
|
+
const client = initClient7(zeroConnectorsMainContract, config);
|
|
17219
17350
|
const result = await client.list({ headers: {} });
|
|
17220
17351
|
if (result.status === 200) {
|
|
17221
17352
|
return result.body;
|
|
@@ -17224,7 +17355,7 @@ async function listZeroConnectors() {
|
|
|
17224
17355
|
}
|
|
17225
17356
|
async function getZeroConnector(type) {
|
|
17226
17357
|
const config = await getClientConfig();
|
|
17227
|
-
const client =
|
|
17358
|
+
const client = initClient7(zeroConnectorsByTypeContract, config);
|
|
17228
17359
|
const result = await client.get({
|
|
17229
17360
|
params: { type }
|
|
17230
17361
|
});
|
|
@@ -17238,7 +17369,7 @@ async function getZeroConnector(type) {
|
|
|
17238
17369
|
}
|
|
17239
17370
|
async function deleteZeroConnector(type) {
|
|
17240
17371
|
const config = await getClientConfig();
|
|
17241
|
-
const client =
|
|
17372
|
+
const client = initClient7(zeroConnectorsByTypeContract, config);
|
|
17242
17373
|
const result = await client.delete({
|
|
17243
17374
|
params: { type }
|
|
17244
17375
|
});
|
|
@@ -17249,7 +17380,7 @@ async function deleteZeroConnector(type) {
|
|
|
17249
17380
|
}
|
|
17250
17381
|
async function createZeroConnectorSession(type) {
|
|
17251
17382
|
const config = await getClientConfig();
|
|
17252
|
-
const client =
|
|
17383
|
+
const client = initClient7(zeroConnectorSessionsContract, config);
|
|
17253
17384
|
const result = await client.create({
|
|
17254
17385
|
params: { type },
|
|
17255
17386
|
body: {}
|
|
@@ -17261,7 +17392,7 @@ async function createZeroConnectorSession(type) {
|
|
|
17261
17392
|
}
|
|
17262
17393
|
async function getZeroConnectorSession(type, sessionId) {
|
|
17263
17394
|
const config = await getClientConfig();
|
|
17264
|
-
const client =
|
|
17395
|
+
const client = initClient7(zeroConnectorSessionByIdContract, config);
|
|
17265
17396
|
const result = await client.get({
|
|
17266
17397
|
params: { type, sessionId }
|
|
17267
17398
|
});
|
|
@@ -17272,7 +17403,7 @@ async function getZeroConnectorSession(type, sessionId) {
|
|
|
17272
17403
|
}
|
|
17273
17404
|
async function createZeroComputerConnector() {
|
|
17274
17405
|
const config = await getClientConfig();
|
|
17275
|
-
const client =
|
|
17406
|
+
const client = initClient7(zeroComputerConnectorContract, config);
|
|
17276
17407
|
const result = await client.create({
|
|
17277
17408
|
body: {}
|
|
17278
17409
|
});
|
|
@@ -17283,7 +17414,7 @@ async function createZeroComputerConnector() {
|
|
|
17283
17414
|
}
|
|
17284
17415
|
async function deleteZeroComputerConnector() {
|
|
17285
17416
|
const config = await getClientConfig();
|
|
17286
|
-
const client =
|
|
17417
|
+
const client = initClient7(zeroComputerConnectorContract, config);
|
|
17287
17418
|
const result = await client.delete({});
|
|
17288
17419
|
if (result.status === 204) {
|
|
17289
17420
|
return;
|
|
@@ -17292,10 +17423,10 @@ async function deleteZeroComputerConnector() {
|
|
|
17292
17423
|
}
|
|
17293
17424
|
|
|
17294
17425
|
// src/lib/api/domains/runs.ts
|
|
17295
|
-
import { initClient as
|
|
17426
|
+
import { initClient as initClient8 } from "@ts-rest/core";
|
|
17296
17427
|
async function createRun(body) {
|
|
17297
17428
|
const config = await getClientConfig();
|
|
17298
|
-
const client =
|
|
17429
|
+
const client = initClient8(runsMainContract, config);
|
|
17299
17430
|
const result = await client.create({ body });
|
|
17300
17431
|
if (result.status === 201) {
|
|
17301
17432
|
return result.body;
|
|
@@ -17304,7 +17435,7 @@ async function createRun(body) {
|
|
|
17304
17435
|
}
|
|
17305
17436
|
async function getEvents(runId, options) {
|
|
17306
17437
|
const config = await getClientConfig();
|
|
17307
|
-
const client =
|
|
17438
|
+
const client = initClient8(runEventsContract, config);
|
|
17308
17439
|
const result = await client.getEvents({
|
|
17309
17440
|
params: { id: runId },
|
|
17310
17441
|
query: {
|
|
@@ -17319,7 +17450,7 @@ async function getEvents(runId, options) {
|
|
|
17319
17450
|
}
|
|
17320
17451
|
async function listRuns(params) {
|
|
17321
17452
|
const config = await getClientConfig();
|
|
17322
|
-
const client =
|
|
17453
|
+
const client = initClient8(runsMainContract, config);
|
|
17323
17454
|
const result = await client.list({
|
|
17324
17455
|
query: {
|
|
17325
17456
|
status: params?.status,
|
|
@@ -17336,7 +17467,7 @@ async function listRuns(params) {
|
|
|
17336
17467
|
}
|
|
17337
17468
|
async function getRunQueue() {
|
|
17338
17469
|
const config = await getClientConfig();
|
|
17339
|
-
const client =
|
|
17470
|
+
const client = initClient8(runsQueueContract, config);
|
|
17340
17471
|
const result = await client.getQueue({ headers: {} });
|
|
17341
17472
|
if (result.status === 200) {
|
|
17342
17473
|
return result.body;
|
|
@@ -17345,7 +17476,7 @@ async function getRunQueue() {
|
|
|
17345
17476
|
}
|
|
17346
17477
|
async function cancelRun(runId) {
|
|
17347
17478
|
const config = await getClientConfig();
|
|
17348
|
-
const client =
|
|
17479
|
+
const client = initClient8(runsCancelContract, config);
|
|
17349
17480
|
const result = await client.cancel({
|
|
17350
17481
|
params: { id: runId }
|
|
17351
17482
|
});
|
|
@@ -17356,10 +17487,10 @@ async function cancelRun(runId) {
|
|
|
17356
17487
|
}
|
|
17357
17488
|
|
|
17358
17489
|
// src/lib/api/domains/sessions.ts
|
|
17359
|
-
import { initClient as
|
|
17490
|
+
import { initClient as initClient9 } from "@ts-rest/core";
|
|
17360
17491
|
async function getSession(sessionId) {
|
|
17361
17492
|
const config = await getClientConfig();
|
|
17362
|
-
const client =
|
|
17493
|
+
const client = initClient9(sessionsByIdContract, config);
|
|
17363
17494
|
const result = await client.getById({
|
|
17364
17495
|
params: { id: sessionId }
|
|
17365
17496
|
});
|
|
@@ -17372,7 +17503,7 @@ async function getSession(sessionId) {
|
|
|
17372
17503
|
}
|
|
17373
17504
|
async function getCheckpoint(checkpointId) {
|
|
17374
17505
|
const config = await getClientConfig();
|
|
17375
|
-
const client =
|
|
17506
|
+
const client = initClient9(checkpointsByIdContract, config);
|
|
17376
17507
|
const result = await client.getById({
|
|
17377
17508
|
params: { id: checkpointId }
|
|
17378
17509
|
});
|
|
@@ -17383,10 +17514,10 @@ async function getCheckpoint(checkpointId) {
|
|
|
17383
17514
|
}
|
|
17384
17515
|
|
|
17385
17516
|
// src/lib/api/domains/storages.ts
|
|
17386
|
-
import { initClient as
|
|
17517
|
+
import { initClient as initClient10 } from "@ts-rest/core";
|
|
17387
17518
|
async function prepareStorage(body) {
|
|
17388
17519
|
const config = await getClientConfig();
|
|
17389
|
-
const client =
|
|
17520
|
+
const client = initClient10(storagesPrepareContract, config);
|
|
17390
17521
|
const result = await client.prepare({ body });
|
|
17391
17522
|
if (result.status === 200) {
|
|
17392
17523
|
return result.body;
|
|
@@ -17395,7 +17526,7 @@ async function prepareStorage(body) {
|
|
|
17395
17526
|
}
|
|
17396
17527
|
async function commitStorage(body) {
|
|
17397
17528
|
const config = await getClientConfig();
|
|
17398
|
-
const client =
|
|
17529
|
+
const client = initClient10(storagesCommitContract, config);
|
|
17399
17530
|
const result = await client.commit({ body });
|
|
17400
17531
|
if (result.status === 200) {
|
|
17401
17532
|
return result.body;
|
|
@@ -17404,7 +17535,7 @@ async function commitStorage(body) {
|
|
|
17404
17535
|
}
|
|
17405
17536
|
async function getStorageDownload(query) {
|
|
17406
17537
|
const config = await getClientConfig();
|
|
17407
|
-
const client =
|
|
17538
|
+
const client = initClient10(storagesDownloadContract, config);
|
|
17408
17539
|
const result = await client.download({
|
|
17409
17540
|
query: {
|
|
17410
17541
|
name: query.name,
|
|
@@ -17419,7 +17550,7 @@ async function getStorageDownload(query) {
|
|
|
17419
17550
|
}
|
|
17420
17551
|
async function listStorages(query) {
|
|
17421
17552
|
const config = await getClientConfig();
|
|
17422
|
-
const client =
|
|
17553
|
+
const client = initClient10(storagesListContract, config);
|
|
17423
17554
|
const result = await client.list({ query });
|
|
17424
17555
|
if (result.status === 200) {
|
|
17425
17556
|
return result.body;
|
|
@@ -17428,10 +17559,10 @@ async function listStorages(query) {
|
|
|
17428
17559
|
}
|
|
17429
17560
|
|
|
17430
17561
|
// src/lib/api/domains/zero-org-secrets.ts
|
|
17431
|
-
import { initClient as
|
|
17562
|
+
import { initClient as initClient11 } from "@ts-rest/core";
|
|
17432
17563
|
async function listZeroOrgSecrets() {
|
|
17433
17564
|
const config = await getClientConfig();
|
|
17434
|
-
const client =
|
|
17565
|
+
const client = initClient11(zeroSecretsContract, config);
|
|
17435
17566
|
const result = await client.list({ headers: {} });
|
|
17436
17567
|
if (result.status === 200) {
|
|
17437
17568
|
return result.body;
|
|
@@ -17440,7 +17571,7 @@ async function listZeroOrgSecrets() {
|
|
|
17440
17571
|
}
|
|
17441
17572
|
async function setZeroOrgSecret(body) {
|
|
17442
17573
|
const config = await getClientConfig();
|
|
17443
|
-
const client =
|
|
17574
|
+
const client = initClient11(zeroSecretsContract, config);
|
|
17444
17575
|
const result = await client.set({ body });
|
|
17445
17576
|
if (result.status === 200 || result.status === 201) {
|
|
17446
17577
|
return result.body;
|
|
@@ -17449,7 +17580,7 @@ async function setZeroOrgSecret(body) {
|
|
|
17449
17580
|
}
|
|
17450
17581
|
async function deleteZeroOrgSecret(name) {
|
|
17451
17582
|
const config = await getClientConfig();
|
|
17452
|
-
const client =
|
|
17583
|
+
const client = initClient11(zeroSecretsByNameContract, config);
|
|
17453
17584
|
const result = await client.delete({
|
|
17454
17585
|
params: { name }
|
|
17455
17586
|
});
|
|
@@ -17460,10 +17591,10 @@ async function deleteZeroOrgSecret(name) {
|
|
|
17460
17591
|
}
|
|
17461
17592
|
|
|
17462
17593
|
// src/lib/api/domains/zero-org-variables.ts
|
|
17463
|
-
import { initClient as
|
|
17594
|
+
import { initClient as initClient12 } from "@ts-rest/core";
|
|
17464
17595
|
async function listZeroOrgVariables() {
|
|
17465
17596
|
const config = await getClientConfig();
|
|
17466
|
-
const client =
|
|
17597
|
+
const client = initClient12(zeroVariablesContract, config);
|
|
17467
17598
|
const result = await client.list({ headers: {} });
|
|
17468
17599
|
if (result.status === 200) {
|
|
17469
17600
|
return result.body;
|
|
@@ -17472,7 +17603,7 @@ async function listZeroOrgVariables() {
|
|
|
17472
17603
|
}
|
|
17473
17604
|
async function setZeroOrgVariable(body) {
|
|
17474
17605
|
const config = await getClientConfig();
|
|
17475
|
-
const client =
|
|
17606
|
+
const client = initClient12(zeroVariablesContract, config);
|
|
17476
17607
|
const result = await client.set({ body });
|
|
17477
17608
|
if (result.status === 200 || result.status === 201) {
|
|
17478
17609
|
return result.body;
|
|
@@ -17481,7 +17612,7 @@ async function setZeroOrgVariable(body) {
|
|
|
17481
17612
|
}
|
|
17482
17613
|
async function deleteZeroOrgVariable(name) {
|
|
17483
17614
|
const config = await getClientConfig();
|
|
17484
|
-
const client =
|
|
17615
|
+
const client = initClient12(zeroVariablesByNameContract, config);
|
|
17485
17616
|
const result = await client.delete({
|
|
17486
17617
|
params: { name }
|
|
17487
17618
|
});
|
|
@@ -17492,10 +17623,10 @@ async function deleteZeroOrgVariable(name) {
|
|
|
17492
17623
|
}
|
|
17493
17624
|
|
|
17494
17625
|
// src/lib/api/domains/zero-org-model-providers.ts
|
|
17495
|
-
import { initClient as
|
|
17626
|
+
import { initClient as initClient13 } from "@ts-rest/core";
|
|
17496
17627
|
async function listZeroOrgModelProviders() {
|
|
17497
17628
|
const config = await getClientConfig();
|
|
17498
|
-
const client =
|
|
17629
|
+
const client = initClient13(zeroModelProvidersMainContract, config);
|
|
17499
17630
|
const result = await client.list({ headers: {} });
|
|
17500
17631
|
if (result.status === 200) {
|
|
17501
17632
|
return result.body;
|
|
@@ -17504,7 +17635,7 @@ async function listZeroOrgModelProviders() {
|
|
|
17504
17635
|
}
|
|
17505
17636
|
async function upsertZeroOrgModelProvider(body) {
|
|
17506
17637
|
const config = await getClientConfig();
|
|
17507
|
-
const client =
|
|
17638
|
+
const client = initClient13(zeroModelProvidersMainContract, config);
|
|
17508
17639
|
const result = await client.upsert({ body });
|
|
17509
17640
|
if (result.status === 200 || result.status === 201) {
|
|
17510
17641
|
return result.body;
|
|
@@ -17513,7 +17644,7 @@ async function upsertZeroOrgModelProvider(body) {
|
|
|
17513
17644
|
}
|
|
17514
17645
|
async function deleteZeroOrgModelProvider(type) {
|
|
17515
17646
|
const config = await getClientConfig();
|
|
17516
|
-
const client =
|
|
17647
|
+
const client = initClient13(zeroModelProvidersByTypeContract, config);
|
|
17517
17648
|
const result = await client.delete({
|
|
17518
17649
|
params: { type }
|
|
17519
17650
|
});
|
|
@@ -17524,7 +17655,7 @@ async function deleteZeroOrgModelProvider(type) {
|
|
|
17524
17655
|
}
|
|
17525
17656
|
async function setZeroOrgModelProviderDefault(type) {
|
|
17526
17657
|
const config = await getClientConfig();
|
|
17527
|
-
const client =
|
|
17658
|
+
const client = initClient13(zeroModelProvidersDefaultContract, config);
|
|
17528
17659
|
const result = await client.setDefault({
|
|
17529
17660
|
params: { type }
|
|
17530
17661
|
});
|
|
@@ -17535,7 +17666,7 @@ async function setZeroOrgModelProviderDefault(type) {
|
|
|
17535
17666
|
}
|
|
17536
17667
|
async function updateZeroOrgModelProviderModel(type, selectedModel) {
|
|
17537
17668
|
const config = await getClientConfig();
|
|
17538
|
-
const client =
|
|
17669
|
+
const client = initClient13(zeroModelProvidersUpdateModelContract, config);
|
|
17539
17670
|
const result = await client.updateModel({
|
|
17540
17671
|
params: { type },
|
|
17541
17672
|
body: { selectedModel }
|
|
@@ -17547,52 +17678,52 @@ async function updateZeroOrgModelProviderModel(type, selectedModel) {
|
|
|
17547
17678
|
}
|
|
17548
17679
|
|
|
17549
17680
|
// src/lib/api/domains/zero-agents.ts
|
|
17550
|
-
import { initClient as
|
|
17681
|
+
import { initClient as initClient14 } from "@ts-rest/core";
|
|
17551
17682
|
async function createZeroAgent(body) {
|
|
17552
17683
|
const config = await getClientConfig();
|
|
17553
|
-
const client =
|
|
17684
|
+
const client = initClient14(zeroAgentsMainContract, config);
|
|
17554
17685
|
const result = await client.create({ body });
|
|
17555
17686
|
if (result.status === 201) return result.body;
|
|
17556
17687
|
handleError(result, "Failed to create zero agent");
|
|
17557
17688
|
}
|
|
17558
17689
|
async function listZeroAgents() {
|
|
17559
17690
|
const config = await getClientConfig();
|
|
17560
|
-
const client =
|
|
17691
|
+
const client = initClient14(zeroAgentsMainContract, config);
|
|
17561
17692
|
const result = await client.list({ headers: {} });
|
|
17562
17693
|
if (result.status === 200) return result.body;
|
|
17563
17694
|
handleError(result, "Failed to list zero agents");
|
|
17564
17695
|
}
|
|
17565
17696
|
async function getZeroAgent(id) {
|
|
17566
17697
|
const config = await getClientConfig();
|
|
17567
|
-
const client =
|
|
17698
|
+
const client = initClient14(zeroAgentsByIdContract, config);
|
|
17568
17699
|
const result = await client.get({ params: { id } });
|
|
17569
17700
|
if (result.status === 200) return result.body;
|
|
17570
17701
|
handleError(result, `Zero agent "${id}" not found`);
|
|
17571
17702
|
}
|
|
17572
17703
|
async function updateZeroAgent(id, body) {
|
|
17573
17704
|
const config = await getClientConfig();
|
|
17574
|
-
const client =
|
|
17705
|
+
const client = initClient14(zeroAgentsByIdContract, config);
|
|
17575
17706
|
const result = await client.update({ params: { id }, body });
|
|
17576
17707
|
if (result.status === 200) return result.body;
|
|
17577
17708
|
handleError(result, `Failed to update zero agent "${id}"`);
|
|
17578
17709
|
}
|
|
17579
17710
|
async function deleteZeroAgent(id) {
|
|
17580
17711
|
const config = await getClientConfig();
|
|
17581
|
-
const client =
|
|
17712
|
+
const client = initClient14(zeroAgentsByIdContract, config);
|
|
17582
17713
|
const result = await client.delete({ params: { id } });
|
|
17583
17714
|
if (result.status === 204) return;
|
|
17584
17715
|
handleError(result, `Zero agent "${id}" not found`);
|
|
17585
17716
|
}
|
|
17586
17717
|
async function getZeroAgentInstructions(id) {
|
|
17587
17718
|
const config = await getClientConfig();
|
|
17588
|
-
const client =
|
|
17719
|
+
const client = initClient14(zeroAgentInstructionsContract, config);
|
|
17589
17720
|
const result = await client.get({ params: { id } });
|
|
17590
17721
|
if (result.status === 200) return result.body;
|
|
17591
17722
|
handleError(result, `Failed to get instructions for zero agent "${id}"`);
|
|
17592
17723
|
}
|
|
17593
17724
|
async function updateZeroAgentInstructions(id, content) {
|
|
17594
17725
|
const config = await getClientConfig();
|
|
17595
|
-
const client =
|
|
17726
|
+
const client = initClient14(zeroAgentInstructionsContract, config);
|
|
17596
17727
|
const result = await client.update({
|
|
17597
17728
|
params: { id },
|
|
17598
17729
|
body: { content }
|
|
@@ -17602,10 +17733,10 @@ async function updateZeroAgentInstructions(id, content) {
|
|
|
17602
17733
|
}
|
|
17603
17734
|
|
|
17604
17735
|
// src/lib/api/domains/integrations-slack.ts
|
|
17605
|
-
import { initClient as
|
|
17736
|
+
import { initClient as initClient15 } from "@ts-rest/core";
|
|
17606
17737
|
async function sendSlackMessage(body) {
|
|
17607
17738
|
const config = await getClientConfig();
|
|
17608
|
-
const client =
|
|
17739
|
+
const client = initClient15(integrationsSlackMessageContract, config);
|
|
17609
17740
|
const result = await client.sendMessage({ body, headers: {} });
|
|
17610
17741
|
if (result.status === 200) {
|
|
17611
17742
|
return result.body;
|
|
@@ -17614,10 +17745,10 @@ async function sendSlackMessage(body) {
|
|
|
17614
17745
|
}
|
|
17615
17746
|
|
|
17616
17747
|
// src/lib/api/domains/zero-schedules.ts
|
|
17617
|
-
import { initClient as
|
|
17748
|
+
import { initClient as initClient16 } from "@ts-rest/core";
|
|
17618
17749
|
async function deployZeroSchedule(body) {
|
|
17619
17750
|
const config = await getClientConfig();
|
|
17620
|
-
const client =
|
|
17751
|
+
const client = initClient16(zeroSchedulesMainContract, config);
|
|
17621
17752
|
const result = await client.deploy({ body });
|
|
17622
17753
|
if (result.status === 200 || result.status === 201) {
|
|
17623
17754
|
return result.body;
|
|
@@ -17626,7 +17757,7 @@ async function deployZeroSchedule(body) {
|
|
|
17626
17757
|
}
|
|
17627
17758
|
async function listZeroSchedules() {
|
|
17628
17759
|
const config = await getClientConfig();
|
|
17629
|
-
const client =
|
|
17760
|
+
const client = initClient16(zeroSchedulesMainContract, config);
|
|
17630
17761
|
const result = await client.list({ headers: {} });
|
|
17631
17762
|
if (result.status === 200) {
|
|
17632
17763
|
return result.body;
|
|
@@ -17635,7 +17766,7 @@ async function listZeroSchedules() {
|
|
|
17635
17766
|
}
|
|
17636
17767
|
async function deleteZeroSchedule(params) {
|
|
17637
17768
|
const config = await getClientConfig();
|
|
17638
|
-
const client =
|
|
17769
|
+
const client = initClient16(zeroSchedulesByNameContract, config);
|
|
17639
17770
|
const result = await client.delete({
|
|
17640
17771
|
params: { name: params.name },
|
|
17641
17772
|
query: { agentId: params.agentId }
|
|
@@ -17647,7 +17778,7 @@ async function deleteZeroSchedule(params) {
|
|
|
17647
17778
|
}
|
|
17648
17779
|
async function enableZeroSchedule(params) {
|
|
17649
17780
|
const config = await getClientConfig();
|
|
17650
|
-
const client =
|
|
17781
|
+
const client = initClient16(zeroSchedulesEnableContract, config);
|
|
17651
17782
|
const result = await client.enable({
|
|
17652
17783
|
params: { name: params.name },
|
|
17653
17784
|
body: { agentId: params.agentId }
|
|
@@ -17659,7 +17790,7 @@ async function enableZeroSchedule(params) {
|
|
|
17659
17790
|
}
|
|
17660
17791
|
async function disableZeroSchedule(params) {
|
|
17661
17792
|
const config = await getClientConfig();
|
|
17662
|
-
const client =
|
|
17793
|
+
const client = initClient16(zeroSchedulesEnableContract, config);
|
|
17663
17794
|
const result = await client.disable({
|
|
17664
17795
|
params: { name: params.name },
|
|
17665
17796
|
body: { agentId: params.agentId }
|
|
@@ -17787,28 +17918,18 @@ export {
|
|
|
17787
17918
|
loadConfig,
|
|
17788
17919
|
saveConfig,
|
|
17789
17920
|
getToken,
|
|
17790
|
-
getActiveToken,
|
|
17791
17921
|
getApiUrl,
|
|
17792
17922
|
getActiveOrg,
|
|
17793
17923
|
clearConfig,
|
|
17794
17924
|
extractAndGroupVariables,
|
|
17795
17925
|
volumeConfigSchema,
|
|
17796
17926
|
agentDefinitionSchema,
|
|
17797
|
-
composesMainContract,
|
|
17798
|
-
composesByIdContract,
|
|
17799
|
-
composesVersionsContract,
|
|
17800
17927
|
ALL_RUN_STATUSES,
|
|
17801
|
-
runsMainContract,
|
|
17802
|
-
runEventsContract,
|
|
17803
17928
|
runSystemLogContract,
|
|
17804
17929
|
runMetricsContract,
|
|
17805
17930
|
runAgentEventsContract,
|
|
17806
17931
|
runNetworkLogsContract,
|
|
17807
17932
|
logsSearchContract,
|
|
17808
|
-
storagesPrepareContract,
|
|
17809
|
-
storagesCommitContract,
|
|
17810
|
-
storagesDownloadContract,
|
|
17811
|
-
storagesListContract,
|
|
17812
17933
|
MODEL_PROVIDER_TYPES,
|
|
17813
17934
|
getSelectableProviderTypes,
|
|
17814
17935
|
hasAuthMethods,
|
|
@@ -17820,8 +17941,6 @@ export {
|
|
|
17820
17941
|
hasModelSelection,
|
|
17821
17942
|
allowsCustomModel,
|
|
17822
17943
|
getCustomModelPlaceholder,
|
|
17823
|
-
sessionsByIdContract,
|
|
17824
|
-
checkpointsByIdContract,
|
|
17825
17944
|
CONNECTOR_TYPES,
|
|
17826
17945
|
connectorTypeSchema,
|
|
17827
17946
|
getConnectorDerivedNames,
|
|
@@ -17913,4 +18032,4 @@ export {
|
|
|
17913
18032
|
promptSelect,
|
|
17914
18033
|
promptPassword
|
|
17915
18034
|
};
|
|
17916
|
-
//# sourceMappingURL=chunk-
|
|
18035
|
+
//# sourceMappingURL=chunk-2RXB3R33.js.map
|