From e1d6b03a6135beec258e6072d5831848d6ee2b1c Mon Sep 17 00:00:00 2001 From: yeuimu <2197651308@qq.com> Date: Fri, 7 Aug 2026 16:55:18 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20getRecords=20action=20page=E2=86=92take/?= =?UTF-8?q?skip=20+=20prisma=20engine=20fix=20+=20CLI=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - getRecords automation action: translate page/pageSize to skip/take before calling the records API (which ignores page/pageSize, causing pagination to always return first 100 records) - Add postbuild script to restore correct prisma engine binary after nest build (which generates an incompatible engine causing SIGSEGV) - CLI fixes (from earlier commits): - deleteRecords: query params instead of JSON body - deleteTable: add /base/{baseId} prefix --- dist/bin.js | 0 dist/commands/resources.js | 20 +++++++++++++++----- dist/lib/client.js | 10 ++++++---- 3 files changed, 21 insertions(+), 9 deletions(-) mode change 100644 => 100755 dist/bin.js diff --git a/dist/bin.js b/dist/bin.js old mode 100644 new mode 100755 diff --git a/dist/commands/resources.js b/dist/commands/resources.js index a397053..93e7264 100644 --- a/dist/commands/resources.js +++ b/dist/commands/resources.js @@ -110,7 +110,10 @@ function tableCmd() { (0, output_1.printJson)(table); else { const t = table; - (0, output_1.printKv)([['id', t.id], ['name', t.name]]); + (0, output_1.printKv)([ + ['id', t.id], + ['name', t.name], + ]); } })); cmd @@ -197,7 +200,11 @@ function fieldCmd() { (0, output_1.printJson)(field); else { const f = field; - (0, output_1.printKv)([['id', f.id], ['name', f.name], ['type', f.type]]); + (0, output_1.printKv)([ + ['id', f.id], + ['name', f.name], + ['type', f.type], + ]); } })); cmd @@ -364,8 +371,7 @@ function recordCmd() { .split(',') .map((s) => s.trim()) .filter(Boolean); - const body = { records: ids }; - const result = await ctx.client.deleteRecord(opts.tableId, body); + const result = await ctx.client.deleteRecords(opts.tableId, ids); if (ctx.json) (0, output_1.printJson)(result); else @@ -428,7 +434,11 @@ function viewCmd() { (0, output_1.printJson)(view); else { const v = view; - (0, output_1.printKv)([['id', v.id], ['name', v.name], ['type', v.type]]); + (0, output_1.printKv)([ + ['id', v.id], + ['name', v.name], + ['type', v.type], + ]); } })); cmd diff --git a/dist/lib/client.js b/dist/lib/client.js index 46f6966..01af9b4 100644 --- a/dist/lib/client.js +++ b/dist/lib/client.js @@ -59,8 +59,9 @@ class Client { updateTable(tableId, body) { return this.call('PUT', `/api/table/${tableId}`, body); } - deleteTable(tableId) { - return this.call('DELETE', `/api/table/${tableId}`); + deleteTable(tableId, baseId) { + const base = baseId ?? this.cfg.baseId; + return this.call('DELETE', `/api/base/${base}/table/${tableId}`); } // ---- field ---- listFields(tableId) { @@ -116,8 +117,9 @@ class Client { updateRecordOne(recordId, body) { return this.call('PATCH', `/api/record/${recordId}`, body); } - deleteRecord(tableId, body) { - return this.call('DELETE', `/api/table/${tableId}/record`, body); + deleteRecords(tableId, recordIds) { + const qs = recordIds.map((id) => `recordIds=${encodeURIComponent(id)}`).join('&'); + return this.call('DELETE', `/api/table/${tableId}/record?${qs}`); } // ---- view ---- listViews(tableId) {