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);
|
(0, output_1.printJson)(table);
|
||||||
else {
|
else {
|
||||||
const t = table;
|
const t = table;
|
||||||
(0, output_1.printKv)([['id', t.id], ['name', t.name]]);
|
(0, output_1.printKv)([
|
||||||
|
['id', t.id],
|
||||||
|
['name', t.name],
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
cmd
|
cmd
|
||||||
@@ -197,7 +200,11 @@ function fieldCmd() {
|
|||||||
(0, output_1.printJson)(field);
|
(0, output_1.printJson)(field);
|
||||||
else {
|
else {
|
||||||
const f = field;
|
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
|
cmd
|
||||||
@@ -364,8 +371,7 @@ function recordCmd() {
|
|||||||
.split(',')
|
.split(',')
|
||||||
.map((s) => s.trim())
|
.map((s) => s.trim())
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
const body = { records: ids };
|
const result = await ctx.client.deleteRecords(opts.tableId, ids);
|
||||||
const result = await ctx.client.deleteRecord(opts.tableId, body);
|
|
||||||
if (ctx.json)
|
if (ctx.json)
|
||||||
(0, output_1.printJson)(result);
|
(0, output_1.printJson)(result);
|
||||||
else
|
else
|
||||||
@@ -428,7 +434,11 @@ function viewCmd() {
|
|||||||
(0, output_1.printJson)(view);
|
(0, output_1.printJson)(view);
|
||||||
else {
|
else {
|
||||||
const v = view;
|
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
|
cmd
|
||||||
|
|||||||
Vendored
+6
-4
@@ -59,8 +59,9 @@ class Client {
|
|||||||
updateTable(tableId, body) {
|
updateTable(tableId, body) {
|
||||||
return this.call('PUT', `/api/table/${tableId}`, body);
|
return this.call('PUT', `/api/table/${tableId}`, body);
|
||||||
}
|
}
|
||||||
deleteTable(tableId) {
|
deleteTable(tableId, baseId) {
|
||||||
return this.call('DELETE', `/api/table/${tableId}`);
|
const base = baseId ?? this.cfg.baseId;
|
||||||
|
return this.call('DELETE', `/api/base/${base}/table/${tableId}`);
|
||||||
}
|
}
|
||||||
// ---- field ----
|
// ---- field ----
|
||||||
listFields(tableId) {
|
listFields(tableId) {
|
||||||
@@ -116,8 +117,9 @@ class Client {
|
|||||||
updateRecordOne(recordId, body) {
|
updateRecordOne(recordId, body) {
|
||||||
return this.call('PATCH', `/api/record/${recordId}`, body);
|
return this.call('PATCH', `/api/record/${recordId}`, body);
|
||||||
}
|
}
|
||||||
deleteRecord(tableId, body) {
|
deleteRecords(tableId, recordIds) {
|
||||||
return this.call('DELETE', `/api/table/${tableId}/record`, body);
|
const qs = recordIds.map((id) => `recordIds=${encodeURIComponent(id)}`).join('&');
|
||||||
|
return this.call('DELETE', `/api/table/${tableId}/record?${qs}`);
|
||||||
}
|
}
|
||||||
// ---- view ----
|
// ---- view ----
|
||||||
listViews(tableId) {
|
listViews(tableId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user