@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,93 @@
|
|
|
1
|
-
import{mockDataStore
|
|
1
|
+
import { mockDataStore } from "../shared/mock-data.js";
|
|
2
|
+
import { buildStateMachineDefinition, createStateMachineEngine } from "../state-machine/index.js";
|
|
3
|
+
import { createApprovalRequests } from "../approval/approval.handler.js";
|
|
4
|
+
|
|
5
|
+
//#region src/instance/instance.handler.ts
|
|
6
|
+
async function handleStartWorkflow(input, context) {
|
|
7
|
+
const workflow = Array.from(mockDataStore.workflows.values()).find((w) => w.key === input.workflowKey && w.status === "ACTIVE" && w.organizationId === context.organizationId);
|
|
8
|
+
if (!workflow) throw new Error(`Active workflow ${input.workflowKey} not found`);
|
|
9
|
+
const id = `inst_${Date.now()}`;
|
|
10
|
+
const now = /* @__PURE__ */ new Date();
|
|
11
|
+
const instance = {
|
|
12
|
+
id,
|
|
13
|
+
workflowDefinitionId: workflow.id,
|
|
14
|
+
referenceId: input.referenceId,
|
|
15
|
+
referenceType: input.referenceType,
|
|
16
|
+
status: "RUNNING",
|
|
17
|
+
currentStepId: workflow.initialStepId,
|
|
18
|
+
contextData: input.contextData ?? {},
|
|
19
|
+
triggeredBy: context.userId,
|
|
20
|
+
organizationId: context.organizationId,
|
|
21
|
+
priority: input.priority ?? 0,
|
|
22
|
+
dueAt: input.dueAt,
|
|
23
|
+
createdAt: now,
|
|
24
|
+
updatedAt: now,
|
|
25
|
+
startedAt: now
|
|
26
|
+
};
|
|
27
|
+
mockDataStore.instances.set(id, instance);
|
|
28
|
+
if (workflow.initialStepId) {
|
|
29
|
+
const firstStep = mockDataStore.steps.get(workflow.initialStepId);
|
|
30
|
+
if (firstStep?.type === "APPROVAL") {
|
|
31
|
+
instance.status = "WAITING";
|
|
32
|
+
await createApprovalRequests(instance, firstStep, context);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return instance;
|
|
36
|
+
}
|
|
37
|
+
async function handleTransitionWorkflow(input, context) {
|
|
38
|
+
const instance = mockDataStore.instances.get(input.instanceId);
|
|
39
|
+
if (!instance) throw new Error(`Instance ${input.instanceId} not found`);
|
|
40
|
+
const workflow = mockDataStore.workflows.get(instance.workflowDefinitionId);
|
|
41
|
+
if (!workflow) throw new Error(`Workflow ${instance.workflowDefinitionId} not found`);
|
|
42
|
+
const steps = Array.from(mockDataStore.steps.values()).filter((s) => s.workflowDefinitionId === workflow.id);
|
|
43
|
+
const definition = buildStateMachineDefinition({
|
|
44
|
+
key: workflow.key,
|
|
45
|
+
name: workflow.name,
|
|
46
|
+
version: workflow.version,
|
|
47
|
+
initialStepId: workflow.initialStepId ?? null
|
|
48
|
+
}, steps);
|
|
49
|
+
const currentStep = steps.find((s) => s.id === instance.currentStepId);
|
|
50
|
+
const state = {
|
|
51
|
+
currentStepKey: currentStep?.key ?? "",
|
|
52
|
+
status: instance.status,
|
|
53
|
+
contextData: instance.contextData,
|
|
54
|
+
history: []
|
|
55
|
+
};
|
|
56
|
+
const transitionContext = {
|
|
57
|
+
userId: context.userId,
|
|
58
|
+
userRoles: context.userRoles,
|
|
59
|
+
data: input.data
|
|
60
|
+
};
|
|
61
|
+
const result = createStateMachineEngine().transition(definition, state, input.action, transitionContext);
|
|
62
|
+
if (!result.success) return {
|
|
63
|
+
success: false,
|
|
64
|
+
instance,
|
|
65
|
+
message: result.error
|
|
66
|
+
};
|
|
67
|
+
const previousStepKey = currentStep?.key;
|
|
68
|
+
const newStep = steps.find((s) => s.key === result.currentStepKey);
|
|
69
|
+
instance.currentStepId = newStep?.id;
|
|
70
|
+
instance.status = result.status;
|
|
71
|
+
instance.contextData = {
|
|
72
|
+
...instance.contextData,
|
|
73
|
+
...input.data
|
|
74
|
+
};
|
|
75
|
+
instance.updatedAt = /* @__PURE__ */ new Date();
|
|
76
|
+
if (result.status === "COMPLETED") {
|
|
77
|
+
instance.completedAt = /* @__PURE__ */ new Date();
|
|
78
|
+
instance.outcome = input.action;
|
|
79
|
+
}
|
|
80
|
+
if (newStep?.type === "APPROVAL") {
|
|
81
|
+
instance.status = "WAITING";
|
|
82
|
+
await createApprovalRequests(instance, newStep, context);
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
success: true,
|
|
86
|
+
instance,
|
|
87
|
+
previousStepKey,
|
|
88
|
+
currentStepKey: result.currentStepKey ?? void 0
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
//#endregion
|
|
93
|
+
export { handleStartWorkflow, handleTransitionWorkflow };
|
|
@@ -1,220 +1,220 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _lssm_lib_schema1127 from "@lssm/lib.schema";
|
|
2
2
|
|
|
3
3
|
//#region src/instance/instance.schema.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* A running workflow instance.
|
|
6
6
|
*/
|
|
7
|
-
declare const WorkflowInstanceModel:
|
|
7
|
+
declare const WorkflowInstanceModel: _lssm_lib_schema1127.SchemaModel<{
|
|
8
8
|
id: {
|
|
9
|
-
type:
|
|
9
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
10
10
|
isOptional: false;
|
|
11
11
|
};
|
|
12
12
|
workflowDefinitionId: {
|
|
13
|
-
type:
|
|
13
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
14
14
|
isOptional: false;
|
|
15
15
|
};
|
|
16
16
|
referenceId: {
|
|
17
|
-
type:
|
|
17
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
18
18
|
isOptional: true;
|
|
19
19
|
};
|
|
20
20
|
referenceType: {
|
|
21
|
-
type:
|
|
21
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
22
22
|
isOptional: true;
|
|
23
23
|
};
|
|
24
24
|
status: {
|
|
25
|
-
type:
|
|
25
|
+
type: _lssm_lib_schema1127.EnumType<[string, string, string, string, string, string, string, string]>;
|
|
26
26
|
isOptional: false;
|
|
27
27
|
};
|
|
28
28
|
currentStepId: {
|
|
29
|
-
type:
|
|
29
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
30
30
|
isOptional: true;
|
|
31
31
|
};
|
|
32
32
|
contextData: {
|
|
33
|
-
type:
|
|
33
|
+
type: _lssm_lib_schema1127.FieldType<unknown, unknown>;
|
|
34
34
|
isOptional: true;
|
|
35
35
|
};
|
|
36
36
|
triggeredBy: {
|
|
37
|
-
type:
|
|
37
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
38
38
|
isOptional: false;
|
|
39
39
|
};
|
|
40
40
|
organizationId: {
|
|
41
|
-
type:
|
|
41
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
42
42
|
isOptional: false;
|
|
43
43
|
};
|
|
44
44
|
priority: {
|
|
45
|
-
type:
|
|
45
|
+
type: _lssm_lib_schema1127.FieldType<number, number>;
|
|
46
46
|
isOptional: false;
|
|
47
47
|
};
|
|
48
48
|
dueAt: {
|
|
49
|
-
type:
|
|
49
|
+
type: _lssm_lib_schema1127.FieldType<Date, string>;
|
|
50
50
|
isOptional: true;
|
|
51
51
|
};
|
|
52
52
|
outcome: {
|
|
53
|
-
type:
|
|
53
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
54
54
|
isOptional: true;
|
|
55
55
|
};
|
|
56
56
|
resultData: {
|
|
57
|
-
type:
|
|
57
|
+
type: _lssm_lib_schema1127.FieldType<unknown, unknown>;
|
|
58
58
|
isOptional: true;
|
|
59
59
|
};
|
|
60
60
|
errorMessage: {
|
|
61
|
-
type:
|
|
61
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
62
62
|
isOptional: true;
|
|
63
63
|
};
|
|
64
64
|
createdAt: {
|
|
65
|
-
type:
|
|
65
|
+
type: _lssm_lib_schema1127.FieldType<Date, string>;
|
|
66
66
|
isOptional: false;
|
|
67
67
|
};
|
|
68
68
|
startedAt: {
|
|
69
|
-
type:
|
|
69
|
+
type: _lssm_lib_schema1127.FieldType<Date, string>;
|
|
70
70
|
isOptional: true;
|
|
71
71
|
};
|
|
72
72
|
completedAt: {
|
|
73
|
-
type:
|
|
73
|
+
type: _lssm_lib_schema1127.FieldType<Date, string>;
|
|
74
74
|
isOptional: true;
|
|
75
75
|
};
|
|
76
76
|
}>;
|
|
77
77
|
/**
|
|
78
78
|
* Input for starting a workflow.
|
|
79
79
|
*/
|
|
80
|
-
declare const StartWorkflowInputModel:
|
|
80
|
+
declare const StartWorkflowInputModel: _lssm_lib_schema1127.SchemaModel<{
|
|
81
81
|
workflowKey: {
|
|
82
|
-
type:
|
|
82
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
83
83
|
isOptional: false;
|
|
84
84
|
};
|
|
85
85
|
contextData: {
|
|
86
|
-
type:
|
|
86
|
+
type: _lssm_lib_schema1127.FieldType<unknown, unknown>;
|
|
87
87
|
isOptional: true;
|
|
88
88
|
};
|
|
89
89
|
referenceId: {
|
|
90
|
-
type:
|
|
90
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
91
91
|
isOptional: true;
|
|
92
92
|
};
|
|
93
93
|
referenceType: {
|
|
94
|
-
type:
|
|
94
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
95
95
|
isOptional: true;
|
|
96
96
|
};
|
|
97
97
|
priority: {
|
|
98
|
-
type:
|
|
98
|
+
type: _lssm_lib_schema1127.FieldType<number, number>;
|
|
99
99
|
isOptional: true;
|
|
100
100
|
};
|
|
101
101
|
dueAt: {
|
|
102
|
-
type:
|
|
102
|
+
type: _lssm_lib_schema1127.FieldType<Date, string>;
|
|
103
103
|
isOptional: true;
|
|
104
104
|
};
|
|
105
105
|
}>;
|
|
106
106
|
/**
|
|
107
107
|
* Input for transitioning a workflow.
|
|
108
108
|
*/
|
|
109
|
-
declare const TransitionInputModel:
|
|
109
|
+
declare const TransitionInputModel: _lssm_lib_schema1127.SchemaModel<{
|
|
110
110
|
instanceId: {
|
|
111
|
-
type:
|
|
111
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
112
112
|
isOptional: false;
|
|
113
113
|
};
|
|
114
114
|
action: {
|
|
115
|
-
type:
|
|
115
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
116
116
|
isOptional: false;
|
|
117
117
|
};
|
|
118
118
|
data: {
|
|
119
|
-
type:
|
|
119
|
+
type: _lssm_lib_schema1127.FieldType<unknown, unknown>;
|
|
120
120
|
isOptional: true;
|
|
121
121
|
};
|
|
122
122
|
comment: {
|
|
123
|
-
type:
|
|
123
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
124
124
|
isOptional: true;
|
|
125
125
|
};
|
|
126
126
|
}>;
|
|
127
127
|
/**
|
|
128
128
|
* Result of a workflow transition.
|
|
129
129
|
*/
|
|
130
|
-
declare const TransitionResultModel:
|
|
130
|
+
declare const TransitionResultModel: _lssm_lib_schema1127.SchemaModel<{
|
|
131
131
|
success: {
|
|
132
|
-
type:
|
|
132
|
+
type: _lssm_lib_schema1127.FieldType<boolean, boolean>;
|
|
133
133
|
isOptional: false;
|
|
134
134
|
};
|
|
135
135
|
instance: {
|
|
136
|
-
type:
|
|
136
|
+
type: _lssm_lib_schema1127.SchemaModel<{
|
|
137
137
|
id: {
|
|
138
|
-
type:
|
|
138
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
139
139
|
isOptional: false;
|
|
140
140
|
};
|
|
141
141
|
workflowDefinitionId: {
|
|
142
|
-
type:
|
|
142
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
143
143
|
isOptional: false;
|
|
144
144
|
};
|
|
145
145
|
referenceId: {
|
|
146
|
-
type:
|
|
146
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
147
147
|
isOptional: true;
|
|
148
148
|
};
|
|
149
149
|
referenceType: {
|
|
150
|
-
type:
|
|
150
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
151
151
|
isOptional: true;
|
|
152
152
|
};
|
|
153
153
|
status: {
|
|
154
|
-
type:
|
|
154
|
+
type: _lssm_lib_schema1127.EnumType<[string, string, string, string, string, string, string, string]>;
|
|
155
155
|
isOptional: false;
|
|
156
156
|
};
|
|
157
157
|
currentStepId: {
|
|
158
|
-
type:
|
|
158
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
159
159
|
isOptional: true;
|
|
160
160
|
};
|
|
161
161
|
contextData: {
|
|
162
|
-
type:
|
|
162
|
+
type: _lssm_lib_schema1127.FieldType<unknown, unknown>;
|
|
163
163
|
isOptional: true;
|
|
164
164
|
};
|
|
165
165
|
triggeredBy: {
|
|
166
|
-
type:
|
|
166
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
167
167
|
isOptional: false;
|
|
168
168
|
};
|
|
169
169
|
organizationId: {
|
|
170
|
-
type:
|
|
170
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
171
171
|
isOptional: false;
|
|
172
172
|
};
|
|
173
173
|
priority: {
|
|
174
|
-
type:
|
|
174
|
+
type: _lssm_lib_schema1127.FieldType<number, number>;
|
|
175
175
|
isOptional: false;
|
|
176
176
|
};
|
|
177
177
|
dueAt: {
|
|
178
|
-
type:
|
|
178
|
+
type: _lssm_lib_schema1127.FieldType<Date, string>;
|
|
179
179
|
isOptional: true;
|
|
180
180
|
};
|
|
181
181
|
outcome: {
|
|
182
|
-
type:
|
|
182
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
183
183
|
isOptional: true;
|
|
184
184
|
};
|
|
185
185
|
resultData: {
|
|
186
|
-
type:
|
|
186
|
+
type: _lssm_lib_schema1127.FieldType<unknown, unknown>;
|
|
187
187
|
isOptional: true;
|
|
188
188
|
};
|
|
189
189
|
errorMessage: {
|
|
190
|
-
type:
|
|
190
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
191
191
|
isOptional: true;
|
|
192
192
|
};
|
|
193
193
|
createdAt: {
|
|
194
|
-
type:
|
|
194
|
+
type: _lssm_lib_schema1127.FieldType<Date, string>;
|
|
195
195
|
isOptional: false;
|
|
196
196
|
};
|
|
197
197
|
startedAt: {
|
|
198
|
-
type:
|
|
198
|
+
type: _lssm_lib_schema1127.FieldType<Date, string>;
|
|
199
199
|
isOptional: true;
|
|
200
200
|
};
|
|
201
201
|
completedAt: {
|
|
202
|
-
type:
|
|
202
|
+
type: _lssm_lib_schema1127.FieldType<Date, string>;
|
|
203
203
|
isOptional: true;
|
|
204
204
|
};
|
|
205
205
|
}>;
|
|
206
206
|
isOptional: false;
|
|
207
207
|
};
|
|
208
208
|
previousStepKey: {
|
|
209
|
-
type:
|
|
209
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
210
210
|
isOptional: true;
|
|
211
211
|
};
|
|
212
212
|
currentStepKey: {
|
|
213
|
-
type:
|
|
213
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
214
214
|
isOptional: true;
|
|
215
215
|
};
|
|
216
216
|
message: {
|
|
217
|
-
type:
|
|
217
|
+
type: _lssm_lib_schema1127.FieldType<string, string>;
|
|
218
218
|
isOptional: true;
|
|
219
219
|
};
|
|
220
220
|
}>;
|
|
@@ -1 +1,173 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { ScalarTypeEnum } from "../libs/schema/dist/ScalarTypeEnum.js";
|
|
2
|
+
import { defineSchemaModel } from "../libs/schema/dist/SchemaModel.js";
|
|
3
|
+
import "../libs/schema/dist/index.js";
|
|
4
|
+
import { InstanceStatusEnum } from "./instance.enum.js";
|
|
5
|
+
|
|
6
|
+
//#region src/instance/instance.schema.ts
|
|
7
|
+
/**
|
|
8
|
+
* A running workflow instance.
|
|
9
|
+
*/
|
|
10
|
+
const WorkflowInstanceModel = defineSchemaModel({
|
|
11
|
+
name: "WorkflowInstanceModel",
|
|
12
|
+
description: "A running workflow instance",
|
|
13
|
+
fields: {
|
|
14
|
+
id: {
|
|
15
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
16
|
+
isOptional: false
|
|
17
|
+
},
|
|
18
|
+
workflowDefinitionId: {
|
|
19
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
20
|
+
isOptional: false
|
|
21
|
+
},
|
|
22
|
+
referenceId: {
|
|
23
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
24
|
+
isOptional: true
|
|
25
|
+
},
|
|
26
|
+
referenceType: {
|
|
27
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
28
|
+
isOptional: true
|
|
29
|
+
},
|
|
30
|
+
status: {
|
|
31
|
+
type: InstanceStatusEnum,
|
|
32
|
+
isOptional: false
|
|
33
|
+
},
|
|
34
|
+
currentStepId: {
|
|
35
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
36
|
+
isOptional: true
|
|
37
|
+
},
|
|
38
|
+
contextData: {
|
|
39
|
+
type: ScalarTypeEnum.JSON(),
|
|
40
|
+
isOptional: true
|
|
41
|
+
},
|
|
42
|
+
triggeredBy: {
|
|
43
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
44
|
+
isOptional: false
|
|
45
|
+
},
|
|
46
|
+
organizationId: {
|
|
47
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
48
|
+
isOptional: false
|
|
49
|
+
},
|
|
50
|
+
priority: {
|
|
51
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
52
|
+
isOptional: false
|
|
53
|
+
},
|
|
54
|
+
dueAt: {
|
|
55
|
+
type: ScalarTypeEnum.DateTime(),
|
|
56
|
+
isOptional: true
|
|
57
|
+
},
|
|
58
|
+
outcome: {
|
|
59
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
60
|
+
isOptional: true
|
|
61
|
+
},
|
|
62
|
+
resultData: {
|
|
63
|
+
type: ScalarTypeEnum.JSON(),
|
|
64
|
+
isOptional: true
|
|
65
|
+
},
|
|
66
|
+
errorMessage: {
|
|
67
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
68
|
+
isOptional: true
|
|
69
|
+
},
|
|
70
|
+
createdAt: {
|
|
71
|
+
type: ScalarTypeEnum.DateTime(),
|
|
72
|
+
isOptional: false
|
|
73
|
+
},
|
|
74
|
+
startedAt: {
|
|
75
|
+
type: ScalarTypeEnum.DateTime(),
|
|
76
|
+
isOptional: true
|
|
77
|
+
},
|
|
78
|
+
completedAt: {
|
|
79
|
+
type: ScalarTypeEnum.DateTime(),
|
|
80
|
+
isOptional: true
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
/**
|
|
85
|
+
* Input for starting a workflow.
|
|
86
|
+
*/
|
|
87
|
+
const StartWorkflowInputModel = defineSchemaModel({
|
|
88
|
+
name: "StartWorkflowInput",
|
|
89
|
+
description: "Input for starting a workflow",
|
|
90
|
+
fields: {
|
|
91
|
+
workflowKey: {
|
|
92
|
+
type: ScalarTypeEnum.NonEmptyString(),
|
|
93
|
+
isOptional: false
|
|
94
|
+
},
|
|
95
|
+
contextData: {
|
|
96
|
+
type: ScalarTypeEnum.JSON(),
|
|
97
|
+
isOptional: true
|
|
98
|
+
},
|
|
99
|
+
referenceId: {
|
|
100
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
101
|
+
isOptional: true
|
|
102
|
+
},
|
|
103
|
+
referenceType: {
|
|
104
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
105
|
+
isOptional: true
|
|
106
|
+
},
|
|
107
|
+
priority: {
|
|
108
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
109
|
+
isOptional: true
|
|
110
|
+
},
|
|
111
|
+
dueAt: {
|
|
112
|
+
type: ScalarTypeEnum.DateTime(),
|
|
113
|
+
isOptional: true
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
/**
|
|
118
|
+
* Input for transitioning a workflow.
|
|
119
|
+
*/
|
|
120
|
+
const TransitionInputModel = defineSchemaModel({
|
|
121
|
+
name: "TransitionInput",
|
|
122
|
+
description: "Input for transitioning a workflow",
|
|
123
|
+
fields: {
|
|
124
|
+
instanceId: {
|
|
125
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
126
|
+
isOptional: false
|
|
127
|
+
},
|
|
128
|
+
action: {
|
|
129
|
+
type: ScalarTypeEnum.NonEmptyString(),
|
|
130
|
+
isOptional: false
|
|
131
|
+
},
|
|
132
|
+
data: {
|
|
133
|
+
type: ScalarTypeEnum.JSON(),
|
|
134
|
+
isOptional: true
|
|
135
|
+
},
|
|
136
|
+
comment: {
|
|
137
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
138
|
+
isOptional: true
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
/**
|
|
143
|
+
* Result of a workflow transition.
|
|
144
|
+
*/
|
|
145
|
+
const TransitionResultModel = defineSchemaModel({
|
|
146
|
+
name: "TransitionResult",
|
|
147
|
+
description: "Result of a workflow transition",
|
|
148
|
+
fields: {
|
|
149
|
+
success: {
|
|
150
|
+
type: ScalarTypeEnum.Boolean(),
|
|
151
|
+
isOptional: false
|
|
152
|
+
},
|
|
153
|
+
instance: {
|
|
154
|
+
type: WorkflowInstanceModel,
|
|
155
|
+
isOptional: false
|
|
156
|
+
},
|
|
157
|
+
previousStepKey: {
|
|
158
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
159
|
+
isOptional: true
|
|
160
|
+
},
|
|
161
|
+
currentStepKey: {
|
|
162
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
163
|
+
isOptional: true
|
|
164
|
+
},
|
|
165
|
+
message: {
|
|
166
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
167
|
+
isOptional: true
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
//#endregion
|
|
173
|
+
export { StartWorkflowInputModel, TransitionInputModel, TransitionResultModel, WorkflowInstanceModel };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { StabilityEnum } from "../ownership.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../libs/contracts/dist/capabilities/openbanking.js
|
|
4
|
+
const OWNERS = ["platform.finance"];
|
|
5
|
+
const TAGS = ["open-banking", "finance"];
|
|
6
|
+
const openBankingAccountsReadCapability = {
|
|
7
|
+
meta: {
|
|
8
|
+
key: "openbanking.accounts.read",
|
|
9
|
+
version: 1,
|
|
10
|
+
kind: "integration",
|
|
11
|
+
title: "Open Banking Accounts (Read)",
|
|
12
|
+
description: "Provides read-only access to linked bank accounts, including account summaries and metadata.",
|
|
13
|
+
domain: "finance",
|
|
14
|
+
owners: [...OWNERS],
|
|
15
|
+
tags: [...TAGS],
|
|
16
|
+
stability: StabilityEnum.Experimental
|
|
17
|
+
},
|
|
18
|
+
provides: [
|
|
19
|
+
{
|
|
20
|
+
surface: "operation",
|
|
21
|
+
name: "openbanking.accounts.list",
|
|
22
|
+
version: 1,
|
|
23
|
+
description: "List bank accounts linked to a Powens open banking connection."
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
surface: "operation",
|
|
27
|
+
name: "openbanking.accounts.get",
|
|
28
|
+
version: 1,
|
|
29
|
+
description: "Retrieve the canonical bank account record for a specific account."
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
surface: "operation",
|
|
33
|
+
name: "openbanking.accounts.sync",
|
|
34
|
+
version: 1,
|
|
35
|
+
description: "Trigger a refresh of bank account metadata from the open banking provider."
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
};
|
|
39
|
+
const openBankingTransactionsReadCapability = {
|
|
40
|
+
meta: {
|
|
41
|
+
key: "openbanking.transactions.read",
|
|
42
|
+
version: 1,
|
|
43
|
+
kind: "integration",
|
|
44
|
+
title: "Open Banking Transactions (Read)",
|
|
45
|
+
description: "Enables retrieval of transaction history for linked bank accounts via open banking providers.",
|
|
46
|
+
domain: "finance",
|
|
47
|
+
owners: [...OWNERS],
|
|
48
|
+
tags: [...TAGS, "transactions"],
|
|
49
|
+
stability: StabilityEnum.Experimental
|
|
50
|
+
},
|
|
51
|
+
provides: [{
|
|
52
|
+
surface: "operation",
|
|
53
|
+
name: "openbanking.transactions.list",
|
|
54
|
+
version: 1,
|
|
55
|
+
description: "List transactions for a given bank account with optional date filtering."
|
|
56
|
+
}, {
|
|
57
|
+
surface: "operation",
|
|
58
|
+
name: "openbanking.transactions.sync",
|
|
59
|
+
version: 1,
|
|
60
|
+
description: "Synchronise transactions from the open banking provider into the canonical ledger."
|
|
61
|
+
}]
|
|
62
|
+
};
|
|
63
|
+
const openBankingBalancesReadCapability = {
|
|
64
|
+
meta: {
|
|
65
|
+
key: "openbanking.balances.read",
|
|
66
|
+
version: 1,
|
|
67
|
+
kind: "integration",
|
|
68
|
+
title: "Open Banking Balances (Read)",
|
|
69
|
+
description: "Allows querying of current and available balances for linked bank accounts via open banking providers.",
|
|
70
|
+
domain: "finance",
|
|
71
|
+
owners: [...OWNERS],
|
|
72
|
+
tags: [...TAGS, "balances"],
|
|
73
|
+
stability: StabilityEnum.Experimental
|
|
74
|
+
},
|
|
75
|
+
provides: [{
|
|
76
|
+
surface: "operation",
|
|
77
|
+
name: "openbanking.balances.get",
|
|
78
|
+
version: 1,
|
|
79
|
+
description: "Retrieve the latest known balances for a specified bank account."
|
|
80
|
+
}, {
|
|
81
|
+
surface: "operation",
|
|
82
|
+
name: "openbanking.balances.refresh",
|
|
83
|
+
version: 1,
|
|
84
|
+
description: "Force a balance refresh from the open banking provider."
|
|
85
|
+
}]
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { ContractRegistryFileSchema, ContractRegistryItemSchema, ContractRegistryItemTypeSchema } from "./schemas.js";
|