Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@orbit/record-cache

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@orbit/record-cache - npm Package Compare versions

Comparing version 0.16.0-beta.5 to 0.16.0-beta.6

7

dist/commonjs/es2017/operation-processors/async-cache-integrity-processor.js

@@ -32,5 +32,4 @@ 'use strict';

case 'removeRecord':
let ops = await this.clearInverseRelationshipOps(operation.record);
await this.removeAllInverseRelationships(operation.record);
return ops;
return [];
case 'updateRecord':

@@ -60,2 +59,4 @@ await this.removeAllInverseRelationships(operation.record);

return [];
case 'removeRecord':
return await this.clearInverseRelationshipOps(operation.record);
default:

@@ -107,2 +108,2 @@ return [];

exports.default = AsyncCacheIntegrityProcessor;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9wZXJhdGlvbi1wcm9jZXNzb3JzL2FzeW5jLWNhY2hlLWludGVncml0eS1wcm9jZXNzb3IuanMiXSwibmFtZXMiOlsiQXN5bmNDYWNoZUludGVncml0eVByb2Nlc3NvciIsIkFzeW5jT3BlcmF0aW9uUHJvY2Vzc29yIiwiYWZ0ZXIiLCJvcGVyYXRpb24iLCJvcCIsInJlbW92ZUludmVyc2VSZWxhdGlvbnNoaXAiLCJyZWNvcmQiLCJyZWxhdGlvbnNoaXAiLCJhY2Nlc3NvciIsImdldFJlbGF0ZWRSZWNvcmRBc3luYyIsInJlbW92ZUludmVyc2VSZWxhdGlvbnNoaXBzIiwiZ2V0UmVsYXRlZFJlY29yZHNBc3luYyIsInJlbGF0ZWRSZWNvcmQiLCJvcHMiLCJjbGVhckludmVyc2VSZWxhdGlvbnNoaXBPcHMiLCJyZW1vdmVBbGxJbnZlcnNlUmVsYXRpb25zaGlwcyIsImZpbmFsbHkiLCJhZGRJbnZlcnNlUmVsYXRpb25zaGlwIiw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fVxuICAgIGFzeW5jIGNsZWFySW52ZXJzZVJlbGF0aW9uc2hpcE9wcyhyZWNvcmQpIHtcbiAgICAgICAgcmV0dXJuIGdldEludmVyc2VSZWxhdGlvbnNoaXBSZW1vdmFsT3BzKHRoaXMuYWNjZXNzb3Iuc2NoZW1hLCAoYXdhaXQgdGhpcy5hY2Nlc3Nvci5nZXRJbnZlcnNlUmVsYXRpb25zaGlwc0FzeW5jKHJlY29yZCkpKTtcbiAgICB9XG59Il19

@@ -7,2 +7,4 @@ 'use strict';

var _data = require('@orbit/data');
var _asyncOperationProcessor = require('../async-operation-processor');

@@ -57,2 +59,3 @@

this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
}

@@ -65,4 +68,5 @@ _relatedRecordRemoved(record, relationship, relatedRecord) {

this._validateRecordIdentity(record);
relatedRecords.forEach(record => {
this._validateRecordIdentity(record);
relatedRecords.forEach(relatedRecord => {
this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
});

@@ -74,2 +78,3 @@ }

this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
}

@@ -81,6 +86,25 @@ }

_validateRecordIdentity(record) {
this.accessor.schema.getModel(record.type);
this._getModelSchema(record.type);
}
_validateRelationship(record, relationship, relatedRecord) {
const modelSchema = this._getModelSchema(record.type);
const relationshipDef = modelSchema.relationships && modelSchema.relationships[relationship];
if (relationshipDef === undefined) {
throw new _data.RelationshipNotFound(relationship, record.type);
}
if (Array.isArray(relationshipDef.model)) {
if (!relationshipDef.model.includes(relatedRecord.type)) {
throw new _data.IncorrectRelatedRecordType(relatedRecord.type, relationship, record.type);
}
} else if (typeof relationshipDef.model === 'string') {
if (relationshipDef.model !== relatedRecord.type) {
throw new _data.IncorrectRelatedRecordType(relatedRecord.type, relationship, record.type);
}
}
}
_getModelSchema(type) {
return this.accessor.schema.getModel(type);
}
}
exports.default = AsyncSchemaValidationProcessor;
//# sourceMappingURL=data:application/json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Skge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbmNvcnJlY3RSZWxhdGVkUmVjb3JkVHlwZShyZWxhdGVkUmVjb3JkLnR5cGUsIHJlbGF0aW9uc2hpcCwgcmVjb3JkLnR5cGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiByZWxhdGlvbnNoaXBEZWYubW9kZWwgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICBpZiAocmVsYXRpb25zaGlwRGVmLm1vZGVsICE9PSByZWxhdGVkUmVjb3JkLnR5cGUpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5jb3JyZWN0UmVsYXRlZFJlY29yZFR5cGUocmVsYXRlZFJlY29yZC50eXBlLCByZWxhdGlvbnNoaXAsIHJlY29yZC50eXBlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICBfZ2V0TW9kZWxTY2hlbWEodHlwZSkge1xuICAgICAgICByZXR1cm4gdGhpcy5hY2Nlc3Nvci5zY2hlbWEuZ2V0TW9kZWwodHlwZSk7XG4gICAgfVxufSJdfQ==

@@ -32,5 +32,4 @@ 'use strict';

case 'removeRecord':
let ops = this.clearInverseRelationshipOps(operation.record);
this.removeAllInverseRelationships(operation.record);
return ops;
return [];
case 'updateRecord':

@@ -60,2 +59,4 @@ this.removeAllInverseRelationships(operation.record);

return [];
case 'removeRecord':
return this.clearInverseRelationshipOps(operation.record);
default:

@@ -107,2 +108,2 @@ return [];

