@grupodiariodaregiao/bunstone 0.4.3 → 0.4.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.js +14 -20
- package/dist/lib/app-startup.d.ts +2 -0
- package/dist/lib/on-module/on-module-destroy.d.ts +2 -2
- package/dist/lib/on-module/on-module-init.d.ts +2 -2
- package/lib/app-startup.ts +20 -14
- package/lib/on-module/on-module-destroy.ts +2 -2
- package/lib/on-module/on-module-init.ts +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -116627,14 +116627,6 @@ function Head2(pathname = "") {
|
|
|
116627
116627
|
return HttpMethodDecorator("HEAD", pathname);
|
|
116628
116628
|
}
|
|
116629
116629
|
|
|
116630
|
-
// lib/on-module/on-module-destroy.ts
|
|
116631
|
-
class OnModuleDestroy {
|
|
116632
|
-
}
|
|
116633
|
-
|
|
116634
|
-
// lib/on-module/on-module-init.ts
|
|
116635
|
-
class OnModuleInit {
|
|
116636
|
-
}
|
|
116637
|
-
|
|
116638
116630
|
// lib/openapi.ts
|
|
116639
116631
|
var import_reflect_metadata13 = __toESM(require_Reflect(), 1);
|
|
116640
116632
|
var API_TAGS_METADATA = "dip:openapi:tags";
|
|
@@ -117415,14 +117407,13 @@ if (document.readyState === 'loading') {
|
|
|
117415
117407
|
return;
|
|
117416
117408
|
}
|
|
117417
117409
|
for (const provider of injectables.values()) {
|
|
117418
|
-
if (!(provider instanceof OnModuleInit)) {
|
|
117419
|
-
continue;
|
|
117420
|
-
}
|
|
117421
117410
|
if (AppStartup.initializedModuleHooks.has(provider)) {
|
|
117422
117411
|
continue;
|
|
117423
117412
|
}
|
|
117424
|
-
AppStartup.
|
|
117425
|
-
|
|
117413
|
+
if (AppStartup.hasOnModuleInit(provider)) {
|
|
117414
|
+
AppStartup.initializedModuleHooks.add(provider);
|
|
117415
|
+
await provider.onModuleInit();
|
|
117416
|
+
}
|
|
117426
117417
|
}
|
|
117427
117418
|
}
|
|
117428
117419
|
static async executeOnModuleDestroy(module) {
|
|
@@ -117431,16 +117422,21 @@ if (document.readyState === 'loading') {
|
|
|
117431
117422
|
return;
|
|
117432
117423
|
}
|
|
117433
117424
|
for (const provider of injectables.values()) {
|
|
117434
|
-
if (!(provider instanceof OnModuleDestroy)) {
|
|
117435
|
-
continue;
|
|
117436
|
-
}
|
|
117437
117425
|
if (AppStartup.destroyedModuleHooks.has(provider)) {
|
|
117438
117426
|
continue;
|
|
117439
117427
|
}
|
|
117440
|
-
AppStartup.
|
|
117441
|
-
|
|
117428
|
+
if (AppStartup.hasOnModuleDestroy(provider)) {
|
|
117429
|
+
AppStartup.destroyedModuleHooks.add(provider);
|
|
117430
|
+
await provider.onModuleDestroy();
|
|
117431
|
+
}
|
|
117442
117432
|
}
|
|
117443
117433
|
}
|
|
117434
|
+
static hasOnModuleInit(provider) {
|
|
117435
|
+
return !!provider && typeof provider.onModuleInit === "function";
|
|
117436
|
+
}
|
|
117437
|
+
static hasOnModuleDestroy(provider) {
|
|
117438
|
+
return !!provider && typeof provider.onModuleDestroy === "function";
|
|
117439
|
+
}
|
|
117444
117440
|
static registerRoutes(module) {
|
|
117445
117441
|
const controllers = Reflect.getMetadata("dip:module:routes", module);
|
|
117446
117442
|
if (!controllers) {
|
|
@@ -120059,8 +120055,6 @@ export {
|
|
|
120059
120055
|
ParamType,
|
|
120060
120056
|
Param,
|
|
120061
120057
|
Options,
|
|
120062
|
-
OnModuleInit,
|
|
120063
|
-
OnModuleDestroy,
|
|
120064
120058
|
OkResponse,
|
|
120065
120059
|
NotFoundException,
|
|
120066
120060
|
NoContentResponse,
|
|
@@ -78,6 +78,8 @@ export declare class AppStartup {
|
|
|
78
78
|
private static destroyModules;
|
|
79
79
|
private static executeOnModuleInit;
|
|
80
80
|
private static executeOnModuleDestroy;
|
|
81
|
+
private static hasOnModuleInit;
|
|
82
|
+
private static hasOnModuleDestroy;
|
|
81
83
|
private static registerRoutes;
|
|
82
84
|
/**
|
|
83
85
|
* Builds effective rate limit configuration by merging global config with method config
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
1
|
+
export interface OnModuleDestroy {
|
|
2
|
+
onModuleDestroy(): Promise<void> | void;
|
|
3
3
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
1
|
+
export interface OnModuleInit {
|
|
2
|
+
onModuleInit(): Promise<void> | void;
|
|
3
3
|
}
|
package/lib/app-startup.ts
CHANGED
|
@@ -28,8 +28,8 @@ import { ConfigurationError } from "./errors";
|
|
|
28
28
|
import { HttpException } from "./http-exceptions";
|
|
29
29
|
import { HTTP_HEADERS_METADATA } from "./http-methods";
|
|
30
30
|
import { ParamType, processParameters } from "./http-params";
|
|
31
|
-
import { OnModuleDestroy } from "./on-module/on-module-destroy";
|
|
32
|
-
import { OnModuleInit } from "./on-module/on-module-init";
|
|
31
|
+
import type { OnModuleDestroy } from "./on-module/on-module-destroy";
|
|
32
|
+
import type { OnModuleInit } from "./on-module/on-module-init";
|
|
33
33
|
import {
|
|
34
34
|
API_HEADERS_METADATA,
|
|
35
35
|
API_OPERATION_METADATA,
|
|
@@ -535,16 +535,14 @@ if (document.readyState === 'loading') {
|
|
|
535
535
|
}
|
|
536
536
|
|
|
537
537
|
for (const provider of injectables.values()) {
|
|
538
|
-
if (!(provider instanceof OnModuleInit)) {
|
|
539
|
-
continue;
|
|
540
|
-
}
|
|
541
|
-
|
|
542
538
|
if (AppStartup.initializedModuleHooks.has(provider)) {
|
|
543
539
|
continue;
|
|
544
540
|
}
|
|
545
541
|
|
|
546
|
-
AppStartup.
|
|
547
|
-
|
|
542
|
+
if (AppStartup.hasOnModuleInit(provider)) {
|
|
543
|
+
AppStartup.initializedModuleHooks.add(provider);
|
|
544
|
+
await provider.onModuleInit();
|
|
545
|
+
}
|
|
548
546
|
}
|
|
549
547
|
}
|
|
550
548
|
|
|
@@ -559,19 +557,27 @@ if (document.readyState === 'loading') {
|
|
|
559
557
|
}
|
|
560
558
|
|
|
561
559
|
for (const provider of injectables.values()) {
|
|
562
|
-
if (!(provider instanceof OnModuleDestroy)) {
|
|
563
|
-
continue;
|
|
564
|
-
}
|
|
565
|
-
|
|
566
560
|
if (AppStartup.destroyedModuleHooks.has(provider)) {
|
|
567
561
|
continue;
|
|
568
562
|
}
|
|
569
563
|
|
|
570
|
-
AppStartup.
|
|
571
|
-
|
|
564
|
+
if (AppStartup.hasOnModuleDestroy(provider)) {
|
|
565
|
+
AppStartup.destroyedModuleHooks.add(provider);
|
|
566
|
+
await provider.onModuleDestroy();
|
|
567
|
+
}
|
|
572
568
|
}
|
|
573
569
|
}
|
|
574
570
|
|
|
571
|
+
private static hasOnModuleInit(provider: any): provider is OnModuleInit {
|
|
572
|
+
return !!provider && typeof provider.onModuleInit === "function";
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
private static hasOnModuleDestroy(
|
|
576
|
+
provider: any,
|
|
577
|
+
): provider is OnModuleDestroy {
|
|
578
|
+
return !!provider && typeof provider.onModuleDestroy === "function";
|
|
579
|
+
}
|
|
580
|
+
|
|
575
581
|
private static registerRoutes(module: any) {
|
|
576
582
|
const controllers: Map<
|
|
577
583
|
any,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
1
|
+
export interface OnModuleDestroy {
|
|
2
|
+
onModuleDestroy(): Promise<void> | void;
|
|
3
3
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
1
|
+
export interface OnModuleInit {
|
|
2
|
+
onModuleInit(): Promise<void> | void;
|
|
3
3
|
}
|