Comparing version 1.0.9 to 1.0.10
@@ -17,2 +17,6 @@ "use strict"; | ||
var _EntityTarget = require("../EntityTarget"); | ||
var _EntityTarget2 = _interopRequireDefault(_EntityTarget); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -42,6 +46,7 @@ | ||
entityHandlerClass = _constructor.entityHandlerClass, | ||
entityTargetClass = _constructor.entityTargetClass, | ||
entity = new entityClass(this._resource, attributes), | ||
handler = new entityHandlerClass(entity); | ||
return new Proxy({}, handler); | ||
return new Proxy(new entityTargetClass(entityClass.name), handler); | ||
} | ||
@@ -98,2 +103,3 @@ }, { | ||
EntityFactory.entityHandlerClass = _EntityProxyHandler2.default; | ||
EntityFactory.entityTargetClass = _EntityTarget2.default; | ||
exports.default = EntityFactory; |
{ | ||
"name": "amocrm-js", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "JS Library for AmoCRM", | ||
@@ -5,0 +5,0 @@ "main": "dist/AmoCRM.js", |
import ResourceFactory from "./ResourceFactory"; | ||
import EntityHandler from "../EntityProxyHandler"; | ||
import EntityTarget from "../EntityTarget"; | ||
class EntityFactory extends ResourceFactory { | ||
static entityHandlerClass = EntityHandler; | ||
static entityTargetClass = EntityTarget; | ||
create( attributes={}) { | ||
const { entityClass, entityHandlerClass } = this.constructor, | ||
const { entityClass, entityHandlerClass, entityTargetClass } = this.constructor, | ||
entity = new entityClass( this._resource, attributes ), | ||
handler = new entityHandlerClass( entity ); | ||
return new Proxy({}, handler ); | ||
return new Proxy( new entityTargetClass( entityClass.name ), handler ); | ||
} | ||
@@ -13,0 +15,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
258567
118
3689