@apex-pub/convector-core-model 1.3.12-1-alpha.c6e79dc1 → 1.4.1-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/convector-model.d.ts +2 -2
- package/dist/src/convector-model.js +114 -185
- package/dist/src/convector-model.js.map +1 -1
- package/dist/src/default.decorator.js +7 -11
- package/dist/src/default.decorator.js.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/read-only.decorator.js +9 -8
- package/dist/src/read-only.decorator.js.map +1 -1
- package/dist/src/required.decorator.js +9 -10
- package/dist/src/required.decorator.js.map +1 -1
- package/dist/src/validate.decorator.js +15 -16
- package/dist/src/validate.decorator.js.map +1 -1
- package/package.json +4 -13
|
@@ -31,7 +31,7 @@ export declare abstract class ConvectorModel<T extends ConvectorModel<any>> {
|
|
|
31
31
|
static query<T>(type: new (content: any) => T, ...args: any[]): Promise<T | T[]>;
|
|
32
32
|
static getAll<T extends ConvectorModel<any>>(this: new (content: any) => T, type?: string): Promise<T[]>;
|
|
33
33
|
id: string;
|
|
34
|
-
readonly
|
|
34
|
+
abstract readonly type: string;
|
|
35
35
|
constructor();
|
|
36
36
|
constructor(id: string);
|
|
37
37
|
constructor(content: {
|
|
@@ -48,5 +48,5 @@ export declare abstract class ConvectorModel<T extends ConvectorModel<any>> {
|
|
|
48
48
|
[key in keyof T]?: T[key];
|
|
49
49
|
};
|
|
50
50
|
delete(storageOptions?: any): Promise<void>;
|
|
51
|
-
private assign
|
|
51
|
+
private assign;
|
|
52
52
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
exports.ConvectorModel = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const yup = require("yup");
|
|
6
|
+
const convector_core_errors_1 = require("@apex-pub/convector-core-errors");
|
|
7
|
+
const convector_core_storage_1 = require("@apex-pub/convector-core-storage");
|
|
8
|
+
const validate_decorator_1 = require("../src/validate.decorator");
|
|
9
|
+
const default_decorator_1 = require("../src/default.decorator");
|
|
10
|
+
const required_decorator_1 = require("../src/required.decorator");
|
|
11
|
+
const validate_decorator_2 = require("../src/validate.decorator");
|
|
12
|
+
class ConvectorModel {
|
|
13
|
+
constructor(content) {
|
|
13
14
|
if (!content) {
|
|
14
15
|
return;
|
|
15
16
|
}
|
|
@@ -19,166 +20,106 @@ var ConvectorModel = (function () {
|
|
|
19
20
|
}
|
|
20
21
|
this.assign(content);
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
-
return yup.object().shape(
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
case 1:
|
|
34
|
-
content = _a.sent();
|
|
35
|
-
model = new type(content);
|
|
36
|
-
if ((content && model) && content.type !== new type('').type) {
|
|
37
|
-
if (storageOptions && storageOptions.enforceType) {
|
|
38
|
-
throw new Error("Possible ID collision, element " + id + " of type " + content.type + " is not " + new type('').type);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
console.warn("Possible ID collision, element " + id + " of type " + content.type + " is not " + new type('').type);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return [2, model];
|
|
23
|
+
static schema() {
|
|
24
|
+
return yup.object().shape(Object.assign({ id: yup.string().required(), type: yup.string() }, (0, validate_decorator_2.getPropertiesValidation)(this.prototype)));
|
|
25
|
+
}
|
|
26
|
+
static getOne(id, type, storageOptions) {
|
|
27
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
type = type || this;
|
|
29
|
+
const content = yield convector_core_storage_1.BaseStorage.current.get(id, storageOptions);
|
|
30
|
+
const model = new type(content);
|
|
31
|
+
if ((content && model) && content.type !== new type('').type) {
|
|
32
|
+
if (storageOptions && storageOptions.enforceType) {
|
|
33
|
+
throw new Error(`Possible ID collision, element ${id} of type ${content.type} is not ${new type('').type}`);
|
|
45
34
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
};
|
|
49
|
-
ConvectorModel.query = function () {
|
|
50
|
-
var args = [];
|
|
51
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
52
|
-
args[_i] = arguments[_i];
|
|
53
|
-
}
|
|
54
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
55
|
-
var type, content, _a;
|
|
56
|
-
return tslib_1.__generator(this, function (_b) {
|
|
57
|
-
switch (_b.label) {
|
|
58
|
-
case 0:
|
|
59
|
-
type = this;
|
|
60
|
-
if (args[0] && 'type' in args[0] && args[0].type === ConvectorModel.type) {
|
|
61
|
-
type = args.shift();
|
|
62
|
-
}
|
|
63
|
-
return [4, (_a = convector_core_storage_1.BaseStorage.current).query.apply(_a, args)];
|
|
64
|
-
case 1:
|
|
65
|
-
content = _b.sent();
|
|
66
|
-
return [2, Array.isArray(content) ? content.map(function (c) { return new type(c); }) : new type(content)];
|
|
35
|
+
else {
|
|
36
|
+
console.warn(`Possible ID collision, element ${id} of type ${content.type} is not ${new type('').type}`);
|
|
67
37
|
}
|
|
68
|
-
}
|
|
38
|
+
}
|
|
39
|
+
return model;
|
|
69
40
|
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
});
|
|
41
|
+
}
|
|
42
|
+
static query(...args) {
|
|
43
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
let type = this;
|
|
45
|
+
if (args[0] && 'type' in args[0] && args[0].type === ConvectorModel.type) {
|
|
46
|
+
type = args.shift();
|
|
47
|
+
}
|
|
48
|
+
const content = yield convector_core_storage_1.BaseStorage.current.query(...args);
|
|
49
|
+
return Array.isArray(content) ? content.map(c => new type(c)) : new type(content);
|
|
81
50
|
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
case 0:
|
|
88
|
-
this.assign(content);
|
|
89
|
-
return [4, this.save()];
|
|
90
|
-
case 1:
|
|
91
|
-
_a.sent();
|
|
92
|
-
return [2];
|
|
93
|
-
}
|
|
94
|
-
});
|
|
51
|
+
}
|
|
52
|
+
static getAll(type) {
|
|
53
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
type = type || new this('').type;
|
|
55
|
+
return yield ConvectorModel.query(this, { selector: { type } });
|
|
95
56
|
});
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
switch (_a.label) {
|
|
102
|
-
case 0: return [4, convector_core_storage_1.BaseStorage.current.get(this.id, storageOptions)];
|
|
103
|
-
case 1:
|
|
104
|
-
content = _a.sent();
|
|
105
|
-
if (content.type !== this.type) {
|
|
106
|
-
throw new Error("Possible ID collision, element " + this.id + " of type " + content.type + " is not " + this.type);
|
|
107
|
-
}
|
|
108
|
-
this.assign(content);
|
|
109
|
-
return [2];
|
|
110
|
-
}
|
|
111
|
-
});
|
|
57
|
+
}
|
|
58
|
+
update(content) {
|
|
59
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
this.assign(content);
|
|
61
|
+
yield this.save();
|
|
112
62
|
});
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
63
|
+
}
|
|
64
|
+
fetch(storageOptions) {
|
|
65
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
const content = yield convector_core_storage_1.BaseStorage.current.get(this.id, storageOptions);
|
|
67
|
+
if (content.type !== this.type) {
|
|
68
|
+
throw new Error(`Possible ID collision, element ${this.id} of type ${content.type} is not ${this.type}`);
|
|
69
|
+
}
|
|
70
|
+
this.assign(content);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
history() {
|
|
74
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
const history = yield convector_core_storage_1.BaseStorage.current.history(this.id);
|
|
76
|
+
return history.map(item => ({
|
|
77
|
+
txId: item.tx_id,
|
|
78
|
+
value: new this.constructor(item.value),
|
|
79
|
+
timestamp: item.timestamp
|
|
80
|
+
}));
|
|
130
81
|
});
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
else {
|
|
143
|
-
throw new Error("Model " + this.type + " is not complete\n" + JSON.stringify(this) + ".\n Check your model definition for more details.");
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
convector_core_errors_1.InvalidIdError.test(this.id);
|
|
147
|
-
return [4, convector_core_storage_1.BaseStorage.current.set(this.id, this, storageOptions)];
|
|
148
|
-
case 1:
|
|
149
|
-
_a.sent();
|
|
150
|
-
return [2];
|
|
82
|
+
}
|
|
83
|
+
save(storageOptions) {
|
|
84
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
this.assign((0, default_decorator_1.getDefaults)(this), true);
|
|
86
|
+
if (!(0, required_decorator_1.ensureRequired)(this)) {
|
|
87
|
+
if (!this.id) {
|
|
88
|
+
throw new Error(`Model ${this.type} is missing the 'id' property \n${JSON.stringify(this)}`);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
throw new Error(`Model ${this.type} is not complete\n${JSON.stringify(this)}.
|
|
92
|
+
Check your model definition for more details.`);
|
|
151
93
|
}
|
|
152
|
-
}
|
|
94
|
+
}
|
|
95
|
+
convector_core_errors_1.InvalidIdError.test(this.id);
|
|
96
|
+
yield convector_core_storage_1.BaseStorage.current.set(this.id, this, storageOptions);
|
|
153
97
|
});
|
|
154
|
-
}
|
|
155
|
-
|
|
98
|
+
}
|
|
99
|
+
clone() {
|
|
156
100
|
return new this.constructor(Object.assign({}, this));
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
var protos = [];
|
|
162
|
-
var children = this;
|
|
101
|
+
}
|
|
102
|
+
toJSON(skipEmpty = false) {
|
|
103
|
+
let protos = [];
|
|
104
|
+
let children = this;
|
|
163
105
|
do {
|
|
164
106
|
children = Object.getPrototypeOf(children);
|
|
165
107
|
protos.push(children);
|
|
166
108
|
} while (children['__proto__'].constructor.name !== ConvectorModel.name);
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
109
|
+
const descriptors = protos.reduce((result, proto) => [
|
|
110
|
+
...result,
|
|
111
|
+
...Object.keys(proto)
|
|
112
|
+
.map(key => [key, Object.getOwnPropertyDescriptor(proto, key)])
|
|
113
|
+
], []);
|
|
114
|
+
const base = Object.keys(this).concat('id')
|
|
115
|
+
.filter(k => !k.startsWith('_'))
|
|
116
|
+
.filter(k => !skipEmpty || !(this[k] === undefined || this[k] === null))
|
|
117
|
+
.reduce((result, key) => (Object.assign(Object.assign({}, result), { [key]: this[key] })), {});
|
|
176
118
|
return descriptors
|
|
177
|
-
.reduce(
|
|
178
|
-
|
|
179
|
-
var hasGetter = desc && typeof desc.get === 'function';
|
|
119
|
+
.reduce((result, [key, desc]) => {
|
|
120
|
+
const hasGetter = desc && typeof desc.get === 'function';
|
|
180
121
|
if (hasGetter) {
|
|
181
|
-
result[key] = desc.get.call(
|
|
122
|
+
result[key] = desc.get.call(this);
|
|
182
123
|
}
|
|
183
124
|
if (skipEmpty && (result[key] === undefined || result[key] === null)) {
|
|
184
125
|
delete result[key];
|
|
@@ -188,38 +129,26 @@ var ConvectorModel = (function () {
|
|
|
188
129
|
}
|
|
189
130
|
return result;
|
|
190
131
|
}, base);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
194
|
-
|
|
195
|
-
switch (_a.label) {
|
|
196
|
-
case 0: return [4, convector_core_storage_1.BaseStorage.current.delete(this.id, storageOptions)];
|
|
197
|
-
case 1:
|
|
198
|
-
_a.sent();
|
|
199
|
-
return [2];
|
|
200
|
-
}
|
|
201
|
-
});
|
|
132
|
+
}
|
|
133
|
+
delete(storageOptions) {
|
|
134
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
135
|
+
yield convector_core_storage_1.BaseStorage.current.delete(this.id, storageOptions);
|
|
202
136
|
});
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
.
|
|
209
|
-
.
|
|
210
|
-
|
|
211
|
-
return (tslib_1.__assign({}, result, (_a = {}, _a[key] = content[key] !== undefined ? content[key] : content['_' + key], _a)));
|
|
212
|
-
var _a;
|
|
213
|
-
}, {});
|
|
214
|
-
var afterDefaults = defaults ? this.toJSON(true) : {};
|
|
137
|
+
}
|
|
138
|
+
assign(content, defaults = false) {
|
|
139
|
+
const validated = ['id', 'type', ...(0, validate_decorator_2.getValidatedProperties)(this)];
|
|
140
|
+
const filteredContent = Object.keys(content)
|
|
141
|
+
.map(key => key.replace(/^_/, ''))
|
|
142
|
+
.filter(key => validated.indexOf(key) >= 0)
|
|
143
|
+
.reduce((result, key) => (Object.assign(Object.assign({}, result), { [key]: content[key] !== undefined ? content[key] : content['_' + key] })), {});
|
|
144
|
+
const afterDefaults = defaults ? this.toJSON(true) : {};
|
|
215
145
|
Object.assign(this, filteredContent, afterDefaults);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}());
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
ConvectorModel.type = 'io.convector.model';
|
|
149
|
+
tslib_1.__decorate([
|
|
150
|
+
(0, required_decorator_1.Required)(),
|
|
151
|
+
(0, validate_decorator_1.Validate)(yup.string())
|
|
152
|
+
], ConvectorModel.prototype, "id", void 0);
|
|
224
153
|
exports.ConvectorModel = ConvectorModel;
|
|
225
154
|
//# sourceMappingURL=convector-model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convector-model.js","sourceRoot":"","sources":["../../src/convector-model.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"convector-model.js","sourceRoot":"","sources":["../../src/convector-model.ts"],"names":[],"mappings":";;;;AAEA,2BAA2B;AAC3B,2EAAiE;AACjE,6EAA+D;AAE/D,kEAAqD;AACrD,gEAAuD;AACvD,kEAAqE;AACrE,kEAGmC;AAyBnC,MAAsB,cAAc;IAyGlC,YAAY,OAAgD;QAC1D,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO;SACR;QAED,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YAC/B,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC;YAClB,OAAO;SACR;QAED,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC;IAjHM,MAAM,CAAC,MAAM;QAGlB,OAAO,GAAG,CAAC,MAAM,EAAwD,CAAC,KAAK,CAAC,gBAC9E,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CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACxD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,EAAE,aAAa,CAAC,CAAC;IACtD,CAAC;;AAjQc,mBAAI,GAAG,oBAAoB,CAAC;AAkF3C;IAFC,IAAA,6BAAQ,GAAE;IACV,IAAA,6BAAQ,EAAC,GAAG,CAAC,MAAM,EAAE,CAAC;0CACL;AAnFpB,wCAmQC"}
|
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
exports.getDefaults = exports.Default = exports.defaultMetadataKey = void 0;
|
|
4
|
+
const g = require("window-or-global");
|
|
5
5
|
require("reflect-metadata");
|
|
6
6
|
exports.defaultMetadataKey = g.ConvectorDefaultMetadataKey || Symbol('default');
|
|
7
7
|
g.ConvectorDefaultMetadataKey = exports.defaultMetadataKey;
|
|
8
8
|
function Default(defaultValue) {
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
Reflect.defineMetadata(exports.defaultMetadataKey,
|
|
12
|
-
var _a;
|
|
9
|
+
return (target, key) => {
|
|
10
|
+
const defaults = Reflect.getMetadata(exports.defaultMetadataKey, target) || {};
|
|
11
|
+
Reflect.defineMetadata(exports.defaultMetadataKey, Object.assign(Object.assign({}, defaults), { [key]: defaultValue }), target);
|
|
13
12
|
};
|
|
14
13
|
}
|
|
15
14
|
exports.Default = Default;
|
|
16
15
|
function getDefaults(obj) {
|
|
17
|
-
|
|
16
|
+
const defaults = Reflect.getMetadata(exports.defaultMetadataKey, obj);
|
|
18
17
|
return !defaults ? {} : Object.keys(defaults)
|
|
19
|
-
.reduce(
|
|
20
|
-
return (tslib_1.__assign({}, result, (_a = {}, _a[k] = typeof defaults[k] === 'function' ? defaults[k]() : defaults[k], _a)));
|
|
21
|
-
var _a;
|
|
22
|
-
}, {});
|
|
18
|
+
.reduce((result, k) => (Object.assign(Object.assign({}, result), { [k]: typeof defaults[k] === 'function' ? defaults[k]() : defaults[k] })), {});
|
|
23
19
|
}
|
|
24
20
|
exports.getDefaults = getDefaults;
|
|
25
21
|
//# sourceMappingURL=default.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.decorator.js","sourceRoot":"","sources":["../../src/default.decorator.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"default.decorator.js","sourceRoot":"","sources":["../../src/default.decorator.ts"],"names":[],"mappings":";;;AAEA,sCAAsC;AACtC,4BAA0B;AAEb,QAAA,kBAAkB,GAAG,CAAC,CAAC,2BAA2B,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC;AACrF,CAAC,CAAC,2BAA2B,GAAG,0BAAkB,CAAC;AAEnD,SAAgB,OAAO,CAAI,YAAe;IACxC,OAAO,CAAC,MAAW,EAAE,GAAW,EAAE,EAAE;QAClC,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,0BAAkB,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;QAEvE,OAAO,CAAC,cAAc,CAAC,0BAAkB,kCACpC,QAAQ,KACX,CAAC,GAAG,CAAC,EAAE,YAAY,KAClB,MAAM,CAAC,CAAC;IACb,CAAC,CAAC;AACJ,CAAC;AATD,0BASC;AAED,SAAgB,WAAW,CAAC,GAAQ;IAClC,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,0BAAkB,EAAE,GAAG,CAAC,CAAC;IAE9D,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;SAC1C,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,iCAClB,MAAM,KACT,CAAC,CAAC,CAAC,EAAE,OAAO,QAAQ,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IACpE,EAAE,EAAE,CAAC,CAAC;AACZ,CAAC;AARD,kCAQC"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./convector-model"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./default.decorator"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./required.decorator"), exports);
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReadOnly = void 0;
|
|
3
4
|
function ReadOnly() {
|
|
4
5
|
return function (target, key) {
|
|
5
|
-
|
|
6
|
-
get
|
|
7
|
-
return this[
|
|
6
|
+
const getSet = {
|
|
7
|
+
get() {
|
|
8
|
+
return this[`_${key}`];
|
|
8
9
|
},
|
|
9
|
-
set
|
|
10
|
-
|
|
11
|
-
setter = !setter || setter === getSet.set ? (
|
|
12
|
-
this[
|
|
13
|
-
setter.call(this, newVal) : this[
|
|
10
|
+
set(newVal) {
|
|
11
|
+
let setter = target.__lookupSetter__(key);
|
|
12
|
+
setter = !setter || setter === getSet.set ? (v => v) : setter;
|
|
13
|
+
this[`_${key}`] = this[`_${key}`] === undefined ?
|
|
14
|
+
setter.call(this, newVal) : this[`_${key}`];
|
|
14
15
|
},
|
|
15
16
|
enumerable: true,
|
|
16
17
|
configurable: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-only.decorator.js","sourceRoot":"","sources":["../../src/read-only.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"read-only.decorator.js","sourceRoot":"","sources":["../../src/read-only.decorator.ts"],"names":[],"mappings":";;;AAGA,SAAgB,QAAQ;IACtB,OAAO,UACL,MAAW,EACX,GAAW;QAEX,MAAM,MAAM,GAAG;YACb,GAAG;gBACD,OAAO,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;YACzB,CAAC;YACD,GAAG,CAAC,MAAM;gBACR,IAAI,MAAM,GAAG,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;gBAC1C,MAAM,GAAG,CAAC,MAAM,IAAI,MAAM,KAAK,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;gBAE9D,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,KAAK,SAAS,CAAC,CAAC;oBAC/C,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;YAChD,CAAC;YACD,UAAU,EAAE,IAAI;YAChB,YAAY,EAAE,IAAI;SACnB,CAAC;QAEF,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IAC7C,CAAC,CAAC;AACJ,CAAC;AAtBD,4BAsBC"}
|
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
exports.ensureRequired = exports.Required = exports.requiredMetadataKey = void 0;
|
|
4
|
+
const g = require("window-or-global");
|
|
5
5
|
require("reflect-metadata");
|
|
6
6
|
exports.requiredMetadataKey = g.ConvectorRequiredMetadataKey || Symbol('required');
|
|
7
7
|
g.ConvectorRequiredMetadataKey = exports.requiredMetadataKey;
|
|
8
8
|
function Required() {
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
Reflect.defineMetadata(exports.requiredMetadataKey,
|
|
12
|
-
var _a;
|
|
9
|
+
return (target, key) => {
|
|
10
|
+
const required = Reflect.getMetadata(exports.requiredMetadataKey, target);
|
|
11
|
+
Reflect.defineMetadata(exports.requiredMetadataKey, Object.assign(Object.assign({}, required), { [key]: true }), target);
|
|
13
12
|
};
|
|
14
13
|
}
|
|
15
14
|
exports.Required = Required;
|
|
16
15
|
function ensureRequired(obj) {
|
|
17
|
-
|
|
16
|
+
let required = {};
|
|
18
17
|
try {
|
|
19
18
|
required = Reflect.getMetadata(exports.requiredMetadataKey, obj) || {};
|
|
20
19
|
}
|
|
21
20
|
catch (e) {
|
|
22
21
|
}
|
|
23
22
|
return Object.keys(required)
|
|
24
|
-
.every(
|
|
25
|
-
|
|
23
|
+
.every(k => {
|
|
24
|
+
let res = !required[k] || obj[k] !== undefined;
|
|
26
25
|
if (!res) {
|
|
27
|
-
console.log(
|
|
26
|
+
console.log(`Validation error. Field ${k} is required but was not found.`);
|
|
28
27
|
}
|
|
29
28
|
return res;
|
|
30
29
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"required.decorator.js","sourceRoot":"","sources":["../../src/required.decorator.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"required.decorator.js","sourceRoot":"","sources":["../../src/required.decorator.ts"],"names":[],"mappings":";;;AAEA,sCAAsC;AACtC,4BAA0B;AAEb,QAAA,mBAAmB,GAAG,CAAC,CAAC,4BAA4B,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC;AACxF,CAAC,CAAC,4BAA4B,GAAG,2BAAmB,CAAC;AAErD,SAAgB,QAAQ;IACtB,OAAO,CAAC,MAAW,EAAE,GAAW,EAAE,EAAE;QAClC,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,2BAAmB,EAAE,MAAM,CAAC,CAAC;QAElE,OAAO,CAAC,cAAc,CAAC,2BAAmB,kCACrC,QAAQ,KACX,CAAC,GAAG,CAAC,EAAE,IAAI,KACV,MAAM,CAAC,CAAC;IACb,CAAC,CAAC;AACJ,CAAC;AATD,4BASC;AAED,SAAgB,cAAc,CAAC,GAAQ;IACrC,IAAI,QAAQ,GAAG,EAAE,CAAC;IAElB,IAAI;QACF,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,2BAAmB,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC;KAChE;IAAC,OAAO,CAAC,EAAE;KAEX;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;SACzB,KAAK,CAAC,CAAC,CAAC,EAAE;QACT,IAAI,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;QAC/C,IAAI,CAAC,GAAG,EAAE;YACR,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,iCAAiC,CAAC,CAAC;SAC5E;QACD,OAAO,GAAG,CAAC;IACb,CAAC,CAAC,CAAC;AACP,CAAC;AAjBD,wCAiBC"}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
exports.getValidatedProperties = exports.getPropertiesValidation = exports.Validate = exports.validateMetadataKey = void 0;
|
|
4
|
+
const g = require("window-or-global");
|
|
5
5
|
require("reflect-metadata");
|
|
6
6
|
exports.validateMetadataKey = g.ConvectorValidateMetadataKey || Symbol('validate');
|
|
7
7
|
g.ConvectorValidateMetadataKey = exports.validateMetadataKey;
|
|
8
8
|
function Validate(input) {
|
|
9
|
-
|
|
9
|
+
let schema = input;
|
|
10
10
|
if ('schema' in input) {
|
|
11
11
|
schema = input.schema();
|
|
12
12
|
}
|
|
13
|
-
return
|
|
14
|
-
|
|
15
|
-
get
|
|
16
|
-
return this[
|
|
13
|
+
return (target, key) => {
|
|
14
|
+
const getSet = {
|
|
15
|
+
get() {
|
|
16
|
+
return this[`_${key}`];
|
|
17
17
|
},
|
|
18
|
-
set
|
|
19
|
-
|
|
20
|
-
setter = !setter || setter === getSet.set ? (
|
|
18
|
+
set(newVal) {
|
|
19
|
+
let setter = target.__lookupSetter__(key);
|
|
20
|
+
setter = !setter || setter === getSet.set ? (v => v) : setter;
|
|
21
21
|
try {
|
|
22
|
-
this[
|
|
22
|
+
this[`_${key}`] = schema.validateSync(setter.call(this, newVal));
|
|
23
23
|
}
|
|
24
24
|
catch (ex) {
|
|
25
|
-
ex.message =
|
|
25
|
+
ex.message = `Error for field '${key}' with val '${JSON.stringify(newVal)}' ${ex.message}`;
|
|
26
26
|
throw ex;
|
|
27
27
|
}
|
|
28
28
|
},
|
|
@@ -30,14 +30,13 @@ function Validate(input) {
|
|
|
30
30
|
configurable: true
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(target, key, getSet);
|
|
33
|
-
|
|
34
|
-
Reflect.defineMetadata(exports.validateMetadataKey,
|
|
35
|
-
var _a;
|
|
33
|
+
const validated = Reflect.getMetadata(exports.validateMetadataKey, target);
|
|
34
|
+
Reflect.defineMetadata(exports.validateMetadataKey, Object.assign(Object.assign({}, validated), { [key]: schema }), target);
|
|
36
35
|
};
|
|
37
36
|
}
|
|
38
37
|
exports.Validate = Validate;
|
|
39
38
|
function getPropertiesValidation(obj) {
|
|
40
|
-
|
|
39
|
+
let validated = {};
|
|
41
40
|
try {
|
|
42
41
|
validated = Reflect.getMetadata(exports.validateMetadataKey, obj) || {};
|
|
43
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.decorator.js","sourceRoot":"","sources":["../../src/validate.decorator.ts"],"names":[],"mappings":";;;AAIA,
|
|
1
|
+
{"version":3,"file":"validate.decorator.js","sourceRoot":"","sources":["../../src/validate.decorator.ts"],"names":[],"mappings":";;;AAIA,sCAAsC;AACtC,4BAA0B;AAEb,QAAA,mBAAmB,GAAG,CAAC,CAAC,4BAA4B,IAAI,MAAM,CAAC,UAAU,CAA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,CAAC,GAAG,CAAC,EAAE,MAAM,KACZ,MAAM,CAAC,CAAC;IACb,CAAC,CAAC;AACJ,CAAC;AApCD,4BAoCC;AAED,SAAgB,uBAAuB,CAAC,GAAQ;IAC9C,IAAI,SAAS,GAAG,EAAE,CAAC;IAEnB,IAAI;QACF,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,2BAAmB,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC;KACjE;IAAC,OAAO,CAAC,EAAE;KAEX;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAVD,0DAUC;AAED,SAAgB,sBAAsB,CAAC,GAAQ;IAC7C,OAAO,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC,CAAC;AACnD,CAAC;AAFD,wDAEC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apex-pub/convector-core-model",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1-0",
|
|
4
4
|
"description": "Convector Model base class",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -50,21 +50,12 @@
|
|
|
50
50
|
"reflect-metadata": ">=0.1.12"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@apex-pub/convector-core-errors": "1.
|
|
54
|
-
"@apex-pub/convector-core-storage": "1.
|
|
55
|
-
"tslib": "^1.9.0",
|
|
53
|
+
"@apex-pub/convector-core-errors": "^1.4.1-0",
|
|
54
|
+
"@apex-pub/convector-core-storage": "^1.4.1-0",
|
|
56
55
|
"window-or-global": "^1.0.1",
|
|
57
56
|
"yup": "^0.26.10"
|
|
58
57
|
},
|
|
59
58
|
"devDependencies": {
|
|
60
|
-
"
|
|
61
|
-
"mocha": "^5.0.3",
|
|
62
|
-
"npm-scripts-watcher": "^1.0.2",
|
|
63
|
-
"reflect-metadata": "^0.1.12",
|
|
64
|
-
"rimraf": "^2.6.2",
|
|
65
|
-
"ts-node": "^6.0.3",
|
|
66
|
-
"tslint": "^5.9.1",
|
|
67
|
-
"typedoc": "^0.11.1",
|
|
68
|
-
"typescript": "2.8.3"
|
|
59
|
+
"reflect-metadata": "^0.1.12"
|
|
69
60
|
}
|
|
70
61
|
}
|