exports.default = SyncCacheIntegrityProcessor;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9wZXJhdGlvbi1wcm9jZXNzb3JzL3N5bmMtY2FjaGUtaW50ZWdyaXR5LXByb2Nlc3Nvci5qcyJdLCJuYW1lcyI6WyJTeW5jQ2FjaGVJbnRlZ3JpdHlQcm9jZXNzb3IiLCJTeW5jT3BlcmF0aW9uUHJvY2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ICAgICAgICAgICAgICAgdGhpcy5hZGRJbnZlcnNlUmVsYXRpb25zaGlwcyhvcGVyYXRpb24ucmVjb3JkLCBvcGVyYXRpb24ucmVsYXRpb25zaGlwLCBvcGVyYXRpb24ucmVsYXRlZFJlY29yZHMpO1xuICAgICAgICAgICAgICAgIHJldHVybiBbXTtcbiAgICAgICAgICAgIGNhc2UgJ2FkZFRvUmVsYXRlZFJlY29yZHMnOlxuICAgICAgICAgICAgICAgIHRoaXMuYWRkSW52ZXJzZVJlbGF0aW9uc2hpcChvcGVyYXRpb24ucmVjb3JkLCBvcGVyYXRpb24ucmVsYXRpb25zaGlwLCBvcGVyYXRpb24ucmVsYXRlZFJlY29yZCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFtdO1xuICAgICAgICAgICAgY2FzZSAnYWRkUmVjb3JkJzpcbiAgICAgICAgICAgICAgICB0aGlzLmFkZEFsbEludmVyc2VSZWxhdGlvbnNoaXBzKG9wZXJhdGlvbi5yZWNvcmQpO1xuICAgICAgICAgICAgICAgIHJldHVybiBbXTtcbiAgICAgICAgICAgIGNhc2UgJ3VwZGF0ZVJlY29yZCc6XG4gICAgICAgICAgICAgICAgdGhpcy5hZGRBbGxJbnZlcnNlUmVsYXRpb25zaGlwcyhvcGVyYXRpb24ucmVjb3JkKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gW107XG4gICAgICAgICAgICBjYXNlICdyZW1vdmVSZWNvcmQnOlxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmNsZWFySW52ZXJzZVJlbGF0aW9uc2hpcE9wcyhvcGVyYXRpb24ucmVjb3JkKTtcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgcmV0dXJuIFtdO1xuICAgICAgICB9XG4gICAgfVxuICAgIGFkZEludmVyc2VSZWxhdGlvbnNoaXAocmVjb3JkLCByZWxhdGlvbnNoaXAsIHJlbGF0ZWRSZWNvcmQpIHtcbiAgICAgICAgbGV0IGludmVyc2VSZ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NvcmRJbkNhY2hlKTtcbiAgICAgICAgaWYgKGludmVyc2VSZWxhdGlvbnNoaXBzKSB7XG4gICAgICAgICAgICB0aGlzLmFjY2Vzc29yLnJlbW92ZUludmVyc2VSZWxhdGlvbnNoaXBzU3luYyhpbnZlcnNlUmVsYXRpb25zaGlwcyk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgY2xlYXJJbnZlcnNlUmVsYXRpb25zaGlwT3BzKHJlY29yZCkge1xuICAgICAgICByZXR1cm4gZ2V0SW52ZXJzZVJlbGF0aW9uc2hpcFJlbW92YWxPcHModGhpcy5hY2Nlc3Nvci5zY2hlbWEsIHRoaXMuYWNjZXNzb3IuZ2V0SW52ZXJzZVJlbGF0aW9uc2hpcHNTeW5jKHJlY29yZCkpO1xuICAgIH1cbn0iXX0=

@@ -7,2 +7,4 @@ 'use strict';

var _data = require('@orbit/data');
var _syncOperationProcessor = require('../sync-operation-processor');

@@ -57,2 +59,3 @@

this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
}

@@ -65,4 +68,5 @@ _relatedRecordRemoved(record, relationship, relatedRecord) {

this._validateRecordIdentity(record);
relatedRecords.forEach(record => {
this._validateRecordIdentity(record);
relatedRecords.forEach(relatedRecord => {
this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
});

@@ -74,2 +78,3 @@ }

this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
}

@@ -81,6 +86,25 @@ }

_validateRecordIdentity(record) {
this.accessor.schema.getModel(record.type);
this._getModelSchema(record.type);
}
_validateRelationship(record, relationship, relatedRecord) {
const modelSchema = this._getModelSchema(record.type);
const relationshipDef = modelSchema.relationships && modelSchema.relationships[relationship];
if (relationshipDef === undefined) {
throw new _data.RelationshipNotFound(relationship, record.type);
}
if (Array.isArray(relationshipDef.model)) {
if (!relationshipDef.model.includes(relatedRecord.type)) {
throw new _data.IncorrectRelatedRecordType(relatedRecord.type, relationship, record.type);
}
} else if (typeof relationshipDef.model === 'string') {
if (relationshipDef.model !== relatedRecord.type) {
throw new _data.IncorrectRelatedRecordType(relatedRecord.type, relationship, record.type);
}
}
}
_getModelSchema(type) {
return this.accessor.schema.getModel(type);
}
}
exports.default = SyncSchemaValidationProcessor;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9wZXJhdGlvbi1wcm9jZXNzb3JzL3N5bmMtc2NoZW1hLXZhbGlkYXRpb24tcHJvY2Vzc29yLmpzIl0sIm5hbWVzIjpbIlN5bmNTY2hlbWFWYWxpZGF0aW9uUHJvY2Vzc29yIiwiU3luY09wZXJhdGlvblByb2Nlc3NvciIsInZhbGlkYXRlIiwib3BlcmF0aW9uIiwib3AiLCJfcmVjb3JkQWRkZWQiLCJyZWNvcmQiLCJfcmVjb3JkUmVwbGFjZWQiLCJfcmVjb3JkUmVtb3ZlZCIsIl9rZXlSZXBsYWNlZCIsIl9hdHRyaWJ1dGVSZXBsYWNlZCIsIl9yZWxhdGVkUmVjb3JkQWRkZWQiLCJyZWxhdGlvbnNoaXAiLCJyZWxhdGVkUmVjb3JkIiwiX3JlbGF0ZWRSZWNvcmRSZW1vdmVkIiwiX3JlbGF0ZWRSZWNvcmRzUmVwbGFjZWQiLCJyZWxhdGVkUmVjb3JkcyIsIl9yZWxhdGVkUmVjb3JkUmVwbGFjZWQiLCJfdmFsaWRhdGVSZWNvcmQiLCJfdmFsaWRhdGVSZWNvcmRJZGVudGl0eSIsImZvckVhY2giLCJhY2Nlc3NvciIsInNjaGVtYSIsImdldE1vZGVsIiwidHlwZSJdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUE7O0FBQ0E7Ozs7QUFJZSxNQUFNQSw2QkFBTixTQUE0Q0MsOENBQTVDLENBQW1FO0FBQzlFQyxhQUFTQyxTQUFULEVBQW9CO0FBQ2hCLGdCQUFRQSxVQUFVQyxFQUFsQjtBQUNJLGlCQUFLLFdBQUw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F0ZWRSZWNvcmQpIHtcbiAgICAgICAgdGhpcy5fdmFsaWRhdGVSZWNvcmRJZGVudGl0eShyZWNvcmQpO1xuICAgICAgICB0aGlzLl92YWxpZGF0ZVJlY29yZElkZW50aXR5KHJlbGF0ZWRSZWNvcmQpO1xuICAgIH1cbiAgICBfcmVsYXRlZFJlY29yZHNSZXBsYWNlZChyZWNvcmQsIHJlbGF0aW9uc2hpcCwgcmVsYXRlZFJlY29yZHMpIHtcbiAgICAgICAgdGhpcy5fdmFsaWRhdGVSZWNvcmRJZGVudGl0eShyZWNvcmQpO1xuICAgICAgICByZWxhdGVkUmVjb3Jkcy5mb3JFYWNoKHJlY29yZCA9PiB7XG4gICAgICAgICAgICB0aGlzLl92YWxpZGF0ZVJlY29yZElkZW50aXR5KHJlY29yZCk7XG4gICAgICAgIH0pO1xuICAgIH1cbiAgICBfcmVsYXRlZFJlY29yZFJlcGxhY2VkKHJlY29yZCwgcmVsYXRpb25zaGlwLCByZWxhdGVkUmVjb3JkKSB7XG4gICAgICAgIHRoaXMuX3ZhbGlkYXRlUmVjb3JkSWRlbnRpdHkocmVjb3JkKTtcbiAgICAgICAgaWYgKHJlbGF0ZWRSZWNvcmQpIHtcbiAgICAgICAgICAgIHRoaXMuX3ZhbGlkYXRlUmVjb3JkSWRlbnRpdHkocmVsYXRlZFJlY29yZCk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgX3ZhbGlkYXRlUmVjb3JkKHJlY29yZCkge1xuICAgICAgICB0aGlzLl92YWxpZGF0ZVJlY29yZElkZW50aXR5KHJlY29yZCk7XG4gICAgfVxuICAgIF92YWxpZGF0ZVJlY29yZElkZW50aXR5KHJlY29yZCkge1xuICAgICAgICB0aGlzLmFjY2Vzc29yLnNjaGVtYS5nZXRNb2RlbChyZWNvcmQudHlwZSk7XG4gICAgfVxufSJdfQ==
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9wZXJhdGlvbi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YXkocmVsYXRpb25zaGlwRGVmLm1vZGVsKSkge1xuICAgICAgICAgICAgaWYgKCFyZWxhdGlvbnNoaXBEZWYubW9kZWwuaW5jbHVkZXMocmVsYXRlZFJlY29yZC50eXBlKSkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbmNvcnJlY3RSZWxhdGVkUmVjb3JkVHlwZShyZWxhdGVkUmVjb3JkLnR5cGUsIHJlbGF0aW9uc2hpcCwgcmVjb3JkLnR5cGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiByZWxhdGlvbnNoaXBEZWYubW9kZWwgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICBpZiAocmVsYXRpb25zaGlwRGVmLm1vZGVsICE9PSByZWxhdGVkUmVjb3JkLnR5cGUpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5jb3JyZWN0UmVsYXRlZFJlY29yZFR5cGUocmVsYXRlZFJlY29yZC50eXBlLCByZWxhdGlvbnNoaXAsIHJlY29yZC50eXBlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICBfZ2V0TW9kZWxTY2hlbWEodHlwZSkge1xuICAgICAgICByZXR1cm4gdGhpcy5hY2Nlc3Nvci5zY2hlbWEuZ2V0TW9kZWwodHlwZSk7XG4gICAgfVxufSJdfQ==

