@hotmeshio/hotmesh 0.3.12 → 0.3.13
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/README.md +1 -1
- package/build/modules/key.js +1 -1
- package/build/modules/utils.d.ts +3 -2
- package/build/modules/utils.js +1 -1
- package/build/package.json +2 -2
- package/build/services/activities/activity.js +1 -1
- package/build/services/activities/await.js +1 -1
- package/build/services/activities/cycle.js +1 -1
- 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.js +1 -1
- package/build/services/activities/trigger.js +1 -1
- package/build/services/activities/worker.js +1 -1
- package/build/services/collator/index.js +1 -1
- package/build/services/compiler/deployer.js +1 -1
- package/build/services/compiler/index.js +1 -1
- package/build/services/compiler/validator.js +1 -1
- package/build/services/engine/index.js +1 -1
- package/build/services/exporter/index.js +1 -1
- package/build/services/mapper/index.js +1 -1
- package/build/services/meshdata/index.js +2 -1
- package/build/services/meshflow/exporter.js +1 -1
- package/build/services/meshos/index.js +2 -2
- 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.js +1 -1
- 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.js +1 -1
- package/build/services/quorum/index.js +1 -1
- package/build/services/reporter/index.js +1 -1
- package/build/services/router/index.js +1 -1
- 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/providers/postgres/kvsql.js +1 -1
- package/build/services/store/providers/postgres/postgres.js +1 -1
- package/build/services/store/providers/redis/_base.js +1 -1
- package/build/services/store/providers/redis/ioredis.js +1 -1
- package/build/services/store/providers/redis/redis.js +1 -1
- package/build/services/store/providers/store-initializable.js +1 -1
- package/build/services/stream/providers/nats/nats.js +1 -1
- 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/redis/ioredis.js +1 -1
- package/build/services/sub/providers/redis/redis.js +1 -1
- package/build/services/task/index.js +1 -1
- package/build/services/telemetry/index.js +1 -1
- package/build/services/worker/index.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# HotMesh
|
|
2
2
|

