vona-module-a-version 5.0.13 → 5.0.15
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/.metadata/index.d.ts +10 -15
- package/dist/index.js +76 -23
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BeanScopeUtil, TypeLocaleBase, TypeModuleErrors, TypeModuleLocales } from 'vona';
|
|
2
|
+
import type { TypeMetaEntity } from 'vona-module-a-database';
|
|
2
3
|
import type { IDecoratorModelOptions } from 'vona-module-a-database';
|
|
3
4
|
import type { EventOn } from 'vona-module-a-event';
|
|
4
5
|
import type { TypeEntityOptionsFields } from 'vona-module-a-openapi';
|
|
@@ -45,44 +46,38 @@ export * from '../bean/meta.version.ts';
|
|
|
45
46
|
export * from '../bean/startup.databaseInit.ts';
|
|
46
47
|
declare module 'vona-module-a-database' {
|
|
47
48
|
interface IEntityRecord {
|
|
48
|
-
'a-version:version': IEntityOptionsVersion
|
|
49
|
-
'a-version:versionInit': IEntityOptionsVersionInit
|
|
50
|
-
'a-version:viewRecord': IEntityOptionsViewRecord
|
|
49
|
+
'a-version:version': Omit<IEntityOptionsVersion, '_fieldsMore_'>;
|
|
50
|
+
'a-version:versionInit': Omit<IEntityOptionsVersionInit, '_fieldsMore_'>;
|
|
51
|
+
'a-version:viewRecord': Omit<IEntityOptionsViewRecord, '_fieldsMore_'>;
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
declare module 'vona-module-a-version' {
|
|
54
55
|
}
|
|
55
56
|
export interface IModuleEntity {
|
|
56
|
-
version: EntityVersion
|
|
57
|
-
versionInit: EntityVersionInit
|
|
58
|
-
viewRecord: EntityViewRecord
|
|
57
|
+
version: TypeMetaEntity<EntityVersion>;
|
|
58
|
+
versionInit: TypeMetaEntity<EntityVersionInit>;
|
|
59
|
+
viewRecord: TypeMetaEntity<EntityViewRecord>;
|
|
59
60
|
}
|
|
60
61
|
/** entity: end */
|
|
61
62
|
/** entity: begin */
|
|
62
63
|
declare module 'vona-module-a-version' {
|
|
63
64
|
interface EntityVersion {
|
|
64
65
|
get $table(): 'aVersion';
|
|
65
|
-
$column: <K extends keyof Omit<EntityVersion, '$column' | '$columns' | '$table'>>(column: K) => K;
|
|
66
|
-
$columns: <K extends keyof Omit<EntityVersion, '$column' | '$columns' | '$table'>>(...columns: K[]) => K[];
|
|
67
66
|
}
|
|
68
67
|
interface EntityVersionInit {
|
|
69
68
|
get $table(): 'aVersionInit';
|
|
70
|
-
$column: <K extends keyof Omit<EntityVersionInit, '$column' | '$columns' | '$table'>>(column: K) => K;
|
|
71
|
-
$columns: <K extends keyof Omit<EntityVersionInit, '$column' | '$columns' | '$table'>>(...columns: K[]) => K[];
|
|
72
69
|
}
|
|
73
70
|
interface EntityViewRecord {
|
|
74
71
|
get $table(): 'aViewRecord';
|
|
75
|
-
$column: <K extends keyof Omit<EntityViewRecord, '$column' | '$columns' | '$table'>>(column: K) => K;
|
|
76
|
-
$columns: <K extends keyof Omit<EntityViewRecord, '$column' | '$columns' | '$table'>>(...columns: K[]) => K[];
|
|
77
72
|
}
|
|
78
73
|
interface IEntityOptionsVersion {
|
|
79
|
-
fields?: TypeEntityOptionsFields<EntityVersion, IEntityOptionsVersion['
|
|
74
|
+
fields?: TypeEntityOptionsFields<EntityVersion, IEntityOptionsVersion['_fieldsMore_']>;
|
|
80
75
|
}
|
|
81
76
|
interface IEntityOptionsVersionInit {
|
|
82
|
-
fields?: TypeEntityOptionsFields<EntityVersionInit, IEntityOptionsVersionInit['
|
|
77
|
+
fields?: TypeEntityOptionsFields<EntityVersionInit, IEntityOptionsVersionInit['_fieldsMore_']>;
|
|
83
78
|
}
|
|
84
79
|
interface IEntityOptionsViewRecord {
|
|
85
|
-
fields?: TypeEntityOptionsFields<EntityViewRecord, IEntityOptionsViewRecord['
|
|
80
|
+
fields?: TypeEntityOptionsFields<EntityViewRecord, IEntityOptionsViewRecord['_fieldsMore_']>;
|
|
86
81
|
}
|
|
87
82
|
}
|
|
88
83
|
export * from '../bean/startup.databaseName.ts';
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import fse from 'fs-extra';
|
|
|
5
5
|
import { Meta } from 'vona-module-a-meta';
|
|
6
6
|
import { Startup } from 'vona-module-a-startup';
|
|
7
7
|
import { Entity, EntityBaseSimple, Model, BeanModelBase } from 'vona-module-a-database';
|
|
8
|
+
import { Api } from 'vona-module-a-openapi';
|
|
8
9
|
import chalk from 'chalk';
|
|
9
10
|
import moment from 'moment';
|
|
10
11
|
import { Service } from 'vona-module-a-web';
|
|
@@ -34,9 +35,9 @@ let MetaVersion = (_dec$a = Meta(), _dec2$a = BeanInfo({
|
|
|
34
35
|
deleted: false,
|
|
35
36
|
iid: false
|
|
36
37
|
});
|
|
37
|
-
table.string(entity
|
|
38
|
-
table.string(entity
|
|
39
|
-
table.integer(entity
|
|
38
|
+
table.string(entity.instanceName, 255);
|
|
39
|
+
table.string(entity.module, 255);
|
|
40
|
+
table.integer(entity.version);
|
|
40
41
|
});
|
|
41
42
|
const entity2 = this.scope.entity.viewRecord;
|
|
42
43
|
await this.bean.model.createTable(entity2.$table, table => {
|
|
@@ -44,8 +45,8 @@ let MetaVersion = (_dec$a = Meta(), _dec2$a = BeanInfo({
|
|
|
44
45
|
deleted: true,
|
|
45
46
|
iid: false
|
|
46
47
|
});
|
|
47
|
-
table.string(entity2
|
|
48
|
-
table.text(entity2
|
|
48
|
+
table.string(entity2.viewName, 255);
|
|
49
|
+
table.text(entity2.viewSql);
|
|
49
50
|
});
|
|
50
51
|
}
|
|
51
52
|
}
|
|
@@ -105,39 +106,91 @@ let Errors = /*#__PURE__*/function (Errors) {
|
|
|
105
106
|
return Errors;
|
|
106
107
|
}({});
|
|
107
108
|
|
|
108
|
-
|
|
109
|
+
function _applyDecoratedDescriptor(i, e, r, n, l) {
|
|
110
|
+
var a = {};
|
|
111
|
+
return Object.keys(n).forEach(function (i) {
|
|
112
|
+
a[i] = n[i];
|
|
113
|
+
}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = true), a = r.slice().reverse().reduce(function (r, n) {
|
|
114
|
+
return n(i, e, r) || r;
|
|
115
|
+
}, a), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a;
|
|
116
|
+
}
|
|
117
|
+
function _initializerDefineProperty(e, i, r, l) {
|
|
118
|
+
r && Object.defineProperty(e, i, {
|
|
119
|
+
enumerable: r.enumerable,
|
|
120
|
+
configurable: r.configurable,
|
|
121
|
+
writable: r.writable,
|
|
122
|
+
value: r.initializer ? r.initializer.call(l) : void 0
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
var _dec$6, _dec2$6, _dec3$2, _dec4$2, _dec5$2, _dec6$2, _class$6, _class2$2, _descriptor$2, _descriptor2$2;
|
|
109
127
|
let EntityVersion = (_dec$6 = Entity('aVersion'), _dec2$6 = BeanInfo({
|
|
110
128
|
module: "a-version"
|
|
111
|
-
}), _dec$6(_class$6 = _dec2$6(_class$6 = class EntityVersion extends ClassMapped.omit(EntityBaseSimple, ['iid', 'deleted']) {
|
|
129
|
+
}), _dec3$2 = Api.field(), _dec4$2 = Reflect.metadata("design:type", String), _dec5$2 = Api.field(), _dec6$2 = Reflect.metadata("design:type", Number), _dec$6(_class$6 = _dec2$6(_class$6 = (_class2$2 = class EntityVersion extends ClassMapped.omit(EntityBaseSimple, ['iid', 'deleted']) {
|
|
112
130
|
constructor(...args) {
|
|
113
131
|
super(...args);
|
|
114
|
-
this
|
|
115
|
-
this
|
|
132
|
+
_initializerDefineProperty(this, "module", _descriptor$2, this);
|
|
133
|
+
_initializerDefineProperty(this, "version", _descriptor2$2, this);
|
|
116
134
|
}
|
|
117
|
-
}
|
|
135
|
+
}, _descriptor$2 = _applyDecoratedDescriptor(_class2$2.prototype, "module", [_dec3$2, _dec4$2], {
|
|
136
|
+
configurable: true,
|
|
137
|
+
enumerable: true,
|
|
138
|
+
writable: true,
|
|
139
|
+
initializer: null
|
|
140
|
+
}), _descriptor2$2 = _applyDecoratedDescriptor(_class2$2.prototype, "version", [_dec5$2, _dec6$2], {
|
|
141
|
+
configurable: true,
|
|
142
|
+
enumerable: true,
|
|
143
|
+
writable: true,
|
|
144
|
+
initializer: null
|
|
145
|
+
}), _class2$2)) || _class$6) || _class$6);
|
|
118
146
|
|
|
119
|
-
var _dec$5, _dec2$5, _class$5;
|
|
147
|
+
var _dec$5, _dec2$5, _dec3$1, _dec4$1, _dec5$1, _dec6$1, _dec7, _dec8, _class$5, _class2$1, _descriptor$1, _descriptor2$1, _descriptor3;
|
|
120
148
|
let EntityVersionInit = (_dec$5 = Entity('aVersionInit'), _dec2$5 = BeanInfo({
|
|
121
149
|
module: "a-version"
|
|
122
|
-
}), _dec$5(_class$5 = _dec2$5(_class$5 = class EntityVersionInit extends ClassMapped.omit(EntityBaseSimple, ['iid', 'deleted']) {
|
|
150
|
+
}), _dec3$1 = Api.field(), _dec4$1 = Reflect.metadata("design:type", String), _dec5$1 = Api.field(), _dec6$1 = Reflect.metadata("design:type", String), _dec7 = Api.field(), _dec8 = Reflect.metadata("design:type", Number), _dec$5(_class$5 = _dec2$5(_class$5 = (_class2$1 = class EntityVersionInit extends ClassMapped.omit(EntityBaseSimple, ['iid', 'deleted']) {
|
|
123
151
|
constructor(...args) {
|
|
124
152
|
super(...args);
|
|
125
|
-
this
|
|
126
|
-
this
|
|
127
|
-
this
|
|
153
|
+
_initializerDefineProperty(this, "instanceName", _descriptor$1, this);
|
|
154
|
+
_initializerDefineProperty(this, "module", _descriptor2$1, this);
|
|
155
|
+
_initializerDefineProperty(this, "version", _descriptor3, this);
|
|
128
156
|
}
|
|
129
|
-
}
|
|
157
|
+
}, _descriptor$1 = _applyDecoratedDescriptor(_class2$1.prototype, "instanceName", [_dec3$1, _dec4$1], {
|
|
158
|
+
configurable: true,
|
|
159
|
+
enumerable: true,
|
|
160
|
+
writable: true,
|
|
161
|
+
initializer: null
|
|
162
|
+
}), _descriptor2$1 = _applyDecoratedDescriptor(_class2$1.prototype, "module", [_dec5$1, _dec6$1], {
|
|
163
|
+
configurable: true,
|
|
164
|
+
enumerable: true,
|
|
165
|
+
writable: true,
|
|
166
|
+
initializer: null
|
|
167
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2$1.prototype, "version", [_dec7, _dec8], {
|
|
168
|
+
configurable: true,
|
|
169
|
+
enumerable: true,
|
|
170
|
+
writable: true,
|
|
171
|
+
initializer: null
|
|
172
|
+
}), _class2$1)) || _class$5) || _class$5);
|
|
130
173
|
|
|
131
|
-
var _dec$4, _dec2$4, _class$4;
|
|
174
|
+
var _dec$4, _dec2$4, _dec3, _dec4, _dec5, _dec6, _class$4, _class2, _descriptor, _descriptor2;
|
|
132
175
|
let EntityViewRecord = (_dec$4 = Entity('aViewRecord'), _dec2$4 = BeanInfo({
|
|
133
176
|
module: "a-version"
|
|
134
|
-
}), _dec$4(_class$4 = _dec2$4(_class$4 = class EntityViewRecord extends ClassMapped.omit(EntityBaseSimple, ['iid']) {
|
|
177
|
+
}), _dec3 = Api.field(), _dec4 = Reflect.metadata("design:type", String), _dec5 = Api.field(), _dec6 = Reflect.metadata("design:type", String), _dec$4(_class$4 = _dec2$4(_class$4 = (_class2 = class EntityViewRecord extends ClassMapped.omit(EntityBaseSimple, ['iid']) {
|
|
135
178
|
constructor(...args) {
|
|
136
179
|
super(...args);
|
|
137
|
-
this
|
|
138
|
-
this
|
|
180
|
+
_initializerDefineProperty(this, "viewName", _descriptor, this);
|
|
181
|
+
_initializerDefineProperty(this, "viewSql", _descriptor2, this);
|
|
139
182
|
}
|
|
140
|
-
}
|
|
183
|
+
}, _descriptor = _applyDecoratedDescriptor(_class2.prototype, "viewName", [_dec3, _dec4], {
|
|
184
|
+
configurable: true,
|
|
185
|
+
enumerable: true,
|
|
186
|
+
writable: true,
|
|
187
|
+
initializer: null
|
|
188
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "viewSql", [_dec5, _dec6], {
|
|
189
|
+
configurable: true,
|
|
190
|
+
enumerable: true,
|
|
191
|
+
writable: true,
|
|
192
|
+
initializer: null
|
|
193
|
+
}), _class2)) || _class$4) || _class$4);
|
|
141
194
|
|
|
142
195
|
var _dec$3, _dec2$3, _class$3;
|
|
143
196
|
let ModelViewRecord = (_dec$3 = Model({
|
|
@@ -300,8 +353,8 @@ let ServiceVersion = (_dec$1 = Service(), _dec2$1 = BeanInfo({
|
|
|
300
353
|
deleted: false,
|
|
301
354
|
iid: false
|
|
302
355
|
});
|
|
303
|
-
table.string(entity
|
|
304
|
-
table.integer(entity
|
|
356
|
+
table.string(entity.module, 255);
|
|
357
|
+
table.integer(entity.version);
|
|
305
358
|
});
|
|
306
359
|
}
|
|
307
360
|
}
|