vona-module-a-executor 5.0.24 → 5.0.26
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/index.js +10 -0
- package/dist/types/executor.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -97,6 +97,7 @@ let BeanExecutor = (_dec$2 = Bean(), _dec2$2 = BeanInfo({
|
|
|
97
97
|
// locale/instanceName
|
|
98
98
|
if (ctxRef) {
|
|
99
99
|
options.locale = options.locale === undefined ? ctxRef.locale : options.locale;
|
|
100
|
+
options.tz = options.tz === undefined ? ctxRef.tz : options.tz;
|
|
100
101
|
options.instanceName = options.instanceName === undefined ? ctxRef.instanceName : options.instanceName;
|
|
101
102
|
}
|
|
102
103
|
// run
|
|
@@ -108,6 +109,10 @@ let BeanExecutor = (_dec$2 = Bean(), _dec2$2 = BeanInfo({
|
|
|
108
109
|
if (options.locale !== undefined) {
|
|
109
110
|
ctx.locale = options.locale;
|
|
110
111
|
}
|
|
112
|
+
// tz
|
|
113
|
+
if (options.tz !== undefined) {
|
|
114
|
+
ctx.tz = options.tz;
|
|
115
|
+
}
|
|
111
116
|
// instanceName: undefined/null is different
|
|
112
117
|
if (options.instanceName !== undefined) {
|
|
113
118
|
ctx.instanceName = options.instanceName;
|
|
@@ -132,6 +137,9 @@ let BeanExecutor = (_dec$2 = Bean(), _dec2$2 = BeanInfo({
|
|
|
132
137
|
// instance
|
|
133
138
|
const instanceName = this.ctx.instanceName; // use default instanceName when undefined
|
|
134
139
|
if (instanceName !== undefined && instanceName !== null) {
|
|
140
|
+
if (!this.app.meta.appReady) {
|
|
141
|
+
throw new Error(`should not init ctx.instance: ${instanceName}, when app.meta.appReady not true`);
|
|
142
|
+
}
|
|
135
143
|
this.ctx.instance = await this.bean.instance.get(instanceName);
|
|
136
144
|
// start instance
|
|
137
145
|
if (options?.instance) {
|
|
@@ -235,6 +243,7 @@ let ServiceExecutor = (_dec$1 = Service(), _dec2$1 = BeanInfo({
|
|
|
235
243
|
const level = (options?.dbInfo?.level ?? current?.level ?? 0) + 1;
|
|
236
244
|
const clientName = options?.dbInfo?.clientName ?? current?.clientName;
|
|
237
245
|
const locale = options?.locale === undefined ? this.ctx?.locale : options.locale;
|
|
246
|
+
const tz = options?.tz === undefined ? this.ctx?.tz : options.tz;
|
|
238
247
|
const instanceName = options?.instanceName === undefined ? this.ctx?.instanceName : options.instanceName;
|
|
239
248
|
options = Object.assign({}, options, {
|
|
240
249
|
dbInfo: {
|
|
@@ -242,6 +251,7 @@ let ServiceExecutor = (_dec$1 = Service(), _dec2$1 = BeanInfo({
|
|
|
242
251
|
clientName
|
|
243
252
|
},
|
|
244
253
|
locale,
|
|
254
|
+
tz,
|
|
245
255
|
instanceName
|
|
246
256
|
});
|
|
247
257
|
if (this.ctx) {
|
package/dist/types/executor.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export interface INewCtxOptions extends INewCtxBaseOptions {
|
|
|
13
13
|
}
|
|
14
14
|
export interface INewCtxBaseOptions {
|
|
15
15
|
locale?: keyof ILocaleRecord;
|
|
16
|
+
tz?: string;
|
|
16
17
|
instanceName?: keyof IInstanceRecord | undefined | null;
|
|
17
18
|
instance?: boolean;
|
|
18
19
|
transaction?: boolean;
|
|
@@ -35,6 +36,7 @@ export interface IPerformActionOptions {
|
|
|
35
36
|
export interface IGeneralInfoOptions {
|
|
36
37
|
dbInfo?: Partial<IDbInfo>;
|
|
37
38
|
locale?: keyof ILocaleRecord;
|
|
39
|
+
tz?: string;
|
|
38
40
|
instanceName?: keyof IInstanceRecord | undefined | null;
|
|
39
41
|
extraData?: INewCtxExtraData;
|
|
40
42
|
}
|