Initial commit - Event Planner application
This commit is contained in:
9
node_modules/@nestjs/core/hooks/before-app-shutdown.hook.d.ts
generated
vendored
Normal file
9
node_modules/@nestjs/core/hooks/before-app-shutdown.hook.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Module } from '../injector/module';
|
||||
/**
|
||||
* Calls the `beforeApplicationShutdown` function on the module and its children
|
||||
* (providers / controllers).
|
||||
*
|
||||
* @param module The module which will be initialized
|
||||
* @param signal The signal which caused the shutdown
|
||||
*/
|
||||
export declare function callBeforeAppShutdownHook(module: Module, signal?: string): Promise<void>;
|
||||
51
node_modules/@nestjs/core/hooks/before-app-shutdown.hook.js
generated
vendored
Normal file
51
node_modules/@nestjs/core/hooks/before-app-shutdown.hook.js
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.callBeforeAppShutdownHook = callBeforeAppShutdownHook;
|
||||
const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
|
||||
const iterare_1 = require("iterare");
|
||||
const transient_instances_1 = require("../injector/helpers/transient-instances");
|
||||
/**
|
||||
* Checks if the given instance has the `beforeApplicationShutdown` function
|
||||
*
|
||||
* @param instance The instance which should be checked
|
||||
*/
|
||||
function hasBeforeApplicationShutdownHook(instance) {
|
||||
return (0, shared_utils_1.isFunction)(instance.beforeApplicationShutdown);
|
||||
}
|
||||
/**
|
||||
* Calls the given instances
|
||||
*/
|
||||
function callOperator(instances, signal) {
|
||||
return (0, iterare_1.iterate)(instances)
|
||||
.filter(instance => !(0, shared_utils_1.isNil)(instance))
|
||||
.filter(hasBeforeApplicationShutdownHook)
|
||||
.map(async (instance) => instance.beforeApplicationShutdown(signal))
|
||||
.toArray();
|
||||
}
|
||||
/**
|
||||
* Calls the `beforeApplicationShutdown` function on the module and its children
|
||||
* (providers / controllers).
|
||||
*
|
||||
* @param module The module which will be initialized
|
||||
* @param signal The signal which caused the shutdown
|
||||
*/
|
||||
async function callBeforeAppShutdownHook(module, signal) {
|
||||
const providers = module.getNonAliasProviders();
|
||||
const [_, moduleClassHost] = providers.shift();
|
||||
const instances = [
|
||||
...module.controllers,
|
||||
...providers,
|
||||
...module.injectables,
|
||||
...module.middlewares,
|
||||
];
|
||||
const nonTransientInstances = (0, transient_instances_1.getNonTransientInstances)(instances);
|
||||
await Promise.all(callOperator(nonTransientInstances, signal));
|
||||
const transientInstances = (0, transient_instances_1.getTransientInstances)(instances);
|
||||
await Promise.all(callOperator(transientInstances, signal));
|
||||
const moduleClassInstance = moduleClassHost.instance;
|
||||
if (moduleClassInstance &&
|
||||
hasBeforeApplicationShutdownHook(moduleClassInstance) &&
|
||||
moduleClassHost.isDependencyTreeStatic()) {
|
||||
await moduleClassInstance.beforeApplicationShutdown(signal);
|
||||
}
|
||||
}
|
||||
5
node_modules/@nestjs/core/hooks/index.d.ts
generated
vendored
Normal file
5
node_modules/@nestjs/core/hooks/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export * from './on-app-bootstrap.hook';
|
||||
export * from './on-app-shutdown.hook';
|
||||
export * from './on-module-destroy.hook';
|
||||
export * from './on-module-init.hook';
|
||||
export * from './before-app-shutdown.hook';
|
||||
8
node_modules/@nestjs/core/hooks/index.js
generated
vendored
Normal file
8
node_modules/@nestjs/core/hooks/index.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const tslib_1 = require("tslib");
|
||||
tslib_1.__exportStar(require("./on-app-bootstrap.hook"), exports);
|
||||
tslib_1.__exportStar(require("./on-app-shutdown.hook"), exports);
|
||||
tslib_1.__exportStar(require("./on-module-destroy.hook"), exports);
|
||||
tslib_1.__exportStar(require("./on-module-init.hook"), exports);
|
||||
tslib_1.__exportStar(require("./before-app-shutdown.hook"), exports);
|
||||
8
node_modules/@nestjs/core/hooks/on-app-bootstrap.hook.d.ts
generated
vendored
Normal file
8
node_modules/@nestjs/core/hooks/on-app-bootstrap.hook.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { Module } from '../injector/module';
|
||||
/**
|
||||
* Calls the `onApplicationBootstrap` function on the module and its children
|
||||
* (providers / controllers).
|
||||
*
|
||||
* @param module The module which will be initialized
|
||||
*/
|
||||
export declare function callModuleBootstrapHook(module: Module): Promise<any>;
|
||||
53
node_modules/@nestjs/core/hooks/on-app-bootstrap.hook.js
generated
vendored
Normal file
53
node_modules/@nestjs/core/hooks/on-app-bootstrap.hook.js
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.callModuleBootstrapHook = callModuleBootstrapHook;
|
||||
const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
|
||||
const iterare_1 = require("iterare");
|
||||
const transient_instances_1 = require("../injector/helpers/transient-instances");
|
||||
/**
|
||||
* Checks if the given instance has the `onApplicationBootstrap` function
|
||||
*
|
||||
* @param instance The instance which should be checked
|
||||
*/
|
||||
function hasOnAppBootstrapHook(instance) {
|
||||
return (0, shared_utils_1.isFunction)(instance.onApplicationBootstrap);
|
||||
}
|
||||
/**
|
||||
* Calls the given instances
|
||||
*/
|
||||
function callOperator(instances) {
|
||||
return (0, iterare_1.iterate)(instances)
|
||||
.filter(instance => !(0, shared_utils_1.isNil)(instance))
|
||||
.filter(hasOnAppBootstrapHook)
|
||||
.map(async (instance) => instance.onApplicationBootstrap())
|
||||
.toArray();
|
||||
}
|
||||
/**
|
||||
* Calls the `onApplicationBootstrap` function on the module and its children
|
||||
* (providers / controllers).
|
||||
*
|
||||
* @param module The module which will be initialized
|
||||
*/
|
||||
async function callModuleBootstrapHook(module) {
|
||||
const providers = module.getNonAliasProviders();
|
||||
// Module (class) instance is the first element of the providers array
|
||||
// Lifecycle hook has to be called once all classes are properly initialized
|
||||
const [_, moduleClassHost] = providers.shift();
|
||||
const instances = [
|
||||
...module.controllers,
|
||||
...providers,
|
||||
...module.injectables,
|
||||
...module.middlewares,
|
||||
];
|
||||
const nonTransientInstances = (0, transient_instances_1.getNonTransientInstances)(instances);
|
||||
await Promise.all(callOperator(nonTransientInstances));
|
||||
const transientInstances = (0, transient_instances_1.getTransientInstances)(instances);
|
||||
await Promise.all(callOperator(transientInstances));
|
||||
// Call the instance itself
|
||||
const moduleClassInstance = moduleClassHost.instance;
|
||||
if (moduleClassInstance &&
|
||||
hasOnAppBootstrapHook(moduleClassInstance) &&
|
||||
moduleClassHost.isDependencyTreeStatic()) {
|
||||
await moduleClassInstance.onApplicationBootstrap();
|
||||
}
|
||||
}
|
||||
9
node_modules/@nestjs/core/hooks/on-app-shutdown.hook.d.ts
generated
vendored
Normal file
9
node_modules/@nestjs/core/hooks/on-app-shutdown.hook.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Module } from '../injector/module';
|
||||
/**
|
||||
* Calls the `onApplicationShutdown` function on the module and its children
|
||||
* (providers / controllers).
|
||||
*
|
||||
* @param module The module which will be initialized
|
||||
* @param signal
|
||||
*/
|
||||
export declare function callAppShutdownHook(module: Module, signal?: string): Promise<any>;
|
||||
54
node_modules/@nestjs/core/hooks/on-app-shutdown.hook.js
generated
vendored
Normal file
54
node_modules/@nestjs/core/hooks/on-app-shutdown.hook.js
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.callAppShutdownHook = callAppShutdownHook;
|
||||
const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
|
||||
const iterare_1 = require("iterare");
|
||||
const transient_instances_1 = require("../injector/helpers/transient-instances");
|
||||
/**
|
||||
* Checks if the given instance has the `onApplicationShutdown` function
|
||||
*
|
||||
* @param instance The instance which should be checked
|
||||
*/
|
||||
function hasOnAppShutdownHook(instance) {
|
||||
return (0, shared_utils_1.isFunction)(instance.onApplicationShutdown);
|
||||
}
|
||||
/**
|
||||
* Calls the given instances
|
||||
*/
|
||||
function callOperator(instances, signal) {
|
||||
return (0, iterare_1.iterate)(instances)
|
||||
.filter(instance => !(0, shared_utils_1.isNil)(instance))
|
||||
.filter(hasOnAppShutdownHook)
|
||||
.map(async (instance) => instance.onApplicationShutdown(signal))
|
||||
.toArray();
|
||||
}
|
||||
/**
|
||||
* Calls the `onApplicationShutdown` function on the module and its children
|
||||
* (providers / controllers).
|
||||
*
|
||||
* @param module The module which will be initialized
|
||||
* @param signal
|
||||
*/
|
||||
async function callAppShutdownHook(module, signal) {
|
||||
const providers = module.getNonAliasProviders();
|
||||
// Module (class) instance is the first element of the providers array
|
||||
// Lifecycle hook has to be called once all classes are properly initialized
|
||||
const [_, moduleClassHost] = providers.shift();
|
||||
const instances = [
|
||||
...module.controllers,
|
||||
...providers,
|
||||
...module.injectables,
|
||||
...module.middlewares,
|
||||
];
|
||||
const nonTransientInstances = (0, transient_instances_1.getNonTransientInstances)(instances);
|
||||
await Promise.all(callOperator(nonTransientInstances, signal));
|
||||
const transientInstances = (0, transient_instances_1.getTransientInstances)(instances);
|
||||
await Promise.all(callOperator(transientInstances, signal));
|
||||
// Call the instance itself
|
||||
const moduleClassInstance = moduleClassHost.instance;
|
||||
if (moduleClassInstance &&
|
||||
hasOnAppShutdownHook(moduleClassInstance) &&
|
||||
moduleClassHost.isDependencyTreeStatic()) {
|
||||
await moduleClassInstance.onApplicationShutdown(signal);
|
||||
}
|
||||
}
|
||||
8
node_modules/@nestjs/core/hooks/on-module-destroy.hook.d.ts
generated
vendored
Normal file
8
node_modules/@nestjs/core/hooks/on-module-destroy.hook.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { Module } from '../injector/module';
|
||||
/**
|
||||
* Calls the `onModuleDestroy` function on the module and its children
|
||||
* (providers / controllers).
|
||||
*
|
||||
* @param module The module which will be initialized
|
||||
*/
|
||||
export declare function callModuleDestroyHook(module: Module): Promise<any>;
|
||||
53
node_modules/@nestjs/core/hooks/on-module-destroy.hook.js
generated
vendored
Normal file
53
node_modules/@nestjs/core/hooks/on-module-destroy.hook.js
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.callModuleDestroyHook = callModuleDestroyHook;
|
||||
const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
|
||||
const iterare_1 = require("iterare");
|
||||
const transient_instances_1 = require("../injector/helpers/transient-instances");
|
||||
/**
|
||||
* Returns true or false if the given instance has a `onModuleDestroy` function
|
||||
*
|
||||
* @param instance The instance which should be checked
|
||||
*/
|
||||
function hasOnModuleDestroyHook(instance) {
|
||||
return (0, shared_utils_1.isFunction)(instance.onModuleDestroy);
|
||||
}
|
||||
/**
|
||||
* Calls the given instances onModuleDestroy hook
|
||||
*/
|
||||
function callOperator(instances) {
|
||||
return (0, iterare_1.iterate)(instances)
|
||||
.filter(instance => !(0, shared_utils_1.isNil)(instance))
|
||||
.filter(hasOnModuleDestroyHook)
|
||||
.map(async (instance) => instance.onModuleDestroy())
|
||||
.toArray();
|
||||
}
|
||||
/**
|
||||
* Calls the `onModuleDestroy` function on the module and its children
|
||||
* (providers / controllers).
|
||||
*
|
||||
* @param module The module which will be initialized
|
||||
*/
|
||||
async function callModuleDestroyHook(module) {
|
||||
const providers = module.getNonAliasProviders();
|
||||
// Module (class) instance is the first element of the providers array
|
||||
// Lifecycle hook has to be called once all classes are properly destroyed
|
||||
const [_, moduleClassHost] = providers.shift();
|
||||
const instances = [
|
||||
...module.controllers,
|
||||
...providers,
|
||||
...module.injectables,
|
||||
...module.middlewares,
|
||||
];
|
||||
const nonTransientInstances = (0, transient_instances_1.getNonTransientInstances)(instances);
|
||||
await Promise.all(callOperator(nonTransientInstances));
|
||||
const transientInstances = (0, transient_instances_1.getTransientInstances)(instances);
|
||||
await Promise.all(callOperator(transientInstances));
|
||||
// Call the module instance itself
|
||||
const moduleClassInstance = moduleClassHost.instance;
|
||||
if (moduleClassInstance &&
|
||||
hasOnModuleDestroyHook(moduleClassInstance) &&
|
||||
moduleClassHost.isDependencyTreeStatic()) {
|
||||
await moduleClassInstance.onModuleDestroy();
|
||||
}
|
||||
}
|
||||
8
node_modules/@nestjs/core/hooks/on-module-init.hook.d.ts
generated
vendored
Normal file
8
node_modules/@nestjs/core/hooks/on-module-init.hook.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { Module } from '../injector/module';
|
||||
/**
|
||||
* Calls the `onModuleInit` function on the module and its children
|
||||
* (providers / controllers).
|
||||
*
|
||||
* @param module The module which will be initialized
|
||||
*/
|
||||
export declare function callModuleInitHook(module: Module): Promise<void>;
|
||||
53
node_modules/@nestjs/core/hooks/on-module-init.hook.js
generated
vendored
Normal file
53
node_modules/@nestjs/core/hooks/on-module-init.hook.js
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.callModuleInitHook = callModuleInitHook;
|
||||
const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
|
||||
const iterare_1 = require("iterare");
|
||||
const transient_instances_1 = require("../injector/helpers/transient-instances");
|
||||
/**
|
||||
* Returns true or false if the given instance has a `onModuleInit` function
|
||||
*
|
||||
* @param instance The instance which should be checked
|
||||
*/
|
||||
function hasOnModuleInitHook(instance) {
|
||||
return (0, shared_utils_1.isFunction)(instance.onModuleInit);
|
||||
}
|
||||
/**
|
||||
* Calls the given instances
|
||||
*/
|
||||
function callOperator(instances) {
|
||||
return (0, iterare_1.iterate)(instances)
|
||||
.filter(instance => !(0, shared_utils_1.isNil)(instance))
|
||||
.filter(hasOnModuleInitHook)
|
||||
.map(async (instance) => instance.onModuleInit())
|
||||
.toArray();
|
||||
}
|
||||
/**
|
||||
* Calls the `onModuleInit` function on the module and its children
|
||||
* (providers / controllers).
|
||||
*
|
||||
* @param module The module which will be initialized
|
||||
*/
|
||||
async function callModuleInitHook(module) {
|
||||
const providers = module.getNonAliasProviders();
|
||||
// Module (class) instance is the first element of the providers array
|
||||
// Lifecycle hook has to be called once all classes are properly initialized
|
||||
const [_, moduleClassHost] = providers.shift();
|
||||
const instances = [
|
||||
...module.controllers,
|
||||
...providers,
|
||||
...module.injectables,
|
||||
...module.middlewares,
|
||||
];
|
||||
const nonTransientInstances = (0, transient_instances_1.getNonTransientInstances)(instances);
|
||||
await Promise.all(callOperator(nonTransientInstances));
|
||||
const transientInstances = (0, transient_instances_1.getTransientInstances)(instances);
|
||||
await Promise.all(callOperator(transientInstances));
|
||||
// Call the instance itself
|
||||
const moduleClassInstance = moduleClassHost.instance;
|
||||
if (moduleClassInstance &&
|
||||
hasOnModuleInitHook(moduleClassInstance) &&
|
||||
moduleClassHost.isDependencyTreeStatic()) {
|
||||
await moduleClassInstance.onModuleInit();
|
||||
}
|
||||
}
|
||||
3
node_modules/@nestjs/core/hooks/utils/get-instances-grouped-by-hierarchy-level.d.ts
generated
vendored
Normal file
3
node_modules/@nestjs/core/hooks/utils/get-instances-grouped-by-hierarchy-level.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { InjectionToken } from '@nestjs/common';
|
||||
import { InstanceWrapper } from '../../injector/instance-wrapper.js';
|
||||
export declare function getInstancesGroupedByHierarchyLevel(...collections: Array<Map<InjectionToken, InstanceWrapper> | Array<[InjectionToken, InstanceWrapper]>>): Map<number, unknown[]>;
|
||||
27
node_modules/@nestjs/core/hooks/utils/get-instances-grouped-by-hierarchy-level.js
generated
vendored
Normal file
27
node_modules/@nestjs/core/hooks/utils/get-instances-grouped-by-hierarchy-level.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
export function getInstancesGroupedByHierarchyLevel(...collections) {
|
||||
const groupedByHierarchyLevel = new Map();
|
||||
for (const collection of collections) {
|
||||
for (const [_, wrapper] of collection) {
|
||||
if (!wrapper.isDependencyTreeStatic()) {
|
||||
continue;
|
||||
}
|
||||
const level = wrapper.hierarchyLevel;
|
||||
if (!groupedByHierarchyLevel.has(level)) {
|
||||
groupedByHierarchyLevel.set(level, []);
|
||||
}
|
||||
const byHierarchyLevelGroup = groupedByHierarchyLevel.get(level);
|
||||
if (wrapper.isTransient) {
|
||||
const staticTransientInstances = wrapper
|
||||
.getStaticTransientInstances()
|
||||
.filter(i => !!i)
|
||||
.map(i => i.instance);
|
||||
byHierarchyLevelGroup.push(...staticTransientInstances);
|
||||
continue;
|
||||
}
|
||||
if (wrapper.instance) {
|
||||
byHierarchyLevelGroup.push(wrapper.instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
return groupedByHierarchyLevel;
|
||||
}
|
||||
1
node_modules/@nestjs/core/hooks/utils/get-sorted-hierarchy-levels.d.ts
generated
vendored
Normal file
1
node_modules/@nestjs/core/hooks/utils/get-sorted-hierarchy-levels.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function getSortedHierarchyLevels(groups: Map<number, unknown[]>, order?: 'ASC' | 'DESC'): number[];
|
||||
7
node_modules/@nestjs/core/hooks/utils/get-sorted-hierarchy-levels.js
generated
vendored
Normal file
7
node_modules/@nestjs/core/hooks/utils/get-sorted-hierarchy-levels.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
export function getSortedHierarchyLevels(groups, order = 'ASC') {
|
||||
const comparator = order === 'ASC'
|
||||
? (a, b) => a - b
|
||||
: (a, b) => b - a;
|
||||
const levels = Array.from(groups.keys()).sort(comparator);
|
||||
return levels;
|
||||
}
|
||||
Reference in New Issue
Block a user