lucid-extension-sdk 0.0.220 → 0.0.221

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.
@@ -1,3 +1,4 @@
1
+ import { DataUpdateFilterType } from '../../../data/dataupdatefiltertype';
1
2
  import { SerializedFields } from '../serializedfield/serializedfields';
2
3
  import { DataSourceType } from './datasourcetype';
3
4
  import { SerializedImportedCollection } from './serializedimporteddatasource';
@@ -28,6 +29,7 @@ export declare function makeSerializedImportedDataSource(id: string, name: strin
28
29
  UpdateType: UpstreamUpdateType;
29
30
  SourceConfig: {
30
31
  spreadsheetId: string;
32
+ UpdateFilterType: DataUpdateFilterType;
31
33
  };
32
34
  };
33
35
  };
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.makeSerializedImportedDataSource = exports.makeSerializedImportedCollection = exports.MetadataPK = exports.makeNameReadablyUnique = exports.normalizeName = exports.alphabetize = void 0;
4
+ const dataupdatefiltertype_1 = require("../../../data/dataupdatefiltertype");
4
5
  const checks_1 = require("../../checks");
5
6
  const scalarfieldtype_1 = require("../fieldtypedefinition/scalarfieldtype");
6
7
  const alphabet_1 = require("./alphabet");
@@ -223,7 +224,10 @@ function makeSerializedImportedDataSource(id, name, collections) {
223
224
  'UpstreamConfig': {
224
225
  'SourceType': datasourcetype_1.DataSourceType.DataService,
225
226
  'UpdateType': upstreamupdatetype_1.UpstreamUpdateType.EVENTPULL,
226
- 'SourceConfig': { 'spreadsheetId': id },
227
+ 'SourceConfig': {
228
+ 'spreadsheetId': id,
229
+ 'UpdateFilterType': dataupdatefiltertype_1.DataUpdateFilterType.CurrentCollectionUpdates,
230
+ },
227
231
  },
228
232
  },
229
233
  'Collections': collections,
@@ -1,8 +1,8 @@
1
1
  /** Allows Lucid documents to determine what updates they will receive when changes happen in the data source */
2
2
  export declare enum DataUpdateFilterType {
3
- /** All updates relevant to the data source will be sent to the document, new items created in the data source will be added to the document */
3
+ /** All updates relevant to the data source will be sent to the document, new items created in the data source will be added to the document. Note that the in the `documentCollections` mapping in the `DataConnectorActionContext` will not have a list of all items in it with the DataUpdateFilterType selected */
4
4
  'AllUpdates' = "AllUpdates",
5
- /** All updates relevant to collections already present on the document will be sent to that document, new items added to those collections in the data source will be added to the document */
5
+ /** All updates relevant to collections already present on the document will be sent to that document, new items added to those collections in the data source will be added to the document. Note that the `documentCollections` mapping in the `DataConnectorActionContext` will not have a list of all items in it with the DataUpdateFilterType selected */
6
6
  'CurrentCollectionUpdates' = "CurrentCollectionUpdates",
7
7
  /** All updates to items already present on the document will be sent to the document. New items created in the data source will not be created on the document. */
8
8
  'CurrentItemUpdates' = "CurrentItemUpdates"
@@ -4,9 +4,9 @@ exports.DataUpdateFilterType = void 0;
4
4
  /** Allows Lucid documents to determine what updates they will receive when changes happen in the data source */
5
5
  var DataUpdateFilterType;
6
6
  (function (DataUpdateFilterType) {
7
- /** All updates relevant to the data source will be sent to the document, new items created in the data source will be added to the document */
7
+ /** All updates relevant to the data source will be sent to the document, new items created in the data source will be added to the document. Note that the in the `documentCollections` mapping in the `DataConnectorActionContext` will not have a list of all items in it with the DataUpdateFilterType selected */
8
8
  DataUpdateFilterType["AllUpdates"] = "AllUpdates";
9
- /** All updates relevant to collections already present on the document will be sent to that document, new items added to those collections in the data source will be added to the document */
9
+ /** All updates relevant to collections already present on the document will be sent to that document, new items added to those collections in the data source will be added to the document. Note that the `documentCollections` mapping in the `DataConnectorActionContext` will not have a list of all items in it with the DataUpdateFilterType selected */
10
10
  DataUpdateFilterType["CurrentCollectionUpdates"] = "CurrentCollectionUpdates";
11
11
  /** All updates to items already present on the document will be sent to the document. New items created in the data source will not be created on the document. */
12
12
  DataUpdateFilterType["CurrentItemUpdates"] = "CurrentItemUpdates";
@@ -25,17 +25,18 @@ class DataSourceClient {
25
25
  const dataSyncUrl = urls.dataSync;
26
26
  this.metadataUrl = (0, checks_1.isString)(dataSyncUrl) ? `${dataSyncUrl}dataSource/metadata` : undefined;
27
27
  }
28
- formatBody({ dataSourceName, collections, dataSourceConfiguration }) {
28
+ formatBody({ dataSourceName, collections, updateFilterType, dataSourceConfiguration }) {
29
29
  var _a;
30
30
  const updateData = {};
31
31
  for (const collectionId in collections) {
32
32
  updateData[collectionId] = (0, datasourceupdatetypes_1.serializeCollectionPatch)(collections[collectionId]);
33
33
  }
34
+ const updateFilterTypeObj = updateFilterType ? { 'UpdateFilterType': updateFilterType } : {};
34
35
  const upstreamConfig = {
35
36
  dataSourceType: datasourcetype_1.DataSourceType.DataService,
36
37
  updateType: upstreamupdatetype_1.UpstreamUpdateType.EVENTPULL,
37
38
  patchType: (_a = dataSourceConfiguration === null || dataSourceConfiguration === void 0 ? void 0 : dataSourceConfiguration.patchType) !== null && _a !== void 0 ? _a : upstreampatchtype_1.UpstreamPatchType.AUTO,
38
- sourceConfig: {},
39
+ sourceConfig: Object.assign({}, updateFilterTypeObj),
39
40
  };
40
41
  return {
41
42
  'updateData': updateData,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.220",
3
+ "version": "0.0.221",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",