@worldsibu/convector-core-model
Advanced tools
Comparing version 1.2.1-0-alpha.0284ea21 to 1.2.1-0-alpha.0a7ddf29
@@ -11,3 +11,6 @@ import * as yup from 'yup'; | ||
export declare abstract class ConvectorModel<T extends ConvectorModel<any>> { | ||
static schema<T extends ConvectorModel<any>>(this: new (...args: any[]) => T): yup.ObjectSchema<FlatConvectorModel<T> & { | ||
private static type; | ||
static schema<T extends ConvectorModel<any>>(this: Function & { | ||
prototype: T; | ||
}): yup.ObjectSchema<FlatConvectorModel<T> & { | ||
id: string; | ||
@@ -14,0 +17,0 @@ type: string; |
@@ -23,4 +23,3 @@ "use strict"; | ||
ConvectorModel.schema = function () { | ||
var instance = new this(); | ||
return yup.object().shape(tslib_1.__assign({ id: yup.string().required(), type: yup.string() }, validate_decorator_2.getPropertiesValidation(instance))); | ||
return yup.object().shape(tslib_1.__assign({ id: yup.string().required(), type: yup.string() }, validate_decorator_2.getPropertiesValidation(this.prototype))); | ||
}; | ||
@@ -53,3 +52,3 @@ ConvectorModel.getOne = function (id, type) { | ||
type = this; | ||
if (args[0] && args[0].prototype.__proto__.constructor === ConvectorModel) { | ||
if (args[0] && 'type' in args[0] && args[0].type === ConvectorModel.type) { | ||
type = args.shift(); | ||
@@ -208,2 +207,3 @@ } | ||
}; | ||
ConvectorModel.type = 'io.convector.model'; | ||
tslib_1.__decorate([ | ||
@@ -210,0 +210,0 @@ required_decorator_1.Required(), |
{ | ||
"name": "@worldsibu/convector-core-model", | ||
"version": "1.2.1-0-alpha.0284ea21", | ||
"version": "1.2.1-0-alpha.0a7ddf29", | ||
"description": "Convector Model base class", | ||
@@ -35,4 +35,4 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@worldsibu/convector-core-errors": "1.2.1-0-alpha.0284ea21", | ||
"@worldsibu/convector-core-storage": "1.2.1-0-alpha.0284ea21", | ||
"@worldsibu/convector-core-errors": "1.2.1-0-alpha.0a7ddf29", | ||
"@worldsibu/convector-core-storage": "1.2.1-0-alpha.0a7ddf29", | ||
"tslib": "^1.9.0", | ||
@@ -39,0 +39,0 @@ "yup": "^0.26.10" |
Sorry, the diff of this file is not supported yet
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
40579
399
+ Added@worldsibu/convector-core-errors@1.2.1-0-alpha.0a7ddf29(transitive)
+ Added@worldsibu/convector-core-storage@1.2.1-0-alpha.0a7ddf29(transitive)
- Removed@worldsibu/convector-core-errors@1.2.1-0-alpha.0284ea21(transitive)
- Removed@worldsibu/convector-core-storage@1.2.1-0-alpha.0284ea21(transitive)
Updated@worldsibu/convector-core-errors@1.2.1-0-alpha.0a7ddf29
Updated@worldsibu/convector-core-storage@1.2.1-0-alpha.0a7ddf29