@lssm/example.workflow-system 0.0.0-canary-20251217063201 → 0.0.0-canary-20251217073102
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.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 -1
- package/dist/libs/contracts/dist/client/index.js +5 -1
- package/dist/libs/contracts/dist/client/react/feature-render.js +2 -1
- package/dist/libs/contracts/dist/client/react/form-render.js +4 -1
- package/dist/libs/contracts/dist/client/react/index.js +4 -1
- package/dist/libs/contracts/dist/contract-registry/index.js +1 -1
- package/dist/libs/contracts/dist/contract-registry/schemas.js +60 -1
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +16 -76
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +16 -350
- package/dist/libs/contracts/dist/docs/index.js +29 -1
- package/dist/libs/contracts/dist/docs/presentations.js +71 -1
- package/dist/libs/contracts/dist/docs/registry.js +44 -1
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +16 -383
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +16 -68
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +16 -140
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +16 -86
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +16 -1
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +24 -2
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +21 -2
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +16 -213
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +73 -5
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +37 -1
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +16 -1
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +20 -262
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +48 -1
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +24 -2
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +23 -2
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +25 -16
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +67 -1
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +22 -2
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +40 -36
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +47 -1
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +23 -2
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +36 -3
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +20 -1
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +36 -3
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +20 -1
- package/dist/libs/contracts/dist/events.js +10 -1
- package/dist/libs/contracts/dist/experiments/evaluator.js +1 -1
- package/dist/libs/contracts/dist/index.js +71 -1
- package/dist/libs/contracts/dist/install.js +2 -1
- package/dist/libs/contracts/dist/integrations/contracts.js +377 -1
- package/dist/libs/contracts/dist/integrations/index.js +18 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +228 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +159 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +3 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +210 -1
- package/dist/libs/contracts/dist/integrations/openbanking/models.js +242 -1
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +13 -1
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +52 -1
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +75 -1
- package/dist/libs/contracts/dist/integrations/providers/gmail.js +87 -1
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +66 -1
- package/dist/libs/contracts/dist/integrations/providers/index.js +11 -1
- package/dist/libs/contracts/dist/integrations/providers/mistral.js +68 -1
- package/dist/libs/contracts/dist/integrations/providers/postmark.js +68 -1
- package/dist/libs/contracts/dist/integrations/providers/powens.js +116 -1
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js +73 -1
- package/dist/libs/contracts/dist/integrations/providers/registry.js +10 -1
- package/dist/libs/contracts/dist/integrations/providers/stripe.js +83 -1
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +61 -1
- package/dist/libs/contracts/dist/jsonschema.js +1 -1
- package/dist/libs/contracts/dist/knowledge/contracts.js +306 -1
- package/dist/libs/contracts/dist/knowledge/index.js +7 -1
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +34 -1
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +34 -1
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +38 -1
- package/dist/libs/contracts/dist/knowledge/spaces/index.js +6 -1
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +34 -1
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +37 -1
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +34 -1
- package/dist/libs/contracts/dist/llm/exporters.js +19 -1
- package/dist/libs/contracts/dist/llm/index.js +2 -1
- package/dist/libs/contracts/dist/llm/prompts.js +1 -1
- package/dist/libs/contracts/dist/onboarding-base.js +196 -1
- package/dist/libs/contracts/dist/openapi.js +1 -1
- package/dist/libs/contracts/dist/ownership.js +21 -1
- package/dist/libs/contracts/dist/presentations.js +1 -1
- package/dist/libs/contracts/dist/presentations.v2.js +11 -1
- package/dist/libs/contracts/dist/prompt.js +1 -1
- package/dist/libs/contracts/dist/promptRegistry.js +1 -1
- package/dist/libs/contracts/dist/regenerator/index.js +1 -1
- package/dist/libs/contracts/dist/regenerator/service.js +6 -1
- package/dist/libs/contracts/dist/registry.js +2 -1
- package/dist/libs/contracts/dist/resources.js +1 -1
- package/dist/libs/contracts/dist/schema/dist/EnumType.js +2 -1
- package/dist/libs/contracts/dist/schema/dist/FieldType.js +49 -1
- package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +236 -1
- package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +39 -1
- package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +1 -1
- package/dist/libs/contracts/dist/schema/dist/entity/index.js +2 -1
- package/dist/libs/contracts/dist/schema/dist/entity/types.js +1 -1
- package/dist/libs/contracts/dist/schema/dist/index.js +6 -1
- package/dist/libs/contracts/dist/server/graphql-pothos.js +6 -1
- package/dist/libs/contracts/dist/server/index.js +8 -1
- package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +4 -1
- package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +2 -1
- package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +1 -1
- package/dist/libs/contracts/dist/server/mcp/registerResources.js +2 -1
- package/dist/libs/contracts/dist/server/mcp/registerTools.js +1 -1
- package/dist/libs/contracts/dist/server/provider-mcp.js +1 -1
- package/dist/libs/contracts/dist/server/rest-elysia.js +1 -1
- package/dist/libs/contracts/dist/server/rest-express.js +1 -1
- package/dist/libs/contracts/dist/server/rest-generic.js +1 -1
- package/dist/libs/contracts/dist/server/rest-next-app.js +1 -1
- package/dist/libs/contracts/dist/server/rest-next-pages.js +1 -1
- package/dist/libs/contracts/dist/spec.js +34 -1
- package/dist/libs/contracts/dist/telemetry/index.js +1 -1
- package/dist/libs/contracts/dist/telemetry/tracker.js +1 -1
- package/dist/libs/contracts/dist/tests/index.js +1 -1
- package/dist/libs/contracts/dist/tests/runner.js +2 -1
- package/dist/libs/contracts/dist/workflow/index.js +1 -1
- package/dist/libs/contracts/dist/workflow/runner.js +1 -1
- package/dist/libs/schema/dist/EnumType.js +56 -1
- package/dist/libs/schema/dist/FieldType.js +49 -1
- package/dist/libs/schema/dist/ScalarTypeEnum.js +236 -1
- package/dist/libs/schema/dist/SchemaModel.js +39 -1
- package/dist/libs/schema/dist/entity/defineEntity.js +236 -1
- package/dist/libs/schema/dist/entity/index.js +2 -1
- package/dist/libs/schema/dist/entity/types.js +1 -1
- package/dist/libs/schema/dist/index.js +6 -1
- 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 +246 -246
- package/dist/workflow/workflow.contracts.js +239 -1
- package/dist/workflow/workflow.enum.d.ts +5 -5
- package/dist/workflow/workflow.enum.js +47 -1
- package/dist/workflow/workflow.event.d.ts +33 -33
- package/dist/workflow/workflow.event.js +116 -1
- package/dist/workflow/workflow.handler.js +65 -1
- package/dist/workflow/workflow.schema.d.ts +63 -63
- package/dist/workflow/workflow.schema.js +250 -1
- package/dist/workflow-system.feature.js +337 -1
- package/package.json +11 -11
package/dist/entities/step.d.ts
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _lssm_lib_schema889 from "@lssm/lib.schema";
|
|
2
2
|
|
|
3
3
|
//#region src/entities/step.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Step type enum - what kind of step this is.
|
|
6
6
|
*/
|
|
7
|
-
declare const StepTypeEnum:
|
|
7
|
+
declare const StepTypeEnum: _lssm_lib_schema889.EntityEnumDef;
|
|
8
8
|
/**
|
|
9
9
|
* Approval mode enum - how approvals are handled.
|
|
10
10
|
*/
|
|
11
|
-
declare const ApprovalModeEnum:
|
|
11
|
+
declare const ApprovalModeEnum: _lssm_lib_schema889.EntityEnumDef;
|
|
12
12
|
/**
|
|
13
13
|
* WorkflowStep entity - defines a step in a workflow.
|
|
14
14
|
*
|
|
15
15
|
* Each step represents a state in the workflow state machine,
|
|
16
16
|
* with transitions defined by the `transitions` JSON field.
|
|
17
17
|
*/
|
|
18
|
-
declare const WorkflowStepEntity:
|
|
19
|
-
id:
|
|
20
|
-
workflowDefinitionId:
|
|
21
|
-
name:
|
|
22
|
-
key:
|
|
23
|
-
description:
|
|
24
|
-
type:
|
|
25
|
-
position:
|
|
26
|
-
transitions:
|
|
27
|
-
approvalMode:
|
|
28
|
-
approverRoles:
|
|
29
|
-
approverUserIds:
|
|
30
|
-
escalationConfig:
|
|
31
|
-
assigneeRoles:
|
|
32
|
-
taskTemplate:
|
|
33
|
-
conditionExpression:
|
|
34
|
-
waitDuration:
|
|
35
|
-
waitForEvent:
|
|
36
|
-
actionType:
|
|
37
|
-
actionConfig:
|
|
38
|
-
timeoutSeconds:
|
|
39
|
-
slaSeconds:
|
|
40
|
-
notifyOnEnter:
|
|
41
|
-
notifyOnExit:
|
|
42
|
-
metadata:
|
|
43
|
-
createdAt:
|
|
44
|
-
updatedAt:
|
|
45
|
-
workflowDefinition:
|
|
46
|
-
executions:
|
|
18
|
+
declare const WorkflowStepEntity: _lssm_lib_schema889.EntitySpec<{
|
|
19
|
+
id: _lssm_lib_schema889.EntityScalarField;
|
|
20
|
+
workflowDefinitionId: _lssm_lib_schema889.EntityScalarField;
|
|
21
|
+
name: _lssm_lib_schema889.EntityScalarField;
|
|
22
|
+
key: _lssm_lib_schema889.EntityScalarField;
|
|
23
|
+
description: _lssm_lib_schema889.EntityScalarField;
|
|
24
|
+
type: _lssm_lib_schema889.EntityEnumField;
|
|
25
|
+
position: _lssm_lib_schema889.EntityScalarField;
|
|
26
|
+
transitions: _lssm_lib_schema889.EntityScalarField;
|
|
27
|
+
approvalMode: _lssm_lib_schema889.EntityEnumField;
|
|
28
|
+
approverRoles: _lssm_lib_schema889.EntityScalarField;
|
|
29
|
+
approverUserIds: _lssm_lib_schema889.EntityScalarField;
|
|
30
|
+
escalationConfig: _lssm_lib_schema889.EntityScalarField;
|
|
31
|
+
assigneeRoles: _lssm_lib_schema889.EntityScalarField;
|
|
32
|
+
taskTemplate: _lssm_lib_schema889.EntityScalarField;
|
|
33
|
+
conditionExpression: _lssm_lib_schema889.EntityScalarField;
|
|
34
|
+
waitDuration: _lssm_lib_schema889.EntityScalarField;
|
|
35
|
+
waitForEvent: _lssm_lib_schema889.EntityScalarField;
|
|
36
|
+
actionType: _lssm_lib_schema889.EntityScalarField;
|
|
37
|
+
actionConfig: _lssm_lib_schema889.EntityScalarField;
|
|
38
|
+
timeoutSeconds: _lssm_lib_schema889.EntityScalarField;
|
|
39
|
+
slaSeconds: _lssm_lib_schema889.EntityScalarField;
|
|
40
|
+
notifyOnEnter: _lssm_lib_schema889.EntityScalarField;
|
|
41
|
+
notifyOnExit: _lssm_lib_schema889.EntityScalarField;
|
|
42
|
+
metadata: _lssm_lib_schema889.EntityScalarField;
|
|
43
|
+
createdAt: _lssm_lib_schema889.EntityScalarField;
|
|
44
|
+
updatedAt: _lssm_lib_schema889.EntityScalarField;
|
|
45
|
+
workflowDefinition: _lssm_lib_schema889.EntityRelationField;
|
|
46
|
+
executions: _lssm_lib_schema889.EntityRelationField;
|
|
47
47
|
}>;
|
|
48
48
|
//#endregion
|
|
49
49
|
export { ApprovalModeEnum, StepTypeEnum, WorkflowStepEntity };
|
package/dist/entities/step.js
CHANGED
|
@@ -1 +1,135 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { defineEntity, defineEntityEnum, field, index } from "../libs/schema/dist/entity/defineEntity.js";
|
|
2
|
+
import "../libs/schema/dist/index.js";
|
|
3
|
+
|
|
4
|
+
//#region src/entities/step.ts
|
|
5
|
+
/**
|
|
6
|
+
* Step type enum - what kind of step this is.
|
|
7
|
+
*/
|
|
8
|
+
const StepTypeEnum = defineEntityEnum({
|
|
9
|
+
name: "StepType",
|
|
10
|
+
values: [
|
|
11
|
+
"START",
|
|
12
|
+
"APPROVAL",
|
|
13
|
+
"TASK",
|
|
14
|
+
"CONDITION",
|
|
15
|
+
"PARALLEL",
|
|
16
|
+
"WAIT",
|
|
17
|
+
"ACTION",
|
|
18
|
+
"END"
|
|
19
|
+
],
|
|
20
|
+
schema: "workflow",
|
|
21
|
+
description: "Type of workflow step."
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Approval mode enum - how approvals are handled.
|
|
25
|
+
*/
|
|
26
|
+
const ApprovalModeEnum = defineEntityEnum({
|
|
27
|
+
name: "ApprovalMode",
|
|
28
|
+
values: [
|
|
29
|
+
"ANY",
|
|
30
|
+
"ALL",
|
|
31
|
+
"MAJORITY",
|
|
32
|
+
"SEQUENTIAL"
|
|
33
|
+
],
|
|
34
|
+
schema: "workflow",
|
|
35
|
+
description: "How multiple approvers are handled."
|
|
36
|
+
});
|
|
37
|
+
/**
|
|
38
|
+
* WorkflowStep entity - defines a step in a workflow.
|
|
39
|
+
*
|
|
40
|
+
* Each step represents a state in the workflow state machine,
|
|
41
|
+
* with transitions defined by the `transitions` JSON field.
|
|
42
|
+
*/
|
|
43
|
+
const WorkflowStepEntity = defineEntity({
|
|
44
|
+
name: "WorkflowStep",
|
|
45
|
+
description: "A single step/state in a workflow definition.",
|
|
46
|
+
schema: "workflow",
|
|
47
|
+
map: "workflow_step",
|
|
48
|
+
fields: {
|
|
49
|
+
id: field.id({ description: "Unique step ID" }),
|
|
50
|
+
workflowDefinitionId: field.foreignKey(),
|
|
51
|
+
name: field.string({ description: "Human-readable step name" }),
|
|
52
|
+
key: field.string({ description: "Unique key within workflow (e.g., \"manager_approval\")" }),
|
|
53
|
+
description: field.string({ isOptional: true }),
|
|
54
|
+
type: field.enum("StepType", { default: "TASK" }),
|
|
55
|
+
position: field.int({
|
|
56
|
+
default: 0,
|
|
57
|
+
description: "Order for display"
|
|
58
|
+
}),
|
|
59
|
+
transitions: field.json({ description: "Map of action -> next step key" }),
|
|
60
|
+
approvalMode: field.enum("ApprovalMode", {
|
|
61
|
+
default: "ANY",
|
|
62
|
+
isOptional: true
|
|
63
|
+
}),
|
|
64
|
+
approverRoles: field.string({
|
|
65
|
+
isArray: true,
|
|
66
|
+
description: "Roles that can approve"
|
|
67
|
+
}),
|
|
68
|
+
approverUserIds: field.string({
|
|
69
|
+
isArray: true,
|
|
70
|
+
description: "Specific users that can approve"
|
|
71
|
+
}),
|
|
72
|
+
escalationConfig: field.json({
|
|
73
|
+
isOptional: true,
|
|
74
|
+
description: "Escalation rules"
|
|
75
|
+
}),
|
|
76
|
+
assigneeRoles: field.string({
|
|
77
|
+
isArray: true,
|
|
78
|
+
description: "Roles that can be assigned"
|
|
79
|
+
}),
|
|
80
|
+
taskTemplate: field.json({
|
|
81
|
+
isOptional: true,
|
|
82
|
+
description: "Template for task creation"
|
|
83
|
+
}),
|
|
84
|
+
conditionExpression: field.string({
|
|
85
|
+
isOptional: true,
|
|
86
|
+
description: "Expression for branching"
|
|
87
|
+
}),
|
|
88
|
+
waitDuration: field.int({
|
|
89
|
+
isOptional: true,
|
|
90
|
+
description: "Wait duration in seconds"
|
|
91
|
+
}),
|
|
92
|
+
waitForEvent: field.string({
|
|
93
|
+
isOptional: true,
|
|
94
|
+
description: "Event name to wait for"
|
|
95
|
+
}),
|
|
96
|
+
actionType: field.string({
|
|
97
|
+
isOptional: true,
|
|
98
|
+
description: "Action to execute"
|
|
99
|
+
}),
|
|
100
|
+
actionConfig: field.json({
|
|
101
|
+
isOptional: true,
|
|
102
|
+
description: "Action parameters"
|
|
103
|
+
}),
|
|
104
|
+
timeoutSeconds: field.int({
|
|
105
|
+
isOptional: true,
|
|
106
|
+
description: "Step timeout"
|
|
107
|
+
}),
|
|
108
|
+
slaSeconds: field.int({
|
|
109
|
+
isOptional: true,
|
|
110
|
+
description: "SLA deadline"
|
|
111
|
+
}),
|
|
112
|
+
notifyOnEnter: field.json({
|
|
113
|
+
isOptional: true,
|
|
114
|
+
description: "Notification config when entering step"
|
|
115
|
+
}),
|
|
116
|
+
notifyOnExit: field.json({
|
|
117
|
+
isOptional: true,
|
|
118
|
+
description: "Notification config when exiting step"
|
|
119
|
+
}),
|
|
120
|
+
metadata: field.json({ isOptional: true }),
|
|
121
|
+
createdAt: field.createdAt(),
|
|
122
|
+
updatedAt: field.updatedAt(),
|
|
123
|
+
workflowDefinition: field.belongsTo("WorkflowDefinition", ["workflowDefinitionId"], ["id"], { onDelete: "Cascade" }),
|
|
124
|
+
executions: field.hasMany("StepExecution")
|
|
125
|
+
},
|
|
126
|
+
indexes: [
|
|
127
|
+
index.unique(["workflowDefinitionId", "key"]),
|
|
128
|
+
index.on(["workflowDefinitionId", "position"]),
|
|
129
|
+
index.on(["type"])
|
|
130
|
+
],
|
|
131
|
+
enums: [StepTypeEnum, ApprovalModeEnum]
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
//#endregion
|
|
135
|
+
export { ApprovalModeEnum, StepTypeEnum, WorkflowStepEntity };
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _lssm_lib_schema1104 from "@lssm/lib.schema";
|
|
2
2
|
|
|
3
3
|
//#region src/entities/workflow.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Workflow status enum - the lifecycle state of a workflow definition.
|
|
6
6
|
*/
|
|
7
|
-
declare const WorkflowStatusEnum:
|
|
7
|
+
declare const WorkflowStatusEnum: _lssm_lib_schema1104.EntityEnumDef;
|
|
8
8
|
/**
|
|
9
9
|
* Workflow trigger type enum - what initiates a workflow.
|
|
10
10
|
*/
|
|
11
|
-
declare const WorkflowTriggerTypeEnum:
|
|
11
|
+
declare const WorkflowTriggerTypeEnum: _lssm_lib_schema1104.EntityEnumDef;
|
|
12
12
|
/**
|
|
13
13
|
* WorkflowDefinition entity - defines a workflow blueprint.
|
|
14
14
|
*
|
|
15
15
|
* A workflow definition specifies the structure, steps, and rules
|
|
16
16
|
* for a business process. Instances are created from definitions.
|
|
17
17
|
*/
|
|
18
|
-
declare const WorkflowDefinitionEntity:
|
|
19
|
-
id:
|
|
20
|
-
name:
|
|
21
|
-
key:
|
|
22
|
-
description:
|
|
23
|
-
version:
|
|
24
|
-
status:
|
|
25
|
-
triggerType:
|
|
26
|
-
triggerConfig:
|
|
27
|
-
initialStepId:
|
|
28
|
-
featureFlagKey:
|
|
29
|
-
settings:
|
|
30
|
-
metadata:
|
|
31
|
-
organizationId:
|
|
32
|
-
createdBy:
|
|
33
|
-
createdAt:
|
|
34
|
-
updatedAt:
|
|
35
|
-
publishedAt:
|
|
36
|
-
steps:
|
|
37
|
-
instances:
|
|
18
|
+
declare const WorkflowDefinitionEntity: _lssm_lib_schema1104.EntitySpec<{
|
|
19
|
+
id: _lssm_lib_schema1104.EntityScalarField;
|
|
20
|
+
name: _lssm_lib_schema1104.EntityScalarField;
|
|
21
|
+
key: _lssm_lib_schema1104.EntityScalarField;
|
|
22
|
+
description: _lssm_lib_schema1104.EntityScalarField;
|
|
23
|
+
version: _lssm_lib_schema1104.EntityScalarField;
|
|
24
|
+
status: _lssm_lib_schema1104.EntityEnumField;
|
|
25
|
+
triggerType: _lssm_lib_schema1104.EntityEnumField;
|
|
26
|
+
triggerConfig: _lssm_lib_schema1104.EntityScalarField;
|
|
27
|
+
initialStepId: _lssm_lib_schema1104.EntityScalarField;
|
|
28
|
+
featureFlagKey: _lssm_lib_schema1104.EntityScalarField;
|
|
29
|
+
settings: _lssm_lib_schema1104.EntityScalarField;
|
|
30
|
+
metadata: _lssm_lib_schema1104.EntityScalarField;
|
|
31
|
+
organizationId: _lssm_lib_schema1104.EntityScalarField;
|
|
32
|
+
createdBy: _lssm_lib_schema1104.EntityScalarField;
|
|
33
|
+
createdAt: _lssm_lib_schema1104.EntityScalarField;
|
|
34
|
+
updatedAt: _lssm_lib_schema1104.EntityScalarField;
|
|
35
|
+
publishedAt: _lssm_lib_schema1104.EntityScalarField;
|
|
36
|
+
steps: _lssm_lib_schema1104.EntityRelationField;
|
|
37
|
+
instances: _lssm_lib_schema1104.EntityRelationField;
|
|
38
38
|
}>;
|
|
39
39
|
//#endregion
|
|
40
40
|
export { WorkflowDefinitionEntity, WorkflowStatusEnum, WorkflowTriggerTypeEnum };
|
|
@@ -1 +1,102 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { defineEntity, defineEntityEnum, field, index } from "../libs/schema/dist/entity/defineEntity.js";
|
|
2
|
+
import "../libs/schema/dist/index.js";
|
|
3
|
+
|
|
4
|
+
//#region src/entities/workflow.ts
|
|
5
|
+
/**
|
|
6
|
+
* Workflow status enum - the lifecycle state of a workflow definition.
|
|
7
|
+
*/
|
|
8
|
+
const WorkflowStatusEnum = defineEntityEnum({
|
|
9
|
+
name: "WorkflowStatus",
|
|
10
|
+
values: [
|
|
11
|
+
"DRAFT",
|
|
12
|
+
"ACTIVE",
|
|
13
|
+
"DEPRECATED",
|
|
14
|
+
"ARCHIVED"
|
|
15
|
+
],
|
|
16
|
+
schema: "workflow",
|
|
17
|
+
description: "Status of a workflow definition."
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* Workflow trigger type enum - what initiates a workflow.
|
|
21
|
+
*/
|
|
22
|
+
const WorkflowTriggerTypeEnum = defineEntityEnum({
|
|
23
|
+
name: "WorkflowTriggerType",
|
|
24
|
+
values: [
|
|
25
|
+
"MANUAL",
|
|
26
|
+
"EVENT",
|
|
27
|
+
"SCHEDULED",
|
|
28
|
+
"API"
|
|
29
|
+
],
|
|
30
|
+
schema: "workflow",
|
|
31
|
+
description: "What triggers workflow instantiation."
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* WorkflowDefinition entity - defines a workflow blueprint.
|
|
35
|
+
*
|
|
36
|
+
* A workflow definition specifies the structure, steps, and rules
|
|
37
|
+
* for a business process. Instances are created from definitions.
|
|
38
|
+
*/
|
|
39
|
+
const WorkflowDefinitionEntity = defineEntity({
|
|
40
|
+
name: "WorkflowDefinition",
|
|
41
|
+
description: "A workflow blueprint that defines the process structure.",
|
|
42
|
+
schema: "workflow",
|
|
43
|
+
map: "workflow_definition",
|
|
44
|
+
fields: {
|
|
45
|
+
id: field.id({ description: "Unique workflow definition ID" }),
|
|
46
|
+
name: field.string({ description: "Human-readable workflow name" }),
|
|
47
|
+
key: field.string({ description: "Unique key for referencing (e.g., \"purchase_approval\")" }),
|
|
48
|
+
description: field.string({
|
|
49
|
+
isOptional: true,
|
|
50
|
+
description: "Detailed description"
|
|
51
|
+
}),
|
|
52
|
+
version: field.int({
|
|
53
|
+
default: 1,
|
|
54
|
+
description: "Version number for versioning definitions"
|
|
55
|
+
}),
|
|
56
|
+
status: field.enum("WorkflowStatus", { default: "DRAFT" }),
|
|
57
|
+
triggerType: field.enum("WorkflowTriggerType", { default: "MANUAL" }),
|
|
58
|
+
triggerConfig: field.json({
|
|
59
|
+
isOptional: true,
|
|
60
|
+
description: "Trigger-specific configuration"
|
|
61
|
+
}),
|
|
62
|
+
initialStepId: field.string({
|
|
63
|
+
isOptional: true,
|
|
64
|
+
description: "First step when workflow starts"
|
|
65
|
+
}),
|
|
66
|
+
featureFlagKey: field.string({
|
|
67
|
+
isOptional: true,
|
|
68
|
+
description: "Feature flag to control availability"
|
|
69
|
+
}),
|
|
70
|
+
settings: field.json({
|
|
71
|
+
isOptional: true,
|
|
72
|
+
description: "Workflow-wide settings"
|
|
73
|
+
}),
|
|
74
|
+
metadata: field.json({
|
|
75
|
+
isOptional: true,
|
|
76
|
+
description: "Custom metadata"
|
|
77
|
+
}),
|
|
78
|
+
organizationId: field.foreignKey({ description: "Owning organization" }),
|
|
79
|
+
createdBy: field.foreignKey({ description: "User who created this workflow" }),
|
|
80
|
+
createdAt: field.createdAt(),
|
|
81
|
+
updatedAt: field.updatedAt(),
|
|
82
|
+
publishedAt: field.dateTime({
|
|
83
|
+
isOptional: true,
|
|
84
|
+
description: "When workflow was activated"
|
|
85
|
+
}),
|
|
86
|
+
steps: field.hasMany("WorkflowStep"),
|
|
87
|
+
instances: field.hasMany("WorkflowInstance")
|
|
88
|
+
},
|
|
89
|
+
indexes: [
|
|
90
|
+
index.unique([
|
|
91
|
+
"organizationId",
|
|
92
|
+
"key",
|
|
93
|
+
"version"
|
|
94
|
+
]),
|
|
95
|
+
index.on(["organizationId", "status"]),
|
|
96
|
+
index.on(["key", "version"])
|
|
97
|
+
],
|
|
98
|
+
enums: [WorkflowStatusEnum, WorkflowTriggerTypeEnum]
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
//#endregion
|
|
102
|
+
export { WorkflowDefinitionEntity, WorkflowStatusEnum, WorkflowTriggerTypeEnum };
|
package/dist/example.js
CHANGED
|
@@ -1 +1,50 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/example.ts
|
|
2
|
+
const example = {
|
|
3
|
+
id: "workflow-system",
|
|
4
|
+
title: "Workflow / Approval System",
|
|
5
|
+
summary: "State-machine driven approvals with RBAC, audit trail, notifications, and jobs.",
|
|
6
|
+
tags: [
|
|
7
|
+
"workflow",
|
|
8
|
+
"approval",
|
|
9
|
+
"state-machine",
|
|
10
|
+
"rbac"
|
|
11
|
+
],
|
|
12
|
+
kind: "template",
|
|
13
|
+
visibility: "public",
|
|
14
|
+
docs: {
|
|
15
|
+
rootDocId: "docs.examples.workflow-system",
|
|
16
|
+
goalDocId: "docs.examples.workflow-system.goal",
|
|
17
|
+
usageDocId: "docs.examples.workflow-system.usage",
|
|
18
|
+
constraintsDocId: "docs.examples.workflow-system.constraints"
|
|
19
|
+
},
|
|
20
|
+
entrypoints: {
|
|
21
|
+
packageName: "@lssm/example.workflow-system",
|
|
22
|
+
feature: "./feature",
|
|
23
|
+
contracts: "./contracts",
|
|
24
|
+
presentations: "./presentations",
|
|
25
|
+
handlers: "./handlers",
|
|
26
|
+
docs: "./docs"
|
|
27
|
+
},
|
|
28
|
+
surfaces: {
|
|
29
|
+
templates: true,
|
|
30
|
+
sandbox: {
|
|
31
|
+
enabled: true,
|
|
32
|
+
modes: [
|
|
33
|
+
"playground",
|
|
34
|
+
"specs",
|
|
35
|
+
"builder",
|
|
36
|
+
"markdown",
|
|
37
|
+
"evolution"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
studio: {
|
|
41
|
+
enabled: true,
|
|
42
|
+
installable: true
|
|
43
|
+
},
|
|
44
|
+
mcp: { enabled: true }
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var example_default = example;
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export { example_default as default };
|
package/dist/index.js
CHANGED
|
@@ -1 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ApprovalModeEnum, StepTypeEnum, TriggerTypeEnum, WorkflowStatusEnum } from "./workflow/workflow.enum.js";
|
|
2
|
+
import { AddStepInputModel, CreateWorkflowInputModel, UpdateWorkflowInputModel, WorkflowDefinitionModel, WorkflowStepModel } from "./workflow/workflow.schema.js";
|
|
3
|
+
import { AddStepContract, CreateWorkflowContract, GetWorkflowContract, ListWorkflowsContract, PublishWorkflowContract, UpdateWorkflowContract } from "./workflow/workflow.contracts.js";
|
|
4
|
+
import { StepAddedEvent, WorkflowCreatedEvent, WorkflowPublishedEvent, WorkflowUpdatedEvent } from "./workflow/workflow.event.js";
|
|
5
|
+
import "./workflow/index.js";
|
|
6
|
+
import { InstanceStatusEnum } from "./instance/instance.enum.js";
|
|
7
|
+
import { StartWorkflowInputModel, TransitionInputModel, TransitionResultModel, WorkflowInstanceModel } from "./instance/instance.schema.js";
|
|
8
|
+
import { CancelWorkflowContract, GetInstanceContract, ListInstancesContract, PauseWorkflowContract, ResumeWorkflowContract, StartWorkflowContract, TransitionWorkflowContract } from "./instance/instance.contracts.js";
|
|
9
|
+
import { InstanceCancelledEvent, InstanceCompletedEvent, InstanceFailedEvent, InstancePausedEvent, InstanceResumedEvent, InstanceStartedEvent, InstanceTimedOutEvent, StepEnteredEvent, StepExitedEvent } from "./instance/instance.event.js";
|
|
10
|
+
import "./instance/index.js";
|
|
11
|
+
import { ApprovalDecisionEnum, ApprovalStatusEnum } from "./approval/approval.enum.js";
|
|
12
|
+
import { ApprovalCommentModel, ApprovalRequestModel } from "./approval/approval.schema.js";
|
|
13
|
+
import { AddApprovalCommentContract, DelegateApprovalContract, GetApprovalContract, ListMyApprovalsContract, SubmitDecisionContract } from "./approval/approval.contracts.js";
|
|
14
|
+
import { ApprovalDecidedEvent, ApprovalDelegatedEvent, ApprovalEscalatedEvent, ApprovalRequestedEvent } from "./approval/approval.event.js";
|
|
15
|
+
import "./approval/index.js";
|
|
16
|
+
import { mockDataStore } from "./shared/mock-data.js";
|
|
17
|
+
import { BasicStateMachineEngine, buildStateMachineDefinition, createInitialState, createStateMachineEngine } from "./state-machine/index.js";
|
|
18
|
+
|
|
19
|
+
export { AddApprovalCommentContract, AddStepContract, AddStepInputModel, ApprovalCommentModel, ApprovalDecidedEvent, ApprovalDecisionEnum, ApprovalDelegatedEvent, ApprovalEscalatedEvent, ApprovalModeEnum, ApprovalRequestModel, ApprovalRequestedEvent, ApprovalStatusEnum, BasicStateMachineEngine, CancelWorkflowContract, CreateWorkflowContract, CreateWorkflowInputModel, DelegateApprovalContract, GetApprovalContract, GetInstanceContract, GetWorkflowContract, InstanceCancelledEvent, InstanceCompletedEvent, InstanceFailedEvent, InstancePausedEvent, InstanceResumedEvent, InstanceStartedEvent, InstanceStatusEnum, InstanceTimedOutEvent, ListInstancesContract, ListMyApprovalsContract, ListWorkflowsContract, PauseWorkflowContract, PublishWorkflowContract, ResumeWorkflowContract, StartWorkflowContract, StartWorkflowInputModel, StepAddedEvent, StepEnteredEvent, StepExitedEvent, StepTypeEnum, SubmitDecisionContract, TransitionInputModel, TransitionResultModel, TransitionWorkflowContract, TriggerTypeEnum, UpdateWorkflowContract, UpdateWorkflowInputModel, WorkflowCreatedEvent, WorkflowDefinitionModel, WorkflowInstanceModel, WorkflowPublishedEvent, WorkflowStatusEnum, WorkflowStepModel, WorkflowUpdatedEvent, buildStateMachineDefinition, createInitialState, createStateMachineEngine, mockDataStore };
|
package/dist/instance/index.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { InstanceStatusEnum } from "./instance.enum.js";
|
|
2
|
+
import { StartWorkflowInputModel, TransitionInputModel, TransitionResultModel, WorkflowInstanceModel } from "./instance.schema.js";
|
|
3
|
+
import { CancelWorkflowContract, GetInstanceContract, ListInstancesContract, PauseWorkflowContract, ResumeWorkflowContract, StartWorkflowContract, TransitionWorkflowContract } from "./instance.contracts.js";
|
|
4
|
+
import { InstanceCancelledEvent, InstanceCompletedEvent, InstanceFailedEvent, InstancePausedEvent, InstanceResumedEvent, InstanceStartedEvent, InstanceTimedOutEvent, StepEnteredEvent, StepExitedEvent } from "./instance.event.js";
|
|
5
|
+
|
|
6
|
+
export { CancelWorkflowContract, GetInstanceContract, InstanceCancelledEvent, InstanceCompletedEvent, InstanceFailedEvent, InstancePausedEvent, InstanceResumedEvent, InstanceStartedEvent, InstanceStatusEnum, InstanceTimedOutEvent, ListInstancesContract, PauseWorkflowContract, ResumeWorkflowContract, StartWorkflowContract, StartWorkflowInputModel, StepEnteredEvent, StepExitedEvent, TransitionInputModel, TransitionResultModel, TransitionWorkflowContract, WorkflowInstanceModel };
|