@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.
Files changed (170) hide show
  1. package/dist/approval/approval.contracts.d.ts +134 -134
  2. package/dist/approval/approval.contracts.js +250 -1
  3. package/dist/approval/approval.enum.d.ts +3 -3
  4. package/dist/approval/approval.enum.js +29 -1
  5. package/dist/approval/approval.event.d.ts +32 -32
  6. package/dist/approval/approval.event.js +186 -1
  7. package/dist/approval/approval.handler.js +71 -1
  8. package/dist/approval/approval.schema.d.ts +24 -24
  9. package/dist/approval/approval.schema.js +111 -1
  10. package/dist/approval/index.js +6 -1
  11. package/dist/docs/index.js +1 -1
  12. package/dist/docs/workflow-system.docblock.js +61 -5
  13. package/dist/entities/approval.d.ts +36 -36
  14. package/dist/entities/approval.js +128 -1
  15. package/dist/entities/index.d.ts +127 -127
  16. package/dist/entities/index.js +31 -1
  17. package/dist/entities/instance.d.ts +47 -47
  18. package/dist/entities/instance.js +168 -1
  19. package/dist/entities/step.d.ts +32 -32
  20. package/dist/entities/step.js +135 -1
  21. package/dist/entities/workflow.d.ts +23 -23
  22. package/dist/entities/workflow.js +102 -1
  23. package/dist/example.js +50 -1
  24. package/dist/index.d.ts +0 -3
  25. package/dist/index.js +19 -1
  26. package/dist/instance/index.js +6 -1
  27. package/dist/instance/instance.contracts.d.ts +256 -256
  28. package/dist/instance/instance.contracts.js +334 -1
  29. package/dist/instance/instance.enum.d.ts +2 -2
  30. package/dist/instance/instance.enum.js +20 -1
  31. package/dist/instance/instance.event.d.ts +87 -87
  32. package/dist/instance/instance.event.js +214 -1
  33. package/dist/instance/instance.handler.js +93 -1
  34. package/dist/instance/instance.schema.d.ts +54 -54
  35. package/dist/instance/instance.schema.js +173 -1
  36. package/dist/libs/contracts/dist/capabilities/openbanking.js +88 -0
  37. package/dist/libs/contracts/dist/client/index.js +5 -0
  38. package/dist/libs/contracts/dist/client/react/feature-render.js +2 -0
  39. package/dist/libs/contracts/dist/client/react/form-render.js +4 -0
  40. package/dist/libs/contracts/dist/client/react/index.js +4 -0
  41. package/dist/libs/contracts/dist/contract-registry/index.js +1 -0
  42. package/dist/libs/contracts/dist/contract-registry/schemas.js +60 -0
  43. package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +16 -0
  44. package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +16 -0
  45. package/dist/libs/contracts/dist/docs/index.js +29 -0
  46. package/dist/libs/contracts/dist/docs/presentations.js +71 -0
  47. package/dist/libs/contracts/dist/docs/registry.js +44 -0
  48. package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +16 -0
  49. package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +16 -0
  50. package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +16 -0
  51. package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +16 -0
  52. package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +16 -0
  53. package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +80 -0
  54. package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +57 -0
  55. package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +16 -0
  56. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +357 -0
  57. package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +37 -0
  58. package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +16 -0
  59. package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +20 -0
  60. package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +48 -0
  61. package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +79 -0
  62. package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +84 -0
  63. package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +45 -0
  64. package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +67 -0
  65. package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +40 -0
  66. package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +69 -0
  67. package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +47 -0
  68. package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +62 -0
  69. package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +155 -0
  70. package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +20 -0
  71. package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +101 -0
  72. package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +20 -0
  73. package/dist/libs/contracts/dist/events.js +10 -0
  74. package/dist/libs/contracts/dist/experiments/evaluator.js +1 -0
  75. package/dist/libs/contracts/dist/index.js +71 -0
  76. package/dist/libs/contracts/dist/install.js +2 -0
  77. package/dist/libs/contracts/dist/integrations/contracts.js +377 -0
  78. package/dist/libs/contracts/dist/integrations/index.js +18 -0
  79. package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +228 -0
  80. package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +159 -0
  81. package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +3 -0
  82. package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +210 -0
  83. package/dist/libs/contracts/dist/integrations/openbanking/models.js +242 -0
  84. package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +13 -0
  85. package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +52 -0
  86. package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +75 -0
  87. package/dist/libs/contracts/dist/integrations/providers/gmail.js +87 -0
  88. package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +66 -0
  89. package/dist/libs/contracts/dist/integrations/providers/index.js +11 -0
  90. package/dist/libs/contracts/dist/integrations/providers/mistral.js +68 -0
  91. package/dist/libs/contracts/dist/integrations/providers/postmark.js +68 -0
  92. package/dist/libs/contracts/dist/integrations/providers/powens.js +116 -0
  93. package/dist/libs/contracts/dist/integrations/providers/qdrant.js +73 -0
  94. package/dist/libs/contracts/dist/integrations/providers/registry.js +10 -0
  95. package/dist/libs/contracts/dist/integrations/providers/stripe.js +83 -0
  96. package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +61 -0
  97. package/dist/libs/contracts/dist/jsonschema.js +1 -0
  98. package/dist/libs/contracts/dist/knowledge/contracts.js +306 -0
  99. package/dist/libs/contracts/dist/knowledge/index.js +7 -0
  100. package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +34 -0
  101. package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +34 -0
  102. package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +38 -0
  103. package/dist/libs/contracts/dist/knowledge/spaces/index.js +6 -0
  104. package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +34 -0
  105. package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +37 -0
  106. package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +34 -0
  107. package/dist/libs/contracts/dist/llm/exporters.js +19 -0
  108. package/dist/libs/contracts/dist/llm/index.js +2 -0
  109. package/dist/libs/contracts/dist/llm/prompts.js +1 -0
  110. package/dist/libs/contracts/dist/onboarding-base.js +196 -0
  111. package/dist/libs/contracts/dist/openapi.js +1 -0
  112. package/dist/libs/contracts/dist/ownership.js +21 -0
  113. package/dist/libs/contracts/dist/presentations.js +1 -0
  114. package/dist/libs/contracts/dist/presentations.v2.js +11 -0
  115. package/dist/libs/contracts/dist/prompt.js +1 -0
  116. package/dist/libs/contracts/dist/promptRegistry.js +1 -0
  117. package/dist/libs/contracts/dist/regenerator/index.js +1 -0
  118. package/dist/libs/contracts/dist/regenerator/service.js +6 -0
  119. package/dist/libs/contracts/dist/registry.js +2 -0
  120. package/dist/libs/contracts/dist/resources.js +1 -0
  121. package/dist/libs/contracts/dist/schema/dist/EnumType.js +2 -0
  122. package/dist/libs/contracts/dist/schema/dist/FieldType.js +49 -0
  123. package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +236 -0
  124. package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +39 -0
  125. package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +1 -0
  126. package/dist/libs/contracts/dist/schema/dist/entity/index.js +2 -0
  127. package/dist/libs/contracts/dist/schema/dist/entity/types.js +1 -0
  128. package/dist/libs/contracts/dist/schema/dist/index.js +6 -0
  129. package/dist/libs/contracts/dist/server/graphql-pothos.js +6 -0
  130. package/dist/libs/contracts/dist/server/index.js +8 -0
  131. package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +4 -0
  132. package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +2 -0
  133. package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +1 -0
  134. package/dist/libs/contracts/dist/server/mcp/registerResources.js +2 -0
  135. package/dist/libs/contracts/dist/server/mcp/registerTools.js +1 -0
  136. package/dist/libs/contracts/dist/server/provider-mcp.js +1 -0
  137. package/dist/libs/contracts/dist/server/rest-elysia.js +1 -0
  138. package/dist/libs/contracts/dist/server/rest-express.js +1 -0
  139. package/dist/libs/contracts/dist/server/rest-generic.js +1 -0
  140. package/dist/libs/contracts/dist/server/rest-next-app.js +1 -0
  141. package/dist/libs/contracts/dist/server/rest-next-pages.js +1 -0
  142. package/dist/libs/contracts/dist/spec.js +34 -0
  143. package/dist/libs/contracts/dist/telemetry/index.js +1 -0
  144. package/dist/libs/contracts/dist/telemetry/tracker.js +1 -0
  145. package/dist/libs/contracts/dist/tests/index.js +1 -0
  146. package/dist/libs/contracts/dist/tests/runner.js +2 -0
  147. package/dist/libs/contracts/dist/workflow/index.js +1 -0
  148. package/dist/libs/contracts/dist/workflow/runner.js +1 -0
  149. package/dist/libs/schema/dist/EnumType.js +56 -0
  150. package/dist/libs/schema/dist/FieldType.js +49 -0
  151. package/dist/libs/schema/dist/ScalarTypeEnum.js +236 -0
  152. package/dist/libs/schema/dist/SchemaModel.js +39 -0
  153. package/dist/libs/schema/dist/entity/defineEntity.js +236 -0
  154. package/dist/libs/schema/dist/entity/index.js +2 -0
  155. package/dist/libs/schema/dist/entity/types.js +1 -0
  156. package/dist/libs/schema/dist/index.js +6 -0
  157. package/dist/presentations/index.js +291 -1
  158. package/dist/shared/index.js +3 -1
  159. package/dist/shared/mock-data.js +11 -1
  160. package/dist/state-machine/index.js +157 -1
  161. package/dist/workflow/index.js +6 -1
  162. package/dist/workflow/workflow.contracts.d.ts +245 -245
  163. package/dist/workflow/workflow.contracts.js +239 -1
  164. package/dist/workflow/workflow.enum.js +47 -1
  165. package/dist/workflow/workflow.event.d.ts +32 -32
  166. package/dist/workflow/workflow.event.js +116 -1
  167. package/dist/workflow/workflow.handler.js +65 -1
  168. package/dist/workflow/workflow.schema.js +250 -1
  169. package/dist/workflow-system.feature.js +337 -1
  170. package/package.json +11 -11
