From 255394f28a0cbc7be4f089238c9cc7aedb341d08 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 22 Aug 2026 03:53:10 +0200 Subject: [PATCH] Register Heimdall access discovery documents --- src/odin/documents.cjs | 33 ++++++++++++++++++++++ test/heimdall-discovery-documents.test.cjs | 23 +++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 test/heimdall-discovery-documents.test.cjs diff --git a/src/odin/documents.cjs b/src/odin/documents.cjs index 0158054..d8047ab 100644 --- a/src/odin/documents.cjs +++ b/src/odin/documents.cjs @@ -6,6 +6,9 @@ function defineOdinDocuments(defineDocumentType) { if (!defineDocumentType) { return { interfaceBindingDefinition: null, + evePluginAdvertisementDefinition: null, + heimdallCommandBoundaryDefinition: null, + heimdallTransportProfileDefinition: null, idunnCommandBoundaryDefinition: null, idunnDaemonHealthDefinition: null, idunnTransportProfileDefinition: null, @@ -83,6 +86,33 @@ function defineOdinDocuments(defineDocumentType) { name: (value) => value?.providerId || value?.provider?.id || "provider", schema: parseObjectDocument("Eve provider advertisement"), }); + const evePluginAdvertisementDefinition = defineDocumentType({ + type: "gamecult.eve.plugin_advertisement", + schemaName: "gamecult.eve.plugin_advertisement", + schemaId: "gamecult.eve.plugin_advertisement.v1", + schemaVersion: "gamecult.eve.plugin_advertisement.v1", + global: false, + name: (value) => value?.pluginId || value?.plugin?.id || "plugin", + schema: parseObjectDocument("Eve plugin advertisement"), + }); + const heimdallCommandBoundaryDefinition = defineDocumentType({ + type: "heimdall.command_boundary", + schemaName: "heimdall.command_boundary", + schemaId: "heimdall.command_boundary.v1", + schemaVersion: "heimdall.command_boundary.v1", + global: false, + name: (value) => value?.boundaryId || value?.daemonId || "heimdall", + schema: parseObjectDocument("Heimdall command boundary"), + }); + const heimdallTransportProfileDefinition = defineDocumentType({ + type: "heimdall.transport_profile", + schemaName: "heimdall.transport_profile", + schemaId: "heimdall.transport_profile.v1", + schemaVersion: "heimdall.transport_profile.v1", + global: false, + name: (value) => value?.profileId || value?.daemonId || "heimdall", + schema: parseObjectDocument("Heimdall transport profile"), + }); const interfaceLayoutDefinition = defineDocumentType({ type: "odin.interface_layout", schemaName: "odin.interface_layout", @@ -446,6 +476,9 @@ function defineOdinDocuments(defineDocumentType) { return { interfaceBindingDefinition, + evePluginAdvertisementDefinition, + heimdallCommandBoundaryDefinition, + heimdallTransportProfileDefinition, interfaceLayoutDefinition, idunnCommandBoundaryDefinition, idunnDaemonHealthDefinition, diff --git a/test/heimdall-discovery-documents.test.cjs b/test/heimdall-discovery-documents.test.cjs new file mode 100644 index 0000000..f4f6e47 --- /dev/null +++ b/test/heimdall-discovery-documents.test.cjs @@ -0,0 +1,23 @@ +"use strict"; + +const assert = require("node:assert/strict"); +const test = require("node:test"); + +const { defineOdinDocuments } = require("../src/odin/documents.cjs"); + +test("Odin registers the typed Heimdall access discovery documents", () => { + const documents = defineOdinDocuments((definition) => definition); + + assert.equal( + documents.evePluginAdvertisementDefinition.schemaId, + "gamecult.eve.plugin_advertisement.v1", + ); + assert.equal( + documents.heimdallCommandBoundaryDefinition.schemaId, + "heimdall.command_boundary.v1", + ); + assert.equal( + documents.heimdallTransportProfileDefinition.schemaId, + "heimdall.transport_profile.v1", + ); +});