@@ -67,5 +67,4 @@ "use strict";

case 'removeRecord':
var ops = await this.clearInverseRelationshipOps(operation.record);
await this.removeAllInverseRelationships(operation.record);
return ops;
return [];
case 'updateRecord':

@@ -96,2 +95,4 @@ await this.removeAllInverseRelationships(operation.record);

return [];
case 'removeRecord':
return await this.clearInverseRelationshipOps(operation.record);
default:

@@ -153,2 +154,2 @@ return [];

exports.default = AsyncCacheIntegrityProcessor;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9wZXJhdGlvbi1wcm9jZXNzb3JzL2FzeW5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kUmVjb3Jkcyk7XG4gICAgICAgIGlmIChpbnZlcnNlUmVsYXRpb25zaGlwcykge1xuICAgICAgICAgICAgYXdhaXQgdGhpcy5hY2Nlc3Nvci5yZW1vdmVJbnZlcnNlUmVsYXRpb25zaGlwc0FzeW5jKGludmVyc2VSZWxhdGlvbnNoaXBzKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBhc3luYyByZW1vdmVBbGxJbnZlcnNlUmVsYXRpb25zaGlwcyhyZWNvcmQpIHtcbiAgICAgICAgY29uc3QgcmVjb3JkSW5DYWNoZSA9IGF3YWl0IHRoaXMuYWNjZXNzb3IuZ2V0UmVjb3JkQXN5bmMocmVjb3JkKTtcbiAgICAgICAgY29uc3QgaW52ZXJzZVJlbGF0aW9uc2hpcHMgPSBnZXRBbGxJbnZlcnNlUmVsYXRpb25zaGlwcyhyZWNvcmRJbkNhY2hlKTtcbiAgICAgICAgaWYgKGludmVyc2VSZWxhdGlvbnNoaXBzKSB7XG4gICAgICAgICAgICBhd2FpdCB0aGlzLmFjY2Vzc29yLnJlbW92ZUludmVyc2VSZWxhdGlvbnNoaXBzQXN5bmMoaW52ZXJzZVJlbGF0aW9uc2hpcHMpO1xuICAgICAgICB9XG4gICAgfVxuICAgIGFzeW5jIGNsZWFySW52ZXJzZVJlbGF0aW9uc2hpcE9wcyhyZWNvcmQpIHtcbiAgICAgICAgcmV0dXJuIGdldEludmVyc2VSZWxhdGlvbnNoaXBSZW1vdmFsT3BzKHRoaXMuYWNjZXNzb3Iuc2NoZW1hLCAoYXdhaXQgdGhpcy5hY2Nlc3Nvci5nZXRJbnZlcnNlUmVsYXRpb25zaGlwc0FzeW5jKHJlY29yZCkpKTtcbiAgICB9XG59Il19

@@ -7,2 +7,4 @@ "use strict";

var _data = require("@orbit/data");
var _asyncOperationProcessor = require("../async-operation-processor");

@@ -98,2 +100,3 @@

this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
};

@@ -110,4 +113,5 @@

this._validateRecordIdentity(record);
relatedRecords.forEach(function (record) {
_this2._validateRecordIdentity(record);
relatedRecords.forEach(function (relatedRecord) {
_this2._validateRecordIdentity(relatedRecord);
_this2._validateRelationship(record, relationship, relatedRecord);
});

@@ -120,2 +124,3 @@ };

this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
}

@@ -129,5 +134,26 @@ };

AsyncSchemaValidationProcessor.prototype._validateRecordIdentity = function _validateRecordIdentity(record) {
this.accessor.schema.getModel(record.type);
this._getModelSchema(record.type);
};
AsyncSchemaValidationProcessor.prototype._validateRelationship = function _validateRelationship(record, relationship, relatedRecord) {
var modelSchema = this._getModelSchema(record.type);
var relationshipDef = modelSchema.relationships && modelSchema.relationships[relationship];
if (relationshipDef === undefined) {
throw new _data.RelationshipNotFound(relationship, record.type);
}
if (Array.isArray(relationshipDef.model)) {
if (!relationshipDef.model.includes(relatedRecord.type)) {
throw new _data.IncorrectRelatedRecordType(relatedRecord.type, relationship, record.type);
}
} else if (typeof relationshipDef.model === 'string') {
if (relationshipDef.model !== relatedRecord.type) {
throw new _data.IncorrectRelatedRecordType(relatedRecord.type, relationship, record.type);
}
}
};
AsyncSchemaValidationProcessor.prototype._getModelSchema = function _getModelSchema(type) {
return this.accessor.schema.getModel(type);
};
return AsyncSchemaValidationProcessor;

