udp-react-enterprise-component-library 27.0.0-next.12 → 27.0.0-next.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/UI/fluent-web-components/UdpIconPicker.d.ts +4 -1
- package/dist/UI/fluent-web-components/UdpIconPicker.d.ts.map +1 -1
- package/dist/UI/fluent-web-components/UdpIconPicker.js +2 -2
- package/dist/UI/fluent-web-components/UdpIconPicker.js.map +1 -1
- package/dist/UI/fluent-web-components/UdpIconPicker.mjs +32 -28
- package/dist/UI/fluent-web-components/UdpIconPicker.mjs.map +1 -1
- package/dist/UI/fluent-web-components/UdpLink.d.ts +6 -0
- package/dist/UI/fluent-web-components/UdpLink.d.ts.map +1 -1
- package/dist/UI/fluent-web-components/UdpLink.js.map +1 -1
- package/dist/UI/fluent-web-components/UdpLink.mjs.map +1 -1
- package/dist/UI/fluent-web-components/types.d.ts +2 -0
- package/dist/UI/fluent-web-components/types.d.ts.map +1 -1
- package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.d.ts +16 -3
- package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.d.ts.map +1 -1
- package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.js +36 -13
- package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.js.map +1 -1
- package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.mjs +119 -62
- package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.mjs.map +1 -1
- package/dist/UI/widgets/library/InquiryFindRecordsWidget/index.mjs +3 -2
- package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.d.ts +9 -2
- package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.d.ts.map +1 -1
- package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.js +18 -18
- package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.js.map +1 -1
- package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.mjs +79 -67
- package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.mjs.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.d.ts +8 -2
- package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.d.ts.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.js +32 -16
- package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.js.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.mjs +129 -102
- package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.mjs.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.d.ts +3 -2
- package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.d.ts.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.js +11 -12
- package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.js.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.mjs +6 -4
- package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.mjs.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.d.ts +2 -19
- package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.d.ts.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.js +4 -5
- package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.js.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.mjs +5 -4
- package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.mjs.map +1 -1
- package/dist/actionPanels/index.d.ts +0 -2
- package/dist/actionPanels/index.d.ts.map +1 -1
- package/dist/actionPanels/index.js +0 -2
- package/dist/actionPanels/index.js.map +1 -1
- package/dist/actionPanels/panelActionFields.d.ts +9 -26
- package/dist/actionPanels/panelActionFields.d.ts.map +1 -1
- package/dist/actionPanels/panelActionFields.js +32 -55
- package/dist/actionPanels/panelActionFields.js.map +1 -1
- package/dist/actionPanels/panelActionFields.mjs +159 -375
- package/dist/actionPanels/panelActionFields.mjs.map +1 -1
- package/dist/actionPanels/panelOperations.d.ts +15 -41
- package/dist/actionPanels/panelOperations.d.ts.map +1 -1
- package/dist/actionPanels/panelOperations.js +51 -89
- package/dist/actionPanels/panelOperations.js.map +1 -1
- package/dist/actionPanels/panelOperations.mjs +37 -92
- package/dist/actionPanels/panelOperations.mjs.map +1 -1
- package/dist/domain/actionPanel/actionTypeMeta.d.ts +15 -2
- package/dist/domain/actionPanel/actionTypeMeta.d.ts.map +1 -1
- package/dist/domain/actionPanel/actionTypeMeta.js +21 -2
- package/dist/domain/actionPanel/actionTypeMeta.js.map +1 -1
- package/dist/domain/actionPanel/actionTypeMeta.mjs +18 -3
- package/dist/domain/actionPanel/actionTypeMeta.mjs.map +1 -1
- package/dist/domain/actionPanel/buttonOrder.d.ts +67 -0
- package/dist/domain/actionPanel/buttonOrder.d.ts.map +1 -0
- package/dist/domain/actionPanel/buttonOrder.js +105 -0
- package/dist/domain/actionPanel/buttonOrder.js.map +1 -0
- package/dist/domain/actionPanel/buttonOrder.mjs +90 -0
- package/dist/domain/actionPanel/buttonOrder.mjs.map +1 -0
- package/dist/domain/actionPanel/index.d.ts +1 -0
- package/dist/domain/actionPanel/index.d.ts.map +1 -1
- package/dist/domain/actionPanel/index.js +1 -0
- package/dist/domain/actionPanel/index.js.map +1 -1
- package/dist/domain/actionPanel/index.mjs +4 -3
- package/dist/domain/actionPanel/serialize.d.ts +6 -2
- package/dist/domain/actionPanel/serialize.d.ts.map +1 -1
- package/dist/domain/actionPanel/serialize.js +10 -3
- package/dist/domain/actionPanel/serialize.js.map +1 -1
- package/dist/domain/actionPanel/serialize.mjs +7 -3
- package/dist/domain/actionPanel/serialize.mjs.map +1 -1
- package/dist/domain/actionPanel/types.d.ts +24 -8
- package/dist/domain/actionPanel/types.d.ts.map +1 -1
- package/dist/domain/actionPanel/types.js.map +1 -1
- package/dist/domain/actionPanel/types.mjs.map +1 -1
- package/dist/domain/inquiryTree/describe.d.ts +15 -3
- package/dist/domain/inquiryTree/describe.d.ts.map +1 -1
- package/dist/domain/inquiryTree/describe.js +32 -28
- package/dist/domain/inquiryTree/describe.js.map +1 -1
- package/dist/domain/inquiryTree/describe.mjs +34 -16
- package/dist/domain/inquiryTree/describe.mjs.map +1 -1
- package/dist/domain/inquiryTree/displayTree.d.ts +75 -97
- package/dist/domain/inquiryTree/displayTree.d.ts.map +1 -1
- package/dist/domain/inquiryTree/displayTree.js +418 -551
- package/dist/domain/inquiryTree/displayTree.js.map +1 -1
- package/dist/domain/inquiryTree/displayTree.mjs +345 -414
- package/dist/domain/inquiryTree/displayTree.mjs.map +1 -1
- package/dist/domain/inquiryTree/groups.d.ts +2 -0
- package/dist/domain/inquiryTree/groups.d.ts.map +1 -1
- package/dist/domain/inquiryTree/groups.js.map +1 -1
- package/dist/domain/inquiryTree/groups.mjs.map +1 -1
- package/dist/domain/inquiryTree/index.d.ts +1 -1
- package/dist/domain/inquiryTree/index.d.ts.map +1 -1
- package/dist/domain/inquiryTree/index.js +1 -1
- package/dist/domain/inquiryTree/index.js.map +1 -1
- package/dist/domain/inquiryTree/index.mjs +12 -12
- package/dist/domain/inquiryTree/lazyLoad.d.ts +20 -129
- package/dist/domain/inquiryTree/lazyLoad.d.ts.map +1 -1
- package/dist/domain/inquiryTree/lazyLoad.js +48 -233
- package/dist/domain/inquiryTree/lazyLoad.js.map +1 -1
- package/dist/domain/inquiryTree/lazyLoad.mjs +32 -187
- package/dist/domain/inquiryTree/lazyLoad.mjs.map +1 -1
- package/dist/domain/inquiryTree/legalChildren.d.ts +13 -14
- package/dist/domain/inquiryTree/legalChildren.d.ts.map +1 -1
- package/dist/domain/inquiryTree/legalChildren.js +21 -42
- package/dist/domain/inquiryTree/legalChildren.js.map +1 -1
- package/dist/domain/inquiryTree/legalChildren.mjs +19 -37
- package/dist/domain/inquiryTree/legalChildren.mjs.map +1 -1
- package/dist/domain/inquiryTree/names.d.ts +38 -0
- package/dist/domain/inquiryTree/names.d.ts.map +1 -0
- package/dist/domain/inquiryTree/names.js +64 -0
- package/dist/domain/inquiryTree/names.js.map +1 -0
- package/dist/domain/inquiryTree/names.mjs +56 -0
- package/dist/domain/inquiryTree/names.mjs.map +1 -0
- package/dist/domain/inquiryTree/operations.d.ts +6 -2
- package/dist/domain/inquiryTree/operations.d.ts.map +1 -1
- package/dist/domain/inquiryTree/operations.js +17 -16
- package/dist/domain/inquiryTree/operations.js.map +1 -1
- package/dist/domain/inquiryTree/operations.mjs +14 -11
- package/dist/domain/inquiryTree/operations.mjs.map +1 -1
- package/dist/domain/inquiryTree/rules.d.ts +3 -4
- package/dist/domain/inquiryTree/rules.d.ts.map +1 -1
- package/dist/domain/inquiryTree/rules.js +3 -13
- package/dist/domain/inquiryTree/rules.js.map +1 -1
- package/dist/domain/inquiryTree/rules.mjs +3 -9
- package/dist/domain/inquiryTree/rules.mjs.map +1 -1
- package/dist/domain/inquiryTree/runtime.d.ts +23 -16
- package/dist/domain/inquiryTree/runtime.d.ts.map +1 -1
- package/dist/domain/inquiryTree/runtime.js +46 -54
- package/dist/domain/inquiryTree/runtime.js.map +1 -1
- package/dist/domain/inquiryTree/runtime.mjs +31 -26
- package/dist/domain/inquiryTree/runtime.mjs.map +1 -1
- package/dist/domain/inquiryTree/serialize.d.ts +20 -29
- package/dist/domain/inquiryTree/serialize.d.ts.map +1 -1
- package/dist/domain/inquiryTree/serialize.js +93 -205
- package/dist/domain/inquiryTree/serialize.js.map +1 -1
- package/dist/domain/inquiryTree/serialize.mjs +89 -180
- package/dist/domain/inquiryTree/serialize.mjs.map +1 -1
- package/dist/domain/inquiryTree/types.d.ts +146 -65
- package/dist/domain/inquiryTree/types.d.ts.map +1 -1
- package/dist/domain/inquiryTree/types.js +5 -0
- package/dist/domain/inquiryTree/types.js.map +1 -1
- package/dist/domain/inquiryTree/types.mjs +3 -1
- package/dist/domain/inquiryTree/types.mjs.map +1 -1
- package/dist/domain/inquiryTree/validate.d.ts +9 -2
- package/dist/domain/inquiryTree/validate.d.ts.map +1 -1
- package/dist/domain/inquiryTree/validate.js +30 -58
- package/dist/domain/inquiryTree/validate.js.map +1 -1
- package/dist/domain/inquiryTree/validate.mjs +29 -44
- package/dist/domain/inquiryTree/validate.mjs.map +1 -1
- package/dist/domain/inquiryTree/view.d.ts +8 -12
- package/dist/domain/inquiryTree/view.d.ts.map +1 -1
- package/dist/domain/inquiryTree/view.js +40 -66
- package/dist/domain/inquiryTree/view.js.map +1 -1
- package/dist/domain/inquiryTree/view.mjs +30 -60
- package/dist/domain/inquiryTree/view.mjs.map +1 -1
- package/dist/domain/inquiryTree/waveLoad.d.ts +32 -48
- package/dist/domain/inquiryTree/waveLoad.d.ts.map +1 -1
- package/dist/domain/inquiryTree/waveLoad.js +75 -90
- package/dist/domain/inquiryTree/waveLoad.js.map +1 -1
- package/dist/domain/inquiryTree/waveLoad.mjs +54 -60
- package/dist/domain/inquiryTree/waveLoad.mjs.map +1 -1
- package/dist/domain/inquiryTree/wireString.d.ts +5 -0
- package/dist/domain/inquiryTree/wireString.d.ts.map +1 -1
- package/dist/domain/inquiryTree/wireString.js +11 -0
- package/dist/domain/inquiryTree/wireString.js.map +1 -1
- package/dist/domain/inquiryTree/wireString.mjs +10 -1
- package/dist/domain/inquiryTree/wireString.mjs.map +1 -1
- package/dist/domain/nodeView/index.mjs +2 -2
- package/dist/domain/nodeView/model.d.ts +35 -30
- package/dist/domain/nodeView/model.d.ts.map +1 -1
- package/dist/domain/nodeView/model.js +108 -69
- package/dist/domain/nodeView/model.js.map +1 -1
- package/dist/domain/nodeView/model.mjs +86 -36
- package/dist/domain/nodeView/model.mjs.map +1 -1
- package/dist/icons/legacyIconNames.d.ts.map +1 -1
- package/dist/icons/legacyIconNames.js +46 -1
- package/dist/icons/legacyIconNames.js.map +1 -1
- package/dist/icons/legacyIconNames.mjs +46 -1
- package/dist/icons/legacyIconNames.mjs.map +1 -1
- package/dist/index.mjs +10 -12
- package/dist/inquiry/Inquiry.d.ts +3 -0
- package/dist/inquiry/Inquiry.d.ts.map +1 -1
- package/dist/inquiry/Inquiry.js +3 -0
- package/dist/inquiry/Inquiry.js.map +1 -1
- package/dist/inquiry/Inquiry.mjs +3 -0
- package/dist/inquiry/Inquiry.mjs.map +1 -1
- package/dist/inquiry/v2/InquiryV2.d.ts +8 -6
- package/dist/inquiry/v2/InquiryV2.d.ts.map +1 -1
- package/dist/inquiry/v2/InquiryV2.js +45 -24
- package/dist/inquiry/v2/InquiryV2.js.map +1 -1
- package/dist/inquiry/v2/InquiryV2.mjs +108 -61
- package/dist/inquiry/v2/InquiryV2.mjs.map +1 -1
- package/dist/inquiry/v2/InquiryV2.module.css +60 -15
- package/dist/inquiry/v2/InquiryWorkspace.d.ts +9 -9
- package/dist/inquiry/v2/InquiryWorkspace.d.ts.map +1 -1
- package/dist/inquiry/v2/InquiryWorkspace.js +531 -408
- package/dist/inquiry/v2/InquiryWorkspace.js.map +1 -1
- package/dist/inquiry/v2/InquiryWorkspace.mjs +524 -408
- package/dist/inquiry/v2/InquiryWorkspace.mjs.map +1 -1
- package/dist/inquiry/v2/ai/InquiryV2Copilot.d.ts +3 -2
- package/dist/inquiry/v2/ai/InquiryV2Copilot.d.ts.map +1 -1
- package/dist/inquiry/v2/ai/InquiryV2Copilot.js +20 -37
- package/dist/inquiry/v2/ai/InquiryV2Copilot.js.map +1 -1
- package/dist/inquiry/v2/ai/InquiryV2Copilot.mjs +19 -31
- package/dist/inquiry/v2/ai/InquiryV2Copilot.mjs.map +1 -1
- package/dist/inquiry/v2/ai/copilotModel.d.ts +6 -14
- package/dist/inquiry/v2/ai/copilotModel.d.ts.map +1 -1
- package/dist/inquiry/v2/ai/copilotModel.js +35 -87
- package/dist/inquiry/v2/ai/copilotModel.js.map +1 -1
- package/dist/inquiry/v2/ai/copilotModel.mjs +23 -47
- package/dist/inquiry/v2/ai/copilotModel.mjs.map +1 -1
- package/dist/inquiry/v2/api/queries.d.ts +46 -73
- package/dist/inquiry/v2/api/queries.d.ts.map +1 -1
- package/dist/inquiry/v2/api/queries.js +151 -210
- package/dist/inquiry/v2/api/queries.js.map +1 -1
- package/dist/inquiry/v2/api/queries.mjs +227 -183
- package/dist/inquiry/v2/api/queries.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/ActionsCapability.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/ActionsCapability.js +103 -32
- package/dist/inquiry/v2/capabilities/actions/ActionsCapability.js.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/ActionsCapability.mjs +92 -32
- package/dist/inquiry/v2/capabilities/actions/ActionsCapability.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/ActionsCapability.module.css +8 -1
- package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.d.ts +20 -16
- package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.js +111 -68
- package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.js.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.mjs +108 -142
- package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/RetrieveSurface.mjs +1 -1
- package/dist/inquiry/v2/capabilities/actions/actionModel.d.ts +66 -50
- package/dist/inquiry/v2/capabilities/actions/actionModel.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/actionModel.js +141 -66
- package/dist/inquiry/v2/capabilities/actions/actionModel.js.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/actionModel.mjs +115 -53
- package/dist/inquiry/v2/capabilities/actions/actionModel.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.d.ts +26 -0
- package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.d.ts.map +1 -0
- package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.js +36 -0
- package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.js.map +1 -0
- package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.mjs +41 -0
- package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.mjs.map +1 -0
- package/dist/inquiry/v2/capabilities/actions/runAction.d.ts +3 -2
- package/dist/inquiry/v2/capabilities/actions/runAction.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/runAction.js +27 -23
- package/dist/inquiry/v2/capabilities/actions/runAction.js.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/runAction.mjs +26 -20
- package/dist/inquiry/v2/capabilities/actions/runAction.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/useHeaderFold.d.ts +20 -0
- package/dist/inquiry/v2/capabilities/actions/useHeaderFold.d.ts.map +1 -0
- package/dist/inquiry/v2/capabilities/actions/useHeaderFold.js +112 -0
- package/dist/inquiry/v2/capabilities/actions/useHeaderFold.js.map +1 -0
- package/dist/inquiry/v2/capabilities/actions/useHeaderFold.mjs +118 -0
- package/dist/inquiry/v2/capabilities/actions/useHeaderFold.mjs.map +1 -0
- package/dist/inquiry/v2/capabilities/actions/useSheetPanel.d.ts +25 -1
- package/dist/inquiry/v2/capabilities/actions/useSheetPanel.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/useSheetPanel.js +7 -4
- package/dist/inquiry/v2/capabilities/actions/useSheetPanel.js.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/useSheetPanel.mjs +9 -4
- package/dist/inquiry/v2/capabilities/actions/useSheetPanel.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.d.ts +5 -3
- package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.js +11 -8
- package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.js.map +1 -1
- package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.mjs +13 -7
- package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.module.css +4 -4
- package/dist/inquiry/v2/capabilities/header/HeaderCapability.d.ts +1 -1
- package/dist/inquiry/v2/capabilities/header/HeaderCapability.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/header/HeaderCapability.js +20 -17
- package/dist/inquiry/v2/capabilities/header/HeaderCapability.js.map +1 -1
- package/dist/inquiry/v2/capabilities/header/HeaderCapability.mjs +101 -111
- package/dist/inquiry/v2/capabilities/header/HeaderCapability.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/header/HeaderCapability.module.css +9 -6
- package/dist/inquiry/v2/capabilities/tabs/TabsCapability.d.ts +2 -1
- package/dist/inquiry/v2/capabilities/tabs/TabsCapability.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/tabs/TabsCapability.js +9 -2
- package/dist/inquiry/v2/capabilities/tabs/TabsCapability.js.map +1 -1
- package/dist/inquiry/v2/capabilities/tabs/TabsCapability.mjs +18 -15
- package/dist/inquiry/v2/capabilities/tabs/TabsCapability.mjs.map +1 -1
- package/dist/inquiry/v2/index.d.ts +0 -1
- package/dist/inquiry/v2/index.d.ts.map +1 -1
- package/dist/inquiry/v2/index.js.map +1 -1
- package/dist/inquiry/v2/kernel/ActionRunnerContext.d.ts +3 -3
- package/dist/inquiry/v2/kernel/ActionRunnerContext.d.ts.map +1 -1
- package/dist/inquiry/v2/kernel/ActionRunnerContext.js +11 -5
- package/dist/inquiry/v2/kernel/ActionRunnerContext.js.map +1 -1
- package/dist/inquiry/v2/kernel/ActionRunnerContext.mjs +15 -12
- package/dist/inquiry/v2/kernel/ActionRunnerContext.mjs.map +1 -1
- package/dist/inquiry/v2/kernel/ReadOnlyContext.d.ts +3 -0
- package/dist/inquiry/v2/kernel/ReadOnlyContext.d.ts.map +1 -0
- package/dist/inquiry/v2/kernel/ReadOnlyContext.js +14 -0
- package/dist/inquiry/v2/kernel/ReadOnlyContext.js.map +1 -0
- package/dist/inquiry/v2/kernel/ReadOnlyContext.mjs +20 -0
- package/dist/inquiry/v2/kernel/ReadOnlyContext.mjs.map +1 -0
- package/dist/inquiry/v2/kernel/RecordContext.d.ts +2 -0
- package/dist/inquiry/v2/kernel/RecordContext.d.ts.map +1 -1
- package/dist/inquiry/v2/kernel/RecordContext.js.map +1 -1
- package/dist/inquiry/v2/kernel/RecordContext.mjs.map +1 -1
- package/dist/inquiry/v2/kernel/UdpNodeView.d.ts.map +1 -1
- package/dist/inquiry/v2/kernel/UdpNodeView.js +18 -13
- package/dist/inquiry/v2/kernel/UdpNodeView.js.map +1 -1
- package/dist/inquiry/v2/kernel/UdpNodeView.mjs +177 -140
- package/dist/inquiry/v2/kernel/UdpNodeView.mjs.map +1 -1
- package/dist/inquiry/v2/kernel/UdpNodeView.module.css +56 -5
- package/dist/inquiry/v2/kernel/capabilities.d.ts +0 -2
- package/dist/inquiry/v2/kernel/capabilities.d.ts.map +1 -1
- package/dist/inquiry/v2/kernel/capabilities.js.map +1 -1
- package/dist/inquiry/v2/kernel/capabilities.mjs.map +1 -1
- package/dist/inquiry/v2/landing/InquiryExplorePage.d.ts +26 -37
- package/dist/inquiry/v2/landing/InquiryExplorePage.d.ts.map +1 -1
- package/dist/inquiry/v2/landing/InquiryExplorePage.js +48 -57
- package/dist/inquiry/v2/landing/InquiryExplorePage.js.map +1 -1
- package/dist/inquiry/v2/landing/InquiryExplorePage.mjs +102 -106
- package/dist/inquiry/v2/landing/InquiryExplorePage.mjs.map +1 -1
- package/dist/inquiry/v2/landing/InquiryExplorePage.module.css +58 -6
- package/dist/inquiry/v2/landing/InquiryLanding.d.ts +3 -3
- package/dist/inquiry/v2/landing/InquiryLanding.d.ts.map +1 -1
- package/dist/inquiry/v2/landing/InquiryLanding.js +8 -3
- package/dist/inquiry/v2/landing/InquiryLanding.js.map +1 -1
- package/dist/inquiry/v2/landing/InquiryLanding.mjs +51 -35
- package/dist/inquiry/v2/landing/InquiryLanding.mjs.map +1 -1
- package/dist/inquiry/v2/landing/InquiryLanding.module.css +8 -0
- package/dist/inquiry/v2/page/UdpPageRenderer.d.ts +5 -1
- package/dist/inquiry/v2/page/UdpPageRenderer.d.ts.map +1 -1
- package/dist/inquiry/v2/page/UdpPageRenderer.js +13 -1
- package/dist/inquiry/v2/page/UdpPageRenderer.js.map +1 -1
- package/dist/inquiry/v2/page/UdpPageRenderer.mjs +36 -7
- package/dist/inquiry/v2/page/UdpPageRenderer.mjs.map +1 -1
- package/dist/inquiry/v2/search/InquirySearchPanel.d.ts +1 -7
- package/dist/inquiry/v2/search/InquirySearchPanel.d.ts.map +1 -1
- package/dist/inquiry/v2/search/InquirySearchPanel.js +6 -13
- package/dist/inquiry/v2/search/InquirySearchPanel.js.map +1 -1
- package/dist/inquiry/v2/search/InquirySearchPanel.mjs +4 -8
- package/dist/inquiry/v2/search/InquirySearchPanel.mjs.map +1 -1
- package/dist/inquiry/v2/search/RecordFinder.d.ts +30 -1
- package/dist/inquiry/v2/search/RecordFinder.d.ts.map +1 -1
- package/dist/inquiry/v2/search/RecordFinder.js +43 -20
- package/dist/inquiry/v2/search/RecordFinder.js.map +1 -1
- package/dist/inquiry/v2/search/RecordFinder.mjs +68 -42
- package/dist/inquiry/v2/search/RecordFinder.mjs.map +1 -1
- package/dist/inquiry/v2/search/index.d.ts +3 -3
- package/dist/inquiry/v2/search/index.d.ts.map +1 -1
- package/dist/inquiry/v2/search/index.js +1 -1
- package/dist/inquiry/v2/search/index.js.map +1 -1
- package/dist/inquiry/v2/search/searchModel.d.ts +130 -23
- package/dist/inquiry/v2/search/searchModel.d.ts.map +1 -1
- package/dist/inquiry/v2/search/searchModel.js +237 -36
- package/dist/inquiry/v2/search/searchModel.js.map +1 -1
- package/dist/inquiry/v2/search/searchModel.mjs +207 -34
- package/dist/inquiry/v2/search/searchModel.mjs.map +1 -1
- package/dist/inquiry/v2/search/useInquirySearch.d.ts.map +1 -1
- package/dist/inquiry/v2/search/useInquirySearch.js +46 -19
- package/dist/inquiry/v2/search/useInquirySearch.js.map +1 -1
- package/dist/inquiry/v2/search/useInquirySearch.mjs +83 -84
- package/dist/inquiry/v2/search/useInquirySearch.mjs.map +1 -1
- package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.d.ts +4 -1
- package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.js +174 -166
- package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.js.map +1 -1
- package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.mjs +343 -325
- package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.mjs.map +1 -1
- package/dist/inquiry/v2/tree/InquiryMenuToolbar.d.ts +3 -1
- package/dist/inquiry/v2/tree/InquiryMenuToolbar.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/InquiryMenuToolbar.js +8 -7
- package/dist/inquiry/v2/tree/InquiryMenuToolbar.js.map +1 -1
- package/dist/inquiry/v2/tree/InquiryMenuToolbar.mjs +68 -72
- package/dist/inquiry/v2/tree/InquiryMenuToolbar.mjs.map +1 -1
- package/dist/inquiry/v2/tree/LoadRecordDialog.d.ts +3 -3
- package/dist/inquiry/v2/tree/LoadRecordDialog.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/LoadRecordDialog.js +12 -7
- package/dist/inquiry/v2/tree/LoadRecordDialog.js.map +1 -1
- package/dist/inquiry/v2/tree/LoadRecordDialog.mjs +48 -33
- package/dist/inquiry/v2/tree/LoadRecordDialog.mjs.map +1 -1
- package/dist/inquiry/v2/tree/NodeList.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/NodeList.js +17 -6
- package/dist/inquiry/v2/tree/NodeList.js.map +1 -1
- package/dist/inquiry/v2/tree/NodeList.mjs +49 -36
- package/dist/inquiry/v2/tree/NodeList.mjs.map +1 -1
- package/dist/inquiry/v2/tree/arrivalModel.d.ts +15 -0
- package/dist/inquiry/v2/tree/arrivalModel.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/arrivalModel.js +14 -1
- package/dist/inquiry/v2/tree/arrivalModel.js.map +1 -1
- package/dist/inquiry/v2/tree/arrivalModel.mjs +12 -1
- package/dist/inquiry/v2/tree/arrivalModel.mjs.map +1 -1
- package/dist/inquiry/v2/tree/branchRefreshModel.d.ts +32 -0
- package/dist/inquiry/v2/tree/branchRefreshModel.d.ts.map +1 -0
- package/dist/inquiry/v2/tree/branchRefreshModel.js +62 -0
- package/dist/inquiry/v2/tree/branchRefreshModel.js.map +1 -0
- package/dist/inquiry/v2/tree/branchRefreshModel.mjs +60 -0
- package/dist/inquiry/v2/tree/branchRefreshModel.mjs.map +1 -0
- package/dist/inquiry/v2/tree/droppedPageModel.d.ts +23 -1
- package/dist/inquiry/v2/tree/droppedPageModel.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/droppedPageModel.js +53 -26
- package/dist/inquiry/v2/tree/droppedPageModel.js.map +1 -1
- package/dist/inquiry/v2/tree/droppedPageModel.mjs +48 -20
- package/dist/inquiry/v2/tree/droppedPageModel.mjs.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.d.ts +7 -12
- package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.js +44 -15
- package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.js.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.mjs +34 -15
- package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.mjs.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/useAggregateBadges.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/useAggregateBadges.js +7 -18
- package/dist/inquiry/v2/tree/fluentTreeMenu/useAggregateBadges.js.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/useAggregateBadges.mjs +6 -14
- package/dist/inquiry/v2/tree/fluentTreeMenu/useAggregateBadges.mjs.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.d.ts +20 -16
- package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.js +77 -55
- package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.js.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.mjs +85 -106
- package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.mjs.map +1 -1
- package/dist/inquiry/v2/tree/lineageModel.d.ts +18 -1
- package/dist/inquiry/v2/tree/lineageModel.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/lineageModel.js +71 -2
- package/dist/inquiry/v2/tree/lineageModel.js.map +1 -1
- package/dist/inquiry/v2/tree/lineageModel.mjs +53 -3
- package/dist/inquiry/v2/tree/lineageModel.mjs.map +1 -1
- package/dist/inquiry/v2/tree/menuRebuildModel.d.ts +10 -27
- package/dist/inquiry/v2/tree/menuRebuildModel.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/menuRebuildModel.js +8 -58
- package/dist/inquiry/v2/tree/menuRebuildModel.js.map +1 -1
- package/dist/inquiry/v2/tree/menuRebuildModel.mjs +8 -51
- package/dist/inquiry/v2/tree/menuRebuildModel.mjs.map +1 -1
- package/dist/inquiry/v2/tree/pagedChildrenModel.d.ts +26 -0
- package/dist/inquiry/v2/tree/pagedChildrenModel.d.ts.map +1 -0
- package/dist/inquiry/v2/tree/pagedChildrenModel.js +56 -0
- package/dist/inquiry/v2/tree/pagedChildrenModel.js.map +1 -0
- package/dist/inquiry/v2/tree/pagedChildrenModel.mjs +43 -0
- package/dist/inquiry/v2/tree/pagedChildrenModel.mjs.map +1 -0
- package/dist/inquiry/v2/tree/rootRemovalModel.d.ts +7 -0
- package/dist/inquiry/v2/tree/rootRemovalModel.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/rootRemovalModel.js +31 -5
- package/dist/inquiry/v2/tree/rootRemovalModel.js.map +1 -1
- package/dist/inquiry/v2/tree/rootRemovalModel.mjs +21 -4
- package/dist/inquiry/v2/tree/rootRemovalModel.mjs.map +1 -1
- package/dist/inquiry/v2/tree/treeFilterModel.d.ts +0 -2
- package/dist/inquiry/v2/tree/treeFilterModel.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/treeFilterModel.js +0 -7
- package/dist/inquiry/v2/tree/treeFilterModel.js.map +1 -1
- package/dist/inquiry/v2/tree/treeFilterModel.mjs.map +1 -1
- package/dist/inquiry/v2/tree/useInquiryMenu.d.ts +16 -7
- package/dist/inquiry/v2/tree/useInquiryMenu.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/useInquiryMenu.js +401 -163
- package/dist/inquiry/v2/tree/useInquiryMenu.js.map +1 -1
- package/dist/inquiry/v2/tree/useInquiryMenu.mjs +511 -310
- package/dist/inquiry/v2/tree/useInquiryMenu.mjs.map +1 -1
- package/dist/inquiry/v2/tree/waveLoader.d.ts +10 -11
- package/dist/inquiry/v2/tree/waveLoader.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/waveLoader.js +78 -72
- package/dist/inquiry/v2/tree/waveLoader.js.map +1 -1
- package/dist/inquiry/v2/tree/waveLoader.mjs +79 -68
- package/dist/inquiry/v2/tree/waveLoader.mjs.map +1 -1
- package/dist/inquiry/v2/widgets/listRow.module.css +27 -0
- package/dist/inquiry/v2/widgets/widgetRowModel.d.ts +6 -2
- package/dist/inquiry/v2/widgets/widgetRowModel.d.ts.map +1 -1
- package/dist/inquiry/v2/widgets/widgetRowModel.js +49 -14
- package/dist/inquiry/v2/widgets/widgetRowModel.js.map +1 -1
- package/dist/inquiry/v2/widgets/widgetRowModel.mjs +36 -12
- package/dist/inquiry/v2/widgets/widgetRowModel.mjs.map +1 -1
- package/dist/maintenance/UdpTaggedRecordsPage.mjs +1 -1
- package/dist/maintenance/api/lookupApi.mjs +1 -1
- package/dist/maintenance/api/tagsApi.mjs +1 -1
- package/dist/maintenance/config/nodeDefaults.d.ts.map +1 -1
- package/dist/maintenance/config/nodeDefaults.js +16 -5
- package/dist/maintenance/config/nodeDefaults.js.map +1 -1
- package/dist/maintenance/config/nodeDefaults.mjs +14 -5
- package/dist/maintenance/config/nodeDefaults.mjs.map +1 -1
- package/dist/maintenance/config/useEntityConfig.mjs +1 -1
- package/dist/maintenance/config/useLinkedLabels.mjs +1 -1
- package/dist/maintenance/grid/MaintenanceGrid.mjs +1 -1
- package/dist/maintenance/metadata/useEntityMetadata.mjs +1 -1
- package/dist/maintenance/record/ChildTab.mjs +1 -1
- package/dist/maintenance/record/DeleteRecordDialog.mjs +1 -1
- package/dist/maintenance/record/LinkRecordsSheet.mjs +1 -1
- package/dist/maintenance/record/RecordFacts.mjs +1 -1
- package/dist/maintenance/record/RecordSheet.mjs +2 -2
- package/dist/maintenance/record/displayValue.mjs +1 -1
- package/dist/maintenance/record/stampDisplayText.mjs +1 -1
- package/dist/maintenance/settings/useEntityCatalog.mjs +1 -1
- package/dist/maintenanceEngine/tableBrowser/TableColumnDefs.d.ts +4 -5
- package/dist/maintenanceEngine/tableBrowser/TableColumnDefs.d.ts.map +1 -1
- package/dist/stores/inquiryStore.d.ts +2 -1
- package/dist/stores/inquiryStore.d.ts.map +1 -1
- package/dist/stores/inquiryStore.js +4 -3
- package/dist/stores/inquiryStore.js.map +1 -1
- package/dist/stores/inquiryStore.mjs +18 -11
- package/dist/stores/inquiryStore.mjs.map +1 -1
- package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.d.ts.map +1 -1
- package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.js +1 -1
- package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.js.map +1 -1
- package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.mjs +2 -1
- package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.mjs.map +1 -1
- package/dist/udp/pages/UdpMaintenanceEnginePage/components/EntitiyTimeLine.mjs +1 -1
- package/dist/udp/utilities/useDateStringColumnDef.d.ts +1 -1
- package/dist/utilities/i18n/locales/es-US.json +23 -5
- package/dist/utilities/i18n/locales/es-US.mjs +24 -4
- package/dist/utilities/i18n/locales/fr-CA.json +23 -5
- package/dist/utilities/i18n/locales/fr-CA.mjs +24 -4
- package/package.json +30 -18
- package/dist/actionPanels/PanelActionForm.d.ts +0 -56
- package/dist/actionPanels/PanelActionForm.d.ts.map +0 -1
- package/dist/actionPanels/PanelActionForm.js +0 -30
- package/dist/actionPanels/PanelActionForm.js.map +0 -1
- package/dist/actionPanels/PanelActionForm.mjs +0 -168
- package/dist/actionPanels/PanelActionForm.mjs.map +0 -1
- package/dist/actionPanels/PanelEditor.d.ts +0 -44
- package/dist/actionPanels/PanelEditor.d.ts.map +0 -1
- package/dist/actionPanels/PanelEditor.js +0 -78
- package/dist/actionPanels/PanelEditor.js.map +0 -1
- package/dist/actionPanels/PanelEditor.mjs +0 -345
- package/dist/actionPanels/PanelEditor.mjs.map +0 -1
- package/dist/actionPanels/panelActionFields.module.css +0 -18
- package/dist/domain/inquiryTree/ruleBindings.d.ts +0 -10
- package/dist/domain/inquiryTree/ruleBindings.d.ts.map +0 -1
- package/dist/domain/inquiryTree/ruleBindings.js +0 -20
- package/dist/domain/inquiryTree/ruleBindings.js.map +0 -1
- package/dist/domain/inquiryTree/ruleBindings.mjs +0 -21
- package/dist/domain/inquiryTree/ruleBindings.mjs.map +0 -1
- package/dist/inquiry/v2/kernel/readOnlyModel.d.ts +0 -17
- package/dist/inquiry/v2/kernel/readOnlyModel.d.ts.map +0 -1
- package/dist/inquiry/v2/kernel/readOnlyModel.js +0 -19
- package/dist/inquiry/v2/kernel/readOnlyModel.js.map +0 -1
- package/dist/inquiry/v2/kernel/readOnlyModel.mjs +0 -21
- package/dist/inquiry/v2/kernel/readOnlyModel.mjs.map +0 -1
|
@@ -1,91 +1,86 @@
|
|
|
1
|
-
import { isGroupNode } from "./types.mjs";
|
|
2
1
|
import { toWireString } from "./wireString.mjs";
|
|
3
|
-
import {
|
|
2
|
+
import { isGroupNode } from "./types.mjs";
|
|
3
|
+
import { issueText } from "./names.mjs";
|
|
4
4
|
import { deepClone } from "../jsonClone.mjs";
|
|
5
|
+
import { validateTree } from "./validate.mjs";
|
|
5
6
|
//#region src/domain/inquiryTree/serialize.ts
|
|
6
7
|
/**
|
|
7
8
|
* Tolerant reader (wire → typed) and strict writer (typed → wire).
|
|
8
9
|
* The ONLY place in the codebase that reshapes tree data (foundation principle 1).
|
|
9
10
|
*
|
|
10
|
-
* Reader guarantees: no data loss
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* - root parentId: '' ⇄ null
|
|
11
|
+
* Reader guarantees: no data loss and no reshaping — every value keeps its
|
|
12
|
+
* wire form (icon colours, the root's '' parentId). Unknown keys ride through
|
|
13
|
+
* unknownProperties / unknownNodeKeys and are re-emitted on write. Old trees
|
|
14
|
+
* round-trip byte-safely except what the detailed read stamps on
|
|
15
|
+
* (searchFilterElements, searchTableColumns, associatedInquiryTree): read-time
|
|
16
|
+
* derivations, dropped on read (v2 derives them or reads the linked tree).
|
|
17
17
|
*
|
|
18
|
-
* `toWire` is the READ shape — joins (panels, nodeActions,
|
|
19
|
-
*
|
|
20
|
-
* the tree PUT: the same minus the joins, which have their own endpoints.
|
|
18
|
+
* `toWire` is the READ shape — joins (panels, nodeActions) included, so a
|
|
19
|
+
* working tree renders exactly as a saved one — and the save's body.
|
|
21
20
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
21
|
+
const TYPED_PROPERTY_KEYS = new Set(Object.keys({
|
|
22
|
+
name: true,
|
|
23
|
+
displayName: true,
|
|
24
|
+
displayDetails: true,
|
|
25
|
+
headerName: true,
|
|
26
|
+
inquiryTitle: true,
|
|
27
|
+
description: true,
|
|
28
|
+
sequenceNo: true,
|
|
29
|
+
catalogReturnObject: true,
|
|
30
|
+
catalogObjectKey: true,
|
|
31
|
+
associatedTreeId: true,
|
|
32
|
+
associatedTreePrimaryKeyMap: true,
|
|
33
|
+
showTags: true,
|
|
34
|
+
headerShowTags: true,
|
|
35
|
+
loadRecordsOnOpen: true,
|
|
36
|
+
lazyLoad: true,
|
|
37
|
+
isPrimarySearch: true,
|
|
38
|
+
isDraggable: true,
|
|
39
|
+
defaultDisplay: true,
|
|
40
|
+
joiningEntityName: true,
|
|
41
|
+
joiningEntityCatalogObjectKey: true,
|
|
42
|
+
joiningEntityCatalogObjectLeftKey: true,
|
|
43
|
+
joiningEntityChildKey: true,
|
|
44
|
+
joinedWithName: true,
|
|
45
|
+
isUsingJointEntityAdditionalProperties: true,
|
|
46
|
+
defaultIcon: true,
|
|
47
|
+
conditionalNodeIcons: true,
|
|
48
|
+
conditionalNodeIconExpression: true,
|
|
49
|
+
conditionalNodeAdornments: true,
|
|
50
|
+
conditionalNodeAdornmentExpression: true,
|
|
51
|
+
conditionalIcons: true,
|
|
52
|
+
conditionalIconExpression: true,
|
|
53
|
+
hiddenNode: true,
|
|
54
|
+
tabs: true,
|
|
55
|
+
nodeHeaderPages: true,
|
|
56
|
+
pageHeaderConfiguration: true,
|
|
57
|
+
searchConfiguration: true,
|
|
58
|
+
alerts: true,
|
|
59
|
+
actions: true,
|
|
60
|
+
appsConfiguration: true,
|
|
61
|
+
defaultNodeHeaderExpanded: true,
|
|
62
|
+
defaultPageHeaderExpanded: true,
|
|
63
|
+
aggregateThresholdId: true,
|
|
64
|
+
aggregateThresholdParamMappings: true,
|
|
65
|
+
countChips: true,
|
|
66
|
+
countChip: true,
|
|
67
|
+
groupConfiguration: true,
|
|
68
|
+
isActive: true,
|
|
69
|
+
childNodes: true,
|
|
70
|
+
keys: true,
|
|
71
|
+
path: true,
|
|
72
|
+
noOfNodesDisplayed: true,
|
|
73
|
+
icon: true,
|
|
74
|
+
catalogObjectProperty: true,
|
|
75
|
+
panels: true,
|
|
76
|
+
nodeActions: true
|
|
77
|
+
}));
|
|
78
|
+
/** What the backend stamps on the detailed read — derivations, never data. */
|
|
79
|
+
const READ_TIME_DERIVED_KEYS = new Set([
|
|
80
|
+
"searchFilterElements",
|
|
81
|
+
"searchTableColumns",
|
|
79
82
|
"associatedInquiryTree"
|
|
80
83
|
]);
|
|
81
|
-
/** Read-time derivations of the config the backend stamps on the detailed read — never data. */
|
|
82
|
-
const READ_TIME_DERIVED_KEYS = new Set(["searchFilterElements", "searchTableColumns"]);
|
|
83
|
-
/** The node's joins — on the node in the read shape, out of the tree PUT. */
|
|
84
|
-
const JOIN_KEYS = [
|
|
85
|
-
"panels",
|
|
86
|
-
"nodeActions",
|
|
87
|
-
"associatedInquiryTree"
|
|
88
|
-
];
|
|
89
84
|
const NODE_LEVEL_KEYS = new Set([
|
|
90
85
|
"id",
|
|
91
86
|
"parentId",
|
|
@@ -95,88 +90,24 @@ const NODE_LEVEL_KEYS = new Set([
|
|
|
95
90
|
"groupType",
|
|
96
91
|
"properties"
|
|
97
92
|
]);
|
|
98
|
-
/** '' | '#hex' | react-color object | {hex} | null/undefined → IconColor | null. */
|
|
99
|
-
const readIconColor = (raw) => {
|
|
100
|
-
if (raw === null || raw === void 0 || raw === "") return null;
|
|
101
|
-
if (typeof raw === "string") return { hex: raw };
|
|
102
|
-
if (typeof raw === "object") {
|
|
103
|
-
const hex = raw.hex;
|
|
104
|
-
if (typeof hex === "string" && hex !== "") return { hex };
|
|
105
|
-
return null;
|
|
106
|
-
}
|
|
107
|
-
return null;
|
|
108
|
-
};
|
|
109
|
-
/** Domain color → legacy wire convention: no color = '', color = { hex }. */
|
|
110
|
-
const writeIconColor = (color) => color && color.hex ? { hex: color.hex } : "";
|
|
111
|
-
const readNodeIcon = (raw) => {
|
|
112
|
-
if (raw === null || raw === void 0) return null;
|
|
113
|
-
if (typeof raw !== "object") return null;
|
|
114
|
-
const { name, color, type, fluentName, ...rest } = raw;
|
|
115
|
-
const icon = { name: typeof name === "string" ? name : "" };
|
|
116
|
-
if (color !== void 0) icon.color = readIconColor(color);
|
|
117
|
-
if (type !== void 0) icon.type = typeof type === "string" ? type : null;
|
|
118
|
-
if (fluentName !== void 0) icon.fluentName = typeof fluentName === "string" ? fluentName : null;
|
|
119
|
-
if (Object.keys(rest).length) icon.unknownKeys = deepClone(rest);
|
|
120
|
-
return icon;
|
|
121
|
-
};
|
|
122
|
-
const writeNodeIcon = (icon) => {
|
|
123
|
-
if (!icon) return icon === null ? null : void 0;
|
|
124
|
-
const out = {
|
|
125
|
-
...icon.unknownKeys ?? {},
|
|
126
|
-
name: icon.name
|
|
127
|
-
};
|
|
128
|
-
if (icon.color !== void 0) out.color = writeIconColor(icon.color);
|
|
129
|
-
if (icon.type !== void 0) out.type = icon.type;
|
|
130
|
-
if (icon.fluentName !== void 0) out.fluentName = icon.fluentName;
|
|
131
|
-
return out;
|
|
132
|
-
};
|
|
133
|
-
const readConditionalRule = (raw) => {
|
|
134
|
-
const { iconColor, ...rest } = raw ?? {};
|
|
135
|
-
const rule = deepClone(rest);
|
|
136
|
-
if (iconColor !== void 0) rule.iconColor = readIconColor(iconColor);
|
|
137
|
-
return rule;
|
|
138
|
-
};
|
|
139
|
-
const writeConditionalRule = (rule) => {
|
|
140
|
-
const { iconColor, ...rest } = rule;
|
|
141
|
-
const out = deepClone(rest);
|
|
142
|
-
if (iconColor !== void 0) out.iconColor = writeIconColor(iconColor);
|
|
143
|
-
return out;
|
|
144
|
-
};
|
|
145
93
|
const readProperties = (raw) => {
|
|
146
94
|
const props = {};
|
|
147
95
|
const unknown = {};
|
|
148
96
|
for (const [key, value] of Object.entries(raw)) {
|
|
149
97
|
if (READ_TIME_DERIVED_KEYS.has(key)) continue;
|
|
150
|
-
if (
|
|
151
|
-
|
|
152
|
-
continue;
|
|
153
|
-
}
|
|
154
|
-
switch (key) {
|
|
155
|
-
case "defaultIcon":
|
|
156
|
-
props.defaultIcon = readNodeIcon(value);
|
|
157
|
-
break;
|
|
158
|
-
case "conditionalNodeIcons":
|
|
159
|
-
props.conditionalNodeIcons = Array.isArray(value) ? value.map(readConditionalRule) : [];
|
|
160
|
-
break;
|
|
161
|
-
case "conditionalNodeAdornments":
|
|
162
|
-
props.conditionalNodeAdornments = Array.isArray(value) ? value.map(readConditionalRule) : [];
|
|
163
|
-
break;
|
|
164
|
-
default: props[key] = deepClone(value);
|
|
165
|
-
}
|
|
98
|
+
if (TYPED_PROPERTY_KEYS.has(key)) props[key] = deepClone(value);
|
|
99
|
+
else unknown[key] = deepClone(value);
|
|
166
100
|
}
|
|
167
101
|
if (Object.keys(unknown).length) props.unknownProperties = unknown;
|
|
168
102
|
return props;
|
|
169
103
|
};
|
|
170
104
|
const writeProperties = (props) => {
|
|
171
|
-
const {
|
|
105
|
+
const { unknownProperties, ...rest } = props;
|
|
172
106
|
const out = { ...deepClone(unknownProperties ?? {}) };
|
|
173
107
|
for (const [key, value] of Object.entries(rest)) {
|
|
174
108
|
if (value === void 0) continue;
|
|
175
109
|
out[key] = deepClone(value);
|
|
176
110
|
}
|
|
177
|
-
if (defaultIcon !== void 0) out.defaultIcon = writeNodeIcon(defaultIcon);
|
|
178
|
-
if (conditionalNodeIcons !== void 0) out.conditionalNodeIcons = conditionalNodeIcons.map(writeConditionalRule);
|
|
179
|
-
if (conditionalNodeAdornments !== void 0) out.conditionalNodeAdornments = conditionalNodeAdornments.map(writeConditionalRule);
|
|
180
111
|
return out;
|
|
181
112
|
};
|
|
182
113
|
const readNode = (raw) => {
|
|
@@ -184,8 +115,8 @@ const readNode = (raw) => {
|
|
|
184
115
|
const unknownNodeKeys = {};
|
|
185
116
|
for (const [key, value] of Object.entries(source)) if (!NODE_LEVEL_KEYS.has(key)) unknownNodeKeys[key] = deepClone(value);
|
|
186
117
|
const base = {
|
|
187
|
-
id:
|
|
188
|
-
parentId:
|
|
118
|
+
id: toWireString(source.id),
|
|
119
|
+
parentId: toWireString(source.parentId)
|
|
189
120
|
};
|
|
190
121
|
if (source.parentGroupId !== void 0) base.parentGroupId = source.parentGroupId;
|
|
191
122
|
if (source.isDeleted !== void 0) base.isDeleted = Boolean(source.isDeleted);
|
|
@@ -204,7 +135,7 @@ const readNode = (raw) => {
|
|
|
204
135
|
const writeNode = (node) => {
|
|
205
136
|
const out = { ...deepClone(node.unknownNodeKeys ?? {}) };
|
|
206
137
|
out.id = node.id;
|
|
207
|
-
out.parentId = node.parentId
|
|
138
|
+
out.parentId = node.parentId;
|
|
208
139
|
if (node.parentGroupId !== void 0) out.parentGroupId = node.parentGroupId;
|
|
209
140
|
if (node.isDeleted !== void 0) out.isDeleted = node.isDeleted;
|
|
210
141
|
if (isGroupNode(node)) {
|
|
@@ -217,35 +148,35 @@ const writeNode = (node) => {
|
|
|
217
148
|
return out;
|
|
218
149
|
};
|
|
219
150
|
/**
|
|
220
|
-
* Tolerant reader:
|
|
151
|
+
* Tolerant reader: GET inquiryTree/{id} → InquiryTree.
|
|
221
152
|
* Accepts every known legacy quirk without data loss; never throws on shape surprises.
|
|
222
153
|
*/
|
|
223
154
|
const fromWire = (wire) => {
|
|
224
|
-
const { treeStructure, ...wrapper } = wire;
|
|
225
|
-
const rawNodes = Array.isArray(treeStructure) ? treeStructure : typeof treeStructure === "string" && treeStructure.trim() ? JSON.parse(treeStructure) : [];
|
|
155
|
+
const { treeStructure, inquiryTreeId, name, ...wrapper } = wire;
|
|
226
156
|
return {
|
|
227
|
-
inquiryTreeId
|
|
228
|
-
name
|
|
229
|
-
nodes:
|
|
157
|
+
inquiryTreeId,
|
|
158
|
+
name,
|
|
159
|
+
nodes: (treeStructure ?? []).map(readNode),
|
|
230
160
|
wrapper: deepClone(wrapper)
|
|
231
161
|
};
|
|
232
162
|
};
|
|
233
163
|
var TreeSerializationError = class extends Error {
|
|
234
|
-
|
|
235
|
-
|
|
164
|
+
/** `tree` names each issue's level (issueText). */
|
|
165
|
+
constructor(issues, tree) {
|
|
166
|
+
super(`Refusing to serialize an invalid tree: ${issues.filter((issue) => issue.severity === "error").map((issue) => issueText(tree, issue)).join("; ")}`);
|
|
236
167
|
this.name = "TreeSerializationError";
|
|
237
168
|
this.issues = issues;
|
|
238
169
|
}
|
|
239
170
|
};
|
|
240
171
|
/**
|
|
241
|
-
* Strict writer: InquiryTree → the
|
|
172
|
+
* Strict writer: InquiryTree → the GET shape the save takes back
|
|
242
173
|
* (whole wrapper spread + flat `treeStructure` node array — never stringified).
|
|
243
174
|
* Refuses to serialize a tree with validation errors.
|
|
244
175
|
*/
|
|
245
176
|
const toWire = (tree, options) => {
|
|
246
177
|
if (!options?.skipValidation) {
|
|
247
178
|
const issues = validateTree(tree);
|
|
248
|
-
if (issues.some((issue) => issue.severity === "error")) throw new TreeSerializationError(issues);
|
|
179
|
+
if (issues.some((issue) => issue.severity === "error")) throw new TreeSerializationError(issues, tree);
|
|
249
180
|
}
|
|
250
181
|
return {
|
|
251
182
|
...deepClone(tree.wrapper),
|
|
@@ -254,29 +185,7 @@ const toWire = (tree, options) => {
|
|
|
254
185
|
treeStructure: tree.nodes.map(writeNode)
|
|
255
186
|
};
|
|
256
187
|
};
|
|
257
|
-
/**
|
|
258
|
-
* The tree PUT body. The backend stores `treeStructure` verbatim, and the joins
|
|
259
|
-
* are rows in their own tables written through their own endpoints — so the
|
|
260
|
-
* JSON carries `panels: []` / `nodeActions: []` (the backend's own convention
|
|
261
|
-
* when it duplicates a tree) and no associated tree. Same validation as
|
|
262
|
-
* `toWire`.
|
|
263
|
-
*/
|
|
264
|
-
const toPutBody = (tree, options) => {
|
|
265
|
-
const wire = toWire(tree, options);
|
|
266
|
-
wire.treeStructure = wire.treeStructure.map((node) => {
|
|
267
|
-
if (!node.properties) return node;
|
|
268
|
-
const properties = { ...node.properties };
|
|
269
|
-
for (const key of JOIN_KEYS) delete properties[key];
|
|
270
|
-
properties.panels = [];
|
|
271
|
-
properties.nodeActions = [];
|
|
272
|
-
return {
|
|
273
|
-
...node,
|
|
274
|
-
properties
|
|
275
|
-
};
|
|
276
|
-
});
|
|
277
|
-
return wire;
|
|
278
|
-
};
|
|
279
188
|
//#endregion
|
|
280
|
-
export { TreeSerializationError, fromWire,
|
|
189
|
+
export { TreeSerializationError, fromWire, toWire };
|
|
281
190
|
|
|
282
191
|
//# sourceMappingURL=serialize.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialize.mjs","names":["ConditionalIconRule","EntityNode","EntityNodeProperties","GroupNode","IconColor","InquiryTree","NodeIcon","TreeNode","isGroupNode","validateTree","toWireString","deepClone","TYPED_PROPERTY_KEYS","Set","READ_TIME_DERIVED_KEYS","JOIN_KEYS","const","NODE_LEVEL_KEYS","readIconColor","raw","undefined","hex","writeIconColor","color","readNodeIcon","name","type","fluentName","rest","Record","icon","Object","keys","length","unknownKeys","writeNodeIcon","out","readConditionalRule","source","iconColor","rule","writeConditionalRule","readProperties","props","unknown","key","value","entries","has","defaultIcon","conditionalNodeIcons","Array","isArray","map","conditionalNodeAdornments","unknownProperties","writeProperties","readNode","unknownNodeKeys","base","id","parentId","parentGroupId","isDeleted","Boolean","group","groupType","properties","entity","writeNode","node","fromWire","wire","treeStructure","wrapper","rawNodes","trim","JSON","parse","inquiryTreeId","nodes","TreeSerializationError","Error","issues","ReturnType","constructor","filter","issue","severity","message","join","ToWireOptions","skipValidation","toWire","tree","options","some","toPutBody","panels","nodeActions"],"sources":["../../../src/domain/inquiryTree/serialize.ts"],"sourcesContent":["/**\n * Tolerant reader (wire → typed) and strict writer (typed → wire).\n * The ONLY place in the codebase that reshapes tree data (foundation principle 1).\n *\n * Reader guarantees: no data loss. Unknown keys ride through unknownProperties /\n * unknownNodeKeys and are re-emitted on write. Old trees round-trip byte-safely\n * modulo the documented normalizations:\n * - searchFilterElements/searchTableColumns: read-time derivations of the\n * config, dropped on read (v2 derives them itself)\n * - typed color fields: '' | '#hex' string | react-color object → { hex } | null\n * - root parentId: '' ⇄ null\n *\n * `toWire` is the READ shape — joins (panels, nodeActions, associatedInquiryTree)\n * included, so a working tree renders exactly as a saved one. `toPutBody` is\n * the tree PUT: the same minus the joins, which have their own endpoints.\n */\nimport {\n ConditionalIconRule,\n EntityNode,\n EntityNodeProperties,\n GroupNode,\n IconColor,\n InquiryTree,\n NodeIcon,\n TreeNode,\n isGroupNode\n} from './types';\nimport { validateTree } from './validate';\nimport { toWireString } from './wireString';\nimport { deepClone } from '../jsonClone';\n\n/** Property keys read into typed fields (everything else → unknownProperties). */\nconst TYPED_PROPERTY_KEYS = new Set([\n 'name',\n 'displayName',\n 'displayDetails',\n 'headerName',\n 'inquiryTitle',\n 'description',\n 'sequenceNo',\n 'catalogReturnObject',\n 'catalogObjectKey',\n 'associatedTreeId',\n 'associatedTreePrimaryKeyMap',\n 'eagerLoad',\n 'showTags',\n 'headerShowTags',\n 'loadRecordsOnOpen',\n 'lazyLoad',\n 'isPrimarySearch',\n 'isDraggable',\n 'defaultDisplay',\n 'joiningEntityName',\n 'joiningEntityCatalogObjectKey',\n 'joiningEntityCatalogObjectLeftKey',\n 'joiningEntityChildKey',\n 'joinedWithName',\n 'isUsingJointEntityAdditionalProperties',\n 'defaultIcon',\n 'conditionalNodeIcons',\n 'conditionalNodeIconExpression',\n 'conditionalNodeAdornments',\n 'conditionalNodeAdornmentExpression',\n 'conditionalIcons',\n 'conditionalIconExpression',\n 'hiddenNode',\n 'tabs',\n 'nodeHeaderPages',\n 'pageHeaderConfiguration',\n 'searchConfiguration',\n 'alerts',\n 'actions',\n 'appsConfiguration',\n 'defaultNodeHeaderExpanded',\n 'defaultPageHeaderExpanded',\n 'aggregateThresholdId',\n 'aggregateThresholdParamMappings',\n 'countChip',\n 'groupConfiguration',\n 'isActive',\n 'childNodes',\n 'keys',\n 'path',\n 'noOfNodesDisplayed',\n 'icon',\n 'catalogObjectProperty',\n 'panels',\n 'nodeActions',\n 'associatedInquiryTree'\n]);\n\n/** Read-time derivations of the config the backend stamps on the detailed read — never data. */\nconst READ_TIME_DERIVED_KEYS = new Set(['searchFilterElements', 'searchTableColumns']);\n\n/** The node's joins — on the node in the read shape, out of the tree PUT. */\nconst JOIN_KEYS = ['panels', 'nodeActions', 'associatedInquiryTree'] as const;\n\nconst NODE_LEVEL_KEYS = new Set([\n 'id',\n 'parentId',\n 'parentGroupId',\n 'isDeleted',\n 'isGroupNode',\n 'groupType',\n 'properties'\n]);\n\n/** '' | '#hex' | react-color object | {hex} | null/undefined → IconColor | null. */\nexport const readIconColor = (raw: unknown): IconColor | null => {\n if (raw === null || raw === undefined || raw === '') return null;\n if (typeof raw === 'string') return { hex: raw };\n if (typeof raw === 'object') {\n const hex = (raw as { hex?: unknown }).hex;\n if (typeof hex === 'string' && hex !== '') return { hex };\n return null;\n }\n return null;\n};\n\n/** Domain color → legacy wire convention: no color = '', color = { hex }. */\nexport const writeIconColor = (color: IconColor | null | undefined): unknown =>\n color && color.hex ? { hex: color.hex } : '';\n\nconst readNodeIcon = (raw: unknown): NodeIcon | null => {\n if (raw === null || raw === undefined) return null;\n if (typeof raw !== 'object') return null;\n const { name, color, type, fluentName, ...rest } = raw as Record<\n string,\n unknown\n >;\n const icon: NodeIcon = { name: typeof name === 'string' ? name : '' };\n if (color !== undefined) icon.color = readIconColor(color);\n if (type !== undefined) icon.type = typeof type === 'string' ? type : null;\n if (fluentName !== undefined) {\n icon.fluentName = typeof fluentName === 'string' ? fluentName : null;\n }\n if (Object.keys(rest).length) icon.unknownKeys = deepClone(rest);\n return icon;\n};\n\nconst writeNodeIcon = (icon: NodeIcon | null | undefined): unknown => {\n if (!icon) return icon === null ? null : undefined;\n const out: Record<string, unknown> = {\n ...(icon.unknownKeys ?? {}),\n name: icon.name\n };\n if (icon.color !== undefined) out.color = writeIconColor(icon.color);\n if (icon.type !== undefined) out.type = icon.type;\n if (icon.fluentName !== undefined) out.fluentName = icon.fluentName;\n return out;\n};\n\nconst readConditionalRule = (raw: unknown): ConditionalIconRule => {\n const source = (raw ?? {}) as Record<string, unknown>;\n const { iconColor, ...rest } = source;\n const rule = deepClone(rest) as ConditionalIconRule;\n if (iconColor !== undefined) rule.iconColor = readIconColor(iconColor);\n return rule;\n};\n\nconst writeConditionalRule = (\n rule: ConditionalIconRule\n): Record<string, unknown> => {\n const { iconColor, ...rest } = rule;\n const out: Record<string, unknown> = deepClone(rest);\n if (iconColor !== undefined) out.iconColor = writeIconColor(iconColor);\n return out;\n};\n\nconst readProperties = (raw: Record<string, unknown>): EntityNodeProperties => {\n const props: EntityNodeProperties = {};\n const unknown: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(raw)) {\n if (READ_TIME_DERIVED_KEYS.has(key)) continue;\n if (!TYPED_PROPERTY_KEYS.has(key)) {\n unknown[key] = deepClone(value);\n continue;\n }\n switch (key) {\n case 'defaultIcon':\n props.defaultIcon = readNodeIcon(value);\n break;\n case 'conditionalNodeIcons':\n props.conditionalNodeIcons = Array.isArray(value)\n ? value.map(readConditionalRule)\n : [];\n break;\n case 'conditionalNodeAdornments':\n props.conditionalNodeAdornments = Array.isArray(value)\n ? value.map(readConditionalRule)\n : [];\n break;\n default:\n (props as Record<string, unknown>)[key] = deepClone(value);\n }\n }\n\n if (Object.keys(unknown).length) props.unknownProperties = unknown;\n return props;\n};\n\nconst writeProperties = (\n props: EntityNodeProperties\n): Record<string, unknown> => {\n const {\n defaultIcon,\n conditionalNodeIcons,\n conditionalNodeAdornments,\n unknownProperties,\n ...rest\n } = props;\n\n const out: Record<string, unknown> = {\n ...deepClone(unknownProperties ?? {})\n };\n for (const [key, value] of Object.entries(rest)) {\n if (value === undefined) continue;\n out[key] = deepClone(value);\n }\n if (defaultIcon !== undefined) out.defaultIcon = writeNodeIcon(defaultIcon);\n if (conditionalNodeIcons !== undefined) {\n out.conditionalNodeIcons = conditionalNodeIcons.map(writeConditionalRule);\n }\n if (conditionalNodeAdornments !== undefined) {\n out.conditionalNodeAdornments =\n conditionalNodeAdornments.map(writeConditionalRule);\n }\n return out;\n};\n\nconst readNode = (raw: unknown): TreeNode => {\n const source = (raw ?? {}) as Record<string, unknown>;\n const unknownNodeKeys: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(source)) {\n if (!NODE_LEVEL_KEYS.has(key)) unknownNodeKeys[key] = deepClone(value);\n }\n\n const base = {\n id: typeof source.id === 'string' ? source.id : '',\n parentId:\n source.parentId === '' ||\n source.parentId === null ||\n source.parentId === undefined\n ? null\n : toWireString(source.parentId)\n } as TreeNode;\n if (source.parentGroupId !== undefined)\n base.parentGroupId = source.parentGroupId as string | null;\n if (source.isDeleted !== undefined)\n base.isDeleted = Boolean(source.isDeleted);\n if (Object.keys(unknownNodeKeys).length)\n base.unknownNodeKeys = unknownNodeKeys;\n\n if ((source as { isGroupNode?: unknown }).isGroupNode === true) {\n const group = base as GroupNode;\n group.isGroupNode = true;\n if (source.groupType !== undefined)\n group.groupType = source.groupType as string;\n group.properties = deepClone(\n (source.properties ?? {}) as Record<string, unknown>\n );\n return group;\n }\n const entity = base as EntityNode;\n entity.properties = readProperties(\n (source.properties ?? {}) as Record<string, unknown>\n );\n return entity;\n};\n\nconst writeNode = (node: TreeNode): Record<string, unknown> => {\n const out: Record<string, unknown> = {\n ...deepClone(node.unknownNodeKeys ?? {})\n };\n out.id = node.id;\n // Legacy wire convention for roots is '' (decisions log #10).\n out.parentId = node.parentId === null ? '' : node.parentId;\n if (node.parentGroupId !== undefined) out.parentGroupId = node.parentGroupId;\n if (node.isDeleted !== undefined) out.isDeleted = node.isDeleted;\n if (isGroupNode(node)) {\n out.isGroupNode = true;\n if (node.groupType !== undefined) out.groupType = node.groupType;\n out.properties = deepClone(node.properties);\n return out;\n }\n out.properties = writeProperties(node.properties);\n return out;\n};\n\n/**\n * Tolerant reader: the full GET wrapper → InquiryTree.\n * Accepts every known legacy quirk without data loss; never throws on shape surprises.\n */\nexport const fromWire = (wire: Record<string, unknown>): InquiryTree => {\n const { treeStructure, ...wrapper } = wire;\n const rawNodes: unknown[] = Array.isArray(treeStructure)\n ? treeStructure\n : typeof treeStructure === 'string' && treeStructure.trim()\n ? (JSON.parse(treeStructure) as unknown[])\n : [];\n return {\n inquiryTreeId: toWireString(wire.inquiryTreeId),\n name: typeof wire.name === 'string' ? wire.name : undefined,\n nodes: rawNodes.map(readNode),\n wrapper: deepClone(wrapper)\n };\n};\n\nexport class TreeSerializationError extends Error {\n issues: ReturnType<typeof validateTree>;\n\n constructor(issues: ReturnType<typeof validateTree>) {\n super(\n `Refusing to serialize an invalid tree: ${issues\n .filter((issue) => issue.severity === 'error')\n .map((issue) => issue.message)\n .join('; ')}`\n );\n this.name = 'TreeSerializationError';\n this.issues = issues;\n }\n}\n\nexport interface ToWireOptions {\n /** Skip the strict-validation gate (used by tests exercising invalid trees). */\n skipValidation?: boolean;\n}\n\n/**\n * Strict writer: InquiryTree → the exact legacy PUT body shape\n * (whole wrapper spread + flat `treeStructure` node array — never stringified).\n * Refuses to serialize a tree with validation errors.\n */\nexport const toWire = (\n tree: InquiryTree,\n options?: ToWireOptions\n): Record<string, unknown> => {\n if (!options?.skipValidation) {\n const issues = validateTree(tree);\n if (issues.some((issue) => issue.severity === 'error')) {\n throw new TreeSerializationError(issues);\n }\n }\n return {\n ...deepClone(tree.wrapper),\n inquiryTreeId: tree.inquiryTreeId,\n ...(tree.name !== undefined ? { name: tree.name } : {}),\n treeStructure: tree.nodes.map(writeNode)\n };\n};\n\n/**\n * The tree PUT body. The backend stores `treeStructure` verbatim, and the joins\n * are rows in their own tables written through their own endpoints — so the\n * JSON carries `panels: []` / `nodeActions: []` (the backend's own convention\n * when it duplicates a tree) and no associated tree. Same validation as\n * `toWire`.\n */\nexport const toPutBody = (\n tree: InquiryTree,\n options?: ToWireOptions\n): Record<string, unknown> => {\n const wire = toWire(tree, options);\n wire.treeStructure = (wire.treeStructure as Record<string, unknown>[]).map(\n (node) => {\n if (!node.properties) return node;\n const properties = { ...(node.properties as Record<string, unknown>) };\n for (const key of JOIN_KEYS) delete properties[key];\n properties.panels = [];\n properties.nodeActions = [];\n return { ...node, properties };\n }\n );\n return wire;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAMY,sBAAsB,IAAIC,IAAI;CAClC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;C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B/B,aAAWgC,cAAc,EAAE;AAC3B,SAAO;GAAE,GAAG7B;GAAMH;GAAY;GAEjC;AACD,QAAOK"}
|
|
1
|
+
{"version":3,"file":"serialize.mjs","names":["EntityNode","EntityNodeProperties","GroupNode","InquiryTree","InquiryTreeWire","TreeNode","isGroupNode","validateTree","issueText","toWireString","deepClone","TYPED_PROPERTIES","Record","Exclude","name","displayName","displayDetails","headerName","inquiryTitle","description","sequenceNo","catalogReturnObject","catalogObjectKey","associatedTreeId","associatedTreePrimaryKeyMap","showTags","headerShowTags","loadRecordsOnOpen","lazyLoad","isPrimarySearch","isDraggable","defaultDisplay","joiningEntityName","joiningEntityCatalogObjectKey","joiningEntityCatalogObjectLeftKey","joiningEntityChildKey","joinedWithName","isUsingJointEntityAdditionalProperties","defaultIcon","conditionalNodeIcons","conditionalNodeIconExpression","conditionalNodeAdornments","conditionalNodeAdornmentExpression","conditionalIcons","conditionalIconExpression","hiddenNode","tabs","nodeHeaderPages","pageHeaderConfiguration","searchConfiguration","alerts","actions","appsConfiguration","defaultNodeHeaderExpanded","defaultPageHeaderExpanded","aggregateThresholdId","aggregateThresholdParamMappings","countChips","countChip","groupConfiguration","isActive","childNodes","keys","path","noOfNodesDisplayed","icon","catalogObjectProperty","panels","nodeActions","TYPED_PROPERTY_KEYS","Set","Object","READ_TIME_DERIVED_KEYS","NODE_LEVEL_KEYS","readProperties","raw","props","unknown","key","value","entries","has","length","unknownProperties","writeProperties","rest","out","undefined","readNode","source","unknownNodeKeys","base","id","parentId","parentGroupId","isDeleted","Boolean","group","groupType","properties","entity","writeNode","node","fromWire","wire","treeStructure","inquiryTreeId","wrapper","nodes","map","TreeSerializationError","Error","issues","ReturnType","constructor","tree","filter","issue","severity","join","ToWireOptions","skipValidation","toWire","options","some"],"sources":["../../../src/domain/inquiryTree/serialize.ts"],"sourcesContent":["/**\n * Tolerant reader (wire → typed) and strict writer (typed → wire).\n * The ONLY place in the codebase that reshapes tree data (foundation principle 1).\n *\n * Reader guarantees: no data loss and no reshaping — every value keeps its\n * wire form (icon colours, the root's '' parentId). Unknown keys ride through\n * unknownProperties / unknownNodeKeys and are re-emitted on write. Old trees\n * round-trip byte-safely except what the detailed read stamps on\n * (searchFilterElements, searchTableColumns, associatedInquiryTree): read-time\n * derivations, dropped on read (v2 derives them or reads the linked tree).\n *\n * `toWire` is the READ shape — joins (panels, nodeActions) included, so a\n * working tree renders exactly as a saved one — and the save's body.\n */\nimport {\n EntityNode,\n EntityNodeProperties,\n GroupNode,\n InquiryTree,\n InquiryTreeWire,\n TreeNode,\n isGroupNode\n} from './types';\nimport { validateTree } from './validate';\nimport { issueText } from './names';\nimport { toWireString } from './wireString';\nimport { deepClone } from '../jsonClone';\n\n/**\n * Property keys read into typed fields (everything else → unknownProperties).\n * The annotation holds it to EntityNodeProperties, key for key.\n */\nconst TYPED_PROPERTIES: Record<\n Exclude<keyof EntityNodeProperties, 'unknownProperties'>,\n true\n> = {\n name: true,\n displayName: true,\n displayDetails: true,\n headerName: true,\n inquiryTitle: true,\n description: true,\n sequenceNo: true,\n catalogReturnObject: true,\n catalogObjectKey: true,\n associatedTreeId: true,\n associatedTreePrimaryKeyMap: true,\n showTags: true,\n headerShowTags: true,\n loadRecordsOnOpen: true,\n lazyLoad: true,\n isPrimarySearch: true,\n isDraggable: true,\n defaultDisplay: true,\n joiningEntityName: true,\n joiningEntityCatalogObjectKey: true,\n joiningEntityCatalogObjectLeftKey: true,\n joiningEntityChildKey: true,\n joinedWithName: true,\n isUsingJointEntityAdditionalProperties: true,\n defaultIcon: true,\n conditionalNodeIcons: true,\n conditionalNodeIconExpression: true,\n conditionalNodeAdornments: true,\n conditionalNodeAdornmentExpression: true,\n conditionalIcons: true,\n conditionalIconExpression: true,\n hiddenNode: true,\n tabs: true,\n nodeHeaderPages: true,\n pageHeaderConfiguration: true,\n searchConfiguration: true,\n alerts: true,\n actions: true,\n appsConfiguration: true,\n defaultNodeHeaderExpanded: true,\n defaultPageHeaderExpanded: true,\n aggregateThresholdId: true,\n aggregateThresholdParamMappings: true,\n countChips: true,\n countChip: true,\n groupConfiguration: true,\n isActive: true,\n childNodes: true,\n keys: true,\n path: true,\n noOfNodesDisplayed: true,\n icon: true,\n catalogObjectProperty: true,\n panels: true,\n nodeActions: true\n};\nconst TYPED_PROPERTY_KEYS = new Set(Object.keys(TYPED_PROPERTIES));\n\n/** What the backend stamps on the detailed read — derivations, never data. */\nconst READ_TIME_DERIVED_KEYS = new Set([\n 'searchFilterElements',\n 'searchTableColumns',\n 'associatedInquiryTree'\n]);\n\nconst NODE_LEVEL_KEYS = new Set([\n 'id',\n 'parentId',\n 'parentGroupId',\n 'isDeleted',\n 'isGroupNode',\n 'groupType',\n 'properties'\n]);\n\nconst readProperties = (raw: Record<string, unknown>): EntityNodeProperties => {\n const props: EntityNodeProperties = {};\n const unknown: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(raw)) {\n if (READ_TIME_DERIVED_KEYS.has(key)) continue;\n if (TYPED_PROPERTY_KEYS.has(key)) {\n (props as Record<string, unknown>)[key] = deepClone(value);\n } else {\n unknown[key] = deepClone(value);\n }\n }\n\n if (Object.keys(unknown).length) props.unknownProperties = unknown;\n return props;\n};\n\nconst writeProperties = (\n props: EntityNodeProperties\n): Record<string, unknown> => {\n const { unknownProperties, ...rest } = props;\n const out: Record<string, unknown> = {\n ...deepClone(unknownProperties ?? {})\n };\n for (const [key, value] of Object.entries(rest)) {\n if (value === undefined) continue;\n out[key] = deepClone(value);\n }\n return out;\n};\n\nconst readNode = (raw: unknown): TreeNode => {\n const source = (raw ?? {}) as Record<string, unknown>;\n const unknownNodeKeys: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(source)) {\n if (!NODE_LEVEL_KEYS.has(key)) unknownNodeKeys[key] = deepClone(value);\n }\n\n const base = {\n id: toWireString(source.id),\n parentId: toWireString(source.parentId)\n } as TreeNode;\n if (source.parentGroupId !== undefined)\n base.parentGroupId = source.parentGroupId as string | null;\n if (source.isDeleted !== undefined)\n base.isDeleted = Boolean(source.isDeleted);\n if (Object.keys(unknownNodeKeys).length)\n base.unknownNodeKeys = unknownNodeKeys;\n\n if (source.isGroupNode === true) {\n const group = base as GroupNode;\n group.isGroupNode = true;\n if (source.groupType !== undefined)\n group.groupType = source.groupType as string;\n group.properties = deepClone(\n (source.properties ?? {}) as Record<string, unknown>\n );\n return group;\n }\n const entity = base as EntityNode;\n entity.properties = readProperties(\n (source.properties ?? {}) as Record<string, unknown>\n );\n return entity;\n};\n\nconst writeNode = (node: TreeNode): Record<string, unknown> => {\n const out: Record<string, unknown> = {\n ...deepClone(node.unknownNodeKeys ?? {})\n };\n out.id = node.id;\n out.parentId = node.parentId;\n if (node.parentGroupId !== undefined) out.parentGroupId = node.parentGroupId;\n if (node.isDeleted !== undefined) out.isDeleted = node.isDeleted;\n if (isGroupNode(node)) {\n out.isGroupNode = true;\n if (node.groupType !== undefined) out.groupType = node.groupType;\n out.properties = deepClone(node.properties);\n return out;\n }\n out.properties = writeProperties(node.properties);\n return out;\n};\n\n/**\n * Tolerant reader: GET inquiryTree/{id} → InquiryTree.\n * Accepts every known legacy quirk without data loss; never throws on shape surprises.\n */\nexport const fromWire = (wire: InquiryTreeWire): InquiryTree => {\n const { treeStructure, inquiryTreeId, name, ...wrapper } = wire;\n return {\n inquiryTreeId,\n name,\n nodes: (treeStructure ?? []).map(readNode),\n wrapper: deepClone(wrapper)\n };\n};\n\nexport class TreeSerializationError extends Error {\n issues: ReturnType<typeof validateTree>;\n\n /** `tree` names each issue's level (issueText). */\n constructor(issues: ReturnType<typeof validateTree>, tree?: InquiryTree) {\n super(\n `Refusing to serialize an invalid tree: ${issues\n .filter((issue) => issue.severity === 'error')\n .map((issue) => issueText(tree, issue))\n .join('; ')}`\n );\n this.name = 'TreeSerializationError';\n this.issues = issues;\n }\n}\n\nexport interface ToWireOptions {\n /**\n * Skip the strict-validation gate: a tree handed on as read (the explore\n * page's widgets) or written with only its status changed (archive) must\n * not throw on issues it would not save with.\n */\n skipValidation?: boolean;\n}\n\n/**\n * Strict writer: InquiryTree → the GET shape the save takes back\n * (whole wrapper spread + flat `treeStructure` node array — never stringified).\n * Refuses to serialize a tree with validation errors.\n */\nexport const toWire = (\n tree: InquiryTree,\n options?: ToWireOptions\n): InquiryTreeWire => {\n if (!options?.skipValidation) {\n const issues = validateTree(tree);\n if (issues.some((issue) => issue.severity === 'error')) {\n throw new TreeSerializationError(issues, tree);\n }\n }\n return {\n ...deepClone(tree.wrapper),\n inquiryTreeId: tree.inquiryTreeId,\n ...(tree.name !== undefined ? { name: tree.name } : {}),\n treeStructure: tree.nodes.map(writeNode)\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4FA,MAAMqE,sBAAsB,IAAIC,IAAIC,OAAOT,KAzDvC;CACFhD,MAAM;CACNC,aAAa;CACbC,gBAAgB;CAChBC,YAAY;CACZC,cAAc;CACdC,aAAa;CACbC,YAAY;CACZC,qBAAqB;CACrBC,kBAAkB;CAClBC,kBAAkB;CAClBC,6BAA6B;CAC7BC,UAAU;CACVC,gBAAgB;CAChBC,mBAAmB;CACnBC,UAAU;CACVC,iBAAiB;CACjBC,aAAa;CACbC,gBAAgB;CAChBC,mBAAmB;CACnBC,+BAA+B;CAC/BC,mCAAmC;CACnCC,uBAAuB;CACvBC,gBAAgB;CAChBC,wCAAwC;CACxCC,aAAa;CACbC,sBAAsB;CACtBC,+BAA+B;CAC/BC,2BAA2B;CAC3BC,oCAAoC;CACpCC,kBAAkB;CAClBC,2BAA2B;CAC3BC,YAAY;CACZC,MAAM;CACNC,iBAAiB;CACjBC,yBAAyB;CACzBC,qBAAqB;CACrBC,QAAQ;CACRC,SAAS;CACTC,mBAAmB;CACnBC,2BAA2B;CAC3BC,2BAA2B;CAC3BC,sBAAsB;CACtBC,iCAAiC;CACjCC,YAAY;CACZC,WAAW;CACXC,oBAAoB;CACpBC,UAAU;CACVC,YAAY;CACZC,MAAM;CACNC,MAAM;CACNC,oBAAoB;CACpBC,MAAM;CACN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