@firedrill-tools/trolley 0.1.1

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 (78) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +219 -0
  3. package/firedrill/agent.target.json +16 -0
  4. package/firedrill/baseline.scenario.json +2109 -0
  5. package/firedrill/conformance.suite.json +19 -0
  6. package/firedrill/partner-outage.scenario.json +11 -0
  7. package/firedrill/processing-response-lost.scenario.json +11 -0
  8. package/firedrill/rate-limited.scenario.json +11 -0
  9. package/firedrill/tight-limits.scenario.json +16 -0
  10. package/firedrill/tools/trolley/app/assets/ATTRIBUTION.md +35 -0
  11. package/firedrill/tools/trolley/app/assets/cropped-Site-Icon-512x512-px-1-192x192.png +0 -0
  12. package/firedrill/tools/trolley/app/assets/fonts/OFL.txt +93 -0
  13. package/firedrill/tools/trolley/app/assets/full-logo.svg +1 -0
  14. package/firedrill/tools/trolley/app/assets/logo-black.svg +18 -0
  15. package/firedrill/tools/trolley/app/site/app.js +139 -0
  16. package/firedrill/tools/trolley/app/site/assets/fonts/inter-latin.woff2 +0 -0
  17. package/firedrill/tools/trolley/app/site/assets/trolley-icon.png +0 -0
  18. package/firedrill/tools/trolley/app/site/assets/trolley-logo.svg +1 -0
  19. package/firedrill/tools/trolley/app/site/base.css +99 -0
  20. package/firedrill/tools/trolley/app/site/batch-actions.js +139 -0
  21. package/firedrill/tools/trolley/app/site/components.css +149 -0
  22. package/firedrill/tools/trolley/app/site/icons.js +50 -0
  23. package/firedrill/tools/trolley/app/site/index.html +53 -0
  24. package/firedrill/tools/trolley/app/site/list.js +87 -0
  25. package/firedrill/tools/trolley/app/site/ui.js +181 -0
  26. package/firedrill/tools/trolley/app/site/view-balances.js +30 -0
  27. package/firedrill/tools/trolley/app/site/view-batch.js +86 -0
  28. package/firedrill/tools/trolley/app/site/view-batches.js +78 -0
  29. package/firedrill/tools/trolley/app/site/view-dashboard.js +79 -0
  30. package/firedrill/tools/trolley/app/site/view-methods.js +80 -0
  31. package/firedrill/tools/trolley/app/site/view-recipient.js +124 -0
  32. package/firedrill/tools/trolley/app/site/view-recipients.js +115 -0
  33. package/firedrill/tools/trolley/behavior.mjs +78 -0
  34. package/firedrill/tools/trolley/lib/access.mjs +21 -0
  35. package/firedrill/tools/trolley/lib/ids.mjs +28 -0
  36. package/firedrill/tools/trolley/lib/money.mjs +55 -0
  37. package/firedrill/tools/trolley/lib/paging.mjs +65 -0
  38. package/firedrill/tools/trolley/lib/pricing.mjs +88 -0
  39. package/firedrill/tools/trolley/lib/records.mjs +87 -0
  40. package/firedrill/tools/trolley/lib/serialize.mjs +152 -0
  41. package/firedrill/tools/trolley/lib/store.mjs +61 -0
  42. package/firedrill/tools/trolley/lib/time.mjs +60 -0
  43. package/firedrill/tools/trolley/lib/validate.mjs +111 -0
  44. package/firedrill/tools/trolley/lib/wire.mjs +145 -0
  45. package/firedrill/tools/trolley/ops/accounts-write.mjs +117 -0
  46. package/firedrill/tools/trolley/ops/accounts.mjs +129 -0
  47. package/firedrill/tools/trolley/ops/balances.mjs +23 -0
  48. package/firedrill/tools/trolley/ops/batches.mjs +139 -0
  49. package/firedrill/tools/trolley/ops/payment-build.mjs +79 -0
  50. package/firedrill/tools/trolley/ops/payments.mjs +112 -0
  51. package/firedrill/tools/trolley/ops/processing.mjs +104 -0
  52. package/firedrill/tools/trolley/ops/recipients-list.mjs +58 -0
  53. package/firedrill/tools/trolley/ops/recipients.mjs +127 -0
  54. package/firedrill/tools/trolley/trolley.tool.json +10095 -0
  55. package/firedrill/trolley-accounts.drill.json +205 -0
  56. package/firedrill/trolley-batch-lifecycle.drill.json +522 -0
  57. package/firedrill/trolley-denied.drill.json +74 -0
  58. package/firedrill/trolley-fresh-install.drill.json +68 -0
  59. package/firedrill/trolley-invalid-key.drill.json +743 -0
  60. package/firedrill/trolley-partner-outage.drill.json +97 -0
  61. package/firedrill/trolley-processing-rules.drill.json +138 -0
  62. package/firedrill/trolley-rate-limited.drill.json +118 -0
  63. package/firedrill/trolley-read-only.drill.json +468 -0
  64. package/firedrill/trolley-recipients.drill.json +183 -0
  65. package/firedrill/trolley-response-lost.drill.json +127 -0
  66. package/firedrill/trolley-tight-limits.drill.json +348 -0
  67. package/firedrill/world.json +2539 -0
  68. package/firedrill.json +5 -0
  69. package/package.json +64 -0
  70. package/starter.json +2108 -0
  71. package/test/conformance.mjs +12 -0
  72. package/test/flow-access.mjs +54 -0
  73. package/test/flow-accounts.mjs +63 -0
  74. package/test/flow-batches.mjs +107 -0
  75. package/test/flow-faults.mjs +58 -0
  76. package/test/flow-processing.mjs +41 -0
  77. package/test/flow-recipients.mjs +93 -0
  78. package/test/harness.mjs +87 -0
@@ -0,0 +1,522 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "trolley-batch-lifecycle",
4
+ "title": "Batches and payments: create, list, update, delete, summary, quote, processing and terminal-state refusals",
5
+ "targetId": "conformance-agent",
6
+ "scenarioId": "baseline",
7
+ "actorId": "ops",
8
+ "task": {
9
+ "instruction": "Run the batch-lifecycle conformance flow against the synthetic Trolley Tool and fail loudly on any unexpected status or body."
10
+ },
11
+ "assertions": [
12
+ {
13
+ "id": "batches-create-ok",
14
+ "kind": "operation.count",
15
+ "operation": {
16
+ "packageId": "trolley",
17
+ "operationId": "batches.create"
18
+ },
19
+ "outcomes": [
20
+ "ok"
21
+ ],
22
+ "comparison": {
23
+ "operator": "greater_than_or_equal",
24
+ "value": 1
25
+ }
26
+ },
27
+ {
28
+ "id": "batches-create-tool-error",
29
+ "kind": "operation.count",
30
+ "operation": {
31
+ "packageId": "trolley",
32
+ "operationId": "batches.create"
33
+ },
34
+ "outcomes": [
35
+ "tool_error"
36
+ ],
37
+ "comparison": {
38
+ "operator": "greater_than_or_equal",
39
+ "value": 1
40
+ }
41
+ },
42
+ {
43
+ "id": "batches-get-ok",
44
+ "kind": "operation.count",
45
+ "operation": {
46
+ "packageId": "trolley",
47
+ "operationId": "batches.get"
48
+ },
49
+ "outcomes": [
50
+ "ok"
51
+ ],
52
+ "comparison": {
53
+ "operator": "greater_than_or_equal",
54
+ "value": 1
55
+ }
56
+ },
57
+ {
58
+ "id": "batches-get-tool-error",
59
+ "kind": "operation.count",
60
+ "operation": {
61
+ "packageId": "trolley",
62
+ "operationId": "batches.get"
63
+ },
64
+ "outcomes": [
65
+ "tool_error"
66
+ ],
67
+ "comparison": {
68
+ "operator": "greater_than_or_equal",
69
+ "value": 1
70
+ }
71
+ },
72
+ {
73
+ "id": "batches-update-ok",
74
+ "kind": "operation.count",
75
+ "operation": {
76
+ "packageId": "trolley",
77
+ "operationId": "batches.update"
78
+ },
79
+ "outcomes": [
80
+ "ok"
81
+ ],
82
+ "comparison": {
83
+ "operator": "greater_than_or_equal",
84
+ "value": 1
85
+ }
86
+ },
87
+ {
88
+ "id": "batches-update-tool-error",
89
+ "kind": "operation.count",
90
+ "operation": {
91
+ "packageId": "trolley",
92
+ "operationId": "batches.update"
93
+ },
94
+ "outcomes": [
95
+ "tool_error"
96
+ ],
97
+ "comparison": {
98
+ "operator": "greater_than_or_equal",
99
+ "value": 1
100
+ }
101
+ },
102
+ {
103
+ "id": "batches-delete-ok",
104
+ "kind": "operation.count",
105
+ "operation": {
106
+ "packageId": "trolley",
107
+ "operationId": "batches.delete"
108
+ },
109
+ "outcomes": [
110
+ "ok"
111
+ ],
112
+ "comparison": {
113
+ "operator": "greater_than_or_equal",
114
+ "value": 1
115
+ }
116
+ },
117
+ {
118
+ "id": "batches-delete-tool-error",
119
+ "kind": "operation.count",
120
+ "operation": {
121
+ "packageId": "trolley",
122
+ "operationId": "batches.delete"
123
+ },
124
+ "outcomes": [
125
+ "tool_error"
126
+ ],
127
+ "comparison": {
128
+ "operator": "greater_than_or_equal",
129
+ "value": 1
130
+ }
131
+ },
132
+ {
133
+ "id": "batches-list-ok",
134
+ "kind": "operation.count",
135
+ "operation": {
136
+ "packageId": "trolley",
137
+ "operationId": "batches.list"
138
+ },
139
+ "outcomes": [
140
+ "ok"
141
+ ],
142
+ "comparison": {
143
+ "operator": "greater_than_or_equal",
144
+ "value": 1
145
+ }
146
+ },
147
+ {
148
+ "id": "batches-list-tool-error",
149
+ "kind": "operation.count",
150
+ "operation": {
151
+ "packageId": "trolley",
152
+ "operationId": "batches.list"
153
+ },
154
+ "outcomes": [
155
+ "tool_error"
156
+ ],
157
+ "comparison": {
158
+ "operator": "greater_than_or_equal",
159
+ "value": 1
160
+ }
161
+ },
162
+ {
163
+ "id": "batches-generate-quote-ok",
164
+ "kind": "operation.count",
165
+ "operation": {
166
+ "packageId": "trolley",
167
+ "operationId": "batches.generate_quote"
168
+ },
169
+ "outcomes": [
170
+ "ok"
171
+ ],
172
+ "comparison": {
173
+ "operator": "greater_than_or_equal",
174
+ "value": 1
175
+ }
176
+ },
177
+ {
178
+ "id": "batches-generate-quote-tool-error",
179
+ "kind": "operation.count",
180
+ "operation": {
181
+ "packageId": "trolley",
182
+ "operationId": "batches.generate_quote"
183
+ },
184
+ "outcomes": [
185
+ "tool_error"
186
+ ],
187
+ "comparison": {
188
+ "operator": "greater_than_or_equal",
189
+ "value": 1
190
+ }
191
+ },
192
+ {
193
+ "id": "batches-start-processing-ok",
194
+ "kind": "operation.count",
195
+ "operation": {
196
+ "packageId": "trolley",
197
+ "operationId": "batches.start_processing"
198
+ },
199
+ "outcomes": [
200
+ "ok"
201
+ ],
202
+ "comparison": {
203
+ "operator": "greater_than_or_equal",
204
+ "value": 1
205
+ }
206
+ },
207
+ {
208
+ "id": "batches-start-processing-tool-error",
209
+ "kind": "operation.count",
210
+ "operation": {
211
+ "packageId": "trolley",
212
+ "operationId": "batches.start_processing"
213
+ },
214
+ "outcomes": [
215
+ "tool_error"
216
+ ],
217
+ "comparison": {
218
+ "operator": "greater_than_or_equal",
219
+ "value": 1
220
+ }
221
+ },
222
+ {
223
+ "id": "batches-summary-ok",
224
+ "kind": "operation.count",
225
+ "operation": {
226
+ "packageId": "trolley",
227
+ "operationId": "batches.summary"
228
+ },
229
+ "outcomes": [
230
+ "ok"
231
+ ],
232
+ "comparison": {
233
+ "operator": "greater_than_or_equal",
234
+ "value": 1
235
+ }
236
+ },
237
+ {
238
+ "id": "batches-summary-tool-error",
239
+ "kind": "operation.count",
240
+ "operation": {
241
+ "packageId": "trolley",
242
+ "operationId": "batches.summary"
243
+ },
244
+ "outcomes": [
245
+ "tool_error"
246
+ ],
247
+ "comparison": {
248
+ "operator": "greater_than_or_equal",
249
+ "value": 1
250
+ }
251
+ },
252
+ {
253
+ "id": "payments-create-ok",
254
+ "kind": "operation.count",
255
+ "operation": {
256
+ "packageId": "trolley",
257
+ "operationId": "payments.create"
258
+ },
259
+ "outcomes": [
260
+ "ok"
261
+ ],
262
+ "comparison": {
263
+ "operator": "greater_than_or_equal",
264
+ "value": 1
265
+ }
266
+ },
267
+ {
268
+ "id": "payments-create-tool-error",
269
+ "kind": "operation.count",
270
+ "operation": {
271
+ "packageId": "trolley",
272
+ "operationId": "payments.create"
273
+ },
274
+ "outcomes": [
275
+ "tool_error"
276
+ ],
277
+ "comparison": {
278
+ "operator": "greater_than_or_equal",
279
+ "value": 1
280
+ }
281
+ },
282
+ {
283
+ "id": "payments-list-ok",
284
+ "kind": "operation.count",
285
+ "operation": {
286
+ "packageId": "trolley",
287
+ "operationId": "payments.list"
288
+ },
289
+ "outcomes": [
290
+ "ok"
291
+ ],
292
+ "comparison": {
293
+ "operator": "greater_than_or_equal",
294
+ "value": 1
295
+ }
296
+ },
297
+ {
298
+ "id": "payments-list-tool-error",
299
+ "kind": "operation.count",
300
+ "operation": {
301
+ "packageId": "trolley",
302
+ "operationId": "payments.list"
303
+ },
304
+ "outcomes": [
305
+ "tool_error"
306
+ ],
307
+ "comparison": {
308
+ "operator": "greater_than_or_equal",
309
+ "value": 1
310
+ }
311
+ },
312
+ {
313
+ "id": "payments-get-ok",
314
+ "kind": "operation.count",
315
+ "operation": {
316
+ "packageId": "trolley",
317
+ "operationId": "payments.get"
318
+ },
319
+ "outcomes": [
320
+ "ok"
321
+ ],
322
+ "comparison": {
323
+ "operator": "greater_than_or_equal",
324
+ "value": 1
325
+ }
326
+ },
327
+ {
328
+ "id": "payments-get-tool-error",
329
+ "kind": "operation.count",
330
+ "operation": {
331
+ "packageId": "trolley",
332
+ "operationId": "payments.get"
333
+ },
334
+ "outcomes": [
335
+ "tool_error"
336
+ ],
337
+ "comparison": {
338
+ "operator": "greater_than_or_equal",
339
+ "value": 1
340
+ }
341
+ },
342
+ {
343
+ "id": "payments-update-ok",
344
+ "kind": "operation.count",
345
+ "operation": {
346
+ "packageId": "trolley",
347
+ "operationId": "payments.update"
348
+ },
349
+ "outcomes": [
350
+ "ok"
351
+ ],
352
+ "comparison": {
353
+ "operator": "greater_than_or_equal",
354
+ "value": 1
355
+ }
356
+ },
357
+ {
358
+ "id": "payments-update-tool-error",
359
+ "kind": "operation.count",
360
+ "operation": {
361
+ "packageId": "trolley",
362
+ "operationId": "payments.update"
363
+ },
364
+ "outcomes": [
365
+ "tool_error"
366
+ ],
367
+ "comparison": {
368
+ "operator": "greater_than_or_equal",
369
+ "value": 1
370
+ }
371
+ },
372
+ {
373
+ "id": "payments-delete-ok",
374
+ "kind": "operation.count",
375
+ "operation": {
376
+ "packageId": "trolley",
377
+ "operationId": "payments.delete"
378
+ },
379
+ "outcomes": [
380
+ "ok"
381
+ ],
382
+ "comparison": {
383
+ "operator": "greater_than_or_equal",
384
+ "value": 1
385
+ }
386
+ },
387
+ {
388
+ "id": "payments-delete-tool-error",
389
+ "kind": "operation.count",
390
+ "operation": {
391
+ "packageId": "trolley",
392
+ "operationId": "payments.delete"
393
+ },
394
+ "outcomes": [
395
+ "tool_error"
396
+ ],
397
+ "comparison": {
398
+ "operator": "greater_than_or_equal",
399
+ "value": 1
400
+ }
401
+ },
402
+ {
403
+ "id": "balances-list-ok",
404
+ "kind": "operation.count",
405
+ "operation": {
406
+ "packageId": "trolley",
407
+ "operationId": "balances.list"
408
+ },
409
+ "outcomes": [
410
+ "ok"
411
+ ],
412
+ "comparison": {
413
+ "operator": "greater_than_or_equal",
414
+ "value": 1
415
+ }
416
+ },
417
+ {
418
+ "id": "balances-list-tool-error",
419
+ "kind": "operation.count",
420
+ "operation": {
421
+ "packageId": "trolley",
422
+ "operationId": "balances.list"
423
+ },
424
+ "outcomes": [
425
+ "tool_error"
426
+ ],
427
+ "comparison": {
428
+ "operator": "greater_than_or_equal",
429
+ "value": 1
430
+ }
431
+ },
432
+ {
433
+ "id": "event-batch-processing",
434
+ "kind": "event.count",
435
+ "event": {
436
+ "packageId": "trolley",
437
+ "eventId": "batch.processing"
438
+ },
439
+ "phase": "emitted",
440
+ "comparison": {
441
+ "operator": "equals",
442
+ "value": 1
443
+ }
444
+ },
445
+ {
446
+ "id": "event-payment-processed",
447
+ "kind": "event.count",
448
+ "event": {
449
+ "packageId": "trolley",
450
+ "eventId": "payment.processed"
451
+ },
452
+ "phase": "emitted",
453
+ "comparison": {
454
+ "operator": "equals",
455
+ "value": 3
456
+ }
457
+ },
458
+ {
459
+ "id": "event-payment-failed",
460
+ "kind": "event.count",
461
+ "event": {
462
+ "packageId": "trolley",
463
+ "eventId": "payment.failed"
464
+ },
465
+ "phase": "emitted",
466
+ "comparison": {
467
+ "operator": "equals",
468
+ "value": 0
469
+ }
470
+ },
471
+ {
472
+ "id": "usd-balance-debited",
473
+ "kind": "state.value",
474
+ "packageId": "trolley",
475
+ "namespace": "balances",
476
+ "rowId": "paymentrails:USD",
477
+ "path": [
478
+ "amount"
479
+ ],
480
+ "comparison": {
481
+ "operator": "equals",
482
+ "value": "17179.55"
483
+ }
484
+ },
485
+ {
486
+ "id": "b1-complete",
487
+ "kind": "state.value",
488
+ "packageId": "trolley",
489
+ "namespace": "batches",
490
+ "rowId": "B-000000000000000000003F",
491
+ "path": [
492
+ "status"
493
+ ],
494
+ "comparison": {
495
+ "operator": "equals",
496
+ "value": "complete"
497
+ }
498
+ },
499
+ {
500
+ "id": "quote-before-processing",
501
+ "kind": "operation.order",
502
+ "sequence": [
503
+ {
504
+ "anyOf": [
505
+ {
506
+ "packageId": "trolley",
507
+ "operationId": "batches.generate_quote"
508
+ }
509
+ ]
510
+ },
511
+ {
512
+ "anyOf": [
513
+ {
514
+ "packageId": "trolley",
515
+ "operationId": "batches.start_processing"
516
+ }
517
+ ]
518
+ }
519
+ ]
520
+ }
521
+ ]
522
+ }
@@ -0,0 +1,74 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "trolley-denied",
4
+ "title": "Actor without grants is denied by the framework before the Tool runs",
5
+ "targetId": "conformance-agent",
6
+ "scenarioId": "baseline",
7
+ "actorId": "no-grants",
8
+ "task": {
9
+ "instruction": "Run the denied conformance flow against the synthetic Trolley Tool and fail loudly on any unexpected status or body."
10
+ },
11
+ "assertions": [
12
+ {
13
+ "id": "recipients-list-denied",
14
+ "kind": "operation.denied",
15
+ "operation": {
16
+ "packageId": "trolley",
17
+ "operationId": "recipients.list"
18
+ },
19
+ "outcomes": [
20
+ "denied"
21
+ ],
22
+ "attemptRequired": true
23
+ },
24
+ {
25
+ "id": "batches-create-denied",
26
+ "kind": "operation.denied",
27
+ "operation": {
28
+ "packageId": "trolley",
29
+ "operationId": "batches.create"
30
+ },
31
+ "outcomes": [
32
+ "denied"
33
+ ],
34
+ "attemptRequired": true
35
+ },
36
+ {
37
+ "id": "batches-start-processing-denied",
38
+ "kind": "operation.denied",
39
+ "operation": {
40
+ "packageId": "trolley",
41
+ "operationId": "batches.start_processing"
42
+ },
43
+ "outcomes": [
44
+ "denied"
45
+ ],
46
+ "attemptRequired": true
47
+ },
48
+ {
49
+ "id": "batches-create-ok-exact",
50
+ "kind": "operation.count",
51
+ "operation": {
52
+ "packageId": "trolley",
53
+ "operationId": "batches.create"
54
+ },
55
+ "outcomes": [
56
+ "ok"
57
+ ],
58
+ "comparison": {
59
+ "operator": "equals",
60
+ "value": 0
61
+ }
62
+ },
63
+ {
64
+ "id": "count-batches",
65
+ "kind": "state.count",
66
+ "packageId": "trolley",
67
+ "namespace": "batches",
68
+ "comparison": {
69
+ "operator": "equals",
70
+ "value": 11
71
+ }
72
+ }
73
+ ]
74
+ }
@@ -0,0 +1,68 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "trolley-fresh-install",
4
+ "title": "Actor without attributes maps to the seeded merchant with full access",
5
+ "targetId": "conformance-agent",
6
+ "scenarioId": "baseline",
7
+ "actorId": "fresh",
8
+ "task": {
9
+ "instruction": "Run the fresh-install conformance flow against the synthetic Trolley Tool and fail loudly on any unexpected status or body."
10
+ },
11
+ "assertions": [
12
+ {
13
+ "id": "recipients-list-ok",
14
+ "kind": "operation.count",
15
+ "operation": {
16
+ "packageId": "trolley",
17
+ "operationId": "recipients.list"
18
+ },
19
+ "outcomes": [
20
+ "ok"
21
+ ],
22
+ "comparison": {
23
+ "operator": "greater_than_or_equal",
24
+ "value": 1
25
+ }
26
+ },
27
+ {
28
+ "id": "balances-list-ok",
29
+ "kind": "operation.count",
30
+ "operation": {
31
+ "packageId": "trolley",
32
+ "operationId": "balances.list"
33
+ },
34
+ "outcomes": [
35
+ "ok"
36
+ ],
37
+ "comparison": {
38
+ "operator": "greater_than_or_equal",
39
+ "value": 1
40
+ }
41
+ },
42
+ {
43
+ "id": "batches-create-ok-exact",
44
+ "kind": "operation.count",
45
+ "operation": {
46
+ "packageId": "trolley",
47
+ "operationId": "batches.create"
48
+ },
49
+ "outcomes": [
50
+ "ok"
51
+ ],
52
+ "comparison": {
53
+ "operator": "equals",
54
+ "value": 1
55
+ }
56
+ },
57
+ {
58
+ "id": "count-batches",
59
+ "kind": "state.count",
60
+ "packageId": "trolley",
61
+ "namespace": "batches",
62
+ "comparison": {
63
+ "operator": "equals",
64
+ "value": 12
65
+ }
66
+ }
67
+ ]
68
+ }