2
0

(sheets) Add rows filtering to update multiple rows at the same time

This commit is contained in:
Baptiste Arnaud
2023-05-04 14:00:50 -04:00
parent 035dded654
commit 55db360200
6 changed files with 168 additions and 91 deletions

View File

@ -38,8 +38,9 @@ const initialGoogleSheetsOptionsSchema = googleSheetsOptionsBaseSchema.merge(
const googleSheetsGetOptionsSchema = googleSheetsOptionsBaseSchema.merge(
z.object({
action: z.enum([GoogleSheetsAction.GET]),
// TODO: remove referenceCell once migrated to filtering
referenceCell: cellSchema.optional(),
referenceCell: cellSchema
.optional()
.describe('Deprecated. Use `filter` instead.'),
filter: z
.object({
comparisons: z.array(rowsFilterComparisonSchema),
@ -61,7 +62,15 @@ const googleSheetsUpdateRowOptionsSchema = googleSheetsOptionsBaseSchema.merge(
z.object({
action: z.enum([GoogleSheetsAction.UPDATE_ROW]),
cellsToUpsert: z.array(cellSchema),
referenceCell: cellSchema.optional(),
referenceCell: cellSchema
.optional()
.describe('Deprecated. Use `filter` instead.'),
filter: z
.object({
comparisons: z.array(rowsFilterComparisonSchema),
logicalOperator: z.nativeEnum(LogicalOperator),
})
.optional(),
})
)