@hotmeshio/long-tail 0.22.1 → 0.22.3
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/build/api/escalations/accumulate.js +38 -19
- package/build/api/escalations/lookups.d.ts +9 -2
- package/build/api/escalations/lookups.js +15 -3
- package/build/api/escalations/metadata.d.ts +2 -0
- package/build/api/escalations/metadata.js +9 -0
- package/build/api/escalations/resolve-batch.js +18 -11
- package/build/api/roles.js +4 -0
- package/build/api/scan-codes/badge-policy.d.ts +10 -0
- package/build/api/scan-codes/badge-policy.js +72 -0
- package/build/api/scan-codes/choice.js +16 -10
- package/build/api/scan-codes/context.d.ts +45 -1
- package/build/api/scan-codes/context.js +51 -3
- package/build/api/scan-codes/execute.js +73 -35
- package/build/api/scan-codes/grant.d.ts +27 -0
- package/build/api/scan-codes/grant.js +67 -0
- package/build/api/scan-codes/hold.d.ts +10 -0
- package/build/api/scan-codes/hold.js +98 -0
- package/build/api/scan-codes/identity.d.ts +5 -2
- package/build/api/scan-codes/identity.js +26 -8
- package/build/api/scan-codes/locate.js +4 -0
- package/build/api/scan-codes/present.d.ts +1 -1
- package/build/api/scan-codes/present.js +43 -0
- package/build/api/scan-codes/subject.d.ts +15 -0
- package/build/api/scan-codes/subject.js +68 -0
- package/build/api/scan-codes/verb-accumulate.d.ts +24 -0
- package/build/api/scan-codes/verb-accumulate.js +151 -0
- package/build/api/scan-codes/verb-fill.d.ts +6 -0
- package/build/api/scan-codes/verb-fill.js +155 -0
- package/build/api/scan-codes/verb-into-subject.d.ts +12 -0
- package/build/api/scan-codes/verb-into-subject.js +157 -0
- package/build/api/scan-codes/verbs-subject.d.ts +33 -0
- package/build/api/scan-codes/verbs-subject.js +247 -0
- package/build/api/scan-codes/verbs.d.ts +11 -29
- package/build/api/scan-codes/verbs.js +51 -131
- package/build/index.d.ts +1 -0
- package/build/index.js +9 -2
- package/build/lib/db/schemas/037_scan_gtin_and_subject_grants.sql +27 -0
- package/build/routes/escalations/acting.d.ts +5 -0
- package/build/routes/escalations/acting.js +8 -1
- package/build/routes/scan-codes.js +3 -0
- package/build/sdk/index.d.ts +1 -0
- package/build/services/escalation/claim-asserted.d.ts +10 -0
- package/build/services/escalation/claim-asserted.js +64 -0
- package/build/services/escalation/facets.d.ts +3 -1
- package/build/services/escalation/facets.js +7 -3
- package/build/services/escalation/index.d.ts +1 -0
- package/build/services/escalation/index.js +3 -1
- package/build/services/iam/acting-identity.d.ts +29 -4
- package/build/services/iam/acting-identity.js +60 -17
- package/build/services/iam/ephemeral.d.ts +21 -0
- package/build/services/iam/ephemeral.js +32 -1
- package/build/services/iam/sql.d.ts +10 -0
- package/build/services/iam/sql.js +32 -3
- package/build/services/knowledge/lookup-cache.d.ts +16 -4
- package/build/services/knowledge/lookup-cache.js +53 -20
- package/build/services/knowledge/lookup-refs.d.ts +3 -2
- package/build/services/knowledge/lookup-refs.js +6 -4
- package/build/services/knowledge/sql.d.ts +2 -0
- package/build/services/knowledge/sql.js +9 -1
- package/build/services/mcp/server-tools.js +1 -1
- package/build/services/orchestrator/condition.d.ts +13 -10
- package/build/services/orchestrator/condition.js +8 -6
- package/build/services/role/badge-grant.d.ts +5 -0
- package/build/services/role/badge-grant.js +36 -0
- package/build/services/role/seed.js +5 -0
- package/build/services/role/types.d.ts +14 -0
- package/build/services/role/types.js +5 -0
- package/build/services/scan-code/index.d.ts +3 -2
- package/build/services/scan-code/index.js +8 -1
- package/build/services/scan-code/parse.d.ts +23 -20
- package/build/services/scan-code/parse.js +45 -90
- package/build/services/scan-code/read.js +1 -0
- package/build/services/scan-code/sql.d.ts +3 -3
- package/build/services/scan-code/sql.js +11 -8
- package/build/services/scan-code/validate-facts.d.ts +5 -0
- package/build/services/scan-code/validate-facts.js +24 -0
- package/build/services/scan-code/validate-query.d.ts +8 -0
- package/build/services/scan-code/validate-query.js +36 -0
- package/build/services/scan-code/validate-subject.d.ts +7 -0
- package/build/services/scan-code/validate-subject.js +185 -0
- package/build/services/scan-code/validate.d.ts +7 -0
- package/build/services/scan-code/validate.js +103 -18
- package/build/services/scan-code/write.d.ts +1 -0
- package/build/services/scan-code/write.js +9 -3
- package/build/shared/form-validation/field-validator.js +4 -0
- package/build/shared/form-validation/index.d.ts +1 -0
- package/build/shared/form-validation/index.js +1 -0
- package/build/shared/form-validation/x-lt-scan.d.ts +52 -0
- package/build/shared/form-validation/x-lt-scan.js +166 -0
- package/build/shared/scan-code/gtin.d.ts +11 -0
- package/build/shared/scan-code/gtin.js +38 -0
- package/build/shared/scan-code/index.d.ts +2 -0
- package/build/shared/scan-code/index.js +11 -0
- package/build/shared/scan-code/parse.d.ts +46 -0
- package/build/shared/scan-code/parse.js +133 -0
- package/build/system/mcp-servers/admin/scan-codes.js +10 -4
- package/build/system/mcp-servers/admin/schemas.d.ts +939 -28
- package/build/system/mcp-servers/admin/schemas.js +72 -6
- package/build/system/mcp-servers/human-queue-schemas.d.ts +6 -6
- package/build/system/seed/tool-manifests-admin.d.ts +202 -1
- package/build/system/seed/tool-manifests-admin.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/escalation.d.ts +16 -8
- package/build/types/escalation.js +18 -7
- package/build/types/index.d.ts +4 -4
- package/build/types/index.js +10 -1
- package/build/types/scan-code/constants.d.ts +182 -0
- package/build/types/{scan-code.js → scan-code/constants.js} +72 -11
- package/build/types/scan-code/index.d.ts +3 -0
- package/build/types/scan-code/index.js +17 -0
- package/build/types/scan-code/response.d.ts +145 -0
- package/build/types/scan-code/response.js +2 -0
- package/build/types/scan-code/rule.d.ts +229 -0
- package/build/types/scan-code/rule.js +2 -0
- package/build/types/startup.d.ts +3 -1
- package/dashboard/dist/assets/{AdminDashboard-BbWve-Ax.js → AdminDashboard-hI5-kKpL.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-BbWve-Ax.js.map → AdminDashboard-hI5-kKpL.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-M-9eTKhP.js → AgentConfigPage-DetU4HZe.js} +2 -2
- package/dashboard/dist/assets/{AgentConfigPage-M-9eTKhP.js.map → AgentConfigPage-DetU4HZe.js.map} +1 -1
- package/dashboard/dist/assets/{AgentDetailPage-CsakSlx5.js → AgentDetailPage-DrGXo8KQ.js} +3 -3
- package/dashboard/dist/assets/{AgentDetailPage-CsakSlx5.js.map → AgentDetailPage-DrGXo8KQ.js.map} +1 -1
- package/dashboard/dist/assets/{AgentsPage-Cj_cRTT1.js → AgentsPage-D4md5BzM.js} +2 -2
- package/dashboard/dist/assets/{AgentsPage-Cj_cRTT1.js.map → AgentsPage-D4md5BzM.js.map} +1 -1
- package/dashboard/dist/assets/{AvailableEscalationsPage-BXJmMBM1.js → AvailableEscalationsPage-B2bS2ZJy.js} +2 -2
- package/dashboard/dist/assets/{AvailableEscalationsPage-BXJmMBM1.js.map → AvailableEscalationsPage-B2bS2ZJy.js.map} +1 -1
- package/dashboard/dist/assets/{BotPicker-CGB16rYU.js → BotPicker-BXtey255.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-CGB16rYU.js.map → BotPicker-BXtey255.js.map} +1 -1
- package/dashboard/dist/assets/{BulkAssignModal-MjxcU7N1.js → BulkAssignModal-CSL_PeZv.js} +2 -2
- package/dashboard/dist/assets/{BulkAssignModal-MjxcU7N1.js.map → BulkAssignModal-CSL_PeZv.js.map} +1 -1
- package/dashboard/dist/assets/CapabilitiesPage-5scufTHW.js +2 -0
- package/dashboard/dist/assets/{CapabilitiesPage-BxadotXn.js.map → CapabilitiesPage-5scufTHW.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-BBNpP-6h.js → CollapsibleSection-DjjDGxP_.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-BBNpP-6h.js.map → CollapsibleSection-DjjDGxP_.js.map} +1 -1
- package/dashboard/dist/assets/{ConfirmDeleteModal-D_kAbT_D.js → ConfirmDeleteModal-DJSmsHQM.js} +2 -2
- package/dashboard/dist/assets/{ConfirmDeleteModal-D_kAbT_D.js.map → ConfirmDeleteModal-DJSmsHQM.js.map} +1 -1
- package/dashboard/dist/assets/CountdownTimer-C5ZRYPfF.js +2 -0
- package/dashboard/dist/assets/{CountdownTimer-CI_JOAvk.js.map → CountdownTimer-C5ZRYPfF.js.map} +1 -1
- package/dashboard/dist/assets/{CredentialsPage-C9OA1Q2J.js → CredentialsPage-CV6e60yC.js} +2 -2
- package/dashboard/dist/assets/{CredentialsPage-C9OA1Q2J.js.map → CredentialsPage-CV6e60yC.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-sxLLBf2I.js → CronLabel-CnqhqW0B.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-sxLLBf2I.js.map → CronLabel-CnqhqW0B.js.map} +1 -1
- package/dashboard/dist/assets/{ElapsedCell-jH9m8Dgl.js → ElapsedCell-C1IOn-tj.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-jH9m8Dgl.js.map → ElapsedCell-C1IOn-tj.js.map} +1 -1
- package/dashboard/dist/assets/{EntityTimelinePanel-Dl3Nr2kk.js → EntityTimelinePanel-Dz6Liig4.js} +2 -2
- package/dashboard/dist/assets/{EntityTimelinePanel-Dl3Nr2kk.js.map → EntityTimelinePanel-Dz6Liig4.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListSchemaPage-DAK6It5J.js → EscalationListSchemaPage-bgdmLmrh.js} +3 -3
- package/dashboard/dist/assets/{EscalationListSchemaPage-DAK6It5J.js.map → EscalationListSchemaPage-bgdmLmrh.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListView-CAHbdxKR.js → EscalationListView-CrlD3ZGt.js} +2 -2
- package/dashboard/dist/assets/{EscalationListView-CAHbdxKR.js.map → EscalationListView-CrlD3ZGt.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationSchemaPage-DotfAMCL.js → EscalationSchemaPage-dxXO_T3t.js} +3 -3
- package/dashboard/dist/assets/{EscalationSchemaPage-DotfAMCL.js.map → EscalationSchemaPage-dxXO_T3t.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationTimeline-DqmFydnU.js → EscalationTimeline-C3WQZQuM.js} +2 -2
- package/dashboard/dist/assets/{EscalationTimeline-DqmFydnU.js.map → EscalationTimeline-C3WQZQuM.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationTitleSelect-BpRquguO.js → EscalationTitleSelect-CTtcETUO.js} +2 -2
- package/dashboard/dist/assets/{EscalationTitleSelect-BpRquguO.js.map → EscalationTitleSelect-CTtcETUO.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-DtGOqnP4.js → EscalationsOverview-DAjZ7JY2.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-DtGOqnP4.js.map → EscalationsOverview-DAjZ7JY2.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-DSHqKyX2.js → EventTable-B72DQP_v.js} +2 -2
- package/dashboard/dist/assets/{EventTable-DSHqKyX2.js.map → EventTable-B72DQP_v.js.map} +1 -1
- package/dashboard/dist/assets/{FilterBar-Dxd0wNSW.js → FilterBar-CCTaA_LH.js} +2 -2
- package/dashboard/dist/assets/{FilterBar-Dxd0wNSW.js.map → FilterBar-CCTaA_LH.js.map} +1 -1
- package/dashboard/dist/assets/GrantScopeField-BzWGzBfA.js +2 -0
- package/dashboard/dist/assets/GrantScopeField-BzWGzBfA.js.map +1 -0
- package/dashboard/dist/assets/{GraphInvokePage-ChqqGkro.js → GraphInvokePage-CAsCgFo3.js} +2 -2
- package/dashboard/dist/assets/{GraphInvokePage-ChqqGkro.js.map → GraphInvokePage-CAsCgFo3.js.map} +1 -1
- package/dashboard/dist/assets/{HomePage-ByKesG8w.js → HomePage-DseE_iSr.js} +2 -2
- package/dashboard/dist/assets/{HomePage-ByKesG8w.js.map → HomePage-DseE_iSr.js.map} +1 -1
- package/dashboard/dist/assets/{ListToolbar-Ddz_S2av.js → ListToolbar-1zdqnjW6.js} +2 -2
- package/dashboard/dist/assets/{ListToolbar-Ddz_S2av.js.map → ListToolbar-1zdqnjW6.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-CVe13tEv.js → McpOverview-DS_JXDW5.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-CVe13tEv.js.map → McpOverview-DS_JXDW5.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-BQYF2Mjq.js → McpQueryDetailPage-BeMUGcv3.js} +2 -2
- package/dashboard/dist/assets/{McpQueryDetailPage-BQYF2Mjq.js.map → McpQueryDetailPage-BeMUGcv3.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryPage-DZi5lm7s.js → McpQueryPage-CeiLO_LR.js} +2 -2
- package/dashboard/dist/assets/{McpQueryPage-DZi5lm7s.js.map → McpQueryPage-CeiLO_LR.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-DreARTE1.js → McpRunDetailPage-DYp1uZK2.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-DreARTE1.js.map → McpRunDetailPage-DYp1uZK2.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunsPage-DmO0YVhT.js → McpRunsPage-VeaDzcL4.js} +2 -2
- package/dashboard/dist/assets/{McpRunsPage-DmO0YVhT.js.map → McpRunsPage-VeaDzcL4.js.map} +1 -1
- package/dashboard/dist/assets/{OperationsPage-DpjCO85T.js → OperationsPage-DK2mgaXf.js} +2 -2
- package/dashboard/dist/assets/{OperationsPage-DpjCO85T.js.map → OperationsPage-DK2mgaXf.js.map} +1 -1
- package/dashboard/dist/assets/{OperatorDashboard-Vv_MEBkv.js → OperatorDashboard-BNjLF0f7.js} +2 -2
- package/dashboard/dist/assets/{OperatorDashboard-Vv_MEBkv.js.map → OperatorDashboard-BNjLF0f7.js.map} +1 -1
- package/dashboard/dist/assets/{PersonaDetailPage-CW-2uBHY.js → PersonaDetailPage-IQ2fZLa6.js} +2 -2
- package/dashboard/dist/assets/{PersonaDetailPage-CW-2uBHY.js.map → PersonaDetailPage-IQ2fZLa6.js.map} +1 -1
- package/dashboard/dist/assets/{PersonasPage-CO6yYQdm.js → PersonasPage-DpGFEcU-.js} +2 -2
- package/dashboard/dist/assets/{PersonasPage-CO6yYQdm.js.map → PersonasPage-DpGFEcU-.js.map} +1 -1
- package/dashboard/dist/assets/{PortalPage-DcNqhBlg.js → PortalPage-D07xyvG_.js} +2 -2
- package/dashboard/dist/assets/{PortalPage-DcNqhBlg.js.map → PortalPage-D07xyvG_.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessDetailPage-BuipGZcC.js → ProcessDetailPage-t8EEYSMk.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-BuipGZcC.js.map → ProcessDetailPage-t8EEYSMk.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-D9DYntvl.js → ProcessesListPage-BDUXLFdb.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-D9DYntvl.js.map → ProcessesListPage-BDUXLFdb.js.map} +1 -1
- package/dashboard/dist/assets/ResolverForm-BwWOYv_Z.js +8 -0
- package/dashboard/dist/assets/ResolverForm-BwWOYv_Z.js.map +1 -0
- package/dashboard/dist/assets/RoleDetailPage-zMF3x2xi.js +8 -0
- package/dashboard/dist/assets/RoleDetailPage-zMF3x2xi.js.map +1 -0
- package/dashboard/dist/assets/{RolesPage-0QJOBSzF.js → RolesPage-CEBp_PpL.js} +2 -2
- package/dashboard/dist/assets/{RolesPage-0QJOBSzF.js.map → RolesPage-CEBp_PpL.js.map} +1 -1
- package/dashboard/dist/assets/{RunAsSelector-Dh4lyyRo.js → RunAsSelector-CC_EHN3z.js} +2 -2
- package/dashboard/dist/assets/{RunAsSelector-Dh4lyyRo.js.map → RunAsSelector-CC_EHN3z.js.map} +1 -1
- package/dashboard/dist/assets/ScanCodesPage-DD4uU-jY.js +2 -0
- package/dashboard/dist/assets/ScanCodesPage-DD4uU-jY.js.map +1 -0
- package/dashboard/dist/assets/ScanSchemeDetailPage-CUW8gYFh.js +2 -0
- package/dashboard/dist/assets/ScanSchemeDetailPage-CUW8gYFh.js.map +1 -0
- package/dashboard/dist/assets/ScanStationPage-DpO_ESuf.js +2 -0
- package/dashboard/dist/assets/ScanStationPage-DpO_ESuf.js.map +1 -0
- package/dashboard/dist/assets/{StickyPagination-BSUyf5ja.js → StickyPagination-cNqSDm5f.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-BSUyf5ja.js.map → StickyPagination-cNqSDm5f.js.map} +1 -1
- package/dashboard/dist/assets/{StreamMessageDetail--tp7l2Sd.js → StreamMessageDetail-C4oZqQdB.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail--tp7l2Sd.js.map → StreamMessageDetail-C4oZqQdB.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-CxBZ2THh.js → SwimlaneTimeline-BjBiV7GT.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-CxBZ2THh.js.map → SwimlaneTimeline-BjBiV7GT.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-BJ1QrmPH.js → TaskDetailPage-pO_AnVS1.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-BJ1QrmPH.js.map → TaskDetailPage-pO_AnVS1.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-5BydGWmt.js → TasksListPage-DKDHlWP7.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-5BydGWmt.js.map → TasksListPage-DKDHlWP7.js.map} +1 -1
- package/dashboard/dist/assets/{TimeAgo-CCnz84Y4.js → TimeAgo-D2qchUuJ.js} +2 -2
- package/dashboard/dist/assets/{TimeAgo-CCnz84Y4.js.map → TimeAgo-D2qchUuJ.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-D0ru7Lya.js → TimestampCell-DeswZGGo.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-D0ru7Lya.js.map → TimestampCell-DeswZGGo.js.map} +1 -1
- package/dashboard/dist/assets/{ToolTestPanel-3Kpofmen.js → ToolTestPanel-DJh7PIUa.js} +2 -2
- package/dashboard/dist/assets/{ToolTestPanel-3Kpofmen.js.map → ToolTestPanel-DJh7PIUa.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-BaBXD_AK.js → TopicDetailPage-CsgDJ4Z4.js} +2 -2
- package/dashboard/dist/assets/{TopicDetailPage-BaBXD_AK.js.map → TopicDetailPage-CsgDJ4Z4.js.map} +1 -1
- package/dashboard/dist/assets/{TopicsPage-Cnm1AAjh.js → TopicsPage-tBRZDVDN.js} +2 -2
- package/dashboard/dist/assets/{TopicsPage-Cnm1AAjh.js.map → TopicsPage-tBRZDVDN.js.map} +1 -1
- package/dashboard/dist/assets/{UserName-CXsdPiMZ.js → UserName-B-5JcDck.js} +2 -2
- package/dashboard/dist/assets/{UserName-CXsdPiMZ.js.map → UserName-B-5JcDck.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-zx3AUJFd.js → WorkflowExecutionPage-BPHVnhp6.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-zx3AUJFd.js.map → WorkflowExecutionPage-BPHVnhp6.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsDashboard-DfAGK1l7.js → WorkflowsDashboard-CxLlfZmY.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsDashboard-DfAGK1l7.js.map → WorkflowsDashboard-CxLlfZmY.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview-QIYvoa13.js → WorkflowsOverview-C4az5rwp.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-QIYvoa13.js.map → WorkflowsOverview-C4az5rwp.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-DGgO3hyB.js → YamlWorkflowDetailPage-BmhlAUFQ.js} +8 -8
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-DGgO3hyB.js.map → YamlWorkflowDetailPage-BmhlAUFQ.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-CEsHm0B9.js → YamlWorkflowsPage-CSbG5o2V.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-CEsHm0B9.js.map → YamlWorkflowsPage-CSbG5o2V.js.map} +1 -1
- package/dashboard/dist/assets/{agents-v_HH3Rji.js → agents-BohEn7vw.js} +2 -2
- package/dashboard/dist/assets/{agents-v_HH3Rji.js.map → agents-BohEn7vw.js.map} +1 -1
- package/dashboard/dist/assets/{bots-bwvWYrXz.js → bots-BG2EO-Wi.js} +2 -2
- package/dashboard/dist/assets/{bots-bwvWYrXz.js.map → bots-BG2EO-Wi.js.map} +1 -1
- package/dashboard/dist/assets/{capabilities-D4vaw_nQ.js → capabilities-CeFrBmYX.js} +2 -2
- package/dashboard/dist/assets/{capabilities-D4vaw_nQ.js.map → capabilities-CeFrBmYX.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-CiiZ6LJF.js → controlplane-Dhvt8l8F.js} +2 -2
- package/dashboard/dist/assets/{controlplane-CiiZ6LJF.js.map → controlplane-Dhvt8l8F.js.map} +1 -1
- package/dashboard/dist/assets/{escalation-columns-Dv-MB3eC.js → escalation-columns-BWMNxImp.js} +2 -2
- package/dashboard/dist/assets/{escalation-columns-Dv-MB3eC.js.map → escalation-columns-BWMNxImp.js.map} +1 -1
- package/dashboard/dist/assets/{index-CzjUgFt_.js → index-Bd_dgyfJ.js} +2 -2
- package/dashboard/dist/assets/{index-CzjUgFt_.js.map → index-Bd_dgyfJ.js.map} +1 -1
- package/dashboard/dist/assets/{index-IJmtbuLh.js → index-C8VlM2Oe.js} +2 -2
- package/dashboard/dist/assets/{index-IJmtbuLh.js.map → index-C8VlM2Oe.js.map} +1 -1
- package/dashboard/dist/assets/{index-CcuvGdvf.js → index-CiqSVDga.js} +2 -2
- package/dashboard/dist/assets/{index-CcuvGdvf.js.map → index-CiqSVDga.js.map} +1 -1
- package/dashboard/dist/assets/{index-C3WutFpT.js → index-Cl_YXEdp.js} +2 -2
- package/dashboard/dist/assets/{index-C3WutFpT.js.map → index-Cl_YXEdp.js.map} +1 -1
- package/dashboard/dist/assets/index-CtZWpy22.js +2 -0
- package/dashboard/dist/assets/index-CtZWpy22.js.map +1 -0
- package/dashboard/dist/assets/{index-CjenRVX_.js → index-D90D9y0J.js} +2 -2
- package/dashboard/dist/assets/{index-CjenRVX_.js.map → index-D90D9y0J.js.map} +1 -1
- package/dashboard/dist/assets/{index-BLB77tc8.js → index-DABkM7s-.js} +2 -2
- package/dashboard/dist/assets/{index-BLB77tc8.js.map → index-DABkM7s-.js.map} +1 -1
- package/dashboard/dist/assets/index-Dbwu51xm.js +3 -0
- package/dashboard/dist/assets/index-Dbwu51xm.js.map +1 -0
- package/dashboard/dist/assets/{index-2tzsxFat.js → index-Dc3Om6G3.js} +2 -2
- package/dashboard/dist/assets/{index-2tzsxFat.js.map → index-Dc3Om6G3.js.map} +1 -1
- package/dashboard/dist/assets/{index-D2VKBMng.js → index-Dc_zWK23.js} +2 -2
- package/dashboard/dist/assets/{index-D2VKBMng.js.map → index-Dc_zWK23.js.map} +1 -1
- package/dashboard/dist/assets/index-DcppjzP5.css +1 -0
- package/dashboard/dist/assets/{index-C_ISDOWJ.js → index-Y-bdW8vo.js} +2 -2
- package/dashboard/dist/assets/{index-C_ISDOWJ.js.map → index-Y-bdW8vo.js.map} +1 -1
- package/dashboard/dist/assets/{index-C4Lce2ET.js → index-dYKgd06u.js} +3 -3
- package/dashboard/dist/assets/{index-C4Lce2ET.js.map → index-dYKgd06u.js.map} +1 -1
- package/dashboard/dist/assets/index-fUsx_gYx.js +67 -0
- package/dashboard/dist/assets/index-fUsx_gYx.js.map +1 -0
- package/dashboard/dist/assets/{knowledge-D1YP2NzS.js → knowledge-CCcTidNV.js} +2 -2
- package/dashboard/dist/assets/{knowledge-D1YP2NzS.js.map → knowledge-CCcTidNV.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-Bb5psC61.js → mcp-CLA1z7Pg.js} +2 -2
- package/dashboard/dist/assets/{mcp-Bb5psC61.js.map → mcp-CLA1z7Pg.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-D5jUdZwN.js → mcp-query-CWG0WMAs.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-D5jUdZwN.js.map → mcp-query-CWG0WMAs.js.map} +1 -1
- package/dashboard/dist/assets/metadata-display-B7X5hGxG.js +2 -0
- package/dashboard/dist/assets/metadata-display-B7X5hGxG.js.map +1 -0
- package/dashboard/dist/assets/{personas-CDndbkp4.js → personas-8jURIzx6.js} +2 -2
- package/dashboard/dist/assets/{personas-CDndbkp4.js.map → personas-8jURIzx6.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-Dq3kNhKu.js → pipelines-hVVRAXqG.js} +2 -2
- package/dashboard/dist/assets/{pipelines-Dq3kNhKu.js.map → pipelines-hVVRAXqG.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-BlpDsWCy.js → tasks-BE1O57Bf.js} +2 -2
- package/dashboard/dist/assets/{tasks-BlpDsWCy.js.map → tasks-BE1O57Bf.js.map} +1 -1
- package/dashboard/dist/assets/{topics-C0YaR9fu.js → topics-Bg96Wp1r.js} +2 -2
- package/dashboard/dist/assets/{topics-C0YaR9fu.js.map → topics-Bg96Wp1r.js.map} +1 -1
- package/dashboard/dist/assets/{useDebouncedValue-B-KC5ba3.js → useDebouncedValue-DmEveyEy.js} +2 -2
- package/dashboard/dist/assets/{useDebouncedValue-B-KC5ba3.js.map → useDebouncedValue-DmEveyEy.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-Dkr5g2Ac.js → useNamespace-DHgkzIuL.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-Dkr5g2Ac.js.map → useNamespace-DHgkzIuL.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-BANBOshA.js → useYamlActivityEvents-RU0PvU8S.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-BANBOshA.js.map → useYamlActivityEvents-RU0PvU8S.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-BLYoJfmB.js → yaml-workflows-DQWE9ijc.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-BLYoJfmB.js.map → yaml-workflows-DQWE9ijc.js.map} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/docs/dashboard.md +1 -1
- package/docs/hitl/lookups.md +27 -18
- package/docs/hitl/x-lt-scan.md +51 -0
- package/docs/hitl/x-lt-validation.md +1 -1
- package/docs/hitl/x-lt-widget.md +1 -1
- package/docs/hitl-guide.md +3 -1
- package/docs/scan-codes.md +303 -33
- package/package.json +1 -1
- package/build/types/scan-code.d.ts +0 -317
- package/dashboard/dist/assets/CapabilitiesPage-BxadotXn.js +0 -2
- package/dashboard/dist/assets/CountdownTimer-CI_JOAvk.js +0 -2
- package/dashboard/dist/assets/ResolverForm-BVG8X0sS.js +0 -8
- package/dashboard/dist/assets/ResolverForm-BVG8X0sS.js.map +0 -1
- package/dashboard/dist/assets/RoleDetailPage-KCXDqoJz.js +0 -8
- package/dashboard/dist/assets/RoleDetailPage-KCXDqoJz.js.map +0 -1
- package/dashboard/dist/assets/ScanCodesPage-CUhCz-Yr.js +0 -2
- package/dashboard/dist/assets/ScanCodesPage-CUhCz-Yr.js.map +0 -1
- package/dashboard/dist/assets/ScanSchemeDetailPage-qzXKNqJK.js +0 -2
- package/dashboard/dist/assets/ScanSchemeDetailPage-qzXKNqJK.js.map +0 -1
- package/dashboard/dist/assets/ScanStationPage-D8e8cG3t.js +0 -2
- package/dashboard/dist/assets/ScanStationPage-D8e8cG3t.js.map +0 -1
- package/dashboard/dist/assets/index-CT-FN6CW.js +0 -3
- package/dashboard/dist/assets/index-CT-FN6CW.js.map +0 -1
- package/dashboard/dist/assets/index-D6pBLZFu.js +0 -2
- package/dashboard/dist/assets/index-D6pBLZFu.js.map +0 -1
- package/dashboard/dist/assets/index-Dh8MJl3L.css +0 -1
- package/dashboard/dist/assets/index-N71QQ3J5.js +0 -67
- package/dashboard/dist/assets/index-N71QQ3J5.js.map +0 -1
- package/dashboard/dist/assets/metadata-display-COo3mMCr.js +0 -2
- package/dashboard/dist/assets/metadata-display-COo3mMCr.js.map +0 -1
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.bags = bags;
|
|
37
|
+
exports.claimGuard = claimGuard;
|
|
38
|
+
exports.matchGuard = matchGuard;
|
|
39
|
+
exports.failedAdd = failedAdd;
|
|
40
|
+
exports.rendered = rendered;
|
|
41
|
+
exports.accumulateFromSubject = accumulateFromSubject;
|
|
42
|
+
exports.already = already;
|
|
43
|
+
const scanCodeService = __importStar(require("../../services/scan-code"));
|
|
44
|
+
const escalationService = __importStar(require("../../services/escalation"));
|
|
45
|
+
const accumulate_1 = require("../escalations/accumulate");
|
|
46
|
+
const helpers_1 = require("../escalations/helpers");
|
|
47
|
+
const metadata_1 = require("../escalations/metadata");
|
|
48
|
+
const escalation_1 = require("../../types/escalation");
|
|
49
|
+
const types_1 = require("../../types");
|
|
50
|
+
const context_1 = require("./context");
|
|
51
|
+
const grant_1 = require("./grant");
|
|
52
|
+
const subject_1 = require("./subject");
|
|
53
|
+
// ── Acting on the held subject ──────────────────────────────────────────────
|
|
54
|
+
//
|
|
55
|
+
// The station holds an item; this scan names where it goes. The step checks
|
|
56
|
+
// the pairing first (match), refusing with nothing written when it is wrong,
|
|
57
|
+
// then writes by id in one atomic statement: the subject joins the scanned
|
|
58
|
+
// container with its own row as the reciprocal (from: 'subject'), or the
|
|
59
|
+
// subject's row collects the scanned code (into: 'subject', in
|
|
60
|
+
// verb-into-subject.ts).
|
|
61
|
+
const STOCK_REFUSAL = 'That is not where this one goes.';
|
|
62
|
+
const STOCK_CONFLICT = 'That container just closed. Scan it again, or the next one.';
|
|
63
|
+
const STOCK_PLACED = 'This one is already placed.';
|
|
64
|
+
/** The step's template bags with the subject, the container, and the scanned item's row once located. */
|
|
65
|
+
function bags(ctx, container, item) {
|
|
66
|
+
return {
|
|
67
|
+
...(0, context_1.templateContext)(ctx),
|
|
68
|
+
...(container ? { container: container.metadata ?? {} } : {}),
|
|
69
|
+
...(item ? { item: item.metadata ?? {} } : {}),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/** Refuse the act when someone else holds a live claim on the subject. */
|
|
73
|
+
async function claimGuard(step, ctx, subject) {
|
|
74
|
+
if (step.subject?.claimedByOther === 'allow')
|
|
75
|
+
return null;
|
|
76
|
+
const other = await (0, subject_1.claimedByOther)(subject.row, ctx.auth.userId);
|
|
77
|
+
return other ? (0, context_1.refused)(`Claimed by **${other.displayName}**.`) : null;
|
|
78
|
+
}
|
|
79
|
+
/** The container the scan names: a pending accumulator under the actor's read scope. */
|
|
80
|
+
async function locateContainer(step, ctx) {
|
|
81
|
+
const selector = step.params?.accumulate?.container;
|
|
82
|
+
const scope = await (0, helpers_1.getEscalationReadScope)(ctx.auth.userId);
|
|
83
|
+
const roles = (0, metadata_1.restrictScopeRoles)(scope.allRoles, scope.global, selector?.roles ?? step.query?.roles);
|
|
84
|
+
if (roles !== null && roles.length === 0)
|
|
85
|
+
return null;
|
|
86
|
+
const found = await escalationService.searchByFacets({
|
|
87
|
+
roles: roles ?? undefined,
|
|
88
|
+
types: selector?.types,
|
|
89
|
+
subtypes: selector?.subtypes,
|
|
90
|
+
facets: { ...selector?.facets, [ctx.scheme.target_facet]: ctx.parsed.target },
|
|
91
|
+
status: 'pending',
|
|
92
|
+
exists: [escalation_1.ESCALATION_ACCUMULATE_KEYS.COUNT],
|
|
93
|
+
limit: 2,
|
|
94
|
+
}, { total: false });
|
|
95
|
+
return found.escalations.filter((row) => row.id !== ctx.subject?.row.id);
|
|
96
|
+
}
|
|
97
|
+
const WHOLE_BAG_TOKEN = /^\{(subject|container|item)\.([a-zA-Z0-9_]+)\}$/;
|
|
98
|
+
/**
|
|
99
|
+
* One match.target template as the values it allows. A template that is a
|
|
100
|
+
* single bag token naming a list facet (`{subject.offeredContainers}`) allows every
|
|
101
|
+
* entry; anything else renders to one value. A token with nothing to read
|
|
102
|
+
* allows nothing.
|
|
103
|
+
*/
|
|
104
|
+
function expandTarget(template, tpl) {
|
|
105
|
+
const whole = template.match(WHOLE_BAG_TOKEN);
|
|
106
|
+
if (whole) {
|
|
107
|
+
const value = tpl[whole[1]]?.[whole[2]];
|
|
108
|
+
if (Array.isArray(value))
|
|
109
|
+
return value.filter((v) => v !== null && v !== '').map(String);
|
|
110
|
+
}
|
|
111
|
+
try {
|
|
112
|
+
return [scanCodeService.interpolateScanTemplate(template, tpl)];
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
return [];
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* The pre-write guard. Returns the refusal when the pairing is wrong, null
|
|
120
|
+
* when it holds (or the step declares no match).
|
|
121
|
+
*/
|
|
122
|
+
function matchGuard(step, ctx, container, item) {
|
|
123
|
+
const match = step.match;
|
|
124
|
+
if (!match)
|
|
125
|
+
return null;
|
|
126
|
+
const tpl = bags(ctx, container, item);
|
|
127
|
+
const expected = (match.target ?? []).flatMap((t) => expandTarget(t, tpl));
|
|
128
|
+
const targetOk = match.target === undefined || expected.includes(ctx.parsed.target);
|
|
129
|
+
const subjectMeta = (ctx.subject?.row.metadata ?? {});
|
|
130
|
+
const containerMeta = (container?.metadata ?? {});
|
|
131
|
+
// With no container located there is nothing to compare; the step falls through.
|
|
132
|
+
const facetsOk = match.facets === undefined || !container || (match.facets.every((f) => subjectMeta[f] !== undefined && subjectMeta[f] !== null && String(subjectMeta[f]) === String(containerMeta[f])));
|
|
133
|
+
if (targetOk && facetsOk)
|
|
134
|
+
return null;
|
|
135
|
+
const markdown = scanCodeService.renderScanCopy(step.refuse?.markdown ?? STOCK_REFUSAL, tpl);
|
|
136
|
+
return (0, context_1.refused)(markdown, { refusal: { markdown, ...(expected.length ? { expected } : {}) } });
|
|
137
|
+
}
|
|
138
|
+
const PLACED_OUTCOMES = ['reciprocal-terminal', 'reciprocal-full', 'reciprocal-duplicate'];
|
|
139
|
+
/**
|
|
140
|
+
* Map a failed add onto what the bench says. 404 falls through. `keepSubject`
|
|
141
|
+
* leaves the hold in place when the reciprocal was already placed (the
|
|
142
|
+
* subject is the container the actor is still filling).
|
|
143
|
+
*/
|
|
144
|
+
function failedAdd(step, ctx, result, container, keepSubject = false) {
|
|
145
|
+
const outcome = result.data?.outcome;
|
|
146
|
+
if (result.status === 404)
|
|
147
|
+
return null;
|
|
148
|
+
if (result.status === 403)
|
|
149
|
+
return (0, context_1.forbidden)(result.error);
|
|
150
|
+
if (outcome && PLACED_OUTCOMES.includes(outcome)) {
|
|
151
|
+
return (0, context_1.refused)(STOCK_PLACED, { clearSubject: !keepSubject });
|
|
152
|
+
}
|
|
153
|
+
if (outcome === 'claimed-by-other' || outcome === 'claim-expired')
|
|
154
|
+
return (0, context_1.conflict)(result.error);
|
|
155
|
+
if (result.status === 409) {
|
|
156
|
+
const markdown = scanCodeService.renderScanCopy(step.refuse?.conflict ?? STOCK_CONFLICT, bags(ctx, container));
|
|
157
|
+
// A lost race for a shared container: the subject's offer may have moved, so drop it.
|
|
158
|
+
return (0, context_1.refused)(markdown, { clearSubject: !!step.refuse?.conflict });
|
|
159
|
+
}
|
|
160
|
+
return (0, context_1.refused)(result.error ?? STOCK_REFUSAL);
|
|
161
|
+
}
|
|
162
|
+
/** The step's itemKey, payload and metadata, or null when a template token has nothing to read. */
|
|
163
|
+
function rendered(step, ctx, itemKeyDefault, item) {
|
|
164
|
+
const tpl = bags(ctx, undefined, item);
|
|
165
|
+
try {
|
|
166
|
+
return {
|
|
167
|
+
itemKey: scanCodeService.interpolateScanTemplate(step.params?.itemKey ?? itemKeyDefault ?? '', tpl),
|
|
168
|
+
payload: step.params?.resolverPayload
|
|
169
|
+
? scanCodeService.interpolateScanTemplate(step.params.resolverPayload, tpl)
|
|
170
|
+
: undefined,
|
|
171
|
+
metadata: {
|
|
172
|
+
...(step.params?.metadata ? scanCodeService.interpolateScanTemplate(step.params.metadata, tpl) : {}),
|
|
173
|
+
...(0, context_1.provenance)(ctx),
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
catch (err) {
|
|
178
|
+
if (err instanceof scanCodeService.ScanTemplateError)
|
|
179
|
+
return null;
|
|
180
|
+
throw err;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/** The subject joins the scanned container; the subject's row is the reciprocal. */
|
|
184
|
+
async function accumulateFromSubject(step, ctx) {
|
|
185
|
+
const subject = ctx.subject;
|
|
186
|
+
const claimed = await claimGuard(step, ctx, subject);
|
|
187
|
+
if (claimed)
|
|
188
|
+
return claimed;
|
|
189
|
+
// 1. Locate the container the scan names
|
|
190
|
+
const containers = await locateContainer(step, ctx);
|
|
191
|
+
if (containers && containers.length > 1) {
|
|
192
|
+
return (0, context_1.conflict)(`more than one open container carries ${ctx.scheme.target_facet} = ${ctx.parsed.target}`);
|
|
193
|
+
}
|
|
194
|
+
const container = containers?.[0];
|
|
195
|
+
// 2. Check the pairing before anything is written
|
|
196
|
+
const mismatch = matchGuard(step, ctx, container);
|
|
197
|
+
if (mismatch)
|
|
198
|
+
return mismatch;
|
|
199
|
+
if (!container) {
|
|
200
|
+
if (!step.refuse?.missing)
|
|
201
|
+
return null;
|
|
202
|
+
return (0, context_1.refused)(scanCodeService.renderScanCopy(step.refuse.missing, bags(ctx)));
|
|
203
|
+
}
|
|
204
|
+
// 3. Spend the badge, then write both rows in one statement
|
|
205
|
+
const values = rendered(step, ctx);
|
|
206
|
+
if (!values)
|
|
207
|
+
return null;
|
|
208
|
+
const notPrimed = (await (0, grant_1.identityGate)(step, ctx)) ?? (await (0, grant_1.spendGrant)(ctx));
|
|
209
|
+
if (notPrimed)
|
|
210
|
+
return notPrimed;
|
|
211
|
+
const result = await (0, accumulate_1.accumulateItem)({
|
|
212
|
+
id: container.id,
|
|
213
|
+
itemKey: values.itemKey,
|
|
214
|
+
payload: values.payload,
|
|
215
|
+
metadata: values.metadata,
|
|
216
|
+
reciprocal: { id: subject.row.id },
|
|
217
|
+
}, ctx.auth);
|
|
218
|
+
// 4. Report
|
|
219
|
+
if (result.status !== 200) {
|
|
220
|
+
if (result.data?.outcome === 'duplicate-item') {
|
|
221
|
+
return already(step, container);
|
|
222
|
+
}
|
|
223
|
+
return failedAdd(step, ctx, result, container);
|
|
224
|
+
}
|
|
225
|
+
return (0, context_1.withDone)({
|
|
226
|
+
status: 200,
|
|
227
|
+
data: {
|
|
228
|
+
outcome: types_1.SCAN_OUTCOMES.EXECUTED,
|
|
229
|
+
verb: step.verb,
|
|
230
|
+
escalation: { id: container.id, ...result.data },
|
|
231
|
+
clearSubject: true,
|
|
232
|
+
},
|
|
233
|
+
}, step, bags(ctx, container));
|
|
234
|
+
}
|
|
235
|
+
/** The item is already where the scan says: harmless, nothing written. */
|
|
236
|
+
function already(step, row, keepSubject = false) {
|
|
237
|
+
return {
|
|
238
|
+
status: 200,
|
|
239
|
+
data: {
|
|
240
|
+
outcome: types_1.SCAN_OUTCOMES.EXECUTED,
|
|
241
|
+
verb: step.verb,
|
|
242
|
+
escalation: { id: row.id },
|
|
243
|
+
already: true,
|
|
244
|
+
clearSubject: !keepSubject,
|
|
245
|
+
},
|
|
246
|
+
};
|
|
247
|
+
}
|
|
@@ -1,41 +1,23 @@
|
|
|
1
1
|
import { type ScanExecuteResponse, type ScanStep } from '../../types';
|
|
2
2
|
import type { LTApiResult } from '../../types/sdk';
|
|
3
3
|
import { type StepContext } from './context';
|
|
4
|
-
|
|
4
|
+
/** Claims the scanned row; a presented choice passes the row it showed. */
|
|
5
|
+
export declare function claimStep(step: ScanStep, ctx: StepContext, presentedId?: string): Promise<LTApiResult<ScanExecuteResponse> | null>;
|
|
5
6
|
/**
|
|
6
7
|
* Resolves the row the step's query names: the scanned target, the extra
|
|
7
8
|
* facets, and the claim state, all inside the atomic statement. A presented
|
|
8
9
|
* choice passes the row it showed, so the resolve lands on that row or misses.
|
|
9
10
|
*/
|
|
10
11
|
export declare function resolveStep(step: ScanStep, ctx: StepContext, presentedId?: string): Promise<LTApiResult<ScanExecuteResponse> | null>;
|
|
11
|
-
export declare function escalateStep(step: ScanStep, ctx: StepContext): Promise<LTApiResult<ScanExecuteResponse> | null>;
|
|
12
|
-
export declare function releaseStep(step: ScanStep, ctx: StepContext): Promise<LTApiResult<ScanExecuteResponse> | null>;
|
|
12
|
+
export declare function escalateStep(step: ScanStep, ctx: StepContext, presentedId?: string): Promise<LTApiResult<ScanExecuteResponse> | null>;
|
|
13
|
+
export declare function releaseStep(step: ScanStep, ctx: StepContext, presentedId?: string): Promise<LTApiResult<ScanExecuteResponse> | null>;
|
|
13
14
|
/**
|
|
14
|
-
* Dispatch one CHOICE verb against an already-presented row.
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* Dispatch one CHOICE verb against an already-presented row. Every verb that
|
|
16
|
+
* writes the row writes that row by id, so a code shared by several rows
|
|
17
|
+
* never moves the write elsewhere. Unlike the step walk (where a miss falls
|
|
18
|
+
* through to the next step), a miss answers with the truth: FORBIDDEN when
|
|
19
|
+
* the actor holds no write scope here, CONFLICT when a concurrent actor won.
|
|
18
20
|
*/
|
|
19
21
|
export declare function dispatchChoiceVerb(step: ScanStep, ctx: StepContext, row: Record<string, any>): Promise<LTApiResult<ScanExecuteResponse>>;
|
|
20
|
-
export declare function cancelStep(step: ScanStep, ctx: StepContext): Promise<LTApiResult<ScanExecuteResponse> | null>;
|
|
21
|
-
|
|
22
|
-
* Adds the scanned item to an accumulator. Two modes, one atomic write:
|
|
23
|
-
*
|
|
24
|
-
* - Item-locate (`params.accumulate.containerFacet`): the scan locates the
|
|
25
|
-
* item's own pending row through the scheme facet, reads the container
|
|
26
|
-
* facet value it carries, and adds the target to the container that shares
|
|
27
|
-
* it, writing the item row as the reciprocal in the same statement. An
|
|
28
|
-
* item with no row, or no container facet, falls through. An item whose
|
|
29
|
-
* container has closed and whose successor has not parked yet answers
|
|
30
|
-
* `no_open_container` with the item row, so the station can say "scan
|
|
31
|
-
* again" instead of showing the bag with no hint.
|
|
32
|
-
* - Container-locate (no `containerFacet`): the scan locates the container
|
|
33
|
-
* by the scheme facet and adds `params.itemKey` (template).
|
|
34
|
-
*
|
|
35
|
-
* Templates may read `{claim.<facet>}` (the actor's live claim) and, in item
|
|
36
|
-
* mode, `{item.<facet>}` (the located row); an unresolvable token falls
|
|
37
|
-
* through. The write is the SDK's guarded statement; the locate only picks
|
|
38
|
-
* ids. A container already holding the item answers conflict, never a
|
|
39
|
-
* second add.
|
|
40
|
-
*/
|
|
41
|
-
export declare function accumulateStep(step: ScanStep, ctx: StepContext): Promise<LTApiResult<ScanExecuteResponse> | null>;
|
|
22
|
+
export declare function cancelStep(step: ScanStep, ctx: StepContext, presentedId?: string): Promise<LTApiResult<ScanExecuteResponse> | null>;
|
|
23
|
+
export { accumulateStep } from './verb-accumulate';
|
|
@@ -33,52 +33,42 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.accumulateStep = void 0;
|
|
36
37
|
exports.claimStep = claimStep;
|
|
37
38
|
exports.resolveStep = resolveStep;
|
|
38
39
|
exports.escalateStep = escalateStep;
|
|
39
40
|
exports.releaseStep = releaseStep;
|
|
40
41
|
exports.dispatchChoiceVerb = dispatchChoiceVerb;
|
|
41
42
|
exports.cancelStep = cancelStep;
|
|
42
|
-
exports.accumulateStep = accumulateStep;
|
|
43
43
|
const scanCodeService = __importStar(require("../../services/scan-code"));
|
|
44
44
|
const escalationService = __importStar(require("../../services/escalation"));
|
|
45
45
|
const metadata_1 = require("../escalations/metadata");
|
|
46
|
-
const accumulate_1 = require("../escalations/accumulate");
|
|
47
46
|
const create_1 = require("../escalations/create");
|
|
48
47
|
const claim_1 = require("../escalations/claim");
|
|
49
48
|
const helpers_1 = require("../escalations/helpers");
|
|
50
49
|
const types_1 = require("../../types");
|
|
51
50
|
const context_1 = require("./context");
|
|
52
|
-
const
|
|
51
|
+
const grant_1 = require("./grant");
|
|
52
|
+
const hold_1 = require("./hold");
|
|
53
53
|
// ── Mutating verbs — each a single atomic operation under the ACTOR's RBAC ──
|
|
54
54
|
// ctx.auth is the effective actor: the badged person when a grant rode the
|
|
55
55
|
// request, otherwise the authenticated principal. Attribution and write
|
|
56
56
|
// scoping both derive from it, live, inside the escalation APIs.
|
|
57
|
-
/**
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
*/
|
|
61
|
-
async function templated(step, ctx, render, item) {
|
|
62
|
-
const tpl = await (0, context_1.stepTemplate)(step, ctx, item);
|
|
63
|
-
try {
|
|
64
|
-
return render(tpl);
|
|
65
|
-
}
|
|
66
|
-
catch (err) {
|
|
67
|
-
if (err instanceof scanCodeService.ScanTemplateError)
|
|
68
|
-
return null;
|
|
69
|
-
throw err;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
async function claimStep(step, ctx) {
|
|
73
|
-
const metadata = await templated(step, ctx, (tpl) => (0, context_1.interpolatedMetadata)(step, ctx, tpl));
|
|
57
|
+
/** Claims the scanned row; a presented choice passes the row it showed. */
|
|
58
|
+
async function claimStep(step, ctx, presentedId) {
|
|
59
|
+
const metadata = await (0, context_1.templated)(step, ctx, (tpl) => (0, context_1.interpolatedMetadata)(step, ctx, tpl));
|
|
74
60
|
if (metadata === null)
|
|
75
61
|
return null;
|
|
62
|
+
const notPrimed = await (0, grant_1.spendGrant)(ctx);
|
|
63
|
+
if (notPrimed)
|
|
64
|
+
return notPrimed;
|
|
76
65
|
const result = await (0, metadata_1.claimByMetadata)({
|
|
77
66
|
key: ctx.scheme.target_facet,
|
|
78
67
|
value: ctx.parsed.target,
|
|
79
68
|
durationMinutes: step.params?.durationMinutes,
|
|
80
69
|
metadata: { ...metadata, ...(0, context_1.provenance)(ctx) },
|
|
81
70
|
restrictRoles: step.query?.roles,
|
|
71
|
+
assertId: presentedId,
|
|
82
72
|
}, ctx.auth);
|
|
83
73
|
if (result.status === 404)
|
|
84
74
|
return null;
|
|
@@ -94,12 +84,15 @@ async function claimStep(step, ctx) {
|
|
|
94
84
|
* choice passes the row it showed, so the resolve lands on that row or misses.
|
|
95
85
|
*/
|
|
96
86
|
async function resolveStep(step, ctx, presentedId) {
|
|
97
|
-
const rendered = await templated(step, ctx, (tpl) => ({
|
|
87
|
+
const rendered = await (0, context_1.templated)(step, ctx, (tpl) => ({
|
|
98
88
|
resolverPayload: scanCodeService.interpolateScanTemplate(step.params?.resolverPayload ?? {}, tpl),
|
|
99
89
|
metadata: (0, context_1.interpolatedMetadata)(step, ctx, tpl),
|
|
100
90
|
}));
|
|
101
91
|
if (rendered === null)
|
|
102
92
|
return null;
|
|
93
|
+
const notPrimed = await (0, grant_1.spendGrant)(ctx);
|
|
94
|
+
if (notPrimed)
|
|
95
|
+
return notPrimed;
|
|
103
96
|
const result = await (0, metadata_1.resolveByMetadata)({
|
|
104
97
|
key: ctx.scheme.target_facet,
|
|
105
98
|
value: ctx.parsed.target,
|
|
@@ -116,30 +109,35 @@ async function resolveStep(step, ctx, presentedId) {
|
|
|
116
109
|
return (0, context_1.forbidden)(result.error);
|
|
117
110
|
if (result.status === 409)
|
|
118
111
|
return (0, context_1.conflict)(result.error);
|
|
112
|
+
if (result.status === 400 || result.status === 422)
|
|
113
|
+
return (0, context_1.refused)(result.error ?? 'the payload was not accepted');
|
|
119
114
|
if (result.status !== 200)
|
|
120
115
|
return result;
|
|
121
116
|
const escalation = result.data.escalation
|
|
122
117
|
?? (result.data.escalationId ? { id: result.data.escalationId } : undefined);
|
|
123
118
|
return (0, context_1.executed)(escalation, step);
|
|
124
119
|
}
|
|
125
|
-
async function escalateStep(step, ctx) {
|
|
120
|
+
async function escalateStep(step, ctx, presentedId) {
|
|
126
121
|
// Close the located escalation first when configured — the close doubles as
|
|
127
122
|
// the condition check AND the double-scan guard (second scan finds nothing
|
|
128
123
|
// to close and falls through).
|
|
129
124
|
if (step.params?.closeCurrent === 'resolve') {
|
|
130
|
-
const closed = await resolveStep({ ...step, params: { ...step.params, resolverPayload: step.params?.resolverPayload ?? {} } }, ctx);
|
|
125
|
+
const closed = await resolveStep({ ...step, params: { ...step.params, resolverPayload: step.params?.resolverPayload ?? {} } }, ctx, presentedId);
|
|
131
126
|
if (closed === null)
|
|
132
127
|
return null;
|
|
133
128
|
if (closed.data?.outcome !== types_1.SCAN_OUTCOMES.EXECUTED)
|
|
134
129
|
return closed;
|
|
135
130
|
}
|
|
136
131
|
else if (step.params?.closeCurrent === 'cancel') {
|
|
137
|
-
const cancelled = await cancelStep(step, ctx);
|
|
132
|
+
const cancelled = await cancelStep(step, ctx, presentedId);
|
|
138
133
|
if (cancelled === null)
|
|
139
134
|
return null;
|
|
140
135
|
if (cancelled.data?.outcome !== types_1.SCAN_OUTCOMES.EXECUTED)
|
|
141
136
|
return cancelled;
|
|
142
137
|
}
|
|
138
|
+
const notPrimed = await (0, grant_1.spendGrant)(ctx);
|
|
139
|
+
if (notPrimed)
|
|
140
|
+
return notPrimed;
|
|
143
141
|
const created = await (0, create_1.createEscalation)({
|
|
144
142
|
type: step.params?.escalationType ?? 'scan',
|
|
145
143
|
role: step.params.targetRole,
|
|
@@ -156,9 +154,11 @@ async function escalateStep(step, ctx) {
|
|
|
156
154
|
return created;
|
|
157
155
|
return (0, context_1.executed)(created.data, step);
|
|
158
156
|
}
|
|
159
|
-
async function releaseStep(step, ctx) {
|
|
157
|
+
async function releaseStep(step, ctx, presentedId) {
|
|
160
158
|
// Locate the caller's own claim; release-by-id re-asserts the assignee
|
|
161
159
|
// inside the SDK, so a lost race resolves to 409, never a foreign release.
|
|
160
|
+
if (presentedId)
|
|
161
|
+
return releaseById(presentedId, step, ctx);
|
|
162
162
|
const scope = await (0, helpers_1.getEscalationReadScope)(ctx.auth.userId);
|
|
163
163
|
const readable = [...scope.allRoles, ...scope.selfRoles];
|
|
164
164
|
const roles = (0, metadata_1.restrictScopeRoles)(readable, scope.global, step.query?.roles);
|
|
@@ -173,36 +173,45 @@ async function releaseStep(step, ctx) {
|
|
|
173
173
|
});
|
|
174
174
|
if (escalations.length === 0)
|
|
175
175
|
return null;
|
|
176
|
-
|
|
176
|
+
return releaseById(escalations[0].id, step, ctx);
|
|
177
|
+
}
|
|
178
|
+
async function releaseById(id, step, ctx) {
|
|
179
|
+
const notPrimed = await (0, grant_1.spendGrant)(ctx);
|
|
180
|
+
if (notPrimed)
|
|
181
|
+
return notPrimed;
|
|
182
|
+
const result = await (0, claim_1.releaseEscalation)({ id }, ctx.auth);
|
|
177
183
|
if (result.status === 403)
|
|
178
184
|
return (0, context_1.forbidden)(result.error);
|
|
179
|
-
if (result.status === 409)
|
|
185
|
+
if (result.status === 409 || result.status === 404)
|
|
180
186
|
return (0, context_1.conflict)(result.error);
|
|
181
187
|
if (result.status !== 200)
|
|
182
188
|
return result;
|
|
183
189
|
return (0, context_1.executed)(result.data.escalation, step);
|
|
184
190
|
}
|
|
185
191
|
/**
|
|
186
|
-
* Dispatch one CHOICE verb against an already-presented row.
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
192
|
+
* Dispatch one CHOICE verb against an already-presented row. Every verb that
|
|
193
|
+
* writes the row writes that row by id, so a code shared by several rows
|
|
194
|
+
* never moves the write elsewhere. Unlike the step walk (where a miss falls
|
|
195
|
+
* through to the next step), a miss answers with the truth: FORBIDDEN when
|
|
196
|
+
* the actor holds no write scope here, CONFLICT when a concurrent actor won.
|
|
190
197
|
*/
|
|
191
198
|
async function dispatchChoiceVerb(step, ctx, row) {
|
|
192
199
|
switch (step.verb) {
|
|
193
200
|
case types_1.SCAN_VERBS.SHOW_DETAIL:
|
|
194
201
|
return (0, context_1.executed)(row, step); // already located under the actor's scope
|
|
202
|
+
case types_1.SCAN_VERBS.HOLD:
|
|
203
|
+
return (await (0, hold_1.holdStep)(step, ctx, row));
|
|
195
204
|
case types_1.SCAN_VERBS.CLAIM:
|
|
196
205
|
case types_1.SCAN_VERBS.CLAIM_SHOW_DETAIL:
|
|
197
|
-
return (await claimStep(step, ctx)) ?? (await missReason(step, ctx, 'the item is no longer claimable'));
|
|
206
|
+
return (await claimStep(step, ctx, row.id)) ?? (await missReason(step, ctx, 'the item is no longer claimable'));
|
|
198
207
|
case types_1.SCAN_VERBS.RESOLVE:
|
|
199
208
|
return (await resolveStep(step, ctx, row.id)) ?? (await missReason(step, ctx, 'the item is no longer resolvable'));
|
|
200
209
|
case types_1.SCAN_VERBS.ESCALATE:
|
|
201
|
-
return (await escalateStep(step, ctx)) ?? (await missReason(step, ctx, 'the item already moved on'));
|
|
210
|
+
return (await escalateStep(step, ctx, row.id)) ?? (await missReason(step, ctx, 'the item already moved on'));
|
|
202
211
|
case types_1.SCAN_VERBS.RELEASE:
|
|
203
|
-
return (await releaseStep(step, ctx)) ?? (0, context_1.conflict)('no claim of yours to release');
|
|
212
|
+
return (await releaseStep(step, ctx, row.id)) ?? (0, context_1.conflict)('no claim of yours to release');
|
|
204
213
|
case types_1.SCAN_VERBS.CANCEL:
|
|
205
|
-
return (await cancelStep(step, ctx)) ?? (await missReason(step, ctx, 'the item is no longer cancellable'));
|
|
214
|
+
return (await cancelStep(step, ctx, row.id)) ?? (await missReason(step, ctx, 'the item is no longer cancellable'));
|
|
206
215
|
default:
|
|
207
216
|
throw new Error(`unknown choice verb "${step.verb}"`);
|
|
208
217
|
}
|
|
@@ -217,14 +226,18 @@ async function missReason(step, ctx, raceMessage) {
|
|
|
217
226
|
}
|
|
218
227
|
return (0, context_1.conflict)(raceMessage);
|
|
219
228
|
}
|
|
220
|
-
async function cancelStep(step, ctx) {
|
|
229
|
+
async function cancelStep(step, ctx, presentedId) {
|
|
221
230
|
// Claim-as-lock: the atomic claim pins the row to this caller (or extends
|
|
222
231
|
// their claim), serializing concurrent double-scans before the cancel.
|
|
232
|
+
const notPrimed = await (0, grant_1.spendGrant)(ctx);
|
|
233
|
+
if (notPrimed)
|
|
234
|
+
return notPrimed;
|
|
223
235
|
const claimed = await (0, metadata_1.claimByMetadata)({
|
|
224
236
|
key: ctx.scheme.target_facet,
|
|
225
237
|
value: ctx.parsed.target,
|
|
226
238
|
metadata: (0, context_1.provenance)(ctx),
|
|
227
239
|
restrictRoles: step.query?.roles,
|
|
240
|
+
assertId: presentedId,
|
|
228
241
|
}, ctx.auth);
|
|
229
242
|
if (claimed.status === 404)
|
|
230
243
|
return null;
|
|
@@ -237,98 +250,5 @@ async function cancelStep(step, ctx) {
|
|
|
237
250
|
return (0, context_1.conflict)('Escalation is not cancellable (already terminal)');
|
|
238
251
|
return (0, context_1.executed)(cancelled, step);
|
|
239
252
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
*
|
|
243
|
-
* - Item-locate (`params.accumulate.containerFacet`): the scan locates the
|
|
244
|
-
* item's own pending row through the scheme facet, reads the container
|
|
245
|
-
* facet value it carries, and adds the target to the container that shares
|
|
246
|
-
* it, writing the item row as the reciprocal in the same statement. An
|
|
247
|
-
* item with no row, or no container facet, falls through. An item whose
|
|
248
|
-
* container has closed and whose successor has not parked yet answers
|
|
249
|
-
* `no_open_container` with the item row, so the station can say "scan
|
|
250
|
-
* again" instead of showing the bag with no hint.
|
|
251
|
-
* - Container-locate (no `containerFacet`): the scan locates the container
|
|
252
|
-
* by the scheme facet and adds `params.itemKey` (template).
|
|
253
|
-
*
|
|
254
|
-
* Templates may read `{claim.<facet>}` (the actor's live claim) and, in item
|
|
255
|
-
* mode, `{item.<facet>}` (the located row); an unresolvable token falls
|
|
256
|
-
* through. The write is the SDK's guarded statement; the locate only picks
|
|
257
|
-
* ids. A container already holding the item answers conflict, never a
|
|
258
|
-
* second add.
|
|
259
|
-
*/
|
|
260
|
-
async function accumulateStep(step, ctx) {
|
|
261
|
-
const options = step.params?.accumulate;
|
|
262
|
-
let item;
|
|
263
|
-
if (options?.containerFacet) {
|
|
264
|
-
const located = await (0, locate_1.locateForStep)(step, ctx, 1);
|
|
265
|
-
item = located?.escalations[0];
|
|
266
|
-
if (!item)
|
|
267
|
-
return null;
|
|
268
|
-
}
|
|
269
|
-
const rendered = await templated(step, ctx, (tpl) => ({
|
|
270
|
-
payload: step.params?.resolverPayload
|
|
271
|
-
? scanCodeService.interpolateScanTemplate(step.params.resolverPayload, tpl)
|
|
272
|
-
: undefined,
|
|
273
|
-
metadata: { ...(0, context_1.interpolatedMetadata)(step, ctx, tpl), ...(0, context_1.provenance)(ctx) },
|
|
274
|
-
itemKey: options?.containerFacet
|
|
275
|
-
? ctx.parsed.target
|
|
276
|
-
: scanCodeService.interpolateScanTemplate(step.params.itemKey, tpl),
|
|
277
|
-
}), item);
|
|
278
|
-
if (rendered === null)
|
|
279
|
-
return null;
|
|
280
|
-
let request;
|
|
281
|
-
let container;
|
|
282
|
-
if (options?.containerFacet && item) {
|
|
283
|
-
const containerValue = item.metadata?.[options.containerFacet];
|
|
284
|
-
if (containerValue === undefined || containerValue === null || containerValue === '')
|
|
285
|
-
return null;
|
|
286
|
-
container = { facet: options.containerFacet, value: String(containerValue) };
|
|
287
|
-
request = {
|
|
288
|
-
key: container.facet,
|
|
289
|
-
value: container.value,
|
|
290
|
-
itemKey: rendered.itemKey,
|
|
291
|
-
payload: rendered.payload,
|
|
292
|
-
metadata: rendered.metadata,
|
|
293
|
-
restrictRoles: options.container?.roles ?? options.containerRoles,
|
|
294
|
-
container: options.container
|
|
295
|
-
? { types: options.container.types, subtypes: options.container.subtypes, facets: options.container.facets }
|
|
296
|
-
: undefined,
|
|
297
|
-
...(options.reciprocal === false ? {} : { reciprocal: { id: item.id } }),
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
|
-
else {
|
|
301
|
-
request = {
|
|
302
|
-
key: ctx.scheme.target_facet,
|
|
303
|
-
value: ctx.parsed.target,
|
|
304
|
-
itemKey: rendered.itemKey,
|
|
305
|
-
payload: rendered.payload,
|
|
306
|
-
metadata: rendered.metadata,
|
|
307
|
-
restrictRoles: step.query?.roles,
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
const result = await (0, accumulate_1.accumulateItemByMetadata)(request, ctx.auth);
|
|
311
|
-
if (result.status === 404) {
|
|
312
|
-
if (!container || !item)
|
|
313
|
-
return null;
|
|
314
|
-
return {
|
|
315
|
-
status: 200,
|
|
316
|
-
data: {
|
|
317
|
-
outcome: types_1.SCAN_OUTCOMES.NO_OPEN_CONTAINER,
|
|
318
|
-
verb: step.verb,
|
|
319
|
-
escalation: item,
|
|
320
|
-
container,
|
|
321
|
-
fallback: ctx.rule.fallback,
|
|
322
|
-
error: `No open container carries ${container.facet} = ${container.value}`,
|
|
323
|
-
},
|
|
324
|
-
};
|
|
325
|
-
}
|
|
326
|
-
if (result.status === 403)
|
|
327
|
-
return (0, context_1.forbidden)(result.error);
|
|
328
|
-
if (result.status === 409)
|
|
329
|
-
return (0, context_1.conflict)(result.error);
|
|
330
|
-
if (result.status !== 200)
|
|
331
|
-
return result;
|
|
332
|
-
const escalation = result.data.escalationId ? { id: result.data.escalationId, ...result.data } : undefined;
|
|
333
|
-
return (0, context_1.executed)(escalation, step);
|
|
334
|
-
}
|
|
253
|
+
var verb_accumulate_1 = require("./verb-accumulate");
|
|
254
|
+
Object.defineProperty(exports, "accumulateStep", { enumerable: true, get: function () { return verb_accumulate_1.accumulateStep; } });
|
package/build/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export * as TaskService from './services/task';
|
|
|
12
12
|
export * as EscalationService from './services/escalation';
|
|
13
13
|
export * as ConfigService from './services/config';
|
|
14
14
|
export * as UserService from './services/user';
|
|
15
|
+
export { assertValidScheme as assertValidScanScheme, assertValidSteps as assertValidScanSteps, assertValidIdentityRule as assertValidScanIdentityRule, isValidGtin, normalizeGtin, displayGtin, type ScanSchemeInput, type ScanRuleInput, } from './services/scan-code';
|
|
15
16
|
export * as TopicService from './services/topics';
|
|
16
17
|
export { seedSystemTopics, seedConfigTopics } from './services/topics/system-topics';
|
|
17
18
|
export { ltConfig } from './modules/ltconfig';
|
package/build/index.js
CHANGED
|
@@ -36,8 +36,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
40
|
-
exports.LTExpressAdapter = exports.api = exports.KnowledgeApi = exports.resolveCredential = exports.mimeFromPath = exports.getStorageBackend = exports.listOAuthConnections = exports.getFreshAccessToken = exports.createClient = exports.CallbackEventAdapter = exports.builtinMcpServerFactories = exports.getSystemAgents = exports.getSystemWorkers = exports.registerMcpTool = exports.getToolContext = exports.getActivityIdentity = void 0;
|
|
39
|
+
exports.McpClient = exports.McpService = exports.BuiltInMcpAdapter = exports.mcpRegistry = exports.defaultMaintenanceConfig = exports.maintenanceRegistry = exports.PinoLoggerAdapter = exports.loggerRegistry = exports.HoneycombTelemetryAdapter = exports.telemetryRegistry = exports.publishKnowledgeEvent = exports.publishAgentEvent = exports.publishWorkflowEvent = exports.publishActivityEvent = exports.publishEscalationEvent = exports.publishTaskEvent = exports.publishMilestoneEvent = exports.SocketIOEventAdapter = exports.InMemoryEventAdapter = exports.NatsEventAdapter = exports.eventRegistry = exports.ltConfig = exports.seedConfigTopics = exports.seedSystemTopics = exports.TopicService = exports.displayGtin = exports.normalizeGtin = exports.isValidGtin = exports.assertValidScanIdentityRule = exports.assertValidScanSteps = exports.assertValidScanScheme = exports.UserService = exports.ConfigService = exports.EscalationService = exports.TaskService = exports.setAuthAdapter = exports.signToken = exports.requireAdmin = exports.requireAuth = exports.createAuthMiddleware = exports.JwtAuthAdapter = exports.conditionalAccumulator = exports.conditionLT = exports.conditional = exports.executeLT = exports.createLTActivityInterceptor = exports.createLTInterceptor = exports.registerLT = exports.midnightTheme = exports.start = void 0;
|
|
40
|
+
exports.LTExpressAdapter = exports.api = exports.KnowledgeApi = exports.resolveCredential = exports.mimeFromPath = exports.getStorageBackend = exports.listOAuthConnections = exports.getFreshAccessToken = exports.createClient = exports.CallbackEventAdapter = exports.builtinMcpServerFactories = exports.getSystemAgents = exports.getSystemWorkers = exports.registerMcpTool = exports.getToolContext = exports.getActivityIdentity = exports.McpEscalationStrategy = exports.DefaultEscalationStrategy = exports.escalationStrategyRegistry = exports.McpVisionServer = exports.McpTranslationServer = exports.McpServer = void 0;
|
|
41
41
|
const config_1 = require("./modules/config");
|
|
42
42
|
const logger_1 = require("./lib/logger");
|
|
43
43
|
const midnight_1 = require("./themes/midnight");
|
|
@@ -70,6 +70,13 @@ exports.TaskService = __importStar(require("./services/task"));
|
|
|
70
70
|
exports.EscalationService = __importStar(require("./services/escalation"));
|
|
71
71
|
exports.ConfigService = __importStar(require("./services/config"));
|
|
72
72
|
exports.UserService = __importStar(require("./services/user"));
|
|
73
|
+
var scan_code_1 = require("./services/scan-code");
|
|
74
|
+
Object.defineProperty(exports, "assertValidScanScheme", { enumerable: true, get: function () { return scan_code_1.assertValidScheme; } });
|
|
75
|
+
Object.defineProperty(exports, "assertValidScanSteps", { enumerable: true, get: function () { return scan_code_1.assertValidSteps; } });
|
|
76
|
+
Object.defineProperty(exports, "assertValidScanIdentityRule", { enumerable: true, get: function () { return scan_code_1.assertValidIdentityRule; } });
|
|
77
|
+
Object.defineProperty(exports, "isValidGtin", { enumerable: true, get: function () { return scan_code_1.isValidGtin; } });
|
|
78
|
+
Object.defineProperty(exports, "normalizeGtin", { enumerable: true, get: function () { return scan_code_1.normalizeGtin; } });
|
|
79
|
+
Object.defineProperty(exports, "displayGtin", { enumerable: true, get: function () { return scan_code_1.displayGtin; } });
|
|
73
80
|
exports.TopicService = __importStar(require("./services/topics"));
|
|
74
81
|
var system_topics_1 = require("./services/topics/system-topics");
|
|
75
82
|
Object.defineProperty(exports, "seedSystemTopics", { enumerable: true, get: function () { return system_topics_1.seedSystemTopics; } });
|