lucid-extension-sdk 0.0.218 → 0.0.219

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.
Files changed (62) hide show
  1. package/commandtypes.d.ts +2 -2
  2. package/commandtypes.js +4 -4
  3. package/core/cardintegration/cardfielddisplaysettings.js +4 -4
  4. package/core/cardintegration/cardintegrationdefinitions.d.ts +2 -2
  5. package/core/checks.d.ts +24 -5
  6. package/core/checks.js +29 -6
  7. package/core/data/datasource/datasourcetype.js +1 -1
  8. package/core/data/datasource/metadatatypes.js +1 -1
  9. package/core/data/datasource/serializedimporteddatasource.d.ts +7 -7
  10. package/core/data/datasource/upstreampatchtype.js +1 -1
  11. package/core/data/datasource/upstreamupdatetype.js +1 -1
  12. package/core/data/fieldtypedefinition/collectionenumfieldtype.js +2 -2
  13. package/core/data/fieldtypedefinition/fieldtypearray.js +1 -1
  14. package/core/data/fieldtypedefinition/ndimensionalfieldtypearray.js +1 -1
  15. package/core/data/fieldtypedefinition/scalarfieldtype.js +1 -1
  16. package/core/data/fieldtypedefinition/semantickind.js +1 -1
  17. package/core/data/referencekeys/serializedreferencekey.d.ts +1 -1
  18. package/core/data/referencekeys/serializedreferencekey.js +2 -2
  19. package/core/data/serializedfield/serializeddataitems.d.ts +1 -1
  20. package/core/data/serializedfield/serializeddataitems.js +2 -5
  21. package/core/data/serializedfield/serializedfielddefinition.d.ts +3 -3
  22. package/core/data/serializedfield/serializedfielddefinition.js +2 -2
  23. package/core/data/serializedfield/serializedfields.d.ts +22 -4
  24. package/core/data/serializedfield/serializedfields.js +25 -25
  25. package/core/jsonserializable.js +1 -1
  26. package/core/lucidproduct.js +1 -1
  27. package/core/offsettype.js +1 -1
  28. package/core/properties/datagraphic/badgeposition.js +4 -4
  29. package/core/properties/datagraphic/datagraphicindexes.js +1 -1
  30. package/core/properties/datagraphic/staticdatagraphicsettings.js +1 -1
  31. package/core/properties/fillcolor.js +1 -1
  32. package/core/properties/strokestyle.js +1 -1
  33. package/core/rules/badgeboxfit.js +1 -1
  34. package/core/rules/conditions.js +5 -5
  35. package/core/rules/conditiontype.js +1 -1
  36. package/core/rules/serializedeffect.js +1 -1
  37. package/core/serializeddataerror.js +1 -1
  38. package/core/shapedatainheritance.js +1 -1
  39. package/core/spreadsheetintegration/lucidspreadsheetintegration.js +1 -1
  40. package/core/unfurl/unfurlcallbacks.js +1 -1
  41. package/core/unfurl/unfurliframe.d.ts +2 -2
  42. package/core/unfurl/unfurliframe.js +1 -1
  43. package/core/unfurl/unfurlrefresherrortype.js +1 -1
  44. package/core/unfurl/unfurlthumbnail.d.ts +2 -2
  45. package/core/validators/validators.js +2 -2
  46. package/data/collectionproxy.js +1 -1
  47. package/data/datasourceproxy.js +1 -1
  48. package/data/dataupdatefiltertype.js +1 -1
  49. package/dataconnector/actions/dataconnectoractionkeys.js +1 -1
  50. package/dataconnector/actions/serializedactions.js +2 -2
  51. package/dataconnector/dataconnector.js +1 -1
  52. package/document/blockclasses/customblockproxy.js +4 -4
  53. package/document/blockclasses/legendblockproxy.js +1 -1
  54. package/document/documentaccesspermission.js +1 -1
  55. package/document/documentelement/documentelementtype.js +1 -1
  56. package/document/lineproxy.js +2 -2
  57. package/document/linetextareapositioning.js +1 -1
  58. package/document/text/textstyle.js +1 -1
  59. package/package.json +2 -2
  60. package/ui/iframeui.js +1 -1
  61. package/ui/menu.js +2 -2
  62. package/ui/panel.js +1 -1
package/commandtypes.d.ts CHANGED
@@ -735,9 +735,9 @@ export type AddMenuItemQuery = {
735
735
  /** File types to accept */
736
736
  'ac': string;
737
737
  /** Single file only */
738
- 's'?: boolean;
738
+ 's'?: boolean | undefined;
739
739
  /** Return content in a binary ArrayBuffer instead of as text */
740
- 'b'?: boolean;
740
+ 'b'?: boolean | undefined;
741
741
  } | undefined;
742
742
  };
743
743
  export type AddMenuItemResult = undefined;
package/commandtypes.js CHANGED
@@ -128,20 +128,20 @@ var HashAlgorithmEnum;
128
128
  (function (HashAlgorithmEnum) {
129
129
  /** Use the SHA 256 hashing algorithm */
130
130
  HashAlgorithmEnum["sha256"] = "SHA256";
131
- })(HashAlgorithmEnum = exports.HashAlgorithmEnum || (exports.HashAlgorithmEnum = {}));
131
+ })(HashAlgorithmEnum || (exports.HashAlgorithmEnum = HashAlgorithmEnum = {}));
132
132
  var GetItemsAtSearchType;
133
133
  (function (GetItemsAtSearchType) {
134
134
  GetItemsAtSearchType[GetItemsAtSearchType["PossiblyOverlapping"] = 0] = "PossiblyOverlapping";
135
135
  GetItemsAtSearchType[GetItemsAtSearchType["Overlapping"] = 1] = "Overlapping";
136
136
  GetItemsAtSearchType[GetItemsAtSearchType["Contained"] = 2] = "Contained";
137
- })(GetItemsAtSearchType = exports.GetItemsAtSearchType || (exports.GetItemsAtSearchType = {}));
137
+ })(GetItemsAtSearchType || (exports.GetItemsAtSearchType = GetItemsAtSearchType = {}));
138
138
  var GetLLMContextType;
139
139
  (function (GetLLMContextType) {
140
140
  /** Get context in a format for LLMs where relationships among connected and contained items is preserved */
141
141
  GetLLMContextType[GetLLMContextType["Relational"] = 1] = "Relational";
142
142
  /** Get context containing only plain text displayed on the given items, more suitable for embeddings */
143
143
  GetLLMContextType[GetLLMContextType["PlainText"] = 2] = "PlainText";
144
- })(GetLLMContextType = exports.GetLLMContextType || (exports.GetLLMContextType = {}));
144
+ })(GetLLMContextType || (exports.GetLLMContextType = GetLLMContextType = {}));
145
145
  function isRawSendXHRResponse(val) {
146
146
  return (0, checks_1.isString)(val['url']) && (0, checks_1.isString)(val['t']) && (0, checks_1.isNumber)(val['s']) && (0, checks_1.isObject)(val['h']);
147
147
  }
@@ -152,4 +152,4 @@ var ZOrderOperation;
152
152
  ZOrderOperation[ZOrderOperation["TOP"] = 2] = "TOP";
153
153
  ZOrderOperation[ZOrderOperation["DOWN"] = 3] = "DOWN";
154
154
  ZOrderOperation[ZOrderOperation["BOTTOM"] = 4] = "BOTTOM";
155
- })(ZOrderOperation = exports.ZOrderOperation || (exports.ZOrderOperation = {}));
155
+ })(ZOrderOperation || (exports.ZOrderOperation = ZOrderOperation = {}));
@@ -41,7 +41,7 @@ var FieldDisplayType;
41
41
  * to display as an ImageBadge or InitializedString (or nothing, if neither is present).
42
42
  */
43
43
  FieldDisplayType["UserProfile"] = "UserProfile";
44
- })(FieldDisplayType = exports.FieldDisplayType || (exports.FieldDisplayType = {}));
44
+ })(FieldDisplayType || (exports.FieldDisplayType = FieldDisplayType = {}));
45
45
  exports.isFieldDisplayType = (0, validators_1.enumValidator)(FieldDisplayType);
46
46
  /**
47
47
  * When configuring a field on a LucidCardBlock to be displayed as a data graphic, this click handler value
@@ -61,7 +61,7 @@ var OnClickHandlerKeys;
61
61
  * Display a custom UI panel to edit non-standard fields on the data associated with the card
62
62
  */
63
63
  OnClickHandlerKeys["CustomEditAction"] = "CustomEditAction";
64
- })(OnClickHandlerKeys = exports.OnClickHandlerKeys || (exports.OnClickHandlerKeys = {}));
64
+ })(OnClickHandlerKeys || (exports.OnClickHandlerKeys = OnClickHandlerKeys = {}));
65
65
  exports.isOnClickHandlerKey = (0, validators_1.enumValidator)(OnClickHandlerKeys);
66
66
  /** @ignore */
