@clxmedia/types 1.0.35 → 1.0.37

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.
@@ -20,7 +20,7 @@ export type CLXForm = {
20
20
  name: string;
21
21
  description?: string;
22
22
  };
23
- export type CLXFormResponseType = 'STRING' | 'NUMBER' | 'STRING_ARRAY' | 'CONTACT' | 'CONTACT_ARRAY' | 'BOOLEAN' | 'FILE' | 'DATE' | 'SCHEDULE' | 'ANY';
23
+ export type CLXFormResponseType = 'STRING' | 'NUMBER' | 'STRING_ARRAY' | 'CONTACT' | 'CONTACT_ARRAY' | 'BOOLEAN' | 'FILE' | 'DATE' | 'SCHEDULE' | 'COMPOUND' | 'ANY';
24
24
  export type CLXFormFieldType = 'text' | 'textarea' | 'boolean' | 'select' | 'multiselect' | 'file' | 'contact' | 'date' | 'schedule';
25
25
  export type CLXFormSelectType = 'select' | 'radio' | 'checkbox' | 'freeform';
26
26
  export type CLXFormConditionSubjectEntry = {
@@ -90,6 +90,14 @@ export type CLXFormResponseStringArrayValue = CLXFormResponseValueBase & {
90
90
  type: 'STRING_ARRAY';
91
91
  value: string[];
92
92
  };
93
+ export type CLXFormResponseCompoundValue = CLXFormResponseValueBase & {
94
+ type: 'COMPOUND';
95
+ value: {
96
+ [key: string]: {
97
+ [innerKey: string]: CLXFormResponseStringValue | CLXFormResponseNumberValue | CLXFormResponseDateValue | CLXFormResponseBooleanValue;
98
+ };
99
+ };
100
+ };
93
101
  export type CLXFormResponseAnyValue = CLXFormResponseValueBase & {
94
102
  type: 'ANY';
95
103
  value: any;
@@ -102,7 +110,7 @@ export type CLXFormResponseContactArrayValue = CLXFormResponseValueBase & {
102
110
  type: 'CONTACT_ARRAY';
103
111
  value: CLXContactCard[];
104
112
  };
105
- export type CLXFormResponseValue = CLXFormResponseStringValue | CLXFormResponseStringArrayValue | CLXFormResponseNumberValue | CLXFormResponseDateValue | CLXFormResponseContactValue | CLXFormResponseContactArrayValue | CLXFormResponseScheduleValue | CLXFormResponseFileValue | CLXFormResponseBooleanValue | CLXFormResponseAnyValue;
113
+ export type CLXFormResponseValue = CLXFormResponseStringValue | CLXFormResponseStringArrayValue | CLXFormResponseNumberValue | CLXFormResponseDateValue | CLXFormResponseContactValue | CLXFormResponseContactArrayValue | CLXFormResponseCompoundValue | CLXFormResponseScheduleValue | CLXFormResponseFileValue | CLXFormResponseBooleanValue | CLXFormResponseAnyValue;
106
114
  export type CLXFormResponses = {
107
115
  [questionSlug: string]: CLXFormResponseValue;
108
116
  };
@@ -216,8 +224,20 @@ export type CLXMultiSelectFormField = CLXSelectableFormField & {
216
224
  options: CLXFormSelectOptions;
217
225
  max_select?: number;
218
226
  };
227
+ export type CLXCompoundableFormField = (CLXTextFormField | CLXNumberFormField | CLXDateFormField | CLXFileFormField | CLXTextAreaFormField | CLXBooleanFormField | CLXSelectFormField | CLXMultiSelectFormField) & {
228
+ slug: string;
229
+ label: string;
230
+ is_required?: boolean;
231
+ };
232
+ export type CLXCompoundFormField = CLXSelectableFormField & {
233
+ type: 'multiselect';
234
+ response_type: 'COMPOUND';
235
+ options: CLXFormSelectOptions;
236
+ compound_fields: CLXCompoundableFormField[];
237
+ max_select?: number;
238
+ };
219
239
  export type CLXFormQuestionResponseOptions = {
220
- field: CLXTextFormField | CLXNumberFormField | CLXDateFormField | CLXScheduleFormField | CLXContactFormField | CLXMultipleContactFormField | CLXFileFormField | CLXTextAreaFormField | CLXBooleanFormField | CLXSelectFormField | CLXMultiSelectFormField | CLXMultipleTextFormField;
240
+ field: CLXTextFormField | CLXNumberFormField | CLXDateFormField | CLXScheduleFormField | CLXContactFormField | CLXMultipleContactFormField | CLXFileFormField | CLXCompoundFormField | CLXTextAreaFormField | CLXBooleanFormField | CLXSelectFormField | CLXMultiSelectFormField | CLXMultipleTextFormField;
221
241
  has_parent?: boolean;
222
242
  };
223
243
  export type CLXFormQuestion = {
@@ -235,10 +255,6 @@ export type CLXFormRuleDefinition = {
235
255
  target: CLXFormResponseValue;
236
256
  comparison: CLXRuleComparison;
237
257
  };
238
- export type CLXConditionalOverride = {
239
- rule: CLXFormRuleDefinition;
240
- override: any;
241
- };
242
258
  export type CLXFormRuleInstanceBase = {
243
259
  subject: CLXFormResponseValue;
244
260
  target: CLXFormResponseValue;
@@ -289,8 +305,14 @@ export type CLXFormRuleSet = {
289
305
  rules: (CLXFormRuleDefinition | CLXFormRuleSet)[];
290
306
  combinator?: 'and' | 'or';
291
307
  };
308
+ export type CLXConditionalOverride = {
309
+ ruleset: CLXFormRuleSet;
310
+ override: any;
311
+ };
292
312
  export type CLXConditionalOverrides = {
293
- max_select_override?: CLXConditionalOverride[];
313
+ max_select_override?: (CLXConditionalOverride & {
314
+ override: number;
315
+ })[];
294
316
  };
295
317
  export type CLXFormQuestionLayout = {
296
318
  id: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clxmedia/types",
3
- "version": "1.0.35",
3
+ "version": "1.0.37",
4
4
  "description": "Conversion Logix TypeScript type definitions",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",