@clxmedia/types 1.0.28 → 1.0.30

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' | 'BOOLEAN' | 'FILE' | 'DATE' | 'SCHEDULE' | 'ANY';
24
- export type CLXFormFieldType = 'text' | 'textarea' | 'boolean' | 'select' | 'multiselect' | 'file' | 'date' | 'schedule';
23
+ export type CLXFormResponseType = 'STRING' | 'NUMBER' | 'STRING_ARRAY' | 'CONTACT' | 'CONTACT_ARRAY' | 'BOOLEAN' | 'FILE' | 'DATE' | 'SCHEDULE' | 'ANY';
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 = {
27
27
  value: string;
@@ -49,6 +49,11 @@ export type CLXFormDateTime = {
49
49
  iso_date_time: string;
50
50
  zone: string;
51
51
  };
52
+ export type CLXContactCard = {
53
+ name: string | null;
54
+ email: string | null;
55
+ phone: string | null;
56
+ };
52
57
  export type CLXFormResponseStringValue = CLXFormResponseValueBase & {
53
58
  type: 'STRING';
54
59
  value: string;
@@ -89,7 +94,15 @@ export type CLXFormResponseAnyValue = CLXFormResponseValueBase & {
89
94
  type: 'ANY';
90
95
  value: any;
91
96
  };
92
- export type CLXFormResponseValue = CLXFormResponseStringValue | CLXFormResponseStringArrayValue | CLXFormResponseNumberValue | CLXFormResponseDateValue | CLXFormResponseScheduleValue | CLXFormResponseFileValue | CLXFormResponseBooleanValue | CLXFormResponseAnyValue;
97
+ export type CLXFormResponseContactValue = CLXFormResponseValueBase & {
98
+ type: 'CONTACT';
99
+ value: CLXContactCard;
100
+ };
101
+ export type CLXFormResponseContactArrayValue = CLXFormResponseValueBase & {
102
+ type: 'CONTACT_ARRAY';
103
+ value: CLXContactCard[];
104
+ };
105
+ export type CLXFormResponseValue = CLXFormResponseStringValue | CLXFormResponseStringArrayValue | CLXFormResponseNumberValue | CLXFormResponseDateValue | CLXFormResponseContactValue | CLXFormResponseContactArrayValue | CLXFormResponseScheduleValue | CLXFormResponseFileValue | CLXFormResponseBooleanValue | CLXFormResponseAnyValue;
93
106
  export type CLXFormResponses = {
94
107
  [questionSlug: string]: CLXFormResponseValue;
95
108
  };
@@ -134,6 +147,19 @@ export type CLXFileFormField = CLXFormField & {
134
147
  max_files?: number;
135
148
  allowed_file_types?: CLXFormFieldFileTypes[];
136
149
  };
150
+ export type CLXContactFormFieldBase = CLXFormField & {
151
+ type: 'contact';
152
+ response_type: 'CONTACT' | 'CONTACT_ARRAY';
153
+ allow_multiple: boolean;
154
+ };
155
+ export type CLXContactFormField = CLXContactFormFieldBase & {
156
+ response_type: 'CONTACT';
157
+ allow_multiple: false;
158
+ };
159
+ export type CLXMultipleContactFormField = CLXContactFormFieldBase & {
160
+ response_type: 'CONTACT_ARRAY';
161
+ allow_multiple: true;
162
+ };
137
163
  export type CLXDateFormField = CLXFormField & {
138
164
  type: 'date';
139
165
  response_type: 'DATE';
@@ -189,7 +215,7 @@ export type CLXMultiSelectFormField = CLXSelectableFormField & {
189
215
  max_select?: number;
190
216
  };
191
217
  export type CLXFormQuestionResponseOptions = {
192
- field: CLXTextFormField | CLXNumberFormField | CLXDateFormField | CLXScheduleFormField | CLXFileFormField | CLXTextAreaFormField | CLXBooleanFormField | CLXSelectFormField | CLXMultiSelectFormField | CLXMultipleTextFormField;
218
+ field: CLXTextFormField | CLXNumberFormField | CLXDateFormField | CLXScheduleFormField | CLXContactFormField | CLXMultipleContactFormField | CLXFileFormField | CLXTextAreaFormField | CLXBooleanFormField | CLXSelectFormField | CLXMultiSelectFormField | CLXMultipleTextFormField;
193
219
  has_parent?: boolean;
194
220
  };
195
221
  export type CLXFormQuestion = {
@@ -204,7 +230,7 @@ export type CLXFormQuestions = {
204
230
  export type CLXRuleComparison = 'stringEquals' | 'stringContains' | 'stringStartsWith' | 'stringEndsWith' | 'stringInList' | 'stringListEntryEquals' | 'stringListEntryContains' | 'stringListEntryStartsWith' | 'stringListEntryEndsWith' | 'dateEquals' | 'dateBefore' | 'dateAfter' | 'booleanEquals' | 'fileExists' | 'numberEquals' | 'numberGreaterThan' | 'numberLessThan';
205
231
  export type CLXFormRuleDefinition = {
206
232
  subject: string;
207
- predicate: CLXFormResponseValue;
233
+ target: CLXFormResponseValue;
208
234
  comparison: CLXRuleComparison;
209
235
  };
210
236
  export type CLXConditionalOverride = {
@@ -213,42 +239,42 @@ export type CLXConditionalOverride = {
213
239
  };
214
240
  export type CLXFormRuleInstanceBase = {
215
241
  subject: CLXFormResponseValue;
216
- predicate: CLXFormResponseValue;
242
+ target: CLXFormResponseValue;
217
243
  comparisonType: CLXRuleComparison;
218
244
  };
219
245
  export type CLXFormRuleStringComparisonInstance = CLXFormRuleInstanceBase & {
220
246
  subject: CLXFormResponseStringValue;
221
- predicate: CLXFormResponseStringValue;
247
+ target: CLXFormResponseStringValue;
222
248
  comparisonType: 'stringEquals' | 'stringContains' | 'stringStartsWith' | 'stringEndsWith';
223
249
  };
224
250
  export type CLXFormRuleStringInListInstance = CLXFormRuleInstanceBase & {
225
251
  subject: CLXFormResponseStringValue;
226
- predicate: CLXFormResponseStringArrayValue;
252
+ target: CLXFormResponseStringArrayValue;
227
253
  comparisonType: 'stringInList';
228
254
  };
229
255
  export type CLXFormRuleFileExistsInstance = CLXFormRuleInstanceBase & {
230
256
  subject: CLXFormResponseFileValue;
231
- predicate: CLXFormResponseBooleanValue;
257
+ target: CLXFormResponseBooleanValue;
232
258
  comparisonType: 'fileExists';
233
259
  };
234
260
  export type CLXFormRuleDateComparisonInstance = CLXFormRuleInstanceBase & {
235
261
  subject: CLXFormResponseDateValue;
236
- predicate: CLXFormResponseDateValue;
262
+ target: CLXFormResponseDateValue;
237
263
  comparisonType: 'dateEquals' | 'dateBefore' | 'dateAfter';
238
264
  };
239
265
  export type CLXFormRuleStringListComparisonInstance = CLXFormRuleInstanceBase & {
240
266
  subject: CLXFormResponseStringArrayValue;
241
- predicate: CLXFormResponseStringValue;
267
+ target: CLXFormResponseStringValue;
242
268
  comparisonType: 'stringListEntryEquals' | 'stringListEntryContains' | 'stringListEntryStartsWith' | 'stringListEntryEndsWith';
243
269
  };
244
270
  export type CLXFormRuleBooleanEqualsInstance = CLXFormRuleInstanceBase & {
245
271
  subject: CLXFormResponseBooleanValue;
246
- predicate: CLXFormResponseBooleanValue;
272
+ target: CLXFormResponseBooleanValue;
247
273
  comparisonType: 'booleanEquals';
248
274
  };
249
275
  export type CLXFormRuleNumberComparisonInstance = CLXFormRuleInstanceBase & {
250
276
  subject: CLXFormResponseNumberValue;
251
- predicate: CLXFormResponseNumberValue;
277
+ target: CLXFormResponseNumberValue;
252
278
  comparisonType: 'numberEquals' | 'numberGreaterThan' | 'numberLessThan';
253
279
  };
254
280
  export type CLXFormRuleInstance = CLXFormRuleStringComparisonInstance | CLXFormRuleStringInListInstance | CLXFormRuleFileExistsInstance | CLXFormRuleDateComparisonInstance | CLXFormRuleStringListComparisonInstance | CLXFormRuleBooleanEqualsInstance | CLXFormRuleNumberComparisonInstance;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clxmedia/types",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "description": "Conversion Logix TypeScript type definitions",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",