@openrobops/iso21423 0.0.0-stage → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/README.md +358 -2
  2. package/dist/ccs-CU8XD5sl.d.cts +69 -0
  3. package/dist/ccs-CU8XD5sl.d.ts +69 -0
  4. package/dist/chunk-3JNSIJSX.js +31 -0
  5. package/dist/chunk-3JNSIJSX.js.map +1 -0
  6. package/dist/chunk-5ZIUSUHF.js +55 -0
  7. package/dist/chunk-5ZIUSUHF.js.map +1 -0
  8. package/dist/chunk-DMJ6T3RX.js +445 -0
  9. package/dist/chunk-DMJ6T3RX.js.map +1 -0
  10. package/dist/chunk-GPNR37CI.js +1915 -0
  11. package/dist/chunk-GPNR37CI.js.map +1 -0
  12. package/dist/chunk-JDO725KR.js +210 -0
  13. package/dist/chunk-JDO725KR.js.map +1 -0
  14. package/dist/chunk-JIYCTQXR.js +1 -0
  15. package/dist/chunk-JIYCTQXR.js.map +1 -0
  16. package/dist/chunk-JLUENXGS.js +48 -0
  17. package/dist/chunk-JLUENXGS.js.map +1 -0
  18. package/dist/chunk-JQAMNFAF.js +1 -0
  19. package/dist/chunk-JQAMNFAF.js.map +1 -0
  20. package/dist/chunk-LTPOAVGF.js +44 -0
  21. package/dist/chunk-LTPOAVGF.js.map +1 -0
  22. package/dist/chunk-ODBIFZN3.js +65 -0
  23. package/dist/chunk-ODBIFZN3.js.map +1 -0
  24. package/dist/chunk-OH2DOPKJ.js +107 -0
  25. package/dist/chunk-OH2DOPKJ.js.map +1 -0
  26. package/dist/chunk-QAA44UNO.js +1 -0
  27. package/dist/chunk-QAA44UNO.js.map +1 -0
  28. package/dist/chunk-RD7PYTIT.js +107 -0
  29. package/dist/chunk-RD7PYTIT.js.map +1 -0
  30. package/dist/chunk-UJC46NTA.js +13 -0
  31. package/dist/chunk-UJC46NTA.js.map +1 -0
  32. package/dist/chunk-UW6WTEPT.js +293 -0
  33. package/dist/chunk-UW6WTEPT.js.map +1 -0
  34. package/dist/chunk-W7DIDPTG.js +1 -0
  35. package/dist/chunk-W7DIDPTG.js.map +1 -0
  36. package/dist/core.cjs +2874 -0
  37. package/dist/core.cjs.map +1 -0
  38. package/dist/core.d.cts +996 -0
  39. package/dist/core.d.ts +996 -0
  40. package/dist/core.js +59 -0
  41. package/dist/core.js.map +1 -0
  42. package/dist/gateway.cjs +2937 -0
  43. package/dist/gateway.cjs.map +1 -0
  44. package/dist/gateway.d.cts +165 -0
  45. package/dist/gateway.d.ts +165 -0
  46. package/dist/gateway.js +21 -0
  47. package/dist/gateway.js.map +1 -0
  48. package/dist/geometry.cjs +98 -0
  49. package/dist/geometry.cjs.map +1 -0
  50. package/dist/geometry.d.cts +38 -0
  51. package/dist/geometry.d.ts +38 -0
  52. package/dist/geometry.js +14 -0
  53. package/dist/geometry.js.map +1 -0
  54. package/dist/identity-BGr2FJmC.d.cts +258 -0
  55. package/dist/identity-Bw8Dik5S.d.ts +258 -0
  56. package/dist/index.cjs +3327 -0
  57. package/dist/index.cjs.map +1 -0
  58. package/dist/index.d.cts +118 -0
  59. package/dist/index.d.ts +118 -0
  60. package/dist/index.js +193 -0
  61. package/dist/index.js.map +1 -0
  62. package/dist/schema.cjs +375 -0
  63. package/dist/schema.cjs.map +1 -0
  64. package/dist/schema.d.cts +28 -0
  65. package/dist/schema.d.ts +28 -0
  66. package/dist/schema.js +14 -0
  67. package/dist/schema.js.map +1 -0
  68. package/dist/session-RV32MFpV.d.cts +139 -0
  69. package/dist/session-ueiESY7Y.d.ts +139 -0
  70. package/dist/session.cjs +855 -0
  71. package/dist/session.cjs.map +1 -0
  72. package/dist/session.d.cts +94 -0
  73. package/dist/session.d.ts +94 -0
  74. package/dist/session.js +20 -0
  75. package/dist/session.js.map +1 -0
  76. package/dist/testing.cjs +205 -0
  77. package/dist/testing.cjs.map +1 -0
  78. package/dist/testing.d.cts +94 -0
  79. package/dist/testing.d.ts +94 -0
  80. package/dist/testing.js +169 -0
  81. package/dist/testing.js.map +1 -0
  82. package/dist/topics-BiVeZyTW.d.cts +43 -0
  83. package/dist/topics-BiVeZyTW.d.ts +43 -0
  84. package/dist/topics.cjs +134 -0
  85. package/dist/topics.cjs.map +1 -0
  86. package/dist/topics.d.cts +41 -0
  87. package/dist/topics.d.ts +41 -0
  88. package/dist/topics.js +30 -0
  89. package/dist/topics.js.map +1 -0
  90. package/dist/transport-BT4AjTn9.d.cts +61 -0
  91. package/dist/transport-BT4AjTn9.d.ts +61 -0
  92. package/dist/types.cjs +186 -0
  93. package/dist/types.cjs.map +1 -0
  94. package/dist/types.d.cts +83 -0
  95. package/dist/types.d.ts +83 -0
  96. package/dist/types.js +50 -0
  97. package/dist/types.js.map +1 -0
  98. package/dist/validators-Be0ce1b8.d.cts +29 -0
  99. package/dist/validators-Be0ce1b8.d.ts +29 -0
  100. package/package.json +48 -4
