@sprucelabs/schema 30.0.7 → 30.0.9
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.
|
@@ -10,7 +10,7 @@ export default abstract class AbstractField<F extends FieldDefinitions> implemen
|
|
|
10
10
|
/** The name of this field (camel case) */
|
|
11
11
|
name: string;
|
|
12
12
|
constructor(name: string, definition: F);
|
|
13
|
-
static
|
|
13
|
+
static description: string;
|
|
14
14
|
/** For mapping schemas to types dynamically in schema values */
|
|
15
15
|
static generateTypeDetails(): {
|
|
16
16
|
valueTypeMapper: string | undefined;
|
|
@@ -1,24 +1,13 @@
|
|
|
1
|
+
var _a;
|
|
1
2
|
import SpruceError from '../errors/SpruceError.js';
|
|
2
3
|
import isUndefinedOrNull from '../utilities/isUndefinedOrNull.js';
|
|
3
|
-
|
|
4
|
+
class AbstractField {
|
|
4
5
|
constructor(name, definition) {
|
|
5
6
|
this.definition = definition;
|
|
6
7
|
this.name = name;
|
|
7
8
|
this.type = definition.type;
|
|
8
9
|
return this;
|
|
9
10
|
}
|
|
10
|
-
static get description() {
|
|
11
|
-
throw new SpruceError({
|
|
12
|
-
code: 'NOT_IMPLEMENTED',
|
|
13
|
-
instructions: `Copy and paste this into ${this.name}:
|
|
14
|
-
|
|
15
|
-
public static get description() {
|
|
16
|
-
return '*** describe your field here ***'
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
`,
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
11
|
/** For mapping schemas to types dynamically in schema values */
|
|
23
12
|
static generateTypeDetails() {
|
|
24
13
|
return {
|
|
@@ -60,8 +49,8 @@ public static generateTemplateDetails(
|
|
|
60
49
|
return this.definition.hint;
|
|
61
50
|
}
|
|
62
51
|
get minArrayLength() {
|
|
63
|
-
var
|
|
64
|
-
return (
|
|
52
|
+
var _b;
|
|
53
|
+
return (_b = this.definition.minArrayLength) !== null && _b !== void 0 ? _b : 1;
|
|
65
54
|
}
|
|
66
55
|
validate(value, _) {
|
|
67
56
|
const errors = [];
|
|
@@ -79,3 +68,10 @@ public static generateTemplateDetails(
|
|
|
79
68
|
return value;
|
|
80
69
|
}
|
|
81
70
|
}
|
|
71
|
+
_a = AbstractField;
|
|
72
|
+
AbstractField.description = `Please set the description for your field ${_a.name}:
|
|
73
|
+
|
|
74
|
+
public static description = '*** describe your field here ***'
|
|
75
|
+
|
|
76
|
+
`;
|
|
77
|
+
export default AbstractField;
|
|
@@ -10,7 +10,7 @@ export default abstract class AbstractField<F extends FieldDefinitions> implemen
|
|
|
10
10
|
/** The name of this field (camel case) */
|
|
11
11
|
name: string;
|
|
12
12
|
constructor(name: string, definition: F);
|
|
13
|
-
static
|
|
13
|
+
static description: string;
|
|
14
14
|
/** For mapping schemas to types dynamically in schema values */
|
|
15
15
|
static generateTypeDetails(): {
|
|
16
16
|
valueTypeMapper: string | undefined;
|
|
@@ -18,18 +18,11 @@ class AbstractField {
|
|
|
18
18
|
this.type = definition.type;
|
|
19
19
|
return this;
|
|
20
20
|
}
|
|
21
|
-
static
|
|
22
|
-
throw new SpruceError_1.default({
|
|
23
|
-
code: 'NOT_IMPLEMENTED',
|
|
24
|
-
instructions: `Copy and paste this into ${this.name}:
|
|
21
|
+
static description = `Please set the description for your field ${this.name}:
|
|
25
22
|
|
|
26
|
-
public static
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
`,
|
|
31
|
-
});
|
|
32
|
-
}
|
|
23
|
+
public static description = '*** describe your field here ***'
|
|
24
|
+
|
|
25
|
+
`;
|
|
33
26
|
/** For mapping schemas to types dynamically in schema values */
|
|
34
27
|
static generateTypeDetails() {
|
|
35
28
|
return {
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"!build/__tests__",
|
|
9
9
|
"esm"
|
|
10
10
|
],
|
|
11
|
-
"version": "30.0.
|
|
11
|
+
"version": "30.0.9",
|
|
12
12
|
"main": "./build/index.js",
|
|
13
13
|
"types": "./build/index.d.ts",
|
|
14
14
|
"module": "./build/esm/index.js",
|
|
@@ -63,14 +63,14 @@
|
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@sprucelabs/error": "^6.0.6",
|
|
66
|
-
"@sprucelabs/test-utils": "^5.0.
|
|
66
|
+
"@sprucelabs/test-utils": "^5.0.7",
|
|
67
67
|
"email-validator": "^2.0.4",
|
|
68
68
|
"just-safe-get": "^4.2.0",
|
|
69
69
|
"just-safe-set": "^4.2.1"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@sprucelabs/esm-postbuild": "^6.0.6",
|
|
73
|
-
"@sprucelabs/jest-json-reporter": "^8.0.
|
|
73
|
+
"@sprucelabs/jest-json-reporter": "^8.0.5",
|
|
74
74
|
"@sprucelabs/resolve-path-aliases": "^2.0.8",
|
|
75
75
|
"@sprucelabs/semantic-release": "^5.0.1",
|
|
76
76
|
"@sprucelabs/test": "^9.0.6",
|