@loopstack/common 0.23.0 → 0.25.0
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/base/base-tool.d.ts +10 -0
- package/dist/base/base-tool.d.ts.map +1 -0
- package/dist/base/base-tool.js +39 -0
- package/dist/base/base-tool.js.map +1 -0
- package/dist/base/base-workflow.d.ts +27 -0
- package/dist/base/base-workflow.d.ts.map +1 -0
- package/dist/base/base-workflow.js +53 -0
- package/dist/base/base-workflow.js.map +1 -0
- package/dist/base/index.d.ts +4 -0
- package/dist/base/index.d.ts.map +1 -0
- package/dist/base/index.js +20 -0
- package/dist/base/index.js.map +1 -0
- package/dist/base/workflow-templates.d.ts +2 -0
- package/dist/base/workflow-templates.d.ts.map +1 -0
- package/dist/{interfaces/state-machine-validator.interface.js → base/workflow-templates.js} +1 -1
- package/dist/base/workflow-templates.js.map +1 -0
- package/dist/decorators/block.decorator.d.ts +52 -48
- package/dist/decorators/block.decorator.d.ts.map +1 -1
- package/dist/decorators/block.decorator.js +66 -86
- package/dist/decorators/block.decorator.js.map +1 -1
- package/dist/decorators/index.d.ts +0 -1
- package/dist/decorators/index.d.ts.map +1 -1
- package/dist/decorators/index.js +0 -1
- package/dist/decorators/index.js.map +1 -1
- package/dist/dtos/run-context.d.ts +4 -5
- package/dist/dtos/run-context.d.ts.map +1 -1
- package/dist/dtos/run-context.js +3 -4
- package/dist/dtos/run-context.js.map +1 -1
- package/dist/entities/document.entity.d.ts +2 -3
- package/dist/entities/document.entity.d.ts.map +1 -1
- package/dist/entities/document.entity.js +8 -14
- package/dist/entities/document.entity.js.map +1 -1
- package/dist/entities/index.d.ts +2 -3
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js +2 -3
- package/dist/entities/index.js.map +1 -1
- package/dist/entities/secret.entity.d.ts +11 -0
- package/dist/entities/secret.entity.d.ts.map +1 -0
- package/dist/entities/secret.entity.js +58 -0
- package/dist/entities/secret.entity.js.map +1 -0
- package/dist/entities/workflow-checkpoint.entity.d.ts +16 -0
- package/dist/entities/workflow-checkpoint.entity.d.ts.map +1 -0
- package/dist/entities/workflow-checkpoint.entity.js +83 -0
- package/dist/entities/workflow-checkpoint.entity.js.map +1 -0
- package/dist/entities/workflow.entity.d.ts +14 -16
- package/dist/entities/workflow.entity.d.ts.map +1 -1
- package/dist/entities/workflow.entity.js +65 -79
- package/dist/entities/workflow.entity.js.map +1 -1
- package/dist/entities/workspace.entity.d.ts +3 -3
- package/dist/entities/workspace.entity.d.ts.map +1 -1
- package/dist/entities/workspace.entity.js +7 -7
- package/dist/entities/workspace.entity.js.map +1 -1
- package/dist/enums/index.d.ts +0 -1
- package/dist/enums/index.d.ts.map +1 -1
- package/dist/enums/index.js +0 -1
- package/dist/enums/index.js.map +1 -1
- package/dist/enums/workflow-state.enum.d.ts +1 -0
- package/dist/enums/workflow-state.enum.d.ts.map +1 -1
- package/dist/enums/workflow-state.enum.js +1 -0
- package/dist/enums/workflow-state.enum.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/block.interface.d.ts +4 -9
- package/dist/interfaces/block.interface.d.ts.map +1 -1
- package/dist/interfaces/document-repository.interface.d.ts +18 -0
- package/dist/interfaces/document-repository.interface.d.ts.map +1 -0
- package/dist/interfaces/{state-machine-validator-result.interface.js → document-repository.interface.js} +1 -1
- package/dist/interfaces/document-repository.interface.js.map +1 -0
- package/dist/interfaces/execution-context.interface.d.ts +10 -0
- package/dist/interfaces/execution-context.interface.d.ts.map +1 -0
- package/dist/interfaces/execution-context.interface.js +3 -0
- package/dist/interfaces/execution-context.interface.js.map +1 -0
- package/dist/interfaces/handler.interface.d.ts +16 -5
- package/dist/interfaces/handler.interface.d.ts.map +1 -1
- package/dist/interfaces/index.d.ts +3 -2
- package/dist/interfaces/index.d.ts.map +1 -1
- package/dist/interfaces/index.js +3 -2
- package/dist/interfaces/index.js.map +1 -1
- package/dist/interfaces/tool-execution-interceptor.interface.d.ts +10 -10
- package/dist/interfaces/tool-execution-interceptor.interface.d.ts.map +1 -1
- package/dist/interfaces/tool-execution-interceptor.interface.js +12 -2
- package/dist/interfaces/tool-execution-interceptor.interface.js.map +1 -1
- package/dist/interfaces/workflow-metadata.interface.d.ts +0 -1
- package/dist/interfaces/workflow-metadata.interface.d.ts.map +1 -1
- package/dist/interfaces/workflow-orchestrator.interface.d.ts +11 -0
- package/dist/interfaces/workflow-orchestrator.interface.d.ts.map +1 -0
- package/dist/interfaces/workflow-orchestrator.interface.js +3 -0
- package/dist/interfaces/workflow-orchestrator.interface.js.map +1 -0
- package/dist/interfaces/workflow-state.interface.d.ts +1 -4
- package/dist/interfaces/workflow-state.interface.d.ts.map +1 -1
- package/dist/tokens.d.ts +5 -0
- package/dist/tokens.d.ts.map +1 -0
- package/dist/tokens.js +8 -0
- package/dist/tokens.js.map +1 -0
- package/dist/utils/block-config.builder.d.ts.map +1 -1
- package/dist/utils/block-config.builder.js +7 -6
- package/dist/utils/block-config.builder.js.map +1 -1
- package/dist/utils/block-metadata.utils.d.ts +7 -16
- package/dist/utils/block-metadata.utils.d.ts.map +1 -1
- package/dist/utils/block-metadata.utils.js +33 -63
- package/dist/utils/block-metadata.utils.js.map +1 -1
- package/dist/utils/index.d.ts +1 -3
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -3
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/workflow-transitions.builder.d.ts +3 -0
- package/dist/utils/workflow-transitions.builder.d.ts.map +1 -0
- package/dist/utils/workflow-transitions.builder.js +22 -0
- package/dist/utils/workflow-transitions.builder.js.map +1 -0
- package/package.json +2 -3
- package/dist/decorators/state-machine-validator.decorator.d.ts +0 -5
- package/dist/decorators/state-machine-validator.decorator.d.ts.map +0 -1
- package/dist/decorators/state-machine-validator.decorator.js +0 -11
- package/dist/decorators/state-machine-validator.decorator.js.map +0 -1
- package/dist/entities/event-subscriber.entity.d.ts +0 -20
- package/dist/entities/event-subscriber.entity.d.ts.map +0 -1
- package/dist/entities/event-subscriber.entity.js +0 -102
- package/dist/entities/event-subscriber.entity.js.map +0 -1
- package/dist/entities/namespace.entity.d.ts +0 -20
- package/dist/entities/namespace.entity.d.ts.map +0 -1
- package/dist/entities/namespace.entity.js +0 -107
- package/dist/entities/namespace.entity.js.map +0 -1
- package/dist/entities/pipeline.entity.d.ts +0 -32
- package/dist/entities/pipeline.entity.d.ts.map +0 -1
- package/dist/entities/pipeline.entity.js +0 -164
- package/dist/entities/pipeline.entity.js.map +0 -1
- package/dist/enums/pipeline-state.d.ts +0 -9
- package/dist/enums/pipeline-state.d.ts.map +0 -1
- package/dist/enums/pipeline-state.js +0 -13
- package/dist/enums/pipeline-state.js.map +0 -1
- package/dist/interfaces/state-machine-validator-result.interface.d.ts +0 -5
- package/dist/interfaces/state-machine-validator-result.interface.d.ts.map +0 -1
- package/dist/interfaces/state-machine-validator-result.interface.js.map +0 -1
- package/dist/interfaces/state-machine-validator.interface.d.ts +0 -9
- package/dist/interfaces/state-machine-validator.interface.d.ts.map +0 -1
- package/dist/interfaces/state-machine-validator.interface.js.map +0 -1
- package/dist/utils/create-hash.util.d.ts +0 -2
- package/dist/utils/create-hash.util.d.ts.map +0 -1
- package/dist/utils/create-hash.util.js +0 -13
- package/dist/utils/create-hash.util.js.map +0 -1
- package/dist/utils/normalize-deep-serialize.util.d.ts +0 -2
- package/dist/utils/normalize-deep-serialize.util.d.ts.map +0 -1
- package/dist/utils/normalize-deep-serialize.util.js +0 -19
- package/dist/utils/normalize-deep-serialize.util.js.map +0 -1
- package/dist/utils/object-fingerprint.util.d.ts +0 -2
- package/dist/utils/object-fingerprint.util.d.ts.map +0 -1
- package/dist/utils/object-fingerprint.util.js +0 -10
- package/dist/utils/object-fingerprint.util.js.map +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { RunContext } from '../dtos';
|
|
2
2
|
import { ToolResult } from './handler.interface';
|
|
3
|
-
export interface ToolExecutionMetrics {
|
|
4
|
-
durationMs?: number;
|
|
5
|
-
[key: string]: unknown;
|
|
6
|
-
}
|
|
7
3
|
export interface ToolExecutionContext {
|
|
8
4
|
tool: object;
|
|
9
5
|
args: Record<string, unknown> | undefined;
|
|
10
6
|
runContext: RunContext;
|
|
11
|
-
|
|
7
|
+
metadata: Record<string, unknown>;
|
|
12
8
|
}
|
|
13
|
-
export interface
|
|
14
|
-
|
|
15
|
-
afterExecute?(context: ToolExecutionContext, result: ToolResult): Promise<void>;
|
|
16
|
-
onError?(context: ToolExecutionContext, error: unknown): Promise<void>;
|
|
9
|
+
export interface ToolInterceptor {
|
|
10
|
+
intercept(context: ToolExecutionContext, next: () => Promise<ToolResult>): Promise<ToolResult>;
|
|
17
11
|
}
|
|
18
|
-
export declare const
|
|
12
|
+
export declare const TOOL_INTERCEPTOR_METADATA_KEY = "loopstack:tool-interceptor";
|
|
13
|
+
export declare function UseToolInterceptor(options?: {
|
|
14
|
+
priority?: number;
|
|
15
|
+
}): ClassDecorator;
|
|
16
|
+
export type ToolExecutionInterceptor = ToolInterceptor;
|
|
17
|
+
export declare const TOOL_INTERCEPTORS = "TOOL_INTERCEPTORS";
|
|
18
|
+
export declare const TOOL_EXECUTION_INTERCEPTORS = "TOOL_INTERCEPTORS";
|
|
19
19
|
//# sourceMappingURL=tool-execution-interceptor.interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-execution-interceptor.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/tool-execution-interceptor.interface.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tool-execution-interceptor.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/tool-execution-interceptor.interface.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAC1C,UAAU,EAAE,UAAU,CAAC;IAEvB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AA6BD,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,OAAO,EAAE,oBAAoB,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CAChG;AAGD,eAAO,MAAM,6BAA6B,+BAA+B,CAAC;AAc1E,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,cAAc,CAKlF;AAKD,MAAM,MAAM,wBAAwB,GAAG,eAAe,CAAC;AAKvD,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAKrD,eAAO,MAAM,2BAA2B,sBAAoB,CAAC"}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TOOL_EXECUTION_INTERCEPTORS = void 0;
|
|
4
|
-
exports.
|
|
3
|
+
exports.TOOL_EXECUTION_INTERCEPTORS = exports.TOOL_INTERCEPTORS = exports.TOOL_INTERCEPTOR_METADATA_KEY = void 0;
|
|
4
|
+
exports.UseToolInterceptor = UseToolInterceptor;
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
exports.TOOL_INTERCEPTOR_METADATA_KEY = 'loopstack:tool-interceptor';
|
|
7
|
+
function UseToolInterceptor(options) {
|
|
8
|
+
return (target) => {
|
|
9
|
+
(0, common_1.Injectable)()(target);
|
|
10
|
+
(0, common_1.SetMetadata)(exports.TOOL_INTERCEPTOR_METADATA_KEY, { priority: options?.priority ?? 100 })(target);
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
exports.TOOL_INTERCEPTORS = 'TOOL_INTERCEPTORS';
|
|
14
|
+
exports.TOOL_EXECUTION_INTERCEPTORS = exports.TOOL_INTERCEPTORS;
|
|
5
15
|
//# sourceMappingURL=tool-execution-interceptor.interface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-execution-interceptor.interface.js","sourceRoot":"","sources":["../../src/interfaces/tool-execution-interceptor.interface.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"tool-execution-interceptor.interface.js","sourceRoot":"","sources":["../../src/interfaces/tool-execution-interceptor.interface.ts"],"names":[],"mappings":";;;AA0DA,gDAKC;AA/DD,2CAAyD;AA4C5C,QAAA,6BAA6B,GAAG,4BAA4B,CAAC;AAc1E,SAAgB,kBAAkB,CAAC,OAA+B;IAChE,OAAO,CAAC,MAAM,EAAE,EAAE;QAChB,IAAA,mBAAU,GAAE,CAAC,MAAM,CAAC,CAAC;QACrB,IAAA,oBAAW,EAAC,qCAA6B,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,IAAI,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;IAC7F,CAAC,CAAC;AACJ,CAAC;AAUY,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AAKxC,QAAA,2BAA2B,GAAG,yBAAiB,CAAC"}
|
|
@@ -16,7 +16,6 @@ export interface WorkflowMetadataInterface {
|
|
|
16
16
|
place: string;
|
|
17
17
|
tools: Record<string, any>;
|
|
18
18
|
transition?: HistoryTransition;
|
|
19
|
-
hashRecord: Record<string, string | null> | null;
|
|
20
19
|
result: Record<string, unknown> | null;
|
|
21
20
|
}
|
|
22
21
|
//# sourceMappingURL=workflow-metadata.interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-metadata.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/workflow-metadata.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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AAS,CAAC,EAAE,MAAM,CAAC;IAEnB,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAE/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CACxC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { QueueResult, RunOptions } from '../base';
|
|
2
|
+
import type { WorkflowEntity } from '../entities';
|
|
3
|
+
export interface CallbackOptions {
|
|
4
|
+
transition: string;
|
|
5
|
+
}
|
|
6
|
+
export interface WorkflowOrchestrator {
|
|
7
|
+
queue(args?: Record<string, unknown>, options?: RunOptions): Promise<QueueResult>;
|
|
8
|
+
callback(workflowId: string, payload: Record<string, unknown>, options: CallbackOptions): Promise<void>;
|
|
9
|
+
complete(workflowEntity: WorkflowEntity): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=workflow-orchestrator.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-orchestrator.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/workflow-orchestrator.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAClF,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxG,QAAQ,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-orchestrator.interface.js","sourceRoot":"","sources":["../../src/interfaces/workflow-orchestrator.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { WorkflowMementoData } from './workflow-memento-data.interfate';
|
|
2
1
|
export interface WorkflowStateInterface<TState, TData> {
|
|
3
2
|
get<K extends keyof TState>(key: K): TState[K];
|
|
4
3
|
set<K extends keyof TState>(key: K, value: TState[K]): void;
|
|
@@ -9,8 +8,6 @@ export interface WorkflowStateInterface<TState, TData> {
|
|
|
9
8
|
setData<K extends keyof TData>(key: K, value: TData[K]): void;
|
|
10
9
|
updateData(partial: Partial<TData>): void;
|
|
11
10
|
checkpoint(): void;
|
|
12
|
-
|
|
13
|
-
getHistory(): WorkflowMementoData<TState, TData>[];
|
|
14
|
-
restoreToLatest(): boolean;
|
|
11
|
+
getVersion(): number;
|
|
15
12
|
}
|
|
16
13
|
//# sourceMappingURL=workflow-state.interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-state.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/workflow-state.interface.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"workflow-state.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/workflow-state.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB,CAAC,MAAM,EAAE,KAAK;IACnD,GAAG,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAC/C,GAAG,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAC5D,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACvC,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;IAE3B,UAAU,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9B,OAAO,CAAC,CAAC,SAAS,MAAM,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACjD,OAAO,CAAC,CAAC,SAAS,MAAM,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAC9D,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IAE1C,UAAU,IAAI,IAAI,CAAC;IACnB,UAAU,IAAI,MAAM,CAAC;CACtB"}
|
package/dist/tokens.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,eAA+B,CAAC;AAChE,eAAO,MAAM,iBAAiB,eAA6B,CAAC;AAC5D,eAAO,MAAM,qBAAqB,eAAiC,CAAC;AACpE,eAAO,MAAM,iBAAiB,eAA6B,CAAC"}
|
package/dist/tokens.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TEMPLATE_RENDERER = exports.WORKFLOW_ORCHESTRATOR = exports.FRAMEWORK_CONTEXT = exports.DOCUMENT_REPOSITORY = void 0;
|
|
4
|
+
exports.DOCUMENT_REPOSITORY = Symbol('DocumentRepository');
|
|
5
|
+
exports.FRAMEWORK_CONTEXT = Symbol('FrameworkContext');
|
|
6
|
+
exports.WORKFLOW_ORCHESTRATOR = Symbol('WorkflowOrchestrator');
|
|
7
|
+
exports.TEMPLATE_RENDERER = Symbol('TemplateRenderer');
|
|
8
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":";;;AAIa,QAAA,mBAAmB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AACnD,QAAA,iBAAiB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAC/C,QAAA,qBAAqB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AACvD,QAAA,iBAAiB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-config.builder.d.ts","sourceRoot":"","sources":["../../src/utils/block-config.builder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAA8B,MAAM,4BAA4B,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,wBAAgB,WAAW,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,eAAe,
|
|
1
|
+
{"version":3,"file":"block-config.builder.d.ts","sourceRoot":"","sources":["../../src/utils/block-config.builder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAA8B,MAAM,4BAA4B,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,wBAAgB,WAAW,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,eAAe,CAwBjF"}
|
|
@@ -8,16 +8,17 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const yaml_1 = require("yaml");
|
|
10
10
|
function buildConfig(options, type) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (options.configFile) {
|
|
15
|
-
const configSource = loadConfigFile(options.configFile);
|
|
11
|
+
let baseConfig = {};
|
|
12
|
+
if (typeof options.uiConfig === 'string') {
|
|
13
|
+
const configSource = loadConfigFile(options.uiConfig);
|
|
16
14
|
if (!configSource) {
|
|
17
|
-
throw new Error(`Could not load config source ${options.
|
|
15
|
+
throw new Error(`Could not load config source ${options.uiConfig}`);
|
|
18
16
|
}
|
|
19
17
|
Object.assign(baseConfig, configSource.config);
|
|
20
18
|
}
|
|
19
|
+
else if (options.uiConfig) {
|
|
20
|
+
baseConfig = { ...options.uiConfig };
|
|
21
|
+
}
|
|
21
22
|
if (type) {
|
|
22
23
|
baseConfig.type = type;
|
|
23
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-config.builder.js","sourceRoot":"","sources":["../../src/utils/block-config.builder.ts"],"names":[],"mappings":";;;;;AAMA,
|
|
1
|
+
{"version":3,"file":"block-config.builder.js","sourceRoot":"","sources":["../../src/utils/block-config.builder.ts"],"names":[],"mappings":";;;;;AAMA,kCAwBC;AA9BD,4CAAoB;AACpB,gDAAwB;AACxB,+BAA6B;AAI7B,SAAgB,WAAW,CAAC,OAAqB,EAAE,IAAa;IAC9D,IAAI,UAAU,GAA6B,EAAE,CAAC;IAE9C,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAEzC,MAAM,YAAY,GAAG,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACtD,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,gCAAgC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QACtE,CAAC;QACD,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;SAAM,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QAE5B,UAAU,GAAG,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IACvC,CAAC;IAED,IAAI,IAAI,EAAE,CAAC;QACT,UAAU,CAAC,IAAI,GAAG,IAA+B,CAAC;IACpD,CAAC;IAED,OAAO;QACL,IAAI,EAAE,UAAU,CAAC,IAAI,IAAI,WAAW;QACpC,WAAW,EAAE,UAAU,CAAC,WAAW,IAAI,EAAE;QACzC,GAAG,UAAU;KACK,CAAC;AACvB,CAAC;AAED,SAAS,cAAc,CAAC,QAAgB;IACtC,MAAM,GAAG,GAAG,YAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAE9C,MAAM,MAAM,GAAG,IAAA,YAAK,EAAC,GAAG,CAA6B,CAAC;IAEtD,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,cAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;QACrC,GAAG;QACH,MAAM;KACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { BlockConfigType } from '@loopstack/contracts/dist/types';
|
|
3
|
-
import { BlockOptions,
|
|
3
|
+
import { BlockOptions, BlockType, GuardMetadata, TransitionMetadata } from '../decorators';
|
|
4
4
|
type Constructor = Function & {
|
|
5
5
|
prototype: object;
|
|
6
6
|
};
|
|
@@ -9,24 +9,15 @@ export declare function getBlockOptions(target: object | Constructor): BlockOpti
|
|
|
9
9
|
export declare function getBlockTools(target: object | Constructor): string[];
|
|
10
10
|
export declare function getBlockDocuments(target: object | Constructor): string[];
|
|
11
11
|
export declare function getBlockWorkflows(target: object | Constructor): string[];
|
|
12
|
-
export declare function getBlockHelpers(target: object | Constructor): string[];
|
|
13
|
-
export declare function getBlockSharedProperties(target: object | Constructor): (string | symbol)[];
|
|
14
|
-
export declare function getBlockInputMetadata(target: object | Constructor): InputMetadata | undefined;
|
|
15
|
-
export declare function getBlockContextMetadata(target: object | Constructor): ContextMetadata | undefined;
|
|
16
|
-
export declare function getBlockRuntimeMetadata(target: object | Constructor): RuntimeMetadata | undefined;
|
|
17
12
|
export declare function getBlockArgsSchema(target: object | Constructor): z.ZodType | undefined;
|
|
18
|
-
export declare function getBlockStateMetadata(target: object | Constructor): StateMetadata | undefined;
|
|
19
|
-
export declare function getBlockStateSchema(target: object | Constructor): z.ZodType | undefined;
|
|
20
|
-
export declare function getBlockOutputMetadata(target: object | Constructor): OutputMetadata | undefined;
|
|
21
|
-
export declare function getBlockResultSchema(target: object | Constructor): z.ZodType | undefined;
|
|
22
13
|
export declare function getBlockWorkflow<T = unknown>(target: object, name: string): T | undefined;
|
|
23
14
|
export declare function getBlockTool<T = unknown>(target: object, name: string): T | undefined;
|
|
24
15
|
export declare function getBlockDocument<T = unknown>(target: object, name: string): T | undefined;
|
|
25
|
-
export declare function
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export declare function
|
|
16
|
+
export declare function getTransitionMetadata(target: object | Constructor): TransitionMetadata[];
|
|
17
|
+
export declare function getGuardMetadata(target: object | Constructor): GuardMetadata[];
|
|
18
|
+
export declare function getGuardMetadataMap(target: object | Constructor): Map<string, GuardMetadata>;
|
|
19
|
+
export declare function getBlockTypeFromMetadata(target: object | Constructor): BlockType | undefined;
|
|
20
|
+
export declare function getDocumentSchema(target: object | Constructor): z.ZodType | undefined;
|
|
21
|
+
export declare function getPassThroughProperties(target: object | Constructor): string[];
|
|
31
22
|
export {};
|
|
32
23
|
//# sourceMappingURL=block-metadata.utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-metadata.utils.d.ts","sourceRoot":"","sources":["../../src/utils/block-metadata.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,
|
|
1
|
+
{"version":3,"file":"block-metadata.utils.d.ts","sour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SAAS,CAGzF;AAOD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,kBAAkB,EAAE,CAGxF;AAKD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,EAAE,CAG9E;AAKD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAO5F;AAKD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,CAG5F;AAMD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,CAAC,CAAC,OAAO,GAAG,SAAS,CAErF;AAKD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,EAAE,CAI/E"}
|
|
@@ -5,21 +5,16 @@ exports.getBlockOptions = getBlockOptions;
|
|
|
5
5
|
exports.getBlockTools = getBlockTools;
|
|
6
6
|
exports.getBlockDocuments = getBlockDocuments;
|
|
7
7
|
exports.getBlockWorkflows = getBlockWorkflows;
|
|
8
|
-
exports.getBlockHelpers = getBlockHelpers;
|
|
9
|
-
exports.getBlockSharedProperties = getBlockSharedProperties;
|
|
10
|
-
exports.getBlockInputMetadata = getBlockInputMetadata;
|
|
11
|
-
exports.getBlockContextMetadata = getBlockContextMetadata;
|
|
12
|
-
exports.getBlockRuntimeMetadata = getBlockRuntimeMetadata;
|
|
13
8
|
exports.getBlockArgsSchema = getBlockArgsSchema;
|
|
14
|
-
exports.getBlockStateMetadata = getBlockStateMetadata;
|
|
15
|
-
exports.getBlockStateSchema = getBlockStateSchema;
|
|
16
|
-
exports.getBlockOutputMetadata = getBlockOutputMetadata;
|
|
17
|
-
exports.getBlockResultSchema = getBlockResultSchema;
|
|
18
9
|
exports.getBlockWorkflow = getBlockWorkflow;
|
|
19
10
|
exports.getBlockTool = getBlockTool;
|
|
20
11
|
exports.getBlockDocument = getBlockDocument;
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
12
|
+
exports.getTransitionMetadata = getTransitionMetadata;
|
|
13
|
+
exports.getGuardMetadata = getGuardMetadata;
|
|
14
|
+
exports.getGuardMetadataMap = getGuardMetadataMap;
|
|
15
|
+
exports.getBlockTypeFromMetadata = getBlockTypeFromMetadata;
|
|
16
|
+
exports.getDocumentSchema = getDocumentSchema;
|
|
17
|
+
exports.getPassThroughProperties = getPassThroughProperties;
|
|
23
18
|
const decorators_1 = require("../decorators");
|
|
24
19
|
const block_config_builder_js_1 = require("./block-config.builder.js");
|
|
25
20
|
function getConstructor(target) {
|
|
@@ -58,43 +53,10 @@ function getBlockWorkflows(target) {
|
|
|
58
53
|
const keys = Reflect.getMetadata(decorators_1.INJECTED_WORKFLOWS_METADATA_KEY, proto) ?? [];
|
|
59
54
|
return keys.map((key) => String(key));
|
|
60
55
|
}
|
|
61
|
-
function getBlockHelpers(target) {
|
|
62
|
-
const proto = getPrototype(target);
|
|
63
|
-
const keys = Reflect.getMetadata(decorators_1.TEMPLATE_HELPER_METADATA_KEY, proto) ?? [];
|
|
64
|
-
return keys.map((key) => String(key));
|
|
65
|
-
}
|
|
66
|
-
function getBlockSharedProperties(target) {
|
|
67
|
-
const ctor = getConstructor(target);
|
|
68
|
-
return Reflect.getMetadata(decorators_1.SHARED_METADATA_KEY, ctor) ?? [];
|
|
69
|
-
}
|
|
70
|
-
function getBlockInputMetadata(target) {
|
|
71
|
-
const ctor = getConstructor(target);
|
|
72
|
-
return Reflect.getMetadata(decorators_1.INPUT_METADATA_KEY, ctor);
|
|
73
|
-
}
|
|
74
|
-
function getBlockContextMetadata(target) {
|
|
75
|
-
const ctor = getConstructor(target);
|
|
76
|
-
return Reflect.getMetadata(decorators_1.CONTEXT_METADATA_KEY, ctor);
|
|
77
|
-
}
|
|
78
|
-
function getBlockRuntimeMetadata(target) {
|
|
79
|
-
const ctor = getConstructor(target);
|
|
80
|
-
return Reflect.getMetadata(decorators_1.RUNTIME_METADATA_KEY, ctor);
|
|
81
|
-
}
|
|
82
56
|
function getBlockArgsSchema(target) {
|
|
83
|
-
return getBlockInputMetadata(target)?.schema;
|
|
84
|
-
}
|
|
85
|
-
function getBlockStateMetadata(target) {
|
|
86
57
|
const ctor = getConstructor(target);
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
function getBlockStateSchema(target) {
|
|
90
|
-
return getBlockStateMetadata(target)?.schema;
|
|
91
|
-
}
|
|
92
|
-
function getBlockOutputMetadata(target) {
|
|
93
|
-
const ctor = getConstructor(target);
|
|
94
|
-
return Reflect.getMetadata(decorators_1.OUTPUT_METADATA_KEY, ctor);
|
|
95
|
-
}
|
|
96
|
-
function getBlockResultSchema(target) {
|
|
97
|
-
return getBlockOutputMetadata(target)?.schema;
|
|
58
|
+
const options = Reflect.getMetadata(decorators_1.BLOCK_CONFIG_METADATA_KEY, ctor);
|
|
59
|
+
return options?.schema;
|
|
98
60
|
}
|
|
99
61
|
function getBlockWorkflow(target, name) {
|
|
100
62
|
const workflows = getBlockWorkflows(target);
|
|
@@ -108,24 +70,32 @@ function getBlockDocument(target, name) {
|
|
|
108
70
|
const documents = getBlockDocuments(target);
|
|
109
71
|
return documents.includes(name) ? target[name] : undefined;
|
|
110
72
|
}
|
|
111
|
-
function
|
|
112
|
-
const
|
|
113
|
-
return
|
|
114
|
-
? target[name]
|
|
115
|
-
: undefined;
|
|
73
|
+
function getTransitionMetadata(target) {
|
|
74
|
+
const ctor = getConstructor(target);
|
|
75
|
+
return Reflect.getMetadata(decorators_1.TRANSITIONS_METADATA_KEY, ctor) ?? [];
|
|
116
76
|
}
|
|
117
|
-
function
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
helpers.push({ name, fn: fn.bind(target) });
|
|
127
|
-
}
|
|
77
|
+
function getGuardMetadata(target) {
|
|
78
|
+
const ctor = getConstructor(target);
|
|
79
|
+
return Reflect.getMetadata(decorators_1.GUARDS_METADATA_KEY, ctor) ?? [];
|
|
80
|
+
}
|
|
81
|
+
function getGuardMetadataMap(target) {
|
|
82
|
+
const guards = getGuardMetadata(target);
|
|
83
|
+
const map = new Map();
|
|
84
|
+
for (const guard of guards) {
|
|
85
|
+
map.set(guard.transitionMethodName, guard);
|
|
128
86
|
}
|
|
129
|
-
return
|
|
87
|
+
return map;
|
|
88
|
+
}
|
|
89
|
+
function getBlockTypeFromMetadata(target) {
|
|
90
|
+
const ctor = getConstructor(target);
|
|
91
|
+
return Reflect.getMetadata(decorators_1.BLOCK_TYPE_METADATA_KEY, ctor);
|
|
92
|
+
}
|
|
93
|
+
function getDocumentSchema(target) {
|
|
94
|
+
return getBlockArgsSchema(target);
|
|
95
|
+
}
|
|
96
|
+
function getPassThroughProperties(target) {
|
|
97
|
+
const proto = getPrototype(target);
|
|
98
|
+
const keys = Reflect.getMetadata(decorators_1.PASS_THROUGH_METADATA_KEY, proto) ?? [];
|
|
99
|
+
return keys.map((key) => String(key));
|
|
130
100
|
}
|
|
131
101
|
//# sourceMappingURL=block-metadata.utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-metadata.utils.js","sourceRoot":"","sources":["../../src/utils/block-metadata.utils.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"block-metadata.utils.js","sourceRoot":"","sources":["../../src/utils/block-metadata.utils.ts"],"names":[],"mappings":";;AA8CA,wCAIC;AAKD,0CAGC;AAKD,sCAIC;AAKD,8CAIC;AAKD,8CAIC;AAKD,gDAIC;AAKD,4CAGC;AAKD,oCAGC;AAKD,4CAGC;AAOD,sDAGC;AAKD,4CAGC;AAKD,kDAOC;AAKD,4DAGC;AAMD,8CAEC;AAKD,4DAIC;AA3KD,8CAauB;AACvB,uEAAwD;AAUxD,SAAS,cAAc,CAAC,MAA4B;IAClD,IAAI,OAA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C,IAAI,EAAE,CAAC;IAC9G,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AACxC,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export * from './block-metadata.utils.js';
|
|
2
|
-
export * from './create-hash.util.js';
|
|
3
|
-
export * from './normalize-deep-serialize.util.js';
|
|
4
2
|
export * from './normalize-object.js';
|
|
5
|
-
export * from './object-fingerprint.util.js';
|
|
6
3
|
export * from './stable-json-transformer.js';
|
|
4
|
+
export * from './workflow-transitions.builder.js';
|
|
7
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC"}
|
package/dist/utils/index.js
CHANGED
|
@@ -15,9 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./block-metadata.utils.js"), exports);
|
|
18
|
-
__exportStar(require("./create-hash.util.js"), exports);
|
|
19
|
-
__exportStar(require("./normalize-deep-serialize.util.js"), exports);
|
|
20
18
|
__exportStar(require("./normalize-object.js"), exports);
|
|
21
|
-
__exportStar(require("./object-fingerprint.util.js"), exports);
|
|
22
19
|
__exportStar(require("./stable-json-transformer.js"), exports);
|
|
20
|
+
__exportStar(require("./workflow-transitions.builder.js"), exports);
|
|
23
21
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,wDAAsC;AACtC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,wDAAsC;AACtC,+DAA6C;AAC7C,oEAAkD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-transitions.builder.d.ts","sourceRoot":"","sources":["../../src/utils/workflow-transitions.builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAkBzE,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,sBAAsB,EAAE,CAiBjF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildWorkflowTransitions = buildWorkflowTransitions;
|
|
4
|
+
const block_metadata_utils_js_1 = require("./block-metadata.utils.js");
|
|
5
|
+
function buildWorkflowTransitions(target) {
|
|
6
|
+
const transitions = (0, block_metadata_utils_js_1.getTransitionMetadata)(target);
|
|
7
|
+
const guards = (0, block_metadata_utils_js_1.getGuardMetadataMap)(target);
|
|
8
|
+
return transitions.map((t) => {
|
|
9
|
+
const guard = guards.get(t.methodName);
|
|
10
|
+
const result = {
|
|
11
|
+
id: t.methodName,
|
|
12
|
+
from: t.from,
|
|
13
|
+
to: t.to,
|
|
14
|
+
trigger: t.wait ? 'manual' : 'onEntry',
|
|
15
|
+
};
|
|
16
|
+
if (guard) {
|
|
17
|
+
result.if = `\${{ ${guard.guardMethodName}() }}`;
|
|
18
|
+
}
|
|
19
|
+
return result;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=workflow-transitions.builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-transitions.builder.js","sourceRoot":"","sources":["../../src/utils/workflow-transitions.builder.ts"],"names":[],"mappings":";;AAkBA,4DAiBC;AAlCD,uEAAuF;AAiBvF,SAAgB,wBAAwB,CAAC,MAAc;IACrD,MAAM,WAAW,GAAG,IAAA,+CAAqB,EAAC,MAAM,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,IAAA,6CAAmB,EAAC,MAAM,CAAC,CAAC;IAE3C,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QAC3B,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;QACvC,MAAM,MAAM,GAA2B;YACrC,EAAE,EAAE,CAAC,CAAC,UAAU;YAChB,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,EAAE,EAAE,CAAC,CAAC,EAAE;YACR,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;SACvC,CAAC;QACF,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,CAAC,EAAE,GAAG,QAAQ,KAAK,CAAC,eAAe,OAAO,CAAC;QACnD,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@loopstack/common",
|
|
3
3
|
"displayName": "Loopstack Common Module",
|
|
4
4
|
"description": "A collection of utils and dtos shared between nestjs modules",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.25.0",
|
|
6
6
|
"license": "BSL",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "Jakob Klippel",
|
|
@@ -24,10 +24,9 @@
|
|
|
24
24
|
"watch": "nest build --watch"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@loopstack/contracts": "^0.
|
|
27
|
+
"@loopstack/contracts": "^0.25.0",
|
|
28
28
|
"class-transformer": "^0.5.1",
|
|
29
29
|
"fast-json-stable-stringify": "^2.1.0",
|
|
30
|
-
"murmurhash": "^2.0.1",
|
|
31
30
|
"reflect-metadata": "^0.2.2",
|
|
32
31
|
"yaml": "^2.8.2",
|
|
33
32
|
"zod": "^4.3.6"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"state-machine-validator.decorator.d.ts","sourceRoot":"","sources":["../../src/decorators/state-machine-validator.decorator.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sCAAsC,2CAA2C,CAAC;AAE/F,wBAAgB,qBAAqB,CAAC,OAAO,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,cAAc,CAEnF"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LOOP_STATE_MACHINE_VALIDATOR_DECORATOR = void 0;
|
|
4
|
-
exports.StateMachineValidator = StateMachineValidator;
|
|
5
|
-
const common_1 = require("@nestjs/common");
|
|
6
|
-
const common_2 = require("@nestjs/common");
|
|
7
|
-
exports.LOOP_STATE_MACHINE_VALIDATOR_DECORATOR = 'LOOP_STATE_MACHINE_VALIDATOR_DECORATOR';
|
|
8
|
-
function StateMachineValidator(options) {
|
|
9
|
-
return (0, common_2.applyDecorators)((0, common_1.Injectable)(), (0, common_1.SetMetadata)(exports.LOOP_STATE_MACHINE_VALIDATOR_DECORATOR, options));
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=state-machine-validator.decorator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"state-machine-validator.decorator.js","sourceRoot":"","sources":["../../src/decorators/state-machine-validator.decorator.ts"],"names":[],"mappings":";;;AAKA,sDAEC;AAPD,2CAAyD;AACzD,2CAAiD;AAEpC,QAAA,sCAAsC,GAAG,wCAAwC,CAAC;AAE/F,SAAgB,qBAAqB,CAAC,OAA6B;IACjE,OAAO,IAAA,wBAAe,EAAC,IAAA,mBAAU,GAAE,EAAE,IAAA,oBAAW,EAAC,8CAAsC,EAAE,OAAO,CAAC,CAAC,CAAC;AACrG,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { PipelineEntity } from './pipeline.entity';
|
|
2
|
-
import { User } from './user.entity';
|
|
3
|
-
import { WorkspaceEntity } from './workspace.entity';
|
|
4
|
-
export declare class EventSubscriberEntity {
|
|
5
|
-
id: string;
|
|
6
|
-
subscriberPipeline: PipelineEntity;
|
|
7
|
-
subscriberPipelineId: string;
|
|
8
|
-
subscriberWorkflowId: string;
|
|
9
|
-
subscriberTransition: string;
|
|
10
|
-
eventCorrelationId: string;
|
|
11
|
-
eventName: string;
|
|
12
|
-
createdAt: Date;
|
|
13
|
-
updatedAt: Date;
|
|
14
|
-
workspace: WorkspaceEntity;
|
|
15
|
-
workspaceId: string;
|
|
16
|
-
user: User;
|
|
17
|
-
userId: string;
|
|
18
|
-
once: boolean;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=event-subscriber.entity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event-subscriber.entity.d.ts","sourceRoot":"","sources":["../../src/entities/event-subscriber.entity.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,qBAGa,qBAAqB;IAEhC,EAAE,EAAG,MAAM,CAAC;IAIZ,kBAAkB,EAAG,cAAc,CAAC;IAIpC,oBAAoB,EAAE,MAAM,CAAC;IAG7B,oBAAoB,EAAG,MAAM,CAAC;IAG9B,oBAAoB,EAAG,MAAM,CAAC;IAI9B,kBAAkB,EAAG,MAAM,CAAC;IAI5B,SAAS,EAAG,MAAM,CAAC;IAGnB,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,EAAG,IAAI,CAAC;IAIjB,SAAS,EAAG,eAAe,CAAC;IAG5B,WAAW,EAAG,MAAM,CAAC;IAIrB,IAAI,EAAG,IAAI,CAAC;IAIZ,MAAM,EAAG,MAAM,CAAC;IAGhB,IAAI,EAAG,OAAO,CAAC;CAChB"}
|