@clxmedia/types 1.13.1 → 1.14.1

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.
@@ -52,8 +52,8 @@ export type CLXForm = {
52
52
  description?: string;
53
53
  settings?: CLXFormSettings;
54
54
  };
55
- export type CLXFormResponseType = "STRING" | "NUMBER" | "STRING_ARRAY" | "GRID" | "CONTACT" | "CONTACT_ARRAY" | "BOOLEAN" | "FILE" | "DATE" | "SCHEDULE" | "COMPOUND" | "MULTI_COMPOUND" | "ANY";
56
- export type CLXFormFieldType = "text" | "textarea" | "credential" | "grid" | "boolean" | "select" | "multiselect" | "file" | "contact" | "date" | "schedule" | "compound";
55
+ export type CLXFormResponseType = "STRING" | "NUMBER" | "STRING_ARRAY" | "GRID" | "CONTACT" | "CONTACT_ARRAY" | "ENTITY" | "ENTITY_ARRAY" | "BOOLEAN" | "FILE" | "DATE" | "SCHEDULE" | "COMPOUND" | "MULTI_COMPOUND" | "ANY";
56
+ export type CLXFormFieldType = "text" | "textarea" | "credential" | "grid" | "boolean" | "select" | "multiselect" | "file" | "contact" | "entity" | "date" | "schedule" | "compound";
57
57
  export type CLXFormSelectType = "select" | "radio" | "checkbox" | "freeform";
