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

rest-client-sdk

Package Overview
Dependencies
Maintainers
3
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rest-client-sdk - npm Package Compare versions

Comparing version 2.0.0-rc.11 to 2.0.0-rc.12

2

package.json
{
"name": "rest-client-sdk",
"version": "2.0.0-rc.11",
"version": "2.0.0-rc.12",
"description": "Rest Client SDK for API",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -38,4 +38,52 @@ const DEFAULT_CONFIG = {

}
isMappingValid() {
return !this._classMetadataList.some(classMetadata => {
// check that the relations exists
const errorList = Object.values(classMetadata.getAttributeList()).map(
attribute => {
const relation = classMetadata.getRelation(attribute.serializedKey);
if (!relation) {
// attribute can not be "invalid" (for now ?)
return false;
}
const relationMetadata = this.getClassMetadataByKey(
relation.targetMetadataKey
);
// no error if there is metadata linked
if (relationMetadata) {
return false;
}
return `"${classMetadata.key}.${
attribute.serializedKey
}" defined a relation to the metadata named "${
relation.targetMetadataKey
}" but this metadata is not knowned by the mapping`;
}
);
if (!classMetadata.getIdentifierAttribute()) {
errorList.push(
`"${classMetadata.key}" has no identifier attribute set`
);
}
const nbError = errorList.filter(error => {
if (error) {
// eslint-disable-next-line no-console
console.warn(error);
}
return error;
});
return nbError.length > 0;
});
}
}
export default Mapping;

@@ -34,2 +34,3 @@ import AbstractClient from '../client/AbstractClient';

this._attributeList = {};
this._identifierAttribute = null;

@@ -45,3 +46,7 @@ attributeList.forEach(attribute => {

if (!this._identifierAttribute) {
throw new TypeError('attributeList must contain a identifier attribute');
throw new TypeError(
`"${
this.key
}" has no identifier attribute set. You must set all your attributes in one time and send an attribute with "isIdentifier=true"`
);
}

@@ -48,0 +53,0 @@ }

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

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

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