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

@kasko/fe-toolbelt

Package Overview
Dependencies
Maintainers
11
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kasko/fe-toolbelt - npm Package Compare versions

Comparing version 2.0.1-beta.21 to 2.0.1-beta.22

2

package.json
{
"license": "UNLICENSED",
"name": "@kasko/fe-toolbelt",
"version": "2.0.1-beta.21",
"version": "2.0.1-beta.22",
"engines": {

@@ -6,0 +6,0 @@ "node": ">=8.11.x"

@@ -10,20 +10,13 @@ const axios = require('../../axios');

const url = `${kaskoConfig.feApiUrl}/touchpoints/${kaskoConfig.touchpointId}/items/${item.id}`;
const { data } = await axios.get(url, {
params: {
language: kaskoConfig.language,
key: kaskoConfig.publicKey,
},
})
.catch((error) => {
throw error;
});
let data;
try {
data = await axios.get(url, {
params: {
language: kaskoConfig.language,
key: kaskoConfig.publicKey,
},
})
.catch((error) => {
// throw error;
throw new Error('ERROR 6');
});
} catch (e) {
throw new Error('ERROR 5');
}
if (!data.data) {
if (!data) {
throw new Error('No item data');

@@ -33,7 +26,7 @@ }

return {
id: data.data.id,
name: data.data.content.item_title || data.data.id,
contents: data.data.content.data || {},
fields: data.data.field_definition || [],
manifest: data.data.webapp_manifest || {},
id: data.id,
name: data.content.item_title || data.id,
contents: data.content.data || {},
fields: data.field_definition || [],
manifest: data.webapp_manifest || {},
};

@@ -40,0 +33,0 @@ }

@@ -15,19 +15,13 @@ const axios = require('../../axios');

const url = `${kaskoConfig.feApiUrl}/touchpoints/${kaskoConfig.touchpointId}`;
let data;
try {
data = await axios.get(url, {
params: {
language: kaskoConfig.language,
key: kaskoConfig.publicKey,
},
})
.catch((error) => {
// throw error;
throw new Error('ERROR 4');
});
} catch (e) {
throw new Error('ERROR 3');
}
const { data } = await axios.get(url, {
params: {
language: kaskoConfig.language,
key: kaskoConfig.publicKey,
},
})
.catch((error) => {
throw error;
});
if (!data.data) {
if (!data) {
throw new Error('No touchpoint data');

@@ -37,7 +31,7 @@ }

return {
id: data.data.id || kaskoConfig.touchpointId,
productName: data.data.title,
contents: data.data.content.data || {},
items: data.data.items || [],
manifest: data.data.webapp_manifest || {},
id: data.id || kaskoConfig.touchpointId,
productName: data.title,
contents: data.content.data || {},
items: data.items || [],
manifest: data.webapp_manifest || {},
};

@@ -44,0 +38,0 @@ }

@@ -1,4 +0,3 @@

// const axios = require('../../axios');
// const fetch = require('node-fetch');
const { default: fetch } = require('node-fetch');
const axios = require('../../axios');
// const { default: fetch } = require('node-fetch');

@@ -14,11 +13,18 @@ const getProduct = require('./getProduct');

async function getWebappData(url) {
let data;
try {
const urlTest = 'https://apps.eu1.kaskocloud.com/pk_test_YjelaXzVMPGEDp8PePy2LxRq1rKd5Qmo/tp_256da351104839a521980c1937aa3';
const response = await fetch(urlTest);
data = await response.text();
} catch (e) {
throw new Error(`ERROR 1: ${e.message}, ${JSON.stringify(process.env)}`);
}
// let data;
// try {
// const urlTest = 'https://apps.eu1.kaskocloud.com/pk_test_YjelaXzVMPGEDp8PePy2LxRq1rKd5Qmo/tp_256da351104839a521980c1937aa3';
// const response = await fetch(urlTest);
// data = await response.text();
// } catch (e) {
// throw new Error(`ERROR 1: ${e.message}, ${JSON.stringify(process.env)}`);
// }
const urlTest = 'https://apps.eu1.kaskocloud.com/pk_test_YjelaXzVMPGEDp8PePy2LxRq1rKd5Qmo/tp_256da351104839a521980c1937aa3';
// const { data } = await axios.get(url)
const { data } = await axios.get(urlTest)
.catch((error) => {
throw error;
});
if (typeof data !== 'string' || !data) {

@@ -25,0 +31,0 @@ throw new Error('Webapp couldn\'t be loaded');

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