@@ -137,2 +163,2 @@ }(_asyncOperationProcessor.AsyncOperationProcessor);

exports.default = AsyncSchemaValidationProcessor;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9wZXJhdGlvbi1wcm9jZXNzb3JzL2FzeW5jLXNjaGVtYS12YWxpZGF0aW9uLXByb2Nlc3Nvci5qcyJdLCJuYW1lcyI6WyJBc3luY1NjaGVtYVZhbGlkYXRpb25Qcm9jZXNzb3IiLCJBc3luY09wZXJhdGlvblByb2Nlc3NvciIsInZhbGlkYXRlIiwib3BlcmF0aW9uIiwiX3JlY29yZEFkZGVkIiwicmVjb3J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XBlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgcmVsYXRpb25zaGlwRGVmLm1vZGVsID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgaWYgKHJlbGF0aW9uc2hpcERlZi5tb2RlbCAhPT0gcmVsYXRlZFJlY29yZC50eXBlKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEluY29ycmVjdFJlbGF0ZWRSZWNvcmRUeXBlKHJlbGF0ZWRSZWNvcmQudHlwZSwgcmVsYXRpb25zaGlwLCByZWNvcmQudHlwZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG4gICAgX2dldE1vZGVsU2NoZW1hKHR5cGUpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuYWNjZXNzb3Iuc2NoZW1hLmdldE1vZGVsKHR5cGUpO1xuICAgIH1cbn0iXX0=

@@ -67,5 +67,4 @@ "use strict";

case 'removeRecord':
var ops = this.clearInverseRelationshipOps(operation.record);
this.removeAllInverseRelationships(operation.record);
return ops;
return [];
case 'updateRecord':

@@ -96,2 +95,4 @@ this.removeAllInverseRelationships(operation.record);

return [];
case 'removeRecord':
return this.clearInverseRelationshipOps(operation.record);
default:

@@ -153,2 +154,2 @@ return [];

exports.default = SyncCacheIntegrityProcessor;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9wZXJhdGlvbi1wcm9jZXNzb3JzL3N5bmMtY2FjaGUtaW50ZWdyaXR5LXByb2Nlc3Nvci5qcyJdLCJuYW1lcyI6WyJTeW5jQ2FjaGVJbnRlZ3JpdHlQcm9jZXNzb3IiLCJTeW5jT3BlcmF0aW9uUHJvY2Vzc29yIiwiYWZ0ZXIiLCJvcGVyYXRpb24iLCJvcHMiLCJmaW5hbGx5IiwiYWRkSW52ZXJzZVJlbGF0aW9uc2hpcCIsInJlY29yZCIsInJlbGF0aW9uc2hpcCIsInJlbG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lvbnNoaXBzKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICByZW1vdmVBbGxJbnZlcnNlUmVsYXRpb25zaGlwcyhyZWNvcmQpIHtcbiAgICAgICAgY29uc3QgcmVjb3JkSW5DYWNoZSA9IHRoaXMuYWNjZXNzb3IuZ2V0UmVjb3JkU3luYyhyZWNvcmQpO1xuICAgICAgICBjb25zdCBpbnZlcnNlUmVsYXRpb25zaGlwcyA9IGdldEFsbEludmVyc2VSZWxhdGlvbnNoaXBzKHJlY29yZEluQ2FjaGUpO1xuICAgICAgICBpZiAoaW52ZXJzZVJlbGF0aW9uc2hpcHMpIHtcbiAgICAgICAgICAgIHRoaXMuYWNjZXNzb3IucmVtb3ZlSW52ZXJzZVJlbGF0aW9uc2hpcHNTeW5jKGludmVyc2VSZWxhdGlvbnNoaXBzKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBjbGVhckludmVyc2VSZWxhdGlvbnNoaXBPcHMocmVjb3JkKSB7XG4gICAgICAgIHJldHVybiBnZXRJbnZlcnNlUmVsYXRpb25zaGlwUmVtb3ZhbE9wcyh0aGlzLmFjY2Vzc29yLnNjaGVtYSwgdGhpcy5hY2Nlc3Nvci5nZXRJbnZlcnNlUmVsYXRpb25zaGlwc1N5bmMocmVjb3JkKSk7XG4gICAgfVxufSJdfQ==

@@ -7,2 +7,4 @@ "use strict";

var _data = require("@orbit/data");
var _syncOperationProcessor = require("../sync-operation-processor");

@@ -98,2 +100,3 @@

this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
};

@@ -110,4 +113,5 @@

this._validateRecordIdentity(record);
relatedRecords.forEach(function (record) {
_this2._validateRecordIdentity(record);
relatedRecords.forEach(function (relatedRecord) {
_this2._validateRecordIdentity(relatedRecord);
_this2._validateRelationship(record, relationship, relatedRecord);
});

@@ -120,2 +124,3 @@ };

this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
}

@@ -129,5 +134,26 @@ };

SyncSchemaValidationProcessor.prototype._validateRecordIdentity = function _validateRecordIdentity(record) {
this.accessor.schema.getModel(record.type);
this._getModelSchema(record.type);
};
SyncSchemaValidationProcessor.prototype._validateRelationship = function _validateRelationship(record, relationship, relatedRecord) {
var modelSchema = this._getModelSchema(record.type);
var relationshipDef = modelSchema.relationships && modelSchema.relationships[relationship];
if (relationshipDef === undefined) {
throw new _data.RelationshipNotFound(relationship, record.type);
}
if (Array.isArray(relationshipDef.model)) {
if (!relationshipDef.model.includes(relatedRecord.type)) {
throw new _data.IncorrectRelatedRecordType(relatedRecord.type, relationship, record.type);
}
} else if (typeof relationshipDef.model === 'string') {
if (relationshipDef.model !== relatedRecord.type) {
throw new _data.IncorrectRelatedRecordType(relatedRecord.type, relationship, record.type);
}
}
};
SyncSchemaValidationProcessor.prototype._getModelSchema = function _getModelSchema(type) {
return this.accessor.schema.getModel(type);
};
return SyncSchemaValidationProcessor;

@@ -137,2 +163,2 @@ }(_syncOperationProcessor.SyncOperationProcessor);

