@neon/sdk 1.4.1 → 1.5.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 +64 -3
- package/dist/client/types.gen.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/neon/config.d.ts +13 -0
- package/dist/neon/config.d.ts.map +1 -1
- package/dist/neon/config.js +2 -0
- package/dist/neon/config.js.map +1 -1
- package/dist/neon/context.d.ts +26 -6
- package/dist/neon/context.d.ts.map +1 -1
- package/dist/neon/context.js +59 -10
- package/dist/neon/context.js.map +1 -1
- package/dist/neon/deadline.d.ts +81 -0
- package/dist/neon/deadline.d.ts.map +1 -0
- package/dist/neon/deadline.js +143 -0
- package/dist/neon/deadline.js.map +1 -0
- package/dist/neon/errors.d.ts +22 -3
- package/dist/neon/errors.d.ts.map +1 -1
- package/dist/neon/errors.js +22 -2
- package/dist/neon/errors.js.map +1 -1
- package/dist/neon/paginate.d.ts +6 -1
- package/dist/neon/paginate.d.ts.map +1 -1
- package/dist/neon/paginate.js +59 -24
- package/dist/neon/paginate.js.map +1 -1
- package/dist/neon/raw-wrap.d.ts.map +1 -1
- package/dist/neon/raw-wrap.js +17 -2
- package/dist/neon/raw-wrap.js.map +1 -1
- package/dist/neon/resources/account.d.ts.map +1 -1
- package/dist/neon/resources/account.js +18 -12
- package/dist/neon/resources/account.js.map +1 -1
- package/dist/neon/resources/ai-gateway.js +3 -2
- package/dist/neon/resources/ai-gateway.js.map +1 -1
- package/dist/neon/resources/auth.d.ts.map +1 -1
- package/dist/neon/resources/auth.js +42 -28
- package/dist/neon/resources/auth.js.map +1 -1
- package/dist/neon/resources/branches.d.ts +1 -1
- package/dist/neon/resources/branches.d.ts.map +1 -1
- package/dist/neon/resources/branches.js +29 -20
- package/dist/neon/resources/branches.js.map +1 -1
- package/dist/neon/resources/bucket-objects.d.ts.map +1 -1
- package/dist/neon/resources/bucket-objects.js +15 -10
- package/dist/neon/resources/bucket-objects.js.map +1 -1
- package/dist/neon/resources/buckets.d.ts.map +1 -1
- package/dist/neon/resources/buckets.js +9 -6
- package/dist/neon/resources/buckets.js.map +1 -1
- package/dist/neon/resources/consumption.d.ts +4 -4
- package/dist/neon/resources/consumption.d.ts.map +1 -1
- package/dist/neon/resources/consumption.js +6 -6
- package/dist/neon/resources/consumption.js.map +1 -1
- package/dist/neon/resources/credentials.d.ts.map +1 -1
- package/dist/neon/resources/credentials.js +9 -6
- package/dist/neon/resources/credentials.js.map +1 -1
- package/dist/neon/resources/dataapi.d.ts.map +1 -1
- package/dist/neon/resources/dataapi.js +12 -8
- package/dist/neon/resources/dataapi.js.map +1 -1
- package/dist/neon/resources/databases.d.ts.map +1 -1
- package/dist/neon/resources/databases.js +15 -10
- package/dist/neon/resources/databases.js.map +1 -1
- package/dist/neon/resources/endpoints.d.ts.map +1 -1
- package/dist/neon/resources/endpoints.js +27 -18
- package/dist/neon/resources/endpoints.js.map +1 -1
- package/dist/neon/resources/functions.d.ts +1 -1
- package/dist/neon/resources/functions.d.ts.map +1 -1
- package/dist/neon/resources/functions.js +14 -10
- package/dist/neon/resources/functions.js.map +1 -1
- package/dist/neon/resources/operations.d.ts +12 -3
- package/dist/neon/resources/operations.d.ts.map +1 -1
- package/dist/neon/resources/operations.js +5 -4
- package/dist/neon/resources/operations.js.map +1 -1
- package/dist/neon/resources/postgres.d.ts.map +1 -1
- package/dist/neon/resources/postgres.js +9 -1
- package/dist/neon/resources/postgres.js.map +1 -1
- package/dist/neon/resources/projects.d.ts +1 -1
- package/dist/neon/resources/projects.d.ts.map +1 -1
- package/dist/neon/resources/projects.js +35 -24
- package/dist/neon/resources/projects.js.map +1 -1
- package/dist/neon/resources/roles.d.ts.map +1 -1
- package/dist/neon/resources/roles.js +18 -12
- package/dist/neon/resources/roles.js.map +1 -1
- package/dist/neon/resources/snapshots.d.ts +10 -1
- package/dist/neon/resources/snapshots.d.ts.map +1 -1
- package/dist/neon/resources/snapshots.js +37 -19
- package/dist/neon/resources/snapshots.js.map +1 -1
- package/dist/neon/resources/storage.js +3 -2
- package/dist/neon/resources/storage.js.map +1 -1
- package/dist/neon/retry.d.ts +30 -8
- package/dist/neon/retry.d.ts.map +1 -1
- package/dist/neon/retry.js +59 -20
- package/dist/neon/retry.js.map +1 -1
- package/dist/neon/wait.d.ts +7 -1
- package/dist/neon/wait.d.ts.map +1 -1
- package/dist/neon/wait.js +53 -34
- package/dist/neon/wait.js.map +1 -1
- package/package.json +2 -1
|
@@ -7,18 +7,19 @@ var DataApi = class {
|
|
|
7
7
|
this.#ctx = ctx;
|
|
8
8
|
}
|
|
9
9
|
get(projectId, branchId, databaseName, opts) {
|
|
10
|
-
return this.#ctx.run(opts, (client) => getProjectBranchDataApi({
|
|
10
|
+
return this.#ctx.run(opts, (client, signal) => getProjectBranchDataApi({
|
|
11
11
|
client,
|
|
12
12
|
path: {
|
|
13
13
|
project_id: projectId,
|
|
14
14
|
branch_id: branchId,
|
|
15
15
|
database_name: databaseName
|
|
16
16
|
},
|
|
17
|
-
throwOnError: false
|
|
17
|
+
throwOnError: false,
|
|
18
|
+
signal
|
|
18
19
|
}), (data) => data);
|
|
19
20
|
}
|
|
20
21
|
create(projectId, branchId, databaseName, input, opts) {
|
|
21
|
-
return this.#ctx.run(opts, (client) => createProjectBranchDataApi({
|
|
22
|
+
return this.#ctx.run(opts, (client, signal) => createProjectBranchDataApi({
|
|
22
23
|
client,
|
|
23
24
|
path: {
|
|
24
25
|
project_id: projectId,
|
|
@@ -26,11 +27,12 @@ var DataApi = class {
|
|
|
26
27
|
database_name: databaseName
|
|
27
28
|
},
|
|
28
29
|
body: input,
|
|
29
|
-
throwOnError: false
|
|
30
|
+
throwOnError: false,
|
|
31
|
+
signal
|
|
30
32
|
}), (data) => data);
|
|
31
33
|
}
|
|
32
34
|
update(projectId, branchId, databaseName, input, opts) {
|
|
33
|
-
return this.#ctx.run(opts, (client) => updateProjectBranchDataApi({
|
|
35
|
+
return this.#ctx.run(opts, (client, signal) => updateProjectBranchDataApi({
|
|
34
36
|
client,
|
|
35
37
|
path: {
|
|
36
38
|
project_id: projectId,
|
|
@@ -38,18 +40,20 @@ var DataApi = class {
|
|
|
38
40
|
database_name: databaseName
|
|
39
41
|
},
|
|
40
42
|
body: input,
|
|
41
|
-
throwOnError: false
|
|
43
|
+
throwOnError: false,
|
|
44
|
+
signal
|
|
42
45
|
}), () => void 0);
|
|
43
46
|
}
|
|
44
47
|
delete(projectId, branchId, databaseName, opts) {
|
|
45
|
-
return this.#ctx.run(opts, (client) => deleteProjectBranchDataApi({
|
|
48
|
+
return this.#ctx.run(opts, (client, signal) => deleteProjectBranchDataApi({
|
|
46
49
|
client,
|
|
47
50
|
path: {
|
|
48
51
|
project_id: projectId,
|
|
49
52
|
branch_id: branchId,
|
|
50
53
|
database_name: databaseName
|
|
51
54
|
},
|
|
52
|
-
throwOnError: false
|
|
55
|
+
throwOnError: false,
|
|
56
|
+
signal
|
|
53
57
|
}), () => void 0);
|
|
54
58
|
}
|
|
55
59
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataapi.js","names":["#ctx"],"sources":["../../../src/neon/resources/dataapi.ts"],"sourcesContent":["import {\n\tcreateProjectBranchDataApi,\n\tdeleteProjectBranchDataApi,\n\tgetProjectBranchDataApi,\n\tupdateProjectBranchDataApi,\n} from \"../../client/sdk.gen.js\";\nimport type {\n\tDataApiCreateRequest,\n\tDataApiCreateResponse,\n\tDataApiReponse,\n\tDataApiUpdateRequest,\n} from \"../../client/types.gen.js\";\nimport type { CallOptions, RequestContext } from \"../context.js\";\nimport type { NeonResult, Outcome } from \"../result.js\";\n\n/** Neon Data API resource (branch + database scoped). */\nexport class DataApi<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}/data-api/{database_name} */\n\tget(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: string,\n\t): Promise<Outcome<DataApiReponse, DThrow>>;\n\tget<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<DataApiReponse, Throw>>;\n\tget(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: string,\n\t\topts?: CallOptions,\n\t): Promise<DataApiReponse | NeonResult<DataApiReponse>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tgetProjectBranchDataApi({\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\tdatabase_name: databaseName,\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\t/** @apiCall POST /projects/{project_id}/branches/{branch_id}/data-api/{database_name} */\n\tcreate(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: string,\n\t\tinput?: DataApiCreateRequest,\n\t): Promise<Outcome<DataApiCreateResponse, DThrow>>;\n\tcreate<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: string,\n\t\tinput: DataApiCreateRequest | undefined,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<DataApiCreateResponse, Throw>>;\n\tcreate(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: string,\n\t\tinput?: DataApiCreateRequest,\n\t\topts?: CallOptions,\n\t): Promise<DataApiCreateResponse | NeonResult<DataApiCreateResponse>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tcreateProjectBranchDataApi({\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\tdatabase_name: databaseName,\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,\n\t\t);\n\t}\n\n\t/** @apiCall PATCH /projects/{project_id}/branches/{branch_id}/data-api/{database_name} */\n\tupdate(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: string,\n\t\tinput?: DataApiUpdateRequest,\n\t): Promise<Outcome<void, DThrow>>;\n\tupdate<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: string,\n\t\tinput: DataApiUpdateRequest | undefined,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<void, Throw>>;\n\tupdate(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: string,\n\t\tinput?: DataApiUpdateRequest,\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\tupdateProjectBranchDataApi({\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\tdatabase_name: databaseName,\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() => undefined,\n\t\t);\n\t}\n\n\t/** @apiCall DELETE /projects/{project_id}/branches/{branch_id}/data-api/{database_name} */\n\tdelete(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: string,\n\t): Promise<Outcome<void, DThrow>>;\n\tdelete<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<void, Throw>>;\n\tdelete(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: 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\tdeleteProjectBranchDataApi({\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\tdatabase_name: databaseName,\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":";;;AAgBA,IAAa,UAAb,MAA6C;CAC5C;CAEA,YAAY,KAAqB;EAChC,KAAKA,OAAO;CACb;CAcA,IACC,WACA,UACA,cACA,MACuD;EACvD,OAAO,KAAKA,KAAK,IAChB,OACC,
|
|
1
|
+
{"version":3,"file":"dataapi.js","names":["#ctx"],"sources":["../../../src/neon/resources/dataapi.ts"],"sourcesContent":["import {\n\tcreateProjectBranchDataApi,\n\tdeleteProjectBranchDataApi,\n\tgetProjectBranchDataApi,\n\tupdateProjectBranchDataApi,\n} from \"../../client/sdk.gen.js\";\nimport type {\n\tDataApiCreateRequest,\n\tDataApiCreateResponse,\n\tDataApiReponse,\n\tDataApiUpdateRequest,\n} from \"../../client/types.gen.js\";\nimport type { CallOptions, RequestContext } from \"../context.js\";\nimport type { NeonResult, Outcome } from \"../result.js\";\n\n/** Neon Data API resource (branch + database scoped). */\nexport class DataApi<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}/data-api/{database_name} */\n\tget(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: string,\n\t): Promise<Outcome<DataApiReponse, DThrow>>;\n\tget<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<DataApiReponse, Throw>>;\n\tget(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: string,\n\t\topts?: CallOptions,\n\t): Promise<DataApiReponse | NeonResult<DataApiReponse>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client, signal) =>\n\t\t\t\tgetProjectBranchDataApi({\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\tdatabase_name: databaseName,\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) => data,\n\t\t);\n\t}\n\n\t/** @apiCall POST /projects/{project_id}/branches/{branch_id}/data-api/{database_name} */\n\tcreate(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: string,\n\t\tinput?: DataApiCreateRequest,\n\t): Promise<Outcome<DataApiCreateResponse, DThrow>>;\n\tcreate<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: string,\n\t\tinput: DataApiCreateRequest | undefined,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<DataApiCreateResponse, Throw>>;\n\tcreate(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: string,\n\t\tinput?: DataApiCreateRequest,\n\t\topts?: CallOptions,\n\t): Promise<DataApiCreateResponse | NeonResult<DataApiCreateResponse>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client, signal) =>\n\t\t\t\tcreateProjectBranchDataApi({\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\tdatabase_name: databaseName,\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\tsignal,\n\t\t\t\t}),\n\t\t\t(data) => data,\n\t\t);\n\t}\n\n\t/** @apiCall PATCH /projects/{project_id}/branches/{branch_id}/data-api/{database_name} */\n\tupdate(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: string,\n\t\tinput?: DataApiUpdateRequest,\n\t): Promise<Outcome<void, DThrow>>;\n\tupdate<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: string,\n\t\tinput: DataApiUpdateRequest | undefined,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<void, Throw>>;\n\tupdate(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: string,\n\t\tinput?: DataApiUpdateRequest,\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, signal) =>\n\t\t\t\tupdateProjectBranchDataApi({\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\tdatabase_name: databaseName,\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\tsignal,\n\t\t\t\t}),\n\t\t\t() => undefined,\n\t\t);\n\t}\n\n\t/** @apiCall DELETE /projects/{project_id}/branches/{branch_id}/data-api/{database_name} */\n\tdelete(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: string,\n\t): Promise<Outcome<void, DThrow>>;\n\tdelete<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<void, Throw>>;\n\tdelete(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tdatabaseName: 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, signal) =>\n\t\t\t\tdeleteProjectBranchDataApi({\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\tdatabase_name: databaseName,\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() => undefined,\n\t\t);\n\t}\n}\n"],"mappings":";;;AAgBA,IAAa,UAAb,MAA6C;CAC5C;CAEA,YAAY,KAAqB;EAChC,KAAKA,OAAO;CACb;CAcA,IACC,WACA,UACA,cACA,MACuD;EACvD,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,wBAAwB;GACvB;GACA,MAAM;IACL,YAAY;IACZ,WAAW;IACX,eAAe;GAChB;GACA,cAAc;GACd;EACD,CAAC,IACD,SAAS,IACX;CACD;CAgBA,OACC,WACA,UACA,cACA,OACA,MACqE;EACrE,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,2BAA2B;GAC1B;GACA,MAAM;IACL,YAAY;IACZ,WAAW;IACX,eAAe;GAChB;GACA,MAAM;GACN,cAAc;GACd;EACD,CAAC,IACD,SAAS,IACX;CACD;CAgBA,OACC,WACA,UACA,cACA,OACA,MACmC;EACnC,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,2BAA2B;GAC1B;GACA,MAAM;IACL,YAAY;IACZ,WAAW;IACX,eAAe;GAChB;GACA,MAAM;GACN,cAAc;GACd;EACD,CAAC,SACI,KAAA,CACP;CACD;CAcA,OACC,WACA,UACA,cACA,MACmC;EACnC,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,2BAA2B;GAC1B;GACA,MAAM;IACL,YAAY;IACZ,WAAW;IACX,eAAe;GAChB;GACA,cAAc;GACd;EACD,CAAC,SACI,KAAA,CACP;CACD;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"databases.d.ts","names":[],"sources":["../../../src/neon/resources/databases.ts"],"mappings":";;;;;KAeK,WAAA,GAAc;KACd,WAAA,GAAc;AAHqC;AAGnD,cAGQ,SAHG,CAAG,eAAA,OAAqB,CAAA,CAAA;EAG3B,CAAA,OAAA;EAAS,WAAA,CAAA,GAAA,EAGJ,cAHI;EAGJ;EAQE,IAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,CAAA,EAAhB,OAAgB,CAAR,OAAQ,CAAA,QAAA,EAAA,EAAY,MAAZ,CAAA,CAAA;EAAY,IAAA,CAAA,cAAA,OAAA,GACF,MADE,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAIxB,WAJwB,CAIZ,KAJY,CAAA,CAAA,EAK5B,OAL4B,CAKpB,OALoB,CAKZ,QALY,EAAA,EAKA,KALA,CAAA,CAAA;EAApB;EAAR,GAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"databases.d.ts","names":[],"sources":["../../../src/neon/resources/databases.ts"],"mappings":";;;;;KAeK,WAAA,GAAc;KACd,WAAA,GAAc;AAHqC;AAGnD,cAGQ,SAHG,CAAG,eAAA,OAAqB,CAAA,CAAA;EAG3B,CAAA,OAAA;EAAS,WAAA,CAAA,GAAA,EAGJ,cAHI;EAGJ;EAQE,IAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,CAAA,EAAhB,OAAgB,CAAR,OAAQ,CAAA,QAAA,EAAA,EAAY,MAAZ,CAAA,CAAA;EAAY,IAAA,CAAA,cAAA,OAAA,GACF,MADE,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAIxB,WAJwB,CAIZ,KAJY,CAAA,CAAA,EAK5B,OAL4B,CAKpB,OALoB,CAKZ,QALY,EAAA,EAKA,KALA,CAAA,CAAA;EAApB;EAAR,GAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,CAAA,EA6BA,OA7BA,CA6BQ,OA7BR,CA6BgB,QA7BhB,EA6B0B,MA7B1B,CAAA,CAAA;EAC0B,GAAA,CAAA,cAAA,OAAA,GA6BD,MA7BC,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAiCtB,WAjCsB,CAiCV,KAjCU,CAAA,CAAA,EAkC1B,OAlC0B,CAkClB,OAlCkB,CAkCV,QAlCU,EAkCA,KAlCA,CAAA,CAAA;EAGV;EAAZ,MAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,KAAA,EA2DC,WA3DD,CAAA,EA4DJ,OA5DI,CA4DI,OA5DJ,CA4DY,QA5DZ,EA4DsB,MA5DtB,CAAA,CAAA;EACY,MAAA,CAAA,cAAA,OAAA,GA4DY,MA5DZ,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,KAAA,EA+DX,WA/DW,EAAA,IAAA,EAgEZ,WAhEY,CAgEA,KAhEA,CAAA,CAAA,EAiEhB,OAjEgB,CAiER,OAjEQ,CAiEA,QAjEA,EAiEU,KAjEV,CAAA,CAAA;EAAY;EAApB,MAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,KAAA,EA2FH,WA3FG,CAAA,EA4FR,OA5FQ,CA4FA,OA5FA,CA4FQ,QA5FR,EA4FkB,MA5FlB,CAAA,CAAA;EAAR,MAAA,CAAA,cAAA,OAAA,GA6F4B,MA7F5B,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,KAAA,EAiGK,WAjGL,EAAA,IAAA,EAkGI,WAlGJ,CAkGgB,KAlGhB,CAAA,CAAA,EAmGA,OAnGA,CAmGQ,OAnGR,CAmGgB,QAnGhB,EAmG0B,KAnG1B,CAAA,CAAA;EAwBgB;EAAU,MAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,CAAA,EA0G1B,OA1G0B,CA0GlB,OA1GkB,CAAA,IAAA,EA0GJ,MA1GI,CAAA,CAAA;EAAlB,MAAA,CAAA,cAAA,OAAA,GA2GoB,MA3GpB,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EA+GJ,WA/GI,CA+GQ,KA/GR,CAAA,CAAA,EAgHR,OAhHQ,CAgHA,OAhHA,CAAA,IAAA,EAgHc,KAhHd,CAAA,CAAA;AAAR"}
|
|
@@ -7,39 +7,42 @@ var Databases = class {
|
|
|
7
7
|
this.#ctx = ctx;
|
|
8
8
|
}
|
|
9
9
|
list(projectId, branchId, opts) {
|
|
10
|
-
return this.#ctx.run(opts, (client) => listProjectBranchDatabases({
|
|
10
|
+
return this.#ctx.run(opts, (client, signal) => listProjectBranchDatabases({
|
|
11
11
|
client,
|
|
12
12
|
path: {
|
|
13
13
|
project_id: projectId,
|
|
14
14
|
branch_id: branchId
|
|
15
15
|
},
|
|
16
|
-
throwOnError: false
|
|
16
|
+
throwOnError: false,
|
|
17
|
+
signal
|
|
17
18
|
}), (data) => data.databases);
|
|
18
19
|
}
|
|
19
20
|
get(projectId, branchId, name, opts) {
|
|
20
|
-
return this.#ctx.run(opts, (client) => getProjectBranchDatabase({
|
|
21
|
+
return this.#ctx.run(opts, (client, signal) => getProjectBranchDatabase({
|
|
21
22
|
client,
|
|
22
23
|
path: {
|
|
23
24
|
project_id: projectId,
|
|
24
25
|
branch_id: branchId,
|
|
25
26
|
database_name: name
|
|
26
27
|
},
|
|
27
|
-
throwOnError: false
|
|
28
|
+
throwOnError: false,
|
|
29
|
+
signal
|
|
28
30
|
}), (data) => data.database);
|
|
29
31
|
}
|
|
30
32
|
create(projectId, branchId, input, opts) {
|
|
31
|
-
return this.#ctx.run(opts, (client) => createProjectBranchDatabase({
|
|
33
|
+
return this.#ctx.run(opts, (client, signal) => createProjectBranchDatabase({
|
|
32
34
|
client,
|
|
33
35
|
path: {
|
|
34
36
|
project_id: projectId,
|
|
35
37
|
branch_id: branchId
|
|
36
38
|
},
|
|
37
39
|
body: { database: input },
|
|
38
|
-
throwOnError: false
|
|
40
|
+
throwOnError: false,
|
|
41
|
+
signal
|
|
39
42
|
}), (data) => data.database);
|
|
40
43
|
}
|
|
41
44
|
update(projectId, branchId, name, input, opts) {
|
|
42
|
-
return this.#ctx.run(opts, (client) => updateProjectBranchDatabase({
|
|
45
|
+
return this.#ctx.run(opts, (client, signal) => updateProjectBranchDatabase({
|
|
43
46
|
client,
|
|
44
47
|
path: {
|
|
45
48
|
project_id: projectId,
|
|
@@ -47,18 +50,20 @@ var Databases = class {
|
|
|
47
50
|
database_name: name
|
|
48
51
|
},
|
|
49
52
|
body: { database: input },
|
|
50
|
-
throwOnError: false
|
|
53
|
+
throwOnError: false,
|
|
54
|
+
signal
|
|
51
55
|
}), (data) => data.database);
|
|
52
56
|
}
|
|
53
57
|
delete(projectId, branchId, name, opts) {
|
|
54
|
-
return this.#ctx.runVoid(opts, (client) => deleteProjectBranchDatabase({
|
|
58
|
+
return this.#ctx.runVoid(opts, (client, signal) => deleteProjectBranchDatabase({
|
|
55
59
|
client,
|
|
56
60
|
path: {
|
|
57
61
|
project_id: projectId,
|
|
58
62
|
branch_id: branchId,
|
|
59
63
|
database_name: name
|
|
60
64
|
},
|
|
61
|
-
throwOnError: false
|
|
65
|
+
throwOnError: false,
|
|
66
|
+
signal
|
|
62
67
|
}));
|
|
63
68
|
}
|
|
64
69
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"databases.js","names":["#ctx"],"sources":["../../../src/neon/resources/databases.ts"],"sourcesContent":["import {\n\tcreateProjectBranchDatabase,\n\tdeleteProjectBranchDatabase,\n\tgetProjectBranchDatabase,\n\tlistProjectBranchDatabases,\n\tupdateProjectBranchDatabase,\n} from \"../../client/sdk.gen.js\";\nimport type {\n\tDatabase,\n\tDatabaseCreateRequest,\n\tDatabaseUpdateRequest,\n} from \"../../client/types.gen.js\";\nimport type { CallOptions, RequestContext } from \"../context.js\";\nimport type { NeonResult, Outcome } from \"../result.js\";\n\ntype CreateInput = DatabaseCreateRequest[\"database\"];\ntype UpdateInput = DatabaseUpdateRequest[\"database\"];\n\n/** Database resource (branch-scoped). */\nexport class Databases<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}/databases */\n\tlist(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t): Promise<Outcome<Database[], DThrow>>;\n\tlist<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Database[], Throw>>;\n\tlist(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\topts?: CallOptions,\n\t): Promise<Database[] | NeonResult<Database[]>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tlistProjectBranchDatabases({\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.databases,\n\t\t);\n\t}\n\n\t/** @apiCall GET /projects/{project_id}/branches/{branch_id}/databases/{database_name} */\n\tget(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tname: string,\n\t): Promise<Outcome<Database, DThrow>>;\n\tget<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tname: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Database, Throw>>;\n\tget(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tname: string,\n\t\topts?: CallOptions,\n\t): Promise<Database | NeonResult<Database>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tgetProjectBranchDatabase({\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\tdatabase_name: name,\n\t\t\t\t\t},\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.database,\n\t\t);\n\t}\n\n\t/** @apiCall POST /projects/{project_id}/branches/{branch_id}/databases */\n\tcreate(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tinput: CreateInput,\n\t): Promise<Outcome<Database, 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<Database, Throw>>;\n\tcreate(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tinput: CreateInput,\n\t\topts?: CallOptions,\n\t): Promise<Database | NeonResult<Database>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tcreateProjectBranchDatabase({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, branch_id: branchId },\n\t\t\t\t\tbody: { database: input },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.database,\n\t\t);\n\t}\n\n\t/** @apiCall PATCH /projects/{project_id}/branches/{branch_id}/databases/{database_name} */\n\tupdate(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tname: string,\n\t\tinput: UpdateInput,\n\t): Promise<Outcome<Database, DThrow>>;\n\tupdate<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tname: string,\n\t\tinput: UpdateInput,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Database, Throw>>;\n\tupdate(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tname: string,\n\t\tinput: UpdateInput,\n\t\topts?: CallOptions,\n\t): Promise<Database | NeonResult<Database>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tupdateProjectBranchDatabase({\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\tdatabase_name: name,\n\t\t\t\t\t},\n\t\t\t\t\tbody: { database: input },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.database,\n\t\t);\n\t}\n\n\t/** @apiCall DELETE /projects/{project_id}/branches/{branch_id}/databases/{database_name} */\n\tdelete(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tname: string,\n\t): Promise<Outcome<void, DThrow>>;\n\tdelete<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tname: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<void, Throw>>;\n\tdelete(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tname: string,\n\t\topts?: CallOptions,\n\t): Promise<void | NeonResult<void>> {\n\t\treturn this.#ctx.runVoid(opts, (client) =>\n\t\t\tdeleteProjectBranchDatabase({\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\tdatabase_name: name,\n\t\t\t\t},\n\t\t\t\tthrowOnError: false,\n\t\t\t}),\n\t\t);\n\t}\n}\n"],"mappings":";;;AAmBA,IAAa,YAAb,MAA+C;CAC9C;CAEA,YAAY,KAAqB;EAChC,KAAKA,OAAO;CACb;CAYA,KACC,WACA,UACA,MAC+C;EAC/C,OAAO,KAAKA,KAAK,IAChB,OACC,
|
|
1
|
+
{"version":3,"file":"databases.js","names":["#ctx"],"sources":["../../../src/neon/resources/databases.ts"],"sourcesContent":["import {\n\tcreateProjectBranchDatabase,\n\tdeleteProjectBranchDatabase,\n\tgetProjectBranchDatabase,\n\tlistProjectBranchDatabases,\n\tupdateProjectBranchDatabase,\n} from \"../../client/sdk.gen.js\";\nimport type {\n\tDatabase,\n\tDatabaseCreateRequest,\n\tDatabaseUpdateRequest,\n} from \"../../client/types.gen.js\";\nimport type { CallOptions, RequestContext } from \"../context.js\";\nimport type { NeonResult, Outcome } from \"../result.js\";\n\ntype CreateInput = DatabaseCreateRequest[\"database\"];\ntype UpdateInput = DatabaseUpdateRequest[\"database\"];\n\n/** Database resource (branch-scoped). */\nexport class Databases<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}/databases */\n\tlist(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t): Promise<Outcome<Database[], DThrow>>;\n\tlist<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Database[], Throw>>;\n\tlist(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\topts?: CallOptions,\n\t): Promise<Database[] | NeonResult<Database[]>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client, signal) =>\n\t\t\t\tlistProjectBranchDatabases({\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\tsignal,\n\t\t\t\t}),\n\t\t\t(data) => data.databases,\n\t\t);\n\t}\n\n\t/** @apiCall GET /projects/{project_id}/branches/{branch_id}/databases/{database_name} */\n\tget(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tname: string,\n\t): Promise<Outcome<Database, DThrow>>;\n\tget<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tname: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Database, Throw>>;\n\tget(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tname: string,\n\t\topts?: CallOptions,\n\t): Promise<Database | NeonResult<Database>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client, signal) =>\n\t\t\t\tgetProjectBranchDatabase({\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\tdatabase_name: name,\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) => data.database,\n\t\t);\n\t}\n\n\t/** @apiCall POST /projects/{project_id}/branches/{branch_id}/databases */\n\tcreate(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tinput: CreateInput,\n\t): Promise<Outcome<Database, 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<Database, Throw>>;\n\tcreate(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tinput: CreateInput,\n\t\topts?: CallOptions,\n\t): Promise<Database | NeonResult<Database>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client, signal) =>\n\t\t\t\tcreateProjectBranchDatabase({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, branch_id: branchId },\n\t\t\t\t\tbody: { database: input },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t\tsignal,\n\t\t\t\t}),\n\t\t\t(data) => data.database,\n\t\t);\n\t}\n\n\t/** @apiCall PATCH /projects/{project_id}/branches/{branch_id}/databases/{database_name} */\n\tupdate(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tname: string,\n\t\tinput: UpdateInput,\n\t): Promise<Outcome<Database, DThrow>>;\n\tupdate<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tname: string,\n\t\tinput: UpdateInput,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Database, Throw>>;\n\tupdate(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tname: string,\n\t\tinput: UpdateInput,\n\t\topts?: CallOptions,\n\t): Promise<Database | NeonResult<Database>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client, signal) =>\n\t\t\t\tupdateProjectBranchDatabase({\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\tdatabase_name: name,\n\t\t\t\t\t},\n\t\t\t\t\tbody: { database: input },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t\tsignal,\n\t\t\t\t}),\n\t\t\t(data) => data.database,\n\t\t);\n\t}\n\n\t/** @apiCall DELETE /projects/{project_id}/branches/{branch_id}/databases/{database_name} */\n\tdelete(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tname: string,\n\t): Promise<Outcome<void, DThrow>>;\n\tdelete<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tname: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<void, Throw>>;\n\tdelete(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\tname: string,\n\t\topts?: CallOptions,\n\t): Promise<void | NeonResult<void>> {\n\t\treturn this.#ctx.runVoid(opts, (client, signal) =>\n\t\t\tdeleteProjectBranchDatabase({\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\tdatabase_name: name,\n\t\t\t\t},\n\t\t\t\tthrowOnError: false,\n\t\t\t\tsignal,\n\t\t\t}),\n\t\t);\n\t}\n}\n"],"mappings":";;;AAmBA,IAAa,YAAb,MAA+C;CAC9C;CAEA,YAAY,KAAqB;EAChC,KAAKA,OAAO;CACb;CAYA,KACC,WACA,UACA,MAC+C;EAC/C,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,2BAA2B;GAC1B;GACA,MAAM;IAAE,YAAY;IAAW,WAAW;GAAS;GACnD,cAAc;GACd;EACD,CAAC,IACD,SAAS,KAAK,SAChB;CACD;CAcA,IACC,WACA,UACA,MACA,MAC2C;EAC3C,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,yBAAyB;GACxB;GACA,MAAM;IACL,YAAY;IACZ,WAAW;IACX,eAAe;GAChB;GACA,cAAc;GACd;EACD,CAAC,IACD,SAAS,KAAK,QAChB;CACD;CAcA,OACC,WACA,UACA,OACA,MAC2C;EAC3C,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,4BAA4B;GAC3B;GACA,MAAM;IAAE,YAAY;IAAW,WAAW;GAAS;GACnD,MAAM,EAAE,UAAU,MAAM;GACxB,cAAc;GACd;EACD,CAAC,IACD,SAAS,KAAK,QAChB;CACD;CAgBA,OACC,WACA,UACA,MACA,OACA,MAC2C;EAC3C,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,4BAA4B;GAC3B;GACA,MAAM;IACL,YAAY;IACZ,WAAW;IACX,eAAe;GAChB;GACA,MAAM,EAAE,UAAU,MAAM;GACxB,cAAc;GACd;EACD,CAAC,IACD,SAAS,KAAK,QAChB;CACD;CAcA,OACC,WACA,UACA,MACA,MACmC;EACnC,OAAO,KAAKA,KAAK,QAAQ,OAAO,QAAQ,WACvC,4BAA4B;GAC3B;GACA,MAAM;IACL,YAAY;IACZ,WAAW;IACX,eAAe;GAChB;GACA,cAAc;GACd;EACD,CAAC,CACF;CACD;AACD"}
|
|
@@ -1 +1 @@
|
|
|
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;EAGJ;EAKwB,IAAA,CAAA,SAAA,EAAA,MAAA,CAAA,EAAhB,OAAgB,CAAR,OAAQ,CAAA,QAAA,EAAA,EAAY,MAAZ,CAAA,CAAA;EAAY,IAAA,CAAA,cAAA,OAAA,GACxB,MADwB,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,IAAA,EAG9C,WAH8C,CAGlC,KAHkC,CAAA,CAAA,EAIlD,OAJkD,CAI1C,OAJ0C,CAIlC,QAJkC,EAAA,EAItB,KAJsB,CAAA,CAAA;EAApB;EAAR,YAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,CAAA,
|
|
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;EAGJ;EAKwB,IAAA,CAAA,SAAA,EAAA,MAAA,CAAA,EAAhB,OAAgB,CAAR,OAAQ,CAAA,QAAA,EAAA,EAAY,MAAZ,CAAA,CAAA;EAAY,IAAA,CAAA,cAAA,OAAA,GACxB,MADwB,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,IAAA,EAG9C,WAH8C,CAGlC,KAHkC,CAAA,CAAA,EAIlD,OAJkD,CAI1C,OAJ0C,CAIlC,QAJkC,EAAA,EAItB,KAJsB,CAAA,CAAA;EAApB;EAAR,YAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,CAAA,EA0BtB,OA1BsB,CA0Bd,OA1Bc,CA0BN,QA1BM,EAAA,EA0BM,MA1BN,CAAA,CAAA;EACI,YAAA,CAAA,cAAA,OAAA,GA0BQ,MA1BR,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EA6BtB,WA7BsB,CA6BV,KA7BU,CAAA,CAAA,EA8B1B,OA9B0B,CA8BlB,OA9BkB,CA8BV,QA9BU,EAAA,EA8BE,KA9BF,CAAA,CAAA;EAEV;EAAZ,GAAA,CAAA,SAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,CAAA,EAmDJ,OAnDI,CAmDI,OAnDJ,CAmDY,QAnDZ,EAmDsB,MAnDtB,CAAA,CAAA;EACY,GAAA,CAAA,cAAA,OAAA,GAmDS,MAnDT,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,IAAA,EAsDZ,WAtDY,CAsDA,KAtDA,CAAA,CAAA,EAuDhB,OAvDgB,CAuDR,OAvDQ,CAuDA,QAvDA,EAuDU,KAvDV,CAAA,CAAA;EAAY;EAApB,MAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,EA6EH,WA7EG,CAAA,EA8ER,OA9EQ,CA8EA,OA9EA,CA8EQ,QA9ER,EA8EkB,MA9ElB,CAAA,CAAA;EAAR,MAAA,CAAA,cAAA,OAAA,GA+E4B,MA/E5B,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,EAiFK,WAjFL,EAAA,IAAA,EAkFI,WAlFJ,CAkFgB,KAlFhB,CAAA,CAAA,EAmFA,OAnFA,CAmFQ,OAnFR,CAmFgB,QAnFhB,EAmF0B,KAnF1B,CAAA,CAAA;EAsBgB;EAAY,MAAA,CAAA,SAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,KAAA,EAqFvB,WArFuB,CAAA,EAsF5B,OAtF4B,CAsFpB,OAtFoB,CAsFZ,QAtFY,EAsFF,MAtFE,CAAA,CAAA;EAApB,MAAA,CAAA,cAAA,OAAA,GAuFoB,MAvFpB,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,KAAA,EA0FH,WA1FG,EAAA,IAAA,EA2FJ,WA3FI,CA2FQ,KA3FR,CAAA,CAAA,EA4FR,OA5FQ,CA4FA,OA5FA,CA4FQ,QA5FR,EA4FkB,KA5FlB,CAAA,CAAA;EAAR;EACkC,MAAA,CAAA,SAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,CAAA,EAoHlC,OApHkC,CAoH1B,OApH0B,CAAA,IAAA,EAoHZ,MApHY,CAAA,CAAA;EAGlB,MAAA,CAAA,cAAA,OAAA,GAkHY,MAlHZ,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,IAAA,EAqHZ,WArHY,CAqHA,KArHA,CAAA,CAAA,EAsHhB,OAtHgB,CAsHR,OAtHQ,CAAA,IAAA,EAsHM,KAtHN,CAAA,CAAA;EAAZ;EACY,KAAA,CAAA,SAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,CAAA,EAyIhB,OAzIgB,CAyIR,OAzIQ,CAyIA,QAzIA,EAyIU,MAzIV,CAAA,CAAA;EAAY,KAAA,CAAA,cAAA,OAAA,GA0ID,MA1IC,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,IAAA,EA6IxB,WA7IwB,CA6IZ,KA7IY,CAAA,CAAA,EA8I5B,OA9I4B,CA8IpB,OA9IoB,CA8IZ,QA9IY,EA8IF,KA9IE,CAAA,CAAA;EAApB;EAAR,OAAA,CAAA,SAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,CAAA,EAqKA,OArKA,CAqKQ,OArKR,CAqKgB,QArKhB,EAqK0B,MArK1B,CAAA,CAAA;EAuBgB,OAAA,CAAA,cAAA,OAAA,GA+Ia,MA/Ib,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,IAAA,EAkJZ,WAlJY,CAkJA,KAlJA,CAAA,CAAA,EAmJhB,OAnJgB,CAmJR,OAnJQ,CAmJA,QAnJA,EAmJU,KAnJV,CAAA,CAAA;EAAU;EAAlB,OAAA,CAAA,SAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,CAAA,EA0KR,OA1KQ,CA0KA,OA1KA,CA0KQ,QA1KR,EA0KkB,MA1KlB,CAAA,CAAA;EAAR,OAAA,CAAA,cAAA,OAAA,GA2K6B,MA3K7B,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,IAAA,EA8KI,WA9KJ,CA8KgB,KA9KhB,CAAA,CAAA,EA+KA,OA/KA,CA+KQ,OA/KR,CA+KgB,QA/KhB,EA+K0B,KA/K1B,CAAA,CAAA;AACyB"}
|
|
@@ -7,89 +7,98 @@ var Endpoints = class {
|
|
|
7
7
|
this.#ctx = ctx;
|
|
8
8
|
}
|
|
9
9
|
list(projectId, opts) {
|
|
10
|
-
return this.#ctx.run(opts, (client) => listProjectEndpoints({
|
|
10
|
+
return this.#ctx.run(opts, (client, signal) => listProjectEndpoints({
|
|
11
11
|
client,
|
|
12
12
|
path: { project_id: projectId },
|
|
13
|
-
throwOnError: false
|
|
13
|
+
throwOnError: false,
|
|
14
|
+
signal
|
|
14
15
|
}), (data) => data.endpoints);
|
|
15
16
|
}
|
|
16
17
|
listByBranch(projectId, branchId, opts) {
|
|
17
|
-
return this.#ctx.run(opts, (client) => listProjectBranchEndpoints({
|
|
18
|
+
return this.#ctx.run(opts, (client, signal) => listProjectBranchEndpoints({
|
|
18
19
|
client,
|
|
19
20
|
path: {
|
|
20
21
|
project_id: projectId,
|
|
21
22
|
branch_id: branchId
|
|
22
23
|
},
|
|
23
|
-
throwOnError: false
|
|
24
|
+
throwOnError: false,
|
|
25
|
+
signal
|
|
24
26
|
}), (data) => data.endpoints);
|
|
25
27
|
}
|
|
26
28
|
get(projectId, endpointId, opts) {
|
|
27
|
-
return this.#ctx.run(opts, (client) => getProjectEndpoint({
|
|
29
|
+
return this.#ctx.run(opts, (client, signal) => getProjectEndpoint({
|
|
28
30
|
client,
|
|
29
31
|
path: {
|
|
30
32
|
project_id: projectId,
|
|
31
33
|
endpoint_id: endpointId
|
|
32
34
|
},
|
|
33
|
-
throwOnError: false
|
|
35
|
+
throwOnError: false,
|
|
36
|
+
signal
|
|
34
37
|
}), (data) => data.endpoint);
|
|
35
38
|
}
|
|
36
39
|
create(projectId, input, opts) {
|
|
37
|
-
return this.#ctx.run(opts, (client) => createProjectEndpoint({
|
|
40
|
+
return this.#ctx.run(opts, (client, signal) => createProjectEndpoint({
|
|
38
41
|
client,
|
|
39
42
|
path: { project_id: projectId },
|
|
40
43
|
body: { endpoint: input },
|
|
41
|
-
throwOnError: false
|
|
44
|
+
throwOnError: false,
|
|
45
|
+
signal
|
|
42
46
|
}), (data) => data.endpoint);
|
|
43
47
|
}
|
|
44
48
|
update(projectId, endpointId, input, opts) {
|
|
45
|
-
return this.#ctx.run(opts, (client) => updateProjectEndpoint({
|
|
49
|
+
return this.#ctx.run(opts, (client, signal) => updateProjectEndpoint({
|
|
46
50
|
client,
|
|
47
51
|
path: {
|
|
48
52
|
project_id: projectId,
|
|
49
53
|
endpoint_id: endpointId
|
|
50
54
|
},
|
|
51
55
|
body: { endpoint: input },
|
|
52
|
-
throwOnError: false
|
|
56
|
+
throwOnError: false,
|
|
57
|
+
signal
|
|
53
58
|
}), (data) => data.endpoint);
|
|
54
59
|
}
|
|
55
60
|
delete(projectId, endpointId, opts) {
|
|
56
|
-
return this.#ctx.runVoid(opts, (client) => deleteProjectEndpoint({
|
|
61
|
+
return this.#ctx.runVoid(opts, (client, signal) => deleteProjectEndpoint({
|
|
57
62
|
client,
|
|
58
63
|
path: {
|
|
59
64
|
project_id: projectId,
|
|
60
65
|
endpoint_id: endpointId
|
|
61
66
|
},
|
|
62
|
-
throwOnError: false
|
|
67
|
+
throwOnError: false,
|
|
68
|
+
signal
|
|
63
69
|
}));
|
|
64
70
|
}
|
|
65
71
|
start(projectId, endpointId, opts) {
|
|
66
|
-
return this.#ctx.run(opts, (client) => startProjectEndpoint({
|
|
72
|
+
return this.#ctx.run(opts, (client, signal) => startProjectEndpoint({
|
|
67
73
|
client,
|
|
68
74
|
path: {
|
|
69
75
|
project_id: projectId,
|
|
70
76
|
endpoint_id: endpointId
|
|
71
77
|
},
|
|
72
|
-
throwOnError: false
|
|
78
|
+
throwOnError: false,
|
|
79
|
+
signal
|
|
73
80
|
}), (data) => data.endpoint);
|
|
74
81
|
}
|
|
75
82
|
suspend(projectId, endpointId, opts) {
|
|
76
|
-
return this.#ctx.run(opts, (client) => suspendProjectEndpoint({
|
|
83
|
+
return this.#ctx.run(opts, (client, signal) => suspendProjectEndpoint({
|
|
77
84
|
client,
|
|
78
85
|
path: {
|
|
79
86
|
project_id: projectId,
|
|
80
87
|
endpoint_id: endpointId
|
|
81
88
|
},
|
|
82
|
-
throwOnError: false
|
|
89
|
+
throwOnError: false,
|
|
90
|
+
signal
|
|
83
91
|
}), (data) => data.endpoint);
|
|
84
92
|
}
|
|
85
93
|
restart(projectId, endpointId, opts) {
|
|
86
|
-
return this.#ctx.run(opts, (client) => restartProjectEndpoint({
|
|
94
|
+
return this.#ctx.run(opts, (client, signal) => restartProjectEndpoint({
|
|
87
95
|
client,
|
|
88
96
|
path: {
|
|
89
97
|
project_id: projectId,
|
|
90
98
|
endpoint_id: endpointId
|
|
91
99
|
},
|
|
92
|
-
throwOnError: false
|
|
100
|
+
throwOnError: false,
|
|
101
|
+
signal
|
|
93
102
|
}), (data) => data.endpoint);
|
|
94
103
|
}
|
|
95
104
|
};
|
|
@@ -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\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,
|
|
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, signal) =>\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\tsignal,\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, signal) =>\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\tsignal,\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, signal) =>\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\tsignal,\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, signal) =>\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\tsignal,\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, signal) =>\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\tsignal,\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, signal) =>\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\tsignal,\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, signal) =>\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\tsignal,\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, signal) =>\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\tsignal,\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, signal) =>\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\tsignal,\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,QAAQ,WACR,qBAAqB;GACpB;GACA,MAAM,EAAE,YAAY,UAAU;GAC9B,cAAc;GACd;EACD,CAAC,IACD,SAAS,KAAK,SAChB;CACD;CAYA,aACC,WACA,UACA,MAC+C;EAC/C,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,2BAA2B;GAC1B;GACA,MAAM;IAAE,YAAY;IAAW,WAAW;GAAS;GACnD,cAAc;GACd;EACD,CAAC,IACD,SAAS,KAAK,SAChB;CACD;CAYA,IACC,WACA,YACA,MAC2C;EAC3C,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,mBAAmB;GAClB;GACA,MAAM;IAAE,YAAY;IAAW,aAAa;GAAW;GACvD,cAAc;GACd;EACD,CAAC,IACD,SAAS,KAAK,QAChB;CACD;CAYA,OACC,WACA,OACA,MAC2C;EAC3C,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,sBAAsB;GACrB;GACA,MAAM,EAAE,YAAY,UAAU;GAC9B,MAAM,EAAE,UAAU,MAAM;GACxB,cAAc;GACd;EACD,CAAC,IACD,SAAS,KAAK,QAChB;CACD;CAcA,OACC,WACA,YACA,OACA,MAC2C;EAC3C,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,sBAAsB;GACrB;GACA,MAAM;IAAE,YAAY;IAAW,aAAa;GAAW;GACvD,MAAM,EAAE,UAAU,MAAM;GACxB,cAAc;GACd;EACD,CAAC,IACD,SAAS,KAAK,QAChB;CACD;CAYA,OACC,WACA,YACA,MACmC;EACnC,OAAO,KAAKA,KAAK,QAAQ,OAAO,QAAQ,WACvC,sBAAsB;GACrB;GACA,MAAM;IAAE,YAAY;IAAW,aAAa;GAAW;GACvD,cAAc;GACd;EACD,CAAC,CACF;CACD;CAYA,MACC,WACA,YACA,MAC2C;EAC3C,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,qBAAqB;GACpB;GACA,MAAM;IAAE,YAAY;IAAW,aAAa;GAAW;GACvD,cAAc;GACd;EACD,CAAC,IACD,SAAS,KAAK,QAChB;CACD;CAYA,QACC,WACA,YACA,MAC2C;EAC3C,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,uBAAuB;GACtB;GACA,MAAM;IAAE,YAAY;IAAW,aAAa;GAAW;GACvD,cAAc;GACd;EACD,CAAC,IACD,SAAS,KAAK,QAChB;CACD;CAYA,QACC,WACA,YACA,MAC2C;EAC3C,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,uBAAuB;GACtB;GACA,MAAM;IAAE,YAAY;IAAW,aAAa;GAAW;GACvD,cAAc;GACd;EACD,CAAC,IACD,SAAS,KAAK,QAChB;CACD;AACD"}
|
|
@@ -11,7 +11,7 @@ declare class Functions<DThrow extends boolean> {
|
|
|
11
11
|
#private;
|
|
12
12
|
constructor(ctx: RequestContext);
|
|
13
13
|
/** @apiCall GET /projects/{project_id}/branches/{branch_id}/functions (cursor-paginated) */
|
|
14
|
-
list(projectId: string, branchId: string, query?: ListQuery): Paginated<NeonFunction>;
|
|
14
|
+
list(projectId: string, branchId: string, query?: ListQuery, opts?: CallOptions): Paginated<NeonFunction>;
|
|
15
15
|
/** @apiCall GET /projects/{project_id}/branches/{branch_id}/functions/{slug} */
|
|
16
16
|
get(projectId: string, branchId: string, slug: string): Promise<Outcome<NeonFunction, DThrow>>;
|
|
17
17
|
get<Throw extends boolean = DThrow>(projectId: string, branchId: string, slug: string, opts: CallOptions<Throw>): Promise<Outcome<NeonFunction, Throw>>;
|
|
@@ -1 +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;EACD,CAAA,OAAA;EAAZ,WAAA,CAAA,GAAA,EASiB,cATjB;EADgB;EAAI,IAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,KAAA,CAAA,EAkBX,SAlBW,CAAA,
|
|
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;EACD,CAAA,OAAA;EAAZ,WAAA,CAAA,GAAA,EASiB,cATjB;EADgB;EAAI,IAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,KAAA,CAAA,EAkBX,SAlBW,EAAA,IAAA,CAAA,EAmBZ,WAnBY,CAAA,EAoBjB,SApBiB,CAoBP,YApBO,CAAA;EAIhB;EAGQ,GAAA,CAAA,SAAS,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,CAAA,EAoClB,OApCkB,CAoCV,OApCU,CAoCF,YApCE,EAoCY,MApCZ,CAAA,CAAA;EAAA,GAAA,CAAA,cAAA,OAAA,GAqCO,MArCP,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAyCd,WAzCc,CAyCF,KAzCE,CAAA,CAAA,EA0ClB,OA1CkB,CA0CV,OA1CU,CA0CF,YA1CE,EA0CY,KA1CZ,CAAA,CAAA;EAGJ;EAQR,MAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,KAAA,EA4DD,WA5DC,CAAA,EA6DN,OA7DM,CA6DE,OA7DF,CA6DU,YA7DV,EA6DwB,MA7DxB,CAAA,CAAA;EACD,MAAA,CAAA,cAAA,OAAA,GA6DuB,MA7DvB,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,KAAA,EAiEA,WAjEA,EAAA,IAAA,EAkED,WAlEC,CAkEW,KAlEX,CAAA,CAAA,EAmEL,OAnEK,CAmEG,OAnEH,CAmEW,YAnEX,EAmEyB,KAnEzB,CAAA,CAAA;EACK;EAAV,MAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,CAAA,EAiGA,OAjGA,CAiGQ,OAjGR,CAAA,IAAA,EAiGsB,MAjGtB,CAAA,CAAA;EAuBgB,MAAA,CAAA,cAAA,OAAA,GA2EY,MA3EZ,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EA+EZ,WA/EY,CA+EA,KA/EA,CAAA,CAAA,EAgFhB,OAhFgB,CAgFR,OAhFQ,CAAA,IAAA,EAgFM,KAhFN,CAAA,CAAA;EAAc;EAAtB,MAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,KAAA,CAAA,EA0GF,qBA1GE,CAAA,EA2GR,OA3GQ,CA2GA,OA3GA,CA2GQ,sBA3GR,EA2GgC,MA3GhC,CAAA,CAAA;EAAR,MAAA,CAAA,cAAA,OAAA,GA4G4B,MA5G5B,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,KAAA,EAgHK,qBAhHL,GAAA,SAAA,EAAA,IAAA,EAiHI,WAjHJ,CAiHgB,KAjHhB,CAAA,CAAA,EAkHA,OAlHA,CAkHQ,OAlHR,CAkHgB,sBAlHhB,EAkHwC,KAlHxC,CAAA,CAAA;AACyB"}
|
|
@@ -8,7 +8,7 @@ var Functions = class {
|
|
|
8
8
|
this.#ctx = ctx;
|
|
9
9
|
}
|
|
10
10
|
/** @apiCall GET /projects/{project_id}/branches/{branch_id}/functions (cursor-paginated) */
|
|
11
|
-
list(projectId, branchId, query) {
|
|
11
|
+
list(projectId, branchId, query, opts) {
|
|
12
12
|
return paginate((cursor, signal) => listProjectBranchFunctions({
|
|
13
13
|
client: this.#ctx.client,
|
|
14
14
|
path: {
|
|
@@ -24,21 +24,22 @@ var Functions = class {
|
|
|
24
24
|
}), (data) => ({
|
|
25
25
|
items: data?.functions ?? [],
|
|
26
26
|
cursor: data?.pagination?.next
|
|
27
|
-
}));
|
|
27
|
+
}), () => this.#ctx.deadlineFor(opts));
|
|
28
28
|
}
|
|
29
29
|
get(projectId, branchId, slug, opts) {
|
|
30
|
-
return this.#ctx.run(opts, (client) => getProjectBranchFunction({
|
|
30
|
+
return this.#ctx.run(opts, (client, signal) => getProjectBranchFunction({
|
|
31
31
|
client,
|
|
32
32
|
path: {
|
|
33
33
|
project_id: projectId,
|
|
34
34
|
branch_id: branchId,
|
|
35
35
|
slug
|
|
36
36
|
},
|
|
37
|
-
throwOnError: false
|
|
37
|
+
throwOnError: false,
|
|
38
|
+
signal
|
|
38
39
|
}), (data) => data.function);
|
|
39
40
|
}
|
|
40
41
|
update(projectId, branchId, slug, input, opts) {
|
|
41
|
-
return this.#ctx.run(opts, (client) => updateProjectBranchFunction({
|
|
42
|
+
return this.#ctx.run(opts, (client, signal) => updateProjectBranchFunction({
|
|
42
43
|
client,
|
|
43
44
|
path: {
|
|
44
45
|
project_id: projectId,
|
|
@@ -46,22 +47,24 @@ var Functions = class {
|
|
|
46
47
|
slug
|
|
47
48
|
},
|
|
48
49
|
body: input,
|
|
49
|
-
throwOnError: false
|
|
50
|
+
throwOnError: false,
|
|
51
|
+
signal
|
|
50
52
|
}), (data) => data.function);
|
|
51
53
|
}
|
|
52
54
|
delete(projectId, branchId, slug, opts) {
|
|
53
|
-
return this.#ctx.runVoid(opts, (client) => deleteProjectBranchFunction({
|
|
55
|
+
return this.#ctx.runVoid(opts, (client, signal) => deleteProjectBranchFunction({
|
|
54
56
|
client,
|
|
55
57
|
path: {
|
|
56
58
|
project_id: projectId,
|
|
57
59
|
branch_id: branchId,
|
|
58
60
|
slug
|
|
59
61
|
},
|
|
60
|
-
throwOnError: false
|
|
62
|
+
throwOnError: false,
|
|
63
|
+
signal
|
|
61
64
|
}));
|
|
62
65
|
}
|
|
63
66
|
deploy(projectId, branchId, slug, input, opts) {
|
|
64
|
-
return this.#ctx.run(opts, (client) => createProjectBranchFunctionDeployment({
|
|
67
|
+
return this.#ctx.run(opts, (client, signal) => createProjectBranchFunctionDeployment({
|
|
65
68
|
client,
|
|
66
69
|
path: {
|
|
67
70
|
project_id: projectId,
|
|
@@ -69,7 +72,8 @@ var Functions = class {
|
|
|
69
72
|
slug
|
|
70
73
|
},
|
|
71
74
|
body: input ?? {},
|
|
72
|
-
throwOnError: false
|
|
75
|
+
throwOnError: false,
|
|
76
|
+
signal
|
|
73
77
|
}), (data) => data.deployment);
|
|
74
78
|
}
|
|
75
79
|
};
|
|
@@ -1 +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,
|
|
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\topts?: CallOptions,\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\t() => this.#ctx.deadlineFor(opts),\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, signal) =>\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\tsignal,\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, signal) =>\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\tsignal,\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, signal) =>\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\tsignal,\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, signal) =>\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\tsignal,\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,OACA,MAC0B;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,UACM,KAAKA,KAAK,YAAY,IAAI,CACjC;CACD;CAcA,IACC,WACA,UACA,MACA,MACmD;EACnD,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,yBAAyB;GACxB;GACA,MAAM;IACL,YAAY;IACZ,WAAW;IACX;GACD;GACA,cAAc;GACd;EACD,CAAC,IACD,SAAS,KAAK,QAChB;CACD;CAgBA,OACC,WACA,UACA,MACA,OACA,MACmD;EACnD,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,4BAA4B;GAC3B;GACA,MAAM;IACL,YAAY;IACZ,WAAW;IACX;GACD;GACA,MAAM;GACN,cAAc;GACd;EACD,CAAC,IACD,SAAS,KAAK,QAChB;CACD;CAcA,OACC,WACA,UACA,MACA,MACmC;EACnC,OAAO,KAAKA,KAAK,QAAQ,OAAO,QAAQ,WACvC,4BAA4B;GAC3B;GACA,MAAM;IACL,YAAY;IACZ,WAAW;IACX;GACD;GACA,cAAc;GACd;EACD,CAAC,CACF;CACD;CAgBA,OACC,WACA,UACA,MACA,OACA,MACuE;EACvE,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,sCAAsC;GACrC;GACA,MAAM;IACL,YAAY;IACZ,WAAW;IACX;GACD;GACA,MAAM,SAAS,CAAC;GAChB,cAAc;GACd;EACD,CAAC,IACD,SAAS,KAAK,UAChB;CACD;AACD"}
|
|
@@ -5,12 +5,21 @@ import { CallOptions, RequestContext } from "../context.js";
|
|
|
5
5
|
import { Paginated } from "../paginate.js";
|
|
6
6
|
|
|
7
7
|
//#region src/neon/resources/operations.d.ts
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Options for {@link Operations.waitFor}.
|
|
11
|
+
*
|
|
12
|
+
* `requestTimeoutMs` and `waitForReadiness` are deliberately excluded. Readiness is
|
|
13
|
+
* budgeted by `timeoutMs`, and waiting *is* the readiness step — accepting either would
|
|
14
|
+
* offer a knob that silently did nothing.
|
|
15
|
+
*/
|
|
16
|
+
type WaitForForOptions<Throw extends boolean> = WaitForOptions & Omit<CallOptions<Throw>, "requestTimeoutMs" | "waitForReadiness">;
|
|
8
17
|
/** Operation resource — read operations and wait for them to finish. */
|
|
9
18
|
declare class Operations<DThrow extends boolean> {
|
|
10
19
|
#private;
|
|
11
20
|
constructor(ctx: RequestContext);
|
|
12
21
|
/** @apiCall GET /projects/{project_id}/operations (cursor-paginated) */
|
|
13
|
-
list(projectId: string): Paginated<Operation>;
|
|
22
|
+
list(projectId: string, opts?: CallOptions): Paginated<Operation>;
|
|
14
23
|
/** @apiCall GET /projects/{project_id}/operations/{operation_id} */
|
|
15
24
|
get(projectId: string, operationId: string): Promise<Outcome<Operation, DThrow>>;
|
|
16
25
|
get<Throw extends boolean = DThrow>(projectId: string, operationId: string, opts: CallOptions<Throw>): Promise<Outcome<Operation, Throw>>;
|
|
@@ -20,8 +29,8 @@ declare class Operations<DThrow extends boolean> {
|
|
|
20
29
|
* from any source (e.g. a raw call or a create response).
|
|
21
30
|
*/
|
|
22
31
|
waitFor(operations: readonly Operation[]): Promise<Outcome<void, DThrow>>;
|
|
23
|
-
waitFor<Throw extends boolean = DThrow>(operations: readonly Operation[], opts:
|
|
32
|
+
waitFor<Throw extends boolean = DThrow>(operations: readonly Operation[], opts: WaitForForOptions<Throw>): Promise<Outcome<void, Throw>>;
|
|
24
33
|
}
|
|
25
34
|
//#endregion
|
|
26
|
-
export { Operations };
|
|
35
|
+
export { Operations, WaitForForOptions };
|
|
27
36
|
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","names":[],"sources":["../../../src/neon/resources/operations.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"operations.d.ts","names":[],"sources":["../../../src/neon/resources/operations.ts"],"mappings":";;;;;;;;;;AAiBA;AAA6B;AAA0B;AACrC;AAAZ;AAAL,KADW,iBACX,CAAA,cAAA,OAAA,CAAA,GADsD,cACtD,GAAA,IAAA,CAAK,WAAL,CAAiB,KAAjB,CAAA,EAAA,kBAAA,GAAA,kBAAA,CAAA;AAAI;AAGQ,cAAA,UAAU,CAAA,eAAA,OAAA,CAAA,CAAA;EAAA,CAAA,OAAA;EAGL,WAAA,CAAA,GAAA,EAAA,cAAA;EAKc;EAAwB,IAAA,CAAA,SAAA,EAAA,MAAA,EAAA,IAAA,CAAA,EAAxB,WAAwB,CAAA,EAAV,SAAU,CAAA,SAAA,CAAA;EAAV;EAsB1B,GAAA,CAAA,SAAA,EAAA,MAAA,EAAA,WAAA,EAAA,MAAA,CAAA,EAAhB,OAAgB,CAAR,OAAQ,CAAA,SAAA,EAAW,MAAX,CAAA,CAAA;EAAW,GAAA,CAAA,cAAA,OAAA,GACF,MADE,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,WAAA,EAAA,MAAA,EAAA,IAAA,EAIvB,WAJuB,CAIX,KAJW,CAAA,CAAA,EAK3B,OAL2B,CAKnB,OALmB,CAKX,SALW,EAKA,KALA,CAAA,CAAA;EAAnB;AAAR;AACyB;AAGT;AAAZ;EACY,OAAA,CAAA,UAAA,EAAA,SAwBU,SAxBV,EAAA,CAAA,EAwBwB,OAxBxB,CAwBgC,OAxBhC,CAAA,IAAA,EAwB8C,MAxB9C,CAAA,CAAA;EAAW,OAAA,CAAA,cAAA,OAAA,GAyBE,MAzBF,CAAA,CAAA,UAAA,EAAA,SA0BR,SA1BQ,EAAA,EAAA,IAAA,EA2BvB,iBA3BuB,CA2BL,KA3BK,CAAA,CAAA,EA4B3B,OA5B2B,CA4BnB,OA5BmB,CAAA,IAAA,EA4BL,KA5BK,CAAA,CAAA;AAAnB"}
|
|
@@ -9,7 +9,7 @@ var Operations = class {
|
|
|
9
9
|
this.#ctx = ctx;
|
|
10
10
|
}
|
|
11
11
|
/** @apiCall GET /projects/{project_id}/operations (cursor-paginated) */
|
|
12
|
-
list(projectId) {
|
|
12
|
+
list(projectId, opts) {
|
|
13
13
|
return paginate((cursor, signal) => listProjectOperations({
|
|
14
14
|
client: this.#ctx.client,
|
|
15
15
|
path: { project_id: projectId },
|
|
@@ -19,16 +19,17 @@ var Operations = class {
|
|
|
19
19
|
}), (data) => ({
|
|
20
20
|
items: data?.operations ?? [],
|
|
21
21
|
cursor: data?.pagination?.cursor
|
|
22
|
-
}));
|
|
22
|
+
}), () => this.#ctx.deadlineFor(opts));
|
|
23
23
|
}
|
|
24
24
|
get(projectId, operationId, opts) {
|
|
25
|
-
return this.#ctx.run(opts, (client) => getProjectOperation({
|
|
25
|
+
return this.#ctx.run(opts, (client, signal) => getProjectOperation({
|
|
26
26
|
client,
|
|
27
27
|
path: {
|
|
28
28
|
project_id: projectId,
|
|
29
29
|
operation_id: operationId
|
|
30
30
|
},
|
|
31
|
-
throwOnError: false
|
|
31
|
+
throwOnError: false,
|
|
32
|
+
signal
|
|
32
33
|
}), (data) => data.operation);
|
|
33
34
|
}
|
|
34
35
|
async waitFor(operations, opts) {
|