@takeshape/schema 8.68.3 → 8.69.0
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/es/layers/layers.js +2 -2
- package/es/layers/type-utils.js +4 -4
- package/es/rewrite.js +3 -3
- package/es/types/utils.js +8 -8
- package/es/unions.js +5 -5
- package/es/validate.js +0 -16
- package/lib/layers/layers.js +1 -1
- package/lib/layers/type-utils.js +3 -3
- package/lib/rewrite.js +2 -2
- package/lib/types/utils.js +7 -7
- package/lib/unions.js +4 -4
- package/lib/validate.d.ts.map +1 -1
- package/lib/validate.js +0 -16
- package/package.json +4 -4
package/es/layers/layers.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import minimatch from 'minimatch';
|
|
2
|
-
import { deepClone, isDefined,
|
|
2
|
+
import { deepClone, isDefined, isRecord } from '@takeshape/util';
|
|
3
3
|
import uniq from 'lodash/uniq';
|
|
4
4
|
import { getArgsReferenceWithPath, getRefOrItemsRef, dereferenceSchema, parseReturnShape, refItemToString, splitAtRef } from './refs';
|
|
5
5
|
import { isAllOfSchema, isObjectSchema, isOneOfSchema, isRefSchema } from './type-utils';
|
|
@@ -36,7 +36,7 @@ function filterLayer(layerSchema, filters) {
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
export function isObjectSchemaV4_0_0(maybeObjectSchema) {
|
|
39
|
-
return maybeObjectSchema.type === 'object' &&
|
|
39
|
+
return maybeObjectSchema.type === 'object' && isRecord(maybeObjectSchema.properties);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
function mergeShape(a, b) {
|
package/es/layers/type-utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isRecord } from '@takeshape/util';
|
|
2
2
|
import isPlainObject from 'lodash/isPlainObject';
|
|
3
3
|
import isString from 'lodash/isString';
|
|
4
4
|
import isArray from 'lodash/isArray';
|
|
@@ -60,7 +60,7 @@ export function isDirectiveMappingArray(maybeArray) {
|
|
|
60
60
|
*/
|
|
61
61
|
|
|
62
62
|
export function isDirectiveConfig(maybeConfig) {
|
|
63
|
-
return isArray(maybeConfig) && isArray(maybeConfig[0]) && isString(maybeConfig[0][0]) &&
|
|
63
|
+
return isArray(maybeConfig) && isArray(maybeConfig[0]) && isString(maybeConfig[0][0]) && isRecord(maybeConfig[0][1]);
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
66
|
* Determine whether a ParameterSerializeOption is a content type serializer
|
|
@@ -135,8 +135,8 @@ export function isOneOfSchema(schema) {
|
|
|
135
135
|
return isArray(schema.oneOf);
|
|
136
136
|
}
|
|
137
137
|
export function isArraySchema(schema) {
|
|
138
|
-
return schema.type === 'array' &&
|
|
138
|
+
return schema.type === 'array' && isRecord(schema.items);
|
|
139
139
|
}
|
|
140
140
|
export function isObjectSchema(schema) {
|
|
141
|
-
return schema.type === 'object' &&
|
|
141
|
+
return schema.type === 'object' && isRecord(schema.properties);
|
|
142
142
|
}
|
package/es/rewrite.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import defaults from 'lodash/fp/defaults';
|
|
2
|
-
import {
|
|
2
|
+
import { isRecord } from '@takeshape/util';
|
|
3
3
|
const rewriteSchemaCache = new Map();
|
|
4
4
|
|
|
5
5
|
function getRewriteCache(options) {
|
|
@@ -33,7 +33,7 @@ export function rewriteSchema(schema, options) {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
rewrittenSchema = JSON.parse(JSON.stringify(schema), (_key, value) => {
|
|
36
|
-
if (
|
|
36
|
+
if (isRecord(value)) {
|
|
37
37
|
// Remove required
|
|
38
38
|
if (options.removeRequired && Array.isArray(value.required) && value.required.length) {
|
|
39
39
|
delete value.required;
|
|
@@ -44,7 +44,7 @@ export function rewriteSchema(schema, options) {
|
|
|
44
44
|
delete value.default;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
if (options.replaceInput &&
|
|
47
|
+
if (options.replaceInput && isRecord(value['@input'])) {
|
|
48
48
|
return { ...value['@input'],
|
|
49
49
|
'@mapping': value['@mapping']
|
|
50
50
|
};
|
package/es/types/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isRecord } from '@takeshape/util';
|
|
2
2
|
import { ArgsType, RefType } from './types';
|
|
3
3
|
import eq from 'semver/functions/eq';
|
|
4
4
|
import coerce from 'semver/functions/coerce';
|
|
@@ -79,10 +79,10 @@ export const isProjectSchemaV3_14_0 = createVersionPredicate('3.14.0');
|
|
|
79
79
|
export const isProjectSchemaV3_15_0 = createVersionPredicate('3.15.0');
|
|
80
80
|
export const isLatestProjectSchema = createVersionPredicate(CURRENT_SCHEMA_VERSION);
|
|
81
81
|
export function isV1XSchema(maybeSchema) {
|
|
82
|
-
return
|
|
82
|
+
return isRecord(maybeSchema) && isString(maybeSchema.projectId) && isRecord(maybeSchema.contentTypes) && (isUndefined(maybeSchema.schemaVersion) || maybeSchema.schemaVersion === '1' || maybeSchema.schemaVersion === '1.0.0');
|
|
83
83
|
}
|
|
84
84
|
export function isV3XSchema(maybeSchema) {
|
|
85
|
-
if (!
|
|
85
|
+
if (!isRecord(maybeSchema) || !isString(maybeSchema.projectId) || !isString(maybeSchema.schemaVersion)) {
|
|
86
86
|
return false;
|
|
87
87
|
}
|
|
88
88
|
|
|
@@ -94,12 +94,12 @@ export function isV3XSchema(maybeSchema) {
|
|
|
94
94
|
*/
|
|
95
95
|
|
|
96
96
|
export function isAnyProjectSchema(value) {
|
|
97
|
-
if (!
|
|
97
|
+
if (!isRecord(value)) {
|
|
98
98
|
return false;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
const maybeSchema = value;
|
|
102
|
-
return
|
|
102
|
+
return isRecord(value) && isString(maybeSchema.projectId) && (isV1XSchema(maybeSchema) || isV3XSchema(maybeSchema));
|
|
103
103
|
}
|
|
104
104
|
export function isProjectSchemaWithServices(schema) {
|
|
105
105
|
return typeof schema.dataKey !== 'undefined' && typeof schema.services !== 'undefined';
|
|
@@ -125,7 +125,7 @@ export function isDirectiveMappingArray(maybeArray) {
|
|
|
125
125
|
*/
|
|
126
126
|
|
|
127
127
|
export function isDirectiveConfig(maybeConfig) {
|
|
128
|
-
return isArray(maybeConfig) && isArray(maybeConfig[0]) && isString(maybeConfig[0][0]) &&
|
|
128
|
+
return isArray(maybeConfig) && isArray(maybeConfig[0]) && isString(maybeConfig[0][0]) && isRecord(maybeConfig[0][1]);
|
|
129
129
|
}
|
|
130
130
|
/**
|
|
131
131
|
* Determine whether a ParameterSerializeOption is a content type serializer
|
|
@@ -221,10 +221,10 @@ export function isEnumSchema(obj) {
|
|
|
221
221
|
return isArray(obj.enum);
|
|
222
222
|
}
|
|
223
223
|
export function isArraySchema(propertySchema) {
|
|
224
|
-
return propertySchema.type === 'array' &&
|
|
224
|
+
return propertySchema.type === 'array' && isRecord(propertySchema.items);
|
|
225
225
|
}
|
|
226
226
|
export function isObjectSchema(propertySchema) {
|
|
227
|
-
return propertySchema.type === 'object' &&
|
|
227
|
+
return propertySchema.type === 'object' && isRecord(propertySchema.properties);
|
|
228
228
|
}
|
|
229
229
|
/** Service Config Utils **/
|
|
230
230
|
|
package/es/unions.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getRef, refItemToShapeName } from './refs';
|
|
2
|
-
import { camelCase,
|
|
2
|
+
import { camelCase, isRecord } from '@takeshape/util';
|
|
3
3
|
import omit from 'lodash/omit';
|
|
4
4
|
import { getContentTransform, toName } from './content-schema-transform';
|
|
5
5
|
import { isRefSchema } from './types/utils';
|
|
@@ -64,7 +64,7 @@ function formatKeys(keys) {
|
|
|
64
64
|
|
|
65
65
|
// eslint-disable-next-line max-params
|
|
66
66
|
export const createUnwrapTransform = projectSchema => (obj, schema, name, shape, next) => {
|
|
67
|
-
if (
|
|
67
|
+
if (isRecord(obj)) {
|
|
68
68
|
const oneOfKeys = enumerateOneOfKeys(projectSchema, getOneOf(schema));
|
|
69
69
|
const objectKeys = Object.keys(obj);
|
|
70
70
|
|
|
@@ -80,10 +80,10 @@ export const createUnwrapTransform = projectSchema => (obj, schema, name, shape,
|
|
|
80
80
|
} of oneOfKeys) {
|
|
81
81
|
const propValue = obj[propName];
|
|
82
82
|
|
|
83
|
-
if (
|
|
83
|
+
if (isRecord(propValue)) {
|
|
84
84
|
const transformedPropValue = next(propValue, propSchema, name);
|
|
85
85
|
|
|
86
|
-
if (
|
|
86
|
+
if (isRecord(transformedPropValue)) {
|
|
87
87
|
return { ...transformedPropValue,
|
|
88
88
|
_shapeId: shapeId
|
|
89
89
|
};
|
|
@@ -94,7 +94,7 @@ export const createUnwrapTransform = projectSchema => (obj, schema, name, shape,
|
|
|
94
94
|
}; // eslint-disable-next-line max-params
|
|
95
95
|
|
|
96
96
|
export const createWrapTransform = projectSchema => (obj, schema, name, shape, next) => {
|
|
97
|
-
if (
|
|
97
|
+
if (isRecord(obj) && typeof obj._shapeId === 'string') {
|
|
98
98
|
const shape = getShapeById(projectSchema, obj._shapeId);
|
|
99
99
|
|
|
100
100
|
if (shape) {
|
package/es/validate.js
CHANGED
|
@@ -290,22 +290,6 @@ function validateIndexedShapeConfig(projectSchema, shapeName, config) {
|
|
|
290
290
|
message: `Invalid query "${list.name}"`
|
|
291
291
|
});
|
|
292
292
|
}
|
|
293
|
-
|
|
294
|
-
const shape = projectSchema.shapes[shapeName]; // Resolved shapes are not checked
|
|
295
|
-
|
|
296
|
-
if (shape && list.ignoreFields) {
|
|
297
|
-
for (const fieldName of list.ignoreFields) {
|
|
298
|
-
var _properties;
|
|
299
|
-
|
|
300
|
-
if (((_properties = shape.schema.properties) === null || _properties === void 0 ? void 0 : _properties[fieldName]) === undefined) {
|
|
301
|
-
errors.push({
|
|
302
|
-
path: ['indexedShapes', shapeName, 'queries', 'list', 'ignoreFields'],
|
|
303
|
-
type: 'notFound',
|
|
304
|
-
message: `Invalid property "${fieldName}" on shape "${shapeName}"`
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
293
|
}
|
|
310
294
|
|
|
311
295
|
return errors;
|
package/lib/layers/layers.js
CHANGED
|
@@ -59,7 +59,7 @@ function filterLayer(layerSchema, filters) {
|
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
function isObjectSchemaV4_0_0(maybeObjectSchema) {
|
|
62
|
-
return maybeObjectSchema.type === 'object' && (0, _util.
|
|
62
|
+
return maybeObjectSchema.type === 'object' && (0, _util.isRecord)(maybeObjectSchema.properties);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
function mergeShape(a, b) {
|
package/lib/layers/type-utils.js
CHANGED
|
@@ -104,7 +104,7 @@ function isDirectiveMappingArray(maybeArray) {
|
|
|
104
104
|
|
|
105
105
|
|
|
106
106
|
function isDirectiveConfig(maybeConfig) {
|
|
107
|
-
return (0, _isArray.default)(maybeConfig) && (0, _isArray.default)(maybeConfig[0]) && (0, _isString.default)(maybeConfig[0][0]) && (0, _util.
|
|
107
|
+
return (0, _isArray.default)(maybeConfig) && (0, _isArray.default)(maybeConfig[0]) && (0, _isString.default)(maybeConfig[0][0]) && (0, _util.isRecord)(maybeConfig[0][1]);
|
|
108
108
|
}
|
|
109
109
|
/**
|
|
110
110
|
* Determine whether a ParameterSerializeOption is a content type serializer
|
|
@@ -190,9 +190,9 @@ function isOneOfSchema(schema) {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
function isArraySchema(schema) {
|
|
193
|
-
return schema.type === 'array' && (0, _util.
|
|
193
|
+
return schema.type === 'array' && (0, _util.isRecord)(schema.items);
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
function isObjectSchema(schema) {
|
|
197
|
-
return schema.type === 'object' && (0, _util.
|
|
197
|
+
return schema.type === 'object' && (0, _util.isRecord)(schema.properties);
|
|
198
198
|
}
|
package/lib/rewrite.js
CHANGED
|
@@ -44,7 +44,7 @@ function rewriteSchema(schema, options) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
rewrittenSchema = JSON.parse(JSON.stringify(schema), (_key, value) => {
|
|
47
|
-
if ((0, _util.
|
|
47
|
+
if ((0, _util.isRecord)(value)) {
|
|
48
48
|
// Remove required
|
|
49
49
|
if (options.removeRequired && Array.isArray(value.required) && value.required.length) {
|
|
50
50
|
delete value.required;
|
|
@@ -55,7 +55,7 @@ function rewriteSchema(schema, options) {
|
|
|
55
55
|
delete value.default;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
if (options.replaceInput && (0, _util.
|
|
58
|
+
if (options.replaceInput && (0, _util.isRecord)(value['@input'])) {
|
|
59
59
|
return { ...value['@input'],
|
|
60
60
|
'@mapping': value['@mapping']
|
|
61
61
|
};
|
package/lib/types/utils.js
CHANGED
|
@@ -176,11 +176,11 @@ const isLatestProjectSchema = createVersionPredicate(_schemas.CURRENT_SCHEMA_VER
|
|
|
176
176
|
exports.isLatestProjectSchema = isLatestProjectSchema;
|
|
177
177
|
|
|
178
178
|
function isV1XSchema(maybeSchema) {
|
|
179
|
-
return (0, _util.
|
|
179
|
+
return (0, _util.isRecord)(maybeSchema) && (0, _isString.default)(maybeSchema.projectId) && (0, _util.isRecord)(maybeSchema.contentTypes) && ((0, _isUndefined.default)(maybeSchema.schemaVersion) || maybeSchema.schemaVersion === '1' || maybeSchema.schemaVersion === '1.0.0');
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
function isV3XSchema(maybeSchema) {
|
|
183
|
-
if (!(0, _util.
|
|
183
|
+
if (!(0, _util.isRecord)(maybeSchema) || !(0, _isString.default)(maybeSchema.projectId) || !(0, _isString.default)(maybeSchema.schemaVersion)) {
|
|
184
184
|
return false;
|
|
185
185
|
}
|
|
186
186
|
|
|
@@ -193,12 +193,12 @@ function isV3XSchema(maybeSchema) {
|
|
|
193
193
|
|
|
194
194
|
|
|
195
195
|
function isAnyProjectSchema(value) {
|
|
196
|
-
if (!(0, _util.
|
|
196
|
+
if (!(0, _util.isRecord)(value)) {
|
|
197
197
|
return false;
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
const maybeSchema = value;
|
|
201
|
-
return (0, _util.
|
|
201
|
+
return (0, _util.isRecord)(value) && (0, _isString.default)(maybeSchema.projectId) && (isV1XSchema(maybeSchema) || isV3XSchema(maybeSchema));
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
function isProjectSchemaWithServices(schema) {
|
|
@@ -228,7 +228,7 @@ function isDirectiveMappingArray(maybeArray) {
|
|
|
228
228
|
|
|
229
229
|
|
|
230
230
|
function isDirectiveConfig(maybeConfig) {
|
|
231
|
-
return (0, _isArray.default)(maybeConfig) && (0, _isArray.default)(maybeConfig[0]) && (0, _isString.default)(maybeConfig[0][0]) && (0, _util.
|
|
231
|
+
return (0, _isArray.default)(maybeConfig) && (0, _isArray.default)(maybeConfig[0]) && (0, _isString.default)(maybeConfig[0][0]) && (0, _util.isRecord)(maybeConfig[0][1]);
|
|
232
232
|
}
|
|
233
233
|
/**
|
|
234
234
|
* Determine whether a ParameterSerializeOption is a content type serializer
|
|
@@ -341,11 +341,11 @@ function isEnumSchema(obj) {
|
|
|
341
341
|
}
|
|
342
342
|
|
|
343
343
|
function isArraySchema(propertySchema) {
|
|
344
|
-
return propertySchema.type === 'array' && (0, _util.
|
|
344
|
+
return propertySchema.type === 'array' && (0, _util.isRecord)(propertySchema.items);
|
|
345
345
|
}
|
|
346
346
|
|
|
347
347
|
function isObjectSchema(propertySchema) {
|
|
348
|
-
return propertySchema.type === 'object' && (0, _util.
|
|
348
|
+
return propertySchema.type === 'object' && (0, _util.isRecord)(propertySchema.properties);
|
|
349
349
|
}
|
|
350
350
|
/** Service Config Utils **/
|
|
351
351
|
|
package/lib/unions.js
CHANGED
|
@@ -86,7 +86,7 @@ function formatKeys(keys) {
|
|
|
86
86
|
|
|
87
87
|
// eslint-disable-next-line max-params
|
|
88
88
|
const createUnwrapTransform = projectSchema => (obj, schema, name, shape, next) => {
|
|
89
|
-
if ((0, _util.
|
|
89
|
+
if ((0, _util.isRecord)(obj)) {
|
|
90
90
|
const oneOfKeys = enumerateOneOfKeys(projectSchema, getOneOf(schema));
|
|
91
91
|
const objectKeys = Object.keys(obj);
|
|
92
92
|
|
|
@@ -102,10 +102,10 @@ const createUnwrapTransform = projectSchema => (obj, schema, name, shape, next)
|
|
|
102
102
|
} of oneOfKeys) {
|
|
103
103
|
const propValue = obj[propName];
|
|
104
104
|
|
|
105
|
-
if ((0, _util.
|
|
105
|
+
if ((0, _util.isRecord)(propValue)) {
|
|
106
106
|
const transformedPropValue = next(propValue, propSchema, name);
|
|
107
107
|
|
|
108
|
-
if ((0, _util.
|
|
108
|
+
if ((0, _util.isRecord)(transformedPropValue)) {
|
|
109
109
|
return { ...transformedPropValue,
|
|
110
110
|
_shapeId: shapeId
|
|
111
111
|
};
|
|
@@ -119,7 +119,7 @@ const createUnwrapTransform = projectSchema => (obj, schema, name, shape, next)
|
|
|
119
119
|
exports.createUnwrapTransform = createUnwrapTransform;
|
|
120
120
|
|
|
121
121
|
const createWrapTransform = projectSchema => (obj, schema, name, shape, next) => {
|
|
122
|
-
if ((0, _util.
|
|
122
|
+
if ((0, _util.isRecord)(obj) && typeof obj._shapeId === 'string') {
|
|
123
123
|
const shape = (0, _schemaUtil.getShapeById)(projectSchema, obj._shapeId);
|
|
124
124
|
|
|
125
125
|
if (shape) {
|
package/lib/validate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/validate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,WAAW,EAAC,MAAM,KAAK,CAAC;AACvD,OAAO,KAAK,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAE1D,OAAO,KAAK,EAEV,gBAAgB,EAChB,aAAa,EASb,iBAAiB,
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/validate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,WAAW,EAAC,MAAM,KAAK,CAAC;AACvD,OAAO,KAAK,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAE1D,OAAO,KAAK,EAEV,gBAAgB,EAChB,aAAa,EASb,iBAAiB,EAGlB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAwB,yBAAyB,EAAC,MAAM,mBAAmB,CAAC;AAgdnF,oBAAY,sBAAsB,GAC9B;IAAC,KAAK,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAC,GAC1D;IAAC,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,yBAAyB,EAAE,CAAA;CAAC,CAAC;AAE3E,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,yBAAyB,CAuBzE;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,CAAC,aAAa,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;IAC/C,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,KAAK,sBAAsB,CAAC;CAClF;AACD,MAAM,WAAW,eAAe;IAC9B,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;IACnC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,iBAAiB,GAAG,SAAS,CAAC;CACnE;AA6ID;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,sBAAsB,CAqB9F;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,aAAa,CAgBnE;AAgBD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,OAAO,GAAG,SAAS,CAQpE;AAgBD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,CAQlE;AAqBD;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,OAAO,GAAG,gBAAgB,CASlF"}
|
package/lib/validate.js
CHANGED
|
@@ -325,22 +325,6 @@ function validateIndexedShapeConfig(projectSchema, shapeName, config) {
|
|
|
325
325
|
message: `Invalid query "${list.name}"`
|
|
326
326
|
});
|
|
327
327
|
}
|
|
328
|
-
|
|
329
|
-
const shape = projectSchema.shapes[shapeName]; // Resolved shapes are not checked
|
|
330
|
-
|
|
331
|
-
if (shape && list.ignoreFields) {
|
|
332
|
-
for (const fieldName of list.ignoreFields) {
|
|
333
|
-
var _properties;
|
|
334
|
-
|
|
335
|
-
if (((_properties = shape.schema.properties) === null || _properties === void 0 ? void 0 : _properties[fieldName]) === undefined) {
|
|
336
|
-
errors.push({
|
|
337
|
-
path: ['indexedShapes', shapeName, 'queries', 'list', 'ignoreFields'],
|
|
338
|
-
type: 'notFound',
|
|
339
|
-
message: `Invalid property "${fieldName}" on shape "${shapeName}"`
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
328
|
}
|
|
345
329
|
|
|
346
330
|
return errors;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takeshape/schema",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.69.0",
|
|
4
4
|
"description": "TakeShape Schema",
|
|
5
5
|
"homepage": "https://www.takeshape.io",
|
|
6
6
|
"repository": {
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"examples"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@takeshape/errors": "8.
|
|
25
|
-
"@takeshape/json-schema": "8.
|
|
26
|
-
"@takeshape/util": "8.
|
|
24
|
+
"@takeshape/errors": "8.69.0",
|
|
25
|
+
"@takeshape/json-schema": "8.69.0",
|
|
26
|
+
"@takeshape/util": "8.69.0",
|
|
27
27
|
"ajv": "^7.0.4",
|
|
28
28
|
"ajv-formats": "^1.5.1",
|
|
29
29
|
"blueimp-md5": "^2.10.0",
|