Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(providers): add zulip #4457

Merged
merged 11 commits into from
Oct 31, 2023
14 changes: 14 additions & 0 deletions apps/web/public/static/images/providers/dark/square/zulip.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions apps/web/public/static/images/providers/dark/zulip.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions apps/web/public/static/images/providers/light/square/zulip.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions apps/web/public/static/images/providers/light/zulip.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions libs/shared/src/consts/providers/channels/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,12 @@ export const chatProviders: IProviderConfig[] = [
docReference: 'https://developers.mattermost.com/integrate/webhooks/incoming/',
logoFileName: { light: 'mattermost.svg', dark: 'mattermost.svg' },
},
{
id: ChatProviderIdEnum.Zulip,
displayName: 'Zulip',
channel: ChannelTypeEnum.CHAT,
credentials: [] as IConfigCredentials[],
docReference: 'https://docs.novu.co/channels-and-providers/chat/zulip',
logoFileName: { light: 'zulip.svg', dark: 'zulip.svg' },
},
];
1 change: 1 addition & 0 deletions libs/shared/src/consts/providers/provider.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export enum ChatProviderIdEnum {
Discord = 'discord',
MsTeams = 'msteams',
Mattermost = 'mattermost',
Zulip = 'zulip',
}

export enum PushProviderIdEnum {
Expand Down
1 change: 1 addition & 0 deletions packages/application-generic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"@novu/termii": "^0.20.0-alpha.0",
"@novu/testing": "^0.20.0-alpha.0",
"@novu/twilio": "^0.20.0-alpha.0",
"@novu/zulip": "^0.20.0-alpha.0",
"@sentry/node": "^7.12.1",
"analytics-node": "^6.2.0",
"bullmq": "^3.10.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import { IntegrationEntity } from '@novu/dal';
import { DiscordHandler } from './handlers/discord.handler';
import { MSTeamsHandler } from './handlers/msteams.handler';
import { MattermostHandler } from './handlers/mattermost.handler';
import { ZulipHandler } from './handlers/zulip.handler';

export class ChatFactory implements IChatFactory {
handlers: IChatHandler[] = [
new SlackHandler(),
new DiscordHandler(),
new MSTeamsHandler(),
new MattermostHandler(),
new ZulipHandler(),
];

getHandler(integration: IntegrationEntity) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { ICredentials, ChatProviderIdEnum } from '@novu/shared';
import { ChannelTypeEnum } from '@novu/stateless';
import { BaseChatHandler } from './base.handler';
import { ZulipProvider } from '@novu/zulip';

export class ZulipHandler extends BaseChatHandler {
constructor() {
super(ChatProviderIdEnum.Zulip, ChannelTypeEnum.CHAT);
}

buildProvider(_credentials: ICredentials) {
this.provider = new ZulipProvider({});
}
}
78 changes: 65 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions providers/zulip/.czrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"path": "cz-conventional-changelog"
}
3 changes: 3 additions & 0 deletions providers/zulip/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../.eslintrc.js"
}
9 changes: 9 additions & 0 deletions providers/zulip/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.idea/*
.nyc_output
build
node_modules
test
src/**.js
coverage
*.log
package-lock.json
9 changes: 9 additions & 0 deletions providers/zulip/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Novu Zulip Provider

A Zulip chat provider library for [@novu/node](https://github.com/novuhq/novu)

## Usage

```javascript
FILL IN THE INITIALIZATION USAGE
michaldziuba03 marked this conversation as resolved.
Show resolved Hide resolved
```
8 changes: 8 additions & 0 deletions providers/zulip/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
moduleNameMapper: {
axios: 'axios/dist/node/axios.cjs',
},
};
Loading
Loading