@@ -0,0 +1,375 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/schema/index.ts
31
+ var schema_exports = {};
32
+ __export(schema_exports, {
33
+ assertValid: () => assertValid,
34
+ normalizeInbound: () => normalizeInbound,
35
+ validateMessage: () => validateMessage
36
+ });
37
+ module.exports = __toCommonJS(schema_exports);
38
+
39
+ // src/schema/validators.ts
40
+ var import__ = require("ajv/dist/2020.js");
41
+ var import_ajv_formats = __toESM(require("ajv-formats"), 1);
42
+
43
+ // src/schema/iso21423.schema.json
44
+ var iso21423_schema_default = {
45
+ $schema: "https://json-schema.org/draft/2020-12/schema",
46
+ $id: "https://openrobops.org/schemas/iso21423/v1.json",
47
+ $defs: {
48
+ uuid: { type: "string", pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" },
49
+ timestamp: { type: "string", format: "date-time" },
50
+ point: {
51
+ type: "object",
52
+ required: ["x", "y"],
53
+ properties: { x: { type: "number" }, y: { type: "number" } }
54
+ },
55
+ locationPoint: {
56
+ type: "object",
57
+ required: ["ccsId", "x", "y", "z"],
58
+ properties: {
59
+ ccsId: { $ref: "#/$defs/uuid" },
60
+ x: { type: "number" },
61
+ y: { type: "number" },
62
+ z: { type: "number" }
63
+ }
64
+ },
65
+ orientation: {
66
+ type: "object",
67
+ required: ["yaw", "pitch", "roll"],
68
+ properties: { yaw: { type: "number" }, pitch: { type: "number" }, roll: { type: "number" } }
69
+ },
70
+ capabilities: {
71
+ type: "object",
72
+ required: ["provides", "accepts"],
73
+ properties: {
74
+ provides: { type: "array", items: { type: "string" } },
75
+ accepts: {
76
+ type: "object",
77
+ required: ["requests"],
78
+ properties: { requests: { type: "array", items: { type: "string" } } }
79
+ },
80
+ manages: { type: "array", items: { $ref: "#/$defs/uuid" } },
81
+ managedBy: { $ref: "#/$defs/uuid" }
82
+ }
83
+ },
84
+ softwareVersion: {
85
+ type: "object",
86
+ required: ["moduleName", "moduleVersion"],
87
+ properties: { moduleName: { type: "string" }, moduleVersion: { type: "string" } }
88
+ },
89
+ locationPointStamped: {
90
+ type: "object",
91
+ required: ["timestamp", "locationPoint"],
92
+ properties: {
93
+ timestamp: { $ref: "#/$defs/timestamp" },
94
+ locationPoint: { $ref: "#/$defs/locationPoint" }
95
+ }
96
+ },
97
+ requestDetail: {
98
+ type: "object",
99
+ required: ["type", "version"],
100
+ properties: {
101
+ type: { type: "string" },
102
+ version: { type: "string" },
103
+ format: { type: "string" },
104
+ blocking: { type: "boolean" },
105
+ atomic: { type: "boolean" },
106
+ properties: { type: "object" }
107
+ }
108
+ },
109
+ requestDetailStatus: {
110
+ type: "object",
111
+ required: ["type", "version", "status"],
112
+ properties: {
113
+ type: { type: "string" },
114
+ version: { type: "string" },
115
+ blocking: { type: "boolean" },
116
+ status: {
117
+ type: "object",
118
+ required: ["code"],
119
+ properties: {
120
+ code: { enum: ["RECEIVED", "ACCEPTED", "EXECUTING", "CANCELED", "SUCCEEDED", "ABORTED"] },
121
+ reason: { type: "string" },
122
+ message: { type: "string" }
123
+ }
124
+ },
125
+ properties: { type: "object" }
126
+ }
127
+ },
128
+ entityIdentity: {
129
+ type: "object",
130
+ required: ["id", "timestamp", "entityType", "manufacturerName", "capabilities", "details"],
131
+ properties: {
132
+ id: { $ref: "#/$defs/uuid" },
133
+ timestamp: { $ref: "#/$defs/timestamp" },
134
+ entityType: { type: "string" },
135
+ manufacturerName: { type: "string" },
136
+ iso21423Version: { type: "string" },
137
+ capabilities: { $ref: "#/$defs/capabilities" },
138
+ details: { type: "object" }
139
+ }
140
+ },
141
+ entityStatus: {
142
+ type: "object",
143
+ required: ["entityId", "timestamp", "states"],
144
+ properties: {
145
+ entityId: { $ref: "#/$defs/uuid" },
146
+ timestamp: { $ref: "#/$defs/timestamp" },
147
+ states: { type: "array", items: { type: "string", pattern: "^[A-Z0-9_]+$" } },
148
+ disabledCapabilities: { $ref: "#/$defs/capabilities" }
149
+ }
150
+ },
151
+ batteryStatus: {
152
+ type: "object",
153
+ required: ["timestamp", "batterySoc"],
154
+ properties: {
155
+ timestamp: { $ref: "#/$defs/timestamp" },
156
+ batterySoc: { type: "number", minimum: 0, maximum: 1 },
157
+ batteryHealth: { type: "string" },
158
+ batteryTemperature: { type: "number" },
159
+ batteryVoltage: { type: "number" },
160
+ batteryCurrent: { type: "number" },
161
+ batteryChargingState: { type: "string" }
162
+ }
163
+ },
164
+ odometry: {
165
+ type: "object",
166
+ required: ["timestamp", "pose", "velocity"],
167
+ properties: {
168
+ timestamp: { $ref: "#/$defs/timestamp" },
169
+ pose: {
170
+ type: "object",
171
+ required: ["locationPoint", "orientation"],
172
+ properties: {
173
+ locationPoint: { $ref: "#/$defs/locationPoint" },
174
+ orientation: { $ref: "#/$defs/orientation" }
175
+ }
176
+ },
177
+ velocity: {
178
+ type: "object",
179
+ required: ["linear", "angular"],
180
+ properties: { linear: { type: "number" }, angular: { type: "number" } }
181
+ }
182
+ }
183
+ },
184
+ localTrajectory: {
185
+ type: "object",
186
+ required: ["timestamp", "localTrajectory"],
187
+ properties: {
188
+ timestamp: { $ref: "#/$defs/timestamp" },
189
+ localTrajectory: { type: "array", items: { $ref: "#/$defs/locationPointStamped" } }
190
+ }
191
+ },
192
+ globalPath: {
193
+ type: "object",
194
+ required: ["timestamp", "globalPath"],
195
+ properties: {
196
+ timestamp: { $ref: "#/$defs/timestamp" },
197
+ globalPath: {
198
+ type: "object",
199
+ required: ["degree", "controlPoints", "knots"],
200
+ properties: {
201
+ degree: { type: "integer", minimum: 1 },
202
+ controlPoints: {
203
+ type: "array",
204
+ items: {
205
+ type: "object",
206
+ required: ["locationPoint"],
207
+ properties: {
208
+ locationPoint: { $ref: "#/$defs/locationPoint" },
209
+ weight: { type: "number" }
210
+ }
211
+ }
212
+ },
213
+ knots: { type: "array", items: { type: "number" }, minItems: 4 }
214
+ }
215
+ }
216
+ }
217
+ },
218
+ globalPlan: {
219
+ type: "object",
220
+ required: ["timestamp", "globalPlan"],
221
+ properties: {
222
+ timestamp: { $ref: "#/$defs/timestamp" },
223
+ globalPlan: { type: "array", items: { $ref: "#/$defs/locationPointStamped" } }
224
+ }
225
+ },
226
+ request: {
227
+ type: "object",
228
+ required: ["destination", "source", "sequenceId", "timestamp", "details"],
229
+ properties: {
230
+ destination: { anyOf: [{ $ref: "#/$defs/uuid" }, { const: "" }] },
231
+ source: { $ref: "#/$defs/uuid" },
232
+ sequenceId: { type: "integer", minimum: 0 },
233
+ timestamp: { $ref: "#/$defs/timestamp" },
234
+ priority: { type: "integer", minimum: 0, maximum: 255 },
235
+ atomic: { type: "boolean" },
236
+ details: { type: "array", minItems: 1, items: { $ref: "#/$defs/requestDetail" } },
237
+ recoveries: { type: "array", items: { $ref: "#/$defs/requestDetail" } }
238
+ }
239
+ },
240
+ requestStatus: {
241
+ type: "object",
242
+ required: ["source", "destination", "sequenceId", "requestSequenceId", "timestamp", "status", "detailStatuses"],
243
+ properties: {
244
+ source: { $ref: "#/$defs/uuid" },
245
+ destination: { $ref: "#/$defs/uuid" },
246
+ sequenceId: { type: "integer", minimum: 0 },
247
+ requestSequenceId: { type: "integer", minimum: 0 },
248
+ timestamp: { $ref: "#/$defs/timestamp" },
249
+ status: { enum: ["RECEIVED", "ACCEPTED", "EXECUTING", "CANCELED", "SUCCEEDED", "ABORTED", "RECOVERY"] },
250
+ detailStatuses: { type: "array", items: { $ref: "#/$defs/requestDetailStatus" } },
251
+ recoveryStatuses: { type: "array", items: { $ref: "#/$defs/requestDetailStatus" } }
252
+ }
253
+ },
254
+ requestStatusArray: { type: "array", items: { $ref: "#/$defs/requestStatus" } }
255
+ }
256
+ };
257
+
258
+ // src/types/constants.ts
259
+ var KNOWN_OPERATING_STATES = [
260
+ "STOP_CATEGORY_0",
261
+ "STOP_CATEGORY_1",
262
+ "STOP_CATEGORY_2",
263
+ "PAUSED",
264
+ "WAIT_FOR_RESET",
265
+ "MAPPING",
266
+ "LOST",
267
+ "WAIT_FOR_ATTACHMENT",
268
+ "WAIT_FOR_EVENT",
269
+ "BLOCKED",
270
+ "ATTACHMENT_ACTIVE",
271
+ "STOPPED",
272
+ "DOCKING",
273
+ "SLOWING",
274
+ "ACCELERATING",
275
+ "LEFT_TURN",
276
+ "RIGHT_TURN",
277
+ "REVERSE",
278
+ "FORWARD",
279
+ "LINE_FOLLOWING",
280
+ "CHARGING",
281
+ "LOW_BATTERY",
282
+ "IDLE",
283
+ "PARKED",
284
+ "OFFLINE",
285
+ "READY",
286
+ "NOT_READY",
287
+ "MODE_AUTO",
288
+ "MODE_SEMIAUTO",
289
+ "MODE_TELEOP",
290
+ "MODE_MANUAL",
291
+ "MODE_MAINTENANCE"
292
+ ];
293
+
294
+ // src/errors.ts
295
+ var Iso21423Error = class extends Error {
296
+ constructor(message) {
297
+ super(message);
298
+ this.name = new.target.name;
299
+ }
300
+ };
301
+ var ValidationError = class extends Iso21423Error {
302
+ constructor(message, errors) {
303
+ super(message);
304
+ this.errors = errors;
305
+ }
306
+ errors;
307
+ };
308
+
309
+ // src/schema/normalize.ts
310
+ var TIMESTAMP_KEYS = /* @__PURE__ */ new Set(["timestamp", "arrivalTime"]);
311
+ var COMMA_TS = /^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}),(\d+)(Z|[+-]\d{2}:?\d{2})$/;
312
+ function fixTimestamps(value, warnings, path) {
313
+ if (Array.isArray(value)) return value.map((v, i) => fixTimestamps(v, warnings, `${path}[${i}]`));
314
+ if (value === null || typeof value !== "object") return value;
315
+ const out = {};
316
+ for (const [k, v] of Object.entries(value)) {
317
+ if (TIMESTAMP_KEYS.has(k) && typeof v === "string" && COMMA_TS.test(v)) {
318
+ out[k] = v.replace(COMMA_TS, "$1.$2$3");
319
+ warnings.push(`${path}.${k}: comma-decimal timestamp normalized to dot form`);
320
+ } else {
321
+ out[k] = fixTimestamps(v, warnings, `${path}.${k}`);
322
+ }
323
+ }
324
+ return out;
325
+ }
326
+ function normalizeInbound(kind, value) {
327
+ const warnings = [];
328
+ let v = fixTimestamps(value, warnings, kind);
329
+ if (kind === "entityStatus" && v !== null && typeof v === "object" && !Array.isArray(v)) {
330
+ const o = v;
331
+ if (o.entityId === void 0 && typeof o.id === "string") {
332
+ const { id, ...rest } = o;
333
+ v = { ...rest, entityId: id };
334
+ warnings.push('entityStatus: legacy field "id" renamed to "entityId" (spec \xA73.1)');
335
+ }
336
+ }
337
+ return { value: v, warnings };
338
+ }
339
+
340
+ // src/schema/validators.ts
341
+ var ajv = new import__.Ajv2020({ allErrors: true, strict: false });
342
+ (0, import_ajv_formats.default)(ajv);
343
+ ajv.addSchema(iso21423_schema_default);
344
+ var KNOWN_STATES = new Set(KNOWN_OPERATING_STATES);
345
+ function collectWarnings(kind, value, warnings) {
346
+ if (kind !== "entityStatus") return;
347
+ const states = value?.states;
348
+ if (!Array.isArray(states)) return;
349
+ for (const s of states) {
350
+ if (typeof s === "string" && !KNOWN_STATES.has(s)) {
351
+ warnings.push(`entityStatus: unknown operating state "${s}" (deployment extension?)`);
352
+ }
353
+ }
354
+ }
355
+ function validateMessage(kind, raw) {
356
+ const { value, warnings } = normalizeInbound(kind, raw);
357
+ const validate = ajv.getSchema(`https://openrobops.org/schemas/iso21423/v1.json#/$defs/${kind}`);
358
+ if (!validate) throw new Error(`No schema for message kind: ${kind}`);
359
+ const ok = validate(value);
360
+ collectWarnings(kind, value, warnings);
361
+ return ok ? { ok: true, value, warnings } : { ok: false, value, warnings, errors: validate.errors ?? [] };
362
+ }
363
+ function assertValid(kind, value) {
364
+ const r = validateMessage(kind, value);
365
+ if (!r.ok) {
366
+ throw new ValidationError(`outbound ${kind} message is not ISO 21423 conformant`, r.errors ?? []);
367
+ }
368
+ }
369
+ // Annotate the CommonJS export names for ESM import in node:
370
+ 0 && (module.exports = {
371
+ assertValid,
372
+ normalizeInbound,
373
+ validateMessage
374
+ });
375
+ //# sourceMappingURL=schema.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/schema/index.ts","../src/schema/validators.ts","../src/schema/iso21423.schema.json","../src/types/constants.ts","../src/errors.ts","../src/schema/normalize.ts"],"sourcesContent":["/**\n * Copyright 2026 InOrbit, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './validators.js';\nexport { normalizeInbound } from './normalize.js';\n","/**\n * Copyright 2026 InOrbit, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Ajv2020 } from 'ajv/dist/2020.js';\nimport addFormats from 'ajv-formats';\nimport schema from './iso21423.schema.json' with { type: 'json' };\nimport { KNOWN_OPERATING_STATES } from '../types/constants.js';\nimport { ValidationError } from '../errors.js';\nimport { normalizeInbound } from './normalize.js';\n\nexport type MessageKind =\n | 'entityIdentity' | 'entityStatus' | 'batteryStatus' | 'odometry'\n | 'localTrajectory' | 'globalPath' | 'globalPlan'\n | 'request' | 'requestStatus' | 'requestStatusArray';\n\n/** Result of {@link validateMessage}: `value` is the normalized payload (present whether or not it validated). */\nexport interface ValidationResult {\n ok: boolean;\n value?: unknown;\n warnings: string[];\n errors?: unknown[];\n}\n\nconst ajv = new Ajv2020({ allErrors: true, strict: false });\n(addFormats as unknown as (ajv: Ajv2020) => void)(ajv);\najv.addSchema(schema);\n\nconst KNOWN_STATES = new Set<string>(KNOWN_OPERATING_STATES);\n\n/** Appends a warning (mutating `warnings`) for each `entityStatus.states` entry not in {@link KNOWN_OPERATING_STATES} — schema-valid but possibly a deployment-specific extension. */\nfunction collectWarnings(kind: MessageKind, value: unknown, warnings: string[]): void {\n if (kind !== 'entityStatus') return;\n const states = (value as { states?: unknown })?.states;\n if (!Array.isArray(states)) return;\n for (const s of states) {\n if (typeof s === 'string' && !KNOWN_STATES.has(s)) {\n warnings.push(`entityStatus: unknown operating state \"${s}\" (deployment extension?)`);\n }\n }\n}\n\n/** Normalizes then validates a raw wire payload against the ISO 21423 JSON Schema for `kind`. Throws if `kind` has no registered schema. */\nexport function validateMessage(kind: MessageKind, raw: unknown): ValidationResult {\n const { value, warnings } = normalizeInbound(kind, raw);\n const validate = ajv.getSchema(`https://openrobops.org/schemas/iso21423/v1.json#/$defs/${kind}`);\n if (!validate) throw new Error(`No schema for message kind: ${kind}`);\n const ok = validate(value) as boolean;\n collectWarnings(kind, value, warnings);\n return ok\n ? { ok: true, value, warnings }\n : { ok: false, value, warnings, errors: validate.errors ?? [] };\n}\n\n/** Egress guard: throws on non-conformant outbound payloads. */\nexport function assertValid(kind: MessageKind, value: unknown): void {\n const r = validateMessage(kind, value);\n if (!r.ok) {\n throw new ValidationError(`outbound ${kind} message is not ISO 21423 conformant`, r.errors ?? []);\n }\n}\n","{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://openrobops.org/schemas/iso21423/v1.json\",\n \"$defs\": {\n \"uuid\": { \"type\": \"string\", \"pattern\": \"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$\" },\n \"timestamp\": { \"type\": \"string\", \"format\": \"date-time\" },\n \"point\": {\n \"type\": \"object\", \"required\": [\"x\", \"y\"],\n \"properties\": { \"x\": { \"type\": \"number\" }, \"y\": { \"type\": \"number\" } }\n },\n \"locationPoint\": {\n \"type\": \"object\", \"required\": [\"ccsId\", \"x\", \"y\", \"z\"],\n \"properties\": {\n \"ccsId\": { \"$ref\": \"#/$defs/uuid\" },\n \"x\": { \"type\": \"number\" }, \"y\": { \"type\": \"number\" }, \"z\": { \"type\": \"number\" }\n }\n },\n \"orientation\": {\n \"type\": \"object\", \"required\": [\"yaw\", \"pitch\", \"roll\"],\n \"properties\": { \"yaw\": { \"type\": \"number\" }, \"pitch\": { \"type\": \"number\" }, \"roll\": { \"type\": \"number\" } }\n },\n \"capabilities\": {\n \"type\": \"object\", \"required\": [\"provides\", \"accepts\"],\n \"properties\": {\n \"provides\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"accepts\": {\n \"type\": \"object\", \"required\": [\"requests\"],\n \"properties\": { \"requests\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } } }\n },\n \"manages\": { \"type\": \"array\", \"items\": { \"$ref\": \"#/$defs/uuid\" } },\n \"managedBy\": { \"$ref\": \"#/$defs/uuid\" }\n }\n },\n \"softwareVersion\": {\n \"type\": \"object\", \"required\": [\"moduleName\", \"moduleVersion\"],\n \"properties\": { \"moduleName\": { \"type\": \"string\" }, \"moduleVersion\": { \"type\": \"string\" } }\n },\n \"locationPointStamped\": {\n \"type\": \"object\", \"required\": [\"timestamp\", \"locationPoint\"],\n \"properties\": {\n \"timestamp\": { \"$ref\": \"#/$defs/timestamp\" },\n \"locationPoint\": { \"$ref\": \"#/$defs/locationPoint\" }\n }\n },\n \"requestDetail\": {\n \"type\": \"object\", \"required\": [\"type\", \"version\"],\n \"properties\": {\n \"type\": { \"type\": \"string\" },\n \"version\": { \"type\": \"string\" },\n \"format\": { \"type\": \"string\" },\n \"blocking\": { \"type\": \"boolean\" },\n \"atomic\": { \"type\": \"boolean\" },\n \"properties\": { \"type\": \"object\" }\n }\n },\n \"requestDetailStatus\": {\n \"type\": \"object\", \"required\": [\"type\", \"version\", \"status\"],\n \"properties\": {\n \"type\": { \"type\": \"string\" },\n \"version\": { \"type\": \"string\" },\n \"blocking\": { \"type\": \"boolean\" },\n \"status\": {\n \"type\": \"object\", \"required\": [\"code\"],\n \"properties\": {\n \"code\": { \"enum\": [\"RECEIVED\", \"ACCEPTED\", \"EXECUTING\", \"CANCELED\", \"SUCCEEDED\", \"ABORTED\"] },\n \"reason\": { \"type\": \"string\" },\n \"message\": { \"type\": \"string\" }\n }\n },\n \"properties\": { \"type\": \"object\" }\n }\n },\n \"entityIdentity\": {\n \"type\": \"object\",\n \"required\": [\"id\", \"timestamp\", \"entityType\", \"manufacturerName\", \"capabilities\", \"details\"],\n \"properties\": {\n \"id\": { \"$ref\": \"#/$defs/uuid\" },\n \"timestamp\": { \"$ref\": \"#/$defs/timestamp\" },\n \"entityType\": { \"type\": \"string\" },\n \"manufacturerName\": { \"type\": \"string\" },\n \"iso21423Version\": { \"type\": \"string\" },\n \"capabilities\": { \"$ref\": \"#/$defs/capabilities\" },\n \"details\": { \"type\": \"object\" }\n }\n },\n \"entityStatus\": {\n \"type\": \"object\", \"required\": [\"entityId\", \"timestamp\", \"states\"],\n \"properties\": {\n \"entityId\": { \"$ref\": \"#/$defs/uuid\" },\n \"timestamp\": { \"$ref\": \"#/$defs/timestamp\" },\n \"states\": { \"type\": \"array\", \"items\": { \"type\": \"string\", \"pattern\": \"^[A-Z0-9_]+$\" } },\n \"disabledCapabilities\": { \"$ref\": \"#/$defs/capabilities\" }\n }\n },\n \"batteryStatus\": {\n \"type\": \"object\", \"required\": [\"timestamp\", \"batterySoc\"],\n \"properties\": {\n \"timestamp\": { \"$ref\": \"#/$defs/timestamp\" },\n \"batterySoc\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"batteryHealth\": { \"type\": \"string\" },\n \"batteryTemperature\": { \"type\": \"number\" },\n \"batteryVoltage\": { \"type\": \"number\" },\n \"batteryCurrent\": { \"type\": \"number\" },\n \"batteryChargingState\": { \"type\": \"string\" }\n }\n },\n \"odometry\": {\n \"type\": \"object\", \"required\": [\"timestamp\", \"pose\", \"velocity\"],\n \"properties\": {\n \"timestamp\": { \"$ref\": \"#/$defs/timestamp\" },\n \"pose\": {\n \"type\": \"object\", \"required\": [\"locationPoint\", \"orientation\"],\n \"properties\": {\n \"locationPoint\": { \"$ref\": \"#/$defs/locationPoint\" },\n \"orientation\": { \"$ref\": \"#/$defs/orientation\" }\n }\n },\n \"velocity\": {\n \"type\": \"object\", \"required\": [\"linear\", \"angular\"],\n \"properties\": { \"linear\": { \"type\": \"number\" }, \"angular\": { \"type\": \"number\" } }\n }\n }\n },\n \"localTrajectory\": {\n \"type\": \"object\", \"required\": [\"timestamp\", \"localTrajectory\"],\n \"properties\": {\n \"timestamp\": { \"$ref\": \"#/$defs/timestamp\" },\n \"localTrajectory\": { \"type\": \"array\", \"items\": { \"$ref\": \"#/$defs/locationPointStamped\" } }\n }\n },\n \"globalPath\": {\n \"type\": \"object\", \"required\": [\"timestamp\", \"globalPath\"],\n \"properties\": {\n \"timestamp\": { \"$ref\": \"#/$defs/timestamp\" },\n \"globalPath\": {\n \"type\": \"object\", \"required\": [\"degree\", \"controlPoints\", \"knots\"],\n \"properties\": {\n \"degree\": { \"type\": \"integer\", \"minimum\": 1 },\n \"controlPoints\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\", \"required\": [\"locationPoint\"],\n \"properties\": {\n \"locationPoint\": { \"$ref\": \"#/$defs/locationPoint\" },\n \"weight\": { \"type\": \"number\" }\n }\n }\n },\n \"knots\": { \"type\": \"array\", \"items\": { \"type\": \"number\" }, \"minItems\": 4 }\n }\n }\n }\n },\n \"globalPlan\": {\n \"type\": \"object\", \"required\": [\"timestamp\", \"globalPlan\"],\n \"properties\": {\n \"timestamp\": { \"$ref\": \"#/$defs/timestamp\" },\n \"globalPlan\": { \"type\": \"array\", \"items\": { \"$ref\": \"#/$defs/locationPointStamped\" } }\n }\n },\n \"request\": {\n \"type\": \"object\",\n \"required\": [\"destination\", \"source\", \"sequenceId\", \"timestamp\", \"details\"],\n \"properties\": {\n \"destination\": { \"anyOf\": [{ \"$ref\": \"#/$defs/uuid\" }, { \"const\": \"\" }] },\n \"source\": { \"$ref\": \"#/$defs/uuid\" },\n \"sequenceId\": { \"type\": \"integer\", \"minimum\": 0 },\n \"timestamp\": { \"$ref\": \"#/$defs/timestamp\" },\n \"priority\": { \"type\": \"integer\", \"minimum\": 0, \"maximum\": 255 },\n \"atomic\": { \"type\": \"boolean\" },\n \"details\": { \"type\": \"array\", \"minItems\": 1, \"items\": { \"$ref\": \"#/$defs/requestDetail\" } },\n \"recoveries\": { \"type\": \"array\", \"items\": { \"$ref\": \"#/$defs/requestDetail\" } }\n }\n },\n \"requestStatus\": {\n \"type\": \"object\",\n \"required\": [\"source\", \"destination\", \"sequenceId\", \"requestSequenceId\", \"timestamp\", \"status\", \"detailStatuses\"],\n \"properties\": {\n \"source\": { \"$ref\": \"#/$defs/uuid\" },\n \"destination\": { \"$ref\": \"#/$defs/uuid\" },\n \"sequenceId\": { \"type\": \"integer\", \"minimum\": 0 },\n \"requestSequenceId\": { \"type\": \"integer\", \"minimum\": 0 },\n \"timestamp\": { \"$ref\": \"#/$defs/timestamp\" },\n \"status\": { \"enum\": [\"RECEIVED\", \"ACCEPTED\", \"EXECUTING\", \"CANCELED\", \"SUCCEEDED\", \"ABORTED\", \"RECOVERY\"] },\n \"detailStatuses\": { \"type\": \"array\", \"items\": { \"$ref\": \"#/$defs/requestDetailStatus\" } },\n \"recoveryStatuses\": { \"type\": \"array\", \"items\": { \"$ref\": \"#/$defs/requestDetailStatus\" } }\n }\n },\n \"requestStatusArray\": { \"type\": \"array\", \"items\": { \"$ref\": \"#/$defs/requestStatus\" } }\n }\n}\n","/**\n * Copyright 2026 InOrbit, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const ROOT_NAMESPACE = '/ISO_21423/v1';\nexport const PROTOCOL_VERSION = '1.0';\n\nexport const ENTITY_TYPES = ['IMR', 'IMRFM'] as const;\nexport type KnownEntityType = (typeof ENTITY_TYPES)[number];\n/** Widened to allow vendor-defined entity types beyond the two the spec names, while still autocompleting the known ones. */\nexport type EntityType = KnownEntityType | (string & {});\n\n/** All operating states the spec defines: stop categories, motion states, and MODE_* (mutually-exclusive mode markers) mixed together. */\nexport const KNOWN_OPERATING_STATES = [\n 'STOP_CATEGORY_0', 'STOP_CATEGORY_1', 'STOP_CATEGORY_2',\n 'PAUSED', 'WAIT_FOR_RESET', 'MAPPING', 'LOST',\n 'WAIT_FOR_ATTACHMENT', 'WAIT_FOR_EVENT', 'BLOCKED', 'ATTACHMENT_ACTIVE',\n 'STOPPED', 'DOCKING', 'SLOWING', 'ACCELERATING',\n 'LEFT_TURN', 'RIGHT_TURN', 'REVERSE', 'FORWARD', 'LINE_FOLLOWING',\n 'CHARGING', 'LOW_BATTERY', 'IDLE', 'PARKED', 'OFFLINE',\n 'READY', 'NOT_READY',\n 'MODE_AUTO', 'MODE_SEMIAUTO', 'MODE_TELEOP', 'MODE_MANUAL', 'MODE_MAINTENANCE',\n] as const;\nexport type KnownOperatingState = (typeof KNOWN_OPERATING_STATES)[number];\nexport type OperatingState = KnownOperatingState | (string & {});\n\n/** Subset of {@link KNOWN_OPERATING_STATES} that are the mutually-exclusive MODE_* markers. */\nexport const OPERATING_MODES = [\n 'MODE_AUTO', 'MODE_SEMIAUTO', 'MODE_TELEOP', 'MODE_MANUAL', 'MODE_MAINTENANCE',\n] as const;\n\n/** LWT state published by the broker on ungraceful disconnect (B.4). */\nexport const LOST_CONNECTION_STATE = 'LOST_CONNECTION';\n\n/** Overall lifecycle states for a whole {@link Request} (its `RECOVERY` state has no per-detail equivalent — see {@link DetailState}). */\nexport const REQUEST_STATES = [\n 'RECEIVED', 'ACCEPTED', 'EXECUTING', 'CANCELED', 'SUCCEEDED', 'ABORTED', 'RECOVERY',\n] as const;\nexport type RequestState = (typeof REQUEST_STATES)[number];\n\n/** Lifecycle states for a single detail/action within a request. */\nexport const DETAIL_STATES = [\n 'RECEIVED', 'ACCEPTED', 'EXECUTING', 'CANCELED', 'SUCCEEDED', 'ABORTED',\n] as const;\nexport type DetailState = (typeof DETAIL_STATES)[number];\n\nexport const KNOWN_REASON_CODES = [\n 'OK', 'GENERAL_FAILURE', 'TIMEOUT', 'VERSION_NOT_SUPPORTED', 'FORMAT_NOT_SUPPORTED',\n 'ACTION_NOT_IMPLEMENTED', 'REJECTED', 'MALFORMED_REQUEST', 'INVALID_IMR_STATE_FOR_ACTION',\n] as const;\nexport type ReasonCode = (typeof KNOWN_REASON_CODES)[number] | (string & {});\n\nexport const BATTERY_HEALTH = [\n 'UNKNOWN', 'HEALTHY', 'OVERHEAT', 'DEAD', 'OVERVOLTAGE', 'FAILURE', 'COLD',\n] as const;\nexport type BatteryHealth = (typeof BATTERY_HEALTH)[number] | (string & {});\n\n/** Charging state as distinct from {@link BatteryHealth} — this is about current/direction of charge flow, not battery condition. */\nexport const CHARGING_STATES = [\n 'UNKNOWN', 'CHARGING', 'DISCHARGING', 'NOT_CHARGING', 'FULL',\n] as const;\nexport type ChargingState = (typeof CHARGING_STATES)[number] | (string & {});\n\nexport const DOCK_ACTIONS = ['CHARGE', 'DUMP', 'FILL', 'LOAD', 'UNLOAD', 'PICK', 'DROP'] as const;\nexport type DockAction = (typeof DOCK_ACTIONS)[number] | (string & {});\n","/**\n * Copyright 2026 InOrbit, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** Base class for all errors this SDK throws; `name` is set to the concrete subclass name so it survives serialization. */\nexport class Iso21423Error extends Error {\n constructor(message: string) {\n super(message);\n this.name = new.target.name;\n }\n}\n\n/** Thrown when a payload fails ISO 21423 JSON Schema validation; `errors` holds the raw Ajv error list. */\nexport class ValidationError extends Iso21423Error {\n constructor(message: string, public readonly errors: unknown[]) {\n super(message);\n }\n}\n\n/** Thrown when a request/detail reaches a terminal failure state; `finalStatus` carries the last status received. */\nexport class RequestFailed extends Iso21423Error {\n constructor(message: string, public readonly finalStatus: unknown) {\n super(message);\n }\n}\n\nexport class RequestTimeout extends Iso21423Error {}\nexport class BrokerUnavailable extends Iso21423Error {}\n\n/** Thrown when a broker/ACL rejects a publish or subscribe; `topic` names the topic that was denied. */\nexport class AuthorizationDenied extends Iso21423Error {\n constructor(message: string, public readonly topic: string) {\n super(message);\n }\n}\n\nexport class NotCapableError extends Iso21423Error {}\n/** Thrown by {@link Lifecycle.transition} when the requested state change isn't allowed from the current state. */\nexport class IllegalTransition extends Iso21423Error {}\n","/**\n * Copyright 2026 InOrbit, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst TIMESTAMP_KEYS = new Set(['timestamp', 'arrivalTime']);\nconst COMMA_TS = /^(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}),(\\d+)(Z|[+-]\\d{2}:?\\d{2})$/;\n\n/** Recursively rewrites comma-decimal timestamps (e.g. \"12:00:00,500Z\") to dot-decimal form, recording a warning per fix. */\nfunction fixTimestamps(value: unknown, warnings: string[], path: string): unknown {\n if (Array.isArray(value)) return value.map((v, i) => fixTimestamps(v, warnings, `${path}[${i}]`));\n if (value === null || typeof value !== 'object') return value;\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(value as Record<string, unknown>)) {\n if (TIMESTAMP_KEYS.has(k) && typeof v === 'string' && COMMA_TS.test(v)) {\n out[k] = v.replace(COMMA_TS, '$1.$2$3');\n warnings.push(`${path}.${k}: comma-decimal timestamp normalized to dot form`);\n } else {\n out[k] = fixTimestamps(v, warnings, `${path}.${k}`);\n }\n }\n return out;\n}\n\n/**\n * Best-effort cleanup of inbound wire payloads before schema validation: fixes comma-decimal\n * timestamps and, for `entityStatus`, renames the legacy `id` field to `entityId` (spec §3.1).\n * Never throws; returns the corrected value plus human-readable warnings for anything it touched.\n */\nexport function normalizeInbound(kind: string, value: unknown): { value: unknown; warnings: string[] } {\n const warnings: string[] = [];\n let v = fixTimestamps(value, warnings, kind);\n if (kind === 'entityStatus' && v !== null && typeof v === 'object' && !Array.isArray(v)) {\n const o = v as Record<string, unknown>;\n if (o.entityId === undefined && typeof o.id === 'string') {\n const { id, ...rest } = o;\n v = { ...rest, entityId: id };\n warnings.push('entityStatus: legacy field \"id\" renamed to \"entityId\" (spec §3.1)');\n }\n }\n return { value: v, warnings };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACgBA,eAAwB;AACxB,yBAAuB;;;ACjBvB;AAAA,EACE,SAAW;AAAA,EACX,KAAO;AAAA,EACP,OAAS;AAAA,IACP,MAAQ,EAAE,MAAQ,UAAU,SAAW,6FAA6F;AAAA,IACpI,WAAa,EAAE,M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AI,OAAO,MAAM,YAAY,CAAC,aAAa,IAAI,CAAC,GAAG;AACjD,eAAS,KAAK,0CAA0C,CAAC,2BAA2B;AAAA,IACtF;AAAA,EACF;AACF;AAGO,SAAS,gBAAgB,MAAmB,KAAgC;AACjF,QAAM,EAAE,OAAO,SAAS,IAAI,iBAAiB,MAAM,GAAG;AACtD,QAAM,WAAW,IAAI,UAAU,0DAA0D,IAAI,EAAE;AAC/F,MAAI,CAAC,SAAU,OAAM,IAAI,MAAM,+BAA+B,IAAI,EAAE;AACpE,QAAM,KAAK,SAAS,KAAK;AACzB,kBAAgB,MAAM,OAAO,QAAQ;AACrC,SAAO,KACH,EAAE,IAAI,MAAM,OAAO,SAAS,IAC5B,EAAE,IAAI,OAAO,OAAO,UAAU,QAAQ,SAAS,UAAU,CAAC,EAAE;AAClE;AAGO,SAAS,YAAY,MAAmB,OAAsB;AACnE,QAAM,IAAI,gBAAgB,MAAM,KAAK;AACrC,MAAI,CAAC,EAAE,IAAI;AACT,UAAM,IAAI,gBAAgB,YAAY,IAAI,wCAAwC,EAAE,UAAU,CAAC,CAAC;AAAA,EAClG;AACF;","names":["addFormats"]}
@@ -0,0 +1,28 @@
1
+ export { M as MessageKind, V as ValidationResult, a as assertValid, v as validateMessage } from './validators-Be0ce1b8.cjs';
2
+
3
+ /**
4
+ * Copyright 2026 InOrbit, Inc.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ /**
19
+ * Best-effort cleanup of inbound wire payloads before schema validation: fixes comma-decimal
20
+ * timestamps and, for `entityStatus`, renames the legacy `id` field to `entityId` (spec §3.1).
21
+ * Never throws; returns the corrected value plus human-readable warnings for anything it touched.
22
+ */
23
+ declare function normalizeInbound(kind: string, value: unknown): {
24
+ value: unknown;
25
+ warnings: string[];
26
+ };
27
+
28
+ export { normalizeInbound };
@@ -0,0 +1,28 @@
1
+ export { M as MessageKind, V as ValidationResult, a as assertValid, v as validateMessage } from './validators-Be0ce1b8.js';
2
+
3
+ /**
4
+ * Copyright 2026 InOrbit, Inc.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ /**
19
+ * Best-effort cleanup of inbound wire payloads before schema validation: fixes comma-decimal
20
+ * timestamps and, for `entityStatus`, renames the legacy `id` field to `entityId` (spec §3.1).
21
+ * Never throws; returns the corrected value plus human-readable warnings for anything it touched.
22
+ */
23
+ declare function normalizeInbound(kind: string, value: unknown): {
24
+ value: unknown;
25
+ warnings: string[];
26
+ };
27
+
28
+ export { normalizeInbound };
package/dist/schema.js ADDED
@@ -0,0 +1,14 @@
1
+ import "./chunk-JIYCTQXR.js";
2
+ import {
3
+ assertValid,
4
+ normalizeInbound,
5
+ validateMessage
6
+ } from "./chunk-UW6WTEPT.js";
7
+ import "./chunk-RD7PYTIT.js";
8
+ import "./chunk-JLUENXGS.js";
9
+ export {
10
+ assertValid,
11
+ normalizeInbound,
12
+ validateMessage
13
+ };
14
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}