@uns-kit/core 3.0.28 → 3.0.30
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.
- package/MIGRATIONS.md +100 -0
- package/README.md +10 -0
- package/dist/config/app-config.d.ts +14 -0
- package/dist/config/app-config.d.ts.map +1 -1
- package/dist/config/app-config.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/runtime/configuration-group-authorization.d.ts +50 -0
- package/dist/runtime/configuration-group-authorization.d.ts.map +1 -0
- package/dist/runtime/configuration-group-authorization.js +113 -0
- package/dist/runtime/configuration-group-authorization.js.map +1 -0
- package/dist/runtime/configuration-group-contract.d.ts +75 -0
- package/dist/runtime/configuration-group-contract.d.ts.map +1 -0
- package/dist/runtime/configuration-group-contract.js +233 -0
- package/dist/runtime/configuration-group-contract.js.map +1 -0
- package/dist/runtime/process-group-authorization.d.ts +2 -0
- package/dist/runtime/process-group-authorization.d.ts.map +1 -1
- package/dist/runtime/process-group-authorization.js +34 -12
- package/dist/runtime/process-group-authorization.js.map +1 -1
- package/dist/runtime/process-group-backup-contract.d.ts +22 -0
- package/dist/runtime/process-group-backup-contract.d.ts.map +1 -0
- package/dist/runtime/process-group-backup-contract.js +20 -0
- package/dist/runtime/process-group-backup-contract.js.map +1 -0
- package/dist/runtime/process-group-backup-contract.json +7 -0
- package/dist/runtime/process-group-configured-upgrade.d.ts +4 -0
- package/dist/runtime/process-group-configured-upgrade.d.ts.map +1 -0
- package/dist/runtime/process-group-configured-upgrade.js +107 -0
- package/dist/runtime/process-group-configured-upgrade.js.map +1 -0
- package/dist/runtime/process-group-generation.d.ts +166 -0
- package/dist/runtime/process-group-generation.d.ts.map +1 -0
- package/dist/runtime/process-group-generation.js +278 -0
- package/dist/runtime/process-group-generation.js.map +1 -0
- package/dist/runtime/process-group-inspection.d.ts +2 -0
- package/dist/runtime/process-group-inspection.d.ts.map +1 -1
- package/dist/runtime/process-group-inspection.js +120 -40
- package/dist/runtime/process-group-inspection.js.map +1 -1
- package/dist/runtime/process-group-resources.d.ts +1 -0
- package/dist/runtime/process-group-resources.d.ts.map +1 -1
- package/dist/runtime/process-group-resources.js +8 -0
- package/dist/runtime/process-group-resources.js.map +1 -1
- package/dist/runtime/process-group-runtime-selection.d.ts +14 -0
- package/dist/runtime/process-group-runtime-selection.d.ts.map +1 -0
- package/dist/runtime/process-group-runtime-selection.js +29 -0
- package/dist/runtime/process-group-runtime-selection.js.map +1 -0
- package/dist/runtime/process-group-snapshot.mjs +60 -8
- package/dist/runtime/process-group-staging.d.ts +2 -2
- package/dist/runtime/process-group-staging.d.ts.map +1 -1
- package/dist/runtime/process-group-staging.js +6 -4
- package/dist/runtime/process-group-staging.js.map +1 -1
- package/dist/runtime/process-group-supervision.d.ts +2 -2
- package/dist/runtime/process-group-supervision.d.ts.map +1 -1
- package/dist/runtime/process-group-supervision.js +3 -2
- package/dist/runtime/process-group-supervision.js.map +1 -1
- package/dist/runtime/process-group-upgrade.d.ts +76 -6
- package/dist/runtime/process-group-upgrade.d.ts.map +1 -1
- package/dist/runtime/process-group-upgrade.js +7 -1
- package/dist/runtime/process-group-upgrade.js.map +1 -1
- package/dist/uns/uns-interfaces.d.ts +3 -0
- package/dist/uns/uns-interfaces.d.ts.map +1 -1
- package/dist/uns/uns-interfaces.js.map +1 -1
- package/dist/uns/uns-proxy-process.d.ts.map +1 -1
- package/dist/uns/uns-proxy-process.js +3 -0
- package/dist/uns/uns-proxy-process.js.map +1 -1
- package/dist/uns-config/config-schema.d.ts +16 -0
- package/dist/uns-config/config-schema.d.ts.map +1 -1
- package/dist/uns-config/mqtt-channel.d.ts +1 -1
- package/dist/uns-config/mqtt-channel.d.ts.map +1 -1
- package/dist/uns-config/mqtt-channel.js +3 -0
- package/dist/uns-config/mqtt-channel.js.map +1 -1
- package/dist/uns-config/uns-core-schema.d.ts +137 -0
- package/dist/uns-config/uns-core-schema.d.ts.map +1 -1
- package/dist/uns-config/uns-core-schema.js +6 -1
- package/dist/uns-config/uns-core-schema.js.map +1 -1
- package/dist/uns-mqtt/mqtt-interfaces.d.ts +5 -0
- package/dist/uns-mqtt/mqtt-interfaces.d.ts.map +1 -1
- package/dist/uns-mqtt/mqtt-interfaces.js.map +1 -1
- package/dist/uns-mqtt/mqtt-proxy.d.ts +3 -0
- package/dist/uns-mqtt/mqtt-proxy.d.ts.map +1 -1
- package/dist/uns-mqtt/mqtt-proxy.js +26 -1
- package/dist/uns-mqtt/mqtt-proxy.js.map +1 -1
- package/dist/uns-mqtt/mqtt-worker.d.ts +3 -1
- package/dist/uns-mqtt/mqtt-worker.d.ts.map +1 -1
- package/dist/uns-mqtt/mqtt-worker.js +45 -8
- package/dist/uns-mqtt/mqtt-worker.js.map +1 -1
- package/dist/uns-mqtt/publish-queue-contract.d.ts +33 -0
- package/dist/uns-mqtt/publish-queue-contract.d.ts.map +1 -0
- package/dist/uns-mqtt/publish-queue-contract.js +18 -0
- package/dist/uns-mqtt/publish-queue-contract.js.map +1 -0
- package/dist/uns-mqtt/publish-queue-store.d.ts +33 -0
- package/dist/uns-mqtt/publish-queue-store.d.ts.map +1 -0
- package/dist/uns-mqtt/publish-queue-store.js +177 -0
- package/dist/uns-mqtt/publish-queue-store.js.map +1 -0
- package/dist/uns-mqtt/publish-queue.d.ts +43 -0
- package/dist/uns-mqtt/publish-queue.d.ts.map +1 -0
- package/dist/uns-mqtt/publish-queue.js +235 -0
- package/dist/uns-mqtt/publish-queue.js.map +1 -0
- package/dist/uns-mqtt/uns-mqtt-proxy.d.ts +7 -0
- package/dist/uns-mqtt/uns-mqtt-proxy.d.ts.map +1 -1
- package/dist/uns-mqtt/uns-mqtt-proxy.js +98 -5
- package/dist/uns-mqtt/uns-mqtt-proxy.js.map +1 -1
- package/package.json +1 -1
package/MIGRATIONS.md
CHANGED
|
@@ -9,6 +9,106 @@ Agents must inspect the application's existing ownership and shutdown flow
|
|
|
9
9
|
before editing it. The examples below describe the intended behavior, not a
|
|
10
10
|
mechanical search-and-replace operation.
|
|
11
11
|
|
|
12
|
+
## 3.0.30 - Optional MQTT output buffering and durable admission
|
|
13
|
+
|
|
14
|
+
When crossing `<3.0.30` to `>=3.0.30`, output persistence remains optional.
|
|
15
|
+
Registry3.0.29 must not be assumed to contain these APIs. Ordinary
|
|
16
|
+
applications require no migration and keep the old publisher behavior.
|
|
17
|
+
|
|
18
|
+
Opt-in TypeScript applications may configure `output.publishQueue` and pass it via
|
|
19
|
+
standard MQTT channel resolution. `buffered` uses RAM with spill-on-failure/overflow;
|
|
20
|
+
`durable` acknowledges local admission only after a SQLite WAL/FULL commit. Both
|
|
21
|
+
require QoS1/2, serial output and an explicit private persistent directory. A publish
|
|
22
|
+
call acknowledges admission; `flush()` includes retained records and waits for broker
|
|
23
|
+
completion. Unknown delivery outcomes can replay. Input MQTT ACKs are not changed.
|
|
24
|
+
|
|
25
|
+
Use one owner with `handover=false`. Legacy RAM hash handover cannot transfer the
|
|
26
|
+
outbox. Preserve existing application journals/Archiver spools; do not reinterpret,
|
|
27
|
+
move or delete them as part of this opt-in. Host migration/automatic backup, Python,
|
|
28
|
+
SQL writers and non-MQTT destinations remain outside this capability. See the source
|
|
29
|
+
`docs/mqtt-output-persistence.md` and two unrelated examples before enabling it.
|
|
30
|
+
|
|
31
|
+
### Shared bounded journal backup coverage in 3.0.30
|
|
32
|
+
|
|
33
|
+
Consume `runtime/process-group-backup-contract.js` for public coverage validation,
|
|
34
|
+
and vendor the matching standalone exporter plus contract JSON with source/digest
|
|
35
|
+
provenance in native helpers. The fixed contract supports32 journals while keeping
|
|
36
|
+
512MiB snapshot and1GiB capsule bounds. Do not take limits from an operation request.
|
|
37
|
+
Old two-argument exporter callers keep their nine-journal limit; archives through9
|
|
38
|
+
remain compatible. Older readers may reject larger new captures, so coordinate the
|
|
39
|
+
host/helper rollout. Preserve all source journals and reject overflow without partial
|
|
40
|
+
success. See `docs/process-group-backup-capacity.md`. This follow-up is not
|
|
41
|
+
part of source3.0.29; use the coordinated3.0.30 SDK, host and helper before rollout.
|
|
42
|
+
|
|
43
|
+
## 3.0.29 - Optional configuration resources and reviewed journal transitions
|
|
44
|
+
|
|
45
|
+
Release preparation: source/packaged local acceptance is complete; npm publication
|
|
46
|
+
is a separate owner-operated step. These APIs are not in registry3.0.28.
|
|
47
|
+
|
|
48
|
+
When crossing `<3.0.29` to `>=3.0.29`, existing applications and file policies need
|
|
49
|
+
no migration. Opt-in applications can declare `processGroupConfigurationRuntime`
|
|
50
|
+
protocol2 and use `runtime/configuration-group-contract.js`, immutable opaque JSON
|
|
51
|
+
resources, journal contract2 and policy schema4. Applications own business validation;
|
|
52
|
+
SDK owns common validation/hash/identity rules; hosts own authenticated review,
|
|
53
|
+
durable operations and launch control. Never add named-application lifecycle code.
|
|
54
|
+
|
|
55
|
+
Use `configurationGroupSnapshot` to bind plain JSON resources and retain its SDK-issued
|
|
56
|
+
proof. Validate the resolved application resources against the authorized raw snapshot.
|
|
57
|
+
Keep runtime group snapshots immutable. No mapping, unit or topic is inferred by the
|
|
58
|
+
host. See [the configuration guide](https://github.com/uns-openhub/uns-kit/blob/master/docs/process-group-configuration-runtime.md)
|
|
59
|
+
and [worked unrelated adapter example](https://github.com/uns-openhub/uns-kit/blob/master/docs/examples/configuration-process-group.md).
|
|
60
|
+
|
|
61
|
+
Keep file protocol1/policy3 and frozen historical policies1/2 unchanged. New journals
|
|
62
|
+
store profile bindings as `{processName, resourceSha256, dataGroup}`. Host inspection,
|
|
63
|
+
reservations, staging, supervision and standalone snapshots understand both formats;
|
|
64
|
+
ordinary undeclared Node/Python services retain their current behavior. Hosts must
|
|
65
|
+
pin group/generation in configured launch reservations and share these helpers rather
|
|
66
|
+
than reconstruct the validation or execute application JavaScript.
|
|
67
|
+
|
|
68
|
+
### Resource changes require separate generations
|
|
69
|
+
|
|
70
|
+
The paired management envelope stays protocol1. Its nested protocol2 input reviews
|
|
71
|
+
four placements, separate source/target journals and explicit input-pause,
|
|
72
|
+
resource-review and possible-broker-replay acknowledgements. Use the shared
|
|
73
|
+
`process-group-generation.js` review; stop receiver first, finish admitted old work,
|
|
74
|
+
prove publisher exit, then launch the reviewed new receiver and publisher. Rollback
|
|
75
|
+
symmetrically drains the successor generation before restoring the old pair.
|
|
76
|
+
|
|
77
|
+
Never relabel an old journal or reinterpret pending payloads, even when it is empty.
|
|
78
|
+
UUIDs, contracts, checkpoints and canonical policies remain separate and retained.
|
|
79
|
+
Unknown initialization/stop/start outcomes require reconciliation of the same durable
|
|
80
|
+
operation. Do not initialize a replacement journal or retry an unconfirmed launch.
|
|
81
|
+
See [generation preparation and limits](https://github.com/uns-openhub/uns-kit/blob/master/docs/process-group-generations.md).
|
|
82
|
+
|
|
83
|
+
### Version changes can retain an unchanged generation
|
|
84
|
+
|
|
85
|
+
`reviewInstalledProcessGroupUpgrade` supports file groups and configured pairs through
|
|
86
|
+
the existing nested protocol1 version input. Configured review adds `retainedJournal`
|
|
87
|
+
(contract2); all resources, process/profile/input/broker identities, capacity,
|
|
88
|
+
journal directory/UUID and generation must stay unchanged. A resource change belongs
|
|
89
|
+
to the separate-generation path. No initializer runs during this version-only step.
|
|
90
|
+
|
|
91
|
+
The SDK validates staged schema4 target policy data without issuing live authority.
|
|
92
|
+
After both prior owners have proven clean exits, the host compares/swaps the canonical
|
|
93
|
+
policy and starts receiver before publisher with one-use launch identities. Both old
|
|
94
|
+
and new policy byte snapshots remain available for rollback; pending records and
|
|
95
|
+
completed checkpoints stay valid in that same journal. Recheck its integrity before
|
|
96
|
+
policy replacement and launch. See [paired-version guide and request example](https://github.com/uns-openhub/uns-kit/blob/master/docs/process-group-version-upgrade.md).
|
|
97
|
+
|
|
98
|
+
### Packaging and limits
|
|
99
|
+
|
|
100
|
+
Local Linux acceptance covers pending tasks, interruption, lost response, same-operation
|
|
101
|
+
reconciliation, exact outputs and rollback. The shared snapshot reader accepts journal
|
|
102
|
+
contracts1/2 and verifies resource/checkpoint bindings; sync native helpers from the
|
|
103
|
+
exact installed SDK asset/version/hash. Existing backup bounds remain9 journals total,
|
|
104
|
+
unique flat snapshot group identifiers across namespaces, and archiver spool exclusion.
|
|
105
|
+
|
|
106
|
+
Publish the coordinated SDK before pinning downstream registry versions/lockfiles;
|
|
107
|
+
keep Zod resolution compatible and regenerate schemas/typecheck from frozen installs.
|
|
108
|
+
Hosts/helpers require their own compatible releases. This does not authorize a
|
|
109
|
+
production rollout, cross-host queue transfer, exactly-once output, automatic unknown
|
|
110
|
+
outcome resolution or recovery of MQTT input never admitted by the receiver.
|
|
111
|
+
|
|
12
112
|
## 3.0.28 - Paired process-group version upgrades
|
|
13
113
|
|
|
14
114
|
When crossing `<3.0.28` to `>=3.0.28`, shared schemas and installed-resource review support a
|
package/README.md
CHANGED
|
@@ -273,6 +273,16 @@ and apply only the migrations whose version boundaries are crossed. The
|
|
|
273
273
|
`3.0.0` migration documents the MQTT table-column object contract, while the
|
|
274
274
|
`2.0.71` migration documents MQTT publish and shutdown ownership changes.
|
|
275
275
|
|
|
276
|
+
## Optional configuration-owned process groups
|
|
277
|
+
|
|
278
|
+
Version3.0.29 adds optional shared contracts for immutable application-owned JSON
|
|
279
|
+
resources, reviewed journal generations and same-generation paired version upgrades.
|
|
280
|
+
Existing file groups and ordinary services need no migration. Applications validate
|
|
281
|
+
business resources; hosts enforce authenticated durable lifecycle operations.
|
|
282
|
+
See the [guide and example](https://github.com/uns-openhub/uns-kit/blob/master/docs/process-group-configuration-runtime.md)
|
|
283
|
+
and the3.0.29 entry in `MIGRATIONS.md`. Source preparation is not npm publication or
|
|
284
|
+
production activation.
|
|
285
|
+
|
|
276
286
|
## Sync UNS schema from the controller
|
|
277
287
|
|
|
278
288
|
`sync-uns-schema` fetches the canonical UNS dictionary and measurements from the controller REST API and refreshes local JSON files and generated TypeScript artifacts.
|
|
@@ -112,6 +112,20 @@ export interface ProjectAppConfig {
|
|
|
112
112
|
cert?: string | undefined;
|
|
113
113
|
key?: string | undefined;
|
|
114
114
|
servername?: string | undefined;
|
|
115
|
+
/** Opt-in MQTT output persistence; does not persist input subscriptions. */
|
|
116
|
+
publishQueue?: {
|
|
117
|
+
mode: "buffered" | "durable";
|
|
118
|
+
directory: string;
|
|
119
|
+
maxRecords?: number;
|
|
120
|
+
maxBytes?: number;
|
|
121
|
+
memoryRecords?: number;
|
|
122
|
+
memoryBytes?: number;
|
|
123
|
+
maxMessageBytes?: number;
|
|
124
|
+
maxDiskBytes?: number;
|
|
125
|
+
minFreeBytes?: number;
|
|
126
|
+
retryIntervalMs?: number;
|
|
127
|
+
publishTimeoutMs?: number;
|
|
128
|
+
} | undefined;
|
|
115
129
|
} | undefined;
|
|
116
130
|
infra: {
|
|
117
131
|
host?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-config.d.ts","sourceRoot":"","sources":["../../src/config/app-config.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,gBAAgB;IAC7B,GAAG,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,2EAA2E;QAC3E,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC3B,8EAA8E;QAC9E,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC3B,0DAA0D;QAC1D,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC9B,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;QAC7C,iDAAiD;QACjD,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,2DAA2D;QAC3D,gBAAgB,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;QAC/C,+EAA+E;QAC/E,UAAU,CAAC,EAAE;YACT,uEAAuE;YACvE,OAAO,CAAC,EAAE,OAAO,CAAC;YAClB,8DAA8D;YAC9D,aAAa,CAAC,EAAE,OAAO,CAAC;YACxB,sDAA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jB,GAAG,SAAS,CAAC;QACd,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACxB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC1B,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACzB,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KACnC,CAAC;IACF,MAAM,CAAC,EAAE;QACL,QAAQ,CAAC,EAAE,cAAc,CAAC;QAC1B,YAAY,EAAE,MAAM,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KAChC,GAAG,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,SAAU,SAAQ,gBAAgB;CAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-config.js","sourceRoot":"","sources":["../../src/config/app-config.ts"],"names":[],"mappings":"","sourcesContent":["/* Auto-generated. Do not edit by hand. */\nexport interface ProjectAppConfig {\n uns: {\n graphql: string;\n rest: string;\n /** Bearer token used for service-to-service access to the UNS instance. */\n token?: string | undefined;\n /** Email used when authenticating to graphql endpoint of the UNS instance. */\n email?: string | undefined;\n /** Password or secret value paired with the UNS email. */\n password?: string | undefined;\n instanceMode?: \"wait\" | \"force\" | \"handover\";\n /** Process name used in MQTT topics and logs. */\n processName: string;\n handover?: boolean;\n /** Opt-in controller-correlated MQTT handover protocol. */\n handoverProtocol?: \"correlated-v1\" | undefined;\n /** Optional PM2/controller supervisor guard settings for this RTT instance. */\n supervisor?: {\n /** Enable controller/PM2 supervisor handling for this RTT instance. */\n enabled?: boolean;\n /** Let PM2 restart the process when it exits unexpectedly. */\n restartOnExit?: boolean;\n /** Optional PM2 memory restart limit in megabytes. */\n maxMemoryMb?: number | undefined;\n /** Let the controller auto-start this instance when required system-service runtime signals are absent. */\n restartOnUnhealthy?: boolean;\n /** How long runtime signals must stay unhealthy before the controller supervisor can act. */\n unhealthyAfterMs?: number;\n /** Minimum time between controller supervisor restart attempts for this instance. */\n restartCooldownMs?: number;\n } | undefined;\n jwksWellKnownUrl?: string | undefined;\n kidWellKnownUrl?: string | undefined;\n env?: \"dev\" | \"staging\" | \"test\" | \"prod\";\n };\n logging?: {\n adapter?: string;\n host: string;\n port?: number;\n level?: \"error\" | \"warn\" | \"info\" | \"http\" | \"verbose\" | \"debug\" | \"silly\";\n } | undefined;\n input?: {\n host?: string | undefined;\n hosts?: string[] | undefined;\n servers?: {\n host: string;\n port?: number | undefined;\n protocol?: (\"mqtt\" | \"mqtts\" | \"ws\" | \"wss\" | \"tcp\" | \"ssl\") | undefined;\n }[] | undefined;\n port?: number | undefined;\n protocol?: (\"mqtt\" | \"mqtts\" | \"ws\" | \"wss\" | \"tcp\" | \"ssl\") | undefined;\n username?: string | undefined;\n password?: string | undefined;\n clientId?: string | undefined;\n clean?: boolean | undefined;\n keepalive?: number | undefined;\n connectTimeout?: number | undefined;\n reconnectPeriod?: number | undefined;\n reconnectOnConnackError?: boolean | undefined;\n resubscribe?: boolean | undefined;\n queueQoSZero?: boolean | undefined;\n rejectUnauthorized?: boolean | undefined;\n properties?: {\n sessionExpiryInterval?: number | undefined;\n receiveMaximum?: number | undefined;\n maximumPacketSize?: number | undefined;\n topicAliasMaximum?: number | undefined;\n requestResponseInformation?: boolean | undefined;\n requestProblemInformation?: boolean | undefined;\n userProperties?: {\n [x: string]: string;\n } | undefined;\n } | undefined;\n ca?: string | undefined;\n cert?: string | undefined;\n key?: string | undefined;\n servername?: string | undefined;\n } | undefined;\n output?: {\n host?: string | undefined;\n hosts?: string[] | undefined;\n servers?: {\n host: string;\n port?: number | undefined;\n protocol?: (\"mqtt\" | \"mqtts\" | \"ws\" | \"wss\" | \"tcp\" | \"ssl\") | undefined;\n }[] | undefined;\n port?: number | undefined;\n protocol?: (\"mqtt\" | \"mqtts\" | \"ws\" | \"wss\" | \"tcp\" | \"ssl\") | undefined;\n username?: string | undefined;\n password?: string | undefined;\n clientId?: string | undefined;\n clean?: boolean | undefined;\n keepalive?: number | undefined;\n connectTimeout?: number | undefined;\n reconnectPeriod?: number | undefined;\n reconnectOnConnackError?: boolean | undefined;\n resubscribe?: boolean | undefined;\n queueQoSZero?: boolean | undefined;\n rejectUnauthorized?: boolean | undefined;\n properties?: {\n sessionExpiryInterval?: number | undefined;\n receiveMaximum?: number | undefined;\n maximumPacketSize?: number | undefined;\n topicAliasMaximum?: number | undefined;\n requestResponseInformation?: boolean | undefined;\n requestProblemInformation?: boolean | undefined;\n userProperties?: {\n [x: string]: string;\n } | undefined;\n } | undefined;\n ca?: string | undefined;\n cert?: string | undefined;\n key?: string | undefined;\n servername?: string | undefined;\n } | undefined;\n infra: {\n host?: string | undefined;\n hosts?: string[] | undefined;\n servers?: {\n host: string;\n port?: number | undefined;\n protocol?: (\"mqtt\" | \"mqtts\" | \"ws\" | \"wss\" | \"tcp\" | \"ssl\") | undefined;\n }[] | undefined;\n port?: number | undefined;\n protocol?: (\"mqtt\" | \"mqtts\" | \"ws\" | \"wss\" | \"tcp\" | \"ssl\") | undefined;\n username?: string | undefined;\n password?: string | undefined;\n clientId?: string | undefined;\n clean?: boolean | undefined;\n keepalive?: number | undefined;\n connectTimeout?: number | undefined;\n reconnectPeriod?: number | undefined;\n reconnectOnConnackError?: boolean | undefined;\n resubscribe?: boolean | undefined;\n queueQoSZero?: boolean | undefined;\n rejectUnauthorized?: boolean | undefined;\n properties?: {\n sessionExpiryInterval?: number | undefined;\n receiveMaximum?: number | undefined;\n maximumPacketSize?: number | undefined;\n topicAliasMaximum?: number | undefined;\n requestResponseInformation?: boolean | undefined;\n requestProblemInformation?: boolean | undefined;\n userProperties?: {\n [x: string]: string;\n } | undefined;\n } | undefined;\n ca?: string | undefined;\n cert?: string | undefined;\n key?: string | undefined;\n servername?: string | undefined;\n };\n devops?: {\n provider?: \"azure-devops\";\n organization: string;\n project?: string | undefined;\n } | undefined;\n}\n\nexport interface AppConfig extends ProjectAppConfig {}\n"]}
|
|
1
|
+
{"version":3,"file":"app-config.js","sourceRoot":"","sources":["../../src/config/app-config.ts"],"names":[],"mappings":"","sourcesContent":["/* Auto-generated. Do not edit by hand. */\nexport interface ProjectAppConfig {\n uns: {\n graphql: string;\n rest: string;\n /** Bearer token used for service-to-service access to the UNS instance. */\n token?: string | undefined;\n /** Email used when authenticating to graphql endpoint of the UNS instance. */\n email?: string | undefined;\n /** Password or secret value paired with the UNS email. */\n password?: string | undefined;\n instanceMode?: \"wait\" | \"force\" | \"handover\";\n /** Process name used in MQTT topics and logs. */\n processName: string;\n handover?: boolean;\n /** Opt-in controller-correlated MQTT handover protocol. */\n handoverProtocol?: \"correlated-v1\" | undefined;\n /** Optional PM2/controller supervisor guard settings for this RTT instance. */\n supervisor?: {\n /** Enable controller/PM2 supervisor handling for this RTT instance. */\n enabled?: boolean;\n /** Let PM2 restart the process when it exits unexpectedly. */\n restartOnExit?: boolean;\n /** Optional PM2 memory restart limit in megabytes. */\n maxMemoryMb?: number | undefined;\n /** Let the controller auto-start this instance when required system-service runtime signals are absent. */\n restartOnUnhealthy?: boolean;\n /** How long runtime signals must stay unhealthy before the controller supervisor can act. */\n unhealthyAfterMs?: number;\n /** Minimum time between controller supervisor restart attempts for this instance. */\n restartCooldownMs?: number;\n } | undefined;\n jwksWellKnownUrl?: string | undefined;\n kidWellKnownUrl?: string | undefined;\n env?: \"dev\" | \"staging\" | \"test\" | \"prod\";\n };\n logging?: {\n adapter?: string;\n host: string;\n port?: number;\n level?: \"error\" | \"warn\" | \"info\" | \"http\" | \"verbose\" | \"debug\" | \"silly\";\n } | undefined;\n input?: {\n host?: string | undefined;\n hosts?: string[] | undefined;\n servers?: {\n host: string;\n port?: number | undefined;\n protocol?: (\"mqtt\" | \"mqtts\" | \"ws\" | \"wss\" | \"tcp\" | \"ssl\") | undefined;\n }[] | undefined;\n port?: number | undefined;\n protocol?: (\"mqtt\" | \"mqtts\" | \"ws\" | \"wss\" | \"tcp\" | \"ssl\") | undefined;\n username?: string | undefined;\n password?: string | undefined;\n clientId?: string | undefined;\n clean?: boolean | undefined;\n keepalive?: number | undefined;\n connectTimeout?: number | undefined;\n reconnectPeriod?: number | undefined;\n reconnectOnConnackError?: boolean | undefined;\n resubscribe?: boolean | undefined;\n queueQoSZero?: boolean | undefined;\n rejectUnauthorized?: boolean | undefined;\n properties?: {\n sessionExpiryInterval?: number | undefined;\n receiveMaximum?: number | undefined;\n maximumPacketSize?: number | undefined;\n topicAliasMaximum?: number | undefined;\n requestResponseInformation?: boolean | undefined;\n requestProblemInformation?: boolean | undefined;\n userProperties?: {\n [x: string]: string;\n } | undefined;\n } | undefined;\n ca?: string | undefined;\n cert?: string | undefined;\n key?: string | undefined;\n servername?: string | undefined;\n } | undefined;\n output?: {\n host?: string | undefined;\n hosts?: string[] | undefined;\n servers?: {\n host: string;\n port?: number | undefined;\n protocol?: (\"mqtt\" | \"mqtts\" | \"ws\" | \"wss\" | \"tcp\" | \"ssl\") | undefined;\n }[] | undefined;\n port?: number | undefined;\n protocol?: (\"mqtt\" | \"mqtts\" | \"ws\" | \"wss\" | \"tcp\" | \"ssl\") | undefined;\n username?: string | undefined;\n password?: string | undefined;\n clientId?: string | undefined;\n clean?: boolean | undefined;\n keepalive?: number | undefined;\n connectTimeout?: number | undefined;\n reconnectPeriod?: number | undefined;\n reconnectOnConnackError?: boolean | undefined;\n resubscribe?: boolean | undefined;\n queueQoSZero?: boolean | undefined;\n rejectUnauthorized?: boolean | undefined;\n properties?: {\n sessionExpiryInterval?: number | undefined;\n receiveMaximum?: number | undefined;\n maximumPacketSize?: number | undefined;\n topicAliasMaximum?: number | undefined;\n requestResponseInformation?: boolean | undefined;\n requestProblemInformation?: boolean | undefined;\n userProperties?: {\n [x: string]: string;\n } | undefined;\n } | undefined;\n ca?: string | undefined;\n cert?: string | undefined;\n key?: string | undefined;\n servername?: string | undefined;\n /** Opt-in MQTT output persistence; does not persist input subscriptions. */\n publishQueue?: {\n mode: \"buffered\" | \"durable\";\n directory: string;\n maxRecords?: number;\n maxBytes?: number;\n memoryRecords?: number;\n memoryBytes?: number;\n maxMessageBytes?: number;\n maxDiskBytes?: number;\n minFreeBytes?: number;\n retryIntervalMs?: number;\n publishTimeoutMs?: number;\n } | undefined;\n } | undefined;\n infra: {\n host?: string | undefined;\n hosts?: string[] | undefined;\n servers?: {\n host: string;\n port?: number | undefined;\n protocol?: (\"mqtt\" | \"mqtts\" | \"ws\" | \"wss\" | \"tcp\" | \"ssl\") | undefined;\n }[] | undefined;\n port?: number | undefined;\n protocol?: (\"mqtt\" | \"mqtts\" | \"ws\" | \"wss\" | \"tcp\" | \"ssl\") | undefined;\n username?: string | undefined;\n password?: string | undefined;\n clientId?: string | undefined;\n clean?: boolean | undefined;\n keepalive?: number | undefined;\n connectTimeout?: number | undefined;\n reconnectPeriod?: number | undefined;\n reconnectOnConnackError?: boolean | undefined;\n resubscribe?: boolean | undefined;\n queueQoSZero?: boolean | undefined;\n rejectUnauthorized?: boolean | undefined;\n properties?: {\n sessionExpiryInterval?: number | undefined;\n receiveMaximum?: number | undefined;\n maximumPacketSize?: number | undefined;\n topicAliasMaximum?: number | undefined;\n requestResponseInformation?: boolean | undefined;\n requestProblemInformation?: boolean | undefined;\n userProperties?: {\n [x: string]: string;\n } | undefined;\n } | undefined;\n ca?: string | undefined;\n cert?: string | undefined;\n key?: string | undefined;\n servername?: string | undefined;\n };\n devops?: {\n provider?: \"azure-devops\";\n organization: string;\n project?: string | undefined;\n } | undefined;\n}\n\nexport interface AppConfig extends ProjectAppConfig {}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -15,4 +15,6 @@ export { UnsClient, LastValueResult, ClientError, RangeResult, BatchRangeTopicRe
|
|
|
15
15
|
export type { LastValuePayload, CatchAllTimeField, CatchAllAggregate, RangeQueryOptions, RangeColumn, RangeStats, RangePayload, BatchRangeTopicPayload, BatchRangeResponsePayload, ProviderAssetIdentity, AssetIdentityPublicationMetadata, AssetProviderIdentityPublicationMetadata, AssetIdentityPublicationEvidenceMetadata, } from "./tools/datahub/datahub-client.js";
|
|
16
16
|
export { registerService } from "./tools/datahub/runtime-service-registration.js";
|
|
17
17
|
export type { RegisterServiceOptions, RuntimeServiceDescriptor, RuntimeServiceRegistration, RuntimeServiceRegistrationClient, } from "./tools/datahub/runtime-service-registration.js";
|
|
18
|
+
export { mqttPublishQueueSchema } from "./uns-mqtt/publish-queue-contract.js";
|
|
19
|
+
export type { MqttPublishQueueOptions, MqttPublishQueueStatus } from "./uns-mqtt/publish-queue-contract.js";
|
|
18
20
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACxE,YAAY,EACV,qBAAqB,EACrB,wBAAwB,EACxB,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,4BAA4B,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,YAAY,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACzF,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACzE,YAAY,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAC9F,OAAO,EACL,SAAS,EACT,eAAe,EACf,WAAW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,MAAM,uBAAuB,CAAC;AAC9F,OAAO,EACL,SAAS,EACT,eAAe,EACf,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,UAAU,EACV,YAAY,EACZ,sBAAsB,EACtB,yBAAyB,EACzB,qBAAqB,EACrB,gCAAgC,EAChC,wCAAwC,EACxC,wCAAwC,GACzC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AAClF,YAAY,EACV,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,gCAAgC,GACjC,MAAM,iDAAiD,CAAC;AAEzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,YAAY,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -9,4 +9,5 @@ export { mqttChannelParameters, resolveMqttChannel } from "./uns-config/mqtt-cha
|
|
|
9
9
|
export { AuthClient, ServiceTokenProvider } from "./tools/auth/index.js";
|
|
10
10
|
export { UnsClient, LastValueResult, ClientError, RangeResult, BatchRangeTopicResult, BatchRangeResponse, } from "./tools/datahub/datahub-client.js";
|
|
11
11
|
export { registerService } from "./tools/datahub/runtime-service-registration.js";
|
|
12
|
+
export { mqttPublishQueueSchema } from "./uns-mqtt/publish-queue-contract.js";
|
|
12
13
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAOxE,cAAc,yBAAyB,CAAC;AAExC,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAEzF,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAEzE,OAAO,EACL,SAAS,EACT,eAAe,EACf,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,mCAAmC,CAAC;AAgB3C,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC","sourcesContent":["export { default as UnsProxyProcess } from \"./uns/uns-proxy-process.js\";\nexport type {\n UnsProxyProcessPlugin,\n UnsProxyProcessPluginApi,\n UnsProxyProcessPluginMethod,\n UnsProxyProcessPluginMethods,\n} from \"./uns/uns-proxy-process.js\";\nexport * from \"./uns/uns-interfaces.js\";\nexport type { HandoverShutdownHooks } from \"./uns/handover-shutdown.js\";\nexport * from \"./uns/service-metadata.js\";\nexport { ConfigFile } from \"./config-file.js\";\nexport { default as logger } from \"./logger.js\";\nexport { getLogger } from \"./logger.js\";\nexport { resolveInfisicalConfig } from \"./uns-config/secret-resolver.js\";\nexport { mqttChannelParameters, resolveMqttChannel } from \"./uns-config/mqtt-channel.js\";\nexport type { MqttChannelConfig, ResolvedMqttChannel } from \"./uns-config/mqtt-channel.js\";\nexport { AuthClient, ServiceTokenProvider } from \"./tools/auth/index.js\";\nexport type { AccessTokenProvider, ServiceTokenProviderOptions } from \"./tools/auth/index.js\";\nexport {\n UnsClient,\n LastValueResult,\n ClientError,\n RangeResult,\n BatchRangeTopicResult,\n BatchRangeResponse,\n} from \"./tools/datahub/datahub-client.js\";\nexport type {\n LastValuePayload,\n CatchAllTimeField,\n CatchAllAggregate,\n RangeQueryOptions,\n RangeColumn,\n RangeStats,\n RangePayload,\n BatchRangeTopicPayload,\n BatchRangeResponsePayload,\n ProviderAssetIdentity,\n AssetIdentityPublicationMetadata,\n AssetProviderIdentityPublicationMetadata,\n AssetIdentityPublicationEvidenceMetadata,\n} from \"./tools/datahub/datahub-client.js\";\nexport { registerService } from \"./tools/datahub/runtime-service-registration.js\";\nexport type {\n RegisterServiceOptions,\n RuntimeServiceDescriptor,\n RuntimeServiceRegistration,\n RuntimeServiceRegistrationClient,\n} from \"./tools/datahub/runtime-service-registration.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAOxE,cAAc,yBAAyB,CAAC;AAExC,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAEzF,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAEzE,OAAO,EACL,SAAS,EACT,eAAe,EACf,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,mCAAmC,CAAC;AAgB3C,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AAQlF,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC","sourcesContent":["export { default as UnsProxyProcess } from \"./uns/uns-proxy-process.js\";\nexport type {\n UnsProxyProcessPlugin,\n UnsProxyProcessPluginApi,\n UnsProxyProcessPluginMethod,\n UnsProxyProcessPluginMethods,\n} from \"./uns/uns-proxy-process.js\";\nexport * from \"./uns/uns-interfaces.js\";\nexport type { HandoverShutdownHooks } from \"./uns/handover-shutdown.js\";\nexport * from \"./uns/service-metadata.js\";\nexport { ConfigFile } from \"./config-file.js\";\nexport { default as logger } from \"./logger.js\";\nexport { getLogger } from \"./logger.js\";\nexport { resolveInfisicalConfig } from \"./uns-config/secret-resolver.js\";\nexport { mqttChannelParameters, resolveMqttChannel } from \"./uns-config/mqtt-channel.js\";\nexport type { MqttChannelConfig, ResolvedMqttChannel } from \"./uns-config/mqtt-channel.js\";\nexport { AuthClient, ServiceTokenProvider } from \"./tools/auth/index.js\";\nexport type { AccessTokenProvider, ServiceTokenProviderOptions } from \"./tools/auth/index.js\";\nexport {\n UnsClient,\n LastValueResult,\n ClientError,\n RangeResult,\n BatchRangeTopicResult,\n BatchRangeResponse,\n} from \"./tools/datahub/datahub-client.js\";\nexport type {\n LastValuePayload,\n CatchAllTimeField,\n CatchAllAggregate,\n RangeQueryOptions,\n RangeColumn,\n RangeStats,\n RangePayload,\n BatchRangeTopicPayload,\n BatchRangeResponsePayload,\n ProviderAssetIdentity,\n AssetIdentityPublicationMetadata,\n AssetProviderIdentityPublicationMetadata,\n AssetIdentityPublicationEvidenceMetadata,\n} from \"./tools/datahub/datahub-client.js\";\nexport { registerService } from \"./tools/datahub/runtime-service-registration.js\";\nexport type {\n RegisterServiceOptions,\n RuntimeServiceDescriptor,\n RuntimeServiceRegistration,\n RuntimeServiceRegistrationClient,\n} from \"./tools/datahub/runtime-service-registration.js\";\n\nexport { mqttPublishQueueSchema } from \"./uns-mqtt/publish-queue-contract.js\";\nexport type { MqttPublishQueueOptions, MqttPublishQueueStatus } from \"./uns-mqtt/publish-queue-contract.js\";\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { ProcessGroupAuthorizationContext } from "./process-group-authorization.js";
|
|
3
|
+
export declare const configurationGroupAuthorizationSchema: z.ZodObject<{
|
|
4
|
+
schemaVersion: z.ZodLiteral<4>;
|
|
5
|
+
kind: z.ZodLiteral<"uns-process-group-runtime-authorization">;
|
|
6
|
+
protocolVersion: z.ZodLiteral<2>;
|
|
7
|
+
packageName: z.ZodString;
|
|
8
|
+
namespace: z.ZodString;
|
|
9
|
+
groupId: z.ZodString;
|
|
10
|
+
generationId: z.ZodString;
|
|
11
|
+
descriptorSha256: z.ZodString;
|
|
12
|
+
controllerName: z.ZodString;
|
|
13
|
+
packageRoot: z.ZodString;
|
|
14
|
+
artifactSha256: z.ZodString;
|
|
15
|
+
groupSha256: z.ZodString;
|
|
16
|
+
channelsSha256: z.ZodString;
|
|
17
|
+
stateRoot: z.ZodString;
|
|
18
|
+
directory: z.ZodString;
|
|
19
|
+
journalId: z.ZodNullable<z.ZodString>;
|
|
20
|
+
placements: z.ZodArray<z.ZodObject<{
|
|
21
|
+
instanceId: z.ZodString;
|
|
22
|
+
processName: z.ZodString;
|
|
23
|
+
role: z.ZodEnum<{
|
|
24
|
+
source: "source";
|
|
25
|
+
target: "target";
|
|
26
|
+
receiver: "receiver";
|
|
27
|
+
}>;
|
|
28
|
+
configurationSha256: z.ZodString;
|
|
29
|
+
}, z.core.$strict>>;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
export type ConfigurationGroupAuthorizationPolicy = z.infer<typeof configurationGroupAuthorizationSchema>;
|
|
32
|
+
/** Canonical policy selection uses the reviewed generation, not an app-selected policy path. */
|
|
33
|
+
export declare function configurationGroupPolicyIdentity(packageRoot: string, raw: Record<string, unknown>): {
|
|
34
|
+
namespace: string;
|
|
35
|
+
generationId: string;
|
|
36
|
+
} | undefined;
|
|
37
|
+
/** Data-only verifier. Its result alone is not runtime authority; the common issuer owns that boundary. */
|
|
38
|
+
export declare function verifyConfigurationGroupPolicy(context: ProcessGroupAuthorizationContext, bytes: Buffer, root: string, file: string): Readonly<{
|
|
39
|
+
sha256: string;
|
|
40
|
+
file: string;
|
|
41
|
+
directory: string;
|
|
42
|
+
journalId: string;
|
|
43
|
+
role: "source" | "target" | "receiver";
|
|
44
|
+
groupId: string;
|
|
45
|
+
groupProcessName: string;
|
|
46
|
+
namespace: string;
|
|
47
|
+
generationId: string;
|
|
48
|
+
configurationGroupSha256: string;
|
|
49
|
+
}>;
|
|
50
|
+
//# sourceMappingURL=configuration-group-authorization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration-group-authorization.d.ts","sourceRoot":"","sources":["../../src/runtime/configuration-group-authorization.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,kCAAkC,CAAC;AAgBzF,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA4BhD,CAAC;AACH,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAE1G,gGAAgG;AAChG,wBAAgB,gCAAgC,CAC9C,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAE1B;IACE,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB,GACD,SAAS,CAMZ;AAED,2GAA2G;AAC3G,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,gCAAgC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;;;;;;;;;;;GAsElI"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { configurationGroupJournalSchema, configurationResourceHash, selectedConfigurationGroup } from "./configuration-group-contract.js";
|
|
4
|
+
import { readConfigurationSelector } from "./process-group-contract.js";
|
|
5
|
+
import { assertPrivateProcessGroupDirectory, groupArtifactHash, groupChannelsHash, readProcessGroupResource, sha256, } from "./process-group-resources.js";
|
|
6
|
+
const digest = z.string().regex(/^[a-f0-9]{64}$/), identity = z.string().regex(/^[a-z][a-z0-9-]{0,99}$/);
|
|
7
|
+
const absolute = z
|
|
8
|
+
.string()
|
|
9
|
+
.max(512)
|
|
10
|
+
.refine((v) => path.isAbsolute(v) && path.resolve(v) === v);
|
|
11
|
+
export const configurationGroupAuthorizationSchema = z.strictObject({
|
|
12
|
+
schemaVersion: z.literal(4),
|
|
13
|
+
kind: z.literal("uns-process-group-runtime-authorization"),
|
|
14
|
+
protocolVersion: z.literal(2),
|
|
15
|
+
packageName: z.string().min(1).max(214),
|
|
16
|
+
namespace: identity,
|
|
17
|
+
groupId: identity,
|
|
18
|
+
generationId: identity,
|
|
19
|
+
descriptorSha256: digest,
|
|
20
|
+
controllerName: z.string().min(1).max(100),
|
|
21
|
+
packageRoot: absolute,
|
|
22
|
+
artifactSha256: digest,
|
|
23
|
+
groupSha256: digest,
|
|
24
|
+
channelsSha256: digest,
|
|
25
|
+
stateRoot: absolute,
|
|
26
|
+
directory: absolute,
|
|
27
|
+
journalId: z.string().uuid().nullable(),
|
|
28
|
+
placements: z
|
|
29
|
+
.array(z.strictObject({
|
|
30
|
+
instanceId: z.string().regex(/^[a-zA-Z0-9-]{1,100}$/),
|
|
31
|
+
processName: identity,
|
|
32
|
+
role: z.enum(["source", "target", "receiver"]),
|
|
33
|
+
configurationSha256: digest,
|
|
34
|
+
}))
|
|
35
|
+
.min(4)
|
|
36
|
+
.max(18),
|
|
37
|
+
});
|
|
38
|
+
/** Canonical policy selection uses the reviewed generation, not an app-selected policy path. */
|
|
39
|
+
export function configurationGroupPolicyIdentity(packageRoot, raw) {
|
|
40
|
+
const selected = selectedConfigurationGroup(packageRoot, raw);
|
|
41
|
+
if (!selected)
|
|
42
|
+
return undefined;
|
|
43
|
+
const journal = configurationGroupJournalSchema.parse(readConfigurationSelector(raw, selected.descriptor.journalPath));
|
|
44
|
+
if (journal.groupSha256 !== selected.snapshot.sha256)
|
|
45
|
+
throw Error("Configuration group journal differs from the selected revision");
|
|
46
|
+
return { namespace: selected.descriptor.namespace, generationId: journal.generationId };
|
|
47
|
+
}
|
|
48
|
+
/** Data-only verifier. Its result alone is not runtime authority; the common issuer owns that boundary. */
|
|
49
|
+
export function verifyConfigurationGroupPolicy(context, bytes, root, file) {
|
|
50
|
+
const p = configurationGroupAuthorizationSchema.parse(JSON.parse(bytes.toString()));
|
|
51
|
+
const selected = selectedConfigurationGroup(context.packageRoot, context.rawConfiguration);
|
|
52
|
+
if (!selected)
|
|
53
|
+
throw Error("Configuration group capability required");
|
|
54
|
+
const { descriptor: d, snapshot } = selected, group = snapshot.group;
|
|
55
|
+
const pkg = JSON.parse(readProcessGroupResource(path.join(context.packageRoot, "package.json")).toString());
|
|
56
|
+
const declaration = pkg.unsDatahub?.processGroupConfigurationRuntime;
|
|
57
|
+
if (p.packageName !== pkg.name ||
|
|
58
|
+
p.namespace !== d.namespace ||
|
|
59
|
+
p.descriptorSha256 !== configurationResourceHash(declaration) ||
|
|
60
|
+
p.packageRoot !== context.packageRoot ||
|
|
61
|
+
p.controllerName !== context.controllerName ||
|
|
62
|
+
p.stateRoot !== root ||
|
|
63
|
+
p.groupId !== group.id ||
|
|
64
|
+
p.groupSha256 !== snapshot.sha256 ||
|
|
65
|
+
file !== path.join(root, d.namespace, "authorizations", p.generationId + ".json") ||
|
|
66
|
+
p.directory !== path.join(root, d.namespace, "admission", p.generationId))
|
|
67
|
+
throw Error("Reviewed configuration group placement differs");
|
|
68
|
+
assertPrivateProcessGroupDirectory(root);
|
|
69
|
+
assertPrivateProcessGroupDirectory(path.dirname(file));
|
|
70
|
+
if (groupArtifactHash(context.packageRoot) !== p.artifactSha256 || groupChannelsHash(context.channels) !== p.channelsSha256)
|
|
71
|
+
throw Error("Reviewed artifact or channels differ");
|
|
72
|
+
const expected = new Map([
|
|
73
|
+
...group.profiles.map((member) => [member.processName, "source"]),
|
|
74
|
+
[group.processName, "target"],
|
|
75
|
+
[group.receiverProcessName, "receiver"],
|
|
76
|
+
]);
|
|
77
|
+
if (p.placements.length !== expected.size ||
|
|
78
|
+
new Set(p.placements.map((x) => x.instanceId)).size !== expected.size ||
|
|
79
|
+
new Set(p.placements.map((x) => x.processName)).size !== expected.size ||
|
|
80
|
+
p.placements.some((x) => expected.get(x.processName) !== x.role))
|
|
81
|
+
throw Error("Reviewed process roles differ");
|
|
82
|
+
const entry = p.placements.find((x) => context.instanceDirectory === path.join(context.packageRoot, "instances", x.instanceId));
|
|
83
|
+
const raw = context.rawConfiguration, uns = raw["uns"];
|
|
84
|
+
const journal = configurationGroupJournalSchema.parse(readConfigurationSelector(raw, d.journalPath));
|
|
85
|
+
const role = readConfigurationSelector(raw, d.runtimeRolePath), memberId = readConfigurationSelector(raw, d.memberPath);
|
|
86
|
+
if (!entry ||
|
|
87
|
+
entry.processName !== uns?.["processName"] ||
|
|
88
|
+
entry.configurationSha256 !== configurationResourceHash(raw) ||
|
|
89
|
+
journal.directory !== p.directory ||
|
|
90
|
+
journal.generationId !== p.generationId ||
|
|
91
|
+
journal.groupSha256 !== p.groupSha256 ||
|
|
92
|
+
(journal.journalId ?? null) !== p.journalId)
|
|
93
|
+
throw Error("Reviewed configuration or journal differs");
|
|
94
|
+
if (context.initialize ? p.journalId !== null || entry.role !== "receiver" : p.journalId === null)
|
|
95
|
+
throw Error("Only a reviewed unbound receiver can initialize");
|
|
96
|
+
if (entry.role === "receiver" ? role !== d.receiverRole : role !== undefined && role !== "publisher")
|
|
97
|
+
throw Error("Reviewed runtime role differs");
|
|
98
|
+
if (entry.role === "source" ? !group.profiles.some((x) => x.id === memberId && x.processName === entry.processName) : memberId !== undefined)
|
|
99
|
+
throw Error("Reviewed member selection differs");
|
|
100
|
+
return Object.freeze({
|
|
101
|
+
sha256: sha256(bytes),
|
|
102
|
+
file,
|
|
103
|
+
directory: p.directory,
|
|
104
|
+
journalId: p.journalId,
|
|
105
|
+
role: entry.role,
|
|
106
|
+
groupId: p.groupId,
|
|
107
|
+
groupProcessName: group.processName,
|
|
108
|
+
namespace: d.namespace,
|
|
109
|
+
generationId: p.generationId,
|
|
110
|
+
configurationGroupSha256: p.groupSha256,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=configuration-group-authorization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration-group-authorization.js","sourceRoot":"","sources":["../../src/runtime/configuration-group-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,+BAA+B,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAE3I,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EACL,kCAAkC,EAClC,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EACxB,MAAM,GACP,MAAM,8BAA8B,CAAC;AAEtC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAC/C,QAAQ,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;AACxD,MAAM,QAAQ,GAAG,CAAC;KACf,MAAM,EAAE;KACR,GAAG,CAAC,GAAG,CAAC;KACR,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9D,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC,YAAY,CAAC;IAClE,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3B,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,yCAAyC,CAAC;I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WAAW;KACxC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import path from \"node:path\";\nimport { z } from \"zod\";\n\nimport { configurationGroupJournalSchema, configurationResourceHash, selectedConfigurationGroup } from \"./configuration-group-contract.js\";\nimport type { ProcessGroupAuthorizationContext } from \"./process-group-authorization.js\";\nimport { readConfigurationSelector } from \"./process-group-contract.js\";\nimport {\n assertPrivateProcessGroupDirectory,\n groupArtifactHash,\n groupChannelsHash,\n readProcessGroupResource,\n sha256,\n} from \"./process-group-resources.js\";\n\nconst digest = z.string().regex(/^[a-f0-9]{64}$/),\n identity = z.string().regex(/^[a-z][a-z0-9-]{0,99}$/);\nconst absolute = z\n .string()\n .max(512)\n .refine((v) => path.isAbsolute(v) && path.resolve(v) === v);\nexport const configurationGroupAuthorizationSchema = z.strictObject({\n schemaVersion: z.literal(4),\n kind: z.literal(\"uns-process-group-runtime-authorization\"),\n protocolVersion: z.literal(2),\n packageName: z.string().min(1).max(214),\n namespace: identity,\n groupId: identity,\n generationId: identity,\n descriptorSha256: digest,\n controllerName: z.string().min(1).max(100),\n packageRoot: absolute,\n artifactSha256: digest,\n groupSha256: digest,\n channelsSha256: digest,\n stateRoot: absolute,\n directory: absolute,\n journalId: z.string().uuid().nullable(),\n placements: z\n .array(\n z.strictObject({\n instanceId: z.string().regex(/^[a-zA-Z0-9-]{1,100}$/),\n processName: identity,\n role: z.enum([\"source\", \"target\", \"receiver\"]),\n configurationSha256: digest,\n }),\n )\n .min(4)\n .max(18),\n});\nexport type ConfigurationGroupAuthorizationPolicy = z.infer<typeof configurationGroupAuthorizationSchema>;\n\n/** Canonical policy selection uses the reviewed generation, not an app-selected policy path. */\nexport function configurationGroupPolicyIdentity(\n packageRoot: string,\n raw: Record<string, unknown>,\n):\n | {\n namespace: string;\n generationId: string;\n }\n | undefined {\n const selected = selectedConfigurationGroup(packageRoot, raw);\n if (!selected) return undefined;\n const journal = configurationGroupJournalSchema.parse(readConfigurationSelector(raw, selected.descriptor.journalPath));\n if (journal.groupSha256 !== selected.snapshot.sha256) throw Error(\"Configuration group journal differs from the selected revision\");\n return { namespace: selected.descriptor.namespace, generationId: journal.generationId };\n}\n\n/** Data-only verifier. Its result alone is not runtime authority; the common issuer owns that boundary. */\nexport function verifyConfigurationGroupPolicy(context: ProcessGroupAuthorizationContext, bytes: Buffer, root: string, file: string) {\n const p = configurationGroupAuthorizationSchema.parse(JSON.parse(bytes.toString()));\n const selected = selectedConfigurationGroup(context.packageRoot, context.rawConfiguration);\n if (!selected) throw Error(\"Configuration group capability required\");\n const { descriptor: d, snapshot } = selected,\n group = snapshot.group;\n const pkg = JSON.parse(readProcessGroupResource(path.join(context.packageRoot, \"package.json\")).toString());\n const declaration = pkg.unsDatahub?.processGroupConfigurationRuntime;\n if (\n p.packageName !== pkg.name ||\n p.namespace !== d.namespace ||\n p.descriptorSha256 !== configurationResourceHash(declaration) ||\n p.packageRoot !== context.packageRoot ||\n p.controllerName !== context.controllerName ||\n p.stateRoot !== root ||\n p.groupId !== group.id ||\n p.groupSha256 !== snapshot.sha256 ||\n file !== path.join(root, d.namespace, \"authorizations\", p.generationId + \".json\") ||\n p.directory !== path.join(root, d.namespace, \"admission\", p.generationId)\n )\n throw Error(\"Reviewed configuration group placement differs\");\n assertPrivateProcessGroupDirectory(root);\n assertPrivateProcessGroupDirectory(path.dirname(file));\n if (groupArtifactHash(context.packageRoot) !== p.artifactSha256 || groupChannelsHash(context.channels) !== p.channelsSha256)\n throw Error(\"Reviewed artifact or channels differ\");\n const expected = new Map([\n ...group.profiles.map((member) => [member.processName, \"source\"] as const),\n [group.processName, \"target\"] as const,\n [group.receiverProcessName, \"receiver\"] as const,\n ]);\n if (\n p.placements.length !== expected.size ||\n new Set(p.placements.map((x) => x.instanceId)).size !== expected.size ||\n new Set(p.placements.map((x) => x.processName)).size !== expected.size ||\n p.placements.some((x) => expected.get(x.processName) !== x.role)\n )\n throw Error(\"Reviewed process roles differ\");\n const entry = p.placements.find((x) => context.instanceDirectory === path.join(context.packageRoot, \"instances\", x.instanceId));\n const raw = context.rawConfiguration,\n uns = raw[\"uns\"] as Record<string, unknown> | undefined;\n const journal = configurationGroupJournalSchema.parse(readConfigurationSelector(raw, d.journalPath));\n const role = readConfigurationSelector(raw, d.runtimeRolePath),\n memberId = readConfigurationSelector(raw, d.memberPath);\n if (\n !entry ||\n entry.processName !== uns?.[\"processName\"] ||\n entry.configurationSha256 !== configurationResourceHash(raw) ||\n journal.directory !== p.directory ||\n journal.generationId !== p.generationId ||\n journal.groupSha256 !== p.groupSha256 ||\n (journal.journalId ?? null) !== p.journalId\n )\n throw Error(\"Reviewed configuration or journal differs\");\n if (context.initialize ? p.journalId !== null || entry.role !== \"receiver\" : p.journalId === null)\n throw Error(\"Only a reviewed unbound receiver can initialize\");\n if (entry.role === \"receiver\" ? role !== d.receiverRole : role !== undefined && role !== \"publisher\") throw Error(\"Reviewed runtime role differs\");\n if (entry.role === \"source\" ? !group.profiles.some((x) => x.id === memberId && x.processName === entry.processName) : memberId !== undefined)\n throw Error(\"Reviewed member selection differs\");\n return Object.freeze({\n sha256: sha256(bytes),\n file,\n directory: p.directory,\n journalId: p.journalId,\n role: entry.role,\n groupId: p.groupId,\n groupProcessName: group.processName,\n namespace: d.namespace,\n generationId: p.generationId,\n configurationGroupSha256: p.groupSha256,\n });\n}\n"]}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Versioned canonical JSON: binary key order, no locale, executable values or accessors. */
|
|
3
|
+
export declare function configurationResourceJson(value: unknown): string;
|
|
4
|
+
export declare function configurationResourceHash(value: unknown): string;
|
|
5
|
+
export declare const configurationGroupProfileSchema: z.ZodObject<{
|
|
6
|
+
id: z.ZodString;
|
|
7
|
+
processName: z.ZodString;
|
|
8
|
+
dataGroup: z.ZodString;
|
|
9
|
+
resource: z.ZodUnknown;
|
|
10
|
+
}, z.core.$strict>;
|
|
11
|
+
export declare const configurationGroupSchema: z.ZodObject<{
|
|
12
|
+
schemaVersion: z.ZodLiteral<2>;
|
|
13
|
+
id: z.ZodString;
|
|
14
|
+
inputTopic: z.ZodString;
|
|
15
|
+
processName: z.ZodString;
|
|
16
|
+
receiverProcessName: z.ZodString;
|
|
17
|
+
profiles: z.ZodArray<z.ZodObject<{
|
|
18
|
+
id: z.ZodString;
|
|
19
|
+
processName: z.ZodString;
|
|
20
|
+
dataGroup: z.ZodString;
|
|
21
|
+
resource: z.ZodUnknown;
|
|
22
|
+
}, z.core.$strict>>;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
export declare const configurationGroupDescriptorSchema: z.ZodObject<{
|
|
25
|
+
protocolVersion: z.ZodLiteral<2>;
|
|
26
|
+
namespace: z.ZodString;
|
|
27
|
+
publisherPath: z.ZodArray<z.ZodString>;
|
|
28
|
+
groupPath: z.ZodArray<z.ZodString>;
|
|
29
|
+
memberPath: z.ZodArray<z.ZodString>;
|
|
30
|
+
journalPath: z.ZodArray<z.ZodString>;
|
|
31
|
+
runtimeRolePath: z.ZodArray<z.ZodString>;
|
|
32
|
+
receiverRole: z.ZodString;
|
|
33
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
34
|
+
path: z.ZodArray<z.ZodString>;
|
|
35
|
+
value: z.ZodString;
|
|
36
|
+
}, z.core.$strict>>;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
export type ConfigurationGroupDescriptor = z.infer<typeof configurationGroupDescriptorSchema>;
|
|
39
|
+
export type ConfigurationGroup = z.infer<typeof configurationGroupSchema>;
|
|
40
|
+
export interface ConfigurationGroupProfile {
|
|
41
|
+
readonly id: string;
|
|
42
|
+
readonly processName: string;
|
|
43
|
+
readonly dataGroup: string;
|
|
44
|
+
readonly resourceSha256: string;
|
|
45
|
+
readonly resource: unknown;
|
|
46
|
+
}
|
|
47
|
+
export interface ConfigurationGroupSnapshot {
|
|
48
|
+
readonly group: Readonly<ConfigurationGroup>;
|
|
49
|
+
readonly sha256: string;
|
|
50
|
+
readonly profiles: readonly ConfigurationGroupProfile[];
|
|
51
|
+
}
|
|
52
|
+
export declare function configurationGroupSnapshot(value: unknown): ConfigurationGroupSnapshot;
|
|
53
|
+
export declare function assertConfigurationGroupSnapshot(value: ConfigurationGroupSnapshot): void;
|
|
54
|
+
/** Optional data-only capability; packages without it keep their existing behavior. */
|
|
55
|
+
export declare function configurationGroupDescriptor(packageRoot: string): ConfigurationGroupDescriptor | undefined;
|
|
56
|
+
export declare function selectedConfigurationGroup(packageRoot: string, raw: Record<string, unknown>): {
|
|
57
|
+
descriptor: ConfigurationGroupDescriptor;
|
|
58
|
+
snapshot: ConfigurationGroupSnapshot;
|
|
59
|
+
} | undefined;
|
|
60
|
+
export declare const configurationGroupJournalSchema: z.ZodObject<{
|
|
61
|
+
directory: z.ZodString;
|
|
62
|
+
journalId: z.ZodOptional<z.ZodString>;
|
|
63
|
+
generationId: z.ZodString;
|
|
64
|
+
groupSha256: z.ZodString;
|
|
65
|
+
minFreeBytes: z.ZodDefault<z.ZodNumber>;
|
|
66
|
+
maxRecords: z.ZodDefault<z.ZodNumber>;
|
|
67
|
+
maxBytes: z.ZodDefault<z.ZodNumber>;
|
|
68
|
+
}, z.core.$strict>;
|
|
69
|
+
export type ConfigurationGroupJournal = z.infer<typeof configurationGroupJournalSchema>;
|
|
70
|
+
export declare function configurationGroupJournalContract(snapshot: ConfigurationGroupSnapshot, sourceIdentity: string, config: ConfigurationGroupJournal, profiles: readonly {
|
|
71
|
+
processName: string;
|
|
72
|
+
resourceSha256: string;
|
|
73
|
+
dataGroup: string;
|
|
74
|
+
}[]): string;
|
|
75
|
+
//# sourceMappingURL=configuration-group-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration-group-contract.d.ts","sourceRoot":"","sources":["../../src/runtime/configuration-group-contract.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,6FAA6F;AAC7F,wBAAgB,yBAAyB,CAAC,KAAK,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