@capriza/as-inspector
Advanced tools
Comparing version 0.2.62 to 0.2.63
{ | ||
"name": "@capriza/as-inspector", | ||
"version": "0.2.62", | ||
"version": "0.2.63", | ||
"description": "Capriza AS inspector", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
{ | ||
"main.css": "static/css/main.73ef4d21.css", | ||
"main.css.map": "static/css/main.73ef4d21.css.map", | ||
"main.js": "static/js/main.776b128d.js", | ||
"main.js.map": "static/js/main.776b128d.js.map", | ||
"main.css": "static/css/main.587197db.css", | ||
"main.css.map": "static/css/main.587197db.css.map", | ||
"main.js": "static/js/main.62c3c4bc.js", | ||
"main.js.map": "static/js/main.62c3c4bc.js.map", | ||
"static/media/Roboto-Light.ttf": "static/media/Roboto-Light.fc84e998.ttf", | ||
@@ -7,0 +7,0 @@ "static/media/Roboto-Medium.ttf": "static/media/Roboto-Medium.d0884059.ttf", |
@@ -1,1 +0,1 @@ | ||
"use strict";var precacheConfig=[["/index.html","4030c9270ba44c92a89f7d7d543902d5"],["/static/css/main.73ef4d21.css","53a161b639554620025773683077c8fc"],["/static/media/Roboto-Light.fc84e998.ttf","fc84e998bc29b297ea20321e4c90b6ed"],["/static/media/Roboto-Medium.d0884059.ttf","d08840599e05db7345652d3d417574a9"],["/static/media/Roboto-Regular.3e1af3ef.ttf","3e1af3ef546b9e6ecef9f3ba197bf7d2"],["/static/media/absence.4dbb9308.svg","4dbb9308875054a07ca9e874a29d385d"],["/static/media/approvesimple-logo.465ea012.svg","465ea01231a66076d1cd238f4ebad262"],["/static/media/expense.24cebce3.svg","24cebce35801c5174d9b4317b0e253bd"],["/static/media/invoice.0fa075cd.svg","0fa075cd4a1e70d8cd37ba074233ea6c"],["/static/media/it.a785dbcb.svg","a785dbcbe7da13cfee48f97e0a870b97"],["/static/media/purchase-order.f86fcd82.svg","f86fcd827c0ae486eb702ea97ccb9a37"],["/static/media/purchase-request.8e1504a6.svg","8e1504a6f862753b5afc45849934218b"],["/static/media/timesheet.4e7b0841.svg","4e7b084140c074d0b4d0eed7bc605980"]],cacheName="sw-precache-v3-sw-precache-webpack-plugin-"+(self.registration?self.registration.scope:""),ignoreUrlParametersMatching=[/^utm_/],addDirectoryIndex=function(e,t){var n=new URL(e);return"/"===n.pathname.slice(-1)&&(n.pathname+=t),n.toString()},cleanResponse=function(t){return t.redirected?("body"in t?Promise.resolve(t.body):t.blob()).then(function(e){return new Response(e,{headers:t.headers,status:t.status,statusText:t.statusText})}):Promise.resolve(t)},createCacheKey=function(e,t,n,a){var r=new URL(e);return a&&r.pathname.match(a)||(r.search+=(r.search?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(n)),r.toString()},isPathWhitelisted=function(e,t){if(0===e.length)return!0;var n=new URL(t).pathname;return e.some(function(e){return n.match(e)})},stripIgnoredUrlParameters=function(e,n){var t=new URL(e);return t.hash="",t.search=t.search.slice(1).split("&").map(function(e){return e.split("=")}).filter(function(t){return n.every(function(e){return!e.test(t[0])})}).map(function(e){return e.join("=")}).join("&"),t.toString()},hashParamName="_sw-precache",urlsToCacheKeys=new Map(precacheConfig.map(function(e){var t=e[0],n=e[1],a=new URL(t,self.location),r=createCacheKey(a,hashParamName,n,/\.\w{8}\./);return[a.toString(),r]}));function setOfCachedUrls(e){return e.keys().then(function(e){return e.map(function(e){return e.url})}).then(function(e){return new Set(e)})}self.addEventListener("install",function(e){e.waitUntil(caches.open(cacheName).then(function(a){return setOfCachedUrls(a).then(function(n){return Promise.all(Array.from(urlsToCacheKeys.values()).map(function(t){if(!n.has(t)){var e=new Request(t,{credentials:"same-origin"});return fetch(e).then(function(e){if(!e.ok)throw new Error("Request for "+t+" returned a response with status "+e.status);return cleanResponse(e).then(function(e){return a.put(t,e)})})}}))})}).then(function(){return self.skipWaiting()}))}),self.addEventListener("activate",function(e){var n=new Set(urlsToCacheKeys.values());e.waitUntil(caches.open(cacheName).then(function(t){return t.keys().then(function(e){return Promise.all(e.map(function(e){if(!n.has(e.url))return t.delete(e)}))})}).then(function(){return self.clients.claim()}))}),self.addEventListener("fetch",function(t){if("GET"===t.request.method){var e,n=stripIgnoredUrlParameters(t.request.url,ignoreUrlParametersMatching),a="index.html";(e=urlsToCacheKeys.has(n))||(n=addDirectoryIndex(n,a),e=urlsToCacheKeys.has(n));var r="/index.html";!e&&"navigate"===t.request.mode&&isPathWhitelisted(["^(?!\\/__).*"],t.request.url)&&(n=new URL(r,self.location).toString(),e=urlsToCacheKeys.has(n)),e&&t.respondWith(caches.open(cacheName).then(function(e){return e.match(urlsToCacheKeys.get(n)).then(function(e){if(e)return e;throw Error("The cached response that was expected is missing.")})}).catch(function(e){return console.warn('Couldn\'t serve response for "%s" from cache: %O',t.request.url,e),fetch(t.request)}))}}); | ||
"use strict";var precacheConfig=[["/index.html","c73df61ca12a317d24c8561230b78cc3"],["/static/css/main.587197db.css","78eb96e40e712fd1d4224287a17093aa"],["/static/media/Roboto-Light.fc84e998.ttf","fc84e998bc29b297ea20321e4c90b6ed"],["/static/media/Roboto-Medium.d0884059.ttf","d08840599e05db7345652d3d417574a9"],["/static/media/Roboto-Regular.3e1af3ef.ttf","3e1af3ef546b9e6ecef9f3ba197bf7d2"],["/static/media/absence.4dbb9308.svg","4dbb9308875054a07ca9e874a29d385d"],["/static/media/approvesimple-logo.465ea012.svg","465ea01231a66076d1cd238f4ebad262"],["/static/media/expense.24cebce3.svg","24cebce35801c5174d9b4317b0e253bd"],["/static/media/invoice.0fa075cd.svg","0fa075cd4a1e70d8cd37ba074233ea6c"],["/static/media/it.a785dbcb.svg","a785dbcbe7da13cfee48f97e0a870b97"],["/static/media/purchase-order.f86fcd82.svg","f86fcd827c0ae486eb702ea97ccb9a37"],["/static/media/purchase-request.8e1504a6.svg","8e1504a6f862753b5afc45849934218b"],["/static/media/timesheet.4e7b0841.svg","4e7b084140c074d0b4d0eed7bc605980"]],cacheName="sw-precache-v3-sw-precache-webpack-plugin-"+(self.registration?self.registration.scope:""),ignoreUrlParametersMatching=[/^utm_/],addDirectoryIndex=function(e,t){var a=new URL(e);return"/"===a.pathname.slice(-1)&&(a.pathname+=t),a.toString()},cleanResponse=function(t){return t.redirected?("body"in t?Promise.resolve(t.body):t.blob()).then(function(e){return new Response(e,{headers:t.headers,status:t.status,statusText:t.statusText})}):Promise.resolve(t)},createCacheKey=function(e,t,a,n){var r=new URL(e);return n&&r.pathname.match(n)||(r.search+=(r.search?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(a)),r.toString()},isPathWhitelisted=function(e,t){if(0===e.length)return!0;var a=new URL(t).pathname;return e.some(function(e){return a.match(e)})},stripIgnoredUrlParameters=function(e,a){var t=new URL(e);return t.hash="",t.search=t.search.slice(1).split("&").map(function(e){return e.split("=")}).filter(function(t){return a.every(function(e){return!e.test(t[0])})}).map(function(e){return e.join("=")}).join("&"),t.toString()},hashParamName="_sw-precache",urlsToCacheKeys=new Map(precacheConfig.map(function(e){var t=e[0],a=e[1],n=new URL(t,self.location),r=createCacheKey(n,hashParamName,a,/\.\w{8}\./);return[n.toString(),r]}));function setOfCachedUrls(e){return e.keys().then(function(e){return e.map(function(e){return e.url})}).then(function(e){return new Set(e)})}self.addEventListener("install",function(e){e.waitUntil(caches.open(cacheName).then(function(n){return setOfCachedUrls(n).then(function(a){return Promise.all(Array.from(urlsToCacheKeys.values()).map(function(t){if(!a.has(t)){var e=new Request(t,{credentials:"same-origin"});return fetch(e).then(function(e){if(!e.ok)throw new Error("Request for "+t+" returned a response with status "+e.status);return cleanResponse(e).then(function(e){return n.put(t,e)})})}}))})}).then(function(){return self.skipWaiting()}))}),self.addEventListener("activate",function(e){var a=new Set(urlsToCacheKeys.values());e.waitUntil(caches.open(cacheName).then(function(t){return t.keys().then(function(e){return Promise.all(e.map(function(e){if(!a.has(e.url))return t.delete(e)}))})}).then(function(){return self.clients.claim()}))}),self.addEventListener("fetch",function(t){if("GET"===t.request.method){var e,a=stripIgnoredUrlParameters(t.request.url,ignoreUrlParametersMatching),n="index.html";(e=urlsToCacheKeys.has(a))||(a=addDirectoryIndex(a,n),e=urlsToCacheKeys.has(a));var r="/index.html";!e&&"navigate"===t.request.mode&&isPathWhitelisted(["^(?!\\/__).*"],t.request.url)&&(a=new URL(r,self.location).toString(),e=urlsToCacheKeys.has(a)),e&&t.respondWith(caches.open(cacheName).then(function(e){return e.match(urlsToCacheKeys.get(a)).then(function(e){if(e)return e;throw Error("The cached response that was expected is missing.")})}).catch(function(e){return console.warn('Couldn\'t serve response for "%s" from cache: %O',t.request.url,e),fetch(t.request)}))}}); |
@@ -25,2 +25,4 @@ const express = require('express'); | ||
var taskResults = {}; | ||
exports.LocalServer = class server{ | ||
@@ -50,4 +52,32 @@ constructor(TaskClasses, logger, port){ | ||
async start(){ | ||
async start() { | ||
var logger = this.logger; | ||
this.app.get('/get-task-result/:taskId', async (req, res) => { | ||
try { | ||
let taskId = req.params.taskId; | ||
let result; | ||
if (taskResults[taskId]) { | ||
result = taskResults[taskId]; | ||
delete taskResults[taskId]; | ||
} else result = "not-exist"; | ||
if (result.taskStatus && result.taskStatus.attachment) { | ||
var stream = result.taskStatus.attachment.stream, contentType = result.taskStatus.attachment.contentType; | ||
res.writeHead(200, { | ||
'attachment': true, | ||
'Content-Type': contentType/*, | ||
'Content-Length': stream.size*/ | ||
}); | ||
await stream.pipe(res); | ||
} else { | ||
res.send(JSON.stringify(result)); | ||
res.end(); | ||
} | ||
} catch (e) { | ||
console.error("got server error:", e) | ||
} | ||
}); | ||
this.app.get('/fetch', async (req, res) => { | ||
@@ -57,2 +87,4 @@ var taskId = this.generateTaskId(); | ||
backend = task.backend, result; | ||
res.send(JSON.stringify({taskId})); | ||
res.end(); | ||
@@ -69,3 +101,3 @@ try{ | ||
result = JSON.stringify({approvalsResult, taskStatus}); | ||
result = {approvalsResult, taskStatus}; | ||
} catch(ex){ | ||
@@ -75,4 +107,3 @@ result = `Sync error ${ex.stack}`; | ||
res.send(result); | ||
res.end(); | ||
taskResults[taskId] = result; | ||
}); | ||
@@ -85,2 +116,6 @@ | ||
var taskId = data.id = this.generateTaskId(); | ||
res.send(JSON.stringify({taskId})); | ||
res.end(); | ||
var task = new this.TaskClasses.Task(data), | ||
@@ -102,19 +137,4 @@ backend = task.backend, result; | ||
if (!taskStatus.attachment){ | ||
result = JSON.stringify({approvalsResult, taskStatus}); | ||
res.send(result); | ||
res.end(); | ||
} else { | ||
var stream = taskStatus.attachment.stream, | ||
contentType = taskStatus.attachment.contentType; | ||
result = {approvalsResult, taskStatus}; | ||
res.writeHead(200, { | ||
'attachment' : true, | ||
'Content-Type' : contentType/*, | ||
'Content-Length': stream.size*/ | ||
}); | ||
await stream.pipe(res); | ||
} | ||
} catch(ex){ | ||
@@ -125,2 +145,3 @@ res.send(`Action error ${ex.stack}`); | ||
taskResults[taskId] = result; | ||
@@ -127,0 +148,0 @@ }); |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
21754142
15760