postgresdk 0.1.1 → 0.1.2-alpha.1

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/dist/cli.js CHANGED
@@ -1,6 +1,467 @@
1
1
  #!/usr/bin/env node
2
+ import { createRequire } from "node:module";
3
+ var __create = Object.create;
4
+ var __getProtoOf = Object.getPrototypeOf;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __toESM = (mod, isNodeMode, target) => {
9
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
10
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
11
+ for (let key of __getOwnPropNames(mod))
12
+ if (!__hasOwnProp.call(to, key))
13
+ __defProp(to, key, {
14
+ get: () => mod[key],
15
+ enumerable: true
16
+ });
17
+ return to;
18
+ };
19
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
20
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
21
+
22
+ // node_modules/dotenv/package.json
23
+ var require_package = __commonJS((exports, module) => {
24
+ module.exports = {
25
+ name: "dotenv",
26
+ version: "17.2.1",
27
+ description: "Loads environment variables from .env file",
28
+ main: "lib/main.js",
29
+ types: "lib/main.d.ts",
30
+ exports: {
31
+ ".": {
32
+ types: "./lib/main.d.ts",
33
+ require: "./lib/main.js",
34
+ default: "./lib/main.js"
35
+ },
36
+ "./config": "./config.js",
37
+ "./config.js": "./config.js",
38
+ "./lib/env-options": "./lib/env-options.js",
39
+ "./lib/env-options.js": "./lib/env-options.js",
40
+ "./lib/cli-options": "./lib/cli-options.js",
41
+ "./lib/cli-options.js": "./lib/cli-options.js",
42
+ "./package.json": "./package.json"
43
+ },
44
+ scripts: {
45
+ "dts-check": "tsc --project tests/types/tsconfig.json",
46
+ lint: "standard",
47
+ pretest: "npm run lint && npm run dts-check",
48
+ test: "tap run --allow-empty-coverage --disable-coverage --timeout=60000",
49
+ "test:coverage": "tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",
50
+ prerelease: "npm test",
51
+ release: "standard-version"
52
+ },
53
+ repository: {
54
+ type: "git",
55
+ url: "git://github.com/motdotla/dotenv.git"
56
+ },
57
+ homepage: "https://github.com/motdotla/dotenv#readme",
58
+ funding: "https://dotenvx.com",
59
+ keywords: [
60
+ "dotenv",
61
+ "env",
62
+ ".env",
63
+ "environment",
64
+ "variables",
65
+ "config",
66
+ "settings"
67
+ ],
68
+ readmeFilename: "README.md",
69
+ license: "BSD-2-Clause",
70
+ devDependencies: {
71
+ "@types/node": "^18.11.3",
72
+ decache: "^4.6.2",
73
+ sinon: "^14.0.1",
74
+ standard: "^17.0.0",
75
+ "standard-version": "^9.5.0",
76
+ tap: "^19.2.0",
77
+ typescript: "^4.8.4"
78
+ },
79
+ engines: {
80
+ node: ">=12"
81
+ },
82
+ browser: {
83
+ fs: false
84
+ }
85
+ };
86
+ });
87
+
88
+ // node_modules/dotenv/lib/main.js
89
+ var require_main = __commonJS((exports, module) => {
90
+ var fs = __require("fs");
91
+ var path = __require("path");
92
+ var os = __require("os");
93
+ var crypto = __require("crypto");
94
+ var packageJson = require_package();
95
+ var version = packageJson.version;
96
+ var TIPS = [
97
+ "\uD83D\uDD10 encrypt with Dotenvx: https://dotenvx.com",
98
+ "\uD83D\uDD10 prevent committing .env to code: https://dotenvx.com/precommit",
99
+ "\uD83D\uDD10 prevent building .env in docker: https://dotenvx.com/prebuild",
100
+ "\uD83D\uDCE1 observe env with Radar: https://dotenvx.com/radar",
101
+ "\uD83D\uDCE1 auto-backup env with Radar: https://dotenvx.com/radar",
102
+ "\uD83D\uDCE1 version env with Radar: https://dotenvx.com/radar",
103
+ "\uD83D\uDEE0️ run anywhere with `dotenvx run -- yourcommand`",
104
+ "⚙️ specify custom .env file path with { path: '/custom/path/.env' }",
105
+ "⚙️ enable debug logging with { debug: true }",
106
+ "⚙️ override existing env vars with { override: true }",
107
+ "⚙️ suppress all logs with { quiet: true }",
108
+ "⚙️ write to custom object with { processEnv: myObject }",
109
+ "⚙️ load multiple .env files with { path: ['.env.local', '.env'] }"
110
+ ];
111
+ function _getRandomTip() {
112
+ return TIPS[Math.floor(Math.random() * TIPS.length)];
113
+ }
114
+ function parseBoolean(value) {
115
+ if (typeof value === "string") {
116
+ return !["false", "0", "no", "off", ""].includes(value.toLowerCase());
117
+ }
118
+ return Boolean(value);
119
+ }
120
+ function supportsAnsi() {
121
+ return process.stdout.isTTY;
122
+ }
123
+ function dim(text) {
124
+ return supportsAnsi() ? `\x1B[2m${text}\x1B[0m` : text;
125
+ }
126
+ var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
127
+ function parse(src) {
128
+ const obj = {};
129
+ let lines = src.toString();
130
+ lines = lines.replace(/\r\n?/mg, `
131
+ `);
132
+ let match;
133
+ while ((match = LINE.exec(lines)) != null) {
134
+ const key = match[1];
135
+ let value = match[2] || "";
136
+ value = value.trim();
137
+ const maybeQuote = value[0];
138
+ value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
139
+ if (maybeQuote === '"') {
140
+ value = value.replace(/\\n/g, `
141
+ `);
142
+ value = value.replace(/\\r/g, "\r");
143
+ }
144
+ obj[key] = value;
145
+ }
146
+ return obj;
147
+ }
148
+ function _parseVault(options) {
149
+ options = options || {};
150
+ const vaultPath = _vaultPath(options);
151
+ options.path = vaultPath;
152
+ const result = DotenvModule.configDotenv(options);
153
+ if (!result.parsed) {
154
+ const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
155
+ err.code = "MISSING_DATA";
156
+ throw err;
157
+ }
158
+ const keys = _dotenvKey(options).split(",");
159
+ const length = keys.length;
160
+ let decrypted;
161
+ for (let i = 0;i < length; i++) {
162
+ try {
163
+ const key = keys[i].trim();
164
+ const attrs = _instructions(result, key);
165
+ decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
166
+ break;
167
+ } catch (error) {
168
+ if (i + 1 >= length) {
169
+ throw error;
170
+ }
171
+ }
172
+ }
173
+ return DotenvModule.parse(decrypted);
174
+ }
175
+ function _warn(message) {
176
+ console.error(`[dotenv@${version}][WARN] ${message}`);
177
+ }
178
+ function _debug(message) {
179
+ console.log(`[dotenv@${version}][DEBUG] ${message}`);
180
+ }
181
+ function _log(message) {
182
+ console.log(`[dotenv@${version}] ${message}`);
183
+ }
184
+ function _dotenvKey(options) {
185
+ if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
186
+ return options.DOTENV_KEY;
187
+ }
188
+ if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
189
+ return process.env.DOTENV_KEY;
190
+ }
191
+ return "";
192
+ }
193
+ function _instructions(result, dotenvKey) {
194
+ let uri;
195
+ try {
196
+ uri = new URL(dotenvKey);
197
+ } catch (error) {
198
+ if (error.code === "ERR_INVALID_URL") {
199
+ const err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
200
+ err.code = "INVALID_DOTENV_KEY";
201
+ throw err;
202
+ }
203
+ throw error;
204
+ }
205
+ const key = uri.password;
206
+ if (!key) {
207
+ const err = new Error("INVALID_DOTENV_KEY: Missing key part");
208
+ err.code = "INVALID_DOTENV_KEY";
209
+ throw err;
210
+ }
211
+ const environment = uri.searchParams.get("environment");
212
+ if (!environment) {
213
+ const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
214
+ err.code = "INVALID_DOTENV_KEY";
215
+ throw err;
216
+ }
217
+ const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
218
+ const ciphertext = result.parsed[environmentKey];
219
+ if (!ciphertext) {
220
+ const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
221
+ err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
222
+ throw err;
223
+ }
224
+ return { ciphertext, key };
225
+ }
226
+ function _vaultPath(options) {
227
+ let possibleVaultPath = null;
228
+ if (options && options.path && options.path.length > 0) {
229
+ if (Array.isArray(options.path)) {
230
+ for (const filepath of options.path) {
231
+ if (fs.existsSync(filepath)) {
232
+ possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
233
+ }
234
+ }
235
+ } else {
236
+ possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
237
+ }
238
+ } else {
239
+ possibleVaultPath = path.resolve(process.cwd(), ".env.vault");
240
+ }
241
+ if (fs.existsSync(possibleVaultPath)) {
242
+ return possibleVaultPath;
243
+ }
244
+ return null;
245
+ }
246
+ function _resolveHome(envPath) {
247
+ return envPath[0] === "~" ? path.join(os.homedir(), envPath.slice(1)) : envPath;
248
+ }
249
+ function _configVault(options) {
250
+ const debug = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options && options.debug);
251
+ const quiet = parseBoolean(process.env.DOTENV_CONFIG_QUIET || options && options.quiet);
252
+ if (debug || !quiet) {
253
+ _log("Loading env from encrypted .env.vault");
254
+ }
255
+ const parsed = DotenvModule._parseVault(options);
256
+ let processEnv = process.env;
257
+ if (options && options.processEnv != null) {
258
+ processEnv = options.processEnv;
259
+ }
260
+ DotenvModule.populate(processEnv, parsed, options);
261
+ return { parsed };
262
+ }
263
+ function configDotenv(options) {
264
+ const dotenvPath = path.resolve(process.cwd(), ".env");
265
+ let encoding = "utf8";
266
+ let processEnv = process.env;
267
+ if (options && options.processEnv != null) {
268
+ processEnv = options.processEnv;
269
+ }
270
+ let debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || options && options.debug);
271
+ let quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || options && options.quiet);
272
+ if (options && options.encoding) {
273
+ encoding = options.encoding;
274
+ } else {
275
+ if (debug) {
276
+ _debug("No encoding is specified. UTF-8 is used by default");
277
+ }
278
+ }
279
+ let optionPaths = [dotenvPath];
280
+ if (options && options.path) {
281
+ if (!Array.isArray(options.path)) {
282
+ optionPaths = [_resolveHome(options.path)];
283
+ } else {
284
+ optionPaths = [];
285
+ for (const filepath of options.path) {
286
+ optionPaths.push(_resolveHome(filepath));
287
+ }
288
+ }
289
+ }
290
+ let lastError;
291
+ const parsedAll = {};
292
+ for (const path2 of optionPaths) {
293
+ try {
294
+ const parsed = DotenvModule.parse(fs.readFileSync(path2, { encoding }));
295
+ DotenvModule.populate(parsedAll, parsed, options);
296
+ } catch (e) {
297
+ if (debug) {
298
+ _debug(`Failed to load ${path2} ${e.message}`);
299
+ }
300
+ lastError = e;
301
+ }
302
+ }
303
+ const populated = DotenvModule.populate(processEnv, parsedAll, options);
304
+ debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || debug);
305
+ quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || quiet);
306
+ if (debug || !quiet) {
307
+ const keysCount = Object.keys(populated).length;
308
+ const shortPaths = [];
309
+ for (const filePath of optionPaths) {
310
+ try {
311
+ const relative = path.relative(process.cwd(), filePath);
312
+ shortPaths.push(relative);
313
+ } catch (e) {
314
+ if (debug) {
315
+ _debug(`Failed to load ${filePath} ${e.message}`);
316
+ }
317
+ lastError = e;
318
+ }
319
+ }
320
+ _log(`injecting env (${keysCount}) from ${shortPaths.join(",")} ${dim(`-- tip: ${_getRandomTip()}`)}`);
321
+ }
322
+ if (lastError) {
323
+ return { parsed: parsedAll, error: lastError };
324
+ } else {
325
+ return { parsed: parsedAll };
326
+ }
327
+ }
328
+ function config(options) {
329
+ if (_dotenvKey(options).length === 0) {
330
+ return DotenvModule.configDotenv(options);
331
+ }
332
+ const vaultPath = _vaultPath(options);
333
+ if (!vaultPath) {
334
+ _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
335
+ return DotenvModule.configDotenv(options);
336
+ }
337
+ return DotenvModule._configVault(options);
338
+ }
339
+ function decrypt(encrypted, keyStr) {
340
+ const key = Buffer.from(keyStr.slice(-64), "hex");
341
+ let ciphertext = Buffer.from(encrypted, "base64");
342
+ const nonce = ciphertext.subarray(0, 12);
343
+ const authTag = ciphertext.subarray(-16);
344
+ ciphertext = ciphertext.subarray(12, -16);
345
+ try {
346
+ const aesgcm = crypto.createDecipheriv("aes-256-gcm", key, nonce);
347
+ aesgcm.setAuthTag(authTag);
348
+ return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
349
+ } catch (error) {
350
+ const isRange = error instanceof RangeError;
351
+ const invalidKeyLength = error.message === "Invalid key length";
352
+ const decryptionFailed = error.message === "Unsupported state or unable to authenticate data";
353
+ if (isRange || invalidKeyLength) {
354
+ const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
355
+ err.code = "INVALID_DOTENV_KEY";
356
+ throw err;
357
+ } else if (decryptionFailed) {
358
+ const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
359
+ err.code = "DECRYPTION_FAILED";
360
+ throw err;
361
+ } else {
362
+ throw error;
363
+ }
364
+ }
365
+ }
366
+ function populate(processEnv, parsed, options = {}) {
367
+ const debug = Boolean(options && options.debug);
368
+ const override = Boolean(options && options.override);
369
+ const populated = {};
370
+ if (typeof parsed !== "object") {
371
+ const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
372
+ err.code = "OBJECT_REQUIRED";
373
+ throw err;
374
+ }
375
+ for (const key of Object.keys(parsed)) {
376
+ if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
377
+ if (override === true) {
378
+ processEnv[key] = parsed[key];
379
+ populated[key] = parsed[key];
380
+ }
381
+ if (debug) {
382
+ if (override === true) {
383
+ _debug(`"${key}" is already defined and WAS overwritten`);
384
+ } else {
385
+ _debug(`"${key}" is already defined and was NOT overwritten`);
386
+ }
387
+ }
388
+ } else {
389
+ processEnv[key] = parsed[key];
390
+ populated[key] = parsed[key];
391
+ }
392
+ }
393
+ return populated;
394
+ }
395
+ var DotenvModule = {
396
+ configDotenv,
397
+ _configVault,
398
+ _parseVault,
399
+ config,
400
+ decrypt,
401
+ parse,
402
+ populate
403
+ };
404
+ exports.configDotenv = DotenvModule.configDotenv;
405
+ exports._configVault = DotenvModule._configVault;
406
+ exports._parseVault = DotenvModule._parseVault;
407
+ exports.config = DotenvModule.config;
408
+ exports.decrypt = DotenvModule.decrypt;
409
+ exports.parse = DotenvModule.parse;
410
+ exports.populate = DotenvModule.populate;
411
+ module.exports = DotenvModule;
412
+ });
413
+
414
+ // node_modules/dotenv/lib/env-options.js
415
+ var require_env_options = __commonJS((exports, module) => {
416
+ var options = {};
417
+ if (process.env.DOTENV_CONFIG_ENCODING != null) {
418
+ options.encoding = process.env.DOTENV_CONFIG_ENCODING;
419
+ }
420
+ if (process.env.DOTENV_CONFIG_PATH != null) {
421
+ options.path = process.env.DOTENV_CONFIG_PATH;
422
+ }
423
+ if (process.env.DOTENV_CONFIG_QUIET != null) {
424
+ options.quiet = process.env.DOTENV_CONFIG_QUIET;
425
+ }
426
+ if (process.env.DOTENV_CONFIG_DEBUG != null) {
427
+ options.debug = process.env.DOTENV_CONFIG_DEBUG;
428
+ }
429
+ if (process.env.DOTENV_CONFIG_OVERRIDE != null) {
430
+ options.override = process.env.DOTENV_CONFIG_OVERRIDE;
431
+ }
432
+ if (process.env.DOTENV_CONFIG_DOTENV_KEY != null) {
433
+ options.DOTENV_KEY = process.env.DOTENV_CONFIG_DOTENV_KEY;
434
+ }
435
+ module.exports = options;
436
+ });
437
+
438
+ // node_modules/dotenv/lib/cli-options.js
439
+ var require_cli_options = __commonJS((exports, module) => {
440
+ var re = /^dotenv_config_(encoding|path|quiet|debug|override|DOTENV_KEY)=(.+)$/;
441
+ module.exports = function optionMatcher(args) {
442
+ const options = args.reduce(function(acc, cur) {
443
+ const matches = cur.match(re);
444
+ if (matches) {
445
+ acc[matches[1]] = matches[2];
446
+ }
447
+ return acc;
448
+ }, {});
449
+ if (!("quiet" in options)) {
450
+ options.quiet = "true";
451
+ }
452
+ return options;
453
+ };
454
+ });
455
+
456
+ // node_modules/dotenv/config.js
457
+ var require_config = __commonJS(() => {
458
+ (function() {
459
+ require_main().config(Object.assign({}, require_env_options(), require_cli_options()(process.argv)));
460
+ })();
461
+ });
2
462
 
