vona-module-a-onion 5.0.32 → 5.0.35
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 +18 -21
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProxyDisable, BeanInfo, BeanBase, compose, appMetadata, cast, deepExtend, appResource, BeanSimple, BeanScopeBase } from 'vona';
|
|
2
|
-
import {
|
|
3
|
-
import { matchSelector } from '@cabloy/
|
|
2
|
+
import { __decorate } from 'tslib';
|
|
3
|
+
import { isNil, checkMeta, matchSelector } from '@cabloy/utils';
|
|
4
4
|
import { Service, Bean, Scope } from 'vona-module-a-bean';
|
|
5
5
|
import { isRegExp } from 'node:util/types';
|
|
6
6
|
import { swapDeps } from '@cabloy/deps';
|
|
@@ -9,12 +9,9 @@ import { getOnionScenesMeta } from '@cabloy/module-info';
|
|
|
9
9
|
const SymbolUseOnionLocal = Symbol('SymbolUseOnionLocal');
|
|
10
10
|
const SymbolUseOnionOptions = Symbol('SymbolUseOnionOptions');
|
|
11
11
|
|
|
12
|
-
var _dec$2, _dec2$2, _dec3$1, _class$2;
|
|
13
12
|
const SymbolOnionsEnabled = Symbol('SymbolOnionsEnabled');
|
|
14
13
|
const SymbolOnionsEnabledWrapped = Symbol('SymbolOnionsEnabledWrapped');
|
|
15
|
-
let ServiceOnion =
|
|
16
|
-
module: "a-onion"
|
|
17
|
-
}), _dec$2(_class$2 = _dec2$2(_class$2 = _dec3$1(_class$2 = class ServiceOnion extends BeanBase {
|
|
14
|
+
let ServiceOnion = class ServiceOnion extends BeanBase {
|
|
18
15
|
constructor(...args) {
|
|
19
16
|
super(...args);
|
|
20
17
|
this.sceneName = void 0;
|
|
@@ -163,12 +160,12 @@ let ServiceOnion = (_dec$2 = ProxyDisable(), _dec2$2 = Service(), _dec3$1 = Bean
|
|
|
163
160
|
// options: meta/config
|
|
164
161
|
const optionsMetaAndConfig = item.beanOptions.options;
|
|
165
162
|
// options: instance config
|
|
166
|
-
const optionsInstanceConfig = ctx
|
|
163
|
+
const optionsInstanceConfig = ctx?.instance ? ctx?.config.onions[item.beanOptions.scene]?.[item.name] : undefined;
|
|
167
164
|
// options: route
|
|
168
165
|
// not use route options for argument pipe
|
|
169
166
|
let optionsRoute;
|
|
170
167
|
if (!cast(item).argumentPipe && this.sceneMeta.optionsRoute) {
|
|
171
|
-
const route = ctx
|
|
168
|
+
const route = ctx?.route?.route;
|
|
172
169
|
optionsRoute = route?.meta?.[item.beanOptions.beanFullName];
|
|
173
170
|
}
|
|
174
171
|
// options: argument pipe
|
|
@@ -176,7 +173,7 @@ let ServiceOnion = (_dec$2 = ProxyDisable(), _dec2$2 = Service(), _dec3$1 = Bean
|
|
|
176
173
|
// options: dynamic
|
|
177
174
|
let optionsDynamic;
|
|
178
175
|
if (this.sceneMeta.optionsDynamic) {
|
|
179
|
-
optionsDynamic = ctx
|
|
176
|
+
optionsDynamic = ctx?.onionsDynamic?.[item.beanOptions.scene]?.[item.name];
|
|
180
177
|
}
|
|
181
178
|
// final options
|
|
182
179
|
let options;
|
|
@@ -235,7 +232,6 @@ let ServiceOnion = (_dec$2 = ProxyDisable(), _dec2$2 = Service(), _dec3$1 = Bean
|
|
|
235
232
|
});
|
|
236
233
|
}
|
|
237
234
|
}
|
|
238
|
-
|
|
239
235
|
/** internal */
|
|
240
236
|
_wrapOnion(item, executeCustom) {
|
|
241
237
|
const sceneName = this.sceneName;
|
|
@@ -262,7 +258,6 @@ let ServiceOnion = (_dec$2 = ProxyDisable(), _dec2$2 = Service(), _dec3$1 = Bean
|
|
|
262
258
|
fn._name = item.name;
|
|
263
259
|
return fn;
|
|
264
260
|
}
|
|
265
|
-
|
|
266
261
|
// todo: maybe use routePathRaw directly
|
|
267
262
|
_getRoutePathForMatch() {
|
|
268
263
|
const routePathRaw = this.ctx.route?.routePathRaw;
|
|
@@ -293,12 +288,12 @@ let ServiceOnion = (_dec$2 = ProxyDisable(), _dec2$2 = Service(), _dec3$1 = Bean
|
|
|
293
288
|
this.$logger.silly(JSON.stringify(onionSlices2, null, 2));
|
|
294
289
|
this.$logger.silly(JSON.stringify(onionNames, null, 2));
|
|
295
290
|
}
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
var _dec$1, _dec2$1, _dec3, _class$1;
|
|
299
|
-
let BeanOnion = (_dec$1 = ProxyDisable(), _dec2$1 = Bean(), _dec3 = BeanInfo({
|
|
291
|
+
};
|
|
292
|
+
ServiceOnion = __decorate([ProxyDisable(), Service(), BeanInfo({
|
|
300
293
|
module: "a-onion"
|
|
301
|
-
}),
|
|
294
|
+
})], ServiceOnion);
|
|
295
|
+
|
|
296
|
+
let BeanOnion = class BeanOnion extends BeanBase {
|
|
302
297
|
constructor(...args) {
|
|
303
298
|
super(...args);
|
|
304
299
|
this.__instances = {};
|
|
@@ -327,7 +322,10 @@ let BeanOnion = (_dec$1 = ProxyDisable(), _dec2$1 = Bean(), _dec3 = BeanInfo({
|
|
|
327
322
|
}
|
|
328
323
|
return checkMeta(meta, metaCurrent);
|
|
329
324
|
}
|
|
330
|
-
}
|
|
325
|
+
};
|
|
326
|
+
BeanOnion = __decorate([ProxyDisable(), Bean(), BeanInfo({
|
|
327
|
+
module: "a-onion"
|
|
328
|
+
})], BeanOnion);
|
|
331
329
|
function __onionMatchSelector(match, selector, matchThis, ...matchArgs) {
|
|
332
330
|
return matchSelector(match, selector, matchThis, ...matchArgs);
|
|
333
331
|
}
|
|
@@ -340,11 +338,10 @@ class Main extends BeanSimple {
|
|
|
340
338
|
async configLoaded(_config) {}
|
|
341
339
|
}
|
|
342
340
|
|
|
343
|
-
|
|
344
|
-
|
|
341
|
+
let ScopeModuleAOnion = class ScopeModuleAOnion extends BeanScopeBase {};
|
|
342
|
+
ScopeModuleAOnion = __decorate([Scope(), BeanInfo({
|
|
345
343
|
module: "a-onion"
|
|
346
|
-
}),
|
|
347
|
-
|
|
344
|
+
})], ScopeModuleAOnion);
|
|
348
345
|
/** scope: end */
|
|
349
346
|
|
|
350
347
|
export { BeanOnion, Main, ScopeModuleAOnion, ServiceOnion, SymbolUseOnionLocal, SymbolUseOnionOptions };
|