exports.default = SyncSchemaValidationProcessor;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9wZXJhdGlvbi1wcm9jZXNzb3JzL3N5bmMtc2NoZW1hLXZhbGlkYXRpb24tcHJvY2Vzc29yLmpzIl0sIm5hbWVzIjpbIlN5bmNTY2hlbWFWYWxpZGF0aW9uUHJvY2Vzc29yIiwiU3luY09wZXJhdGlvblByb2Nlc3NvciIsInZhbGlkYXRlIiwib3BlcmF0aW9uIiwiX3JlY29yZEFkZGVkIiwicmVjb3JkIiwiX3JlY29yZFJlcGxhY2VkIiwiX3JlY29yZFJlbW92ZWQiLCJfa2V5UmVwbGFjZWQiLCJfYXR0cmlidXRlUmVwbGFjZWQiLCJfcmVsYXRlZFJlY29yZEFkZGVkIiwicmVsYXRpb25zaGlwIiwicmVsYXRlZFJlY29yZCIsIl9yZWxhdGVkUmVjb3JkUmVtb3ZlZCIsIl9yZWxhdGVkUmVjb3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UeXBlKHJlbGF0ZWRSZWNvcmQudHlwZSwgcmVsYXRpb25zaGlwLCByZWNvcmQudHlwZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG4gICAgX2dldE1vZGVsU2NoZW1hKHR5cGUpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuYWNjZXNzb3Iuc2NoZW1hLmdldE1vZGVsKHR5cGUpO1xuICAgIH1cbn0iXX0=

@@ -24,5 +24,4 @@ import { AsyncOperationProcessor } from '../async-operation-processor';

case 'removeRecord':
let ops = await this.clearInverseRelationshipOps(operation.record);
await this.removeAllInverseRelationships(operation.record);
return ops;
return [];
case 'updateRecord':

@@ -52,2 +51,4 @@ await this.removeAllInverseRelationships(operation.record);

return [];
case 'removeRecord':
return await this.clearInverseRelationshipOps(operation.record);
default:

@@ -54,0 +55,0 @@ return [];

@@ -0,1 +1,2 @@

import { RelationshipNotFound, IncorrectRelatedRecordType } from '@orbit/data';
import { AsyncOperationProcessor } from '../async-operation-processor';