67
67
  function serializeLucidCardFieldDisplaySettings(settings) {
@@ -107,7 +107,7 @@ var StatusValues;
107
107
  StatusValues["Todo"] = "To Do";
108
108
  StatusValues["InProgress"] = "In Progress";
109
109
  StatusValues["Done"] = "Done";
110
- })(StatusValues = exports.StatusValues || (exports.StatusValues = {}));
110
+ })(StatusValues || (exports.StatusValues = StatusValues = {}));
111
111
  var LucidCardFields;
112
112
  (function (LucidCardFields) {
113
113
  LucidCardFields["Title"] = "Title";
@@ -117,4 +117,4 @@ var LucidCardFields;
117
117
  LucidCardFields["Status"] = "Status";
118
118
  LucidCardFields["StartTime"] = "StartTime";
119
119
  LucidCardFields["EndTime"] = "EndTime";
120
- })(LucidCardFields = exports.LucidCardFields || (exports.LucidCardFields = {}));
120
+ })(LucidCardFields || (exports.LucidCardFields = LucidCardFields = {}));
@@ -2,7 +2,7 @@ import { FieldDefinition } from '../../data/schemadefinition';
2
2
  import { isString } from '../checks';
3
3
  import { isSerializedFieldTypeDefinition } from '../data/fieldtypedefinition/fieldtypedefinition';
4
4
  import { SerializedFieldDefinition } from '../data/serializedfield/serializedfielddefinition';
5
- import { isSerializedFieldType, SerializedFieldType } from '../data/serializedfield/serializedfields';
5
+ import { SerializedFieldType, isSerializedFieldType } from '../data/serializedfield/serializedfields';
6
6
  /** For fields with Option or ApiOption type, the label and value for each available option */
7
7
  export interface ExtensionCardFieldOption {
8
8
  label: string;
@@ -68,7 +68,7 @@ export declare const isSerializedExtensionCardFieldDefinition: (subject: unknown
68
68
  Type: typeof isSerializedFieldTypeDefinition;
69
69
  Constraints: (x: unknown) => x is import("../guards").DestructureGuardedTypeObj<{
70
70
  Type: (x: unknown) => x is import("../data/serializedfield/serializedfielddefinition").FieldConstraintType;
71
- Details: (x: unknown) => x is unknown;
71
+ Details: (x: unknown) => x is any;
72
72
  }>[] | undefined;
73
73
  l: typeof isString;
74
74
  d: (x: unknown) => x is string | undefined;
package/core/checks.d.ts CHANGED
@@ -67,17 +67,36 @@ export declare function isInt(val: unknown): val is number;
67
67
  export declare function isInfinite(val: unknown): val is number;
68
68
  export declare function isFunction(val: unknown): val is (...unknownArgs: any[]) => unknown;
69
69
  /**
70
- * Returns true if the specified value is an object (i.e. it's safe to do property accesses on it).
70
+ * Returns true if the specified value is an object (including arrays and functions) (i.e. it's safe to do property accesses on it).
71
71
  *
72
- * This is safer than using goog.isObject directly (this is its code inlined) because it doesn't introduce an `any`.
73
72
  * @param val Variable to test.
74
73
  * @return Whether variable is an object.
75
74
  */
76
- export declare function isObject(val: unknown): val is Record<string, unknown>;
75
+ export declare function isObject(val: unknown): val is object;
77
76
  /**
78
- * Returns true if the specified value is an object (i.e. it's safe to do property accesses on it).
77
+ * Returns true for objects, includings arrays and functions.
78
+ * Matches the behavior of goog.isObject, with a more permissive type.
79
+ *
80
+ * @param val Variable to test.
81
+ * @return Whether variable is an object.
82
+ */
83
+ export declare function isObjectUnsafe(val: any): val is {
84
+ [key: string]: unknown;
85
+ };
86
+ /**
87
+ * Returns true for objects, includings arrays and functions.
88
+ * Matches the behavior of goog.isObject, with an extremely permissive type.
89
+ *
90
+ * @param val Variable to test.
91
+ * @return Whether variable is an object.
92
+ */
93
+ export declare function isObjectUnsafer(val: any): val is {
94
+ [key: string]: any;
95
+ };
96
+ /**
97
+ * Returns true if the specified value is an object (i.e. it's safe to do property accesses on it),
98
+ * and every value matches the record type.
79
99
  *
80
- * This is safer than using goog.isObject directly (this is its code inlined) because it doesn't introduce an `any`.
81
100
  * @param val Variable to test.
82
101
  * @return Whether variable is an object.
83
102
  */
package/core/checks.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isInstanceOf = exports.isLiteral = exports.isPromise = exports.isUnknown = exports.isAny = exports.isEmptyOrNullishObject = exports.isAtLeastLength = exports.isExactLength = exports.isTypedArray = exports.isArray = exports.isRecord = exports.isObject = exports.isFunction = exports.isInfinite = exports.isInt = exports.isNumber = exports.isBoolean = exports.isString = exports.isNullish = exports.isDefAndNotNull = exports.isVoid = exports.isUndefined = exports.isNull = exports.isDef = void 0;
3
+ exports.isInstanceOf = exports.isLiteral = exports.isPromise = exports.isUnknown = exports.isAny = exports.isEmptyOrNullishObject = exports.isAtLeastLength = exports.isExactLength = exports.isTypedArray = exports.isArray = exports.isRecord = exports.isObjectUnsafer = exports.isObjectUnsafe = exports.isObject = exports.isFunction = exports.isInfinite = exports.isInt = exports.isNumber = exports.isBoolean = exports.isString = exports.isNullish = exports.isDefAndNotNull = exports.isVoid = exports.isUndefined = exports.isNull = exports.isDef = void 0;
4
4
  /**
5
5
  * Returns true if the specified value is not undefined.
6
6
  *
@@ -106,9 +106,8 @@ function isFunction(val) {
106
106
  }
107
107
  exports.isFunction = isFunction;
108
108
  /**
109
- * Returns true if the specified value is an object (i.e. it's safe to do property accesses on it).
109
+ * Returns true if the specified value is an object (including arrays and functions) (i.e. it's safe to do property accesses on it).
110
110
  *
111
- * This is safer than using goog.isObject directly (this is its code inlined) because it doesn't introduce an `any`.
112
111
  * @param val Variable to test.
113
112
  * @return Whether variable is an object.
114
113
  */
@@ -118,9 +117,33 @@ function isObject(val) {
118
117
  }
119
118
  exports.isObject = isObject;
120
119
  /**
121
- * Returns true if the specified value is an object (i.e. it's safe to do property accesses on it).
120
+ * Returns true for objects, includings arrays and functions.
121
+ * Matches the behavior of goog.isObject, with a more permissive type.
122
+ *
123
+ * @param val Variable to test.
124
+ * @return Whether variable is an object.
125
+ */
126
+ function isObjectUnsafe(val) {
127
+ const type = typeof val;
128
+ return (type == 'object' && val != null) || type == 'function';
129
+ }
130
+ exports.isObjectUnsafe = isObjectUnsafe;
131
+ /**
132
+ * Returns true for objects, includings arrays and functions.
133
+ * Matches the behavior of goog.isObject, with an extremely permissive type.
134
+ *
135
+ * @param val Variable to test.
136
+ * @return Whether variable is an object.
137
+ */
138
+ function isObjectUnsafer(val) {
139
+ const type = typeof val;
140
+ return (type == 'object' && val != null) || type == 'function';
141
+ }
142
+ exports.isObjectUnsafer = isObjectUnsafer;
143
+ /**
144
+ * Returns true if the specified value is an object (i.e. it's safe to do property accesses on it),
145
+ * and every value matches the record type.
122
146
  *
123
- * This is safer than using goog.isObject directly (this is its code inlined) because it doesn't introduce an `any`.
124
147
  * @param val Variable to test.
125
148
  * @return Whether variable is an object.
126
149
  */
@@ -186,7 +209,7 @@ function isUnknown(val) {
186
209
  }
187
210
  exports.isUnknown = isUnknown;
188
211
  function isPromise(val) {
189
- return isObject(val) && isFunction(val['then']) && isFunction(val['catch']);
212
+ return isObjectUnsafe(val) && isFunction(val['then']) && isFunction(val['catch']);
190
213
  }
191
214
  exports.isPromise = isPromise;
192
215
  function isLiteral(t) {
@@ -13,4 +13,4 @@ var DataSourceType;
13
13
  DataSourceType[DataSourceType["ForeignKeyOverride"] = 7] = "ForeignKeyOverride";
14
14
  DataSourceType[DataSourceType["Extension"] = 8] = "Extension";
15
15
  DataSourceType[DataSourceType["Unknown"] = 9] = "Unknown";
16
- })(DataSourceType = exports.DataSourceType || (exports.DataSourceType = {}));
16
+ })(DataSourceType || (exports.DataSourceType = DataSourceType = {}));
@@ -12,4 +12,4 @@ var MetadataTypes;
12
12
  MetadataTypes["Comment"] = "Comment";
13
13
  MetadataTypes["Formula"] = "Formula";
14
14
  MetadataTypes["HeaderRowMetadata"] = "HeaderRowMetadata";
