@takeshape/schema 8.68.4 → 8.70.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.
@@ -1,5 +1,5 @@
1
1
  import minimatch from 'minimatch';
2
- import { deepClone, isDefined, isObject } from '@takeshape/util';
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' && isObject(maybeObjectSchema.properties);
39
+ return maybeObjectSchema.type === 'object' && isRecord(maybeObjectSchema.properties);
40
40
  }
41
41
 
42
42
  function mergeShape(a, b) {
@@ -1,4 +1,4 @@
1
- import { isObject } from '@takeshape/util';
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]) && isObject(maybeConfig[0][1]);
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' && isObject(schema.items);
138
+ return schema.type === 'array' && isRecord(schema.items);
139
139
  }
140
140
  export function isObjectSchema(schema) {
141
- return schema.type === 'object' && isObject(schema.properties);
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 { isObject } from '@takeshape/util';
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 (isObject(value)) {
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 && isObject(value['@input'])) {
47
+ if (options.replaceInput && isRecord(value['@input'])) {
48
48
  return { ...value['@input'],
49
49
  '@mapping': value['@mapping']
50
50
  };
package/es/schema-util.js CHANGED
@@ -99,7 +99,7 @@ export function getServiceInfo(projectSchema, shape) {
99
99
  const depShapes = getShapeDependencies(projectSchema, shape).map(name => projectSchema.shapes[name]);
100
100
  const shapesToCheck = [shape, ...depShapes];
101
101
  shapesToCheck.forEach(thisShape => {
102
- createSchemaPropertyList(projectSchema, thisShape.schema).forEach(([key, value]) => {
102
+ createSchemaPropertyList(projectSchema, thisShape).forEach(([key, value]) => {
103
103
  const resolver = value['@resolver'];
104
104
 
105
105
  if (!isBasicResolver(resolver)) {
package/es/taxonomies.js CHANGED
@@ -16,7 +16,7 @@ export function getFirstStringFieldV3(shape, projectSchema) {
16
16
  return null;
17
17
  }
18
18
 
19
- const schemaProperties = createSchemaPropertyAccessor(projectSchema, shape.schema);
19
+ const schemaProperties = createSchemaPropertyAccessor(projectSchema, shape);
20
20
  const {
21
21
  order
22
22
  } = forms.default;
@@ -137,7 +137,7 @@ function getConflictingProperties(projectSchema, shapes) {
137
137
  const allProps = {};
138
138
 
139
139
  for (const shape of Object.values(shapes)) {
140
- for (const [name, prop] of createSchemaPropertyList(projectSchema, shape.schema).getNodes()) {
140
+ for (const [name, prop] of createSchemaPropertyList(projectSchema, shape).getNodes()) {
141
141
  if (name in allProps && (allProps[name].type !== prop.type || !isEqualRelationship(allProps[name], prop))) {
142
142
  conflicts.add(name);
143
143
  }
@@ -303,7 +303,7 @@ export function getFields(typeName, shapes, context) {
303
303
  };
304
304
 
305
305
  for (const shape of shapes) {
306
- const nodes = createSchemaPropertyList(projectSchema, shape.schema).filterBy(([name, property]) => !skipField(name, property, projectSchema, tooDeep)).getNodes();
306
+ const nodes = createSchemaPropertyList(projectSchema, shape).filterBy(([name, property]) => !skipField(name, property, projectSchema, tooDeep)).getNodes();
307
307
 
308
308
  for (const [name, property] of nodes) {
309
309
  Object.assign(result, getPropertyComparisonType(name, property, shape.name, fieldContext));
package/es/types/utils.js CHANGED
@@ -1,4 +1,4 @@
1
- import { isObject } from '@takeshape/util';
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 isObject(maybeSchema) && isString(maybeSchema.projectId) && isObject(maybeSchema.contentTypes) && (isUndefined(maybeSchema.schemaVersion) || maybeSchema.schemaVersion === '1' || maybeSchema.schemaVersion === '1.0.0');
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 (!isObject(maybeSchema) || !isString(maybeSchema.projectId) || !isString(maybeSchema.schemaVersion)) {
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 (!isObject(value)) {
97
+ if (!isRecord(value)) {
98
98
  return false;
99
99
  }
100
100
 
101
101
  const maybeSchema = value;
102
- return isObject(value) && isString(maybeSchema.projectId) && (isV1XSchema(maybeSchema) || isV3XSchema(maybeSchema));
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]) && isObject(maybeConfig[0][1]);
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' && isObject(propertySchema.items);
224
+ return propertySchema.type === 'array' && isRecord(propertySchema.items);
225
225
  }
226
226
  export function isObjectSchema(propertySchema) {
227
- return propertySchema.type === 'object' && isObject(propertySchema.properties);
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, isObject } from '@takeshape/util';
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 (isObject(obj)) {
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 (isObject(propValue)) {
83
+ if (isRecord(propValue)) {
84
84
  const transformedPropValue = next(propValue, propSchema, name);
85
85
 
86
- if (isObject(transformedPropValue)) {
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 (isObject(obj) && typeof obj._shapeId === 'string') {
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;
@@ -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.isObject)(maybeObjectSchema.properties);
62
+ return maybeObjectSchema.type === 'object' && (0, _util.isRecord)(maybeObjectSchema.properties);
63
63
  }
64
64
 
65
65
  function mergeShape(a, b) {
@@ -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.isObject)(maybeConfig[0][1]);
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.isObject)(schema.items);
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.isObject)(schema.properties);
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.isObject)(value)) {
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.isObject)(value['@input'])) {
58
+ if (options.replaceInput && (0, _util.isRecord)(value['@input'])) {
59
59
  return { ...value['@input'],
60
60
  '@mapping': value['@mapping']
61
61
  };
@@ -204,7 +204,7 @@ function getServiceInfo(projectSchema, shape) {
204
204
  const depShapes = getShapeDependencies(projectSchema, shape).map(name => projectSchema.shapes[name]);
205
205
  const shapesToCheck = [shape, ...depShapes];
206
206
  shapesToCheck.forEach(thisShape => {
207
- createSchemaPropertyList(projectSchema, thisShape.schema).forEach(([key, value]) => {
207
+ createSchemaPropertyList(projectSchema, thisShape).forEach(([key, value]) => {
208
208
  const resolver = value['@resolver'];
209
209
 
210
210
  if (!(0, _utils.isBasicResolver)(resolver)) {
package/lib/taxonomies.js CHANGED
@@ -27,7 +27,7 @@ function getFirstStringFieldV3(shape, projectSchema) {
27
27
  return null;
28
28
  }
29
29
 
30
- const schemaProperties = (0, _schemaUtil.createSchemaPropertyAccessor)(projectSchema, shape.schema);
30
+ const schemaProperties = (0, _schemaUtil.createSchemaPropertyAccessor)(projectSchema, shape);
31
31
  const {
32
32
  order
33
33
  } = forms.default;
@@ -171,7 +171,7 @@ function getConflictingProperties(projectSchema, shapes) {
171
171
  const allProps = {};
172
172
 
173
173
  for (const shape of Object.values(shapes)) {
174
- for (const [name, prop] of (0, _schemaUtil.createSchemaPropertyList)(projectSchema, shape.schema).getNodes()) {
174
+ for (const [name, prop] of (0, _schemaUtil.createSchemaPropertyList)(projectSchema, shape).getNodes()) {
175
175
  if (name in allProps && (allProps[name].type !== prop.type || !isEqualRelationship(allProps[name], prop))) {
176
176
  conflicts.add(name);
177
177
  }
@@ -337,7 +337,7 @@ function getFields(typeName, shapes, context) {
337
337
  };
338
338
 
339
339
  for (const shape of shapes) {
340
- const nodes = (0, _schemaUtil.createSchemaPropertyList)(projectSchema, shape.schema).filterBy(([name, property]) => !skipField(name, property, projectSchema, tooDeep)).getNodes();
340
+ const nodes = (0, _schemaUtil.createSchemaPropertyList)(projectSchema, shape).filterBy(([name, property]) => !skipField(name, property, projectSchema, tooDeep)).getNodes();
341
341
 
342
342
  for (const [name, property] of nodes) {
343
343
  Object.assign(result, getPropertyComparisonType(name, property, shape.name, fieldContext));
@@ -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.isObject)(maybeSchema) && (0, _isString.default)(maybeSchema.projectId) && (0, _util.isObject)(maybeSchema.contentTypes) && ((0, _isUndefined.default)(maybeSchema.schemaVersion) || maybeSchema.schemaVersion === '1' || maybeSchema.schemaVersion === '1.0.0');
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.isObject)(maybeSchema) || !(0, _isString.default)(maybeSchema.projectId) || !(0, _isString.default)(maybeSchema.schemaVersion)) {
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.isObject)(value)) {
196
+ if (!(0, _util.isRecord)(value)) {
197
197
  return false;
198
198
  }
199
199
 
200
200
  const maybeSchema = value;
201
- return (0, _util.isObject)(value) && (0, _isString.default)(maybeSchema.projectId) && (isV1XSchema(maybeSchema) || isV3XSchema(maybeSchema));
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.isObject)(maybeConfig[0][1]);
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.isObject)(propertySchema.items);
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.isObject)(propertySchema.properties);
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.isObject)(obj)) {
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.isObject)(propValue)) {
105
+ if ((0, _util.isRecord)(propValue)) {
106
106
  const transformedPropValue = next(propValue, propSchema, name);
107
107
 
108
- if ((0, _util.isObject)(transformedPropValue)) {
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.isObject)(obj) && typeof obj._shapeId === 'string') {
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) {
@@ -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,EAIlB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAwB,yBAAyB,EAAC,MAAM,mBAAmB,CAAC;AA+dnF,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,CAA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@@ -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.68.4",
3
+ "version": "8.70.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.68.4",
25
- "@takeshape/json-schema": "8.68.4",
26
- "@takeshape/util": "8.68.4",
24
+ "@takeshape/errors": "8.70.0",
25
+ "@takeshape/json-schema": "8.70.0",
26
+ "@takeshape/util": "8.70.0",
27
27
  "ajv": "^7.0.4",
28
28
  "ajv-formats": "^1.5.1",
29
29
  "blueimp-md5": "^2.10.0",