lucid-extension-sdk 0.0.181 → 0.0.182

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.
@@ -103,8 +103,9 @@ export declare class Patch {
103
103
  **/
104
104
  export declare class DataConnectorPatchAction extends DataConnectorAction {
105
105
  /** changes applied by Lucid */ patches: Patch[];
106
+ client: DataSourceClient;
106
107
  constructor(context: DataConnectorActionContext,
107
- /** changes applied by Lucid */ patches: Patch[], name?: string);
108
+ /** changes applied by Lucid */ patches: Patch[], client: DataSourceClient, name?: string);
108
109
  }
109
110
  /**
110
111
  * A description of an existing webhook that Lucid is keeping track of.
@@ -95,9 +95,10 @@ exports.Patch = Patch;
95
95
  **/
96
96
  class DataConnectorPatchAction extends DataConnectorAction {
97
97
  constructor(context,
98
- /** changes applied by Lucid */ patches, name = dataconnectoractionkeys_1.DataConnectorActionKeys.Patch) {
98
+ /** changes applied by Lucid */ patches, client, name = dataconnectoractionkeys_1.DataConnectorActionKeys.Patch) {
99
99
  super(name, context);
100
100
  this.patches = patches;
101
+ this.client = client;
101
102
  }
102
103
  }
103
104
  exports.DataConnectorPatchAction = DataConnectorPatchAction;
@@ -20,7 +20,6 @@ const serializedActionsBaseValidator = (0, validators_1.objectValidator)({
20
20
  });
21
21
  const serializedPatchDataValidator = (0, validators_1.objectValidator)({
22
22
  'packageVersion': checks_1.isString,
23
- 'userCredential': checks_1.isString,
24
23
  'patches': (0, validators_1.arrayValidator)((0, validators_1.objectValidator)({
25
24
  'patch': (0, validators_1.objectValidator)({
26
25
  'itemsAdded': (0, validators_1.objectOfValidator)(checks_1.isObject),
@@ -33,6 +32,8 @@ const serializedPatchDataValidator = (0, validators_1.objectValidator)({
33
32
  }),
34
33
  'id': checks_1.isString,
35
34
  })),
35
+ 'userCredential': checks_1.isString,
36
+ 'documentUpdateToken': checks_1.isString,
36
37
  });
37
38
  const parseSerializedPatches = (patches) => {
38
39
  return patches.map((patch) => {
@@ -61,7 +62,7 @@ function deserializeActions(client, actions) {
61
62
  return data.map((item) => {
62
63
  const context = new action_1.DataConnectorActionContext(actions['packageId'], item['packageVersion'], item['userCredential'], actions['dataConnectorName'], actions['dataConnectorName'], actions['documentCollections'], actions['updateFilterType']);
63
64
  const patches = parseSerializedPatches(item['patches']);
64
- return new action_1.DataConnectorPatchAction(context, patches);
65
+ return new action_1.DataConnectorPatchAction(context, patches, client.getDataSourceClient(item['documentUpdateToken']));
65
66
  });
66
67
  }
67
68
  if (!actions['packageVersion'] || !actions['userCredential']) {
@@ -73,7 +74,7 @@ function deserializeActions(client, actions) {
73
74
  }
74
75
  const context = new action_1.DataConnectorActionContext(actions['packageId'], actions['packageVersion'], actions['userCredential'], actions['dataConnectorName'], actions['dataConnectorName'], actions['documentCollections'], actions['updateFilterType']);
75
76
  return [
76
- new action_1.DataConnectorPatchAction(context, parseSerializedPatches(data['patches']), dataconnectoractionkeys_1.DataConnectorActionKeys.UnbatchedPatch),
77
+ new action_1.DataConnectorPatchAction(context, parseSerializedPatches(data['patches']), client.getDataSourceClient(data['documentUpdateToken']), dataconnectoractionkeys_1.DataConnectorActionKeys.UnbatchedPatch),
77
78
  ];
78
79
  }
79
80
  const context = new action_1.DataConnectorActionContext(actions['packageId'], actions['packageVersion'], actions['userCredential'], actions['dataConnectorName'], actions['dataConnectorName'], actions['documentCollections'], actions['updateFilterType']);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.181",
3
+ "version": "0.0.182",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",