From 3a14a531cc07bbff046e6c536ccd92401caed475 Mon Sep 17 00:00:00 2001 From: Ayush Shukla Date: Sat, 28 Oct 2023 13:06:35 +0000 Subject: [PATCH 1/4] feat: Added MessageBird SMS client This commit adds the MessageBird SMS client to our project. --- .../images/providers/dark/messagebird.png | Bin 0 -> 17841 bytes .../images/providers/light/messagebird.png | Bin 0 -> 17841 bytes .../src/consts/providers/channels/sms.ts | 9 ++ .../credentials/provider-credentials.ts | 10 ++ .../src/consts/providers/provider.enum.ts | 2 + .../integration/credential.interface.ts | 1 + packages/application-generic/package.json | 1 + .../src/factories/sms/handlers/index.ts | 1 + .../sms/handlers/messagebird.handler.ts | 14 +++ .../src/factories/sms/sms.factory.ts | 2 + pnpm-lock.yaml | 63 +++++++++++- providers/messagebird/.czrc | 3 + providers/messagebird/.eslintrc.json | 3 + providers/messagebird/.gitignore | 9 ++ providers/messagebird/README.md | 91 ++++++++++++++++++ providers/messagebird/jest.config.js | 5 + providers/messagebird/package.json | 78 +++++++++++++++ providers/messagebird/src/index.ts | 1 + .../src/lib/messagebird.provider.spec.ts | 40 ++++++++ .../src/lib/messagebird.provider.ts | 47 +++++++++ providers/messagebird/tsconfig.json | 10 ++ providers/messagebird/tsconfig.module.json | 9 ++ 22 files changed, 395 insertions(+), 4 deletions(-) create mode 100644 apps/web/public/static/images/providers/dark/messagebird.png create mode 100644 apps/web/public/static/images/providers/light/messagebird.png create mode 100644 packages/application-generic/src/factories/sms/handlers/messagebird.handler.ts create mode 100644 providers/messagebird/.czrc create mode 100644 providers/messagebird/.eslintrc.json create mode 100644 providers/messagebird/.gitignore create mode 100644 providers/messagebird/README.md create mode 100644 providers/messagebird/jest.config.js create mode 100644 providers/messagebird/package.json create mode 100644 providers/messagebird/src/index.ts create mode 100644 providers/messagebird/src/lib/messagebird.provider.spec.ts create mode 100644 providers/messagebird/src/lib/messagebird.provider.ts create mode 100644 providers/messagebird/tsconfig.json create mode 100644 providers/messagebird/tsconfig.module.json diff --git a/apps/web/public/static/images/providers/dark/messagebird.png b/apps/web/public/static/images/providers/dark/messagebird.png new file mode 100644 index 0000000000000000000000000000000000000000..8222ddca5ddc52cecb59849db650127a6947bdf7 GIT binary patch literal 17841 zcmeIa`CrUm^f-QJrk$FU62(j;Q4~cXW|SqQvKLa>DcVq^=9wrFWshh=B&9{KcFZUd zqO>S!&(f-Cuc?{m=iKS_`h32R@8k0qd>-!~UU}Yo&pG#O_uO;Oz4HpSvst64Fhv0& zq`1~<h{vb4miT@G`a`>MZDuzH$ z3H=f;xyCsGXZ}_Xvi$C30Eh;Q-QyODw-`JZy>x9@Jv3jHBF zZ!a@uCNeTs1khV0vQ)+%rr?2V$WbX|Z3SIyg(OS4u00ygxri@?S5WL~4P->2z}M{d zd}7=WDWo(=uT)0FxmR-9qth&gIG^XdblukYb`Pav4GjdSIU}!q&s7?AtR8DIc2c-e zTg}|JH5MvR%{SmVlA_Nm*PT-qYi7#IQPDJQ=!=m`mZG3=Rrs`10mf-~?i*IhNT7)4 zp4lEmB>37lccTSJ@OdW=4-Oq1>1-&l^KE?t&pH9BJ)y(I9;7mztn)}_YzMVU0>nFe% z|I9oXJNYVbCXQdu%ZsgL(5>n4Nt{yDCR~+@uyIkZ-`B*v^X*DSYjNw-P`1PQ&6U$4 zFX7g$-Xw?fGb$O8L6TM(S61+*U-mZ>TEzavbQF1B(qGAy_1H6&n2lLrDvC~_;^)#v zYMArb#u4Sb>~!=*GVSpy1!Rp)jSi=(p~!RitF+Wz+AK|%Uxj6hh&KH^M{DOKXKQS4 ztFrSaDDQOOi!gZwevzI|c{fJq{!(RS4GD*(zu0VN6AAQ>JLp)UM)zwI{j>~iAVa*oBZJ&lVTz~xz9;5gT__bTp)>kj2ANB2Gn}S~e6L}M zp256Ds9`o0KJ|i*BK{-HsvXEK(8J8#c)*nr)a;D?|nf zn3BF`zh)E|f^`*RkU>G3n8_G}_uo{jR>BwB@2P}RuHvtcOW0NlS{ z(GJ@i=3$J9&m0a@5JzI6?C7048*WK(9#hb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Vx*_X%;OJw&5sI0KKB7#$e>42?4RRkx32uo8_0>3*Ec6*5y^n7b@BZk; z6)?VYp_tfmxP_HjNoOY{qPM*T0y;`F>Z6sYDH3c@y0ces0Lqz(Iq8 z1Og0uQ^L|wQ<(r%6^3GrLGwD@_ME!sN~21hG-9efr3L2!U(FRqO!f1{_cO<%k;jyh z2|$FZ;X3ML8}!e)`CEYO5UC zlO;=>F+o$nbP=U(4X@jh#11FYd%ETfBYqTA`Jm3nXY7V+7xWg2KL`<0W1R$UAQh-r z;G!+m>2Qe<|3&hWnkJJ1g*PZYGV$O4LHd7R5z3CUe;IOXm(A=10.0.0'} + dependencies: + jose: 4.13.1 + safe-buffer: 5.2.1 + scmp: 2.1.0 + dev: false + /methods@1.1.2: resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} engines: {node: '>= 0.6'} diff --git a/providers/messagebird/.czrc b/providers/messagebird/.czrc new file mode 100644 index 00000000000..d1bcc209ca1 --- /dev/null +++ b/providers/messagebird/.czrc @@ -0,0 +1,3 @@ +{ + "path": "cz-conventional-changelog" +} diff --git a/providers/messagebird/.eslintrc.json b/providers/messagebird/.eslintrc.json new file mode 100644 index 00000000000..ec40100be69 --- /dev/null +++ b/providers/messagebird/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "../../.eslintrc.js" +} diff --git a/providers/messagebird/.gitignore b/providers/messagebird/.gitignore new file mode 100644 index 00000000000..963d5292865 --- /dev/null +++ b/providers/messagebird/.gitignore @@ -0,0 +1,9 @@ +.idea/* +.nyc_output +build +node_modules +test +src/**.js +coverage +*.log +package-lock.json diff --git a/providers/messagebird/README.md b/providers/messagebird/README.md new file mode 100644 index 00000000000..4a63c9e1ace --- /dev/null +++ b/providers/messagebird/README.md @@ -0,0 +1,91 @@ +# Novu Messagebird Provider + +A Messagebird sms provider library for [@novu/node](https://github.com/novuhq/novu) + +## Usage + +# MessageBird Node.js API Client + +Welcome to the MessageBird Node.js API Client repository. This open-source library facilitates seamless integration with the MessageBird REST API, empowering developers to harness the power of SMS, Voice, and Chat functionalities within their applications. This Node.js client simplifies interaction with the MessageBird API, enabling the programmable sending of SMS messages, balance inquiries, and other operations. + +## Prerequisites + +To use this library effectively, you should have the following prerequisites in place: + +1. **MessageBird Account**: Ensure you have an active MessageBird account. If you haven't already, you can sign up for a free MessageBird account at [MessageBird Signup](https://www.messagebird.com/en/sign-up). + +2. **Access Key**: Generate an access key within the developers' section of your MessageBird account. This access key is essential for authenticating your requests to the MessageBird API. + +3. **Node.js**: This library requires Node.js version 0.10 or higher (or io.js) to be installed on your system. + +## Installation + +To install the MessageBird Node.js client, use npm with the following command: + +```bash +npm install messagebird +``` + +## Getting Started + +The following guide explains how to set up and use the library for your development needs. + +### Initialization + +You can initialize the MessageBird client using either CommonJS or ES6 import syntax. Replace `` with your actual access key. + +**CommonJS require syntax:** + +```javascript +const messagebird = require('messagebird').initClient(''); +``` + +**Typescript with ES6 import (or .mjs with Node >= v13):** + +```javascript +import { initClient } from 'messagebird'; +const messagebird = initClient(''); +``` + +### Example: Checking Your Account Balance + +Once the client is initialized, you can commence making API requests. Here's an example of how to retrieve your account balance: + +```javascript +// Get your balance +messagebird.balance.read(function (err, data) { + if (err) { + return console.log(err); + } + console.log(data); +}); +``` + +In the event of a successful response, you can expect an object similar to this: + +```javascript +{ + payment: 'prepaid', + type: 'credits', + amount: 42.5 +} +``` + +Should an error occur, the response may resemble the following: + +```javascript +{ + [Error: api error], + errors: [ + { + code: 2, + description: 'Request not allowed (incorrect access_key)', + parameter: 'access_key' + } + ] +} +``` + +For comprehensive details on using the library and exploring the entire array of API endpoints, consult the official MessageBird documentation at [MessageBird Developers](https://developers.messagebird.com). + +We wish you a productive and successful development journey! diff --git a/providers/messagebird/jest.config.js b/providers/messagebird/jest.config.js new file mode 100644 index 00000000000..e86e13bab91 --- /dev/null +++ b/providers/messagebird/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/messagebird/package.json b/providers/messagebird/package.json new file mode 100644 index 00000000000..d99e7c550fe --- /dev/null +++ b/providers/messagebird/package.json @@ -0,0 +1,78 @@ +{ + "name": "@novu/messagebird", + "version": "0.16.3", + "description": "A messagebird 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" + }, + "dependencies": { + "@novu/stateless": "0.16.3", + "messagebird": "^4.0.1" + }, + "devDependencies": { + "@istanbuljs/nyc-config-typescript": "~1.0.1", + "@types/jest": "~27.5.2", + "cspell": "~6.19.2", + "jest": "~27.5.1", + "npm-run-all": "^4.1.5", + "nyc": "~15.1.0", + "prettier": "~2.8.0", + "rimraf": "~3.0.2", + "ts-jest": "~27.1.5", + "ts-node": "~10.9.1", + "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/**" + ] + }, + "prettier": { + "singleQuote": true + }, + "nyc": { + "extends": "@istanbuljs/nyc-config-typescript", + "exclude": [ + "**/*.spec.js" + ] + } +} diff --git a/providers/messagebird/src/index.ts b/providers/messagebird/src/index.ts new file mode 100644 index 00000000000..9b713251fea --- /dev/null +++ b/providers/messagebird/src/index.ts @@ -0,0 +1 @@ +export * from './lib/messagebird.provider'; diff --git a/providers/messagebird/src/lib/messagebird.provider.spec.ts b/providers/messagebird/src/lib/messagebird.provider.spec.ts new file mode 100644 index 00000000000..ab172535206 --- /dev/null +++ b/providers/messagebird/src/lib/messagebird.provider.spec.ts @@ -0,0 +1,40 @@ +import { MessageBirdSmsProvider } from './messagebird.provider'; + +test('should trigger MessageBird correctly', async () => { + const provider = new MessageBirdSmsProvider({ + access_key: 'your-access-key', + }); + + const mockResponse = { + id: 'messagebird-message-id', + date: new Date(), + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } as any; + + const spy = jest + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-expect-error + .spyOn(provider.messageBirdClient.messages, 'create') + .mockImplementation(async (params, callback) => { + callback(null, mockResponse); + }); + + const testOptions = { + from: '+123456', + to: '+176543', + content: 'Test SMS Content', + }; + + await provider.sendMessage(testOptions); + + expect(spy).toHaveBeenCalled(); + + expect(spy).toHaveBeenCalledWith( + { + originator: '+123456', + recipients: ['+176543'], + body: 'Test SMS Content', + }, + expect.any(Function) + ); +}); diff --git a/providers/messagebird/src/lib/messagebird.provider.ts b/providers/messagebird/src/lib/messagebird.provider.ts new file mode 100644 index 00000000000..65afcea2ff1 --- /dev/null +++ b/providers/messagebird/src/lib/messagebird.provider.ts @@ -0,0 +1,47 @@ +import { + ChannelTypeEnum, + ISendMessageSuccessResponse, + ISmsOptions, + ISmsProvider, +} from '@novu/stateless'; + +import { Message } from 'messagebird/types/messages'; +import { initClient } from 'messagebird'; + +export class MessageBirdSmsProvider implements ISmsProvider { + id = 'messagebird'; + channelType = ChannelTypeEnum.SMS as ChannelTypeEnum.SMS; + private messageBirdClient: ReturnType; + constructor( + private config: { + access_key?: string; + } + ) { + this.messageBirdClient = initClient(config.access_key); + } + + async sendMessage( + options: ISmsOptions + ): Promise { + const params = { + originator: options.from, + recipients: [options.to], + body: options.content, + }; + + const response = await new Promise((resolve, reject) => { + this.messageBirdClient.messages.create(params, (err, res) => { + if (err) { + reject(err); + } else { + resolve(res); + } + }); + }); + + return { + id: response.id, + date: response.createdDatetime, + }; + } +} diff --git a/providers/messagebird/tsconfig.json b/providers/messagebird/tsconfig.json new file mode 100644 index 00000000000..5b8120fea36 --- /dev/null +++ b/providers/messagebird/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/messagebird/tsconfig.module.json b/providers/messagebird/tsconfig.module.json new file mode 100644 index 00000000000..79be3a5c40b --- /dev/null +++ b/providers/messagebird/tsconfig.module.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "target": "esnext", + "outDir": "build/module", + "module": "esnext" + }, + "exclude": ["node_modules/**"] +} From ef59345bf25825bdf01f61a7b8bd011d27f275d4 Mon Sep 17 00:00:00 2001 From: Ayush Shukla Date: Sat, 28 Oct 2023 20:20:09 +0000 Subject: [PATCH 2/4] fix: Corrected version and readme.md Added messagebird version as 0.21.0, updated readme to novu specific --- packages/application-generic/package.json | 2 +- providers/messagebird/README.md | 84 +---------------------- providers/messagebird/package.json | 2 +- 3 files changed, 5 insertions(+), 83 deletions(-) diff --git a/packages/application-generic/package.json b/packages/application-generic/package.json index 7cae687b6a1..cbfac59e13e 100644 --- a/packages/application-generic/package.json +++ b/packages/application-generic/package.json @@ -72,6 +72,7 @@ "@novu/mandrill": "^0.21.0", "@novu/maqsam": "^0.21.0", "@novu/mattermost": "^0.21.0", + "@novu/messagebird": "^0.21.0", "@novu/ms-teams": "^0.21.0", "@novu/netcore": "^0.21.0", "@novu/nodemailer": "^0.21.0", @@ -98,7 +99,6 @@ "@novu/telnyx": "^0.21.0", "@novu/termii": "^0.21.0", "@novu/testing": "^0.21.0", - "@novu/messagebird": "^0.16.3", "@novu/twilio": "^0.21.0", "@sentry/node": "^7.12.1", "analytics-node": "^6.2.0", diff --git a/providers/messagebird/README.md b/providers/messagebird/README.md index 4a63c9e1ace..6eefc7dca91 100644 --- a/providers/messagebird/README.md +++ b/providers/messagebird/README.md @@ -4,88 +4,10 @@ A Messagebird sms provider library for [@novu/node](https://github.com/novuhq/no ## Usage -# MessageBird Node.js API Client - -Welcome to the MessageBird Node.js API Client repository. This open-source library facilitates seamless integration with the MessageBird REST API, empowering developers to harness the power of SMS, Voice, and Chat functionalities within their applications. This Node.js client simplifies interaction with the MessageBird API, enabling the programmable sending of SMS messages, balance inquiries, and other operations. - -## Prerequisites - -To use this library effectively, you should have the following prerequisites in place: - -1. **MessageBird Account**: Ensure you have an active MessageBird account. If you haven't already, you can sign up for a free MessageBird account at [MessageBird Signup](https://www.messagebird.com/en/sign-up). - -2. **Access Key**: Generate an access key within the developers' section of your MessageBird account. This access key is essential for authenticating your requests to the MessageBird API. - -3. **Node.js**: This library requires Node.js version 0.10 or higher (or io.js) to be installed on your system. - -## Installation - -To install the MessageBird Node.js client, use npm with the following command: - -```bash -npm install messagebird -``` - -## Getting Started - -The following guide explains how to set up and use the library for your development needs. - -### Initialization - -You can initialize the MessageBird client using either CommonJS or ES6 import syntax. Replace `` with your actual access key. - -**CommonJS require syntax:** - -```javascript -const messagebird = require('messagebird').initClient(''); -``` - -**Typescript with ES6 import (or .mjs with Node >= v13):** - ```javascript -import { initClient } from 'messagebird'; -const messagebird = initClient(''); -``` - -### Example: Checking Your Account Balance +import { MessageBirdProvider } from '@novu/messagebird'; -Once the client is initialized, you can commence making API requests. Here's an example of how to retrieve your account balance: - -```javascript -// Get your balance -messagebird.balance.read(function (err, data) { - if (err) { - return console.log(err); - } - console.log(data); +const provider = new MailgunEmailProvider({ + access_key: process.env.MESSAGEBIRD_ACCESS_KEY, }); ``` - -In the event of a successful response, you can expect an object similar to this: - -```javascript -{ - payment: 'prepaid', - type: 'credits', - amount: 42.5 -} -``` - -Should an error occur, the response may resemble the following: - -```javascript -{ - [Error: api error], - errors: [ - { - code: 2, - description: 'Request not allowed (incorrect access_key)', - parameter: 'access_key' - } - ] -} -``` - -For comprehensive details on using the library and exploring the entire array of API endpoints, consult the official MessageBird documentation at [MessageBird Developers](https://developers.messagebird.com). - -We wish you a productive and successful development journey! diff --git a/providers/messagebird/package.json b/providers/messagebird/package.json index d99e7c550fe..413c37f53a1 100644 --- a/providers/messagebird/package.json +++ b/providers/messagebird/package.json @@ -1,6 +1,6 @@ { "name": "@novu/messagebird", - "version": "0.16.3", + "version": "0.21.0", "description": "A messagebird wrapper for novu", "main": "build/main/index.js", "typings": "build/main/index.d.ts", From d73c41a1b3c9d4a9ef8c55024b3972a410928f7a Mon Sep 17 00:00:00 2001 From: Ayush Shukla Date: Sat, 28 Oct 2023 20:26:47 +0000 Subject: [PATCH 3/4] fix: Corrected version and readme.md Added messagebird version as 0.21.0, updated readme to novu specific --- pnpm-lock.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2721725deb4..14f61518453 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2171,7 +2171,7 @@ importers: specifier: ^0.21.0 version: link:../../providers/mattermost '@novu/messagebird': - specifier: ^0.16.3 + specifier: ^0.21.0 version: link:../../providers/messagebird '@novu/ms-teams': specifier: ^0.21.0 @@ -3160,6 +3160,7 @@ importers: specifier: 4.9.5 version: 4.9.5 + providers/burst-sms: dependencies: '@novu/stateless': @@ -30170,7 +30171,7 @@ packages: object.values: 1.1.6 prop-types: 15.8.1 resolve: 2.0.0-next.4 - semver: 6.3.0 + semver: 6.3.1 string.prototype.matchall: 4.0.8 dev: true @@ -44071,7 +44072,7 @@ 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 @@ -46025,7 +46026,7 @@ packages: color-name: 1.1.4 didyoumean: 1.2.2 dlv: 1.1.3 - fast-glob: 3.3.0 + fast-glob: 3.3.1 glob-parent: 6.0.2 is-glob: 4.0.3 jiti: 1.18.2 From 496749d2f59a025ffcb3b8dbc2893bb850d87562 Mon Sep 17 00:00:00 2001 From: Ayush Shukla Date: Sat, 28 Oct 2023 21:20:14 +0000 Subject: [PATCH 4/4] feat: Added 'messagebird' and 'Datetime' to cspell dictionary --- .cspell.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.cspell.json b/.cspell.json index 2aafec01243..088020717da 100644 --- a/.cspell.json +++ b/.cspell.json @@ -518,7 +518,9 @@ "ryver", "idempotency", "IDEMPOTENCY", - "Idempotency" + "Idempotency", + "messagebird", + "Datetime" ], "flagWords": [], "patterns": [