@pikku/core 0.12.129 → 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 (67) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/dist/function/function-meta.types.d.ts +14 -0
  3. package/dist/middleware-runner.d.ts +4 -0
  4. package/dist/middleware-runner.js +52 -16
  5. package/dist/services/in-memory-lease-service.d.ts +13 -0
  6. package/dist/services/in-memory-lease-service.js +49 -0
  7. package/dist/services/in-memory-workflow-service.d.ts +11 -3
  8. package/dist/services/in-memory-workflow-service.js +53 -23
  9. package/dist/services/index.d.ts +2 -0
  10. package/dist/services/index.js +2 -0
  11. package/dist/services/lease-service.d.ts +61 -0
  12. package/dist/services/lease-service.js +110 -0
  13. package/dist/services/trigger-source-store.d.ts +19 -2
  14. package/dist/services/trigger-source-store.js +14 -1
  15. package/dist/services/workflow-service.d.ts +1 -1
  16. package/dist/testing/index.d.ts +1 -0
  17. package/dist/testing/service-tests/lease-service-tests.d.ts +3 -0
  18. package/dist/testing/service-tests/lease-service-tests.js +138 -0
  19. package/dist/testing/service-tests/workflow-fencing-tests.d.ts +18 -0
  20. package/dist/testing/service-tests/workflow-fencing-tests.js +216 -0
  21. package/dist/testing/service-tests.d.ts +5 -0
  22. package/dist/testing/service-tests.js +8 -0
  23. package/dist/types/core.types.d.ts +12 -8
  24. package/dist/utils/hmac.d.ts +14 -10
  25. package/dist/utils/hmac.js +29 -25
  26. package/dist/wirings/http/pikku-fetch-http-response.js +13 -0
  27. package/dist/wirings/secret/derive-oauth2-app-secrets.js +1 -0
  28. package/dist/wirings/secret/secret.types.d.ts +6 -0
  29. package/dist/wirings/trigger/index.d.ts +4 -4
  30. package/dist/wirings/trigger/index.js +2 -2
  31. package/dist/wirings/trigger/webhook-source-runner.d.ts +51 -4
  32. package/dist/wirings/trigger/webhook-source-runner.js +201 -15
  33. package/dist/wirings/trigger/webhook-source.types.d.ts +50 -0
  34. package/dist/wirings/trigger/webhook-source.types.js +2 -0
  35. package/dist/wirings/workflow/graph/graph-runner.js +33 -14
  36. package/dist/wirings/workflow/index.d.ts +4 -3
  37. package/dist/wirings/workflow/index.js +3 -2
  38. package/dist/wirings/workflow/pikku-workflow-service.d.ts +57 -18
  39. package/dist/wirings/workflow/pikku-workflow-service.js +148 -145
  40. package/dist/wirings/workflow/workflow-constants.d.ts +28 -1
  41. package/dist/wirings/workflow/workflow-constants.js +28 -1
  42. package/dist/wirings/workflow/workflow-errors.d.ts +21 -0
  43. package/dist/wirings/workflow/workflow-errors.js +38 -0
  44. package/dist/wirings/workflow/workflow-queue-routing.d.ts +4 -2
  45. package/dist/wirings/workflow/workflow-queue-routing.js +9 -1
  46. package/dist/wirings/workflow/workflow-run-lease.d.ts +10 -0
  47. package/dist/wirings/workflow/workflow-run-lease.js +25 -0
  48. package/dist/wirings/workflow/workflow-run-status.d.ts +4 -0
  49. package/dist/wirings/workflow/workflow-run-status.js +37 -0
  50. package/dist/wirings/workflow/workflow-status-stream.d.ts +2 -1
  51. package/dist/wirings/workflow/workflow-status-stream.js +18 -1
  52. package/dist/wirings/workflow/workflow-step-claim.d.ts +13 -1
  53. package/dist/wirings/workflow/workflow-step-claim.js +29 -5
  54. package/dist/wirings/workflow/workflow-step-lease.d.ts +25 -0
  55. package/dist/wirings/workflow/workflow-step-lease.js +53 -0
  56. package/dist/wirings/workflow/workflow-step-retry.d.ts +14 -0
  57. package/dist/wirings/workflow/workflow-step-retry.js +33 -0
  58. package/dist/wirings/workflow/workflow-version-fallback.d.ts +11 -0
  59. package/dist/wirings/workflow/workflow-version-fallback.js +30 -0
  60. package/dist/wirings/workflow/workflow.types.d.ts +17 -0
  61. package/knowledge/decisions/internals/a-held-run-is-woken-later-not-retried.md +28 -0
  62. package/knowledge/decisions/internals/index.md +2 -1
  63. package/knowledge/decisions/internals/the-in-memory-workflow-service-is-inline-only-and-single-process.md +2 -2
  64. package/knowledge/decisions/internals/workflow-step-lock-is-held-only-to-claim-the-step.md +12 -5
  65. package/knowledge/decisions/security/an-actor-credential-is-derived-per-persona.md +4 -3
  66. package/package.json +1 -1
  67. package/src/public-surface.json +21 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikku/core",
3
- "version": "0.12.129",
3
+ "version": "0.12.133",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/pikkujs/pikku.git",
@@ -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",
@@ -183,12 +188,16 @@
183
188
  "PIKKU_INCOMING_WEBHOOK_QUEUE_NAME",
184
189
  "PikkuTriggerService",
185
190
  "declaredTriggerSources",
191
+ "disableTriggerSource",
186
192
  "dispatchWebhookSourceJob",
193
+ "enableTriggerSource",
187
194
  "receiveWebhookSourceRequest",
188
195
  "reconcileTriggerSources",
196
+ "reconcileWebhookRegistrations",
189
197
  "runWebhookSourceLifecycle",
190
198
  "subscribedWebhookEvents",
191
199
  "teardownTriggerSources",
200
+ "webhookSecretCredentialName",
192
201
  "wireTrigger",
193
202
  "wireTriggerSource",
194
203
  "wireTriggerWebhookSource"
@@ -421,6 +430,7 @@
421
430
  "DEFAULT_WEBHOOK_RETRIES",
422
431
  "FileScenarioRunStore",
423
432
  "InMemoryAgentRunStateService",
433
+ "InMemoryLeaseService",
424
434
  "InMemoryQueueService",
425
435
  "InMemorySessionStore",
426
436
  "InMemoryTriggerService",
@@ -433,10 +443,13 @@
433
443
  "LocalGatewayService",
434
444
  "LocalSecretService",
435
445
  "LocalVariablesService",
446
+ "LeaseLostError",
447
+ "LeaseTakenError",
436
448
  "LogLevel",
437
449
  "NoopAuditService",
438
450
  "PIKKU_OUTGOING_WEBHOOK_QUEUE_NAME",
439
451
  "PikkuCredentialWireService",
452
+ "holdLease",
440
453
  "PikkuSessionService",
441
454
  "QueueWebhookService",
442
455
  "REMOTE_JOBS_SECRET_HEADER",
@@ -518,7 +531,14 @@
518
531
  "verifyWithKeyMaterial",
519
532
  "wrapDEK"
520
533
  ],
521
- "./hmac": ["WebhookSigningSecret", "hmacSha256Hex", "timingSafeStringEqual"],
534
+ "./hmac": [
535
+ "WebhookSigningSecret",
536
+ "hmacDigest",
537
+ "hmacSha256Hex",
538
+ "timingSafeStringEqual",
539
+ "verifyHmacSignature",
540
+ "verifyPublicKeySignature"
541
+ ],
522
542
  "./state": [
523
543
  "addPackageServiceFactories",
524
544
  "getAllPackageStates",