drizzle-docs-generator 0.2.0 → 0.4.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 (61) hide show
  1. package/README.ja.md +59 -15
  2. package/README.md +55 -11
  3. package/dist/adapter/types.d.ts +40 -0
  4. package/dist/adapter/types.d.ts.map +1 -0
  5. package/dist/adapter/v0-adapter.d.ts +73 -0
  6. package/dist/adapter/v0-adapter.d.ts.map +1 -0
  7. package/dist/adapter/v0-adapter.js +136 -0
  8. package/dist/adapter/v0-adapter.js.map +1 -0
  9. package/dist/adapter/v1-adapter.d.ts +40 -0
  10. package/dist/adapter/v1-adapter.d.ts.map +1 -0
  11. package/dist/adapter/v1-adapter.js +83 -0
  12. package/dist/adapter/v1-adapter.js.map +1 -0
  13. package/dist/cli/index.js +194 -71
  14. package/dist/cli/index.js.map +1 -1
  15. package/dist/cli/integration-test-utils.d.ts +19 -0
  16. package/dist/cli/integration-test-utils.d.ts.map +1 -0
  17. package/dist/formatter/dbml-builder.d.ts +29 -0
  18. package/dist/formatter/dbml-builder.d.ts.map +1 -0
  19. package/dist/formatter/dbml-builder.js +39 -0
  20. package/dist/formatter/dbml-builder.js.map +1 -0
  21. package/dist/formatter/dbml.d.ts +81 -0
  22. package/dist/formatter/dbml.d.ts.map +1 -0
  23. package/dist/formatter/dbml.js +163 -0
  24. package/dist/formatter/dbml.js.map +1 -0
  25. package/dist/formatter/markdown.d.ts +126 -0
  26. package/dist/formatter/markdown.d.ts.map +1 -0
  27. package/dist/formatter/markdown.js +235 -0
  28. package/dist/formatter/markdown.js.map +1 -0
  29. package/dist/formatter/mermaid.d.ts +102 -0
  30. package/dist/formatter/mermaid.d.ts.map +1 -0
  31. package/dist/formatter/mermaid.js +177 -0
  32. package/dist/formatter/mermaid.js.map +1 -0
  33. package/dist/formatter/types.d.ts +37 -0
  34. package/dist/formatter/types.d.ts.map +1 -0
  35. package/dist/generator/common.d.ts +115 -208
  36. package/dist/generator/common.d.ts.map +1 -1
  37. package/dist/generator/common.js +260 -479
  38. package/dist/generator/common.js.map +1 -1
  39. package/dist/generator/mysql.js +3 -3
  40. package/dist/generator/pg.d.ts +8 -7
  41. package/dist/generator/pg.d.ts.map +1 -1
  42. package/dist/generator/pg.js +29 -31
  43. package/dist/generator/pg.js.map +1 -1
  44. package/dist/generator/sqlite.js +3 -3
  45. package/dist/index.d.ts +15 -4
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +22 -18
  48. package/dist/index.js.map +1 -1
  49. package/dist/test-utils/cli-runner.d.ts +4 -1
  50. package/dist/test-utils/cli-runner.d.ts.map +1 -1
  51. package/dist/test-utils/dbml-validator.d.ts +29 -0
  52. package/dist/test-utils/dbml-validator.d.ts.map +1 -1
  53. package/dist/types.d.ts +128 -16
  54. package/dist/types.d.ts.map +1 -1
  55. package/package.json +3 -2
  56. package/dist/generator/index.d.ts +0 -15
  57. package/dist/generator/index.d.ts.map +0 -1
  58. package/dist/parser/index.d.ts +0 -5
  59. package/dist/parser/index.d.ts.map +0 -1
  60. package/dist/test-utils/index.d.ts +0 -7
  61. package/dist/test-utils/index.d.ts.map +0 -1
@@ -1,67 +1,77 @@
1
1
  import { AnyColumn, Table } from 'drizzle-orm';
2
2
  import { TableRelationalConfig } from 'drizzle-orm/relations';