15
- })(MetadataTypes = exports.MetadataTypes || (exports.MetadataTypes = {}));
15
+ })(MetadataTypes || (exports.MetadataTypes = MetadataTypes = {}));
@@ -1,6 +1,6 @@
1
1
  import { isObject, isString } from '../../checks';
2
- import { isSerializedDataItems, SerializedDataItems } from '../serializedfield/serializeddataitems';
3
- import { isSerializedSchema, SerializedSchema } from '../serializedfield/serializedschema';
2
+ import { SerializedDataItems } from '../serializedfield/serializeddataitems';
3
+ import { SerializedSchema, isSerializedSchema } from '../serializedfield/serializedschema';
4
4
  import { SerializedDataSourceProperties } from './serializeddatasourceproperties';
5
5
  /** @ignore until spreadsheet integration is ready for launch (CHART-51946) */
6
6
  export interface SerializedImportedMetadataCollection {
@@ -12,7 +12,7 @@ export interface SerializedImportedMetadataCollection {
12
12
  export declare const isSerializedImportedMetadataCollection: (subject: unknown) => subject is import("../../guards").DestructureGuardedTypeObj<{
13
13
  Name: typeof isString;
14
14
  Schema: typeof isSerializedSchema;
15
- Items: typeof isSerializedDataItems;
15
+ Items: (x: unknown) => x is Record<any, Record<any, import("../serializedfield/serializedfields").SerializedFieldType>>;
16
16
  }>;
17
17
  /** @ignore until spreadsheet integration is ready for launch (CHART-51946) */
18
18
  export interface SerializedImportedCollection {
@@ -31,12 +31,12 @@ export interface SerializedImportedCollection {
31
31
  export declare const isSerializedImportedCollection: (subject: unknown) => subject is import("../../guards").DestructureGuardedTypeObj<{
32
32
  Name: typeof isString;
33
33
  Schema: typeof isSerializedSchema;
34
- Items: typeof isSerializedDataItems;
34
+ Items: (x: unknown) => x is Record<any, Record<any, import("../serializedfield/serializedfields").SerializedFieldType>>;
35
35
  UpstreamConfig: typeof isObject;
36
36
  Metadata: (val: unknown) => val is Record<string, import("../../guards").DestructureGuardedTypeObj<{
37
37
  Name: typeof isString;
38
38
  Schema: typeof isSerializedSchema;
39
- Items: typeof isSerializedDataItems;
39
+ Items: (x: unknown) => x is Record<any, Record<any, import("../serializedfield/serializedfields").SerializedFieldType>>;
40
40
  }>>;
41
41
  DataIsPartial: (x: unknown) => x is true | undefined;
42
42
  }>;
@@ -59,12 +59,12 @@ export declare const isSerializedImportedDataSource: (subject: unknown) => subje
59
59
  Collections: (val: unknown) => val is import("../../guards").DestructureGuardedTypeObj<{
60
60
  Name: typeof isString;
61
61
  Schema: typeof isSerializedSchema;
62
- Items: typeof isSerializedDataItems;
62
+ Items: (x: unknown) => x is Record<any, Record<any, import("../serializedfield/serializedfields").SerializedFieldType>>;
63
63
  UpstreamConfig: typeof isObject;
64
64
  Metadata: (val: unknown) => val is Record<string, import("../../guards").DestructureGuardedTypeObj<{
65
65
  Name: typeof isString;
66
66
  Schema: typeof isSerializedSchema;
67
- Items: typeof isSerializedDataItems;
67
+ Items: (x: unknown) => x is Record<any, Record<any, import("../serializedfield/serializedfields").SerializedFieldType>>;
68
68
  }>>;
69
69
  DataIsPartial: (x: unknown) => x is true | undefined;
70
70
  }>[];
@@ -7,4 +7,4 @@ var UpstreamPatchType;
7
7
  UpstreamPatchType[UpstreamPatchType["NONE"] = 0] = "NONE";
8
8
  UpstreamPatchType[UpstreamPatchType["MANUAL"] = 2] = "MANUAL";
9
9
  UpstreamPatchType[UpstreamPatchType["AUTO"] = 3] = "AUTO";
10
- })(UpstreamPatchType = exports.UpstreamPatchType || (exports.UpstreamPatchType = {}));
10
+ })(UpstreamPatchType || (exports.UpstreamPatchType = UpstreamPatchType = {}));
@@ -8,4 +8,4 @@ var UpstreamUpdateType;
8
8
  UpstreamUpdateType[UpstreamUpdateType["PULL"] = 1] = "PULL";
9
9
  UpstreamUpdateType[UpstreamUpdateType["USER"] = 2] = "USER";
10
10
  UpstreamUpdateType[UpstreamUpdateType["EVENTPULL"] = 3] = "EVENTPULL";
11
- })(UpstreamUpdateType = exports.UpstreamUpdateType || (exports.UpstreamUpdateType = {}));
11
+ })(UpstreamUpdateType || (exports.UpstreamUpdateType = UpstreamUpdateType = {}));
@@ -16,7 +16,7 @@ var CollectionEnumFieldNames;
16
16
  CollectionEnumFieldNames["Description"] = "description";
17
17
  CollectionEnumFieldNames["Color"] = "color";
18
18
  CollectionEnumFieldNames["IconUrl"] = "iconUrl";
19
- })(CollectionEnumFieldNames = exports.CollectionEnumFieldNames || (exports.CollectionEnumFieldNames = {}));
19
+ })(CollectionEnumFieldNames || (exports.CollectionEnumFieldNames = CollectionEnumFieldNames = {}));
20
20
  exports.isCollectionEnumFieldNames = (0, validators_1.enumValidator)(CollectionEnumFieldNames);
