fix: getRecords action page→take/skip + prisma engine fix + CLI fixes
- 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
This commit is contained in:
Vendored
+15
-5
@@ -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
|
||||
|
||||
Vendored
+6
-4
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user