@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 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']) || resource.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']) || resource.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']) || resource.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']) || resource.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 };
@@ -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 type { Onboarding, CreateOnboardingRequest, UpdateOnboardingRequest, ListOnboardingsParams, Flow, CreateFlowRequest, UpdateFlowRequest, ListFlowsParams, UserJourney, UserJourneyStatus, StartJourneyRequest, CompleteStepRequest, ListUserJourneysParams, UserIdentity, CreateUserIdentityRequest, VerifyUserIdentityRequest, ListUserIdentitiesParams, } from './lib/types';
4
- export type { OnboardingsService, FlowsService, UserJourneysService, UserIdentitiesService, } from './lib/services';
5
- export { createOnboardingsService, createFlowsService, createUserJourneysService, createUserIdentitiesService, } from './lib/services';
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
@@ -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,YAAY,EAEV,UAAU,EACV,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,EAErB,IAAI,EACJ,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EAEf,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EAEtB,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,aAAa,CAAC;AAGrB,YAAY,EACV,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,eAAe,CAAC"}
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@23blocks/block-onboarding",
3
- "version": "3.1.0",
3
+ "version": "3.1.2",
4
4
  "description": "Onboarding block for 23blocks SDK - user journeys, flows, and identity verification",
5
5
  "license": "MIT",
6
6
  "author": "23blocks <hello@23blocks.com>",