Persist Ghostlight public schema catalogs
This commit is contained in:
parent
28c0497260
commit
ed56dab812
3 changed files with 37 additions and 0 deletions
|
|
@ -35,6 +35,11 @@ their contents; Odin owns catalog acceptance and exact retrieval. Sensitive
|
|||
auth commands and claims travel directly between the consuming app and
|
||||
Heimdall, never through Odin.
|
||||
|
||||
Ghostlight publishes a `ghostlight.schema_catalog.v1` envelope containing only
|
||||
the state contracts named by its public provider surface. Odin registers that
|
||||
envelope so it can persist and return the provider-owned catalog; it does not
|
||||
register every private Ghostlight receipt, transition, or simulation schema.
|
||||
|
||||
## Gjallar
|
||||
|
||||
Gjallar is the herald display daemon that runs on Nightwing. Odin sees the
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ function defineOdinDocuments(defineDocumentType) {
|
|||
return {
|
||||
interfaceBindingDefinition: null,
|
||||
evePluginAdvertisementDefinition: null,
|
||||
ghostlightSchemaCatalogDefinition: null,
|
||||
heimdallCommandBoundaryDefinition: null,
|
||||
heimdallTransportProfileDefinition: null,
|
||||
idunnCommandBoundaryDefinition: null,
|
||||
|
|
@ -95,6 +96,15 @@ function defineOdinDocuments(defineDocumentType) {
|
|||
name: (value) => value?.pluginId || value?.plugin?.id || "plugin",
|
||||
schema: parseObjectDocument("Eve plugin advertisement"),
|
||||
});
|
||||
const ghostlightSchemaCatalogDefinition = defineDocumentType({
|
||||
type: "ghostlight.schema_catalog",
|
||||
schemaName: "ghostlight.schema_catalog",
|
||||
schemaId: "ghostlight.schema_catalog.v1",
|
||||
schemaVersion: "ghostlight.schema_catalog.v1",
|
||||
global: false,
|
||||
name: (value) => value?.providerId || "gamecult.ghostlight.dungeon",
|
||||
schema: parseObjectDocument("Ghostlight public schema catalog"),
|
||||
});
|
||||
const heimdallCommandBoundaryDefinition = defineDocumentType({
|
||||
type: "heimdall.command_boundary",
|
||||
schemaName: "heimdall.command_boundary",
|
||||
|
|
@ -477,6 +487,7 @@ function defineOdinDocuments(defineDocumentType) {
|
|||
return {
|
||||
interfaceBindingDefinition,
|
||||
evePluginAdvertisementDefinition,
|
||||
ghostlightSchemaCatalogDefinition,
|
||||
heimdallCommandBoundaryDefinition,
|
||||
heimdallTransportProfileDefinition,
|
||||
interfaceLayoutDefinition,
|
||||
|
|
|
|||
21
test/ghostlight-discovery-documents.test.cjs
Normal file
21
test/ghostlight-discovery-documents.test.cjs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
"use strict";
|
||||
|
||||
const assert = require("node:assert/strict");
|
||||
const test = require("node:test");
|
||||
|
||||
const { defineOdinDocuments } = require("../src/odin/documents.cjs");
|
||||
|
||||
test("Odin persists Ghostlight's public schema catalog envelope", () => {
|
||||
const documents = defineOdinDocuments((definition) => definition);
|
||||
const catalog = documents.ghostlightSchemaCatalogDefinition;
|
||||
|
||||
assert.equal(catalog.type, "ghostlight.schema_catalog");
|
||||
assert.equal(catalog.schemaId, "ghostlight.schema_catalog.v1");
|
||||
assert.equal(catalog.schemaVersion, "ghostlight.schema_catalog.v1");
|
||||
assert.equal(catalog.name({ providerId: "gamecult.ghostlight.dungeon" }), "gamecult.ghostlight.dungeon");
|
||||
});
|
||||
|
||||
test("Odin's unavailable-runtime projection includes the Ghostlight catalog slot", () => {
|
||||
const documents = defineOdinDocuments(null);
|
||||
assert.equal(documents.ghostlightSchemaCatalogDefinition, null);
|
||||
});
|
||||
Loading…
Reference in a new issue