lucid-extension-sdk 0.0.437 → 0.0.438
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 +10 -3
- package/core/cardintegration/cardintegrationautosyncconfig.d.ts +15 -4
- package/core/cardintegration/cardintegrationautosyncconfig.js +7 -0
- package/core/cardintegration/cardintegrationparams.d.ts +2 -2
- package/core/cardintegration/lucidcardintegration.d.ts +3 -3
- package/core/cardintegration/lucidcardintegrationregistry.js +7 -7
- package/core/cardintegration/useritemeditpermissions.d.ts +26 -0
- package/core/cardintegration/useritemeditpermissions.js +27 -0
- package/core/data/serializedfield/serializedfielddefinition.d.ts +2 -1
- package/core/data/serializedfield/serializedfielddefinition.js +1 -0
- package/core/sharedcardintegration/cardintegrationdefinitions.d.ts +4 -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/package.json +1 -1
- package/core/cardintegration/carduseraccessresult.d.ts +0 -18
- package/core/cardintegration/carduseraccessresult.js +0 -13
package/commandtypes.d.ts
CHANGED
|
@@ -908,9 +908,9 @@ export type AddCardIntegrationQuery = {
|
|
|
908
908
|
'cb': string;
|
|
909
909
|
} | undefined;
|
|
910
910
|
/**
|
|
911
|
-
*
|
|
911
|
+
* Whether the user can edit an item in the data source.
|
|
912
912
|
*/
|
|
913
|
-
'
|
|
913
|
+
'cei'?: string | undefined;
|
|
914
914
|
};
|
|
915
915
|
export type AddCardIntegrationResult = undefined;
|
|
916
916
|
/** @ignore */
|
|
@@ -1398,8 +1398,13 @@ export type GetDataItemFieldQuery = {
|
|
|
1398
1398
|
'c': string;
|
|
1399
1399
|
/** Primary key of the data item to read */
|
|
1400
1400
|
'pk': string;
|
|
1401
|
-
/** Name of field to read */
|
|
1401
|
+
/** Name of field (or field label, if 'l' is true) to read */
|
|
1402
1402
|
'f': string;
|
|
1403
|
+
/**
|
|
1404
|
+
* "label" - If true, get the field by label, not name
|
|
1405
|
+
* (Labels are specified by `FieldLabelOverrides` in `SerializedSchema`)
|
|
1406
|
+
* */
|
|
1407
|
+
'l'?: boolean | undefined;
|
|
1403
1408
|
};
|
|
1404
1409
|
export type GetDataItemFieldResult = SerializedFieldType;
|
|
1405
1410
|
export type GetDeveloperModeStatusQuery = void;
|
|
@@ -1631,6 +1636,8 @@ export type ListDataItemsResult = string[];
|
|
|
1631
1636
|
export type ListCollectionFieldsQuery = {
|
|
1632
1637
|
/** Collection ID to query */
|
|
1633
1638
|
'id': string;
|
|
1639
|
+
/** "labels" - If true, list field labels. Otherwise, list field names (default) */
|
|
1640
|
+
'l'?: boolean | undefined;
|
|
1634
1641
|
};
|
|
1635
1642
|
export type ListCollectionFieldsResult = string[];
|
|
1636
1643
|
export type ListDataSourcesQuery = undefined;
|
|
@@ -1,8 +1,18 @@
|
|
|
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
|
-
* The header to display for the integration
|
|
15
|
+
* The header to display for the integration in the autosync modal.
|
|
6
16
|
*/
|
|
7
17
|
header: string;
|
|
8
18
|
/**
|
|
@@ -14,12 +24,13 @@ export interface CardIntegrationAutoSyncConfig {
|
|
|
14
24
|
*/
|
|
15
25
|
getSyncDataSourceIdField: (searchSoFar: Map<string, SerializedFieldType>) => Promise<ExtensionCardFieldDefinition[]>;
|
|
16
26
|
/**
|
|
17
|
-
* Perform a search on the query string. This should support pagination.
|
|
27
|
+
* Perform a search on the query string. This should support pagination (See {@link AutoSyncPaginationSize}).
|
|
18
28
|
*
|
|
19
29
|
* The syncDataSourceIdNonce is provided in otherFields
|
|
20
|
-
* @
|
|
30
|
+
* @param pageNumber If undefined, will return all results from the search
|
|
31
|
+
* @returns the search results after searching using the given query string.
|
|
21
32
|
*/
|
|
22
|
-
searchQueryString?: (queryString: string, otherFields: Map<string, SerializedFieldType>, pageNumber: number, nextPageToken: string | undefined) => Promise<SearchResult>;
|
|
33
|
+
searchQueryString?: (queryString: string, otherFields: Map<string, SerializedFieldType>, pageNumber: number | undefined, nextPageToken: string | undefined) => Promise<SearchResult>;
|
|
23
34
|
/**
|
|
24
35
|
* @returns the ImportResult for the query string.
|
|
25
36
|
*/
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AutoSyncPaginationSize = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The amount of results that will be displayed per page when using pagination. To enable pagination, define the
|
|
6
|
+
* {@link SearchResult.itemsPerSearchResult} field in your search results and return workitems equal to this variable's
|
|
7
|
+
* value.
|
|
8
|
+
*/
|
|
9
|
+
exports.AutoSyncPaginationSize = 50;
|
|
@@ -26,7 +26,7 @@ export interface SearchParam {
|
|
|
26
26
|
export interface QuerySearchParam {
|
|
27
27
|
'qs': string;
|
|
28
28
|
'of': [string, SerializedFieldType][];
|
|
29
|
-
'pn': number;
|
|
29
|
+
'pn': number | undefined;
|
|
30
30
|
'npt': string | undefined;
|
|
31
31
|
}
|
|
32
32
|
export interface QuerySyncParam {
|
|
@@ -101,7 +101,7 @@ export interface ImportFromSerializedFieldsCallbackParam {
|
|
|
101
101
|
'sf': SerializedFields[];
|
|
102
102
|
}
|
|
103
103
|
/** @ignore */
|
|
104
|
-
export interface
|
|
104
|
+
export interface CanEditItemsParam {
|
|
105
105
|
'ek': string;
|
|
106
106
|
'dk'?: string;
|
|
107
107
|
}
|
|
@@ -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
|
}
|
|
@@ -10,8 +10,8 @@ const checks_1 = require("../checks");
|
|
|
10
10
|
const importcardfromdetails_1 = require("../importcardfromdetails/importcardfromdetails");
|
|
11
11
|
const cardintegrationdefinitions_1 = require("../sharedcardintegration/cardintegrationdefinitions");
|
|
12
12
|
const cardintegrationconfig_1 = require("./cardintegrationconfig");
|
|
13
|
-
const carduseraccessresult_1 = require("./carduseraccessresult");
|
|
14
13
|
const lucidcardintegrationcustomimportmodal_1 = require("./lucidcardintegrationcustomimportmodal");
|
|
14
|
+
const useritemeditpermissions_1 = require("./useritemeditpermissions");
|
|
15
15
|
class LucidCardIntegrationRegistry {
|
|
16
16
|
static nextHookName() {
|
|
17
17
|
return '__lucidcard__hook' + LucidCardIntegrationRegistry.nextHookId++;
|
|
@@ -430,12 +430,12 @@ class LucidCardIntegrationRegistry {
|
|
|
430
430
|
return (0, importcardfromdetails_1.serializeImportCardFromDetails)(result);
|
|
431
431
|
});
|
|
432
432
|
}
|
|
433
|
-
if (cardIntegration.
|
|
434
|
-
const
|
|
435
|
-
serialized['
|
|
436
|
-
client.registerAction(
|
|
437
|
-
const result = await cardIntegration.
|
|
438
|
-
return (0,
|
|
433
|
+
if (cardIntegration.canEditItems) {
|
|
434
|
+
const canEditItemsActionName = LucidCardIntegrationRegistry.nextHookName();
|
|
435
|
+
serialized['cei'] = canEditItemsActionName;
|
|
436
|
+
client.registerAction(canEditItemsActionName, async ({ 'ek': editedKey, 'dk': dependencyKey }) => {
|
|
437
|
+
const result = await cardIntegration.canEditItems(editedKey, dependencyKey);
|
|
438
|
+
return (0, useritemeditpermissions_1.serializeUserItemEditPermissions)(result);
|
|
439
439
|
});
|
|
440
440
|
}
|
|
441
441
|
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;
|
|
@@ -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 {
|
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 {
|
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;
|