@@ -1 +1,250 @@
1
- import{ApprovalDecisionEnum as e,ApprovalStatusEnum as t}from"./approval.enum.js";import{ApprovalCommentModel as n,ApprovalRequestModel as r}from"./approval.schema.js";import{ScalarTypeEnum as i,defineSchemaModel as a}from"@lssm/lib.schema";import{defineCommand as o,defineQuery as s}from"@lssm/lib.contracts/spec";const c=[`@example.workflow-system`],l=o({meta:{name:`workflow.approval.decide`,version:1,stability:`stable`,owners:[...c],tags:[`workflow`,`approval`,`decision`],description:`Submit an approval decision (approve/reject).`,goal:`Allow approvers to make decisions on requests.`,context:`Approval inbox, workflow detail.`},io:{input:a({name:`ApproveRejectInput`,fields:{requestId:{type:i.String_unsecure(),isOptional:!1},decision:{type:e,isOptional:!1},comment:{type:i.String_unsecure(),isOptional:!0},data:{type:i.JSON(),isOptional:!0}}}),output:r},policy:{auth:`user`},sideEffects:{emits:[{name:`workflow.approval.decided`,version:1,when:`Decision is made`,payload:r}],audit:[`workflow.approval.decided`]}}),u=o({meta:{name:`workflow.approval.delegate`,version:1,stability:`stable`,owners:[...c],tags:[`workflow`,`approval`,`delegate`],description:`Delegate an approval request to another user.`,goal:`Allow approvers to pass approval to others.`,context:`Approval inbox.`},io:{input:a({name:`DelegateInput`,fields:{requestId:{type:i.String_unsecure(),isOptional:!1},delegateTo:{type:i.String_unsecure(),isOptional:!1},reason:{type:i.String_unsecure(),isOptional:!0}}}),output:r},policy:{auth:`user`},sideEffects:{emits:[{name:`workflow.approval.delegated`,version:1,when:`Approval is delegated`,payload:r}],audit:[`workflow.approval.delegated`]}}),d=o({meta:{name:`workflow.approval.comment.add`,version:1,stability:`stable`,owners:[...c],tags:[`workflow`,`approval`,`comment`],description:`Add a comment to an approval request.`,goal:`Allow discussion on approval requests.`,context:`Approval detail view.`},io:{input:a({name:`AddCommentInput`,fields:{requestId:{type:i.String_unsecure(),isOptional:!1},content:{type:i.NonEmptyString(),isOptional:!1},isInternal:{type:i.Boolean(),isOptional:!0}}}),output:n},policy:{auth:`user`},sideEffects:{emits:[{name:`workflow.approval.comment.added`,version:1,when:`Comment is added`,payload:n}]}}),f=s({meta:{name:`workflow.approval.list.mine`,version:1,stability:`stable`,owners:[...c],tags:[`workflow`,`approval`,`list`,`inbox`],description:`List approval requests assigned to current user.`,goal:`Show pending approvals in user inbox.`,context:`Approval inbox, dashboard widget.`},io:{input:a({name:`ListMyApprovalsInput`,fields:{status:{type:t,isOptional:!0},limit:{type:i.Int_unsecure(),isOptional:!0,defaultValue:20},offset:{type:i.Int_unsecure(),isOptional:!0,defaultValue:0}}}),output:a({name:`ListMyApprovalsOutput`,fields:{requests:{type:r,isArray:!0,isOptional:!1},total:{type:i.Int_unsecure(),isOptional:!1},pendingCount:{type:i.Int_unsecure(),isOptional:!1}}})},policy:{auth:`user`}}),p=s({meta:{name:`workflow.approval.get`,version:1,stability:`stable`,owners:[...c],tags:[`workflow`,`approval`,`get`],description:`Get an approval request with details.`,goal:`View approval request details.`,context:`Approval detail view.`},io:{input:a({name:`GetApprovalInput`,fields:{requestId:{type:i.String_unsecure(),isOptional:!1}}}),output:r},policy:{auth:`user`}});export{d as AddApprovalCommentContract,u as DelegateApprovalContract,p as GetApprovalContract,f as ListMyApprovalsContract,l as SubmitDecisionContract};
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 { defineCommand, defineQuery } from "../libs/contracts/dist/spec.js";
5
+ import { ApprovalDecisionEnum, ApprovalStatusEnum } from "./approval.enum.js";
6
+ import { ApprovalCommentModel, ApprovalRequestModel } from "./approval.schema.js";
7
+
8
+ //#region src/approval/approval.contracts.ts
9
+ const OWNERS = ["@example.workflow-system"];
10
+ /**
11
+ * Approve or reject an approval request.
12
+ */
13
+ const SubmitDecisionContract = defineCommand({
14
+ meta: {
15
+ name: "workflow.approval.decide",
16
+ version: 1,
17
+ stability: "stable",
18
+ owners: [...OWNERS],
19
+ tags: [
20
+ "workflow",
21
+ "approval",
22
+ "decision"
23
+ ],
24
+ description: "Submit an approval decision (approve/reject).",
25
+ goal: "Allow approvers to make decisions on requests.",
26
+ context: "Approval inbox, workflow detail."
27
+ },
28
+ io: {
29
+ input: defineSchemaModel({
30
+ name: "ApproveRejectInput",
31
+ fields: {
32
+ requestId: {
33
+ type: ScalarTypeEnum.String_unsecure(),
34
+ isOptional: false
35
+ },
36
+ decision: {
37
+ type: ApprovalDecisionEnum,
38
+ isOptional: false
39
+ },
40
+ comment: {
41
+ type: ScalarTypeEnum.String_unsecure(),
42
+ isOptional: true
43
+ },
44
+ data: {
45
+ type: ScalarTypeEnum.JSON(),
46
+ isOptional: true
47
+ }
48
+ }
49
+ }),
50
+ output: ApprovalRequestModel
51
+ },
52
+ policy: { auth: "user" },
53
+ sideEffects: {
54
+ emits: [{
55
+ name: "workflow.approval.decided",
56
+ version: 1,
57
+ when: "Decision is made",
58
+ payload: ApprovalRequestModel
59
+ }],
60
+ audit: ["workflow.approval.decided"]
61
+ }
62
+ });
63
+ /**
64
+ * Delegate an approval to another user.
65
+ */
66
+ const DelegateApprovalContract = defineCommand({
67
+ meta: {
68
+ name: "workflow.approval.delegate",
69
+ version: 1,
70
+ stability: "stable",
71
+ owners: [...OWNERS],
72
+ tags: [
73
+ "workflow",
74
+ "approval",
75
+ "delegate"
76
+ ],
77
+ description: "Delegate an approval request to another user.",
78
+ goal: "Allow approvers to pass approval to others.",
79
+ context: "Approval inbox."
80
+ },
81
+ io: {
82
+ input: defineSchemaModel({
83
+ name: "DelegateInput",
84
+ fields: {
85
+ requestId: {
86
+ type: ScalarTypeEnum.String_unsecure(),
87
+ isOptional: false
88
+ },
89
+ delegateTo: {
90
+ type: ScalarTypeEnum.String_unsecure(),
91
+ isOptional: false
92
+ },
93
+ reason: {
94
+ type: ScalarTypeEnum.String_unsecure(),
95
+ isOptional: true
96
+ }
97
+ }
98
+ }),
99
+ output: ApprovalRequestModel
100
+ },
101
+ policy: { auth: "user" },
102
+ sideEffects: {
103
+ emits: [{
104
+ name: "workflow.approval.delegated",
105
+ version: 1,
106
+ when: "Approval is delegated",
107
+ payload: ApprovalRequestModel
108
+ }],
109
+ audit: ["workflow.approval.delegated"]
110
+ }
111
+ });
112
+ /**
113
+ * Add a comment to an approval request.
114
+ */
115
+ const AddApprovalCommentContract = defineCommand({
116
+ meta: {
117
+ name: "workflow.approval.comment.add",
118
+ version: 1,
119
+ stability: "stable",
120
+ owners: [...OWNERS],
121
+ tags: [
122
+ "workflow",
123
+ "approval",
124
+ "comment"
125
+ ],
126
+ description: "Add a comment to an approval request.",
127
+ goal: "Allow discussion on approval requests.",
128
+ context: "Approval detail view."
129
+ },
130
+ io: {
131
+ input: defineSchemaModel({
132
+ name: "AddCommentInput",
133
+ fields: {
134
+ requestId: {
135
+ type: ScalarTypeEnum.String_unsecure(),
136
+ isOptional: false
137
+ },
138
+ content: {
139
+ type: ScalarTypeEnum.NonEmptyString(),
140
+ isOptional: false
141
+ },
142
+ isInternal: {
143
+ type: ScalarTypeEnum.Boolean(),
144
+ isOptional: true
145
+ }
146
+ }
147
+ }),
148
+ output: ApprovalCommentModel
149
+ },
150
+ policy: { auth: "user" },
151
+ sideEffects: { emits: [{
152
+ name: "workflow.approval.comment.added",
153
+ version: 1,
154
+ when: "Comment is added",
155
+ payload: ApprovalCommentModel
156
+ }] }
157
+ });
158
+ /**
159
+ * List approvals assigned to the current user.
160
+ */
161
+ const ListMyApprovalsContract = defineQuery({
162
+ meta: {
163
+ name: "workflow.approval.list.mine",
164
+ version: 1,
165
+ stability: "stable",
166
+ owners: [...OWNERS],
167
+ tags: [
168
+ "workflow",
169
+ "approval",
170
+ "list",
171
+ "inbox"
172
+ ],
173
+ description: "List approval requests assigned to current user.",
174
+ goal: "Show pending approvals in user inbox.",
175
+ context: "Approval inbox, dashboard widget."
176
+ },
177
+ io: {
178
+ input: defineSchemaModel({
179
+ name: "ListMyApprovalsInput",
180
+ fields: {
181
+ status: {
182
+ type: ApprovalStatusEnum,
183
+ isOptional: true
184
+ },
185
+ limit: {
186
+ type: ScalarTypeEnum.Int_unsecure(),
187
+ isOptional: true,
188
+ defaultValue: 20
189
+ },
190
+ offset: {
191
+ type: ScalarTypeEnum.Int_unsecure(),
192
+ isOptional: true,
193
+ defaultValue: 0
194
+ }
195
+ }
196
+ }),
197
+ output: defineSchemaModel({
198
+ name: "ListMyApprovalsOutput",
199
+ fields: {
200
+ requests: {
201
+ type: ApprovalRequestModel,
202
+ isArray: true,
203
+ isOptional: false
204
+ },
205
+ total: {
206
+ type: ScalarTypeEnum.Int_unsecure(),
207
+ isOptional: false
208
+ },
209
+ pendingCount: {
210
+ type: ScalarTypeEnum.Int_unsecure(),
211
+ isOptional: false
212
+ }
213
+ }
214
+ })
215
+ },
216
+ policy: { auth: "user" }
217
+ });
218
+ /**
219
+ * Get a single approval request.
220
+ */
221
+ const GetApprovalContract = defineQuery({
222
+ meta: {
223
+ name: "workflow.approval.get",
224
+ version: 1,
225
+ stability: "stable",
226
+ owners: [...OWNERS],
227
+ tags: [
228
+ "workflow",
229
+ "approval",
230
+ "get"
231
+ ],
232
+ description: "Get an approval request with details.",
233
+ goal: "View approval request details.",
234
+ context: "Approval detail view."
235
+ },
236
+ io: {
237
+ input: defineSchemaModel({
238
+ name: "GetApprovalInput",
239
+ fields: { requestId: {
240
+ type: ScalarTypeEnum.String_unsecure(),
241
+ isOptional: false
242
+ } }
243
+ }),
244
+ output: ApprovalRequestModel
245
+ },
246
+ policy: { auth: "user" }
247
+ });
248
+
249
+ //#endregion
250
+ export { AddApprovalCommentContract, DelegateApprovalContract, GetApprovalContract, ListMyApprovalsContract, SubmitDecisionContract };
@@ -1,13 +1,13 @@
1
- import * as _lssm_lib_schema533 from "@lssm/lib.schema";
1
+ import * as _lssm_lib_schema228 from "@lssm/lib.schema";
2
2
 