3
463
  // src/index.ts
464
+ var import_config = __toESM(require_config(), 1);
4
465
  import { join } from "node:path";
5
466
  import { pathToFileURL } from "node:url";
6
467
 
@@ -1198,6 +1659,87 @@ export async function authMiddleware(c: Context, next: Next) {
1198
1659
  `;
1199
1660
  }
1200
1661
 
1662
+ // src/emit-server-index.ts
1663
+ function emitServerIndex(tables, hasAuth) {
1664
+ const tableNames = tables.map((t) => t.name).sort();
1665
+ const imports = tableNames.map((name) => {
1666
+ const Type = pascal(name);
1667
+ return `import { register${Type}Routes } from "./routes/${name}";`;
1668
+ }).join(`
1669
+ `);
1670
+ const registrations = tableNames.map((name) => {
1671
+ const Type = pascal(name);
1672
+ return ` register${Type}Routes(router, deps);`;
1673
+ }).join(`
1674
+ `);
1675
+ const reExports = tableNames.map((name) => {
1676
+ const Type = pascal(name);
1677
+ return `export { register${Type}Routes } from "./routes/${name}";`;
1678
+ }).join(`
1679
+ `);
1680
+ return `/* Generated. Do not edit. */
1681
+ import { Hono } from "hono";
1682
+ ${imports}
1683
+ ${hasAuth ? `export { authMiddleware } from "./auth";` : ""}
1684
+
1685
+ /**
1686
+ * Creates a Hono router with all generated routes that can be mounted into your existing app.
1687
+ *
1688
+ * @example
1689
+ * import { Hono } from "hono";
1690
+ * import { Client } from "pg";
1691
+ * import { createRouter } from "./generated/server";
1692
+ *
1693
+ * const app = new Hono();
1694
+ * const pg = new Client({ connectionString: process.env.DATABASE_URL });
1695
+ * await pg.connect();
1696
+ *
1697
+ * // Mount all generated routes under /api
1698
+ * const apiRouter = createRouter({ pg });
1699
+ * app.route("/api", apiRouter);
1700
+ *
1701
+ * // Or mount directly at root
1702
+ * const router = createRouter({ pg });
1703
+ * app.route("/", router);
1704
+ */
1705
+ export function createRouter(
1706
+ deps: { pg: { query: (text: string, params?: any[]) => Promise<{ rows: any[] }> } }
1707
+ ): Hono {
1708
+ const router = new Hono();
1709
+ ${registrations}
1710
+ return router;
1711
+ }
1712
+
1713
+ /**
1714
+ * Register all generated routes directly on an existing Hono app.
1715
+ *
1716
+ * @example
1717
+ * import { Hono } from "hono";
1718
+ * import { Client } from "pg";
1719
+ * import { registerAllRoutes } from "./generated/server";
1720
+ *
1721
+ * const app = new Hono();
1722
+ * const pg = new Client({ connectionString: process.env.DATABASE_URL });
1723
+ * await pg.connect();
1724
+ *
1725
+ * // Register all routes at once
1726
+ * registerAllRoutes(app, { pg });
1727
+ */
1728
+ export function registerAllRoutes(
1729
+ app: Hono,
1730
+ deps: { pg: { query: (text: string, params?: any[]) => Promise<{ rows: any[] }> } }
1731
+ ) {
1732
+ ${registrations.replace(/router/g, "app")}
1733
+ }
1734
+
1735
+ // Individual route registrations (for selective use)
1736
+ ${reExports}
1737
+
1738
+ // Re-export types and schemas for convenience
1739
+ export * from "./include-spec";
1740
+ `;
1741
+ }
1742
+
1201
1743
  // src/index.ts
1202
1744
  async function generate(configPath) {
1203
1745
  const configUrl = pathToFileURL(configPath).href;
@@ -1260,6 +1802,10 @@ async function generate(configPath) {
1260
1802
  path: join(clientDir, "index.ts"),
1261
1803
  content: emitClientIndex(Object.values(model.tables))
1262
1804
  });
1805
+ files.push({
1806
+ path: join(serverDir, "index.ts"),
1807
+ content: emitServerIndex(Object.values(model.tables), !!cfg.auth?.strategy && cfg.auth.strategy !== "none")
1808
+ });
1263
1809
  console.log("✍️ Writing files...");
1264
1810
  await writeFiles(files);
1265
1811
  console.log(`✅ Generated ${files.length} files`);
@@ -1268,6 +1814,7 @@ async function generate(configPath) {
1268
1814
  }
1269
1815
 
1270
1816
  // src/cli.ts
1817
+ var import_config2 = __toESM(require_config(), 1);
1271
1818
  import { resolve } from "node:path";
1272
1819
  import { readFileSync } from "node:fs";
1273
1820
  import { fileURLToPath } from "node:url";
@@ -0,0 +1,5 @@
1
+ import type { Table } from "./introspect";
2
+ /**
3
+ * Emits the server index file that exports helper functions for route registration
4
+ */
5
+ export declare function emitServerIndex(tables: Table[], hasAuth: boolean): string;
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
+ import "dotenv/config";
1
2
  export declare function generate(configPath: string): Promise<void>;