58
58
  export type CLXFormConditionSubjectEntry = {
59
59
  value: string;
@@ -93,6 +93,11 @@ export type CLXContactCard = {
93
93
  email: string | null;
94
94
  phone: string | null;
95
95
  };
96
+ export type CLXEntityCard = {
97
+ master_id: number;
98
+ name: string;
99
+ type: 'portfolio' | 'property' | 'person';
100
+ };
96
101
  export type CLXGridColumnType = "string" | "number" | "boolean";
97
102
  export type CLXGridColumn = {
98
103
  title: string;
@@ -167,11 +172,19 @@ export type CLXFormResponseContactArrayValue = CLXFormResponseValueBase & {
167
172
  type: "CONTACT_ARRAY";
168
173
  value: CLXContactCard[];
169
174
  };
175
+ export type CLXFormResponseEntityValue = CLXFormResponseValueBase & {
176
+ type: "ENTITY";
177
+ value: CLXEntityCard;
178
+ };
179
+ export type CLXFormResponseEntityArrayValue = CLXFormResponseValueBase & {
180
+ type: "ENTITY_ARRAY";
181
+ value: CLXEntityCard[];
182
+ };
170
183
  export type CLXFormResponseGridValue = CLXFormResponseValueBase & {
171
184
  type: "GRID";
172
185
  value: CLXGridData;
173
186
  };
174
- export type CLXFormResponseValue = CLXFormResponseStringValue | CLXFormResponseStringArrayValue | CLXFormResponseNumberValue | CLXFormResponseDateValue | CLXFormResponseGridValue | CLXFormResponseContactValue | CLXFormResponseContactArrayValue | CLXFormResponseCompoundValue | CLXFormResponseSingleCompoundValue | CLXFormResponseScheduleValue | CLXFormResponseFileValue | CLXFormResponseBooleanValue | CLXFormResponseAnyValue;
187
+ export type CLXFormResponseValue = CLXFormResponseStringValue | CLXFormResponseStringArrayValue | CLXFormResponseNumberValue | CLXFormResponseDateValue | CLXFormResponseGridValue | CLXFormResponseContactValue | CLXFormResponseContactArrayValue | CLXFormResponseEntityValue | CLXFormResponseEntityArrayValue | CLXFormResponseCompoundValue | CLXFormResponseSingleCompoundValue | CLXFormResponseScheduleValue | CLXFormResponseFileValue | CLXFormResponseBooleanValue | CLXFormResponseAnyValue;
175
188
  export type CLXFormResponses = {
176
189
  [questionSlug: string]: CLXFormResponseValue;
177
190
  };
@@ -244,6 +257,20 @@ export type CLXMultipleContactFormField = CLXContactFormFieldBase & {
244
257
  response_type: "CONTACT_ARRAY";
245
258
  allow_multiple: true;
246
259
  };
260
+ export type CLXEntityFormFieldBase = CLXFormField & {
261
+ type: "entity";
262
+ response_type: "ENTITY" | "ENTITY_ARRAY";
263
+ allow_multiple: boolean;
264
+ types?: ('portfolio' | 'property' | 'person')[];
265
+ };
266
+ export type CLXEntityFormField = CLXEntityFormFieldBase & {
267
+ response_type: "ENTITY";
268
+ allow_multiple: false;
269
+ };
270
+ export type CLXMultipleEntityFormField = CLXEntityFormFieldBase & {
271
+ response_type: "ENTITY_ARRAY";
272
+ allow_multiple: true;
273
+ };
247
274
  export type CLXDateFormField = CLXFormField & {
248
275
  type: "date";
249
276
  response_type: "DATE";
@@ -318,7 +345,7 @@ export type CLXSingleCompoundFormField = CLXFormField & {
318
345
  compound_fields: CLXCompoundableFormField[];
319
346
  };
320
347
  export type CLXFormQuestionResponseOptions = {
321
- field: CLXTextFormField | CLXNumberFormField | CLXDateFormField | CLXScheduleFormField | CLXCredentialFormField | CLXGridFormField | CLXContactFormField | CLXMultipleContactFormField | CLXSingleCompoundFormField | CLXFileFormField | CLXCompoundFormField | CLXTextAreaFormField | CLXBooleanFormField | CLXSelectFormField | CLXMultiSelectFormField | CLXMultipleTextFormField;
348
+ field: CLXTextFormField | CLXNumberFormField | CLXDateFormField | CLXScheduleFormField | CLXCredentialFormField | CLXGridFormField | CLXContactFormField | CLXMultipleContactFormField | CLXEntityFormField | CLXMultipleEntityFormField | CLXSingleCompoundFormField | CLXFileFormField | CLXCompoundFormField | CLXTextAreaFormField | CLXBooleanFormField | CLXSelectFormField | CLXMultiSelectFormField | CLXMultipleTextFormField;
322
349
  has_parent?: boolean;
323
350
  locked?: boolean;
324
351
  tags?: string[];
@@ -373,12 +400,36 @@ export type CLXFormRuleStringListToStringListInstance = CLXFormRuleInstanceBase
373
400
  comparisonType: "isAnswered" | "stringListContainsAll" | "stringListContainsAny" | "stringListContainsNone";
374
401
  negate?: boolean;
375
402
  };
403
+ export type CLXFormRuleEntityInListInstance = CLXFormRuleInstanceBase & {
404
+ subject: CLXFormResponseEntityValue;
405
+ target: CLXFormResponseEntityArrayValue;
406
+ comparisonType: "entityInList" | "isAnswered";
407
+ negate?: boolean;
408
+ };
376
409
  export type CLXFormRuleStringInListInstance = CLXFormRuleInstanceBase & {
377
410
  subject: CLXFormResponseStringValue;
378
411
  target: CLXFormResponseStringArrayValue;
379
412
  comparisonType: "stringInList" | "stringNotInList" | "isAnswered";
380
413
  negate?: boolean;
381
414
  };
415
+ export type CLXFormRuleEntityComparisonInstance = CLXFormRuleInstanceBase & {
416
+ subject: CLXFormResponseEntityValue;
417
+ target: CLXFormResponseEntityValue;
418
+ comparisonType: "isAnswered" | "entityEquals";
419
+ negate?: boolean;
420
+ };
421
+ export type CLXFormRuleEntityToEntityListInstance = CLXFormRuleInstanceBase & {
422
+ subject: CLXFormResponseEntityValue;
423
+ target: CLXFormResponseEntityArrayValue;
424
+ comparisonType: "isAnswered" | "entityListContains";
425
+ negate?: boolean;
426
+ };
427
+ export type CLXFormRuleEntityListToEntityListInstance = CLXFormRuleInstanceBase & {
428
+ subject: CLXFormResponseEntityArrayValue;
429
+ target: CLXFormResponseEntityArrayValue;
430
+ comparisonType: "isAnswered" | "entityListContainsAll" | "entityListContainsAny" | "entityListContainsNone";
431
+ negate?: boolean;
432
+ };
382
433
  export type CLXFormRuleFileExistsInstance = CLXFormRuleInstanceBase & {
383
434
  subject: CLXFormResponseFileValue;
384
435
  target: CLXFormResponseBooleanValue;
@@ -409,7 +460,7 @@ export type CLXFormRuleNumberComparisonInstance = CLXFormRuleInstanceBase & {
409
460
  comparisonType: "numberEquals" | "numberGreaterThan" | "numberLessThan" | "isAnswered";
410
461
  negate?: boolean;
411
462
  };
412
- export type CLXFormRuleInstance = CLXFormRuleStringComparisonInstance | CLXFormRuleStringExistsComparisonInstance | CLXFormRuleStringInListInstance | CLXFormRuleFileExistsInstance | CLXFormRuleDateComparisonInstance | CLXFormRuleStringListToStringListInstance | CLXFormRuleStringListComparisonInstance | CLXFormRuleBooleanEqualsInstance | CLXFormRuleNumberComparisonInstance;
463
+ export type CLXFormRuleInstance = CLXFormRuleStringComparisonInstance | CLXFormRuleStringExistsComparisonInstance | CLXFormRuleStringInListInstance | CLXFormRuleEntityInListInstance | CLXFormRuleStringListToStringListInstance | CLXFormRuleEntityComparisonInstance | CLXFormRuleEntityToEntityListInstance | CLXFormRuleFileExistsInstance | CLXFormRuleDateComparisonInstance | CLXFormRuleStringListToStringListInstance | CLXFormRuleEntityListToEntityListInstance | CLXFormRuleStringListComparisonInstance | CLXFormRuleBooleanEqualsInstance | CLXFormRuleNumberComparisonInstance;
413
464
  /**
414
465
  * A form rule set is a collection of rules/conditions to evaluate.
415
466
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clxmedia/types",
3
- "version": "1.13.1",
3
+ "version": "1.14.1",
4
4
  "description": "Conversion Logix TypeScript type definitions",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",