@go-mailer/jarvis 9.0.0 → 10.0.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/.env ADDED
@@ -0,0 +1,119 @@
1
+ NODE_ENV=development
2
+ REACT_APP_ENV=development
3
+
4
+ JWT_ISSUER=go-mailer.com
5
+
6
+ LOG_DB_HOST=mongo:27017
7
+ LOG_DB_USER=
8
+ LOG_DB_PASS=
9
+ LOG_DB_SLUG=mongodb://
10
+
11
+ MAIN_DB_HOST=mongo:27017
12
+ MAIN_DB_USER=
13
+ MAIN_DB_PASS=
14
+ MAIN_DB_SLUG=mongodb://
15
+
16
+ EMAIL_DB_HOST="45.94.209.67"
17
+ EMAIL_DB_PORT="3306"
18
+ EMAIL_DB_USER="logger"
19
+ EMAIL_DB_PASS="now.you.see.me.0110"
20
+ EMAIL_DB_NAME="emaillogs"
21
+
22
+ ADMIN_URI="http://localhost:3002"
23
+ EDITOR_URI="http://localhost:3003"
24
+ FRONTEND_URI="http://localhost:3000"
25
+ LANDING_URI="http://localhost:3001"
26
+
27
+ API_SERVICE_URI="http://api:4018"
28
+ AUTOMATA_SERVICE_URI="http://automata:4016"
29
+ AUTOMATA_API_SERVICE_URI="http://automata-api:4009"
30
+ AUTOMATOR_SERVICE_URI="http://automator:4015"
31
+ CAMPAIGN_PROCESSOR_SERVICE_URI="http://automator:4019"
32
+ FILES_SERVICE_URI="http://files:4010"
33
+ IAM_SERVICE_URI="http://iam:4011"
34
+ IMPORTER_SERVICE_URI="http://importer:4013"
35
+ JANITOR_SERVICE_URI="http://janitor:4004"
36
+ MAILING_SERVICE_URI="http://mailing:4017"
37
+ MAILING_API_SERVICE_URI="http://mailing-api:4002"
38
+ MESSAGING_SERVICE_URI="http://messaging:4014"
39
+ MESSENGER_SERVICE_URI="http://messaging:4020"
40
+ NOTIFICATIONS_SERVICE_URI="http://notifications:4007"
41
+ POSTAL_SERVICE_URI="http://postal:4008"
42
+ REPORTS_SERVICE_URI="http://reports:4012"
43
+ SALES_SERVICE_URI="http://sales:4003"
44
+ SCHEDULE_SERVICE_URI="http://sales:4003"
45
+ USERS_SERVICE_URI="http://users:4001"
46
+
47
+ API_FQDN="http://localhost:4018"
48
+ AUTOMATA_FQDN="http://localhost:4016"
49
+ AUTOMATA_API_FQDN="http://localhost:4009"
50
+ AUTOMATOR_FQDN="http://localhost:4015"
51
+ CAMPAIGN_PROCESSOR_FQDN="http://localhost:4019"
52
+ FILES_FQDN="http://localhost:4010"
53
+ IAM_FQDN="http://localhost:4011"
54
+ IMPORTER_FQDN="http://localhost:4013"
55
+ JANITOR_FQDN="http://localhost:4004"
56
+ MAILING_FQDN="http://localhost:4017"
57
+ MAILING_API_FQDN="http://localhost:4002"
58
+ MESSAGING_FQDN="http://localhost:4014"
59
+ MESSENGER_FQDN="http://localhost:4020"
60
+ NOTIFICATIONS_FQDN="http://localhost:4007"
61
+ POSTAL_FQDN="http://localhost:4008"
62
+ REPORTS_FQDN="http://localhost:4012"
63
+ SALES_FQDN="http://localhost:4003"
64
+ SCHEDULE_FQDN="http://localhost:4003"
65
+ USERS_FQDN="http://localhost:4001"
66
+
67
+ BOUNCE_MAIL_USER="bounces-dev"
68
+ BOUNCE_MAIL_PASS=bounces.andolini.2021
69
+ MAIL_HOST="mail.go-mailer.net"
70
+ MAIL_PORT=25
71
+ IMAP_HOST="mail.go-mailer.xyz"
72
+ IMAP_PORT=993
73
+ MAILER_MAIL_USER=mailer
74
+ MAILER_MAIL_PASS=mailer.go-mailer.2021
75
+ PEOPLE_MAIL_USER=people
76
+ PEOPLE_MAIL_PASS=people.go-mailer.2021
77
+
78
+ RABBIT_HOST=rabbitmq
79
+ RABBIT_PORT=5672
80
+ RABBIT_USER=app
81
+ RABBIT_PASS=app.password.0110
82
+
83
+ REDIS_URL=redis://redis:6379
84
+
85
+ RAVE_URI='https://api.flutterwave.com/v3'
86
+ RAVE_KEY=FLWSECK_TEST-9e78fd97aef9bbbeda7a7d9507b6a680-X
87
+ RAVE_HASH=ksjdriweindcq3847que9wejd8q43wurwdseioj
88
+
89
+ ONEAPP_URI='https://api.oneappgo.com/v1'
90
+ ONEAPP_SECRET_KEY=1applive_sk_6313b0be9086988a71cb673cdd65a0f4
91
+ ONEAPP_PUBLIC_KEY=1applive_pb_2bc999e8ecbc2645ba950b6a66818dcc
92
+
93
+ GIBISEND_URI="http://lm_sales:6003"
94
+
95
+ GO_FLAGS_ENV=`development`
96
+ GO_FLAGS_KEY='quD7$GqrvwJJurLNhKF4JCyyF'
97
+ GO_FLAGS_URI='https://api.go-flags.com'
98
+
99
+ GM_API_KEY='TmF0aGFuLTExNjYwNDA4NjY2NjcuNTc0Mi0x'
100
+
101
+ LOGTAIL_SECRET=k2JiNWArbwNWpeh5nZJnZE52
102
+
103
+ # AWS
104
+ S3_REGION=us-east-1
105
+ S3_FILES_BUCKET_NAME=go-mailer-dev-files
106
+ S3_ACCESS_KEY=AKIA5WDKPKBDEMFHONPH
107
+ S3_SECRET_KEY=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
108
+
109
+ # TERMII
110
+ TERMII_URL=https://v3.api.termii.com
111
+
112
+ # WEB PUSH
113
+ VAPID_PUBLIC_KEY="BGlX_kj-D7u2_D0A-kBLEiXFfg9zY6-S6CPvAuTlU-c0sz8Z63rt4woH0jvcCiYdFPLBV6QAcLsXRKtiHXi4JMg"
114
+ VAPID_PRIVATE_KEY="eUQ7O7XH95rTT158p42OMr48cAMxZjW3VQFn_OAyp2o"
115
+ VAPID_SUBJECT="mailto:test@test.test"
116
+ DEFAULT_TOKEN=eab2ow4ahngeeh7cahdoo5ang7chugoo2oozoroos8de2ieGeepah5ath9ohngoh
117
+ JWT_SECRET=euGuxahgh9OhRul9BeiBi6ooquebiixahmut7ahPh2aich3bo7jithahGaphei2v
118
+ DEFAULT_TOKEN=eab2ow4ahngeeh7cahdoo5ang7chugoo2oozoroos8de2ieGeepah5ath9ohngoh
119
+ JWT_SECRET=euGuxahgh9OhRul9BeiBi6ooquebiixahmut7ahPh2aich3bo7jithahGaphei2v
@@ -1,7 +1,7 @@
1
1
  const axios = require('axios').default
