@neon/sdk 0.2.0 → 1.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 (86) hide show
  1. package/README.md +135 -5
  2. package/dist/client/index.d.ts +3 -3
  3. package/dist/client/index.js +2 -2
  4. package/dist/client/raw.gen.d.ts +4282 -0
  5. package/dist/client/raw.gen.d.ts.map +1 -0
  6. package/dist/client/raw.gen.js +170 -0
  7. package/dist/client/raw.gen.js.map +1 -0
  8. package/dist/client/sdk.gen.d.ts +252 -2
  9. package/dist/client/sdk.gen.d.ts.map +1 -1
  10. package/dist/client/sdk.gen.js +634 -1
  11. package/dist/client/sdk.gen.js.map +1 -1
  12. package/dist/client/types.gen.d.ts +2092 -1010
  13. package/dist/client/types.gen.d.ts.map +1 -1
  14. package/dist/index.d.ts +5 -4
  15. package/dist/neon/client.d.ts +10 -0
  16. package/dist/neon/client.d.ts.map +1 -1
  17. package/dist/neon/client.js +10 -0
  18. package/dist/neon/client.js.map +1 -1
  19. package/dist/neon/client.test-d.js +17 -0
  20. package/dist/neon/client.test-d.js.map +1 -1
  21. package/dist/neon/coverage.d.ts.map +1 -1
  22. package/dist/neon/coverage.js +57 -0
  23. package/dist/neon/coverage.js.map +1 -1
  24. package/dist/neon/raw-wrap.d.ts +63 -0
  25. package/dist/neon/raw-wrap.d.ts.map +1 -0
  26. package/dist/neon/raw-wrap.js +47 -0
  27. package/dist/neon/raw-wrap.js.map +1 -0
  28. package/dist/neon/resources/ai-gateway.d.ts +16 -0
  29. package/dist/neon/resources/ai-gateway.d.ts.map +1 -0
  30. package/dist/neon/resources/ai-gateway.js +23 -0
  31. package/dist/neon/resources/ai-gateway.js.map +1 -0
  32. package/dist/neon/resources/auth.d.ts +81 -0
  33. package/dist/neon/resources/auth.d.ts.map +1 -0
  34. package/dist/neon/resources/auth.js +197 -0
  35. package/dist/neon/resources/auth.js.map +1 -0
  36. package/dist/neon/resources/branches.d.ts +7 -0
  37. package/dist/neon/resources/branches.d.ts.map +1 -1
  38. package/dist/neon/resources/branches.js +11 -1
  39. package/dist/neon/resources/branches.js.map +1 -1
  40. package/dist/neon/resources/bucket-objects.d.ts +33 -0
  41. package/dist/neon/resources/bucket-objects.d.ts.map +1 -0
  42. package/dist/neon/resources/bucket-objects.js +74 -0
  43. package/dist/neon/resources/bucket-objects.js.map +1 -0
  44. package/dist/neon/resources/buckets.d.ts +23 -0
  45. package/dist/neon/resources/buckets.d.ts.map +1 -0
  46. package/dist/neon/resources/buckets.js +45 -0
  47. package/dist/neon/resources/buckets.js.map +1 -0
  48. package/dist/neon/resources/credentials.d.ts +23 -0
  49. package/dist/neon/resources/credentials.d.ts.map +1 -0
  50. package/dist/neon/resources/credentials.js +45 -0
  51. package/dist/neon/resources/credentials.js.map +1 -0
  52. package/dist/neon/resources/endpoints.d.ts +3 -0
  53. package/dist/neon/resources/endpoints.d.ts.map +1 -1
  54. package/dist/neon/resources/endpoints.js +11 -1
  55. package/dist/neon/resources/endpoints.js.map +1 -1
  56. package/dist/neon/resources/functions.d.ts +30 -0
  57. package/dist/neon/resources/functions.d.ts.map +1 -0
  58. package/dist/neon/resources/functions.js +79 -0
  59. package/dist/neon/resources/functions.js.map +1 -0
  60. package/dist/neon/resources/projects.d.ts +26 -2
  61. package/dist/neon/resources/projects.d.ts.map +1 -1
  62. package/dist/neon/resources/projects.js +44 -2
  63. package/dist/neon/resources/projects.js.map +1 -1
  64. package/dist/neon/resources/snapshots.d.ts +16 -5
  65. package/dist/neon/resources/snapshots.d.ts.map +1 -1
  66. package/dist/neon/resources/snapshots.js +4 -1
  67. package/dist/neon/resources/snapshots.js.map +1 -1
  68. package/dist/neon/resources/storage.d.ts +24 -0
  69. package/dist/neon/resources/storage.d.ts.map +1 -0
  70. package/dist/neon/resources/storage.js +32 -0
  71. package/dist/neon/resources/storage.js.map +1 -0
  72. package/dist/node_modules/.pnpm/@vitest_runner@3.0.9/node_modules/@vitest/runner/dist/chunk-tasks.js +1 -1
  73. package/dist/node_modules/.pnpm/@vitest_runner@3.0.9/node_modules/@vitest/runner/dist/index.js +4 -3
  74. package/dist/node_modules/.pnpm/@vitest_runner@3.0.9/node_modules/@vitest/runner/dist/index.js.map +1 -1
  75. package/dist/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +1 -1
  76. package/dist/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/index.js +3 -3
  77. package/dist/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/source-map.js +1 -1
  78. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js +1 -1
  79. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js +1 -1
  80. package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +1 -1
  81. package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/node.js +1 -1
  82. 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 +2 -2
  83. package/dist/raw.d.ts +4 -3
  84. package/dist/raw.js +24 -3
  85. package/dist/raw.js.map +1 -1
  86. package/package.json +4 -4
@@ -0,0 +1,45 @@
1
+ import { createProjectBranchBucket, deleteProjectBranchBucket, listProjectBranchBuckets } from "../../client/sdk.gen.js";
2
+ //#region src/neon/resources/buckets.ts
3
+ /** Branch-scoped object-storage buckets. */
4
+ var Buckets = class {
5
+ #ctx;
6
+ constructor(ctx) {
7
+ this.#ctx = ctx;
8
+ }
9
+ list(projectId, branchId, opts) {
10
+ return this.#ctx.run(opts, (client) => listProjectBranchBuckets({
11
+ client,
12
+ path: {
13
+ project_id: projectId,
14
+ branch_id: branchId
15
+ },
16
+ throwOnError: false
17
+ }), (data) => data.buckets);
18
+ }
19
+ create(projectId, branchId, input, opts) {
20
+ return this.#ctx.run(opts, (client) => createProjectBranchBucket({
21
+ client,
22
+ path: {
23
+ project_id: projectId,
24
+ branch_id: branchId
25
+ },
26
+ body: input,
27
+ throwOnError: false
28
+ }), (data) => data.bucket);
29
+ }
30
+ delete(projectId, branchId, bucketName, opts) {
31
+ return this.#ctx.runVoid(opts, (client) => deleteProjectBranchBucket({
32
+ client,
33
+ path: {
34
+ project_id: projectId,
35
+ branch_id: branchId,
36
+ bucket_name: bucketName
37
+ },
38
+ throwOnError: false
39
+ }));
40
+ }
41
+ };
42
+ //#endregion
43
+ export { Buckets };
44
+
45
+ //# sourceMappingURL=buckets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buckets.js","names":["#ctx"],"sources":["../../../src/neon/resources/buckets.ts"],"sourcesContent":["import {\n\tcreateProjectBranchBucket,\n\tdeleteProjectBranchBucket,\n\tlistProjectBranchBuckets,\n} from \"../../client/sdk.gen.js\";\nimport type {\n\tBucket,\n\tBucketAccessLevel,\n\tBucketCreateRequest,\n} from \"../../client/types.gen.js\";\nimport type { CallOptions, RequestContext } from \"../context.js\";\nimport type { NeonResult, Outcome } from \"../result.js\";\n\ntype CreateInput = BucketCreateRequest;\n\n/** Branch-scoped object-storage buckets. */\nexport class Buckets<DThrow extends boolean> {\n\treadonly #ctx: RequestContext;\n\n\tconstructor(ctx: RequestContext) {\n\t\tthis.#ctx = ctx;\n\t}\n\n\t/** @apiCall GET /projects/{project_id}/branches/{branch_id}/buckets */\n\tlist(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t): Promise<Outcome<Bucket[], DThrow>>;\n\tlist<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Bucket[], Throw>>;\n\tlist(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\topts?: CallOptions,\n\t): Promise<Bucket[] | NeonResult<Bucket[]>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tlistProjectBranchBuckets({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, branch_id: branchId },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.buckets,\n\t\t);\n\t}\n\n\t/** @apiCall POST /projects/{project_id}/branches/{branch_id}/buckets */\n\tcreate(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tinput: CreateInput,\n\t): Promise<Outcome<Bucket, DThrow>>;\n\tcreate<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tinput: CreateInput,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Bucket, Throw>>;\n\tcreate(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tinput: CreateInput,\n\t\topts?: CallOptions,\n\t): Promise<Bucket | NeonResult<Bucket>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tcreateProjectBranchBucket({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, branch_id: branchId },\n\t\t\t\t\tbody: input,\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.bucket,\n\t\t);\n\t}\n\n\t/** @apiCall DELETE /projects/{project_id}/branches/{branch_id}/buckets/{bucket_name} */\n\tdelete(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tbucketName: string,\n\t): Promise<Outcome<void, DThrow>>;\n\tdelete<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tbucketName: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<void, Throw>>;\n\tdelete(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tbucketName: string,\n\t\topts?: CallOptions,\n\t): Promise<void | NeonResult<void>> {\n\t\treturn this.#ctx.runVoid(opts, (client) =>\n\t\t\tdeleteProjectBranchBucket({\n\t\t\t\tclient,\n\t\t\t\tpath: {\n\t\t\t\t\tproject_id: projectId,\n\t\t\t\t\tbranch_id: branchId,\n\t\t\t\t\tbucket_name: bucketName,\n\t\t\t\t},\n\t\t\t\tthrowOnError: false,\n\t\t\t}),\n\t\t);\n\t}\n}\n\nexport type { BucketAccessLevel };\n"],"mappings":";;;AAgBA,IAAa,UAAb,MAA6C;CAC5C;CAEA,YAAY,KAAqB;EAChC,KAAKA,OAAO;CACb;CAYA,KACC,WACA,UACA,MAC2C;EAC3C,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,yBAAyB;GACxB;GACA,MAAM;IAAE,YAAY;IAAW,WAAW;GAAS;GACnD,cAAc;EACf,CAAC,IACD,SAAS,KAAK,OAChB;CACD;CAcA,OACC,WACA,UACA,OACA,MACuC;EACvC,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,0BAA0B;GACzB;GACA,MAAM;IAAE,YAAY;IAAW,WAAW;GAAS;GACnD,MAAM;GACN,cAAc;EACf,CAAC,IACD,SAAS,KAAK,MAChB;CACD;CAcA,OACC,WACA,UACA,YACA,MACmC;EACnC,OAAO,KAAKA,KAAK,QAAQ,OAAO,WAC/B,0BAA0B;GACzB;GACA,MAAM;IACL,YAAY;IACZ,WAAW;IACX,aAAa;GACd;GACA,cAAc;EACf,CAAC,CACF;CACD;AACD"}
@@ -0,0 +1,23 @@
1
+ import { CreateCredentialRequest, CreateCredentialResponse, CredentialMeta } from "../../client/types.gen.js";
2
+ import { Outcome } from "../result.js";
3
+ import { CallOptions, RequestContext } from "../context.js";
4
+
5
+ //#region src/neon/resources/credentials.d.ts
6
+ type CreateInput = CreateCredentialRequest;
7
+ /** Branch-scoped scoped credentials. */
8
+ declare class Credentials<DThrow extends boolean> {
9
+ #private;
10
+ constructor(ctx: RequestContext);
11
+ /** @apiCall GET /projects/{project_id}/branches/{branch_id}/credentials */
12
+ list(projectId: string, branchId: string): Promise<Outcome<CredentialMeta[], DThrow>>;
13
+ list<Throw extends boolean = DThrow>(projectId: string, branchId: string, opts: CallOptions<Throw>): Promise<Outcome<CredentialMeta[], Throw>>;
14
+ /** @apiCall POST /projects/{project_id}/branches/{branch_id}/credentials */
15
+ create(projectId: string, branchId: string, input: CreateInput): Promise<Outcome<CreateCredentialResponse, DThrow>>;
16
+ create<Throw extends boolean = DThrow>(projectId: string, branchId: string, input: CreateInput, opts: CallOptions<Throw>): Promise<Outcome<CreateCredentialResponse, Throw>>;
17
+ /** @apiCall DELETE /projects/{project_id}/branches/{branch_id}/credentials/{token_id} */
18
+ revoke(projectId: string, branchId: string, tokenId: string): Promise<Outcome<void, DThrow>>;
19
+ revoke<Throw extends boolean = DThrow>(projectId: string, branchId: string, tokenId: string, opts: CallOptions<Throw>): Promise<Outcome<void, Throw>>;
20
+ }
21
+ //#endregion
22
+ export { Credentials };
23
+ //# sourceMappingURL=credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentials.d.ts","names":[],"sources":["../../../src/neon/resources/credentials.ts"],"mappings":";;;;;KAaK,WAAA,GAAc;;AAAd,cAGQ,WAHM,CAAA,eAAA,OAAuB,CAAA,CAAA;EAG7B,CAAA,OAAA;EAAW,WAAA,CAAA,GAAA,EAGN,cAHM;;MAWJ,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,CAAA,EAAhB,OAAgB,CAAR,OAAQ,CAAA,cAAA,EAAA,EAAkB,MAAlB,CAAA,CAAA;MAAkB,CAAA,cAAA,OAAA,GACR,MADQ,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAI9B,WAJ8B,CAIlB,KAJkB,CAAA,CAAA,EAKlC,OALkC,CAK1B,OAL0B,CAKlB,cALkB,EAAA,EAKA,KALA,CAAA,CAAA;;QAAlC,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,KAAA,EA2BK,WA3BL,CAAA,EA4BA,OA5BA,CA4BQ,OA5BR,CA4BgB,wBA5BhB,EA4B0C,MA5B1C,CAAA,CAAA;QAC0B,CAAA,cAAA,OAAA,GA4BE,MA5BF,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,KAAA,EA+BrB,WA/BqB,EAAA,IAAA,EAgCtB,WAhCsB,CAgCV,KAhCU,CAAA,CAAA,EAiC1B,OAjC0B,CAiClB,OAjCkB,CAiCV,wBAjCU,EAiCgB,KAjChB,CAAA,CAAA;;QAGtB,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,CAAA,EAyDJ,OAzDI,CAyDI,OAzDJ,CAAA,IAAA,EAyDkB,MAzDlB,CAAA,CAAA;QACY,CAAA,cAAA,OAAA,GAyDY,MAzDZ,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,EAAA,IAAA,EA6DZ,WA7DY,CA6DA,KA7DA,CAAA,CAAA,EA8DhB,OA9DgB,CA8DR,OA9DQ,CAAA,IAAA,EA8DM,KA9DN,CAAA,CAAA"}
@@ -0,0 +1,45 @@
1
+ import { createCredential, listCredentials, revokeCredential } from "../../client/sdk.gen.js";
2
+ //#region src/neon/resources/credentials.ts
3
+ /** Branch-scoped scoped credentials. */
4
+ var Credentials = class {
5
+ #ctx;
6
+ constructor(ctx) {
7
+ this.#ctx = ctx;
8
+ }
9
+ list(projectId, branchId, opts) {
10
+ return this.#ctx.run(opts, (client) => listCredentials({
11
+ client,
12
+ path: {
13
+ project_id: projectId,
14
+ branch_id: branchId
15
+ },
16
+ throwOnError: false
17
+ }), (data) => data.credentials);
18
+ }
19
+ create(projectId, branchId, input, opts) {
20
+ return this.#ctx.run(opts, (client) => createCredential({
21
+ client,
22
+ path: {
23
+ project_id: projectId,
24
+ branch_id: branchId
25
+ },
26
+ body: input,
27
+ throwOnError: false
28
+ }), (data) => data);
29
+ }
30
+ revoke(projectId, branchId, tokenId, opts) {
31
+ return this.#ctx.runVoid(opts, (client) => revokeCredential({
32
+ client,
33
+ path: {
34
+ project_id: projectId,
35
+ branch_id: branchId,
36
+ token_id: tokenId
37
+ },
38
+ throwOnError: false
39
+ }));
40
+ }
41
+ };
42
+ //#endregion
43
+ export { Credentials };
44
+
45
+ //# sourceMappingURL=credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentials.js","names":["#ctx"],"sources":["../../../src/neon/resources/credentials.ts"],"sourcesContent":["import {\n\tcreateCredential,\n\tlistCredentials,\n\trevokeCredential,\n} from \"../../client/sdk.gen.js\";\nimport type {\n\tCreateCredentialRequest,\n\tCreateCredentialResponse,\n\tCredentialMeta,\n} from \"../../client/types.gen.js\";\nimport type { CallOptions, RequestContext } from \"../context.js\";\nimport type { NeonResult, Outcome } from \"../result.js\";\n\ntype CreateInput = CreateCredentialRequest;\n\n/** Branch-scoped scoped credentials. */\nexport class Credentials<DThrow extends boolean> {\n\treadonly #ctx: RequestContext;\n\n\tconstructor(ctx: RequestContext) {\n\t\tthis.#ctx = ctx;\n\t}\n\n\t/** @apiCall GET /projects/{project_id}/branches/{branch_id}/credentials */\n\tlist(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t): Promise<Outcome<CredentialMeta[], DThrow>>;\n\tlist<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<CredentialMeta[], Throw>>;\n\tlist(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\topts?: CallOptions,\n\t): Promise<CredentialMeta[] | NeonResult<CredentialMeta[]>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tlistCredentials({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, branch_id: branchId },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.credentials,\n\t\t);\n\t}\n\n\t/** @apiCall POST /projects/{project_id}/branches/{branch_id}/credentials */\n\tcreate(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tinput: CreateInput,\n\t): Promise<Outcome<CreateCredentialResponse, DThrow>>;\n\tcreate<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tinput: CreateInput,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<CreateCredentialResponse, Throw>>;\n\tcreate(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tinput: CreateInput,\n\t\topts?: CallOptions,\n\t): Promise<\n\t\tCreateCredentialResponse | NeonResult<CreateCredentialResponse>\n\t> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tcreateCredential({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, branch_id: branchId },\n\t\t\t\t\tbody: input,\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data,\n\t\t);\n\t}\n\n\t/** @apiCall DELETE /projects/{project_id}/branches/{branch_id}/credentials/{token_id} */\n\trevoke(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\ttokenId: string,\n\t): Promise<Outcome<void, DThrow>>;\n\trevoke<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\ttokenId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<void, Throw>>;\n\trevoke(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\ttokenId: string,\n\t\topts?: CallOptions,\n\t): Promise<void | NeonResult<void>> {\n\t\treturn this.#ctx.runVoid(opts, (client) =>\n\t\t\trevokeCredential({\n\t\t\t\tclient,\n\t\t\t\tpath: {\n\t\t\t\t\tproject_id: projectId,\n\t\t\t\t\tbranch_id: branchId,\n\t\t\t\t\ttoken_id: tokenId,\n\t\t\t\t},\n\t\t\t\tthrowOnError: false,\n\t\t\t}),\n\t\t);\n\t}\n}\n"],"mappings":";;;AAgBA,IAAa,cAAb,MAAiD;CAChD;CAEA,YAAY,KAAqB;EAChC,KAAKA,OAAO;CACb;CAYA,KACC,WACA,UACA,MAC2D;EAC3D,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,gBAAgB;GACf;GACA,MAAM;IAAE,YAAY;IAAW,WAAW;GAAS;GACnD,cAAc;EACf,CAAC,IACD,SAAS,KAAK,WAChB;CACD;CAcA,OACC,WACA,UACA,OACA,MAGC;EACD,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,iBAAiB;GAChB;GACA,MAAM;IAAE,YAAY;IAAW,WAAW;GAAS;GACnD,MAAM;GACN,cAAc;EACf,CAAC,IACD,SAAS,IACX;CACD;CAcA,OACC,WACA,UACA,SACA,MACmC;EACnC,OAAO,KAAKA,KAAK,QAAQ,OAAO,WAC/B,iBAAiB;GAChB;GACA,MAAM;IACL,YAAY;IACZ,WAAW;IACX,UAAU;GACX;GACA,cAAc;EACf,CAAC,CACF;CACD;AACD"}
@@ -12,6 +12,9 @@ declare class Endpoints<DThrow extends boolean> {
12
12
  /** @apiCall GET /projects/{project_id}/endpoints */
13
13
  list(projectId: string): Promise<Outcome<Endpoint[], DThrow>>;
14
14
  list<Throw extends boolean = DThrow>(projectId: string, opts: CallOptions<Throw>): Promise<Outcome<Endpoint[], Throw>>;
15
+ /** @apiCall GET /projects/{project_id}/branches/{branch_id}/endpoints */
16
+ listByBranch(projectId: string, branchId: string): Promise<Outcome<Endpoint[], DThrow>>;
17
+ listByBranch<Throw extends boolean = DThrow>(projectId: string, branchId: string, opts: CallOptions<Throw>): Promise<Outcome<Endpoint[], Throw>>;
15
18
  /** @apiCall GET /projects/{project_id}/endpoints/{endpoint_id} */
16
19
  get(projectId: string, endpointId: string): Promise<Outcome<Endpoint, DThrow>>;
17
20
  get<Throw extends boolean = DThrow>(projectId: string, endpointId: string, opts: CallOptions<Throw>): Promise<Outcome<Endpoint, Throw>>;
@@ -1 +1 @@
1
- {"version":3,"file":"endpoints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IV,CAAA,CAAA;;SAAR,CAAA,SAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,CAAA,EAoKR,OApKQ,CAoKA,OApKA,CAoKQ,QApKR,EAoKkB,MApKlB,CAAA,CAAA;SAAR,CAAA,cAAA,OAAA,GAqK6B,MArK7B,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,IAAA,EAwKI,WAxKJ,CAwKgB,KAxKhB,CAAA,CAAA,EAyKA,OAzKA,CAyKQ,OAzKR,CAyKgB,QAzKhB,EAyK0B,KAzK1B,CAAA,CAAA"}
@@ -1,4 +1,4 @@
1
- import { createProjectEndpoint, deleteProjectEndpoint, getProjectEndpoint, listProjectEndpoints, restartProjectEndpoint, startProjectEndpoint, suspendProjectEndpoint, updateProjectEndpoint } from "../../client/sdk.gen.js";
1
+ import { createProjectEndpoint, deleteProjectEndpoint, getProjectEndpoint, listProjectBranchEndpoints, listProjectEndpoints, restartProjectEndpoint, startProjectEndpoint, suspendProjectEndpoint, updateProjectEndpoint } from "../../client/sdk.gen.js";
2
2
  //#region src/neon/resources/endpoints.ts
3
3
  /** Compute endpoint resource (project-scoped). */
4
4
  var Endpoints = class {
@@ -13,6 +13,16 @@ var Endpoints = class {
13
13
  throwOnError: false
14
14
  }), (data) => data.endpoints);
15
15
  }
16
+ listByBranch(projectId, branchId, opts) {
17
+ return this.#ctx.run(opts, (client) => listProjectBranchEndpoints({
18
+ client,
19
+ path: {
20
+ project_id: projectId,
21
+ branch_id: branchId
22
+ },
23
+ throwOnError: false
24
+ }), (data) => data.endpoints);
25
+ }
16
26
  get(projectId, endpointId, opts) {
17
27
  return this.#ctx.run(opts, (client) => getProjectEndpoint({
18
28
  client,
@@ -1 +1 @@
1
- {"version":3,"file":"endpoints.js","names":["#ctx"],"sources":["../../../src/neon/resources/endpoints.ts"],"sourcesContent":["import {\n\tcreateProjectEndpoint,\n\tdeleteProjectEndpoint,\n\tgetProjectEndpoint,\n\tlistProjectEndpoints,\n\trestartProjectEndpoint,\n\tstartProjectEndpoint,\n\tsuspendProjectEndpoint,\n\tupdateProjectEndpoint,\n} from \"../../client/sdk.gen.js\";\nimport type {\n\tEndpoint,\n\tEndpointCreateRequest,\n\tEndpointUpdateRequest,\n} from \"../../client/types.gen.js\";\nimport type { CallOptions, RequestContext } from \"../context.js\";\nimport type { NeonResult, Outcome } from \"../result.js\";\n\ntype CreateInput = EndpointCreateRequest[\"endpoint\"];\ntype UpdateInput = EndpointUpdateRequest[\"endpoint\"];\n\n/** Compute endpoint resource (project-scoped). */\nexport class Endpoints<DThrow extends boolean> {\n\treadonly #ctx: RequestContext;\n\n\tconstructor(ctx: RequestContext) {\n\t\tthis.#ctx = ctx;\n\t}\n\n\t/** @apiCall GET /projects/{project_id}/endpoints */\n\tlist(projectId: string): Promise<Outcome<Endpoint[], DThrow>>;\n\tlist<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Endpoint[], Throw>>;\n\tlist(\n\t\tprojectId: string,\n\t\topts?: CallOptions,\n\t): Promise<Endpoint[] | NeonResult<Endpoint[]>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tlistProjectEndpoints({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.endpoints,\n\t\t);\n\t}\n\n\t/** @apiCall GET /projects/{project_id}/endpoints/{endpoint_id} */\n\tget(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t): Promise<Outcome<Endpoint, DThrow>>;\n\tget<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Endpoint, Throw>>;\n\tget(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts?: CallOptions,\n\t): Promise<Endpoint | NeonResult<Endpoint>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tgetProjectEndpoint({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, endpoint_id: endpointId },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.endpoint,\n\t\t);\n\t}\n\n\t/** @apiCall POST /projects/{project_id}/endpoints */\n\tcreate(\n\t\tprojectId: string,\n\t\tinput: CreateInput,\n\t): Promise<Outcome<Endpoint, DThrow>>;\n\tcreate<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tinput: CreateInput,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Endpoint, Throw>>;\n\tcreate(\n\t\tprojectId: string,\n\t\tinput: CreateInput,\n\t\topts?: CallOptions,\n\t): Promise<Endpoint | NeonResult<Endpoint>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tcreateProjectEndpoint({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId },\n\t\t\t\t\tbody: { endpoint: input },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.endpoint,\n\t\t);\n\t}\n\n\t/** @apiCall PATCH /projects/{project_id}/endpoints/{endpoint_id} */\n\tupdate(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\tinput: UpdateInput,\n\t): Promise<Outcome<Endpoint, DThrow>>;\n\tupdate<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\tinput: UpdateInput,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Endpoint, Throw>>;\n\tupdate(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\tinput: UpdateInput,\n\t\topts?: CallOptions,\n\t): Promise<Endpoint | NeonResult<Endpoint>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tupdateProjectEndpoint({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, endpoint_id: endpointId },\n\t\t\t\t\tbody: { endpoint: input },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.endpoint,\n\t\t);\n\t}\n\n\t/** @apiCall DELETE /projects/{project_id}/endpoints/{endpoint_id} */\n\tdelete(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t): Promise<Outcome<void, DThrow>>;\n\tdelete<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<void, Throw>>;\n\tdelete(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts?: CallOptions,\n\t): Promise<void | NeonResult<void>> {\n\t\treturn this.#ctx.runVoid(opts, (client) =>\n\t\t\tdeleteProjectEndpoint({\n\t\t\t\tclient,\n\t\t\t\tpath: { project_id: projectId, endpoint_id: endpointId },\n\t\t\t\tthrowOnError: false,\n\t\t\t}),\n\t\t);\n\t}\n\n\t/** @apiCall POST /projects/{project_id}/endpoints/{endpoint_id}/start */\n\tstart(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t): Promise<Outcome<Endpoint, DThrow>>;\n\tstart<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Endpoint, Throw>>;\n\tstart(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts?: CallOptions,\n\t): Promise<Endpoint | NeonResult<Endpoint>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tstartProjectEndpoint({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, endpoint_id: endpointId },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.endpoint,\n\t\t);\n\t}\n\n\t/** @apiCall POST /projects/{project_id}/endpoints/{endpoint_id}/suspend */\n\tsuspend(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t): Promise<Outcome<Endpoint, DThrow>>;\n\tsuspend<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Endpoint, Throw>>;\n\tsuspend(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts?: CallOptions,\n\t): Promise<Endpoint | NeonResult<Endpoint>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tsuspendProjectEndpoint({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, endpoint_id: endpointId },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.endpoint,\n\t\t);\n\t}\n\n\t/** @apiCall POST /projects/{project_id}/endpoints/{endpoint_id}/restart */\n\trestart(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t): Promise<Outcome<Endpoint, DThrow>>;\n\trestart<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Endpoint, Throw>>;\n\trestart(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts?: CallOptions,\n\t): Promise<Endpoint | NeonResult<Endpoint>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\trestartProjectEndpoint({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, endpoint_id: endpointId },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.endpoint,\n\t\t);\n\t}\n}\n"],"mappings":";;;AAsBA,IAAa,YAAb,MAA+C;CAC9C;CAEA,YAAY,KAAqB;EAChC,KAAKA,OAAO;CACb;CAQA,KACC,WACA,MAC+C;EAC/C,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,qBAAqB;GACpB;GACA,MAAM,EAAE,YAAY,UAAU;GAC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AM;IAAE,YAAY;IAAW,aAAa;GAAW;GACvD,cAAc;EACf,CAAC,IACD,SAAS,KAAK,QAChB;CACD;AACD"}
1
+ {"version":3,"file":"endpoints.js","names":["#ctx"],"sources":["../../../src/neon/resources/endpoints.ts"],"sourcesContent":["import {\n\tcreateProjectEndpoint,\n\tdeleteProjectEndpoint,\n\tgetProjectEndpoint,\n\tlistProjectBranchEndpoints,\n\tlistProjectEndpoints,\n\trestartProjectEndpoint,\n\tstartProjectEndpoint,\n\tsuspendProjectEndpoint,\n\tupdateProjectEndpoint,\n} from \"../../client/sdk.gen.js\";\nimport type {\n\tEndpoint,\n\tEndpointCreateRequest,\n\tEndpointUpdateRequest,\n} from \"../../client/types.gen.js\";\nimport type { CallOptions, RequestContext } from \"../context.js\";\nimport type { NeonResult, Outcome } from \"../result.js\";\n\ntype CreateInput = EndpointCreateRequest[\"endpoint\"];\ntype UpdateInput = EndpointUpdateRequest[\"endpoint\"];\n\n/** Compute endpoint resource (project-scoped). */\nexport class Endpoints<DThrow extends boolean> {\n\treadonly #ctx: RequestContext;\n\n\tconstructor(ctx: RequestContext) {\n\t\tthis.#ctx = ctx;\n\t}\n\n\t/** @apiCall GET /projects/{project_id}/endpoints */\n\tlist(projectId: string): Promise<Outcome<Endpoint[], DThrow>>;\n\tlist<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Endpoint[], Throw>>;\n\tlist(\n\t\tprojectId: string,\n\t\topts?: CallOptions,\n\t): Promise<Endpoint[] | NeonResult<Endpoint[]>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tlistProjectEndpoints({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.endpoints,\n\t\t);\n\t}\n\n\t/** @apiCall GET /projects/{project_id}/branches/{branch_id}/endpoints */\n\tlistByBranch(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t): Promise<Outcome<Endpoint[], DThrow>>;\n\tlistByBranch<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Endpoint[], Throw>>;\n\tlistByBranch(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\topts?: CallOptions,\n\t): Promise<Endpoint[] | NeonResult<Endpoint[]>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tlistProjectBranchEndpoints({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, branch_id: branchId },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.endpoints,\n\t\t);\n\t}\n\n\t/** @apiCall GET /projects/{project_id}/endpoints/{endpoint_id} */\n\tget(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t): Promise<Outcome<Endpoint, DThrow>>;\n\tget<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Endpoint, Throw>>;\n\tget(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts?: CallOptions,\n\t): Promise<Endpoint | NeonResult<Endpoint>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tgetProjectEndpoint({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, endpoint_id: endpointId },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.endpoint,\n\t\t);\n\t}\n\n\t/** @apiCall POST /projects/{project_id}/endpoints */\n\tcreate(\n\t\tprojectId: string,\n\t\tinput: CreateInput,\n\t): Promise<Outcome<Endpoint, DThrow>>;\n\tcreate<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tinput: CreateInput,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Endpoint, Throw>>;\n\tcreate(\n\t\tprojectId: string,\n\t\tinput: CreateInput,\n\t\topts?: CallOptions,\n\t): Promise<Endpoint | NeonResult<Endpoint>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tcreateProjectEndpoint({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId },\n\t\t\t\t\tbody: { endpoint: input },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.endpoint,\n\t\t);\n\t}\n\n\t/** @apiCall PATCH /projects/{project_id}/endpoints/{endpoint_id} */\n\tupdate(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\tinput: UpdateInput,\n\t): Promise<Outcome<Endpoint, DThrow>>;\n\tupdate<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\tinput: UpdateInput,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Endpoint, Throw>>;\n\tupdate(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\tinput: UpdateInput,\n\t\topts?: CallOptions,\n\t): Promise<Endpoint | NeonResult<Endpoint>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tupdateProjectEndpoint({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, endpoint_id: endpointId },\n\t\t\t\t\tbody: { endpoint: input },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.endpoint,\n\t\t);\n\t}\n\n\t/** @apiCall DELETE /projects/{project_id}/endpoints/{endpoint_id} */\n\tdelete(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t): Promise<Outcome<void, DThrow>>;\n\tdelete<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<void, Throw>>;\n\tdelete(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts?: CallOptions,\n\t): Promise<void | NeonResult<void>> {\n\t\treturn this.#ctx.runVoid(opts, (client) =>\n\t\t\tdeleteProjectEndpoint({\n\t\t\t\tclient,\n\t\t\t\tpath: { project_id: projectId, endpoint_id: endpointId },\n\t\t\t\tthrowOnError: false,\n\t\t\t}),\n\t\t);\n\t}\n\n\t/** @apiCall POST /projects/{project_id}/endpoints/{endpoint_id}/start */\n\tstart(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t): Promise<Outcome<Endpoint, DThrow>>;\n\tstart<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Endpoint, Throw>>;\n\tstart(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts?: CallOptions,\n\t): Promise<Endpoint | NeonResult<Endpoint>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tstartProjectEndpoint({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, endpoint_id: endpointId },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.endpoint,\n\t\t);\n\t}\n\n\t/** @apiCall POST /projects/{project_id}/endpoints/{endpoint_id}/suspend */\n\tsuspend(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t): Promise<Outcome<Endpoint, DThrow>>;\n\tsuspend<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Endpoint, Throw>>;\n\tsuspend(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts?: CallOptions,\n\t): Promise<Endpoint | NeonResult<Endpoint>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tsuspendProjectEndpoint({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, endpoint_id: endpointId },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.endpoint,\n\t\t);\n\t}\n\n\t/** @apiCall POST /projects/{project_id}/endpoints/{endpoint_id}/restart */\n\trestart(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t): Promise<Outcome<Endpoint, DThrow>>;\n\trestart<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Endpoint, Throw>>;\n\trestart(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts?: CallOptions,\n\t): Promise<Endpoint | NeonResult<Endpoint>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\trestartProjectEndpoint({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, endpoint_id: endpointId },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.endpoint,\n\t\t);\n\t}\n}\n"],"mappings":";;;AAuBA,IAAa,YAAb,MAA+C;CAC9C;CAEA,YAAY,KAAqB;EAChC,KAAKA,OAAO;CACb;CAQA,KACC,WACA,MAC+C;EAC/C,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,qBAAqB;GACpB;GACA,MAAM,EAAE,YAAY,UAAU;GAC9B,cAAc;EACf,CAAC,IACD,SAAS,KAAK,SAChB;CACD;CAYA,aACC,WACA,UACA,MAC+C;EAC/C,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,2BAA2B;GAC1B;GACA,MAAM;IAAE,YAAY;IAAW,WAAW;GAAS;GACnD,cAAc;EACf,CAAC,IACD,SAAS,KAAK,SAChB;CACD;CAYA,IACC,WACA,YACA,MAC2C;EAC3C,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,mBAAmB;GAClB;GACA,MAAM;IAAE,YAAY;IAAW,aAAa;GAAW;GACvD,cAAc;EACf,CAAC,IACD,SAAS,KAAK,QAChB;CACD;CAYA,OACC,WACA,OACA,MAC2C;EAC3C,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,sBAAsB;GACrB;GACA,MAAM,EAAE,YAAY,UAAU;GAC9B,MAAM,EAAE,UAAU,MAAM;GACxB,cAAc;EACf,CAAC,IACD,SAAS,KAAK,QAChB;CACD;CAcA,OACC,WACA,YACA,OACA,MAC2C;EAC3C,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,sBAAsB;GACrB;GACA,MAAM;IAAE,YAAY;IAAW,aAAa;GAAW;GACvD,MAAM,EAAE,UAAU,MAAM;GACxB,cAAc;EACf,CAAC,IACD,SAAS,KAAK,QAChB;CACD;CAYA,OACC,WACA,YACA,MACmC;EACnC,OAAO,KAAKA,KAAK,QAAQ,OAAO,WAC/B,sBAAsB;GACrB;GACA,MAAM;IAAE,YAAY;IAAW,aAAa;GAAW;GACvD,cAAc;EACf,CAAC,CACF;CACD;CAYA,MACC,WACA,YACA,MAC2C;EAC3C,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,qBAAqB;GACpB;GACA,MAAM;IAAE,YAAY;IAAW,aAAa;GAAW;GACvD,cAAc;EACf,CAAC,IACD,SAAS,KAAK,QAChB;CACD;CAYA,QACC,WACA,YACA,MAC2C;EAC3C,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,uBAAuB;GACtB;GACA,MAAM;IAAE,YAAY;IAAW,aAAa;GAAW;GACvD,cAAc;EACf,CAAC,IACD,SAAS,KAAK,QAChB;CACD;CAYA,QACC,WACA,YACA,MAC2C;EAC3C,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,uBAAuB;GACtB;GACA,MAAM;IAAE,YAAY;IAAW,aAAa;GAAW;GACvD,cAAc;EACf,CAAC,IACD,SAAS,KAAK,QAChB;CACD;AACD"}
@@ -0,0 +1,30 @@
1
+ import { FunctionDeployRequest, ListProjectBranchFunctionsData, NeonFunction, NeonFunctionDeployment, NeonFunctionUpdateRequest } from "../../client/types.gen.js";
2
+ import { Outcome } from "../result.js";
3
+ import { CallOptions, RequestContext } from "../context.js";
4
+ import { Paginated } from "../paginate.js";
5
+
6
+ //#region src/neon/resources/functions.d.ts
7
+ type ListQuery = Omit<NonNullable<ListProjectBranchFunctionsData["query"]>, "cursor">;
8
+ type UpdateInput = NeonFunctionUpdateRequest;
9
+ /** Branch-scoped Neon Functions. */
10
+ declare class Functions<DThrow extends boolean> {
11
+ #private;
12
+ constructor(ctx: RequestContext);
13
+ /** @apiCall GET /projects/{project_id}/branches/{branch_id}/functions (cursor-paginated) */
14
+ list(projectId: string, branchId: string, query?: ListQuery): Paginated<NeonFunction>;
15
+ /** @apiCall GET /projects/{project_id}/branches/{branch_id}/functions/{slug} */
16
+ get(projectId: string, branchId: string, slug: string): Promise<Outcome<NeonFunction, DThrow>>;
17
+ get<Throw extends boolean = DThrow>(projectId: string, branchId: string, slug: string, opts: CallOptions<Throw>): Promise<Outcome<NeonFunction, Throw>>;
18
+ /** @apiCall PATCH /projects/{project_id}/branches/{branch_id}/functions/{slug} */
19
+ update(projectId: string, branchId: string, slug: string, input: UpdateInput): Promise<Outcome<NeonFunction, DThrow>>;
20
+ update<Throw extends boolean = DThrow>(projectId: string, branchId: string, slug: string, input: UpdateInput, opts: CallOptions<Throw>): Promise<Outcome<NeonFunction, Throw>>;
21
+ /** @apiCall DELETE /projects/{project_id}/branches/{branch_id}/functions/{slug} */
22
+ delete(projectId: string, branchId: string, slug: string): Promise<Outcome<void, DThrow>>;
23
+ delete<Throw extends boolean = DThrow>(projectId: string, branchId: string, slug: string, opts: CallOptions<Throw>): Promise<Outcome<void, Throw>>;
24
+ /** @apiCall POST /projects/{project_id}/branches/{branch_id}/functions/{slug}/deployments */
25
+ deploy(projectId: string, branchId: string, slug: string, input?: FunctionDeployRequest): Promise<Outcome<NeonFunctionDeployment, DThrow>>;
26
+ deploy<Throw extends boolean = DThrow>(projectId: string, branchId: string, slug: string, input: FunctionDeployRequest | undefined, opts: CallOptions<Throw>): Promise<Outcome<NeonFunctionDeployment, Throw>>;
27
+ }
28
+ //#endregion
29
+ export { Functions };
30
+ //# sourceMappingURL=functions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions.d.ts","names":[],"sources":["../../../src/neon/resources/functions.ts"],"mappings":";;;;;;KAkBK,SAAA,GAAY,KAChB,YAAY;KAGR,WAAA,GAAc;AANqC;AAE1C,cAOD,SAPC,CAAA,eAAA,OAAA,CAAA,CAAA;UACD;aAAZ,CAAA,GAAA,EASiB,cATjB;;EADoB,IAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,KAAA,CAAA,EAkBX,SAlBW,CAAA,EAmBjB,SAnBiB,CAmBP,YAnBO,CAAA;EAIhB;EAGQ,GAAA,CAAA,SAAS,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,CAAA,EAkClB,OAlCkB,CAkCV,OAlCU,CAkCF,YAlCE,EAkCY,MAlCZ,CAAA,CAAA;EAAA,GAAA,CAAA,cAAA,OAAA,GAmCO,MAnCP,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAuCd,WAvCc,CAuCF,KAvCE,CAAA,CAAA,EAwClB,OAxCkB,CAwCV,OAxCU,CAwCF,YAxCE,EAwCY,KAxCZ,CAAA,CAAA;;QAWZ,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,KAAA,EAyDD,WAzDC,CAAA,EA0DN,OA1DM,CA0DE,OA1DF,CA0DU,YA1DV,EA0DwB,MA1DxB,CAAA,CAAA;QACI,CAAA,cAAA,OAAA,GA0DkB,MA1DlB,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,KAAA,EA8DL,WA9DK,EAAA,IAAA,EA+DN,WA/DM,CA+DM,KA/DN,CAAA,CAAA,EAgEV,OAhEU,CAgEF,OAhEE,CAgEM,YAhEN,EAgEoB,KAhEpB,CAAA,CAAA;;QAsBM,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,CAAA,EAwEhB,OAxEgB,CAwER,OAxEQ,CAAA,IAAA,EAwEM,MAxEN,CAAA,CAAA;QAAc,CAAA,cAAA,OAAA,GAyEF,MAzEE,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EA6E1B,WA7E0B,CA6Ed,KA7Ec,CAAA,CAAA,EA8E9B,OA9E8B,CA8EtB,OA9EsB,CAAA,IAAA,EA8ER,KA9EQ,CAAA,CAAA;;QAA9B,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,KAAA,CAAA,EAuGM,qBAvGN,CAAA,EAwGA,OAxGA,CAwGQ,OAxGR,CAwGgB,sBAxGhB,EAwGwC,MAxGxC,CAAA,CAAA;QACyB,CAAA,cAAA,OAAA,GAwGG,MAxGH,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,KAAA,EA4GpB,qBA5GoB,GAAA,SAAA,EAAA,IAAA,EA6GrB,WA7GqB,CA6GT,KA7GS,CAAA,CAAA,EA8GzB,OA9GyB,CA8GjB,OA9GiB,CA8GT,sBA9GS,EA8Ge,KA9Gf,CAAA,CAAA"}
@@ -0,0 +1,79 @@
1
+ import { createProjectBranchFunctionDeployment, deleteProjectBranchFunction, getProjectBranchFunction, listProjectBranchFunctions, updateProjectBranchFunction } from "../../client/sdk.gen.js";
2
+ import { paginate } from "../paginate.js";
3
+ //#region src/neon/resources/functions.ts
4
+ /** Branch-scoped Neon Functions. */
5
+ var Functions = class {
6
+ #ctx;
7
+ constructor(ctx) {
8
+ this.#ctx = ctx;
9
+ }
10
+ /** @apiCall GET /projects/{project_id}/branches/{branch_id}/functions (cursor-paginated) */
11
+ list(projectId, branchId, query) {
12
+ return paginate((cursor, signal) => listProjectBranchFunctions({
13
+ client: this.#ctx.client,
14
+ path: {
15
+ project_id: projectId,
16
+ branch_id: branchId
17
+ },
18
+ query: {
19
+ ...query,
20
+ cursor
21
+ },
22
+ throwOnError: false,
23
+ signal
24
+ }), (data) => ({
25
+ items: data?.functions ?? [],
26
+ cursor: data?.pagination?.next
27
+ }));
28
+ }
29
+ get(projectId, branchId, slug, opts) {
30
+ return this.#ctx.run(opts, (client) => getProjectBranchFunction({
31
+ client,
32
+ path: {
33
+ project_id: projectId,
34
+ branch_id: branchId,
35
+ slug
36
+ },
37
+ throwOnError: false
38
+ }), (data) => data.function);
39
+ }
40
+ update(projectId, branchId, slug, input, opts) {
41
+ return this.#ctx.run(opts, (client) => updateProjectBranchFunction({
42
+ client,
43
+ path: {
44
+ project_id: projectId,
45
+ branch_id: branchId,
46
+ slug
47
+ },
48
+ body: input,
49
+ throwOnError: false
50
+ }), (data) => data.function);
51
+ }
52
+ delete(projectId, branchId, slug, opts) {
53
+ return this.#ctx.runVoid(opts, (client) => deleteProjectBranchFunction({
54
+ client,
55
+ path: {
56
+ project_id: projectId,
57
+ branch_id: branchId,
58
+ slug
59
+ },
60
+ throwOnError: false
61
+ }));
62
+ }
63
+ deploy(projectId, branchId, slug, input, opts) {
64
+ return this.#ctx.run(opts, (client) => createProjectBranchFunctionDeployment({
65
+ client,
66
+ path: {
67
+ project_id: projectId,
68
+ branch_id: branchId,
69
+ slug
70
+ },
71
+ body: input ?? {},
72
+ throwOnError: false
73
+ }), (data) => data.deployment);
74
+ }
75
+ };
76
+ //#endregion
77
+ export { Functions };
78
+
79
+ //# sourceMappingURL=functions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions.js","names":["#ctx"],"sources":["../../../src/neon/resources/functions.ts"],"sourcesContent":["import {\n\tcreateProjectBranchFunctionDeployment,\n\tdeleteProjectBranchFunction,\n\tgetProjectBranchFunction,\n\tlistProjectBranchFunctions,\n\tupdateProjectBranchFunction,\n} from \"../../client/sdk.gen.js\";\nimport type {\n\tFunctionDeployRequest,\n\tListProjectBranchFunctionsData,\n\tNeonFunction,\n\tNeonFunctionDeployment,\n\tNeonFunctionUpdateRequest,\n} from \"../../client/types.gen.js\";\nimport type { CallOptions, RequestContext } from \"../context.js\";\nimport { type Paginated, paginate } from \"../paginate.js\";\nimport type { NeonResult, Outcome } from \"../result.js\";\n\ntype ListQuery = Omit<\n\tNonNullable<ListProjectBranchFunctionsData[\"query\"]>,\n\t\"cursor\"\n>;\ntype UpdateInput = NeonFunctionUpdateRequest;\n\n/** Branch-scoped Neon Functions. */\nexport class Functions<DThrow extends boolean> {\n\treadonly #ctx: RequestContext;\n\n\tconstructor(ctx: RequestContext) {\n\t\tthis.#ctx = ctx;\n\t}\n\n\t/** @apiCall GET /projects/{project_id}/branches/{branch_id}/functions (cursor-paginated) */\n\tlist(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tquery?: ListQuery,\n\t): Paginated<NeonFunction> {\n\t\treturn paginate(\n\t\t\t(cursor, signal) =>\n\t\t\t\tlistProjectBranchFunctions({\n\t\t\t\t\tclient: this.#ctx.client,\n\t\t\t\t\tpath: { project_id: projectId, branch_id: branchId },\n\t\t\t\t\tquery: { ...query, cursor },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t\tsignal,\n\t\t\t\t}),\n\t\t\t(data) => ({\n\t\t\t\titems: data?.functions ?? [],\n\t\t\t\tcursor: data?.pagination?.next,\n\t\t\t}),\n\t\t);\n\t}\n\n\t/** @apiCall GET /projects/{project_id}/branches/{branch_id}/functions/{slug} */\n\tget(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tslug: string,\n\t): Promise<Outcome<NeonFunction, DThrow>>;\n\tget<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tslug: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<NeonFunction, Throw>>;\n\tget(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tslug: string,\n\t\topts?: CallOptions,\n\t): Promise<NeonFunction | NeonResult<NeonFunction>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tgetProjectBranchFunction({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: {\n\t\t\t\t\t\tproject_id: projectId,\n\t\t\t\t\t\tbranch_id: branchId,\n\t\t\t\t\t\tslug,\n\t\t\t\t\t},\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.function,\n\t\t);\n\t}\n\n\t/** @apiCall PATCH /projects/{project_id}/branches/{branch_id}/functions/{slug} */\n\tupdate(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tslug: string,\n\t\tinput: UpdateInput,\n\t): Promise<Outcome<NeonFunction, DThrow>>;\n\tupdate<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tslug: string,\n\t\tinput: UpdateInput,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<NeonFunction, Throw>>;\n\tupdate(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tslug: string,\n\t\tinput: UpdateInput,\n\t\topts?: CallOptions,\n\t): Promise<NeonFunction | NeonResult<NeonFunction>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tupdateProjectBranchFunction({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: {\n\t\t\t\t\t\tproject_id: projectId,\n\t\t\t\t\t\tbranch_id: branchId,\n\t\t\t\t\t\tslug,\n\t\t\t\t\t},\n\t\t\t\t\tbody: input,\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.function,\n\t\t);\n\t}\n\n\t/** @apiCall DELETE /projects/{project_id}/branches/{branch_id}/functions/{slug} */\n\tdelete(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tslug: string,\n\t): Promise<Outcome<void, DThrow>>;\n\tdelete<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tslug: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<void, Throw>>;\n\tdelete(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tslug: string,\n\t\topts?: CallOptions,\n\t): Promise<void | NeonResult<void>> {\n\t\treturn this.#ctx.runVoid(opts, (client) =>\n\t\t\tdeleteProjectBranchFunction({\n\t\t\t\tclient,\n\t\t\t\tpath: {\n\t\t\t\t\tproject_id: projectId,\n\t\t\t\t\tbranch_id: branchId,\n\t\t\t\t\tslug,\n\t\t\t\t},\n\t\t\t\tthrowOnError: false,\n\t\t\t}),\n\t\t);\n\t}\n\n\t/** @apiCall POST /projects/{project_id}/branches/{branch_id}/functions/{slug}/deployments */\n\tdeploy(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tslug: string,\n\t\tinput?: FunctionDeployRequest,\n\t): Promise<Outcome<NeonFunctionDeployment, DThrow>>;\n\tdeploy<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tslug: string,\n\t\tinput: FunctionDeployRequest | undefined,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<NeonFunctionDeployment, Throw>>;\n\tdeploy(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tslug: string,\n\t\tinput?: FunctionDeployRequest,\n\t\topts?: CallOptions,\n\t): Promise<NeonFunctionDeployment | NeonResult<NeonFunctionDeployment>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tcreateProjectBranchFunctionDeployment({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: {\n\t\t\t\t\t\tproject_id: projectId,\n\t\t\t\t\t\tbranch_id: branchId,\n\t\t\t\t\t\tslug,\n\t\t\t\t\t},\n\t\t\t\t\tbody: input ?? {},\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.deployment,\n\t\t);\n\t}\n}\n"],"mappings":";;;;AAyBA,IAAa,YAAb,MAA+C;CAC9C;CAEA,YAAY,KAAqB;EAChC,KAAKA,OAAO;CACb;;CAGA,KACC,WACA,UACA,OAC0B;EAC1B,OAAO,UACL,QAAQ,WACR,2BAA2B;GAC1B,QAAQ,KAAKA,KAAK;GAClB,MAAM;IAAE,YAAY;IAAW,WAAW;GAAS;GACnD,OAAO;IAAE,GAAG;IAAO;GAAO;GAC1B,cAAc;GACd;EACD,CAAC,IACD,UAAU;GACV,OAAO,MAAM,aAAa,CAAC;GAC3B,QAAQ,MAAM,YAAY;EAC3B,EACD;CACD;CAcA,IACC,WACA,UACA,MACA,MACmD;EACnD,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,yBAAyB;GACxB;GACA,MAAM;IACL,YAAY;IACZ,WAAW;IACX;GACD;GACA,cAAc;EACf,CAAC,IACD,SAAS,KAAK,QAChB;CACD;CAgBA,OACC,WACA,UACA,MACA,OACA,MACmD;EACnD,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,4BAA4B;GAC3B;GACA,MAAM;IACL,YAAY;IACZ,WAAW;IACX;GACD;GACA,MAAM;GACN,cAAc;EACf,CAAC,IACD,SAAS,KAAK,QAChB;CACD;CAcA,OACC,WACA,UACA,MACA,MACmC;EACnC,OAAO,KAAKA,KAAK,QAAQ,OAAO,WAC/B,4BAA4B;GAC3B;GACA,MAAM;IACL,YAAY;IACZ,WAAW;IACX;GACD;GACA,cAAc;EACf,CAAC,CACF;CACD;CAgBA,OACC,WACA,UACA,MACA,OACA,MACuE;EACvE,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,sCAAsC;GACrC;GACA,MAAM;IACL,YAAY;IACZ,WAAW;IACX;GACD;GACA,MAAM,SAAS,CAAC;GAChB,cAAc;EACf,CAAC,IACD,SAAS,KAAK,UAChB;CACD;AACD"}
@@ -1,4 +1,4 @@
1
- import { ListProjectsData, Project, ProjectCreateRequest, ProjectListItem, ProjectUpdateRequest } from "../../client/types.gen.js";
1
+ import { ListProjectsData, Project, ProjectCreateRequest, ProjectListItem, ProjectPermission, ProjectUpdateRequest } from "../../client/types.gen.js";
2
2
  import { Outcome } from "../result.js";
