Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Feat eazy sms #5393

Merged
merged 9 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@
"cafebabe",
"Icann",
"limitbar",
"eazy"
],
"flagWords": [],
"patterns": [
Expand Down
5 changes: 5 additions & 0 deletions apps/api/src/app/integrations/dtos/credentials.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,9 @@ export class CredentialsDto implements ICredentials {
@IsString()
@IsOptional()
externalLink?: string;

@ApiPropertyOptional()
@IsString()
@IsOptional()
channelId?: string;
}
14 changes: 14 additions & 0 deletions apps/web/public/static/images/providers/dark/eazy-sms.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions apps/web/public/static/images/providers/dark/square/eazy-sms.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions apps/web/public/static/images/providers/light/eazy-sms.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions apps/web/public/static/images/providers/light/square/eazy-sms.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const providers: Record<ChannelTypeEnum, ProvidersIdEnum[]> = {
SmsProviderIdEnum.Simpletexting,
SmsProviderIdEnum.BrevoSms,
SmsProviderIdEnum.ISendSms,
SmsProviderIdEnum.EazySms,
].sort(),
],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const integrationSchema = new Schema<IntegrationDBModel>(
state: Schema.Types.String,
externalLink: Schema.Types.String,
apiToken: Schema.Types.String,
channelId: Schema.Types.String,
},
active: {
type: Schema.Types.Boolean,
Expand Down
9 changes: 9 additions & 0 deletions libs/shared/src/consts/providers/channels/sms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
iSendSmsConfig,
ringCentralConfig,
brevoSmsConfig,
eazySmsConfig,
} from '../credentials';
import { SmsProviderIdEnum } from '../provider.enum';

Expand Down Expand Up @@ -271,4 +272,12 @@ export const smsProviders: IProviderConfig[] = [
docReference: 'https://developers.brevo.com/reference/sendtransacsms',
logoFileName: { light: 'brevo.svg', dark: 'brevo.svg' },
},
{
id: SmsProviderIdEnum.EazySms,
displayName: `Eazy`,
channel: ChannelTypeEnum.SMS,
credentials: eazySmsConfig,
docReference: 'https://developers.eazy.im/#678805af-be7b-4487-93a4-c1007b7920f5',
logoFileName: { light: 'eazy-sms.svg', dark: 'eazy-sms.svg' },
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -1104,3 +1104,19 @@ export const brevoSmsConfig: IConfigCredentials[] = [
},
...smsConfigBase,
];

export const eazySmsConfig: IConfigCredentials[] = [
{
key: CredentialsKeyEnum.ApiKey,
displayName: 'API Key',
type: 'string',
required: true,
},
{
key: CredentialsKeyEnum.channelId,
displayName: 'SMS Channel Id',
type: 'string',
required: true,
description: 'Your SMS Channel Id',
},
];
2 changes: 2 additions & 0 deletions libs/shared/src/consts/providers/provider.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export enum CredentialsKeyEnum {
imageUrl = 'imageUrl',
state = 'state',
externalLink = 'externalLink',
channelId = 'channelId',
}

export enum EmailProviderIdEnum {
Expand Down Expand Up @@ -100,6 +101,7 @@ export enum SmsProviderIdEnum {
AzureSms = 'azure-sms',
RingCentral = 'ring-central',
BrevoSms = 'brevo-sms',
EazySms = 'eazy-sms',
}

export enum ChatProviderIdEnum {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ export interface ICredentials {
imageUrl?: string;
state?: string;
externalLink?: string;
channelId?: string;
}
1 change: 1 addition & 0 deletions packages/application-generic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"@novu/testing": "^0.24.1",
"@novu/twilio": "^0.24.1",
"@novu/zulip": "^0.24.1",
"@novu/eazy-sms": "^0.24.1",
"@opentelemetry/api": "^1.7.0",
"@opentelemetry/auto-instrumentations-node": "^0.40.2",
"@opentelemetry/context-async-hooks": "^1.19.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { ChannelTypeEnum, ICredentials } from '@novu/shared';
import { EazySmsProvider } from '@novu/eazy-sms';
import { BaseSmsHandler } from './base.handler';

export class EazySmsHandler extends BaseSmsHandler {
constructor() {
super('eazy-sms', ChannelTypeEnum.SMS);
}

buildProvider(credentials: ICredentials) {
const config = {
apiKey: credentials.apiKey,
channelId: credentials.channelId,
};
this.provider = new EazySmsProvider(config);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ export * from './nexmo.handler';
export * from './isend-sms.handler';
export * from './ring-central.handler';
export * from './brevo-sms.handler';
export * from './eazy-sms.handler';
2 changes: 2 additions & 0 deletions packages/application-generic/src/factories/sms/sms.factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
ISendSmsHandler,
RingCentralHandler,
BrevoSmsHandler,
EazySmsHandler,
} from './handlers';

export class SmsFactory implements ISmsFactory {
Expand Down Expand Up @@ -61,6 +62,7 @@ export class SmsFactory implements ISmsFactory {
new ISendSmsHandler(),
new RingCentralHandler(),
new BrevoSmsHandler(),
new EazySmsHandler(),
];

getHandler(integration: IntegrationEntity) {
Expand Down
Loading
Loading