|
|
3
3
|
|
|
4
|
-
**HotMesh** offers the power of Temporal.io as a
|
|
4
|
+
**HotMesh** offers the power of Temporal.io as a serverless swarm. It's backed by Postgres or Redis (*your choice*), and there's no need for a central server! Just install the package and start orchestrating your microservices.
|
|
5
5
|
|
|
6
6
|
## Features
|
|
7
7
|
|
package/build/modules/key.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x474660,_0x48e508){const _0x21b3fc=_0x3e89,_0x5c6443=_0x474660();while(!![]){try{const _0x25a428=parseInt(_0x21b3fc(0x17f))/0x1+-parseInt(_0x21b3fc(0x186))/0x2*(-parseInt(_0x21b3fc(0x184))/0x3)+-parseInt(_0x21b3fc(0x185))/0x4+-parseInt(_0x21b3fc(0x17e))/0x5*(-parseInt(_0x21b3fc(0x187))/0x6)+parseInt(_0x21b3fc(0x181))/0x7+-parseInt(_0x21b3fc(0x183))/0x8*(-parseInt(_0x21b3fc(0x180))/0x9)+-parseInt(_0x21b3fc(0x182))/0xa;if(_0x25a428===_0x48e508)break;else _0x5c6443['push'](_0x5c6443['shift']());}catch(_0x319e1a){_0x5c6443['push'](_0x5c6443['shift']());}}}(_0x1fae,0x1ccea));function _0x3e89(_0xfee55a,_0x1175a7){const _0x1fae30=_0x1fae();return _0x3e89=function(_0x3e89a2,_0x1dc95b){_0x3e89a2=_0x3e89a2-0x17e;let _0x14cbbf=_0x1fae30[_0x3e89a2];return _0x14cbbf;},_0x3e89(_0xfee55a,_0x1175a7);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['VALSEP']=exports['WEBSEP']=exports['TYPSEP']=exports['KEYSEP']=exports['HMNS']=exports['KeyType']=exports['KeyService']=void 0x0;const hotmesh_1=require('../types/hotmesh');Object['defineProperty'](exports,'KeyType',{'enumerable':!![],'get':function(){return hotmesh_1['KeyType'];}});const HMNS='hmsh';exports['HMNS']=HMNS;const KEYSEP=':';function _0x1fae(){const _0x3a9d02=['118268KHTOZV','9HvNZca','1640233OHNtqe','5045950JvSDjA','1584296MsDdGi','151221UoOhTy','733264OHiXLr','6IDdntL','2838XEYfrF','1100PxnZIY'];_0x1fae=function(){return _0x3a9d02;};return _0x1fae();}exports['KEYSEP']=KEYSEP;const VALSEP='::';exports['VALSEP']=VALSEP;const WEBSEP='::';exports['WEBSEP']=WEBSEP;const TYPSEP='::';exports['TYPSEP']=TYPSEP;class KeyService{static['mintKey'](_0x2e9c48,_0xc6258b,_0x4ae971){switch(_0xc6258b){case hotmesh_1['KeyType']['HOTMESH']:return _0x2e9c48;case hotmesh_1['KeyType']['THROTTLE_RATE']:return _0x2e9c48+':'+_0x4ae971['appId']+':r:';case hotmesh_1['KeyType']['WORK_ITEMS']:return _0x2e9c48+':'+_0x4ae971['appId']+':w:'+(_0x4ae971['scoutType']||'');case hotmesh_1['KeyType']['TIME_RANGE']:return _0x2e9c48+':'+_0x4ae971['appId']+':t:'+(_0x4ae971['timeValue']||'');case hotmesh_1['KeyType']['APP']:return _0x2e9c48+':a:'+(_0x4ae971['appId']||'');case hotmesh_1['KeyType']['QUORUM']:return _0x2e9c48+':'+_0x4ae971['appId']+':q:'+(_0x4ae971['engineId']||'');case hotmesh_1['KeyType']['JOB_STATE']:return _0x2e9c48+':'+_0x4ae971['appId']+':j:'+_0x4ae971['jobId'];case hotmesh_1['KeyType']['JOB_DEPENDENTS']:return _0x2e9c48+':'+_0x4ae971['appId']+':d:'+_0x4ae971['jobId'];case hotmesh_1['KeyType']['JOB_STATS_GENERAL']:return _0x2e9c48+':'+_0x4ae971['appId']+':s:'+_0x4ae971['jobKey']+':'+_0x4ae971['dateTime'];case hotmesh_1['KeyType']['JOB_STATS_MEDIAN']:return _0x2e9c48+':'+_0x4ae971['appId']+':s:'+_0x4ae971['jobKey']+':'+_0x4ae971['dateTime']+':'+_0x4ae971['facet'];case hotmesh_1['KeyType']['JOB_STATS_INDEX']:return _0x2e9c48+':'+_0x4ae971['appId']+':s:'+_0x4ae971['jobKey']+':'+_0x4ae971['dateTime']+':'+_0x4ae971['facet'];case hotmesh_1['KeyType']['SCHEMAS']:return _0x2e9c48+':'+_0x4ae971['appId']+':v:'+_0x4ae971['appVersion']+':schemas';case hotmesh_1['KeyType']['SUBSCRIPTIONS']:return _0x2e9c48+':'+_0x4ae971['appId']+':v:'+_0x4ae971['appVersion']+':subscriptions';case hotmesh_1['KeyType']['SUBSCRIPTION_PATTERNS']:return _0x2e9c48+':'+_0x4ae971['appId']+':v:'+_0x4ae971['appVersion']+':transitions';case hotmesh_1['KeyType']['HOOKS']:return _0x2e9c48+':'+_0x4ae971['appId']+':hooks';case hotmesh_1['KeyType']['SIGNALS']:return _0x2e9c48+':'+_0x4ae971['appId']+':signals';case hotmesh_1['KeyType']['SYMKEYS']:return _0x2e9c48+':'+_0x4ae971['appId']+':sym:keys:'+(_0x4ae971['activityId']||'');case hotmesh_1['KeyType']['SYMVALS']:return _0x2e9c48+':'+_0x4ae971['appId']+':sym:vals:';case hotmesh_1['KeyType']['STREAMS']:return _0x2e9c48+':'+(_0x4ae971['appId']||'')+':x:'+(_0x4ae971['topic']||'');default:throw new Error('Invalid\x20key\x20type.');}}static['parseKey'](_0x12f85a){const [_0x43145e,_0x1c5ad0,_0x5d4326,..._0x524a1d]=_0x12f85a['split'](KEYSEP),_0x5c2a91=_0x524a1d['join'](KEYSEP)||'';return{'namespace':_0x43145e,'app':_0x5d4326==='a'?_0x1c5ad0:undefined,'entity':_0x5d4326,'id':_0x5c2a91};}static['reconstituteKey'](_0x3039d9){const {namespace:_0x58d08d,app:_0x43be43,entity:_0x491726,id:_0x5e7919}=_0x3039d9;return''+_0x58d08d+KEYSEP+_0x43be43+KEYSEP+_0x491726+KEYSEP+(_0x5e7919||'');}static['resolveEntityType'](_0xa112c2,_0x3018e7=''){switch(_0xa112c2){case'a':return'applications';case'r':return'throttles';case'w':return _0x3018e7===''?'task_priorities':'roles';case't':return _0x3018e7===''?'task_schedules':'task_lists';case'q':return'events';case'j':return'jobs';case's':return'stats';case'v':return'versions';case'x':return _0x3018e7===''?'streams':'stream_topics';case'hooks':return'signal_patterns';case'signals':return'signal_registry';case'sym':return'symbols';default:return'unknown_entity';}}static['resolveAbbreviation'](_0x55a18c){switch(_0x55a18c){case'applications':return'a';case'throttles':return'r';case'roles':return'w';case'task_schedules':return't';case'task_lists':return't';case'events':return'q';case'jobs':return'j';case'stats':return's';case'versions':return'v';case'streams':return'x';case'signal_patterns':return'hooks';case'signal_registry':return'signals';case'symbols':return'sym';default:return'unknown_entity';}}}exports['KeyService']=KeyService;
|
package/build/modules/utils.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { StoreService } from '../services/store';
|
|
3
3
|
import { AppSubscriptions, AppTransitions, AppVID } from '../types/app';
|
|
4
|
-
import { ProviderClient, ProviderConfig, ProviderTransaction, Providers } from '../types/provider';
|
|
4
|
+
import { ProviderClient, ProviderConfig, ProviderTransaction, Providers, ProvidersConfig } from '../types/provider';
|
|
5
5
|
import { StringAnyType } from '../types/serializer';
|
|
6
6
|
import { StreamCode, StreamData, StreamStatus } from '../types/stream';
|
|
7
7
|
import { SystemHealth } from '../types/quorum';
|
|
@@ -22,9 +22,10 @@ export declare const polyfill: {
|
|
|
22
22
|
providerConfig(obj: any): any;
|
|
23
23
|
meshDataConfig(obj: {
|
|
24
24
|
connection?: Partial<ProviderConfig>;
|
|
25
|
+
connections?: Partial<ProvidersConfig>;
|
|
25
26
|
redisClass?: any;
|
|
26
27
|
redisOptions?: StringAnyType;
|
|
27
|
-
}): Partial<ProviderConfig>;
|
|
28
|
+
}): Partial<ProviderConfig> | Partial<ProvidersConfig>;
|
|
28
29
|
};
|
|
29
30
|
export declare function identifyRedisTypeFromClass(redisClass: any): 'redis' | 'ioredis' | null;
|
|
30
31
|
export declare function matchesStatusCode(code: StreamCode, pattern: string | RegExp): boolean;
|
package/build/modules/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(_0x263c50,_0x514054){const _0x33abb6=_0x5899,_0x415fa5=_0x263c50();while(!![]){try{const _0x2261f6=parseInt(_0x33abb6(0x110))/0x1+-parseInt(_0x33abb6(0x113))/0x2+parseInt(_0x33abb6(0x10c))/0x3+-parseInt(_0x33abb6(0x10d))/0x4+-parseInt(_0x33abb6(0x114))/0x5*(-parseInt(_0x33abb6(0x10e))/0x6)+parseInt(_0x33abb6(0x111))/0x7+parseInt(_0x33abb6(0x10f))/0x8*(-parseInt(_0x33abb6(0x112))/0x9);if(_0x2261f6===_0x514054)break;else _0x415fa5['push'](_0x415fa5['shift']());}catch(_0x148ad1){_0x415fa5['push'](_0x415fa5['shift']());}}}(_0x5529,0x9c84d));var __importDefault=this&&this['__importDefault']||function(_0x22e3f1){return _0x22e3f1&&_0x22e3f1['__esModule']?_0x22e3f1:{'default':_0x22e3f1};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['arrayToHash']=exports['isStreamMessage']=exports['parseStreamMessage']=exports['s']=exports['isValidCron']=exports['restoreHierarchy']=exports['getValueByPath']=exports['getIndexedHash']=exports['getSymVal']=exports['getSymKey']=exports['formatISODate']=exports['getTimeSeries']=exports['getSubscriptionTopic']=exports['findSubscriptionForTrigger']=exports['findTopKey']=exports['matchesStatus']=exports['matchesStatusCode']=exports['identifyRedisTypeFromClass']=exports['polyfill']=exports['identifyProvider']=exports['XSleepFor']=exports['sleepImmediate']=exports['sleepFor']=exports['guid']=exports['deterministicRandom']=exports['deepCopy']=exports['getSystemHealth']=exports['hashOptions']=void 0x0;const os_1=__importDefault(require('os')),crypto_1=require('crypto'),nanoid_1=require('nanoid'),ms_1=__importDefault(require('ms')),logger_1=require('../services/logger'),enums_1=require('./enums'),logger=new logger_1['LoggerService']('hotmesh','utils'),hashOptions=_0x41fc47=>{const _0x16f811=JSON['stringify'](_0x41fc47);return(0x0,crypto_1['createHash'])('sha256')['update'](_0x16f811)['digest']('hex');};exports['hashOptions']=hashOptions;async function getSystemHealth(){const _0xd0f0b8=os_1['default']['totalmem'](),_0x5801d3=os_1['default']['freemem'](),_0x265174=_0xd0f0b8-_0x5801d3,_0x5377a7={'TotalMemoryGB':(_0xd0f0b8/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','FreeMemoryGB':(_0x5801d3/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','UsedMemoryGB':(_0x265174/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','CPULoad':[],'NetworkStats':[]};return _0x5377a7;}exports['getSystemHealth']=getSystemHealth;function deepCopy(_0x35e6bb){return JSON['parse'](JSON['stringify'](_0x35e6bb));}exports['deepCopy']=deepCopy;function _0x5899(_0x3a22d6,_0x56a18c){const _0x55297f=_0x5529();return _0x5899=function(_0x5899c0,_0x40b4d4){_0x5899c0=_0x5899c0-0x10c;let _0x318bd6=_0x55297f[_0x5899c0];return _0x318bd6;},_0x5899(_0x3a22d6,_0x56a18c);}function deterministicRandom(_0x4dd413){const _0x276087=Math['sin'](_0x4dd413)*0x2710;return _0x276087-Math['floor'](_0x276087);}exports['deterministicRandom']=deterministicRandom;function guid(_0x2bfa9a=enums_1['HMSH_GUID_SIZE']){return'H'+(0x0,nanoid_1['nanoid'])(_0x2bfa9a);}exports['guid']=guid;async function sleepFor(_0x113b89){return new Promise(_0x245c86=>setTimeout(_0x245c86,_0x113b89));}exports['sleepFor']=sleepFor;function sleepImmediate(){return new Promise(_0x5f3778=>setImmediate(_0x5f3778));}exports['sleepImmediate']=sleepImmediate;function XSleepFor(_0x51c3bc){let _0x4a06a5;const _0x2a827d=new Promise(_0x16e9b3=>{_0x4a06a5=setTimeout(_0x16e9b3,_0x51c3bc);});return{'promise':_0x2a827d,'timerId':_0x4a06a5};}exports['XSleepFor']=XSleepFor;function _0x5529(){const _0x26faa5=['1370100NlhrPH','1410130pIdZYh','1412388JJytFs','4975184EoHvMu','6LIRfcI','3512gJYllw','600468mHJfbB','8814680icIhqW','873Czfjho'];_0x5529=function(){return _0x26faa5;};return _0x5529();}function identifyProvider(_0x2afada){const _0x42e6b3=Object['getPrototypeOf'](_0x2afada);if(_0x2afada['Query']?.['prototype']||Object['keys'](_0x2afada)['includes']('database'))return'postgres';else{if(_0x2afada['constructor']&&_0x2afada['constructor']['name']==='Client')return'nats';else{if('defineCommand'in _0x42e6b3||Object['keys'](_0x42e6b3)['includes']('multi'))return'ioredis';else{if(Object['keys'](_0x42e6b3)['includes']('Multi'))return'redis';}}}if(_0x2afada['constructor']){if(_0x2afada['constructor']['name']==='Redis'||_0x2afada['constructor']['name']==='EventEmitter'){if('hset'in _0x2afada)return'ioredis';}else{if(_0x2afada['constructor']['name']==='ProviderClient'||_0x2afada['constructor']['name']==='Commander'){if('HSET'in _0x2afada)return'redis';}}}let _0x343c1b=null;if(Object['keys'](_0x2afada)['includes']('connection'))_0x343c1b='postgres';else{if(Object['keys'](_0x2afada)['includes']('Pipeline'))_0x343c1b='ioredis';else{if(Object['keys'](_0x2afada)['includes']('createClient'))_0x343c1b='redis';else Object['keys'](_0x2afada)['includes']('jetstream')&&(_0x343c1b='nats');}}return _0x343c1b;}exports['identifyProvider']=identifyProvider,exports['polyfill']={'resolveActivityType'(_0x2d7e6d){return _0x2d7e6d==='activity'?'hook':_0x2d7e6d;},'providerConfig'(_0x3279fb){return _0x3279fb?.['connection']??_0x3279fb?.['redis'];},'meshDataConfig'(_0x163a65){return _0x163a65?.['connection']??{'class':_0x163a65?.['redisClass'],'options':_0x163a65?.['redisOptions']};}};function identifyRedisTypeFromClass(_0x2b8b2a){if(_0x2b8b2a&&_0x2b8b2a['name']==='Redis'||_0x2b8b2a['name']==='EventEmitter')return'ioredis';else{if(_0x2b8b2a&&'createClient'in _0x2b8b2a)return'redis';}return null;}exports['identifyRedisTypeFromClass']=identifyRedisTypeFromClass;function matchesStatusCode(_0x2776fa,_0x11f119){if(typeof _0x11f119==='string'){const _0x1ed51e='^'+_0x11f119['replace'](/\*/g,'\x5cd')+'$';return new RegExp(_0x1ed51e)['test'](_0x2776fa['toString']());}return _0x11f119['test'](_0x2776fa['toString']());}exports['matchesStatusCode']=matchesStatusCode;function matchesStatus(_0x41b9a8,_0xa15df5){return _0x41b9a8===_0xa15df5;}exports['matchesStatus']=matchesStatus;function findTopKey(_0x258cac,_0x18eb4e){for(const [_0x766369,_0x2f532f]of Object['entries'](_0x258cac)){if(_0x2f532f['hasOwnProperty'](_0x18eb4e)){const _0x5b7504=findTopKey(_0x258cac,_0x766369['replace'](/^\./,''));return(_0x5b7504||_0x766369)['replace'](/^\./,'');}}return null;}exports['findTopKey']=findTopKey;function findSubscriptionForTrigger(_0x491761,_0x4db611){for(const [_0x2cb36f,_0x544818]of Object['entries'](_0x491761)){if(_0x544818===_0x4db611)return _0x2cb36f;}return null;}exports['findSubscriptionForTrigger']=findSubscriptionForTrigger;async function getSubscriptionTopic(_0x164545,_0xc8e829,_0x354e50){const _0x1965fb=await _0xc8e829['getTransitions'](_0x354e50),_0x5b5ccc=await _0xc8e829['getSubscriptions'](_0x354e50),_0x5d5670=findTopKey(_0x1965fb,_0x164545),_0x5458ec=findSubscriptionForTrigger(_0x5b5ccc,_0x5d5670);return _0x5458ec;}exports['getSubscriptionTopic']=getSubscriptionTopic;function getTimeSeries(_0x25ba84){if(_0x25ba84['toString']()==='infinity')return'0';const _0x5d11fc=new Date(),_0x3b611a=_0x25ba84['slice'](-0x1),_0x221a2c=parseInt(_0x25ba84['slice'](0x0,-0x1),0xa);if(_0x3b611a==='m'){const _0x1b865b=Math['floor'](_0x5d11fc['getMinutes']()/_0x221a2c)*_0x221a2c;_0x5d11fc['setUTCMinutes'](_0x1b865b,0x0,0x0);}else _0x3b611a==='h'&&_0x5d11fc['setUTCMinutes'](0x0,0x0,0x0);return _0x5d11fc['toISOString']()['replace'](/:\d\d\..+|-|T/g,'')['replace'](':','');}exports['getTimeSeries']=getTimeSeries;function formatISODate(_0x3f20c5){const _0x55eaa1=_0x3f20c5 instanceof Date?_0x3f20c5:new Date(_0x3f20c5);return _0x55eaa1['toISOString']()['replace'](/[:TZ-]/g,'');}exports['formatISODate']=formatISODate;function getSymKey(_0x2aab08){const _0x1534ef='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x3f9f3a=_0x1534ef['length'];if(_0x2aab08<0x0||_0x2aab08>=Math['pow'](_0x3f9f3a,0x3))throw new Error('Number\x20out\x20of\x20range');const [_0x31eb16,_0x244ff8]=divmod(_0x2aab08,_0x3f9f3a),[_0x19ca2f,_0x4b0695]=divmod(_0x31eb16,_0x3f9f3a);return _0x1534ef[_0x19ca2f]+_0x1534ef[_0x244ff8]+_0x1534ef[_0x4b0695];}exports['getSymKey']=getSymKey;function getSymVal(_0x197ee7){const _0x45d80f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x346a12=_0x45d80f['length'];if(_0x197ee7<0x0||_0x197ee7>=Math['pow'](_0x346a12,0x2))throw new Error('Number\x20out\x20of\x20range');const [_0x4f0db6,_0x2ccfe8]=divmod(_0x197ee7,_0x346a12);return _0x45d80f[_0x4f0db6]+_0x45d80f[_0x2ccfe8];}exports['getSymVal']=getSymVal;function divmod(_0x51a25f,_0x591514){return[Math['floor'](_0x51a25f/_0x591514),_0x51a25f%_0x591514];}function getIndexedHash(_0x481da9,_0x27980c){const _0x25ecad=_0x481da9[_0x27980c]||0x0,_0x31dd64={..._0x481da9};return delete _0x31dd64[_0x27980c],[_0x25ecad,_0x31dd64];}exports['getIndexedHash']=getIndexedHash;function getValueByPath(_0x459abf,_0x35a70a){const _0x16932e=_0x35a70a['split']('/');let _0x32b6ce=_0x459abf;for(const _0x40e6f9 of _0x16932e){if(_0x32b6ce[_0x40e6f9]!==undefined)_0x32b6ce=_0x32b6ce[_0x40e6f9];else return undefined;}return _0x32b6ce;}exports['getValueByPath']=getValueByPath;function restoreHierarchy(_0x2a51fe){const _0x5504d0={};for(const _0x257718 in _0x2a51fe){if(_0x2a51fe[_0x257718]===undefined)continue;const _0xbefef7=_0x257718['split']('/');let _0x5c83c9=_0x5504d0;for(let _0x2717c0=0x0;_0x2717c0<_0xbefef7['length'];_0x2717c0++){_0x2717c0===_0xbefef7['length']-0x1?_0x5c83c9[_0xbefef7[_0x2717c0]]=_0x2a51fe[_0x257718]:(_0x5c83c9[_0xbefef7[_0x2717c0]]=_0x5c83c9[_0xbefef7[_0x2717c0]]||{},_0x5c83c9=_0x5c83c9[_0xbefef7[_0x2717c0]]);}}return _0x5504d0;}exports['restoreHierarchy']=restoreHierarchy;function isValidCron(_0x2cebc8){const _0x4b0b5a=/^(\*|([0-5]?\d)) (\*|([01]?\d|2[0-3])) (\*|([12]?\d|3[01])) (\*|([1-9]|1[0-2])) (\*|([0-6](?:-[0-6])?(?:,[0-6])?))$/;return _0x4b0b5a['test'](_0x2cebc8);}exports['isValidCron']=isValidCron;const s=_0x37f2aa=>{return(0x0,ms_1['default'])(_0x37f2aa)/0x3e8;};exports['s']=s;const parseStreamMessage=_0x2c3df5=>{try{return JSON['parse'](_0x2c3df5);}catch(_0x1bca27){logger['error']('Error\x20parsing\x20Stream\x20message',{..._0x1bca27});throw _0x1bca27;}};exports['parseStreamMessage']=parseStreamMessage;const isStreamMessage=_0x8bdfd5=>{return Array['isArray'](_0x8bdfd5)&&Array['isArray'](_0x8bdfd5[0x0]);};exports['isStreamMessage']=isStreamMessage;const arrayToHash=_0x31b79b=>{const _0x5b1ec8=[];let _0x40bc86;for(let _0xc72157=0x1;_0xc72157<_0x31b79b['length'];_0xc72157++){const _0x122a78=_0x31b79b[_0xc72157],_0x52cc12={};if(Array['isArray'](_0x122a78)){for(let _0x388ecc=0x0;_0x388ecc<_0x122a78['length'];_0x388ecc+=0x2){const _0x24357a=_0x122a78[_0x388ecc],_0x85826=_0x122a78[_0x388ecc+0x1];_0x52cc12[_0x24357a]=_0x85826;}_0x40bc86&&(_0x52cc12['$']=_0x40bc86),_0x5b1ec8['push'](_0x52cc12),_0x40bc86=undefined;}else _0x40bc86=_0x122a78;}return _0x5b1ec8;};exports['arrayToHash']=arrayToHash;
|
|
1
|
+
'use strict';(function(_0x5d6c89,_0x2a02f8){const _0x23fe18=_0x24e3,_0xbb6066=_0x5d6c89();while(!![]){try{const _0x4cbdc2=-parseInt(_0x23fe18(0x12e))/0x1*(-parseInt(_0x23fe18(0x12a))/0x2)+-parseInt(_0x23fe18(0x12f))/0x3+-parseInt(_0x23fe18(0x12d))/0x4+parseInt(_0x23fe18(0x130))/0x5+parseInt(_0x23fe18(0x126))/0x6*(-parseInt(_0x23fe18(0x12b))/0x7)+parseInt(_0x23fe18(0x127))/0x8*(parseInt(_0x23fe18(0x128))/0x9)+-parseInt(_0x23fe18(0x12c))/0xa*(-parseInt(_0x23fe18(0x129))/0xb);if(_0x4cbdc2===_0x2a02f8)break;else _0xbb6066['push'](_0xbb6066['shift']());}catch(_0x3fdd34){_0xbb6066['push'](_0xbb6066['shift']());}}}(_0x10b0,0xa3219));var __importDefault=this&&this['__importDefault']||function(_0x22f73f){return _0x22f73f&&_0x22f73f['__esModule']?_0x22f73f:{'default':_0x22f73f};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['arrayToHash']=exports['isStreamMessage']=exports['parseStreamMessage']=exports['s']=exports['isValidCron']=exports['restoreHierarchy']=exports['getValueByPath']=exports['getIndexedHash']=exports['getSymVal']=exports['getSymKey']=exports['formatISODate']=exports['getTimeSeries']=exports['getSubscriptionTopic']=exports['findSubscriptionForTrigger']=exports['findTopKey']=exports['matchesStatus']=exports['matchesStatusCode']=exports['identifyRedisTypeFromClass']=exports['polyfill']=exports['identifyProvider']=exports['XSleepFor']=exports['sleepImmediate']=exports['sleepFor']=exports['guid']=exports['deterministicRandom']=exports['deepCopy']=exports['getSystemHealth']=exports['hashOptions']=void 0x0;const os_1=__importDefault(require('os')),crypto_1=require('crypto'),nanoid_1=require('nanoid'),ms_1=__importDefault(require('ms')),logger_1=require('../services/logger'),enums_1=require('./enums'),logger=new logger_1['LoggerService']('hotmesh','utils'),hashOptions=_0xc429e5=>{const _0x4e0b83=JSON['stringify'](_0xc429e5);return(0x0,crypto_1['createHash'])('sha256')['update'](_0x4e0b83)['digest']('hex');};exports['hashOptions']=hashOptions;async function getSystemHealth(){const _0x1d7155=os_1['default']['totalmem'](),_0x58f1fa=os_1['default']['freemem'](),_0x360305=_0x1d7155-_0x58f1fa,_0x1b9077={'TotalMemoryGB':(_0x1d7155/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','FreeMemoryGB':(_0x58f1fa/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','UsedMemoryGB':(_0x360305/0x400/0x400/0x400)['toFixed'](0x2)+'\x20GB','CPULoad':[],'NetworkStats':[]};return _0x1b9077;}exports['getSystemHealth']=getSystemHealth;function _0x10b0(){const _0x53bc90=['87536PrRYDo','351RgIyor','11mUOJWr','44sRJwRM','1288jWwFXs','12382570viuAsA','2360396WprFyX','7115RFTsqZ','1868877GLZbFl','1420990ypKaxc','7320aFBbej'];_0x10b0=function(){return _0x53bc90;};return _0x10b0();}function deepCopy(_0x49780f){return JSON['parse'](JSON['stringify'](_0x49780f));}exports['deepCopy']=deepCopy;function deterministicRandom(_0x3999da){const _0x33f623=Math['sin'](_0x3999da)*0x2710;return _0x33f623-Math['floor'](_0x33f623);}exports['deterministicRandom']=deterministicRandom;function guid(_0x178206=enums_1['HMSH_GUID_SIZE']){return'H'+(0x0,nanoid_1['nanoid'])(_0x178206);}function _0x24e3(_0x312ee4,_0x239b72){const _0x10b01b=_0x10b0();return _0x24e3=function(_0x24e3e7,_0x2c6e9e){_0x24e3e7=_0x24e3e7-0x126;let _0x16ad54=_0x10b01b[_0x24e3e7];return _0x16ad54;},_0x24e3(_0x312ee4,_0x239b72);}exports['guid']=guid;async function sleepFor(_0x574825){return new Promise(_0x1c94cd=>setTimeout(_0x1c94cd,_0x574825));}exports['sleepFor']=sleepFor;function sleepImmediate(){return new Promise(_0x2fde34=>setImmediate(_0x2fde34));}exports['sleepImmediate']=sleepImmediate;function XSleepFor(_0x1d49a1){let _0x5be22e;const _0x529952=new Promise(_0x3bef18=>{_0x5be22e=setTimeout(_0x3bef18,_0x1d49a1);});return{'promise':_0x529952,'timerId':_0x5be22e};}exports['XSleepFor']=XSleepFor;function identifyProvider(_0x4c75e1){const _0xed44c9=Object['getPrototypeOf'](_0x4c75e1);if(_0x4c75e1['Query']?.['prototype']||Object['keys'](_0x4c75e1)['includes']('database'))return'postgres';else{if(_0x4c75e1['constructor']&&_0x4c75e1['constructor']['name']==='Client')return'nats';else{if('defineCommand'in _0xed44c9||Object['keys'](_0xed44c9)['includes']('multi'))return'ioredis';else{if(Object['keys'](_0xed44c9)['includes']('Multi'))return'redis';}}}if(_0x4c75e1['constructor']){if(_0x4c75e1['constructor']['name']==='Redis'||_0x4c75e1['constructor']['name']==='EventEmitter'){if('hset'in _0x4c75e1)return'ioredis';}else{if(_0x4c75e1['constructor']['name']==='ProviderClient'||_0x4c75e1['constructor']['name']==='Commander'){if('HSET'in _0x4c75e1)return'redis';}}}let _0x2e3a71=null;if(Object['keys'](_0x4c75e1)['includes']('connection'))_0x2e3a71='postgres';else{if(Object['keys'](_0x4c75e1)['includes']('Pipeline'))_0x2e3a71='ioredis';else{if(Object['keys'](_0x4c75e1)['includes']('createClient'))_0x2e3a71='redis';else Object['keys'](_0x4c75e1)['includes']('jetstream')&&(_0x2e3a71='nats');}}return _0x2e3a71;}exports['identifyProvider']=identifyProvider,exports['polyfill']={'resolveActivityType'(_0x140f63){return _0x140f63==='activity'?'hook':_0x140f63;},'providerConfig'(_0x170007){return _0x170007?.['connection']??_0x170007?.['redis'];},'meshDataConfig'(_0x1a1cdb){if(_0x1a1cdb?.['connections'])return _0x1a1cdb['connections'];return _0x1a1cdb?.['connection']??{'class':_0x1a1cdb?.['redisClass'],'options':_0x1a1cdb?.['redisOptions']};}};function identifyRedisTypeFromClass(_0x54487f){if(_0x54487f&&_0x54487f['name']==='Redis'||_0x54487f['name']==='EventEmitter')return'ioredis';else{if(_0x54487f&&'createClient'in _0x54487f)return'redis';}return null;}exports['identifyRedisTypeFromClass']=identifyRedisTypeFromClass;function matchesStatusCode(_0x1bb29b,_0x24dd72){if(typeof _0x24dd72==='string'){const _0x517923='^'+_0x24dd72['replace'](/\*/g,'\x5cd')+'$';return new RegExp(_0x517923)['test'](_0x1bb29b['toString']());}return _0x24dd72['test'](_0x1bb29b['toString']());}exports['matchesStatusCode']=matchesStatusCode;function matchesStatus(_0x8b4ac1,_0x584858){return _0x8b4ac1===_0x584858;}exports['matchesStatus']=matchesStatus;function findTopKey(_0x47495c,_0x17e6e2){for(const [_0x3d05bf,_0x25932f]of Object['entries'](_0x47495c)){if(_0x25932f['hasOwnProperty'](_0x17e6e2)){const _0x2c09b5=findTopKey(_0x47495c,_0x3d05bf['replace'](/^\./,''));return(_0x2c09b5||_0x3d05bf)['replace'](/^\./,'');}}return null;}exports['findTopKey']=findTopKey;function findSubscriptionForTrigger(_0x5b5382,_0x14fe2a){for(const [_0x5096c6,_0x53b706]of Object['entries'](_0x5b5382)){if(_0x53b706===_0x14fe2a)return _0x5096c6;}return null;}exports['findSubscriptionForTrigger']=findSubscriptionForTrigger;async function getSubscriptionTopic(_0x41d7ab,_0x12f7ea,_0x41ebdb){const _0x5244e9=await _0x12f7ea['getTransitions'](_0x41ebdb),_0x5666d1=await _0x12f7ea['getSubscriptions'](_0x41ebdb),_0x2e4fb3=findTopKey(_0x5244e9,_0x41d7ab),_0x29d2c9=findSubscriptionForTrigger(_0x5666d1,_0x2e4fb3);return _0x29d2c9;}exports['getSubscriptionTopic']=getSubscriptionTopic;function getTimeSeries(_0x146dc1){if(_0x146dc1['toString']()==='infinity')return'0';const _0x15a845=new Date(),_0x330ce4=_0x146dc1['slice'](-0x1),_0x17dc0f=parseInt(_0x146dc1['slice'](0x0,-0x1),0xa);if(_0x330ce4==='m'){const _0x133591=Math['floor'](_0x15a845['getMinutes']()/_0x17dc0f)*_0x17dc0f;_0x15a845['setUTCMinutes'](_0x133591,0x0,0x0);}else _0x330ce4==='h'&&_0x15a845['setUTCMinutes'](0x0,0x0,0x0);return _0x15a845['toISOString']()['replace'](/:\d\d\..+|-|T/g,'')['replace'](':','');}exports['getTimeSeries']=getTimeSeries;function formatISODate(_0x465a3f){const _0x76cd6c=_0x465a3f instanceof Date?_0x465a3f:new Date(_0x465a3f);return _0x76cd6c['toISOString']()['replace'](/[:TZ-]/g,'');}exports['formatISODate']=formatISODate;function getSymKey(_0x5da888){const _0x597a3f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0xfa559a=_0x597a3f['length'];if(_0x5da888<0x0||_0x5da888>=Math['pow'](_0xfa559a,0x3))throw new Error('Number\x20out\x20of\x20range');const [_0x4fd28e,_0xf2ed73]=divmod(_0x5da888,_0xfa559a),[_0x100d23,_0x34181e]=divmod(_0x4fd28e,_0xfa559a);return _0x597a3f[_0x100d23]+_0x597a3f[_0xf2ed73]+_0x597a3f[_0x34181e];}exports['getSymKey']=getSymKey;function getSymVal(_0x2c14c4){const _0x23bb05='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',_0x125389=_0x23bb05['length'];if(_0x2c14c4<0x0||_0x2c14c4>=Math['pow'](_0x125389,0x2))throw new Error('Number\x20out\x20of\x20range');const [_0x5511d9,_0x30bb93]=divmod(_0x2c14c4,_0x125389);return _0x23bb05[_0x5511d9]+_0x23bb05[_0x30bb93];}exports['getSymVal']=getSymVal;function divmod(_0x5becc2,_0x1cf0f3){return[Math['floor'](_0x5becc2/_0x1cf0f3),_0x5becc2%_0x1cf0f3];}function getIndexedHash(_0x463e59,_0x15ef45){const _0x11a22a=_0x463e59[_0x15ef45]||0x0,_0x1ed92f={..._0x463e59};return delete _0x1ed92f[_0x15ef45],[_0x11a22a,_0x1ed92f];}exports['getIndexedHash']=getIndexedHash;function getValueByPath(_0x3d273a,_0x547858){const _0x17bd0e=_0x547858['split']('/');let _0x416419=_0x3d273a;for(const _0x506ff2 of _0x17bd0e){if(_0x416419[_0x506ff2]!==undefined)_0x416419=_0x416419[_0x506ff2];else return undefined;}return _0x416419;}exports['getValueByPath']=getValueByPath;function restoreHierarchy(_0x11bfbb){const _0x2c8efa={};for(const _0x26a754 in _0x11bfbb){if(_0x11bfbb[_0x26a754]===undefined)continue;const _0x331d6d=_0x26a754['split']('/');let _0x889f0=_0x2c8efa;for(let _0x3041ed=0x0;_0x3041ed<_0x331d6d['length'];_0x3041ed++){_0x3041ed===_0x331d6d['length']-0x1?_0x889f0[_0x331d6d[_0x3041ed]]=_0x11bfbb[_0x26a754]:(_0x889f0[_0x331d6d[_0x3041ed]]=_0x889f0[_0x331d6d[_0x3041ed]]||{},_0x889f0=_0x889f0[_0x331d6d[_0x3041ed]]);}}return _0x2c8efa;}exports['restoreHierarchy']=restoreHierarchy;function isValidCron(_0x619c36){const _0x244867=/^(\*|([0-5]?\d)) (\*|([01]?\d|2[0-3])) (\*|([12]?\d|3[01])) (\*|([1-9]|1[0-2])) (\*|([0-6](?:-[0-6])?(?:,[0-6])?))$/;return _0x244867['test'](_0x619c36);}exports['isValidCron']=isValidCron;const s=_0xd70687=>{return(0x0,ms_1['default'])(_0xd70687)/0x3e8;};exports['s']=s;const parseStreamMessage=_0x3d4f6d=>{try{return JSON['parse'](_0x3d4f6d);}catch(_0x1b1a09){logger['error']('Error\x20parsing\x20Stream\x20message',{..._0x1b1a09});throw _0x1b1a09;}};exports['parseStreamMessage']=parseStreamMessage;const isStreamMessage=_0x2fcdb0=>{return Array['isArray'](_0x2fcdb0)&&Array['isArray'](_0x2fcdb0[0x0]);};exports['isStreamMessage']=isStreamMessage;const arrayToHash=_0x5d2d90=>{const _0x369611=[];let _0x2e00b5;for(let _0x20bca3=0x1;_0x20bca3<_0x5d2d90['length'];_0x20bca3++){const _0x12d395=_0x5d2d90[_0x20bca3],_0x221720={};if(Array['isArray'](_0x12d395)){for(let _0x3d77d7=0x0;_0x3d77d7<_0x12d395['length'];_0x3d77d7+=0x2){const _0x517e40=_0x12d395[_0x3d77d7],_0xf4e0=_0x12d395[_0x3d77d7+0x1];_0x221720[_0x517e40]=_0xf4e0;}_0x2e00b5&&(_0x221720['$']=_0x2e00b5),_0x369611['push'](_0x221720),_0x2e00b5=undefined;}else _0x2e00b5=_0x12d395;}return _0x369611;};exports['arrayToHash']=arrayToHash;
|
package/build/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hotmeshio/hotmesh",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.13",
|
|
4
4
|
"description": "Unbreakable Workflows",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"test:sub:redis": "NODE_ENV=test jest ./tests/functional/sub/providers/redis/redis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
73
73
|
"test:trigger": "NODE_ENV=test jest ./tests/unit/services/activities/trigger.test.ts --detectOpenHandles --forceExit --verbose",
|
|
74
74
|
"test:meshdata": "NODE_ENV=test HMSH_IS_CLUSTER=true jest ./tests/meshdata/index.test.ts --forceExit --verbose",
|
|
75
|
-
"test:meshos": "NODE_ENV=test HMSH_IS_CLUSTER=true jest ./tests/meshos
|
|
75
|
+
"test:meshos": "NODE_ENV=test HMSH_IS_CLUSTER=true jest ./tests/meshos/*.test.ts --forceExit --verbose --detectOpenHandles",
|
|
76
76
|
"test:meshcall": "NODE_ENV=test jest ./tests/meshcall/index.test.ts --forceExit --verbose --detectOpenHandles",
|
|
77
77
|
"test:unit": "NODE_ENV=test jest ./tests/unit/*/*/index.test.ts --detectOpenHandles --forceExit --verbose"
|
|
78
78
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function _0x5d10(_0x1c2517,_0x5e79ff){const _0x29dfc1=_0x29df();return _0x5d10=function(_0x5d1096,_0x20267d){_0x5d1096=_0x5d1096-0x179;let _0xdeb4d7=_0x29dfc1[_0x5d1096];return _0xdeb4d7;},_0x5d10(_0x1c2517,_0x5e79ff);}function _0x29df(){const _0x8309b2=['42036mMGRYg','3005055aSiAxe','4032eAOnFg','258787wCYHiJ','3589340tKiUAK','7tDefVY','3419080lXgBHO','305484HvJKbY','22GRaLZl','840oMSSdE'];_0x29df=function(){return _0x8309b2;};return _0x29df();}(function(_0x280216,_0x43d843){const _0x549a56=_0x5d10,_0x47826d=_0x280216();while(!![]){try{const _0x1a7a1a=parseInt(_0x549a56(0x179))/0x1+-parseInt(_0x549a56(0x17e))/0x2*(-parseInt(_0x549a56(0x180))/0x3)+parseInt(_0x549a56(0x17d))/0x4+-parseInt(_0x549a56(0x17f))/0x5*(-parseInt(_0x549a56(0x182))/0x6)+parseInt(_0x549a56(0x17b))/0x7*(parseInt(_0x549a56(0x17c))/0x8)+-parseInt(_0x549a56(0x181))/0x9+-parseInt(_0x549a56(0x17a))/0xa;if(_0x1a7a1a===_0x43d843)break;else _0x47826d['push'](_0x47826d['shift']());}catch(_0xcdb7a1){_0x47826d['push'](_0x47826d['shift']());}}}(_0x29df,0x52366));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Activity']=void 0x0;const enums_1=require('../../modules/enums'),errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),mapper_1=require('../mapper'),pipe_1=require('../pipe'),serializer_1=require('../serializer'),telemetry_1=require('../telemetry'),stream_1=require('../../types/stream');class Activity{constructor(_0x28931e,_0x24ed92,_0xc234e7,_0x241fe5,_0x1bc1d1,_0xffea47){this['status']=stream_1['StreamStatus']['SUCCESS'],this['code']=0xc8,this['adjacentIndex']=0x0,this['config']=_0x28931e,this['data']=_0x24ed92,this['metadata']=_0xc234e7,this['hook']=_0x241fe5,this['engine']=_0x1bc1d1,this['context']=_0xffea47||{'data':{},'metadata':{}},this['logger']=_0x1bc1d1['logger'],this['store']=_0x1bc1d1['store'];}['setLeg'](_0x4710df){this['leg']=_0x4710df;}['mapStatusThreshold'](){if(this['config']['statusThreshold']!==undefined){const _0x15ac73=pipe_1['Pipe']['resolve'](this['config']['statusThreshold'],this['context']);if(_0x15ac73!==undefined&&!isNaN(Number(_0x15ac73)))return _0x15ac73;}return 0x0;}async['verifyEntry'](){this['setLeg'](0x1),await this['getState']();const _0x1981d5=this['mapStatusThreshold']();try{collator_1['CollatorService']['assertJobActive'](this['context']['metadata']['js'],this['context']['metadata']['jid'],this['metadata']['aid'],_0x1981d5);}catch(_0x4ad59c){await collator_1['CollatorService']['notarizeEntry'](this);if(_0x1981d5>0x0){if(this['context']['metadata']['js']===_0x1981d5){const _0x3fc6ce=await this['setStatus'](-_0x1981d5);Number(_0x3fc6ce)===0x0&&await this['engine']['runJobCompletionTasks'](this['context']);}}else throw _0x4ad59c;return;}await collator_1['CollatorService']['notarizeEntry'](this);}async['verifyReentry'](){const _0x3c3f21=this['context']['metadata']['guid'];return this['setLeg'](0x2),await this['getState'](),collator_1['CollatorService']['assertJobActive'](this['context']['metadata']['js'],this['context']['metadata']['jid'],this['metadata']['aid']),await collator_1['CollatorService']['notarizeReentry'](this,_0x3c3f21);}async['processEvent'](_0x4fd195=stream_1['StreamStatus']['SUCCESS'],_0x2238dd=0xc8,_0x4730c1='output'){this['setLeg'](0x2);const _0x226140=this['context']['metadata']['jid'];if(!_0x226140){this['logger']['error']('activity-process-event-error',{'message':'job\x20id\x20is\x20undefined'});return;}const _0x1a97a8=this['metadata']['aid'];this['status']=_0x4fd195,this['code']=_0x2238dd,this['logger']['debug']('activity-process-event',{'topic':this['config']['subtype'],'jid':_0x226140,'aid':_0x1a97a8,'status':_0x4fd195,'code':_0x2238dd});let _0x2af52f;try{const _0x50bfc0=await this['verifyReentry']();this['adjacentIndex']=collator_1['CollatorService']['getDimensionalIndex'](_0x50bfc0),_0x2af52f=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x2af52f['startActivitySpan'](this['leg']);let _0x28f869;if(_0x4fd195===stream_1['StreamStatus']['PENDING'])_0x28f869=await this['processPending'](_0x4730c1);else _0x4fd195===stream_1['StreamStatus']['SUCCESS']?_0x28f869=await this['processSuccess'](_0x4730c1):_0x28f869=await this['processError']();this['transitionAdjacent'](_0x28f869,_0x2af52f);}catch(_0xb40119){if(_0xb40119 instanceof errors_1['CollationError']){this['logger']['info']('process-event-'+_0xb40119['fault']+'-error',{..._0xb40119});return;}else{if(_0xb40119 instanceof errors_1['InactiveJobError']){this['logger']['info']('process-event-inactive-job-error',{..._0xb40119});return;}else{if(_0xb40119 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0xb40119});return;}else{if(_0xb40119 instanceof errors_1['GetStateError']){this['logger']['info']('process-event-get-job-error',{..._0xb40119});return;}}}}this['logger']['error']('activity-process-event-error',{..._0xb40119,'message':_0xb40119['message'],'stack':_0xb40119['stack'],'name':_0xb40119['name']}),_0x2af52f?.['setActivityError'](_0xb40119['message']);throw _0xb40119;}finally{_0x2af52f?.['endActivitySpan'](),this['logger']['debug']('activity-process-event-end',{'jid':_0x226140,'aid':_0x1a97a8});}}async['processPending'](_0x30c0e6){this['bindActivityData'](_0x30c0e6),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x4a8ae0=this['store']['transact']();return await this['setState'](_0x4a8ae0),await collator_1['CollatorService']['notarizeContinuation'](this,_0x4a8ae0),await this['setStatus'](this['adjacencyList']['length'],_0x4a8ae0),await _0x4a8ae0['exec']();}async['processSuccess'](_0x23aa07){this['bindActivityData'](_0x23aa07),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0xadc87b=this['store']['transact']();return await this['setState'](_0xadc87b),await collator_1['CollatorService']['notarizeCompletion'](this,_0xadc87b),await this['setStatus'](this['adjacencyList']['length']-0x1,_0xadc87b),await _0xadc87b['exec']();}async['processError'](){this['bindActivityError'](this['data']),this['adjacencyList']=await this['filterAdjacent']();!this['adjacencyList']['length']&&this['bindJobError'](this['data']);this['mapJobData']();const _0x31bf27=this['store']['transact']();return await this['setState'](_0x31bf27),await collator_1['CollatorService']['notarizeCompletion'](this,_0x31bf27),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x31bf27),await _0x31bf27['exec']();}async['transitionAdjacent'](_0x87d3c0,_0x265cf9){_0x265cf9['mapActivityAttributes']();const _0x2212bf=this['resolveStatus'](_0x87d3c0),_0x4155cb={'app.job.jss':_0x2212bf},_0x4cf0b3=await this['transition'](this['adjacencyList'],_0x2212bf);_0x4cf0b3?.['length']&&(_0x4155cb['app.activity.mids']=_0x4cf0b3['join'](',')),_0x265cf9['setActivityAttributes'](_0x4155cb);}['resolveStatus'](_0x3a938f){const _0x2fb9ae=_0x3a938f[_0x3a938f['length']-0x1];return Array['isArray'](_0x2fb9ae)?Number(_0x2fb9ae[0x1]):Number(_0x2fb9ae);}['mapJobData'](){if(this['config']['job']?.['maps']){const _0x3980fb=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['job']['maps']),this['context']),_0x1c8970=_0x3980fb['mapRules']();if(_0x1c8970)for(const _0x5f2c50 in _0x1c8970){const _0x1b0fa6=_0x5f2c50['indexOf']('[');if(_0x1b0fa6>-0x1){const _0x3ce2a0=_0x5f2c50['substring'](_0x1b0fa6+0x1)['split'](']')[0x0];if(!isNaN(Number(_0x3ce2a0))){const _0x8793c6=_0x5f2c50['substring'](0x0,_0x1b0fa6);_0x1c8970[_0x8793c6]=_0x1c8970[_0x5f2c50],delete _0x1c8970[_0x5f2c50];}else{if(_0x3ce2a0==='-'||_0x3ce2a0==='_'){const _0x52d939=_0x1c8970[_0x5f2c50];Object['keys'](_0x52d939)['forEach'](_0x5bffa5=>{_0x1c8970[_0x5bffa5]=_0x52d939[_0x5bffa5];});}}}}this['context']['data']=_0x1c8970;}}['mapInputData'](){if(this['config']['input']?.['maps']){const _0x43f320=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['input']['maps']),this['context']);this['context']['data']=_0x43f320['mapRules']();}}['mapOutputData'](){if(this['config']['output']?.['maps']){const _0x1a93de=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['output']['maps']),this['context']),_0x36afc4=_0x1a93de['mapRules'](),_0x2183c5=this['metadata']['aid'],_0x400b9a={...this['context'][_0x2183c5]['output'],..._0x36afc4};this['context'][_0x2183c5]['output']['data']=_0x400b9a;}}async['registerTimeout'](){}['bindActivityError'](_0x4d7501){const _0x2e3c5e=this['context'][this['metadata']['aid']]['output']['metadata'];_0x2e3c5e['err']=JSON['stringify'](this['data']),_0x2e3c5e['$error']={..._0x4d7501,'is_stream_error':!![]};}['bindJobError'](_0x41c76d){this['context']['metadata']['err']=JSON['stringify']({..._0x41c76d,'is_stream_error':!![]});}async['getTriggerConfig'](){return await this['store']['getSchema'](this['config']['trigger'],await this['engine']['getVID']());}['getJobStatus'](){return null;}async['setStatus'](_0x49aee1,_0x5e8079){const {id:_0x3a7597}=await this['engine']['getVID']();return await this['store']['setStatus'](_0x49aee1,this['context']['metadata']['jid'],_0x3a7597,_0x5e8079);}['authorizeEntry'](_0x27f1ed){return this['adjacencyList']?.['map'](_0x23ef88=>{const {metadata:{aid:_0x17ce72}}=_0x23ef88;return _0x27f1ed[_0x17ce72+'/output/metadata/as']=collator_1['CollatorService']['getSeed'](),_0x17ce72;})??[];}['bindDimensionalAddress'](_0x51487f){const _0x843312=this['resolveDad']();_0x51487f[this['metadata']['aid']+'/output/metadata/dad']=_0x843312;}async['setState'](_0x1e2a50){const _0x2b5ef3=this['context']['metadata']['jid'];this['bindJobMetadata'](),this['bindActivityMetadata']();const _0x59c5f6={};await this['bindJobState'](_0x59c5f6);const _0x47c5c7=this['authorizeEntry'](_0x59c5f6);this['bindDimensionalAddress'](_0x59c5f6),this['bindActivityState'](_0x59c5f6);const _0x4e1075=['$'+this['config']['subscribes'],this['metadata']['aid'],..._0x47c5c7],_0x65b72c=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],this['resolveDad']());return await this['store']['setState'](_0x59c5f6,this['getJobStatus'](),_0x2b5ef3,_0x4e1075,_0x65b72c,_0x1e2a50);}['bindJobMetadata'](){this['context']['metadata']['ju']=(0x0,utils_1['formatISODate'])(new Date());}['bindActivityMetadata'](){const _0x28b7b6=this['context']['$self'];!_0x28b7b6['output']['metadata']&&(_0x28b7b6['output']['metadata']={});this['status']===stream_1['StreamStatus']['ERROR']&&(_0x28b7b6['output']['metadata']['err']=JSON['stringify'](this['data']));const _0x5288c4=(0x0,utils_1['formatISODate'])(new Date());_0x28b7b6['output']['metadata']['ac']=_0x5288c4,_0x28b7b6['output']['metadata']['au']=_0x5288c4,_0x28b7b6['output']['metadata']['atp']=this['config']['type'],this['config']['subtype']&&(_0x28b7b6['output']['metadata']['stp']=this['config']['subtype']),_0x28b7b6['output']['metadata']['aid']=this['metadata']['aid'];}async['bindJobState'](_0x32e199){const _0x1c2993=await this['getTriggerConfig'](),_0x23af4b=[..._0x1c2993['PRODUCES']||[],...this['bindJobMetadataPaths']()];for(const _0x587043 of _0x23af4b){const _0x36302a=(0x0,utils_1['getValueByPath'])(this['context'],_0x587043);_0x36302a!==undefined&&(_0x32e199[_0x587043]=_0x36302a);}for(const _0x35db61 in this['context']?.['data']??{}){(_0x35db61['startsWith']('-')||_0x35db61['startsWith']('_'))&&(_0x32e199[_0x35db61]=this['context']['data'][_0x35db61]);}telemetry_1['TelemetryService']['bindJobTelemetryToState'](_0x32e199,this['config'],this['context']);}['bindActivityState'](_0x541a4a){const _0x303a1e=[...this['config']['produces'],...this['bindActivityMetadataPaths']()];for(const _0x11cb87 of _0x303a1e){const _0x19dd3c=this['metadata']['aid']+'/'+_0x11cb87,_0x5c2d79=(0x0,utils_1['getValueByPath'])(this['context'],_0x19dd3c);_0x5c2d79!==undefined&&(_0x541a4a[_0x19dd3c]=_0x5c2d79);}telemetry_1['TelemetryService']['bindActivityTelemetryToState'](_0x541a4a,this['config'],this['metadata'],this['context'],this['leg']);}['bindJobMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['JOB_UPDATE']['KEYS']['map'](_0x153f71=>'metadata/'+_0x153f71);}['bindActivityMetadataPaths'](){const _0x106a2f=this['leg']===0x1?'ACTIVITY':'ACTIVITY_UPDATE';return serializer_1['MDATA_SYMBOLS'][_0x106a2f]['KEYS']['map'](_0x36f084=>'output/metadata/'+_0x36f084);}async['getState'](){const _0x14f186=this['context']['metadata']['gid'],_0x1e53a8='$'+this['config']['subscribes'],_0xbe5be6={[_0x1e53a8]:serializer_1['MDATA_SYMBOLS']['JOB']['KEYS']['map'](_0x51fde8=>'metadata/'+_0x51fde8)};for(let [_0x20cf68,_0x32f06e]of Object['entries'](this['config']['consumes'])){if(_0x20cf68==='$job')for(const _0x3d4c0b of _0x32f06e){_0xbe5be6[_0x1e53a8]['push'](_0x3d4c0b);}else{_0x20cf68==='$self'&&(_0x20cf68=this['metadata']['aid']);!_0xbe5be6[_0x20cf68]&&(_0xbe5be6[_0x20cf68]=[]);for(const _0x14d5d1 of _0x32f06e){_0xbe5be6[_0x20cf68]['push'](_0x20cf68+'/'+_0x14d5d1);}}}telemetry_1['TelemetryService']['addTargetTelemetryPaths'](_0xbe5be6,this['config'],this['metadata'],this['leg']);const {dad:_0x30e4b2,jid:_0x37e2fa}=this['context']['metadata'],_0x4acd20=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],_0x30e4b2||''),[_0x3c6ea0,_0x56dcd1]=await this['store']['getState'](_0x37e2fa,_0xbe5be6,_0x4acd20);this['context']=(0x0,utils_1['restoreHierarchy'])(_0x3c6ea0),this['assertGenerationalId'](this['context']?.['metadata']?.['gid'],_0x14f186),this['initDimensionalAddress'](_0x30e4b2),this['initSelf'](this['context']),this['initPolicies'](this['context']);}['assertGenerationalId'](_0x49a1a1,_0x108264){if(_0x108264!==_0x49a1a1)throw new errors_1['GenerationalError'](_0x49a1a1,_0x108264,this['context']?.['metadata']?.['jid']??'',this['context']?.['metadata']?.['aid']??'',this['context']?.['metadata']?.['dad']??'');}['initDimensionalAddress'](_0x422731){this['metadata']['dad']=_0x422731;}['initSelf'](_0x3b9f8b){const _0x5b882a=this['metadata']['aid'];!_0x3b9f8b[_0x5b882a]&&(_0x3b9f8b[_0x5b882a]={});const _0x3412e5=_0x3b9f8b[_0x5b882a];return!_0x3412e5['output']&&(_0x3412e5['output']={}),!_0x3412e5['input']&&(_0x3412e5['input']={}),!_0x3412e5['hook']&&(_0x3412e5['hook']={}),!_0x3412e5['output']['metadata']&&(_0x3412e5['output']['metadata']={}),_0x3412e5['output']['metadata']['au']=(0x0,utils_1['formatISODate'])(new Date()),_0x3b9f8b['$self']=_0x3412e5,_0x3b9f8b['$job']=_0x3b9f8b,_0x3b9f8b;}['initPolicies'](_0x4bfa94){const _0x538903=pipe_1['Pipe']['resolve'](this['config']['expire']??enums_1['HMSH_EXPIRE_DURATION'],_0x4bfa94);_0x4bfa94['metadata']['expire']=_0x538903;if(this['config']['persistent']!=undefined){const _0x38d35d=pipe_1['Pipe']['resolve'](this['config']['persistent']??![],_0x4bfa94);_0x4bfa94['metadata']['persistent']=_0x38d35d;}}['bindActivityData'](_0x350ec8){this['context'][this['metadata']['aid']][_0x350ec8]['data']=this['data'];}['resolveDad'](){let _0x7baa0=this['metadata']['dad'];return this['adjacentIndex']>0x0&&(_0x7baa0=_0x7baa0['substring'](0x0,_0x7baa0['lastIndexOf'](','))+','+this['adjacentIndex']),_0x7baa0;}['resolveAdjacentDad'](){return''+this['resolveDad']()+collator_1['CollatorService']['getDimensionalSeed'](0x0);}async['filterAdjacent'](){const _0xa02e33=[],_0x460295=await this['store']['getTransitions'](await this['engine']['getVID']()),_0x42de9e=_0x460295['.'+this['metadata']['aid']],_0x3cafd7=this['resolveAdjacentDad']();if(_0x42de9e)for(const _0x573ea5 in _0x42de9e){const _0x213953=_0x42de9e[_0x573ea5];mapper_1['MapperService']['evaluate'](_0x213953,this['context'],this['code'])&&_0xa02e33['push']({'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'dad':_0x3cafd7,'aid':_0x573ea5,'spn':this['context']['$self']['output']['metadata']?.['l2s'],'trc':this['context']['metadata']['trc']},'type':stream_1['StreamDataType']['TRANSITION'],'data':{}});}return _0xa02e33;}['isJobComplete'](_0x580bf3){return _0x580bf3<=0x0;}['shouldEmit'](){if(this['config']['emit'])return pipe_1['Pipe']['resolve'](this['config']['emit'],this['context'])===!![];return![];}['shouldPersistJob'](){if(this['config']['persist']!==undefined)return pipe_1['Pipe']['resolve'](this['config']['persist'],this['context'])===!![];return![];}async['transition'](_0x5e82ff,_0x28d0f8){if(this['jobWasInterrupted'](_0x28d0f8))return;let _0x4b001d=[];(this['shouldEmit']()||this['isJobComplete'](_0x28d0f8)||this['shouldPersistJob']())&&await this['engine']['runJobCompletionTasks'](this['context'],{'emit':!this['isJobComplete'](_0x28d0f8)&&!this['shouldPersistJob']()});if(_0x5e82ff['length']&&!this['isJobComplete'](_0x28d0f8)){const _0x5e65c9=this['store']['transact']();for(const _0x5daa05 of _0x5e82ff){await this['engine']['router']?.['publishMessage'](null,_0x5daa05,_0x5e65c9);}_0x4b001d=await _0x5e65c9['exec']();}return _0x4b001d;}['jobWasInterrupted'](_0x139218){return _0x139218<-0x5f5e100;}}exports['Activity']=Activity;
|
|
1
|
+
'use strict';(function(_0xfe9c1a,_0x2fc875){const _0x4b68b7=_0x5091,_0x5be381=_0xfe9c1a();while(!![]){try{const _0x4b8eb7=parseInt(_0x4b68b7(0x11b))/0x1*(-parseInt(_0x4b68b7(0x11f))/0x2)+parseInt(_0x4b68b7(0x121))/0x3+parseInt(_0x4b68b7(0x11d))/0x4*(parseInt(_0x4b68b7(0x11c))/0x5)+-parseInt(_0x4b68b7(0x118))/0x6+-parseInt(_0x4b68b7(0x119))/0x7+parseInt(_0x4b68b7(0x11a))/0x8+-parseInt(_0x4b68b7(0x120))/0x9*(-parseInt(_0x4b68b7(0x11e))/0xa);if(_0x4b8eb7===_0x2fc875)break;else _0x5be381['push'](_0x5be381['shift']());}catch(_0x2ddab0){_0x5be381['push'](_0x5be381['shift']());}}}(_0x56fe,0x4733b));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Activity']=void 0x0;function _0x5091(_0x4e3a82,_0x1243a4){const _0x56fe3b=_0x56fe();return _0x5091=function(_0x509199,_0x3d33fb){_0x509199=_0x509199-0x118;let _0x233d20=_0x56fe3b[_0x509199];return _0x233d20;},_0x5091(_0x4e3a82,_0x1243a4);}const enums_1=require('../../modules/enums'),errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),mapper_1=require('../mapper'),pipe_1=require('../pipe'),serializer_1=require('../serializer'),telemetry_1=require('../telemetry'),stream_1=require('../../types/stream');class Activity{constructor(_0x1898bd,_0x6535b1,_0x1ce7d5,_0x57ef3a,_0xb40cb7,_0x58d6a9){this['status']=stream_1['StreamStatus']['SUCCESS'],this['code']=0xc8,this['adjacentIndex']=0x0,this['config']=_0x1898bd,this['data']=_0x6535b1,this['metadata']=_0x1ce7d5,this['hook']=_0x57ef3a,this['engine']=_0xb40cb7,this['context']=_0x58d6a9||{'data':{},'metadata':{}},this['logger']=_0xb40cb7['logger'],this['store']=_0xb40cb7['store'];}['setLeg'](_0x38ba92){this['leg']=_0x38ba92;}['mapStatusThreshold'](){if(this['config']['statusThreshold']!==undefined){const _0x1dbd19=pipe_1['Pipe']['resolve'](this['config']['statusThreshold'],this['context']);if(_0x1dbd19!==undefined&&!isNaN(Number(_0x1dbd19)))return _0x1dbd19;}return 0x0;}async['verifyEntry'](){this['setLeg'](0x1),await this['getState']();const _0x586504=this['mapStatusThreshold']();try{collator_1['CollatorService']['assertJobActive'](this['context']['metadata']['js'],this['context']['metadata']['jid'],this['metadata']['aid'],_0x586504);}catch(_0x1d85ee){await collator_1['CollatorService']['notarizeEntry'](this);if(_0x586504>0x0){if(this['context']['metadata']['js']===_0x586504){const _0x394908=await this['setStatus'](-_0x586504);Number(_0x394908)===0x0&&await this['engine']['runJobCompletionTasks'](this['context']);}}else throw _0x1d85ee;return;}await collator_1['CollatorService']['notarizeEntry'](this);}async['verifyReentry'](){const _0x43d02f=this['context']['metadata']['guid'];return this['setLeg'](0x2),await this['getState'](),collator_1['CollatorService']['assertJobActive'](this['context']['metadata']['js'],this['context']['metadata']['jid'],this['metadata']['aid']),await collator_1['CollatorService']['notarizeReentry'](this,_0x43d02f);}async['processEvent'](_0x236583=stream_1['StreamStatus']['SUCCESS'],_0x2af466=0xc8,_0x26457='output'){this['setLeg'](0x2);const _0x56afa7=this['context']['metadata']['jid'];if(!_0x56afa7){this['logger']['error']('activity-process-event-error',{'message':'job\x20id\x20is\x20undefined'});return;}const _0x58ced6=this['metadata']['aid'];this['status']=_0x236583,this['code']=_0x2af466,this['logger']['debug']('activity-process-event',{'topic':this['config']['subtype'],'jid':_0x56afa7,'aid':_0x58ced6,'status':_0x236583,'code':_0x2af466});let _0x3860a1;try{const _0x30d591=await this['verifyReentry']();this['adjacentIndex']=collator_1['CollatorService']['getDimensionalIndex'](_0x30d591),_0x3860a1=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x3860a1['startActivitySpan'](this['leg']);let _0x37eb77;if(_0x236583===stream_1['StreamStatus']['PENDING'])_0x37eb77=await this['processPending'](_0x26457);else _0x236583===stream_1['StreamStatus']['SUCCESS']?_0x37eb77=await this['processSuccess'](_0x26457):_0x37eb77=await this['processError']();this['transitionAdjacent'](_0x37eb77,_0x3860a1);}catch(_0x14c219){if(_0x14c219 instanceof errors_1['CollationError']){this['logger']['info']('process-event-'+_0x14c219['fault']+'-error',{..._0x14c219});return;}else{if(_0x14c219 instanceof errors_1['InactiveJobError']){this['logger']['info']('process-event-inactive-job-error',{..._0x14c219});return;}else{if(_0x14c219 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x14c219});return;}else{if(_0x14c219 instanceof errors_1['GetStateError']){this['logger']['info']('process-event-get-job-error',{..._0x14c219});return;}}}}this['logger']['error']('activity-process-event-error',{..._0x14c219,'message':_0x14c219['message'],'stack':_0x14c219['stack'],'name':_0x14c219['name']}),_0x3860a1?.['setActivityError'](_0x14c219['message']);throw _0x14c219;}finally{_0x3860a1?.['endActivitySpan'](),this['logger']['debug']('activity-process-event-end',{'jid':_0x56afa7,'aid':_0x58ced6});}}async['processPending'](_0x18bdfd){this['bindActivityData'](_0x18bdfd),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x3dae29=this['store']['transact']();return await this['setState'](_0x3dae29),await collator_1['CollatorService']['notarizeContinuation'](this,_0x3dae29),await this['setStatus'](this['adjacencyList']['length'],_0x3dae29),await _0x3dae29['exec']();}async['processSuccess'](_0x1f959b){this['bindActivityData'](_0x1f959b),this['adjacencyList']=await this['filterAdjacent'](),this['mapJobData']();const _0x155dbb=this['store']['transact']();return await this['setState'](_0x155dbb),await collator_1['CollatorService']['notarizeCompletion'](this,_0x155dbb),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x155dbb),await _0x155dbb['exec']();}async['processError'](){this['bindActivityError'](this['data']),this['adjacencyList']=await this['filterAdjacent']();!this['adjacencyList']['length']&&this['bindJobError'](this['data']);this['mapJobData']();const _0x433b26=this['store']['transact']();return await this['setState'](_0x433b26),await collator_1['CollatorService']['notarizeCompletion'](this,_0x433b26),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x433b26),await _0x433b26['exec']();}async['transitionAdjacent'](_0x376355,_0x4e39e6){_0x4e39e6['mapActivityAttributes']();const _0x38489b=this['resolveStatus'](_0x376355),_0x47a07f={'app.job.jss':_0x38489b},_0xe9d0be=await this['transition'](this['adjacencyList'],_0x38489b);_0xe9d0be?.['length']&&(_0x47a07f['app.activity.mids']=_0xe9d0be['join'](',')),_0x4e39e6['setActivityAttributes'](_0x47a07f);}['resolveStatus'](_0x5a71e6){const _0x4b4b5d=_0x5a71e6[_0x5a71e6['length']-0x1];return Array['isArray'](_0x4b4b5d)?Number(_0x4b4b5d[0x1]):Number(_0x4b4b5d);}['mapJobData'](){if(this['config']['job']?.['maps']){const _0x55dd41=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['job']['maps']),this['context']),_0xfa5e66=_0x55dd41['mapRules']();if(_0xfa5e66)for(const _0x4d9e26 in _0xfa5e66){const _0x41c650=_0x4d9e26['indexOf']('[');if(_0x41c650>-0x1){const _0x256ec9=_0x4d9e26['substring'](_0x41c650+0x1)['split'](']')[0x0];if(!isNaN(Number(_0x256ec9))){const _0x2947d5=_0x4d9e26['substring'](0x0,_0x41c650);_0xfa5e66[_0x2947d5]=_0xfa5e66[_0x4d9e26],delete _0xfa5e66[_0x4d9e26];}else{if(_0x256ec9==='-'||_0x256ec9==='_'){const _0x4f50ef=_0xfa5e66[_0x4d9e26];Object['keys'](_0x4f50ef)['forEach'](_0x302619=>{_0xfa5e66[_0x302619]=_0x4f50ef[_0x302619];});}}}}this['context']['data']=_0xfa5e66;}}['mapInputData'](){if(this['config']['input']?.['maps']){const _0x321263=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['input']['maps']),this['context']);this['context']['data']=_0x321263['mapRules']();}}['mapOutputData'](){if(this['config']['output']?.['maps']){const _0xd9cec0=new mapper_1['MapperService']((0x0,utils_1['deepCopy'])(this['config']['output']['maps']),this['context']),_0x5b272a=_0xd9cec0['mapRules'](),_0x33fb58=this['metadata']['aid'],_0x4616b0={...this['context'][_0x33fb58]['output'],..._0x5b272a};this['context'][_0x33fb58]['output']['data']=_0x4616b0;}}async['registerTimeout'](){}['bindActivityError'](_0x3deff6){const _0xe7792d=this['context'][this['metadata']['aid']]['output']['metadata'];_0xe7792d['err']=JSON['stringify'](this['data']),_0xe7792d['$error']={..._0x3deff6,'is_stream_error':!![]};}['bindJobError'](_0x1c4673){this['context']['metadata']['err']=JSON['stringify']({..._0x1c4673,'is_stream_error':!![]});}async['getTriggerConfig'](){return await this['store']['getSchema'](this['config']['trigger'],await this['engine']['getVID']());}['getJobStatus'](){return null;}async['setStatus'](_0x573738,_0x558b25){const {id:_0x19892e}=await this['engine']['getVID']();return await this['store']['setStatus'](_0x573738,this['context']['metadata']['jid'],_0x19892e,_0x558b25);}['authorizeEntry'](_0x3d091f){return this['adjacencyList']?.['map'](_0x3bada9=>{const {metadata:{aid:_0x3708d4}}=_0x3bada9;return _0x3d091f[_0x3708d4+'/output/metadata/as']=collator_1['CollatorService']['getSeed'](),_0x3708d4;})??[];}['bindDimensionalAddress'](_0x317950){const _0x4214b1=this['resolveDad']();_0x317950[this['metadata']['aid']+'/output/metadata/dad']=_0x4214b1;}async['setState'](_0x5af3d5){const _0x347dca=this['context']['metadata']['jid'];this['bindJobMetadata'](),this['bindActivityMetadata']();const _0x439067={};await this['bindJobState'](_0x439067);const _0x2f4135=this['authorizeEntry'](_0x439067);this['bindDimensionalAddress'](_0x439067),this['bindActivityState'](_0x439067);const _0x44aff6=['$'+this['config']['subscribes'],this['metadata']['aid'],..._0x2f4135],_0xba2bed=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],this['resolveDad']());return await this['store']['setState'](_0x439067,this['getJobStatus'](),_0x347dca,_0x44aff6,_0xba2bed,_0x5af3d5);}['bindJobMetadata'](){this['context']['metadata']['ju']=(0x0,utils_1['formatISODate'])(new Date());}['bindActivityMetadata'](){const _0x41f69b=this['context']['$self'];!_0x41f69b['output']['metadata']&&(_0x41f69b['output']['metadata']={});this['status']===stream_1['StreamStatus']['ERROR']&&(_0x41f69b['output']['metadata']['err']=JSON['stringify'](this['data']));const _0x18cbe6=(0x0,utils_1['formatISODate'])(new Date());_0x41f69b['output']['metadata']['ac']=_0x18cbe6,_0x41f69b['output']['metadata']['au']=_0x18cbe6,_0x41f69b['output']['metadata']['atp']=this['config']['type'],this['config']['subtype']&&(_0x41f69b['output']['metadata']['stp']=this['config']['subtype']),_0x41f69b['output']['metadata']['aid']=this['metadata']['aid'];}async['bindJobState'](_0x811d9a){const _0x5b3c2a=await this['getTriggerConfig'](),_0x1b11e9=[..._0x5b3c2a['PRODUCES']||[],...this['bindJobMetadataPaths']()];for(const _0x3c4b73 of _0x1b11e9){const _0x480ec2=(0x0,utils_1['getValueByPath'])(this['context'],_0x3c4b73);_0x480ec2!==undefined&&(_0x811d9a[_0x3c4b73]=_0x480ec2);}for(const _0x37813e in this['context']?.['data']??{}){(_0x37813e['startsWith']('-')||_0x37813e['startsWith']('_'))&&(_0x811d9a[_0x37813e]=this['context']['data'][_0x37813e]);}telemetry_1['TelemetryService']['bindJobTelemetryToState'](_0x811d9a,this['config'],this['context']);}['bindActivityState'](_0x2c088d){const _0x376188=[...this['config']['produces'],...this['bindActivityMetadataPaths']()];for(const _0xf56586 of _0x376188){const _0x29ff31=this['metadata']['aid']+'/'+_0xf56586,_0x29f799=(0x0,utils_1['getValueByPath'])(this['context'],_0x29ff31);_0x29f799!==undefined&&(_0x2c088d[_0x29ff31]=_0x29f799);}telemetry_1['TelemetryService']['bindActivityTelemetryToState'](_0x2c088d,this['config'],this['metadata'],this['context'],this['leg']);}['bindJobMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['JOB_UPDATE']['KEYS']['map'](_0x3241e9=>'metadata/'+_0x3241e9);}['bindActivityMetadataPaths'](){const _0x5598d0=this['leg']===0x1?'ACTIVITY':'ACTIVITY_UPDATE';return serializer_1['MDATA_SYMBOLS'][_0x5598d0]['KEYS']['map'](_0x4aa93b=>'output/metadata/'+_0x4aa93b);}async['getState'](){const _0x56a7e9=this['context']['metadata']['gid'],_0x295687='$'+this['config']['subscribes'],_0x2fa7ce={[_0x295687]:serializer_1['MDATA_SYMBOLS']['JOB']['KEYS']['map'](_0x3debe7=>'metadata/'+_0x3debe7)};for(let [_0x262a33,_0x4e9033]of Object['entries'](this['config']['consumes'])){if(_0x262a33==='$job')for(const _0x389c14 of _0x4e9033){_0x2fa7ce[_0x295687]['push'](_0x389c14);}else{_0x262a33==='$self'&&(_0x262a33=this['metadata']['aid']);!_0x2fa7ce[_0x262a33]&&(_0x2fa7ce[_0x262a33]=[]);for(const _0x578162 of _0x4e9033){_0x2fa7ce[_0x262a33]['push'](_0x262a33+'/'+_0x578162);}}}telemetry_1['TelemetryService']['addTargetTelemetryPaths'](_0x2fa7ce,this['config'],this['metadata'],this['leg']);const {dad:_0x26ebf2,jid:_0x2d9c3a}=this['context']['metadata'],_0x25981c=collator_1['CollatorService']['getDimensionsById']([...this['config']['ancestors'],this['metadata']['aid']],_0x26ebf2||''),[_0x46f2d9,_0x1712a0]=await this['store']['getState'](_0x2d9c3a,_0x2fa7ce,_0x25981c);this['context']=(0x0,utils_1['restoreHierarchy'])(_0x46f2d9),this['assertGenerationalId'](this['context']?.['metadata']?.['gid'],_0x56a7e9),this['initDimensionalAddress'](_0x26ebf2),this['initSelf'](this['context']),this['initPolicies'](this['context']);}['assertGenerationalId'](_0x2d6ece,_0x3d8824){if(_0x3d8824!==_0x2d6ece)throw new errors_1['GenerationalError'](_0x2d6ece,_0x3d8824,this['context']?.['metadata']?.['jid']??'',this['context']?.['metadata']?.['aid']??'',this['context']?.['metadata']?.['dad']??'');}['initDimensionalAddress'](_0x15b915){this['metadata']['dad']=_0x15b915;}['initSelf'](_0x4d4932){const _0x3af972=this['metadata']['aid'];!_0x4d4932[_0x3af972]&&(_0x4d4932[_0x3af972]={});const _0x5991cf=_0x4d4932[_0x3af972];return!_0x5991cf['output']&&(_0x5991cf['output']={}),!_0x5991cf['input']&&(_0x5991cf['input']={}),!_0x5991cf['hook']&&(_0x5991cf['hook']={}),!_0x5991cf['output']['metadata']&&(_0x5991cf['output']['metadata']={}),_0x5991cf['output']['metadata']['au']=(0x0,utils_1['formatISODate'])(new Date()),_0x4d4932['$self']=_0x5991cf,_0x4d4932['$job']=_0x4d4932,_0x4d4932;}['initPolicies'](_0x19c90f){const _0x32ec9c=pipe_1['Pipe']['resolve'](this['config']['expire']??enums_1['HMSH_EXPIRE_DURATION'],_0x19c90f);_0x19c90f['metadata']['expire']=_0x32ec9c;if(this['config']['persistent']!=undefined){const _0x5e89cc=pipe_1['Pipe']['resolve'](this['config']['persistent']??![],_0x19c90f);_0x19c90f['metadata']['persistent']=_0x5e89cc;}}['bindActivityData'](_0x3a9cd1){this['context'][this['metadata']['aid']][_0x3a9cd1]['data']=this['data'];}['resolveDad'](){let _0x846d0a=this['metadata']['dad'];return this['adjacentIndex']>0x0&&(_0x846d0a=_0x846d0a['substring'](0x0,_0x846d0a['lastIndexOf'](','))+','+this['adjacentIndex']),_0x846d0a;}['resolveAdjacentDad'](){return''+this['resolveDad']()+collator_1['CollatorService']['getDimensionalSeed'](0x0);}async['filterAdjacent'](){const _0x24ad54=[],_0x3ad136=await this['store']['getTransitions'](await this['engine']['getVID']()),_0x154d37=_0x3ad136['.'+this['metadata']['aid']],_0x231fc4=this['resolveAdjacentDad']();if(_0x154d37)for(const _0x58551d in _0x154d37){const _0x31366f=_0x154d37[_0x58551d];mapper_1['MapperService']['evaluate'](_0x31366f,this['context'],this['code'])&&_0x24ad54['push']({'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'dad':_0x231fc4,'aid':_0x58551d,'spn':this['context']['$self']['output']['metadata']?.['l2s'],'trc':this['context']['metadata']['trc']},'type':stream_1['StreamDataType']['TRANSITION'],'data':{}});}return _0x24ad54;}['isJobComplete'](_0x22151c){return _0x22151c<=0x0;}['shouldEmit'](){if(this['config']['emit'])return pipe_1['Pipe']['resolve'](this['config']['emit'],this['context'])===!![];return![];}['shouldPersistJob'](){if(this['config']['persist']!==undefined)return pipe_1['Pipe']['resolve'](this['config']['persist'],this['context'])===!![];return![];}async['transition'](_0x510c09,_0x264fb3){if(this['jobWasInterrupted'](_0x264fb3))return;let _0x32a109=[];(this['shouldEmit']()||this['isJobComplete'](_0x264fb3)||this['shouldPersistJob']())&&await this['engine']['runJobCompletionTasks'](this['context'],{'emit':!this['isJobComplete'](_0x264fb3)&&!this['shouldPersistJob']()});if(_0x510c09['length']&&!this['isJobComplete'](_0x264fb3)){const _0x34aeec=this['store']['transact']();for(const _0x3c3c8e of _0x510c09){await this['engine']['router']?.['publishMessage'](null,_0x3c3c8e,_0x34aeec);}_0x32a109=await _0x34aeec['exec']();}return _0x32a109;}['jobWasInterrupted'](_0x5c5cc7){return _0x5c5cc7<-0x5f5e100;}}function _0x56fe(){const _0x1ac528=['44236WFBwaL','4040prmVAm','662ZBSRme','3006BECumH','1190802AkzKTx','838230VbgLZa','3352034fikgYM','2499848sDXTPo','937UXlggU','170aMPktu'];_0x56fe=function(){return _0x1ac528;};return _0x56fe();}exports['Activity']=Activity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x24ec11,_0x1be68d){const _0x140617=_0x238d,_0x1cb102=_0x24ec11();while(!![]){try{const _0x80c5c5=-parseInt(_0x140617(0xcb))/0x1*(-parseInt(_0x140617(0xca))/0x2)+-parseInt(_0x140617(0xce))/0x3*(-parseInt(_0x140617(0xd2))/0x4)+parseInt(_0x140617(0xcf))/0x5+-parseInt(_0x140617(0xcc))/0x6+parseInt(_0x140617(0xd1))/0x7+parseInt(_0x140617(0xd0))/0x8+-parseInt(_0x140617(0xcd))/0x9;if(_0x80c5c5===_0x1be68d)break;else _0x1cb102['push'](_0x1cb102['shift']());}catch(_0x320d2b){_0x1cb102['push'](_0x1cb102['shift']());}}}(_0x20e0,0x50e00));function _0x20e0(){const _0x2eeea3=['3431057XDvcTb','56428GttynR','2pWCWIu','92888eVGJhF','1004664LzaNBY','11191500cHUOQv','33KfuqCB','1864345HivVXl','5048984VMCxed'];_0x20e0=function(){return _0x2eeea3;};return _0x20e0();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Await']=void 0x0;function _0x238d(_0x7f0785,_0x198d19){const _0x20e0b0=_0x20e0();return _0x238d=function(_0x238dfd,_0x3cd755){_0x238dfd=_0x238dfd-0xca;let _0x36f469=_0x20e0b0[_0x238dfd];return _0x36f469;},_0x238d(_0x7f0785,_0x198d19);}const errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),pipe_1=require('../pipe'),telemetry_1=require('../telemetry'),stream_1=require('../../types/stream'),activity_1=require('./activity');class Await extends activity_1['Activity']{constructor(_0xd0239b,_0x3924c0,_0x556e97,_0x408b80,_0x392b59,_0x57df32){super(_0xd0239b,_0x3924c0,_0x556e97,_0x408b80,_0x392b59,_0x57df32);}async['process'](){this['logger']['debug']('await-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x4b419a;try{await this['verifyEntry'](),_0x4b419a=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x4b419a['startActivitySpan'](this['leg']),this['mapInputData']();const _0x4e1476=this['store']['transact'](),_0x25367f=await this['execActivity'](_0x4e1476);await collator_1['CollatorService']['authorizeReentry'](this,_0x4e1476),await this['setState'](_0x4e1476),await this['setStatus'](0x0,_0x4e1476);const _0xb6f952=await _0x4e1476['exec']();_0x4b419a['mapActivityAttributes']();const _0x4cd8f9=this['resolveStatus'](_0xb6f952);return _0x4b419a['setActivityAttributes']({'app.activity.mid':_0x25367f,'app.job.jss':_0x4cd8f9}),this['context']['metadata']['aid'];}catch(_0x3951f3){if(_0x3951f3 instanceof errors_1['InactiveJobError']){this['logger']['error']('await-inactive-job-error',{..._0x3951f3});return;}else{if(_0x3951f3 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x3951f3});return;}else{if(_0x3951f3 instanceof errors_1['GetStateError']){this['logger']['error']('await-get-state-error',{..._0x3951f3});return;}else{if(_0x3951f3 instanceof errors_1['CollationError']){if(_0x3951f3['fault']==='duplicate'){this['logger']['info']('await-collation-overage',{'job_id':this['context']['metadata']['jid'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('await-collation-error',{..._0x3951f3});}else this['logger']['error']('await-process-error',{..._0x3951f3});}}}_0x4b419a?.['setActivityError'](_0x3951f3['message']);throw _0x3951f3;}finally{_0x4b419a?.['endActivitySpan'](),this['logger']['debug']('await-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['execActivity'](_0x2eb718){const _0x5a5d96=pipe_1['Pipe']['resolve'](this['config']['subtype'],this['context']),_0x36745b={'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'dad':this['metadata']['dad'],'aid':this['metadata']['aid'],'topic':_0x5a5d96,'spn':this['context']['$self']['output']['metadata']?.['l1s'],'trc':this['context']['metadata']['trc']},'type':stream_1['StreamDataType']['AWAIT'],'data':this['context']['data']};if(this['config']['await']!==!![]){const _0x237988=pipe_1['Pipe']['resolve'](this['config']['await'],this['context']);_0x237988===![]&&(_0x36745b['metadata']['await']=![]);}return this['config']['retry']&&(_0x36745b['policies']={'retry':this['config']['retry']}),await this['engine']['router']?.['publishMessage'](null,_0x36745b,_0x2eb718);}}exports['Await']=Await;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';function _0x173e(_0x3ae8ca,_0x26fbc5){const _0x401371=_0x4013();return _0x173e=function(_0x173eb2,_0x5dcbb5){_0x173eb2=_0x173eb2-0xcb;let _0x54c5b6=_0x401371[_0x173eb2];return _0x54c5b6;},_0x173e(_0x3ae8ca,_0x26fbc5);}(function(_0x5b57cf,_0x488d18){const _0x40980e=_0x173e,_0x3a809e=_0x5b57cf();while(!![]){try{const _0x5aa7b7=-parseInt(_0x40980e(0xcb))/0x1+parseInt(_0x40980e(0xd4))/0x2*(parseInt(_0x40980e(0xcf))/0x3)+-parseInt(_0x40980e(0xcc))/0x4*(parseInt(_0x40980e(0xd3))/0x5)+parseInt(_0x40980e(0xd2))/0x6*(parseInt(_0x40980e(0xd0))/0x7)+-parseInt(_0x40980e(0xce))/0x8+-parseInt(_0x40980e(0xd5))/0x9*(parseInt(_0x40980e(0xd6))/0xa)+parseInt(_0x40980e(0xd1))/0xb*(parseInt(_0x40980e(0xcd))/0xc);if(_0x5aa7b7===_0x488d18)break;else _0x3a809e['push'](_0x3a809e['shift']());}catch(_0x36f72f){_0x3a809e['push'](_0x3a809e['shift']());}}}(_0x4013,0x69115));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Cycle']=void 0x0;const errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),telemetry_1=require('../telemetry'),activity_1=require('./activity');class Cycle extends activity_1['Activity']{constructor(_0x59de20,_0x16cbdf,_0x330027,_0x288698,_0x3c5134,_0x27623b){super(_0x59de20,_0x16cbdf,_0x330027,_0x288698,_0x3c5134,_0x27623b);}async['process'](){this['logger']['debug']('cycle-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x48ab01;try{await this['verifyEntry'](),_0x48ab01=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x48ab01['startActivitySpan'](this['leg']),this['mapInputData']();let _0x4e8bbc=this['store']['transact']();await this['setState'](_0x4e8bbc),await this['setStatus'](0x0,_0x4e8bbc);const _0x41e52f=await _0x4e8bbc['exec']();_0x48ab01['mapActivityAttributes']();const _0xf1821c=this['resolveStatus'](_0x41e52f);_0x4e8bbc=this['store']['transact']();const _0x531036=await this['cycleAncestorActivity'](_0x4e8bbc);return _0x48ab01['setActivityAttributes']({'app.activity.mid':_0x531036,'app.job.jss':_0xf1821c}),await collator_1['CollatorService']['notarizeEarlyExit'](this,_0x4e8bbc),await _0x4e8bbc['exec'](),this['context']['metadata']['aid'];}catch(_0x26b5e1){if(_0x26b5e1 instanceof errors_1['InactiveJobError']){this['logger']['error']('cycle-inactive-job-error',{..._0x26b5e1});return;}else{if(_0x26b5e1 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x26b5e1});return;}else{if(_0x26b5e1 instanceof errors_1['GetStateError']){this['logger']['error']('cycle-get-state-error',{..._0x26b5e1});return;}else{if(_0x26b5e1 instanceof errors_1['CollationError']){if(_0x26b5e1['fault']==='duplicate'){this['logger']['info']('cycle-collation-overage',{'job_id':this['context']['metadata']['jid'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('cycle-collation-error',{..._0x26b5e1});}else this['logger']['error']('cycle-process-error',{..._0x26b5e1});}}}_0x48ab01?.['setActivityError'](_0x26b5e1['message']);throw _0x26b5e1;}finally{_0x48ab01?.['endActivitySpan'](),this['logger']['debug']('cycle-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['cycleAncestorActivity'](_0x43f7a6){this['mapInputData']();const _0x5ed688={'metadata':{'guid':(0x0,utils_1['guid'])(),'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'dad':collator_1['CollatorService']['resolveReentryDimension'](this),'aid':this['config']['ancestor'],'spn':this['context']['$self']['output']['metadata']?.['l1s'],'trc':this['context']['metadata']['trc']},'data':this['context']['data']};return await this['engine']['router']?.['publishMessage'](null,_0x5ed688,_0x43f7a6);}}exports['Cycle']=Cycle;function _0x4013(){const _0xe9a004=['608289dstVxo','54BrwqCr','5nAcXmh','1636504agEOPM','419886MnhaBD','160JBhVvT','228668sccFzZ','669236tWTuSx','108CUQdsO','4283824oPQboH','3SWYtZB','616259IleqUZ'];_0x4013=function(){return _0xe9a004;};return _0x4013();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x186ff1,_0x15eb98){const _0x4ae28a=_0x445f,_0x16be9b=_0x186ff1();while(!![]){try{const _0x4aafe2=parseInt(_0x4ae28a(0x6e))/0x1*(parseInt(_0x4ae28a(0x6f))/0x2)+-parseInt(_0x4ae28a(0x68))/0x3*(parseInt(_0x4ae28a(0x6b))/0x4)+-parseInt(_0x4ae28a(0x6c))/0x5*(-parseInt(_0x4ae28a(0x69))/0x6)+parseInt(_0x4ae28a(0x66))/0x7+-parseInt(_0x4ae28a(0x67))/0x8+-parseInt(_0x4ae28a(0x6d))/0x9*(-parseInt(_0x4ae28a(0x6a))/0xa)+-parseInt(_0x4ae28a(0x65))/0xb*(parseInt(_0x4ae28a(0x64))/0xc);if(_0x4aafe2===_0x15eb98)break;else _0x16be9b['push'](_0x16be9b['shift']());}catch(_0x4cf0fc){_0x16be9b['push'](_0x16be9b['shift']());}}}(_0x1b20,0xac0f6));function _0x445f(_0x15da60,_0x524ac2){const _0x1b20ca=_0x1b20();return _0x445f=function(_0x445f9b,_0x384e35){_0x445f9b=_0x445f9b-0x64;let _0xb2030c=_0x1b20ca[_0x445f9b];return _0xb2030c;},_0x445f(_0x15da60,_0x524ac2);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Hook']=void 0x0;const enums_1=require('../../modules/enums'),errors_1=require('../../modules/errors'),collator_1=require('../collator'),pipe_1=require('../pipe'),task_1=require('../task'),telemetry_1=require('../telemetry'),stream_1=require('../../types/stream'),activity_1=require('./activity');class Hook extends activity_1['Activity']{constructor(_0xd0d905,_0x119e9b,_0x1088a3,_0x4e030c,_0x2cb517,_0x26dc39){super(_0xd0d905,_0x119e9b,_0x1088a3,_0x4e030c,_0x2cb517,_0x26dc39);}async['process'](){this['logger']['debug']('hook-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x4406cb;try{return await this['verifyEntry'](),_0x4406cb=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x4406cb['startActivitySpan'](this['leg']),this['doesHook']()?await this['doHook'](_0x4406cb):await this['doPassThrough'](_0x4406cb),this['context']['metadata']['aid'];}catch(_0x7091c7){if(_0x7091c7 instanceof errors_1['InactiveJobError']){this['logger']['error']('hook-inactive-job-error',{..._0x7091c7});return;}else{if(_0x7091c7 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x7091c7});return;}else{if(_0x7091c7 instanceof errors_1['GetStateError']){this['logger']['error']('hook-get-state-error',{..._0x7091c7});return;}else{if(_0x7091c7 instanceof errors_1['CollationError']){if(_0x7091c7['fault']==='duplicate'){this['logger']['info']('hook-collation-overage',{'job_id':this['context']['metadata']['jid'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('hook-collation-error',{..._0x7091c7});}else this['logger']['error']('hook-process-error',{..._0x7091c7});}}}_0x4406cb?.['setActivityError'](_0x7091c7['message']);throw _0x7091c7;}finally{_0x4406cb?.['endActivitySpan'](),this['logger']['debug']('hook-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}['doesHook'](){if(this['config']['sleep']){const _0x3177ed=pipe_1['Pipe']['resolve'](this['config']['sleep'],this['context']);return!isNaN(_0x3177ed)&&Number(_0x3177ed)>0x0;}return!!this['config']['hook']?.['topic'];}async['doHook'](_0x270fbf){const _0x5ce5c8=this['store']['transact']();await this['registerHook'](enums_1['HMSH_IS_CLUSTER']?undefined:_0x5ce5c8),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x5ce5c8),await collator_1['CollatorService']['authorizeReentry'](this,_0x5ce5c8),await this['setStatus'](0x0,_0x5ce5c8),await _0x5ce5c8['exec'](),_0x270fbf['mapActivityAttributes']();}async['doPassThrough'](_0x23f391){const _0x485235=this['store']['transact']();let _0x27379c;this['adjacencyList']=await this['filterAdjacent'](),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x485235),await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x485235),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x485235),_0x27379c=await _0x485235['exec'](),_0x23f391['mapActivityAttributes']();const _0x2f1084=this['resolveStatus'](_0x27379c),_0x42e7a7={'app.job.jss':_0x2f1084},_0x40353f=await this['transition'](this['adjacencyList'],_0x2f1084);_0x40353f['length']&&(_0x42e7a7['app.activity.mids']=_0x40353f['join'](',')),_0x23f391['setActivityAttributes'](_0x42e7a7);}async['getHookRule'](_0x293f91){const _0x15dd5b=await this['store']['getHookRules']();return _0x15dd5b?.[_0x293f91]?.[0x0];}async['registerHook'](_0x322518){if(this['config']['hook']?.['topic'])return await this['engine']['taskService']['registerWebHook'](this['config']['hook']['topic'],this['context'],this['resolveDad'](),this['context']['metadata']['expire'],_0x322518);else{if(this['config']['sleep']){const _0x4c8610=pipe_1['Pipe']['resolve'](this['config']['sleep'],this['context']);return await this['engine']['taskService']['registerTimeHook'](this['context']['metadata']['jid'],this['context']['metadata']['gid'],''+this['metadata']['aid']+(this['metadata']['dad']||''),'sleep',_0x4c8610,this['metadata']['dad']||''),this['context']['metadata']['jid'];}}}async['processWebHookEvent'](_0x1388c2=stream_1['StreamStatus']['SUCCESS'],_0x1abd8a=0xc8){this['logger']['debug']('hook-process-web-hook-event',{'topic':this['config']['hook']['topic'],'aid':this['metadata']['aid'],'status':_0x1388c2,'code':_0x1abd8a});const _0x576623=new task_1['TaskService'](this['store'],this['logger']),_0x3256ac={...this['data']},_0x590532=await _0x576623['processWebHookSignal'](this['config']['hook']['topic'],_0x3256ac);if(_0x590532){const [_0x187d8b,_0x20f0cd,_0x47f180,_0x52e6e6]=_0x590532;this['context']['metadata']['jid']=_0x187d8b,this['context']['metadata']['gid']=_0x52e6e6,this['context']['metadata']['dad']=_0x47f180,await this['processEvent'](_0x1388c2,_0x1abd8a,'hook'),_0x1abd8a===0xc8&&await _0x576623['deleteWebHookSignal'](this['config']['hook']['topic'],_0x3256ac);}}async['processTimeHookEvent'](_0xfc977c){this['logger']['debug']('hook-process-time-hook-event',{'jid':_0xfc977c,'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']}),await this['processEvent'](stream_1['StreamStatus']['SUCCESS'],0xc8,'hook');}}function _0x1b20(){const _0x44e9e6=['20bkpgMk','15daILLi','83133xGjBQh','189722zydgTa','4KAwLkX','6644412gJZftt','11rPaxxB','4953564uvrGxu','3541656MhobTh','141633MGEUmK','111486NpDyAQ','860NPCYxm'];_0x1b20=function(){return _0x44e9e6;};return _0x1b20();}exports['Hook']=Hook;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';(function(_0x5625ea,_0x1e2a3f){const _0x12db84=_0x28bd,_0x5166e8=_0x5625ea();while(!![]){try{const _0x673e82=-parseInt(_0x12db84(0x91))/0x1*(-parseInt(_0x12db84(0x8e))/0x2)+-parseInt(_0x12db84(0x8f))/0x3+parseInt(_0x12db84(0x97))/0x4*(-parseInt(_0x12db84(0x96))/0x5)+parseInt(_0x12db84(0x93))/0x6*(parseInt(_0x12db84(0x95))/0x7)+parseInt(_0x12db84(0x98))/0x8*(parseInt(_0x12db84(0x8d))/0x9)+-parseInt(_0x12db84(0x92))/0xa+-parseInt(_0x12db84(0x94))/0xb*(-parseInt(_0x12db84(0x90))/0xc);if(_0x673e82===_0x1e2a3f)break;else _0x5166e8['push'](_0x5166e8['shift']());}catch(_0x4cb87f){_0x5166e8['push'](_0x5166e8['shift']());}}}(_0x4378,0x7e1cd));function _0x4378(){const _0x3299b2=['2883219VTMWwd','409824GnGDJE','1bIYxSw','1162820ENRaoT','12JgDAoV','297OpqUVm','2301803CLTsZp','385lIXJAY','51268FiEfRl','16ImOwNJ','3886380nfNmBH','274838syahxC'];_0x4378=function(){return _0x3299b2;};return _0x4378();}Object['defineProperty'](exports,'__esModule',{'value':!![]});function _0x28bd(_0x139417,_0x52e93a){const _0x43787e=_0x4378();return _0x28bd=function(_0x28bdec,_0x1de33d){_0x28bdec=_0x28bdec-0x8d;let _0x573393=_0x43787e[_0x28bdec];return _0x573393;},_0x28bd(_0x139417,_0x52e93a);}const activity_1=require('./activity'),await_1=require('./await'),cycle_1=require('./cycle'),hook_1=require('./hook'),interrupt_1=require('./interrupt'),signal_1=require('./signal'),trigger_1=require('./trigger'),worker_1=require('./worker');exports['default']={'activity':activity_1['Activity'],'await':await_1['Await'],'cycle':cycle_1['Cycle'],'hook':hook_1['Hook'],'interrupt':interrupt_1['Interrupt'],'signal':signal_1['Signal'],'trigger':trigger_1['Trigger'],'worker':worker_1['Worker']};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x216533,_0x252bde){const _0x568a0e=_0x3687,_0x373f18=_0x216533();while(!![]){try{const _0x474fa=-parseInt(_0x568a0e(0x161))/0x1+parseInt(_0x568a0e(0x160))/0x2+parseInt(_0x568a0e(0x15d))/0x3+-parseInt(_0x568a0e(0x163))/0x4*(-parseInt(_0x568a0e(0x15b))/0x5)+-parseInt(_0x568a0e(0x15f))/0x6+-parseInt(_0x568a0e(0x15e))/0x7+parseInt(_0x568a0e(0x162))/0x8*(parseInt(_0x568a0e(0x15c))/0x9);if(_0x474fa===_0x252bde)break;else _0x373f18['push'](_0x373f18['shift']());}catch(_0x5d55fc){_0x373f18['push'](_0x373f18['shift']());}}}(_0x3d50,0xee09c));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Interrupt']=void 0x0;const errors_1=require('../../modules/errors'),collator_1=require('../collator'),pipe_1=require('../pipe'),telemetry_1=require('../telemetry'),activity_1=require('./activity');class Interrupt extends activity_1['Activity']{constructor(_0x451e55,_0x5e202b,_0x1fbdd4,_0x592677,_0x57439c,_0x1892c6){super(_0x451e55,_0x5e202b,_0x1fbdd4,_0x592677,_0x57439c,_0x1892c6);}async['process'](){this['logger']['debug']('interrupt-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0xcab302;try{await this['verifyEntry'](),_0xcab302=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0xcab302['startActivitySpan'](this['leg']),this['isInterruptingSelf']()?await this['interruptSelf'](_0xcab302):await this['interruptAnother'](_0xcab302);}catch(_0x5e9696){if(_0x5e9696 instanceof errors_1['InactiveJobError']){this['logger']['error']('interrupt-inactive-job-error',{..._0x5e9696});return;}else{if(_0x5e9696 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x5e9696});return;}else{if(_0x5e9696 instanceof errors_1['GetStateError']){this['logger']['error']('interrupt-get-state-error',{..._0x5e9696});return;}else{if(_0x5e9696 instanceof errors_1['CollationError']){if(_0x5e9696['fault']==='duplicate'){this['logger']['info']('interrupt-collation-overage',{'job_id':this['context']['metadata']['jid'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('interrupt-collation-error',{..._0x5e9696});}else this['logger']['error']('interrupt-process-error',{..._0x5e9696});}}}_0xcab302?.['setActivityError'](_0x5e9696['message']);throw _0x5e9696;}finally{_0xcab302?.['endActivitySpan'](),this['logger']['debug']('interrupt-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}async['interruptSelf'](_0x3ffb41){this['config']['job']?.['maps']&&(this['mapJobData'](),await this['setState']());const _0x475ebf=await this['interrupt']();_0x3ffb41['mapActivityAttributes']();const _0x172ba8=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x172ba8),await this['setStatus'](-0x1,_0x172ba8);const _0x82e82e=await _0x172ba8['exec'](),_0x1dd500=this['resolveStatus'](_0x82e82e);return _0x3ffb41['setActivityAttributes']({'app.activity.mid':_0x475ebf,'app.job.jss':_0x1dd500}),this['context']['metadata']['aid'];}async['interruptAnother'](_0x130c1a){const _0x15b60d=await this['interrupt'](),_0x58054b={'app.activity.mid':_0x15b60d};_0x130c1a['mapActivityAttributes'](),this['adjacencyList']=await this['filterAdjacent']();if(this['config']['job']?.['maps']||this['config']['output']?.['maps']){this['mapOutputData'](),this['mapJobData']();const _0x211e57=this['store']['transact']();await this['setState'](_0x211e57);}const _0x37d46c=this['store']['transact']();await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x37d46c),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x37d46c);const _0x41b7ea=await _0x37d46c['exec'](),_0x2d24c8=this['resolveStatus'](_0x41b7ea);_0x58054b['app.job.jss']=_0x2d24c8;const _0x4c9ef0=await this['transition'](this['adjacencyList'],_0x2d24c8);return _0x4c9ef0['length']&&(_0x58054b['app.activity.mids']=_0x4c9ef0['join'](',')),_0x130c1a['setActivityAttributes'](_0x58054b),this['context']['metadata']['aid'];}['isInterruptingSelf'](){if(!this['config']['target'])return!![];const _0x1ae083=pipe_1['Pipe']['resolve'](this['config']['target'],this['context']);return _0x1ae083==this['context']['metadata']['jid'];}['resolveInterruptOptions'](){return{'reason':this['config']['reason']!==undefined?pipe_1['Pipe']['resolve'](this['config']['reason'],this['context']):undefined,'throw':this['config']['throw']!==undefined?pipe_1['Pipe']['resolve'](this['config']['throw'],this['context']):undefined,'descend':this['config']['descend']!==undefined?pipe_1['Pipe']['resolve'](this['config']['descend'],this['context']):undefined,'code':this['config']['code']!==undefined?pipe_1['Pipe']['resolve'](this['config']['code'],this['context']):undefined,'expire':this['config']['expire']!==undefined?pipe_1['Pipe']['resolve'](this['config']['expire'],this['context']):undefined,'stack':this['config']['stack']!==undefined?pipe_1['Pipe']['resolve'](this['config']['stack'],this['context']):undefined};}async['interrupt'](){const _0x412b10=this['resolveInterruptOptions']();return await this['engine']['interrupt'](this['config']['topic']!==undefined?pipe_1['Pipe']['resolve'](this['config']['topic'],this['context']):this['context']['metadata']['tpc'],this['config']['target']!==undefined?pipe_1['Pipe']['resolve'](this['config']['target'],this['context']):this['context']['metadata']['jid'],_0x412b10);}}function _0x3687(_0x5c1478,_0x3296ef){const _0x3d5092=_0x3d50();return _0x3687=function(_0x3687e1,_0x820896){_0x3687e1=_0x3687e1-0x15b;let _0x3ad33e=_0x3d5092[_0x3687e1];return _0x3ad33e;},_0x3687(_0x5c1478,_0x3296ef);}exports['Interrupt']=Interrupt;function _0x3d50(){const _0x310358=['26636aLWZwe','635QAnoIN','90621fVXcbb','2914674BWRxhR','11493832LjjjIo','1939194eEqzkI','1383968VdjHVi','1945340FoKwvF','1888RwMOHj'];_0x3d50=function(){return _0x310358;};return _0x3d50();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';(function(_0x3aa64a,_0x1fcb13){const _0x284e77=_0x2dc6,_0x5a5e5e=_0x3aa64a();while(!![]){try{const _0x1914bf=parseInt(_0x284e77(0x96))/0x1*(-parseInt(_0x284e77(0x93))/0x2)+parseInt(_0x284e77(0x8f))/0x3*(parseInt(_0x284e77(0x8e))/0x4)+parseInt(_0x284e77(0x95))/0x5*(-parseInt(_0x284e77(0x97))/0x6)+parseInt(_0x284e77(0x98))/0x7+-parseInt(_0x284e77(0x91))/0x8*(-parseInt(_0x284e77(0x90))/0x9)+parseInt(_0x284e77(0x92))/0xa+-parseInt(_0x284e77(0x94))/0xb;if(_0x1914bf===_0x1fcb13)break;else _0x5a5e5e['push'](_0x5a5e5e['shift']());}catch(_0x3bbbaa){_0x5a5e5e['push'](_0x5a5e5e['shift']());}}}(_0x502e,0xcf404));function _0x2dc6(_0x5441a5,_0x165958){const _0x502e27=_0x502e();return _0x2dc6=function(_0x2dc65c,_0x3b003b){_0x2dc65c=_0x2dc65c-0x8e;let _0x24d4e9=_0x502e27[_0x2dc65c];return _0x24d4e9;},_0x2dc6(_0x5441a5,_0x165958);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Signal']=void 0x0;const errors_1=require('../../modules/errors'),collator_1=require('../collator'),mapper_1=require('../mapper'),pipe_1=require('../pipe'),telemetry_1=require('../telemetry'),activity_1=require('./activity');function _0x502e(){const _0x35fa01=['9wvxhYa','11807192VIEBgX','3991180fulIgb','4PFkWtO','4932774PBgJXw','17445VJQxIh','501617xpWBjx','1242IsBQNy','1409793PJFLYo','11300gCzjbp','1005RmicAu'];_0x502e=function(){return _0x35fa01;};return _0x502e();}class Signal extends activity_1['Activity']{constructor(_0x59bf0e,_0x33927a,_0x3152c7,_0x68807,_0x25d01a,_0x418f41){super(_0x59bf0e,_0x33927a,_0x3152c7,_0x68807,_0x25d01a,_0x418f41);}async['process'](){this['logger']['debug']('signal-process',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});let _0x2af127;try{await this['verifyEntry'](),_0x2af127=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x2af127['startActivitySpan'](this['leg']);const _0x7bd752=this['store']['transact']();this['adjacencyList']=await this['filterAdjacent'](),this['mapOutputData'](),this['mapJobData'](),await this['setState'](_0x7bd752),await collator_1['CollatorService']['notarizeEarlyCompletion'](this,_0x7bd752),await this['setStatus'](this['adjacencyList']['length']-0x1,_0x7bd752);const _0x470ca1=await _0x7bd752['exec']();this['config']['subtype']==='all'?await this['hookAll']():await this['hookOne']();const _0x5bcb86=this['resolveStatus'](_0x470ca1),_0x2a17fe={'app.job.jss':_0x5bcb86},_0x46dff3=await this['transition'](this['adjacencyList'],_0x5bcb86);return _0x46dff3['length']&&(_0x2a17fe['app.activity.mids']=_0x46dff3['join'](',')),_0x2af127['mapActivityAttributes'](),_0x2af127['setActivityAttributes'](_0x2a17fe),this['context']['metadata']['aid'];}catch(_0x474236){if(_0x474236 instanceof errors_1['InactiveJobError']){this['logger']['error']('signal-inactive-job-error',{..._0x474236});return;}else{if(_0x474236 instanceof errors_1['GenerationalError']){this['logger']['info']('process-event-generational-job-error',{..._0x474236});return;}else{if(_0x474236 instanceof errors_1['GetStateError']){this['logger']['error']('signal-get-state-error',{..._0x474236});return;}else{if(_0x474236 instanceof errors_1['CollationError']){if(_0x474236['fault']==='duplicate'){this['logger']['info']('signal-collation-overage',{'job_id':this['context']['metadata']['jid'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('signal-collation-error',{..._0x474236});}else this['logger']['error']('signal-process-error',{..._0x474236});}}}_0x2af127?.['setActivityError'](_0x474236['message']);throw _0x474236;}finally{_0x2af127?.['endActivitySpan'](),this['logger']['debug']('signal-process-end',{'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid'],'aid':this['metadata']['aid']});}}['mapSignalData'](){if(this['config']['signal']?.['maps']){const _0x33c5cf=new mapper_1['MapperService'](this['config']['signal']['maps'],this['context']);return _0x33c5cf['mapRules']();}}['mapResolverData'](){if(this['config']['resolver']?.['maps']){const _0x6d42dc=new mapper_1['MapperService'](this['config']['resolver']['maps'],this['context']);return _0x6d42dc['mapRules']();}}async['hookOne'](){const _0x2eafba=pipe_1['Pipe']['resolve'](this['config']['topic'],this['context']),_0x1a01f3=this['mapSignalData'](),_0x29b669=pipe_1['Pipe']['resolve'](this['config']['status'],this['context']),_0x36f145=pipe_1['Pipe']['resolve'](this['config']['code'],this['context']);return await this['engine']['hook'](_0x2eafba,_0x1a01f3,_0x29b669,_0x36f145);}async['hookAll'](){const _0x290716=this['mapSignalData'](),_0x9ebf81=this['mapResolverData']();this['config']['scrub']&&(_0x9ebf81['scrub']=!![]);const _0x495518=pipe_1['Pipe']['resolve'](this['config']['key_name'],this['context']),_0x3caf15=pipe_1['Pipe']['resolve'](this['config']['key_value'],this['context']),_0x4a91d9=[_0x495518+':'+_0x3caf15];return await this['engine']['hookAll'](this['config']['topic'],_0x290716,_0x9ebf81,_0x4a91d9);}}exports['Signal']=Signal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';(function(_0x3a4baa,_0x316613){const _0x2beec8=_0x1a99,_0x556bfa=_0x3a4baa();while(!![]){try{const _0x4abf44=parseInt(_0x2beec8(0x15d))/0x1+parseInt(_0x2beec8(0x15f))/0x2+-parseInt(_0x2beec8(0x15a))/0x3+-parseInt(_0x2beec8(0x15e))/0x4+parseInt(_0x2beec8(0x15b))/0x5+parseInt(_0x2beec8(0x160))/0x6+-parseInt(_0x2beec8(0x15c))/0x7;if(_0x4abf44===_0x316613)break;else _0x556bfa['push'](_0x556bfa['shift']());}catch(_0x87286c){_0x556bfa['push'](_0x556bfa['shift']());}}}(_0x261c,0xc8de5));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['Trigger']=void 0x0;const errors_1=require('../../modules/errors'),utils_1=require('../../modules/utils'),collator_1=require('../collator'),pipe_1=require('../pipe'),reporter_1=require('../reporter'),serializer_1=require('../serializer'),telemetry_1=require('../telemetry'),activity_1=require('./activity');function _0x1a99(_0x6184e6,_0xbcf9a9){const _0x261c10=_0x261c();return _0x1a99=function(_0x1a9940,_0x16d275){_0x1a9940=_0x1a9940-0x15a;let _0x472f0d=_0x261c10[_0x1a9940];return _0x472f0d;},_0x1a99(_0x6184e6,_0xbcf9a9);}class Trigger extends activity_1['Activity']{constructor(_0x1768f0,_0x797ab2,_0x229960,_0x595599,_0x33b49d,_0x48fd06){super(_0x1768f0,_0x797ab2,_0x229960,_0x595599,_0x33b49d,_0x48fd06);}async['process'](_0x5ae93a){this['logger']['debug']('trigger-process',{'subscribes':this['config']['subscribes']});let _0x198323;try{this['setLeg'](0x2),await this['getState'](),_0x198323=new telemetry_1['TelemetryService'](this['engine']['appId'],this['config'],this['metadata'],this['context']),_0x198323['startJobSpan'](),_0x198323['startActivitySpan'](this['leg']),this['mapJobData'](),this['adjacencyList']=await this['filterAdjacent']();const _0x196660=this['initStatus'](_0x5ae93a,this['adjacencyList']['length']);await this['setStateNX'](_0x196660),await this['setStatus'](_0x196660),this['bindSearchData'](_0x5ae93a),this['bindMarkerData'](_0x5ae93a);const _0x2797eb=this['store']['transact']();await this['setState'](_0x2797eb),await this['setStats'](_0x2797eb);_0x5ae93a?.['pending']&&await this['setExpired'](_0x5ae93a?.['pending'],_0x2797eb);await collator_1['CollatorService']['notarizeInception'](this,this['context']['metadata']['guid'],_0x2797eb),await _0x2797eb['exec'](),this['execAdjacentParent'](),_0x198323['mapActivityAttributes']();const _0x20524e=Number(this['context']['metadata']['js']);_0x198323['setJobAttributes']({'app.job.jss':_0x20524e});const _0x598bb8={'app.job.jss':_0x20524e};return await this['transitionAndLogAdjacent'](_0x5ae93a,_0x20524e,_0x598bb8),_0x198323['setActivityAttributes'](_0x598bb8),this['context']['metadata']['jid'];}catch(_0xc16fb7){_0x198323?.['setActivityError'](_0xc16fb7['message']);if(_0xc16fb7 instanceof errors_1['DuplicateJobError']){await(0x0,utils_1['sleepFor'])(0x3e8);const _0x1a5325=await collator_1['CollatorService']['isInceptionOverage'](this,this['context']['metadata']['guid']);if(_0x1a5325){this['logger']['info']('trigger-collation-overage',{'job_id':_0xc16fb7['jobId'],'guid':this['context']['metadata']['guid']});return;}this['logger']['error']('duplicate-job-error',{'job_id':_0xc16fb7['jobId'],'guid':this['context']['metadata']['guid']});}else this['logger']['error']('trigger-process-error',{..._0xc16fb7});throw _0xc16fb7;}finally{_0x198323?.['endJobSpan'](),_0x198323?.['endActivitySpan'](),this['logger']['debug']('trigger-process-end',{'subscribes':this['config']['subscribes'],'jid':this['context']['metadata']['jid'],'gid':this['context']['metadata']['gid']});}}async['transitionAndLogAdjacent'](_0x4bdeb8={},_0x3d9625,_0x3b2d54){if(isNaN(_0x4bdeb8['pending'])){const _0x1252bd=await this['transition'](this['adjacencyList'],_0x3d9625);_0x1252bd['length']&&(_0x3b2d54['app.activity.mids']=_0x1252bd['join'](','));}}['initStatus'](_0x4ab7c5={},_0x944e3d){if(_0x4ab7c5['pending'])return-0x1;return _0x944e3d;}async['setExpired'](_0x10ad13,_0x321fdc){await this['store']['expireJob'](this['context']['metadata']['jid'],_0x10ad13,_0x321fdc);}['safeKey'](_0x573917){return'_'+_0x573917;}['bindSearchData'](_0x145a4d){_0x145a4d?.['search']&&Object['keys'](_0x145a4d['search'])['forEach'](_0x429260=>{this['context']['data'][this['safeKey'](_0x429260)]=_0x145a4d['search'][_0x429260]['toString']();});}['bindMarkerData'](_0x1049a4){_0x1049a4?.['marker']&&Object['keys'](_0x1049a4['marker'])['forEach'](_0x1b0e64=>{_0x1b0e64['startsWith']('-')&&(this['context']['data'][_0x1b0e64]=_0x1049a4['marker'][_0x1b0e64]['toString']());});}async['setStatus'](_0x7b8474){this['context']['metadata']['js']=_0x7b8474;}async['execAdjacentParent'](){if(this['context']['metadata']['px']){const _0x30b992=(0x0,utils_1['formatISODate'])(new Date()),_0x223a87={'metadata':this['context']['metadata'],'data':{'job_id':this['context']['metadata']['jid'],'jc':_0x30b992,'ju':_0x30b992}};await this['engine']['execAdjacentParent'](this['context'],_0x223a87);}}['createInputContext'](){const _0x24c167={[this['metadata']['aid']]:{'input':{'data':this['data']}},'$self':{'input':{'data':this['data']},'output':{'data':this['data']}}};return _0x24c167;}async['getState'](){const _0x1423a4=this['createInputContext'](),_0x342b85=this['resolveJobId'](_0x1423a4),_0x4e18bf=this['resolveJobKey'](_0x1423a4),_0x18f0c9=(0x0,utils_1['formatISODate'])(new Date()),{id:_0x5ae0ba,version:_0x3ed611}=await this['engine']['getVID']();this['initDimensionalAddress'](collator_1['CollatorService']['getDimensionalSeed']());const _0x46276a={...this['metadata'],'jid':_0x342b85,'key':_0x4e18bf,'as':collator_1['CollatorService']['getTriggerSeed']()};this['context']={'metadata':{...this['metadata'],'gid':(0x0,utils_1['guid'])(),'ngn':this['context']['metadata']['ngn'],'pj':this['context']['metadata']['pj'],'pg':this['context']['metadata']['pg'],'pd':this['context']['metadata']['pd'],'pa':this['context']['metadata']['pa'],'px':this['context']['metadata']['px'],'app':_0x5ae0ba,'vrs':_0x3ed611,'tpc':this['config']['subscribes'],'trc':this['context']['metadata']['trc'],'spn':this['context']['metadata']['spn'],'guid':this['context']['metadata']['guid'],'jid':_0x342b85,'dad':collator_1['CollatorService']['getDimensionalSeed'](),'key':_0x4e18bf,'jc':_0x18f0c9,'ju':_0x18f0c9,'ts':(0x0,utils_1['getTimeSeries'])(this['resolveGranularity']()),'js':0x0},'data':{},[this['metadata']['aid']]:{'input':{'data':this['data'],'metadata':_0x46276a},'output':{'data':this['data'],'metadata':_0x46276a},'settings':{'data':{}},'errors':{'data':{}}}},this['context']['$self']=this['context'][this['metadata']['aid']],this['context']['$job']=this['context'];}['bindJobMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['JOB']['KEYS']['map'](_0x5f58fc=>'metadata/'+_0x5f58fc);}['bindActivityMetadataPaths'](){return serializer_1['MDATA_SYMBOLS']['ACTIVITY']['KEYS']['map'](_0x200a7a=>'output/metadata/'+_0x200a7a);}['resolveGranularity'](){return this['config']['stats']?.['granularity']||reporter_1['ReporterService']['DEFAULT_GRANULARITY'];}['getJobStatus'](){return this['context']['metadata']['js'];}['resolveJobId'](_0x3437d5){const _0x1bfe5e=this['config']['stats']?.['id'];return _0x1bfe5e?pipe_1['Pipe']['resolve'](_0x1bfe5e,_0x3437d5):(0x0,utils_1['guid'])();}['resolveJobKey'](_0x59fb66){const _0x6653ec=this['config']['stats']?.['key'];return _0x6653ec?pipe_1['Pipe']['resolve'](_0x6653ec,_0x59fb66):'';}async['setStateNX'](_0x518ba4){const _0x18499f=this['context']['metadata']['jid'];if(!await this['store']['setStateNX'](_0x18499f,this['engine']['appId'],_0x518ba4))throw new errors_1['DuplicateJobError'](_0x18499f);}async['setStats'](_0x31bba4){const _0x2fe63a=this['context']['metadata'];if(_0x2fe63a['key']&&this['config']['stats']?.['measures']){const _0x589199=await this['engine']['getVID'](),_0x38ab1a=new reporter_1['ReporterService'](_0x589199,this['store'],this['logger']);await this['store']['setStats'](_0x2fe63a['key'],_0x2fe63a['jid'],_0x2fe63a['ts'],_0x38ab1a['resolveTriggerStatistics'](this['config'],this['context']),_0x589199,_0x31bba4);}}}exports['Trigger']=Trigger;function _0x261c(){const _0x197401=['21251699hTGguC','1275591QXJshO','116188wRzrsJ','3215418GcxpQz','9628242DRXaAM','4581906TqyDyr','4635280Vdvcrr'];_0x261c=function(){return _0x197401;};return _0x261c();}
|