lucid-extension-sdk 0.0.96 → 0.0.98
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/package.json +5 -1
- package/sdk/core/cardintegration/taskmanagementcardintegration.d.ts +2 -2
- package/sdk/core/cardintegration/taskmanagementcardintegrationdefinitions.d.ts +0 -2
- package/sdk/core/cardintegration/taskmangementcardregistry.js +2 -5
- package/sdk/data/collectionproxy.d.ts +1 -0
- package/sdk/data/collectionproxy.js +8 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lucid-extension-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.98",
|
|
4
4
|
"description": "Utility classes for writing Lucid Software editor extensions",
|
|
5
5
|
"main": "sdk/index.js",
|
|
6
6
|
"types": "sdk/index.d.ts",
|
|
@@ -13,5 +13,9 @@
|
|
|
13
13
|
"typedoc": "^0.23.15",
|
|
14
14
|
"typedoc-plugin-markdown": "^3.13.6",
|
|
15
15
|
"typescript": "4.7.4"
|
|
16
|
+
},
|
|
17
|
+
"exports": {
|
|
18
|
+
".": "./sdk/index.js",
|
|
19
|
+
"./*": "./sdk/*.js"
|
|
16
20
|
}
|
|
17
21
|
}
|
|
@@ -33,7 +33,7 @@ export declare abstract class TaskManagementCardIntegration {
|
|
|
33
33
|
/**
|
|
34
34
|
* Callback to provide a list of all supported field names for the card integration.
|
|
35
35
|
*/
|
|
36
|
-
getAllFields: (
|
|
36
|
+
getAllFields: (dataSource: DataSourceProxy) => Promise<string[]>;
|
|
37
37
|
/**
|
|
38
38
|
* Callback that handled changes in the fields the user wants to be displayed in the card integration.
|
|
39
39
|
* If this callback is not provided then the user will not be shown the modal to configure fields.
|
|
@@ -48,7 +48,7 @@ export declare abstract class TaskManagementCardIntegration {
|
|
|
48
48
|
/**
|
|
49
49
|
* Provide the default configuration for a new import
|
|
50
50
|
*/
|
|
51
|
-
abstract getDefaultConfig: (
|
|
51
|
+
abstract getDefaultConfig: (dataSource: DataSourceProxy) => Promise<CardIntegrationConfig>;
|
|
52
52
|
/**
|
|
53
53
|
* If specified, allow the user to import cards using the standard card-import modal.
|
|
54
54
|
*
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { SerializedFieldType } from '../data/serializedfield/serializedfields';
|
|
2
2
|
/** @ignore */
|
|
3
3
|
export interface GetFieldsParam {
|
|
4
|
-
'c': string;
|
|
5
4
|
'd': string;
|
|
6
5
|
}
|
|
7
6
|
/** @ignore */
|
|
8
7
|
export interface GetDefaultConfigParam {
|
|
9
|
-
'c': string;
|
|
10
8
|
'd': string;
|
|
11
9
|
}
|
|
12
10
|
/** @ignore */
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TaskManagementCardRegistry = void 0;
|
|
4
4
|
const collectiondefinition_1 = require("../../data/collectiondefinition");
|
|
5
|
-
const collectionproxy_1 = require("../../data/collectionproxy");
|
|
6
5
|
const datasourceproxy_1 = require("../../data/datasourceproxy");
|
|
7
6
|
const cardintegrationconfig_1 = require("./cardintegrationconfig");
|
|
8
7
|
const cardintegrationdefinitions_1 = require("./cardintegrationdefinitions");
|
|
@@ -32,9 +31,8 @@ class TaskManagementCardRegistry {
|
|
|
32
31
|
static addCardIntegration(client, cardIntegration) {
|
|
33
32
|
const getFieldsActionName = TaskManagementCardRegistry.nextHookName();
|
|
34
33
|
client.registerAction(getFieldsActionName, async (param) => {
|
|
35
|
-
const collection = new collectionproxy_1.CollectionProxy(param['c'], client);
|
|
36
34
|
const dataSource = new datasourceproxy_1.DataSourceProxy(param['d'], client);
|
|
37
|
-
const fields = await cardIntegration.fieldConfiguration.getAllFields(
|
|
35
|
+
const fields = await cardIntegration.fieldConfiguration.getAllFields(dataSource);
|
|
38
36
|
return fields;
|
|
39
37
|
});
|
|
40
38
|
let onSelectedFieldsChangeActionName = undefined;
|
|
@@ -48,9 +46,8 @@ class TaskManagementCardRegistry {
|
|
|
48
46
|
}
|
|
49
47
|
const getDefaultConfigActionName = TaskManagementCardRegistry.nextHookName();
|
|
50
48
|
client.registerAction(getDefaultConfigActionName, async (param) => {
|
|
51
|
-
const collection = new collectionproxy_1.CollectionProxy(param['c'], client);
|
|
52
49
|
const dataSource = new datasourceproxy_1.DataSourceProxy(param['d'], client);
|
|
53
|
-
return (0, cardintegrationconfig_1.serializeCardIntegrationConfig)(await cardIntegration.getDefaultConfig(
|
|
50
|
+
return (0, cardintegrationconfig_1.serializeCardIntegrationConfig)(await cardIntegration.getDefaultConfig(dataSource));
|
|
54
51
|
});
|
|
55
52
|
let showIntroActionName = undefined;
|
|
56
53
|
if (cardIntegration.showIntro) {
|
|
@@ -20,6 +20,7 @@ export declare class CollectionProxy extends PropertyStoreProxy {
|
|
|
20
20
|
* @returns a human-readable name for this collection
|
|
21
21
|
*/
|
|
22
22
|
getName(): string;
|
|
23
|
+
getSyncCollectionId(): string | undefined;
|
|
23
24
|
/**
|
|
24
25
|
* Some data collections may have local branches on the document, to store the set of changes that have been
|
|
25
26
|
* made by the user since the time the data was last refreshed from its source. For those collections, you
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CollectionProxy = void 0;
|
|
4
|
+
const checks_1 = require("../core/checks");
|
|
4
5
|
const mapproxy_1 = require("../document/mapproxy");
|
|
5
6
|
const propertystoreproxy_1 = require("../document/propertystoreproxy");
|
|
6
7
|
const dataitemproxy_1 = require("./dataitemproxy");
|
|
@@ -31,6 +32,13 @@ class CollectionProxy extends propertystoreproxy_1.PropertyStoreProxy {
|
|
|
31
32
|
getName() {
|
|
32
33
|
return this.properties.get('Name');
|
|
33
34
|
}
|
|
35
|
+
getSyncCollectionId() {
|
|
36
|
+
const upstreamConfig = this.properties.get('UpstreamConfig');
|
|
37
|
+
if ((0, checks_1.isObject)(upstreamConfig) && (0, checks_1.isString)(upstreamConfig['SyncId'])) {
|
|
38
|
+
return upstreamConfig['SyncId'];
|
|
39
|
+
}
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
34
42
|
/**
|
|
35
43
|
* Some data collections may have local branches on the document, to store the set of changes that have been
|
|
36
44
|
* made by the user since the time the data was last refreshed from its source. For those collections, you
|