2
2
  const Env = require('../env')
3
3
  const { fetchTenants } = require('./iam')
4
- const AUTOMATA_URI = Env.fetch('AUTOMATA_SERVICE_URI', true)
4
+ const API_SERVICE_URI = Env.fetch('API_SERVICE_URI', true)
5
5
  const GM_API_KEY = Env.fetch('GM_API_KEY', true)
6
6
 
7
7
  const triggerEvent = async (event_code, tenant_id, context = {}) => {
@@ -15,7 +15,7 @@ const triggerEvent = async (event_code, tenant_id, context = {}) => {
15
15
  } = tenant
16
16
 
17
17
  await axios.post(
18
- `${AUTOMATA_URI}/api/v1/events/trigger`,
18
+ `${API_SERVICE_URI}/v1/automations`,
19
19
  {
20
20
  event_code,
21
21
  contact_email,
@@ -1,8 +1,8 @@
1
- const axios = require("axios").default;
2
- const Env = require("../env");
3
- const IAM_URI = Env.fetch("IAM_SERVICE_URI", true);
4
- const API_SERVICE_URI = Env.fetch("API_SERVICE_URI", true);
5
- const DEFAULT_TOKEN = Env.fetch("DEFAULT_TOKEN", true);
1
+ const axios = require('axios').default
2
+ const Env = require('../env')
3
+ const IAM_URI = Env.fetch('IAM_SERVICE_URI', true)
4
+ const API_SERVICE_URI = Env.fetch('API_SERVICE_URI', true)
5
+ const DEFAULT_TOKEN = Env.fetch('DEFAULT_TOKEN', true)
6
6
 
7
7
  const checkAuthority = async ({ action, resource, user_id, tenant_id }) => {
8
8
  const { error, payload } = (
@@ -10,41 +10,41 @@ const checkAuthority = async ({ action, resource, user_id, tenant_id }) => {
10
10
  action,
11
11
  resource,
12
12
  tenant_id,
13
- user_id,
13
+ user_id
14
14
  })
15
- ).data;
15
+ ).data
16
16
 
17
- if (error || !payload.is_permitted) throw new Error("Unauthorized");
18
- return payload.is_permitted;
19
- };
17
+ if (error || !payload.is_permitted) throw new Error('Unauthorized')
18
+ return payload.is_permitted
19
+ }
20
20
 
