@hotmeshio/hotmesh 0.3.29 → 0.3.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/build/index.d.ts +8 -2
  2. package/build/index.js +13 -7
  3. package/build/modules/enums.d.ts +65 -1
  4. package/build/modules/enums.js +79 -5
  5. package/build/modules/key.d.ts +52 -0
  6. package/build/modules/key.js +1 -1
  7. package/build/modules/utils.d.ts +73 -0
  8. package/build/modules/utils.js +1 -1
  9. package/build/package.json +6 -4
  10. package/build/services/activities/activity.d.ts +36 -0
  11. package/build/services/activities/activity.js +1 -1
  12. package/build/services/activities/await.js +1 -1
  13. package/build/services/activities/cycle.d.ts +7 -0
  14. package/build/services/activities/cycle.js +1 -1
  15. package/build/services/activities/hook.d.ts +6 -0
  16. package/build/services/activities/hook.js +1 -1
  17. package/build/services/activities/index.js +1 -1
  18. package/build/services/activities/interrupt.js +1 -1
  19. package/build/services/activities/signal.d.ts +6 -0
  20. package/build/services/activities/signal.js +1 -1
  21. package/build/services/activities/trigger.d.ts +7 -0
  22. package/build/services/activities/trigger.js +1 -1
  23. package/build/services/activities/worker.js +1 -1
  24. package/build/services/collator/index.d.ts +76 -0
  25. package/build/services/collator/index.js +1 -1
  26. package/build/services/compiler/deployer.js +1 -1
  27. package/build/services/compiler/index.d.ts +15 -0
  28. package/build/services/compiler/index.js +1 -1
  29. package/build/services/compiler/validator.d.ts +3 -0
  30. package/build/services/compiler/validator.js +1 -1
  31. package/build/services/connector/factory.d.ts +14 -0
  32. package/build/services/connector/factory.js +22 -2
  33. package/build/services/connector/index.d.ts +13 -1
  34. package/build/services/connector/index.js +13 -1
  35. package/build/services/connector/providers/postgres.js +7 -0
  36. package/build/services/engine/index.d.ts +162 -0
  37. package/build/services/engine/index.js +1 -1
  38. package/build/services/exporter/index.d.ts +27 -0
  39. package/build/services/exporter/index.js +1 -1
  40. package/build/services/hotmesh/index.d.ts +280 -0
  41. package/build/services/hotmesh/index.js +286 -0
  42. package/build/services/logger/index.js +1 -0
  43. package/build/services/mapper/index.d.ts +14 -0
  44. package/build/services/mapper/index.js +1 -1
  45. package/build/services/meshcall/index.d.ts +171 -0
  46. package/build/services/meshcall/index.js +190 -0
  47. package/build/services/meshcall/schemas/factory.d.ts +7 -0
  48. package/build/services/meshcall/schemas/factory.js +7 -0
  49. package/build/services/meshdata/index.d.ts +725 -3
  50. package/build/services/meshdata/index.js +689 -3
  51. package/build/services/meshflow/client.d.ts +89 -0
  52. package/build/services/meshflow/client.js +173 -4
  53. package/build/services/meshflow/connection.d.ts +17 -0
  54. package/build/services/meshflow/connection.js +17 -0
  55. package/build/services/meshflow/exporter.d.ts +22 -0
  56. package/build/services/meshflow/exporter.js +1 -1
  57. package/build/services/meshflow/handle.d.ts +68 -0
  58. package/build/services/meshflow/handle.js +75 -0
  59. package/build/services/meshflow/index.d.ts +92 -0
  60. package/build/services/meshflow/index.js +92 -0
  61. package/build/services/meshflow/schemas/factory.d.ts +25 -0
  62. package/build/services/meshflow/schemas/factory.js +26 -1
  63. package/build/services/meshflow/search.d.ts +120 -0
  64. package/build/services/meshflow/search.js +108 -0
  65. package/build/services/meshflow/worker.d.ts +97 -0
  66. package/build/services/meshflow/worker.js +116 -2
  67. package/build/services/meshflow/workflow/all.d.ts +6 -0
  68. package/build/services/meshflow/workflow/all.js +7 -0
  69. package/build/services/meshflow/workflow/context.d.ts +4 -0
  70. package/build/services/meshflow/workflow/context.js +4 -0
  71. package/build/services/meshflow/workflow/didRun.d.ts +6 -0
  72. package/build/services/meshflow/workflow/didRun.js +6 -0
  73. package/build/services/meshflow/workflow/emit.d.ts +7 -0
  74. package/build/services/meshflow/workflow/emit.js +7 -0
  75. package/build/services/meshflow/workflow/enrich.d.ts +7 -0
  76. package/build/services/meshflow/workflow/enrich.js +7 -0
  77. package/build/services/meshflow/workflow/execChild.d.ts +14 -0
  78. package/build/services/meshflow/workflow/execChild.js +18 -0
  79. package/build/services/meshflow/workflow/hook.d.ts +7 -0
  80. package/build/services/meshflow/workflow/hook.js +7 -0
  81. package/build/services/meshflow/workflow/index.d.ts +31 -0
  82. package/build/services/meshflow/workflow/index.js +31 -0
  83. package/build/services/meshflow/workflow/interrupt.d.ts +7 -0
  84. package/build/services/meshflow/workflow/interrupt.js +7 -0
  85. package/build/services/meshflow/workflow/isSideEffectAllowed.d.ts +8 -0
  86. package/build/services/meshflow/workflow/isSideEffectAllowed.js +8 -0
  87. package/build/services/meshflow/workflow/proxyActivities.d.ts +14 -0
  88. package/build/services/meshflow/workflow/proxyActivities.js +18 -3
  89. package/build/services/meshflow/workflow/random.d.ts +5 -0
  90. package/build/services/meshflow/workflow/random.js +5 -0
  91. package/build/services/meshflow/workflow/searchMethods.d.ts +4 -0
  92. package/build/services/meshflow/workflow/searchMethods.js +4 -0
  93. package/build/services/meshflow/workflow/signal.d.ts +6 -0
  94. package/build/services/meshflow/workflow/signal.js +6 -0
  95. package/build/services/meshflow/workflow/sleepFor.d.ts +7 -0
  96. package/build/services/meshflow/workflow/sleepFor.js +7 -0
  97. package/build/services/meshflow/workflow/trace.d.ts +10 -0
  98. package/build/services/meshflow/workflow/trace.js +10 -0
  99. package/build/services/meshflow/workflow/waitFor.d.ts +7 -0
  100. package/build/services/meshflow/workflow/waitFor.js +7 -0
  101. package/build/services/meshos/index.d.ts +213 -2
  102. package/build/services/meshos/index.js +221 -1
  103. package/build/services/pipe/functions/array.js +1 -1
  104. package/build/services/pipe/functions/bitwise.js +1 -1
  105. package/build/services/pipe/functions/conditional.js +1 -1
  106. package/build/services/pipe/functions/cron.d.ts +6 -0
  107. package/build/services/pipe/functions/cron.js +1 -1
  108. package/build/services/pipe/functions/date.d.ts +7 -0
  109. package/build/services/pipe/functions/date.js +1 -1
  110. package/build/services/pipe/functions/index.js +1 -1
  111. package/build/services/pipe/functions/json.js +1 -1
  112. package/build/services/pipe/functions/logical.js +1 -1
  113. package/build/services/pipe/functions/math.js +1 -1
  114. package/build/services/pipe/functions/number.js +1 -1
  115. package/build/services/pipe/functions/object.js +1 -1
  116. package/build/services/pipe/functions/string.js +1 -1
  117. package/build/services/pipe/functions/symbol.js +1 -1
  118. package/build/services/pipe/functions/unary.js +1 -1
  119. package/build/services/pipe/index.d.ts +15 -0
  120. package/build/services/pipe/index.js +1 -1
  121. package/build/services/quorum/index.d.ts +49 -0
  122. package/build/services/quorum/index.js +1 -1
  123. package/build/services/reporter/index.d.ts +5 -0
  124. package/build/services/reporter/index.js +1 -1
  125. package/build/services/router/index.d.ts +10 -0
  126. package/build/services/router/index.js +1 -1
  127. package/build/services/search/providers/postgres/postgres.d.ts +3 -0
  128. package/build/services/search/providers/postgres/postgres.js +1 -1
  129. package/build/services/search/providers/redis/ioredis.js +1 -1
  130. package/build/services/search/providers/redis/redis.js +1 -1
  131. package/build/services/serializer/index.js +1 -1
  132. package/build/services/store/cache.d.ts +19 -0
  133. package/build/services/store/cache.js +19 -0
  134. package/build/services/store/factory.js +1 -1
  135. package/build/services/store/providers/postgres/kvsql.d.ts +7 -0
  136. package/build/services/store/providers/postgres/kvsql.js +1 -1
  137. package/build/services/store/providers/postgres/kvtables.d.ts +4 -0
  138. package/build/services/store/providers/postgres/kvtables.js +1 -1
  139. package/build/services/store/providers/postgres/kvtransaction.js +1 -1
  140. package/build/services/store/providers/postgres/kvtypes/hash.d.ts +4 -0
  141. package/build/services/store/providers/postgres/kvtypes/hash.js +1 -1
  142. package/build/services/store/providers/postgres/kvtypes/list.js +1 -1
  143. package/build/services/store/providers/postgres/kvtypes/string.js +1 -1
  144. package/build/services/store/providers/postgres/kvtypes/zset.js +1 -1
  145. package/build/services/store/providers/postgres/postgres.d.ts +48 -1
  146. package/build/services/store/providers/postgres/postgres.js +1 -1
  147. package/build/services/store/providers/redis/_base.d.ts +42 -0
  148. package/build/services/store/providers/redis/_base.js +1 -1
  149. package/build/services/store/providers/redis/ioredis.d.ts +8 -0
  150. package/build/services/store/providers/redis/ioredis.js +1 -1
  151. package/build/services/store/providers/redis/redis.d.ts +6 -0
  152. package/build/services/store/providers/redis/redis.js +1 -1
  153. package/build/services/store/providers/store-initializable.js +1 -1
  154. package/build/services/stream/factory.js +2 -1
  155. package/build/services/stream/index.d.ts +4 -0
  156. package/build/services/stream/providers/nats/nats.js +1 -1
  157. package/build/services/stream/providers/postgres/kvtables.js +1 -1
  158. package/build/services/stream/providers/postgres/postgres.d.ts +21 -0
  159. package/build/services/stream/providers/postgres/postgres.js +1 -1
  160. package/build/services/stream/providers/redis/ioredis.js +1 -1
  161. package/build/services/stream/providers/redis/redis.js +1 -1
  162. package/build/services/stream/providers/stream-initializable.js +1 -1
  163. package/build/services/sub/providers/nats/nats.js +1 -1
  164. package/build/services/sub/providers/postgres/postgres.js +1 -1
  165. package/build/services/sub/providers/redis/ioredis.js +1 -1
  166. package/build/services/sub/providers/redis/redis.js +1 -1
  167. package/build/services/task/index.d.ts +9 -0
  168. package/build/services/task/index.js +1 -1
  169. package/build/services/telemetry/index.d.ts +7 -0
  170. package/build/services/telemetry/index.js +1 -1
  171. package/build/services/worker/index.d.ts +37 -0
  172. package/build/services/worker/index.js +1 -1
  173. package/build/types/activity.d.ts +81 -0
  174. package/build/types/exporter.d.ts +13 -0
  175. package/build/types/hotmesh.d.ts +144 -0
  176. package/build/types/hotmesh.js +3 -0
  177. package/build/types/job.d.ts +101 -0
  178. package/build/types/manifest.d.ts +8 -0
  179. package/build/types/meshcall.d.ts +148 -0
  180. package/build/types/meshdata.d.ts +193 -0
  181. package/build/types/meshflow.d.ts +297 -0
  182. package/build/types/nats.d.ts +55 -0
  183. package/build/types/pipe.d.ts +65 -0
  184. package/build/types/provider.d.ts +43 -0
  185. package/build/types/quorum.d.ts +12 -0
  186. package/build/types/redis.d.ts +6 -0
  187. package/build/types/stream.d.ts +65 -0
  188. package/build/types/stream.js +4 -0
  189. package/index.ts +8 -1
  190. package/package.json +6 -4
  191. package/types/manifest.ts +2 -2
  192. package/types/meshcall.ts +1 -2
  193. package/types/meshdata.ts +1 -1
@@ -2,6 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AbstractConnection = void 0;
4
4
  const logger_1 = require("../logger");
5
+ /**
6
+ * Abstract class for creating connections to different backend providers.
7
+ * All implementations should extend this class and implement
8
+ * the following steps:
9
+ *
10
+ * 1) Add the provider to ./providers/<name>.ts
11
+ * 2) Update ./factory.ts to reference the provider
12
+ * 3) Register the tag with the `Provider` type in ./types/provider.ts.
13
+ * 4) Create the specific provider type file at ./types/<name>.ts
14
+ * 5) Update ./modules/utils.ts (identifyProvider) with logic to resolve the provider by inspecting the class/import
15
+ */
5
16
  class AbstractConnection {
6
17
  constructor() {
7
18
  this.connection = null;
@@ -16,7 +27,8 @@ class AbstractConnection {
16
27
  AbstractConnection.instances.delete(this.id);
17
28
  }
18
29
  }
19
- static async connect(id, client, options, config) {
30
+ static async connect(id, client, options, //user
31
+ config) {
20
32
  if (AbstractConnection.instances.has(id)) {
21
33
  return AbstractConnection.instances.get(id);
22
34
  }
@@ -20,18 +20,22 @@ class PostgresConnection extends __1.AbstractConnection {
20
20
  let connection;
21
21
  if (config.provider === 'postgres.poolclient' ||
22
22
  PostgresConnection.isPoolClient(clientConstructor)) {
23
+ // It's a PoolClient
23
24
  connection = clientConstructor;
24
25
  if (config.connect) {
25
26
  const client = await clientConstructor.connect();
27
+ //register the connection singularly to be 'released' later
26
28
  PostgresConnection.poolClientInstances.add(client);
27
29
  this.poolClientInstance = client;
28
30
  }
29
31
  }
30
32
  else {
33
+ // It's a Client
31
34
  connection = new clientConstructor(options);
32
35
  await connection.connect();
33
36
  await connection.query('SELECT 1');
34
37
  }
38
+ //register the connection statically to be 'ended' later
35
39
  PostgresConnection.connectionInstances.add(connection);
36
40
  return connection;
37
41
  }
@@ -72,6 +76,7 @@ class PostgresConnection extends __1.AbstractConnection {
72
76
  this.connectionInstances.clear();
73
77
  }
74
78
  async closeConnection(connection) {
79
+ //no-op (handled by disconnectAll)
75
80
  }
76
81
  static isPoolClient(client) {
77
82
  return !(isNaN(client?.totalCount) && isNaN(client?.idleCount));
@@ -91,5 +96,7 @@ class PostgresConnection extends __1.AbstractConnection {
91
96
  }
92
97
  }
93
98
  exports.PostgresConnection = PostgresConnection;
99
+ //statically track all clients (//call 'release')
94
100
  PostgresConnection.poolClientInstances = new Set();
101
+ //statically track all connections (//call 'end')
95
102
  PostgresConnection.connectionInstances = new Set();
@@ -44,59 +44,221 @@ declare class EngineService {
44
44
  reporting: boolean;
45
45
  jobId: number;
46
46
  inited: string;
47
+ /**
48
+ * @private
49
+ */
47
50
  constructor();
51
+ /**
52
+ * @private
53
+ */
48
54
  static init(namespace: string, appId: string, guid: string, config: HotMeshConfig, logger: ILogger): Promise<EngineService>;
55
+ /**
56
+ * @private
57
+ */
49
58
  verifyEngineFields(config: HotMeshConfig): void;
59
+ /**
60
+ * @private
61
+ */
50
62
  initSearchChannel(search: ProviderClient, store?: ProviderClient): Promise<void>;
63
+ /**
64
+ * @private
65
+ */
51
66
  initStoreChannel(store: ProviderClient): Promise<void>;
67
+ /**
68
+ * @private
69
+ */
52
70
  initSubChannel(sub: ProviderClient, store: ProviderClient): Promise<void>;
71
+ /**
72
+ * @private
73
+ */
53
74
  initStreamChannel(stream: ProviderClient, store: ProviderClient): Promise<void>;
75
+ /**
76
+ * @private
77
+ */
54
78
  initRouter(config: HotMeshConfig): Promise<Router<StreamService<ProviderClient, ProviderTransaction>>>;
79
+ /**
80
+ * resolves the distributed executable version using a delay
81
+ * to allow deployment race conditions to resolve
82
+ * @private
83
+ */
55
84
  fetchAndVerifyVID(vid: AppVID, count?: number): Promise<AppVID>;
56
85
  getVID(vid?: AppVID): Promise<AppVID>;
86
+ /**
87
+ * @private
88
+ */
57
89
  setCacheMode(cacheMode: CacheMode, untilVersion: string): void;
90
+ /**
91
+ * @private
92
+ */
58
93
  routeToSubscribers(topic: string, message: JobOutput): Promise<void>;
94
+ /**
95
+ * @private
96
+ */
59
97
  processWebHooks(): Promise<void>;
98
+ /**
99
+ * @private
100
+ */
60
101
  processTimeHooks(): Promise<void>;
102
+ /**
103
+ * @private
104
+ */
61
105
  throttle(delayInMillis: number): Promise<void>;
106
+ /**
107
+ * @private
108
+ */
62
109
  initActivity(topic: string, data?: JobData, context?: JobState): Promise<Await | Cycle | Hook | Signal | Trigger | Worker | Interrupt>;
63
110
  getSchema(topic: string): Promise<[activityId: string, schema: ActivityType]>;
111
+ /**
112
+ * @private
113
+ */
64
114
  getSettings(): Promise<HotMeshSettings>;
115
+ /**
116
+ * @private
117
+ */
65
118
  isPrivate(topic: string): boolean;
119
+ /**
120
+ * @private
121
+ */
66
122
  plan(pathOrYAML: string): Promise<HotMeshManifest>;
123
+ /**
124
+ * @private
125
+ */
67
126
  deploy(pathOrYAML: string): Promise<HotMeshManifest>;
127
+ /**
128
+ * @private
129
+ */
68
130
  getStats(topic: string, query: JobStatsInput): Promise<StatsResponse>;
131
+ /**
132
+ * @private
133
+ */
69
134
  getIds(topic: string, query: JobStatsInput, queryFacets?: any[]): Promise<IdsResponse>;
135
+ /**
136
+ * @private
137
+ */
70
138
  resolveQuery(topic: string, query: JobStatsInput): Promise<GetStatsOptions>;
139
+ /**
140
+ * @private
141
+ */
71
142
  processStreamMessage(streamData: StreamDataResponse): Promise<void>;
143
+ /**
144
+ * @private
145
+ */
72
146
  execAdjacentParent(context: JobState, jobOutput: JobOutput, emit?: boolean): Promise<string>;
147
+ /**
148
+ * @private
149
+ */
73
150
  hasParentJob(context: JobState, checkSevered?: boolean): boolean;
151
+ /**
152
+ * @private
153
+ */
74
154
  resolveError(metadata: JobMetadata): StreamError | undefined;
155
+ /**
156
+ * @private
157
+ */
75
158
  interrupt(topic: string, jobId: string, options?: JobInterruptOptions): Promise<string>;
159
+ /**
160
+ * @private
161
+ */
76
162
  scrub(jobId: string): Promise<void>;
163
+ /**
164
+ * @private
165
+ */
77
166
  hook(topic: string, data: JobData, status?: StreamStatus, code?: StreamCode): Promise<string>;
167
+ /**
168
+ * @private
169
+ */
78
170
  hookTime(jobId: string, gId: string, topicOrActivity: string, type?: WorkListTaskType): Promise<string | void>;
171
+ /**
172
+ * @private
173
+ */
79
174
  hookAll(hookTopic: string, data: JobData, keyResolver: JobStatsInput, queryFacets?: string[]): Promise<string[]>;
175
+ /**
176
+ * @private
177
+ */
80
178
  pub(topic: string, data: JobData, context?: JobState, extended?: ExtensionType): Promise<string>;
179
+ /**
180
+ * @private
181
+ */
81
182
  sub(topic: string, callback: JobMessageCallback): Promise<void>;
183
+ /**
184
+ * @private
185
+ */
82
186
  unsub(topic: string): Promise<void>;
187
+ /**
188
+ * @private
189
+ */
83
190
  psub(wild: string, callback: JobMessageCallback): Promise<void>;
191
+ /**
192
+ * @private
193
+ */
84
194
  punsub(wild: string): Promise<void>;
195
+ /**
196
+ * @private
197
+ */
85
198
  pubsub(topic: string, data: JobData, context?: JobState | null, timeout?: number): Promise<JobOutput>;
199
+ /**
200
+ * @private
201
+ */
86
202
  pubOneTimeSubs(context: JobState, jobOutput: JobOutput, emit?: boolean): Promise<void>;
203
+ /**
204
+ * @private
205
+ */
87
206
  getPublishesTopic(context: JobState): Promise<string>;
207
+ /**
208
+ * @private
209
+ */
88
210
  pubPermSubs(context: JobState, jobOutput: JobOutput, emit?: boolean): Promise<void>;
211
+ /**
212
+ * @private
213
+ */
89
214
  add(streamData: StreamData | StreamDataResponse): Promise<string>;
215
+ /**
216
+ * @private
217
+ */
90
218
  registerJobCallback(jobId: string, jobCallback: JobMessageCallback): void;
219
+ /**
220
+ * @private
221
+ */
91
222
  delistJobCallback(jobId: string): void;
223
+ /**
224
+ * @private
225
+ */
92
226
  hasOneTimeSubscription(context: JobState): boolean;
227
+ /**
228
+ * @private
229
+ */
93
230
  runJobCompletionTasks(context: JobState, options?: JobCompletionOptions): Promise<string | void>;
231
+ /**
232
+ * Job hash expiration is typically reliant on the metadata field
233
+ * if the activity concludes normally. However, if the job is `interrupted`,
234
+ * it will be expired immediately.
235
+ * @private
236
+ */
94
237
  resolveExpires(context: JobState, options: JobCompletionOptions): number;
238
+ /**
239
+ * @private
240
+ */
95
241
  export(jobId: string): Promise<JobExport>;
242
+ /**
243
+ * @private
244
+ */
96
245
  getRaw(jobId: string): Promise<StringStringType>;
246
+ /**
247
+ * @private
248
+ */
97
249
  getStatus(jobId: string): Promise<JobStatus>;
250
+ /**
251
+ * @private
252
+ */
98
253
  getState(topic: string, jobId: string): Promise<JobOutput>;
254
+ /**
255
+ * @private
256
+ */
99
257
  getQueryState(jobId: string, fields: string[]): Promise<StringAnyType>;
258
+ /**
259
+ * @private
260
+ * @deprecated
261
+ */
100
262
  compress(terms: string[]): Promise<boolean>;
101
263
  }
102
264
  export { EngineService };
@@ -1 +1 @@
1
- 'use strict';const q=b;(function(c,d){const o=b,e=c();while(!![]){try{const f=parseInt(o(0x1e5))/0x1*(parseInt(o(0x155))/0x2)+-parseInt(o(0x1f5))/0x3+-parseInt(o(0x1ef))/0x4+parseInt(o(0x18b))/0x5*(-parseInt(o(0x17c))/0x6)+-parseInt(o(0x1a3))/0x7+-parseInt(o(0x1fa))/0x8+parseInt(o(0x1cf))/0x9;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xad42b));var __importDefault=this&&this['__importDefault']||function(c){const p=b;return c&&c[p(0x17e)]?c:{'default':c};};Object[q(0x1dd)](exports,q(0x17e),{'value':!![]}),exports[q(0x15a)]=void 0x0;const key_1=require(q(0x1fb)),enums_1=require(q(0x170)),utils_1=require(q(0x1c4)),activities_1=__importDefault(require('../activities')),compiler_1=require(q(0x153)),exporter_1=require(q(0x146)),reporter_1=require(q(0x158)),router_1=require('../router'),serializer_1=require(q(0x1b7)),factory_1=require(q(0x1a7)),factory_2=require(q(0x1c1)),factory_3=require(q(0x156)),factory_4=require('../sub/factory'),task_1=require('../task'),stream_1=require(q(0x15b));class EngineService{constructor(){const r=q;this['cacheMode']='cache',this[r(0x13b)]=null,this[r(0x172)]={},this[r(0x1cb)]=![],this[r(0x150)]=0x1;}static async['init'](c,d,e,f,g){const s=q;if(f['engine']){const h=new EngineService();h[s(0x183)](f),h[s(0x1d9)]=c,h['appId']=d,h[s(0x16a)]=e,h['logger']=g,await h[s(0x16c)](f[s(0x1de)]['store']),await h['initStoreChannel'](f[s(0x1de)][s(0x1a2)]),await h[s(0x142)](f['engine'][s(0x1b8)],f[s(0x1de)][s(0x1d0)]??f[s(0x1de)][s(0x1a2)]),await h[s(0x1dc)](f[s(0x1de)][s(0x1a8)],f[s(0x1de)][s(0x1a2)]),h[s(0x1e8)]=await h['initRouter'](f);const i=h[s(0x1a2)][s(0x19b)](key_1[s(0x191)][s(0x1c0)],{'appId':h[s(0x13a)]});return h[s(0x1e8)][s(0x147)](i,s(0x1b5),h['guid'],h['processStreamMessage'][s(0x141)](h)),h['taskService']=new task_1['TaskService'](h[s(0x1a2)],g),h[s(0x1fc)]=new exporter_1[(s(0x1e6))](h[s(0x13a)],h[s(0x1a2)],g),h[s(0x1ee)]=(0x0,utils_1['formatISODate'])(new Date()),h;}}[q(0x183)](c){const t=q;if(!(0x0,utils_1[t(0x1d5)])(c[t(0x1de)][t(0x1a2)])||!(0x0,utils_1[t(0x1d5)])(c['engine']['stream'])||!(0x0,utils_1[t(0x1d5)])(c['engine'][t(0x1b8)]))throw new Error('engine\x20must\x20include\x20`store`,\x20`stream`,\x20and\x20`sub`\x20fields.');}async[q(0x16c)](c,d){const u=q;this[u(0x143)]=await factory_1[u(0x18e)][u(0x1e4)](c,d,this[u(0x1d9)],this[u(0x13a)],this[u(0x1f9)]);}async[q(0x14e)](c){const v=q;this[v(0x1a2)]=await factory_2[v(0x1c8)][v(0x1e4)](c,this[v(0x1d9)],this['appId'],this[v(0x1f9)]);}async[q(0x142)](c,d){const w=q;this[w(0x1f1)]=await factory_4['SubServiceFactory']['init'](c,d,this[w(0x1d9)],this[w(0x13a)],this[w(0x16a)],this[w(0x1f9)]);}async[q(0x1dc)](c,d){const x=q;this[x(0x1a8)]=await factory_3[x(0x178)][x(0x1e4)](c,d,this[x(0x1d9)],this[x(0x13a)],this[x(0x1f9)]);}async[q(0x185)](c){const y=q,d=await this['store']['getThrottleRate'](':');return new router_1[(y(0x14f))]({'namespace':this[y(0x1d9)],'appId':this[y(0x13a)],'guid':this['guid'],'role':stream_1['StreamRole']['ENGINE'],'reclaimDelay':c['engine'][y(0x16e)],'reclaimCount':c[y(0x1de)][y(0x177)],'throttle':d,'readonly':c['engine'][y(0x1b4)]},this[y(0x1a8)],this[y(0x1f9)]);}async[q(0x18a)](c,d=0x0){const z=q;if(isNaN(Number(c[z(0x15e)]))){const e=await this['store'][z(0x1e9)](c['id'],!![]);if(!isNaN(Number(e[z(0x15e)]))){if(!this[z(0x136)])this[z(0x136)]={};return this['apps'][c['id']]=e,{'id':c['id'],'version':e[z(0x15e)]};}else{if(d<0xa)return await(0x0,utils_1['sleepFor'])(enums_1['HMSH_QUORUM_DELAY_MS']*0x2),await this[z(0x18a)](c,d+0x1);else this['logger'][z(0x1a0)](z(0x1a1),{'id':c['id'],'guid':this[z(0x16a)]});}}return c;}async['getVID'](c){const A=q;if(this[A(0x1ab)]===A(0x13d)){const d=await this[A(0x1a2)]['getApp'](this['appId'],!![]);if(d['version'][A(0x151)]()===this[A(0x13b)][A(0x151)]()){if(!this[A(0x136)])this['apps']={};this[A(0x136)][this['appId']]=d,this[A(0x14d)]('cache',d[A(0x15e)][A(0x151)]());}return{'id':this[A(0x13a)],'version':d[A(0x15e)]};}else return!this[A(0x136)]&&c?(this['apps']={},this[A(0x136)][this[A(0x13a)]]=c,c):await this[A(0x18a)]({'id':this['appId'],'version':this['apps']?.[this[A(0x13a)]][A(0x15e)]});}[q(0x14d)](c,d){const B=q;this[B(0x1f9)][B(0x16d)](B(0x164),{'mode':c,[c===B(0x195)?B(0x1b0):B(0x1f2)]:d}),this[B(0x1ab)]=c,this[B(0x13b)]=d;}async[q(0x1e1)](c,d){const C=q,e=this[C(0x172)][d[C(0x19e)]['jid']];e&&(this[C(0x1f6)](d[C(0x19e)][C(0x199)]),e(c,d));}async[q(0x171)](){const D=q;this[D(0x145)][D(0x171)](this[D(0x184)][D(0x141)](this));}async['processTimeHooks'](){const E=q;this['taskService']['processTimeHooks'](this['hookTime'][E(0x141)](this));}async['throttle'](c){const F=q;try{this[F(0x1e8)]?.[F(0x197)](c);}catch(d){this[F(0x1f9)]['error'](F(0x194),{'error':d});}}async['initActivity'](c,d={},e){const G=q,[f,g]=await this[G(0x135)](c),h=activities_1['default'][g[G(0x1fd)]];if(h){const i=(0x0,utils_1[G(0x1ca)])(new Date()),j={'aid':f,'atp':g[G(0x1fd)],'stp':g['subtype'],'ac':i,'au':i},k=null;return new h(g,d,j,k,this,e);}else throw new Error(G(0x167)+g['type']+G(0x1c3));}async[q(0x135)](c){const H=q,d=await this[H(0x1a2)][H(0x1e9)](this[H(0x13a)]);if(!d)throw new Error(H(0x1df)+this[H(0x13a)]);if(this['isPrivate'](c)){const e=c[H(0x13c)](0x1),f=await this[H(0x1a2)][H(0x135)](e,await this[H(0x166)](d));return[e,f];}else{const g=await this['store']['getSubscription'](c,await this[H(0x166)](d));if(g){const h=await this[H(0x1a2)][H(0x135)](g,await this[H(0x166)](d));return[g,h];}}throw new Error('no\x20subscription\x20found\x20for\x20topic\x20'+c+'\x20in\x20app\x20'+this[H(0x13a)]+H(0x17b)+d[H(0x15e)]);}async[q(0x140)](){const I=q;return await this[I(0x1a2)]['getSettings']();}[q(0x1b9)](c){const J=q;return c[J(0x1ec)]('.');}async[q(0x1d1)](c){const K=q,d=new compiler_1[(K(0x17d))](this[K(0x1a2)],this[K(0x1a8)],this[K(0x1f9)]);return await d[K(0x1d1)](c);}async['deploy'](c){const L=q,d=new compiler_1[(L(0x17d))](this[L(0x1a2)],this[L(0x1a8)],this[L(0x1f9)]);return await d[L(0x1a6)](c);}async[q(0x180)](c,d){const M=q,{id:e,version:f}=await this[M(0x166)](),g=new reporter_1[(M(0x189))]({'id':e,'version':f},this[M(0x1a2)],this[M(0x1f9)]),h=await this[M(0x162)](c,d);return await g[M(0x180)](h);}async[q(0x1d3)](c,d,e=[]){const N=q,{id:f,version:g}=await this[N(0x166)](),h=new reporter_1[(N(0x189))]({'id':f,'version':g},this[N(0x1a2)],this[N(0x1f9)]),i=await this[N(0x162)](c,d);return await h[N(0x1d3)](i,e);}async['resolveQuery'](c,d){const O=q,e=await this[O(0x19d)](c,d[O(0x1f7)]);return await e[O(0x1aa)](),{'end':d[O(0x181)],'start':d['start'],'range':d['range'],'granularity':e[O(0x1c5)](),'key':e['resolveJobKey'](e[O(0x1d7)]()),'sparse':d[O(0x160)]};}async['processStreamMessage'](c){const P=q;this[P(0x1f9)][P(0x14c)](P(0x168),{'jid':c[P(0x19e)][P(0x199)],'gid':c['metadata'][P(0x15f)],'dad':c[P(0x19e)][P(0x1cd)],'aid':c[P(0x19e)][P(0x1e7)],'status':c['status']||stream_1[P(0x187)]['SUCCESS'],'code':c[P(0x179)]||0xc8,'type':c['type']});const d={'metadata':{'guid':c[P(0x19e)][P(0x16a)],'jid':c[P(0x19e)][P(0x199)],'gid':c[P(0x19e)][P(0x15f)],'dad':c[P(0x19e)][P(0x1cd)],'aid':c['metadata'][P(0x1e7)]},'data':c[P(0x1f7)]};if(c[P(0x1fd)]===stream_1[P(0x137)][P(0x14a)]){const e=await this[P(0x19d)]('.'+c[P(0x19e)][P(0x1e7)],d[P(0x1f7)],d);await e[P(0x14b)](c[P(0x19e)][P(0x199)]);}else{if(c['type']===stream_1['StreamDataType'][P(0x16b)]){const f=await this[P(0x19d)]('.'+c[P(0x19e)][P(0x1e7)],d[P(0x1f7)],d);await f[P(0x1ae)](c['status'],c['code']);}else{if(c[P(0x1fd)]===stream_1[P(0x137)][P(0x188)]){const g=await this[P(0x19d)]('.'+c[P(0x19e)]['aid'],d[P(0x1f7)],d);await g[P(0x1d2)]();}else{if(c[P(0x1fd)]===stream_1['StreamDataType'][P(0x1f0)]){d[P(0x19e)]={...d[P(0x19e)],'pj':c['metadata'][P(0x199)],'pg':c[P(0x19e)][P(0x15f)],'pd':c['metadata'][P(0x1cd)],'pa':c[P(0x19e)][P(0x1e7)],'px':c['metadata'][P(0x1e3)]===![],'trc':c[P(0x19e)][P(0x157)],'spn':c[P(0x19e)][P(0x1b3)]};const h=await this['initActivity'](c[P(0x19e)][P(0x1ed)],c[P(0x1f7)],d);await h[P(0x1d2)]();}else{if(c[P(0x1fd)]===stream_1[P(0x137)]['RESULT']){const i=await this[P(0x19d)]('.'+d[P(0x19e)][P(0x1e7)],c[P(0x1f7)],d);await i[P(0x1ba)](c[P(0x1b2)],c['code']);}else{const j=await this['initActivity']('.'+c[P(0x19e)][P(0x1e7)],c['data'],d);await j['processEvent'](c[P(0x1b2)],c[P(0x179)],P(0x152));}}}}}this[P(0x1f9)][P(0x14c)](P(0x18d),{'jid':c[P(0x19e)][P(0x199)],'gid':c[P(0x19e)][P(0x15f)],'aid':c[P(0x19e)][P(0x1e7)]});}async['execAdjacentParent'](c,d,e=![]){const Q=q;if(this['hasParentJob'](c)){const f=this[Q(0x1c2)](d[Q(0x19e)]),g=c[Q(0x192)]?.['output']?.[Q(0x19e)]?.[Q(0x15d)]||c[Q(0x192)]?.[Q(0x152)]?.[Q(0x19e)]?.[Q(0x193)],h={'metadata':{'guid':(0x0,utils_1[Q(0x16a)])(),'jid':c['metadata']['pj'],'gid':c[Q(0x19e)]['pg'],'dad':c[Q(0x19e)]['pd'],'aid':c['metadata']['pa'],'trc':c[Q(0x19e)][Q(0x157)],'spn':g},'type':stream_1['StreamDataType'][Q(0x174)],'data':d[Q(0x1f7)]};if(f&&f[Q(0x179)])h[Q(0x1b2)]=stream_1[Q(0x187)]['ERROR'],h[Q(0x1f7)]=f,h['code']=f[Q(0x179)],h['stack']=f[Q(0x19c)];else e?(h[Q(0x1b2)]=stream_1['StreamStatus'][Q(0x1f8)],h[Q(0x179)]=enums_1[Q(0x1c9)]):(h[Q(0x1b2)]=stream_1[Q(0x187)]['SUCCESS'],h[Q(0x179)]=enums_1[Q(0x1a5)]);return await this[Q(0x1e8)]?.[Q(0x1d6)](null,h);}}[q(0x144)](c,d=![]){const R=q;if(d)return Boolean(c[R(0x19e)]['pj']&&c[R(0x19e)]['pa']&&!c[R(0x19e)]['px']);return Boolean(c[R(0x19e)]['pj']&&c['metadata']['pa']);}[q(0x1c2)](c){const S=q;if(c&&c[S(0x1af)])return JSON[S(0x139)](c['err']);}async[q(0x1eb)](c,d,e={}){const T=q;await this[T(0x1a2)][T(0x1eb)](c,d,e);const f=await this['getState'](c,d),g={'interrupt':e['descend'],'expire':e[T(0x1c7)]};return await this['runJobCompletionTasks'](f,g);}async[q(0x13f)](c){const U=q;await this[U(0x1a2)][U(0x13f)](c);}async[q(0x184)](c,d,e=stream_1['StreamStatus'][q(0x1bf)],f=0xc8){const V=q,g=await this[V(0x145)]['getHookRule'](c),[h]=await this[V(0x135)]('.'+g['to']),i={'type':stream_1['StreamDataType'][V(0x16b)],'status':e,'code':f,'metadata':{'guid':(0x0,utils_1[V(0x16a)])(),'aid':h,'topic':c},'data':d};return await this[V(0x1e8)]?.[V(0x1d6)](null,i);}async[q(0x1b6)](c,d,e,f){const W=q;if(f===W(0x1eb)||f==='expire')return await this[W(0x1eb)](e,c,{'suppress':!![],'expire':0x1});const [g,...h]=e[W(0x1d8)](','),i=','+h[W(0x17a)](','),j={'type':stream_1[W(0x137)][W(0x14a)],'metadata':{'guid':(0x0,utils_1[W(0x16a)])(),'jid':c,'gid':d,'dad':i,'aid':g},'data':{'timestamp':Date[W(0x175)]()}};await this[W(0x1e8)]?.[W(0x1d6)](null,j);}async[q(0x1da)](c,d,e,f=[]){const X=q,g=await this['getVID'](),h=await this[X(0x145)][X(0x1e2)](c);if(h){const i=await(0x0,utils_1[X(0x1c6)])(h['to'],this[X(0x1a2)],g),j=await this[X(0x162)](i,e),k=new reporter_1['ReporterService'](g,this[X(0x1a2)],this['logger']),l=await k[X(0x1be)](j,f);if(l[X(0x198)]){const m=new task_1['TaskService'](this[X(0x1a2)],this['logger']);await m['enqueueWorkItems'](l[X(0x18f)](n=>[c,n,e[X(0x13f)]||![],JSON[X(0x1ea)](d)]['join'](key_1[X(0x1d4)]))),this[X(0x1f1)][X(0x1bb)](key_1[X(0x191)][X(0x173)],{'type':'work','originator':this[X(0x16a)]},this[X(0x13a)]);}return l;}else throw new Error(X(0x163)+c);}async[q(0x1d0)](c,d,e,f){const Y=q,g=await this[Y(0x19d)](c,d,e);if(g)return await g['process'](f);else throw new Error(Y(0x154)+c);}async[q(0x1b8)](c,d){const Z=q,e=async(f,g)=>{d(g['topic'],g['job']);};return await this['subscribe'][Z(0x1f1)](key_1['KeyType'][Z(0x173)],e,this[Z(0x13a)],c);}async[q(0x1a9)](c){const a0=q;return await this[a0(0x1f1)][a0(0x13e)](key_1[a0(0x191)][a0(0x173)],this[a0(0x13a)],c);}async[q(0x1bc)](c,d){const a2=q,e=async(f,g)=>{const a1=b;d(g[a1(0x1ed)],g['job']);};return await this[a2(0x1f1)]['psubscribe'](key_1['KeyType'][a2(0x173)],e,this[a2(0x13a)],c);}async[q(0x134)](c){const a3=q;return await this[a3(0x1f1)]['punsubscribe'](key_1[a3(0x191)][a3(0x173)],this[a3(0x13a)],c);}async[q(0x19a)](c,d,e,f=enums_1['HMSH_OTT_WAIT_TIME']){const a4=q;e={'metadata':{'ngn':this[a4(0x16a)],'trc':e?.[a4(0x19e)]?.[a4(0x157)],'spn':e?.['metadata']?.[a4(0x1b3)]}};const g=await this[a4(0x1d0)](c,d,e);return new Promise((h,i)=>{const a5=a4;this[a5(0x1b1)](g,(j,k)=>{const a6=a5;if(k['metadata'][a6(0x1af)]){const l=JSON[a6(0x139)](k[a6(0x19e)][a6(0x1af)]);i({'error':l,'job_id':k[a6(0x19e)][a6(0x199)]});}else h(k);}),setTimeout(()=>{const a7=a5;this[a7(0x1f6)](g),i({'code':enums_1[a7(0x1ad)],'message':'timeout','job_id':g});},f);});}async[q(0x169)](c,d,e=![]){const a8=q;if(this[a8(0x186)](c)){const f={'type':a8(0x161),'topic':c['metadata'][a8(0x199)],'job':(0x0,utils_1[a8(0x1f4)])(d)};this['subscribe'][a8(0x1bb)](key_1['KeyType'][a8(0x173)],f,this[a8(0x13a)],c[a8(0x19e)]['ngn']);}}async[q(0x149)](c){const a9=q,d=await this[a9(0x166)](),e=c[a9(0x19e)][a9(0x1e7)]||c['$self']?.[a9(0x152)]?.[a9(0x19e)]?.[a9(0x1e7)],f=await this[a9(0x1a2)]['getSchema'](e,d);return f[a9(0x17f)];}async[q(0x159)](c,d,e=![]){const aa=q,f=await this[aa(0x149)](c);if(f){const g={'type':'job','topic':f,'job':(0x0,utils_1[aa(0x1f4)])(d)};this[aa(0x1f1)][aa(0x1bb)](key_1['KeyType'][aa(0x173)],g,this['appId'],f+'.'+c[aa(0x19e)][aa(0x199)]);}}async[q(0x1a4)](c){const ab=q;return await this[ab(0x1e8)]?.[ab(0x1d6)](null,c);}[q(0x1b1)](c,d){const ac=q;this[ac(0x172)][c]=d;}['delistJobCallback'](c){const ad=q;delete this[ad(0x172)][c];}['hasOneTimeSubscription'](c){const ae=q;return Boolean(c['metadata'][ae(0x1ce)]);}async[q(0x1ac)](c,d={}){const af=q,e=this['hasParentJob'](c,!![]),f=this[af(0x186)](c),g=await this[af(0x149)](c);let h;if(e||f||g){const i=await this[af(0x1aa)](c[af(0x19e)][af(0x138)],c['metadata']['jid']);h=await this[af(0x190)](c,i,d[af(0x15c)]),this[af(0x169)](c,i,d[af(0x15c)]),this[af(0x159)](c,i,d['emit']);}return!d[af(0x15c)]&&this[af(0x145)][af(0x16f)](c['metadata'][af(0x199)],this[af(0x1e0)](c,d),d),h;}[q(0x1e0)](c,d){const ag=q;return d[ag(0x1c7)]??c[ag(0x19e)][ag(0x1c7)]??enums_1[ag(0x19f)];}async[q(0x1cc)](c){const ah=q;return await this[ah(0x1fc)][ah(0x1cc)](c);}async[q(0x196)](c){const ai=q;return await this[ai(0x1a2)][ai(0x196)](c);}async[q(0x1f3)](c){const aj=q,{id:d}=await this[aj(0x166)]();return await this[aj(0x1a2)]['getStatus'](c,d);}async[q(0x1aa)](c,d){const ak=q,e=await this[ak(0x1a2)][ak(0x18c)]('$'+c),f={['$'+c]:Object[ak(0x1db)](e)},g={},h=await this['store']['getState'](d,f,g);if(!h)throw new Error(ak(0x1bd)+d);const [i,j]=h,k=(0x0,utils_1[ak(0x1f4)])(i);return j&&k[ak(0x19e)]&&(k['metadata']['js']=j),k;}async[q(0x182)](c,d){const al=q;return await this['store'][al(0x182)](c,d);}async['compress'](c){const am=q,d=await this[am(0x1a2)]['getSymbolValues'](),e=Object[am(0x1db)](d)['length'],f=Math[am(0x165)](0x34,0x2)-0x1,g=serializer_1['SerializerService'][am(0x176)](e,f,d,new Set(c));return await this[am(0x1a2)][am(0x148)](g);}}function b(c,d){const e=a();return b=function(f,g){f=f-0x134;let h=e[f];return h;},b(c,d);}exports[q(0x15a)]=EngineService;function a(){const an=['publishMessage','createInputContext','split','namespace','hookAll','keys','initStreamChannel','defineProperty','engine','no\x20app\x20found\x20for\x20id\x20','resolveExpires','routeToSubscribers','getHookRule','await','init','1vcqPDC','ExporterService','aid','router','getApp','stringify','interrupt','startsWith','topic','inited','2413056BOTcRM','AWAIT','subscribe','until','getStatus','restoreHierarchy','582492hAiVxX','delistJobCallback','data','PENDING','logger','8252968EnMZvX','../../modules/key','exporter','type','punsub','getSchema','apps','StreamDataType','tpc','parse','appId','untilVersion','substring','nocache','unsubscribe','scrub','getSettings','bind','initSubChannel','search','hasParentJob','taskService','../exporter','consumeMessages','addSymbolValues','getPublishesTopic','TIMEHOOK','processTimeHookEvent','debug','setCacheMode','initStoreChannel','Router','jobId','toString','output','../compiler','unable\x20to\x20process\x20activity\x20for\x20topic\x20','1501008ZHURkF','../stream/factory','trc','../reporter','pubPermSubs','EngineService','../../types/stream','emit','l2s','version','gid','sparse','job','resolveQuery','unable\x20to\x20find\x20hook\x20rule\x20for\x20topic\x20','engine-executable-cache','pow','getVID','activity\x20type\x20','engine-process','pubOneTimeSubs','guid','WEBHOOK','initSearchChannel','info','reclaimDelay','registerJobForCleanup','../../modules/enums','processWebHooks','jobCallbacks','QUORUM','RESULT','now','filterSymVals','reclaimCount','StreamServiceFactory','code','join','\x20for\x20app\x20version\x20','582054BKxHDL','CompilerService','__esModule','publishes','getStats','end','getQueryState','verifyEngineFields','hook','initRouter','hasOneTimeSubscription','StreamStatus','TRANSITION','ReporterService','fetchAndVerifyVID','55SzZaWn','getSymbols','engine-process-end','SearchServiceFactory','map','execAdjacentParent','KeyType','$self','l1s','engine-throttle-error','cache','getRaw','setThrottle','length','jid','pubsub','mintKey','stack','initActivity','metadata','HMSH_EXPIRE_JOB_SECONDS','error','engine-vid-resolution-error','store','9496746YrBHfv','add','HMSH_CODE_SUCCESS','deploy','../search/factory','stream','unsub','getState','cacheMode','runJobCompletionTasks','HMSH_CODE_TIMEOUT','processWebHookEvent','err','target','registerJobCallback','status','spn','readonly','ENGINE','hookTime','../serializer','sub','isPrivate','processEvent','publish','psub','not\x20found\x20','getWorkItems','SUCCESS','STREAMS','../store/factory','resolveError','\x20not\x20found','../../modules/utils','resolveGranularity','getSubscriptionTopic','expire','StoreServiceFactory','HMSH_CODE_PENDING','formatISODate','reporting','export','dad','ngn','37907973gYXbeT','pub','plan','process','getIds','VALSEP','identifyProvider'];a=function(){return an;};return a();}
1
+ 'use strict';function a(){const ax=['engine-throttle-error','1907195KehDPM','HMSH_CODE_PENDING','hookAll','../router','getHookRule','plan','routeToSubscribers','977490RFANpG','export','output','SearchServiceFactory','Router','inited','pubOneTimeSubs','descend','topic','hasOneTimeSubscription','engine','parse','jobId','processWebHookEvent','../../modules/utils','reclaimDelay','err','RESULT','ngn','cacheMode','sub','subscribe','registerJobForCleanup','StoreServiceFactory','createInputContext','processWebHooks','StreamRole','getStatus','getSubscriptionTopic','resolveQuery','getRaw','code','getSubscription','initRouter','error','resolveJobKey','execAdjacentParent','engine-process','HMSH_CODE_SUCCESS','unsub','addSymbolValues','process','hookTime','../activities','psubscribe','emit','75Akdkus','KeyType','untilVersion','pubsub','AWAIT','stream','end','verifyEngineFields','3606505wUDmOx','taskService','data','namespace','gid','store','info','../compiler','trc','punsub','init','registerJobCallback','jobCallbacks','WEBHOOK','661293aDljCR','tpc','getWorkItems','getPublishesTopic','resolveError','getStats','runJobCompletionTasks','initActivity','dad','cache','StreamDataType','fetchAndVerifyVID','1494542HOWkEo','HMSH_OTT_WAIT_TIME','await','identifyProvider','initStoreChannel','type','pubPermSubs','not\x20found\x20','../stream/factory','target','consumeMessages','QUORUM','VALSEP','getSymbols','getSettings','CompilerService','sparse','isPrivate','deploy','aid','HMSH_EXPIRE_JOB_SECONDS','HMSH_QUORUM_DELAY_MS','unable\x20to\x20process\x20activity\x20for\x20topic\x20','STREAMS','418908ISGEFL','getQueryState','logger','guid','StreamStatus','bind','readonly','$self','spn','exporter','expire','apps','TIMEHOOK','job','length','processStreamMessage','setCacheMode','16sXjcmR','../serializer','keys','getThrottleRate','interrupt','processTimeHookEvent','__importDefault','ENGINE','range','../task','publishMessage','formatISODate','processEvent','../search/factory','pow','appId','reclaimCount','engine-executable-cache','no\x20app\x20found\x20for\x20id\x20','hook','initSearchChannel','unsubscribe','enqueueWorkItems','__esModule','getSymbolValues','l1s','../store/factory','stack','stringify','split','getIds','initSubChannel','join','\x20in\x20app\x20','status','until','50884RBmPPO','getState','version','publish','engine\x20must\x20include\x20`store`,\x20`stream`,\x20and\x20`sub`\x20fields.','router','jid','publishes','../exporter','sleepFor','metadata','work','SUCCESS','start','activity\x20type\x20','reporting','scrub','delistJobCallback','ExporterService','StreamServiceFactory','TaskService','getVID','unable\x20to\x20find\x20hook\x20rule\x20for\x20topic\x20','resolveGranularity','getSchema','EngineService','now','toString','SubServiceFactory','map','engine-vid-resolution-error','timeout','hasParentJob','startsWith','ReporterService','restoreHierarchy','subtype','../../types/stream','getApp','debug'];a=function(){return ax;};return a();}const y=b;(function(c,d){const x=b,e=c();while(!![]){try{const f=-parseInt(x(0x14e))/0x1+parseInt(x(0x136))/0x2+parseInt(x(0x114))/0x3*(-parseInt(x(0xb6))/0x4)+-parseInt(x(0xdf))/0x5+parseInt(x(0xe6))/0x6+parseInt(x(0x11c))/0x7+parseInt(x(0x15f))/0x8*(parseInt(x(0x12a))/0x9);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x6ed5f));var __importDefault=this&&this[y(0x165)]||function(c){const z=y;return c&&c[z(0x176)]?c:{'default':c};};function b(c,d){const e=a();return b=function(f,g){f=f-0xac;let h=e[f];return h;},b(c,d);}Object['defineProperty'](exports,'__esModule',{'value':!0x0}),exports['EngineService']=void 0x0;const key_1=require('../../modules/key'),enums_1=require('../../modules/enums'),utils_1=require(y(0xf4)),activities_1=__importDefault(require(y(0x111))),compiler_1=require(y(0x123)),exporter_1=require(y(0xbe)),reporter_1=require('../reporter'),router_1=require(y(0xe2)),serializer_1=require(y(0x160)),factory_1=require(y(0x16c)),factory_2=require(y(0xac)),factory_3=require(y(0x13e)),factory_4=require('../sub/factory'),task_1=require(y(0x168)),stream_1=require(y(0xdb));class EngineService{constructor(){const A=y;this['cacheMode']=A(0x133),this[A(0x116)]=null,this['jobCallbacks']={},this[A(0xc5)]=!0x1,this[A(0xf2)]=0x1;}static async[y(0x126)](c,d,f,g,h){const B=y;if(g[B(0xf0)]){const j=new EngineService();j[B(0x11b)](g),j[B(0x11f)]=c,j[B(0x16e)]=d,j[B(0x151)]=f,j[B(0x150)]=h,await j['initSearchChannel'](g['engine']['store']),await j[B(0x13a)](g[B(0xf0)][B(0x121)]),await j[B(0xb1)](g[B(0xf0)][B(0xfa)],g[B(0xf0)]['pub']??g[B(0xf0)][B(0x121)]),await j['initStreamChannel'](g[B(0xf0)]['stream'],g[B(0xf0)][B(0x121)]),j[B(0xbb)]=await j[B(0x107)](g);const k=j[B(0x121)]['mintKey'](key_1[B(0x115)][B(0x14d)],{'appId':j[B(0x16e)]});return j[B(0xbb)][B(0x140)](k,B(0x166),j['guid'],j[B(0x15d)][B(0x153)](j)),j['taskService']=new task_1[(B(0xca))](j[B(0x121)],h),j[B(0x157)]=new exporter_1[(B(0xc8))](j[B(0x16e)],j['store'],h),j[B(0xeb)]=(0x0,utils_1[B(0x16a)])(new Date()),j;}}['verifyEngineFields'](c){const C=y;if(!(0x0,utils_1['identifyProvider'])(c[C(0xf0)][C(0x121)])||!(0x0,utils_1[C(0x139)])(c[C(0xf0)]['stream'])||!(0x0,utils_1[C(0x139)])(c['engine']['sub']))throw new Error(C(0xba));}async[y(0x173)](c,d){const D=y;this['search']=await factory_1[D(0xe9)]['init'](c,d,this[D(0x11f)],this['appId'],this[D(0x150)]);}async['initStoreChannel'](c){const E=y;this[E(0x121)]=await factory_2[E(0xfd)]['init'](c,this[E(0x11f)],this['appId'],this[E(0x150)]);}async[y(0xb1)](c,d){const F=y;this[F(0xfb)]=await factory_4[F(0xd2)]['init'](c,d,this[F(0x11f)],this[F(0x16e)],this['guid'],this[F(0x150)]);}async['initStreamChannel'](c,d){const G=y;this[G(0x119)]=await factory_3[G(0xc9)][G(0x126)](c,d,this[G(0x11f)],this[G(0x16e)],this['logger']);}async['initRouter'](c){const H=y,d=await this[H(0x121)][H(0x162)](':');return new router_1[(H(0xea))]({'namespace':this[H(0x11f)],'appId':this[H(0x16e)],'guid':this['guid'],'role':stream_1[H(0x100)][H(0x166)],'reclaimDelay':c[H(0xf0)][H(0xf5)],'reclaimCount':c[H(0xf0)][H(0x16f)],'throttle':d,'readonly':c[H(0xf0)][H(0x154)]},this['stream'],this[H(0x150)]);}async[y(0x135)](c,d=0x0){const I=y;if(isNaN(Number(c['version']))){const f=await this[I(0x121)][I(0xdc)](c['id'],!0x0);if(!isNaN(Number(f[I(0xb8)])))return this['apps']||(this['apps']={}),this[I(0x159)][c['id']]=f,{'id':c['id'],'version':f[I(0xb8)]};if(d<0xa)return await(0x0,utils_1[I(0xbf)])(0x2*enums_1[I(0x14b)]),await this[I(0x135)](c,d+0x1);this[I(0x150)][I(0x108)](I(0xd4),{'id':c['id'],'guid':this[I(0x151)]});}return c;}async[y(0xcb)](c){const J=y;if('nocache'===this[J(0xf9)]){const d=await this['store'][J(0xdc)](this[J(0x16e)],!0x0);return d[J(0xb8)][J(0xd1)]()===this['untilVersion'][J(0xd1)]()&&(this['apps']||(this[J(0x159)]={}),this['apps'][this[J(0x16e)]]=d,this[J(0x15e)]('cache',d['version'][J(0xd1)]())),{'id':this['appId'],'version':d['version']};}return!this[J(0x159)]&&c?(this[J(0x159)]={},this[J(0x159)][this[J(0x16e)]]=c,c):await this[J(0x135)]({'id':this['appId'],'version':this[J(0x159)]?.[this[J(0x16e)]][J(0xb8)]});}['setCacheMode'](c,d){const K=y;this[K(0x150)][K(0x122)](K(0x170),{'mode':c,[K(0x133)===c?K(0x13f):K(0xb5)]:d}),this['cacheMode']=c,this[K(0x116)]=d;}async[y(0xe5)](c,d){const L=y,f=this['jobCallbacks'][d[L(0xc0)][L(0xbc)]];f&&(this['delistJobCallback'](d[L(0xc0)][L(0xbc)]),f(c,d));}async[y(0xff)](){const M=y;this[M(0x11d)][M(0xff)](this[M(0x172)]['bind'](this));}async['processTimeHooks'](){const N=y;this[N(0x11d)]['processTimeHooks'](this[N(0x110)][N(0x153)](this));}async['throttle'](c){const O=y;try{this[O(0xbb)]?.['setThrottle'](c);}catch(d){this[O(0x150)]['error'](O(0xde),{'error':d});}}async[y(0x131)](c,d={},f){const P=y,[g,h]=await this[P(0xce)](c),j=activities_1['default'][h['type']];if(j){const k=(0x0,utils_1[P(0x16a)])(new Date());return new j(h,d,{'aid':g,'atp':h[P(0x13b)],'stp':h[P(0xda)],'ac':k,'au':k},null,this,f);}throw new Error(P(0xc4)+h[P(0x13b)]+'\x20not\x20found');}async[y(0xce)](c){const Q=y,d=await this[Q(0x121)][Q(0xdc)](this[Q(0x16e)]);if(!d)throw new Error(Q(0x171)+this['appId']);if(this[Q(0x147)](c)){const f=c['substring'](0x1);return[f,await this['store'][Q(0xce)](f,await this['getVID'](d))];}{const g=await this[Q(0x121)][Q(0x106)](c,await this[Q(0xcb)](d));if(g)return[g,await this[Q(0x121)][Q(0xce)](g,await this[Q(0xcb)](d))];}throw new Error('no\x20subscription\x20found\x20for\x20topic\x20'+c+Q(0xb3)+this[Q(0x16e)]+'\x20for\x20app\x20version\x20'+d[Q(0xb8)]);}async['getSettings'](){const R=y;return await this[R(0x121)][R(0x144)]();}[y(0x147)](c){const S=y;return c[S(0xd7)]('.');}async[y(0xe4)](c){const T=y,d=new compiler_1['CompilerService'](this[T(0x121)],this[T(0x119)],this[T(0x150)]);return await d[T(0xe4)](c);}async[y(0x148)](c){const U=y,d=new compiler_1[(U(0x145))](this[U(0x121)],this['stream'],this['logger']);return await d['deploy'](c);}async[y(0x12f)](c,d){const V=y,{id:f,version:g}=await this['getVID'](),h=new reporter_1[(V(0xd8))]({'id':f,'version':g},this['store'],this[V(0x150)]),j=await this[V(0x103)](c,d);return await h[V(0x12f)](j);}async['getIds'](c,d,f=[]){const W=y,{id:g,version:h}=await this[W(0xcb)](),j=new reporter_1[(W(0xd8))]({'id':g,'version':h},this[W(0x121)],this[W(0x150)]),k=await this[W(0x103)](c,d);return await j[W(0xb0)](k,f);}async[y(0x103)](c,d){const X=y,f=await this[X(0x131)](c,d[X(0x11e)]);return await f[X(0xb7)](),{'end':d[X(0x11a)],'start':d[X(0xc3)],'range':d[X(0x167)],'granularity':f[X(0xcd)](),'key':f[X(0x109)](f[X(0xfe)]()),'sparse':d[X(0x146)]};}async[y(0x15d)](c){const Y=y;this[Y(0x150)][Y(0xdd)](Y(0x10b),{'jid':c[Y(0xc0)][Y(0xbc)],'gid':c[Y(0xc0)][Y(0x120)],'dad':c['metadata'][Y(0x132)],'aid':c['metadata'][Y(0x149)],'status':c[Y(0xb4)]||stream_1[Y(0x152)]['SUCCESS'],'code':c[Y(0x105)]||0xc8,'type':c[Y(0x13b)]});const d={'metadata':{'guid':c[Y(0xc0)][Y(0x151)],'jid':c['metadata'][Y(0xbc)],'gid':c[Y(0xc0)][Y(0x120)],'dad':c[Y(0xc0)][Y(0x132)],'aid':c[Y(0xc0)]['aid']},'data':c['data']};if(c[Y(0x13b)]===stream_1[Y(0x134)][Y(0x15a)]){const f=await this[Y(0x131)]('.'+c[Y(0xc0)][Y(0x149)],d[Y(0x11e)],d);await f[Y(0x164)](c[Y(0xc0)][Y(0xbc)]);}else{if(c[Y(0x13b)]===stream_1[Y(0x134)][Y(0x129)]){const g=await this['initActivity']('.'+c[Y(0xc0)][Y(0x149)],d[Y(0x11e)],d);await g[Y(0xf3)](c[Y(0xb4)],c[Y(0x105)]);}else{if(c[Y(0x13b)]===stream_1[Y(0x134)]['TRANSITION']){const h=await this[Y(0x131)]('.'+c['metadata']['aid'],d[Y(0x11e)],d);await h[Y(0x10f)]();}else{if(c['type']===stream_1[Y(0x134)][Y(0x118)]){d[Y(0xc0)]={...d[Y(0xc0)],'pj':c['metadata'][Y(0xbc)],'pg':c[Y(0xc0)]['gid'],'pd':c[Y(0xc0)][Y(0x132)],'pa':c[Y(0xc0)][Y(0x149)],'px':!0x1===c['metadata'][Y(0x138)],'trc':c[Y(0xc0)]['trc'],'spn':c[Y(0xc0)][Y(0x156)]};const i=await this['initActivity'](c[Y(0xc0)][Y(0xee)],c['data'],d);await i[Y(0x10f)]();}else{if(c['type']===stream_1[Y(0x134)][Y(0xf7)]){const j=await this[Y(0x131)]('.'+d['metadata'][Y(0x149)],c['data'],d);await j[Y(0x16b)](c[Y(0xb4)],c['code']);}else{const k=await this['initActivity']('.'+c['metadata'][Y(0x149)],c[Y(0x11e)],d);await k[Y(0x16b)](c[Y(0xb4)],c[Y(0x105)],Y(0xe8));}}}}}this[Y(0x150)]['debug']('engine-process-end',{'jid':c[Y(0xc0)][Y(0xbc)],'gid':c[Y(0xc0)][Y(0x120)],'aid':c[Y(0xc0)][Y(0x149)]});}async[y(0x10a)](c,d,f=!0x1){const Z=y;if(this[Z(0xd6)](c)){const g=this[Z(0x12e)](d[Z(0xc0)]),h=c[Z(0x155)]?.[Z(0xe8)]?.[Z(0xc0)]?.['l2s']||c[Z(0x155)]?.[Z(0xe8)]?.[Z(0xc0)]?.[Z(0x178)],j={'metadata':{'guid':(0x0,utils_1[Z(0x151)])(),'jid':c[Z(0xc0)]['pj'],'gid':c[Z(0xc0)]['pg'],'dad':c['metadata']['pd'],'aid':c[Z(0xc0)]['pa'],'trc':c[Z(0xc0)]['trc'],'spn':h},'type':stream_1['StreamDataType'][Z(0xf7)],'data':d[Z(0x11e)]};return g&&g[Z(0x105)]?(j['status']=stream_1['StreamStatus']['ERROR'],j['data']=g,j['code']=g['code'],j[Z(0xad)]=g['stack']):f?(j[Z(0xb4)]=stream_1[Z(0x152)]['PENDING'],j[Z(0x105)]=enums_1[Z(0xe0)]):(j[Z(0xb4)]=stream_1[Z(0x152)][Z(0xc2)],j[Z(0x105)]=enums_1[Z(0x10c)]),await this[Z(0xbb)]?.[Z(0x169)](null,j);}}[y(0xd6)](c,d=!0x1){const a0=y;return d?Boolean(c['metadata']['pj']&&c[a0(0xc0)]['pa']&&!c[a0(0xc0)]['px']):Boolean(c[a0(0xc0)]['pj']&&c['metadata']['pa']);}[y(0x12e)](c){const a1=y;if(c&&c['err'])return JSON[a1(0xf1)](c[a1(0xf6)]);}async['interrupt'](c,d,f={}){const a2=y;await this[a2(0x121)][a2(0x163)](c,d,f);const g=await this[a2(0xb7)](c,d),h={'interrupt':f[a2(0xed)],'expire':f['expire']};return await this[a2(0x130)](g,h);}async[y(0xc6)](c){const a3=y;await this[a3(0x121)][a3(0xc6)](c);}async[y(0x172)](c,d,f=stream_1[y(0x152)][y(0xc2)],g=0xc8){const a4=y,h=await this['taskService'][a4(0xe3)](c),[j]=await this[a4(0xce)]('.'+h['to']),k={'type':stream_1['StreamDataType'][a4(0x129)],'status':f,'code':g,'metadata':{'guid':(0x0,utils_1[a4(0x151)])(),'aid':j,'topic':c},'data':d};return await this[a4(0xbb)]?.[a4(0x169)](null,k);}async[y(0x110)](c,d,f,g){const a5=y;if(a5(0x163)===g||a5(0x158)===g)return await this['interrupt'](f,c,{'suppress':!0x0,'expire':0x1});const [h,...j]=f[a5(0xaf)](','),k=','+j[a5(0xb2)](','),l={'type':stream_1[a5(0x134)]['TIMEHOOK'],'metadata':{'guid':(0x0,utils_1[a5(0x151)])(),'jid':c,'gid':d,'dad':k,'aid':h},'data':{'timestamp':Date[a5(0xd0)]()}};await this[a5(0xbb)]?.['publishMessage'](null,l);}async[y(0xe1)](f,g,h,j=[]){const a6=y,k=await this[a6(0xcb)](),l=await this['taskService'][a6(0xe3)](f);if(l){const m=await(0x0,utils_1[a6(0x102)])(l['to'],this[a6(0x121)],k),p=await this['resolveQuery'](m,h),q=new reporter_1[(a6(0xd8))](k,this[a6(0x121)],this['logger']),u=await q[a6(0x12c)](p,j);if(u[a6(0x15c)]){const v=new task_1['TaskService'](this['store'],this[a6(0x150)]);await v[a6(0x175)](u[a6(0xd3)](w=>[f,w,h[a6(0xc6)]||!0x1,JSON[a6(0xae)](g)][a6(0xb2)](key_1[a6(0x142)]))),this[a6(0xfb)][a6(0xb9)](key_1[a6(0x115)][a6(0x141)],{'type':a6(0xc1),'originator':this['guid']},this[a6(0x16e)]);}return u;}throw new Error(a6(0xcc)+f);}async['pub'](c,d,f,g){const a7=y,h=await this['initActivity'](c,d,f);if(h)return await h[a7(0x10f)](g);throw new Error(a7(0x14c)+c);}async['sub'](c,d){const a8=y;return await this[a8(0xfb)][a8(0xfb)](key_1[a8(0x115)][a8(0x141)],async(f,g)=>{const a9=a8;d(g[a9(0xee)],g['job']);},this[a8(0x16e)],c);}async[y(0x10d)](c){const aa=y;return await this['subscribe'][aa(0x174)](key_1[aa(0x115)]['QUORUM'],this[aa(0x16e)],c);}async['psub'](c,d){const ab=y;return await this[ab(0xfb)][ab(0x112)](key_1[ab(0x115)][ab(0x141)],async(f,g)=>{const ac=ab;d(g[ac(0xee)],g[ac(0x15b)]);},this[ab(0x16e)],c);}async[y(0x125)](c){const ad=y;return await this['subscribe']['punsubscribe'](key_1[ad(0x115)]['QUORUM'],this[ad(0x16e)],c);}async[y(0x117)](c,d,f,g=enums_1[y(0x137)]){const ae=y;f={'metadata':{'ngn':this[ae(0x151)],'trc':f?.[ae(0xc0)]?.[ae(0x124)],'spn':f?.['metadata']?.[ae(0x156)]}};const h=await this['pub'](c,d,f);return new Promise((j,k)=>{const af=ae;this[af(0x127)](h,(l,m)=>{const ag=af;if(m[ag(0xc0)][ag(0xf6)]){const n=JSON[ag(0xf1)](m[ag(0xc0)][ag(0xf6)]);k({'error':n,'job_id':m[ag(0xc0)][ag(0xbc)]});}else j(m);}),setTimeout(()=>{const ah=af;this['delistJobCallback'](h),k({'code':enums_1['HMSH_CODE_TIMEOUT'],'message':ah(0xd5),'job_id':h});},g);});}async[y(0xec)](c,d,f=!0x1){const ai=y;if(this[ai(0xef)](c)){const g={'type':'job','topic':c[ai(0xc0)][ai(0xbc)],'job':(0x0,utils_1[ai(0xd9)])(d)};this['subscribe'][ai(0xb9)](key_1[ai(0x115)][ai(0x141)],g,this['appId'],c['metadata'][ai(0xf8)]);}}async[y(0x12d)](c){const aj=y,d=await this[aj(0xcb)](),f=c[aj(0xc0)][aj(0x149)]||c[aj(0x155)]?.[aj(0xe8)]?.['metadata']?.[aj(0x149)];return(await this[aj(0x121)]['getSchema'](f,d))[aj(0xbd)];}async[y(0x13c)](c,d,f=!0x1){const ak=y,g=await this['getPublishesTopic'](c);if(g){const h={'type':ak(0x15b),'topic':g,'job':(0x0,utils_1['restoreHierarchy'])(d)};this[ak(0xfb)]['publish'](key_1[ak(0x115)][ak(0x141)],h,this[ak(0x16e)],g+'.'+c['metadata']['jid']);}}async['add'](c){const al=y;return await this[al(0xbb)]?.[al(0x169)](null,c);}['registerJobCallback'](c,d){const am=y;this[am(0x128)][c]=d;}[y(0xc7)](c){const an=y;delete this[an(0x128)][c];}[y(0xef)](c){const ao=y;return Boolean(c[ao(0xc0)][ao(0xf8)]);}async[y(0x130)](c,d={}){const ap=y,f=this[ap(0xd6)](c,!0x0),g=this[ap(0xef)](c),h=await this['getPublishesTopic'](c);let j;if(f||g||h){const k=await this[ap(0xb7)](c[ap(0xc0)][ap(0x12b)],c['metadata'][ap(0xbc)]);j=await this['execAdjacentParent'](c,k,d[ap(0x113)]),this[ap(0xec)](c,k,d['emit']),this[ap(0x13c)](c,k,d['emit']);}return d['emit']||this[ap(0x11d)][ap(0xfc)](c[ap(0xc0)][ap(0xbc)],this['resolveExpires'](c,d),d),j;}['resolveExpires'](c,d){const aq=y;return d[aq(0x158)]??c[aq(0xc0)]['expire']??enums_1[aq(0x14a)];}async[y(0xe7)](c){const ar=y;return await this[ar(0x157)][ar(0xe7)](c);}async[y(0x104)](c){const as=y;return await this[as(0x121)]['getRaw'](c);}async['getStatus'](c){const at=y,{id:d}=await this['getVID']();return await this['store'][at(0x101)](c,d);}async[y(0xb7)](c,d){const au=y,f=await this[au(0x121)][au(0x143)]('$'+c),g={['$'+c]:Object['keys'](f)},h=await this[au(0x121)]['getState'](d,g,{});if(!h)throw new Error(au(0x13d)+d);const [j,k]=h,l=(0x0,utils_1['restoreHierarchy'])(j);return k&&l['metadata']&&(l[au(0xc0)]['js']=k),l;}async[y(0x14f)](c,d){const av=y;return await this['store'][av(0x14f)](c,d);}async['compress'](c){const aw=y,d=await this[aw(0x121)][aw(0x177)](),f=Object[aw(0x161)](d)[aw(0x15c)],g=Math[aw(0x16d)](0x34,0x2)-0x1,h=serializer_1['SerializerService']['filterSymVals'](f,g,d,new Set(c));return await this[aw(0x121)][aw(0x10e)](h);}}exports[y(0xcf)]=EngineService;
@@ -3,15 +3,42 @@ import { StoreService } from '../store';
3
3
  import { DependencyExport, ExportOptions, JobActionExport, JobExport } from '../../types/exporter';
4
4
  import { ProviderClient, ProviderTransaction } from '../../types/provider';
5
5
  import { StringStringType, Symbols } from '../../types/serializer';
6
+ /**
7
+ * Downloads job data from Redis (hscan, hmget, hgetall)
8
+ * Expands process data and includes dependency list
9
+ */
6
10
  declare class ExporterService {
7
11
  appId: string;
8
12
  logger: ILogger;
9
13
  store: StoreService<ProviderClient, ProviderTransaction>;
10
14
  symbols: Promise<Symbols> | Symbols;
11
15
  constructor(appId: string, store: StoreService<ProviderClient, ProviderTransaction>, logger: ILogger);
16
+ /**
17
+ * Convert the job hash into a JobExport object.
18
+ * This object contains various facets that describe the interaction
19
+ * in terms relevant to narrative storytelling.
20
+ */
12
21
  export(jobId: string, options?: ExportOptions): Promise<JobExport>;
22
+ /**
23
+ * Inflates the key from Redis, 3-character symbol
24
+ * into a human-readable JSON path, reflecting the
25
+ * tree-like structure of the unidimensional Hash
26
+ */
13
27
  inflateKey(key: string): string;
28
+ /**
29
+ * Inflates the job data from Redis into a JobExport object
30
+ * @param jobHash - the job data from Redis
31
+ * @param dependencyList - the list of dependencies for the job
32
+ * @returns - the inflated job data
33
+ */
14
34
  inflate(jobHash: StringStringType, dependencyList: string[]): JobExport;
35
+ /**
36
+ * Inflates the dependency data from Redis into a JobExport object by
37
+ * organizing the dimensional isolate in sch a way asto interleave
38
+ * into a story
39
+ * @param data - the dependency data from Redis
40
+ * @returns - the organized dependency data
41
+ */
15
42
  inflateDependencyData(data: string[], actions: JobActionExport): DependencyExport[];
16
43
  }
17
44
  export { ExporterService };
@@ -1 +1 @@
1
- 'use strict';const z=b;function b(c,d){const e=a();return b=function(f,g){f=f-0xc5;let h=e[f];return h;},b(c,d);}(function(c,d){const y=b,e=c();while(!![]){try{const f=-parseInt(y(0xcb))/0x1+-parseInt(y(0xe3))/0x2+-parseInt(y(0xdf))/0x3+parseInt(y(0xd4))/0x4+parseInt(y(0xd1))/0x5*(parseInt(y(0xdb))/0x6)+-parseInt(y(0xe4))/0x7*(parseInt(y(0xe5))/0x8)+-parseInt(y(0xcd))/0x9*(-parseInt(y(0xda))/0xa);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xaca5d));function a(){const G=['inflateDependencyData','replace','logger','12891290GDhOtU','42fSPYuE','entries','forEach','VALSEP','388809EUdslq','inflateKey','../../modules/utils','split','499000quTpuq','14PreMSr','3374776Jhnkzx','length','../../modules/key','ExporterService','fromString','SerializerService','export','appId','1056256gFkUxv','defineProperty','9dKzChj','match','restoreHierarchy','store','828705MlWsJL','inflate','join','2147608vatnah','hook','symbols'];a=function(){return G;};return a();}Object[z(0xcc)](exports,'__esModule',{'value':!![]}),exports[z(0xc6)]=void 0x0;const key_1=require(z(0xc5)),utils_1=require(z(0xe1)),serializer_1=require('../serializer');class ExporterService{constructor(c,d,e){const A=z;this[A(0xca)]=c,this[A(0xd9)]=e,this[A(0xd0)]=d;}async[z(0xc9)](c,d={}){const B=z;!this['symbols']&&(this['symbols']=this['store']['getAllSymbols'](),this[B(0xd6)]=await this[B(0xd6)]);const e=[],f=await this[B(0xd0)]['getRaw'](c),g=this['inflate'](f,e);return g;}['inflateKey'](c){const C=z;return c in this['symbols']?this[C(0xd6)][c]:c;}[z(0xd2)](c,d){const D=z,e={'hooks':{},'main':{'cursor':-0x1,'items':[]}},f={},g=this[D(0xd7)](d,e),h=/^([a-zA-Z]{3}),(\d+(?:,\d+)*)/;return Object[D(0xdc)](c)[D(0xdd)](([i,j])=>{const E=D,k=i[E(0xce)](h);if(k){const [l,m,n]=k,o=this[E(0xe0)](m),p=''+n[E(0xd8)](/,/g,'/'),q=serializer_1[E(0xc8)][E(0xc7)](j);f[p+'/'+o]=q;}else i[E(0xe6)]===0x3&&(f[this[E(0xe0)](i)]=serializer_1[E(0xc8)][E(0xc7)](j));}),{'dependencies':g,'process':(0x0,utils_1[D(0xcf)])(f),'status':c[':']};}[z(0xd7)](c,d){const e=/([0-9,]+)-(\d+)$/,f=/-(\d+)$/;return c['map']((g,h)=>{const F=b,[i,j,k,l,...m]=g['split'](key_1[F(0xde)]),n=m[F(0xd3)](key_1[F(0xde)]),o=n['match'](e);let p,q,r='';if(o){const [s,t,u]=o;r=t[F(0xe2)](',')[F(0xd3)]('/'),p=r+'['+u+']',q=F(0xd5);}else{const v=n[F(0xce)](f);if(v){const [w,x]=v;p='['+x+']',q='flow';}else p='/',q='other';}return{'type':i,'topic':j,'gid':k,'jid':n};});}}exports[z(0xc6)]=ExporterService;
1
+ 'use strict';const L=b;(function(c,d){const K=b,e=c();while(!![]){try{const f=-parseInt(K(0x1db))/0x1*(-parseInt(K(0x1ef))/0x2)+-parseInt(K(0x1fb))/0x3*(-parseInt(K(0x1fa))/0x4)+-parseInt(K(0x1dd))/0x5*(-parseInt(K(0x1e4))/0x6)+-parseInt(K(0x1ff))/0x7*(-parseInt(K(0x1ea))/0x8)+-parseInt(K(0x1f3))/0x9*(-parseInt(K(0x1e9))/0xa)+parseInt(K(0x1e0))/0xb*(parseInt(K(0x1ec))/0xc)+-parseInt(K(0x1ed))/0xd*(parseInt(K(0x1e3))/0xe);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x1c191));function a(){const T=['8pHwQbk','export','length','join','4356kFBSon','inflateDependencyData','../../modules/utils','../../modules/key','inflateKey','replace','SerializerService','88212fstbLL','24jsJWnq','flow','VALSEP','restoreHierarchy','54649ZTthdw','map','getAllSymbols','../serializer','inflate','34302DEHyzJ','getRaw','10jqiukc','store','match','2541pFpief','split','appId','434DFVGfU','233820WAMrql','symbols','__esModule','ExporterService','fromString','1380nBRioV','16yGbQSk','defineProperty','2868qOpyTv','173654mxKKcx','forEach'];a=function(){return T;};return a();}Object[L(0x1eb)](exports,L(0x1e6),{'value':!0x0}),exports[L(0x1e7)]=void 0x0;const key_1=require(L(0x1f6)),utils_1=require(L(0x1f5)),serializer_1=require(L(0x202));class ExporterService{constructor(c,d,f){const M=L;this[M(0x1e2)]=c,this['logger']=f,this['store']=d;}async[L(0x1f0)](c,d={}){const N=L;this[N(0x1e5)]||(this[N(0x1e5)]=this[N(0x1de)][N(0x201)](),this[N(0x1e5)]=await this[N(0x1e5)]);const f=await this[N(0x1de)][N(0x1dc)](c);return this[N(0x1da)](f,[]);}[L(0x1f7)](c){const O=L;return c in this[O(0x1e5)]?this[O(0x1e5)][c]:c;}[L(0x1da)](c,d){const P=L,f={},g=this[P(0x1f4)](d,{'hooks':{},'main':{'cursor':-0x1,'items':[]}}),h=/^([a-zA-Z]{3}),(\d+(?:,\d+)*)/;return Object['entries'](c)[P(0x1ee)](([j,k])=>{const Q=P,m=j[Q(0x1df)](h);if(m){const [p,q,u]=m,v=this[Q(0x1f7)](q),w=''+u[Q(0x1f8)](/,/g,'/'),x=serializer_1['SerializerService'][Q(0x1e8)](k);f[w+'/'+v]=x;}else 0x3===j[Q(0x1f1)]&&(f[this['inflateKey'](j)]=serializer_1[Q(0x1f9)][Q(0x1e8)](k));}),{'dependencies':g,'process':(0x0,utils_1[P(0x1fe)])(f),'status':c[':']};}[L(0x1f4)](c,d){const R=L,f=/([0-9,]+)-(\d+)$/,g=/-(\d+)$/;return c[R(0x200)]((j,k)=>{const S=R,[m,q,v,w,...x]=j[S(0x1e1)](key_1[S(0x1fd)]),z=x[S(0x1f2)](key_1['VALSEP']),A=z[S(0x1df)](f);let B,C,D='';if(A){const [E,F,G]=A;D=F[S(0x1e1)](',')[S(0x1f2)]('/'),B=D+'['+G+']',C='hook';}else{const H=z[S(0x1df)](g);if(H){const [I,J]=H;B='['+J+']',C=S(0x1fc);}else B='/',C='other';}return{'type':m,'topic':q,'gid':v,'jid':z};});}}function b(c,d){const e=a();return b=function(f,g){f=f-0x1da;let h=e[f];return h;},b(c,d);}exports[L(0x1e7)]=ExporterService;