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

Update version field typing #259

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion dist/declarations/client/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ declare class Client {
getAPIToken(): string | undefined;
getConfig(): {
host: string;
version: string;
version: `v${number}` | `v${number}.${number}`;
output: import("axios").ResponseType;
};
getOptions(): {
Expand Down
2 changes: 1 addition & 1 deletion dist/declarations/request/Request.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AxiosProxyConfig, AxiosRequestConfig, AxiosRequestHeaders, ResponseType
import { TObject } from '../types';
export interface RequestConfig {
host: string;
version: string;
version: `v${number}` | `v${number}.${number}`;
output: ResponseType;
}
export interface RequestOptions {
Expand Down
2 changes: 1 addition & 1 deletion lib/request/Request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { TObject } from '../types';

export interface RequestConfig {
host: string;
version: string;
version: `v${number}` | `v${number}.${number}`;
output: ResponseType;
}

Expand Down
5 changes: 3 additions & 2 deletions test/integration/sms.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { expect } from 'chai';
import { isUndefined } from '../../lib/utils';
/*lib*/
import Mailjet, { Request } from '../../lib/index';
import { RequestConfig } from '../../lib/request/Request';
/*other*/

describe('SMS Basic Usage', () => {
Expand All @@ -15,7 +16,7 @@ describe('SMS Basic Usage', () => {
if (isUndefined(API_TOKEN)) {
this.skip();
} else {
const smsConfig = {
const smsConfig: Partial<RequestConfig> = {
version: 'v4',
};
client = Mailjet.smsConnect(API_TOKEN, { config: smsConfig });
Expand All @@ -33,7 +34,7 @@ describe('SMS Basic Usage', () => {
});

it('creates an instance of the client wiht options', () => {
const smsConfig = {
const smsConfig: Partial<RequestConfig> = {
version: 'v4',
};

Expand Down