From cede35c7eaaea516dd275fc9fd7fe0770615cd43 Mon Sep 17 00:00:00 2001 From: Kanav Arora Date: Wed, 11 Oct 2023 22:50:37 +0530 Subject: [PATCH 01/18] feat(provider): guilded provider added --- .../static/images/providers/dark/guilded.svg | 9 ++ .../static/images/providers/light/guilded.svg | 9 ++ .../src/consts/providers/channels/chat.ts | 10 +- .../credentials/provider-credentials.ts | 15 +++ .../src/consts/providers/provider.enum.ts | 1 + packages/application-generic/package.json | 1 + .../src/factories/chat/chat.factory.ts | 2 + .../chat/handlers/guilded.handler.ts | 16 ++++ pnpm-lock.yaml | 54 +++++++++-- providers/guilded/.czrc | 3 + providers/guilded/.eslintrc.json | 3 + providers/guilded/.gitignore | 9 ++ providers/guilded/README.md | 9 ++ providers/guilded/jest.config.js | 5 + providers/guilded/package.json | 93 +++++++++++++++++++ providers/guilded/src/index.ts | 1 + .../guilded/src/lib/guilded.provider.spec.ts | 24 +++++ providers/guilded/src/lib/guilded.provider.ts | 28 ++++++ providers/guilded/tsconfig.json | 10 ++ providers/guilded/tsconfig.module.json | 9 ++ 20 files changed, 304 insertions(+), 7 deletions(-) create mode 100644 apps/web/public/static/images/providers/dark/guilded.svg create mode 100644 apps/web/public/static/images/providers/light/guilded.svg create mode 100644 packages/application-generic/src/factories/chat/handlers/guilded.handler.ts create mode 100644 providers/guilded/.czrc create mode 100644 providers/guilded/.eslintrc.json create mode 100644 providers/guilded/.gitignore create mode 100644 providers/guilded/README.md create mode 100644 providers/guilded/jest.config.js create mode 100644 providers/guilded/package.json create mode 100644 providers/guilded/src/index.ts create mode 100644 providers/guilded/src/lib/guilded.provider.spec.ts create mode 100644 providers/guilded/src/lib/guilded.provider.ts create mode 100644 providers/guilded/tsconfig.json create mode 100644 providers/guilded/tsconfig.module.json diff --git a/apps/web/public/static/images/providers/dark/guilded.svg b/apps/web/public/static/images/providers/dark/guilded.svg new file mode 100644 index 00000000000..7ddf3681804 --- /dev/null +++ b/apps/web/public/static/images/providers/dark/guilded.svg @@ -0,0 +1,9 @@ + + + + Assets / Logomark + Wordmark / Guilded-Logomark+Wordmark-White + Created with Sketch. + + + + \ No newline at end of file diff --git a/apps/web/public/static/images/providers/light/guilded.svg b/apps/web/public/static/images/providers/light/guilded.svg new file mode 100644 index 00000000000..56e5d7b1ec0 --- /dev/null +++ b/apps/web/public/static/images/providers/light/guilded.svg @@ -0,0 +1,9 @@ + + + + Assets / Logomark + Wordmark / Guilded-Logomark+Wordmark-Black + Created with Sketch. + + + + \ No newline at end of file diff --git a/libs/shared/src/consts/providers/channels/chat.ts b/libs/shared/src/consts/providers/channels/chat.ts index 998f4a109cc..faff44b8419 100644 --- a/libs/shared/src/consts/providers/channels/chat.ts +++ b/libs/shared/src/consts/providers/channels/chat.ts @@ -1,5 +1,5 @@ import { IConfigCredentials, IProviderConfig } from '../provider.interface'; -import { slackConfig } from '../credentials'; +import { guildedConfig, slackConfig } from '../credentials'; import { ChatProviderIdEnum } from '../provider.enum'; import { ChannelTypeEnum } from '../../../types'; @@ -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.Guilded, + displayName: 'Guilded', + channel: ChannelTypeEnum.CHAT, + credentials: guildedConfig, + docReference: 'https://www.guilded.gg/docs/api/chat/ChatMessage', + logoFileName: { light: 'guilded.svg', dark: 'guilded.svg' }, + }, ]; diff --git a/libs/shared/src/consts/providers/credentials/provider-credentials.ts b/libs/shared/src/consts/providers/credentials/provider-credentials.ts index f48e8c106fe..a1bc4c2bcf8 100644 --- a/libs/shared/src/consts/providers/credentials/provider-credentials.ts +++ b/libs/shared/src/consts/providers/credentials/provider-credentials.ts @@ -422,6 +422,21 @@ export const twilioConfig: IConfigCredentials[] = [ ...smsConfigBase, ]; +export const guildedConfig: IConfigCredentials[] = [ + { + key: CredentialsKeyEnum.ApiKey, + displayName: 'API Key', + type: 'string', + required: true, + }, + { + key: CredentialsKeyEnum.MessageProfileId, + displayName: 'Channel ID', + type: 'string', + required: true, + }, +]; + export const slackConfig: IConfigCredentials[] = [ { key: CredentialsKeyEnum.ApplicationId, diff --git a/libs/shared/src/consts/providers/provider.enum.ts b/libs/shared/src/consts/providers/provider.enum.ts index 9a59244472b..8b3a6790342 100644 --- a/libs/shared/src/consts/providers/provider.enum.ts +++ b/libs/shared/src/consts/providers/provider.enum.ts @@ -79,6 +79,7 @@ export enum ChatProviderIdEnum { Discord = 'discord', MsTeams = 'msteams', Mattermost = 'mattermost', + Guilded = 'guilded', } export enum PushProviderIdEnum { diff --git a/packages/application-generic/package.json b/packages/application-generic/package.json index 5460f390b58..7548ff195e1 100644 --- a/packages/application-generic/package.json +++ b/packages/application-generic/package.json @@ -84,6 +84,7 @@ "@novu/sendinblue": "^0.20.0-alpha.1", "@novu/ses": "^0.20.0-alpha.1", "@novu/shared": "^0.20.0-alpha.1", + "@novu/guilded": "^0.20.0-alpha.1", "@novu/slack": "^0.20.0-alpha.1", "@novu/sms-central": "^0.20.0-alpha.0", "@novu/sms77": "^0.20.0-alpha.1", diff --git a/packages/application-generic/src/factories/chat/chat.factory.ts b/packages/application-generic/src/factories/chat/chat.factory.ts index 77ec8b29a02..aedb11c2241 100644 --- a/packages/application-generic/src/factories/chat/chat.factory.ts +++ b/packages/application-generic/src/factories/chat/chat.factory.ts @@ -4,6 +4,7 @@ import { IntegrationEntity } from '@novu/dal'; import { DiscordHandler } from './handlers/discord.handler'; import { MSTeamsHandler } from './handlers/msteams.handler'; import { MattermostHandler } from './handlers/mattermost.handler'; +import { GuildedHandler } from './handlers/guilded.handler'; export class ChatFactory implements IChatFactory { handlers: IChatHandler[] = [ @@ -11,6 +12,7 @@ export class ChatFactory implements IChatFactory { new DiscordHandler(), new MSTeamsHandler(), new MattermostHandler(), + new GuildedHandler(), ]; getHandler(integration: IntegrationEntity) { diff --git a/packages/application-generic/src/factories/chat/handlers/guilded.handler.ts b/packages/application-generic/src/factories/chat/handlers/guilded.handler.ts new file mode 100644 index 00000000000..fe97f971c42 --- /dev/null +++ b/packages/application-generic/src/factories/chat/handlers/guilded.handler.ts @@ -0,0 +1,16 @@ +import { ChannelTypeEnum } from '@novu/shared'; +import { GuildedChatProvider } from '@novu/guilded'; +import { ICredentials } from '@novu/shared'; +import { BaseChatHandler } from './base.handler'; + +export class GuildedHandler extends BaseChatHandler { + constructor() { + super('guilded', ChannelTypeEnum.CHAT); + } + + buildProvider(_credentials: ICredentials) { + this.provider = new GuildedChatProvider(); + } +} + +export * from './guilded.handler'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3023d1685bc..b6eebeee2f3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -390,7 +390,7 @@ importers: nodemon: 2.0.22 prettier: 2.8.7 sinon: 9.2.4 - ts-jest: 27.1.5_4aafjbpmnrfjtrzkyohogv4jce + ts-jest: 27.1.5_cnngzrja2umb46xxazlucyx2qu ts-loader: 9.4.2_fejcc7gjbwtmwzggoernzojija ts-node: 10.9.1_wh2cnrlliuuxb2etxm2m3ttgna tsconfig-paths: 4.1.2 @@ -1350,6 +1350,7 @@ importers: '@novu/fcm': ^0.20.0-alpha.1 '@novu/firetext': ^0.20.0-alpha.1 '@novu/forty-six-elks': ^0.20.0-alpha.1 + '@novu/guilded': ^0.20.0-alpha.1 '@novu/gupshup': ^0.20.0-alpha.1 '@novu/infobip': ^0.20.0-alpha.1 '@novu/kannel': ^0.20.0-alpha.1 @@ -1443,6 +1444,7 @@ importers: '@novu/fcm': link:../../providers/fcm '@novu/firetext': link:../../providers/firetext '@novu/forty-six-elks': link:../../providers/forty-six-elks + '@novu/guilded': link:../../providers/guilded '@novu/gupshup': link:../../providers/gupshup '@novu/infobip': link:../../providers/infobip '@novu/kannel': link:../../providers/kannel @@ -2369,6 +2371,45 @@ importers: ts-node: 10.9.1_wh2cnrlliuuxb2etxm2m3ttgna typescript: 4.9.5 + providers/guilded: + specifiers: + '@istanbuljs/nyc-config-typescript': ^1.0.1 + '@novu/stateless': ^0.20.0-alpha.1 + '@types/jest': ^29.5.0 + axios: ^1.3.3 + codecov: ^3.5.0 + cspell: ^4.1.0 + gh-pages: ^3.1.0 + jest: ^27.1.0 + npm-run-all: ^4.1.5 + nyc: ^15.1.0 + open-cli: ^6.0.1 + prettier: ~2.8.0 + rimraf: ^3.0.2 + ts-jest: ^27.0.5 + ts-node: ~10.9.1 + typedoc: ^0.24.0 + typescript: 4.9.5 + dependencies: + '@novu/stateless': link:../../packages/stateless + axios: 1.4.0 + devDependencies: + '@istanbuljs/nyc-config-typescript': 1.0.2_nyc@15.1.0 + '@types/jest': 29.5.2 + codecov: 3.8.3 + cspell: 4.2.8 + gh-pages: 3.2.3 + jest: 27.5.1_ts-node@10.9.1 + npm-run-all: 4.1.5 + nyc: 15.1.0 + open-cli: 6.0.1 + prettier: 2.8.7 + rimraf: 3.0.2 + ts-jest: 27.1.5_jt6hjr4g6reedzkbayzypxjbqa + ts-node: 10.9.1_wh2cnrlliuuxb2etxm2m3ttgna + typedoc: 0.24.6_typescript@4.9.5 + typescript: 4.9.5 + providers/gupshup: specifiers: '@babel/preset-env': ^7.13.15 @@ -5357,6 +5398,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/highlight': 7.22.13 + dev: true /@babel/code-frame/7.22.13: resolution: {integrity: sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==} @@ -27326,7 +27368,7 @@ packages: minimatch: 3.1.2 object.values: 1.1.6 resolve: 1.22.2 - semver: 6.3.0 + semver: 6.3.1 tsconfig-paths: 3.14.2 transitivePeerDependencies: - eslint-import-resolver-typescript @@ -41375,11 +41417,11 @@ packages: peerDependencies: rollup: ^2.0.0 dependencies: - '@babel/code-frame': 7.21.4 + '@babel/code-frame': 7.22.13 jest-worker: 26.6.2 rollup: 2.79.1 serialize-javascript: 4.0.0 - terser: 5.16.9 + terser: 5.19.3 /rollup-plugin-terser/7.0.2_rollup@3.20.2: resolution: {integrity: sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==} @@ -43746,6 +43788,7 @@ packages: acorn: 8.10.0 commander: 2.20.3 source-map-support: 0.5.21 + dev: true /terser/5.19.3: resolution: {integrity: sha512-pQzJ9UJzM0IgmT4FAtYI6+VqFf0lj/to58AV0Xfgg0Up37RyPG7Al+1cepC6/BVuAxR9oNb41/DL4DEoHJvTdg==} @@ -44107,7 +44150,7 @@ packages: yargs-parser: 20.2.9 dev: true - /ts-jest/27.1.5_4aafjbpmnrfjtrzkyohogv4jce: + /ts-jest/27.1.5_cnngzrja2umb46xxazlucyx2qu: resolution: {integrity: sha512-Xv6jBQPoBEvBq/5i2TeSG9tt/nqkbpcurrEG1b+2yfBrcJelOZF9Ml6dmyMh7bcW9JyFbRYpR5rxROSlBLTZHA==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} hasBin: true @@ -44128,7 +44171,6 @@ packages: esbuild: optional: true dependencies: - '@babel/core': 7.22.11 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 jest: 27.5.1_ts-node@10.9.1 diff --git a/providers/guilded/.czrc b/providers/guilded/.czrc new file mode 100644 index 00000000000..d1bcc209ca1 --- /dev/null +++ b/providers/guilded/.czrc @@ -0,0 +1,3 @@ +{ + "path": "cz-conventional-changelog" +} diff --git a/providers/guilded/.eslintrc.json b/providers/guilded/.eslintrc.json new file mode 100644 index 00000000000..ec40100be69 --- /dev/null +++ b/providers/guilded/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "../../.eslintrc.js" +} diff --git a/providers/guilded/.gitignore b/providers/guilded/.gitignore new file mode 100644 index 00000000000..963d5292865 --- /dev/null +++ b/providers/guilded/.gitignore @@ -0,0 +1,9 @@ +.idea/* +.nyc_output +build +node_modules +test +src/**.js +coverage +*.log +package-lock.json diff --git a/providers/guilded/README.md b/providers/guilded/README.md new file mode 100644 index 00000000000..2272b02885b --- /dev/null +++ b/providers/guilded/README.md @@ -0,0 +1,9 @@ +# Novu Guilded Provider + +A Guilded chat provider library for [@novu/node](https://github.com/novuhq/novu) + +## Usage + +```javascript + FILL IN THE INITIALIZATION USAGE +``` diff --git a/providers/guilded/jest.config.js b/providers/guilded/jest.config.js new file mode 100644 index 00000000000..e86e13bab91 --- /dev/null +++ b/providers/guilded/jest.config.js @@ -0,0 +1,5 @@ +/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', +}; diff --git a/providers/guilded/package.json b/providers/guilded/package.json new file mode 100644 index 00000000000..32ebea65d21 --- /dev/null +++ b/providers/guilded/package.json @@ -0,0 +1,93 @@ +{ + "name": "@novu/guilded", + "version": "0.20.0-alpha.1", + "description": "A guilded wrapper for novu", + "main": "build/main/index.js", + "typings": "build/main/index.d.ts", + "module": "build/module/index.js", + "private": false, + "repository": "https://github.com/novuhq/novu", + "license": "MIT", + "keywords": [], + "scripts": { + "prebuild": "rimraf build", + "build": "run-p build:*", + "build:main": "tsc -p tsconfig.json", + "build:module": "tsc -p tsconfig.module.json", + "fix": "run-s fix:*", + "fix:prettier": "prettier \"src/**/*.ts\" --write", + "fix:lint": "eslint src --ext .ts --fix", + "test": "run-s test:*", + "lint": "eslint src --ext .ts", + "test:unit": "jest src", + "watch:build": "tsc -p tsconfig.json -w", + "watch:test": "jest src --watch", + "reset-hard": "git clean -dfx && git reset --hard && yarn", + "prepare-release": "run-s reset-hard test" + }, + "publishConfig": { + "access": "public" + }, + "engines": { + "node": ">=13.0.0 <17.0.0", + "pnpm": "^7.26.0" + }, + "dependencies": { + "@novu/stateless": "^0.20.0-alpha.1", + "axios": "^1.3.3" + }, + "devDependencies": { + "@istanbuljs/nyc-config-typescript": "^1.0.1", + "@types/jest": "^29.5.0", + "codecov": "^3.5.0", + "cspell": "^4.1.0", + "gh-pages": "^3.1.0", + "jest": "^27.1.0", + "npm-run-all": "^4.1.5", + "nyc": "^15.1.0", + "open-cli": "^6.0.1", + "prettier": "~2.8.0", + "rimraf": "^3.0.2", + "ts-jest": "^27.0.5", + "ts-node": "~10.9.1", + "typedoc": "^0.24.0", + "typescript": "4.9.5" + }, + "files": [ + "build/main", + "build/module", + "!**/*.spec.*", + "!**/*.json", + "CHANGELOG.md", + "LICENSE", + "README.md" + ], + "ava": { + "failFast": true, + "timeout": "60s", + "typescript": { + "rewritePaths": { + "src/": "build/main/" + } + }, + "files": [ + "!build/module/**" + ] + }, + "jest": { + "preset": "ts-jest", + "testEnvironment": "node", + "moduleNameMapper": { + "axios": "axios/dist/node/axios.cjs" + } + }, + "prettier": { + "singleQuote": true + }, + "nyc": { + "extends": "@istanbuljs/nyc-config-typescript", + "exclude": [ + "**/*.spec.js" + ] + } +} diff --git a/providers/guilded/src/index.ts b/providers/guilded/src/index.ts new file mode 100644 index 00000000000..eb82e0f831c --- /dev/null +++ b/providers/guilded/src/index.ts @@ -0,0 +1 @@ +export * from './lib/guilded.provider'; diff --git a/providers/guilded/src/lib/guilded.provider.spec.ts b/providers/guilded/src/lib/guilded.provider.spec.ts new file mode 100644 index 00000000000..f0b725b5666 --- /dev/null +++ b/providers/guilded/src/lib/guilded.provider.spec.ts @@ -0,0 +1,24 @@ +import { GuildedChatProvider } from './guilded.provider'; + +test('should trigger guilded library correctly', async () => { + const provider = new GuildedChatProvider(); + const spy = jest + .spyOn(provider, 'sendMessage') + .mockImplementation(async () => { + return { + dateCreated: new Date(), + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } as any; + }); + + await provider.sendMessage({ + webhookUrl: 'webhookUrl', + content: 'chat message', + }); + + expect(spy).toHaveBeenCalled(); + expect(spy).toHaveBeenCalledWith({ + webhookUrl: 'webhookUrl', + content: 'chat message', + }); +}); diff --git a/providers/guilded/src/lib/guilded.provider.ts b/providers/guilded/src/lib/guilded.provider.ts new file mode 100644 index 00000000000..a6a9f9a5ac8 --- /dev/null +++ b/providers/guilded/src/lib/guilded.provider.ts @@ -0,0 +1,28 @@ +import { + ChannelTypeEnum, + ISendMessageSuccessResponse, + IChatOptions, + IChatProvider, +} from '@novu/stateless'; + +import axios from 'axios'; + +export class GuildedChatProvider implements IChatProvider { + id = 'guilded'; + channelType = ChannelTypeEnum.CHAT as ChannelTypeEnum.CHAT; + private axiosInstance = axios.create(); + + async sendMessage( + options: IChatOptions + ): Promise { + const url = new URL(options.webhookUrl); + const response = await this.axiosInstance.post(url.toString(), { + content: options.content, + }); + + return { + id: response.data.id, + date: response.data.timestamp, + }; + } +} diff --git a/providers/guilded/tsconfig.json b/providers/guilded/tsconfig.json new file mode 100644 index 00000000000..5b8120fea36 --- /dev/null +++ b/providers/guilded/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "build/main", + "rootDir": "src", + "types": ["node", "jest"] + }, + "include": ["src/**/*.ts"], + "exclude": ["node_modules/**"] +} diff --git a/providers/guilded/tsconfig.module.json b/providers/guilded/tsconfig.module.json new file mode 100644 index 00000000000..79be3a5c40b --- /dev/null +++ b/providers/guilded/tsconfig.module.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "target": "esnext", + "outDir": "build/module", + "module": "esnext" + }, + "exclude": ["node_modules/**"] +} From 697a820b7214558c8f2e53d19149a86a3a141a73 Mon Sep 17 00:00:00 2001 From: Kanav Arora Date: Thu, 12 Oct 2023 21:05:45 +0530 Subject: [PATCH 02/18] fix(test): cspell fail fixed --- .cspell.json | 6 +++++- providers/guilded/README.md | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.cspell.json b/.cspell.json index 6f667c50dac..68e989ebfe6 100644 --- a/.cspell.json +++ b/.cspell.json @@ -510,7 +510,11 @@ "mediumdark", "Docgen", "clicksend", - "Clicksend" + "Clicksend", + "guilded", + "Guilded", + "Wordmark", + "Logomark" ], "flagWords": [], "patterns": [ diff --git a/providers/guilded/README.md b/providers/guilded/README.md index 2272b02885b..d09f095794a 100644 --- a/providers/guilded/README.md +++ b/providers/guilded/README.md @@ -5,5 +5,10 @@ A Guilded chat provider library for [@novu/node](https://github.com/novuhq/novu) ## Usage ```javascript - FILL IN THE INITIALIZATION USAGE +import { GuildedChatProvider } from './guilded.provider'; + +const provider = new GuildedChatProvider({ + apiKey: process.env.API_KEY, + channelID: process.env.CHANNEL_ID, +}); ``` From 327e7215d750468184edcf948f91931a1e4a1142 Mon Sep 17 00:00:00 2001 From: Kanav Arora Date: Wed, 11 Oct 2023 22:50:37 +0530 Subject: [PATCH 03/18] feat(provider): guilded provider added --- .../static/images/providers/dark/guilded.svg | 9 ++ .../static/images/providers/light/guilded.svg | 9 ++ .../src/consts/providers/channels/chat.ts | 10 +- .../credentials/provider-credentials.ts | 15 ++ .../src/consts/providers/provider.enum.ts | 1 + packages/application-generic/package.json | 48 ++++++ .../src/factories/chat/chat.factory.ts | 2 + .../chat/handlers/guilded.handler.ts | 16 ++ pnpm-lock.yaml | 146 +++++++++++++++++- providers/guilded/.czrc | 3 + providers/guilded/.eslintrc.json | 3 + providers/guilded/.gitignore | 9 ++ providers/guilded/README.md | 9 ++ providers/guilded/jest.config.js | 5 + providers/guilded/package.json | 93 +++++++++++ providers/guilded/src/index.ts | 1 + .../guilded/src/lib/guilded.provider.spec.ts | 24 +++ providers/guilded/src/lib/guilded.provider.ts | 28 ++++ providers/guilded/tsconfig.json | 10 ++ providers/guilded/tsconfig.module.json | 9 ++ 20 files changed, 443 insertions(+), 7 deletions(-) create mode 100644 apps/web/public/static/images/providers/dark/guilded.svg create mode 100644 apps/web/public/static/images/providers/light/guilded.svg create mode 100644 packages/application-generic/src/factories/chat/handlers/guilded.handler.ts create mode 100644 providers/guilded/.czrc create mode 100644 providers/guilded/.eslintrc.json create mode 100644 providers/guilded/.gitignore create mode 100644 providers/guilded/README.md create mode 100644 providers/guilded/jest.config.js create mode 100644 providers/guilded/package.json create mode 100644 providers/guilded/src/index.ts create mode 100644 providers/guilded/src/lib/guilded.provider.spec.ts create mode 100644 providers/guilded/src/lib/guilded.provider.ts create mode 100644 providers/guilded/tsconfig.json create mode 100644 providers/guilded/tsconfig.module.json diff --git a/apps/web/public/static/images/providers/dark/guilded.svg b/apps/web/public/static/images/providers/dark/guilded.svg new file mode 100644 index 00000000000..7ddf3681804 --- /dev/null +++ b/apps/web/public/static/images/providers/dark/guilded.svg @@ -0,0 +1,9 @@ + + + + Assets / Logomark + Wordmark / Guilded-Logomark+Wordmark-White + Created with Sketch. + + + + \ No newline at end of file diff --git a/apps/web/public/static/images/providers/light/guilded.svg b/apps/web/public/static/images/providers/light/guilded.svg new file mode 100644 index 00000000000..56e5d7b1ec0 --- /dev/null +++ b/apps/web/public/static/images/providers/light/guilded.svg @@ -0,0 +1,9 @@ + + + + Assets / Logomark + Wordmark / Guilded-Logomark+Wordmark-Black + Created with Sketch. + + + + \ No newline at end of file diff --git a/libs/shared/src/consts/providers/channels/chat.ts b/libs/shared/src/consts/providers/channels/chat.ts index 998f4a109cc..faff44b8419 100644 --- a/libs/shared/src/consts/providers/channels/chat.ts +++ b/libs/shared/src/consts/providers/channels/chat.ts @@ -1,5 +1,5 @@ import { IConfigCredentials, IProviderConfig } from '../provider.interface'; -import { slackConfig } from '../credentials'; +import { guildedConfig, slackConfig } from '../credentials'; import { ChatProviderIdEnum } from '../provider.enum'; import { ChannelTypeEnum } from '../../../types'; @@ -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.Guilded, + displayName: 'Guilded', + channel: ChannelTypeEnum.CHAT, + credentials: guildedConfig, + docReference: 'https://www.guilded.gg/docs/api/chat/ChatMessage', + logoFileName: { light: 'guilded.svg', dark: 'guilded.svg' }, + }, ]; diff --git a/libs/shared/src/consts/providers/credentials/provider-credentials.ts b/libs/shared/src/consts/providers/credentials/provider-credentials.ts index 2ff03ec0f75..633861280a0 100644 --- a/libs/shared/src/consts/providers/credentials/provider-credentials.ts +++ b/libs/shared/src/consts/providers/credentials/provider-credentials.ts @@ -422,6 +422,21 @@ export const twilioConfig: IConfigCredentials[] = [ ...smsConfigBase, ]; +export const guildedConfig: IConfigCredentials[] = [ + { + key: CredentialsKeyEnum.ApiKey, + displayName: 'API Key', + type: 'string', + required: true, + }, + { + key: CredentialsKeyEnum.MessageProfileId, + displayName: 'Channel ID', + type: 'string', + required: true, + }, +]; + export const slackConfig: IConfigCredentials[] = [ { key: CredentialsKeyEnum.ApplicationId, diff --git a/libs/shared/src/consts/providers/provider.enum.ts b/libs/shared/src/consts/providers/provider.enum.ts index de79f4dae62..d28407ac690 100644 --- a/libs/shared/src/consts/providers/provider.enum.ts +++ b/libs/shared/src/consts/providers/provider.enum.ts @@ -80,6 +80,7 @@ export enum ChatProviderIdEnum { Discord = 'discord', MsTeams = 'msteams', Mattermost = 'mattermost', + Guilded = 'guilded', } export enum PushProviderIdEnum { diff --git a/packages/application-generic/package.json b/packages/application-generic/package.json index 37f6022c624..c8ee68f8792 100644 --- a/packages/application-generic/package.json +++ b/packages/application-generic/package.json @@ -95,6 +95,54 @@ "@novu/termii": "^0.20.0", "@novu/testing": "^0.20.0", "@novu/twilio": "^0.20.0", + "@novu/africas-talking": "^0.20.0-alpha.1", + "@novu/apns": "^0.20.0-alpha.1", + "@novu/burst-sms": "^0.20.0-alpha.1", + "@novu/clickatell": "^0.20.0-alpha.1", + "@novu/dal": "^0.20.0-alpha.1", + "@novu/discord": "^0.20.0-alpha.1", + "@novu/email-webhook": "^0.20.0-alpha.0", + "@novu/emailjs": "^0.20.0-alpha.1", + "@novu/expo": "^0.20.0-alpha.1", + "@novu/fcm": "^0.20.0-alpha.1", + "@novu/firetext": "^0.20.0-alpha.1", + "@novu/forty-six-elks": "^0.20.0-alpha.1", + "@novu/gupshup": "^0.20.0-alpha.1", + "@novu/infobip": "^0.20.0-alpha.1", + "@novu/kannel": "^0.20.0-alpha.1", + "@novu/mailersend": "^0.20.0-alpha.1", + "@novu/mailgun": "^0.20.0-alpha.1", + "@novu/mailjet": "^0.20.0-alpha.1", + "@novu/mailtrap": "^0.20.0-alpha.1", + "@novu/mandrill": "^0.20.0-alpha.1", + "@novu/maqsam": "^0.20.0-alpha.1", + "@novu/mattermost": "^0.20.0-alpha.1", + "@novu/ms-teams": "^0.20.0-alpha.0", + "@novu/netcore": "^0.20.0-alpha.1", + "@novu/nodemailer": "^0.20.0-alpha.1", + "@novu/one-signal": "^0.20.0-alpha.1", + "@novu/outlook365": "^0.20.0-alpha.1", + "@novu/plivo": "^0.20.0-alpha.1", + "@novu/plunk": "^0.20.0-alpha.1", + "@novu/postmark": "^0.20.0-alpha.1", + "@novu/push-webhook": "^0.20.0-alpha.1", + "@novu/resend": "^0.20.0-alpha.1", + "@novu/sendchamp": "^0.20.0-alpha.1", + "@novu/sendgrid": "^0.20.0-alpha.1", + "@novu/sendinblue": "^0.20.0-alpha.1", + "@novu/ses": "^0.20.0-alpha.1", + "@novu/shared": "^0.20.0-alpha.1", + "@novu/guilded": "^0.20.0-alpha.1", + "@novu/slack": "^0.20.0-alpha.1", + "@novu/sms-central": "^0.20.0-alpha.0", + "@novu/sms77": "^0.20.0-alpha.1", + "@novu/sns": "^0.20.0-alpha.1", + "@novu/sparkpost": "^0.20.0-alpha.1", + "@novu/stateless": "^0.20.0-alpha.1", + "@novu/telnyx": "^0.20.0-alpha.1", + "@novu/termii": "^0.20.0-alpha.1", + "@novu/testing": "^0.20.0-alpha.1", + "@novu/twilio": "^0.20.0-alpha.1", "@sentry/node": "^7.12.1", "analytics-node": "^6.2.0", "bullmq": "^3.10.2", diff --git a/packages/application-generic/src/factories/chat/chat.factory.ts b/packages/application-generic/src/factories/chat/chat.factory.ts index 77ec8b29a02..aedb11c2241 100644 --- a/packages/application-generic/src/factories/chat/chat.factory.ts +++ b/packages/application-generic/src/factories/chat/chat.factory.ts @@ -4,6 +4,7 @@ import { IntegrationEntity } from '@novu/dal'; import { DiscordHandler } from './handlers/discord.handler'; import { MSTeamsHandler } from './handlers/msteams.handler'; import { MattermostHandler } from './handlers/mattermost.handler'; +import { GuildedHandler } from './handlers/guilded.handler'; export class ChatFactory implements IChatFactory { handlers: IChatHandler[] = [ @@ -11,6 +12,7 @@ export class ChatFactory implements IChatFactory { new DiscordHandler(), new MSTeamsHandler(), new MattermostHandler(), + new GuildedHandler(), ]; getHandler(integration: IntegrationEntity) { diff --git a/packages/application-generic/src/factories/chat/handlers/guilded.handler.ts b/packages/application-generic/src/factories/chat/handlers/guilded.handler.ts new file mode 100644 index 00000000000..fe97f971c42 --- /dev/null +++ b/packages/application-generic/src/factories/chat/handlers/guilded.handler.ts @@ -0,0 +1,16 @@ +import { ChannelTypeEnum } from '@novu/shared'; +import { GuildedChatProvider } from '@novu/guilded'; +import { ICredentials } from '@novu/shared'; +import { BaseChatHandler } from './base.handler'; + +export class GuildedHandler extends BaseChatHandler { + constructor() { + super('guilded', ChannelTypeEnum.CHAT); + } + + buildProvider(_credentials: ICredentials) { + this.provider = new GuildedChatProvider(); + } +} + +export * from './guilded.handler'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 762f449ad63..67ecdb7dd18 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1949,6 +1949,101 @@ importers: version: 4.9.5 packages/application-generic: + specifiers: + '@aws-sdk/client-s3': ^3.382.0 + '@aws-sdk/s3-request-presigner': ^3.382.0 + '@azure/storage-blob': ^12.11.0 + '@google-cloud/storage': ^6.2.3 + '@istanbuljs/nyc-config-typescript': ^1.0.1 + '@nestjs/common': '>=10' + '@nestjs/core': '>=10' + '@nestjs/jwt': ^10.1.0 + '@nestjs/swagger': '>=6' + '@nestjs/terminus': '>=10' + '@nestjs/testing': '>=10' + '@novu/africas-talking': ^0.20.0-alpha.1 + '@novu/apns': ^0.20.0-alpha.1 + '@novu/burst-sms': ^0.20.0-alpha.1 + '@novu/clickatell': ^0.20.0-alpha.1 + '@novu/dal': ^0.20.0-alpha.1 + '@novu/discord': ^0.20.0-alpha.1 + '@novu/email-webhook': ^0.20.0-alpha.0 + '@novu/emailjs': ^0.20.0-alpha.1 + '@novu/expo': ^0.20.0-alpha.1 + '@novu/fcm': ^0.20.0-alpha.1 + '@novu/firetext': ^0.20.0-alpha.1 + '@novu/forty-six-elks': ^0.20.0-alpha.1 + '@novu/guilded': ^0.20.0-alpha.1 + '@novu/gupshup': ^0.20.0-alpha.1 + '@novu/infobip': ^0.20.0-alpha.1 + '@novu/kannel': ^0.20.0-alpha.1 + '@novu/mailersend': ^0.20.0-alpha.1 + '@novu/mailgun': ^0.20.0-alpha.1 + '@novu/mailjet': ^0.20.0-alpha.1 + '@novu/mailtrap': ^0.20.0-alpha.1 + '@novu/mandrill': ^0.20.0-alpha.1 + '@novu/maqsam': ^0.20.0-alpha.1 + '@novu/mattermost': ^0.20.0-alpha.1 + '@novu/ms-teams': ^0.20.0-alpha.0 + '@novu/netcore': ^0.20.0-alpha.1 + '@novu/nodemailer': ^0.20.0-alpha.1 + '@novu/one-signal': ^0.20.0-alpha.1 + '@novu/outlook365': ^0.20.0-alpha.1 + '@novu/plivo': ^0.20.0-alpha.1 + '@novu/plunk': ^0.20.0-alpha.1 + '@novu/postmark': ^0.20.0-alpha.1 + '@novu/push-webhook': ^0.20.0-alpha.1 + '@novu/resend': ^0.20.0-alpha.1 + '@novu/sendchamp': ^0.20.0-alpha.1 + '@novu/sendgrid': ^0.20.0-alpha.1 + '@novu/sendinblue': ^0.20.0-alpha.1 + '@novu/ses': ^0.20.0-alpha.1 + '@novu/shared': ^0.20.0-alpha.1 + '@novu/slack': ^0.20.0-alpha.1 + '@novu/sms-central': ^0.20.0-alpha.0 + '@novu/sms77': ^0.20.0-alpha.1 + '@novu/sns': ^0.20.0-alpha.1 + '@novu/sparkpost': ^0.20.0-alpha.1 + '@novu/stateless': ^0.20.0-alpha.1 + '@novu/telnyx': ^0.20.0-alpha.1 + '@novu/termii': ^0.20.0-alpha.1 + '@novu/testing': ^0.20.0-alpha.1 + '@novu/twilio': ^0.20.0-alpha.1 + '@sentry/node': ^7.12.1 + '@taskforcesh/bullmq-pro': 5.1.14 + '@types/analytics-node': ^3.1.9 + '@types/jest': 29.5.2 + '@types/sinon': ^9.0.0 + analytics-node: ^6.2.0 + bullmq: ^3.10.2 + class-transformer: ^0.5.1 + class-validator: ^0.14.0 + codecov: ^3.5.0 + cpx: ^1.5.0 + date-fns: ^2.29.2 + dotenv: ^8.2.0 + handlebars: ^4.7.7 + ioredis: ^5.2.4 + jest: ^27.1.0 + launchdarkly-node-server-sdk: ^7.0.1 + lodash: ^4.17.15 + mixpanel: ^0.17.0 + nestjs-pino: ^3.4.0 + newrelic: ^9 + node-fetch: ^3.2.10 + npm-run-all: ^4.1.5 + nyc: ^15.1.0 + pino-http: ^8.3.3 + pino-pretty: ^9.4.0 + prettier: ~2.8.0 + redlock: 4.2.0 + reflect-metadata: ^0.1.13 + rimraf: ^3.0.2 + rrule: ^2.7.2 + sinon: ^9.2.4 + ts-jest: ^27.0.5 + ts-node: ~10.9.1 + typescript: 4.9.5 dependencies: '@aws-sdk/client-s3': specifier: ^3.382.0 @@ -3486,6 +3581,45 @@ importers: specifier: 4.9.5 version: 4.9.5 + providers/guilded: + specifiers: + '@istanbuljs/nyc-config-typescript': ^1.0.1 + '@novu/stateless': ^0.20.0-alpha.1 + '@types/jest': ^29.5.0 + axios: ^1.3.3 + codecov: ^3.5.0 + cspell: ^4.1.0 + gh-pages: ^3.1.0 + jest: ^27.1.0 + npm-run-all: ^4.1.5 + nyc: ^15.1.0 + open-cli: ^6.0.1 + prettier: ~2.8.0 + rimraf: ^3.0.2 + ts-jest: ^27.0.5 + ts-node: ~10.9.1 + typedoc: ^0.24.0 + typescript: 4.9.5 + dependencies: + '@novu/stateless': link:../../packages/stateless + axios: 1.4.0 + devDependencies: + '@istanbuljs/nyc-config-typescript': 1.0.2_nyc@15.1.0 + '@types/jest': 29.5.2 + codecov: 3.8.3 + cspell: 4.2.8 + gh-pages: 3.2.3 + jest: 27.5.1_ts-node@10.9.1 + npm-run-all: 4.1.5 + nyc: 15.1.0 + open-cli: 6.0.1 + prettier: 2.8.7 + rimraf: 3.0.2 + ts-jest: 27.1.5_jt6hjr4g6reedzkbayzypxjbqa + ts-node: 10.9.1_wh2cnrlliuuxb2etxm2m3ttgna + typedoc: 0.24.6_typescript@4.9.5 + typescript: 4.9.5 + providers/gupshup: dependencies: '@novu/stateless': @@ -30416,7 +30550,8 @@ packages: object.fromentries: 2.0.6 object.groupby: 1.0.1 object.values: 1.1.6 - semver: 6.3.1 + resolve: 1.22.2 + semver: 6.3.0 tsconfig-paths: 3.14.2 transitivePeerDependencies: - eslint-import-resolver-typescript @@ -44395,12 +44530,11 @@ packages: peerDependencies: rollup: ^2.0.0 dependencies: - '@babel/code-frame': 7.21.4 + '@babel/code-frame': 7.22.13 jest-worker: 26.6.2 rollup: 2.79.1 serialize-javascript: 4.0.0 terser: 5.16.9 - dev: true /rollup-plugin-terser@7.0.2(rollup@3.20.2): resolution: {integrity: sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==} @@ -46746,6 +46880,7 @@ packages: acorn: 8.10.0 commander: 2.20.3 source-map-support: 0.5.21 + dev: true /terser@5.19.3: resolution: {integrity: sha512-pQzJ9UJzM0IgmT4FAtYI6+VqFf0lj/to58AV0Xfgg0Up37RyPG7Al+1cepC6/BVuAxR9oNb41/DL4DEoHJvTdg==} @@ -47112,7 +47247,7 @@ packages: yargs-parser: 20.2.9 dev: true - /ts-jest@27.1.5(@babel/core@7.23.2)(@types/jest@29.5.1)(jest@27.5.1)(typescript@4.9.5): + /ts-jest/27.1.5_4aafjbpmnrfjtrzkyohogv4jce: resolution: {integrity: sha512-Xv6jBQPoBEvBq/5i2TeSG9tt/nqkbpcurrEG1b+2yfBrcJelOZF9Ml6dmyMh7bcW9JyFbRYpR5rxROSlBLTZHA==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} hasBin: true @@ -47133,8 +47268,7 @@ packages: esbuild: optional: true dependencies: - '@babel/core': 7.23.2 - '@types/jest': 29.5.1 + '@babel/core': 7.22.11 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 jest: 27.5.1(ts-node@10.9.1) diff --git a/providers/guilded/.czrc b/providers/guilded/.czrc new file mode 100644 index 00000000000..d1bcc209ca1 --- /dev/null +++ b/providers/guilded/.czrc @@ -0,0 +1,3 @@ +{ + "path": "cz-conventional-changelog" +} diff --git a/providers/guilded/.eslintrc.json b/providers/guilded/.eslintrc.json new file mode 100644 index 00000000000..ec40100be69 --- /dev/null +++ b/providers/guilded/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "../../.eslintrc.js" +} diff --git a/providers/guilded/.gitignore b/providers/guilded/.gitignore new file mode 100644 index 00000000000..963d5292865 --- /dev/null +++ b/providers/guilded/.gitignore @@ -0,0 +1,9 @@ +.idea/* +.nyc_output +build +node_modules +test +src/**.js +coverage +*.log +package-lock.json diff --git a/providers/guilded/README.md b/providers/guilded/README.md new file mode 100644 index 00000000000..2272b02885b --- /dev/null +++ b/providers/guilded/README.md @@ -0,0 +1,9 @@ +# Novu Guilded Provider + +A Guilded chat provider library for [@novu/node](https://github.com/novuhq/novu) + +## Usage + +```javascript + FILL IN THE INITIALIZATION USAGE +``` diff --git a/providers/guilded/jest.config.js b/providers/guilded/jest.config.js new file mode 100644 index 00000000000..e86e13bab91 --- /dev/null +++ b/providers/guilded/jest.config.js @@ -0,0 +1,5 @@ +/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', +}; diff --git a/providers/guilded/package.json b/providers/guilded/package.json new file mode 100644 index 00000000000..32ebea65d21 --- /dev/null +++ b/providers/guilded/package.json @@ -0,0 +1,93 @@ +{ + "name": "@novu/guilded", + "version": "0.20.0-alpha.1", + "description": "A guilded wrapper for novu", + "main": "build/main/index.js", + "typings": "build/main/index.d.ts", + "module": "build/module/index.js", + "private": false, + "repository": "https://github.com/novuhq/novu", + "license": "MIT", + "keywords": [], + "scripts": { + "prebuild": "rimraf build", + "build": "run-p build:*", + "build:main": "tsc -p tsconfig.json", + "build:module": "tsc -p tsconfig.module.json", + "fix": "run-s fix:*", + "fix:prettier": "prettier \"src/**/*.ts\" --write", + "fix:lint": "eslint src --ext .ts --fix", + "test": "run-s test:*", + "lint": "eslint src --ext .ts", + "test:unit": "jest src", + "watch:build": "tsc -p tsconfig.json -w", + "watch:test": "jest src --watch", + "reset-hard": "git clean -dfx && git reset --hard && yarn", + "prepare-release": "run-s reset-hard test" + }, + "publishConfig": { + "access": "public" + }, + "engines": { + "node": ">=13.0.0 <17.0.0", + "pnpm": "^7.26.0" + }, + "dependencies": { + "@novu/stateless": "^0.20.0-alpha.1", + "axios": "^1.3.3" + }, + "devDependencies": { + "@istanbuljs/nyc-config-typescript": "^1.0.1", + "@types/jest": "^29.5.0", + "codecov": "^3.5.0", + "cspell": "^4.1.0", + "gh-pages": "^3.1.0", + "jest": "^27.1.0", + "npm-run-all": "^4.1.5", + "nyc": "^15.1.0", + "open-cli": "^6.0.1", + "prettier": "~2.8.0", + "rimraf": "^3.0.2", + "ts-jest": "^27.0.5", + "ts-node": "~10.9.1", + "typedoc": "^0.24.0", + "typescript": "4.9.5" + }, + "files": [ + "build/main", + "build/module", + "!**/*.spec.*", + "!**/*.json", + "CHANGELOG.md", + "LICENSE", + "README.md" + ], + "ava": { + "failFast": true, + "timeout": "60s", + "typescript": { + "rewritePaths": { + "src/": "build/main/" + } + }, + "files": [ + "!build/module/**" + ] + }, + "jest": { + "preset": "ts-jest", + "testEnvironment": "node", + "moduleNameMapper": { + "axios": "axios/dist/node/axios.cjs" + } + }, + "prettier": { + "singleQuote": true + }, + "nyc": { + "extends": "@istanbuljs/nyc-config-typescript", + "exclude": [ + "**/*.spec.js" + ] + } +} diff --git a/providers/guilded/src/index.ts b/providers/guilded/src/index.ts new file mode 100644 index 00000000000..eb82e0f831c --- /dev/null +++ b/providers/guilded/src/index.ts @@ -0,0 +1 @@ +export * from './lib/guilded.provider'; diff --git a/providers/guilded/src/lib/guilded.provider.spec.ts b/providers/guilded/src/lib/guilded.provider.spec.ts new file mode 100644 index 00000000000..f0b725b5666 --- /dev/null +++ b/providers/guilded/src/lib/guilded.provider.spec.ts @@ -0,0 +1,24 @@ +import { GuildedChatProvider } from './guilded.provider'; + +test('should trigger guilded library correctly', async () => { + const provider = new GuildedChatProvider(); + const spy = jest + .spyOn(provider, 'sendMessage') + .mockImplementation(async () => { + return { + dateCreated: new Date(), + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } as any; + }); + + await provider.sendMessage({ + webhookUrl: 'webhookUrl', + content: 'chat message', + }); + + expect(spy).toHaveBeenCalled(); + expect(spy).toHaveBeenCalledWith({ + webhookUrl: 'webhookUrl', + content: 'chat message', + }); +}); diff --git a/providers/guilded/src/lib/guilded.provider.ts b/providers/guilded/src/lib/guilded.provider.ts new file mode 100644 index 00000000000..a6a9f9a5ac8 --- /dev/null +++ b/providers/guilded/src/lib/guilded.provider.ts @@ -0,0 +1,28 @@ +import { + ChannelTypeEnum, + ISendMessageSuccessResponse, + IChatOptions, + IChatProvider, +} from '@novu/stateless'; + +import axios from 'axios'; + +export class GuildedChatProvider implements IChatProvider { + id = 'guilded'; + channelType = ChannelTypeEnum.CHAT as ChannelTypeEnum.CHAT; + private axiosInstance = axios.create(); + + async sendMessage( + options: IChatOptions + ): Promise { + const url = new URL(options.webhookUrl); + const response = await this.axiosInstance.post(url.toString(), { + content: options.content, + }); + + return { + id: response.data.id, + date: response.data.timestamp, + }; + } +} diff --git a/providers/guilded/tsconfig.json b/providers/guilded/tsconfig.json new file mode 100644 index 00000000000..5b8120fea36 --- /dev/null +++ b/providers/guilded/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "build/main", + "rootDir": "src", + "types": ["node", "jest"] + }, + "include": ["src/**/*.ts"], + "exclude": ["node_modules/**"] +} diff --git a/providers/guilded/tsconfig.module.json b/providers/guilded/tsconfig.module.json new file mode 100644 index 00000000000..79be3a5c40b --- /dev/null +++ b/providers/guilded/tsconfig.module.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "target": "esnext", + "outDir": "build/module", + "module": "esnext" + }, + "exclude": ["node_modules/**"] +} From 37d3d2bc07b4647b9e38ef975f018f6ec5c7fa75 Mon Sep 17 00:00:00 2001 From: Kanav Arora Date: Thu, 12 Oct 2023 21:05:45 +0530 Subject: [PATCH 04/18] fix(test): cspell fail fixed --- .cspell.json | 5 +++++ providers/guilded/README.md | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.cspell.json b/.cspell.json index 42a732732e9..da2d2f3b352 100644 --- a/.cspell.json +++ b/.cspell.json @@ -514,6 +514,11 @@ "Kamil", "MyΕ›liwiec", "nestframework" + "Clicksend", + "guilded", + "Guilded", + "Wordmark", + "Logomark" ], "flagWords": [], "patterns": [ diff --git a/providers/guilded/README.md b/providers/guilded/README.md index 2272b02885b..d09f095794a 100644 --- a/providers/guilded/README.md +++ b/providers/guilded/README.md @@ -5,5 +5,10 @@ A Guilded chat provider library for [@novu/node](https://github.com/novuhq/novu) ## Usage ```javascript - FILL IN THE INITIALIZATION USAGE +import { GuildedChatProvider } from './guilded.provider'; + +const provider = new GuildedChatProvider({ + apiKey: process.env.API_KEY, + channelID: process.env.CHANNEL_ID, +}); ``` From 70a6fe7803596d95f7a883bdc767cc652312bf62 Mon Sep 17 00:00:00 2001 From: Aditya Aryaman Das <128703909+alienishi@users.noreply.github.com> Date: Sun, 22 Oct 2023 15:03:59 +0530 Subject: [PATCH 05/18] Updated README.md --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1292d8953bb..3ce7999c422 100644 --- a/README.md +++ b/README.md @@ -23,13 +23,13 @@ BONUS: watch our video, answer the riddle, and win awesome swag!

πŸŽ‰ We're participating in Hacktoberfest 2023! πŸŽ‰

-Interested in participating in Hacktoberfest? We extend a warm invitation! You also get the opportunity to win some swag 😁 +Are you interested in participating in Hacktoberfest? We extend a warm invitation! You also get the opportunity to win some swag 😁 > ⭐️ If you're new to Hacktoberfest, you can learn more and register to participate [here](https://hacktoberfest.com/participation/). Registration is from **September 26th - October 31st**. - Our Hacktoberfest kickoff event is happening on October 2, 2023. πŸš€ - Check out our website for [hacktoberfest instructions](https://novu.co/hacktoberfest/). -- Join our [Discord and engage with our community](https://discord.com/invite/novu), get answers to your challenges, stay updated on events, announcements & prizes. +- Join our [Discord and engage with our community](https://discord.com/invite/novu), get answers to your challenges, and stay updated on events, announcements, and prizes. In addition to this repository, here are the other Novu repositories you can contribute to for Hacktoberfest: - [Novu Docs](https://github.com/novuhq/docs/issues) @@ -89,7 +89,7 @@ With Novu, you can create custom workflows and define conditions for each channe - πŸ“¦ Easy to set up and integrate - πŸ›‘ Debug and analyze multi-channel messages in a single dashboard - πŸ“¦ Embeddable notification center with real-time updates -- πŸ‘¨β€πŸ’» Community driven +- πŸ‘¨β€πŸ’» community-driven ## πŸ“š Table Of Contents @@ -108,7 +108,7 @@ With Novu, you can create custom workflows and define conditions for each channe ## πŸš€ Getting Started -We are excited to launch the complete Novu API and admin panel. Want to give it a test before the official release? Here is how: +We are excited to launch the complete Novu API and admin panel. Do you want to give it a test before the official release? Here is how: ``` npx novu init @@ -116,7 +116,7 @@ npx novu init After setting up your account using the cloud or docker version, you can trigger the API using the `@novu/node` package. -For API documentation and reference, please visit [Novu API Reference](https://docs.novu.co/api-reference/events/trigger-event). +Please visit [Novu API Reference](https://docs.novu.co/api-reference/events/trigger-event) for API documentation and reference. To get started with the Node.js package, you can install it using npm: @@ -232,11 +232,11 @@ Novu provides a single API to manage providers across multiple channels with a s ## πŸ“‹ Read Our Code Of Conduct -Before you begin coding and collaborating, please read our [Code of Conduct](https://github.com/novuhq/novu/blob/main/CODE_OF_CONDUCT.md) thoroughly to understand the standards (that you are required to adhere to) for community engagement. As part of our open-source community, we hold ourselves and other contributors to a high standard of communication. As a participant and contributor to this project, you are agreeing to abide by our [Code of Conduct](https://github.com/novuhq/novu/blob/main/CODE_OF_CONDUCT.md). +Before you begin coding and collaborating, please read our [Code of Conduct](https://github.com/novuhq/novu/blob/main/CODE_OF_CONDUCT.md) thoroughly to understand the standards (that you are required to adhere to) for community engagement. As part of our open-source community, we hold ourselves and other contributors to a high standard of communication. As a participant and contributor to this project, you agree to abide by our [Code of Conduct](https://github.com/novuhq/novu/blob/main/CODE_OF_CONDUCT.md). ## πŸ’» Need Help? -We are more than happy to help you. If you are getting any errors or facing problems while working on this project, join our [Discord server](https://discord.novu.co) and ask for help. We are open to discuss anything related to the project. +We are more than happy to help you. If you are getting any errors or facing problems while working on this project, join our [Discord server](https://discord.novu.co) and ask for help. We are open to discussing anything related to the project. ## ⚑ Immediate working space with Gitpod From 3e65106c4ca4ae2a94cc1a04a7d2d010c8b80cdc Mon Sep 17 00:00:00 2001 From: ainouzgali Date: Mon, 23 Oct 2023 14:10:20 +0300 Subject: [PATCH 06/18] feat: add actor to system variables (#4278) * feat: add actor to system variables * test: add test for actor variables * chore: update lock file --------- Co-authored-by: Dima Grossman --- .../events/dtos/trigger-event-request.dto.ts | 3 ++ .../dtos/trigger-event-to-all-request.dto.ts | 3 ++ .../src/app/events/e2e/trigger-event.e2e.ts | 42 ++++++++++++++++++- apps/api/src/app/events/events.controller.ts | 3 +- .../parse-event-request.command.ts | 1 + .../process-bulk-trigger.usecase.ts | 3 +- .../ExecutionDetailTrigger.tsx | 7 +++- .../send-message/send-message-chat.usecase.ts | 9 ++++ .../send-message-email.usecase.ts | 10 +++++ .../send-message-in-app.usecase.ts | 21 ++++++++-- .../send-message/send-message-push.usecase.ts | 9 ++++ .../send-message/send-message-sms.usecase.ts | 9 ++++ libs/dal/src/repositories/job/job.entity.ts | 1 + libs/dal/src/repositories/job/job.schema.ts | 3 ++ .../notification/notification.repository.ts | 2 +- .../message-template.interface.ts | 14 ++++++- .../notification-template.interface.ts | 1 + .../create-notification-jobs.usecase.ts | 5 ++- .../trigger-event/trigger-event.command.ts | 1 + pnpm-lock.yaml | 3 +- 20 files changed, 136 insertions(+), 14 deletions(-) diff --git a/apps/api/src/app/events/dtos/trigger-event-request.dto.ts b/apps/api/src/app/events/dtos/trigger-event-request.dto.ts index 4488d4fd22a..4c31e8e8e35 100644 --- a/apps/api/src/app/events/dtos/trigger-event-request.dto.ts +++ b/apps/api/src/app/events/dtos/trigger-event-request.dto.ts @@ -112,6 +112,9 @@ export class TriggerEventRequestDto { ], }) @IsOptional() + @ValidateIf((_, value) => typeof value !== 'string') + @ValidateNested() + @Type(() => SubscriberPayloadDto) actor?: TriggerRecipientSubscriber; @ApiProperty({ diff --git a/apps/api/src/app/events/dtos/trigger-event-to-all-request.dto.ts b/apps/api/src/app/events/dtos/trigger-event-to-all-request.dto.ts index ab518c77753..1cae7579bcb 100644 --- a/apps/api/src/app/events/dtos/trigger-event-to-all-request.dto.ts +++ b/apps/api/src/app/events/dtos/trigger-event-to-all-request.dto.ts @@ -58,6 +58,9 @@ export class TriggerEventToAllRequestDto { ], }) @IsOptional() + @ValidateIf((_, value) => typeof value !== 'string') + @ValidateNested() + @Type(() => SubscriberPayloadDto) actor?: TriggerRecipientSubscriber; @ApiProperty({ diff --git a/apps/api/src/app/events/e2e/trigger-event.e2e.ts b/apps/api/src/app/events/e2e/trigger-event.e2e.ts index 9d12dbaf5fc..c36242ed765 100644 --- a/apps/api/src/app/events/e2e/trigger-event.e2e.ts +++ b/apps/api/src/app/events/e2e/trigger-event.e2e.ts @@ -1178,6 +1178,44 @@ describe(`Trigger event - ${eventTriggerPath} (POST)`, function () { expect(message!.subject).to.equal('Test email a subject nested'); }); + it('should trigger E-Mail notification with actor data', async function () { + const newSubscriberId = SubscriberRepository.createObjectId(); + const channelType = ChannelTypeEnum.EMAIL; + const actorSubscriber = await subscriberService.createSubscriber({ firstName: 'Actor' }); + + template = await session.createTemplate({ + steps: [ + { + name: 'Message Name', + subject: 'Test email', + type: StepTypeEnum.EMAIL, + content: [ + { + type: EmailBlockTypeEnum.TEXT, + content: 'Hello {{actor.firstName}}, Welcome to {{organizationName}}' as string, + }, + ], + }, + ], + }); + + await sendTrigger(session, template, newSubscriberId, {}, {}, '', actorSubscriber.subscriberId); + + await session.awaitRunningJobs(template._id); + + const createdSubscriber = await subscriberRepository.findBySubscriberId(session.environment._id, newSubscriberId); + + const message = await messageRepository.findOne({ + _environmentId: session.environment._id, + _subscriberId: createdSubscriber?._id, + channel: channelType, + }); + + const block = message!.content[0] as IEmailBlock; + + expect(block.content).to.equal('Hello Actor, Welcome to Umbrella Corp'); + }); + it('should not trigger notification with subscriber data if integration is inactive', async function () { const newSubscriberIdInAppNotification = SubscriberRepository.createObjectId(); const channelType = ChannelTypeEnum.SMS; @@ -2442,7 +2480,8 @@ export async function sendTrigger( newSubscriberIdInAppNotification: string, payload: Record = {}, overrides: Record = {}, - tenant?: string + tenant?: string, + actor?: string ): Promise { return await axiosInstance.post( `${session.serverUrl}${eventTriggerPath}`, @@ -2456,6 +2495,7 @@ export async function sendTrigger( }, overrides, tenant, + actor, }, { headers: { diff --git a/apps/api/src/app/events/events.controller.ts b/apps/api/src/app/events/events.controller.ts index 47ddb117449..4389964b7dd 100644 --- a/apps/api/src/app/events/events.controller.ts +++ b/apps/api/src/app/events/events.controller.ts @@ -60,6 +60,7 @@ export class EventsController { @Body() body: TriggerEventRequestDto ): Promise { const mappedTenant = body.tenant ? this.mapTenant(body.tenant) : null; + const mappedActor = body.actor ? this.mapActor(body.actor) : null; const result = await this.parseEventRequest.execute( ParseEventRequestCommand.create({ @@ -70,7 +71,7 @@ export class EventsController { payload: body.payload || {}, overrides: body.overrides || {}, to: body.to, - actor: body.actor, + actor: mappedActor, tenant: mappedTenant, transactionId: body.transactionId, }) diff --git a/apps/api/src/app/events/usecases/parse-event-request/parse-event-request.command.ts b/apps/api/src/app/events/usecases/parse-event-request/parse-event-request.command.ts index 1ce91ea52e1..d3cbb4d2937 100644 --- a/apps/api/src/app/events/usecases/parse-event-request/parse-event-request.command.ts +++ b/apps/api/src/app/events/usecases/parse-event-request/parse-event-request.command.ts @@ -22,6 +22,7 @@ export class ParseEventRequestCommand extends EnvironmentWithUserCommand { transactionId?: string; @IsOptional() + @ValidateNested() actor?: TriggerRecipientSubscriber | null; @IsOptional() diff --git a/apps/api/src/app/events/usecases/process-bulk-trigger/process-bulk-trigger.usecase.ts b/apps/api/src/app/events/usecases/process-bulk-trigger/process-bulk-trigger.usecase.ts index 56751f3acd9..71746dcd424 100644 --- a/apps/api/src/app/events/usecases/process-bulk-trigger/process-bulk-trigger.usecase.ts +++ b/apps/api/src/app/events/usecases/process-bulk-trigger/process-bulk-trigger.usecase.ts @@ -18,6 +18,7 @@ export class ProcessBulkTrigger { for (const event of command.events) { let result: TriggerEventResponseDto; const mappedTenant = event.tenant ? this.parseEventRequest.mapTenant(event.tenant) : null; + const mappedActor = event.actor ? this.mapTriggerRecipients.mapSubscriber(event.actor) : null; try { result = (await this.parseEventRequest.execute( @@ -29,7 +30,7 @@ export class ProcessBulkTrigger { payload: event.payload, overrides: event.overrides || {}, to: event.to, - actor: event.actor, + actor: mappedActor, tenant: mappedTenant, transactionId: event.transactionId, }) diff --git a/apps/web/src/components/execution-detail/ExecutionDetailTrigger.tsx b/apps/web/src/components/execution-detail/ExecutionDetailTrigger.tsx index 8e9b0864051..6e21876f39e 100644 --- a/apps/web/src/components/execution-detail/ExecutionDetailTrigger.tsx +++ b/apps/web/src/components/execution-detail/ExecutionDetailTrigger.tsx @@ -11,9 +11,12 @@ const TriggerTitle = styled(Text)` `; export const ExecutionDetailTrigger = ({ identifier, step, subscriberVariables }) => { - const { payload, overrides, tenant } = step || {}; + const { payload, overrides, tenant, actorId } = step || {}; - const curlSnippet = getCurlTriggerSnippet(identifier, subscriberVariables, payload, overrides, { tenant }); + const curlSnippet = getCurlTriggerSnippet(identifier, subscriberVariables, payload, overrides, { + ...(tenant && { tenant }), + ...(actorId && { actor: { subscriberId: actorId } }), + }); return ( <> diff --git a/apps/worker/src/app/workflow/usecases/send-message/send-message-chat.usecase.ts b/apps/worker/src/app/workflow/usecases/send-message/send-message-chat.usecase.ts index 8b6ea72d913..efb92cc80c4 100644 --- a/apps/worker/src/app/workflow/usecases/send-message/send-message-chat.usecase.ts +++ b/apps/worker/src/app/workflow/usecases/send-message/send-message-chat.usecase.ts @@ -8,6 +8,7 @@ import { IntegrationEntity, IChannelSettings, TenantRepository, + SubscriberEntity, } from '@novu/dal'; import { ChannelTypeEnum, @@ -75,6 +76,13 @@ export class SendMessageChat extends SendMessageBase { if (!chatChannel?.template) throw new PlatformException('Chat channel template not found'); const tenant = await this.handleTenantExecution(command.job); + let actor: SubscriberEntity | null = null; + if (command.job.actorId) { + actor = await this.getSubscriberBySubscriberId({ + subscriberId: command.job.actorId, + _environmentId: command.environmentId, + }); + } let content = ''; const data = { @@ -85,6 +93,7 @@ export class SendMessageChat extends SendMessageBase { total_count: command.events?.length, }, ...(tenant && { tenant }), + ...(actor && { actor }), ...command.payload, }; diff --git a/apps/worker/src/app/workflow/usecases/send-message/send-message-email.usecase.ts b/apps/worker/src/app/workflow/usecases/send-message/send-message-email.usecase.ts index eb8cb3eae94..777d6ae34eb 100644 --- a/apps/worker/src/app/workflow/usecases/send-message/send-message-email.usecase.ts +++ b/apps/worker/src/app/workflow/usecases/send-message/send-message-email.usecase.ts @@ -8,6 +8,7 @@ import { MessageEntity, LayoutRepository, TenantRepository, + SubscriberEntity, } from '@novu/dal'; import { ChannelTypeEnum, @@ -135,6 +136,14 @@ export class SendMessageEmail extends SendMessageBase { return; } + let actor: SubscriberEntity | null = null; + if (command.job.actorId) { + actor = await this.getSubscriberBySubscriberId({ + subscriberId: command.job.actorId, + _environmentId: command.environmentId, + }); + } + const [tenant, overrideLayoutId] = await Promise.all([ this.handleTenantExecution(command.job), this.getOverrideLayoutId(command), @@ -167,6 +176,7 @@ export class SendMessageEmail extends SendMessageBase { total_count: command.events?.length, }, ...(tenant && { tenant }), + ...(actor && { actor }), subscriber, }, }; diff --git a/apps/worker/src/app/workflow/usecases/send-message/send-message-in-app.usecase.ts b/apps/worker/src/app/workflow/usecases/send-message/send-message-in-app.usecase.ts index 4da3733346c..55c48917f3f 100644 --- a/apps/worker/src/app/workflow/usecases/send-message/send-message-in-app.usecase.ts +++ b/apps/worker/src/app/workflow/usecases/send-message/send-message-in-app.usecase.ts @@ -113,6 +113,14 @@ export class SendMessageInApp extends SendMessageBase { const { actor } = command.step.template; + let actorSubscriber: SubscriberEntity | null = null; + if (command.job.actorId) { + actorSubscriber = await this.getSubscriberBySubscriberId({ + subscriberId: command.job.actorId, + _environmentId: command.environmentId, + }); + } + const [tenant, organization] = await Promise.all([ this.handleTenantExecution(command.job), this.organizationRepository.findById(command.organizationId, 'branding'), @@ -125,7 +133,8 @@ export class SendMessageInApp extends SendMessageBase { subscriber, command, organization, - tenant + tenant, + actorSubscriber ); if (inAppChannel.template.cta?.data?.url) { @@ -135,7 +144,8 @@ export class SendMessageInApp extends SendMessageBase { subscriber, command, organization, - tenant + tenant, + actorSubscriber ); } @@ -149,7 +159,8 @@ export class SendMessageInApp extends SendMessageBase { subscriber, command, organization, - tenant + tenant, + actorSubscriber ); ctaButtons.push({ type: action.type, content: buttonContent }); } @@ -286,7 +297,8 @@ export class SendMessageInApp extends SendMessageBase { subscriber: SubscriberEntity, command: SendMessageCommand, organization: OrganizationEntity | null, - tenant: TenantEntity | null + tenant: TenantEntity | null, + actor: SubscriberEntity | null ): Promise { return await this.compileTemplate.execute( CompileTemplateCommand.create({ @@ -303,6 +315,7 @@ export class SendMessageInApp extends SendMessageBase { color: organization?.branding?.color || '#f47373', }, ...(tenant && { tenant }), + ...(actor && { actor }), ...payload, }, }) diff --git a/apps/worker/src/app/workflow/usecases/send-message/send-message-push.usecase.ts b/apps/worker/src/app/workflow/usecases/send-message/send-message-push.usecase.ts index 6650b961af0..e06ab3a85bc 100644 --- a/apps/worker/src/app/workflow/usecases/send-message/send-message-push.usecase.ts +++ b/apps/worker/src/app/workflow/usecases/send-message/send-message-push.usecase.ts @@ -7,6 +7,7 @@ import { MessageEntity, IntegrationEntity, TenantRepository, + SubscriberEntity, JobEntity, } from '@novu/dal'; import { @@ -86,11 +87,19 @@ export class SendMessagePush extends SendMessageBase { total_count: command.events?.length, }; const tenant = await this.handleTenantExecution(command.job); + let actor: SubscriberEntity | null = null; + if (command.job.actorId) { + actor = await this.getSubscriberBySubscriberId({ + subscriberId: command.job.actorId, + _environmentId: command.environmentId, + }); + } const data = { subscriber: subscriber, step: stepData, ...(tenant && { tenant }), + ...(actor && { actor }), ...command.payload, }; let content = ''; diff --git a/apps/worker/src/app/workflow/usecases/send-message/send-message-sms.usecase.ts b/apps/worker/src/app/workflow/usecases/send-message/send-message-sms.usecase.ts index 305553132db..f8f7026b6d8 100644 --- a/apps/worker/src/app/workflow/usecases/send-message/send-message-sms.usecase.ts +++ b/apps/worker/src/app/workflow/usecases/send-message/send-message-sms.usecase.ts @@ -7,6 +7,7 @@ import { MessageEntity, IntegrationEntity, TenantRepository, + SubscriberEntity, } from '@novu/dal'; import { ChannelTypeEnum, LogCodeEnum, ExecutionDetailsSourceEnum, ExecutionDetailsStatusEnum } from '@novu/shared'; import { @@ -79,6 +80,13 @@ export class SendMessageSms extends SendMessageBase { const smsChannel: NotificationStepEntity = command.step; if (!smsChannel.template) throw new PlatformException(`Unexpected error: SMS template is missing`); + let actor: SubscriberEntity | null = null; + if (command.job.actorId) { + actor = await this.getSubscriberBySubscriberId({ + subscriberId: command.job.actorId, + _environmentId: command.environmentId, + }); + } const tenant = await this.handleTenantExecution(command.job); const payload = { @@ -89,6 +97,7 @@ export class SendMessageSms extends SendMessageBase { total_count: command.events?.length, }, ...(tenant && { tenant }), + ...(actor && { actor }), ...command.payload, }; diff --git a/libs/dal/src/repositories/job/job.entity.ts b/libs/dal/src/repositories/job/job.entity.ts index d6b66f75e90..42d2e683cb1 100644 --- a/libs/dal/src/repositories/job/job.entity.ts +++ b/libs/dal/src/repositories/job/job.entity.ts @@ -40,6 +40,7 @@ export class JobEntity { }; type?: StepTypeEnum; _actorId?: string; + actorId?: string; } export type JobDBModel = ChangePropsValueType< diff --git a/libs/dal/src/repositories/job/job.schema.ts b/libs/dal/src/repositories/job/job.schema.ts index 783284d8f80..e7ffc277e3e 100644 --- a/libs/dal/src/repositories/job/job.schema.ts +++ b/libs/dal/src/repositories/job/job.schema.ts @@ -123,6 +123,9 @@ const jobSchema = new Schema( type: Schema.Types.ObjectId, ref: 'Subscriber', }, + actorId: { + type: Schema.Types.String, + }, expireAt: Schema.Types.Date, }, schemaOptions diff --git a/libs/dal/src/repositories/notification/notification.repository.ts b/libs/dal/src/repositories/notification/notification.repository.ts index cfa0e3b9e73..a5cbeaf2973 100644 --- a/libs/dal/src/repositories/notification/notification.repository.ts +++ b/libs/dal/src/repositories/notification/notification.repository.ts @@ -110,7 +110,7 @@ export class NotificationRepository extends BaseRepository< $nin: [StepTypeEnum.TRIGGER], }, }, - select: 'createdAt digest payload overrides to tenant providerId step status type updatedAt', + select: 'createdAt digest payload overrides to tenant actorId providerId step status type updatedAt', populate: [ { path: 'executionDetails', diff --git a/libs/shared/src/entities/message-template/message-template.interface.ts b/libs/shared/src/entities/message-template/message-template.interface.ts index fe4d07d5672..edbe333bdce 100644 --- a/libs/shared/src/entities/message-template/message-template.interface.ts +++ b/libs/shared/src/entities/message-template/message-template.interface.ts @@ -38,7 +38,7 @@ export interface IMessageTemplate { } // eslint-disable-next-line @typescript-eslint/naming-convention -export const TemplateSystemVariables = ['subscriber', 'step', 'branding', 'tenant', 'preheader']; +export const TemplateSystemVariables = ['subscriber', 'step', 'branding', 'tenant', 'preheader', 'actor']; // eslint-disable-next-line @typescript-eslint/naming-convention export const SystemVariablesWithTypes = { @@ -51,6 +51,15 @@ export const SystemVariablesWithTypes = { locale: 'string', subscriberId: 'string', }, + actor: { + firstName: 'string', + lastName: 'string', + email: 'string', + phone: 'string', + avatar: 'string', + locale: 'string', + subscriberId: 'string', + }, step: { digest: 'boolean', events: 'array', @@ -67,9 +76,10 @@ export const SystemVariablesWithTypes = { }; // eslint-disable-next-line @typescript-eslint/naming-convention -export const TriggerReservedVariables = ['tenant']; +export const TriggerReservedVariables = ['tenant', 'actor']; // eslint-disable-next-line @typescript-eslint/naming-convention export const ReservedVariablesMap = { [TriggerContextTypeEnum.TENANT]: [{ name: 'identifier', type: TemplateVariableTypeEnum.STRING }], + [TriggerContextTypeEnum.ACTOR]: [{ name: 'subscriberId', type: TemplateVariableTypeEnum.STRING }], }; diff --git a/libs/shared/src/entities/notification-template/notification-template.interface.ts b/libs/shared/src/entities/notification-template/notification-template.interface.ts index b404ed29e4c..55cd6e05395 100644 --- a/libs/shared/src/entities/notification-template/notification-template.interface.ts +++ b/libs/shared/src/entities/notification-template/notification-template.interface.ts @@ -41,6 +41,7 @@ export interface INotificationTrigger { export enum TriggerContextTypeEnum { TENANT = 'tenant', + ACTOR = 'actor', } export interface ITriggerReservedVariable { diff --git a/packages/application-generic/src/usecases/create-notification-jobs/create-notification-jobs.usecase.ts b/packages/application-generic/src/usecases/create-notification-jobs/create-notification-jobs.usecase.ts index a5bacdf2c6a..5234c76be18 100644 --- a/packages/application-generic/src/usecases/create-notification-jobs/create-notification-jobs.usecase.ts +++ b/packages/application-generic/src/usecases/create-notification-jobs/create-notification-jobs.usecase.ts @@ -101,7 +101,10 @@ export class CreateNotificationJobs { type: step.template.type, providerId: providerId, expireAt: notification.expireAt, - ...(command.actor && { _actorId: command.actor?._id }), + ...(command.actor && { + _actorId: command.actor?._id, + actorId: command.actor?.subscriberId, + }), }; jobs.push(job); diff --git a/packages/application-generic/src/usecases/trigger-event/trigger-event.command.ts b/packages/application-generic/src/usecases/trigger-event/trigger-event.command.ts index 77733a3cf13..3f94fef7cf1 100644 --- a/packages/application-generic/src/usecases/trigger-event/trigger-event.command.ts +++ b/packages/application-generic/src/usecases/trigger-event/trigger-event.command.ts @@ -27,6 +27,7 @@ export class TriggerEventCommand extends EnvironmentWithUserCommand { transactionId: string; @IsOptional() + @ValidateNested() actor?: ISubscribersDefine | null; @IsOptional() diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ef31bf6b5c7..d1ab5337d66 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -44505,7 +44505,8 @@ packages: jest-worker: 26.6.2 rollup: 2.79.1 serialize-javascript: 4.0.0 - terser: 5.19.3 + terser: 5.22.0 + dev: true /rollup-plugin-terser@7.0.2(rollup@3.20.2): resolution: {integrity: sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==} From ab01eefafb1e2c8e9b82ee988a9c5e20b1e34ac4 Mon Sep 17 00:00:00 2001 From: Nevo David <100117126+nevo-david@users.noreply.github.com> Date: Mon, 23 Oct 2023 18:22:39 +0700 Subject: [PATCH 07/18] Remove Product Hunt and added UTMs (#4621) --- README.md | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 3ce7999c422..332b10b46eb 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
- + ![Novu Logo] @@ -12,15 +12,7 @@
The ultimate service for managing multi-channel notifications with a single API.
- -

πŸŽ‰ Novu is live on Product Hunt! πŸŽ‰

-

-We are on Product Hunt and would appreciate any help you can give us 🩷
-BONUS: watch our video, answer the riddle, and win awesome swag!

-


-

-

πŸŽ‰ We're participating in Hacktoberfest 2023! πŸŽ‰

Are you interested in participating in Hacktoberfest? We extend a warm invitation! You also get the opportunity to win some swag 😁 @@ -244,7 +236,7 @@ We are more than happy to help you. If you are getting any errors or facing prob ## πŸ”— Links -- [Home page](https://novu.co/) +- [Home page](https://novu.co?utm_source=github) - [Contribution Guidelines](https://github.com/novuhq/novu/blob/main/CONTRIBUTING.md) - [Run Novu Locally](https://docs.novu.co/community/run-in-local-machine) @@ -256,6 +248,6 @@ Novu is licensed under the MIT License - see the [LICENSE](https://github.com/no Thanks a lot for spending your time helping Novu grow. Keep rocking πŸ₯‚ - + Contributors From dcd006fd6638738c065c0fc4bf5507928d0f2c23 Mon Sep 17 00:00:00 2001 From: Aditya Aryaman Das <128703909+alienishi@users.noreply.github.com> Date: Mon, 23 Oct 2023 17:27:42 +0530 Subject: [PATCH 08/18] Updated README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 332b10b46eb..a9cf537e515 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ With Novu, you can create custom workflows and define conditions for each channe - πŸ“¦ Easy to set up and integrate - πŸ›‘ Debug and analyze multi-channel messages in a single dashboard - πŸ“¦ Embeddable notification center with real-time updates -- πŸ‘¨β€πŸ’» community-driven +- πŸ‘¨β€πŸ’» Community-driven ## πŸ“š Table Of Contents @@ -108,7 +108,7 @@ npx novu init After setting up your account using the cloud or docker version, you can trigger the API using the `@novu/node` package. -Please visit [Novu API Reference](https://docs.novu.co/api-reference/events/trigger-event) for API documentation and reference. +For API documentation and reference, please visit [Novu API Reference] (https://docs.novu.co/api-reference/ events/trigger-event). To get started with the Node.js package, you can install it using npm: From 9a810d504f2f2349d0d5a56bf37994dd34ea54be Mon Sep 17 00:00:00 2001 From: Aditya Aryaman Das <128703909+alienishi@users.noreply.github.com> Date: Mon, 23 Oct 2023 17:30:17 +0530 Subject: [PATCH 09/18] Updated README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a9cf537e515..84edb476116 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ npx novu init After setting up your account using the cloud or docker version, you can trigger the API using the `@novu/node` package. -For API documentation and reference, please visit [Novu API Reference] (https://docs.novu.co/api-reference/ events/trigger-event). +For API documentation and reference, please visit [Novu API Reference] (https://docs.novu.co/api-reference/events/trigger-event). To get started with the Node.js package, you can install it using npm: From c0dcf1a8a909b41b3b02e3d0674a05f9b93f0daf Mon Sep 17 00:00:00 2001 From: Emerson Date: Wed, 18 Oct 2023 13:44:24 +0800 Subject: [PATCH 10/18] fix: sender name in mandrill provider --- .../src/factories/mail/handlers/mandrill.handler.ts | 3 ++- providers/mandrill/README.md | 5 +++-- providers/mandrill/src/lib/mandril.interface.ts | 1 + providers/mandrill/src/lib/mandrill.provider.spec.ts | 1 + providers/mandrill/src/lib/mandrill.provider.ts | 2 ++ 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/application-generic/src/factories/mail/handlers/mandrill.handler.ts b/packages/application-generic/src/factories/mail/handlers/mandrill.handler.ts index 9d30134c159..c0fe775bf70 100644 --- a/packages/application-generic/src/factories/mail/handlers/mandrill.handler.ts +++ b/packages/application-generic/src/factories/mail/handlers/mandrill.handler.ts @@ -7,9 +7,10 @@ export class MandrillHandler extends BaseHandler { super('mandrill', ChannelTypeEnum.EMAIL); } buildProvider(credentials: ICredentials, from?: string) { - const config: { apiKey: string; from: string } = { + const config: { apiKey: string; from: string; senderName: string } = { from: from as string, apiKey: credentials.apiKey as string, + senderName: credentials.senderName as string, }; this.provider = new MandrillProvider(config); diff --git a/providers/mandrill/README.md b/providers/mandrill/README.md index 59df9ace370..b5bff8fdba9 100644 --- a/providers/mandrill/README.md +++ b/providers/mandrill/README.md @@ -8,7 +8,8 @@ A mandrill email provider library for [@novu/stateless](https://github.com/novuh import { MandrillProvider } from '@novu/mandrill'; const provider = new MandrillProvider({ - apiKey: process.env.apiKey, - from: process.env.email, + apiKey: process.env.API_KEY, + from: process.env.EMAIL, + senderName: process.env.SENDER_NAME }); ``` diff --git a/providers/mandrill/src/lib/mandril.interface.ts b/providers/mandrill/src/lib/mandril.interface.ts index 0d325df6eb8..3a28e49a8fa 100644 --- a/providers/mandrill/src/lib/mandril.interface.ts +++ b/providers/mandrill/src/lib/mandril.interface.ts @@ -10,6 +10,7 @@ export interface IMandrilInterface { export interface IMandrillSendOptions { message: { from_email: string; + from_name: string; subject: string; html: string; to: { email: string; type: 'to' | string }[]; diff --git a/providers/mandrill/src/lib/mandrill.provider.spec.ts b/providers/mandrill/src/lib/mandrill.provider.spec.ts index a85dc550a9d..95295a19370 100644 --- a/providers/mandrill/src/lib/mandrill.provider.spec.ts +++ b/providers/mandrill/src/lib/mandrill.provider.spec.ts @@ -3,6 +3,7 @@ import { MandrillProvider } from './mandrill.provider'; const mockConfig = { apiKey: 'API_KEY', from: 'test@test.com', + senderName: 'Test Sender', }; test('should trigger mandrill correctly', async () => { diff --git a/providers/mandrill/src/lib/mandrill.provider.ts b/providers/mandrill/src/lib/mandrill.provider.ts index 200f21b515f..2e1ca9b6caa 100644 --- a/providers/mandrill/src/lib/mandrill.provider.ts +++ b/providers/mandrill/src/lib/mandrill.provider.ts @@ -35,6 +35,7 @@ export class MandrillProvider implements IEmailProvider { private config: { apiKey: string; from: string; + senderName: string; } ) { this.transporter = mailchimp(this.config.apiKey); @@ -46,6 +47,7 @@ export class MandrillProvider implements IEmailProvider { const mandrillSendOption = { message: { from_email: this.config.from, + from_name: this.config.senderName, subject: emailOptions.subject, html: emailOptions.html, to: this.mapTo(emailOptions), From 40f7e72e71732f64423a6b77a5528e6bbb83b491 Mon Sep 17 00:00:00 2001 From: Emerson Date: Thu, 19 Oct 2023 21:19:10 +0800 Subject: [PATCH 11/18] fix: add missing parameter in test --- providers/mandrill/src/lib/mandrill.provider.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/providers/mandrill/src/lib/mandrill.provider.spec.ts b/providers/mandrill/src/lib/mandrill.provider.spec.ts index 95295a19370..fc09cab4855 100644 --- a/providers/mandrill/src/lib/mandrill.provider.spec.ts +++ b/providers/mandrill/src/lib/mandrill.provider.spec.ts @@ -34,6 +34,7 @@ test('should trigger mandrill correctly', async () => { expect(spy).toHaveBeenCalledWith({ message: { from_email: mockConfig.from, + from_name: mockConfig.senderName, subject: mockNovuMessage.subject, html: mockNovuMessage.html, to: [ From 392234ba7c377e60cdd5c42d437651a76da404e6 Mon Sep 17 00:00:00 2001 From: Uzair Khan Date: Sat, 30 Sep 2023 19:23:40 +0530 Subject: [PATCH 12/18] fix: changed the logout icon from a trash to that of a log out icon --- .../layout/components/HeaderNav.tsx | 6 ++--- .../design-system/icons/general/Logout.tsx | 23 +++++++++++++++++++ .../icons/general/UserAccess.tsx | 1 + apps/web/src/design-system/icons/index.ts | 2 ++ 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 apps/web/src/design-system/icons/general/Logout.tsx diff --git a/apps/web/src/components/layout/components/HeaderNav.tsx b/apps/web/src/components/layout/components/HeaderNav.tsx index fb12825af38..a7f8dcdafca 100644 --- a/apps/web/src/components/layout/components/HeaderNav.tsx +++ b/apps/web/src/components/layout/components/HeaderNav.tsx @@ -8,7 +8,7 @@ import LogRocket from 'logrocket'; import { CONTEXT_PATH, INTERCOM_APP_ID, IS_DOCKER_HOSTED, LOGROCKET_ID, REACT_APP_VERSION } from '../../../config'; import { ROUTES } from '../../../constants/routes.enum'; import { colors, Dropdown, shadows, Text, Tooltip } from '../../../design-system'; -import { Ellipse, Mail, Moon, Question, Sun, Trash } from '../../../design-system/icons'; +import { Ellipse, Mail, Moon, Question, Sun, Trash, Logout } from '../../../design-system/icons'; import { useLocalThemePreference } from '../../../hooks'; import { discordInviteUrl } from '../../../pages/quick-start/consts'; import { useAuthContext } from '../../providers/AuthProvider'; @@ -111,7 +111,7 @@ export function HeaderNav({ isIntercomOpened }: Props) { { id: 'sign-out', title: 'Sign out', - icon: , + icon: , onTrigger: () => { logout(); }, @@ -153,7 +153,7 @@ export function HeaderNav({ isIntercomOpened }: Props) { )), - } onClick={logout} data-test-id="logout-button"> + } onClick={logout} data-test-id="logout-button"> Sign Out , ]; diff --git a/apps/web/src/design-system/icons/general/Logout.tsx b/apps/web/src/design-system/icons/general/Logout.tsx new file mode 100644 index 00000000000..138b69b8d7c --- /dev/null +++ b/apps/web/src/design-system/icons/general/Logout.tsx @@ -0,0 +1,23 @@ +import React from 'react'; +/* eslint-disable */ +export function Logout(props: React.ComponentPropsWithoutRef<'svg'>) { + return ( + + + + + ); +} diff --git a/apps/web/src/design-system/icons/general/UserAccess.tsx b/apps/web/src/design-system/icons/general/UserAccess.tsx index 97666f9f619..2fcb46ae442 100644 --- a/apps/web/src/design-system/icons/general/UserAccess.tsx +++ b/apps/web/src/design-system/icons/general/UserAccess.tsx @@ -1,3 +1,4 @@ +import React from 'react'; export function UserAccess(props: React.ComponentPropsWithoutRef<'svg'>) { return ( diff --git a/apps/web/src/design-system/icons/index.ts b/apps/web/src/design-system/icons/index.ts index d781a96e70b..4fe9400e987 100644 --- a/apps/web/src/design-system/icons/index.ts +++ b/apps/web/src/design-system/icons/index.ts @@ -1,4 +1,5 @@ export { ActiveLabel } from './general/ActiveLabel'; +import { Logout } from './general/Logout'; export { Activity } from './general/Activity'; export { Brand } from './general/Brand'; export { Buildings } from './general/Buildings'; @@ -84,6 +85,7 @@ export { Cloud } from './general/Cloud'; export { Condition } from './general/Condition'; export { RemoveCondition } from './general/RemoveCondition'; export { Warning } from './general/Warning'; +export { Logout } from './general/Logout'; export { Copy } from './actions/Copy'; export { Close } from './actions/Close'; From 5a5f8cdace63b25bb471374797d9ed1f15287cdd Mon Sep 17 00:00:00 2001 From: Uzair Khan Date: Mon, 2 Oct 2023 18:23:50 +0530 Subject: [PATCH 13/18] Update index.ts removed the duplicate exports --- apps/web/src/design-system/icons/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/web/src/design-system/icons/index.ts b/apps/web/src/design-system/icons/index.ts index 4fe9400e987..0be91222e63 100644 --- a/apps/web/src/design-system/icons/index.ts +++ b/apps/web/src/design-system/icons/index.ts @@ -1,5 +1,4 @@ export { ActiveLabel } from './general/ActiveLabel'; -import { Logout } from './general/Logout'; export { Activity } from './general/Activity'; export { Brand } from './general/Brand'; export { Buildings } from './general/Buildings'; From af66f94d6061a2d0ffb624284051471ae2f88b2a Mon Sep 17 00:00:00 2001 From: Uzair Khan Date: Mon, 2 Oct 2023 18:52:08 +0530 Subject: [PATCH 14/18] Updated HeaderNav.tsx changed the text Sign out to Log out --- apps/web/src/components/layout/components/HeaderNav.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/components/layout/components/HeaderNav.tsx b/apps/web/src/components/layout/components/HeaderNav.tsx index a7f8dcdafca..6c15c7c741a 100644 --- a/apps/web/src/components/layout/components/HeaderNav.tsx +++ b/apps/web/src/components/layout/components/HeaderNav.tsx @@ -154,7 +154,7 @@ export function HeaderNav({ isIntercomOpened }: Props) { )), } onClick={logout} data-test-id="logout-button"> - Sign Out + Log Out , ]; From ca767beb193431c3e20658770ffac290827bce0e Mon Sep 17 00:00:00 2001 From: Uzair Khan Date: Fri, 20 Oct 2023 17:13:53 +0530 Subject: [PATCH 15/18] fix:changed logout icon to one mentioned in figma design --- .../design-system/icons/general/Logout.tsx | 26 ++++++-------- novu.code-workspace | 6 +++- pnpm-lock.yaml | 34 +++++++------------ 3 files changed, 28 insertions(+), 38 deletions(-) diff --git a/apps/web/src/design-system/icons/general/Logout.tsx b/apps/web/src/design-system/icons/general/Logout.tsx index 138b69b8d7c..659b0500da3 100644 --- a/apps/web/src/design-system/icons/general/Logout.tsx +++ b/apps/web/src/design-system/icons/general/Logout.tsx @@ -2,22 +2,16 @@ import React from 'react'; /* eslint-disable */ export function Logout(props: React.ComponentPropsWithoutRef<'svg'>) { return ( - - - + + + + + + + ); } diff --git a/novu.code-workspace b/novu.code-workspace index 9bba2423a8d..73d622d7638 100644 --- a/novu.code-workspace +++ b/novu.code-workspace @@ -183,7 +183,11 @@ "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.formatOnSave": true, "editor.formatOnPaste": true, - "cSpell.words": ["Chainable", "usecases"] + "cSpell.words": [ + "Chainable", + "usecases" + ], + "vsicons.presets.nestjs": true }, "extensions": { "recommendations": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d1ab5337d66..1d89cd09ad5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6902,7 +6902,7 @@ packages: '@aws-sdk/types': 3.387.0 '@smithy/querystring-builder': 2.0.3 '@smithy/types': 2.2.0 - tslib: 2.5.0 + tslib: 2.6.2 dev: false /@aws-sdk/util-locate-window@3.310.0: @@ -6977,7 +6977,7 @@ packages: resolution: {integrity: sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw==} engines: {node: '>=12.0.0'} dependencies: - tslib: 2.5.0 + tslib: 2.6.2 dev: false /@azure/core-auth@1.4.0: @@ -7002,7 +7002,7 @@ packages: form-data: 4.0.0 node-fetch: 2.7.0 process: 0.11.10 - tslib: 2.5.0 + tslib: 2.6.2 tunnel: 0.0.6 uuid: 8.3.2 xml2js: 0.5.0 @@ -7017,14 +7017,14 @@ packages: '@azure/abort-controller': 1.1.0 '@azure/core-util': 1.3.0 '@azure/logger': 1.0.4 - tslib: 2.5.0 + tslib: 2.6.2 dev: false /@azure/core-paging@1.5.0: resolution: {integrity: sha512-zqWdVIt+2Z+3wqxEOGzR5hXFZ8MGKK52x4vFLw8n58pR6ZfKRx3EXYTxTaYxYHc/PexPUTyimcTWFJbji9Z6Iw==} engines: {node: '>=14.0.0'} dependencies: - tslib: 2.5.0 + tslib: 2.6.2 dev: false /@azure/core-tracing@1.0.0-preview.13: @@ -7032,7 +7032,7 @@ packages: engines: {node: '>=12.0.0'} dependencies: '@opentelemetry/api': 1.4.1 - tslib: 2.5.0 + tslib: 2.6.2 dev: false /@azure/core-util@1.3.0: @@ -7047,7 +7047,7 @@ packages: resolution: {integrity: sha512-ustrPY8MryhloQj7OWGe+HrYx+aoiOxzbXTtgblbV3xwCqpzUK36phH3XNHQKj3EPonyFUuDTfR3qFhTEAuZEg==} engines: {node: '>=14.0.0'} dependencies: - tslib: 2.5.0 + tslib: 2.6.2 dev: false /@azure/storage-blob@12.13.0: @@ -24659,14 +24659,6 @@ packages: acorn: ^8 dependencies: acorn: 8.10.0 - dev: true - - /acorn-import-assertions@1.9.0(acorn@8.8.2): - resolution: {integrity: sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==} - peerDependencies: - acorn: ^8 - dependencies: - acorn: 8.8.2 /acorn-jsx@5.3.2(acorn@7.4.1): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} @@ -27770,7 +27762,7 @@ packages: dev: false /concat-map@0.0.1: - resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} /concat-stream@1.6.2: resolution: {integrity: sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==} @@ -34214,7 +34206,7 @@ packages: /is-core-module@2.13.0: resolution: {integrity: sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==} dependencies: - has: 1.0.3 + has: 1.0.4 dev: true /is-data-descriptor@0.1.4: @@ -49009,8 +49001,8 @@ packages: '@webassemblyjs/ast': 1.11.1 '@webassemblyjs/wasm-edit': 1.11.1 '@webassemblyjs/wasm-parser': 1.11.1 - acorn: 8.8.2 - acorn-import-assertions: 1.9.0(acorn@8.8.2) + acorn: 8.10.0 + acorn-import-assertions: 1.9.0(acorn@8.10.0) browserslist: 4.21.10 chrome-trace-event: 1.0.3 enhanced-resolve: 5.15.0 @@ -49049,8 +49041,8 @@ packages: '@webassemblyjs/ast': 1.11.1 '@webassemblyjs/wasm-edit': 1.11.1 '@webassemblyjs/wasm-parser': 1.11.1 - acorn: 8.8.2 - acorn-import-assertions: 1.9.0(acorn@8.8.2) + acorn: 8.10.0 + acorn-import-assertions: 1.9.0(acorn@8.10.0) browserslist: 4.21.10 chrome-trace-event: 1.0.3 enhanced-resolve: 5.15.0 From d88429594a3934c028c294cd54b29ce2c2da52e7 Mon Sep 17 00:00:00 2001 From: Uzair Khan Date: Fri, 20 Oct 2023 17:52:26 +0530 Subject: [PATCH 16/18] solved the issue of switching svg with theme --- .../src/design-system/icons/general/Logout.tsx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/apps/web/src/design-system/icons/general/Logout.tsx b/apps/web/src/design-system/icons/general/Logout.tsx index 659b0500da3..fdfbb94811b 100644 --- a/apps/web/src/design-system/icons/general/Logout.tsx +++ b/apps/web/src/design-system/icons/general/Logout.tsx @@ -2,14 +2,22 @@ import React from 'react'; /* eslint-disable */ export function Logout(props: React.ComponentPropsWithoutRef<'svg'>) { return ( - - + + - + From 75c25b6a190909a58f1406e5ba853ff02ef9375b Mon Sep 17 00:00:00 2001 From: Kanav Arora Date: Wed, 11 Oct 2023 22:50:37 +0530 Subject: [PATCH 17/18] feat(provider): guilded provider added --- pnpm-lock.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1d89cd09ad5..e09bcac2e05 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -47212,7 +47212,7 @@ packages: yargs-parser: 20.2.9 dev: true - /ts-jest/27.1.5_cnngzrja2umb46xxazlucyx2qu: + /ts-jest/27.1.5_4aafjbpmnrfjtrzkyohogv4jce: resolution: {integrity: sha512-Xv6jBQPoBEvBq/5i2TeSG9tt/nqkbpcurrEG1b+2yfBrcJelOZF9Ml6dmyMh7bcW9JyFbRYpR5rxROSlBLTZHA==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} hasBin: true @@ -47233,6 +47233,7 @@ packages: esbuild: optional: true dependencies: + '@babel/core': 7.22.11 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 jest: 27.5.1(ts-node@10.9.1) From 2727b54183f2a66c9ca604006555078751be0322 Mon Sep 17 00:00:00 2001 From: Kanav Arora Date: Wed, 11 Oct 2023 22:50:37 +0530 Subject: [PATCH 18/18] feat(provider): guilded provider added --- pnpm-lock.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e09bcac2e05..32a4823f4d4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30514,7 +30514,7 @@ packages: object.groupby: 1.0.1 object.values: 1.1.6 resolve: 1.22.2 - semver: 6.3.0 + semver: 6.3.1 tsconfig-paths: 3.14.2 transitivePeerDependencies: - eslint-import-resolver-typescript @@ -47212,7 +47212,7 @@ packages: yargs-parser: 20.2.9 dev: true - /ts-jest/27.1.5_4aafjbpmnrfjtrzkyohogv4jce: + /ts-jest/27.1.5_cnngzrja2umb46xxazlucyx2qu: resolution: {integrity: sha512-Xv6jBQPoBEvBq/5i2TeSG9tt/nqkbpcurrEG1b+2yfBrcJelOZF9Ml6dmyMh7bcW9JyFbRYpR5rxROSlBLTZHA==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} hasBin: true @@ -47233,7 +47233,6 @@ packages: esbuild: optional: true dependencies: - '@babel/core': 7.22.11 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 jest: 27.5.1(ts-node@10.9.1)