Manage shared ARNavi VPS contours and application keys from infrastructure

This commit is contained in:
DCCONSTRUCTIONS
2026-09-30 15:34:39 +03:00
parent 6ca6738bab
commit 1828a05332
22 changed files with 1099 additions and 2 deletions
@@ -63,6 +63,12 @@ export function createDeviceCoreClient({ baseUrl, token, fetchImpl = fetch } = {
return {
configured: true,
async b2Infrastructure(actor, input, requestId) {
return request("/internal/v1/b2/infrastructure", actor, {
method: "POST", headers: { "Content-Type": "application/json", "Idempotency-Key": requestId },
body: JSON.stringify(input),
}).then((body) => body.result);
},
async listProjects(actor) {
return request("/internal/v1/query/projects", actor)
.then((body) => body.projects);
@@ -1297,7 +1303,7 @@ function normalizeBaseUrl(value) {
}
function safeCoreError(value) {
return typeof value === "string" && /^device_[a-z0-9._:-]{2,120}$/.test(value)
return typeof value === "string" && /^(?:device|b2)_[a-z0-9._:-]{2,120}$/.test(value)
? value
: "device_core_unavailable";
}