@velastack/patterns 0.0.19 → 0.0.21

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 (37) hide show
  1. package/README.md +12 -0
  2. package/dist/chunks/collections-OI0LQoJt.js +67 -0
  3. package/dist/chunks/collections-OI0LQoJt.js.map +1 -0
  4. package/dist/chunks/{env.runtime-C3E02sUH.js → env.runtime-CSAfqDu4.js} +2 -2
  5. package/dist/chunks/{env.runtime-C3E02sUH.js.map → env.runtime-CSAfqDu4.js.map} +1 -1
  6. package/dist/chunks/generate.runtime-BQFcrwn8.js +334 -0
  7. package/dist/chunks/generate.runtime-BQFcrwn8.js.map +1 -0
  8. package/dist/chunks/generate.runtime-BQg5E0LV.js +172 -0
  9. package/dist/chunks/generate.runtime-BQg5E0LV.js.map +1 -0
  10. package/dist/chunks/generate.runtime-C7g-zL0o.js.map +1 -1
  11. package/dist/chunks/generate.runtime-CEFyA2-Y.js +610 -0
  12. package/dist/chunks/generate.runtime-CEFyA2-Y.js.map +1 -0
  13. package/dist/chunks/{generate.runtime-DgtB6hP4.js → generate.runtime-ZXBZUjeH.js} +33 -10
  14. package/dist/chunks/generate.runtime-ZXBZUjeH.js.map +1 -0
  15. package/dist/chunks/{index-E6LAzq1d.js → index-9TLCLhJv.js} +2542 -2246
  16. package/dist/chunks/index-9TLCLhJv.js.map +1 -0
  17. package/dist/chunks/{pocketbase-BCvqw1Cr.js → pocketbase-Vk0YzqnQ.js} +50 -45
  18. package/dist/chunks/pocketbase-Vk0YzqnQ.js.map +1 -0
  19. package/dist/chunks/ts-morph-helpers-BNCluWTs.js +166 -0
  20. package/dist/chunks/ts-morph-helpers-BNCluWTs.js.map +1 -0
  21. package/dist/chunks/{write-result-CbUTMeAc.js → write-result-DmD7kWlV.js} +81 -70
  22. package/dist/chunks/write-result-DmD7kWlV.js.map +1 -0
  23. package/dist/index.d.ts +85 -0
  24. package/dist/index.js +1 -1
  25. package/package.json +16 -1
  26. package/dist/chunks/collections-CAafgIoZ.js +0 -62
  27. package/dist/chunks/collections-CAafgIoZ.js.map +0 -1
  28. package/dist/chunks/generate.runtime-C7YhHvlr.js +0 -353
  29. package/dist/chunks/generate.runtime-C7YhHvlr.js.map +0 -1
  30. package/dist/chunks/generate.runtime-DBTOrhnc.js +0 -633
  31. package/dist/chunks/generate.runtime-DBTOrhnc.js.map +0 -1
  32. package/dist/chunks/generate.runtime-DgtB6hP4.js.map +0 -1
  33. package/dist/chunks/generate.runtime-DoQkjIdl.js +0 -227
  34. package/dist/chunks/generate.runtime-DoQkjIdl.js.map +0 -1
  35. package/dist/chunks/index-E6LAzq1d.js.map +0 -1
  36. package/dist/chunks/pocketbase-BCvqw1Cr.js.map +0 -1
  37. package/dist/chunks/write-result-CbUTMeAc.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -9,6 +9,9 @@ export declare const byCategory: Record<"auth" | "generators" | "api" | "i18n",
9
9
  requires: {
10
10
  auth: false;
11
11
  api: false;
12
+ apiKeys: false;
13
+ i18n: false;
14
+ teams: false;
12
15
  payments: false;
13
16
  };
14
17
  category: "generators";
@@ -18,6 +21,7 @@ export declare const byCategory: Record<"auth" | "generators" | "api" | "i18n",
18
21
  base: string;
19
22
  argv: string[];
20
23
  };
24
+ tests: number;
21
25
  baseline: "velastack";
22
26
  generate: generate;
23
27
  } | {
@@ -31,6 +35,9 @@ export declare const byCategory: Record<"auth" | "generators" | "api" | "i18n",
31
35
  requires: {
32
36
  auth: false;
33
37
  api: false;
38
+ apiKeys: false;
39
+ i18n: false;
40
+ teams: false;
34
41
  payments: false;
35
42
  };
36
43
  category: "generators";
@@ -40,6 +47,7 @@ export declare const byCategory: Record<"auth" | "generators" | "api" | "i18n",
40
47
  base: string;
41
48
  argv: string[];
42
49
  };
50
+ tests: number;
43
51
  baseline: "velastack";
44
52
  generate: generate_2;
45
53
  } | {
@@ -53,6 +61,9 @@ export declare const byCategory: Record<"auth" | "generators" | "api" | "i18n",
53
61
  requires: {
54
62
  auth: false;
55
63
  api: false;
64
+ apiKeys: false;
65
+ i18n: false;
66
+ teams: false;
56
67
  payments: false;
57
68
  };
58
69
  category: "generators";
@@ -62,6 +73,7 @@ export declare const byCategory: Record<"auth" | "generators" | "api" | "i18n",
62
73
  base: string;
63
74
  argv: string[];
64
75
  };
76
+ tests: number;
65
77
  baseline: "velastack";
66
78
  generate: generate_3;
67
79
  } | {
@@ -75,6 +87,9 @@ export declare const byCategory: Record<"auth" | "generators" | "api" | "i18n",
75
87
  requires: {
76
88
  auth: false;
77
89
  api: false;
90
+ apiKeys: false;
91
+ i18n: false;
92
+ teams: false;
78
93
  payments: false;
79
94
  };
80
95
  category: "generators";
@@ -84,6 +99,7 @@ export declare const byCategory: Record<"auth" | "generators" | "api" | "i18n",
84
99
  base: string;
85
100
  argv: string[];
86
101
  };
102
+ tests: number;
87
103
  baseline: "velastack";
88
104
  generate: generate_4;
89
105
  } | {
@@ -97,6 +113,9 @@ export declare const byCategory: Record<"auth" | "generators" | "api" | "i18n",
97
113
  requires: {
98
114
  auth: false;
99
115
  api: false;
116
+ apiKeys: false;
117
+ i18n: false;
118
+ teams: false;
100
119
  payments: false;
101
120
  };
102
121
  category: "auth";
@@ -106,6 +125,7 @@ export declare const byCategory: Record<"auth" | "generators" | "api" | "i18n",
106
125
  base: string;
107
126
  argv: never[];
108
127
  };
128
+ tests: number;
109
129
  baseline: "velastack";
110
130
  generate: generate_5;
111
131
  } | {
@@ -119,6 +139,9 @@ export declare const byCategory: Record<"auth" | "generators" | "api" | "i18n",
119
139
  requires: {
120
140
  auth: false;
121
141
  api: false;
142
+ apiKeys: false;
143
+ i18n: false;
144
+ teams: false;
122
145
  payments: false;
123
146
  };
124
147
  category: "api";
@@ -128,6 +151,7 @@ export declare const byCategory: Record<"auth" | "generators" | "api" | "i18n",
128
151
  base: string;
129
152
  argv: never[];
130
153
  };
154
+ tests: number;
131
155
  baseline: "velastack";
132
156
  generate: generate_6;
133
157
  } | {
@@ -141,6 +165,9 @@ export declare const byCategory: Record<"auth" | "generators" | "api" | "i18n",
141
165
  requires: {
142
166
  auth: true;
143
167
  api: true;
168
+ apiKeys: false;
169
+ i18n: false;
170
+ teams: false;
144
171
  payments: false;
145
172
  };
146
173
  category: "api";
@@ -150,6 +177,7 @@ export declare const byCategory: Record<"auth" | "generators" | "api" | "i18n",
150
177
  base: string;
151
178
  argv: never[];
152
179
  };
180
+ tests: number;
153
181
  baseline: "velastack";
154
182
  generate: generate_7;