21
21
  class CollectionEnumFieldType {
22
22
  constructor(collectionId) {
@@ -42,6 +42,6 @@ function deserializeCollectionEnumFieldType(serializedCollectionEnumFieldType) {
42
42
  }
43
43
  exports.deserializeCollectionEnumFieldType = deserializeCollectionEnumFieldType;
44
44
  function isSerializedCollectionEnumFieldType(fieldType) {
45
- return (0, checks_1.isObject)(fieldType) && (0, checks_1.isString)(fieldType[exports.CollectionEnumFieldTypeKey]);
45
+ return (0, checks_1.isObjectUnsafe)(fieldType) && (0, checks_1.isString)(fieldType[exports.CollectionEnumFieldTypeKey]);
46
46
  }
47
47
  exports.isSerializedCollectionEnumFieldType = isSerializedCollectionEnumFieldType;
@@ -30,7 +30,7 @@ class FieldTypeArray extends BaseFieldTypeArray {
30
30
  }
31
31
  exports.FieldTypeArray = FieldTypeArray;
32
32
  function isSerializedFieldTypeArray(fieldType, validateTypeCheck) {
33
- return ((0, checks_1.isObject)(fieldType) &&
33
+ return ((0, checks_1.isObjectUnsafe)(fieldType) &&
34
34
  (0, checks_1.isBoolean)(fieldType['ND']) &&
35
35
  fieldType['ND'] === false &&
36
36
  (0, checks_1.isArray)(fieldType['validTypes']) &&
@@ -31,7 +31,7 @@ function isNDimensionalFieldTypeArray(fieldType) {
31
31
  }
32
32
  exports.isNDimensionalFieldTypeArray = isNDimensionalFieldTypeArray;
33
33
  function isSerializedNDimensionalFieldTypeArray(fieldType) {
34
- return ((0, checks_1.isObject)(fieldType) &&
34
+ return ((0, checks_1.isObjectUnsafe)(fieldType) &&
35
35
  (0, checks_1.isBoolean)(fieldType['ND']) &&
36
36
  fieldType['ND'] === true &&
37
37
  (0, checks_1.isTypedArray)(checks_1.isAny)(fieldType['validTypes']) &&
@@ -13,7 +13,7 @@ var ScalarFieldTypeEnum;
13
13
  ScalarFieldTypeEnum[ScalarFieldTypeEnum["DICTIONARY"] = 7] = "DICTIONARY";
14
14
  ScalarFieldTypeEnum[ScalarFieldTypeEnum["CURRENCY"] = 8] = "CURRENCY";
15
15
  ScalarFieldTypeEnum[ScalarFieldTypeEnum["DATEONLY"] = 9] = "DATEONLY";
16
- })(ScalarFieldTypeEnum = exports.ScalarFieldTypeEnum || (exports.ScalarFieldTypeEnum = {}));
16
+ })(ScalarFieldTypeEnum || (exports.ScalarFieldTypeEnum = ScalarFieldTypeEnum = {}));
17
17
  exports.AnyScalarFieldType = [
18
18
  ScalarFieldTypeEnum.ANY,
19
19
  ScalarFieldTypeEnum.NUMBER,
@@ -21,5 +21,5 @@ var SemanticKind;
21
21
  SemanticKind["GroupByHint"] = "groupbyhint";
22
22
  SemanticKind["PrimaryKeyReference"] = "primarykeyreference";
23
23
  SemanticKind["URL"] = "url";
24
- })(SemanticKind = exports.SemanticKind || (exports.SemanticKind = {}));
24
+ })(SemanticKind || (exports.SemanticKind = SemanticKind = {}));
25
25
  exports.isSemanticKind = (0, validators_1.enumValidator)(SemanticKind);
@@ -1,4 +1,4 @@
1
- import { SerializedFields, SerializedFieldType } from '../serializedfield/serializedfields';
1
+ import { SerializedFieldType, SerializedFields } from '../serializedfield/serializedfields';
2
2
  import { SerializedSchema } from '../serializedfield/serializedschema';
3
3
  export declare const FlattenedReferenceKeyId = "192d0e9f-2f5a-4032-9f03-59bbf1ea5891";
4
4
  export declare const FlattenedReferenceKeyName = "192d0e9f-2f5a-4032-9f03-59bbf1ea5891_n";
@@ -6,12 +6,12 @@ exports.FlattenedReferenceKeyId = '192d0e9f-2f5a-4032-9f03-59bbf1ea5891';
6
6
  exports.FlattenedReferenceKeyName = '192d0e9f-2f5a-4032-9f03-59bbf1ea5891_n';
7
7
  /** @ignore */
8
8
  function isTypedSerializedFlattenedReference(data) {
9
- return (0, checks_1.isObject)(data) && (0, checks_1.isObject)(data['sc']) && (0, checks_1.isObject)(data['d']);
9
+ return (0, checks_1.isObjectUnsafe)(data) && (0, checks_1.isObject)(data['sc']) && (0, checks_1.isObject)(data['d']);
10
10
  }
11
11
  exports.isTypedSerializedFlattenedReference = isTypedSerializedFlattenedReference;
12
12
  /** @ignore */
13
13
  function isUnTypedSerializedFlattenedReference(data) {
14
- return (0, checks_1.isObject)(data) && data[exports.FlattenedReferenceKeyId] === true;
14
+ return (0, checks_1.isObjectUnsafe)(data) && data[exports.FlattenedReferenceKeyId] === true;
15
15
  }
16
16
  exports.isUnTypedSerializedFlattenedReference = isUnTypedSerializedFlattenedReference;
17
17
  /** @ignore */
@@ -2,4 +2,4 @@ import { SerializedFields } from './serializedfields';
2
2
  export interface SerializedDataItems {
3
3
  [primaryKey: string]: SerializedFields;
4
4
  }
5
- export declare function isSerializedDataItems(x: unknown): x is SerializedDataItems;
5
+ export declare const isSerializedDataItems: (x: unknown) => x is Record<any, Record<any, import("./serializedfields").SerializedFieldType>>;
@@ -1,9 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isSerializedDataItems = void 0;
4
- const checks_1 = require("../../checks");
4
+ const validators_1 = require("../../validators/validators");
5
5
  const serializedfields_1 = require("./serializedfields");
6
- function isSerializedDataItems(x) {
7
- return (0, checks_1.isObject)(x) && Object.values(x).every(serializedfields_1.isSerializedFields);
8
- }
9
- exports.isSerializedDataItems = isSerializedDataItems;
6
+ exports.isSerializedDataItems = (0, validators_1.objectOfValidator)(serializedfields_1.isSerializedFields);
@@ -1,6 +1,6 @@
1
1
  import { isString } from '../../checks';
2
2
  import { JsonSerializable } from '../../jsonserializable';
3
- import { isSerializedFieldTypeDefinition, SerializedFieldTypeDefinition } from '../fieldtypedefinition/fieldtypedefinition';
3
+ import { SerializedFieldTypeDefinition, isSerializedFieldTypeDefinition } from '../fieldtypedefinition/fieldtypedefinition';
4
4
  import { SemanticKind } from '../fieldtypedefinition/semantickind';
5
5
  export declare enum FieldConstraintType {
6
6
  REQUIRED = "required",
@@ -18,7 +18,7 @@ export type SerializedFieldConstraint = {
18
18
  };
19
19
  export declare const isSerializedFieldConstraint: (subject: unknown) => subject is import("../../guards").DestructureGuardedTypeObj<{
20
20
  Type: (x: unknown) => x is FieldConstraintType;
21
- Details: (x: unknown) => x is unknown;
21
+ Details: (x: unknown) => x is any;
22
22
  }>;
23
23
  export type SerializedFieldDefinition = {
24
24
  'Name': string;
@@ -32,7 +32,7 @@ export declare const isSerializedFieldDefinition: (subject: unknown) => subject
32
32
  Type: typeof isSerializedFieldTypeDefinition;
33
33
  Constraints: (x: unknown) => x is import("../../guards").DestructureGuardedTypeObj<{
34
34
  Type: (x: unknown) => x is FieldConstraintType;
35
- Details: (x: unknown) => x is unknown;
35
+ Details: (x: unknown) => x is any;
36
36
  }>[] | undefined;
37
37
  SyncSchema: (x: unknown) => x is string | undefined;
38
38
  Mapping: (x: unknown) => x is SemanticKind[] | undefined;
@@ -15,11 +15,11 @@ var FieldConstraintType;
15
15
  FieldConstraintType["SINGLE_LINE_ONLY"] = "singleLineOnly";
16
16
  FieldConstraintType["NO_WHITESPACE"] = "noWhitespace";
17
17
  FieldConstraintType["UNIQUE_EDIT"] = "uniqueEditType";
18
- })(FieldConstraintType = exports.FieldConstraintType || (exports.FieldConstraintType = {}));
18
+ })(FieldConstraintType || (exports.FieldConstraintType = FieldConstraintType = {}));
19
19
  exports.isFieldConstraintType = (0, validators_1.enumValidator)(FieldConstraintType);
20
20
  exports.isSerializedFieldConstraint = (0, validators_1.objectValidator)({
21
21
  'Type': (0, validators_1.enumValidator)(FieldConstraintType),
22
- 'Details': (0, validators_1.option)(checks_1.isUnknown),
22
+ 'Details': (0, validators_1.option)(checks_1.isAny),
23
23
  });
