@navios/core 0.1.2 → 0.1.4
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.d.mts +54 -13
- package/dist/index.d.ts +54 -13
- package/dist/index.js +336 -203
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +336 -209
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/config/config.provider.mts +10 -20
- package/src/decorators/endpoint.decorator.mts +7 -2
- package/src/decorators/header.decorator.mts +18 -0
- package/src/decorators/http-code.decorator.mts +18 -0
- package/src/decorators/index.mts +2 -0
- package/src/logger/logger.service.mts +0 -1
- package/src/logger/pino-wrapper.mts +6 -5
- package/src/metadata/endpoint.metadata.mts +13 -0
- package/src/navios.application.mts +36 -1
- package/src/service-locator/__tests__/injectable.spec.mts +2 -1
- package/src/service-locator/__tests__/injection-token.spec.mts +124 -0
- package/src/service-locator/decorators/get-injectable-token.mts +2 -6
- package/src/service-locator/decorators/injectable.decorator.mts +7 -46
- package/src/service-locator/errors/errors.enum.mts +1 -0
- package/src/service-locator/errors/factory-token-not-resolved.mts +10 -0
- package/src/service-locator/errors/index.mts +1 -0
- package/src/service-locator/index.mts +1 -0
- package/src/service-locator/inject.mts +4 -18
- package/src/service-locator/injection-token.mts +57 -6
- package/src/service-locator/resolve-service.mts +46 -0
- package/src/service-locator/service-locator.mts +87 -35
- package/src/service-locator/sync-injector.mts +0 -8
- package/src/services/controller-adapter.service.mts +116 -71
package/dist/index.mjs
CHANGED
|
@@ -57,7 +57,7 @@ function envString(key, defaultValue) {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
// packages/core/src/config/config.provider.mts
|
|
60
|
-
import { z as
|
|
60
|
+
import { z as z3 } from "zod";
|
|
61
61
|
|
|
62
62
|
// packages/core/src/logger/utils/cli-colors.util.mts
|
|
63
63
|
var isColorAllowed = () => !process.env.NO_COLOR;
|
|
@@ -157,6 +157,9 @@ var isSymbol = (val) => typeof val === "symbol";
|
|
|
157
157
|
// packages/core/src/logger/console-logger.service.mts
|
|
158
158
|
import { inspect } from "util";
|
|
159
159
|
|
|
160
|
+
// packages/core/src/service-locator/decorators/injectable.decorator.mts
|
|
161
|
+
import { NaviosException as NaviosException2 } from "@navios/common";
|
|
162
|
+
|
|
160
163
|
// packages/core/src/service-locator/enums/injectable-scope.enum.mts
|
|
161
164
|
var InjectableScope = /* @__PURE__ */ ((InjectableScope2) => {
|
|
162
165
|
InjectableScope2["Singleton"] = "Singleton";
|
|
@@ -176,8 +179,38 @@ var InjectionToken = class _InjectionToken {
|
|
|
176
179
|
static create(name2, schema) {
|
|
177
180
|
return new _InjectionToken(name2, schema);
|
|
178
181
|
}
|
|
179
|
-
|
|
180
|
-
return
|
|
182
|
+
static bound(token, value) {
|
|
183
|
+
return new BoundInjectionToken(token, value);
|
|
184
|
+
}
|
|
185
|
+
static factory(token, factory) {
|
|
186
|
+
return new FactoryInjectionToken(token, factory);
|
|
187
|
+
}
|
|
188
|
+
static refineType(token) {
|
|
189
|
+
return token;
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
var BoundInjectionToken = class extends InjectionToken {
|
|
193
|
+
constructor(token, value) {
|
|
194
|
+
super(token.name, token.schema);
|
|
195
|
+
this.token = token;
|
|
196
|
+
this.value = value;
|
|
197
|
+
this.id = token.id;
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
var FactoryInjectionToken = class extends InjectionToken {
|
|
201
|
+
constructor(token, factory) {
|
|
202
|
+
super(token.name, token.schema);
|
|
203
|
+
this.token = token;
|
|
204
|
+
this.factory = factory;
|
|
205
|
+
}
|
|
206
|
+
value;
|
|
207
|
+
resolved = false;
|
|
208
|
+
async resolve() {
|
|
209
|
+
if (!this.value) {
|
|
210
|
+
this.value = await this.factory();
|
|
211
|
+
this.resolved = true;
|
|
212
|
+
}
|
|
213
|
+
return this.value;
|
|
181
214
|
}
|
|
182
215
|
};
|
|
183
216
|
|
|
@@ -188,6 +221,7 @@ var ErrorsEnum = /* @__PURE__ */ ((ErrorsEnum2) => {
|
|
|
188
221
|
ErrorsEnum2["InstanceDestroying"] = "InstanceDestroying";
|
|
189
222
|
ErrorsEnum2["UnknownError"] = "UnknownError";
|
|
190
223
|
ErrorsEnum2["FactoryNotFound"] = "FactoryNotFound";
|
|
224
|
+
ErrorsEnum2["FactoryTokenNotResolved"] = "FactoryTokenNotResolved";
|
|
191
225
|
return ErrorsEnum2;
|
|
192
226
|
})(ErrorsEnum || {});
|
|
193
227
|
|
|
@@ -200,6 +234,14 @@ var FactoryNotFound = class extends Error {
|
|
|
200
234
|
code = "FactoryNotFound" /* FactoryNotFound */;
|
|
201
235
|
};
|
|
202
236
|
|
|
237
|
+
// packages/core/src/service-locator/errors/factory-token-not-resolved.mts
|
|
238
|
+
var FactoryTokenNotResolved = class extends Error {
|
|
239
|
+
code = "FactoryTokenNotResolved" /* FactoryTokenNotResolved */;
|
|
240
|
+
constructor(name2) {
|
|
241
|
+
super(`Factory token not resolved: ${name2.toString()}`);
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
|
|
203
245
|
// packages/core/src/service-locator/errors/instance-destroying.mts
|
|
204
246
|
var InstanceDestroying = class extends Error {
|
|
205
247
|
constructor(name2) {
|
|
@@ -442,29 +484,48 @@ var ServiceLocator = class {
|
|
|
442
484
|
this.instanceFactories.delete(token);
|
|
443
485
|
}
|
|
444
486
|
}
|
|
445
|
-
|
|
446
|
-
var _a;
|
|
447
|
-
|
|
448
|
-
if (
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
487
|
+
resolveTokenArgs(token, args) {
|
|
488
|
+
var _a, _b;
|
|
489
|
+
let realArgs = args;
|
|
490
|
+
if (token instanceof BoundInjectionToken) {
|
|
491
|
+
realArgs = token.value;
|
|
492
|
+
} else if (token instanceof FactoryInjectionToken) {
|
|
493
|
+
if (token.resolved) {
|
|
494
|
+
realArgs = token.value;
|
|
495
|
+
} else {
|
|
496
|
+
return [new FactoryTokenNotResolved(token.name)];
|
|
497
|
+
}
|
|
454
498
|
}
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
const validatedArgs = token.schema ? token.schema.safeParse(args) : void 0;
|
|
499
|
+
if (!token.schema) {
|
|
500
|
+
return [void 0, realArgs];
|
|
501
|
+
}
|
|
502
|
+
const validatedArgs = (_a = token.schema) == null ? void 0 : _a.safeParse(realArgs);
|
|
460
503
|
if (validatedArgs && !validatedArgs.success) {
|
|
461
|
-
(
|
|
504
|
+
(_b = this.logger) == null ? void 0 : _b.error(
|
|
462
505
|
`[ServiceLocator]#getInstance(): Error validating args for ${token.name.toString()}`,
|
|
463
506
|
validatedArgs.error
|
|
464
507
|
);
|
|
465
508
|
return [new UnknownError(validatedArgs.error)];
|
|
466
509
|
}
|
|
467
|
-
|
|
510
|
+
return [void 0, validatedArgs == null ? void 0 : validatedArgs.data];
|
|
511
|
+
}
|
|
512
|
+
getInstanceIdentifier(token, args) {
|
|
513
|
+
const [err, realArgs] = this.resolveTokenArgs(token, args);
|
|
514
|
+
if (err) {
|
|
515
|
+
throw err;
|
|
516
|
+
}
|
|
517
|
+
return this.makeInstanceName(token, realArgs);
|
|
518
|
+
}
|
|
519
|
+
async getInstance(token, args) {
|
|
520
|
+
var _a, _b;
|
|
521
|
+
const [err, realArgs] = this.resolveTokenArgs(token, args);
|
|
522
|
+
if (err instanceof UnknownError) {
|
|
523
|
+
throw err;
|
|
524
|
+
} else if (err instanceof FactoryTokenNotResolved && token instanceof FactoryInjectionToken) {
|
|
525
|
+
await token.resolve();
|
|
526
|
+
return this.getInstance(token, args);
|
|
527
|
+
}
|
|
528
|
+
const instanceName = this.makeInstanceName(token, realArgs);
|
|
468
529
|
const [error, holder] = this.manager.get(instanceName);
|
|
469
530
|
if (!error) {
|
|
470
531
|
if (holder.status === "creating" /* Creating */) {
|
|
@@ -476,13 +537,13 @@ var ServiceLocator = class {
|
|
|
476
537
|
}
|
|
477
538
|
switch (error.code) {
|
|
478
539
|
case "InstanceDestroying" /* InstanceDestroying */:
|
|
479
|
-
(
|
|
540
|
+
(_a = this.logger) == null ? void 0 : _a.log(
|
|
480
541
|
`[ServiceLocator]#getInstance() TTL expired for ${holder == null ? void 0 : holder.name}`
|
|
481
542
|
);
|
|
482
543
|
await (holder == null ? void 0 : holder.destroyPromise);
|
|
483
544
|
return this.getInstance(token, args);
|
|
484
545
|
case "InstanceExpired" /* InstanceExpired */:
|
|
485
|
-
(
|
|
546
|
+
(_b = this.logger) == null ? void 0 : _b.log(
|
|
486
547
|
`[ServiceLocator]#getInstance() TTL expired for ${holder == null ? void 0 : holder.name}`
|
|
487
548
|
);
|
|
488
549
|
await this.invalidate(instanceName);
|
|
@@ -492,7 +553,7 @@ var ServiceLocator = class {
|
|
|
492
553
|
default:
|
|
493
554
|
return [error];
|
|
494
555
|
}
|
|
495
|
-
return this.createInstance(instanceName, token,
|
|
556
|
+
return this.createInstance(instanceName, token, realArgs);
|
|
496
557
|
}
|
|
497
558
|
async getOrThrowInstance(token, args) {
|
|
498
559
|
const [error, instance] = await this.getInstance(token, args);
|
|
@@ -513,10 +574,15 @@ var ServiceLocator = class {
|
|
|
513
574
|
(_a = this.logger) == null ? void 0 : _a.log(
|
|
514
575
|
`[ServiceLocator]#createInstance() Creating instance for ${instanceName}`
|
|
515
576
|
);
|
|
516
|
-
|
|
517
|
-
|
|
577
|
+
let realToken = token instanceof BoundInjectionToken || token instanceof FactoryInjectionToken ? token.token : token;
|
|
578
|
+
if (this.abstractFactories.has(realToken) || this.instanceFactories.has(realToken)) {
|
|
579
|
+
return this.createInstanceFromAbstractFactory(
|
|
580
|
+
instanceName,
|
|
581
|
+
realToken,
|
|
582
|
+
args
|
|
583
|
+
);
|
|
518
584
|
} else {
|
|
519
|
-
return [new FactoryNotFound(
|
|
585
|
+
return [new FactoryNotFound(realToken.name.toString())];
|
|
520
586
|
}
|
|
521
587
|
}
|
|
522
588
|
async createInstanceFromAbstractFactory(instanceName, token, args) {
|
|
@@ -563,7 +629,7 @@ var ServiceLocator = class {
|
|
|
563
629
|
);
|
|
564
630
|
});
|
|
565
631
|
}
|
|
566
|
-
if (holder.ttl === 0) {
|
|
632
|
+
if (holder.ttl === 0 || !shouldStore) {
|
|
567
633
|
await this.invalidate(instanceName);
|
|
568
634
|
}
|
|
569
635
|
await this.notifyListeners(instanceName);
|
|
@@ -635,16 +701,11 @@ var ServiceLocator = class {
|
|
|
635
701
|
};
|
|
636
702
|
}
|
|
637
703
|
getSyncInstance(token, args) {
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
(_a = this.logger) == null ? void 0 : _a.error(
|
|
642
|
-
`[ServiceLocator]#getInstance(): Error validating args for ${token.name.toString()}`,
|
|
643
|
-
validatedArgs.error
|
|
644
|
-
);
|
|
645
|
-
throw new UnknownError(validatedArgs.error);
|
|
704
|
+
const [err, realArgs] = this.resolveTokenArgs(token, args);
|
|
705
|
+
if (err) {
|
|
706
|
+
return null;
|
|
646
707
|
}
|
|
647
|
-
const instanceName = this.makeInstanceName(token,
|
|
708
|
+
const instanceName = this.makeInstanceName(token, realArgs);
|
|
648
709
|
const [error, holder] = this.manager.get(instanceName);
|
|
649
710
|
if (error) {
|
|
650
711
|
return null;
|
|
@@ -752,6 +813,9 @@ function getServiceLocator() {
|
|
|
752
813
|
return serviceLocator;
|
|
753
814
|
}
|
|
754
815
|
|
|
816
|
+
// packages/core/src/service-locator/resolve-service.mts
|
|
817
|
+
import { NaviosException } from "@navios/common";
|
|
818
|
+
|
|
755
819
|
// packages/core/src/service-locator/proxy-service-locator.mts
|
|
756
820
|
var ProxyServiceLocator = class {
|
|
757
821
|
constructor(serviceLocator2, ctx) {
|
|
@@ -800,14 +864,6 @@ function makeProxyServiceLocator(serviceLocator2, ctx) {
|
|
|
800
864
|
// packages/core/src/service-locator/sync-injector.mts
|
|
801
865
|
var promiseCollector = null;
|
|
802
866
|
function syncInject(token, args) {
|
|
803
|
-
if (token.schema) {
|
|
804
|
-
const parsed = token.schema.safeParse(args);
|
|
805
|
-
if (!parsed.success) {
|
|
806
|
-
throw new Error(
|
|
807
|
-
`[ServiceLocator] Invalid arguments for ${token.name.toString()}: ${parsed.error}`
|
|
808
|
-
);
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
867
|
let realToken = token;
|
|
812
868
|
if (!(token instanceof InjectionToken)) {
|
|
813
869
|
realToken = getInjectableToken(token);
|
|
@@ -831,6 +887,40 @@ function setPromiseCollector(collector) {
|
|
|
831
887
|
return original;
|
|
832
888
|
}
|
|
833
889
|
|
|
890
|
+
// packages/core/src/service-locator/resolve-service.mts
|
|
891
|
+
async function resolveService(ctx, target, args = []) {
|
|
892
|
+
const proxyServiceLocator = makeProxyServiceLocator(getServiceLocator(), ctx);
|
|
893
|
+
let promises = [];
|
|
894
|
+
const promiseCollector2 = (promise) => {
|
|
895
|
+
promises.push(promise);
|
|
896
|
+
};
|
|
897
|
+
const originalPromiseCollector = setPromiseCollector(promiseCollector2);
|
|
898
|
+
const tryLoad = () => {
|
|
899
|
+
const original = provideServiceLocator(proxyServiceLocator);
|
|
900
|
+
let result = new target(...args);
|
|
901
|
+
provideServiceLocator(original);
|
|
902
|
+
return result;
|
|
903
|
+
};
|
|
904
|
+
let instance = tryLoad();
|
|
905
|
+
setPromiseCollector(originalPromiseCollector);
|
|
906
|
+
if (promises.length > 0) {
|
|
907
|
+
await Promise.all(promises);
|
|
908
|
+
promises = [];
|
|
909
|
+
instance = tryLoad();
|
|
910
|
+
}
|
|
911
|
+
if (promises.length > 0) {
|
|
912
|
+
console.error(`[ServiceLocator] ${target.name} has problem with it's definition.
|
|
913
|
+
|
|
914
|
+
One or more of the dependencies are registered as a InjectableScope.Instance and are used with syncInject.
|
|
915
|
+
|
|
916
|
+
Please use inject instead of syncInject to load those dependencies.`);
|
|
917
|
+
throw new NaviosException(
|
|
918
|
+
`[ServiceLocator] Service ${target.name} cannot be instantiated.`
|
|
919
|
+
);
|
|
920
|
+
}
|
|
921
|
+
return instance;
|
|
922
|
+
}
|
|
923
|
+
|
|
834
924
|
// packages/core/src/service-locator/decorators/injectable.decorator.mts
|
|
835
925
|
var InjectableType = /* @__PURE__ */ ((InjectableType2) => {
|
|
836
926
|
InjectableType2["Class"] = "Class";
|
|
@@ -851,62 +941,22 @@ function Injectable({
|
|
|
851
941
|
}
|
|
852
942
|
let injectableToken = token ?? InjectionToken.create(target);
|
|
853
943
|
const locator = getServiceLocator();
|
|
854
|
-
if (!locator) {
|
|
855
|
-
throw new Error(
|
|
856
|
-
"[ServiceLocator] Service locator is not initialized. Please provide the service locator before using the @Injectable decorator."
|
|
857
|
-
);
|
|
858
|
-
}
|
|
859
944
|
if (type === "Class" /* Class */) {
|
|
860
945
|
locator.registerAbstractFactory(
|
|
861
946
|
injectableToken,
|
|
862
|
-
async (ctx) =>
|
|
863
|
-
if (scope === "Instance" /* Instance */) {
|
|
864
|
-
ctx.setTtl(0);
|
|
865
|
-
}
|
|
866
|
-
const proxyServiceLocator = makeProxyServiceLocator(
|
|
867
|
-
getServiceLocator(),
|
|
868
|
-
ctx
|
|
869
|
-
);
|
|
870
|
-
const promises = [];
|
|
871
|
-
const promiseCollector2 = (promise) => {
|
|
872
|
-
promises.push(promise);
|
|
873
|
-
};
|
|
874
|
-
const originalPromiseCollector = setPromiseCollector(promiseCollector2);
|
|
875
|
-
const tryInit = () => {
|
|
876
|
-
const original = provideServiceLocator(proxyServiceLocator);
|
|
877
|
-
let result2 = new target();
|
|
878
|
-
provideServiceLocator(original);
|
|
879
|
-
return result2;
|
|
880
|
-
};
|
|
881
|
-
const result = tryInit();
|
|
882
|
-
setPromiseCollector(originalPromiseCollector);
|
|
883
|
-
if (promises.length > 0) {
|
|
884
|
-
await Promise.all(promises);
|
|
885
|
-
return tryInit();
|
|
886
|
-
}
|
|
887
|
-
return result;
|
|
888
|
-
},
|
|
947
|
+
async (ctx) => resolveService(ctx, target),
|
|
889
948
|
scope
|
|
890
949
|
);
|
|
891
950
|
} else if (type === "Factory" /* Factory */) {
|
|
892
951
|
locator.registerAbstractFactory(
|
|
893
952
|
injectableToken,
|
|
894
953
|
async (ctx, args) => {
|
|
895
|
-
|
|
896
|
-
ctx.setTtl(0);
|
|
897
|
-
}
|
|
898
|
-
const proxyServiceLocator = makeProxyServiceLocator(
|
|
899
|
-
getServiceLocator(),
|
|
900
|
-
ctx
|
|
901
|
-
);
|
|
902
|
-
const original = provideServiceLocator(proxyServiceLocator);
|
|
903
|
-
const builder = new target();
|
|
954
|
+
const builder = await resolveService(ctx, target);
|
|
904
955
|
if (typeof builder.create !== "function") {
|
|
905
|
-
throw new
|
|
956
|
+
throw new NaviosException2(
|
|
906
957
|
`[ServiceLocator] Factory ${target.name} does not implement the create method.`
|
|
907
958
|
);
|
|
908
959
|
}
|
|
909
|
-
provideServiceLocator(original);
|
|
910
960
|
return builder.create(ctx, args);
|
|
911
961
|
},
|
|
912
962
|
scope
|
|
@@ -969,14 +1019,6 @@ var EventEmitter = class {
|
|
|
969
1019
|
|
|
970
1020
|
// packages/core/src/service-locator/inject.mts
|
|
971
1021
|
function inject(token, args) {
|
|
972
|
-
if (token.schema) {
|
|
973
|
-
const parsed = token.schema.safeParse(args);
|
|
974
|
-
if (!parsed.success) {
|
|
975
|
-
throw new Error(
|
|
976
|
-
`[ServiceLocator] Invalid arguments for ${token.name.toString()}: ${parsed.error}`
|
|
977
|
-
);
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
1022
|
let realToken = token;
|
|
981
1023
|
if (!(token instanceof InjectionToken)) {
|
|
982
1024
|
realToken = getInjectableToken(token);
|
|
@@ -1350,7 +1392,7 @@ __runInitializers(_init, 1, _ConsoleLogger);
|
|
|
1350
1392
|
var ConsoleLogger = _ConsoleLogger;
|
|
1351
1393
|
|
|
1352
1394
|
// packages/core/src/logger/logger.factory.mts
|
|
1353
|
-
import { z } from "zod";
|
|
1395
|
+
import { z as z2 } from "zod";
|
|
1354
1396
|
|
|
1355
1397
|
// packages/core/src/logger/logger.service.mts
|
|
1356
1398
|
var DEFAULT_LOGGER = new ConsoleLogger();
|
|
@@ -1444,7 +1486,6 @@ var _LoggerInstance = class _LoggerInstance {
|
|
|
1444
1486
|
}
|
|
1445
1487
|
static overrideLogger(logger) {
|
|
1446
1488
|
var _a, _b;
|
|
1447
|
-
console.log(logger);
|
|
1448
1489
|
if (Array.isArray(logger)) {
|
|
1449
1490
|
_LoggerInstance.logLevels = logger;
|
|
1450
1491
|
return (_b = (_a = this.staticInstanceRef) == null ? void 0 : _a.setLogLevels) == null ? void 0 : _b.call(_a, logger);
|
|
@@ -1478,10 +1519,10 @@ var LoggerInstance = _LoggerInstance;
|
|
|
1478
1519
|
|
|
1479
1520
|
// packages/core/src/logger/logger.factory.mts
|
|
1480
1521
|
var LoggerInjectionToken = "LoggerInjectionToken";
|
|
1481
|
-
var LoggerOptions =
|
|
1482
|
-
context:
|
|
1483
|
-
options:
|
|
1484
|
-
timestamp:
|
|
1522
|
+
var LoggerOptions = z2.object({
|
|
1523
|
+
context: z2.string().optional(),
|
|
1524
|
+
options: z2.object({
|
|
1525
|
+
timestamp: z2.boolean().optional()
|
|
1485
1526
|
}).optional()
|
|
1486
1527
|
}).optional();
|
|
1487
1528
|
var Logger = InjectionToken.create(LoggerInjectionToken, LoggerOptions);
|
|
@@ -1516,8 +1557,7 @@ var PinoWrapper = class _PinoWrapper {
|
|
|
1516
1557
|
warn(message, ...optionalParams) {
|
|
1517
1558
|
this.logger.warn(message, ...optionalParams);
|
|
1518
1559
|
}
|
|
1519
|
-
info(
|
|
1520
|
-
this.logger.log(message, ...optionalParams);
|
|
1560
|
+
info() {
|
|
1521
1561
|
}
|
|
1522
1562
|
debug(message, ...optionalParams) {
|
|
1523
1563
|
var _a, _b;
|
|
@@ -1527,7 +1567,7 @@ var PinoWrapper = class _PinoWrapper {
|
|
|
1527
1567
|
var _a, _b;
|
|
1528
1568
|
(_b = (_a = this.logger).verbose) == null ? void 0 : _b.call(_a, message, ...optionalParams);
|
|
1529
1569
|
}
|
|
1530
|
-
silent(
|
|
1570
|
+
silent() {
|
|
1531
1571
|
}
|
|
1532
1572
|
child(options) {
|
|
1533
1573
|
const keys = Object.keys(options);
|
|
@@ -1546,14 +1586,14 @@ var PinoWrapper = class _PinoWrapper {
|
|
|
1546
1586
|
}
|
|
1547
1587
|
const levels = LoggerInstance["logLevels"];
|
|
1548
1588
|
if (levels) {
|
|
1549
|
-
return levels
|
|
1589
|
+
return levels.find((level) => level !== "verbose");
|
|
1550
1590
|
}
|
|
1551
|
-
return "
|
|
1591
|
+
return "warn";
|
|
1552
1592
|
}
|
|
1553
1593
|
};
|
|
1554
1594
|
|
|
1555
1595
|
// packages/core/src/config/config.service.mts
|
|
1556
|
-
import { NaviosException } from "@navios/common";
|
|
1596
|
+
import { NaviosException as NaviosException3 } from "@navios/common";
|
|
1557
1597
|
var ConfigServiceInstance = class {
|
|
1558
1598
|
constructor(config = {}, logger) {
|
|
1559
1599
|
this.config = config;
|
|
@@ -1592,30 +1632,29 @@ var ConfigServiceInstance = class {
|
|
|
1592
1632
|
if (value === null) {
|
|
1593
1633
|
const message = errorMessage || `Configuration value for key "${String(key)}" is not defined`;
|
|
1594
1634
|
this.logger.error(message);
|
|
1595
|
-
throw new
|
|
1635
|
+
throw new NaviosException3(message);
|
|
1596
1636
|
}
|
|
1597
1637
|
return value;
|
|
1598
1638
|
}
|
|
1599
1639
|
};
|
|
1600
1640
|
|
|
1601
1641
|
// packages/core/src/config/config.provider.mts
|
|
1602
|
-
var
|
|
1603
|
-
|
|
1604
|
-
load: z2.function()
|
|
1642
|
+
var ConfigProviderOptions = z3.object({
|
|
1643
|
+
load: z3.function()
|
|
1605
1644
|
});
|
|
1606
|
-
var ConfigProvider = InjectionToken.create(
|
|
1645
|
+
var ConfigProvider = InjectionToken.create(ConfigServiceInstance, ConfigProviderOptions);
|
|
1607
1646
|
var _ConfigProviderFactory_decorators, _init4;
|
|
1608
1647
|
_ConfigProviderFactory_decorators = [Injectable({
|
|
1609
1648
|
token: ConfigProvider,
|
|
1610
1649
|
type: "Factory" /* Factory */
|
|
1611
1650
|
})];
|
|
1612
1651
|
var ConfigProviderFactory = class {
|
|
1613
|
-
logger =
|
|
1652
|
+
logger = syncInject(Logger, {
|
|
1614
1653
|
context: "ConfigService"
|
|
1615
1654
|
});
|
|
1616
1655
|
async create(ctx, args) {
|
|
1617
1656
|
const { load } = args;
|
|
1618
|
-
const logger =
|
|
1657
|
+
const logger = this.logger;
|
|
1619
1658
|
try {
|
|
1620
1659
|
const config = await load();
|
|
1621
1660
|
return new ConfigServiceInstance(config, logger);
|
|
@@ -1628,25 +1667,18 @@ var ConfigProviderFactory = class {
|
|
|
1628
1667
|
_init4 = __decoratorStart(null);
|
|
1629
1668
|
ConfigProviderFactory = __decorateElement(_init4, 0, "ConfigProviderFactory", _ConfigProviderFactory_decorators, ConfigProviderFactory);
|
|
1630
1669
|
__runInitializers(_init4, 1, ConfigProviderFactory);
|
|
1631
|
-
function
|
|
1632
|
-
|
|
1633
|
-
_ConfigServiceImpl_decorators = [Injectable({
|
|
1634
|
-
type: "Factory" /* Factory */
|
|
1635
|
-
})];
|
|
1636
|
-
class ConfigServiceImpl {
|
|
1637
|
-
configService = inject(ConfigProvider, options);
|
|
1638
|
-
create() {
|
|
1639
|
-
return this.configService;
|
|
1640
|
-
}
|
|
1641
|
-
}
|
|
1642
|
-
_init9 = __decoratorStart(null);
|
|
1643
|
-
ConfigServiceImpl = __decorateElement(_init9, 0, "ConfigServiceImpl", _ConfigServiceImpl_decorators, ConfigServiceImpl);
|
|
1644
|
-
__runInitializers(_init9, 1, ConfigServiceImpl);
|
|
1645
|
-
return getInjectableToken(ConfigServiceImpl);
|
|
1670
|
+
function provideConfig(options) {
|
|
1671
|
+
return InjectionToken.bound(ConfigProvider, options);
|
|
1646
1672
|
}
|
|
1647
1673
|
|
|
1648
1674
|
// packages/core/src/metadata/endpoint.metadata.mts
|
|
1649
1675
|
var EndpointMetadataKey = Symbol("EndpointMetadataKey");
|
|
1676
|
+
var EndpointType = /* @__PURE__ */ ((EndpointType2) => {
|
|
1677
|
+
EndpointType2["Unknown"] = "unknown";
|
|
1678
|
+
EndpointType2["Config"] = "config";
|
|
1679
|
+
EndpointType2["Handler"] = "handler";
|
|
1680
|
+
return EndpointType2;
|
|
1681
|
+
})(EndpointType || {});
|
|
1650
1682
|
function getAllEndpointMetadata(context) {
|
|
1651
1683
|
if (context.metadata) {
|
|
1652
1684
|
const metadata = context.metadata[EndpointMetadataKey];
|
|
@@ -1672,6 +1704,9 @@ function getEndpointMetadata(target, context) {
|
|
|
1672
1704
|
const newMetadata = {
|
|
1673
1705
|
classMethod: target.name,
|
|
1674
1706
|
url: "",
|
|
1707
|
+
successStatusCode: 200,
|
|
1708
|
+
headers: {},
|
|
1709
|
+
type: "unknown" /* Unknown */,
|
|
1675
1710
|
httpMethod: "GET",
|
|
1676
1711
|
config: null,
|
|
1677
1712
|
guards: /* @__PURE__ */ new Set(),
|
|
@@ -1801,6 +1836,7 @@ function Endpoint(endpoint) {
|
|
|
1801
1836
|
);
|
|
1802
1837
|
}
|
|
1803
1838
|
endpointMetadata.config = config;
|
|
1839
|
+
endpointMetadata.type = "config" /* Config */;
|
|
1804
1840
|
endpointMetadata.classMethod = target.name;
|
|
1805
1841
|
endpointMetadata.httpMethod = config.method;
|
|
1806
1842
|
endpointMetadata.url = config.url;
|
|
@@ -1809,6 +1845,32 @@ function Endpoint(endpoint) {
|
|
|
1809
1845
|
};
|
|
1810
1846
|
}
|
|
1811
1847
|
|
|
1848
|
+
// packages/core/src/decorators/header.decorator.mts
|
|
1849
|
+
function Header(name2, value) {
|
|
1850
|
+
return (target, context) => {
|
|
1851
|
+
if (context.kind !== "method") {
|
|
1852
|
+
throw new Error("[Navios] Header decorator can only be used on methods.");
|
|
1853
|
+
}
|
|
1854
|
+
const metadata = getEndpointMetadata(target, context);
|
|
1855
|
+
metadata.headers[name2] = value;
|
|
1856
|
+
return target;
|
|
1857
|
+
};
|
|
1858
|
+
}
|
|
1859
|
+
|
|
1860
|
+
// packages/core/src/decorators/http-code.decorator.mts
|
|
1861
|
+
function HttpCode(code) {
|
|
1862
|
+
return (target, context) => {
|
|
1863
|
+
if (context.kind !== "method") {
|
|
1864
|
+
throw new Error(
|
|
1865
|
+
"[Navios] HttpCode decorator can only be used on methods."
|
|
1866
|
+
);
|
|
1867
|
+
}
|
|
1868
|
+
const metadata = getEndpointMetadata(target, context);
|
|
1869
|
+
metadata.successStatusCode = code;
|
|
1870
|
+
return target;
|
|
1871
|
+
};
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1812
1874
|
// packages/core/src/decorators/module.decorator.mts
|
|
1813
1875
|
function Module(metadata) {
|
|
1814
1876
|
return (target, context) => {
|
|
@@ -1918,6 +1980,9 @@ var ConflictException = class extends HttpException {
|
|
|
1918
1980
|
}
|
|
1919
1981
|
};
|
|
1920
1982
|
|
|
1983
|
+
// packages/core/src/services/controller-adapter.service.mts
|
|
1984
|
+
import { NaviosException as NaviosException4 } from "@navios/common";
|
|
1985
|
+
|
|
1921
1986
|
// packages/core/src/tokens/application.token.mts
|
|
1922
1987
|
var ApplicationInjectionToken = "ApplicationInjectionToken";
|
|
1923
1988
|
var Application = InjectionToken.create(
|
|
@@ -2061,8 +2126,8 @@ var _ControllerAdapterService = class _ControllerAdapterService {
|
|
|
2061
2126
|
setupController(controller, instance, moduleMetadata) {
|
|
2062
2127
|
const controllerMetadata = extractControllerMetadata(controller);
|
|
2063
2128
|
for (const endpoint of controllerMetadata.endpoints) {
|
|
2064
|
-
const { classMethod, url, httpMethod
|
|
2065
|
-
if (!url
|
|
2129
|
+
const { classMethod, url, httpMethod } = endpoint;
|
|
2130
|
+
if (!url) {
|
|
2066
2131
|
throw new Error(
|
|
2067
2132
|
`[Navios] Malformed Endpoint ${controller.name}:${classMethod}`
|
|
2068
2133
|
);
|
|
@@ -2072,91 +2137,115 @@ var _ControllerAdapterService = class _ControllerAdapterService {
|
|
|
2072
2137
|
controllerMetadata,
|
|
2073
2138
|
endpoint
|
|
2074
2139
|
);
|
|
2075
|
-
const guards = this.guardRunner.makeContext(executionContext);
|
|
2076
|
-
const { querySchema, requestSchema, responseSchema } = config;
|
|
2077
|
-
const schema = {};
|
|
2078
|
-
if (querySchema) {
|
|
2079
|
-
schema.querystring = querySchema;
|
|
2080
|
-
}
|
|
2081
|
-
if (requestSchema) {
|
|
2082
|
-
schema.body = requestSchema;
|
|
2083
|
-
}
|
|
2084
|
-
if (responseSchema) {
|
|
2085
|
-
schema.response = {
|
|
2086
|
-
200: responseSchema
|
|
2087
|
-
};
|
|
2088
|
-
}
|
|
2089
2140
|
instance.withTypeProvider().route({
|
|
2090
2141
|
method: httpMethod,
|
|
2091
2142
|
url: url.replaceAll("$", ":"),
|
|
2092
|
-
schema,
|
|
2093
|
-
preHandler:
|
|
2094
|
-
|
|
2095
|
-
getServiceLocator().registerInstance(Request, request);
|
|
2096
|
-
getServiceLocator().registerInstance(Reply, reply);
|
|
2097
|
-
getServiceLocator().registerInstance(
|
|
2098
|
-
ExecutionContextToken,
|
|
2099
|
-
executionContext
|
|
2100
|
-
);
|
|
2101
|
-
executionContext.provideRequest(request);
|
|
2102
|
-
executionContext.provideReply(reply);
|
|
2103
|
-
const canActivate = await this.guardRunner.runGuards(
|
|
2104
|
-
guards,
|
|
2105
|
-
executionContext
|
|
2106
|
-
);
|
|
2107
|
-
getServiceLocator().removeInstance(Request);
|
|
2108
|
-
getServiceLocator().removeInstance(Reply);
|
|
2109
|
-
getServiceLocator().removeInstance(ExecutionContextToken);
|
|
2110
|
-
if (!canActivate) {
|
|
2111
|
-
return reply;
|
|
2112
|
-
}
|
|
2113
|
-
}
|
|
2114
|
-
},
|
|
2115
|
-
handler: async (request, reply) => {
|
|
2116
|
-
getServiceLocator().registerInstance(Request, request);
|
|
2117
|
-
getServiceLocator().registerInstance(Reply, reply);
|
|
2118
|
-
getServiceLocator().registerInstance(
|
|
2119
|
-
ExecutionContextToken,
|
|
2120
|
-
executionContext
|
|
2121
|
-
);
|
|
2122
|
-
executionContext.provideRequest(request);
|
|
2123
|
-
executionContext.provideReply(reply);
|
|
2124
|
-
const controllerInstance = await inject(controller);
|
|
2125
|
-
try {
|
|
2126
|
-
const { query, params, body } = request;
|
|
2127
|
-
const argument = {};
|
|
2128
|
-
if (query && Object.keys(query).length > 0) {
|
|
2129
|
-
argument.params = query;
|
|
2130
|
-
}
|
|
2131
|
-
if (params && Object.keys(params).length > 0) {
|
|
2132
|
-
argument.urlParams = params;
|
|
2133
|
-
}
|
|
2134
|
-
if (body) {
|
|
2135
|
-
argument.data = body;
|
|
2136
|
-
}
|
|
2137
|
-
const result = await controllerInstance[classMethod](argument);
|
|
2138
|
-
reply.status(200).send(result);
|
|
2139
|
-
} catch (error) {
|
|
2140
|
-
if (error instanceof HttpException) {
|
|
2141
|
-
reply.status(error.statusCode).send(error.response);
|
|
2142
|
-
} else {
|
|
2143
|
-
reply.status(500).send({
|
|
2144
|
-
message: "Internal server error",
|
|
2145
|
-
error: error.message
|
|
2146
|
-
});
|
|
2147
|
-
}
|
|
2148
|
-
} finally {
|
|
2149
|
-
getServiceLocator().removeInstance(Request);
|
|
2150
|
-
getServiceLocator().removeInstance(Reply);
|
|
2151
|
-
getServiceLocator().removeInstance(ExecutionContextToken);
|
|
2152
|
-
}
|
|
2153
|
-
}
|
|
2143
|
+
schema: this.provideSchemaForConfig(endpoint),
|
|
2144
|
+
preHandler: this.providePreHandler(executionContext),
|
|
2145
|
+
handler: this.provideHandler(controller, executionContext, endpoint)
|
|
2154
2146
|
});
|
|
2155
2147
|
this.logger.debug(
|
|
2156
2148
|
`Registered ${httpMethod} ${url} for ${controller.name}:${classMethod}`
|
|
2157
2149
|
);
|
|
2158
2150
|
}
|
|
2159
2151
|
}
|
|
2152
|
+
providePreHandler(executionContext) {
|
|
2153
|
+
const guards = this.guardRunner.makeContext(executionContext);
|
|
2154
|
+
return guards.size > 0 ? async (request, reply) => {
|
|
2155
|
+
getServiceLocator().registerInstance(Request, request);
|
|
2156
|
+
getServiceLocator().registerInstance(Reply, reply);
|
|
2157
|
+
getServiceLocator().registerInstance(
|
|
2158
|
+
ExecutionContextToken,
|
|
2159
|
+
executionContext
|
|
2160
|
+
);
|
|
2161
|
+
executionContext.provideRequest(request);
|
|
2162
|
+
executionContext.provideReply(reply);
|
|
2163
|
+
let canActivate = true;
|
|
2164
|
+
try {
|
|
2165
|
+
canActivate = await this.guardRunner.runGuards(
|
|
2166
|
+
guards,
|
|
2167
|
+
executionContext
|
|
2168
|
+
);
|
|
2169
|
+
} finally {
|
|
2170
|
+
getServiceLocator().removeInstance(Request);
|
|
2171
|
+
getServiceLocator().removeInstance(Reply);
|
|
2172
|
+
getServiceLocator().removeInstance(ExecutionContextToken);
|
|
2173
|
+
}
|
|
2174
|
+
if (!canActivate) {
|
|
2175
|
+
return reply;
|
|
2176
|
+
}
|
|
2177
|
+
} : void 0;
|
|
2178
|
+
}
|
|
2179
|
+
provideSchemaForConfig(endpointMetadata) {
|
|
2180
|
+
if (!endpointMetadata.config) {
|
|
2181
|
+
this.logger.warn(`No config found for endpoint ${endpointMetadata.url}`);
|
|
2182
|
+
return {};
|
|
2183
|
+
}
|
|
2184
|
+
const { querySchema, requestSchema, responseSchema } = endpointMetadata.config;
|
|
2185
|
+
const schema = {};
|
|
2186
|
+
if (querySchema) {
|
|
2187
|
+
schema.querystring = querySchema;
|
|
2188
|
+
}
|
|
2189
|
+
if (requestSchema) {
|
|
2190
|
+
schema.body = requestSchema;
|
|
2191
|
+
}
|
|
2192
|
+
if (responseSchema) {
|
|
2193
|
+
schema.response = {
|
|
2194
|
+
200: responseSchema
|
|
2195
|
+
};
|
|
2196
|
+
}
|
|
2197
|
+
return schema;
|
|
2198
|
+
}
|
|
2199
|
+
provideHandler(controller, executionContext, endpointMetadata) {
|
|
2200
|
+
switch (endpointMetadata.type) {
|
|
2201
|
+
case "unknown" /* Unknown */:
|
|
2202
|
+
this.logger.error(
|
|
2203
|
+
`Unknown endpoint type ${endpointMetadata.type} for ${controller.name}:${endpointMetadata.classMethod}`
|
|
2204
|
+
);
|
|
2205
|
+
throw new NaviosException4("Unknown endpoint type");
|
|
2206
|
+
case "config" /* Config */:
|
|
2207
|
+
return this.provideHandlerForConfig(
|
|
2208
|
+
controller,
|
|
2209
|
+
executionContext,
|
|
2210
|
+
endpointMetadata
|
|
2211
|
+
);
|
|
2212
|
+
case "handler" /* Handler */:
|
|
2213
|
+
this.logger.error("Not implemented yet");
|
|
2214
|
+
throw new NaviosException4("Not implemented yet");
|
|
2215
|
+
}
|
|
2216
|
+
}
|
|
2217
|
+
provideHandlerForConfig(controller, executionContext, endpointMetadata) {
|
|
2218
|
+
return async (request, reply) => {
|
|
2219
|
+
getServiceLocator().registerInstance(Request, request);
|
|
2220
|
+
getServiceLocator().registerInstance(Reply, reply);
|
|
2221
|
+
getServiceLocator().registerInstance(
|
|
2222
|
+
ExecutionContextToken,
|
|
2223
|
+
executionContext
|
|
2224
|
+
);
|
|
2225
|
+
executionContext.provideRequest(request);
|
|
2226
|
+
executionContext.provideReply(reply);
|
|
2227
|
+
const controllerInstance = await inject(controller);
|
|
2228
|
+
try {
|
|
2229
|
+
const { query, params, body } = request;
|
|
2230
|
+
const argument = {};
|
|
2231
|
+
if (query && Object.keys(query).length > 0) {
|
|
2232
|
+
argument.params = query;
|
|
2233
|
+
}
|
|
2234
|
+
if (params && Object.keys(params).length > 0) {
|
|
2235
|
+
argument.urlParams = params;
|
|
2236
|
+
}
|
|
2237
|
+
if (body) {
|
|
2238
|
+
argument.data = body;
|
|
2239
|
+
}
|
|
2240
|
+
const result = await controllerInstance[endpointMetadata.classMethod](argument);
|
|
2241
|
+
reply.status(endpointMetadata.successStatusCode).headers(endpointMetadata.headers).send(result);
|
|
2242
|
+
} finally {
|
|
2243
|
+
getServiceLocator().removeInstance(Request);
|
|
2244
|
+
getServiceLocator().removeInstance(Reply);
|
|
2245
|
+
getServiceLocator().removeInstance(ExecutionContextToken);
|
|
2246
|
+
}
|
|
2247
|
+
};
|
|
2248
|
+
}
|
|
2160
2249
|
};
|
|
2161
2250
|
_init6 = __decoratorStart(null);
|
|
2162
2251
|
_ControllerAdapterService = __decorateElement(_init6, 0, "ControllerAdapterService", _ControllerAdapterService_decorators, _ControllerAdapterService);
|
|
@@ -2313,6 +2402,7 @@ var _NaviosApplication = class _NaviosApplication {
|
|
|
2313
2402
|
}
|
|
2314
2403
|
await this.moduleLoader.loadModules(this.appModule);
|
|
2315
2404
|
this.server = await this.getFastifyInstance(this.options);
|
|
2405
|
+
this.configureFastifyInstance(this.server);
|
|
2316
2406
|
getServiceLocator().registerInstance(Application, this.server);
|
|
2317
2407
|
this.server.setValidatorCompiler(validatorCompiler);
|
|
2318
2408
|
this.server.setSerializerCompiler(serializerCompiler);
|
|
@@ -2320,6 +2410,7 @@ var _NaviosApplication = class _NaviosApplication {
|
|
|
2320
2410
|
await this.server.register(cors, this.corsOptions);
|
|
2321
2411
|
}
|
|
2322
2412
|
await this.initModules();
|
|
2413
|
+
await this.server.ready();
|
|
2323
2414
|
this.logger.debug("Navios application initialized");
|
|
2324
2415
|
}
|
|
2325
2416
|
async getFastifyInstance(rawOptions) {
|
|
@@ -2349,6 +2440,35 @@ var _NaviosApplication = class _NaviosApplication {
|
|
|
2349
2440
|
});
|
|
2350
2441
|
}
|
|
2351
2442
|
}
|
|
2443
|
+
configureFastifyInstance(fastifyInstance) {
|
|
2444
|
+
fastifyInstance.setErrorHandler((error, request, reply) => {
|
|
2445
|
+
if (error instanceof HttpException) {
|
|
2446
|
+
return reply.status(error.statusCode).send(error.response);
|
|
2447
|
+
} else {
|
|
2448
|
+
const statusCode = error.statusCode || 500;
|
|
2449
|
+
const message = error.message || "Internal Server Error";
|
|
2450
|
+
const response = {
|
|
2451
|
+
statusCode,
|
|
2452
|
+
message,
|
|
2453
|
+
error: error.name || "InternalServerError"
|
|
2454
|
+
};
|
|
2455
|
+
this.logger.error(
|
|
2456
|
+
`Error occurred: ${error.message} on ${request.url}`,
|
|
2457
|
+
error
|
|
2458
|
+
);
|
|
2459
|
+
return reply.status(statusCode).send(response);
|
|
2460
|
+
}
|
|
2461
|
+
});
|
|
2462
|
+
fastifyInstance.setNotFoundHandler((req, reply) => {
|
|
2463
|
+
const response = {
|
|
2464
|
+
statusCode: 404,
|
|
2465
|
+
message: "Not Found",
|
|
2466
|
+
error: "NotFound"
|
|
2467
|
+
};
|
|
2468
|
+
this.logger.error(`Route not found: ${req.url}`);
|
|
2469
|
+
return reply.status(404).send(response);
|
|
2470
|
+
});
|
|
2471
|
+
}
|
|
2352
2472
|
async initModules() {
|
|
2353
2473
|
const modules = this.moduleLoader.getAllModules();
|
|
2354
2474
|
const promises = [];
|
|
@@ -2392,7 +2512,8 @@ var _NaviosApplication = class _NaviosApplication {
|
|
|
2392
2512
|
if (!this.server) {
|
|
2393
2513
|
throw new Error("Server is not initialized. Call init() first.");
|
|
2394
2514
|
}
|
|
2395
|
-
await this.server.listen(options);
|
|
2515
|
+
const res = await this.server.listen(options);
|
|
2516
|
+
this.logger.debug(`Navios is listening on ${res}`);
|
|
2396
2517
|
}
|
|
2397
2518
|
};
|
|
2398
2519
|
_init8 = __decoratorStart(null);
|
|
@@ -2422,9 +2543,9 @@ export {
|
|
|
2422
2543
|
Application,
|
|
2423
2544
|
AttributeFactory,
|
|
2424
2545
|
BadRequestException,
|
|
2546
|
+
BoundInjectionToken,
|
|
2425
2547
|
ConfigProvider,
|
|
2426
2548
|
ConfigProviderFactory,
|
|
2427
|
-
ConfigProviderInjectionToken,
|
|
2428
2549
|
ConfigProviderOptions,
|
|
2429
2550
|
ConfigServiceInstance,
|
|
2430
2551
|
ConflictException,
|
|
@@ -2434,14 +2555,19 @@ export {
|
|
|
2434
2555
|
ControllerMetadataKey,
|
|
2435
2556
|
Endpoint,
|
|
2436
2557
|
EndpointMetadataKey,
|
|
2558
|
+
EndpointType,
|
|
2437
2559
|
ErrorsEnum,
|
|
2438
2560
|
EventEmitter,
|
|
2439
2561
|
ExecutionContext2 as ExecutionContext,
|
|
2440
2562
|
ExecutionContextInjectionToken,
|
|
2441
2563
|
ExecutionContextToken,
|
|
2564
|
+
FactoryInjectionToken,
|
|
2442
2565
|
FactoryNotFound,
|
|
2566
|
+
FactoryTokenNotResolved,
|
|
2443
2567
|
ForbiddenException,
|
|
2444
2568
|
GuardRunnerService,
|
|
2569
|
+
Header,
|
|
2570
|
+
HttpCode,
|
|
2445
2571
|
HttpException,
|
|
2446
2572
|
Injectable,
|
|
2447
2573
|
InjectableScope,
|
|
@@ -2503,10 +2629,11 @@ export {
|
|
|
2503
2629
|
isString,
|
|
2504
2630
|
isSymbol,
|
|
2505
2631
|
isUndefined,
|
|
2506
|
-
makeConfigToken,
|
|
2507
2632
|
normalizePath,
|
|
2508
2633
|
override,
|
|
2634
|
+
provideConfig,
|
|
2509
2635
|
provideServiceLocator,
|
|
2636
|
+
resolveService,
|
|
2510
2637
|
setPromiseCollector,
|
|
2511
2638
|
stripEndSlash,
|
|
2512
2639
|
syncInject,
|