iii-browser-sdk 0.17.0 → 0.18.0

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.
@@ -1,239 +0,0 @@
1
- //#region src/stream.d.ts
2
- /** Input for stream authentication. */
3
- interface StreamAuthInput {
4
- /** Request headers. */
5
- headers: Record<string, string>;
6
- /** Request path. */
7
- path: string;
8
- /** Query parameters. */
9
- query_params: Record<string, string[]>;
10
- /** Client address. */
11
- addr: string;
12
- }
13
- /** Result of stream authentication. */
14
- interface StreamAuthResult {
15
- /** Arbitrary context passed to stream handlers after authentication. */
16
- context?: any;
17
- }
18
- /** Context type extracted from {@link StreamAuthResult}. */
19
- type StreamContext = StreamAuthResult['context'];
20
- /** Event payload for stream join/leave events. */
21
- interface StreamJoinLeaveEvent {
22
- /** Unique subscription identifier. */
23
- subscription_id: string;
24
- /** Name of the stream. */
25
- stream_name: string;
26
- /** Group identifier. */
27
- group_id: string;
28
- /** Item identifier (if applicable). */
29
- id?: string;
30
- /** Auth context from {@link StreamAuthResult}. */
31
- context?: StreamContext;
32
- }
33
- /** Result of a stream join request. */
34
- interface StreamJoinResult {
35
- /** Whether the join was unauthorized. */
36
- unauthorized: boolean;
37
- }
38
- /** Input for retrieving a single stream item. */
39
- type StreamGetInput = {
40
- /** Name of the stream. */stream_name: string; /** Group identifier. */
41
- group_id: string; /** Item identifier. */
42
- item_id: string;
43
- };
44
- /** Input for setting a stream item. */
45
- type StreamSetInput = {
46
- /** Name of the stream. */stream_name: string; /** Group identifier. */
47
- group_id: string; /** Item identifier. */
48
- item_id: string; /** Data to store. */
49
- data: any;
50
- };
51
- /** Input for deleting a stream item. */
52
- type StreamDeleteInput = {
53
- /** Name of the stream. */stream_name: string; /** Group identifier. */
54
- group_id: string; /** Item identifier. */
55
- item_id: string;
56
- };
57
- /** Input for listing all items in a stream group. */
58
- type StreamListInput = {
59
- /** Name of the stream. */stream_name: string; /** Group identifier. */
60
- group_id: string;
61
- };
62
- /** Input for listing all groups in a stream. */
63
- type StreamListGroupsInput = {
64
- /** Name of the stream. */stream_name: string;
65
- };
66
- /** Result of a stream set operation. */
67
- type StreamSetResult<TData> = {
68
- /** Previous value (if it existed). */old_value?: TData; /** New value that was stored. */
69
- new_value: TData;
70
- };
71
- /** Result of a stream update operation. */
72
- type StreamUpdateResult<TData> = {
73
- /** Previous value (if it existed). */old_value?: TData; /** New value after the update. */
74
- new_value: TData;
75
- /**
76
- * Per-op errors. Emitted by `merge` and `append` for validation
77
- * rejections (path/value bounds, proto-pollution segments) and by
78
- * `append` for the `append.type_mismatch` and
79
- * `append.target_not_object` surfaces. Field omitted when empty.
80
- */
81
- errors?: UpdateOpError[];
82
- };
83
- /** Set a field at the given path to a value. */
84
- type UpdateSet = {
85
- type: 'set'; /** First-level field path. Use an empty string to target the root value. */
86
- path: string; /** Value to set. */
87
- value: any;
88
- };
89
- /** Increment a numeric field by a given amount. */
90
- type UpdateIncrement = {
91
- type: 'increment'; /** First-level field path. */
92
- path: string; /** Amount to increment by. */
93
- by: number;
94
- };
95
- /** Decrement a numeric field by a given amount. */
96
- type UpdateDecrement = {
97
- type: 'decrement'; /** First-level field path. */
98
- path: string; /** Amount to decrement by. */
99
- by: number;
100
- };
101
- /**
102
- * Append an element to an array, concatenate a string, or push a new
103
- * value at a nested path. The target is the root (when `path` is
104
- * omitted, empty, or `[]`), a single first-level key (when `path` is
105
- * a non-empty string), or an arbitrary nested location (when `path`
106
- * is an array of literal segments). See {@link MergePath}.
107
- *
108
- * Engine semantics: missing/null intermediates along a nested path are
109
- * auto-created; missing leaves on a nested path always become arrays
110
- * (no string-concat tier); existing object/scalar leaves return
111
- * `append.type_mismatch`. Each path segment is a literal key —
112
- * `["a.b"]` targets a single key named `"a.b"`, not `a → b`.
113
- */
114
- type UpdateAppend = {
115
- type: 'append';
116
- /**
117
- * Optional path to the append target. Accepts a single first-level
118
- * key (legacy `string`) or an array of literal segments for nested
119
- * append. See {@link MergePath} (the same shape is reused).
120
- */
121
- path?: MergePath; /** Value to append. String targets only accept string values. */
122
- value: any;
123
- };
124
- /** Remove a field at the given path. */
125
- type UpdateRemove = {
126
- type: 'remove'; /** First-level field path. */
127
- path: string;
128
- };
129
- /**
130
- * Path target for a {@link UpdateMerge} op. Accepts:
131
- * - a single string (legacy / first-level field)
132
- * - an array of literal segments (nested path; each element is one
133
- * literal key, dots are NOT interpreted as separators)
134
- *
135
- * Omit `path`, pass `""`, or pass `[]` to target the root value.
136
- *
137
- * @example single first-level field
138
- * { type: 'merge', path: 'session-abc', value: { author: 'alice' } }
139
- * @example nested path
140
- * { type: 'merge', path: ['sessions', 'abc'], value: { ts: chunk } }
141
- */
142
- type MergePath = string | string[];
143
- /**
144
- * Shallow-merge an object into the target. The target is the root
145
- * (when `path` is omitted/empty) or an arbitrary nested location
146
- * specified by an array of literal segments. See {@link MergePath}.
147
- *
148
- * Validation: invalid paths/values (depth > 32, segment > 256 bytes,
149
- * value depth > 16, > 1024 top-level keys, or any
150
- * `__proto__`/`constructor`/`prototype` segment or top-level key) are
151
- * rejected with a structured error in the response's `errors` array.
152
- */
153
- type UpdateMerge = {
154
- type: 'merge'; /** Optional path to the merge target. See {@link MergePath}. */
155
- path?: MergePath; /** Object to merge. Must be a JSON object. */
156
- value: any;
157
- };
158
- /** Per-op error returned by `state::update` / `stream::update`. */
159
- type UpdateOpError = {
160
- /** Index of the offending op within the original `ops` array. */op_index: number; /** Stable error code, e.g. `"merge.path.too_deep"`. */
161
- code: string; /** Human-readable description with concrete numbers when applicable. */
162
- message: string; /** Optional documentation URL. */
163
- doc_url?: string;
164
- };
165
- /** Result of a stream delete operation. */
166
- type DeleteResult = {
167
- /** Previous value (if it existed). */old_value?: any;
168
- };
169
- /**
170
- * Union of all atomic update operations supported by streams.
171
- *
172
- * @see {@link UpdateSet}, {@link UpdateIncrement}, {@link UpdateDecrement},
173
- * {@link UpdateAppend}, {@link UpdateRemove}, {@link UpdateMerge}
174
- */
175
- type UpdateOp = UpdateSet | UpdateIncrement | UpdateDecrement | UpdateAppend | UpdateRemove | UpdateMerge;
176
- /** Input for atomically updating a stream item. */
177
- type StreamUpdateInput = {
178
- /** Name of the stream. */stream_name: string; /** Group identifier. */
179
- group_id: string; /** Item identifier. */
180
- item_id: string; /** Ordered list of update operations to apply atomically. */
181
- ops: UpdateOp[];
182
- };
183
- /** Trigger config for `stream` triggers. Filters which item changes fire the handler. */
184
- interface StreamTriggerConfig {
185
- /** Stream name to watch. Only changes on this stream fire the handler. */
186
- stream_name: string;
187
- /** If set, only changes within this group fire the handler. */
188
- group_id?: string;
189
- /** If set, only changes to this specific item fire the handler. */
190
- item_id?: string;
191
- /** Function ID for conditional execution. If it returns `false`, the handler is skipped. */
192
- condition_function_id?: string;
193
- }
194
- /** Trigger config for `stream:join` and `stream:leave` triggers. */
195
- interface StreamJoinLeaveTriggerConfig {
196
- /** Function ID for conditional execution. If it returns `false`, the handler is skipped. */
197
- condition_function_id?: string;
198
- }
199
- /** Handler input for `stream` triggers, fired when an item changes via `stream::set`, `stream::update`, or `stream::delete`. */
200
- interface StreamChangeEvent {
201
- /** The event type. */
202
- type: 'stream';
203
- /** Unix timestamp of the event. */
204
- timestamp: number;
205
- /** The stream where the change occurred. */
206
- streamName: string;
207
- /** The group where the change occurred. */
208
- groupId: string;
209
- /** The item ID that changed. */
210
- id?: string;
211
- /** The event detail object containing `type` and `data` fields. */
212
- event: {
213
- type: 'create' | 'update' | 'delete';
214
- data: any;
215
- };
216
- }
217
- /**
218
- * Interface for custom stream implementations. Passed to `ISdk.createStream`
219
- * to override the engine's built-in stream storage.
220
- *
221
- * @typeParam TData - Type of the data stored in the stream.
222
- */
223
- interface IStream<TData> {
224
- /** Retrieve a single item by group and item ID. */
225
- get(input: StreamGetInput): Promise<TData | null>;
226
- /** Set (create or overwrite) a stream item. */
227
- set(input: StreamSetInput): Promise<StreamSetResult<TData> | null>;
228
- /** Delete a stream item. */
229
- delete(input: StreamDeleteInput): Promise<DeleteResult>;
230
- /** List all items in a group. */
231
- list(input: StreamListInput): Promise<TData[]>;
232
- /** List all group IDs in a stream. */
233
- listGroups(input: StreamListGroupsInput): Promise<string[]>;
234
- /** Apply atomic update operations to a stream item. */
235
- update(input: StreamUpdateInput): Promise<StreamUpdateResult<TData> | null>;
236
- }
237
- //#endregion
238
- export { UpdateMerge as C, UpdateSet as D, UpdateRemove as E, UpdateIncrement as S, UpdateOpError as T, StreamTriggerConfig as _, StreamAuthResult as a, UpdateAppend as b, StreamDeleteInput as c, StreamJoinLeaveTriggerConfig as d, StreamJoinResult as f, StreamSetResult as g, StreamSetInput as h, StreamAuthInput as i, StreamGetInput as l, StreamListInput as m, IStream as n, StreamChangeEvent as o, StreamListGroupsInput as p, MergePath as r, StreamContext as s, DeleteResult as t, StreamJoinLeaveEvent as u, StreamUpdateInput as v, UpdateOp as w, UpdateDecrement as x, StreamUpdateResult as y };
239
- //# sourceMappingURL=stream-4S6io5EI.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stream-4S6io5EI.d.mts","names":[],"sources":["../src/stream.ts"],"mappings":";;UACiB,eAAA;EAAe;EAE9B,OAAA,EAAS,MAAA;EAIW;EAFpB,IAAA;EAFS;EAIT,YAAA,EAAc,MAAA;EAAd;EAEA,IAAA;AAAA;;UAIe,gBAAA;EAAA;EAGf,OAAA;AAAA;;KAIU,aAAA,GAAgB,gBAAA;AAA5B;AAAA,UAGiB,oBAAA;;EAEf,eAAA;EAL0C;EAO1C,WAAA;EAJmC;EAMnC,QAAA;EAIuB;EAFvB,EAAA;EAJA;EAMA,OAAA,GAAU,aAAA;AAAA;;UAIK,gBAAA;EAJQ;EAMvB,YAAA;AAAA;;KAIU,cAAA;EAJV,0BAMA,WAAA,UAFU;EAIV,QAAA;EAEA,OAAA;AAAA;;KAIU,cAAA;EAJH,0BAMP,WAAA,UAFU;EAIV,QAAA;EAEA,OAAA,UAJA;EAOA,IAAA;AAAA;;KAIU,iBAAA;EAJN,0BAMJ,WAAA,UAF2B;EAI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A;;EAEA,qBAAA;AAAA;;UAIe,4BAAA;EAcf;EAZA,qBAAA;AAAA;;UAIe,iBAAA;EAeT;EAbN,IAAA;EAuBe;EArBf,SAAA;EAqBsB;EAnBtB,UAAA;EAqBoC;EAnBpC,OAAA;EAqBW;EAnBX,EAAA;EAmBoC;EAjBpC,KAAA;IACE,IAAA;IAEA,IAAA;EAAA;AAAA;;;;;;;UAUa,OAAA;EAYmB;EAVlC,GAAA,CAAI,KAAA,EAAO,cAAA,GAAiB,OAAA,CAAQ,KAAA;EAUK;EARzC,GAAA,CAAI,KAAA,EAAO,cAAA,GAAiB,OAAA,CAAQ,eAAA,CAAgB,KAAA;EAFpD;EAIA,MAAA,CAAO,KAAA,EAAO,iBAAA,GAAoB,OAAA,CAAQ,YAAA;EAJtC;EAMJ,IAAA,CAAK,KAAA,EAAO,eAAA,GAAkB,OAAA,CAAQ,KAAA;EANF;EAQpC,UAAA,CAAW,KAAA,EAAO,qBAAA,GAAwB,OAAA;EAN/B;EAQX,MAAA,CAAO,KAAA,EAAO,iBAAA,GAAoB,OAAA,CAAQ,kBAAA,CAAmB,KAAA;AAAA"}
@@ -1,239 +0,0 @@
1
- //#region src/stream.d.ts
2
- /** Input for stream authentication. */
3
- interface StreamAuthInput {
4
- /** Request headers. */
5
- headers: Record<string, string>;
6
- /** Request path. */
7
- path: string;
8
- /** Query parameters. */
9
- query_params: Record<string, string[]>;
10
- /** Client address. */
11
- addr: string;
12
- }
13
- /** Result of stream authentication. */
14
- interface StreamAuthResult {
15
- /** Arbitrary context passed to stream handlers after authentication. */
16
- context?: any;
17
- }
18
- /** Context type extracted from {@link StreamAuthResult}. */
19
- type StreamContext = StreamAuthResult['context'];
20
- /** Event payload for stream join/leave events. */
21
- interface StreamJoinLeaveEvent {
22
- /** Unique subscription identifier. */
23
- subscription_id: string;
24
- /** Name of the stream. */
25
- stream_name: string;
26
- /** Group identifier. */
27
- group_id: string;
28
- /** Item identifier (if applicable). */
29
- id?: string;
30
- /** Auth context from {@link StreamAuthResult}. */
31
- context?: StreamContext;
32
- }
33
- /** Result of a stream join request. */
34
- interface StreamJoinResult {
35
- /** Whether the join was unauthorized. */
36
- unauthorized: boolean;
37
- }
38
- /** Input for retrieving a single stream item. */
39
- type StreamGetInput = {
40
- /** Name of the stream. */stream_name: string; /** Group identifier. */
41
- group_id: string; /** Item identifier. */
42
- item_id: string;
43
- };
44
- /** Input for setting a stream item. */
45
- type StreamSetInput = {
46
- /** Name of the stream. */stream_name: string; /** Group identifier. */
47
- group_id: string; /** Item identifier. */
48
- item_id: string; /** Data to store. */
49
- data: any;
50
- };
51
- /** Input for deleting a stream item. */
52
- type StreamDeleteInput = {
53
- /** Name of the stream. */stream_name: string; /** Group identifier. */
54
- group_id: string; /** Item identifier. */
55
- item_id: string;
56
- };
57
- /** Input for listing all items in a stream group. */
58
- type StreamListInput = {
59
- /** Name of the stream. */stream_name: string; /** Group identifier. */
60
- group_id: string;
61
- };
62
- /** Input for listing all groups in a stream. */
63
- type StreamListGroupsInput = {
64
- /** Name of the stream. */stream_name: string;
65
- };
66
- /** Result of a stream set operation. */
67
- type StreamSetResult<TData> = {
68
- /** Previous value (if it existed). */old_value?: TData; /** New value that was stored. */
69
- new_value: TData;
70
- };
71
- /** Result of a stream update operation. */
72
- type StreamUpdateResult<TData> = {
73
- /** Previous value (if it existed). */old_value?: TData; /** New value after the update. */
74
- new_value: TData;
75
- /**
76
- * Per-op errors. Emitted by `merge` and `append` for validation
77
- * rejections (path/value bounds, proto-pollution segments) and by
78
- * `append` for the `append.type_mismatch` and
79
- * `append.target_not_object` surfaces. Field omitted when empty.
80
- */
81
- errors?: UpdateOpError[];
82
- };
83
- /** Set a field at the given path to a value. */
84
- type UpdateSet = {
85
- type: 'set'; /** First-level field path. Use an empty string to target the root value. */
86
- path: string; /** Value to set. */
87
- value: any;
88
- };
89
- /** Increment a numeric field by a given amount. */
90
- type UpdateIncrement = {
91
- type: 'increment'; /** First-level field path. */
92
- path: string; /** Amount to increment by. */
93
- by: number;
94
- };
95
- /** Decrement a numeric field by a given amount. */
96
- type UpdateDecrement = {
97
- type: 'decrement'; /** First-level field path. */
98
- path: string; /** Amount to decrement by. */
99
- by: number;
100
- };
101
- /**
102
- * Append an element to an array, concatenate a string, or push a new
103
- * value at a nested path. The target is the root (when `path` is
104
- * omitted, empty, or `[]`), a single first-level key (when `path` is
105
- * a non-empty string), or an arbitrary nested location (when `path`
106
- * is an array of literal segments). See {@link MergePath}.
107
- *
108
- * Engine semantics: missing/null intermediates along a nested path are
109
- * auto-created; missing leaves on a nested path always become arrays
110
- * (no string-concat tier); existing object/scalar leaves return
111
- * `append.type_mismatch`. Each path segment is a literal key —
112
- * `["a.b"]` targets a single key named `"a.b"`, not `a → b`.
113
- */
114
- type UpdateAppend = {
115
- type: 'append';
116
- /**
117
- * Optional path to the append target. Accepts a single first-level
118
- * key (legacy `string`) or an array of literal segments for nested
119
- * append. See {@link MergePath} (the same shape is reused).
120
- */
121
- path?: MergePath; /** Value to append. String targets only accept string values. */
122
- value: any;
123
- };
124
- /** Remove a field at the given path. */
125
- type UpdateRemove = {
126
- type: 'remove'; /** First-level field path. */
127
- path: string;
128
- };
129
- /**
130
- * Path target for a {@link UpdateMerge} op. Accepts:
131
- * - a single string (legacy / first-level field)
132
- * - an array of literal segments (nested path; each element is one
133
- * literal key, dots are NOT interpreted as separators)
134
- *
135
- * Omit `path`, pass `""`, or pass `[]` to target the root value.
136
- *
137
- * @example single first-level field
138
- * { type: 'merge', path: 'session-abc', value: { author: 'alice' } }
139
- * @example nested path
140
- * { type: 'merge', path: ['sessions', 'abc'], value: { ts: chunk } }
141
- */
142
- type MergePath = string | string[];
143
- /**
144
- * Shallow-merge an object into the target. The target is the root
145
- * (when `path` is omitted/empty) or an arbitrary nested location
146
- * specified by an array of literal segments. See {@link MergePath}.
147
- *
148
- * Validation: invalid paths/values (depth > 32, segment > 256 bytes,
149
- * value depth > 16, > 1024 top-level keys, or any
150
- * `__proto__`/`constructor`/`prototype` segment or top-level key) are
151
- * rejected with a structured error in the response's `errors` array.
152
- */
153
- type UpdateMerge = {
154
- type: 'merge'; /** Optional path to the merge target. See {@link MergePath}. */
155
- path?: MergePath; /** Object to merge. Must be a JSON object. */
156
- value: any;
157
- };
158
- /** Per-op error returned by `state::update` / `stream::update`. */
159
- type UpdateOpError = {
160
- /** Index of the offending op within the original `ops` array. */op_index: number; /** Stable error code, e.g. `"merge.path.too_deep"`. */
161
- code: string; /** Human-readable description with concrete numbers when applicable. */
162
- message: string; /** Optional documentation URL. */
163
- doc_url?: string;
164
- };
165
- /** Result of a stream delete operation. */
166
- type DeleteResult = {
167
- /** Previous value (if it existed). */old_value?: any;
168
- };
169
- /**
170
- * Union of all atomic update operations supported by streams.
171
- *
172
- * @see {@link UpdateSet}, {@link UpdateIncrement}, {@link UpdateDecrement},
173
- * {@link UpdateAppend}, {@link UpdateRemove}, {@link UpdateMerge}
174
- */
175
- type UpdateOp = UpdateSet | UpdateIncrement | UpdateDecrement | UpdateAppend | UpdateRemove | UpdateMerge;
176
- /** Input for atomically updating a stream item. */
177
- type StreamUpdateInput = {
178
- /** Name of the stream. */stream_name: string; /** Group identifier. */
179
- group_id: string; /** Item identifier. */
180
- item_id: string; /** Ordered list of update operations to apply atomically. */
181
- ops: UpdateOp[];
182
- };
183
- /** Trigger config for `stream` triggers. Filters which item changes fire the handler. */
184
- interface StreamTriggerConfig {
185
- /** Stream name to watch. Only changes on this stream fire the handler. */
186
- stream_name: string;
187
- /** If set, only changes within this group fire the handler. */
188
- group_id?: string;
189
- /** If set, only changes to this specific item fire the handler. */
190
- item_id?: string;
191
- /** Function ID for conditional execution. If it returns `false`, the handler is skipped. */
192
- condition_function_id?: string;
193
- }
194
- /** Trigger config for `stream:join` and `stream:leave` triggers. */
195
- interface StreamJoinLeaveTriggerConfig {
196
- /** Function ID for conditional execution. If it returns `false`, the handler is skipped. */
197
- condition_function_id?: string;
198
- }
199
- /** Handler input for `stream` triggers, fired when an item changes via `stream::set`, `stream::update`, or `stream::delete`. */
200
- interface StreamChangeEvent {
201
- /** The event type. */
202
- type: 'stream';
203
- /** Unix timestamp of the event. */
204
- timestamp: number;
205
- /** The stream where the change occurred. */
206
- streamName: string;
207
- /** The group where the change occurred. */
208
- groupId: string;
209
- /** The item ID that changed. */
210
- id?: string;
211
- /** The event detail object containing `type` and `data` fields. */
212
- event: {
213
- type: 'create' | 'update' | 'delete';
214
- data: any;
215
- };
216
- }
217
- /**
218
- * Interface for custom stream implementations. Passed to `ISdk.createStream`
219
- * to override the engine's built-in stream storage.
220
- *
221
- * @typeParam TData - Type of the data stored in the stream.
222
- */
223
- interface IStream<TData> {
224
- /** Retrieve a single item by group and item ID. */
225
- get(input: StreamGetInput): Promise<TData | null>;
226
- /** Set (create or overwrite) a stream item. */
227
- set(input: StreamSetInput): Promise<StreamSetResult<TData> | null>;
228
- /** Delete a stream item. */
229
- delete(input: StreamDeleteInput): Promise<DeleteResult>;
230
- /** List all items in a group. */
231
- list(input: StreamListInput): Promise<TData[]>;
232
- /** List all group IDs in a stream. */
233
- listGroups(input: StreamListGroupsInput): Promise<string[]>;
234
- /** Apply atomic update operations to a stream item. */
235
- update(input: StreamUpdateInput): Promise<StreamUpdateResult<TData> | null>;
236
- }
237
- //#endregion
238
- export { UpdateMerge as C, UpdateSet as D, UpdateRemove as E, UpdateIncrement as S, UpdateOpError as T, StreamTriggerConfig as _, StreamAuthResult as a, UpdateAppend as b, StreamDeleteInput as c, StreamJoinLeaveTriggerConfig as d, StreamJoinResult as f, StreamSetResult as g, StreamSetInput as h, StreamAuthInput as i, StreamGetInput as l, StreamListInput as m, IStream as n, StreamChangeEvent as o, StreamListGroupsInput as p, MergePath as r, StreamContext as s, DeleteResult as t, StreamJoinLeaveEvent as u, StreamUpdateInput as v, UpdateOp as w, UpdateDecrement as x, StreamUpdateResult as y };
239
- //# sourceMappingURL=stream-DUoMZNRq.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stream-DUoMZNRq.d.cts","names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