feat(manager): manage ontology assets and infrastructure

This commit is contained in:
DCCONSTRUCTIONS
2026-08-22 15:04:32 +03:00
parent b302b6ba1a
commit 088686d67f
8 changed files with 1027 additions and 27 deletions
@@ -123,6 +123,34 @@ test("Device Manager BFF exposes an empty, mutation-driven project workspace", a
deploymentRef: "deployment:preview-edge",
lifecycleState: "provisioning",
});
const host = await postJson(`${baseUrl}/api/device-manager/infrastructure-hosts:ensure`, {
projectRef,
hostKey: "preview-vps",
displayName: "Preview VPS",
providerRef: "provider:preview",
externalRef: "provider-resource:preview-vps",
managementCredentialRef: "secret-ref:device-core/preview-vps",
lifecycleState: "active",
});
const deployment = await postJson(`${baseUrl}/api/device-manager/infrastructure-deployments:ensure`, {
projectRef,
hostRef: host.result.host.hostRef,
deploymentKey: "preview-edge",
displayName: "Preview Edge deployment",
artifactRef: "artifact:device-edge/1.0.0",
artifactDigest: `sha256:${"c".repeat(64)}`,
lifecycleState: "active",
});
await postJson(`${baseUrl}/api/device-manager/infrastructure-service-instances:ensure`, {
projectRef,
hostRef: host.result.host.hostRef,
deploymentRef: deployment.result.deployment.deploymentRef,
edgeRef: null,
serviceKey: "device-edge",
displayName: "Device Edge",
serviceRole: "device.edge",
lifecycleState: "active",
});
await postJson(`${baseUrl}/api/device-manager/project-grants:upsert`, {
projectRef,
principalKind: "group",
@@ -141,6 +169,9 @@ test("Device Manager BFF exposes an empty, mutation-driven project workspace", a
assert.equal(workspace.workspace.edges[0].edgeKey, "preview-edge");
assert.equal(workspace.workspace.grants.length, 2);
assert.equal(workspace.workspace.policies.commandTransport, "disabled");
assert.equal(workspace.workspace.ontology.hosts[0].hostKey, "preview-vps");
assert.equal(workspace.workspace.ontology.serviceInstances[0].serviceKey, "device-edge");
assert.equal(JSON.stringify(workspace).includes("secret-ref:device-core/preview-vps"), false);
assert.deepEqual(workspace.workspace.devices, []);
const missingKey = await fetch(`${baseUrl}/api/device-manager/projects:ensure`, {