@shrfe/assets 1.0.71-staging.2 → 1.0.72-staging.1

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.
@@ -36661,6 +36661,33 @@ const PROFILE_KEY_MAP = {
36661
36661
  firstName: 'first_name',
36662
36662
  lastName: 'last_name'
36663
36663
  };
36664
+ // Customer.io's documented person attributes; any other profile key is dropped before identify.
36665
+ const CUSTOMER_IO_ATTRIBUTES = new Set([
36666
+ 'first_name',
36667
+ 'last_name',
36668
+ 'gender',
36669
+ 'email',
36670
+ 'phone_number',
36671
+ 'employer_name',
36672
+ 'employer_address',
36673
+ 'date_joined',
36674
+ 'time_in_company',
36675
+ 'employee_id',
36676
+ 'job_title',
36677
+ 'department',
36678
+ 'breeze_user_id',
36679
+ 'channel',
36680
+ 'date_of_birth',
36681
+ 'location',
36682
+ 'country',
36683
+ 'payday',
36684
+ 'breeze_access_status',
36685
+ 'breeze_access_date',
36686
+ 'total_amount_eligible',
36687
+ 'repayment_status',
36688
+ 'device',
36689
+ 'number_of_loans'
36690
+ ]);
36664
36691
  // Where the SDK persists the identified person (localStorage and cookies).
36665
36692
  const STORED_IDENTITY_KEYS = [
36666
36693
  'ajs_user_id',
@@ -36779,7 +36806,11 @@ const CustomerIoService = {
36779
36806
  },
36780
36807
  identify (userId, profile) {
36781
36808
  if (userId === undefined || userId === null || userId === '') return;
36782
- const traits = toProfileTraits(profile);
36809
+ const attributeProfile = {};
36810
+ CUSTOMER_IO_ATTRIBUTES.forEach((name)=>{
36811
+ if (profile && name in profile) attributeProfile[name] = profile[name];
36812
+ });
36813
+ const traits = toProfileTraits(attributeProfile);
36783
36814
  log('identify', userId, traits);
36784
36815
  safely((client)=>client.identify(String(userId), traits));
36785
36816
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shrfe/assets",
3
- "version": "1.0.71-staging.2",
3
+ "version": "1.0.72-staging.1",
4
4
  "description": "The assets used in SeamlessHR products",
5
5
  "author": "SeamlessHR LTD <oludayo@seamlesshr.com>",
6
6
  "license": "ISC",