@iterable/api 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +74 -0
- package/dist/client/base.d.ts +33 -0
- package/dist/client/base.d.ts.map +1 -0
- package/dist/client/base.js +155 -0
- package/dist/client/base.js.map +1 -0
- package/dist/client/campaigns.d.ts +71 -0
- package/dist/client/campaigns.d.ts.map +1 -0
- package/dist/client/campaigns.js +125 -0
- package/dist/client/campaigns.js.map +1 -0
- package/dist/client/catalogs.d.ts +60 -0
- package/dist/client/catalogs.d.ts.map +1 -0
- package/dist/client/catalogs.js +138 -0
- package/dist/client/catalogs.js.map +1 -0
- package/dist/client/events.d.ts +38 -0
- package/dist/client/events.d.ts.map +1 -0
- package/dist/client/events.js +38 -0
- package/dist/client/events.js.map +1 -0
- package/dist/client/experiments.d.ts +24 -0
- package/dist/client/experiments.d.ts.map +1 -0
- package/dist/client/experiments.js +29 -0
- package/dist/client/experiments.js.map +1 -0
- package/dist/client/export.d.ts +27 -0
- package/dist/client/export.d.ts.map +1 -0
- package/dist/client/export.js +31 -0
- package/dist/client/export.js.map +1 -0
- package/dist/client/index.d.ts +315 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +25 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/journeys.d.ts +26 -0
- package/dist/client/journeys.d.ts.map +1 -0
- package/dist/client/journeys.js +32 -0
- package/dist/client/journeys.js.map +1 -0
- package/dist/client/lists.d.ts +39 -0
- package/dist/client/lists.d.ts.map +1 -0
- package/dist/client/lists.js +80 -0
- package/dist/client/lists.js.map +1 -0
- package/dist/client/messaging.d.ts +39 -0
- package/dist/client/messaging.d.ts.map +1 -0
- package/dist/client/messaging.js +110 -0
- package/dist/client/messaging.js.map +1 -0
- package/dist/client/snippets.d.ts +37 -0
- package/dist/client/snippets.d.ts.map +1 -0
- package/dist/client/snippets.js +29 -0
- package/dist/client/snippets.js.map +1 -0
- package/dist/client/subscriptions.d.ts +26 -0
- package/dist/client/subscriptions.d.ts.map +1 -0
- package/dist/client/subscriptions.js +31 -0
- package/dist/client/subscriptions.js.map +1 -0
- package/dist/client/templates.d.ts +52 -0
- package/dist/client/templates.d.ts.map +1 -0
- package/dist/client/templates.js +132 -0
- package/dist/client/templates.js.map +1 -0
- package/dist/client/users.d.ts +76 -0
- package/dist/client/users.d.ts.map +1 -0
- package/dist/client/users.js +115 -0
- package/dist/client/users.js.map +1 -0
- package/dist/client/webhooks.d.ts +25 -0
- package/dist/client/webhooks.d.ts.map +1 -0
- package/dist/client/webhooks.js +17 -0
- package/dist/client/webhooks.js.map +1 -0
- package/dist/config.d.ts +26 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +51 -0
- package/dist/config.js.map +1 -0
- package/dist/errors.d.ts +45 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +144 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +3 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +32 -0
- package/dist/logger.js.map +1 -0
- package/dist/types/campaigns.d.ts +307 -0
- package/dist/types/campaigns.d.ts.map +1 -0
- package/dist/types/campaigns.js +226 -0
- package/dist/types/campaigns.js.map +1 -0
- package/dist/types/catalogs.d.ts +138 -0
- package/dist/types/catalogs.d.ts.map +1 -0
- package/dist/types/catalogs.js +139 -0
- package/dist/types/catalogs.js.map +1 -0
- package/dist/types/common.d.ts +145 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/common.js +110 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/events.d.ts +124 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/events.js +118 -0
- package/dist/types/events.js.map +1 -0
- package/dist/types/experiments.d.ts +14 -0
- package/dist/types/experiments.d.ts.map +1 -0
- package/dist/types/experiments.js +24 -0
- package/dist/types/experiments.js.map +1 -0
- package/dist/types/export.d.ts +121 -0
- package/dist/types/export.d.ts.map +1 -0
- package/dist/types/export.js +105 -0
- package/dist/types/export.js.map +1 -0
- package/dist/types/journeys.d.ts +72 -0
- package/dist/types/journeys.d.ts.map +1 -0
- package/dist/types/journeys.js +65 -0
- package/dist/types/journeys.js.map +1 -0
- package/dist/types/lists.d.ts +149 -0
- package/dist/types/lists.d.ts.map +1 -0
- package/dist/types/lists.js +140 -0
- package/dist/types/lists.js.map +1 -0
- package/dist/types/messaging.d.ts +246 -0
- package/dist/types/messaging.d.ts.map +1 -0
- package/dist/types/messaging.js +323 -0
- package/dist/types/messaging.js.map +1 -0
- package/dist/types/snippets.d.ts +89 -0
- package/dist/types/snippets.d.ts.map +1 -0
- package/dist/types/snippets.js +85 -0
- package/dist/types/snippets.js.map +1 -0
- package/dist/types/subscriptions.d.ts +63 -0
- package/dist/types/subscriptions.d.ts.map +1 -0
- package/dist/types/subscriptions.js +40 -0
- package/dist/types/subscriptions.js.map +1 -0
- package/dist/types/templates.d.ts +315 -0
- package/dist/types/templates.d.ts.map +1 -0
- package/dist/types/templates.js +357 -0
- package/dist/types/templates.js.map +1 -0
- package/dist/types/users.d.ts +144 -0
- package/dist/types/users.d.ts.map +1 -0
- package/dist/types/users.js +189 -0
- package/dist/types/users.js.map +1 -0
- package/dist/types/webhooks.d.ts +52 -0
- package/dist/types/webhooks.d.ts.map +1 -0
- package/dist/types/webhooks.js +32 -0
- package/dist/types/webhooks.js.map +1 -0
- package/package.json +73 -0
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { BaseIterableClient } from "./base.js";
|
|
2
|
+
declare const IterableClient_base: new (...args: any[]) => BaseIterableClient & {
|
|
3
|
+
getCampaigns(params?: import("../index.js").GetCampaignsParams, opts?: {
|
|
4
|
+
signal?: AbortSignal;
|
|
5
|
+
} | undefined): Promise<import("../index.js").GetCampaignsResponse>;
|
|
6
|
+
getCampaign(params: import("../index.js").GetCampaignParams, opts?: {
|
|
7
|
+
signal?: AbortSignal;
|
|
8
|
+
} | undefined): Promise<import("../index.js").GetCampaignResponse>;
|
|
9
|
+
createCampaign(params: import("../index.js").CreateCampaignParams): Promise<import("../index.js").CreateCampaignResponse>;
|
|
10
|
+
getChildCampaigns(params: import("../index.js").GetChildCampaignsParams, opts?: {
|
|
11
|
+
signal?: AbortSignal;
|
|
12
|
+
} | undefined): Promise<import("../index.js").GetChildCampaignsResponse>;
|
|
13
|
+
getCampaignMetrics(options: import("../index.js").GetCampaignMetricsParams): Promise<any[]>;
|
|
14
|
+
scheduleCampaign(params: import("../index.js").ScheduleCampaignParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
15
|
+
abortCampaign(params: import("../index.js").AbortCampaignParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
16
|
+
cancelCampaign(params: import("../index.js").CancelCampaignParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
17
|
+
activateTriggeredCampaign(params: import("../index.js").ActivateTriggeredCampaignParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
18
|
+
deactivateTriggeredCampaign(params: import("../index.js").DeactivateTriggeredCampaignParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
19
|
+
archiveCampaigns(params: import("../index.js").ArchiveCampaignsParams): Promise<import("../index.js").ArchiveCampaignsResponse>;
|
|
20
|
+
triggerCampaign(params: import("../index.js").TriggerCampaignParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
21
|
+
sendCampaign(params: import("../index.js").SendCampaignParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
22
|
+
client: import("axios").AxiosInstance;
|
|
23
|
+
"__#private@#httpAgent"?: import("http").Agent;
|
|
24
|
+
"__#private@#httpsAgent"?: import("https").Agent;
|
|
25
|
+
parseNdjson(data: string): any[];
|
|
26
|
+
parseCsv(data: string): any[];
|
|
27
|
+
validateResponse<T>(response: {
|
|
28
|
+
data: unknown;
|
|
29
|
+
config?: {
|
|
30
|
+
url?: string;
|
|
31
|
+
};
|
|
32
|
+
}, schema: import("zod").ZodType<T>): T;
|
|
33
|
+
destroy(): void;
|
|
34
|
+
} & {
|
|
35
|
+
createCatalog(catalogName: string): Promise<import("../index.js").IterableSuccessResponse>;
|
|
36
|
+
updateCatalogItems(options: import("../index.js").UpdateCatalogItemParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
37
|
+
getCatalogItem(catalogName: string, itemId: string): Promise<import("../index.js").CatalogItemWithProperties>;
|
|
38
|
+
deleteCatalogItem(catalogName: string, itemId: string): Promise<import("../index.js").IterableSuccessResponse>;
|
|
39
|
+
getCatalogs(params?: import("../index.js").GetCatalogsParams): Promise<import("../index.js").GetCatalogsResponse>;
|
|
40
|
+
getCatalogFieldMappings(params: import("../index.js").GetCatalogFieldMappingsParams): Promise<import("../index.js").CatalogFieldMappingsResponse>;
|
|
41
|
+
getCatalogItems(params: import("../index.js").GetCatalogItemsParams): Promise<import("../index.js").GetCatalogItemsResponse>;
|
|
42
|
+
deleteCatalog(catalogName: string): Promise<import("../index.js").IterableSuccessResponse>;
|
|
43
|
+
updateCatalogFieldMappings(params: import("../index.js").UpdateCatalogFieldMappingsParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
44
|
+
bulkDeleteCatalogItems(params: import("../index.js").BulkDeleteCatalogItemsParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
45
|
+
partialUpdateCatalogItem(params: import("../index.js").PartialUpdateCatalogItemParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
46
|
+
replaceCatalogItem(params: import("../index.js").ReplaceCatalogItemParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
47
|
+
client: import("axios").AxiosInstance;
|
|
48
|
+
"__#private@#httpAgent"?: import("http").Agent;
|
|
49
|
+
"__#private@#httpsAgent"?: import("https").Agent;
|
|
50
|
+
parseNdjson(data: string): any[];
|
|
51
|
+
parseCsv(data: string): any[];
|
|
52
|
+
validateResponse<T>(response: {
|
|
53
|
+
data: unknown;
|
|
54
|
+
config?: {
|
|
55
|
+
url?: string;
|
|
56
|
+
};
|
|
57
|
+
}, schema: import("zod").ZodType<T>): T;
|
|
58
|
+
destroy(): void;
|
|
59
|
+
} & {
|
|
60
|
+
trackEvent(event: import("../index.js").TrackEventParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
61
|
+
trackBulkEvents(params: import("../index.js").TrackBulkEventsParams): Promise<import("../index.js").BulkTrackResponse>;
|
|
62
|
+
getUserEventsByEmail(options: import("../index.js").GetUserEventsByEmailParams, opts?: {
|
|
63
|
+
signal?: AbortSignal;
|
|
64
|
+
} | undefined): Promise<import("../index.js").GetUserEventsByEmailResponse>;
|
|
65
|
+
getUserEventsByUserId(options: import("../index.js").GetUserEventsByUserIdParams, opts?: {
|
|
66
|
+
signal?: AbortSignal;
|
|
67
|
+
} | undefined): Promise<import("../index.js").GetUserEventsByUserIdResponse>;
|
|
68
|
+
client: import("axios").AxiosInstance;
|
|
69
|
+
"__#private@#httpAgent"?: import("http").Agent;
|
|
70
|
+
"__#private@#httpsAgent"?: import("https").Agent;
|
|
71
|
+
parseNdjson(data: string): any[];
|
|
72
|
+
parseCsv(data: string): any[];
|
|
73
|
+
validateResponse<T>(response: {
|
|
74
|
+
data: unknown;
|
|
75
|
+
config?: {
|
|
76
|
+
url?: string;
|
|
77
|
+
};
|
|
78
|
+
}, schema: import("zod").ZodType<T>): T;
|
|
79
|
+
destroy(): void;
|
|
80
|
+
} & {
|
|
81
|
+
getExperimentMetrics(params?: import("../index.js").GetExperimentMetricsParams): Promise<import("../index.js").ExperimentMetricsResponse>;
|
|
82
|
+
client: import("axios").AxiosInstance;
|
|
83
|
+
"__#private@#httpAgent"?: import("http").Agent;
|
|
84
|
+
"__#private@#httpsAgent"?: import("https").Agent;
|
|
85
|
+
parseNdjson(data: string): any[];
|
|
86
|
+
parseCsv(data: string): any[];
|
|
87
|
+
validateResponse<T>(response: {
|
|
88
|
+
data: unknown;
|
|
89
|
+
config?: {
|
|
90
|
+
url?: string;
|
|
91
|
+
};
|
|
92
|
+
}, schema: import("zod").ZodType<T>): T;
|
|
93
|
+
destroy(): void;
|
|
94
|
+
} & {
|
|
95
|
+
getExportJobs(params?: import("../index.js").GetExportJobsParams): Promise<import("../index.js").GetExportJobsResponse>;
|
|
96
|
+
getExportFiles(params: import("../index.js").GetExportFilesParams): Promise<import("../index.js").GetExportFilesResponse>;
|
|
97
|
+
startExportJob(params: import("../index.js").StartExportJobParams): Promise<import("../index.js").StartExportJobResponse>;
|
|
98
|
+
cancelExportJob(params: import("../index.js").CancelExportJobParams): Promise<import("../index.js").CancelExportJobResponse>;
|
|
99
|
+
client: import("axios").AxiosInstance;
|
|
100
|
+
"__#private@#httpAgent"?: import("http").Agent;
|
|
101
|
+
"__#private@#httpsAgent"?: import("https").Agent;
|
|
102
|
+
parseNdjson(data: string): any[];
|
|
103
|
+
parseCsv(data: string): any[];
|
|
104
|
+
validateResponse<T>(response: {
|
|
105
|
+
data: unknown;
|
|
106
|
+
config?: {
|
|
107
|
+
url?: string;
|
|
108
|
+
};
|
|
109
|
+
}, schema: import("zod").ZodType<T>): T;
|
|
110
|
+
destroy(): void;
|
|
111
|
+
} & {
|
|
112
|
+
triggerJourney(options: import("../index.js").TriggerJourneyParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
113
|
+
getJourneys(params?: import("../index.js").GetJourneysParams): Promise<import("../index.js").GetJourneysResponse>;
|
|
114
|
+
client: import("axios").AxiosInstance;
|
|
115
|
+
"__#private@#httpAgent"?: import("http").Agent;
|
|
116
|
+
"__#private@#httpsAgent"?: import("https").Agent;
|
|
117
|
+
parseNdjson(data: string): any[];
|
|
118
|
+
parseCsv(data: string): any[];
|
|
119
|
+
validateResponse<T>(response: {
|
|
120
|
+
data: unknown;
|
|
121
|
+
config?: {
|
|
122
|
+
url?: string;
|
|
123
|
+
};
|
|
124
|
+
}, schema: import("zod").ZodType<T>): T;
|
|
125
|
+
destroy(): void;
|
|
126
|
+
} & {
|
|
127
|
+
getLists(): Promise<import("../index.js").GetListsResponse>;
|
|
128
|
+
subscribeUserToList(options: import("../index.js").SubscribeToListParams): Promise<import("../index.js").UserBulkUpdateListResponse>;
|
|
129
|
+
unsubscribeUserFromList(options: import("../index.js").UnsubscribeFromListParams): Promise<import("../index.js").UserBulkUpdateListResponse>;
|
|
130
|
+
getListUsers(options: import("../index.js").GetListUsersParams, opts?: {
|
|
131
|
+
signal?: AbortSignal;
|
|
132
|
+
} | undefined): Promise<import("../index.js").GetListUsersResponse>;
|
|
133
|
+
createList(options: import("../index.js").CreateListParams): Promise<import("../index.js").CreateListResponse>;
|
|
134
|
+
deleteList(listId: number): Promise<import("../index.js").IterableSuccessResponse>;
|
|
135
|
+
getListSize(params: import("../index.js").GetListSizeParams): Promise<import("../index.js").GetListSizeResponse>;
|
|
136
|
+
getListPreviewUsers(params: import("../index.js").GetListPreviewUsersParams): Promise<import("../index.js").GetListPreviewUsersResponse>;
|
|
137
|
+
client: import("axios").AxiosInstance;
|
|
138
|
+
"__#private@#httpAgent"?: import("http").Agent;
|
|
139
|
+
"__#private@#httpsAgent"?: import("https").Agent;
|
|
140
|
+
parseNdjson(data: string): any[];
|
|
141
|
+
parseCsv(data: string): any[];
|
|
142
|
+
validateResponse<T>(response: {
|
|
143
|
+
data: unknown;
|
|
144
|
+
config?: {
|
|
145
|
+
url?: string;
|
|
146
|
+
};
|
|
147
|
+
}, schema: import("zod").ZodType<T>): T;
|
|
148
|
+
destroy(): void;
|
|
149
|
+
} & {
|
|
150
|
+
sendEmail(request: import("../index.js").SendEmailParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
151
|
+
cancelEmail(options: import("../index.js").CancelEmailParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
152
|
+
sendSMS(options: import("../index.js").SendSMSParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
153
|
+
cancelSMS(options: import("../index.js").CancelSMSParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
154
|
+
sendPush(options: import("../index.js").SendPushParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
155
|
+
cancelPush(options: import("../index.js").CancelPushParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
156
|
+
sendWebPush(request: import("../index.js").SendWebPushParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
157
|
+
cancelWebPush(options: import("../index.js").CancelWebPushParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
158
|
+
sendWhatsApp(request: import("../index.js").SendWhatsAppParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
159
|
+
cancelWhatsApp(options: import("../index.js").CancelWhatsAppParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
160
|
+
getInAppMessages(options: import("../index.js").GetInAppMessagesParams): Promise<import("../index.js").GetInAppMessagesResponse>;
|
|
161
|
+
sendInApp(options: import("../index.js").SendInAppParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
162
|
+
cancelInApp(params: import("../index.js").CancelInAppParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
163
|
+
getEmbeddedMessages(params: import("../index.js").GetEmbeddedMessagesParams): Promise<import("../index.js").EmbeddedMessagesResponse>;
|
|
164
|
+
getChannels(): Promise<import("../index.js").ChannelsResponse>;
|
|
165
|
+
getMessageTypes(): Promise<import("../index.js").MessageTypesResponse>;
|
|
166
|
+
client: import("axios").AxiosInstance;
|
|
167
|
+
"__#private@#httpAgent"?: import("http").Agent;
|
|
168
|
+
"__#private@#httpsAgent"?: import("https").Agent;
|
|
169
|
+
parseNdjson(data: string): any[];
|
|
170
|
+
parseCsv(data: string): any[];
|
|
171
|
+
validateResponse<T>(response: {
|
|
172
|
+
data: unknown;
|
|
173
|
+
config?: {
|
|
174
|
+
url?: string;
|
|
175
|
+
};
|
|
176
|
+
}, schema: import("zod").ZodType<T>): T;
|
|
177
|
+
destroy(): void;
|
|
178
|
+
} & {
|
|
179
|
+
getSnippets(opts?: {
|
|
180
|
+
signal?: AbortSignal;
|
|
181
|
+
} | undefined): Promise<import("../index.js").GetSnippetsResponse>;
|
|
182
|
+
createSnippet(params: import("../index.js").CreateSnippetRequest, opts?: {
|
|
183
|
+
signal?: AbortSignal;
|
|
184
|
+
} | undefined): Promise<import("../index.js").CreateSnippetResponse>;
|
|
185
|
+
getSnippet(params: import("../index.js").GetSnippetParams, opts?: {
|
|
186
|
+
signal?: AbortSignal;
|
|
187
|
+
} | undefined): Promise<import("../index.js").GetSnippetResponse>;
|
|
188
|
+
updateSnippet(params: import("../index.js").UpdateSnippetParams, body: import("../index.js").UpdateSnippetRequest, opts?: {
|
|
189
|
+
signal?: AbortSignal;
|
|
190
|
+
} | undefined): Promise<import("../index.js").UpdateSnippetResponse>;
|
|
191
|
+
deleteSnippet(params: import("../index.js").DeleteSnippetParams, opts?: {
|
|
192
|
+
signal?: AbortSignal;
|
|
193
|
+
} | undefined): Promise<import("../index.js").DeleteSnippetResponse>;
|
|
194
|
+
client: import("axios").AxiosInstance;
|
|
195
|
+
"__#private@#httpAgent"?: import("http").Agent;
|
|
196
|
+
"__#private@#httpsAgent"?: import("https").Agent;
|
|
197
|
+
parseNdjson(data: string): any[];
|
|
198
|
+
parseCsv(data: string): any[];
|
|
199
|
+
validateResponse<T>(response: {
|
|
200
|
+
data: unknown;
|
|
201
|
+
config?: {
|
|
202
|
+
url?: string;
|
|
203
|
+
};
|
|
204
|
+
}, schema: import("zod").ZodType<T>): T;
|
|
205
|
+
destroy(): void;
|
|
206
|
+
} & {
|
|
207
|
+
bulkUpdateSubscriptions(params: import("../index.js").BulkUpdateSubscriptionsParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
208
|
+
subscribeUserByEmail(params: import("../index.js").SubscribeUserByEmailParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
209
|
+
subscribeUserByUserId(params: import("../index.js").SubscribeUserByUserIdParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
210
|
+
unsubscribeUserByEmail(params: import("../index.js").UnsubscribeUserByEmailParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
211
|
+
unsubscribeUserByUserId(params: import("../index.js").UnsubscribeUserByUserIdParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
212
|
+
client: import("axios").AxiosInstance;
|
|
213
|
+
"__#private@#httpAgent"?: import("http").Agent;
|
|
214
|
+
"__#private@#httpsAgent"?: import("https").Agent;
|
|
215
|
+
parseNdjson(data: string): any[];
|
|
216
|
+
parseCsv(data: string): any[];
|
|
217
|
+
validateResponse<T>(response: {
|
|
218
|
+
data: unknown;
|
|
219
|
+
config?: {
|
|
220
|
+
url?: string;
|
|
221
|
+
};
|
|
222
|
+
}, schema: import("zod").ZodType<T>): T;
|
|
223
|
+
destroy(): void;
|
|
224
|
+
} & {
|
|
225
|
+
"__#private@#getTemplateByType"<T>(pathSegment: string, params: import("../index.js").GetTemplateParams, schema: import("zod").ZodType<T, unknown, import("zod/v4/core").$ZodTypeInternals<T, unknown>>): Promise<T>;
|
|
226
|
+
"__#private@#createTemplateByType"<T>(pathSegment: string, template: T): Promise<import("../index.js").IterableSuccessResponse>;
|
|
227
|
+
"__#private@#updateTemplateByType"<T>(pathSegment: string, options: T): Promise<import("../index.js").IterableSuccessResponse>;
|
|
228
|
+
deleteTemplates(templateIds: number[]): Promise<import("../index.js").BulkDeleteTemplatesResponse>;
|
|
229
|
+
"__#private@#sendTemplateProof"(pathSegment: string, request: import("../index.js").TemplateProofRequest): Promise<import("../index.js").IterableSuccessResponse>;
|
|
230
|
+
"__#private@#previewTemplate"(pathSegment: string, params: import("../index.js").PreviewTemplateParams): Promise<string>;
|
|
231
|
+
getTemplates(options?: import("../index.js").GetTemplatesParams): Promise<import("../index.js").GetTemplatesResponse>;
|
|
232
|
+
getTemplateByClientId(clientTemplateId: string): Promise<import("../index.js").GetTemplateByClientIdResponse>;
|
|
233
|
+
bulkDeleteTemplates(params: import("../index.js").BulkDeleteTemplatesParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
234
|
+
getEmailTemplate(params: import("../index.js").GetTemplateParams): Promise<import("../index.js").EmailTemplate>;
|
|
235
|
+
upsertEmailTemplate(template: import("../index.js").UpsertEmailTemplateParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
236
|
+
updateEmailTemplate(options: import("../index.js").UpdateEmailTemplateParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
237
|
+
sendEmailTemplateProof(request: import("../index.js").TemplateProofRequest): Promise<import("../index.js").IterableSuccessResponse>;
|
|
238
|
+
previewEmailTemplate(params: import("../index.js").PreviewTemplateParams): Promise<string>;
|
|
239
|
+
getSMSTemplate(params: import("../index.js").GetTemplateParams): Promise<import("../index.js").SMSTemplate>;
|
|
240
|
+
upsertSMSTemplate(template: import("../index.js").UpsertSMSTemplateParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
241
|
+
updateSMSTemplate(options: import("../index.js").UpdateSMSTemplateParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
242
|
+
sendSMSTemplateProof(request: import("../index.js").TemplateProofRequest): Promise<import("../index.js").IterableSuccessResponse>;
|
|
243
|
+
getPushTemplate(params: import("../index.js").GetTemplateParams): Promise<import("../index.js").PushTemplate>;
|
|
244
|
+
upsertPushTemplate(template: import("../index.js").UpsertPushTemplateParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
245
|
+
updatePushTemplate(options: import("../index.js").UpdatePushTemplateParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
246
|
+
sendPushTemplateProof(request: import("../index.js").TemplateProofRequest): Promise<import("../index.js").IterableSuccessResponse>;
|
|
247
|
+
getInAppTemplate(params: import("../index.js").GetTemplateParams): Promise<import("../index.js").InAppTemplate>;
|
|
248
|
+
upsertInAppTemplate(template: import("../index.js").UpsertInAppTemplateParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
249
|
+
updateInAppTemplate(options: import("../index.js").UpdateInAppTemplateParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
250
|
+
sendInAppTemplateProof(request: import("../index.js").TemplateProofRequest): Promise<import("../index.js").IterableSuccessResponse>;
|
|
251
|
+
previewInAppTemplate(params: import("../index.js").PreviewTemplateParams): Promise<string>;
|
|
252
|
+
client: import("axios").AxiosInstance;
|
|
253
|
+
"__#private@#httpAgent"?: import("http").Agent;
|
|
254
|
+
"__#private@#httpsAgent"?: import("https").Agent;
|
|
255
|
+
parseNdjson(data: string): any[];
|
|
256
|
+
parseCsv(data: string): any[];
|
|
257
|
+
validateResponse<T>(response: {
|
|
258
|
+
data: unknown;
|
|
259
|
+
config?: {
|
|
260
|
+
url?: string;
|
|
261
|
+
};
|
|
262
|
+
}, schema: import("zod").ZodType<T>): T;
|
|
263
|
+
destroy(): void;
|
|
264
|
+
} & {
|
|
265
|
+
getUserByEmail(email: string, opts?: {
|
|
266
|
+
signal?: AbortSignal;
|
|
267
|
+
} | undefined): Promise<import("../index.js").UserResponse>;
|
|
268
|
+
getUserByUserId(userId: string, opts?: {
|
|
269
|
+
signal?: AbortSignal;
|
|
270
|
+
} | undefined): Promise<import("../index.js").UserResponse>;
|
|
271
|
+
updateUser(userProfile: import("../index.js").UpdateUserParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
272
|
+
deleteUserByEmail(email: string): Promise<import("../index.js").IterableSuccessResponse>;
|
|
273
|
+
deleteUserByUserId(userId: string): Promise<import("../index.js").IterableSuccessResponse>;
|
|
274
|
+
updateEmail(params: import("../index.js").UpdateEmailParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
275
|
+
updateUserSubscriptions(params: import("../index.js").UpdateUserSubscriptionsParams): Promise<import("../index.js").IterableSuccessResponse>;
|
|
276
|
+
bulkUpdateUsers(params: import("../index.js").BulkUpdateUsersParams): Promise<import("../index.js").UserBulkUpdateListResponse>;
|
|
277
|
+
getSentMessages(params: import("../index.js").GetSentMessagesParams): Promise<import("../index.js").GetSentMessagesResponse>;
|
|
278
|
+
getUserFields(): Promise<import("../index.js").GetUserFieldsResponse>;
|
|
279
|
+
client: import("axios").AxiosInstance;
|
|
280
|
+
"__#private@#httpAgent"?: import("http").Agent;
|
|
281
|
+
"__#private@#httpsAgent"?: import("https").Agent;
|
|
282
|
+
parseNdjson(data: string): any[];
|
|
283
|
+
parseCsv(data: string): any[];
|
|
284
|
+
validateResponse<T>(response: {
|
|
285
|
+
data: unknown;
|
|
286
|
+
config?: {
|
|
287
|
+
url?: string;
|
|
288
|
+
};
|
|
289
|
+
}, schema: import("zod").ZodType<T>): T;
|
|
290
|
+
destroy(): void;
|
|
291
|
+
} & {
|
|
292
|
+
getWebhooks(): Promise<import("../index.js").GetWebhooksResponse>;
|
|
293
|
+
updateWebhook(options: import("../index.js").UpdateWebhookParams): Promise<import("../index.js").Webhook>;
|
|
294
|
+
client: import("axios").AxiosInstance;
|
|
295
|
+
"__#private@#httpAgent"?: import("http").Agent;
|
|
296
|
+
"__#private@#httpsAgent"?: import("https").Agent;
|
|
297
|
+
parseNdjson(data: string): any[];
|
|
298
|
+
parseCsv(data: string): any[];
|
|
299
|
+
validateResponse<T>(response: {
|
|
300
|
+
data: unknown;
|
|
301
|
+
config?: {
|
|
302
|
+
url?: string;
|
|
303
|
+
};
|
|
304
|
+
}, schema: import("zod").ZodType<T>): T;
|
|
305
|
+
destroy(): void;
|
|
306
|
+
};
|
|
307
|
+
/**
|
|
308
|
+
* Main Iterable API client composed from domain mixins
|
|
309
|
+
* This approach keeps all methods at the top level (client.getUserByEmail())
|
|
310
|
+
* while organizing code into separate domain files
|
|
311
|
+
*/
|
|
312
|
+
export declare class IterableClient extends IterableClient_base {
|
|
313
|
+
}
|
|
314
|
+
export {};
|
|
315
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;iDAyCf,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwB2uG,CAAC;eAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;cAAT,CAAC;eAAO,CAAC;;;;;;;;;;;;;;;;;;;;cAAT,CAAC;eAAO,CAAC;;;;;;;;;;;;;cAAT,CAAC;eAAO,CAAC;;;;;;;;;;;;;;;;cAAT,CAAC;eAAO,CAAC;;;;;;;;;;;;;;cAAT,CAAC;eAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;cAAT,CAAC;eAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAT,CAAC;eAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAT,CAAC;eAAO,CAAC;;;;;;;;;;;;;;;;;cAAT,CAAC;eAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAT,CAAC;eAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;cAAT,CAAC;eAAO,CAAC;;;;;;;;;;;;;;cAAT,CAAC;eAAO,CAAC;;;;;AArBzxG;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,mBAenC;CAAG"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BaseIterableClient } from "./base.js";
|
|
2
|
+
import { Campaigns } from "./campaigns.js";
|
|
3
|
+
import { Catalogs } from "./catalogs.js";
|
|
4
|
+
import { Events } from "./events.js";
|
|
5
|
+
import { Experiments } from "./experiments.js";
|
|
6
|
+
import { Export } from "./export.js";
|
|
7
|
+
import { Journeys } from "./journeys.js";
|
|
8
|
+
import { Lists } from "./lists.js";
|
|
9
|
+
import { Messaging } from "./messaging.js";
|
|
10
|
+
import { Snippets } from "./snippets.js";
|
|
11
|
+
import { Subscriptions } from "./subscriptions.js";
|
|
12
|
+
import { Templates } from "./templates.js";
|
|
13
|
+
import { Users } from "./users.js";
|
|
14
|
+
import { Webhooks } from "./webhooks.js";
|
|
15
|
+
function compose(base, ...mixins) {
|
|
16
|
+
return mixins.reduce((acc, mixin) => mixin(acc), base);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Main Iterable API client composed from domain mixins
|
|
20
|
+
* This approach keeps all methods at the top level (client.getUserByEmail())
|
|
21
|
+
* while organizing code into separate domain files
|
|
22
|
+
*/
|
|
23
|
+
export class IterableClient extends compose(BaseIterableClient, Campaigns, Catalogs, Events, Experiments, Export, Journeys, Lists, Messaging, Snippets, Subscriptions, Templates, Users, Webhooks) {
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAgBzC,SAAS,OAAO,CAGd,IAAU,EAAE,GAAG,MAAc;IAM7B,OAAO,MAAM,CAAC,MAAM,CAClB,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAC1B,IAAwB,CACmB,CAAC;AAChD,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,cAAe,SAAQ,OAAO,CACzC,kBAAkB,EAClB,SAAS,EACT,QAAQ,EACR,MAAM,EACN,WAAW,EACX,MAAM,EACN,QAAQ,EACR,KAAK,EACL,SAAS,EACT,QAAQ,EACR,aAAa,EACb,SAAS,EACT,KAAK,EACL,QAAQ,CACT;CAAG"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IterableSuccessResponse } from "../types/common.js";
|
|
2
|
+
import { GetJourneysParams, GetJourneysResponse, TriggerJourneyParams } from "../types/journeys.js";
|
|
3
|
+
import type { Constructor } from "./base.js";
|
|
4
|
+
import type { BaseIterableClient } from "./base.js";
|
|
5
|
+
/**
|
|
6
|
+
* Journeys operations mixin
|
|
7
|
+
*/
|
|
8
|
+
export declare function Journeys<T extends Constructor<BaseIterableClient>>(Base: T): {
|
|
9
|
+
new (...args: any[]): {
|
|
10
|
+
triggerJourney(options: TriggerJourneyParams): Promise<IterableSuccessResponse>;
|
|
11
|
+
getJourneys(params?: GetJourneysParams): Promise<GetJourneysResponse>;
|
|
12
|
+
client: import("axios").AxiosInstance;
|
|
13
|
+
"__#private@#httpAgent"?: import("http").Agent;
|
|
14
|
+
"__#private@#httpsAgent"?: import("https").Agent;
|
|
15
|
+
parseNdjson(data: string): any[];
|
|
16
|
+
parseCsv(data: string): any[];
|
|
17
|
+
validateResponse<T_1>(response: {
|
|
18
|
+
data: unknown;
|
|
19
|
+
config?: {
|
|
20
|
+
url?: string;
|
|
21
|
+
};
|
|
22
|
+
}, schema: import("zod").ZodType<T_1>): T_1;
|
|
23
|
+
destroy(): void;
|
|
24
|
+
};
|
|
25
|
+
} & T;
|
|
26
|
+
//# sourceMappingURL=journeys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journeys.d.ts","sourceRoot":"","sources":["../../src/client/journeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,uBAAuB,EAExB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD;;GAEG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,WAAW,CAAC,kBAAkB,CAAC,EAAE,IAAI,EAAE,CAAC;;gCAG5D,oBAAoB,GAC5B,OAAO,CAAC,uBAAuB,CAAC;6BASxB,iBAAiB,GACzB,OAAO,CAAC,mBAAmB,CAAC;;;;;;;;kBAwB25G,CAAC;mBAAO,CAAC;;;;;MADt8G"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { formatSortParam, IterableSuccessResponseSchema, } from "../types/common.js";
|
|
2
|
+
/**
|
|
3
|
+
* Journeys operations mixin
|
|
4
|
+
*/
|
|
5
|
+
export function Journeys(Base) {
|
|
6
|
+
return class extends Base {
|
|
7
|
+
async triggerJourney(options) {
|
|
8
|
+
const response = await this.client.post("/api/workflows/triggerWorkflow", options);
|
|
9
|
+
return this.validateResponse(response, IterableSuccessResponseSchema);
|
|
10
|
+
}
|
|
11
|
+
async getJourneys(params) {
|
|
12
|
+
// Always use pagination with defaults to ensure consistent API behavior
|
|
13
|
+
const page = params?.page ?? 1;
|
|
14
|
+
const pageSize = params?.pageSize ?? 10;
|
|
15
|
+
const sort = params?.sort;
|
|
16
|
+
const queryParams = new URLSearchParams();
|
|
17
|
+
queryParams.append("page", page.toString());
|
|
18
|
+
queryParams.append("pageSize", pageSize.toString());
|
|
19
|
+
const sortString = formatSortParam(sort);
|
|
20
|
+
if (sortString) {
|
|
21
|
+
queryParams.append("sort", sortString);
|
|
22
|
+
}
|
|
23
|
+
if (params?.state) {
|
|
24
|
+
params.state.forEach((state) => queryParams.append("state", state));
|
|
25
|
+
}
|
|
26
|
+
const url = `/api/journeys?${queryParams.toString()}`;
|
|
27
|
+
const response = await this.client.get(url);
|
|
28
|
+
return response.data;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=journeys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journeys.js","sourceRoot":"","sources":["../../src/client/journeys.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEf,6BAA6B,GAC9B,MAAM,oBAAoB,CAAC;AAS5B;;GAEG;AACH,MAAM,UAAU,QAAQ,CAA4C,IAAO;IACzE,OAAO,KAAM,SAAQ,IAAI;QACvB,KAAK,CAAC,cAAc,CAClB,OAA6B;YAE7B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CACrC,gCAAgC,EAChC,OAAO,CACR,CAAC;YACF,OAAO,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,6BAA6B,CAAC,CAAC;QACxE,CAAC;QAED,KAAK,CAAC,WAAW,CACf,MAA0B;YAE1B,wEAAwE;YACxE,MAAM,IAAI,GAAG,MAAM,EAAE,IAAI,IAAI,CAAC,CAAC;YAC/B,MAAM,QAAQ,GAAG,MAAM,EAAE,QAAQ,IAAI,EAAE,CAAC;YACxC,MAAM,IAAI,GAAG,MAAM,EAAE,IAAI,CAAC;YAE1B,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC;YAC1C,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC5C,WAAW,CAAC,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;YAEpD,MAAM,UAAU,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;YACzC,IAAI,UAAU,EAAE,CAAC;gBACf,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;YACzC,CAAC;YACD,IAAI,MAAM,EAAE,KAAK,EAAE,CAAC;gBAClB,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;YACtE,CAAC;YAED,MAAM,GAAG,GAAG,iBAAiB,WAAW,CAAC,QAAQ,EAAE,EAAE,CAAC;YACtD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC5C,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { IterableSuccessResponse } from "../types/common.js";
|
|
2
|
+
import { CreateListParams, CreateListResponse, GetListPreviewUsersParams, GetListPreviewUsersResponse, GetListSizeParams, GetListSizeResponse, GetListsResponse, GetListUsersParams, GetListUsersResponse, SubscribeToListParams, UnsubscribeFromListParams, UserBulkUpdateListResponse } from "../types/lists.js";
|
|
3
|
+
import type { BaseIterableClient, Constructor } from "./base.js";
|
|
4
|
+
/**
|
|
5
|
+
* Lists operations mixin
|
|
6
|
+
*/
|
|
7
|
+
export declare function Lists<T extends Constructor<BaseIterableClient>>(Base: T): {
|
|
8
|
+
new (...args: any[]): {
|
|
9
|
+
getLists(): Promise<GetListsResponse>;
|
|
10
|
+
subscribeUserToList(options: SubscribeToListParams): Promise<UserBulkUpdateListResponse>;
|
|
11
|
+
unsubscribeUserFromList(options: UnsubscribeFromListParams): Promise<UserBulkUpdateListResponse>;
|
|
12
|
+
getListUsers(options: GetListUsersParams, opts?: {
|
|
13
|
+
signal?: AbortSignal;
|
|
14
|
+
}): Promise<GetListUsersResponse>;
|
|
15
|
+
createList(options: CreateListParams): Promise<CreateListResponse>;
|
|
16
|
+
deleteList(listId: number): Promise<IterableSuccessResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* Get the count of users in a list
|
|
19
|
+
*/
|
|
20
|
+
getListSize(params: GetListSizeParams): Promise<GetListSizeResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* Preview users in a list (up to 5000 users)
|
|
23
|
+
*/
|
|
24
|
+
getListPreviewUsers(params: GetListPreviewUsersParams): Promise<GetListPreviewUsersResponse>;
|
|
25
|
+
client: import("axios").AxiosInstance;
|
|
26
|
+
"__#private@#httpAgent"?: import("http").Agent;
|
|
27
|
+
"__#private@#httpsAgent"?: import("https").Agent;
|
|
28
|
+
parseNdjson(data: string): any[];
|
|
29
|
+
parseCsv(data: string): any[];
|
|
30
|
+
validateResponse<T_1>(response: {
|
|
31
|
+
data: unknown;
|
|
32
|
+
config?: {
|
|
33
|
+
url?: string;
|
|
34
|
+
};
|
|
35
|
+
}, schema: import("zod").ZodType<T_1>): T_1;
|
|
36
|
+
destroy(): void;
|
|
37
|
+
};
|
|
38
|
+
} & T;
|
|
39
|
+
//# sourceMappingURL=lists.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lists.d.ts","sourceRoot":"","sources":["../../src/client/lists.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EAExB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAElB,yBAAyB,EACzB,2BAA2B,EAC3B,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAEhB,kBAAkB,EAClB,oBAAoB,EAEpB,qBAAqB,EACrB,yBAAyB,EACzB,0BAA0B,EAE3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAEjE;;GAEG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,WAAW,CAAC,kBAAkB,CAAC,EAAE,IAAI,EAAE,CAAC;;oBAElD,OAAO,CAAC,gBAAgB,CAAC;qCAMhC,qBAAqB,GAC7B,OAAO,CAAC,0BAA0B,CAAC;yCAM3B,yBAAyB,GACjC,OAAO,CAAC,0BAA0B,CAAC;8BAS3B,kBAAkB,SACpB;YAAE,MAAM,CAAC,EAAE,WAAW,CAAA;SAAE,GAC9B,OAAO,CAAC,oBAAoB,CAAC;4BA2BN,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;2BAK/C,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC;QAKlE;;WAEG;4BACuB,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;QAS1E;;WAEG;oCAEO,yBAAyB,GAChC,OAAO,CAAC,2BAA2B,CAAC;;;;;;;;kBAwB8wB,CAAC;mBAAO,CAAC;;;;;MADj0B"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { IterableSuccessResponseSchema, } from "../types/common.js";
|
|
2
|
+
import { CreateListResponseSchema, GetListsResponseSchema, GetListUsersResponseSchema, UserBulkUpdateListResponseSchema, } from "../types/lists.js";
|
|
3
|
+
/**
|
|
4
|
+
* Lists operations mixin
|
|
5
|
+
*/
|
|
6
|
+
export function Lists(Base) {
|
|
7
|
+
return class extends Base {
|
|
8
|
+
async getLists() {
|
|
9
|
+
const response = await this.client.get("/api/lists");
|
|
10
|
+
return this.validateResponse(response, GetListsResponseSchema);
|
|
11
|
+
}
|
|
12
|
+
async subscribeUserToList(options) {
|
|
13
|
+
const response = await this.client.post("/api/lists/subscribe", options);
|
|
14
|
+
return this.validateResponse(response, UserBulkUpdateListResponseSchema);
|
|
15
|
+
}
|
|
16
|
+
async unsubscribeUserFromList(options) {
|
|
17
|
+
const response = await this.client.post("/api/lists/unsubscribe", options);
|
|
18
|
+
return this.validateResponse(response, UserBulkUpdateListResponseSchema);
|
|
19
|
+
}
|
|
20
|
+
async getListUsers(options, opts) {
|
|
21
|
+
const params = new URLSearchParams();
|
|
22
|
+
params.append("listId", options.listId.toString());
|
|
23
|
+
if (options.maxResults)
|
|
24
|
+
params.append("maxResults", options.maxResults.toString());
|
|
25
|
+
const response = await this.client.get(`/api/lists/getUsers?${params.toString()}`, opts?.signal ? { signal: opts.signal } : {});
|
|
26
|
+
// The API returns newline-delimited email addresses as plain text
|
|
27
|
+
const responseData = response.data;
|
|
28
|
+
if (typeof responseData === "string") {
|
|
29
|
+
const emails = responseData
|
|
30
|
+
.trim()
|
|
31
|
+
.split("\n")
|
|
32
|
+
.filter((email) => email.trim());
|
|
33
|
+
return {
|
|
34
|
+
users: emails.map((email) => ({ email: email.trim() })),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
// Fallback to original format if it's already JSON
|
|
38
|
+
return this.validateResponse(response, GetListUsersResponseSchema);
|
|
39
|
+
}
|
|
40
|
+
async createList(options) {
|
|
41
|
+
const response = await this.client.post("/api/lists", options);
|
|
42
|
+
return this.validateResponse(response, CreateListResponseSchema);
|
|
43
|
+
}
|
|
44
|
+
async deleteList(listId) {
|
|
45
|
+
const response = await this.client.delete(`/api/lists/${listId}`);
|
|
46
|
+
return this.validateResponse(response, IterableSuccessResponseSchema);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Get the count of users in a list
|
|
50
|
+
*/
|
|
51
|
+
async getListSize(params) {
|
|
52
|
+
const response = await this.client.get(`/api/lists/${params.listId}/size`);
|
|
53
|
+
// API returns a string, but we want to return a proper object
|
|
54
|
+
const size = parseInt(response.data, 10);
|
|
55
|
+
return { size };
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Preview users in a list (up to 5000 users)
|
|
59
|
+
*/
|
|
60
|
+
async getListPreviewUsers(params) {
|
|
61
|
+
const queryParams = new URLSearchParams();
|
|
62
|
+
queryParams.append("listId", params.listId.toString());
|
|
63
|
+
if (params.preferUserId !== undefined) {
|
|
64
|
+
queryParams.append("preferUserId", params.preferUserId.toString());
|
|
65
|
+
}
|
|
66
|
+
if (params.size !== undefined) {
|
|
67
|
+
queryParams.append("size", params.size.toString());
|
|
68
|
+
}
|
|
69
|
+
const response = await this.client.get(`/api/lists/previewUsers?${queryParams.toString()}`);
|
|
70
|
+
// API returns plain text with users separated by newlines
|
|
71
|
+
const usersText = response.data;
|
|
72
|
+
const users = usersText
|
|
73
|
+
.trim()
|
|
74
|
+
.split("\n")
|
|
75
|
+
.filter((user) => user.length > 0);
|
|
76
|
+
return { users };
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=lists.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lists.js","sourceRoot":"","sources":["../../src/client/lists.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { IterableSuccessResponse } from "../types/common.js";
|
|
2
|
+
import { CancelEmailParams, CancelInAppParams, CancelPushParams, CancelSMSParams, CancelWebPushParams, CancelWhatsAppParams, ChannelsResponse, EmbeddedMessagesResponse, GetEmbeddedMessagesParams, GetInAppMessagesParams, GetInAppMessagesResponse, MessageTypesResponse, SendEmailParams, SendInAppParams, SendPushParams, SendSMSParams, SendWebPushParams, SendWhatsAppParams } from "../types/messaging.js";
|
|
3
|
+
import type { BaseIterableClient, Constructor } from "./base.js";
|
|
4
|
+
/**
|
|
5
|
+
* Messaging operations mixin
|
|
6
|
+
*/
|
|
7
|
+
export declare function Messaging<T extends Constructor<BaseIterableClient>>(Base: T): {
|
|
8
|
+
new (...args: any[]): {
|
|
9
|
+
sendEmail(request: SendEmailParams): Promise<IterableSuccessResponse>;
|
|
10
|
+
cancelEmail(options: CancelEmailParams): Promise<IterableSuccessResponse>;
|
|
11
|
+
sendSMS(options: SendSMSParams): Promise<IterableSuccessResponse>;
|
|
12
|
+
cancelSMS(options: CancelSMSParams): Promise<IterableSuccessResponse>;
|
|
13
|
+
sendPush(options: SendPushParams): Promise<IterableSuccessResponse>;
|
|
14
|
+
cancelPush(options: CancelPushParams): Promise<IterableSuccessResponse>;
|
|
15
|
+
sendWebPush(request: SendWebPushParams): Promise<IterableSuccessResponse>;
|
|
16
|
+
cancelWebPush(options: CancelWebPushParams): Promise<IterableSuccessResponse>;
|
|
17
|
+
sendWhatsApp(request: SendWhatsAppParams): Promise<IterableSuccessResponse>;
|
|
18
|
+
cancelWhatsApp(options: CancelWhatsAppParams): Promise<IterableSuccessResponse>;
|
|
19
|
+
getInAppMessages(options: GetInAppMessagesParams): Promise<GetInAppMessagesResponse>;
|
|
20
|
+
sendInApp(options: SendInAppParams): Promise<IterableSuccessResponse>;
|
|
21
|
+
cancelInApp(params: CancelInAppParams): Promise<IterableSuccessResponse>;
|
|
22
|
+
getEmbeddedMessages(params: GetEmbeddedMessagesParams): Promise<EmbeddedMessagesResponse>;
|
|
23
|
+
getChannels(): Promise<ChannelsResponse>;
|
|
24
|
+
getMessageTypes(): Promise<MessageTypesResponse>;
|
|
25
|
+
client: import("axios").AxiosInstance;
|
|
26
|
+
"__#private@#httpAgent"?: import("http").Agent;
|
|
27
|
+
"__#private@#httpsAgent"?: import("https").Agent;
|
|
28
|
+
parseNdjson(data: string): any[];
|
|
29
|
+
parseCsv(data: string): any[];
|
|
30
|
+
validateResponse<T_1>(response: {
|
|
31
|
+
data: unknown;
|
|
32
|
+
config?: {
|
|
33
|
+
url?: string;
|
|
34
|
+
};
|
|
35
|
+
}, schema: import("zod").ZodType<T_1>): T_1;
|
|
36
|
+
destroy(): void;
|
|
37
|
+
};
|
|
38
|
+
} & T;
|
|
39
|
+
//# sourceMappingURL=messaging.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messaging.d.ts","sourceRoot":"","sources":["../../src/client/messaging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAEhB,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EAExB,oBAAoB,EAEpB,eAAe,EACf,eAAe,EACf,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAEjE;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,WAAW,CAAC,kBAAkB,CAAC,EAAE,IAAI,EAAE,CAAC;;2BAI7D,eAAe,GACvB,OAAO,CAAC,uBAAuB,CAAC;6BAMxB,iBAAiB,GACzB,OAAO,CAAC,uBAAuB,CAAC;yBAMZ,aAAa,GAAG,OAAO,CAAC,uBAAuB,CAAC;2BAM5D,eAAe,GACvB,OAAO,CAAC,uBAAuB,CAAC;0BAMX,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC;4BAM9D,gBAAgB,GACxB,OAAO,CAAC,uBAAuB,CAAC;6BAOxB,iBAAiB,GACzB,OAAO,CAAC,uBAAuB,CAAC;+BAMxB,mBAAmB,GAC3B,OAAO,CAAC,uBAAuB,CAAC;8BAOxB,kBAAkB,GAC1B,OAAO,CAAC,uBAAuB,CAAC;gCAMxB,oBAAoB,GAC5B,OAAO,CAAC,uBAAuB,CAAC;kCAOxB,sBAAsB,GAC9B,OAAO,CAAC,wBAAwB,CAAC;2BAczB,eAAe,GACvB,OAAO,CAAC,uBAAuB,CAAC;4BAMzB,iBAAiB,GACxB,OAAO,CAAC,uBAAuB,CAAC;oCAOzB,yBAAyB,GAChC,OAAO,CAAC,wBAAwB,CAAC;uBA8Bf,OAAO,CAAC,gBAAgB,CAAC;2BAMrB,OAAO,CAAC,oBAAoB,CAAC;;;;;;;;kBA7BlD,CAAL;mBAAO,CAAC;;;;;MAkCV"}
|