@hotmeshio/hotmesh 0.3.32 → 0.4.0

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 (254) hide show
  1. package/README.md +128 -823
  2. package/build/index.d.ts +9 -9
  3. package/build/index.js +10 -10
  4. package/build/package.json +22 -21
  5. package/build/types/error.d.ts +5 -5
  6. package/build/types/exporter.d.ts +1 -1
  7. package/build/types/index.d.ts +3 -3
  8. package/build/types/manifest.d.ts +2 -2
  9. package/build/types/{meshflow.d.ts → memflow.d.ts} +15 -15
  10. package/build/types/meshdata.d.ts +3 -3
  11. package/build/types/postgres.d.ts +7 -0
  12. package/build/types/stream.d.ts +3 -0
  13. package/index.ts +11 -11
  14. package/package.json +22 -21
  15. package/typedoc.json +8 -7
  16. package/types/error.ts +5 -5
  17. package/types/exporter.ts +1 -1
  18. package/types/index.ts +7 -7
  19. package/types/manifest.ts +2 -2
  20. package/types/{meshflow.ts → memflow.ts} +15 -15
  21. package/types/meshdata.ts +3 -3
  22. package/types/postgres.ts +9 -0
  23. package/types/stream.ts +4 -0
  24. package/build/modules/enums.d.ts +0 -110
  25. package/build/modules/enums.js +0 -134
  26. package/build/modules/errors.d.ts +0 -124
  27. package/build/modules/errors.js +0 -191
  28. package/build/modules/key.d.ts +0 -66
  29. package/build/modules/key.js +0 -1
  30. package/build/modules/storage.d.ts +0 -3
  31. package/build/modules/storage.js +0 -5
  32. package/build/modules/utils.d.ts +0 -119
  33. package/build/modules/utils.js +0 -1
  34. package/build/services/activities/activity.d.ts +0 -104
  35. package/build/services/activities/activity.js +0 -1
  36. package/build/services/activities/await.d.ts +0 -12
  37. package/build/services/activities/await.js +0 -1
  38. package/build/services/activities/cycle.d.ts +0 -19
  39. package/build/services/activities/cycle.js +0 -1
  40. package/build/services/activities/hook.d.ts +0 -27
  41. package/build/services/activities/hook.js +0 -1
  42. package/build/services/activities/index.d.ts +0 -19
  43. package/build/services/activities/index.js +0 -1
  44. package/build/services/activities/interrupt.d.ts +0 -16
  45. package/build/services/activities/interrupt.js +0 -1
  46. package/build/services/activities/signal.d.ts +0 -20
  47. package/build/services/activities/signal.js +0 -1
  48. package/build/services/activities/trigger.d.ts +0 -37
  49. package/build/services/activities/trigger.js +0 -1
  50. package/build/services/activities/worker.d.ts +0 -12
  51. package/build/services/activities/worker.js +0 -1
  52. package/build/services/collator/index.d.ts +0 -111
  53. package/build/services/collator/index.js +0 -1
  54. package/build/services/compiler/deployer.d.ts +0 -40
  55. package/build/services/compiler/deployer.js +0 -1
  56. package/build/services/compiler/index.d.ts +0 -32
  57. package/build/services/compiler/index.js +0 -1
  58. package/build/services/compiler/validator.d.ts +0 -34
  59. package/build/services/compiler/validator.js +0 -1
  60. package/build/services/connector/factory.d.ts +0 -22
  61. package/build/services/connector/factory.js +0 -99
  62. package/build/services/connector/index.d.ts +0 -30
  63. package/build/services/connector/index.js +0 -54
  64. package/build/services/connector/providers/ioredis.d.ts +0 -9
  65. package/build/services/connector/providers/ioredis.js +0 -26
  66. package/build/services/connector/providers/nats.d.ts +0 -9
  67. package/build/services/connector/providers/nats.js +0 -34
  68. package/build/services/connector/providers/postgres.d.ts +0 -20
  69. package/build/services/connector/providers/postgres.js +0 -102
  70. package/build/services/connector/providers/redis.d.ts +0 -9
  71. package/build/services/connector/providers/redis.js +0 -38
  72. package/build/services/engine/index.d.ts +0 -264
  73. package/build/services/engine/index.js +0 -1
  74. package/build/services/exporter/index.d.ts +0 -44
  75. package/build/services/exporter/index.js +0 -1
  76. package/build/services/hotmesh/index.d.ts +0 -340
  77. package/build/services/hotmesh/index.js +0 -479
  78. package/build/services/logger/index.d.ts +0 -16
  79. package/build/services/logger/index.js +0 -54
  80. package/build/services/mapper/index.d.ts +0 -28
  81. package/build/services/mapper/index.js +0 -1
  82. package/build/services/meshcall/index.d.ts +0 -194
  83. package/build/services/meshcall/index.js +0 -452
  84. package/build/services/meshcall/schemas/factory.d.ts +0 -9
  85. package/build/services/meshcall/schemas/factory.js +0 -189
  86. package/build/services/meshdata/index.d.ts +0 -795
  87. package/build/services/meshdata/index.js +0 -1235
  88. package/build/services/meshflow/client.d.ts +0 -108
  89. package/build/services/meshflow/client.js +0 -371
  90. package/build/services/meshflow/connection.d.ts +0 -23
  91. package/build/services/meshflow/connection.js +0 -33
  92. package/build/services/meshflow/exporter.d.ts +0 -51
  93. package/build/services/meshflow/exporter.js +0 -1
  94. package/build/services/meshflow/handle.d.ts +0 -90
  95. package/build/services/meshflow/handle.js +0 -176
  96. package/build/services/meshflow/index.d.ts +0 -111
  97. package/build/services/meshflow/index.js +0 -117
  98. package/build/services/meshflow/schemas/factory.d.ts +0 -29
  99. package/build/services/meshflow/schemas/factory.js +0 -2492
  100. package/build/services/meshflow/search.d.ts +0 -142
  101. package/build/services/meshflow/search.js +0 -320
  102. package/build/services/meshflow/worker.d.ts +0 -124
  103. package/build/services/meshflow/worker.js +0 -514
  104. package/build/services/meshflow/workflow/all.d.ts +0 -7
  105. package/build/services/meshflow/workflow/all.js +0 -15
  106. package/build/services/meshflow/workflow/common.d.ts +0 -18
  107. package/build/services/meshflow/workflow/common.js +0 -45
  108. package/build/services/meshflow/workflow/context.d.ts +0 -6
  109. package/build/services/meshflow/workflow/context.js +0 -45
  110. package/build/services/meshflow/workflow/didRun.d.ts +0 -7
  111. package/build/services/meshflow/workflow/didRun.js +0 -22
  112. package/build/services/meshflow/workflow/emit.d.ts +0 -11
  113. package/build/services/meshflow/workflow/emit.js +0 -29
  114. package/build/services/meshflow/workflow/enrich.d.ts +0 -9
  115. package/build/services/meshflow/workflow/enrich.js +0 -17
  116. package/build/services/meshflow/workflow/execChild.d.ts +0 -18
  117. package/build/services/meshflow/workflow/execChild.js +0 -102
  118. package/build/services/meshflow/workflow/hook.d.ts +0 -9
  119. package/build/services/meshflow/workflow/hook.js +0 -40
  120. package/build/services/meshflow/workflow/index.d.ts +0 -70
  121. package/build/services/meshflow/workflow/index.js +0 -83
  122. package/build/services/meshflow/workflow/interrupt.d.ts +0 -9
  123. package/build/services/meshflow/workflow/interrupt.js +0 -24
  124. package/build/services/meshflow/workflow/isSideEffectAllowed.d.ts +0 -10
  125. package/build/services/meshflow/workflow/isSideEffectAllowed.js +0 -33
  126. package/build/services/meshflow/workflow/proxyActivities.d.ts +0 -20
  127. package/build/services/meshflow/workflow/proxyActivities.js +0 -97
  128. package/build/services/meshflow/workflow/random.d.ts +0 -6
  129. package/build/services/meshflow/workflow/random.js +0 -16
  130. package/build/services/meshflow/workflow/searchMethods.d.ts +0 -6
  131. package/build/services/meshflow/workflow/searchMethods.js +0 -25
  132. package/build/services/meshflow/workflow/signal.d.ts +0 -7
  133. package/build/services/meshflow/workflow/signal.js +0 -28
  134. package/build/services/meshflow/workflow/sleepFor.d.ts +0 -8
  135. package/build/services/meshflow/workflow/sleepFor.js +0 -35
  136. package/build/services/meshflow/workflow/trace.d.ts +0 -14
  137. package/build/services/meshflow/workflow/trace.js +0 -33
  138. package/build/services/meshflow/workflow/waitFor.d.ts +0 -8
  139. package/build/services/meshflow/workflow/waitFor.js +0 -35
  140. package/build/services/meshos/index.d.ts +0 -293
  141. package/build/services/meshos/index.js +0 -547
  142. package/build/services/pipe/functions/array.d.ts +0 -17
  143. package/build/services/pipe/functions/array.js +0 -1
  144. package/build/services/pipe/functions/bitwise.d.ts +0 -9
  145. package/build/services/pipe/functions/bitwise.js +0 -1
  146. package/build/services/pipe/functions/conditional.d.ts +0 -13
  147. package/build/services/pipe/functions/conditional.js +0 -1
  148. package/build/services/pipe/functions/cron.d.ts +0 -12
  149. package/build/services/pipe/functions/cron.js +0 -1
  150. package/build/services/pipe/functions/date.d.ts +0 -58
  151. package/build/services/pipe/functions/date.js +0 -1
  152. package/build/services/pipe/functions/index.d.ts +0 -29
  153. package/build/services/pipe/functions/index.js +0 -1
  154. package/build/services/pipe/functions/json.d.ts +0 -5
  155. package/build/services/pipe/functions/json.js +0 -1
  156. package/build/services/pipe/functions/logical.d.ts +0 -5
  157. package/build/services/pipe/functions/logical.js +0 -1
  158. package/build/services/pipe/functions/math.d.ts +0 -42
  159. package/build/services/pipe/functions/math.js +0 -1
  160. package/build/services/pipe/functions/number.d.ts +0 -21
  161. package/build/services/pipe/functions/number.js +0 -1
  162. package/build/services/pipe/functions/object.d.ts +0 -25
  163. package/build/services/pipe/functions/object.js +0 -1
  164. package/build/services/pipe/functions/string.d.ts +0 -23
  165. package/build/services/pipe/functions/string.js +0 -1
  166. package/build/services/pipe/functions/symbol.d.ts +0 -12
  167. package/build/services/pipe/functions/symbol.js +0 -1
  168. package/build/services/pipe/functions/unary.d.ts +0 -7
  169. package/build/services/pipe/functions/unary.js +0 -1
  170. package/build/services/pipe/index.d.ts +0 -48
  171. package/build/services/pipe/index.js +0 -1
  172. package/build/services/quorum/index.d.ts +0 -90
  173. package/build/services/quorum/index.js +0 -1
  174. package/build/services/reporter/index.d.ts +0 -50
  175. package/build/services/reporter/index.js +0 -1
  176. package/build/services/router/index.d.ts +0 -60
  177. package/build/services/router/index.js +0 -1
  178. package/build/services/search/factory.d.ts +0 -7
  179. package/build/services/search/factory.js +0 -24
  180. package/build/services/search/index.d.ts +0 -22
  181. package/build/services/search/index.js +0 -10
  182. package/build/services/search/providers/postgres/postgres.d.ts +0 -24
  183. package/build/services/search/providers/postgres/postgres.js +0 -1
  184. package/build/services/search/providers/redis/ioredis.d.ts +0 -18
  185. package/build/services/search/providers/redis/ioredis.js +0 -1
  186. package/build/services/search/providers/redis/redis.d.ts +0 -18
  187. package/build/services/search/providers/redis/redis.js +0 -1
  188. package/build/services/serializer/index.d.ts +0 -42
  189. package/build/services/serializer/index.js +0 -1
  190. package/build/services/store/cache.d.ts +0 -67
  191. package/build/services/store/cache.js +0 -128
  192. package/build/services/store/factory.d.ts +0 -8
  193. package/build/services/store/factory.js +0 -24
  194. package/build/services/store/index.d.ts +0 -89
  195. package/build/services/store/index.js +0 -9
  196. package/build/services/store/providers/postgres/kvsql.d.ts +0 -168
  197. package/build/services/store/providers/postgres/kvsql.js +0 -1
  198. package/build/services/store/providers/postgres/kvtables.d.ts +0 -20
  199. package/build/services/store/providers/postgres/kvtables.js +0 -1
  200. package/build/services/store/providers/postgres/kvtransaction.d.ts +0 -36
  201. package/build/services/store/providers/postgres/kvtransaction.js +0 -1
  202. package/build/services/store/providers/postgres/kvtypes/hash.d.ts +0 -60
  203. package/build/services/store/providers/postgres/kvtypes/hash.js +0 -1
  204. package/build/services/store/providers/postgres/kvtypes/list.d.ts +0 -33
  205. package/build/services/store/providers/postgres/kvtypes/list.js +0 -1
  206. package/build/services/store/providers/postgres/kvtypes/string.d.ts +0 -20
  207. package/build/services/store/providers/postgres/kvtypes/string.js +0 -1
  208. package/build/services/store/providers/postgres/kvtypes/zset.d.ts +0 -41
  209. package/build/services/store/providers/postgres/kvtypes/zset.js +0 -1
  210. package/build/services/store/providers/postgres/postgres.d.ts +0 -145
  211. package/build/services/store/providers/postgres/postgres.js +0 -1
  212. package/build/services/store/providers/redis/_base.d.ts +0 -137
  213. package/build/services/store/providers/redis/_base.js +0 -1
  214. package/build/services/store/providers/redis/ioredis.d.ts +0 -20
  215. package/build/services/store/providers/redis/ioredis.js +0 -1
  216. package/build/services/store/providers/redis/redis.d.ts +0 -18
  217. package/build/services/store/providers/redis/redis.js +0 -1
  218. package/build/services/store/providers/store-initializable.d.ts +0 -5
  219. package/build/services/store/providers/store-initializable.js +0 -1
  220. package/build/services/stream/factory.d.ts +0 -8
  221. package/build/services/stream/factory.js +0 -37
  222. package/build/services/stream/index.d.ts +0 -64
  223. package/build/services/stream/index.js +0 -11
  224. package/build/services/stream/providers/nats/nats.d.ts +0 -59
  225. package/build/services/stream/providers/nats/nats.js +0 -1
  226. package/build/services/stream/providers/postgres/kvtables.d.ts +0 -2
  227. package/build/services/stream/providers/postgres/kvtables.js +0 -1
  228. package/build/services/stream/providers/postgres/postgres.d.ts +0 -88
  229. package/build/services/stream/providers/postgres/postgres.js +0 -1
  230. package/build/services/stream/providers/redis/ioredis.d.ts +0 -60
  231. package/build/services/stream/providers/redis/ioredis.js +0 -1
  232. package/build/services/stream/providers/redis/redis.d.ts +0 -60
  233. package/build/services/stream/providers/redis/redis.js +0 -1
  234. package/build/services/stream/providers/stream-initializable.d.ts +0 -4
  235. package/build/services/stream/providers/stream-initializable.js +0 -1
  236. package/build/services/sub/factory.d.ts +0 -7
  237. package/build/services/sub/factory.js +0 -29
  238. package/build/services/sub/index.d.ts +0 -22
  239. package/build/services/sub/index.js +0 -10
  240. package/build/services/sub/providers/nats/nats.d.ts +0 -19
  241. package/build/services/sub/providers/nats/nats.js +0 -1
  242. package/build/services/sub/providers/postgres/postgres.d.ts +0 -19
  243. package/build/services/sub/providers/postgres/postgres.js +0 -1
  244. package/build/services/sub/providers/redis/ioredis.d.ts +0 -17
  245. package/build/services/sub/providers/redis/ioredis.js +0 -1
  246. package/build/services/sub/providers/redis/redis.d.ts +0 -17
  247. package/build/services/sub/providers/redis/redis.js +0 -1
  248. package/build/services/task/index.d.ts +0 -36
  249. package/build/services/task/index.js +0 -1
  250. package/build/services/telemetry/index.d.ts +0 -52
  251. package/build/services/telemetry/index.js +0 -1
  252. package/build/services/worker/index.d.ts +0 -77
  253. package/build/services/worker/index.js +0 -1
  254. /package/build/types/{meshflow.js → memflow.js} +0 -0
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SearchServiceFactory = void 0;
4
- const utils_1 = require("../../modules/utils");
5
- const postgres_1 = require("./providers/postgres/postgres");
6
- const ioredis_1 = require("./providers/redis/ioredis");
7
- const redis_1 = require("./providers/redis/redis");
8
- class SearchServiceFactory {
9
- static async init(providerClient, storeProviderClient, namespace, appId, logger) {
10
- let service;
11
- if ((0, utils_1.identifyProvider)(providerClient) === 'postgres') {
12
- service = new postgres_1.PostgresSearchService(providerClient, storeProviderClient);
13
- }
14
- else if ((0, utils_1.identifyProvider)(providerClient) === 'redis') {
15
- service = new redis_1.RedisSearchService(providerClient, storeProviderClient);
16
- }
17
- else {
18
- service = new ioredis_1.IORedisSearchService(providerClient, storeProviderClient);
19
- }
20
- await service.init(namespace, appId, logger);
21
- return service;
22
- }
23
- }
24
- exports.SearchServiceFactory = SearchServiceFactory;
@@ -1,22 +0,0 @@
1
- import { ILogger } from '../logger';
2
- import { ProviderClient } from '../../types/provider';
3
- declare abstract class SearchService<ClientProvider extends ProviderClient> {
4
- protected searchClient: ClientProvider;
5
- protected storeClient: ClientProvider;
6
- protected namespace: string;
7
- protected logger: ILogger;
8
- protected appId: string;
9
- constructor(searchClient: ClientProvider, storeClient?: ClientProvider);
10
- abstract init(namespace: string, appId: string, logger: ILogger): Promise<void>;
11
- abstract createSearchIndex(indexName: string, prefixes: string[], schema: string[]): Promise<void>;
12
- abstract listSearchIndexes(): Promise<string[]>;
13
- abstract setFields(key: string, fields: Record<string, string>): Promise<number>;
14
- abstract getField(key: string, field: string): Promise<string>;
15
- abstract getFields(key: string, fields: string[]): Promise<string[]>;
16
- abstract getAllFields(key: string): Promise<Record<string, string>>;
17
- abstract deleteFields(key: string, fields: string[]): Promise<number>;
18
- abstract incrementFieldByFloat(key: string, field: string, increment: number): Promise<number>;
19
- abstract sendQuery(query: any): Promise<any>;
20
- abstract sendIndexedQuery(index: string, query: any[]): Promise<any>;
21
- }
22
- export { SearchService };
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SearchService = void 0;
4
- class SearchService {
5
- constructor(searchClient, storeClient) {
6
- this.searchClient = searchClient;
7
- this.storeClient = storeClient;
8
- }
9
- }
10
- exports.SearchService = SearchService;
@@ -1,24 +0,0 @@
1
- import { SearchService } from '../../index';
2
- import { ILogger } from '../../../logger';
3
- import { PostgresClientType } from '../../../../types/postgres';
4
- import { ProviderClient, ProviderTransaction } from '../../../../types/provider';
5
- declare class PostgresSearchService extends SearchService<PostgresClientType & ProviderClient> {
6
- pgClient: PostgresClientType;
7
- transact(): ProviderTransaction;
8
- constructor(searchClient: PostgresClientType & ProviderClient, storeClient?: PostgresClientType & ProviderClient);
9
- init(namespace: string, appId: string, logger: ILogger): Promise<void>;
10
- createSearchIndex(indexName: string, prefixes: string[], schema: string[]): Promise<void>;
11
- listSearchIndexes(): Promise<string[]>;
12
- setFields(key: string, fields: Record<string, string>): Promise<number>;
13
- getField(key: string, field: string): Promise<string>;
14
- getFields(key: string, fields: string[]): Promise<string[]>;
15
- getAllFields(key: string): Promise<Record<string, string>>;
16
- deleteFields(key: string, fields: string[]): Promise<number>;
17
- incrementFieldByFloat(key: string, field: string, increment: number): Promise<number>;
18
- sendQuery(query: string): Promise<any>;
19
- /**
20
- * assume aggregation type query
21
- */
22
- sendIndexedQuery(type: string, queryParams?: any[]): Promise<any[]>;
23
- }
24
- export { PostgresSearchService };
@@ -1 +0,0 @@
1
- 'use strict';const j=b;(function(c,d){const i=b,e=c();while(!![]){try{const f=parseInt(i(0x141))/0x1*(-parseInt(i(0x153))/0x2)+parseInt(i(0x15d))/0x3+parseInt(i(0x14c))/0x4*(parseInt(i(0x144))/0x5)+parseInt(i(0x14b))/0x6*(parseInt(i(0x14e))/0x7)+-parseInt(i(0x136))/0x8*(-parseInt(i(0x142))/0x9)+-parseInt(i(0x15c))/0xa*(-parseInt(i(0x15f))/0xb)+parseInt(i(0x161))/0xc*(-parseInt(i(0x155))/0xd);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xacde5));function b(c,d){const e=a();return b=function(f,g){f=f-0x136;let h=e[f];return h;},b(c,d);}function a(){const v=['6anyGPX','setFields','13kwJHpP','searchClient','__esModule','transact','../../index','logger','pgClient','195080WqTXji','259623TTYSmv','defineProperty','759wntsWh','hget','34858500VdeRAY','14848ueSSon','postgres-increment-field-error','PostgresSearchService','../../../store/providers/postgres/kvsql','sendIndexedQuery','appId','createSearchIndex','SearchService','incrementFieldByFloat','init','postgres-send-query-error','56466sDWyBo','4986XHflHf','postgres-search-get-fields-error','50MizahN','namespace','listSearchIndexes','KVSQL','postgres-send-indexed-query-error','getFields','hdel','78vCkzzM','523436IMpUNq','query','6965sLzuFL','length','hgetall','error','rows'];a=function(){return v;};return a();}Object[j(0x15e)](exports,j(0x157),{'value':!0x0}),exports[j(0x138)]=void 0x0;const index_1=require(j(0x159)),kvsql_1=require(j(0x139));class PostgresSearchService extends index_1[j(0x13d)]{[j(0x158)](){const k=j;return this['storeClient'][k(0x158)]();}constructor(c,d){const l=j;super(c,d),this[l(0x15b)]=c,this[l(0x156)]=new kvsql_1[(l(0x147))](c,this[l(0x145)],this['appId']);}async[j(0x13f)](c,d,f){const m=j;this[m(0x156)]['namespace']=this['namespace']=c,this[m(0x156)][m(0x13b)]=this[m(0x13b)]=d,this['namespace']=c,this[m(0x13b)]=d,this[m(0x15a)]=f;}async[j(0x13c)](c,d,f){}async[j(0x146)](){return[];}async[j(0x154)](c,d){const n=j;try{const f=await this['searchClient']['hset'](c,d);return Number(f);}catch(g){throw this[n(0x15a)][n(0x151)]('postgres-search-set-fields-error',{'key':c,'error':g}),g;}}async['getField'](c,d){const o=j;try{return await this[o(0x156)][o(0x160)](c,d);}catch(f){throw this[o(0x15a)]['error']('postgres-search-get-field-error',{'key':c,'field':d,'error':f}),f;}}async[j(0x149)](c,d){const p=j;try{return await this[p(0x156)]['hmget'](c,[...d]);}catch(f){throw this[p(0x15a)][p(0x151)](p(0x143),{'key':c,'fields':d,'error':f}),f;}}async['getAllFields'](c){const q=j;try{return await this[q(0x156)][q(0x150)](c);}catch(d){throw this[q(0x15a)][q(0x151)]('postgres-search-get-all-fields-error',{'key':c,'error':d}),d;}}async['deleteFields'](c,d){const r=j;try{const f=await this['searchClient'][r(0x14a)](c,d);return Number(f);}catch(g){throw this[r(0x15a)][r(0x151)]('postgres-search-delete-fields-error',{'key':c,'fields':d,'error':g}),g;}}async[j(0x13e)](c,d,f){const s=j;try{const g=await this[s(0x156)]['hincrbyfloat'](c,d,f);return Number(g);}catch(h){throw this[s(0x15a)][s(0x151)](s(0x137),{'key':c,'field':d,'error':h}),h;}}async['sendQuery'](c){const t=j;try{return await this[t(0x15b)]['query'](c);}catch(d){throw this[t(0x15a)][t(0x151)](t(0x140),{'query':c,'error':d}),d;}}async[j(0x13a)](c,d=[]){const u=j,[f,...g]=d;try{return(await this[u(0x15b)][u(0x14d)](f,g[u(0x14f)]?g:void 0x0))[u(0x152)];}catch(h){throw this[u(0x15a)][u(0x151)](u(0x148),{'query':f,'error':h}),h;}}}exports['PostgresSearchService']=PostgresSearchService;
@@ -1,18 +0,0 @@
1
- import { SearchService } from '../../index';
2
- import { ILogger } from '../../../logger';
3
- import { IORedisClientType } from '../../../../types/redis';
4
- declare class IORedisSearchService extends SearchService<IORedisClientType> {
5
- constructor(searchClient: IORedisClientType, storeClient?: IORedisClientType);
6
- init(namespace: string, appId: string, logger: ILogger): Promise<void>;
7
- createSearchIndex(indexName: string, prefixes: string[], schema: string[]): Promise<void>;
8
- listSearchIndexes(): Promise<string[]>;
9
- setFields(key: string, fields: Record<string, string>): Promise<number>;
10
- getField(key: string, field: string): Promise<string>;
11
- getFields(key: string, fields: string[]): Promise<string[]>;
12
- getAllFields(key: string): Promise<Record<string, string>>;
13
- deleteFields(key: string, fields: string[]): Promise<number>;
14
- incrementFieldByFloat(key: string, field: string, increment: number): Promise<number>;
15
- sendQuery(...query: [string, ...string[]]): Promise<any>;
16
- sendIndexedQuery(index: string, query: string[]): Promise<string[]>;
17
- }
18
- export { IORedisSearchService };
@@ -1 +0,0 @@
1
- 'use strict';const j=b;(function(c,d){const i=b,e=c();while(!![]){try{const f=parseInt(i(0x1f4))/0x1*(parseInt(i(0x202))/0x2)+parseInt(i(0x1d7))/0x3*(parseInt(i(0x1dc))/0x4)+parseInt(i(0x1dd))/0x5*(-parseInt(i(0x1ff))/0x6)+parseInt(i(0x1d9))/0x7*(parseInt(i(0x1ed))/0x8)+-parseInt(i(0x1e2))/0x9*(parseInt(i(0x1eb))/0xa)+-parseInt(i(0x1e5))/0xb*(-parseInt(i(0x1f9))/0xc)+-parseInt(i(0x1f5))/0xd*(parseInt(i(0x1f8))/0xe);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x967e0));function a(){const u=['Error\x20executing\x20query','IORedisSearchService','9GayifV','toString','7THiXUf','hmget','sendQuery','31308SJKrIQ','115rhhWyl','hget','__esModule','getField','incrementFieldByFloat','117nrtamV','HASH','../../index','407OxfXpM','error','sendIndexedQuery','defineProperty','Error\x20getting\x20fields\x20for\x20key:\x20','SearchService','423060luLnal','call','8947688fyOIbD','\x20for\x20key:\x20','listSearchIndexes','Error\x20setting\x20fields\x20for\x20key:\x20','FT.SEARCH','FT.CREATE','Error\x20getting\x20field\x20','10UsyyrF','184275IbGpsk','searchClient','startsWith','294OmTJUZ','30420bwQZOX','SCHEMA','logger','Error\x20incrementing\x20field\x20','FT._LIST','Error\x20deleting\x20fields\x20for\x20key:\x20','243816eXykvL','init','setFields','232592GzEBiG','info','hincrbyfloat','PREFIX'];a=function(){return u;};return a();}Object[j(0x1e8)](exports,j(0x1df),{'value':!0x0}),exports[j(0x1d6)]=void 0x0;const index_1=require(j(0x1e4));class IORedisSearchService extends index_1[j(0x1ea)]{constructor(c,d){super(c,d);}async[j(0x200)](c,d,f){this['namespace']=c,this['appId']=d,this['logger']=f;}async['createSearchIndex'](c,d,f){const k=j;try{await this[k(0x1f6)][k(0x1ec)](k(0x1f2),c,'ON',k(0x1e3),k(0x205),d['length'][k(0x1d8)](),...d,k(0x1fa),...f);}catch(g){throw this[k(0x1fb)]['info']('Error\x20creating\x20search\x20index',{'error':g}),g;}}async[j(0x1ef)](){const l=j;try{return await this[l(0x1f6)][l(0x1ec)](l(0x1fd));}catch(c){throw this[l(0x1fb)][l(0x203)]('Error\x20listing\x20search\x20indexes',{'error':c}),c;}}async[j(0x201)](c,d){const m=j;try{const f=await this[m(0x1f6)]['hset'](c,d);return Number(f);}catch(g){throw this[m(0x1fb)][m(0x1e6)](m(0x1f0)+c,{'error':g}),g;}}async[j(0x1e0)](c,d){const n=j;try{return await this[n(0x1f6)][n(0x1de)](c,d);}catch(f){throw this[n(0x1fb)][n(0x1e6)](n(0x1f3)+d+n(0x1ee)+c,{'error':f}),f;}}async['getFields'](c,d){const o=j;try{return await this['searchClient'][o(0x1da)](c,[...d]);}catch(f){throw this['logger']['error'](o(0x1e9)+c,{'error':f}),f;}}async['getAllFields'](c){const p=j;try{return await this['searchClient']['hgetall'](c);}catch(d){throw this['logger'][p(0x1e6)](p(0x1e9)+c,{'error':d}),d;}}async['deleteFields'](c,d){const q=j;try{const f=await this[q(0x1f6)]['hdel'](c,...d);return Number(f);}catch(g){throw this[q(0x1fb)][q(0x1e6)](q(0x1fe)+c,{'error':g}),g;}}async[j(0x1e1)](c,d,f){const r=j;try{const g=await this['searchClient'][r(0x204)](c,d,f);return Number(g);}catch(h){throw this[r(0x1fb)][r(0x1e6)](r(0x1fc)+d+r(0x1ee)+c,{'error':h}),h;}}async[j(0x1db)](...c){const s=j;try{return await this['searchClient'][s(0x1ec)](...c);}catch(d){throw this[s(0x1fb)][s(0x1e6)](s(0x206),{'error':d}),d;}}async[j(0x1e7)](c,d){const t=j;try{if(d[0x0]?.[t(0x1f7)]('FT.')){const [f,...g]=d;return await this[t(0x1f6)][t(0x1ec)](f,...g);}return await this[t(0x1f6)][t(0x1ec)](t(0x1f1),c,...d);}catch(h){throw this[t(0x1fb)]['error'](t(0x206),{'error':h}),h;}}}function b(c,d){const e=a();return b=function(f,g){f=f-0x1d6;let h=e[f];return h;},b(c,d);}exports['IORedisSearchService']=IORedisSearchService;
@@ -1,18 +0,0 @@
1
- import { SearchService } from '../../index';
2
- import { ILogger } from '../../../logger';
3
- import { RedisRedisClientType } from '../../../../types/redis';
4
- declare class RedisSearchService extends SearchService<RedisRedisClientType> {
5
- constructor(searchClient: RedisRedisClientType, storeClient?: RedisRedisClientType);
6
- init(namespace: string, appId: string, logger: ILogger): Promise<void>;
7
- createSearchIndex(indexName: string, prefixes: string[], schema: string[]): Promise<void>;
8
- listSearchIndexes(): Promise<string[]>;
9
- setFields(key: string, fields: Record<string, string>): Promise<number>;
10
- getField(key: string, field: string): Promise<string>;
11
- getFields(key: string, fields: string[]): Promise<string[]>;
12
- getAllFields(key: string): Promise<Record<string, string>>;
13
- deleteFields(key: string, fields: string[]): Promise<number>;
14
- incrementFieldByFloat(key: string, field: string, increment: number): Promise<number>;
15
- sendQuery(...query: any[]): Promise<any>;
16
- sendIndexedQuery(index: string, query: string[]): Promise<string[]>;
17
- }
18
- export { RedisSearchService };
@@ -1 +0,0 @@
1
- 'use strict';const j=b;(function(c,d){const i=b,e=c();while(!![]){try{const f=-parseInt(i(0x184))/0x1*(-parseInt(i(0x15e))/0x2)+-parseInt(i(0x166))/0x3*(-parseInt(i(0x173))/0x4)+parseInt(i(0x168))/0x5*(parseInt(i(0x183))/0x6)+-parseInt(i(0x180))/0x7+-parseInt(i(0x15d))/0x8+-parseInt(i(0x16e))/0x9*(-parseInt(i(0x161))/0xa)+-parseInt(i(0x189))/0xb*(parseInt(i(0x169))/0xc);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xab193));function b(c,d){const e=a();return b=function(f,g){f=f-0x159;let h=e[f];return h;},b(c,d);}Object[j(0x162)](exports,j(0x177),{'value':!0x0}),exports[j(0x163)]=void 0x0;const index_1=require(j(0x165));function a(){const v=['sendCommand','145JApbBj','3467892psyClD','FT.CREATE','HDEL','init','info','639FaoPwR','Error\x20creating\x20search\x20index','HGETALL','getAllFields','HSET','8jxzHVO','Error\x20incrementing\x20field\x20','createSearchIndex','error','__esModule','setFields','incrementFieldByFloat','HASH','\x20for\x20key:\x20','FT.SEARCH','getFields','Error\x20getting\x20fields\x20for\x20key:\x20','Error\x20setting\x20fields\x20for\x20key:\x20','4119248hhJGRp','SearchService','namespace','208836rtkStq','2KeNyDD','listSearchIndexes','Error\x20executing\x20query','toString','FT._LIST','44wYdRhi','sendQuery','HGET','appId','searchClient','7652768myBdgQ','1310356MnstlD','getField','length','121190dqQySt','defineProperty','RedisSearchService','logger','../../index','332496nQkFJJ'];a=function(){return v;};return a();}class RedisSearchService extends index_1[j(0x181)]{constructor(c,d){super(c,d);}async[j(0x16c)](c,d,f){const k=j;this[k(0x182)]=c,this[k(0x15b)]=d,this[k(0x164)]=f;}async[j(0x175)](c,d,f){const l=j;try{await this[l(0x15c)][l(0x167)]([l(0x16a),c,'ON',l(0x17a),'PREFIX',d[l(0x160)][l(0x187)](),...d,'SCHEMA',...f]);}catch(g){throw this[l(0x164)][l(0x16d)](l(0x16f),{'error':g}),g;}}async[j(0x185)](){const m=j;try{return await this[m(0x15c)]['sendCommand']([m(0x188)]);}catch(c){throw this['logger'][m(0x16d)]('Error\x20listing\x20search\x20indexes',{'error':c}),c;}}async[j(0x178)](c,d){const n=j;try{const f=await this[n(0x15c)][n(0x172)](c,d);return Number(f);}catch(g){throw this[n(0x164)]['error'](n(0x17f)+c,{'error':g}),g;}}async[j(0x15f)](c,d){const o=j;try{return await this[o(0x15c)][o(0x15a)](c,d);}catch(f){throw this[o(0x164)][o(0x176)]('Error\x20getting\x20field\x20'+d+o(0x17b)+c,{'error':f}),f;}}async[j(0x17d)](c,d){const p=j;try{return await this[p(0x15c)]['HMGET'](c,[...d]);}catch(f){throw this[p(0x164)]['error']('Error\x20getting\x20fields\x20for\x20key:\x20'+c,{'error':f}),f;}}async[j(0x171)](c){const q=j;try{return await this[q(0x15c)][q(0x170)](c);}catch(d){throw this[q(0x164)][q(0x176)](q(0x17e)+c,{'error':d}),d;}}async['deleteFields'](c,d){const r=j;try{const f=await this['searchClient'][r(0x16b)](c,d);return Number(f);}catch(g){throw this[r(0x164)][r(0x176)]('Error\x20deleting\x20fields\x20for\x20key:\x20'+c,{'error':g}),g;}}async[j(0x179)](c,d,f){const s=j;try{const g=await this[s(0x15c)]['HINCRBYFLOAT'](c,d,f);return Number(g);}catch(h){throw this[s(0x164)][s(0x176)](s(0x174)+d+'\x20for\x20key:\x20'+c,{'error':h}),h;}}async[j(0x159)](...c){const t=j;try{return await this[t(0x15c)][t(0x167)](c);}catch(d){throw this[t(0x164)]['error'](t(0x186),{'error':d}),d;}}async['sendIndexedQuery'](c,d){const u=j;try{return d[0x0]?.['startsWith']('FT.')?await this[u(0x15c)]['sendCommand'](d):await this['searchClient'][u(0x167)]([u(0x17c),c,...d]);}catch(f){throw this['logger'][u(0x176)](u(0x186),{'error':f}),f;}}}exports['RedisSearchService']=RedisSearchService;
@@ -1,42 +0,0 @@
1
- import { Consumes } from '../../types/activity';
2
- import { StringStringType, StringAnyType, SymbolMap, SymbolMaps, SymbolSets, Symbols } from '../../types/serializer';
3
- export declare const MDATA_SYMBOLS: {
4
- SLOTS: number;
5
- ACTIVITY: {
6
- KEYS: string[];
7
- };
8
- ACTIVITY_UPDATE: {
9
- KEYS: string[];
10
- };
11
- JOB: {
12
- KEYS: string[];
13
- };
14
- JOB_UPDATE: {
15
- KEYS: string[];
16
- };
17
- };
18
- export declare class SerializerService {
19
- dIds: StringStringType;
20
- symKeys: SymbolMaps;
21
- symReverseKeys: SymbolMaps;
22
- symValMaps: SymbolMap;
23
- symValReverseMaps: SymbolMap;
24
- constructor();
25
- abbreviate(consumes: Consumes, symbolNames: string[], fields?: string[]): string[];
26
- resolveDimensionalIndex(path: string): string;
27
- isJobPath(path: string): boolean;
28
- resetSymbols(symKeys: SymbolSets, symVals: Symbols, dIds: StringStringType): void;
29
- getReverseKeyMap(keyMap: SymbolMap, id?: string): SymbolMap;
30
- getReverseValueMap(valueMap: SymbolMap): SymbolMap;
31
- static filterSymVals(startIndex: number, maxIndex: number, existingSymbolValues: Symbols, proposedValues: Set<string>): Symbols;
32
- compress(document: StringStringType, ids: string[]): StringStringType;
33
- isLiteralKeyType(key: string): boolean;
34
- decompress(document: StringStringType, ids: string[]): StringStringType;
35
- stringify(document: Record<string, any>): StringStringType;
36
- parse(document: StringStringType): any;
37
- static toString(value: any): string | undefined;
38
- static fromString(value: string | undefined): any;
39
- package(multiDimensionalDocument: StringAnyType, ids: string[]): StringStringType;
40
- unpackage(document: StringStringType, ids: string[]): StringAnyType;
41
- export(): SymbolSets;
42
- }
@@ -1 +0,0 @@
1
- 'use strict';function b(c,d){const e=a();return b=function(f,g){f=f-0x151;let h=e[f];return h;},b(c,d);}const q=b;(function(c,d){const p=b,e=c();while(!![]){try{const f=-parseInt(p(0x16b))/0x1+parseInt(p(0x16d))/0x2*(parseInt(p(0x194))/0x3)+-parseInt(p(0x18f))/0x4*(-parseInt(p(0x170))/0x5)+-parseInt(p(0x169))/0x6*(parseInt(p(0x157))/0x7)+-parseInt(p(0x176))/0x8*(-parseInt(p(0x177))/0x9)+-parseInt(p(0x18e))/0xa*(parseInt(p(0x188))/0xb)+parseInt(p(0x16f))/0xc*(parseInt(p(0x167))/0xd);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x2fc2b));Object['defineProperty'](exports,q(0x160),{'value':!0x0}),exports[q(0x184)]=exports[q(0x15b)]=void 0x0;function a(){const K=['get','392tlsKCH','compress','parse','size','MDATA_SYMBOLS','includes','toString','metadata/','getReverseKeyMap','__esModule','entries','gid','dIds','push','symValMaps','has','1431547YwpqUn','stp','39708TiKXYd','err','176322wqczRt','object','2ySERZC','l2s','60YlPupr','100155umrBCr','abbreviate','symReverseKeys','resetSymbols','unpackage','$ADJACENT','8vxBsep','677007gsiEwy','metadata','data/','resolveDimensionalIndex','ngn','slice','values','dad','add','stringify','set','number','atp','SerializerService','boolean','key','package','1826ZbWWOw','export','decompress','l1s','undefined','symValReverseMaps','13190FrwAjM','16MfZydx','split','fromString','getReverseValueMap','isLiteralKeyType','766707kYSajj','jid','exec','isJobPath','startsWith','data','string','app','../../modules/utils','aid','symKeys'];a=function(){return K;};return a();}const utils_1=require(q(0x153)),dateReg=/^"\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z)?"$/;exports[q(0x15b)]={'SLOTS':0x1a,'ACTIVITY':{'KEYS':['aid',q(0x17e),'as',q(0x183),q(0x168),'ac','au',q(0x16a),q(0x18b),q(0x16e)]},'ACTIVITY_UPDATE':{'KEYS':['au','err',q(0x16e)]},'JOB':{'KEYS':[q(0x17b),'tpc','pj','pg','pd','px','pa',q(0x186),q(0x152),'vrs',q(0x195),q(0x162),q(0x154),'ts','jc','ju','js',q(0x16a),'trc']},'JOB_UPDATE':{'KEYS':['ju',q(0x16a)]}};class SerializerService{constructor(){this['resetSymbols']({},{},{});}[q(0x171)](c,d,f=[]){const r=q;for(const g of d){const h=this[r(0x155)][r(0x156)](g),j=c[g];for(const k of j){const l=h[r(0x156)](k);if(l){const m=this[r(0x17a)](k);f[r(0x164)](''+l+m);}else f[r(0x164)](k);}}return f;}[q(0x17a)](c){const s=q;if(this[s(0x197)](c))return'';{const [d]=c[s(0x190)]('/');return d in this[s(0x163)]?this[s(0x163)][d]:s(0x175)in this[s(0x163)]?this['dIds'][s(0x175)]:',0';}}[q(0x197)](c){const t=q;return c['startsWith'](t(0x179))||c[t(0x198)](t(0x15e));}[q(0x173)](c,d,f){const u=q;this[u(0x155)]=new Map(),this['symReverseKeys']=new Map();for(const g in c)this[u(0x155)]['set'](g,new Map(Object[u(0x161)](c[g])));this[u(0x165)]=new Map(Object[u(0x161)](d)),this[u(0x18d)]=this[u(0x192)](this[u(0x165)]),this[u(0x163)]=f;}[q(0x15f)](c,d){const v=q;let f=this[v(0x172)][v(0x156)](d);if(!f){f=new Map();for(const [g,h]of c[v(0x161)]())f[v(0x181)](h,g);this['symReverseKeys']['set'](d,f);}return f;}[q(0x192)](c){const w=q,d=new Map();for(const [f,g]of c[w(0x161)]())d[w(0x181)](g,f);return d;}static['filterSymVals'](c,d,f,g){const x=q,h={},j={...f},k=new Set(Object[x(0x17d)](j));for(const l of g)if(!k[x(0x166)](l)){if(c>d)return h;const m=(0x0,utils_1['getSymVal'])(c);c++,h[m]=l,k[x(0x17f)](l);}return h;}[q(0x158)](c,d){const y=q;if(0x0===this[y(0x155)][y(0x15a)])return c;const f={...c},g={},h=(j,k)=>{const z=y;for(const l in f)if(l[z(0x198)](k+'/')||k[z(0x198)]('$')&&[z(0x199),z(0x178)][z(0x15c)](l[z(0x190)]('/')[0x0])){const m=this[z(0x17a)](l),o=j[z(0x156)](l)||l;g[''+o+m]=f[l];}else!(l in g)&&this[z(0x193)](l)&&(g[l]=f[l]);};for(const j of d){const k=this['symKeys'][y(0x156)](j);k&&h(k,j);}return g;}[q(0x193)](c){const A=q;return c[A(0x198)]('-')||c[A(0x198)]('_');}[q(0x18a)](c,d){const C=q;if(0x0===this['symKeys']['size'])return c;const f={...c},g=(h,j)=>{const B=b,k=this[B(0x15f)](h,j);for(const l in f){const m=l['split'](',')[0x0],n=k[B(0x156)](m);n&&(f[n]=f[l],delete f[l]);}};for(const h of d){const i=this[C(0x155)][C(0x156)](h);i&&g(i,h);}return f;}[q(0x180)](c){const D=q,d={};for(const f in c){const g=SerializerService[D(0x15d)](c[f]);g&&(d[f]=g);}return d;}[q(0x159)](c){const E=q,d={};for(const [f,g]of Object[E(0x161)](c))null!=g&&(d[f]=SerializerService[E(0x191)](g));return d;}static[q(0x15d)](c){const F=q;switch(typeof c){case F(0x151):break;case F(0x185):c=c?'/t':'/f';break;case F(0x182):c='/d'+c[F(0x15d)]();break;case F(0x18c):return;case F(0x16c):c=null===c?'/n':'/s'+JSON[F(0x180)](c);}return c;}static[q(0x191)](c){const G=q;if('string'!=typeof c)return;const d=c[G(0x17c)](0x0,0x2),f=c[G(0x17c)](0x2);switch(d){case'/t':return!0x0;case'/f':return!0x1;case'/d':return Number(f);case'/n':return null;case'/s':return dateReg[G(0x196)](f)?new Date(JSON[G(0x159)](f)):JSON['parse'](f);default:return c;}}[q(0x187)](c,d){const H=q,f=this[H(0x180)](c);return this[H(0x158)](f,d);}[q(0x174)](c,d){const I=q,f=this[I(0x18a)](c,d);return this['parse'](f);}[q(0x189)](){const J=q,c={};for(const [d,f]of this['symKeys'][J(0x161)]()){c[d]={};for(const [g,h]of f[J(0x161)]())c[d][g]=h;}return c;}}exports[q(0x184)]=SerializerService;
@@ -1,67 +0,0 @@
1
- /**
2
- * The Cache is a key/value store and used to store commonly accessed Redis metadata
3
- * (mainly the execution rules for the app) to save time accessing them as they
4
- * are immutable per verison. Rules are only ejected when a new version
5
- * (a new distributed executable) is deployed to the quorum
6
- * and the cache is invalidated/cleared of the prior version.
7
- */
8
- import { ActivityType } from '../../types/activity';
9
- import { HookRule } from '../../types/hook';
10
- import { HotMeshApp, HotMeshSettings } from '../../types/hotmesh';
11
- import { Symbols } from '../../types/serializer';
12
- import { Transitions } from '../../types/transition';
13
- declare class Cache {
14
- settings: HotMeshSettings;
15
- appId: string;
16
- apps: Record<string, HotMeshApp>;
17
- schemas: Record<string, ActivityType>;
18
- subscriptions: Record<string, Record<string, string>>;
19
- symbols: Record<string, Symbols>;
20
- symvals: Record<string, Symbols>;
21
- transitions: Record<string, Record<string, unknown>>;
22
- hookRules: Record<string, Record<string, HookRule[]>>;
23
- workItems: Record<string, string>;
24
- /**
25
- * The cache is ALWAYS initialized with HotMeshSettings. The other parameters are optional.
26
- * @param settings
27
- * @param apps
28
- * @param schemas
29
- * @param subscriptions
30
- * @param transitions
31
- * @param hookRules
32
- */
33
- constructor(appId: string, settings: HotMeshSettings, apps?: Record<string, HotMeshApp>, schemas?: Record<string, ActivityType>, subscriptions?: Record<string, Record<string, string>>, symbols?: Record<string, Symbols>, symvals?: Record<string, Symbols>, transitions?: Record<string, Record<string, unknown>>, hookRules?: Record<string, Record<string, HookRule[]>>, workItems?: Record<string, string>);
34
- /**
35
- * invalidate the cache; settings are not invalidated!
36
- */
37
- invalidate(): void;
38
- getSettings(): HotMeshSettings;
39
- setSettings(settings: HotMeshSettings): void;
40
- getApps(): Record<string, HotMeshApp>;
41
- getApp(appId: string): HotMeshApp;
42
- setApps(apps: Record<string, HotMeshApp>): void;
43
- setApp(appId: string, app: HotMeshApp): void;
44
- getSchemas(appId: string, version: string): Record<string, ActivityType>;
45
- getSchema(appId: string, version: string, activityId: string): ActivityType;
46
- setSchemas(appId: string, version: string, schemas: Record<string, ActivityType>): void;
47
- setSchema(appId: string, version: string, activityId: string, schema: ActivityType): void;
48
- getSubscriptions(appId: string, version: string): Record<string, string>;
49
- getSubscription(appId: string, version: string, topic: string): unknown;
50
- setSubscriptions(appId: string, version: string, subscriptions: Record<string, string>): void;
51
- getSymbols(appId: string, targetEntityId: string): Symbols;
52
- setSymbols(appId: string, targetEntityId: string, symbols: Symbols): void;
53
- deleteSymbols(appId: string, targetEntityId: string): void;
54
- getSymbolValues(appId: string): Symbols;
55
- setSymbolValues(appId: string, symvals: Symbols): void;
56
- deleteSymbolValues(appId: string): void;
57
- getTransitions(appId: string, version: string): Transitions;
58
- setTransitions(appId: string, version: string, transitions: Transitions): void;
59
- getHookRules(appId: string): Record<string, HookRule[]>;
60
- setHookRules(appId: string, hookRules: Record<string, HookRule[]>): void;
61
- getSignals(appId: string, version: string): Record<string, unknown>;
62
- setSignals(appId: string, version: string): Record<string, unknown>;
63
- getActiveTaskQueue(appId: string): string;
64
- setWorkItem(appId: string, workItem: string): void;
65
- removeWorkItem(appId: string): void;
66
- }
67
- export { Cache };
@@ -1,128 +0,0 @@
1
- "use strict";
2
- /**
3
- * The Cache is a key/value store and used to store commonly accessed Redis metadata
4
- * (mainly the execution rules for the app) to save time accessing them as they
5
- * are immutable per verison. Rules are only ejected when a new version
6
- * (a new distributed executable) is deployed to the quorum
7
- * and the cache is invalidated/cleared of the prior version.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.Cache = void 0;
11
- class Cache {
12
- /**
13
- * The cache is ALWAYS initialized with HotMeshSettings. The other parameters are optional.
14
- * @param settings
15
- * @param apps
16
- * @param schemas
17
- * @param subscriptions
18
- * @param transitions
19
- * @param hookRules
20
- */
21
- constructor(appId, settings, apps = {}, schemas = {}, subscriptions = {}, symbols = {}, symvals = {}, transitions = {}, hookRules = {}, workItems = {}) {
22
- this.appId = appId;
23
- this.settings = settings;
24
- this.apps = apps;
25
- this.schemas = schemas;
26
- this.subscriptions = subscriptions;
27
- this.symbols = symbols;
28
- this.symvals = symvals;
29
- this.transitions = transitions;
30
- this.hookRules = hookRules;
31
- this.workItems = workItems;
32
- }
33
- /**
34
- * invalidate the cache; settings are not invalidated!
35
- */
36
- invalidate() {
37
- this.apps = {};
38
- this.schemas = {};
39
- this.subscriptions = {};
40
- this.transitions = {};
41
- this.hookRules = {};
42
- }
43
- getSettings() {
44
- return this.settings;
45
- }
46
- setSettings(settings) {
47
- this.settings = settings;
48
- }
49
- getApps() {
50
- return this.apps;
51
- }
52
- getApp(appId) {
53
- return this.apps[appId];
54
- }
55
- setApps(apps) {
56
- this.apps = apps;
57
- }
58
- setApp(appId, app) {
59
- this.apps[appId] = app;
60
- }
61
- getSchemas(appId, version) {
62
- return this.schemas[`${appId}/${version}`];
63
- }
64
- getSchema(appId, version, activityId) {
65
- return this.schemas?.[`${appId}/${version}`]?.[activityId];
66
- }
67
- setSchemas(appId, version, schemas) {
68
- this.schemas[`${appId}/${version}`] = schemas;
69
- }
70
- setSchema(appId, version, activityId, schema) {
71
- this.schemas[`${appId}/${version}`][activityId] = schema;
72
- }
73
- getSubscriptions(appId, version) {
74
- return this.subscriptions[`${appId}/${version}`];
75
- }
76
- getSubscription(appId, version, topic) {
77
- return this.subscriptions?.[`${appId}/${version}`]?.[topic];
78
- }
79
- setSubscriptions(appId, version, subscriptions) {
80
- this.subscriptions[`${appId}/${version}`] = subscriptions;
81
- }
82
- getSymbols(appId, targetEntityId) {
83
- return this.symbols[`${appId}/${targetEntityId}`];
84
- }
85
- setSymbols(appId, targetEntityId, symbols) {
86
- this.symbols[`${appId}/${targetEntityId}`] = symbols;
87
- }
88
- deleteSymbols(appId, targetEntityId) {
89
- delete this.symbols[`${appId}/${targetEntityId}`];
90
- }
91
- getSymbolValues(appId) {
92
- return this.symvals[`${appId}`];
93
- }
94
- setSymbolValues(appId, symvals) {
95
- this.symvals[`${appId}`] = symvals;
96
- }
97
- deleteSymbolValues(appId) {
98
- delete this.symvals[`${appId}`];
99
- }
100
- getTransitions(appId, version) {
101
- return this.transitions[`${appId}/${version}`];
102
- }
103
- setTransitions(appId, version, transitions) {
104
- this.transitions[`${appId}/${version}`] = transitions;
105
- }
106
- getHookRules(appId) {
107
- return this.hookRules[`${appId}`];
108
- }
109
- setHookRules(appId, hookRules) {
110
- this.hookRules[`${appId}`] = hookRules;
111
- }
112
- getSignals(appId, version) {
113
- throw new Error('SIGNAL (getHooks) is not supported');
114
- }
115
- setSignals(appId, version) {
116
- throw new Error('SIGNAL (setHook) is not supported');
117
- }
118
- getActiveTaskQueue(appId) {
119
- return this.workItems[appId];
120
- }
121
- setWorkItem(appId, workItem) {
122
- this.workItems[appId] = workItem;
123
- }
124
- removeWorkItem(appId) {
125
- delete this.workItems[appId];
126
- }
127
- }
128
- exports.Cache = Cache;
@@ -1,8 +0,0 @@
1
- import { ILogger } from '../logger';
2
- import { ProviderClient, ProviderTransaction } from '../../types/provider';
3
- import { StoreInitializable } from './providers/store-initializable';
4
- import { StoreService } from './index';
5
- declare class StoreServiceFactory {
6
- static init(providerClient: ProviderClient, namespace: string, appId: string, logger: ILogger): Promise<StoreService<ProviderClient, ProviderTransaction> & StoreInitializable>;
7
- }
8
- export { StoreServiceFactory };
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StoreServiceFactory = void 0;
4
- const utils_1 = require("../../modules/utils");
5
- const ioredis_1 = require("./providers/redis/ioredis");
6
- const redis_1 = require("./providers/redis/redis");
7
- const postgres_1 = require("./providers/postgres/postgres");
8
- class StoreServiceFactory {
9
- static async init(providerClient, namespace, appId, logger) {
10
- let service;
11
- if ((0, utils_1.identifyProvider)(providerClient) === 'redis') {
12
- service = new redis_1.RedisStoreService(providerClient);
13
- }
14
- else if ((0, utils_1.identifyProvider)(providerClient) === 'ioredis') {
15
- service = new ioredis_1.IORedisStoreService(providerClient);
16
- }
17
- else if ((0, utils_1.identifyProvider)(providerClient) === 'postgres') {
18
- service = new postgres_1.PostgresStoreService(providerClient);
19
- } //etc
20
- await service.init(namespace, appId, logger);
21
- return service;
22
- }
23
- }
24
- exports.StoreServiceFactory = StoreServiceFactory;
@@ -1,89 +0,0 @@
1
- import { KeyStoreParams, KeyType } from '../../modules/key';
2
- import { ILogger } from '../logger';
3
- import { SerializerService as Serializer } from '../serializer';
4
- import { Consumes } from '../../types/activity';
5
- import { AppVID } from '../../types/app';
6
- import { HookRule, HookSignal } from '../../types/hook';
7
- import { HotMeshApps, HotMeshSettings } from '../../types/hotmesh';
8
- import { ProviderClient, ProviderTransaction } from '../../types/provider';
9
- import { ThrottleOptions } from '../../types/quorum';
10
- import { StringAnyType, Symbols, StringStringType, SymbolSets } from '../../types/serializer';
11
- import { IdsData, JobStatsRange, StatsType } from '../../types/stats';
12
- import { WorkListTaskType } from '../../types/task';
13
- import { Cache } from './cache';
14
- declare abstract class StoreService<Provider extends ProviderClient, TransactionProvider extends ProviderTransaction> {
15
- storeClient: Provider;
16
- namespace: string;
17
- appId: string;
18
- logger: ILogger;
19
- cache: Cache;
20
- serializer: Serializer;
21
- constructor(client: Provider);
22
- abstract transact(): TransactionProvider;
23
- abstract init(namespace: string, appId: string, logger: ILogger): Promise<HotMeshApps>;
24
- abstract mintKey(type: KeyType, params: KeyStoreParams): string;
25
- abstract getSettings(bCreate?: boolean): Promise<HotMeshSettings>;
26
- abstract setSettings(manifest: HotMeshSettings): Promise<any>;
27
- abstract getApp(id: string, refresh?: boolean): Promise<any>;
28
- abstract setApp(id: string, version: string): Promise<any>;
29
- abstract activateAppVersion(id: string, version: string): Promise<boolean>;
30
- abstract reserveScoutRole(scoutType: 'time' | 'signal' | 'activate', delay?: number): Promise<boolean>;
31
- abstract releaseScoutRole(scoutType: 'time' | 'signal' | 'activate'): Promise<boolean>;
32
- abstract reserveSymbolRange(target: string, size: number, type: 'JOB' | 'ACTIVITY', tryCount?: number): Promise<[number, number, Symbols]>;
33
- abstract getSymbols(activityId: string): Promise<Symbols>;
34
- abstract addSymbols(activityId: string, symbols: Symbols): Promise<boolean>;
35
- abstract getSymbolValues(): Promise<Symbols>;
36
- abstract addSymbolValues(symvals: Symbols): Promise<boolean>;
37
- abstract getSymbolKeys(symbolNames: string[]): Promise<SymbolSets>;
38
- abstract setStats(jobKey: string, jobId: string, dateTime: string, stats: StatsType, appVersion: AppVID, transaction?: TransactionProvider): Promise<any>;
39
- abstract getJobStats(jobKeys: string[]): Promise<JobStatsRange>;
40
- abstract getJobIds(indexKeys: string[], idRange: [number, number]): Promise<IdsData>;
41
- abstract setStatus(collationKeyStatus: number, jobId: string, appId: string, transaction?: TransactionProvider): Promise<any>;
42
- abstract getStatus(jobId: string, appId: string): Promise<number>;
43
- abstract setStateNX(jobId: string, appId: string, status?: number): Promise<boolean>;
44
- abstract setState(state: StringAnyType, status: number | null, jobId: string, symbolNames: string[], dIds: StringStringType, transaction?: TransactionProvider): Promise<string>;
45
- abstract getQueryState(jobId: string, fields: string[]): Promise<StringAnyType>;
46
- abstract getState(jobId: string, consumes: Consumes, dIds: StringStringType): Promise<[StringAnyType, number] | undefined>;
47
- abstract getRaw(jobId: string): Promise<StringStringType>;
48
- abstract collate(jobId: string, activityId: string, amount: number, dIds: StringStringType, transaction?: TransactionProvider): Promise<number>;
49
- abstract collateSynthetic(jobId: string, guid: string, amount: number, transaction?: TransactionProvider): Promise<number>;
50
- abstract getSchema(activityId: string, appVersion: AppVID): Promise<any>;
51
- abstract getSchemas(appVersion: AppVID): Promise<Record<string, any>>;
52
- abstract setSchemas(schemas: Record<string, any>, appVersion: AppVID): Promise<any>;
53
- abstract setSubscriptions(subscriptions: Record<string, any>, appVersion: AppVID): Promise<boolean>;
54
- abstract getSubscriptions(appVersion: AppVID): Promise<Record<string, any>>;
55
- abstract getSubscription(topic: string, appVersion: AppVID): Promise<string | undefined>;
56
- abstract setTransitions(transitions: Record<string, any>, appVersion: AppVID): Promise<any>;
57
- abstract getTransitions(appVersion: AppVID): Promise<any>;
58
- abstract setHookRules(hookRules: Record<string, HookRule[]>): Promise<any>;
59
- abstract getHookRules(): Promise<Record<string, HookRule[]>>;
60
- abstract getAllSymbols(): Promise<Symbols>;
61
- abstract setHookSignal(hook: HookSignal, transaction?: TransactionProvider): Promise<any>;
62
- abstract getHookSignal(topic: string, resolved: string): Promise<string | undefined>;
63
- abstract deleteHookSignal(topic: string, resolved: string): Promise<number | undefined>;
64
- abstract addTaskQueues(keys: string[]): Promise<void>;
65
- abstract getActiveTaskQueue(): Promise<string | null>;
66
- abstract deleteProcessedTaskQueue(workItemKey: string, key: string, processedKey: string, scrub?: boolean): Promise<void>;
67
- abstract processTaskQueue(sourceKey: string, destinationKey: string): Promise<any>;
68
- abstract expireJob(jobId: string, inSeconds: number, redisMulti?: TransactionProvider): Promise<void>;
69
- abstract getDependencies(jobId: string): Promise<string[]>;
70
- abstract delistSignalKey(key: string, target: string): Promise<void>;
71
- abstract registerTimeHook(jobId: string, gId: string, activityId: string, type: WorkListTaskType, deletionTime: number, dad: string, transaction?: TransactionProvider): Promise<void>;
72
- abstract getNextTask(listKey?: string): Promise<[
73
- listKey: string,
74
- jobId: string,
75
- gId: string,
76
- activityId: string,
77
- type: WorkListTaskType
78
- ] | boolean>;
79
- abstract interrupt(topic: string, jobId: string, options: {
80
- [key: string]: any;
81
- }): Promise<void>;
82
- abstract scrub(jobId: string): Promise<void>;
83
- abstract findJobs(queryString?: string, limit?: number, batchSize?: number, cursor?: string): Promise<[string, string[]]>;
84
- abstract findJobFields(jobId: string, fieldMatchPattern?: string, limit?: number, batchSize?: number, cursor?: string): Promise<[string, StringStringType]>;
85
- abstract setThrottleRate(options: ThrottleOptions): Promise<void>;
86
- abstract getThrottleRates(): Promise<StringStringType>;
87
- abstract getThrottleRate(topic: string): Promise<number>;
88
- }
89
- export { StoreService };
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StoreService = void 0;
4
- class StoreService {
5
- constructor(client) {
6
- this.storeClient = client;
7
- }
8
- }
9
- exports.StoreService = StoreService;