@23blocks/block-onboarding 3.1.0 → 3.1.2
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 +25 -5
- package/dist/src/index.d.ts +3 -4
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -36,6 +36,26 @@ import { _ } from '@swc/helpers/_/_extends';
|
|
|
36
36
|
}
|
|
37
37
|
return false;
|
|
38
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Parse an array of strings
|
|
41
|
+
*/ function parseStringArray(value) {
|
|
42
|
+
if (value === null || value === undefined) {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
if (Array.isArray(value)) {
|
|
46
|
+
return value.map(String);
|
|
47
|
+
}
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Parse a number value
|
|
52
|
+
*/ function parseNumber(value) {
|
|
53
|
+
if (value === null || value === undefined) {
|
|
54
|
+
return 0;
|
|
55
|
+
}
|
|
56
|
+
const num = Number(value);
|
|
57
|
+
return isNaN(num) ? 0 : num;
|
|
58
|
+
}
|
|
39
59
|
/**
|
|
40
60
|
* Parse an optional number value
|
|
41
61
|
*/ function parseOptionalNumber(value) {
|
|
@@ -101,7 +121,7 @@ const onboardingMapper = {
|
|
|
101
121
|
type: 'Onboarding',
|
|
102
122
|
map: (resource)=>({
|
|
103
123
|
id: resource.id,
|
|
104
|
-
uniqueId: parseString(resource.attributes['unique_id'])
|
|
124
|
+
uniqueId: parseString(resource.attributes['unique_id']),
|
|
105
125
|
createdAt: parseDate(resource.attributes['created_at']) || new Date(),
|
|
106
126
|
updatedAt: parseDate(resource.attributes['updated_at']) || new Date(),
|
|
107
127
|
code: parseString(resource.attributes['code']) || '',
|
|
@@ -219,7 +239,7 @@ const flowMapper = {
|
|
|
219
239
|
type: 'Flow',
|
|
220
240
|
map: (resource)=>({
|
|
221
241
|
id: resource.id,
|
|
222
|
-
uniqueId: parseString(resource.attributes['unique_id'])
|
|
242
|
+
uniqueId: parseString(resource.attributes['unique_id']),
|
|
223
243
|
createdAt: parseDate(resource.attributes['created_at']) || new Date(),
|
|
224
244
|
updatedAt: parseDate(resource.attributes['updated_at']) || new Date(),
|
|
225
245
|
onboardingUniqueId: parseString(resource.attributes['onboarding_unique_id']) || '',
|
|
@@ -306,7 +326,7 @@ const userJourneyMapper = {
|
|
|
306
326
|
type: 'UserJourney',
|
|
307
327
|
map: (resource)=>({
|
|
308
328
|
id: resource.id,
|
|
309
|
-
uniqueId: parseString(resource.attributes['unique_id'])
|
|
329
|
+
uniqueId: parseString(resource.attributes['unique_id']),
|
|
310
330
|
createdAt: parseDate(resource.attributes['created_at']) || new Date(),
|
|
311
331
|
updatedAt: parseDate(resource.attributes['updated_at']) || new Date(),
|
|
312
332
|
userUniqueId: parseString(resource.attributes['user_unique_id']) || '',
|
|
@@ -453,7 +473,7 @@ const userIdentityMapper = {
|
|
|
453
473
|
type: 'UserIdentity',
|
|
454
474
|
map: (resource)=>({
|
|
455
475
|
id: resource.id,
|
|
456
|
-
uniqueId: parseString(resource.attributes['unique_id'])
|
|
476
|
+
uniqueId: parseString(resource.attributes['unique_id']),
|
|
457
477
|
createdAt: parseDate(resource.attributes['created_at']) || new Date(),
|
|
458
478
|
updatedAt: parseDate(resource.attributes['updated_at']) || new Date(),
|
|
459
479
|
userUniqueId: parseString(resource.attributes['user_unique_id']) || '',
|
|
@@ -800,4 +820,4 @@ const onboardingBlockMetadata = {
|
|
|
800
820
|
]
|
|
801
821
|
};
|
|
802
822
|
|
|
803
|
-
export { createFlowsService, createOnboardingBlock, createOnboardingsService, createUserIdentitiesService, createUserJourneysService, flowMapper, onboardingBlockMetadata, onboardingMapper, userIdentityMapper, userJourneyMapper };
|
|
823
|
+
export { createFlowsService, createMailTemplatesService, createOnboardService, createOnboardingBlock, createOnboardingsService, createRemarketingService, createUserIdentitiesService, createUserJourneysService, flowMapper, mailTemplateMapper, onboardJourneyMapper, onboardingBlockMetadata, onboardingMapper, onboardingStepMapper, parseBoolean, parseDate, parseJourneyStatus, parseNumber, parseNumberArray, parseObject, parseObjectArray, parseOptionalNumber, parseStatus, parseString, parseStringArray, userIdentityMapper, userJourneyMapper };
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { createOnboardingBlock, onboardingBlockMetadata } from './lib/onboarding.block';
|
|
2
2
|
export type { OnboardingBlock, OnboardingBlockConfig } from './lib/onboarding.block';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export { onboardingMapper, flowMapper, userJourneyMapper, userIdentityMapper, } from './lib/mappers';
|
|
3
|
+
export * from './lib/types';
|
|
4
|
+
export * from './lib/services';
|
|
5
|
+
export * from './lib/mappers';
|
|
7
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACxF,YAAY,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAGrF,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACxF,YAAY,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAGrF,cAAc,aAAa,CAAC;AAG5B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,eAAe,CAAC"}
|
package/package.json
CHANGED