forked from vdavid/node-mautic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
241 lines (209 loc) · 13.6 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
export = Mautic;
declare namespace Mautic {
type EntityID = string | number;
type Parameters = Record<string, any>
type EditMethod = 'PUT' | 'PATCH'
type Response = any
interface ConnectorConstructorOptions {
apiUrl: string
username: string
password: string
timeoutInSeconds: number
logLevel?: ( 'none' | 'error' | 'verbose' )
}
}
declare class Mautic {
constructor(options: Mautic.ConnectorConstructorOptions)
assets: {
getAsset: (assetId: Mautic.EntityID) => Promise<Mautic.Response>
listAssets: (params: Mautic.Parameters) => Promise<Mautic.Response>
createAsset: (params: Mautic.Parameters) => Promise<Mautic.Response>
}
campaigns: {
getCampaign: (campaignId: Mautic.EntityID) => Promise<Mautic.Response>
listCampaigns: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
listCampaignContacts: (campaignId: Mautic.EntityID) => Promise<Mautic.Response>
addContactToCampaign: (campaignId: Mautic.EntityID, contactId: Mautic.EntityID) => Promise<Mautic.Response>,
removeContactFromCampaign: (campaignId: Mautic.EntityID, contactId: Mautic.EntityID) => Promise<Mautic.Response>,
}
categories: {
getCategory: (categoryId: Mautic.EntityID) => Promise<Mautic.Response>
listContactCategories: () => Promise<Mautic.Response>,
createCategory: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
editCategory: (method: Mautic.EditMethod, queryParameters: Mautic.Parameters, categoryId: Mautic.EntityID) => Promise<Mautic.Response>
deleteCategory: (categoryId: Mautic.EntityID) => Promise<Mautic.Response>
}
companies: {
getCompany: (companyId: Mautic.EntityID) => Promise<Mautic.Response>
listContactCompanies: () => Promise<Mautic.Response>
createCompany: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
editCompany: (method: Mautic.EditMethod, queryParameters: Mautic.Parameters, companyId: Mautic.EntityID) => Promise<Mautic.Response>
deleteCompany: (companyId: Mautic.EntityID) => Promise<Mautic.Response>
addContactToCompany: (companyId: Mautic.EntityID, contactId: Mautic.EntityID) => Promise<Mautic.Response>
removeContactFromCompany: (companyId: Mautic.EntityID, contactId: Mautic.EntityID) => Promise<Mautic.Response>
}
contacts: {
getContact: (contactId: Mautic.EntityID) => Promise<Mautic.Response>
getContactByEmailAddress: (lemailAddress: string) => Promise<Mautic.Response>
listContacts: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
createContact: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
editContact: (method: Mautic.EditMethod, queryParameters: Mautic.Parameters, contactId: Mautic.EntityID) => Promise<Mautic.Response>
deleteContact: (contactId: Mautic.EntityID) => Promise<Mautic.Response>
addPoints: (contactId: Mautic.EntityID, queryParameters: Mautic.Parameters, points: number | string) => Promise<Mautic.Response>
subtractPoints: (contactId: Mautic.EntityID, queryParameters: Mautic.Parameters, points: number | string) => Promise<Mautic.Response>
listAvailableOwners: () => Promise<Mautic.Response>
listAvailableFields: () => Promise<Mautic.Response>
listContactNotes: (contactId: Mautic.EntityID, queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
getSegmentMemberships: (contactId: Mautic.EntityID) => Promise<Mautic.Response>
getCampaignMemberships: (contactId: Mautic.EntityID) => Promise<Mautic.Response>
getActivityEventsForContact: (contactId: Mautic.EntityID, queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
getContactCompanies: (contactId: Mautic.EntityID) => Promise<Mautic.Response>
getContactDevices: (contactId: Mautic.EntityID) => Promise<Mautic.Response>
addDoNotContact: (contactId: Mautic.EntityID, channel: string, queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
removeDoNotContact: (contactId: Mautic.EntityID, channel: string) => Promise<Mautic.Response>
addUtmTags: (contactId: Mautic.EntityID, queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
removeUtmTags: (contactId: Mautic.EntityID, utmId: Mautic.EntityID) => Promise<Mautic.Response>
}
dashboard: {
getAvailableWidgetTypes: () => Promise<Mautic.Response>
}
dynamiccontent: {
getDynamicContent: (contentId: Mautic.EntityID) => Promise<Mautic.Response>
listDynamicContent: () => Promise<Mautic.Response>
createDynamicContent: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
editDynamicContent: (method: Mautic.EditMethod, queryParameters: Mautic.Parameters, contentId: Mautic.EntityID) => Promise<Mautic.Response>
deleteDynamicContent: (contentId: Mautic.EntityID) => Promise<Mautic.Response>
}
emails: {
getEmail: (emailId: Mautic.EntityID) => Promise<Mautic.Response>
listEmails: () => Promise<Mautic.Response>
createEmail: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
editEmail: (method: Mautic.EditMethod, queryParameters: Mautic.Parameters, emailId: Mautic.EntityID) => Promise<Mautic.Response>
deleteEmail: (emailId: Mautic.EntityID) => Promise<Mautic.Response>
sendEmailToContact: (emailId: Mautic.EntityID, contactId: Mautic.EntityID, queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
sendEmailToSegment: (emailId: Mautic.EntityID) => Promise<Mautic.Response>
}
fields: {
getField: (fieldType: string, fieldId: Mautic.EntityID) => Promise<Mautic.Response>
listContactFields: (fieldType: string) => Promise<Mautic.Response>
createField: (fieldType: string, queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
editField: (method: Mautic.EditMethod, fieldType: string, queryParameters: Mautic.Parameters, fieldId: Mautic.EntityID) => Promise<Mautic.Response>
deleteField: (fieldType: string, fieldId: Mautic.EntityID) => Promise<Mautic.Response>
}
forms: {
getForm: (formId: Mautic.EntityID) => Promise<Mautic.Response>
listForms: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
createForm: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
editForm: (method: Mautic.EditMethod, queryParameters: Mautic.Parameters, formId: Mautic.EntityID) => Promise<Mautic.Response>
deleteForm: (formId: Mautic.EntityID) => Promise<Mautic.Response>
deleteFormFields: (formId: Mautic.EntityID, queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
deleteFormActions: (formId: Mautic.EntityID, queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
listFormSubmissions: (formId: Mautic.EntityID) => Promise<Mautic.Response>
listFormSubmissionsForContact: (formId: Mautic.EntityID, contactId: Mautic.EntityID) => Promise<Mautic.Response>
getFormSubmission: (formId: Mautic.EntityID, submissionId: Mautic.EntityID) => Promise<Mautic.Response>
}
marketingmessages: {
getMarketingMessage: (messageId: Mautic.EntityID) => Promise<Mautic.Response>
listMarketingMessages: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
createMarketingMessage: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
editMarketingMessage: (method: Mautic.EditMethod, queryParameters: Mautic.Parameters, messageId: Mautic.EntityID) => Promise<Mautic.Response>
deleteMarketingMessage: (messageId: Mautic.EntityID) => Promise<Mautic.Response>
};
notes: {
getNote: (noteId: Mautic.EntityID) => Promise<Mautic.Response>
listContactNotes: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
createNote: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
editNote: (method: Mautic.EditMethod, queryParameters: Mautic.Parameters, noteId: Mautic.EntityID) => Promise<Mautic.Response>
deleteNote: (noteId: Mautic.EntityID) => Promise<Mautic.Response>
}
notifications: {
getNotification: (notificationId: Mautic.EntityID) => Promise<Mautic.Response>
listNotifications: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
createNotification: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
editNotification: (method: Mautic.EditMethod, queryParameters: Mautic.Parameters, notificationId: Mautic.EntityID) => Promise<Mautic.Response>
deleteNotification: (notificationId: Mautic.EntityID) => Promise<Mautic.Response>
}
pages: {
getPage: (pageId: Mautic.EntityID) => Promise<Mautic.Response>
listPages: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
createPage: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
editPage: (method: Mautic.EditMethod, queryParameters: Mautic.Parameters, pageId: Mautic.EntityID) => Promise<Mautic.Response>
deletePage: (pageId: Mautic.EntityID) => Promise<Mautic.Response>
}
pointactions: {
getPointAction: (pointActionId: Mautic.EntityID) => Promise<Mautic.Response>
listPointActions: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
createPointAction: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
editPointAction: (method: Mautic.EditMethod, queryParameters: Mautic.Parameters, pointActionId: Mautic.EntityID) => Promise<Mautic.Response>
deletePointAction: (pointActionId: Mautic.EntityID) => Promise<Mautic.Response>
getPointActionTypes: () => Promise<Mautic.Response>
}
pointtriggers: {
getPointTrigger: (pointTriggerId: Mautic.EntityID) => Promise<Mautic.Response>
listPointTriggers: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
createPointTrigger: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
editPointTrigger: (method: Mautic.EditMethod, queryParameters: Mautic.Parameters, pointTriggerId: Mautic.EntityID) => Promise<Mautic.Response>
deletePointTrigger: (pointTriggerId: Mautic.EntityID) => Promise<Mautic.Response>
getPointTriggerEventTypes: () => Promise<Mautic.Response>
}
roles: {
getRole: (roleId: Mautic.EntityID) => Promise<Mautic.Response>
listContactRoles: () => Promise<Mautic.Response>
createRole: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
editRole: (method: Mautic.EditMethod, queryParameters: Mautic.Parameters, roleId: Mautic.EntityID) => Promise<Mautic.Response>
deleteRole: (roleId: Mautic.EntityID) => Promise<Mautic.Response>
}
segments: {
getSegment: (segmentId: Mautic.EntityID) => Promise<Mautic.Response>
listSegments: () => Promise<Mautic.Response>
createSegment: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
editSegment: (method: Mautic.EditMethod, queryParameters: Mautic.Parameters, segmentId: Mautic.EntityID) => Promise<Mautic.Response>
deleteSegment: (segmentId: Mautic.EntityID) => Promise<Mautic.Response>
addContactToSegment: (segmentId: Mautic.EntityID, contactId: Mautic.EntityID) => Promise<Mautic.Response>
removeContactFromSegment: (segmentId: Mautic.EntityID, contactId: Mautic.EntityID) => Promise<Mautic.Response>
}
textmessages: {
getTextMessage: (textMessageId: Mautic.EntityID) => Promise<Mautic.Response>
listTextMessages: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
createTextMessage: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
editTextMessage: (method: Mautic.EditMethod, queryParameters: Mautic.Parameters, textMessageId: Mautic.EntityID) => Promise<Mautic.Response>
deleteTextMessage: (textMessageId: Mautic.EntityID) => Promise<Mautic.Response>
}
stages: {
getStage: (stageId: Mautic.EntityID) => Promise<Mautic.Response>
listStages: () => Promise<Mautic.Response>
createStage: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
editStage: (method: Mautic.EditMethod, queryParameters: Mautic.Parameters, stageId: Mautic.EntityID) => Promise<Mautic.Response>
deleteStage: (stageId: Mautic.EntityID) => Promise<Mautic.Response>
addContactToStage: (stageId: Mautic.EntityID, contactId: Mautic.EntityID) => Promise<Mautic.Response>
removeContactFromStage: (stageId: Mautic.EntityID, contactId: Mautic.EntityID) => Promise<Mautic.Response>
}
themes: {
getTheme: (themeName: Mautic.EntityID) => Promise<Mautic.Response>
getListOfThemes: () => Promise<Mautic.Response>
}
tweets: {
getTweet: (tweetId: Mautic.EntityID) => Promise<Mautic.Response>
listTweets: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
createTweet: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
editTweet: (method: Mautic.EditMethod, queryParameters: Mautic.Parameters, tweetId: Mautic.EntityID) => Promise<Mautic.Response>
deleteTweet: (tweetId: Mautic.EntityID) => Promise<Mautic.Response>
}
users: {
getUser: (userId: Mautic.EntityID) => Promise<Mautic.Response>
listContactUsers: () => Promise<Mautic.Response>
createUser: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
editUser: (method: Mautic.EditMethod, queryParameters: Mautic.Parameters, userId: Mautic.EntityID) => Promise<Mautic.Response>
deleteUser: (userId: Mautic.EntityID) => Promise<Mautic.Response>
getSelfUser: () => Promise<Mautic.Response>
checkUserPermissions: (userId: Mautic.EntityID) => Promise<Mautic.Response>
}
webhooks: {
getWebhook: (webhookId: Mautic.EntityID) => Promise<Mautic.Response>
listWebhooks: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
createWebhook: (queryParameters: Mautic.Parameters) => Promise<Mautic.Response>
editWebhook: (method: Mautic.EditMethod, queryParameters: Mautic.Parameters, webhookId: Mautic.EntityID) => Promise<Mautic.Response>
deleteWebhook: (webhookId: Mautic.EntityID) => Promise<Mautic.Response>
listAvailableWebhookTriggers: () => Promise<Mautic.Response>
}
}