lucid-extension-sdk 0.0.137 → 0.0.138
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/package.json
CHANGED
|
@@ -8,7 +8,8 @@ export declare enum FieldConstraintType {
|
|
|
8
8
|
MIN_VALUE = "minValue",
|
|
9
9
|
MAX_VALUE = "maxValue",
|
|
10
10
|
SINGLE_LINE_ONLY = "singleLineOnly",
|
|
11
|
-
NO_WHITESPACE = "noWhitespace"
|
|
11
|
+
NO_WHITESPACE = "noWhitespace",
|
|
12
|
+
UNIQUE_EDIT = "uniqueEditType"
|
|
12
13
|
}
|
|
13
14
|
export declare const isFieldConstraintType: (x: unknown) => x is FieldConstraintType;
|
|
14
15
|
export declare type SerializedFieldConstraint = {
|
|
@@ -14,6 +14,7 @@ var FieldConstraintType;
|
|
|
14
14
|
FieldConstraintType["MAX_VALUE"] = "maxValue";
|
|
15
15
|
FieldConstraintType["SINGLE_LINE_ONLY"] = "singleLineOnly";
|
|
16
16
|
FieldConstraintType["NO_WHITESPACE"] = "noWhitespace";
|
|
17
|
+
FieldConstraintType["UNIQUE_EDIT"] = "uniqueEditType";
|
|
17
18
|
})(FieldConstraintType = exports.FieldConstraintType || (exports.FieldConstraintType = {}));
|
|
18
19
|
exports.isFieldConstraintType = (0, validators_1.enumValidator)(FieldConstraintType);
|
|
19
20
|
exports.isSerializedFieldConstraint = (0, validators_1.objectValidator)({
|
|
@@ -27,7 +27,11 @@ export interface NoWhitespaceFieldConstraintDefinition {
|
|
|
27
27
|
type: FieldConstraintType.NO_WHITESPACE;
|
|
28
28
|
value?: undefined;
|
|
29
29
|
}
|
|
30
|
-
export
|
|
30
|
+
export interface UniqueEditFieldConstraintDefinition {
|
|
31
|
+
type: FieldConstraintType.UNIQUE_EDIT;
|
|
32
|
+
value?: undefined;
|
|
33
|
+
}
|
|
34
|
+
export declare type FieldConstraintDefinition = RequiredFieldConstraintDefinition | LockedFieldConstraintDefinition | MinValueFieldConstraintDefinition | MaxValueFieldConstraintDefinition | SingleLineFieldConstraintDefinition | NoWhitespaceFieldConstraintDefinition | UniqueEditFieldConstraintDefinition;
|
|
31
35
|
export declare function minMaxFieldConstraintValidator(val: unknown): val is FieldConstraintType.MIN_VALUE | FieldConstraintType.MAX_VALUE;
|
|
32
36
|
export declare const isFieldConstraintDefinition: (x: unknown) => x is {
|
|
33
37
|
type?: FieldConstraintType | undefined;
|
|
@@ -37,7 +41,7 @@ export declare const isFieldConstraintDefinition: (x: unknown) => x is {
|
|
|
37
41
|
type: typeof minMaxFieldConstraintValidator;
|
|
38
42
|
value: typeof isNumber;
|
|
39
43
|
}> | import("..").DestructureGuardedTypeObj<{
|
|
40
|
-
type: (x: unknown) => x is FieldConstraintType.REQUIRED | FieldConstraintType.LOCKED | FieldConstraintType.SINGLE_LINE_ONLY | FieldConstraintType.NO_WHITESPACE;
|
|
44
|
+
type: (x: unknown) => x is FieldConstraintType.REQUIRED | FieldConstraintType.LOCKED | FieldConstraintType.SINGLE_LINE_ONLY | FieldConstraintType.NO_WHITESPACE | FieldConstraintType.UNIQUE_EDIT;
|
|
41
45
|
value: typeof isUndefined;
|
|
42
46
|
}>);
|
|
43
47
|
/**
|
|
@@ -62,6 +62,7 @@ function parseFieldDefinition(field) {
|
|
|
62
62
|
case serializedfielddefinition_1.FieldConstraintType.LOCKED:
|
|
63
63
|
case serializedfielddefinition_1.FieldConstraintType.SINGLE_LINE_ONLY:
|
|
64
64
|
case serializedfielddefinition_1.FieldConstraintType.NO_WHITESPACE:
|
|
65
|
+
case serializedfielddefinition_1.FieldConstraintType.UNIQUE_EDIT:
|
|
65
66
|
return { type: constraint['Type'] };
|
|
66
67
|
default:
|
|
67
68
|
throw new Error('Invalid constraint format');
|