@textback/notification-widget 2.0.4 → 2.0.6-110502
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/.gitlab-ci.yml +2 -8
- package/{release/builds/textback/notificationwidget/build → build}/index.js +1 -1
- package/package.json +2 -2
- package/release/builds/textback/notificationwidget/.eslintrc.js +0 -291
- package/release/builds/textback/notificationwidget/.gitlab-ci.yml +0 -34
- package/release/builds/textback/notificationwidget/package-lock.json +0 -9985
- package/release/builds/textback/notificationwidget/package.json +0 -70
- package/release/builds/textback/notificationwidget/promote_tag.sh +0 -2
- package/release/builds/textback/notificationwidget/readme.md +0 -569
- package/release/builds/textback/notificationwidget/server.js +0 -224
- package/release/builds/textback/notificationwidget/src/libraries/ai.1.0.11.js +0 -4089
- package/release/builds/textback/notificationwidget/src/libraries/localization/getLocale.js +0 -17
- package/release/builds/textback/notificationwidget/src/libraries/localization/locales/.tern-port +0 -1
- package/release/builds/textback/notificationwidget/src/libraries/localization/locales/cs.js +0 -23
- package/release/builds/textback/notificationwidget/src/libraries/localization/locales/en.js +0 -23
- package/release/builds/textback/notificationwidget/src/libraries/localization/locales/index.js +0 -9
- package/release/builds/textback/notificationwidget/src/libraries/localization/locales/pl.js +0 -23
- package/release/builds/textback/notificationwidget/src/libraries/localization/locales/ro.js +0 -23
- package/release/builds/textback/notificationwidget/src/libraries/localization/locales/ru.js +0 -22
- package/release/builds/textback/notificationwidget/src/libraries/localization/locales/uk.js +0 -23
- package/release/builds/textback/notificationwidget/src/libraries/localization/text.js +0 -9
- package/release/builds/textback/notificationwidget/src/libraries/t.js +0 -82
- package/release/builds/textback/notificationwidget/src/sdk/channels/channel.js +0 -31
- package/release/builds/textback/notificationwidget/src/sdk/channels/facebook.js +0 -13
- package/release/builds/textback/notificationwidget/src/sdk/channels/factory.js +0 -34
- package/release/builds/textback/notificationwidget/src/sdk/channels/skype.js +0 -13
- package/release/builds/textback/notificationwidget/src/sdk/channels/telegram.js +0 -18
- package/release/builds/textback/notificationwidget/src/sdk/channels/viber.js +0 -13
- package/release/builds/textback/notificationwidget/src/sdk/channels/vk-modal/vk-modal.html +0 -17
- package/release/builds/textback/notificationwidget/src/sdk/channels/vk-modal/vk-modal.js +0 -25
- package/release/builds/textback/notificationwidget/src/sdk/channels/vk-modal/vk-modal.scss +0 -116
- package/release/builds/textback/notificationwidget/src/sdk/channels/vk.js +0 -195
- package/release/builds/textback/notificationwidget/src/sdk/channels/whatsapp.js +0 -27
- package/release/builds/textback/notificationwidget/src/sdk/channels/whatsappb.js +0 -27
- package/release/builds/textback/notificationwidget/src/sdk/events/observer.js +0 -46
- package/release/builds/textback/notificationwidget/src/sdk/index.js +0 -6
- package/release/builds/textback/notificationwidget/src/sdk/sdk.entry.js +0 -1
- package/release/builds/textback/notificationwidget/src/sdk/sdk.js +0 -67
- package/release/builds/textback/notificationwidget/src/sdk/utils/apiErrorHandler.js +0 -12
- package/release/builds/textback/notificationwidget/src/sdk/utils/appInsights.js +0 -88
- package/release/builds/textback/notificationwidget/src/sdk/utils/browserInfo.js +0 -9
- package/release/builds/textback/notificationwidget/src/sdk/utils/constants.js +0 -18
- package/release/builds/textback/notificationwidget/src/sdk/utils/cookies.js +0 -67
- package/release/builds/textback/notificationwidget/src/sdk/utils/find.js +0 -8
- package/release/builds/textback/notificationwidget/src/sdk/utils/loadConfig.js +0 -21
- package/release/builds/textback/notificationwidget/src/sdk/utils/loadDeepLink.js +0 -48
- package/release/builds/textback/notificationwidget/src/sdk/utils/loadScript.js +0 -26
- package/release/builds/textback/notificationwidget/src/sdk/utils/loadSubscriptions.js +0 -6
- package/release/builds/textback/notificationwidget/src/sdk/utils/parseQueryString.js +0 -34
- package/release/builds/textback/notificationwidget/src/sdk/utils/windowHelper.js +0 -25
- package/release/builds/textback/notificationwidget/src/sdk/widget/widget.js +0 -192
- package/release/builds/textback/notificationwidget/src/widget/components/index.js +0 -52
- package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/facebook.js +0 -55
- package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/index.js +0 -35
- package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/styles.scss +0 -657
- package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/telegram.js +0 -55
- package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/viber.js +0 -57
- package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/vk.js +0 -92
- package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/whatsapp.js +0 -58
- package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/whatsappb.js +0 -58
- package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-widget/index.js +0 -694
- package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-widget/normalize.scss +0 -395
- package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-widget/styles.scss +0 -543
- package/release/builds/textback/notificationwidget/src/widget/components/tb-nw-wahunter/index.js +0 -261
- package/release/builds/textback/notificationwidget/src/widget/components/tb-nw-wahunter/styles.scss +0 -471
- package/release/builds/textback/notificationwidget/src/widget/config.js +0 -5
- package/release/builds/textback/notificationwidget/src/widget/icons/bell-icon.png +0 -0
- package/release/builds/textback/notificationwidget/src/widget/icons/broadcast-icon.png +0 -0
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_chat_window.svg +0 -1
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_close.svg +0 -1
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_facebook.svg +0 -7
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_facebook_circle.svg +0 -7
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_instagram_circle.svg +0 -96
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_skype.svg +0 -44
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_skype_circle.svg +0 -46
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_skype_new.svg +0 -114
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_tg.svg +0 -25
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_tg_circle.svg +0 -17
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_viber.svg +0 -75
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_viber_circle.svg +0 -67
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_viber_new.svg +0 -102
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_vk.svg +0 -14
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_vk_circle.svg +0 -16
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_whatsapp.svg +0 -147
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_whatsapp_circle.svg +0 -4
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_whatsapp_hollow.svg +0 -128
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_whatsapp_new.svg +0 -127
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_whatsappb.svg +0 -147
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_whatsappb_circle.svg +0 -4
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_whatsappb_new.svg +0 -127
- package/release/builds/textback/notificationwidget/src/widget/icons/paper-plane-arrow.svg +0 -3
- package/release/builds/textback/notificationwidget/src/widget/icons/paper-plane-icon.png +0 -0
- package/release/builds/textback/notificationwidget/src/widget/icons/tb-logo-dark-en.svg +0 -17
- package/release/builds/textback/notificationwidget/src/widget/icons/tb-logo-dark-ru.svg +0 -17
- package/release/builds/textback/notificationwidget/src/widget/icons/tb-logo-dark.svg +0 -16
- package/release/builds/textback/notificationwidget/src/widget/icons/tb-logo-light-en.svg +0 -17
- package/release/builds/textback/notificationwidget/src/widget/icons/tb-logo-light-ru.svg +0 -17
- package/release/builds/textback/notificationwidget/src/widget/icons/tb-logo-white.svg +0 -16
- package/release/builds/textback/notificationwidget/src/widget/icons/tb-logo.svg +0 -16
- package/release/builds/textback/notificationwidget/src/widget/index.js +0 -29
- package/release/builds/textback/notificationwidget/src/widget/locales/cs.js +0 -42
- package/release/builds/textback/notificationwidget/src/widget/locales/en.js +0 -42
- package/release/builds/textback/notificationwidget/src/widget/locales/index.js +0 -9
- package/release/builds/textback/notificationwidget/src/widget/locales/pl.js +0 -42
- package/release/builds/textback/notificationwidget/src/widget/locales/ro.js +0 -41
- package/release/builds/textback/notificationwidget/src/widget/locales/ru.js +0 -41
- package/release/builds/textback/notificationwidget/src/widget/locales/uk.js +0 -41
- package/release/builds/textback/notificationwidget/src/widget/utils/cookiesEx.js +0 -41
- package/release/builds/textback/notificationwidget/src/widget/utils/getLocale.js +0 -17
- package/release/builds/textback/notificationwidget/src/widget/utils/stringifyAttributes.js +0 -19
- package/release/builds/textback/notificationwidget/src/widget/utils/text.js +0 -10
- package/release/builds/textback/notificationwidget/src/widget/utils/widgetsStorage.js +0 -28
- package/release/builds/textback/notificationwidget/src/widget/widget.entry.js +0 -3
- package/release/builds/textback/notificationwidget/tests/gf.html +0 -35
- package/release/builds/textback/notificationwidget/tests/gf.js +0 -22
- package/release/builds/textback/notificationwidget/tests/index.js +0 -62
- package/release/builds/textback/notificationwidget/views/examples.ejs +0 -51
- package/release/builds/textback/notificationwidget/views/sdk.html +0 -274
- package/release/builds/textback/notificationwidget/webpack.common.js +0 -72
- package/release/builds/textback/notificationwidget/webpack.dev.js +0 -15
- package/release/builds/textback/notificationwidget/webpack.prod.js +0 -10
- package/widget.tar.gz +0 -0
- /package/{release/builds/textback/notificationwidget/build → build}/sdk.js +0 -0
@@ -1,41 +0,0 @@
|
|
1
|
-
module.exports = {
|
2
|
-
|
3
|
-
//пояснения к переводу смотри в en.js
|
4
|
-
|
5
|
-
//виджет подписок
|
6
|
-
facebook: "Facebook",
|
7
|
-
facebookExtended: "Abonați-vă la Facebook",
|
8
|
-
telegram: "Telegram",
|
9
|
-
telegramExtended: "Abonați-vă la Telegram",
|
10
|
-
viber: "Viber",
|
11
|
-
viberExtended: "Abonați-vă la Viber",
|
12
|
-
vkontakte: "VK",
|
13
|
-
vkontakteExtended: "Abonați-vă la VK",
|
14
|
-
whatsapp: "WhatsApp",
|
15
|
-
whatsappExtended: "Abonați-vă la WhatsApp",
|
16
|
-
whatsappb: "WhatsApp",
|
17
|
-
whatsappbExtended: "Abonați-vă la WhatsApp",
|
18
|
-
|
19
|
-
vkontakteLogin: "VK Login",
|
20
|
-
singVK: "Abonează-te VK",
|
21
|
-
|
22
|
-
//double check в рассылке
|
23
|
-
facebookTip: "Tap <strong>Get started</strong><br/>in Messenger",
|
24
|
-
telegramTip: "Tap <strong>Start</strong></br>in Telegram",
|
25
|
-
viberTip: "<strong>Viber Desktop App</strong></br>should be installed on your PC",
|
26
|
-
vkontakteTip: "Press <strong>Allow messages</strong><br/>in a popup window",
|
27
|
-
whatsappTip: "<strong>Send generated text</strong><br/>to WhatsApp",
|
28
|
-
|
29
|
-
//WhatsApp Hunter
|
30
|
-
getAnswer: "Primește răspuns în ",
|
31
|
-
enterNumber: "Introdu numarul tau",
|
32
|
-
sendMessage: "Trimitem un mesaj în 3-2-1 sec",
|
33
|
-
answerSuccessful: "V-am răspuns pe WhatsApp.<br>Verifică-ți telefonul",
|
34
|
-
numberNotFound: "Nu există un astfel de număr în WhatsApp.<br>Sunteți de pe Marte?🤔",
|
35
|
-
tryAgain: "Specificați un alt număr",
|
36
|
-
somethingWentWrong: "Hopa! Ceva n-a mers bine",
|
37
|
-
errorTryAgain: "Să mai încerc o dată",
|
38
|
-
|
39
|
-
//логотип
|
40
|
-
worksFor: "Works on"
|
41
|
-
};
|
@@ -1,41 +0,0 @@
|
|
1
|
-
module.exports = {
|
2
|
-
|
3
|
-
//пояснения к переводу смотри в en.js
|
4
|
-
|
5
|
-
//виджет подписок
|
6
|
-
facebook: "Facebook",
|
7
|
-
facebookExtended: "Подписаться в Facebook",
|
8
|
-
telegram: "Telegram",
|
9
|
-
telegramExtended: "Подписаться в Telegram",
|
10
|
-
viber: "Viber",
|
11
|
-
viberExtended: "Подписаться в Viber",
|
12
|
-
vkontakte: "ВКонтакте",
|
13
|
-
vkontakteExtended: "Подписаться ВКонтакте",
|
14
|
-
whatsapp: "WhatsApp",
|
15
|
-
whatsappExtended: "Подписаться в WhatsApp",
|
16
|
-
whatsappb: "WhatsApp",
|
17
|
-
whatsappbExtended: "Подписаться в WhatsApp",
|
18
|
-
|
19
|
-
vkontakteLogin: "VK Login",
|
20
|
-
singVK: "Подписаться ВКонтакте",
|
21
|
-
|
22
|
-
//double check в рассылке
|
23
|
-
telegramTip: "Нажмите <strong>Запустить</strong></br>в приложении Telegram",
|
24
|
-
facebookTip: "Нажмите <strong>Начать</strong><br/>в Messenger",
|
25
|
-
viberTip: "У вас должно быть установлено<br/><strong>Viber Desktop приложение</strong>",
|
26
|
-
vkontakteTip: "Нажмите <strong>Разрешить</strong><br/>во всплывающем окне",
|
27
|
-
whatsappTip: "Отправьте <strong>предзаполненный текст</strong><br/>в WhatsApp без изменений",
|
28
|
-
|
29
|
-
//WhatsApp Hunter
|
30
|
-
getAnswer: "Получить ответ в ",
|
31
|
-
enterNumber: "Введите ваш номер",
|
32
|
-
sendMessage: "Отправляем сообщение через 3-2-1 сек",
|
33
|
-
answerSuccessful: "Ответили вам в WhatsApp.<br>Проверьте телефон",
|
34
|
-
numberNotFound: "Такого номера нет в WhatsApp.<br>Вы что, с Марса?🤔",
|
35
|
-
tryAgain: "Указать другой номер",
|
36
|
-
somethingWentWrong: "Упс! Что-то пошло не так",
|
37
|
-
errorTryAgain: "Попробовать еще раз",
|
38
|
-
|
39
|
-
//логотип
|
40
|
-
worksFor: "Работает на",
|
41
|
-
};
|
@@ -1,41 +0,0 @@
|
|
1
|
-
module.exports = {
|
2
|
-
|
3
|
-
//пояснения к переводу смотри в en.js
|
4
|
-
|
5
|
-
//виджет подписок
|
6
|
-
facebook: "Facebook",
|
7
|
-
facebookExtended: "Підписатися в Facebook",
|
8
|
-
telegram: "Telegram",
|
9
|
-
telegramExtended: "Підписатися в Telegram",
|
10
|
-
viber: "Viber",
|
11
|
-
viberExtended: "Підписатися в Viber",
|
12
|
-
vkontakte: "ВКонтакте",
|
13
|
-
vkontakteExtended: "Підписатися ВКонтакте",
|
14
|
-
whatsapp: "WhatsApp",
|
15
|
-
whatsappExtended: "Підписатися в WhatsApp",
|
16
|
-
whatsappb: "WhatsApp",
|
17
|
-
whatsappbExtended: "Підписатися в WhatsApp",
|
18
|
-
|
19
|
-
vkontakteLogin: "VK Login",
|
20
|
-
singVK: "Підписатися на VK",
|
21
|
-
|
22
|
-
//double check в рассылке
|
23
|
-
facebookTip: "Tap <strong>Get started</strong><br/>in Messenger",
|
24
|
-
telegramTip: "Tap <strong>Start</strong></br>in Telegram",
|
25
|
-
viberTip: "<strong>Viber Desktop App</strong></br>should be installed on your PC",
|
26
|
-
vkontakteTip: "Press <strong>Allow messages</strong><br/>in a popup window",
|
27
|
-
whatsappTip: "<strong>Send generated text</strong><br/>to WhatsApp",
|
28
|
-
|
29
|
-
//WhatsApp Hunter
|
30
|
-
getAnswer: "Отримати відповідь в ",
|
31
|
-
enterNumber: "Введіть ваш номер",
|
32
|
-
sendMessage: "Відправляємо повідомлення через 3-2-1 сек",
|
33
|
-
answerSuccessful: "Відповіли вам в WhatsApp. <br> Перевірте телефон",
|
34
|
-
numberNotFound: "Такого номера немає в WhatsApp.<br>Ви що, з Марса?🤔",
|
35
|
-
tryAgain: "Вказати інший номер",
|
36
|
-
somethingWentWrong: "Упс! Щось пішло не так",
|
37
|
-
errorTryAgain: "Спробувати ще раз",
|
38
|
-
|
39
|
-
//логотип
|
40
|
-
worksFor: "Works on"
|
41
|
-
};
|
@@ -1,41 +0,0 @@
|
|
1
|
-
// const cookies = require('./cookies');
|
2
|
-
import cookies from '../../sdk/utils/cookies.js';
|
3
|
-
|
4
|
-
/**
|
5
|
-
*
|
6
|
-
* @extends cookies
|
7
|
-
*/
|
8
|
-
const cookiesEx = Object.create(cookies);
|
9
|
-
|
10
|
-
/**
|
11
|
-
*
|
12
|
-
* @param name {string}
|
13
|
-
* @returns {Number}
|
14
|
-
*/
|
15
|
-
cookiesEx.getIntCookie = function (name) {
|
16
|
-
return parseInt(this.getCookie(name));
|
17
|
-
};
|
18
|
-
|
19
|
-
/**
|
20
|
-
*
|
21
|
-
* @param name {string}
|
22
|
-
* @returns {boolean}
|
23
|
-
*/
|
24
|
-
cookiesEx.getBoolCookie = function (name) {
|
25
|
-
return (this.getCookie(name)) === 'true';
|
26
|
-
};
|
27
|
-
/**
|
28
|
-
*
|
29
|
-
* @param name {string}
|
30
|
-
* @param timeToLive {number}
|
31
|
-
* @returns {number}
|
32
|
-
*/
|
33
|
-
cookiesEx.incrementIntCookie = function (name, timeToLive) {
|
34
|
-
let val = this.getIntCookie(name) || 0;
|
35
|
-
val++;
|
36
|
-
this.setCookie(name, val, timeToLive);
|
37
|
-
|
38
|
-
return val;
|
39
|
-
};
|
40
|
-
|
41
|
-
export default cookiesEx;
|
@@ -1,17 +0,0 @@
|
|
1
|
-
const locales = require('../locales');
|
2
|
-
|
3
|
-
function getLocale() {
|
4
|
-
let locale = 'main';
|
5
|
-
|
6
|
-
if (document) {
|
7
|
-
locale = document.querySelector('html').getAttribute('lang');
|
8
|
-
}
|
9
|
-
|
10
|
-
if (!locales[locale] && navigator) {
|
11
|
-
locale = navigator.language;
|
12
|
-
}
|
13
|
-
|
14
|
-
return locale;
|
15
|
-
}
|
16
|
-
|
17
|
-
export default getLocale;
|
@@ -1,19 +0,0 @@
|
|
1
|
-
function stringifyAttributes(attributesMap = {}) {
|
2
|
-
return Object.keys(attributesMap)
|
3
|
-
.map(key => {
|
4
|
-
let value = attributesMap[key];
|
5
|
-
|
6
|
-
if (value === null || typeof value === 'undefined') {
|
7
|
-
return ''
|
8
|
-
}
|
9
|
-
|
10
|
-
if (typeof value === 'object') {
|
11
|
-
value = JSON.stringify(value)
|
12
|
-
}
|
13
|
-
|
14
|
-
return `${key}='${value}'`
|
15
|
-
})
|
16
|
-
.join(' ');
|
17
|
-
}
|
18
|
-
|
19
|
-
export default stringifyAttributes;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
const locales = require('../locales');
|
2
|
-
import getLocale from './getLocale'
|
3
|
-
|
4
|
-
function text(string, locale) {
|
5
|
-
const dictionary = locales[locale] || locales[locale.split('-')[0]] || locales[getLocale()] || locales[getLocale().split('-')[0]] ||locales.main;
|
6
|
-
|
7
|
-
return dictionary[string] || locales.main[string] || string;
|
8
|
-
}
|
9
|
-
|
10
|
-
export default text;
|
@@ -1,28 +0,0 @@
|
|
1
|
-
const storage = {};
|
2
|
-
|
3
|
-
function setWidget(widgetId, widgetPromise) {
|
4
|
-
storage[widgetId] = storage[widgetId] || {};
|
5
|
-
storage[widgetId].promise = widgetPromise;
|
6
|
-
}
|
7
|
-
|
8
|
-
function getWidget(widgetId) {
|
9
|
-
return storage[widgetId] ? storage[widgetId].promise : null;
|
10
|
-
}
|
11
|
-
|
12
|
-
function setVkHandler(widgetId, handler) {
|
13
|
-
storage[widgetId] = storage[widgetId] || {};
|
14
|
-
storage[widgetId].vkHandler = handler;
|
15
|
-
}
|
16
|
-
|
17
|
-
function getVkHandler(widgetId) {
|
18
|
-
return storage[widgetId] ? storage[widgetId].vkHandler : null;
|
19
|
-
}
|
20
|
-
|
21
|
-
const widgetsStorage = {
|
22
|
-
setWidget,
|
23
|
-
getWidget,
|
24
|
-
setVkHandler,
|
25
|
-
getVkHandler,
|
26
|
-
};
|
27
|
-
|
28
|
-
export default widgetsStorage;
|
@@ -1,35 +0,0 @@
|
|
1
|
-
<html lang="en">
|
2
|
-
<head>
|
3
|
-
<meta charset="UTF-8">
|
4
|
-
<title>example</title>
|
5
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui-css/semantic.min.css">
|
6
|
-
<script src="//cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
|
7
|
-
<script src="//cdn.polyfill.io/v2/polyfill.min.js?features=default,fetch,Promise"></script>
|
8
|
-
<script src="/build/index.js"></script>
|
9
|
-
<script>
|
10
|
-
var _fetch = window.fetch;
|
11
|
-
|
12
|
-
window.fetch = function(url, options) {
|
13
|
-
window.fetch.calls.push({url: url, options: options});
|
14
|
-
return _fetch(url, options);
|
15
|
-
}
|
16
|
-
|
17
|
-
window.fetch.calls = [];
|
18
|
-
</script>
|
19
|
-
</head>
|
20
|
-
<body>
|
21
|
-
<tb-notification-widget
|
22
|
-
secure-context-token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJvcmRlcklkIjoiNDU2OCIsImlhdCI6MTQ5MTMzMzM0OCwiZXhwIjoxNDkyMTk3MzQ4LCJpc3MiOiJlZTlhZTMwYi1jYzRhLTRlNTctYWM1Mi05ZmYwOTEyMmRkODEiLCJzdWIiOiIxMjM0NSJ9._3FnsIV0atJ9F8_vmDZlzz5S0Qo6-tn7GP597Rxphm8="
|
23
|
-
widget-id="59f3dfaf-935f-4f0f-98b3-02a51abd0c7c"
|
24
|
-
api-path="https://api.textback.io/api"
|
25
|
-
data-insecure-order-id="">
|
26
|
-
</tb-notification-widget>
|
27
|
-
<script>
|
28
|
-
setTimeout(function() {
|
29
|
-
var widgetElement = $('tb-notification-widget').get(0);
|
30
|
-
widgetElement.dataset.insecureOrderId = 'testId';
|
31
|
-
new TextBack.NotificationWidget({element: widgetElement});
|
32
|
-
}, 2000);
|
33
|
-
</script>
|
34
|
-
</body>
|
35
|
-
</html>
|
@@ -1,22 +0,0 @@
|
|
1
|
-
fixture `Notification widget growfood tests`
|
2
|
-
.page `http://localhost:3000/tests/gf.html`;
|
3
|
-
|
4
|
-
test('Post initialization deeplink request', async t => {
|
5
|
-
const initialization = new Promise(resolve => {
|
6
|
-
setTimeout(resolve, 3000);
|
7
|
-
});
|
8
|
-
|
9
|
-
await initialization;
|
10
|
-
|
11
|
-
const requests = await t.eval(() => window.fetch.calls);
|
12
|
-
const deeplinkRequests = requests.filter(call => {
|
13
|
-
return call.url === 'https://api.textback.io/api/endUserNotifications/deepLinks';
|
14
|
-
});
|
15
|
-
|
16
|
-
await t.expect(JSON.parse(deeplinkRequests[1].options.body)).eql({
|
17
|
-
"accountId": "ee9ae30b-cc4a-4e57-ac52-9ff09122dd81",
|
18
|
-
"insecureContext": {"insecureOrderId": "testId"},
|
19
|
-
"secureContextToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJvcmRlcklkIjoiNDU2OCIsImlhdCI6MTQ5MTMzMzM0OCwiZXhwIjoxNDkyMTk3MzQ4LCJpc3MiOiJlZTlhZTMwYi1jYzRhLTRlNTctYWM1Mi05ZmYwOTEyMmRkODEiLCJzdWIiOiIxMjM0NSJ9._3FnsIV0atJ9F8_vmDZlzz5S0Qo6-tn7GP597Rxphm8="
|
20
|
-
});
|
21
|
-
|
22
|
-
});
|
@@ -1,62 +0,0 @@
|
|
1
|
-
const {Selector} = require('testcafe');
|
2
|
-
const querystring = require('querystring');
|
3
|
-
|
4
|
-
const query = querystring.stringify({
|
5
|
-
widgetPath: '/build/index.js',
|
6
|
-
apiPath: '/api',
|
7
|
-
widgetId: 'a'
|
8
|
-
});
|
9
|
-
|
10
|
-
fixture `Notification widget base tests`
|
11
|
-
.page `http://localhost:3000/examples?${query}`;
|
12
|
-
|
13
|
-
test('Telegram button', async t => {
|
14
|
-
const button = Selector('tb-notification-button[channel="tg"]');
|
15
|
-
const link = button.find('a');
|
16
|
-
const text = await button.innerText;
|
17
|
-
const href = await link.getAttribute('href');
|
18
|
-
|
19
|
-
await t.expect(text).contains('Telegram');
|
20
|
-
await t.expect(href).contains('https://telegram.me/rb_dev_3_bot?start=subscribe_');
|
21
|
-
});
|
22
|
-
|
23
|
-
test('VK button', async t => {
|
24
|
-
const button = Selector('tb-notification-button[channel="vk"]');
|
25
|
-
const text = await button.innerText;
|
26
|
-
|
27
|
-
await t.expect(text).contains('VKontakte');
|
28
|
-
});
|
29
|
-
|
30
|
-
test('Facebook button', async t => {
|
31
|
-
const button = Selector('tb-notification-button[channel="facebook"]');
|
32
|
-
const link = button.find('a');
|
33
|
-
const text = await button.innerText;
|
34
|
-
const href = await link.getAttribute('href');
|
35
|
-
|
36
|
-
await t.expect(text).contains('Facebook');
|
37
|
-
await t.expect(href).contains('https://m.me/323049074708312?ref=subscribe_');
|
38
|
-
});
|
39
|
-
|
40
|
-
test('Viber button', async t => {
|
41
|
-
const button = Selector('tb-notification-button[channel="viber"]');
|
42
|
-
const link = button.find('a');
|
43
|
-
const text = await button.innerText;
|
44
|
-
const href = await link.getAttribute('href');
|
45
|
-
|
46
|
-
await t.expect(text).contains('Viber');
|
47
|
-
await t.expect(href).contains('viber://pa?chatURI=dev_&context=subscribe_');
|
48
|
-
});
|
49
|
-
|
50
|
-
test('deeplink request', async t => {
|
51
|
-
const requests = await t.eval(() => window.fetch.calls);
|
52
|
-
|
53
|
-
const deeplinkRequests = requests.filter(call => {
|
54
|
-
return call.url === '/api/endUserNotifications/deepLinks'
|
55
|
-
});
|
56
|
-
|
57
|
-
await t.expect(JSON.parse(deeplinkRequests[0].options.body)).eql({
|
58
|
-
"accountId": "99bffda5-5bd1-49b1-b4f2-658854797c01",
|
59
|
-
"insecureContext": {"orderId": "insecureOrderID"},
|
60
|
-
"secureContextToken": null
|
61
|
-
});
|
62
|
-
});
|
@@ -1,51 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<meta charset="UTF-8">
|
4
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
5
|
-
<title>example</title>
|
6
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui-css/semantic.min.css">
|
7
|
-
<!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">-->
|
8
|
-
<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
|
9
|
-
<script src="https://cdn.jsdelivr.net/npm/semantic-ui-css/semantic.min.js"></script>
|
10
|
-
<!-- <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=default,fetch,Promise"></script> -->
|
11
|
-
|
12
|
-
</head>
|
13
|
-
<body>
|
14
|
-
<div class="ui stackable two column grid padded">
|
15
|
-
<div class="column">
|
16
|
-
<form class="ui form">
|
17
|
-
<div class="field">
|
18
|
-
<label>widgetPath</label>
|
19
|
-
<input type="text" name="widgetPath" value="<%- query.widgetPath %>" placeholder="widgetPath">
|
20
|
-
</div>
|
21
|
-
<div class="field">
|
22
|
-
<label>apiPath</label>
|
23
|
-
<input type="text" name="apiPath" value="<%- query.apiPath %>" placeholder="apiPath">
|
24
|
-
</div>
|
25
|
-
<div class="field">
|
26
|
-
<label>widgetId</label>
|
27
|
-
<input type="text" name="widgetId" value="<%- query.widgetId %>" placeholder="widgetId">
|
28
|
-
</div>
|
29
|
-
<div class="field">
|
30
|
-
<label>lang</label>
|
31
|
-
<input type="text" name="lang" value="<%- query.lang %>" placeholder="lang">
|
32
|
-
</div>
|
33
|
-
<div class="field">
|
34
|
-
<label>data</label>
|
35
|
-
<input type="text" name="data" value=<%- `${query.data}` %> placeholder="data">
|
36
|
-
</div>
|
37
|
-
<button class="ui button primary" type="submit">Render</button>
|
38
|
-
<a href="/examples" class="ui button">Defaults</a>
|
39
|
-
</form>
|
40
|
-
</div>
|
41
|
-
<div class="column">
|
42
|
-
<%- widgetCode %>
|
43
|
-
|
44
|
-
<div class="ui segment">
|
45
|
-
<pre style="padding-bottom: 20px; margin: 0 0 -20px;"><%= widgetCode %></pre>
|
46
|
-
</div>
|
47
|
-
</div>
|
48
|
-
</div>
|
49
|
-
</div>
|
50
|
-
</body>
|
51
|
-
</html>
|