24
24
  exports.isSerializedFieldDefinition = (0, validators_1.strictObjectValidator)({
25
25
  'Name': checks_1.isString,
@@ -1,3 +1,4 @@
1
+ import { isNumber, isString } from '../../checks';
1
2
  export type SerializedFieldType = number | boolean | string | null | SerializedLucidDateObject | SerializedColorObjectFieldType | SerializedLucidDictionary | SerializedLucidCurrency | undefined | Array<SerializedFieldType>;
2
3
  export type SerializedJsonFieldType = number | boolean | string | null | undefined | Array<SerializedJsonFieldType> | {
3
4
  [index: string]: SerializedJsonFieldType;
@@ -73,9 +74,26 @@ export declare const isJsonSerializedLucidDictionary: (subject: unknown) => subj
73
74
  [key: string]: SerializedJsonFieldType;
74
75
  };
75
76
  }>;
76
- export declare function isSerializedLucidDictionary(value: any): value is SerializedLucidDictionary;
77
- export declare function isSerializedLucidCurrency(value: any): value is SerializedLucidCurrency;
78
- export declare function isSerializedLucidDateObject(value: any): value is SerializedLucidDateObject;
77
+ export declare const isSerializedLucidDictionary: (x: unknown) => x is import("../../guards").DestructureGuardedTypeObj<{
78
+ dict: (x: unknown) => x is {
79
+ [key: string]: SerializedFieldType;
80
+ };
81
+ }> | import("../../guards").DestructureGuardedTypeObj<{
82
+ js: (x: unknown) => x is {
83
+ [key: string]: SerializedJsonFieldType;
84
+ };
85
+ }>;
86
+ export declare const isSerializedLucidCurrency: (subject: unknown) => subject is import("../../guards").DestructureGuardedTypeObj<{
87
+ a: typeof isNumber;
88
+ t: typeof isString;
89
+ }>;
90
+ export declare const isSerializedLucidDateObject: (x: unknown) => x is import("../../guards").DestructureGuardedTypeObj<{
91
+ ms: typeof isNumber;
92
+ isDateOnly: (x: unknown) => x is boolean | undefined;
93
+ }> | import("../../guards").DestructureGuardedTypeObj<{
94
+ isoDate: typeof isString;
95
+ displayTimezone: (x: unknown) => x is string | undefined;
96
+ }>;
79
97
  export declare function isSerializedFieldType(value: any): value is SerializedFieldType;
80
98
  export declare function isSerializedJsonFieldType(value: any): value is SerializedJsonFieldType;
81
- export declare function isSerializedFields(value: unknown): value is SerializedFields;
99
+ export declare const isSerializedFields: (x: unknown) => x is Record<any, SerializedFieldType>;
@@ -4,37 +4,40 @@ exports.isSerializedFields = exports.isSerializedJsonFieldType = exports.isSeria
4
4
  const checks_1 = require("../../checks");
5
5
  const validators_1 = require("../../validators/validators");
6
6
  function isSerializedColorObjectFieldType(value) {
7
- return (0, checks_1.isObject)(value) && (0, checks_1.isObject)(value['color']);
7
+ return (0, checks_1.isObjectUnsafe)(value) && (0, checks_1.isObject)(value['color']);
8
8
  }
9
9
  exports.isSerializedColorObjectFieldType = isSerializedColorObjectFieldType;
10
10
  /** a dictionary type that has full type support */
11
- exports.isNestedSerializedLucidDictionary = (0, validators_1.strictObjectValidator)({ 'dict': (0, validators_1.mapValidator)(isSerializedFieldType) });
11
+ exports.isNestedSerializedLucidDictionary = (0, validators_1.strictObjectValidator)({
12
+ 'dict': (0, validators_1.mapValidator)(isSerializedFieldType),
13
+ });
12
14
  /** a dictionary type that only supports raw js, primarily used when external data could be arbritrary js */
13
- exports.isJsonSerializedLucidDictionary = (0, validators_1.strictObjectValidator)({ 'js': (0, validators_1.mapValidator)(isSerializedJsonFieldType) });
14
- function isSerializedLucidDictionary(value) {
15
- return (0, exports.isNestedSerializedLucidDictionary)(value) || (0, exports.isJsonSerializedLucidDictionary)(value);
16
- }
17
- exports.isSerializedLucidDictionary = isSerializedLucidDictionary;
18
- function isSerializedLucidCurrency(value) {
19
- return (0, checks_1.isObject)(value) && (0, checks_1.isNumber)(value['a']) && (0, checks_1.isString)(value['t']);
20
- }
21
- exports.isSerializedLucidCurrency = isSerializedLucidCurrency;
22
- function isSerializedLucidDateObject(value) {
23
- var _a, _b;
24
- return ((0, checks_1.isObject)(value) &&
25
- (((0, checks_1.isNumber)(value['ms']) && (0, checks_1.isBoolean)((_a = value['isDateOnly']) !== null && _a !== void 0 ? _a : true)) ||
26
- ((0, checks_1.isString)(value['isoDate']) && (0, checks_1.isString)((_b = value['displayTimezone']) !== null && _b !== void 0 ? _b : 'a'))));
27
- }
28
- exports.isSerializedLucidDateObject = isSerializedLucidDateObject;
15
+ exports.isJsonSerializedLucidDictionary = (0, validators_1.strictObjectValidator)({
16
+ 'js': (0, validators_1.mapValidator)(isSerializedJsonFieldType),
17
+ });
18
+ exports.isSerializedLucidDictionary = (0, validators_1.either)(exports.isNestedSerializedLucidDictionary, exports.isJsonSerializedLucidDictionary);
19
+ exports.isSerializedLucidCurrency = (0, validators_1.objectValidator)({
20
+ 'a': checks_1.isNumber,
21
+ 't': checks_1.isString,
22
+ });
23
+ const isSerializedMillisecondsDateObject = (0, validators_1.objectValidator)({
24
+ 'ms': checks_1.isNumber,
25
+ 'isDateOnly': (0, validators_1.option)(checks_1.isBoolean),
26
+ });
27
+ const isSerializedIsoDateObject = (0, validators_1.objectValidator)({
28
+ 'isoDate': checks_1.isString,
29
+ 'displayTimezone': (0, validators_1.option)(checks_1.isString),
30
+ });
31
+ exports.isSerializedLucidDateObject = (0, validators_1.either)(isSerializedMillisecondsDateObject, isSerializedIsoDateObject);
29
32
  function isSerializedFieldType(value) {
30
33
  return (value == null ||
31
34
  (0, checks_1.isNumber)(value) ||
32
35
  (0, checks_1.isString)(value) ||
33
36
  (0, checks_1.isBoolean)(value) ||
34
- isSerializedLucidDictionary(value) ||
35
- isSerializedLucidCurrency(value) ||
37
+ (0, exports.isSerializedLucidDictionary)(value) ||
38
+ (0, exports.isSerializedLucidCurrency)(value) ||
36
39
  ((0, checks_1.isArray)(value) && value.every(isSerializedFieldType)) ||
37
- isSerializedLucidDateObject(value) ||
40
+ (0, exports.isSerializedLucidDateObject)(value) ||
38
41
  isSerializedColorObjectFieldType(value));
39
42
  }
40
43
  exports.isSerializedFieldType = isSerializedFieldType;
@@ -47,7 +50,4 @@ function isSerializedJsonFieldType(value) {
47
50
  ((0, checks_1.isObject)(value) && Object.values(value).every(isSerializedJsonFieldType)));
48
51
  }
49
52
  exports.isSerializedJsonFieldType = isSerializedJsonFieldType;
50
- function isSerializedFields(value) {
51
- return (0, checks_1.isObject)(value) && Object.values(value).every(isSerializedFieldType);
52
- }
53
- exports.isSerializedFields = isSerializedFields;
53
+ exports.isSerializedFields = (0, validators_1.objectOfValidator)(isSerializedFieldType);
@@ -12,7 +12,7 @@ function isJsonSerializable(x) {
12
12
  }
13
13
  exports.isJsonSerializable = isJsonSerializable;
14
14
  function isJsonObject(x) {
15
- if (!(0, checks_1.isObject)(x)) {
15
+ if (!(0, checks_1.isObjectUnsafe)(x)) {
16
16
  return false;
17
17
  }
18
18
  for (const k in x) {
@@ -9,4 +9,4 @@ var LucidProduct;
9
9
  LucidProduct["Chart"] = "chart";
10
10
  LucidProduct["Spark"] = "spark";
11
11
  LucidProduct["TeamSpaces"] = "teamspaces";
12
- })(LucidProduct = exports.LucidProduct || (exports.LucidProduct = {}));
12
+ })(LucidProduct || (exports.LucidProduct = LucidProduct = {}));
@@ -45,7 +45,7 @@ var OffsetType;
45
45
  * Resize from the west (left) side of the selection, stretching horizontally.
46
46
  */
47
47
  OffsetType[OffsetType["W"] = 11] = "W";
48
- })(OffsetType = exports.OffsetType || (exports.OffsetType = {}));
48
+ })(OffsetType || (exports.OffsetType = OffsetType = {}));
49
49
  function isLinearOffsetType(offsetType) {
50
50
  return (offsetType === OffsetType.NW ||
51
51
  offsetType === OffsetType.NE ||
@@ -7,24 +7,24 @@ var HorizontalBadgePos;
7
7
  HorizontalBadgePos[HorizontalBadgePos["LEFT"] = 0] = "LEFT";
8
8
  HorizontalBadgePos[HorizontalBadgePos["CENTER"] = 1] = "CENTER";
9
9
  HorizontalBadgePos[HorizontalBadgePos["RIGHT"] = 2] = "RIGHT";
10
- })(HorizontalBadgePos = exports.HorizontalBadgePos || (exports.HorizontalBadgePos = {}));
10
+ })(HorizontalBadgePos || (exports.HorizontalBadgePos = HorizontalBadgePos = {}));
11
11
  var VerticalBadgePos;
12
12
  (function (VerticalBadgePos) {
13
13
  VerticalBadgePos[VerticalBadgePos["TOP"] = 0] = "TOP";
14
14
  VerticalBadgePos[VerticalBadgePos["CENTER"] = 1] = "CENTER";
15
15
  VerticalBadgePos[VerticalBadgePos["BOTTOM"] = 2] = "BOTTOM";
16
- })(VerticalBadgePos = exports.VerticalBadgePos || (exports.VerticalBadgePos = {}));
16
+ })(VerticalBadgePos || (exports.VerticalBadgePos = VerticalBadgePos = {}));
17
17
  var BadgeLayerPos;
18
18
  (function (BadgeLayerPos) {
19
19
  BadgeLayerPos[BadgeLayerPos["INSIDE"] = 0] = "INSIDE";
20
20
  BadgeLayerPos[BadgeLayerPos["EDGE"] = 1] = "EDGE";
21
21
  BadgeLayerPos[BadgeLayerPos["OUTSIDE"] = 2] = "OUTSIDE";
22
- })(BadgeLayerPos = exports.BadgeLayerPos || (exports.BadgeLayerPos = {}));
22
+ })(BadgeLayerPos || (exports.BadgeLayerPos = BadgeLayerPos = {}));
23
23
  var BadgeResponsiveness;
24
24
  (function (BadgeResponsiveness) {
25
25
  BadgeResponsiveness[BadgeResponsiveness["STATIC"] = 0] = "STATIC";
26
26
  BadgeResponsiveness[BadgeResponsiveness["STACK"] = 1] = "STACK";
27
- })(BadgeResponsiveness = exports.BadgeResponsiveness || (exports.BadgeResponsiveness = {}));
27
+ })(BadgeResponsiveness || (exports.BadgeResponsiveness = BadgeResponsiveness = {}));
28
28
  /*
29
29
  * The order of the badge position starting from the top-left corner and going clockwise
30
30
  */
@@ -13,7 +13,7 @@ var DataGraphicIconSets;
13
13
  DataGraphicIconSets[DataGraphicIconSets["TRENDING_ARROWS"] = 5] = "TRENDING_ARROWS";
14
14
  DataGraphicIconSets[DataGraphicIconSets["STATUS_CHECK_BOXES"] = 6] = "STATUS_CHECK_BOXES";
15
15
  DataGraphicIconSets[DataGraphicIconSets["TRENDING_ARROWS_FLIPPED"] = 7] = "TRENDING_ARROWS_FLIPPED";
