Skip to content

Commit

Permalink
fix(root): Apply more TS fixes
Browse files Browse the repository at this point in the history
Ensure that the repo builds after resolving all TS issue.
Also force @novu/shared resolution to v0.24.1 instead of v0.24.2.
The latter seems to be broken for the state of the code at the time.
  • Loading branch information
SokratisVidros committed Sep 11, 2024
1 parent f0447ca commit 253133e
Show file tree
Hide file tree
Showing 6 changed files with 8,578 additions and 13,926 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@
"trim-newlines@<3.0.1": "^3.0.1",
"minimatch@>=3.0.0 <3.0.5": "^3.0.5",
"get-func-name@<2.0.1": "^2.0.1",
"postcss@<8.4.31": "^8.4.31"
"postcss@<8.4.31": "^8.4.31",
"@novu/shared": "0.24.1"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { IChatOptions, IChatProvider } from '@novu/stateless';
import {
IChatOptions,
IChatProvider,
ISendMessageSuccessResponse,
} from '@novu/stateless';
import { ChannelTypeEnum } from '@novu/shared';
import { IChatHandler } from '../interfaces';

Expand All @@ -16,7 +20,7 @@ export abstract class BaseChatHandler implements IChatHandler {

abstract buildProvider(credentials);

async send(chatContent: IChatOptions) {
async send(chatContent: IChatOptions): Promise<ISendMessageSuccessResponse> {
if (process.env.NODE_ENV === 'test') {
return {};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { IEmailOptions, IEmailProvider } from '@novu/stateless';
import {
IEmailOptions,
IEmailProvider,
ISendMessageSuccessResponse,
ICheckIntegrationResponse,
} from '@novu/stateless';
import { ChannelTypeEnum } from '@novu/shared';

import { IMailHandler } from '../interfaces/send.handler.interface';
Expand All @@ -18,7 +23,7 @@ export abstract class BaseHandler implements IMailHandler {

abstract buildProvider(credentials, options);

async send(mailData: IEmailOptions) {
async send(mailData: IEmailOptions): Promise<ISendMessageSuccessResponse> {
if (process.env.NODE_ENV === 'test') {
return {};
}
Expand All @@ -30,7 +35,7 @@ export abstract class BaseHandler implements IMailHandler {
return this.provider;
}

async check() {
async check(): Promise<ICheckIntegrationResponse> {
const mailData: IEmailOptions = {
html: '<div>checking integration</div>',
subject: 'Checking Integration',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { IPushOptions, IPushProvider } from '@novu/stateless';
import {
IPushOptions,
IPushProvider,
ISendMessageSuccessResponse,
} from '@novu/stateless';
import { ChannelTypeEnum, ICredentials } from '@novu/shared';
import {} from '@novu/dal';
import { IPushHandler } from '../interfaces';

export abstract class BasePushHandler implements IPushHandler {
Expand All @@ -15,7 +18,7 @@ export abstract class BasePushHandler implements IPushHandler {
return providerId === this.providerId && channelType === this.channelType;
}

async send(options: IPushOptions) {
async send(options: IPushOptions): Promise<ISendMessageSuccessResponse> {
if (process.env.NODE_ENV === 'test') {
throw new Error(
'Currently 3rd-party packages test are not support on test env'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { ISmsOptions, ISmsProvider } from '@novu/stateless';
import {
ISmsOptions,
ISmsProvider,
ISendMessageSuccessResponse,
} from '@novu/stateless';
import { ChannelTypeEnum, ICredentials } from '@novu/shared';
import { ISmsHandler } from '../interfaces';

Expand All @@ -18,7 +22,7 @@ export abstract class BaseSmsHandler implements ISmsHandler {
return providerId === this.providerId && channelType === this.channelType;
}

async send(options: ISmsOptions) {
async send(options: ISmsOptions): Promise<ISendMessageSuccessResponse> {
if (process.env.NODE_ENV === 'test') {
throw new Error(
'Currently 3rd-party packages test are not support on test env'
Expand Down
Loading

0 comments on commit 253133e

Please sign in to comment.