@neon/sdk 0.0.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +178 -0
- package/README.md +349 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/client/client/client.gen.d.ts +7 -0
- package/dist/client/client/client.gen.d.ts.map +1 -0
- package/dist/client/client/client.gen.js +176 -0
- package/dist/client/client/client.gen.js.map +1 -0
- package/dist/client/client/index.d.ts +10 -0
- package/dist/client/client/index.js +6 -0
- package/dist/client/client/types.gen.d.ts +124 -0
- package/dist/client/client/types.gen.d.ts.map +1 -0
- package/dist/client/client/types.gen.js +1 -0
- package/dist/client/client/utils.gen.d.ts +42 -0
- package/dist/client/client/utils.gen.d.ts.map +1 -0
- package/dist/client/client/utils.gen.js +179 -0
- package/dist/client/client/utils.gen.js.map +1 -0
- package/dist/client/client.gen.d.ts +18 -0
- package/dist/client/client.gen.d.ts.map +1 -0
- package/dist/client/client.gen.js +8 -0
- package/dist/client/client.gen.js.map +1 -0
- package/dist/client/core/auth.gen.d.ts +29 -0
- package/dist/client/core/auth.gen.d.ts.map +1 -0
- package/dist/client/core/auth.gen.js +12 -0
- package/dist/client/core/auth.gen.js.map +1 -0
- package/dist/client/core/bodySerializer.gen.d.ts +29 -0
- package/dist/client/core/bodySerializer.gen.d.ts.map +1 -0
- package/dist/client/core/bodySerializer.gen.js +33 -0
- package/dist/client/core/bodySerializer.gen.js.map +1 -0
- package/dist/client/core/params.gen.d.ts +46 -0
- package/dist/client/core/params.gen.d.ts.map +1 -0
- package/dist/client/core/params.gen.js +65 -0
- package/dist/client/core/params.gen.js.map +1 -0
- package/dist/client/core/pathSerializer.gen.d.ts +52 -0
- package/dist/client/core/pathSerializer.gen.d.ts.map +1 -0
- package/dist/client/core/pathSerializer.gen.js +82 -0
- package/dist/client/core/pathSerializer.gen.js.map +1 -0
- package/dist/client/core/queryKeySerializer.gen.d.ts +22 -0
- package/dist/client/core/queryKeySerializer.gen.d.ts.map +1 -0
- package/dist/client/core/queryKeySerializer.gen.js +64 -0
- package/dist/client/core/queryKeySerializer.gen.js.map +1 -0
- package/dist/client/core/serverSentEvents.gen.d.ts +88 -0
- package/dist/client/core/serverSentEvents.gen.d.ts.map +1 -0
- package/dist/client/core/serverSentEvents.gen.js +95 -0
- package/dist/client/core/serverSentEvents.gen.js.map +1 -0
- package/dist/client/core/types.gen.d.ts +80 -0
- package/dist/client/core/types.gen.d.ts.map +1 -0
- package/dist/client/core/types.gen.js +1 -0
- package/dist/client/core/utils.gen.d.ts +33 -0
- package/dist/client/core/utils.gen.d.ts.map +1 -0
- package/dist/client/core/utils.gen.js +78 -0
- package/dist/client/core/utils.gen.js.map +1 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.js +2 -0
- package/dist/client/sdk.gen.d.ts +1362 -0
- package/dist/client/sdk.gen.d.ts.map +1 -0
- package/dist/client/sdk.gen.js +4315 -0
- package/dist/client/sdk.gen.js.map +1 -0
- package/dist/client/types.gen.d.ts +9938 -0
- package/dist/client/types.gen.d.ts.map +1 -0
- package/dist/client/types.gen.js +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +4 -0
- package/dist/neon/client.d.ts +52 -0
- package/dist/neon/client.d.ts.map +1 -0
- package/dist/neon/client.js +40 -0
- package/dist/neon/client.js.map +1 -0
- package/dist/neon/config.d.ts +40 -0
- package/dist/neon/config.d.ts.map +1 -0
- package/dist/neon/config.js +23 -0
- package/dist/neon/config.js.map +1 -0
- package/dist/neon/connection.d.ts +22 -0
- package/dist/neon/connection.d.ts.map +1 -0
- package/dist/neon/connection.js +33 -0
- package/dist/neon/connection.js.map +1 -0
- package/dist/neon/context.d.ts +50 -0
- package/dist/neon/context.d.ts.map +1 -0
- package/dist/neon/context.js +59 -0
- package/dist/neon/context.js.map +1 -0
- package/dist/neon/coverage.d.ts +26 -0
- package/dist/neon/coverage.d.ts.map +1 -0
- package/dist/neon/coverage.js +229 -0
- package/dist/neon/coverage.js.map +1 -0
- package/dist/neon/errors.d.ts +78 -0
- package/dist/neon/errors.d.ts.map +1 -0
- package/dist/neon/errors.js +116 -0
- package/dist/neon/errors.js.map +1 -0
- package/dist/neon/paginate.d.ts +34 -0
- package/dist/neon/paginate.d.ts.map +1 -0
- package/dist/neon/paginate.js +51 -0
- package/dist/neon/paginate.js.map +1 -0
- package/dist/neon/resources/account.d.ts +45 -0
- package/dist/neon/resources/account.d.ts.map +1 -0
- package/dist/neon/resources/account.js +65 -0
- package/dist/neon/resources/account.js.map +1 -0
- package/dist/neon/resources/branches.d.ts +84 -0
- package/dist/neon/resources/branches.d.ts.map +1 -0
- package/dist/neon/resources/branches.js +132 -0
- package/dist/neon/resources/branches.js.map +1 -0
- package/dist/neon/resources/consumption.d.ts +22 -0
- package/dist/neon/resources/consumption.d.ts.map +1 -0
- package/dist/neon/resources/consumption.js +59 -0
- package/dist/neon/resources/consumption.js.map +1 -0
- package/dist/neon/resources/dataapi.d.ts +25 -0
- package/dist/neon/resources/dataapi.d.ts.map +1 -0
- package/dist/neon/resources/dataapi.js +59 -0
- package/dist/neon/resources/dataapi.js.map +1 -0
- package/dist/neon/resources/databases.d.ts +30 -0
- package/dist/neon/resources/databases.d.ts.map +1 -0
- package/dist/neon/resources/databases.js +68 -0
- package/dist/neon/resources/databases.js.map +1 -0
- package/dist/neon/resources/endpoints.d.ts +39 -0
- package/dist/neon/resources/endpoints.d.ts.map +1 -0
- package/dist/neon/resources/endpoints.js +89 -0
- package/dist/neon/resources/endpoints.js.map +1 -0
- package/dist/neon/resources/operations.d.ts +27 -0
- package/dist/neon/resources/operations.d.ts.map +1 -0
- package/dist/neon/resources/operations.js +50 -0
- package/dist/neon/resources/operations.js.map +1 -0
- package/dist/neon/resources/postgres.d.ts +45 -0
- package/dist/neon/resources/postgres.d.ts.map +1 -0
- package/dist/neon/resources/postgres.js +104 -0
- package/dist/neon/resources/postgres.js.map +1 -0
- package/dist/neon/resources/projects.d.ts +84 -0
- package/dist/neon/resources/projects.d.ts.map +1 -0
- package/dist/neon/resources/projects.js +111 -0
- package/dist/neon/resources/projects.js.map +1 -0
- package/dist/neon/resources/roles.d.ts +40 -0
- package/dist/neon/resources/roles.d.ts.map +1 -0
- package/dist/neon/resources/roles.js +78 -0
- package/dist/neon/resources/roles.js.map +1 -0
- package/dist/neon/resources/snapshots.d.ts +86 -0
- package/dist/neon/resources/snapshots.d.ts.map +1 -0
- package/dist/neon/resources/snapshots.js +125 -0
- package/dist/neon/resources/snapshots.js.map +1 -0
- package/dist/neon/result.d.ts +32 -0
- package/dist/neon/result.d.ts.map +1 -0
- package/dist/neon/result.js +26 -0
- package/dist/neon/result.js.map +1 -0
- package/dist/neon/retry.d.ts +17 -0
- package/dist/neon/retry.d.ts.map +1 -0
- package/dist/neon/retry.js +42 -0
- package/dist/neon/retry.js.map +1 -0
- package/dist/neon/wait.d.ts +27 -0
- package/dist/neon/wait.d.ts.map +1 -0
- package/dist/neon/wait.js +70 -0
- package/dist/neon/wait.js.map +1 -0
- package/dist/raw.d.ts +13 -0
- package/dist/raw.d.ts.map +1 -0
- package/dist/raw.js +159 -0
- package/dist/raw.js.map +1 -0
- package/package.json +57 -16
|
@@ -0,0 +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;;MAWF,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,CAAA,EAAhB,OAAgB,CAAR,OAAQ,CAAA,QAAA,EAAA,EAAY,MAAZ,CAAA,CAAA;MAAY,CAAA,cAAA,OAAA,GACF,MADE,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,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A,EAAA,KAAA,EA8FK,WA9FL,EAAA,IAAA,EA+FI,WA/FJ,CA+FgB,KA/FhB,CAAA,CAAA,EAgGA,OAhGA,CAgGQ,OAhGR,CAgGgB,QAhGhB,EAgG0B,KAhG1B,CAAA,CAAA;;QAuB0B,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,CAAA,EAuG1B,OAvG0B,CAuGlB,OAvGkB,CAAA,IAAA,EAuGJ,MAvGI,CAAA,CAAA;QAAlB,CAAA,cAAA,OAAA,GAwGoB,MAxGpB,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EA4GJ,WA5GI,CA4GQ,KA5GR,CAAA,CAAA,EA6GR,OA7GQ,CA6GA,OA7GA,CAAA,IAAA,EA6Gc,KA7Gd,CAAA,CAAA"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { createProjectBranchDatabase, deleteProjectBranchDatabase, getProjectBranchDatabase, listProjectBranchDatabases, updateProjectBranchDatabase } from "../../client/sdk.gen.js";
|
|
2
|
+
//#region src/neon/resources/databases.ts
|
|
3
|
+
/** Database resource (branch-scoped). */
|
|
4
|
+
var Databases = class {
|
|
5
|
+
#ctx;
|
|
6
|
+
constructor(ctx) {
|
|
7
|
+
this.#ctx = ctx;
|
|
8
|
+
}
|
|
9
|
+
list(projectId, branchId, opts) {
|
|
10
|
+
return this.#ctx.run(opts, (client) => listProjectBranchDatabases({
|
|
11
|
+
client,
|
|
12
|
+
path: {
|
|
13
|
+
project_id: projectId,
|
|
14
|
+
branch_id: branchId
|
|
15
|
+
},
|
|
16
|
+
throwOnError: false
|
|
17
|
+
}), (data) => data.databases);
|
|
18
|
+
}
|
|
19
|
+
get(projectId, branchId, name, opts) {
|
|
20
|
+
return this.#ctx.run(opts, (client) => getProjectBranchDatabase({
|
|
21
|
+
client,
|
|
22
|
+
path: {
|
|
23
|
+
project_id: projectId,
|
|
24
|
+
branch_id: branchId,
|
|
25
|
+
database_name: name
|
|
26
|
+
},
|
|
27
|
+
throwOnError: false
|
|
28
|
+
}), (data) => data.database);
|
|
29
|
+
}
|
|
30
|
+
create(projectId, branchId, input, opts) {
|
|
31
|
+
return this.#ctx.run(opts, (client) => createProjectBranchDatabase({
|
|
32
|
+
client,
|
|
33
|
+
path: {
|
|
34
|
+
project_id: projectId,
|
|
35
|
+
branch_id: branchId
|
|
36
|
+
},
|
|
37
|
+
body: { database: input },
|
|
38
|
+
throwOnError: false
|
|
39
|
+
}), (data) => data.database);
|
|
40
|
+
}
|
|
41
|
+
update(projectId, branchId, name, input, opts) {
|
|
42
|
+
return this.#ctx.run(opts, (client) => updateProjectBranchDatabase({
|
|
43
|
+
client,
|
|
44
|
+
path: {
|
|
45
|
+
project_id: projectId,
|
|
46
|
+
branch_id: branchId,
|
|
47
|
+
database_name: name
|
|
48
|
+
},
|
|
49
|
+
body: { database: input },
|
|
50
|
+
throwOnError: false
|
|
51
|
+
}), (data) => data.database);
|
|
52
|
+
}
|
|
53
|
+
delete(projectId, branchId, name, opts) {
|
|
54
|
+
return this.#ctx.runVoid(opts, (client) => deleteProjectBranchDatabase({
|
|
55
|
+
client,
|
|
56
|
+
path: {
|
|
57
|
+
project_id: projectId,
|
|
58
|
+
branch_id: branchId,
|
|
59
|
+
database_name: name
|
|
60
|
+
},
|
|
61
|
+
throwOnError: false
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
//#endregion
|
|
66
|
+
export { Databases };
|
|
67
|
+
|
|
68
|
+
//# sourceMappingURL=databases.js.map
|
|
@@ -0,0 +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,WACA,2BAA2B;GAC1B;GACA,MAAM;IAAE,YAAY;IAAW,WAAW;GAAS;GACnD,cAAc;EACf,CAAC,IACD,SAAS,KAAK,SAChB;CACD;CAcA,IACC,WACA,UACA,MACA,MAC2C;EAC3C,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,yBAAyB;GACxB;GACA,MAAM;IACL,YAAY;IACZ,WAAW;IACX,eAAe;GAChB;GACA,cAAc;EACf,CAAC,IACD,SAAS,KAAK,QAChB;CACD;CAcA,OACC,WACA,UACA,OACA,MAC2C;EAC3C,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,4BAA4B;GAC3B;GACA,MAAM;IAAE,YAAY;IAAW,WAAW;GAAS;GACnD,MAAM,EAAE,UAAU,MAAM;GACxB,cAAc;EACf,CAAC,IACD,SAAS,KAAK,QAChB;CACD;CAgBA,OACC,WACA,UACA,MACA,OACA,MAC2C;EAC3C,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,4BAA4B;GAC3B;GACA,MAAM;IACL,YAAY;IACZ,WAAW;IACX,eAAe;GAChB;GACA,MAAM,EAAE,UAAU,MAAM;GACxB,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,eAAe;GAChB;GACA,cAAc;EACf,CAAC,CACF;CACD;AACD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Endpoint, EndpointCreateRequest, EndpointUpdateRequest } from "../../client/types.gen.js";
|
|
2
|
+
import { Outcome } from "../result.js";
|
|
3
|
+
import { CallOptions, RequestContext } from "../context.js";
|
|
4
|
+
|
|
5
|
+
//#region src/neon/resources/endpoints.d.ts
|
|
6
|
+
type CreateInput = EndpointCreateRequest["endpoint"];
|
|
7
|
+
type UpdateInput = EndpointUpdateRequest["endpoint"];
|
|
8
|
+
/** Compute endpoint resource (project-scoped). */
|
|
9
|
+
declare class Endpoints<DThrow extends boolean> {
|
|
10
|
+
#private;
|
|
11
|
+
constructor(ctx: RequestContext);
|
|
12
|
+
/** @apiCall GET /projects/{project_id}/endpoints */
|
|
13
|
+
list(projectId: string): Promise<Outcome<Endpoint[], DThrow>>;
|
|
14
|
+
list<Throw extends boolean = DThrow>(projectId: string, opts: CallOptions<Throw>): Promise<Outcome<Endpoint[], Throw>>;
|
|
15
|
+
/** @apiCall GET /projects/{project_id}/endpoints/{endpoint_id} */
|
|
16
|
+
get(projectId: string, endpointId: string): Promise<Outcome<Endpoint, DThrow>>;
|
|
17
|
+
get<Throw extends boolean = DThrow>(projectId: string, endpointId: string, opts: CallOptions<Throw>): Promise<Outcome<Endpoint, Throw>>;
|
|
18
|
+
/** @apiCall POST /projects/{project_id}/endpoints */
|
|
19
|
+
create(projectId: string, input: CreateInput): Promise<Outcome<Endpoint, DThrow>>;
|
|
20
|
+
create<Throw extends boolean = DThrow>(projectId: string, input: CreateInput, opts: CallOptions<Throw>): Promise<Outcome<Endpoint, Throw>>;
|
|
21
|
+
/** @apiCall PATCH /projects/{project_id}/endpoints/{endpoint_id} */
|
|
22
|
+
update(projectId: string, endpointId: string, input: UpdateInput): Promise<Outcome<Endpoint, DThrow>>;
|
|
23
|
+
update<Throw extends boolean = DThrow>(projectId: string, endpointId: string, input: UpdateInput, opts: CallOptions<Throw>): Promise<Outcome<Endpoint, Throw>>;
|
|
24
|
+
/** @apiCall DELETE /projects/{project_id}/endpoints/{endpoint_id} */
|
|
25
|
+
delete(projectId: string, endpointId: string): Promise<Outcome<void, DThrow>>;
|
|
26
|
+
delete<Throw extends boolean = DThrow>(projectId: string, endpointId: string, opts: CallOptions<Throw>): Promise<Outcome<void, Throw>>;
|
|
27
|
+
/** @apiCall POST /projects/{project_id}/endpoints/{endpoint_id}/start */
|
|
28
|
+
start(projectId: string, endpointId: string): Promise<Outcome<Endpoint, DThrow>>;
|
|
29
|
+
start<Throw extends boolean = DThrow>(projectId: string, endpointId: string, opts: CallOptions<Throw>): Promise<Outcome<Endpoint, Throw>>;
|
|
30
|
+
/** @apiCall POST /projects/{project_id}/endpoints/{endpoint_id}/suspend */
|
|
31
|
+
suspend(projectId: string, endpointId: string): Promise<Outcome<Endpoint, DThrow>>;
|
|
32
|
+
suspend<Throw extends boolean = DThrow>(projectId: string, endpointId: string, opts: CallOptions<Throw>): Promise<Outcome<Endpoint, Throw>>;
|
|
33
|
+
/** @apiCall POST /projects/{project_id}/endpoints/{endpoint_id}/restart */
|
|
34
|
+
restart(projectId: string, endpointId: string): Promise<Outcome<Endpoint, DThrow>>;
|
|
35
|
+
restart<Throw extends boolean = DThrow>(projectId: string, endpointId: string, opts: CallOptions<Throw>): Promise<Outcome<Endpoint, Throw>>;
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { Endpoints };
|
|
39
|
+
//# sourceMappingURL=endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.d.ts","names":[],"sources":["../../../src/neon/resources/endpoints.ts"],"mappings":";;;;;KAkBK,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,EAG9C,WAH8C,CAGlC,KAHkC,CAAA,CAAA,EAIlD,OAJkD,CAI1C,OAJ0C,CAIlC,QAJkC,EAAA,EAItB,KAJsB,CAAA,CAAA;;KAA5B,CAAA,SAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,CAAA,EAyBtB,OAzBsB,CAyBd,OAzBc,CAyBN,QAzBM,EAyBI,MAzBJ,CAAA,CAAA;KACI,CAAA,cAAA,OAAA,GAyBD,MAzBC,CAAA,C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oints, restartProjectEndpoint, startProjectEndpoint, suspendProjectEndpoint, updateProjectEndpoint } from "../../client/sdk.gen.js";
|
|
2
|
+
//#region src/neon/resources/endpoints.ts
|
|
3
|
+
/** Compute endpoint resource (project-scoped). */
|
|
4
|
+
var Endpoints = class {
|
|
5
|
+
#ctx;
|
|
6
|
+
constructor(ctx) {
|
|
7
|
+
this.#ctx = ctx;
|
|
8
|
+
}
|
|
9
|
+
list(projectId, opts) {
|
|
10
|
+
return this.#ctx.run(opts, (client) => listProjectEndpoints({
|
|
11
|
+
client,
|
|
12
|
+
path: { project_id: projectId },
|
|
13
|
+
throwOnError: false
|
|
14
|
+
}), (data) => data.endpoints);
|
|
15
|
+
}
|
|
16
|
+
get(projectId, endpointId, opts) {
|
|
17
|
+
return this.#ctx.run(opts, (client) => getProjectEndpoint({
|
|
18
|
+
client,
|
|
19
|
+
path: {
|
|
20
|
+
project_id: projectId,
|
|
21
|
+
endpoint_id: endpointId
|
|
22
|
+
},
|
|
23
|
+
throwOnError: false
|
|
24
|
+
}), (data) => data.endpoint);
|
|
25
|
+
}
|
|
26
|
+
create(projectId, input, opts) {
|
|
27
|
+
return this.#ctx.run(opts, (client) => createProjectEndpoint({
|
|
28
|
+
client,
|
|
29
|
+
path: { project_id: projectId },
|
|
30
|
+
body: { endpoint: input },
|
|
31
|
+
throwOnError: false
|
|
32
|
+
}), (data) => data.endpoint);
|
|
33
|
+
}
|
|
34
|
+
update(projectId, endpointId, input, opts) {
|
|
35
|
+
return this.#ctx.run(opts, (client) => updateProjectEndpoint({
|
|
36
|
+
client,
|
|
37
|
+
path: {
|
|
38
|
+
project_id: projectId,
|
|
39
|
+
endpoint_id: endpointId
|
|
40
|
+
},
|
|
41
|
+
body: { endpoint: input },
|
|
42
|
+
throwOnError: false
|
|
43
|
+
}), (data) => data.endpoint);
|
|
44
|
+
}
|
|
45
|
+
delete(projectId, endpointId, opts) {
|
|
46
|
+
return this.#ctx.runVoid(opts, (client) => deleteProjectEndpoint({
|
|
47
|
+
client,
|
|
48
|
+
path: {
|
|
49
|
+
project_id: projectId,
|
|
50
|
+
endpoint_id: endpointId
|
|
51
|
+
},
|
|
52
|
+
throwOnError: false
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
start(projectId, endpointId, opts) {
|
|
56
|
+
return this.#ctx.run(opts, (client) => startProjectEndpoint({
|
|
57
|
+
client,
|
|
58
|
+
path: {
|
|
59
|
+
project_id: projectId,
|
|
60
|
+
endpoint_id: endpointId
|
|
61
|
+
},
|
|
62
|
+
throwOnError: false
|
|
63
|
+
}), (data) => data.endpoint);
|
|
64
|
+
}
|
|
65
|
+
suspend(projectId, endpointId, opts) {
|
|
66
|
+
return this.#ctx.run(opts, (client) => suspendProjectEndpoint({
|
|
67
|
+
client,
|
|
68
|
+
path: {
|
|
69
|
+
project_id: projectId,
|
|
70
|
+
endpoint_id: endpointId
|
|
71
|
+
},
|
|
72
|
+
throwOnError: false
|
|
73
|
+
}), (data) => data.endpoint);
|
|
74
|
+
}
|
|
75
|
+
restart(projectId, endpointId, opts) {
|
|
76
|
+
return this.#ctx.run(opts, (client) => restartProjectEndpoint({
|
|
77
|
+
client,
|
|
78
|
+
path: {
|
|
79
|
+
project_id: projectId,
|
|
80
|
+
endpoint_id: endpointId
|
|
81
|
+
},
|
|
82
|
+
throwOnError: false
|
|
83
|
+
}), (data) => data.endpoint);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
//#endregion
|
|
87
|
+
export { Endpoints };
|
|
88
|
+
|
|
89
|
+
//# sourceMappingURL=endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.js","names":["#ctx"],"sources":["../../../src/neon/resources/endpoints.ts"],"sourcesContent":["import {\n\tcreateProjectEndpoint,\n\tdeleteProjectEndpoint,\n\tgetProjectEndpoint,\n\tlistProjectEndpoints,\n\trestartProjectEndpoint,\n\tstartProjectEndpoint,\n\tsuspendProjectEndpoint,\n\tupdateProjectEndpoint,\n} from \"../../client/sdk.gen.js\";\nimport type {\n\tEndpoint,\n\tEndpointCreateRequest,\n\tEndpointUpdateRequest,\n} from \"../../client/types.gen.js\";\nimport type { CallOptions, RequestContext } from \"../context.js\";\nimport type { NeonResult, Outcome } from \"../result.js\";\n\ntype CreateInput = EndpointCreateRequest[\"endpoint\"];\ntype UpdateInput = EndpointUpdateRequest[\"endpoint\"];\n\n/** Compute endpoint resource (project-scoped). */\nexport class Endpoints<DThrow extends boolean> {\n\treadonly #ctx: RequestContext;\n\n\tconstructor(ctx: RequestContext) {\n\t\tthis.#ctx = ctx;\n\t}\n\n\t/** @apiCall GET /projects/{project_id}/endpoints */\n\tlist(projectId: string): Promise<Outcome<Endpoint[], DThrow>>;\n\tlist<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Endpoint[], Throw>>;\n\tlist(\n\t\tprojectId: string,\n\t\topts?: CallOptions,\n\t): Promise<Endpoint[] | NeonResult<Endpoint[]>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tlistProjectEndpoints({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.endpoints,\n\t\t);\n\t}\n\n\t/** @apiCall GET /projects/{project_id}/endpoints/{endpoint_id} */\n\tget(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t): Promise<Outcome<Endpoint, DThrow>>;\n\tget<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Endpoint, Throw>>;\n\tget(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts?: CallOptions,\n\t): Promise<Endpoint | NeonResult<Endpoint>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tgetProjectEndpoint({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, endpoint_id: endpointId },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.endpoint,\n\t\t);\n\t}\n\n\t/** @apiCall POST /projects/{project_id}/endpoints */\n\tcreate(\n\t\tprojectId: string,\n\t\tinput: CreateInput,\n\t): Promise<Outcome<Endpoint, DThrow>>;\n\tcreate<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tinput: CreateInput,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Endpoint, Throw>>;\n\tcreate(\n\t\tprojectId: string,\n\t\tinput: CreateInput,\n\t\topts?: CallOptions,\n\t): Promise<Endpoint | NeonResult<Endpoint>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tcreateProjectEndpoint({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId },\n\t\t\t\t\tbody: { endpoint: input },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.endpoint,\n\t\t);\n\t}\n\n\t/** @apiCall PATCH /projects/{project_id}/endpoints/{endpoint_id} */\n\tupdate(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\tinput: UpdateInput,\n\t): Promise<Outcome<Endpoint, DThrow>>;\n\tupdate<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\tinput: UpdateInput,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Endpoint, Throw>>;\n\tupdate(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\tinput: UpdateInput,\n\t\topts?: CallOptions,\n\t): Promise<Endpoint | NeonResult<Endpoint>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tupdateProjectEndpoint({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, endpoint_id: endpointId },\n\t\t\t\t\tbody: { endpoint: input },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.endpoint,\n\t\t);\n\t}\n\n\t/** @apiCall DELETE /projects/{project_id}/endpoints/{endpoint_id} */\n\tdelete(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t): Promise<Outcome<void, DThrow>>;\n\tdelete<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<void, Throw>>;\n\tdelete(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts?: CallOptions,\n\t): Promise<void | NeonResult<void>> {\n\t\treturn this.#ctx.runVoid(opts, (client) =>\n\t\t\tdeleteProjectEndpoint({\n\t\t\t\tclient,\n\t\t\t\tpath: { project_id: projectId, endpoint_id: endpointId },\n\t\t\t\tthrowOnError: false,\n\t\t\t}),\n\t\t);\n\t}\n\n\t/** @apiCall POST /projects/{project_id}/endpoints/{endpoint_id}/start */\n\tstart(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t): Promise<Outcome<Endpoint, DThrow>>;\n\tstart<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Endpoint, Throw>>;\n\tstart(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts?: CallOptions,\n\t): Promise<Endpoint | NeonResult<Endpoint>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tstartProjectEndpoint({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, endpoint_id: endpointId },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.endpoint,\n\t\t);\n\t}\n\n\t/** @apiCall POST /projects/{project_id}/endpoints/{endpoint_id}/suspend */\n\tsuspend(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t): Promise<Outcome<Endpoint, DThrow>>;\n\tsuspend<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Endpoint, Throw>>;\n\tsuspend(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts?: CallOptions,\n\t): Promise<Endpoint | NeonResult<Endpoint>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tsuspendProjectEndpoint({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, endpoint_id: endpointId },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.endpoint,\n\t\t);\n\t}\n\n\t/** @apiCall POST /projects/{project_id}/endpoints/{endpoint_id}/restart */\n\trestart(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t): Promise<Outcome<Endpoint, DThrow>>;\n\trestart<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Endpoint, Throw>>;\n\trestart(\n\t\tprojectId: string,\n\t\tendpointId: string,\n\t\topts?: CallOptions,\n\t): Promise<Endpoint | NeonResult<Endpoint>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\trestartProjectEndpoint({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, endpoint_id: endpointId },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.endpoint,\n\t\t);\n\t}\n}\n"],"mappings":";;;AAsBA,IAAa,YAAb,MAA+C;CAC9C;CAEA,YAAY,KAAqB;EAChC,KAAKA,OAAO;CACb;CAQA,KACC,WACA,MAC+C;EAC/C,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,qBAAqB;GACpB;GACA,MAAM,EAAE,YAAY,UAAU;GAC9B,cAAc;EACf,CAAC,IACD,SAAS,KAAK,SAChB;CACD;CAYA,IACC,WACA,YACA,MAC2C;EAC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CACD;AACD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Operation } from "../../client/types.gen.js";
|
|
2
|
+
import { Outcome } from "../result.js";
|
|
3
|
+
import { WaitForOptions } from "../wait.js";
|
|
4
|
+
import { CallOptions, RequestContext } from "../context.js";
|
|
5
|
+
import { Paginated } from "../paginate.js";
|
|
6
|
+
|
|
7
|
+
//#region src/neon/resources/operations.d.ts
|
|
8
|
+
/** Operation resource — read operations and wait for them to finish. */
|
|
9
|
+
declare class Operations<DThrow extends boolean> {
|
|
10
|
+
#private;
|
|
11
|
+
constructor(ctx: RequestContext);
|
|
12
|
+
/** @apiCall GET /projects/{project_id}/operations (cursor-paginated) */
|
|
13
|
+
list(projectId: string): Paginated<Operation>;
|
|
14
|
+
/** @apiCall GET /projects/{project_id}/operations/{operation_id} */
|
|
15
|
+
get(projectId: string, operationId: string): Promise<Outcome<Operation, DThrow>>;
|
|
16
|
+
get<Throw extends boolean = DThrow>(projectId: string, operationId: string, opts: CallOptions<Throw>): Promise<Outcome<Operation, Throw>>;
|
|
17
|
+
/**
|
|
18
|
+
* Poll until every given operation reaches a terminal `finished`/`skipped` state.
|
|
19
|
+
* The primitive behind `waitForReadiness`; use it directly with operations obtained
|
|
20
|
+
* from any source (e.g. a raw call or a create response).
|
|
21
|
+
*/
|
|
22
|
+
waitFor(operations: readonly Operation[]): Promise<Outcome<void, DThrow>>;
|
|
23
|
+
waitFor<Throw extends boolean = DThrow>(operations: readonly Operation[], opts: WaitForOptions & CallOptions<Throw>): Promise<Outcome<void, Throw>>;
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { Operations };
|
|
27
|
+
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.d.ts","names":[],"sources":["../../../src/neon/resources/operations.ts"],"mappings":";;;;;;;;cAWa;EAAA,CAAA,OAAA;EAAU,WAAA,CAAA,GAAA,EAGL,cAHK;;MAQa,CAAA,SAAA,EAAA,MAAA,CAAA,EAAV,SAAU,CAAA,SAAA,CAAA;;KAqBhB,CAAA,SAAA,EAAA,MAAA,EAAA,WAAA,EAAA,MAAA,CAAA,EAAhB,OAAgB,CAAR,OAAQ,CAAA,SAAA,EAAW,MAAX,CAAA,CAAA;KAAW,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;;;;;;SAKX,CAAA,UAAA,EAAA,SAuBU,SAvBV,EAAA,CAAA,EAuBwB,OAvBxB,CAuBgC,OAvBhC,CAAA,IAAA,EAuB8C,MAvB9C,CAAA,CAAA;SAAW,CAAA,cAAA,OAAA,GAwBE,MAxBF,CAAA,CAAA,UAAA,EAAA,SAyBR,SAzBQ,EAAA,EAAA,IAAA,EA0BvB,cA1BuB,GA0BN,WA1BM,CA0BM,KA1BN,CAAA,CAAA,EA2B3B,OA3B2B,CA2BnB,OA3BmB,CAAA,IAAA,EA2BL,KA3BK,CAAA,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { getProjectOperation, listProjectOperations } from "../../client/sdk.gen.js";
|
|
2
|
+
import { waitForOperations } from "../wait.js";
|
|
3
|
+
import { paginate } from "../paginate.js";
|
|
4
|
+
//#region src/neon/resources/operations.ts
|
|
5
|
+
/** Operation resource — read operations and wait for them to finish. */
|
|
6
|
+
var Operations = class {
|
|
7
|
+
#ctx;
|
|
8
|
+
constructor(ctx) {
|
|
9
|
+
this.#ctx = ctx;
|
|
10
|
+
}
|
|
11
|
+
/** @apiCall GET /projects/{project_id}/operations (cursor-paginated) */
|
|
12
|
+
list(projectId) {
|
|
13
|
+
return paginate((cursor, signal) => listProjectOperations({
|
|
14
|
+
client: this.#ctx.client,
|
|
15
|
+
path: { project_id: projectId },
|
|
16
|
+
query: { cursor },
|
|
17
|
+
throwOnError: false,
|
|
18
|
+
signal
|
|
19
|
+
}), (data) => ({
|
|
20
|
+
items: data?.operations ?? [],
|
|
21
|
+
cursor: data?.pagination?.cursor
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
get(projectId, operationId, opts) {
|
|
25
|
+
return this.#ctx.run(opts, (client) => getProjectOperation({
|
|
26
|
+
client,
|
|
27
|
+
path: {
|
|
28
|
+
project_id: projectId,
|
|
29
|
+
operation_id: operationId
|
|
30
|
+
},
|
|
31
|
+
throwOnError: false
|
|
32
|
+
}), (data) => data.operation);
|
|
33
|
+
}
|
|
34
|
+
async waitFor(operations, opts) {
|
|
35
|
+
const defaults = this.#ctx.defaults;
|
|
36
|
+
const shouldThrow = opts?.throwOnError ?? defaults.throwOnError;
|
|
37
|
+
const result = await waitForOperations(this.#ctx.client, operations, {
|
|
38
|
+
pollIntervalMs: opts?.pollIntervalMs ?? defaults.waitOptions.pollIntervalMs,
|
|
39
|
+
timeoutMs: opts?.timeoutMs ?? defaults.waitOptions.timeoutMs,
|
|
40
|
+
signal: opts?.signal ?? defaults.waitOptions.signal
|
|
41
|
+
});
|
|
42
|
+
if (!shouldThrow) return result;
|
|
43
|
+
if (result.error) throw result.error;
|
|
44
|
+
return result.data;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
//#endregion
|
|
48
|
+
export { Operations };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.js","names":["#ctx"],"sources":["../../../src/neon/resources/operations.ts"],"sourcesContent":["import {\n\tgetProjectOperation,\n\tlistProjectOperations,\n} from \"../../client/sdk.gen.js\";\nimport type { Operation } 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\";\nimport { type WaitForOptions, waitForOperations } from \"../wait.js\";\n\n/** Operation resource — read operations and wait for them to finish. */\nexport class Operations<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}/operations (cursor-paginated) */\n\tlist(projectId: string): Paginated<Operation> {\n\t\treturn paginate(\n\t\t\t(cursor, signal) =>\n\t\t\t\tlistProjectOperations({\n\t\t\t\t\tclient: this.#ctx.client,\n\t\t\t\t\tpath: { project_id: projectId },\n\t\t\t\t\tquery: { 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?.operations ?? [],\n\t\t\t\tcursor: data?.pagination?.cursor,\n\t\t\t}),\n\t\t);\n\t}\n\n\t/** @apiCall GET /projects/{project_id}/operations/{operation_id} */\n\tget(\n\t\tprojectId: string,\n\t\toperationId: string,\n\t): Promise<Outcome<Operation, DThrow>>;\n\tget<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\toperationId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Operation, Throw>>;\n\tget(\n\t\tprojectId: string,\n\t\toperationId: string,\n\t\topts?: CallOptions,\n\t): Promise<Operation | NeonResult<Operation>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tgetProjectOperation({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, operation_id: operationId },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data.operation,\n\t\t);\n\t}\n\n\t/**\n\t * Poll until every given operation reaches a terminal `finished`/`skipped` state.\n\t * The primitive behind `waitForReadiness`; use it directly with operations obtained\n\t * from any source (e.g. a raw call or a create response).\n\t */\n\twaitFor(operations: readonly Operation[]): Promise<Outcome<void, DThrow>>;\n\twaitFor<Throw extends boolean = DThrow>(\n\t\toperations: readonly Operation[],\n\t\topts: WaitForOptions & CallOptions<Throw>,\n\t): Promise<Outcome<void, Throw>>;\n\tasync waitFor(\n\t\toperations: readonly Operation[],\n\t\topts?: WaitForOptions & CallOptions,\n\t): Promise<void | NeonResult<void>> {\n\t\tconst defaults = this.#ctx.defaults;\n\t\tconst shouldThrow = opts?.throwOnError ?? defaults.throwOnError;\n\t\tconst result = await waitForOperations(this.#ctx.client, operations, {\n\t\t\tpollIntervalMs:\n\t\t\t\topts?.pollIntervalMs ?? defaults.waitOptions.pollIntervalMs,\n\t\t\ttimeoutMs: opts?.timeoutMs ?? defaults.waitOptions.timeoutMs,\n\t\t\tsignal: opts?.signal ?? defaults.waitOptions.signal,\n\t\t});\n\t\tif (!shouldThrow) return result;\n\t\tif (result.error) throw result.error;\n\t\treturn result.data;\n\t}\n}\n"],"mappings":";;;;;AAWA,IAAa,aAAb,MAAgD;CAC/C;CAEA,YAAY,KAAqB;EAChC,KAAKA,OAAO;CACb;;CAGA,KAAK,WAAyC;EAC7C,OAAO,UACL,QAAQ,WACR,sBAAsB;GACrB,QAAQ,KAAKA,KAAK;GAClB,MAAM,EAAE,YAAY,UAAU;GAC9B,OAAO,EAAE,OAAO;GAChB,cAAc;GACd;EACD,CAAC,IACD,UAAU;GACV,OAAO,MAAM,cAAc,CAAC;GAC5B,QAAQ,MAAM,YAAY;EAC3B,EACD;CACD;CAYA,IACC,WACA,aACA,MAC6C;EAC7C,OAAO,KAAKA,KAAK,IAChB,OACC,WACA,oBAAoB;GACnB;GACA,MAAM;IAAE,YAAY;IAAW,cAAc;GAAY;GACzD,cAAc;EACf,CAAC,IACD,SAAS,KAAK,SAChB;CACD;CAYA,MAAM,QACL,YACA,MACmC;EACnC,MAAM,WAAW,KAAKA,KAAK;EAC3B,MAAM,cAAc,MAAM,gBAAgB,SAAS;EACnD,MAAM,SAAS,MAAM,kBAAkB,KAAKA,KAAK,QAAQ,YAAY;GACpE,gBACC,MAAM,kBAAkB,SAAS,YAAY;GAC9C,WAAW,MAAM,aAAa,SAAS,YAAY;GACnD,QAAQ,MAAM,UAAU,SAAS,YAAY;EAC9C,CAAC;EACD,IAAI,CAAC,aAAa,OAAO;EACzB,IAAI,OAAO,OAAO,MAAM,OAAO;EAC/B,OAAO,OAAO;CACf;AACD"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Outcome } from "../result.js";
|
|
2
|
+
import { CallOptions, RequestContext } from "../context.js";
|
|
3
|
+
import { DataApi } from "./dataapi.js";
|
|
4
|
+
import { Databases } from "./databases.js";
|
|
5
|
+
import { Endpoints } from "./endpoints.js";
|
|
6
|
+
import { Roles } from "./roles.js";
|
|
7
|
+
|
|
8
|
+
//#region src/neon/resources/postgres.d.ts
|
|
9
|
+
/** Parameters for {@link Postgres.connectionString}. */
|
|
10
|
+
interface ConnectionStringParams {
|
|
11
|
+
projectId: string;
|
|
12
|
+
/** Defaults to the project's default branch. */
|
|
13
|
+
branchId?: string;
|
|
14
|
+
/** Defaults to the branch's read-write endpoint. */
|
|
15
|
+
endpointId?: string;
|
|
16
|
+
/** Auto-selected when the branch has exactly one database. */
|
|
17
|
+
databaseName?: string;
|
|
18
|
+
/** Auto-selected when the branch has exactly one role. */
|
|
19
|
+
roleName?: string;
|
|
20
|
+
/** Pooled connection string (default `true`). */
|
|
21
|
+
pooled?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The Postgres data plane of a branch: compute endpoints, roles, databases, the Data API,
|
|
25
|
+
* and a connection-string helper. (Grouped under `neon.postgres.*` so future top-level
|
|
26
|
+
* namespaces like `functions` / `storage` stay unambiguous.)
|
|
27
|
+
*/
|
|
28
|
+
declare class Postgres<DThrow extends boolean> {
|
|
29
|
+
#private;
|
|
30
|
+
readonly endpoints: Endpoints<DThrow>;
|
|
31
|
+
readonly roles: Roles<DThrow>;
|
|
32
|
+
readonly databases: Databases<DThrow>;
|
|
33
|
+
readonly dataApi: DataApi<DThrow>;
|
|
34
|
+
constructor(ctx: RequestContext);
|
|
35
|
+
/**
|
|
36
|
+
* Resolve a Postgres connection string. Auto-selects the default branch and the sole
|
|
37
|
+
* role/database when not specified (mirrors `@neondatabase/config`'s `fetchEnv`); returns
|
|
38
|
+
* a `client`-kind {@link NeonError} when the selection is ambiguous.
|
|
39
|
+
*/
|
|
40
|
+
connectionString(params: ConnectionStringParams): Promise<Outcome<string, DThrow>>;
|
|
41
|
+
connectionString<Throw extends boolean = DThrow>(params: ConnectionStringParams, opts: CallOptions<Throw>): Promise<Outcome<string, Throw>>;
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { ConnectionStringParams, Postgres };
|
|
45
|
+
//# sourceMappingURL=postgres.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postgres.d.ts","names":[],"sources":["../../../src/neon/resources/postgres.ts"],"mappings":";;;;;;;;;UAeiB,sBAAA;EAAA,SAAA,EAAA,MAAA;EAmBJ;EAAQ,QAAA,CAAA,EAAA,MAAA;;YACA,CAAA,EAAA,MAAA;;cACJ,CAAA,EAAA,MAAA;;UACI,CAAA,EAAA,MAAA;;QACF,CAAA,EAAA,OAAA;;;;;;;AAoBT,cAxBG,QAwBH,CAAA,eAAA,OAAA,CAAA,CAAA;UACU;WAAZ,SAAA,EAxBa,SAwBb,CAxBuB,MAwBvB,CAAA;WACoB,KAAA,EAxBX,KAwBW,CAxBL,MAwBK,CAAA;WAAhB,SAAA,EAvBS,SAuBT,CAvBmB,MAuBnB,CAAA;WAAR,OAAA,EAtBe,OAsBf,CAtBuB,MAsBvB,CAAA;EAAO,WAAA,CAAA,GAAA,EAnBO,cAmBP;;;;;;2BALD,yBACN,QAAQ,gBAAgB;2CACc,gBAChC,8BACF,YAAY,SAChB,QAAQ,gBAAgB"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { NeonError, toNeonError } from "../errors.js";
|
|
2
|
+
import { err, finalize, ok } from "../result.js";
|
|
3
|
+
import { getConnectionUri, listProjectBranchDatabases, listProjectBranchRoles, listProjectBranches } from "../../client/sdk.gen.js";
|
|
4
|
+
import { DataApi } from "./dataapi.js";
|
|
5
|
+
import { Databases } from "./databases.js";
|
|
6
|
+
import { Endpoints } from "./endpoints.js";
|
|
7
|
+
import { Roles } from "./roles.js";
|
|
8
|
+
//#region src/neon/resources/postgres.ts
|
|
9
|
+
/**
|
|
10
|
+
* The Postgres data plane of a branch: compute endpoints, roles, databases, the Data API,
|
|
11
|
+
* and a connection-string helper. (Grouped under `neon.postgres.*` so future top-level
|
|
12
|
+
* namespaces like `functions` / `storage` stay unambiguous.)
|
|
13
|
+
*/
|
|
14
|
+
var Postgres = class {
|
|
15
|
+
endpoints;
|
|
16
|
+
roles;
|
|
17
|
+
databases;
|
|
18
|
+
dataApi;
|
|
19
|
+
#ctx;
|
|
20
|
+
constructor(ctx) {
|
|
21
|
+
this.#ctx = ctx;
|
|
22
|
+
this.endpoints = new Endpoints(ctx);
|
|
23
|
+
this.roles = new Roles(ctx);
|
|
24
|
+
this.databases = new Databases(ctx);
|
|
25
|
+
this.dataApi = new DataApi(ctx);
|
|
26
|
+
}
|
|
27
|
+
async connectionString(params, opts) {
|
|
28
|
+
const shouldThrow = opts?.throwOnError ?? this.#ctx.defaults.throwOnError;
|
|
29
|
+
return finalize(await this.#resolve(params, opts?.signal), shouldThrow);
|
|
30
|
+
}
|
|
31
|
+
async #resolve(params, signal) {
|
|
32
|
+
const client = this.#ctx.client;
|
|
33
|
+
const projectId = params.projectId;
|
|
34
|
+
let branchId = params.branchId;
|
|
35
|
+
let roleName = params.roleName;
|
|
36
|
+
let databaseName = params.databaseName;
|
|
37
|
+
if ((!roleName || !databaseName) && !branchId) {
|
|
38
|
+
const branches = await listProjectBranches({
|
|
39
|
+
client,
|
|
40
|
+
path: { project_id: projectId },
|
|
41
|
+
throwOnError: false,
|
|
42
|
+
signal
|
|
43
|
+
});
|
|
44
|
+
if (branches.error || !branches.data) return err(toNeonError(branches.error, branches.response));
|
|
45
|
+
branchId = branches.data.branches.find((branch) => branch.default)?.id;
|
|
46
|
+
if (!branchId) return err(new NeonError("Could not determine the default branch; pass branchId.", "client"));
|
|
47
|
+
}
|
|
48
|
+
if (!roleName) {
|
|
49
|
+
if (!branchId) return err(branchRequired("roleName"));
|
|
50
|
+
const roles = await listProjectBranchRoles({
|
|
51
|
+
client,
|
|
52
|
+
path: {
|
|
53
|
+
project_id: projectId,
|
|
54
|
+
branch_id: branchId
|
|
55
|
+
},
|
|
56
|
+
throwOnError: false,
|
|
57
|
+
signal
|
|
58
|
+
});
|
|
59
|
+
if (roles.error || !roles.data) return err(toNeonError(roles.error, roles.response));
|
|
60
|
+
if (roles.data.roles.length !== 1) return err(ambiguous("role", roles.data.roles.length, "roleName"));
|
|
61
|
+
roleName = roles.data.roles[0].name;
|
|
62
|
+
}
|
|
63
|
+
if (!databaseName) {
|
|
64
|
+
if (!branchId) return err(branchRequired("databaseName"));
|
|
65
|
+
const databases = await listProjectBranchDatabases({
|
|
66
|
+
client,
|
|
67
|
+
path: {
|
|
68
|
+
project_id: projectId,
|
|
69
|
+
branch_id: branchId
|
|
70
|
+
},
|
|
71
|
+
throwOnError: false,
|
|
72
|
+
signal
|
|
73
|
+
});
|
|
74
|
+
if (databases.error || !databases.data) return err(toNeonError(databases.error, databases.response));
|
|
75
|
+
if (databases.data.databases.length !== 1) return err(ambiguous("database", databases.data.databases.length, "databaseName"));
|
|
76
|
+
databaseName = databases.data.databases[0].name;
|
|
77
|
+
}
|
|
78
|
+
const conn = await getConnectionUri({
|
|
79
|
+
client,
|
|
80
|
+
path: { project_id: projectId },
|
|
81
|
+
query: {
|
|
82
|
+
branch_id: branchId,
|
|
83
|
+
endpoint_id: params.endpointId,
|
|
84
|
+
database_name: databaseName,
|
|
85
|
+
role_name: roleName,
|
|
86
|
+
pooled: params.pooled ?? true
|
|
87
|
+
},
|
|
88
|
+
throwOnError: false,
|
|
89
|
+
signal
|
|
90
|
+
});
|
|
91
|
+
if (conn.error || !conn.data) return err(toNeonError(conn.error, conn.response));
|
|
92
|
+
return ok(conn.data.uri);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
function branchRequired(param) {
|
|
96
|
+
return new NeonError(`Pass branchId or ${param} to resolve a connection string.`, "client");
|
|
97
|
+
}
|
|
98
|
+
function ambiguous(kind, count, param) {
|
|
99
|
+
return new NeonError(`Expected exactly one ${kind} to auto-select for the connection string; found ${count}. Pass ${param}.`, "client");
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
export { Postgres };
|
|
103
|
+
|
|
104
|
+
//# sourceMappingURL=postgres.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postgres.js","names":["#ctx","#resolve"],"sources":["../../../src/neon/resources/postgres.ts"],"sourcesContent":["import {\n\tgetConnectionUri,\n\tlistProjectBranchDatabases,\n\tlistProjectBranches,\n\tlistProjectBranchRoles,\n} from \"../../client/sdk.gen.js\";\nimport type { CallOptions, RequestContext } from \"../context.js\";\nimport { NeonError, toNeonError } from \"../errors.js\";\nimport { err, finalize, type NeonResult, type Outcome, ok } from \"../result.js\";\nimport { DataApi } from \"./dataapi.js\";\nimport { Databases } from \"./databases.js\";\nimport { Endpoints } from \"./endpoints.js\";\nimport { Roles } from \"./roles.js\";\n\n/** Parameters for {@link Postgres.connectionString}. */\nexport interface ConnectionStringParams {\n\tprojectId: string;\n\t/** Defaults to the project's default branch. */\n\tbranchId?: string;\n\t/** Defaults to the branch's read-write endpoint. */\n\tendpointId?: string;\n\t/** Auto-selected when the branch has exactly one database. */\n\tdatabaseName?: string;\n\t/** Auto-selected when the branch has exactly one role. */\n\troleName?: string;\n\t/** Pooled connection string (default `true`). */\n\tpooled?: boolean;\n}\n\n/**\n * The Postgres data plane of a branch: compute endpoints, roles, databases, the Data API,\n * and a connection-string helper. (Grouped under `neon.postgres.*` so future top-level\n * namespaces like `functions` / `storage` stay unambiguous.)\n */\nexport class Postgres<DThrow extends boolean> {\n\treadonly endpoints: Endpoints<DThrow>;\n\treadonly roles: Roles<DThrow>;\n\treadonly databases: Databases<DThrow>;\n\treadonly dataApi: DataApi<DThrow>;\n\treadonly #ctx: RequestContext;\n\n\tconstructor(ctx: RequestContext) {\n\t\tthis.#ctx = ctx;\n\t\tthis.endpoints = new Endpoints<DThrow>(ctx);\n\t\tthis.roles = new Roles<DThrow>(ctx);\n\t\tthis.databases = new Databases<DThrow>(ctx);\n\t\tthis.dataApi = new DataApi<DThrow>(ctx);\n\t}\n\n\t/**\n\t * Resolve a Postgres connection string. Auto-selects the default branch and the sole\n\t * role/database when not specified (mirrors `@neondatabase/config`'s `fetchEnv`); returns\n\t * a `client`-kind {@link NeonError} when the selection is ambiguous.\n\t */\n\tconnectionString(\n\t\tparams: ConnectionStringParams,\n\t): Promise<Outcome<string, DThrow>>;\n\tconnectionString<Throw extends boolean = DThrow>(\n\t\tparams: ConnectionStringParams,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<string, Throw>>;\n\tasync connectionString(\n\t\tparams: ConnectionStringParams,\n\t\topts?: CallOptions,\n\t): Promise<string | NeonResult<string>> {\n\t\tconst shouldThrow =\n\t\t\topts?.throwOnError ?? this.#ctx.defaults.throwOnError;\n\t\treturn finalize(await this.#resolve(params, opts?.signal), shouldThrow);\n\t}\n\n\tasync #resolve(\n\t\tparams: ConnectionStringParams,\n\t\tsignal?: AbortSignal,\n\t): Promise<NeonResult<string>> {\n\t\tconst client = this.#ctx.client;\n\t\tconst projectId = params.projectId;\n\t\tlet branchId = params.branchId;\n\t\tlet roleName = params.roleName;\n\t\tlet databaseName = params.databaseName;\n\n\t\tif ((!roleName || !databaseName) && !branchId) {\n\t\t\tconst branches = await listProjectBranches({\n\t\t\t\tclient,\n\t\t\t\tpath: { project_id: projectId },\n\t\t\t\tthrowOnError: false,\n\t\t\t\tsignal,\n\t\t\t});\n\t\t\tif (branches.error || !branches.data) {\n\t\t\t\treturn err(toNeonError(branches.error, branches.response));\n\t\t\t}\n\t\t\tbranchId = branches.data.branches.find(\n\t\t\t\t(branch) => branch.default,\n\t\t\t)?.id;\n\t\t\tif (!branchId) {\n\t\t\t\treturn err(\n\t\t\t\t\tnew NeonError(\n\t\t\t\t\t\t\"Could not determine the default branch; pass branchId.\",\n\t\t\t\t\t\t\"client\",\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (!roleName) {\n\t\t\tif (!branchId) return err(branchRequired(\"roleName\"));\n\t\t\tconst roles = await listProjectBranchRoles({\n\t\t\t\tclient,\n\t\t\t\tpath: { project_id: projectId, branch_id: branchId },\n\t\t\t\tthrowOnError: false,\n\t\t\t\tsignal,\n\t\t\t});\n\t\t\tif (roles.error || !roles.data)\n\t\t\t\treturn err(toNeonError(roles.error, roles.response));\n\t\t\tif (roles.data.roles.length !== 1) {\n\t\t\t\treturn err(\n\t\t\t\t\tambiguous(\"role\", roles.data.roles.length, \"roleName\"),\n\t\t\t\t);\n\t\t\t}\n\t\t\troleName = roles.data.roles[0].name;\n\t\t}\n\n\t\tif (!databaseName) {\n\t\t\tif (!branchId) return err(branchRequired(\"databaseName\"));\n\t\t\tconst databases = await listProjectBranchDatabases({\n\t\t\t\tclient,\n\t\t\t\tpath: { project_id: projectId, branch_id: branchId },\n\t\t\t\tthrowOnError: false,\n\t\t\t\tsignal,\n\t\t\t});\n\t\t\tif (databases.error || !databases.data) {\n\t\t\t\treturn err(toNeonError(databases.error, databases.response));\n\t\t\t}\n\t\t\tif (databases.data.databases.length !== 1) {\n\t\t\t\treturn err(\n\t\t\t\t\tambiguous(\n\t\t\t\t\t\t\"database\",\n\t\t\t\t\t\tdatabases.data.databases.length,\n\t\t\t\t\t\t\"databaseName\",\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t\tdatabaseName = databases.data.databases[0].name;\n\t\t}\n\n\t\tconst conn = await getConnectionUri({\n\t\t\tclient,\n\t\t\tpath: { project_id: projectId },\n\t\t\tquery: {\n\t\t\t\tbranch_id: branchId,\n\t\t\t\tendpoint_id: params.endpointId,\n\t\t\t\tdatabase_name: databaseName,\n\t\t\t\trole_name: roleName,\n\t\t\t\tpooled: params.pooled ?? true,\n\t\t\t},\n\t\t\tthrowOnError: false,\n\t\t\tsignal,\n\t\t});\n\t\tif (conn.error || !conn.data)\n\t\t\treturn err(toNeonError(conn.error, conn.response));\n\t\treturn ok(conn.data.uri);\n\t}\n}\n\nfunction branchRequired(param: string): NeonError {\n\treturn new NeonError(\n\t\t`Pass branchId or ${param} to resolve a connection string.`,\n\t\t\"client\",\n\t);\n}\n\nfunction ambiguous(kind: string, count: number, param: string): NeonError {\n\treturn new NeonError(\n\t\t`Expected exactly one ${kind} to auto-select for the connection string; found ${count}. Pass ${param}.`,\n\t\t\"client\",\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;AAkCA,IAAa,WAAb,MAA8C;CAC7C;CACA;CACA;CACA;CACA;CAEA,YAAY,KAAqB;EAChC,KAAKA,OAAO;EACZ,KAAK,YAAY,IAAI,UAAkB,GAAG;EAC1C,KAAK,QAAQ,IAAI,MAAc,GAAG;EAClC,KAAK,YAAY,IAAI,UAAkB,GAAG;EAC1C,KAAK,UAAU,IAAI,QAAgB,GAAG;CACvC;CAcA,MAAM,iBACL,QACA,MACuC;EACvC,MAAM,cACL,MAAM,gBAAgB,KAAKA,KAAK,SAAS;EAC1C,OAAO,SAAS,MAAM,KAAKC,SAAS,QAAQ,MAAM,MAAM,GAAG,WAAW;CACvE;CAEA,MAAMA,SACL,QACA,QAC8B;EAC9B,MAAM,SAAS,KAAKD,KAAK;EACzB,MAAM,YAAY,OAAO;EACzB,IAAI,WAAW,OAAO;EACtB,IAAI,WAAW,OAAO;EACtB,IAAI,eAAe,OAAO;EAE1B,KAAK,CAAC,YAAY,CAAC,iBAAiB,CAAC,UAAU;GAC9C,MAAM,WAAW,MAAM,oBAAoB;IAC1C;IACA,MAAM,EAAE,YAAY,UAAU;IAC9B,cAAc;IACd;GACD,CAAC;GACD,IAAI,SAA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;GACd;EACD,CAAC;EACD,IAAI,KAAK,SAAS,CAAC,KAAK,MACvB,OAAO,IAAI,YAAY,KAAK,OAAO,KAAK,QAAQ,CAAC;EAClD,OAAO,GAAG,KAAK,KAAK,GAAG;CACxB;AACD;AAEA,SAAS,eAAe,OAA0B;CACjD,OAAO,IAAI,UACV,oBAAoB,MAAM,mCAC1B,QACD;AACD;AAEA,SAAS,UAAU,MAAc,OAAe,OAA0B;CACzE,OAAO,IAAI,UACV,wBAAwB,KAAK,mDAAmD,MAAM,SAAS,MAAM,IACrG,QACD;AACD"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ListProjectsData, Project, ProjectCreateRequest, ProjectListItem, ProjectUpdateRequest } 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/projects.d.ts
|
|
7
|
+
/** Input for {@link Projects.transfer} (org → org). */
|
|
8
|
+
interface TransferProjectsInput {
|
|
9
|
+
/** Source org. Defaults to the client's `orgId`. */
|
|
10
|
+
fromOrgId?: string;
|
|
11
|
+
/** Destination org. */
|
|
12
|
+
toOrgId: string;
|
|
13
|
+
projectIds: string[];
|
|
14
|
+
}
|
|
15
|
+
type ListQuery = Omit<NonNullable<ListProjectsData["query"]>, "cursor">;
|
|
16
|
+
type CreateInput = ProjectCreateRequest["project"];
|
|
17
|
+
type UpdateInput = ProjectUpdateRequest["project"];
|
|
18
|
+
/** Per-call options for the connect workflow. */
|
|
19
|
+
interface WorkflowOptions<Throw extends boolean> extends CallOptions<Throw> {
|
|
20
|
+
/** Return a pooled connection string (default `true`). */
|
|
21
|
+
pooled?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** A project with a ready-to-use connection string to its default branch. */
|
|
24
|
+
interface ProjectConnection {
|
|
25
|
+
project: Project;
|
|
26
|
+
connectionString: string;
|
|
27
|
+
}
|
|
28
|
+
/** Project resource — one API call per method (`list` is cursor-paginated). */
|
|
29
|
+
declare class Projects<DThrow extends boolean> {
|
|
30
|
+
#private;
|
|
31
|
+
constructor(ctx: RequestContext);
|
|
32
|
+
/**
|
|
33
|
+
* List projects (cursor-paginated). Returns a lazy list — `await .all()`, `.page()`,
|
|
34
|
+
* or `for await (… of …)`.
|
|
35
|
+
*
|
|
36
|
+
* @apiCall GET /projects
|
|
37
|
+
*/
|
|
38
|
+
list(query?: ListQuery): Paginated<ProjectListItem>;
|
|
39
|
+
/** @apiCall GET /projects/{project_id} */
|
|
40
|
+
get(id: string): Promise<Outcome<Project, DThrow>>;
|
|
41
|
+
get<Throw extends boolean = DThrow>(id: string, opts: CallOptions<Throw>): Promise<Outcome<Project, Throw>>;
|
|
42
|
+
/** @apiCall POST /projects */
|
|
43
|
+
create(input?: CreateInput): Promise<Outcome<Project, DThrow>>;
|
|
44
|
+
create<Throw extends boolean = DThrow>(input: CreateInput | undefined, opts: CallOptions<Throw>): Promise<Outcome<Project, Throw>>;
|
|
45
|
+
/**
|
|
46
|
+
* Create a project and return a ready-to-use connection string to its default branch.
|
|
47
|
+
* One API call plus readiness polling (the create response already carries the
|
|
48
|
+
* connection URI).
|
|
49
|
+
*
|
|
50
|
+
* @workflow createProject + waitForReadiness
|
|
51
|
+
*/
|
|
52
|
+
createAndConnect(input?: CreateInput): Promise<Outcome<ProjectConnection, DThrow>>;
|
|
53
|
+
createAndConnect<Throw extends boolean = DThrow>(input: CreateInput | undefined, opts: WorkflowOptions<Throw>): Promise<Outcome<ProjectConnection, Throw>>;
|
|
54
|
+
/** @apiCall PATCH /projects/{project_id} */
|
|
55
|
+
update(id: string, input: UpdateInput): Promise<Outcome<Project, DThrow>>;
|
|
56
|
+
update<Throw extends boolean = DThrow>(id: string, input: UpdateInput, opts: CallOptions<Throw>): Promise<Outcome<Project, Throw>>;
|
|
57
|
+
/** @apiCall DELETE /projects/{project_id} */
|
|
58
|
+
delete(id: string): Promise<Outcome<Project, DThrow>>;
|
|
59
|
+
delete<Throw extends boolean = DThrow>(id: string, opts: CallOptions<Throw>): Promise<Outcome<Project, Throw>>;
|
|
60
|
+
/**
|
|
61
|
+
* Transfer projects from one organization to another (e.g. sponsored → paid). The
|
|
62
|
+
* source org defaults to the client's `orgId`. Requires a key with access to both orgs.
|
|
63
|
+
*
|
|
64
|
+
* @apiCall POST /organizations/{source_org_id}/projects/transfer
|
|
65
|
+
*/
|
|
66
|
+
transfer(input: TransferProjectsInput): Promise<Outcome<void, DThrow>>;
|
|
67
|
+
transfer<Throw extends boolean = DThrow>(input: TransferProjectsInput, opts: CallOptions<Throw>): Promise<Outcome<void, Throw>>;
|
|
68
|
+
/**
|
|
69
|
+
* Transfer projects from the personal account to an organization.
|
|
70
|
+
*
|
|
71
|
+
* @apiCall POST /users/me/projects/transfer
|
|
72
|
+
*/
|
|
73
|
+
transferFromUser(input: {
|
|
74
|
+
toOrgId: string;
|
|
75
|
+
projectIds: string[];
|
|
76
|
+
}): Promise<Outcome<void, DThrow>>;
|
|
77
|
+
transferFromUser<Throw extends boolean = DThrow>(input: {
|
|
78
|
+
toOrgId: string;
|
|
79
|
+
projectIds: string[];
|
|
80
|
+
}, opts: CallOptions<Throw>): Promise<Outcome<void, Throw>>;
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
export { ProjectConnection, Projects, TransferProjectsInput };
|
|
84
|
+
//# sourceMappingURL=projects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projects.d.ts","names":[],"sources":["../../../src/neon/resources/projects.ts"],"mappings":";;;;;;;UAuBiB,qBAAA;EAAA;EAQZ,SAAA,CAAA,EAAS,MAAA;EAAA;SAAoB,EAAA,MAAA;YAAZ,EAAA,MAAA,EAAA;;AAAD,KAAhB,SAAA,GAAY,IAAI,CAAC,WAAD,CAAa,gBAAb,CAAA,OAAA,CAAA,CAAA,EAAA,QAAA,CAAA;AAAA,KAChB,WAA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