lucid-extension-sdk 0.0.334 → 0.0.335

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.
@@ -33,7 +33,7 @@ export declare function arrayValidator<T>(subValidator: (p1: unknown) => p1 is T
33
33
  * @param subValidator
34
34
  * @returns
35
35
  */
36
- export declare function arrayValidatorWithList<T>(subValidator: (p1: unknown) => p1 is T): (p1: unknown, invalidItems?: unknown[]) => p1 is T[];
36
+ export declare function arrayValidatorWithList<T>(subValidator: (p1: unknown, invalidItems?: unknown[]) => p1 is T): (p1: unknown, invalidItems?: unknown[]) => p1 is T[];
37
37
  /**
38
38
  * Creates a validator for a fixed width array where each entry
39
39
  * in the array can have a separate validator
@@ -74,12 +74,7 @@ function arrayValidatorWithList(subValidator) {
74
74
  if (!(0, checks_1.isArray)(x)) {
75
75
  return false;
76
76
  }
77
- for (const element of x) {
78
- if (!subValidator(element)) {
79
- invalidItems === null || invalidItems === void 0 ? void 0 : invalidItems.push(element);
80
- }
81
- }
82
- return x.some(subValidator);
77
+ return x.some((item) => subValidator(item, invalidItems));
83
78
  };
84
79
  }
85
80
  exports.arrayValidatorWithList = arrayValidatorWithList;
@@ -25,8 +25,6 @@ export declare class DataConnectorActionContext {
25
25
  };
26
26
  /** Update filter type for this document */
27
27
  updateFilterType: DataUpdateFilterType;
28
- /** User timezone to ensure we properly account for any offsets */
29
- timezone: string | null | undefined;
30
28
  constructor(
31
29
  /** The package ID of the extension that triggered this action */
32
30
  packageId: string,
@@ -45,9 +43,7 @@ export declare class DataConnectorActionContext {
45
43
  [collectionId: CollectionId]: ItemPrimaryKey[];
46
44
  },
47
45
  /** Update filter type for this document */
48
- updateFilterType: DataUpdateFilterType,
49
- /** User timezone to ensure we properly account for any offsets */
50
- timezone: string | null | undefined);
46
+ updateFilterType: DataUpdateFilterType);
51
47
  }
52
48
  /** Base class for actions to be performed by data connectors */
