dodopayments-mcp 2.20.0 → 2.22.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.
Files changed (50) hide show
  1. package/code-tool-paths.cjs +6 -0
  2. package/code-tool-paths.cjs.map +1 -0
  3. package/code-tool-paths.d.cts +2 -0
  4. package/code-tool-paths.d.cts.map +1 -0
  5. package/code-tool-types.d.mts.map +1 -1
  6. package/code-tool-types.d.ts.map +1 -1
  7. package/code-tool-worker.d.mts +5 -0
  8. package/code-tool-worker.d.mts.map +1 -0
  9. package/code-tool-worker.d.ts +5 -0
  10. package/code-tool-worker.d.ts.map +1 -0
  11. package/code-tool-worker.js +325 -0
  12. package/code-tool-worker.js.map +1 -0
  13. package/code-tool-worker.mjs +320 -0
  14. package/code-tool-worker.mjs.map +1 -0
  15. package/code-tool.d.mts +8 -2
  16. package/code-tool.d.mts.map +1 -1
  17. package/code-tool.d.ts +8 -2
  18. package/code-tool.d.ts.map +1 -1
  19. package/code-tool.js +248 -40
  20. package/code-tool.js.map +1 -1
  21. package/code-tool.mjs +212 -40
  22. package/code-tool.mjs.map +1 -1
  23. package/methods.d.mts.map +1 -1
  24. package/methods.d.ts.map +1 -1
  25. package/methods.js +78 -0
  26. package/methods.js.map +1 -1
  27. package/methods.mjs +78 -0
  28. package/methods.mjs.map +1 -1
  29. package/options.d.mts +3 -0
  30. package/options.d.mts.map +1 -1
  31. package/options.d.ts +3 -0
  32. package/options.d.ts.map +1 -1
  33. package/options.js +14 -0
  34. package/options.js.map +1 -1
  35. package/options.mjs +14 -0
  36. package/options.mjs.map +1 -1
  37. package/package.json +19 -3
  38. package/server.d.mts.map +1 -1
  39. package/server.d.ts.map +1 -1
  40. package/server.js +7 -5
  41. package/server.js.map +1 -1
  42. package/server.mjs +7 -5
  43. package/server.mjs.map +1 -1
  44. package/src/code-tool-paths.cts +3 -0
  45. package/src/code-tool-types.ts +1 -0
  46. package/src/code-tool-worker.ts +371 -0
  47. package/src/code-tool.ts +274 -53
  48. package/src/methods.ts +78 -0
  49. package/src/options.ts +21 -0
  50. package/src/server.ts +11 -6
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.workerPath = void 0;
5
+ exports.workerPath = require.resolve('./code-tool-worker.mjs');
6
+ //# sourceMappingURL=code-tool-paths.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-tool-paths.cjs","sourceRoot":"","sources":["src/code-tool-paths.cts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEzE,QAAA,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const workerPath: string;
2
+ //# sourceMappingURL=code-tool-paths.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-tool-paths.d.cts","sourceRoot":"","sources":["src/code-tool-paths.cts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,QAA4C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"code-tool-types.d.mts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,cAAc;AAE5C,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,aAAa,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;AACF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC"}
1
+ {"version":3,"file":"code-tool-types.d.mts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,cAAc;AAE5C,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,aAAa,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"code-tool-types.d.ts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,cAAc;AAE5C,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,aAAa,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;AACF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC"}
1
+ {"version":3,"file":"code-tool-types.d.ts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,cAAc;AAE5C,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,aAAa,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC"}
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ fetch: (req: Request) => Promise<Response>;
3
+ };
4
+ export default _default;
5
+ //# sourceMappingURL=code-tool-worker.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-tool-worker.d.mts","sourceRoot":"","sources":["src/code-tool-worker.ts"],"names":[],"mappings":";iBA4S0B,OAAO,KAAG,OAAO,CAAC,QAAQ,CAAC;;AAsErD,wBAAyB"}
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ fetch: (req: Request) => Promise<Response>;
3
+ };
4
+ export default _default;
5
+ //# sourceMappingURL=code-tool-worker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-tool-worker.d.ts","sourceRoot":"","sources":["src/code-tool-worker.ts"],"names":[],"mappings":";iBA4S0B,OAAO,KAAG,OAAO,CAAC,QAAQ,CAAC;;AAsErD,wBAAyB"}
@@ -0,0 +1,325 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const node_path_1 = __importDefault(require("node:path"));
8
+ const node_util_1 = __importDefault(require("node:util"));
9
+ const fuse_js_1 = __importDefault(require("fuse.js"));
10
+ const typescript_1 = __importDefault(require("typescript"));
11
+ const dodopayments_1 = require("dodopayments");
12
+ function getRunFunctionSource(code) {
13
+ const sourceFile = typescript_1.default.createSourceFile('code.ts', code, typescript_1.default.ScriptTarget.Latest, true);
14
+ const printer = typescript_1.default.createPrinter();
15
+ for (const statement of sourceFile.statements) {
16
+ // Check for top-level function declarations
17
+ if (typescript_1.default.isFunctionDeclaration(statement)) {
18
+ if (statement.name?.text === 'run') {
19
+ return {
20
+ type: 'declaration',
21
+ client: statement.parameters[0]?.name.getText(),
22
+ code: printer.printNode(typescript_1.default.EmitHint.Unspecified, statement.body, sourceFile),
23
+ };
24
+ }
25
+ }
26
+ // Check for variable declarations: const run = () => {} or const run = function() {}
27
+ if (typescript_1.default.isVariableStatement(statement)) {
28
+ for (const declaration of statement.declarationList.declarations) {
29
+ if (typescript_1.default.isIdentifier(declaration.name) &&
30
+ declaration.name.text === 'run' &&
31
+ // Check if it's initialized with a function
32
+ declaration.initializer &&
33
+ (typescript_1.default.isFunctionExpression(declaration.initializer) || typescript_1.default.isArrowFunction(declaration.initializer))) {
34
+ return {
35
+ type: 'expression',
36
+ client: declaration.initializer.parameters[0]?.name.getText(),
37
+ code: printer.printNode(typescript_1.default.EmitHint.Unspecified, declaration.initializer, sourceFile),
38
+ };
39
+ }
40
+ }
41
+ }
42
+ }
43
+ return null;
44
+ }
45
+ function getTSDiagnostics(code) {
46
+ const functionSource = getRunFunctionSource(code);
47
+ const codeWithImport = [
48
+ 'import { DodoPayments } from "dodopayments";',
49
+ functionSource.type === 'declaration' ?
50
+ `async function run(${functionSource.client}: DodoPayments)`
51
+ : `const run: (${functionSource.client}: DodoPayments) => Promise<unknown> =`,
52
+ functionSource.code,
53
+ ].join('\n');
54
+ const sourcePath = node_path_1.default.resolve('code.ts');
55
+ const ast = typescript_1.default.createSourceFile(sourcePath, codeWithImport, typescript_1.default.ScriptTarget.Latest, true);
56
+ const options = typescript_1.default.getDefaultCompilerOptions();
57
+ options.target = typescript_1.default.ScriptTarget.Latest;
58
+ options.module = typescript_1.default.ModuleKind.NodeNext;
59
+ options.moduleResolution = typescript_1.default.ModuleResolutionKind.NodeNext;
60
+ const host = typescript_1.default.createCompilerHost(options, true);
61
+ const newHost = {
62
+ ...host,
63
+ getSourceFile: (...args) => {
64
+ if (node_path_1.default.resolve(args[0]) === sourcePath) {
65
+ return ast;
66
+ }
67
+ return host.getSourceFile(...args);
68
+ },
69
+ readFile: (...args) => {
70
+ if (node_path_1.default.resolve(args[0]) === sourcePath) {
71
+ return codeWithImport;
72
+ }
73
+ return host.readFile(...args);
74
+ },
75
+ fileExists: (...args) => {
76
+ if (node_path_1.default.resolve(args[0]) === sourcePath) {
77
+ return true;
78
+ }
79
+ return host.fileExists(...args);
80
+ },
81
+ };
82
+ const program = typescript_1.default.createProgram({
83
+ options,
84
+ rootNames: [sourcePath],
85
+ host: newHost,
86
+ });
87
+ const diagnostics = typescript_1.default.getPreEmitDiagnostics(program, ast);
88
+ return diagnostics.map((d) => {
89
+ const message = typescript_1.default.flattenDiagnosticMessageText(d.messageText, '\n');
90
+ if (!d.file || !d.start)
91
+ return `- ${message}`;
92
+ const { line: lineNumber } = typescript_1.default.getLineAndCharacterOfPosition(d.file, d.start);
93
+ const line = codeWithImport.split('\n').at(lineNumber)?.trim();
94
+ return line ? `- ${message}\n ${line}` : `- ${message}`;
95
+ });
96
+ }
97
+ const fuse = new fuse_js_1.default([
98
+ 'client.checkoutSessions.create',
99
+ 'client.checkoutSessions.preview',
100
+ 'client.checkoutSessions.retrieve',
101
+ 'client.payments.create',
102
+ 'client.payments.list',
103
+ 'client.payments.retrieve',
104
+ 'client.payments.retrieveLineItems',
105
+ 'client.subscriptions.changePlan',
106
+ 'client.subscriptions.charge',
107
+ 'client.subscriptions.create',
108
+ 'client.subscriptions.list',
109
+ 'client.subscriptions.previewChangePlan',
110
+ 'client.subscriptions.retrieve',
111
+ 'client.subscriptions.retrieveCreditUsage',
112
+ 'client.subscriptions.retrieveUsageHistory',
113
+ 'client.subscriptions.update',
114
+ 'client.subscriptions.updatePaymentMethod',
115
+ 'client.invoices.payments.retrieve',
116
+ 'client.invoices.payments.retrieveRefund',
117
+ 'client.licenses.activate',
118
+ 'client.licenses.deactivate',
119
+ 'client.licenses.validate',
120
+ 'client.licenseKeys.list',
121
+ 'client.licenseKeys.retrieve',
122
+ 'client.licenseKeys.update',
123
+ 'client.licenseKeyInstances.list',
124
+ 'client.licenseKeyInstances.retrieve',
125
+ 'client.licenseKeyInstances.update',
126
+ 'client.customers.create',
127
+ 'client.customers.list',
128
+ 'client.customers.listCreditEntitlements',
129
+ 'client.customers.retrieve',
130
+ 'client.customers.retrievePaymentMethods',
131
+ 'client.customers.update',
132
+ 'client.customers.customerPortal.create',
133
+ 'client.customers.wallets.list',
134
+ 'client.customers.wallets.ledgerEntries.create',
135
+ 'client.customers.wallets.ledgerEntries.list',
136
+ 'client.refunds.create',
137
+ 'client.refunds.list',
138
+ 'client.refunds.retrieve',
139
+ 'client.disputes.list',
140
+ 'client.disputes.retrieve',
141
+ 'client.payouts.list',
142
+ 'client.products.archive',
143
+ 'client.products.create',
144
+ 'client.products.list',
145
+ 'client.products.retrieve',
146
+ 'client.products.unarchive',
147
+ 'client.products.update',
148
+ 'client.products.updateFiles',
149
+ 'client.products.images.update',
150
+ 'client.products.shortLinks.create',
151
+ 'client.products.shortLinks.list',
152
+ 'client.misc.listSupportedCountries',
153
+ 'client.discounts.create',
154
+ 'client.discounts.delete',
155
+ 'client.discounts.list',
156
+ 'client.discounts.retrieve',
157
+ 'client.discounts.retrieveByCode',
158
+ 'client.discounts.update',
159
+ 'client.addons.create',
160
+ 'client.addons.list',
161
+ 'client.addons.retrieve',
162
+ 'client.addons.update',
163
+ 'client.addons.updateImages',
164
+ 'client.brands.create',
165
+ 'client.brands.list',
166
+ 'client.brands.retrieve',
167
+ 'client.brands.update',
168
+ 'client.brands.updateImages',
169
+ 'client.webhooks.create',
170
+ 'client.webhooks.delete',
171
+ 'client.webhooks.list',
172
+ 'client.webhooks.retrieve',
173
+ 'client.webhooks.retrieveSecret',
174
+ 'client.webhooks.unsafeUnwrap',
175
+ 'client.webhooks.unwrap',
176
+ 'client.webhooks.update',
177
+ 'client.webhooks.headers.retrieve',
178
+ 'client.webhooks.headers.update',
179
+ 'client.usageEvents.ingest',
180
+ 'client.usageEvents.list',
181
+ 'client.usageEvents.retrieve',
182
+ 'client.meters.archive',
183
+ 'client.meters.create',
184
+ 'client.meters.list',
185
+ 'client.meters.retrieve',
186
+ 'client.meters.unarchive',
187
+ 'client.balances.retrieveLedger',
188
+ 'client.creditEntitlements.create',
189
+ 'client.creditEntitlements.delete',
190
+ 'client.creditEntitlements.list',
191
+ 'client.creditEntitlements.retrieve',
192
+ 'client.creditEntitlements.undelete',
193
+ 'client.creditEntitlements.update',
194
+ 'client.creditEntitlements.balances.createLedgerEntry',
195
+ 'client.creditEntitlements.balances.list',
196
+ 'client.creditEntitlements.balances.listGrants',
197
+ 'client.creditEntitlements.balances.listLedger',
198
+ 'client.creditEntitlements.balances.retrieve',
199
+ ], { threshold: 1, shouldSort: true });
200
+ function getMethodSuggestions(fullyQualifiedMethodName) {
201
+ return fuse
202
+ .search(fullyQualifiedMethodName)
203
+ .map(({ item }) => item)
204
+ .slice(0, 5);
205
+ }
206
+ const proxyToObj = new WeakMap();
207
+ const objToProxy = new WeakMap();
208
+ function makeSdkProxy(obj, { path, isBelievedBad = false }) {
209
+ let proxy = objToProxy.get(obj);
210
+ if (!proxy) {
211
+ proxy = new Proxy(obj, {
212
+ get(target, prop, receiver) {
213
+ const propPath = [...path, String(prop)];
214
+ const value = Reflect.get(target, prop, receiver);
215
+ if (isBelievedBad || (!(prop in target) && value === undefined)) {
216
+ // If we're accessing a path that doesn't exist, it will probably eventually error.
217
+ // Let's proxy it and mark it bad so that we can control the error message.
218
+ // We proxy an empty class so that an invocation or construction attempt is possible.
219
+ return makeSdkProxy(class {
220
+ }, { path: propPath, isBelievedBad: true });
221
+ }
222
+ if (value !== null && (typeof value === 'object' || typeof value === 'function')) {
223
+ return makeSdkProxy(value, { path: propPath, isBelievedBad });
224
+ }
225
+ return value;
226
+ },
227
+ apply(target, thisArg, args) {
228
+ if (isBelievedBad || typeof target !== 'function') {
229
+ const fullyQualifiedMethodName = path.join('.');
230
+ const suggestions = getMethodSuggestions(fullyQualifiedMethodName);
231
+ throw new Error(`${fullyQualifiedMethodName} is not a function. Did you mean: ${suggestions.join(', ')}`);
232
+ }
233
+ return Reflect.apply(target, proxyToObj.get(thisArg) ?? thisArg, args);
234
+ },
235
+ construct(target, args, newTarget) {
236
+ if (isBelievedBad || typeof target !== 'function') {
237
+ const fullyQualifiedMethodName = path.join('.');
238
+ const suggestions = getMethodSuggestions(fullyQualifiedMethodName);
239
+ throw new Error(`${fullyQualifiedMethodName} is not a constructor. Did you mean: ${suggestions.join(', ')}`);
240
+ }
241
+ return Reflect.construct(target, args, newTarget);
242
+ },
243
+ });
244
+ objToProxy.set(obj, proxy);
245
+ proxyToObj.set(proxy, obj);
246
+ }
247
+ return proxy;
248
+ }
249
+ function parseError(code, error) {
250
+ if (!(error instanceof Error))
251
+ return;
252
+ const message = error.name ? `${error.name}: ${error.message}` : error.message;
253
+ try {
254
+ // Deno uses V8; the first "<anonymous>:LINE:COLUMN" is the top of stack.
255
+ const lineNumber = error.stack?.match(/<anonymous>:([0-9]+):[0-9]+/)?.[1];
256
+ // -1 for the zero-based indexing
257
+ const line = lineNumber &&
258
+ code
259
+ .split('\n')
260
+ .at(parseInt(lineNumber, 10) - 1)
261
+ ?.trim();
262
+ return line ? `${message}\n at line ${lineNumber}\n ${line}` : message;
263
+ }
264
+ catch {
265
+ return message;
266
+ }
267
+ }
268
+ const fetch = async (req) => {
269
+ const { opts, code } = (await req.json());
270
+ const runFunctionSource = code ? getRunFunctionSource(code) : null;
271
+ if (!runFunctionSource) {
272
+ const message = code ?
273
+ 'The code is missing a top-level `run` function.'
274
+ : 'The code argument is missing. Provide one containing a top-level `run` function.';
275
+ return Response.json({
276
+ is_error: true,
277
+ result: `${message} Write code within this template:\n\n\`\`\`\nasync function run(client) {\n // Fill this out\n}\n\`\`\``,
278
+ log_lines: [],
279
+ err_lines: [],
280
+ }, { status: 400, statusText: 'Code execution error' });
281
+ }
282
+ const diagnostics = getTSDiagnostics(code);
283
+ if (diagnostics.length > 0) {
284
+ return Response.json({
285
+ is_error: true,
286
+ result: `The code contains TypeScript diagnostics:\n${diagnostics.join('\n')}`,
287
+ log_lines: [],
288
+ err_lines: [],
289
+ }, { status: 400, statusText: 'Code execution error' });
290
+ }
291
+ const client = new dodopayments_1.DodoPayments({
292
+ ...opts,
293
+ });
294
+ const log_lines = [];
295
+ const err_lines = [];
296
+ const console = {
297
+ log: (...args) => {
298
+ log_lines.push(node_util_1.default.format(...args));
299
+ },
300
+ error: (...args) => {
301
+ err_lines.push(node_util_1.default.format(...args));
302
+ },
303
+ };
304
+ try {
305
+ let run_ = async (client) => { };
306
+ eval(`${code}\nrun_ = run;`);
307
+ const result = await run_(makeSdkProxy(client, { path: ['client'] }));
308
+ return Response.json({
309
+ is_error: false,
310
+ result,
311
+ log_lines,
312
+ err_lines,
313
+ });
314
+ }
315
+ catch (e) {
316
+ return Response.json({
317
+ is_error: true,
318
+ result: parseError(code, e),
319
+ log_lines,
320
+ err_lines,
321
+ }, { status: 400, statusText: 'Code execution error' });
322
+ }
323
+ };
324
+ exports.default = { fetch };
325
+ //# sourceMappingURL=code-tool-worker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-tool-worker.js","sourceRoot":"","sources":["src/code-tool-worker.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;AAEtF,0DAA6B;AAC7B,0DAA6B;AAC7B,sDAA2B;AAC3B,4DAA4B;AAE5B,+CAA2D;AAE3D,SAAS,oBAAoB,CAAC,IAAY;IAKxC,MAAM,UAAU,GAAG,oBAAE,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,EAAE,oBAAE,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACtF,MAAM,OAAO,GAAG,oBAAE,CAAC,aAAa,EAAE,CAAC;IAEnC,KAAK,MAAM,SAAS,IAAI,UAAU,CAAC,UAAU,EAAE,CAAC;QAC9C,4CAA4C;QAC5C,IAAI,oBAAE,CAAC,qBAAqB,CAAC,SAAS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