2
0

(setVariable) Add Pop and Shift items

This commit is contained in:
Baptiste Arnaud
2024-06-27 08:22:22 +02:00
parent a1b5e59124
commit 8ec0fbdebf
5 changed files with 75 additions and 1 deletions

View File

@@ -15,6 +15,8 @@ export const valueTypes = [
'Random ID',
'Moment of the day',
'Map item with same index',
'Pop',
'Shift',
'Phone number',
'Contact name',
] as const

View File

@@ -25,6 +25,11 @@ const basicSetVariableOptionsSchema = baseOptions.extend({
]),
})
const popOrShiftSetVariableOptionsSchema = baseOptions.extend({
type: z.enum(['Pop', 'Shift']),
saveItemInVariableId: z.string().optional(),
})
const dateSetVariableOptionsSchema = baseOptions.extend({
type: z.enum(['Now', 'Yesterday', 'Tomorrow']),
timeZone: z.string().optional(),
@@ -65,6 +70,7 @@ export const setVariableOptionsSchema = z.discriminatedUnion('type', [
customSetVariableOptionsSchema,
mapListItemsOptionsSchema,
appendItemToListOptionsSchema,
popOrShiftSetVariableOptionsSchema,
])
export const setVariableBlockSchema = blockBaseSchema.merge(