lucid-extension-sdk 1.1.1 → 1.1.3

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 (38) hide show
  1. package/commandtypes.d.ts +6 -4
  2. package/core/cardintegration/cardfielddisplaysettings.d.ts +33 -6
  3. package/core/cardintegration/cardfielddisplaysettings.js +12 -0
  4. package/core/cardintegration/cardintegrationautosyncconfig.d.ts +35 -4
  5. package/core/cardintegration/cardintegrationautosyncconfig.js +6 -1
  6. package/core/cardintegration/cardintegrationconfig.d.ts +10 -5
  7. package/core/cardintegration/cardintegrationparams.d.ts +4 -0
  8. package/core/cardintegration/lucidcardintegrationregistry.d.ts +0 -5
  9. package/core/cardintegration/lucidcardintegrationregistry.js +8 -191
  10. package/core/checks.d.ts +1 -0
  11. package/core/checks.js +14 -0
  12. package/core/sharedcardintegration/sharedregistryutil.d.ts +47 -1
  13. package/core/sharedcardintegration/sharedregistryutil.js +203 -0
  14. package/core/spreadsheetintegration/lucidspreadsheetintegration.d.ts +5 -0
  15. package/core/spreadsheetintegration/lucidspreadsheetintegrationregistry.js +3 -0
  16. package/dataconnector/actions/action.d.ts +20 -1
  17. package/dataconnector/actions/action.js +7 -1
  18. package/dataconnector/actions/serializedactions.js +7 -5
  19. package/dataconnector/dataconnector.js +5 -1
  20. package/dataconnector/datasourceupdatetypes.d.ts +14 -0
  21. package/dataconnector/datasourceupdatetypes.js +19 -1
  22. package/dataconnector/querycollection/buildpatches.d.ts +38 -0
  23. package/dataconnector/querycollection/buildpatches.js +66 -0
  24. package/dataconnector/querycollection/derivequerycollectionschema.d.ts +15 -0
  25. package/dataconnector/querycollection/derivequerycollectionschema.js +36 -0
  26. package/dataconnector/querycollection/diffprimarykeys.d.ts +21 -0
  27. package/dataconnector/querycollection/diffprimarykeys.js +31 -0
  28. package/dataconnector/querycollection/getquerycollections.d.ts +21 -0
  29. package/dataconnector/querycollection/getquerycollections.js +44 -0
  30. package/dataconnector/querycollection/index.d.ts +5 -0
  31. package/dataconnector/querycollection/index.js +15 -0
  32. package/dataconnector/querycollection/sendquerycollectionpatch.d.ts +15 -0
  33. package/dataconnector/querycollection/sendquerycollectionpatch.js +21 -0
  34. package/document/linetextareapositioning.d.ts +13 -0
  35. package/document/linetextareapositioning.js +11 -2
  36. package/index.d.ts +190 -121
  37. package/index.js +583 -135
  38. package/package.json +1 -1
