postgresai 0.16.0-dev.4 → 0.16.0-dev.5
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/bun.lock +4 -4
- package/dist/bin/postgres-ai.js +4 -4
- package/lib/dblab.ts +8 -2
- package/package.json +1 -1
- package/test/dblab.test.ts +7 -0
package/bun.lock
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"name": "postgresai",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@modelcontextprotocol/sdk": "^1.20.2",
|
|
9
|
-
"commander": "^
|
|
9
|
+
"commander": "^12.1.0",
|
|
10
10
|
"js-yaml": "^4.1.0",
|
|
11
11
|
"pg": "^8.16.3",
|
|
12
12
|
},
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@types/pg": "^8.15.6",
|
|
17
17
|
"ajv": "^8.17.1",
|
|
18
18
|
"ajv-formats": "^3.0.1",
|
|
19
|
-
"typescript": "^
|
|
19
|
+
"typescript": "^5.9.3",
|
|
20
20
|
},
|
|
21
21
|
},
|
|
22
22
|
},
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
|
|
52
52
|
"call-bound": ["call-bound@1.0.4", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" } }, "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg=="],
|
|
53
53
|
|
|
54
|
-
"commander": ["commander@
|
|
54
|
+
"commander": ["commander@12.1.0", "", {}, "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA=="],
|
|
55
55
|
|
|
56
56
|
"content-disposition": ["content-disposition@1.0.0", "", { "dependencies": { "safe-buffer": "5.2.1" } }, "sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg=="],
|
|
57
57
|
|
|
@@ -233,7 +233,7 @@
|
|
|
233
233
|
|
|
234
234
|
"type-is": ["type-is@2.0.1", "", { "dependencies": { "content-type": "^1.0.5", "media-typer": "^1.1.0", "mime-types": "^3.0.0" } }, "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw=="],
|
|
235
235
|
|
|
236
|
-
"typescript": ["typescript@
|
|
236
|
+
"typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
|
|
237
237
|
|
|
238
238
|
"undici-types": ["undici-types@5.26.5", "", {}, "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="],
|
|
239
239
|
|
package/dist/bin/postgres-ai.js
CHANGED
|
@@ -13425,7 +13425,7 @@ var {
|
|
|
13425
13425
|
// package.json
|
|
13426
13426
|
var package_default = {
|
|
13427
13427
|
name: "postgresai",
|
|
13428
|
-
version: "0.16.0-dev.
|
|
13428
|
+
version: "0.16.0-dev.5",
|
|
13429
13429
|
description: "postgres_ai CLI",
|
|
13430
13430
|
license: "Apache-2.0",
|
|
13431
13431
|
private: false,
|
|
@@ -16256,7 +16256,7 @@ var Result = import_lib.default.Result;
|
|
|
16256
16256
|
var TypeOverrides = import_lib.default.TypeOverrides;
|
|
16257
16257
|
var defaults = import_lib.default.defaults;
|
|
16258
16258
|
// package.json
|
|
16259
|
-
var version = "0.16.0-dev.
|
|
16259
|
+
var version = "0.16.0-dev.5";
|
|
16260
16260
|
var package_default2 = {
|
|
16261
16261
|
name: "postgresai",
|
|
16262
16262
|
version,
|
|
@@ -17847,7 +17847,7 @@ async function destroySnapshot(params) {
|
|
|
17847
17847
|
const { apiKey, apiBaseUrl, instanceId, snapshotId, force, debug } = params;
|
|
17848
17848
|
if (!snapshotId)
|
|
17849
17849
|
throw new Error("snapshotId is required");
|
|
17850
|
-
const action = `/snapshot/${
|
|
17850
|
+
const action = `/snapshot/${snapshotId}?force=${Boolean(force)}`;
|
|
17851
17851
|
return callDblabApi({
|
|
17852
17852
|
apiKey,
|
|
17853
17853
|
apiBaseUrl,
|
|
@@ -27585,7 +27585,7 @@ async function destroySnapshot2(params) {
|
|
|
27585
27585
|
const { apiKey, apiBaseUrl, instanceId, snapshotId, force, debug } = params;
|
|
27586
27586
|
if (!snapshotId)
|
|
27587
27587
|
throw new Error("snapshotId is required");
|
|
27588
|
-
const action = `/snapshot/${
|
|
27588
|
+
const action = `/snapshot/${snapshotId}?force=${Boolean(force)}`;
|
|
27589
27589
|
return callDblabApi2({
|
|
27590
27590
|
apiKey,
|
|
27591
27591
|
apiBaseUrl,
|
package/lib/dblab.ts
CHANGED
|
@@ -415,11 +415,17 @@ export interface DestroySnapshotParams extends DblabCommon {
|
|
|
415
415
|
force?: boolean;
|
|
416
416
|
}
|
|
417
417
|
|
|
418
|
-
/** Destroy a snapshot — `/snapshot/<id>?force=<bool>` DELETE (Console `destroySnapshot`).
|
|
418
|
+
/** Destroy a snapshot — `/snapshot/<id>?force=<bool>` DELETE (Console `destroySnapshot`).
|
|
419
|
+
*
|
|
420
|
+
* The snapshot id is a MULTI-SEGMENT zfs path (`pool/branch/<b>/<clone>/r0@snap`),
|
|
421
|
+
* which the DBLab engine routes as a wildcard path — it must be passed RAW,
|
|
422
|
+
* exactly as the Console does. `encodeURIComponent` here turned `/`→`%2F` and
|
|
423
|
+
* `@`→`%40`, which the engine rejects with 400 `invalid snapshot name given`
|
|
424
|
+
* (verified live against DBLab CE 4.1.3). */
|
|
419
425
|
export async function destroySnapshot<T = unknown>(params: DestroySnapshotParams): Promise<T> {
|
|
420
426
|
const { apiKey, apiBaseUrl, instanceId, snapshotId, force, debug } = params;
|
|
421
427
|
if (!snapshotId) throw new Error("snapshotId is required");
|
|
422
|
-
const action = `/snapshot/${
|
|
428
|
+
const action = `/snapshot/${snapshotId}?force=${Boolean(force)}`;
|
|
423
429
|
return callDblabApi<T>({
|
|
424
430
|
apiKey, apiBaseUrl, instanceId,
|
|
425
431
|
action, method: "delete",
|
package/package.json
CHANGED
package/test/dblab.test.ts
CHANGED
|
@@ -302,6 +302,13 @@ describe("snapshot verbs → dblab_api_call", () => {
|
|
|
302
302
|
expect(b.method).toBe("delete");
|
|
303
303
|
});
|
|
304
304
|
|
|
305
|
+
test("destroySnapshot passes a multi-segment zfs snapshot id RAW (no percent-encoding)", async () => {
|
|
306
|
+
const cap = stubFetch(true);
|
|
307
|
+
await destroySnapshot({ ...common, snapshotId: "dblab_pool/branch/main/c-1/r0@20260707065703" });
|
|
308
|
+
// The engine 400s on %2F/%40 — the Console passes the id raw and so must we.
|
|
309
|
+
expect(bodyOf(cap.get()).action).toBe("/snapshot/dblab_pool/branch/main/c-1/r0@20260707065703?force=false");
|
|
310
|
+
});
|
|
311
|
+
|
|
305
312
|
test("destroySnapshot defaults force=false", async () => {
|
|
306
313
|
const cap = stubFetch(true);
|
|
307
314
|
await destroySnapshot({ ...common, snapshotId: "s-1" });
|