16
- })(DataGraphicIconSets = exports.DataGraphicIconSets || (exports.DataGraphicIconSets = {}));
16
+ })(DataGraphicIconSets || (exports.DataGraphicIconSets = DataGraphicIconSets = {}));
17
17
  function areDataGraphicIconIndexesEqual(a, b) {
18
18
  return a.set == b.set && a.index == b.index && areDataGraphicImagesEqual(a.iconImage, b.iconImage);
19
19
  }
@@ -20,7 +20,7 @@ function deserializeSimpleStaticDataGraphicSettings(settings) {
20
20
  }
21
21
  exports.deserializeSimpleStaticDataGraphicSettings = deserializeSimpleStaticDataGraphicSettings;
22
22
  function isSerializedSimpleStaticDataGraphicSettings(settings) {
23
- return ((0, checks_1.isObject)(settings) &&
23
+ return ((0, checks_1.isObjectUnsafe)(settings) &&
24
24
  (0, checks_1.isString)(settings['color']) &&
25
25
  (0, checks_1.isObject)(settings['icon']) &&
26
26
  (0, badgeposition_1.isValidSerializedBadgeEnumPosition)(settings['pos']));
@@ -18,7 +18,7 @@ var SimpleImageFillPosition;
18
18
  /** The image is tiled in its original size vertically and horizontally to fully cover the block */
19
19
  SimpleImageFillPosition["Tile"] = "tile";
20
20
  //TODO: 'mask' but mask requires additional settings
21
- })(SimpleImageFillPosition = exports.SimpleImageFillPosition || (exports.SimpleImageFillPosition = {}));
21
+ })(SimpleImageFillPosition || (exports.SimpleImageFillPosition = SimpleImageFillPosition = {}));
22
22
  /** @ignore */
23
23
  function serializeSimpleFill(fill) {
24
24
  if ((0, checks_1.isString)(fill)) {
@@ -21,7 +21,7 @@ var StrokeStyle;
21
21
  StrokeStyle["StripeThickThinThick"] = "stripethickthinthick";
22
22
  StrokeStyle["StripeThinThickThin"] = "stripethinthickthin";
23
23
  StrokeStyle["StripeTriple"] = "stripetriple";
24
- })(StrokeStyle = exports.StrokeStyle || (exports.StrokeStyle = {}));
24
+ })(StrokeStyle || (exports.StrokeStyle = StrokeStyle = {}));
25
25
  const strokeStyleSet = new Set(Object.values(StrokeStyle));
26
26
  function isStrokeStyle(value) {
27
27
  return strokeStyleSet.has(value);
@@ -5,4 +5,4 @@ var BadgeBoxFit;
5
5
  (function (BadgeBoxFit) {
6
6
  BadgeBoxFit["fitHeight"] = "fit-height";
7
7
  BadgeBoxFit["none"] = "none";
8
- })(BadgeBoxFit = exports.BadgeBoxFit || (exports.BadgeBoxFit = {}));
8
+ })(BadgeBoxFit || (exports.BadgeBoxFit = BadgeBoxFit = {}));
@@ -5,7 +5,7 @@ var ConditionCombination;
5
5
  (function (ConditionCombination) {
6
6
  ConditionCombination["AND"] = "AND";
7
7
  ConditionCombination["OR"] = "OR";
8
- })(ConditionCombination = exports.ConditionCombination || (exports.ConditionCombination = {}));
8
+ })(ConditionCombination || (exports.ConditionCombination = ConditionCombination = {}));
9
9
  var TextConditions;
10
10
  (function (TextConditions) {
11
11
  TextConditions[TextConditions["TextEmpty"] = 0] = "TextEmpty";
@@ -20,7 +20,7 @@ var TextConditions;
20
20
  TextConditions[TextConditions["NotEqual"] = 13] = "NotEqual";
21
21
  TextConditions[TextConditions["Between"] = 14] = "Between";
22
22
  TextConditions[TextConditions["NotBetween"] = 15] = "NotBetween";
23
- })(TextConditions = exports.TextConditions || (exports.TextConditions = {}));
23
+ })(TextConditions || (exports.TextConditions = TextConditions = {}));
24
24
  var ShapeDataConditions;
25
25
  (function (ShapeDataConditions) {
26
26
  ShapeDataConditions[ShapeDataConditions["TextEmpty"] = 0] = "TextEmpty";
@@ -39,12 +39,12 @@ var ShapeDataConditions;
39
39
  ShapeDataConditions[ShapeDataConditions["NotEqual"] = 13] = "NotEqual";
40
40
  ShapeDataConditions[ShapeDataConditions["Between"] = 14] = "Between";
41
41
  ShapeDataConditions[ShapeDataConditions["NotBetween"] = 15] = "NotBetween";
42
- })(ShapeDataConditions = exports.ShapeDataConditions || (exports.ShapeDataConditions = {}));
42
+ })(ShapeDataConditions || (exports.ShapeDataConditions = ShapeDataConditions = {}));
43
43
  var ShapeTypeConditions;
44
44
  (function (ShapeTypeConditions) {
45
45
  ShapeTypeConditions[ShapeTypeConditions["TextContains"] = 2] = "TextContains";
46
46
  ShapeTypeConditions[ShapeTypeConditions["TextDoesNotContain"] = 3] = "TextDoesNotContain";
47
- })(ShapeTypeConditions = exports.ShapeTypeConditions || (exports.ShapeTypeConditions = {}));
47
+ })(ShapeTypeConditions || (exports.ShapeTypeConditions = ShapeTypeConditions = {}));
48
48
  var ConnectedShapesCondition;
49
49
  (function (ConnectedShapesCondition) {
50
50
  ConnectedShapesCondition[ConnectedShapesCondition["GreaterThan"] = 8] = "GreaterThan";
@@ -55,4 +55,4 @@ var ConnectedShapesCondition;
55
55
  ConnectedShapesCondition[ConnectedShapesCondition["NotEqual"] = 13] = "NotEqual";
56
56
  ConnectedShapesCondition[ConnectedShapesCondition["Between"] = 14] = "Between";
57
57
  ConnectedShapesCondition[ConnectedShapesCondition["NotBetween"] = 15] = "NotBetween";
58
- })(ConnectedShapesCondition = exports.ConnectedShapesCondition || (exports.ConnectedShapesCondition = {}));
58
+ })(ConnectedShapesCondition || (exports.ConnectedShapesCondition = ConnectedShapesCondition = {}));
@@ -8,4 +8,4 @@ var ConditionType;
8
8
  ConditionType[ConditionType["Formula"] = 2] = "Formula";
9
9
  ConditionType[ConditionType["ShapeType"] = 3] = "ShapeType";
10
10
  ConditionType[ConditionType["ConnectedShapes"] = 4] = "ConnectedShapes";
11
- })(ConditionType = exports.ConditionType || (exports.ConditionType = {}));
11
+ })(ConditionType || (exports.ConditionType = ConditionType = {}));
@@ -6,4 +6,4 @@ var RuleFormattingType;
6
6
  RuleFormattingType[RuleFormattingType["FORMATTING"] = 0] = "FORMATTING";
7
7
  RuleFormattingType[RuleFormattingType["DATA_GRAPHICS"] = 1] = "DATA_GRAPHICS";
8
8
  RuleFormattingType[RuleFormattingType["STENCIL"] = 2] = "STENCIL";
9
- })(RuleFormattingType = exports.RuleFormattingType || (exports.RuleFormattingType = {}));
9
+ })(RuleFormattingType || (exports.RuleFormattingType = RuleFormattingType = {}));
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isSerializedDataError = void 0;
4
4
  const checks_1 = require("./checks");
5
5
  function isSerializedDataError(raw) {
6
- return (0, checks_1.isObject)(raw) && (0, checks_1.isString)(raw['error']) && (0, checks_1.isNumber)(raw['type']);
6
+ return (0, checks_1.isObjectUnsafe)(raw) && (0, checks_1.isString)(raw['error']) && (0, checks_1.isNumber)(raw['type']);
7
7
  }
8
8
  exports.isSerializedDataError = isSerializedDataError;
@@ -17,4 +17,4 @@ var ShapeDataInheritance;
17
17
  * every single Element on the page, including all groups and items inside those groups.
18
18
  */
19
19
  ShapeDataInheritance[ShapeDataInheritance["VALUE"] = 2] = "VALUE";
20
- })(ShapeDataInheritance = exports.ShapeDataInheritance || (exports.ShapeDataInheritance = {}));
20
+ })(ShapeDataInheritance || (exports.ShapeDataInheritance = ShapeDataInheritance = {}));
@@ -12,7 +12,7 @@ var LucidSpreadsheetIntegrationFailureType;
12
12
  LucidSpreadsheetIntegrationFailureType["AuthorizationFailure"] = "AuthorizationFailure";
13
13
  LucidSpreadsheetIntegrationFailureType["GenericFailure"] = "GenericFailure";
14
14
  LucidSpreadsheetIntegrationFailureType["UserCancelled"] = "UserCanceled";