package/commandtypes.d.ts CHANGED
@@ -858,13 +858,11 @@ export type AutoSyncSettings = {
858
858
  'gsf': string;
859
859
  'sqs'?: string | undefined;
860
860
  'syqs'?: string | undefined;
861
- /** getDefaultFilterFields action ID - field-only config */
862
- 'gdf'?: string | undefined;
863
861
  /** searchFields action ID - field-only config */
864
862
  'sf'?: string | undefined;
865
863
  /** syncFields action ID - field-only config */
866
864
  'syf'?: string | undefined;
867
- /** If specified, setup fields that allow user to create query template that auto applies to dynamic tables when created*/
865
+ /** If specified, setup fields that allow user to create query template that auto applies to dynamic tables when created */
868
866
  'dpf'?: {
869
867
  /** Get search fields action */
870
868
  'gsf': string;
@@ -872,8 +870,10 @@ export type AutoSyncSettings = {
872
870
  'gpv': string;
873
871
  } | undefined;
874
872
  'cftqs'?: string | undefined;
875
- /** Get default filter fields action */
873
+ /** Get default filter fields action. Used in both field-only and query-string configurations. */
876
874
  'gdff'?: string | undefined;
875
+ /** Get more filter fields action. Used in both field-only and query-string configurations. */
876
+ 'gmff'?: string | undefined;
877
877
  };
878
878
  export type SerializedFieldConfiguration = {
879
879
  /** Callback to get field definitions for all fields supported by the card integration */
@@ -1137,6 +1137,8 @@ export type AddSpreadsheetIntegrationQuery = {
1137
1137
  [K in keyof SerializedFieldConfiguration]?: SerializedFieldConfiguration[K] | undefined;
1138
1138
  } | undefined;
1139
1139
  'dm'?: DependencyMappingSettings | undefined;
1140
+ /** Auto-sync configuration (only honored when `c` / addCardsIntegration is true) */
1141
+ 'as'?: AutoSyncSettings | undefined;
1140
1142
  };
1141
1143
  /** @ignore until spreadsheet integration is ready for launch (CHART-51946) */
1142
1144
  export type AddSpreadsheetIntegrationResult = undefined;
@@ -63,6 +63,12 @@ export declare const FieldDisplayType: {
63
63
  * Truncates value to be a maximum of 20 chars, appending '...' to the given value.
64
64
  */
65
65
  readonly CustomTextField: "CustomTextField";
66
+ /**
67
+ * @experimental
68
+ * Renders the field value as a small 24x24 rounded-square icon aligned inline with
69
+ * one of the card's text rows. Use `inlineRowIndex` on the stencil config to pick which row.
70
+ */
71
+ readonly InlineIcon: "InlineIcon";
66
72
  };
67
73
  export type FieldDisplayType = (typeof FieldDisplayType)[keyof typeof FieldDisplayType];
68
74
  export declare const isFieldDisplayType: (x: unknown) => x is {} extends {
@@ -123,7 +129,13 @@ export declare const isFieldDisplayType: (x: unknown) => x is {} extends {
123
129
  * Truncates value to be a maximum of 20 chars, appending '...' to the given value.
124
130
  */
125
131
  readonly CustomTextField: "CustomTextField";
126
- } ? never : "BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField";
132
+ /**
133
+ * @experimental
134
+ * Renders the field value as a small 24x24 rounded-square icon aligned inline with
135
+ * one of the card's text rows. Use `inlineRowIndex` on the stencil config to pick which row.
136
+ */
137
+ readonly InlineIcon: "InlineIcon";
138
+ } ? never : "BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField" | "InlineIcon";
127
139
  /**
128
140
  * When configuring a field on a LucidCardBlock to be displayed as a data graphic, this click handler value
129
141
  * specifies what to do when the user clicks on the data graphic produced.
@@ -225,7 +237,7 @@ declare const StencilConfigFormatter: import("../format/format").Format<import("
225
237
  * The serialized key is `getterKey` for backwards compatible, legacy reasons. We have renamed this field in code,
226
238
  * but need to support the original serialized key.
227
239
  */
228
- readonly displayType: readonly ["getterKey", import("../format/format").Format<"BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField", "BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField">];
240
+ readonly displayType: readonly ["getterKey", import("../format/format").Format<"BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField" | "InlineIcon", "BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField" | "InlineIcon">];
229
241
  /**
230
242
  * For displayType values that support it, you may provide an override for the
231
243
  * background color for this data. If this is not provided, the background color
@@ -320,8 +332,14 @@ declare const StencilConfigFormatter: import("../format/format").Format<import("
320
332
  readonly iswithinpill?: boolean | null | undefined;
321
333
  readonly hasleadingicon?: boolean | null | undefined;
322
334
  } | null | undefined>];
335
+ /**
336
+ * @experimental
337
+ * For inline stencils, this is the index of the text row that the stencil should render
338
+ * alongside. Ignored for non-inline display types, defaults to 0 (the first text row)
339
+ */
340
+ readonly inlineRowIndex: readonly ["inlineRowIndex", import("../format/format").Format<number | null | undefined, number | null | undefined>];
323
341
  }>, {
324
- readonly displayType: "BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField";
342
+ readonly displayType: "BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField" | "InlineIcon";
325
343
  readonly backgroundColor?: string | null | undefined;
326
344
  readonly foregroundColor?: string | null | undefined;
327
345
  readonly imageBadgeSettings?: {
@@ -347,6 +365,7 @@ declare const StencilConfigFormatter: import("../format/format").Format<import("
347
365
  readonly iswithinpill?: boolean | null | undefined;
348
366
  readonly hasleadingicon?: boolean | null | undefined;
349
367
  } | null | undefined;
368
+ readonly inlineRowIndex?: number | null | undefined;
350
369
  }>;
351
370
  export type StencilConfig = FormatToDeserializedType<typeof StencilConfigFormatter>;
352
371
  export declare const CardFieldDisplaySettingsFormatter: import("../format/format").Format<import("../format/objectformat").ObjectFormatSerializedType<{
@@ -358,7 +377,7 @@ export declare const CardFieldDisplaySettingsFormatter: import("../format/format
358
377
  * The serialized key is `getterKey` for backwards compatible, legacy reasons. We have renamed this field in code,
359
378
  * but need to support the original serialized key.
360
379
  */
361
- readonly displayType: readonly ["getterKey", import("../format/format").Format<"BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField", "BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField">];
380
+ readonly displayType: readonly ["getterKey", import("../format/format").Format<"BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField" | "InlineIcon", "BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField" | "InlineIcon">];
362
381
  /**
363
382
  * For displayType values that support it, you may provide an override for the
364
383
  * background color for this data. If this is not provided, the background color
@@ -453,8 +472,14 @@ export declare const CardFieldDisplaySettingsFormatter: import("../format/format
453
472
  readonly iswithinpill?: boolean | null | undefined;
454
473
  readonly hasleadingicon?: boolean | null | undefined;
455
474
  } | null | undefined>];
475
+ /**
476
+ * @experimental
477
+ * For inline stencils, this is the index of the text row that the stencil should render
478
+ * alongside. Ignored for non-inline display types, defaults to 0 (the first text row)
479
+ */
480
+ readonly inlineRowIndex: readonly ["inlineRowIndex", import("../format/format").Format<number | null | undefined, number | null | undefined>];
456
481
  }> | null | undefined, {
457
- readonly displayType: "BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField";
482
+ readonly displayType: "BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField" | "InlineIcon";
458
483
  readonly backgroundColor?: string | null | undefined;
459
484
  readonly foregroundColor?: string | null | undefined;
460
485
  readonly imageBadgeSettings?: {
@@ -480,10 +505,11 @@ export declare const CardFieldDisplaySettingsFormatter: import("../format/format
480
505
  readonly iswithinpill?: boolean | null | undefined;
481
506
  readonly hasleadingicon?: boolean | null | undefined;
482
507
  } | null | undefined;
508
+ readonly inlineRowIndex?: number | null | undefined;
483
509
  } | null | undefined>];
484
510
  }>, {
485
511
  readonly stencilConfig?: {
486
- readonly displayType: "BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField";
512
+ readonly displayType: "BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField" | "InlineIcon";
487
513
  readonly backgroundColor?: string | null | undefined;
488
514
  readonly foregroundColor?: string | null | undefined;
489
515
  readonly imageBadgeSettings?: {
@@ -509,6 +535,7 @@ export declare const CardFieldDisplaySettingsFormatter: import("../format/format
509
535
  readonly iswithinpill?: boolean | null | undefined;
510
536
  readonly hasleadingicon?: boolean | null | undefined;
511
537
  } | null | undefined;
538
+ readonly inlineRowIndex?: number | null | undefined;
512
539
  } | null | undefined;
513
540
  }>;
514
541
  /**
@@ -71,6 +71,12 @@ exports.FieldDisplayType = {
71
71
  * Truncates value to be a maximum of 20 chars, appending '...' to the given value.
72
72
  */
73
73
  CustomTextField: 'CustomTextField',
74
+ /**
75
+ * @experimental
76
+ * Renders the field value as a small 24x24 rounded-square icon aligned inline with
77
+ * one of the card's text rows. Use `inlineRowIndex` on the stencil config to pick which row.
78
+ */
79
+ InlineIcon: 'InlineIcon',
74
80
  };
75
81
  exports.isFieldDisplayType = (0, validators_1.enumValidator)(exports.FieldDisplayType);
76
82
  /**
@@ -194,6 +200,12 @@ const StencilConfigFormatter = (0, objectformat_1.ObjectFormat)({
194
200
  * You can change bold, italic, underline, rounding, minwidth, minheight, maxtextwidth, maxfontsize
195
201
  */
196
202
  textBadgeSettings: ['textBadgeSettings', (0, format_1.OptionFormat)(TextBadgeSettingsFormatter)],
203
+ /**
204
+ * @experimental
205
+ * For inline stencils, this is the index of the text row that the stencil should render
206
+ * alongside. Ignored for non-inline display types, defaults to 0 (the first text row)
207
+ */
208
+ inlineRowIndex: ['inlineRowIndex', (0, format_1.OptionFormat)(primitiveformat_1.NumberFormat)],
197
209
  });