3
3
  //#region src/approval/approval.enum.d.ts
4
4
  /**
5
5
  * Approval status enum.
6
6
  */
7
- declare const ApprovalStatusEnum: _lssm_lib_schema533.EnumType<[string, string, string, string, string, string, string]>;
7
+ declare const ApprovalStatusEnum: _lssm_lib_schema228.EnumType<[string, string, string, string, string, string, string]>;
8
8
  /**
9
9
  * Approval decision enum.
10
10
  */
11
- declare const ApprovalDecisionEnum: _lssm_lib_schema533.EnumType<[string, string, string, string, string]>;
11
+ declare const ApprovalDecisionEnum: _lssm_lib_schema228.EnumType<[string, string, string, string, string]>;
12
12
  //#endregion
13
13
  export { ApprovalDecisionEnum, ApprovalStatusEnum };
@@ -1 +1,29 @@
1
- import{defineEnum as e}from"@lssm/lib.schema";const t=e(`ApprovalStatus`,[`PENDING`,`APPROVED`,`REJECTED`,`DELEGATED`,`ESCALATED`,`WITHDRAWN`,`EXPIRED`]),n=e(`ApprovalDecision`,[`APPROVE`,`REJECT`,`REQUEST_CHANGES`,`DELEGATE`,`ABSTAIN`]);export{n as ApprovalDecisionEnum,t as ApprovalStatusEnum};
1
+ import { defineEnum } from "../libs/schema/dist/EnumType.js";
2
+ import "../libs/schema/dist/index.js";
3
+
4
+ //#region src/approval/approval.enum.ts
5
+ /**
6
+ * Approval status enum.
7
+ */
8
+ const ApprovalStatusEnum = defineEnum("ApprovalStatus", [
9
+ "PENDING",
10
+ "APPROVED",
11
+ "REJECTED",
12
+ "DELEGATED",
13
+ "ESCALATED",
14
+ "WITHDRAWN",
15
+ "EXPIRED"
16
+ ]);
17
+ /**
18
+ * Approval decision enum.
19
+ */
20
+ const ApprovalDecisionEnum = defineEnum("ApprovalDecision", [
21
+ "APPROVE",
22
+ "REJECT",
23
+ "REQUEST_CHANGES",
24
+ "DELEGATE",
25
+ "ABSTAIN"
26
+ ]);
27
+
28
+ //#endregion
29
+ export { ApprovalDecisionEnum, ApprovalStatusEnum };
@@ -1,128 +1,128 @@
1
- import * as _lssm_lib_schema588 from "@lssm/lib.schema";
2
- import * as _lssm_lib_contracts20 from "@lssm/lib.contracts";
1
+ import * as _lssm_lib_schema230 from "@lssm/lib.schema";
2
+ import * as _lssm_lib_contracts4 from "@lssm/lib.contracts";
3
3
 
