@vm0/cli 9.90.2 → 9.90.3

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.
@@ -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.90.2",
50
+ release: "9.90.3",
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.90.2",
69
+ version: "9.90.3",
70
70
  command: process.argv.slice(2).join(" ")
71
71
  });
72
72
  Sentry.setContext("runtime", {
@@ -543,8 +543,7 @@ var composesMainContract = c.router({
543
543
  path: "/api/agent/composes",
544
544
  headers: authHeadersSchema,
545
545
  query: z3.object({
546
- name: z3.string().min(1, "Missing name query parameter"),
547
- org: z3.string().optional()
546
+ name: z3.string().min(1, "Missing name query parameter")
548
547
  }),
549
548
  responses: {
550
549
  200: composeResponseSchema,
@@ -660,15 +659,13 @@ var composesListContract = c.router({
660
659
  /**
661
660
  * GET /api/agent/composes/list?org={org}
662
661
  * List all agent composes for an org
663
- * If org is not provided, uses the authenticated user's default org
662
+ * Uses the authenticated user's active org.
664
663
  */
665
664
  list: {
666
665
  method: "GET",
667
666
  path: "/api/agent/composes/list",
668
667
  headers: authHeadersSchema,
669
- query: z3.object({
670
- org: z3.string().optional()
671
- }),
668
+ query: z3.object({}),
672
669
  responses: {
673
670
  200: z3.object({
674
671
  composes: z3.array(composeListItemSchema)
@@ -859,7 +856,6 @@ var logsListContract = c2.router({
859
856
  search: z5.string().optional(),
860
857
  agent: z5.string().optional(),
861
858
  name: z5.string().optional(),
862
- org: z5.string().optional(),
863
859
  status: logStatusSchema.optional(),
864
860
  triggerSource: triggerSourceSchema.optional(),
865
861
  scheduleId: z5.string().uuid().optional()
@@ -996,7 +992,7 @@ var updateOrgRequestSchema = z7.object({
996
992
  });
997
993
  var orgDefaultAgentContract = c3.router({
998
994
  /**
999
- * PUT /api/zero/default-agent?org={slug}
995
+ * PUT /api/zero/default-agent
1000
996
  * Set or unset the default agent for an org.
1001
997
  * Only org admins can perform this action.
1002
998
  * The agent must belong to the same org.
@@ -1005,9 +1001,7 @@ var orgDefaultAgentContract = c3.router({
1005
1001
  method: "PUT",
1006
1002
  path: "/api/zero/default-agent",
1007
1003
  headers: authHeadersSchema,
1008
- query: z7.object({
1009
- org: z7.string().optional()
1010
- }),
1004
+ query: z7.object({}),
1011
1005
  body: z7.object({
1012
1006
  agentId: z7.uuid().nullable()
1013
1007
  }),
@@ -17380,8 +17374,7 @@ var zeroComposesMainContract = c24.router({
17380
17374
  path: "/api/zero/composes",
17381
17375
  headers: authHeadersSchema,
17382
17376
  query: z30.object({
17383
- name: z30.string().min(1, "Missing name query parameter"),
17384
- org: z30.string().optional()
17377
+ name: z30.string().min(1, "Missing name query parameter")
17385
17378
  }),
17386
17379
  responses: {
17387
17380
  200: composeResponseSchema,
@@ -17431,9 +17424,7 @@ var zeroComposesListContract = c24.router({
17431
17424
  method: "GET",
17432
17425
  path: "/api/zero/composes/list",
17433
17426
  headers: authHeadersSchema,
17434
- query: z30.object({
17435
- org: z30.string().optional()
17436
- }),
17427
+ query: z30.object({}),
17437
17428
  responses: {
17438
17429
  200: z30.object({
17439
17430
  composes: z30.array(composeListItemSchema)
@@ -18893,11 +18884,11 @@ function withErrorHandler(fn) {
18893
18884
 
18894
18885
  // src/lib/api/domains/composes.ts
18895
18886
  import { initClient } from "@ts-rest/core";
18896
- async function getComposeByName(name, org) {
18887
+ async function getComposeByName(name) {
18897
18888
  const config = await getClientConfig();
18898
18889
  const client = initClient(composesMainContract, config);
18899
18890
  const result = await client.getByName({
18900
- query: { name, org }
18891
+ query: { name }
18901
18892
  });
18902
18893
  if (result.status === 200) {
18903
18894
  return result.body;
@@ -18908,7 +18899,7 @@ async function getComposeByName(name, org) {
18908
18899
  handleError(result, `Compose not found: ${name}`);
18909
18900
  }
18910
18901
  var UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
18911
- async function resolveCompose(identifier, org) {
18902
+ async function resolveCompose(identifier) {
18912
18903
  if (UUID_PATTERN.test(identifier)) {
18913
18904
  try {
18914
18905
  return await getComposeById(identifier);
@@ -18919,7 +18910,7 @@ async function resolveCompose(identifier, org) {
18919
18910
  throw error;
18920
18911
  }
18921
18912
  }
18922
- return getComposeByName(identifier, org);
18913
+ return getComposeByName(identifier);
18923
18914
  }
18924
18915
  async function getComposeById(id) {
18925
18916
  const config = await getClientConfig();
@@ -18997,121 +18988,11 @@ async function resolveSkills(skillUrls) {
18997
18988
  }
18998
18989
  }
18999
18990
 
19000
- // src/lib/api/domains/zero-orgs.ts
19001
- import { initClient as initClient4 } from "@ts-rest/core";
19002
- async function getUserTokenClientConfig() {
19003
- const baseUrl = await getBaseUrl();
19004
- const token = await getToken();
19005
- if (!token) {
19006
- throw new ApiRequestError("Not authenticated", "UNAUTHORIZED", 401);
19007
- }
19008
- const headers = {
19009
- Authorization: `Bearer ${token}`
19010
- };
19011
- const bypassSecret = process.env.VERCEL_AUTOMATION_BYPASS_SECRET;
19012
- if (bypassSecret) {
19013
- headers["x-vercel-protection-bypass"] = bypassSecret;
19014
- }
19015
- return { baseUrl, baseHeaders: headers, jsonQuery: false };
19016
- }
19017
- async function getZeroOrg() {
19018
- const config = await getClientConfig();
19019
- const client = initClient4(zeroOrgContract, config);
19020
- const result = await client.get({ headers: {} });
19021
- if (result.status === 200) {
19022
- return result.body;
19023
- }
19024
- handleError(result, "Failed to get organization");
19025
- }
19026
- async function updateZeroOrg(body) {
19027
- const config = await getClientConfig();
19028
- const client = initClient4(zeroOrgContract, config);
19029
- const result = await client.update({ body });
19030
- if (result.status === 200) {
19031
- return result.body;
19032
- }
19033
- handleError(result, "Failed to update organization");
19034
- }
19035
- async function listZeroOrgs() {
19036
- const config = await getUserTokenClientConfig();
19037
- const client = initClient4(zeroOrgListContract, config);
19038
- const result = await client.list({ headers: {} });
19039
- if (result.status === 200) {
19040
- return result.body;
19041
- }
19042
- handleError(result, "Failed to list organizations");
19043
- }
19044
- async function getZeroOrgMembers() {
19045
- const config = await getClientConfig();
19046
- const client = initClient4(zeroOrgMembersContract, config);
19047
- const result = await client.members({ headers: {} });
19048
- if (result.status === 200) {
19049
- return result.body;
19050
- }
19051
- handleError(result, "Failed to get organization members");
19052
- }
19053
- async function inviteZeroOrgMember(email) {
19054
- const config = await getClientConfig();
19055
- const client = initClient4(zeroOrgInviteContract, config);
19056
- const result = await client.invite({
19057
- body: { email }
19058
- });
19059
- if (result.status === 200) {
19060
- return;
19061
- }
19062
- handleError(result, "Failed to invite member");
19063
- }
19064
- async function removeZeroOrgMember(email) {
19065
- const config = await getClientConfig();
19066
- const client = initClient4(zeroOrgMembersContract, config);
19067
- const result = await client.removeMember({
19068
- body: { email }
19069
- });
19070
- if (result.status === 200) {
19071
- return;
19072
- }
19073
- handleError(result, "Failed to remove member");
19074
- }
19075
- async function leaveZeroOrg() {
19076
- const config = await getClientConfig();
19077
- const client = initClient4(zeroOrgLeaveContract, config);
19078
- const result = await client.leave({
19079
- body: {}
19080
- });
19081
- if (result.status === 200) {
19082
- return;
19083
- }
19084
- handleError(result, "Failed to leave organization");
19085
- }
19086
- async function deleteZeroOrg(slug) {
19087
- const config = await getClientConfig();
19088
- const client = initClient4(zeroOrgDeleteContract, config);
19089
- const result = await client.delete({
19090
- body: { slug }
19091
- });
19092
- if (result.status === 200) {
19093
- return;
19094
- }
19095
- handleError(result, "Failed to delete organization");
19096
- }
19097
- async function switchZeroOrg(slug) {
19098
- const config = await getUserTokenClientConfig();
19099
- const client = initClient4(cliAuthOrgContract, config);
19100
- const result = await client.switchOrg({
19101
- headers: {},
19102
- body: { slug }
19103
- });
19104
- if (result.status === 200) {
19105
- return result.body;
19106
- }
19107
- handleError(result, "Failed to switch organization");
19108
- }
19109
-
19110
18991
  // src/lib/api/domains/zero-secrets.ts
19111
- import { initClient as initClient5 } from "@ts-rest/core";
18992
+ import { initClient as initClient4 } from "@ts-rest/core";
19112
18993
  async function listZeroSecrets() {
19113
18994
  const config = await getClientConfig();
19114
- const client = initClient5(zeroSecretsContract, config);
18995
+ const client = initClient4(zeroSecretsContract, config);
19115
18996
  const result = await client.list({ headers: {} });
19116
18997
  if (result.status === 200) {
19117
18998
  return result.body;
@@ -19120,7 +19001,7 @@ async function listZeroSecrets() {
19120
19001
  }
19121
19002
  async function setZeroSecret(body) {
19122
19003
  const config = await getClientConfig();
19123
- const client = initClient5(zeroSecretsContract, config);
19004
+ const client = initClient4(zeroSecretsContract, config);
19124
19005
  const result = await client.set({ body });
19125
19006
  if (result.status === 200 || result.status === 201) {
19126
19007
  return result.body;
@@ -19129,7 +19010,7 @@ async function setZeroSecret(body) {
19129
19010
  }
19130
19011
  async function deleteZeroSecret(name) {
19131
19012
  const config = await getClientConfig();
19132
- const client = initClient5(zeroSecretsByNameContract, config);
19013
+ const client = initClient4(zeroSecretsByNameContract, config);
19133
19014
  const result = await client.delete({
19134
19015
  params: { name }
19135
19016
  });
@@ -19140,10 +19021,10 @@ async function deleteZeroSecret(name) {
19140
19021
  }
19141
19022
 
19142
19023
  // src/lib/api/domains/zero-variables.ts
19143
- import { initClient as initClient6 } from "@ts-rest/core";
19024
+ import { initClient as initClient5 } from "@ts-rest/core";
19144
19025
  async function listZeroVariables() {
19145
19026
  const config = await getClientConfig();
19146
- const client = initClient6(zeroVariablesContract, config);
19027
+ const client = initClient5(zeroVariablesContract, config);
19147
19028
  const result = await client.list({ headers: {} });
19148
19029
  if (result.status === 200) {
19149
19030
  return result.body;
@@ -19152,7 +19033,7 @@ async function listZeroVariables() {
19152
19033
  }
19153
19034
  async function setZeroVariable(body) {
19154
19035
  const config = await getClientConfig();
19155
- const client = initClient6(zeroVariablesContract, config);
19036
+ const client = initClient5(zeroVariablesContract, config);
19156
19037
  const result = await client.set({ body });
19157
19038
  if (result.status === 200 || result.status === 201) {
19158
19039
  return result.body;
@@ -19161,7 +19042,7 @@ async function setZeroVariable(body) {
19161
19042
  }
19162
19043
  async function deleteZeroVariable(name) {
19163
19044
  const config = await getClientConfig();
19164
- const client = initClient6(zeroVariablesByNameContract, config);
19045
+ const client = initClient5(zeroVariablesByNameContract, config);
19165
19046
  const result = await client.delete({
19166
19047
  params: { name }
19167
19048
  });
@@ -19172,10 +19053,10 @@ async function deleteZeroVariable(name) {
19172
19053
  }
19173
19054
 
19174
19055
  // src/lib/api/domains/zero-connectors.ts
19175
- import { initClient as initClient7 } from "@ts-rest/core";
19056
+ import { initClient as initClient6 } from "@ts-rest/core";
19176
19057
  async function listZeroConnectors() {
19177
19058
  const config = await getClientConfig();
19178
- const client = initClient7(zeroConnectorsMainContract, config);
19059
+ const client = initClient6(zeroConnectorsMainContract, config);
19179
19060
  const result = await client.list({ headers: {} });
19180
19061
  if (result.status === 200) {
19181
19062
  return result.body;
@@ -19184,7 +19065,7 @@ async function listZeroConnectors() {
19184
19065
  }
19185
19066
  async function getZeroConnector(type) {
19186
19067
  const config = await getClientConfig();
19187
- const client = initClient7(zeroConnectorsByTypeContract, config);
19068
+ const client = initClient6(zeroConnectorsByTypeContract, config);
19188
19069
  const result = await client.get({
19189
19070
  params: { type }
19190
19071
  });
@@ -19198,7 +19079,7 @@ async function getZeroConnector(type) {
19198
19079
  }
19199
19080
  async function deleteZeroConnector(type) {
19200
19081
  const config = await getClientConfig();
19201
- const client = initClient7(zeroConnectorsByTypeContract, config);
19082
+ const client = initClient6(zeroConnectorsByTypeContract, config);
19202
19083
  const result = await client.delete({
19203
19084
  params: { type }
19204
19085
  });
@@ -19209,7 +19090,7 @@ async function deleteZeroConnector(type) {
19209
19090
  }
19210
19091
  async function createZeroConnectorSession(type) {
19211
19092
  const config = await getClientConfig();
19212
- const client = initClient7(zeroConnectorSessionsContract, config);
19093
+ const client = initClient6(zeroConnectorSessionsContract, config);
19213
19094
  const result = await client.create({
19214
19095
  params: { type },
19215
19096
  body: {}
@@ -19221,7 +19102,7 @@ async function createZeroConnectorSession(type) {
19221
19102
  }
19222
19103
  async function getZeroConnectorSession(type, sessionId) {
19223
19104
  const config = await getClientConfig();
19224
- const client = initClient7(zeroConnectorSessionByIdContract, config);
19105
+ const client = initClient6(zeroConnectorSessionByIdContract, config);
19225
19106
  const result = await client.get({
19226
19107
  params: { type, sessionId }
19227
19108
  });
@@ -19232,7 +19113,7 @@ async function getZeroConnectorSession(type, sessionId) {
19232
19113
  }
19233
19114
  async function createZeroComputerConnector() {
19234
19115
  const config = await getClientConfig();
19235
- const client = initClient7(zeroComputerConnectorContract, config);
19116
+ const client = initClient6(zeroComputerConnectorContract, config);
19236
19117
  const result = await client.create({
19237
19118
  body: {}
19238
19119
  });
@@ -19243,7 +19124,7 @@ async function createZeroComputerConnector() {
19243
19124
  }
19244
19125
  async function deleteZeroComputerConnector() {
19245
19126
  const config = await getClientConfig();
19246
- const client = initClient7(zeroComputerConnectorContract, config);
19127
+ const client = initClient6(zeroComputerConnectorContract, config);
19247
19128
  const result = await client.delete({});
19248
19129
  if (result.status === 204) {
19249
19130
  return;
@@ -19252,10 +19133,10 @@ async function deleteZeroComputerConnector() {
19252
19133
  }
19253
19134
 
19254
19135
  // src/lib/api/domains/logs.ts
19255
- import { initClient as initClient8 } from "@ts-rest/core";
19136
+ import { initClient as initClient7 } from "@ts-rest/core";
19256
19137
  async function getSystemLog(runId, options) {
19257
19138
  const config = await getClientConfig();
19258
- const client = initClient8(runSystemLogContract, config);
19139
+ const client = initClient7(runSystemLogContract, config);
19259
19140
  const result = await client.getSystemLog({
19260
19141
  params: { id: runId },
19261
19142
  query: {
@@ -19271,7 +19152,7 @@ async function getSystemLog(runId, options) {
19271
19152
  }
19272
19153
  async function getMetrics(runId, options) {
19273
19154
  const config = await getClientConfig();
19274
- const client = initClient8(runMetricsContract, config);
19155
+ const client = initClient7(runMetricsContract, config);
19275
19156
  const result = await client.getMetrics({
19276
19157
  params: { id: runId },
19277
19158
  query: {
@@ -19287,7 +19168,7 @@ async function getMetrics(runId, options) {
19287
19168
  }
19288
19169
  async function getAgentEvents(runId, options) {
19289
19170
  const config = await getClientConfig();
19290
- const client = initClient8(runAgentEventsContract, config);
19171
+ const client = initClient7(runAgentEventsContract, config);
19291
19172
  const result = await client.getAgentEvents({
19292
19173
  params: { id: runId },
19293
19174
  query: {
@@ -19303,7 +19184,7 @@ async function getAgentEvents(runId, options) {
19303
19184
  }
19304
19185
  async function getNetworkLogs(runId, options) {
19305
19186
  const config = await getClientConfig();
19306
- const client = initClient8(runNetworkLogsContract, config);
19187
+ const client = initClient7(runNetworkLogsContract, config);
19307
19188
  const result = await client.getNetworkLogs({
19308
19189
  params: { id: runId },
19309
19190
  query: {
@@ -19319,7 +19200,7 @@ async function getNetworkLogs(runId, options) {
19319
19200
  }
19320
19201
  async function searchLogs(options) {
19321
19202
  const config = await getClientConfig();
19322
- const client = initClient8(logsSearchContract, config);
19203
+ const client = initClient7(logsSearchContract, config);
19323
19204
  const result = await client.searchLogs({
19324
19205
  query: {
19325
19206
  keyword: options.keyword,
@@ -19338,10 +19219,10 @@ async function searchLogs(options) {
19338
19219
  }
19339
19220
 
19340
19221
  // src/lib/api/domains/runs.ts
19341
- import { initClient as initClient9 } from "@ts-rest/core";
19222
+ import { initClient as initClient8 } from "@ts-rest/core";
19342
19223
  async function createRun(body) {
19343
19224
  const config = await getClientConfig();
19344
- const client = initClient9(runsMainContract, config);
19225
+ const client = initClient8(runsMainContract, config);
19345
19226
  const result = await client.create({ body });
19346
19227
  if (result.status === 201) {
19347
19228
  return result.body;
@@ -19350,7 +19231,7 @@ async function createRun(body) {
19350
19231
  }
19351
19232
  async function getEvents(runId, options) {
19352
19233
  const config = await getClientConfig();
19353
- const client = initClient9(runEventsContract, config);
19234
+ const client = initClient8(runEventsContract, config);
19354
19235
  const result = await client.getEvents({
19355
19236
  params: { id: runId },
19356
19237
  query: {
@@ -19365,7 +19246,7 @@ async function getEvents(runId, options) {
19365
19246
  }
19366
19247
  async function listRuns(params) {
19367
19248
  const config = await getClientConfig();
19368
- const client = initClient9(runsMainContract, config);
19249
+ const client = initClient8(runsMainContract, config);
19369
19250
  const result = await client.list({
19370
19251
  query: {
19371
19252
  status: params?.status,
@@ -19382,7 +19263,7 @@ async function listRuns(params) {
19382
19263
  }
19383
19264
  async function getRunQueue() {
19384
19265
  const config = await getClientConfig();
19385
- const client = initClient9(runsQueueContract, config);
19266
+ const client = initClient8(runsQueueContract, config);
19386
19267
  const result = await client.getQueue({ headers: {} });
19387
19268
  if (result.status === 200) {
19388
19269
  return result.body;
@@ -19391,7 +19272,7 @@ async function getRunQueue() {
19391
19272
  }
19392
19273
  async function cancelRun(runId) {
19393
19274
  const config = await getClientConfig();
19394
- const client = initClient9(runsCancelContract, config);
19275
+ const client = initClient8(runsCancelContract, config);
19395
19276
  const result = await client.cancel({
19396
19277
  params: { id: runId }
19397
19278
  });
@@ -19402,10 +19283,10 @@ async function cancelRun(runId) {
19402
19283
  }
19403
19284
 
19404
19285
  // src/lib/api/domains/sessions.ts
19405
- import { initClient as initClient10 } from "@ts-rest/core";
19286
+ import { initClient as initClient9 } from "@ts-rest/core";
19406
19287
  async function getSession(sessionId) {
19407
19288
  const config = await getClientConfig();
19408
- const client = initClient10(sessionsByIdContract, config);
19289
+ const client = initClient9(sessionsByIdContract, config);
19409
19290
  const result = await client.getById({
19410
19291
  params: { id: sessionId }
19411
19292
  });
@@ -19418,7 +19299,7 @@ async function getSession(sessionId) {
19418
19299
  }
19419
19300
  async function getCheckpoint(checkpointId) {
19420
19301
  const config = await getClientConfig();
19421
- const client = initClient10(checkpointsByIdContract, config);
19302
+ const client = initClient9(checkpointsByIdContract, config);
19422
19303
  const result = await client.getById({
19423
19304
  params: { id: checkpointId }
19424
19305
  });
@@ -19429,10 +19310,10 @@ async function getCheckpoint(checkpointId) {
19429
19310
  }
19430
19311
 
19431
19312
  // src/lib/api/domains/storages.ts
19432
- import { initClient as initClient11 } from "@ts-rest/core";
19313
+ import { initClient as initClient10 } from "@ts-rest/core";
19433
19314
  async function prepareStorage(body) {
19434
19315
  const config = await getClientConfig();
19435
- const client = initClient11(storagesPrepareContract, config);
19316
+ const client = initClient10(storagesPrepareContract, config);
19436
19317
  const result = await client.prepare({ body });
19437
19318
  if (result.status === 200) {
19438
19319
  return result.body;
@@ -19441,7 +19322,7 @@ async function prepareStorage(body) {
19441
19322
  }
19442
19323
  async function commitStorage(body) {
19443
19324
  const config = await getClientConfig();
19444
- const client = initClient11(storagesCommitContract, config);
19325
+ const client = initClient10(storagesCommitContract, config);
19445
19326
  const result = await client.commit({ body });
19446
19327
  if (result.status === 200) {
19447
19328
  return result.body;
@@ -19450,7 +19331,7 @@ async function commitStorage(body) {
19450
19331
  }
19451
19332
  async function getStorageDownload(query) {
19452
19333
  const config = await getClientConfig();
19453
- const client = initClient11(storagesDownloadContract, config);
19334
+ const client = initClient10(storagesDownloadContract, config);
19454
19335
  const result = await client.download({
19455
19336
  query: {
19456
19337
  name: query.name,
@@ -19465,7 +19346,7 @@ async function getStorageDownload(query) {
19465
19346
  }
19466
19347
  async function listStorages(query) {
19467
19348
  const config = await getClientConfig();
19468
- const client = initClient11(storagesListContract, config);
19349
+ const client = initClient10(storagesListContract, config);
19469
19350
  const result = await client.list({ query });
19470
19351
  if (result.status === 200) {
19471
19352
  return result.body;
@@ -19473,6 +19354,116 @@ async function listStorages(query) {
19473
19354
  handleError(result, `Failed to list ${query.type}s`);
19474
19355
  }
19475
19356
 
19357
+ // src/lib/api/domains/zero-orgs.ts
19358
+ import { initClient as initClient11 } from "@ts-rest/core";
19359
+ async function getUserTokenClientConfig() {
19360
+ const baseUrl = await getBaseUrl();
19361
+ const token = await getToken();
19362
+ if (!token) {
19363
+ throw new ApiRequestError("Not authenticated", "UNAUTHORIZED", 401);
19364
+ }
19365
+ const headers = {
19366
+ Authorization: `Bearer ${token}`
19367
+ };
19368
+ const bypassSecret = process.env.VERCEL_AUTOMATION_BYPASS_SECRET;
19369
+ if (bypassSecret) {
19370
+ headers["x-vercel-protection-bypass"] = bypassSecret;
19371
+ }
19372
+ return { baseUrl, baseHeaders: headers, jsonQuery: false };
19373
+ }
19374
+ async function getZeroOrg() {
19375
+ const config = await getClientConfig();
19376
+ const client = initClient11(zeroOrgContract, config);
19377
+ const result = await client.get({ headers: {} });
19378
+ if (result.status === 200) {
19379
+ return result.body;
19380
+ }
19381
+ handleError(result, "Failed to get organization");
19382
+ }
19383
+ async function updateZeroOrg(body) {
19384
+ const config = await getClientConfig();
19385
+ const client = initClient11(zeroOrgContract, config);
19386
+ const result = await client.update({ body });
19387
+ if (result.status === 200) {
19388
+ return result.body;
19389
+ }
19390
+ handleError(result, "Failed to update organization");
19391
+ }
19392
+ async function listZeroOrgs() {
19393
+ const config = await getUserTokenClientConfig();
19394
+ const client = initClient11(zeroOrgListContract, config);
19395
+ const result = await client.list({ headers: {} });
19396
+ if (result.status === 200) {
19397
+ return result.body;
19398
+ }
19399
+ handleError(result, "Failed to list organizations");
19400
+ }
19401
+ async function getZeroOrgMembers() {
19402
+ const config = await getClientConfig();
19403
+ const client = initClient11(zeroOrgMembersContract, config);
19404
+ const result = await client.members({ headers: {} });
19405
+ if (result.status === 200) {
19406
+ return result.body;
19407
+ }
19408
+ handleError(result, "Failed to get organization members");
19409
+ }
19410
+ async function inviteZeroOrgMember(email) {
19411
+ const config = await getClientConfig();
19412
+ const client = initClient11(zeroOrgInviteContract, config);
19413
+ const result = await client.invite({
19414
+ body: { email }
19415
+ });
19416
+ if (result.status === 200) {
19417
+ return;
19418
+ }
19419
+ handleError(result, "Failed to invite member");
19420
+ }
19421
+ async function removeZeroOrgMember(email) {
19422
+ const config = await getClientConfig();
19423
+ const client = initClient11(zeroOrgMembersContract, config);
19424
+ const result = await client.removeMember({
19425
+ body: { email }
19426
+ });
19427
+ if (result.status === 200) {
19428
+ return;
19429
+ }
19430
+ handleError(result, "Failed to remove member");
19431
+ }
19432
+ async function leaveZeroOrg() {
19433
+ const config = await getClientConfig();
19434
+ const client = initClient11(zeroOrgLeaveContract, config);
19435
+ const result = await client.leave({
19436
+ body: {}
19437
+ });
19438
+ if (result.status === 200) {
19439
+ return;
19440
+ }
19441
+ handleError(result, "Failed to leave organization");
19442
+ }
19443
+ async function deleteZeroOrg(slug) {
19444
+ const config = await getClientConfig();
19445
+ const client = initClient11(zeroOrgDeleteContract, config);
19446
+ const result = await client.delete({
19447
+ body: { slug }
19448
+ });
19449
+ if (result.status === 200) {
19450
+ return;
19451
+ }
19452
+ handleError(result, "Failed to delete organization");
19453
+ }
19454
+ async function switchZeroOrg(slug) {
19455
+ const config = await getUserTokenClientConfig();
19456
+ const client = initClient11(cliAuthOrgContract, config);
19457
+ const result = await client.switchOrg({
19458
+ headers: {},
19459
+ body: { slug }
19460
+ });
19461
+ if (result.status === 200) {
19462
+ return result.body;
19463
+ }
19464
+ handleError(result, "Failed to switch organization");
19465
+ }
19466
+
19476
19467
  // src/lib/api/domains/zero-org-secrets.ts
19477
19468
  import { initClient as initClient12 } from "@ts-rest/core";
19478
19469
  async function listZeroOrgSecrets() {
@@ -20602,22 +20593,14 @@ function parseIdentifier(identifier) {
20602
20593
  if (isUUID(identifier)) {
20603
20594
  return { name: identifier };
20604
20595
  }
20605
- let org;
20606
- let rest = identifier;
20607
- const slashIndex = identifier.indexOf("/");
20608
- if (slashIndex > 0) {
20609
- org = identifier.slice(0, slashIndex);
20610
- rest = identifier.slice(slashIndex + 1);
20611
- }
20612
- const colonIndex = rest.indexOf(":");
20613
- if (colonIndex > 0 && colonIndex < rest.length - 1) {
20596
+ const colonIndex = identifier.indexOf(":");
20597
+ if (colonIndex > 0 && colonIndex < identifier.length - 1) {
20614
20598
  return {
20615
- org,
20616
- name: rest.slice(0, colonIndex),
20617
- version: rest.slice(colonIndex + 1)
20599
+ name: identifier.slice(0, colonIndex),
20600
+ version: identifier.slice(colonIndex + 1)
20618
20601
  };
20619
20602
  }
20620
- return { org, name: rest };
20603
+ return { name: identifier };
20621
20604
  }
20622
20605
  function renderRunCreated(response) {
20623
20606
  if (response.status === "queued") {
@@ -20851,4 +20834,4 @@ export {
20851
20834
  pollEvents,
20852
20835
  showNextSteps
20853
20836
  };
20854
- //# sourceMappingURL=chunk-VO3BTEUW.js.map
20837
+ //# sourceMappingURL=chunk-HZQ6GQVS.js.map