21
- const fetchTenants = async (query = "") => {
21
+ const fetchTenants = async (query = '') => {
22
22
  const { data: response } = await axios.get(`${IAM_URI}/tenants?${query}`, {
23
23
  headers: {
24
- authorization: `Bearer ${DEFAULT_TOKEN}`,
25
- },
26
- });
24
+ authorization: `Bearer ${DEFAULT_TOKEN}`
25
+ }
26
+ })
27
27
 
28
- const { error, payload } = response;
29
- if (error) throw new Error(error);
28
+ const { error, payload } = response
29
+ if (error) throw new Error(error)
30
30
 
31
- const { data: tenants, meta } = payload;
32
- return { tenants, size: meta?.size || 0 };
33
- };
31
+ const { data: tenants, meta } = payload
32
+ return { tenants, size: meta?.size || 0 }
33
+ }
34
34
 
35
35
  const verifyAPIKey = async (key) => {
36
36
  const { error, payload } = (
37
37
  await axios.get(`${API_SERVICE_URI}/keys/verify/${key}`, {
38
38
  headers: {
39
- authorization: `Bearer ${DEFAULT_TOKEN}`,
40
- },
39
+ authorization: `Bearer ${DEFAULT_TOKEN}`
40
+ }
41
41
  })
42
- ).data;
42
+ ).data
43
43
 
44
- if (error) throw new Error("Unauthorized");
44
+ if (error) throw new Error('Unauthorized')
45
45
 
46
- return payload.org_id;
47
- };
46
+ return payload.org_id
47
+ }
48
48
 
