lucid-extension-sdk 0.0.217 → 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 (68) hide show
  1. package/commandtypes.d.ts +10 -2
  2. package/commandtypes.js +11 -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/blockproxy.d.ts +4 -0
  55. package/document/blockproxy.js +7 -0
  56. package/document/documentaccesspermission.js +1 -1
  57. package/document/documentelement/documentelementtype.js +1 -1
  58. package/document/lineproxy.js +2 -2
  59. package/document/linetextareapositioning.js +1 -1
  60. package/document/pageproxy.d.ts +2 -2
  61. package/document/pageproxy.js +3 -1
  62. package/document/text/textstyle.js +1 -1
  63. package/math.d.ts +13 -0
  64. package/math.js +55 -1
  65. package/package.json +2 -2
  66. package/ui/iframeui.js +1 -1
  67. package/ui/menu.js +2 -2
  68. 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;
@@ -1096,11 +1096,19 @@ export type GetItemsAtQuery = {
1096
1096
  };
1097
1097
  /** IDs of the items found */
1098
1098
  export type GetItemsAtResult = string[];
1099
+ export declare enum GetLLMContextType {
1100
+ /** Get context in a format for LLMs where relationships among connected and contained items is preserved */
1101
+ Relational = 1,
1102
+ /** Get context containing only plain text displayed on the given items, more suitable for embeddings */
1103
+ PlainText = 2
1104
+ }
1099
1105
  export type GetLLMContextFromItemsQuery = {
1100
1106
  /** Page ID to find closely-related items */
1101
1107
  'p': string;
1102
1108
  /** List of item IDs to return LLM-readable context for */
1103
1109
  'i': string[];
1110
+ /** Type of context to get */
1111
+ 't'?: GetLLMContextType | undefined;
1104
1112
  };
1105
1113
  export type GetLLMContextFromItemsResult = {
1106
1114
  /**
package/commandtypes.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ZOrderOperation = exports.isRawSendXHRResponse = exports.GetItemsAtSearchType = exports.HashAlgorithmEnum = exports.commandTitles = void 0;
3
+ exports.ZOrderOperation = exports.isRawSendXHRResponse = exports.GetLLMContextType = exports.GetItemsAtSearchType = exports.HashAlgorithmEnum = exports.commandTitles = void 0;
4
4
  const checks_1 = require("./core/checks");
5
5
  /** @ignore */
6
6
  exports.commandTitles = new Map([
@@ -128,13 +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
+ var GetLLMContextType;
139
+ (function (GetLLMContextType) {
140
+ /** Get context in a format for LLMs where relationships among connected and contained items is preserved */
141
+ GetLLMContextType[GetLLMContextType["Relational"] = 1] = "Relational";
142
+ /** Get context containing only plain text displayed on the given items, more suitable for embeddings */
143
+ GetLLMContextType[GetLLMContextType["PlainText"] = 2] = "PlainText";
144
+ })(GetLLMContextType || (exports.GetLLMContextType = GetLLMContextType = {}));
138
145
  function isRawSendXHRResponse(val) {
139
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']);
140
147
  }
@@ -145,4 +152,4 @@ var ZOrderOperation;
145
152
  ZOrderOperation[ZOrderOperation["TOP"] = 2] = "TOP";
146
153
  ZOrderOperation[ZOrderOperation["DOWN"] = 3] = "DOWN";
147
154
  ZOrderOperation[ZOrderOperation["BOTTOM"] = 4] = "BOTTOM";
148
- })(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
  */