Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { IEventHandler, EventsHandler } from '@nestjs/cqrs';
import { UserDeletedEvent } from '../impl/user-deleted.event';
import { Logger } from '@nestjs/common';
@EventsHandler(UserDeletedEvent)
export class UserDeletedHandler
implements IEventHandler {
handle(event: UserDeletedEvent) {
Logger.log(event, 'UserDeletedEvent'); // write here
}
}
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
const _1 = require("../");
const cqrs_1 = require("@nestjs/cqrs");
let AddonAfterEnableEventHandler = class AddonAfterEnableEventHandler {
handle(event) {
console.log("Addon After Enable Event applied: " + event.identification);
return undefined;
}
};
AddonAfterEnableEventHandler = __decorate([
cqrs_1.EventsHandler(_1.AddonAfterEnableEvent)
], AddonAfterEnableEventHandler);
exports.AddonAfterEnableEventHandler = AddonAfterEnableEventHandler;
//# sourceMappingURL=addon-after-enable.event.handler.js.map
import {Logger} from '@nestjs/common';
import {EventsHandler, IEventHandler} from '@nestjs/cqrs';
import {UserLoggedInEvent} from '../../impl/auth';
@EventsHandler(UserLoggedInEvent)
export class UserLoggedInHandler implements IEventHandler {
handle(event: UserLoggedInEvent): any {
Logger.log(event, 'UserLoggedInHandler');
}
}
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
const _1 = require("../");
const cqrs_1 = require("@nestjs/cqrs");
let AddonBeforeInstallEventHandler = class AddonBeforeInstallEventHandler {
handle(event) {
return undefined;
}
};
AddonBeforeInstallEventHandler = __decorate([
cqrs_1.EventsHandler(_1.AddonBeforeInstallEvent)
], AddonBeforeInstallEventHandler);
exports.AddonBeforeInstallEventHandler = AddonBeforeInstallEventHandler;
//# sourceMappingURL=addon-before-install.event.handler.js.map
import { EventsHandler, IEventHandler } from '@nestjs/cqrs';
import { Inject } from '@nestjs/common';
import { FeedbackQueryRepository } from '../../../domains/feedback/feedback-query.repository';
import { StoreFeedbackEvent } from './store-feedback.event';
@EventsHandler(StoreFeedbackEvent)
export class StoreFeedbackHandler implements IEventHandler {
constructor(
@Inject('FeedbackQueryRepository') private feedbackRepository: FeedbackQueryRepository) {
}
/**
* @param {StoreFeedbackEvent} event
* @returns {Promise}
*/
async handle(event: StoreFeedbackEvent) {
await this.feedbackRepository.store(event.feedback);
}
}
import { CommandBus, EventsHandler, IEventHandler } from '@nestjs/cqrs';
import {
CharacterPostedOnAllianceWallEvent,
CharacterPostedOnCharacterWallEvent, CharacterPostedOnCorporationWallEvent,
CharacterPostedOnWallEvent,
} from '../create.character.event';
import { NOTIFICATION_TYPE } from '../../../notification/notification.constants';
import { Character } from '../../../character/character.entity';
import { Notification } from '../../../notification/notification.entity';
import * as uuidv4 from 'uuid/v4';
import { CreateNotificationCommand } from '../../../notification/commands/create.command';
@EventsHandler(
CharacterPostedOnCharacterWallEvent,
CharacterPostedOnCorporationWallEvent,
CharacterPostedOnAllianceWallEvent,
)
export class CharacterPostedOnWallEventHandler
implements IEventHandler {
constructor(
private readonly commandBus: CommandBus,
) {
}
async handle(event: CharacterPostedOnWallEvent) {
const notificationType = this.notificationType(event);
const characters = await this.getCharactersToReceiveNotification(event, notificationType);
const eventUuid = uuidv4();
import { AddonAfterInstallEvent } from "../";
import { EventsHandler, IEventHandler } from "@nestjs/cqrs";
@EventsHandler(AddonAfterInstallEvent)
export class AddonAfterInstallEventHandler implements IEventHandler {
handle(event: AddonAfterInstallEvent): any {
return undefined;
}
}
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
const cqrs_1 = require("@nestjs/cqrs");
const _1 = require("../");
let ExtensionAfterUninstallEventHandler = class ExtensionAfterUninstallEventHandler {
handle(event) {
return undefined;
}
};
ExtensionAfterUninstallEventHandler = __decorate([
cqrs_1.EventsHandler(_1.ExtensionAfterUninstallEvent)
], ExtensionAfterUninstallEventHandler);
exports.ExtensionAfterUninstallEventHandler = ExtensionAfterUninstallEventHandler;
//# sourceMappingURL=extension-after-uninstall.event.handler.js.map
import { AddonAfterUninstallEvent } from "../";
import { EventsHandler, IEventHandler } from "@nestjs/cqrs";
@EventsHandler(AddonAfterUninstallEvent)
export class AddonAfterUninstallEventHandler implements IEventHandler {
handle(event: AddonAfterUninstallEvent): any {
return undefined;
}
}
import { EventsHandler, IEventHandler } from '@nestjs/cqrs';
import { CreateFeedbackEvent } from './create-feedback.event';
import { Inject } from "@nestjs/common";
import { FeedbackCommandRepository } from '../../../domains/feedback/feedback-command.repository';
@EventsHandler(CreateFeedbackEvent)
export class CreateFeedbackHandler implements IEventHandler {
constructor(
@Inject('FeedbackQueryRepository') private feedbackRepository: FeedbackCommandRepository) {
}
async handle(feedback: CreateFeedbackEvent) {
await this.feedbackRepository.store(feedback.feedback);
}
}