@neon/sdk 0.1.0 → 1.0.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.
- package/README.md +133 -5
- package/dist/_virtual/_rolldown/runtime.js +2 -1
- package/dist/client/core/pathSerializer.gen.d.ts.map +1 -1
- package/dist/client/index.d.ts +3 -3
- package/dist/client/index.js +2 -2
- package/dist/client/raw.gen.d.ts +4282 -0
- package/dist/client/raw.gen.d.ts.map +1 -0
- package/dist/client/raw.gen.js +170 -0
- package/dist/client/raw.gen.js.map +1 -0
- package/dist/client/sdk.gen.d.ts +252 -2
- package/dist/client/sdk.gen.d.ts.map +1 -1
- package/dist/client/sdk.gen.js +634 -1
- package/dist/client/sdk.gen.js.map +1 -1
- package/dist/client/types.gen.d.ts +2602 -1530
- package/dist/client/types.gen.d.ts.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/neon/client.d.ts +10 -0
- package/dist/neon/client.d.ts.map +1 -1
- package/dist/neon/client.js +10 -0
- package/dist/neon/client.js.map +1 -1
- package/dist/neon/client.test-d.d.ts +1 -0
- package/dist/neon/client.test-d.js +93 -0
- package/dist/neon/client.test-d.js.map +1 -0
- package/dist/neon/coverage.d.ts.map +1 -1
- package/dist/neon/coverage.js +57 -0
- package/dist/neon/coverage.js.map +1 -1
- package/dist/neon/raw-wrap.d.ts +63 -0
- package/dist/neon/raw-wrap.d.ts.map +1 -0
- package/dist/neon/raw-wrap.js +47 -0
- package/dist/neon/raw-wrap.js.map +1 -0
- package/dist/neon/resources/ai-gateway.d.ts +16 -0
- package/dist/neon/resources/ai-gateway.d.ts.map +1 -0
- package/dist/neon/resources/ai-gateway.js +23 -0
- package/dist/neon/resources/ai-gateway.js.map +1 -0
- package/dist/neon/resources/auth.d.ts +81 -0
- package/dist/neon/resources/auth.d.ts.map +1 -0
- package/dist/neon/resources/auth.js +197 -0
- package/dist/neon/resources/auth.js.map +1 -0
- package/dist/neon/resources/branches.d.ts +7 -0
- package/dist/neon/resources/branches.d.ts.map +1 -1
- package/dist/neon/resources/branches.js +11 -1
- package/dist/neon/resources/branches.js.map +1 -1
- package/dist/neon/resources/bucket-objects.d.ts +33 -0
- package/dist/neon/resources/bucket-objects.d.ts.map +1 -0
- package/dist/neon/resources/bucket-objects.js +74 -0
- package/dist/neon/resources/bucket-objects.js.map +1 -0
- package/dist/neon/resources/buckets.d.ts +23 -0
- package/dist/neon/resources/buckets.d.ts.map +1 -0
- package/dist/neon/resources/buckets.js +45 -0
- package/dist/neon/resources/buckets.js.map +1 -0
- package/dist/neon/resources/credentials.d.ts +23 -0
- package/dist/neon/resources/credentials.d.ts.map +1 -0
- package/dist/neon/resources/credentials.js +45 -0
- package/dist/neon/resources/credentials.js.map +1 -0
- package/dist/neon/resources/endpoints.d.ts +3 -0
- package/dist/neon/resources/endpoints.d.ts.map +1 -1
- package/dist/neon/resources/endpoints.js +11 -1
- package/dist/neon/resources/endpoints.js.map +1 -1
- package/dist/neon/resources/functions.d.ts +30 -0
- package/dist/neon/resources/functions.d.ts.map +1 -0
- package/dist/neon/resources/functions.js +79 -0
- package/dist/neon/resources/functions.js.map +1 -0
- package/dist/neon/resources/postgres.d.ts +1 -1
- package/dist/neon/resources/postgres.js.map +1 -1
- package/dist/neon/resources/projects.d.ts +26 -2
- package/dist/neon/resources/projects.d.ts.map +1 -1
- package/dist/neon/resources/projects.js +44 -2
- package/dist/neon/resources/projects.js.map +1 -1
- package/dist/neon/resources/storage.d.ts +24 -0
- package/dist/neon/resources/storage.d.ts.map +1 -0
- package/dist/neon/resources/storage.js +32 -0
- package/dist/neon/resources/storage.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_pretty-format@3.0.9/node_modules/@vitest/pretty-format/dist/index.js +879 -0
- package/dist/node_modules/.pnpm/@vitest_pretty-format@3.0.9/node_modules/@vitest/pretty-format/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_runner@3.0.9/node_modules/@vitest/runner/dist/chunk-tasks.js +30 -0
- package/dist/node_modules/.pnpm/@vitest_runner@3.0.9/node_modules/@vitest/runner/dist/chunk-tasks.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_runner@3.0.9/node_modules/@vitest/runner/dist/index.js +579 -0
- package/dist/node_modules/.pnpm/@vitest_runner@3.0.9/node_modules/@vitest/runner/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +92 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/helpers.js +43 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/helpers.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/index.js +450 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/source-map.js +168 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/source-map.js.map +1 -0
- package/dist/node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/branding.js +10 -0
- package/dist/node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/branding.js.map +1 -0
- package/dist/node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/index.js +109 -0
- package/dist/node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/messages.js +10 -0
- package/dist/node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/messages.js.map +1 -0
- package/dist/node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/overloads.js +10 -0
- package/dist/node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/overloads.js.map +1 -0
- package/dist/node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/utils.js +10 -0
- package/dist/node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/utils.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js +11 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js +16 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js +11 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js +15 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js +13 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js +34 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js +12 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js +122 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js +39 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js +99 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js +25 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js +14 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js +21 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js +6 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js +12 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js +18 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js +24 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js +9 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js +30 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js.map +1 -0
- package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +82 -0
- package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js.map +1 -0
- package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/node.js +7 -0
- package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/node.js.map +1 -0
- 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
- 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
- package/dist/raw.d.ts +4 -3
- package/dist/raw.js +24 -3
- package/dist/raw.js.map +1 -1
- package/package.json +4 -3
|
@@ -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.d.ts","names":[],"sources":["../../../src/neon/resources/endpoints.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"endpoints.d.ts","names":[],"sources":["../../../src/neon/resources/endpoints.ts"],"mappings":";;;;;KAmBK,WAAA,GAAc;KACd,WAAA,GAAc;AAHqC;AAGnD,cAGQ,SAHG,CAAG,eAAA,OAAqB,CAAA,CAAA;EAG3B,CAAA,OAAA;EAAS,WAAA,CAAA,GAAA,EAGJ,cAHI;;MAQoB,CAAA,SAAA,EAAA,MAAA,CAAA,EAAhB,OAAgB,CAAR,OAAQ,CAAA,QAAA,EAAA,EAAY,MAAZ,CAAA,CAAA;MAAY,CAAA,cAAA,OAAA,GACxB,MADwB,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,IAAA,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AAA;SAsBgB,CAAA,cAAA,OAAA,GA0Ia,MA1Ib,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,IAAA,EA6IZ,WA7IY,CA6IA,KA7IA,CAAA,CAAA,EA8IhB,OA9IgB,CA8IR,OA9IQ,CA8IA,QA9IA,EA8IU,KA9IV,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":";;;
|
|
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,m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
|
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,MAA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A,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"}
|
|
@@ -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 `@
|
|
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 `@
|
|
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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-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":";;;;;;;
|
|
1
|
+
{"version":3,"file":"projects.d.ts","names":[],"sources":["../../../src/neon/resources/projects.ts"],"mappings":";;;;;;;UA4BiB,qBAAA;EAAA;EAQZ,SAAA,CAAA,EAAS,MAAA;E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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
|