@takeshape/schema 8.61.0 → 8.62.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.
@@ -4,12 +4,12 @@ import get from 'lodash/get';
4
4
  function migrateToV3_13_0(projectSchema) {
5
5
  visit(projectSchema, ['@relationship'], (relationship, path) => {
6
6
  const parent = get(projectSchema, path.slice(0, -1));
7
- parent['@backReference'] = {
7
+ parent['@backreference'] = {
8
8
  enabled: true
9
9
  };
10
10
 
11
11
  if (relationship.relatedName) {
12
- parent['@backReference'].name = relationship.relatedName;
12
+ parent['@backreference'].name = relationship.relatedName;
13
13
  delete relationship.relatedName;
14
14
  }
15
15
  });
package/es/schema-util.js CHANGED
@@ -44,7 +44,7 @@ export const objectSchemaKeys = [...commonSchemaKeys, 'properties', 'required'];
44
44
  export const arraySchemaKeys = [...commonSchemaKeys, 'items', 'additionalItems', 'maxItems', 'minItems', 'uniqueItems'];
45
45
  export const multipleRelationshipSchemaKeys = [...schemaMetadataKeys, 'maxItems', 'minItems']; // All properties except properties, items, additionalItems
46
46
 
47
- export const nonStructuralSchemaKeys = [...scalarSchemaKeys, '@relationship', '@backReference', 'required', 'maxItems', 'minItems', 'uniqueItems'];
47
+ export const nonStructuralSchemaKeys = [...scalarSchemaKeys, '@relationship', '@backreference', 'required', 'maxItems', 'minItems', 'uniqueItems'];
48
48
  const commonProperties = {
49
49
  _id: {
50
50
  title: 'Id',
@@ -426,22 +426,22 @@ export function findExistingRelationships(projectSchema, shapes) {
426
426
 
427
427
  const findRelationships = (schema, path) => {
428
428
  if (schema['@relationship']) {
429
- var _schema$BackReferenc;
429
+ var _schema$Backreferenc;
430
430
 
431
431
  const {
432
432
  shapeIds: relatedShapeIds
433
433
  } = schema['@relationship'];
434
- const relatedName = (_schema$BackReferenc = schema['@backReference']) === null || _schema$BackReferenc === void 0 ? void 0 : _schema$BackReferenc.name;
434
+ const relatedName = (_schema$Backreferenc = schema['@backreference']) === null || _schema$Backreferenc === void 0 ? void 0 : _schema$Backreferenc.name;
435
435
 
436
436
  for (const shapeId of relatedShapeIds) {
437
437
  if (shapeIds.has(shapeId)) {
438
- var _schema$BackReferenc2;
438
+ var _schema$Backreferenc2;
439
439
 
440
440
  addRelationship(relationships, shapeId, {
441
441
  relatedName,
442
442
  path: path.slice(1),
443
443
  shapeId: path[0],
444
- hasBackreference: Boolean((_schema$BackReferenc2 = schema['@backReference']) === null || _schema$BackReferenc2 === void 0 ? void 0 : _schema$BackReferenc2.enabled)
444
+ hasBackreference: Boolean((_schema$Backreferenc2 = schema['@backreference']) === null || _schema$Backreferenc2 === void 0 ? void 0 : _schema$Backreferenc2.enabled)
445
445
  });
446
446
  }
447
447
  }
@@ -62,7 +62,7 @@
62
62
  "required": ["shapeIds"],
63
63
  "additionalProperties": false
64
64
  },
65
- "backReference": {
65
+ "backreference": {
66
66
  "title": "Back Reference",
67
67
  "description": "A configuration object for a reverse reference in a relationship.",
68
68
  "type": "object",
@@ -1459,8 +1459,8 @@
1459
1459
  "@relationship": {
1460
1460
  "$ref": "#/definitions/relationship"
1461
1461
  },
1462
- "@backReference": {
1463
- "$ref": "#/definitions/backReference"
1462
+ "@backreference": {
1463
+ "$ref": "#/definitions/backreference"
1464
1464
  },
1465
1465
  "@syncLocaleStructure": {
1466
1466
  "type": "boolean"