@pikku/core 0.12.130 → 0.12.133

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 (62) hide show
  1. package/CHANGELOG.md +95 -0
  2. package/dist/middleware-runner.d.ts +4 -0
  3. package/dist/middleware-runner.js +52 -16
  4. package/dist/services/in-memory-lease-service.d.ts +13 -0
  5. package/dist/services/in-memory-lease-service.js +49 -0
  6. package/dist/services/in-memory-workflow-service.d.ts +11 -3
  7. package/dist/services/in-memory-workflow-service.js +53 -23
  8. package/dist/services/index.d.ts +2 -0
  9. package/dist/services/index.js +2 -0
  10. package/dist/services/lease-service.d.ts +61 -0
  11. package/dist/services/lease-service.js +110 -0
  12. package/dist/services/workflow-service.d.ts +1 -1
  13. package/dist/testing/index.d.ts +1 -0
  14. package/dist/testing/service-tests/lease-service-tests.d.ts +3 -0
  15. package/dist/testing/service-tests/lease-service-tests.js +138 -0
  16. package/dist/testing/service-tests/workflow-fencing-tests.d.ts +18 -0
  17. package/dist/testing/service-tests/workflow-fencing-tests.js +216 -0
  18. package/dist/testing/service-tests.d.ts +5 -0
  19. package/dist/testing/service-tests.js +8 -0
  20. package/dist/types/core.types.d.ts +12 -8
  21. package/dist/utils/hmac.d.ts +14 -10
  22. package/dist/utils/hmac.js +29 -25
  23. package/dist/wirings/http/pikku-fetch-http-response.js +13 -0
  24. package/dist/wirings/secret/derive-oauth2-app-secrets.js +1 -0
  25. package/dist/wirings/secret/secret.types.d.ts +6 -0
  26. package/dist/wirings/trigger/index.d.ts +2 -2
  27. package/dist/wirings/trigger/index.js +1 -1
  28. package/dist/wirings/trigger/webhook-source-runner.js +45 -1
  29. package/dist/wirings/trigger/webhook-source.types.d.ts +50 -0
  30. package/dist/wirings/trigger/webhook-source.types.js +2 -0
  31. package/dist/wirings/workflow/graph/graph-runner.js +33 -14
  32. package/dist/wirings/workflow/index.d.ts +4 -3
  33. package/dist/wirings/workflow/index.js +3 -2
  34. package/dist/wirings/workflow/pikku-workflow-service.d.ts +57 -18
  35. package/dist/wirings/workflow/pikku-workflow-service.js +143 -140
  36. package/dist/wirings/workflow/workflow-constants.d.ts +28 -1
  37. package/dist/wirings/workflow/workflow-constants.js +28 -1
  38. package/dist/wirings/workflow/workflow-errors.d.ts +21 -0
  39. package/dist/wirings/workflow/workflow-errors.js +38 -0
  40. package/dist/wirings/workflow/workflow-queue-routing.d.ts +4 -2
  41. package/dist/wirings/workflow/workflow-queue-routing.js +9 -1
  42. package/dist/wirings/workflow/workflow-run-lease.d.ts +10 -0
  43. package/dist/wirings/workflow/workflow-run-lease.js +25 -0
  44. package/dist/wirings/workflow/workflow-run-status.d.ts +4 -0
  45. package/dist/wirings/workflow/workflow-run-status.js +37 -0
  46. package/dist/wirings/workflow/workflow-status-stream.d.ts +2 -1
  47. package/dist/wirings/workflow/workflow-status-stream.js +18 -1
  48. package/dist/wirings/workflow/workflow-step-claim.d.ts +13 -1
  49. package/dist/wirings/workflow/workflow-step-claim.js +29 -5
  50. package/dist/wirings/workflow/workflow-step-lease.d.ts +25 -0
  51. package/dist/wirings/workflow/workflow-step-lease.js +53 -0
  52. package/dist/wirings/workflow/workflow-step-retry.d.ts +14 -0
  53. package/dist/wirings/workflow/workflow-step-retry.js +33 -0
  54. package/dist/wirings/workflow/workflow-version-fallback.d.ts +11 -0
  55. package/dist/wirings/workflow/workflow-version-fallback.js +30 -0
  56. package/dist/wirings/workflow/workflow.types.d.ts +17 -0
  57. package/knowledge/decisions/internals/a-held-run-is-woken-later-not-retried.md +28 -0
  58. package/knowledge/decisions/internals/index.md +2 -1
  59. package/knowledge/decisions/internals/the-in-memory-workflow-service-is-inline-only-and-single-process.md +2 -2
  60. package/knowledge/decisions/internals/workflow-step-lock-is-held-only-to-claim-the-step.md +12 -5
  61. package/package.json +1 -1
  62. package/src/public-surface.json +18 -1
