-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amqp provider based on #3812 #4040
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -740,3 +740,36 @@ export const sendchampConfig: IConfigCredentials[] = [ | |
}, | ||
...smsConfigBase, | ||
]; | ||
|
||
export const amqpSmsConfig: IConfigCredentials[] = [ | ||
{ | ||
key: CredentialsKeyEnum.ApiKey, | ||
displayName: 'Amqp Queue', | ||
type: 'text', | ||
required: true, | ||
}, | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess from the perspective of AMQP the field @scopsy I think this is an important point that we should discuss, if gathering providers by channel should be done by goal or by message entity type. |
||
key: CredentialsKeyEnum.Host, | ||
displayName: 'Amqp Host', | ||
type: 'text', | ||
required: true, | ||
}, | ||
{ | ||
key: CredentialsKeyEnum.Port, | ||
displayName: 'Amqp port', | ||
type: 'text', | ||
required: true, | ||
}, | ||
{ | ||
key: CredentialsKeyEnum.User, | ||
displayName: 'Amqp user', | ||
type: 'text', | ||
required: true, | ||
}, | ||
{ | ||
key: CredentialsKeyEnum.Password, | ||
displayName: 'Amqp password', | ||
type: 'password', | ||
required: true, | ||
}, | ||
]; |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -71,6 +71,7 @@ export enum SmsProviderIdEnum { | |||||
AfricasTalking = 'africas-talking', | ||||||
Novu = 'novu-sms', | ||||||
Sendchamp = 'sendchamp', | ||||||
AmqpSms = 'amqp-sms', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
We don't need to specify it is for the SMS channel. We add the channel to the enum key and value for the cases that a provider can send notifications to more than one channel. |
||||||
} | ||||||
|
||||||
export enum ChatProviderIdEnum { | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,6 +91,7 @@ | |
"@novu/termii": "^0.18.0", | ||
"@novu/testing": "^0.18.0", | ||
"@novu/twilio": "^0.18.0", | ||
"@novu/amqp-sms": "0.16.3", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The provider versions are outdated as unfortunately this PR has taken long for us to review. It will need updates. |
||
"@sentry/node": "^7.12.1", | ||
"analytics-node": "^6.2.0", | ||
"bullmq": "^3.10.2", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { ChannelTypeEnum } from '@novu/shared'; | ||
import { BaseSmsHandler } from './base.handler'; | ||
import { AmqpSmsProvider } from '@novu/amqp-sms'; | ||
|
||
export class AmqpSmsHandler extends BaseSmsHandler { | ||
constructor() { | ||
super('amqp-sms', ChannelTypeEnum.SMS); | ||
} | ||
|
||
buildProvider(credentials: any) { | ||
this.provider = new AmqpSmsProvider({ | ||
apiKey: credentials.apiKey, | ||
host: credentials.host, | ||
port: credentials.port, | ||
user: credentials.user, | ||
password: credentials.password, | ||
}); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"path": "cz-conventional-changelog" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "../../.eslintrc.js" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.idea/* | ||
.nyc_output | ||
build | ||
node_modules | ||
test | ||
src/**.js | ||
coverage | ||
*.log | ||
package-lock.json |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,9 @@ | ||||||||||||||||||||||||||||||||||||
# Novu AmqpSms Provider | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
A AmqpSms sms provider library for [@novu/node](https://github.com/novuhq/novu) | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
## Usage | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
```javascript | ||||||||||||||||||||||||||||||||||||
FILL IN THE INITIALIZATION USAGE | ||||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||||
Comment on lines
+1
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the display name let's keep the acronym in capitals as it is not code syntax.