3
- import { GeneratedRef, GenerateOptions } from '../types';
3
+ import { GeneratedRef, GenerateOptions, IntermediateSchema, TableDefinition, ColumnDefinition, IndexDefinition, ConstraintDefinition, RelationDefinition, EnumDefinition, DatabaseType } from '../types';
4
4
  import { SchemaComments } from '../parser/comments';
5
5
  import { SchemaRelations } from '../parser/relations';
6
6
  /**
7
- * Legacy v0 Relations type (for backward compatibility with relations())
8
- * This is a simplified type - the actual structure is more complex
7
+ * Configuration for different database dialects
9
8
  */
10
- type LegacyRelations = {
11
- table: Table;
12
- config: Record<string, unknown>;
13
- };
9
+ export interface DialectConfig {
10
+ escapeName: (name: string) => string;
11
+ isIncrement: (column: AnyColumn) => boolean;
12
+ }
14
13
  /**
15
- * Simple DBML string builder
14
+ * Configuration for an index definition
16
15
  */
17
- export declare class DbmlBuilder {
18
- private lines;
19
- private indentLevel;
20
- /**
21
- * Increase the indentation level by one
22
- * @returns This instance for method chaining
23
- */
24
- indent(): this;
25
- /**
26
- * Decrease the indentation level by one (minimum 0)
27
- * @returns This instance for method chaining
28
- */
29
- dedent(): this;
30
- /**
31
- * Add a line with the current indentation level
32
- * @param content - The content to add (empty string adds a blank line)
33
- * @returns This instance for method chaining
34
- */
35
- line(content?: string): this;
36
- /**
37
- * Build the final DBML string from all added lines
38
- * @returns The complete DBML content as a string
39
- */
40
- build(): string;
16
+ interface IndexConfig {
17
+ config: {
18
+ columns: Array<{
19
+ name: string;
20
+ }>;
21
+ name?: string;
22
+ unique: boolean;
23
+ using?: string;
24
+ };
41
25
  }
42
26
  /**
43
- * Configuration for different database dialects
27
+ * Configuration for a primary key constraint
44
28
  */
45
- export interface DialectConfig {
46
- escapeName: (name: string) => string;
47
- isIncrement: (column: AnyColumn) => boolean;
29
+ interface PrimaryKeyConfig {
30
+ columns: Array<{
31
+ name: string;
32
+ }>;
33
+ name?: string;
34
+ }
35
+ /**
36
+ * Configuration for a unique constraint
37
+ */
38
+ interface UniqueConstraintConfig {
39
+ columns: Array<{
40
+ name: string;
41
+ }>;
42
+ name?: string;
43
+ }
44
+ /**
45
+ * Configuration for a foreign key constraint
46
+ */
47
+ export interface ForeignKeyConfig {
48
+ reference: () => {
49
+ columns: Array<{
50
+ name: string;
51
+ }>;
52
+ foreignColumns: Array<{
53
+ name: string;
54
+ }>;
55
+ foreignTable: Table;
56
+ };
57
+ name?: string;
58
+ onDelete?: string;
59
+ onUpdate?: string;
48
60
  }
49
61
  /**
50
62
  * Table configuration extracted from Drizzle tables
51
- * Using 'any' types for dialect-agnostic handling
52
63
  */
53
64
  export interface TableConfig {
54
- indexes: unknown[];
55
- primaryKeys: unknown[];
56
- uniqueConstraints: unknown[];
57
- foreignKeys: unknown[];
65
+ indexes: IndexConfig[];
66
+ primaryKeys: PrimaryKeyConfig[];
67
+ uniqueConstraints: UniqueConstraintConfig[];
68
+ foreignKeys: ForeignKeyConfig[];
58
69
  }
59
70
  /**
60
71
  * Base generator class for DBML generation
61
72
  */
62
73
  export declare abstract class BaseGenerator<TSchema extends Record<string, unknown> = Record<string, unknown>> {
63
74
  protected schema: TSchema;
64
- protected relational: boolean;
65
75
  protected generatedRefs: GeneratedRef[];
66
76
  protected comments: SchemaComments | undefined;
67
77
  protected parsedRelations: SchemaRelations | undefined;
@@ -69,7 +79,7 @@ export declare abstract class BaseGenerator<TSchema extends Record<string, unkno
69
79
  protected abstract dialectConfig: DialectConfig;
70
80
  /**
71
81
  * Create a new generator instance
72
- * @param options - Configuration options including schema, relational mode, source code, and comments
82
+ * @param options - Configuration options including schema, source code, and comments
73
83
  */
74
84
  constructor(options: GenerateOptions<TSchema>);
75
85
  /**
@@ -102,24 +112,6 @@ export declare abstract class BaseGenerator<TSchema extends Record<string, unkno
102
112
  * @returns True if value is a Drizzle table
103
113
  */
104
114
  protected isTable(value: unknown): boolean;
105
- /**
106
- * Get all v0 relations from schema (legacy relations() API)
107
- *
108
- * Extracts legacy relations defined using the old relations() API.
109
- * These are identified by having 'table' and 'config' properties.
110
- *
111
- * @returns Array of legacy relation objects
112
- */
113
- protected getV0Relations(): LegacyRelations[];
114
- /**
115
- * Check if a value is a Drizzle v0 relations object (from relations())
116
- *
117
- * Validates the legacy relations() format by checking for 'table' and 'config' properties.
118
- *
119
- * @param value - The value to check
120
- * @returns True if value is a legacy relations object
121
- */
122
- protected isV0Relations(value: unknown): boolean;
123
115
  /**
124
116
  * Check if a value is a v1 relation entry (from defineRelations())
125
117
  *
@@ -149,16 +141,6 @@ export declare abstract class BaseGenerator<TSchema extends Record<string, unkno
149
141
  * @returns True if value is a full defineRelations() result
150
142
  */
151
143
  protected isV1DefineRelationsResult(value: unknown): boolean;
152
- /**
153
- * Generate a table definition in DBML format
154
- *
155
- * Creates the complete table definition including columns, indexes, constraints,
156
- * and table-level comments. Also collects foreign keys if not in relational mode.
157
- *
158
- * @param dbml - The DBML builder to add the table to
159
- * @param table - The Drizzle table to generate
160
- */
161
- protected generateTable(dbml: DbmlBuilder, table: Table): void;
162
144
  /**
163
145
  * Get table configuration from a Drizzle table
164
146
  *
@@ -170,41 +152,13 @@ export declare abstract class BaseGenerator<TSchema extends Record<string, unkno
170
152
  */
171
153
  protected getTableConfig(table: Table): TableConfig | undefined;
172
154
  /**
173
- * Generate a column definition in DBML format
174
- *
175
- * Creates a column line with type and attributes (primary key, not null, unique, etc.)
176
- * and includes column-level comments if available.
177
- *
178
- * @param dbml - The DBML builder to add the column to
179
- * @param column - The Drizzle column to generate
180
- * @param tableName - Optional table name for looking up comments
181
- */
182
- protected generateColumn(dbml: DbmlBuilder, column: AnyColumn, tableName?: string): void;
183
- /**
184
- * Get the SQL type for a column
185
- *
186
- * @param column - The column to get the SQL type from
187
- * @returns The SQL type string (e.g., "varchar", "integer")
188
- */
189
- protected getColumnType(column: AnyColumn): string;
190
- /**
191
- * Get column attributes for DBML
192
- *
193
- * Extracts attributes like primary key, not null, unique, increment, default value,
194
- * and note from the column. Uses column metadata and comments if available.
195
- *
196
- * @param column - The column to get attributes from
197
- * @param tableName - Optional table name for looking up comments
198
- * @returns Array of attribute strings for DBML format
199
- */
200
- protected getColumnAttributes(column: AnyColumn, tableName?: string): string[];
201
- /**
202
- * Format attributes into a string
155
+ * Map Drizzle's internal table config to our typed TableConfig
203
156
  *
204
- * @param attrs - Array of attribute strings
205
- * @returns Comma-separated attribute string
157
+ * Note: Drizzle ORM's columns type is `SQL<unknown> | IndexedColumn` union,
158
+ * so we use `{ name?: string }` and cast to access the name property.
159
+ * This is unavoidable due to Drizzle's internal type structure.
206
160
  */
207
- protected formatAttributes(attrs: string[]): string;
161
+ private mapTableConfig;
208
162
  /**
209
163
  * Get the default value for a column
210
164
  *
@@ -215,16 +169,6 @@ export declare abstract class BaseGenerator<TSchema extends Record<string, unkno
215
169
  * @returns Formatted default value string or undefined
216
170
  */
217
171
  protected getDefaultValue(column: AnyColumn): string | undefined;
218
- /**
219
- * Generate indexes block from table configuration
220
- *
221
- * Creates the indexes block containing primary keys, unique constraints,
222
- * and regular indexes with their respective attributes.
223
- *
224
- * @param dbml - The DBML builder to add the indexes block to
225
- * @param tableConfig - The table configuration containing index information
226
- */
227
- protected generateIndexesBlock(dbml: DbmlBuilder, tableConfig: TableConfig): void;
228
172
  /**
229
173
  * Collect foreign keys from table configuration
230
174
  *
@@ -234,7 +178,7 @@ export declare abstract class BaseGenerator<TSchema extends Record<string, unkno
234
178
  * @param tableName - The name of the source table
235
179
  * @param foreignKeys - Array of foreign key definitions from table config
236
180
  */
237
- protected collectForeignKeysFromConfig(tableName: string, foreignKeys: unknown[]): void;
181
+ protected collectForeignKeysFromConfig(tableName: string, foreignKeys: ForeignKeyConfig[]): void;
238
182
  /**
239
183
  * Parse a foreign key into a GeneratedRef
240
184
  *
@@ -243,141 +187,104 @@ export declare abstract class BaseGenerator<TSchema extends Record<string, unkno
243
187
  *
244
188
  * @param tableName - The name of the source table
245
189
  * @param fk - The foreign key definition to parse
246
- * @returns GeneratedRef object or undefined if parsing fails
190
+ * @returns GeneratedRef object
247
191
  */
248
- protected parseForeignKey(tableName: string, fk: unknown): GeneratedRef | undefined;
192
+ protected parseForeignKey(tableName: string, fk: ForeignKeyConfig): GeneratedRef;
249
193
  /**
250
- * Get a mapping from variable names to table names in the schema
194
+ * Detect if relation definitions are present in the schema
251
195
  *
252
- * Creates a map from TypeScript variable names (e.g., "usersTable") to
253
- * actual database table names (e.g., "users").
196
+ * Checks for both v1 (defineRelations()) and v0 (relations()) API usage.
197
+ * Returns true if any relation definitions are found.
254
198
  *
255
- * @returns Map of variable names to table names
199
+ * @returns True if relations are defined, false otherwise
256
200
  */
257
- protected getTableNameMapping(): Map<string, string>;
201
+ private hasRelationDefinitions;
258
202
  /**
259
- * Get a mapping from TypeScript property names to database column names for a table
203
+ * Create the appropriate relation adapter based on schema contents
260
204
  *
261
- * Creates a map from TypeScript property names (e.g., "authorId") to
262
- * actual database column names (e.g., "author_id").
205
+ * Detects whether v1 or v0 relations are present and returns the
206
+ * corresponding adapter implementation.
263
207
  *
264
- * @param tableVarName - The variable name of the table in the schema
265
- * @returns Map of property names to column names
208
+ * @returns RelationAdapter instance (V1RelationAdapter or V0RelationAdapter)
266
209
  */
267
- protected getColumnNameMapping(tableVarName: string): Map<string, string>;
210
+ private createRelationAdapter;
268
211
  /**
269
- * Check if there's a reverse one() relation (B->A when we have A->B)
270
- *
271
- * Used to detect one-to-one relationships by checking if both tables
272
- * have one() relations pointing to each other.
212
+ * Convert a UnifiedRelation to a RelationDefinition
273
213
  *
274
- * @param sourceTable - The source table variable name
275
- * @param targetTable - The target table variable name
276
- * @param sourceFields - The source table's field names
277
- * @param targetReferences - The target table's reference column names
278
- * @returns True if a reverse one() relation exists
279
- */
280
- protected hasReverseOneRelation(sourceTable: string, targetTable: string, sourceFields: string[], targetReferences: string[]): boolean;
281
- /**
282
- * Helper to check if two arrays are equal
214
+ * Maps the unified relation format from adapters to the intermediate
215
+ * schema's RelationDefinition format.
283
216
  *
284
- * @param a - First array
285
- * @param b - Second array
286
- * @returns True if arrays have same length and same elements in order
217
+ * @param unified - The unified relation from adapter
218
+ * @returns RelationDefinition for intermediate schema
287
219
  */
288
- private arraysEqual;
220
+ private unifiedRelationToDefinition;
289
221
  /**
290
- * Generate references from v0 relations() API
222
+ * Convert the Drizzle schema to an intermediate schema representation
291
223
  *
292
- * Uses TypeScript Compiler API to parse relations() definitions from source file
293
- * and extract fields/references to generate DBML Ref lines.
224
+ * Creates a database-agnostic intermediate representation that can be
225
+ * used to generate various output formats (DBML, Markdown, JSON, etc.)
294
226
  *
295
- * Detects one-to-one relationships when bidirectional one() relations exist.
227
+ * @returns The intermediate schema representation
296
228
  */
297
- protected generateRelationalRefsFromV0(): void;
229
+ toIntermediateSchema(): IntermediateSchema;
298
230
  /**
299
- * Generate references from v1 defineRelations() entries
231
+ * Determine the database type from a Drizzle table
300
232
  *
301
- * Uses official Drizzle v1 types (TableRelationalConfig, Relation, One).
302
- * Processes One relations to extract foreign key information and generates
303
- * DBML Ref lines. Detects one-to-one relationships with bidirectional checks.
304
- *
305
- * @param entries - Array of v1 relation entries from defineRelations()
233
+ * @param table - The table to check (can be undefined for empty schemas)
234
+ * @returns The database type
306
235
  */
307
- protected generateRelationalRefsFromV1(entries: TableRelationalConfig[]): void;
236
+ protected getDatabaseType(table: Table | undefined): DatabaseType;
308
237
  /**
309
- * Check if there's a reverse One relation in v1 entries
310
- *
311
- * Detects one-to-one relationships by checking if the target table
312
- * has a matching One relation pointing back to the source table.
238
+ * Convert a Drizzle table to a TableDefinition
313
239
  *
314
- * @param entries - All v1 relation entries
315
- * @param fromTableName - The table to search for reverse relation
316
- * @param toTableName - The expected target table of the reverse relation
317
- * @param fromColumns - The expected source columns of the reverse relation
318
- * @param toColumns - The expected target columns of the reverse relation
319
- * @returns True if a matching reverse One relation exists
240
+ * @param table - The Drizzle table to convert
241
+ * @returns The table definition
320
242
  */
321
- protected hasV1ReverseOneRelation(entries: TableRelationalConfig[], fromTableName: string, toTableName: string, fromColumns: string[], toColumns: string[]): boolean;
243
+ protected tableToDefinition(table: Table): TableDefinition;
322
244
  /**
323
- * Get unique key for a relation to avoid duplicates
245
+ * Convert a Drizzle column to a ColumnDefinition
324
246
  *
325
- * Creates a consistent key by sorting table names alphabetically.
326
- *
327
- * @param tableName - The source table name
328
- * @param relation - The relation object
329
- * @returns A unique key string for the relation
247
+ * @param column - The Drizzle column to convert
248
+ * @param tableName - The name of the table containing the column
249
+ * @returns The column definition
330
250
  */
331
- protected getRelationKey(tableName: string, relation: unknown): string;
251
+ protected columnToDefinition(column: AnyColumn, tableName: string): ColumnDefinition;
332
252
  /**
333
- * Parse a relation into a GeneratedRef
334
- *
335
- * Extracts relation information from a legacy relation object and converts
336
- * it to a GeneratedRef for DBML output.
253
+ * Extract index definitions from table config
337
254
  *
338
- * @param tableName - The source table name
339
- * @param relation - The relation object to parse
340
- * @returns GeneratedRef object or undefined if parsing fails
255
+ * @param tableConfig - The table configuration
256
+ * @returns Array of index definitions
341
257
  */
342
- protected parseRelation(tableName: string, relation: unknown): GeneratedRef | undefined;
258
+ protected extractIndexDefinitions(tableConfig: TableConfig | undefined): IndexDefinition[];
343
259
  /**
344
- * Generate a reference line in DBML format
260
+ * Extract constraint definitions from table config
345
261
  *
346
- * Creates a Ref line showing the relationship between tables with optional
347
- * onDelete and onUpdate actions.
348
- *
349
- * @param dbml - The DBML builder to add the reference to
350
- * @param ref - The reference definition to generate
262
+ * @param tableConfig - The table configuration
263
+ * @returns Array of constraint definitions
351
264
  */
352
- protected generateRef(dbml: DbmlBuilder, ref: GeneratedRef): void;
265
+ protected extractConstraintDefinitions(tableConfig: TableConfig | undefined): ConstraintDefinition[];
353
266
  /**
354
- * Get column names from an index definition
267
+ * Parse a foreign key into a ConstraintDefinition
355
268
  *
356
- * @param idx - The index definition to extract columns from
357
- * @returns Array of column names in the index
269
+ * @param fk - The foreign key definition
270
+ * @returns ConstraintDefinition
358
271
  */
359
- protected getIndexColumns(idx: unknown): string[];
272
+ protected parseForeignKeyForConstraint(fk: ForeignKeyConfig): ConstraintDefinition;
360
273
  /**
361
- * Check if an index is unique
274
+ * Convert a GeneratedRef to a RelationDefinition
362
275
  *
363
- * @param idx - The index definition to check
364
- * @returns True if the index has the unique flag
276
+ * @param ref - The generated reference
277
+ * @returns The relation definition
365
278
  */
366
- protected isUniqueIndex(idx: unknown): boolean;
279
+ protected refToRelationDefinition(ref: GeneratedRef): RelationDefinition;
367
280
  /**
368
- * Get column names from a primary key constraint
281
+ * Collect enum definitions from the schema
369
282
  *
370
- * @param pk - The primary key definition to extract columns from
371
- * @returns Array of column names in the primary key
372
- */
373
- protected getPrimaryKeyColumns(pk: unknown): string[];
374
- /**
375
- * Get column names from a unique constraint
283
+ * Override in subclasses for dialect-specific enum handling (e.g., PostgreSQL)
376
284
  *
377
- * @param uc - The unique constraint definition to extract columns from
378
- * @returns Array of column names in the unique constraint
285
+ * @returns Array of enum definitions (empty by default)
379
286
  */
380
- protected getUniqueConstraintColumns(uc: unknown): string[];
287
+ protected collectEnumDefinitions(): EnumDefinition[];
381
288
  }
382
289
  /**
383
290
  * Write DBML content to a file
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/generator/common.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,KAAK,EAMX,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAe,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAGhF;;;GAGG;AACH,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC,CAAC;AAKF,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE7E;;GAEG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,KAAK,CAAgB;IAC7B,OAAO,CAAC,WAAW,CAAK;IAExB;;;OAGG;IACH,MAAM,IAAI,IAAI;IAKd;;;OAGG;IACH,MAAM,IAAI,IAAI;IAKd;;;;OAIG;IACH,IAAI,CAAC,OAAO,GAAE,MAAW,GAAG,IAAI;IAMhC;;;OAGG;IACH,KAAK,IAAI,MAAM;CAGhB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACrC,WAAW,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,OAAO,CAAC;CAC7C;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1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