vona-module-a-version 5.0.15 → 5.0.17
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 +64 -69
- package/dist/index.js +115 -115
- package/package.json +1 -1
|
@@ -1,49 +1,13 @@
|
|
|
1
|
-
import type { BeanScopeUtil, TypeLocaleBase, TypeModuleErrors, TypeModuleLocales } from 'vona';
|
|
2
1
|
import type { TypeMetaEntity } from 'vona-module-a-database';
|
|
3
|
-
import type { IDecoratorModelOptions } from 'vona-module-a-database';
|
|
4
|
-
import type { EventOn } from 'vona-module-a-event';
|
|
5
2
|
import type { TypeEntityOptionsFields } from 'vona-module-a-openapi';
|
|
6
|
-
import type { IDecoratorStartupOptions } from 'vona-module-a-startup';
|
|
7
|
-
/** event: end */
|
|
8
|
-
/** event: begin */
|
|
9
|
-
import type { EventVersionDone } from '../bean/event.versionDone.ts';
|
|
10
|
-
/** event: end */
|
|
11
|
-
/** event: begin */
|
|
12
|
-
import type { TypeEventVersionDoneData, TypeEventVersionDoneResult } from '../bean/event.versionDone.ts';
|
|
13
|
-
import type { Errors } from '../config/errors.ts';
|
|
14
|
-
import type { IEntityOptionsVersion } from '../entity/version.ts';
|
|
15
|
-
/** entity: end */
|
|
16
3
|
/** entity: begin */
|
|
17
|
-
|
|
4
|
+
export * from '../entity/version.ts';
|
|
5
|
+
export * from '../entity/versionInit.ts';
|
|
6
|
+
export * from '../entity/viewRecord.ts';
|
|
7
|
+
import type { IEntityOptionsVersion } from '../entity/version.ts';
|
|
18
8
|
import type { IEntityOptionsVersionInit } from '../entity/versionInit.ts';
|
|
19
|
-
import type { EntityVersionInit } from '../entity/versionInit.ts';
|
|
20
9
|
import type { IEntityOptionsViewRecord } from '../entity/viewRecord.ts';
|
|
21
|
-
import type { EntityViewRecord } from '../entity/viewRecord.ts';
|
|
22
|
-
/** model: end */
|
|
23
|
-
/** model: begin */
|
|
24
|
-
import type { ModelViewRecord } from '../model/viewRecord.ts';
|
|
25
|
-
/** service: end */
|
|
26
|
-
/** service: begin */
|
|
27
|
-
import type { ServiceDatabase } from '../service/database.ts';
|
|
28
|
-
import type { ServiceVersion } from '../service/version.ts';
|
|
29
|
-
/** error: end */
|
|
30
|
-
/** scope: begin */
|
|
31
|
-
import { BeanScopeBase } from 'vona';
|
|
32
10
|
import 'vona';
|
|
33
|
-
import 'vona';
|
|
34
|
-
import 'vona';
|
|
35
|
-
import 'vona';
|
|
36
|
-
import 'vona';
|
|
37
|
-
import 'vona';
|
|
38
|
-
/** model: end */
|
|
39
|
-
/** event: begin */
|
|
40
|
-
export * from '../bean/event.versionDone.ts';
|
|
41
|
-
/** event: end */
|
|
42
|
-
/** meta: begin */
|
|
43
|
-
export * from '../bean/meta.version.ts';
|
|
44
|
-
/** meta: end */
|
|
45
|
-
/** startup: begin */
|
|
46
|
-
export * from '../bean/startup.databaseInit.ts';
|
|
47
11
|
declare module 'vona-module-a-database' {
|
|
48
12
|
interface IEntityRecord {
|
|
49
13
|
'a-version:version': Omit<IEntityOptionsVersion, '_fieldsMore_'>;
|
|
@@ -53,23 +17,22 @@ declare module 'vona-module-a-database' {
|
|
|
53
17
|
}
|
|
54
18
|
declare module 'vona-module-a-version' {
|
|
55
19
|
}
|
|
20
|
+
/** entity: end */
|
|
21
|
+
/** entity: begin */
|
|
22
|
+
import type { EntityVersion } from '../entity/version.ts';
|
|
23
|
+
import type { EntityVersionInit } from '../entity/versionInit.ts';
|
|
24
|
+
import type { EntityViewRecord } from '../entity/viewRecord.ts';
|
|
56
25
|
export interface IModuleEntity {
|
|
57
|
-
version: TypeMetaEntity<EntityVersion>;
|
|
58
|
-
versionInit: TypeMetaEntity<EntityVersionInit>;
|
|
59
|
-
viewRecord: TypeMetaEntity<EntityViewRecord>;
|
|
26
|
+
'version': TypeMetaEntity<EntityVersion, EntityVersionTableName>;
|
|
27
|
+
'versionInit': TypeMetaEntity<EntityVersionInit, EntityVersionInitTableName>;
|
|
28
|
+
'viewRecord': TypeMetaEntity<EntityViewRecord, EntityViewRecordTableName>;
|
|
60
29
|
}
|
|
61
30
|
/** entity: end */
|
|
62
31
|
/** entity: begin */
|
|
32
|
+
export type EntityVersionTableName = 'aVersion';
|
|
33
|
+
export type EntityVersionInitTableName = 'aVersionInit';
|
|
34
|
+
export type EntityViewRecordTableName = 'aViewRecord';
|
|
63
35
|
declare module 'vona-module-a-version' {
|
|
64
|
-
interface EntityVersion {
|
|
65
|
-
get $table(): 'aVersion';
|
|
66
|
-
}
|
|
67
|
-
interface EntityVersionInit {
|
|
68
|
-
get $table(): 'aVersionInit';
|
|
69
|
-
}
|
|
70
|
-
interface EntityViewRecord {
|
|
71
|
-
get $table(): 'aViewRecord';
|
|
72
|
-
}
|
|
73
36
|
interface IEntityOptionsVersion {
|
|
74
37
|
fields?: TypeEntityOptionsFields<EntityVersion, IEntityOptionsVersion['_fieldsMore_']>;
|
|
75
38
|
}
|
|
@@ -80,7 +43,10 @@ declare module 'vona-module-a-version' {
|
|
|
80
43
|
fields?: TypeEntityOptionsFields<EntityViewRecord, IEntityOptionsViewRecord['_fieldsMore_']>;
|
|
81
44
|
}
|
|
82
45
|
}
|
|
83
|
-
|
|
46
|
+
/** entity: end */
|
|
47
|
+
/** model: begin */
|
|
48
|
+
export * from '../model/viewRecord.ts';
|
|
49
|
+
import { type IDecoratorModelOptions } from 'vona-module-a-database';
|
|
84
50
|
declare module 'vona-module-a-database' {
|
|
85
51
|
interface IModelRecord {
|
|
86
52
|
'a-version:viewRecord': IDecoratorModelOptions;
|
|
@@ -90,27 +56,41 @@ declare module 'vona-module-a-version' {
|
|
|
90
56
|
interface ModelViewRecord {
|
|
91
57
|
}
|
|
92
58
|
}
|
|
59
|
+
/** model: end */
|
|
60
|
+
/** model: begin */
|
|
61
|
+
import type { ModelViewRecord } from '../model/viewRecord.ts';
|
|
93
62
|
export interface IModuleModel {
|
|
94
|
-
viewRecord: ModelViewRecord;
|
|
63
|
+
'viewRecord': ModelViewRecord;
|
|
95
64
|
}
|
|
96
|
-
|
|
65
|
+
/** model: end */
|
|
66
|
+
/** event: begin */
|
|
67
|
+
export * from '../bean/event.versionDone.ts';
|
|
68
|
+
import 'vona';
|
|
97
69
|
declare module 'vona' {
|
|
98
70
|
}
|
|
99
71
|
declare module 'vona-module-a-version' {
|
|
100
72
|
interface EventVersionDone {
|
|
101
73
|
}
|
|
102
74
|
}
|
|
75
|
+
/** event: end */
|
|
76
|
+
/** event: begin */
|
|
77
|
+
import type { EventVersionDone } from '../bean/event.versionDone.ts';
|
|
103
78
|
export interface IModuleEvent {
|
|
104
|
-
versionDone: EventVersionDone;
|
|
79
|
+
'versionDone': EventVersionDone;
|
|
105
80
|
}
|
|
81
|
+
/** event: end */
|
|
82
|
+
/** event: begin */
|
|
83
|
+
import type { TypeEventVersionDoneData, TypeEventVersionDoneResult } from '../bean/event.versionDone.ts';
|
|
84
|
+
import type { EventOn } from 'vona-module-a-event';
|
|
106
85
|
declare module 'vona-module-a-event' {
|
|
107
86
|
interface IEventRecord {
|
|
108
87
|
'a-version:versionDone': EventOn<TypeEventVersionDoneData, TypeEventVersionDoneResult>;
|
|
109
88
|
}
|
|
110
89
|
}
|
|
111
|
-
/**
|
|
112
|
-
/**
|
|
113
|
-
export * from '../
|
|
90
|
+
/** event: end */
|
|
91
|
+
/** meta: begin */
|
|
92
|
+
export * from '../bean/meta.version.ts';
|
|
93
|
+
import 'vona';
|
|
114
94
|
declare module 'vona' {
|
|
115
95
|
interface IMetaRecord {
|
|
116
96
|
'a-version:version': never;
|
|
@@ -120,10 +100,12 @@ declare module 'vona-module-a-version' {
|
|
|
120
100
|
interface MetaVersion {
|
|
121
101
|
}
|
|
122
102
|
}
|
|
123
|
-
/**
|
|
124
|
-
|
|
125
|
-
export * from '../
|
|
126
|
-
export * from '../
|
|
103
|
+
/** meta: end */
|
|
104
|
+
/** startup: begin */
|
|
105
|
+
export * from '../bean/startup.databaseInit.ts';
|
|
106
|
+
export * from '../bean/startup.databaseName.ts';
|
|
107
|
+
export * from '../bean/startup.instanceInit.ts';
|
|
108
|
+
import { type IDecoratorStartupOptions } from 'vona-module-a-startup';
|
|
127
109
|
declare module 'vona-module-a-startup' {
|
|
128
110
|
interface IStartupRecord {
|
|
129
111
|
'a-version:databaseInit': IDecoratorStartupOptions;
|
|
@@ -139,12 +121,11 @@ declare module 'vona-module-a-version' {
|
|
|
139
121
|
interface StartupInstanceInit {
|
|
140
122
|
}
|
|
141
123
|
}
|
|
142
|
-
/** entity: end */
|
|
143
|
-
/** model: begin */
|
|
144
|
-
export * from '../model/viewRecord.ts';
|
|
145
124
|
/** startup: end */
|
|
146
125
|
/** service: begin */
|
|
147
126
|
export * from '../service/database.ts';
|
|
127
|
+
export * from '../service/version.ts';
|
|
128
|
+
import 'vona';
|
|
148
129
|
declare module 'vona-module-a-web' {
|
|
149
130
|
interface IServiceRecord {
|
|
150
131
|
'a-version:database': never;
|
|
@@ -157,10 +138,17 @@ declare module 'vona-module-a-version' {
|
|
|
157
138
|
interface ServiceVersion {
|
|
158
139
|
}
|
|
159
140
|
}
|
|
141
|
+
/** service: end */
|
|
142
|
+
/** service: begin */
|
|
143
|
+
import type { ServiceDatabase } from '../service/database.ts';
|
|
144
|
+
import type { ServiceVersion } from '../service/version.ts';
|
|
160
145
|
export interface IModuleService {
|
|
161
|
-
database: ServiceDatabase;
|
|
162
|
-
version: ServiceVersion;
|
|
146
|
+
'database': ServiceDatabase;
|
|
147
|
+
'version': ServiceVersion;
|
|
163
148
|
}
|
|
149
|
+
/** service: end */
|
|
150
|
+
/** service: begin */
|
|
151
|
+
import 'vona';
|
|
164
152
|
declare module 'vona' {
|
|
165
153
|
interface IBeanRecordGeneral {
|
|
166
154
|
'a-version.service.database': ServiceDatabase;
|
|
@@ -175,7 +163,13 @@ export declare const locales: {
|
|
|
175
163
|
ModuleOld: string;
|
|
176
164
|
};
|
|
177
165
|
};
|
|
178
|
-
|
|
166
|
+
/** locale: end */
|
|
167
|
+
/** error: begin */
|
|
168
|
+
export * from '../config/errors.ts';
|
|
169
|
+
import type { Errors } from '../config/errors.ts';
|
|
170
|
+
/** error: end */
|
|
171
|
+
/** scope: begin */
|
|
172
|
+
import { BeanScopeBase, type BeanScopeUtil, type TypeModuleErrors, type TypeModuleLocales, type TypeLocaleBase } from 'vona';
|
|
179
173
|
export declare class ScopeModuleAVersion extends BeanScopeBase {
|
|
180
174
|
}
|
|
181
175
|
export interface ScopeModuleAVersion {
|
|
@@ -187,6 +181,7 @@ export interface ScopeModuleAVersion {
|
|
|
187
181
|
event: IModuleEvent;
|
|
188
182
|
service: IModuleService;
|
|
189
183
|
}
|
|
184
|
+
import 'vona';
|
|
190
185
|
declare module 'vona' {
|
|
191
186
|
interface IBeanScopeRecord {
|
|
192
187
|
'a-version': ScopeModuleAVersion;
|
package/dist/index.js
CHANGED
|
@@ -1,110 +1,14 @@
|
|
|
1
|
-
import { BeanInfo,
|
|
2
|
-
import {
|
|
1
|
+
import { BeanInfo, ClassMapped, BeanBase, BeanScopeBase } from 'vona';
|
|
2
|
+
import { Entity, EntityBaseSimple, Model, BeanModelBase } from 'vona-module-a-database';
|
|
3
|
+
import { Api } from 'vona-module-a-openapi';
|
|
3
4
|
import { Event, BeanEventBase } from 'vona-module-a-event';
|
|
4
5
|
import fse from 'fs-extra';
|
|
5
6
|
import { Meta } from 'vona-module-a-meta';
|
|
6
7
|
import { Startup } from 'vona-module-a-startup';
|
|
7
|
-
import { Entity, EntityBaseSimple, Model, BeanModelBase } from 'vona-module-a-database';
|
|
8
|
-
import { Api } from 'vona-module-a-openapi';
|
|
9
8
|
import chalk from 'chalk';
|
|
10
9
|
import moment from 'moment';
|
|
11
10
|
import { Service } from 'vona-module-a-web';
|
|
12
|
-
|
|
13
|
-
var locale_en_us = {
|
|
14
|
-
ModuleOld: 'Module %s is Old'
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
var locale_zh_cn = {
|
|
18
|
-
ModuleOld: '模块 %s 过旧'
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
var _dec$b, _dec2$b, _class$b;
|
|
22
|
-
let EventVersionDone = (_dec$b = Event(), _dec2$b = BeanInfo({
|
|
23
|
-
module: "a-version"
|
|
24
|
-
}), _dec$b(_class$b = _dec2$b(_class$b = class EventVersionDone extends BeanEventBase {}) || _class$b) || _class$b);
|
|
25
|
-
|
|
26
|
-
var _dec$a, _dec2$a, _class$a;
|
|
27
|
-
let MetaVersion = (_dec$a = Meta(), _dec2$a = BeanInfo({
|
|
28
|
-
module: "a-version"
|
|
29
|
-
}), _dec$a(_class$a = _dec2$a(_class$a = class MetaVersion extends BeanBase {
|
|
30
|
-
async update(options) {
|
|
31
|
-
if (options.version === 1) {
|
|
32
|
-
const entity = this.scope.entity.versionInit;
|
|
33
|
-
await this.bean.model.createTable(entity.$table, table => {
|
|
34
|
-
table.basicFieldsSimple({
|
|
35
|
-
deleted: false,
|
|
36
|
-
iid: false
|
|
37
|
-
});
|
|
38
|
-
table.string(entity.instanceName, 255);
|
|
39
|
-
table.string(entity.module, 255);
|
|
40
|
-
table.integer(entity.version);
|
|
41
|
-
});
|
|
42
|
-
const entity2 = this.scope.entity.viewRecord;
|
|
43
|
-
await this.bean.model.createTable(entity2.$table, table => {
|
|
44
|
-
table.basicFieldsSimple({
|
|
45
|
-
deleted: true,
|
|
46
|
-
iid: false
|
|
47
|
-
});
|
|
48
|
-
table.string(entity2.viewName, 255);
|
|
49
|
-
table.text(entity2.viewSql);
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
async init(options) {
|
|
54
|
-
if (options.version === 1) {
|
|
55
|
-
// remove publicDir
|
|
56
|
-
await this._removePublicDir();
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
async _removePublicDir() {
|
|
60
|
-
// only for test/local env
|
|
61
|
-
if (this.app.meta.isProd) return;
|
|
62
|
-
// path
|
|
63
|
-
const publicPath = await this.app.util.getPublicPathPhysical();
|
|
64
|
-
// remove
|
|
65
|
-
await fse.remove(publicPath);
|
|
66
|
-
}
|
|
67
|
-
}) || _class$a) || _class$a);
|
|
68
|
-
|
|
69
|
-
var _dec$9, _dec2$9, _class$9;
|
|
70
|
-
let StartupDatabaseInit = (_dec$9 = Startup({
|
|
71
|
-
debounce: true
|
|
72
|
-
}), _dec2$9 = BeanInfo({
|
|
73
|
-
module: "a-version"
|
|
74
|
-
}), _dec$9(_class$9 = _dec2$9(_class$9 = class StartupDatabaseInit extends BeanBase {
|
|
75
|
-
async execute() {
|
|
76
|
-
return await this.scope.service.database.databaseInitStartup();
|
|
77
|
-
}
|
|
78
|
-
}) || _class$9) || _class$9);
|
|
79
|
-
|
|
80
|
-
var _dec$8, _dec2$8, _class$8;
|
|
81
|
-
let StartupDatabaseName = (_dec$8 = Startup({
|
|
82
|
-
dependencies: 'a-version:databaseInit'
|
|
83
|
-
}), _dec2$8 = BeanInfo({
|
|
84
|
-
module: "a-version"
|
|
85
|
-
}), _dec$8(_class$8 = _dec2$8(_class$8 = class StartupDatabaseName extends BeanBase {
|
|
86
|
-
async execute() {
|
|
87
|
-
return await this.scope.service.database.databaseNameStartup();
|
|
88
|
-
}
|
|
89
|
-
}) || _class$8) || _class$8);
|
|
90
|
-
|
|
91
|
-
var _dec$7, _dec2$7, _class$7;
|
|
92
|
-
let StartupInstanceInit = (_dec$7 = Startup({
|
|
93
|
-
instance: true,
|
|
94
|
-
debounce: true
|
|
95
|
-
}), _dec2$7 = BeanInfo({
|
|
96
|
-
module: "a-version"
|
|
97
|
-
}), _dec$7(_class$7 = _dec2$7(_class$7 = class StartupInstanceInit extends BeanBase {
|
|
98
|
-
async execute(options) {
|
|
99
|
-
const beanVersion = this.scope.service.version;
|
|
100
|
-
return await beanVersion.instanceInitStartup(options);
|
|
101
|
-
}
|
|
102
|
-
}) || _class$7) || _class$7);
|
|
103
|
-
|
|
104
|
-
let Errors = /*#__PURE__*/function (Errors) {
|
|
105
|
-
Errors[Errors["ModuleOld"] = 1001] = "ModuleOld";
|
|
106
|
-
return Errors;
|
|
107
|
-
}({});
|
|
11
|
+
import { Scope } from 'vona-module-a-bean';
|
|
108
12
|
|
|
109
13
|
function _applyDecoratedDescriptor(i, e, r, n, l) {
|
|
110
14
|
var a = {};
|
|
@@ -123,10 +27,10 @@ function _initializerDefineProperty(e, i, r, l) {
|
|
|
123
27
|
});
|
|
124
28
|
}
|
|
125
29
|
|
|
126
|
-
var _dec$
|
|
127
|
-
let EntityVersion = (_dec$
|
|
30
|
+
var _dec$b, _dec2$b, _dec3$2, _dec4$2, _dec5$2, _dec6$2, _class$b, _class2$2, _descriptor$2, _descriptor2$2;
|
|
31
|
+
let EntityVersion = (_dec$b = Entity('aVersion'), _dec2$b = BeanInfo({
|
|
128
32
|
module: "a-version"
|
|
129
|
-
}), _dec3$2 = Api.field(), _dec4$2 = Reflect.metadata("design:type", String), _dec5$2 = Api.field(), _dec6$2 = Reflect.metadata("design:type", Number), _dec$
|
|
33
|
+
}), _dec3$2 = Api.field(), _dec4$2 = Reflect.metadata("design:type", String), _dec5$2 = Api.field(), _dec6$2 = Reflect.metadata("design:type", Number), _dec$b(_class$b = _dec2$b(_class$b = (_class2$2 = class EntityVersion extends ClassMapped.omit(EntityBaseSimple, ['iid', 'deleted']) {
|
|
130
34
|
constructor(...args) {
|
|
131
35
|
super(...args);
|
|
132
36
|
_initializerDefineProperty(this, "module", _descriptor$2, this);
|
|
@@ -142,12 +46,12 @@ let EntityVersion = (_dec$6 = Entity('aVersion'), _dec2$6 = BeanInfo({
|
|
|
142
46
|
enumerable: true,
|
|
143
47
|
writable: true,
|
|
144
48
|
initializer: null
|
|
145
|
-
}), _class2$2)) || _class$
|
|
49
|
+
}), _class2$2)) || _class$b) || _class$b);
|
|
146
50
|
|
|
147
|
-
var _dec$
|
|
148
|
-
let EntityVersionInit = (_dec$
|
|
51
|
+
var _dec$a, _dec2$a, _dec3$1, _dec4$1, _dec5$1, _dec6$1, _dec7, _dec8, _class$a, _class2$1, _descriptor$1, _descriptor2$1, _descriptor3;
|
|
52
|
+
let EntityVersionInit = (_dec$a = Entity('aVersionInit'), _dec2$a = BeanInfo({
|
|
149
53
|
module: "a-version"
|
|
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$
|
|
54
|
+
}), _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$a(_class$a = _dec2$a(_class$a = (_class2$1 = class EntityVersionInit extends ClassMapped.omit(EntityBaseSimple, ['iid', 'deleted']) {
|
|
151
55
|
constructor(...args) {
|
|
152
56
|
super(...args);
|
|
153
57
|
_initializerDefineProperty(this, "instanceName", _descriptor$1, this);
|
|
@@ -169,12 +73,12 @@ let EntityVersionInit = (_dec$5 = Entity('aVersionInit'), _dec2$5 = BeanInfo({
|
|
|
169
73
|
enumerable: true,
|
|
170
74
|
writable: true,
|
|
171
75
|
initializer: null
|
|
172
|
-
}), _class2$1)) || _class$
|
|
76
|
+
}), _class2$1)) || _class$a) || _class$a);
|
|
173
77
|
|
|
174
|
-
var _dec$
|
|
175
|
-
let EntityViewRecord = (_dec$
|
|
78
|
+
var _dec$9, _dec2$9, _dec3, _dec4, _dec5, _dec6, _class$9, _class2, _descriptor, _descriptor2;
|
|
79
|
+
let EntityViewRecord = (_dec$9 = Entity('aViewRecord'), _dec2$9 = BeanInfo({
|
|
176
80
|
module: "a-version"
|
|
177
|
-
}), _dec3 = Api.field(), _dec4 = Reflect.metadata("design:type", String), _dec5 = Api.field(), _dec6 = Reflect.metadata("design:type", String), _dec$
|
|
81
|
+
}), _dec3 = Api.field(), _dec4 = Reflect.metadata("design:type", String), _dec5 = Api.field(), _dec6 = Reflect.metadata("design:type", String), _dec$9(_class$9 = _dec2$9(_class$9 = (_class2 = class EntityViewRecord extends ClassMapped.omit(EntityBaseSimple, ['iid']) {
|
|
178
82
|
constructor(...args) {
|
|
179
83
|
super(...args);
|
|
180
84
|
_initializerDefineProperty(this, "viewName", _descriptor, this);
|
|
@@ -190,16 +94,99 @@ let EntityViewRecord = (_dec$4 = Entity('aViewRecord'), _dec2$4 = BeanInfo({
|
|
|
190
94
|
enumerable: true,
|
|
191
95
|
writable: true,
|
|
192
96
|
initializer: null
|
|
193
|
-
}), _class2)) || _class$
|
|
97
|
+
}), _class2)) || _class$9) || _class$9);
|
|
194
98
|
|
|
195
|
-
var _dec$
|
|
196
|
-
let ModelViewRecord = (_dec$
|
|
99
|
+
var _dec$8, _dec2$8, _class$8;
|
|
100
|
+
let ModelViewRecord = (_dec$8 = Model({
|
|
197
101
|
entity: EntityViewRecord,
|
|
198
102
|
disableDeleted: false,
|
|
199
103
|
disableInstance: true
|
|
104
|
+
}), _dec2$8 = BeanInfo({
|
|
105
|
+
module: "a-version"
|
|
106
|
+
}), _dec$8(_class$8 = _dec2$8(_class$8 = class ModelViewRecord extends BeanModelBase {}) || _class$8) || _class$8);
|
|
107
|
+
|
|
108
|
+
var _dec$7, _dec2$7, _class$7;
|
|
109
|
+
let EventVersionDone = (_dec$7 = Event(), _dec2$7 = BeanInfo({
|
|
110
|
+
module: "a-version"
|
|
111
|
+
}), _dec$7(_class$7 = _dec2$7(_class$7 = class EventVersionDone extends BeanEventBase {}) || _class$7) || _class$7);
|
|
112
|
+
|
|
113
|
+
var _dec$6, _dec2$6, _class$6;
|
|
114
|
+
let MetaVersion = (_dec$6 = Meta(), _dec2$6 = BeanInfo({
|
|
115
|
+
module: "a-version"
|
|
116
|
+
}), _dec$6(_class$6 = _dec2$6(_class$6 = class MetaVersion extends BeanBase {
|
|
117
|
+
async update(options) {
|
|
118
|
+
if (options.version === 1) {
|
|
119
|
+
const entity = this.scope.entity.versionInit;
|
|
120
|
+
await this.bean.model.createTable(entity.$table, table => {
|
|
121
|
+
table.basicFieldsSimple({
|
|
122
|
+
deleted: false,
|
|
123
|
+
iid: false
|
|
124
|
+
});
|
|
125
|
+
table.string(entity.instanceName, 255);
|
|
126
|
+
table.string(entity.module, 255);
|
|
127
|
+
table.integer(entity.version);
|
|
128
|
+
});
|
|
129
|
+
const entity2 = this.scope.entity.viewRecord;
|
|
130
|
+
await this.bean.model.createTable(entity2.$table, table => {
|
|
131
|
+
table.basicFieldsSimple({
|
|
132
|
+
deleted: true,
|
|
133
|
+
iid: false
|
|
134
|
+
});
|
|
135
|
+
table.string(entity2.viewName, 255);
|
|
136
|
+
table.text(entity2.viewSql);
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
async init(options) {
|
|
141
|
+
if (options.version === 1) {
|
|
142
|
+
// remove publicDir
|
|
143
|
+
await this._removePublicDir();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
async _removePublicDir() {
|
|
147
|
+
// only for test/local env
|
|
148
|
+
if (this.app.meta.isProd) return;
|
|
149
|
+
// path
|
|
150
|
+
const publicPath = await this.app.util.getPublicPathPhysical();
|
|
151
|
+
// remove
|
|
152
|
+
await fse.remove(publicPath);
|
|
153
|
+
}
|
|
154
|
+
}) || _class$6) || _class$6);
|
|
155
|
+
|
|
156
|
+
var _dec$5, _dec2$5, _class$5;
|
|
157
|
+
let StartupDatabaseInit = (_dec$5 = Startup({
|
|
158
|
+
debounce: true
|
|
159
|
+
}), _dec2$5 = BeanInfo({
|
|
160
|
+
module: "a-version"
|
|
161
|
+
}), _dec$5(_class$5 = _dec2$5(_class$5 = class StartupDatabaseInit extends BeanBase {
|
|
162
|
+
async execute() {
|
|
163
|
+
return await this.scope.service.database.databaseInitStartup();
|
|
164
|
+
}
|
|
165
|
+
}) || _class$5) || _class$5);
|
|
166
|
+
|
|
167
|
+
var _dec$4, _dec2$4, _class$4;
|
|
168
|
+
let StartupDatabaseName = (_dec$4 = Startup({
|
|
169
|
+
dependencies: 'a-version:databaseInit'
|
|
170
|
+
}), _dec2$4 = BeanInfo({
|
|
171
|
+
module: "a-version"
|
|
172
|
+
}), _dec$4(_class$4 = _dec2$4(_class$4 = class StartupDatabaseName extends BeanBase {
|
|
173
|
+
async execute() {
|
|
174
|
+
return await this.scope.service.database.databaseNameStartup();
|
|
175
|
+
}
|
|
176
|
+
}) || _class$4) || _class$4);
|
|
177
|
+
|
|
178
|
+
var _dec$3, _dec2$3, _class$3;
|
|
179
|
+
let StartupInstanceInit = (_dec$3 = Startup({
|
|
180
|
+
instance: true,
|
|
181
|
+
debounce: true
|
|
200
182
|
}), _dec2$3 = BeanInfo({
|
|
201
183
|
module: "a-version"
|
|
202
|
-
}), _dec$3(_class$3 = _dec2$3(_class$3 = class
|
|
184
|
+
}), _dec$3(_class$3 = _dec2$3(_class$3 = class StartupInstanceInit extends BeanBase {
|
|
185
|
+
async execute(options) {
|
|
186
|
+
const beanVersion = this.scope.service.version;
|
|
187
|
+
return await beanVersion.instanceInitStartup(options);
|
|
188
|
+
}
|
|
189
|
+
}) || _class$3) || _class$3);
|
|
203
190
|
|
|
204
191
|
var _dec$2, _dec2$2, _class$2;
|
|
205
192
|
const __separator = '-';
|
|
@@ -545,6 +532,19 @@ let ServiceVersion = (_dec$1 = Service(), _dec2$1 = BeanInfo({
|
|
|
545
532
|
}
|
|
546
533
|
}) || _class$1) || _class$1);
|
|
547
534
|
|
|
535
|
+
var locale_en_us = {
|
|
536
|
+
ModuleOld: 'Module %s is Old'
|
|
537
|
+
};
|
|
538
|
+
|
|
539
|
+
var locale_zh_cn = {
|
|
540
|
+
ModuleOld: '模块 %s 过旧'
|
|
541
|
+
};
|
|
542
|
+
|
|
543
|
+
let Errors = /*#__PURE__*/function (Errors) {
|
|
544
|
+
Errors[Errors["ModuleOld"] = 1001] = "ModuleOld";
|
|
545
|
+
return Errors;
|
|
546
|
+
}({});
|
|
547
|
+
|
|
548
548
|
var _dec, _dec2, _class;
|
|
549
549
|
const locales = {
|
|
550
550
|
'en-us': locale_en_us,
|