@capillarytech/creatives-library 8.0.328 → 8.0.330-alpha.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/constants/unified.js +4 -0
- package/package.json +1 -1
- package/services/api.js +17 -0
- package/services/tests/api.test.js +85 -0
- package/utils/commonUtils.js +28 -0
- package/utils/tagValidations.js +2 -3
- package/utils/templateVarUtils.js +35 -6
- package/utils/tests/commonUtil.test.js +169 -0
- package/utils/tests/tagValidations.test.js +1 -1
- package/utils/tests/templateVarUtils.test.js +44 -0
- package/v2Components/CommonTestAndPreview/AddTestCustomer.js +42 -0
- package/v2Components/CommonTestAndPreview/CustomerCreationModal.js +155 -0
- package/v2Components/CommonTestAndPreview/ExistingCustomerModal.js +93 -0
- package/v2Components/CommonTestAndPreview/SendTestMessage.js +79 -51
- package/v2Components/CommonTestAndPreview/_commonTestAndPreview.scss +134 -34
- package/v2Components/CommonTestAndPreview/actions.js +10 -0
- package/v2Components/CommonTestAndPreview/constants.js +15 -1
- package/v2Components/CommonTestAndPreview/index.js +364 -72
- package/v2Components/CommonTestAndPreview/messages.js +106 -0
- package/v2Components/CommonTestAndPreview/reducer.js +10 -0
- package/v2Components/CommonTestAndPreview/tests/AddTestCustomer.test.js +66 -0
- package/v2Components/CommonTestAndPreview/tests/CommonTestAndPreview.addTestCustomer.test.js +648 -0
- package/v2Components/CommonTestAndPreview/tests/CustomValuesEditor.test.js +24 -0
- package/v2Components/CommonTestAndPreview/tests/CustomerCreationModal.test.js +174 -0
- package/v2Components/CommonTestAndPreview/tests/ExistingCustomerModal.test.js +114 -0
- package/v2Components/CommonTestAndPreview/tests/SendTestMessage.test.js +52 -0
- package/v2Components/CommonTestAndPreview/tests/constants.test.js +31 -1
- package/v2Components/CommonTestAndPreview/tests/index.test.js +36 -0
- package/v2Components/CommonTestAndPreview/tests/reducer.test.js +71 -0
- package/v2Components/CommonTestAndPreview/tests/selectors.test.js +17 -0
- package/v2Components/SmsFallback/smsFallbackUtils.js +14 -3
- package/v2Components/SmsFallback/tests/smsFallbackUtils.test.js +16 -0
- package/v2Components/TestAndPreviewSlidebox/index.js +5 -0
- package/v2Containers/CreativesContainer/index.js +15 -10
- package/v2Containers/Rcs/constants.js +6 -2
- package/v2Containers/Rcs/index.js +219 -91
- package/v2Containers/Rcs/messages.js +2 -1
- package/v2Containers/Rcs/rcsLibraryHydrationUtils.js +20 -0
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +2370 -1758
- package/v2Containers/Rcs/tests/rcsLibraryHydrationUtils.test.js +67 -0
- package/v2Containers/Rcs/tests/utils.test.js +56 -0
- package/v2Containers/Rcs/utils.js +53 -6
- package/v2Containers/SmsTrai/Edit/index.js +27 -0
- package/v2Containers/SmsTrai/Edit/messages.js +5 -0
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +357 -324
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +5586 -5212
|
@@ -466,7 +466,8 @@ export default defineMessages({
|
|
|
466
466
|
},
|
|
467
467
|
unknownCharactersError: {
|
|
468
468
|
id: `${prefix}.unknownCharactersError`,
|
|
469
|
-
defaultMessage:
|
|
469
|
+
defaultMessage:
|
|
470
|
+
'Only letters, numbers, underscores, and dots are allowed in custom param (e.g. tag.FORMAT_1). Spaces and other special characters are not allowed.',
|
|
470
471
|
},
|
|
471
472
|
emptyVariableError: {
|
|
472
473
|
id: `${prefix}.emptyVariableError`,
|
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import isEmpty from 'lodash/isEmpty';
|
|
2
2
|
import get from 'lodash/get';
|
|
3
3
|
import { RCS_SMS_FALLBACK_VAR_MAPPED_PROP } from '../../v2Components/CommonTestAndPreview/constants';
|
|
4
|
+
import {
|
|
5
|
+
RCS_NUMERIC_VAR_NAME_REGEX,
|
|
6
|
+
RCS_CARD_VAR_MAPPED_SEMANTIC_KEY_REGEX,
|
|
7
|
+
} from './constants';
|
|
8
|
+
|
|
9
|
+
/** RCS card `cardVarMapped` / `rcsCardVarMapped` only (SMS fallback slot keys stay on `smsFallBackContent`). */
|
|
10
|
+
export function pickRcsCardVarMappedEntries(record) {
|
|
11
|
+
if (record == null || typeof record !== 'object' || Array.isArray(record)) return {};
|
|
12
|
+
return Object.fromEntries(
|
|
13
|
+
Object.entries(record).filter(([k]) => {
|
|
14
|
+
const key = String(k);
|
|
15
|
+
return (
|
|
16
|
+
RCS_NUMERIC_VAR_NAME_REGEX.test(key)
|
|
17
|
+
|| RCS_CARD_VAR_MAPPED_SEMANTIC_KEY_REGEX.test(key)
|
|
18
|
+
);
|
|
19
|
+
}),
|
|
20
|
+
);
|
|
21
|
+
}
|
|
4
22
|
|
|
5
23
|
/**
|
|
6
24
|
* Nested `versions…smsFallBackContent` and root `smsFallBackContent` (CreativesContainer mirror)
|
|
@@ -88,6 +106,8 @@ export function getLibrarySmsFallbackApiBaselineFromTemplateData(templateData) {
|
|
|
88
106
|
};
|
|
89
107
|
}
|
|
90
108
|
|
|
109
|
+
export { extractRegisteredSenderIdsFromSmsFallbackRecord } from '../../utils/commonUtils';
|
|
110
|
+
|
|
91
111
|
export function pickFirstSmsFallbackTemplateString(sms = {}) {
|
|
92
112
|
if (!sms || typeof sms !== 'object') return '';
|
|
93
113
|
const keys = [
|