lucid-extension-sdk 0.0.258 → 0.0.260
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,3 @@
|
|
|
1
|
+
import { ScalarFieldTypeEnum } from './scalarfieldtype';
|
|
2
|
+
export declare function isDateScalarFieldTypeEnum(fieldType: unknown): fieldType is ScalarFieldTypeEnum.DATE | ScalarFieldTypeEnum.DATEONLY;
|
|
3
|
+
export declare function isDateFieldTypeDefinition(fieldType: unknown): fieldType is (ScalarFieldTypeEnum.DATE | ScalarFieldTypeEnum.DATEONLY)[] | ScalarFieldTypeEnum.DATE | ScalarFieldTypeEnum.DATEONLY;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isDateFieldTypeDefinition = exports.isDateScalarFieldTypeEnum = void 0;
|
|
4
|
+
const checks_1 = require("../../checks");
|
|
5
|
+
const basefieldtypedefinition_1 = require("./basefieldtypedefinition");
|
|
6
|
+
const scalarfieldtype_1 = require("./scalarfieldtype");
|
|
7
|
+
function isDateScalarFieldTypeEnum(fieldType) {
|
|
8
|
+
return ((0, scalarfieldtype_1.isScalarFieldTypeEnum)(fieldType) &&
|
|
9
|
+
(fieldType === scalarfieldtype_1.ScalarFieldTypeEnum.DATE || fieldType === scalarfieldtype_1.ScalarFieldTypeEnum.DATEONLY));
|
|
10
|
+
}
|
|
11
|
+
exports.isDateScalarFieldTypeEnum = isDateScalarFieldTypeEnum;
|
|
12
|
+
function isDateFieldTypeDefinition(fieldType) {
|
|
13
|
+
return (((0, basefieldtypedefinition_1.isBaseFieldTypeDefinition)(fieldType) && isDateScalarFieldTypeEnum(fieldType)) ||
|
|
14
|
+
((0, checks_1.isArray)(fieldType) && fieldType.every(isDateScalarFieldTypeEnum)));
|
|
15
|
+
}
|
|
16
|
+
exports.isDateFieldTypeDefinition = isDateFieldTypeDefinition;
|
|
@@ -42,7 +42,8 @@ type SerializedSchemaForApi = {
|
|
|
42
42
|
'fieldLabelOverrides'?: SerializedLabelOverrides | undefined;
|
|
43
43
|
};
|
|
44
44
|
type serializedPropertiesForApi = {
|
|
45
|
-
'Represents'
|
|
45
|
+
'Represents'?: SemanticCollection[];
|
|
46
|
+
'Name'?: string;
|
|
46
47
|
};
|
|
47
48
|
export interface SerializedCollectionPatch {
|
|
48
49
|
'schema'?: SerializedSchemaForApi;
|
|
@@ -114,6 +115,8 @@ export interface CollectionPatch {
|
|
|
114
115
|
patch: ItemsPatch;
|
|
115
116
|
/** What the collection implicitly represents **/
|
|
116
117
|
represents?: SemanticCollection[];
|
|
118
|
+
/** The collection's display name */
|
|
119
|
+
name?: string | undefined;
|
|
117
120
|
}
|
|
118
121
|
/** @ignore */
|
|
119
122
|
export declare function serializeFieldDefinitionForApi(field: FieldDefinition): SerializedFieldDefinitionForApi;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.schemaOKStatus = exports.schemaOutOfSyncStatus = exports.serializeCollectionPatch = exports.serializeFieldDefinitionForApi = exports.serializeItemsPatch = exports.ItemsPatchExhaustive = exports.ItemsPatchInexhaustive = void 0;
|
|
4
|
+
const checks_1 = require("../core/checks");
|
|
4
5
|
const fieldtypedefinition_1 = require("../core/data/fieldtypedefinition/fieldtypedefinition");
|
|
5
6
|
const object_1 = require("../core/object");
|
|
6
7
|
const collectionerrortypes_1 = require("../data/collectionerrortypes");
|
|
@@ -72,11 +73,19 @@ function serializeRepresentsAsPropertyForApi(represents) {
|
|
|
72
73
|
'Represents': represents, // key needs to match 'Represents' key in cake/app/webroot/ts/property/collection/collectionproperties.ts
|
|
73
74
|
};
|
|
74
75
|
}
|
|
76
|
+
function serializeNameAsPropertyForApi(name) {
|
|
77
|
+
return {
|
|
78
|
+
'Name': name, // key needs to match 'Name' key in cake/app/webroot/ts/property/collection/collectionproperties.ts
|
|
79
|
+
};
|
|
80
|
+
}
|
|
75
81
|
function serializeCollectionPatch(patch) {
|
|
82
|
+
const representsProperty = patch.represents && serializeRepresentsAsPropertyForApi(patch.represents);
|
|
83
|
+
const nameProperty = (0, checks_1.isString)(patch.name) ? serializeNameAsPropertyForApi(patch.name) : undefined;
|
|
84
|
+
const properties = (representsProperty || nameProperty) && Object.assign(Object.assign({}, representsProperty), nameProperty);
|
|
76
85
|
return {
|
|
77
86
|
'schema': patch.schema && serializeSchemaForApi(patch.schema),
|
|
78
87
|
'itemsPatch': serializeItemsPatch(patch.patch),
|
|
79
|
-
'properties':
|
|
88
|
+
'properties': properties,
|
|
80
89
|
};
|
|
81
90
|
}
|
|
82
91
|
exports.serializeCollectionPatch = serializeCollectionPatch;
|