Skip to content

Commit

Permalink
fix(): publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
houssenedao committed Dec 16, 2021
1 parent 22ba62b commit 7c130f6
Show file tree
Hide file tree
Showing 18 changed files with 70 additions and 39 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/publisher.yml
Original file line number Diff line number Diff line change
@@ -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 }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NestJsNotify } from "../../interfaces";
import { NestJsNotify } from '../../interfaces';

export interface IFirebaseCloudMessagingChannel extends NestJsNotify {
/**
Expand Down
10 changes: 6 additions & 4 deletions lib/channels/fcm/firebase-cloud-messaging.channel.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
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 {
constructor() {
//
}

public async send(notification: IFirebaseCloudMessagingChannel): Promise<any> {
public async send(
notification: IFirebaseCloudMessagingChannel,
): Promise<any> {
return Promise.resolve(undefined);
}
}
4 changes: 2 additions & 2 deletions lib/channels/nexmo/nexmo.channel.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions lib/channels/sendgrid/sendgrid.channel.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions lib/channels/slack/slack.channel.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion lib/channels/telegram/telegram-channel.interface.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NestJsNotify } from "../../interfaces";
import { NestJsNotify } from '../../interfaces';

/** Telegram channel model
* @interface ITelegramChannel
Expand Down
6 changes: 3 additions & 3 deletions lib/channels/telegram/telegram.channel.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions lib/channels/twilio/twilio.channel.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions lib/channels/twitter/twitter.channel.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions lib/channels/webhook/webhook-channel.interface.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NestJsNotify } from "../../interfaces";
import { NestJsNotify } from '../../interfaces';

/**
* Webhook channel model
Expand All @@ -19,4 +19,4 @@ export interface IWebhookChannel extends NestJsNotify {
* @returns {any} http payload data
*/
toWebhook?(): any;
}
}
12 changes: 7 additions & 5 deletions lib/channels/webhook/webhook.channel.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -18,7 +18,9 @@ export class WebhookChannel implements INestjsNotifyChannel {
* @param {IWebhookChannel} notification
* @return Promise<AxiosResponse<any>>
*/
public async send(notification: IWebhookChannel): Promise<AxiosResponse<any>> {
public async send(
notification: IWebhookChannel,
): Promise<AxiosResponse<any>> {
return Promise.resolve(undefined);
}
}
2 changes: 1 addition & 1 deletion lib/constants/nestjs-notify-provider.constant.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const NESTJS_NOTIFY_OPTIONS = 'NESTJS_NOTIFY_OPTIONS';
export const NESTJS_NOTIFY_OPTIONS = 'NESTJS_NOTIFY_OPTIONS';
2 changes: 1 addition & 1 deletion lib/interfaces/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './nestjs-notify.interface';
export * from './nestjs-notify-module.interface';
export * from './nestjs-notify-channel.interface'
export * from './nestjs-notify-channel.interface';
4 changes: 2 additions & 2 deletions lib/interfaces/nestjs-notify-channel.interface.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NestJsNotify } from "./nestjs-notify.interface";
import { NestJsNotify } from './nestjs-notify.interface';

/**
* @interface INestjsNotifyChannel
Expand All @@ -11,4 +11,4 @@ export interface INestjsNotifyChannel {
* @return Promise<any>
*/
send(notification: NestJsNotify): Promise<any>;
}
}
8 changes: 5 additions & 3 deletions lib/interfaces/nestjs-notify-module.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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> | NestjsNotifyModuleOptions;
createNestjsNotifyOptions():
| Promise<NestjsNotifyModuleOptions>
| NestjsNotifyModuleOptions;
}

/**
Expand All @@ -35,4 +37,4 @@ export interface NestjsNotifyModuleAsyncOptions
/**
* @interface NestjsNotifyModuleOptions
*/
export interface NestjsNotifyModuleOptions {}
export interface NestjsNotifyModuleOptions {}
4 changes: 2 additions & 2 deletions lib/interfaces/nestjs-notify.interface.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -16,4 +16,4 @@ export interface NestJsNotify {
* @returns json
*/
toPayload?(): Record<string, any>;
}
}
16 changes: 12 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -70,9 +69,18 @@
"lint-staged": {
"**/*": "pretty-quick --staged"
},
"author": {
"name": "Houssene Dao",
"email": "[email protected]",
"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": [
Expand Down

0 comments on commit 7c130f6

Please sign in to comment.