lucid-extension-sdk 0.0.366 → 0.0.368

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.
@@ -2,12 +2,23 @@ import { CollectionProxy } from '../../data/collectionproxy';
2
2
  import { DataSourceProxy } from '../../data/datasourceproxy';
3
3
  import { TextStyle } from '../../document/text/textstyle';
4
4
  import { EditorClient } from '../../editorclient';
5
+ import { isString } from '../checks';
5
6
  import { SerializedFieldType } from '../data/serializedfield/serializedfields';
6
7
  import { DependenciesForItems, ExtensionCardFieldDefinition, ImportResult } from '../sharedcardintegration/cardintegrationdefinitions';
7
8
  import { CardIntegrationConfig } from './cardintegrationconfig';
8
9
  import { DependencyMappingPhrasesType } from './dependencymappingphrases';
9
10
  import { LucidCardIntegrationCustomImportModal } from './lucidcardintegrationcustomimportmodal';
10
11
  import { LucidCardIntegrationStandardImportModal } from './lucidcardintegrationstandardimportmodal';
12
+ export interface FieldDescriptor {
13
+ name: string;
14
+ label?: string | undefined;
15
+ locked?: boolean | undefined;
16
+ }
17
+ export declare const isFieldDescriptor: (subject: unknown) => subject is import("../guards").DestructureGuardedTypeObj<{
18
+ name: typeof isString;
19
+ label: (x: unknown) => x is string | undefined;
20
+ locked: (x: unknown) => x is boolean | undefined;
21
+ }>;
11
22
  export declare abstract class LucidCardIntegration {
12
23
  protected readonly client: EditorClient;
13
24
  constructor(client: EditorClient);
@@ -43,7 +54,7 @@ export declare abstract class LucidCardIntegration {
43
54
  /**
44
55
  * Callback to provide a list of all supported field names for the card integration.
45
56
  */
46
- getAllFields: (dataSource: DataSourceProxy) => Promise<string[]>;
57
+ getAllFields: (dataSource: DataSourceProxy) => Promise<string[] | FieldDescriptor[]>;
47
58
  /**
48
59
  * Callback that handled changes in the fields the user wants to be displayed in the card integration.
49
60
  * If this callback is not provided then the user will not be shown the modal to configure fields.
@@ -1,6 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LucidCardIntegration = void 0;
3
+ exports.LucidCardIntegration = exports.isFieldDescriptor = void 0;
4
+ const checks_1 = require("../checks");
5
+ const validators_1 = require("../validators/validators");
6
+ exports.isFieldDescriptor = (0, validators_1.objectValidator)({
7
+ name: checks_1.isString,
8
+ label: (0, validators_1.option)(checks_1.isString),
9
+ locked: (0, validators_1.option)(checks_1.isBoolean),
10
+ });
4
11
  class LucidCardIntegration {
5
12
  constructor(client) {
6
13
  this.client = client;
@@ -57,7 +57,7 @@ function deserializeActions(client, actions, patchParser) {
57
57
  const data = parsedActions['action']['data'];
58
58
  if (name === dataconnectoractionkeys_1.DataConnectorActionKeys.Patch) {
59
59
  if (!(0, validators_1.arrayValidator)(serializedPatchDataValidator)(data)) {
60
- console.log(`Failing validation step`);
60
+ console.log(`Failing validation step due to serializedPatchDataValidator`);
61
61
  return;
62
62
  }
63
63
  const parsedData = data
@@ -72,7 +72,7 @@ function deserializeActions(client, actions, patchParser) {
72
72
  })
73
73
  .filter(checks_1.isDefAndNotNull);
74
74
  if (parsedData.length < data.length) {
75
- console.log(`Failing validation step`);
75
+ console.log(`Failing validation step due to mismatched patches length.\nExpected length: ${data.length}\nActual length: ${parsedData.length}`);
76
76
  return;
77
77
  }
78
78
  return parsedData;
@@ -87,7 +87,7 @@ function deserializeActions(client, actions, patchParser) {
87
87
  const context = new action_1.DataConnectorActionContext(parsedActions['packageId'], parsedActions['packageVersion'], parsedActions['userCredential'], parsedActions['useOutboundProxy'], parsedActions['dataConnectorName'], parsedActions['dataConnectorName'], parsedActions['documentCollections'], parsedActions['updateFilterType']);
88
88
  const parsedPatches = parseSerializedPatches(data['patches'], patchParser);
89
89
  if (parsedPatches.length < data['patches'].length) {
90
- console.log(`Failing validation step`);
90
+ console.log(`Failing validation step due to mismatched patches length.\nExpected length: ${data['patches'].length}\nActual length: ${parsedPatches.length}`);
91
91
  return;
92
92
  }
93
93
  return [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.366",
3
+ "version": "0.0.368",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",