3
3
  import { CallOptions, RequestContext } from "../context.js";
4
4
  import { Paginated } from "../paginate.js";
@@ -25,9 +25,25 @@ interface ProjectConnection {
25
25
  project: Project;
26
26
  connectionString: string;
27
27
  }
28
+ /** Project access grants (share a project with additional users by email). */
29
+ declare class Permissions<DThrow extends boolean> {
30
+ #private;
31
+ constructor(ctx: RequestContext);
32
+ /** @apiCall GET /projects/{project_id}/permissions */
33
+ list(projectId: string): Promise<Outcome<ProjectPermission[], DThrow>>;
34
+ list<Throw extends boolean = DThrow>(projectId: string, opts: CallOptions<Throw>): Promise<Outcome<ProjectPermission[], Throw>>;
35
+ /** @apiCall POST /projects/{project_id}/permissions */
36
+ grant(projectId: string, email: string): Promise<Outcome<ProjectPermission, DThrow>>;
37
+ grant<Throw extends boolean = DThrow>(projectId: string, email: string, opts: CallOptions<Throw>): Promise<Outcome<ProjectPermission, Throw>>;
38
+ /** @apiCall DELETE /projects/{project_id}/permissions/{permission_id} */
39
+ revoke(projectId: string, permissionId: string): Promise<Outcome<ProjectPermission, DThrow>>;
40
+ revoke<Throw extends boolean = DThrow>(projectId: string, permissionId: string, opts: CallOptions<Throw>): Promise<Outcome<ProjectPermission, Throw>>;
41
+ }
28
42
  /** Project resource — one API call per method (`list` is cursor-paginated). */
