@sphereon/ssi-sdk.xstate-machine-persistence 0.19.1-next.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +181 -0
- package/dist/agent/MachineStatePersistence.d.ts +26 -0
- package/dist/agent/MachineStatePersistence.d.ts.map +1 -0
- package/dist/agent/MachineStatePersistence.js +198 -0
- package/dist/agent/MachineStatePersistence.js.map +1 -0
- package/dist/functions/index.d.ts +4 -0
- package/dist/functions/index.d.ts.map +1 -0
- package/dist/functions/index.js +20 -0
- package/dist/functions/index.js.map +1 -0
- package/dist/functions/machineRegistration.d.ts +130 -0
- package/dist/functions/machineRegistration.d.ts.map +1 -0
- package/dist/functions/machineRegistration.js +303 -0
- package/dist/functions/machineRegistration.js.map +1 -0
- package/dist/functions/stateEventEmitter.d.ts +10 -0
- package/dist/functions/stateEventEmitter.d.ts.map +1 -0
- package/dist/functions/stateEventEmitter.js +21 -0
- package/dist/functions/stateEventEmitter.js.map +1 -0
- package/dist/functions/stateMapper.d.ts +40 -0
- package/dist/functions/stateMapper.d.ts.map +1 -0
- package/dist/functions/stateMapper.js +83 -0
- package/dist/functions/stateMapper.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/ssi-sdk.xstate-machine-persistence.d.ts +473 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/dist/types/IMachineStatePersistence.d.ts +62 -0
- package/dist/types/IMachineStatePersistence.d.ts.map +1 -0
- package/dist/types/IMachineStatePersistence.js +3 -0
- package/dist/types/IMachineStatePersistence.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +19 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/types.d.ts +173 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/types.js +13 -0
- package/dist/types/types.js.map +1 -0
- package/package.json +56 -0
- package/plugin.schema.json +699 -0
- package/src/__tests__/localAgent.test.ts +32 -0
- package/src/__tests__/restAgent.test.ts +73 -0
- package/src/__tests__/shared/MachineStatePersistenceAgentLogic.ts +323 -0
- package/src/agent/MachineStatePersistence.ts +226 -0
- package/src/functions/index.ts +3 -0
- package/src/functions/machineRegistration.ts +409 -0
- package/src/functions/stateEventEmitter.ts +21 -0
- package/src/functions/stateMapper.ts +89 -0
- package/src/index.ts +5 -0
- package/src/types/IMachineStatePersistence.ts +79 -0
- package/src/types/index.ts +2 -0
- package/src/types/types.ts +209 -0
|
@@ -0,0 +1,699 @@
|
|
|
1
|
+
{
|
|
2
|
+
"IMachineStatePersistence": {
|
|
3
|
+
"components": {
|
|
4
|
+
"schemas": {
|
|
5
|
+
"MachineStateDeleteArgs": {
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"instanceId": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Unique instance ID of the machine"
|
|
11
|
+
},
|
|
12
|
+
"tenantId": {
|
|
13
|
+
"type": "string"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"required": [
|
|
17
|
+
"instanceId"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"MachineStateGetArgs": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"properties": {
|
|
23
|
+
"instanceId": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"description": "Unique instance ID of the machine"
|
|
26
|
+
},
|
|
27
|
+
"tenantId": {
|
|
28
|
+
"type": "string"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"required": [
|
|
32
|
+
"instanceId"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"MachineStateInfo": {
|
|
36
|
+
"type": "object",
|
|
37
|
+
"properties": {
|
|
38
|
+
"state": {
|
|
39
|
+
"$ref": "#/components/schemas/SerializableState"
|
|
40
|
+
},
|
|
41
|
+
"instanceId": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"description": "Unique instance ID of the machine"
|
|
44
|
+
},
|
|
45
|
+
"sessionId": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"description": "Session Id of the machine. Not necessarily unique"
|
|
48
|
+
},
|
|
49
|
+
"machineName": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"description": "Machine name"
|
|
52
|
+
},
|
|
53
|
+
"latestStateName": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"description": "The latest state name. Can be empty for a newly initialize machine"
|
|
56
|
+
},
|
|
57
|
+
"latestEventType": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"description": "event types like SET_TOC, SET_FIRSTNAME, .... Will be xstate.init on a newly initialized machine"
|
|
60
|
+
},
|
|
61
|
+
"createdAt": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"description": "Represents the creation date"
|
|
64
|
+
},
|
|
65
|
+
"expiresAt": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"description": "Represents the expiration date"
|
|
68
|
+
},
|
|
69
|
+
"updatedAt": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"description": "Represents the update date"
|
|
72
|
+
},
|
|
73
|
+
"updatedCount": {
|
|
74
|
+
"type": "number",
|
|
75
|
+
"description": "Represents a counter for tracking updates."
|
|
76
|
+
},
|
|
77
|
+
"completedAt": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"format": "date-time"
|
|
80
|
+
},
|
|
81
|
+
"tenantId": {
|
|
82
|
+
"type": "string"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"required": [
|
|
86
|
+
"createdAt",
|
|
87
|
+
"instanceId",
|
|
88
|
+
"latestEventType",
|
|
89
|
+
"machineName",
|
|
90
|
+
"state",
|
|
91
|
+
"updatedAt",
|
|
92
|
+
"updatedCount"
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
"SerializableState": {
|
|
96
|
+
"$ref": "#/components/schemas/XStateConfig<any,AnyEventObject>"
|
|
97
|
+
},
|
|
98
|
+
"XStateConfig<any,AnyEventObject>": {
|
|
99
|
+
"type": "object",
|
|
100
|
+
"properties": {
|
|
101
|
+
"value": {
|
|
102
|
+
"$ref": "#/components/schemas/StateValue"
|
|
103
|
+
},
|
|
104
|
+
"context": {},
|
|
105
|
+
"_event": {
|
|
106
|
+
"$ref": "#/components/schemas/SCXML.Event<AnyEventObject>"
|
|
107
|
+
},
|
|
108
|
+
"_sessionid": {
|
|
109
|
+
"type": [
|
|
110
|
+
"string",
|
|
111
|
+
"null"
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
"historyValue": {
|
|
115
|
+
"$ref": "#/components/schemas/HistoryValue"
|
|
116
|
+
},
|
|
117
|
+
"history": {},
|
|
118
|
+
"actions": {
|
|
119
|
+
"type": "array",
|
|
120
|
+
"items": {}
|
|
121
|
+
},
|
|
122
|
+
"activities": {},
|
|
123
|
+
"meta": {},
|
|
124
|
+
"events": {
|
|
125
|
+
"type": "array",
|
|
126
|
+
"items": {
|
|
127
|
+
"$ref": "#/components/schemas/AnyEventObject"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"configuration": {
|
|
131
|
+
"type": "array",
|
|
132
|
+
"items": {}
|
|
133
|
+
},
|
|
134
|
+
"transitions": {
|
|
135
|
+
"type": "array",
|
|
136
|
+
"items": {}
|
|
137
|
+
},
|
|
138
|
+
"children": {
|
|
139
|
+
"type": "object"
|
|
140
|
+
},
|
|
141
|
+
"done": {
|
|
142
|
+
"type": "boolean"
|
|
143
|
+
},
|
|
144
|
+
"tags": {
|
|
145
|
+
"type": "object",
|
|
146
|
+
"properties": {
|
|
147
|
+
"size": {
|
|
148
|
+
"type": "number"
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"required": [
|
|
152
|
+
"size"
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
"machine": {}
|
|
156
|
+
},
|
|
157
|
+
"required": [
|
|
158
|
+
"value",
|
|
159
|
+
"context",
|
|
160
|
+
"_event",
|
|
161
|
+
"_sessionid",
|
|
162
|
+
"configuration",
|
|
163
|
+
"transitions",
|
|
164
|
+
"children"
|
|
165
|
+
],
|
|
166
|
+
"description": "The configuration for the XState machine state. Simplified StateConfig object from XState so we have a minimal typed structure"
|
|
167
|
+
},
|
|
168
|
+
"StateValue": {
|
|
169
|
+
"anyOf": [
|
|
170
|
+
{
|
|
171
|
+
"type": "string"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"$ref": "#/components/schemas/StateValueMap"
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
"description": "The string or object representing the state value relative to the parent state node.\n\n- For a child atomic state node, this is a string, e.g., `\"pending\"`.\n- For complex state nodes, this is an object, e.g., `{ success: \"someChildState\" }`."
|
|
178
|
+
},
|
|
179
|
+
"StateValueMap": {
|
|
180
|
+
"type": "object",
|
|
181
|
+
"additionalProperties": {
|
|
182
|
+
"$ref": "#/components/schemas/StateValue"
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
"SCXML.Event<AnyEventObject>": {
|
|
186
|
+
"type": "object",
|
|
187
|
+
"properties": {
|
|
188
|
+
"name": {
|
|
189
|
+
"type": "string",
|
|
190
|
+
"description": "This is a character string giving the name of the event. The SCXML Processor must set the name field to the name of this event. It is what is matched against the 'event' attribute of <transition>. Note that transitions can do additional tests by using the value of this field inside boolean expressions in the 'cond' attribute."
|
|
191
|
+
},
|
|
192
|
+
"type": {
|
|
193
|
+
"type": "string",
|
|
194
|
+
"enum": [
|
|
195
|
+
"platform",
|
|
196
|
+
"internal",
|
|
197
|
+
"external"
|
|
198
|
+
],
|
|
199
|
+
"description": "This field describes the event type. The SCXML Processor must set it to: \"platform\" (for events raised by the platform itself, such as error events), \"internal\" (for events raised by <raise> and <send> with target '_internal') or \"external\" (for all other events)."
|
|
200
|
+
},
|
|
201
|
+
"sendid": {
|
|
202
|
+
"type": "string",
|
|
203
|
+
"description": "If the sending entity has specified a value for this, the Processor must set this field to that value (see C Event I/O Processors for details). Otherwise, in the case of error events triggered by a failed attempt to send an event, the Processor must set this field to the send id of the triggering <send> element. Otherwise it must leave it blank."
|
|
204
|
+
},
|
|
205
|
+
"origin": {
|
|
206
|
+
"type": "string",
|
|
207
|
+
"description": "This is a URI, equivalent to the 'target' attribute on the <send> element. For external events, the SCXML Processor should set this field to a value which, when used as the value of 'target', will allow the receiver of the event to <send> a response back to the originating entity via the Event I/O Processor specified in 'origintype'. For internal and platform events, the Processor must leave this field blank."
|
|
208
|
+
},
|
|
209
|
+
"origintype": {
|
|
210
|
+
"type": "string",
|
|
211
|
+
"description": "This is equivalent to the 'type' field on the <send> element. For external events, the SCXML Processor should set this field to a value which, when used as the value of 'type', will allow the receiver of the event to <send> a response back to the originating entity at the URI specified by 'origin'. For internal and platform events, the Processor must leave this field blank."
|
|
212
|
+
},
|
|
213
|
+
"invokeid": {
|
|
214
|
+
"type": "string",
|
|
215
|
+
"description": "If this event is generated from an invoked child process, the SCXML Processor must set this field to the invoke id of the invocation that triggered the child process. Otherwise it must leave it blank."
|
|
216
|
+
},
|
|
217
|
+
"data": {
|
|
218
|
+
"$ref": "#/components/schemas/AnyEventObject",
|
|
219
|
+
"description": "This field contains whatever data the sending entity chose to include in this event. The receiving SCXML Processor should reformat this data to match its data model, but must not otherwise modify it.\n\nIf the conversion is not possible, the Processor must leave the field blank and must place an error 'error.execution' in the internal event queue."
|
|
220
|
+
},
|
|
221
|
+
"$$type": {
|
|
222
|
+
"type": "string",
|
|
223
|
+
"const": "scxml"
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"required": [
|
|
227
|
+
"name",
|
|
228
|
+
"type",
|
|
229
|
+
"data",
|
|
230
|
+
"$$type"
|
|
231
|
+
]
|
|
232
|
+
},
|
|
233
|
+
"AnyEventObject": {
|
|
234
|
+
"type": "object",
|
|
235
|
+
"properties": {
|
|
236
|
+
"type": {
|
|
237
|
+
"type": "string",
|
|
238
|
+
"description": "The type of event that is sent."
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
"required": [
|
|
242
|
+
"type"
|
|
243
|
+
]
|
|
244
|
+
},
|
|
245
|
+
"HistoryValue": {
|
|
246
|
+
"type": "object",
|
|
247
|
+
"properties": {
|
|
248
|
+
"states": {
|
|
249
|
+
"type": "object",
|
|
250
|
+
"additionalProperties": {
|
|
251
|
+
"anyOf": [
|
|
252
|
+
{
|
|
253
|
+
"$ref": "#/components/schemas/HistoryValue"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"not": {}
|
|
257
|
+
}
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
"current": {
|
|
262
|
+
"$ref": "#/components/schemas/StateValue"
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
"required": [
|
|
266
|
+
"states"
|
|
267
|
+
]
|
|
268
|
+
},
|
|
269
|
+
"InitMachineStateArgs": {
|
|
270
|
+
"type": "object",
|
|
271
|
+
"properties": {
|
|
272
|
+
"cleanupAllOtherInstances": {
|
|
273
|
+
"type": "boolean"
|
|
274
|
+
},
|
|
275
|
+
"customInstanceId": {
|
|
276
|
+
"type": "string"
|
|
277
|
+
},
|
|
278
|
+
"existingInstanceId": {
|
|
279
|
+
"type": "string"
|
|
280
|
+
},
|
|
281
|
+
"machineName": {
|
|
282
|
+
"type": "object",
|
|
283
|
+
"properties": {},
|
|
284
|
+
"description": "Machine name"
|
|
285
|
+
},
|
|
286
|
+
"tenantId": {
|
|
287
|
+
"type": "string"
|
|
288
|
+
},
|
|
289
|
+
"createdAt": {
|
|
290
|
+
"type": "object",
|
|
291
|
+
"properties": {},
|
|
292
|
+
"description": "Represents the creation date"
|
|
293
|
+
},
|
|
294
|
+
"expiresAt": {
|
|
295
|
+
"type": "string",
|
|
296
|
+
"description": "Represents the expiration date"
|
|
297
|
+
},
|
|
298
|
+
"stateType": {
|
|
299
|
+
"anyOf": [
|
|
300
|
+
{
|
|
301
|
+
"type": "object",
|
|
302
|
+
"properties": {}
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"type": "object",
|
|
306
|
+
"properties": {}
|
|
307
|
+
}
|
|
308
|
+
]
|
|
309
|
+
},
|
|
310
|
+
"machineState": {
|
|
311
|
+
"type": "object",
|
|
312
|
+
"properties": {
|
|
313
|
+
"state": {
|
|
314
|
+
"$ref": "#/components/schemas/SerializableState"
|
|
315
|
+
},
|
|
316
|
+
"instanceId": {
|
|
317
|
+
"type": "string",
|
|
318
|
+
"description": "Unique instance ID of the machine"
|
|
319
|
+
},
|
|
320
|
+
"sessionId": {
|
|
321
|
+
"type": "string",
|
|
322
|
+
"description": "Session Id of the machine. Not necessarily unique"
|
|
323
|
+
},
|
|
324
|
+
"machineName": {
|
|
325
|
+
"type": "string",
|
|
326
|
+
"description": "Machine name"
|
|
327
|
+
},
|
|
328
|
+
"latestStateName": {
|
|
329
|
+
"type": "string",
|
|
330
|
+
"description": "The latest state name. Can be empty for a newly initialize machine"
|
|
331
|
+
},
|
|
332
|
+
"latestEventType": {
|
|
333
|
+
"type": "string",
|
|
334
|
+
"description": "event types like SET_TOC, SET_FIRSTNAME, .... Will be xstate.init on a newly initialized machine"
|
|
335
|
+
},
|
|
336
|
+
"createdAt": {
|
|
337
|
+
"type": "string",
|
|
338
|
+
"description": "Represents the creation date"
|
|
339
|
+
},
|
|
340
|
+
"expiresAt": {
|
|
341
|
+
"type": "string",
|
|
342
|
+
"description": "Represents the expiration date"
|
|
343
|
+
},
|
|
344
|
+
"updatedAt": {
|
|
345
|
+
"type": "string",
|
|
346
|
+
"description": "Represents the update date"
|
|
347
|
+
},
|
|
348
|
+
"updatedCount": {
|
|
349
|
+
"type": "number",
|
|
350
|
+
"description": "Represents a counter for tracking updates."
|
|
351
|
+
},
|
|
352
|
+
"completedAt": {
|
|
353
|
+
"type": "string",
|
|
354
|
+
"format": "date-time"
|
|
355
|
+
},
|
|
356
|
+
"tenantId": {
|
|
357
|
+
"type": "string"
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
"required": [
|
|
361
|
+
"createdAt",
|
|
362
|
+
"instanceId",
|
|
363
|
+
"latestEventType",
|
|
364
|
+
"machineName",
|
|
365
|
+
"state",
|
|
366
|
+
"updatedAt",
|
|
367
|
+
"updatedCount"
|
|
368
|
+
]
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
"required": [
|
|
372
|
+
"machineName"
|
|
373
|
+
]
|
|
374
|
+
},
|
|
375
|
+
"MachineStateInit": {
|
|
376
|
+
"type": "object",
|
|
377
|
+
"properties": {
|
|
378
|
+
"stateType": {
|
|
379
|
+
"$ref": "#/components/schemas/MachineStateInitType"
|
|
380
|
+
},
|
|
381
|
+
"machineState": {
|
|
382
|
+
"$ref": "#/components/schemas/MachineStateInfo"
|
|
383
|
+
},
|
|
384
|
+
"instanceId": {
|
|
385
|
+
"type": "object",
|
|
386
|
+
"properties": {},
|
|
387
|
+
"description": "Unique instance ID of the machine"
|
|
388
|
+
},
|
|
389
|
+
"machineName": {
|
|
390
|
+
"type": "object",
|
|
391
|
+
"properties": {},
|
|
392
|
+
"description": "Machine name"
|
|
393
|
+
},
|
|
394
|
+
"tenantId": {
|
|
395
|
+
"type": "string"
|
|
396
|
+
},
|
|
397
|
+
"createdAt": {
|
|
398
|
+
"type": "object",
|
|
399
|
+
"properties": {},
|
|
400
|
+
"description": "Represents the creation date"
|
|
401
|
+
},
|
|
402
|
+
"expiresAt": {
|
|
403
|
+
"type": "string",
|
|
404
|
+
"description": "Represents the expiration date"
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
"required": [
|
|
408
|
+
"createdAt",
|
|
409
|
+
"instanceId",
|
|
410
|
+
"machineName",
|
|
411
|
+
"stateType"
|
|
412
|
+
]
|
|
413
|
+
},
|
|
414
|
+
"MachineStateInitType": {
|
|
415
|
+
"type": "string",
|
|
416
|
+
"enum": [
|
|
417
|
+
"new",
|
|
418
|
+
"existing"
|
|
419
|
+
]
|
|
420
|
+
},
|
|
421
|
+
"MachineStatePersistArgs": {
|
|
422
|
+
"type": "object",
|
|
423
|
+
"properties": {
|
|
424
|
+
"cleanupOnFinalState": {
|
|
425
|
+
"type": "boolean"
|
|
426
|
+
},
|
|
427
|
+
"updatedCount": {
|
|
428
|
+
"type": "object",
|
|
429
|
+
"properties": {},
|
|
430
|
+
"description": "Represents a counter for tracking updates."
|
|
431
|
+
},
|
|
432
|
+
"state": {
|
|
433
|
+
"type": "object",
|
|
434
|
+
"properties": {
|
|
435
|
+
"value": {
|
|
436
|
+
"$ref": "#/components/schemas/StateValue"
|
|
437
|
+
},
|
|
438
|
+
"context": {},
|
|
439
|
+
"_event": {
|
|
440
|
+
"$ref": "#/components/schemas/SCXML.Event<AnyEventObject>"
|
|
441
|
+
},
|
|
442
|
+
"_sessionid": {
|
|
443
|
+
"type": [
|
|
444
|
+
"string",
|
|
445
|
+
"null"
|
|
446
|
+
]
|
|
447
|
+
},
|
|
448
|
+
"historyValue": {
|
|
449
|
+
"$ref": "#/components/schemas/HistoryValue"
|
|
450
|
+
},
|
|
451
|
+
"history": {},
|
|
452
|
+
"actions": {
|
|
453
|
+
"type": "array",
|
|
454
|
+
"items": {}
|
|
455
|
+
},
|
|
456
|
+
"activities": {},
|
|
457
|
+
"meta": {},
|
|
458
|
+
"events": {
|
|
459
|
+
"type": "array",
|
|
460
|
+
"items": {
|
|
461
|
+
"$ref": "#/components/schemas/AnyEventObject"
|
|
462
|
+
}
|
|
463
|
+
},
|
|
464
|
+
"configuration": {
|
|
465
|
+
"type": "array",
|
|
466
|
+
"items": {}
|
|
467
|
+
},
|
|
468
|
+
"transitions": {
|
|
469
|
+
"type": "array",
|
|
470
|
+
"items": {}
|
|
471
|
+
},
|
|
472
|
+
"children": {
|
|
473
|
+
"type": "object"
|
|
474
|
+
},
|
|
475
|
+
"done": {
|
|
476
|
+
"type": "boolean"
|
|
477
|
+
},
|
|
478
|
+
"tags": {
|
|
479
|
+
"type": "object",
|
|
480
|
+
"properties": {
|
|
481
|
+
"size": {
|
|
482
|
+
"type": "number"
|
|
483
|
+
}
|
|
484
|
+
},
|
|
485
|
+
"required": [
|
|
486
|
+
"size"
|
|
487
|
+
]
|
|
488
|
+
},
|
|
489
|
+
"machine": {}
|
|
490
|
+
},
|
|
491
|
+
"required": [
|
|
492
|
+
"_event",
|
|
493
|
+
"_sessionid",
|
|
494
|
+
"children",
|
|
495
|
+
"configuration",
|
|
496
|
+
"context",
|
|
497
|
+
"transitions",
|
|
498
|
+
"value"
|
|
499
|
+
]
|
|
500
|
+
},
|
|
501
|
+
"instanceId": {
|
|
502
|
+
"type": "object",
|
|
503
|
+
"properties": {},
|
|
504
|
+
"description": "Unique instance ID of the machine"
|
|
505
|
+
},
|
|
506
|
+
"machineName": {
|
|
507
|
+
"type": "object",
|
|
508
|
+
"properties": {},
|
|
509
|
+
"description": "Machine name"
|
|
510
|
+
},
|
|
511
|
+
"tenantId": {
|
|
512
|
+
"type": "string"
|
|
513
|
+
},
|
|
514
|
+
"expiresAt": {
|
|
515
|
+
"type": "string",
|
|
516
|
+
"description": "Represents the expiration date"
|
|
517
|
+
},
|
|
518
|
+
"stateType": {
|
|
519
|
+
"anyOf": [
|
|
520
|
+
{
|
|
521
|
+
"type": "object",
|
|
522
|
+
"properties": {}
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
"type": "object",
|
|
526
|
+
"properties": {}
|
|
527
|
+
}
|
|
528
|
+
]
|
|
529
|
+
},
|
|
530
|
+
"machineState": {
|
|
531
|
+
"type": "object",
|
|
532
|
+
"properties": {
|
|
533
|
+
"state": {
|
|
534
|
+
"$ref": "#/components/schemas/SerializableState"
|
|
535
|
+
},
|
|
536
|
+
"instanceId": {
|
|
537
|
+
"type": "string",
|
|
538
|
+
"description": "Unique instance ID of the machine"
|
|
539
|
+
},
|
|
540
|
+
"sessionId": {
|
|
541
|
+
"type": "string",
|
|
542
|
+
"description": "Session Id of the machine. Not necessarily unique"
|
|
543
|
+
},
|
|
544
|
+
"machineName": {
|
|
545
|
+
"type": "string",
|
|
546
|
+
"description": "Machine name"
|
|
547
|
+
},
|
|
548
|
+
"latestStateName": {
|
|
549
|
+
"type": "string",
|
|
550
|
+
"description": "The latest state name. Can be empty for a newly initialize machine"
|
|
551
|
+
},
|
|
552
|
+
"latestEventType": {
|
|
553
|
+
"type": "string",
|
|
554
|
+
"description": "event types like SET_TOC, SET_FIRSTNAME, .... Will be xstate.init on a newly initialized machine"
|
|
555
|
+
},
|
|
556
|
+
"createdAt": {
|
|
557
|
+
"type": "string",
|
|
558
|
+
"description": "Represents the creation date"
|
|
559
|
+
},
|
|
560
|
+
"expiresAt": {
|
|
561
|
+
"type": "string",
|
|
562
|
+
"description": "Represents the expiration date"
|
|
563
|
+
},
|
|
564
|
+
"updatedAt": {
|
|
565
|
+
"type": "string",
|
|
566
|
+
"description": "Represents the update date"
|
|
567
|
+
},
|
|
568
|
+
"updatedCount": {
|
|
569
|
+
"type": "number",
|
|
570
|
+
"description": "Represents a counter for tracking updates."
|
|
571
|
+
},
|
|
572
|
+
"completedAt": {
|
|
573
|
+
"type": "string",
|
|
574
|
+
"format": "date-time"
|
|
575
|
+
},
|
|
576
|
+
"tenantId": {
|
|
577
|
+
"type": "string"
|
|
578
|
+
}
|
|
579
|
+
},
|
|
580
|
+
"required": [
|
|
581
|
+
"createdAt",
|
|
582
|
+
"instanceId",
|
|
583
|
+
"latestEventType",
|
|
584
|
+
"machineName",
|
|
585
|
+
"state",
|
|
586
|
+
"updatedAt",
|
|
587
|
+
"updatedCount"
|
|
588
|
+
]
|
|
589
|
+
}
|
|
590
|
+
},
|
|
591
|
+
"required": [
|
|
592
|
+
"instanceId",
|
|
593
|
+
"machineName",
|
|
594
|
+
"state",
|
|
595
|
+
"stateType"
|
|
596
|
+
],
|
|
597
|
+
"description": "Represents the arguments required to persist the machine state."
|
|
598
|
+
},
|
|
599
|
+
"DeleteExpiredStatesArgs": {
|
|
600
|
+
"type": "object",
|
|
601
|
+
"properties": {
|
|
602
|
+
"deleteDoneStates": {
|
|
603
|
+
"type": "boolean"
|
|
604
|
+
},
|
|
605
|
+
"machineName": {
|
|
606
|
+
"type": "string"
|
|
607
|
+
},
|
|
608
|
+
"tenantId": {
|
|
609
|
+
"type": "string"
|
|
610
|
+
}
|
|
611
|
+
},
|
|
612
|
+
"description": "Represents the arguments for deleting expired states from a machine."
|
|
613
|
+
},
|
|
614
|
+
"DeleteStateResult": {
|
|
615
|
+
"type": "number"
|
|
616
|
+
},
|
|
617
|
+
"FindActiveStatesArgs": {
|
|
618
|
+
"$ref": "#/components/schemas/StoreMachineStatesFindActiveArgs",
|
|
619
|
+
"description": "Represents the arguments for finding active states of a store machine."
|
|
620
|
+
},
|
|
621
|
+
"StoreMachineStatesFindActiveArgs": {
|
|
622
|
+
"type": "object",
|
|
623
|
+
"properties": {
|
|
624
|
+
"machineName": {
|
|
625
|
+
"type": "string",
|
|
626
|
+
"description": "Machine name"
|
|
627
|
+
},
|
|
628
|
+
"tenantId": {
|
|
629
|
+
"type": "string"
|
|
630
|
+
},
|
|
631
|
+
"instanceId": {
|
|
632
|
+
"type": "string",
|
|
633
|
+
"description": "Unique instance ID of the machine"
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
},
|
|
638
|
+
"methods": {
|
|
639
|
+
"machineStateDelete": {
|
|
640
|
+
"description": "Delete a particular machine state by instance id and tenant id",
|
|
641
|
+
"arguments": {
|
|
642
|
+
"$ref": "#/components/schemas/MachineStateDeleteArgs"
|
|
643
|
+
},
|
|
644
|
+
"returnType": {
|
|
645
|
+
"type": "boolean"
|
|
646
|
+
}
|
|
647
|
+
},
|
|
648
|
+
"machineStateGet": {
|
|
649
|
+
"description": "Get a particular machine state by instance id and tenant id",
|
|
650
|
+
"arguments": {
|
|
651
|
+
"$ref": "#/components/schemas/MachineStateGetArgs"
|
|
652
|
+
},
|
|
653
|
+
"returnType": {
|
|
654
|
+
"$ref": "#/components/schemas/MachineStateInfo"
|
|
655
|
+
}
|
|
656
|
+
},
|
|
657
|
+
"machineStateInit": {
|
|
658
|
+
"description": "Initializes a state object for a new machine. Does not persist anything",
|
|
659
|
+
"arguments": {
|
|
660
|
+
"$ref": "#/components/schemas/InitMachineStateArgs"
|
|
661
|
+
},
|
|
662
|
+
"returnType": {
|
|
663
|
+
"$ref": "#/components/schemas/MachineStateInit"
|
|
664
|
+
}
|
|
665
|
+
},
|
|
666
|
+
"machineStatePersist": {
|
|
667
|
+
"description": "Persists the state",
|
|
668
|
+
"arguments": {
|
|
669
|
+
"$ref": "#/components/schemas/MachineStatePersistArgs"
|
|
670
|
+
},
|
|
671
|
+
"returnType": {
|
|
672
|
+
"$ref": "#/components/schemas/MachineStateInfo"
|
|
673
|
+
}
|
|
674
|
+
},
|
|
675
|
+
"machineStatesDeleteExpired": {
|
|
676
|
+
"description": "Deletes the state of an xstate machine in the database.",
|
|
677
|
+
"arguments": {
|
|
678
|
+
"$ref": "#/components/schemas/DeleteExpiredStatesArgs"
|
|
679
|
+
},
|
|
680
|
+
"returnType": {
|
|
681
|
+
"$ref": "#/components/schemas/DeleteStateResult"
|
|
682
|
+
}
|
|
683
|
+
},
|
|
684
|
+
"machineStatesFindActive": {
|
|
685
|
+
"description": "Loads the states of active xstate machines from the database.",
|
|
686
|
+
"arguments": {
|
|
687
|
+
"$ref": "#/components/schemas/FindActiveStatesArgs"
|
|
688
|
+
},
|
|
689
|
+
"returnType": {
|
|
690
|
+
"type": "array",
|
|
691
|
+
"items": {
|
|
692
|
+
"$ref": "#/components/schemas/MachineStateInfo"
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
}
|