@clxmedia/types 1.0.37 → 1.0.39

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,8 +20,8 @@ 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' | 'COMPOUND' | 'ANY';
24
- export type CLXFormFieldType = 'text' | 'textarea' | 'boolean' | 'select' | 'multiselect' | 'file' | 'contact' | 'date' | 'schedule';
23
+ export type CLXFormResponseType = 'STRING' | 'NUMBER' | 'STRING_ARRAY' | 'CONTACT' | 'CONTACT_ARRAY' | 'BOOLEAN' | 'FILE' | 'DATE' | 'SCHEDULE' | 'COMPOUND' | 'MULTI_COMPOUND' | 'ANY';
24
+ export type CLXFormFieldType = 'text' | 'textarea' | 'boolean' | 'select' | 'multiselect' | 'file' | 'contact' | 'date' | 'schedule' | 'compound';
25
25
  export type CLXFormSelectType = 'select' | 'radio' | 'checkbox' | 'freeform';
26
26
  export type CLXFormConditionSubjectEntry = {
27
27
  value: string;
@@ -90,10 +90,16 @@ export type CLXFormResponseStringArrayValue = CLXFormResponseValueBase & {
90
90
  type: 'STRING_ARRAY';
91
91
  value: string[];
92
92
  };
93
- export type CLXFormResponseCompoundValue = CLXFormResponseValueBase & {
93
+ export type CLXFormResponseSingleCompoundValue = CLXFormResponseValueBase & {
94
94
  type: 'COMPOUND';
95
95
  value: {
96
- [key: string]: {
96
+ [innerKey: string]: CLXFormResponseStringValue | CLXFormResponseNumberValue | CLXFormResponseDateValue | CLXFormResponseBooleanValue;
97
+ };
98
+ };
99
+ export type CLXFormResponseCompoundValue = CLXFormResponseValueBase & {
100
+ type: 'MULTI_COMPOUND';
101
+ value: {
102
+ [outerKey: string]: {
97
103
  [innerKey: string]: CLXFormResponseStringValue | CLXFormResponseNumberValue | CLXFormResponseDateValue | CLXFormResponseBooleanValue;
98
104
  };
99
105
  };
@@ -110,7 +116,7 @@ export type CLXFormResponseContactArrayValue = CLXFormResponseValueBase & {
110
116
  type: 'CONTACT_ARRAY';
111
117
  value: CLXContactCard[];
112
118
  };
113
- export type CLXFormResponseValue = CLXFormResponseStringValue | CLXFormResponseStringArrayValue | CLXFormResponseNumberValue | CLXFormResponseDateValue | CLXFormResponseContactValue | CLXFormResponseContactArrayValue | CLXFormResponseCompoundValue | CLXFormResponseScheduleValue | CLXFormResponseFileValue | CLXFormResponseBooleanValue | CLXFormResponseAnyValue;
119
+ export type CLXFormResponseValue = CLXFormResponseStringValue | CLXFormResponseStringArrayValue | CLXFormResponseNumberValue | CLXFormResponseDateValue | CLXFormResponseContactValue | CLXFormResponseContactArrayValue | CLXFormResponseCompoundValue | CLXFormResponseSingleCompoundValue | CLXFormResponseScheduleValue | CLXFormResponseFileValue | CLXFormResponseBooleanValue | CLXFormResponseAnyValue;
114
120
  export type CLXFormResponses = {
115
121
  [questionSlug: string]: CLXFormResponseValue;
116
122
  };
@@ -231,13 +237,18 @@ export type CLXCompoundableFormField = (CLXTextFormField | CLXNumberFormField |
231
237
  };
232
238
  export type CLXCompoundFormField = CLXSelectableFormField & {
233
239
  type: 'multiselect';
234
- response_type: 'COMPOUND';
240
+ response_type: 'MULTI_COMPOUND';
235
241
  options: CLXFormSelectOptions;
236
242
  compound_fields: CLXCompoundableFormField[];
237
243
  max_select?: number;
238
244
  };
245
+ export type CLXSingleCompoundFormField = CLXFormField & {
246
+ type: 'compound';
247
+ response_type: 'COMPOUND';
248
+ compound_fields: CLXCompoundableFormField[];
249
+ };
239
250
  export type CLXFormQuestionResponseOptions = {
240
- field: CLXTextFormField | CLXNumberFormField | CLXDateFormField | CLXScheduleFormField | CLXContactFormField | CLXMultipleContactFormField | CLXFileFormField | CLXCompoundFormField | CLXTextAreaFormField | CLXBooleanFormField | CLXSelectFormField | CLXMultiSelectFormField | CLXMultipleTextFormField;
251
+ field: CLXTextFormField | CLXNumberFormField | CLXDateFormField | CLXScheduleFormField | CLXContactFormField | CLXMultipleContactFormField | CLXSingleCompoundFormField | CLXFileFormField | CLXCompoundFormField | CLXTextAreaFormField | CLXBooleanFormField | CLXSelectFormField | CLXMultiSelectFormField | CLXMultipleTextFormField;
241
252
  has_parent?: boolean;
242
253
  };
243
254
  export type CLXFormQuestion = {
@@ -341,6 +352,14 @@ export type CLXFormStep = {
341
352
  sections: CLXFormSection[];
342
353
  conditions?: CLXFormRuleSet;
343
354
  };
355
+ export type FormStatCount = {
356
+ complete: number;
357
+ total: number;
358
+ };
359
+ export type FormStats = {
360
+ optional: FormStatCount;
361
+ required: FormStatCount;
362
+ };
344
363
  export type CLXFormLayout = {
345
364
  form: {
346
365
  slug: string;
@@ -348,7 +367,5 @@ export type CLXFormLayout = {
348
367
  description?: string;
349
368
  };
350
369
  steps: CLXFormStep[];
351
- completedCount?: number;
352
- totalCount?: number;
353
- updated_at?: number;
370
+ stats?: FormStats;
354
371
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clxmedia/types",
3
- "version": "1.0.37",
3
+ "version": "1.0.39",
4
4
  "description": "Conversion Logix TypeScript type definitions",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",