@vicacha-devs/strapi-plugin-broadcasts 0.0.0-stage → 0.1.0
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 +15 -2
- package/dist/admin/BroadcastsHomePage-CM_N_spo.mjs +1210 -0
- package/dist/admin/BroadcastsHomePage-DQueM7nj.js +1228 -0
- package/dist/admin/SettingsPage-TawvAAiv.js +1187 -0
- package/dist/admin/SettingsPage-ikcb0cfh.mjs +1169 -0
- package/dist/admin/ar-vwekVqfp.js +232 -0
- package/dist/admin/ar-wZTCd3Za.mjs +232 -0
- package/dist/admin/de-IZicxuvv.mjs +232 -0
- package/dist/admin/de-Qa2SQQfY.js +232 -0
- package/dist/admin/en-B-HnZo8U.mjs +232 -0
- package/dist/admin/en-D1byrK0s.js +232 -0
- package/dist/admin/es-Co7PmAj8.mjs +232 -0
- package/dist/admin/es-Dgylqagv.js +232 -0
- package/dist/admin/fr-B9zZn3z1.mjs +232 -0
- package/dist/admin/fr-C7-MIWnw.js +232 -0
- package/dist/admin/index-CApLw9Uu.mjs +1036 -0
- package/dist/admin/index-Dw6J7U1v.js +1053 -0
- package/dist/admin/index.js +6 -0
- package/dist/admin/index.mjs +6 -0
- package/dist/admin/it-DJU9iBqT.mjs +232 -0
- package/dist/admin/it-D_mulZtx.js +232 -0
- package/dist/admin/pt-B9swwjPu.js +232 -0
- package/dist/admin/pt-Dr8u5we0.mjs +232 -0
- package/dist/admin/ru-B0NNiMNA.js +232 -0
- package/dist/admin/ru-Bd4cEKDV.mjs +232 -0
- package/dist/admin/selectOptions-BlvNrhvc.mjs +150 -0
- package/dist/admin/selectOptions-DuHQ0KK3.js +149 -0
- package/dist/admin/src/components/AutomationAndLogsTabs.d.ts +16 -0
- package/dist/admin/src/components/BridgesSandboxTab.d.ts +8 -0
- package/dist/admin/src/components/CampaignComposerForm.d.ts +26 -0
- package/dist/admin/src/components/CampaignsTableSection.d.ts +27 -0
- package/dist/admin/src/components/DeliveryLedgerSection.d.ts +17 -0
- package/dist/admin/src/components/Initializer.d.ts +6 -0
- package/dist/admin/src/components/OrganizationEmailTab.d.ts +10 -0
- package/dist/admin/src/components/PluginIcon.d.ts +3 -0
- package/dist/admin/src/components/WhatsAppTransportTab.d.ts +11 -0
- package/dist/admin/src/index.d.ts +24 -0
- package/dist/admin/src/pages/BroadcastsHomePage.d.ts +2 -0
- package/dist/admin/src/pages/SettingsPage.d.ts +3 -0
- package/dist/admin/src/permissions.d.ts +30 -0
- package/dist/admin/src/pluginId.d.ts +2 -0
- package/dist/admin/src/translations/cmLabels.d.ts +1 -0
- package/dist/admin/src/translations/cmLabelsExtra.d.ts +1 -0
- package/dist/admin/src/translations/cmPlaceholders.d.ts +1 -0
- package/dist/admin/src/translations/cmPlaceholdersExtra.d.ts +1 -0
- package/dist/admin/src/utils/extractApiError.d.ts +1 -0
- package/dist/admin/src/utils/selectOptions.d.ts +21 -0
- package/dist/admin/tr-Cc-ItZUP.js +232 -0
- package/dist/admin/tr-DlyHa2Vk.mjs +232 -0
- package/dist/admin/zh-CLzJ7x3y.mjs +232 -0
- package/dist/admin/zh-CaqwZk-p.js +232 -0
- package/dist/server/index.js +3399 -0
- package/dist/server/index.mjs +3399 -0
- package/dist/server/src/bootstrap.d.ts +5 -0
- package/dist/server/src/config/index.d.ts +5 -0
- package/dist/server/src/content-types/automation-rule/index.d.ts +90 -0
- package/dist/server/src/content-types/automation-rule/schema.json.d.ts +90 -0
- package/dist/server/src/content-types/campaign/index.d.ts +118 -0
- package/dist/server/src/content-types/campaign/schema.json.d.ts +118 -0
- package/dist/server/src/content-types/delivery-log/index.d.ts +71 -0
- package/dist/server/src/content-types/delivery-log/schema.json.d.ts +71 -0
- package/dist/server/src/content-types/index.d.ts +279 -0
- package/dist/server/src/controllers/broadcastController.d.ts +32 -0
- package/dist/server/src/controllers/index.d.ts +22 -0
- package/dist/server/src/destroy.d.ts +5 -0
- package/dist/server/src/eventHubRegistry.d.ts +5 -0
- package/dist/server/src/index.d.ts +463 -0
- package/dist/server/src/register.d.ts +5 -0
- package/dist/server/src/routes/admin.d.ts +17 -0
- package/dist/server/src/routes/content-api.d.ts +13 -0
- package/dist/server/src/routes/index.d.ts +31 -0
- package/dist/server/src/services/automationService.d.ts +33 -0
- package/dist/server/src/services/campaignChannelDispatch.d.ts +20 -0
- package/dist/server/src/services/campaignHelpers.d.ts +20 -0
- package/dist/server/src/services/campaignLifecycle.d.ts +23 -0
- package/dist/server/src/services/campaignService.d.ts +54 -0
- package/dist/server/src/services/deliveryLedger.d.ts +18 -0
- package/dist/server/src/services/emailDesignerBridge.d.ts +30 -0
- package/dist/server/src/services/idempotency.d.ts +5 -0
- package/dist/server/src/services/index.d.ts +119 -0
- package/dist/server/src/services/settings.d.ts +12 -0
- package/dist/server/src/services/transportService.d.ts +70 -0
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.js +825 -0
- package/dist/shared/index.mjs +823 -0
- package/package.json +109 -3
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
register: ({ strapi }: {
|
|
3
|
+
strapi: import("@strapi/strapi").Core.Strapi;
|
|
4
|
+
}) => void;
|
|
5
|
+
bootstrap: ({ strapi }: {
|
|
6
|
+
strapi: import("@strapi/strapi").Core.Strapi;
|
|
7
|
+
}) => Promise<void>;
|
|
8
|
+
destroy: ({ strapi }: {
|
|
9
|
+
strapi: import("@strapi/strapi").Core.Strapi;
|
|
10
|
+
}) => void;
|
|
11
|
+
config: {
|
|
12
|
+
default: import('../../shared').BroadcastSettings;
|
|
13
|
+
validator(): void;
|
|
14
|
+
};
|
|
15
|
+
contentTypes: {
|
|
16
|
+
campaign: {
|
|
17
|
+
schema: {
|
|
18
|
+
kind: string;
|
|
19
|
+
collectionName: string;
|
|
20
|
+
info: {
|
|
21
|
+
singularName: string;
|
|
22
|
+
pluralName: string;
|
|
23
|
+
displayName: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
options: {
|
|
27
|
+
draftAndPublish: boolean;
|
|
28
|
+
};
|
|
29
|
+
pluginOptions: {
|
|
30
|
+
"content-manager": {
|
|
31
|
+
visible: boolean;
|
|
32
|
+
};
|
|
33
|
+
"content-type-builder": {
|
|
34
|
+
visible: boolean;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
attributes: {
|
|
38
|
+
title: {
|
|
39
|
+
type: string;
|
|
40
|
+
required: boolean;
|
|
41
|
+
};
|
|
42
|
+
slug: {
|
|
43
|
+
type: string;
|
|
44
|
+
targetField: string;
|
|
45
|
+
required: boolean;
|
|
46
|
+
};
|
|
47
|
+
topic: {
|
|
48
|
+
type: string;
|
|
49
|
+
default: string;
|
|
50
|
+
required: boolean;
|
|
51
|
+
};
|
|
52
|
+
channels: {
|
|
53
|
+
type: string;
|
|
54
|
+
required: boolean;
|
|
55
|
+
default: string[];
|
|
56
|
+
};
|
|
57
|
+
priority: {
|
|
58
|
+
type: string;
|
|
59
|
+
enum: string[];
|
|
60
|
+
default: string;
|
|
61
|
+
required: boolean;
|
|
62
|
+
};
|
|
63
|
+
status: {
|
|
64
|
+
type: string;
|
|
65
|
+
enum: string[];
|
|
66
|
+
default: string;
|
|
67
|
+
required: boolean;
|
|
68
|
+
};
|
|
69
|
+
scheduledAt: {
|
|
70
|
+
type: string;
|
|
71
|
+
};
|
|
72
|
+
sentAt: {
|
|
73
|
+
type: string;
|
|
74
|
+
};
|
|
75
|
+
subject: {
|
|
76
|
+
type: string;
|
|
77
|
+
required: boolean;
|
|
78
|
+
};
|
|
79
|
+
bodyText: {
|
|
80
|
+
type: string;
|
|
81
|
+
required: boolean;
|
|
82
|
+
};
|
|
83
|
+
bodyHtml: {
|
|
84
|
+
type: string;
|
|
85
|
+
};
|
|
86
|
+
ctaLabel: {
|
|
87
|
+
type: string;
|
|
88
|
+
};
|
|
89
|
+
ctaUrl: {
|
|
90
|
+
type: string;
|
|
91
|
+
};
|
|
92
|
+
mediaUrl: {
|
|
93
|
+
type: string;
|
|
94
|
+
};
|
|
95
|
+
emailTemplateRef: {
|
|
96
|
+
type: string;
|
|
97
|
+
};
|
|
98
|
+
whatsappTemplateName: {
|
|
99
|
+
type: string;
|
|
100
|
+
};
|
|
101
|
+
whatsappGroupIds: {
|
|
102
|
+
type: string;
|
|
103
|
+
default: never[];
|
|
104
|
+
};
|
|
105
|
+
telegramChatId: {
|
|
106
|
+
type: string;
|
|
107
|
+
};
|
|
108
|
+
telegramThreadId: {
|
|
109
|
+
type: string;
|
|
110
|
+
};
|
|
111
|
+
translations: {
|
|
112
|
+
type: string;
|
|
113
|
+
default: {};
|
|
114
|
+
};
|
|
115
|
+
secondaryDate: {
|
|
116
|
+
type: string;
|
|
117
|
+
default: {};
|
|
118
|
+
};
|
|
119
|
+
secondaryDateLabel: {
|
|
120
|
+
type: string;
|
|
121
|
+
};
|
|
122
|
+
stats: {
|
|
123
|
+
type: string;
|
|
124
|
+
default: {};
|
|
125
|
+
};
|
|
126
|
+
metadata: {
|
|
127
|
+
type: string;
|
|
128
|
+
default: {};
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
"automation-rule": {
|
|
134
|
+
schema: {
|
|
135
|
+
kind: string;
|
|
136
|
+
collectionName: string;
|
|
137
|
+
info: {
|
|
138
|
+
singularName: string;
|
|
139
|
+
pluralName: string;
|
|
140
|
+
displayName: string;
|
|
141
|
+
description: string;
|
|
142
|
+
};
|
|
143
|
+
options: {
|
|
144
|
+
draftAndPublish: boolean;
|
|
145
|
+
};
|
|
146
|
+
pluginOptions: {
|
|
147
|
+
"content-manager": {
|
|
148
|
+
visible: boolean;
|
|
149
|
+
};
|
|
150
|
+
"content-type-builder": {
|
|
151
|
+
visible: boolean;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
attributes: {
|
|
155
|
+
name: {
|
|
156
|
+
type: string;
|
|
157
|
+
required: boolean;
|
|
158
|
+
};
|
|
159
|
+
slug: {
|
|
160
|
+
type: string;
|
|
161
|
+
targetField: string;
|
|
162
|
+
required: boolean;
|
|
163
|
+
};
|
|
164
|
+
eventName: {
|
|
165
|
+
type: string;
|
|
166
|
+
required: boolean;
|
|
167
|
+
};
|
|
168
|
+
targetContentType: {
|
|
169
|
+
type: string;
|
|
170
|
+
};
|
|
171
|
+
topic: {
|
|
172
|
+
type: string;
|
|
173
|
+
default: string;
|
|
174
|
+
required: boolean;
|
|
175
|
+
};
|
|
176
|
+
channels: {
|
|
177
|
+
type: string;
|
|
178
|
+
required: boolean;
|
|
179
|
+
default: string[];
|
|
180
|
+
};
|
|
181
|
+
active: {
|
|
182
|
+
type: string;
|
|
183
|
+
default: boolean;
|
|
184
|
+
};
|
|
185
|
+
priority: {
|
|
186
|
+
type: string;
|
|
187
|
+
enum: string[];
|
|
188
|
+
default: string;
|
|
189
|
+
};
|
|
190
|
+
subjectTemplate: {
|
|
191
|
+
type: string;
|
|
192
|
+
required: boolean;
|
|
193
|
+
};
|
|
194
|
+
bodyTextTemplate: {
|
|
195
|
+
type: string;
|
|
196
|
+
required: boolean;
|
|
197
|
+
};
|
|
198
|
+
bodyHtmlTemplate: {
|
|
199
|
+
type: string;
|
|
200
|
+
};
|
|
201
|
+
ctaLabelTemplate: {
|
|
202
|
+
type: string;
|
|
203
|
+
};
|
|
204
|
+
ctaUrlTemplate: {
|
|
205
|
+
type: string;
|
|
206
|
+
};
|
|
207
|
+
translations: {
|
|
208
|
+
type: string;
|
|
209
|
+
default: {};
|
|
210
|
+
};
|
|
211
|
+
lastTriggeredAt: {
|
|
212
|
+
type: string;
|
|
213
|
+
};
|
|
214
|
+
triggerCount: {
|
|
215
|
+
type: string;
|
|
216
|
+
default: number;
|
|
217
|
+
min: number;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
"delivery-log": {
|
|
223
|
+
schema: {
|
|
224
|
+
kind: string;
|
|
225
|
+
collectionName: string;
|
|
226
|
+
info: {
|
|
227
|
+
singularName: string;
|
|
228
|
+
pluralName: string;
|
|
229
|
+
displayName: string;
|
|
230
|
+
description: string;
|
|
231
|
+
};
|
|
232
|
+
options: {
|
|
233
|
+
draftAndPublish: boolean;
|
|
234
|
+
};
|
|
235
|
+
pluginOptions: {
|
|
236
|
+
"content-manager": {
|
|
237
|
+
visible: boolean;
|
|
238
|
+
};
|
|
239
|
+
"content-type-builder": {
|
|
240
|
+
visible: boolean;
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
attributes: {
|
|
244
|
+
idempotencyKey: {
|
|
245
|
+
type: string;
|
|
246
|
+
required: boolean;
|
|
247
|
+
unique: boolean;
|
|
248
|
+
};
|
|
249
|
+
campaignSlug: {
|
|
250
|
+
type: string;
|
|
251
|
+
required: boolean;
|
|
252
|
+
};
|
|
253
|
+
channel: {
|
|
254
|
+
type: string;
|
|
255
|
+
enum: string[];
|
|
256
|
+
required: boolean;
|
|
257
|
+
};
|
|
258
|
+
driver: {
|
|
259
|
+
type: string;
|
|
260
|
+
required: boolean;
|
|
261
|
+
};
|
|
262
|
+
recipientMasked: {
|
|
263
|
+
type: string;
|
|
264
|
+
required: boolean;
|
|
265
|
+
};
|
|
266
|
+
locale: {
|
|
267
|
+
type: string;
|
|
268
|
+
default: string;
|
|
269
|
+
required: boolean;
|
|
270
|
+
};
|
|
271
|
+
status: {
|
|
272
|
+
type: string;
|
|
273
|
+
enum: string[];
|
|
274
|
+
required: boolean;
|
|
275
|
+
};
|
|
276
|
+
externalMessageId: {
|
|
277
|
+
type: string;
|
|
278
|
+
};
|
|
279
|
+
errorMessage: {
|
|
280
|
+
type: string;
|
|
281
|
+
};
|
|
282
|
+
sentAt: {
|
|
283
|
+
type: string;
|
|
284
|
+
required: boolean;
|
|
285
|
+
};
|
|
286
|
+
secondaryDateLabel: {
|
|
287
|
+
type: string;
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
controllers: {
|
|
294
|
+
broadcastController: ({ strapi }: {
|
|
295
|
+
strapi: import("@strapi/strapi").Core.Strapi;
|
|
296
|
+
}) => {
|
|
297
|
+
getSettings(ctx: import('./controllers/broadcastController').ControllerCtx): Promise<void>;
|
|
298
|
+
updateSettings(ctx: import('./controllers/broadcastController').ControllerCtx): Promise<unknown>;
|
|
299
|
+
listStarterTemplates(ctx: import('./controllers/broadcastController').ControllerCtx): Promise<void>;
|
|
300
|
+
listEmailTemplates(ctx: import('./controllers/broadcastController').ControllerCtx): Promise<void>;
|
|
301
|
+
listCampaigns(ctx: import('./controllers/broadcastController').ControllerCtx): Promise<void>;
|
|
302
|
+
createCampaign(ctx: import('./controllers/broadcastController').ControllerCtx): Promise<unknown>;
|
|
303
|
+
updateCampaign(ctx: import('./controllers/broadcastController').ControllerCtx): Promise<unknown>;
|
|
304
|
+
createFromTemplate(ctx: import('./controllers/broadcastController').ControllerCtx): Promise<unknown>;
|
|
305
|
+
sendCampaign(ctx: import('./controllers/broadcastController').ControllerCtx): Promise<unknown>;
|
|
306
|
+
listAutomationRules(ctx: import('./controllers/broadcastController').ControllerCtx): Promise<void>;
|
|
307
|
+
createAutomationRule(ctx: import('./controllers/broadcastController').ControllerCtx): Promise<unknown>;
|
|
308
|
+
updateAutomationRule(ctx: import('./controllers/broadcastController').ControllerCtx): Promise<unknown>;
|
|
309
|
+
listDeliveryLogs(ctx: import('./controllers/broadcastController').ControllerCtx): Promise<void>;
|
|
310
|
+
listPublicChannels(ctx: import('./controllers/broadcastController').ControllerCtx): Promise<void>;
|
|
311
|
+
listPublicArchive(ctx: import('./controllers/broadcastController').ControllerCtx): Promise<void>;
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
routes: {
|
|
315
|
+
"content-api": {
|
|
316
|
+
type: string;
|
|
317
|
+
routes: {
|
|
318
|
+
method: string;
|
|
319
|
+
path: string;
|
|
320
|
+
handler: string;
|
|
321
|
+
config: {
|
|
322
|
+
policies: never[];
|
|
323
|
+
auth: boolean;
|
|
324
|
+
};
|
|
325
|
+
}[];
|
|
326
|
+
};
|
|
327
|
+
admin: {
|
|
328
|
+
type: string;
|
|
329
|
+
routes: {
|
|
330
|
+
method: string;
|
|
331
|
+
path: string;
|
|
332
|
+
handler: string;
|
|
333
|
+
config: {
|
|
334
|
+
policies: (string | {
|
|
335
|
+
name: string;
|
|
336
|
+
config: {
|
|
337
|
+
actions: string[];
|
|
338
|
+
};
|
|
339
|
+
})[];
|
|
340
|
+
};
|
|
341
|
+
}[];
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
services: {
|
|
345
|
+
settings: ({ strapi }: {
|
|
346
|
+
strapi: import("@strapi/strapi").Core.Strapi;
|
|
347
|
+
}) => {
|
|
348
|
+
getPluginStore(): import("@strapi/strapi").Core.PluginStore;
|
|
349
|
+
getConfigDefaults(): import('../../shared').BroadcastSettings;
|
|
350
|
+
getSettings(): Promise<import('../../shared').BroadcastSettings>;
|
|
351
|
+
getPublicSafeSettings(): Promise<import('../../shared').BroadcastSettings>;
|
|
352
|
+
updateSettings(rawPartial: Partial<import('../../shared').BroadcastSettings>): Promise<import('../../shared').BroadcastSettings>;
|
|
353
|
+
};
|
|
354
|
+
transportService: ({ strapi }: {
|
|
355
|
+
strapi: import("@strapi/strapi").Core.Strapi;
|
|
356
|
+
}) => {
|
|
357
|
+
getSettingsService(): {
|
|
358
|
+
getSettings(): Promise<import('../../shared').BroadcastSettings>;
|
|
359
|
+
};
|
|
360
|
+
fetchRawEmailDesignerTemplates(): Promise<import('./services/emailDesignerBridge').EmailDesignerTemplateRow[]>;
|
|
361
|
+
listEmailDesignerTemplates(): Promise<import('../../shared').EmailDesignerTemplateSummary[]>;
|
|
362
|
+
resolveEmailDesignerTemplate(templateRef: string, locale?: string): Promise<import('./services/emailDesignerBridge').EmailDesignerTemplateRow | null>;
|
|
363
|
+
hasAlreadyDelivered(idempotencyKey: string): Promise<boolean>;
|
|
364
|
+
recordDeliveryLog(entry: Omit<import('../../shared').DeliveryLogRecord, "documentId" | "sentAt">, secrets?: Array<string | undefined>): Promise<import('../../shared').DeliveryLogRecord>;
|
|
365
|
+
listDeliveryLogs(params?: {
|
|
366
|
+
campaignSlug?: string;
|
|
367
|
+
channel?: import('../../shared').BroadcastChannel;
|
|
368
|
+
limit?: number;
|
|
369
|
+
}): Promise<import('../../shared').DeliveryLogRecord[]>;
|
|
370
|
+
persistResult(campaignSlug: string, secondaryDateLabel: string | undefined, result: import('../../shared').ChannelDispatchResult, settings?: import('../../shared').BroadcastSettings): Promise<import('../../shared').ChannelDispatchResult>;
|
|
371
|
+
logOutcome(p: {
|
|
372
|
+
campaignSlug: string;
|
|
373
|
+
locale: string;
|
|
374
|
+
secondaryDateLabel?: string;
|
|
375
|
+
}, channel: import('../../shared').BroadcastChannel, driver: string, recipientMasked: string, status: import('../../shared').ChannelDispatchResult["status"], idempotencyKey: string, extra?: Partial<import('../../shared').ChannelDispatchResult>, settings?: import('../../shared').BroadcastSettings): Promise<import('../../shared').ChannelDispatchResult>;
|
|
376
|
+
simulateDryRunEmail(payload: import('./services/transportService').EmailSendPayload, effectiveTemplateRef: string, recipientMasked: string, idempotencyKey: string, settings: import('../../shared').BroadcastSettings): Promise<import('../../shared').ChannelDispatchResult>;
|
|
377
|
+
executeLiveEmailSend(payload: import('./services/transportService').EmailSendPayload, settings: import('../../shared').BroadcastSettings, effectiveTemplateRef: string, recipientMasked: string, idempotencyKey: string): Promise<import('../../shared').ChannelDispatchResult>;
|
|
378
|
+
sendEmailBroadcast(payload: import('./services/transportService').EmailSendPayload): Promise<import('../../shared').ChannelDispatchResult>;
|
|
379
|
+
sendTelegramBroadcast(payload: import('./services/transportService').TelegramSendPayload): Promise<import('../../shared').ChannelDispatchResult>;
|
|
380
|
+
sendWhatsAppBroadcast(payload: import('./services/transportService').WhatsAppSendPayload): Promise<import('../../shared').ChannelDispatchResult>;
|
|
381
|
+
};
|
|
382
|
+
campaignService: ({ strapi }: {
|
|
383
|
+
strapi: import("@strapi/strapi").Core.Strapi;
|
|
384
|
+
}) => {
|
|
385
|
+
getSettingsService(): {
|
|
386
|
+
getSettings(): Promise<import('../../shared').BroadcastSettings>;
|
|
387
|
+
};
|
|
388
|
+
getTransportService(): import('./services/campaignChannelDispatch').TransportServiceContract;
|
|
389
|
+
listCampaigns(params?: {
|
|
390
|
+
status?: string;
|
|
391
|
+
topic?: string;
|
|
392
|
+
}): Promise<import('../../shared').CampaignRecord[]>;
|
|
393
|
+
listPublicArchive(params?: {
|
|
394
|
+
topic?: string;
|
|
395
|
+
limit?: number;
|
|
396
|
+
}): Promise<{
|
|
397
|
+
slug: string;
|
|
398
|
+
title: string;
|
|
399
|
+
topic: string;
|
|
400
|
+
subject: string;
|
|
401
|
+
bodyText: string;
|
|
402
|
+
ctaLabel: string | undefined;
|
|
403
|
+
ctaUrl: string | undefined;
|
|
404
|
+
sentAt: string | undefined;
|
|
405
|
+
secondaryDateLabel: string | undefined;
|
|
406
|
+
translations: Record<string, import('../../shared').CampaignTranslation> | undefined;
|
|
407
|
+
}[]>;
|
|
408
|
+
getCampaignBySlug(slug: string): Promise<import('../../shared').CampaignRecord | null>;
|
|
409
|
+
findCampaignByDocIdOrSlug(documentIdOrSlug: string): Promise<import('../../shared').CampaignRecord | null>;
|
|
410
|
+
createCampaign(input: Partial<import('../../shared').CampaignRecord>): Promise<import('../../shared').CampaignRecord>;
|
|
411
|
+
updateCampaign(documentIdOrSlug: string, input: Partial<import('../../shared').CampaignRecord>): Promise<import('../../shared').CampaignRecord>;
|
|
412
|
+
createFromStarterTemplate(templateId: string): Promise<import('../../shared').CampaignRecord>;
|
|
413
|
+
seedStarterCampaigns(): Promise<number>;
|
|
414
|
+
resolveRecipientsForTopic(topic: string): Promise<import('../../shared').SubscriberRecipient[]>;
|
|
415
|
+
selectCampaignRecipients(campaign: import('../../shared').CampaignRecord, settings: import('../../shared').BroadcastSettings, options: import('./services/campaignLifecycle').RawDispatchOptions): Promise<{
|
|
416
|
+
isTestDispatch: boolean;
|
|
417
|
+
testTelegramChatId?: string;
|
|
418
|
+
recipients: import('../../shared').SubscriberRecipient[];
|
|
419
|
+
}>;
|
|
420
|
+
finalizeDispatchedCampaign(campaign: import('../../shared').CampaignRecord, secondaryDate: import('../../shared').CampaignRecord["secondaryDate"], secondaryDateLabel: string, stats: import('../../shared').CampaignStats): Promise<import('../../shared').CampaignRecord>;
|
|
421
|
+
dispatchCampaign(documentIdOrSlug: string, options?: {
|
|
422
|
+
customRecipients?: import('../../shared').SubscriberRecipient[];
|
|
423
|
+
testRecipientEmail?: string;
|
|
424
|
+
testRecipientPhone?: string;
|
|
425
|
+
testTelegramChatId?: string;
|
|
426
|
+
}): Promise<{
|
|
427
|
+
campaign: import('../../shared').CampaignRecord;
|
|
428
|
+
results: import('../../shared').ChannelDispatchResult[];
|
|
429
|
+
}>;
|
|
430
|
+
};
|
|
431
|
+
automationService: ({ strapi }: {
|
|
432
|
+
strapi: import("@strapi/strapi").Core.Strapi;
|
|
433
|
+
}) => {
|
|
434
|
+
getSettingsService(): {
|
|
435
|
+
getSettings(): Promise<import('../../shared').BroadcastSettings>;
|
|
436
|
+
};
|
|
437
|
+
getCampaignService(): {
|
|
438
|
+
createCampaign(input: Partial<import('../../shared').CampaignRecord>): Promise<import('../../shared').CampaignRecord>;
|
|
439
|
+
dispatchCampaign(documentIdOrSlug: string): Promise<{
|
|
440
|
+
campaign: import('../../shared').CampaignRecord;
|
|
441
|
+
results: import('../../shared').ChannelDispatchResult[];
|
|
442
|
+
}>;
|
|
443
|
+
};
|
|
444
|
+
listRules(): Promise<import('../../shared').AutomationRuleRecord[]>;
|
|
445
|
+
getRuleBySlug(slug: string): Promise<import('../../shared').AutomationRuleRecord | null>;
|
|
446
|
+
findRuleByDocIdOrSlug(documentIdOrSlug: string): Promise<import('../../shared').AutomationRuleRecord | null>;
|
|
447
|
+
createRule(input: Partial<import('../../shared').AutomationRuleRecord>): Promise<import('../../shared').AutomationRuleRecord>;
|
|
448
|
+
updateRule(documentIdOrSlug: string, input: Partial<import('../../shared').AutomationRuleRecord>): Promise<import('../../shared').AutomationRuleRecord>;
|
|
449
|
+
seedStarterRules(): Promise<number>;
|
|
450
|
+
executeSingleTriggerRule(rule: import('../../shared').AutomationRuleRecord, vars: Record<string, string | number | undefined>): Promise<{
|
|
451
|
+
ruleSlug: string;
|
|
452
|
+
campaignSlug: string;
|
|
453
|
+
results: import('../../shared').ChannelDispatchResult[];
|
|
454
|
+
}>;
|
|
455
|
+
handleEventTrigger(eventName: string, payload?: Record<string, unknown>): Promise<Array<{
|
|
456
|
+
ruleSlug: string;
|
|
457
|
+
campaignSlug: string;
|
|
458
|
+
results: import('../../shared').ChannelDispatchResult[];
|
|
459
|
+
}>>;
|
|
460
|
+
};
|
|
461
|
+
};
|
|
462
|
+
};
|
|
463
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
type: string;
|
|
3
|
+
routes: {
|
|
4
|
+
method: string;
|
|
5
|
+
path: string;
|
|
6
|
+
handler: string;
|
|
7
|
+
config: {
|
|
8
|
+
policies: (string | {
|
|
9
|
+
name: string;
|
|
10
|
+
config: {
|
|
11
|
+
actions: string[];
|
|
12
|
+
};
|
|
13
|
+
})[];
|
|
14
|
+
};
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"content-api": {
|
|
3
|
+
type: string;
|
|
4
|
+
routes: {
|
|
5
|
+
method: string;
|
|
6
|
+
path: string;
|
|
7
|
+
handler: string;
|
|
8
|
+
config: {
|
|
9
|
+
policies: never[];
|
|
10
|
+
auth: boolean;
|
|
11
|
+
};
|
|
12
|
+
}[];
|
|
13
|
+
};
|
|
14
|
+
admin: {
|
|
15
|
+
type: string;
|
|
16
|
+
routes: {
|
|
17
|
+
method: string;
|
|
18
|
+
path: string;
|
|
19
|
+
handler: string;
|
|
20
|
+
config: {
|
|
21
|
+
policies: (string | {
|
|
22
|
+
name: string;
|
|
23
|
+
config: {
|
|
24
|
+
actions: string[];
|
|
25
|
+
};
|
|
26
|
+
})[];
|
|
27
|
+
};
|
|
28
|
+
}[];
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Core } from '@strapi/strapi';
|
|
2
|
+
import { AutomationRuleRecord, BroadcastSettings, CampaignRecord, ChannelDispatchResult } from '../../../shared';
|
|
3
|
+
declare const createAutomationService: ({ strapi }: {
|
|
4
|
+
strapi: Core.Strapi;
|
|
5
|
+
}) => {
|
|
6
|
+
getSettingsService(): {
|
|
7
|
+
getSettings(): Promise<BroadcastSettings>;
|
|
8
|
+
};
|
|
9
|
+
getCampaignService(): {
|
|
10
|
+
createCampaign(input: Partial<CampaignRecord>): Promise<CampaignRecord>;
|
|
11
|
+
dispatchCampaign(documentIdOrSlug: string): Promise<{
|
|
12
|
+
campaign: CampaignRecord;
|
|
13
|
+
results: ChannelDispatchResult[];
|
|
14
|
+
}>;
|
|
15
|
+
};
|
|
16
|
+
listRules(): Promise<AutomationRuleRecord[]>;
|
|
17
|
+
getRuleBySlug(slug: string): Promise<AutomationRuleRecord | null>;
|
|
18
|
+
findRuleByDocIdOrSlug(documentIdOrSlug: string): Promise<AutomationRuleRecord | null>;
|
|
19
|
+
createRule(input: Partial<AutomationRuleRecord>): Promise<AutomationRuleRecord>;
|
|
20
|
+
updateRule(documentIdOrSlug: string, input: Partial<AutomationRuleRecord>): Promise<AutomationRuleRecord>;
|
|
21
|
+
seedStarterRules(): Promise<number>;
|
|
22
|
+
executeSingleTriggerRule(rule: AutomationRuleRecord, vars: Record<string, string | number | undefined>): Promise<{
|
|
23
|
+
ruleSlug: string;
|
|
24
|
+
campaignSlug: string;
|
|
25
|
+
results: ChannelDispatchResult[];
|
|
26
|
+
}>;
|
|
27
|
+
handleEventTrigger(eventName: string, payload?: Record<string, unknown>): Promise<Array<{
|
|
28
|
+
ruleSlug: string;
|
|
29
|
+
campaignSlug: string;
|
|
30
|
+
results: ChannelDispatchResult[];
|
|
31
|
+
}>>;
|
|
32
|
+
};
|
|
33
|
+
export default createAutomationService;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BroadcastChannel, BroadcastSettings, CampaignRecord, CampaignStats, ChannelDispatchResult, SubscriberRecipient } from '../../../shared';
|
|
2
|
+
import { EmailSendPayload, TelegramSendPayload, WhatsAppSendPayload } from './transportService';
|
|
3
|
+
export interface TransportServiceContract {
|
|
4
|
+
sendEmailBroadcast(payload: EmailSendPayload): Promise<ChannelDispatchResult>;
|
|
5
|
+
sendTelegramBroadcast(payload: TelegramSendPayload): Promise<ChannelDispatchResult>;
|
|
6
|
+
sendWhatsAppBroadcast(payload: WhatsAppSendPayload): Promise<ChannelDispatchResult>;
|
|
7
|
+
}
|
|
8
|
+
export declare function buildCampaignDocumentData(candidate: Partial<CampaignRecord>, channels: BroadcastChannel[], resolvedStatus?: CampaignRecord["status"]): Record<string, unknown>;
|
|
9
|
+
export declare function buildPresetCampaignPayload(preset: Partial<CampaignRecord>): Partial<CampaignRecord>;
|
|
10
|
+
export declare function mapRawSubscriber(sub: Record<string, unknown>, defaultLocale: string): SubscriberRecipient;
|
|
11
|
+
export declare function dispatchAllActiveChannels(params: {
|
|
12
|
+
transport: TransportServiceContract;
|
|
13
|
+
campaign: CampaignRecord;
|
|
14
|
+
settings: BroadcastSettings;
|
|
15
|
+
recipients: SubscriberRecipient[];
|
|
16
|
+
isTestDispatch: boolean;
|
|
17
|
+
testTelegramChatId?: string;
|
|
18
|
+
secondaryDateLabel: string;
|
|
19
|
+
stats: CampaignStats;
|
|
20
|
+
}): Promise<ChannelDispatchResult[]>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { normalizeWhatsAppTarget, BroadcastChannel, BroadcastSettings, CampaignRecord, CampaignStats, ChannelDispatchResult, SubscriberRecipient } from '../../../shared';
|
|
2
|
+
import { computeIdempotencyKey } from './idempotency';
|
|
3
|
+
import { EmailSendPayload, TelegramSendPayload, WhatsAppSendPayload } from './transportService';
|
|
4
|
+
export { computeIdempotencyKey };
|
|
5
|
+
export declare function clampLimit(val: unknown, defaultLimit: number): number;
|
|
6
|
+
export declare function buildTelegramIdempotencyKey(payload: TelegramSendPayload, targetChatId: string): string;
|
|
7
|
+
export declare function makeResult(channel: BroadcastChannel, driver: string, recipientMasked: string, locale: string, status: ChannelDispatchResult["status"], idempotencyKey: string, extra?: Partial<ChannelDispatchResult>): ChannelDispatchResult;
|
|
8
|
+
export declare function parseTargetList(raw?: string | string[]): string[];
|
|
9
|
+
export declare function resolveTelegramTargets(campaign: CampaignRecord, settings: BroadcastSettings): string[];
|
|
10
|
+
export declare function resolveWhatsAppRecipients(campaign: CampaignRecord, settings: BroadcastSettings, subscribers: SubscriberRecipient[], isTestDispatch: boolean): SubscriberRecipient[];
|
|
11
|
+
export declare function createEmptyStats(): CampaignStats;
|
|
12
|
+
export declare function recordResultInStats(stats: CampaignStats, result: ChannelDispatchResult): void;
|
|
13
|
+
export declare function resolveEffectiveEmailTemplateRef(payload: EmailSendPayload, settings: BroadcastSettings): string;
|
|
14
|
+
export declare function buildEmailTemplateVariables(payload: EmailSendPayload, settings: BroadcastSettings, inlineHtml: string): Record<string, string | number | undefined>;
|
|
15
|
+
export declare function buildTelegramRequestPayload(payload: TelegramSendPayload, targetChatId: string): Record<string, unknown>;
|
|
16
|
+
export declare function executeTelegramHttpSend(payload: TelegramSendPayload, targetChatId: string, botToken: string): Promise<string>;
|
|
17
|
+
export declare function sendViaMetaCloudApi(payload: WhatsAppSendPayload, settings: BroadcastSettings, evolutionNumber: string, fullText: string): Promise<string>;
|
|
18
|
+
export declare function sendViaSelfHostedGateway(driver: string, settings: BroadcastSettings, target: ReturnType<typeof normalizeWhatsAppTarget>, fullText: string): Promise<string>;
|
|
19
|
+
export declare function executeWhatsAppHttpSend(driver: string, payload: WhatsAppSendPayload, settings: BroadcastSettings, target: ReturnType<typeof normalizeWhatsAppTarget>): Promise<string>;
|
|
20
|
+
export declare function hasWhatsAppCredentials(driver: string, settings: BroadcastSettings): boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BroadcastSettings, CampaignRecord, CampaignStatus, SubscriberRecipient } from '../../../shared';
|
|
2
|
+
export declare function resolveInitialStatus(rawStatus: CampaignStatus | undefined): CampaignStatus;
|
|
3
|
+
export declare function resolveUpdatedStatus(currentStatus: CampaignStatus, requestedStatus: CampaignStatus | undefined): CampaignStatus;
|
|
4
|
+
export declare function computeCampaignSecondaryDate(campaign: CampaignRecord, settings: BroadcastSettings): NonNullable<CampaignRecord["secondaryDate"]>;
|
|
5
|
+
export interface RawDispatchOptions {
|
|
6
|
+
customRecipients?: unknown;
|
|
7
|
+
testRecipientEmail?: unknown;
|
|
8
|
+
testRecipientPhone?: unknown;
|
|
9
|
+
testTelegramChatId?: unknown;
|
|
10
|
+
}
|
|
11
|
+
export interface SanitizedDispatchOptions {
|
|
12
|
+
hasCustomRecipientsList: boolean;
|
|
13
|
+
customRecipients: SubscriberRecipient[];
|
|
14
|
+
testRecipientEmail?: string;
|
|
15
|
+
testRecipientPhone?: string;
|
|
16
|
+
testTelegramChatId?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function sanitizeDispatchOptions(rawOptions: RawDispatchOptions | undefined, defaultLocale: string): SanitizedDispatchOptions;
|
|
19
|
+
export declare function buildSelectedRecipients(campaign: CampaignRecord, settings: BroadcastSettings, options: RawDispatchOptions, resolveTopicRecipients: (topic: string) => Promise<SubscriberRecipient[]>): Promise<{
|
|
20
|
+
isTestDispatch: boolean;
|
|
21
|
+
testTelegramChatId?: string;
|
|
22
|
+
recipients: SubscriberRecipient[];
|
|
23
|
+
}>;
|