New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

savim

Package Overview
Dependencies
Maintainers
1
Versions
234
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

savim - npm Package Compare versions

Comparing version 1.2.144 to 1.2.145

55

dist/savim.cjs.development.js

@@ -9,2 +9,27 @@ 'use strict';

function asyncGeneratorStep(n, t, e, r, o, a, c) {
try {
var i = n[a](c),
u = i.value;
} catch (n) {
return void e(n);
}
i.done ? t(u) : Promise.resolve(u).then(r, o);
}
function _asyncToGenerator(n) {
return function () {
var t = this,
e = arguments;
return new Promise(function (r, o) {
var a = n.apply(t, e);
function _next(n) {
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
}
function _throw(n) {
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
}
_next(void 0);
});
};
}
function _regeneratorRuntime() {

@@ -311,32 +336,2 @@ _regeneratorRuntime = function () {

}
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}

@@ -343,0 +338,0 @@ var SavimProviderInterface =

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r,t=(r=require("pino"))&&"object"==typeof r&&"default"in r?r.default:r;function e(){e=function(){return t};var r,t={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(r,t,e){r[t]=e.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(r,t,e){return Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{l({},"")}catch(r){l=function(r,t,e){return r[t]=e}}function f(r,t,e,n){var o=Object.create((t&&t.prototype instanceof y?t:y).prototype),a=new _(n||[]);return i(o,"_invoke",{value:N(r,e,a)}),o}function h(r,t,e){try{return{type:"normal",arg:r.call(t,e)}}catch(r){return{type:"throw",arg:r}}}t.wrap=f;var v="suspendedStart",d="executing",p="completed",g={};function y(){}function m(){}function b(){}var w={};l(w,u,(function(){return this}));var x=Object.getPrototypeOf,P=x&&x(x(j([])));P&&P!==n&&o.call(P,u)&&(w=P);var L=b.prototype=y.prototype=Object.create(w);function k(r){["next","throw","return"].forEach((function(t){l(r,t,(function(r){return this._invoke(t,r)}))}))}function E(r,t){function e(n,i,a,u){var c=h(r[n],r,i);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==typeof l&&o.call(l,"__await")?t.resolve(l.__await).then((function(r){e("next",r,a,u)}),(function(r){e("throw",r,a,u)})):t.resolve(l).then((function(r){s.value=r,a(s)}),(function(r){return e("throw",r,a,u)}))}u(c.arg)}var n;i(this,"_invoke",{value:function(r,o){function i(){return new t((function(t,n){e(r,o,t,n)}))}return n=n?n.then(i,i):i()}})}function N(t,e,n){var o=v;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===p){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=I(u,n);if(c){if(c===g)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=h(t,e,n);if("normal"===s.type){if(o=n.done?p:"suspendedYield",s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=p,n.method="throw",n.arg=s.arg)}}}function I(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,I(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,g):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function F(r){var t={tryLoc:r[0]};1 in r&&(t.catchLoc=r[1]),2 in r&&(t.finallyLoc=r[2],t.afterLoc=r[3]),this.tryEntries.push(t)}function S(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function _(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(F,this),this.reset(!0)}function j(t){if(t||""===t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(o.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=r,e.done=!0,e};return i.next=i}}throw new TypeError(typeof t+" is not iterable")}return m.prototype=b,i(L,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:m,configurable:!0}),m.displayName=l(b,s,"GeneratorFunction"),t.isGeneratorFunction=function(r){var t="function"==typeof r&&r.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,b):(r.__proto__=b,l(r,s,"GeneratorFunction")),r.prototype=Object.create(L),r},t.awrap=function(r){return{__await:r}},k(E.prototype),l(E.prototype,c,(function(){return this})),t.AsyncIterator=E,t.async=function(r,e,n,o,i){void 0===i&&(i=Promise);var a=new E(f(r,e,n,o),i);return t.isGeneratorFunction(e)?a:a.next().then((function(r){return r.done?r.value:a.next()}))},k(L),l(L,s,"Generator"),l(L,u,(function(){return this})),l(L,"toString",(function(){return"[object Generator]"})),t.keys=function(r){var t=Object(r),e=[];for(var n in t)e.push(n);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=j,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var r=this.tryEntries[0].completion;if("throw"===r.type)throw r.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,o){return u.type="throw",u.arg=t,e.next=n,o&&(e.method="next",e.arg=r),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),s=o.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(r,t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===r||"continue"===r)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=r,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(r,t){if("throw"===r.type)throw r.arg;return"break"===r.type||"continue"===r.type?this.next=r.arg:"return"===r.type?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):"normal"===r.type&&t&&(this.next=t),g},finish:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var e=this.tryEntries[t];if(e.finallyLoc===r)return this.complete(e.completion,e.afterLoc),S(e),g}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var e=this.tryEntries[t];if(e.tryLoc===r){var n=e.completion;if("throw"===n.type){var o=n.arg;S(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:j(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),g}},t}function n(r,t,e,n,o,i,a){try{var u=r[i](a),c=u.value}catch(r){return void e(r)}u.done?t(c):Promise.resolve(c).then(n,o)}function o(r){return function(){var t=this,e=arguments;return new Promise((function(o,i){var a=r.apply(t,e);function u(r){n(a,o,i,u,c,"next",r)}function c(r){n(a,o,i,u,c,"throw",r)}u(void 0)}))}}exports.Savim=function(){function r(r){var e=this;this.log=r,this.providers={},this.getInvolvedProvider=function(r){var t=Object.keys(e.providers),n=void 0;return r&&e.providers[r]?n=e.providers[r]:(null==t?void 0:t.length)>0&&(n=e.providers[t[0]]),n},this.logger=t({level:r||"info"})}var n=r.prototype;return n.addProvider=function(){var r=o(e().mark((function r(t,n,o){var i;return e().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=new t(n),r.next=3,i.isHealthy();case 3:if(r.sent){r.next=6;break}throw this.logger.error("[SAVIM] Provider "+i.name+" is not healthy !"),"Provider is not healthy !";case 6:if(!this.providers[o||i.name]){r.next=9;break}throw this.logger.error("[SAVIM] Provider "+(o||i.name)+" is not healthy !"),"Provider already exist !";case 9:this.providers[o||i.name]=i;case 10:case"end":return r.stop()}}),r,this)})));return function(t,e,n){return r.apply(this,arguments)}}(),n.removeProvider=function(){var r=o(e().mark((function r(t){return e().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:this.providers[t]&&delete this.providers[t];case 1:case"end":return r.stop()}}),r,this)})));return function(t){return r.apply(this,arguments)}}(),n.uploadFile=function(){var r=o(e().mark((function r(t,n,o,i){var a;return e().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===o&&(o={}),a=this.getInvolvedProvider(i),this.logger.debug("[SAVIM] Upload file "+(a?"(Provider: "+a.name+")":"(No provider)")+" "+(a?"(Provider: "+a.name+")":"(No provider)")+" "+t),this.logger.debug(o),!a){r.next=6;break}return r.abrupt("return",a.uploadFile(t,n,o));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(t,e,n,o){return r.apply(this,arguments)}}(),n.getFile=function(){var r=o(e().mark((function r(t,n,o){var i;return e().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===n&&(n={}),i=this.getInvolvedProvider(o),this.logger.debug("[SAVIM] Get file "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+t),this.logger.debug(n),!i){r.next=6;break}return r.abrupt("return",i.getFile(t,n));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(t,e,n){return r.apply(this,arguments)}}(),n.deleteFile=function(){var r=o(e().mark((function r(t,n,o){var i;return e().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===n&&(n={}),i=this.getInvolvedProvider(o),this.logger.debug("[SAVIM] Delete file "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")),this.logger.debug(n),!i){r.next=6;break}return r.abrupt("return",i.deleteFile(t,n));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(t,e,n){return r.apply(this,arguments)}}(),n.createFolder=function(){var r=o(e().mark((function r(t,n,o){var i;return e().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===n&&(n={}),i=this.getInvolvedProvider(o),this.logger.debug("[SAVIM] Create folder "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+t),this.logger.debug(n),!i){r.next=6;break}return r.abrupt("return",i.createFolder(t,n));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(t,e,n){return r.apply(this,arguments)}}(),n.deleteFolder=function(){var r=o(e().mark((function r(t,n,o){var i;return e().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===n&&(n={}),i=this.getInvolvedProvider(o),this.logger.debug("[SAVIM] Delete folder "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")),this.logger.debug(n),!i){r.next=6;break}return r.abrupt("return",i.deleteFolder(t,n));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(t,e,n){return r.apply(this,arguments)}}(),n.getFolders=function(){var r=o(e().mark((function r(t,n,o){var i;return e().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===n&&(n={}),i=this.getInvolvedProvider(o),this.logger.debug("[SAVIM] Get folders "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+t),this.logger.debug(n),!i){r.next=6;break}return r.abrupt("return",i.getFolders(t,n));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(t,e,n){return r.apply(this,arguments)}}(),n.getFiles=function(){var r=o(e().mark((function r(t,n,o){var i;return e().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===n&&(n={}),i=this.getInvolvedProvider(o),this.logger.debug("[SAVIM] Get files "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+t),this.logger.debug(n),!i){r.next=6;break}return r.abrupt("return",i.getFiles(t,n));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(t,e,n){return r.apply(this,arguments)}}(),r}(),exports.SavimProviderInterface=function(r){};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r,t=(r=require("pino"))&&"object"==typeof r&&"default"in r?r.default:r;function e(r,t,e,n,o,i,a){try{var u=r[i](a),c=u.value}catch(r){return void e(r)}u.done?t(c):Promise.resolve(c).then(n,o)}function n(r){return function(){var t=this,n=arguments;return new Promise((function(o,i){var a=r.apply(t,n);function u(r){e(a,o,i,u,c,"next",r)}function c(r){e(a,o,i,u,c,"throw",r)}u(void 0)}))}}function o(){o=function(){return t};var r,t={},e=Object.prototype,n=e.hasOwnProperty,i=Object.defineProperty||function(r,t,e){r[t]=e.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(r,t,e){return Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{l({},"")}catch(r){l=function(r,t,e){return r[t]=e}}function f(r,t,e,n){var o=Object.create((t&&t.prototype instanceof y?t:y).prototype),a=new _(n||[]);return i(o,"_invoke",{value:N(r,e,a)}),o}function h(r,t,e){try{return{type:"normal",arg:r.call(t,e)}}catch(r){return{type:"throw",arg:r}}}t.wrap=f;var v="suspendedStart",d="executing",p="completed",g={};function y(){}function m(){}function b(){}var w={};l(w,u,(function(){return this}));var x=Object.getPrototypeOf,P=x&&x(x(j([])));P&&P!==e&&n.call(P,u)&&(w=P);var L=b.prototype=y.prototype=Object.create(w);function k(r){["next","throw","return"].forEach((function(t){l(r,t,(function(r){return this._invoke(t,r)}))}))}function E(r,t){function e(o,i,a,u){var c=h(r[o],r,i);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(r){e("next",r,a,u)}),(function(r){e("throw",r,a,u)})):t.resolve(l).then((function(r){s.value=r,a(s)}),(function(r){return e("throw",r,a,u)}))}u(c.arg)}var o;i(this,"_invoke",{value:function(r,n){function i(){return new t((function(t,o){e(r,n,t,o)}))}return o=o?o.then(i,i):i()}})}function N(t,e,n){var o=v;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===p){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=I(u,n);if(c){if(c===g)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=h(t,e,n);if("normal"===s.type){if(o=n.done?p:"suspendedYield",s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=p,n.method="throw",n.arg=s.arg)}}}function I(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,I(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,g):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function F(r){var t={tryLoc:r[0]};1 in r&&(t.catchLoc=r[1]),2 in r&&(t.finallyLoc=r[2],t.afterLoc=r[3]),this.tryEntries.push(t)}function S(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function _(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(F,this),this.reset(!0)}function j(t){if(t||""===t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function e(){for(;++o<t.length;)if(n.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=r,e.done=!0,e};return i.next=i}}throw new TypeError(typeof t+" is not iterable")}return m.prototype=b,i(L,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:m,configurable:!0}),m.displayName=l(b,s,"GeneratorFunction"),t.isGeneratorFunction=function(r){var t="function"==typeof r&&r.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,b):(r.__proto__=b,l(r,s,"GeneratorFunction")),r.prototype=Object.create(L),r},t.awrap=function(r){return{__await:r}},k(E.prototype),l(E.prototype,c,(function(){return this})),t.AsyncIterator=E,t.async=function(r,e,n,o,i){void 0===i&&(i=Promise);var a=new E(f(r,e,n,o),i);return t.isGeneratorFunction(e)?a:a.next().then((function(r){return r.done?r.value:a.next()}))},k(L),l(L,s,"Generator"),l(L,u,(function(){return this})),l(L,"toString",(function(){return"[object Generator]"})),t.keys=function(r){var t=Object(r),e=[];for(var n in t)e.push(n);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=j,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var r=this.tryEntries[0].completion;if("throw"===r.type)throw r.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function o(n,o){return u.type="throw",u.arg=t,e.next=n,o&&(e.method="next",e.arg=r),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(r,t){for(var e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===r||"continue"===r)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=r,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(r,t){if("throw"===r.type)throw r.arg;return"break"===r.type||"continue"===r.type?this.next=r.arg:"return"===r.type?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):"normal"===r.type&&t&&(this.next=t),g},finish:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var e=this.tryEntries[t];if(e.finallyLoc===r)return this.complete(e.completion,e.afterLoc),S(e),g}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var e=this.tryEntries[t];if(e.tryLoc===r){var n=e.completion;if("throw"===n.type){var o=n.arg;S(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:j(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),g}},t}exports.Savim=function(){function r(r){var e=this;this.log=r,this.providers={},this.getInvolvedProvider=function(r){var t=Object.keys(e.providers),n=void 0;return r&&e.providers[r]?n=e.providers[r]:(null==t?void 0:t.length)>0&&(n=e.providers[t[0]]),n},this.logger=t({level:r||"info"})}var e=r.prototype;return e.addProvider=function(){var r=n(o().mark((function r(t,e,n){var i;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=new t(e),r.next=3,i.isHealthy();case 3:if(r.sent){r.next=6;break}throw this.logger.error("[SAVIM] Provider "+i.name+" is not healthy !"),"Provider is not healthy !";case 6:if(!this.providers[n||i.name]){r.next=9;break}throw this.logger.error("[SAVIM] Provider "+(n||i.name)+" is not healthy !"),"Provider already exist !";case 9:this.providers[n||i.name]=i;case 10:case"end":return r.stop()}}),r,this)})));return function(t,e,n){return r.apply(this,arguments)}}(),e.removeProvider=function(){var r=n(o().mark((function r(t){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:this.providers[t]&&delete this.providers[t];case 1:case"end":return r.stop()}}),r,this)})));return function(t){return r.apply(this,arguments)}}(),e.uploadFile=function(){var r=n(o().mark((function r(t,e,n,i){var a;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===n&&(n={}),a=this.getInvolvedProvider(i),this.logger.debug("[SAVIM] Upload file "+(a?"(Provider: "+a.name+")":"(No provider)")+" "+(a?"(Provider: "+a.name+")":"(No provider)")+" "+t),this.logger.debug(n),!a){r.next=6;break}return r.abrupt("return",a.uploadFile(t,e,n));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(t,e,n,o){return r.apply(this,arguments)}}(),e.getFile=function(){var r=n(o().mark((function r(t,e,n){var i;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===e&&(e={}),i=this.getInvolvedProvider(n),this.logger.debug("[SAVIM] Get file "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+t),this.logger.debug(e),!i){r.next=6;break}return r.abrupt("return",i.getFile(t,e));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(t,e,n){return r.apply(this,arguments)}}(),e.deleteFile=function(){var r=n(o().mark((function r(t,e,n){var i;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===e&&(e={}),i=this.getInvolvedProvider(n),this.logger.debug("[SAVIM] Delete file "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")),this.logger.debug(e),!i){r.next=6;break}return r.abrupt("return",i.deleteFile(t,e));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(t,e,n){return r.apply(this,arguments)}}(),e.createFolder=function(){var r=n(o().mark((function r(t,e,n){var i;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===e&&(e={}),i=this.getInvolvedProvider(n),this.logger.debug("[SAVIM] Create folder "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+t),this.logger.debug(e),!i){r.next=6;break}return r.abrupt("return",i.createFolder(t,e));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(t,e,n){return r.apply(this,arguments)}}(),e.deleteFolder=function(){var r=n(o().mark((function r(t,e,n){var i;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===e&&(e={}),i=this.getInvolvedProvider(n),this.logger.debug("[SAVIM] Delete folder "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")),this.logger.debug(e),!i){r.next=6;break}return r.abrupt("return",i.deleteFolder(t,e));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(t,e,n){return r.apply(this,arguments)}}(),e.getFolders=function(){var r=n(o().mark((function r(t,e,n){var i;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===e&&(e={}),i=this.getInvolvedProvider(n),this.logger.debug("[SAVIM] Get folders "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+t),this.logger.debug(e),!i){r.next=6;break}return r.abrupt("return",i.getFolders(t,e));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(t,e,n){return r.apply(this,arguments)}}(),e.getFiles=function(){var r=n(o().mark((function r(t,e,n){var i;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===e&&(e={}),i=this.getInvolvedProvider(n),this.logger.debug("[SAVIM] Get files "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+t),this.logger.debug(e),!i){r.next=6;break}return r.abrupt("return",i.getFiles(t,e));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(t,e,n){return r.apply(this,arguments)}}(),r}(),exports.SavimProviderInterface=function(r){};
//# sourceMappingURL=savim.cjs.production.min.js.map
import Pino from 'pino';
function asyncGeneratorStep(n, t, e, r, o, a, c) {
try {
var i = n[a](c),
u = i.value;
} catch (n) {
return void e(n);
}
i.done ? t(u) : Promise.resolve(u).then(r, o);
}
function _asyncToGenerator(n) {
return function () {
var t = this,
e = arguments;
return new Promise(function (r, o) {
var a = n.apply(t, e);
function _next(n) {
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
}
function _throw(n) {
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
}
_next(void 0);
});
};
}
function _regeneratorRuntime() {

@@ -304,32 +329,2 @@ _regeneratorRuntime = function () {

}
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}

@@ -336,0 +331,0 @@ var SavimProviderInterface =

{
"version": "1.2.144",
"version": "1.2.145",
"license": "MIT",

@@ -67,4 +67,4 @@ "main": "dist/index.js",

"@types/jest": "^29.5.0",
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"@typescript-eslint/eslint-plugin": "7.11.0",
"@typescript-eslint/parser": "7.11.0",
"eslint": "8.57.0",

@@ -71,0 +71,0 @@ "eslint-config-prettier": "9.1.0",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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