lucid-extension-sdk 0.0.308 → 0.0.310
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.
- package/commandtypes.d.ts +2 -0
- package/core/cardintegration/lucidcardintegration.d.ts +1 -0
- package/core/cardintegration/lucidcardintegrationregistry.js +3 -0
- package/dataconnector/actions/action.d.ts +5 -1
- package/dataconnector/actions/action.js +4 -1
- package/dataconnector/actions/serializedactions.js +6 -3
- package/package.json +1 -1
package/commandtypes.d.ts
CHANGED
|
@@ -762,6 +762,8 @@ export type AddCardIntegrationQuery = {
|
|
|
762
762
|
/** Create card action */
|
|
763
763
|
'cc': string;
|
|
764
764
|
} | undefined;
|
|
765
|
+
/** Whether to enable dependency mapping for this integration */
|
|
766
|
+
'sdm'?: boolean;
|
|
765
767
|
};
|
|
766
768
|
export type AddCardIntegrationResult = undefined;
|
|
767
769
|
/** @ignore */
|
|
@@ -23,6 +23,8 @@ export declare class DataConnectorActionContext {
|
|
|
23
23
|
};
|
|
24
24
|
/** Update filter type for this document */
|
|
25
25
|
updateFilterType: DataUpdateFilterType;
|
|
26
|
+
/** User timezone to ensure we properly account for any offsets */
|
|
27
|
+
timezone: string | null | undefined;
|
|
26
28
|
constructor(
|
|
27
29
|
/** The package ID of the extension that triggered this action */
|
|
28
30
|
packageId: string,
|
|
@@ -39,7 +41,9 @@ export declare class DataConnectorActionContext {
|
|
|
39
41
|
[collectionId: CollectionId]: ItemPrimaryKey[];
|
|
40
42
|
},
|
|
41
43
|
/** Update filter type for this document */
|
|
42
|
-
updateFilterType: DataUpdateFilterType
|
|
44
|
+
updateFilterType: DataUpdateFilterType,
|
|
45
|
+
/** User timezone to ensure we properly account for any offsets */
|
|
46
|
+
timezone: string | null | undefined);
|
|
43
47
|
}
|
|
44
48
|
/** Base class for actions to be performed by data connectors */
|
|
45
49
|
export declare class DataConnectorAction {
|
|
@@ -20,7 +20,9 @@ class DataConnectorActionContext {
|
|
|
20
20
|
/** Set of items this document is tracking as a `Record<CollectionId, ItemPrimaryKey[]>` */
|
|
21
21
|
documentCollections,
|
|
22
22
|
/** Update filter type for this document */
|
|
23
|
-
updateFilterType
|
|
23
|
+
updateFilterType,
|
|
24
|
+
/** User timezone to ensure we properly account for any offsets */
|
|
25
|
+
timezone) {
|
|
24
26
|
this.packageId = packageId;
|
|
25
27
|
this.packageVersion = packageVersion;
|
|
26
28
|
this.userCredential = userCredential;
|
|
@@ -28,6 +30,7 @@ class DataConnectorActionContext {
|
|
|
28
30
|
this.installationId = installationId;
|
|
29
31
|
this.documentCollections = documentCollections;
|
|
30
32
|
this.updateFilterType = updateFilterType;
|
|
33
|
+
this.timezone = timezone;
|
|
31
34
|
}
|
|
32
35
|
}
|
|
33
36
|
exports.DataConnectorActionContext = DataConnectorActionContext;
|
|
@@ -20,6 +20,7 @@ const serializedActionsBaseValidator = (0, validators_1.objectValidator)({
|
|
|
20
20
|
documentUpdateToken: (0, validators_1.nullableOption)(checks_1.isString),
|
|
21
21
|
documentCollections: (0, validators_1.objectOfValidator)((0, validators_1.arrayValidator)(checks_1.isString)),
|
|
22
22
|
updateFilterType: (0, validators_1.enumValidator)(dataupdatefiltertype_1.DataUpdateFilterType),
|
|
23
|
+
timezone: (0, validators_1.nullableOption)(checks_1.isString),
|
|
23
24
|
});
|
|
24
25
|
const serializedPatchDataValidator = (0, validators_1.objectValidator)({
|
|
25
26
|
packageVersion: checks_1.isString,
|
|
@@ -29,6 +30,7 @@ const serializedPatchDataValidator = (0, validators_1.objectValidator)({
|
|
|
29
30
|
})),
|
|
30
31
|
userCredential: checks_1.isString,
|
|
31
32
|
documentUpdateToken: checks_1.isString,
|
|
33
|
+
timezone: (0, validators_1.nullableOption)(checks_1.isString),
|
|
32
34
|
});
|
|
33
35
|
const parseSerializedPatches = (patches, patchParser) => {
|
|
34
36
|
return patches
|
|
@@ -60,7 +62,7 @@ function deserializeActions(client, actions, patchParser) {
|
|
|
60
62
|
}
|
|
61
63
|
const parsedData = data
|
|
62
64
|
.map((item) => {
|
|
63
|
-
const context = new action_1.DataConnectorActionContext(parsedActions['packageId'], item['packageVersion'], item['userCredential'], parsedActions['dataConnectorName'], parsedActions['dataConnectorName'], parsedActions['documentCollections'], parsedActions['updateFilterType']);
|
|
65
|
+
const context = new action_1.DataConnectorActionContext(parsedActions['packageId'], item['packageVersion'], item['userCredential'], parsedActions['dataConnectorName'], parsedActions['dataConnectorName'], parsedActions['documentCollections'], parsedActions['updateFilterType'], parsedActions['timezone']);
|
|
64
66
|
const patches = parseSerializedPatches(item['patches'], patchParser);
|
|
65
67
|
if (patches.length < item['patches'].length) {
|
|
66
68
|
return undefined;
|
|
@@ -74,6 +76,7 @@ function deserializeActions(client, actions, patchParser) {
|
|
|
74
76
|
}
|
|
75
77
|
return parsedData;
|
|
76
78
|
}
|
|
79
|
+
//TODO: Add a check for timezone when its made non-optional
|
|
77
80
|
if (!parsedActions['packageVersion'] || !parsedActions['userCredential']) {
|
|
78
81
|
return;
|
|
79
82
|
}
|
|
@@ -81,7 +84,7 @@ function deserializeActions(client, actions, patchParser) {
|
|
|
81
84
|
if (!serializedPatchDataValidator(data)) {
|
|
82
85
|
return;
|
|
83
86
|
}
|
|
84
|
-
const context = new action_1.DataConnectorActionContext(parsedActions['packageId'], parsedActions['packageVersion'], parsedActions['userCredential'], parsedActions['dataConnectorName'], parsedActions['dataConnectorName'], parsedActions['documentCollections'], parsedActions['updateFilterType']);
|
|
87
|
+
const context = new action_1.DataConnectorActionContext(parsedActions['packageId'], parsedActions['packageVersion'], parsedActions['userCredential'], parsedActions['dataConnectorName'], parsedActions['dataConnectorName'], parsedActions['documentCollections'], parsedActions['updateFilterType'], parsedActions['timezone']);
|
|
85
88
|
const parsedPatches = parseSerializedPatches(data['patches'], patchParser);
|
|
86
89
|
if (parsedPatches.length < data['patches'].length) {
|
|
87
90
|
console.log(`Failing validation step`);
|
|
@@ -91,7 +94,7 @@ function deserializeActions(client, actions, patchParser) {
|
|
|
91
94
|
new action_1.DataConnectorPatchAction(context, parsedPatches, client.getDataSourceClient(data['documentUpdateToken']), dataconnectoractionkeys_1.DataConnectorActionKeys.UnbatchedPatch),
|
|
92
95
|
];
|
|
93
96
|
}
|
|
94
|
-
const context = new action_1.DataConnectorActionContext(parsedActions['packageId'], parsedActions['packageVersion'], parsedActions['userCredential'], parsedActions['dataConnectorName'], parsedActions['dataConnectorName'], parsedActions['documentCollections'], parsedActions['updateFilterType']);
|
|
97
|
+
const context = new action_1.DataConnectorActionContext(parsedActions['packageId'], parsedActions['packageVersion'], parsedActions['userCredential'], parsedActions['dataConnectorName'], parsedActions['dataConnectorName'], parsedActions['documentCollections'], parsedActions['updateFilterType'], parsedActions['timezone']);
|
|
95
98
|
if (name == 'ManageWebhook') {
|
|
96
99
|
if (!serializedManageWebhookDataValidator(data)) {
|
|
97
100
|
return;
|