From 7c130f6aa1e6fef788ac9e9d54456b46169df18b Mon Sep 17 00:00:00 2001 From: Houssene Dao Date: Thu, 16 Dec 2021 14:47:22 +0000 Subject: [PATCH] fix(): publish action --- .github/workflows/publisher.yml | 17 +++++++++++++++++ ...irebase-cloud-messaging-channel.interface.ts | 2 +- .../fcm/firebase-cloud-messaging.channel.ts | 10 ++++++---- lib/channels/nexmo/nexmo.channel.ts | 4 ++-- lib/channels/sendgrid/sendgrid.channel.ts | 4 ++-- lib/channels/slack/slack.channel.ts | 4 ++-- .../telegram/telegram-channel.interface.ts | 2 +- lib/channels/telegram/telegram.channel.ts | 6 +++--- lib/channels/twilio/twilio.channel.ts | 4 ++-- lib/channels/twitter/twitter.channel.ts | 4 ++-- .../webhook/webhook-channel.interface.ts | 4 ++-- lib/channels/webhook/webhook.channel.ts | 12 +++++++----- .../nestjs-notify-provider.constant.ts | 2 +- lib/interfaces/index.ts | 2 +- .../nestjs-notify-channel.interface.ts | 4 ++-- .../nestjs-notify-module.interface.ts | 8 +++++--- lib/interfaces/nestjs-notify.interface.ts | 4 ++-- package.json | 16 ++++++++++++---- 18 files changed, 70 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/publisher.yml diff --git a/.github/workflows/publisher.yml b/.github/workflows/publisher.yml new file mode 100644 index 00000000..2a6003d5 --- /dev/null +++ b/.github/workflows/publisher.yml @@ -0,0 +1,17 @@ +name: Publish Package to npmjs +on: + release: + types: [created] +jobs: + npm-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '16.x' + registry-url: 'https://registry.npmjs.org' + - run: npm ci + - run: npm run publish:npm + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH }} diff --git a/lib/channels/fcm/firebase-cloud-messaging-channel.interface.ts b/lib/channels/fcm/firebase-cloud-messaging-channel.interface.ts index 95ba39df..bba4bd00 100644 --- a/lib/channels/fcm/firebase-cloud-messaging-channel.interface.ts +++ b/lib/channels/fcm/firebase-cloud-messaging-channel.interface.ts @@ -1,4 +1,4 @@ -import { NestJsNotify } from "../../interfaces"; +import { NestJsNotify } from '../../interfaces'; export interface IFirebaseCloudMessagingChannel extends NestJsNotify { /** diff --git a/lib/channels/fcm/firebase-cloud-messaging.channel.ts b/lib/channels/fcm/firebase-cloud-messaging.channel.ts index 880f4acc..94e0b931 100644 --- a/lib/channels/fcm/firebase-cloud-messaging.channel.ts +++ b/lib/channels/fcm/firebase-cloud-messaging.channel.ts @@ -1,6 +1,6 @@ -import { Injectable } from "@nestjs/common"; -import { INestjsNotifyChannel } from "../../interfaces"; -import { IFirebaseCloudMessagingChannel } from "./firebase-cloud-messaging-channel.interface"; +import { Injectable } from '@nestjs/common'; +import { INestjsNotifyChannel } from '../../interfaces'; +import { IFirebaseCloudMessagingChannel } from './firebase-cloud-messaging-channel.interface'; @Injectable() export class FirebaseCloudMessagingChannel implements INestjsNotifyChannel { @@ -8,7 +8,9 @@ export class FirebaseCloudMessagingChannel implements INestjsNotifyChannel { // } - public async send(notification: IFirebaseCloudMessagingChannel): Promise { + public async send( + notification: IFirebaseCloudMessagingChannel, + ): Promise { return Promise.resolve(undefined); } } diff --git a/lib/channels/nexmo/nexmo.channel.ts b/lib/channels/nexmo/nexmo.channel.ts index 45acdf25..9e458a86 100644 --- a/lib/channels/nexmo/nexmo.channel.ts +++ b/lib/channels/nexmo/nexmo.channel.ts @@ -1,5 +1,5 @@ -import { Injectable } from "@nestjs/common"; -import { INestjsNotifyChannel } from "../../interfaces"; +import { Injectable } from '@nestjs/common'; +import { INestjsNotifyChannel } from '../../interfaces'; @Injectable() export class NexmoChannel implements INestjsNotifyChannel { diff --git a/lib/channels/sendgrid/sendgrid.channel.ts b/lib/channels/sendgrid/sendgrid.channel.ts index ec6901e1..e74bc157 100644 --- a/lib/channels/sendgrid/sendgrid.channel.ts +++ b/lib/channels/sendgrid/sendgrid.channel.ts @@ -1,5 +1,5 @@ -import { Injectable } from "@nestjs/common"; -import { INestjsNotifyChannel } from "../../interfaces"; +import { Injectable } from '@nestjs/common'; +import { INestjsNotifyChannel } from '../../interfaces'; @Injectable() export class SendgridChannel implements INestjsNotifyChannel { diff --git a/lib/channels/slack/slack.channel.ts b/lib/channels/slack/slack.channel.ts index f6181328..ee887026 100644 --- a/lib/channels/slack/slack.channel.ts +++ b/lib/channels/slack/slack.channel.ts @@ -1,5 +1,5 @@ -import { Injectable } from "@nestjs/common"; -import { INestjsNotifyChannel } from "../../interfaces"; +import { Injectable } from '@nestjs/common'; +import { INestjsNotifyChannel } from '../../interfaces'; @Injectable() export class SlackChannel implements INestjsNotifyChannel { diff --git a/lib/channels/telegram/telegram-channel.interface.ts b/lib/channels/telegram/telegram-channel.interface.ts index 0838a3be..e6020010 100644 --- a/lib/channels/telegram/telegram-channel.interface.ts +++ b/lib/channels/telegram/telegram-channel.interface.ts @@ -1,4 +1,4 @@ -import { NestJsNotify } from "../../interfaces"; +import { NestJsNotify } from '../../interfaces'; /** Telegram channel model * @interface ITelegramChannel diff --git a/lib/channels/telegram/telegram.channel.ts b/lib/channels/telegram/telegram.channel.ts index 54fc3fa2..8324c997 100644 --- a/lib/channels/telegram/telegram.channel.ts +++ b/lib/channels/telegram/telegram.channel.ts @@ -1,6 +1,6 @@ -import { Injectable } from "@nestjs/common"; -import { INestjsNotifyChannel } from "../../interfaces"; -import { ITelegramChannel } from "./telegram-channel.interface"; +import { Injectable } from '@nestjs/common'; +import { INestjsNotifyChannel } from '../../interfaces'; +import { ITelegramChannel } from './telegram-channel.interface'; @Injectable() export class TelegramChannel implements INestjsNotifyChannel { diff --git a/lib/channels/twilio/twilio.channel.ts b/lib/channels/twilio/twilio.channel.ts index cb23c1d2..a515c207 100644 --- a/lib/channels/twilio/twilio.channel.ts +++ b/lib/channels/twilio/twilio.channel.ts @@ -1,5 +1,5 @@ -import { Injectable } from "@nestjs/common"; -import { INestjsNotifyChannel } from "../../interfaces"; +import { Injectable } from '@nestjs/common'; +import { INestjsNotifyChannel } from '../../interfaces'; @Injectable() export class TwilioChannel implements INestjsNotifyChannel { diff --git a/lib/channels/twitter/twitter.channel.ts b/lib/channels/twitter/twitter.channel.ts index 7edbf27c..b1c8ea4d 100644 --- a/lib/channels/twitter/twitter.channel.ts +++ b/lib/channels/twitter/twitter.channel.ts @@ -1,5 +1,5 @@ -import { Injectable } from "@nestjs/common"; -import { INestjsNotifyChannel } from "../../interfaces"; +import { Injectable } from '@nestjs/common'; +import { INestjsNotifyChannel } from '../../interfaces'; @Injectable() export class TwitterChannel implements INestjsNotifyChannel { diff --git a/lib/channels/webhook/webhook-channel.interface.ts b/lib/channels/webhook/webhook-channel.interface.ts index e5ce0a40..6a64b45b 100644 --- a/lib/channels/webhook/webhook-channel.interface.ts +++ b/lib/channels/webhook/webhook-channel.interface.ts @@ -1,4 +1,4 @@ -import { NestJsNotify } from "../../interfaces"; +import { NestJsNotify } from '../../interfaces'; /** * Webhook channel model @@ -19,4 +19,4 @@ export interface IWebhookChannel extends NestJsNotify { * @returns {any} http payload data */ toWebhook?(): any; -} \ No newline at end of file +} diff --git a/lib/channels/webhook/webhook.channel.ts b/lib/channels/webhook/webhook.channel.ts index 218d4668..bb77d6aa 100644 --- a/lib/channels/webhook/webhook.channel.ts +++ b/lib/channels/webhook/webhook.channel.ts @@ -1,8 +1,8 @@ -import { Injectable } from "@nestjs/common"; -import { HttpService } from "@nestjs/axios"; +import { Injectable } from '@nestjs/common'; +import { HttpService } from '@nestjs/axios'; import { AxiosResponse } from 'axios'; -import { IWebhookChannel } from "./webhook-channel.interface"; -import { INestjsNotifyChannel } from "../../interfaces"; +import { IWebhookChannel } from './webhook-channel.interface'; +import { INestjsNotifyChannel } from '../../interfaces'; @Injectable() export class WebhookChannel implements INestjsNotifyChannel { @@ -18,7 +18,9 @@ export class WebhookChannel implements INestjsNotifyChannel { * @param {IWebhookChannel} notification * @return Promise> */ - public async send(notification: IWebhookChannel): Promise> { + public async send( + notification: IWebhookChannel, + ): Promise> { return Promise.resolve(undefined); } } diff --git a/lib/constants/nestjs-notify-provider.constant.ts b/lib/constants/nestjs-notify-provider.constant.ts index 35172986..5e3c28b3 100644 --- a/lib/constants/nestjs-notify-provider.constant.ts +++ b/lib/constants/nestjs-notify-provider.constant.ts @@ -1 +1 @@ -export const NESTJS_NOTIFY_OPTIONS = 'NESTJS_NOTIFY_OPTIONS'; \ No newline at end of file +export const NESTJS_NOTIFY_OPTIONS = 'NESTJS_NOTIFY_OPTIONS'; diff --git a/lib/interfaces/index.ts b/lib/interfaces/index.ts index e4775b2e..483c9db7 100644 --- a/lib/interfaces/index.ts +++ b/lib/interfaces/index.ts @@ -1,3 +1,3 @@ export * from './nestjs-notify.interface'; export * from './nestjs-notify-module.interface'; -export * from './nestjs-notify-channel.interface' \ No newline at end of file +export * from './nestjs-notify-channel.interface'; diff --git a/lib/interfaces/nestjs-notify-channel.interface.ts b/lib/interfaces/nestjs-notify-channel.interface.ts index 9bf957a2..475b03de 100644 --- a/lib/interfaces/nestjs-notify-channel.interface.ts +++ b/lib/interfaces/nestjs-notify-channel.interface.ts @@ -1,4 +1,4 @@ -import { NestJsNotify } from "./nestjs-notify.interface"; +import { NestJsNotify } from './nestjs-notify.interface'; /** * @interface INestjsNotifyChannel @@ -11,4 +11,4 @@ export interface INestjsNotifyChannel { * @return Promise */ send(notification: NestJsNotify): Promise; -} \ No newline at end of file +} diff --git a/lib/interfaces/nestjs-notify-module.interface.ts b/lib/interfaces/nestjs-notify-module.interface.ts index 55db6317..3f2f5b40 100644 --- a/lib/interfaces/nestjs-notify-module.interface.ts +++ b/lib/interfaces/nestjs-notify-module.interface.ts @@ -2,14 +2,16 @@ * @interface NestjsNotifyModuleOptionsFactory * @property createNestjsNotifyOptions() */ -import { ModuleMetadata, Provider, Type } from "@nestjs/common"; +import { ModuleMetadata, Provider, Type } from '@nestjs/common'; /** * @interface NestjsNotifyModuleOptionsFactory * @property createNestjsNotifyOptions() */ export interface NestjsNotifyModuleOptionsFactory { - createNestjsNotifyOptions(): Promise | NestjsNotifyModuleOptions; + createNestjsNotifyOptions(): + | Promise + | NestjsNotifyModuleOptions; } /** @@ -35,4 +37,4 @@ export interface NestjsNotifyModuleAsyncOptions /** * @interface NestjsNotifyModuleOptions */ -export interface NestjsNotifyModuleOptions {} \ No newline at end of file +export interface NestjsNotifyModuleOptions {} diff --git a/lib/interfaces/nestjs-notify.interface.ts b/lib/interfaces/nestjs-notify.interface.ts index 9bb0842a..b8853f4f 100644 --- a/lib/interfaces/nestjs-notify.interface.ts +++ b/lib/interfaces/nestjs-notify.interface.ts @@ -1,5 +1,5 @@ import { Type } from '@nestjs/common'; -import { INestjsNotifyChannel } from "./nestjs-notify-channel.interface"; +import { INestjsNotifyChannel } from './nestjs-notify-channel.interface'; /** * @interface NestJsNotify @@ -16,4 +16,4 @@ export interface NestJsNotify { * @returns json */ toPayload?(): Record; -} \ No newline at end of file +} diff --git a/package.json b/package.json index 4a3b0dd2..4318bb67 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,7 @@ { - "name": "nestjs-notify", + "name": "@sinuos/nestjs-notification", "version": "0.0.0", - "description": "", - "author": "", + "description": "NestJS notification based on channel", "license": "MIT", "keywords": [ "nest", @@ -70,9 +69,18 @@ "lint-staged": { "**/*": "pretty-quick --staged" }, + "author": { + "name": "Houssene Dao", + "email": "dao.houssene@gmail.com", + "url": "https://twitter.com/houssenedao" + }, + "homepage": "https://github.com/sinuoslabs/nestjs-notification#readme", + "bugs": { + "url": "https://github.com/sinuoslabs/nestjs-notification/issues" + }, "repository": { "type": "git", - "url": "https://github.com/themartiangeeks/nestjs-notify" + "url": "https://github.com/sinuoslabs/nestjs-notification" }, "jest": { "moduleFileExtensions": [