4
4
  //#region src/approval/approval.event.d.ts
5
5
  /**
6
6
  * ApprovalRequestedEvent - An approval has been requested.
7
7
  */
8
- declare const ApprovalRequestedEvent: _lssm_lib_contracts20.EventSpec<_lssm_lib_schema588.SchemaModel<{
8
+ declare const ApprovalRequestedEvent: _lssm_lib_contracts4.EventSpec<_lssm_lib_schema230.SchemaModel<{
9
9
  requestId: {
10
- type: _lssm_lib_schema588.FieldType<string, string>;
10
+ type: _lssm_lib_schema230.FieldType<string, string>;
11
11
  isOptional: false;
12
12
  };
13
13
  instanceId: {
14
- type: _lssm_lib_schema588.FieldType<string, string>;
14
+ type: _lssm_lib_schema230.FieldType<string, string>;
15
15
  isOptional: false;
16
16
  };
17
17
  workflowKey: {
18
- type: _lssm_lib_schema588.FieldType<string, string>;
18
+ type: _lssm_lib_schema230.FieldType<string, string>;
19
19
  isOptional: false;
20
20
  };
21
21
  approverId: {
22
- type: _lssm_lib_schema588.FieldType<string, string>;
22
+ type: _lssm_lib_schema230.FieldType<string, string>;
23
23
  isOptional: false;
24
24
  };
25
25
  approverRole: {
26
- type: _lssm_lib_schema588.FieldType<string, string>;
26
+ type: _lssm_lib_schema230.FieldType<string, string>;
27
27
  isOptional: true;
28
28
  };
29
29
  title: {
30
- type: _lssm_lib_schema588.FieldType<string, string>;
30
+ type: _lssm_lib_schema230.FieldType<string, string>;
31
31
  isOptional: false;
32
32
  };
33
33
  dueAt: {
34
- type: _lssm_lib_schema588.FieldType<Date, string>;
34
+ type: _lssm_lib_schema230.FieldType<Date, string>;
35
35
  isOptional: true;
36
36
  };
37
37
  timestamp: {
38
- type: _lssm_lib_schema588.FieldType<Date, string>;
38
+ type: _lssm_lib_schema230.FieldType<Date, string>;
39
39
  isOptional: false;
40
40
  };
41
41
  }>>;
42
42
  /**
43
43
  * ApprovalDecidedEvent - An approval decision has been made.
44
44
  */
45
- declare const ApprovalDecidedEvent: _lssm_lib_contracts20.EventSpec<_lssm_lib_schema588.SchemaModel<{
45
+ declare const ApprovalDecidedEvent: _lssm_lib_contracts4.EventSpec<_lssm_lib_schema230.SchemaModel<{
46
46
  requestId: {
47
- type: _lssm_lib_schema588.FieldType<string, string>;
47
+ type: _lssm_lib_schema230.FieldType<string, string>;
48
48
  isOptional: false;
49
49
  };
50
50
  instanceId: {
51
- type: _lssm_lib_schema588.FieldType<string, string>;
51
+ type: _lssm_lib_schema230.FieldType<string, string>;
52
52
  isOptional: false;
53
53
  };
54
54
  decision: {
55
- type: _lssm_lib_schema588.FieldType<string, string>;
55
+ type: _lssm_lib_schema230.FieldType<string, string>;
56
56
  isOptional: false;
57
57
  };
58
58
  decidedBy: {
59
- type: _lssm_lib_schema588.FieldType<string, string>;
59
+ type: _lssm_lib_schema230.FieldType<string, string>;
60
60
  isOptional: false;
61
61
  };
62
62
  comment: {
63
- type: _lssm_lib_schema588.FieldType<string, string>;
63
+ type: _lssm_lib_schema230.FieldType<string, string>;
64
64
  isOptional: true;
65
65
  };
66
66
  timestamp: {
67
- type: _lssm_lib_schema588.FieldType<Date, string>;
67
+ type: _lssm_lib_schema230.FieldType<Date, string>;
68
68
  isOptional: false;
69
69
  };
70
70
  }>>;
71
71
  /**
72
72
  * ApprovalDelegatedEvent - An approval has been delegated.
73
73
  */
74
- declare const ApprovalDelegatedEvent: _lssm_lib_contracts20.EventSpec<_lssm_lib_schema588.SchemaModel<{
74
+ declare const ApprovalDelegatedEvent: _lssm_lib_contracts4.EventSpec<_lssm_lib_schema230.SchemaModel<{
75
75
  requestId: {
76
- type: _lssm_lib_schema588.FieldType<string, string>;
76
+ type: _lssm_lib_schema230.FieldType<string, string>;
77
77
  isOptional: false;
78
78
  };
79
79
  instanceId: {
80
- type: _lssm_lib_schema588.FieldType<string, string>;
80
+ type: _lssm_lib_schema230.FieldType<string, string>;
81
81
  isOptional: false;
82
82
  };
83
83
  fromUserId: {
84
- type: _lssm_lib_schema588.FieldType<string, string>;
84
+ type: _lssm_lib_schema230.FieldType<string, string>;
85
85
  isOptional: false;
86
86
  };
87
87
  toUserId: {
88
- type: _lssm_lib_schema588.FieldType<string, string>;
88
+ type: _lssm_lib_schema230.FieldType<string, string>;
89
89
  isOptional: false;
90
90
  };
91
91
  reason: {
92
- type: _lssm_lib_schema588.FieldType<string, string>;
92
+ type: _lssm_lib_schema230.FieldType<string, string>;
93
93
  isOptional: true;
94
94
  };
95
95
  timestamp: {
96
- type: _lssm_lib_schema588.FieldType<Date, string>;
96
+ type: _lssm_lib_schema230.FieldType<Date, string>;
97
97
  isOptional: false;
98
98
  };
99
99
  }>>;
100
100
  /**
101
101
  * ApprovalEscalatedEvent - An approval has been escalated.
102
102
  */
103
- declare const ApprovalEscalatedEvent: _lssm_lib_contracts20.EventSpec<_lssm_lib_schema588.SchemaModel<{
103
+ declare const ApprovalEscalatedEvent: _lssm_lib_contracts4.EventSpec<_lssm_lib_schema230.SchemaModel<{
104
104
  requestId: {
105
- type: _lssm_lib_schema588.FieldType<string, string>;
105
+ type: _lssm_lib_schema230.FieldType<string, string>;
106
106
  isOptional: false;
107
107
  };
108
108
  instanceId: {
109
- type: _lssm_lib_schema588.FieldType<string, string>;
109
+ type: _lssm_lib_schema230.FieldType<string, string>;
110
110
  isOptional: false;
111
111
  };
112
112
  escalationLevel: {
113
- type: _lssm_lib_schema588.FieldType<number, number>;
113
+ type: _lssm_lib_schema230.FieldType<number, number>;
114
114
  isOptional: false;
115
115
  };
116
116
  escalatedTo: {
117
- type: _lssm_lib_schema588.FieldType<string, string>;
117
+ type: _lssm_lib_schema230.FieldType<string, string>;
118
118
  isOptional: false;
119
119
  };
120
120
  reason: {
121
- type: _lssm_lib_schema588.FieldType<string, string>;
121
+ type: _lssm_lib_schema230.FieldType<string, string>;
122
122
  isOptional: false;
123
123
  };
124
124
  timestamp: {
125
- type: _lssm_lib_schema588.FieldType<Date, string>;
125
+ type: _lssm_lib_schema230.FieldType<Date, string>;
126
126
  isOptional: false;
127
127
  };
128
128
  }>>;
@@ -1 +1,186 @@
1
- import{ScalarTypeEnum as e}from"@lssm/lib.schema";import{defineEvent as t,defineSchemaModel as n}from"@lssm/lib.contracts";const r=n({name:`ApprovalRequestedEventPayload`,description:`Payload when approval is requested`,fields:{requestId:{type:e.String_unsecure(),isOptional:!1},instanceId:{type:e.String_unsecure(),isOptional:!1},workflowKey:{type:e.String_unsecure(),isOptional:!1},approverId:{type:e.String_unsecure(),isOptional:!1},approverRole:{type:e.String_unsecure(),isOptional:!0},title:{type:e.String_unsecure(),isOptional:!1},dueAt:{type:e.DateTime(),isOptional:!0},timestamp:{type:e.DateTime(),isOptional:!1}}}),i=n({name:`ApprovalDecidedEventPayload`,description:`Payload when approval decision is made`,fields:{requestId:{type:e.String_unsecure(),isOptional:!1},instanceId:{type:e.String_unsecure(),isOptional:!1},decision:{type:e.String_unsecure(),isOptional:!1},decidedBy:{type:e.String_unsecure(),isOptional:!1},comment:{type:e.String_unsecure(),isOptional:!0},timestamp:{type:e.DateTime(),isOptional:!1}}}),a=n({name:`ApprovalDelegatedEventPayload`,description:`Payload when approval is delegated`,fields:{requestId:{type:e.String_unsecure(),isOptional:!1},instanceId:{type:e.String_unsecure(),isOptional:!1},fromUserId:{type:e.String_unsecure(),isOptional:!1},toUserId:{type:e.String_unsecure(),isOptional:!1},reason:{type:e.String_unsecure(),isOptional:!0},timestamp:{type:e.DateTime(),isOptional:!1}}}),o=n({name:`ApprovalEscalatedEventPayload`,description:`Payload when approval is escalated`,fields:{requestId:{type:e.String_unsecure(),isOptional:!1},instanceId:{type:e.String_unsecure(),isOptional:!1},escalationLevel:{type:e.Int_unsecure(),isOptional:!1},escalatedTo:{type:e.String_unsecure(),isOptional:!1},reason:{type:e.String_unsecure(),isOptional:!1},timestamp:{type:e.DateTime(),isOptional:!1}}}),s=t({name:`workflow.approval.requested`,version:1,description:`An approval has been requested.`,payload:r}),c=t({name:`workflow.approval.decided`,version:1,description:`An approval decision has been made.`,payload:i}),l=t({name:`workflow.approval.delegated`,version:1,description:`An approval has been delegated.`,payload:a}),u=t({name:`workflow.approval.escalated`,version:1,description:`An approval has been escalated.`,payload:o});export{c as ApprovalDecidedEvent,l as ApprovalDelegatedEvent,u as ApprovalEscalatedEvent,s as ApprovalRequestedEvent};
1
+ import { ScalarTypeEnum } from "../libs/schema/dist/ScalarTypeEnum.js";
2
+ import "../libs/schema/dist/index.js";
3
+ import { defineSchemaModel } from "../libs/contracts/dist/schema/dist/SchemaModel.js";
4
+ import { defineEvent } from "../libs/contracts/dist/events.js";
5
+ import "../libs/contracts/dist/index.js";
6
+
7
+ //#region src/approval/approval.event.ts
8
+ /**
9
+ * Payload when approval is requested.
10
+ */
11
+ const ApprovalRequestedPayload = defineSchemaModel({
12
+ name: "ApprovalRequestedEventPayload",
13
+ description: "Payload when approval is requested",
14
+ fields: {
15
+ requestId: {
16
+ type: ScalarTypeEnum.String_unsecure(),
17
+ isOptional: false
18
+ },
19
+ instanceId: {
20
+ type: ScalarTypeEnum.String_unsecure(),
21
+ isOptional: false
22
+ },
23
+ workflowKey: {
24
+ type: ScalarTypeEnum.String_unsecure(),
25
+ isOptional: false
26
+ },
27
+ approverId: {
28
+ type: ScalarTypeEnum.String_unsecure(),
29
+ isOptional: false
30
+ },
31
+ approverRole: {
32
+ type: ScalarTypeEnum.String_unsecure(),
33
+ isOptional: true
34
+ },
35
+ title: {
36
+ type: ScalarTypeEnum.String_unsecure(),
37
+ isOptional: false
38
+ },
39
+ dueAt: {
40
+ type: ScalarTypeEnum.DateTime(),
41
+ isOptional: true
42
+ },
43
+ timestamp: {
44
+ type: ScalarTypeEnum.DateTime(),
45
+ isOptional: false
46
+ }
47
+ }
48
+ });
49
+ /**
50
+ * Payload when approval decision is made.
51
+ */
52
+ const ApprovalDecidedPayload = defineSchemaModel({
53
+ name: "ApprovalDecidedEventPayload",
54
+ description: "Payload when approval decision is made",
55
+ fields: {
56
+ requestId: {
57
+ type: ScalarTypeEnum.String_unsecure(),
58
+ isOptional: false
59
+ },
60
+ instanceId: {
61
+ type: ScalarTypeEnum.String_unsecure(),
62
+ isOptional: false
63
+ },
64
+ decision: {
65
+ type: ScalarTypeEnum.String_unsecure(),
66
+ isOptional: false
67
+ },
68
+ decidedBy: {
69
+ type: ScalarTypeEnum.String_unsecure(),
70
+ isOptional: false
71
+ },
72
+ comment: {
73
+ type: ScalarTypeEnum.String_unsecure(),
74
+ isOptional: true
75
+ },
76
+ timestamp: {
77
+ type: ScalarTypeEnum.DateTime(),
78
+ isOptional: false
79
+ }
80
+ }
81
+ });
82
+ /**
83
+ * Payload when approval is delegated.
84
+ */
85
+ const ApprovalDelegatedPayload = defineSchemaModel({
86
+ name: "ApprovalDelegatedEventPayload",
87
+ description: "Payload when approval is delegated",
88
+ fields: {
89
+ requestId: {
90
+ type: ScalarTypeEnum.String_unsecure(),
91
+ isOptional: false
92
+ },
93
+ instanceId: {
94
+ type: ScalarTypeEnum.String_unsecure(),
95
+ isOptional: false
96
+ },
97
+ fromUserId: {
98
+ type: ScalarTypeEnum.String_unsecure(),
99
+ isOptional: false
100
+ },
101
+ toUserId: {
102
+ type: ScalarTypeEnum.String_unsecure(),
103
+ isOptional: false
104
+ },
105
+ reason: {
106
+ type: ScalarTypeEnum.String_unsecure(),
107
+ isOptional: true
108
+ },
109
+ timestamp: {
110
+ type: ScalarTypeEnum.DateTime(),
111
+ isOptional: false
112
+ }
113
+ }
114
+ });
115
+ /**
116
+ * Payload when approval is escalated.
117
+ */
118
+ const ApprovalEscalatedPayload = defineSchemaModel({
119
+ name: "ApprovalEscalatedEventPayload",
120
+ description: "Payload when approval is escalated",
121
+ fields: {
122
+ requestId: {
123
+ type: ScalarTypeEnum.String_unsecure(),
124
+ isOptional: false
125
+ },
126
+ instanceId: {
127
+ type: ScalarTypeEnum.String_unsecure(),
128
+ isOptional: false
129
+ },
130
+ escalationLevel: {
131
+ type: ScalarTypeEnum.Int_unsecure(),
132
+ isOptional: false
133
+ },
134
+ escalatedTo: {
135
+ type: ScalarTypeEnum.String_unsecure(),
136
+ isOptional: false
137
+ },
138
+ reason: {
139
+ type: ScalarTypeEnum.String_unsecure(),
140
+ isOptional: false
141
+ },
142
+ timestamp: {
143
+ type: ScalarTypeEnum.DateTime(),
144
+ isOptional: false
145
+ }
146
+ }
147
+ });
148
+ /**
149
+ * ApprovalRequestedEvent - An approval has been requested.
150
+ */
151
+ const ApprovalRequestedEvent = defineEvent({
152
+ name: "workflow.approval.requested",
153
+ version: 1,
154
+ description: "An approval has been requested.",
155
+ payload: ApprovalRequestedPayload
156
+ });
157
+ /**
158
+ * ApprovalDecidedEvent - An approval decision has been made.
159
+ */
160
+ const ApprovalDecidedEvent = defineEvent({
161
+ name: "workflow.approval.decided",
162
+ version: 1,
163
+ description: "An approval decision has been made.",
164
+ payload: ApprovalDecidedPayload
165
+ });
166
+ /**
167
+ * ApprovalDelegatedEvent - An approval has been delegated.
168
+ */
169
+ const ApprovalDelegatedEvent = defineEvent({
170
+ name: "workflow.approval.delegated",
171
+ version: 1,
172
+ description: "An approval has been delegated.",
173
+ payload: ApprovalDelegatedPayload
174
+ });
175
+ /**
176
+ * ApprovalEscalatedEvent - An approval has been escalated.
177
+ */
178
+ const ApprovalEscalatedEvent = defineEvent({
179
+ name: "workflow.approval.escalated",
180
+ version: 1,
181
+ description: "An approval has been escalated.",
182
+ payload: ApprovalEscalatedPayload
183
+ });
184
+
185
+ //#endregion
186
+ export { ApprovalDecidedEvent, ApprovalDelegatedEvent, ApprovalEscalatedEvent, ApprovalRequestedEvent };