49
49
  const verifyFeatureFlag = async (flag_name, criteria = {}) => {
50
50
  const { error, payload } = (
@@ -52,20 +52,20 @@ const verifyFeatureFlag = async (flag_name, criteria = {}) => {
52
52
  `${IAM_URI}/flags`,
53
53
  {
54
54
  criteria,
55
- environment: Env.fetch("NODE_ENV"),
56
- name: flag_name,
55
+ environment: Env.fetch('NODE_ENV'),
56
+ name: flag_name
57
57
  },
58
58
  {
59
59
  headers: {
60
- authorization: `Bearer ${DEFAULT_TOKEN}`,
61
- },
60
+ authorization: `Bearer ${DEFAULT_TOKEN}`
61
+ }
62
62
  }
63
63
  )
64
- ).data;
64
+ ).data
65
65
 
66
- if (error) throw new Error(error);
66
+ if (error) throw new Error(error)
67
67
 
68
- return payload.is_permitted;
69
- };
68
+ return payload.is_permitted
69
+ }
70
70
 
71
- module.exports = { checkAuthority, fetchTenants, verifyAPIKey, verifyFeatureFlag };
71
+ module.exports = { checkAuthority, fetchTenants, verifyAPIKey, verifyFeatureFlag }
@@ -1,8 +1,8 @@
1
- const axios = require("axios").default;
2
- const Env = require("../env");
3
- const { fetchTenants } = require("./iam");
4
- const USERS_URI = Env.fetch("USERS_SERVICE_URI", true);
5
- const GM_API_KEY = Env.fetch("GM_API_KEY", true);
1
+ const axios = require('axios').default
2
+ const Env = require('../env')
3
+ const { fetchTenants } = require('./iam')
4
+ const API_SERVICE_URI = Env.fetch('API_SERVICE_URI', true)
5
+ const GM_API_KEY = Env.fetch('GM_API_KEY', true)
6
6
 
7
7
  const updateContact = async (tenant_id, data = {}) => {
8
8
  const {
@@ -14,12 +14,12 @@ const updateContact = async (tenant_id, data = {}) => {
14
14
  emails: [email],
15
15
  name
16
16
  } = tenant
17
-
17
+
18
18
  await axios.post(
19
- `${USERS_URI}/api/contacts`,
19
+ `${API_SERVICE_URI}/v1/contacts`,
20
20
  { email, name, ...data },
21
21
  { headers: { Authorization: `Bearer ${GM_API_KEY}` } }
22
- );
23
- };
22
+ )
23
+ }
24
24
 
