@23blocks/block-onboarding 1.0.4 → 2.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/dist/index.esm.js +438 -75
- package/dist/src/lib/mappers/index.d.ts +4 -1
- package/dist/src/lib/mappers/index.d.ts.map +1 -1
- package/dist/src/lib/mappers/mail-template.mapper.d.ts +4 -0
- package/dist/src/lib/mappers/mail-template.mapper.d.ts.map +1 -0
- package/dist/src/lib/mappers/onboard.mapper.d.ts +4 -0
- package/dist/src/lib/mappers/onboard.mapper.d.ts.map +1 -0
- package/dist/src/lib/mappers/step.mapper.d.ts +4 -0
- package/dist/src/lib/mappers/step.mapper.d.ts.map +1 -0
- package/dist/src/lib/onboarding.block.d.ts +4 -1
- package/dist/src/lib/onboarding.block.d.ts.map +1 -1
- package/dist/src/lib/services/flows.service.d.ts +2 -0
- package/dist/src/lib/services/flows.service.d.ts.map +1 -1
- package/dist/src/lib/services/index.d.ts +3 -0
- package/dist/src/lib/services/index.d.ts.map +1 -1
- package/dist/src/lib/services/mail-templates.service.d.ts +16 -0
- package/dist/src/lib/services/mail-templates.service.d.ts.map +1 -0
- package/dist/src/lib/services/onboard.service.d.ts +15 -0
- package/dist/src/lib/services/onboard.service.d.ts.map +1 -0
- package/dist/src/lib/services/onboardings.service.d.ts +5 -0
- package/dist/src/lib/services/onboardings.service.d.ts.map +1 -1
- package/dist/src/lib/services/remarketing.service.d.ts +9 -0
- package/dist/src/lib/services/remarketing.service.d.ts.map +1 -0
- package/dist/src/lib/services/user-identities.service.d.ts.map +1 -1
- package/dist/src/lib/services/user-journeys.service.d.ts +4 -0
- package/dist/src/lib/services/user-journeys.service.d.ts.map +1 -1
- package/dist/src/lib/types/index.d.ts +5 -0
- package/dist/src/lib/types/index.d.ts.map +1 -1
- package/dist/src/lib/types/mail-template.d.ts +72 -0
- package/dist/src/lib/types/mail-template.d.ts.map +1 -0
- package/dist/src/lib/types/onboard.d.ts +48 -0
- package/dist/src/lib/types/onboard.d.ts.map +1 -0
- package/dist/src/lib/types/remarketing.d.ts +17 -0
- package/dist/src/lib/types/remarketing.d.ts.map +1 -0
- package/dist/src/lib/types/report.d.ts +41 -0
- package/dist/src/lib/types/report.d.ts.map +1 -0
- package/dist/src/lib/types/step.d.ts +26 -0
- package/dist/src/lib/types/step.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { decodeOne, decodePageResult, decodeMany } from '@23blocks/jsonapi-codec';
|
|
2
|
+
import { _ } from '@swc/helpers/_/_extends';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Parse a string value, returning undefined for empty/undefined
|
|
@@ -113,6 +114,23 @@ const onboardingMapper = {
|
|
|
113
114
|
})
|
|
114
115
|
};
|
|
115
116
|
|
|
117
|
+
const onboardingStepMapper = {
|
|
118
|
+
type: 'onboarding_step',
|
|
119
|
+
map: (resource)=>({
|
|
120
|
+
id: resource.id,
|
|
121
|
+
uniqueId: resource.attributes['unique_id'],
|
|
122
|
+
onboardingUniqueId: resource.attributes['onboarding_unique_id'],
|
|
123
|
+
stepNumber: resource.attributes['step_number'],
|
|
124
|
+
name: resource.attributes['name'],
|
|
125
|
+
description: resource.attributes['description'],
|
|
126
|
+
type: resource.attributes['type'],
|
|
127
|
+
config: resource.attributes['config'],
|
|
128
|
+
payload: resource.attributes['payload'],
|
|
129
|
+
createdAt: parseDate(resource.attributes['created_at']),
|
|
130
|
+
updatedAt: parseDate(resource.attributes['updated_at'])
|
|
131
|
+
})
|
|
132
|
+
};
|
|
133
|
+
|
|
116
134
|
function createOnboardingsService(transport, _config) {
|
|
117
135
|
return {
|
|
118
136
|
async list (params) {
|
|
@@ -134,37 +152,65 @@ function createOnboardingsService(transport, _config) {
|
|
|
134
152
|
},
|
|
135
153
|
async create (data) {
|
|
136
154
|
const response = await transport.post('/onboardings', {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
steps: data.steps,
|
|
144
|
-
payload: data.payload
|
|
145
|
-
}
|
|
155
|
+
onboarding: {
|
|
156
|
+
code: data.code,
|
|
157
|
+
name: data.name,
|
|
158
|
+
description: data.description,
|
|
159
|
+
steps: data.steps,
|
|
160
|
+
payload: data.payload
|
|
146
161
|
}
|
|
147
162
|
});
|
|
148
163
|
return decodeOne(response, onboardingMapper);
|
|
149
164
|
},
|
|
150
165
|
async update (uniqueId, data) {
|
|
151
166
|
const response = await transport.put(`/onboardings/${uniqueId}`, {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
status: data.status,
|
|
160
|
-
payload: data.payload
|
|
161
|
-
}
|
|
167
|
+
onboarding: {
|
|
168
|
+
name: data.name,
|
|
169
|
+
description: data.description,
|
|
170
|
+
steps: data.steps,
|
|
171
|
+
enabled: data.enabled,
|
|
172
|
+
status: data.status,
|
|
173
|
+
payload: data.payload
|
|
162
174
|
}
|
|
163
175
|
});
|
|
164
176
|
return decodeOne(response, onboardingMapper);
|
|
165
177
|
},
|
|
166
178
|
async delete (uniqueId) {
|
|
167
179
|
await transport.delete(`/onboardings/${uniqueId}`);
|
|
180
|
+
},
|
|
181
|
+
async addStep (uniqueId, data) {
|
|
182
|
+
const response = await transport.put(`/onboardings/${uniqueId}/steps`, {
|
|
183
|
+
step: {
|
|
184
|
+
step_number: data.stepNumber,
|
|
185
|
+
name: data.name,
|
|
186
|
+
description: data.description,
|
|
187
|
+
type: data.type,
|
|
188
|
+
config: data.config,
|
|
189
|
+
payload: data.payload
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
return decodeOne(response, onboardingStepMapper);
|
|
193
|
+
},
|
|
194
|
+
async updateStep (uniqueId, stepUniqueId, data) {
|
|
195
|
+
const response = await transport.put(`/onboardings/${uniqueId}/steps/${stepUniqueId}`, {
|
|
196
|
+
step: {
|
|
197
|
+
name: data.name,
|
|
198
|
+
description: data.description,
|
|
199
|
+
type: data.type,
|
|
200
|
+
config: data.config,
|
|
201
|
+
payload: data.payload
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
return decodeOne(response, onboardingStepMapper);
|
|
205
|
+
},
|
|
206
|
+
async deleteStep (uniqueId, stepUniqueId) {
|
|
207
|
+
await transport.delete(`/onboardings/${uniqueId}/steps/${stepUniqueId}`);
|
|
208
|
+
},
|
|
209
|
+
async stepUser (uniqueId, userUniqueId, stepData) {
|
|
210
|
+
const response = await transport.put(`/onboardings/${uniqueId}/users/${userUniqueId}`, {
|
|
211
|
+
step_data: stepData
|
|
212
|
+
});
|
|
213
|
+
return decodeOne(response, onboardingMapper);
|
|
168
214
|
}
|
|
169
215
|
};
|
|
170
216
|
}
|
|
@@ -210,34 +256,28 @@ function createFlowsService(transport, _config) {
|
|
|
210
256
|
},
|
|
211
257
|
async create (data) {
|
|
212
258
|
const response = await transport.post('/flows', {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
conditions: data.conditions,
|
|
222
|
-
payload: data.payload
|
|
223
|
-
}
|
|
259
|
+
flow: {
|
|
260
|
+
onboarding_unique_id: data.onboardingUniqueId,
|
|
261
|
+
code: data.code,
|
|
262
|
+
name: data.name,
|
|
263
|
+
description: data.description,
|
|
264
|
+
steps: data.steps,
|
|
265
|
+
conditions: data.conditions,
|
|
266
|
+
payload: data.payload
|
|
224
267
|
}
|
|
225
268
|
});
|
|
226
269
|
return decodeOne(response, flowMapper);
|
|
227
270
|
},
|
|
228
271
|
async update (uniqueId, data) {
|
|
229
272
|
const response = await transport.put(`/flows/${uniqueId}`, {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
status: data.status,
|
|
239
|
-
payload: data.payload
|
|
240
|
-
}
|
|
273
|
+
flow: {
|
|
274
|
+
name: data.name,
|
|
275
|
+
description: data.description,
|
|
276
|
+
steps: data.steps,
|
|
277
|
+
conditions: data.conditions,
|
|
278
|
+
enabled: data.enabled,
|
|
279
|
+
status: data.status,
|
|
280
|
+
payload: data.payload
|
|
241
281
|
}
|
|
242
282
|
});
|
|
243
283
|
return decodeOne(response, flowMapper);
|
|
@@ -248,6 +288,16 @@ function createFlowsService(transport, _config) {
|
|
|
248
288
|
async listByOnboarding (onboardingUniqueId) {
|
|
249
289
|
const response = await transport.get(`/onboardings/${onboardingUniqueId}/flows`);
|
|
250
290
|
return decodeMany(response, flowMapper);
|
|
291
|
+
},
|
|
292
|
+
async getBySource (uniqueId, sourceUniqueId) {
|
|
293
|
+
const response = await transport.get(`/flows/${uniqueId}/sources/${sourceUniqueId}`);
|
|
294
|
+
return decodeOne(response, flowMapper);
|
|
295
|
+
},
|
|
296
|
+
async stepBySource (uniqueId, sourceUniqueId, stepData) {
|
|
297
|
+
const response = await transport.put(`/flows/${uniqueId}/sources/${sourceUniqueId}`, {
|
|
298
|
+
step_data: stepData
|
|
299
|
+
});
|
|
300
|
+
return decodeOne(response, flowMapper);
|
|
251
301
|
}
|
|
252
302
|
};
|
|
253
303
|
}
|
|
@@ -294,36 +344,27 @@ function createUserJourneysService(transport, _config) {
|
|
|
294
344
|
},
|
|
295
345
|
async start (data) {
|
|
296
346
|
const response = await transport.post('/user_journeys', {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
flow_unique_id: data.flowUniqueId,
|
|
303
|
-
payload: data.payload
|
|
304
|
-
}
|
|
347
|
+
user_journey: {
|
|
348
|
+
user_unique_id: data.userUniqueId,
|
|
349
|
+
onboarding_unique_id: data.onboardingUniqueId,
|
|
350
|
+
flow_unique_id: data.flowUniqueId,
|
|
351
|
+
payload: data.payload
|
|
305
352
|
}
|
|
306
353
|
});
|
|
307
354
|
return decodeOne(response, userJourneyMapper);
|
|
308
355
|
},
|
|
309
356
|
async completeStep (uniqueId, data) {
|
|
310
357
|
const response = await transport.post(`/user_journeys/${uniqueId}/complete_step`, {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
step_number: data.stepNumber,
|
|
315
|
-
step_data: data.stepData
|
|
316
|
-
}
|
|
358
|
+
user_journey: {
|
|
359
|
+
step_number: data.stepNumber,
|
|
360
|
+
step_data: data.stepData
|
|
317
361
|
}
|
|
318
362
|
});
|
|
319
363
|
return decodeOne(response, userJourneyMapper);
|
|
320
364
|
},
|
|
321
365
|
async abandon (uniqueId) {
|
|
322
366
|
const response = await transport.put(`/user_journeys/${uniqueId}/abandon`, {
|
|
323
|
-
|
|
324
|
-
type: 'UserJourney',
|
|
325
|
-
attributes: {}
|
|
326
|
-
}
|
|
367
|
+
user_journey: {}
|
|
327
368
|
});
|
|
328
369
|
return decodeOne(response, userJourneyMapper);
|
|
329
370
|
},
|
|
@@ -339,6 +380,71 @@ function createUserJourneysService(transport, _config) {
|
|
|
339
380
|
currentStep: data.data.attributes.current_step,
|
|
340
381
|
completedSteps: data.data.attributes.completed_steps
|
|
341
382
|
};
|
|
383
|
+
},
|
|
384
|
+
async listByUserAndOnboarding (userUniqueId, onboardingUniqueId) {
|
|
385
|
+
const response = await transport.get(`/users/${userUniqueId}/onboardings/${onboardingUniqueId}`);
|
|
386
|
+
return decodeOne(response, userJourneyMapper);
|
|
387
|
+
},
|
|
388
|
+
async reportList (params) {
|
|
389
|
+
const response = await transport.post('/reports/user_journeys/list', {
|
|
390
|
+
start_date: params.startDate,
|
|
391
|
+
end_date: params.endDate,
|
|
392
|
+
onboarding_unique_id: params.onboardingUniqueId,
|
|
393
|
+
status: params.status,
|
|
394
|
+
page: params.page,
|
|
395
|
+
per_page: params.perPage
|
|
396
|
+
});
|
|
397
|
+
return {
|
|
398
|
+
journeys: (response.journeys || []).map((j)=>({
|
|
399
|
+
uniqueId: j.unique_id,
|
|
400
|
+
userUniqueId: j.user_unique_id,
|
|
401
|
+
onboardingName: j.onboarding_name,
|
|
402
|
+
progress: j.progress,
|
|
403
|
+
status: j.status,
|
|
404
|
+
startedAt: new Date(j.started_at),
|
|
405
|
+
completedAt: j.completed_at ? new Date(j.completed_at) : undefined
|
|
406
|
+
})),
|
|
407
|
+
summary: {
|
|
408
|
+
totalJourneys: response.summary.total_journeys,
|
|
409
|
+
totalCompleted: response.summary.total_completed,
|
|
410
|
+
totalAbandoned: response.summary.total_abandoned,
|
|
411
|
+
totalActive: response.summary.total_active,
|
|
412
|
+
averageProgress: response.summary.average_progress,
|
|
413
|
+
completionRate: response.summary.completion_rate,
|
|
414
|
+
journeysByStatus: response.summary.journeys_by_status,
|
|
415
|
+
period: {
|
|
416
|
+
startDate: new Date(response.summary.period.start_date),
|
|
417
|
+
endDate: new Date(response.summary.period.end_date)
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
meta: {
|
|
421
|
+
totalCount: response.meta.total_count,
|
|
422
|
+
page: response.meta.page,
|
|
423
|
+
perPage: response.meta.per_page,
|
|
424
|
+
totalPages: response.meta.total_pages
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
},
|
|
428
|
+
async reportSummary (params) {
|
|
429
|
+
const response = await transport.post('/reports/user_journeys/summary', {
|
|
430
|
+
start_date: params.startDate,
|
|
431
|
+
end_date: params.endDate,
|
|
432
|
+
onboarding_unique_id: params.onboardingUniqueId,
|
|
433
|
+
status: params.status
|
|
434
|
+
});
|
|
435
|
+
return {
|
|
436
|
+
totalJourneys: response.total_journeys,
|
|
437
|
+
totalCompleted: response.total_completed,
|
|
438
|
+
totalAbandoned: response.total_abandoned,
|
|
439
|
+
totalActive: response.total_active,
|
|
440
|
+
averageProgress: response.average_progress,
|
|
441
|
+
completionRate: response.completion_rate,
|
|
442
|
+
journeysByStatus: response.journeys_by_status,
|
|
443
|
+
period: {
|
|
444
|
+
startDate: new Date(response.period.start_date),
|
|
445
|
+
endDate: new Date(response.period.end_date)
|
|
446
|
+
}
|
|
447
|
+
};
|
|
342
448
|
}
|
|
343
449
|
};
|
|
344
450
|
}
|
|
@@ -383,26 +489,20 @@ function createUserIdentitiesService(transport, _config) {
|
|
|
383
489
|
},
|
|
384
490
|
async create (data) {
|
|
385
491
|
const response = await transport.post('/user_identities', {
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
identity_value: data.identityValue,
|
|
392
|
-
payload: data.payload
|
|
393
|
-
}
|
|
492
|
+
user_identity: {
|
|
493
|
+
user_unique_id: data.userUniqueId,
|
|
494
|
+
identity_type: data.identityType,
|
|
495
|
+
identity_value: data.identityValue,
|
|
496
|
+
payload: data.payload
|
|
394
497
|
}
|
|
395
498
|
});
|
|
396
499
|
return decodeOne(response, userIdentityMapper);
|
|
397
500
|
},
|
|
398
501
|
async verify (uniqueId, data) {
|
|
399
502
|
const response = await transport.post(`/user_identities/${uniqueId}/verify`, {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
verification_code: data.verificationCode,
|
|
404
|
-
verification_data: data.verificationData
|
|
405
|
-
}
|
|
503
|
+
user_identity: {
|
|
504
|
+
verification_code: data.verificationCode,
|
|
505
|
+
verification_data: data.verificationData
|
|
406
506
|
}
|
|
407
507
|
});
|
|
408
508
|
return decodeOne(response, userIdentityMapper);
|
|
@@ -417,12 +517,274 @@ function createUserIdentitiesService(transport, _config) {
|
|
|
417
517
|
};
|
|
418
518
|
}
|
|
419
519
|
|
|
520
|
+
const onboardJourneyMapper = {
|
|
521
|
+
type: 'onboard_journey',
|
|
522
|
+
map: (resource)=>({
|
|
523
|
+
id: resource.id,
|
|
524
|
+
uniqueId: resource.attributes['unique_id'],
|
|
525
|
+
userUniqueId: resource.attributes['user_unique_id'],
|
|
526
|
+
onboardingUniqueId: resource.attributes['onboarding_unique_id'],
|
|
527
|
+
currentStep: resource.attributes['current_step'],
|
|
528
|
+
completedSteps: resource.attributes['completed_steps'] || [],
|
|
529
|
+
status: resource.attributes['status'],
|
|
530
|
+
progress: resource.attributes['progress'] || 0,
|
|
531
|
+
startedAt: parseDate(resource.attributes['started_at']),
|
|
532
|
+
completedAt: resource.attributes['completed_at'] ? parseDate(resource.attributes['completed_at']) : undefined,
|
|
533
|
+
suspendedAt: resource.attributes['suspended_at'] ? parseDate(resource.attributes['suspended_at']) : undefined,
|
|
534
|
+
payload: resource.attributes['payload'],
|
|
535
|
+
createdAt: parseDate(resource.attributes['created_at']),
|
|
536
|
+
updatedAt: parseDate(resource.attributes['updated_at'])
|
|
537
|
+
})
|
|
538
|
+
};
|
|
539
|
+
|
|
540
|
+
function createOnboardService(transport, _config) {
|
|
541
|
+
return {
|
|
542
|
+
async start (uniqueId, data) {
|
|
543
|
+
const response = await transport.post(`/onboard/${uniqueId}/start`, {
|
|
544
|
+
onboard: {
|
|
545
|
+
onboarding_unique_id: data == null ? void 0 : data.onboardingUniqueId,
|
|
546
|
+
payload: data == null ? void 0 : data.payload
|
|
547
|
+
}
|
|
548
|
+
});
|
|
549
|
+
return decodeOne(response, onboardJourneyMapper);
|
|
550
|
+
},
|
|
551
|
+
async get (uniqueId) {
|
|
552
|
+
const response = await transport.get(`/onboard/${uniqueId}`);
|
|
553
|
+
return decodeOne(response, onboardJourneyMapper);
|
|
554
|
+
},
|
|
555
|
+
async getDetails (uniqueId) {
|
|
556
|
+
var _response_data_attributes, _response_data, _response_data_attributes1, _response_data1, _response_data_attributes2, _response_data2;
|
|
557
|
+
const response = await transport.get(`/onboard/${uniqueId}/details`);
|
|
558
|
+
const base = decodeOne(response, onboardJourneyMapper);
|
|
559
|
+
return _({}, base, {
|
|
560
|
+
onboardingName: (_response_data = response.data) == null ? void 0 : (_response_data_attributes = _response_data.attributes) == null ? void 0 : _response_data_attributes.onboarding_name,
|
|
561
|
+
steps: (((_response_data1 = response.data) == null ? void 0 : (_response_data_attributes1 = _response_data1.attributes) == null ? void 0 : _response_data_attributes1.steps) || []).map((s)=>({
|
|
562
|
+
stepNumber: s.step_number,
|
|
563
|
+
stepName: s.step_name,
|
|
564
|
+
completed: s.completed,
|
|
565
|
+
completedAt: s.completed_at ? new Date(s.completed_at) : undefined,
|
|
566
|
+
data: s.data
|
|
567
|
+
})),
|
|
568
|
+
logs: (((_response_data2 = response.data) == null ? void 0 : (_response_data_attributes2 = _response_data2.attributes) == null ? void 0 : _response_data_attributes2.logs) || []).map((l)=>({
|
|
569
|
+
uniqueId: l.unique_id,
|
|
570
|
+
action: l.action,
|
|
571
|
+
stepNumber: l.step_number,
|
|
572
|
+
message: l.message,
|
|
573
|
+
payload: l.payload,
|
|
574
|
+
createdAt: new Date(l.created_at)
|
|
575
|
+
}))
|
|
576
|
+
});
|
|
577
|
+
},
|
|
578
|
+
async step (uniqueId, data) {
|
|
579
|
+
const response = await transport.put(`/onboard/${uniqueId}`, {
|
|
580
|
+
step: {
|
|
581
|
+
step_number: data.stepNumber,
|
|
582
|
+
step_data: data.stepData
|
|
583
|
+
}
|
|
584
|
+
});
|
|
585
|
+
return decodeOne(response, onboardJourneyMapper);
|
|
586
|
+
},
|
|
587
|
+
async log (uniqueId, data) {
|
|
588
|
+
const response = await transport.put(`/onboard/${uniqueId}/log`, {
|
|
589
|
+
log: {
|
|
590
|
+
action: data.action,
|
|
591
|
+
step_number: data.stepNumber,
|
|
592
|
+
message: data.message,
|
|
593
|
+
payload: data.payload
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
return decodeOne(response, onboardJourneyMapper);
|
|
597
|
+
},
|
|
598
|
+
async suspend (uniqueId) {
|
|
599
|
+
const response = await transport.put(`/onboard/${uniqueId}/suspend`, {});
|
|
600
|
+
return decodeOne(response, onboardJourneyMapper);
|
|
601
|
+
},
|
|
602
|
+
async resume (uniqueId) {
|
|
603
|
+
const response = await transport.put(`/onboard/${uniqueId}/resume`, {});
|
|
604
|
+
return decodeOne(response, onboardJourneyMapper);
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
const mailTemplateMapper = {
|
|
610
|
+
type: 'mail_template',
|
|
611
|
+
map: (resource)=>{
|
|
612
|
+
var _resource_attributes_enabled;
|
|
613
|
+
return {
|
|
614
|
+
id: resource.id,
|
|
615
|
+
uniqueId: resource.attributes['unique_id'],
|
|
616
|
+
code: resource.attributes['code'],
|
|
617
|
+
name: resource.attributes['name'],
|
|
618
|
+
subject: resource.attributes['subject'],
|
|
619
|
+
fromEmail: resource.attributes['from_email'],
|
|
620
|
+
fromName: resource.attributes['from_name'],
|
|
621
|
+
htmlContent: resource.attributes['html_content'],
|
|
622
|
+
textContent: resource.attributes['text_content'],
|
|
623
|
+
mandrillSlug: resource.attributes['mandrill_slug'],
|
|
624
|
+
status: parseStatus(resource.attributes['status']),
|
|
625
|
+
enabled: (_resource_attributes_enabled = resource.attributes['enabled']) != null ? _resource_attributes_enabled : true,
|
|
626
|
+
payload: resource.attributes['payload'],
|
|
627
|
+
createdAt: parseDate(resource.attributes['created_at']),
|
|
628
|
+
updatedAt: parseDate(resource.attributes['updated_at'])
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
};
|
|
632
|
+
|
|
633
|
+
function createMailTemplatesService(transport, _config) {
|
|
634
|
+
return {
|
|
635
|
+
async list (params) {
|
|
636
|
+
const queryParams = {};
|
|
637
|
+
if (params == null ? void 0 : params.page) queryParams['page'] = String(params.page);
|
|
638
|
+
if (params == null ? void 0 : params.perPage) queryParams['records'] = String(params.perPage);
|
|
639
|
+
if (params == null ? void 0 : params.status) queryParams['status'] = params.status;
|
|
640
|
+
if (params == null ? void 0 : params.search) queryParams['search'] = params.search;
|
|
641
|
+
const response = await transport.get('/mailtemplates', {
|
|
642
|
+
params: queryParams
|
|
643
|
+
});
|
|
644
|
+
return decodePageResult(response, mailTemplateMapper);
|
|
645
|
+
},
|
|
646
|
+
async get (uniqueId) {
|
|
647
|
+
const response = await transport.get(`/mailtemplates/${uniqueId}`);
|
|
648
|
+
return decodeOne(response, mailTemplateMapper);
|
|
649
|
+
},
|
|
650
|
+
async create (data) {
|
|
651
|
+
const response = await transport.post('/mailtemplates', {
|
|
652
|
+
mail_template: {
|
|
653
|
+
code: data.code,
|
|
654
|
+
name: data.name,
|
|
655
|
+
subject: data.subject,
|
|
656
|
+
from_email: data.fromEmail,
|
|
657
|
+
from_name: data.fromName,
|
|
658
|
+
html_content: data.htmlContent,
|
|
659
|
+
text_content: data.textContent,
|
|
660
|
+
payload: data.payload
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
return decodeOne(response, mailTemplateMapper);
|
|
664
|
+
},
|
|
665
|
+
async update (uniqueId, data) {
|
|
666
|
+
const response = await transport.put(`/mailtemplates/${uniqueId}`, {
|
|
667
|
+
mail_template: {
|
|
668
|
+
name: data.name,
|
|
669
|
+
subject: data.subject,
|
|
670
|
+
from_email: data.fromEmail,
|
|
671
|
+
from_name: data.fromName,
|
|
672
|
+
html_content: data.htmlContent,
|
|
673
|
+
text_content: data.textContent,
|
|
674
|
+
enabled: data.enabled,
|
|
675
|
+
status: data.status,
|
|
676
|
+
payload: data.payload
|
|
677
|
+
}
|
|
678
|
+
});
|
|
679
|
+
return decodeOne(response, mailTemplateMapper);
|
|
680
|
+
},
|
|
681
|
+
async getMandrillStats (uniqueId) {
|
|
682
|
+
const response = await transport.get(`/mailtemplates/${uniqueId}/mandrill/stats`);
|
|
683
|
+
return {
|
|
684
|
+
slug: response.slug,
|
|
685
|
+
name: response.name,
|
|
686
|
+
sentCount: response.sent_count || 0,
|
|
687
|
+
openCount: response.open_count || 0,
|
|
688
|
+
clickCount: response.click_count || 0,
|
|
689
|
+
bounceCount: response.bounce_count || 0,
|
|
690
|
+
complaintCount: response.complaint_count || 0,
|
|
691
|
+
createdAt: new Date(response.created_at),
|
|
692
|
+
updatedAt: new Date(response.updated_at)
|
|
693
|
+
};
|
|
694
|
+
},
|
|
695
|
+
async createMandrillTemplate (uniqueId, data) {
|
|
696
|
+
const response = await transport.post(`/mailtemplates/${uniqueId}/mandrill`, {
|
|
697
|
+
mandrill: {
|
|
698
|
+
name: data.name,
|
|
699
|
+
from_email: data.fromEmail,
|
|
700
|
+
from_name: data.fromName,
|
|
701
|
+
subject: data.subject,
|
|
702
|
+
code: data.code,
|
|
703
|
+
text: data.text,
|
|
704
|
+
publish: data.publish,
|
|
705
|
+
labels: data.labels
|
|
706
|
+
}
|
|
707
|
+
});
|
|
708
|
+
return decodeOne(response, mailTemplateMapper);
|
|
709
|
+
},
|
|
710
|
+
async updateMandrillTemplate (uniqueId, data) {
|
|
711
|
+
const response = await transport.put(`/mailtemplates/${uniqueId}/mandrill`, {
|
|
712
|
+
mandrill: {
|
|
713
|
+
from_email: data.fromEmail,
|
|
714
|
+
from_name: data.fromName,
|
|
715
|
+
subject: data.subject,
|
|
716
|
+
code: data.code,
|
|
717
|
+
text: data.text,
|
|
718
|
+
publish: data.publish,
|
|
719
|
+
labels: data.labels
|
|
720
|
+
}
|
|
721
|
+
});
|
|
722
|
+
return decodeOne(response, mailTemplateMapper);
|
|
723
|
+
},
|
|
724
|
+
async publishMandrill (uniqueId) {
|
|
725
|
+
const response = await transport.put(`/mailtemplates/${uniqueId}/mandrill/publish`, {});
|
|
726
|
+
return decodeOne(response, mailTemplateMapper);
|
|
727
|
+
}
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
function createRemarketingService(transport, _config) {
|
|
732
|
+
return {
|
|
733
|
+
async listAbandonedJourneys (params) {
|
|
734
|
+
var _response_meta, _response_meta1, _response_meta2, _response_meta3;
|
|
735
|
+
const queryParams = {};
|
|
736
|
+
if (params == null ? void 0 : params.page) queryParams['page'] = String(params.page);
|
|
737
|
+
if (params == null ? void 0 : params.perPage) queryParams['records'] = String(params.perPage);
|
|
738
|
+
if (params == null ? void 0 : params.onboardingUniqueId) queryParams['onboarding_unique_id'] = params.onboardingUniqueId;
|
|
739
|
+
if ((params == null ? void 0 : params.minProgress) !== undefined) queryParams['min_progress'] = String(params.minProgress);
|
|
740
|
+
if ((params == null ? void 0 : params.maxProgress) !== undefined) queryParams['max_progress'] = String(params.maxProgress);
|
|
741
|
+
if (params == null ? void 0 : params.abandonedAfter) queryParams['abandoned_after'] = params.abandonedAfter.toISOString();
|
|
742
|
+
if (params == null ? void 0 : params.abandonedBefore) queryParams['abandoned_before'] = params.abandonedBefore.toISOString();
|
|
743
|
+
const response = await transport.get('/tools/remarketing/abandoned_journeys', {
|
|
744
|
+
params: queryParams
|
|
745
|
+
});
|
|
746
|
+
const data = response.data || [];
|
|
747
|
+
return {
|
|
748
|
+
data: data.map((j)=>({
|
|
749
|
+
id: j.id,
|
|
750
|
+
uniqueId: j.unique_id,
|
|
751
|
+
userUniqueId: j.user_unique_id,
|
|
752
|
+
onboardingUniqueId: j.onboarding_unique_id,
|
|
753
|
+
currentStep: j.current_step,
|
|
754
|
+
completedSteps: j.completed_steps || [],
|
|
755
|
+
status: j.status,
|
|
756
|
+
progress: j.progress || 0,
|
|
757
|
+
startedAt: new Date(j.started_at),
|
|
758
|
+
completedAt: j.completed_at ? new Date(j.completed_at) : undefined,
|
|
759
|
+
suspendedAt: j.suspended_at ? new Date(j.suspended_at) : undefined,
|
|
760
|
+
userEmail: j.user_email,
|
|
761
|
+
userName: j.user_name,
|
|
762
|
+
abandonedAt: new Date(j.abandoned_at || j.updated_at),
|
|
763
|
+
lastStepName: j.last_step_name,
|
|
764
|
+
payload: j.payload,
|
|
765
|
+
createdAt: new Date(j.created_at),
|
|
766
|
+
updatedAt: new Date(j.updated_at)
|
|
767
|
+
})),
|
|
768
|
+
meta: {
|
|
769
|
+
totalCount: ((_response_meta = response.meta) == null ? void 0 : _response_meta.total_count) || data.length,
|
|
770
|
+
page: ((_response_meta1 = response.meta) == null ? void 0 : _response_meta1.page) || 1,
|
|
771
|
+
perPage: ((_response_meta2 = response.meta) == null ? void 0 : _response_meta2.per_page) || data.length,
|
|
772
|
+
totalPages: ((_response_meta3 = response.meta) == null ? void 0 : _response_meta3.total_pages) || 1
|
|
773
|
+
}
|
|
774
|
+
};
|
|
775
|
+
}
|
|
776
|
+
};
|
|
777
|
+
}
|
|
778
|
+
|
|
420
779
|
function createOnboardingBlock(transport, config) {
|
|
421
780
|
return {
|
|
422
781
|
onboardings: createOnboardingsService(transport),
|
|
423
782
|
flows: createFlowsService(transport),
|
|
424
783
|
userJourneys: createUserJourneysService(transport),
|
|
425
|
-
userIdentities: createUserIdentitiesService(transport)
|
|
784
|
+
userIdentities: createUserIdentitiesService(transport),
|
|
785
|
+
onboard: createOnboardService(transport),
|
|
786
|
+
mailTemplates: createMailTemplatesService(transport),
|
|
787
|
+
remarketing: createRemarketingService(transport)
|
|
426
788
|
};
|
|
427
789
|
}
|
|
428
790
|
const onboardingBlockMetadata = {
|
|
@@ -433,7 +795,8 @@ const onboardingBlockMetadata = {
|
|
|
433
795
|
'Onboarding',
|
|
434
796
|
'Flow',
|
|
435
797
|
'UserJourney',
|
|
436
|
-
'UserIdentity'
|
|
798
|
+
'UserIdentity',
|
|
799
|
+
'MailTemplate'
|
|
437
800
|
]
|
|
438
801
|
};
|
|
439
802
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
export * from './utils';
|
|
1
2
|
export * from './onboarding.mapper';
|
|
2
3
|
export * from './flow.mapper';
|
|
3
4
|
export * from './user-journey.mapper';
|
|
4
5
|
export * from './user-identity.mapper';
|
|
5
|
-
export * from './
|
|
6
|
+
export * from './onboard.mapper';
|
|
7
|
+
export * from './mail-template.mapper';
|
|
8
|
+
export * from './step.mapper';
|
|
6
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mail-template.mapper.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/mail-template.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAG3D,eAAO,MAAM,kBAAkB,EAAE,cAAc,CAAC,YAAY,CAmB3D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboard.mapper.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/onboard.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,cAAc,CAkB/D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step.mapper.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/step.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpD,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,cAAc,CAe/D,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Transport, BlockConfig, BlockMetadata } from '@23blocks/contracts';
|
|
2
|
-
import { type OnboardingsService, type FlowsService, type UserJourneysService, type UserIdentitiesService } from './services';
|
|
2
|
+
import { type OnboardingsService, type FlowsService, type UserJourneysService, type UserIdentitiesService, type OnboardService, type MailTemplatesService, type RemarketingService } from './services';
|
|
3
3
|
export interface OnboardingBlockConfig extends BlockConfig {
|
|
4
4
|
appId: string;
|
|
5
5
|
tenantId?: string;
|
|
@@ -9,6 +9,9 @@ export interface OnboardingBlock {
|
|
|
9
9
|
flows: FlowsService;
|
|
10
10
|
userJourneys: UserJourneysService;
|
|
11
11
|
userIdentities: UserIdentitiesService;
|
|
12
|
+
onboard: OnboardService;
|
|
13
|
+
mailTemplates: MailTemplatesService;
|
|
14
|
+
remarketing: RemarketingService;
|
|
12
15
|
}
|
|
13
16
|
export declare function createOnboardingBlock(transport: Transport, config: OnboardingBlockConfig): OnboardingBlock;
|
|
14
17
|
export declare const onboardingBlockMetadata: BlockMetadata;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onboarding.block.d.ts","sourceRoot":"","sources":["../../../src/lib/onboarding.block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,
|
|
1
|
+
{"version":3,"file":"onboarding.block.d.ts","sourceRoot":"","sources":["../../../src/lib/onboarding.block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAQL,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACxB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,qBAAsB,SAAQ,WAAW;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,kBAAkB,CAAC;IAChC,KAAK,EAAE,YAAY,CAAC;IACpB,YAAY,EAAE,mBAAmB,CAAC;IAClC,cAAc,EAAE,qBAAqB,CAAC;IACtC,OAAO,EAAE,cAAc,CAAC;IACxB,aAAa,EAAE,oBAAoB,CAAC;IACpC,WAAW,EAAE,kBAAkB,CAAC;CACjC;AAED,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,qBAAqB,GAC5B,eAAe,CAUjB;AAED,eAAO,MAAM,uBAAuB,EAAE,aAWrC,CAAC"}
|
|
@@ -7,6 +7,8 @@ export interface FlowsService {
|
|
|
7
7
|
update(uniqueId: string, data: UpdateFlowRequest): Promise<Flow>;
|
|
8
8
|
delete(uniqueId: string): Promise<void>;
|
|
9
9
|
listByOnboarding(onboardingUniqueId: string): Promise<Flow[]>;
|
|
10
|
+
getBySource(uniqueId: string, sourceUniqueId: string): Promise<Flow>;
|
|
11
|
+
stepBySource(uniqueId: string, sourceUniqueId: string, stepData?: Record<string, unknown>): Promise<Flow>;
|
|
10
12
|
}
|
|
11
13
|
export declare function createFlowsService(transport: Transport, _config: {
|
|
12
14
|
appId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flows.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/flows.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,IAAI,EACJ,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EAChB,MAAM,eAAe,CAAC;AAGvB,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,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M,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3G;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,YAAY,CAwEjG"}
|
|
@@ -2,4 +2,7 @@ export * from './onboardings.service';
|
|
|
2
2
|
export * from './flows.service';
|
|
3
3
|
export * from './user-journeys.service';
|
|
4
4
|
export * from './user-identities.service';
|
|
5
|
+
export * from './onboard.service';
|
|
6
|
+
export * from './mail-templates.service';
|
|
7
|
+
export * from './remarketing.service';
|
|
5
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Transport, PageResult } from '@23blocks/contracts';
|
|
2
|
+
import type { MailTemplate, CreateMailTemplateRequest, UpdateMailTemplateRequest, ListMailTemplatesParams, CreateMandrillTemplateRequest, UpdateMandrillTemplateRequest, MandrillTemplateStats } from '../types/mail-template';
|
|
3
|
+
export interface MailTemplatesService {
|
|
4
|
+
list(params?: ListMailTemplatesParams): Promise<PageResult<MailTemplate>>;
|
|
5
|
+
get(uniqueId: string): Promise<MailTemplate>;
|
|
6
|
+
create(data: CreateMailTemplateRequest): Promise<MailTemplate>;
|
|
7
|
+
update(uniqueId: string, data: UpdateMailTemplateRequest): Promise<MailTemplate>;
|
|
8
|
+
getMandrillStats(uniqueId: string): Promise<MandrillTemplateStats>;
|
|
9
|
+
createMandrillTemplate(uniqueId: string, data: CreateMandrillTemplateRequest): Promise<MailTemplate>;
|
|
10
|
+
updateMandrillTemplate(uniqueId: string, data: UpdateMandrillTemplateRequest): Promise<MailTemplate>;
|
|
11
|
+
publishMandrill(uniqueId: string): Promise<MailTemplate>;
|
|
12
|
+
}
|
|
13
|
+
export declare function createMailTemplatesService(transport: Transport, _config: {
|
|
14
|
+
appId: string;
|
|
15
|
+
}): MailTemplatesService;
|
|
16
|
+
//# sourceMappingURL=mail-templates.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mail-templates.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/mail-templates.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EACvB,6BAA6B,EAC7B,6BAA6B,EAC7B,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAGhC,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,MAAM,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;IAC1E,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC7C,MAAM,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/D,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACjF,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACnE,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,6BAA6B,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACrG,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,6BAA6B,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACrG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CAC1D;AAED,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,oBAAoB,CAsGjH"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Transport } from '@23blocks/contracts';
|
|
2
|
+
import type { OnboardJourney, OnboardJourneyDetails, StartOnboardRequest, StepOnboardRequest, LogOnboardRequest } from '../types/onboard';
|
|
3
|
+
export interface OnboardService {
|
|
4
|
+
start(uniqueId: string, data?: StartOnboardRequest): Promise<OnboardJourney>;
|
|
5
|
+
get(uniqueId: string): Promise<OnboardJourney>;
|
|
6
|
+
getDetails(uniqueId: string): Promise<OnboardJourneyDetails>;
|
|
7
|
+
step(uniqueId: string, data: StepOnboardRequest): Promise<OnboardJourney>;
|
|
8
|
+
log(uniqueId: string, data: LogOnboardRequest): Promise<OnboardJourney>;
|
|
9
|
+
suspend(uniqueId: string): Promise<OnboardJourney>;
|
|
10
|
+
resume(uniqueId: string): Promise<OnboardJourney>;
|
|
11
|
+
}
|
|
12
|
+
export declare function createOnboardService(transport: Transport, _config: {
|
|
13
|
+
appId: string;
|
|
14
|
+
}): OnboardService;
|
|
15
|
+
//# sourceMappingURL=onboard.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboard.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/onboard.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAG1B,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC7E,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC/C,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC7D,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC1E,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IACxE,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IACnD,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CACnD;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,cAAc,CAyErG"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import type { Transport, PageResult } from '@23blocks/contracts';
|
|
2
2
|
import type { Onboarding, CreateOnboardingRequest, UpdateOnboardingRequest, ListOnboardingsParams } from '../types/onboarding';
|
|
3
|
+
import type { OnboardingStep, AddStepRequest, UpdateStepRequest } from '../types/step';
|
|
3
4
|
export interface OnboardingsService {
|
|
4
5
|
list(params?: ListOnboardingsParams): Promise<PageResult<Onboarding>>;
|
|
5
6
|
get(uniqueId: string): Promise<Onboarding>;
|
|
6
7
|
create(data: CreateOnboardingRequest): Promise<Onboarding>;
|
|
7
8
|
update(uniqueId: string, data: UpdateOnboardingRequest): Promise<Onboarding>;
|
|
8
9
|
delete(uniqueId: string): Promise<void>;
|
|
10
|
+
addStep(uniqueId: string, data: AddStepRequest): Promise<OnboardingStep>;
|
|
11
|
+
updateStep(uniqueId: string, stepUniqueId: string, data: UpdateStepRequest): Promise<OnboardingStep>;
|
|
12
|
+
deleteStep(uniqueId: string, stepUniqueId: string): Promise<void>;
|
|
13
|
+
stepUser(uniqueId: string, userUniqueId: string, stepData?: Record<string, unknown>): Promise<Onboarding>;
|
|
9
14
|
}
|
|
10
15
|
export declare function createOnboardingsService(transport: Transport, _config: {
|
|
11
16
|
appId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onboardings.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/onboardings.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,UAAU,EACV,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"onboardings.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/onboardings.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,UAAU,EACV,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,E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|
+
export interface RemarketingService {
|
|
4
|
+
listAbandonedJourneys(params?: ListAbandonedJourneysParams): Promise<PageResult<AbandonedJourney>>;
|
|
5
|
+
}
|
|
6
|
+
export declare function createRemarketingService(transport: Transport, _config: {
|
|
7
|
+
appId: string;
|
|
8
|
+
}): RemarketingService;
|
|
9
|
+
//# sourceMappingURL=remarketing.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remarketing.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/remarketing.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EACV,gBAAgB,EAChB,2BAA2B,EAC5B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,kBAAkB;IACjC,qBAAqB,CAAC,MAAM,CAAC,EAAE,2BAA2B,GAAG,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC;CACpG;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,kBAAkB,CA4C7G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-identities.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/user-identities.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACzB,MAAM,wBAAwB,CAAC;AAGhC,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,MAAM,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;IAC3E,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,C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AE,CAAC,CAAC;CAC3D;AAED,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,qBAAqB,CAoDnH"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Transport, PageResult } from '@23blocks/contracts';
|
|
2
2
|
import type { UserJourney, StartJourneyRequest, CompleteStepRequest, ListUserJourneysParams } from '../types/user-journey';
|
|
3
|
+
import type { UserJourneyReportParams, UserJourneyReportSummary, UserJourneyReportList } from '../types/report';
|
|
3
4
|
export interface UserJourneysService {
|
|
4
5
|
list(params?: ListUserJourneysParams): Promise<PageResult<UserJourney>>;
|
|
5
6
|
get(uniqueId: string): Promise<UserJourney>;
|
|
@@ -12,6 +13,9 @@ export interface UserJourneysService {
|
|
|
12
13
|
currentStep?: number;
|
|
13
14
|
completedSteps?: number[];
|
|
14
15
|
}>;
|
|
16
|
+
listByUserAndOnboarding(userUniqueId: string, onboardingUniqueId: string): Promise<UserJourney>;
|
|
17
|
+
reportList(params: UserJourneyReportParams): Promise<UserJourneyReportList>;
|
|
18
|
+
reportSummary(params: UserJourneyReportParams): Promise<UserJourneyReportSummary>;
|
|
15
19
|
}
|
|
16
20
|
export declare function createUserJourneysService(transport: Transport, _config: {
|
|
17
21
|
appId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-journeys.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/user-journeys.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,WAAW,EACX,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"user-journeys.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/user-journeys.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EA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AC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,mBAAmB,CAqI/G"}
|
|
@@ -2,4 +2,9 @@ export * from './onboarding';
|
|
|
2
2
|
export * from './flow';
|
|
3
3
|
export * from './user-journey';
|
|
4
4
|
export * from './user-identity';
|
|
5
|
+
export * from './onboard';
|
|
6
|
+
export * from './mail-template';
|
|
7
|
+
export * from './remarketing';
|
|
8
|
+
export * from './report';
|
|
9
|
+
export * from './step';
|
|
5
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { IdentityCore, EntityStatus } from '@23blocks/contracts';
|
|
2
|
+
export interface MailTemplate extends IdentityCore {
|
|
3
|
+
code: string;
|
|
4
|
+
name: string;
|
|
5
|
+
subject?: string;
|
|
6
|
+
fromEmail?: string;
|
|
7
|
+
fromName?: string;
|
|
8
|
+
htmlContent?: string;
|
|
9
|
+
textContent?: string;
|
|
10
|
+
mandrillSlug?: string;
|
|
11
|
+
status: EntityStatus;
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
payload?: Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
export interface CreateMailTemplateRequest {
|
|
16
|
+
code: string;
|
|
17
|
+
name: string;
|
|
18
|
+
subject?: string;
|
|
19
|
+
fromEmail?: string;
|
|
20
|
+
fromName?: string;
|
|
21
|
+
htmlContent?: string;
|
|
22
|
+
textContent?: string;
|
|
23
|
+
payload?: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
export interface UpdateMailTemplateRequest {
|
|
26
|
+
name?: string;
|
|
27
|
+
subject?: string;
|
|
28
|
+
fromEmail?: string;
|
|
29
|
+
fromName?: string;
|
|
30
|
+
htmlContent?: string;
|
|
31
|
+
textContent?: string;
|
|
32
|
+
enabled?: boolean;
|
|
33
|
+
status?: EntityStatus;
|
|
34
|
+
payload?: Record<string, unknown>;
|
|
35
|
+
}
|
|
36
|
+
export interface ListMailTemplatesParams {
|
|
37
|
+
page?: number;
|
|
38
|
+
perPage?: number;
|
|
39
|
+
status?: EntityStatus;
|
|
40
|
+
search?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface CreateMandrillTemplateRequest {
|
|
43
|
+
name: string;
|
|
44
|
+
fromEmail?: string;
|
|
45
|
+
fromName?: string;
|
|
46
|
+
subject?: string;
|
|
47
|
+
code?: string;
|
|
48
|
+
text?: string;
|
|
49
|
+
publish?: boolean;
|
|
50
|
+
labels?: string[];
|
|
51
|
+
}
|
|
52
|
+
export interface UpdateMandrillTemplateRequest {
|
|
53
|
+
fromEmail?: string;
|
|
54
|
+
fromName?: string;
|
|
55
|
+
subject?: string;
|
|
56
|
+
code?: string;
|
|
57
|
+
text?: string;
|
|
58
|
+
publish?: boolean;
|
|
59
|
+
labels?: string[];
|
|
60
|
+
}
|
|
61
|
+
export interface MandrillTemplateStats {
|
|
62
|
+
slug: string;
|
|
63
|
+
name: string;
|
|
64
|
+
sentCount: number;
|
|
65
|
+
openCount: number;
|
|
66
|
+
clickCount: number;
|
|
67
|
+
bounceCount: number;
|
|
68
|
+
complaintCount: number;
|
|
69
|
+
createdAt: Date;
|
|
70
|
+
updatedAt: Date;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=mail-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mail-template.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/mail-template.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEtE,MAAM,WAAW,YAAa,SAAQ,YAAY;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,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,CAAC;IACvB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { IdentityCore } from '@23blocks/contracts';
|
|
2
|
+
export interface OnboardJourney extends IdentityCore {
|
|
3
|
+
userUniqueId: string;
|
|
4
|
+
onboardingUniqueId: string;
|
|
5
|
+
currentStep?: number;
|
|
6
|
+
completedSteps: number[];
|
|
7
|
+
status: 'active' | 'completed' | 'suspended' | 'abandoned';
|
|
8
|
+
progress: number;
|
|
9
|
+
startedAt: Date;
|
|
10
|
+
completedAt?: Date;
|
|
11
|
+
suspendedAt?: Date;
|
|
12
|
+
payload?: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
export interface OnboardJourneyDetails extends OnboardJourney {
|
|
15
|
+
onboardingName?: string;
|
|
16
|
+
steps: OnboardStepDetail[];
|
|
17
|
+
logs: OnboardLogEntry[];
|
|
18
|
+
}
|
|
19
|
+
export interface OnboardStepDetail {
|
|
20
|
+
stepNumber: number;
|
|
21
|
+
stepName?: string;
|
|
22
|
+
completed: boolean;
|
|
23
|
+
completedAt?: Date;
|
|
24
|
+
data?: Record<string, unknown>;
|
|
25
|
+
}
|
|
26
|
+
export interface OnboardLogEntry {
|
|
27
|
+
uniqueId: string;
|
|
28
|
+
action: string;
|
|
29
|
+
stepNumber?: number;
|
|
30
|
+
message?: string;
|
|
31
|
+
payload?: Record<string, unknown>;
|
|
32
|
+
createdAt: Date;
|
|
33
|
+
}
|
|
34
|
+
export interface StartOnboardRequest {
|
|
35
|
+
onboardingUniqueId?: string;
|
|
36
|
+
payload?: Record<string, unknown>;
|
|
37
|
+
}
|
|
38
|
+
export interface StepOnboardRequest {
|
|
39
|
+
stepNumber: number;
|
|
40
|
+
stepData?: Record<string, unknown>;
|
|
41
|
+
}
|
|
42
|
+
export interface LogOnboardRequest {
|
|
43
|
+
action: string;
|
|
44
|
+
stepNumber?: number;
|
|
45
|
+
message?: string;
|
|
46
|
+
payload?: Record<string, unknown>;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=onboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboard.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/onboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAgB,MAAM,qBAAqB,CAAC;AAEtE,MAAM,WAAW,cAAe,SAAQ,YAAY;IAClD,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,MAAM,EAAE,QAAQ,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC;IAC3D,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,IAAI,CAAC;IAChB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC3D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,IAAI,EAAE,eAAe,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { OnboardJourney } from './onboard';
|
|
2
|
+
export interface AbandonedJourney extends OnboardJourney {
|
|
3
|
+
userEmail?: string;
|
|
4
|
+
userName?: string;
|
|
5
|
+
abandonedAt: Date;
|
|
6
|
+
lastStepName?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ListAbandonedJourneysParams {
|
|
9
|
+
page?: number;
|
|
10
|
+
perPage?: number;
|
|
11
|
+
onboardingUniqueId?: string;
|
|
12
|
+
minProgress?: number;
|
|
13
|
+
maxProgress?: number;
|
|
14
|
+
abandonedAfter?: Date;
|
|
15
|
+
abandonedBefore?: Date;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=remarketing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remarketing.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/remarketing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,IAAI,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,IAAI,CAAC;CACxB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface UserJourneyReportParams {
|
|
2
|
+
startDate?: string;
|
|
3
|
+
endDate?: string;
|
|
4
|
+
onboardingUniqueId?: string;
|
|
5
|
+
status?: string;
|
|
6
|
+
page?: number;
|
|
7
|
+
perPage?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface UserJourneyReportItem {
|
|
10
|
+
uniqueId: string;
|
|
11
|
+
userUniqueId: string;
|
|
12
|
+
onboardingName: string;
|
|
13
|
+
progress: number;
|
|
14
|
+
status: string;
|
|
15
|
+
startedAt: Date;
|
|
16
|
+
completedAt?: Date;
|
|
17
|
+
}
|
|
18
|
+
export interface UserJourneyReportSummary {
|
|
19
|
+
totalJourneys: number;
|
|
20
|
+
totalCompleted: number;
|
|
21
|
+
totalAbandoned: number;
|
|
22
|
+
totalActive: number;
|
|
23
|
+
averageProgress: number;
|
|
24
|
+
completionRate: number;
|
|
25
|
+
journeysByStatus: Record<string, number>;
|
|
26
|
+
period: {
|
|
27
|
+
startDate: Date;
|
|
28
|
+
endDate: Date;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export interface UserJourneyReportList {
|
|
32
|
+
journeys: UserJourneyReportItem[];
|
|
33
|
+
summary: UserJourneyReportSummary;
|
|
34
|
+
meta: {
|
|
35
|
+
totalCount: number;
|
|
36
|
+
page: number;
|
|
37
|
+
perPage: number;
|
|
38
|
+
totalPages: number;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/report.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,IAAI,CAAC;IAChB,WAAW,CAAC,EAAE,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,MAAM,EAAE;QACN,SAAS,EAAE,IAAI,CAAC;QAChB,OAAO,EAAE,IAAI,CAAC;KACf,CAAC;CACH;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,qBAAqB,EAAE,CAAC;IAClC,OAAO,EAAE,wBAAwB,CAAC;IAClC,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { IdentityCore } from '@23blocks/contracts';
|
|
2
|
+
export interface OnboardingStep extends IdentityCore {
|
|
3
|
+
onboardingUniqueId: string;
|
|
4
|
+
stepNumber: number;
|
|
5
|
+
name: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
type?: string;
|
|
8
|
+
config?: Record<string, unknown>;
|
|
9
|
+
payload?: Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
export interface AddStepRequest {
|
|
12
|
+
stepNumber?: number;
|
|
13
|
+
name: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
type?: string;
|
|
16
|
+
config?: Record<string, unknown>;
|
|
17
|
+
payload?: Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
export interface UpdateStepRequest {
|
|
20
|
+
name?: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
type?: string;
|
|
23
|
+
config?: Record<string, unknown>;
|
|
24
|
+
payload?: Record<string, unknown>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=step.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,WAAW,cAAe,SAAQ,YAAY;IAClD,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC"}
|
package/package.json
CHANGED