@shushed/helpers 0.0.247-airtable-helper-views-20260130114104 → 0.0.247-airtable-helper-views-20260130115721
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.
|
@@ -425,11 +425,13 @@ class AirtableHelper extends runtime_1.default {
|
|
|
425
425
|
nextCursor = res.cursor;
|
|
426
426
|
this.logging.log(`Received ${res.payloads.length} records from the table: ${this.tableId}.`);
|
|
427
427
|
for (const payload of res.payloads) {
|
|
428
|
-
|
|
429
|
-
|
|
428
|
+
const changes = this.viewId
|
|
429
|
+
? payload.changedViewsById?.[this.viewId]
|
|
430
|
+
: payload.changedTablesById?.[this.tableId]
|
|
431
|
+
|| Object.values(payload.changedTablesById || {})[0];
|
|
430
432
|
const airtableCreated = Object.entries(changes?.createdRecordsById || {}).map(([k, v]) => ({
|
|
431
433
|
id: k,
|
|
432
|
-
fields: AirtableHelper.translateFields(this.dictionary, { fields:
|
|
434
|
+
fields: AirtableHelper.translateFields(this.dictionary, { fields: v.cellValuesByFieldId || {} }).fields,
|
|
433
435
|
created_at: v.createdTime || payload.timestamp,
|
|
434
436
|
last_modified_at: v.createdTime || payload.timestamp,
|
|
435
437
|
previous_fields: null
|
|
@@ -23,9 +23,7 @@ declare class AirtableHelper<T extends Record<string, string>, K extends keyof T
|
|
|
23
23
|
viewId?: string;
|
|
24
24
|
});
|
|
25
25
|
static translateFields<T extends Record<string, string>, S extends {
|
|
26
|
-
fields:
|
|
27
|
-
[key in T[keyof T]]: any;
|
|
28
|
-
};
|
|
26
|
+
fields: Record<string, any>;
|
|
29
27
|
}>(dictionary: T, y: S): S & {
|
|
30
28
|
fields: {
|
|
31
29
|
[key in keyof T]: any;
|