25
- module.exports = { updateContact };
25
+ module.exports = { updateContact }
@@ -1,21 +1,21 @@
1
1
  module.exports = {
2
- EVENT_ANNIVERSARY: "anniversary",
3
- EVENT_BIRTHDAY: "birthday",
4
- EVENT_CLICKED_LINK: "clicked_link",
5
- EVENT_NEW_CONTACT: "new_contact",
6
- EVENT_OPENED_CAMPAIGN: "opened_campaign",
7
- EVENT_OPENED_TRANSACTIONAL: "opened_transactional",
8
- EVENT_SUBSCRIPTION: "joined_audience",
9
- EVENT_UNSUBSCRIPTION: "left_audience",
2
+ EVENT_ANNIVERSARY: 'anniversary',
3
+ EVENT_BIRTHDAY: 'birthday',
4
+ EVENT_CLICKED_LINK: 'clicked_link',
5
+ EVENT_NEW_CONTACT: 'new_contact',
6
+ EVENT_OPENED_CAMPAIGN: 'opened_campaign',
7
+ EVENT_OPENED_TRANSACTIONAL: 'opened_transactional',
8
+ EVENT_SUBSCRIPTION: 'joined_audience',
9
+ EVENT_UNSUBSCRIPTION: 'left_audience',
10
10
 
11
11
  //
12
- EFFECT_ADD_CONTACT_ATTRIBUTE: "add_attribute_to_contact",
13
- EFFECT_ADD_CONTACT_TAG: "add_tag_to_contact",
14
- EFFECT_REMOVE_CONTACT_TAG: "remove_tag_from_contact",
15
- EFFECT_REMOVE_CONTACT: "delete_contact",
16
- EFFECT_SEND_TRANSACTIONAL: "send_transactional_email",
17
- EFFECT_SEND_SMS: "send_sms",
18
- EFFECT_SEND_WEB_PUSH: "send_web_push_message",
19
- EFFECT_SUBSCRIBE: "add_to_audience",
20
- EFFECT_UNSUBSCRIBE: "remove_from_audience",
21
- };
12
+ EFFECT_ADD_CONTACT_ATTRIBUTE: 'add_attribute_to_contact',
13
+ EFFECT_ADD_CONTACT_TAG: 'add_tag_to_contact',
14
+ EFFECT_REMOVE_CONTACT_TAG: 'remove_tag_from_contact',
15
+ EFFECT_REMOVE_CONTACT: 'delete_contact',
16
+ EFFECT_SEND_TRANSACTIONAL: 'send_transactional_email',
17
+ EFFECT_SEND_SMS: 'send_sms',
18
+ EFFECT_SEND_WEB_PUSH: 'send_web_push_message',
19
+ EFFECT_SUBSCRIBE: 'add_to_audience',
20
+ EFFECT_UNSUBSCRIBE: 'remove_from_audience'
21
+ }
@@ -1,7 +1,7 @@
1
- const { triggerEvent } = require("../clients/automata");
2
- const { updateContact } = require("../clients/users");
1
+ const { triggerEvent } = require('../clients/automata')
2
+ const { updateContact } = require('../clients/users')
3
3
 
4
4
  module.exports = {
5
5
  triggerEvent,
6
- updateContact,
7
- };
6
+ updateContact
7
+ }
@@ -2,7 +2,7 @@ const { Schema } = require('redis-om')
2
2
 
3
3
  const APIKeySchema = new Schema('apikey', {
4
4
  key: { type: 'string' },
5
- tenant_id: { type: 'number'}
5
+ tenant_id: { type: 'number' }
6
6
  })
7
7
 
8
8
  module.exports = {
@@ -1,14 +1,14 @@
1
- const { ActivityLogSchema } = require("./iam/Activity");
2
- const { ContactImportSchema } = require("./Contact");
3
- const { PostalSchema } = require("./Postal");
4
- const { TaskSchema } = require("./automation/Task");
5
- const { CampaignSchema, CampaignConversionSchema } = require("./mailing/Campaign");
6
- const { LinkSchema } = require("./mailing/Link");
7
- const { MailActionSchema } = require("./mailing/Mailaction");
8
- const { SubscriptionSchema } = require("./sales/Subscription");
9
- const { AutoTopUpSchema } = require("./sales/Wallet");
10
- const { APIKeySchema } = require("./iam/Key");
11
- const { TransactionalSchema } = require("./mailing/Transactonal");
1
+ const { ActivityLogSchema } = require('./iam/Activity')
2
+ const { ContactDownloadSchema, ContactImportSchema } = require('./user/Contact')
3
+ const { PostalSchema } = require('./postal')
4
+ const { TaskSchema } = require('./automation/Task')
5
+ const { CampaignSchema, CampaignConversionSchema } = require('./mailing/Campaign')
6
+ const { LinkSchema } = require('./mailing/Link')
7
+ const { MailActionSchema } = require('./mailing/Mailaction')
8
+ const { SubscriptionSchema } = require('./sales/Subscription')
9
+ const { AutoTopUpSchema } = require('./sales/Wallet')
10
+ const { APIKeySchema } = require('./iam/Key')
11
+ const { TransactionalSchema } = require('./mailing/Transactonal')
12
12
 
13
13
  module.exports = {
14
14
  ActivityLogSchema,
@@ -17,10 +17,11 @@ module.exports = {
17
17
  AutoTopUpSchema,
18
18
  CampaignConversionSchema,
19
19
  CampaignSchema,
20
+ ContactDownloadSchema,
20
21
  ContactImportSchema,
21
22
  LinkSchema,
22
23
  MailActionSchema,
23
24
  PostalSchema,
24
25
  SubscriptionSchema,
25
- TransactionalSchema,
26
- };
26
+ TransactionalSchema
27
+ }
@@ -1,16 +1,16 @@
1
- const { Schema } = require("redis-om");
1
+ const { Schema } = require('redis-om')
2
2
 
3
- const CampaignSchema = new Schema("campaign", {
4
- id: { type: "number" },
5
- status: { type: "string" },
6
- });
3
+ const CampaignSchema = new Schema('campaign', {
4
+ id: { type: 'number' },
5
+ status: { type: 'string' }
6
+ })
7
7
 
8
- const CampaignConversionSchema = new Schema("campaign_conversion", {
9
- id: { type: "string" },
10
- campaign_id: { type: "string" },
11
- });
8
+ const CampaignConversionSchema = new Schema('campaign_conversion', {
9
+ id: { type: 'string' },
10
+ campaign_id: { type: 'string' }
11
+ })
12
12
 
13
13
  module.exports = {
14
14
  CampaignConversionSchema,
15
- CampaignSchema,
16
- };
15
+ CampaignSchema
16
+ }
@@ -1,18 +1,18 @@
1
- const { Schema } = require("redis-om");
1
+ const { Schema } = require('redis-om')
2
2
 
