postgresdk 0.9.6 → 0.9.7

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/README.md CHANGED
@@ -88,7 +88,7 @@ export default {
88
88
  outServer: "./api/server", // Server code output directory
89
89
  outClient: "./api/client", // Client SDK output directory
90
90
  softDeleteColumn: null, // Column name for soft deletes (e.g., "deleted_at")
91
- includeDepthLimit: 3, // Max depth for nested includes
91
+ includeMethodsDepth: 2, // Max depth for nested includes
92
92
  dateType: "date", // "date" | "string" - How to handle timestamps
93
93
  serverFramework: "hono", // Currently only hono is supported
94
94
  useJsExtensions: false, // Add .js to imports (for Vercel Edge, Deno)
package/dist/cli.js CHANGED
@@ -1355,11 +1355,11 @@ function extractConfigFields(configContent) {
1355
1355
  isCommented: !!softDeleteMatch[1]
1356
1356
  });
1357
1357
  }
1358
- const depthMatch = configContent.match(/^\s*(\/\/)?\s*includeDepthLimit:\s*(\d+)/m);
1358
+ const depthMatch = configContent.match(/^\s*(\/\/)?\s*(includeMethodsDepth|includeDepthLimit):\s*(\d+)/m);
1359
1359
  if (depthMatch) {
1360
1360
  fields.push({
1361
- key: "includeDepthLimit",
1362
- value: parseInt(depthMatch[2]),
1361
+ key: "includeMethodsDepth",
1362
+ value: parseInt(depthMatch[3]),
1363
1363
  description: "Maximum depth for nested relationship includes",
1364
1364
  isCommented: !!depthMatch[1]
1365
1365
  });
@@ -1469,9 +1469,9 @@ export default {
1469
1469
 
1470
1470
  /**
1471
1471
  * Maximum depth for nested relationship includes to prevent infinite loops
1472
- * @default 3
1472
+ * @default 2
1473
1473
  */
1474
- ${getFieldLine("includeDepthLimit", existingFields, mergeStrategy, "3", userChoices)}
1474
+ ${getFieldLine("includeMethodsDepth", existingFields, mergeStrategy, "2", userChoices)}
1475
1475
 
1476
1476
 
1477
1477
  /**
@@ -1793,9 +1793,9 @@ export default {
1793
1793
 
1794
1794
  /**
1795
1795
  * Maximum depth for nested relationship includes to prevent infinite loops
1796
- * @default 3
1796
+ * @default 2
1797
1797
  */
1798
- // includeDepthLimit: 3,
1798
+ // includeMethodsDepth: 2,
1799
1799
 
1800
1800
 
1801
1801
  /**
@@ -2359,7 +2359,7 @@ export function register${Type}Routes(app: Hono, deps: { pg: { query: (text: str
2359
2359
  table: "${fileTableName}",
2360
2360
  pkColumns: ${JSON.stringify(safePkCols)},
2361
2361
  softDeleteColumn: ${softDel ? `"${softDel}"` : "null"},
2362
- includeDepthLimit: ${opts.includeDepthLimit}
2362
+ includeMethodsDepth: ${opts.includeMethodsDepth}
2363
2363
  };
2364
2364
  ${hasAuth ? `
2365
2365
  // \uD83D\uDD10 Auth: protect all routes for this table
@@ -2420,7 +2420,7 @@ ${hasAuth ? `
2420
2420
  result.data,
2421
2421
  result.includeSpec,
2422
2422
  deps.pg,
2423
- ${opts.includeDepthLimit}
2423
+ ${opts.includeMethodsDepth}
2424
2424
  );
2425
2425
  return c.json(stitched);
2426
2426
  } catch (e: any) {
@@ -3492,7 +3492,7 @@ export interface OperationContext {
3492
3492
  table: string;
3493
3493
  pkColumns: string[];
3494
3494
  softDeleteColumn?: string | null;
3495
- includeDepthLimit: number;
3495
+ includeMethodsDepth: number;
3496
3496
  }
3497
3497
 
3498
3498
  const DEBUG = process.env.SDK_DEBUG === "1" || process.env.SDK_DEBUG === "true";
@@ -4535,7 +4535,7 @@ async function generate(configPath) {
4535
4535
  if (serverFramework === "hono") {
4536
4536
  routeContent = emitHonoRoutes(table, graph, {
4537
4537
  softDeleteColumn: cfg.softDeleteColumn || null,
4538
- includeDepthLimit: cfg.includeMethodsDepth || 2,
4538
+ includeMethodsDepth: cfg.includeMethodsDepth || 2,
4539
4539
  authStrategy: normalizedAuth?.strategy,
4540
4540
  useJsExtensions: cfg.useJsExtensions
4541
4541
  });
@@ -12,7 +12,7 @@ export interface OperationContext {
12
12
  table: string;
13
13
  pkColumns: string[];
14
14
  softDeleteColumn?: string | null;
15
- includeDepthLimit: number;
15
+ includeMethodsDepth: number;
16
16
  }
17
17
  /**
18
18
  * CREATE operation - Insert a new record
@@ -5,7 +5,7 @@ import type { Table } from "./introspect";
5
5
  import type { Graph } from "./rel-classify";
6
6
  export declare function emitHonoRoutes(table: Table, _graph: Graph, opts: {
7
7
  softDeleteColumn: string | null;
8
- includeDepthLimit: number;
8
+ includeMethodsDepth: number;
9
9
  authStrategy?: string;
10
10
  useJsExtensions?: boolean;
11
11
  }): string;
@@ -16,6 +16,6 @@ import type { Graph } from "./rel-classify";
16
16
  */
17
17
  export declare function emitRoutes(table: Table, _graph: Graph, opts: {
18
18
  softDeleteColumn: string | null;
19
- includeDepthLimit: number;
19
+ includeMethodsDepth: number;
20
20
  authStrategy?: string;
21
21
  }): string;
package/dist/index.js CHANGED
@@ -1694,7 +1694,7 @@ export function register${Type}Routes(app: Hono, deps: { pg: { query: (text: str
1694
1694
  table: "${fileTableName}",
1695
1695
  pkColumns: ${JSON.stringify(safePkCols)},
1696
1696
  softDeleteColumn: ${softDel ? `"${softDel}"` : "null"},
1697
- includeDepthLimit: ${opts.includeDepthLimit}
1697
+ includeMethodsDepth: ${opts.includeMethodsDepth}
1698
1698
  };
1699
1699
  ${hasAuth ? `
1700
1700
  // \uD83D\uDD10 Auth: protect all routes for this table
@@ -1755,7 +1755,7 @@ ${hasAuth ? `
1755
1755
  result.data,
1756
1756
  result.includeSpec,
1757
1757
  deps.pg,
1758
- ${opts.includeDepthLimit}
1758
+ ${opts.includeMethodsDepth}
1759
1759
  );
1760
1760
  return c.json(stitched);
1761
1761
  } catch (e: any) {
@@ -2827,7 +2827,7 @@ export interface OperationContext {
2827
2827
  table: string;
2828
2828
  pkColumns: string[];
2829
2829
  softDeleteColumn?: string | null;
2830
- includeDepthLimit: number;
2830
+ includeMethodsDepth: number;
2831
2831
  }
2832
2832
 
2833
2833
  const DEBUG = process.env.SDK_DEBUG === "1" || process.env.SDK_DEBUG === "true";
@@ -3870,7 +3870,7 @@ async function generate(configPath) {
3870
3870
  if (serverFramework === "hono") {
3871
3871
  routeContent = emitHonoRoutes(table, graph, {
3872
3872
  softDeleteColumn: cfg.softDeleteColumn || null,
3873
- includeDepthLimit: cfg.includeMethodsDepth || 2,
3873
+ includeMethodsDepth: cfg.includeMethodsDepth || 2,
3874
3874
  authStrategy: normalizedAuth?.strategy,
3875
3875
  useJsExtensions: cfg.useJsExtensions
3876
3876
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postgresdk",
3
- "version": "0.9.6",
3
+ "version": "0.9.7",
4
4
  "description": "Generate a typed server/client SDK from a Postgres schema (includes, Zod, Hono).",
5
5
  "type": "module",
6
6
  "bin": {