@based/functions 3.1.2 → 3.2.1
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/dist/context.js.map +1 -1
- package/dist/functions.d.ts +111 -35
- package/dist/functions.js +1 -0
- package/dist/functions.js.map +1 -1
- package/dist/stream.d.ts +5 -0
- package/dist/stream.js.map +1 -1
- package/package.json +1 -1
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AA8GA,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,GAAqB,EACQ,EAAE;IAC/B,IAAI,KAAK,IAAI,GAAG,EAAE,OAAO,EAAE
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AA8GA,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,GAAqB,EACQ,EAAE;IAC/B,IAAI,KAAK,IAAI,GAAG,EAAE,OAAO,EAAE;QACzB,OAAO,IAAI,CAAA;KACZ;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,GAAqB,EACa,EAAE;IACpC,IAAI,GAAG,CAAC,OAAO,IAAI,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;QAC3C,OAAO,IAAI,CAAA;KACZ;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,GAAqB,EAC2B,EAAE;IAClD,IAAI,GAAG,CAAC,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE;QAC3E,OAAO,IAAI,CAAA;KACZ;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,OAA4B,EACJ,EAAE;IAC1B,IAAI,OAAO,IAAI,KAAK,IAAI,OAAO,EAAE;QAC/B,OAAO,IAAI,CAAA;KACZ;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,OAA4B,EACC,EAAE;IAC/B,IAAI,OAAO,IAAI,MAAM,IAAI,OAAO,EAAE;QAChC,OAAO,IAAI,CAAA;KACZ;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA"}
|
package/dist/functions.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
1
3
|
import type { Required } from 'utility-types';
|
|
2
4
|
import { Context, HttpSession } from './context.js';
|
|
3
5
|
import { BasedFunctionClient } from './client.js';
|
|
@@ -11,6 +13,7 @@ export type HttpHeaders = {
|
|
|
11
13
|
};
|
|
12
14
|
export type SendHttpResponse = (responseData: any, headers?: HttpHeaders, status?: string | number) => void;
|
|
13
15
|
export type HttpResponse<P = any, K = any> = (based: BasedFunctionClient, payload: P, responseData: K, send: SendHttpResponse, ctx: Context<HttpSession>) => Promise<void>;
|
|
16
|
+
export type BasedHttpFunction<P = any> = (based: BasedFunctionClient, payload: P, send: SendHttpResponse, ctx: Context<HttpSession>) => Promise<void>;
|
|
14
17
|
export type BasedFunction<P = any, K = any> = (based: BasedFunctionClient, payload: P, ctx: Context) => Promise<K>;
|
|
15
18
|
export type BasedAppFunction = (based: BasedFunctionClient, assets: {
|
|
16
19
|
css: {
|
|
@@ -49,8 +52,60 @@ type FunctionConfigShared = {
|
|
|
49
52
|
/** Function name */
|
|
50
53
|
name?: string;
|
|
51
54
|
/** In addition to the name, a function can have a custom path for HTTP requests.
|
|
52
|
-
*
|
|
53
|
-
*
|
|
55
|
+
*
|
|
56
|
+
* For example:
|
|
57
|
+
*
|
|
58
|
+
* ```ts
|
|
59
|
+
* {
|
|
60
|
+
* name: 'myFunction',
|
|
61
|
+
* path: '/my/custom/path'
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* Will result in the function being available with a request to:
|
|
66
|
+
* `env.based.io/my/custom/path` or `env.based.io/myFunction/my/custom/path`
|
|
67
|
+
*
|
|
68
|
+
* ----
|
|
69
|
+
* **Query Parameters Matching**
|
|
70
|
+
*
|
|
71
|
+
* You can also use pattern matching to get parameters from the path.
|
|
72
|
+
* If set, the matched parameters will be injected into the payload argument.
|
|
73
|
+
*
|
|
74
|
+
* ----
|
|
75
|
+
* *Rules:*
|
|
76
|
+
* - The paths are strict and case-insensitive.
|
|
77
|
+
* - The paths matches with or without `/` in the end of the path.
|
|
78
|
+
* ----
|
|
79
|
+
* `/users` or `/my-page`
|
|
80
|
+
* - Static and required path.
|
|
81
|
+
* - Static paths are not included in the payload because they're not dynamic.
|
|
82
|
+
* ----
|
|
83
|
+
* `/users/:userId`
|
|
84
|
+
* - Static path and required parameter `userId` with any value.
|
|
85
|
+
* - If the parameter `userId` was missing, the path will not match, and your function will not be invoked.
|
|
86
|
+
* ----
|
|
87
|
+
* `/users/:userId?`
|
|
88
|
+
* - Static path and optional parameter `userId` with any value.
|
|
89
|
+
* - Returns `''` if the parameter `userId` was missing.
|
|
90
|
+
* ----
|
|
91
|
+
* `/product/:description*`
|
|
92
|
+
* - Static path and optional parameter `description` (0 or many).
|
|
93
|
+
* - Returns and Array of strings with all the consecutive values, eg. `/big/book/blue`
|
|
94
|
+
* - Returns `[]` if the parameter `description` was missing.
|
|
95
|
+
* ----
|
|
96
|
+
* `/product/:description+`
|
|
97
|
+
* - Static path and required parameter `description` (1 or many).
|
|
98
|
+
* - Returns and Array of strings with all the consecutive values, eg. `/big/book/blue`.
|
|
99
|
+
* - If the parameter `description` was missing, the path will not match, and your function will not be invoked.
|
|
100
|
+
* ----
|
|
101
|
+
* **Query String Parameters**
|
|
102
|
+
*
|
|
103
|
+
* Dont need to be included in the path, they will be merged and included in the payload automatically.
|
|
104
|
+
* ----
|
|
105
|
+
* **Reserved words**
|
|
106
|
+
*
|
|
107
|
+
* `token`
|
|
108
|
+
* - If you define an parameter named 'token' or use 'token' as query string, the value will not be included in the payload, instead it will be user internally to keep your AuthState updated.
|
|
54
109
|
*/
|
|
55
110
|
path?: string;
|
|
56
111
|
/** In bytes. `-1` indicates no size limit */
|
|
@@ -73,21 +128,22 @@ type FunctionConfigShared = {
|
|
|
73
128
|
uninstall?: UninstallFunction;
|
|
74
129
|
/** Specific authorize for this function */
|
|
75
130
|
authorize?: Authorize;
|
|
76
|
-
/** Relay allows functions to relay traffic to another `@based/server
|
|
77
|
-
|
|
131
|
+
/** Relay allows functions to relay traffic to another `@based/server`.
|
|
132
|
+
*
|
|
133
|
+
* Currently not supported for `stream`.
|
|
78
134
|
|
|
79
135
|
```js
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
136
|
+
new BasedServer({
|
|
137
|
+
clients: { events: BasedClient },
|
|
138
|
+
functions: {
|
|
139
|
+
specs: {
|
|
140
|
+
somethingToRelay: {
|
|
141
|
+
relay: { client: 'events', target: 'hello' },
|
|
142
|
+
type: 'function'
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
})
|
|
91
147
|
```
|
|
92
148
|
*/
|
|
93
149
|
relay?: {
|
|
@@ -99,30 +155,38 @@ type FunctionConfigShared = {
|
|
|
99
155
|
/** Used inernaly to check if a function is ready to uninstall */
|
|
100
156
|
timeoutCounter?: number;
|
|
101
157
|
};
|
|
102
|
-
type
|
|
103
|
-
|
|
158
|
+
export type PathToken = {
|
|
159
|
+
type: 0 | 1 | 2;
|
|
160
|
+
value?: Buffer;
|
|
161
|
+
modifier?: 0 | 63 | 43 | 42;
|
|
162
|
+
};
|
|
163
|
+
type FunctionConfigSharedComplete = Required<FunctionConfigShared, 'maxPayloadSize' | 'rateLimitTokens' | 'version' | 'name'> & {
|
|
164
|
+
tokens?: PathToken[];
|
|
165
|
+
};
|
|
166
|
+
export type BasedFunctionTypes = 'channel' | 'query' | 'function' | 'stream' | 'app' | 'job' | 'http';
|
|
104
167
|
type BasedChannelFunctionConfig = {
|
|
105
|
-
/** Function type `channel, function, query, stream, authorize` */
|
|
168
|
+
/** Function type `app, http, channel, function, query, stream, authorize, job` */
|
|
106
169
|
type: 'channel';
|
|
107
170
|
/** Channel subscriber
|
|
108
171
|
|
|
109
172
|
```js
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
173
|
+
const subscribe = (based, payload, id, update) => {
|
|
174
|
+
let cnt = 0
|
|
175
|
+
const interval = setInterval(() => {
|
|
176
|
+
update(++cnt)
|
|
177
|
+
})
|
|
178
|
+
|
|
179
|
+
return () => clearInterval(cnt)
|
|
180
|
+
}
|
|
117
181
|
```
|
|
118
182
|
*/
|
|
119
183
|
subscriber?: BasedChannelFunction;
|
|
120
184
|
/** Channel publisher
|
|
121
185
|
|
|
122
186
|
```js
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
187
|
+
const publisher = (based, payload, msg, id) => {
|
|
188
|
+
publishToChannel(id, msg)
|
|
189
|
+
}
|
|
126
190
|
```
|
|
127
191
|
*/
|
|
128
192
|
publisher?: BasedChannelPublishFunction;
|
|
@@ -136,13 +200,19 @@ type BasedChannelFunctionConfig = {
|
|
|
136
200
|
throttle?: number;
|
|
137
201
|
};
|
|
138
202
|
type BasedCallFunctionConfig = {
|
|
139
|
-
/** Function type `channel, function, query, stream` */
|
|
203
|
+
/** Function type `app, http, channel, function, query, stream, authorize, job` */
|
|
140
204
|
type: 'function';
|
|
141
205
|
fn?: BasedFunction;
|
|
142
206
|
httpResponse?: HttpResponse;
|
|
143
207
|
};
|
|
208
|
+
type BasedHttpFunctionConfig = {
|
|
209
|
+
/** Function type `app, http, channel, function, query, stream, authorize, job` */
|
|
210
|
+
type: 'http';
|
|
211
|
+
path: string;
|
|
212
|
+
fn: BasedHttpFunction;
|
|
213
|
+
};
|
|
144
214
|
type BasedQueryFunctionConfig = {
|
|
145
|
-
/** Function type `channel, function, query, stream` */
|
|
215
|
+
/** Function type `app, http, channel, function, query, stream, authorize, job` */
|
|
146
216
|
type: 'query';
|
|
147
217
|
fn?: BasedQueryFunction;
|
|
148
218
|
httpResponse?: HttpResponse;
|
|
@@ -152,30 +222,36 @@ type BasedQueryFunctionConfig = {
|
|
|
152
222
|
throttle?: number;
|
|
153
223
|
};
|
|
154
224
|
type BasedStreamFunctionConfig = {
|
|
155
|
-
/** Function type `channel, function, query, stream` */
|
|
225
|
+
/** Function type `app, http, channel, function, query, stream, authorize, job` */
|
|
156
226
|
type: 'stream';
|
|
157
227
|
fn: BasedStreamFunction;
|
|
158
228
|
};
|
|
159
229
|
type BasedAppFunctionConfig = {
|
|
230
|
+
/** Function type `app, http, channel, function, query, stream, authorize, job` */
|
|
160
231
|
type: 'app';
|
|
161
232
|
main: string;
|
|
233
|
+
/** The path your main file will be served through HTTP */
|
|
162
234
|
path?: string;
|
|
163
235
|
favicon?: string;
|
|
164
236
|
plugins?: BuildOptions['plugins'];
|
|
165
237
|
};
|
|
166
238
|
type BasedJobFunctionConfig = {
|
|
239
|
+
/** Function type `app, http, channel, function, query, stream, authorize, job` */
|
|
167
240
|
type: 'job';
|
|
168
241
|
fn?: BasedFunction;
|
|
169
242
|
};
|
|
170
|
-
export type BasedFunctionConfig<T extends BasedFunctionTypes = BasedFunctionTypes> = T extends 'channel' ? BasedChannelFunctionConfig & FunctionConfigShared : T extends 'function' ? BasedCallFunctionConfig & FunctionConfigShared : T extends 'query' ? BasedQueryFunctionConfig & FunctionConfigShared : T extends 'stream' ? BasedStreamFunctionConfig & FunctionConfigShared : T extends 'job' ? BasedJobFunctionConfig & FunctionConfigShared : T extends 'app' ? BasedAppFunctionConfig & FunctionConfigShared : (BasedChannelFunctionConfig & FunctionConfigShared) | (BasedCallFunctionConfig & FunctionConfigShared) | (BasedQueryFunctionConfig & FunctionConfigShared) | (BasedStreamFunctionConfig & FunctionConfigShared) | (BasedJobFunctionConfig & FunctionConfigShared) | (BasedAppFunctionConfig & FunctionConfigShared);
|
|
171
|
-
export type BasedFunctionConfigComplete<T extends BasedFunctionTypes = BasedFunctionTypes> = T extends 'channel' ? BasedChannelFunctionConfig & FunctionConfigSharedComplete : T extends 'function' ? BasedCallFunctionConfig & FunctionConfigSharedComplete : T extends 'query' ? BasedQueryFunctionConfig & FunctionConfigSharedComplete : T extends 'stream' ? BasedStreamFunctionConfig & FunctionConfigSharedComplete : T extends 'job' ? BasedJobFunctionConfig & FunctionConfigSharedComplete : T extends 'app' ? BasedAppFunctionConfig & FunctionConfigSharedComplete : (BasedChannelFunctionConfig & FunctionConfigSharedComplete) | (BasedCallFunctionConfig & FunctionConfigSharedComplete) | (BasedQueryFunctionConfig & FunctionConfigSharedComplete) | (BasedStreamFunctionConfig & FunctionConfigSharedComplete) | (BasedJobFunctionConfig & FunctionConfigSharedComplete) | (BasedAppFunctionConfig & FunctionConfigSharedComplete);
|
|
243
|
+
export type BasedFunctionConfig<T extends BasedFunctionTypes = BasedFunctionTypes> = T extends 'channel' ? BasedChannelFunctionConfig & FunctionConfigShared : T extends 'function' ? BasedCallFunctionConfig & FunctionConfigShared : T extends 'query' ? BasedQueryFunctionConfig & FunctionConfigShared : T extends 'stream' ? BasedStreamFunctionConfig & FunctionConfigShared : T extends 'job' ? BasedJobFunctionConfig & FunctionConfigShared : T extends 'app' ? BasedAppFunctionConfig & FunctionConfigShared : T extends 'http' ? BasedHttpFunctionConfig & FunctionConfigShared : (BasedChannelFunctionConfig & FunctionConfigShared) | (BasedCallFunctionConfig & FunctionConfigShared) | (BasedQueryFunctionConfig & FunctionConfigShared) | (BasedStreamFunctionConfig & FunctionConfigShared) | (BasedJobFunctionConfig & FunctionConfigShared) | (BasedAppFunctionConfig & FunctionConfigShared) | (BasedHttpFunctionConfig & FunctionConfigShared);
|
|
244
|
+
export type BasedFunctionConfigComplete<T extends BasedFunctionTypes = BasedFunctionTypes> = T extends 'channel' ? BasedChannelFunctionConfig & FunctionConfigSharedComplete : T extends 'function' ? BasedCallFunctionConfig & FunctionConfigSharedComplete : T extends 'query' ? BasedQueryFunctionConfig & FunctionConfigSharedComplete : T extends 'stream' ? BasedStreamFunctionConfig & FunctionConfigSharedComplete : T extends 'job' ? BasedJobFunctionConfig & FunctionConfigSharedComplete : T extends 'app' ? BasedAppFunctionConfig & FunctionConfigSharedComplete : T extends 'http' ? BasedHttpFunctionConfig & FunctionConfigSharedComplete : (BasedChannelFunctionConfig & FunctionConfigSharedComplete) | (BasedCallFunctionConfig & FunctionConfigSharedComplete) | (BasedQueryFunctionConfig & FunctionConfigSharedComplete) | (BasedStreamFunctionConfig & FunctionConfigSharedComplete) | (BasedJobFunctionConfig & FunctionConfigSharedComplete) | (BasedAppFunctionConfig & FunctionConfigSharedComplete) | (BasedHttpFunctionConfig & FunctionConfigSharedComplete);
|
|
172
245
|
export type BasedAuthorizeFunctionConfig = {
|
|
173
|
-
/** Function type `authorize` */
|
|
246
|
+
/** Function type `app, http, channel, function, query, stream, authorize, job` */
|
|
174
247
|
type: 'authorize';
|
|
175
248
|
fn?: Authorize;
|
|
176
249
|
};
|
|
177
250
|
export type BasedRoute<T extends BasedFunctionTypes = BasedFunctionTypes, R extends keyof BasedFunctionConfig = 'type' | 'name'> = Required<Partial<BasedFunctionConfig<T>>, R>;
|
|
178
|
-
export type BasedRouteComplete<T extends BasedFunctionTypes = BasedFunctionTypes> = Required<Partial<BasedFunctionConfig<T>>, 'type' | 'name' | 'maxPayloadSize' | 'rateLimitTokens'
|
|
251
|
+
export type BasedRouteComplete<T extends BasedFunctionTypes = BasedFunctionTypes> = Required<Partial<BasedFunctionConfig<T>>, 'type' | 'name' | 'maxPayloadSize' | 'rateLimitTokens'> & {
|
|
252
|
+
tokens?: PathToken[];
|
|
253
|
+
nameOnPath?: boolean;
|
|
254
|
+
};
|
|
179
255
|
export declare function isBasedRoute<T extends BasedFunctionTypes>(type: T, route: any): route is BasedRoute<T>;
|
|
180
256
|
export declare function isAnyBasedRoute(route: any): route is BasedRoute;
|
|
181
257
|
export declare function isBasedFunctionConfig<T extends BasedFunctionTypes>(type: T, config: any): config is BasedFunctionConfig<T>;
|
package/dist/functions.js
CHANGED
package/dist/functions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../src/functions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../src/functions.ts"],"names":[],"mappings":"AA8ZA,MAAM,UAAU,YAAY,CAC1B,IAAO,EACP,KAAU;IAEV,OAAO,CACL,KAAK;QACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,CAAC,IAAI,KAAK,IAAI;QACnB,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAC/B,CAAA;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAU;IACxC,OAAO,CACL,KAAK;QACL,OAAO,KAAK,KAAK,QAAQ;QACzB,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS;YACvB,KAAK,CAAC,IAAI,KAAK,OAAO;YACtB,KAAK,CAAC,IAAI,KAAK,UAAU;YACzB,KAAK,CAAC,IAAI,KAAK,MAAM;YACrB,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC;QAC1B,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAC/B,CAAA;AACH,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,IAAO,EACP,MAAW;IAEX,OAAO,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;AACnC,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,MAAW;IAEX,OAAO,eAAe,CAAC,MAAM,CAAC,CAAA;AAChC,CAAC"}
|
package/dist/stream.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
4
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
5
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
1
6
|
import { Duplex, Readable } from "node:stream";
|
|
2
7
|
import util from "node:util";
|
|
3
8
|
export declare class BasedDataStream extends Duplex {
|
package/dist/stream.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.js","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,OAAO,eAAgB,SAAQ,MAAM;IAClC,IAAI,GAAW,CAAC,CAAC;IACjB,MAAM,GAAY,KAAK,CAAC;IACxB,aAAa,GAAW,CAAC,CAAC;IAC1B,YAAY,CAAiB;IAEpC,YAAY,IAAY;QACtB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAEjB,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YACpB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACrB,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;YACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACtB,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC3B,CAAC;IAEQ,KAAK,KAAI,CAAC;IAEV,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ;QACvC,IAAI,CAAC,aAAa,IAAI,KAAK,CAAC,U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