3
- const TransactionalSchema = new Schema("transactional", {
4
- id: { type: "number" },
5
- tenant_id: { type: "number" },
6
- body: { type: "string" },
7
- code: { type: "string" },
8
- subject: { type: "string" },
9
- sender_email: { type: "string" },
10
- sender_name: { type: "string" },
11
- is_active: { type: "boolean" },
12
- is_deleted: { type: "boolean" },
13
- is_marketer_managed: { type: "boolean" },
14
- });
3
+ const TransactionalSchema = new Schema('transactional', {
4
+ id: { type: 'number' },
5
+ tenant_id: { type: 'number' },
6
+ body: { type: 'string' },
7
+ code: { type: 'string' },
8
+ subject: { type: 'string' },
9
+ sender_email: { type: 'string' },
10
+ sender_name: { type: 'string' },
11
+ is_active: { type: 'boolean' },
12
+ is_deleted: { type: 'boolean' },
13
+ is_marketer_managed: { type: 'boolean' }
14
+ })
15
15
 
16
16
  module.exports = {
17
- TransactionalSchema,
18
- };
17
+ TransactionalSchema
18
+ }
@@ -1,9 +1,9 @@
1
- const { Schema } = require("redis-om");
1
+ const { Schema } = require('redis-om')
2
2
 
3
- const SubscriptionSchema = new Schema("subscription", {
4
- tenant_id: { type: "string" },
5
- });
3
+ const SubscriptionSchema = new Schema('subscription', {
4
+ tenant_id: { type: 'string' }
5
+ })
6
6
 
7
7
  module.exports = {
8
- SubscriptionSchema,
9
- };
8
+ SubscriptionSchema
9
+ }
@@ -0,0 +1,17 @@
1
+ const { Schema } = require('redis-om')
2
+
3
+ const ContactDownloadSchema = new Schema('contactdownload', {
4
+ tenant_id: { type: 'number' },
5
+ contact_count: { type: 'number' },
6
+ file_name: { type: 'string' },
7
+ last_batch_processed: { type: 'number' }
8
+ })
9
+
10
+ const ContactImportSchema = new Schema('contactimport', {
11
+ data: { type: 'string' }
12
+ })
13
+
14
+ module.exports = {
15
+ ContactDownloadSchema,
16
+ ContactImportSchema
17
+ }
@@ -1,11 +1,11 @@
1
- const Chart = require("./chart");
2
- const Date = require("./date");
3
- const Number = require("./number");
4
- const Text = require("./text");
1
+ const Chart = require('./chart')
2
+ const Date = require('./date')
3
+ const Number = require('./number')
4
+ const Text = require('./text')
5
5
 
