@capillarytech/creatives-library 8.0.87-alpha.14 → 8.0.87-alpha.15

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "8.0.87-alpha.14",
4
+ "version": "8.0.87-alpha.15",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -21,17 +21,19 @@ export const transformSmsPayload = (smsData, options = {}) => {
21
21
  const { smsDeliverySettings } = transformedMessageDetails;
22
22
 
23
23
  return {
24
- ouId: ouId || -1,
25
- sourceEntityId: actionId,
26
- channel: "SMS",
27
- module,
28
- smsMessageContent: {
24
+ centralCommsPayload: {
25
+ ouId: ouId || -1,
26
+ sourceEntityId: actionId,
29
27
  channel: "SMS",
30
- message: smsData.messageBody || ""
31
- },
32
- smsDeliverySettings: smsDeliverySettings || {},
33
- executionParams: {},
34
- clientName: clientName || "EMF"
28
+ module,
29
+ smsMessageContent: {
30
+ channel: "SMS",
31
+ message: smsData.messageBody || ""
32
+ },
33
+ smsDeliverySettings: smsDeliverySettings || {},
34
+ executionParams: {},
35
+ clientName: clientName || "EMF"
36
+ }
35
37
  };
36
38
  };
37
39
 
@@ -58,18 +60,20 @@ export const transformEmailPayload = (emailData, options = {}) => {
58
60
  const { emailDeliverySettings = {} } = transformedMessageDetails;
59
61
 
60
62
  return {
61
- ouId: ouId || -1,
62
- sourceEntityId: actionId,
63
- channel: "EMAIL",
64
- module,
65
- emailMessageContent: {
63
+ centralCommsPayload: {
64
+ ouId: ouId || -1,
65
+ sourceEntityId: actionId,
66
66
  channel: "EMAIL",
67
- messageBody: emailData.emailBody || "",
68
- messageSubject: emailData.emailSubject || ""
69
- },
70
- emailDeliverySettings: emailDeliverySettings || {},
71
- executionParams: {},
72
- clientName: clientName || "EMF"
67
+ module,
68
+ emailMessageContent: {
69
+ channel: "EMAIL",
70
+ messageBody: emailData.emailBody || "",
71
+ messageSubject: emailData.emailSubject || ""
72
+ },
73
+ emailDeliverySettings: emailDeliverySettings || {},
74
+ executionParams: {},
75
+ clientName: clientName || "EMF"
76
+ }
73
77
  };
74
78
  };
75
79
 
@@ -107,66 +111,68 @@ export const transformMpushPayload = (mpushData, options = {}) => {
107
111
  };
108
112
 