198
210
  exports.CardFieldDisplaySettingsFormatter = (0, objectformat_1.ObjectFormat)({
199
211
  stencilConfig: ['StencilConfig', (0, format_1.OptionFormat)(StencilConfigFormatter)],
@@ -1,3 +1,4 @@
1
+ import { isString } from '../checks';
1
2
  import type { SerializedFieldType } from '../data/serializedfield/serializedfields';
2
3
  import type { ExtensionCardFieldDefinition, ImportResult, SearchResult } from '../sharedcardintegration/cardintegrationdefinitions';
3
4
  import type { DocumentPresetSetupFields } from './lucidcardintegrationpresetsetupmodal';
@@ -60,18 +61,30 @@ export interface QueryStringCardIntegrationAutoSyncConfig extends BaseCardIntegr
60
61
  * when advanced search mode is enabled and filters are changed.
61
62
  *
62
63
  * @param filterFields The current filter selections
63
- * @returns The generated query string, or undefined if no query can be generated
64
+ * @returns One of:
65
+ * - A query string to populate the search bar with.
66
+ * - A {@link ConvertFiltersToQueryStringResult} object that can carry either a `queryString`
67
+ * for success, or an `error` message that will be displayed to the user.
68
+ * - `undefined`, equivalent to an empty result.
64
69
  */
65
- convertFiltersToQueryString?: (filterFields: Map<string, SerializedFieldType>) => Promise<string | undefined>;
70
+ convertFiltersToQueryString?: (filterFields: Map<string, SerializedFieldType>) => Promise<string | ConvertFiltersToQueryStringResult | undefined>;
66
71
  /**
67
72
  * Provides the default filter fields to display in the auto-sync UI when advanced search mode is
68
73
  * enabled. These fields seed the filter form so the user can refine the query without having to
69
74
  * type a raw query string.
70
75
  *
71
76
  * @param searchSoFar The fields the user has populated so far (e.g. the selected data source id)
72
- * @returns The filter fields to render
77
+ * @returns The filter fields to always render
73
78
  */
74
79
  getDefaultFilterFields?: (searchSoFar: Map<string, SerializedFieldType>) => Promise<ExtensionCardFieldDefinition[]>;
80
+ /**
81
+ * Provides the additional filter fields a user can pin from the "More filters" picker.
82
+ * Implementations **MUST exclude** any field already returned by {@link getDefaultFilterFields}.
83
+ *
84
+ * @param searchSoFar The fields the user has populated so far (e.g. the selected data source id)
85
+ * @returns The additional filter fields, excluding default fields
86
+ */
87
+ getMoreFilterFields?: (searchSoFar: Map<string, SerializedFieldType>) => Promise<ExtensionCardFieldDefinition[]>;
75
88
  }
76
89
  /**
77
90
  * @experimental
@@ -83,10 +96,20 @@ export interface FieldOnlyCardIntegrationAutoSyncConfig extends BaseCardIntegrat
83
96
  * Returns the filter field definitions available for the user to configure. Called whenever the
84
97
  * current field selections change, allowing fields to be dynamically updated based on prior selections.
85
98
  *
99
+ * Keep this callback fast — it is called eagerly whenever the filter form is shown.
100
+ *
86
101
  * @param searchSoFar The filter field values selected so far
87
- * @returns the field definitions to display for filtering
102
+ * @returns the field definitions to display for filtering by default
88
103
  */
89
104
  getDefaultFilterFields: (searchSoFar: Map<string, SerializedFieldType>) => Promise<ExtensionCardFieldDefinition[]>;
105
+ /**
106
+ * Provides the additional filter fields a user can pin from the "More filters" picker.
107
+ * Implementations **MUST exclude** any field already returned by {@link getDefaultFilterFields}.
108
+ *
109
+ * @param searchSoFar The filter field values selected so far
110
+ * @returns The additional filter fields, excluding default fields
111
+ */
112
+ getMoreFilterFields?: (searchSoFar: Map<string, SerializedFieldType>) => Promise<ExtensionCardFieldDefinition[]>;
90
113
  /**
91
114
  * Perform a search using the selected filter field values. This should support pagination
92
115
  * (See {@link AutoSyncPaginationSize}).
@@ -152,3 +175,11 @@ export declare const isSupportedAutoSyncGeneratorType: (x: unknown) => x is {} e
152
175
  readonly DynamicMatrix: "dynamic matrix";
153
176
  readonly Frame: "frame";
154
177
  } ? never : "timeline" | "dynamic matrix" | "frame";
178
+ export interface ConvertFiltersToQueryStringResult {
179
+ queryString?: string | undefined;
180
+ error?: string | undefined;
181
+ }
182
+ export declare const isConvertFiltersToQueryStringResult: (subject: unknown) => subject is Partial<import("../guards").DestructureGuardedTypeObj<{
183
+ queryString: typeof isString;
184
+ error: typeof isString;
185
+ }>>;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isSupportedAutoSyncGeneratorType = exports.SupportedAutoSyncGeneratorType = exports.AutoSyncPaginationSize = void 0;
3
+ exports.isConvertFiltersToQueryStringResult = exports.isSupportedAutoSyncGeneratorType = exports.SupportedAutoSyncGeneratorType = exports.AutoSyncPaginationSize = void 0;
4
+ const checks_1 = require("../checks");
4
5
  const validators_1 = require("../validators/validators");
5
6
  /**
6
7
  * The amount of results that will be displayed per page when using pagination. To enable pagination, define the
@@ -14,3 +15,7 @@ exports.SupportedAutoSyncGeneratorType = {
14
15
  Frame: 'frame',
15
16
  };
16
17
  exports.isSupportedAutoSyncGeneratorType = (0, validators_1.stringEnumValidator)(exports.SupportedAutoSyncGeneratorType);
18
+ exports.isConvertFiltersToQueryStringResult = (0, validators_1.partialObjectValidator)({
19
+ queryString: checks_1.isString,
20
+ error: checks_1.isString,
21
+ });
@@ -32,7 +32,7 @@ declare const CardIntegrationConfigFormatter: import("../format/format").Format<
32
32
  */
33
33
  readonly fieldDisplaySettings: readonly ["fd", import("../format/format").Format<[string, import("../format/objectformat").ObjectFormatSerializedType<{
34
34
  readonly stencilConfig: readonly ["StencilConfig", import("../format/format").Format<import("../format/objectformat").ObjectFormatSerializedType<{
35
- readonly displayType: readonly ["getterKey", import("../format/format").Format<"BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField", "BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField">];
35
+ readonly displayType: readonly ["getterKey", import("../format/format").Format<"BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField" | "InlineIcon", "BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField" | "InlineIcon">];
36
36
  readonly backgroundColor: readonly ["bg", import("../format/format").Format<string | null | undefined, string | null | undefined>];
37
37
  readonly foregroundColor: readonly ["fg", import("../format/format").Format<string | null | undefined, string | null | undefined>];
38
38
  readonly imageBadgeSettings: readonly ["imageBadgeSettings", import("../format/format").Format<import("../format/objectformat").ObjectFormatSerializedType<{
@@ -72,8 +72,9 @@ declare const CardIntegrationConfigFormatter: import("../format/format").Format<
72
72
  readonly iswithinpill?: boolean | null | undefined;
73
73
  readonly hasleadingicon?: boolean | null | undefined;
74
74
  } | null | undefined>];
75
+ readonly inlineRowIndex: readonly ["inlineRowIndex", import("../format/format").Format<number | null | undefined, number | null | undefined>];
75
76
  }> | null | undefined, {
76
- readonly displayType: "BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField";
77
+ readonly displayType: "BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField" | "InlineIcon";
77
78
  readonly backgroundColor?: string | null | undefined;
78
79
  readonly foregroundColor?: string | null | undefined;
79
80
  readonly imageBadgeSettings?: {
@@ -99,10 +100,11 @@ declare const CardIntegrationConfigFormatter: import("../format/format").Format<
99
100
  readonly iswithinpill?: boolean | null | undefined;
100
101
  readonly hasleadingicon?: boolean | null | undefined;
101
102
  } | null | undefined;
103
+ readonly inlineRowIndex?: number | null | undefined;
102
104
  } | null | undefined>];
103
105
  }>][] | null | undefined, Map<string, {
104
106
  readonly stencilConfig?: {
105
- readonly displayType: "BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField";
107
+ readonly displayType: "BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField" | "InlineIcon";
106
108
  readonly backgroundColor?: string | null | undefined;
107
109
  readonly foregroundColor?: string | null | undefined;
108
110
  readonly imageBadgeSettings?: {
@@ -128,6 +130,7 @@ declare const CardIntegrationConfigFormatter: import("../format/format").Format<
128
130
  readonly iswithinpill?: boolean | null | undefined;
129
131
  readonly hasleadingicon?: boolean | null | undefined;
130
132
  } | null | undefined;
133
+ readonly inlineRowIndex?: number | null | undefined;
131
134
  } | null | undefined;
132
135
  }> | null | undefined>];
133
136
  readonly supportsParentCards: readonly ["spc", import("../format/format").Format<boolean | null | undefined, boolean | null | undefined>];
@@ -144,7 +147,7 @@ declare const CardIntegrationConfigFormatter: import("../format/format").Format<
144
147
  }> | null | undefined;
