@hotmeshio/hotmesh
Version:
Serverless Workflow
1 lines • 7.62 kB
JavaScript
'use strict';const m=b;(function(c,d){const l=b,e=c();while(!![]){try{const f=parseInt(l(0xd4))/0x1*(parseInt(l(0x77))/0x2)+parseInt(l(0xd9))/0x3*(-parseInt(l(0xd0))/0x4)+-parseInt(l(0xac))/0x5*(parseInt(l(0x88))/0x6)+-parseInt(l(0xa2))/0x7*(-parseInt(l(0x74))/0x8)+parseInt(l(0x94))/0x9*(-parseInt(l(0xa8))/0xa)+-parseInt(l(0x95))/0xb*(-parseInt(l(0xb0))/0xc)+parseInt(l(0x9a))/0xd;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x9d868));Object[m(0x8a)](exports,m(0xd1),{'value':!0x0}),exports['Trigger']=void 0x0;function b(c,d){const e=a();return b=function(f,g){f=f-0x6b;let h=e[f];return h;},b(c,d);}const errors_1=require(m(0x93)),utils_1=require(m(0xb2)),collator_1=require(m(0x78)),pipe_1=require(m(0x72)),reporter_1=require(m(0xa1)),serializer_1=require(m(0x6f)),telemetry_1=require(m(0x75)),activity_1=require(m(0x90));class Trigger extends activity_1[m(0xcf)]{constructor(c,d,f,g,h,j){super(c,d,f,g,h,j);}async[m(0x80)](c){const n=m;let d;this['logger'][n(0xb7)](n(0x9c),{'subscribes':this['config']['subscribes']});try{this[n(0x6b)](0x2),await this[n(0x84)](),d=new telemetry_1[(n(0x7e))](this[n(0xd6)]['appId'],this[n(0xb9)],this[n(0x76)],this[n(0xc2)]),d[n(0xae)](),d[n(0x73)](this['leg']),this[n(0xca)](),this['adjacencyList']=await this[n(0x96)]();const f=this[n(0xd3)](c,this[n(0x8f)]['length']);await this['setStateNX'](f),await this[n(0xb6)](f),this[n(0xbf)](c),this[n(0x83)](c);const g=this[n(0x92)][n(0x79)]();await this[n(0xaa)](g),await this[n(0x89)](g),c?.[n(0x97)]&&await this[n(0xa3)](c?.[n(0x97)],g),await collator_1[n(0x7a)][n(0xc6)](this,this[n(0xc2)]['metadata'][n(0x8c)],g),await g[n(0xc0)](),this[n(0x9f)](),d[n(0xc3)]();const h=Number(this[n(0xc2)][n(0x76)]['js']);d[n(0xc1)]({'app.job.jss':h});const j={'app.job.jss':h};return await this['transitionAndLogAdjacent'](c,h,j),d[n(0x8e)](j),this[n(0xc2)][n(0x76)]['jid'];}catch(k){if(d?.[n(0xda)](k[n(0x81)]),k instanceof errors_1['DuplicateJobError']){await(0x0,utils_1[n(0x9d)])(0x3e8);if(await collator_1[n(0x7a)][n(0xcc)](this,this[n(0xc2)]['metadata']['guid']))return void this[n(0xd8)][n(0xba)](n(0x6c),{'job_id':k['jobId'],'guid':this[n(0xc2)]['metadata']['guid']});this[n(0xd8)][n(0xc5)](n(0xa5),{'job_id':k['jobId'],'guid':this[n(0xc2)]['metadata'][n(0x8c)]});}else this[n(0xd8)][n(0xc5)](n(0xcb),{'error':k});throw k;}finally{d?.[n(0x82)](),d?.[n(0xd7)](),this[n(0xd8)][n(0xb7)]('trigger-process-end',{'subscribes':this[n(0xb9)][n(0x86)],'jid':this[n(0xc2)][n(0x76)][n(0xb4)],'gid':this['context'][n(0x76)][n(0xb5)]});}}async['transitionAndLogAdjacent'](c={},d,f){const o=m;if(isNaN(c['pending'])){const g=await this[o(0x87)](this[o(0x8f)],d);g['length']&&(f['app.activity.mids']=g[o(0xb8)](','));}}[m(0xd3)](c={},d){const p=m;return c[p(0x97)]?-0x1:d;}async[m(0xa3)](c,d){const q=m;await this['store'][q(0xbc)](this[q(0xc2)][q(0x76)][q(0xb4)],c,d);}['safeKey'](c){return'_'+c;}[m(0xbf)](c){const r=m;c?.[r(0x6d)]&&Object[r(0xab)](c['search'])[r(0xbe)](d=>{const s=r;this[s(0xc2)][s(0xbb)][this[s(0xc4)](d)]=c[s(0x6d)][d][s(0x7d)]();});}[m(0x83)](c){const t=m;c?.[t(0xa0)]&&Object[t(0xab)](c[t(0xa0)])[t(0xbe)](d=>{const u=t;d['startsWith']('-')&&(this[u(0xc2)][u(0xbb)][d]=c[u(0xa0)][d][u(0x7d)]());});}async['setStatus'](c){const v=m;this[v(0xc2)][v(0x76)]['js']=c;}async[m(0x9f)](){const w=m;if(this[w(0xc2)][w(0x76)]['px']){const c=(0x0,utils_1[w(0x6e)])(new Date()),d={'metadata':this['context'][w(0x76)],'data':{'job_id':this['context'][w(0x76)][w(0xb4)],'jc':c,'ju':c}};await this[w(0xd6)][w(0x9f)](this['context'],d);}}[m(0xdb)](){const x=m;return{[this[x(0x76)][x(0xaf)]]:{'input':{'data':this['data']}},'$self':{'input':{'data':this[x(0xbb)]},'output':{'data':this['data']}}};}async['getState'](){const y=m,c=this[y(0xdb)](),d=this[y(0x9e)](c),f=this[y(0xb1)](c),g=(0x0,utils_1[y(0x6e)])(new Date()),{id:h,version:j}=await this['engine'][y(0xa7)]();this[y(0xa6)](collator_1['CollatorService'][y(0xbd)]());const k={...this[y(0x76)],'jid':d,'key':f,'as':collator_1[y(0x7a)][y(0xa9)]()};this['context']={'metadata':{...this[y(0x76)],'gid':(0x0,utils_1[y(0x8c)])(),'ngn':this[y(0xc2)][y(0x76)][y(0x7c)],'pj':this[y(0xc2)][y(0x76)]['pj'],'pg':this[y(0xc2)]['metadata']['pg'],'pd':this[y(0xc2)]['metadata']['pd'],'pa':this['context'][y(0x76)]['pa'],'px':this[y(0xc2)][y(0x76)]['px'],'app':h,'vrs':j,'tpc':this[y(0xb9)][y(0x86)],'trc':this['context'][y(0x76)][y(0xc8)],'spn':this[y(0xc2)][y(0x76)][y(0x99)],'guid':this[y(0xc2)][y(0x76)][y(0x8c)],'jid':d,'dad':collator_1['CollatorService']['getDimensionalSeed'](),'key':f,'jc':g,'ju':g,'ts':(0x0,utils_1[y(0x9b)])(this[y(0x85)]()),'js':0x0},'data':{},[this[y(0x76)][y(0xaf)]]:{'input':{'data':this['data'],'metadata':k},'output':{'data':this[y(0xbb)],'metadata':k},'settings':{'data':{}},'errors':{'data':{}}}},this[y(0xc2)][y(0xc7)]=this[y(0xc2)][this[y(0x76)][y(0xaf)]],this[y(0xc2)]['$job']=this[y(0xc2)];}['bindJobMetadataPaths'](){const z=m;return serializer_1['MDATA_SYMBOLS'][z(0x91)]['KEYS'][z(0x7f)](c=>'metadata/'+c);}['bindActivityMetadataPaths'](){const A=m;return serializer_1[A(0xd2)]['ACTIVITY']['KEYS'][A(0x7f)](c=>A(0x98)+c);}[m(0x85)](){const B=m;return this['config'][B(0xb3)]?.[B(0xce)]||reporter_1[B(0x8b)][B(0x70)];}[m(0x71)](){const C=m;return this['context'][C(0x76)]['js'];}['resolveJobId'](c){const D=m,d=this['config'][D(0xb3)]?.['id'];return d?pipe_1[D(0xd5)][D(0xcd)](d,c):(0x0,utils_1['guid'])();}[m(0xb1)](c){const E=m,d=this['config']['stats']?.[E(0xad)];return d?pipe_1[E(0xd5)]['resolve'](d,c):'';}async['setStateNX'](c){const F=m,d=this[F(0xc2)]['metadata'][F(0xb4)];if(!await this['store'][F(0xa4)](d,this['engine'][F(0xc9)],c))throw new errors_1[(F(0x8d))](d);}async['setStats'](c){const G=m,d=this[G(0xc2)]['metadata'];if(d[G(0xad)]&&this[G(0xb9)][G(0xb3)]?.[G(0x7b)]){const f=await this[G(0xd6)]['getVID'](),g=new reporter_1[(G(0x8b))](f,this[G(0x92)],this[G(0xd8)]);await this['store'][G(0x89)](d[G(0xad)],d[G(0xb4)],d['ts'],g['resolveTriggerStatistics'](this['config'],this['context']),f,c);}}}function a(){const H=['setState','keys','64810XNSlgW','key','startJobSpan','aid','1855752DuwOrm','resolveJobKey','../../modules/utils','stats','jid','gid','setStatus','debug','join','config','info','data','expireJob','getDimensionalSeed','forEach','bindSearchData','exec','setJobAttributes','context','mapActivityAttributes','safeKey','error','notarizeInception','$self','trc','appId','mapJobData','trigger-process-error','isInceptionOverage','resolve','granularity','Activity','14172SdGMIc','__esModule','MDATA_SYMBOLS','initStatus','269POoqvK','Pipe','engine','endActivitySpan','logger','906DMKFAt','setActivityError','createInputContext','setLeg','trigger-collation-overage','search','formatISODate','../serializer','DEFAULT_GRANULARITY','getJobStatus','../pipe','startActivitySpan','8bdEjke','../telemetry','metadata','4586WGWaVF','../collator','transact','CollatorService','measures','ngn','toString','TelemetryService','map','process','message','endJobSpan','bindMarkerData','getState','resolveGranularity','subscribes','transition','510cQaYPZ','setStats','defineProperty','ReporterService','guid','DuplicateJobError','setActivityAttributes','adjacencyList','./activity','JOB','store','../../modules/errors','9sHaNYq','33pYdCQz','filterAdjacent','pending','output/metadata/','spn','19860828RCSsAu','getTimeSeries','trigger-process','sleepFor','resolveJobId','execAdjacentParent','marker','../reporter','5526570nPSHee','setExpired','setStateNX','duplicate-job-error','initDimensionalAddress','getVID','5810410NUgkVA','getTriggerSeed'];a=function(){return H;};return a();}exports['Trigger']=Trigger;