@riboseinc/paneron-registry-kit 2.2.58 → 2.2.60
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/LICENSE +21 -0
- package/README.adoc +67 -0
- package/compiled/common.js +2 -0
- package/compiled/index.js +42 -0
- package/compiled/item-classes/Tree.js +61 -0
- package/compiled/item-classes/treeNodes.js +56 -0
- package/compiled/migrations/initial.js +28 -0
- package/compiled/proposals/ChangeRequestContext.js +121 -0
- package/compiled/proposals/HistoryDrawer.js +55 -0
- package/compiled/proposals/ListItem.js +22 -0
- package/compiled/proposals/MetaProperties.js +98 -0
- package/compiled/proposals/NewProposalMenu.js +53 -0
- package/compiled/proposals/ProposalBrowser.js +141 -0
- package/compiled/proposals/ProposalDetail.js +27 -0
- package/compiled/proposals/ProposalItem.js +24 -0
- package/compiled/proposals/ProposalSummary.js +28 -0
- package/compiled/proposals/ProposalTab.js +89 -0
- package/compiled/proposals/ProposalType.js +62 -0
- package/compiled/proposals/ProposalWorkspace.js +70 -0
- package/compiled/proposals/Search.js +106 -0
- package/compiled/proposals/TransitionHistory.js +271 -0
- package/compiled/proposals/TransitionOptions.js +432 -0
- package/compiled/proposals/actionableGroups/Tree.js +170 -0
- package/compiled/proposals/actionableGroups/queries.js +78 -0
- package/compiled/proposals/actionableGroups/treeNodes.js +90 -0
- package/compiled/proposals/actionableGroups/types.js +2 -0
- package/compiled/proposals/index.js +7 -0
- package/compiled/proposals/objectChangeset.js +331 -0
- package/compiled/proposals/queries.js +5 -0
- package/compiled/proposals/types.js +229 -0
- package/compiled/types/index.js +7 -0
- package/compiled/types/item.js +28 -0
- package/compiled/types/register.js +25 -0
- package/compiled/types/registry.js +10 -0
- package/compiled/types/stakeholder.js +81 -0
- package/compiled/types/util.js +3 -0
- package/compiled/types/views.js +2 -0
- package/compiled/views/AnnotatedChange.js +62 -0
- package/compiled/views/BrowserCtx.js +20 -0
- package/compiled/views/FilterCriteria/CRITERIA_CONFIGURATION.js +121 -0
- package/compiled/views/FilterCriteria/criteriaGroupToQueryExpression.js +45 -0
- package/compiled/views/FilterCriteria/criteriaGroupToSummary.js +47 -0
- package/compiled/views/FilterCriteria/criteriaToNodes.js +92 -0
- package/compiled/views/FilterCriteria/index.js +75 -0
- package/compiled/views/FilterCriteria/models.js +45 -0
- package/compiled/views/FilterCriteria/mutateGroup.js +74 -0
- package/compiled/views/GenericRelatedItemView.js +179 -0
- package/compiled/views/ItemDetailsDrawer.js +21 -0
- package/compiled/views/ItemSearchDrawer.js +29 -0
- package/compiled/views/Party.js +156 -0
- package/compiled/views/RegisterStakeholder.js +22 -0
- package/compiled/views/RegisterVersion.js +20 -0
- package/compiled/views/SearchQuery.js +90 -0
- package/compiled/views/StatefulTree.js +95 -0
- package/compiled/views/detail/AllItems.js +31 -0
- package/compiled/views/detail/ChangeRequest/index.js +49 -0
- package/compiled/views/detail/CustomView/index.js +34 -0
- package/compiled/views/detail/ProposalWork.js +167 -0
- package/compiled/views/detail/RegisterHome/ActiveProposalDetails.js +64 -0
- package/compiled/views/detail/RegisterHome/Block.js +39 -0
- package/compiled/views/detail/RegisterHome/MetaSummary.js +27 -0
- package/compiled/views/detail/RegisterHome/Proposal.js +105 -0
- package/compiled/views/detail/RegisterHome/index.js +381 -0
- package/compiled/views/detail/RegisterHome2/index.js +36 -0
- package/compiled/views/detail/RegisterItem/RelatedItems.js +28 -0
- package/compiled/views/detail/RegisterItem/SupersedingItemMenu.js +27 -0
- package/compiled/views/detail/RegisterItem/index.js +576 -0
- package/compiled/views/detail/RegisterItem/index.js.map +1 -0
- package/compiled/views/detail/RegisterItemClass.js +59 -0
- package/compiled/views/detail/RegisterMeta/RegisterMetaForm.js +176 -0
- package/compiled/views/detail/RegisterMeta/index.js +73 -0
- package/compiled/views/detail/index.js +12 -0
- package/compiled/views/diffing/InlineDiff.js +117 -0
- package/compiled/views/diffing/StructuredDiff.js +38 -0
- package/compiled/views/hooks/useCustomView.js +14 -0
- package/compiled/views/hooks/useItemClassConfig.js +8 -0
- package/compiled/views/hooks/useItemRef.js +27 -0
- package/compiled/views/hooks/useLatestAcceptedProposal.js +39 -0
- package/compiled/views/hooks/useRegisterVersion.js +35 -0
- package/compiled/views/hooks/useSingleRegisterItemData.js +22 -0
- package/compiled/views/hooks/useStakeholder.js +2 -0
- package/compiled/views/index.js +247 -0
- package/compiled/views/itemPathUtils.js +139 -0
- package/compiled/views/itemQueryUtils.js +49 -0
- package/compiled/views/protocolRegistry.js +30 -0
- package/compiled/views/sidebar/Browse/index.js +291 -0
- package/compiled/views/sidebar/ExportImport/ExportOptions.js +56 -0
- package/compiled/views/sidebar/ExportImport/ImportOptions.js +9 -0
- package/compiled/views/sidebar/ExportImport/index.js +4 -0
- package/compiled/views/sidebar/ListItem.js +31 -0
- package/compiled/views/sidebar/Registration/index.js +89 -0
- package/compiled/views/sidebar/Search/index.js +129 -0
- package/{views → compiled/views}/sidebar/Search/index.js.map +1 -1
- package/compiled/views/sidebar/index.js +115 -0
- package/compiled/views/util.js +278 -0
- package/compiled/views/util.js.map +1 -0
- package/dependencies-local/extension-kit/SettingsContext.d.ts +8 -0
- package/dependencies-local/extension-kit/SettingsContext.js +19 -0
- package/dependencies-local/extension-kit/SettingsContext.js.map +1 -0
- package/dependencies-local/extension-kit/build_site.d.ts +1 -0
- package/dependencies-local/extension-kit/build_site.js +4 -0
- package/dependencies-local/extension-kit/build_site.js.map +1 -0
- package/dependencies-local/extension-kit/context.d.ts +18 -0
- package/dependencies-local/extension-kit/context.js +143 -0
- package/dependencies-local/extension-kit/context.js.map +1 -0
- package/dependencies-local/extension-kit/i18n/ContextProvider.d.ts +9 -0
- package/dependencies-local/extension-kit/i18n/ContextProvider.js +33 -0
- package/dependencies-local/extension-kit/i18n/ContextProvider.js.map +1 -0
- package/dependencies-local/extension-kit/i18n/context.d.ts +9 -0
- package/dependencies-local/extension-kit/i18n/context.js +23 -0
- package/dependencies-local/extension-kit/i18n/context.js.map +1 -0
- package/dependencies-local/extension-kit/i18n/types.d.ts +10 -0
- package/dependencies-local/extension-kit/i18n/types.js.map +1 -0
- package/dependencies-local/extension-kit/i18n/widgets.d.ts +16 -0
- package/dependencies-local/extension-kit/i18n/widgets.js +59 -0
- package/dependencies-local/extension-kit/i18n/widgets.js.map +1 -0
- package/dependencies-local/extension-kit/index.d.ts +16 -0
- package/dependencies-local/extension-kit/index.js +149 -0
- package/dependencies-local/extension-kit/index.js.map +1 -0
- package/dependencies-local/extension-kit/object-specs/index.d.ts +2 -0
- package/dependencies-local/extension-kit/object-specs/index.js +22 -0
- package/dependencies-local/extension-kit/object-specs/index.js.map +1 -0
- package/dependencies-local/extension-kit/object-specs/paneron-object.d.ts +7 -0
- package/dependencies-local/extension-kit/object-specs/paneron-object.js +159 -0
- package/dependencies-local/extension-kit/object-specs/paneron-object.js.map +1 -0
- package/dependencies-local/extension-kit/object-specs/ser-des.d.ts +32 -0
- package/dependencies-local/extension-kit/object-specs/ser-des.js +232 -0
- package/dependencies-local/extension-kit/object-specs/ser-des.js.map +1 -0
- package/dependencies-local/extension-kit/object-specs/yaml/custom-bool.d.ts +3 -0
- package/dependencies-local/extension-kit/object-specs/yaml/custom-bool.js +42 -0
- package/dependencies-local/extension-kit/object-specs/yaml/custom-bool.js.map +1 -0
- package/dependencies-local/extension-kit/object-specs/yaml/custom-timestamp.d.ts +3 -0
- package/dependencies-local/extension-kit/object-specs/yaml/custom-timestamp.js +110 -0
- package/dependencies-local/extension-kit/object-specs/yaml/custom-timestamp.js.map +1 -0
- package/dependencies-local/extension-kit/object-specs/yaml/index.d.ts +9 -0
- package/dependencies-local/extension-kit/object-specs/yaml/index.js +36 -0
- package/dependencies-local/extension-kit/object-specs/yaml/index.js.map +1 -0
- package/dependencies-local/extension-kit/object-specs/yaml/schema.d.ts +4 -0
- package/dependencies-local/extension-kit/object-specs/yaml/schema.js +26 -0
- package/dependencies-local/extension-kit/object-specs/yaml/schema.js.map +1 -0
- package/dependencies-local/extension-kit/settings.d.ts +9 -0
- package/dependencies-local/extension-kit/settings.js +17 -0
- package/dependencies-local/extension-kit/settings.js.map +1 -0
- package/dependencies-local/extension-kit/types/binary-invocation.d.ts +31 -0
- package/dependencies-local/extension-kit/types/binary-invocation.js.map +1 -0
- package/dependencies-local/extension-kit/types/buffers.d.ts +19 -0
- package/dependencies-local/extension-kit/types/buffers.js.map +1 -0
- package/dependencies-local/extension-kit/types/changes.d.ts +37 -0
- package/dependencies-local/extension-kit/types/changes.js +5 -0
- package/dependencies-local/extension-kit/types/changes.js.map +1 -0
- package/dependencies-local/extension-kit/types/data.d.ts +54 -0
- package/dependencies-local/extension-kit/types/data.js +5 -0
- package/dependencies-local/extension-kit/types/data.js.map +1 -0
- package/dependencies-local/extension-kit/types/dialogs.d.ts +21 -0
- package/dependencies-local/extension-kit/types/dialogs.js +5 -0
- package/dependencies-local/extension-kit/types/dialogs.js.map +1 -0
- package/dependencies-local/extension-kit/types/export-formats.d.ts +23 -0
- package/dependencies-local/extension-kit/types/export-formats.js +5 -0
- package/dependencies-local/extension-kit/types/export-formats.js.map +1 -0
- package/dependencies-local/extension-kit/types/extension-maker.d.ts +17 -0
- package/dependencies-local/extension-kit/types/extension-maker.js +5 -0
- package/dependencies-local/extension-kit/types/extension-maker.js.map +1 -0
- package/dependencies-local/extension-kit/types/extension.d.ts +40 -0
- package/dependencies-local/extension-kit/types/extension.js +5 -0
- package/dependencies-local/extension-kit/types/extension.js.map +1 -0
- package/dependencies-local/extension-kit/types/index.d.ts +3 -0
- package/dependencies-local/extension-kit/types/index.js +41 -0
- package/dependencies-local/extension-kit/types/index.js.map +1 -0
- package/dependencies-local/extension-kit/types/indexes.d.ts +6 -0
- package/dependencies-local/extension-kit/types/indexes.js +15 -0
- package/dependencies-local/extension-kit/types/indexes.js.map +1 -0
- package/dependencies-local/extension-kit/types/migrations.d.ts +35 -0
- package/dependencies-local/extension-kit/types/migrations.js +5 -0
- package/dependencies-local/extension-kit/types/migrations.js.map +1 -0
- package/dependencies-local/extension-kit/types/object-spec.d.ts +109 -0
- package/dependencies-local/extension-kit/types/object-spec.js +24 -0
- package/dependencies-local/extension-kit/types/object-spec.js.map +1 -0
- package/dependencies-local/extension-kit/types/objects.d.ts +18 -0
- package/dependencies-local/extension-kit/types/objects.js +5 -0
- package/dependencies-local/extension-kit/types/objects.js.map +1 -0
- package/dependencies-local/extension-kit/types/progress.d.ts +5 -0
- package/dependencies-local/extension-kit/types/progress.js +5 -0
- package/dependencies-local/extension-kit/types/progress.js.map +1 -0
- package/dependencies-local/extension-kit/types/renderer.d.ts +505 -0
- package/dependencies-local/extension-kit/types/renderer.js +16 -0
- package/dependencies-local/extension-kit/types/renderer.js.map +1 -0
- package/dependencies-local/extension-kit/useDebounce.d.ts +5 -0
- package/dependencies-local/extension-kit/useDebounce.js +25 -0
- package/dependencies-local/extension-kit/useDebounce.js.map +1 -0
- package/dependencies-local/extension-kit/usePersistentStateReducer.d.ts +39 -0
- package/dependencies-local/extension-kit/usePersistentStateReducer.js +133 -0
- package/dependencies-local/extension-kit/usePersistentStateReducer.js.map +1 -0
- package/dependencies-local/extension-kit/useTimeTravelingPersistentStateReducer.d.ts +71 -0
- package/dependencies-local/extension-kit/useTimeTravelingPersistentStateReducer.js +107 -0
- package/dependencies-local/extension-kit/useTimeTravelingPersistentStateReducer.js.map +1 -0
- package/dependencies-local/extension-kit/util.d.ts +37 -0
- package/dependencies-local/extension-kit/util.js +179 -0
- package/dependencies-local/extension-kit/util.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/DL.d.ts +44 -0
- package/dependencies-local/extension-kit/widgets/DL.js +89 -0
- package/dependencies-local/extension-kit/widgets/DL.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/ErrorBoundary.d.ts +17 -0
- package/dependencies-local/extension-kit/widgets/ErrorBoundary.js +49 -0
- package/dependencies-local/extension-kit/widgets/ErrorBoundary.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/ErrorState.d.ts +10 -0
- package/dependencies-local/extension-kit/widgets/ErrorState.js +54 -0
- package/dependencies-local/extension-kit/widgets/ErrorState.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/Grid.d.ts +41 -0
- package/dependencies-local/extension-kit/widgets/Grid.js +213 -0
- package/dependencies-local/extension-kit/widgets/Grid.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/HelpTooltip.d.ts +18 -0
- package/dependencies-local/extension-kit/widgets/HelpTooltip.js +72 -0
- package/dependencies-local/extension-kit/widgets/HelpTooltip.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/ItemCount.d.ts +19 -0
- package/dependencies-local/extension-kit/widgets/ItemCount.js +79 -0
- package/dependencies-local/extension-kit/widgets/ItemCount.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/List.d.ts +41 -0
- package/dependencies-local/extension-kit/widgets/List.js +210 -0
- package/dependencies-local/extension-kit/widgets/List.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/Navbar.d.ts +20 -0
- package/dependencies-local/extension-kit/widgets/Navbar.js +76 -0
- package/dependencies-local/extension-kit/widgets/Navbar.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/Navbar2.d.ts +17 -0
- package/dependencies-local/extension-kit/widgets/Navbar2.js +95 -0
- package/dependencies-local/extension-kit/widgets/Navbar2.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/OperationQueue/context.d.ts +17 -0
- package/dependencies-local/extension-kit/widgets/OperationQueue/context.js +21 -0
- package/dependencies-local/extension-kit/widgets/OperationQueue/context.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/OperationQueue/index.d.ts +8 -0
- package/dependencies-local/extension-kit/widgets/OperationQueue/index.js +159 -0
- package/dependencies-local/extension-kit/widgets/OperationQueue/index.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/OperationQueue/types.d.ts +19 -0
- package/dependencies-local/extension-kit/widgets/OperationQueue/types.js +5 -0
- package/dependencies-local/extension-kit/widgets/OperationQueue/types.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/SearchResultList.d.ts +31 -0
- package/dependencies-local/extension-kit/widgets/SearchResultList.js +203 -0
- package/dependencies-local/extension-kit/widgets/SearchResultList.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/Block.d.ts +24 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/Block.js +109 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/Block.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/BlockStateButtonGroup.d.ts +6 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/BlockStateButtonGroup.js +23 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/BlockStateButtonGroup.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/PropertyView.d.ts +29 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/PropertyView.js +157 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/PropertyView.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/index.d.ts +27 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/index.js +197 -0
- package/dependencies-local/extension-kit/widgets/Sidebar/index.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/SuperSidebar.d.ts +29 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/SuperSidebar.js +135 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/SuperSidebar.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/context.d.ts +10 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/context.js +205 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/context.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/detail.d.ts +9 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/detail.js +69 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/detail.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/index.d.ts +54 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/index.js +301 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/index.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/types.d.ts +102 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/types.js +5 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/types.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/util.d.ts +1 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/util.js +14 -0
- package/dependencies-local/extension-kit/widgets/TabbedWorkspace/util.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/Workspace.d.ts +40 -0
- package/dependencies-local/extension-kit/widgets/Workspace.js +96 -0
- package/dependencies-local/extension-kit/widgets/Workspace.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/panels/PanelSeparator.d.ts +12 -0
- package/dependencies-local/extension-kit/widgets/panels/PanelSeparator.js +60 -0
- package/dependencies-local/extension-kit/widgets/panels/PanelSeparator.js.map +1 -0
- package/dependencies-local/extension-kit/widgets/panels/index.d.ts +28 -0
- package/dependencies-local/extension-kit/widgets/panels/index.js +169 -0
- package/dependencies-local/extension-kit/widgets/panels/index.js.map +1 -0
- package/dist/common.d.ts +1 -0
- package/dist/common.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js.map +1 -0
- package/dist/item-classes/Tree.d.ts +5 -0
- package/dist/item-classes/Tree.js.map +1 -0
- package/dist/item-classes/treeNodes.d.ts +12 -0
- package/dist/item-classes/treeNodes.js.map +1 -0
- package/dist/migrations/initial.d.ts +3 -0
- package/dist/migrations/initial.js.map +1 -0
- package/dist/proposals/ChangeRequestContext.d.ts +44 -0
- package/dist/proposals/ChangeRequestContext.js.map +1 -0
- package/dist/proposals/HistoryDrawer.d.ts +12 -0
- package/dist/proposals/HistoryDrawer.js.map +1 -0
- package/dist/proposals/ListItem.d.ts +9 -0
- package/dist/proposals/ListItem.js.map +1 -0
- package/dist/proposals/MetaProperties.d.ts +14 -0
- package/dist/proposals/MetaProperties.js.map +1 -0
- package/dist/proposals/NewProposalMenu.d.ts +10 -0
- package/dist/proposals/NewProposalMenu.js.map +1 -0
- package/dist/proposals/ProposalBrowser.d.ts +29 -0
- package/dist/proposals/ProposalBrowser.js.map +1 -0
- package/dist/proposals/ProposalDetail.d.ts +6 -0
- package/dist/proposals/ProposalDetail.js.map +1 -0
- package/dist/proposals/ProposalItem.d.ts +16 -0
- package/dist/proposals/ProposalItem.js.map +1 -0
- package/dist/proposals/ProposalSummary.d.ts +6 -0
- package/dist/proposals/ProposalSummary.js.map +1 -0
- package/dist/proposals/ProposalTab.d.ts +14 -0
- package/dist/proposals/ProposalTab.js.map +1 -0
- package/dist/proposals/ProposalType.d.ts +11 -0
- package/dist/proposals/ProposalType.js.map +1 -0
- package/dist/proposals/ProposalWorkspace.d.ts +15 -0
- package/dist/proposals/ProposalWorkspace.js.map +1 -0
- package/dist/proposals/Search.d.ts +26 -0
- package/dist/proposals/Search.js.map +1 -0
- package/dist/proposals/TransitionHistory.d.ts +31 -0
- package/dist/proposals/TransitionHistory.js.map +1 -0
- package/dist/proposals/TransitionOptions.d.ts +38 -0
- package/dist/proposals/TransitionOptions.js.map +1 -0
- package/dist/proposals/actionableGroups/Tree.d.ts +7 -0
- package/dist/proposals/actionableGroups/Tree.js.map +1 -0
- package/dist/proposals/actionableGroups/queries.d.ts +4 -0
- package/dist/proposals/actionableGroups/queries.js.map +1 -0
- package/dist/proposals/actionableGroups/treeNodes.d.ts +27 -0
- package/dist/proposals/actionableGroups/treeNodes.js.map +1 -0
- package/dist/proposals/actionableGroups/types.d.ts +6 -0
- package/dist/proposals/actionableGroups/types.js +5 -0
- package/dist/proposals/actionableGroups/types.js.map +1 -0
- package/dist/proposals/index.d.ts +6 -0
- package/dist/proposals/index.js.map +1 -0
- package/dist/proposals/objectChangeset.d.ts +72 -0
- package/dist/proposals/objectChangeset.js.map +1 -0
- package/dist/proposals/queries.d.ts +4 -0
- package/dist/proposals/queries.js.map +1 -0
- package/dist/proposals/types.d.ts +332 -0
- package/dist/proposals/types.js.map +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/item.d.ts +55 -0
- package/dist/types/item.js.map +1 -0
- package/dist/types/register.d.ts +21 -0
- package/dist/types/register.js.map +1 -0
- package/dist/types/registry.d.ts +15 -0
- package/dist/types/registry.js.map +1 -0
- package/dist/types/stakeholder.d.ts +43 -0
- package/dist/types/stakeholder.js.map +1 -0
- package/dist/types/util.d.ts +28 -0
- package/dist/types/util.js +5 -0
- package/dist/types/util.js.map +1 -0
- package/dist/types/views.d.ts +228 -0
- package/dist/types/views.js +5 -0
- package/dist/types/views.js.map +1 -0
- package/dist/views/AnnotatedChange.d.ts +7 -0
- package/dist/views/AnnotatedChange.js.map +1 -0
- package/dist/views/BrowserCtx.d.ts +69 -0
- package/dist/views/BrowserCtx.js.map +1 -0
- package/dist/views/FilterCriteria/CRITERIA_CONFIGURATION.d.ts +17 -0
- package/dist/views/FilterCriteria/CRITERIA_CONFIGURATION.js.map +1 -0
- package/dist/views/FilterCriteria/criteriaGroupToQueryExpression.d.ts +6 -0
- package/dist/views/FilterCriteria/criteriaGroupToQueryExpression.js.map +1 -0
- package/dist/views/FilterCriteria/criteriaGroupToSummary.d.ts +5 -0
- package/dist/views/FilterCriteria/criteriaGroupToSummary.js.map +1 -0
- package/dist/views/FilterCriteria/criteriaToNodes.d.ts +24 -0
- package/dist/views/FilterCriteria/criteriaToNodes.js.map +1 -0
- package/dist/views/FilterCriteria/index.d.ts +23 -0
- package/dist/views/FilterCriteria/index.js.map +1 -0
- package/dist/views/FilterCriteria/models.d.ts +70 -0
- package/dist/views/FilterCriteria/models.js.map +1 -0
- package/dist/views/FilterCriteria/mutateGroup.d.ts +24 -0
- package/dist/views/FilterCriteria/mutateGroup.js.map +1 -0
- package/dist/views/GenericRelatedItemView.d.ts +9 -0
- package/dist/views/GenericRelatedItemView.js.map +1 -0
- package/dist/views/ItemDetailsDrawer.d.ts +12 -0
- package/dist/views/ItemDetailsDrawer.js.map +1 -0
- package/dist/views/ItemSearchDrawer.d.ts +11 -0
- package/dist/views/ItemSearchDrawer.js.map +1 -0
- package/dist/views/Party.d.ts +0 -0
- package/dist/views/Party.js.map +1 -0
- package/dist/views/RegisterStakeholder.d.ts +12 -0
- package/dist/views/RegisterStakeholder.js.map +1 -0
- package/dist/views/RegisterVersion.d.ts +9 -0
- package/dist/views/RegisterVersion.js.map +1 -0
- package/dist/views/SearchQuery.d.ts +19 -0
- package/dist/views/SearchQuery.js.map +1 -0
- package/dist/views/StatefulTree.d.ts +28 -0
- package/dist/views/StatefulTree.js.map +1 -0
- package/dist/views/detail/AllItems.d.ts +8 -0
- package/dist/views/detail/AllItems.js.map +1 -0
- package/dist/views/detail/ChangeRequest/index.d.ts +12 -0
- package/dist/views/detail/ChangeRequest/index.js.map +1 -0
- package/dist/views/detail/CustomView/index.d.ts +13 -0
- package/dist/views/detail/CustomView/index.js.map +1 -0
- package/dist/views/detail/ProposalWork.d.ts +8 -0
- package/dist/views/detail/ProposalWork.js.map +1 -0
- package/dist/views/detail/RegisterHome/ActiveProposalDetails.d.ts +15 -0
- package/dist/views/detail/RegisterHome/ActiveProposalDetails.js.map +1 -0
- package/dist/views/detail/RegisterHome/Block.d.ts +29 -0
- package/dist/views/detail/RegisterHome/Block.js.map +1 -0
- package/dist/views/detail/RegisterHome/MetaSummary.d.ts +9 -0
- package/dist/views/detail/RegisterHome/MetaSummary.js.map +1 -0
- package/dist/views/detail/RegisterHome/Proposal.d.ts +14 -0
- package/dist/views/detail/RegisterHome/Proposal.js.map +1 -0
- package/dist/views/detail/RegisterHome/index.d.ts +5 -0
- package/dist/views/detail/RegisterHome/index.js.map +1 -0
- package/dist/views/detail/RegisterHome2/index.d.ts +5 -0
- package/dist/views/detail/RegisterHome2/index.js.map +1 -0
- package/dist/views/detail/RegisterItem/RelatedItems.d.ts +14 -0
- package/dist/views/detail/RegisterItem/RelatedItems.js.map +1 -0
- package/dist/views/detail/RegisterItem/SupersedingItemMenu.d.ts +13 -0
- package/dist/views/detail/RegisterItem/SupersedingItemMenu.js.map +1 -0
- package/dist/views/detail/RegisterItem/index.d.ts +21 -0
- package/{views → dist/views}/detail/RegisterItem/index.js +1 -1
- package/dist/views/detail/RegisterItem/index.js.map +1 -0
- package/dist/views/detail/RegisterItemClass.d.ts +12 -0
- package/dist/views/detail/RegisterItemClass.js.map +1 -0
- package/dist/views/detail/RegisterMeta/RegisterMetaForm.d.ts +10 -0
- package/dist/views/detail/RegisterMeta/RegisterMetaForm.js.map +1 -0
- package/dist/views/detail/RegisterMeta/index.d.ts +10 -0
- package/dist/views/detail/RegisterMeta/index.js.map +1 -0
- package/dist/views/detail/index.d.ts +1 -0
- package/dist/views/detail/index.js.map +1 -0
- package/dist/views/diffing/InlineDiff.d.ts +38 -0
- package/dist/views/diffing/InlineDiff.js.map +1 -0
- package/dist/views/diffing/StructuredDiff.d.ts +11 -0
- package/dist/views/diffing/StructuredDiff.js.map +1 -0
- package/dist/views/hooks/useCustomView.d.ts +3 -0
- package/dist/views/hooks/useCustomView.js.map +1 -0
- package/dist/views/hooks/useItemClassConfig.d.ts +2 -0
- package/dist/views/hooks/useItemClassConfig.js.map +1 -0
- package/dist/views/hooks/useItemRef.d.ts +3 -0
- package/dist/views/hooks/useItemRef.js.map +1 -0
- package/dist/views/hooks/useLatestAcceptedProposal.d.ts +2 -0
- package/dist/views/hooks/useLatestAcceptedProposal.js.map +1 -0
- package/dist/views/hooks/useRegisterVersion.d.ts +5 -0
- package/dist/views/hooks/useRegisterVersion.js.map +1 -0
- package/dist/views/hooks/useSingleRegisterItemData.d.ts +3 -0
- package/dist/views/hooks/useSingleRegisterItemData.js.map +1 -0
- package/dist/views/hooks/useStakeholder.d.ts +0 -0
- package/dist/views/hooks/useStakeholder.js.map +1 -0
- package/dist/views/index.d.ts +8 -0
- package/dist/views/index.js.map +1 -0
- package/dist/views/itemPathUtils.d.ts +47 -0
- package/dist/views/itemPathUtils.js.map +1 -0
- package/dist/views/itemQueryUtils.d.ts +12 -0
- package/dist/views/itemQueryUtils.js.map +1 -0
- package/dist/views/protocolRegistry.d.ts +14 -0
- package/dist/views/protocolRegistry.js.map +1 -0
- package/dist/views/sidebar/Browse/index.d.ts +11 -0
- package/dist/views/sidebar/Browse/index.js.map +1 -0
- package/dist/views/sidebar/ExportImport/ExportOptions.d.ts +5 -0
- package/dist/views/sidebar/ExportImport/ExportOptions.js.map +1 -0
- package/dist/views/sidebar/ExportImport/ImportOptions.d.ts +4 -0
- package/dist/views/sidebar/ExportImport/ImportOptions.js.map +1 -0
- package/dist/views/sidebar/ExportImport/index.d.ts +3 -0
- package/dist/views/sidebar/ExportImport/index.js.map +1 -0
- package/dist/views/sidebar/ListItem.d.ts +10 -0
- package/dist/views/sidebar/ListItem.js.map +1 -0
- package/dist/views/sidebar/Registration/index.d.ts +9 -0
- package/dist/views/sidebar/Registration/index.js.map +1 -0
- package/dist/views/sidebar/Search/index.d.ts +29 -0
- package/{views → dist/views}/sidebar/Search/index.js +1 -1
- package/dist/views/sidebar/Search/index.js.map +1 -0
- package/dist/views/sidebar/index.d.ts +7 -0
- package/dist/views/sidebar/index.js.map +1 -0
- package/dist/views/util.d.ts +98 -0
- package/{views → dist/views}/util.js +33 -7
- package/dist/views/util.js.map +1 -0
- package/package.json +1 -1
- package/react-visual-diff.d.ts +9 -0
- package/views/detail/RegisterItem/index.js.map +0 -1
- package/views/util.js.map +0 -1
- /package/{common.d.ts → compiled/common.d.ts} +0 -0
- /package/{common.js.map → compiled/common.js.map} +0 -0
- /package/{index.d.ts → compiled/index.d.ts} +0 -0
- /package/{index.js.map → compiled/index.js.map} +0 -0
- /package/{item-classes → compiled/item-classes}/Tree.d.ts +0 -0
- /package/{item-classes → compiled/item-classes}/Tree.js.map +0 -0
- /package/{item-classes → compiled/item-classes}/treeNodes.d.ts +0 -0
- /package/{item-classes → compiled/item-classes}/treeNodes.js.map +0 -0
- /package/{migrations → compiled/migrations}/initial.d.ts +0 -0
- /package/{migrations → compiled/migrations}/initial.js.map +0 -0
- /package/{proposals → compiled/proposals}/ChangeRequestContext.d.ts +0 -0
- /package/{proposals → compiled/proposals}/ChangeRequestContext.js.map +0 -0
- /package/{proposals → compiled/proposals}/HistoryDrawer.d.ts +0 -0
- /package/{proposals → compiled/proposals}/HistoryDrawer.js.map +0 -0
- /package/{proposals → compiled/proposals}/ListItem.d.ts +0 -0
- /package/{proposals → compiled/proposals}/ListItem.js.map +0 -0
- /package/{proposals → compiled/proposals}/MetaProperties.d.ts +0 -0
- /package/{proposals → compiled/proposals}/MetaProperties.js.map +0 -0
- /package/{proposals → compiled/proposals}/NewProposalMenu.d.ts +0 -0
- /package/{proposals → compiled/proposals}/NewProposalMenu.js.map +0 -0
- /package/{proposals → compiled/proposals}/ProposalBrowser.d.ts +0 -0
- /package/{proposals → compiled/proposals}/ProposalBrowser.js.map +0 -0
- /package/{proposals → compiled/proposals}/ProposalDetail.d.ts +0 -0
- /package/{proposals → compiled/proposals}/ProposalDetail.js.map +0 -0
- /package/{proposals → compiled/proposals}/ProposalItem.d.ts +0 -0
- /package/{proposals → compiled/proposals}/ProposalItem.js.map +0 -0
- /package/{proposals → compiled/proposals}/ProposalSummary.d.ts +0 -0
- /package/{proposals → compiled/proposals}/ProposalSummary.js.map +0 -0
- /package/{proposals → compiled/proposals}/ProposalTab.d.ts +0 -0
- /package/{proposals → compiled/proposals}/ProposalTab.js.map +0 -0
- /package/{proposals → compiled/proposals}/ProposalType.d.ts +0 -0
- /package/{proposals → compiled/proposals}/ProposalType.js.map +0 -0
- /package/{proposals → compiled/proposals}/ProposalWorkspace.d.ts +0 -0
- /package/{proposals → compiled/proposals}/ProposalWorkspace.js.map +0 -0
- /package/{proposals → compiled/proposals}/Search.d.ts +0 -0
- /package/{proposals → compiled/proposals}/Search.js.map +0 -0
- /package/{proposals → compiled/proposals}/TransitionHistory.d.ts +0 -0
- /package/{proposals → compiled/proposals}/TransitionHistory.js.map +0 -0
- /package/{proposals → compiled/proposals}/TransitionOptions.d.ts +0 -0
- /package/{proposals → compiled/proposals}/TransitionOptions.js.map +0 -0
- /package/{proposals → compiled/proposals}/actionableGroups/Tree.d.ts +0 -0
- /package/{proposals → compiled/proposals}/actionableGroups/Tree.js.map +0 -0
- /package/{proposals → compiled/proposals}/actionableGroups/queries.d.ts +0 -0
- /package/{proposals → compiled/proposals}/actionableGroups/queries.js.map +0 -0
- /package/{proposals → compiled/proposals}/actionableGroups/treeNodes.d.ts +0 -0
- /package/{proposals → compiled/proposals}/actionableGroups/treeNodes.js.map +0 -0
- /package/{proposals → compiled/proposals}/actionableGroups/types.d.ts +0 -0
- /package/{proposals → compiled/proposals}/actionableGroups/types.js.map +0 -0
- /package/{proposals → compiled/proposals}/index.d.ts +0 -0
- /package/{proposals → compiled/proposals}/index.js.map +0 -0
- /package/{proposals → compiled/proposals}/objectChangeset.d.ts +0 -0
- /package/{proposals → compiled/proposals}/objectChangeset.js.map +0 -0
- /package/{proposals → compiled/proposals}/queries.d.ts +0 -0
- /package/{proposals → compiled/proposals}/queries.js.map +0 -0
- /package/{proposals → compiled/proposals}/types.d.ts +0 -0
- /package/{proposals → compiled/proposals}/types.js.map +0 -0
- /package/{types → compiled/types}/index.d.ts +0 -0
- /package/{types → compiled/types}/index.js.map +0 -0
- /package/{types → compiled/types}/item.d.ts +0 -0
- /package/{types → compiled/types}/item.js.map +0 -0
- /package/{types → compiled/types}/register.d.ts +0 -0
- /package/{types → compiled/types}/register.js.map +0 -0
- /package/{types → compiled/types}/registry.d.ts +0 -0
- /package/{types → compiled/types}/registry.js.map +0 -0
- /package/{types → compiled/types}/stakeholder.d.ts +0 -0
- /package/{types → compiled/types}/stakeholder.js.map +0 -0
- /package/{types → compiled/types}/util.d.ts +0 -0
- /package/{types → compiled/types}/util.js.map +0 -0
- /package/{types → compiled/types}/views.d.ts +0 -0
- /package/{types → compiled/types}/views.js.map +0 -0
- /package/{views → compiled/views}/AnnotatedChange.d.ts +0 -0
- /package/{views → compiled/views}/AnnotatedChange.js.map +0 -0
- /package/{views → compiled/views}/BrowserCtx.d.ts +0 -0
- /package/{views → compiled/views}/BrowserCtx.js.map +0 -0
- /package/{views → compiled/views}/FilterCriteria/CRITERIA_CONFIGURATION.d.ts +0 -0
- /package/{views → compiled/views}/FilterCriteria/CRITERIA_CONFIGURATION.js.map +0 -0
- /package/{views → compiled/views}/FilterCriteria/criteriaGroupToQueryExpression.d.ts +0 -0
- /package/{views → compiled/views}/FilterCriteria/criteriaGroupToQueryExpression.js.map +0 -0
- /package/{views → compiled/views}/FilterCriteria/criteriaGroupToSummary.d.ts +0 -0
- /package/{views → compiled/views}/FilterCriteria/criteriaGroupToSummary.js.map +0 -0
- /package/{views → compiled/views}/FilterCriteria/criteriaToNodes.d.ts +0 -0
- /package/{views → compiled/views}/FilterCriteria/criteriaToNodes.js.map +0 -0
- /package/{views → compiled/views}/FilterCriteria/index.d.ts +0 -0
- /package/{views → compiled/views}/FilterCriteria/index.js.map +0 -0
- /package/{views → compiled/views}/FilterCriteria/models.d.ts +0 -0
- /package/{views → compiled/views}/FilterCriteria/models.js.map +0 -0
- /package/{views → compiled/views}/FilterCriteria/mutateGroup.d.ts +0 -0
- /package/{views → compiled/views}/FilterCriteria/mutateGroup.js.map +0 -0
- /package/{views → compiled/views}/GenericRelatedItemView.d.ts +0 -0
- /package/{views → compiled/views}/GenericRelatedItemView.js.map +0 -0
- /package/{views → compiled/views}/ItemDetailsDrawer.d.ts +0 -0
- /package/{views → compiled/views}/ItemDetailsDrawer.js.map +0 -0
- /package/{views → compiled/views}/ItemSearchDrawer.d.ts +0 -0
- /package/{views → compiled/views}/ItemSearchDrawer.js.map +0 -0
- /package/{views → compiled/views}/Party.d.ts +0 -0
- /package/{views → compiled/views}/Party.js.map +0 -0
- /package/{views → compiled/views}/RegisterStakeholder.d.ts +0 -0
- /package/{views → compiled/views}/RegisterStakeholder.js.map +0 -0
- /package/{views → compiled/views}/RegisterVersion.d.ts +0 -0
- /package/{views → compiled/views}/RegisterVersion.js.map +0 -0
- /package/{views → compiled/views}/SearchQuery.d.ts +0 -0
- /package/{views → compiled/views}/SearchQuery.js.map +0 -0
- /package/{views → compiled/views}/StatefulTree.d.ts +0 -0
- /package/{views → compiled/views}/StatefulTree.js.map +0 -0
- /package/{views → compiled/views}/detail/AllItems.d.ts +0 -0
- /package/{views → compiled/views}/detail/AllItems.js.map +0 -0
- /package/{views → compiled/views}/detail/ChangeRequest/index.d.ts +0 -0
- /package/{views → compiled/views}/detail/ChangeRequest/index.js.map +0 -0
- /package/{views → compiled/views}/detail/CustomView/index.d.ts +0 -0
- /package/{views → compiled/views}/detail/CustomView/index.js.map +0 -0
- /package/{views → compiled/views}/detail/ProposalWork.d.ts +0 -0
- /package/{views → compiled/views}/detail/ProposalWork.js.map +0 -0
- /package/{views → compiled/views}/detail/RegisterHome/ActiveProposalDetails.d.ts +0 -0
- /package/{views → compiled/views}/detail/RegisterHome/ActiveProposalDetails.js.map +0 -0
- /package/{views → compiled/views}/detail/RegisterHome/Block.d.ts +0 -0
- /package/{views → compiled/views}/detail/RegisterHome/Block.js.map +0 -0
- /package/{views → compiled/views}/detail/RegisterHome/MetaSummary.d.ts +0 -0
- /package/{views → compiled/views}/detail/RegisterHome/MetaSummary.js.map +0 -0
- /package/{views → compiled/views}/detail/RegisterHome/Proposal.d.ts +0 -0
- /package/{views → compiled/views}/detail/RegisterHome/Proposal.js.map +0 -0
- /package/{views → compiled/views}/detail/RegisterHome/index.d.ts +0 -0
- /package/{views → compiled/views}/detail/RegisterHome/index.js.map +0 -0
- /package/{views → compiled/views}/detail/RegisterHome2/index.d.ts +0 -0
- /package/{views → compiled/views}/detail/RegisterHome2/index.js.map +0 -0
- /package/{views → compiled/views}/detail/RegisterItem/RelatedItems.d.ts +0 -0
- /package/{views → compiled/views}/detail/RegisterItem/RelatedItems.js.map +0 -0
- /package/{views → compiled/views}/detail/RegisterItem/SupersedingItemMenu.d.ts +0 -0
- /package/{views → compiled/views}/detail/RegisterItem/SupersedingItemMenu.js.map +0 -0
- /package/{views → compiled/views}/detail/RegisterItem/index.d.ts +0 -0
- /package/{views → compiled/views}/detail/RegisterItemClass.d.ts +0 -0
- /package/{views → compiled/views}/detail/RegisterItemClass.js.map +0 -0
- /package/{views → compiled/views}/detail/RegisterMeta/RegisterMetaForm.d.ts +0 -0
- /package/{views → compiled/views}/detail/RegisterMeta/RegisterMetaForm.js.map +0 -0
- /package/{views → compiled/views}/detail/RegisterMeta/index.d.ts +0 -0
- /package/{views → compiled/views}/detail/RegisterMeta/index.js.map +0 -0
- /package/{views → compiled/views}/detail/index.d.ts +0 -0
- /package/{views → compiled/views}/detail/index.js.map +0 -0
- /package/{views → compiled/views}/diffing/InlineDiff.d.ts +0 -0
- /package/{views → compiled/views}/diffing/InlineDiff.js.map +0 -0
- /package/{views → compiled/views}/diffing/StructuredDiff.d.ts +0 -0
- /package/{views → compiled/views}/diffing/StructuredDiff.js.map +0 -0
- /package/{views → compiled/views}/hooks/useCustomView.d.ts +0 -0
- /package/{views → compiled/views}/hooks/useCustomView.js.map +0 -0
- /package/{views → compiled/views}/hooks/useItemClassConfig.d.ts +0 -0
- /package/{views → compiled/views}/hooks/useItemClassConfig.js.map +0 -0
- /package/{views → compiled/views}/hooks/useItemRef.d.ts +0 -0
- /package/{views → compiled/views}/hooks/useItemRef.js.map +0 -0
- /package/{views → compiled/views}/hooks/useLatestAcceptedProposal.d.ts +0 -0
- /package/{views → compiled/views}/hooks/useLatestAcceptedProposal.js.map +0 -0
- /package/{views → compiled/views}/hooks/useRegisterVersion.d.ts +0 -0
- /package/{views → compiled/views}/hooks/useRegisterVersion.js.map +0 -0
- /package/{views → compiled/views}/hooks/useSingleRegisterItemData.d.ts +0 -0
- /package/{views → compiled/views}/hooks/useSingleRegisterItemData.js.map +0 -0
- /package/{views → compiled/views}/hooks/useStakeholder.d.ts +0 -0
- /package/{views → compiled/views}/hooks/useStakeholder.js.map +0 -0
- /package/{views → compiled/views}/index.d.ts +0 -0
- /package/{views → compiled/views}/index.js.map +0 -0
- /package/{views → compiled/views}/itemPathUtils.d.ts +0 -0
- /package/{views → compiled/views}/itemPathUtils.js.map +0 -0
- /package/{views → compiled/views}/itemQueryUtils.d.ts +0 -0
- /package/{views → compiled/views}/itemQueryUtils.js.map +0 -0
- /package/{views → compiled/views}/protocolRegistry.d.ts +0 -0
- /package/{views → compiled/views}/protocolRegistry.js.map +0 -0
- /package/{views → compiled/views}/sidebar/Browse/index.d.ts +0 -0
- /package/{views → compiled/views}/sidebar/Browse/index.js.map +0 -0
- /package/{views → compiled/views}/sidebar/ExportImport/ExportOptions.d.ts +0 -0
- /package/{views → compiled/views}/sidebar/ExportImport/ExportOptions.js.map +0 -0
- /package/{views → compiled/views}/sidebar/ExportImport/ImportOptions.d.ts +0 -0
- /package/{views → compiled/views}/sidebar/ExportImport/ImportOptions.js.map +0 -0
- /package/{views → compiled/views}/sidebar/ExportImport/index.d.ts +0 -0
- /package/{views → compiled/views}/sidebar/ExportImport/index.js.map +0 -0
- /package/{views → compiled/views}/sidebar/ListItem.d.ts +0 -0
- /package/{views → compiled/views}/sidebar/ListItem.js.map +0 -0
- /package/{views → compiled/views}/sidebar/Registration/index.d.ts +0 -0
- /package/{views → compiled/views}/sidebar/Registration/index.js.map +0 -0
- /package/{views → compiled/views}/sidebar/Search/index.d.ts +0 -0
- /package/{views → compiled/views}/sidebar/index.d.ts +0 -0
- /package/{views → compiled/views}/sidebar/index.js.map +0 -0
- /package/{views → compiled/views}/util.d.ts +0 -0
- /package/{proposals/actionableGroups → dependencies-local/extension-kit/i18n}/types.js +0 -0
- /package/{types/util.js → dependencies-local/extension-kit/types/binary-invocation.js} +0 -0
- /package/{types/views.js → dependencies-local/extension-kit/types/buffers.js} +0 -0
- /package/{common.js → dist/common.js} +0 -0
- /package/{index.js → dist/index.js} +0 -0
- /package/{item-classes → dist/item-classes}/Tree.js +0 -0
- /package/{item-classes → dist/item-classes}/treeNodes.js +0 -0
- /package/{migrations → dist/migrations}/initial.js +0 -0
- /package/{proposals → dist/proposals}/ChangeRequestContext.js +0 -0
- /package/{proposals → dist/proposals}/HistoryDrawer.js +0 -0
- /package/{proposals → dist/proposals}/ListItem.js +0 -0
- /package/{proposals → dist/proposals}/MetaProperties.js +0 -0
- /package/{proposals → dist/proposals}/NewProposalMenu.js +0 -0
- /package/{proposals → dist/proposals}/ProposalBrowser.js +0 -0
- /package/{proposals → dist/proposals}/ProposalDetail.js +0 -0
- /package/{proposals → dist/proposals}/ProposalItem.js +0 -0
- /package/{proposals → dist/proposals}/ProposalSummary.js +0 -0
- /package/{proposals → dist/proposals}/ProposalTab.js +0 -0
- /package/{proposals → dist/proposals}/ProposalType.js +0 -0
- /package/{proposals → dist/proposals}/ProposalWorkspace.js +0 -0
- /package/{proposals → dist/proposals}/Search.js +0 -0
- /package/{proposals → dist/proposals}/TransitionHistory.js +0 -0
- /package/{proposals → dist/proposals}/TransitionOptions.js +0 -0
- /package/{proposals → dist/proposals}/actionableGroups/Tree.js +0 -0
- /package/{proposals → dist/proposals}/actionableGroups/queries.js +0 -0
- /package/{proposals → dist/proposals}/actionableGroups/treeNodes.js +0 -0
- /package/{proposals → dist/proposals}/index.js +0 -0
- /package/{proposals → dist/proposals}/objectChangeset.js +0 -0
- /package/{proposals → dist/proposals}/queries.js +0 -0
- /package/{proposals → dist/proposals}/types.js +0 -0
- /package/{types → dist/types}/index.js +0 -0
- /package/{types → dist/types}/item.js +0 -0
- /package/{types → dist/types}/register.js +0 -0
- /package/{types → dist/types}/registry.js +0 -0
- /package/{types → dist/types}/stakeholder.js +0 -0
- /package/{views → dist/views}/AnnotatedChange.js +0 -0
- /package/{views → dist/views}/BrowserCtx.js +0 -0
- /package/{views → dist/views}/FilterCriteria/CRITERIA_CONFIGURATION.js +0 -0
- /package/{views → dist/views}/FilterCriteria/criteriaGroupToQueryExpression.js +0 -0
- /package/{views → dist/views}/FilterCriteria/criteriaGroupToSummary.js +0 -0
- /package/{views → dist/views}/FilterCriteria/criteriaToNodes.js +0 -0
- /package/{views → dist/views}/FilterCriteria/index.js +0 -0
- /package/{views → dist/views}/FilterCriteria/models.js +0 -0
- /package/{views → dist/views}/FilterCriteria/mutateGroup.js +0 -0
- /package/{views → dist/views}/GenericRelatedItemView.js +0 -0
- /package/{views → dist/views}/ItemDetailsDrawer.js +0 -0
- /package/{views → dist/views}/ItemSearchDrawer.js +0 -0
- /package/{views → dist/views}/Party.js +0 -0
- /package/{views → dist/views}/RegisterStakeholder.js +0 -0
- /package/{views → dist/views}/RegisterVersion.js +0 -0
- /package/{views → dist/views}/SearchQuery.js +0 -0
- /package/{views → dist/views}/StatefulTree.js +0 -0
- /package/{views → dist/views}/detail/AllItems.js +0 -0
- /package/{views → dist/views}/detail/ChangeRequest/index.js +0 -0
- /package/{views → dist/views}/detail/CustomView/index.js +0 -0
- /package/{views → dist/views}/detail/ProposalWork.js +0 -0
- /package/{views → dist/views}/detail/RegisterHome/ActiveProposalDetails.js +0 -0
- /package/{views → dist/views}/detail/RegisterHome/Block.js +0 -0
- /package/{views → dist/views}/detail/RegisterHome/MetaSummary.js +0 -0
- /package/{views → dist/views}/detail/RegisterHome/Proposal.js +0 -0
- /package/{views → dist/views}/detail/RegisterHome/index.js +0 -0
- /package/{views → dist/views}/detail/RegisterHome2/index.js +0 -0
- /package/{views → dist/views}/detail/RegisterItem/RelatedItems.js +0 -0
- /package/{views → dist/views}/detail/RegisterItem/SupersedingItemMenu.js +0 -0
- /package/{views → dist/views}/detail/RegisterItemClass.js +0 -0
- /package/{views → dist/views}/detail/RegisterMeta/RegisterMetaForm.js +0 -0
- /package/{views → dist/views}/detail/RegisterMeta/index.js +0 -0
- /package/{views → dist/views}/detail/index.js +0 -0
- /package/{views → dist/views}/diffing/InlineDiff.js +0 -0
- /package/{views → dist/views}/diffing/StructuredDiff.js +0 -0
- /package/{views → dist/views}/hooks/useCustomView.js +0 -0
- /package/{views → dist/views}/hooks/useItemClassConfig.js +0 -0
- /package/{views → dist/views}/hooks/useItemRef.js +0 -0
- /package/{views → dist/views}/hooks/useLatestAcceptedProposal.js +0 -0
- /package/{views → dist/views}/hooks/useRegisterVersion.js +0 -0
- /package/{views → dist/views}/hooks/useSingleRegisterItemData.js +0 -0
- /package/{views → dist/views}/hooks/useStakeholder.js +0 -0
- /package/{views → dist/views}/index.js +0 -0
- /package/{views → dist/views}/itemPathUtils.js +0 -0
- /package/{views → dist/views}/itemQueryUtils.js +0 -0
- /package/{views → dist/views}/protocolRegistry.js +0 -0
- /package/{views → dist/views}/sidebar/Browse/index.js +0 -0
- /package/{views → dist/views}/sidebar/ExportImport/ExportOptions.js +0 -0
- /package/{views → dist/views}/sidebar/ExportImport/ImportOptions.js +0 -0
- /package/{views → dist/views}/sidebar/ExportImport/index.js +0 -0
- /package/{views → dist/views}/sidebar/ListItem.js +0 -0
- /package/{views → dist/views}/sidebar/Registration/index.js +0 -0
- /package/{views → dist/views}/sidebar/index.js +0 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.makePaneronObjectCompositeSerDesRule = makePaneronObjectCompositeSerDesRule;
|
|
7
|
+
exports.unflattenObject = unflattenObject;
|
|
8
|
+
exports.flattenObject = flattenObject;
|
|
9
|
+
exports.textEncoder = exports.utf8Decoder = void 0;
|
|
10
|
+
const utf8Decoder = new TextDecoder('utf-8');
|
|
11
|
+
exports.utf8Decoder = utf8Decoder;
|
|
12
|
+
const textEncoder = new TextEncoder();
|
|
13
|
+
exports.textEncoder = textEncoder;
|
|
14
|
+
const stringSerDes = {
|
|
15
|
+
deserialize: buf => utf8Decoder.decode(buf),
|
|
16
|
+
serialize: val => textEncoder.encode(val)
|
|
17
|
+
};
|
|
18
|
+
const numberSerDes = {
|
|
19
|
+
deserialize: buf => parseInt(utf8Decoder.decode(buf), 10),
|
|
20
|
+
serialize: val => textEncoder.encode(val.toString())
|
|
21
|
+
};
|
|
22
|
+
const partSerDes = {
|
|
23
|
+
'text': stringSerDes,
|
|
24
|
+
'number': numberSerDes
|
|
25
|
+
}; //const EXT = '.pan';
|
|
26
|
+
|
|
27
|
+
/* Creates a spec for objects where a serialized object
|
|
28
|
+
is represented as a tree of buffers.
|
|
29
|
+
|
|
30
|
+
An object is represented as comprised from “parts”,
|
|
31
|
+
where each part corresponds to a buffer (e.g., file).
|
|
32
|
+
|
|
33
|
+
The default behavior is such that e.g.
|
|
34
|
+
|
|
35
|
+
{ title: "Hello world", foo: { bar: baz } }
|
|
36
|
+
|
|
37
|
+
after disassembly (basic flattening) would be represented as:
|
|
38
|
+
|
|
39
|
+
{ "/title": "Hello world", "/foo/bar": "baz" }
|
|
40
|
+
|
|
41
|
+
(On disk, title and foo/bar would be paths to files
|
|
42
|
+
relative to object root path.)
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
function makePaneronObjectCompositeSerDesRule() {
|
|
46
|
+
const assemble = unflattenObject;
|
|
47
|
+
const disassemble = flattenObject;
|
|
48
|
+
return {
|
|
49
|
+
deserialize: (rawData, opts) => {
|
|
50
|
+
function deserializePart(buf, partPath) {
|
|
51
|
+
var _a, _b;
|
|
52
|
+
|
|
53
|
+
return partSerDes[(_b = (_a = opts.parts[partPath]) === null || _a === void 0 ? void 0 : _a.dataType) !== null && _b !== void 0 ? _b : 'text'].deserialize(buf);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const parts = deserializeParts(rawData, deserializePart);
|
|
57
|
+
return assemble(parts);
|
|
58
|
+
},
|
|
59
|
+
serialize: (obj, opts) => {
|
|
60
|
+
function serializePart(data, partPath) {
|
|
61
|
+
var _a, _b;
|
|
62
|
+
|
|
63
|
+
return partSerDes[(_b = (_a = opts.parts[partPath]) === null || _a === void 0 ? void 0 : _a.dataType) !== null && _b !== void 0 ? _b : 'text'].serialize(data);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const parts = disassemble(obj);
|
|
67
|
+
return serializeParts(parts, serializePart);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
} // Object flattening and unflattening is based
|
|
71
|
+
// on original implementation from Tofandel’s answer: https://stackoverflow.com/a/59787588/247441
|
|
72
|
+
|
|
73
|
+
/* Aggregates parts (mapped to slash-separated paths) into a nested object.
|
|
74
|
+
|
|
75
|
+
E.g.:
|
|
76
|
+
|
|
77
|
+
{ /some/path: A, /foo: B, /some/other/path: C }
|
|
78
|
+
|
|
79
|
+
gets turned into:
|
|
80
|
+
|
|
81
|
+
{ foo: B, some: { path: A, other: { path: C } } }
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
function unflattenObject(parts) {
|
|
86
|
+
const result = {}; // Ideally should be typed as Partial<T>, but that causes problems down the line
|
|
87
|
+
|
|
88
|
+
for (const partPath of Object.keys(parts)) {
|
|
89
|
+
if (Object.prototype.hasOwnProperty.call(parts, partPath)) {
|
|
90
|
+
const keys = partPath.match(/^\/+[^\/]*|[^\/]*\/+$|(?:\/{2,}|[^\/])+(?:\/+$)?/g); // Matches a standalone slash in a key
|
|
91
|
+
//const keys = partPath.match(/^\.+[^.]*|[^.]*\.+$|(?:\.{2,}|[^.])+(?:\.+$)?/g);
|
|
92
|
+
|
|
93
|
+
if (keys) {
|
|
94
|
+
keys.reduce((accumulator, val, idx) => {
|
|
95
|
+
return accumulator[val] || (accumulator[val] = isNaN(Number(keys[idx + 1])) ? keys.length - 1 === idx ? parts[partPath] : {} : []);
|
|
96
|
+
}, result);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const POSIX_SEP = '/';
|
|
105
|
+
/* Recursively decomposes an arbitrarily nested object into a flat record
|
|
106
|
+
of slash-separated part paths mapped to respective structures.
|
|
107
|
+
|
|
108
|
+
E.g.:
|
|
109
|
+
|
|
110
|
+
{ foo: B, some: { path: A, other: { path: C } } }
|
|
111
|
+
|
|
112
|
+
gets turned into:
|
|
113
|
+
|
|
114
|
+
{ /some/path: A, /foo: B, /some/other/path: C }
|
|
115
|
+
*/
|
|
116
|
+
|
|
117
|
+
function flattenObject(obj, _prefix = false, _result = null) {
|
|
118
|
+
const result = _result || {}; // Preserve empty objects and arrays, they are lost otherwise
|
|
119
|
+
|
|
120
|
+
if (_prefix !== false && typeof obj === 'object' && obj !== null && Object.keys(obj).length === 0) {
|
|
121
|
+
result[_prefix] = Array.isArray(obj) ? [] : {};
|
|
122
|
+
return result;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const prefix = _prefix !== false ? _prefix + POSIX_SEP : POSIX_SEP;
|
|
126
|
+
|
|
127
|
+
for (const i in obj) {
|
|
128
|
+
if (Object.prototype.hasOwnProperty.call(obj, i)) {
|
|
129
|
+
if (typeof obj[i] === 'object' && obj[i] !== null) {
|
|
130
|
+
// Recursion on deeper objects
|
|
131
|
+
flattenObject(obj[i], prefix + i, result);
|
|
132
|
+
} else {
|
|
133
|
+
result[prefix + i] = obj[i];
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return result;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function deserializeParts(buffers, partFromBuffer) {
|
|
142
|
+
const result = {};
|
|
143
|
+
|
|
144
|
+
for (const [p, buffer] of Object.entries(buffers)) {
|
|
145
|
+
result[p] = partFromBuffer(buffer, p);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return result;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function serializeParts(parts, partToBuffer) {
|
|
152
|
+
const result = {};
|
|
153
|
+
|
|
154
|
+
for (const [p, part] of Object.entries(parts)) {
|
|
155
|
+
result[p] = partToBuffer(part, p);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return result;
|
|
159
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
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GAAG,CAAC,CAAC,CAAC,CAAC;aAC7B;SACF;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAGD,SAAS,gBAAgB,CACvB,OAAmC,EACnC,cAAyD;IAEzD,MAAM,MAAM,GAAwB,EAAE,CAAC;IACvC,KAAK,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QACjD,MAAM,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;KACvC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAGD,SAAS,cAAc,CACrB,KAA0B,EAC1B,YAAqD;IAErD,MAAM,MAAM,GAA+B,EAAE,CAAC;IAC9C,KAAK,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QAC7C,MAAM,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;KACnC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { SerDesRule } from '../types/object-spec';\nimport { OnlyJSON } from '../util';\n\n\nexport const utf8Decoder = new TextDecoder('utf-8');\nexport const textEncoder = new TextEncoder();\n\n\ninterface PartSerDes<T> {\n deserialize: (buf: Uint8Array) => T\n serialize: (obj: T) => Uint8Array\n}\n\n\nconst stringSerDes: PartSerDes<string> = {\n deserialize: (buf) => utf8Decoder.decode(buf),\n serialize: (val) => textEncoder.encode(val),\n};\n\nconst numberSerDes: PartSerDes<number> = {\n deserialize: (buf) => parseInt(utf8Decoder.decode(buf), 10),\n serialize: (val) => textEncoder.encode(val.toString()),\n};\n\nconst partSerDes: { [key in DataType]: PartSerDes<any> } = {\n 'text': stringSerDes,\n 'number': numberSerDes,\n};\n\n\ninterface PartSerDesOptions {\n dataType: DataType\n}\n\ninterface SerDesOptions {\n parts: {\n [propertyPath: string]: PartSerDesOptions\n }\n}\n\ntype DataType = 'text' | 'number';\n\n//const EXT = '.pan';\n\n\n/* Creates a spec for objects where a serialized object\n is represented as a tree of buffers.\n\n An object is represented as comprised from “parts”,\n where each part corresponds to a buffer (e.g., file).\n\n The default behavior is such that e.g.\n\n { title: \"Hello world\", foo: { bar: baz } }\n\n after disassembly (basic flattening) would be represented as:\n\n { \"/title\": \"Hello world\", \"/foo/bar\": \"baz\" }\n\n (On disk, title and foo/bar would be paths to files\n relative to object root path.)\n*/\nexport function makePaneronObjectCompositeSerDesRule\n<T extends Record<string, any> & OnlyJSON<Record<string, any>> = any>\n():\nSerDesRule<T> {\n const assemble: (data: any) => T = unflattenObject;\n const disassemble: (obj: T) => Record<string, any> = flattenObject;\n\n return {\n deserialize: (rawData, opts: SerDesOptions) => {\n function deserializePart(buf: Uint8Array, partPath: string): any {\n return partSerDes[opts.parts[partPath]?.dataType ?? 'text'].deserialize(buf);\n }\n const parts = deserializeParts(rawData, deserializePart);\n return assemble(parts);\n },\n serialize: (obj, opts: SerDesOptions) => {\n function serializePart(data: any, partPath: string): Uint8Array {\n return partSerDes[opts.parts[partPath]?.dataType ?? 'text'].serialize(data);\n }\n const parts = disassemble(obj);\n return serializeParts(parts, serializePart);\n },\n };\n}\n\n\n// Object flattening and unflattening is based\n// on original implementation from Tofandel’s answer: https://stackoverflow.com/a/59787588/247441\n\n/* Aggregates parts (mapped to slash-separated paths) into a nested object.\n\n E.g.:\n\n { /some/path: A, /foo: B, /some/other/path: C }\n \n gets turned into:\n\n { foo: B, some: { path: A, other: { path: C } } }\n*/\n\nexport function unflattenObject<T extends Record<string, any>>\n(parts: Record<string, any>): T {\n const result: Record<string, any> = {};\n // Ideally should be typed as Partial<T>, but that causes problems down the line\n\n for (const partPath of Object.keys(parts)) {\n if (Object.prototype.hasOwnProperty.call(parts, partPath)) {\n\n const keys = partPath.match(/^\\/+[^\\/]*|[^\\/]*\\/+$|(?:\\/{2,}|[^\\/])+(?:\\/+$)?/g);\n // Matches a standalone slash in a key\n //const keys = partPath.match(/^\\.+[^.]*|[^.]*\\.+$|(?:\\.{2,}|[^.])+(?:\\.+$)?/g);\n\n if (keys) {\n keys.reduce((accumulator, val, idx) => {\n return accumulator[val] || (\n (accumulator[val] = isNaN(Number(keys[idx + 1]))\n ? (keys.length - 1 === idx\n ? parts[partPath]\n : {})\n : [])\n );\n }, result);\n }\n }\n }\n\n return result as T;\n}\n\n\nconst POSIX_SEP = '/'\n\n\n/* Recursively decomposes an arbitrarily nested object into a flat record\n of slash-separated part paths mapped to respective structures.\n\n E.g.:\n\n { foo: B, some: { path: A, other: { path: C } } }\n \n gets turned into:\n\n { /some/path: A, /foo: B, /some/other/path: C }\n*/\nexport function flattenObject(\n obj: Record<string, any>,\n _prefix: false | string = false,\n _result: Record<string, any> | null = null,\n): Record<string, any> {\n const result: Record<string, any> = _result || {};\n\n // Preserve empty objects and arrays, they are lost otherwise\n if (_prefix !== false &&\n typeof obj === 'object' &&\n obj !== null &&\n Object.keys(obj).length === 0) {\n result[_prefix] = Array.isArray(obj) ? [] : {};\n return result;\n }\n\n const prefix = _prefix !== false\n ? (_prefix + POSIX_SEP)\n : POSIX_SEP;\n\n for (const i in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, i)) {\n if (typeof obj[i] === 'object' && obj[i] !== null) {\n // Recursion on deeper objects\n flattenObject(obj[i], prefix + i, result);\n } else {\n result[prefix + i] = obj[i];\n }\n }\n }\n return result;\n}\n\n\nfunction deserializeParts(\n buffers: Record<string, Uint8Array>,\n partFromBuffer: (buffer: Uint8Array, path: string) => any,\n): Record<string, any> {\n const result: Record<string, any> = {};\n for (const [p, buffer] of Object.entries(buffers)) {\n result[p] = partFromBuffer(buffer, p);\n }\n return result;\n}\n\n\nfunction serializeParts(\n parts: Record<string, any>,\n partToBuffer: (data: any, path: string) => Uint8Array,\n): Record<string, Uint8Array> {\n const result: Record<string, Uint8Array> = {};\n for (const [p, part] of Object.entries(parts)) {\n result[p] = partToBuffer(part, p);\n }\n return result;\n}\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serialization/deserialization rules describe how physical buffers
|
|
3
|
+
* are represented as JS structures at runtime.
|
|
4
|
+
*
|
|
5
|
+
* This is Node-only code due to use of Buffer API.
|
|
6
|
+
*/
|
|
7
|
+
import { type PointerInfo as LFSPointerInfo } from '@riboseinc/isogit-lfs/pointers';
|
|
8
|
+
import type { SerDesRule, SerDesRuleName, SerDesRuleNameExtensionMap } from '../types/object-spec';
|
|
9
|
+
import type { OnlyJSON } from '../util';
|
|
10
|
+
import type { BufferDataset } from '../types/buffers';
|
|
11
|
+
/** Returns serialization/deserialization rule that works for given object. */
|
|
12
|
+
export declare function findSerDesRuleForObject(objPath: string, obj: Record<string, any>, overrides?: {
|
|
13
|
+
extensions?: SerDesRuleNameExtensionMap;
|
|
14
|
+
}): SerDesRule;
|
|
15
|
+
/** Returns serialization/deserialization rule that works for given buffer dataset. */
|
|
16
|
+
export declare function findSerDesRuleForBuffers(objPath: string, buffers: BufferDataset, overrides?: {
|
|
17
|
+
extensions?: SerDesRuleNameExtensionMap;
|
|
18
|
+
}): SerDesRule;
|
|
19
|
+
export declare function getSerDesRuleByName(ruleName: SerDesRuleName): SerDesRule;
|
|
20
|
+
export declare const lfsPointer: SerDesRule<{
|
|
21
|
+
lfsPointerInfo: LFSPointerInfo;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const textFile: SerDesRule<{
|
|
24
|
+
asText: string;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const jsonFile: SerDesRule<OnlyJSON<Record<string, any>>>;
|
|
27
|
+
export declare const yamlFile: SerDesRule<OnlyJSON<Record<string, any>>>;
|
|
28
|
+
export declare const mmelFile: SerDesRule<OnlyJSON<Record<string, any>>>;
|
|
29
|
+
export declare const binaryFile: SerDesRule<{
|
|
30
|
+
binaryData: Uint8Array;
|
|
31
|
+
asBase64: string;
|
|
32
|
+
}>;
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.findSerDesRuleForObject = findSerDesRuleForObject;
|
|
7
|
+
exports.findSerDesRuleForBuffers = findSerDesRuleForBuffers;
|
|
8
|
+
exports.getSerDesRuleByName = getSerDesRuleByName;
|
|
9
|
+
exports.binaryFile = exports.mmelFile = exports.yamlFile = exports.jsonFile = exports.textFile = exports.lfsPointer = void 0;
|
|
10
|
+
|
|
11
|
+
var _pointers = require("@riboseinc/isogit-lfs/pointers");
|
|
12
|
+
|
|
13
|
+
var _util = require("@riboseinc/isogit-lfs/util");
|
|
14
|
+
|
|
15
|
+
var _libmmel = require("@paneron/libmmel");
|
|
16
|
+
|
|
17
|
+
var _objectSpec = require("../types/object-spec");
|
|
18
|
+
|
|
19
|
+
var _yaml = _interopRequireDefault(require("./yaml"));
|
|
20
|
+
|
|
21
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Serialization/deserialization rules describe how physical buffers
|
|
25
|
+
* are represented as JS structures at runtime.
|
|
26
|
+
*
|
|
27
|
+
* This is Node-only code due to use of Buffer API.
|
|
28
|
+
*/
|
|
29
|
+
// Tools for working with buffers
|
|
30
|
+
const utf8Decoder = new TextDecoder('utf-8');
|
|
31
|
+
const utf8Encoder = new TextEncoder();
|
|
32
|
+
/** Takes bytes and outputs Base64. */
|
|
33
|
+
|
|
34
|
+
function base64Encoder(bytes) {
|
|
35
|
+
return btoa(bytes.reduce((acc, current) => acc + String.fromCharCode(current), ""));
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Cross-platform separator for buffer path components.
|
|
39
|
+
* Since buffer paths use POSIX format, this is a POSIX path separator.
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
const sep = '/'; // path.posix.sep;
|
|
44
|
+
|
|
45
|
+
/** Returns whether buffer dataset has only one root buffer at `sep`. */
|
|
46
|
+
|
|
47
|
+
function isLeaf(buffers) {
|
|
48
|
+
return Object.keys(buffers).length === 1 && buffers[sep] !== undefined;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Returns extension normalized to lower-case with leading dot,
|
|
52
|
+
* or empty string if no extension could be determined.
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
function getExt(str) {
|
|
57
|
+
var _a, _b;
|
|
58
|
+
|
|
59
|
+
const _str = str.trim();
|
|
60
|
+
|
|
61
|
+
if (_str === '') {
|
|
62
|
+
return _str;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const ext = (_b = (_a = _str.split('.').pop()) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : '';
|
|
66
|
+
|
|
67
|
+
if (!ext || ext === _str) {
|
|
68
|
+
return '';
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return `.${ext}`;
|
|
72
|
+
} // /**
|
|
73
|
+
// * Returns whether buffer dataset looks like a tree.
|
|
74
|
+
// * A tree won’t have root buffer path mapped to any contents.
|
|
75
|
+
// */
|
|
76
|
+
// function isTree(buffers: BufferDataset) {
|
|
77
|
+
// return Object.keys(buffers).length > 1 && buffers[sep] === undefined;
|
|
78
|
+
// }
|
|
79
|
+
// Rule query API
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Returns serialization/deserialization rule corresponding to given object path,
|
|
83
|
+
* using provided extension map.
|
|
84
|
+
*/
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
function findSerDesRuleForExtension(objPath, map) {
|
|
88
|
+
const extension = getExt(objPath);
|
|
89
|
+
const ruleName = map[extension];
|
|
90
|
+
return ruleName ? getSerDesRuleByName(ruleName) : null;
|
|
91
|
+
}
|
|
92
|
+
/** Returns serialization/deserialization rule that works for given object. */
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
function findSerDesRuleForObject(objPath, obj, overrides) {
|
|
96
|
+
var _a, _b, _c, _d;
|
|
97
|
+
|
|
98
|
+
const override = (overrides === null || overrides === void 0 ? void 0 : overrides.extensions) ? findSerDesRuleForExtension(objPath, overrides.extensions) : null;
|
|
99
|
+
if (override) return override;
|
|
100
|
+
|
|
101
|
+
for (const rule of SER_DES_RULES) {
|
|
102
|
+
if (((_b = (_a = rule.worksForPath) === null || _a === void 0 ? void 0 : _a.call(rule, objPath)) !== null && _b !== void 0 ? _b : true) && ((_d = (_c = rule.worksForObject) === null || _c === void 0 ? void 0 : _c.call(rule, obj)) !== null && _d !== void 0 ? _d : true)) {
|
|
103
|
+
return rule;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return getSerDesRuleByName(DEFAULT_RULE);
|
|
108
|
+
}
|
|
109
|
+
/** Returns serialization/deserialization rule that works for given buffer dataset. */
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
function findSerDesRuleForBuffers(objPath, buffers, overrides) {
|
|
113
|
+
var _a, _b, _c, _d;
|
|
114
|
+
|
|
115
|
+
const override = (overrides === null || overrides === void 0 ? void 0 : overrides.extensions) ? findSerDesRuleForExtension(objPath, overrides.extensions) : null;
|
|
116
|
+
if (override) return override;
|
|
117
|
+
|
|
118
|
+
for (const rule of SER_DES_RULES) {
|
|
119
|
+
if (((_b = (_a = rule.worksForPath) === null || _a === void 0 ? void 0 : _a.call(rule, objPath)) !== null && _b !== void 0 ? _b : true) && ((_d = (_c = rule.worksForBufferDataset) === null || _c === void 0 ? void 0 : _c.call(rule, buffers)) !== null && _d !== void 0 ? _d : true)) {
|
|
120
|
+
return rule;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return getSerDesRuleByName(DEFAULT_RULE);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function getSerDesRuleByName(ruleName) {
|
|
128
|
+
return SER_DES_RULE_REGISTRY[ruleName];
|
|
129
|
+
} // Rule definitions
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
const lfsPointer = {
|
|
133
|
+
worksForObject: obj => obj.lfsPointerInfo !== undefined,
|
|
134
|
+
worksForBufferDataset: buffers => isLeaf(buffers) && (0, _util.pointsToLFS)(buffers[sep]),
|
|
135
|
+
deserialize: buffers => ({
|
|
136
|
+
lfsPointerInfo: (0, _pointers.readPointerInfo)(buffers[sep])
|
|
137
|
+
}),
|
|
138
|
+
serialize: objectData => ({
|
|
139
|
+
[sep]: (0, _pointers.formatPointerInfo)(objectData.lfsPointerInfo)
|
|
140
|
+
})
|
|
141
|
+
};
|
|
142
|
+
exports.lfsPointer = lfsPointer;
|
|
143
|
+
const textFile = {
|
|
144
|
+
worksForBufferDataset: isLeaf,
|
|
145
|
+
deserialize: buffers => ({
|
|
146
|
+
asText: utf8Decoder.decode(buffers[sep])
|
|
147
|
+
}),
|
|
148
|
+
serialize: objectData => ({
|
|
149
|
+
[sep]: utf8Encoder.encode(objectData.asText)
|
|
150
|
+
})
|
|
151
|
+
};
|
|
152
|
+
exports.textFile = textFile;
|
|
153
|
+
const jsonFile = {
|
|
154
|
+
worksForPath: path => path.endsWith('.json'),
|
|
155
|
+
worksForBufferDataset: isLeaf,
|
|
156
|
+
deserialize: buffers => JSON.parse(utf8Decoder.decode(buffers[sep])),
|
|
157
|
+
serialize: data => ({
|
|
158
|
+
[sep]: utf8Encoder.encode(JSON.stringify(data))
|
|
159
|
+
})
|
|
160
|
+
};
|
|
161
|
+
exports.jsonFile = jsonFile;
|
|
162
|
+
const yamlFile = {
|
|
163
|
+
worksForPath: path => path.endsWith('.yaml') || path.endsWith('.yml'),
|
|
164
|
+
worksForBufferDataset: isLeaf,
|
|
165
|
+
deserialize: buffers => {
|
|
166
|
+
const result = _yaml.default.load(utf8Decoder.decode(buffers[sep]));
|
|
167
|
+
|
|
168
|
+
if (result && typeof result !== 'string' && typeof result !== 'number') {
|
|
169
|
+
return result;
|
|
170
|
+
} else {
|
|
171
|
+
throw new Error("Failed to deserialize buffers: got a non-object from yaml.load()");
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
serialize: data => ({
|
|
175
|
+
[sep]: utf8Encoder.encode(_yaml.default.dump(data))
|
|
176
|
+
})
|
|
177
|
+
};
|
|
178
|
+
exports.yamlFile = yamlFile;
|
|
179
|
+
const mmelFile = {
|
|
180
|
+
worksForPath: path => path.endsWith('.mmel'),
|
|
181
|
+
worksForBufferDataset: isLeaf,
|
|
182
|
+
deserialize: buffers => {
|
|
183
|
+
const result = (0, _libmmel.textToMMEL)(utf8Decoder.decode(buffers[sep]));
|
|
184
|
+
return result;
|
|
185
|
+
},
|
|
186
|
+
serialize: data => ({
|
|
187
|
+
[sep]: utf8Encoder.encode((0, _libmmel.MMELToText)(data))
|
|
188
|
+
})
|
|
189
|
+
};
|
|
190
|
+
exports.mmelFile = mmelFile;
|
|
191
|
+
const KNOWN_BINARY_EXTENSIONS = new Set(['.jpg', '.jpeg', '.png', '.wav', '.ogg', '.mov', '.mp4', '.webm']);
|
|
192
|
+
const binaryFile = {
|
|
193
|
+
worksForPath: objPath => KNOWN_BINARY_EXTENSIONS.has(getExt(objPath)),
|
|
194
|
+
deserialize: buffers => ({
|
|
195
|
+
binaryData: buffers[sep],
|
|
196
|
+
asBase64: base64Encoder(buffers[sep])
|
|
197
|
+
}),
|
|
198
|
+
serialize: data => ({
|
|
199
|
+
[sep]: data.binaryData
|
|
200
|
+
})
|
|
201
|
+
}; // Rule registers
|
|
202
|
+
|
|
203
|
+
exports.binaryFile = binaryFile;
|
|
204
|
+
const DEFAULT_RULE = _objectSpec.AtomicSerDesRuleName.textFile;
|
|
205
|
+
const SER_DES_RULES = [lfsPointer, // LFS pointer rule comes first. Any object/buffer can be a pointer
|
|
206
|
+
// regardless of path.
|
|
207
|
+
jsonFile, yamlFile, binaryFile, textFile];
|
|
208
|
+
const ATOMIC_SER_DES_RULES = {
|
|
209
|
+
[_objectSpec.AtomicSerDesRuleName.lfsPointer]: lfsPointer,
|
|
210
|
+
[_objectSpec.AtomicSerDesRuleName.jsonFile]: jsonFile,
|
|
211
|
+
[_objectSpec.AtomicSerDesRuleName.yamlFile]: yamlFile,
|
|
212
|
+
[_objectSpec.AtomicSerDesRuleName.mmelFile]: mmelFile,
|
|
213
|
+
[_objectSpec.AtomicSerDesRuleName.binaryFile]: binaryFile,
|
|
214
|
+
[_objectSpec.AtomicSerDesRuleName.textFile]: textFile
|
|
215
|
+
};
|
|
216
|
+
const SER_DES_RULE_REGISTRY = { ...ATOMIC_SER_DES_RULES // [CompositeSerDesRuleName.paneronObject]: makePaneronObjectCompositeSerDesRule(),
|
|
217
|
+
|
|
218
|
+
}; //export function getAtomicSerDesRuleForExtension(ext: string): SerDesRule | undefined {
|
|
219
|
+
// return Object.values(ATOMIC_SER_DES_RULES).find(rule =>
|
|
220
|
+
// rule.extensions.indexOf(ext) >= 0 ||
|
|
221
|
+
// Object.keys(rule.extensions).length === 0);
|
|
222
|
+
//}
|
|
223
|
+
//const EFFECTIVE_SER_DES_RULES: SerDesRuleName[] = [
|
|
224
|
+
// AtomicSerDesRuleName.jsonFile,
|
|
225
|
+
// AtomicSerDesRuleName.yamlFile,
|
|
226
|
+
// AtomicSerDesRuleName.binaryFile,
|
|
227
|
+
// AtomicSerDesRuleName.textFile,
|
|
228
|
+
//];
|
|
229
|
+
//export const SER_DES_RULES: { [key in SerDesRuleName]: SerDesRule } = {
|
|
230
|
+
// ...ATOMIC_SER_DES_RULES,
|
|
231
|
+
// //[NestedSerDesRuleName.tree]: makeTreeSerDesRule(ATOMIC_SER_DES_RULES),
|
|
232
|
+
//};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ser-des.js","sourceRoot":"","sources":["../../src/object-specs/ser-des.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,iBAAiB,EAEjB,eAAe,GAChB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,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IAEtB,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,QAAQ;CACT,CAAC;AAEF,MAAM,oBAAoB,GAAkD;IAC1E,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE,UAAU;IAC7C,CAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAE,QAAQ;IACzC,CAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAE,QAAQ;IACzC,CAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAE,QAAQ;IACzC,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE,UAAU;IAC7C,CAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAE,QAAQ;CAC1C,CAAC;AAEF,MAAM,qBAAqB,GAA4C;IACrE,GAAG,oBAAoB;IACvB,mFAAmF;CACpF,CAAC;AAGF,wFAAwF;AACxF,2DAA2D;AAC3D,0CAA0C;AAC1C,iDAAiD;AACjD,GAAG;AAEH,qDAAqD;AACrD,kCAAkC;AAClC,kCAAkC;AAClC,oCAAoC;AACpC,kCAAkC;AAClC,IAAI;AAEJ,yEAAyE;AACzE,4BAA4B;AAC5B,4EAA4E;AAC5E,IAAI","sourcesContent":["/**\n * Serialization/deserialization rules describe how physical buffers\n * are represented as JS structures at runtime.\n * \n * This is Node-only code due to use of Buffer API.\n */\n\nimport {\n formatPointerInfo,\n type PointerInfo as LFSPointerInfo,\n readPointerInfo,\n} from '@riboseinc/isogit-lfs/pointers';\nimport { pointsToLFS } from '@riboseinc/isogit-lfs/util';\n\nimport { MMELToText, textToMMEL } from '@paneron/libmmel';\nimport { type MMELModel } from '@paneron/libmmel/interface/model';\n\nimport { AtomicSerDesRuleName } from '../types/object-spec';\nimport type { SerDesRule, SerDesRuleName, SerDesRuleNameExtensionMap } from '../types/object-spec';\nimport type { OnlyJSON } from '../util';\nimport type { BufferDataset } from '../types/buffers';\n\nimport yaml from './yaml';\n\n\n// Tools for working with buffers\n\nconst utf8Decoder = new TextDecoder('utf-8');\nconst utf8Encoder = new TextEncoder();\n\n/** Takes bytes and outputs Base64. */\nfunction base64Encoder(bytes: Uint8Array): string {\n return btoa(\n bytes.reduce((acc, current) => acc + String.fromCharCode(current), \"\")\n );\n}\n\n/**\n * Cross-platform separator for buffer path components.\n * Since buffer paths use POSIX format, this is a POSIX path separator.\n */\nconst sep = '/' // path.posix.sep;\n\n/** Returns whether buffer dataset has only one root buffer at `sep`. */\nfunction isLeaf(buffers: BufferDataset) {\n return Object.keys(buffers).length === 1 && buffers[sep] !== undefined;\n}\n\n/**\n * Returns extension normalized to lower-case with leading dot,\n * or empty string if no extension could be determined.\n */\nfunction getExt(str: string): string {\n const _str = str.trim();\n if (_str === '') { return _str; }\n const ext = _str.split('.').pop()?.toLowerCase() ?? '';\n if (!ext || ext === _str) { return ''; }\n return `.${ext}`;\n}\n\n// /**\n// * Returns whether buffer dataset looks like a tree.\n// * A tree won’t have root buffer path mapped to any contents.\n// */\n// function isTree(buffers: BufferDataset) {\n// return Object.keys(buffers).length > 1 && buffers[sep] === undefined;\n// }\n\n\n// Rule query API\n\n/**\n * Returns serialization/deserialization rule corresponding to given object path,\n * using provided extension map.\n */\nfunction findSerDesRuleForExtension(objPath: string, map: SerDesRuleNameExtensionMap): SerDesRule | null {\n const extension = getExt(objPath);\n const ruleName = map[extension];\n return ruleName ? getSerDesRuleByName(ruleName) : null;\n}\n\n\n/** Returns serialization/deserialization rule that works for given object. */\nexport function findSerDesRuleForObject(\n objPath: string,\n obj: Record<string, any>,\n overrides?: { extensions?: SerDesRuleNameExtensionMap },\n): SerDesRule {\n const override = overrides?.extensions\n ? findSerDesRuleForExtension(objPath, overrides.extensions)\n : null;\n if (override) return override;\n\n for (const rule of SER_DES_RULES) {\n if ((rule.worksForPath?.(objPath) ?? true) && (rule.worksForObject?.(obj) ?? true)) {\n return rule;\n }\n }\n return getSerDesRuleByName(DEFAULT_RULE);\n}\n\n/** Returns serialization/deserialization rule that works for given buffer dataset. */\nexport function findSerDesRuleForBuffers(\n objPath: string,\n buffers: BufferDataset,\n overrides?: { extensions?: SerDesRuleNameExtensionMap },\n): SerDesRule {\n const override = overrides?.extensions\n ? findSerDesRuleForExtension(objPath, overrides.extensions)\n : null;\n if (override) return override;\n\n for (const rule of SER_DES_RULES) {\n if ((rule.worksForPath?.(objPath) ?? true) && (rule.worksForBufferDataset?.(buffers) ?? true)) {\n return rule;\n }\n }\n return getSerDesRuleByName(DEFAULT_RULE);\n}\n\nexport function getSerDesRuleByName(ruleName: SerDesRuleName): SerDesRule {\n return SER_DES_RULE_REGISTRY[ruleName];\n}\n\n\n// Rule definitions\n\nexport const lfsPointer: SerDesRule<{ lfsPointerInfo: LFSPointerInfo }> = {\n worksForObject: (obj) => obj.lfsPointerInfo !== undefined,\n worksForBufferDataset: (buffers) =>\n isLeaf(buffers) && pointsToLFS(buffers[sep]!),\n\n deserialize: (buffers) =>\n ({ lfsPointerInfo: readPointerInfo(buffers[sep]) }),\n serialize: (objectData) =>\n ({ [sep]: formatPointerInfo(objectData.lfsPointerInfo) }),\n}\n\nexport const textFile: SerDesRule<{ asText: string }> = {\n worksForBufferDataset: isLeaf,\n deserialize: (buffers) =>\n ({ asText: utf8Decoder.decode(buffers[sep]) }),\n serialize: (objectData) =>\n ({ [sep]: utf8Encoder.encode(objectData.asText) }),\n};\n\n\nexport const jsonFile: SerDesRule<OnlyJSON<Record<string, any>>> = {\n worksForPath: (path) => path.endsWith('.json'),\n worksForBufferDataset: isLeaf,\n deserialize: (buffers) => JSON.parse(utf8Decoder.decode(buffers[sep])),\n serialize: (data) => ({ [sep]: utf8Encoder.encode(JSON.stringify(data)) }),\n};\n\n\nexport const yamlFile: SerDesRule<OnlyJSON<Record<string, any>>> = {\n worksForPath: (path) => path.endsWith('.yaml') || path.endsWith('.yml'),\n worksForBufferDataset: isLeaf,\n deserialize: (buffers) => {\n const result = yaml.load(utf8Decoder.decode(buffers[sep]));\n if (result && typeof result !== 'string' && typeof result !== 'number') {\n return result;\n } else {\n throw new Error(\"Failed to deserialize buffers: got a non-object from yaml.load()\");\n }\n },\n serialize: (data) =>\n ({ [sep]: utf8Encoder.encode(yaml.dump(data)) }),\n};\n\n\nexport const mmelFile: SerDesRule<OnlyJSON<Record<string, any>>> = {\n worksForPath: (path) => path.endsWith('.mmel'),\n worksForBufferDataset: isLeaf,\n deserialize: (buffers) => {\n const result: MMELModel = textToMMEL(utf8Decoder.decode(buffers[sep]));\n return result;\n },\n serialize: (data) =>\n ({ [sep]: utf8Encoder.encode(MMELToText(data as MMELModel)) }),\n};\n\n\nconst KNOWN_BINARY_EXTENSIONS: Set<string> = new Set([\n '.jpg',\n '.jpeg',\n '.png',\n '.wav',\n '.ogg',\n '.mov',\n '.mp4',\n '.webm',\n]);\nexport const binaryFile: SerDesRule<{ binaryData: Uint8Array; asBase64: string; }> = {\n worksForPath: (objPath) =>\n KNOWN_BINARY_EXTENSIONS.has(getExt(objPath)),\n deserialize: (buffers) => ({\n binaryData: buffers[sep],\n asBase64: base64Encoder(buffers[sep]),\n }),\n serialize: (data) =>\n ({ [sep]: data.binaryData }),\n};\n\n\n// Rule registers\n\nconst DEFAULT_RULE: SerDesRuleName = AtomicSerDesRuleName.textFile;\n\nconst SER_DES_RULES: SerDesRule[] = [\n lfsPointer,\n // LFS pointer rule comes first. Any object/buffer can be a pointer\n // regardless of path.\n\n jsonFile,\n yamlFile,\n binaryFile,\n textFile,\n];\n\nconst ATOMIC_SER_DES_RULES: { [key in AtomicSerDesRuleName]: SerDesRule } = {\n [AtomicSerDesRuleName.lfsPointer]: lfsPointer,\n [AtomicSerDesRuleName.jsonFile]: jsonFile,\n [AtomicSerDesRuleName.yamlFile]: yamlFile,\n [AtomicSerDesRuleName.mmelFile]: mmelFile,\n [AtomicSerDesRuleName.binaryFile]: binaryFile,\n [AtomicSerDesRuleName.textFile]: textFile,\n};\n\nconst SER_DES_RULE_REGISTRY: { [key in SerDesRuleName]: SerDesRule } = {\n ...ATOMIC_SER_DES_RULES,\n // [CompositeSerDesRuleName.paneronObject]: makePaneronObjectCompositeSerDesRule(),\n};\n\n\n//export function getAtomicSerDesRuleForExtension(ext: string): SerDesRule | undefined {\n// return Object.values(ATOMIC_SER_DES_RULES).find(rule =>\n// rule.extensions.indexOf(ext) >= 0 ||\n// Object.keys(rule.extensions).length === 0);\n//}\n\n//const EFFECTIVE_SER_DES_RULES: SerDesRuleName[] = [\n// AtomicSerDesRuleName.jsonFile,\n// AtomicSerDesRuleName.yamlFile,\n// AtomicSerDesRuleName.binaryFile,\n// AtomicSerDesRuleName.textFile,\n//];\n\n//export const SER_DES_RULES: { [key in SerDesRuleName]: SerDesRule } = {\n// ...ATOMIC_SER_DES_RULES,\n// //[NestedSerDesRuleName.tree]: makeTreeSerDesRule(ATOMIC_SER_DES_RULES),\n//};\n"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.customBoolType = void 0;
|
|
7
|
+
|
|
8
|
+
var _jsYaml = require("js-yaml");
|
|
9
|
+
|
|
10
|
+
function resolveYamlBoolean(data) {
|
|
11
|
+
if (data === null) return false;
|
|
12
|
+
var max = data.length;
|
|
13
|
+
return max === 4 && (data === 'true' || data === 'True' || data === 'TRUE') || max === 5 && (data === 'false' || data === 'False' || data === 'FALSE') || max === 3 && (data === 'yes' || data === 'Yes' || data === 'YES') || max === 2 && (data === 'no' || data === 'No' || data === 'NO');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function constructYamlBoolean(data) {
|
|
17
|
+
return data === 'yes' || data === 'Yes' || data === 'YES' || data === 'true' || data === 'True' || data === 'TRUE';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function isBoolean(object) {
|
|
21
|
+
return Object.prototype.toString.call(object) === '[object Boolean]';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const customBoolType = new _jsYaml.Type('tag:yaml.org,2002:bool', {
|
|
25
|
+
kind: 'scalar',
|
|
26
|
+
resolve: resolveYamlBoolean,
|
|
27
|
+
construct: constructYamlBoolean,
|
|
28
|
+
predicate: isBoolean,
|
|
29
|
+
represent: {
|
|
30
|
+
lowercase: function (object) {
|
|
31
|
+
return object ? 'true' : 'false';
|
|
32
|
+
},
|
|
33
|
+
uppercase: function (object) {
|
|
34
|
+
return object ? 'TRUE' : 'FALSE';
|
|
35
|
+
},
|
|
36
|
+
camelcase: function (object) {
|
|
37
|
+
return object ? 'True' : 'False';
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
defaultStyle: 'lowercase'
|
|
41
|
+
});
|
|
42
|
+
exports.customBoolType = customBoolType;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-bool.js","sourceRoot":"","sources":["../../../src/object-specs/yaml/custom-bool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAG/B,SAAS,kBAAkB,CAAC,IAAmB;IAC7C,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAEhC,IAAI,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;IAEtB,OAAO,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,MAAM,CAAC,CAAC;QACtE,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,OAAO,CAAC,CAAC;QACzE,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,CAAC,CAAC;QACnE,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC;AAC1E,CAAC;AAED,SAAS,oBAAoB,CAAC,IAAY;IACxC,OAAO,IAAI,KAAK,KAAK;QACd,IAAI,KAAK,KAAK;QACd,IAAI,KAAK,KAAK;QACd,IAAI,KAAK,MAAM;QACf,IAAI,KAAK,MAAM;QACf,IAAI,KAAK,MAAM,CAAC;AACzB,CAAC;AAED,SAAS,SAAS,CAAC,MAAW;IAC5B,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,kBAAkB,CAAC;AACvE,CAAC;AAED,MAAM,cAAc,GAAG,IAAI,IAAI,CAAC,wBAAwB,EAAE;IACxD,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,kBAAkB;IAC3B,SAAS,EAAE,oBAAoB;IAC/B,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE;QACT,SAAS,EAAE,UAAU,MAAM,IAAI,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAClE,SAAS,EAAE,UAAU,MAAM,IAAI,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAClE,SAAS,EAAE,UAAU,MAAM,IAAI,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;KACnE;IACD,YAAY,EAAE,WAAW;CAC1B,CAAC,CAAC;AAGH,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { Type } from 'js-yaml';\n\n\nfunction resolveYamlBoolean(data: null | string) {\n if (data === null) return false;\n\n var max = data.length;\n\n return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||\n (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')) ||\n (max === 3 && (data === 'yes' || data === 'Yes' || data === 'YES')) ||\n (max === 2 && (data === 'no' || data === 'No' || data === 'NO'));\n}\n\nfunction constructYamlBoolean(data: string) {\n return data === 'yes' ||\n data === 'Yes' ||\n data === 'YES' ||\n data === 'true' ||\n data === 'True' ||\n data === 'TRUE';\n}\n\nfunction isBoolean(object: any): object is Boolean {\n return Object.prototype.toString.call(object) === '[object Boolean]';\n}\n\nconst customBoolType = new Type('tag:yaml.org,2002:bool', {\n kind: 'scalar',\n resolve: resolveYamlBoolean,\n construct: constructYamlBoolean,\n predicate: isBoolean,\n represent: {\n lowercase: function (object) { return object ? 'true' : 'false'; },\n uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },\n camelcase: function (object) { return object ? 'True' : 'False'; }\n },\n defaultStyle: 'lowercase'\n});\n\n\nexport { customBoolType };\n"]}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _jsYaml = require("js-yaml");
|
|
9
|
+
|
|
10
|
+
var YAML_DATE_REGEXP = new RegExp('^([0-9][0-9][0-9][0-9])' + // [1] year
|
|
11
|
+
'-([0-9][0-9])' + // [2] month
|
|
12
|
+
'-([0-9][0-9])$'); // [3] day
|
|
13
|
+
|
|
14
|
+
var YAML_TIMESTAMP_REGEXP = new RegExp('^([0-9][0-9][0-9][0-9])' + // [1] year
|
|
15
|
+
'-([0-9][0-9]?)' + // [2] month
|
|
16
|
+
'-([0-9][0-9]?)' + // [3] day
|
|
17
|
+
'(?:[Tt]|[ \\t]+)' + // ...
|
|
18
|
+
'([0-9][0-9]?)' + // [4] hour
|
|
19
|
+
':([0-9][0-9])' + // [5] minute
|
|
20
|
+
':([0-9][0-9])' + // [6] second
|
|
21
|
+
'(?:\\.([0-9]*))?' + // [7] fraction
|
|
22
|
+
'(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour
|
|
23
|
+
'(?::([0-9][0-9]))?))?$'); // [11] tz_minute
|
|
24
|
+
|
|
25
|
+
function resolveYamlTimestamp(data) {
|
|
26
|
+
if (data === null) return false;
|
|
27
|
+
if (YAML_DATE_REGEXP.exec(data) !== null) return true;
|
|
28
|
+
if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function constructYamlTimestamp(data) {
|
|
33
|
+
let match,
|
|
34
|
+
year,
|
|
35
|
+
month,
|
|
36
|
+
day,
|
|
37
|
+
hour,
|
|
38
|
+
minute,
|
|
39
|
+
second,
|
|
40
|
+
fraction = 0,
|
|
41
|
+
delta = null,
|
|
42
|
+
tz_hour,
|
|
43
|
+
tz_minute,
|
|
44
|
+
date;
|
|
45
|
+
match = YAML_DATE_REGEXP.exec(data);
|
|
46
|
+
if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
|
|
47
|
+
if (match === null) throw new Error('Date resolve error'); // match: [1] year [2] month [3] day
|
|
48
|
+
|
|
49
|
+
year = +match[1];
|
|
50
|
+
month = +match[2] - 1; // JS month starts with 0
|
|
51
|
+
|
|
52
|
+
day = +match[3];
|
|
53
|
+
|
|
54
|
+
if (!match[4]) {
|
|
55
|
+
// no hour
|
|
56
|
+
return new Date(Date.UTC(year, month, day));
|
|
57
|
+
} // match: [4] hour [5] minute [6] second [7] fraction
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
hour = +match[4];
|
|
61
|
+
minute = +match[5];
|
|
62
|
+
second = +match[6];
|
|
63
|
+
|
|
64
|
+
if (match[7]) {
|
|
65
|
+
let fractionStr = match[7].slice(0, 3);
|
|
66
|
+
|
|
67
|
+
while (fractionStr.length < 3) {
|
|
68
|
+
// milliseconds
|
|
69
|
+
fractionStr += '0';
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
fraction = parseInt(fractionStr, 10);
|
|
74
|
+
} catch (e) {
|
|
75
|
+
fraction = 0;
|
|
76
|
+
}
|
|
77
|
+
} // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
if (match[9]) {
|
|
81
|
+
tz_hour = +match[10];
|
|
82
|
+
tz_minute = +(match[11] || 0);
|
|
83
|
+
delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds
|
|
84
|
+
|
|
85
|
+
if (match[9] === '-') delta = -delta;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
|
|
89
|
+
if (delta) date.setTime(date.getTime() - delta);
|
|
90
|
+
return date;
|
|
91
|
+
} // function representYamlTimestamp(object /*, style*/) {
|
|
92
|
+
// return object.toISOString();
|
|
93
|
+
// }
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
const customTimestampType = new _jsYaml.Type('tag:yaml.org,2002:timestamp', {
|
|
97
|
+
kind: 'scalar',
|
|
98
|
+
resolve: resolveYamlTimestamp,
|
|
99
|
+
construct: constructYamlTimestamp,
|
|
100
|
+
instanceOf: Date,
|
|
101
|
+
represent: obj => {
|
|
102
|
+
if (obj.toISOString) {
|
|
103
|
+
return obj.toISOString();
|
|
104
|
+
} else {
|
|
105
|
+
throw new Error("Unable to represent a date");
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
var _default = customTimestampType;
|
|
110
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-timestamp.js","sourceRoot":"","sources":["../../../src/object-specs/yaml/custom-timestamp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAG/B,IAAI,gBAAgB,GAAG,IAAI,MAAM,CAC/B,yBAAyB,GAAY,WAAW;IAChD,eAAe,GAAsB,YAAY;IACjD,gBAAgB,CAAC,CAAC,CAAmB,UAAU;AAGjD,IAAI,qBAAqB,GAAG,IAAI,MAAM,CACpC,yBAAyB,GAAY,WAAW;IAChD,gBA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,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE5E,IAAI,KAAK;QAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,CAAC;IAEhD,OAAO,IAAI,CAAC;AACd,CAAC;AAGD,wDAAwD;AACxD,iCAAiC;AACjC,IAAI;AAGJ,MAAM,mBAAmB,GAAG,IAAI,IAAI,CAAC,6BAA6B,EAAE;IAClE,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,oBAAoB;IAC7B,SAAS,EAAE,sBAAsB;IACjC,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE;QACjB,IAAK,GAAW,CAAC,WAAW,EAAE;YAC5B,OAAQ,GAAY,CAAC,WAAW,EAAE,CAAC;SACpC;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;SAC/C;IACH,CAAC;CACF,CAAC,CAAC;AAGH,eAAe,mBAAmB,CAAC","sourcesContent":["import { Type } from 'js-yaml';\n\n\nvar YAML_DATE_REGEXP = new RegExp(\n '^([0-9][0-9][0-9][0-9])' + // [1] year\n '-([0-9][0-9])' + // [2] month\n '-([0-9][0-9])$'); // [3] day\n\n\nvar YAML_TIMESTAMP_REGEXP = new RegExp(\n '^([0-9][0-9][0-9][0-9])' + // [1] year\n '-([0-9][0-9]?)' + // [2] month\n '-([0-9][0-9]?)' + // [3] day\n '(?:[Tt]|[ \\\\t]+)' + // ...\n '([0-9][0-9]?)' + // [4] hour\n ':([0-9][0-9])' + // [5] minute\n ':([0-9][0-9])' + // [6] second\n '(?:\\\\.([0-9]*))?' + // [7] fraction\n '(?:[ \\\\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour\n '(?::([0-9][0-9]))?))?$'); // [11] tz_minute\n\n\nfunction resolveYamlTimestamp(data: string | null) {\n if (data === null) return false;\n if (YAML_DATE_REGEXP.exec(data) !== null) return true;\n if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;\n return false;\n}\n\n\nfunction constructYamlTimestamp(data: string) {\n let match, year, month, day, hour, minute, second, fraction = 0,\n delta = null, tz_hour, tz_minute, date;\n\n match = YAML_DATE_REGEXP.exec(data);\n if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);\n\n if (match === null) throw new Error('Date resolve error');\n\n // match: [1] year [2] month [3] day\n\n year = +(match[1]);\n month = +(match[2]) - 1; // JS month starts with 0\n day = +(match[3]);\n\n if (!match[4]) { // no hour\n return new Date(Date.UTC(year, month, day));\n }\n\n // match: [4] hour [5] minute [6] second [7] fraction\n\n hour = +(match[4]);\n minute = +(match[5]);\n second = +(match[6]);\n\n if (match[7]) {\n let fractionStr = match[7].slice(0, 3);\n while (fractionStr.length < 3) { // milliseconds\n fractionStr += '0';\n }\n try {\n fraction = parseInt(fractionStr, 10);\n } catch (e) {\n fraction = 0;\n }\n }\n\n // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute\n\n if (match[9]) {\n tz_hour = +(match[10]);\n tz_minute = +(match[11] || 0);\n delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds\n if (match[9] === '-') delta = -delta;\n }\n\n date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));\n\n if (delta) date.setTime(date.getTime() - delta);\n\n return date;\n}\n\n\n// function representYamlTimestamp(object /*, style*/) {\n// return object.toISOString();\n// }\n\n\nconst customTimestampType = new Type('tag:yaml.org,2002:timestamp', {\n kind: 'scalar',\n resolve: resolveYamlTimestamp,\n construct: constructYamlTimestamp,\n instanceOf: Date,\n represent: (obj) => {\n if ((obj as any).toISOString) {\n return (obj as Date).toISOString();\n } else {\n throw new Error(\"Unable to represent a date\");\n }\n },\n});\n\n\nexport default customTimestampType;\n"]}
|