Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@modulbank/sendamo

Package Overview
Dependencies
Maintainers
4
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@modulbank/sendamo - npm Package Compare versions

Comparing version 0.0.26-beta-sm-8778-integration-with-cityes-add-9d99acaa to 0.0.26-beta-sm-8778-integration-with-cityes-add-c2967bd3

23

dist/index.js

@@ -55,3 +55,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

// Идентификатор, если пришел в поисковых систем
const searchEngine = ((_a = window === null || window === void 0 ? void 0 : window.document) === null || _a === void 0 ? void 0 : _a.referrer) ? getCookie("utm_source") : "current.src";
let searchEngine = ((_a = window === null || window === void 0 ? void 0 : window.document) === null || _a === void 0 ? void 0 : _a.referrer) || current.src;
const utmSource = getCookie("utm_source");
if (utmSource) {
searchEngine = utmSource;
}
const params = {

@@ -81,8 +85,9 @@ // @ts-ignore

return new Promise((resolve, reject) => {
const url = new URL('https://postback.cityads.com/service/postback/');
url.searchParams.set('campaign_secret', 'oPBnE0');
url.searchParams.set('order_id', orderId);
url.searchParams.set('click_id', clickId);
// @ts-ignore
fetch(`https://postback.cityads.com/service/postback/?campaign_secret=oPBnE0&order_id='\'${orderId}&click_id=${clickId}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json;charset=utf-8',
}
fetch(url.toString(), {
method: 'GET'
})

@@ -114,5 +119,7 @@ .then((response) => __awaiter(this, void 0, void 0, function* () {

if (response.status === 200) {
const orderId = getCookie("order_id");
const responseData = yield response.json();
const orderId = getCookie("order_id") || responseData.lead_id;
const clickId = getCookie("click_id");
if (clickId && orderId) {
const utmSource = getCookie("utm_source");
if (utmSource === "cityads") {
sendPostBack(clickId, orderId);

@@ -119,0 +126,0 @@ }

{
"name": "@modulbank/sendamo",
"version": "0.0.26-beta-sm-8778-integration-with-cityes-add-9d99acaa",
"version": "0.0.26-beta-sm-8778-integration-with-cityes-add-c2967bd3",
"description": "send to amocrm method",

@@ -5,0 +5,0 @@ "homepage": "",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc