@ornncompute/cli 1.0.115 → 1.0.117

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ornncompute/cli",
3
- "version": "1.0.115",
3
+ "version": "1.0.117",
4
4
  "description": "Command-line interface for Ornn compute access workflows.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -251,9 +251,9 @@ export function resolveInstallerBaseUrl({ env = process.env } = {}) {
251
251
  }
252
252
 
253
253
  function operatorProxyEndpoint(endpoint) {
254
- // Benchmark functions use their owner namespace; retain the existing staff
255
- // envelope, including its admin-role and impersonation checks.
256
- const path = normalizeComputePath(endpoint).replace(/^\/v1\/benchmark(?=\/|$)/, "");
254
+ // Shared clients use canonical staff or Benchmark paths. Keep the existing
255
+ // staff envelope, including its admin-role and impersonation checks.
256
+ const path = normalizeComputePath(endpoint).replace(/^\/v1\/(?:staff|benchmark)(?=\/|$)/, "");
257
257
  return `/v1/staff${path}`;
258
258
  }
259
259
 
@@ -1,3 +1,4 @@
1
+ import * as gatewayApi from "../vendor/api-client/gateway.js";
1
2
  import { gpuLabeler } from "./gpu-catalog.mjs";
2
3
  import { clusterFactLabel, reservationFactsForCluster } from "./kubernetes-commands.mjs";
3
4
  import { listOwnedActiveMachines, resolveMachineReference } from "./machine-reference.mjs";
@@ -410,7 +411,7 @@ async function activeMachines(fetch, interaction) {
410
411
  }
411
412
 