29
43
  declare class Projects<DThrow extends boolean> {
30
44
  #private;
45
+ /** Project access grants (share by email). */
46
+ readonly permissions: Permissions<DThrow>;
31
47
  constructor(ctx: RequestContext);
32
48
  /**
33
49
  * List projects (cursor-paginated). Returns a lazy list — `await .all()`, `.page()`,
@@ -57,6 +73,14 @@ declare class Projects<DThrow extends boolean> {
57
73
  /** @apiCall DELETE /projects/{project_id} */
58
74
  delete(id: string): Promise<Outcome<Project, DThrow>>;
59
75
  delete<Throw extends boolean = DThrow>(id: string, opts: CallOptions<Throw>): Promise<Outcome<Project, Throw>>;
76
+ /**
77
+ * Recover a soft-deleted project within its retention window (beta). Mirrors
78
+ * `branches.recover` at the project level.
79
+ *
80
+ * @apiCall POST /projects/{project_id}/recover
81
+ */
82
+ recover(id: string): Promise<Outcome<Project, DThrow>>;
83
+ recover<Throw extends boolean = DThrow>(id: string, opts: CallOptions<Throw>): Promise<Outcome<Project, Throw>>;
60
84
  /**
61
85
  * Transfer projects from one organization to another (e.g. sponsored → paid). The
62
86
  * source org defaults to the client's `orgId`. Requires a key with access to both orgs.
@@ -80,5 +104,5 @@ declare class Projects<DThrow extends boolean> {
80
104
  }, opts: CallOptions<Throw>): Promise<Outcome<void, Throw>>;
81
105
  }
82
106
  //#endregion
83
- export { ProjectConnection, Projects, TransferProjectsInput };
107
+ export { Permissions, ProjectConnection, Projects, TransferProjectsInput };
84
108
  //# sourceMappingURL=projects.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"projects.d.ts","names":[],"sources":["../../../src/neon/resources/projects.ts"],"mappings":";;;;;;;UAuBiB,qBAAA;EAAA;EAQZ,SAAA,CAAA,EAAS,MAAA;EAAA;SAAoB,EAAA,MAAA;YAAZ,EAAA,MAAA,EAAA;;AAAD,KAAhB,SAAA,GAAY,IAAI,CAAC,WAAD,CAAa,gBAAb,CAAA,OAAA,CAAA,CAAA,EAAA,QAAA,CAAA;AAAA,KAChB,WAAA,GAAc,oBAAA,CAAA,SAAA,CAAA;AAAoB,KAClC,WAAA,GAAc,oBAAA,CAAA,SAAA,CAAA;AAAoB;UAG7B,eAAe,CAAA,cAAA,OAAA,CAAA,SAAgC,WAAhC,CAA4C,KAA5C,CAAA,CAAA;;QAAgC,CAAA,EAAA,OAAA;AAAW;AAMpE;AAMa,UANI,iBAAA,CAMI;EAAA,OAAA,EALX,OAKW;kBAGH,EAAA,MAAA;;;AAUQ,cAbb,QAaa,CA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AAA,EAAA,EAAA,MAAA,CAAA,EAkIjC,OAlIiC,CAkIzB,OAlIyB,CAkIjB,OAlIiB,EAkIR,MAlIQ,CAAA,CAAA;SAAjB,CAAA,cAAA,OAAA,GAmIL,MAnIK,CAAA,CAAA,EAAA,EAAA,MAAA,EAAA,IAAA,EAqI9B,WArI8B,CAqIlB,KArIkB,CAAA,CAAA,EAsIlC,OAtIkC,CAsI1B,OAtI0B,CAsIlB,OAtIkB,EAsIT,KAtIS,CAAA,CAAA;;;;;;;UAIT,CAAA,KAAA,EAyJZ,qBAzJY,CAAA,EAyJY,OAzJZ,CAyJoB,OAzJpB,CAAA,IAAA,EAyJkC,MAzJlC,CAAA,CAAA;UAAjB,CAAA,cAAA,OAAA,GA0JsB,MA1JtB,CAAA,CAAA,KAAA,EA2JH,qBA3JG,EAAA,IAAA,EA4JJ,WA5JI,CA4JQ,KA5JR,CAAA,CAAA,EA6JR,OA7JQ,CA6JA,OA7JA,CAAA,IAAA,EA6Jc,KA7Jd,CAAA,CAAA;;;;;;kBAiCR,CAAA,KAAA,EAAA;IACsC,OAAA,EAAA,MAAA;IACjC,UAAA,EAAA,MAAA,EAAA;MAqKJ,OApKmB,CAoKX,OApKW,CAAA,IAAA,EAoKG,MApKH,CAAA,CAAA;kBAAhB,CAAA,cAAA,OAAA,GAqKkC,MArKlC,CAAA,CAAA,KAAA,EAAA;IACY,OAAA,EAAA,MAAA;IAAmB,UAAA,EAAA,MAAA,EAAA;KAA3B,IAAA,EAsKJ,WAtKI,CAsKQ,KAtKR,CAAA,CAAA,EAuKR,OAvKQ,CAuKA,OAvKA,CAAA,IAAA,EAuKc,KAvKd,CAAA,CAAA"}
@@ -1,14 +1,49 @@
1
1
  import { NeonError } from "../errors.js";
2
2
  import { err, finalize } from "../result.js";
3
- import { createProject, deleteProject, getProject, listProjects, transferProjectsFromOrgToOrg, transferProjectsFromUserToOrg, updateProject } from "../../client/sdk.gen.js";
3
+ import { createProject, deleteProject, getProject, grantPermissionToProject, listProjectPermissions, listProjects, recoverProject, revokePermissionFromProject, transferProjectsFromOrgToOrg, transferProjectsFromUserToOrg, updateProject } from "../../client/sdk.gen.js";
4
4
  import { withConnectionString } from "../connection.js";
5
5
  import { paginate } from "../paginate.js";
6
6
  //#region src/neon/resources/projects.ts
7
+ /** Project access grants (share a project with additional users by email). */
8
+ var Permissions = class {
9
+ #ctx;
10
+ constructor(ctx) {
11
+ this.#ctx = ctx;
12
+ }
13
+ list(projectId, opts) {
14
+ return this.#ctx.run(opts, (client) => listProjectPermissions({
15
+ client,
16
+ path: { project_id: projectId },
17
+ throwOnError: false
18
+ }), (data) => data.project_permissions);
19
+ }
20
+ grant(projectId, email, opts) {
21
+ return this.#ctx.run(opts, (client) => grantPermissionToProject({
22
+ client,
23
+ path: { project_id: projectId },
24
+ body: { email },
25
+ throwOnError: false
26
+ }), (data) => data);
27
+ }
28
+ revoke(projectId, permissionId, opts) {
29
+ return this.#ctx.run(opts, (client) => revokePermissionFromProject({
30
+ client,
31
+ path: {
32
+ project_id: projectId,
33
+ permission_id: permissionId
34
+ },
35
+ throwOnError: false
36
+ }), (data) => data);
37
+ }
38
+ };
7
39
  /** Project resource — one API call per method (`list` is cursor-paginated). */
