@neon/sdk 0.1.0 → 0.2.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 (76) hide show
  1. package/README.md +1 -1
  2. package/dist/_virtual/_rolldown/runtime.js +2 -1
  3. package/dist/neon/client.test-d.d.ts +1 -0
  4. package/dist/neon/client.test-d.js +76 -0
  5. package/dist/neon/client.test-d.js.map +1 -0
  6. package/dist/neon/resources/postgres.d.ts +1 -1
  7. package/dist/neon/resources/postgres.js.map +1 -1
  8. package/dist/node_modules/.pnpm/@vitest_pretty-format@3.0.9/node_modules/@vitest/pretty-format/dist/index.js +879 -0
  9. package/dist/node_modules/.pnpm/@vitest_pretty-format@3.0.9/node_modules/@vitest/pretty-format/dist/index.js.map +1 -0
  10. package/dist/node_modules/.pnpm/@vitest_runner@3.0.9/node_modules/@vitest/runner/dist/chunk-tasks.js +30 -0
  11. package/dist/node_modules/.pnpm/@vitest_runner@3.0.9/node_modules/@vitest/runner/dist/chunk-tasks.js.map +1 -0
  12. package/dist/node_modules/.pnpm/@vitest_runner@3.0.9/node_modules/@vitest/runner/dist/index.js +578 -0
  13. package/dist/node_modules/.pnpm/@vitest_runner@3.0.9/node_modules/@vitest/runner/dist/index.js.map +1 -0
  14. package/dist/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +92 -0
  15. package/dist/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js.map +1 -0
  16. package/dist/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/helpers.js +43 -0
  17. package/dist/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/helpers.js.map +1 -0
  18. package/dist/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/index.js +450 -0
  19. package/dist/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/index.js.map +1 -0
  20. package/dist/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/source-map.js +168 -0
  21. package/dist/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/source-map.js.map +1 -0
  22. package/dist/node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/branding.js +10 -0
  23. package/dist/node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/branding.js.map +1 -0
  24. package/dist/node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/index.js +109 -0
  25. package/dist/node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/index.js.map +1 -0
  26. package/dist/node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/messages.js +10 -0
  27. package/dist/node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/messages.js.map +1 -0
  28. package/dist/node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/overloads.js +10 -0
  29. package/dist/node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/overloads.js.map +1 -0
  30. package/dist/node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/utils.js +10 -0
  31. package/dist/node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/utils.js.map +1 -0
  32. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js +11 -0
  33. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js.map +1 -0
  34. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js +16 -0
  35. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js.map +1 -0
  36. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js +11 -0
  37. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js.map +1 -0
  38. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js +15 -0
  39. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js.map +1 -0
  40. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js +13 -0
  41. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js.map +1 -0
  42. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js +34 -0
  43. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js.map +1 -0
  44. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js +12 -0
  45. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js.map +1 -0
  46. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js +122 -0
  47. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js.map +1 -0
  48. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js +39 -0
  49. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js.map +1 -0
  50. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js +99 -0
  51. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js.map +1 -0
  52. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js +25 -0
  53. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js.map +1 -0
  54. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js +14 -0
  55. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js.map +1 -0
  56. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js +21 -0
  57. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js.map +1 -0
  58. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js +6 -0
  59. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js.map +1 -0
  60. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js +12 -0
  61. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js.map +1 -0
  62. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js +18 -0
  63. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js.map +1 -0
  64. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js +24 -0
  65. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js.map +1 -0
  66. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js +9 -0
  67. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js.map +1 -0
  68. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js +30 -0
  69. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js.map +1 -0
  70. package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +82 -0
  71. package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js.map +1 -0
  72. package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/node.js +7 -0
  73. package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/node.js.map +1 -0
  74. package/dist/node_modules/.pnpm/vitest@3.0.9_@types_debug@4.1.13_@types_node@20.19.17_jiti@2.7.0_jsdom@26.1.0_lightning_fb7ae83398b95c49208c9194029bba02/node_modules/vitest/dist/index.js +8 -0
  75. package/dist/node_modules/.pnpm/vitest@3.0.9_@types_debug@4.1.13_@types_node@20.19.17_jiti@2.7.0_jsdom@26.1.0_lightning_fb7ae83398b95c49208c9194029bba02/node_modules/vitest/dist/index.js.map +1 -0
  76. package/package.json +3 -2
package/README.md CHANGED
@@ -15,7 +15,7 @@ Two layers, one package:
15
15
  npm install @neon/sdk