6
6
  module.exports = {
7
7
  Chart,
8
8
  Date,
9
9
  Number,
10
- Text,
11
- };
10
+ Text
11
+ }
@@ -1,11 +1,11 @@
1
1
  module.exports = {
2
2
  convertToPercent: (value, total) => {
3
- if (!value || !total) return 0;
4
- return (Number(value) / Number(total)) * 100;
3
+ if (!value || !total) return 0
4
+ return (Number(value) / Number(total)) * 100
5
5
  },
6
6
  toReadableNumber: (value) => {
7
- if (!value) return 0;
8
- if (isNaN(value)) return value;
9
- return Number(Number(value).toFixed(2)).toLocaleString();
10
- },
11
- };
7
+ if (!value) return 0
8
+ if (isNaN(value)) return value
9
+ return Number(Number(value).toFixed(2)).toLocaleString()
10
+ }
11
+ }
@@ -1,32 +1,32 @@
1
- const flattenObject = (object = {}, result = {}, concatenate_keys = false, root_key = "") => {
2
- let flattened_object = {};
1
+ const flattenObject = (object = {}, result = {}, concatenate_keys = false, root_key = '') => {
2
+ let flattened_object = {}
3
3
 
4
- const entries = Object.entries(object);
4
+ const entries = Object.entries(object)
5
5
 
6
- for (let [key, value] of entries) {
7
- const item_key = root_key && concatenate_keys ? `${root_key}.${key}` : key;
8
- if (value && typeof value === "object") {
9
- flattened_object = { ...flattenObject(value, { ...flattened_object }, concatenate_keys, item_key) };
6
+ for (const [key, value] of entries) {
7
+ const item_key = root_key && concatenate_keys ? `${root_key}.${key}` : key
8
+ if (value && typeof value === 'object') {
9
+ flattened_object = { ...flattenObject(value, { ...flattened_object }, concatenate_keys, item_key) }
10
10
  } else {
11
- flattened_object[item_key] = value;
11
+ flattened_object[item_key] = value
12
12
  }
13
13
  }
14
14
 
15
- return { ...result, ...flattened_object };
16
- };
15
+ return { ...result, ...flattened_object }
16
+ }
17
17
 
18
18
  const scrambleSensitiveData = (SENSITIVE_DATA_KEYS = [], object = {}) => {
19
- const scrambled_data = {};
19
+ const scrambled_data = {}
20
20
  for (const [key, value] of Object.entries(object)) {
21
- scrambled_data[key] = value;
21
+ scrambled_data[key] = value
22
22
  for (const piid_key of SENSITIVE_DATA_KEYS) {
23
23
  if (key.toLowerCase().includes(piid_key.toLowerCase())) {
24
- scrambled_data[key] = value.toString().replace(/\w/gi, "*");
24
+ scrambled_data[key] = value.toString().replace(/\w/gi, '*')
25
25
  }
26
26
  }
27
27
  }
28
28
 
29
- return scrambled_data;
30
- };
29
+ return scrambled_data
30
+ }
31
31
 
32
- module.exports = { flattenObject, scrambleSensitiveData };
32
+ module.exports = { flattenObject, scrambleSensitiveData }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-mailer/jarvis",
3
- "version": "9.0.0",
3
+ "version": "10.0.0",
4
4
  "main": "index.js",
5
5
  "repository": "git@github.com:go-mailer-ltd/jarvis-node.git",
6
6
  "author": "Nathan Oguntuberu <nateoguns.work@gmail.com>",
@@ -1,9 +0,0 @@
1
- const { Schema } = require('redis-om')
2
-
3
- const ContactImportSchema = new Schema('contactimport', {
4
- data: { type: 'string' }
5
- })
6
-
7
- module.exports = {
8
- ContactImportSchema
9
- }