@danielfgray/pg-sourcerer 0.1.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 (145) hide show
  1. package/dist/cli.d.ts +3 -0
  2. package/dist/cli.d.ts.map +1 -0
  3. package/dist/cli.js +104 -0
  4. package/dist/cli.js.map +1 -0
  5. package/dist/config.d.ts +133 -0
  6. package/dist/config.d.ts.map +1 -0
  7. package/dist/config.js +47 -0
  8. package/dist/config.js.map +1 -0
  9. package/dist/errors.d.ts +129 -0
  10. package/dist/errors.d.ts.map +1 -0
  11. package/dist/errors.js +41 -0
  12. package/dist/errors.js.map +1 -0
  13. package/dist/generate.d.ts +75 -0
  14. package/dist/generate.d.ts.map +1 -0
  15. package/dist/generate.js +183 -0
  16. package/dist/generate.js.map +1 -0
  17. package/dist/index.d.ts +35 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +62 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/init.d.ts +4 -0
  22. package/dist/init.d.ts.map +1 -0
  23. package/dist/init.js +229 -0
  24. package/dist/init.js.map +1 -0
  25. package/dist/ir/index.d.ts +7 -0
  26. package/dist/ir/index.d.ts.map +1 -0
  27. package/dist/ir/index.js +7 -0
  28. package/dist/ir/index.js.map +1 -0
  29. package/dist/ir/relation-graph.d.ts +113 -0
  30. package/dist/ir/relation-graph.d.ts.map +1 -0
  31. package/dist/ir/relation-graph.js +232 -0
  32. package/dist/ir/relation-graph.js.map +1 -0
  33. package/dist/ir/semantic-ir.d.ts +448 -0
  34. package/dist/ir/semantic-ir.d.ts.map +1 -0
  35. package/dist/ir/semantic-ir.js +138 -0
  36. package/dist/ir/semantic-ir.js.map +1 -0
  37. package/dist/ir/smart-tags.d.ts +24 -0
  38. package/dist/ir/smart-tags.d.ts.map +1 -0
  39. package/dist/ir/smart-tags.js +30 -0
  40. package/dist/ir/smart-tags.js.map +1 -0
  41. package/dist/lib/conjure.d.ts +431 -0
  42. package/dist/lib/conjure.d.ts.map +1 -0
  43. package/dist/lib/conjure.js +697 -0
  44. package/dist/lib/conjure.js.map +1 -0
  45. package/dist/lib/field-utils.d.ts +61 -0
  46. package/dist/lib/field-utils.d.ts.map +1 -0
  47. package/dist/lib/field-utils.js +132 -0
  48. package/dist/lib/field-utils.js.map +1 -0
  49. package/dist/lib/hex.d.ts +117 -0
  50. package/dist/lib/hex.d.ts.map +1 -0
  51. package/dist/lib/hex.js +185 -0
  52. package/dist/lib/hex.js.map +1 -0
  53. package/dist/plugins/arktype.d.ts +11 -0
  54. package/dist/plugins/arktype.d.ts.map +1 -0
  55. package/dist/plugins/arktype.js +207 -0
  56. package/dist/plugins/arktype.js.map +1 -0
  57. package/dist/plugins/effect-model.d.ts +10 -0
  58. package/dist/plugins/effect-model.d.ts.map +1 -0
  59. package/dist/plugins/effect-model.js +261 -0
  60. package/dist/plugins/effect-model.js.map +1 -0
  61. package/dist/plugins/kysely-queries.d.ts +7 -0
  62. package/dist/plugins/kysely-queries.d.ts.map +1 -0
  63. package/dist/plugins/kysely-queries.js +380 -0
  64. package/dist/plugins/kysely-queries.js.map +1 -0
  65. package/dist/plugins/sql-queries.d.ts +6 -0
  66. package/dist/plugins/sql-queries.d.ts.map +1 -0
  67. package/dist/plugins/sql-queries.js +249 -0
  68. package/dist/plugins/sql-queries.js.map +1 -0
  69. package/dist/plugins/types.d.ts +18 -0
  70. package/dist/plugins/types.d.ts.map +1 -0
  71. package/dist/plugins/types.js +263 -0
  72. package/dist/plugins/types.js.map +1 -0
  73. package/dist/plugins/zod.d.ts +11 -0
  74. package/dist/plugins/zod.d.ts.map +1 -0
  75. package/dist/plugins/zod.js +180 -0
  76. package/dist/plugins/zod.js.map +1 -0
  77. package/dist/services/artifact-store.d.ts +55 -0
  78. package/dist/services/artifact-store.d.ts.map +1 -0
  79. package/dist/services/artifact-store.js +51 -0
  80. package/dist/services/artifact-store.js.map +1 -0
  81. package/dist/services/config-loader.d.ts +45 -0
  82. package/dist/services/config-loader.d.ts.map +1 -0
  83. package/dist/services/config-loader.js +113 -0
  84. package/dist/services/config-loader.js.map +1 -0
  85. package/dist/services/emissions.d.ts +89 -0
  86. package/dist/services/emissions.d.ts.map +1 -0
  87. package/dist/services/emissions.js +194 -0
  88. package/dist/services/emissions.js.map +1 -0
  89. package/dist/services/file-builder.d.ts +81 -0
  90. package/dist/services/file-builder.d.ts.map +1 -0
  91. package/dist/services/file-builder.js +112 -0
  92. package/dist/services/file-builder.js.map +1 -0
  93. package/dist/services/file-writer.d.ts +57 -0
  94. package/dist/services/file-writer.d.ts.map +1 -0
  95. package/dist/services/file-writer.js +76 -0
  96. package/dist/services/file-writer.js.map +1 -0
  97. package/dist/services/inflection.d.ts +227 -0
  98. package/dist/services/inflection.d.ts.map +1 -0
  99. package/dist/services/inflection.js +350 -0
  100. package/dist/services/inflection.js.map +1 -0
  101. package/dist/services/introspection.d.ts +46 -0
  102. package/dist/services/introspection.d.ts.map +1 -0
  103. package/dist/services/introspection.js +99 -0
  104. package/dist/services/introspection.js.map +1 -0
  105. package/dist/services/ir-builder.d.ts +46 -0
  106. package/dist/services/ir-builder.d.ts.map +1 -0
  107. package/dist/services/ir-builder.js +923 -0
  108. package/dist/services/ir-builder.js.map +1 -0
  109. package/dist/services/ir.d.ts +28 -0
  110. package/dist/services/ir.d.ts.map +1 -0
  111. package/dist/services/ir.js +25 -0
  112. package/dist/services/ir.js.map +1 -0
  113. package/dist/services/pg-types.d.ts +197 -0
  114. package/dist/services/pg-types.d.ts.map +1 -0
  115. package/dist/services/pg-types.js +274 -0
  116. package/dist/services/pg-types.js.map +1 -0
  117. package/dist/services/plugin-meta.d.ts +33 -0
  118. package/dist/services/plugin-meta.d.ts.map +1 -0
  119. package/dist/services/plugin-meta.js +24 -0
  120. package/dist/services/plugin-meta.js.map +1 -0
  121. package/dist/services/plugin-runner.d.ts +52 -0
  122. package/dist/services/plugin-runner.d.ts.map +1 -0
  123. package/dist/services/plugin-runner.js +182 -0
  124. package/dist/services/plugin-runner.js.map +1 -0
  125. package/dist/services/plugin.d.ts +286 -0
  126. package/dist/services/plugin.d.ts.map +1 -0
  127. package/dist/services/plugin.js +132 -0
  128. package/dist/services/plugin.js.map +1 -0
  129. package/dist/services/smart-tags-parser.d.ts +37 -0
  130. package/dist/services/smart-tags-parser.d.ts.map +1 -0
  131. package/dist/services/smart-tags-parser.js +79 -0
  132. package/dist/services/smart-tags-parser.js.map +1 -0
  133. package/dist/services/symbols.d.ts +85 -0
  134. package/dist/services/symbols.d.ts.map +1 -0
  135. package/dist/services/symbols.js +128 -0
  136. package/dist/services/symbols.js.map +1 -0
  137. package/dist/services/type-hints.d.ts +62 -0
  138. package/dist/services/type-hints.d.ts.map +1 -0
  139. package/dist/services/type-hints.js +117 -0
  140. package/dist/services/type-hints.js.map +1 -0
  141. package/dist/testing.d.ts +77 -0
  142. package/dist/testing.d.ts.map +1 -0
  143. package/dist/testing.js +84 -0
  144. package/dist/testing.js.map +1 -0
  145. package/package.json +74 -0
