@hotmeshio/hotmesh
Version:
Serverless Workflow
1 lines • 3.59 kB
JavaScript
function b(c,d){var e=a();return b=function(f,g){f=f-0x1ec;var h=e[f];return h;},b(c,d);}var j=b;(function(c,d){var i=b,e=c();while(!![]){try{var f=-parseInt(i(0x200))/0x1+-parseInt(i(0x1f8))/0x2+parseInt(i(0x210))/0x3+parseInt(i(0x1ef))/0x4+-parseInt(i(0x1f6))/0x5+parseInt(i(0x1f1))/0x6*(-parseInt(i(0x1f4))/0x7)+parseInt(i(0x215))/0x8;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xed716));var __createBinding=this&&this[j(0x1fb)]||(Object[j(0x1ed)]?function(c,d,f,g){var k=j;void 0x0===g&&(g=f);var h=Object[k(0x21f)](d,f);h&&!(k(0x207)in h?!d[k(0x208)]:h[k(0x204)]||h[k(0x212)])||(h={'enumerable':!0x0,'get':function(){return d[f];}}),Object['defineProperty'](c,g,h);}:function(c,d,f,g){void 0x0===g&&(g=f),c[g]=d[f];}),__setModuleDefault=this&&this[j(0x222)]||(Object[j(0x1ed)]?function(c,d){var l=j;Object[l(0x213)](c,l(0x1f9),{'enumerable':!0x0,'value':d});}:function(c,d){var m=j;c[m(0x1f9)]=d;}),__importStar=this&&this[j(0x220)]||function(c){var n=j;if(c&&c[n(0x208)])return c;var d={};if(null!=c){for(var f in c)n(0x1f9)!==f&&Object[n(0x1ff)][n(0x1f5)][n(0x20b)](c,f)&&__createBinding(d,c,f);}return __setModuleDefault(d,c),d;},__importDefault=this&&this[j(0x21e)]||function(c){var o=j;return c&&c[o(0x208)]?c:{'default':c};};function a(){var v=['__esModule','.hotmesh.','js-yaml','call','store','deploy','Deployer','compiler-plan-error','3060102jVzrLz','dereference','configurable','defineProperty','stringify','26860760hbxvSl','Validator','startsWith','plan','error','utf8','app','version','CompilerService','__importDefault','getOwnPropertyDescriptor','__importStar','isPath','__setModuleDefault','activate','create','./deployer','7292508FOpsIL','trim','8256558LSJugk','fs/promises','logger','7msjkpu','hasOwnProperty','6786990vBYAey','writeFile','3070682mOpgRW','default','setApp','__createBinding','validate','stream','load','prototype','959358BnpoZR','compiler-deploy-error','activateAppVersion','@apidevtools/json-schema-ref-parser','writable','join','dirname','get'];a=function(){return v;};return a();}Object['defineProperty'](exports,j(0x208),{'value':!0x0}),exports[j(0x21d)]=void 0x0;const fs=__importStar(require(j(0x1f2))),path=__importStar(require('path')),json_schema_ref_parser_1=__importDefault(require(j(0x203))),js_yaml_1=__importDefault(require(j(0x20a))),deployer_1=require(j(0x1ee)),validator_1=require('./validator');class CompilerService{constructor(c,d,f){var p=j;this[p(0x20c)]=c,this[p(0x1fd)]=d,this[p(0x1f3)]=f;}async[j(0x218)](c){var q=j;try{let d;return d=this[q(0x221)](c)?await json_schema_ref_parser_1[q(0x1f9)][q(0x211)](c):js_yaml_1[q(0x1f9)][q(0x1fe)](c),(new validator_1[(q(0x216))](d)[q(0x1fc)](this['store']),d);}catch(f){this['logger'][q(0x219)](q(0x20f),f);}}['isPath'](c){var r=j;return!c[r(0x1f0)]()[r(0x217)]('app:');}async[j(0x20d)](c){var s=j;try{let d;this[s(0x221)](c)?(d=await json_schema_ref_parser_1['default'][s(0x211)](c),await this['saveAsJSON'](c,d)):d=js_yaml_1['default'][s(0x1fe)](c),new validator_1['Validator'](d)[s(0x1fc)](this[s(0x20c)]);const f=new deployer_1[(s(0x20e))](d);return await f[s(0x20d)](this[s(0x20c)],this[s(0x1fd)]),await this[s(0x20c)][s(0x1fa)](d[s(0x21b)]['id'],d[s(0x21b)][s(0x21c)]),d;}catch(g){this[s(0x1f3)]['error'](s(0x201),g);}}async[j(0x1ec)](c,d){var t=j;return await this[t(0x20c)][t(0x202)](c,d);}async['saveAsJSON'](c,d){var u=j;const f=JSON[u(0x214)](d,null,0x2),g=path[u(0x205)](path[u(0x206)](c),u(0x209)+d[u(0x21b)]['id']+'.'+d[u(0x21b)]['version']+'.json');await fs[u(0x1f7)](g,f,u(0x21a));}}exports[j(0x21d)]=CompilerService;
;