@@ -50,6 +50,7 @@
50
50
  "wireChannel"
51
51
  ],
52
52
  "./workflow": [
53
+ "DEFAULT_STEP_LEASE_MS",
53
54
  "DEFAULT_STEP_RETRIES",
54
55
  "PikkuWorkflowService",
55
56
  "WorkflowApprovalForbiddenError",
@@ -60,6 +61,8 @@
60
61
  "WorkflowRunForbiddenError",
61
62
  "WorkflowRunNotFoundError",
62
63
  "WorkflowStepFunctionMismatchError",
64
+ "WorkflowStepLeaseExpiredError",
65
+ "WorkflowStepSupersededError",
63
66
  "WorkflowSuspendedException",
64
67
  "addWorkflow",
65
68
  "assertWorkflowRunOwner",
@@ -67,6 +70,8 @@
67
70
  "createGraph",
68
71
  "deriveInvocationId",
69
72
  "isRef",
73
+ "isStepLeaseLive",
74
+ "leaseAttemptsExhausted",
70
75
  "pikkuWorkflowGraph",
71
76
  "reconstructFinalState",
72
77
  "reconstructStateAt",
@@ -192,6 +197,7 @@
192
197
  "runWebhookSourceLifecycle",
193
198
  "subscribedWebhookEvents",
194
199
  "teardownTriggerSources",
200
+ "webhookSecretCredentialName",
195
201
  "wireTrigger",
196
202
  "wireTriggerSource",
197
203
  "wireTriggerWebhookSource"
@@ -424,6 +430,7 @@
424
430
  "DEFAULT_WEBHOOK_RETRIES",
425
431
  "FileScenarioRunStore",
426
432
  "InMemoryAgentRunStateService",
433
+ "InMemoryLeaseService",
427
434
  "InMemoryQueueService",
428
435
  "InMemorySessionStore",
429
436
  "InMemoryTriggerService",
@@ -436,10 +443,13 @@
436
443
  "LocalGatewayService",
437
444
  "LocalSecretService",
438
445
  "LocalVariablesService",
446
+ "LeaseLostError",
447
+ "LeaseTakenError",
439
448
  "LogLevel",
440
449
  "NoopAuditService",
441
450
  "PIKKU_OUTGOING_WEBHOOK_QUEUE_NAME",
442
451
  "PikkuCredentialWireService",
452
+ "holdLease",
443
453
  "PikkuSessionService",
444
454
  "QueueWebhookService",
445
455
  "REMOTE_JOBS_SECRET_HEADER",
@@ -521,7 +531,14 @@
521
531
  "verifyWithKeyMaterial",
522
532
  "wrapDEK"
523
533
  ],
524
- "./hmac": ["WebhookSigningSecret", "hmacSha256Hex", "timingSafeStringEqual"],
534
+ "./hmac": [
535
+ "WebhookSigningSecret",
536
+ "hmacDigest",
537
+ "hmacSha256Hex",
538
+ "timingSafeStringEqual",
539
+ "verifyHmacSignature",
540
+ "verifyPublicKeySignature"
541
+ ],
525
542
  "./state": [
526
543
  "addPackageServiceFactories",
527
544
  "getAllPackageStates",