53
49
  export declare class DataConnectorAction {
@@ -22,9 +22,7 @@ class DataConnectorActionContext {
22
22
  /** Set of items this document is tracking as a `Record<CollectionId, ItemPrimaryKey[]>` */
23
23
  documentCollections,
24
24
  /** Update filter type for this document */
25
- updateFilterType,
26
- /** User timezone to ensure we properly account for any offsets */
27
- timezone) {
25
+ updateFilterType) {
28
26
  this.packageId = packageId;
29
27
  this.packageVersion = packageVersion;
30
28
  this.userCredential = userCredential;
@@ -33,7 +31,6 @@ class DataConnectorActionContext {
33
31
  this.installationId = installationId;
34
32
  this.documentCollections = documentCollections;
35
33
  this.updateFilterType = updateFilterType;
36
- this.timezone = timezone;
37
34
  }
38
35
  }
39
36
  exports.DataConnectorActionContext = DataConnectorActionContext;
@@ -21,7 +21,6 @@ const serializedActionsBaseValidator = (0, validators_1.objectValidator)({
21
21
  documentUpdateToken: (0, validators_1.nullableOption)(checks_1.isString),
22
22
  documentCollections: (0, validators_1.objectOfValidator)((0, validators_1.arrayValidator)(checks_1.isString)),
23
23
  updateFilterType: (0, validators_1.enumValidator)(dataupdatefiltertype_1.DataUpdateFilterType),
24
- timezone: (0, validators_1.nullableOption)(checks_1.isString),
25
24
  });
26
25
  const serializedPatchDataValidator = (0, validators_1.objectValidator)({
27
26
  packageVersion: checks_1.isString,
@@ -32,7 +31,6 @@ const serializedPatchDataValidator = (0, validators_1.objectValidator)({
32
31
  userCredential: checks_1.isString,
33
32
  useOutboundProxy: (0, validators_1.option)(checks_1.isBoolean),
34
33
  documentUpdateToken: checks_1.isString,
35
- timezone: (0, validators_1.nullableOption)(checks_1.isString),
36
34
  });
37
35
  const parseSerializedPatches = (patches, patchParser) => {
38
36
  return patches
@@ -65,7 +63,7 @@ function deserializeActions(client, actions, patchParser) {
65
63
  const parsedData = data
66
64
  .map((item) => {
67
65
  const context = new action_1.DataConnectorActionContext(parsedActions['packageId'], item['packageVersion'], item['userCredential'], item['useOutboundProxy'], // Use from action data and ignores the useOutboundProxy boolean in parsedActions
68
- parsedActions['dataConnectorName'], parsedActions['dataConnectorName'], parsedActions['documentCollections'], parsedActions['updateFilterType'], parsedActions['timezone']);
66
+ parsedActions['dataConnectorName'], parsedActions['dataConnectorName'], parsedActions['documentCollections'], parsedActions['updateFilterType']);
69
67
  const patches = parseSerializedPatches(item['patches'], patchParser);
70
68
  if (patches.length < item['patches'].length) {
71
69
  return undefined;
@@ -79,7 +77,6 @@ function deserializeActions(client, actions, patchParser) {
79
77
  }
80
78
  return parsedData;
81
79
  }
82
- //TODO: Add a check for timezone when its made non-optional
83
80
  if (!parsedActions['packageVersion'] || !parsedActions['userCredential']) {
84
81
  return;
85
82
  }
@@ -87,7 +84,7 @@ function deserializeActions(client, actions, patchParser) {
87
84
  if (!serializedPatchDataValidator(data)) {
88
85
  return;
89
86
  }
90
- const context = new action_1.DataConnectorActionContext(parsedActions['packageId'], parsedActions['packageVersion'], parsedActions['userCredential'], parsedActions['useOutboundProxy'], parsedActions['dataConnectorName'], parsedActions['dataConnectorName'], parsedActions['documentCollections'], parsedActions['updateFilterType'], parsedActions['timezone']);
87
+ const context = new action_1.DataConnectorActionContext(parsedActions['packageId'], parsedActions['packageVersion'], parsedActions['userCredential'], parsedActions['useOutboundProxy'], parsedActions['dataConnectorName'], parsedActions['dataConnectorName'], parsedActions['documentCollections'], parsedActions['updateFilterType']);
91
88
  const parsedPatches = parseSerializedPatches(data['patches'], patchParser);
92
89
  if (parsedPatches.length < data['patches'].length) {
93
90
  console.log(`Failing validation step`);
@@ -97,7 +94,7 @@ function deserializeActions(client, actions, patchParser) {
97
94
  new action_1.DataConnectorPatchAction(context, parsedPatches, client.getDataSourceClient(data['documentUpdateToken']), dataconnectoractionkeys_1.DataConnectorActionKeys.UnbatchedPatch),
98
95
  ];
99
96
  }
100
- const context = new action_1.DataConnectorActionContext(parsedActions['packageId'], parsedActions['packageVersion'], parsedActions['userCredential'], parsedActions['useOutboundProxy'], parsedActions['dataConnectorName'], parsedActions['dataConnectorName'], parsedActions['documentCollections'], parsedActions['updateFilterType'], parsedActions['timezone']);
97
+ const context = new action_1.DataConnectorActionContext(parsedActions['packageId'], parsedActions['packageVersion'], parsedActions['userCredential'], parsedActions['useOutboundProxy'], parsedActions['dataConnectorName'], parsedActions['dataConnectorName'], parsedActions['documentCollections'], parsedActions['updateFilterType']);
101
98
  if (name == 'ManageWebhook') {
102
99
  if (!serializedManageWebhookDataValidator(data)) {
103
100
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.334",
3
+ "version": "0.0.335",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",