145
148
  readonly fieldDisplaySettings?: Map<string, {
146
149
  readonly stencilConfig?: {
147
- readonly displayType: "BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField";
150
+ readonly displayType: "BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField" | "InlineIcon";
148
151
  readonly backgroundColor?: string | null | undefined;
149
152
  readonly foregroundColor?: string | null | undefined;
150
153
  readonly imageBadgeSettings?: {
@@ -170,6 +173,7 @@ declare const CardIntegrationConfigFormatter: import("../format/format").Format<
170
173
  readonly iswithinpill?: boolean | null | undefined;
171
174
  readonly hasleadingicon?: boolean | null | undefined;
172
175
  } | null | undefined;
176
+ readonly inlineRowIndex?: number | null | undefined;
173
177
  } | null | undefined;
174
178
  }> | null | undefined;
175
179
  readonly supportsParentCards?: boolean | null | undefined;
@@ -229,7 +233,7 @@ declare const CardIntegrationConfigFormatter: import("../format/format").Format<
229
233
  }> | null | undefined;
230
234
  readonly fieldDisplaySettings?: Map<string, {
231
235
  readonly stencilConfig?: {
232
- readonly displayType: "BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField";
236
+ readonly displayType: "BasicTextBadge" | "InitializedString" | "StandardEstimation" | "ImageBadge" | "SquareImageBadge" | "TagBadge" | "DateBadge" | "DateRangeBadge" | "UserProfile" | "CustomSingleSelectField" | "CustomTextField" | "InlineIcon";
233
237
  readonly backgroundColor?: string | null | undefined;
234
238
  readonly foregroundColor?: string | null | undefined;
235
239
  readonly imageBadgeSettings?: {
@@ -255,6 +259,7 @@ declare const CardIntegrationConfigFormatter: import("../format/format").Format<
255
259
  readonly iswithinpill?: boolean | null | undefined;
256
260
  readonly hasleadingicon?: boolean | null | undefined;
257
261
  } | null | undefined;
262
+ readonly inlineRowIndex?: number | null | undefined;
258
263
  } | null | undefined;
259
264
  }> | null | undefined;
