2
0

🐛 Attempt to fix load crash on UC Browser

This commit is contained in:
Baptiste Arnaud
2023-02-25 19:15:43 +01:00
parent c889f302f6
commit 5dd87554c3
11 changed files with 33 additions and 25 deletions

View File

@ -1,6 +1,5 @@
import { z } from 'zod'
import { ComparisonOperators, LogicalOperator } from '../../logic/condition'
import { createId } from '@paralleldrive/cuid2'
import { IntegrationBlockType } from '../enums'
import { GoogleSheetsAction } from './enums'
import { blockBaseSchema } from '../../baseSchemas'
@ -72,7 +71,9 @@ export const googleSheetsBlockSchema = blockBaseSchema.and(
export const defaultGoogleSheetsOptions: GoogleSheetsOptions = {}
export const defaultGoogleSheetsGetOptions: GoogleSheetsGetOptions = {
export const defaultGoogleSheetsGetOptions = (
createId: () => string
): GoogleSheetsGetOptions => ({
action: GoogleSheetsAction.GET,
cellsToExtract: [
{
@ -87,25 +88,29 @@ export const defaultGoogleSheetsGetOptions: GoogleSheetsGetOptions = {
],
logicalOperator: LogicalOperator.AND,
},
}
})
export const defaultGoogleSheetsInsertOptions: GoogleSheetsInsertRowOptions = {
export const defaultGoogleSheetsInsertOptions = (
createId: () => string
): GoogleSheetsInsertRowOptions => ({
action: GoogleSheetsAction.INSERT_ROW,
cellsToInsert: [
{
id: createId(),
},
],
}
})
export const defaultGoogleSheetsUpdateOptions: GoogleSheetsUpdateRowOptions = {
export const defaultGoogleSheetsUpdateOptions = (
createId: () => string
): GoogleSheetsUpdateRowOptions => ({
action: GoogleSheetsAction.UPDATE_ROW,
cellsToUpsert: [
{
id: createId(),
},
],
}
})
export type GoogleSheetsBlock = z.infer<typeof googleSheetsBlockSchema>
export type GoogleSheetsOptions = z.infer<typeof googleSheetsOptionsSchema>