moost 0.5.29 → 0.5.31
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.cjs +371 -122
- package/dist/index.d.ts +364 -13
- package/dist/index.mjs +353 -106
- package/package.json +8 -8
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//#region rolldown:runtime
|
|
3
2
|
var __create = Object.create;
|
|
4
3
|
var __defProp = Object.defineProperty;
|
|
@@ -37,10 +36,18 @@ function setDefaultLogger(logger) {
|
|
|
37
36
|
function getDefaultLogger(topic) {
|
|
38
37
|
if (!defaultLogger) defaultLogger = new __prostojs_logger.ProstoLogger({
|
|
39
38
|
level: 4,
|
|
40
|
-
transports: [
|
|
39
|
+
transports: [loggerConsoleTransport]
|
|
41
40
|
});
|
|
42
41
|
return topic && defaultLogger instanceof __prostojs_logger.ProstoLogger ? defaultLogger.createTopic(topic) : defaultLogger;
|
|
43
42
|
}
|
|
43
|
+
function createLogger(opts) {
|
|
44
|
+
return new __prostojs_logger.ProstoLogger({
|
|
45
|
+
...opts,
|
|
46
|
+
level: opts?.level ?? 4,
|
|
47
|
+
transports: opts?.transports ?? [loggerConsoleTransport]
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const loggerConsoleTransport = (0, __prostojs_logger.createConsoleTransort)({ format: __prostojs_logger.coloredConsole });
|
|
44
51
|
|
|
45
52
|
//#endregion
|
|
46
53
|
//#region packages/moost/src/pipes/run-pipes.ts
|
|
@@ -70,7 +77,7 @@ function getMoostMate() {
|
|
|
70
77
|
//#endregion
|
|
71
78
|
//#region packages/moost/src/metadata/infact.ts
|
|
72
79
|
const sharedMoostInfact = getNewMoostInfact();
|
|
73
|
-
const INFACT_BANNER =
|
|
80
|
+
const INFACT_BANNER = `[2m[35minfact`;
|
|
74
81
|
let loggingOptions = {
|
|
75
82
|
newInstance: "SINGLETON",
|
|
76
83
|
warn: true,
|
|
@@ -85,16 +92,28 @@ function setInfactLoggingOptions(options) {
|
|
|
85
92
|
function getMoostInfact() {
|
|
86
93
|
return sharedMoostInfact;
|
|
87
94
|
}
|
|
88
|
-
const scopeVarsMap = new Map();
|
|
89
|
-
|
|
95
|
+
const scopeVarsMap = /* @__PURE__ */ new Map();
|
|
96
|
+
/**
|
|
97
|
+
* Define global scope name to be used with `@InjectFromScope` and `@InjectScopeVars` decorators
|
|
98
|
+
*
|
|
99
|
+
* You can read scoped vars with `getInfactScopeVars`
|
|
100
|
+
* @param name scope name
|
|
101
|
+
* @param scopeVars key-value object as scoped vars
|
|
102
|
+
*/ function defineInfactScope(name, scopeVars) {
|
|
90
103
|
scopeVarsMap.set(name, scopeVars);
|
|
91
104
|
getMoostInfact().registerScope(name);
|
|
92
105
|
}
|
|
93
|
-
|
|
106
|
+
/**
|
|
107
|
+
* Read scoped vars defined with `defineInfactScope`
|
|
108
|
+
* @param name scope name
|
|
109
|
+
* @returns key-value object as scoped vars
|
|
110
|
+
*/ function getInfactScopeVars(name) {
|
|
94
111
|
return scopeVarsMap.get(name);
|
|
95
112
|
}
|
|
96
|
-
|
|
97
|
-
|
|
113
|
+
/**
|
|
114
|
+
* Get Infact instance (used for Dependency Injections)
|
|
115
|
+
*/ function getNewMoostInfact() {
|
|
116
|
+
const infactInstance = new __prostojs_infact.Infact({
|
|
98
117
|
describeClass(classConstructor) {
|
|
99
118
|
const meta = getMoostMate().read(classConstructor);
|
|
100
119
|
return {
|
|
@@ -103,25 +122,26 @@ function getNewMoostInfact() {
|
|
|
103
122
|
constructorParams: meta?.params || [],
|
|
104
123
|
provide: meta?.provide,
|
|
105
124
|
properties: meta?.properties || [],
|
|
106
|
-
scopeId: meta?.injectable === "FOR_EVENT" ? (0, __wooksjs_event_core.useEventId)().getId() :
|
|
125
|
+
scopeId: meta?.injectable === "FOR_EVENT" ? (0, __wooksjs_event_core.useEventId)().getId() : void 0
|
|
107
126
|
};
|
|
108
127
|
},
|
|
109
|
-
resolveParam({ paramMeta, customData, classConstructor, index, scopeId }) {
|
|
110
|
-
if (paramMeta && customData?.pipes) return runPipes(customData.pipes,
|
|
128
|
+
resolveParam({ paramMeta, customData, classConstructor, index, scopeId, instantiate }) {
|
|
129
|
+
if (paramMeta && customData?.pipes) return runPipes(customData.pipes, void 0, {
|
|
111
130
|
paramMeta,
|
|
112
131
|
type: classConstructor,
|
|
113
132
|
key: "constructor",
|
|
114
133
|
scopeId,
|
|
115
134
|
classMeta: getMoostMate().read(classConstructor),
|
|
116
135
|
index,
|
|
117
|
-
targetMeta: paramMeta
|
|
136
|
+
targetMeta: paramMeta,
|
|
137
|
+
instantiate
|
|
118
138
|
}, "PARAM");
|
|
119
139
|
},
|
|
120
140
|
describeProp(classConstructor, key) {
|
|
121
141
|
const meta = getMoostMate().read(classConstructor, key);
|
|
122
142
|
return meta;
|
|
123
143
|
},
|
|
124
|
-
resolveProp({ instance, key, initialValue, propMeta, scopeId, classMeta, customData, classConstructor }) {
|
|
144
|
+
resolveProp({ instance, key, initialValue, propMeta, scopeId, classMeta, customData, classConstructor, instantiate }) {
|
|
125
145
|
if (propMeta && customData?.pipes) return runPipes(customData.pipes, initialValue, {
|
|
126
146
|
instance,
|
|
127
147
|
type: classConstructor,
|
|
@@ -129,7 +149,8 @@ function getNewMoostInfact() {
|
|
|
129
149
|
scopeId,
|
|
130
150
|
propMeta,
|
|
131
151
|
targetMeta: propMeta,
|
|
132
|
-
classMeta
|
|
152
|
+
classMeta,
|
|
153
|
+
instantiate
|
|
133
154
|
}, "PROP");
|
|
134
155
|
},
|
|
135
156
|
storeProvideRegByInstance: true,
|
|
@@ -148,6 +169,7 @@ function getNewMoostInfact() {
|
|
|
148
169
|
if (!loggingOptions.error) return;
|
|
149
170
|
break;
|
|
150
171
|
}
|
|
172
|
+
default:
|
|
151
173
|
}
|
|
152
174
|
let logger;
|
|
153
175
|
try {
|
|
@@ -155,14 +177,14 @@ function getNewMoostInfact() {
|
|
|
155
177
|
} catch (error) {
|
|
156
178
|
logger = getDefaultLogger(INFACT_BANNER);
|
|
157
179
|
}
|
|
158
|
-
const instance =
|
|
180
|
+
const instance = `[4m${targetClass.name}[24m`;
|
|
159
181
|
switch (event) {
|
|
160
182
|
case "new-instance": {
|
|
161
183
|
const params = args?.map((a) => {
|
|
162
184
|
switch (typeof a) {
|
|
163
185
|
case "number":
|
|
164
|
-
case "boolean": return
|
|
165
|
-
case "string": return
|
|
186
|
+
case "boolean": return `[33m${a}[2m[34m`;
|
|
187
|
+
case "string": return `[92m"${a.slice(0, 1)}..."[2m[34m`;
|
|
166
188
|
case "object": {
|
|
167
189
|
if (Array.isArray(a)) return `[${a.length}]`;
|
|
168
190
|
if ((0, __prostojs_mate.getConstructor)(a)) return (0, __prostojs_mate.getConstructor)(a).name;
|
|
@@ -170,17 +192,17 @@ function getNewMoostInfact() {
|
|
|
170
192
|
}
|
|
171
193
|
default: return "*";
|
|
172
194
|
}
|
|
173
|
-
}).map((a) =>
|
|
174
|
-
logger.info(`new ${instance}
|
|
195
|
+
}).map((a) => `[2m[1m${a}[22m[2m`).join(", ") || "";
|
|
196
|
+
logger.info(`new ${instance}[2m[34m(${params})`);
|
|
175
197
|
break;
|
|
176
198
|
}
|
|
177
199
|
case "warn": {
|
|
178
|
-
const hier =
|
|
200
|
+
const hier = `[2m[34m⋱ ${args?.map(String).join(" → ") || ""}`;
|
|
179
201
|
logger.warn(`${instance} - ${message} ${hier}`);
|
|
180
202
|
break;
|
|
181
203
|
}
|
|
182
204
|
case "error": {
|
|
183
|
-
const hier =
|
|
205
|
+
const hier = `[2m[34m⋱ ${args?.map(String).join(" → ") || ""}`;
|
|
184
206
|
logger.error(`Failed to instantiate ${instance}. ${message} ${hier}`);
|
|
185
207
|
break;
|
|
186
208
|
}
|
|
@@ -188,6 +210,7 @@ function getNewMoostInfact() {
|
|
|
188
210
|
}
|
|
189
211
|
}
|
|
190
212
|
});
|
|
213
|
+
return infactInstance;
|
|
191
214
|
}
|
|
192
215
|
|
|
193
216
|
//#endregion
|
|
@@ -257,7 +280,7 @@ function defineMoostEventHandler(options) {
|
|
|
257
280
|
const interceptorHandler = await options.getIterceptorHandler();
|
|
258
281
|
if (interceptorHandler?.count) try {
|
|
259
282
|
response = await ci.with("Interceptors:init", () => interceptorHandler.init());
|
|
260
|
-
if (response !==
|
|
283
|
+
if (response !== void 0) return await endWithResponse();
|
|
261
284
|
} catch (error) {
|
|
262
285
|
options.logErrors && logger.error(error);
|
|
263
286
|
response = error;
|
|
@@ -273,7 +296,7 @@ function defineMoostEventHandler(options) {
|
|
|
273
296
|
}
|
|
274
297
|
if (interceptorHandler?.countBefore) {
|
|
275
298
|
response = await ci.with("Interceptors:before", () => interceptorHandler.fireBefore(response));
|
|
276
|
-
if (response !==
|
|
299
|
+
if (response !== void 0) return endWithResponse();
|
|
277
300
|
}
|
|
278
301
|
const callControllerMethod = () => {
|
|
279
302
|
if (options.callControllerMethod) return options.callControllerMethod(args);
|
|
@@ -342,7 +365,7 @@ async function getCallableFn(targetInstance, fn, pipes, logger) {
|
|
|
342
365
|
return (...args) => instance.handler(...args);
|
|
343
366
|
}
|
|
344
367
|
if (typeof fn === "function") return fn;
|
|
345
|
-
const e = new Error(`getCallableFn failed for "${(0, __prostojs_mate.getConstructor)(targetInstance).name}" because the passed arg is not a Function nor TClassFunction`);
|
|
368
|
+
const e = /* @__PURE__ */ new Error(`getCallableFn failed for "${(0, __prostojs_mate.getConstructor)(targetInstance).name}" because the passed arg is not a Function nor TClassFunction`);
|
|
346
369
|
logger.error(e);
|
|
347
370
|
throw e;
|
|
348
371
|
}
|
|
@@ -395,7 +418,7 @@ var InterceptorHandler = class {
|
|
|
395
418
|
fn
|
|
396
419
|
});
|
|
397
420
|
}));
|
|
398
|
-
if (response !==
|
|
421
|
+
if (response !== void 0) return response;
|
|
399
422
|
}
|
|
400
423
|
}
|
|
401
424
|
async fireBefore(response) {
|
|
@@ -491,18 +514,19 @@ async function bindControllerMethods(options) {
|
|
|
491
514
|
});
|
|
492
515
|
const resolveArgs = async () => {
|
|
493
516
|
const args = [];
|
|
494
|
-
for (const [i, { pipes: pipes$1, meta: paramMeta }] of argsPipes.entries()) args[i] = await runPipes(pipes$1,
|
|
517
|
+
for (const [i, { pipes: pipes$1, meta: paramMeta }] of argsPipes.entries()) args[i] = await runPipes(pipes$1, void 0, {
|
|
495
518
|
classMeta: meta,
|
|
496
519
|
methodMeta,
|
|
497
520
|
paramMeta,
|
|
498
521
|
type: classConstructor,
|
|
499
522
|
key: method,
|
|
500
523
|
index: i,
|
|
501
|
-
targetMeta: paramMeta
|
|
524
|
+
targetMeta: paramMeta,
|
|
525
|
+
instantiate: (t) => useControllerContext().instantiate(t)
|
|
502
526
|
}, "PARAM");
|
|
503
527
|
return args;
|
|
504
528
|
};
|
|
505
|
-
const wm = new WeakMap();
|
|
529
|
+
const wm = /* @__PURE__ */ new WeakMap();
|
|
506
530
|
controllerOverview.handlers.push(...methodMeta.handlers.map((h) => {
|
|
507
531
|
const data = {
|
|
508
532
|
meta: methodMeta,
|
|
@@ -546,22 +570,67 @@ function Circular(resolver) {
|
|
|
546
570
|
|
|
547
571
|
//#endregion
|
|
548
572
|
//#region packages/moost/src/decorators/common.decorator.ts
|
|
549
|
-
|
|
573
|
+
/**
|
|
574
|
+
* Apply Multiple Decorators
|
|
575
|
+
*
|
|
576
|
+
* @param decorators - array of decorators
|
|
577
|
+
* @returns
|
|
578
|
+
*/ function ApplyDecorators(...decorators) {
|
|
579
|
+
const mate$1 = getMoostMate();
|
|
580
|
+
return mate$1.apply(...decorators);
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* ## Label
|
|
584
|
+
* ### @Decorator
|
|
585
|
+
* _Common purpose decorator that may be used by various adapters for various purposes_
|
|
586
|
+
*
|
|
587
|
+
* Stores Label metadata
|
|
588
|
+
*/ function Label(value) {
|
|
550
589
|
return getMoostMate().decorate("label", value);
|
|
551
590
|
}
|
|
552
|
-
|
|
591
|
+
/**
|
|
592
|
+
* ## Description
|
|
593
|
+
* ### @Decorator
|
|
594
|
+
* _Common purpose decorator that may be used by various adapters for various purposes_
|
|
595
|
+
*
|
|
596
|
+
* Stores Description metadata
|
|
597
|
+
*/ function Description(value) {
|
|
553
598
|
return getMoostMate().decorate("description", value);
|
|
554
599
|
}
|
|
555
|
-
|
|
600
|
+
/**
|
|
601
|
+
* ## Value
|
|
602
|
+
* ### @Decorator
|
|
603
|
+
* _Common purpose decorator that may be used by various adapters for various purposes_
|
|
604
|
+
*
|
|
605
|
+
* Stores Value metadata
|
|
606
|
+
*/ function Value(value) {
|
|
556
607
|
return getMoostMate().decorate("value", value);
|
|
557
608
|
}
|
|
558
|
-
|
|
609
|
+
/**
|
|
610
|
+
* ## Id
|
|
611
|
+
* ### @Decorator
|
|
612
|
+
* _Common purpose decorator that may be used by various adapters for various purposes_
|
|
613
|
+
*
|
|
614
|
+
* Stores Id metadata
|
|
615
|
+
*/ function Id(value) {
|
|
559
616
|
return getMoostMate().decorate("id", value);
|
|
560
617
|
}
|
|
561
|
-
|
|
618
|
+
/**
|
|
619
|
+
* ## Optional
|
|
620
|
+
* ### @Decorator
|
|
621
|
+
* _Common purpose decorator that may be used by various adapters for various purposes_
|
|
622
|
+
*
|
|
623
|
+
* Stores Optional metadata
|
|
624
|
+
*/ function Optional() {
|
|
562
625
|
return getMoostMate().decorate("optional", true);
|
|
563
626
|
}
|
|
564
|
-
|
|
627
|
+
/**
|
|
628
|
+
* ## Required
|
|
629
|
+
* ### @Decorator
|
|
630
|
+
* _Common purpose decorator that may be used by various adapters for various purposes_
|
|
631
|
+
*
|
|
632
|
+
* Stores Required metadata
|
|
633
|
+
*/ function Required() {
|
|
565
634
|
const mate$1 = getMoostMate();
|
|
566
635
|
return mate$1.apply(mate$1.decorate("required", true), mate$1.decorateClass((meta, level, key, index) => {
|
|
567
636
|
if (typeof index !== "number" && meta && ["string", "symbol"].includes(typeof key)) {
|
|
@@ -574,7 +643,15 @@ function Required() {
|
|
|
574
643
|
|
|
575
644
|
//#endregion
|
|
576
645
|
//#region packages/moost/src/decorators/injectable.decorator.ts
|
|
577
|
-
|
|
646
|
+
/**
|
|
647
|
+
* ## Injectable
|
|
648
|
+
* ### @Decorator
|
|
649
|
+
* Mark the Class as Injectable to enable it to be used in dependency injection
|
|
650
|
+
* @param scope - Scope for injection ("FOR_EVENT" | "SINGLETON" | true)
|
|
651
|
+
* FOR_EVENT - will create a new instance for each incoming request
|
|
652
|
+
* SINGLETON | true - will create a new instance only once
|
|
653
|
+
* @param label - field label
|
|
654
|
+
*/ function Injectable(scope = true) {
|
|
578
655
|
return getMoostMate().decorate("injectable", scope);
|
|
579
656
|
}
|
|
580
657
|
const insureInjectable = getMoostMate().decorate((meta) => {
|
|
@@ -584,25 +661,35 @@ const insureInjectable = getMoostMate().decorate((meta) => {
|
|
|
584
661
|
|
|
585
662
|
//#endregion
|
|
586
663
|
//#region packages/moost/src/decorators/controller.decorator.ts
|
|
587
|
-
|
|
664
|
+
/**
|
|
665
|
+
* ## Controller
|
|
666
|
+
* ### @Decorator
|
|
667
|
+
* Set Class as a Controller
|
|
668
|
+
* @param prefix - define the prefix for all the paths of this controller
|
|
669
|
+
*/ function Controller(prefix) {
|
|
588
670
|
const mate$1 = getMoostMate();
|
|
589
671
|
return mate$1.apply(insureInjectable, mate$1.decorate("controller", { prefix: prefix || "" }));
|
|
590
672
|
}
|
|
591
673
|
function ImportController(prefix, controller, provide) {
|
|
592
674
|
return getMoostMate().decorate("importController", {
|
|
593
|
-
prefix: typeof prefix === "string" ? prefix :
|
|
675
|
+
prefix: typeof prefix === "string" ? prefix : void 0,
|
|
594
676
|
typeResolver: typeof prefix === "string" ? controller : prefix,
|
|
595
|
-
provide: typeof prefix === "string" ? provide ||
|
|
677
|
+
provide: typeof prefix === "string" ? provide || void 0 : controller || void 0
|
|
596
678
|
}, true);
|
|
597
679
|
}
|
|
598
680
|
|
|
599
681
|
//#endregion
|
|
600
682
|
//#region packages/moost/src/decorators/inherit.decorator.ts
|
|
601
|
-
|
|
683
|
+
/**
|
|
684
|
+
* ## Inherit
|
|
685
|
+
* ### @Decorator
|
|
686
|
+
* Inherit metadata from super class
|
|
687
|
+
* @returns
|
|
688
|
+
*/ const Inherit = () => getMoostMate().decorate("inherit", true);
|
|
602
689
|
|
|
603
690
|
//#endregion
|
|
604
691
|
//#region packages/moost/src/decorators/intercept.decorator.ts
|
|
605
|
-
var TInterceptorPriority =
|
|
692
|
+
var TInterceptorPriority = /* @__PURE__ */ function(TInterceptorPriority$1) {
|
|
606
693
|
TInterceptorPriority$1[TInterceptorPriority$1["BEFORE_ALL"] = 0] = "BEFORE_ALL";
|
|
607
694
|
TInterceptorPriority$1[TInterceptorPriority$1["BEFORE_GUARD"] = 1] = "BEFORE_GUARD";
|
|
608
695
|
TInterceptorPriority$1[TInterceptorPriority$1["GUARD"] = 2] = "GUARD";
|
|
@@ -612,7 +699,14 @@ var TInterceptorPriority = /*#__PURE__*/ function(TInterceptorPriority$1) {
|
|
|
612
699
|
TInterceptorPriority$1[TInterceptorPriority$1["AFTER_ALL"] = 6] = "AFTER_ALL";
|
|
613
700
|
return TInterceptorPriority$1;
|
|
614
701
|
}({});
|
|
615
|
-
|
|
702
|
+
/**
|
|
703
|
+
* ## Intercept
|
|
704
|
+
* ### @Decorator
|
|
705
|
+
* Set interceptor
|
|
706
|
+
* @param handler interceptor fn (use defineInterceptorFn)
|
|
707
|
+
* @param priority interceptor priority
|
|
708
|
+
* @returns
|
|
709
|
+
*/ function Intercept(handler, priority, name) {
|
|
616
710
|
return getMoostMate().decorate("interceptors", {
|
|
617
711
|
handler,
|
|
618
712
|
priority: priority || handler.priority || 4,
|
|
@@ -622,9 +716,15 @@ function Intercept(handler, priority, name) {
|
|
|
622
716
|
|
|
623
717
|
//#endregion
|
|
624
718
|
//#region packages/moost/src/decorators/resolve.decorator.ts
|
|
625
|
-
|
|
719
|
+
/**
|
|
720
|
+
* Hook to the Response Status
|
|
721
|
+
* @decorator
|
|
722
|
+
* @param resolver - resolver function
|
|
723
|
+
* @param label - field label
|
|
724
|
+
* @paramType unknown
|
|
725
|
+
*/ function Resolve(resolver, label) {
|
|
626
726
|
return (target, key, index) => {
|
|
627
|
-
const i = typeof index === "number" ? index :
|
|
727
|
+
const i = typeof index === "number" ? index : void 0;
|
|
628
728
|
getMoostMate().decorate("resolver", (metas, level) => {
|
|
629
729
|
let newLabel = label;
|
|
630
730
|
if (!newLabel && level === "PROP" && typeof metas.key === "string") newLabel = metas.key;
|
|
@@ -633,16 +733,37 @@ function Resolve(resolver, label) {
|
|
|
633
733
|
})(target, key, i);
|
|
634
734
|
};
|
|
635
735
|
}
|
|
636
|
-
|
|
736
|
+
/**
|
|
737
|
+
* Get Param Value from url parh
|
|
738
|
+
* @decorator
|
|
739
|
+
* @param name - param name
|
|
740
|
+
* @paramType string
|
|
741
|
+
*/ function Param(name) {
|
|
637
742
|
return getMoostMate().apply(getMoostMate().decorate("paramSource", "ROUTE"), getMoostMate().decorate("paramName", name), Resolve(() => (0, __wooksjs_event_core.useRouteParams)().get(name), name));
|
|
638
743
|
}
|
|
639
|
-
|
|
744
|
+
/**
|
|
745
|
+
* Get Parsed Params from url parh
|
|
746
|
+
* @decorator
|
|
747
|
+
* @paramType object
|
|
748
|
+
*/ function Params() {
|
|
640
749
|
return Resolve(() => (0, __wooksjs_event_core.useRouteParams)().params, "params");
|
|
641
750
|
}
|
|
642
|
-
|
|
751
|
+
/**
|
|
752
|
+
* Provide Const Value
|
|
753
|
+
* @decorator
|
|
754
|
+
* @param value - provided value
|
|
755
|
+
* @param label - label of the field
|
|
756
|
+
* @paramType unknown
|
|
757
|
+
*/ function Const(value, label) {
|
|
643
758
|
return Resolve(() => value, label);
|
|
644
759
|
}
|
|
645
|
-
|
|
760
|
+
/**
|
|
761
|
+
* Provide Const Value from Factory fn
|
|
762
|
+
* @decorator
|
|
763
|
+
* @param factory - value Factory fn
|
|
764
|
+
* @param label - label of the field
|
|
765
|
+
* @paramType unknown
|
|
766
|
+
*/ function ConstFactory(factory, label) {
|
|
646
767
|
return Resolve(async () => factory(), label);
|
|
647
768
|
}
|
|
648
769
|
function fillLabel(target, key, index, name) {
|
|
@@ -656,10 +777,18 @@ function fillLabel(target, key, index, name) {
|
|
|
656
777
|
|
|
657
778
|
//#endregion
|
|
658
779
|
//#region packages/moost/src/decorators/logger.decorator.ts
|
|
659
|
-
|
|
780
|
+
/**
|
|
781
|
+
* Resolves event logger from event context
|
|
782
|
+
* @param topic
|
|
783
|
+
* @returns Resolver to '@wooksjs/event-core' (EventLogger)
|
|
784
|
+
*/ function InjectEventLogger(topic) {
|
|
660
785
|
return Resolve(() => (0, __wooksjs_event_core.useEventLogger)(topic));
|
|
661
786
|
}
|
|
662
|
-
|
|
787
|
+
/**
|
|
788
|
+
* Resolves app-level logger
|
|
789
|
+
* @param topic - logger topic (can be overrided by @LoggerTopic)
|
|
790
|
+
* @returns
|
|
791
|
+
*/ function InjectMoostLogger(topic) {
|
|
663
792
|
return Resolve(async (metas) => {
|
|
664
793
|
const { instantiate, getController } = useControllerContext();
|
|
665
794
|
const controller = getController();
|
|
@@ -668,13 +797,17 @@ function InjectMoostLogger(topic) {
|
|
|
668
797
|
return moostApp.getLogger(meta?.loggerTopic || topic || meta?.id);
|
|
669
798
|
});
|
|
670
799
|
}
|
|
671
|
-
|
|
800
|
+
/**
|
|
801
|
+
* Sets logger topic (used in @InjectMoostLogger)
|
|
802
|
+
* @param topic - logger topic (banner)
|
|
803
|
+
* @returns
|
|
804
|
+
*/ function LoggerTopic(topic) {
|
|
672
805
|
return getMoostMate().decorate("loggerTopic", topic);
|
|
673
806
|
}
|
|
674
807
|
|
|
675
808
|
//#endregion
|
|
676
809
|
//#region packages/moost/src/pipes/types.ts
|
|
677
|
-
var TPipePriority =
|
|
810
|
+
var TPipePriority = /* @__PURE__ */ function(TPipePriority$1) {
|
|
678
811
|
TPipePriority$1[TPipePriority$1["BEFORE_RESOLVE"] = 0] = "BEFORE_RESOLVE";
|
|
679
812
|
TPipePriority$1[TPipePriority$1["RESOLVE"] = 1] = "RESOLVE";
|
|
680
813
|
TPipePriority$1[TPipePriority$1["AFTER_RESOLVE"] = 2] = "AFTER_RESOLVE";
|
|
@@ -689,7 +822,14 @@ var TPipePriority = /*#__PURE__*/ function(TPipePriority$1) {
|
|
|
689
822
|
|
|
690
823
|
//#endregion
|
|
691
824
|
//#region packages/moost/src/decorators/pipe.decorator.ts
|
|
692
|
-
|
|
825
|
+
/**
|
|
826
|
+
* ## Pipe
|
|
827
|
+
* ### @Decorator
|
|
828
|
+
* Attach pipe
|
|
829
|
+
* @param handler pipe handler
|
|
830
|
+
* @param priority pipe priority
|
|
831
|
+
* @returns
|
|
832
|
+
*/ function Pipe(handler, priority) {
|
|
693
833
|
if (typeof priority !== "number") priority = typeof handler.priority === "number" ? handler.priority : TPipePriority.TRANSFORM;
|
|
694
834
|
return getMoostMate().decorate("pipes", {
|
|
695
835
|
handler,
|
|
@@ -699,40 +839,104 @@ function Pipe(handler, priority) {
|
|
|
699
839
|
|
|
700
840
|
//#endregion
|
|
701
841
|
//#region packages/moost/src/decorators/provide.decorator.ts
|
|
702
|
-
|
|
842
|
+
/**
|
|
843
|
+
* ## Provide
|
|
844
|
+
* ### @Decorator
|
|
845
|
+
* Defines provide registry for class (and all the children)
|
|
846
|
+
* @param type - string or class constructor
|
|
847
|
+
* @param fn - factory function for provided value
|
|
848
|
+
*/ function Provide(type, fn) {
|
|
703
849
|
return getMoostMate().decorate((meta) => {
|
|
704
850
|
meta.provide = meta.provide || {};
|
|
705
851
|
Object.assign(meta.provide, (0, __prostojs_infact.createProvideRegistry)([type, fn]));
|
|
706
852
|
return meta;
|
|
707
853
|
});
|
|
708
854
|
}
|
|
709
|
-
|
|
855
|
+
/**
|
|
856
|
+
* ## Replace
|
|
857
|
+
* ### @Decorator
|
|
858
|
+
* Defines class to replace in DI
|
|
859
|
+
* @param type - class to replace
|
|
860
|
+
* @param newType - new class
|
|
861
|
+
*/ function Replace(type, newType) {
|
|
710
862
|
return getMoostMate().decorate((meta) => {
|
|
711
863
|
meta.replace = meta.replace || {};
|
|
712
864
|
Object.assign(meta.replace, (0, __prostojs_infact.createReplaceRegistry)([type, newType]));
|
|
713
865
|
return meta;
|
|
714
866
|
});
|
|
715
867
|
}
|
|
716
|
-
|
|
868
|
+
/**
|
|
869
|
+
* ## Inject
|
|
870
|
+
* ### @Decorator
|
|
871
|
+
* Defines a key from provide registry to inject value
|
|
872
|
+
* (For optional values use with @Optional())
|
|
873
|
+
* @param type - string or class constructor
|
|
874
|
+
*/ function Inject(type) {
|
|
717
875
|
return getMoostMate().decorate("inject", type);
|
|
718
876
|
}
|
|
719
|
-
|
|
877
|
+
/**
|
|
878
|
+
* Injects instance from scope
|
|
879
|
+
*
|
|
880
|
+
* (scope must be defined by `defineInfactScope` fn)
|
|
881
|
+
* @param name scope name
|
|
882
|
+
*/ function InjectFromScope(name) {
|
|
720
883
|
return getMoostMate().decorate("fromScope", name);
|
|
721
884
|
}
|
|
722
|
-
|
|
885
|
+
/**
|
|
886
|
+
* Inject vars from scope for instances
|
|
887
|
+
* instantiated with `@InjectFromScope` decorator
|
|
888
|
+
*/ function InjectScopeVars(name) {
|
|
723
889
|
return Resolve(({ scopeId }) => {
|
|
724
890
|
if (scopeId) return name ? getInfactScopeVars(scopeId)?.[name] : getInfactScopeVars(scopeId);
|
|
725
|
-
return
|
|
891
|
+
return void 0;
|
|
726
892
|
});
|
|
727
893
|
}
|
|
728
894
|
|
|
729
895
|
//#endregion
|
|
730
896
|
//#region packages/moost/src/define.ts
|
|
731
|
-
|
|
897
|
+
/**
|
|
898
|
+
* ### Define Interceptor Function
|
|
899
|
+
*
|
|
900
|
+
* ```ts
|
|
901
|
+
* defineInterceptorFn((before, after, onError) => {
|
|
902
|
+
* //init
|
|
903
|
+
* before(() => {
|
|
904
|
+
* // before handler
|
|
905
|
+
* })
|
|
906
|
+
* after((response, reply) => {
|
|
907
|
+
* // after handler
|
|
908
|
+
* })
|
|
909
|
+
* onError((error, reply) => {
|
|
910
|
+
* // when error occured
|
|
911
|
+
* })
|
|
912
|
+
* },
|
|
913
|
+
* TInterceptorPriority.INTERCEPTOR,
|
|
914
|
+
* )
|
|
915
|
+
* ```
|
|
916
|
+
*
|
|
917
|
+
* @param fn interceptor function
|
|
918
|
+
* @param priority priority of the interceptor where BEFORE_ALL = 0, BEFORE_GUARD = 1, GUARD = 2, AFTER_GUARD = 3, INTERCEPTOR = 4, CATCH_ERROR = 5, AFTER_ALL = 6
|
|
919
|
+
* @returns
|
|
920
|
+
*/ function defineInterceptorFn(fn, priority = TInterceptorPriority.INTERCEPTOR) {
|
|
732
921
|
fn.priority = priority;
|
|
733
922
|
return fn;
|
|
734
923
|
}
|
|
735
|
-
|
|
924
|
+
/**
|
|
925
|
+
* ### Define Pipe Function
|
|
926
|
+
*
|
|
927
|
+
* ```ts
|
|
928
|
+
* // example of a transform pipe
|
|
929
|
+
* const uppercaseTransformPipe = definePipeFn((value, metas, level) => {
|
|
930
|
+
* return typeof value === 'string' ? value.toUpperCase() : value
|
|
931
|
+
* },
|
|
932
|
+
* TPipePriority.TRANSFORM,
|
|
933
|
+
* )
|
|
934
|
+
* ```
|
|
935
|
+
*
|
|
936
|
+
* @param fn interceptor function
|
|
937
|
+
* @param priority priority of the pipe where BEFORE_RESOLVE = 0, RESOLVE = 1, AFTER_RESOLVE = 2, BEFORE_TRANSFORM = 3, TRANSFORM = 4, AFTER_TRANSFORM = 5, BEFORE_VALIDATE = 6, VALIDATE = 7, AFTER_VALIDATE = 8
|
|
938
|
+
* @returns
|
|
939
|
+
*/ function definePipeFn(fn, priority = TPipePriority.TRANSFORM) {
|
|
736
940
|
fn.priority = priority;
|
|
737
941
|
return fn;
|
|
738
942
|
}
|
|
@@ -742,7 +946,7 @@ function definePipeFn(fn, priority = TPipePriority.TRANSFORM) {
|
|
|
742
946
|
const resolvePipe = definePipeFn((_value, metas, level) => {
|
|
743
947
|
const resolver = metas.targetMeta?.resolver;
|
|
744
948
|
if (resolver) return resolver(metas, level);
|
|
745
|
-
return
|
|
949
|
+
return void 0;
|
|
746
950
|
}, TPipePriority.RESOLVE);
|
|
747
951
|
|
|
748
952
|
//#endregion
|
|
@@ -764,7 +968,56 @@ function _define_property(obj, key, value) {
|
|
|
764
968
|
else obj[key] = value;
|
|
765
969
|
return obj;
|
|
766
970
|
}
|
|
767
|
-
|
|
971
|
+
/**
|
|
972
|
+
* ## Moost
|
|
973
|
+
* Main moostjs class that serves as a shell for Moost Adapters
|
|
974
|
+
*
|
|
975
|
+
* ### Usage with HTTP Adapter
|
|
976
|
+
* ```ts
|
|
977
|
+
* │ // HTTP server example
|
|
978
|
+
* │ import { MoostHttp, Get } from '@moostjs/event-http'
|
|
979
|
+
* │ import { Moost, Param } from 'moost'
|
|
980
|
+
* │
|
|
981
|
+
* │ class MyServer extends Moost {
|
|
982
|
+
* │ @Get('test/:name')
|
|
983
|
+
* │ test(@Param('name') name: string) {
|
|
984
|
+
* │ return { message: `Hello ${name}!` }
|
|
985
|
+
* │ }
|
|
986
|
+
* │ }
|
|
987
|
+
* │
|
|
988
|
+
* │ const app = new MyServer()
|
|
989
|
+
* │ const http = new MoostHttp()
|
|
990
|
+
* │ app.adapter(http).listen(3000, () => {
|
|
991
|
+
* │ app.getLogger('MyApp').log('Up on port 3000')
|
|
992
|
+
* │ })
|
|
993
|
+
* │ app.init()
|
|
994
|
+
* ```
|
|
995
|
+
* ### Usage with CLI Adapter
|
|
996
|
+
* ```ts
|
|
997
|
+
* │ // CLI example
|
|
998
|
+
* │ import { MoostCli, Cli, CliOption, cliHelpInterceptor } from '@moostjs/event-cli'
|
|
999
|
+
* │ import { Moost, Param } from 'moost'
|
|
1000
|
+
* │
|
|
1001
|
+
* │ class MyApp extends Moost {
|
|
1002
|
+
* │ @Cli('command/:arg')
|
|
1003
|
+
* │ command(
|
|
1004
|
+
* │ @Param('arg')
|
|
1005
|
+
* │ arg: string,
|
|
1006
|
+
* │ @CliOption('test', 't')
|
|
1007
|
+
* │ test: boolean,
|
|
1008
|
+
* │ ) {
|
|
1009
|
+
* │ return `command run with flag arg=${ arg }, test=${ test }`
|
|
1010
|
+
* │ }
|
|
1011
|
+
* │ }
|
|
1012
|
+
* │
|
|
1013
|
+
* │ const app = new MyApp()
|
|
1014
|
+
* │ app.applyGlobalInterceptors(cliHelpInterceptor())
|
|
1015
|
+
* │
|
|
1016
|
+
* │ const cli = new MoostCli()
|
|
1017
|
+
* │ app.adapter(cli)
|
|
1018
|
+
* │ app.init()
|
|
1019
|
+
* ```
|
|
1020
|
+
*/ var Moost = class Moost extends hookable.Hookable {
|
|
768
1021
|
_fireEventStart(source) {
|
|
769
1022
|
this.callHook("event-start", source);
|
|
770
1023
|
}
|
|
@@ -879,17 +1132,10 @@ var Moost = class Moost extends hookable.Hookable {
|
|
|
879
1132
|
for (const ic of classMeta.importController) if (ic.typeResolver) {
|
|
880
1133
|
const isConstr = (0, __prostojs_mate.isConstructor)(ic.typeResolver);
|
|
881
1134
|
const isFunc = typeof ic.typeResolver === "function";
|
|
882
|
-
await this.bindController(
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
...mergedProvide,
|
|
887
|
-
...ic.provide
|
|
888
|
-
} : mergedProvide,
|
|
889
|
-
mergedReplace,
|
|
890
|
-
`${globalPrefix}/${prefix || ""}`,
|
|
891
|
-
ic.prefix
|
|
892
|
-
);
|
|
1135
|
+
await this.bindController(isConstr ? ic.typeResolver : isFunc ? await ic.typeResolver() : ic.typeResolver, ic.provide ? {
|
|
1136
|
+
...mergedProvide,
|
|
1137
|
+
...ic.provide
|
|
1138
|
+
} : mergedProvide, mergedReplace, `${globalPrefix}/${prefix || ""}`, ic.prefix);
|
|
893
1139
|
}
|
|
894
1140
|
}
|
|
895
1141
|
}
|
|
@@ -902,7 +1148,7 @@ var Moost = class Moost extends hookable.Hookable {
|
|
|
902
1148
|
handler: item.handler,
|
|
903
1149
|
priority: item.priority
|
|
904
1150
|
});
|
|
905
|
-
this.globalInterceptorHandler =
|
|
1151
|
+
this.globalInterceptorHandler = void 0;
|
|
906
1152
|
return this;
|
|
907
1153
|
}
|
|
908
1154
|
/**
|
|
@@ -931,7 +1177,7 @@ var Moost = class Moost extends hookable.Hookable {
|
|
|
931
1177
|
priority: item.priority,
|
|
932
1178
|
name: item.name || item.handler._name || item.handler.name || "<anonymous>"
|
|
933
1179
|
});
|
|
934
|
-
this.globalInterceptorHandler =
|
|
1180
|
+
this.globalInterceptorHandler = void 0;
|
|
935
1181
|
return this;
|
|
936
1182
|
}
|
|
937
1183
|
/**
|
|
@@ -967,11 +1213,11 @@ var Moost = class Moost extends hookable.Hookable {
|
|
|
967
1213
|
logMappedHandler(eventName, classConstructor, method, stroke, prefix) {
|
|
968
1214
|
const c = stroke ? "\x1B[9m" : "";
|
|
969
1215
|
const coff = stroke ? "\x1B[29m" : "";
|
|
970
|
-
this.logger.info(`${prefix || ""}${c}${eventName} ${"\x1B[0m\x1B[2m\x1B[32m" + c}→ ${classConstructor.name}.${"\x1B[36m" + c}${method}
|
|
1216
|
+
this.logger.info(`${prefix || ""}${c}${eventName} ${"\x1B[0m\x1B[2m\x1B[32m" + c}→ ${classConstructor.name}.${"\x1B[36m" + c}${method}[32m()${coff}`);
|
|
971
1217
|
}
|
|
972
1218
|
constructor(options) {
|
|
973
1219
|
super(), _define_property(this, "options", void 0), _define_property(this, "logger", void 0), _define_property(this, "pipes", void 0), _define_property(this, "interceptors", void 0), _define_property(this, "adapters", void 0), _define_property(this, "controllersOverview", void 0), _define_property(this, "provide", void 0), _define_property(this, "replace", void 0), _define_property(this, "unregisteredControllers", void 0), _define_property(this, "globalInterceptorHandler", void 0), this.options = options, this.pipes = Array.from(sharedPipes), this.interceptors = [], this.adapters = [], this.controllersOverview = [], this.provide = (0, __prostojs_infact.createProvideRegistry)([__prostojs_infact.Infact, getMoostInfact], [__prostojs_mate.Mate, getMoostMate]), this.replace = {}, this.unregisteredControllers = [];
|
|
974
|
-
this.logger = options?.logger || getDefaultLogger(
|
|
1220
|
+
this.logger = options?.logger || getDefaultLogger(`[2m[35mmoost`);
|
|
975
1221
|
setDefaultLogger(this.logger);
|
|
976
1222
|
const mate$1 = getMoostMate();
|
|
977
1223
|
Object.assign(mate$1, { logger: this.getLogger("mate") });
|
|
@@ -979,60 +1225,62 @@ var Moost = class Moost extends hookable.Hookable {
|
|
|
979
1225
|
};
|
|
980
1226
|
|
|
981
1227
|
//#endregion
|
|
982
|
-
exports.
|
|
983
|
-
exports.
|
|
984
|
-
exports.
|
|
1228
|
+
exports.ApplyDecorators = ApplyDecorators;
|
|
1229
|
+
exports.Circular = Circular;
|
|
1230
|
+
exports.Const = Const;
|
|
1231
|
+
exports.ConstFactory = ConstFactory;
|
|
985
1232
|
Object.defineProperty(exports, 'ContextInjector', {
|
|
986
1233
|
enumerable: true,
|
|
987
1234
|
get: function () {
|
|
988
1235
|
return __wooksjs_event_core.ContextInjector;
|
|
989
1236
|
}
|
|
990
1237
|
});
|
|
991
|
-
exports.Controller = Controller
|
|
992
|
-
exports.Description = Description
|
|
1238
|
+
exports.Controller = Controller;
|
|
1239
|
+
exports.Description = Description;
|
|
993
1240
|
Object.defineProperty(exports, 'EventLogger', {
|
|
994
1241
|
enumerable: true,
|
|
995
1242
|
get: function () {
|
|
996
1243
|
return __wooksjs_event_core.EventLogger;
|
|
997
1244
|
}
|
|
998
1245
|
});
|
|
999
|
-
exports.Id = Id
|
|
1000
|
-
exports.ImportController = ImportController
|
|
1001
|
-
exports.Inherit = Inherit
|
|
1002
|
-
exports.Inject = Inject
|
|
1003
|
-
exports.InjectEventLogger = InjectEventLogger
|
|
1004
|
-
exports.InjectFromScope = InjectFromScope
|
|
1005
|
-
exports.InjectMoostLogger = InjectMoostLogger
|
|
1006
|
-
exports.InjectScopeVars = InjectScopeVars
|
|
1007
|
-
exports.Injectable = Injectable
|
|
1008
|
-
exports.Intercept = Intercept
|
|
1009
|
-
exports.InterceptorHandler = InterceptorHandler
|
|
1010
|
-
exports.Label = Label
|
|
1011
|
-
exports.LoggerTopic = LoggerTopic
|
|
1012
|
-
exports.Moost = Moost
|
|
1013
|
-
exports.Optional = Optional
|
|
1014
|
-
exports.Param = Param
|
|
1015
|
-
exports.Params = Params
|
|
1016
|
-
exports.Pipe = Pipe
|
|
1246
|
+
exports.Id = Id;
|
|
1247
|
+
exports.ImportController = ImportController;
|
|
1248
|
+
exports.Inherit = Inherit;
|
|
1249
|
+
exports.Inject = Inject;
|
|
1250
|
+
exports.InjectEventLogger = InjectEventLogger;
|
|
1251
|
+
exports.InjectFromScope = InjectFromScope;
|
|
1252
|
+
exports.InjectMoostLogger = InjectMoostLogger;
|
|
1253
|
+
exports.InjectScopeVars = InjectScopeVars;
|
|
1254
|
+
exports.Injectable = Injectable;
|
|
1255
|
+
exports.Intercept = Intercept;
|
|
1256
|
+
exports.InterceptorHandler = InterceptorHandler;
|
|
1257
|
+
exports.Label = Label;
|
|
1258
|
+
exports.LoggerTopic = LoggerTopic;
|
|
1259
|
+
exports.Moost = Moost;
|
|
1260
|
+
exports.Optional = Optional;
|
|
1261
|
+
exports.Param = Param;
|
|
1262
|
+
exports.Params = Params;
|
|
1263
|
+
exports.Pipe = Pipe;
|
|
1017
1264
|
Object.defineProperty(exports, 'ProstoLogger', {
|
|
1018
1265
|
enumerable: true,
|
|
1019
1266
|
get: function () {
|
|
1020
1267
|
return __prostojs_logger.ProstoLogger;
|
|
1021
1268
|
}
|
|
1022
1269
|
});
|
|
1023
|
-
exports.Provide = Provide
|
|
1024
|
-
exports.Replace = Replace
|
|
1025
|
-
exports.Required = Required
|
|
1026
|
-
exports.Resolve = Resolve
|
|
1027
|
-
exports.TInterceptorPriority = TInterceptorPriority
|
|
1028
|
-
exports.TPipePriority = TPipePriority
|
|
1029
|
-
exports.Value = Value
|
|
1270
|
+
exports.Provide = Provide;
|
|
1271
|
+
exports.Replace = Replace;
|
|
1272
|
+
exports.Required = Required;
|
|
1273
|
+
exports.Resolve = Resolve;
|
|
1274
|
+
exports.TInterceptorPriority = TInterceptorPriority;
|
|
1275
|
+
exports.TPipePriority = TPipePriority;
|
|
1276
|
+
exports.Value = Value;
|
|
1030
1277
|
Object.defineProperty(exports, 'clearGlobalWooks', {
|
|
1031
1278
|
enumerable: true,
|
|
1032
1279
|
get: function () {
|
|
1033
1280
|
return wooks.clearGlobalWooks;
|
|
1034
1281
|
}
|
|
1035
1282
|
});
|
|
1283
|
+
exports.createLogger = createLogger;
|
|
1036
1284
|
Object.defineProperty(exports, 'createProvideRegistry', {
|
|
1037
1285
|
enumerable: true,
|
|
1038
1286
|
get: function () {
|
|
@@ -1045,10 +1293,10 @@ Object.defineProperty(exports, 'createReplaceRegistry', {
|
|
|
1045
1293
|
return __prostojs_infact.createReplaceRegistry;
|
|
1046
1294
|
}
|
|
1047
1295
|
});
|
|
1048
|
-
exports.defineInfactScope = defineInfactScope
|
|
1049
|
-
exports.defineInterceptorFn = defineInterceptorFn
|
|
1050
|
-
exports.defineMoostEventHandler = defineMoostEventHandler
|
|
1051
|
-
exports.definePipeFn = definePipeFn
|
|
1296
|
+
exports.defineInfactScope = defineInfactScope;
|
|
1297
|
+
exports.defineInterceptorFn = defineInterceptorFn;
|
|
1298
|
+
exports.defineMoostEventHandler = defineMoostEventHandler;
|
|
1299
|
+
exports.definePipeFn = definePipeFn;
|
|
1052
1300
|
Object.defineProperty(exports, 'getConstructor', {
|
|
1053
1301
|
enumerable: true,
|
|
1054
1302
|
get: function () {
|
|
@@ -1067,35 +1315,36 @@ Object.defineProperty(exports, 'getGlobalWooks', {
|
|
|
1067
1315
|
return wooks.getGlobalWooks;
|
|
1068
1316
|
}
|
|
1069
1317
|
});
|
|
1070
|
-
exports.getInfactScopeVars = getInfactScopeVars
|
|
1071
|
-
exports.getInstanceOwnMethods = getInstanceOwnMethods
|
|
1072
|
-
exports.getInstanceOwnProps = getInstanceOwnProps
|
|
1073
|
-
exports.getMoostInfact = getMoostInfact
|
|
1074
|
-
exports.getMoostMate = getMoostMate
|
|
1075
|
-
exports.getNewMoostInfact = getNewMoostInfact
|
|
1318
|
+
exports.getInfactScopeVars = getInfactScopeVars;
|
|
1319
|
+
exports.getInstanceOwnMethods = getInstanceOwnMethods;
|
|
1320
|
+
exports.getInstanceOwnProps = getInstanceOwnProps;
|
|
1321
|
+
exports.getMoostInfact = getMoostInfact;
|
|
1322
|
+
exports.getMoostMate = getMoostMate;
|
|
1323
|
+
exports.getNewMoostInfact = getNewMoostInfact;
|
|
1076
1324
|
Object.defineProperty(exports, 'isConstructor', {
|
|
1077
1325
|
enumerable: true,
|
|
1078
1326
|
get: function () {
|
|
1079
1327
|
return __prostojs_mate.isConstructor;
|
|
1080
1328
|
}
|
|
1081
1329
|
});
|
|
1082
|
-
exports.
|
|
1330
|
+
exports.loggerConsoleTransport = loggerConsoleTransport;
|
|
1331
|
+
exports.registerEventScope = registerEventScope;
|
|
1083
1332
|
Object.defineProperty(exports, 'replaceContextInjector', {
|
|
1084
1333
|
enumerable: true,
|
|
1085
1334
|
get: function () {
|
|
1086
1335
|
return __wooksjs_event_core.replaceContextInjector;
|
|
1087
1336
|
}
|
|
1088
1337
|
});
|
|
1089
|
-
exports.resolvePipe = resolvePipe
|
|
1090
|
-
exports.setControllerContext = setControllerContext
|
|
1091
|
-
exports.setInfactLoggingOptions = setInfactLoggingOptions
|
|
1338
|
+
exports.resolvePipe = resolvePipe;
|
|
1339
|
+
exports.setControllerContext = setControllerContext;
|
|
1340
|
+
exports.setInfactLoggingOptions = setInfactLoggingOptions;
|
|
1092
1341
|
Object.defineProperty(exports, 'useAsyncEventContext', {
|
|
1093
1342
|
enumerable: true,
|
|
1094
1343
|
get: function () {
|
|
1095
1344
|
return __wooksjs_event_core.useAsyncEventContext;
|
|
1096
1345
|
}
|
|
1097
1346
|
});
|
|
1098
|
-
exports.useControllerContext = useControllerContext
|
|
1347
|
+
exports.useControllerContext = useControllerContext;
|
|
1099
1348
|
Object.defineProperty(exports, 'useEventLogger', {
|
|
1100
1349
|
enumerable: true,
|
|
1101
1350
|
get: function () {
|