@general-input/cli 0.3.0 → 0.4.0
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/dist/cli.js +45 -50
- package/dist/cli.js.map +1 -1
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -224,7 +224,7 @@ var AuthService = class {
|
|
|
224
224
|
printSuccess("Removed ~/.config/geni/runner-session.json");
|
|
225
225
|
}
|
|
226
226
|
/**
|
|
227
|
-
* Verify the active session by hitting `/
|
|
227
|
+
* Verify the active session by hitting `/v1/auth/me`. Returns the
|
|
228
228
|
* resolved status when the session is valid, or `null` when no
|
|
229
229
|
* local session exists. Stale-session failures throw `ApiError(401)`
|
|
230
230
|
* so commands can map them to exit code 78 with the same
|
|
@@ -384,7 +384,7 @@ import chalk4 from "chalk";
|
|
|
384
384
|
// package.json
|
|
385
385
|
var package_default = {
|
|
386
386
|
name: "@general-input/cli",
|
|
387
|
-
version: "0.
|
|
387
|
+
version: "0.4.0",
|
|
388
388
|
type: "module",
|
|
389
389
|
description: "The agent-facing CLI for General Input. Authenticate, manage workflows, run bash with operator credentials injected by the cloud.",
|
|
390
390
|
license: "SEE LICENSE IN LICENSE",
|
|
@@ -869,7 +869,7 @@ var DiscoveryService = class {
|
|
|
869
869
|
/**
|
|
870
870
|
* Look up one operation. When `service` is provided, hits the
|
|
871
871
|
* service-scoped integrations route; otherwise hits the standalone
|
|
872
|
-
* `/
|
|
872
|
+
* `/v1/operations/:opId` route which lets the server resolve the
|
|
873
873
|
* service from the id alone.
|
|
874
874
|
*/
|
|
875
875
|
async getOperation(args) {
|
|
@@ -1362,24 +1362,24 @@ var AuthApiClient = class {
|
|
|
1362
1362
|
}
|
|
1363
1363
|
http;
|
|
1364
1364
|
async startDeviceCode(clientLabel) {
|
|
1365
|
-
return this.http.fetch("/
|
|
1365
|
+
return this.http.fetch("/v1/auth/device-code", {
|
|
1366
1366
|
method: "POST",
|
|
1367
1367
|
body: { clientLabel }
|
|
1368
1368
|
});
|
|
1369
1369
|
}
|
|
1370
1370
|
async pollDeviceCode(userCode) {
|
|
1371
1371
|
return this.http.fetch(
|
|
1372
|
-
`/
|
|
1372
|
+
`/v1/auth/device-code/${encodeURIComponent(userCode)}/poll`,
|
|
1373
1373
|
{ method: "POST" }
|
|
1374
1374
|
);
|
|
1375
1375
|
}
|
|
1376
1376
|
async me() {
|
|
1377
1377
|
this.http.requireAuthed();
|
|
1378
|
-
return this.http.fetch("/
|
|
1378
|
+
return this.http.fetch("/v1/auth/me");
|
|
1379
1379
|
}
|
|
1380
1380
|
async logout() {
|
|
1381
1381
|
this.http.requireAuthed();
|
|
1382
|
-
return this.http.fetch("/
|
|
1382
|
+
return this.http.fetch("/v1/auth/logout", { method: "POST" });
|
|
1383
1383
|
}
|
|
1384
1384
|
};
|
|
1385
1385
|
|
|
@@ -1391,11 +1391,11 @@ var WorkspacesApiClient = class {
|
|
|
1391
1391
|
http;
|
|
1392
1392
|
async list() {
|
|
1393
1393
|
this.http.requireAuthed();
|
|
1394
|
-
return this.http.fetch("/
|
|
1394
|
+
return this.http.fetch("/v1/workspaces");
|
|
1395
1395
|
}
|
|
1396
1396
|
async switch(membershipId) {
|
|
1397
1397
|
this.http.requireAuthed();
|
|
1398
|
-
return this.http.fetch("/
|
|
1398
|
+
return this.http.fetch("/v1/workspaces/switch", {
|
|
1399
1399
|
method: "POST",
|
|
1400
1400
|
body: { membershipId }
|
|
1401
1401
|
});
|
|
@@ -1410,7 +1410,7 @@ var ExecApiClient = class {
|
|
|
1410
1410
|
http;
|
|
1411
1411
|
async resolve(body) {
|
|
1412
1412
|
this.http.requireAuthed();
|
|
1413
|
-
return this.http.fetch("/
|
|
1413
|
+
return this.http.fetch("/v1/exec/resolve", {
|
|
1414
1414
|
method: "POST",
|
|
1415
1415
|
body
|
|
1416
1416
|
});
|
|
@@ -1425,11 +1425,11 @@ var CredentialsApiClient = class {
|
|
|
1425
1425
|
http;
|
|
1426
1426
|
async list() {
|
|
1427
1427
|
this.http.requireAuthed();
|
|
1428
|
-
return this.http.fetch("/
|
|
1428
|
+
return this.http.fetch("/v1/credentials");
|
|
1429
1429
|
}
|
|
1430
1430
|
async get(id) {
|
|
1431
1431
|
this.http.requireAuthed();
|
|
1432
|
-
return this.http.fetch(`/
|
|
1432
|
+
return this.http.fetch(`/v1/credentials/${encodeURIComponent(id)}`);
|
|
1433
1433
|
}
|
|
1434
1434
|
};
|
|
1435
1435
|
|
|
@@ -1441,23 +1441,23 @@ var IntegrationsApiClient = class {
|
|
|
1441
1441
|
http;
|
|
1442
1442
|
async list(args) {
|
|
1443
1443
|
this.http.requireAuthed();
|
|
1444
|
-
const path = args?.query && args.query.length > 0 ? `/
|
|
1444
|
+
const path = args?.query && args.query.length > 0 ? `/v1/integrations?q=${encodeURIComponent(args.query)}` : "/v1/integrations";
|
|
1445
1445
|
return this.http.fetch(path);
|
|
1446
1446
|
}
|
|
1447
1447
|
async get(service) {
|
|
1448
1448
|
this.http.requireAuthed();
|
|
1449
|
-
return this.http.fetch(`/
|
|
1449
|
+
return this.http.fetch(`/v1/integrations/${encodeURIComponent(service)}`);
|
|
1450
1450
|
}
|
|
1451
1451
|
async listOperations(service) {
|
|
1452
1452
|
this.http.requireAuthed();
|
|
1453
1453
|
return this.http.fetch(
|
|
1454
|
-
`/
|
|
1454
|
+
`/v1/integrations/${encodeURIComponent(service)}/operations`
|
|
1455
1455
|
);
|
|
1456
1456
|
}
|
|
1457
1457
|
async getOperation(args) {
|
|
1458
1458
|
this.http.requireAuthed();
|
|
1459
1459
|
return this.http.fetch(
|
|
1460
|
-
`/
|
|
1460
|
+
`/v1/integrations/${encodeURIComponent(args.service)}/operations/${encodeURIComponent(args.opId)}`
|
|
1461
1461
|
);
|
|
1462
1462
|
}
|
|
1463
1463
|
};
|
|
@@ -1470,7 +1470,7 @@ var OperationsApiClient = class {
|
|
|
1470
1470
|
http;
|
|
1471
1471
|
async getById(opId) {
|
|
1472
1472
|
this.http.requireAuthed();
|
|
1473
|
-
return this.http.fetch(`/
|
|
1473
|
+
return this.http.fetch(`/v1/operations/${encodeURIComponent(opId)}`);
|
|
1474
1474
|
}
|
|
1475
1475
|
};
|
|
1476
1476
|
|
|
@@ -1482,67 +1482,62 @@ var WorkflowsApiClient = class {
|
|
|
1482
1482
|
http;
|
|
1483
1483
|
async list() {
|
|
1484
1484
|
this.http.requireAuthed();
|
|
1485
|
-
return this.http.fetch("/
|
|
1485
|
+
return this.http.fetch("/v1/workflows");
|
|
1486
1486
|
}
|
|
1487
1487
|
async create(body) {
|
|
1488
1488
|
this.http.requireAuthed();
|
|
1489
|
-
return this.http.fetch("/
|
|
1489
|
+
return this.http.fetch("/v1/workflows", { method: "POST", body });
|
|
1490
1490
|
}
|
|
1491
1491
|
async get(id) {
|
|
1492
1492
|
this.http.requireAuthed();
|
|
1493
|
-
return this.http.fetch(`/
|
|
1493
|
+
return this.http.fetch(`/v1/workflows/${encodeURIComponent(id)}`);
|
|
1494
1494
|
}
|
|
1495
1495
|
async setType(id, body) {
|
|
1496
1496
|
this.http.requireAuthed();
|
|
1497
|
-
return this.http.fetch(`/
|
|
1497
|
+
return this.http.fetch(`/v1/workflows/${encodeURIComponent(id)}/type`, {
|
|
1498
1498
|
method: "PATCH",
|
|
1499
1499
|
body
|
|
1500
1500
|
});
|
|
1501
1501
|
}
|
|
1502
1502
|
async bundleUrl(id) {
|
|
1503
1503
|
this.http.requireAuthed();
|
|
1504
|
-
return this.http.fetch(
|
|
1505
|
-
`/cli/workflows/${encodeURIComponent(id)}/bundle-url`
|
|
1506
|
-
);
|
|
1504
|
+
return this.http.fetch(`/v1/workflows/${encodeURIComponent(id)}/bundle-url`);
|
|
1507
1505
|
}
|
|
1508
1506
|
async bundleUploadUrl(id) {
|
|
1509
1507
|
this.http.requireAuthed();
|
|
1510
1508
|
return this.http.fetch(
|
|
1511
|
-
`/
|
|
1509
|
+
`/v1/workflows/${encodeURIComponent(id)}/bundle-upload-url`,
|
|
1512
1510
|
{ method: "POST" }
|
|
1513
1511
|
);
|
|
1514
1512
|
}
|
|
1515
1513
|
async validate(id, body) {
|
|
1516
1514
|
this.http.requireAuthed();
|
|
1517
|
-
return this.http.fetch(
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
body
|
|
1522
|
-
}
|
|
1523
|
-
);
|
|
1515
|
+
return this.http.fetch(`/v1/workflows/${encodeURIComponent(id)}/validate`, {
|
|
1516
|
+
method: "POST",
|
|
1517
|
+
body
|
|
1518
|
+
});
|
|
1524
1519
|
}
|
|
1525
1520
|
async publish(id, body) {
|
|
1526
1521
|
this.http.requireAuthed();
|
|
1527
|
-
return this.http.fetch(`/
|
|
1522
|
+
return this.http.fetch(`/v1/workflows/${encodeURIComponent(id)}/publish`, {
|
|
1528
1523
|
method: "POST",
|
|
1529
1524
|
body
|
|
1530
1525
|
});
|
|
1531
1526
|
}
|
|
1532
1527
|
async getConfig(id) {
|
|
1533
1528
|
this.http.requireAuthed();
|
|
1534
|
-
return this.http.fetch(`/
|
|
1529
|
+
return this.http.fetch(`/v1/workflows/${encodeURIComponent(id)}/config`);
|
|
1535
1530
|
}
|
|
1536
1531
|
async updateConfig(id, body) {
|
|
1537
1532
|
this.http.requireAuthed();
|
|
1538
|
-
return this.http.fetch(`/
|
|
1533
|
+
return this.http.fetch(`/v1/workflows/${encodeURIComponent(id)}/config`, {
|
|
1539
1534
|
method: "PATCH",
|
|
1540
1535
|
body
|
|
1541
1536
|
});
|
|
1542
1537
|
}
|
|
1543
1538
|
async test(id, body) {
|
|
1544
1539
|
this.http.requireAuthed();
|
|
1545
|
-
return this.http.fetch(`/
|
|
1540
|
+
return this.http.fetch(`/v1/workflows/${encodeURIComponent(id)}/test`, {
|
|
1546
1541
|
method: "POST",
|
|
1547
1542
|
body
|
|
1548
1543
|
});
|
|
@@ -1551,44 +1546,44 @@ var WorkflowsApiClient = class {
|
|
|
1551
1546
|
this.http.requireAuthed();
|
|
1552
1547
|
const query = limit ? `?limit=${limit}` : "";
|
|
1553
1548
|
return this.http.fetch(
|
|
1554
|
-
`/
|
|
1549
|
+
`/v1/workflows/${encodeURIComponent(id)}/executions${query}`
|
|
1555
1550
|
);
|
|
1556
1551
|
}
|
|
1557
1552
|
async getExecution(id, executionId) {
|
|
1558
1553
|
this.http.requireAuthed();
|
|
1559
1554
|
return this.http.fetch(
|
|
1560
|
-
`/
|
|
1555
|
+
`/v1/workflows/${encodeURIComponent(id)}/executions/${encodeURIComponent(executionId)}`
|
|
1561
1556
|
);
|
|
1562
1557
|
}
|
|
1563
1558
|
async getExecutionLogs(id, executionId) {
|
|
1564
1559
|
this.http.requireAuthed();
|
|
1565
1560
|
return this.http.fetch(
|
|
1566
|
-
`/
|
|
1561
|
+
`/v1/workflows/${encodeURIComponent(id)}/executions/${encodeURIComponent(executionId)}/logs`
|
|
1567
1562
|
);
|
|
1568
1563
|
}
|
|
1569
1564
|
async getExecutionTrace(id, executionId) {
|
|
1570
1565
|
this.http.requireAuthed();
|
|
1571
1566
|
return this.http.fetch(
|
|
1572
|
-
`/
|
|
1567
|
+
`/v1/workflows/${encodeURIComponent(id)}/executions/${encodeURIComponent(executionId)}/trace`
|
|
1573
1568
|
);
|
|
1574
1569
|
}
|
|
1575
1570
|
async triggerSample(id) {
|
|
1576
1571
|
this.http.requireAuthed();
|
|
1577
1572
|
return this.http.fetch(
|
|
1578
|
-
`/
|
|
1573
|
+
`/v1/workflows/${encodeURIComponent(id)}/trigger-sample`
|
|
1579
1574
|
);
|
|
1580
1575
|
}
|
|
1581
1576
|
async inputUploadUrl(id, body) {
|
|
1582
1577
|
this.http.requireAuthed();
|
|
1583
1578
|
return this.http.fetch(
|
|
1584
|
-
`/
|
|
1579
|
+
`/v1/workflows/${encodeURIComponent(id)}/input-upload-url`,
|
|
1585
1580
|
{ method: "POST", body }
|
|
1586
1581
|
);
|
|
1587
1582
|
}
|
|
1588
1583
|
async appBuildStatus(id) {
|
|
1589
1584
|
this.http.requireAuthed();
|
|
1590
1585
|
return this.http.fetch(
|
|
1591
|
-
`/
|
|
1586
|
+
`/v1/workflows/${encodeURIComponent(id)}/app/build-status`
|
|
1592
1587
|
);
|
|
1593
1588
|
}
|
|
1594
1589
|
async appInvocations(id, opts) {
|
|
@@ -1599,13 +1594,13 @@ var WorkflowsApiClient = class {
|
|
|
1599
1594
|
if (opts.limit) params.set("limit", String(opts.limit));
|
|
1600
1595
|
const query = params.toString();
|
|
1601
1596
|
return this.http.fetch(
|
|
1602
|
-
`/
|
|
1597
|
+
`/v1/workflows/${encodeURIComponent(id)}/app/invocations${query ? `?${query}` : ""}`
|
|
1603
1598
|
);
|
|
1604
1599
|
}
|
|
1605
1600
|
async runHandler(id, body) {
|
|
1606
1601
|
this.http.requireAuthed();
|
|
1607
1602
|
return this.http.fetch(
|
|
1608
|
-
`/
|
|
1603
|
+
`/v1/workflows/${encodeURIComponent(id)}/app/run-handler`,
|
|
1609
1604
|
{ method: "POST", body }
|
|
1610
1605
|
);
|
|
1611
1606
|
}
|
|
@@ -1613,24 +1608,24 @@ var WorkflowsApiClient = class {
|
|
|
1613
1608
|
this.http.requireAuthed();
|
|
1614
1609
|
const query = opts.limit ? `?limit=${opts.limit}` : "";
|
|
1615
1610
|
return this.http.fetch(
|
|
1616
|
-
`/
|
|
1611
|
+
`/v1/workflows/${encodeURIComponent(id)}/app/errors${query}`
|
|
1617
1612
|
);
|
|
1618
1613
|
}
|
|
1619
1614
|
async clearHandlerCache(id) {
|
|
1620
1615
|
this.http.requireAuthed();
|
|
1621
1616
|
return this.http.fetch(
|
|
1622
|
-
`/
|
|
1617
|
+
`/v1/workflows/${encodeURIComponent(id)}/app/clear-cache`,
|
|
1623
1618
|
{ method: "POST" }
|
|
1624
1619
|
);
|
|
1625
1620
|
}
|
|
1626
1621
|
async spec(type) {
|
|
1627
1622
|
this.http.requireAuthed();
|
|
1628
|
-
return this.http.fetch(`/
|
|
1623
|
+
return this.http.fetch(`/v1/workflows/spec/${encodeURIComponent(type)}`);
|
|
1629
1624
|
}
|
|
1630
1625
|
async listTriggers(query) {
|
|
1631
1626
|
this.http.requireAuthed();
|
|
1632
1627
|
const suffix = query ? `?q=${encodeURIComponent(query)}` : "";
|
|
1633
|
-
return this.http.fetch(`/
|
|
1628
|
+
return this.http.fetch(`/v1/triggers${suffix}`);
|
|
1634
1629
|
}
|
|
1635
1630
|
};
|
|
1636
1631
|
|
|
@@ -2091,7 +2086,7 @@ async function executeAuthStatus(opts) {
|
|
|
2091
2086
|
}
|
|
2092
2087
|
function registerStatus(parent) {
|
|
2093
2088
|
parent.command("status").description(
|
|
2094
|
-
'Verify the active session and print operator + active workspace. Hits `/
|
|
2089
|
+
'Verify the active session and print operator + active workspace. Hits `/v1/auth/me` to confirm the token is still valid server-side; a stale local session (server revoked, expired) exits 78 with a clear "run geni login" message rather than reporting a fake-OK from the local file alone.'
|
|
2095
2090
|
).option(
|
|
2096
2091
|
"--json",
|
|
2097
2092
|
"Emit a machine-readable JSON object: `{ authenticated, user, workspace, server }`. When unauthenticated, `{ authenticated: false }` is the only field."
|