Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-mailjet

Package Overview
Dependencies
Maintainers
7
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-mailjet - npm Package Compare versions

Comparing version 5.1.1 to 6.0.0

declarations/client/Client.d.ts

18

CHANGELOG.md

@@ -5,2 +5,20 @@ # Changelog

## [6.0.0](https://github.com/mailjet/mailjet-apiv3-nodejs/compare/v5.1.1...v6.0.0) (2022-12-27)
### Bug Fixes
* **types:** Build Typescript changes ([f683f70](https://github.com/mailjet/mailjet-apiv3-nodejs/commits/f683f708db0245f74568f1c4bf0e06cc5f0a86c7))
* **types:** Typescript exported types ([0e19bab](https://github.com/mailjet/mailjet-apiv3-nodejs/commits/0e19bab228ffc83d19b17c270e0156f58f60cfe1))
### Docs changes
* Update Readme ([29bb64f](https://github.com/mailjet/mailjet-apiv3-nodejs/commits/29bb64f23092d72728c19208ac2367293433d62b))
### Breaking changes
* Update TypeScript namings in the code and tests ([904735d](https://github.com/mailjet/mailjet-apiv3-nodejs/commits/904735db615480de2d1614f1b93a27a3de37d73d))
### [5.1.1](https://github.com/mailjet/mailjet-apiv3-nodejs/compare/v5.1.0...v5.1.1) (2022-07-27)

@@ -7,0 +25,0 @@

22

declarations/client/index.d.ts

@@ -1,5 +0,5 @@

import { IClientParams } from './IClient';
import { IRequestConfig, TRequestConstructorConfig } from '../request/IRequest';
import { ClientParams } from './Client';
import { RequestConfig, RequestConstructorConfig } from '../request/Request';
import Request from '../request';
export declare type TClientConnectParams = Pick<IClientParams, 'config' | 'options'>;
export declare type ClientConnectParams = Pick<ClientParams, 'config' | 'options'>;
declare class Client {

@@ -12,3 +12,3 @@ private version;

private apiToken?;
constructor(params: IClientParams);
constructor(params: ClientParams);
getPackageVersion(): string;

@@ -30,6 +30,6 @@ getAPIKey(): string | undefined;

};
get(resource: string, config?: TRequestConstructorConfig): Request;
post(resource: string, config?: TRequestConstructorConfig): Request;
put(resource: string, config?: TRequestConstructorConfig): Request;
delete(resource: string, config?: TRequestConstructorConfig): Request;
get(resource: string, config?: RequestConstructorConfig): Request;
post(resource: string, config?: RequestConstructorConfig): Request;
put(resource: string, config?: RequestConstructorConfig): Request;
delete(resource: string, config?: RequestConstructorConfig): Request;
private init;

@@ -41,5 +41,5 @@ private cloneParams;

private basicConnectStrategy;
static apiConnect(apiKey: string, apiSecret: string, params?: TClientConnectParams): Client;
static smsConnect(apiToken: string, params?: TClientConnectParams): Client;
static config: Readonly<IRequestConfig>;
static apiConnect(apiKey: string, apiSecret: string, params?: ClientConnectParams): Client;
static smsConnect(apiToken: string, params?: ClientConnectParams): Client;
static config: Readonly<RequestConfig>;
static packageJSON: Readonly<{

@@ -46,0 +46,0 @@ readonly name: string;

@@ -1,7 +0,7 @@

import { TObject } from "../types";
import { ILibraryResponse, ILibraryLocalResponse } from "../types/api/LibraryResponse";
import { TObject } from '@custom/types';
import { LibraryResponse, LibraryLocalResponse } from '@mailjet/types/api/LibraryResponse';
import HttpMethods from './HttpMethods';
import { TRequestData, TRequestParams, TRequestConstructorConfig } from './IRequest';
import { RequestData, RequestParams, RequestConstructorConfig } from './Request';
import Client from '../client';
declare type TUnknownRec = TObject.TUnknownRec;
declare type UnknownRec = TObject.UnknownRec;
declare class Request {

@@ -15,3 +15,3 @@ private readonly client;

private actionPath;
constructor(client: Client, method: HttpMethods, resource: string, config?: TRequestConstructorConfig);
constructor(client: Client, method: HttpMethods, resource: string, config?: RequestConstructorConfig);
getUserAgent(): string;

@@ -31,4 +31,4 @@ getCredentials(): {

action(name: string): this;
request<TBody extends TRequestData>(data?: TRequestData, params?: TRequestParams, performAPICall?: true): Promise<ILibraryResponse<TBody>>;
request<TBody extends TRequestData, TParams extends TUnknownRec>(data?: TBody, params?: TParams, performAPICall?: false): Promise<ILibraryLocalResponse<TBody, TParams>>;
request<Body extends RequestData>(data?: RequestData, params?: RequestParams, performAPICall?: true): Promise<LibraryResponse<Body>>;
request<Body extends RequestData, Params extends UnknownRec>(data?: Body, params?: Params, performAPICall?: false): Promise<LibraryLocalResponse<Body, Params>>;
static protocol: "https://";

@@ -35,0 +35,0 @@ static parseToJSONb(text: string): any;

@@ -1,2 +0,2 @@

import { Common } from "./Common";
import { Common } from '@mailjet/types/api/Common';
export declare namespace DraftCampaign {

@@ -28,11 +28,11 @@ export enum EditMode {

}
export interface IRecipient {
export interface Recipient {
Email: string;
Name?: string;
}
export interface ICampaignDraft<TAXTesting = Common.TUnknownRec> {
export interface CampaignDraft<AXTesting = Common.UnknownRec> {
ID: number;
AXFraction: number;
AXFractionName: string;
AXTesting: TAXTesting;
AXTesting: AXTesting;
Current: number;

@@ -61,4 +61,4 @@ EditMode: EditMode;

}
export interface ICampaignDraftDetailContent<THeaders = Common.TUnknownRec> {
Headers: THeaders;
export interface CampaignDraftDetailContent<Headers = Common.UnknownRec> {
Headers: Headers;
'Html-part': string;

@@ -68,7 +68,7 @@ 'Text-part': string;

}
export interface ICampaignDraftSchedule {
export interface CampaignDraftSchedule {
Date: string;
Status: string;
}
export interface IPostCampaignDraftBody<TAXTesting = Common.TUnknownRec> {
export type PostCampaignDraftBody<AXTesting = Common.UnknownRec> = {
Locale: string;

@@ -78,3 +78,3 @@ Subject: string;

AXFractionName?: string;
AXTesting?: TAXTesting;
AXTesting?: AXTesting;
Current?: number;

@@ -94,7 +94,7 @@ EditMode?: EditMode;

SenderEmail?: string;
}
export interface IPutCampaignDraftBody<TAXTesting = Common.TUnknownRec> extends Omit<Partial<IPostCampaignDraftBody<TAXTesting>>, 'ContactsListAlt'> {
};
export type PutCampaignDraftBody<AXTesting = Common.UnknownRec> = Omit<Partial<PostCampaignDraftBody<AXTesting>>, 'ContactsListAlt'> & {
Status?: CampaignDraftStatus;
}
export interface IGetCampaignDraftQueryParams extends Partial<Common.IPagination> {
};
export type GetCampaignDraftQueryParams = Partial<Common.Pagination> & {
AXTesting?: number;

@@ -115,30 +115,28 @@ Campaign?: number;

Template?: number;
}
export interface IPostCampaignDraftDetailContentBody<THeaders = Common.TUnknownRec> extends Partial<ICampaignDraftDetailContent<THeaders>> {
}
export interface IPostCampaignDraftScheduleBody {
};
export type PostCampaignDraftDetailContentBody<Headers = Common.UnknownRec> = Partial<CampaignDraftDetailContent<Headers>>;
export type PostCampaignDraftScheduleBody = {
Date: string;
}
export interface IPutCampaignDraftScheduleBody extends Partial<IPostCampaignDraftScheduleBody> {
}
export interface IPostCampaignDraftTestBody {
Recipients: IRecipient[];
}
type TCampaignDraftResponse = Common.IResponse<ICampaignDraft[]>;
type TCampaignDraftScheduleResponse = Common.IResponse<ICampaignDraftSchedule[]>;
type TCampaignDraftDetailContentResponse<THeaders = Common.TUnknownRec> = Common.IResponse<Array<ICampaignDraftDetailContent<THeaders>>>;
type TCampaignDraftStatusResponse = Common.IResponse<Array<{
};
export type PutCampaignDraftScheduleBody = Partial<PostCampaignDraftScheduleBody>;
export type PostCampaignDraftTestBody = {
Recipients: Recipient[];
};
type CampaignDraftResponse = Common.Response<CampaignDraft[]>;
type CampaignDraftScheduleResponse = Common.Response<CampaignDraftSchedule[]>;
type CampaignDraftDetailContentResponse<Headers = Common.UnknownRec> = Common.Response<Array<CampaignDraftDetailContent<Headers>>>;
type CampaignDraftStatusResponse = Common.Response<Array<{
Status: CampaignDraftSendingStatus;
}>>;
export type TPostCampaignDraftResponse = TCampaignDraftResponse;
export type TPutCampaignDraftResponse = TCampaignDraftResponse;
export type TGetCampaignDraftResponse = TCampaignDraftResponse;
export type TPostCampaignDraftScheduleResponse = TCampaignDraftScheduleResponse;
export type TPutCampaignDraftScheduleResponse = TCampaignDraftScheduleResponse;
export type TGetCampaignDraftScheduleResponse = TCampaignDraftScheduleResponse;
export type TPostCampaignDraftDetailContentResponse<THeaders = Common.TUnknownRec> = TCampaignDraftDetailContentResponse<THeaders>;
export type TGetCampaignDraftDetailContentResponse<THeaders = Common.TUnknownRec> = TCampaignDraftDetailContentResponse<THeaders>;
export type TPostCampaignDraftSend = TCampaignDraftStatusResponse;
export type TPostCampaignDraftTest = TCampaignDraftStatusResponse;
export type TGetCampaignDraftStatus = TCampaignDraftStatusResponse;
export type PostCampaignDraftResponse = CampaignDraftResponse;
export type PutCampaignDraftResponse = CampaignDraftResponse;
export type GetCampaignDraftResponse = CampaignDraftResponse;
export type PostCampaignDraftScheduleResponse = CampaignDraftScheduleResponse;
export type PutCampaignDraftScheduleResponse = CampaignDraftScheduleResponse;
export type GetCampaignDraftScheduleResponse = CampaignDraftScheduleResponse;
export type PostCampaignDraftDetailContentResponse<Headers = Common.UnknownRec> = CampaignDraftDetailContentResponse<Headers>;
export type GetCampaignDraftDetailContentResponse<Headers = Common.UnknownRec> = CampaignDraftDetailContentResponse<Headers>;
export type PostCampaignDraftSend = CampaignDraftStatusResponse;
export type PostCampaignDraftTest = CampaignDraftStatusResponse;
export type GetCampaignDraftStatus = CampaignDraftStatusResponse;
export {};

@@ -152,3 +150,3 @@ }

}
export interface ICampaign {
export interface Campaign {
ID: number;

@@ -175,7 +173,7 @@ IsDeleted: boolean;

}
export interface IPutCampaignBody {
export type PutCampaignBody = {
IsDeleted?: boolean;
IsStarred?: boolean;
}
export interface IGetCampaignQueryParams extends Partial<Common.ITimestampPeriod>, Partial<Common.IPagination> {
};
export type GetCampaignQueryParams = Partial<Common.TimestampPeriod> & Partial<Common.Pagination> & {
CampaignID?: number;

@@ -193,7 +191,7 @@ ContactsListID?: number;

WorkflowID?: number;
}
type TCampaignResponse = Common.IResponse<ICampaign[]>;
export type TPutCampaignResponse = TCampaignResponse;
export type TGetCampaignResponse = TCampaignResponse;
};
type CampaignResponse = Common.Response<Campaign[]>;
export type PutCampaignResponse = CampaignResponse;
export type GetCampaignResponse = CampaignResponse;
export {};
}
export declare namespace Common {
type TUnknownRec = Record<string, unknown>;
interface IPagination {
type UnknownRec = Record<string, unknown>;
interface Pagination {
countOnly: boolean;

@@ -9,11 +9,11 @@ Limit: number;

}
interface ITimestampPeriod {
interface TimestampPeriod {
FromTS: string | number;
ToTS: string | number;
}
interface IResponse<TEntity> {
type Response<Entity> = {
Count: number;
Total: number;
Data: TEntity;
}
Data: Entity;
};
enum Period {

@@ -20,0 +20,0 @@ Day = "Day",

@@ -1,4 +0,4 @@

import { Common } from "./Common";
import { Common } from '@mailjet/types/api/Common';
export declare namespace Contact {
export interface IContact {
export interface Contact {
ID: number;

@@ -16,22 +16,25 @@ IsExcludedFromCampaigns: boolean;

}
export interface IPostContactBody {
export type PostContactBody = {
Email: string;
IsExcludedFromCampaigns?: boolean;
Name?: string;
}
export interface IPutContactBody extends Omit<IPostContactBody, 'Email'> {
}
export interface IGetContactQueryParams extends Partial<Common.IPagination> {
};
export type PutContactBody = Omit<PostContactBody, 'Email'>;
export type GetContactQueryParams = Partial<Common.Pagination> & {
Campaign?: number;
ContactsList?: number;
IsExcludedFromCampaigns?: boolean;
}
type TContactResponse = Common.IResponse<IContact[]>;
export type TPostContactResponse = TContactResponse;
export type IPutContactResponse = TContactResponse;
export type TGetContactResponse = TContactResponse;
};
type ContactResponse = {
Count: number;
Total: number;
Data: Contact[];
};
export type PostContactResponse = ContactResponse;
export type PutContactResponse = ContactResponse;
export type GetContactResponse = ContactResponse;
export {};
}
export declare namespace ContactList {
export interface IContactList {
export interface ContactList {
ID: number;

@@ -44,9 +47,8 @@ IsDeleted: boolean;

}
export interface IPostContactListBody {
export type PostContactListBody = {
Name: string;
IsDeleted?: boolean;
}
export interface IPutContactListBody extends Partial<IPostContactListBody> {
}
export interface IGetContactListQueryParams extends Partial<Common.IPagination> {
};
export type PutContactListBody = Partial<PostContactListBody>;
export type GetContactListQueryParams = Partial<Common.Pagination> & {
Address?: string;

@@ -56,7 +58,7 @@ ExcludeID?: number;

Name?: string;
}
type TContactListResponse = Common.IResponse<IContactList[]>;
export type TPostContactListResponse = TContactListResponse;
export type TPutContactListResponse = TContactListResponse;
export type TGetContactListResponse = TContactListResponse;
};
type ContactListResponse = Common.Response<ContactList[]>;
export type PostContactListResponse = ContactListResponse;
export type PutContactListResponse = ContactListResponse;
export type GetContactListResponse = ContactListResponse;
export {};

@@ -96,6 +98,6 @@ }

}
export interface IJob {
export interface Job {
JobID: number;
}
export interface ICSVImport {
export interface CSVImport {
ID: number;

@@ -116,8 +118,8 @@ ErrTreshold: number;

}
export interface IContactList {
export interface ContactList {
ListID: number;
Action: ManageContactsAction;
}
export interface IContactManageManyContacts {
ContactsLists: IContactList[];
export interface ContactManageManyContacts {
ContactsLists: ContactList[];
Count: number;

@@ -130,3 +132,3 @@ Error: string;

}
export interface IContactsListImportList {
export interface ContactsListImportList {
JobID: number;

@@ -136,21 +138,21 @@ Action: ImportListAction;

}
export interface IContactBody<TProperties = Common.TUnknownRec> {
export type ContactBody<Properties = Common.UnknownRec> = {
Email: string;
Name?: string;
IsExcludedFromCampaigns?: boolean;
Properties?: TProperties;
}
export interface IPostContactManageManyContactsBody<TProperties = Common.TUnknownRec> {
Contacts: Array<IContactBody<TProperties>>;
ContactsLists?: IContactList[];
}
export interface IPostContactsListImportListBody {
Properties?: Properties;
};
export type PostContactManageManyContactsBody<Properties = Common.UnknownRec> = {
Contacts: Array<ContactBody<Properties>>;
ContactsLists?: ContactList[];
};
export type PostContactsListImportListBody = {
Action: ImportListAction;
ListID: number;
}
export interface IPostContactsListManageManyContactsBody<TProperties = Common.TUnknownRec> {
};
export type PostContactsListManageManyContactsBody<Properties = Common.UnknownRec> = {
Action: ManageContactsAction;
Contacts: Array<IContactBody<TProperties>>;
}
export interface IPostCSVImportBody {
Contacts: Array<ContactBody<Properties>>;
};
export type PostCSVImportBody = {
ContactsListID: number;

@@ -161,20 +163,19 @@ DataID: number;

Method?: ImportCSVMethod;
}
export interface IPutCSVImportBody extends Partial<IPostCSVImportBody> {
};
export type PutCSVImportBody = Partial<PostCSVImportBody> & {
Status?: CSVImportStatus;
}
export interface IGetCSVImportQueryParams extends Partial<Common.IPagination> {
}
type TJobResponse = Common.IResponse<IJob[]>;
type TCSVImportResponse = Common.IResponse<ICSVImport[]>;
type TContactManageManyContactsResponse = Common.IResponse<IContactManageManyContacts[]>;
export type TPostContactManageManyContactsResponse = TJobResponse;
export type TGetContactManageManyContactsResponse = TContactManageManyContactsResponse;
export type TPostContactsListImportListResponse = TJobResponse;
export type TGetContactsListImportListResponse = Common.IResponse<IContactsListImportList[]>;
export type TPostContactsListManageManyContactsResponse = TJobResponse;
export type TGetContactsListManageManyContactsResponse = TContactManageManyContactsResponse;
export type TPostCSVImportResponse = TCSVImportResponse;
export type TPutCSVImportResponse = TCSVImportResponse;
export type TGetCSVImportResponse = TCSVImportResponse;
};
export type GetCSVImportQueryParams = Partial<Common.Pagination>;
type JobResponse = Common.Response<Job[]>;
type CSVImportResponse = Common.Response<CSVImport[]>;
type ContactManageManyContactsResponse = Common.Response<ContactManageManyContacts[]>;
export type PostContactManageManyContactsResponse = JobResponse;
export type GetContactManageManyContactsResponse = ContactManageManyContactsResponse;
export type PostContactsListImportListResponse = JobResponse;
export type GetContactsListImportListResponse = Common.Response<ContactsListImportList[]>;
export type PostContactsListManageManyContactsResponse = JobResponse;
export type GetContactsListManageManyContactsResponse = ContactManageManyContactsResponse;
export type PostCSVImportResponse = CSVImportResponse;
export type PutCSVImportResponse = CSVImportResponse;
export type GetCSVImportResponse = CSVImportResponse;
export {};

@@ -194,12 +195,12 @@ }

}
export interface IContactProperty {
export interface ContactProperty {
Name: string;
Value: string;
}
export interface IContactData {
export interface ContactData {
ID: number;
ContactID: number;
Data: IContactProperty[];
Data: ContactProperty[];
}
export interface IContactMetaData {
export interface ContactMetaData {
ID: number;

@@ -210,19 +211,19 @@ Datatype: DataType;

}
export interface IPostContactMetaDataBody {
export type PostContactMetaDataBody = {
Name: string;
Datatype?: DataType;
NameSpace?: NameSpace;
}
export interface IPutContactMetaDataBody {
};
export type PutContactMetaDataBody = {
Name?: string;
Datatype?: DataType;
}
export interface IGetContactMetaDataQueryParams extends Partial<Common.IPagination> {
};
export type GetContactMetaDataQueryParams = Partial<Common.Pagination> & {
DataType?: DataType;
Namespace?: NameSpace;
}
export interface IPutContactDataBody {
Data: IContactProperty[];
}
export interface IGetContactDataQueryParams extends Partial<Common.IPagination> {
};
export type PutContactDataBody = {
Data: ContactProperty[];
};
export type GetContactDataQueryParams = Partial<Common.Pagination> & {
Campaign?: number;

@@ -233,20 +234,20 @@ ContactEmail?: string;

LastActivityAt?: string;
}
type TContactDataResponse = Common.IResponse<IContactData[]>;
type TContactMetaDataResponse = Common.IResponse<IContactMetaData[]>;
export type TPostContactMetaDataResponse = TContactMetaDataResponse;
export type TPutContactMetaDataResponse = TContactMetaDataResponse;
export type TGetContactMetaDataResponse = TContactMetaDataResponse;
export type TPutContactDataResponse = TContactDataResponse;
export type TGetContactDataResponse = TContactDataResponse;
};
type ContactDataResponse = Common.Response<ContactData[]>;
type ContactMetaDataResponse = Common.Response<ContactMetaData[]>;
export type PostContactMetaDataResponse = ContactMetaDataResponse;
export type PutContactMetaDataResponse = ContactMetaDataResponse;
export type GetContactMetaDataResponse = ContactMetaDataResponse;
export type PutContactDataResponse = ContactDataResponse;
export type GetContactDataResponse = ContactDataResponse;
export {};
}
export declare namespace ContactSubscription {
export interface IManageContacts<TProperties = Common.TUnknownRec> {
export interface ManageContacts<Properties = Common.UnknownRec> {
Email: string;
Action: BulkContactManagement.ManageContactsAction;
Name: string;
Properties: TProperties;
Properties: Properties;
}
export interface IListRecipient {
export interface ListRecipient {
ID: number;

@@ -260,3 +261,3 @@ IsUnsubscribed: boolean;

}
export interface IContactsList {
export interface ContactsList {
ListID: number;

@@ -266,3 +267,3 @@ IsUnsub: boolean;

}
export interface IContactsListSignup {
export interface ContactsListSignup {
ID: number;

@@ -280,12 +281,12 @@ ConfirmAt: number;

}
export interface IPostContactManageContactsListsBody {
ContactsLists: BulkContactManagement.IContactList[];
}
export interface IPostContactsListManageContactBody<TProperties = Common.TUnknownRec> {
export type PostContactManageContactsListsBody = {
ContactsLists: BulkContactManagement.ContactList[];
};
export type PostContactsListManageContactBody<Properties = Common.UnknownRec> = {
Email: string;
Action: BulkContactManagement.ManageContactsAction;
Name?: string;
Properties?: TProperties;
}
export interface IPostListRecipientBody {
Properties?: Properties;
};
export type PostListRecipientBody = {
IsUnsubscribed?: boolean;

@@ -296,7 +297,7 @@ ContactID: number;

ListAlt?: string;
}
export interface IPutListRecipientBody {
};
export type PutListRecipientBody = {
IsUnsubscribed?: boolean;
}
export interface IGetListRecipientQueryParams extends Partial<Common.IPagination> {
};
export type GetListRecipientQueryParams = Partial<Common.Pagination> & {
Blocked?: boolean;

@@ -312,4 +313,4 @@ Contact?: number;

Unsub?: boolean;
}
export interface IGetContactsListSignupQueryParams extends Partial<Common.IPagination> {
};
export type GetContactsListSignupQueryParams = Partial<Common.Pagination> & {
Contact?: number;

@@ -327,21 +328,21 @@ ContactsList?: number;

SourceID?: number;
}
type TListRecipientResponse = Common.IResponse<IListRecipient[]>;
export type TPostContactManageContactsListsResponse = Common.IResponse<Array<{
ContactsLists: BulkContactManagement.IContactList[];
};
type ListRecipientResponse = Common.Response<ListRecipient[]>;
export type PostContactManageContactsListsResponse = Common.Response<Array<{
ContactsLists: BulkContactManagement.ContactList[];
}>>;
export type TPostContactsListManageContactResponse<TProperties = Common.TUnknownRec> = Common.IResponse<Array<IManageContacts<TProperties>>>;
export type TPostListRecipientResponse = TListRecipientResponse;
export type TPutListRecipientResponse = TListRecipientResponse;
export type TGetListRecipientResponse = TListRecipientResponse;
export type TGetContactGetContactsListsResponse = Common.IResponse<IContactsList[]>;
export type TGetContactsListSignupResponse = Common.IResponse<IContactsListSignup[]>;
export type PostContactsListManageContactResponse<Properties = Common.UnknownRec> = Common.Response<Array<ManageContacts<Properties>>>;
export type PostListRecipientResponse = ListRecipientResponse;
export type PutListRecipientResponse = ListRecipientResponse;
export type GetListRecipientResponse = ListRecipientResponse;
export type GetContactGetContactsListsResponse = Common.Response<ContactsList[]>;
export type GetContactsListSignupResponse = Common.Response<ContactsListSignup[]>;
export {};
}
export declare namespace ContactVerification {
interface IVerificationSummary<TResult = Common.TUnknownRec, TRisk = Common.TUnknownRec> {
result: TResult;
risk: TRisk;
interface VerificationSummary<Result = Common.UnknownRec, Risk = Common.UnknownRec> {
result: Result;
risk: Risk;
}
interface IContactsListVerification<TResult = Common.TUnknownRec, TRisk = Common.TUnknownRec> {
interface ContactsListVerification<Result = Common.UnknownRec, Risk = Common.UnknownRec> {
Akid: number;

@@ -357,5 +358,5 @@ ContactListID: number;

Status: string;
Summary: IVerificationSummary<TResult, TRisk>;
Summary: VerificationSummary<Result, Risk>;
}
type TGetContactsListVerifyResponse<TResult = Common.TUnknownRec, TRisk = Common.TUnknownRec> = Common.IResponse<Array<IContactsListVerification<TResult, TRisk>>>;
type GetContactsListVerifyResponse<Result = Common.UnknownRec, Risk = Common.UnknownRec> = Common.Response<Array<ContactsListVerification<Result, Risk>>>;
}

@@ -1,2 +0,2 @@

export { ILibraryResponse, ILibraryLocalResponse } from './LibraryResponse';
export { LibraryResponse, LibraryLocalResponse } from './LibraryResponse';
export { Common } from './Common';

@@ -3,0 +3,0 @@ export { SendEmailV3, SendEmailV3_1, } from './SendEmail';

import { AxiosResponse } from 'axios';
export interface ILibraryResponse<TBody> {
response: AxiosResponse<TBody>;
body: TBody;
export interface LibraryResponse<Body> {
response: AxiosResponse<Body>;
body: Body;
}
export interface ILibraryLocalResponse<TData, TParams> {
body: TData;
params: TParams;
export interface LibraryLocalResponse<Data, Params> {
body: Data;
params: Params;
url: string;
}

@@ -1,2 +0,2 @@

import { Common } from "./Common";
import { Common } from '@mailjet/types/api/Common';
export declare namespace Message {

@@ -68,3 +68,3 @@ enum MessageState {

}
interface IMessageTracked {
interface MessageTracked {
IsClickTracked: boolean;

@@ -76,3 +76,3 @@ IsHTMLPartIncluded: boolean;

}
interface IMessage extends IMessageTracked {
interface Message extends MessageTracked {
ID: number;

@@ -98,3 +98,3 @@ ArrivedAt: string;

}
interface IMessageHistory {
interface MessageHistory {
Comment: string;

@@ -107,3 +107,3 @@ EventAt: number;

}
interface IMessageInformation<TRules = Common.TUnknownRec> {
interface MessageInformation<Rules = Common.UnknownRec> {
ID: number;

@@ -119,6 +119,6 @@ CampaignID: number;

SentCount: number;
SpamAssassinRules: TRules;
SpamAssassinRules: Rules;
SpamAssassinScore: number;
}
interface IGetMessageQueryParams extends Partial<Common.ITimestampPeriod>, Partial<Common.IPagination> {
type GetMessageQueryParams = Partial<Common.TimestampPeriod> & Partial<Common.Pagination> & {
Campaign?: number;

@@ -136,4 +136,4 @@ Contact?: number;

ShowSubject?: boolean;
}
interface IGetMessageInformationQueryParams extends Partial<Common.ITimestampPeriod>, Partial<Common.IPagination> {
};
type GetMessageInformationQueryParams = Partial<Common.TimestampPeriod> & Partial<Common.Pagination> & {
CampaignID?: number;

@@ -151,6 +151,6 @@ ContactsList?: number;

Period?: Common.Period;
}
type TGetMessagesResponse = Common.IResponse<IMessage[]>;
type TGetMessageHistoryResponse = Common.IResponse<IMessageHistory[]>;
type TGetMessageInformationResponse<TRules = Common.TUnknownRec> = Common.IResponse<Array<IMessageInformation<TRules>>>;
};
type GetMessagesResponse = Common.Response<Message[]>;
type GetMessageHistoryResponse = Common.Response<MessageHistory[]>;
type GetMessageInformationResponse<Rules = Common.UnknownRec> = Common.Response<Array<MessageInformation<Rules>>>;
}

@@ -1,5 +0,5 @@

import { Message } from "./Message";
import { Common } from "./Common";
import { Message } from '@mailjet/types/api/Message';
import { Common } from '@mailjet/types/api/Common';
export declare namespace MessageEvent {
interface IBounceStatistic {
interface BounceStatistic {
ID: number;

@@ -13,3 +13,3 @@ BouncedAt: string;

}
interface IClickStatistic {
interface ClickStatistic {
ID: number;

@@ -23,3 +23,3 @@ ClickedAt: string;

}
interface IOpenInformation {
interface OpenInformation {
ArrivedAt: string;

@@ -33,3 +33,3 @@ CampaignID: number;

}
interface IGetBounceStatisticsQueryParams extends Partial<Common.ITimestampPeriod>, Partial<Common.IPagination> {
type GetBounceStatisticsQueryParams = Partial<Common.TimestampPeriod> & Partial<Common.Pagination> & {
CampaignID?: number;

@@ -40,4 +40,4 @@ ContactsList?: number;

Period?: Common.Period;
}
interface IGetClickStatisticsQueryParams extends Partial<Common.ITimestampPeriod>, Partial<Common.IPagination> {
};
type GetClickStatisticsQueryParams = Partial<Common.TimestampPeriod> & Partial<Common.Pagination> & {
CampaignID?: number;

@@ -57,4 +57,4 @@ ContactsList?: number;

Period?: Common.Period;
}
interface IGetOpenInformationQueryParams extends Partial<Common.ITimestampPeriod>, Partial<Common.IPagination> {
};
type GetOpenInformationQueryParams = Partial<Common.TimestampPeriod> & Partial<Common.Pagination> & {
CampaignID?: number;

@@ -72,6 +72,6 @@ ContactsList?: number;

Period?: Common.Period;
}
type TGetBounceStatisticsResponse = Common.IResponse<IBounceStatistic[]>;
type TGetClickStatisticsResponse = Common.IResponse<IClickStatistic[]>;
type TGetOpenInformationResponse = Common.IResponse<IOpenInformation[]>;
};
type GetBounceStatisticsResponse = Common.Response<BounceStatistic[]>;
type GetClickStatisticsResponse = Common.Response<ClickStatistic[]>;
type GetOpenInformationResponse = Common.Response<OpenInformation[]>;
}

@@ -1,4 +0,4 @@

import { Common } from "./Common";
import { Common } from '@mailjet/types/api/Common';
export declare namespace Parse {
export interface IParseRoute {
export interface ParseRoute {
ID: number;

@@ -9,16 +9,14 @@ APIKeyID: number;

}
export interface IPostParseRouteBody {
export type PostParseRouteBody = {
Url: string;
APIKeyID?: number;
Email?: string;
}
export interface IPutParseRouteBody extends Partial<IPostParseRouteBody> {
}
export interface IGetParseRouteQueryParams extends Partial<Common.IPagination> {
}
type TParseRouteResponse = Common.IResponse<IParseRoute[]>;
export type TPostParseRouteResponse = TParseRouteResponse;
export type TPutParseRouteResponse = TParseRouteResponse;
export type TGetParseRouteResponse = TParseRouteResponse;
};
export type PutParseRouteBody = Partial<PostParseRouteBody>;
export type GetParseRouteQueryParams = Partial<Common.Pagination>;
type ParseRouteResponse = Common.Response<ParseRoute[]>;
export type PostParseRouteResponse = ParseRouteResponse;
export type PutParseRouteResponse = ParseRouteResponse;
export type GetParseRouteResponse = ParseRouteResponse;
export {};
}

@@ -1,2 +0,2 @@

import { Common } from "./Common";
import { Common } from '@mailjet/types/api/Common';
export declare namespace Segmentation {

@@ -8,3 +8,3 @@ export enum SegmentStatus {

}
export interface IContactFilter {
export interface ContactFilter {
ID: number;

@@ -16,19 +16,19 @@ Description: string;

}
export interface IPostContactFilterBody {
export type PostContactFilterBody = {
Name: string;
Expression: string;
Description?: string;
}
export interface IPutContactFilterBody extends Partial<IPostContactFilterBody> {
};
export type PutContactFilterBody = Partial<PostContactFilterBody> & {
Status?: SegmentStatus;
}
export interface IGetContactFilterQueryParams extends Partial<Common.IPagination> {
};
export type GetContactFilterQueryParams = Partial<Common.Pagination> & {
ShowDeleted?: boolean;
Status?: SegmentStatus;
}
type TContactFilterResponse = Common.IResponse<IContactFilter[]>;
export type TPostContactFilterResponse = TContactFilterResponse;
export type TPutContactFilterResponse = TContactFilterResponse;
export type TGetContactFilterResponse = TContactFilterResponse;
};
type ContactFilterResponse = Common.Response<ContactFilter[]>;
export type PostContactFilterResponse = ContactFilterResponse;
export type PutContactFilterResponse = ContactFilterResponse;
export type GetContactFilterResponse = ContactFilterResponse;
export {};
}

@@ -1,7 +0,7 @@

import { Common } from "./Common";
import { Common } from '@mailjet/types/api/Common';
export declare namespace SendEmailV3 {
type TMjTemplateErrorDeliver = '0' | 'deliver';
type TMjDeduplicateCampaign = 0 | 1;
type TMjTrackOpen = 0 | 1 | 2;
interface IRecipient {
type MjTemplateErrorDeliver = '0' | 'deliver';
type MjDeduplicateCampaign = 0 | 1;
type MjTrackOpen = 0 | 1 | 2;
interface Recipient {
Email: string;

@@ -11,3 +11,3 @@ Name?: string;

}
interface IAttachment {
interface Attachment {
Filename: string;

@@ -17,18 +17,18 @@ Content: string;

}
interface IBodyMj {
type BodyMj = {
'Mj-TemplateID'?: number;
'Mj-TemplateLanguage'?: boolean;
'Mj-TemplateErrorReporting'?: string;
'Mj-TemplateErrorDeliver'?: TMjTemplateErrorDeliver;
'Mj-TemplateErrorDeliver'?: MjTemplateErrorDeliver;
'Mj-prio'?: number;
'Mj-campaign'?: string;
'Mj-deduplicatecampaign'?: TMjDeduplicateCampaign;
'Mj-trackopen'?: TMjTrackOpen;
'Mj-deduplicatecampaign'?: MjDeduplicateCampaign;
'Mj-trackopen'?: MjTrackOpen;
'Mj-CustomID'?: string;
'Mj-EventPayload'?: string;
}
interface IBody<THeaders = Common.TUnknownRec, TVars = Common.TUnknownRec> extends IBodyMj {
};
type Body<Headers = Common.UnknownRec, Vars = Common.UnknownRec> = BodyMj & {
FromEmail?: string;
FromName?: string;
Recipients?: IRecipient[];
Recipients?: Recipient[];
Sender?: boolean;

@@ -41,8 +41,8 @@ Subject?: string;

Bcc?: string;
Attachments?: IAttachment[];
Inline_attachments?: IAttachment[];
Headers?: THeaders;
Vars?: TVars;
}
interface IResponseSent {
Attachments?: Attachment[];
Inline_attachments?: Attachment[];
Headers?: Headers;
Vars?: Vars;
};
interface ResponseSent {
Email: string;

@@ -52,5 +52,5 @@ MessageID: number;

}
interface IResponse {
Sent: IResponseSent[];
}
type Response = {
Sent: ResponseSent[];
};
}

@@ -68,7 +68,7 @@ export declare namespace SendEmailV3_1 {

}
interface IEmailAddressTo {
interface EmailAddressTo {
Email: string;
Name?: string;
}
interface IAttachment {
interface Attachment {
Filename: string;

@@ -78,12 +78,12 @@ ContentType: string;

}
interface IInlinedAttachment extends IAttachment {
interface InlinedAttachment extends Attachment {
ContentID?: string;
}
interface IMessage<THeaders = Common.TUnknownRec, TVariables = Common.TUnknownRec> {
From: IEmailAddressTo;
Sender?: IEmailAddressTo;
To: IEmailAddressTo[];
Cc?: IEmailAddressTo[];
Bcc?: IEmailAddressTo[];
ReplyTo?: IEmailAddressTo;
interface Message<Headers = Common.UnknownRec, Variables = Common.UnknownRec> {
From: EmailAddressTo;
Sender?: EmailAddressTo;
To: EmailAddressTo[];
Cc?: EmailAddressTo[];
Bcc?: EmailAddressTo[];
ReplyTo?: EmailAddressTo;
Subject?: string;

@@ -94,6 +94,6 @@ TextPart?: string;

TemplateLanguage?: boolean;
TemplateErrorReporting?: IEmailAddressTo;
TemplateErrorReporting?: EmailAddressTo;
TemplateErrorDeliver?: boolean;
Attachments?: IAttachment[];
InlinedAttachments?: IInlinedAttachment[];
Attachments?: Attachment[];
InlinedAttachments?: InlinedAttachment[];
Priority?: number;

@@ -107,4 +107,4 @@ CustomCampaign?: string;

URLTags?: string;
Headers?: THeaders;
Variables?: TVariables;
Headers?: Headers;
Variables?: Variables;
}

@@ -115,3 +115,3 @@ enum ResponseStatus {

}
interface IResponseError {
interface ResponseError {
ErrorIdentifier: string;

@@ -123,3 +123,3 @@ ErrorCode: string;

}
interface IResponseEmailAddressTo {
interface ResponseEmailAddressTo {
Email: string;

@@ -130,19 +130,19 @@ MessageUUID: string;

}
interface IBody<THeaders = Common.TUnknownRec, TVariables = Common.TUnknownRec, TGlobals = Common.TUnknownRec> {
Messages: Array<IMessage<THeaders, TVariables>>;
type Body<Headers = Common.UnknownRec, Variables = Common.UnknownRec, Globals = Common.UnknownRec> = {
Messages: Array<Message<Headers, Variables>>;
SandboxMode?: boolean;
AdvanceErrorHandling?: boolean;
Globals?: TGlobals;
}
interface IResponseMessage {
Globals?: Globals;
};
interface ResponseMessage {
Status: ResponseStatus;
Errors: IResponseError[];
Errors: ResponseError[];
CustomID: string;
To: IResponseEmailAddressTo[];
Cc: IResponseEmailAddressTo[];
Bcc: IResponseEmailAddressTo[];
To: ResponseEmailAddressTo[];
Cc: ResponseEmailAddressTo[];
Bcc: ResponseEmailAddressTo[];
}
interface IResponse {
Messages: IResponseMessage[];
}
type Response = {
Messages: ResponseMessage[];
};
}

@@ -1,2 +0,2 @@

import { Common } from "./Common";
import { Common } from '@mailjet/types/api/Common';
export declare namespace Sender {

@@ -13,3 +13,3 @@ export enum EmailType {

}
export interface ISender {
export interface Sender {
ID: number;

@@ -25,3 +25,3 @@ EmailType: EmailType;

}
export interface ISenderValidate {
export interface SenderValidate {
ValidationMethod: string;

@@ -31,3 +31,3 @@ Errors: string;

}
export interface IPostSenderBody {
export type PostSenderBody = {
Email: string;

@@ -37,6 +37,5 @@ EmailType?: EmailType;

Name?: string;
}
export interface IPutSenderBody extends Omit<IPostSenderBody, 'Email'> {
}
export interface IGetSenderQueryParams extends Partial<Common.IPagination> {
};
export type PutSenderBody = Omit<PostSenderBody, 'Email'>;
export type GetSenderQueryParams = Partial<Common.Pagination> & {
DnsID?: number;

@@ -49,12 +48,12 @@ Domain?: string;

Status?: SenderStatus;
}
type TSenderResponse = Common.IResponse<ISender[]>;
export type TPostSenderResponse = TSenderResponse;
export type TPutSenderResponse = TSenderResponse;
export type TGetSenderResponse = TSenderResponse;
export type TPostSenderValidateResponse = Common.IResponse<ISenderValidate[]>;
};
type SenderResponse = Common.Response<Sender[]>;
export type PostSenderResponse = SenderResponse;
export type PutSenderResponse = SenderResponse;
export type GetSenderResponse = SenderResponse;
export type PostSenderValidateResponse = Common.Response<SenderValidate[]>;
export {};
}
export declare namespace Metasender {
export interface IMetaSender {
export interface MetaSender {
ID: number;

@@ -67,15 +66,14 @@ Description: string;

}
export interface IPostMetaSenderBody {
export type PostMetaSenderBody = {
Email: string;
Description?: string;
}
export interface IPutMetaSenderBody extends Omit<IPostMetaSenderBody, 'Email'> {
}
export interface IGetMetaSenderQueryParams extends Partial<Common.IPagination> {
};
export type PutMetaSenderBody = Omit<PostMetaSenderBody, 'Email'>;
export type GetMetaSenderQueryParams = Partial<Common.Pagination> & {
DNS?: number;
}
type TMetaSenderResponse = Common.IResponse<IMetaSender[]>;
export type TPostMetaSenderResponse = TMetaSenderResponse;
export type TPutMetaSenderResponse = TMetaSenderResponse;
export type TGetMetaSenderResponse = TMetaSenderResponse;
};
type MetaSenderResponse = Common.Response<MetaSender[]>;
export type PostMetaSenderResponse = MetaSenderResponse;
export type PutMetaSenderResponse = MetaSenderResponse;
export type GetMetaSenderResponse = MetaSenderResponse;
export {};

@@ -103,3 +101,3 @@ }

}
interface IDNS {
interface DNS {
ID: number;

@@ -117,3 +115,3 @@ DKIMRecordName: string;

}
interface IDNSCheck {
interface DNSCheck {
DKIMErrors: string;

@@ -126,3 +124,3 @@ DKIMRecordCurrentValue: string;

}
interface IGetDNSQueryParams extends Partial<Common.IPagination> {
type GetDNSQueryParams = Partial<Common.Pagination> & {
IsCheckInProgress?: boolean;

@@ -134,5 +132,5 @@ IsSenderIdentified?: boolean;

SPFStatus?: SPFConfigurationCheckStatus;
}
type TGetDNSResponse = Common.IResponse<IDNS[]>;
type TPostDNSCheckResponse = Common.IResponse<IDNSCheck[]>;
};
type GetDNSResponse = Common.Response<DNS[]>;
type PostDNSCheckResponse = Common.Response<DNSCheck[]>;
}
export declare namespace SendMessage {
interface ICost {
interface Cost {
Value: number;
Currency: string;
}
interface ISendStatus {
interface SendStatus {
Code: number;

@@ -11,6 +11,11 @@ Name: string;

}
interface ISMS {
type Body = {
From: string;
To: string;
Text: string;
};
type Response = {
From: string;
To: string;
Text: string;
MessageID: string | number;

@@ -20,11 +25,5 @@ SMSCount: number;

SentTS: number;
Cost: ICost;
Status: ISendStatus;
}
interface IBody {
From: string;
To: string;
Text: string;
}
type TResponse = ISMS;
Cost: Cost;
Status: SendStatus;
};
}

@@ -1,2 +0,2 @@

import { Common } from "./Common";
import { Common } from '@mailjet/types/api/Common';
export declare namespace APIKeyConfiguration {

@@ -8,3 +8,3 @@ export enum RunLevel {

}
export interface IApiKey {
export interface ApiKey {
ID: number;

@@ -23,10 +23,9 @@ ACL: string;

}
export interface IPostApiKeyBody {
export type PostApiKeyBody = {
Name: string;
ACL?: string;
IsActive?: boolean;
}
export interface IPutApiKeyBody extends Partial<IPostApiKeyBody> {
}
export interface IGetApiKeyQueryParams extends Partial<Common.IPagination> {
};
export type PutApiKeyBody = Partial<PostApiKeyBody>;
export type GetApiKeyQueryParams = Partial<Common.Pagination> & {
APIKey?: string;

@@ -36,11 +35,11 @@ IsActive?: boolean;

Name?: string;
}
type TApiKeyResponse = Common.IResponse<IApiKey[]>;
export type TPostApiKeyResponse = TApiKeyResponse;
export type TPutApiKeyResponse = TApiKeyResponse;
export type TGetApiKeyResponse = TApiKeyResponse;
};
type ApiKeyResponse = Common.Response<ApiKey[]>;
export type PostApiKeyResponse = ApiKeyResponse;
export type PutApiKeyResponse = ApiKeyResponse;
export type GetApiKeyResponse = ApiKeyResponse;
export {};
}
export declare namespace AccountSetting {
export interface IMyProfile {
export interface MyProfile {
ID: number;

@@ -68,3 +67,3 @@ AddressCity: string;

}
export interface IUser {
export interface User {
ID: number;

@@ -83,13 +82,11 @@ ACL: string;

}
export interface IPutMyProfileBody extends Partial<Omit<IMyProfile, 'ID' | 'VAT' | 'UserID'>> {
}
export interface IPutUserBody extends Partial<Omit<IUser, 'ID' | 'CreatedAt' | 'FirstIp' | 'MaxAllowedAPIKeys' | 'WarnedRatelimitAt'>> {
}
type TMyProfileResponse = Common.IResponse<IMyProfile[]>;
type TUserResponse = Common.IResponse<IUser[]>;
export type TPutMyProfileResponse = TMyProfileResponse;
export type TGetMyProfileResponse = TMyProfileResponse;
export type TPutUserResponse = TUserResponse;
export type TGetUserResponse = TUserResponse;
export type PutMyProfileBody = Partial<Omit<MyProfile, 'ID' | 'VAT' | 'UserID'>>;
export type PutUserBody = Partial<Omit<User, 'ID' | 'CreatedAt' | 'FirstIp' | 'MaxAllowedAPIKeys' | 'WarnedRatelimitAt'>>;
type MyProfileResponse = Common.Response<MyProfile[]>;
type UserResponse = Common.Response<User[]>;
export type PutMyProfileResponse = MyProfileResponse;
export type GetMyProfileResponse = MyProfileResponse;
export type PutUserResponse = UserResponse;
export type GetUserResponse = UserResponse;
export {};
}

@@ -1,32 +0,39 @@

import { SendMessage } from "./SendMessage";
import { Common } from "./Common";
import { SendMessage } from '@mailjet/types/api/SendMessage';
import { Common } from '@mailjet/types/api/Common';
export declare namespace SMSMessage {
interface ISMS extends Omit<SendMessage.ISMS, 'Text'> {
}
interface ISMSExport {
type SMS = {
From: string;
To: string;
MessageID: string | number;
SMSCount: number;
CreationTS: number;
SentTS: number;
Cost: SendMessage.Cost;
Status: SendMessage.SendStatus;
};
type SMSExport = {
ID: number;
URL: string;
Status: SendMessage.ISendStatus;
Status: SendMessage.SendStatus;
CreationTS: number;
ExpirationTS: number;
}
interface IPostSMSExportBody extends Common.ITimestampPeriod {
}
interface IGetSMSQueryParams extends Partial<Common.ITimestampPeriod>, Partial<Pick<Common.IPagination, 'Limit' | 'Offset'>> {
};
type PostSMSExportBody = Common.TimestampPeriod;
type GetSMSQueryParams = Partial<Common.TimestampPeriod> & Partial<Pick<Common.Pagination, 'Limit' | 'Offset'>> & {
StatusCode?: Array<string>;
To?: string;
IDs?: string;
}
interface IGetSMSCountQueryParams extends Partial<Common.ITimestampPeriod> {
};
type GetSMSCountQueryParams = Partial<Common.TimestampPeriod> & {
StatusCode?: Array<string>;
To?: string;
}
type TPostSMSExportResponse = ISMSExport;
type TGetSMSExportResponse = ISMSExport;
type TGetSMSResponse = {
Data: ISMS[];
};
type TGetSMSCountResponse = {
type PostSMSExportResponse = SMSExport;
type GetSMSExportResponse = SMSExport;
type GetSMSResponse = {
Data: SMS[];
};
type GetSMSCountResponse = {
Count: number;
};
}

@@ -1,5 +0,5 @@

import { Common } from "./Common";
import { Message } from "./Message";
import { Common } from '@mailjet/types/api/Common';
import { Message } from '@mailjet/types/api/Message';
export declare namespace Statistic {
enum CampaignOverViewIDType {
enum CampaignOverviewIDType {
SentCampaign = "Campaign",

@@ -9,3 +9,3 @@ ABTesting = "AX",

}
enum CampaignOverViewEditMode {
enum CampaignOverviewEditMode {
Tool = "tool",

@@ -17,3 +17,3 @@ HTML = "html",

}
enum CampaignOverViewEditType {
enum CampaignOverviewEditType {
Full = "full",

@@ -42,9 +42,9 @@ Unknown = "unknown"

}
interface ICampaignOverView {
interface CampaignOverview {
ClickedCount: number;
DeliveredCount: number;
EditMode: CampaignOverViewEditMode;
EditType: CampaignOverViewEditType;
EditMode: CampaignOverviewEditMode;
EditType: CampaignOverviewEditType;
ID: number;
IDType: CampaignOverViewIDType;
IDType: CampaignOverviewIDType;
OpenedCount: number;

@@ -57,3 +57,3 @@ ProcessedCount: number;

}
interface IContactStatistic {
interface ContactStatistic {
BlockedCount: number;

@@ -77,3 +77,3 @@ BouncedCount: number;

}
interface IGEOStatistic {
interface GEOStatistic {
ClickedCount: number;

@@ -83,7 +83,7 @@ OpenedCount: number;

}
interface IListRecipientStatistic<TData = Array<unknown>> {
interface ListRecipientStatistic<Data = Array<unknown>> {
BlockedCount: number;
BouncedCount: number;
ClickedCount: number;
Data: TData;
Data: Data;
DeferredCount: number;

@@ -103,3 +103,3 @@ DeliveredCount: number;

}
interface IStatCounter {
interface StatCounter {
APIKeyID: number;

@@ -128,3 +128,3 @@ EventClickDelay: number;

}
interface ILinkClickStatistic {
interface LinkClickStatistic {
ClickedEventsCount: number;

@@ -135,3 +135,3 @@ ClickedMessagesCount: number;

}
interface IRecipientESPStatistic {
interface RecipientESPStatistic {
AttemptedMessagesCount?: number;

@@ -155,3 +155,3 @@ ClickedMessagesCount?: number;

}
interface ITopLinkClicked {
interface TopLinkClicked {
ClickedCount: number;

@@ -161,3 +161,3 @@ LinkId: number;

}
interface IUserAgentStatistic {
interface UserAgentStatistic {
Count: number;

@@ -168,3 +168,3 @@ DistinctCount: number;

}
interface IGetCampaignOverViewQueryParams extends Partial<Common.IPagination> {
type GetCampaignOverviewQueryParams = Partial<Common.Pagination> & {
All?: boolean;

@@ -174,3 +174,3 @@ Archived?: boolean;

ID?: number;
IDType?: CampaignOverViewIDType;
IDType?: CampaignOverviewIDType;
Programmed?: boolean;

@@ -180,4 +180,4 @@ Sent?: boolean;

Subject?: string;
}
interface IGetContactStatisticsQueryParams extends Partial<Common.IPagination> {
};
type GetContactStatisticsQueryParams = Partial<Common.Pagination> & {
Blocked?: boolean;

@@ -197,4 +197,4 @@ Bounced?: boolean;

Unsubscribed?: boolean;
}
interface IGetGEOStatisticsQueryParams extends Partial<Common.ITimestampPeriod>, Partial<Common.IPagination> {
};
type GetGEOStatisticsQueryParams = Partial<Common.TimestampPeriod> & Partial<Common.Pagination> & {
CampaignID?: number;

@@ -212,4 +212,4 @@ ContactsList?: number;

Period?: Common.Period;
}
interface IGetListRecipientStatisticsQueryParams extends Partial<Common.IPagination> {
};
type GetListRecipientStatisticsQueryParams = Partial<Common.Pagination> & {
Blocked?: boolean;

@@ -234,4 +234,4 @@ Bounced?: boolean;

Unsubscribed?: boolean;
}
interface IGetStatCountersQueryParams extends Partial<Common.ITimestampPeriod>, Partial<Common.IPagination> {
};
type GetStatCountersQueryParams = Partial<Common.TimestampPeriod> & Partial<Common.Pagination> & {
CounterSource: CounterSource;

@@ -241,10 +241,10 @@ CounterResolution: CounterResolution;

SourceID?: number;
}
interface IGetLinkClickStatisticsQueryParams extends Partial<Common.IPagination> {
};
type GetLinkClickStatisticsQueryParams = Partial<Common.Pagination> & {
CampaignID: number;
}
interface IGetRecipientESPStatisticsQueryParams extends IGetLinkClickStatisticsQueryParams {
};
type GetRecipientESPStatisticsQueryParams = GetLinkClickStatisticsQueryParams & {
ESP_Name?: number;
}
interface IGetTopLinkClickedQueryParams extends Partial<Common.ITimestampPeriod>, Partial<Common.IPagination> {
};
type GetTopLinkClickedQueryParams = Partial<Common.TimestampPeriod> & Partial<Common.Pagination> & {
ActualClicks?: boolean;

@@ -264,4 +264,4 @@ CampaignID?: number;

Period?: Common.Period;
}
interface IGetUserAgentStatisticsQueryParams extends Partial<Common.ITimestampPeriod>, Partial<Common.IPagination> {
};
type GetUserAgentStatisticsQueryParams = Partial<Common.TimestampPeriod> & Partial<Common.Pagination> & {
CampaignID?: number;

@@ -281,12 +281,12 @@ ContactsList?: number;

Platform?: string;
}
type TGetCampaignOverViewResponse = Common.IResponse<ICampaignOverView[]>;
type TGetContactStatisticsResponse = Common.IResponse<IContactStatistic[]>;
type TGetGEOStatisticsResponse = Common.IResponse<IGEOStatistic[]>;
type TGetListRecipientStatisticsResponse<TData = Array<unknown>> = Common.IResponse<Array<IListRecipientStatistic<TData>>>;
type TGetStatCountersResponse = Common.IResponse<IStatCounter[]>;
type TGetLinkClickStatisticsResponse = Common.IResponse<ILinkClickStatistic[]>;
type TGetRecipientESPStatisticsResponse = Common.IResponse<IRecipientESPStatistic[]>;
type TGetTopLinkClickedResponse = Common.IResponse<ITopLinkClicked[]>;
type TGetUserAgentStatisticsResponse = Common.IResponse<IUserAgentStatistic[]>;
};
type GetCampaignOverviewResponse = Common.Response<CampaignOverview[]>;
type GetContactStatisticsResponse = Common.Response<ContactStatistic[]>;
type GetGEOStatisticsResponse = Common.Response<GEOStatistic[]>;
type GetListRecipientStatisticsResponse<Data = Array<unknown>> = Common.Response<Array<ListRecipientStatistic<Data>>>;
type GetStatCountersResponse = Common.Response<StatCounter[]>;
type GetLinkClickStatisticsResponse = Common.Response<LinkClickStatistic[]>;
type GetRecipientESPStatisticsResponse = Common.Response<RecipientESPStatistic[]>;
type GetTopLinkClickedResponse = Common.Response<TopLinkClicked[]>;
type GetUserAgentStatisticsResponse = Common.Response<UserAgentStatistic[]>;
}

@@ -1,2 +0,2 @@

import { Common } from "./Common";
import { Common } from '@mailjet/types/api/Common';
export declare namespace Template {

@@ -45,3 +45,3 @@ export enum Categories {

}
export interface IHeaders {
export interface Headers {
From: string;

@@ -51,3 +51,3 @@ Subject: string;

}
export interface ITemplate {
export interface Template {
Author: string;

@@ -71,14 +71,13 @@ Categories: Categories;

}
export interface ITemplateDetailContent {
Headers: IHeaders;
export type TemplateDetailContent = {
Headers: Headers;
'Html-part': string;
'Text-part': string;
MJMLContent: string;
}
export interface IPostTemplateBody extends Partial<Omit<ITemplate, 'Name' | 'ID' | 'OwnerId' | 'Previews' | 'CreatedAt' | 'LastUpdatedAt'>> {
};
export type PostTemplateBody = Partial<Omit<Template, 'Name' | 'ID' | 'OwnerId' | 'Previews' | 'CreatedAt' | 'LastUpdatedAt'>> & {
Name: string;
}
export interface IPutTemplateBody extends Partial<IPostTemplateBody> {
}
export interface IGetTemplateQueryParams extends Partial<Common.IPagination> {
};
export type PutTemplateBody = Partial<PostTemplateBody>;
export type GetTemplateQueryParams = Partial<Common.Pagination> & {
Categories?: string;

@@ -91,17 +90,16 @@ CategoriesSelectionMethod?: CategoriesSelectionMethod;

PurposesSelectionMethod?: PurposesSelectionMethod;
}
export interface IPostTemplateDetailContentBody extends Partial<Omit<ITemplateDetailContent, 'Headers'>> {
Headers?: Partial<IHeaders>;
}
export interface IPutTemplateDetailContentBody extends IPostTemplateDetailContentBody {
}
type TTemplateResponse = Common.IResponse<ITemplate[]>;
type TTemplateDetailContentResponse = Common.IResponse<ITemplateDetailContent[]>;
export type TPostTemplateResponse = TTemplateResponse;
export type TPutTemplateResponse = TTemplateResponse;
export type TGetTemplateResponse = TTemplateResponse;
export type TPostTemplateDetailContentResponse = TTemplateDetailContentResponse;
export type TPutTemplateDetailContentResponse = TTemplateDetailContentResponse;
export type TGetTemplateDetailContentResponse = TTemplateDetailContentResponse;
};
export type PostTemplateDetailContentBody = Partial<Omit<TemplateDetailContent, 'Headers'>> & {
Headers?: Partial<Headers>;
};
export type PutTemplateDetailContentBody = PostTemplateDetailContentBody;
type TemplateResponse = Common.Response<Template[]>;
type TemplateDetailContentResponse = Common.Response<TemplateDetailContent[]>;
export type PostTemplateResponse = TemplateResponse;
export type PutTemplateResponse = TemplateResponse;
export type GetTemplateResponse = TemplateResponse;
export type PostTemplateDetailContentResponse = TemplateDetailContentResponse;
export type PutTemplateDetailContentResponse = TemplateDetailContentResponse;
export type GetTemplateDetailContentResponse = TemplateDetailContentResponse;
export {};
}

@@ -1,2 +0,2 @@

import { Common } from "./Common";
import { Common } from '@mailjet/types/api/Common';
export declare namespace Webhook {

@@ -25,4 +25,4 @@ export enum EventType {

}
export type TVersion = 1 | 2;
export interface IEventCallbackUrl {
export type Version = 1 | 2;
export interface EventCallbackUrl {
ID: number;

@@ -33,6 +33,6 @@ EventType: EventType;

APIKeyID: number;
Version: TVersion;
Version: Version;
Url: string;
}
export interface IPostEventCallbackUrlBody {
export type PostEventCallbackUrlBody = {
Url: string;

@@ -42,16 +42,19 @@ EventType?: EventType;

Status?: Status;
}
export interface IPutEventCallbackUrlBody extends Partial<IPostEventCallbackUrlBody> {
}
export interface IGetEventCallbackUrlQueryParams extends Partial<Common.IPagination> {
};
export type PutEventCallbackUrlBody = Partial<PostEventCallbackUrlBody>;
export type GetEventCallbackUrlQueryParams = Partial<Common.Pagination> & {
Backup?: boolean;
EventType?: EventTypeValue;
Status?: string;
Version?: TVersion;
}
type TEventCallbackUrlResponse = Common.IResponse<IEventCallbackUrl[]>;
export type TPostEventCallbackUrlResponse = TEventCallbackUrlResponse;
export type TPutEventCallbackUrlResponse = TEventCallbackUrlResponse;
export type TGetEventCallbackUrlResponse = TEventCallbackUrlResponse;
Version?: Version;
};
type EventCallbackUrlResponse = {
Count: number;
Total: number;
Data: EventCallbackUrl[];
};
export type PostEventCallbackUrlResponse = EventCallbackUrlResponse;
export type PutEventCallbackUrlResponse = EventCallbackUrlResponse;
export type GetEventCallbackUrlResponse = EventCallbackUrlResponse;
export {};
}

@@ -16,3 +16,3 @@ export declare namespace TFunction {

};
type TUnknownRec = Record<string, unknown>;
type UnknownRec = Record<string, unknown>;
}

@@ -19,0 +19,0 @@ export declare namespace TArray {

@@ -1,3 +0,3 @@

import { TObject } from "../types";
declare function setValueIfNotNil(targetObject: TObject.TUnknownRec, path: string, value: unknown): void;
import { TObject } from '@custom/types';
declare function setValueIfNotNil(targetObject: TObject.UnknownRec, path: string, value: unknown): void;
export default setValueIfNotNil;

@@ -15,2 +15,2 @@ /*!

/*! node-mailjet v5.1.1 */
/*! node-mailjet v6.0.0 */

@@ -1,1 +0,1 @@

/*! node-mailjet v5.1.1 */
/*! node-mailjet v6.0.0 */
{
"name": "node-mailjet",
"version": "5.1.1",
"version": "6.0.0",
"main": "./mailjet.node.js",

@@ -5,0 +5,0 @@ "browser": "./mailjet.web.js",

@@ -13,3 +13,3 @@ [mailjet]: http://www.mailjet.com

[![Build Status](https://travis-ci.org/mailjet/mailjet-apiv3-nodejs.svg?branch=master)](https://travis-ci.org/mailjet/mailjet-apiv3-nodejs)
![Current Version](https://img.shields.io/badge/version-5.1.1-green.svg)
![Current Version](https://img.shields.io/badge/version-6.0.0-green.svg)

@@ -51,2 +51,3 @@ ## Overview

- [Send Email example](#send-email-example)
- [Send Message example](#send-message-example)
- [Get Contact example](#get-contact-example)

@@ -494,3 +495,3 @@ - [Our external Typings](#our-external-typings)

(async () => {
const data: SendEmailV3_1.IBody = {
const data: SendEmailV3_1.Body = {
Messages: [

@@ -519,3 +520,3 @@ {

.post('send', { version: 'v3.1' })
.request<SendEmailV3_1.IResponse>(data);
.request<SendEmailV3_1.Response>(data);

@@ -540,3 +541,52 @@ const { Status } = result.body.Messages[0];

```
### Send Message Example
```typescript
import Mailjet, { SendMessage } from 'node-mailjet'
const mailjet = new Mailjet({
apiKey: process.env.MJ_APIKEY_PUBLIC,
apiSecret: process.env.MJ_APIKEY_PRIVATE
});
(async () => {
const body: SendMessage.Body = {
From: 'some@email.com',
To: 'some2@email.com',
Text: 'Test'
};
const result = await mailjet
.post('contact', { version: 'v3' })
.request<SendMessage.Response>(body);
const { Status } = result.body;
})();
```
And `response` will have this shape:
```typescript
{
response: Response;
body: {
From: string;
To: string;
Text: string;
MessageID: string | number;
SMSCount: number;
CreationTS: number;
SentTS: number;
Cost: {
Value: number;
Currency: string;
};
Status: {
Code: number;
Name: string;
Description: string;
};
}
}
```
### Get Contact Example

@@ -553,3 +603,3 @@

(async () => {
const queryData: Contact.IGetContactQueryParams = {
const queryData: Contact.GetContactQueryParams = {
IsExcludedFromCampaigns: false,

@@ -561,3 +611,3 @@ Campaign: 2234234,

.get('contact', { version: 'v3' })
.request<Contact.TGetContactResponse>({}, queryData);
.request<Contact.GetContactResponse>({}, queryData);

@@ -564,0 +614,0 @@ const ContactID = result.body.Data[0].ID;

@@ -1,1 +0,1 @@

5.1.1
6.0.0

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc