lucid-extension-sdk 0.0.437 → 0.0.439
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 +27 -3
- package/core/cardintegration/cardfielddisplaysettings.d.ts +0 -1
- package/core/cardintegration/cardfielddisplaysettings.js +1 -1
- package/core/cardintegration/cardintegrationautosyncconfig.d.ts +49 -4
- package/core/cardintegration/cardintegrationautosyncconfig.js +13 -0
- package/core/cardintegration/cardintegrationparams.d.ts +12 -2
- package/core/cardintegration/lucidcardintegration.d.ts +3 -3
- package/core/cardintegration/lucidcardintegrationregistry.js +43 -10
- package/core/cardintegration/useritemeditpermissions.d.ts +26 -0
- package/core/cardintegration/useritemeditpermissions.js +27 -0
- package/core/data/fieldtypedefinition/lucidfields.d.ts +0 -2
- package/core/data/fieldtypedefinition/lucidfields.js +1 -2
- package/core/data/serializedfield/serializedfielddefinition.d.ts +2 -1
- package/core/data/serializedfield/serializedfielddefinition.js +1 -0
- package/core/properties/fillcolor.d.ts +1 -0
- package/core/sharedcardintegration/cardintegrationdefinitions.d.ts +8 -2
- package/data/dataitemproxy.d.ts +4 -0
- package/data/dataitemproxy.js +9 -0
- package/data/fieldconstraintdefinition.d.ts +8 -3
- package/data/fieldconstraintdefinition.js +10 -5
- package/document/documentelement/documentelementtype.d.ts +1 -1
- package/document/documentelement/documentelementtype.js +1 -1
- package/package.json +1 -1
- package/core/cardintegration/carduseraccessresult.d.ts +0 -18
- package/core/cardintegration/carduseraccessresult.js +0 -13
package/commandtypes.d.ts
CHANGED
|
@@ -747,6 +747,21 @@ export type AddCardsActions = {
|
|
|
747
747
|
};
|
|
748
748
|
export type AutoSyncSettings = {
|
|
749
749
|
'h': string;
|
|
750
|
+
/** Phrases */
|
|
751
|
+
'p'?: {
|
|
752
|
+
/** Header */
|
|
753
|
+
'h': string;
|
|
754
|
+
/** query placeholder */
|
|
755
|
+
'qph': string;
|
|
756
|
+
/**remove non matching label */
|
|
757
|
+
'rnml': string;
|
|
758
|
+
/**no matched label */
|
|
759
|
+
'nml': string;
|
|
760
|
+
/**syncing growl message*/
|
|
761
|
+
'sgm'?: string | undefined;
|
|
762
|
+
/**removing growl message */
|
|
763
|
+
'rgm'?: string | undefined;
|
|
764
|
+
};
|
|
750
765
|
'gsf': string;
|
|
751
766
|
'sqs'?: string | undefined;
|
|
752
767
|
'syqs'?: string | undefined;
|
|
@@ -762,6 +777,8 @@ export type SerializedFieldConfiguration = {
|
|
|
762
777
|
'dsc'?: string | undefined;
|
|
763
778
|
/** Custom field display settings */
|
|
764
779
|
'cfds'?: SerializedCustomFieldDisplaySettings;
|
|
780
|
+
/** Non-customizable fields */
|
|
781
|
+
'ncf'?: string[] | undefined;
|
|
765
782
|
};
|
|
766
783
|
export type AddCardIntegrationQuery = {
|
|
767
784
|
/** Title/name */
|
|
@@ -908,9 +925,9 @@ export type AddCardIntegrationQuery = {
|
|
|
908
925
|
'cb': string;
|
|
909
926
|
} | undefined;
|
|
910
927
|
/**
|
|
911
|
-
*
|
|
928
|
+
* Whether the user can edit an item in the data source.
|
|
912
929
|
*/
|
|
913
|
-
'
|
|
930
|
+
'cei'?: string | undefined;
|
|
914
931
|
};
|
|
915
932
|
export type AddCardIntegrationResult = undefined;
|
|
916
933
|
/** @ignore */
|
|
@@ -1398,8 +1415,13 @@ export type GetDataItemFieldQuery = {
|
|
|
1398
1415
|
'c': string;
|
|
1399
1416
|
/** Primary key of the data item to read */
|
|
1400
1417
|
'pk': string;
|
|
1401
|
-
/** Name of field to read */
|
|
1418
|
+
/** Name of field (or field label, if 'l' is true) to read */
|
|
1402
1419
|
'f': string;
|
|
1420
|
+
/**
|
|
1421
|
+
* "label" - If true, get the field by label, not name
|
|
1422
|
+
* (Labels are specified by `FieldLabelOverrides` in `SerializedSchema`)
|
|
1423
|
+
* */
|
|
1424
|
+
'l'?: boolean | undefined;
|
|
1403
1425
|
};
|
|
1404
1426
|
export type GetDataItemFieldResult = SerializedFieldType;
|
|
1405
1427
|
export type GetDeveloperModeStatusQuery = void;
|
|
@@ -1631,6 +1653,8 @@ export type ListDataItemsResult = string[];
|
|
|
1631
1653
|
export type ListCollectionFieldsQuery = {
|
|
1632
1654
|
/** Collection ID to query */
|
|
1633
1655
|
'id': string;
|
|
1656
|
+
/** "labels" - If true, list field labels. Otherwise, list field names (default) */
|
|
1657
|
+
'l'?: boolean | undefined;
|
|
1634
1658
|
};
|
|
1635
1659
|
export type ListCollectionFieldsResult = string[];
|
|
1636
1660
|
export type ListDataSourcesQuery = undefined;
|
|
@@ -221,7 +221,6 @@ export declare function serializeLucidCardFieldDisplaySettings(settings: LucidCa
|
|
|
221
221
|
export declare function deserializeLucidCardFieldDisplaySettings(settings: SerializedLucidCardFieldDisplaySettings): LucidCardFieldDisplaySettings;
|
|
222
222
|
/**
|
|
223
223
|
* These are the six possible values for the status of a basic card block.
|
|
224
|
-
* Must be kept in sync with cake/app/webroot/ts/libraries/lucidcards/lucidcarddefaultstatus.ts
|
|
225
224
|
*/
|
|
226
225
|
export declare enum StatusValues {
|
|
227
226
|
New = "New",
|
|
@@ -189,10 +189,10 @@ function deserializeLucidCardFieldDisplaySettings(settings) {
|
|
|
189
189
|
exports.deserializeLucidCardFieldDisplaySettings = deserializeLucidCardFieldDisplaySettings;
|
|
190
190
|
/**
|
|
191
191
|
* These are the six possible values for the status of a basic card block.
|
|
192
|
-
* Must be kept in sync with cake/app/webroot/ts/libraries/lucidcards/lucidcarddefaultstatus.ts
|
|
193
192
|
*/
|
|
194
193
|
var StatusValues;
|
|
195
194
|
(function (StatusValues) {
|
|
195
|
+
// IMPORTANT: Must be kept in sync with cake/app/webroot/ts/libraries/lucidcards/lucidcarddefaultstatus.ts
|
|
196
196
|
StatusValues["New"] = "New";
|
|
197
197
|
StatusValues["Todo"] = "To Do";
|
|
198
198
|
StatusValues["InProgress"] = "In Progress";
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
import { SerializedFieldType } from '../data/serializedfield/serializedfields';
|
|
2
2
|
import { ExtensionCardFieldDefinition, ImportResult, SearchResult } from '../sharedcardintegration/cardintegrationdefinitions';
|
|
3
|
+
/**
|
|
4
|
+
* The amount of results that will be displayed per page when using pagination. To enable pagination, define the
|
|
5
|
+
* {@link SearchResult.itemsPerSearchResult} field in your search results and return workitems equal to this variable's
|
|
6
|
+
* value.
|
|
7
|
+
*/
|
|
8
|
+
export declare const AutoSyncPaginationSize = 50;
|
|
9
|
+
/**
|
|
10
|
+
* This config defines variables and methods required to implement query sync for various container objects in Lucid
|
|
11
|
+
* (e.g. timelines).
|
|
12
|
+
*/
|
|
3
13
|
export interface CardIntegrationAutoSyncConfig {
|
|
4
14
|
/**
|
|
5
|
-
*
|
|
15
|
+
* @deprecated Use AutoSyncConfigPhrasesType instead.
|
|
6
16
|
*/
|
|
7
17
|
header: string;
|
|
18
|
+
/**
|
|
19
|
+
* The phrases to use for the auto sync callout. This is used to display the correct strings in the UI.
|
|
20
|
+
*/
|
|
21
|
+
phrases?: AutoSyncConfigPhrasesType | undefined;
|
|
8
22
|
/**
|
|
9
23
|
* Callback that should return a single field that users can use to determine which instance, workspace,
|
|
10
24
|
* organization (or any equivalent field for an extension) so that the data source id can be caluclated
|
|
@@ -14,14 +28,45 @@ export interface CardIntegrationAutoSyncConfig {
|
|
|
14
28
|
*/
|
|
15
29
|
getSyncDataSourceIdField: (searchSoFar: Map<string, SerializedFieldType>) => Promise<ExtensionCardFieldDefinition[]>;
|
|
16
30
|
/**
|
|
17
|
-
* Perform a search on the query string. This should support pagination.
|
|
31
|
+
* Perform a search on the query string. This should support pagination (See {@link AutoSyncPaginationSize}).
|
|
18
32
|
*
|
|
19
33
|
* The syncDataSourceIdNonce is provided in otherFields
|
|
20
|
-
* @
|
|
34
|
+
* @param pageNumber If undefined, will return all results from the search
|
|
35
|
+
* @returns the search results after searching using the given query string.
|
|
21
36
|
*/
|
|
22
|
-
searchQueryString?: (queryString: string, otherFields: Map<string, SerializedFieldType>, pageNumber: number, nextPageToken: string | undefined) => Promise<SearchResult>;
|
|
37
|
+
searchQueryString?: (queryString: string, otherFields: Map<string, SerializedFieldType>, pageNumber: number | undefined, nextPageToken: string | undefined) => Promise<SearchResult>;
|
|
23
38
|
/**
|
|
24
39
|
* @returns the ImportResult for the query string.
|
|
25
40
|
*/
|
|
26
41
|
syncQueryString?: (queryString: string, otherFields: Map<string, SerializedFieldType>) => Promise<ImportResult | ImportResult[]>;
|
|
27
42
|
}
|
|
43
|
+
export interface AutoSyncConfigPhrasesType {
|
|
44
|
+
/**
|
|
45
|
+
* The header to display for the integration in the autosync modal.
|
|
46
|
+
*/
|
|
47
|
+
header: string;
|
|
48
|
+
/**
|
|
49
|
+
* The query placeholder string to display for the integration. For example, the Jira integration displays "Search with a JQL query..."
|
|
50
|
+
*/
|
|
51
|
+
queryPlaceholder: string;
|
|
52
|
+
/**
|
|
53
|
+
* The string to display for the checkbox to set if non-matching items would be removed for syncing. For example, the Jira integration displays "Remove issues that don't match this query"
|
|
54
|
+
*/
|
|
55
|
+
removeNonMatchingLabel: (generator: SupportedAutoSyncGeneratorType) => string;
|
|
56
|
+
/**
|
|
57
|
+
* The string to display when there are no matched items. For example, the Jira integration displays "No issues matched your search query"
|
|
58
|
+
*/
|
|
59
|
+
noMatchedLabel: string;
|
|
60
|
+
/**
|
|
61
|
+
* If defined, A growl would show up with the string when the cards are syncing / importing into generators. For example, the Jira integration displays "Syncing 1 issue" or "Syncing 5 issues"
|
|
62
|
+
*/
|
|
63
|
+
syncingGrowlMessage?: ((count: number) => string) | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* If defined, A growl would show up with the string when cards gets removed because of they are not matched with the query . For example, the Jira integration displays "1 Jira issue removed" or "5 Jira issues removed"
|
|
66
|
+
*/
|
|
67
|
+
removingGrowlMessage?: ((count: number) => string) | undefined;
|
|
68
|
+
}
|
|
69
|
+
export declare enum SupportedAutoSyncGeneratorType {
|
|
70
|
+
Timeline = "timeline"
|
|
71
|
+
}
|
|
72
|
+
export declare const isSupportedAutoSyncGeneratorType: (x: unknown) => x is SupportedAutoSyncGeneratorType.Timeline;
|
|
@@ -1,2 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isSupportedAutoSyncGeneratorType = exports.SupportedAutoSyncGeneratorType = exports.AutoSyncPaginationSize = void 0;
|
|
4
|
+
const validators_1 = require("../validators/validators");
|
|
5
|
+
/**
|
|
6
|
+
* The amount of results that will be displayed per page when using pagination. To enable pagination, define the
|
|
7
|
+
* {@link SearchResult.itemsPerSearchResult} field in your search results and return workitems equal to this variable's
|
|
8
|
+
* value.
|
|
9
|
+
*/
|
|
10
|
+
exports.AutoSyncPaginationSize = 50;
|
|
11
|
+
var SupportedAutoSyncGeneratorType;
|
|
12
|
+
(function (SupportedAutoSyncGeneratorType) {
|
|
13
|
+
SupportedAutoSyncGeneratorType["Timeline"] = "timeline";
|
|
14
|
+
})(SupportedAutoSyncGeneratorType || (exports.SupportedAutoSyncGeneratorType = SupportedAutoSyncGeneratorType = {}));
|
|
15
|
+
exports.isSupportedAutoSyncGeneratorType = (0, validators_1.stringEnumValidator)(SupportedAutoSyncGeneratorType);
|
|
@@ -23,17 +23,27 @@ export interface SearchParam {
|
|
|
23
23
|
'o': number;
|
|
24
24
|
'l': number;
|
|
25
25
|
}
|
|
26
|
+
/** @ignore */
|
|
26
27
|
export interface QuerySearchParam {
|
|
27
28
|
'qs': string;
|
|
28
29
|
'of': [string, SerializedFieldType][];
|
|
29
|
-
'pn': number;
|
|
30
|
+
'pn': number | undefined;
|
|
30
31
|
'npt': string | undefined;
|
|
31
32
|
}
|
|
33
|
+
/** @ignore */
|
|
32
34
|
export interface QuerySyncParam {
|
|
33
35
|
'qs': string;
|
|
34
36
|
'of': [string, SerializedFieldType][];
|
|
35
37
|
}
|
|
36
38
|
/** @ignore */
|
|
39
|
+
export interface QuerySyncRemoveNonMatchingLabelParam {
|
|
40
|
+
'g': string;
|
|
41
|
+
}
|
|
42
|
+
/** @ignore */
|
|
43
|
+
export interface QuerySyncGrowlMessageParam {
|
|
44
|
+
'c': number;
|
|
45
|
+
}
|
|
46
|
+
/** @ignore */
|
|
37
47
|
export interface ImportParam {
|
|
38
48
|
'pks': string[];
|
|
39
49
|
's': [string, SerializedFieldType][];
|
|
@@ -101,7 +111,7 @@ export interface ImportFromSerializedFieldsCallbackParam {
|
|
|
101
111
|
'sf': SerializedFields[];
|
|
102
112
|
}
|
|
103
113
|
/** @ignore */
|
|
104
|
-
export interface
|
|
114
|
+
export interface CanEditItemsParam {
|
|
105
115
|
'ek': string;
|
|
106
116
|
'dk'?: string;
|
|
107
117
|
}
|
|
@@ -9,10 +9,10 @@ import { ImportCardFromPastedLinkCallback } from '../importcardfrompastedlink/im
|
|
|
9
9
|
import { DependenciesForItems, ExtensionCardFieldDefinition, ExtensionFieldConfiguration, ImportResult } from '../sharedcardintegration/cardintegrationdefinitions';
|
|
10
10
|
import { CardIntegrationAutoSyncConfig } from './cardintegrationautosyncconfig';
|
|
11
11
|
import { CardIntegrationConfig } from './cardintegrationconfig';
|
|
12
|
-
import { CardUserAccessResult } from './carduseraccessresult';
|
|
13
12
|
import { DependencyMappingPhrasesType } from './dependencymappingphrases';
|
|
14
13
|
import { LucidCardIntegrationCustomImportModal } from './lucidcardintegrationcustomimportmodal';
|
|
15
14
|
import { LucidCardIntegrationStandardImportModal } from './lucidcardintegrationstandardimportmodal';
|
|
15
|
+
import { UserItemEditPermissions } from './useritemeditpermissions';
|
|
16
16
|
export interface FieldDescriptor {
|
|
17
17
|
name: string;
|
|
18
18
|
label?: string | undefined;
|
|
@@ -156,7 +156,7 @@ export declare abstract class LucidCardIntegration {
|
|
|
156
156
|
*/
|
|
157
157
|
importFromSerializedFields?: (data: SerializedFields[]) => Promise<ImportCardFromDetails>;
|
|
158
158
|
/**
|
|
159
|
-
* @experimental When defined, allows the extension to make cards that the user
|
|
159
|
+
* @experimental When defined, allows the extension to make cards that the user can't edit view-only.
|
|
160
160
|
*/
|
|
161
|
-
|
|
161
|
+
canEditItems?: (editedKey: string, dependencyKey: string | undefined) => Promise<UserItemEditPermissions>;
|
|
162
162
|
}
|
|
@@ -9,9 +9,10 @@ const importcardfrompastedlinkeventmessage_1 = require("../../message/importcard
|
|
|
9
9
|
const checks_1 = require("../checks");
|
|
10
10
|
const importcardfromdetails_1 = require("../importcardfromdetails/importcardfromdetails");
|
|
11
11
|
const cardintegrationdefinitions_1 = require("../sharedcardintegration/cardintegrationdefinitions");
|
|
12
|
+
const cardintegrationautosyncconfig_1 = require("./cardintegrationautosyncconfig");
|
|
12
13
|
const cardintegrationconfig_1 = require("./cardintegrationconfig");
|
|
13
|
-
const carduseraccessresult_1 = require("./carduseraccessresult");
|
|
14
14
|
const lucidcardintegrationcustomimportmodal_1 = require("./lucidcardintegrationcustomimportmodal");
|
|
15
|
+
const useritemeditpermissions_1 = require("./useritemeditpermissions");
|
|
15
16
|
class LucidCardIntegrationRegistry {
|
|
16
17
|
static nextHookName() {
|
|
17
18
|
return '__lucidcard__hook' + LucidCardIntegrationRegistry.nextHookId++;
|
|
@@ -236,7 +237,7 @@ class LucidCardIntegrationRegistry {
|
|
|
236
237
|
* Register a card integration.
|
|
237
238
|
*/
|
|
238
239
|
static addCardIntegration(client, cardIntegration) {
|
|
239
|
-
var _a, _b, _c, _d;
|
|
240
|
+
var _a, _b, _c, _d, _e, _f;
|
|
240
241
|
const getFieldsActionName = LucidCardIntegrationRegistry.nextHookName();
|
|
241
242
|
client.registerAction(getFieldsActionName, async (param) => {
|
|
242
243
|
const dataSource = new datasourceproxy_1.DataSourceProxy(param['d'], client);
|
|
@@ -384,6 +385,35 @@ class LucidCardIntegrationRegistry {
|
|
|
384
385
|
'h': autoSync.header,
|
|
385
386
|
'gsf': LucidCardIntegrationRegistry.nextHookName(),
|
|
386
387
|
};
|
|
388
|
+
if (autoSync.phrases) {
|
|
389
|
+
serialized['as']['p'] = {
|
|
390
|
+
'h': autoSync.phrases.header,
|
|
391
|
+
'qph': autoSync.phrases.queryPlaceholder,
|
|
392
|
+
'rnml': LucidCardIntegrationRegistry.nextHookName(),
|
|
393
|
+
'nml': autoSync.phrases.noMatchedLabel,
|
|
394
|
+
};
|
|
395
|
+
client.registerAction(serialized['as']['p']['rnml'], ({ 'g': inputSoFar }) => {
|
|
396
|
+
var _a;
|
|
397
|
+
if (!(0, cardintegrationautosyncconfig_1.isSupportedAutoSyncGeneratorType)(inputSoFar)) {
|
|
398
|
+
return '';
|
|
399
|
+
}
|
|
400
|
+
return (_a = autoSync.phrases) === null || _a === void 0 ? void 0 : _a.removeNonMatchingLabel(inputSoFar);
|
|
401
|
+
});
|
|
402
|
+
if ((_a = autoSync.phrases) === null || _a === void 0 ? void 0 : _a.syncingGrowlMessage) {
|
|
403
|
+
serialized['as']['p']['sgm'] = LucidCardIntegrationRegistry.nextHookName();
|
|
404
|
+
client.registerAction(serialized['as']['p']['sgm'], ({ 'c': count }) => {
|
|
405
|
+
var _a, _b;
|
|
406
|
+
return (_b = (_a = autoSync.phrases) === null || _a === void 0 ? void 0 : _a.syncingGrowlMessage) === null || _b === void 0 ? void 0 : _b.call(_a, count);
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
if ((_b = autoSync.phrases) === null || _b === void 0 ? void 0 : _b.removingGrowlMessage) {
|
|
410
|
+
serialized['as']['p']['rgm'] = LucidCardIntegrationRegistry.nextHookName();
|
|
411
|
+
client.registerAction(serialized['as']['p']['rgm'], ({ 'c': count }) => {
|
|
412
|
+
var _a, _b;
|
|
413
|
+
return (_b = (_a = autoSync.phrases) === null || _a === void 0 ? void 0 : _a.removingGrowlMessage) === null || _b === void 0 ? void 0 : _b.call(_a, count);
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
}
|
|
387
417
|
client.registerAction(serialized['as']['gsf'], async ({ 'i': inputSoFar }) => {
|
|
388
418
|
const result = await autoSync.getSyncDataSourceIdField(new Map(inputSoFar));
|
|
389
419
|
return (0, cardintegrationdefinitions_1.serializeCardFieldArrayDefinition)(result);
|
|
@@ -416,10 +446,13 @@ class LucidCardIntegrationRegistry {
|
|
|
416
446
|
if (cardIntegration.fieldConfiguration.customFieldDisplaySettings) {
|
|
417
447
|
serialized['fc']['cfds'] = {
|
|
418
448
|
'd': cardIntegration.fieldConfiguration.customFieldDisplaySettings.defaultToMultilineText,
|
|
419
|
-
'uri': (
|
|
420
|
-
'dadr': (
|
|
449
|
+
'uri': (_d = (_c = cardIntegration.fieldConfiguration) === null || _c === void 0 ? void 0 : _c.customFieldDisplaySettings) === null || _d === void 0 ? void 0 : _d.useRoundIcons,
|
|
450
|
+
'dadr': (_f = (_e = cardIntegration.fieldConfiguration) === null || _e === void 0 ? void 0 : _e.customFieldDisplaySettings) === null || _f === void 0 ? void 0 : _f.displayMappedDatesAsDateRange,
|
|
421
451
|
};
|
|
422
452
|
}
|
|
453
|
+
if (cardIntegration.fieldConfiguration.nonCustomizableFields) {
|
|
454
|
+
serialized['fc']['ncf'] = cardIntegration.fieldConfiguration.nonCustomizableFields;
|
|
455
|
+
}
|
|
423
456
|
this.registerDependencyMapping(client, cardIntegration, serialized);
|
|
424
457
|
this.registerImportCardFromPastedLinkHandler(client, cardIntegration, serialized);
|
|
425
458
|
if (cardIntegration.importFromSerializedFields) {
|
|
@@ -430,12 +463,12 @@ class LucidCardIntegrationRegistry {
|
|
|
430
463
|
return (0, importcardfromdetails_1.serializeImportCardFromDetails)(result);
|
|
431
464
|
});
|
|
432
465
|
}
|
|
433
|
-
if (cardIntegration.
|
|
434
|
-
const
|
|
435
|
-
serialized['
|
|
436
|
-
client.registerAction(
|
|
437
|
-
const result = await cardIntegration.
|
|
438
|
-
return (0,
|
|
466
|
+
if (cardIntegration.canEditItems) {
|
|
467
|
+
const canEditItemsActionName = LucidCardIntegrationRegistry.nextHookName();
|
|
468
|
+
serialized['cei'] = canEditItemsActionName;
|
|
469
|
+
client.registerAction(canEditItemsActionName, async ({ 'ek': editedKey, 'dk': dependencyKey }) => {
|
|
470
|
+
const result = await cardIntegration.canEditItems(editedKey, dependencyKey);
|
|
471
|
+
return (0, useritemeditpermissions_1.serializeUserItemEditPermissions)(result);
|
|
439
472
|
});
|
|
440
473
|
}
|
|
441
474
|
client.sendCommand("aci" /* CommandName.AddCardIntegration */, serialized);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SerializedFieldConstraint } from '../data/serializedfield/serializedfielddefinition';
|
|
2
|
+
/**
|
|
3
|
+
* Defines whether the current user can edit an item.
|
|
4
|
+
*/
|
|
5
|
+
export interface UserItemEditPermissions {
|
|
6
|
+
hasPermission: boolean;
|
|
7
|
+
constraints: {
|
|
8
|
+
fieldName: string;
|
|
9
|
+
constraints?: SerializedFieldConstraint[];
|
|
10
|
+
}[];
|
|
11
|
+
}
|
|
12
|
+
export declare class UserCanEditItem implements UserItemEditPermissions {
|
|
13
|
+
readonly hasPermission = true;
|
|
14
|
+
constraints: never[];
|
|
15
|
+
}
|
|
16
|
+
export declare class UserCannotEditItem implements UserItemEditPermissions {
|
|
17
|
+
readonly hasPermission = false;
|
|
18
|
+
constraints: never[];
|
|
19
|
+
}
|
|
20
|
+
export declare function serializeUserItemEditPermissions(result: UserItemEditPermissions): {
|
|
21
|
+
hp: boolean;
|
|
22
|
+
c: {
|
|
23
|
+
fn: string;
|
|
24
|
+
cs: SerializedFieldConstraint[] | undefined;
|
|
25
|
+
}[];
|
|
26
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serializeUserItemEditPermissions = exports.UserCannotEditItem = exports.UserCanEditItem = void 0;
|
|
4
|
+
class UserCanEditItem {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.hasPermission = true;
|
|
7
|
+
this.constraints = [];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.UserCanEditItem = UserCanEditItem;
|
|
11
|
+
class UserCannotEditItem {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.hasPermission = false;
|
|
14
|
+
this.constraints = [];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.UserCannotEditItem = UserCannotEditItem;
|
|
18
|
+
function serializeUserItemEditPermissions(result) {
|
|
19
|
+
return {
|
|
20
|
+
'hp': result.hasPermission,
|
|
21
|
+
'c': result.constraints.map((c) => ({
|
|
22
|
+
'fn': c.fieldName,
|
|
23
|
+
'cs': c.constraints,
|
|
24
|
+
})),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
exports.serializeUserItemEditPermissions = serializeUserItemEditPermissions;
|
|
@@ -14,8 +14,6 @@
|
|
|
14
14
|
* Integration Simplicity: Simplifies the process of integrating new data sources into Lucid by mapping to an established set of Lucid Fields.
|
|
15
15
|
* Feature Compatibility: Allows for seamless use of Lucid’s intelligent features across all data, regardless of its origin.
|
|
16
16
|
* Data Organization: Provides a structured approach to organizing and grouping data within the Lucid ecosystem.
|
|
17
|
-
*
|
|
18
|
-
* Must be kept in sync with src/jvm/com/lucidchart/data/model/fielddefinition/LucidFields.scala
|
|
19
17
|
*/
|
|
20
18
|
export declare enum LucidFields {
|
|
21
19
|
/**
|
|
@@ -18,11 +18,10 @@ const validators_1 = require("../../validators/validators");
|
|
|
18
18
|
* Integration Simplicity: Simplifies the process of integrating new data sources into Lucid by mapping to an established set of Lucid Fields.
|
|
19
19
|
* Feature Compatibility: Allows for seamless use of Lucid’s intelligent features across all data, regardless of its origin.
|
|
20
20
|
* Data Organization: Provides a structured approach to organizing and grouping data within the Lucid ecosystem.
|
|
21
|
-
*
|
|
22
|
-
* Must be kept in sync with src/jvm/com/lucidchart/data/model/fielddefinition/LucidFields.scala
|
|
23
21
|
*/
|
|
24
22
|
var LucidFields;
|
|
25
23
|
(function (LucidFields) {
|
|
24
|
+
// IMPORTANT: this enum must be kept in sync with src/jvm/com/lucidchart/data/model/fielddefinition/LucidFields.scala
|
|
26
25
|
/**
|
|
27
26
|
* Represents the title or main descriptor of an item.
|
|
28
27
|
*/
|
|
@@ -13,7 +13,8 @@ export declare enum FieldConstraintType {
|
|
|
13
13
|
SINGLE_LINE_ONLY = "singleLineOnly",
|
|
14
14
|
NO_WHITESPACE = "noWhitespace",
|
|
15
15
|
UNIQUE_EDIT = "uniqueEditType",
|
|
16
|
-
MAX_LENGTH = "maxLength"
|
|
16
|
+
MAX_LENGTH = "maxLength",
|
|
17
|
+
MAX_DECIMAL_LENGTH = "maxDecimalLength"
|
|
17
18
|
}
|
|
18
19
|
export declare const isFieldConstraintType: (x: unknown) => x is FieldConstraintType;
|
|
19
20
|
export type SerializedFieldConstraint = {
|
|
@@ -18,6 +18,7 @@ var FieldConstraintType;
|
|
|
18
18
|
FieldConstraintType["NO_WHITESPACE"] = "noWhitespace";
|
|
19
19
|
FieldConstraintType["UNIQUE_EDIT"] = "uniqueEditType";
|
|
20
20
|
FieldConstraintType["MAX_LENGTH"] = "maxLength";
|
|
21
|
+
FieldConstraintType["MAX_DECIMAL_LENGTH"] = "maxDecimalLength";
|
|
21
22
|
})(FieldConstraintType || (exports.FieldConstraintType = FieldConstraintType = {}));
|
|
22
23
|
exports.isFieldConstraintType = (0, validators_1.enumValidator)(FieldConstraintType);
|
|
23
24
|
exports.isSerializedFieldConstraint = (0, validators_1.objectValidator)({
|
|
@@ -154,8 +154,10 @@ export interface SearchResultPerCollection {
|
|
|
154
154
|
* If you change this interface, check if your changes need to be synced with
|
|
155
155
|
* editorextensioncardintegrationregistry.ts.
|
|
156
156
|
*
|
|
157
|
-
* By specifying the itemsPerSearchResult, you can enable pagination for results in the import modal
|
|
158
|
-
* parameters in the search function will tell you which page of results
|
|
157
|
+
* By specifying the itemsPerSearchResult, you can enable pagination for results in the import modal OR the
|
|
158
|
+
* query sync modal. The offset and limit parameters in the search function will tell you which page of results
|
|
159
|
+
* to return, whereas the {@link AutoSyncPaginationSize} variable and pageNumber parameter should be used to
|
|
160
|
+
* calculate which search reults to return for query sync.
|
|
159
161
|
*
|
|
160
162
|
*/
|
|
161
163
|
export interface SearchResult {
|
|
@@ -271,6 +273,10 @@ export type ExtensionFieldConfiguration = {
|
|
|
271
273
|
defaultSearchCallback?: string;
|
|
272
274
|
/** Optional properties to configure how fields are displayed */
|
|
273
275
|
customFieldDisplaySettings?: CustomFieldDisplaySettings;
|
|
276
|
+
/** List of field names that will not be displayed in the settings panel or edit panel, so its badge position cannot be changed by user
|
|
277
|
+
* Order matters here, as the order of the fields in this list will be used to determine the order of the badges in the card
|
|
278
|
+
*/
|
|
279
|
+
nonCustomizableFields?: string[] | undefined;
|
|
274
280
|
};
|
|
275
281
|
/**
|
|
276
282
|
* Maps item field names to icons that show next to the field labels in the card details panel.
|
package/data/dataitemproxy.d.ts
CHANGED
|
@@ -18,6 +18,10 @@ export declare class DataItemProxy {
|
|
|
18
18
|
* The fields on this data item, organized by their name.
|
|
19
19
|
*/
|
|
20
20
|
readonly fields: MapProxy<string, import("..").SerializedFieldType>;
|
|
21
|
+
/**
|
|
22
|
+
* The fields on this data item, organized by their label.
|
|
23
|
+
*/
|
|
24
|
+
readonly fieldsByLabel: MapProxy<string, import("..").SerializedFieldType>;
|
|
21
25
|
/**
|
|
22
26
|
* @returns True if a data item exists in this collection at this primary key
|
|
23
27
|
*/
|
package/data/dataitemproxy.js
CHANGED
|
@@ -23,6 +23,15 @@ class DataItemProxy {
|
|
|
23
23
|
'pk': this.primaryKey,
|
|
24
24
|
'f': name,
|
|
25
25
|
}));
|
|
26
|
+
/**
|
|
27
|
+
* The fields on this data item, organized by their label.
|
|
28
|
+
*/
|
|
29
|
+
this.fieldsByLabel = new mapproxy_1.MapProxy(() => this.client.sendCommand("lcf" /* CommandName.ListCollectionFields */, { 'id': this.collection.id, 'l': true }), (name) => this.client.sendCommand("gdif" /* CommandName.GetDataItemField */, {
|
|
30
|
+
'c': this.collection.id,
|
|
31
|
+
'pk': this.primaryKey,
|
|
32
|
+
'f': name,
|
|
33
|
+
'l': true,
|
|
34
|
+
}));
|
|
26
35
|
}
|
|
27
36
|
/**
|
|
28
37
|
* @returns True if a data item exists in this collection at this primary key
|
|
@@ -40,15 +40,20 @@ export interface MaxLengthConstraintDefinition {
|
|
|
40
40
|
value: number;
|
|
41
41
|
reason?: string | undefined;
|
|
42
42
|
}
|
|
43
|
-
export
|
|
43
|
+
export interface MaxDecimalPlacesConstraintDefinition {
|
|
44
|
+
type: FieldConstraintType.MAX_DECIMAL_LENGTH;
|
|
45
|
+
value: number;
|
|
46
|
+
reason?: string | undefined;
|
|
47
|
+
}
|
|
48
|
+
export type FieldConstraintDefinition = RequiredFieldConstraintDefinition | LockedFieldConstraintDefinition | MinValueFieldConstraintDefinition | MaxValueFieldConstraintDefinition | SingleLineFieldConstraintDefinition | NoWhitespaceFieldConstraintDefinition | UniqueEditFieldConstraintDefinition | MaxLengthConstraintDefinition | MaxDecimalPlacesConstraintDefinition;
|
|
44
49
|
export declare function createFieldConstraintDefinition(type: FieldConstraintType, value?: number, reason?: string): FieldConstraintDefinition;
|
|
45
|
-
export declare function
|
|
50
|
+
export declare function numericFieldConstraintValidator(val: unknown): val is FieldConstraintType.MIN_VALUE | FieldConstraintType.MAX_VALUE | FieldConstraintType.MAX_LENGTH | FieldConstraintType.MAX_DECIMAL_LENGTH;
|
|
46
51
|
export declare const isFieldConstraintDefinition: (x: unknown) => x is {
|
|
47
52
|
type?: FieldConstraintType | undefined;
|
|
48
53
|
} & {
|
|
49
54
|
type: FieldConstraintType;
|
|
50
55
|
} & (import("..").DestructureGuardedTypeObj<{
|
|
51
|
-
type: typeof
|
|
56
|
+
type: typeof numericFieldConstraintValidator;
|
|
52
57
|
value: typeof isNumber;
|
|
53
58
|
}> | import("..").DestructureGuardedTypeObj<{
|
|
54
59
|
type: (x: unknown) => x is FieldConstraintType.REQUIRED | FieldConstraintType.LOCKED | FieldConstraintType.SINGLE_LINE_ONLY | FieldConstraintType.NO_WHITESPACE | FieldConstraintType.UNIQUE_EDIT;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.serializeFieldConstraintDefinition = exports.isFieldConstraintDefinition = exports.
|
|
3
|
+
exports.serializeFieldConstraintDefinition = exports.isFieldConstraintDefinition = exports.numericFieldConstraintValidator = exports.createFieldConstraintDefinition = void 0;
|
|
4
4
|
const assertnever_1 = require("../core/assertnever");
|
|
5
5
|
const checks_1 = require("../core/checks");
|
|
6
6
|
const serializedfielddefinition_1 = require("../core/data/serializedfield/serializedfielddefinition");
|
|
@@ -13,6 +13,7 @@ function createFieldConstraintDefinition(type, value, reason) {
|
|
|
13
13
|
case serializedfielddefinition_1.FieldConstraintType.MIN_VALUE:
|
|
14
14
|
case serializedfielddefinition_1.FieldConstraintType.MAX_VALUE:
|
|
15
15
|
case serializedfielddefinition_1.FieldConstraintType.MAX_LENGTH:
|
|
16
|
+
case serializedfielddefinition_1.FieldConstraintType.MAX_DECIMAL_LENGTH:
|
|
16
17
|
if (value === undefined) {
|
|
17
18
|
throw new Error('Invalid constraint value');
|
|
18
19
|
}
|
|
@@ -29,15 +30,19 @@ function createFieldConstraintDefinition(type, value, reason) {
|
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
exports.createFieldConstraintDefinition = createFieldConstraintDefinition;
|
|
32
|
-
function
|
|
33
|
+
function numericFieldConstraintValidator(val) {
|
|
33
34
|
return (val === serializedfielddefinition_1.FieldConstraintType.MIN_VALUE ||
|
|
34
35
|
val === serializedfielddefinition_1.FieldConstraintType.MAX_VALUE ||
|
|
35
|
-
val === serializedfielddefinition_1.FieldConstraintType.MAX_LENGTH
|
|
36
|
+
val === serializedfielddefinition_1.FieldConstraintType.MAX_LENGTH ||
|
|
37
|
+
val === serializedfielddefinition_1.FieldConstraintType.MAX_DECIMAL_LENGTH);
|
|
36
38
|
}
|
|
37
|
-
exports.
|
|
39
|
+
exports.numericFieldConstraintValidator = numericFieldConstraintValidator;
|
|
38
40
|
exports.isFieldConstraintDefinition = (0, validators_1.both)((0, validators_1.objectValidator)({
|
|
39
41
|
'type': serializedfielddefinition_1.isFieldConstraintType,
|
|
40
|
-
}), (0, validators_1.either)((0, validators_1.objectValidator)({ 'type':
|
|
42
|
+
}), (0, validators_1.either)((0, validators_1.objectValidator)({ 'type': numericFieldConstraintValidator, 'value': checks_1.isNumber }), (0, validators_1.objectValidator)({
|
|
43
|
+
'type': (0, validators_1.exclude)(serializedfielddefinition_1.isFieldConstraintType, numericFieldConstraintValidator),
|
|
44
|
+
'value': checks_1.isUndefined,
|
|
45
|
+
})));
|
|
41
46
|
/** @ignore */
|
|
42
47
|
function serializeFieldConstraintDefinition(constraint) {
|
|
43
48
|
return {
|
|
@@ -20,6 +20,6 @@ export declare enum DocumentElementType {
|
|
|
20
20
|
TrackedFormulaLocation = "TrackedFormulaLocation",
|
|
21
21
|
ElementAlias = "ElementAlias",
|
|
22
22
|
GeneratorCardSyncConfig = "GeneratorCardSyncConfig",
|
|
23
|
-
|
|
23
|
+
Scenario = "Scenario",
|
|
24
24
|
PropertyPrecedenceRegistry = "PropertyPrecedenceRegistry"
|
|
25
25
|
}
|
|
@@ -32,6 +32,6 @@ var DocumentElementType;
|
|
|
32
32
|
DocumentElementType["TrackedFormulaLocation"] = "TrackedFormulaLocation";
|
|
33
33
|
DocumentElementType["ElementAlias"] = "ElementAlias";
|
|
34
34
|
DocumentElementType["GeneratorCardSyncConfig"] = "GeneratorCardSyncConfig";
|
|
35
|
-
DocumentElementType["
|
|
35
|
+
DocumentElementType["Scenario"] = "Scenario";
|
|
36
36
|
DocumentElementType["PropertyPrecedenceRegistry"] = "PropertyPrecedenceRegistry";
|
|
37
37
|
})(DocumentElementType || (exports.DocumentElementType = DocumentElementType = {}));
|
package/package.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { SerializedFieldConstraint } from '../data/serializedfield/serializedfielddefinition';
|
|
2
|
-
/**
|
|
3
|
-
* Defines whether the current user has access to an item.
|
|
4
|
-
*/
|
|
5
|
-
export interface CardUserAccessResult {
|
|
6
|
-
hasPermission: boolean;
|
|
7
|
-
constraints: {
|
|
8
|
-
fieldName: string;
|
|
9
|
-
constraints?: SerializedFieldConstraint[];
|
|
10
|
-
}[];
|
|
11
|
-
}
|
|
12
|
-
export declare function serializeCardUserAccessResult(result: CardUserAccessResult): {
|
|
13
|
-
hp: boolean;
|
|
14
|
-
c: {
|
|
15
|
-
fn: string;
|
|
16
|
-
cs: SerializedFieldConstraint[] | undefined;
|
|
17
|
-
}[];
|
|
18
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.serializeCardUserAccessResult = void 0;
|
|
4
|
-
function serializeCardUserAccessResult(result) {
|
|
5
|
-
return {
|
|
6
|
-
'hp': result.hasPermission,
|
|
7
|
-
'c': result.constraints.map((c) => ({
|
|
8
|
-
'fn': c.fieldName,
|
|
9
|
-
'cs': c.constraints,
|
|
10
|
-
})),
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
exports.serializeCardUserAccessResult = serializeCardUserAccessResult;
|