@aofl/resource-enumerate
Advanced tools
Comparing version 3.0.0-beta.28 to 3.0.0-beta.30
25
.aofl.js
@@ -31,7 +31,22 @@ const path = require('path'); | ||
externals: { | ||
'lit-element': { | ||
commonjs2: 'lit-element', | ||
commonjs: 'lit-element', | ||
amd: 'lit-element', | ||
} | ||
'@aofl/api-request': { | ||
commonjs2: '@aofl/api-request', | ||
commonjs: '@aofl/api-request', | ||
amd: '@aofl/api-request', | ||
}, | ||
'@aofl/cache-manager': { | ||
commonjs2: '@aofl/cache-manager', | ||
commonjs: '@aofl/cache-manager', | ||
amd: '@aofl/cache-manager', | ||
}, | ||
'@aofl/middleware': { | ||
commonjs2: '@aofl/middleware', | ||
commonjs: '@aofl/middleware', | ||
amd: '@aofl/middleware', | ||
}, | ||
'@aofl/server-environment': { | ||
commonjs2: '@aofl/server-environment', | ||
commonjs: '@aofl/server-environment', | ||
amd: '@aofl/server-environment', | ||
}, | ||
} | ||
@@ -38,0 +53,0 @@ } |
@@ -1,2 +0,2 @@ | ||
module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s="QfWi")}({"+lLu":function(e,t,r){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s="QfWi")}({MmcY:function(e,t){e.exports=r("lwsE")},QfWi:function(e,t,r){"use strict";r.r(t);var n=r("MmcY"),o=r.n(n),i=r("iTvO"),a=r.n(i),u=function(){function e(){o()(this,e),this.middleware={};for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];for(var i=0;i<r.length;i++)this.middleware[r[i]]=[]}return a()(e,[{key:"use",value:function(e,t){if("function"!=typeof e)throw new Error("callback must be a function");if(void 0===this.middleware[t])throw new Error("Only ".concat(Object.keys(this.middleware)," hooks are supported."));return this.middleware[t].push({callback:e,hook:t}),this.createUnsubscribeFn(t,e)}},{key:"getMiddlewareIterator",value:function(e){var t=this.middleware[e],r=0;return{next:function(){return r<t.length?{value:t[r++],done:!1}:{done:!0}}}}},{key:"iterateMiddleware",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return new Promise((function(o){var i=r.getMiddlewareIterator(t),a=null;!function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;!0!==(a=i.next()).done?a.value.callback(e,r,t):o(r)}(n)}))}},{key:"createUnsubscribeFn",value:function(e,t){var r=this;return function n(){if(!n.executed){Object.defineProperty(n,"executed",{value:!0});var o=r.middleware[e].indexOf(t);o>-1&&r.middleware[e].splice(o,1)}}}}]),e}();r.d(t,"Middleware",(function(){return u}))},iTvO:function(e,t){e.exports=r("W8MJ")}})},GkNx:function(e,t){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s="QfWi")}({QfWi:function(e,t,r){"use strict";r.r(t);var n={DEV:"development",STAGE:"stage",PROD:"production"};function o(e,t){return e instanceof RegExp&&e.test(location.hostname)?n.DEV:t instanceof RegExp&&t.test(location.hostname)?n.STAGE:n.PROD}r.d(t,"environmentTypeEnumerate",(function(){return n})),r.d(t,"getServerEnvironment",(function(){return o}))}})},QfWi:function(e,t,r){"use strict";r.r(t);var n=r("o0o1"),o=r.n(n),i=r("yXPU"),a=r.n(i),u=r("lwsE"),c=r.n(u),s=r("W8MJ"),f=r.n(s),l=r("GkNx"),h=r("+lLu"),p=r("n/fh"),d=function(){function e(t){var r=this;c()(this,e),this.environment=t,this.ready=new Promise((function(e){r.resolve=e})),this.middlewareInstance=new h.Middleware("before","after"),this.apiRequestInstance=new p.ApiRequest}var t,r;return f()(e,[{key:"init",value:(r=a()(o.a.mark((function e(t){var r,n,i,a,u,c,s=this,f=arguments;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.apis,n=t.developmentConfig,i=t.stageConfig,a=f.length>1&&void 0!==f[1]&&f[1],this.apis=r,u=function(e){if(!Object.hasOwnProperty.call(s.apis,e))return"continue";var t=s.apis[e];s.apiRequestInstance.addFormatter(e,{pack:function(){return t.requestOptions||{}},unpack:function(e){return e.json()}})},e.t0=o.a.keys(this.apis);case 5:if((e.t1=e.t0()).done){e.next=12;break}if(c=e.t1.value,"continue"!==u(c)){e.next=10;break}return e.abrupt("continue",5);case 10:e.next=5;break;case 12:if(!1!==a||this.environment===l.environmentTypeEnumerate.PROD){e.next=17;break}return e.next=15,this.updateApis(n,i);case 15:case 17:return this.resolve(),e.abrupt("return",this.ready);case 19:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"before",value:function(e){this.middlewareInstance.use(e,"before")}},{key:"after",value:function(e){this.middlewareInstance.use(e,"after")}},{key:"get",value:(t=a()(o.a.mark((function t(r){var n,i,a,u,c,s,f,l=this,h=arguments;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=!(h.length>1&&void 0!==h[1])||h[1],t.next=3,this.ready;case 3:if(i=this.apis[r],a=n,void 0!==i){t.next=7;break}throw new TypeError("".concat(r," is not a valid api namespace."));case 7:return(!a||"function"==typeof i.invalidateCache&&i.invalidateCache.call(null))&&(this.apiRequestInstance.clearCache(e.NAMESPACE),a=!1),u=this.apiRequestInstance.getCacheManager(e.NAMESPACE),c=u.getItem(i.url+JSON.stringify("")),s={namespace:r,cached:null!==c},t.next=13,this.middlewareInstance.iterateMiddleware(s,"before");case 13:return f=null,f=null!==c?c:this.apiRequestInstance.request(i.url,"",r,a,e.NAMESPACE),t.abrupt("return",f.then((function(e){return l.middlewareInstance.iterateMiddleware(s,"after",e)})));case 16:case"end":return t.stop()}}),t,this)}))),function(e){return t.apply(this,arguments)})},{key:"updateApis",value:function(e,t){var r=this,n=e;return this.environment===l.environmentTypeEnumerate.STAGE&&(n=t),n().then((function(e){for(var t in r.apis)if(Object.hasOwnProperty.call(r.apis,t)){var n=r.apis[t],o={};"function"==typeof n[r.environment+"Variables"]&&(o=n[r.environment+"Variables"].call(null)),n.url=e.default(t,o)}}))}}],[{key:"NAMESPACE",get:function(){return"resource-enumerate"}}]),e}();r.d(t,"ResourceEnumerate",(function(){return d}))},W8MJ:function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}},ls82:function(e,t,r){var n=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(e,t,r,n){var o=t&&t.prototype instanceof y?t:y,i=Object.create(o.prototype),a=new P(n||[]);return i._invoke=function(e,t,r){var n=f;return function(o,i){if(n===h)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return _()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=M(a,r);if(u){if(u===d)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var c=s(e,t,r);if("normal"===c.type){if(n=r.done?p:l,c.arg===d)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=p,r.method="throw",r.arg=c.arg)}}}(e,r,a),i}function s(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f="suspendedStart",l="suspendedYield",h="executing",p="completed",d={};function y(){}function v(){}function g(){}var m={};m[i]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(j([])));w&&w!==r&&n.call(w,i)&&(m=w);var x=g.prototype=y.prototype=Object.create(m);function O(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function E(e){var t;this._invoke=function(r,o){function i(){return new Promise((function(t,i){!function t(r,o,i,a){var u=s(e[r],e,o);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==typeof f&&n.call(f,"__await")?Promise.resolve(f.__await).then((function(e){t("next",e,i,a)}),(function(e){t("throw",e,i,a)})):Promise.resolve(f).then((function(e){c.value=e,i(c)}),(function(e){return t("throw",e,i,a)}))}a(u.arg)}(r,o,t,i)}))}return t=t?t.then(i,i):i()}}function M(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,M(e,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var o=s(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function j(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:_}}function _(){return{value:t,done:!0}}return v.prototype=x.constructor=g,g.constructor=v,g[u]=v.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,u in e||(e[u]="GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},O(E.prototype),E.prototype[a]=function(){return this},e.AsyncIterator=E,e.async=function(t,r,n,o){var i=new E(c(t,r,n,o));return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(x),x[u]="Generator",x[i]=function(){return this},x.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=j,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(S),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!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 new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}(e.exports);try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}},lwsE:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},"n/fh":function(e,t,r){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s="QfWi")}({QfWi:function(e,t,r){"use strict";r.r(t);var n=r("lwsE"),o=r.n(n),i=r("W8MJ"),a=r.n(i),u=function(){function e(){o()(this,e),this.formatters={}}return a()(e,[{key:"getFormatter",value:function(e){if(this.formatters.hasOwnProperty(e))return this.formatters[e]}},{key:"addFormatter",value:function(e,t){if("function"!=typeof t.pack||"function"!=typeof t.unpack)throw new TypeError("formatter must implement pack() and unpack() functions");if(void 0!==this.formatters[e])throw new Error("".concat(e," already exists. Cannot replace an existing format."));this.formatters[e]=t}}]),e}(),c=r("tMVl"),s=function(){function e(){o()(this,e),this.formatterManager=new u,this.cacheManagers={},this.addCacheManager("default")}return a()(e,null,[{key:"DEFAULT_CACHE_NAMESPACE",get:function(){return"ApiRequest"}}]),a()(e,[{key:"addFormatter",value:function(e,t){this.formatterManager.addFormatter(e,t)}},{key:"addCacheManager",value:function(e,t){if(Object.hasOwnProperty.call(this.cacheManagers,e))throw new Error("ApiRequest: Cache namespace ".concat(e," already exists"));this.cacheManagers[e]=new c.CacheManager(e,c.cacheTypeEnumerate.MEMORY,t)}},{key:"getCacheManager",value:function(e,t){try{void 0===e?this.addCacheManager(this[this.DEFAULT_CACHE_NAMESPACE],t):this.addCacheManager(e,t)}catch(e){}return this.cacheManagers[e]}},{key:"updateCacheInterval",value:function(e,t){this.getCacheManager(e,t).expire=t}},{key:"purgeCache",value:function(e){if(void 0===e)for(var t in this.cacheManagers)Object.hasOwnProperty.call(this.cacheManagers,t)&&this.cacheManagers[t].clear();else this.cacheManagers[e].clear()}},{key:"request",value:function(e,t,r){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"default",i=arguments.length>5?arguments[5]:void 0,a=this.formatterManager.getFormatter(r),u=e+JSON.stringify(t),c=this.getCacheManager(o,i),s=c.getItem(u);if(n&&s)return s;var f=fetch(e,a.pack(t)).then(a.unpack);return c.setItem(u,f),f}},{key:"clearCache",value:function(e){this.getCacheManager(e).clear()}}]),e}();r.d(t,"ApiRequest",(function(){return s}))},W8MJ:function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}},lwsE:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},tMVl:function(e,t){e.exports=r("o+F9")}})},"o+F9":function(e,t,r){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s="QfWi")}({QfWi:function(e,t,r){"use strict";r.r(t);var n,o=r("lwsE"),i=r.n(o),a=r("W8MJ"),u=r.n(a),c=r("lSNA"),s=r.n(c),f={MEMORY:0,LOCAL:1,SESSION:2},l=function(){function e(){i()(this,e)}return u()(e,null,[{key:"clear",value:function(){for(var t in e)e.hasOwnProperty(t)&&e.removeItem(t)}},{key:"getItem",value:function(t){return e.hasOwnProperty(t)?e[t]:null}},{key:"setItem",value:function(t,r){e[t]=r}},{key:"removeItem",value:function(t){e[t]=null,delete e[t]}},{key:"size",get:function(){var t=0;for(var r in e)e.hasOwnProperty(r)&&t++;return t}}]),e}(),h=r("rlan"),p=r.n(h),d=(n={},s()(n,f.LOCAL,localStorage),s()(n,f.SESSION,sessionStorage),s()(n,f.MEMORY,l),n),y=Symbol("expire"),v=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f.MEMORY,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:36e5;i()(this,e),this.storage=d[r],this.storageType=r,this.namespace=t,this.storedKeys=this.getStoredKeys(),this.expire=n}return u()(e,[{key:"getStoredKeys",value:function(){var e=[];for(var t in this.storage)this.storage.hasOwnProperty(t)&&0===t.indexOf(this.namespace+"_")&&e.push(t);return e}},{key:"getNamespaceKey",value:function(e){return this.storedKeys.indexOf(e)>-1?e:this.namespace+"_"+p()(e)}},{key:"setItem",value:function(e,t){var r={t:Date.now(),v:t};this.storageType!==f.LOCAL&&this.storageType!==f.SESSION||(r=JSON.stringify(r));var n=this.getNamespaceKey(e);this.storage.setItem(n,r),this.storedKeys.push(n)}},{key:"getItem",value:function(e){var t=this.storage.getItem(this.getNamespaceKey(e));return this.storageType!==f.LOCAL&&this.storageType!==f.SESSION||(t=JSON.parse(t)),null!==t&&t.hasOwnProperty("t")?this.isExpired(e)?(this.removeItem(e),null):t.v:t}},{key:"getCollection",value:function(){var e={};this.storedKeys=this.getStoredKeys();for(var t=0;t<this.storedKeys.length;t++)this.isExpired(this.storedKeys[t])||(e[this.storedKeys[t]]=this.getItem(this.storedKeys[t]));return e}},{key:"removeItem",value:function(e){var t=this.getNamespaceKey(e),r=this.storedKeys.indexOf(t);r>-1&&(this.storage.removeItem(t),this.storedKeys.splice(r,1))}},{key:"clear",value:function(){for(var e=0;e<this.storedKeys.length;e++)this.storage.removeItem(this.storedKeys[e]);this.storedKeys=[]}},{key:"isExpired",value:function(e){if("number"!=typeof this.expire||this.expire<=0)return!1;var t=this.getNamespaceKey(e),r=this.storage.getItem(t);return this.storageType!==f.LOCAL&&this.storageType!==f.SESSION||(r=JSON.parse(r)),r.t<Date.now()-this.expire}},{key:"removeExpired",value:function(){for(var e=0;e<this.storedKeys.length;e++)this.isExpired(this.storedKeys[e])&&this.removeItem(this.storedKeys[e])}},{key:"destruct",value:function(){clearInterval(this.interval),this.namespace=null,this.storage=null,this.storageType=null,this.expire=null,this.storedKeys=null,this.interval=null}},{key:"expire",get:function(){return this[y]},set:function(e){var t=this;this[y]=e,null!==this.interval&&clearInterval(this.interval),e>0&&e<2147483647&&(this.interval=setInterval((function(){return t.removeExpired()}),e))}},{key:"size",get:function(){var e=this.getCollection();return Object.keys(e).length}}]),e}();r.d(t,"CacheManager",(function(){return v})),r.d(t,"cacheTypeEnumerate",(function(){return f})),r.d(t,"MemoryStorage",(function(){return l}))},W8MJ:function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}},lSNA:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},lwsE:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},rlan:function(e,t){e.exports=r("q+NK")}})},o0o1:function(e,t,r){e.exports=r("ls82")},"q+NK":function(e,t){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return r.m=e,r.c=t,r.p="",r(0)}([function(e,t,r){e.exports=r(1)},function(e,t,r){var n=r(2);e.exports=n},function(e,t){var r;r=function(){for(var e=[],t=0;t<64;)e[t]=0|4294967296*Math.abs(Math.sin(++t));return function(t){for(var r,n,o,i,a=[],u=unescape(encodeURI(t)),c=u.length,s=[r=1732584193,n=-271733879,~r,~n],f=0;f<=c;)a[f>>2]|=(u.charCodeAt(f)||128)<<f++%4*8;for(a[t=16*(c+8>>6)+14]=8*c,f=0;f<t;f+=16){for(c=s,i=0;i<64;)c=[o=c[3],(r=0|c[1])+((o=c[0]+[r&(n=c[2])|~r&o,o&r|~o&n,r^n^o,n^(r|~o)][c=i>>4]+(e[i]+(0|a[[i,5*i+1,3*i+5,7*i][c]%16+f])))<<(c=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*c+i++%4])|o>>>32-c),r,n];for(i=4;i;)s[--i]=s[i]+c[i]}for(t="";i<32;)t+=(s[i>>3]>>4*(1^7&i++)&15).toString(16);return t}}(),e.exports=r}])},yXPU:function(e,t){function r(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var a=e.apply(t,n);function u(e){r(a,o,i,u,c,"next",e)}function c(e){r(a,o,i,u,c,"throw",e)}u(void 0)}))}}}}); | ||
module.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/",r(r.s="QfWi")}({BZcc:function(t,e){t.exports=require("@aofl/api-request")},QfWi:function(t,e,r){"use strict";r.r(e);var n=r("o0o1"),o=r.n(n),i=r("yXPU"),a=r.n(i),u=r("lwsE"),c=r.n(u),s=r("W8MJ"),f=r.n(s),l=r("bygm"),h=r("j1ZV"),p=r("BZcc"),v=function(){function t(e){var r=this;c()(this,t),this.environment=e,this.ready=new Promise((function(t){r.resolve=t})),this.middlewareInstance=new h.Middleware("before","after"),this.apiRequestInstance=new p.ApiRequest}var e,r;return f()(t,[{key:"init",value:(r=a()(o.a.mark((function t(e){var r,n,i,a,u,c,s=this,f=arguments;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e.apis,n=e.developmentConfig,i=e.stageConfig,a=f.length>1&&void 0!==f[1]&&f[1],this.apis=r,u=function(t){if(!Object.hasOwnProperty.call(s.apis,t))return"continue";var e=s.apis[t];s.apiRequestInstance.addFormatter(t,{pack:function(){return e.requestOptions||{}},unpack:function(t){return t.json()}})},t.t0=o.a.keys(this.apis);case 5:if((t.t1=t.t0()).done){t.next=12;break}if(c=t.t1.value,"continue"!==u(c)){t.next=10;break}return t.abrupt("continue",5);case 10:t.next=5;break;case 12:if(!1!==a||this.environment===l.environmentTypeEnumerate.PROD){t.next=17;break}return t.next=15,this.updateApis(n,i);case 15:case 17:return this.resolve(),t.abrupt("return",this.ready);case 19:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"before",value:function(t){this.middlewareInstance.use(t,"before")}},{key:"after",value:function(t){this.middlewareInstance.use(t,"after")}},{key:"get",value:(e=a()(o.a.mark((function e(r){var n,i,a,u,c,s,f,l=this,h=arguments;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=!(h.length>1&&void 0!==h[1])||h[1],e.next=3,this.ready;case 3:if(i=this.apis[r],a=n,void 0!==i){e.next=7;break}throw new TypeError("".concat(r," is not a valid api namespace."));case 7:return(!a||"function"==typeof i.invalidateCache&&i.invalidateCache.call(null))&&(this.apiRequestInstance.clearCache(t.NAMESPACE),a=!1),u=this.apiRequestInstance.getCacheManager(t.NAMESPACE),c=u.getItem(i.url+JSON.stringify("")),s={namespace:r,cached:null!==c},e.next=13,this.middlewareInstance.iterateMiddleware(s,"before");case 13:return f=null,f=null!==c?c:this.apiRequestInstance.request(i.url,"",r,a,t.NAMESPACE),e.abrupt("return",f.then((function(t){return l.middlewareInstance.iterateMiddleware(s,"after",t)})));case 16:case"end":return e.stop()}}),e,this)}))),function(t){return e.apply(this,arguments)})},{key:"updateApis",value:function(t,e){var r=this,n=t;return this.environment===l.environmentTypeEnumerate.STAGE&&(n=e),n().then((function(t){for(var e in r.apis)if(Object.hasOwnProperty.call(r.apis,e)){var n=r.apis[e],o={};"function"==typeof n[r.environment+"Variables"]&&(o=n[r.environment+"Variables"].call(null)),n.url=t.default(e,o)}}))}}],[{key:"NAMESPACE",get:function(){return"resource-enumerate"}}]),t}();r.d(e,"ResourceEnumerate",(function(){return v}))},W8MJ:function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},bygm:function(t,e){t.exports=require("@aofl/server-environment")},j1ZV:function(t,e){t.exports=require("@aofl/middleware")},ls82:function(t,e,r){var n=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new j(n||[]);return i._invoke=function(t,e,r){var n=f;return function(o,i){if(n===h)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=O(a,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var c=s(t,e,r);if("normal"===c.type){if(n=r.done?p:l,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=p,r.method="throw",r.arg=c.arg)}}}(t,r,a),i}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f="suspendedStart",l="suspendedYield",h="executing",p="completed",v={};function y(){}function d(){}function m(){}var g={};g[i]=function(){return this};var w=Object.getPrototypeOf,b=w&&w(w(_([])));b&&b!==r&&n.call(b,i)&&(g=b);var x=m.prototype=y.prototype=Object.create(g);function E(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function L(t){var e;this._invoke=function(r,o){function i(){return new Promise((function(e,i){!function e(r,o,i,a){var u=s(t[r],t,o);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==typeof f&&n.call(f,"__await")?Promise.resolve(f.__await).then((function(t){e("next",t,i,a)}),(function(t){e("throw",t,i,a)})):Promise.resolve(f).then((function(t){c.value=t,i(c)}),(function(t){return e("throw",t,i,a)}))}a(u.arg)}(r,o,e,i)}))}return e=e?e.then(i,i):i()}}function O(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=s(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function _(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:S}}function S(){return{value:e,done:!0}}return d.prototype=x.constructor=m,m.constructor=d,m[u]=d.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u in t||(t[u]="GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},E(L.prototype),L.prototype[a]=function(){return this},t.AsyncIterator=L,t.async=function(e,r,n,o){var i=new L(c(e,r,n,o));return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},E(x),x[u]="Generator",x[i]=function(){return this},x.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);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:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!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 new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:_(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},lwsE:function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},o0o1:function(t,e,r){t.exports=r("ls82")},yXPU:function(t,e){function r(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function u(t){r(a,o,i,u,c,"next",t)}function c(t){r(a,o,i,u,c,"throw",t)}u(void 0)}))}}}}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@aofl/resource-enumerate", | ||
"version": "3.0.0-beta.28", | ||
"version": "3.0.0-beta.30", | ||
"description": "Resource enumerate is a special case API call that returns the interface of the API code in a single endpoint", | ||
@@ -33,7 +33,7 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@aofl/api-request": "^3.0.0-beta.28", | ||
"@aofl/cache-manager": "^3.0.0-beta.28", | ||
"@aofl/cli": "^3.0.0-beta.28", | ||
"@aofl/middleware": "^3.0.0-beta.28", | ||
"@aofl/server-environment": "^3.0.0-beta.28", | ||
"@aofl/api-request": "^3.0.0-beta.30", | ||
"@aofl/cache-manager": "^3.0.0-beta.30", | ||
"@aofl/cli": "^3.0.0-beta.30", | ||
"@aofl/middleware": "^3.0.0-beta.30", | ||
"@aofl/server-environment": "^3.0.0-beta.30", | ||
"cross-env": "^6.0.3", | ||
@@ -50,3 +50,3 @@ "jsdoc": "^3.6.3", | ||
}, | ||
"gitHead": "dbd14b0bd931ea76999d514d051dcd0a3ef6a8c0" | ||
"gitHead": "7bb6b9b6e2c1d77cf7e65680aeb6a4c60e0300f4" | ||
} |
Sorry, the diff of this file is not supported yet
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
45624
423
4