8
40
  var Projects = class {
9
41
  #ctx;
42
+ /** Project access grants (share by email). */
43
+ permissions;
10
44
  constructor(ctx) {
11
45
  this.#ctx = ctx;
46
+ this.permissions = new Permissions(ctx);
12
47
  }
13
48
  /**
14
49
  * List projects (cursor-paginated). Returns a lazy list — `await .all()`, `.page()`,
@@ -80,6 +115,13 @@ var Projects = class {
80
115
  throwOnError: false
81
116
  }), (data) => data.project);
82
117
  }
118
+ recover(id, opts) {
119
+ return this.#ctx.run(opts, (client) => recoverProject({
120
+ client,
121
+ path: { project_id: id },
122
+ throwOnError: false
123
+ }), (data) => data.project);
124
+ }
83
125
  async transfer(input, opts) {
84
126
  const shouldThrow = opts?.throwOnError ?? this.#ctx.defaults.throwOnError;
85
127
  const fromOrgId = input.fromOrgId ?? this.#ctx.defaults.orgId;
@@ -106,6 +148,6 @@ var Projects = class {
106
148
  }
107
149
  };
108
150
  //#endregion
109
- export { Projects };
151
+ export { Permissions, Projects };
110
152
 
111
153
  //# sourceMappingURL=projects.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"projects.js","names":["#ctx"],"sources":["../../../src/neon/resources/projects.ts"],"sourcesContent":["import {\n\tcreateProject,\n\tdeleteProject,\n\tgetProject,\n\tlistProjects,\n\ttransferProjectsFromOrgToOrg,\n\ttransferProjectsFromUserToOrg,\n\tupdateProject,\n} from \"../../client/sdk.gen.js\";\nimport type {\n\tListProjectsData,\n\tProject,\n\tProjectCreateRequest,\n\tProjectListItem,\n\tProjectUpdateRequest,\n} from \"../../client/types.gen.js\";\nimport { withConnectionString } from \"../connection.js\";\nimport type { CallOptions, RequestContext } from \"../context.js\";\nimport { NeonError } from \"../errors.js\";\nimport { type Paginated, paginate } from \"../paginate.js\";\nimport { err, finalize, type NeonResult, type Outcome } from \"../result.js\";\n\n/** Input for {@link Projects.transfer} (org → org). */\nexport interface TransferProjectsInput {\n\t/** Source org. Defaults to the client's `orgId`. */\n\tfromOrgId?: string;\n\t/** Destination org. */\n\ttoOrgId: string;\n\tprojectIds: string[];\n}\n\ntype ListQuery = Omit<NonNullable<ListProjectsData[\"query\"]>, \"cursor\">;\ntype CreateInput = ProjectCreateRequest[\"project\"];\ntype UpdateInput = ProjectUpdateRequest[\"project\"];\n\n/** Per-call options for the connect workflow. */\ninterface WorkflowOptions<Throw extends boolean> extends CallOptions<Throw> {\n\t/** Return a pooled connection string (default `true`). */\n\tpooled?: boolean;\n}\n\n/** A project with a ready-to-use connection string to its default branch. */\nexport interface ProjectConnection {\n\tproject: Project;\n\tconnectionString: string;\n}\n\n/** Project resource — one API call per method (`list` is cursor-paginated). */\nexport class Projects<DThrow extends boolean> {\n\treadonly #ctx: RequestContext;\n\n\tconstructor(ctx: RequestContext) {\n\t\tthis.#ctx = ctx;\n\t}\n\n\t/**\n\t * List projects (cursor-paginated). Returns a lazy list — `await .all()`, `.page()`,\n\t * or `for await (… of …)`.\n\t *\n\t * @apiCall GET /projects\n\t */\n\tlist(query?: ListQuery): Paginated<ProjectListItem> {\n\t\treturn paginate(\n\t\t\t(cursor, signal) =>\n\t\t\t\tlistProjects({\n\t\t\t\t\tclient: this.#ctx.client,\n\t\t\t\t\tquery: {\n\t\t\t\t\t\torg_id: this.#ctx.defaults.orgId,\n\t\t\t\t\t\t...query,\n\t\t\t\t\t\tcursor,\n\t\t\t\t\t},\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t\tsignal,\n\t\t\t\t}),\n\t\t\t(data) => ({\n\t\t\t\titems: data?.projects ?? [],\n\t\t\t\tcursor: data?.pagination?.cursor,\n\t\t\t}),\n\t\t);\n\t}\n\n\t/** @apiCall GET /projects/{project_id} */\n\tget(id: string): Promise<Outcome<Project, DThrow>>;\n\tget<Throw extends boolean = DThrow>(\n\t\tid: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Project, Throw>>;\n\tget(\n\t\tid: string,\n\t\topts?: CallOptions,\n\t): Promise<Project | NeonResult<Project>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tgetProject({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: id },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.project,\n\t\t);\n\t}\n\n\t/** @apiCall POST /projects */\n\tcreate(input?: CreateInput): Promise<Outcome<Project, DThrow>>;\n\tcreate<Throw extends boolean = DThrow>(\n\t\tinput: CreateInput | undefined,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Project, Throw>>;\n\tcreate(\n\t\tinput?: CreateInput,\n\t\topts?: CallOptions,\n\t): Promise<Project | NeonResult<Project>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tcreateProject({\n\t\t\t\t\tclient,\n\t\t\t\t\tbody: {\n\t\t\t\t\t\tproject: {\n\t\t\t\t\t\t\t...(this.#ctx.defaults.orgId\n\t\t\t\t\t\t\t\t? { org_id: this.#ctx.defaults.orgId }\n\t\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t\t\t...input,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.project,\n\t\t);\n\t}\n\n\t/**\n\t * Create a project and return a ready-to-use connection string to its default branch.\n\t * One API call plus readiness polling (the create response already carries the\n\t * connection URI).\n\t *\n\t * @workflow createProject + waitForReadiness\n\t */\n\tcreateAndConnect(\n\t\tinput?: CreateInput,\n\t): Promise<Outcome<ProjectConnection, DThrow>>;\n\tcreateAndConnect<Throw extends boolean = DThrow>(\n\t\tinput: CreateInput | undefined,\n\t\topts: WorkflowOptions<Throw>,\n\t): Promise<Outcome<ProjectConnection, Throw>>;\n\tasync createAndConnect(\n\t\tinput?: CreateInput,\n\t\topts?: WorkflowOptions<boolean>,\n\t): Promise<ProjectConnection | NeonResult<ProjectConnection>> {\n\t\tconst shouldThrow =\n\t\t\topts?.throwOnError ?? this.#ctx.defaults.throwOnError;\n\t\tconst result = await this.#ctx.execute(\n\t\t\t{ ...opts, waitForReadiness: opts?.waitForReadiness ?? true },\n\t\t\t(client) =>\n\t\t\t\tcreateProject({\n\t\t\t\t\tclient,\n\t\t\t\t\tbody: {\n\t\t\t\t\t\tproject: {\n\t\t\t\t\t\t\t...(this.#ctx.defaults.orgId\n\t\t\t\t\t\t\t\t? { org_id: this.#ctx.defaults.orgId }\n\t\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t\t\t...input,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data,\n\t\t);\n\t\tconst out = withConnectionString(\n\t\t\tresult,\n\t\t\t(data) => data.connection_uris,\n\t\t\t(data, connectionString) => ({\n\t\t\t\tproject: data.project,\n\t\t\t\tconnectionString,\n\t\t\t}),\n\t\t\topts?.pooled ?? true,\n\t\t);\n\t\treturn finalize(out, shouldThrow);\n\t}\n\n\t/** @apiCall PATCH /projects/{project_id} */\n\tupdate(id: string, input: UpdateInput): Promise<Outcome<Project, DThrow>>;\n\tupdate<Throw extends boolean = DThrow>(\n\t\tid: string,\n\t\tinput: UpdateInput,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Project, Throw>>;\n\tupdate(\n\t\tid: string,\n\t\tinput: UpdateInput,\n\t\topts?: CallOptions,\n\t): Promise<Project | NeonResult<Project>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tupdateProject({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: id },\n\t\t\t\t\tbody: { project: input },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.project,\n\t\t);\n\t}\n\n\t/** @apiCall DELETE /projects/{project_id} */\n\tdelete(id: string): Promise<Outcome<Project, DThrow>>;\n\tdelete<Throw extends boolean = DThrow>(\n\t\tid: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Project, Throw>>;\n\tdelete(\n\t\tid: string,\n\t\topts?: CallOptions,\n\t): Promise<Project | NeonResult<Project>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tdeleteProject({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: id },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.project,\n\t\t);\n\t}\n\n\t/**\n\t * Transfer projects from one organization to another (e.g. sponsored → paid). The\n\t * source org defaults to the client's `orgId`. Requires a key with access to both orgs.\n\t *\n\t * @apiCall POST /organizations/{source_org_id}/projects/transfer\n\t */\n\ttransfer(input: TransferProjectsInput): Promise<Outcome<void, DThrow>>;\n\ttransfer<Throw extends boolean = DThrow>(\n\t\tinput: TransferProjectsInput,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<void, Throw>>;\n\tasync transfer(\n\t\tinput: TransferProjectsInput,\n\t\topts?: CallOptions,\n\t): Promise<void | NeonResult<void>> {\n\t\tconst shouldThrow =\n\t\t\topts?.throwOnError ?? this.#ctx.defaults.throwOnError;\n\t\tconst fromOrgId = input.fromOrgId ?? this.#ctx.defaults.orgId;\n\t\tif (!fromOrgId) {\n\t\t\treturn finalize(\n\t\t\t\terr<void>(\n\t\t\t\t\tnew NeonError(\n\t\t\t\t\t\t\"Pass fromOrgId or set orgId on the client.\",\n\t\t\t\t\t\t\"client\",\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tshouldThrow,\n\t\t\t);\n\t\t}\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\ttransferProjectsFromOrgToOrg({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { source_org_id: fromOrgId },\n\t\t\t\t\tbody: {\n\t\t\t\t\t\tdestination_org_id: input.toOrgId,\n\t\t\t\t\t\tproject_ids: input.projectIds,\n\t\t\t\t\t},\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t() => undefined,\n\t\t);\n\t}\n\n\t/**\n\t * Transfer projects from the personal account to an organization.\n\t *\n\t * @apiCall POST /users/me/projects/transfer\n\t */\n\ttransferFromUser(input: {\n\t\ttoOrgId: string;\n\t\tprojectIds: string[];\n\t}): Promise<Outcome<void, DThrow>>;\n\ttransferFromUser<Throw extends boolean = DThrow>(\n\t\tinput: { toOrgId: string; projectIds: string[] },\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<void, Throw>>;\n\ttransferFromUser(\n\t\tinput: { toOrgId: string; projectIds: string[] },\n\t\topts?: CallOptions,\n\t): Promise<void | NeonResult<void>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\ttransferProjectsFromUserToOrg({\n\t\t\t\t\tclient,\n\t\t\t\t\tbody: {\n\t\t\t\t\t\tdestination_org_id: input.toOrgId,\n\t\t\t\t\t\tproject_ids: input.projectIds,\n\t\t\t\t\t},\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t() => undefined,\n\t\t);\n\t}\n}\n"],"mappings":";;;;;;;AAgDA,IAAa,WAAb,MAA8C;CAC7C;CAEA,YAAY,KAAqB;EAChC,KAAKA,OAAO;CACb;;;;;;;CAQA,KAAK,OAA+C;EACnD,OAAO,UACL,QAAQ,WACR,aAAa;GACZ,QAAQ,KAAKA,KAAK;GAClB,OAAO;IACN,QAAQ,KAAKA,KAAK,SAAS;IAC3B,GAAG;IACH;GACD;GACA,cAAc;GACd;EACD,CAAC,IACD,UAAU;GACV,OAAO,MAAM,YAAY,CAAC;GAC1B,QAAQ,MAAM,YAAY;EAC3B,EACD;CACD;CAQA,IACC,IACA,MACyC;EACzC,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,WAAW;GACV;GACA,MAAM,EAAE,YAAY,GAAG;GACvB,cAAc;EACf,CAAC,IACD,SAAS,KAAK,OAChB;CACD;CAQA,OACC,OACA,MACyC;EACzC,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,cAAc;GACb;GACA,MAAM,EACL,SAAS;IACR,GAAI,KAAKA,KAAK,SAAS,QACpB,EAAE,QAAQ,KAAKA,KAAK,SAAS,MAAM,IACnC,CAAC;IACJ,GAAG;GACJ,EACD;GACA,cAAc;EACf,CAAC,IACD,SAAS,KAAK,OAChB;CACD;CAgBA,MAAM,iBACL,OACA,MAC6D;EAC7D,MAAM,cACL,MAAM,gBAAgB,KAAKA,KAAK,SAAS;EA2B1C,OAAO,SATK,qBACX,MAlBoB,KAAKA,KAAK,QAC9B;GAAE,GAAG;GAAM,kBAAkB,MAAM,oBAAoB;EAAK,IAC3D,WACA,cAAc;GACb;GACA,MAAM,EACL,SAAS;IACR,GAAI,KAAKA,KAAK,SAAS,QACpB,EAAE,QAAQ,KAAKA,KAAK,SAAS,MAAM,IACnC,CAAC;IACJ,GAAG;GACJ,EACD;GACA,cAAc;EACf,CAAC,IACD,SAAS,IACX,IAGE,SAAS,KAAK,kBACd,MAAM,sBAAsB;GAC5B,SAAS,KAAK;GACd;EACD,IACA,MAAM,UAAU,IAEC,GAAG,WAAW;CACjC;CASA,OACC,IACA,OACA,MACyC;EACzC,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,cAAc;GACb;GACA,MAAM,EAAE,YAAY,GAAG;GACvB,MAAM,EAAE,SAAS,MAAM;GACvB,cAAc;EACf,CAAC,IACD,SAAS,KAAK,OAChB;CACD;CAQA,OACC,IACA,MACyC;EACzC,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,cAAc;GACb;GACA,MAAM,EAAE,YAAY,GAAG;GACvB,cAAc;EACf,CAAC,IACD,SAAS,KAAK,OAChB;CACD;CAaA,MAAM,SACL,OACA,MACmC;EACnC,MAAM,cACL,MAAM,gBAAgB,KAAKA,KAAK,SAAS;EAC1C,MAAM,YAAY,MAAM,aAAa,KAAKA,KAAK,SAAS;EACxD,IAAI,CAAC,WACJ,OAAO,SACN,IACC,IAAI,UACH,8CACA,QACD,CACD,GACA,WACD;EAED,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,6BAA6B;GAC5B;GACA,MAAM,EAAE,eAAe,UAAU;GACjC,MAAM;IACL,oBAAoB,MAAM;IAC1B,aAAa,MAAM;GACpB;GACA,cAAc;EACf,CAAC,SACI,KAAA,CACP;CACD;CAeA,iBACC,OACA,MACmC;EACnC,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,8BAA8B;GAC7B;GACA,MAAM;IACL,oBAAoB,MAAM;IAC1B,aAAa,MAAM;GACpB;GACA,cAAc;EACf,CAAC,SACI,KAAA,CACP;CACD;AACD"}
