Socket
Socket
Sign inDemoInstall

@ns8/ns8-shopify-switches

Package Overview
Dependencies
78
Maintainers
13
Versions
195
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.154 to 1.0.155

32

dist/ShopifyCreateOrderActionSwitch.js

@@ -104,2 +104,25 @@ "use strict";

});
const parseDemoSession = (noteAttributes = []) => {
const ip = noteAttributes
.filter((note) => note.name === 'ip')
.map((note) => note.value)
.join();
const userAgent = noteAttributes
.filter((note) => note.name === 'ua')
.map((note) => note.value)
.join();
const acceptLanguage = noteAttributes
.filter((note) => note.name === 'accept_language')
.map((note) => note.value)
.join();
return mapSession({
accept_language: acceptLanguage,
browser_height: null,
browser_ip: ip,
browser_width: null,
session_hash: null,
user_agent: userAgent,
});
};
exports.parseDemoSession = parseDemoSession;
const mapSession = (clientDetails) => {

@@ -135,3 +158,3 @@ const { accept_language, browser_ip, user_agent, } = clientDetails;

const { id: merchantId } = switchContext.merchant;
const { id, name, currency, billing_address, shipping_address, customer, total_price, line_items = [], created_at, client_details, test, } = shopifyOrder;
const { id, name, currency, billing_address, shipping_address, customer, total_price, line_items = [], created_at, client_details, test, source_name, note_attributes, } = shopifyOrder;
const addresses = [];

@@ -149,3 +172,6 @@ if (billing_address) {

let session;
if (test && (!client_details || Object.keys(client_details).length === 0)) {
if (source_name === 'demo' && (!client_details || Object.keys(client_details).length === 0)) {
session = parseDemoSession(note_attributes);
}
else if (test && (!client_details || Object.keys(client_details).length === 0)) {
session = makeTestSession();

@@ -156,3 +182,3 @@ }

}
if (session) {
if (session && session.ip) {
return new ns8_protect_models_1.Order({

@@ -159,0 +185,0 @@ name,

2

package.json
{
"name": "@ns8/ns8-shopify-switches",
"version": "1.0.154",
"version": "1.0.155",
"description": "Custom switches for the shopify integration",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc