@rebasepro/codegen 0.9.1-canary.fd3754b → 0.10.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.
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@rebasepro/codegen",
3
- "version": "0.9.1-canary.fd3754b",
3
+ "version": "0.10.0",
4
4
  "description": "Generate a typed JS SDK from Rebase collection definitions",
5
- "main": "./dist/index.cjs",
5
+ "main": "./dist/index.es.js",
6
6
  "module": "./dist/index.es.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "type": "module",
@@ -22,8 +22,8 @@
22
22
  "author": "rebase.pro",
23
23
  "license": "MIT",
24
24
  "peerDependencies": {
25
- "@rebasepro/types": "0.9.1-canary.fd3754b",
26
- "@rebasepro/common": "0.9.1-canary.fd3754b"
25
+ "@rebasepro/common": "0.10.0",
26
+ "@rebasepro/types": "0.10.0"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@jest/globals": "^30.4.1",
@@ -33,19 +33,18 @@
33
33
  "ts-jest": "^29.4.11",
34
34
  "typescript": "^6.0.3",
35
35
  "vite": "^8.0.16",
36
- "@rebasepro/common": "0.9.1-canary.fd3754b",
37
- "@rebasepro/types": "0.9.1-canary.fd3754b"
36
+ "@rebasepro/common": "0.10.0",
37
+ "@rebasepro/types": "0.10.0"
38
38
  },
39
39
  "exports": {
40
40
  ".": {
41
41
  "types": "./dist/index.d.ts",
42
- "import": "./dist/index.es.js",
43
- "require": "./dist/index.cjs"
42
+ "import": "./dist/index.es.js"
44
43
  }
45
44
  },
46
45
  "gitHead": "d935eefa5aa8d1009a2398cfac2c1e4ee9aeb6b6",
47
46
  "dependencies": {
48
- "@rebasepro/client": "0.9.1-canary.fd3754b"
47
+ "@rebasepro/client": "0.10.0"
49
48
  },
50
49
  "repository": {
51
50
  "type": "git",
@@ -54,7 +53,7 @@
54
53
  },
55
54
  "scripts": {
56
55
  "test": "jest --config jest.config.cjs",
57
- "build": "vite build && tsc --emitDeclarationOnly -p tsconfig.prod.json",
56
+ "build": "vite build && tsc --emitDeclarationOnly -p tsconfig.prod.json && node ../../scripts/assert-build-output.mjs",
58
57
  "clean": "rm -rf dist && find ./src -name '*.js' -type f | xargs rm -f"
59
58
  }
60
59
  }
