@shushed/helpers 0.0.262 → 0.0.263-fix-airtable-20260213104643
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.
|
@@ -421,7 +421,11 @@ class AirtableHelper extends runtime_1.default {
|
|
|
421
421
|
let collectedRecords = [];
|
|
422
422
|
let resp = null;
|
|
423
423
|
try {
|
|
424
|
-
|
|
424
|
+
const payloadsUrl = new URL(`https://api.airtable.com/v0/bases/${this.baseId}/webhooks/${input.webhook.id}/payloads`);
|
|
425
|
+
if (startingCursor) {
|
|
426
|
+
payloadsUrl.searchParams.set('cursor', String(startingCursor));
|
|
427
|
+
}
|
|
428
|
+
resp = await fetch(payloadsUrl.toString(), {
|
|
425
429
|
method: 'GET',
|
|
426
430
|
headers: {
|
|
427
431
|
'Authorization': 'Bearer ' + this.apiKey,
|
|
@@ -450,7 +454,7 @@ class AirtableHelper extends runtime_1.default {
|
|
|
450
454
|
this.logging.log(`Received ${res.payloads.length} records from the ${scope}.`);
|
|
451
455
|
for (const payload of res.payloads) {
|
|
452
456
|
const changes = this.viewId
|
|
453
|
-
? payload.changedViewsById?.[this.viewId]
|
|
457
|
+
? payload.changedTablesById?.[this.tableId]?.changedViewsById?.[this.viewId]
|
|
454
458
|
: payload.changedTablesById?.[this.tableId];
|
|
455
459
|
const airtableCreated = Object.entries(changes?.createdRecordsById || {}).map(([k, v]) => ({
|
|
456
460
|
id: k,
|