@lssm/example.workflow-system 0.0.0-canary-20251217060834 → 0.0.0-canary-20251217072406
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/approval/approval.contracts.d.ts +134 -134
- package/dist/approval/approval.contracts.js +250 -1
- package/dist/approval/approval.enum.d.ts +3 -3
- package/dist/approval/approval.enum.js +29 -1
- package/dist/approval/approval.event.d.ts +32 -32
- package/dist/approval/approval.event.js +186 -1
- package/dist/approval/approval.handler.js +71 -1
- package/dist/approval/approval.schema.d.ts +24 -24
- package/dist/approval/approval.schema.js +111 -1
- package/dist/approval/index.js +6 -1
- package/dist/docs/index.js +1 -1
- package/dist/docs/workflow-system.docblock.js +61 -5
- package/dist/entities/approval.d.ts +36 -36
- package/dist/entities/approval.js +128 -1
- package/dist/entities/index.d.ts +127 -127
- package/dist/entities/index.js +31 -1
- package/dist/entities/instance.d.ts +47 -47
- package/dist/entities/instance.js +168 -1
- package/dist/entities/step.d.ts +32 -32
- package/dist/entities/step.js +135 -1
- package/dist/entities/workflow.d.ts +23 -23
- package/dist/entities/workflow.js +102 -1
- package/dist/example.js +50 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js +19 -1
- package/dist/instance/index.js +6 -1
- package/dist/instance/instance.contracts.d.ts +256 -256
- package/dist/instance/instance.contracts.js +334 -1
- package/dist/instance/instance.enum.d.ts +2 -2
- package/dist/instance/instance.enum.js +20 -1
- package/dist/instance/instance.event.d.ts +87 -87
- package/dist/instance/instance.event.js +214 -1
- package/dist/instance/instance.handler.js +93 -1
- package/dist/instance/instance.schema.d.ts +54 -54
- package/dist/instance/instance.schema.js +173 -1
- package/dist/libs/contracts/dist/capabilities/openbanking.js +88 -0
- package/dist/libs/contracts/dist/client/index.js +5 -0
- package/dist/libs/contracts/dist/client/react/feature-render.js +2 -0
- package/dist/libs/contracts/dist/client/react/form-render.js +4 -0
- package/dist/libs/contracts/dist/client/react/index.js +4 -0
- package/dist/libs/contracts/dist/contract-registry/index.js +1 -0
- package/dist/libs/contracts/dist/contract-registry/schemas.js +60 -0
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/index.js +29 -0
- package/dist/libs/contracts/dist/docs/presentations.js +71 -0
- package/dist/libs/contracts/dist/docs/registry.js +44 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +80 -0
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +57 -0
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +357 -0
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +37 -0
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +20 -0
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +48 -0
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +79 -0
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +84 -0
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +45 -0
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +67 -0
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +40 -0
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +69 -0
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +47 -0
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +62 -0
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +155 -0
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +20 -0
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +101 -0
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +20 -0
- package/dist/libs/contracts/dist/events.js +10 -0
- package/dist/libs/contracts/dist/experiments/evaluator.js +1 -0
- package/dist/libs/contracts/dist/index.js +71 -0
- package/dist/libs/contracts/dist/install.js +2 -0
- package/dist/libs/contracts/dist/integrations/contracts.js +377 -0
- package/dist/libs/contracts/dist/integrations/index.js +18 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +228 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +159 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +3 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +210 -0
- package/dist/libs/contracts/dist/integrations/openbanking/models.js +242 -0
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +13 -0
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +52 -0
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +75 -0
- package/dist/libs/contracts/dist/integrations/providers/gmail.js +87 -0
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +66 -0
- package/dist/libs/contracts/dist/integrations/providers/index.js +11 -0
- package/dist/libs/contracts/dist/integrations/providers/mistral.js +68 -0
- package/dist/libs/contracts/dist/integrations/providers/postmark.js +68 -0
- package/dist/libs/contracts/dist/integrations/providers/powens.js +116 -0
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js +73 -0
- package/dist/libs/contracts/dist/integrations/providers/registry.js +10 -0
- package/dist/libs/contracts/dist/integrations/providers/stripe.js +83 -0
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +61 -0
- package/dist/libs/contracts/dist/jsonschema.js +1 -0
- package/dist/libs/contracts/dist/knowledge/contracts.js +306 -0
- package/dist/libs/contracts/dist/knowledge/index.js +7 -0
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +34 -0
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +34 -0
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +38 -0
- package/dist/libs/contracts/dist/knowledge/spaces/index.js +6 -0
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +34 -0
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +37 -0
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +34 -0
- package/dist/libs/contracts/dist/llm/exporters.js +19 -0
- package/dist/libs/contracts/dist/llm/index.js +2 -0
- package/dist/libs/contracts/dist/llm/prompts.js +1 -0
- package/dist/libs/contracts/dist/onboarding-base.js +196 -0
- package/dist/libs/contracts/dist/openapi.js +1 -0
- package/dist/libs/contracts/dist/ownership.js +21 -0
- package/dist/libs/contracts/dist/presentations.js +1 -0
- package/dist/libs/contracts/dist/presentations.v2.js +11 -0
- package/dist/libs/contracts/dist/prompt.js +1 -0
- package/dist/libs/contracts/dist/promptRegistry.js +1 -0
- package/dist/libs/contracts/dist/regenerator/index.js +1 -0
- package/dist/libs/contracts/dist/regenerator/service.js +6 -0
- package/dist/libs/contracts/dist/registry.js +2 -0
- package/dist/libs/contracts/dist/resources.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/EnumType.js +2 -0
- package/dist/libs/contracts/dist/schema/dist/FieldType.js +49 -0
- package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +236 -0
- package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +39 -0
- package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/entity/index.js +2 -0
- package/dist/libs/contracts/dist/schema/dist/entity/types.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/index.js +6 -0
- package/dist/libs/contracts/dist/server/graphql-pothos.js +6 -0
- package/dist/libs/contracts/dist/server/index.js +8 -0
- package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +4 -0
- package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +2 -0
- package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +1 -0
- package/dist/libs/contracts/dist/server/mcp/registerResources.js +2 -0
- package/dist/libs/contracts/dist/server/mcp/registerTools.js +1 -0
- package/dist/libs/contracts/dist/server/provider-mcp.js +1 -0
- package/dist/libs/contracts/dist/server/rest-elysia.js +1 -0
- package/dist/libs/contracts/dist/server/rest-express.js +1 -0
- package/dist/libs/contracts/dist/server/rest-generic.js +1 -0
- package/dist/libs/contracts/dist/server/rest-next-app.js +1 -0
- package/dist/libs/contracts/dist/server/rest-next-pages.js +1 -0
- package/dist/libs/contracts/dist/spec.js +34 -0
- package/dist/libs/contracts/dist/telemetry/index.js +1 -0
- package/dist/libs/contracts/dist/telemetry/tracker.js +1 -0
- package/dist/libs/contracts/dist/tests/index.js +1 -0
- package/dist/libs/contracts/dist/tests/runner.js +2 -0
- package/dist/libs/contracts/dist/workflow/index.js +1 -0
- package/dist/libs/contracts/dist/workflow/runner.js +1 -0
- package/dist/libs/schema/dist/EnumType.js +56 -0
- package/dist/libs/schema/dist/FieldType.js +49 -0
- package/dist/libs/schema/dist/ScalarTypeEnum.js +236 -0
- package/dist/libs/schema/dist/SchemaModel.js +39 -0
- package/dist/libs/schema/dist/entity/defineEntity.js +236 -0
- package/dist/libs/schema/dist/entity/index.js +2 -0
- package/dist/libs/schema/dist/entity/types.js +1 -0
- package/dist/libs/schema/dist/index.js +6 -0
- package/dist/presentations/index.js +291 -1
- package/dist/shared/index.js +3 -1
- package/dist/shared/mock-data.js +11 -1
- package/dist/state-machine/index.js +157 -1
- package/dist/workflow/index.js +6 -1
- package/dist/workflow/workflow.contracts.d.ts +245 -245
- package/dist/workflow/workflow.contracts.js +239 -1
- package/dist/workflow/workflow.enum.js +47 -1
- package/dist/workflow/workflow.event.d.ts +32 -32
- package/dist/workflow/workflow.event.js +116 -1
- package/dist/workflow/workflow.handler.js +65 -1
- package/dist/workflow/workflow.schema.js +250 -1
- package/dist/workflow-system.feature.js +337 -1
- package/package.json +11 -11
|
@@ -1 +1,291 @@
|
|
|
1
|
-
import{WorkflowDefinitionModel
|
|
1
|
+
import { WorkflowDefinitionModel } from "../workflow/workflow.schema.js";
|
|
2
|
+
import { WorkflowInstanceModel } from "../instance/instance.schema.js";
|
|
3
|
+
import { ApprovalRequestModel } from "../approval/approval.schema.js";
|
|
4
|
+
|
|
5
|
+
//#region src/presentations/index.ts
|
|
6
|
+
/**
|
|
7
|
+
* Workflow designer canvas for building workflows.
|
|
8
|
+
*/
|
|
9
|
+
const WorkflowDesignerPresentation = {
|
|
10
|
+
meta: {
|
|
11
|
+
name: "workflow.designer",
|
|
12
|
+
version: 1,
|
|
13
|
+
description: "Visual workflow designer with drag-and-drop steps",
|
|
14
|
+
domain: "workflow-system",
|
|
15
|
+
owners: ["@workflow-team"],
|
|
16
|
+
tags: [
|
|
17
|
+
"workflow",
|
|
18
|
+
"designer",
|
|
19
|
+
"admin"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
source: {
|
|
23
|
+
type: "component",
|
|
24
|
+
framework: "react",
|
|
25
|
+
componentKey: "WorkflowDesigner",
|
|
26
|
+
props: WorkflowDefinitionModel
|
|
27
|
+
},
|
|
28
|
+
targets: ["react"],
|
|
29
|
+
policy: { flags: ["workflow.designer.enabled"] }
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* List of workflow definitions.
|
|
33
|
+
*/
|
|
34
|
+
const WorkflowListPresentation = {
|
|
35
|
+
meta: {
|
|
36
|
+
name: "workflow.definition.list",
|
|
37
|
+
version: 1,
|
|
38
|
+
description: "List of workflow definitions with status and actions",
|
|
39
|
+
domain: "workflow-system",
|
|
40
|
+
owners: ["@workflow-team"],
|
|
41
|
+
tags: [
|
|
42
|
+
"workflow",
|
|
43
|
+
"list",
|
|
44
|
+
"admin"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
source: {
|
|
48
|
+
type: "component",
|
|
49
|
+
framework: "react",
|
|
50
|
+
componentKey: "WorkflowDefinitionList",
|
|
51
|
+
props: WorkflowDefinitionModel
|
|
52
|
+
},
|
|
53
|
+
targets: ["react", "markdown"],
|
|
54
|
+
policy: { flags: ["workflow.enabled"] }
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Workflow definition detail view.
|
|
58
|
+
*/
|
|
59
|
+
const WorkflowDetailPresentation = {
|
|
60
|
+
meta: {
|
|
61
|
+
name: "workflow.definition.detail",
|
|
62
|
+
version: 1,
|
|
63
|
+
description: "Detailed view of a workflow definition with steps",
|
|
64
|
+
domain: "workflow-system",
|
|
65
|
+
owners: ["@workflow-team"],
|
|
66
|
+
tags: ["workflow", "detail"]
|
|
67
|
+
},
|
|
68
|
+
source: {
|
|
69
|
+
type: "component",
|
|
70
|
+
framework: "react",
|
|
71
|
+
componentKey: "WorkflowDefinitionDetail",
|
|
72
|
+
props: WorkflowDefinitionModel
|
|
73
|
+
},
|
|
74
|
+
targets: ["react", "markdown"],
|
|
75
|
+
policy: { flags: ["workflow.enabled"] }
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* List of running workflow instances.
|
|
79
|
+
*/
|
|
80
|
+
const InstanceListPresentation = {
|
|
81
|
+
meta: {
|
|
82
|
+
name: "workflow.instance.list",
|
|
83
|
+
version: 1,
|
|
84
|
+
description: "List of workflow instances with status and progress",
|
|
85
|
+
domain: "workflow-system",
|
|
86
|
+
owners: ["@workflow-team"],
|
|
87
|
+
tags: [
|
|
88
|
+
"workflow",
|
|
89
|
+
"instance",
|
|
90
|
+
"list"
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
source: {
|
|
94
|
+
type: "component",
|
|
95
|
+
framework: "react",
|
|
96
|
+
componentKey: "WorkflowInstanceList",
|
|
97
|
+
props: WorkflowInstanceModel
|
|
98
|
+
},
|
|
99
|
+
targets: ["react", "markdown"],
|
|
100
|
+
policy: { flags: ["workflow.enabled"] }
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Workflow instance detail view with timeline.
|
|
104
|
+
*/
|
|
105
|
+
const InstanceDetailPresentation = {
|
|
106
|
+
meta: {
|
|
107
|
+
name: "workflow.instance.detail",
|
|
108
|
+
version: 1,
|
|
109
|
+
description: "Detailed view of a workflow instance with step timeline",
|
|
110
|
+
domain: "workflow-system",
|
|
111
|
+
owners: ["@workflow-team"],
|
|
112
|
+
tags: [
|
|
113
|
+
"workflow",
|
|
114
|
+
"instance",
|
|
115
|
+
"detail",
|
|
116
|
+
"timeline"
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
source: {
|
|
120
|
+
type: "component",
|
|
121
|
+
framework: "react",
|
|
122
|
+
componentKey: "WorkflowInstanceDetail",
|
|
123
|
+
props: WorkflowInstanceModel
|
|
124
|
+
},
|
|
125
|
+
targets: ["react", "markdown"],
|
|
126
|
+
policy: { flags: ["workflow.enabled"] }
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Workflow progress tracker widget.
|
|
130
|
+
*/
|
|
131
|
+
const ProgressTrackerPresentation = {
|
|
132
|
+
meta: {
|
|
133
|
+
name: "workflow.instance.progress",
|
|
134
|
+
version: 1,
|
|
135
|
+
description: "Visual progress tracker showing current step in workflow",
|
|
136
|
+
domain: "workflow-system",
|
|
137
|
+
owners: ["@workflow-team"],
|
|
138
|
+
tags: [
|
|
139
|
+
"workflow",
|
|
140
|
+
"progress",
|
|
141
|
+
"widget"
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
source: {
|
|
145
|
+
type: "component",
|
|
146
|
+
framework: "react",
|
|
147
|
+
componentKey: "WorkflowProgressTracker",
|
|
148
|
+
props: WorkflowInstanceModel
|
|
149
|
+
},
|
|
150
|
+
targets: ["react"],
|
|
151
|
+
policy: { flags: ["workflow.enabled"] }
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Approval inbox - list of pending approvals.
|
|
155
|
+
*/
|
|
156
|
+
const ApprovalInboxPresentation = {
|
|
157
|
+
meta: {
|
|
158
|
+
name: "workflow.approval.inbox",
|
|
159
|
+
version: 1,
|
|
160
|
+
description: "Inbox showing pending approval requests for current user",
|
|
161
|
+
domain: "workflow-system",
|
|
162
|
+
owners: ["@workflow-team"],
|
|
163
|
+
tags: [
|
|
164
|
+
"workflow",
|
|
165
|
+
"approval",
|
|
166
|
+
"inbox"
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
source: {
|
|
170
|
+
type: "component",
|
|
171
|
+
framework: "react",
|
|
172
|
+
componentKey: "ApprovalInbox",
|
|
173
|
+
props: ApprovalRequestModel
|
|
174
|
+
},
|
|
175
|
+
targets: ["react", "markdown"],
|
|
176
|
+
policy: { flags: ["workflow.approvals.enabled"] }
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Approval request detail view.
|
|
180
|
+
*/
|
|
181
|
+
const ApprovalDetailPresentation = {
|
|
182
|
+
meta: {
|
|
183
|
+
name: "workflow.approval.detail",
|
|
184
|
+
version: 1,
|
|
185
|
+
description: "Detailed approval request view with context and actions",
|
|
186
|
+
domain: "workflow-system",
|
|
187
|
+
owners: ["@workflow-team"],
|
|
188
|
+
tags: [
|
|
189
|
+
"workflow",
|
|
190
|
+
"approval",
|
|
191
|
+
"detail"
|
|
192
|
+
]
|
|
193
|
+
},
|
|
194
|
+
source: {
|
|
195
|
+
type: "component",
|
|
196
|
+
framework: "react",
|
|
197
|
+
componentKey: "ApprovalRequestDetail",
|
|
198
|
+
props: ApprovalRequestModel
|
|
199
|
+
},
|
|
200
|
+
targets: ["react", "markdown"],
|
|
201
|
+
policy: { flags: ["workflow.approvals.enabled"] }
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* Approval decision form.
|
|
205
|
+
*/
|
|
206
|
+
const ApprovalFormPresentation = {
|
|
207
|
+
meta: {
|
|
208
|
+
name: "workflow.approval.form",
|
|
209
|
+
version: 1,
|
|
210
|
+
description: "Form for submitting approval decisions",
|
|
211
|
+
domain: "workflow-system",
|
|
212
|
+
owners: ["@workflow-team"],
|
|
213
|
+
tags: [
|
|
214
|
+
"workflow",
|
|
215
|
+
"approval",
|
|
216
|
+
"form"
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
source: {
|
|
220
|
+
type: "component",
|
|
221
|
+
framework: "react",
|
|
222
|
+
componentKey: "ApprovalDecisionForm"
|
|
223
|
+
},
|
|
224
|
+
targets: ["react"],
|
|
225
|
+
policy: { flags: ["workflow.approvals.enabled"] }
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* Pending approvals count badge.
|
|
229
|
+
*/
|
|
230
|
+
const PendingApprovalsBadgePresentation = {
|
|
231
|
+
meta: {
|
|
232
|
+
name: "workflow.approval.badge",
|
|
233
|
+
version: 1,
|
|
234
|
+
description: "Badge showing count of pending approvals",
|
|
235
|
+
domain: "workflow-system",
|
|
236
|
+
owners: ["@workflow-team"],
|
|
237
|
+
tags: [
|
|
238
|
+
"workflow",
|
|
239
|
+
"approval",
|
|
240
|
+
"badge",
|
|
241
|
+
"widget"
|
|
242
|
+
]
|
|
243
|
+
},
|
|
244
|
+
source: {
|
|
245
|
+
type: "component",
|
|
246
|
+
framework: "react",
|
|
247
|
+
componentKey: "PendingApprovalsBadge"
|
|
248
|
+
},
|
|
249
|
+
targets: ["react"],
|
|
250
|
+
policy: { flags: ["workflow.approvals.enabled"] }
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* Workflow metrics dashboard widget.
|
|
254
|
+
*/
|
|
255
|
+
const WorkflowMetricsPresentation = {
|
|
256
|
+
meta: {
|
|
257
|
+
name: "workflow.metrics",
|
|
258
|
+
version: 1,
|
|
259
|
+
description: "Dashboard widget showing workflow metrics and statistics",
|
|
260
|
+
domain: "workflow-system",
|
|
261
|
+
owners: ["@workflow-team"],
|
|
262
|
+
tags: [
|
|
263
|
+
"workflow",
|
|
264
|
+
"metrics",
|
|
265
|
+
"dashboard"
|
|
266
|
+
]
|
|
267
|
+
},
|
|
268
|
+
source: {
|
|
269
|
+
type: "component",
|
|
270
|
+
framework: "react",
|
|
271
|
+
componentKey: "WorkflowMetricsDashboard"
|
|
272
|
+
},
|
|
273
|
+
targets: ["react", "markdown"],
|
|
274
|
+
policy: { flags: ["workflow.metrics.enabled"] }
|
|
275
|
+
};
|
|
276
|
+
const WorkflowSystemPresentations = {
|
|
277
|
+
WorkflowDesignerPresentation,
|
|
278
|
+
WorkflowListPresentation,
|
|
279
|
+
WorkflowDetailPresentation,
|
|
280
|
+
InstanceListPresentation,
|
|
281
|
+
InstanceDetailPresentation,
|
|
282
|
+
ProgressTrackerPresentation,
|
|
283
|
+
ApprovalInboxPresentation,
|
|
284
|
+
ApprovalDetailPresentation,
|
|
285
|
+
ApprovalFormPresentation,
|
|
286
|
+
PendingApprovalsBadgePresentation,
|
|
287
|
+
WorkflowMetricsPresentation
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
//#endregion
|
|
291
|
+
export { ApprovalDetailPresentation, ApprovalFormPresentation, ApprovalInboxPresentation, InstanceDetailPresentation, InstanceListPresentation, PendingApprovalsBadgePresentation, ProgressTrackerPresentation, WorkflowDesignerPresentation, WorkflowDetailPresentation, WorkflowListPresentation, WorkflowMetricsPresentation, WorkflowSystemPresentations };
|
package/dist/shared/index.js
CHANGED
package/dist/shared/mock-data.js
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/shared/mock-data.ts
|
|
2
|
+
const mockDataStore = {
|
|
3
|
+
workflows: /* @__PURE__ */ new Map(),
|
|
4
|
+
steps: /* @__PURE__ */ new Map(),
|
|
5
|
+
instances: /* @__PURE__ */ new Map(),
|
|
6
|
+
approvals: /* @__PURE__ */ new Map(),
|
|
7
|
+
stepExecutions: /* @__PURE__ */ new Map()
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { mockDataStore };
|
|
@@ -1 +1,157 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/state-machine/index.ts
|
|
2
|
+
/**
|
|
3
|
+
* Basic state machine engine implementation.
|
|
4
|
+
* This is a reference implementation for spec validation.
|
|
5
|
+
*/
|
|
6
|
+
var BasicStateMachineEngine = class {
|
|
7
|
+
canTransition(definition, state, action, context) {
|
|
8
|
+
if (state.status !== "RUNNING" && state.status !== "WAITING") return {
|
|
9
|
+
allowed: false,
|
|
10
|
+
reason: `Workflow is ${state.status}, cannot transition`
|
|
11
|
+
};
|
|
12
|
+
const currentStep = definition.steps[state.currentStepKey];
|
|
13
|
+
if (!currentStep) return {
|
|
14
|
+
allowed: false,
|
|
15
|
+
reason: `Step ${state.currentStepKey} not found`
|
|
16
|
+
};
|
|
17
|
+
const transition = currentStep.transitions[action];
|
|
18
|
+
if (!transition) return {
|
|
19
|
+
allowed: false,
|
|
20
|
+
reason: `Action ${action} not available in step ${state.currentStepKey}`
|
|
21
|
+
};
|
|
22
|
+
if (currentStep.allowedRoles && currentStep.allowedRoles.length > 0) {
|
|
23
|
+
if (!currentStep.allowedRoles.some((role) => context.userRoles.includes(role))) return {
|
|
24
|
+
allowed: false,
|
|
25
|
+
reason: `User lacks required role for this action`
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
if (typeof transition === "object" && transition.allowedRoles && transition.allowedRoles.length > 0) {
|
|
29
|
+
if (!transition.allowedRoles.some((role) => context.userRoles.includes(role))) return {
|
|
30
|
+
allowed: false,
|
|
31
|
+
reason: `User lacks required role for action ${action}`
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return { allowed: true };
|
|
35
|
+
}
|
|
36
|
+
getAvailableActions(definition, state, context) {
|
|
37
|
+
if (state.status !== "RUNNING" && state.status !== "WAITING") return [];
|
|
38
|
+
const currentStep = definition.steps[state.currentStepKey];
|
|
39
|
+
if (!currentStep) return [];
|
|
40
|
+
return Object.keys(currentStep.transitions).filter((action) => {
|
|
41
|
+
return this.canTransition(definition, state, action, context).allowed;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
transition(definition, state, action, context) {
|
|
45
|
+
const validation = this.canTransition(definition, state, action, context);
|
|
46
|
+
if (!validation.allowed) return {
|
|
47
|
+
success: false,
|
|
48
|
+
previousStepKey: state.currentStepKey,
|
|
49
|
+
currentStepKey: state.currentStepKey,
|
|
50
|
+
status: state.status,
|
|
51
|
+
error: validation.reason
|
|
52
|
+
};
|
|
53
|
+
const currentStep = definition.steps[state.currentStepKey];
|
|
54
|
+
if (!currentStep) return {
|
|
55
|
+
success: false,
|
|
56
|
+
previousStepKey: state.currentStepKey,
|
|
57
|
+
currentStepKey: state.currentStepKey,
|
|
58
|
+
status: state.status,
|
|
59
|
+
error: `Current step ${state.currentStepKey} not found`
|
|
60
|
+
};
|
|
61
|
+
const transition = currentStep.transitions[action];
|
|
62
|
+
if (!transition) return {
|
|
63
|
+
success: false,
|
|
64
|
+
previousStepKey: state.currentStepKey,
|
|
65
|
+
currentStepKey: state.currentStepKey,
|
|
66
|
+
status: state.status,
|
|
67
|
+
error: `Transition for action ${action} not found`
|
|
68
|
+
};
|
|
69
|
+
const targetStepKey = typeof transition === "string" ? transition : transition.targetStepKey;
|
|
70
|
+
const targetStep = definition.steps[targetStepKey];
|
|
71
|
+
if (!targetStep) return {
|
|
72
|
+
success: false,
|
|
73
|
+
previousStepKey: state.currentStepKey,
|
|
74
|
+
currentStepKey: state.currentStepKey,
|
|
75
|
+
status: state.status,
|
|
76
|
+
error: `Target step ${targetStepKey} not found`
|
|
77
|
+
};
|
|
78
|
+
let newStatus = "RUNNING";
|
|
79
|
+
if (targetStep.type === "END") newStatus = "COMPLETED";
|
|
80
|
+
else if (targetStep.type === "APPROVAL" || targetStep.type === "WAIT") newStatus = "WAITING";
|
|
81
|
+
return {
|
|
82
|
+
success: true,
|
|
83
|
+
previousStepKey: state.currentStepKey,
|
|
84
|
+
currentStepKey: targetStepKey,
|
|
85
|
+
status: newStatus
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
evaluateCondition(expression, contextData) {
|
|
89
|
+
try {
|
|
90
|
+
const match = expression.match(/^(\w+)\s*(>=|<=|>|<|===|!==|==|!=)\s*(.+)$/);
|
|
91
|
+
if (match) {
|
|
92
|
+
const [, prop, operator, value] = match;
|
|
93
|
+
if (!prop || !operator || value === void 0) return false;
|
|
94
|
+
const propValue = contextData[prop];
|
|
95
|
+
const compareValue = JSON.parse(value);
|
|
96
|
+
switch (operator) {
|
|
97
|
+
case ">": return Number(propValue) > Number(compareValue);
|
|
98
|
+
case "<": return Number(propValue) < Number(compareValue);
|
|
99
|
+
case ">=": return Number(propValue) >= Number(compareValue);
|
|
100
|
+
case "<=": return Number(propValue) <= Number(compareValue);
|
|
101
|
+
case "===":
|
|
102
|
+
case "==": return propValue === compareValue;
|
|
103
|
+
case "!==":
|
|
104
|
+
case "!=": return propValue !== compareValue;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (expression in contextData) return Boolean(contextData[expression]);
|
|
108
|
+
return false;
|
|
109
|
+
} catch {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Create a new state machine engine instance.
|
|
116
|
+
*/
|
|
117
|
+
function createStateMachineEngine() {
|
|
118
|
+
return new BasicStateMachineEngine();
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Build a state machine definition from workflow entities.
|
|
122
|
+
*/
|
|
123
|
+
function buildStateMachineDefinition(workflow, steps) {
|
|
124
|
+
const stepMap = {};
|
|
125
|
+
for (const step of steps) stepMap[step.key] = {
|
|
126
|
+
key: step.key,
|
|
127
|
+
name: step.name,
|
|
128
|
+
type: step.type,
|
|
129
|
+
transitions: step.transitions,
|
|
130
|
+
approvalMode: step.approvalMode,
|
|
131
|
+
allowedRoles: step.approverRoles,
|
|
132
|
+
timeoutSeconds: step.timeoutSeconds,
|
|
133
|
+
conditionExpression: step.conditionExpression
|
|
134
|
+
};
|
|
135
|
+
const initialStepKey = steps.find((s) => s.type === "START")?.key ?? steps[0]?.key ?? "";
|
|
136
|
+
return {
|
|
137
|
+
key: workflow.key,
|
|
138
|
+
name: workflow.name,
|
|
139
|
+
version: workflow.version,
|
|
140
|
+
initialStepKey,
|
|
141
|
+
steps: stepMap
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Create initial state for a new workflow instance.
|
|
146
|
+
*/
|
|
147
|
+
function createInitialState(definition, contextData = {}) {
|
|
148
|
+
return {
|
|
149
|
+
currentStepKey: definition.initialStepKey,
|
|
150
|
+
status: "RUNNING",
|
|
151
|
+
contextData,
|
|
152
|
+
history: []
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
//#endregion
|
|
157
|
+
export { BasicStateMachineEngine, buildStateMachineDefinition, createInitialState, createStateMachineEngine };
|
package/dist/workflow/index.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ApprovalModeEnum, StepTypeEnum, TriggerTypeEnum, WorkflowStatusEnum } from "./workflow.enum.js";
|
|
2
|
+
import { AddStepInputModel, CreateWorkflowInputModel, UpdateWorkflowInputModel, WorkflowDefinitionModel, WorkflowStepModel } from "./workflow.schema.js";
|
|
3
|
+
import { AddStepContract, CreateWorkflowContract, GetWorkflowContract, ListWorkflowsContract, PublishWorkflowContract, UpdateWorkflowContract } from "./workflow.contracts.js";
|
|
4
|
+
import { StepAddedEvent, WorkflowCreatedEvent, WorkflowPublishedEvent, WorkflowUpdatedEvent } from "./workflow.event.js";
|
|
5
|
+
|
|
6
|
+
export { AddStepContract, AddStepInputModel, ApprovalModeEnum, CreateWorkflowContract, CreateWorkflowInputModel, GetWorkflowContract, ListWorkflowsContract, PublishWorkflowContract, StepAddedEvent, StepTypeEnum, TriggerTypeEnum, UpdateWorkflowContract, UpdateWorkflowInputModel, WorkflowCreatedEvent, WorkflowDefinitionModel, WorkflowPublishedEvent, WorkflowStatusEnum, WorkflowStepModel, WorkflowUpdatedEvent };
|