@aws-amplify/notifications 2.0.1-console-preview.11cf989.0 → 2.0.1-console-preview.4ae78ed.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/lib/common/AWSPinpointProviderCommon/index.d.ts +2 -2
- package/lib/common/AWSPinpointProviderCommon/index.js +1 -1
- package/lib/common/AWSPinpointProviderCommon/index.js.map +1 -1
- package/lib/common/AWSPinpointProviderCommon/types.d.ts +2 -2
- package/lib/inAppMessaging/index.d.ts +0 -1
- package/lib/inAppMessaging/index.js +0 -2
- package/lib/inAppMessaging/index.js.map +1 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +55 -2
- package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.js +89 -4
- package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.js.map +1 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/syncMessages.js +1 -2
- package/lib/inAppMessaging/providers/pinpoint/apis/syncMessages.js.map +1 -1
- package/lib/inAppMessaging/providers/pinpoint/types/errors.d.ts +9 -0
- package/lib/inAppMessaging/providers/pinpoint/types/errors.js +15 -0
- package/lib/inAppMessaging/providers/pinpoint/types/errors.js.map +1 -0
- package/lib/inAppMessaging/providers/pinpoint/types/index.d.ts +3 -0
- package/lib/inAppMessaging/providers/pinpoint/types/index.js +7 -0
- package/lib/inAppMessaging/providers/pinpoint/types/index.js.map +1 -0
- package/lib/inAppMessaging/providers/pinpoint/types/inputs.d.ts +6 -0
- package/lib/inAppMessaging/providers/pinpoint/types/inputs.js +5 -0
- package/lib/inAppMessaging/providers/pinpoint/types/inputs.js.map +1 -0
- package/lib/inAppMessaging/providers/pinpoint/types/options.d.ts +5 -0
- package/lib/inAppMessaging/providers/pinpoint/types/options.js +5 -0
- package/lib/inAppMessaging/providers/pinpoint/types/options.js.map +1 -0
- package/lib/inAppMessaging/types/config.d.ts +5 -0
- package/lib/inAppMessaging/types/config.js +3 -0
- package/lib/inAppMessaging/types/config.js.map +1 -0
- package/lib/inAppMessaging/types/event.d.ts +6 -0
- package/lib/inAppMessaging/types/event.js +5 -0
- package/lib/inAppMessaging/types/event.js.map +1 -0
- package/lib/inAppMessaging/types/index.d.ts +5 -0
- package/lib/inAppMessaging/types/index.js +5 -0
- package/lib/inAppMessaging/types/index.js.map +1 -0
- package/lib/inAppMessaging/types/inputs.d.ts +21 -0
- package/lib/inAppMessaging/types/inputs.js +5 -0
- package/lib/inAppMessaging/types/inputs.js.map +1 -0
- package/lib/inAppMessaging/types/message.d.ts +44 -0
- package/lib/inAppMessaging/types/message.js +5 -0
- package/lib/inAppMessaging/types/message.js.map +1 -0
- package/lib/inAppMessaging/types/options.d.ts +4 -0
- package/lib/inAppMessaging/types/options.js +5 -0
- package/lib/inAppMessaging/types/options.js.map +1 -0
- package/lib/index.d.ts +1 -2
- package/lib/index.js +0 -2
- package/lib/index.js.map +1 -1
- package/lib/pushNotifications/providers/AWSPinpointProvider/index.js +4 -4
- package/lib/pushNotifications/providers/AWSPinpointProvider/index.js.map +1 -1
- package/lib/pushNotifications/types.d.ts +3 -9
- package/lib-esm/common/AWSPinpointProviderCommon/index.d.ts +2 -2
- package/lib-esm/common/AWSPinpointProviderCommon/index.js +1 -1
- package/lib-esm/common/AWSPinpointProviderCommon/index.js.map +1 -1
- package/lib-esm/common/AWSPinpointProviderCommon/types.d.ts +2 -2
- package/lib-esm/inAppMessaging/index.d.ts +0 -1
- package/lib-esm/inAppMessaging/index.js +0 -1
- package/lib-esm/inAppMessaging/index.js.map +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +55 -2
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.js +89 -3
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.js.map +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/syncMessages.js +2 -3
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/syncMessages.js.map +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/errors.d.ts +9 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/types/errors.js +13 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/types/errors.js.map +1 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/types/index.d.ts +3 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/types/index.js +4 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/types/index.js.map +1 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.d.ts +6 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.js +3 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.js.map +1 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/types/options.d.ts +5 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/types/options.js +3 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/types/options.js.map +1 -0
- package/lib-esm/inAppMessaging/types/config.d.ts +5 -0
- package/lib-esm/inAppMessaging/types/config.js +1 -0
- package/lib-esm/inAppMessaging/types/config.js.map +1 -0
- package/lib-esm/inAppMessaging/types/event.d.ts +6 -0
- package/lib-esm/inAppMessaging/types/event.js +3 -0
- package/lib-esm/inAppMessaging/types/event.js.map +1 -0
- package/lib-esm/inAppMessaging/types/index.d.ts +5 -0
- package/lib-esm/inAppMessaging/types/index.js +3 -0
- package/lib-esm/inAppMessaging/types/index.js.map +1 -0
- package/lib-esm/inAppMessaging/types/inputs.d.ts +21 -0
- package/lib-esm/inAppMessaging/types/inputs.js +3 -0
- package/lib-esm/inAppMessaging/types/inputs.js.map +1 -0
- package/lib-esm/inAppMessaging/types/message.d.ts +44 -0
- package/lib-esm/inAppMessaging/types/message.js +3 -0
- package/lib-esm/inAppMessaging/types/message.js.map +1 -0
- package/lib-esm/inAppMessaging/types/options.d.ts +4 -0
- package/lib-esm/inAppMessaging/types/options.js +3 -0
- package/lib-esm/inAppMessaging/types/options.js.map +1 -0
- package/lib-esm/index.d.ts +1 -2
- package/lib-esm/index.js +0 -1
- package/lib-esm/index.js.map +1 -1
- package/lib-esm/pushNotifications/providers/AWSPinpointProvider/index.js +4 -4
- package/lib-esm/pushNotifications/providers/AWSPinpointProvider/index.js.map +1 -1
- package/lib-esm/pushNotifications/types.d.ts +3 -9
- package/package.json +4 -4
- package/src/common/AWSPinpointProviderCommon/index.ts +3 -3
- package/src/common/AWSPinpointProviderCommon/types.ts +2 -2
- package/src/inAppMessaging/index.ts +0 -13
- package/src/inAppMessaging/providers/pinpoint/apis/identifyUser.ts +90 -7
- package/src/inAppMessaging/providers/pinpoint/apis/syncMessages.ts +2 -6
- package/src/inAppMessaging/providers/pinpoint/types/errors.ts +12 -0
- package/src/inAppMessaging/providers/pinpoint/types/index.ts +6 -0
- package/src/inAppMessaging/providers/pinpoint/types/inputs.ts +11 -0
- package/src/inAppMessaging/providers/pinpoint/types/options.ts +9 -0
- package/src/inAppMessaging/types/config.ts +8 -0
- package/src/inAppMessaging/types/event.ts +14 -0
- package/src/inAppMessaging/types/index.ts +8 -0
- package/src/inAppMessaging/types/inputs.ts +29 -0
- package/src/inAppMessaging/types/message.ts +62 -0
- package/src/inAppMessaging/types/options.ts +7 -0
- package/src/index.ts +1 -14
- package/src/pushNotifications/providers/AWSPinpointProvider/index.ts +13 -20
- package/src/pushNotifications/types.ts +8 -9
- package/lib/inAppMessaging/providers/pinpoint/utils/utils.d.ts +0 -17
- package/lib/inAppMessaging/providers/pinpoint/utils/utils.js +0 -243
- package/lib/inAppMessaging/providers/pinpoint/utils/utils.js.map +0 -1
- package/lib/inAppMessaging/types.d.ts +0 -87
- package/lib/inAppMessaging/types.js +0 -12
- package/lib/inAppMessaging/types.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/utils.d.ts +0 -17
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/utils.js +0 -241
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/utils.js.map +0 -1
- package/lib-esm/inAppMessaging/types.d.ts +0 -87
- package/lib-esm/inAppMessaging/types.js +0 -10
- package/lib-esm/inAppMessaging/types.js.map +0 -1
- package/src/inAppMessaging/providers/pinpoint/utils/utils.ts +0 -304
- package/src/inAppMessaging/types.ts +0 -142
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
var tslib_1 = require("tslib");
|
|
6
|
-
var utils_1 = require("@aws-amplify/core/internals/utils");
|
|
7
|
-
var isEmpty_1 = tslib_1.__importDefault(require("lodash/isEmpty"));
|
|
8
|
-
var DELIVERY_TYPE = 'IN_APP_MESSAGE';
|
|
9
|
-
var eventNameMemo = {};
|
|
10
|
-
var eventAttributesMemo = {};
|
|
11
|
-
var eventMetricsMemo = {};
|
|
12
|
-
exports.logger = new utils_1.ConsoleLogger('InAppMessaging.AWSPinpointProvider');
|
|
13
|
-
exports.recordAnalyticsEvent = function (event, message) {
|
|
14
|
-
// TODO(V6) : Add back recording here without validation
|
|
15
|
-
// if (Amplify.Analytics && typeof Amplify.Analytics.record === 'function') {
|
|
16
|
-
// const { id, metadata } = message;
|
|
17
|
-
// Amplify.Analytics.record({
|
|
18
|
-
// name: event,
|
|
19
|
-
// attributes: {
|
|
20
|
-
// campaign_id: id,
|
|
21
|
-
// delivery_type: DELIVERY_TYPE,
|
|
22
|
-
// treatment_id: metadata?.treatmentId,
|
|
23
|
-
// },
|
|
24
|
-
// });
|
|
25
|
-
// } else {
|
|
26
|
-
// logger.debug('Analytics module is not registered into Amplify');
|
|
27
|
-
// }
|
|
28
|
-
};
|
|
29
|
-
exports.getStartOfDay = function () {
|
|
30
|
-
var now = new Date();
|
|
31
|
-
now.setHours(0, 0, 0, 0);
|
|
32
|
-
return now.toISOString();
|
|
33
|
-
};
|
|
34
|
-
exports.matchesEventType = function (_a, _b) {
|
|
35
|
-
var CampaignId = _a.CampaignId, Schedule = _a.Schedule;
|
|
36
|
-
var eventType = _b.name;
|
|
37
|
-
var _c;
|
|
38
|
-
var EventType = ((_c = Schedule === null || Schedule === void 0 ? void 0 : Schedule.EventFilter) === null || _c === void 0 ? void 0 : _c.Dimensions).EventType;
|
|
39
|
-
var memoKey = CampaignId + ":" + eventType;
|
|
40
|
-
if (!eventNameMemo.hasOwnProperty(memoKey)) {
|
|
41
|
-
eventNameMemo[memoKey] = !!(EventType === null || EventType === void 0 ? void 0 : EventType.Values.includes(eventType));
|
|
42
|
-
}
|
|
43
|
-
return eventNameMemo[memoKey];
|
|
44
|
-
};
|
|
45
|
-
exports.matchesAttributes = function (_a, _b) {
|
|
46
|
-
var CampaignId = _a.CampaignId, Schedule = _a.Schedule;
|
|
47
|
-
var attributes = _b.attributes;
|
|
48
|
-
var _c;
|
|
49
|
-
var Attributes = ((_c = Schedule === null || Schedule === void 0 ? void 0 : Schedule.EventFilter) === null || _c === void 0 ? void 0 : _c.Dimensions).Attributes;
|
|
50
|
-
if (isEmpty_1.default(Attributes)) {
|
|
51
|
-
// if message does not have attributes defined it does not matter what attributes are on the event
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
if (isEmpty_1.default(attributes)) {
|
|
55
|
-
// if message does have attributes but the event does not then it always fails the check
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
var memoKey = CampaignId + ":" + JSON.stringify(attributes);
|
|
59
|
-
if (!eventAttributesMemo.hasOwnProperty(memoKey)) {
|
|
60
|
-
eventAttributesMemo[memoKey] = Object.entries(Attributes).every(function (_a) {
|
|
61
|
-
var _b = tslib_1.__read(_a, 2), key = _b[0], Values = _b[1].Values;
|
|
62
|
-
return Values.includes(attributes[key]);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
return eventAttributesMemo[memoKey];
|
|
66
|
-
};
|
|
67
|
-
exports.matchesMetrics = function (_a, _b) {
|
|
68
|
-
var CampaignId = _a.CampaignId, Schedule = _a.Schedule;
|
|
69
|
-
var metrics = _b.metrics;
|
|
70
|
-
var _c;
|
|
71
|
-
var Metrics = ((_c = Schedule === null || Schedule === void 0 ? void 0 : Schedule.EventFilter) === null || _c === void 0 ? void 0 : _c.Dimensions).Metrics;
|
|
72
|
-
if (isEmpty_1.default(Metrics)) {
|
|
73
|
-
// if message does not have metrics defined it does not matter what metrics are on the event
|
|
74
|
-
return true;
|
|
75
|
-
}
|
|
76
|
-
if (isEmpty_1.default(metrics)) {
|
|
77
|
-
// if message does have metrics but the event does not then it always fails the check
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
var memoKey = CampaignId + ":" + JSON.stringify(metrics);
|
|
81
|
-
if (!eventMetricsMemo.hasOwnProperty(memoKey)) {
|
|
82
|
-
eventMetricsMemo[memoKey] = Object.entries(Metrics).every(function (_a) {
|
|
83
|
-
var _b = tslib_1.__read(_a, 2), key = _b[0], _c = _b[1], ComparisonOperator = _c.ComparisonOperator, Value = _c.Value;
|
|
84
|
-
var compare = exports.getComparator(ComparisonOperator);
|
|
85
|
-
// if there is some unknown comparison operator, treat as a comparison failure
|
|
86
|
-
return compare ? compare(Value, metrics[key]) : false;
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
return eventMetricsMemo[memoKey];
|
|
90
|
-
};
|
|
91
|
-
exports.getComparator = function (operator) {
|
|
92
|
-
switch (operator) {
|
|
93
|
-
case 'EQUAL':
|
|
94
|
-
return function (metricsVal, eventVal) { return metricsVal === eventVal; };
|
|
95
|
-
case 'GREATER_THAN':
|
|
96
|
-
return function (metricsVal, eventVal) { return metricsVal < eventVal; };
|
|
97
|
-
case 'GREATER_THAN_OR_EQUAL':
|
|
98
|
-
return function (metricsVal, eventVal) { return metricsVal <= eventVal; };
|
|
99
|
-
case 'LESS_THAN':
|
|
100
|
-
return function (metricsVal, eventVal) { return metricsVal > eventVal; };
|
|
101
|
-
case 'LESS_THAN_OR_EQUAL':
|
|
102
|
-
return function (metricsVal, eventVal) { return metricsVal >= eventVal; };
|
|
103
|
-
default:
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
exports.isBeforeEndDate = function (_a) {
|
|
108
|
-
var Schedule = _a.Schedule;
|
|
109
|
-
if (!(Schedule === null || Schedule === void 0 ? void 0 : Schedule.EndDate)) {
|
|
110
|
-
return true;
|
|
111
|
-
}
|
|
112
|
-
return new Date() < new Date(Schedule.EndDate);
|
|
113
|
-
};
|
|
114
|
-
exports.isQuietTime = function (message) {
|
|
115
|
-
var Schedule = message.Schedule;
|
|
116
|
-
if (!(Schedule === null || Schedule === void 0 ? void 0 : Schedule.QuietTime)) {
|
|
117
|
-
return false;
|
|
118
|
-
}
|
|
119
|
-
var pattern = /^[0-2]\d:[0-5]\d$/; // basic sanity check, not a fully featured HH:MM validation
|
|
120
|
-
var _a = Schedule.QuietTime, Start = _a.Start, End = _a.End;
|
|
121
|
-
if (!Start ||
|
|
122
|
-
!End ||
|
|
123
|
-
Start === End ||
|
|
124
|
-
!pattern.test(Start) ||
|
|
125
|
-
!pattern.test(End)) {
|
|
126
|
-
return false;
|
|
127
|
-
}
|
|
128
|
-
var now = new Date();
|
|
129
|
-
var start = new Date(now);
|
|
130
|
-
var end = new Date(now);
|
|
131
|
-
var _b = tslib_1.__read(Start.split(':'), 2), startHours = _b[0], startMinutes = _b[1];
|
|
132
|
-
var _c = tslib_1.__read(End.split(':'), 2), endHours = _c[0], endMinutes = _c[1];
|
|
133
|
-
start.setHours(Number.parseInt(startHours, 10), Number.parseInt(startMinutes, 10), 0, 0);
|
|
134
|
-
end.setHours(Number.parseInt(endHours, 10), Number.parseInt(endMinutes, 10), 0, 0);
|
|
135
|
-
// if quiet time includes midnight, bump the end time to the next day
|
|
136
|
-
if (start > end) {
|
|
137
|
-
end.setDate(end.getDate() + 1);
|
|
138
|
-
}
|
|
139
|
-
var isQuietTime = now >= start && now <= end;
|
|
140
|
-
if (isQuietTime) {
|
|
141
|
-
exports.logger.debug('message filtered due to quiet time', message);
|
|
142
|
-
}
|
|
143
|
-
return isQuietTime;
|
|
144
|
-
};
|
|
145
|
-
exports.clearMemo = function () {
|
|
146
|
-
eventNameMemo = {};
|
|
147
|
-
eventAttributesMemo = {};
|
|
148
|
-
eventMetricsMemo = {};
|
|
149
|
-
};
|
|
150
|
-
// in the pinpoint console when a message is created with a Modal or Full Screen layout,
|
|
151
|
-
// it is assigned a layout value of MOBILE_FEED or OVERLAYS respectively in the message payload.
|
|
152
|
-
// In the future, Pinpoint will be updating the layout values in the aforementioned scenario
|
|
153
|
-
// to MODAL and FULL_SCREEN.
|
|
154
|
-
//
|
|
155
|
-
// This utility acts as a safeguard to ensure that:
|
|
156
|
-
// - 1. the usage of MOBILE_FEED and OVERLAYS as values for message layouts are not leaked
|
|
157
|
-
// outside the Pinpoint provider
|
|
158
|
-
// - 2. Amplify correctly handles the legacy layout values from Pinpoint after they are updated
|
|
159
|
-
exports.interpretLayout = function (layout) {
|
|
160
|
-
if (layout === 'MOBILE_FEED') {
|
|
161
|
-
return 'MODAL';
|
|
162
|
-
}
|
|
163
|
-
if (layout === 'OVERLAYS') {
|
|
164
|
-
return 'FULL_SCREEN';
|
|
165
|
-
}
|
|
166
|
-
// cast as PinpointInAppMessage['InAppMessage']['Layout'] allows `string` as a value
|
|
167
|
-
return layout;
|
|
168
|
-
};
|
|
169
|
-
exports.extractContent = function (_a) {
|
|
170
|
-
var message = _a.InAppMessage;
|
|
171
|
-
var _b, _c;
|
|
172
|
-
return ((_c = (_b = message === null || message === void 0 ? void 0 : message.Content) === null || _b === void 0 ? void 0 : _b.map(function (content) {
|
|
173
|
-
var BackgroundColor = content.BackgroundColor, BodyConfig = content.BodyConfig, HeaderConfig = content.HeaderConfig, ImageUrl = content.ImageUrl, PrimaryBtn = content.PrimaryBtn, SecondaryBtn = content.SecondaryBtn;
|
|
174
|
-
var defaultPrimaryButton = PrimaryBtn === null || PrimaryBtn === void 0 ? void 0 : PrimaryBtn.DefaultConfig;
|
|
175
|
-
var defaultSecondaryButton = SecondaryBtn === null || SecondaryBtn === void 0 ? void 0 : SecondaryBtn.DefaultConfig;
|
|
176
|
-
var extractedContent = {};
|
|
177
|
-
if (BackgroundColor) {
|
|
178
|
-
extractedContent.container = {
|
|
179
|
-
style: {
|
|
180
|
-
backgroundColor: BackgroundColor,
|
|
181
|
-
},
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
if (HeaderConfig) {
|
|
185
|
-
extractedContent.header = {
|
|
186
|
-
content: HeaderConfig.Header,
|
|
187
|
-
style: {
|
|
188
|
-
color: HeaderConfig.TextColor,
|
|
189
|
-
textAlign: HeaderConfig.Alignment.toLowerCase(),
|
|
190
|
-
},
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
if (BodyConfig) {
|
|
194
|
-
extractedContent.body = {
|
|
195
|
-
content: BodyConfig.Body,
|
|
196
|
-
style: {
|
|
197
|
-
color: BodyConfig.TextColor,
|
|
198
|
-
textAlign: BodyConfig.Alignment.toLowerCase(),
|
|
199
|
-
},
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
if (ImageUrl) {
|
|
203
|
-
extractedContent.image = {
|
|
204
|
-
src: ImageUrl,
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
if (defaultPrimaryButton) {
|
|
208
|
-
extractedContent.primaryButton = {
|
|
209
|
-
title: defaultPrimaryButton.Text,
|
|
210
|
-
action: defaultPrimaryButton.ButtonAction,
|
|
211
|
-
url: defaultPrimaryButton.Link,
|
|
212
|
-
style: {
|
|
213
|
-
backgroundColor: defaultPrimaryButton.BackgroundColor,
|
|
214
|
-
borderRadius: defaultPrimaryButton.BorderRadius,
|
|
215
|
-
color: defaultPrimaryButton.TextColor,
|
|
216
|
-
},
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
if (defaultSecondaryButton) {
|
|
220
|
-
extractedContent.secondaryButton = {
|
|
221
|
-
title: defaultSecondaryButton.Text,
|
|
222
|
-
action: defaultSecondaryButton.ButtonAction,
|
|
223
|
-
url: defaultSecondaryButton.Link,
|
|
224
|
-
style: {
|
|
225
|
-
backgroundColor: defaultSecondaryButton.BackgroundColor,
|
|
226
|
-
borderRadius: defaultSecondaryButton.BorderRadius,
|
|
227
|
-
color: defaultSecondaryButton.TextColor,
|
|
228
|
-
},
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
return extractedContent;
|
|
232
|
-
})) !== null && _c !== void 0 ? _c : []);
|
|
233
|
-
};
|
|
234
|
-
exports.extractMetadata = function (_a) {
|
|
235
|
-
var InAppMessage = _a.InAppMessage, Priority = _a.Priority, Schedule = _a.Schedule, TreatmentId = _a.TreatmentId;
|
|
236
|
-
return ({
|
|
237
|
-
customData: InAppMessage === null || InAppMessage === void 0 ? void 0 : InAppMessage.CustomConfig,
|
|
238
|
-
endDate: Schedule === null || Schedule === void 0 ? void 0 : Schedule.EndDate,
|
|
239
|
-
priority: Priority,
|
|
240
|
-
treatmentId: TreatmentId,
|
|
241
|
-
});
|
|
242
|
-
};
|
|
243
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/inAppMessaging/providers/pinpoint/utils/utils.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,2DAAkE;AAElE,mEAAqC;AAYrC,IAAM,aAAa,GAAG,gBAAgB,CAAC;AAEvC,IAAI,aAAa,GAAG,EAAE,CAAC;AACvB,IAAI,mBAAmB,GAAG,EAAE,CAAC;AAC7B,IAAI,gBAAgB,GAAG,EAAE,CAAC;AAEb,QAAA,MAAM,GAAG,IAAI,qBAAa,CAAC,oCAAoC,CAAC,CAAC;AAEjE,QAAA,oBAAoB,GAAG,UACnC,KAA8B,EAC9B,OAAqB;IAErB,wDAAwD;IACxD,6EAA6E;IAC7E,qCAAqC;IACrC,8BAA8B;IAC9B,iBAAiB;I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E,QAAQ;QAClB,WAAW,EAAE,WAAW;KACxB,CAAC;AALoD,CAKpD,CAAC"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { EventListener } from '../common';
|
|
2
|
-
import { AWSPinpointProviderConfig } from '../common/AWSPinpointProviderCommon/types';
|
|
3
|
-
import { NotificationsProvider, NotificationsSubCategory as NotificationsSubCategories, UserInfo } from '../types';
|
|
4
|
-
export declare type NotificationsSubCategory = Extract<NotificationsSubCategories, 'InAppMessaging'>;
|
|
5
|
-
export interface InAppMessagingInterface {
|
|
6
|
-
configure: (config: InAppMessagingConfig) => InAppMessagingConfig;
|
|
7
|
-
getModuleName: () => NotificationsSubCategory;
|
|
8
|
-
getPluggable: (providerName: string) => InAppMessagingProvider;
|
|
9
|
-
addPluggable: (pluggable: InAppMessagingProvider) => void;
|
|
10
|
-
removePluggable: (providerName: string) => void;
|
|
11
|
-
syncMessages: () => Promise<void[]>;
|
|
12
|
-
clearMessages: () => Promise<void[]>;
|
|
13
|
-
dispatchEvent: (event: InAppMessagingEvent) => Promise<void>;
|
|
14
|
-
identifyUser: (userId: string, userInfo: UserInfo) => Promise<void[]>;
|
|
15
|
-
onMessageReceived: (handler: OnMessageInteractionEventHandler) => EventListener<OnMessageInteractionEventHandler>;
|
|
16
|
-
onMessageDisplayed: (handler: OnMessageInteractionEventHandler) => EventListener<OnMessageInteractionEventHandler>;
|
|
17
|
-
onMessageDismissed: (handler: OnMessageInteractionEventHandler) => EventListener<OnMessageInteractionEventHandler>;
|
|
18
|
-
onMessageActionTaken: (handler: OnMessageInteractionEventHandler) => EventListener<OnMessageInteractionEventHandler>;
|
|
19
|
-
notifyMessageInteraction: (message: InAppMessage, type: InAppMessageInteractionEvent) => void;
|
|
20
|
-
setConflictHandler: (handler: InAppMessageConflictHandler) => void;
|
|
21
|
-
}
|
|
22
|
-
export interface InAppMessagingProvider extends NotificationsProvider {
|
|
23
|
-
getSubCategory(): NotificationsSubCategory;
|
|
24
|
-
getInAppMessages(): Promise<any>;
|
|
25
|
-
processInAppMessages(messages: InAppMessage[], event: InAppMessagingEvent): Promise<InAppMessage[]>;
|
|
26
|
-
}
|
|
27
|
-
export interface InAppMessagingConfig {
|
|
28
|
-
listenForAnalyticsEvents?: boolean;
|
|
29
|
-
AWSPinpoint?: AWSPinpointProviderConfig;
|
|
30
|
-
}
|
|
31
|
-
export declare type InAppMessagingEvent = {
|
|
32
|
-
name: string;
|
|
33
|
-
attributes?: Record<string, string>;
|
|
34
|
-
metrics?: Record<string, number>;
|
|
35
|
-
};
|
|
36
|
-
export declare type InAppMessageLayout = 'BOTTOM_BANNER' | 'CAROUSEL' | 'FULL_SCREEN' | 'MIDDLE_BANNER' | 'MODAL' | 'TOP_BANNER';
|
|
37
|
-
export declare type InAppMessageAction = 'CLOSE' | 'DEEP_LINK' | 'LINK';
|
|
38
|
-
export declare type InAppMessageTextAlign = 'center' | 'left' | 'right';
|
|
39
|
-
interface InAppMessageContainer {
|
|
40
|
-
style?: InAppMessageStyle;
|
|
41
|
-
}
|
|
42
|
-
interface InAppMessageHeader {
|
|
43
|
-
content: string;
|
|
44
|
-
style?: InAppMessageStyle;
|
|
45
|
-
}
|
|
46
|
-
interface InAppMessageBody {
|
|
47
|
-
content: string;
|
|
48
|
-
style?: InAppMessageStyle;
|
|
49
|
-
}
|
|
50
|
-
export interface InAppMessageImage {
|
|
51
|
-
src: string;
|
|
52
|
-
}
|
|
53
|
-
export interface InAppMessageButton {
|
|
54
|
-
title: string;
|
|
55
|
-
action: InAppMessageAction;
|
|
56
|
-
url?: string;
|
|
57
|
-
style?: InAppMessageStyle;
|
|
58
|
-
}
|
|
59
|
-
export interface InAppMessageStyle {
|
|
60
|
-
backgroundColor?: string;
|
|
61
|
-
borderRadius?: number;
|
|
62
|
-
color?: string;
|
|
63
|
-
textAlign?: InAppMessageTextAlign;
|
|
64
|
-
}
|
|
65
|
-
export interface InAppMessageContent {
|
|
66
|
-
container?: InAppMessageContainer;
|
|
67
|
-
header?: InAppMessageHeader;
|
|
68
|
-
body?: InAppMessageBody;
|
|
69
|
-
image?: InAppMessageImage;
|
|
70
|
-
primaryButton?: InAppMessageButton;
|
|
71
|
-
secondaryButton?: InAppMessageButton;
|
|
72
|
-
}
|
|
73
|
-
export interface InAppMessage {
|
|
74
|
-
id: string;
|
|
75
|
-
layout: InAppMessageLayout;
|
|
76
|
-
content: InAppMessageContent[];
|
|
77
|
-
metadata?: any;
|
|
78
|
-
}
|
|
79
|
-
export declare type OnMessageInteractionEventHandler = (message: InAppMessage) => any;
|
|
80
|
-
export declare enum InAppMessageInteractionEvent {
|
|
81
|
-
MESSAGE_RECEIVED = "MESSAGE_RECEIVED_EVENT",
|
|
82
|
-
MESSAGE_DISPLAYED = "MESSAGE_DISPLAYED_EVENT",
|
|
83
|
-
MESSAGE_DISMISSED = "MESSAGE_DISMISSED_EVENT",
|
|
84
|
-
MESSAGE_ACTION_TAKEN = "MESSAGE_ACTION_TAKEN_EVENT"
|
|
85
|
-
}
|
|
86
|
-
export declare type InAppMessageConflictHandler = (messages: InAppMessage[]) => InAppMessage;
|
|
87
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
var InAppMessageInteractionEvent;
|
|
6
|
-
(function (InAppMessageInteractionEvent) {
|
|
7
|
-
InAppMessageInteractionEvent["MESSAGE_RECEIVED"] = "MESSAGE_RECEIVED_EVENT";
|
|
8
|
-
InAppMessageInteractionEvent["MESSAGE_DISPLAYED"] = "MESSAGE_DISPLAYED_EVENT";
|
|
9
|
-
InAppMessageInteractionEvent["MESSAGE_DISMISSED"] = "MESSAGE_DISMISSED_EVENT";
|
|
10
|
-
InAppMessageInteractionEvent["MESSAGE_ACTION_TAKEN"] = "MESSAGE_ACTION_TAKEN_EVENT";
|
|
11
|
-
})(InAppMessageInteractionEvent = exports.InAppMessageInteractionEvent || (exports.InAppMessageInteractionEvent = {}));
|
|
12
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/inAppMessaging/types.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;AAmItC,IAAY,4BAKX;AALD,WAAY,4BAA4B;IACvC,2EAA2C,CAAA;IAC3C,6EAA6C,CAAA;IAC7C,6EAA6C,CAAA;IAC7C,mFAAmD,CAAA;AACpD,CAAC,EALW,4BAA4B,GAA5B,oCAA4B,KAA5B,oCAA4B,QAKvC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ConsoleLogger } from '@aws-amplify/core/internals/utils';
|
|
2
|
-
import type { InAppMessageCampaign as PinpointInAppMessage } from '@aws-amplify/core/internals/aws-clients/pinpoint';
|
|
3
|
-
import { InAppMessage, InAppMessageContent, InAppMessageLayout, InAppMessagingEvent } from '../../../types';
|
|
4
|
-
import { AWSPinpointMessageEvent, MetricsComparator } from '../types/types';
|
|
5
|
-
export declare const logger: ConsoleLogger;
|
|
6
|
-
export declare const recordAnalyticsEvent: (event: AWSPinpointMessageEvent, message: InAppMessage) => void;
|
|
7
|
-
export declare const getStartOfDay: () => string;
|
|
8
|
-
export declare const matchesEventType: ({ CampaignId, Schedule }: PinpointInAppMessage, { name: eventType }: InAppMessagingEvent) => any;
|
|
9
|
-
export declare const matchesAttributes: ({ CampaignId, Schedule }: PinpointInAppMessage, { attributes }: InAppMessagingEvent) => boolean;
|
|
10
|
-
export declare const matchesMetrics: ({ CampaignId, Schedule }: PinpointInAppMessage, { metrics }: InAppMessagingEvent) => boolean;
|
|
11
|
-
export declare const getComparator: (operator: string) => MetricsComparator;
|
|
12
|
-
export declare const isBeforeEndDate: ({ Schedule, }: PinpointInAppMessage) => boolean;
|
|
13
|
-
export declare const isQuietTime: (message: PinpointInAppMessage) => boolean;
|
|
14
|
-
export declare const clearMemo: () => void;
|
|
15
|
-
export declare const interpretLayout: (layout: string) => InAppMessageLayout;
|
|
16
|
-
export declare const extractContent: ({ InAppMessage: message, }: PinpointInAppMessage) => InAppMessageContent[];
|
|
17
|
-
export declare const extractMetadata: ({ InAppMessage, Priority, Schedule, TreatmentId, }: PinpointInAppMessage) => any;
|
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { __read } from "tslib";
|
|
4
|
-
import { ConsoleLogger } from '@aws-amplify/core/internals/utils';
|
|
5
|
-
import isEmpty from 'lodash/isEmpty';
|
|
6
|
-
var DELIVERY_TYPE = 'IN_APP_MESSAGE';
|
|
7
|
-
var eventNameMemo = {};
|
|
8
|
-
var eventAttributesMemo = {};
|
|
9
|
-
var eventMetricsMemo = {};
|
|
10
|
-
export var logger = new ConsoleLogger('InAppMessaging.AWSPinpointProvider');
|
|
11
|
-
export var recordAnalyticsEvent = function (event, message) {
|
|
12
|
-
// TODO(V6) : Add back recording here without validation
|
|
13
|
-
// if (Amplify.Analytics && typeof Amplify.Analytics.record === 'function') {
|
|
14
|
-
// const { id, metadata } = message;
|
|
15
|
-
// Amplify.Analytics.record({
|
|
16
|
-
// name: event,
|
|
17
|
-
// attributes: {
|
|
18
|
-
// campaign_id: id,
|
|
19
|
-
// delivery_type: DELIVERY_TYPE,
|
|
20
|
-
// treatment_id: metadata?.treatmentId,
|
|
21
|
-
// },
|
|
22
|
-
// });
|
|
23
|
-
// } else {
|
|
24
|
-
// logger.debug('Analytics module is not registered into Amplify');
|
|
25
|
-
// }
|
|
26
|
-
};
|
|
27
|
-
export var getStartOfDay = function () {
|
|
28
|
-
var now = new Date();
|
|
29
|
-
now.setHours(0, 0, 0, 0);
|
|
30
|
-
return now.toISOString();
|
|
31
|
-
};
|
|
32
|
-
export var matchesEventType = function (_a, _b) {
|
|
33
|
-
var CampaignId = _a.CampaignId, Schedule = _a.Schedule;
|
|
34
|
-
var eventType = _b.name;
|
|
35
|
-
var _c;
|
|
36
|
-
var EventType = ((_c = Schedule === null || Schedule === void 0 ? void 0 : Schedule.EventFilter) === null || _c === void 0 ? void 0 : _c.Dimensions).EventType;
|
|
37
|
-
var memoKey = CampaignId + ":" + eventType;
|
|
38
|
-
if (!eventNameMemo.hasOwnProperty(memoKey)) {
|
|
39
|
-
eventNameMemo[memoKey] = !!(EventType === null || EventType === void 0 ? void 0 : EventType.Values.includes(eventType));
|
|
40
|
-
}
|
|
41
|
-
return eventNameMemo[memoKey];
|
|
42
|
-
};
|
|
43
|
-
export var matchesAttributes = function (_a, _b) {
|
|
44
|
-
var CampaignId = _a.CampaignId, Schedule = _a.Schedule;
|
|
45
|
-
var attributes = _b.attributes;
|
|
46
|
-
var _c;
|
|
47
|
-
var Attributes = ((_c = Schedule === null || Schedule === void 0 ? void 0 : Schedule.EventFilter) === null || _c === void 0 ? void 0 : _c.Dimensions).Attributes;
|
|
48
|
-
if (isEmpty(Attributes)) {
|
|
49
|
-
// if message does not have attributes defined it does not matter what attributes are on the event
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
if (isEmpty(attributes)) {
|
|
53
|
-
// if message does have attributes but the event does not then it always fails the check
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
var memoKey = CampaignId + ":" + JSON.stringify(attributes);
|
|
57
|
-
if (!eventAttributesMemo.hasOwnProperty(memoKey)) {
|
|
58
|
-
eventAttributesMemo[memoKey] = Object.entries(Attributes).every(function (_a) {
|
|
59
|
-
var _b = __read(_a, 2), key = _b[0], Values = _b[1].Values;
|
|
60
|
-
return Values.includes(attributes[key]);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
return eventAttributesMemo[memoKey];
|
|
64
|
-
};
|
|
65
|
-
export var matchesMetrics = function (_a, _b) {
|
|
66
|
-
var CampaignId = _a.CampaignId, Schedule = _a.Schedule;
|
|
67
|
-
var metrics = _b.metrics;
|
|
68
|
-
var _c;
|
|
69
|
-
var Metrics = ((_c = Schedule === null || Schedule === void 0 ? void 0 : Schedule.EventFilter) === null || _c === void 0 ? void 0 : _c.Dimensions).Metrics;
|
|
70
|
-
if (isEmpty(Metrics)) {
|
|
71
|
-
// if message does not have metrics defined it does not matter what metrics are on the event
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
if (isEmpty(metrics)) {
|
|
75
|
-
// if message does have metrics but the event does not then it always fails the check
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
var memoKey = CampaignId + ":" + JSON.stringify(metrics);
|
|
79
|
-
if (!eventMetricsMemo.hasOwnProperty(memoKey)) {
|
|
80
|
-
eventMetricsMemo[memoKey] = Object.entries(Metrics).every(function (_a) {
|
|
81
|
-
var _b = __read(_a, 2), key = _b[0], _c = _b[1], ComparisonOperator = _c.ComparisonOperator, Value = _c.Value;
|
|
82
|
-
var compare = getComparator(ComparisonOperator);
|
|
83
|
-
// if there is some unknown comparison operator, treat as a comparison failure
|
|
84
|
-
return compare ? compare(Value, metrics[key]) : false;
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
return eventMetricsMemo[memoKey];
|
|
88
|
-
};
|
|
89
|
-
export var getComparator = function (operator) {
|
|
90
|
-
switch (operator) {
|
|
91
|
-
case 'EQUAL':
|
|
92
|
-
return function (metricsVal, eventVal) { return metricsVal === eventVal; };
|
|
93
|
-
case 'GREATER_THAN':
|
|
94
|
-
return function (metricsVal, eventVal) { return metricsVal < eventVal; };
|
|
95
|
-
case 'GREATER_THAN_OR_EQUAL':
|
|
96
|
-
return function (metricsVal, eventVal) { return metricsVal <= eventVal; };
|
|
97
|
-
case 'LESS_THAN':
|
|
98
|
-
return function (metricsVal, eventVal) { return metricsVal > eventVal; };
|
|
99
|
-
case 'LESS_THAN_OR_EQUAL':
|
|
100
|
-
return function (metricsVal, eventVal) { return metricsVal >= eventVal; };
|
|
101
|
-
default:
|
|
102
|
-
return null;
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
export var isBeforeEndDate = function (_a) {
|
|
106
|
-
var Schedule = _a.Schedule;
|
|
107
|
-
if (!(Schedule === null || Schedule === void 0 ? void 0 : Schedule.EndDate)) {
|
|
108
|
-
return true;
|
|
109
|
-
}
|
|
110
|
-
return new Date() < new Date(Schedule.EndDate);
|
|
111
|
-
};
|
|
112
|
-
export var isQuietTime = function (message) {
|
|
113
|
-
var Schedule = message.Schedule;
|
|
114
|
-
if (!(Schedule === null || Schedule === void 0 ? void 0 : Schedule.QuietTime)) {
|
|
115
|
-
return false;
|
|
116
|
-
}
|
|
117
|
-
var pattern = /^[0-2]\d:[0-5]\d$/; // basic sanity check, not a fully featured HH:MM validation
|
|
118
|
-
var _a = Schedule.QuietTime, Start = _a.Start, End = _a.End;
|
|
119
|
-
if (!Start ||
|
|
120
|
-
!End ||
|
|
121
|
-
Start === End ||
|
|
122
|
-
!pattern.test(Start) ||
|
|
123
|
-
!pattern.test(End)) {
|
|
124
|
-
return false;
|
|
125
|
-
}
|
|
126
|
-
var now = new Date();
|
|
127
|
-
var start = new Date(now);
|
|
128
|
-
var end = new Date(now);
|
|
129
|
-
var _b = __read(Start.split(':'), 2), startHours = _b[0], startMinutes = _b[1];
|
|
130
|
-
var _c = __read(End.split(':'), 2), endHours = _c[0], endMinutes = _c[1];
|
|
131
|
-
start.setHours(Number.parseInt(startHours, 10), Number.parseInt(startMinutes, 10), 0, 0);
|
|
132
|
-
end.setHours(Number.parseInt(endHours, 10), Number.parseInt(endMinutes, 10), 0, 0);
|
|
133
|
-
// if quiet time includes midnight, bump the end time to the next day
|
|
134
|
-
if (start > end) {
|
|
135
|
-
end.setDate(end.getDate() + 1);
|
|
136
|
-
}
|
|
137
|
-
var isQuietTime = now >= start && now <= end;
|
|
138
|
-
if (isQuietTime) {
|
|
139
|
-
logger.debug('message filtered due to quiet time', message);
|
|
140
|
-
}
|
|
141
|
-
return isQuietTime;
|
|
142
|
-
};
|
|
143
|
-
export var clearMemo = function () {
|
|
144
|
-
eventNameMemo = {};
|
|
145
|
-
eventAttributesMemo = {};
|
|
146
|
-
eventMetricsMemo = {};
|
|
147
|
-
};
|
|
148
|
-
// in the pinpoint console when a message is created with a Modal or Full Screen layout,
|
|
149
|
-
// it is assigned a layout value of MOBILE_FEED or OVERLAYS respectively in the message payload.
|
|
150
|
-
// In the future, Pinpoint will be updating the layout values in the aforementioned scenario
|
|
151
|
-
// to MODAL and FULL_SCREEN.
|
|
152
|
-
//
|
|
153
|
-
// This utility acts as a safeguard to ensure that:
|
|
154
|
-
// - 1. the usage of MOBILE_FEED and OVERLAYS as values for message layouts are not leaked
|
|
155
|
-
// outside the Pinpoint provider
|
|
156
|
-
// - 2. Amplify correctly handles the legacy layout values from Pinpoint after they are updated
|
|
157
|
-
export var interpretLayout = function (layout) {
|
|
158
|
-
if (layout === 'MOBILE_FEED') {
|
|
159
|
-
return 'MODAL';
|
|
160
|
-
}
|
|
161
|
-
if (layout === 'OVERLAYS') {
|
|
162
|
-
return 'FULL_SCREEN';
|
|
163
|
-
}
|
|
164
|
-
// cast as PinpointInAppMessage['InAppMessage']['Layout'] allows `string` as a value
|
|
165
|
-
return layout;
|
|
166
|
-
};
|
|
167
|
-
export var extractContent = function (_a) {
|
|
168
|
-
var message = _a.InAppMessage;
|
|
169
|
-
var _b, _c;
|
|
170
|
-
return ((_c = (_b = message === null || message === void 0 ? void 0 : message.Content) === null || _b === void 0 ? void 0 : _b.map(function (content) {
|
|
171
|
-
var BackgroundColor = content.BackgroundColor, BodyConfig = content.BodyConfig, HeaderConfig = content.HeaderConfig, ImageUrl = content.ImageUrl, PrimaryBtn = content.PrimaryBtn, SecondaryBtn = content.SecondaryBtn;
|
|
172
|
-
var defaultPrimaryButton = PrimaryBtn === null || PrimaryBtn === void 0 ? void 0 : PrimaryBtn.DefaultConfig;
|
|
173
|
-
var defaultSecondaryButton = SecondaryBtn === null || SecondaryBtn === void 0 ? void 0 : SecondaryBtn.DefaultConfig;
|
|
174
|
-
var extractedContent = {};
|
|
175
|
-
if (BackgroundColor) {
|
|
176
|
-
extractedContent.container = {
|
|
177
|
-
style: {
|
|
178
|
-
backgroundColor: BackgroundColor,
|
|
179
|
-
},
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
if (HeaderConfig) {
|
|
183
|
-
extractedContent.header = {
|
|
184
|
-
content: HeaderConfig.Header,
|
|
185
|
-
style: {
|
|
186
|
-
color: HeaderConfig.TextColor,
|
|
187
|
-
textAlign: HeaderConfig.Alignment.toLowerCase(),
|
|
188
|
-
},
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
if (BodyConfig) {
|
|
192
|
-
extractedContent.body = {
|
|
193
|
-
content: BodyConfig.Body,
|
|
194
|
-
style: {
|
|
195
|
-
color: BodyConfig.TextColor,
|
|
196
|
-
textAlign: BodyConfig.Alignment.toLowerCase(),
|
|
197
|
-
},
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
if (ImageUrl) {
|
|
201
|
-
extractedContent.image = {
|
|
202
|
-
src: ImageUrl,
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
if (defaultPrimaryButton) {
|
|
206
|
-
extractedContent.primaryButton = {
|
|
207
|
-
title: defaultPrimaryButton.Text,
|
|
208
|
-
action: defaultPrimaryButton.ButtonAction,
|
|
209
|
-
url: defaultPrimaryButton.Link,
|
|
210
|
-
style: {
|
|
211
|
-
backgroundColor: defaultPrimaryButton.BackgroundColor,
|
|
212
|
-
borderRadius: defaultPrimaryButton.BorderRadius,
|
|
213
|
-
color: defaultPrimaryButton.TextColor,
|
|
214
|
-
},
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
if (defaultSecondaryButton) {
|
|
218
|
-
extractedContent.secondaryButton = {
|
|
219
|
-
title: defaultSecondaryButton.Text,
|
|
220
|
-
action: defaultSecondaryButton.ButtonAction,
|
|
221
|
-
url: defaultSecondaryButton.Link,
|
|
222
|
-
style: {
|
|
223
|
-
backgroundColor: defaultSecondaryButton.BackgroundColor,
|
|
224
|
-
borderRadius: defaultSecondaryButton.BorderRadius,
|
|
225
|
-
color: defaultSecondaryButton.TextColor,
|
|
226
|
-
},
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
return extractedContent;
|
|
230
|
-
})) !== null && _c !== void 0 ? _c : []);
|
|
231
|
-
};
|
|
232
|
-
export var extractMetadata = function (_a) {
|
|
233
|
-
var InAppMessage = _a.InAppMessage, Priority = _a.Priority, Schedule = _a.Schedule, TreatmentId = _a.TreatmentId;
|
|
234
|
-
return ({
|
|
235
|
-
customData: InAppMessage === null || InAppMessage === void 0 ? void 0 : InAppMessage.CustomConfig,
|
|
236
|
-
endDate: Schedule === null || Schedule === void 0 ? void 0 : Schedule.EndDate,
|
|
237
|
-
priority: Priority,
|
|
238
|
-
treatmentId: TreatmentId,
|
|
239
|
-
});
|
|
240
|
-
};
|
|
241
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/inAppMessaging/providers/pinpoint/utils/utils.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE,OAAO,OAAO,MAAM,gBAAgB,CAAC;AAYrC,IAAM,aAAa,GAAG,gBAAgB,CAAC;AAEvC,IAAI,aAAa,GAAG,EAAE,CAAC;AACvB,IAAI,mBAAmB,GAAG,EAAE,CAAC;AAC7B,IAAI,gBAAgB,GAAG,EAAE,CAAC;AAE1B,MAAM,CAAC,IAAM,MAAM,GAAG,IAAI,aAAa,CAAC,oCAAoC,CAAC,CAAC;AAE9E,MAAM,CAAC,IAAM,oBAAoB,GAAG,UACnC,KAA8B,EAC9B,OAAqB;IAErB,wDAAwD;IACxD,6EAA6E;IAC7E,qCAAqC;IACrC,8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