@mailerlite/mailerlite-nodejs
Advanced tools
Comparing version
import { AxiosResponse } from 'axios'; | ||
interface GroupsInterface { | ||
get: (params: GetGroupsParams) => Promise<AxiosResponse<ListAllGroupsResponse>>; | ||
create: (params: CreateUpdateGroupParams) => Promise<AxiosResponse<SingleGroupResponse, CreateUpdateGroupParams>>; | ||
update: (group_id: string, params: CreateUpdateGroupParams) => Promise<AxiosResponse<SingleGroupResponse, CreateUpdateGroupParams>>; | ||
delete: (group_id: string) => Promise<AxiosResponse<null>>; | ||
getSubscribers: (group_id: string, params: SubscriberParams) => Promise<AxiosResponse<ListAllSubscribersResponse>>; | ||
assignSubscriber: (subscriber_id: string, group_id: string) => Promise<AxiosResponse<SingleGroupResponse>>; | ||
unAssignSubscriber: (subscriber_id: string, group_id: string) => Promise<AxiosResponse<null>>; | ||
} | ||
interface GetGroupsParams { | ||
limit?: number; | ||
page?: number; | ||
filter?: { | ||
name?: string; | ||
}; | ||
sort: "name" | "total" | "open_rate" | "click_rate" | "created_at" | "-name" | "-total" | "-open_rate" | "-click_rate" | "-created_at"; | ||
} | ||
interface ListAllGroupsResponse { | ||
data: Array<GroupObject>; | ||
links: Links; | ||
meta: Meta; | ||
} | ||
interface ListAllSubscribersResponse { | ||
data: Array<SubscriberObject>; | ||
links: Links; | ||
meta: Meta; | ||
} | ||
interface SingleGroupResponse { | ||
data: GroupObject; | ||
} | ||
interface CreateUpdateGroupParams { | ||
name: string; | ||
} | ||
interface SubscriberParams { | ||
filter?: { | ||
/** | ||
* @default "active" | ||
*/ | ||
status: "active" | "unsubscribed" | "unconfirmed" | "bounced" | "junk"; | ||
}; | ||
limit?: number; | ||
page?: number; | ||
cursor?: string; | ||
} | ||
interface GroupObject { | ||
id: string; | ||
name: string; | ||
active_count: number; | ||
sent_count: number; | ||
opens_count: number; | ||
open_rate: { | ||
float: number; | ||
string: string; | ||
}; | ||
clicks_count: number; | ||
click_rate: { | ||
float: number; | ||
string: string; | ||
}; | ||
unsubscribed_count: number; | ||
unconfirmed_count: number; | ||
bounced_count: number; | ||
junk_count: number; | ||
created_at: string; | ||
} | ||
interface Config { | ||
@@ -88,3 +154,3 @@ basePath: string; | ||
}; | ||
groups: Array<string>; | ||
groups?: Array<GroupObject>; | ||
opted_in_at: string; | ||
@@ -115,2 +181,3 @@ optin_ip: string; | ||
cursor?: string; | ||
include?: "groups"; | ||
} | ||
@@ -199,3 +266,3 @@ interface CreateOrUpdateSubscriberParams { | ||
ab_settings?: { | ||
test_type?: "subject" | "sender"; | ||
test_type?: "subject" | "sender" | "sending_time"; | ||
select_winner_by?: "o" | "c"; | ||
@@ -220,3 +287,3 @@ after_time_amount?: number; | ||
interface ScheduleCampaignParams { | ||
delivery: "instant" | "scheduled" | "timezone_based"; | ||
delivery: "instant" | "scheduled" | "timezone_based" | "smart_sending"; | ||
schedule?: { | ||
@@ -382,67 +449,2 @@ date?: string; | ||
interface GroupsInterface { | ||
get: (params: GetGroupsParams) => Promise<AxiosResponse<ListAllGroupsResponse>>; | ||
create: (params: CreateUpdateGroupParams) => Promise<AxiosResponse<SingleGroupResponse, CreateUpdateGroupParams>>; | ||
update: (group_id: string, params: CreateUpdateGroupParams) => Promise<AxiosResponse<SingleGroupResponse, CreateUpdateGroupParams>>; | ||
delete: (group_id: string) => Promise<AxiosResponse<null>>; | ||
getSubscribers: (group_id: string, params: SubscriberParams) => Promise<AxiosResponse<ListAllSubscribersResponse>>; | ||
assignSubscriber: (subscriber_id: string, group_id: string) => Promise<AxiosResponse<SingleGroupResponse>>; | ||
unAssignSubscriber: (subscriber_id: string, group_id: string) => Promise<AxiosResponse<null>>; | ||
} | ||
interface GetGroupsParams { | ||
limit?: number; | ||
page?: number; | ||
filter?: { | ||
name?: string; | ||
}; | ||
sort: "name" | "total" | "open_rate" | "click_rate" | "created_at" | "-name" | "-total" | "-open_rate" | "-click_rate" | "-created_at"; | ||
} | ||
interface ListAllGroupsResponse { | ||
data: Array<GroupObject>; | ||
links: Links; | ||
meta: Meta; | ||
} | ||
interface ListAllSubscribersResponse { | ||
data: Array<SubscriberObject>; | ||
links: Links; | ||
meta: Meta; | ||
} | ||
interface SingleGroupResponse { | ||
data: GroupObject; | ||
} | ||
interface CreateUpdateGroupParams { | ||
name: string; | ||
} | ||
interface SubscriberParams { | ||
filter?: { | ||
/** | ||
* @default "active" | ||
*/ | ||
status: "active" | "unsubscribed" | "unconfirmed" | "bounced" | "junk"; | ||
}; | ||
limit: number; | ||
page: number; | ||
} | ||
interface GroupObject { | ||
id: string; | ||
name: string; | ||
active_count: number; | ||
sent_count: number; | ||
opens_count: number; | ||
open_rate: { | ||
float: number; | ||
string: string; | ||
}; | ||
clicks_count: number; | ||
click_rate: { | ||
float: number; | ||
string: string; | ||
}; | ||
unsubscribed_count: number; | ||
unconfirmed_count: number; | ||
bounced_count: number; | ||
junk_count: number; | ||
created_at: string; | ||
} | ||
interface SegmentsInterface { | ||
@@ -464,2 +466,3 @@ get: (params: GetSegmentsParams) => Promise<AxiosResponse<ListAllSegmentsResponse>>; | ||
after?: number; | ||
cursor?: string; | ||
} | ||
@@ -566,2 +569,3 @@ interface ListAllSegmentsResponse { | ||
keyword?: string; | ||
search?: string; | ||
}; | ||
@@ -777,2 +781,3 @@ /** | ||
url: string; | ||
enabled?: boolean; | ||
} | ||
@@ -821,2 +826,3 @@ interface UpdateWebhookParams { | ||
page?: number; | ||
include?: "subscriber"; | ||
} | ||
@@ -838,2 +844,3 @@ interface FormsSubscribersParams { | ||
page?: number; | ||
cursor?: string; | ||
} | ||
@@ -849,3 +856,3 @@ interface CampaignSubscribersActivityResponse { | ||
clicks_count: number; | ||
subscriber: SubscriberObject; | ||
subscriber?: SubscriberObject; | ||
} | ||
@@ -852,0 +859,0 @@ interface StatsMeta extends Meta { |
{ | ||
"name": "@mailerlite/mailerlite-nodejs", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "MailerLite Node.js SDK", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
143695
0.16%927
0.76%