155
183
  } | {
@@ -163,6 +191,9 @@ export declare const byCategory: Record<"auth" | "generators" | "api" | "i18n",
163
191
  requires: {
164
192
  auth: false;
165
193
  api: false;
194
+ apiKeys: false;
195
+ i18n: false;
196
+ teams: false;
166
197
  payments: false;
167
198
  };
168
199
  category: "i18n";
@@ -172,6 +203,7 @@ export declare const byCategory: Record<"auth" | "generators" | "api" | "i18n",
172
203
  base: string;
173
204
  argv: never[];
174
205
  };
206
+ tests: number;
175
207
  baseline: "velastack";
176
208
  generate: generate_8;
177
209
  } | {
@@ -185,6 +217,9 @@ export declare const byCategory: Record<"auth" | "generators" | "api" | "i18n",
185
217
  requires: {
186
218
  auth: true;
187
219
  api: false;
220
+ apiKeys: false;
221
+ i18n: false;
222
+ teams: false;
188
223
  payments: false;
189
224
  };
190
225
  category: "auth";
@@ -194,6 +229,7 @@ export declare const byCategory: Record<"auth" | "generators" | "api" | "i18n",
194
229
  base: string;
195
230
  argv: never[];
196
231
  };
232
+ tests: number;
197
233
  baseline: "velastack";
198
234
  generate: generate_9;
199
235
  })[]>;
@@ -242,6 +278,9 @@ declare type Component = string;
242
278
  declare interface Features {
243
279
  auth: boolean;
244
280
  api: boolean;
281
+ apiKeys: boolean;
282
+ i18n: boolean;
283
+ teams: boolean;
245
284
  payments: boolean;
246
285
  }
247
286
 