package/dist/index.cjs DELETED
@@ -1,227 +0,0 @@
1
- (function(global, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@rebasepro/common")) : typeof define === "function" && define.amd ? define(["exports", "@rebasepro/common"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.RebaseSDKGenerator = {}, global._rebasepro_common));
3
- })(this, function(exports, _rebasepro_common) {
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
5
- //#region src/utils.ts
6
- /**
7
- * Utility functions for the SDK generator
8
- */
9
- /**
10
- * Convert a slug/snake_case string to PascalCase
11
- * e.g. "private_notes" → "PrivateNotes"
12
- */
13
- function toPascalCase(str) {
14
- return str.split(/[_\-\s]+/).map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join("");
15
- }
16
- /**
17
- * Convert a slug/snake_case string to camelCase
18
- * e.g. "private_notes" → "privateNotes"
19
- */
20
- function toCamelCase(str) {
21
- if (!/[_\-\s]/.test(str)) return str.charAt(0).toLowerCase() + str.slice(1);
22
- const pascal = toPascalCase(str);
23
- return pascal.charAt(0).toLowerCase() + pascal.slice(1);
24
- }
25
- /**
26
- * Convert a slug to a safe JS identifier
27
- * e.g. "private-notes" → "privateNotes"
28
- */
29
- function toSafeIdentifier(str) {
30
- return toCamelCase(str.replace(/[^a-zA-Z0-9_]/g, "_"));
31
- }
32
- /**
33
- * Indent a block of text by a given number of spaces
34
- */
35
- function indent(text, spaces) {
36
- const pad = " ".repeat(spaces);
37
- return text.split("\n").map((line) => line.trim() ? pad + line : line).join("\n");
38
- }
39
- //#endregion
40
- //#region src/generate-types.ts
41
- function propertyToTypeScriptType(prop) {
42
- switch (prop.type) {
43
- case "string": {
44
- const sp = prop;
45
- if (sp.enum) return (Array.isArray(sp.enum) ? sp.enum.map((e) => typeof e === "object" ? String(e.id) : String(e)) : Object.keys(sp.enum)).map((v) => `"${v}"`).join(" | ");
46
- return "string";
47
- }
48
- case "number": {
49
- const np = prop;
50
- if (np.enum) return (Array.isArray(np.enum) ? np.enum.map((e) => typeof e === "object" ? String(e.id) : String(e)) : Object.keys(np.enum)).join(" | ");
51
- return "number";
52
- }
53
- case "boolean": return "boolean";
54
- case "date": return "string";
55
- case "geopoint": return "{ latitude: number; longitude: number; }";
56
- case "reference": return "string | number";
57
- case "relation": return "string | number";
58
- case "map": {
59
- const mapProp = prop;
60
- if (mapProp.properties) return `{ ${Object.entries(mapProp.properties).map(([k, v]) => `${toSafeIdentifier(k)}: ${propertyToTypeScriptType(v)};`).join(" ")} }`;
61
- return "Record<string, unknown>";
62
- }
63
- case "array": {
64
- const arrProp = prop;
65
- if (arrProp.of) return `Array<${propertyToTypeScriptType(arrProp.of)}>`;
66
- return "Array<unknown>";
67
- }
68
- case "vector": return "number[]";
69
- case "binary": return "string";
70
- default: return "unknown";
71
- }
72
- }
73
- function generateTypedefs(collections) {
74
- const lines = [
75
- "/**",
76
- " * This file was auto-generated by Rebase.",
77
- " * Do not make direct changes to the file.",
78
- " */",
79
- "",
80
- "export interface Database {"
81
- ];
82
- for (const collection of collections) {
83
- toPascalCase(collection.slug);
84
- const properties = collection.properties ?? {};
85
- let resolvedRelations = {};
86
- try {
87
- resolvedRelations = (0, _rebasepro_common.resolveCollectionRelations)(collection);
88
- } catch {}
89
- lines.push(` ${toSafeIdentifier(collection.slug)}: {`);
90
- lines.push(" Row: {");
91
- const emittedKeys = /* @__PURE__ */ new Set();
92
- for (const [key, rawProp] of Object.entries(properties)) {
93
- const prop = rawProp;
94
- if (prop.type === "relation") continue;
95
- const tsType = propertyToTypeScriptType(prop);
96
- const isRequired = prop.validation?.required;
97
- lines.push(` ${toSafeIdentifier(key)}${isRequired ? "" : "?"}: ${tsType};`);
98
- emittedKeys.add(key);
99
- }
100
- for (const [relKey, relation] of Object.entries(resolvedRelations)) if (relation.direction === "owning" && relation.cardinality === "one" && relation.localKey) {
101
- const fkKey = relation.localKey;
102
- if (emittedKeys.has(fkKey)) continue;
103
- let fkType = "string | number";
104
- try {
105
- let target = relation.target();
106
- if (target && (target.default || target.__esModule)) target = target.default || target;
107
- if (target && target.properties) {
108
- const idProp = Object.entries(target.properties).find(([_, p]) => p.isId);
109
- if (idProp) fkType = idProp[1].type === "number" ? "number" : "string";
110
- }
111
- } catch {}
112
- const isRequired = relation.validation?.required;
113
- lines.push(` ${toSafeIdentifier(fkKey)}${isRequired ? "" : "?"}: ${fkType};`);
114
- emittedKeys.add(fkKey);
115
- }
116
- for (const [key, rawProp] of Object.entries(properties)) if (rawProp.type === "relation") {
117
- if (emittedKeys.has(key)) continue;
118
- const isArray = resolvedRelations[key]?.cardinality === "many";
119
- const relType = "{ id: string | number; path: string; __type: \"relation\"; data?: unknown }";
120
- const tsType = isArray ? `Array<${relType}>` : relType;
121
- lines.push(` ${toSafeIdentifier(key)}?: ${tsType};`);
122
- emittedKeys.add(key);
123
- }
124
- lines.push(" };");
125
- lines.push(" Insert: {");
126
- emittedKeys.clear();
127
- for (const [key, rawProp] of Object.entries(properties)) {
128
- const prop = rawProp;
129
- if (prop.type === "relation") continue;
130
- const tsType = propertyToTypeScriptType(prop);
131
- const isRequired = prop.validation?.required;
132
- const typedProp = prop;
133
- const isAutoId = "isId" in prop && typedProp.isId && typedProp.isId !== "manual" && typedProp.isId !== true;
134
- const isOptional = !isRequired || isAutoId;
135
- lines.push(` ${toSafeIdentifier(key)}${isOptional ? "?" : ""}: ${tsType};`);
136
- emittedKeys.add(key);
137
- }
138
- for (const [relKey, relation] of Object.entries(resolvedRelations)) if (relation.direction === "owning" && relation.cardinality === "one" && relation.localKey) {
139
- const fkKey = relation.localKey;
140
- if (emittedKeys.has(fkKey)) continue;
141
- const fkType = "string | number";
142
- const isRequired = relation.validation?.required;
143
- lines.push(` ${toSafeIdentifier(fkKey)}${isRequired ? "" : "?"}: ${fkType};`);
144
- emittedKeys.add(fkKey);
145
- }
146
- lines.push(" };");
147
- lines.push(" Update: {");
148
- emittedKeys.clear();
149
- for (const [key, rawProp] of Object.entries(properties)) {
150
- const prop = rawProp;
151
- if (prop.type === "relation") continue;
152
- const tsType = propertyToTypeScriptType(prop);
153
- lines.push(` ${toSafeIdentifier(key)}?: ${tsType};`);
154
- emittedKeys.add(key);
155
- }
156
- for (const [relKey, relation] of Object.entries(resolvedRelations)) if (relation.direction === "owning" && relation.cardinality === "one" && relation.localKey) {
157
- const fkKey = relation.localKey;
158
- if (emittedKeys.has(fkKey)) continue;
159
- lines.push(` ${toSafeIdentifier(fkKey)}?: string | number;`);
160
- emittedKeys.add(fkKey);
161
- }
162
- lines.push(" };");
163
- lines.push(" };");
164
- }
165
- lines.push("}");
166
- lines.push("");
167
- lines.push("export type CollectionName = keyof Database;");
168
- lines.push("export type CollectionsDictionary = { [K in CollectionName]: K };");
169
- lines.push("");
170
- lines.push("export const collectionsDictionary = {");
171
- for (const collection of collections) lines.push(` ${toSafeIdentifier(collection.slug)}: "${collection.slug}",`);
172
- lines.push("} as const;");
173
- lines.push("");
174
- return lines.join("\n");
175
- }
176
- //#endregion
177
- //#region src/index.ts
178
- function generateSDK(collections, options = {}) {
179
- const files = [];
180
- files.push({
181
- path: "database.types.ts",
182
- content: generateTypedefs(collections)
183
- });
184
- if (options.includeReadme !== false) files.push({
185
- path: "README.md",
186
- content: `# Rebase SDK
187
-
188
- > Auto-generated by \`rebase generate-sdk\`. Do not edit manually.
189
-
190
- ## Usage
191
-
192
- 1. Install the client package:
193
- \`\`\`bash
194
- npm install @rebasepro/client
195
- \`\`\`
196
-
197
- 2. Initialize with your generated types:
198
- \`\`\`typescript
199
- import { createRebaseClient } from '@rebasepro/client';
200
- import { Database, collectionsDictionary } from './database.types';
201
-
202
- const rebase = createRebaseClient<Database>({
203
- baseUrl: 'http://localhost:3001',
204
- collections: collectionsDictionary,
205
- });
206
-
207
- // Both syntax styles are fully typed!
208
- const { data: users } = await rebase.data.users.find();
209
- console.log(users[0].email); // flat access — no .values wrapper
210
-
211
- const { data: posts } = await rebase.data.collection('posts').find();
212
- console.log(posts[0].title); // just post.title, not post.values.title
213
- \`\`\`
214
- `
215
- });
216
- return files;
217
- }
218
- //#endregion
219
- exports.generateSDK = generateSDK;
220
- exports.generateTypedefs = generateTypedefs;
221
- exports.indent = indent;
222
- exports.toCamelCase = toCamelCase;
223
- exports.toPascalCase = toPascalCase;
224
- exports.toSafeIdentifier = toSafeIdentifier;
225
- });
226
-
227
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../src/utils.ts","../src/generate-types.ts","../src/index.ts"],"sourcesContent":["/**\n * Utility functions for the SDK generator\n */\n\n/**\n * Convert a slug/snake_case string to PascalCase\n * e.g. \"private_notes\" → \"PrivateNotes\"\n */\nexport function toPascalCase(str: string): string {\n return str\n .split(/[_\\-\\s]+/)\n .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(\"\");\n}\n\n/**\n * Convert a slug/snake_case string to camelCase\n * e.g. \"private_notes\" → \"privateNotes\"\n */\nexport function toCamelCase(str: string): string {\n if (!/[_\\-\\s]/.test(str)) {\n return str.charAt(0).toLowerCase() + str.slice(1);\n }\n const pascal = toPascalCase(str);\n return pascal.charAt(0).toLowerCase() + pascal.slice(1);\n}\n\n/**\n * Convert a slug to a safe JS identifier\n * e.g. \"private-notes\" → \"privateNotes\"\n */\nexport function toSafeIdentifier(str: string): string {\n return toCamelCase(str.replace(/[^a-zA-Z0-9_]/g, \"_\"));\n}\n\n/**\n * Indent a block of text by a given number of spaces\n */\nexport function indent(text: string, spaces: number): string {\n const pad = \" \".repeat(spaces);\n return text\n .split(\"\\n\")\n .map(line => (line.trim() ? pad + line : line))\n .join(\"\\n\");\n}\n","import { CollectionConfig, PostgresCollectionConfig, Property, Properties, MapProperty, ArrayProperty, Relation, RelationProperty, StringProperty, NumberProperty } from \"@rebasepro/types\";\nimport { resolveCollectionRelations } from \"@rebasepro/common\";\nimport { toPascalCase, toSafeIdentifier } from \"./utils\";\n\nfunction propertyToTypeScriptType(prop: Property): string {\n switch (prop.type) {\n case \"string\": {\n const sp = prop as StringProperty;\n if (sp.enum) {\n const ids = Array.isArray(sp.enum)\n ? sp.enum.map((e: string | number | { id: string | number }) => typeof e === \"object\" ? String(e.id) : String(e))\n : Object.keys(sp.enum);\n return ids.map(v => `\"${v}\"`).join(\" | \");\n }\n return \"string\";\n }\n case \"number\": {\n const np = prop as NumberProperty;\n if (np.enum) {\n const ids = Array.isArray(np.enum)\n ? np.enum.map((e: string | number | { id: string | number }) => typeof e === \"object\" ? String(e.id) : String(e))\n : Object.keys(np.enum);\n return ids.join(\" | \");\n }\n return \"number\";\n }\n case \"boolean\":\n return \"boolean\";\n case \"date\":\n return \"string\"; // ISO 8601 string over the wire\n case \"geopoint\":\n return \"{ latitude: number; longitude: number; }\";\n case \"reference\":\n return \"string | number\";\n case \"relation\":\n return \"string | number\";\n case \"map\": {\n const mapProp = prop as MapProperty;\n if (mapProp.properties) {\n const inner = Object.entries(mapProp.properties)\n .map(([k, v]) => `${toSafeIdentifier(k)}: ${propertyToTypeScriptType(v as Property)};`)\n .join(\" \");\n return `{ ${inner} }`;\n }\n return \"Record<string, unknown>\";\n }\n case \"array\": {\n const arrProp = prop as ArrayProperty;\n if (arrProp.of) {\n return `Array<${propertyToTypeScriptType(arrProp.of as Property)}>`;\n }\n return \"Array<unknown>\";\n }\n case \"vector\":\n return \"number[]\";\n case \"binary\":\n return \"string\";\n default:\n return \"unknown\";\n }\n}\n\nexport function generateTypedefs(collections: CollectionConfig[]): string {\n const lines: string[] = [\n \"/**\",\n \" * This file was auto-generated by Rebase.\",\n \" * Do not make direct changes to the file.\",\n \" */\",\n \"\",\n \"export interface Database {\"\n ];\n\n for (const collection of collections) {\n const typeName = toPascalCase(collection.slug);\n const properties = (collection.properties ?? {}) as Properties;\n\n // Resolve relations\n let resolvedRelations: Record<string, Relation> = {};\n try {\n resolvedRelations = resolveCollectionRelations(collection);\n } catch { /* ignore */ }\n\n lines.push(` ${toSafeIdentifier(collection.slug)}: {`);\n\n // ── Row Type ──\n lines.push(\" Row: {\");\n const emittedKeys = new Set<string>();\n\n // 1. Direct properties\n for (const [key, rawProp] of Object.entries(properties)) {\n const prop = rawProp as Property;\n if (prop.type === \"relation\") continue;\n\n const tsType = propertyToTypeScriptType(prop);\n const isRequired = prop.validation?.required;\n lines.push(` ${toSafeIdentifier(key)}${isRequired ? \"\" : \"?\"}: ${tsType};`);\n emittedKeys.add(key);\n }\n\n // 2. FK columns from relations\n for (const [relKey, relation] of Object.entries(resolvedRelations)) {\n if (relation.direction === \"owning\" && relation.cardinality === \"one\" && relation.localKey) {\n const fkKey = relation.localKey;\n if (emittedKeys.has(fkKey)) continue;\n\n let fkType = \"string | number\";\n try {\n let target = relation.target();\n if (target && (target.default || target.__esModule)) {\n target = target.default || target;\n }\n if (target && target.properties) {\n const idProp = Object.entries(target.properties).find(([_, p]) => (p as Record<string, unknown>).isId);\n if (idProp) {\n fkType = (idProp[1] as Property).type === \"number\" ? \"number\" : \"string\";\n }\n }\n } catch { /* ignore */ }\n\n const isRequired = relation.validation?.required;\n lines.push(` ${toSafeIdentifier(fkKey)}${isRequired ? \"\" : \"?\"}: ${fkType};`);\n emittedKeys.add(fkKey);\n }\n }\n\n // 3. Relation fields\n for (const [key, rawProp] of Object.entries(properties)) {\n const prop = rawProp as Property;\n if (prop.type === \"relation\") {\n if (emittedKeys.has(key)) continue;\n const relation = resolvedRelations[key];\n const isArray = relation?.cardinality === \"many\";\n const relType = \"{ id: string | number; path: string; __type: \\\"relation\\\"; data?: unknown }\";\n const tsType = isArray ? `Array<${relType}>` : relType;\n lines.push(` ${toSafeIdentifier(key)}?: ${tsType};`);\n emittedKeys.add(key);\n }\n }\n lines.push(\" };\");\n\n // ── Insert Type ──\n lines.push(\" Insert: {\");\n emittedKeys.clear();\n\n for (const [key, rawProp] of Object.entries(properties)) {\n const prop = rawProp as Property;\n if (prop.type === \"relation\") continue;\n const tsType = propertyToTypeScriptType(prop);\n const isRequired = prop.validation?.required;\n const typedProp = prop as StringProperty | NumberProperty;\n const isAutoId = \"isId\" in prop && typedProp.isId && typedProp.isId !== \"manual\" && typedProp.isId !== true;\n const isOptional = !isRequired || isAutoId;\n lines.push(` ${toSafeIdentifier(key)}${isOptional ? \"?\" : \"\"}: ${tsType};`);\n emittedKeys.add(key);\n }\n\n for (const [relKey, relation] of Object.entries(resolvedRelations)) {\n if (relation.direction === \"owning\" && relation.cardinality === \"one\" && relation.localKey) {\n const fkKey = relation.localKey;\n if (emittedKeys.has(fkKey)) continue;\n const fkType = \"string | number\";\n // simple fallback\n const isRequired = relation.validation?.required;\n lines.push(` ${toSafeIdentifier(fkKey)}${isRequired ? \"\" : \"?\"}: ${fkType};`);\n emittedKeys.add(fkKey);\n }\n }\n lines.push(\" };\");\n\n // ── Update Type ──\n lines.push(\" Update: {\");\n emittedKeys.clear();\n for (const [key, rawProp] of Object.entries(properties)) {\n const prop = rawProp as Property;\n if (prop.type === \"relation\") continue;\n const tsType = propertyToTypeScriptType(prop);\n lines.push(` ${toSafeIdentifier(key)}?: ${tsType};`);\n emittedKeys.add(key);\n }\n for (const [relKey, relation] of Object.entries(resolvedRelations)) {\n if (relation.direction === \"owning\" && relation.cardinality === \"one\" && relation.localKey) {\n const fkKey = relation.localKey;\n if (emittedKeys.has(fkKey)) continue;\n lines.push(` ${toSafeIdentifier(fkKey)}?: string | number;`);\n emittedKeys.add(fkKey);\n }\n }\n lines.push(\" };\");\n\n lines.push(\" };\");\n }\n\n lines.push(\"}\");\n lines.push(\"\");\n lines.push(\"export type CollectionName = keyof Database;\");\n lines.push(\"export type CollectionsDictionary = { [K in CollectionName]: K };\");\n lines.push(\"\");\n lines.push(\"export const collectionsDictionary = {\");\n for (const collection of collections) {\n lines.push(` ${toSafeIdentifier(collection.slug)}: \"${collection.slug}\",`);\n }\n lines.push(\"} as const;\");\n lines.push(\"\");\n\n return lines.join(\"\\n\");\n}\n","/**\n * @rebasepro/codegen\n *\n * Generates a purely typed Typescript database definition.\n */\n\nimport { CollectionConfig } from \"@rebasepro/types\";\nimport { generateTypedefs } from \"./generate-types\";\n\nexport { generateTypedefs } from \"./generate-types\";\nexport { toPascalCase, toCamelCase, toSafeIdentifier, indent } from \"./utils\";\n\n// ─── Public API ────────────────────────────────────────────────────\n\nexport interface GeneratedFile {\n /** Relative file path within the output directory */\n path: string;\n /** File content */\n content: string;\n}\n\nexport interface GenerateSDKOptions {\n /** Whether to include a README file (default: true) */\n includeReadme?: boolean;\n}\n\nexport function generateSDK(\n collections: CollectionConfig[],\n options: GenerateSDKOptions = {}\n): GeneratedFile[] {\n const files: GeneratedFile[] = [];\n\n files.push({\n path: \"database.types.ts\",\n content: generateTypedefs(collections)\n });\n\n if (options.includeReadme !== false) {\n files.push({\n path: \"README.md\",\n content: `# Rebase SDK\n\n> Auto-generated by \\`rebase generate-sdk\\`. Do not edit manually.\n\n## Usage\n\n1. Install the client package:\n \\`\\`\\`bash\n npm install @rebasepro/client\n \\`\\`\\`\n\n2. Initialize with your generated types:\n \\`\\`\\`typescript\n import { createRebaseClient } from '@rebasepro/client';\n import { Database, collectionsDictionary } from './database.types';\n\n const rebase = createRebaseClient<Database>({\n baseUrl: 'http://localhost:3001',\n collections: collectionsDictionary,\n });\n\n // Both syntax styles are fully typed!\n const { data: users } = await rebase.data.users.find();\n console.log(users[0].email); // flat access — no .values wrapper\n\n const { data: posts } = await rebase.data.collection('posts').find();\n console.log(posts[0].title); // just post.title, not post.values.title\n \\`\\`\\`\n`\n });\n }\n\n return files;\n}\n"],"mappings":";;;;;;;;;;;;CAQA,SAAgB,aAAa,KAAqB;EAC9C,OAAO,IACF,MAAM,UAAU,EAChB,KAAI,SAAQ,KAAK,OAAO,CAAC,EA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