109
113
  return {
110
- channel: "PUSH",
111
- ouId: ouId || -1,
112
- sourceEntityId: actionId,
113
- clientName: clientName || "VENENO",
114
- module,
115
- mpushMessageContent: {
114
+ centralCommsPayload: {
116
115
  channel: "PUSH",
117
- messageSubject: mpushData.messageSubject || "",
118
- androidContent: {
119
- type: androidContent.type || "TEXT",
120
- deviceType: "ANDROID",
121
- title: androidContent.title || "",
122
- message: androidContent.message || "",
123
- cta: {
124
- type: "EXTERNAL_URL",
125
- actionText: null,
126
- templateCtaId: null,
127
- actionLink: androidContent.cta?.actionLink || ""
116
+ ouId: ouId || -1,
117
+ sourceEntityId: actionId,
118
+ clientName: clientName || "VENENO",
119
+ module,
120
+ mpushMessageContent: {
121
+ channel: "PUSH",
122
+ messageSubject: mpushData.messageSubject || "",
123
+ androidContent: {
124
+ type: androidContent.type || "TEXT",
125
+ deviceType: "ANDROID",
126
+ title: androidContent.title || "",
127
+ message: androidContent.message || "",
128
+ cta: {
129
+ type: "EXTERNAL_URL",
130
+ actionText: null,
131
+ templateCtaId: null,
132
+ actionLink: androidContent.cta?.actionLink || ""
133
+ },
134
+ expandableDetails: {
135
+ style: androidContent.expandableDetails?.style || "BIG_TEXT",
136
+ message: androidContent.expandableDetails?.message || "",
137
+ ctas: androidContent.expandableDetails?.ctas || [],
138
+ image: androidContent.expandableDetails?.image || "",
139
+ categoryId: androidContent.expandableDetails?.categoryId || ""
140
+ },
141
+ customProperties: androidContent.custom || {}
128
142
  },
129
- expandableDetails: {
130
- style: androidContent.expandableDetails?.style || "BIG_TEXT",
131
- message: androidContent.expandableDetails?.message || "",
132
- ctas: androidContent.expandableDetails?.ctas || [],
133
- image: androidContent.expandableDetails?.image || "",
134
- categoryId: androidContent.expandableDetails?.categoryId || ""
143
+ iosContent: {
144
+ type: iosContent.type || "TEXT",
145
+ deviceType: "IOS",
146
+ title: iosContent.title || "",
147
+ message: iosContent.message || "",
148
+ cta: {
149
+ type: "EXTERNAL_URL",
150
+ actionText: null,
151
+ templateCtaId: null,
152
+ actionLink: iosContent.cta?.actionLink || ""
153
+ },
154
+ expandableDetails: {
155
+ style: iosContent.expandableDetails?.style || "BIG_TEXT",
156
+ message: iosContent.expandableDetails?.message || "",
157
+ ctas: iosContent.expandableDetails?.ctas || [],
158
+ image: iosContent.expandableDetails?.image || "",
159
+ categoryId: iosContent.expandableDetails?.categoryId || ""
160
+ },
161
+ customProperties: iosContent.custom || {}
135
162
  },
136
- customProperties: androidContent.custom || {}
163
+ accountId: mpushData.accountId || 0
137
164
  },
138
- iosContent: {
139
- type: iosContent.type || "TEXT",
140
- deviceType: "IOS",
141
- title: iosContent.title || "",
142
- message: iosContent.message || "",
143
- cta: {
144
- type: "EXTERNAL_URL",
145
- actionText: null,
146
- templateCtaId: null,
147
- actionLink: iosContent.cta?.actionLink || ""
148
- },
149
- expandableDetails: {
150
- style: iosContent.expandableDetails?.style || "BIG_TEXT",
151
- message: iosContent.expandableDetails?.message || "",
152
- ctas: iosContent.expandableDetails?.ctas || [],
153
- image: iosContent.expandableDetails?.image || "",
154
- categoryId: iosContent.expandableDetails?.categoryId || ""
165
+ mpushDeliverySettings: mobilePushDeliverySettings || {
166
+ additionalSettings: {
167
+ useTinyUrl: false,
168
+ encryptUrl: false,
169
+ linkTrackingEnabled: false,
170
+ userSubscriptionDisabled: false
155
171
  },
156
- customProperties: iosContent.custom || {}
157
- },
158
- accountId: mpushData.accountId || 0
159
- },
160
- mpushDeliverySettings: mobilePushDeliverySettings || {
161
- additionalSettings: {
162
- useTinyUrl: false,
163
- encryptUrl: false,
164
- linkTrackingEnabled: false,
165
- userSubscriptionDisabled: false
166
- },
167
- channelSettings: {
168
- channel: "PUSH",
169
- domainGatewayMapId: options.domainGatewayMapId || 1
172
+ channelSettings: {
173
+ channel: "PUSH",
174
+ domainGatewayMapId: options.domainGatewayMapId || 1
175
+ }
170
176
  }
171
177
  }
172
178
  };
@@ -198,30 +204,32 @@ export const transformWhatsappPayload = (whatsappData, options = {}) => {
198
204
  const templateConfigs = whatsappData.templateConfigs || {};
199
205
 
200
206
  return {
201
- ouId: ouId || -1,
202
- sourceEntityId: actionId,
203
- channel: "WHATSAPP",
204
- module,
205
- whatsappMessageContent: {
206
- messageBody: whatsappData.messageBody || "",
207
- accountId: whatsappData.accountId || 0,
208
- templateConfigs,
209
- channel: "WHATSAPP"
210
- },
211
- whatsappDeliverySettings: whatsappDeliverySettings || {
212
- additionalSettings: {
213
- encryptUrl: false,
214
- linkTrackingEnabled: false,
215
- useTinyUrl: false
207
+ centralCommsPayload: {
208
+ ouId: ouId || -1,
209
+ sourceEntityId: actionId,
210
+ channel: "WHATSAPP",
211
+ module,
212
+ whatsappMessageContent: {
213
+ messageBody: whatsappData.messageBody || "",
214
+ accountId: whatsappData.accountId || 0,
215
+ templateConfigs,
216
+ channel: "WHATSAPP"
216
217
  },
217
- channelSettings: {
218
- channel: "WHATSAPP",
219
- senderMobNum: whatsappData.senderMobNum || "",
220
- domainId: whatsappData.domainId || 0
221
- }
222
- },
223
- executionParams: {},
224
- clientName: clientName || "VENENO"
218
+ whatsappDeliverySettings: whatsappDeliverySettings || {
219
+ additionalSettings: {
220
+ encryptUrl: false,
221
+ linkTrackingEnabled: false,
222
+ useTinyUrl: false
223
+ },
224
+ channelSettings: {
225
+ channel: "WHATSAPP",
226
+ senderMobNum: whatsappData.senderMobNum || "",
227
+ domainId: whatsappData.domainId || 0
228
+ }
229
+ },
230
+ executionParams: {},
231
+ clientName: clientName || "VENENO"
232
+ }
225
233
  };
226
234
  };
227
235
 
@@ -17,6 +17,7 @@ export const FTP = "FTP";
17
17
  export const NO_COMMUNICATION = "NO_COMMUNICATION";
18
18
  export const VIBER = "VIBER";
19
19
  export const WHATSAPP = "WHATSAPP";
20
+ export const SMALL_CASE_WHATSAPP = "whatsapp";
20
21
  export const RCS = "RCS";
21
22
  export const ZALO = "ZALO";
22
23
  export const INAPP = "INAPP";
@@ -460,6 +460,7 @@ export class Creatives extends React.Component {
460
460
  };
461
461
  break;
462
462
  }
463
+ case constants.SMALL_CASE_WHATSAPP:
463
464
  case constants.WHATSAPP: {
464
465
  const {
465
466
  messageBody = '',