16
16
  ```
17
17
 
18
- Requires Node.js ≥ 22 (or any runtime with a global `fetch` — Bun, Deno, edge, browser).
18
+ Requires Node.js ≥ 20.19 (or any runtime with a global `fetch` — Bun, Deno, edge, browser).
19
19
 
20
20
  ## Quick start
21
21
 
@@ -1,5 +1,6 @@
1
1
  //#region \0rolldown/runtime.js
2
2
  var __defProp = Object.defineProperty;
3
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
3
4
  var __exportAll = (all, no_symbols) => {
4
5
  let target = {};
5
6
  for (var name in all) __defProp(target, name, {
@@ -10,4 +11,4 @@ var __exportAll = (all, no_symbols) => {
10
11
  return target;
11
12
  };
12
13
  //#endregion
13
- export { __exportAll };
14
+ export { __commonJSMin, __exportAll };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,76 @@
1
+ import { createNeonClient } from "./client.js";
2
+ import { it } from "../node_modules/.pnpm/@vitest_runner@3.0.9/node_modules/@vitest/runner/dist/index.js";
3
+ import { import_dist } from "../node_modules/.pnpm/vitest@3.0.9_@types_debug@4.1.13_@types_node@20.19.17_jiti@2.7.0_jsdom@26.1.0_lightning_fb7ae83398b95c49208c9194029bba02/node_modules/vitest/dist/index.js";
4
+ //#region src/neon/client.test-d.ts
5
+ it("default client returns the { data, error } envelope", () => {
6
+ const neon = createNeonClient({ apiKey: "x" });
7
+ (0, import_dist.expectTypeOf)(neon.projects.get("p")).resolves.toEqualTypeOf();
8
+ (0, import_dist.expectTypeOf)(neon.projects.create()).resolves.toEqualTypeOf();
9
+ });
10
+ it("throwOnError on the client narrows methods to the bare resource", () => {
11
+ (0, import_dist.expectTypeOf)(createNeonClient({
12
+ apiKey: "x",
13
+ throwOnError: true
14
+ }).projects.get("p")).resolves.toEqualTypeOf();
15
+ });
16
+ it("per-call throwOnError overrides the client default and narrows", () => {
17
+ (0, import_dist.expectTypeOf)(createNeonClient({ apiKey: "x" }).projects.get("p", { throwOnError: true })).resolves.toEqualTypeOf();
18
+ (0, import_dist.expectTypeOf)(createNeonClient({
19
+ apiKey: "x",
20
+ throwOnError: true
21
+ }).projects.get("p", { throwOnError: false })).resolves.toEqualTypeOf();
22
+ });
23
+ it("branches + workflows carry the envelope and narrow under throwOnError", () => {
24
+ const neon = createNeonClient({ apiKey: "x" });
25
+ (0, import_dist.expectTypeOf)(neon.branches.list("p")).toEqualTypeOf();
26
+ (0, import_dist.expectTypeOf)(neon.branches.get("p", "br")).resolves.toEqualTypeOf();
27
+ (0, import_dist.expectTypeOf)(neon.branches.createWithCompute("p", { name: "x" })).resolves.toEqualTypeOf();
28
+ (0, import_dist.expectTypeOf)(neon.projects.createAndConnect({ name: "x" })).resolves.toEqualTypeOf();
29
+ const throwing = createNeonClient({
30
+ apiKey: "x",
31
+ throwOnError: true
32
+ });
33
+ (0, import_dist.expectTypeOf)(throwing.branches.createWithCompute("p", { name: "x" })).resolves.toEqualTypeOf();
34
+ (0, import_dist.expectTypeOf)(throwing.branches.delete("p", "br")).resolves.toEqualTypeOf();
35
+ });
36
+ it("postgres namespace + tier-2/3 resources are reachable and typed", () => {
37
+ const neon = createNeonClient({ apiKey: "x" });
38
+ (0, import_dist.expectTypeOf)(neon.postgres.endpoints.list("p")).resolves.toEqualTypeOf();
39
+ (0, import_dist.expectTypeOf)(neon.postgres.roles.password("p", "br", "neondb_owner")).resolves.toEqualTypeOf();
40
+ (0, import_dist.expectTypeOf)(neon.postgres.connectionString({ projectId: "p" })).resolves.toEqualTypeOf();
41
+ (0, import_dist.expectTypeOf)(neon.snapshots.list("p")).resolves.toEqualTypeOf();
42
+ const throwing = createNeonClient({
43
+ apiKey: "x",
44
+ throwOnError: true
45
+ });
46
+ (0, import_dist.expectTypeOf)(throwing.postgres.connectionString({ projectId: "p" })).resolves.toEqualTypeOf();
47
+ (0, import_dist.expectTypeOf)(throwing.postgres.dataApi.delete("p", "br", "neondb")).resolves.toEqualTypeOf();
48
+ });
49
+ it("agent-platform helpers (default org, default branch, transfer, finalize) are typed", () => {
50
+ const neon = createNeonClient({
51
+ apiKey: "x",
52
+ orgId: "org-123"
53
+ });
54
+ (0, import_dist.expectTypeOf)(neon.branches.getDefault("p")).resolves.toEqualTypeOf();
55
+ (0, import_dist.expectTypeOf)(neon.branches.setDefault("p", "br")).resolves.toEqualTypeOf();
56
+ (0, import_dist.expectTypeOf)(neon.branches.finalizeRestore("p", "br")).resolves.toEqualTypeOf();
57
+ (0, import_dist.expectTypeOf)(neon.projects.transfer({
58
+ toOrgId: "org-paid",
59
+ projectIds: ["p"]
60
+ })).resolves.toEqualTypeOf();
61
+ (0, import_dist.expectTypeOf)(neon.snapshots.create("p", "br", {
62
+ name: "baseline",
63
+ timestamp: "2026-01-01T00:00:00Z"
64
+ })).resolves.toEqualTypeOf();
65
+ (0, import_dist.expectTypeOf)(neon.snapshots.restore("p", "snap", {
66
+ targetBranchId: "br",
67
+ preview: (restored) => {
68
+ (0, import_dist.expectTypeOf)(restored).toEqualTypeOf();
69
+ return true;
70
+ }
71
+ })).resolves.toEqualTypeOf();
72
+ });
73
+ //#endregion
74
+ export {};
75
+
76
+ //# sourceMappingURL=client.test-d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.test-d.js","names":[],"sources":["../../src/neon/client.test-d.ts"],"sourcesContent":["import { expectTypeOf, it } from \"vitest\";\nimport type {\n\tBranch,\n\tEndpoint,\n\tProject,\n\tSnapshot,\n} from \"../client/types.gen.js\";\nimport { createNeonClient } from \"./client.js\";\nimport type { Paginated } from \"./paginate.js\";\nimport type { BranchWithCompute } from \"./resources/branches.js\";\nimport type { ProjectConnection } from \"./resources/projects.js\";\nimport type { NeonResult } from \"./result.js\";\n\nit(\"default client returns the { data, error } envelope\", () => {\n\tconst neon = createNeonClient({ apiKey: \"x\" });\n\texpectTypeOf(neon.projects.get(\"p\")).resolves.toEqualTypeOf<\n\t\tNeonResult<Project>\n\t>();\n\texpectTypeOf(neon.projects.create()).resolves.toEqualTypeOf<\n\t\tNeonResult<Project>\n\t>();\n});\n\nit(\"throwOnError on the client narrows methods to the bare resource\", () => {\n\tconst neon = createNeonClient({ apiKey: \"x\", throwOnError: true });\n\texpectTypeOf(neon.projects.get(\"p\")).resolves.toEqualTypeOf<Project>();\n});\n\nit(\"per-call throwOnError overrides the client default and narrows\", () => {\n\tconst neon = createNeonClient({ apiKey: \"x\" });\n\texpectTypeOf(\n\t\tneon.projects.get(\"p\", { throwOnError: true }),\n\t).resolves.toEqualTypeOf<Project>();\n\n\tconst throwing = createNeonClient({ apiKey: \"x\", throwOnError: true });\n\texpectTypeOf(\n\t\tthrowing.projects.get(\"p\", { throwOnError: false }),\n\t).resolves.toEqualTypeOf<NeonResult<Project>>();\n});\n\nit(\"branches + workflows carry the envelope and narrow under throwOnError\", () => {\n\tconst neon = createNeonClient({ apiKey: \"x\" });\n\texpectTypeOf(neon.branches.list(\"p\")).toEqualTypeOf<Paginated<Branch>>();\n\texpectTypeOf(neon.branches.get(\"p\", \"br\")).resolves.toEqualTypeOf<\n\t\tNeonResult<Branch>\n\t>();\n\texpectTypeOf(\n\t\tneon.branches.createWithCompute(\"p\", { name: \"x\" }),\n\t).resolves.toEqualTypeOf<NeonResult<BranchWithCompute>>();\n\texpectTypeOf(\n\t\tneon.projects.createAndConnect({ name: \"x\" }),\n\t).resolves.toEqualTypeOf<NeonResult<ProjectConnection>>();\n\n\tconst throwing = createNeonClient({ apiKey: \"x\", throwOnError: true });\n\texpectTypeOf(\n\t\tthrowing.branches.createWithCompute(\"p\", { name: \"x\" }),\n\t).resolves.toEqualTypeOf<BranchWithCompute>();\n\texpectTypeOf(\n\t\tthrowing.branches.delete(\"p\", \"br\"),\n\t).resolves.toEqualTypeOf<void>();\n});\n\nit(\"postgres namespace + tier-2/3 resources are reachable and typed\", () => {\n\tconst neon = createNeonClient({ apiKey: \"x\" });\n\texpectTypeOf(neon.postgres.endpoints.list(\"p\")).resolves.toEqualTypeOf<\n\t\tNeonResult<Endpoint[]>\n\t>();\n\texpectTypeOf(\n\t\tneon.postgres.roles.password(\"p\", \"br\", \"neondb_owner\"),\n\t).resolves.toEqualTypeOf<NeonResult<string>>();\n\texpectTypeOf(\n\t\tneon.postgres.connectionString({ projectId: \"p\" }),\n\t).resolves.toEqualTypeOf<NeonResult<string>>();\n\texpectTypeOf(neon.snapshots.list(\"p\")).resolves.toEqualTypeOf<\n\t\tNeonResult<Snapshot[]>\n\t>();\n\n\tconst throwing = createNeonClient({ apiKey: \"x\", throwOnError: true });\n\texpectTypeOf(\n\t\tthrowing.postgres.connectionString({ projectId: \"p\" }),\n\t).resolves.toEqualTypeOf<string>();\n\texpectTypeOf(\n\t\tthrowing.postgres.dataApi.delete(\"p\", \"br\", \"neondb\"),\n\t).resolves.toEqualTypeOf<void>();\n});\n\nit(\"agent-platform helpers (default org, default branch, transfer, finalize) are typed\", () => {\n\tconst neon = createNeonClient({ apiKey: \"x\", orgId: \"org-123\" });\n\texpectTypeOf(neon.branches.getDefault(\"p\")).resolves.toEqualTypeOf<\n\t\tNeonResult<Branch>\n\t>();\n\texpectTypeOf(neon.branches.setDefault(\"p\", \"br\")).resolves.toEqualTypeOf<\n\t\tNeonResult<Branch>\n\t>();\n\texpectTypeOf(\n\t\tneon.branches.finalizeRestore(\"p\", \"br\"),\n\t).resolves.toEqualTypeOf<NeonResult<void>>();\n\texpectTypeOf(\n\t\tneon.projects.transfer({ toOrgId: \"org-paid\", projectIds: [\"p\"] }),\n\t).resolves.toEqualTypeOf<NeonResult<void>>();\n\texpectTypeOf(\n\t\tneon.snapshots.create(\"p\", \"br\", {\n\t\t\tname: \"baseline\",\n\t\t\ttimestamp: \"2026-01-01T00:00:00Z\",\n\t\t}),\n\t).resolves.toEqualTypeOf<NeonResult<Snapshot>>();\n\texpectTypeOf(\n\t\tneon.snapshots.restore(\"p\", \"snap\", {\n\t\t\ttargetBranchId: \"br\",\n\t\t\tpreview: (restored) => {\n\t\t\t\texpectTypeOf(restored).toEqualTypeOf<Branch>();\n\t\t\t\treturn true;\n\t\t\t},\n\t\t}),\n\t).resolves.toEqualTypeOf<NeonResult<Branch>>();\n});\n"],"mappings":";;;;AAaA,GAAG,6DAA6D;CAC/D,MAAM,OAAO,iBAAiB,EAAE,QAAQ,IAAI,CAAC;CAC7C,CAAA,GAAA,YAAA,aAAA,CAAa,KAAK,SAAS,IAAI,GAAG,CAAC,CAAC,CAAC,SAAS,cAE5C;CACF,CAAA,GAAA,YAAA,aAAA,CAAa,KAAK,SAAS,OAAO,CAAC,CAAC,CAAC,SAAS,cAE5C;AACH,CAAC;AAED,GAAG,yEAAyE;CAE3E,CAAA,GAAA,YAAA,aAAA,CADa,iBAAiB;EAAE,QAAQ;EAAK,cAAc;CAAK,CAChD,CAAC,CAAC,SAAS,IAAI,GAAG,CAAC,CAAC,CAAC,SAAS,cAAuB;AACtE,CAAC;AAED,GAAG,wEAAwE;CAE1E,CAAA,GAAA,YAAA,aAAA,CADa,iBAAiB,EAAE,QAAQ,IAAI,CAExC,CAAC,CAAC,SAAS,IAAI,KAAK,EAAE,cAAc,KAAK,CAAC,CAC9C,CAAC,CAAC,SAAS,cAAuB;CAGlC,CAAA,GAAA,YAAA,aAAA,CADiB,iBAAiB;EAAE,QAAQ;EAAK,cAAc;CAAK,CAE5D,CAAC,CAAC,SAAS,IAAI,KAAK,EAAE,cAAc,MAAM,CAAC,CACnD,CAAC,CAAC,SAAS,cAAmC;AAC/C,CAAC;AAED,GAAG,+EAA+E;CACjF,MAAM,OAAO,iBAAiB,EAAE,QAAQ,IAAI,CAAC;CAC7C,CAAA,GAAA,YAAA,aAAA,CAAa,KAAK,SAAS,KAAK,GAAG,CAAC,CAAC,CAAC,cAAiC;CACvE,CAAA,GAAA,YAAA,aAAA,CAAa,KAAK,SAAS,I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,GAAA,YAAA,aAAA,CACC,SAAS,SAAS,QAAQ,OAAO,KAAK,MAAM,QAAQ,CACrD,CAAC,CAAC,SAAS,cAAoB;AAChC,CAAC;AAED,GAAG,4FAA4F;CAC9F,MAAM,OAAO,iBAAiB;EAAE,QAAQ;EAAK,OAAO;CAAU,CAAC;CAC/D,CAAA,GAAA,YAAA,aAAA,CAAa,KAAK,SAAS,WAAW,GAAG,CAAC,CAAC,CAAC,SAAS,cAEnD;CACF,CAAA,GAAA,YAAA,aAAA,CAAa,KAAK,SAAS,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,cAEzD;CACF,CAAA,GAAA,YAAA,aAAA,CACC,KAAK,SAAS,gBAAgB,KAAK,IAAI,CACxC,CAAC,CAAC,SAAS,cAAgC;CAC3C,CAAA,GAAA,YAAA,aAAA,CACC,KAAK,SAAS,SAAS;EAAE,SAAS;EAAY,YAAY,CAAC,GAAG;CAAE,CAAC,CAClE,CAAC,CAAC,SAAS,cAAgC;CAC3C,CAAA,GAAA,YAAA,aAAA,CACC,KAAK,UAAU,OAAO,KAAK,MAAM;EAChC,MAAM;EACN,WAAW;CACZ,CAAC,CACF,CAAC,CAAC,SAAS,cAAoC;CAC/C,CAAA,GAAA,YAAA,aAAA,CACC,KAAK,UAAU,QAAQ,KAAK,QAAQ;EACnC,gBAAgB;EAChB,UAAU,aAAa;GACtB,CAAA,GAAA,YAAA,aAAA,CAAa,QAAQ,CAAC,CAAC,cAAsB;GAC7C,OAAO;EACR;CACD,CAAC,CACF,CAAC,CAAC,SAAS,cAAkC;AAC9C,CAAC"}
@@ -34,7 +34,7 @@ declare class Postgres<DThrow extends boolean> {
34
34
  constructor(ctx: RequestContext);
35
35
  /**
36
36
  * Resolve a Postgres connection string. Auto-selects the default branch and the sole
37
- * role/database when not specified (mirrors `@neondatabase/config`'s `fetchEnv`); returns
37
+ * role/database when not specified (mirrors `@neon/config`'s `fetchEnv`); returns
38
38
  * a `client`-kind {@link NeonError} when the selection is ambiguous.
39
39
  */
40
40
  connectionString(params: ConnectionStringParams): Promise<Outcome<string, DThrow>>;
@@ -1 +1 @@
1
- {"version":3,"file":"postgres.js","names":["#ctx","#resolve"],"sources":["../../../src/neon/resources/postgres.ts"],"sourcesContent":["import {\n\tgetConnectionUri,\n\tlistProjectBranchDatabases,\n\tlistProjectBranches,\n\tlistProjectBranchRoles,\n} from \"../../client/sdk.gen.js\";\nimport type { CallOptions, RequestContext } from \"../context.js\";\nimport { NeonError, toNeonError } from \"../errors.js\";\nimport { err, finalize, type NeonResult, type Outcome, ok } from \"../result.js\";\nimport { DataApi } from \"./dataapi.js\";\nimport { Databases } from \"./databases.js\";\nimport { Endpoints } from \"./endpoints.js\";\nimport { Roles } from \"./roles.js\";\n\n/** Parameters for {@link Postgres.connectionString}. */\nexport interface ConnectionStringParams {\n\tprojectId: string;\n\t/** Defaults to the project's default branch. */\n\tbranchId?: string;\n\t/** Defaults to the branch's read-write endpoint. */\n\tendpointId?: string;\n\t/** Auto-selected when the branch has exactly one database. */\n\tdatabaseName?: string;\n\t/** Auto-selected when the branch has exactly one role. */\n\troleName?: string;\n\t/** Pooled connection string (default `true`). */\n\tpooled?: boolean;\n}\n\n/**\n * The Postgres data plane of a branch: compute endpoints, roles, databases, the Data API,\n * and a connection-string helper. (Grouped under `neon.postgres.*` so future top-level\n * namespaces like `functions` / `storage` stay unambiguous.)\n */\nexport class Postgres<DThrow extends boolean> {\n\treadonly endpoints: Endpoints<DThrow>;\n\treadonly roles: Roles<DThrow>;\n\treadonly databases: Databases<DThrow>;\n\treadonly dataApi: DataApi<DThrow>;\n\treadonly #ctx: RequestContext;\n\n\tconstructor(ctx: RequestContext) {\n\t\tthis.#ctx = ctx;\n\t\tthis.endpoints = new Endpoints<DThrow>(ctx);\n\t\tthis.roles = new Roles<DThrow>(ctx);\n\t\tthis.databases = new Databases<DThrow>(ctx);\n\t\tthis.dataApi = new DataApi<DThrow>(ctx);\n\t}\n\n\t/**\n\t * Resolve a Postgres connection string. Auto-selects the default branch and the sole\n\t * role/database when not specified (mirrors `@neondatabase/config`'s `fetchEnv`); returns\n\t * a `client`-kind {@link NeonError} when the selection is ambiguous.\n\t */\n\tconnectionString(\n\t\tparams: ConnectionStringParams,\n\t): Promise<Outcome<string, DThrow>>;\n\tconnectionString<Throw extends boolean = DThrow>(\n\t\tparams: ConnectionStringParams,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<string, Throw>>;\n\tasync connectionString(\n\t\tparams: ConnectionStringParams,\n\t\topts?: CallOptions,\n\t): Promise<string | NeonResult<string>> {\n\t\tconst shouldThrow =\n\t\t\topts?.throwOnError ?? this.#ctx.defaults.throwOnError;\n\t\treturn finalize(await this.#resolve(params, opts?.signal), shouldThrow);\n\t}\n\n\tasync #resolve(\n\t\tparams: ConnectionStringParams,\n\t\tsignal?: AbortSignal,\n\t): Promise<NeonResult<string>> {\n\t\tconst client = this.#ctx.client;\n\t\tconst projectId = params.projectId;\n\t\tlet branchId = params.branchId;\n\t\tlet roleName = params.roleName;\n\t\tlet databaseName = params.databaseName;\n\n\t\tif ((!roleName || !databaseName) && !branchId) {\n\t\t\tconst branches = await listProjectBranches({\n\t\t\t\tclient,\n\t\t\t\tpath: { project_id: projectId },\n\t\t\t\tthrowOnError: false,\n\t\t\t\tsignal,\n\t\t\t});\n\t\t\tif (branches.error || !branches.data) {\n\t\t\t\treturn err(toNeonError(branches.error, branches.response));\n\t\t\t}\n\t\t\tbranchId = branches.data.branches.find(\n\t\t\t\t(branch) => branch.default,\n\t\t\t)?.id;\n\t\t\tif (!branchId) {\n\t\t\t\treturn err(\n\t\t\t\t\tnew NeonError(\n\t\t\t\t\t\t\"Could not determine the default branch; pass branchId.\",\n\t\t\t\t\t\t\"client\",\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (!roleName) {\n\t\t\tif (!branchId) return err(branchRequired(\"roleName\"));\n\t\t\tconst roles = await listProjectBranchRoles({\n\t\t\t\tclient,\n\t\t\t\tpath: { project_id: projectId, branch_id: branchId },\n\t\t\t\tthrowOnError: false,\n\t\t\t\tsignal,\n\t\t\t});\n\t\t\tif (roles.error || !roles.data)\n\t\t\t\treturn err(toNeonError(roles.error, roles.response));\n\t\t\tif (roles.data.roles.length !== 1) {\n\t\t\t\treturn err(\n\t\t\t\t\tambiguous(\"role\", roles.data.roles.length, \"roleName\"),\n\t\t\t\t);\n\t\t\t}\n\t\t\troleName = roles.data.roles[0].name;\n\t\t}\n\n\t\tif (!databaseName) {\n\t\t\tif (!branchId) return err(branchRequired(\"databaseName\"));\n\t\t\tconst databases = await listProjectBranchDatabases({\n\t\t\t\tclient,\n\t\t\t\tpath: { project_id: projectId, branch_id: branchId },\n\t\t\t\tthrowOnError: false,\n\t\t\t\tsignal,\n\t\t\t});\n\t\t\tif (databases.error || !databases.data) {\n\t\t\t\treturn err(toNeonError(databases.error, databases.response));\n\t\t\t}\n\t\t\tif (databases.data.databases.length !== 1) {\n\t\t\t\treturn err(\n\t\t\t\t\tambiguous(\n\t\t\t\t\t\t\"database\",\n\t\t\t\t\t\tdatabases.data.databases.length,\n\t\t\t\t\t\t\"databaseName\",\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t\tdatabaseName = databases.data.databases[0].name;\n\t\t}\n\n\t\tconst conn = await getConnectionUri({\n\t\t\tclient,\n\t\t\tpath: { project_id: projectId },\n\t\t\tquery: {\n\t\t\t\tbranch_id: branchId,\n\t\t\t\tendpoint_id: params.endpointId,\n\t\t\t\tdatabase_name: databaseName,\n\t\t\t\trole_name: roleName,\n\t\t\t\tpooled: params.pooled ?? true,\n\t\t\t},\n\t\t\tthrowOnError: false,\n\t\t\tsignal,\n\t\t});\n\t\tif (conn.error || !conn.data)\n\t\t\treturn err(toNeonError(conn.error, conn.response));\n\t\treturn ok(conn.data.uri);\n\t}\n}\n\nfunction branchRequired(param: string): NeonError {\n\treturn new NeonError(\n\t\t`Pass branchId or ${param} to resolve a connection string.`,\n\t\t\"client\",\n\t);\n}\n\nfunction ambiguous(kind: string, count: number, param: string): NeonError {\n\treturn new NeonError(\n\t\t`Expected exactly one ${kind} to auto-select for the connection string; found ${count}. Pass ${param}.`,\n\t\t\"client\",\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;AAkCA,IAAa,WAAb,MAA8C;CAC7C;CACA;CACA;CACA;CACA;CAEA,YAAY,KAAqB;EAChC,KAAKA,OAAO;EACZ,KAAK,YAAY,IAAI,UAAkB,GAAG;EAC1C,KAAK,QAAQ,IAAI,MAAc,GAAG;EAClC,KAAK,YAAY,IAAI,UAAkB,GAAG;EAC1C,KAAK,UAAU,IAAI,QAAgB,GAAG;CACvC;CAcA,MAAM,iBACL,QACA,MACuC;EACvC,MAAM,cACL,MAAM,gBAAgB,KAAKA,KAAK,SAAS;EAC1C,OAAO,SAAS,MAAM,KAAKC,SAAS,QAAQ,MAAM,MAAM,GAAG,WAAW;CACvE;CAEA,MAAMA,SACL,QACA,QAC8B;EAC9B,MAAM,SAAS,KAAKD,KAAK;EACzB,MAAM,YAAY,OAAO;EACzB,IAAI,WAAW,OAAO;EACtB,IAAI,WAAW,OAAO;EACtB,IAAI,eAAe,OAAO;EAE1B,KAAK,CAAC,YAAY,CAAC,iBAAiB,CAAC,UAAU;GAC9C,MAAM,WAAW,MAAM,oBAAoB;IAC1C;IACA,MAAM,EAAE,YAAY,UAAU;IAC9B,cAAc;IACd;GACD,CAAC;GACD,IAAI,SAAS,SAAS,CAAC,SAAS,MAC/B,OAAO,IAAI,YAAY,SAAS,OAAO,SAAS,QAAQ,CAAC;GAE1D,WAAW,SAAS,KAAK,SAAS,MAChC,WAAW,OAAO,OACpB,CAAC,EAAE;GACH,IAAI,CAAC,UACJ,OAAO,IACN,IAAI,UACH,0DACA,QACD,CACD;EAEF;EAEA,IAAI,CAAC,UAAU;GACd,IAAI,CAAC,UAAU,OAAO,IAAI,eAAe,UAAU,CAAC;GACpD,MAAM,QAAQ,MAAM,uBAAuB;IAC1C;IACA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AM,IACrG,QACD;AACD"}
1
+ {"version":3,"file":"postgres.js","names":["#ctx","#resolve"],"sources":["../../../src/neon/resources/postgres.ts"],"sourcesContent":["import {\n\tgetConnectionUri,\n\tlistProjectBranchDatabases,\n\tlistProjectBranches,\n\tlistProjectBranchRoles,\n} from \"../../client/sdk.gen.js\";\nimport type { CallOptions, RequestContext } from \"../context.js\";\nimport { NeonError, toNeonError } from \"../errors.js\";\nimport { err, finalize, type NeonResult, type Outcome, ok } from \"../result.js\";\nimport { DataApi } from \"./dataapi.js\";\nimport { Databases } from \"./databases.js\";\nimport { Endpoints } from \"./endpoints.js\";\nimport { Roles } from \"./roles.js\";\n\n/** Parameters for {@link Postgres.connectionString}. */\nexport interface ConnectionStringParams {\n\tprojectId: string;\n\t/** Defaults to the project's default branch. */\n\tbranchId?: string;\n\t/** Defaults to the branch's read-write endpoint. */\n\tendpointId?: string;\n\t/** Auto-selected when the branch has exactly one database. */\n\tdatabaseName?: string;\n\t/** Auto-selected when the branch has exactly one role. */\n\troleName?: string;\n\t/** Pooled connection string (default `true`). */\n\tpooled?: boolean;\n}\n\n/**\n * The Postgres data plane of a branch: compute endpoints, roles, databases, the Data API,\n * and a connection-string helper. (Grouped under `neon.postgres.*` so future top-level\n * namespaces like `functions` / `storage` stay unambiguous.)\n */\nexport class Postgres<DThrow extends boolean> {\n\treadonly endpoints: Endpoints<DThrow>;\n\treadonly roles: Roles<DThrow>;\n\treadonly databases: Databases<DThrow>;\n\treadonly dataApi: DataApi<DThrow>;\n\treadonly #ctx: RequestContext;\n\n\tconstructor(ctx: RequestContext) {\n\t\tthis.#ctx = ctx;\n\t\tthis.endpoints = new Endpoints<DThrow>(ctx);\n\t\tthis.roles = new Roles<DThrow>(ctx);\n\t\tthis.databases = new Databases<DThrow>(ctx);\n\t\tthis.dataApi = new DataApi<DThrow>(ctx);\n\t}\n\n\t/**\n\t * Resolve a Postgres connection string. Auto-selects the default branch and the sole\n\t * role/database when not specified (mirrors `@neon/config`'s `fetchEnv`); returns\n\t * a `client`-kind {@link NeonError} when the selection is ambiguous.\n\t */\n\tconnectionString(\n\t\tparams: ConnectionStringParams,\n\t): Promise<Outcome<string, DThrow>>;\n\tconnectionString<Throw extends boolean = DThrow>(\n\t\tparams: ConnectionStringParams,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<string, Throw>>;\n\tasync connectionString(\n\t\tparams: ConnectionStringParams,\n\t\topts?: CallOptions,\n\t): Promise<string | NeonResult<string>> {\n\t\tconst shouldThrow =\n\t\t\topts?.throwOnError ?? this.#ctx.defaults.throwOnError;\n\t\treturn finalize(await this.#resolve(params, opts?.signal), shouldThrow);\n\t}\n\n\tasync #resolve(\n\t\tparams: ConnectionStringParams,\n\t\tsignal?: AbortSignal,\n\t): Promise<NeonResult<string>> {\n\t\tconst client = this.#ctx.client;\n\t\tconst projectId = params.projectId;\n\t\tlet branchId = params.branchId;\n\t\tlet roleName = params.roleName;\n\t\tlet databaseName = params.databaseName;\n\n\t\tif ((!roleName || !databaseName) && !branchId) {\n\t\t\tconst branches = await listProjectBranches({\n\t\t\t\tclient,\n\t\t\t\tpath: { project_id: projectId },\n\t\t\t\tthrowOnError: false,\n\t\t\t\tsignal,\n\t\t\t});\n\t\t\tif (branches.error || !branches.data) {\n\t\t\t\treturn err(toNeonError(branches.error, branches.response));\n\t\t\t}\n\t\t\tbranchId = branches.data.branches.find(\n\t\t\t\t(branch) => branch.default,\n\t\t\t)?.id;\n\t\t\tif (!branchId) {\n\t\t\t\treturn err(\n\t\t\t\t\tnew NeonError(\n\t\t\t\t\t\t\"Could not determine the default branch; pass branchId.\",\n\t\t\t\t\t\t\"client\",\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (!roleName) {\n\t\t\tif (!branchId) return err(branchRequired(\"roleName\"));\n\t\t\tconst roles = await listProjectBranchRoles({\n\t\t\t\tclient,\n\t\t\t\tpath: { project_id: projectId, branch_id: branchId },\n\t\t\t\tthrowOnError: false,\n\t\t\t\tsignal,\n\t\t\t});\n\t\t\tif (roles.error || !roles.data)\n\t\t\t\treturn err(toNeonError(roles.error, roles.response));\n\t\t\tif (roles.data.roles.length !== 1) {\n\t\t\t\treturn err(\n\t\t\t\t\tambiguous(\"role\", roles.data.roles.length, \"roleName\"),\n\t\t\t\t);\n\t\t\t}\n\t\t\troleName = roles.data.roles[0].name;\n\t\t}\n\n\t\tif (!databaseName) {\n\t\t\tif (!branchId) return err(branchRequired(\"databaseName\"));\n\t\t\tconst databases = await listProjectBranchDatabases({\n\t\t\t\tclient,\n\t\t\t\tpath: { project_id: projectId, branch_id: branchId },\n\t\t\t\tthrowOnError: false,\n\t\t\t\tsignal,\n\t\t\t});\n\t\t\tif (databases.error || !databases.data) {\n\t\t\t\treturn err(toNeonError(databases.error, databases.response));\n\t\t\t}\n\t\t\tif (databases.data.databases.length !== 1) {\n\t\t\t\treturn err(\n\t\t\t\t\tambiguous(\n\t\t\t\t\t\t\"database\",\n\t\t\t\t\t\tdatabases.data.databases.length,\n\t\t\t\t\t\t\"databaseName\",\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t\tdatabaseName = databases.data.databases[0].name;\n\t\t}\n\n\t\tconst conn = await getConnectionUri({\n\t\t\tclient,\n\t\t\tpath: { project_id: projectId },\n\t\t\tquery: {\n\t\t\t\tbranch_id: branchId,\n\t\t\t\tendpoint_id: params.endpointId,\n\t\t\t\tdatabase_name: databaseName,\n\t\t\t\trole_name: roleName,\n\t\t\t\tpooled: params.pooled ?? true,\n\t\t\t},\n\t\t\tthrowOnError: false,\n\t\t\tsignal,\n\t\t});\n\t\tif (conn.error || !conn.data)\n\t\t\treturn err(toNeonError(conn.error, conn.response));\n\t\treturn ok(conn.data.uri);\n\t}\n}\n\nfunction branchRequired(param: string): NeonError {\n\treturn new NeonError(\n\t\t`Pass branchId or ${param} to resolve a connection string.`,\n\t\t\"client\",\n\t);\n}\n\nfunction ambiguous(kind: string, count: number, param: string): NeonError {\n\treturn new NeonError(\n\t\t`Expected exactly one ${kind} to auto-select for the connection string; found ${count}. Pass ${param}.`,\n\t\t\"client\",\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;AAkCA,IAAa,WAAb,MAA8C;CAC7C;CACA;CACA;CACA;CACA;CAEA,YAAY,KAAqB;EAChC,KAAKA,OAAO;EACZ,KAAK,YAAY,IAAI,UAAkB,GAAG;EAC1C,KAAK,QAAQ,IAAI,MAAc,GAAG;EAClC,KAAK,YAAY,IAAI,UAAkB,GAAG;EAC1C,KAAK,UAAU,IAAI,QAAgB,GAAG;CACvC;CAcA,MAAM,iBACL,QACA,MACuC;EACvC,MAAM,cACL,MAAM,gBAAgB,KAAKA,KAAK,SAAS;EAC1C,OAAO,SAAS,MAAM,KAAKC,SAAS,QAAQ,MAAM,MAAM,GAAG,WAAW;CACvE;CAEA,MAAMA,SACL,QACA,QAC8B;EAC9B,MAAM,SAAS,KAAKD,KAAK;EACzB,MAAM,YAAY,OAAO;EACzB,IAAI,WAAW,OAAO;EACtB,IAAI,WAAW,OAAO;EACtB,IAAI,eAAe,OAAO;EAE1B,KAAK,CAAC,YAAY,CAAC,iBAAiB,CAAC,UAAU;GAC9C,MAAM,WAAW,MAAM,oBAAoB;IAC1C;IACA,MAAM,EAAE,YAAY,UAAU;IAC9B,cAAc;IACd;GACD,CAAC;GACD,IAAI,SAAS,SAAS,CAAC,SAAS,MAC/B,OAAO,IAAI,YAAY,SAAS,OAAO,SAAS,QAAQ,CAAC;GAE1D,WAAW,SAAS,KAAK,SAAS,MAChC,WAAW,OAAO,OACpB,CAAC,EAAE;GACH,IAAI,CAAC,UACJ,OAAO,IACN,IAAI,UACH,0DACA,QACD,CACD;EAEF;EAEA,IAAI,CAAC,UAAU;GACd,IAAI,CAAC,UAAU,OAAO,IAAI,eAAe,UAAU,CAAC;GACpD,MAAM,QAAQ,MAAM,uBAAuB;IAC1C;IACA,MAAM;KAAE,YAAY;KAAW,WAAW;IAAS;IACnD,cAAc;IACd;GACD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