oro-sdk 3.10.0 → 3.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,53 @@ export declare function filterTriggeredAnsweredWithKind(workflowData: WorkflowDa
11
11
  */
12
12
  export declare function getWorkflowDataByCategory(workflowData: WorkflowData, category: MetadataCategory): Promise<PopulatedWorkflowData>;
13
13
  export declare function getImagesFromIndexDb(answer: SelectedAnswerData): Promise<WorkflowUploadedImage[]>;
14
- export declare function isTriggered(triggers: string[], answers: string[]): boolean;
14
+ /**
15
+ * Determine if a question is triggered by some answers
16
+ *
17
+ * We use the following logical combinations of rules:
18
+ *
19
+ * #### Single string
20
+ *
21
+ * ```
22
+ * // Required: rule1
23
+ * rules: rule1
24
+ * ```
25
+ *
26
+ * #### Array of strings (AND is applied between statements):
27
+ *
28
+ * ```
29
+ * // Required: rule1 AND rule2
30
+ * rules: [ rule1, rule2 ]
31
+ * ```
32
+ *
33
+ * #### Array of arrays of strings (OR is applied between inner arrays. AND is applied between inner arrays statements)
34
+ *
35
+ * ```
36
+ * // Required: rule1 OR rule2
37
+ * rules: [
38
+ * [ rule1 ],
39
+ * [ rule2 ]
40
+ * ]
41
+ *
42
+ * // Required: rule1 OR (rule2 AND rule3)
43
+ * rules: [
44
+ * [ rule1 ],
45
+ * [ rule2, rule3 ]
46
+ * ]
47
+ *
48
+ * // THIS IS FORBIDDEN
49
+ * rules: [
50
+ * rule1, // <-- THIS IS FORBIDDEN. Instead use [ rule1 ]
51
+ * [ rule2, rule3 ]
52
+ * ]
53
+ * ```
54
+ *
55
+ * @param triggers the triggering rules
56
+ * @param answers the answers to check againts triggering rules
57
+ * @returns `true` if triggers are verified against ansers. Otherwise, returns `false`.
58
+ * @throws an Error if triggers typing is wrong
59
+ */
60
+ export declare function isTriggered(triggers: string[][] | string[] | string, answers: string[]): boolean;
15
61
  export declare function flattenSelectedAnswers(answers: SelectedAnswersData): string[];
16
62
  /**
17
63
  * This function helps you to get a valid workflow selectedAnswers structure