lucid-extension-sdk 0.0.267 → 0.0.268
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/core/data/datasource/spreadsheetpossibledatatypes.js +1 -0
- package/core/data/fieldtypedefinition/scalarfieldtype.d.ts +2 -1
- package/core/data/fieldtypedefinition/scalarfieldtype.js +2 -0
- package/core/data/serializedfield/serializedfields.d.ts +12 -1
- package/core/data/serializedfield/serializedfields.js +7 -1
- package/package.json +1 -1
|
@@ -10,5 +10,6 @@ exports.SpreadSheetPossibleDataTypes = [
|
|
|
10
10
|
scalarfieldtype_1.ScalarFieldTypeEnum.CURRENCY,
|
|
11
11
|
scalarfieldtype_1.ScalarFieldTypeEnum.DATE,
|
|
12
12
|
scalarfieldtype_1.ScalarFieldTypeEnum.DATEONLY,
|
|
13
|
+
scalarfieldtype_1.ScalarFieldTypeEnum.TIMEONLY,
|
|
13
14
|
scalarfieldtype_1.ScalarFieldTypeEnum.COLOR,
|
|
14
15
|
];
|
|
@@ -8,7 +8,8 @@ export declare enum ScalarFieldTypeEnum {
|
|
|
8
8
|
NULL = 6,
|
|
9
9
|
DICTIONARY = 7,
|
|
10
10
|
CURRENCY = 8,
|
|
11
|
-
DATEONLY = 9
|
|
11
|
+
DATEONLY = 9,
|
|
12
|
+
TIMEONLY = 10
|
|
12
13
|
}
|
|
13
14
|
export declare const AnyScalarFieldType: ScalarFieldTypeEnum[];
|
|
14
15
|
export declare const isScalarFieldTypeEnum: (fieldType: any) => fieldType is ScalarFieldTypeEnum;
|
|
@@ -13,6 +13,7 @@ var ScalarFieldTypeEnum;
|
|
|
13
13
|
ScalarFieldTypeEnum[ScalarFieldTypeEnum["DICTIONARY"] = 7] = "DICTIONARY";
|
|
14
14
|
ScalarFieldTypeEnum[ScalarFieldTypeEnum["CURRENCY"] = 8] = "CURRENCY";
|
|
15
15
|
ScalarFieldTypeEnum[ScalarFieldTypeEnum["DATEONLY"] = 9] = "DATEONLY";
|
|
16
|
+
ScalarFieldTypeEnum[ScalarFieldTypeEnum["TIMEONLY"] = 10] = "TIMEONLY";
|
|
16
17
|
})(ScalarFieldTypeEnum || (exports.ScalarFieldTypeEnum = ScalarFieldTypeEnum = {}));
|
|
17
18
|
exports.AnyScalarFieldType = [
|
|
18
19
|
ScalarFieldTypeEnum.ANY,
|
|
@@ -25,6 +26,7 @@ exports.AnyScalarFieldType = [
|
|
|
25
26
|
ScalarFieldTypeEnum.NULL,
|
|
26
27
|
ScalarFieldTypeEnum.DICTIONARY,
|
|
27
28
|
ScalarFieldTypeEnum.CURRENCY,
|
|
29
|
+
ScalarFieldTypeEnum.TIMEONLY,
|
|
28
30
|
];
|
|
29
31
|
const AnyScalarFieldTypeSet = new Set(exports.AnyScalarFieldType);
|
|
30
32
|
const isScalarFieldTypeEnum = (fieldType) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isNumber, isString } from '../../checks';
|
|
2
|
-
export type SerializedFieldType = number | boolean | string | null | SerializedLucidDateObject | SerializedColorObjectFieldType | SerializedLucidDictionary | SerializedLucidCurrency | undefined | Array<SerializedFieldType>;
|
|
2
|
+
export type SerializedFieldType = number | boolean | string | null | SerializedLucidDateObject | SerializedTimeObject | SerializedColorObjectFieldType | SerializedLucidDictionary | SerializedLucidCurrency | undefined | Array<SerializedFieldType>;
|
|
3
3
|
export type SerializedJsonFieldType = number | boolean | string | null | undefined | Array<SerializedJsonFieldType> | {
|
|
4
4
|
[index: string]: SerializedJsonFieldType;
|
|
5
5
|
};
|
|
@@ -30,6 +30,12 @@ export type SerializedMillisecondsDateObject = {
|
|
|
30
30
|
'isDateOnly'?: boolean;
|
|
31
31
|
};
|
|
32
32
|
export type SerializedLucidDateObject = SerializedMillisecondsDateObject | SerializedIsoDateObject;
|
|
33
|
+
export type SerializedTimeObject = {
|
|
34
|
+
'hours': number;
|
|
35
|
+
'minutes'?: number | undefined;
|
|
36
|
+
'seconds'?: number | undefined;
|
|
37
|
+
'milliseconds'?: number | undefined;
|
|
38
|
+
};
|
|
33
39
|
export type SerializedRGBColor = {
|
|
34
40
|
'r': number;
|
|
35
41
|
'g': number;
|
|
@@ -98,6 +104,11 @@ export declare const isSerializedLucidDateObject: (x: unknown) => x is import(".
|
|
|
98
104
|
isoDate: typeof isString;
|
|
99
105
|
displayTimezone: (x: unknown) => x is string | undefined;
|
|
100
106
|
}>;
|
|
107
|
+
export declare const isSerializedTimeObject: (subject: unknown) => subject is import("../../guards").DestructureGuardedTypeObj<{
|
|
108
|
+
hours: typeof isNumber;
|
|
109
|
+
minutes: (x: unknown) => x is number | undefined;
|
|
110
|
+
seconds: (x: unknown) => x is number | undefined;
|
|
111
|
+
}>;
|
|
101
112
|
export declare function isSerializedFieldType(value: any): value is SerializedFieldType;
|
|
102
113
|
export declare function isSerializedJsonFieldType(value: any): value is SerializedJsonFieldType;
|
|
103
114
|
export declare const isSerializedFields: (x: unknown) => x is Record<any, SerializedFieldType>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSerializedFields = exports.isSerializedJsonFieldType = exports.isSerializedFieldType = exports.isSerializedLucidDateObject = exports.isSerializedMillisecondsDateObject = exports.isSerializedLucidCurrency = exports.isSerializedLucidDictionary = exports.isJsonSerializedLucidDictionary = exports.isNestedSerializedLucidDictionary = exports.isSerializedColorObjectFieldType = void 0;
|
|
3
|
+
exports.isSerializedFields = exports.isSerializedJsonFieldType = exports.isSerializedFieldType = exports.isSerializedTimeObject = exports.isSerializedLucidDateObject = exports.isSerializedMillisecondsDateObject = exports.isSerializedLucidCurrency = exports.isSerializedLucidDictionary = exports.isJsonSerializedLucidDictionary = exports.isNestedSerializedLucidDictionary = exports.isSerializedColorObjectFieldType = void 0;
|
|
4
4
|
const checks_1 = require("../../checks");
|
|
5
5
|
const validators_1 = require("../../validators/validators");
|
|
6
6
|
function isSerializedColorObjectFieldType(value) {
|
|
@@ -29,6 +29,11 @@ const isSerializedIsoDateObject = (0, validators_1.objectValidator)({
|
|
|
29
29
|
'displayTimezone': (0, validators_1.option)(checks_1.isString),
|
|
30
30
|
});
|
|
31
31
|
exports.isSerializedLucidDateObject = (0, validators_1.either)(exports.isSerializedMillisecondsDateObject, isSerializedIsoDateObject);
|
|
32
|
+
exports.isSerializedTimeObject = (0, validators_1.objectValidator)({
|
|
33
|
+
'hours': checks_1.isNumber,
|
|
34
|
+
'minutes': (0, validators_1.option)(checks_1.isNumber),
|
|
35
|
+
'seconds': (0, validators_1.option)(checks_1.isNumber),
|
|
36
|
+
});
|
|
32
37
|
function isSerializedFieldType(value) {
|
|
33
38
|
return (value == null ||
|
|
34
39
|
(0, checks_1.isNumber)(value) ||
|
|
@@ -38,6 +43,7 @@ function isSerializedFieldType(value) {
|
|
|
38
43
|
(0, exports.isSerializedLucidCurrency)(value) ||
|
|
39
44
|
((0, checks_1.isArray)(value) && value.every(isSerializedFieldType)) ||
|
|
40
45
|
(0, exports.isSerializedLucidDateObject)(value) ||
|
|
46
|
+
(0, exports.isSerializedTimeObject)(value) ||
|
|
41
47
|
isSerializedColorObjectFieldType(value));
|
|
42
48
|
}
|
|
43
49
|
exports.isSerializedFieldType = isSerializedFieldType;
|