lucid-extension-sdk 0.0.237 → 0.0.238
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.
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Used to define what a collection implicitly represents.
|
|
3
|
+
*
|
|
4
|
+
* SemanticCollection.Items indicates that the collection's contents should be visualized as distinct elements (such as cards) that can be compared.
|
|
5
|
+
*
|
|
6
|
+
* We currently only have one value in this enum. More will be added in the future.
|
|
7
|
+
*
|
|
8
|
+
* The values in this enum are purposely generic.
|
|
9
|
+
*/
|
|
10
|
+
export declare enum SemanticCollection {
|
|
11
|
+
Items = "Items"
|
|
12
|
+
}
|
|
13
|
+
export declare const isSemanticCollection: (x: unknown) => x is SemanticCollection.Items;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isSemanticCollection = exports.SemanticCollection = void 0;
|
|
4
|
+
const validators_1 = require("../../validators/validators");
|
|
5
|
+
/**
|
|
6
|
+
* Used to define what a collection implicitly represents.
|
|
7
|
+
*
|
|
8
|
+
* SemanticCollection.Items indicates that the collection's contents should be visualized as distinct elements (such as cards) that can be compared.
|
|
9
|
+
*
|
|
10
|
+
* We currently only have one value in this enum. More will be added in the future.
|
|
11
|
+
*
|
|
12
|
+
* The values in this enum are purposely generic.
|
|
13
|
+
*/
|
|
14
|
+
var SemanticCollection;
|
|
15
|
+
(function (SemanticCollection) {
|
|
16
|
+
SemanticCollection["Items"] = "Items";
|
|
17
|
+
})(SemanticCollection || (exports.SemanticCollection = SemanticCollection = {}));
|
|
18
|
+
exports.isSemanticCollection = (0, validators_1.enumValidator)(SemanticCollection);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SemanticCollection } from '../core/data/datasource/semanticcollection';
|
|
1
2
|
import { UpstreamPatchType } from '../core/data/datasource/upstreampatchtype';
|
|
2
3
|
import { SerializedFieldTypeDefinition } from '../core/data/fieldtypedefinition/fieldtypedefinition';
|
|
3
4
|
import { SemanticFields } from '../core/data/fieldtypedefinition/semanticfields';
|
|
@@ -40,9 +41,13 @@ type SerializedSchemaForApi = {
|
|
|
40
41
|
'primaryKey': string[];
|
|
41
42
|
'fieldLabelOverrides'?: SerializedLabelOverrides | undefined;
|
|
42
43
|
};
|
|
44
|
+
type serializedPropertiesForApi = {
|
|
45
|
+
'Represents': SemanticCollection[];
|
|
46
|
+
};
|
|
43
47
|
export interface SerializedCollectionPatch {
|
|
44
48
|
'schema'?: SerializedSchemaForApi;
|
|
45
49
|
'itemsPatch': SerializedItemsPatch;
|
|
50
|
+
'properties'?: serializedPropertiesForApi;
|
|
46
51
|
}
|
|
47
52
|
export declare class ItemsPatchInexhaustive {
|
|
48
53
|
/**
|
|
@@ -105,6 +110,8 @@ export interface CollectionPatch {
|
|
|
105
110
|
schema?: SchemaDefinition;
|
|
106
111
|
/** The patch to apply to the collection */
|
|
107
112
|
patch: ItemsPatch;
|
|
113
|
+
/** What the collection implicitly represents **/
|
|
114
|
+
represents?: SemanticCollection[];
|
|
108
115
|
}
|
|
109
116
|
/** @ignore */
|
|
110
117
|
export declare function serializeFieldDefinitionForApi(field: FieldDefinition): SerializedFieldDefinitionForApi;
|
|
@@ -68,10 +68,16 @@ function serializeSchemaForApi(schema) {
|
|
|
68
68
|
'fieldLabelOverrides': schema.fieldLabels,
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
+
function serializeRepresentsAsPropertyForApi(represents) {
|
|
72
|
+
return {
|
|
73
|
+
'Represents': represents, // key needs to match 'Represents' key in cake/app/webroot/ts/property/collection/collectionproperties.ts
|
|
74
|
+
};
|
|
75
|
+
}
|
|
71
76
|
function serializeCollectionPatch(patch) {
|
|
72
77
|
return {
|
|
73
78
|
'schema': patch.schema && serializeSchemaForApi(patch.schema),
|
|
74
79
|
'itemsPatch': serializeItemsPatch(patch.patch),
|
|
80
|
+
'properties': patch.represents && serializeRepresentsAsPropertyForApi(patch.represents),
|
|
75
81
|
};
|
|
76
82
|
}
|
|
77
83
|
exports.serializeCollectionPatch = serializeCollectionPatch;
|