@ornncompute/cli 1.0.131 → 1.0.132

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.131",
3
+ "version": "1.0.132",
4
4
  "description": "Command-line interface for Ornn compute access workflows.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -687,6 +687,7 @@ function deleteContractFile(request, id2) {
687
687
  }
688
688
 
689
689
  // ../../packages/api-client/dist/commerce/facilities.js
690
+ var facilityEnsurePath = "/internal/v1/facilities/ensure";
690
691
  function listFacilities(request, input = {}, signal) {
691
692
  return request("/commerce/facilities" + queryString(input), { method: "GET", signal });
692
693
  }
@@ -709,7 +710,7 @@ function getStaffFacility(request, id2, signal) {
709
710
  });
710
711
  }
711
712
  function ensureFacility(request, body) {
712
- return request("/internal/v1/facilities/ensure", {
713
+ return request(facilityEnsurePath, {
713
714
  method: "POST",
714
715
  body
715
716
  });
@@ -874,6 +875,7 @@ export {
874
875
  detachReservationSshKey,
875
876
  editCapacityTerms,
876
877
  ensureFacility,
878
+ facilityEnsurePath,
877
879
  getBillingContact,
878
880
  getBillingPaymentMethod,
879
881
  getBillingSummary,
@@ -529,6 +529,7 @@ function createCreditAdjustment(request, organizationId, body2) {
529
529
  }
530
530
 
531
531
  // ../../packages/api-client/dist/commerce/facilities.js
532
+ var facilityEnsurePath = "/internal/v1/facilities/ensure";
532
533
  function listStaffFacilities(request, input = {}, signal) {
533
534
  return request("/internal/v1/facilities" + queryString(input), {
534
535
  method: "GET",
@@ -542,7 +543,7 @@ function getStaffFacility(request, id, signal) {
542
543
  });
543
544
  }
544
545
  function ensureFacility(request, body2) {
545
- return request("/internal/v1/facilities/ensure", {
546
+ return request(facilityEnsurePath, {
546
547
  method: "POST",
547
548
  body: body2
548
549
  });
@@ -585,18 +586,6 @@ function getCliSession(request) {
585
586
  return request("/v1/cli/session", { method: "GET" });
586
587
  }
587
588
 
588
- // ../../packages/capabilities/dist/supplier-directory.js
589
- function listSupplierOrganizationPage(fetch, input) {
590
- return listOrganizations(fetch, {
591
- role: "supplier",
592
- ...input,
593
- q: input.q?.trim() || void 0,
594
- sort: "created_at",
595
- direction: "asc"
596
- });
597
- }
598
- var listSupplierOrganizations2 = listSupplierOrganizations;
599
-
600
589
  // ../../packages/capabilities/dist/capabilities/fleet.js
601
590
  import { z as z2 } from "zod";
602
591
  var suppliersInput = z2.object({
@@ -661,7 +650,14 @@ var listSuppliersCapability = defineCapability({
661
650
  const paged = parsed.limit !== void 0 || parsed.offset !== void 0 || parsed.q !== void 0;
662
651
  const limit = parsed.limit ?? 25;
663
652
  const offset = parsed.offset ?? 0;
664
- const rows = paged ? await listSupplierOrganizationPage(ctx.fetch, { ...parsed, limit, offset }) : await listSupplierOrganizations2(ctx.fetch);
653
+ const rows = paged ? await listOrganizations(ctx.fetch, {
654
+ role: "supplier",
655
+ limit,
656
+ offset,
657
+ q: parsed.q?.trim() || void 0,
658
+ sort: "created_at",
659
+ direction: "asc"
660
+ }) : await listSupplierOrganizations(ctx.fetch);
665
661
  return {
666
662
  suppliers: rows.map((org) => ({ id: org.id, name: org.name })),
667
663
  ...paged && rows.length === limit ? { next_offset: offset + rows.length } : {}
@@ -1645,9 +1641,6 @@ function unplacedLocation(place) {
1645
1641
  return `Ornn could not place "${place}". Give a state, city, address, or catalog region such as us-west-3.`;
1646
1642
  }
1647
1643
  var LOCATION_LOOKUP_UNAVAILABLE = "Ornn's location lookup is unavailable right now. Keep this location and try again in a moment.";
1648
- function ensureFacility2(fetch, organizationId, region2) {
1649
- return ensureFacility(fetch, { organizationId, region: region2 });
1650
- }
1651
1644
 
1652
1645
  // ../../packages/capabilities/dist/capabilities/native-listing.js
1653
1646
  import { z as z8 } from "zod";
@@ -1831,7 +1824,10 @@ var adminCapacityOffersCreateCapability = defineCapability({
1831
1824
  throw new Error(unplacedLocation(location));
1832
1825
  if (!ctx.confirmed)
1833
1826
  return preview("listing.create", located ? { ...body2, located } : body2);
1834
- const facilityId = located ? (await ensureFacility2(ctx.fetch, body2.organizationId, located.region)).facilityId : body2.facilityId;
1827
+ const facilityId = located ? (await ensureFacility(ctx.fetch, {
1828
+ organizationId: body2.organizationId,
1829
+ region: located.region
1830
+ })).facilityId : body2.facilityId;
1835
1831
  return createCapacityListing(ctx.fetch, { ...body2, facilityId }, resolveIdempotencyKey(ctx, idempotencyKey));
1836
1832
  }
1837
1833
  });
@@ -5632,7 +5628,7 @@ var createListingCapability = defineCapability({
5632
5628
  const supplierQuery = (parsed.site_supplier ?? "").trim().toLowerCase();
5633
5629
  const place = (parsed.site_nickname ?? parsed.site ?? "").trim();
5634
5630
  if (!organizationId && supplierQuery) {
5635
- const matches = (await listSupplierOrganizations2(ctx.fetch)).filter((org) => org.id.toLowerCase() === supplierQuery || org.name.toLowerCase() === supplierQuery);
5631
+ const matches = (await listSupplierOrganizations(ctx.fetch)).filter((org) => org.id.toLowerCase() === supplierQuery || org.name.toLowerCase() === supplierQuery);
5636
5632
  if (matches.length !== 1) {
5637
5633
  return { ok: false, error: matches.length ? "ambiguous_supplier" : "supplier_not_found" };
5638
5634
  }
@@ -5732,7 +5728,7 @@ var createListingCapability = defineCapability({
5732
5728
  });
5733
5729
  }
5734
5730
  if (located && !facilityId && priced) {
5735
- facilityId = (await ensureFacility2(ctx.fetch, organizationId, located.region)).facilityId;
5731
+ facilityId = (await ensureFacility(ctx.fetch, { organizationId, region: located.region })).facilityId;
5736
5732
  }
5737
5733
  const listing = listingAt(facilityId);
5738
5734
  if (!listing) {