Socket
Socket
Sign inDemoInstall

@worldsibu/convector-core-model

Package Overview
Dependencies
Maintainers
1
Versions
187
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@worldsibu/convector-core-model - npm Package Compare versions

Comparing version 1.1.9-0-alpha.3b1a9112 to 1.1.9-0-alpha.4b7b7721

6

dist/src/convector-model.d.ts

@@ -5,2 +5,7 @@ import * as yup from 'yup';

};
export interface History<T> {
value: T;
txId: string;
timestamp: number;
}
export declare abstract class ConvectorModel<T extends ConvectorModel<any>> {

@@ -24,2 +29,3 @@ static schema<T extends ConvectorModel<any>>(this: new (...args: any[]) => T): yup.ObjectSchema<FlatConvectorModel<T> & {

fetch(): Promise<void>;
history(): Promise<History<T>[]>;
save(): Promise<void>;

@@ -26,0 +32,0 @@ clone(): T;

24

dist/src/convector-model.js

@@ -106,2 +106,20 @@ "use strict";

};
ConvectorModel.prototype.history = function () {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var _this = this;
var history;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, convector_core_storage_1.BaseStorage.current.history(this.id)];
case 1:
history = _a.sent();
return [2, history.map(function (item) { return ({
txId: item.tx_id,
value: new _this.constructor(item.value),
timestamp: item.timestamp
}); })];
}
});
});
};
ConvectorModel.prototype.save = function () {

@@ -114,3 +132,3 @@ return tslib_1.__awaiter(this, void 0, void 0, function () {

if (!required_decorator_1.ensureRequired(this)) {
throw new Error("Model " + this.type + " is not complete\n" + this.toJSON());
throw new Error("Model " + this.type + " is not complete\n" + JSON.stringify(this));
}

@@ -127,3 +145,3 @@ convector_core_errors_1.InvalidIdError.test(this.id);

ConvectorModel.prototype.clone = function () {
return Object.assign({}, this);
return new this.constructor(Object.assign({}, this));
};

@@ -173,3 +191,3 @@ ConvectorModel.prototype.toJSON = function (skipEmpty) {

.reduce(function (result, key) {
return (tslib_1.__assign({}, result, (_a = {}, _a[key] = content[key], _a)));
return (tslib_1.__assign({}, result, (_a = {}, _a[key] = content[key] !== undefined ? content[key] : content['_' + key], _a)));
var _a;

@@ -176,0 +194,0 @@ }, {});

6

package.json
{
"name": "@worldsibu/convector-core-model",
"version": "1.1.9-0-alpha.3b1a9112",
"version": "1.1.9-0-alpha.4b7b7721",
"description": "Convector Model base class",

@@ -35,4 +35,4 @@ "license": "Apache-2.0",

"dependencies": {
"@worldsibu/convector-core-errors": "1.1.9-0-alpha.3b1a9112",
"@worldsibu/convector-core-storage": "1.1.9-0-alpha.3b1a9112",
"@worldsibu/convector-core-errors": "1.1.9-0-alpha.4b7b7721",
"@worldsibu/convector-core-storage": "1.1.9-0-alpha.4b7b7721",
"tslib": "^1.9.0",

@@ -39,0 +39,0 @@ "yup": "^0.24.1"

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