412
413
  async function clusters(fetch, interaction) {
413
- const payload = await fetch("/v1/workflows/compute/clusters");
414
+ const payload = await gatewayApi.listClusters(fetch);
414
415
  const rows = payloadRows(payload, "clusters");
415
416
  if (!rows)
416
417
  interaction.error("The gateway returned an invalid cluster collection.", {
@@ -769,23 +770,22 @@ function invalidEvidenceResponse(code) {
769
770
  return error;
770
771
  }
771
772
 
772
- function query(params) {
773
- return new URLSearchParams(
774
- Object.entries(params).filter(([, value]) => value !== null && value !== undefined)
775
- ).toString();
776
- }
777
-
778
773
  async function metricSource(machine, reservation, window, maximum, deps, deadline, signal, live) {
779
- const path = live ? "live-metrics" : "telemetry-history";
780
- const params = live
781
- ? { machine_id: machine.id }
782
- : { machine_id: machine.id, start: window.start, end: window.end, max_points: String(maximum) };
783
774
  const response = await fetchEvidence(
784
775
  async (requestSignal) => {
785
- const payload = await deps.fetch(
786
- `/v1/workflows/compute/nodes/reservations/${encodeURIComponent(reservation)}/${path}?${query(params)}`,
787
- { signal: requestSignal }
788
- );
776
+ const payload = live
777
+ ? await gatewayApi.getReservationLiveMetrics(
778
+ deps.fetch,
779
+ reservation,
780
+ { machine_id: machine.id },
781
+ requestSignal
782
+ )
783
+ : await gatewayApi.getReservationTelemetryHistory(
784
+ deps.fetch,
785
+ reservation,
786
+ { machine_id: machine.id, start: window.start, end: window.end, max_points: maximum },
787
+ requestSignal
788
+ );
789
789
  const points = metricPoints(payload, maximum, window);
790
790
  if (points === null) throw invalidEvidenceResponse("invalid_metrics_response");
791
791
  return points;
@@ -830,16 +830,18 @@ async function logSource(
830
830
  ) {
831
831
  const response = await fetchEvidence(
832
832
  async (requestSignal) => {
833
- const payload = await deps.fetch(
834
- `/v1/workflows/compute/nodes/reservations/${encodeURIComponent(reservation)}/logs?${query({
833
+ const payload = await gatewayApi.getReservationLogs(
834
+ deps.fetch,
835
+ reservation,
836
+ {
835
837
  machine_id: machine.id,
836
838
  stream,
837
839
  start: window.start,
838
840
  end: window.end,
839
- limit: String(limit),
841
+ limit,
840
842
  cursor,
841
- })}`,
842
- { signal: requestSignal }
843
+ },
844
+ requestSignal
843
845
  );
844
846
  const entries = logLines(payload, limit, window);
845
847
  if (entries === null) throw invalidEvidenceResponse("invalid_logs_response");
@@ -1,3 +1,4 @@
1
+ import * as gatewayApi from "../vendor/api-client/gateway.js";
1
2
  import { createHash } from "node:crypto";
2
3
  import { readFile } from "node:fs/promises";
3
4
 
@@ -84,7 +85,8 @@ function verificationCode(source) {
84
85
  return typeof code === "string" && /^[A-Za-z][A-Za-z0-9_.-]{0,127}$/.test(code) ? code : null;
85
86
  }
86
87
 
87
- const TRANSFER_ACCOUNT_PATTERN = /^[a-z][a-z0-9-]{4,28}[a-z0-9]@[a-z][a-z0-9-]{4,28}[a-z0-9]\.iam\.gserviceaccount\.com$/;
88
+ const TRANSFER_ACCOUNT_PATTERN =
89
+ /^[a-z][a-z0-9-]{4,28}[a-z0-9]@[a-z][a-z0-9-]{4,28}[a-z0-9]\.iam\.gserviceaccount\.com$/;
88
90
 
89
91
  function safeTransferAccount(value) {
90
92
  return typeof value === "string" && TRANSFER_ACCOUNT_PATTERN.test(value) ? value : null;
@@ -767,11 +769,10 @@ function attachmentFrom(payload) {
767
769
 
768
770
  async function fetchImportAttachment(runtime, reservationId, { signal } = {}) {
769
771
  try {
770
- const payload = await runtime.fetch(
771
- computeEndpoint(
772
- `/nodes/reservations/${encodeURIComponent(reservationId)}/storage-attachment`
773
- ),
774
- { method: "GET", ...(signal ? { signal } : {}) }
772
+ const payload = await gatewayApi.getReservationStorageAttachment(
773
+ runtime.fetch,
774
+ reservationId,
775
+ signal
775
776
  );
776
777
  return attachmentFrom(payload);
777
778
  } catch (error) {
@@ -1217,21 +1218,16 @@ async function importBucket(input, runtime) {
1217
1218
  const replayed = attachment !== null;
1218
1219
  if (!attachment) {
1219
1220
  try {
1220
- const payload = await runtime.fetch(
1221
- computeEndpoint(
1222
- `/nodes/reservations/${encodeURIComponent(reservationId)}/storage-deployment`
1223
- ),
1221
+ const payload = await gatewayApi.deployReservationStorage(
1222
+ runtime.fetch,
1223
+ reservationId,
1224
1224
  {
1225
- body: {
1226
- drive_id: bucket.id,
1227
- mount_path: "/home/tenant/volume",
1228
- mount_mode: "fuse",
1229
- access_mode: "read-write",
1230
- },
1231
- headers: idempotencyHeaders(input),
1232
- method: "POST",
1233
- signal: runtime.signal,
1234
- }
1225
+ drive_id: bucket.id,
1226
+ mount_path: "/home/tenant/volume",
1227
+ mount_mode: "fuse",
1228
+ access_mode: "read-write",
1229
+ },
1230
+ { headers: idempotencyHeaders(input), signal: runtime.signal }
1235
1231
  );
1236
1232
  attachment = attachmentFrom(payload);
1237
1233
  if (!attachment || String(attachment.drive_id ?? "") !== bucket.id) {
@@ -1,3 +1,4 @@
1
+ import * as gatewayApi from "../vendor/api-client/gateway.js";
1
2
  import { getReservation } from "../vendor/api-client/commerce.js";
2
3
  import { createHash } from "node:crypto";
3
4
 
@@ -13,7 +14,6 @@ import { listActiveReservations, reservationLabeler } from "./machine-reference.
13
14
  import { keyInputShapePreflight, keyPlanFromInput, materializeKey } from "./vm-commands.mjs";
14
15
 
15
16
  const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
16
- const CLUSTERS_PATH = "/v1/workflows/compute/clusters";
17
17
  const DEFAULT_LIMIT = 50;
18
18
  const MAX_LIMIT = 500;
19
19
  const DEFAULT_WAIT_SECONDS = 600;
@@ -135,17 +135,8 @@ function clusterLines(cluster) {
135
135
  ];
136
136
  }
137
137
 
138
- function eligibilityPath(reservationId, accessMode = "kubernetes") {
139
- const query = new URLSearchParams({ access_mode: accessMode });
140
- return `/v1/workflows/compute/tenants/me/reservations/${encodeURIComponent(reservationId)}/cluster-eligible-machines?${query}`;
141
- }
142
-
143
- function clusterPath(cluster, suffix) {
144
- return `/v1/workflows/compute/${cluster.access_mode}/reservations/${encodeURIComponent(cluster.reservation_id)}/${suffix}`;
145
- }
146
-
147
138
  async function fetchClusters(fetch) {
148
- const payload = await fetch(CLUSTERS_PATH, { method: "GET" });
139
+ const payload = await gatewayApi.listClusters(fetch);
149
140
  const rows = Array.isArray(payload)
150
141
  ? payload
151
142
  : Array.isArray(record(payload).clusters)
@@ -240,10 +231,12 @@ async function resolveCluster(fetch, runtime, input) {
240
231
  async function fetchClusterDetail(fetch, runtime, cluster, { allowMissing = false, signal } = {}) {
241
232
  let payload;
242
233
  try {
243
- payload = await fetch(clusterPath(cluster, "cluster"), {
244
- method: "GET",
245
- ...(signal ? { signal } : {}),
246
- });
234
+ payload = await gatewayApi.getReservationCluster(
235
+ fetch,
236
+ cluster.access_mode,
237
+ cluster.reservation_id,
238
+ signal
239
+ );
247
240
  } catch (error) {
248
241
  if (allowMissing && error?.status === 404) return null;
249
242
  throw error;
@@ -263,7 +256,9 @@ async function fetchClusterDetail(fetch, runtime, cluster, { allowMissing = fals
263
256
 
264
257
  async function fetchEligibility(fetch, runtime, reservationId, accessMode = "kubernetes") {
265
258
  const payload = record(
266
- await fetch(eligibilityPath(reservationId, accessMode), { method: "GET" })
259
+ await gatewayApi.getReservationClusterEligibility(fetch, reservationId, {
260
+ access_mode: accessMode,
261
+ })
267
262
  );
268
263
  if (
269
264
  text(payload.reservation_id) !== reservationId ||
@@ -558,10 +553,12 @@ function partialClusterExecution(runtime, cluster, accepted = {}) {
558
553
  async function clusterAccessIsReady(fetch, cluster, signal) {
559
554
  try {
560
555
  const credentials = record(
561
- await fetch(clusterPath(cluster, "credentials"), {
562
- method: "GET",
563
- ...(signal ? { signal } : {}),
564
- })
556
+ await gatewayApi.getReservationClusterCredentials(
557
+ fetch,
558
+ cluster.access_mode,
559
+ cluster.reservation_id,
560
+ signal
561
+ )
565
562
  );
566
563
  if (cluster.access_mode === "slurm") {
567
564
  return Boolean(text(credentials.login_host));
@@ -1280,19 +1277,18 @@ export async function launchClusterMode(
1280
1277
  });
1281
1278
  }
1282
1279
  if (selectedKeyId && requested.ssh_key) requested.ssh_key.id = selectedKeyId;
1283
- const response = await context.fetch(
1284
- `/v1/workflows/compute/${accessMode}/reservations/${encodeURIComponent(reservationId)}/cluster/launch`,
1280
+ const response = await gatewayApi.launchReservationCluster(
1281
+ context.fetch,
1282
+ accessMode,
1283
+ reservationId,
1285
1284
  {
1286
- method: "POST",
1287
- headers: { "Idempotency-Key": idempotencyKey },
1288
- body: {
1289
- network_mode: networkMode,
1290
- ...(membershipCount > 0 ? { node_count: membershipCount } : {}),
1291
- node_ids: selectedIds,
1292
- ...(virtualMachineIds.length ? { virtual_machine_ids: virtualMachineIds } : {}),
1293
- ...(selectedKeyId ? { ssh_key_ids: [selectedKeyId] } : {}),
1294
- },
1295
- }
1285
+ network_mode: networkMode,
1286
+ ...(membershipCount > 0 ? { node_count: membershipCount } : {}),
1287
+ node_ids: selectedIds,
1288
+ ...(virtualMachineIds.length ? { virtual_machine_ids: virtualMachineIds } : {}),
1289
+ ...(selectedKeyId ? { ssh_key_ids: [selectedKeyId] } : {}),
1290
+ },
1291
+ { headers: { "Idempotency-Key": idempotencyKey } }
1296
1292
  );
1297
1293
  let cluster = projectCluster(response);
1298
1294
  if (!UUID.test(cluster.id ?? "")) {
@@ -1555,13 +1551,11 @@ async function addNode(input, deps) {
1555
1551
  code: "cluster_eligibility_changed",
1556
1552
  });
1557
1553
  }
1558
- await deps.fetch(
1559
- `/v1/workflows/compute/clusters/reservations/${encodeURIComponent(current.reservation_id)}/cluster/nodes`,
1560
- {
1561
- method: "POST",
1562
- headers: { "Idempotency-Key": prepared.idempotencyKey },
1563
- body: { node_id: machine.id },
1564
- }
1554
+ await gatewayApi.addReservationClusterNode(
1555
+ deps.fetch,
1556
+ current.reservation_id,
1557
+ { node_id: machine.id },
1558
+ { headers: { "Idempotency-Key": prepared.idempotencyKey } }
1565
1559
  );
1566
1560
  const accepted = { membership_goal: goalIds, replayed: false };
1567
1561
  if (!shouldWait(deps.interaction, input))
@@ -1647,13 +1641,9 @@ async function removeNode(input, deps) {
1647
1641
  code: "cluster_membership_changed",
1648
1642
  });
1649
1643
  }
1650
- await deps.fetch(
1651
- `/v1/workflows/compute/clusters/reservations/${encodeURIComponent(current.reservation_id)}/cluster/nodes/${encodeURIComponent(machine.id)}`,
1652
- {
1653
- method: "DELETE",
1654
- headers: { "Idempotency-Key": prepared.idempotencyKey },
1655
- }
1656
- );
1644
+ await gatewayApi.removeReservationClusterNode(deps.fetch, current.reservation_id, machine.id, {
1645
+ headers: { "Idempotency-Key": prepared.idempotencyKey },
1646
+ });
1657
1647
  const accepted = { membership_goal: goalIds, replayed: false };
1658
1648
  if (!shouldWait(deps.interaction, input))
1659
1649
  return deps.interaction.result({
@@ -1723,10 +1713,12 @@ async function teardownCluster(input, deps) {
1723
1713
  code: "cluster_membership_changed",
1724
1714
  });
1725
1715
  }
1726
- await deps.fetch(clusterPath(current, "cluster/teardown"), {
1727
- method: "POST",
1728
- headers: { "Idempotency-Key": idempotencyKey },
1729
- });
1716
+ await gatewayApi.teardownReservationCluster(
1717
+ deps.fetch,
1718
+ current.access_mode,
1719
+ current.reservation_id,
1720
+ { headers: { "Idempotency-Key": idempotencyKey } }
1721
+ );
1730
1722
  const accepted = {
1731
1723
  replayed: false,
1732
1724
  capacity_reservation: { id: current.reservation_id, retained: true, charges_continue: true },
@@ -1909,7 +1901,11 @@ export async function readClusterModeConnectContext(state, accessMode) {
1909
1901
  let credentialError = null;
1910
1902
  try {
1911
1903
  credentials = record(
1912
- await state.context.fetch(clusterPath(current, "credentials"), { method: "GET" })
1904
+ await gatewayApi.getReservationClusterCredentials(
1905
+ state.context.fetch,
1906
+ current.access_mode,
1907
+ current.reservation_id
1908
+ )
1913
1909
  );
1914
1910
  } catch (error) {
1915
1911
  const status = Number(error?.status);
@@ -2046,7 +2042,11 @@ export const kubernetesConnectModeHandler = {
2046
2042
  });
2047
2043
  }
2048
2044
  const credentials = record(
2049
- await state.context.fetch(clusterPath(current, "credentials"), { method: "GET" })
2045
+ await gatewayApi.getReservationClusterCredentials(
2046
+ state.context.fetch,
2047
+ current.access_mode,
2048
+ current.reservation_id
2049
+ )
2050
2050
  );
2051
2051
  const kubeconfig =
2052
2052
  typeof credentials.kubeconfig === "string" && credentials.kubeconfig.trim()
@@ -1,4 +1,5 @@
1
- import { CliApiError, computeEndpoint } from "./api-client.mjs";
1
+ import * as gatewayApi from "../vendor/api-client/gateway.js";
2
+ import { CliApiError } from "./api-client.mjs";
2
3
  import { isRecoverableWaitFailure } from "./interaction-runtime.mjs";
3
4
  import { resolveVolume, safeVolume } from "./storage-commands.mjs";
4
5
 
@@ -118,18 +119,6 @@ function safeFailure(
118
119
  });
119
120
  }
120
121
 
121
- function reservationAttachmentPath(reservationId) {
122
- return computeEndpoint(
123
- `/nodes/reservations/${encodeURIComponent(reservationId)}/storage-attachment`
124
- );
125
- }
126
-
127
- function reservationDeploymentPath(reservationId) {
128
- return computeEndpoint(
129
- `/nodes/reservations/${encodeURIComponent(reservationId)}/storage-deployment`
130
- );
131
- }
132
-
133
122
  function stableAttachmentPhase(value) {
134
123
  const state = text(value)?.toLowerCase() ?? "pending";
135
124
  if (["attached", "ready"].includes(state)) return state;
@@ -355,10 +344,11 @@ async function withMachineCount(runtime, mount, reservationId, signal) {
355
344
 
356
345
  async function fetchMount(runtime, reservationId, { preserveFailure = false, signal } = {}) {
357
346
  try {
358
- const payload = await runtime.fetch(reservationAttachmentPath(reservationId), {
359
- method: "GET",
360
- ...(signal ? { signal } : {}),
361
- });
347
+ const payload = await gatewayApi.getReservationStorageAttachment(
348
+ runtime.fetch,
349
+ reservationId,
350
+ signal
351
+ );
362
352
  return withMachineCount(
363
353
  runtime,
364
354
  projectVolumeMount(payload, reservationId),
@@ -679,15 +669,12 @@ export async function attachVolumeMount(input, runtime) {
679
669
  }
680
670
 
681
671
  try {
682
- const payload = await runtime.fetch(reservationDeploymentPath(reservationId), {
683
- method: "POST",
684
- headers: idempotencyHeaders(input),
685
- body: {
686
- drive_id: projectedVolume.id,
687
- mount_mode: "fuse",
688
- access_mode: access,
689
- },
690
- });
672
+ const payload = await gatewayApi.deployReservationStorage(
673
+ runtime.fetch,
674
+ reservationId,
675
+ { drive_id: projectedVolume.id, mount_mode: "fuse", access_mode: access },
676
+ { headers: idempotencyHeaders(input) }
677
+ );
691
678
  current = await withMachineCount(
692
679
  runtime,
693
680
  projectVolumeMount(payload, reservationId),
@@ -787,10 +774,12 @@ export async function detachVolumeMount(input, runtime) {
787
774
  }
788
775
  current = refreshed;
789
776
  try {
790
- await runtime.fetch(reservationAttachmentPath(reservationId), {
791
- method: "DELETE",
792
- headers: idempotencyHeaders(input),
793
- });
777
+ await gatewayApi.detachReservationStorage(
778
+ runtime.fetch,
779
+ reservationId,
780
+ {},
781
+ { headers: idempotencyHeaders(input) }
782
+ );
794
783
  } catch (error) {
795
784
  if (error instanceof CliApiError && (error.status === undefined || error.status >= 500)) {
796
785
  const reconciled = await fetchMount(runtime, reservationId);
@@ -1,3 +1,4 @@
1
+ import * as gatewayApi from "../vendor/api-client/gateway.js";
1
2
  import { getReservation } from "../vendor/api-client/commerce.js";
2
3
  import { spawn as spawnProcessDefault } from "node:child_process";
3
4
  import { createHash } from "node:crypto";
@@ -513,11 +514,11 @@ async function fetchOrganizationKeys(context) {
513
514
  const seen = new Set();
514
515
  let cursor = null;
515
516
  do {
516
- const query = new URLSearchParams({ status: "active", limit: "500" });
517
- if (cursor) query.set("cursor", cursor);
518
- const page = await context.fetch(
519
- `/v1/workflows/compute/nodes/organizations/me/ssh-keys?${query}`
520
- );
517
+ const page = await gatewayApi.listAccountSshKeys(context.fetch, {
518
+ status: "active",
519
+ limit: 500,
520
+ ...(cursor ? { cursor } : {}),
521
+ });
521
522
  keys.push(...keysFromPayload(page));
522
523
  cursor = page.next_cursor ?? null;
523
524
  if (cursor && seen.has(cursor)) throw new Error("SSH key pagination did not advance.");
@@ -648,11 +649,11 @@ export async function materializeKey(context, plan, interaction, idempotencyKey)
648
649
  const replay = keys.find((key) => text(key.public_key) === publicKey);
649
650
  if (replay) return replay;
650
651
  const created = record(
651
- await context.fetch("/v1/workflows/compute/nodes/organizations/me/ssh-keys", {
652
- method: "POST",
653
- headers: { "Idempotency-Key": idempotencyKey },
654
- body: { label: text(plan.key.label), public_key: publicKey },
655
- })
652
+ await gatewayApi.createAccountSshKey(
653
+ context.fetch,
654
+ { label: text(plan.key.label), public_key: publicKey },
655
+ { headers: { "Idempotency-Key": idempotencyKey } }
656
+ )
656
657
  );
657
658
  if (!resourceId(created) || text(created.public_key) !== publicKey) {
658
659
  interaction.error("The saved SSH key did not match the reviewed public key.", {
@@ -1385,15 +1386,14 @@ function projectVolumeMount(value, reservationId) {
1385
1386
  }
1386
1387
 
1387
1388
  async function bareMetalRelationships(context, reservationId) {
1388
- const encoded = encodeURIComponent(reservationId);
1389
1389
  const missingAttachment = (error) => {
1390
1390
  if (!isReferenceMiss(error)) throw error;
1391
1391
  return null;
1392
1392
  };
1393
1393
  const [network, storage] = await Promise.all([
1394
1394
  context.fetch(`/v1/workflows/compute/networks/shared?overlay=true`),
1395
- context
1396
- .fetch(`/v1/workflows/compute/nodes/reservations/${encoded}/storage-attachment`)
1395
+ gatewayApi
1396
+ .getReservationStorageAttachment(context.fetch, reservationId)
1397
1397
  .catch(missingAttachment),
1398
1398
  ]);
1399
1399
  return {
@@ -3945,11 +3945,11 @@ export async function executeSshKeyCommand(command, input, context, interaction)
3945
3945
  if (command === "list") {
3946
3946
  positional(input, 0, "ornn ssh-keys list [--limit <1-500>] [--cursor <cursor>]", interaction);
3947
3947
  const limit = input.limit ?? 50;
3948
- const query = new URLSearchParams({ status: "active", limit: String(limit) });
3949
- if (text(input.cursor)) query.set("cursor", input.cursor);
3950
- const payload = await context.fetch(
3951
- `/v1/workflows/compute/nodes/organizations/me/ssh-keys?${query}`
3952
- );
3948
+ const payload = await gatewayApi.listAccountSshKeys(context.fetch, {
3949
+ status: "active",
3950
+ limit,
3951
+ ...(text(input.cursor) ? { cursor: input.cursor } : {}),
3952
+ });
3953
3953
  const items = activeKeys(keysFromPayload(payload));
3954
3954
  const page = {
3955
3955
  items,
@@ -4039,13 +4039,9 @@ export async function executeSshKeyCommand(command, input, context, interaction)
4039
4039
  presentation: { lines: ["SSH-key deletion declined."] },
4040
4040
  });
4041
4041
  }
4042
- await context.fetch(
4043
- `/v1/workflows/compute/nodes/organizations/me/ssh-keys/${encodeURIComponent(resourceId(key))}`,
4044
- {
4045
- method: "DELETE",
4046
- headers: { "Idempotency-Key": text(input.idempotencyKey) ?? interaction.idempotencyKey() },
4047
- }
4048
- );
4042
+ await gatewayApi.deleteAccountSshKey(context.fetch, resourceId(key), {
4043
+ headers: { "Idempotency-Key": text(input.idempotencyKey) ?? interaction.idempotencyKey() },
4044
+ });
4049
4045
  return interaction.result({
4050
4046
  data: { ssh_key: projectKey(key) },
4051
4047
  outcome: { class: "ended", phase: "deleted" },
@@ -4,6 +4,12 @@ var listingPath = (id2) => `${BASE}/${encodeURIComponent(id2)}`;
4
4
  var termsPath = (id2) => `${listingPath(id2)}/terms`;
5
5
  var nodePath = (id2, nodeId) => `${listingPath(id2)}/nodes/${encodeURIComponent(nodeId)}`;
6
6
  var replayHeaders = (key) => key ? { headers: { "Idempotency-Key": key } } : {};
7
+ function getCapacityListingImage(fetcher, id2, signal) {
8
+ return fetcher(`${listingPath(id2)}/og.png`, { method: "GET", signal });
9
+ }
10
+ function getCapacityListingSpecPdf(fetcher, id2, signal) {
11
+ return fetcher(`${listingPath(id2)}/spec.pdf`, { method: "GET", signal });
12
+ }
7
13
  function listCapacityListings(request, input = {}, signal) {
8
14
  const query = new URLSearchParams();
9
15
  for (const [key, value] of Object.entries(input)) {
@@ -105,6 +111,9 @@ function detachCapacityNode(request, id2, nodeId) {
105
111
  // ../../packages/api-client/dist/commerce/reservations.js
106
112
  var BASE2 = "/commerce/reservations";
107
113
  var reservationPath = (id2) => `${BASE2}/${encodeURIComponent(id2)}`;
114
+ function getReservationSpecPdf(fetcher, id2, signal) {
115
+ return fetcher(`${reservationPath(id2)}/spec.pdf`, { method: "GET", signal });
116
+ }
108
117
  function listReservations(request, input = {}, signal) {
109
118
  const query = new URLSearchParams();
110
119
  for (const [key, value] of Object.entries(input)) {
@@ -496,6 +505,16 @@ function listTicketActivity(request, recordId) {
496
505
 
497
506
  // ../../packages/api-client/dist/commerce/contracts.js
498
507
  var base2 = "/internal/v1/gtm/contracts";
508
+ function getContractFile(fetcher, id2, signal) {
509
+ return fetcher(`${base2}/${encodeURIComponent(id2)}`, { method: "GET", signal });
510
+ }
511
+ function uploadContractFile(fetcher, input, signal) {
512
+ const body = new FormData();
513
+ body.set("scopeType", input.scopeType);
514
+ body.set("scopeId", input.scopeId);
515
+ body.set("file", input.file);
516
+ return fetcher(base2, { method: "POST", body, signal });
517
+ }
499
518
  function listContractFiles(request, input = {}, signal) {
500
519
  return request(base2 + queryString(input), { method: "GET", signal });
501
520
  }
@@ -593,6 +612,18 @@ function createSupplierAccountSession(request, body, signal) {
593
612
 
594
613
  // ../../packages/api-client/dist/commerce/supplier-intake.js
595
614
  var base3 = "/internal/v1/supplier-intake";
615
+ function getSupplierIntakeDocument(fetcher, id2, input = {}, signal) {
616
+ return fetcher(`${base3}/documents/${encodeURIComponent(id2)}${input.download ? "?download=1" : ""}`, {
617
+ method: "GET",
618
+ signal
619
+ });
620
+ }
621
+ function getSupplierIntakePacket(fetcher, id2, input = {}, signal) {
622
+ return fetcher(`${base3}/submissions/${encodeURIComponent(id2)}/packet${input.download ? "?download=1" : ""}`, {
623
+ method: "GET",
624
+ signal
625
+ });
626
+ }
596
627
  function listSupplierIntakeLinks(request) {
597
628
  return request(base3 + "/links", { method: "GET" });
598
629
  }
@@ -614,21 +645,35 @@ function reviewSupplierIntakeSubmission(request, id2) {
614
645
  });
615
646
  }
616
647
 
648
+ // ../../packages/api-client/dist/commerce/supplier-documents.js
649
+ var base4 = "/commerce/supplier/documents";
650
+ function uploadSupplierDocument(fetcher, file, signal) {
651
+ const body = new FormData();
652
+ body.set("file", file);
653
+ return fetcher(base4, { method: "POST", body, signal });
654
+ }
655
+ function getSupplierDocument(fetcher, id2, input = {}, signal) {
656
+ return fetcher(`${base4}/${encodeURIComponent(id2)}` + queryString(input), {
657
+ method: "GET",
658
+ signal
659
+ });
660
+ }
661
+
617
662
  // ../../packages/api-client/dist/commerce/licenses.js
618
- var base4 = "/internal/v1/controlplane-licenses";
663
+ var base5 = "/internal/v1/controlplane-licenses";
619
664
  function listControlplaneLicenses(request, signal) {
620
- return request(base4, { method: "GET", signal });
665
+ return request(base5, { method: "GET", signal });
621
666
  }
622
667
  function getControlplaneLicense(request, id2) {
623
- return request(`${base4}/${encodeURIComponent(id2)}`, {
668
+ return request(`${base5}/${encodeURIComponent(id2)}`, {
624
669
  method: "GET"
625
670
  });
626
671
  }
627
672
  function createControlplaneLicense(request, body) {
628
- return request(base4, { method: "POST", body });
673
+ return request(base5, { method: "POST", body });
629
674
  }
630
675
  function revokeControlplaneLicense(request, id2) {
631
- return request(`${base4}/${encodeURIComponent(id2)}/revoke`, {
676
+ return request(`${base5}/${encodeURIComponent(id2)}/revoke`, {
632
677
  method: "POST",
633
678
  body: {}
634
679
  });
@@ -674,18 +719,25 @@ export {
674
719
  getBillingPaymentMethod,
675
720
  getBillingSummary,
676
721
  getCapacityListing,
722
+ getCapacityListingImage,
723
+ getCapacityListingSpecPdf,
677
724
  getCommerceOrganization,
725
+ getContractFile,
678
726
  getControlplaneLicense,
679
727
  getGTMPersonalWorkspace,
680
728
  getGTMTicket,
681
729
  getInferenceWallet,
682
730
  getReservation,
683
731
  getReservationHour,
732
+ getReservationSpecPdf,
684
733
  getReservationUsage,
685
734
  getShowback,
686
735
  getStaffFacility,
687
736
  getStorageAgreement,
688
737
  getStorageBill,
738
+ getSupplierDocument,
739
+ getSupplierIntakeDocument,
740
+ getSupplierIntakePacket,
689
741
  getSupplierIntakeSubmission,
690
742
  getSupplierPaymentAccount,
691
743
  listAdminInvoices,
@@ -741,5 +793,7 @@ export {
741
793
  updateGTMComment,
742
794
  updateGTMCompany,
743
795
  updateGTMDeal,
744
- updateGTMTask
796
+ updateGTMTask,
797
+ uploadContractFile,
798
+ uploadSupplierDocument
745
799
  };