@hotmeshio/hotmesh 0.3.29 → 0.3.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.ts +8 -2
- package/build/index.js +13 -7
- package/build/modules/enums.d.ts +65 -1
- package/build/modules/enums.js +79 -5
- package/build/modules/key.d.ts +52 -0
- package/build/modules/key.js +1 -1
- package/build/modules/utils.d.ts +73 -0
- package/build/modules/utils.js +1 -1
- package/build/package.json +6 -4
- package/build/services/activities/activity.d.ts +36 -0
- package/build/services/activities/activity.js +1 -1
- package/build/services/activities/await.js +1 -1
- package/build/services/activities/cycle.d.ts +7 -0
- package/build/services/activities/cycle.js +1 -1
- package/build/services/activities/hook.d.ts +6 -0
- package/build/services/activities/hook.js +1 -1
- package/build/services/activities/index.js +1 -1
- package/build/services/activities/interrupt.js +1 -1
- package/build/services/activities/signal.d.ts +6 -0
- package/build/services/activities/signal.js +1 -1
- package/build/services/activities/trigger.d.ts +7 -0
- package/build/services/activities/trigger.js +1 -1
- package/build/services/activities/worker.js +1 -1
- package/build/services/collator/index.d.ts +76 -0
- package/build/services/collator/index.js +1 -1
- package/build/services/compiler/deployer.js +1 -1
- package/build/services/compiler/index.d.ts +15 -0
- package/build/services/compiler/index.js +1 -1
- package/build/services/compiler/validator.d.ts +3 -0
- package/build/services/compiler/validator.js +1 -1
- package/build/services/connector/factory.d.ts +14 -0
- package/build/services/connector/factory.js +22 -2
- package/build/services/connector/index.d.ts +13 -1
- package/build/services/connector/index.js +13 -1
- package/build/services/connector/providers/postgres.js +7 -0
- package/build/services/engine/index.d.ts +162 -0
- package/build/services/engine/index.js +1 -1
- package/build/services/exporter/index.d.ts +27 -0
- package/build/services/exporter/index.js +1 -1
- package/build/services/hotmesh/index.d.ts +280 -0
- package/build/services/hotmesh/index.js +286 -0
- package/build/services/logger/index.js +1 -0
- package/build/services/mapper/index.d.ts +14 -0
- package/build/services/mapper/index.js +1 -1
- package/build/services/meshcall/index.d.ts +171 -0
- package/build/services/meshcall/index.js +190 -0
- package/build/services/meshcall/schemas/factory.d.ts +7 -0
- package/build/services/meshcall/schemas/factory.js +7 -0
- package/build/services/meshdata/index.d.ts +725 -3
- package/build/services/meshdata/index.js +689 -3
- package/build/services/meshflow/client.d.ts +89 -0
- package/build/services/meshflow/client.js +173 -4
- package/build/services/meshflow/connection.d.ts +17 -0
- package/build/services/meshflow/connection.js +17 -0
- package/build/services/meshflow/exporter.d.ts +22 -0
- package/build/services/meshflow/exporter.js +1 -1
- package/build/services/meshflow/handle.d.ts +68 -0
- package/build/services/meshflow/handle.js +75 -0
- package/build/services/meshflow/index.d.ts +92 -0
- package/build/services/meshflow/index.js +92 -0
- package/build/services/meshflow/schemas/factory.d.ts +25 -0
- package/build/services/meshflow/schemas/factory.js +26 -1
- package/build/services/meshflow/search.d.ts +120 -0
- package/build/services/meshflow/search.js +108 -0
- package/build/services/meshflow/worker.d.ts +97 -0
- package/build/services/meshflow/worker.js +116 -2
- package/build/services/meshflow/workflow/all.d.ts +6 -0
- package/build/services/meshflow/workflow/all.js +7 -0
- package/build/services/meshflow/workflow/context.d.ts +4 -0
- package/build/services/meshflow/workflow/context.js +4 -0
- package/build/services/meshflow/workflow/didRun.d.ts +6 -0
- package/build/services/meshflow/workflow/didRun.js +6 -0
- package/build/services/meshflow/workflow/emit.d.ts +7 -0
- package/build/services/meshflow/workflow/emit.js +7 -0
- package/build/services/meshflow/workflow/enrich.d.ts +7 -0
- package/build/services/meshflow/workflow/enrich.js +7 -0
- package/build/services/meshflow/workflow/execChild.d.ts +14 -0
- package/build/services/meshflow/workflow/execChild.js +18 -0
- package/build/services/meshflow/workflow/hook.d.ts +7 -0
- package/build/services/meshflow/workflow/hook.js +7 -0
- package/build/services/meshflow/workflow/index.d.ts +31 -0
- package/build/services/meshflow/workflow/index.js +31 -0
- package/build/services/meshflow/workflow/interrupt.d.ts +7 -0
- package/build/services/meshflow/workflow/interrupt.js +7 -0
- package/build/services/meshflow/workflow/isSideEffectAllowed.d.ts +8 -0
- package/build/services/meshflow/workflow/isSideEffectAllowed.js +8 -0
- package/build/services/meshflow/workflow/proxyActivities.d.ts +14 -0
- package/build/services/meshflow/workflow/proxyActivities.js +18 -3
- package/build/services/meshflow/workflow/random.d.ts +5 -0
- package/build/services/meshflow/workflow/random.js +5 -0
- package/build/services/meshflow/workflow/searchMethods.d.ts +4 -0
- package/build/services/meshflow/workflow/searchMethods.js +4 -0
- package/build/services/meshflow/workflow/signal.d.ts +6 -0
- package/build/services/meshflow/workflow/signal.js +6 -0
- package/build/services/meshflow/workflow/sleepFor.d.ts +7 -0
- package/build/services/meshflow/workflow/sleepFor.js +7 -0
- package/build/services/meshflow/workflow/trace.d.ts +10 -0
- package/build/services/meshflow/workflow/trace.js +10 -0
- package/build/services/meshflow/workflow/waitFor.d.ts +7 -0
- package/build/services/meshflow/workflow/waitFor.js +7 -0
- package/build/services/meshos/index.d.ts +213 -2
- package/build/services/meshos/index.js +221 -1
- package/build/services/pipe/functions/array.js +1 -1
- package/build/services/pipe/functions/bitwise.js +1 -1
- package/build/services/pipe/functions/conditional.js +1 -1
- package/build/services/pipe/functions/cron.d.ts +6 -0
- package/build/services/pipe/functions/cron.js +1 -1
- package/build/services/pipe/functions/date.d.ts +7 -0
- package/build/services/pipe/functions/date.js +1 -1
- package/build/services/pipe/functions/index.js +1 -1
- package/build/services/pipe/functions/json.js +1 -1
- package/build/services/pipe/functions/logical.js +1 -1
- package/build/services/pipe/functions/math.js +1 -1
- package/build/services/pipe/functions/number.js +1 -1
- package/build/services/pipe/functions/object.js +1 -1
- package/build/services/pipe/functions/string.js +1 -1
- package/build/services/pipe/functions/symbol.js +1 -1
- package/build/services/pipe/functions/unary.js +1 -1
- package/build/services/pipe/index.d.ts +15 -0
- package/build/services/pipe/index.js +1 -1
- package/build/services/quorum/index.d.ts +49 -0
- package/build/services/quorum/index.js +1 -1
- package/build/services/reporter/index.d.ts +5 -0
- package/build/services/reporter/index.js +1 -1
- package/build/services/router/index.d.ts +10 -0
- package/build/services/router/index.js +1 -1
- package/build/services/search/providers/postgres/postgres.d.ts +3 -0
- package/build/services/search/providers/postgres/postgres.js +1 -1
- package/build/services/search/providers/redis/ioredis.js +1 -1
- package/build/services/search/providers/redis/redis.js +1 -1
- package/build/services/serializer/index.js +1 -1
- package/build/services/store/cache.d.ts +19 -0
- package/build/services/store/cache.js +19 -0
- package/build/services/store/factory.js +1 -1
- package/build/services/store/providers/postgres/kvsql.d.ts +7 -0
- package/build/services/store/providers/postgres/kvsql.js +1 -1
- package/build/services/store/providers/postgres/kvtables.d.ts +4 -0
- package/build/services/store/providers/postgres/kvtables.js +1 -1
- package/build/services/store/providers/postgres/kvtransaction.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/hash.d.ts +4 -0
- package/build/services/store/providers/postgres/kvtypes/hash.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/list.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/string.js +1 -1
- package/build/services/store/providers/postgres/kvtypes/zset.js +1 -1
- package/build/services/store/providers/postgres/postgres.d.ts +48 -1
- package/build/services/store/providers/postgres/postgres.js +1 -1
- package/build/services/store/providers/redis/_base.d.ts +42 -0
- package/build/services/store/providers/redis/_base.js +1 -1
- package/build/services/store/providers/redis/ioredis.d.ts +8 -0
- package/build/services/store/providers/redis/ioredis.js +1 -1
- package/build/services/store/providers/redis/redis.d.ts +6 -0
- package/build/services/store/providers/redis/redis.js +1 -1
- package/build/services/store/providers/store-initializable.js +1 -1
- package/build/services/stream/factory.js +2 -1
- package/build/services/stream/index.d.ts +4 -0
- package/build/services/stream/providers/nats/nats.js +1 -1
- package/build/services/stream/providers/postgres/kvtables.js +1 -1
- package/build/services/stream/providers/postgres/postgres.d.ts +21 -0
- package/build/services/stream/providers/postgres/postgres.js +1 -1
- package/build/services/stream/providers/redis/ioredis.js +1 -1
- package/build/services/stream/providers/redis/redis.js +1 -1
- package/build/services/stream/providers/stream-initializable.js +1 -1
- package/build/services/sub/providers/nats/nats.js +1 -1
- package/build/services/sub/providers/postgres/postgres.js +1 -1
- package/build/services/sub/providers/redis/ioredis.js +1 -1
- package/build/services/sub/providers/redis/redis.js +1 -1
- package/build/services/task/index.d.ts +9 -0
- package/build/services/task/index.js +1 -1
- package/build/services/telemetry/index.d.ts +7 -0
- package/build/services/telemetry/index.js +1 -1
- package/build/services/worker/index.d.ts +37 -0
- package/build/services/worker/index.js +1 -1
- package/build/types/activity.d.ts +81 -0
- package/build/types/exporter.d.ts +13 -0
- package/build/types/hotmesh.d.ts +144 -0
- package/build/types/hotmesh.js +3 -0
- package/build/types/job.d.ts +101 -0
- package/build/types/manifest.d.ts +8 -0
- package/build/types/meshcall.d.ts +148 -0
- package/build/types/meshdata.d.ts +193 -0
- package/build/types/meshflow.d.ts +297 -0
- package/build/types/nats.d.ts +55 -0
- package/build/types/pipe.d.ts +65 -0
- package/build/types/provider.d.ts +43 -0
- package/build/types/quorum.d.ts +12 -0
- package/build/types/redis.d.ts +6 -0
- package/build/types/stream.d.ts +65 -0
- package/build/types/stream.js +4 -0
- package/index.ts +8 -1
- package/package.json +6 -4
- package/types/manifest.ts +2 -2
- package/types/meshcall.ts +1 -2
- package/types/meshdata.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const m=b;function b(c,d){const e=a();return b=function(f,g){f=f-0x1ed;let h=e[f];return h;},b(c,d);}(function(c,d){const l=b,e=c();while(!![]){try{const f=parseInt(l(0x1fd))/0x1+-parseInt(l(0x1f4))/0x2*(-parseInt(l(0x200))/0x3)+parseInt(l(0x21a))/0x4*(parseInt(l(0x245))/0x5)+-parseInt(l(0x233))/0x6*(parseInt(l(0x21d))/0x7)+-parseInt(l(0x211))/0x8+parseInt(l(0x21e))/0x9*(-parseInt(l(0x206))/0xa)+-parseInt(l(0x24d))/0xb;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xe9af4));Object[m(0x1f5)](exports,'__esModule',{'value':!0x0}),exports[m(0x224)]=void 0x0;const errors_1=require(m(0x1f0)),utils_1=require(m(0x210)),collator_1=require(m(0x1fc)),pipe_1=require(m(0x1fb)),reporter_1=require('../reporter'),serializer_1=require(m(0x212)),telemetry_1=require('../telemetry'),activity_1=require(m(0x237));function a(){const H=['forEach','debug','info','filterAdjacent','transitionAndLogAdjacent','41165RwvMlc','context','subscribes','createInputContext','trigger-process','appId','process','setStats','17151706KMxcwy','metadata','search','resolveJobId','jobId','duplicate-job-error','$job','TelemetryService','guid','map','../../modules/errors','logger','JOB','setState','3498300NWUGQV','defineProperty','join','CollatorService','getTimeSeries','Pipe','endActivitySpan','../pipe','../collator','776604NJQaYh','setExpired','measures','3oaTred','bindSearchData','setStatus','ReporterService','safeKey','metadata/','411310ByhJKu','resolveGranularity','Activity','key','transact','bindMarkerData','resolveTriggerStatistics','gid','adjacencyList','setJobAttributes','../../modules/utils','6544248SdIUSa','../serializer','getJobStatus','initDimensionalAddress','transition','keys','config','endJobSpan','data','876buaSgK','trigger-process-error','setActivityError','4944905pxvuDN','63BXxVTO','getDimensionalSeed','message','setStateNX','DuplicateJobError','notarizeInception','Trigger','getVID','trc','marker','toString','pending','resolve','formatISODate','store','engine','app.activity.mids','jid','setLeg','stats','aid','6SPcSfp','resolveJobKey','error','length','./activity','mapActivityAttributes','execAdjacentParent','KEYS','exec','initStatus','getTriggerSeed','setActivityAttributes','output/metadata/'];a=function(){return H;};return a();}class Trigger extends activity_1[m(0x208)]{constructor(c,d,f,g,h,j){super(c,d,f,g,h,j);}async[m(0x24b)](c){const n=m;let d;this['logger'][n(0x241)](n(0x249),{'subscribes':this[n(0x217)][n(0x247)]});try{this[n(0x230)](0x2),await this['getState'](),d=new telemetry_1[(n(0x1ed))](this[n(0x22d)]['appId'],this[n(0x217)],this[n(0x24e)],this[n(0x246)]),d['startJobSpan'](),d['startActivitySpan'](this['leg']),this['mapJobData'](),this[n(0x20e)]=await this[n(0x243)]();const f=this['initStatus'](c,this[n(0x20e)]['length']);await this[n(0x221)](f),await this[n(0x202)](f),this[n(0x201)](c),this[n(0x20b)](c);const g=this[n(0x22c)][n(0x20a)]();await this[n(0x1f3)](g),await this['setStats'](g),c?.[n(0x229)]&&await this[n(0x1fe)](c?.[n(0x229)],g),await collator_1[n(0x1f7)][n(0x223)](this,this[n(0x246)]['metadata']['guid'],g),await g[n(0x23b)](),this['execAdjacentParent'](),d[n(0x238)]();const h=Number(this[n(0x246)][n(0x24e)]['js']);d[n(0x20f)]({'app.job.jss':h});const j={'app.job.jss':h};return await this[n(0x244)](c,h,j),d[n(0x23e)](j),this['context'][n(0x24e)][n(0x22f)];}catch(k){if(d?.[n(0x21c)](k[n(0x220)]),k instanceof errors_1[n(0x222)]){await(0x0,utils_1['sleepFor'])(0x3e8);if(await collator_1['CollatorService']['isInceptionOverage'](this,this['context'][n(0x24e)][n(0x1ee)]))return void this[n(0x1f1)][n(0x242)]('trigger-collation-overage',{'job_id':k[n(0x251)],'guid':this[n(0x246)][n(0x24e)][n(0x1ee)]});this[n(0x1f1)][n(0x235)](n(0x252),{'job_id':k['jobId'],'guid':this[n(0x246)][n(0x24e)]['guid']});}else this[n(0x1f1)][n(0x235)](n(0x21b),{'error':k});throw k;}finally{d?.[n(0x218)](),d?.[n(0x1fa)](),this[n(0x1f1)][n(0x241)]('trigger-process-end',{'subscribes':this[n(0x217)][n(0x247)],'jid':this[n(0x246)][n(0x24e)][n(0x22f)],'gid':this['context'][n(0x24e)][n(0x20d)]});}}async[m(0x244)](c={},d,f){const o=m;if(isNaN(c[o(0x229)])){const g=await this[o(0x215)](this[o(0x20e)],d);g[o(0x236)]&&(f[o(0x22e)]=g[o(0x1f6)](','));}}[m(0x23c)](c={},d){const p=m;return c[p(0x229)]?-0x1:d;}async[m(0x1fe)](c,d){const q=m;await this['store']['expireJob'](this['context'][q(0x24e)][q(0x22f)],c,d);}[m(0x204)](c){return'_'+c;}[m(0x201)](c){const r=m;c?.[r(0x24f)]&&Object['keys'](c[r(0x24f)])[r(0x240)](d=>{const s=r;this['context'][s(0x219)][this[s(0x204)](d)]=c[s(0x24f)][d][s(0x228)]();});}[m(0x20b)](c){const t=m;c?.['marker']&&Object[t(0x216)](c[t(0x227)])[t(0x240)](d=>{const u=t;d['startsWith']('-')&&(this[u(0x246)][u(0x219)][d]=c[u(0x227)][d]['toString']());});}async[m(0x202)](c){const v=m;this[v(0x246)][v(0x24e)]['js']=c;}async[m(0x239)](){const w=m;if(this['context'][w(0x24e)]['px']){const c=(0x0,utils_1[w(0x22b)])(new Date()),d={'metadata':this[w(0x246)][w(0x24e)],'data':{'job_id':this[w(0x246)][w(0x24e)][w(0x22f)],'jc':c,'ju':c}};await this[w(0x22d)][w(0x239)](this['context'],d);}}[m(0x248)](){const x=m;return{[this[x(0x24e)][x(0x232)]]:{'input':{'data':this[x(0x219)]}},'$self':{'input':{'data':this[x(0x219)]},'output':{'data':this[x(0x219)]}}};}async['getState'](){const y=m,c=this[y(0x248)](),d=this[y(0x250)](c),f=this[y(0x234)](c),g=(0x0,utils_1[y(0x22b)])(new Date()),{id:h,version:j}=await this[y(0x22d)]['getVID']();this[y(0x214)](collator_1['CollatorService'][y(0x21f)]());const k={...this[y(0x24e)],'jid':d,'key':f,'as':collator_1[y(0x1f7)][y(0x23d)]()};this[y(0x246)]={'metadata':{...this[y(0x24e)],'gid':(0x0,utils_1[y(0x1ee)])(),'ngn':this['context'][y(0x24e)]['ngn'],'pj':this[y(0x246)][y(0x24e)]['pj'],'pg':this[y(0x246)][y(0x24e)]['pg'],'pd':this[y(0x246)][y(0x24e)]['pd'],'pa':this[y(0x246)][y(0x24e)]['pa'],'px':this[y(0x246)]['metadata']['px'],'app':h,'vrs':j,'tpc':this[y(0x217)][y(0x247)],'trc':this[y(0x246)]['metadata'][y(0x226)],'spn':this[y(0x246)]['metadata']['spn'],'guid':this[y(0x246)][y(0x24e)][y(0x1ee)],'jid':d,'dad':collator_1[y(0x1f7)][y(0x21f)](),'key':f,'jc':g,'ju':g,'ts':(0x0,utils_1[y(0x1f8)])(this[y(0x207)]()),'js':0x0},'data':{},[this[y(0x24e)][y(0x232)]]:{'input':{'data':this[y(0x219)],'metadata':k},'output':{'data':this[y(0x219)],'metadata':k},'settings':{'data':{}},'errors':{'data':{}}}},this[y(0x246)]['$self']=this[y(0x246)][this[y(0x24e)][y(0x232)]],this[y(0x246)][y(0x253)]=this[y(0x246)];}['bindJobMetadataPaths'](){const z=m;return serializer_1['MDATA_SYMBOLS'][z(0x1f2)]['KEYS'][z(0x1ef)](c=>z(0x205)+c);}['bindActivityMetadataPaths'](){const A=m;return serializer_1['MDATA_SYMBOLS']['ACTIVITY'][A(0x23a)][A(0x1ef)](c=>A(0x23f)+c);}[m(0x207)](){const B=m;return this[B(0x217)][B(0x231)]?.['granularity']||reporter_1['ReporterService']['DEFAULT_GRANULARITY'];}[m(0x213)](){const C=m;return this[C(0x246)][C(0x24e)]['js'];}[m(0x250)](c){const D=m,d=this['config']['stats']?.['id'];return d?pipe_1[D(0x1f9)][D(0x22a)](d,c):(0x0,utils_1['guid'])();}[m(0x234)](c){const E=m,d=this['config'][E(0x231)]?.[E(0x209)];return d?pipe_1[E(0x1f9)]['resolve'](d,c):'';}async[m(0x221)](c){const F=m,d=this[F(0x246)][F(0x24e)][F(0x22f)];if(!await this[F(0x22c)]['setStateNX'](d,this['engine'][F(0x24a)],c))throw new errors_1[(F(0x222))](d);}async['setStats'](c){const G=m,d=this[G(0x246)]['metadata'];if(d[G(0x209)]&&this[G(0x217)][G(0x231)]?.[G(0x1ff)]){const f=await this['engine'][G(0x225)](),g=new reporter_1[(G(0x203))](f,this[G(0x22c)],this[G(0x1f1)]);await this[G(0x22c)][G(0x24c)](d['key'],d[G(0x22f)],d['ts'],g[G(0x20c)](this['config'],this[G(0x246)]),f,c);}}}exports['Trigger']=Trigger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const l=b;function b(c,d){const e=a();return b=function(f,g){f=f-0x8a;let h=e[f];return h;},b(c,d);}(function(c,d){const k=b,e=c();while(!![]){try{const f=-parseInt(k(0xbd))/0x1*(-parseInt(k(0xc1))/0x2)+parseInt(k(0xb2))/0x3*(parseInt(k(0x9d))/0x4)+-parseInt(k(0x9c))/0x5+-parseInt(k(0xaa))/0x6+-parseInt(k(0xa8))/0x7*(parseInt(k(0xb7))/0x8)+-parseInt(k(0x8e))/0x9+parseInt(k(0xbc))/0xa*(parseInt(k(0xc4))/0xb);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x3c8eb));function a(){const o=['worker-get-state-error','startActivitySpan','process-event-generational-job-error','CollatorService','authorizeReentry','setState','setActivityAttributes','../../modules/errors','3833352uqxNAF','data','../../modules/utils','store','verifyEntry','context','worker-collation-error','./activity','config','worker-process-error','CollationError','guid','mapActivityAttributes','defineProperty','930070bsLPXu','27056MbnDXo','error','appId','dad','publishMessage','resolveStatus','aid','logger','worker-process','metadata','retry','1981JSQkkm','leg','2090922deOJIz','info','gid','GenerationalError','engine','jid','await-inactive-job-error','execActivity','213frZlXk','debug','InactiveJobError','worker-collation-overage','../pipe','8648okTWAO','transact','subtype','setActivityError','endActivitySpan','194620SRGDMl','255671mwWblF','../telemetry','message','Pipe','2EXDKTK','duplicate','process','440IPyAWq','TelemetryService','setStatus','../collator','GetStateError','$self'];a=function(){return o;};return a();}Object[l(0x9b)](exports,'__esModule',{'value':!0x0}),exports['Worker']=void 0x0;const errors_1=require(l(0x8d)),utils_1=require(l(0x90)),collator_1=require(l(0xc7)),pipe_1=require(l(0xb6)),telemetry_1=require(l(0xbe)),activity_1=require(l(0x95));class Worker extends activity_1['Activity']{constructor(c,d,f,g,h,j){super(c,d,f,g,h,j);}async[l(0xc3)](){const m=l;let c;this[m(0xa4)][m(0xb3)](m(0xa5),{'jid':this[m(0x93)][m(0xa6)][m(0xaf)],'gid':this['context'][m(0xa6)][m(0xac)],'aid':this[m(0xa6)][m(0xa3)]});try{await this[m(0x92)](),c=new telemetry_1[(m(0xc5))](this[m(0xae)][m(0x9f)],this[m(0x96)],this[m(0xa6)],this[m(0x93)]),c[m(0xcb)](this[m(0xa9)]),this['mapInputData']();const d=this[m(0x91)][m(0xb8)](),f=await this[m(0xb1)](d);await collator_1[m(0xcd)][m(0x8a)](this,d),await this[m(0x8b)](d),await this[m(0xc6)](0x0,d);const g=await d['exec']();c[m(0x9a)]();const h=this[m(0xa2)](g);return c[m(0x8c)]({'app.activity.mid':f,'app.job.jss':h}),this['context'][m(0xa6)][m(0xa3)];}catch(j){if(j instanceof errors_1[m(0xb4)])return void this[m(0xa4)][m(0x9e)](m(0xb0),{'error':j});if(j instanceof errors_1[m(0xad)])return void this[m(0xa4)][m(0xab)](m(0xcc),{'error':j});if(j instanceof errors_1[m(0xc8)])return void this[m(0xa4)]['error'](m(0xca),{'error':j});if(j instanceof errors_1[m(0x98)]){if(m(0xc2)===j['fault'])return void this[m(0xa4)][m(0xab)](m(0xb5),{'job_id':this[m(0x93)][m(0xa6)]['jid'],'guid':this['context'][m(0xa6)][m(0x99)]});this['logger'][m(0x9e)](m(0x94),{'error':j});}else this[m(0xa4)][m(0x9e)](m(0x97),{'error':j});throw c?.[m(0xba)](j[m(0xbf)]),j;}finally{c?.[m(0xbb)](),this[m(0xa4)]['debug']('worker-process-end',{'jid':this[m(0x93)][m(0xa6)][m(0xaf)],'gid':this[m(0x93)][m(0xa6)][m(0xac)],'aid':this[m(0xa6)]['aid']});}}async[l(0xb1)](c){const n=l,d=pipe_1[n(0xc0)]['resolve'](this[n(0x96)][n(0xb9)],this['context']),f={'metadata':{'guid':(0x0,utils_1[n(0x99)])(),'jid':this[n(0x93)][n(0xa6)][n(0xaf)],'gid':this[n(0x93)][n(0xa6)][n(0xac)],'dad':this[n(0xa6)][n(0xa0)],'aid':this[n(0xa6)][n(0xa3)],'topic':d,'spn':this[n(0x93)][n(0xc9)]['output'][n(0xa6)]['l1s'],'trc':this['context']['metadata']['trc']},'data':this['context'][n(0x8f)]};return this[n(0x96)][n(0xa7)]&&(f['policies']={'retry':this[n(0x96)][n(0xa7)]}),await this[n(0xae)]['router']?.[n(0xa1)](d,f,c);}}exports['Worker']=Worker;
|
|
@@ -6,15 +6,48 @@ import { Activity } from '../activities/activity';
|
|
|
6
6
|
import { Cycle } from '../activities/cycle';
|
|
7
7
|
declare class CollatorService {
|
|
8
8
|
static targetLength: number;
|
|
9
|
+
/**
|
|
10
|
+
* Upon re/entry, verify that the job status is active
|
|
11
|
+
*/
|
|
9
12
|
static assertJobActive(status: number, jobId: string, activityId: string, threshold?: number): void;
|
|
13
|
+
/**
|
|
14
|
+
* returns the dimensional address (dad) for the target; due
|
|
15
|
+
* to the nature of the notary system, the dad for leg 2 entry
|
|
16
|
+
* must target the `0` index while leg 2 exit must target the
|
|
17
|
+
* current index (0)
|
|
18
|
+
*/
|
|
10
19
|
static getDimensionalAddress(activity: Activity, isEntry?: boolean): Record<string, string>;
|
|
20
|
+
/**
|
|
21
|
+
* resolves the dimensional address for the
|
|
22
|
+
* ancestor in the graph to go back to. this address
|
|
23
|
+
* is determined by trimming the last digits from
|
|
24
|
+
* the `dad` (including the target).
|
|
25
|
+
* the target activity index is then set to `0`, so that
|
|
26
|
+
* the origin node can be queried for approval/entry.
|
|
27
|
+
*/
|
|
11
28
|
static resolveReentryDimension(activity: Cycle): string;
|
|
12
29
|
static notarizeEntry(activity: Activity, transaction?: ProviderTransaction): Promise<number>;
|
|
13
30
|
static authorizeReentry(activity: Activity, transaction?: ProviderTransaction): Promise<number>;
|
|
14
31
|
static notarizeEarlyExit(activity: Activity, transaction?: ProviderTransaction): Promise<number>;
|
|
15
32
|
static notarizeEarlyCompletion(activity: Activity, transaction?: ProviderTransaction): Promise<number>;
|
|
33
|
+
/**
|
|
34
|
+
* sets the synthetic inception key (in case of an overage occurs).
|
|
35
|
+
*/
|
|
16
36
|
static notarizeInception(activity: Activity, guid: string, transaction: ProviderTransaction): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* ignore those ID collisions that are due to re-entry overages
|
|
39
|
+
*/
|
|
17
40
|
static isInceptionOverage(activity: Activity, guid: string): Promise<boolean>;
|
|
41
|
+
/**
|
|
42
|
+
* verifies both the concrete and synthetic keys for the activity; concrete keys
|
|
43
|
+
* exist in the original model and are effectively the 'real' keys. In reality,
|
|
44
|
+
* hook activities are atomized during compilation to create a synthetic DAG that
|
|
45
|
+
* is used to track the status of the graph in a distributed environment. The
|
|
46
|
+
* synthetic key represents different dimensional realities and is used to
|
|
47
|
+
* track re-entry overages (it distinguishes between the original and re-entry).
|
|
48
|
+
* The essential challenge is: is this a re-entry that is purposeful in
|
|
49
|
+
* order to induce cycles, or is the re-entry due to a failure in the system?
|
|
50
|
+
*/
|
|
18
51
|
static notarizeReentry(activity: Activity, guid: string, transaction?: ProviderTransaction): Promise<number>;
|
|
19
52
|
static notarizeContinuation(activity: Activity, transaction?: ProviderTransaction): Promise<number>;
|
|
20
53
|
static notarizeCompletion(activity: Activity, transaction?: ProviderTransaction): Promise<number>;
|
|
@@ -23,13 +56,56 @@ declare class CollatorService {
|
|
|
23
56
|
static isDuplicate(num: number, targetDigitIndex: number): boolean;
|
|
24
57
|
static isInactive(num: number): boolean;
|
|
25
58
|
static isPrimed(amount: number, leg: ActivityDuplex): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* During compilation, the graphs are compiled into structures necessary
|
|
61
|
+
* for distributed processing; these are referred to as 'synthetic DAGs',
|
|
62
|
+
* because they are not part of the original graph, but are used to track
|
|
63
|
+
* the status of the graph in a distributed environment. This check ensures
|
|
64
|
+
* that the 'synthetic key' is not a duplicate. (which is different than
|
|
65
|
+
* saying the 'key' is not a duplicate)
|
|
66
|
+
*/
|
|
26
67
|
static verifySyntheticInteger(amount: number): void;
|
|
27
68
|
static verifyInteger(amount: number, leg: ActivityDuplex, stage: CollationStage): void;
|
|
28
69
|
static getDimensionsById(ancestors: string[], dad: string): Record<string, string>;
|
|
70
|
+
/**
|
|
71
|
+
* All non-trigger activities are assigned a status seed by their parent
|
|
72
|
+
*/
|
|
29
73
|
static getSeed(): string;
|
|
74
|
+
/**
|
|
75
|
+
* All trigger activities are assigned a status seed in a completed state
|
|
76
|
+
*/
|
|
30
77
|
static getTriggerSeed(): string;
|
|
78
|
+
/**
|
|
79
|
+
* entry point for compiler-type activities. This is called by the compiler
|
|
80
|
+
* to bind the sorted activity IDs to the trigger activity. These are then used
|
|
81
|
+
* at runtime by the activities to track job/activity status.
|
|
82
|
+
* @param graphs
|
|
83
|
+
*/
|
|
31
84
|
static compile(graphs: HotMeshGraph[]): void;
|
|
85
|
+
/**
|
|
86
|
+
* binds the ancestor array to each activity.
|
|
87
|
+
* Used in conjunction with the dimensional
|
|
88
|
+
* address (dad). If dad is `,0,1,0,0` and the
|
|
89
|
+
* ancestor array is `['t1', 'a1', 'a2']` for
|
|
90
|
+
* activity 'a3', then the SAVED DAD
|
|
91
|
+
* will always have the trailing
|
|
92
|
+
* 0's removed. This ensures that the addressing
|
|
93
|
+
* remains consistent even if the graph changes.
|
|
94
|
+
* id DAD SAVED DAD
|
|
95
|
+
* * t1 => ,0 => [empty]
|
|
96
|
+
* * a1 => ,0,1 => ,0,1
|
|
97
|
+
* * a2 => ,0,1,0 => ,0,1
|
|
98
|
+
* * a3 => ,0,1,0,0 => ,0,1
|
|
99
|
+
*
|
|
100
|
+
*/
|
|
32
101
|
static bindAncestorArray(graphs: HotMeshGraph[]): void;
|
|
102
|
+
/**
|
|
103
|
+
* All activities exist on a dimensional plane. Zero
|
|
104
|
+
* is the default. A value of
|
|
105
|
+
* `AxY,0,0,0,0,1,0,0` would reflect that
|
|
106
|
+
* an ancestor activity was dimensionalized beyond
|
|
107
|
+
* the default.
|
|
108
|
+
*/
|
|
33
109
|
static getDimensionalSeed(index?: number): string;
|
|
34
110
|
}
|
|
35
111
|
export { CollatorService };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const r=b;function b(c,d){const e=a();return b=function(f,g){f=f-0x125;let h=e[f];return h;},b(c,d);}function a(){const R=['notarizeContinuation','../../types/collator','forEach','__esModule','getDimensionsById','bindAncestorArray','exit','compile','substring','12257qZHteZ','MISSING','notarizeEarlyExit','isInceptionOverage','999000000000000','getSeed','keys','jid','notarizeReentry','dad','toString','verifySyntheticInteger','notarizeInception','INVALID','CollationFaultType','authorizeReentry','enter','aid','ancestors','3usAgSf','getDimensionalAddress','1218afLcgH','605440jyFNxn','282131DLmSTO','exec','store','collateSynthetic','CollatorService','targetLength','166486vSNFsi','233928BYyCID','InactiveJobError','3205773sRnVPs','notarizeEarlyCompletion','cycle','context','find','getDimensionalIndex','isDuplicate','lastIndexOf','activities','getDigitAtIndex','length','verifyInteger','3030720wHYSZB','DUPLICATE','leg','type','FORBIDDEN','isInactive','push','collator-trigger-activity-not-found','config','reverse','notarizeCompletion','isArray','CollationError','../../modules/errors','isPrimed','metadata','ancestor','collate','INACTIVE'];a=function(){return R;};return a();}(function(c,d){const q=b,e=c();while(!![]){try{const f=-parseInt(q(0x138))/0x1+-parseInt(q(0x13e))/0x2*(parseInt(q(0x134))/0x3)+parseInt(q(0x13f))/0x4+parseInt(q(0x137))/0x5+-parseInt(q(0x136))/0x6*(parseInt(q(0x169))/0x7)+parseInt(q(0x14d))/0x8+parseInt(q(0x141))/0x9;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x2f4f4));Object['defineProperty'](exports,r(0x163),{'value':!0x0}),exports[r(0x13c)]=void 0x0;const errors_1=require(r(0x15a)),collator_1=require(r(0x161));class CollatorService{static['assertJobActive'](c,d,f,g=0x0){const s=r;if(c<=g)throw new errors_1[(s(0x140))](d,c,f);}static[r(0x135)](c,d=!0x1){const t=r;let f=c[t(0x144)]['metadata'][t(0x12a)]||c[t(0x15c)]['dad'];return d&&f&&0x2===c[t(0x14f)]&&(f=f[t(0x168)](0x0,f[t(0x148)](','))+',0'),CollatorService['getDimensionsById']([...c[t(0x155)][t(0x133)],c['metadata']['aid']],f);}static['resolveReentryDimension'](c){const u=r,d=c[u(0x155)][u(0x15d)],f=c['config'][u(0x133)]['indexOf'](d),g=c[u(0x15c)][u(0x12a)]['split'](',');return g['length']=f+0x1,g[u(0x153)]('0'),g['join'](',');}static async['notarizeEntry'](c,d){const v=r,f=await c['store'][v(0x15e)](c[v(0x144)][v(0x15c)][v(0x128)],c[v(0x15c)][v(0x132)],-0x5af3107a4000,this[v(0x135)](c),d);return this[v(0x14c)](f,0x1,v(0x131)),f;}static async[r(0x130)](c,d){const w=r;return await c[w(0x13a)]['collate'](c[w(0x144)][w(0x15c)]['jid'],c['metadata'][w(0x132)],-0x9184e72a000,this[w(0x135)](c),d);}static async[r(0x16b)](c,d){const x=r;return await c[x(0x13a)][x(0x15e)](c[x(0x144)][x(0x15c)][x(0x128)],c[x(0x15c)]['aid'],-0xa012317b000,this[x(0x135)](c),d);}static async[r(0x142)](c,d){const y=r,f=c[y(0x155)][y(0x143)]?0x9184e72a000:0xa012317b000;return await c[y(0x13a)]['collate'](c[y(0x144)][y(0x15c)][y(0x128)],c[y(0x15c)][y(0x132)],0xf4241-f,this[y(0x135)](c),d);}static async[r(0x12d)](c,d,f){const z=r;d&&await c[z(0x13a)][z(0x13b)](c[z(0x144)][z(0x15c)][z(0x128)],d,0xf4240,f);}static async[r(0x16c)](c,d){const A=r;if(d)return await c[A(0x13a)][A(0x13b)](c['context'][A(0x15c)]['jid'],d,0xf4240)>0xf4240;return!0x1;}static async[r(0x129)](c,d,f){const B=r,g=c[B(0x144)][B(0x15c)]['jid'],h=f||c[B(0x13a)]['transact']();await c[B(0x13a)][B(0x15e)](g,c[B(0x15c)][B(0x132)],0xf4240,this['getDimensionalAddress'](c,!0x0),h),await c[B(0x13a)][B(0x13b)](g,d,0xf4240,h);const [j,k]=await h[B(0x139)](),m=Array[B(0x158)](j)?j[0x1]:j,p=Array['isArray'](k)?k[0x1]:k;return this[B(0x14c)](m,0x2,B(0x131)),this[B(0x12c)](p),m;}static async[r(0x160)](c,d){const C=r;return await c[C(0x13a)]['collate'](c[C(0x144)][C(0x15c)][C(0x128)],c['metadata'][C(0x132)],0x1,this[C(0x135)](c),d);}static async[r(0x157)](c,d){const D=r,f=c[D(0x155)][D(0x143)]?0x0:0xe8d4a51000;return await c[D(0x13a)][D(0x15e)](c[D(0x144)][D(0x15c)][D(0x128)],c[D(0x15c)][D(0x132)],0x1-f,this[D(0x135)](c),d);}static[r(0x14a)](c,d){const E=r,f=c[E(0x12b)]();if(d<0x0||d>=f[E(0x14b)])return null;return parseInt(f[d],0xa);}static[r(0x146)](c){const F=r,d=c[F(0x12b)]();if(d[F(0x14b)]<0x9)return null;const f=d['substring'](0x3,0x9);return parseInt(f,0xa)-0x1;}static[r(0x147)](c,d){const G=r;return this[G(0x14a)](c,d)<0x8;}static['isInactive'](c){const H=r;return this[H(0x14a)](c,0x2)<0x9;}static['isPrimed'](c,d){const I=r;return 0x1==d?-0x5af3107a4000!=c:this[I(0x14a)](c,0x0)<0x9&&this[I(0x14a)](c,0x1)<0x9;}static['verifySyntheticInteger'](c){const J=r,d=c['toString']();if(parseInt(d[d['length']-0x1],0xa)>0x0)throw new errors_1[(J(0x159))](c,0x2,J(0x131),collator_1[J(0x12f)]['INACTIVE']);if(c>=0x1e8480)throw new errors_1[(J(0x159))](c,0x2,J(0x131),collator_1['CollationFaultType'][J(0x14e)]);}static[r(0x14c)](c,d,f){const K=r;let g;if(0x1===d&&K(0x131)===f?this['isPrimed'](c,0x1)?this['isDuplicate'](c,0x0)?g=collator_1[K(0x12f)][K(0x14e)]:0x331a2bfa73000!=c&&(g=collator_1[K(0x12f)][K(0x12e)]):g=collator_1['CollationFaultType']['MISSING']:0x1===d&&K(0x166)===f?-0x9184e72a000===c?g=collator_1[K(0x12f)][K(0x16a)]:this[K(0x147)](c,0x1)&&(g=collator_1[K(0x12f)][K(0x14e)]):0x2===d&&K(0x131)===f&&(this[K(0x15b)](c,0x2)?this[K(0x152)](c)&&(g=collator_1[K(0x12f)][K(0x15f)]):g=collator_1[K(0x12f)][K(0x151)]),g)throw new errors_1[(K(0x159))](c,d,f,g);}static[r(0x164)](c,d){const L=r,f={'$ADJACENT':d+',0'};let g=d;return c[L(0x156)]()['forEach'](h=>{f[h]=g,g=g['substring'](0x0,g['lastIndexOf'](','));}),f;}static[r(0x126)](){const M=r;return M(0x125);}static['getTriggerSeed'](){return'888000001000001';}static[r(0x167)](c){const N=r;CollatorService[N(0x165)](c);}static[r(0x165)](c){const O=r;c[O(0x162)](d=>{const P=O,f={},g=Object[P(0x127)](d[P(0x149)])[P(0x145)](j=>'trigger'===d[P(0x149)][j][P(0x150)]);if(!g)throw new Error(P(0x154));const h=(j,k)=>{const Q=P;f[j]=k,d[Q(0x149)][j][Q(0x133)]=k,(d['transitions']?.[j]||[])[Q(0x162)](l=>{h(l['to'],[...k,j]);});};h(g,[]);});}static['getDimensionalSeed'](c=0x0){return','+c;}}exports['CollatorService']=CollatorService,CollatorService[r(0x13d)]=0xf;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function a(){const X=['11489544wYYQrk','findTrigger','bindCycleTarget','resolveMappableValue','sort','output/data','getVID','setSubscriptions','370juMudL','deployTransitions','object','Symbol\x20index\x20out\x20of\x20bounds','convertActivitiesToHooks','14074590DdehHx','mintKey','app','worker','hooks','getSymKey','getSymbolValues','pow','topic','addSymbolValues','hook','includes','trigger','deployHookPatterns','Validator','ENGINE','generateSymVals','activities','setHookRules','subscribes','data/','2698451ohtQjf','router-stream-group-exists','WORKER','job','Deployer','setSchemas','../../modules/key','deployConsumerGroup','graphs','expire','split','startsWith','keys','examples','KeyType','groupMappingRules','publishes','deployConsumerGroups','entries','collectValues','__esModule','./validator','transitions','generateSymKeys','output','181914NWyYlO','join','hook/data','traverse','../../modules/utils','data','conditions','isArray','length','add','24724wYhjxj','bindSymbols','2kbvElw','string','activity','compile','cycle','schema','convertTopicsToTypes','store','deploySubscriptions','reserveSymbolRange','createConsumerGroup','STREAMS','$job','8rtRMXT','subtype','resolveJobMapsPaths','input','Pipe','persistent','concat','enum','output/metadata','addSymbols','substring','setTransitions','CollatorService','bindParents','bindBackRefs','bindSelf','resolveMappingDependencies','../collator','filterSymVals','../serializer','logger','1396980zdhCXy','consumes','copyJobSchemas','PRODUCES','maps','@pipe','produces','version','type','22KApndG','push','resolve','deployActivitySchemas','../pipe','match','manifest','11332536IpvzUA'];a=function(){return X;};return a();}const u=b;(function(c,d){const t=b,e=c();while(!![]){try{const f=parseInt(t(0x132))/0x1*(parseInt(t(0x18a))/0x2)+parseInt(t(0x17e))/0x3+-parseInt(t(0x188))/0x4*(parseInt(t(0x14b))/0x5)+parseInt(t(0x142))/0x6+parseInt(t(0x165))/0x7*(-parseInt(t(0x197))/0x8)+parseInt(t(0x143))/0x9+parseInt(t(0x150))/0xa*(-parseInt(t(0x13b))/0xb);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xeba41));Object['defineProperty'](exports,u(0x179),{'value':!![]}),exports['Deployer']=void 0x0;const key_1=require(u(0x16b)),utils_1=require(u(0x182)),collator_1=require(u(0x1a8)),serializer_1=require(u(0x130)),pipe_1=require(u(0x13f)),validator_1=require(u(0x17a)),DEFAULT_METADATA_RANGE_SIZE=0x1a,DEFAULT_DATA_RANGE_SIZE=0x104,DEFAULT_RANGE_SIZE=DEFAULT_METADATA_RANGE_SIZE+DEFAULT_DATA_RANGE_SIZE;function b(c,d){const e=a();return b=function(f,g){f=f-0x12f;let h=e[f];return h;},b(c,d);}class Deployer{constructor(c){const v=u;this[v(0x141)]=null,this[v(0x141)]=c;}async['deploy'](c,d){const w=u;this[w(0x191)]=c,this['stream']=d,collator_1[w(0x1a3)][w(0x18d)](this[w(0x141)][w(0x152)][w(0x16d)]),this[w(0x14f)](),this[w(0x190)](),this[w(0x134)](),this[w(0x1a5)](),this[w(0x1a4)](),this[w(0x145)](),this[w(0x1a7)](),this['resolveJobMapsPaths'](),await this[w(0x17c)](),await this[w(0x160)](),await this['deployHookPatterns'](),await this['deployActivitySchemas'](),await this[w(0x192)](),await this[w(0x14c)](),await this['deployConsumerGroups']();}['getVID'](){const x=u;return{'id':this['manifest'][x(0x152)]['id'],'version':this['manifest']['app'][x(0x139)]};}async[u(0x17c)](){const y=u;for(const c of this[y(0x141)][y(0x152)][y(0x16d)]){const [,d]=this[y(0x144)](c),e=d[y(0x163)],[f,g,h]=await this[y(0x191)][y(0x193)]('$'+e,DEFAULT_RANGE_SIZE,'JOB'),i='',j=this[y(0x189)](f,g,h,i,d[y(0x135)]);Object[y(0x171)](j)['length']&&await this[y(0x191)][y(0x1a0)]('$'+e,j);for(const [k,l]of Object[y(0x177)](c[y(0x161)])){const [m,n,o]=await this['store'][y(0x193)](k,DEFAULT_RANGE_SIZE,'ACTIVITY'),p=k+'/';this[y(0x1a6)](l[y(0x133)],l[y(0x138)],k);const q=this[y(0x189)](m,n,o,p,l[y(0x138)]);Object[y(0x171)](q)[y(0x186)]&&await this[y(0x191)]['addSymbols'](k,q);}}}[u(0x1a6)](c,d,e){const z=u;for(const f of[e,'$self']){const g=c[f];if(g)for(const h of g){!d[z(0x15b)](h)&&d['push'](h);}}}['bindSymbols'](c,d,e,f,g){const A=u,h={},i={...e};for(const j of g){const k=''+f+j;if(!i[k]){if(c>d)throw new Error(A(0x14e));const l=(0x0,utils_1[A(0x155)])(c);c++,h[k]=l,i[k]=l;}}return h;}[u(0x134)](){const B=u,c=this[B(0x141)][B(0x152)]['graphs'];for(const d of c){const e=d[B(0x17d)]?.[B(0x18f)],f=d['input']?.['schema'];if(!e&&!f)continue;const g=d[B(0x161)];for(const h in g){if(g[h][B(0x13a)]===B(0x15c)){const i=g[h];e&&(!i[B(0x168)]&&(i[B(0x168)]={}),i[B(0x168)]['schema']=e),f&&(i['output']={'schema':f});}}}}['bindBackRefs'](){const C=u;for(const c of this[C(0x141)][C(0x152)][C(0x16d)]){const d=c[C(0x161)],e=this[C(0x144)](c)[0x0];for(const f in d){d[f]['trigger']=e,d[f][C(0x163)]=c[C(0x163)],c['publishes']&&(d[f][C(0x175)]=c[C(0x175)]),d[f][C(0x16e)]=c['expire']??undefined,d[f]['persistent']=c[C(0x19c)]??undefined;}}}['bindCycleTarget'](){const D=u;for(const c of this[D(0x141)][D(0x152)][D(0x16d)]){const d=c['activities'];for(const e in d){const f=d[e];f[D(0x13a)]===D(0x18e)&&(d[f['ancestor']][D(0x18e)]=!![]);}}}[u(0x190)](){const E=u;for(const c of this[E(0x141)][E(0x152)][E(0x16d)]){const d=c['activities'];for(const e in d){const f=d[e];[E(0x153),'await']['includes'](f[E(0x13a)])&&f[E(0x158)]&&!f[E(0x198)]&&(f['subtype']=f[E(0x158)]);}}}[u(0x14f)](){const F=u;for(const c of this[F(0x141)][F(0x152)][F(0x16d)]){const d=c[F(0x161)];for(const e in d){const f=d[e];[F(0x18c)]['includes'](f['type'])&&(f[F(0x13a)]=F(0x15a));}}}async[u(0x1a4)](){const G=u,c=this['manifest'][G(0x152)][G(0x16d)];for(const d of c){if(d['transitions'])for(const e in d['transitions']){const f=d[G(0x17b)][e];for(const g of f){const h=g['to'];d['activities'][h]['parent']=e;}d[G(0x161)][e][G(0x17b)]=f;}}}[u(0x178)](c,d){const H=u;for(const [e,f]of Object[H(0x177)](c)){if(e===H(0x19e)||e===H(0x172)||e==='default'){if(Array[H(0x185)](f))for(const g of f){typeof g===H(0x18b)&&g[H(0x186)]>0x5&&d['add'](g);}else typeof f==='string'&&f[H(0x186)]>0x5&&d[H(0x187)](f);}else typeof f===H(0x14d)&&this[H(0x178)](f,d);}}[u(0x181)](c,d){const I=u;for(const e of Object['values'](c)){typeof e===I(0x14d)&&(I(0x18f)in e?this[I(0x178)](e[I(0x18f)],d):this[I(0x181)](e,d));}}async[u(0x160)](){const J=u,c=new Set();for(const h of this[J(0x141)][J(0x152)][J(0x16d)]){this[J(0x181)](h,c);}const d=await this[J(0x191)][J(0x156)](),e=Object[J(0x171)](d)['length'],f=Math[J(0x157)](0x34,0x2)-0x1,g=serializer_1['SerializerService'][J(0x12f)](e,f,d,c);await this[J(0x191)][J(0x159)](g);}[u(0x199)](){const L=u;function c(d){const e=[];function f(g,h=[]){const K=b;for(const j in g){if(typeof g[j]==='object'&&g[j]!==null&&!(K(0x137)in g[j])){const k=[...h,j];f(g[j],k);}else{const l=[...h,j][K(0x17f)]('/');if(!l[K(0x15b)]('[')){const m=K(0x164)+l;!e[K(0x15b)](m)&&e['push'](m);}else{const [n,o]=l[K(0x16f)]('['),[p,q]=o[K(0x16f)](']');if(!isNaN(parseInt(p)))for(let r=0x0;r<parseInt(p);r++){const s='data/'+n+'/'+r;!e[K(0x15b)](s)&&e['push'](s);}}}}}return d&&f(d),e;}for(const d of this[L(0x141)]['app'][L(0x16d)]){let e=[];const [,f]=this[L(0x144)](d);for(const g in d[L(0x161)]){const h=d[L(0x161)][g];e=e[L(0x19d)](c(h[L(0x168)]?.[L(0x136)]));}f['PRODUCES']=e;}}[u(0x1a7)](){const N=u,c=[];function d(g,h){const M=b;for(const i in g){if(typeof g[i]===M(0x18b)){const j=g[i],k=j[M(0x140)](/^\{[^@].*}$/);k&&!validator_1[M(0x15e)]['CONTEXT_VARS'][M(0x15b)](j)&&(j[M(0x16f)]('.')[0x1]!==M(0x19a)&&(c['push'](j),h['push'](j)));}else typeof g[i]==='object'&&g[i]!==null&&d(g[i],h);}}const e=this[N(0x141)]['app'][N(0x16d)];for(const g of e){const h=g[N(0x161)];for(const i in h){const j=h[i];j[N(0x133)]=[],d(j,j[N(0x133)]),j[N(0x133)]=this[N(0x174)](j[N(0x133)]);}}const f=this[N(0x174)](c);for(const k of e){const l=k[N(0x161)];for(const m in l){const n=l[m];n[N(0x138)]=f[''+m]||[];}}}[u(0x174)](c){const O=u;c=Array['from'](new Set(c))[O(0x147)]();const d={};for(const e of c){const [f,g]=this[O(0x146)](e);!d[f]&&(d[f]=[]),d[f][O(0x13c)](g);}return d;}['resolveMappableValue'](c){const P=u;c=c[P(0x1a1)](0x1,c['length']-0x1);const d=c['split']('.');if(d[0x0]===P(0x196)){const [e,...f]=d;return[e,f['join']('/')];}else{const [g,h,i,...j]=d,k={'hook':P(0x180),'input':'input/data','output':i===P(0x183)?P(0x148):P(0x19f)}[h];return[g,k+'/'+j[P(0x17f)]('/')];}}async[u(0x13e)](){const Q=u,c=this['manifest'][Q(0x152)][Q(0x16d)],d={};for(const e of c){const f=e[Q(0x161)];for(const g in f){const h=f[g];delete h['transitions'],d[g]=h;}}await this[Q(0x191)][Q(0x16a)](d,this[Q(0x149)]());}async['deploySubscriptions'](){const R=u,c=this['manifest'][R(0x152)][R(0x16d)],d={};for(const e of c){const f=e[R(0x161)],g=e[R(0x163)];for(const h in f){if(f[h][R(0x13a)]===R(0x15c)){d[g]=h;break;}}}await this[R(0x191)][R(0x14a)](d,this[R(0x149)]());}[u(0x144)](c){const S=u;for(const d in c[S(0x161)]){const e=c[S(0x161)][d];if(e['type']===S(0x15c))return[d,e];}return null;}async[u(0x14c)](){const T=u,c=this[T(0x141)][T(0x152)][T(0x16d)],d={};for(const e of c){if(e[T(0x163)]&&e[T(0x163)][T(0x170)]('.')){const [f]=this[T(0x144)](e);f&&(d[e['subscribes']]={[f]:!![]});}if(e[T(0x17b)])for(const g in e[T(0x17b)]){const h=e[T(0x17b)][g],i={};for(const j of h){const k=j['to'];j[T(0x184)]?i[k]=j[T(0x184)]:i[k]=!![];}Object[T(0x171)](i)['length']>0x0&&(d['.'+g]=i);}}await this[T(0x191)][T(0x1a2)](d,this[T(0x149)]());}async[u(0x15d)](){const U=u,c=this['manifest']['app'][U(0x16d)],d={};for(const e of c){if(e[U(0x154)])for(const f in e['hooks']){d[f]=e[U(0x154)][f];const g=e[U(0x154)][f][0x0]['to'],h=e[U(0x161)][g];h&&(!h['hook']&&(h[U(0x15a)]={}),h['hook'][U(0x158)]=f);}}await this['store'][U(0x162)](d);}async[u(0x176)](){const V=u,c={'appId':this[V(0x141)][V(0x152)]['id']},d=this[V(0x191)][V(0x151)](key_1[V(0x173)][V(0x195)],c);await this['deployConsumerGroup'](d,V(0x15f));for(const e of this[V(0x141)][V(0x152)][V(0x16d)]){const f=e[V(0x161)];for(const g in f){const h=f[g];if(h[V(0x13a)]==='worker'&&pipe_1[V(0x19b)][V(0x13d)](h[V(0x198)],{})===h[V(0x198)]){c[V(0x158)]=h[V(0x198)];const i=this[V(0x191)][V(0x151)](key_1['KeyType']['STREAMS'],c);await this[V(0x16c)](i,V(0x167));}}}}async[u(0x16c)](c,d){const W=u;try{await this['stream'][W(0x194)](c,d);}catch(e){this[W(0x191)][W(0x131)]['info'](W(0x166),{'stream':c,'group':d});}}}exports[u(0x169)]=Deployer;
|
|
1
|
+
'use strict';const z=b;(function(c,d){const y=b,e=c();while(!![]){try{const f=parseInt(y(0x186))/0x1+-parseInt(y(0x180))/0x2*(-parseInt(y(0x182))/0x3)+parseInt(y(0x155))/0x4+parseInt(y(0x139))/0x5+-parseInt(y(0x16d))/0x6+-parseInt(y(0x167))/0x7*(-parseInt(y(0x18d))/0x8)+-parseInt(y(0x134))/0x9;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xb2627));function a(){const a2=['6645045rIeZzm','../../modules/key','copyJobSchemas','string','hook/data','cycle','conditions','subtype','addSymbolValues','deployHookPatterns','Pipe','push','mintKey','JOB','add','convertActivitiesToHooks','schema','Deployer','KeyType','ENGINE','output/metadata','$job','addSymbols','groupMappingRules','from','bindBackRefs','trigger','default','2718500paYBtV','persistent','Validator','resolve','compile','pow','../../modules/utils','ancestor','../pipe','deployConsumerGroups','resolveJobMapsPaths','includes','CollatorService','WORKER','publishes','graphs','bindSelf','manifest','91SvbbzI','hook','substring','STREAMS','data/','collectValues','1176720eQfGYF','object','match','bindCycleTarget','router-stream-group-exists','generateSymVals','resolveMappableValue','../serializer','filterSymVals','./validator','produces','input','examples','defineProperty','worker','deployTransitions','output','PRODUCES','Symbol\x20index\x20out\x20of\x20bounds','1286926zMbkJb','bindSymbols','3EmLbbs','@pipe','deployActivitySchemas','concat','66287ZkbEEt','maps','keys','type','transitions','getSymbolValues','getVID','64712DxFNIC','isArray','hooks','generateSymKeys','convertTopicsToTypes','traverse','CONTEXT_VARS','consumes','app','length','findTrigger','setTransitions','store','reserveSymbolRange','deploySubscriptions','setSubscriptions','topic','deployConsumerGroup','createConsumerGroup','entries','resolveMappingDependencies','expire','startsWith','parent','version','deploy','split','join','ACTIVITY','activity','17070822eUMeFG','sort','job','activities','subscribes'];a=function(){return a2;};return a();}function b(c,d){const e=a();return b=function(f,g){f=f-0x118;let h=e[f];return h;},b(c,d);}Object[z(0x17a)](exports,'__esModule',{'value':!0x0}),exports[z(0x14a)]=void 0x0;const key_1=require(z(0x13a)),utils_1=require(z(0x15b)),collator_1=require('../collator'),serializer_1=require(z(0x174)),pipe_1=require(z(0x15d)),validator_1=require(z(0x176)),DEFAULT_METADATA_RANGE_SIZE=0x1a,DEFAULT_DATA_RANGE_SIZE=0x104,DEFAULT_RANGE_SIZE=0x11e;class Deployer{constructor(c){const A=z;this['manifest']=null,this[A(0x166)]=c;}async[z(0x12f)](c,d){const B=z;this[B(0x122)]=c,this['stream']=d,collator_1[B(0x161)][B(0x159)](this['manifest'][B(0x11e)][B(0x164)]),this[B(0x148)](),this[B(0x11a)](),this[B(0x13b)](),this[B(0x152)](),this['bindParents'](),this[B(0x170)](),this[B(0x12a)](),this[B(0x15f)](),await this[B(0x119)](),await this[B(0x172)](),await this[B(0x142)](),await this[B(0x184)](),await this[B(0x124)](),await this[B(0x17c)](),await this[B(0x15e)]();}['getVID'](){const C=z;return{'id':this[C(0x166)][C(0x11e)]['id'],'version':this[C(0x166)][C(0x11e)][C(0x12e)]};}async[z(0x119)](){const D=z;for(const c of this[D(0x166)][D(0x11e)]['graphs']){const [,d]=this[D(0x120)](c),f=d[D(0x138)],[g,h,j]=await this[D(0x122)][D(0x123)]('$'+f,0x11e,D(0x146)),k='',l=this[D(0x181)](g,h,j,k,d[D(0x17e)]);Object[D(0x188)](l)[D(0x11f)]&&await this[D(0x122)][D(0x14f)]('$'+f,l);for(const [m,p]of Object[D(0x129)](c[D(0x137)])){const [q,u,v]=await this[D(0x122)][D(0x123)](m,0x11e,D(0x132)),w=m+'/';this[D(0x165)](p[D(0x11d)],p[D(0x177)],m);const x=this['bindSymbols'](q,u,v,w,p['produces']);Object[D(0x188)](x)[D(0x11f)]&&await this[D(0x122)][D(0x14f)](m,x);}}}['bindSelf'](c,d,f){const E=z;for(const g of[f,'$self']){const h=c[g];if(h){for(const i of h)d[E(0x160)](i)||d['push'](i);}}}[z(0x181)](c,d,f,g,h){const F=z,j={},k={...f};for(const l of h){const m=''+g+l;if(!k[m]){if(c>d)throw new Error(F(0x17f));const p=(0x0,utils_1['getSymKey'])(c);c++,j[m]=p,k[m]=p;}}return j;}[z(0x13b)](){const G=z,c=this[G(0x166)]['app'][G(0x164)];for(const d of c){const f=d[G(0x17d)]?.['schema'],g=d[G(0x178)]?.[G(0x149)];if(!f&&!g)continue;const h=d[G(0x137)];for(const j in h)if('trigger'===h[j][G(0x189)]){const k=h[j];f&&(k[G(0x136)]||(k[G(0x136)]={}),k[G(0x136)]['schema']=f),g&&(k[G(0x17d)]={'schema':g});}}}[z(0x152)](){const H=z;for(const c of this['manifest'][H(0x11e)]['graphs']){const d=c[H(0x137)],f=this[H(0x120)](c)[0x0];for(const g in d)d[g][H(0x153)]=f,d[g][H(0x138)]=c['subscribes'],c[H(0x163)]&&(d[g][H(0x163)]=c[H(0x163)]),d[g][H(0x12b)]=c[H(0x12b)]??void 0x0,d[g][H(0x156)]=c[H(0x156)]??void 0x0;}}[z(0x170)](){const I=z;for(const c of this['manifest'][I(0x11e)][I(0x164)]){const d=c[I(0x137)];for(const e in d){const f=d[e];I(0x13e)===f['type']&&(d[f[I(0x15c)]][I(0x13e)]=!0x0);}}}[z(0x11a)](){const J=z;for(const c of this[J(0x166)]['app'][J(0x164)]){const d=c[J(0x137)];for(const e in d){const f=d[e];[J(0x17b),'await']['includes'](f['type'])&&f[J(0x126)]&&!f[J(0x140)]&&(f['subtype']=f[J(0x126)]);}}}[z(0x148)](){const K=z;for(const c of this[K(0x166)]['app']['graphs']){const d=c[K(0x137)];for(const e in d){const f=d[e];[K(0x133)]['includes'](f[K(0x189)])&&(f[K(0x189)]=K(0x168));}}}async['bindParents'](){const L=z,c=this[L(0x166)][L(0x11e)]['graphs'];for(const d of c)if(d['transitions'])for(const f in d[L(0x18a)]){const g=d[L(0x18a)][f];for(const h of g){const i=h['to'];d['activities'][i][L(0x12d)]=f;}d['activities'][f][L(0x18a)]=g;}}[z(0x16c)](c,d){const M=z;for(const [f,g]of Object['entries'](c))if('enum'===f||M(0x179)===f||M(0x154)===f){if(Array[M(0x18e)](g)){for(const h of g)M(0x13c)==typeof h&&h[M(0x11f)]>0x5&&d[M(0x147)](h);}else M(0x13c)==typeof g&&g[M(0x11f)]>0x5&&d[M(0x147)](g);}else M(0x16e)==typeof g&&this['collectValues'](g,d);}[z(0x11b)](c,d){const N=z;for(const e of Object['values'](c))N(0x16e)==typeof e&&('schema'in e?this[N(0x16c)](e['schema'],d):this[N(0x11b)](e,d));}async[z(0x172)](){const O=z,c=new Set();for(const j of this[O(0x166)][O(0x11e)][O(0x164)])this[O(0x11b)](j,c);const d=await this[O(0x122)][O(0x18b)](),f=Object[O(0x188)](d)[O(0x11f)],g=Math[O(0x15a)](0x34,0x2)-0x1,h=serializer_1['SerializerService'][O(0x175)](f,g,d,c);await this['store'][O(0x141)](h);}['resolveJobMapsPaths'](){const Q=z;function c(d){const f=[];return d&&function g(h,j=[]){const P=b;for(const k in h)if(P(0x16e)!=typeof h[k]||null===h[k]||P(0x183)in h[k]){const l=[...j,k][P(0x131)]('/');if(l[P(0x160)]('[')){const [m,p]=l[P(0x130)]('['),[q,r]=p['split'](']');if(!isNaN(parseInt(q)))for(let u=0x0;u<parseInt(q);u++){const v='data/'+m+'/'+u;f[P(0x160)](v)||f[P(0x144)](v);}}else{const w=P(0x16b)+l;f[P(0x160)](w)||f[P(0x144)](w);}}else{const x=[...j,k];g(h[k],x);}}(d),f;}for(const d of this[Q(0x166)][Q(0x11e)]['graphs']){let f=[];const [,g]=this['findTrigger'](d);for(const h in d[Q(0x137)]){const j=d[Q(0x137)][h];f=f[Q(0x185)](c(j[Q(0x136)]?.[Q(0x187)]));}g['PRODUCES']=f;}}[z(0x12a)](){const S=z,c=[];function d(h,j){const R=b;for(const k in h)if('string'==typeof h[k]){const l=h[k];l[R(0x16f)](/^\{[^@].*}$/)&&!validator_1[R(0x157)][R(0x11c)][R(0x160)](l)&&R(0x178)!==l[R(0x130)]('.')[0x1]&&(c['push'](l),j['push'](l));}else'object'==typeof h[k]&&null!==h[k]&&d(h[k],j);}const f=this['manifest']['app'][S(0x164)];for(const h of f){const i=h['activities'];for(const j in i){const k=i[j];k[S(0x11d)]=[],d(k,k[S(0x11d)]),k[S(0x11d)]=this[S(0x150)](k[S(0x11d)]);}}const g=this[S(0x150)](c);for(const l of f){const m=l[S(0x137)];for(const n in m){m[n][S(0x177)]=g[''+n]||[];}}}[z(0x150)](c){const T=z;c=Array[T(0x151)](new Set(c))[T(0x135)]();const d={};for(const f of c){const [g,h]=this[T(0x173)](f);d[g]||(d[g]=[]),d[g][T(0x144)](h);}return d;}[z(0x173)](c){const U=z,d=(c=c[U(0x169)](0x1,c['length']-0x1))[U(0x130)]('.');if(U(0x14e)===d[0x0]){const [f,...g]=d;return[f,g[U(0x131)]('/')];}{const [h,j,k,...l]=d;return[h,{'hook':U(0x13d),'input':'input/data','output':'data'===k?'output/data':U(0x14d)}[j]+'/'+l['join']('/')];}}async[z(0x184)](){const V=z,c=this[V(0x166)][V(0x11e)][V(0x164)],d={};for(const f of c){const g=f[V(0x137)];for(const h in g){const i=g[h];delete i[V(0x18a)],d[h]=i;}}await this[V(0x122)]['setSchemas'](d,this[V(0x18c)]());}async[z(0x124)](){const W=z,c=this[W(0x166)][W(0x11e)][W(0x164)],d={};for(const f of c){const g=f['activities'],h=f[W(0x138)];for(const i in g)if(W(0x153)===g[i][W(0x189)]){d[h]=i;break;}}await this[W(0x122)][W(0x125)](d,this[W(0x18c)]());}[z(0x120)](c){const X=z;for(const d in c[X(0x137)]){const e=c[X(0x137)][d];if(X(0x153)===e[X(0x189)])return[d,e];}return null;}async[z(0x17c)](){const Y=z,c=this[Y(0x166)]['app'][Y(0x164)],d={};for(const f of c){if(f['subscribes']&&f['subscribes'][Y(0x12c)]('.')){const [g]=this['findTrigger'](f);g&&(d[f[Y(0x138)]]={[g]:!0x0});}if(f[Y(0x18a)])for(const h in f[Y(0x18a)]){const j=f[Y(0x18a)][h],k={};for(const l of j){const m=l['to'];l['conditions']?k[m]=l[Y(0x13f)]:k[m]=!0x0;}Object[Y(0x188)](k)[Y(0x11f)]>0x0&&(d['.'+h]=k);}}await this[Y(0x122)][Y(0x121)](d,this[Y(0x18c)]());}async[z(0x142)](){const Z=z,c=this['manifest'][Z(0x11e)][Z(0x164)],d={};for(const f of c)if(f[Z(0x118)])for(const g in f[Z(0x118)]){d[g]=f[Z(0x118)][g];const h=f[Z(0x118)][g][0x0]['to'],j=f[Z(0x137)][h];j&&(j['hook']||(j[Z(0x168)]={}),j[Z(0x168)][Z(0x126)]=g);}await this[Z(0x122)]['setHookRules'](d);}async[z(0x15e)](){const a0=z,c={'appId':this[a0(0x166)]['app']['id']},d=this[a0(0x122)][a0(0x145)](key_1['KeyType'][a0(0x16a)],c);await this['deployConsumerGroup'](d,a0(0x14c));for(const f of this[a0(0x166)][a0(0x11e)]['graphs']){const g=f['activities'];for(const h in g){const i=g[h];if(a0(0x17b)===i[a0(0x189)]&&pipe_1[a0(0x143)][a0(0x158)](i[a0(0x140)],{})===i[a0(0x140)]){c[a0(0x126)]=i[a0(0x140)];const j=this[a0(0x122)][a0(0x145)](key_1[a0(0x14b)][a0(0x16a)],c);await this[a0(0x127)](j,a0(0x162));}}}}async['deployConsumerGroup'](c,d){const a1=z;try{await this['stream'][a1(0x128)](c,d);}catch(e){this[a1(0x122)]['logger']['info'](a1(0x171),{'stream':c,'group':d});}}}exports[z(0x14a)]=Deployer;
|
|
@@ -3,14 +3,29 @@ import { StoreService } from '../store';
|
|
|
3
3
|
import { HotMeshManifest } from '../../types/hotmesh';
|
|
4
4
|
import { ProviderClient, ProviderTransaction } from '../../types/provider';
|
|
5
5
|
import { StreamService } from '../stream';
|
|
6
|
+
/**
|
|
7
|
+
* The compiler service converts a graph into a executable program.
|
|
8
|
+
*/
|
|
6
9
|
declare class CompilerService {
|
|
7
10
|
store: StoreService<ProviderClient, ProviderTransaction> | null;
|
|
8
11
|
stream: StreamService<ProviderClient, ProviderTransaction> | null;
|
|
9
12
|
logger: ILogger;
|
|
10
13
|
constructor(store: StoreService<ProviderClient, ProviderTransaction>, stream: StreamService<ProviderClient, ProviderTransaction>, logger: ILogger);
|
|
14
|
+
/**
|
|
15
|
+
* verifies and plans the deployment of an app to Redis; the app is not deployed yet
|
|
16
|
+
* @param path
|
|
17
|
+
*/
|
|
11
18
|
plan(mySchemaOrPath: string): Promise<HotMeshManifest>;
|
|
12
19
|
isPath(input: string): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* deploys an app to Redis but does NOT activate it.
|
|
22
|
+
*/
|
|
13
23
|
deploy(mySchemaOrPath: string): Promise<HotMeshManifest>;
|
|
24
|
+
/**
|
|
25
|
+
* activates a deployed version of an app;
|
|
26
|
+
* @param appId
|
|
27
|
+
* @param appVersion
|
|
28
|
+
*/
|
|
14
29
|
activate(appId: string, appVersion: string): Promise<boolean>;
|
|
15
30
|
saveAsJSON(originalPath: string, schema: HotMeshManifest): Promise<void>;
|
|
16
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';var j=b;(function(c,d){var i=b,e=c();while(!![]){try{var f=-parseInt(i(0x145))/0x1*(-parseInt(i(0x162))/0x2)+parseInt(i(0x14a))/0x3*(parseInt(i(0x150))/0x4)+-parseInt(i(0x142))/0x5*(parseInt(i(0x16d))/0x6)+parseInt(i(0x143))/0x7*(parseInt(i(0x161))/0x8)+-parseInt(i(0x14c))/0x9+parseInt(i(0x159))/0xa*(-parseInt(i(0x14e))/0xb)+-parseInt(i(0x170))/0xc*(parseInt(i(0x15e))/0xd);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x9d4c8));var __createBinding=this&&this[j(0x148)]||(Object[j(0x164)]?function(c,d,f,g){var k=j;void 0x0===g&&(g=f);var h=Object[k(0x14b)](d,f);h&&!('get'in h?!d[k(0x157)]:h[k(0x160)]||h[k(0x16a)])||(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(0x165)]||(Object[j(0x164)]?function(c,d){var l=j;Object[l(0x14f)](c,l(0x171),{'enumerable':!0x0,'value':d});}:function(c,d){var m=j;c[m(0x171)]=d;}),__importStar=this&&this['__importStar']||function(c){var n=j;if(c&&c[n(0x157)])return c;var d={};if(null!=c){for(var f in c)'default'!==f&&Object[n(0x152)]['hasOwnProperty'][n(0x166)](c,f)&&__createBinding(d,c,f);}return __setModuleDefault(d,c),d;},__importDefault=this&&this[j(0x169)]||function(c){return c&&c['__esModule']?c:{'default':c};};function a(){var u=['create','__setModuleDefault','call','.json','Validator','__importDefault','configurable','./deployer','logger','3088878ODMKXr','CompilerService','saveAsJSON','12NRqbMJ','default','./validator','stringify','version','5xKNJhS','50491fYzOul','compiler-plan-error','1njjMKV','@apidevtools/json-schema-ref-parser','join','__createBinding','app:','3dGdUoq','getOwnPropertyDescriptor','5776614kEgeOV','path','11zvLWKH','defineProperty','3294308vMsymJ','validate','prototype','activate','store','dereference','stream','__esModule','app','503110JAalPK','load','.hotmesh.','isPath','writeFile','15462187xervHP','js-yaml','writable','1264YGFyVA','2154868gFWvmr','dirname'];a=function(){return u;};return a();}Object[j(0x14f)](exports,j(0x157),{'value':!0x0}),exports[j(0x16e)]=void 0x0;function b(c,d){var e=a();return b=function(f,g){f=f-0x141;var h=e[f];return h;},b(c,d);}const fs=__importStar(require('fs/promises')),path=__importStar(require(j(0x14d))),json_schema_ref_parser_1=__importDefault(require(j(0x146))),js_yaml_1=__importDefault(require(j(0x15f))),deployer_1=require(j(0x16b)),validator_1=require(j(0x172));class CompilerService{constructor(c,d,f){var o=j;this[o(0x154)]=c,this[o(0x156)]=d,this[o(0x16c)]=f;}async['plan'](c){var p=j;try{let d;return d=this[p(0x15c)](c)?await json_schema_ref_parser_1[p(0x171)]['dereference'](c):js_yaml_1['default'][p(0x15a)](c),(new validator_1[(p(0x168))](d)[p(0x151)](this[p(0x154)]),d);}catch(f){this[p(0x16c)]['error'](p(0x144),f);}}['isPath'](c){var q=j;return!c['trim']()['startsWith'](q(0x149));}async['deploy'](c){var r=j;try{let d;this[r(0x15c)](c)?(d=await json_schema_ref_parser_1[r(0x171)][r(0x155)](c),await this[r(0x16f)](c,d)):d=js_yaml_1[r(0x171)][r(0x15a)](c),new validator_1[(r(0x168))](d)[r(0x151)](this[r(0x154)]);const f=new deployer_1['Deployer'](d);return await f['deploy'](this[r(0x154)],this[r(0x156)]),await this[r(0x154)]['setApp'](d[r(0x158)]['id'],d['app'][r(0x141)]),d;}catch(g){this[r(0x16c)]['error']('compiler-deploy-error',g);}}async[j(0x153)](c,d){var s=j;return await this[s(0x154)]['activateAppVersion'](c,d);}async['saveAsJSON'](c,d){var t=j;const f=JSON[t(0x173)](d,null,0x2),g=path[t(0x147)](path[t(0x163)](c),t(0x15b)+d[t(0x158)]['id']+'.'+d[t(0x158)][t(0x141)]+t(0x167));await fs[t(0x15d)](g,f,'utf8');}}exports[j(0x16e)]=CompilerService;
|
|
@@ -10,6 +10,9 @@ declare class Validator {
|
|
|
10
10
|
static SYS_VARS: string[];
|
|
11
11
|
static CONTEXT_VARS: string[];
|
|
12
12
|
constructor(manifest: HotMeshManifest);
|
|
13
|
+
/**
|
|
14
|
+
* validate the manifest file
|
|
15
|
+
*/
|
|
13
16
|
validate(store: StoreService<ProviderClient, ProviderTransaction>): Promise<void>;
|
|
14
17
|
validateActivityIds(): void;
|
|
15
18
|
isMappingStatement(value: string): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function a(){const
|
|
1
|
+
'use strict';const j=b;function b(c,d){const e=a();return b=function(f,g){f=f-0x114;let h=e[f];return h;},b(c,d);}(function(c,d){const i=b,e=c();while(!![]){try{const f=parseInt(i(0x13f))/0x1+-parseInt(i(0x141))/0x2+parseInt(i(0x139))/0x3*(-parseInt(i(0x116))/0x4)+-parseInt(i(0x135))/0x5+-parseInt(i(0x147))/0x6*(-parseInt(i(0x115))/0x7)+-parseInt(i(0x126))/0x8*(parseInt(i(0x145))/0x9)+-parseInt(i(0x12a))/0xa*(-parseInt(i(0x122))/0xb);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x8cee1));function a(){const x=['5769966JUkhye','{$input}','activities','endsWith','manifest','CONTEXT_VARS','extractMappingStatements','7fJmhtl','2596KoyDdT','object','validateReferencedActivityIds','from','app','validateHooks','Mapping\x20statement\x20references\x20non-existent\x20activity:\x20','validateGraphPublishSubscribe','resolveFunction','validateConditionalStatements','validateUniqueHandledTopics','$job','22KigBhp','Validator','Pipe','string','192040UqJQaT','add','validateTransitions','validateSchemas','1084970PPBRvk','mappingStatements','{$item}','graphs','isFunction','has','push','../pipe','activityIds','validateMappingStatements','SYS_VARS','2367340nzvHdw','startsWith','defineProperty','forEach','1839VNeUWA','store','{$key}','getMappingStatements','includes','validateStats','1123199xZrjNx','isMappingStatement','1178490eWHuAQ','validateTransitionConditions','isContextVariable','{$output}','99maznbS','keys'];a=function(){return x;};return a();}Object[j(0x137)](exports,'__esModule',{'value':!0x0}),exports['Validator']=void 0x0;const pipe_1=require(j(0x131));class Validator{constructor(c){const k=j;this[k(0x14b)]=null,this['activityIds']=[],this[k(0x12b)]={},this[k(0x13a)]=null,this[k(0x14b)]=c;}async['validate'](c){const l=j;this[l(0x13a)]=c,this[l(0x13c)](),this['validateActivityIds'](),this['validateReferencedActivityIds'](),this['validateMappingStatements'](),this[l(0x128)](),this[l(0x142)](),this[l(0x13e)](),this[l(0x129)](),this[l(0x120)](),this[l(0x11d)](),this[l(0x11b)](),this[l(0x11f)]();}['validateActivityIds'](){const m=j,c=new Set();this['manifest'][m(0x11a)][m(0x12d)][m(0x138)](d=>{const n=m;Object[n(0x146)](d[n(0x149)])[n(0x138)](e=>{const o=n;if(c[o(0x12f)](e))throw new Error('Duplicate\x20activity\x20id\x20found:\x20'+e);c[o(0x127)](e);});}),this[m(0x132)]=Array[m(0x119)](c);}[j(0x140)](c){const p=j;return p(0x125)==typeof c&&c['startsWith']('{')&&c[p(0x14a)]('}');}[j(0x114)](c,d,f){const q=j;for(const g in c)q(0x117)==typeof c[g]&&null!==c[g]?this['extractMappingStatements'](c[g],d,f):this[q(0x140)](c[g])&&(d[f]||(d[f]=[]),d[f][q(0x130)](c[g]));}[j(0x13c)](){const r=j,c={};this['manifest']['app']['graphs'][r(0x138)](d=>{const s=r,f=d[s(0x149)];for(const g in f){const h=f[g];this[s(0x114)](h,c,g);}}),this[r(0x12b)]=c;}[j(0x118)](){const t=j,c=this[t(0x12b)],d=this['activityIds'];for(const e in c){c[e]['forEach'](f=>{const u=t;if(f['startsWith']('{')&&f[u(0x14a)]('}')){const g=f['slice'](0x1,-0x1)['split']('.')[0x0];if(!(Validator[u(0x134)]['includes'](g)||d[u(0x13d)](g)||this[u(0x12e)](f)||this[u(0x143)](f)))throw new Error(u(0x11c)+f);}});}}['isFunction'](c){const v=j;return c[v(0x136)]('{@')&&pipe_1[v(0x124)][v(0x11e)](c);}[j(0x143)](c){const w=j;return[w(0x148),w(0x144),w(0x12c),w(0x13b),'{$index}'][w(0x13d)](c);}[j(0x133)](){}['validateTransitions'](){}[j(0x142)](){}[j(0x13e)](){}[j(0x129)](){}[j(0x120)](){}[j(0x11d)](){}['validateHooks'](){}[j(0x11f)](){}}exports[j(0x123)]=Validator,Validator[j(0x134)]=['$app','$self','$graph',j(0x121)],Validator[j(0x14c)]=[j(0x148),j(0x144),j(0x12c),'{$key}','{$index}'];
|
|
@@ -2,7 +2,21 @@ import { HotMeshEngine, HotMeshWorker } from '../../types/hotmesh';
|
|
|
2
2
|
import { ProviderConfig, ProviderNativeClient } from '../../types/provider';
|
|
3
3
|
export declare class ConnectorService {
|
|
4
4
|
static disconnectAll(): Promise<void>;
|
|
5
|
+
/**
|
|
6
|
+
* Connect to a provider (redis, nats, postgres) and return the native
|
|
7
|
+
* client. Connections are handled by the engine and worker routers at
|
|
8
|
+
* initialization, but the factory method provided here is useful
|
|
9
|
+
* for testing provider configurations.
|
|
10
|
+
*/
|
|
5
11
|
static connectClient(ProviderConfig: ProviderConfig): Promise<ProviderNativeClient>;
|
|
12
|
+
/**
|
|
13
|
+
* Initialize `store`, `stream`, and `subscription` clients for any provider.
|
|
14
|
+
* @private
|
|
15
|
+
*/
|
|
6
16
|
static initClients(target: HotMeshEngine | HotMeshWorker): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Binds a provider client native instance to the target object.
|
|
19
|
+
* @private
|
|
20
|
+
*/
|
|
7
21
|
static initClient(ProviderConfig: ProviderConfig, target: HotMeshEngine | HotMeshWorker, field: string): Promise<void>;
|
|
8
22
|
}
|
|
@@ -13,11 +13,21 @@ class ConnectorService {
|
|
|
13
13
|
await postgres_1.PostgresConnection.disconnectAll();
|
|
14
14
|
await nats_1.NatsConnection.disconnectAll();
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Connect to a provider (redis, nats, postgres) and return the native
|
|
18
|
+
* client. Connections are handled by the engine and worker routers at
|
|
19
|
+
* initialization, but the factory method provided here is useful
|
|
20
|
+
* for testing provider configurations.
|
|
21
|
+
*/
|
|
16
22
|
static async connectClient(ProviderConfig) {
|
|
17
23
|
const target = {};
|
|
18
24
|
await ConnectorService.initClient(ProviderConfig, target, 'client');
|
|
19
25
|
return target.client;
|
|
20
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Initialize `store`, `stream`, and `subscription` clients for any provider.
|
|
29
|
+
* @private
|
|
30
|
+
*/
|
|
21
31
|
static async initClients(target) {
|
|
22
32
|
let connection = utils_1.polyfill.providerConfig(target);
|
|
23
33
|
if (!('store' in connection)) {
|
|
@@ -28,6 +38,7 @@ class ConnectorService {
|
|
|
28
38
|
sub: { ...connection },
|
|
29
39
|
};
|
|
30
40
|
}
|
|
41
|
+
// Expanded form
|
|
31
42
|
if (connection.store) {
|
|
32
43
|
await ConnectorService.initClient(connection.store, target, 'store');
|
|
33
44
|
}
|
|
@@ -36,7 +47,10 @@ class ConnectorService {
|
|
|
36
47
|
}
|
|
37
48
|
if (connection.sub) {
|
|
38
49
|
await ConnectorService.initClient(connection.sub, target, 'sub');
|
|
50
|
+
// use store for publishing events if same as subscription
|
|
39
51
|
if (connection.sub.class !== connection.store.class) {
|
|
52
|
+
//initialize a separate client for publishing events, using
|
|
53
|
+
//the same provider as the subscription client
|
|
40
54
|
connection.pub = {
|
|
41
55
|
class: connection.sub.class,
|
|
42
56
|
options: { ...connection.sub.options },
|
|
@@ -46,14 +60,18 @@ class ConnectorService {
|
|
|
46
60
|
}
|
|
47
61
|
}
|
|
48
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Binds a provider client native instance to the target object.
|
|
65
|
+
* @private
|
|
66
|
+
*/
|
|
49
67
|
static async initClient(ProviderConfig, target, field) {
|
|
50
68
|
if (target[field]) {
|
|
51
69
|
return;
|
|
52
70
|
}
|
|
53
71
|
const providerClass = ProviderConfig.class;
|
|
54
72
|
const options = ProviderConfig.options;
|
|
55
|
-
const providerName = ProviderConfig.provider || (0, utils_1.identifyProvider)(providerClass);
|
|
56
|
-
const providerType = providerName.split('.')[0];
|
|
73
|
+
const providerName = ProviderConfig.provider || (0, utils_1.identifyProvider)(providerClass); //e.g. 'postgres.poolclient'
|
|
74
|
+
const providerType = providerName.split('.')[0]; //e.g. 'postgres'
|
|
57
75
|
let clientInstance;
|
|
58
76
|
const id = (0, utils_1.guid)();
|
|
59
77
|
switch (providerType) {
|
|
@@ -67,12 +85,14 @@ class ConnectorService {
|
|
|
67
85
|
clientInstance = await nats_1.NatsConnection.connect(id, providerClass, options, { provider: providerName });
|
|
68
86
|
break;
|
|
69
87
|
case 'postgres':
|
|
88
|
+
//if connecting as a poolClient for subscription, auto connect the client
|
|
70
89
|
const bAutoConnect = field === 'sub';
|
|
71
90
|
clientInstance = await postgres_1.PostgresConnection.connect(id, providerClass, options, { connect: bAutoConnect, provider: providerName });
|
|
72
91
|
break;
|
|
73
92
|
default:
|
|
74
93
|
throw new Error(`Unknown provider type: ${providerType}`);
|
|
75
94
|
}
|
|
95
|
+
// Bind the resolved client instance to the target object
|
|
76
96
|
target[field] = clientInstance.getClient();
|
|
77
97
|
}
|
|
78
98
|
}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { StringAnyType } from '../../types';
|
|
2
2
|
import { ProviderClass, ProviderNativeClient, ProviderOptions } from '../../types/provider';
|
|
3
3
|
import { ILogger } from '../logger';
|
|
4
|
+
/**
|
|
5
|
+
* Abstract class for creating connections to different backend providers.
|
|
6
|
+
* All implementations should extend this class and implement
|
|
7
|
+
* the following steps:
|
|
8
|
+
*
|
|
9
|
+
* 1) Add the provider to ./providers/<name>.ts
|
|
10
|
+
* 2) Update ./factory.ts to reference the provider
|
|
11
|
+
* 3) Register the tag with the `Provider` type in ./types/provider.ts.
|
|
12
|
+
* 4) Create the specific provider type file at ./types/<name>.ts
|
|
13
|
+
* 5) Update ./modules/utils.ts (identifyProvider) with logic to resolve the provider by inspecting the class/import
|
|
14
|
+
*/
|
|
4
15
|
declare abstract class AbstractConnection<PClass, POptions> {
|
|
5
16
|
static logger: ILogger;
|
|
6
17
|
static disconnecting: boolean;
|
|
@@ -12,7 +23,8 @@ declare abstract class AbstractConnection<PClass, POptions> {
|
|
|
12
23
|
abstract getClient(): ProviderNativeClient;
|
|
13
24
|
disconnect(): Promise<void>;
|
|
14
25
|
protected abstract closeConnection(connection: any): Promise<void>;
|
|
15
|
-
static connect<T extends AbstractConnection<ProviderClass, ProviderOptions>>(this: new () => T, id: string, client: ProviderClass, options?: ProviderOptions,
|
|
26
|
+
static connect<T extends AbstractConnection<ProviderClass, ProviderOptions>>(this: new () => T, id: string, client: ProviderClass, options?: ProviderOptions, //user
|
|
27
|
+
config?: StringAnyType): Promise<T>;
|
|
16
28
|
static disconnectAll(): Promise<void>;
|
|
17
29
|
}
|
|
18
30
|
export { AbstractConnection };
|