(key: IntegrationTaskKey, records: { fields: Partial<TFields> }[])
| 73 | } |
| 74 | |
| 75 | createRecords(key: IntegrationTaskKey, records: { fields: Partial<TFields> }[]) { |
| 76 | return this.runTask( |
| 77 | key, |
| 78 | async (client) => { |
| 79 | const result = await client |
| 80 | .base(this.baseId) |
| 81 | // official types are wrong - we need to use our extended AirtableFieldSet here |
| 82 | // @ts-ignore |
| 83 | .table<TFields>(this.tableName) |
| 84 | .create(records); |
| 85 | return result.map((record) => toSerializableRecord<TFields>(record)); |
| 86 | }, |
| 87 | { |
| 88 | name: "Create Records", |
| 89 | params: records, |
| 90 | properties: [ |
| 91 | ...tableParams({ baseId: this.baseId, tableName: this.tableName }), |
| 92 | { label: "Created records", text: records.length.toString() }, |
| 93 | ], |
| 94 | } |
| 95 | ); |
| 96 | } |
| 97 | |
| 98 | updateRecords(key: IntegrationTaskKey, records: { id: string; fields: Partial<TFields> }[]) { |
| 99 | return this.runTask( |
no test coverage detected