15
- })(LucidSpreadsheetIntegrationFailureType = exports.LucidSpreadsheetIntegrationFailureType || (exports.LucidSpreadsheetIntegrationFailureType = {}));
15
+ })(LucidSpreadsheetIntegrationFailureType || (exports.LucidSpreadsheetIntegrationFailureType = LucidSpreadsheetIntegrationFailureType = {}));
16
16
  /** @ignore until spreadsheet integration is ready for launch (CHART-51946) */
17
17
  exports.lucidSpreadsheetIntegrationFailureTypeValidator = (0, validators_1.stringEnumValidator)(LucidSpreadsheetIntegrationFailureType);
18
18
  exports.isImportedResults = (0, validators_1.strictObjectValidator)({
@@ -5,4 +5,4 @@ var UnfurlCallbackType;
5
5
  (function (UnfurlCallbackType) {
6
6
  UnfurlCallbackType["Unfurl"] = "u";
7
7
  UnfurlCallbackType["AfterUnfurl"] = "a";
8
- })(UnfurlCallbackType = exports.UnfurlCallbackType || (exports.UnfurlCallbackType = {}));
8
+ })(UnfurlCallbackType || (exports.UnfurlCallbackType = UnfurlCallbackType = {}));
@@ -48,8 +48,8 @@ export interface UnfurlIframe {
48
48
  /** @ignore */
49
49
  export interface SerializedUnfurlIframe {
50
50
  'IframeUrl': string;
51
- 'AspectRatio'?: UnfurlIframeAspectRatio;
52
- 'IframeTitle'?: string;
51
+ 'AspectRatio'?: UnfurlIframeAspectRatio | undefined;
52
+ 'IframeTitle'?: string | undefined;
53
53
  }
54
54
  /** @ignore */
55
55
  export declare const isValidUnfurlIframe: (subject: unknown) => subject is import("../guards").DestructureGuardedTypeObj<{
@@ -31,7 +31,7 @@ var UnfurlIframeAspectRatio;
31
31
  * Aspect ratio 3:4, taller rectangle
32
32
  */
33
33
  UnfurlIframeAspectRatio["ThreeToFour"] = "3:4";
34
- })(UnfurlIframeAspectRatio = exports.UnfurlIframeAspectRatio || (exports.UnfurlIframeAspectRatio = {}));
34
+ })(UnfurlIframeAspectRatio || (exports.UnfurlIframeAspectRatio = UnfurlIframeAspectRatio = {}));
35
35
  /** @ignore */
36
36
  exports.isValidUnfurlIframe = (0, validators_1.objectValidator)({
37
37
  'IframeUrl': checks_1.isString,
@@ -6,5 +6,5 @@ var UnfurlRefreshErrorType;
6
6
  (function (UnfurlRefreshErrorType) {
7
7
  UnfurlRefreshErrorType["AuthorizationFailure"] = "Authorization failure";
8
8
  UnfurlRefreshErrorType["GenericFailure"] = "Generic failure";
9
- })(UnfurlRefreshErrorType = exports.UnfurlRefreshErrorType || (exports.UnfurlRefreshErrorType = {}));
9
+ })(UnfurlRefreshErrorType || (exports.UnfurlRefreshErrorType = UnfurlRefreshErrorType = {}));
10
10
  exports.unfurlRefreshErrorTypeValidator = (0, validators_1.stringEnumValidator)(UnfurlRefreshErrorType);
