@hotmeshio/hotmesh 0.5.2 → 0.5.4

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 (38) hide show
  1. package/README.md +93 -175
  2. package/build/index.d.ts +1 -3
  3. package/build/index.js +1 -5
  4. package/build/modules/enums.d.ts +4 -0
  5. package/build/modules/enums.js +5 -1
  6. package/build/modules/utils.d.ts +1 -9
  7. package/build/modules/utils.js +0 -6
  8. package/build/package.json +3 -4
  9. package/build/services/connector/factory.d.ts +2 -2
  10. package/build/services/connector/factory.js +11 -8
  11. package/build/services/connector/providers/postgres.d.ts +47 -0
  12. package/build/services/connector/providers/postgres.js +107 -0
  13. package/build/services/hotmesh/index.d.ts +8 -0
  14. package/build/services/hotmesh/index.js +27 -0
  15. package/build/services/memflow/client.d.ts +1 -1
  16. package/build/services/memflow/client.js +8 -6
  17. package/build/services/memflow/worker.js +3 -0
  18. package/build/services/pipe/functions/cron.js +1 -1
  19. package/build/services/store/providers/postgres/kvtables.js +19 -6
  20. package/build/services/store/providers/postgres/postgres.js +13 -2
  21. package/build/services/stream/providers/postgres/postgres.d.ts +6 -3
  22. package/build/services/stream/providers/postgres/postgres.js +169 -59
  23. package/build/services/sub/providers/postgres/postgres.d.ts +9 -0
  24. package/build/services/sub/providers/postgres/postgres.js +109 -18
  25. package/build/services/worker/index.js +4 -0
  26. package/build/types/hotmesh.d.ts +19 -5
  27. package/build/types/index.d.ts +0 -2
  28. package/env.example +11 -0
  29. package/index.ts +0 -4
  30. package/package.json +3 -4
  31. package/build/services/meshdata/index.d.ts +0 -795
  32. package/build/services/meshdata/index.js +0 -1235
  33. package/build/services/meshos/index.d.ts +0 -293
  34. package/build/services/meshos/index.js +0 -547
  35. package/build/types/manifest.d.ts +0 -52
  36. package/build/types/manifest.js +0 -2
  37. package/build/types/meshdata.d.ts +0 -252
  38. package/build/types/meshdata.js +0 -2
