@ornncompute/cli 1.0.149 → 1.0.151
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/README.md +3 -1
- package/package.json +1 -1
- package/src/admin-command-handlers.mjs +1 -1
- package/src/admin-shell.mjs +1 -1
- package/src/catalog-shell.mjs +18 -12
- package/vendor/api-client/orchestrator.js +58 -16
- package/vendor/capabilities/cli.js +2470 -2486
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
client for customer compute journeys and the explicit staff namespace. It
|
|
5
5
|
sends browser and CLI traffic only through the API gateway.
|
|
6
6
|
|
|
7
|
-
For
|
|
7
|
+
For customer installation and usage, see the [Ornn CLI guide](https://docs.ornn.com/cli).
|
|
8
8
|
The [shared capability catalog](../../packages/capabilities/README.md) is the authority for
|
|
9
9
|
command identity, role visibility, input schemas, help, and resource discovery.
|
|
10
10
|
The CLI imports `@ornn/capabilities/cli`; packaging includes its dependencies,
|
|
@@ -14,6 +14,8 @@ packages run without workspace links or React.
|
|
|
14
14
|
Native Commerce requests use the caller’s bearer directly through the gateway:
|
|
15
15
|
`/commerce/*` for public APIs and `/internal/v1/*` for staff APIs.
|
|
16
16
|
The gateway and Commerce enforce the caller’s organization and staff permissions.
|
|
17
|
+
Listing output follows the live session's
|
|
18
|
+
[visibility rules in the internal reference](../../docs/cli.md#staff-namespace).
|
|
17
19
|
All Commerce operations use `@ornn/api-client/commerce`, including the reservation
|
|
18
20
|
reads inside launch, connect, and evidence flows. Customer reservation pickers
|
|
19
21
|
explicitly scope every page to the selected organization, including for staff.
|
package/package.json
CHANGED
|
@@ -22,7 +22,7 @@ export function adminCommandHandler(capability) {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
function commandParts(capability) {
|
|
25
|
-
return capability.cli?.
|
|
25
|
+
return capability.cli?.command ?? [];
|
|
26
26
|
}
|
|
27
27
|
function matchedAdminCapability(catalog, argv) {
|
|
28
28
|
return catalog.find((candidate) => {
|
package/src/admin-shell.mjs
CHANGED
package/src/catalog-shell.mjs
CHANGED
|
@@ -158,7 +158,7 @@ function extractFormat(argv) {
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
function vnextCommand(capability) {
|
|
161
|
-
return capability.cli?.
|
|
161
|
+
return capability.cli?.command ?? [];
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
function customerCommands(catalog) {
|
|
@@ -788,16 +788,23 @@ const CUSTOMER_FORBIDDEN_FIELDS = {
|
|
|
788
788
|
};
|
|
789
789
|
const SUPPLIER_OWNER_FIELDS = { organizationId: true, organization_id: true };
|
|
790
790
|
|
|
791
|
-
//
|
|
792
|
-
function assertCustomerResultSafe(value,
|
|
791
|
+
// Native listings expose supplierId to their owner and to verified staff.
|
|
792
|
+
function assertCustomerResultSafe(value, listingSession) {
|
|
793
793
|
if (Array.isArray(value)) {
|
|
794
|
-
for (const item of value) assertCustomerResultSafe(item,
|
|
794
|
+
for (const item of value) assertCustomerResultSafe(item, listingSession);
|
|
795
795
|
return;
|
|
796
796
|
}
|
|
797
797
|
if (!value || typeof value !== "object") return;
|
|
798
|
+
const ownOrganizationId = listingSession?.selectedOrganization?.id;
|
|
798
799
|
const ownedBySupplier = supplierOwnedRecord(value);
|
|
799
800
|
for (const [key, child] of Object.entries(value)) {
|
|
800
|
-
if (
|
|
801
|
+
if (
|
|
802
|
+
key === "supplierId" &&
|
|
803
|
+
value.capacityListingId &&
|
|
804
|
+
typeof child === "string" &&
|
|
805
|
+
(listingSession?.role === "admin" || child === ownOrganizationId)
|
|
806
|
+
)
|
|
807
|
+
continue;
|
|
801
808
|
if (
|
|
802
809
|
CUSTOMER_FORBIDDEN_FIELDS[key] === true ||
|
|
803
810
|
(ownedBySupplier &&
|
|
@@ -809,7 +816,7 @@ function assertCustomerResultSafe(value, ownOrganizationId) {
|
|
|
809
816
|
"customer_result_unsafe"
|
|
810
817
|
);
|
|
811
818
|
}
|
|
812
|
-
assertCustomerResultSafe(child,
|
|
819
|
+
assertCustomerResultSafe(child, listingSession);
|
|
813
820
|
}
|
|
814
821
|
}
|
|
815
822
|
|
|
@@ -989,7 +996,7 @@ async function executeCapability(
|
|
|
989
996
|
`${resolveApiBaseUrl({ env: io.env })}/v1/orchestrator`)
|
|
990
997
|
: undefined;
|
|
991
998
|
const parsedInput = parseCapabilityInput(capability, rawInput);
|
|
992
|
-
let
|
|
999
|
+
let listingSession;
|
|
993
1000
|
let data;
|
|
994
1001
|
try {
|
|
995
1002
|
data = await (capability.cli?.execute ?? capability.execute)(
|
|
@@ -1009,12 +1016,11 @@ async function executeCapability(
|
|
|
1009
1016
|
: path;
|
|
1010
1017
|
return adminFetch(io, endpoint, init);
|
|
1011
1018
|
}
|
|
1012
|
-
if (capability.domain === "listings" &&
|
|
1013
|
-
//
|
|
1014
|
-
|
|
1019
|
+
if (capability.domain === "listings" && listingSession === undefined) {
|
|
1020
|
+
// Resolve listing visibility before the request, never after a committed mutation.
|
|
1021
|
+
listingSession = await getCliSession((path, init) =>
|
|
1015
1022
|
customerCapabilityFetch(io, path, init, authSnapshot)
|
|
1016
1023
|
);
|
|
1017
|
-
ownOrganizationId = session.selectedOrganization?.id ?? null;
|
|
1018
1024
|
}
|
|
1019
1025
|
return customerCapabilityFetch(io, path, init, authSnapshot);
|
|
1020
1026
|
},
|
|
@@ -1038,7 +1044,7 @@ async function executeCapability(
|
|
|
1038
1044
|
interaction?.close();
|
|
1039
1045
|
}
|
|
1040
1046
|
if (audience === "customer") {
|
|
1041
|
-
assertCustomerResultSafe(data,
|
|
1047
|
+
assertCustomerResultSafe(data, listingSession);
|
|
1042
1048
|
}
|
|
1043
1049
|
if (audience === "admin" || sessionCommand || isInteractionExecution(data)) return data;
|
|
1044
1050
|
return {
|
|
@@ -265,20 +265,20 @@ function importDisk(request, body) {
|
|
|
265
265
|
function drivePath(id) {
|
|
266
266
|
return `/v1/orchestrator/drives/${encodeURIComponent(id)}`;
|
|
267
267
|
}
|
|
268
|
-
function filePath(
|
|
269
|
-
return
|
|
268
|
+
function filePath(path6) {
|
|
269
|
+
return path6.replace(/\\/g, "/").split("/").filter(Boolean).map(encodeURIComponent).join("/");
|
|
270
270
|
}
|
|
271
|
-
function driveFilePath(id,
|
|
272
|
-
return `${drivePath(id)}/files/${filePath(
|
|
271
|
+
function driveFilePath(id, path6) {
|
|
272
|
+
return `${drivePath(id)}/files/${filePath(path6)}`;
|
|
273
273
|
}
|
|
274
274
|
function driveArchivePath(id) {
|
|
275
275
|
return `${drivePath(id)}/archive`;
|
|
276
276
|
}
|
|
277
|
-
function driveFolderArchivePath(id,
|
|
278
|
-
return `${drivePath(id)}/folders/${filePath(
|
|
277
|
+
function driveFolderArchivePath(id, path6) {
|
|
278
|
+
return `${drivePath(id)}/folders/${filePath(path6)}/archive`;
|
|
279
279
|
}
|
|
280
|
-
function downloadDriveFile(fetch, id,
|
|
281
|
-
return fetch(driveFilePath(id,
|
|
280
|
+
function downloadDriveFile(fetch, id, path6, signal) {
|
|
281
|
+
return fetch(driveFilePath(id, path6), { method: "GET", ...signal ? { signal } : {} });
|
|
282
282
|
}
|
|
283
283
|
function listDriveContents(request, id, query = {}, signal) {
|
|
284
284
|
const params = new URLSearchParams();
|
|
@@ -291,11 +291,11 @@ function listDriveContents(request, id, query = {}, signal) {
|
|
|
291
291
|
...signal ? { signal } : {}
|
|
292
292
|
});
|
|
293
293
|
}
|
|
294
|
-
function deleteDriveFile(request, id,
|
|
295
|
-
return request(driveFilePath(id,
|
|
294
|
+
function deleteDriveFile(request, id, path6) {
|
|
295
|
+
return request(driveFilePath(id, path6), { method: "DELETE" });
|
|
296
296
|
}
|
|
297
|
-
function deleteDriveFolder(request, id,
|
|
298
|
-
return request(`${drivePath(id)}/folders/${filePath(
|
|
297
|
+
function deleteDriveFolder(request, id, path6) {
|
|
298
|
+
return request(`${drivePath(id)}/folders/${filePath(path6)}`, { method: "DELETE" });
|
|
299
299
|
}
|
|
300
300
|
function clearDriveContents(request, id) {
|
|
301
301
|
return request(`${drivePath(id)}/contents`, { method: "DELETE" });
|
|
@@ -321,13 +321,13 @@ function keepDriveUploadsAlive(request, id) {
|
|
|
321
321
|
}
|
|
322
322
|
|
|
323
323
|
// ../../packages/api-client/dist/orchestrator/drives.js
|
|
324
|
-
function queryPath(
|
|
324
|
+
function queryPath(path6, query) {
|
|
325
325
|
const params = new URLSearchParams();
|
|
326
326
|
for (const [key, value] of Object.entries(query)) {
|
|
327
327
|
if (value !== void 0 && value !== null)
|
|
328
328
|
params.set(key, String(value));
|
|
329
329
|
}
|
|
330
|
-
return `${
|
|
330
|
+
return `${path6}${params.size ? `?${params}` : ""}`;
|
|
331
331
|
}
|
|
332
332
|
function listDrives(request, query = {}, signal) {
|
|
333
333
|
return request(queryPath("/v1/orchestrator/drives", query), {
|
|
@@ -779,13 +779,13 @@ async function deleteSshBastion(request, id, query) {
|
|
|
779
779
|
var storageEventsPath = "/v1/orchestrator/storage/ws";
|
|
780
780
|
|
|
781
781
|
// ../../packages/api-client/dist/orchestrator/storage-usage.js
|
|
782
|
-
function queryPath2(
|
|
782
|
+
function queryPath2(path6, query) {
|
|
783
783
|
const params = new URLSearchParams();
|
|
784
784
|
for (const [key, value] of Object.entries(query)) {
|
|
785
785
|
if (value !== void 0)
|
|
786
786
|
params.set(key, String(value));
|
|
787
787
|
}
|
|
788
|
-
return `${
|
|
788
|
+
return `${path6}${params.size ? `?${params}` : ""}`;
|
|
789
789
|
}
|
|
790
790
|
function listStorageInventory(request, query = {}, signal) {
|
|
791
791
|
return request(queryPath2("/v1/staff/storage/volumes", query), {
|
|
@@ -818,6 +818,43 @@ function getSupplierGateway(request, id, signal) {
|
|
|
818
818
|
});
|
|
819
819
|
}
|
|
820
820
|
|
|
821
|
+
// ../../packages/api-client/dist/orchestrator/supplier-connection-configs.js
|
|
822
|
+
var path5 = "/v1/orchestrator/supplier-connection-configs";
|
|
823
|
+
function listSupplierConnectionTypes(request, signal) {
|
|
824
|
+
return request("/v1/orchestrator/supplier-connection-types", {
|
|
825
|
+
method: "GET",
|
|
826
|
+
...signal ? { signal } : {}
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
function listSupplierConnectionConfigs(request, query = {}, signal) {
|
|
830
|
+
const params = new URLSearchParams();
|
|
831
|
+
if (query.organization_id !== void 0)
|
|
832
|
+
params.set("organization_id", query.organization_id);
|
|
833
|
+
if (query.after !== void 0)
|
|
834
|
+
params.set("after", query.after);
|
|
835
|
+
if (query.limit !== void 0)
|
|
836
|
+
params.set("limit", String(query.limit));
|
|
837
|
+
return request(`${path5}${params.size ? `?${params}` : ""}`, {
|
|
838
|
+
method: "GET",
|
|
839
|
+
...signal ? { signal } : {}
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
function getSupplierConnectionConfig(request, id, signal) {
|
|
843
|
+
return request(`${path5}/${encodeURIComponent(id)}`, {
|
|
844
|
+
method: "GET",
|
|
845
|
+
...signal ? { signal } : {}
|
|
846
|
+
});
|
|
847
|
+
}
|
|
848
|
+
function createSupplierConnectionConfig(request, body) {
|
|
849
|
+
return request(path5, { method: "POST", body });
|
|
850
|
+
}
|
|
851
|
+
function patchSupplierConnectionConfig(request, id, body) {
|
|
852
|
+
return request(`${path5}/${encodeURIComponent(id)}`, {
|
|
853
|
+
method: "PATCH",
|
|
854
|
+
body
|
|
855
|
+
});
|
|
856
|
+
}
|
|
857
|
+
|
|
821
858
|
// ../../packages/api-client/dist/orchestrator/supplier-node-configs.js
|
|
822
859
|
function listSupplierNodeConfigs(request, query = {}, signal) {
|
|
823
860
|
const params = new URLSearchParams();
|
|
@@ -936,6 +973,7 @@ export {
|
|
|
936
973
|
createNetworkPeer,
|
|
937
974
|
createShellSession,
|
|
938
975
|
createSshBastion,
|
|
976
|
+
createSupplierConnectionConfig,
|
|
939
977
|
createSupplierGateway,
|
|
940
978
|
createVirtualMachine,
|
|
941
979
|
deleteDisk,
|
|
@@ -985,6 +1023,7 @@ export {
|
|
|
985
1023
|
getReservationAccessSwitch,
|
|
986
1024
|
getSoftwareCatalog,
|
|
987
1025
|
getStorageUsage,
|
|
1026
|
+
getSupplierConnectionConfig,
|
|
988
1027
|
getSupplierGateway,
|
|
989
1028
|
getVirtualMachine,
|
|
990
1029
|
getVirtualMachineLogs,
|
|
@@ -1028,11 +1067,14 @@ export {
|
|
|
1028
1067
|
listStaffNodes,
|
|
1029
1068
|
listStorageInventory,
|
|
1030
1069
|
listStorageTargets,
|
|
1070
|
+
listSupplierConnectionConfigs,
|
|
1071
|
+
listSupplierConnectionTypes,
|
|
1031
1072
|
listSupplierNodeConfigs,
|
|
1032
1073
|
listVirtualMachinePorts,
|
|
1033
1074
|
localityGeolocatePath,
|
|
1034
1075
|
networksSubscriptionPath,
|
|
1035
1076
|
openVirtualMachinePort,
|
|
1077
|
+
patchSupplierConnectionConfig,
|
|
1036
1078
|
postDiskObject,
|
|
1037
1079
|
postImageObject,
|
|
1038
1080
|
pullGitHubRepository,
|