@slicervm/sdk 0.1.9 → 0.1.11
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/index.cjs +52 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +62 -4
- package/dist/index.d.ts +62 -4
- package/dist/index.js +47 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -877,6 +877,7 @@ var VM = class {
|
|
|
877
877
|
ip;
|
|
878
878
|
createdAt;
|
|
879
879
|
arch;
|
|
880
|
+
tags;
|
|
880
881
|
fs;
|
|
881
882
|
bg;
|
|
882
883
|
transport;
|
|
@@ -887,10 +888,37 @@ var VM = class {
|
|
|
887
888
|
if (init.ip !== void 0) this.ip = init.ip;
|
|
888
889
|
if (init.createdAt !== void 0) this.createdAt = init.createdAt;
|
|
889
890
|
if (init.arch !== void 0) this.arch = init.arch;
|
|
891
|
+
if (init.tags !== void 0) this.tags = init.tags;
|
|
890
892
|
this.fs = new VMFileSystem(transport, this.hostname);
|
|
891
893
|
this.bg = new VMBg(transport, this.hostname);
|
|
892
894
|
}
|
|
893
895
|
// --- lifecycle --------------------------------------------------------
|
|
896
|
+
async getTags() {
|
|
897
|
+
const response = await this.transport.request(
|
|
898
|
+
"GET",
|
|
899
|
+
`/vm/${encodeURIComponent(this.hostname)}/tags`
|
|
900
|
+
);
|
|
901
|
+
this.tags = response.tags;
|
|
902
|
+
return response.tags;
|
|
903
|
+
}
|
|
904
|
+
async updateTags(update) {
|
|
905
|
+
const response = await this.transport.request(
|
|
906
|
+
"PATCH",
|
|
907
|
+
`/vm/${encodeURIComponent(this.hostname)}/tags`,
|
|
908
|
+
update
|
|
909
|
+
);
|
|
910
|
+
this.tags = response.tags;
|
|
911
|
+
return response.tags;
|
|
912
|
+
}
|
|
913
|
+
async addTags(...tags) {
|
|
914
|
+
return this.updateTags({ add: tags });
|
|
915
|
+
}
|
|
916
|
+
async removeTags(...tags) {
|
|
917
|
+
return this.updateTags({ remove: tags });
|
|
918
|
+
}
|
|
919
|
+
async replaceTags(tags) {
|
|
920
|
+
return this.updateTags({ replace: tags });
|
|
921
|
+
}
|
|
894
922
|
async delete() {
|
|
895
923
|
await this.transport.request(
|
|
896
924
|
"DELETE",
|
|
@@ -1347,7 +1375,8 @@ var VMsAPI = class {
|
|
|
1347
1375
|
hostGroup: res.hostGroup ?? hostGroup,
|
|
1348
1376
|
...res.ip !== void 0 && { ip: res.ip },
|
|
1349
1377
|
...res.createdAt !== void 0 && { createdAt: res.createdAt },
|
|
1350
|
-
...res.arch !== void 0 && { arch: res.arch }
|
|
1378
|
+
...res.arch !== void 0 && { arch: res.arch },
|
|
1379
|
+
...req.tags !== void 0 && { tags: [...req.tags] }
|
|
1351
1380
|
});
|
|
1352
1381
|
}
|
|
1353
1382
|
/**
|
|
@@ -1367,7 +1396,8 @@ var VMsAPI = class {
|
|
|
1367
1396
|
hostGroup: found.hostGroup ?? "",
|
|
1368
1397
|
...found.ip !== void 0 && { ip: found.ip },
|
|
1369
1398
|
...found.createdAt !== void 0 && { createdAt: found.createdAt },
|
|
1370
|
-
...found.arch !== void 0 && { arch: found.arch }
|
|
1399
|
+
...found.arch !== void 0 && { arch: found.arch },
|
|
1400
|
+
...found.tags !== void 0 && { tags: found.tags }
|
|
1371
1401
|
});
|
|
1372
1402
|
}
|
|
1373
1403
|
/** Return raw VM metadata across all host groups. */
|
|
@@ -1496,6 +1526,12 @@ function validateCommitId2(commitId) {
|
|
|
1496
1526
|
var ProxySecretBearer = "bearer";
|
|
1497
1527
|
var ProxySecretBasic = "basic";
|
|
1498
1528
|
var ProxySecretOAuthClientCredentials = "oauth-client-creds";
|
|
1529
|
+
var ProxySecretOAuthCodex = "oauth-codex";
|
|
1530
|
+
var ProxySecretOAuthClaude = "oauth-claude";
|
|
1531
|
+
var ProxySecretOAuthGitHubCopilot = "oauth-github-copilot";
|
|
1532
|
+
var ProxySecretOAuthXAI = "oauth-xai";
|
|
1533
|
+
var ProxySecretGitHubAppUser = "github-app-user";
|
|
1534
|
+
var ProxySecretGitHubApp = "github-app";
|
|
1499
1535
|
function clientFromWire(w) {
|
|
1500
1536
|
return { name: w.name, createdAt: w.created_at };
|
|
1501
1537
|
}
|
|
@@ -1505,6 +1541,9 @@ function clientCreatedFromWire(w) {
|
|
|
1505
1541
|
function secretFromWire2(w) {
|
|
1506
1542
|
const out = { name: w.name, host: w.host, createdAt: w.created_at };
|
|
1507
1543
|
if (w.type) out.type = w.type;
|
|
1544
|
+
if (w.updated_at && w.updated_at !== "0001-01-01T00:00:00Z") out.updatedAt = w.updated_at;
|
|
1545
|
+
if (w.adopted_at && w.adopted_at !== "0001-01-01T00:00:00Z") out.adoptedAt = w.adopted_at;
|
|
1546
|
+
if (w.refreshed_at && w.refreshed_at !== "0001-01-01T00:00:00Z") out.refreshedAt = w.refreshed_at;
|
|
1508
1547
|
return out;
|
|
1509
1548
|
}
|
|
1510
1549
|
function ruleFromWire(w) {
|
|
@@ -1512,6 +1551,7 @@ function ruleFromWire(w) {
|
|
|
1512
1551
|
if (w.secret) out.secret = w.secret;
|
|
1513
1552
|
if (w.methods && w.methods.length > 0) out.methods = w.methods;
|
|
1514
1553
|
if (w.paths && w.paths.length > 0) out.paths = w.paths;
|
|
1554
|
+
if (w.ports && w.ports.length > 0) out.ports = w.ports;
|
|
1515
1555
|
if (w.expires && w.expires !== "0001-01-01T00:00:00Z") out.expires = w.expires;
|
|
1516
1556
|
if (w.passthrough) out.passthrough = w.passthrough;
|
|
1517
1557
|
return out;
|
|
@@ -1576,6 +1616,7 @@ var ProxySecretsAPI = class {
|
|
|
1576
1616
|
value: req.value
|
|
1577
1617
|
};
|
|
1578
1618
|
if (req.type) body.type = req.type;
|
|
1619
|
+
if (req.force) body.force = true;
|
|
1579
1620
|
await this.transport.request("POST", "/proxy/v1/secrets", body);
|
|
1580
1621
|
}
|
|
1581
1622
|
async list() {
|
|
@@ -1604,6 +1645,7 @@ var ProxyAllowsAPI = class {
|
|
|
1604
1645
|
if (req.secret) body.secret = req.secret;
|
|
1605
1646
|
if (req.methods && req.methods.length > 0) body.methods = req.methods;
|
|
1606
1647
|
if (req.paths && req.paths.length > 0) body.paths = req.paths;
|
|
1648
|
+
if (req.ports && req.ports.length > 0) body.ports = req.ports;
|
|
1607
1649
|
if (req.ttlSeconds && req.ttlSeconds > 0) body.ttl_seconds = req.ttlSeconds;
|
|
1608
1650
|
if (req.passthrough) body.passthrough = true;
|
|
1609
1651
|
const wire = await this.transport.request(
|
|
@@ -1627,7 +1669,7 @@ var ProxyAllowsAPI = class {
|
|
|
1627
1669
|
}
|
|
1628
1670
|
/**
|
|
1629
1671
|
* Surgical revoke: removes the single rule whose
|
|
1630
|
-
* (host, methods, paths, passthrough) tuple matches the request.
|
|
1672
|
+
* (host, methods, paths, ports, passthrough) tuple matches the request.
|
|
1631
1673
|
* Pass exactly the same fields you used at create time. Method and
|
|
1632
1674
|
* host casing are normalised server-side, so `"GET"` / `"get"` and
|
|
1633
1675
|
* `"github.com"` / `"GITHUB.COM"` all match the same stored rule.
|
|
@@ -1642,6 +1684,7 @@ var ProxyAllowsAPI = class {
|
|
|
1642
1684
|
if (req.secret) body.secret = req.secret;
|
|
1643
1685
|
if (req.methods && req.methods.length > 0) body.methods = req.methods;
|
|
1644
1686
|
if (req.paths && req.paths.length > 0) body.paths = req.paths;
|
|
1687
|
+
if (req.ports && req.ports.length > 0) body.ports = req.ports;
|
|
1645
1688
|
if (req.passthrough) body.passthrough = true;
|
|
1646
1689
|
await this.transport.request("POST", "/proxy/v1/allows/revoke", body);
|
|
1647
1690
|
}
|
|
@@ -1837,7 +1880,13 @@ exports.ProxyAllowsAPI = ProxyAllowsAPI;
|
|
|
1837
1880
|
exports.ProxyClientsAPI = ProxyClientsAPI;
|
|
1838
1881
|
exports.ProxySecretBasic = ProxySecretBasic;
|
|
1839
1882
|
exports.ProxySecretBearer = ProxySecretBearer;
|
|
1883
|
+
exports.ProxySecretGitHubApp = ProxySecretGitHubApp;
|
|
1884
|
+
exports.ProxySecretGitHubAppUser = ProxySecretGitHubAppUser;
|
|
1885
|
+
exports.ProxySecretOAuthClaude = ProxySecretOAuthClaude;
|
|
1840
1886
|
exports.ProxySecretOAuthClientCredentials = ProxySecretOAuthClientCredentials;
|
|
1887
|
+
exports.ProxySecretOAuthCodex = ProxySecretOAuthCodex;
|
|
1888
|
+
exports.ProxySecretOAuthGitHubCopilot = ProxySecretOAuthGitHubCopilot;
|
|
1889
|
+
exports.ProxySecretOAuthXAI = ProxySecretOAuthXAI;
|
|
1841
1890
|
exports.ProxySecretsAPI = ProxySecretsAPI;
|
|
1842
1891
|
exports.SecretExistsError = SecretExistsError;
|
|
1843
1892
|
exports.SecretsAPI = SecretsAPI;
|