@@ -19,8 +19,8 @@ export interface UnfurlThumbnail {
19
19
  /** @ignore */
20
20
  export interface SerializedUnfurlThumbnail {
21
21
  'url': string;
22
- 'width'?: number | null;
23
- 'height'?: number | null;
22
+ 'width'?: number | null | undefined;
23
+ 'height'?: number | null | undefined;
24
24
  }
25
25
  /** @ignore */
26
26
  export declare const isValidUnfurlThumbnail: (subject: unknown) => subject is import("../guards").DestructureGuardedTypeObj<{
@@ -135,7 +135,7 @@ exports.mapValidator = mapValidator;
135
135
  */
136
136
  function objectValidator(validatorStructure) {
137
137
  return (subject) => {
138
- if ((0, checks_1.isArray)(subject) || !(0, checks_1.isObject)(subject)) {
138
+ if ((0, checks_1.isArray)(subject) || !(0, checks_1.isObjectUnsafe)(subject)) {
139
139
  return false;
140
140
  }
141
141
  else {
@@ -153,7 +153,7 @@ exports.objectValidator = objectValidator;
153
153
  */
154
154
  function partialObjectValidator(validatorStructure) {
155
155
  return (subject) => {
156
- if ((0, checks_1.isArray)(subject) || !(0, checks_1.isObject)(subject)) {
156
+ if ((0, checks_1.isArray)(subject) || !(0, checks_1.isObjectUnsafe)(subject)) {
157
157
  return false;
158
158
  }
159
159
  else {
@@ -36,7 +36,7 @@ class CollectionProxy extends propertystoreproxy_1.PropertyStoreProxy {
36
36
  }
37
37
  getSyncCollectionId() {
38
38
  const upstreamConfig = this.properties.get('UpstreamConfig');
39
- if ((0, checks_1.isObject)(upstreamConfig) && (0, checks_1.isString)(upstreamConfig['SyncId'])) {
39
+ if ((0, checks_1.isObjectUnsafe)(upstreamConfig) && (0, checks_1.isString)(upstreamConfig['SyncId'])) {
40
40
  return upstreamConfig['SyncId'];
41
41
  }
42
42
  return undefined;
@@ -53,7 +53,7 @@ class DataSourceProxy extends propertystoreproxy_1.PropertyStoreProxy {
53
53
  */
54
54
  getSourceConfig() {
55
55
  const upstream = this.properties.get('Upstream');
56
- if ((0, checks_1.isObject)(upstream)) {
56
+ if ((0, checks_1.isObjectUnsafe)(upstream)) {
57
57
  return upstream['SourceConfig'];
58
58
  }
59
59
  return {};
@@ -10,4 +10,4 @@ var DataUpdateFilterType;
10
10
  DataUpdateFilterType["CurrentCollectionUpdates"] = "CurrentCollectionUpdates";
11
11
  /** All updates to items already present on the document will be sent to the document. New items created in the data source will not be created on the document. */
12
12
  DataUpdateFilterType["CurrentItemUpdates"] = "CurrentItemUpdates";
13
- })(DataUpdateFilterType = exports.DataUpdateFilterType || (exports.DataUpdateFilterType = {}));
13
+ })(DataUpdateFilterType || (exports.DataUpdateFilterType = DataUpdateFilterType = {}));
@@ -7,4 +7,4 @@ var DataConnectorActionKeys;
7
7
  DataConnectorActionKeys["ManageWebhook"] = "ManageWebhook";
8
8
  DataConnectorActionKeys["Patch"] = "Patch";
9
9
  DataConnectorActionKeys["UnbatchedPatch"] = "UnbatchedPatch";
10
- })(DataConnectorActionKeys = exports.DataConnectorActionKeys || (exports.DataConnectorActionKeys = {}));
10
+ })(DataConnectorActionKeys || (exports.DataConnectorActionKeys = DataConnectorActionKeys = {}));
@@ -22,8 +22,8 @@ const serializedPatchDataValidator = (0, validators_1.objectValidator)({
22
22
  'packageVersion': checks_1.isString,
23
23
  'patches': (0, validators_1.arrayValidator)((0, validators_1.objectValidator)({
24
24
  'patch': (0, validators_1.objectValidator)({
25
- 'itemsAdded': (0, validators_1.objectOfValidator)(checks_1.isObject),
26
- 'itemsChanged': (0, validators_1.objectOfValidator)(checks_1.isObject),
25
+ 'itemsAdded': (0, validators_1.objectOfValidator)(checks_1.isObjectUnsafe),
26
+ 'itemsChanged': (0, validators_1.objectOfValidator)(checks_1.isObjectUnsafe),
27
27
  'itemsDeleted': (0, validators_1.arrayValidator)(checks_1.isString),
28
28
  'syncSourceId': checks_1.isString,
29
29
  'syncCollectionId': checks_1.isString,
@@ -136,5 +136,5 @@ class DataConnector {
136
136
  exports.DataConnector = DataConnector;
137
137
  // instanceof DataConnectorRunError will not work in some environments
138
138
  function isDataConnectorRunError(e) {
139
- return (0, checks_1.isObject)(e) && (0, checks_1.isNumber)(e.status) && e.hasOwnProperty('body');
139
+ return (0, checks_1.isObjectUnsafe)(e) && (0, checks_1.isNumber)(e.status) && e.hasOwnProperty('body');
140
140
  }
@@ -22,9 +22,9 @@ class CustomBlockProxy extends blockproxy_1.BlockProxy {
22
22
  static getCustomBlockClass(client, id) {
23
23
  if (this.subclassRegistry.size > 0) {
24
24
  const stencil = client.sendCommand("gp" /* CommandName.GetProperty */, { 'id': id, 'p': 'Stencil' });
25
- if ((0, checks_1.isObject)(stencil)) {
25
+ if ((0, checks_1.isObjectUnsafe)(stencil)) {
26
26
  const sourceStencil = client.sendCommand("gp" /* CommandName.GetProperty */, { 'p': 'Stencil-' + stencil['id'] });
27
- if ((0, checks_1.isObject)(sourceStencil) && (0, checks_1.isObject)(sourceStencil['sourcePackage'])) {
27
+ if ((0, checks_1.isObjectUnsafe)(sourceStencil) && (0, checks_1.isObjectUnsafe)(sourceStencil['sourcePackage'])) {
28
28
  if (sourceStencil['sourcePackage']['packageId'] === lucid.getPackageId()) {
29
29
  const byLibrary = CustomBlockProxy.subclassRegistry.get(String(sourceStencil['sourcePackage']['library']));
30
30
  const klass = byLibrary === null || byLibrary === void 0 ? void 0 : byLibrary.get(String(sourceStencil['sourcePackage']['shape']));
@@ -39,9 +39,9 @@ class CustomBlockProxy extends blockproxy_1.BlockProxy {
39
39
  }
40
40
  isFromStencil(library, shape) {
41
41
  const stencil = this.properties.get('Stencil');
42
- if ((0, checks_1.isObject)(stencil)) {
42
+ if ((0, checks_1.isObjectUnsafe)(stencil)) {
43
43
  const sourceStencil = this.client.sendCommand("gp" /* CommandName.GetProperty */, { 'p': 'Stencil-' + stencil['id'] });
44
- if ((0, checks_1.isObject)(sourceStencil) && (0, checks_1.isObject)(sourceStencil['sourcePackage'])) {
44
+ if ((0, checks_1.isObjectUnsafe)(sourceStencil) && (0, checks_1.isObjectUnsafe)(sourceStencil['sourcePackage'])) {
45
45
  return (sourceStencil['sourcePackage']['packageId'] === lucid.getPackageId() &&
46
46
  sourceStencil['sourcePackage']['library'] === library &&
47
47
  sourceStencil['sourcePackage']['shape'] === shape);
@@ -6,7 +6,7 @@ var LegendItemType;
6
6
  (function (LegendItemType) {
7
7
  LegendItemType["Color"] = "color";
8
8
  LegendItemType["Shape"] = "shape";
9
- })(LegendItemType = exports.LegendItemType || (exports.LegendItemType = {}));
9
+ })(LegendItemType || (exports.LegendItemType = LegendItemType = {}));
10
10
  class LegendEntryProxy {
11
11
  constructor(legend, index, type) {
12
12
  this.legend = legend;
@@ -23,4 +23,4 @@ var DocumentAccessPermission;
23
23
  * Can view but can't share, edit, comment, or change access permissions.
24
24
  */
25
25
  DocumentAccessPermission["View"] = "view";
26
- })(DocumentAccessPermission = exports.DocumentAccessPermission || (exports.DocumentAccessPermission = {}));
26
+ })(DocumentAccessPermission || (exports.DocumentAccessPermission = DocumentAccessPermission = {}));
@@ -18,4 +18,4 @@ var DocumentElementType;
18
18
  DocumentElementType["GeneratorView"] = "GeneratorView";
19
19
  DocumentElementType["ShapeStylePreset"] = "ShapeStylePreset";
20
20
  DocumentElementType["ShapeSpecificDefaultProperties"] = "ShapeSpecificDefaultProperties";
21
- })(DocumentElementType = exports.DocumentElementType || (exports.DocumentElementType = {}));
21
+ })(DocumentElementType || (exports.DocumentElementType = DocumentElementType = {}));
@@ -10,7 +10,7 @@ var LineShape;
10
10
  LineShape["Curve"] = "curve";
11
11
  LineShape["Elbow"] = "elbow";
12
12
  LineShape["Diagonal"] = "diagonal";
13
- })(LineShape = exports.LineShape || (exports.LineShape = {}));
13
+ })(LineShape || (exports.LineShape = LineShape = {}));
14
14
  /**
15
15
  * A line on the current Lucid document
16
16
  */
@@ -151,7 +151,7 @@ class LineProxy extends itemproxy_1.ItemProxy {
151
151
  */
152
152
  getTextAreaPosition(name) {
153
153
  const serializedTextAreas = this.properties.get('TextAreas');
154
- if ((0, checks_1.isObject)(serializedTextAreas)) {
154
+ if ((0, checks_1.isObjectUnsafe)(serializedTextAreas)) {
155
155
  const rawEntry = serializedTextAreas[name];
156
156
  if ((0, linetextareapositioning_1.isSerializedLineTextAreaPositioning)(rawEntry)) {
157
157
  return (0, linetextareapositioning_1.deserializeLineTextAreaPositioning)(rawEntry);
@@ -4,7 +4,7 @@ exports.serializeLineTextAreaPositioning = exports.deserializeLineTextAreaPositi
4
4
  const checks_1 = require("../core/checks");
5
5
  /** @ignore */
6
6
  function isSerializedLineTextAreaPositioning(raw) {
7
- return ((0, checks_1.isObject)(raw) &&
7
+ return ((0, checks_1.isObjectUnsafe)(raw) &&
8
8
  (0, checks_1.isNumber)(raw['Location']) &&
9
9
  (0, checks_1.isNumber)(raw['Side']) &&
10
10
  ((0, checks_1.isBoolean)(raw['AllowOverBlock']) || (0, checks_1.isUndefined)(raw['AllowOverBlock'])));
@@ -15,7 +15,7 @@ var TextMarkupNames;
15
15
  TextMarkupNames["Size"] = "size";
16
16
  TextMarkupNames["Color"] = "color";
17
17
  TextMarkupNames["HAlign"] = "align";
18
- })(TextMarkupNames = exports.TextMarkupNames || (exports.TextMarkupNames = {}));
18
+ })(TextMarkupNames || (exports.TextMarkupNames = TextMarkupNames = {}));
19
19
  exports.isPartialTextStyle = (0, validators_1.partialObjectValidator)({
20
20
  [TextMarkupNames.Family]: checks_1.isString,
21
21
  [TextMarkupNames.Bold]: checks_1.isBoolean,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.218",
3
+ "version": "0.0.219",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -12,6 +12,6 @@
12
12
  "@types/node": "^16.11.11",
13
13
  "typedoc": "^0.23.15",
14
14
  "typedoc-plugin-markdown": "^3.13.6",
15
- "typescript": "4.7.4"
15
+ "typescript": "5.1.6"
16
16
  }
17
17
  }
package/ui/iframeui.js CHANGED
@@ -9,7 +9,7 @@ var IncomingUIMessageType;
9
9
  IncomingUIMessageType[IncomingUIMessageType["PostMessageFromFrame"] = 2] = "PostMessageFromFrame";
10
10
  IncomingUIMessageType[IncomingUIMessageType["FrameLoaded"] = 3] = "FrameLoaded";
11
11
  IncomingUIMessageType[IncomingUIMessageType["FramePosition"] = 4] = "FramePosition";
12
- })(IncomingUIMessageType = exports.IncomingUIMessageType || (exports.IncomingUIMessageType = {}));
12
+ })(IncomingUIMessageType || (exports.IncomingUIMessageType = IncomingUIMessageType = {}));
13
13
  /**
14
14
  * Base class for defining and interacting with custom UI elements whose contents are displayed
15
15
  * in an iframe.
package/ui/menu.js CHANGED
@@ -13,7 +13,7 @@ var MenuType;
13
13
  MenuType[MenuType["Context"] = 2] = "Context";
14
14
  /** The side dock in Lucidspark and Teamspaces */
15
15
  MenuType[MenuType["ContentDock"] = 3] = "ContentDock";
16
- })(MenuType = exports.MenuType || (exports.MenuType = {}));
16
+ })(MenuType || (exports.MenuType = MenuType = {}));
17
17
  /**
18
18
  * Semantic locations to place a new menu item.
19
19
  */
@@ -26,7 +26,7 @@ var MenuLocation;
26
26
  MenuLocation[MenuLocation["Share"] = 4] = "Share";
27
27
  MenuLocation[MenuLocation["Export"] = 5] = "Export";
28
28
  MenuLocation[MenuLocation["Import"] = 6] = "Import";
29
- })(MenuLocation = exports.MenuLocation || (exports.MenuLocation = {}));
29
+ })(MenuLocation || (exports.MenuLocation = MenuLocation = {}));
30
30
  class Menu {
31
31
  constructor(client) {
32
32
  this.client = client;
package/ui/panel.js CHANGED
@@ -13,7 +13,7 @@ var PanelLocation;
13
13
  PanelLocation[PanelLocation["ContentDock"] = 2] = "ContentDock";
14
14
  /** In Lucidchart & Lucidspark, add to the image dock */
15
15
  PanelLocation[PanelLocation["ImageSearchTab"] = 3] = "ImageSearchTab";
16
- })(PanelLocation = exports.PanelLocation || (exports.PanelLocation = {}));
16
+ })(PanelLocation || (exports.PanelLocation = PanelLocation = {}));
17
17
  /**
18
18
  * Extend this class to show a custom panel to the user, whose contents are displayed in a sandboxed
19
19
  * iframe controlled by your extension.