@@ -1,252 +0,0 @@
1
- import { HookOptions, WorkflowConfig, WorkflowSearchOptions } from './memflow';
2
- import { StringStringType } from './serializer';
3
- export type CallOptions = {
4
- /**
5
- * if provided along with a `ttl`, the function will be cached
6
- */
7
- id?: string;
8
- /**
9
- * in format '1 minute', '5 minutes', '1 hour', 'infinity', etc
10
- */
11
- ttl?: string;
12
- /**
13
- * full GUID (including prefix)
14
- */
15
- $guid?: string;
16
- /**
17
- * exec, hook, proxy
18
- */
19
- $type?: string;
20
- /**
21
- * if set to false explicitly it will not await the result
22
- */
23
- await?: boolean;
24
- /**
25
- * taskQueue for the workflowId (defaults to entity)
26
- */
27
- taskQueue?: string;
28
- /**
29
- * defaults to `entity` input parameter; allows override of the workflowId prefix
30
- */
31
- prefix?: string;
32
- search?: WorkflowSearchOptions;
33
- /**
34
- * list of state field names to return (this is NOT the final response)
35
- */
36
- fields?: string[];
37
- /**
38
- * namespace for the the execution client
39
- * @default 'memflow'
40
- */
41
- namespace?: string;
42
- /**
43
- * Custom marker data field used for adding a searchable marker to the job.
44
- * markers always begin with a dash (-). Any field that does not
45
- * begin with a dash will be removed and will not be inserted with
46
- * the initial data set.
47
- */
48
- marker?: StringStringType;
49
- /**
50
- * If provided, the job will initialize in an pending state, reserving
51
- * only the job ID (HSETNX) and persisting search and marker (if provided).
52
- * If a `resume` signal is sent before the specified number of seconds,
53
- * the job will resume as normal. If the job is not resumed within the
54
- * number of seconds provided, the job will be scrubbed. No dependencies
55
- * are set for a job in a pending state; however, dependencies will be
56
- * added after the job is resumed if necessary.
57
- */
58
- pending?: number;
59
- };
60
- export type ConnectOptions = {
61
- /**
62
- * the task queue for the connected function for greater specificity
63
- */
64
- taskQueue?: string;
65
- /**
66
- * prefix for the workflowId (defaults to entity value if not provided)
67
- */
68
- prefix?: string;
69
- /**
70
- * optional namespace for the the worker
71
- * @default 'memflow'
72
- */
73
- namespace?: string;
74
- /**
75
- * extended worker options
76
- */
77
- options?: WorkerOptions;
78
- /**
79
- * optional search configuration
80
- */
81
- search?: WorkflowSearchOptions;
82
- };
83
- /**
84
- * Connect a function to the operational data layer.
85
- * @template T - the return type of the connected function
86
- */
87
- export type ConnectionInput<T> = {
88
- /**
89
- * The connected function's entity identifier
90
- *
91
- * @example
92
- * user
93
- */
94
- entity: string;
95
- /**
96
- * The target function reference
97
- *
98
- * @example
99
- * function() { return "hello world" }
100
- */
101
- target: (...args: any[]) => T;
102
- /**
103
- * Extended connection options (e.g., ttl, taskQueue)
104
- * @example
105
- * { ttl: 'infinity' }
106
- */
107
- options?: ConnectOptions;
108
- };
109
- /**
110
- * Executes a remote function by its global entity identifier with specified arguments.
111
- * If options.ttl is infinity, the function will be cached indefinitely and can only be
112
- * removed by calling `flush`. During this time, the function will remain active and can
113
- * its state can be augmented by calling `set`, `incr`, `del`, etc OR by calling a
114
- * transactional 'hook' function.
115
- *
116
- * @template T The expected return type of the remote function.
117
- */
118
- export type ExecInput = {
119
- /**
120
- * the connected function's entity identifier
121
- * @example
122
- * user
123
- */
124
- entity: string;
125
- /**
126
- * the function's input arguments
127
- * @example
128
- * ['Jane', 'Doe']
129
- */
130
- args: any[];
131
- /**
132
- * Extended options for the hook function, like specifying a taskQueue or ttl
133
- * @example
134
- * { ttl: '5 minutes' }
135
- */
136
- options?: Partial<MeshDataWorkflowOptions>;
137
- };
138
- /**
139
- * Hook function inputs. Hooks augment running jobs.
140
- */
141
- export type HookInput = {
142
- /**
143
- * The target function's entity identifier
144
- * @example 'user'
145
- */
146
- entity: string;
147
- /**
148
- * The target execution id (workflowId/jobId)
149
- * @example 'jsmith123'
150
- */
151
- id: string;
152
- /**
153
- * The hook function's entity identifier
154
- * @example 'user.notify'
155
- */
156
- hookEntity: string;
157
- /**
158
- * The hook function's input arguments
159
- * @example 'notify'
160
- */
161
- hookArgs: any[];
162
- /**
163
- * Extended options for the hook function, like specifying a taskQueue
164
- * @example { taskQueue: 'priority' }
165
- */
166
- options?: Partial<HookOptions>;
167
- };
168
- export type MeshDataWorkflowOptions = {
169
- /**
170
- * The app deployment namespace
171
- */
172
- namespace?: string;
173
- /**
174
- * Target connected functions more specifically by taskQueue
175
- */
176
- taskQueue?: string;
177
- /**
178
- * The connected function's entity identifier
179
- */
180
- prefix?: string;
181
- /**
182
- * The function execution id (shorthand for workflowId)
183
- */
184
- id?: string;
185
- /**
186
- * The function execution id
187
- */
188
- workflowId?: string;
189
- /**
190
- * The function name (`entity` is a shorthand for this)
191
- */
192
- workflowName?: string;
193
- /**
194
- * The open telemetry trace context for the workflow, used for logging and tracing. If a sink is enabled, this will be sent to the sink.
195
- */
196
- workflowTrace?: string;
197
- /**
198
- * The open telemetry span context for the workflow, used for logging and tracing. If a sink is enabled, this will be sent to the sink.
199
- */
200
- workflowSpan?: string;
201
- /**
202
- * Search fields to seed function state when it first initializes
203
- */
204
- search?: WorkflowSearchOptions;
205
- /**
206
- * Extended execution options
207
- */
208
- config?: WorkflowConfig;
209
- /**
210
- * Set to 'infinity', '1 minute', '1 hour', etc
211
- */
212
- ttl?: string;
213
- /**
214
- * If set to false explicitly it will not await the result
215
- * @default true
216
- */
217
- await?: boolean;
218
- /**
219
- * Custom marker data field used for adding a searchable marker to the job.
220
- * markers always begin with a dash (-). Any field that does not
221
- * begin with a dash will be removed and will not be inserted with
222
- * the initial data set.
223
- */
224
- marker?: StringStringType;
225
- /**
226
- * If provided, the job will initialize in a pending state, reserving
227
- * only the job ID (HSETNX) and persisting search and marker (if provided).
228
- * If a `resume` signal is sent before the specified number of seconds,
229
- * the job will resume as normal. If the job is not resumed within the
230
- * number of seconds provided, the job will be scrubbed. No dependencies
231
- * are set for a job in a pending state; however, dependencies will be
232
- * added after the job is resumed (if necessary).
233
- */
234
- pending?: number;
235
- /**
236
- * sets the number of seconds a workflow may exist after completion. The default policy is to expire the job hash as soon as it completes.
237
- * @default 1
238
- */
239
- expire?: number;
240
- /**
241
- * set to false to optimize workflows that do not require a `signal in`.
242
- * explicitly set to true to force the workflow to remain open and persistent.
243
- * @default true
244
- */
245
- signalIn?: boolean;
246
- /**
247
- * set to `true` by the system when a workflow is started with a ttl, ensuring
248
- * that the workflow will remain active until the ttl expires and the workflow
249
- * is scrubbed. This is a system flag and should not be set by the user.
250
- */
251
- persistent?: boolean;
252
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });