Skip to content

Commit 6652cb5

Browse files
fix(NOJIRA-123): fix Action.condition type (#50)
* fix(types): fix Condition.op, Condition.vars type The Create API allows for the logical operators 'and' and 'or' to used as the operator for a condition. https://developer.typeform.com/create/logic-jumps/#best-practices-for-logic-jumps * fix(types): Use proper Array union type syntax
1 parent 3348493 commit 6652cb5

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/typeform-types.ts

+14-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export namespace Typeform {
1616
* Conditions for executing the Logic Jump. Conditions answer the question, "Under what circumstances?"
1717
* The condition object is the IF statement in your Logic Jump.
1818
*/
19-
condition?: Condition
19+
condition?: Condition | AndOrOperator
2020
}
2121
/**
2222
* Properties that further specify how the Logic Jump will behave.
@@ -198,6 +198,19 @@ export namespace Typeform {
198198
value?: any
199199
}[]
200200
}
201+
/**
202+
* Conditions for a logic jump can be combined using the `and` and `or` operators
203+
*/
204+
export interface AndOrOperator {
205+
/**
206+
* Operator for the condition.
207+
*/
208+
op?: 'and' | 'or'
209+
/**
210+
* Object that defines the field type and value to evaluate with the operator.
211+
*/
212+
vars: Array<AndOrOperator | Condition>
213+
}
201214
/**
202215
* Generic document.
203216
*/

0 commit comments

Comments
 (0)