@@ -292,6 +331,9 @@ export declare const patterns: ({
292
331
  requires: {
293
332
  auth: false;
294
333
  api: false;
334
+ apiKeys: false;
335
+ i18n: false;
336
+ teams: false;
295
337
  payments: false;
296
338
  };
297
339
  category: "generators";
@@ -301,6 +343,7 @@ export declare const patterns: ({
301
343
  base: string;
302
344
  argv: string[];
303
345
  };
346
+ tests: number;
304
347
  baseline: "velastack";
305
348
  generate: generate;
306
349
  } | {
@@ -314,6 +357,9 @@ export declare const patterns: ({
314
357
  requires: {
315
358
  auth: false;
316
359
  api: false;
360
+ apiKeys: false;
361
+ i18n: false;
362
+ teams: false;
317
363
  payments: false;
318
364
  };
319
365
  category: "generators";
@@ -323,6 +369,7 @@ export declare const patterns: ({
323
369
  base: string;
324
370
  argv: string[];
325
371
  };
372
+ tests: number;
326
373
  baseline: "velastack";
327
374
  generate: generate_2;
328
375
  } | {
@@ -336,6 +383,9 @@ export declare const patterns: ({
336
383
  requires: {
337
384
  auth: false;
338
385
  api: false;
386
+ apiKeys: false;
387
+ i18n: false;
388
+ teams: false;
339
389
  payments: false;
340
390
  };
341
391
  category: "generators";
@@ -345,6 +395,7 @@ export declare const patterns: ({
345
395
  base: string;
346
396
  argv: string[];
347
397
  };
398
+ tests: number;
348
399
  baseline: "velastack";
349
400
  generate: generate_3;
350
401
  } | {
@@ -358,6 +409,9 @@ export declare const patterns: ({
358
409
  requires: {
359
410
  auth: false;
360
411
  api: false;
412
+ apiKeys: false;
413
+ i18n: false;
414
+ teams: false;
361
415
  payments: false;
362
416
  };
363
417
  category: "generators";
@@ -367,6 +421,7 @@ export declare const patterns: ({
367
421
  base: string;
368
422
  argv: string[];
369
423
  };
424
+ tests: number;
370
425
  baseline: "velastack";
371
426
  generate: generate_4;
372
427
  } | {
@@ -380,6 +435,9 @@ export declare const patterns: ({
380
435
  requires: {
381
436
  auth: false;
382
437
  api: false;
438
+ apiKeys: false;
439
+ i18n: false;
440
+ teams: false;
383
441
  payments: false;
384
442
  };
385
443
  category: "auth";
@@ -389,6 +447,7 @@ export declare const patterns: ({
389
447
  base: string;
390
448
  argv: never[];
391
449
  };
450
+ tests: number;
392
451
  baseline: "velastack";
393
452
  generate: generate_5;
394
453
  } | {
@@ -402,6 +461,9 @@ export declare const patterns: ({
402
461
  requires: {
403
462
  auth: false;
404
463
  api: false;
464
+ apiKeys: false;
465
+ i18n: false;
466
+ teams: false;
405
467
  payments: false;
406
468
  };
407
469
  category: "api";
@@ -411,6 +473,7 @@ export declare const patterns: ({
411
473
  base: string;
412
474
  argv: never[];
413
475
  };
476
+ tests: number;
414
477
  baseline: "velastack";
415
478
  generate: generate_6;
416
479
  } | {
@@ -424,6 +487,9 @@ export declare const patterns: ({
424
487
  requires: {
425
488
  auth: true;
426
489
  api: true;
490
+ apiKeys: false;
491
+ i18n: false;
492
+ teams: false;
427
493
  payments: false;
428
494
  };
429
495
  category: "api";
@@ -433,6 +499,7 @@ export declare const patterns: ({
433
499
  base: string;
434
500
  argv: never[];
435
501
  };
502
+ tests: number;
436
503
  baseline: "velastack";
437
504
  generate: generate_7;
438
505
  } | {
@@ -446,6 +513,9 @@ export declare const patterns: ({
446
513
  requires: {
447
514
  auth: false;
448
515
  api: false;
516
+ apiKeys: false;
517
+ i18n: false;
518
+ teams: false;
449
519
  payments: false;
450
520
  };
451
521
  category: "i18n";
@@ -455,6 +525,7 @@ export declare const patterns: ({
455
525
  base: string;
456
526
  argv: never[];
457
527
  };
528
+ tests: number;
458
529
  baseline: "velastack";
459
530
  generate: generate_8;
460
531
  } | {
@@ -468,6 +539,9 @@ export declare const patterns: ({
468
539
  requires: {
469
540
  auth: true;
470
541
  api: false;
542
+ apiKeys: false;
543
+ i18n: false;
544
+ teams: false;
471
545
  payments: false;
472
546
  };
473
547
  category: "auth";
@@ -477,6 +551,7 @@ export declare const patterns: ({
477
551
  base: string;
478
552
  argv: never[];
479
553
  };
554
+ tests: number;
480
555
  baseline: "velastack";
481
556
  generate: generate_9;
482
557
  })[];
@@ -495,3 +570,13 @@ export declare type Slug = PatternEntry["slug"];
495
570
  export declare const version: string;
496
571
 
497
572
  export { }
573
+
574
+
575
+ declare module "vitest" {
576
+ interface Matchers<T = any> extends CustomMatchers<T> {
577
+ }
578
+ interface Assertion<T = any> extends CustomMatchers<T> {
579
+ }
580
+ interface AsymmetricMatchersContaining extends CustomMatchers {
581
+ }
582
+ }
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { b as r, a as e, p as o, v as t } from "./chunks/index-E6LAzq1d.js";
1
+ import { b as r, a as e, p as o, v as t } from "./chunks/index-9TLCLhJv.js";
2
2
  export {
3
3
  r as byCategory,
4
4
  e as bySlug,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velastack/patterns",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./dist/index.js",
@@ -12,6 +12,10 @@
12
12
  "build": "vite build",
13
13
  "dev": "vite build --watch",
14
14
  "clean": "rm -rf dist",
15
+ "demo": "vite-node scripts/demo.ts --",
16
+ "lint": "npm run lint:ts && npm run lint:format",
17
+ "lint:ts": "tsc --noEmit",
18
+ "lint:format": "prettier --check .",
15
19
  "test": "vitest run --exclude **/integration.test.ts",
16
20
  "test:watch": "vitest --watch --exclude **/integration.test.ts",
17
21
  "test:integration": "vitest run **/integration.test.ts"
@@ -23,8 +27,10 @@
23
27
  "peerDependencies": {
24
28
  "@velastack/pocketbase": "^0.0.44",
25
29
  "cross-spawn": "^7.0.6",
30
+ "magic-string": "^0.30.0",
26
31
  "package-manager-detector": "^1.6.0",
27
32
  "pocketbase": "^0.26.8",
33
+ "svelte": "^5.0.0",
28
34
  "ts-morph": "^28.0.0"
29
35
  },
30
36
  "peerDependenciesMeta": {
@@ -34,12 +40,18 @@
34
40
  "cross-spawn": {
35
41
  "optional": true
36
42
  },
43
+ "magic-string": {
44
+ "optional": true
45
+ },
37
46
  "package-manager-detector": {
38
47
  "optional": true
39
48
  },
40
49
  "pocketbase": {
41
50
  "optional": true
42
51
  },
52
+ "svelte": {
53
+ "optional": true
54
+ },
43
55
  "ts-morph": {
44
56
  "optional": true
45
57
  }
@@ -52,12 +64,15 @@
52
64
  "change-case": "^5.4.4",
53
65
  "cross-spawn": "^7.0.6",
54
66
  "dedent": "^1.7.2",
67
+ "magic-string": "^0.30.21",
55
68
  "package-manager-detector": "^1.6.0",
56
69
  "pluralize": "^8.0.0",
57
70
  "pocketbase": "^0.26.8",
71
+ "svelte": "^5.55.4",
58
72
  "ts-morph": "^28.0.0",
59
73
  "typescript": "^5.0.0",
60
74
  "vite": "^6.0.0",
75
+ "vite-node": "^6.0.0",
61
76
  "vite-plugin-dts": "^4.4.0",
62
77
  "vitest": "^4.1.4"
63
78
  }
@@ -1,62 +0,0 @@
1
- import { readFileSync as s } from "node:fs";
2
- import { l as u } from "./index-E6LAzq1d.js";
3
- import { w as d, g as c } from "./pocketbase-BCvqw1Cr.js";
4
- function f(e) {
5
- var n, l, o, i;
6
- if (((o = (l = (n = e.response) == null ? void 0 : n.data) == null ? void 0 : l.name) == null ? void 0 : o.code) === "validation_not_unique")
7
- return !0;
8
- const t = ((i = e.message) == null ? void 0 : i.toLowerCase()) ?? "";
9
- return t.includes("already exists") || t.includes("must be unique");
10
- }
11
- function m(e) {
12
- const t = {};
13
- return e.listRule !== void 0 && (t.listRule = e.listRule), e.viewRule !== void 0 && (t.viewRule = e.viewRule), e.createRule !== void 0 && (t.createRule = e.createRule), e.updateRule !== void 0 && (t.updateRule = e.updateRule), e.deleteRule !== void 0 && (t.deleteRule = e.deleteRule), t;
14
- }
15
- async function y(e, t, n) {
16
- const l = [];
17
- for (const o of t) {
18
- const i = o.collectionName.replace(/'/g, "''"), a = await e.collections.getFirstListItem(`name='${i}'`);
19
- if (await e.collections.update(a.id, m(o)), n) {
20
- const r = c(
21
- o.collectionName,
22
- "updated",
23
- n
24
- );
25
- r && l.push({
26
- path: r,
27
- language: u(r),
28
- content: s(r, "utf8")
29
- });
30
- }
31
- }
32
- return l;
33
- }
34
- async function v(e, t) {
35
- if (e.length === 0)
36
- return [];
37
- const n = [];
38
- return await d(t.root, async (l) => {
39
- for (const o of e) {
40
- try {
41
- await l.collections.create(o);
42
- } catch (a) {
43
- throw f(
44
- a
45
- ) ? new Error(
46
- `Collection "${o.name}" already exists. Choose a different model name or remove the existing collection first.`
47
- ) : a;
48
- }
49
- const i = c(o.name, "created", t);
50
- i && n.push({
51
- path: i,
52
- language: u(i),
53
- content: s(i, "utf8")
54
- });
55
- }
56
- }), n;
57
- }
58
- export {
59
- y as applyCollectionRulePatches,
60
- v as createCollections
61
- };
62
- //# sourceMappingURL=collections-CAafgIoZ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collections-CAafgIoZ.js","sources":["../../src/runtime/collections.ts"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport type {\n CollectionRulesPatch,\n CollectionSpec,\n File,\n Options,\n} from \"../core/types\";\nimport { languageFromPath } from \"../core/util\";\nimport { getMigrationFile, withPocketbase } from \"./pocketbase\";\n\ninterface PocketBaseCollectionCreateError {\n response?: {\n data?: {\n name?: {\n code?: string;\n };\n };\n };\n message?: string;\n}\n\nfunction isCollectionAlreadyExistsError(\n error: PocketBaseCollectionCreateError,\n): boolean {\n if (error.response?.data?.name?.code === \"validation_not_unique\") {\n return true;\n }\n\n const message = error.message?.toLowerCase() ?? \"\";\n return message.includes(\"already exists\") || message.includes(\"must be unique\");\n}\n\nfunction rulePayloadFromPatch(patch: CollectionRulesPatch): Record<string, unknown> {\n const payload: Record<string, unknown> = {};\n if (patch.listRule !== undefined) payload.listRule = patch.listRule;\n if (patch.viewRule !== undefined) payload.viewRule = patch.viewRule;\n if (patch.createRule !== undefined) payload.createRule = patch.createRule;\n if (patch.updateRule !== undefined) payload.updateRule = patch.updateRule;\n if (patch.deleteRule !== undefined) payload.deleteRule = patch.deleteRule;\n return payload;\n}\n\n/**\n * Applies API rule updates in array order. Call after all referenced collections exist.\n * Collects migration files produced by each update when `options` is provided.\n */\nexport async function applyCollectionRulePatches(\n pb: {\n collections: {\n getFirstListItem: (filter: string) => Promise<{ id: string }>;\n update: (id: string, body: Record<string, unknown>) => Promise<unknown>;\n };\n },\n patches: CollectionRulesPatch[],\n options?: Options,\n): Promise<File[]> {\n const migrations: File[] = [];\n\n for (const patch of patches) {\n const escaped = patch.collectionName.replace(/'/g, \"''\");\n const col = await pb.collections.getFirstListItem(`name='${escaped}'`);\n await pb.collections.update(col.id, rulePayloadFromPatch(patch));\n\n if (options) {\n const migrationFile = getMigrationFile(\n patch.collectionName,\n \"updated\",\n options,\n );\n if (migrationFile) {\n migrations.push({\n path: migrationFile,\n language: languageFromPath(migrationFile),\n content: readFileSync(migrationFile, \"utf8\"),\n });\n }\n }\n }\n\n return migrations;\n}\n\nexport async function createCollections(\n collections: CollectionSpec[],\n options: Options,\n): Promise<File[]> {\n if (collections.length === 0) {\n return [];\n }\n\n const migrations: File[] = [];\n\n await withPocketbase(options.root, async (pb) => {\n for (const collection of collections) {\n try {\n await pb.collections.create(collection);\n } catch (error) {\n if (\n isCollectionAlreadyExistsError(\n error as PocketBaseCollectionCreateError,\n )\n ) {\n throw new Error(\n `Collection \"${collection.name}\" already exists. Choose a different model name or remove the existing collection first.`,\n );\n }\n throw error;\n }\n\n const migrationFile = getMigrationFile(collection.name, \"created\", options);\n if (!migrationFile) {\n continue;\n }\n\n migrations.push({\n path: migrationFile,\n language: languageFromPath(migrationFile),\n content: readFileSync(migrationFile, \"utf8\"),\n });\n }\n });\n\n return migrations;\n}\n"],"names":["isCollectionAlreadyExistsError","error","_c","_b","_a","message","_d","rulePayloadFromPatch","patch","payload","applyCollectionRulePatches","pb","patches","options","migrations","escaped","col","migrationFile","getMigrationFile","languageFromPath","readFileSync","createCollections","collections","withPocketbase","collection"],"mappings":";;;AAqBA,SAASA,EACPC,GACS;;AACT,QAAIC,KAAAC,KAAAC,IAAAH,EAAM,aAAN,gBAAAG,EAAgB,SAAhB,gBAAAD,EAAsB,SAAtB,gBAAAD,EAA4B,UAAS;AACvC,WAAO;AAGT,QAAMG,MAAUC,IAAAL,EAAM,YAAN,gBAAAK,EAAe,kBAAiB;AAChD,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