1
+ {"version":3,"file":"projects.js","names":["#ctx"],"sources":["../../../src/neon/resources/projects.ts"],"sourcesContent":["import {\n\tcreateProject,\n\tdeleteProject,\n\tgetProject,\n\tgrantPermissionToProject,\n\tlistProjectPermissions,\n\tlistProjects,\n\trecoverProject,\n\trevokePermissionFromProject,\n\ttransferProjectsFromOrgToOrg,\n\ttransferProjectsFromUserToOrg,\n\tupdateProject,\n} from \"../../client/sdk.gen.js\";\nimport type {\n\tListProjectsData,\n\tProject,\n\tProjectCreateRequest,\n\tProjectListItem,\n\tProjectPermission,\n\tProjectUpdateRequest,\n} from \"../../client/types.gen.js\";\nimport { withConnectionString } from \"../connection.js\";\nimport type { CallOptions, RequestContext } from \"../context.js\";\nimport { NeonError } from \"../errors.js\";\nimport { type Paginated, paginate } from \"../paginate.js\";\nimport { err, finalize, type NeonResult, type Outcome } from \"../result.js\";\n\n/** Input for {@link Projects.transfer} (org → org). */\nexport interface TransferProjectsInput {\n\t/** Source org. Defaults to the client's `orgId`. */\n\tfromOrgId?: string;\n\t/** Destination org. */\n\ttoOrgId: string;\n\tprojectIds: string[];\n}\n\ntype ListQuery = Omit<NonNullable<ListProjectsData[\"query\"]>, \"cursor\">;\ntype CreateInput = ProjectCreateRequest[\"project\"];\ntype UpdateInput = ProjectUpdateRequest[\"project\"];\n\n/** Per-call options for the connect workflow. */\ninterface WorkflowOptions<Throw extends boolean> extends CallOptions<Throw> {\n\t/** Return a pooled connection string (default `true`). */\n\tpooled?: boolean;\n}\n\n/** A project with a ready-to-use connection string to its default branch. */\nexport interface ProjectConnection {\n\tproject: Project;\n\tconnectionString: string;\n}\n\n/** Project access grants (share a project with additional users by email). */\nexport class Permissions<DThrow extends boolean> {\n\treadonly #ctx: RequestContext;\n\n\tconstructor(ctx: RequestContext) {\n\t\tthis.#ctx = ctx;\n\t}\n\n\t/** @apiCall GET /projects/{project_id}/permissions */\n\tlist(projectId: string): Promise<Outcome<ProjectPermission[], DThrow>>;\n\tlist<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<ProjectPermission[], Throw>>;\n\tlist(\n\t\tprojectId: string,\n\t\topts?: CallOptions,\n\t): Promise<ProjectPermission[] | NeonResult<ProjectPermission[]>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tlistProjectPermissions({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.project_permissions,\n\t\t);\n\t}\n\n\t/** @apiCall POST /projects/{project_id}/permissions */\n\tgrant(\n\t\tprojectId: string,\n\t\temail: string,\n\t): Promise<Outcome<ProjectPermission, DThrow>>;\n\tgrant<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\temail: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<ProjectPermission, Throw>>;\n\tgrant(\n\t\tprojectId: string,\n\t\temail: string,\n\t\topts?: CallOptions,\n\t): Promise<ProjectPermission | NeonResult<ProjectPermission>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tgrantPermissionToProject({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId },\n\t\t\t\t\tbody: { email },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data,\n\t\t);\n\t}\n\n\t/** @apiCall DELETE /projects/{project_id}/permissions/{permission_id} */\n\trevoke(\n\t\tprojectId: string,\n\t\tpermissionId: string,\n\t): Promise<Outcome<ProjectPermission, DThrow>>;\n\trevoke<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tpermissionId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<ProjectPermission, Throw>>;\n\trevoke(\n\t\tprojectId: string,\n\t\tpermissionId: string,\n\t\topts?: CallOptions,\n\t): Promise<ProjectPermission | NeonResult<ProjectPermission>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\trevokePermissionFromProject({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: {\n\t\t\t\t\t\tproject_id: projectId,\n\t\t\t\t\t\tpermission_id: permissionId,\n\t\t\t\t\t},\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data,\n\t\t);\n\t}\n}\n\n/** Project resource — one API call per method (`list` is cursor-paginated). */\nexport class Projects<DThrow extends boolean> {\n\treadonly #ctx: RequestContext;\n\t/** Project access grants (share by email). */\n\treadonly permissions: Permissions<DThrow>;\n\n\tconstructor(ctx: RequestContext) {\n\t\tthis.#ctx = ctx;\n\t\tthis.permissions = new Permissions<DThrow>(ctx);\n\t}\n\n\t/**\n\t * List projects (cursor-paginated). Returns a lazy list — `await .all()`, `.page()`,\n\t * or `for await (… of …)`.\n\t *\n\t * @apiCall GET /projects\n\t */\n\tlist(query?: ListQuery): Paginated<ProjectListItem> {\n\t\treturn paginate(\n\t\t\t(cursor, signal) =>\n\t\t\t\tlistProjects({\n\t\t\t\t\tclient: this.#ctx.client,\n\t\t\t\t\tquery: {\n\t\t\t\t\t\torg_id: this.#ctx.defaults.orgId,\n\t\t\t\t\t\t...query,\n\t\t\t\t\t\tcursor,\n\t\t\t\t\t},\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t\tsignal,\n\t\t\t\t}),\n\t\t\t(data) => ({\n\t\t\t\titems: data?.projects ?? [],\n\t\t\t\tcursor: data?.pagination?.cursor,\n\t\t\t}),\n\t\t);\n\t}\n\n\t/** @apiCall GET /projects/{project_id} */\n\tget(id: string): Promise<Outcome<Project, DThrow>>;\n\tget<Throw extends boolean = DThrow>(\n\t\tid: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Project, Throw>>;\n\tget(\n\t\tid: string,\n\t\topts?: CallOptions,\n\t): Promise<Project | NeonResult<Project>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tgetProject({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: id },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.project,\n\t\t);\n\t}\n\n\t/** @apiCall POST /projects */\n\tcreate(input?: CreateInput): Promise<Outcome<Project, DThrow>>;\n\tcreate<Throw extends boolean = DThrow>(\n\t\tinput: CreateInput | undefined,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Project, Throw>>;\n\tcreate(\n\t\tinput?: CreateInput,\n\t\topts?: CallOptions,\n\t): Promise<Project | NeonResult<Project>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tcreateProject({\n\t\t\t\t\tclient,\n\t\t\t\t\tbody: {\n\t\t\t\t\t\tproject: {\n\t\t\t\t\t\t\t...(this.#ctx.defaults.orgId\n\t\t\t\t\t\t\t\t? { org_id: this.#ctx.defaults.orgId }\n\t\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t\t\t...input,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.project,\n\t\t);\n\t}\n\n\t/**\n\t * Create a project and return a ready-to-use connection string to its default branch.\n\t * One API call plus readiness polling (the create response already carries the\n\t * connection URI).\n\t *\n\t * @workflow createProject + waitForReadiness\n\t */\n\tcreateAndConnect(\n\t\tinput?: CreateInput,\n\t): Promise<Outcome<ProjectConnection, DThrow>>;\n\tcreateAndConnect<Throw extends boolean = DThrow>(\n\t\tinput: CreateInput | undefined,\n\t\topts: WorkflowOptions<Throw>,\n\t): Promise<Outcome<ProjectConnection, Throw>>;\n\tasync createAndConnect(\n\t\tinput?: CreateInput,\n\t\topts?: WorkflowOptions<boolean>,\n\t): Promise<ProjectConnection | NeonResult<ProjectConnection>> {\n\t\tconst shouldThrow =\n\t\t\topts?.throwOnError ?? this.#ctx.defaults.throwOnError;\n\t\tconst result = await this.#ctx.execute(\n\t\t\t{ ...opts, waitForReadiness: opts?.waitForReadiness ?? true },\n\t\t\t(client) =>\n\t\t\t\tcreateProject({\n\t\t\t\t\tclient,\n\t\t\t\t\tbody: {\n\t\t\t\t\t\tproject: {\n\t\t\t\t\t\t\t...(this.#ctx.defaults.orgId\n\t\t\t\t\t\t\t\t? { org_id: this.#ctx.defaults.orgId }\n\t\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t\t\t...input,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data,\n\t\t);\n\t\tconst out = withConnectionString(\n\t\t\tresult,\n\t\t\t(data) => data.connection_uris,\n\t\t\t(data, connectionString) => ({\n\t\t\t\tproject: data.project,\n\t\t\t\tconnectionString,\n\t\t\t}),\n\t\t\topts?.pooled ?? true,\n\t\t);\n\t\treturn finalize(out, shouldThrow);\n\t}\n\n\t/** @apiCall PATCH /projects/{project_id} */\n\tupdate(id: string, input: UpdateInput): Promise<Outcome<Project, DThrow>>;\n\tupdate<Throw extends boolean = DThrow>(\n\t\tid: string,\n\t\tinput: UpdateInput,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Project, Throw>>;\n\tupdate(\n\t\tid: string,\n\t\tinput: UpdateInput,\n\t\topts?: CallOptions,\n\t): Promise<Project | NeonResult<Project>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tupdateProject({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: id },\n\t\t\t\t\tbody: { project: input },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.project,\n\t\t);\n\t}\n\n\t/** @apiCall DELETE /projects/{project_id} */\n\tdelete(id: string): Promise<Outcome<Project, DThrow>>;\n\tdelete<Throw extends boolean = DThrow>(\n\t\tid: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Project, Throw>>;\n\tdelete(\n\t\tid: string,\n\t\topts?: CallOptions,\n\t): Promise<Project | NeonResult<Project>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tdeleteProject({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: id },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.project,\n\t\t);\n\t}\n\n\t/**\n\t * Recover a soft-deleted project within its retention window (beta). Mirrors\n\t * `branches.recover` at the project level.\n\t *\n\t * @apiCall POST /projects/{project_id}/recover\n\t */\n\trecover(id: string): Promise<Outcome<Project, DThrow>>;\n\trecover<Throw extends boolean = DThrow>(\n\t\tid: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Project, Throw>>;\n\trecover(\n\t\tid: string,\n\t\topts?: CallOptions,\n\t): Promise<Project | NeonResult<Project>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\trecoverProject({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: id },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.project,\n\t\t);\n\t}\n\n\t/**\n\t * Transfer projects from one organization to another (e.g. sponsored → paid). The\n\t * source org defaults to the client's `orgId`. Requires a key with access to both orgs.\n\t *\n\t * @apiCall POST /organizations/{source_org_id}/projects/transfer\n\t */\n\ttransfer(input: TransferProjectsInput): Promise<Outcome<void, DThrow>>;\n\ttransfer<Throw extends boolean = DThrow>(\n\t\tinput: TransferProjectsInput,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<void, Throw>>;\n\tasync transfer(\n\t\tinput: TransferProjectsInput,\n\t\topts?: CallOptions,\n\t): Promise<void | NeonResult<void>> {\n\t\tconst shouldThrow =\n\t\t\topts?.throwOnError ?? this.#ctx.defaults.throwOnError;\n\t\tconst fromOrgId = input.fromOrgId ?? this.#ctx.defaults.orgId;\n\t\tif (!fromOrgId) {\n\t\t\treturn finalize(\n\t\t\t\terr<void>(\n\t\t\t\t\tnew NeonError(\n\t\t\t\t\t\t\"Pass fromOrgId or set orgId on the client.\",\n\t\t\t\t\t\t\"client\",\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tshouldThrow,\n\t\t\t);\n\t\t}\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\ttransferProjectsFromOrgToOrg({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { source_org_id: fromOrgId },\n\t\t\t\t\tbody: {\n\t\t\t\t\t\tdestination_org_id: input.toOrgId,\n\t\t\t\t\t\tproject_ids: input.projectIds,\n\t\t\t\t\t},\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t() => undefined,\n\t\t);\n\t}\n\n\t/**\n\t * Transfer projects from the personal account to an organization.\n\t *\n\t * @apiCall POST /users/me/projects/transfer\n\t */\n\ttransferFromUser(input: {\n\t\ttoOrgId: string;\n\t\tprojectIds: string[];\n\t}): Promise<Outcome<void, DThrow>>;\n\ttransferFromUser<Throw extends boolean = DThrow>(\n\t\tinput: { toOrgId: string; projectIds: string[] },\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<void, Throw>>;\n\ttransferFromUser(\n\t\tinput: { toOrgId: string; projectIds: string[] },\n\t\topts?: CallOptions,\n\t): Promise<void | NeonResult<void>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\ttransferProjectsFromUserToOrg({\n\t\t\t\t\tclient,\n\t\t\t\t\tbody: {\n\t\t\t\t\t\tdestination_org_id: input.toOrgId,\n\t\t\t\t\t\tproject_ids: input.projectIds,\n\t\t\t\t\t},\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t() => undefined,\n\t\t);\n\t}\n}\n"],"mappings":";;;;;;;AAqDA,IAAa,cAAb,MAAiD;CAChD;CAEA,YAAY,KAAqB;EAChC,KAAKA,OAAO;CACb;CAQA,KACC,WACA,MACiE;EACjE,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,uBAAuB;GACtB;GACA,MAAM,EAAE,YAAY,UAAU;GAC9B,cAAc;EACf,CAAC,IACD,SAAS,K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