arvo-event-handler 3.0.7 → 3.0.10
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/dist/ArvoEventHandler/index.d.ts +3 -4
- package/dist/ArvoEventHandler/index.js +53 -71
- package/dist/ArvoEventHandler/types.d.ts +3 -2
- package/dist/ArvoMachine/createMachine.d.ts +1 -1
- package/dist/ArvoMachine/createMachine.js +1 -1
- package/dist/ArvoOrchestrationUtils/createEmitableEvent.d.ts +30 -0
- package/dist/ArvoOrchestrationUtils/createEmitableEvent.js +160 -0
- package/dist/ArvoOrchestrationUtils/error.d.ts +18 -0
- package/dist/{ArvoOrchestrator → ArvoOrchestrationUtils}/error.js +14 -9
- package/dist/ArvoOrchestrationUtils/handlerErrors.d.ts +36 -0
- package/dist/ArvoOrchestrationUtils/handlerErrors.js +183 -0
- package/dist/ArvoOrchestrationUtils/orchestrationExecutionState.d.ts +11 -0
- package/dist/ArvoOrchestrationUtils/orchestrationExecutionState.js +7 -0
- package/dist/ArvoOrchestrationUtils/orchestrationExecutionWrapper/acquireLockWithValidation.d.ts +8 -0
- package/dist/ArvoOrchestrationUtils/orchestrationExecutionWrapper/acquireLockWithValidation.js +69 -0
- package/dist/ArvoOrchestrationUtils/orchestrationExecutionWrapper/index.d.ts +42 -0
- package/dist/ArvoOrchestrationUtils/orchestrationExecutionWrapper/index.js +221 -0
- package/dist/ArvoOrchestrationUtils/orchestrationExecutionWrapper/validateAndParseSubject.d.ts +7 -0
- package/dist/ArvoOrchestrationUtils/orchestrationExecutionWrapper/validateAndParseSubject.js +25 -0
- package/dist/ArvoOrchestrationUtils/servicesValidation.d.ts +22 -0
- package/dist/ArvoOrchestrationUtils/servicesValidation.js +56 -0
- package/dist/ArvoOrchestrationUtils/types.d.ts +7 -0
- package/dist/ArvoOrchestrationUtils/types.js +9 -0
- package/dist/ArvoOrchestrator/factory.d.ts +2 -2
- package/dist/ArvoOrchestrator/factory.js +15 -1
- package/dist/ArvoOrchestrator/index.d.ts +5 -20
- package/dist/ArvoOrchestrator/index.js +94 -471
- package/dist/ArvoOrchestrator/types.d.ts +19 -21
- package/dist/ArvoResumable/factory.d.ts +4 -2
- package/dist/ArvoResumable/factory.js +6 -25
- package/dist/ArvoResumable/index.d.ts +9 -21
- package/dist/ArvoResumable/index.js +82 -422
- package/dist/ArvoResumable/types.d.ts +5 -4
- package/dist/IArvoEventHandler/index.d.ts +1 -2
- package/dist/MachineExecutionEngine/index.d.ts +1 -1
- package/dist/MachineRegistry/index.d.ts +1 -1
- package/dist/SyncEventResource/index.d.ts +1 -1
- package/dist/SyncEventResource/index.js +1 -1
- package/dist/index.d.ts +12 -11
- package/dist/index.js +24 -21
- package/dist/types.d.ts +8 -0
- package/package.json +2 -2
- package/dist/ArvoOrchestrator/error.d.ts +0 -16
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { VersionedArvoContract, ArvoSemanticVersion, InferVersionedArvoContract, ArvoContract, ArvoEvent, InferArvoEvent, CreateArvoEvent } from 'arvo-core';
|
|
2
|
-
import type { EnqueueArvoEventActionParam } from '../ArvoMachine/types';
|
|
3
1
|
import type { Span } from '@opentelemetry/api';
|
|
2
|
+
import type { ArvoContract, ArvoEvent, ArvoSemanticVersion, CreateArvoEvent, InferArvoEvent, InferVersionedArvoContract, VersionedArvoContract } from 'arvo-core';
|
|
3
|
+
import type { EnqueueArvoEventActionParam } from '../ArvoMachine/types';
|
|
4
|
+
import type { OrchestrationExecutionMemoryRecord } from '../ArvoOrchestrationUtils/orchestrationExecutionState';
|
|
4
5
|
type ExtractServiceEventTypes<TServiceContract extends Record<string, VersionedArvoContract<any, any>>> = {
|
|
5
6
|
[K in keyof TServiceContract]: {
|
|
6
7
|
[L in keyof InferVersionedArvoContract<TServiceContract[K]>['emits']]: {
|
|
@@ -88,7 +89,7 @@ type Handler<TState extends ArvoResumableState<Record<string, any>>, TSelfContra
|
|
|
88
89
|
export type ArvoResumableHandler<TState extends ArvoResumableState<Record<string, any>>, TSelfContract extends ArvoContract, TServiceContract extends Record<string, VersionedArvoContract<any, any>>> = {
|
|
89
90
|
[V in ArvoSemanticVersion & keyof TSelfContract['versions']]: Handler<TState, VersionedArvoContract<TSelfContract, V>, TServiceContract>;
|
|
90
91
|
};
|
|
91
|
-
export type ArvoResumableState<T extends Record<string, any>> = {
|
|
92
|
+
export type ArvoResumableState<T extends Record<string, any>> = OrchestrationExecutionMemoryRecord<{
|
|
92
93
|
/**
|
|
93
94
|
* Current execution status of the orchestration workflow
|
|
94
95
|
*
|
|
@@ -149,5 +150,5 @@ export type ArvoResumableState<T extends Record<string, any>> = {
|
|
|
149
150
|
};
|
|
150
151
|
/** The state used by the resumable */
|
|
151
152
|
state$$: T | null;
|
|
152
|
-
}
|
|
153
|
+
}>;
|
|
153
154
|
export {};
|
|
@@ -21,9 +21,8 @@ export default interface IArvoEventHandler {
|
|
|
21
21
|
* @returns A promise that resolves to an array of resulting Arvo events.
|
|
22
22
|
* These events represent the outcome of processing the input event.
|
|
23
23
|
*/
|
|
24
|
-
execute(event: ArvoEvent, opentelemetry
|
|
24
|
+
execute(event: ArvoEvent, opentelemetry?: ArvoEventHandlerOpenTelemetryOptions): Promise<{
|
|
25
25
|
events: ArvoEvent[];
|
|
26
|
-
metadata?: Record<string, any>;
|
|
27
26
|
}>;
|
|
28
27
|
/**
|
|
29
28
|
* Provides the schema for system error events.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { ArvoEventHandlerOpenTelemetryOptions } from '../types';
|
|
1
2
|
import type { IMachineExectionEngine } from './interface';
|
|
2
3
|
import type { ExecuteMachineInput, ExecuteMachineOutput } from './types';
|
|
3
|
-
import type { ArvoEventHandlerOpenTelemetryOptions } from '../types';
|
|
4
4
|
/**
|
|
5
5
|
* Handles state machine execution, event processing, and lifecycle management.
|
|
6
6
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ArvoEvent } from 'arvo-core';
|
|
2
2
|
import type ArvoMachine from '../ArvoMachine';
|
|
3
|
-
import type { IMachineRegistry } from './interface';
|
|
4
3
|
import type { ArvoEventHandlerOpenTelemetryOptions } from '../types';
|
|
4
|
+
import type { IMachineRegistry } from './interface';
|
|
5
5
|
/**
|
|
6
6
|
* Registry for managing and resolving ArvoMachine instances.
|
|
7
7
|
* Provides functionality to store multiple machine instances and resolve them based on events.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { Span } from '@opentelemetry/api';
|
|
1
2
|
import { type ArvoEvent } from 'arvo-core';
|
|
2
3
|
import type { IMachineMemory } from '../MachineMemory/interface';
|
|
3
4
|
import type { AcquiredLockStatusType, ReleasedLockStatusType } from './types';
|
|
4
|
-
import type { Span } from '@opentelemetry/api';
|
|
5
5
|
/**
|
|
6
6
|
* A synchronous event resource that manages machine memory state based on event subjects.
|
|
7
7
|
*
|
|
@@ -38,7 +38,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.SyncEventResource = void 0;
|
|
40
40
|
var arvo_core_1 = require("arvo-core");
|
|
41
|
-
var error_1 = require("../
|
|
41
|
+
var error_1 = require("../ArvoOrchestrationUtils/error");
|
|
42
42
|
var errors_1 = require("../errors");
|
|
43
43
|
/**
|
|
44
44
|
* A synchronous event resource that manages machine memory state based on event subjects.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { assign, emit } from 'xstate';
|
|
2
|
+
import { ArvoDomain, resolveEventDomain } from './ArvoDomain';
|
|
2
3
|
import ArvoEventHandler from './ArvoEventHandler';
|
|
3
4
|
import { createArvoEventHandler } from './ArvoEventHandler/helpers';
|
|
4
5
|
import { ArvoEventHandlerFunction, ArvoEventHandlerFunctionInput, ArvoEventHandlerFunctionOutput } from './ArvoEventHandler/types';
|
|
5
|
-
import { ConfigViolation, ContractViolation, ExecutionViolation } from './errors';
|
|
6
|
-
import { ArvoEventHandlerOpenTelemetryOptions, EventHandlerFactory, PartialExcept } from './types';
|
|
7
|
-
import { coalesce, coalesceOrDefault, getValueOrDefault, isNullOrUndefined } from './utils';
|
|
8
|
-
import { assign, emit } from 'xstate';
|
|
9
6
|
import ArvoMachine from './ArvoMachine';
|
|
10
7
|
import { setupArvoMachine } from './ArvoMachine/createMachine';
|
|
11
8
|
import { ArvoMachineContext, EnqueueArvoEventActionParam } from './ArvoMachine/types';
|
|
9
|
+
import { TransactionViolation, TransactionViolationCause, isTransactionViolationError } from './ArvoOrchestrationUtils/error';
|
|
10
|
+
import { OrchestrationExecutionStatus } from './ArvoOrchestrationUtils/orchestrationExecutionState';
|
|
12
11
|
import { ArvoOrchestrator } from './ArvoOrchestrator';
|
|
13
|
-
import { TransactionViolation, TransactionViolationCause } from './ArvoOrchestrator/error';
|
|
14
12
|
import { createArvoOrchestrator } from './ArvoOrchestrator/factory';
|
|
15
13
|
import { ArvoOrchestratorParam, MachineMemoryRecord } from './ArvoOrchestrator/types';
|
|
14
|
+
import { ArvoResumable } from './ArvoResumable';
|
|
15
|
+
import { createArvoResumable } from './ArvoResumable/factory';
|
|
16
|
+
import { ArvoResumableHandler, ArvoResumableState } from './ArvoResumable/types';
|
|
17
|
+
import IArvoEventHandler from './IArvoEventHandler';
|
|
16
18
|
import { MachineExecutionEngine } from './MachineExecutionEngine';
|
|
17
19
|
import { IMachineExectionEngine } from './MachineExecutionEngine/interface';
|
|
18
20
|
import { ExecuteMachineInput, ExecuteMachineOutput } from './MachineExecutionEngine/types';
|
|
@@ -21,14 +23,13 @@ import { TelemetredSimpleMachineMemory } from './MachineMemory/TelemetredSimple'
|
|
|
21
23
|
import { IMachineMemory } from './MachineMemory/interface';
|
|
22
24
|
import { MachineRegistry } from './MachineRegistry';
|
|
23
25
|
import { IMachineRegistry } from './MachineRegistry/interface';
|
|
26
|
+
import { ConfigViolation, ContractViolation, ExecutionViolation } from './errors';
|
|
27
|
+
import { ArvoEventHandlerOpenTelemetryOptions, ArvoEventHandlerOtelSpanOptions, EventHandlerFactory, PartialExcept } from './types';
|
|
28
|
+
import { coalesce, coalesceOrDefault, getValueOrDefault, isNullOrUndefined } from './utils';
|
|
24
29
|
import { SimpleEventBroker } from './utils/SimpleEventBroker';
|
|
25
30
|
import { createSimpleEventBroker } from './utils/SimpleEventBroker/helper';
|
|
26
|
-
import { ArvoResumable } from './ArvoResumable';
|
|
27
|
-
import { createArvoResumable } from './ArvoResumable/factory';
|
|
28
|
-
import { ArvoResumableHandler, ArvoResumableState } from './ArvoResumable/types';
|
|
29
|
-
import { ArvoDomain, resolveEventDomain } from './ArvoDomain';
|
|
30
31
|
declare const xstate: {
|
|
31
32
|
emit: typeof emit;
|
|
32
33
|
assign: typeof assign;
|
|
33
34
|
};
|
|
34
|
-
export { ArvoEventHandler, createArvoEventHandler, IArvoEventHandler, ArvoEventHandlerFunctionOutput, ArvoEventHandlerFunctionInput, ArvoEventHandlerFunction, PartialExcept, isNullOrUndefined, getValueOrDefault, coalesce, coalesceOrDefault,
|
|
35
|
+
export { ArvoEventHandler, createArvoEventHandler, IArvoEventHandler, ArvoEventHandlerFunctionOutput, ArvoEventHandlerFunctionInput, ArvoEventHandlerFunction, PartialExcept, isNullOrUndefined, getValueOrDefault, coalesce, coalesceOrDefault, ArvoEventHandlerOpenTelemetryOptions, EventHandlerFactory, ContractViolation, ConfigViolation, ExecutionViolation, ArvoMachine, setupArvoMachine, ArvoMachineContext, EnqueueArvoEventActionParam, IMachineRegistry, MachineRegistry, MachineExecutionEngine, IMachineExectionEngine, ExecuteMachineInput, ExecuteMachineOutput, IMachineMemory, SimpleMachineMemory, MachineMemoryRecord, ArvoOrchestratorParam, TransactionViolation, TransactionViolationCause, ArvoOrchestrator, createArvoOrchestrator, SimpleEventBroker, createSimpleEventBroker, TelemetredSimpleMachineMemory, xstate, ArvoResumable, createArvoResumable, ArvoResumableHandler, ArvoResumableState, ArvoDomain, resolveEventDomain, isTransactionViolationError, OrchestrationExecutionStatus, ArvoEventHandlerOtelSpanOptions, };
|
package/dist/index.js
CHANGED
|
@@ -3,32 +3,33 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.resolveEventDomain = exports.ArvoDomain = exports.createArvoResumable = exports.ArvoResumable = exports.xstate = exports.TelemetredSimpleMachineMemory = exports.createSimpleEventBroker = exports.SimpleEventBroker = exports.createArvoOrchestrator = exports.ArvoOrchestrator = exports.TransactionViolationCause = exports.TransactionViolation = exports.SimpleMachineMemory = exports.MachineExecutionEngine = exports.MachineRegistry = exports.setupArvoMachine = exports.ArvoMachine = exports.ExecutionViolation = exports.ConfigViolation = exports.ContractViolation = exports.coalesceOrDefault = exports.coalesce = exports.getValueOrDefault = exports.isNullOrUndefined = exports.createArvoEventHandler = exports.ArvoEventHandler = void 0;
|
|
6
|
+
exports.OrchestrationExecutionStatus = exports.isTransactionViolationError = exports.resolveEventDomain = exports.ArvoDomain = exports.createArvoResumable = exports.ArvoResumable = exports.xstate = exports.TelemetredSimpleMachineMemory = exports.createSimpleEventBroker = exports.SimpleEventBroker = exports.createArvoOrchestrator = exports.ArvoOrchestrator = exports.TransactionViolationCause = exports.TransactionViolation = exports.SimpleMachineMemory = exports.MachineExecutionEngine = exports.MachineRegistry = exports.setupArvoMachine = exports.ArvoMachine = exports.ExecutionViolation = exports.ConfigViolation = exports.ContractViolation = exports.coalesceOrDefault = exports.coalesce = exports.getValueOrDefault = exports.isNullOrUndefined = exports.createArvoEventHandler = exports.ArvoEventHandler = void 0;
|
|
7
|
+
var xstate_1 = require("xstate");
|
|
8
|
+
var ArvoDomain_1 = require("./ArvoDomain");
|
|
9
|
+
Object.defineProperty(exports, "ArvoDomain", { enumerable: true, get: function () { return ArvoDomain_1.ArvoDomain; } });
|
|
10
|
+
Object.defineProperty(exports, "resolveEventDomain", { enumerable: true, get: function () { return ArvoDomain_1.resolveEventDomain; } });
|
|
7
11
|
var ArvoEventHandler_1 = __importDefault(require("./ArvoEventHandler"));
|
|
8
12
|
exports.ArvoEventHandler = ArvoEventHandler_1.default;
|
|
9
13
|
var helpers_1 = require("./ArvoEventHandler/helpers");
|
|
10
14
|
Object.defineProperty(exports, "createArvoEventHandler", { enumerable: true, get: function () { return helpers_1.createArvoEventHandler; } });
|
|
11
|
-
var errors_1 = require("./errors");
|
|
12
|
-
Object.defineProperty(exports, "ConfigViolation", { enumerable: true, get: function () { return errors_1.ConfigViolation; } });
|
|
13
|
-
Object.defineProperty(exports, "ContractViolation", { enumerable: true, get: function () { return errors_1.ContractViolation; } });
|
|
14
|
-
Object.defineProperty(exports, "ExecutionViolation", { enumerable: true, get: function () { return errors_1.ExecutionViolation; } });
|
|
15
|
-
var utils_1 = require("./utils");
|
|
16
|
-
Object.defineProperty(exports, "coalesce", { enumerable: true, get: function () { return utils_1.coalesce; } });
|
|
17
|
-
Object.defineProperty(exports, "coalesceOrDefault", { enumerable: true, get: function () { return utils_1.coalesceOrDefault; } });
|
|
18
|
-
Object.defineProperty(exports, "getValueOrDefault", { enumerable: true, get: function () { return utils_1.getValueOrDefault; } });
|
|
19
|
-
Object.defineProperty(exports, "isNullOrUndefined", { enumerable: true, get: function () { return utils_1.isNullOrUndefined; } });
|
|
20
|
-
var xstate_1 = require("xstate");
|
|
21
15
|
var ArvoMachine_1 = __importDefault(require("./ArvoMachine"));
|
|
22
16
|
exports.ArvoMachine = ArvoMachine_1.default;
|
|
23
17
|
var createMachine_1 = require("./ArvoMachine/createMachine");
|
|
24
18
|
Object.defineProperty(exports, "setupArvoMachine", { enumerable: true, get: function () { return createMachine_1.setupArvoMachine; } });
|
|
25
|
-
var
|
|
26
|
-
Object.defineProperty(exports, "ArvoOrchestrator", { enumerable: true, get: function () { return ArvoOrchestrator_1.ArvoOrchestrator; } });
|
|
27
|
-
var error_1 = require("./ArvoOrchestrator/error");
|
|
19
|
+
var error_1 = require("./ArvoOrchestrationUtils/error");
|
|
28
20
|
Object.defineProperty(exports, "TransactionViolation", { enumerable: true, get: function () { return error_1.TransactionViolation; } });
|
|
29
21
|
Object.defineProperty(exports, "TransactionViolationCause", { enumerable: true, get: function () { return error_1.TransactionViolationCause; } });
|
|
22
|
+
Object.defineProperty(exports, "isTransactionViolationError", { enumerable: true, get: function () { return error_1.isTransactionViolationError; } });
|
|
23
|
+
var orchestrationExecutionState_1 = require("./ArvoOrchestrationUtils/orchestrationExecutionState");
|
|
24
|
+
Object.defineProperty(exports, "OrchestrationExecutionStatus", { enumerable: true, get: function () { return orchestrationExecutionState_1.OrchestrationExecutionStatus; } });
|
|
25
|
+
var ArvoOrchestrator_1 = require("./ArvoOrchestrator");
|
|
26
|
+
Object.defineProperty(exports, "ArvoOrchestrator", { enumerable: true, get: function () { return ArvoOrchestrator_1.ArvoOrchestrator; } });
|
|
30
27
|
var factory_1 = require("./ArvoOrchestrator/factory");
|
|
31
28
|
Object.defineProperty(exports, "createArvoOrchestrator", { enumerable: true, get: function () { return factory_1.createArvoOrchestrator; } });
|
|
29
|
+
var ArvoResumable_1 = require("./ArvoResumable");
|
|
30
|
+
Object.defineProperty(exports, "ArvoResumable", { enumerable: true, get: function () { return ArvoResumable_1.ArvoResumable; } });
|
|
31
|
+
var factory_2 = require("./ArvoResumable/factory");
|
|
32
|
+
Object.defineProperty(exports, "createArvoResumable", { enumerable: true, get: function () { return factory_2.createArvoResumable; } });
|
|
32
33
|
var MachineExecutionEngine_1 = require("./MachineExecutionEngine");
|
|
33
34
|
Object.defineProperty(exports, "MachineExecutionEngine", { enumerable: true, get: function () { return MachineExecutionEngine_1.MachineExecutionEngine; } });
|
|
34
35
|
var Simple_1 = require("./MachineMemory/Simple");
|
|
@@ -37,17 +38,19 @@ var TelemetredSimple_1 = require("./MachineMemory/TelemetredSimple");
|
|
|
37
38
|
Object.defineProperty(exports, "TelemetredSimpleMachineMemory", { enumerable: true, get: function () { return TelemetredSimple_1.TelemetredSimpleMachineMemory; } });
|
|
38
39
|
var MachineRegistry_1 = require("./MachineRegistry");
|
|
39
40
|
Object.defineProperty(exports, "MachineRegistry", { enumerable: true, get: function () { return MachineRegistry_1.MachineRegistry; } });
|
|
41
|
+
var errors_1 = require("./errors");
|
|
42
|
+
Object.defineProperty(exports, "ConfigViolation", { enumerable: true, get: function () { return errors_1.ConfigViolation; } });
|
|
43
|
+
Object.defineProperty(exports, "ContractViolation", { enumerable: true, get: function () { return errors_1.ContractViolation; } });
|
|
44
|
+
Object.defineProperty(exports, "ExecutionViolation", { enumerable: true, get: function () { return errors_1.ExecutionViolation; } });
|
|
45
|
+
var utils_1 = require("./utils");
|
|
46
|
+
Object.defineProperty(exports, "coalesce", { enumerable: true, get: function () { return utils_1.coalesce; } });
|
|
47
|
+
Object.defineProperty(exports, "coalesceOrDefault", { enumerable: true, get: function () { return utils_1.coalesceOrDefault; } });
|
|
48
|
+
Object.defineProperty(exports, "getValueOrDefault", { enumerable: true, get: function () { return utils_1.getValueOrDefault; } });
|
|
49
|
+
Object.defineProperty(exports, "isNullOrUndefined", { enumerable: true, get: function () { return utils_1.isNullOrUndefined; } });
|
|
40
50
|
var SimpleEventBroker_1 = require("./utils/SimpleEventBroker");
|
|
41
51
|
Object.defineProperty(exports, "SimpleEventBroker", { enumerable: true, get: function () { return SimpleEventBroker_1.SimpleEventBroker; } });
|
|
42
52
|
var helper_1 = require("./utils/SimpleEventBroker/helper");
|
|
43
53
|
Object.defineProperty(exports, "createSimpleEventBroker", { enumerable: true, get: function () { return helper_1.createSimpleEventBroker; } });
|
|
44
|
-
var ArvoResumable_1 = require("./ArvoResumable");
|
|
45
|
-
Object.defineProperty(exports, "ArvoResumable", { enumerable: true, get: function () { return ArvoResumable_1.ArvoResumable; } });
|
|
46
|
-
var factory_2 = require("./ArvoResumable/factory");
|
|
47
|
-
Object.defineProperty(exports, "createArvoResumable", { enumerable: true, get: function () { return factory_2.createArvoResumable; } });
|
|
48
|
-
var ArvoDomain_1 = require("./ArvoDomain");
|
|
49
|
-
Object.defineProperty(exports, "ArvoDomain", { enumerable: true, get: function () { return ArvoDomain_1.ArvoDomain; } });
|
|
50
|
-
Object.defineProperty(exports, "resolveEventDomain", { enumerable: true, get: function () { return ArvoDomain_1.resolveEventDomain; } });
|
|
51
54
|
var xstate = {
|
|
52
55
|
emit: xstate_1.emit,
|
|
53
56
|
assign: xstate_1.assign,
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { SpanOptions } from '@opentelemetry/api';
|
|
2
|
+
import type { ArvoEvent } from 'arvo-core';
|
|
1
3
|
import type IArvoEventHandler from './IArvoEventHandler';
|
|
2
4
|
/**
|
|
3
5
|
* Makes properties optional except specified keys
|
|
@@ -30,3 +32,9 @@ export type ArvoEventHandlerOpenTelemetryOptions = {
|
|
|
30
32
|
* @template T - Configuration object type
|
|
31
33
|
*/
|
|
32
34
|
export type EventHandlerFactory<T = void> = T extends void ? () => IArvoEventHandler : (config: T) => IArvoEventHandler;
|
|
35
|
+
export type ArvoEventHandlerOtelSpanOptions = SpanOptions & {
|
|
36
|
+
spanName?: (param: {
|
|
37
|
+
selfContractUri: string;
|
|
38
|
+
consumedEvent: ArvoEvent;
|
|
39
|
+
}) => string;
|
|
40
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arvo-event-handler",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.10",
|
|
4
4
|
"description": "Type-safe event handler system with versioning, telemetry, and contract validation for distributed Arvo event-driven architectures, featuring routing and multi-handler support.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@opentelemetry/api": "^1.9.0",
|
|
48
48
|
"@opentelemetry/core": "^1.30.1",
|
|
49
|
-
"arvo-core": "^3.0.
|
|
49
|
+
"arvo-core": "^3.0.10",
|
|
50
50
|
"uuid": "^11.1.0",
|
|
51
51
|
"xstate": "^5.23.0",
|
|
52
52
|
"zod": "^3.25.74",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type ArvoEvent, ViolationError } from 'arvo-core';
|
|
2
|
-
export declare enum TransactionViolationCause {
|
|
3
|
-
READ_FAILURE = "READ_MACHINE_MEMORY_FAILURE",
|
|
4
|
-
LOCK_FAILURE = "LOCK_MACHINE_MEMORY_FAILURE",
|
|
5
|
-
WRITE_FAILURE = "WRITE_MACHINE_MEMORY_FAILURE",
|
|
6
|
-
LOCK_UNACQUIRED = "LOCK_UNACQUIRED",
|
|
7
|
-
INVALID_SUBJECT = "INVALID_SUBJECT"
|
|
8
|
-
}
|
|
9
|
-
export declare class TransactionViolation extends ViolationError<'OrchestratorTransaction'> {
|
|
10
|
-
readonly cause: TransactionViolationCause;
|
|
11
|
-
constructor(param: {
|
|
12
|
-
cause: TransactionViolationCause;
|
|
13
|
-
message: string;
|
|
14
|
-
initiatingEvent: ArvoEvent;
|
|
15
|
-
});
|
|
16
|
-
}
|