@sprucelabs/schema 29.0.1 → 29.0.3
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.
|
@@ -28,6 +28,7 @@ export interface StaticSchemaEntity<S extends Schema> extends SchemaEntity {
|
|
|
28
28
|
validate(options?: SchemaValidateOptions<S>): void;
|
|
29
29
|
isValid(options?: SchemaValidateOptions<S>): boolean;
|
|
30
30
|
}
|
|
31
|
+
/** @ts-ignore */
|
|
31
32
|
export type SchemaValues<S extends Schema, CreateEntityInstances extends boolean = false, IncludePrivateFields extends boolean = true, ShouldIncludeNullAndUndefinedFields extends boolean = false, F extends SchemaFieldNames<S> = SchemaFieldNames<S>, PF extends SchemaPublicFieldNames<S> = SchemaPublicFieldNames<S>> = IsDynamicSchema<S> extends true ? DynamicSchemaAllValues<S> : IncludePrivateFields extends false ? ShouldIncludeNullAndUndefinedFields extends true ? Pick<SchemaAllValues<S, CreateEntityInstances>, PF> : Pick<SchemaStaticValues<S, CreateEntityInstances>, PF> : ShouldIncludeNullAndUndefinedFields extends true ? Pick<SchemaAllValues<S, CreateEntityInstances>, F> : Pick<SchemaStaticValues<S, CreateEntityInstances>, F>;
|
|
32
33
|
export interface DynamicSchemaEntityByName<ISchema extends Schema, OurField extends Field<any> = ISchema['dynamicFieldSignature'] extends FieldDefinitions ? FieldMap[ISchema['dynamicFieldSignature']['type']] : any> extends SchemaEntity, Omit<StaticSchemaEntity<ISchema>, 'get' | 'set' | 'getValues' | 'setValues' | 'getNamedFields' | 'schemaId' | 'namespace' | 'name' | 'version' | 'description'> {
|
|
33
34
|
get<F extends string, CreateEntityInstances extends boolean = true>(fieldName: F, options?: DynamicSchemaNormalizeOptions<CreateEntityInstances>): FieldDefinitionValueType<OurField, CreateEntityInstances>;
|
|
@@ -28,6 +28,7 @@ export interface StaticSchemaEntity<S extends Schema> extends SchemaEntity {
|
|
|
28
28
|
validate(options?: SchemaValidateOptions<S>): void;
|
|
29
29
|
isValid(options?: SchemaValidateOptions<S>): boolean;
|
|
30
30
|
}
|
|
31
|
+
/** @ts-ignore */
|
|
31
32
|
export type SchemaValues<S extends Schema, CreateEntityInstances extends boolean = false, IncludePrivateFields extends boolean = true, ShouldIncludeNullAndUndefinedFields extends boolean = false, F extends SchemaFieldNames<S> = SchemaFieldNames<S>, PF extends SchemaPublicFieldNames<S> = SchemaPublicFieldNames<S>> = IsDynamicSchema<S> extends true ? DynamicSchemaAllValues<S> : IncludePrivateFields extends false ? ShouldIncludeNullAndUndefinedFields extends true ? Pick<SchemaAllValues<S, CreateEntityInstances>, PF> : Pick<SchemaStaticValues<S, CreateEntityInstances>, PF> : ShouldIncludeNullAndUndefinedFields extends true ? Pick<SchemaAllValues<S, CreateEntityInstances>, F> : Pick<SchemaStaticValues<S, CreateEntityInstances>, F>;
|
|
32
33
|
export interface DynamicSchemaEntityByName<ISchema extends Schema, OurField extends Field<any> = ISchema['dynamicFieldSignature'] extends FieldDefinitions ? FieldMap[ISchema['dynamicFieldSignature']['type']] : any> extends SchemaEntity, Omit<StaticSchemaEntity<ISchema>, 'get' | 'set' | 'getValues' | 'setValues' | 'getNamedFields' | 'schemaId' | 'namespace' | 'name' | 'version' | 'description'> {
|
|
33
34
|
get<F extends string, CreateEntityInstances extends boolean = true>(fieldName: F, options?: DynamicSchemaNormalizeOptions<CreateEntityInstances>): FieldDefinitionValueType<OurField, CreateEntityInstances>;
|
package/package.json
CHANGED
|
@@ -1,122 +1,122 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
2
|
+
"name": "@sprucelabs/schema",
|
|
3
|
+
"publishConfig": {
|
|
4
|
+
"access": "public"
|
|
5
|
+
},
|
|
6
|
+
"files": [
|
|
7
|
+
"build",
|
|
8
|
+
"!build/__tests__",
|
|
9
|
+
"esm"
|
|
10
|
+
],
|
|
11
|
+
"version": "29.0.3",
|
|
12
|
+
"main": "./build/index.js",
|
|
13
|
+
"types": "./build/index.d.ts",
|
|
14
|
+
"module": "./build/esm/index.js",
|
|
15
|
+
"sideEffects": false,
|
|
16
|
+
"description": "Static and dynamic binding plus runtime validation and transformation to ensure your app is sound. 🤓",
|
|
17
|
+
"keywords": [
|
|
18
|
+
"node",
|
|
19
|
+
"components",
|
|
20
|
+
"sprucebot",
|
|
21
|
+
"sprucelabs"
|
|
22
|
+
],
|
|
23
|
+
"skill": {
|
|
24
|
+
"namespace": "spruce-schema",
|
|
25
|
+
"upgradeIgnoreList": [
|
|
26
|
+
"@sprucelabs/spruce-test-fixtures",
|
|
27
|
+
"@types/node",
|
|
28
|
+
"@sprucelabs/esm-postbuild",
|
|
29
|
+
"@sprucelabs/jest-json-reporter",
|
|
30
|
+
"@sprucelabs/jest-sheets-reporter",
|
|
31
|
+
"@sprucelabs/resolve-path-aliases"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"homepage": "https://github.com/sprucelabsai/spruce-schema",
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/sprucelabsai/spruce-schema/issues"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build.ci": "yarn build.tsc && yarn build.resolve-paths && yarn lint",
|
|
40
|
+
"build.dev": "yarn build.tsc --sourceMap ; yarn resolve-paths.lint",
|
|
41
|
+
"build.dist": "tsc --project tsconfig.dist.json && yarn build.resolve-paths && mv build esm && yarn build.esm-postbuild && yarn build.tsc && yarn build.resolve-paths && mv esm build/ && yarn clean.dist",
|
|
42
|
+
"build.esm-postbuild": "esm-postbuild --target esm --patterns '**/*.js'",
|
|
43
|
+
"build.resolve-paths": "resolve-path-aliases --target build --patterns '**/*.js,**/*.d.ts'",
|
|
44
|
+
"build.tsc": "tsc",
|
|
45
|
+
"clean": "yarn clean.build",
|
|
46
|
+
"clean.all": "yarn clean.dependencies && yarn clean.build",
|
|
47
|
+
"clean.build": "rm -rf build/",
|
|
48
|
+
"clean.dependencies": "rm -rf node_modules/ package-lock.json yarn.lock",
|
|
49
|
+
"clean.dist": "rm -rf build/__tests__ build/esm/__tests__",
|
|
50
|
+
"fix.lint": "eslint --fix --cache '**/*.ts'",
|
|
51
|
+
"lint": "eslint --cache '**/*.ts'",
|
|
52
|
+
"lint.tsc": "tsc -p . --noEmit",
|
|
53
|
+
"rebuild": "yarn clean.all && yarn && yarn build.dev",
|
|
54
|
+
"release": "semantic-release",
|
|
55
|
+
"test": "jest",
|
|
56
|
+
"update.dependencies": "yarn clean.dependencies && yarn",
|
|
57
|
+
"upgrade.packages": "yarn-upgrade-all && rm -f yarn.lock ; yarn ; yarn fix.lint ; true",
|
|
58
|
+
"upgrade.packages.all": "yarn install && yarn upgrade.packages",
|
|
59
|
+
"upgrade.packages.test": "yarn upgrade.packages.all && yarn lint && yarn build.dev && yarn test",
|
|
60
|
+
"watch.build.dev": "tsc-watch --sourceMap --onCompilationComplete 'yarn post.watch.build'",
|
|
61
|
+
"watch.lint": "concurrently 'yarn lint' \"chokidar 'src/**/*' -c 'yarn lint.tsc'\"",
|
|
62
|
+
"watch.tsc": "tsc -w",
|
|
63
|
+
"post.watch.build": "yarn build.resolve-paths",
|
|
64
|
+
"resolve-paths.lint": "yarn build.resolve-paths ; yarn lint",
|
|
65
|
+
"watch.rebuild": "yarn clean.all && yarn && yarn watch.build.dev",
|
|
66
|
+
"build.copy-files": "mkdir -p build && rsync -avzq --exclude='*.ts' ./src/ ./build/"
|
|
67
|
+
},
|
|
68
|
+
"dependencies": {
|
|
69
|
+
"@sprucelabs/error": "^5.1.12",
|
|
70
|
+
"@sprucelabs/test-utils": "^3.4.76",
|
|
71
|
+
"email-validator": "^2.0.4",
|
|
72
|
+
"just-safe-get": "^4.2.0",
|
|
73
|
+
"just-safe-set": "^4.2.1"
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@sprucelabs/esm-postbuild": "^2.0.22",
|
|
77
|
+
"@sprucelabs/jest-json-reporter": "^6.0.512",
|
|
78
|
+
"@sprucelabs/jest-sheets-reporter": "^2.0.20",
|
|
79
|
+
"@sprucelabs/resolve-path-aliases": "^1.1.122",
|
|
80
|
+
"@sprucelabs/semantic-release": "^4.0.8",
|
|
81
|
+
"@sprucelabs/test": "^8.0.0",
|
|
82
|
+
"chokidar-cli": "^3.0.0",
|
|
83
|
+
"concurrently": "^8.2.0",
|
|
84
|
+
"eslint": "^8.44.0",
|
|
85
|
+
"eslint-config-spruce": "^10.12.0",
|
|
86
|
+
"jest": "^29.6.1",
|
|
87
|
+
"jest-circus": "^29.6.1",
|
|
88
|
+
"prettier": "2.8.8",
|
|
89
|
+
"ts-node": "^10.9.1",
|
|
90
|
+
"tsc-watch": "^6.0.4",
|
|
91
|
+
"tsconfig-paths": "^4.2.0",
|
|
92
|
+
"typescript": "^5.1.6"
|
|
93
|
+
},
|
|
94
|
+
"jest": {
|
|
95
|
+
"testEnvironment": "node",
|
|
96
|
+
"testPathIgnorePatterns": [
|
|
97
|
+
"<rootDir>/tmp/",
|
|
98
|
+
"<rootDir>/src/",
|
|
99
|
+
"<rootDir>/node_modules/"
|
|
100
|
+
],
|
|
101
|
+
"testMatch": [
|
|
102
|
+
"**/__tests__/**/*.test.js?(x)"
|
|
103
|
+
],
|
|
104
|
+
"moduleNameMapper": {
|
|
105
|
+
"^#spruce/(.*)$": "<rootDir>/build/.spruce/$1"
|
|
106
|
+
},
|
|
107
|
+
"reporters": [
|
|
108
|
+
"default",
|
|
109
|
+
[
|
|
110
|
+
"@sprucelabs/jest-sheets-reporter",
|
|
111
|
+
{
|
|
112
|
+
"sheetId": "1DoWM7mYgGDa-PJXptLomrZmbIBZiuxS1YiAsRXU2Gm0",
|
|
113
|
+
"worksheetId": 843037832,
|
|
114
|
+
"testMap": {
|
|
115
|
+
"passesWithMoreThanMin": "I80",
|
|
116
|
+
"invalidFieldsGiveDescriptionsOnWhySomethingIsInvalid": "I275"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
122
|
}
|