bazis 0.129.0 → 0.131.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/core/agent/AgentToolExecutor.ts +3 -0
- package/core/agent/Tool.contract.ts +1 -1
- package/core/agent/index.ts +1 -0
- package/core/agent/metadata.ts +9 -0
- package/core/agent/semantic.ts +8 -1
- package/core/infra/connectors/codex/CodexAppServerClient.ts +1 -1
- package/core/workflow/contracts/types.ts +37 -1
- package/core/workflow/definitions_module/WorkflowDefinitions.module.ts +10 -1
- package/core/workflow/definitions_module/access/Definitions.permissions.ts +23 -0
- package/core/workflow/definitions_module/access/Process.references.ts +27 -0
- package/core/workflow/definitions_module/events/Definitions.events.ts +16 -0
- package/core/workflow/definitions_module/http/Processes.controller.ts +34 -20
- package/core/workflow/definitions_module/services/IWorkflowDefinitions.service.ts +21 -6
- package/core/workflow/definitions_module/services/WorkflowDefinitions.service.ts +48 -21
- package/core/workflow/generated/deps.ts +7 -3
- package/core/workflow/index.ts +13 -2
- package/core/workflow/internal/WorkflowEvents.ts +23 -0
- package/core/workflow/internal/http.ts +51 -21
- package/core/workflow/runtime_module/WorkflowRuntime.module.ts +4 -1
- package/core/workflow/runtime_module/access/Runtime.permissions.ts +28 -0
- package/core/workflow/runtime_module/events/Runtime.events.ts +28 -1
- package/core/workflow/runtime_module/http/Events.controller.ts +6 -3
- package/core/workflow/runtime_module/http/Instances.controller.ts +38 -22
- package/core/workflow/runtime_module/internal/ToolStep.ts +2 -1
- package/core/workflow/runtime_module/internal/WorkflowEngine.ts +23 -21
- package/core/workflow/runtime_module/services/IWorkflowRuntime.service.ts +17 -5
- package/core/workflow/runtime_module/services/WorkflowRuntime.service.ts +16 -11
- package/core/workflow/tasks_module/WorkflowTasks.module.ts +4 -1
- package/core/workflow/tasks_module/access/Tasks.permissions.ts +13 -0
- package/core/workflow/tasks_module/events/Tasks.events.ts +15 -0
- package/core/workflow/tasks_module/http/Tasks.controller.ts +33 -22
- package/core/workflow/tasks_module/services/IWorkflowTasks.service.ts +10 -5
- package/core/workflow/tasks_module/services/WorkflowTasks.service.ts +50 -15
- package/library/openapi/codegen.ts +9 -0
- package/library/validation/types/ValidatorOptions.ts +10 -0
- package/library/workflow/formFields.ts +2 -1
- package/package.json +1 -1
- package/core/workflow/access/WorkflowAccess.ts +0 -52
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { HttpContext } from "../../http";
|
|
2
|
-
import type { WorkflowActor } from "../contracts/types";
|
|
3
|
-
|
|
4
|
-
export type WorkflowAction =
|
|
5
|
-
| "processes.read"
|
|
6
|
-
| "processes.manage"
|
|
7
|
-
| "processes.publish"
|
|
8
|
-
| "instances.start"
|
|
9
|
-
| "instances.read"
|
|
10
|
-
| "instances.manage"
|
|
11
|
-
| "events.emit"
|
|
12
|
-
| "tasks.work";
|
|
13
|
-
|
|
14
|
-
/** What an action is about; the fields known for the route. */
|
|
15
|
-
export interface WorkflowAccessTarget {
|
|
16
|
-
readonly processKey?: string;
|
|
17
|
-
readonly partition?: string | null;
|
|
18
|
-
readonly instanceId?: string;
|
|
19
|
-
readonly taskId?: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Rights and identity of the workflow HTTP (WORKFLOW-001 §6). The framework's
|
|
24
|
-
* controllers do not know how the application signs people in, so they ask this
|
|
25
|
-
* port. It is the DI token too: register the application's implementation in any
|
|
26
|
-
* module, `DI.singleton(DI.classProvider(WorkflowAccess, AppWorkflowAccess))`.
|
|
27
|
-
* Without one every workflow route answers 403. The services never ask it: the
|
|
28
|
-
* application's code that calls them decides itself.
|
|
29
|
-
*/
|
|
30
|
-
export abstract class WorkflowAccess {
|
|
31
|
-
/** Who makes the request; `undefined` answers 401. */
|
|
32
|
-
abstract actor(ctx: HttpContext): WorkflowActor | undefined | Promise<WorkflowActor | undefined>;
|
|
33
|
-
|
|
34
|
-
/** Whether the actor may do `action` on `target`; `false` answers 403. */
|
|
35
|
-
abstract can(ctx: HttpContext, action: WorkflowAction, target: WorkflowAccessTarget): boolean | Promise<boolean>;
|
|
36
|
-
|
|
37
|
-
/** Whom the user's tasks are addressed to: `user:<id>`, `role:<code>`. */
|
|
38
|
-
assignees(_ctx: HttpContext, actor: WorkflowActor): readonly string[] | Promise<readonly string[]> {
|
|
39
|
-
return [`user:${actor.id}`];
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/** The default: nothing is allowed until the application says otherwise. */
|
|
44
|
-
export class DenyWorkflowAccess extends WorkflowAccess {
|
|
45
|
-
actor(): undefined {
|
|
46
|
-
return undefined;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
can(): boolean {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
}
|