@@ -0,0 +1,183 @@
1
+ /**
2
+ * Generate Orchestration Function
3
+ *
4
+ * Threads together the full code generation pipeline:
5
+ * 1. Load config
6
+ * 2. Introspect database
7
+ * 3. Build IR
8
+ * 4. Prepare and run plugins
9
+ * 5. Write files
10
+ *
11
+ * Logging:
12
+ * - Effect.log (INFO) - Progress messages shown by default
13
+ * - Effect.logDebug (DEBUG) - Detailed info (entity names, file lists)
14
+ *
15
+ * Configure via Logger.withMinimumLogLevel at the call site.
16
+ */
17
+ import { Effect, Layer } from "effect";
18
+ import { Command } from "@effect/platform";
19
+ import { ConfigLoaderService, ConfigLoaderLive, } from "./services/config-loader.js";
20
+ import { DatabaseIntrospectionService, DatabaseIntrospectionLive, } from "./services/introspection.js";
21
+ import { createIRBuilderService } from "./services/ir-builder.js";
22
+ import { PluginRunner } from "./services/plugin-runner.js";
23
+ import { createFileWriter } from "./services/file-writer.js";
24
+ import { TypeHintsLive } from "./services/type-hints.js";
25
+ import { makeInflectionLayer } from "./services/inflection.js";
26
+ import { getEnumEntities, getTableEntities, getDomainEntities, getCompositeEntities } from "./ir/semantic-ir.js";
27
+ import { FormatError, } from "./errors.js";
28
+ /**
29
+ * Run a formatter command on the output directory.
30
+ * Spawns a subprocess and fails if it exits non-zero.
31
+ * Output is piped to the parent process's stdout/stderr.
32
+ */
33
+ const runFormatter = (command, outputDir) => {
34
+ // Parse command string into program and args, append outputDir
35
+ const parts = command.split(/\s+/).filter(Boolean);
36
+ const program = parts[0] ?? "echo";
37
+ const args = parts.slice(1);
38
+ const cmd = Command.make(program, ...args, outputDir).pipe(Command.stdout("inherit"), Command.stderr("inherit"), Command.runInShell(true));
39
+ return Command.exitCode(cmd).pipe(Effect.flatMap((code) => code === 0
40
+ ? Effect.void
41
+ : Effect.fail(new FormatError({
42
+ message: `Formatter command failed with exit code ${code}: ${command} ${outputDir}`,
43
+ path: outputDir,
44
+ cause: new Error(`Exit code: ${code}`),
45
+ }))), Effect.mapError((cause) => cause instanceof FormatError
46
+ ? cause
47
+ : new FormatError({
48
+ message: `Formatter command failed: ${command} ${outputDir}`,
49
+ path: outputDir,
50
+ cause,
51
+ })));
52
+ };
53
+ /**
54
+ * The main generate pipeline
55
+ */
56
+ export const generate = (options = {}) => Effect.gen(function* () {
57
+ // 1. Load configuration
58
+ yield* Effect.logDebug("Loading configuration...");
59
+ const configLoader = yield* ConfigLoaderService;
60
+ const config = yield* configLoader.load(
61
+ // Only include defined properties to satisfy exactOptionalPropertyTypes
62
+ Object.fromEntries(Object.entries({
63
+ configPath: options.configPath,
64
+ searchFrom: options.searchFrom,
65
+ }).filter(([, v]) => v !== undefined)));
66
+ yield* Effect.logDebug(`Config schemas: ${config.schemas.join(", ")}`);
67
+ yield* Effect.logDebug(`Config plugins: ${config.plugins.length}`);
68
+ // 2. Introspect database
69
+ yield* Effect.log("Introspecting database...");
70
+ const dbService = yield* DatabaseIntrospectionService;
71
+ const introspection = yield* dbService.introspect({
72
+ connectionString: config.connectionString,
73
+ role: config.role,
74
+ });
75
+ const tables = introspection.classes.filter((c) => c.relkind === "r");
76
+ const views = introspection.classes.filter((c) => c.relkind === "v");
77
+ yield* Effect.log(`Found ${tables.length} tables, ${views.length} views`);
78
+ if (tables.length > 0) {
79
+ const tableNames = tables.map((t) => t.relname).sort();
80
+ yield* Effect.logDebug(`Tables: ${tableNames.join(", ")}`);
81
+ }
82
+ if (views.length > 0) {
83
+ const viewNames = views.map((v) => v.relname).sort();
84
+ yield* Effect.logDebug(`Views: ${viewNames.join(", ")}`);
85
+ }
86
+ // 3. Build IR with user's inflection config
87
+ yield* Effect.log("Building semantic IR...");
88
+ const irBuilder = createIRBuilderService();
89
+ // Create inflection layer from config (or use defaults)
90
+ const inflectionLayer = makeInflectionLayer(config.inflection);
91
+ const ir = yield* irBuilder
92
+ .build(introspection, { schemas: config.schemas, role: config.role })
93
+ .pipe(Effect.provide(inflectionLayer));
94
+ const enumEntities = getEnumEntities(ir);
95
+ const tableEntities = getTableEntities(ir);
96
+ const domainEntities = getDomainEntities(ir);
97
+ const compositeEntities = getCompositeEntities(ir);
98
+ const counts = [
99
+ `${tableEntities.length} tables/views`,
100
+ `${enumEntities.length} enums`,
101
+ ];
102
+ if (domainEntities.length > 0)
103
+ counts.push(`${domainEntities.length} domains`);
104
+ if (compositeEntities.length > 0)
105
+ counts.push(`${compositeEntities.length} composites`);
106
+ yield* Effect.log(`Built ${counts.join(", ")}`);
107
+ if (ir.entities.size > 0) {
108
+ const entityNames = [...ir.entities.keys()].sort();
109
+ yield* Effect.logDebug(`Entities: ${entityNames.join(", ")}`);
110
+ }
111
+ if (enumEntities.length > 0) {
112
+ const enumNames = enumEntities.map(e => e.name).sort();
113
+ yield* Effect.logDebug(`Enums: ${enumNames.join(", ")}`);
114
+ }
115
+ // 4. Prepare and run plugins
116
+ // NOTE: We create the PluginRunner with the user's inflection layer
117
+ // so plugins use the same naming conventions as the IR
118
+ yield* Effect.log("Running plugins...");
119
+ // Cast plugins from config to ConfiguredPlugin[]
120
+ // The config stores them as unknown[], but they should be ConfiguredPlugin[]
121
+ const plugins = config.plugins;
122
+ // Create TypeHints layer from config
123
+ const typeHintsLayer = TypeHintsLive(config.typeHints);
124
+ // Run plugins with user's inflection (not default identity inflection)
125
+ // Use DefaultWithoutDependencies so our inflectionLayer takes precedence
126
+ const pluginResult = yield* Effect.gen(function* () {
127
+ const runner = yield* PluginRunner;
128
+ const prepared = yield* runner.prepare(plugins);
129
+ const pluginNames = prepared.map((p) => p.plugin.name);
130
+ yield* Effect.log(`Plugin order: ${pluginNames.join(" → ")}`);
131
+ return yield* runner.run(prepared, ir);
132
+ }).pipe(Effect.provide(typeHintsLayer), Effect.provide(Layer.provide(PluginRunner.DefaultWithoutDependencies, inflectionLayer)));
133
+ const emissions = pluginResult.emissions.getAll();
134
+ yield* Effect.log(`Generated ${emissions.length} files`);
135
+ // 5. Write files
136
+ const outputDir = options.outputDir ?? config.outputDir;
137
+ yield* Effect.log(`Writing to ${outputDir}...`);
138
+ const writer = createFileWriter();
139
+ const writeResults = yield* writer.writeAll(emissions, {
140
+ outputDir,
141
+ dryRun: options.dryRun ?? false,
142
+ });
143
+ // 6. Format files (if formatter provided and not dry run)
144
+ if (config.formatter && !options.dryRun) {
145
+ yield* Effect.log(`Formatting with: ${config.formatter} ${outputDir}`);
146
+ yield* runFormatter(config.formatter, outputDir);
147
+ yield* Effect.log("Formatting complete");
148
+ }
149
+ // Log each file at debug level
150
+ for (const result of writeResults) {
151
+ const status = options.dryRun
152
+ ? "(dry run)"
153
+ : result.written
154
+ ? "✓"
155
+ : "–";
156
+ yield* Effect.logDebug(`${status} ${result.path}`);
157
+ }
158
+ const written = writeResults.filter((r) => r.written).length;
159
+ const dryRunSuffix = options.dryRun ? " (dry run)" : "";
160
+ yield* Effect.log(`Wrote ${written} files${dryRunSuffix}`);
161
+ return {
162
+ config,
163
+ ir,
164
+ pluginResult,
165
+ writeResults,
166
+ };
167
+ });
168
+ /**
169
+ * Layer that provides all services needed for generate()
170
+ *
171
+ * Note: PluginRunner is NOT included here because it needs to be
172
+ * created with the user's inflection config (from loaded config).
173
+ * The generate() function creates the PluginRunner internally.
174
+ */
175
+ export const GenerateLive = Layer.mergeAll(ConfigLoaderLive, Layer.effect(DatabaseIntrospectionService, DatabaseIntrospectionLive));
176
+ /**
177
+ * Run generate with all dependencies provided
178
+ *
179
+ * This is the main entry point for programmatic usage.
180
+ * Requires FileSystem, Path, and CommandExecutor from @effect/platform.
181
+ */
182
+ export const runGenerate = (options = {}) => generate(options).pipe(Effect.provide(GenerateLive));
183
+ //# sourceMappingURL=generate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate.js","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAoB,OAAO,EAAmB,MAAM,kBAAkB,CAAA;AAG7E,OAAO,EACL,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAoB,MAAM,2BAA2B,CAAA;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,oBAAoB,EAAmB,MAAM,qBAAqB,CAAA;AACjI,OAAO,EAeL,WAAW,GACZ,MAAM,aAAa,CAAA;AAmDpB;;;;GAIG;AACH,MAAM,YAAY,GAAG,CACnB,OAAe,EACf,SAAiB,EACkD,EAAE;IACrE,+DAA+D;IAC/D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AAE,CAAA;IACvD,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,OAAO,SAAS,YAAY,EAAE,CAAC,CAAA;IAE1D,OAAO;QACL,MAAM;QACN,EAAE;QACF,YAAY;QACZ,YAAY;KACb,CAAA;AACH,CAAC,CAAC,CAAA;AAEJ;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC,QAAQ,CACxC,gBAAgB,EAChB,KAAK,CAAC,MAAM,CAAC,4BAA4B,EAAE,yBAAyB,CAAC,CACtE,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,UAA2B,EAAE,EAK7B,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAA"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * pg-sourcerer - PostgreSQL code generation framework
3
+ *
4
+ * Main entry point
5
+ */
6
+ export { Config, TypeHint, TypeHintMatch, type ResolvedConfig, type ConfigInput } from "./config.js";
7
+ export { type ConfigLoader, ConfigLoaderService, ConfigLoaderLive, createConfigLoader, defineConfig, } from "./services/config-loader.js";
8
+ export * from "./errors.js";
9
+ export { type SemanticIR, type SemanticIRBuilder, type Entity, type TableEntity, type EnumEntity, type DomainEntity, type DomainConstraint, type CompositeEntity, type Shape, type Field, type Relation, type ExtensionInfo, type Artifact, type CapabilityKey, type PrimaryKey, type EntityKind, type DomainBaseTypeInfo, type FunctionEntity, type FunctionArg, type Volatility, createIRBuilder, freezeIR, isTableEntity, isEnumEntity, isDomainEntity, isCompositeEntity, isFunctionEntity, getTableEntities, getEnumEntities, getDomainEntities, getCompositeEntities, getFunctionEntities, type ReverseRelation, type AllRelations, getReverseRelations, getAllRelations, } from "./ir/index.js";
10
+ export { SmartTags, ShapeKind } from "./ir/index.js";
11
+ export { IR } from "./services/ir.js";
12
+ export { ArtifactStore, type ArtifactStoreImpl, createArtifactStore, ArtifactStoreLive } from "./services/artifact-store.js";
13
+ export { PluginMeta, type PluginMetaInfo } from "./services/plugin-meta.js";
14
+ export { type Plugin, type PluginFactory, type PluginInflection, type PluginServices, type ConfiguredPlugin, type SimplePluginContext, type SimplePluginDef, type SimplePluginLogger, definePlugin, } from "./services/plugin.js";
15
+ export { type CoreInflection, type InflectionConfig, type TransformFn, Inflection, inflect, defaultInflection, createInflection, makeInflectionLayer, composeInflectionConfigs, composeInflection, InflectionLive, classicInflectionConfig, ClassicInflectionLive, } from "./services/inflection.js";
16
+ export { type TypeHintRegistry, type TypeHintFieldMatch, TypeHints, createTypeHintRegistry, emptyTypeHintRegistry, TypeHintsLive, } from "./services/type-hints.js";
17
+ export { PgTypeOid, TsType, type TypeMappingResult, type TypeMapper, type EnumLookupResult, ExtensionTypeMap, defaultPgToTs, getExtensionTypeMapping, composeMappers, wrapArrayType, wrapNullable, findEnumByPgName, } from "./services/pg-types.js";
18
+ export { type SymbolRegistry, type Symbol, type SymbolRef, type ImportStatement, type SymbolCollision, Symbols, createSymbolRegistry, SymbolsLive, } from "./services/symbols.js";
19
+ export { type EmissionBuffer, type EmissionEntry, Emissions, createEmissionBuffer, EmissionsLive, } from "./services/emissions.js";
20
+ export { PluginRunner } from "./services/plugin-runner.js";
21
+ export { type FileWriter, type WriteResult, type WriteOptions, FileWriterSvc, createFileWriter, defaultHeader, FileWriterLive, } from "./services/file-writer.js";
22
+ export { type ParsedComment, type TagContext, parseSmartTags, } from "./services/smart-tags-parser.js";
23
+ export { type IRBuilder, type IRBuilderOptions, IRBuilderSvc, IRBuilderLive, createIRBuilderService, } from "./services/ir-builder.js";
24
+ export { PluginTestLayers, createPluginTestLayer, } from "./testing.js";
25
+ export { conjure, cast, type ChainBuilder, type ObjBuilder, type ArrBuilder, type FnBuilder, type SymbolContext, type SymbolMeta, type SymbolStatement, type SymbolProgram, } from "./lib/conjure.js";
26
+ export { hex, type SqlStyle, type QueryParts, buildTemplateLiteral, buildAwaitSqlTag, buildAwaitSqlString, buildQuery, buildFirstRowDecl, buildAllRowsDecl, buildReturnQuery, asyncFn, exportFn, } from "./lib/hex.js";
27
+ export { typesPlugin } from "./plugins/types.js";
28
+ export { zodPlugin } from "./plugins/zod.js";
29
+ export { arktypePlugin } from "./plugins/arktype.js";
30
+ export { effectModelPlugin } from "./plugins/effect-model.js";
31
+ export { sqlQueriesPlugin } from "./plugins/sql-queries.js";
32
+ export { kyselyQueriesPlugin } from "./plugins/kysely-queries.js";
33
+ export { generate, runGenerate, GenerateLive, type GenerateOptions, type GenerateResult, type GenerateError, } from "./generate.js";
34
+ export { type DatabaseIntrospection, type IntrospectOptions, DatabaseIntrospectionService, DatabaseIntrospectionLive, createDatabaseIntrospection, introspectDatabase, } from "./services/introspection.js";
35
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAA;AAGpG,OAAO,EACL,KAAK,YAAY,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,GACb,MAAM,6BAA6B,CAAA;AAGpC,cAAc,aAAa,CAAA;AAG3B,OAAO,EACL,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,KAAK,EACV,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,UAAU,EAC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,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAGjE,OAAO,EACL,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,aAAa,GACnB,MAAM,eAAe,CAAA;AAGtB,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,4BAA4B,EAC5B,yBAAyB,EACzB,2BAA2B,EAC3B,kBAAkB,GACnB,MAAM,6BAA6B,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,62 @@
1
+ /**
2
+ * pg-sourcerer - PostgreSQL code generation framework
3
+ *
4
+ * Main entry point
5
+ */
6
+ // Config
7
+ export { Config, TypeHint, TypeHintMatch } from "./config.js";
8
+ // Config Loader Service
9
+ export { ConfigLoaderService, ConfigLoaderLive, createConfigLoader, defineConfig, } from "./services/config-loader.js";
10
+ // Errors
11
+ export * from "./errors.js";
12
+ // IR
13
+ export { createIRBuilder, freezeIR,
14
+ // Type guards
15
+ isTableEntity, isEnumEntity, isDomainEntity, isCompositeEntity, isFunctionEntity,
16
+ // Helpers
17
+ getTableEntities, getEnumEntities, getDomainEntities, getCompositeEntities, getFunctionEntities, getReverseRelations, getAllRelations, } from "./ir/index.js";
18
+ export { SmartTags, ShapeKind } from "./ir/index.js";
19
+ // Services - IR
20
+ export { IR } from "./services/ir.js";
21
+ // Services - Artifact Store
22
+ export { ArtifactStore, createArtifactStore, ArtifactStoreLive } from "./services/artifact-store.js";
23
+ // Services - Plugin Meta
24
+ export { PluginMeta } from "./services/plugin-meta.js";
25
+ // Services - Plugin Types (Effect-native plugin interface)
26
+ export { definePlugin, } from "./services/plugin.js";
27
+ // Services - Inflection
28
+ export { Inflection, inflect, defaultInflection, createInflection, makeInflectionLayer, composeInflectionConfigs, composeInflection, InflectionLive, classicInflectionConfig, ClassicInflectionLive, } from "./services/inflection.js";
29
+ // Services - Type Hints
30
+ export { TypeHints, createTypeHintRegistry, emptyTypeHintRegistry, TypeHintsLive, } from "./services/type-hints.js";
31
+ // Services - PostgreSQL Type Mapping
32
+ export { PgTypeOid, TsType, ExtensionTypeMap, defaultPgToTs, getExtensionTypeMapping, composeMappers, wrapArrayType, wrapNullable, findEnumByPgName, } from "./services/pg-types.js";
33
+ // Services - Symbols
34
+ export { Symbols, createSymbolRegistry, SymbolsLive, } from "./services/symbols.js";
35
+ // Services - Emissions
36
+ export { Emissions, createEmissionBuffer, EmissionsLive, } from "./services/emissions.js";
37
+ // Services - Plugin Runner
38
+ export { PluginRunner } from "./services/plugin-runner.js";
39
+ // Services - File Writer
40
+ export { FileWriterSvc, createFileWriter, defaultHeader, FileWriterLive, } from "./services/file-writer.js";
41
+ // Services - Smart Tags Parser
42
+ export { parseSmartTags, } from "./services/smart-tags-parser.js";
43
+ // Services - IR Builder
44
+ export { IRBuilderSvc, IRBuilderLive, createIRBuilderService, } from "./services/ir-builder.js";
45
+ // Testing utilities
46
+ export { PluginTestLayers, createPluginTestLayer, } from "./testing.js";
47
+ // Conjure - AST builder DSL
48
+ export { conjure, cast, } from "./lib/conjure.js";
49
+ // Hex - SQL query building primitives
50
+ export { hex, buildTemplateLiteral, buildAwaitSqlTag, buildAwaitSqlString, buildQuery, buildFirstRowDecl, buildAllRowsDecl, buildReturnQuery, asyncFn, exportFn, } from "./lib/hex.js";
51
+ // Plugins
52
+ export { typesPlugin } from "./plugins/types.js";
53
+ export { zodPlugin } from "./plugins/zod.js";
54
+ export { arktypePlugin } from "./plugins/arktype.js";
55
+ export { effectModelPlugin } from "./plugins/effect-model.js";
56
+ export { sqlQueriesPlugin } from "./plugins/sql-queries.js";
57
+ export { kyselyQueriesPlugin } from "./plugins/kysely-queries.js";
58
+ // Generate orchestration
59
+ export { generate, runGenerate, GenerateLive, } from "./generate.js";
60
+ // Database introspection
61
+ export { DatabaseIntrospectionService, DatabaseIntrospectionLive, createDatabaseIntrospection, introspectDatabase, } from "./services/introspection.js";
62
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,SAAS;AACT,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAyC,MAAM,aAAa,CAAA;AAEpG,wBAAwB;AACxB,OAAO,EAEL,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,GACb,MAAM,6BAA6B,CAAA;AAEpC,SAAS;AACT,cAAc,aAAa,CAAA;AAE3B,KAAK;AACL,OAAO,EAqBL,eAAe,EACf,QAAQ;AACR,cAAc;AACd,aAAa,EACb,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,gBAAgB;AAChB,UAAU;AACV,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EAInB,mBAAmB,EACnB,eAAe,GAChB,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAEpD,gBAAgB;AAChB,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;AAErC,4BAA4B;AAC5B,OAAO,EAAE,aAAa,EAA0B,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAE5H,yBAAyB;AACzB,OAAO,EAAE,UAAU,EAAuB,MAAM,2BAA2B,CAAA;AAE3E,2DAA2D;AAC3D,OAAO,EAUL,YAAY,GACb,MAAM,sBAAsB,CAAA;AAE7B,wBAAwB;AACxB,OAAO,EAIL,UAAU,EACV,OAAO,EACP,iBAAiB,EACjB,gBAAgB,EAChB,m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O,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE,yBAAyB;AACzB,OAAO,EACL,QAAQ,EACR,WAAW,EACX,YAAY,GAIb,MAAM,eAAe,CAAA;AAEtB,yBAAyB;AACzB,OAAO,EAGL,4BAA4B,EAC5B,yBAAyB,EACzB,2BAA2B,EAC3B,kBAAkB,GACnB,MAAM,6BAA6B,CAAA"}
package/dist/init.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import { FileSystem, Terminal } from "@effect/platform";
2
+ import { Effect } from "effect";
3
+ export declare const runInit: Effect.Effect<undefined, Error | import("@effect/platform/Error").PlatformError, FileSystem.FileSystem | Terminal.Terminal>;
4
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,EAAW,MAAM,EAAE,MAAM,QAAQ,CAAA;AAmQxC,eAAO,MAAM,OAAO,6HA+ClB,CAAA"}
package/dist/init.js ADDED
@@ -0,0 +1,229 @@
1
+ /**
2
+ * pg-sourcerer init command
3
+ *
4
+ * Interactive config generator using @effect/cli Prompt.
5
+ * Uses conjure AST builder to generate the config file.
6
+ */
7
+ import { Prompt } from "@effect/cli";
8
+ import { FileSystem } from "@effect/platform";
9
+ import { Console, Effect } from "effect";
10
+ import postgres from "postgres";
11
+ import { conjure, cast } from "./lib/conjure.js";
12
+ import recast from "recast";
13
+ const availablePlugins = [
14
+ {
15
+ title: "types",
16
+ value: "types",
17
+ description: "TypeScript type definitions",
18
+ importName: "typesPlugin",
19
+ selected: true, // Default selected
20
+ },
21
+ {
22
+ title: "zod",
23
+ value: "zod",
24
+ description: "Zod validation schemas",
25
+ importName: "zodPlugin",
26
+ },
27
+ {
28
+ title: "arktype",
29
+ value: "arktype",
30
+ description: "ArkType schemas",
31
+ importName: "arktypePlugin",
32
+ },
33
+ {
34
+ title: "effect-model",
35
+ value: "effect-model",
36
+ description: "Effect Schema models",
37
+ importName: "effectModelPlugin",
38
+ },
39
+ {
40
+ title: "sql-queries",
41
+ value: "sql-queries",
42
+ description: "SQL query functions",
43
+ importName: "sqlQueriesPlugin",
44
+ },
45
+ {
46
+ title: "kysely-queries",
47
+ value: "kysely-queries",
48
+ description: "Kysely query builders",
49
+ importName: "kyselyQueriesPlugin",
50
+ },
51
+ ];
52
+ // ============================================================================
53
+ // Prompts
54
+ // ============================================================================
55
+ const connectionStringPrompt = Prompt.text({
56
+ message: "Database connection string",
57
+ validate: (value) => value.trim().length === 0
58
+ ? Effect.fail("Connection string is required")
59
+ : Effect.succeed(value.trim()),
60
+ });
61
+ /**
62
+ * Prompt for connection string and immediately test it.
63
+ * Re-prompts on failure until successful.
64
+ */
65
+ const promptAndTestConnection = (defaultValue) => Effect.gen(function* () {
66
+ const prompt = defaultValue
67
+ ? Prompt.text({ message: "Database connection string", default: defaultValue })
68
+ : connectionStringPrompt;
69
+ const connStr = yield* prompt;
70
+ yield* Console.log("Testing connection...");
71
+ const result = yield* testConnection(connStr).pipe(Effect.map((version) => ({ success: true, version })), Effect.catchAll((e) => Effect.succeed({ success: false, error: e.message })));
72
+ if (result.success) {
73
+ yield* Console.log(`✓ Connected to ${result.version}\n`);
74
+ return connStr;
75
+ }
76
+ else {
77
+ yield* Console.error(`✗ ${result.error}`);
78
+ yield* Console.log("Please try again.\n");
79
+ // On retry, use the failed value as the new default so user can edit it
80
+ return yield* promptAndTestConnection(connStr);
81
+ }
82
+ });
83
+ /**
84
+ * Role prompt with explanation of when to use it.
85
+ *
86
+ * If using Row Level Security (RLS), set this to the role your app connects as.
87
+ * This ensures generated types only include columns/tables visible to that role.
88
+ * Leave empty if not using RLS or connecting as a superuser.
89
+ */
90
+ const makeRolePrompt = () => Prompt.text({
91
+ message: "PostgreSQL role (for RLS - leave empty if not using RLS)",
92
+ default: "",
93
+ }).pipe(Prompt.map((s) => s.trim() || undefined));
94
+ const makeSchemasPrompt = () => Prompt.text({
95
+ message: "Schemas to introspect (comma-separated)",
96
+ default: "public",
97
+ }).pipe(Prompt.map((s) => s.split(",").map((x) => x.trim()).filter((x) => x.length > 0)));
98
+ const makeOutputDirPrompt = () => Prompt.text({
99
+ message: "Output directory",
100
+ default: "src/generated",
101
+ });
102
+ const makePluginsPrompt = () => Prompt.multiSelect({
103
+ message: "Select plugins to enable (space to toggle, enter to confirm)",
104
+ choices: availablePlugins.map((p) => ({
105
+ title: `${p.title} - ${p.description}`,
106
+ value: p.value,
107
+ selected: p.selected,
108
+ })),
109
+ });
110
+ const makeClassicInflectionPrompt = () => Prompt.confirm({
111
+ message: "Use classic inflection? (PascalCase entities, camelCase fields)",
112
+ initial: true,
113
+ });
114
+ const makeFormatterPrompt = () => Prompt.text({
115
+ message: "Formatter command (optional, leave empty to skip)",
116
+ default: "",
117
+ });
118
+ // ============================================================================
119
+ // Connection Test
120
+ // ============================================================================
121
+ const testConnection = (connectionString) => Effect.tryPromise({
122
+ try: async () => {
123
+ const sql = postgres(connectionString, { max: 1 });
124
+ try {
125
+ const result = await sql `SELECT version()`;
126
+ const version = result[0]?.["version"];
127
+ // Extract just the version number (e.g., "PostgreSQL 15.2")
128
+ const match = version.match(/PostgreSQL [\d.]+/);
129
+ return match?.[0] ?? "PostgreSQL";
130
+ }
131
+ finally {
132
+ await sql.end();
133
+ }
134
+ },
135
+ catch: (error) => new Error(`Connection failed: ${error instanceof Error ? error.message : String(error)}`),
136
+ });
137
+ const generateConfigContent = (answers) => {
138
+ const selectedPlugins = availablePlugins.filter((p) => answers.plugins.includes(p.value));
139
+ // Build import specifiers
140
+ const coreImports = ["defineConfig"];
141
+ if (answers.classicInflection) {
142
+ coreImports.push("classicInflectionConfig");
143
+ }
144
+ const allImports = [...coreImports, ...selectedPlugins.map((p) => p.importName)];
145
+ // Build the import statement
146
+ const importDecl = conjure.b.importDeclaration(allImports.map((name) => conjure.b.importSpecifier(conjure.b.identifier(name))), conjure.str("@danielfgray/pg-sourcerer"));
147
+ // Build the config object
148
+ let configObj = conjure.obj()
149
+ .prop("connectionString", conjure.str(answers.connectionString));
150
+ // Role (only if set)
151
+ if (answers.role) {
152
+ configObj = configObj.prop("role", conjure.str(answers.role));
153
+ }
154
+ // Schemas (only if not just ["public"])
155
+ if (answers.schemas.length !== 1 || answers.schemas[0] !== "public") {
156
+ const schemasArr = conjure.arr(...answers.schemas.map((s) => conjure.str(s)));
157
+ configObj = configObj.prop("schemas", schemasArr.build());
158
+ }
159
+ // Output directory (only if not default)
160
+ if (answers.outputDir !== "src/generated") {
161
+ configObj = configObj.prop("outputDir", conjure.str(answers.outputDir));
162
+ }
163
+ // Formatter (only if set)
164
+ if (answers.formatter.trim()) {
165
+ configObj = configObj.prop("formatter", conjure.str(answers.formatter.trim()));
166
+ }
167
+ // Inflection (only if classic)
168
+ if (answers.classicInflection) {
169
+ configObj = configObj.prop("inflection", conjure.id("classicInflectionConfig").build());
170
+ }
171
+ // Plugins array
172
+ const pluginCalls = selectedPlugins.map((plugin) => conjure.id(plugin.importName)
173
+ .call([conjure.obj().prop("outputDir", conjure.str(plugin.value)).build()])
174
+ .build());
175
+ const pluginsArr = conjure.arr(...pluginCalls);
176
+ configObj = configObj.prop("plugins", pluginsArr.build());
177
+ // Build the export default statement
178
+ const defineConfigCall = conjure.id("defineConfig").call([configObj.build()]).build();
179
+ const exportDefault = conjure.b.exportDefaultDeclaration(cast.toExpr(defineConfigCall));
180
+ // Build the program and print with 2-space indentation
181
+ const program = conjure.program(importDecl, exportDefault);
182
+ return recast.print(program, { tabWidth: 2 }).code + "\n";
183
+ };
184
+ // ============================================================================
185
+ // Main Init Effect
186
+ // ============================================================================
187
+ const CONFIG_FILENAME = "pgsourcerer.config.ts";
188
+ export const runInit = Effect.gen(function* () {
189
+ const fs = yield* FileSystem.FileSystem;
190
+ const configPath = `${process.cwd()}/${CONFIG_FILENAME}`;
191
+ // Check if config already exists
192
+ const exists = yield* fs.exists(configPath);
193
+ if (exists) {
194
+ yield* Console.error(`\n✗ ${CONFIG_FILENAME} already exists`);
195
+ yield* Console.log(" Edit it directly or delete it to start fresh.");
196
+ return yield* Effect.fail(new Error("Config already exists"));
197
+ }
198
+ yield* Console.log("\n🔧 pg-sourcerer config generator\n");
199
+ // Collect answers - connection string is tested immediately
200
+ const connectionString = yield* promptAndTestConnection();
201
+ const role = yield* makeRolePrompt();
202
+ const schemas = yield* makeSchemasPrompt();
203
+ const outputDir = yield* makeOutputDirPrompt();
204
+ const plugins = yield* makePluginsPrompt();
205
+ const classicInflection = yield* makeClassicInflectionPrompt();
206
+ const formatter = yield* makeFormatterPrompt();
207
+ // Validate at least one plugin selected
208
+ if (plugins.length === 0) {
209
+ yield* Console.error("✗ At least one plugin must be selected");
210
+ return yield* Effect.fail(new Error("No plugins selected"));
211
+ }
212
+ const answers = {
213
+ connectionString,
214
+ role,
215
+ schemas: schemas.length > 0 ? schemas : ["public"],
216
+ outputDir: outputDir.trim() || "src/generated",
217
+ plugins,
218
+ classicInflection,
219
+ formatter,
220
+ };
221
+ // Generate and write config
222
+ const configContent = generateConfigContent(answers);
223
+ yield* fs.writeFileString(configPath, configContent);
224
+ yield* Console.log(`\n✓ Created ${CONFIG_FILENAME}`);
225
+ yield* Console.log("\nNext steps:");
226
+ yield* Console.log(" 1. Review the generated config file");
227
+ yield* Console.log(" 2. Run: pgsourcerer generate");
228
+ });
229
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.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QAC9C,OAAO;QACP,iBAAiB;QACjB,SAAS;KACV,CAAA;IAED,4BAA4B;IAC5B,MAAM,aAAa,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAA;IACpD,KAAK,CAAC,CAAC,EAAE,CAAC,eAAe,CAAC,UAAU,EAAE,aAAa,CAAC,CAAA;IAEpD,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,eAAe,EAAE,CAAC,CAAA;IACpD,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;IACnC,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAA;IAC3D,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAA;AACtD,CAAC,CAAC,CAAA"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * IR module exports
3
+ */
4
+ export * from "./semantic-ir.js";
5
+ export * from "./smart-tags.js";
6
+ export * from "./relation-graph.js";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ir/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * IR module exports
3
+ */
4
+ export * from "./semantic-ir.js";
5
+ export * from "./smart-tags.js";
6
+ export * from "./relation-graph.js";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ir/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA"}