@n8n/engine 0.17.0 → 0.18.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 (145) hide show
  1. package/dist/auth/action-token.d.ts +7 -0
  2. package/dist/auth/action-token.js +30 -0
  3. package/dist/auth/action-token.js.map +1 -0
  4. package/dist/auth/authenticate.d.ts +2 -1
  5. package/dist/auth/authenticate.js +3 -2
  6. package/dist/auth/authenticate.js.map +1 -1
  7. package/dist/auth/identity-token.d.ts +3 -5
  8. package/dist/auth/identity-token.js +17 -38
  9. package/dist/auth/identity-token.js.map +1 -1
  10. package/dist/auth/index.d.ts +3 -1
  11. package/dist/auth/index.js +7 -5
  12. package/dist/auth/index.js.map +1 -1
  13. package/dist/auth/shared-secret-token.d.ts +12 -0
  14. package/dist/auth/shared-secret-token.js +44 -0
  15. package/dist/auth/shared-secret-token.js.map +1 -0
  16. package/dist/build.tsbuildinfo +1 -1
  17. package/dist/common/index.d.ts +1 -0
  18. package/dist/common/index.js +3 -1
  19. package/dist/common/index.js.map +1 -1
  20. package/dist/common/json.schema.d.ts +3 -0
  21. package/dist/common/json.schema.js +13 -0
  22. package/dist/common/json.schema.js.map +1 -0
  23. package/dist/database/create-stores.d.ts +2 -0
  24. package/dist/database/create-stores.js +6 -2
  25. package/dist/database/create-stores.js.map +1 -1
  26. package/dist/database/entities/workflow-execution.entity.d.ts +0 -1
  27. package/dist/database/entities/workflow-execution.entity.js +0 -11
  28. package/dist/database/entities/workflow-execution.entity.js.map +1 -1
  29. package/dist/database/entities/workflow-step-execution.entity.d.ts +1 -2
  30. package/dist/database/entities/workflow-step-execution.entity.js.map +1 -1
  31. package/dist/database/index.d.ts +1 -0
  32. package/dist/database/index.js +3 -1
  33. package/dist/database/index.js.map +1 -1
  34. package/dist/database/typeorm-execution-store.d.ts +1 -3
  35. package/dist/database/typeorm-execution-store.js +0 -1
  36. package/dist/database/typeorm-execution-store.js.map +1 -1
  37. package/dist/database/typeorm-execution-view-store.d.ts +10 -0
  38. package/dist/database/typeorm-execution-view-store.js +49 -0
  39. package/dist/database/typeorm-execution-view-store.js.map +1 -0
  40. package/dist/database/typeorm-step-store.d.ts +3 -2
  41. package/dist/database/typeorm-step-store.js +6 -1
  42. package/dist/database/typeorm-step-store.js.map +1 -1
  43. package/dist/dependencies/external-dependencies.d.ts +3 -0
  44. package/dist/execution/batch-step.d.ts +8 -0
  45. package/dist/execution/batch-step.js +28 -0
  46. package/dist/execution/batch-step.js.map +1 -0
  47. package/dist/execution/completion.js.map +1 -1
  48. package/dist/execution/execution-query.service.d.ts +7 -0
  49. package/dist/execution/execution-query.service.js +17 -0
  50. package/dist/execution/execution-query.service.js.map +1 -0
  51. package/dist/execution/execution-start-handler.d.ts +3 -1
  52. package/dist/execution/execution-start-handler.js +10 -1
  53. package/dist/execution/execution-start-handler.js.map +1 -1
  54. package/dist/execution/execution-store.d.ts +2 -3
  55. package/dist/execution/execution-store.js.map +1 -1
  56. package/dist/execution/execution-view-store.d.ts +26 -0
  57. package/dist/execution/execution-view-store.js +3 -0
  58. package/dist/execution/execution-view-store.js.map +1 -0
  59. package/dist/execution/execution.types.d.ts +6 -0
  60. package/dist/execution/execution.types.js.map +1 -1
  61. package/dist/execution/index.d.ts +4 -2
  62. package/dist/execution/index.js +3 -1
  63. package/dist/execution/index.js.map +1 -1
  64. package/dist/execution/loop-ledger.d.ts +2 -2
  65. package/dist/execution/loop-ledger.js +4 -3
  66. package/dist/execution/loop-ledger.js.map +1 -1
  67. package/dist/execution/settlement.js.map +1 -1
  68. package/dist/execution/start-execution.service.d.ts +1 -0
  69. package/dist/execution/start-execution.service.js +5 -3
  70. package/dist/execution/start-execution.service.js.map +1 -1
  71. package/dist/execution/step-ready-handler.d.ts +4 -1
  72. package/dist/execution/step-ready-handler.js +37 -3
  73. package/dist/execution/step-ready-handler.js.map +1 -1
  74. package/dist/execution/step-settled-handler.d.ts +3 -1
  75. package/dist/execution/step-settled-handler.js +25 -7
  76. package/dist/execution/step-settled-handler.js.map +1 -1
  77. package/dist/execution/step-store.d.ts +2 -9
  78. package/dist/execution/step-store.js.map +1 -1
  79. package/dist/execution/store-loop-reader.d.ts +4 -0
  80. package/dist/execution/store-loop-reader.js +48 -0
  81. package/dist/execution/store-loop-reader.js.map +1 -0
  82. package/dist/graph/index.d.ts +2 -1
  83. package/dist/graph/index.js +3 -1
  84. package/dist/graph/index.js.map +1 -1
  85. package/dist/graph/loops.d.ts +1 -1
  86. package/dist/graph/loops.js +11 -0
  87. package/dist/graph/loops.js.map +1 -1
  88. package/dist/graph/validate-executable-graph.js +4 -3
  89. package/dist/graph/validate-executable-graph.js.map +1 -1
  90. package/dist/graph/workflow-graph.d.ts +4 -0
  91. package/dist/graph/workflow-graph.js +7 -0
  92. package/dist/graph/workflow-graph.js.map +1 -1
  93. package/dist/index.d.ts +9 -5
  94. package/dist/index.js +13 -1
  95. package/dist/index.js.map +1 -1
  96. package/dist/lifecycle-events/batching-lifecycle-event-publisher.d.ts +26 -0
  97. package/dist/lifecycle-events/batching-lifecycle-event-publisher.js +121 -0
  98. package/dist/lifecycle-events/batching-lifecycle-event-publisher.js.map +1 -0
  99. package/dist/lifecycle-events/index.d.ts +6 -0
  100. package/dist/lifecycle-events/index.js +15 -0
  101. package/dist/lifecycle-events/index.js.map +1 -0
  102. package/dist/lifecycle-events/lifecycle-event-publisher.d.ts +6 -0
  103. package/dist/lifecycle-events/lifecycle-event-publisher.js +8 -0
  104. package/dist/lifecycle-events/lifecycle-event-publisher.js.map +1 -0
  105. package/dist/lifecycle-events/lifecycle-event.schema.d.ts +339 -0
  106. package/dist/lifecycle-events/lifecycle-event.schema.js +39 -0
  107. package/dist/lifecycle-events/lifecycle-event.schema.js.map +1 -0
  108. package/dist/lifecycle-events/lifecycle-event.types.d.ts +4 -0
  109. package/dist/lifecycle-events/lifecycle-event.types.js +3 -0
  110. package/dist/lifecycle-events/lifecycle-event.types.js.map +1 -0
  111. package/dist/logging/console-logger.d.ts +2 -0
  112. package/dist/logging/console-logger.js +18 -0
  113. package/dist/logging/console-logger.js.map +1 -0
  114. package/dist/logging/index.d.ts +2 -0
  115. package/dist/logging/index.js +6 -0
  116. package/dist/logging/index.js.map +1 -0
  117. package/dist/logging/logger.types.d.ts +6 -0
  118. package/dist/logging/logger.types.js +3 -0
  119. package/dist/logging/logger.types.js.map +1 -0
  120. package/dist/queue/in-memory-work-queue.d.ts +3 -0
  121. package/dist/queue/in-memory-work-queue.js +7 -2
  122. package/dist/queue/in-memory-work-queue.js.map +1 -1
  123. package/dist/runtime/create-engine-runtime.d.ts +3 -1
  124. package/dist/runtime/create-engine-runtime.js +19 -7
  125. package/dist/runtime/create-engine-runtime.js.map +1 -1
  126. package/dist/serve.js +7 -4
  127. package/dist/serve.js.map +1 -1
  128. package/dist/server/api.types.d.ts +25 -0
  129. package/dist/server/api.types.js +3 -0
  130. package/dist/server/api.types.js.map +1 -0
  131. package/dist/server/create-engine-server.d.ts +9 -1
  132. package/dist/server/create-engine-server.js +3 -3
  133. package/dist/server/create-engine-server.js.map +1 -1
  134. package/dist/server/index.d.ts +2 -0
  135. package/dist/server/index.js.map +1 -1
  136. package/dist/server/routes/workflow-executions.d.ts +2 -2
  137. package/dist/server/routes/workflow-executions.handlers.d.ts +4 -0
  138. package/dist/server/routes/workflow-executions.handlers.js +68 -0
  139. package/dist/server/routes/workflow-executions.handlers.js.map +1 -0
  140. package/dist/server/routes/workflow-executions.js +10 -13
  141. package/dist/server/routes/workflow-executions.js.map +1 -1
  142. package/dist/testing/start-engine-server.d.ts +2 -3
  143. package/dist/testing/start-engine-server.js +2 -2
  144. package/dist/testing/start-engine-server.js.map +1 -1
  145. package/package.json +7 -6