260
265
  readonly supportsParentCards?: boolean | null | undefined;
@@ -56,6 +56,10 @@ export interface GetDefaultFilterFieldsParam {
56
56
  's': [string, SerializedFieldType][];
57
57
  }
58
58
  /** @ignore */
59
+ export interface GetMoreFilterFieldsParam {
60
+ 's': [string, SerializedFieldType][];
61
+ }
62
+ /** @ignore */
59
63
  export interface QuerySyncRemoveNonMatchingLabelParam {
60
64
  'g': string;
61
65
  }
@@ -18,11 +18,6 @@ export declare class LucidCardIntegrationRegistry {
18
18
  static registerTagCallback(client: EditorClient, callback: TagCallback): string;
19
19
  static registerBannerActionCallback(client: EditorClient, callback: (actionId: string) => void): string;
20
20
  private static registerDependencyMapping;
21
- private static serializeSearchResult;
22
- /**
23
- * Helper to serialize import results (single or array) to the expected format.
24
- */
25
- private static serializeImportResults;
26
21
  private static registerImportCardFromPastedLinkHandler;
27
22
  /**
28
23
  * Register a card integration.
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LucidCardIntegrationRegistry = void 0;
4
4
  const commandtypes_1 = require("../../commandtypes");
5
- const collectiondefinition_1 = require("../../data/collectiondefinition");
6
5
  const collectionproxy_1 = require("../../data/collectionproxy");
7
6
  const dataitemproxy_1 = require("../../data/dataitemproxy");
8
7
  const datasourceproxy_1 = require("../../data/datasourceproxy");
@@ -11,7 +10,6 @@ const checks_1 = require("../checks");
11
10
  const importcardfromdetails_1 = require("../importcardfromdetails/importcardfromdetails");
12
11
  const cardintegrationdefinitions_1 = require("../sharedcardintegration/cardintegrationdefinitions");
13
12
  const sharedregistryutil_1 = require("../sharedcardintegration/sharedregistryutil");
14
- const cardintegrationautosyncconfig_1 = require("./cardintegrationautosyncconfig");
15
13
  const cardintegrationconfig_1 = require("./cardintegrationconfig");
16
14
  const tabs_1 = require("./cardpaneltabs/tabs");
17
15
  const extensiondatapanellistitem_1 = require("./extensiondatapanel/extensiondatapanellistitem");
@@ -99,50 +97,6 @@ class LucidCardIntegrationRegistry {
99
97
  static registerDependencyMapping(client, cardIntegration, serialized) {
100
98
  return (0, sharedregistryutil_1.registerDependencyMapping)(client, cardIntegration, serialized, () => LucidCardIntegrationRegistry.nextHookName());
101
99
  }
102
- static serializeSearchResult(searchResult) {
103
- var _a;
104
- return {
105
- 'srs': searchResult.searchResults.map((resultPerCollection) => ({
106
- 'd': (0, collectiondefinition_1.serializeCollectionDefinition)(resultPerCollection.data),
107
- 'f': (0, cardintegrationdefinitions_1.serializeCardFieldArrayDefinition)(resultPerCollection.fields),
108
- 'm': resultPerCollection.partialImportMetadata && {
109
- 'cid': resultPerCollection.partialImportMetadata.collectionId,
110
- 'sid': resultPerCollection.partialImportMetadata.syncDataSourceId,
111
- },
112
- })),
113
- 'ipsr': searchResult.itemsPerSearchResult,
114
- 'e': searchResult.error,
115
- 'bs': (_a = searchResult.banners) === null || _a === void 0 ? void 0 : _a.map((banner) => ({
116
- 'ty': banner.type,
117
- 'msg': banner.message,
118
- 'btyp': banner.bannerType,
119
- 'actbtn': banner.actionButton
120
- ? {
121
- 'lab': banner.actionButton.label,
122
- 'aid': banner.actionButton.actionId,
123
- 'href': banner.actionButton.href,
124
- }
125
- : undefined,
126
- })),
127
- };
128
- }
129
- /**
130
- * Helper to serialize import results (single or array) to the expected format.
131
- */
132
- static serializeImportResults(result) {
133
- if ((0, checks_1.isArray)(result)) {
134
- return result.map((importResult) => {
135
- return {
136
- 'c': importResult.collection.id,
137
- 'pks': importResult.primaryKeys,
138
- };
139
- });
140
- }
141
- return {
142
- 'c': result.collection.id,
143
- 'pks': result.primaryKeys,
144
- };
145
- }
146
100
  static registerImportCardFromPastedLinkHandler(client, cardIntegration, serialized) {
147
101
  if (!cardIntegration.importCardFromPastedLink) {
148
102
  return;
@@ -175,7 +129,7 @@ class LucidCardIntegrationRegistry {
175
129
  * Register a card integration.
176
130
  */
177
131
  static addCardIntegration(client, cardIntegration) {
178
- var _a, _b, _c, _d, _e, _f;
132
+ var _a, _b, _c, _d;
179
133
  const getFieldsActionName = LucidCardIntegrationRegistry.nextHookName();
180
134
  client.registerAction(getFieldsActionName, async (param) => {
181
135
  const dataSource = new datasourceproxy_1.DataSourceProxy(param['d'], client);
@@ -282,32 +236,21 @@ class LucidCardIntegrationRegistry {
282
236
  const result = await importModal.search(new Map(param), offset, limit);
283
237
  if (!(0, cardintegrationdefinitions_1.isSearchResult)(result)) {
284
238
  if ((0, checks_1.isArray)(result)) {
285
- return this.serializeSearchResult({
239
+ return (0, sharedregistryutil_1.serializeSearchResult)({
286
240
  searchResults: result,
287
241
  });
288
242
  }
289
243
  else {
290
- return this.serializeSearchResult({
244
+ return (0, sharedregistryutil_1.serializeSearchResult)({
291
245
  searchResults: [result],
292
246
  });
293
247
  }
294
248
  }
295
- return this.serializeSearchResult(result);
249
+ return (0, sharedregistryutil_1.serializeSearchResult)(result);
296
250
  });
297
251
  client.registerAction(serialized['im']['i'], async ({ 'pks': primaryKeys, 's': searchFields }) => {
298
252
  const result = await importModal.import(primaryKeys, new Map(searchFields));
299
- if ((0, checks_1.isArray)(result)) {
300
- return result.map((importResult) => {
301
- return {
302
- 'c': importResult.collection.id,
303
- 'pks': importResult.primaryKeys,
304
- };
305
- });
306
- }
307
- return {
308
- 'c': result.collection.id,
309
- 'pks': result.primaryKeys,
310
- };
253
+ return (0, sharedregistryutil_1.serializeImportResults)(result);
311
254
  });
312
255
  if (serialized['im']['os']) {
313
256
  client.registerAction(serialized['im']['os'], async () => {
@@ -336,139 +279,13 @@ class LucidCardIntegrationRegistry {
336
279
  });
337
280
  }
338
281
  if (cardIntegration.autoSync) {
339
- const autoSync = cardIntegration.autoSync;
340
- serialized['as'] = {
341
- 'gsf': LucidCardIntegrationRegistry.nextHookName(),
342
- };
343
- if (autoSync.phrases) {
344
- serialized['as']['p'] = {
345
- 'h': autoSync.phrases.header,
346
- 'l': autoSync.phrases.label,
347
- 'qph': autoSync.phrases.queryPlaceholder,
348
- 'rnml': LucidCardIntegrationRegistry.nextHookName(),
349
- 'nml': autoSync.phrases.noMatchedLabel,
350
- 'esl': autoSync.phrases.emptyStateLabel,
351
- };
352
- client.registerAction(serialized['as']['p']['rnml'], ({ 'g': inputSoFar }) => {
353
- var _a;
354
- if (!(0, cardintegrationautosyncconfig_1.isSupportedAutoSyncGeneratorType)(inputSoFar)) {
355
- return '';
356
- }
357
- return (_a = autoSync.phrases) === null || _a === void 0 ? void 0 : _a.removeNonMatchingLabel(inputSoFar);
358
- });
359
- if ((_a = autoSync.phrases) === null || _a === void 0 ? void 0 : _a.syncingGrowlMessage) {
360
- serialized['as']['p']['sgm'] = LucidCardIntegrationRegistry.nextHookName();
361
- client.registerAction(serialized['as']['p']['sgm'], ({ 'c': count }) => {
362
- var _a, _b;
363
- return (_b = (_a = autoSync.phrases) === null || _a === void 0 ? void 0 : _a.syncingGrowlMessage) === null || _b === void 0 ? void 0 : _b.call(_a, count);
364
- });
365
- }
366
- if ((_b = autoSync.phrases) === null || _b === void 0 ? void 0 : _b.removingGrowlMessage) {
367
- serialized['as']['p']['rgm'] = LucidCardIntegrationRegistry.nextHookName();
368
- client.registerAction(serialized['as']['p']['rgm'], ({ 'c': count }) => {
369
- var _a, _b;
370
- return (_b = (_a = autoSync.phrases) === null || _a === void 0 ? void 0 : _a.removingGrowlMessage) === null || _b === void 0 ? void 0 : _b.call(_a, count);
371
- });
372
- }
373
- }
374
- client.registerAction(serialized['as']['gsf'], async ({ 'i': inputSoFar }) => {
375
- const result = await autoSync.getSyncDataSourceIdField(new Map(inputSoFar));
376
- return (0, cardintegrationdefinitions_1.serializeCardFieldArrayDefinition)(result);
377
- });
378
- if ('searchFields' in autoSync) {
379
- const fieldOnlyAutoSync = autoSync;
380
- serialized['as']['gdf'] = LucidCardIntegrationRegistry.nextHookName();
381
- client.registerAction(serialized['as']['gdf'], async ({ 'i': inputSoFar }) => {
382
- const result = await fieldOnlyAutoSync.getDefaultFilterFields(new Map(inputSoFar));
383
- return (0, cardintegrationdefinitions_1.serializeCardFieldArrayDefinition)(result);
384
- });
385
- serialized['as']['sf'] = LucidCardIntegrationRegistry.nextHookName();
386
- client.registerAction(serialized['as']['sf'], async ({ 'f': fields, 'if': instanceFields, 'pn': pageNumber, 'npt': nextPageToken, }) => {
387
- const result = await fieldOnlyAutoSync.searchFields(new Map(fields), new Map(instanceFields), pageNumber, nextPageToken);
388
- if (result) {
389
- return this.serializeSearchResult(result);
390
- }
391
- else {
392
- return this.serializeSearchResult({
393
- searchResults: [],
394
- error: 'Unknown Error Occurred',
395
- });
396
- }
397
- });
398
- serialized['as']['syf'] = LucidCardIntegrationRegistry.nextHookName();
399
- client.registerAction(serialized['as']['syf'], async ({ 'f': fields, 'if': instanceFields }) => {
400
- var _a;
401
- const result = (_a = (await fieldOnlyAutoSync.syncFields(new Map(fields), new Map(instanceFields)))) !== null && _a !== void 0 ? _a : [];
402
- return LucidCardIntegrationRegistry.serializeImportResults(result);
403
- });
404
- }
405
- else {
406
- const queryStringAutoSync = autoSync;
407
- if (queryStringAutoSync.searchQueryString) {
408
- serialized['as']['sqs'] = LucidCardIntegrationRegistry.nextHookName();
409
- client.registerAction(serialized['as']['sqs'], async ({ 'qs': queryString, 'of': otherFields, 'pn': pageNumber, 'npt': nextPageToken, }) => {
410
- var _a;
411
- const result = await ((_a = queryStringAutoSync.searchQueryString) === null || _a === void 0 ? void 0 : _a.call(queryStringAutoSync, queryString, new Map(otherFields), pageNumber, nextPageToken));
412
- if (result) {
413
- return this.serializeSearchResult(result);
414
- }
415
- else {
416
- return this.serializeSearchResult({
417
- searchResults: [],
418
- error: 'Unknown Error Occurred',
419
- });
420
- }
421
- });
422
- }
423
- if (queryStringAutoSync.syncQueryString) {
424
- serialized['as']['syqs'] = LucidCardIntegrationRegistry.nextHookName();
425
- client.registerAction(serialized['as']['syqs'], async ({ 'qs': queryString, 'of': otherFields }) => {
426
- var _a, _b;
427
- const result = (_b = (await ((_a = queryStringAutoSync.syncQueryString) === null || _a === void 0 ? void 0 : _a.call(queryStringAutoSync, queryString, new Map(otherFields))))) !== null && _b !== void 0 ? _b : [];
428
- return LucidCardIntegrationRegistry.serializeImportResults(result);
429
- });
430
- }
431
- if (queryStringAutoSync.convertFiltersToQueryString) {
432
- serialized['as']['cftqs'] = LucidCardIntegrationRegistry.nextHookName();
433
- client.registerAction(serialized['as']['cftqs'], async ({ 'ff': filterFields }) => {
434
- var _a;
435
- return await ((_a = queryStringAutoSync.convertFiltersToQueryString) === null || _a === void 0 ? void 0 : _a.call(queryStringAutoSync, new Map(filterFields)));
436
- });
437
- }
438
- if (queryStringAutoSync.getDefaultFilterFields) {
439
- serialized['as']['gdff'] = LucidCardIntegrationRegistry.nextHookName();
440
- client.registerAction(serialized['as']['gdff'], async ({ 's': searchSoFar }) => {
441
- var _a, _b;
442
- const result = (_b = (await ((_a = queryStringAutoSync.getDefaultFilterFields) === null || _a === void 0 ? void 0 : _a.call(queryStringAutoSync, new Map(searchSoFar))))) !== null && _b !== void 0 ? _b : [];
443
- return (0, cardintegrationdefinitions_1.serializeCardFieldArrayDefinition)(result);
444
- });
445
- }
446
- }
447
- if (autoSync.documentPresetSetupFields) {
448
- const documentPresetSetupFields = autoSync.documentPresetSetupFields;
449
- serialized['as']['dpf'] = {
450
- 'gsf': LucidCardIntegrationRegistry.nextHookName(),
451
- 'gpv': LucidCardIntegrationRegistry.nextHookName(),
452
- };
453
- client.registerAction(serialized['as']['dpf']['gsf'], async ({ 's': searchSoFar }) => {
454
- const result = await documentPresetSetupFields.getSearchFields(new Map(searchSoFar));
455
- return (0, cardintegrationdefinitions_1.serializeCardFieldArrayDefinition)(result);
456
- });
457
- client.registerAction(serialized['as']['dpf']['gpv'], async ({ 'f': fields }) => {
458
- const result = await documentPresetSetupFields.generatePresetValue(new Map(fields));
459
- return {
460
- 'dcn': result.dataConnectorName,
461
- 'iid': result.instanceId,
462
- 'q': result.query,
463
- };
464
- });
465
- }
282
+ serialized['as'] = (0, sharedregistryutil_1.registerAutoSync)(client, cardIntegration.autoSync, () => LucidCardIntegrationRegistry.nextHookName());
466
283
  }
467
284
  if (cardIntegration.fieldConfiguration.customFieldDisplaySettings) {
468
285
  serialized['fc']['cfds'] = {
469
286
  'd': cardIntegration.fieldConfiguration.customFieldDisplaySettings.defaultToMultilineText,
470
- 'uri': (_d = (_c = cardIntegration.fieldConfiguration) === null || _c === void 0 ? void 0 : _c.customFieldDisplaySettings) === null || _d === void 0 ? void 0 : _d.useRoundIcons,
471
- 'dadr': (_f = (_e = cardIntegration.fieldConfiguration) === null || _e === void 0 ? void 0 : _e.customFieldDisplaySettings) === null || _f === void 0 ? void 0 : _f.displayMappedDatesAsDateRange,
287
+ 'uri': (_b = (_a = cardIntegration.fieldConfiguration) === null || _a === void 0 ? void 0 : _a.customFieldDisplaySettings) === null || _b === void 0 ? void 0 : _b.useRoundIcons,
288
+ 'dadr': (_d = (_c = cardIntegration.fieldConfiguration) === null || _c === void 0 ? void 0 : _c.customFieldDisplaySettings) === null || _d === void 0 ? void 0 : _d.displayMappedDatesAsDateRange,
472
289
  };
473
290
  }
474
291
  if (cardIntegration.fieldConfiguration.nonCustomizableFields) {
package/core/checks.d.ts CHANGED
@@ -138,6 +138,7 @@ export declare function isTypedTuple<const Tuple extends readonly unknown[]>(gua
138
138
  * @return Whether variable is a map.
139
139
  */
140
140
  export declare function isMap(val: unknown): val is Map<unknown, unknown>;
141
+ export declare function isTypedMap<K, V>(kTest: (k: unknown) => k is K, vTest: (v: unknown) => v is V): (val: unknown) => val is Map<K, V>;
141
142
  export type Tuple<T, N extends number> = N extends N ? (number extends N ? T[] : TupleOfHelper<T, N, []>) : never;
142
143
  type TupleOfHelper<T, N extends number, R extends unknown[]> = R['length'] extends N ? R : TupleOfHelper<T, N, [T, ...R]>;
143
144
  export declare function isExactLength<T, N extends number>(arr: readonly T[], exactLength: N): arr is Tuple<T, N>;