feat(device-plane): add universal adapter acceptance boundary
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "@nodedc/device-adapter-catalog",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./src/index.mjs"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node --test test/*.test.mjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import {
|
||||
createDeviceAdapterRegistry,
|
||||
} from "../../device-adapter-runtime/src/index.mjs";
|
||||
import {
|
||||
ARUSNAVI_B2_ADAPTER,
|
||||
} from "../../arusnavi-b2-adapter/src/index.mjs";
|
||||
|
||||
export const DEVICE_ADAPTER_CATALOG = Object.freeze({
|
||||
defaultProfileRef: "arusnavi.b2.internal.v1",
|
||||
registry: createDeviceAdapterRegistry({
|
||||
adapters: [ARUSNAVI_B2_ADAPTER],
|
||||
}),
|
||||
});
|
||||
@@ -0,0 +1,17 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
import { DEVICE_ADAPTER_CATALOG } from "../src/index.mjs";
|
||||
|
||||
test("allowlists ARUSNAVI B2 as the first adapter without making Gateway vendor-specific", () => {
|
||||
assert.deepEqual(DEVICE_ADAPTER_CATALOG.registry.adapterRefs, ["arusnavi-b2"]);
|
||||
assert.deepEqual(
|
||||
DEVICE_ADAPTER_CATALOG.registry.profileRefs,
|
||||
["arusnavi.b2.internal.v1"],
|
||||
);
|
||||
const registration = DEVICE_ADAPTER_CATALOG.registry.resolveProfile(
|
||||
DEVICE_ADAPTER_CATALOG.defaultProfileRef,
|
||||
);
|
||||
assert.equal(registration.adapter.runtimePackageRef, "@nodedc/arusnavi-b2-adapter");
|
||||
assert.equal(registration.profile.model, "B2");
|
||||
});
|
||||
Reference in New Issue
Block a user