@@ -49,2 +50,3 @@ /**

this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
}

@@ -57,4 +59,5 @@ _relatedRecordRemoved(record, relationship, relatedRecord) {

this._validateRecordIdentity(record);
relatedRecords.forEach(record => {
this._validateRecordIdentity(record);
relatedRecords.forEach(relatedRecord => {
this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
});

@@ -66,2 +69,3 @@ }

this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
}

@@ -73,4 +77,23 @@ }

_validateRecordIdentity(record) {
this.accessor.schema.getModel(record.type);
this._getModelSchema(record.type);
}
_validateRelationship(record, relationship, relatedRecord) {
const modelSchema = this._getModelSchema(record.type);
const relationshipDef = modelSchema.relationships && modelSchema.relationships[relationship];
if (relationshipDef === undefined) {
throw new RelationshipNotFound(relationship, record.type);
}
if (Array.isArray(relationshipDef.model)) {
if (!relationshipDef.model.includes(relatedRecord.type)) {
throw new IncorrectRelatedRecordType(relatedRecord.type, relationship, record.type);
}
} else if (typeof relationshipDef.model === 'string') {
if (relationshipDef.model !== relatedRecord.type) {
throw new IncorrectRelatedRecordType(relatedRecord.type, relationship, record.type);
}
}
}
_getModelSchema(type) {
return this.accessor.schema.getModel(type);
}
}

@@ -24,5 +24,4 @@ import { SyncOperationProcessor } from '../sync-operation-processor';

case 'removeRecord':
let ops = this.clearInverseRelationshipOps(operation.record);
this.removeAllInverseRelationships(operation.record);
return ops;
return [];
case 'updateRecord':

@@ -52,2 +51,4 @@ this.removeAllInverseRelationships(operation.record);

return [];
case 'removeRecord':
return this.clearInverseRelationshipOps(operation.record);
default:

@@ -54,0 +55,0 @@ return [];

@@ -0,1 +1,2 @@

import { RelationshipNotFound, IncorrectRelatedRecordType } from '@orbit/data';
import { SyncOperationProcessor } from '../sync-operation-processor';

@@ -49,2 +50,3 @@ /**

this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
}

@@ -57,4 +59,5 @@ _relatedRecordRemoved(record, relationship, relatedRecord) {

this._validateRecordIdentity(record);
relatedRecords.forEach(record => {
this._validateRecordIdentity(record);
relatedRecords.forEach(relatedRecord => {
this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
});

@@ -66,2 +69,3 @@ }

this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
}

@@ -73,4 +77,23 @@ }

_validateRecordIdentity(record) {
this.accessor.schema.getModel(record.type);
this._getModelSchema(record.type);
}
_validateRelationship(record, relationship, relatedRecord) {
const modelSchema = this._getModelSchema(record.type);
const relationshipDef = modelSchema.relationships && modelSchema.relationships[relationship];
if (relationshipDef === undefined) {
throw new RelationshipNotFound(relationship, record.type);
}
if (Array.isArray(relationshipDef.model)) {
if (!relationshipDef.model.includes(relatedRecord.type)) {
throw new IncorrectRelatedRecordType(relatedRecord.type, relationship, record.type);
}
} else if (typeof relationshipDef.model === 'string') {
if (relationshipDef.model !== relatedRecord.type) {
throw new IncorrectRelatedRecordType(relatedRecord.type, relationship, record.type);
}
}
}
_getModelSchema(type) {
return this.accessor.schema.getModel(type);
}
}

@@ -41,5 +41,4 @@ function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }

case 'removeRecord':
var ops = await this.clearInverseRelationshipOps(operation.record);
await this.removeAllInverseRelationships(operation.record);
return ops;
return [];
case 'updateRecord':

@@ -70,2 +69,4 @@ await this.removeAllInverseRelationships(operation.record);

return [];
case 'removeRecord':
return await this.clearInverseRelationshipOps(operation.record);
default:

@@ -127,2 +128,2 @@ return [];

export default AsyncCacheIntegrityProcessor;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9wZXJhdGlvbi1wcm9jZXNzb3JzL2FzeW5jLWNhY2hlLWludGVncml0eS1wcm9jZXNzb3IuanMiXSwibmFtZXMiOlsiQXN5bmNPcGVyYXRpb25Qcm9jZXNzb3IiLCJnZXRJbnZlcnNlUmVsYXRpb25zaGlwIiwiZ2V0SW52ZXJzZVJlbGF0aW9uc2hpcHMiLCJnZXRBbGxJbnZlcnNlUmVsYXRpb25zaGlwcyIsImdldEludmVyc2VSZWxhdGlvbnNoaXBSZW1vdmFsT3BzIiwiQXN5bmNDYWNoZUludGVncml0eVByb2Nlc3NvciIsImFmdGVyIiwib3BlcmF0aW9uIiwib3AiLCJyZW1vdmVJbnZlcnNlUmVsYXRpb25zaGlwIiwicmVjb3JkIiwicmVsYXRpb25zaGlwIiwiYWNjZXNzb3IiLCJnZXRSZWxhdGVkUmVjb3JkQXN5bmMiLCJyZW1vdmVJbnZlcnNlUmVsYXRpb25zaGlwcyIsImdldFJlbGF0ZWRSZWNvcmRzQXN5bmMiLCJyZWxhd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lICdyZW1vdmVGcm9tUmVsYXRlZFJlY29yZHMnOlxuICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMucmVtb3ZlSW52ZXJzZVJlbGF0aW9uc2hpcChvcGVyYXRpb24ucmVjb3JkLCBvcGVyYXRpb24ucmVsYXRpb25zaGlwLCBvcGVyYXRpb24ucmVsYXRlZFJlY29yZCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFtdO1xuICAgICAgICAgICAgY2FzZSAncmVtb3ZlUmVjb3JkJzpcbiAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLnJlbW92ZUFsbEludmVyc2VSZWxhdGlvbnNoaXBzKG9wZXJhdGlvbi5yZWNvcmQpO1xuICAgICAgICAgICAgICAgIHJldHVybiBbXTtcbiAgICAgICAgICAgIGNhc2UgJ3VwZGF0ZVJlY29yZCc6XG4gICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5yZW1vdmVBbGxJbnZlcnNlUmVsYXRpb25zaGlwcyhvcGVyYXRpb24ucmVjb3JkKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gW107XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIHJldHVybiBbXTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBhc3luYyBmaW5hbGx5KG9wZXJhdGlvbikge1xuICAgICAgICBzd2l0Y2ggKG9wZXJhdGlvbi5vcCkge1xuICAgICAgICAgICAgY2FzZSAncmVwbGFjZVJlbGF0ZWRSZWNvcmQnOlxuICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMuYWRkSW52ZXJzZVJlbGF0aW9uc2hpcChvcGVyYXRpb24ucmVjb3JkLCBvcGVyYXRpb24ucmVsYXRpb25zaGlwLCBvcGVyYXRpb24ucmVsYXRlZFJlY29yZCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFtdO1xuICAgICAgICAgICAgY2FzZSAncmVwbGFjZVJlbGF0ZWRSZWNvcmRzJzpcbiAgICAgICAgICAgICAgICBhd2FpdC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y5hY2Nlc3Nvci5nZXRSZWNvcmRBc3luYyhyZWNvcmQpO1xuICAgICAgICBjb25zdCBpbnZlcnNlUmVsYXRpb25zaGlwcyA9IGdldEFsbEludmVyc2VSZWxhdGlvbnNoaXBzKHJlY29yZEluQ2FjaGUpO1xuICAgICAgICBpZiAoaW52ZXJzZVJlbGF0aW9uc2hpcHMpIHtcbiAgICAgICAgICAgIGF3YWl0IHRoaXMuYWNjZXNzb3IucmVtb3ZlSW52ZXJzZVJlbGF0aW9uc2hpcHNBc3luYyhpbnZlcnNlUmVsYXRpb25zaGlwcyk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgYXN5bmMgY2xlYXJJbnZlcnNlUmVsYXRpb25zaGlwT3BzKHJlY29yZCkge1xuICAgICAgICByZXR1cm4gZ2V0SW52ZXJzZVJlbGF0aW9uc2hpcFJlbW92YWxPcHModGhpcy5hY2Nlc3Nvci5zY2hlbWEsIChhd2FpdCB0aGlzLmFjY2Vzc29yLmdldEludmVyc2VSZWxhdGlvbnNoaXBzQXN5bmMocmVjb3JkKSkpO1xuICAgIH1cbn0iXX0=

@@ -9,2 +9,3 @@ function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }

import { RelationshipNotFound, IncorrectRelatedRecordType } from '@orbit/data';
import { AsyncOperationProcessor } from '../async-operation-processor';

@@ -73,2 +74,3 @@ /**

this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
};

@@ -85,4 +87,5 @@

this._validateRecordIdentity(record);
relatedRecords.forEach(function (record) {
_this2._validateRecordIdentity(record);
relatedRecords.forEach(function (relatedRecord) {
_this2._validateRecordIdentity(relatedRecord);
_this2._validateRelationship(record, relationship, relatedRecord);
});

@@ -95,2 +98,3 @@ };

this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
}

@@ -104,5 +108,26 @@ };

AsyncSchemaValidationProcessor.prototype._validateRecordIdentity = function _validateRecordIdentity(record) {
this.accessor.schema.getModel(record.type);
this._getModelSchema(record.type);
};
AsyncSchemaValidationProcessor.prototype._validateRelationship = function _validateRelationship(record, relationship, relatedRecord) {
var modelSchema = this._getModelSchema(record.type);
var relationshipDef = modelSchema.relationships && modelSchema.relationships[relationship];
if (relationshipDef === undefined) {
throw new RelationshipNotFound(relationship, record.type);
}
if (Array.isArray(relationshipDef.model)) {
if (!relationshipDef.model.includes(relatedRecord.type)) {
throw new IncorrectRelatedRecordType(relatedRecord.type, relationship, record.type);
}
} else if (typeof relationshipDef.model === 'string') {
if (relationshipDef.model !== relatedRecord.type) {
throw new IncorrectRelatedRecordType(relatedRecord.type, relationship, record.type);
}
}
};
AsyncSchemaValidationProcessor.prototype._getModelSchema = function _getModelSchema(type) {
return this.accessor.schema.getModel(type);
};
return AsyncSchemaValidationProcessor;

@@ -112,2 +137,2 @@ }(AsyncOperationProcessor);

export default AsyncSchemaValidationProcessor;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9wZXJhdGlvbi1wcm9jZXNzb3JzL2FzeW5jLXNjaGVtYS12YWxpZGF0aW9uLXByb2Nlc3Nvci5qcyJdLCJuYW1lcyI6WyJBc3luY09wZXJhdGlvblByb2Nlc3NvciIsIkFzeW5jU2NoZW1hVmFsaWRhdGlvblByb2Nlc3NvciIsInZhbGlkYXRlIiwib3BlcmF0aW9uIiwib3AiLCJfcmVjb3JkQWRkZWQiLCJyZWNvcmQiLCJfcmVjb3JkUmVwbGFjZWQiLCJfcmVjb3JkUmVtb3ZlZCIsIl9rZXlSZXBsYWNlZCIsIl9hdHRyaWJ1dGVSZXBsYWNlZCIsIl9yZWxhdGVkUmVjb3JkQWRkZWQiLCJyZWxhdGlvbnNoaXAiLCJyZWxhdGVkUmVjb3JkIiwiX3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ICBfZ2V0TW9kZWxTY2hlbWEodHlwZSkge1xuICAgICAgICByZXR1cm4gdGhpcy5hY2Nlc3Nvci5zY2hlbWEuZ2V0TW9kZWwodHlwZSk7XG4gICAgfVxufSJdfQ==

@@ -41,5 +41,4 @@ function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }

case 'removeRecord':
var ops = this.clearInverseRelationshipOps(operation.record);
this.removeAllInverseRelationships(operation.record);
return ops;
return [];
case 'updateRecord':

@@ -70,2 +69,4 @@ this.removeAllInverseRelationships(operation.record);

return [];
case 'removeRecord':
return this.clearInverseRelationshipOps(operation.record);
default:

@@ -127,2 +128,2 @@ return [];

export default SyncCacheIntegrityProcessor;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9wZXJhdGlvbi1wcm9jZXNzb3JzL3N5bmMtY2FjaGUtaW50ZWdyaXR5LXByb2Nlc3Nvci5qcyJdLCJuYW1lcyI6WyJTeW5jT3BlcmF0aW9uUHJvY2Vzc29yIiwiZ2V0SW52ZXJzZVJlbGF0aW9uc2hpcCIsImdldEludmVyc2VSZWxhdGlvbnNoaXBzIiwiZ2V0QWxsSW52ZXJzZVJlbGF0aW9uc2hpcHMiLCJnZXRJbnZlcnNlUmVsYXRpb25zaGlwUmVtb3ZhbE9wcyIsIlN5bmNDYWNoZUludGVncml0eVByb2Nlc3NvciIsImFmdGVyIiwib3BlcmF0aW9uIiwib3AiLCJyZW1vdmVJbnZlcnNlUmVsYXRpb25zaGlwIiwicmVjb3JkIiwicmVsYXRpb25zaGlwIiwiYWNjZXNzb3IiLCJnZXRSZWxhdGVkUmVjb3JkU3luYyIsInJlbW92ZUludmVyc2VSZWxhdGlvbnNoaXBzIiwiZ2V0UmVsYXRlZFJlY29y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F0ZWRSZWNvcmQpO1xuICAgICAgICAgICAgICAgIHJldHVybiBbXTtcbiAgICAgICAgICAgIGNhc2UgJ3JlcGxhY2VSZWxhdGVkUmVjb3Jkcyc6XG4gICAgICAgICAgICAgICAgdGhpcy5hZGRJbnZlcnNlUmVsYXRpb25zaGlwcyhvcGVyYXRpb24ucmVjb3JkLCBvcGVyYXRpb24ucmVsYXRpb25zaGlwLCBvcGVyYXRpb24ucmVsYXRlZFJlY29yZHMpO1xuICAgICAgICAgICAgICAgIHJldHVybiBbXTtcbiAgICAgICAgICAgIGNhc2UgJ2FkZFRvUmVsYXRlZFJlY29yZHMnOlxuICAgICAgICAgICAgICAgIHRoaXMuYWRkSW52ZXJzZVJlbGF0aW9uc2hpcChvcGVyYXRpb24ucmVjb3JkLCBvcGVyYXRpb24ucmVsYXRpb25zaGlwLCBvcGVyYXRpb24ucmVsYXRlZFJlY29yZCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFtdO1xuICAgICAgICAgICAgY2FzZSAnYWRkUmVjb3JkJzpcbiAgICAgICAgICAgICAgICB0aGlzLmFkZEFsbEludmVyc2VSZWxhdGlvbnNoaXBzKG9wZXJhdGlvbi5yZWNvcmQpO1xuICAgICAgICAgICAgICAgIHJldHVybiBbXTtcbiAgICAgICAgICAgIGNhc2UgJ3VwZGF0ZVJlY29yZCc6XG4gICAgICAgICAgICAgICAgdGhpcy5hZGRBbGxJbnZlcnNlUmVsYXRpb25zaGlwcyhvcGVyYXRpb24ucmVjb3JkKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gW107XG4gICAgICAgICAgICBjYXNlICdyZW1vdmVSZWNvcmQnOlxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmNsZWFySW52ZXJzZVJlbGF0aW9uc2hpcE9wcyhvcGVyYXRpb24ucmVjb3JkKTtcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgcmV0dXJuIFtdO1xuICAgICAgICB9XG4gICAgfVxuICA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29yZFN5bmMocmVjb3JkKTtcbiAgICAgICAgY29uc3QgaW52ZXJzZVJlbGF0aW9uc2hpcHMgPSBnZXRBbGxJbnZlcnNlUmVsYXRpb25zaGlwcyhyZWNvcmRJbkNhY2hlKTtcbiAgICAgICAgaWYgKGludmVyc2VSZWxhdGlvbnNoaXBzKSB7XG4gICAgICAgICAgICB0aGlzLmFjY2Vzc29yLnJlbW92ZUludmVyc2VSZWxhdGlvbnNoaXBzU3luYyhpbnZlcnNlUmVsYXRpb25zaGlwcyk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgY2xlYXJJbnZlcnNlUmVsYXRpb25zaGlwT3BzKHJlY29yZCkge1xuICAgICAgICByZXR1cm4gZ2V0SW52ZXJzZVJlbGF0aW9uc2hpcFJlbW92YWxPcHModGhpcy5hY2Nlc3Nvci5zY2hlbWEsIHRoaXMuYWNjZXNzb3IuZ2V0SW52ZXJzZVJlbGF0aW9uc2hpcHNTeW5jKHJlY29yZCkpO1xuICAgIH1cbn0iXX0=

@@ -9,2 +9,3 @@ function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }

import { RelationshipNotFound, IncorrectRelatedRecordType } from '@orbit/data';
import { SyncOperationProcessor } from '../sync-operation-processor';

@@ -73,2 +74,3 @@ /**

this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
};

@@ -85,4 +87,5 @@

this._validateRecordIdentity(record);
relatedRecords.forEach(function (record) {
_this2._validateRecordIdentity(record);
relatedRecords.forEach(function (relatedRecord) {
_this2._validateRecordIdentity(relatedRecord);
_this2._validateRelationship(record, relationship, relatedRecord);
});

@@ -95,2 +98,3 @@ };

this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
}

@@ -104,5 +108,26 @@ };

SyncSchemaValidationProcessor.prototype._validateRecordIdentity = function _validateRecordIdentity(record) {
this.accessor.schema.getModel(record.type);
this._getModelSchema(record.type);
};
SyncSchemaValidationProcessor.prototype._validateRelationship = function _validateRelationship(record, relationship, relatedRecord) {
var modelSchema = this._getModelSchema(record.type);
var relationshipDef = modelSchema.relationships && modelSchema.relationships[relationship];
if (relationshipDef === undefined) {
throw new RelationshipNotFound(relationship, record.type);
}
if (Array.isArray(relationshipDef.model)) {
if (!relationshipDef.model.includes(relatedRecord.type)) {
throw new IncorrectRelatedRecordType(relatedRecord.type, relationship, record.type);
}
} else if (typeof relationshipDef.model === 'string') {
if (relationshipDef.model !== relatedRecord.type) {
throw new IncorrectRelatedRecordType(relatedRecord.type, relationship, record.type);
}
}
};
SyncSchemaValidationProcessor.prototype._getModelSchema = function _getModelSchema(type) {
return this.accessor.schema.getModel(type);
};
return SyncSchemaValidationProcessor;

@@ -112,2 +137,2 @@ }(SyncOperationProcessor);

export default SyncSchemaValidationProcessor;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9wZXJhdGlvbi1wcm9jZXNzb3JzL3N5bmMtc2NoZW1hLXZhbGlkYXRpb24tcHJvY2Vzc29yLmpzIl0sIm5hbWVzIjpbIlN5bmNPcGVyYXRpb25Qcm9jZXNzb3IiLCJTeW5jU2NoZW1hVmFsaWRhdGlvblByb2Nlc3NvciIsInZhbGlkYXRlIiwib3BlcmF0aW9uIiwib3AiLCJfcmVjb3JkQWRkZWQiLCJyZWNvcmQiLCJfcmVjb3JkUmVwbGFjZWQiLCJfcmVjb3JkUmVtb3ZlZCIsIl9rZXlSZXBsYWNlZCIsIl9hdHRyaWJ1dGVSZXBsYWNlZCIsIl9yZWxhdGVkUmVjb3JkQWRkZWQiLCJyZWxhdGlvbnNoaXAiLCJyZWxhdGVkUmVjb3JkIiwiX3JlbGF0ZWRSZWNvcmRSZW1vdmVkIiwiX3JlbGF0ZWRSZWNvcmRzUm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LnNjaGVtYS5nZXRNb2RlbCh0eXBlKTtcbiAgICB9XG59Il19

@@ -20,2 +20,4 @@ import { Record, RecordIdentity, RecordOperation } from '@orbit/data';

protected _validateRecordIdentity(record: RecordIdentity): void;
protected _validateRelationship(record: Record, relationship: string, relatedRecord: RecordIdentity): void;
private _getModelSchema;
}

@@ -20,2 +20,4 @@ import { Record, RecordIdentity, RecordOperation } from '@orbit/data';

protected _validateRecordIdentity(record: RecordIdentity): void;
protected _validateRelationship(record: Record, relationship: string, relatedRecord: RecordIdentity): void;
private _getModelSchema;
}
{
"name": "@orbit/record-cache",
"version": "0.16.0-beta.5",
"version": "0.16.0-beta.6",
"description": "Orbit base classes used to access and maintain a set of records.",

@@ -17,3 +17,3 @@ "contributors": [

"main": "dist/commonjs/es5/index.js",
"module": "dist/modules/es5/index.js",
"module": "dist/modules/es2017/index.js",
"types": "dist/types/index.d.ts",

@@ -23,16 +23,16 @@ "scripts": {

"build:tests": "rm -rf tests && BROCCOLI_ENV=tests broccoli build tests",
"prepare": "npm run build",
"release": "npm publish",
"clean": "git clean -x -f",
"prepare": "yarn run build",
"prepublishOnly": "yarn run clean",
"test": "testem ci"
},
"dependencies": {
"@orbit/core": "^0.16.0-beta.1",
"@orbit/data": "^0.16.0-beta.1",
"@orbit/utils": "^0.16.0-beta.1"
"@orbit/core": "^0.16.0-beta.6",
"@orbit/data": "^0.16.0-beta.6",
"@orbit/utils": "^0.16.0-beta.6"
},
"devDependencies": {
"@glimmer/build": "^0.9.0",
"merge": ">=1.2.1",
"randomatic": ">=3.0.0"
}
"@glimmer/build": "^0.10.1"
},
"gitHead": "6a6f597523408af8fb70be505c843585bbf3a798"
}

@@ -50,5 +50,4 @@ import {

case 'removeRecord':
let ops = await this.clearInverseRelationshipOps(operation.record);
await this.removeAllInverseRelationships(operation.record);
return ops;
return [];

@@ -86,2 +85,5 @@ case 'updateRecord':

case 'removeRecord':
return await this.clearInverseRelationshipOps(operation.record);
default:

@@ -88,0 +90,0 @@ return [];

@@ -5,2 +5,4 @@ import {

RecordOperation,
RelationshipNotFound,
IncorrectRelatedRecordType
} from '@orbit/data';

@@ -71,2 +73,3 @@ import { AsyncOperationProcessor } from '../async-operation-processor';

this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
}

@@ -82,4 +85,5 @@

relatedRecords.forEach(record => {
this._validateRecordIdentity(record);
relatedRecords.forEach(relatedRecord => {
this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
});

@@ -93,5 +97,7 @@ }

this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
}
}
protected _validateRecord(record: Record) {

@@ -102,4 +108,25 @@ this._validateRecordIdentity(record);

protected _validateRecordIdentity(record: RecordIdentity) {
this.accessor.schema.getModel(record.type);
this._getModelSchema(record.type);
}
protected _validateRelationship(record: Record, relationship: string, relatedRecord: RecordIdentity) {
const modelSchema = this._getModelSchema(record.type);
const relationshipDef = modelSchema.relationships && modelSchema.relationships[relationship];
if (relationshipDef === undefined) {
throw new RelationshipNotFound(relationship, record.type);
}
if (Array.isArray(relationshipDef.model)) {
if (!relationshipDef.model.includes(relatedRecord.type)) {
throw new IncorrectRelatedRecordType(relatedRecord.type, relationship, record.type);
}
} else if (typeof relationshipDef.model === 'string') {
if (relationshipDef.model !== relatedRecord.type) {
throw new IncorrectRelatedRecordType(relatedRecord.type, relationship, record.type);
}
}
}
private _getModelSchema(type: string) {
return this.accessor.schema.getModel(type);
}
}

@@ -50,5 +50,4 @@ import {

case 'removeRecord':
let ops = this.clearInverseRelationshipOps(operation.record);
this.removeAllInverseRelationships(operation.record);
return ops;
return [];

@@ -86,2 +85,5 @@ case 'updateRecord':

case 'removeRecord':
return this.clearInverseRelationshipOps(operation.record);
default:

@@ -88,0 +90,0 @@ return [];

@@ -5,2 +5,4 @@ import {

RecordOperation,
RelationshipNotFound,
IncorrectRelatedRecordType
} from '@orbit/data';

@@ -71,2 +73,3 @@ import { SyncOperationProcessor } from '../sync-operation-processor';

this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
}

@@ -82,4 +85,5 @@

relatedRecords.forEach(record => {
this._validateRecordIdentity(record);
relatedRecords.forEach(relatedRecord => {
this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
});

@@ -93,2 +97,3 @@ }

this._validateRecordIdentity(relatedRecord);
this._validateRelationship(record, relationship, relatedRecord);
}

@@ -102,4 +107,26 @@ }

protected _validateRecordIdentity(record: RecordIdentity) {
this.accessor.schema.getModel(record.type);
this._getModelSchema(record.type);
}
protected _validateRelationship(record: Record, relationship: string, relatedRecord: RecordIdentity) {
const modelSchema = this._getModelSchema(record.type);
const relationshipDef = modelSchema.relationships && modelSchema.relationships[relationship];
if (relationshipDef === undefined) {
throw new RelationshipNotFound(relationship, record.type);
}
if (Array.isArray(relationshipDef.model)) {
if (!relationshipDef.model.includes(relatedRecord.type)) {
throw new IncorrectRelatedRecordType(relatedRecord.type, relationship, record.type);
}
} else if (typeof relationshipDef.model === 'string') {
if (relationshipDef.model !== relatedRecord.type) {
throw new IncorrectRelatedRecordType(relatedRecord.type, relationship, record.type);
}
}
}
private _getModelSchema(type: string) {
return this.accessor.schema.getModel(type);
}
}

@@ -99,2 +99,2 @@ import { isArray } from '@orbit/utils';

return ops;
}
}

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc