lucid-extension-sdk 0.0.417 → 0.0.419

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.
@@ -180,7 +180,7 @@ export type SerializedLucidCardFieldDisplaySettings = {
180
180
  'textBadgeSettings'?: TextBadgeSettings | undefined;
181
181
  } | undefined;
182
182
  };
183
- export declare const isSerializedLucidCardFieldSettings: (subject: unknown) => subject is import("../guards").DestructureGuardedTypeObj<{
183
+ export declare const isSerializedLucidCardFieldDisplaySettings: (subject: unknown) => subject is import("../guards").DestructureGuardedTypeObj<{
184
184
  StencilConfig: (x: unknown) => x is import("../guards").DestructureGuardedTypeObj<{
185
185
  getterKey: (x: unknown) => x is FieldDisplayType;
186
186
  fg: (x: unknown) => x is string | undefined;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LucidCardFields = exports.StatusValues = exports.deserializeLucidCardFieldDisplaySettings = exports.serializeLucidCardFieldDisplaySettings = exports.copyLucidCardFieldDisplaySettings = exports.isSerializedLucidCardFieldSettings = exports.isOnClickHandlerKey = exports.OnClickHandlerKeys = exports.isFieldDisplayType = exports.FieldDisplayType = void 0;
3
+ exports.LucidCardFields = exports.StatusValues = exports.deserializeLucidCardFieldDisplaySettings = exports.serializeLucidCardFieldDisplaySettings = exports.copyLucidCardFieldDisplaySettings = exports.isSerializedLucidCardFieldDisplaySettings = exports.isOnClickHandlerKey = exports.OnClickHandlerKeys = exports.isFieldDisplayType = exports.FieldDisplayType = void 0;
4
4
  const checks_1 = require("../checks");
5
5
  const badgeposition_1 = require("../properties/datagraphic/badgeposition");
6
6
  const validators_1 = require("../validators/validators");
@@ -107,7 +107,7 @@ const isStencilConfig = (0, validators_1.objectValidator)({
107
107
  'imageBadgeSettings': (0, validators_1.option)(isImageBadgeSettings),
108
108
  'textBadgeSettings': (0, validators_1.option)(isTextBadgeSettings),
109
109
  });
110
- exports.isSerializedLucidCardFieldSettings = (0, validators_1.objectValidator)({
110
+ exports.isSerializedLucidCardFieldDisplaySettings = (0, validators_1.objectValidator)({
111
111
  'StencilConfig': (0, validators_1.option)(isStencilConfig),
112
112
  });
113
113
  function copyLucidCardFieldDisplaySettings(settings) {
@@ -8,7 +8,7 @@ const cardfielddisplaysettings_1 = require("./cardfielddisplaysettings");
8
8
  exports.isSerializedCardIntegrationConfig = (0, validators_1.objectValidator)({
9
9
  'cc': (0, validators_1.objectValidator)({
10
10
  'f': (0, checks_1.isTypedArray)(checks_1.isString),
11
- 'fd': (0, validators_1.option)((0, checks_1.isTypedArray)((0, checks_1.isPair)(checks_1.isString, cardfielddisplaysettings_1.isSerializedLucidCardFieldSettings))),
11
+ 'fd': (0, validators_1.option)((0, checks_1.isTypedArray)((0, checks_1.isPair)(checks_1.isString, cardfielddisplaysettings_1.isSerializedLucidCardFieldDisplaySettings))),
12
12
  'fs': (0, validators_1.option)((0, checks_1.isTypedArray)((0, checks_1.isPair)(checks_1.isString, textstyle_1.isPartialTextStyle))),
13
13
  'id': (0, validators_1.option)(checks_1.isString),
14
14
  }),
@@ -3,6 +3,7 @@ import { DataSourceClient } from '../datasourceclient';
3
3
  import { ItemPatch, Patch } from './patch';
4
4
  export type CollectionId = string;
5
5
  export type ItemPrimaryKey = string;
6
+ export type DocumentCollections = Record<CollectionId, ItemPrimaryKey[]>;
6
7
  /**
7
8
  * This holds all the contextual information about a give data action.
8
9
  */
@@ -20,9 +21,7 @@ export declare class DataConnectorActionContext {
20
21
  /** The installation id of the extension/user that triggered this action */
21
22
  installationId: string | undefined;
22
23
  /** Set of items this document is tracking as a `Record<CollectionId, ItemPrimaryKey[]>` */
23
- documentCollections: {
24
- [collectionId: CollectionId]: ItemPrimaryKey[];
25
- };
24
+ documentCollections: DocumentCollections;
26
25
  /** Update filter type for this document */
27
26
  updateFilterType: DataUpdateFilterType;
28
27
  constructor(
@@ -39,9 +38,7 @@ export declare class DataConnectorActionContext {
39
38
  /** The installation id of the extension/user that triggered this action */
40
39
  installationId: string | undefined,
41
40
  /** Set of items this document is tracking as a `Record<CollectionId, ItemPrimaryKey[]>` */
42
- documentCollections: {
43
- [collectionId: CollectionId]: ItemPrimaryKey[];
44
- },
41
+ documentCollections: DocumentCollections,
45
42
  /** Update filter type for this document */
46
43
  updateFilterType: DataUpdateFilterType);
47
44
  }
@@ -87,16 +84,12 @@ export declare class DataConnectorPatchAction<P extends Patch = ItemPatch> exten
87
84
  **/
88
85
  export declare class Webhook {
89
86
  /** Set of items this webhook is tracking as a `Record<CollectionId, ItemPrimaryKey[]>` */
90
- documentCollections: {
91
- [collectionId: CollectionId]: ItemPrimaryKey[];
92
- };
87
+ documentCollections: DocumentCollections;
93
88
  /** Arbitrary extra data to allow the data connector to better identitify the webhook. */
94
89
  webhookData: unknown;
95
90
  constructor(
96
91
  /** Set of items this webhook is tracking as a `Record<CollectionId, ItemPrimaryKey[]>` */
97
- documentCollections: {
98
- [collectionId: CollectionId]: ItemPrimaryKey[];
99
- },
92
+ documentCollections: DocumentCollections,
100
93
  /** Arbitrary extra data to allow the data connector to better identitify the webhook. */
101
94
  webhookData: unknown);
102
95
  }
@@ -1,5 +1,5 @@
1
1
  import { UnsafeJsonSerializableOrUndefined } from '../core/jsonserializable';
2
- import { DataConnectorAction, DataConnectorAsynchronousAction, DataConnectorManageWebhookAction, DataConnectorPatchAction, Webhook } from './actions/action';
2
+ import { DataConnectorAction, DataConnectorAsynchronousAction, DataConnectorManageWebhookAction, DataConnectorPatchAction, DocumentCollections, Webhook } from './actions/action';
3
3
  import { DataConnectorActionKeys } from './actions/dataconnectoractionkeys';
4
4
  import { ItemPatch, Patch, PatchParser } from './actions/patch';
5
5
  import { PatchChange } from './actions/patchresponsebody';
@@ -44,7 +44,12 @@ export declare class DataConnectorResponseError extends Error {
44
44
  response: string;
45
45
  constructor(message: string, response: string);
46
46
  }
47
- type ActionTypeForName<P extends Patch, Name extends string, Asynchronous = boolean> = Name extends `${DataConnectorActionKeys.Patch}` ? ActionRequest<DataConnectorPatchAction<P>, PatchChange[]> : Name extends `${DataConnectorActionKeys.UnbatchedPatch}` ? ActionRequest<DataConnectorPatchAction<P>, PatchChange[]> : Name extends `${DataConnectorActionKeys.ManageWebhook}` ? ActionRequest<DataConnectorManageWebhookAction, Webhook> : ActionRequest<Asynchronous extends true ? DataConnectorAsynchronousAction : DataConnectorAction>;
47
+ /** Used to track user collection access when EditorExtensionScope is PERSISTENT_SYNC. */
48
+ export interface DocumentCollectionsBody {
49
+ /** A mapping from collection IDs to item IDs indicating what was affected (e.g. imported, refreshed, updated) by the action. */
50
+ documentCollections?: DocumentCollections;
51
+ }
52
+ type ActionTypeForName<P extends Patch, Name extends string, Asynchronous = boolean> = Name extends `${DataConnectorActionKeys.Patch}` ? ActionRequest<DataConnectorPatchAction<P>, PatchChange[]> : Name extends `${DataConnectorActionKeys.UnbatchedPatch}` ? ActionRequest<DataConnectorPatchAction<P>, PatchChange[]> : Name extends `${DataConnectorActionKeys.ManageWebhook}` ? ActionRequest<DataConnectorManageWebhookAction, Webhook> : ActionRequest<Asynchronous extends true ? DataConnectorAsynchronousAction : DataConnectorAction, unknown | DocumentCollectionsBody>;
48
53
  /** Factory class to define a bunch of action handlers. */
49
54
  export declare class DataConnector<P extends Patch = ItemPatch> {
50
55
  private client;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.417",
3
+ "version": "0.0.419",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",