@vm0/cli 9.82.0 → 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-RGS2GO4Q.js → chunk-2RXB3R33.js} +331 -181
- 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 +49 -42
- package/zero.js.map +1 -1
- package/chunk-RGS2GO4Q.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", {
|
|
@@ -139,11 +139,55 @@ function configureGlobalProxyFromEnv() {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
+
// src/lib/api/zero-token.ts
|
|
143
|
+
function decodeZeroTokenPayload(token) {
|
|
144
|
+
const raw = token ?? process.env.ZERO_TOKEN;
|
|
145
|
+
if (!raw) return void 0;
|
|
146
|
+
const prefix = "vm0_sandbox_";
|
|
147
|
+
if (!raw.startsWith(prefix)) return void 0;
|
|
148
|
+
const jwt = raw.slice(prefix.length);
|
|
149
|
+
const parts = jwt.split(".");
|
|
150
|
+
if (parts.length !== 3) return void 0;
|
|
151
|
+
try {
|
|
152
|
+
const payload = JSON.parse(
|
|
153
|
+
Buffer.from(parts[1], "base64url").toString()
|
|
154
|
+
);
|
|
155
|
+
if (payload.scope === "zero" && Array.isArray(payload.capabilities)) {
|
|
156
|
+
return payload;
|
|
157
|
+
}
|
|
158
|
+
} catch {
|
|
159
|
+
}
|
|
160
|
+
return void 0;
|
|
161
|
+
}
|
|
162
|
+
|
|
142
163
|
// src/lib/api/config.ts
|
|
143
164
|
import { homedir } from "os";
|
|
144
165
|
import { join } from "path";
|
|
145
166
|
import { readFile, writeFile, mkdir, unlink } from "fs/promises";
|
|
146
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
|
|
147
191
|
function getConfigDir() {
|
|
148
192
|
return join(homedir(), ".vm0");
|
|
149
193
|
}
|
|
@@ -187,26 +231,12 @@ async function getApiUrl() {
|
|
|
187
231
|
}
|
|
188
232
|
return config.apiUrl ?? "https://www.vm0.ai";
|
|
189
233
|
}
|
|
190
|
-
function decodeZeroTokenPayload() {
|
|
191
|
-
const token = process.env.ZERO_TOKEN;
|
|
192
|
-
if (!token) return void 0;
|
|
193
|
-
const prefix = "vm0_sandbox_";
|
|
194
|
-
if (!token.startsWith(prefix)) return void 0;
|
|
195
|
-
const jwt = token.slice(prefix.length);
|
|
196
|
-
const parts = jwt.split(".");
|
|
197
|
-
if (parts.length !== 3) return void 0;
|
|
198
|
-
try {
|
|
199
|
-
const payload = JSON.parse(
|
|
200
|
-
Buffer.from(parts[1], "base64url").toString()
|
|
201
|
-
);
|
|
202
|
-
if (payload.scope === "zero") return payload;
|
|
203
|
-
} catch {
|
|
204
|
-
}
|
|
205
|
-
return void 0;
|
|
206
|
-
}
|
|
207
234
|
async function getActiveOrg() {
|
|
208
235
|
const zeroPayload = decodeZeroTokenPayload();
|
|
209
236
|
if (zeroPayload) return zeroPayload.orgId;
|
|
237
|
+
const token = await getToken();
|
|
238
|
+
const cliPayload = decodeCliTokenPayload(token);
|
|
239
|
+
if (cliPayload) return cliPayload.orgId;
|
|
210
240
|
if (process.env.VM0_ACTIVE_ORG) {
|
|
211
241
|
return process.env.VM0_ACTIVE_ORG;
|
|
212
242
|
}
|
|
@@ -1717,6 +1747,32 @@ var firefliesFirewall = {
|
|
|
1717
1747
|
]
|
|
1718
1748
|
};
|
|
1719
1749
|
|
|
1750
|
+
// ../../packages/core/src/firewalls/garmin-connect.generated.ts
|
|
1751
|
+
var garminConnectFirewall = {
|
|
1752
|
+
name: "garmin-connect",
|
|
1753
|
+
description: "Garmin Connect API",
|
|
1754
|
+
placeholders: {
|
|
1755
|
+
GARMIN_CONNECT_TOKEN: "vm0placeholderGarminConnectToken000000000000000000000a"
|
|
1756
|
+
},
|
|
1757
|
+
apis: [
|
|
1758
|
+
{
|
|
1759
|
+
base: "https://apis.garmin.com",
|
|
1760
|
+
auth: {
|
|
1761
|
+
headers: {
|
|
1762
|
+
Authorization: "Bearer ${{ secrets.GARMIN_CONNECT_TOKEN }}"
|
|
1763
|
+
}
|
|
1764
|
+
},
|
|
1765
|
+
permissions: [
|
|
1766
|
+
{
|
|
1767
|
+
name: "unrestricted",
|
|
1768
|
+
description: "Allow all Garmin Connect API endpoints",
|
|
1769
|
+
rules: ["ANY /{path*}"]
|
|
1770
|
+
}
|
|
1771
|
+
]
|
|
1772
|
+
}
|
|
1773
|
+
]
|
|
1774
|
+
};
|
|
1775
|
+
|
|
1720
1776
|
// ../../packages/core/src/firewalls/github.generated.ts
|
|
1721
1777
|
var githubFirewall = {
|
|
1722
1778
|
name: "github",
|
|
@@ -5355,6 +5411,32 @@ var imgurFirewall = {
|
|
|
5355
5411
|
]
|
|
5356
5412
|
};
|
|
5357
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
|
+
|
|
5358
5440
|
// ../../packages/core/src/firewalls/instantly.generated.ts
|
|
5359
5441
|
var instantlyFirewall = {
|
|
5360
5442
|
name: "instantly",
|
|
@@ -6319,6 +6401,32 @@ var mercuryFirewall = {
|
|
|
6319
6401
|
]
|
|
6320
6402
|
};
|
|
6321
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
|
+
|
|
6322
6430
|
// ../../packages/core/src/firewalls/minimax.generated.ts
|
|
6323
6431
|
var minimaxFirewall = {
|
|
6324
6432
|
name: "minimax",
|
|
@@ -6516,6 +6624,58 @@ var openaiFirewall = {
|
|
|
6516
6624
|
]
|
|
6517
6625
|
};
|
|
6518
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
|
+
|
|
6519
6679
|
// ../../packages/core/src/firewalls/pdf4me.generated.ts
|
|
6520
6680
|
var pdf4meFirewall = {
|
|
6521
6681
|
name: "pdf4me",
|
|
@@ -6739,6 +6899,32 @@ var productlaneFirewall = {
|
|
|
6739
6899
|
]
|
|
6740
6900
|
};
|
|
6741
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
|
+
|
|
6742
6928
|
// ../../packages/core/src/firewalls/pushinator.generated.ts
|
|
6743
6929
|
var pushinatorFirewall = {
|
|
6744
6930
|
name: "pushinator",
|
|
@@ -8736,14 +8922,14 @@ var xFirewall = {
|
|
|
8736
8922
|
name: "x",
|
|
8737
8923
|
description: "X (Twitter) API",
|
|
8738
8924
|
placeholders: {
|
|
8739
|
-
|
|
8925
|
+
X_TOKEN: "AAAAAAAAAAAAAAAAAAAAAAVm0PlaceHolder0000000000000000000000000000000000000000000000000000000000000000000000"
|
|
8740
8926
|
},
|
|
8741
8927
|
apis: [
|
|
8742
8928
|
{
|
|
8743
8929
|
base: "https://api.x.com",
|
|
8744
8930
|
auth: {
|
|
8745
8931
|
headers: {
|
|
8746
|
-
Authorization: "Bearer ${{ secrets.
|
|
8932
|
+
Authorization: "Bearer ${{ secrets.X_TOKEN }}"
|
|
8747
8933
|
}
|
|
8748
8934
|
},
|
|
8749
8935
|
permissions: [
|
|
@@ -8920,6 +9106,7 @@ var builtinFirewalls = {
|
|
|
8920
9106
|
figma: figmaFirewall,
|
|
8921
9107
|
firecrawl: firecrawlFirewall,
|
|
8922
9108
|
fireflies: firefliesFirewall,
|
|
9109
|
+
"garmin-connect": garminConnectFirewall,
|
|
8923
9110
|
github: githubFirewall,
|
|
8924
9111
|
gitlab: gitlabFirewall,
|
|
8925
9112
|
gmail: gmailFirewall,
|
|
@@ -8933,6 +9120,7 @@ var builtinFirewalls = {
|
|
|
8933
9120
|
"hugging-face": huggingFaceFirewall,
|
|
8934
9121
|
hume: humeFirewall,
|
|
8935
9122
|
imgur: imgurFirewall,
|
|
9123
|
+
instagram: instagramFirewall,
|
|
8936
9124
|
instantly: instantlyFirewall,
|
|
8937
9125
|
intercom: intercomFirewall,
|
|
8938
9126
|
"intervals-icu": intervalsIcuFirewall,
|
|
@@ -8944,11 +9132,14 @@ var builtinFirewalls = {
|
|
|
8944
9132
|
loops: loopsFirewall,
|
|
8945
9133
|
mailsac: mailsacFirewall,
|
|
8946
9134
|
mercury: mercuryFirewall,
|
|
9135
|
+
"meta-ads": metaAdsFirewall,
|
|
8947
9136
|
minimax: minimaxFirewall,
|
|
8948
9137
|
monday: mondayFirewall,
|
|
8949
9138
|
neon: neonFirewall,
|
|
8950
9139
|
notion: notionFirewall,
|
|
8951
9140
|
openai: openaiFirewall,
|
|
9141
|
+
"outlook-calendar": outlookCalendarFirewall,
|
|
9142
|
+
"outlook-mail": outlookMailFirewall,
|
|
8952
9143
|
pdf4me: pdf4meFirewall,
|
|
8953
9144
|
pdfco: pdfcoFirewall,
|
|
8954
9145
|
pdforge: pdforgeFirewall,
|
|
@@ -8957,6 +9148,7 @@ var builtinFirewalls = {
|
|
|
8957
9148
|
podchaser: podchaserFirewall,
|
|
8958
9149
|
posthog: posthogFirewall,
|
|
8959
9150
|
productlane: productlaneFirewall,
|
|
9151
|
+
"prisma-postgres": prismaPostgresFirewall,
|
|
8960
9152
|
pushinator: pushinatorFirewall,
|
|
8961
9153
|
qiita: qiitaFirewall,
|
|
8962
9154
|
reddit: redditFirewall,
|
|
@@ -13181,7 +13373,7 @@ var CONNECTOR_TYPES_DEF = {
|
|
|
13181
13373
|
// Upload media.
|
|
13182
13374
|
],
|
|
13183
13375
|
environmentMapping: {
|
|
13184
|
-
|
|
13376
|
+
X_TOKEN: "$secrets.X_ACCESS_TOKEN"
|
|
13185
13377
|
}
|
|
13186
13378
|
}
|
|
13187
13379
|
},
|
|
@@ -16431,6 +16623,30 @@ var zeroBillingAutoRechargeContract = c29.router({
|
|
|
16431
16623
|
summary: "Update auto-recharge configuration"
|
|
16432
16624
|
}
|
|
16433
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
|
+
});
|
|
16434
16650
|
|
|
16435
16651
|
// ../../packages/core/src/contracts/zero-usage.ts
|
|
16436
16652
|
import { z as z37 } from "zod";
|
|
@@ -16815,10 +17031,12 @@ async function getClientConfig() {
|
|
|
16815
17031
|
baseHeaders,
|
|
16816
17032
|
jsonQuery: false,
|
|
16817
17033
|
api: async (args) => {
|
|
16818
|
-
const
|
|
16819
|
-
|
|
16820
|
-
|
|
17034
|
+
const [pathPart, queryPart] = args.path.split("?");
|
|
17035
|
+
const params = new URLSearchParams(queryPart ?? "");
|
|
17036
|
+
if (!params.has("org")) {
|
|
17037
|
+
params.set("org", activeOrg);
|
|
16821
17038
|
}
|
|
17039
|
+
args.path = params.toString() ? `${pathPart}?${params.toString()}` : pathPart;
|
|
16822
17040
|
return tsRestFetchApi(args);
|
|
16823
17041
|
}
|
|
16824
17042
|
};
|
|
@@ -16838,8 +17056,13 @@ function withErrorHandler(fn) {
|
|
|
16838
17056
|
} catch (error) {
|
|
16839
17057
|
if (error instanceof ApiRequestError) {
|
|
16840
17058
|
if (error.code === "UNAUTHORIZED") {
|
|
16841
|
-
|
|
16842
|
-
|
|
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
|
+
}
|
|
16843
17066
|
} else {
|
|
16844
17067
|
const guidance = RUN_ERROR_GUIDANCE[error.code];
|
|
16845
17068
|
if (guidance) {
|
|
@@ -16936,80 +17159,19 @@ async function updateZeroUserPreferences(body) {
|
|
|
16936
17159
|
handleError(result, "Failed to update user preferences");
|
|
16937
17160
|
}
|
|
16938
17161
|
|
|
16939
|
-
// src/lib/api/core/http.ts
|
|
16940
|
-
async function appendOrgParam(path) {
|
|
16941
|
-
const activeOrg = await getActiveOrg();
|
|
16942
|
-
if (!activeOrg) {
|
|
16943
|
-
throw new Error(
|
|
16944
|
-
"No active organization configured. Run: zero org use <slug>"
|
|
16945
|
-
);
|
|
16946
|
-
}
|
|
16947
|
-
const queryStart = path.indexOf("?");
|
|
16948
|
-
if (queryStart !== -1) {
|
|
16949
|
-
const params = new URLSearchParams(path.slice(queryStart));
|
|
16950
|
-
if (params.has("org")) {
|
|
16951
|
-
return path;
|
|
16952
|
-
}
|
|
16953
|
-
return `${path}&org=${encodeURIComponent(activeOrg)}`;
|
|
16954
|
-
}
|
|
16955
|
-
return `${path}?org=${encodeURIComponent(activeOrg)}`;
|
|
16956
|
-
}
|
|
16957
|
-
async function getRawHeaders() {
|
|
16958
|
-
const token = await getActiveToken();
|
|
16959
|
-
if (!token) {
|
|
16960
|
-
throw new Error("Not authenticated. Run: vm0 auth login");
|
|
16961
|
-
}
|
|
16962
|
-
const headers = {
|
|
16963
|
-
Authorization: `Bearer ${token}`
|
|
16964
|
-
};
|
|
16965
|
-
const bypassSecret = process.env.VERCEL_AUTOMATION_BYPASS_SECRET;
|
|
16966
|
-
if (bypassSecret) {
|
|
16967
|
-
headers["x-vercel-protection-bypass"] = bypassSecret;
|
|
16968
|
-
}
|
|
16969
|
-
return headers;
|
|
16970
|
-
}
|
|
16971
|
-
async function httpPost(path, body) {
|
|
16972
|
-
const baseUrl = await getBaseUrl();
|
|
16973
|
-
const headers = await getRawHeaders();
|
|
16974
|
-
const orgPath = await appendOrgParam(path);
|
|
16975
|
-
return fetch(`${baseUrl}${orgPath}`, {
|
|
16976
|
-
method: "POST",
|
|
16977
|
-
headers: {
|
|
16978
|
-
...headers,
|
|
16979
|
-
"Content-Type": "application/json"
|
|
16980
|
-
},
|
|
16981
|
-
body: JSON.stringify(body)
|
|
16982
|
-
});
|
|
16983
|
-
}
|
|
16984
|
-
|
|
16985
17162
|
// src/lib/api/domains/skills.ts
|
|
17163
|
+
import { initClient as initClient3 } from "@ts-rest/core";
|
|
16986
17164
|
import chalk2 from "chalk";
|
|
16987
|
-
function isResolveSkillsResponse(value) {
|
|
16988
|
-
if (typeof value !== "object" || value === null) return false;
|
|
16989
|
-
const obj = value;
|
|
16990
|
-
return typeof obj.resolved === "object" && obj.resolved !== null && Array.isArray(obj.unresolved);
|
|
16991
|
-
}
|
|
16992
17165
|
async function resolveSkills(skillUrls) {
|
|
16993
17166
|
try {
|
|
16994
|
-
const
|
|
16995
|
-
|
|
16996
|
-
});
|
|
16997
|
-
if (
|
|
16998
|
-
|
|
16999
|
-
|
|
17000
|
-
|
|
17001
|
-
|
|
17002
|
-
}
|
|
17003
|
-
const body = await response.json();
|
|
17004
|
-
if (!isResolveSkillsResponse(body)) {
|
|
17005
|
-
console.error(
|
|
17006
|
-
chalk2.dim(
|
|
17007
|
-
" Skill resolve returned unexpected format, downloading all skills"
|
|
17008
|
-
)
|
|
17009
|
-
);
|
|
17010
|
-
return { resolved: {}, unresolved: skillUrls };
|
|
17011
|
-
}
|
|
17012
|
-
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 };
|
|
17013
17175
|
} catch {
|
|
17014
17176
|
console.error(
|
|
17015
17177
|
chalk2.dim(" Skill resolve unavailable, downloading all skills")
|
|
@@ -17019,12 +17181,12 @@ async function resolveSkills(skillUrls) {
|
|
|
17019
17181
|
}
|
|
17020
17182
|
|
|
17021
17183
|
// src/lib/api/domains/zero-orgs.ts
|
|
17022
|
-
import { initClient as
|
|
17184
|
+
import { initClient as initClient4 } from "@ts-rest/core";
|
|
17023
17185
|
async function getUserTokenClientConfig() {
|
|
17024
17186
|
const baseUrl = await getBaseUrl();
|
|
17025
17187
|
const token = await getToken();
|
|
17026
17188
|
if (!token) {
|
|
17027
|
-
throw new
|
|
17189
|
+
throw new ApiRequestError("Not authenticated", "UNAUTHORIZED", 401);
|
|
17028
17190
|
}
|
|
17029
17191
|
const headers = {
|
|
17030
17192
|
Authorization: `Bearer ${token}`
|
|
@@ -17037,7 +17199,7 @@ async function getUserTokenClientConfig() {
|
|
|
17037
17199
|
}
|
|
17038
17200
|
async function getZeroOrg() {
|
|
17039
17201
|
const config = await getClientConfig();
|
|
17040
|
-
const client =
|
|
17202
|
+
const client = initClient4(zeroOrgContract, config);
|
|
17041
17203
|
const result = await client.get({ headers: {} });
|
|
17042
17204
|
if (result.status === 200) {
|
|
17043
17205
|
return result.body;
|
|
@@ -17046,7 +17208,7 @@ async function getZeroOrg() {
|
|
|
17046
17208
|
}
|
|
17047
17209
|
async function updateZeroOrg(body) {
|
|
17048
17210
|
const config = await getClientConfig();
|
|
17049
|
-
const client =
|
|
17211
|
+
const client = initClient4(zeroOrgContract, config);
|
|
17050
17212
|
const result = await client.update({ body });
|
|
17051
17213
|
if (result.status === 200) {
|
|
17052
17214
|
return result.body;
|
|
@@ -17055,7 +17217,7 @@ async function updateZeroOrg(body) {
|
|
|
17055
17217
|
}
|
|
17056
17218
|
async function listZeroOrgs() {
|
|
17057
17219
|
const config = await getUserTokenClientConfig();
|
|
17058
|
-
const client =
|
|
17220
|
+
const client = initClient4(zeroOrgListContract, config);
|
|
17059
17221
|
const result = await client.list({ headers: {} });
|
|
17060
17222
|
if (result.status === 200) {
|
|
17061
17223
|
return result.body;
|
|
@@ -17064,7 +17226,7 @@ async function listZeroOrgs() {
|
|
|
17064
17226
|
}
|
|
17065
17227
|
async function getZeroOrgMembers() {
|
|
17066
17228
|
const config = await getClientConfig();
|
|
17067
|
-
const client =
|
|
17229
|
+
const client = initClient4(zeroOrgMembersContract, config);
|
|
17068
17230
|
const result = await client.members({ headers: {} });
|
|
17069
17231
|
if (result.status === 200) {
|
|
17070
17232
|
return result.body;
|
|
@@ -17073,7 +17235,7 @@ async function getZeroOrgMembers() {
|
|
|
17073
17235
|
}
|
|
17074
17236
|
async function inviteZeroOrgMember(email) {
|
|
17075
17237
|
const config = await getClientConfig();
|
|
17076
|
-
const client =
|
|
17238
|
+
const client = initClient4(zeroOrgInviteContract, config);
|
|
17077
17239
|
const result = await client.invite({
|
|
17078
17240
|
body: { email }
|
|
17079
17241
|
});
|
|
@@ -17084,7 +17246,7 @@ async function inviteZeroOrgMember(email) {
|
|
|
17084
17246
|
}
|
|
17085
17247
|
async function removeZeroOrgMember(email) {
|
|
17086
17248
|
const config = await getClientConfig();
|
|
17087
|
-
const client =
|
|
17249
|
+
const client = initClient4(zeroOrgMembersContract, config);
|
|
17088
17250
|
const result = await client.removeMember({
|
|
17089
17251
|
body: { email }
|
|
17090
17252
|
});
|
|
@@ -17095,7 +17257,7 @@ async function removeZeroOrgMember(email) {
|
|
|
17095
17257
|
}
|
|
17096
17258
|
async function leaveZeroOrg() {
|
|
17097
17259
|
const config = await getClientConfig();
|
|
17098
|
-
const client =
|
|
17260
|
+
const client = initClient4(zeroOrgLeaveContract, config);
|
|
17099
17261
|
const result = await client.leave({
|
|
17100
17262
|
body: {}
|
|
17101
17263
|
});
|
|
@@ -17106,7 +17268,7 @@ async function leaveZeroOrg() {
|
|
|
17106
17268
|
}
|
|
17107
17269
|
async function deleteZeroOrg(slug) {
|
|
17108
17270
|
const config = await getClientConfig();
|
|
17109
|
-
const client =
|
|
17271
|
+
const client = initClient4(zeroOrgDeleteContract, config);
|
|
17110
17272
|
const result = await client.delete({
|
|
17111
17273
|
body: { slug }
|
|
17112
17274
|
});
|
|
@@ -17117,10 +17279,10 @@ async function deleteZeroOrg(slug) {
|
|
|
17117
17279
|
}
|
|
17118
17280
|
|
|
17119
17281
|
// src/lib/api/domains/zero-secrets.ts
|
|
17120
|
-
import { initClient as
|
|
17282
|
+
import { initClient as initClient5 } from "@ts-rest/core";
|
|
17121
17283
|
async function listZeroSecrets() {
|
|
17122
17284
|
const config = await getClientConfig();
|
|
17123
|
-
const client =
|
|
17285
|
+
const client = initClient5(zeroSecretsContract, config);
|
|
17124
17286
|
const result = await client.list({ headers: {} });
|
|
17125
17287
|
if (result.status === 200) {
|
|
17126
17288
|
return result.body;
|
|
@@ -17129,7 +17291,7 @@ async function listZeroSecrets() {
|
|
|
17129
17291
|
}
|
|
17130
17292
|
async function setZeroSecret(body) {
|
|
17131
17293
|
const config = await getClientConfig();
|
|
17132
|
-
const client =
|
|
17294
|
+
const client = initClient5(zeroSecretsContract, config);
|
|
17133
17295
|
const result = await client.set({ body });
|
|
17134
17296
|
if (result.status === 200 || result.status === 201) {
|
|
17135
17297
|
return result.body;
|
|
@@ -17138,7 +17300,7 @@ async function setZeroSecret(body) {
|
|
|
17138
17300
|
}
|
|
17139
17301
|
async function deleteZeroSecret(name) {
|
|
17140
17302
|
const config = await getClientConfig();
|
|
17141
|
-
const client =
|
|
17303
|
+
const client = initClient5(zeroSecretsByNameContract, config);
|
|
17142
17304
|
const result = await client.delete({
|
|
17143
17305
|
params: { name }
|
|
17144
17306
|
});
|
|
@@ -17149,10 +17311,10 @@ async function deleteZeroSecret(name) {
|
|
|
17149
17311
|
}
|
|
17150
17312
|
|
|
17151
17313
|
// src/lib/api/domains/zero-variables.ts
|
|
17152
|
-
import { initClient as
|
|
17314
|
+
import { initClient as initClient6 } from "@ts-rest/core";
|
|
17153
17315
|
async function listZeroVariables() {
|
|
17154
17316
|
const config = await getClientConfig();
|
|
17155
|
-
const client =
|
|
17317
|
+
const client = initClient6(zeroVariablesContract, config);
|
|
17156
17318
|
const result = await client.list({ headers: {} });
|
|
17157
17319
|
if (result.status === 200) {
|
|
17158
17320
|
return result.body;
|
|
@@ -17161,7 +17323,7 @@ async function listZeroVariables() {
|
|
|
17161
17323
|
}
|
|
17162
17324
|
async function setZeroVariable(body) {
|
|
17163
17325
|
const config = await getClientConfig();
|
|
17164
|
-
const client =
|
|
17326
|
+
const client = initClient6(zeroVariablesContract, config);
|
|
17165
17327
|
const result = await client.set({ body });
|
|
17166
17328
|
if (result.status === 200 || result.status === 201) {
|
|
17167
17329
|
return result.body;
|
|
@@ -17170,7 +17332,7 @@ async function setZeroVariable(body) {
|
|
|
17170
17332
|
}
|
|
17171
17333
|
async function deleteZeroVariable(name) {
|
|
17172
17334
|
const config = await getClientConfig();
|
|
17173
|
-
const client =
|
|
17335
|
+
const client = initClient6(zeroVariablesByNameContract, config);
|
|
17174
17336
|
const result = await client.delete({
|
|
17175
17337
|
params: { name }
|
|
17176
17338
|
});
|
|
@@ -17181,10 +17343,10 @@ async function deleteZeroVariable(name) {
|
|
|
17181
17343
|
}
|
|
17182
17344
|
|
|
17183
17345
|
// src/lib/api/domains/zero-connectors.ts
|
|
17184
|
-
import { initClient as
|
|
17346
|
+
import { initClient as initClient7 } from "@ts-rest/core";
|
|
17185
17347
|
async function listZeroConnectors() {
|
|
17186
17348
|
const config = await getClientConfig();
|
|
17187
|
-
const client =
|
|
17349
|
+
const client = initClient7(zeroConnectorsMainContract, config);
|
|
17188
17350
|
const result = await client.list({ headers: {} });
|
|
17189
17351
|
if (result.status === 200) {
|
|
17190
17352
|
return result.body;
|
|
@@ -17193,7 +17355,7 @@ async function listZeroConnectors() {
|
|
|
17193
17355
|
}
|
|
17194
17356
|
async function getZeroConnector(type) {
|
|
17195
17357
|
const config = await getClientConfig();
|
|
17196
|
-
const client =
|
|
17358
|
+
const client = initClient7(zeroConnectorsByTypeContract, config);
|
|
17197
17359
|
const result = await client.get({
|
|
17198
17360
|
params: { type }
|
|
17199
17361
|
});
|
|
@@ -17207,7 +17369,7 @@ async function getZeroConnector(type) {
|
|
|
17207
17369
|
}
|
|
17208
17370
|
async function deleteZeroConnector(type) {
|
|
17209
17371
|
const config = await getClientConfig();
|
|
17210
|
-
const client =
|
|
17372
|
+
const client = initClient7(zeroConnectorsByTypeContract, config);
|
|
17211
17373
|
const result = await client.delete({
|
|
17212
17374
|
params: { type }
|
|
17213
17375
|
});
|
|
@@ -17218,7 +17380,7 @@ async function deleteZeroConnector(type) {
|
|
|
17218
17380
|
}
|
|
17219
17381
|
async function createZeroConnectorSession(type) {
|
|
17220
17382
|
const config = await getClientConfig();
|
|
17221
|
-
const client =
|
|
17383
|
+
const client = initClient7(zeroConnectorSessionsContract, config);
|
|
17222
17384
|
const result = await client.create({
|
|
17223
17385
|
params: { type },
|
|
17224
17386
|
body: {}
|
|
@@ -17230,7 +17392,7 @@ async function createZeroConnectorSession(type) {
|
|
|
17230
17392
|
}
|
|
17231
17393
|
async function getZeroConnectorSession(type, sessionId) {
|
|
17232
17394
|
const config = await getClientConfig();
|
|
17233
|
-
const client =
|
|
17395
|
+
const client = initClient7(zeroConnectorSessionByIdContract, config);
|
|
17234
17396
|
const result = await client.get({
|
|
17235
17397
|
params: { type, sessionId }
|
|
17236
17398
|
});
|
|
@@ -17241,7 +17403,7 @@ async function getZeroConnectorSession(type, sessionId) {
|
|
|
17241
17403
|
}
|
|
17242
17404
|
async function createZeroComputerConnector() {
|
|
17243
17405
|
const config = await getClientConfig();
|
|
17244
|
-
const client =
|
|
17406
|
+
const client = initClient7(zeroComputerConnectorContract, config);
|
|
17245
17407
|
const result = await client.create({
|
|
17246
17408
|
body: {}
|
|
17247
17409
|
});
|
|
@@ -17252,7 +17414,7 @@ async function createZeroComputerConnector() {
|
|
|
17252
17414
|
}
|
|
17253
17415
|
async function deleteZeroComputerConnector() {
|
|
17254
17416
|
const config = await getClientConfig();
|
|
17255
|
-
const client =
|
|
17417
|
+
const client = initClient7(zeroComputerConnectorContract, config);
|
|
17256
17418
|
const result = await client.delete({});
|
|
17257
17419
|
if (result.status === 204) {
|
|
17258
17420
|
return;
|
|
@@ -17261,10 +17423,10 @@ async function deleteZeroComputerConnector() {
|
|
|
17261
17423
|
}
|
|
17262
17424
|
|
|
17263
17425
|
// src/lib/api/domains/runs.ts
|
|
17264
|
-
import { initClient as
|
|
17426
|
+
import { initClient as initClient8 } from "@ts-rest/core";
|
|
17265
17427
|
async function createRun(body) {
|
|
17266
17428
|
const config = await getClientConfig();
|
|
17267
|
-
const client =
|
|
17429
|
+
const client = initClient8(runsMainContract, config);
|
|
17268
17430
|
const result = await client.create({ body });
|
|
17269
17431
|
if (result.status === 201) {
|
|
17270
17432
|
return result.body;
|
|
@@ -17273,7 +17435,7 @@ async function createRun(body) {
|
|
|
17273
17435
|
}
|
|
17274
17436
|
async function getEvents(runId, options) {
|
|
17275
17437
|
const config = await getClientConfig();
|
|
17276
|
-
const client =
|
|
17438
|
+
const client = initClient8(runEventsContract, config);
|
|
17277
17439
|
const result = await client.getEvents({
|
|
17278
17440
|
params: { id: runId },
|
|
17279
17441
|
query: {
|
|
@@ -17288,7 +17450,7 @@ async function getEvents(runId, options) {
|
|
|
17288
17450
|
}
|
|
17289
17451
|
async function listRuns(params) {
|
|
17290
17452
|
const config = await getClientConfig();
|
|
17291
|
-
const client =
|
|
17453
|
+
const client = initClient8(runsMainContract, config);
|
|
17292
17454
|
const result = await client.list({
|
|
17293
17455
|
query: {
|
|
17294
17456
|
status: params?.status,
|
|
@@ -17305,7 +17467,7 @@ async function listRuns(params) {
|
|
|
17305
17467
|
}
|
|
17306
17468
|
async function getRunQueue() {
|
|
17307
17469
|
const config = await getClientConfig();
|
|
17308
|
-
const client =
|
|
17470
|
+
const client = initClient8(runsQueueContract, config);
|
|
17309
17471
|
const result = await client.getQueue({ headers: {} });
|
|
17310
17472
|
if (result.status === 200) {
|
|
17311
17473
|
return result.body;
|
|
@@ -17314,7 +17476,7 @@ async function getRunQueue() {
|
|
|
17314
17476
|
}
|
|
17315
17477
|
async function cancelRun(runId) {
|
|
17316
17478
|
const config = await getClientConfig();
|
|
17317
|
-
const client =
|
|
17479
|
+
const client = initClient8(runsCancelContract, config);
|
|
17318
17480
|
const result = await client.cancel({
|
|
17319
17481
|
params: { id: runId }
|
|
17320
17482
|
});
|
|
@@ -17325,10 +17487,10 @@ async function cancelRun(runId) {
|
|
|
17325
17487
|
}
|
|
17326
17488
|
|
|
17327
17489
|
// src/lib/api/domains/sessions.ts
|
|
17328
|
-
import { initClient as
|
|
17490
|
+
import { initClient as initClient9 } from "@ts-rest/core";
|
|
17329
17491
|
async function getSession(sessionId) {
|
|
17330
17492
|
const config = await getClientConfig();
|
|
17331
|
-
const client =
|
|
17493
|
+
const client = initClient9(sessionsByIdContract, config);
|
|
17332
17494
|
const result = await client.getById({
|
|
17333
17495
|
params: { id: sessionId }
|
|
17334
17496
|
});
|
|
@@ -17341,7 +17503,7 @@ async function getSession(sessionId) {
|
|
|
17341
17503
|
}
|
|
17342
17504
|
async function getCheckpoint(checkpointId) {
|
|
17343
17505
|
const config = await getClientConfig();
|
|
17344
|
-
const client =
|
|
17506
|
+
const client = initClient9(checkpointsByIdContract, config);
|
|
17345
17507
|
const result = await client.getById({
|
|
17346
17508
|
params: { id: checkpointId }
|
|
17347
17509
|
});
|
|
@@ -17352,10 +17514,10 @@ async function getCheckpoint(checkpointId) {
|
|
|
17352
17514
|
}
|
|
17353
17515
|
|
|
17354
17516
|
// src/lib/api/domains/storages.ts
|
|
17355
|
-
import { initClient as
|
|
17517
|
+
import { initClient as initClient10 } from "@ts-rest/core";
|
|
17356
17518
|
async function prepareStorage(body) {
|
|
17357
17519
|
const config = await getClientConfig();
|
|
17358
|
-
const client =
|
|
17520
|
+
const client = initClient10(storagesPrepareContract, config);
|
|
17359
17521
|
const result = await client.prepare({ body });
|
|
17360
17522
|
if (result.status === 200) {
|
|
17361
17523
|
return result.body;
|
|
@@ -17364,7 +17526,7 @@ async function prepareStorage(body) {
|
|
|
17364
17526
|
}
|
|
17365
17527
|
async function commitStorage(body) {
|
|
17366
17528
|
const config = await getClientConfig();
|
|
17367
|
-
const client =
|
|
17529
|
+
const client = initClient10(storagesCommitContract, config);
|
|
17368
17530
|
const result = await client.commit({ body });
|
|
17369
17531
|
if (result.status === 200) {
|
|
17370
17532
|
return result.body;
|
|
@@ -17373,7 +17535,7 @@ async function commitStorage(body) {
|
|
|
17373
17535
|
}
|
|
17374
17536
|
async function getStorageDownload(query) {
|
|
17375
17537
|
const config = await getClientConfig();
|
|
17376
|
-
const client =
|
|
17538
|
+
const client = initClient10(storagesDownloadContract, config);
|
|
17377
17539
|
const result = await client.download({
|
|
17378
17540
|
query: {
|
|
17379
17541
|
name: query.name,
|
|
@@ -17388,7 +17550,7 @@ async function getStorageDownload(query) {
|
|
|
17388
17550
|
}
|
|
17389
17551
|
async function listStorages(query) {
|
|
17390
17552
|
const config = await getClientConfig();
|
|
17391
|
-
const client =
|
|
17553
|
+
const client = initClient10(storagesListContract, config);
|
|
17392
17554
|
const result = await client.list({ query });
|
|
17393
17555
|
if (result.status === 200) {
|
|
17394
17556
|
return result.body;
|
|
@@ -17397,10 +17559,10 @@ async function listStorages(query) {
|
|
|
17397
17559
|
}
|
|
17398
17560
|
|
|
17399
17561
|
// src/lib/api/domains/zero-org-secrets.ts
|
|
17400
|
-
import { initClient as
|
|
17562
|
+
import { initClient as initClient11 } from "@ts-rest/core";
|
|
17401
17563
|
async function listZeroOrgSecrets() {
|
|
17402
17564
|
const config = await getClientConfig();
|
|
17403
|
-
const client =
|
|
17565
|
+
const client = initClient11(zeroSecretsContract, config);
|
|
17404
17566
|
const result = await client.list({ headers: {} });
|
|
17405
17567
|
if (result.status === 200) {
|
|
17406
17568
|
return result.body;
|
|
@@ -17409,7 +17571,7 @@ async function listZeroOrgSecrets() {
|
|
|
17409
17571
|
}
|
|
17410
17572
|
async function setZeroOrgSecret(body) {
|
|
17411
17573
|
const config = await getClientConfig();
|
|
17412
|
-
const client =
|
|
17574
|
+
const client = initClient11(zeroSecretsContract, config);
|
|
17413
17575
|
const result = await client.set({ body });
|
|
17414
17576
|
if (result.status === 200 || result.status === 201) {
|
|
17415
17577
|
return result.body;
|
|
@@ -17418,7 +17580,7 @@ async function setZeroOrgSecret(body) {
|
|
|
17418
17580
|
}
|
|
17419
17581
|
async function deleteZeroOrgSecret(name) {
|
|
17420
17582
|
const config = await getClientConfig();
|
|
17421
|
-
const client =
|
|
17583
|
+
const client = initClient11(zeroSecretsByNameContract, config);
|
|
17422
17584
|
const result = await client.delete({
|
|
17423
17585
|
params: { name }
|
|
17424
17586
|
});
|
|
@@ -17429,10 +17591,10 @@ async function deleteZeroOrgSecret(name) {
|
|
|
17429
17591
|
}
|
|
17430
17592
|
|
|
17431
17593
|
// src/lib/api/domains/zero-org-variables.ts
|
|
17432
|
-
import { initClient as
|
|
17594
|
+
import { initClient as initClient12 } from "@ts-rest/core";
|
|
17433
17595
|
async function listZeroOrgVariables() {
|
|
17434
17596
|
const config = await getClientConfig();
|
|
17435
|
-
const client =
|
|
17597
|
+
const client = initClient12(zeroVariablesContract, config);
|
|
17436
17598
|
const result = await client.list({ headers: {} });
|
|
17437
17599
|
if (result.status === 200) {
|
|
17438
17600
|
return result.body;
|
|
@@ -17441,7 +17603,7 @@ async function listZeroOrgVariables() {
|
|
|
17441
17603
|
}
|
|
17442
17604
|
async function setZeroOrgVariable(body) {
|
|
17443
17605
|
const config = await getClientConfig();
|
|
17444
|
-
const client =
|
|
17606
|
+
const client = initClient12(zeroVariablesContract, config);
|
|
17445
17607
|
const result = await client.set({ body });
|
|
17446
17608
|
if (result.status === 200 || result.status === 201) {
|
|
17447
17609
|
return result.body;
|
|
@@ -17450,7 +17612,7 @@ async function setZeroOrgVariable(body) {
|
|
|
17450
17612
|
}
|
|
17451
17613
|
async function deleteZeroOrgVariable(name) {
|
|
17452
17614
|
const config = await getClientConfig();
|
|
17453
|
-
const client =
|
|
17615
|
+
const client = initClient12(zeroVariablesByNameContract, config);
|
|
17454
17616
|
const result = await client.delete({
|
|
17455
17617
|
params: { name }
|
|
17456
17618
|
});
|
|
@@ -17461,10 +17623,10 @@ async function deleteZeroOrgVariable(name) {
|
|
|
17461
17623
|
}
|
|
17462
17624
|
|
|
17463
17625
|
// src/lib/api/domains/zero-org-model-providers.ts
|
|
17464
|
-
import { initClient as
|
|
17626
|
+
import { initClient as initClient13 } from "@ts-rest/core";
|
|
17465
17627
|
async function listZeroOrgModelProviders() {
|
|
17466
17628
|
const config = await getClientConfig();
|
|
17467
|
-
const client =
|
|
17629
|
+
const client = initClient13(zeroModelProvidersMainContract, config);
|
|
17468
17630
|
const result = await client.list({ headers: {} });
|
|
17469
17631
|
if (result.status === 200) {
|
|
17470
17632
|
return result.body;
|
|
@@ -17473,7 +17635,7 @@ async function listZeroOrgModelProviders() {
|
|
|
17473
17635
|
}
|
|
17474
17636
|
async function upsertZeroOrgModelProvider(body) {
|
|
17475
17637
|
const config = await getClientConfig();
|
|
17476
|
-
const client =
|
|
17638
|
+
const client = initClient13(zeroModelProvidersMainContract, config);
|
|
17477
17639
|
const result = await client.upsert({ body });
|
|
17478
17640
|
if (result.status === 200 || result.status === 201) {
|
|
17479
17641
|
return result.body;
|
|
@@ -17482,7 +17644,7 @@ async function upsertZeroOrgModelProvider(body) {
|
|
|
17482
17644
|
}
|
|
17483
17645
|
async function deleteZeroOrgModelProvider(type) {
|
|
17484
17646
|
const config = await getClientConfig();
|
|
17485
|
-
const client =
|
|
17647
|
+
const client = initClient13(zeroModelProvidersByTypeContract, config);
|
|
17486
17648
|
const result = await client.delete({
|
|
17487
17649
|
params: { type }
|
|
17488
17650
|
});
|
|
@@ -17493,7 +17655,7 @@ async function deleteZeroOrgModelProvider(type) {
|
|
|
17493
17655
|
}
|
|
17494
17656
|
async function setZeroOrgModelProviderDefault(type) {
|
|
17495
17657
|
const config = await getClientConfig();
|
|
17496
|
-
const client =
|
|
17658
|
+
const client = initClient13(zeroModelProvidersDefaultContract, config);
|
|
17497
17659
|
const result = await client.setDefault({
|
|
17498
17660
|
params: { type }
|
|
17499
17661
|
});
|
|
@@ -17504,7 +17666,7 @@ async function setZeroOrgModelProviderDefault(type) {
|
|
|
17504
17666
|
}
|
|
17505
17667
|
async function updateZeroOrgModelProviderModel(type, selectedModel) {
|
|
17506
17668
|
const config = await getClientConfig();
|
|
17507
|
-
const client =
|
|
17669
|
+
const client = initClient13(zeroModelProvidersUpdateModelContract, config);
|
|
17508
17670
|
const result = await client.updateModel({
|
|
17509
17671
|
params: { type },
|
|
17510
17672
|
body: { selectedModel }
|
|
@@ -17516,52 +17678,52 @@ async function updateZeroOrgModelProviderModel(type, selectedModel) {
|
|
|
17516
17678
|
}
|
|
17517
17679
|
|
|
17518
17680
|
// src/lib/api/domains/zero-agents.ts
|
|
17519
|
-
import { initClient as
|
|
17681
|
+
import { initClient as initClient14 } from "@ts-rest/core";
|
|
17520
17682
|
async function createZeroAgent(body) {
|
|
17521
17683
|
const config = await getClientConfig();
|
|
17522
|
-
const client =
|
|
17684
|
+
const client = initClient14(zeroAgentsMainContract, config);
|
|
17523
17685
|
const result = await client.create({ body });
|
|
17524
17686
|
if (result.status === 201) return result.body;
|
|
17525
17687
|
handleError(result, "Failed to create zero agent");
|
|
17526
17688
|
}
|
|
17527
17689
|
async function listZeroAgents() {
|
|
17528
17690
|
const config = await getClientConfig();
|
|
17529
|
-
const client =
|
|
17691
|
+
const client = initClient14(zeroAgentsMainContract, config);
|
|
17530
17692
|
const result = await client.list({ headers: {} });
|
|
17531
17693
|
if (result.status === 200) return result.body;
|
|
17532
17694
|
handleError(result, "Failed to list zero agents");
|
|
17533
17695
|
}
|
|
17534
17696
|
async function getZeroAgent(id) {
|
|
17535
17697
|
const config = await getClientConfig();
|
|
17536
|
-
const client =
|
|
17698
|
+
const client = initClient14(zeroAgentsByIdContract, config);
|
|
17537
17699
|
const result = await client.get({ params: { id } });
|
|
17538
17700
|
if (result.status === 200) return result.body;
|
|
17539
17701
|
handleError(result, `Zero agent "${id}" not found`);
|
|
17540
17702
|
}
|
|
17541
17703
|
async function updateZeroAgent(id, body) {
|
|
17542
17704
|
const config = await getClientConfig();
|
|
17543
|
-
const client =
|
|
17705
|
+
const client = initClient14(zeroAgentsByIdContract, config);
|
|
17544
17706
|
const result = await client.update({ params: { id }, body });
|
|
17545
17707
|
if (result.status === 200) return result.body;
|
|
17546
17708
|
handleError(result, `Failed to update zero agent "${id}"`);
|
|
17547
17709
|
}
|
|
17548
17710
|
async function deleteZeroAgent(id) {
|
|
17549
17711
|
const config = await getClientConfig();
|
|
17550
|
-
const client =
|
|
17712
|
+
const client = initClient14(zeroAgentsByIdContract, config);
|
|
17551
17713
|
const result = await client.delete({ params: { id } });
|
|
17552
17714
|
if (result.status === 204) return;
|
|
17553
17715
|
handleError(result, `Zero agent "${id}" not found`);
|
|
17554
17716
|
}
|
|
17555
17717
|
async function getZeroAgentInstructions(id) {
|
|
17556
17718
|
const config = await getClientConfig();
|
|
17557
|
-
const client =
|
|
17719
|
+
const client = initClient14(zeroAgentInstructionsContract, config);
|
|
17558
17720
|
const result = await client.get({ params: { id } });
|
|
17559
17721
|
if (result.status === 200) return result.body;
|
|
17560
17722
|
handleError(result, `Failed to get instructions for zero agent "${id}"`);
|
|
17561
17723
|
}
|
|
17562
17724
|
async function updateZeroAgentInstructions(id, content) {
|
|
17563
17725
|
const config = await getClientConfig();
|
|
17564
|
-
const client =
|
|
17726
|
+
const client = initClient14(zeroAgentInstructionsContract, config);
|
|
17565
17727
|
const result = await client.update({
|
|
17566
17728
|
params: { id },
|
|
17567
17729
|
body: { content }
|
|
@@ -17571,10 +17733,10 @@ async function updateZeroAgentInstructions(id, content) {
|
|
|
17571
17733
|
}
|
|
17572
17734
|
|
|
17573
17735
|
// src/lib/api/domains/integrations-slack.ts
|
|
17574
|
-
import { initClient as
|
|
17736
|
+
import { initClient as initClient15 } from "@ts-rest/core";
|
|
17575
17737
|
async function sendSlackMessage(body) {
|
|
17576
17738
|
const config = await getClientConfig();
|
|
17577
|
-
const client =
|
|
17739
|
+
const client = initClient15(integrationsSlackMessageContract, config);
|
|
17578
17740
|
const result = await client.sendMessage({ body, headers: {} });
|
|
17579
17741
|
if (result.status === 200) {
|
|
17580
17742
|
return result.body;
|
|
@@ -17583,10 +17745,10 @@ async function sendSlackMessage(body) {
|
|
|
17583
17745
|
}
|
|
17584
17746
|
|
|
17585
17747
|
// src/lib/api/domains/zero-schedules.ts
|
|
17586
|
-
import { initClient as
|
|
17748
|
+
import { initClient as initClient16 } from "@ts-rest/core";
|
|
17587
17749
|
async function deployZeroSchedule(body) {
|
|
17588
17750
|
const config = await getClientConfig();
|
|
17589
|
-
const client =
|
|
17751
|
+
const client = initClient16(zeroSchedulesMainContract, config);
|
|
17590
17752
|
const result = await client.deploy({ body });
|
|
17591
17753
|
if (result.status === 200 || result.status === 201) {
|
|
17592
17754
|
return result.body;
|
|
@@ -17595,7 +17757,7 @@ async function deployZeroSchedule(body) {
|
|
|
17595
17757
|
}
|
|
17596
17758
|
async function listZeroSchedules() {
|
|
17597
17759
|
const config = await getClientConfig();
|
|
17598
|
-
const client =
|
|
17760
|
+
const client = initClient16(zeroSchedulesMainContract, config);
|
|
17599
17761
|
const result = await client.list({ headers: {} });
|
|
17600
17762
|
if (result.status === 200) {
|
|
17601
17763
|
return result.body;
|
|
@@ -17604,7 +17766,7 @@ async function listZeroSchedules() {
|
|
|
17604
17766
|
}
|
|
17605
17767
|
async function deleteZeroSchedule(params) {
|
|
17606
17768
|
const config = await getClientConfig();
|
|
17607
|
-
const client =
|
|
17769
|
+
const client = initClient16(zeroSchedulesByNameContract, config);
|
|
17608
17770
|
const result = await client.delete({
|
|
17609
17771
|
params: { name: params.name },
|
|
17610
17772
|
query: { agentId: params.agentId }
|
|
@@ -17616,7 +17778,7 @@ async function deleteZeroSchedule(params) {
|
|
|
17616
17778
|
}
|
|
17617
17779
|
async function enableZeroSchedule(params) {
|
|
17618
17780
|
const config = await getClientConfig();
|
|
17619
|
-
const client =
|
|
17781
|
+
const client = initClient16(zeroSchedulesEnableContract, config);
|
|
17620
17782
|
const result = await client.enable({
|
|
17621
17783
|
params: { name: params.name },
|
|
17622
17784
|
body: { agentId: params.agentId }
|
|
@@ -17628,7 +17790,7 @@ async function enableZeroSchedule(params) {
|
|
|
17628
17790
|
}
|
|
17629
17791
|
async function disableZeroSchedule(params) {
|
|
17630
17792
|
const config = await getClientConfig();
|
|
17631
|
-
const client =
|
|
17793
|
+
const client = initClient16(zeroSchedulesEnableContract, config);
|
|
17632
17794
|
const result = await client.disable({
|
|
17633
17795
|
params: { name: params.name },
|
|
17634
17796
|
body: { agentId: params.agentId }
|
|
@@ -17752,32 +17914,22 @@ async function promptPassword(message) {
|
|
|
17752
17914
|
|
|
17753
17915
|
export {
|
|
17754
17916
|
configureGlobalProxyFromEnv,
|
|
17917
|
+
decodeZeroTokenPayload,
|
|
17755
17918
|
loadConfig,
|
|
17756
17919
|
saveConfig,
|
|
17757
17920
|
getToken,
|
|
17758
|
-
getActiveToken,
|
|
17759
17921
|
getApiUrl,
|
|
17760
|
-
decodeZeroTokenPayload,
|
|
17761
17922
|
getActiveOrg,
|
|
17762
17923
|
clearConfig,
|
|
17763
17924
|
extractAndGroupVariables,
|
|
17764
17925
|
volumeConfigSchema,
|
|
17765
17926
|
agentDefinitionSchema,
|
|
17766
|
-
composesMainContract,
|
|
17767
|
-
composesByIdContract,
|
|
17768
|
-
composesVersionsContract,
|
|
17769
17927
|
ALL_RUN_STATUSES,
|
|
17770
|
-
runsMainContract,
|
|
17771
|
-
runEventsContract,
|
|
17772
17928
|
runSystemLogContract,
|
|
17773
17929
|
runMetricsContract,
|
|
17774
17930
|
runAgentEventsContract,
|
|
17775
17931
|
runNetworkLogsContract,
|
|
17776
17932
|
logsSearchContract,
|
|
17777
|
-
storagesPrepareContract,
|
|
17778
|
-
storagesCommitContract,
|
|
17779
|
-
storagesDownloadContract,
|
|
17780
|
-
storagesListContract,
|
|
17781
17933
|
MODEL_PROVIDER_TYPES,
|
|
17782
17934
|
getSelectableProviderTypes,
|
|
17783
17935
|
hasAuthMethods,
|
|
@@ -17789,8 +17941,6 @@ export {
|
|
|
17789
17941
|
hasModelSelection,
|
|
17790
17942
|
allowsCustomModel,
|
|
17791
17943
|
getCustomModelPlaceholder,
|
|
17792
|
-
sessionsByIdContract,
|
|
17793
|
-
checkpointsByIdContract,
|
|
17794
17944
|
CONNECTOR_TYPES,
|
|
17795
17945
|
connectorTypeSchema,
|
|
17796
17946
|
getConnectorDerivedNames,
|
|
@@ -17882,4 +18032,4 @@ export {
|
|
|
17882
18032
|
promptSelect,
|
|
17883
18033
|
promptPassword
|
|
17884
18034
|
};
|
|
17885
|
-
//# sourceMappingURL=chunk-
|
|
18035
|
+
//# sourceMappingURL=chunk-2RXB3R33.js.map
|