@spine-event-engine/deployment 2.0.0-snapshot.2
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/LICENSE +201 -0
- package/README.md +55 -0
- package/REFERENCE.md +62 -0
- package/dist/discovery/application-node.d.ts +34 -0
- package/dist/discovery/application-node.d.ts.map +1 -0
- package/dist/discovery/application-node.js +80 -0
- package/dist/discovery/application-node.js.map +1 -0
- package/dist/discovery/scheduled-discovery-log.d.ts +9 -0
- package/dist/discovery/scheduled-discovery-log.d.ts.map +1 -0
- package/dist/discovery/scheduled-discovery-log.js +42 -0
- package/dist/discovery/scheduled-discovery-log.js.map +1 -0
- package/dist/index.d.ts +119 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +157 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/backend-membership-kernel.d.ts +176 -0
- package/dist/internal/backend-membership-kernel.d.ts.map +1 -0
- package/dist/internal/backend-membership-kernel.js +614 -0
- package/dist/internal/backend-membership-kernel.js.map +1 -0
- package/dist/registry/leased-node-registry.d.ts +118 -0
- package/dist/registry/leased-node-registry.d.ts.map +1 -0
- package/dist/registry/leased-node-registry.js +333 -0
- package/dist/registry/leased-node-registry.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +43 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, CodeMatters. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
|
5
|
+
* in compliance with the License. You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
|
10
|
+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
|
11
|
+
* or implied. See the License for the specific language governing permissions and limitations under
|
|
12
|
+
* the License.
|
|
13
|
+
*/
|
|
14
|
+
/* eslint-disable @typescript-eslint/no-unnecessary-condition, @typescript-eslint/require-await */
|
|
15
|
+
import { ApplicationNode } from "./discovery/application-node.js";
|
|
16
|
+
import { scheduledDiscoveryLog } from "./discovery/scheduled-discovery-log.js";
|
|
17
|
+
export { ApplicationNode } from "./discovery/application-node.js";
|
|
18
|
+
export { LeasedNodeRegistry, } from "./registry/leased-node-registry.js";
|
|
19
|
+
const systemNodeScheduler = {
|
|
20
|
+
schedule(delayMs, onTick) {
|
|
21
|
+
const timer = setTimeout(onTick, delayMs);
|
|
22
|
+
timer.unref();
|
|
23
|
+
return () => {
|
|
24
|
+
clearTimeout(timer);
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Publishes complete snapshots on an injected, cancellable schedule.
|
|
30
|
+
*/
|
|
31
|
+
export class ScheduledNodeDiscovery {
|
|
32
|
+
#reader;
|
|
33
|
+
#scheduler;
|
|
34
|
+
#intervalMs;
|
|
35
|
+
#logger;
|
|
36
|
+
#cancel;
|
|
37
|
+
#controller;
|
|
38
|
+
#watcher;
|
|
39
|
+
#refreshing;
|
|
40
|
+
#closed = false;
|
|
41
|
+
/**
|
|
42
|
+
* Creates a scheduled source with a ten-second default refresh interval.
|
|
43
|
+
*
|
|
44
|
+
* @param options Supplies the snapshot reader, optional scheduler, and interval.
|
|
45
|
+
*/
|
|
46
|
+
constructor(options) {
|
|
47
|
+
if (options.intervalMs !== undefined &&
|
|
48
|
+
(!Number.isSafeInteger(options.intervalMs) || options.intervalMs < 1))
|
|
49
|
+
throw new RangeError("Node refresh interval must be a positive safe integer.");
|
|
50
|
+
this.#reader = options.reader;
|
|
51
|
+
this.#scheduler = options.scheduler ?? systemNodeScheduler;
|
|
52
|
+
this.#intervalMs = options.intervalMs ?? 10_000;
|
|
53
|
+
this.#logger = options.logger;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Starts the only scheduled complete-snapshot watch.
|
|
57
|
+
*
|
|
58
|
+
* A second active watch or a watch after `close()` is rejected.
|
|
59
|
+
*
|
|
60
|
+
* @param onSnapshot Receives each successful complete snapshot.
|
|
61
|
+
* @returns Stops scheduling and cancels an in-flight read.
|
|
62
|
+
*/
|
|
63
|
+
watch(onSnapshot) {
|
|
64
|
+
if (this.#closed)
|
|
65
|
+
throw new Error("Node discovery is closed.");
|
|
66
|
+
if (this.#watcher !== undefined)
|
|
67
|
+
throw new Error("Node discovery supports one active watch.");
|
|
68
|
+
this.#watcher = onSnapshot;
|
|
69
|
+
this.#schedule(0);
|
|
70
|
+
return () => this.close();
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Stops scheduled refresh work permanently.
|
|
74
|
+
*
|
|
75
|
+
* This operation is idempotent, cancels scheduling, and joins the active
|
|
76
|
+
* snapshot read after requesting its cancellation.
|
|
77
|
+
*
|
|
78
|
+
* @returns Completes after the active read settles.
|
|
79
|
+
*/
|
|
80
|
+
async close() {
|
|
81
|
+
if (this.#closed)
|
|
82
|
+
return;
|
|
83
|
+
this.#closed = true;
|
|
84
|
+
this.#cancel?.();
|
|
85
|
+
this.#controller?.abort();
|
|
86
|
+
this.#watcher = undefined;
|
|
87
|
+
await this.#refreshing;
|
|
88
|
+
}
|
|
89
|
+
#schedule(delayMs) {
|
|
90
|
+
this.#cancel = this.#scheduler.schedule(delayMs, () => {
|
|
91
|
+
// spine-log-boundary: deployment.scheduled_discovery_refresh_tail
|
|
92
|
+
this.#refreshing = this.#refresh().catch(() => undefined);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
async #refresh() {
|
|
96
|
+
if (this.#closed)
|
|
97
|
+
return;
|
|
98
|
+
const controller = new AbortController();
|
|
99
|
+
this.#controller = controller;
|
|
100
|
+
try {
|
|
101
|
+
const nodes = await this.#reader.read(controller.signal);
|
|
102
|
+
if (!this.#closed)
|
|
103
|
+
this.#watcher?.([...nodes]);
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
if (this.#closed || controller.signal.aborted)
|
|
107
|
+
return;
|
|
108
|
+
// spine-log-boundary: deployment.scheduled_discovery_refresh
|
|
109
|
+
scheduledDiscoveryLog.warn(this.#logger);
|
|
110
|
+
// Retain the last successful snapshot and retry at the configured interval.
|
|
111
|
+
}
|
|
112
|
+
finally {
|
|
113
|
+
this.#controller = undefined;
|
|
114
|
+
if (!this.#closed)
|
|
115
|
+
this.#schedule(this.#intervalMs);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Publishes mutable static membership for local and combined deployments.
|
|
121
|
+
*/
|
|
122
|
+
export class StaticNodeDiscovery {
|
|
123
|
+
#nodes;
|
|
124
|
+
#watchers = new Set();
|
|
125
|
+
/**
|
|
126
|
+
* Creates a source with an initial complete static node set.
|
|
127
|
+
*
|
|
128
|
+
* @param nodes Supplies the initial complete static node set.
|
|
129
|
+
*/
|
|
130
|
+
constructor(nodes) {
|
|
131
|
+
this.#nodes = [...nodes];
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Publishes a replacement complete node set.
|
|
135
|
+
*
|
|
136
|
+
* @param nodes Supplies replacement membership.
|
|
137
|
+
*/
|
|
138
|
+
replace(nodes) {
|
|
139
|
+
this.#nodes = [...nodes];
|
|
140
|
+
for (const onSnapshot of this.#watchers)
|
|
141
|
+
onSnapshot([...this.#nodes]);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Starts delivery of current and subsequent complete snapshots.
|
|
145
|
+
*
|
|
146
|
+
* @param onSnapshot Receives the current and subsequent complete snapshots.
|
|
147
|
+
* @returns An operation that removes this snapshot receiver.
|
|
148
|
+
*/
|
|
149
|
+
watch(onSnapshot) {
|
|
150
|
+
this.#watchers.add(onSnapshot);
|
|
151
|
+
onSnapshot([...this.#nodes]);
|
|
152
|
+
return async () => {
|
|
153
|
+
this.#watchers.delete(onSnapshot);
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,kGAAkG;AAElG,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAG/E,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EACL,kBAAkB,GAGnB,MAAM,oCAAoC,CAAC;AA8E5C,MAAM,mBAAmB,GAAkB;IACzC,QAAQ,CAAC,OAAO,EAAE,MAAM;QACtB,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC1C,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC,CAAC;IACJ,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,OAAO,sBAAsB;IACxB,OAAO,CAAqB;IAC5B,UAAU,CAAgB;IAC1B,WAAW,CAAS;IACpB,OAAO,CAAwB;IACxC,OAAO,CAA2B;IAClC,WAAW,CAA8B;IACzC,QAAQ,CAA4D;IACpE,WAAW,CAA4B;IACvC,OAAO,GAAG,KAAK,CAAC;IAEhB;;;;OAIG;IACH,YAAY,OAAsC;QAChD,IACE,OAAO,CAAC,UAAU,KAAK,SAAS;YAChC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,UAAU,GAAG,CAAC,CAAC;YAErE,MAAM,IAAI,UAAU,CAAC,wDAAwD,CAAC,CAAC;QACjF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;QAC9B,IAAI,CA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CAAC;QAC/B,UAAU,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAC7B,OAAO,KAAK,IAAI,EAAE;YAChB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACpC,CAAC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Performs backend operations for one member managed by the internal kernel.
|
|
3
|
+
*/
|
|
4
|
+
export interface BackendMemberClient<Request, Child, Update> {
|
|
5
|
+
/**
|
|
6
|
+
* Returns one unary response from the member.
|
|
7
|
+
*
|
|
8
|
+
* @param request Supplies the request to forward.
|
|
9
|
+
* @returns The backend response bytes.
|
|
10
|
+
*/
|
|
11
|
+
forward(request: Request): Promise<Uint8Array>;
|
|
12
|
+
/**
|
|
13
|
+
* Creates the member's child subscription for one logical definition.
|
|
14
|
+
*
|
|
15
|
+
* @param definition Supplies the member-specific subscription definition.
|
|
16
|
+
* @param signal Cancels child creation.
|
|
17
|
+
* @returns The created child subscription.
|
|
18
|
+
*/
|
|
19
|
+
subscribe(definition: Uint8Array, signal: AbortSignal): Promise<Child>;
|
|
20
|
+
/**
|
|
21
|
+
* Delivers updates from an active child subscription.
|
|
22
|
+
*
|
|
23
|
+
* @param child Supplies the child subscription to activate.
|
|
24
|
+
* @param updates Receives relayed child updates.
|
|
25
|
+
* @param signal Cancels update relay.
|
|
26
|
+
* @returns Completion of the child activation.
|
|
27
|
+
*/
|
|
28
|
+
activate(child: Child, updates: (update: Update) => Promise<void>, signal: AbortSignal): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Removes one child subscription.
|
|
31
|
+
*
|
|
32
|
+
* @param child Supplies the child to dispose.
|
|
33
|
+
* @param signal Cancels disposal when supported.
|
|
34
|
+
* @returns Completion of disposal.
|
|
35
|
+
*/
|
|
36
|
+
dispose(child: Child, signal: AbortSignal): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Closes this member connection.
|
|
39
|
+
*
|
|
40
|
+
* @returns Completion of member cleanup.
|
|
41
|
+
*/
|
|
42
|
+
close(): Promise<void>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Configures the provider-neutral internal member owner.
|
|
46
|
+
*/
|
|
47
|
+
export interface BackendMembershipKernelOptions<Member, Request, Child, Update> {
|
|
48
|
+
/**
|
|
49
|
+
* Connects to one discovered member.
|
|
50
|
+
*
|
|
51
|
+
* @param member Supplies the discovered member.
|
|
52
|
+
* @param signal Cancels connection creation.
|
|
53
|
+
* @returns The connected member client.
|
|
54
|
+
*/
|
|
55
|
+
readonly create: (member: Member, signal: AbortSignal) => Promise<BackendMemberClient<Request, Child, Update>>;
|
|
56
|
+
/**
|
|
57
|
+
* Returns the stable identity of a discovered member.
|
|
58
|
+
*
|
|
59
|
+
* @param member Supplies the member to identify.
|
|
60
|
+
* @returns The stable member identity.
|
|
61
|
+
*/
|
|
62
|
+
readonly memberKey: (member: Member) => string;
|
|
63
|
+
/**
|
|
64
|
+
* Returns whether two snapshots describe the same member endpoint.
|
|
65
|
+
*
|
|
66
|
+
* @param left Supplies one member snapshot.
|
|
67
|
+
* @param right Supplies the other member snapshot.
|
|
68
|
+
* @returns Whether both snapshots represent the same endpoint.
|
|
69
|
+
*/
|
|
70
|
+
readonly sameMember: (left: Member, right: Member) => boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Returns the logical identity from one retained definition.
|
|
73
|
+
*
|
|
74
|
+
* @param definition Supplies the logical subscription definition.
|
|
75
|
+
* @returns Its logical identity, when available.
|
|
76
|
+
*/
|
|
77
|
+
readonly definitionKey: (definition: Uint8Array) => string | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Returns a logical definition rewritten for a specific child member.
|
|
80
|
+
*
|
|
81
|
+
* @param definition Supplies the logical subscription definition.
|
|
82
|
+
* @param member Supplies the child member.
|
|
83
|
+
* @returns The rewritten child definition.
|
|
84
|
+
*/
|
|
85
|
+
readonly childDefinition: (definition: Uint8Array, member: Member) => Uint8Array;
|
|
86
|
+
/**
|
|
87
|
+
* Returns a created child subscription envelope size in bytes.
|
|
88
|
+
*
|
|
89
|
+
* @param child Supplies the child subscription.
|
|
90
|
+
* @returns The child envelope byte size.
|
|
91
|
+
*/
|
|
92
|
+
readonly childSize: (child: Child) => number;
|
|
93
|
+
/**
|
|
94
|
+
* Limits parallel member and child creation when supplied.
|
|
95
|
+
*/
|
|
96
|
+
readonly maxConcurrentStarts?: number;
|
|
97
|
+
/**
|
|
98
|
+
* Rejects child subscription envelopes above this size when supplied.
|
|
99
|
+
*/
|
|
100
|
+
readonly maxChildBytes?: number;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Manages ephemeral backend membership and its native subscription children.
|
|
104
|
+
* Logical-definition persistence intentionally remains with callers.
|
|
105
|
+
*/
|
|
106
|
+
export declare class BackendMembershipKernel<Member, Request, Child, Update> {
|
|
107
|
+
#private;
|
|
108
|
+
/**
|
|
109
|
+
* Creates a kernel with bounded member and child creation.
|
|
110
|
+
*
|
|
111
|
+
* @param options Configures member creation and child subscription handling.
|
|
112
|
+
*/
|
|
113
|
+
constructor(options: BackendMembershipKernelOptions<Member, Request, Child, Update>);
|
|
114
|
+
/**
|
|
115
|
+
* Updates the live member set from a complete discovery snapshot.
|
|
116
|
+
*
|
|
117
|
+
* @param members Supplies the complete member snapshot.
|
|
118
|
+
* @returns Completion of member reconciliation.
|
|
119
|
+
*/
|
|
120
|
+
reconcile(members: readonly Member[]): Promise<void>;
|
|
121
|
+
/**
|
|
122
|
+
* Creates children for one retained logical subscription definition.
|
|
123
|
+
*
|
|
124
|
+
* @param definition Supplies the logical subscription definition.
|
|
125
|
+
* @param signal Cancels subscription creation.
|
|
126
|
+
* @param maxChildBytes Limits each child envelope size.
|
|
127
|
+
* @returns Completion of child creation.
|
|
128
|
+
*/
|
|
129
|
+
subscribe(definition: Uint8Array, signal: AbortSignal, maxChildBytes?: number): Promise<void>;
|
|
130
|
+
/**
|
|
131
|
+
* Updates live children for one previously retained logical definition.
|
|
132
|
+
*
|
|
133
|
+
* @param definition Supplies the retained logical definition.
|
|
134
|
+
* @param maxChildBytes Limits each child envelope size.
|
|
135
|
+
* @returns Completion of child recreation.
|
|
136
|
+
*/
|
|
137
|
+
rehydrate(definition: Uint8Array, maxChildBytes?: number): Promise<void>;
|
|
138
|
+
/**
|
|
139
|
+
* Creates update relay for a retained logical definition until cancellation.
|
|
140
|
+
*
|
|
141
|
+
* @param definition Supplies the retained logical definition.
|
|
142
|
+
* @param updates Receives relayed child updates.
|
|
143
|
+
* @param signal Cancels update relay.
|
|
144
|
+
* @returns Completion after cancellation.
|
|
145
|
+
*/
|
|
146
|
+
activate(definition: Uint8Array, updates: (update: Update) => Promise<void>, signal: AbortSignal): Promise<void>;
|
|
147
|
+
/**
|
|
148
|
+
* Clears one logical definition and its live child subscriptions.
|
|
149
|
+
*
|
|
150
|
+
* @param definition Supplies the logical definition to remove.
|
|
151
|
+
* @param signal Cancels child cleanup when supported.
|
|
152
|
+
* @returns Completion of child cleanup.
|
|
153
|
+
*/
|
|
154
|
+
cancel(definition: Uint8Array, signal: AbortSignal): Promise<void>;
|
|
155
|
+
/**
|
|
156
|
+
* Returns a unary response from the next available member.
|
|
157
|
+
*
|
|
158
|
+
* @param request Supplies the request to forward.
|
|
159
|
+
* @returns The backend response bytes.
|
|
160
|
+
*/
|
|
161
|
+
forward(request: Request): Promise<Uint8Array>;
|
|
162
|
+
/**
|
|
163
|
+
* Clears live work and closes every member connection.
|
|
164
|
+
*
|
|
165
|
+
* @returns Completion of member cleanup.
|
|
166
|
+
*/
|
|
167
|
+
close(): Promise<void>;
|
|
168
|
+
/**
|
|
169
|
+
* Resolves when an abort signal is observed.
|
|
170
|
+
*
|
|
171
|
+
* @param signal Supplies the signal to observe.
|
|
172
|
+
* @returns Completion after the signal aborts.
|
|
173
|
+
*/
|
|
174
|
+
static waitForAbort(signal: AbortSignal): Promise<void>;
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=backend-membership-kernel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend-membership-kernel.d.ts","sourceRoot":"","sources":["../../src/internal/backend-membership-kernel.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,MAAM,WAAW,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM;IAGzD;;;;;OAKG;IACH,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAE/C;;;;;;OAMG;IACH,SAAS,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAEvE;;;;;;;OAOG;IACH,QAAQ,CACN,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EAC1C,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;;;;OAMG;IACH,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1D;;;;OAIG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM;IAG5E;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,CACf,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,WAAW,KAChB,OAAO,CAAC,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IAE1D;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IAE/C;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,EA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