@plumier/core
Advanced tools
Comparing version 1.0.1-canary.0 to 1.0.1-canary.22
@@ -412,2 +412,4 @@ "use strict"; | ||
const result = []; | ||
if (!Array.isArray(raw)) | ||
throw new Error(`Action ${ctx.ctx.route.controller.name}.${ctx.ctx.route.action.name} expecting return value of type Array but got ${raw.constructor.name}`); | ||
for (const item of raw) { | ||
@@ -414,0 +416,0 @@ const val = await filterType(item, node.child, ctx); |
@@ -186,3 +186,3 @@ "use strict"; | ||
if (prop.type === Array && !prop.type[0]) | ||
throw new Error(types_1.errorMessage.GenericControllerMissingTypeInfo.format(`${entity.name}.${relation}`)); | ||
throw new Error(types_1.errorMessage.UnableToGetMemberDataType.format(entity.name, prop.name)); | ||
const type = Array.isArray(prop.type) ? "OneToMany" : "ManyToOne"; | ||
@@ -202,2 +202,4 @@ if (type === "OneToMany") { | ||
const parent = prop.type; | ||
if (!parent) | ||
throw new Error(types_1.errorMessage.UnableToGetMemberDataType.format(entity.name, prop.name)); | ||
const parentMeta = reflect_1.default(parent); | ||
@@ -204,0 +206,0 @@ let parentProperty; |
@@ -516,2 +516,3 @@ /// <reference types="node" /> | ||
const EntityRequireID = "Entity {0} used by generic controller doesn't have an ID property"; | ||
const UnableToGetMemberDataType = "Unable to get data type of member {0}.{1}. Make sure to provide type information, or manage if its has cross reference to other class"; | ||
const UnableToInstantiateModel = "Unable to instantiate {0}. Domain model should not throw error inside constructor"; | ||
@@ -518,0 +519,0 @@ const UnableToConvertValue = "Unable to convert \"{0}\" into {1}"; |
@@ -264,2 +264,3 @@ "use strict"; | ||
errorMessage.EntityRequireID = "Entity {0} used by generic controller doesn't have an ID property"; | ||
errorMessage.UnableToGetMemberDataType = "Unable to get data type of member {0}.{1}. Make sure to provide type information, or manage if its has cross reference to other class"; | ||
//PLUM2XXX internal app error | ||
@@ -266,0 +267,0 @@ errorMessage.UnableToInstantiateModel = `Unable to instantiate {0}. Domain model should not throw error inside constructor`; |
{ | ||
"name": "@plumier/core", | ||
"version": "1.0.1-canary.0+86c4311", | ||
"version": "1.0.1-canary.22+1ce9220", | ||
"description": "Delightful Node.js Rest Framework", | ||
@@ -23,4 +23,4 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@plumier/reflect": "1.0.1-canary.0+86c4311", | ||
"@plumier/validator": "1.0.1-canary.0+86c4311", | ||
"@plumier/reflect": "1.0.1-canary.22+1ce9220", | ||
"@plumier/validator": "1.0.1-canary.22+1ce9220", | ||
"@types/debug": "^4.1.5", | ||
@@ -30,3 +30,3 @@ "@types/glob": "^7.1.3", | ||
"debug": "^4.3.1", | ||
"glob": "^7.1.6", | ||
"glob": "^7.1.7", | ||
"path-to-regexp": "^6.2.0", | ||
@@ -51,3 +51,3 @@ "tslib": "^2.2.0" | ||
}, | ||
"gitHead": "86c43117b03b3474521573729b2516660605cef4" | ||
"gitHead": "1ce922097ba707499a67b537e8cef48681c2060f" | ||
} |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
208912
48
4726