@@ -4,6 +4,7 @@ exports.MAX_SLOT_INDEX = void 0;
4
4
  exports.validateExecutableGraph = validateExecutableGraph;
5
5
  const common_1 = require("../common");
6
6
  const graph_validation_error_1 = require("./graph-validation.error");
7
+ const loops_1 = require("./loops");
7
8
  const workflow_graph_queries_1 = require("./workflow-graph-queries");
8
9
  exports.MAX_SLOT_INDEX = 100;
9
10
  function validateExecutableGraph(graph) {
@@ -14,9 +15,7 @@ function validateExecutableGraph(graph) {
14
15
  if (triggers.length > 1) {
15
16
  throw new graph_validation_error_1.GraphValidationError('Graph must have exactly one trigger node');
16
17
  }
17
- if (graph.edges.some((edge) => edge.isBackEdge)) {
18
- throw new common_1.UnimplementedError('Graphs with back-edges (loops) are not supported yet');
19
- }
18
+ (0, loops_1.validateLoops)(graph);
20
19
  const [trigger] = triggers;
21
20
  const reachable = new Set([trigger.id, ...(0, workflow_graph_queries_1.getDescendantNodeIds)(graph, trigger.id)]);
22
21
  for (const edge of graph.edges) {
@@ -36,6 +35,8 @@ function validateExecutableGraph(graph) {
36
35
  }
37
36
  const seenInputSlots = new Set();
38
37
  for (const edge of graph.edges) {
38
+ if (edge.isBackEdge)
39
+ continue;
39
40
  const slot = `${edge.to}#${edge.inputIndex}`;
40
41
  if (seenInputSlots.has(slot)) {
41
42
  throw new common_1.UnimplementedError(`Node ${edge.to} has more than one edge into input slot ${edge.inputIndex}; converging branches on one slot is not supported yet`);
@@ -1 +1 @@
1
- {"version":3,"file":"validate-executable-graph.js","sourceRoot":"","sources":["../../src/graph/validate-executable-graph.ts"],"names":[],"mappings":";;;;AAAA,sCAA+C;AAC/C,qEAAgE;AAEhE,qEAAgE;AAEnD,QAAA,cAAc,GAAG,GAAG,CAAC;AAUlC,iCAAwC,KAAoB;IAC3D,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;IACvE,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,6CAAoB,CAAC,yCAAyC,CAAC,CAAC;IAC3E,CAAC;IACD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,6CAAo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I,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QAChC,IAAI,IAAI,CAAC,UAAU;YAAE,SAAS;QAC9B,MAAM,IAAI,GAAG,GAAG,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;QAC7C,IAAI,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9B,MAAM,IAAI,2BAAkB,CAC3B,QAAQ,IAAI,CAAC,EAAE,2CAA2C,IAAI,CAAC,UAAU,wDAAwD,CACjI,CAAC;QACH,CAAC;QACD,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;AACF,CAAC"}
@@ -1,5 +1,9 @@
1
1
  export type StepType = 'trigger' | 'v1-node' | 'wait' | 'subworkflow' | 'batch';
2
2
  export type StepConfig = unknown;
3
+ export interface BatchStepConfig {
4
+ batchSize: number;
5
+ }
6
+ export declare function isBatchStepConfig(config: unknown): config is BatchStepConfig;
3
7
  export interface GraphNode {
4
8
  id: string;
5
9
  name: string;
@@ -1,3 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isBatchStepConfig = isBatchStepConfig;
4
+ function isBatchStepConfig(config) {
5
+ if (typeof config !== 'object' || config === null)
6
+ return false;
7
+ const { batchSize } = config;
8
+ return typeof batchSize === 'number' && Number.isInteger(batchSize) && batchSize >= 1;
9
+ }
3
10
  //# sourceMappingURL=workflow-graph.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-graph.js","sourceRoot":"","sources":["../../src/graph/workflow-graph.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"workflow-graph.js","sourceRoot":"","sources":["../../src/graph/workflow-graph.ts"],"names":[],"mappings":";;;AA0BA,2BAAkC,MAAe;IAChD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAChE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAiC,CAAC;IACxD,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,SAAS,IAAI,CAAC,CAAC;AACvF,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,15 +1,19 @@
1
1
  export { createEngineRuntime } from './runtime';
2
2
  export type { EngineRuntime, EngineRuntimeOptions } from './runtime';
3
- export { InvalidIdentityTokenError, mintIdentityToken, SharedSecretIdentityVerifier, } from './auth';
4
- export type { AuthenticatedCaller, IdentityVerifier } from './auth';
5
- export type { EngineErrorResponse } from './server';
3
+ export type { EngineLogger } from './logging';
4
+ export { ACTION_TOKEN, IDENTITY_TOKEN, InvalidActionTokenError, InvalidIdentityTokenError, mintActionToken, mintIdentityToken, SharedSecretIdentityVerifier, verifyActionToken, } from './auth';
5
+ export type { AuthenticatedCaller, ActionScope, IdentityVerifier } from './auth';
6
+ export type { EngineErrorResponse, ExecutionSnapshot, ExecutionStepsResponse, StepDetail, } from './server';
7
+ export { MAX_LIFECYCLE_EVENTS_PER_BATCH, lifecycleEventBatchSchema, lifecycleEventSchema, } from './lifecycle-events';
8
+ export type { LifecycleEventCallback, LifecycleEvent, LifecycleEventBatch, } from './lifecycle-events';
6
9
  export type { JsonObject, JsonValue } from './common';
7
- export type { GraphEdge, GraphNode, StepConfig, StepType, WorkflowGraph, } from './graph';
10
+ export { deriveLoops, isBatchStepConfig } from './graph';
11
+ export type { BatchStepConfig, GraphEdge, GraphNode, StepConfig, StepType, WorkflowGraph, WorkflowLoop, } from './graph';
8
12
  export type { ExternalDependencies, IStepExecutor, StepExecutionContext, StepExecutionRequest, StepExecutionResult, } from './dependencies';
9
13
  export { AllowAllAdmittance, AdmittanceRejectedError } from './admittance';
10
14
  export type { AdmittanceDecision, AdmittanceRequest, AdmittanceService, } from './admittance';
11
15
  export type { ExecutionEnqueuedEvent, OrchestrationMessage, StepSettledEvent, StepMessage, StepReadyEvent, WorkQueue, } from './queue';
12
16
  export { ExecutionNotFoundError, StepNotFoundError } from './execution';
13
- export type { ExecutionMode, ExecutionRecord, ExecutionStatus, ExecutionStore, NewExecutionRecord, NewStepRecord, StartExecutionRequest, StartExecutionResult, StepError, StepKey, StepKeyId, StepRecord, StepSlots, StepStatus, StepStore, TriggerOutputs, } from './execution';
17
+ export type { ExecutionMode, ExecutionViewStore, ExecutionRecord, ExecutionStatus, ExecutionStore, ExecutionView, NewExecutionRecord, NewStepRecord, StartExecutionRequest, StartExecutionResult, StepError, StepKey, StepKeyId, StepRecord, StepSlots, StepStatus, StepStore, StepView, TriggerOutputs, } from './execution';
14
18
  export { createDataSource, WorkflowExecution, WorkflowStepExecution } from './database';
15
19
  export type { EngineStores } from './database';
package/dist/index.js CHANGED
@@ -1,12 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WorkflowStepExecution = exports.WorkflowExecution = exports.createDataSource = exports.StepNotFoundError = exports.ExecutionNotFoundError = exports.AdmittanceRejectedError = exports.AllowAllAdmittance = exports.SharedSecretIdentityVerifier = exports.mintIdentityToken = exports.InvalidIdentityTokenError = exports.createEngineRuntime = void 0;
3
+ exports.WorkflowStepExecution = exports.WorkflowExecution = exports.createDataSource = exports.StepNotFoundError = exports.ExecutionNotFoundError = exports.AdmittanceRejectedError = exports.AllowAllAdmittance = exports.isBatchStepConfig = exports.deriveLoops = exports.lifecycleEventSchema = exports.lifecycleEventBatchSchema = exports.MAX_LIFECYCLE_EVENTS_PER_BATCH = exports.verifyActionToken = exports.SharedSecretIdentityVerifier = exports.mintIdentityToken = exports.mintActionToken = exports.InvalidIdentityTokenError = exports.InvalidActionTokenError = exports.IDENTITY_TOKEN = exports.ACTION_TOKEN = exports.createEngineRuntime = void 0;
4
4
  var runtime_1 = require("./runtime");
5
5
  Object.defineProperty(exports, "createEngineRuntime", { enumerable: true, get: function () { return runtime_1.createEngineRuntime; } });
6
6
  var auth_1 = require("./auth");
7
+ Object.defineProperty(exports, "ACTION_TOKEN", { enumerable: true, get: function () { return auth_1.ACTION_TOKEN; } });
8
+ Object.defineProperty(exports, "IDENTITY_TOKEN", { enumerable: true, get: function () { return auth_1.IDENTITY_TOKEN; } });
9
+ Object.defineProperty(exports, "InvalidActionTokenError", { enumerable: true, get: function () { return auth_1.InvalidActionTokenError; } });
7
10
  Object.defineProperty(exports, "InvalidIdentityTokenError", { enumerable: true, get: function () { return auth_1.InvalidIdentityTokenError; } });
11
+ Object.defineProperty(exports, "mintActionToken", { enumerable: true, get: function () { return auth_1.mintActionToken; } });
8
12
  Object.defineProperty(exports, "mintIdentityToken", { enumerable: true, get: function () { return auth_1.mintIdentityToken; } });
9
13
  Object.defineProperty(exports, "SharedSecretIdentityVerifier", { enumerable: true, get: function () { return auth_1.SharedSecretIdentityVerifier; } });
14
+ Object.defineProperty(exports, "verifyActionToken", { enumerable: true, get: function () { return auth_1.verifyActionToken; } });
15
+ var lifecycle_events_1 = require("./lifecycle-events");
16
+ Object.defineProperty(exports, "MAX_LIFECYCLE_EVENTS_PER_BATCH", { enumerable: true, get: function () { return lifecycle_events_1.MAX_LIFECYCLE_EVENTS_PER_BATCH; } });
17
+ Object.defineProperty(exports, "lifecycleEventBatchSchema", { enumerable: true, get: function () { return lifecycle_events_1.lifecycleEventBatchSchema; } });
18
+ Object.defineProperty(exports, "lifecycleEventSchema", { enumerable: true, get: function () { return lifecycle_events_1.lifecycleEventSchema; } });
19
+ var graph_1 = require("./graph");
20
+ Object.defineProperty(exports, "deriveLoops", { enumerable: true, get: function () { return graph_1.deriveLoops; } });
21
+ Object.defineProperty(exports, "isBatchStepConfig", { enumerable: true, get: function () { return graph_1.isBatchStepConfig; } });
10
22
  var admittance_1 = require("./admittance");
11
23
  Object.defineProperty(exports, "AllowAllAdmittance", { enumerable: true, get: function () { return admittance_1.AllowAllAdmittance; } });
12
24
  Object.defineProperty(exports, "AdmittanceRejectedError", { enumerable: true, get: function () { return admittance_1.AdmittanceRejectedError; } });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAAgD;AAAvC,8GAAA,mBAAmB,OAAA;AAG5B,+BAIgB;AAHf,iHAAA,yBAAyB,OAAA;AACzB,yGAAA,iBAAiB,OAAA;AACjB,oHAAA,4BAA4B,OAAA;AAwB7B,2CAA2E;AAAlE,gHAAA,kBAAkB,OAAA;AAAE,qHAAA,uBAAuB,OAAA;AAgBpD,yCAAwE;AAA/D,mHAAA,sBAAsB,OAAA;AAAE,8GAAA,iBAAiB,OAAA;AAoBlD,uCAAwF;AAA/E,4GAAA,gBAAgB,OAAA;AAAE,6GAAA,iBAAiB,OAAA;AAAE,iHAAA,qBAAqB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAAgD;AAAvC,8GAAA,mBAAmB,OAAA;AAK5B,+BASgB;AARf,oGAAA,YAAY,OAAA;AACZ,sGAAA,cAAc,OAAA;AACd,+GAAA,uBAAuB,OAAA;AACvB,iHAAA,yBAAyB,OAAA;AACzB,uGAAA,eAAe,OAAA;AACf,yGAAA,iBAAiB,OAAA;AACjB,oHAAA,4BAA4B,OAAA;AAC5B,yGAAA,iBAAiB,OAAA;AAYlB,uDAI4B;AAH3B,kIAAA,8BAA8B,OAAA;AAC9B,6HAAA,yBAAyB,OAAA;AACzB,wHAAA,oBAAoB,OAAA;AAUrB,iCAAyD;AAAhD,oGAAA,WAAW,OAAA;AAAE,0GAAA,iBAAiB,OAAA;AAmBvC,2CAA2E;AAAlE,gHAAA,kBAAkB,OAAA;AAAE,qHAAA,uBAAuB,OAAA;AAgBpD,yCAAwE;AAA/D,mHAAA,sBAAsB,OAAA;AAAE,8GAAA,iBAAiB,OAAA;AAuBlD,uCAAwF;AAA/E,4GAAA,gBAAgB,OAAA;AAAE,6GAAA,iBAAiB,OAAA;AAAE,iHAAA,qBAAqB,OAAA"}
@@ -0,0 +1,26 @@
1
+ import type { LifecycleEventPublisher } from './lifecycle-event-publisher';
2
+ import type { LifecycleEventCallback, LifecycleEvent } from './lifecycle-event.types';
3
+ export declare const DEFAULT_LIFECYCLE_EVENT_FLUSH_INTERVAL_MS = 50;
4
+ export declare const DEFAULT_LIFECYCLE_EVENT_SEND_TIMEOUT_MS = 10000;
5
+ export declare const DEFAULT_MAX_PENDING_EVENTS: number;
6
+ export declare class BatchingLifecycleEventPublisher implements LifecycleEventPublisher {
7
+ private readonly send;
8
+ private readonly flushIntervalMs;
9
+ private readonly batchSize;
10
+ private readonly maxPending;
11
+ private readonly sendTimeoutMs;
12
+ private readonly pending;
13
+ private flushTimer;
14
+ private draining;
15
+ private stopped;
16
+ private abandoned;
17
+ private dropped;
18
+ constructor(send: LifecycleEventCallback, flushIntervalMs?: number, batchSize?: number, maxPending?: number, sendTimeoutMs?: number);
19
+ publish(event: LifecycleEvent): void;
20
+ stop(): Promise<void>;
21
+ private startDraining;
22
+ private drain;
23
+ private reportDropped;
24
+ private arm;
25
+ private disarm;
26
+ }
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BatchingLifecycleEventPublisher = exports.DEFAULT_MAX_PENDING_EVENTS = exports.DEFAULT_LIFECYCLE_EVENT_SEND_TIMEOUT_MS = exports.DEFAULT_LIFECYCLE_EVENT_FLUSH_INTERVAL_MS = void 0;
4
+ const lifecycle_event_schema_1 = require("./lifecycle-event.schema");
5
+ exports.DEFAULT_LIFECYCLE_EVENT_FLUSH_INTERVAL_MS = 50;
6
+ exports.DEFAULT_LIFECYCLE_EVENT_SEND_TIMEOUT_MS = 10_000;
7
+ exports.DEFAULT_MAX_PENDING_EVENTS = 20 * lifecycle_event_schema_1.MAX_LIFECYCLE_EVENTS_PER_BATCH;
8
+ class BatchingLifecycleEventPublisher {
9
+ send;
10
+ flushIntervalMs;
11
+ batchSize;
12
+ maxPending;
13
+ sendTimeoutMs;
14
+ pending = [];
15
+ flushTimer;
16
+ draining;
17
+ stopped = false;
18
+ abandoned = false;
19
+ dropped = 0;
20
+ constructor(send, flushIntervalMs = exports.DEFAULT_LIFECYCLE_EVENT_FLUSH_INTERVAL_MS, batchSize = lifecycle_event_schema_1.MAX_LIFECYCLE_EVENTS_PER_BATCH, maxPending = exports.DEFAULT_MAX_PENDING_EVENTS, sendTimeoutMs = exports.DEFAULT_LIFECYCLE_EVENT_SEND_TIMEOUT_MS) {
21
+ this.send = send;
22
+ this.flushIntervalMs = flushIntervalMs;
23
+ this.batchSize = batchSize;
24
+ this.maxPending = maxPending;
25
+ this.sendTimeoutMs = sendTimeoutMs;
26
+ }
27
+ publish(event) {
28
+ if (this.stopped)
29
+ return;
30
+ if (this.pending.length >= this.maxPending) {
31
+ this.dropped++;
32
+ return;
33
+ }
34
+ this.pending.push(event);
35
+ if (this.pending.length >= this.batchSize)
36
+ this.startDraining();
37
+ else
38
+ this.arm();
39
+ }
40
+ async stop() {
41
+ this.stopped = true;
42
+ this.startDraining();
43
+ try {
44
+ await withDeadline('lifecycle event drain', this.sendTimeoutMs, async () => {
45
+ await this.draining;
46
+ });
47
+ }
48
+ catch {
49
+ this.abandoned = true;
50
+ }
51
+ this.reportDropped();
52
+ }
53
+ startDraining() {
54
+ this.disarm();
55
+ if (this.draining)
56
+ return;
57
+ this.draining = this.drain().finally(() => {
58
+ this.draining = undefined;
59
+ });
60
+ }
61
+ async drain() {
62
+ await Promise.resolve();
63
+ while (this.pending.length > 0 && !this.abandoned) {
64
+ const batch = this.pending.splice(0, this.batchSize);
65
+ this.reportDropped();
66
+ try {
67
+ await withDeadline('lifecycle event callback', this.sendTimeoutMs, async (signal) => await this.send(batch, signal));
68
+ }
69
+ catch (error) {
70
+ console.warn(`engine: lifecycle event callback failed, dropped ${batch.length} event(s)`, error);
71
+ }
72
+ }
73
+ if (this.pending.length > 0) {
74
+ console.warn(`engine: lifecycle event publisher stopped, dropped ${this.pending.length} unsent event(s)`);
75
+ this.pending.length = 0;
76
+ }
77
+ }
78
+ reportDropped() {
79
+ if (this.dropped === 0)
80
+ return;
81
+ console.warn(`engine: lifecycle event backlog full, dropped ${this.dropped} event(s)`);
82
+ this.dropped = 0;
83
+ }
84
+ arm() {
85
+ if (this.flushTimer)
86
+ return;
87
+ this.flushTimer = setTimeout(() => {
88
+ this.flushTimer = undefined;
89
+ this.startDraining();
90
+ }, this.flushIntervalMs);
91
+ this.flushTimer.unref();
92
+ }
93
+ disarm() {
94
+ if (!this.flushTimer)
95
+ return;
96
+ clearTimeout(this.flushTimer);
97
+ this.flushTimer = undefined;
98
+ }
99
+ }
100
+ exports.BatchingLifecycleEventPublisher = BatchingLifecycleEventPublisher;
101
+ async function withDeadline(what, ms, work) {
102
+ const overdue = new AbortController();
103
+ let timer;
104
+ try {
105
+ return await Promise.race([
106
+ work(overdue.signal),
107
+ new Promise((_, reject) => {
108
+ timer = setTimeout(() => {
109
+ const error = new Error(`${what} did not settle within ${ms}ms`);
110
+ overdue.abort(error);
111
+ reject(error);
112
+ }, ms);
113
+ timer.unref();
114
+ }),
115
+ ]);
116
+ }
117
+ finally {
118
+ clearTimeout(timer);
119
+ }
120
+ }
121
+ //# sourceMappingURL=batching-lifecycle-event-publisher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batching-lifecycle-event-publisher.js","sourceRoot":"","sources":["../../src/lifecycle-events/batching-lifecycle-event-publisher.ts"],"names":[],"mappings":";;;AACA,qEAA0E;AAI7D,QAAA,yCAAyC,GAAG,EAAE,CAAC;AAG/C,QAAA,uCAAuC,GAAG,MAAM,CAAC;AAGjD,QAAA,0BAA0B,GAAG,EAAE,GAAG,uDAA8B,CAAC;AAW9E;IAkBmB,IAAI;IACJ,eAAe;IACf,SAAS;IACT,UAAU;IACV,aAAa;IApBd,OAAO,GAAqB,EAAE,CAAC;IAExC,UAAU,CAA6B;IAGvC,QAAQ,CAA4B;IAEpC,OAAO,GAAG,KAAK,CAAC;IAGhB,SAAS,GAAG,KAAK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FAULT_LIFECYCLE_EVENT_SEND_TIMEOUT_MS, } from './batching-lifecycle-event-publisher';
2
+ export { noopLifecycleEventPublisher } from './lifecycle-event-publisher';
3
+ export type { LifecycleEventPublisher } from './lifecycle-event-publisher';
4
+ export { MAX_LIFECYCLE_EVENTS_PER_BATCH, lifecycleEventBatchSchema, lifecycleEventSchema, } from './lifecycle-event.schema';
5
+ export type { LifecycleEventBatch } from './lifecycle-event.schema';
6
+ export type { LifecycleEventCallback, LifecycleEvent } from './lifecycle-event.types';
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.lifecycleEventSchema = exports.lifecycleEventBatchSchema = exports.MAX_LIFECYCLE_EVENTS_PER_BATCH = exports.noopLifecycleEventPublisher = exports.DEFAULT_LIFECYCLE_EVENT_SEND_TIMEOUT_MS = exports.DEFAULT_LIFECYCLE_EVENT_FLUSH_INTERVAL_MS = exports.DEFAULT_MAX_PENDING_EVENTS = exports.BatchingLifecycleEventPublisher = void 0;
4
+ var batching_lifecycle_event_publisher_1 = require("./batching-lifecycle-event-publisher");
5
+ Object.defineProperty(exports, "BatchingLifecycleEventPublisher", { enumerable: true, get: function () { return batching_lifecycle_event_publisher_1.BatchingLifecycleEventPublisher; } });
6
+ Object.defineProperty(exports, "DEFAULT_MAX_PENDING_EVENTS", { enumerable: true, get: function () { return batching_lifecycle_event_publisher_1.DEFAULT_MAX_PENDING_EVENTS; } });
7
+ Object.defineProperty(exports, "DEFAULT_LIFECYCLE_EVENT_FLUSH_INTERVAL_MS", { enumerable: true, get: function () { return batching_lifecycle_event_publisher_1.DEFAULT_LIFECYCLE_EVENT_FLUSH_INTERVAL_MS; } });
8
+ Object.defineProperty(exports, "DEFAULT_LIFECYCLE_EVENT_SEND_TIMEOUT_MS", { enumerable: true, get: function () { return batching_lifecycle_event_publisher_1.DEFAULT_LIFECYCLE_EVENT_SEND_TIMEOUT_MS; } });
9
+ var lifecycle_event_publisher_1 = require("./lifecycle-event-publisher");
10
+ Object.defineProperty(exports, "noopLifecycleEventPublisher", { enumerable: true, get: function () { return lifecycle_event_publisher_1.noopLifecycleEventPublisher; } });
11
+ var lifecycle_event_schema_1 = require("./lifecycle-event.schema");
12
+ Object.defineProperty(exports, "MAX_LIFECYCLE_EVENTS_PER_BATCH", { enumerable: true, get: function () { return lifecycle_event_schema_1.MAX_LIFECYCLE_EVENTS_PER_BATCH; } });
13
+ Object.defineProperty(exports, "lifecycleEventBatchSchema", { enumerable: true, get: function () { return lifecycle_event_schema_1.lifecycleEventBatchSchema; } });
14
+ Object.defineProperty(exports, "lifecycleEventSchema", { enumerable: true, get: function () { return lifecycle_event_schema_1.lifecycleEventSchema; } });
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lifecycle-events/index.ts"],"names":[],"mappings":";;;AAAA,2FAK8C;AAJ7C,qJAAA,+BAA+B,OAAA;AAC/B,gJAAA,0BAA0B,OAAA;AAC1B,+JAAA,yCAAyC,OAAA;AACzC,6JAAA,uCAAuC,OAAA;AAExC,yEAA0E;AAAjE,wIAAA,2BAA2B,OAAA;AAEpC,mEAIkC;AAHjC,wIAAA,8BAA8B,OAAA;AAC9B,mIAAA,yBAAyB,OAAA;AACzB,8HAAA,oBAAoB,OAAA"}
@@ -0,0 +1,6 @@
1
+ import type { LifecycleEvent } from './lifecycle-event.types';
2
+ export interface LifecycleEventPublisher {
3
+ publish(event: LifecycleEvent): void;
4
+ stop(): Promise<void>;
5
+ }
6
+ export declare const noopLifecycleEventPublisher: LifecycleEventPublisher;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.noopLifecycleEventPublisher = void 0;
4
+ exports.noopLifecycleEventPublisher = Object.freeze({
5
+ publish: () => { },
6
+ stop: async () => { },
7
+ });
8
+ //# sourceMappingURL=lifecycle-event-publisher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle-event-publisher.js","sourceRoot":"","sources":["../../src/lifecycle-events/lifecycle-event-publisher.ts"],"names":[],"mappings":";;;AAWa,QAAA,2BAA2B,GAA4B,MAAM,CAAC,MAAM,CAAC;IACjF,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;IACjB,IAAI,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;CACpB,CAAC,CAAC"}