@jini-ai/admin 0.3.10 → 0.4.0
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/CHANGELOG.md +58 -0
- package/README.md +71 -37
- package/dist/agent-plugins/adapters/http.d.ts +7 -0
- package/dist/agent-plugins/adapters/http.js +15 -0
- package/dist/agent-plugins/adapters/memory.d.ts +8 -0
- package/dist/agent-plugins/adapters/memory.js +25 -0
- package/dist/agent-plugins/agent-plugins.module.d.ts +51 -0
- package/dist/agent-plugins/agent-plugins.module.js +6 -0
- package/dist/agent-plugins/conformance/agent-plugins-api.conformance.d.ts +12 -0
- package/dist/agent-plugins/conformance/agent-plugins-api.conformance.js +47 -0
- package/dist/agent-plugins/controllers/agent-plugin-files.controller.d.ts +20 -0
- package/dist/agent-plugins/controllers/agent-plugin-files.controller.js +43 -0
- package/dist/agent-plugins/controllers/agent-plugins.controller.d.ts +25 -0
- package/dist/agent-plugins/controllers/agent-plugins.controller.js +91 -0
- package/dist/agent-plugins/index.d.ts +9 -0
- package/dist/agent-plugins/index.js +9 -0
- package/dist/agent-plugins/messages.en.d.ts +23 -0
- package/dist/agent-plugins/messages.en.js +14 -0
- package/dist/agent-plugins/models.d.ts +57 -0
- package/dist/agent-plugins/models.js +2 -0
- package/dist/agent-plugins/package-file-tree.d.ts +111 -0
- package/dist/agent-plugins/package-file-tree.js +188 -0
- package/dist/agent-plugins/ports.d.ts +18 -0
- package/dist/agent-plugins/ports.js +3 -0
- package/dist/agent-plugins/react/components/AgentPluginFileContent.d.ts +5 -0
- package/dist/agent-plugins/react/components/AgentPluginFileContent.js +9 -0
- package/dist/agent-plugins/react/components/AgentPluginFileTree.d.ts +9 -0
- package/dist/agent-plugins/react/components/AgentPluginFileTree.js +7 -0
- package/dist/agent-plugins/react/components/AgentPluginInspector.d.ts +3 -0
- package/dist/agent-plugins/react/components/AgentPluginInspector.js +11 -0
- package/dist/agent-plugins/react/components/AgentPluginListPanel.d.ts +6 -0
- package/dist/agent-plugins/react/components/AgentPluginListPanel.js +10 -0
- package/dist/agent-plugins/react/components/AgentPluginRow.d.ts +5 -0
- package/dist/agent-plugins/react/components/AgentPluginRow.js +8 -0
- package/dist/agent-plugins/react/hooks/AgentPluginInspector.hooks.d.ts +90 -0
- package/dist/agent-plugins/react/hooks/AgentPluginInspector.hooks.js +74 -0
- package/dist/agent-plugins/react/hooks/AgentPluginPanel.hooks.d.ts +67 -0
- package/dist/agent-plugins/react/hooks/AgentPluginPanel.hooks.js +50 -0
- package/dist/agent-plugins/react/hooks/AgentPluginRow.hooks.d.ts +55 -0
- package/dist/agent-plugins/react/hooks/AgentPluginRow.hooks.js +6 -0
- package/dist/agent-plugins/react/hooks/AgentPluginsPage.hooks.d.ts +64 -0
- package/dist/agent-plugins/react/hooks/AgentPluginsPage.hooks.js +39 -0
- package/dist/agent-plugins/react/hooks/AgentPluginsPorts.hooks.d.ts +7 -0
- package/dist/agent-plugins/react/hooks/AgentPluginsPorts.hooks.js +10 -0
- package/dist/agent-plugins/react/hooks/MarketplaceTab.hooks.d.ts +6 -0
- package/dist/agent-plugins/react/hooks/MarketplaceTab.hooks.js +3 -0
- package/dist/agent-plugins/react/index.d.ts +245 -0
- package/dist/agent-plugins/react/index.js +13 -0
- package/dist/agent-plugins/react/pages/AgentPluginsPage.d.ts +4 -0
- package/dist/agent-plugins/react/pages/AgentPluginsPage.js +12 -0
- package/dist/agent-plugins/react/tabs/DownloadedTab.d.ts +4 -0
- package/dist/agent-plugins/react/tabs/DownloadedTab.js +5 -0
- package/dist/agent-plugins/react/tabs/InstalledTab.d.ts +4 -0
- package/dist/agent-plugins/react/tabs/InstalledTab.js +5 -0
- package/dist/agent-plugins/react/tabs/MarketplaceTab.d.ts +4 -0
- package/dist/agent-plugins/react/tabs/MarketplaceTab.js +10 -0
- package/dist/agent-plugins/rules.d.ts +33 -0
- package/dist/agent-plugins/rules.js +51 -0
- package/dist/browser/index.d.ts +1 -0
- package/dist/browser/index.js +1 -0
- package/dist/browser/navigation.d.ts +19 -4
- package/dist/browser/navigation.js +8 -8
- package/dist/browser/shell-navigation.d.ts +12 -0
- package/dist/browser/shell-navigation.js +16 -0
- package/dist/contracts/credential-management.d.ts +8 -0
- package/dist/contracts/credential-management.js +3 -0
- package/dist/contracts/media-picker.d.ts +17 -0
- package/dist/contracts/media-picker.js +5 -0
- package/dist/contracts/playground-render-target.d.ts +18 -0
- package/dist/contracts/playground-render-target.js +3 -0
- package/dist/core/entities/rules.d.ts +138 -0
- package/dist/core/entities/rules.js +344 -0
- package/dist/core/gated/types.d.ts +8 -4
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.js +1 -0
- package/dist/core/manifest/rules.d.ts +24 -6
- package/dist/core/manifest/rules.js +12 -11
- package/dist/core/module/controller-store.d.ts +22 -0
- package/dist/core/module/controller-store.js +32 -0
- package/dist/core/module/create-admin.d.ts +41 -0
- package/dist/core/module/create-admin.js +187 -0
- package/dist/core/module/define-admin-module.d.ts +4 -0
- package/dist/core/module/define-admin-module.js +5 -0
- package/dist/core/module/index.d.ts +7 -0
- package/dist/core/module/index.js +4 -0
- package/dist/core/module/token.d.ts +19 -0
- package/dist/core/module/token.js +4 -0
- package/dist/core/module/types.d.ts +79 -0
- package/dist/core/module/types.js +2 -0
- package/dist/core/permissions/rules.d.ts +4 -1
- package/dist/core/permissions/rules.js +1 -1
- package/dist/core/ports/analytics.d.ts +1 -1
- package/dist/core/ports/auth.d.ts +2 -2
- package/dist/core/ports/comments.d.ts +9 -6
- package/dist/core/ports/database.d.ts +13 -10
- package/dist/core/ports/entities.d.ts +302 -0
- package/dist/core/ports/entities.js +47 -0
- package/dist/core/ports/forms.d.ts +19 -7
- package/dist/core/ports/identity.d.ts +42 -17
- package/dist/core/ports/index.d.ts +2 -0
- package/dist/core/ports/integrations.d.ts +9 -4
- package/dist/core/ports/media.d.ts +16 -7
- package/dist/core/ports/members.d.ts +7 -3
- package/dist/core/ports/menus.d.ts +43 -0
- package/dist/core/ports/menus.js +43 -0
- package/dist/core/ports/plugins.d.ts +3 -2
- package/dist/core/ports/recovery.d.ts +10 -6
- package/dist/core/ports/redirects.d.ts +17 -7
- package/dist/core/ports/seo.d.ts +12 -6
- package/dist/core/ports/shell.d.ts +41 -0
- package/dist/core/ports/shell.js +2 -0
- package/dist/core/ports/workspace.d.ts +3 -3
- package/dist/core/routing/rules.d.ts +17 -4
- package/dist/core/routing/rules.js +4 -4
- package/dist/core/transport/errors.d.ts +13 -4
- package/dist/core/transport/errors.js +4 -4
- package/dist/core/transport/http.d.ts +26 -16
- package/dist/core/transport/http.js +59 -21
- package/dist/core/transport/types.d.ts +26 -14
- package/dist/core/transport/types.js +9 -7
- package/dist/media/adapters/http.d.ts +27 -0
- package/dist/media/adapters/http.js +44 -0
- package/dist/media/adapters/memory.d.ts +11 -0
- package/dist/media/adapters/memory.js +139 -0
- package/dist/media/conformance/media-api.conformance.d.ts +7 -0
- package/dist/media/conformance/media-api.conformance.js +69 -0
- package/dist/media/controllers/edit-media.controller.d.ts +24 -0
- package/dist/media/controllers/edit-media.controller.js +69 -0
- package/dist/media/controllers/library.controller.d.ts +47 -0
- package/dist/media/controllers/library.controller.js +173 -0
- package/dist/media/controllers/providers.controller.d.ts +30 -0
- package/dist/media/controllers/providers.controller.js +76 -0
- package/dist/media/html-attributes.d.ts +82 -0
- package/dist/media/html-attributes.js +204 -0
- package/dist/media/index.d.ts +12 -0
- package/dist/media/index.js +9 -0
- package/dist/media/media.module.d.ts +83 -0
- package/dist/media/media.module.js +43 -0
- package/dist/media/messages.en.d.ts +24 -0
- package/dist/media/messages.en.js +24 -0
- package/dist/media/models.d.ts +72 -0
- package/dist/media/models.js +2 -0
- package/dist/media/ports.d.ts +75 -0
- package/dist/media/ports.js +7 -0
- package/dist/media/react/components/EditMediaPanel.d.ts +3 -0
- package/dist/media/react/components/EditMediaPanel.js +10 -0
- package/dist/media/react/components/MediaCard.d.ts +5 -0
- package/dist/media/react/components/MediaCard.js +17 -0
- package/dist/media/react/components/MediaDialog.d.ts +3 -0
- package/dist/media/react/components/MediaDialog.js +8 -0
- package/dist/media/react/components/MediaGrid.d.ts +4 -0
- package/dist/media/react/components/MediaGrid.js +8 -0
- package/dist/media/react/components/MediaIcons.d.ts +14 -0
- package/dist/media/react/components/MediaIcons.js +39 -0
- package/dist/media/react/components/MediaLightbox.d.ts +5 -0
- package/dist/media/react/components/MediaLightbox.js +12 -0
- package/dist/media/react/components/MediaPicker.d.ts +3 -0
- package/dist/media/react/components/MediaPicker.js +10 -0
- package/dist/media/react/components/MediaPurgeDialog.d.ts +4 -0
- package/dist/media/react/components/MediaPurgeDialog.js +9 -0
- package/dist/media/react/components/UploadButton.d.ts +3 -0
- package/dist/media/react/components/UploadButton.js +8 -0
- package/dist/media/react/hooks/EditMediaPanel.hooks.d.ts +84 -0
- package/dist/media/react/hooks/EditMediaPanel.hooks.js +105 -0
- package/dist/media/react/hooks/LibraryTab.hooks.d.ts +103 -0
- package/dist/media/react/hooks/LibraryTab.hooks.js +164 -0
- package/dist/media/react/hooks/MediaCard.hooks.d.ts +79 -0
- package/dist/media/react/hooks/MediaCard.hooks.js +63 -0
- package/dist/media/react/hooks/MediaDialog.hooks.d.ts +10 -0
- package/dist/media/react/hooks/MediaDialog.hooks.js +20 -0
- package/dist/media/react/hooks/MediaGrid.hooks.d.ts +28 -0
- package/dist/media/react/hooks/MediaGrid.hooks.js +6 -0
- package/dist/media/react/hooks/MediaLightbox.hooks.d.ts +27 -0
- package/dist/media/react/hooks/MediaLightbox.hooks.js +64 -0
- package/dist/media/react/hooks/MediaPage.hooks.d.ts +68 -0
- package/dist/media/react/hooks/MediaPage.hooks.js +68 -0
- package/dist/media/react/hooks/MediaPicker.hooks.d.ts +26 -0
- package/dist/media/react/hooks/MediaPicker.hooks.js +25 -0
- package/dist/media/react/hooks/MediaPorts.hooks.d.ts +9 -0
- package/dist/media/react/hooks/MediaPorts.hooks.js +10 -0
- package/dist/media/react/hooks/MediaPurgeDialog.hooks.d.ts +22 -0
- package/dist/media/react/hooks/MediaPurgeDialog.hooks.js +6 -0
- package/dist/media/react/hooks/ProvidersTab.hooks.d.ts +55 -0
- package/dist/media/react/hooks/ProvidersTab.hooks.js +124 -0
- package/dist/media/react/hooks/UploadButton.hooks.d.ts +48 -0
- package/dist/media/react/hooks/UploadButton.hooks.js +118 -0
- package/dist/media/react/index.d.ts +373 -0
- package/dist/media/react/index.js +73 -0
- package/dist/media/react/pages/MediaPage.d.ts +4 -0
- package/dist/media/react/pages/MediaPage.js +9 -0
- package/dist/media/react/tabs/LibraryTab.d.ts +4 -0
- package/dist/media/react/tabs/LibraryTab.js +14 -0
- package/dist/media/react/tabs/ProvidersTab.d.ts +4 -0
- package/dist/media/react/tabs/ProvidersTab.js +10 -0
- package/dist/media/rules.d.ts +80 -0
- package/dist/media/rules.js +127 -0
- package/dist/media/styles.d.ts +4 -0
- package/dist/media/styles.js +5 -0
- package/dist/playground/adapters/http.d.ts +8 -0
- package/dist/playground/adapters/http.js +4 -0
- package/dist/playground/adapters/memory.d.ts +10 -0
- package/dist/playground/adapters/memory.js +30 -0
- package/dist/playground/conformance/playground-api.conformance.d.ts +6 -0
- package/dist/playground/conformance/playground-api.conformance.js +37 -0
- package/dist/playground/controllers/playground.controller.d.ts +16 -0
- package/dist/playground/controllers/playground.controller.js +21 -0
- package/dist/playground/index.d.ts +7 -0
- package/dist/playground/index.js +5 -0
- package/dist/playground/messages.en.d.ts +9 -0
- package/dist/playground/messages.en.js +2 -0
- package/dist/playground/models.d.ts +4 -0
- package/dist/playground/models.js +2 -0
- package/dist/playground/playground.module.d.ts +31 -0
- package/dist/playground/playground.module.js +5 -0
- package/dist/playground/ports.d.ts +5 -0
- package/dist/playground/ports.js +2 -0
- package/dist/playground/react/components/Canvas.d.ts +3 -0
- package/dist/playground/react/components/Canvas.js +9 -0
- package/dist/playground/react/hooks/Canvas.hooks.d.ts +7 -0
- package/dist/playground/react/hooks/Canvas.hooks.js +18 -0
- package/dist/playground/react/hooks/PlaygroundPage.hooks.d.ts +8 -0
- package/dist/playground/react/hooks/PlaygroundPage.hooks.js +2 -0
- package/dist/playground/react/hooks/PlaygroundPorts.hooks.d.ts +4 -0
- package/dist/playground/react/hooks/PlaygroundPorts.hooks.js +6 -0
- package/dist/playground/react/index.d.ts +136 -0
- package/dist/playground/react/index.js +10 -0
- package/dist/playground/react/pages/PlaygroundPage.d.ts +4 -0
- package/dist/playground/react/pages/PlaygroundPage.js +11 -0
- package/dist/playground/react/tabs/CanvasTab.d.ts +4 -0
- package/dist/playground/react/tabs/CanvasTab.js +5 -0
- package/dist/playground/rules.d.ts +4 -0
- package/dist/playground/rules.js +2 -0
- package/dist/react/OverlayHost.d.ts +3 -0
- package/dist/react/OverlayHost.hooks.d.ts +9 -0
- package/dist/react/OverlayHost.hooks.js +9 -0
- package/dist/react/OverlayHost.js +7 -0
- package/dist/react/bind-react.d.ts +46 -0
- package/dist/react/bind-react.js +28 -0
- package/dist/react/components/ConfirmButton/ConfirmButton.hooks.d.ts +7 -1
- package/dist/react/components/ConfirmButton/ConfirmButton.hooks.js +2 -2
- package/dist/react/components/ConfirmButton/ConfirmButton.js +1 -1
- package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.d.ts +17 -3
- package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.js +3 -3
- package/dist/react/components/ConfirmDialog/ConfirmDialog.js +5 -5
- package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.d.ts +6 -2
- package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.js +7 -8
- package/dist/react/components/RowMenu/RowMenu.d.ts +5 -1
- package/dist/react/components/RowMenu/RowMenu.hooks.d.ts +8 -2
- package/dist/react/components/RowMenu/RowMenu.hooks.js +4 -4
- package/dist/react/components/RowMenu/RowMenu.js +6 -6
- package/dist/react/components/Sidebar.d.ts +1 -1
- package/dist/react/components/Sidebar.js +103 -7
- package/dist/react/entities/EntityCell.d.ts +10 -0
- package/dist/react/entities/EntityCell.js +18 -0
- package/dist/react/entities/EntityDetail.d.ts +3 -0
- package/dist/react/entities/EntityDetail.js +21 -0
- package/dist/react/entities/EntityEdit.d.ts +13 -0
- package/dist/react/entities/EntityEdit.js +45 -0
- package/dist/react/entities/EntityField.d.ts +20 -0
- package/dist/react/entities/EntityField.js +31 -0
- package/dist/react/entities/EntityIndex.d.ts +3 -0
- package/dist/react/entities/EntityIndex.js +10 -0
- package/dist/react/entities/EntityList.d.ts +7 -0
- package/dist/react/entities/EntityList.js +52 -0
- package/dist/react/entities/contribution.d.ts +26 -0
- package/dist/react/entities/contribution.js +78 -0
- package/dist/react/entities/index.d.ts +10 -0
- package/dist/react/entities/index.js +7 -0
- package/dist/react/entities/rules.d.ts +179 -0
- package/dist/react/entities/rules.js +224 -0
- package/dist/react/entities/types.d.ts +45 -0
- package/dist/react/entities/types.js +5 -0
- package/dist/react/entities/use-entity-edit.d.ts +35 -0
- package/dist/react/entities/use-entity-edit.js +98 -0
- package/dist/react/entities/use-entity-read.d.ts +22 -0
- package/dist/react/entities/use-entity-read.js +27 -0
- package/dist/react/hooks/use-nav-sections.d.ts +12 -3
- package/dist/react/hooks/use-nav-sections.js +14 -14
- package/dist/react/hooks/use-sidebar-rail.d.ts +7 -1
- package/dist/react/hooks/use-sidebar-rail.js +11 -11
- package/dist/react/index.d.ts +3 -1
- package/dist/react/index.js +5 -2
- package/dist/react/kit/Kit.hooks.d.ts +13 -0
- package/dist/react/kit/Kit.hooks.js +10 -0
- package/dist/react/kit/Native.hooks.d.ts +38 -0
- package/dist/react/kit/Native.hooks.js +65 -0
- package/dist/react/kit/index.d.ts +12 -0
- package/dist/react/kit/index.js +21 -0
- package/dist/react/kit/native.d.ts +3 -0
- package/dist/react/kit/native.js +21 -0
- package/dist/react/kit/types.d.ts +40 -0
- package/dist/react/kit/types.js +2 -0
- package/dist/react/overlay.d.ts +36 -0
- package/dist/react/overlay.js +35 -0
- package/dist/react/overlays.d.ts +38 -0
- package/dist/react/overlays.js +46 -0
- package/dist/react/shell/AdminShell.d.ts +9 -0
- package/dist/react/shell/AdminShell.hooks.d.ts +15 -0
- package/dist/react/shell/AdminShell.hooks.js +27 -0
- package/dist/react/shell/AdminShell.js +46 -0
- package/dist/react/shell/index.d.ts +7 -0
- package/dist/react/shell/index.js +5 -0
- package/dist/react/shell/model.d.ts +25 -0
- package/dist/react/shell/model.js +29 -0
- package/dist/react/shell/theme-ports.d.ts +28 -0
- package/dist/react/shell/theme-ports.js +2 -0
- package/dist/react/shell/types.d.ts +99 -0
- package/dist/react/shell/types.js +2 -0
- package/dist/react/shell/use-admin-shell-session.d.ts +13 -0
- package/dist/react/shell/use-admin-shell-session.js +81 -0
- package/dist/react/shell/use-admin-theme.d.ts +16 -0
- package/dist/react/shell/use-admin-theme.js +57 -0
- package/dist/react/types.d.ts +6 -4
- package/dist/react/types.js +2 -2
- package/dist/react/use-controller.d.ts +16 -0
- package/dist/react/use-controller.js +18 -0
- package/dist/security/adapters/http.d.ts +16 -0
- package/dist/security/adapters/http.js +94 -0
- package/dist/security/adapters/memory.d.ts +15 -0
- package/dist/security/adapters/memory.js +60 -0
- package/dist/security/conformance/security-api.conformance.d.ts +10 -0
- package/dist/security/conformance/security-api.conformance.js +48 -0
- package/dist/security/controllers/access-tokens.controller.d.ts +44 -0
- package/dist/security/controllers/access-tokens.controller.js +112 -0
- package/dist/security/controllers/other-credentials.controller.d.ts +30 -0
- package/dist/security/controllers/other-credentials.controller.js +74 -0
- package/dist/security/controllers/root-key.controller.d.ts +35 -0
- package/dist/security/controllers/root-key.controller.js +90 -0
- package/dist/security/index.d.ts +9 -0
- package/dist/security/index.js +9 -0
- package/dist/security/messages.en.d.ts +12 -0
- package/dist/security/messages.en.js +2 -0
- package/dist/security/models.d.ts +112 -0
- package/dist/security/models.js +2 -0
- package/dist/security/ports.d.ts +58 -0
- package/dist/security/ports.js +5 -0
- package/dist/security/react/components/CredentialEditor.d.ts +3 -0
- package/dist/security/react/components/CredentialEditor.js +8 -0
- package/dist/security/react/hooks/AccessTokensTab.hooks.d.ts +94 -0
- package/dist/security/react/hooks/AccessTokensTab.hooks.js +36 -0
- package/dist/security/react/hooks/CredentialEditor.hooks.d.ts +49 -0
- package/dist/security/react/hooks/CredentialEditor.hooks.js +14 -0
- package/dist/security/react/hooks/RootKeyTab.hooks.d.ts +29 -0
- package/dist/security/react/hooks/RootKeyTab.hooks.js +19 -0
- package/dist/security/react/hooks/SecurityPage.hooks.d.ts +17 -0
- package/dist/security/react/hooks/SecurityPage.hooks.js +12 -0
- package/dist/security/react/hooks/SecurityPorts.hooks.d.ts +9 -0
- package/dist/security/react/hooks/SecurityPorts.hooks.js +6 -0
- package/dist/security/react/index.d.ts +215 -0
- package/dist/security/react/index.js +10 -0
- package/dist/security/react/pages/SecurityPage.d.ts +4 -0
- package/dist/security/react/pages/SecurityPage.js +10 -0
- package/dist/security/react/tabs/AccessTokensTab.d.ts +4 -0
- package/dist/security/react/tabs/AccessTokensTab.js +10 -0
- package/dist/security/react/tabs/RootKeyTab.d.ts +4 -0
- package/dist/security/react/tabs/RootKeyTab.js +9 -0
- package/dist/security/rules.d.ts +57 -0
- package/dist/security/rules.js +63 -0
- package/dist/security/security.module.d.ts +45 -0
- package/dist/security/security.module.js +5 -0
- package/dist/source-control/adapters/http.d.ts +6 -0
- package/dist/source-control/adapters/http.js +13 -0
- package/dist/source-control/adapters/memory.d.ts +9 -0
- package/dist/source-control/adapters/memory.js +35 -0
- package/dist/source-control/conformance/source-control-api.conformance.d.ts +10 -0
- package/dist/source-control/conformance/source-control-api.conformance.js +48 -0
- package/dist/source-control/controllers/source-control.controller.d.ts +26 -0
- package/dist/source-control/controllers/source-control.controller.js +70 -0
- package/dist/source-control/index.d.ts +8 -0
- package/dist/source-control/index.js +6 -0
- package/dist/source-control/messages.en.d.ts +11 -0
- package/dist/source-control/messages.en.js +2 -0
- package/dist/source-control/models.d.ts +70 -0
- package/dist/source-control/models.js +2 -0
- package/dist/source-control/ports.d.ts +23 -0
- package/dist/source-control/ports.js +3 -0
- package/dist/source-control/react/components/SourceControlCredentialFields.d.ts +5 -0
- package/dist/source-control/react/components/SourceControlCredentialFields.js +8 -0
- package/dist/source-control/react/components/SourceControlProviderRow.d.ts +5 -0
- package/dist/source-control/react/components/SourceControlProviderRow.js +7 -0
- package/dist/source-control/react/hooks/ProvidersTab.hooks.d.ts +45 -0
- package/dist/source-control/react/hooks/ProvidersTab.hooks.js +20 -0
- package/dist/source-control/react/hooks/SourceControlCredentialFields.hooks.d.ts +43 -0
- package/dist/source-control/react/hooks/SourceControlCredentialFields.hooks.js +9 -0
- package/dist/source-control/react/hooks/SourceControlPage.hooks.d.ts +17 -0
- package/dist/source-control/react/hooks/SourceControlPage.hooks.js +5 -0
- package/dist/source-control/react/hooks/SourceControlPorts.hooks.d.ts +9 -0
- package/dist/source-control/react/hooks/SourceControlPorts.hooks.js +6 -0
- package/dist/source-control/react/index.d.ts +156 -0
- package/dist/source-control/react/index.js +10 -0
- package/dist/source-control/react/pages/SourceControlPage.d.ts +4 -0
- package/dist/source-control/react/pages/SourceControlPage.js +11 -0
- package/dist/source-control/react/tabs/ProvidersTab.d.ts +4 -0
- package/dist/source-control/react/tabs/ProvidersTab.js +10 -0
- package/dist/source-control/rules.d.ts +32 -0
- package/dist/source-control/rules.js +35 -0
- package/dist/source-control/source-control.module.d.ts +36 -0
- package/dist/source-control/source-control.module.js +6 -0
- package/package.json +207 -4
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
export class AdminConfigError extends Error {
|
|
2
|
+
issues;
|
|
3
|
+
constructor({ issues }, _optional = {}) {
|
|
4
|
+
super(`Invalid admin configuration:\n${issues.map((issue) => `- ${issue}`).join('\n')}`);
|
|
5
|
+
this.name = 'AdminConfigError';
|
|
6
|
+
this.issues = Object.freeze([...issues]);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export function createAdmin({ modules, ports, }, options = {}) {
|
|
10
|
+
const issues = [];
|
|
11
|
+
const tokens = new Map();
|
|
12
|
+
const identities = new Map();
|
|
13
|
+
const providers = new Map();
|
|
14
|
+
const ids = new Set(), paths = new Set(), tabIds = new Set();
|
|
15
|
+
const requiredNames = new Set();
|
|
16
|
+
const host = ports;
|
|
17
|
+
const values = { ...host };
|
|
18
|
+
const omitted = new Set(options.omit ?? []);
|
|
19
|
+
const grants = new Set(options.permissions ?? []);
|
|
20
|
+
const allowed = (permissions = []) => permissions.every((p) => grants.has(p));
|
|
21
|
+
function collect(map = {}, required = false) {
|
|
22
|
+
for (const [name, tok] of Object.entries(map)) {
|
|
23
|
+
const old = tokens.get(name);
|
|
24
|
+
if (!tok.id || tok.cardinality !== 'one' || !Number.isInteger(tok.version) || tok.version < 1)
|
|
25
|
+
issues.push(`Invalid token: ${name}`);
|
|
26
|
+
if (old && (old.id !== tok.id || old.version !== tok.version))
|
|
27
|
+
issues.push(`Incompatible token: ${name}`);
|
|
28
|
+
const alias = identities.get(tok.id);
|
|
29
|
+
if (alias && alias !== name)
|
|
30
|
+
issues.push(`Token ${tok.id} has conflicting names: ${alias}, ${name}`);
|
|
31
|
+
identities.set(tok.id, name);
|
|
32
|
+
tokens.set(name, tok);
|
|
33
|
+
if (required)
|
|
34
|
+
requiredNames.add(name);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
for (const module of modules) {
|
|
38
|
+
if (ids.has(module.id))
|
|
39
|
+
issues.push(`Duplicate module: ${module.id}`);
|
|
40
|
+
ids.add(module.id);
|
|
41
|
+
collect(module.requires, true);
|
|
42
|
+
collect(module.optional);
|
|
43
|
+
collect(module.provides);
|
|
44
|
+
for (const name of Object.keys(module.provides ?? {})) {
|
|
45
|
+
if (providers.has(name))
|
|
46
|
+
issues.push(`Duplicate provider: ${name}`);
|
|
47
|
+
providers.set(name, module);
|
|
48
|
+
if (host[name] != null &&
|
|
49
|
+
!options.overrides?.includes(name))
|
|
50
|
+
issues.push(`Provider collision: ${name}; declare an override`);
|
|
51
|
+
if (!module.factories?.[name] && host[name] == null)
|
|
52
|
+
issues.push(`Missing provider factory: ${name}`);
|
|
53
|
+
}
|
|
54
|
+
for (const name of Object.keys(module.factories ?? {}))
|
|
55
|
+
if (!(name in (module.provides ?? {})))
|
|
56
|
+
issues.push(`Undeclared provider factory: ${name}`);
|
|
57
|
+
for (const [pageId, page] of Object.entries(module.pages)) {
|
|
58
|
+
if (paths.has(page.path))
|
|
59
|
+
issues.push(`Duplicate route: ${page.path}`);
|
|
60
|
+
paths.add(page.path);
|
|
61
|
+
for (const [tabId, tab] of Object.entries(page.tabs)) {
|
|
62
|
+
const full = `${module.id}.${pageId}.${tabId}`;
|
|
63
|
+
tabIds.add(full);
|
|
64
|
+
collect(tab.requires, !omitted.has(full));
|
|
65
|
+
collect(tab.optional);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
for (const id of omitted)
|
|
70
|
+
if (!tabIds.has(id))
|
|
71
|
+
issues.push(`Unknown tab: ${id}`);
|
|
72
|
+
for (const name of options.overrides ?? [])
|
|
73
|
+
if (!providers.has(String(name)))
|
|
74
|
+
issues.push(`Unknown provider override: ${String(name)}`);
|
|
75
|
+
for (const name of Object.keys(host))
|
|
76
|
+
if (!tokens.has(name))
|
|
77
|
+
issues.push(`Unknown port: ${name}`);
|
|
78
|
+
for (const name of requiredNames)
|
|
79
|
+
if (host[name] == null && !providers.has(name))
|
|
80
|
+
issues.push(`Missing port: ${name}`);
|
|
81
|
+
// Validate the graph before executing factories, so a boot error has no partial side effects.
|
|
82
|
+
const sorted = [], visiting = new Set(), visited = new Set();
|
|
83
|
+
function visit(name, chain) {
|
|
84
|
+
if (visited.has(name) || host[name] != null)
|
|
85
|
+
return;
|
|
86
|
+
if (visiting.has(name)) {
|
|
87
|
+
issues.push(`Provider cycle: ${[...chain, name].join(' -> ')}`);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
visiting.add(name);
|
|
91
|
+
const module = providers.get(name);
|
|
92
|
+
for (const dep of Object.keys(dependencies(module)))
|
|
93
|
+
if (providers.has(dep))
|
|
94
|
+
visit(dep, [...chain, name]);
|
|
95
|
+
visiting.delete(name);
|
|
96
|
+
visited.add(name);
|
|
97
|
+
sorted.push(name);
|
|
98
|
+
}
|
|
99
|
+
for (const name of providers.keys())
|
|
100
|
+
visit(name, []);
|
|
101
|
+
if (issues.length)
|
|
102
|
+
throw new AdminConfigError({ issues: [...new Set(issues)] });
|
|
103
|
+
const disposables = [];
|
|
104
|
+
function dependencies(module) {
|
|
105
|
+
const tabPorts = Object.values(module.pages)
|
|
106
|
+
.flatMap((page) => Object.values(page.tabs))
|
|
107
|
+
.reduce((result, tab) => ({ ...result, ...tab.requires, ...tab.optional }), {});
|
|
108
|
+
return { ...module.requires, ...module.optional, ...tabPorts };
|
|
109
|
+
}
|
|
110
|
+
function narrow(module) {
|
|
111
|
+
return Object.freeze(Object.fromEntries(Object.keys(dependencies(module)).map((name) => [name, values[name]])));
|
|
112
|
+
}
|
|
113
|
+
try {
|
|
114
|
+
for (const name of sorted) {
|
|
115
|
+
const value = providers.get(name).factories[name]({ ports: narrow(providers.get(name)), permissions: [...grants] }, {});
|
|
116
|
+
if (value == null)
|
|
117
|
+
throw new Error(`Provider returned no value: ${name}`);
|
|
118
|
+
values[name] = value;
|
|
119
|
+
if (typeof value === 'object' && 'dispose' in value && typeof value.dispose === 'function')
|
|
120
|
+
disposables.push(value);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
for (const value of disposables.reverse())
|
|
125
|
+
value.dispose();
|
|
126
|
+
throw new AdminConfigError({
|
|
127
|
+
issues: [error instanceof Error ? error.message : 'Provider initialization failed'],
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
const description = Object.freeze({
|
|
131
|
+
modules: Object.freeze([...ids]),
|
|
132
|
+
pages: Object.freeze(modules.flatMap((module) => Object.entries(module.pages).map(([id, page]) => ({
|
|
133
|
+
id: `${module.id}.${id}`,
|
|
134
|
+
path: page.path,
|
|
135
|
+
label: page.label,
|
|
136
|
+
visible: allowed(page.permissions),
|
|
137
|
+
agentReachable: page.agentReachable === true && allowed(page.permissions),
|
|
138
|
+
permissions: page.permissions ?? [],
|
|
139
|
+
grants: Object.freeze([...grants]),
|
|
140
|
+
...(page.nav ? { nav: page.nav } : {}),
|
|
141
|
+
tabs: Object.entries(page.tabs).map(([tabId, tab]) => {
|
|
142
|
+
const full = `${module.id}.${id}.${tabId}`;
|
|
143
|
+
const absent = Object.keys(tab.optional ?? {}).find((name) => values[name] == null);
|
|
144
|
+
const reason = omitted.has(full)
|
|
145
|
+
? 'omitted'
|
|
146
|
+
: !allowed(page.permissions) || !allowed(tab.permissions)
|
|
147
|
+
? 'permission denied'
|
|
148
|
+
: absent
|
|
149
|
+
? `optional port unavailable: ${absent}`
|
|
150
|
+
: null;
|
|
151
|
+
return {
|
|
152
|
+
id: full,
|
|
153
|
+
label: tab.label,
|
|
154
|
+
visible: reason === null,
|
|
155
|
+
reason,
|
|
156
|
+
params: tab.params ?? {},
|
|
157
|
+
agentReachable: reason === null && page.agentReachable === true && tab.agentReachable === true,
|
|
158
|
+
};
|
|
159
|
+
}),
|
|
160
|
+
})))),
|
|
161
|
+
ports: Object.freeze([...tokens]
|
|
162
|
+
.filter(([name]) => values[name] != null)
|
|
163
|
+
.map(([name, tok]) => ({
|
|
164
|
+
name,
|
|
165
|
+
token: tok.id,
|
|
166
|
+
version: tok.version,
|
|
167
|
+
source: host[name] != null ? 'host' : 'module',
|
|
168
|
+
}))),
|
|
169
|
+
});
|
|
170
|
+
let disposed = false;
|
|
171
|
+
return {
|
|
172
|
+
describe: () => description,
|
|
173
|
+
scope: ({ module }) => {
|
|
174
|
+
if (disposed || !modules.includes(module))
|
|
175
|
+
throw new AdminConfigError({ issues: [`Module scope unavailable: ${module.id}`] });
|
|
176
|
+
return narrow(module);
|
|
177
|
+
},
|
|
178
|
+
dispose: () => {
|
|
179
|
+
if (!disposed) {
|
|
180
|
+
disposed = true;
|
|
181
|
+
for (const value of disposables.reverse())
|
|
182
|
+
value.dispose();
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
//# sourceMappingURL=create-admin.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AdminModule } from './types.js';
|
|
2
|
+
/** Definition is data only; boot validates identities before any factory runs. */
|
|
3
|
+
export declare function defineAdminModule<const M extends AdminModule>(required: M, _optional?: Record<string, never>): M;
|
|
4
|
+
//# sourceMappingURL=define-admin-module.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { adminPort } from './token.js';
|
|
2
|
+
export type { AdminPortToken, PortMap, PortValues } from './token.js';
|
|
3
|
+
export { defineAdminModule } from './define-admin-module.js';
|
|
4
|
+
export { createAdmin, AdminConfigError } from './create-admin.js';
|
|
5
|
+
export type { AdminHostPorts, AdminOptions } from './create-admin.js';
|
|
6
|
+
export type { AdminModule, AdminPage, AdminTab, AdminInstance, AdminDescription, ScopedPorts, TabId, } from './types.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Structurally compatible with @jini-ai/core's singleton Token<T, Id>.
|
|
2
|
+
* Admin currently has no core dependency or core/token export to reuse. Keep the same
|
|
3
|
+
* named/versioned wire identity without adding an undeclared runtime dependency. */
|
|
4
|
+
export interface AdminPortToken<T = unknown, Id extends string = string> {
|
|
5
|
+
readonly id: Id;
|
|
6
|
+
readonly version: number;
|
|
7
|
+
readonly cardinality: 'one';
|
|
8
|
+
readonly __type?: T;
|
|
9
|
+
}
|
|
10
|
+
export declare function adminPort<T, const Id extends string = string>({ id }: {
|
|
11
|
+
id: Id;
|
|
12
|
+
}, { version }?: {
|
|
13
|
+
version?: number;
|
|
14
|
+
}): AdminPortToken<T, Id>;
|
|
15
|
+
export type PortMap = Readonly<Record<string, AdminPortToken>>;
|
|
16
|
+
export type PortValues<P extends PortMap> = {
|
|
17
|
+
readonly [K in keyof P]: P[K] extends AdminPortToken<infer T> ? T : never;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=token.d.ts.map
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { PortMap, PortValues } from './token.js';
|
|
2
|
+
export interface AdminTab {
|
|
3
|
+
readonly label: string;
|
|
4
|
+
readonly params?: Readonly<Record<string, unknown>>;
|
|
5
|
+
readonly requires?: PortMap;
|
|
6
|
+
/** A tab depending on an unwired optional port is hidden, with a reason in describe(). */
|
|
7
|
+
readonly optional?: PortMap;
|
|
8
|
+
readonly permissions?: readonly string[];
|
|
9
|
+
readonly agentReachable?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface AdminPage {
|
|
12
|
+
readonly path: string;
|
|
13
|
+
readonly label: string;
|
|
14
|
+
readonly nav?: {
|
|
15
|
+
readonly group: string;
|
|
16
|
+
readonly icon?: string;
|
|
17
|
+
};
|
|
18
|
+
readonly permissions?: readonly string[];
|
|
19
|
+
readonly agentReachable?: boolean;
|
|
20
|
+
readonly tabs: Readonly<Record<string, AdminTab>>;
|
|
21
|
+
}
|
|
22
|
+
export interface AdminModule {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly requires?: PortMap;
|
|
25
|
+
readonly optional?: PortMap;
|
|
26
|
+
readonly provides?: PortMap;
|
|
27
|
+
readonly pages: Readonly<Record<string, AdminPage>>;
|
|
28
|
+
readonly messages?: Readonly<Record<string, string>>;
|
|
29
|
+
readonly factories?: Readonly<Record<string, (required: {
|
|
30
|
+
ports: Readonly<Record<string, unknown>>;
|
|
31
|
+
permissions: readonly string[];
|
|
32
|
+
}, optional?: Record<string, never>) => unknown>>;
|
|
33
|
+
}
|
|
34
|
+
type Intersect<U> = (U extends unknown ? (value: U) => void : never) extends (value: infer I) => void ? I : never;
|
|
35
|
+
type TabPortValues<M extends AdminModule> = {
|
|
36
|
+
[P in keyof M['pages']]: {
|
|
37
|
+
[T in keyof M['pages'][P]['tabs']]: M['pages'][P]['tabs'][T] extends infer Tab ? Tab extends AdminTab ? PortValues<NonNullable<Tab['requires']>> & PortValues<NonNullable<Tab['optional']>> : {} : never;
|
|
38
|
+
}[keyof M['pages'][P]['tabs']];
|
|
39
|
+
}[keyof M['pages']];
|
|
40
|
+
export type ScopedPorts<M extends AdminModule> = PortValues<NonNullable<M['requires']>> & Partial<PortValues<NonNullable<M['optional']>> & Intersect<TabPortValues<M>>>;
|
|
41
|
+
export type TabId<M extends AdminModule> = M extends unknown ? {
|
|
42
|
+
[P in keyof M['pages'] & string]: `${M['id']}.${P}.${keyof M['pages'][P]['tabs'] & string}`;
|
|
43
|
+
}[keyof M['pages'] & string] : never;
|
|
44
|
+
export interface AdminDescription {
|
|
45
|
+
readonly modules: readonly string[];
|
|
46
|
+
readonly pages: readonly {
|
|
47
|
+
id: string;
|
|
48
|
+
path: string;
|
|
49
|
+
label: string;
|
|
50
|
+
visible: boolean;
|
|
51
|
+
agentReachable: boolean;
|
|
52
|
+
permissions: readonly string[];
|
|
53
|
+
grants: readonly string[];
|
|
54
|
+
nav?: AdminPage['nav'];
|
|
55
|
+
tabs: readonly {
|
|
56
|
+
id: string;
|
|
57
|
+
label: string;
|
|
58
|
+
visible: boolean;
|
|
59
|
+
reason: string | null;
|
|
60
|
+
params: Readonly<Record<string, unknown>>;
|
|
61
|
+
agentReachable: boolean;
|
|
62
|
+
}[];
|
|
63
|
+
}[];
|
|
64
|
+
readonly ports: readonly {
|
|
65
|
+
name: string;
|
|
66
|
+
token: string;
|
|
67
|
+
version: number;
|
|
68
|
+
source: 'host' | 'module';
|
|
69
|
+
}[];
|
|
70
|
+
}
|
|
71
|
+
export interface AdminInstance {
|
|
72
|
+
describe(required?: Record<string, never>, optional?: Record<string, never>): AdminDescription;
|
|
73
|
+
scope<M extends AdminModule>(required: {
|
|
74
|
+
module: M;
|
|
75
|
+
}, optional?: Record<string, never>): ScopedPorts<M>;
|
|
76
|
+
dispose(required?: Record<string, never>, optional?: Record<string, never>): void;
|
|
77
|
+
}
|
|
78
|
+
export {};
|
|
79
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -28,5 +28,8 @@
|
|
|
28
28
|
* @complexity O(n) array scan, n = `permissions.length` (a handful of grant strings for a real
|
|
29
29
|
* principal; never a caller-unbounded collection).
|
|
30
30
|
*/
|
|
31
|
-
export declare function hasPermission(permissions
|
|
31
|
+
export declare function hasPermission({ permissions, permission }: {
|
|
32
|
+
readonly permissions: readonly string[];
|
|
33
|
+
readonly permission: string;
|
|
34
|
+
}): boolean;
|
|
32
35
|
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
* @complexity O(n) array scan, n = `permissions.length` (a handful of grant strings for a real
|
|
29
29
|
* principal; never a caller-unbounded collection).
|
|
30
30
|
*/
|
|
31
|
-
export function hasPermission(permissions, permission) {
|
|
31
|
+
export function hasPermission({ permissions, permission }) {
|
|
32
32
|
return permissions.includes('*') || permissions.includes(permission);
|
|
33
33
|
}
|
|
34
34
|
//# sourceMappingURL=rules.js.map
|
|
@@ -28,7 +28,7 @@ export interface AdminAnalyticsPort {
|
|
|
28
28
|
/** `limit` bounds how many recent hits come back; omitting it defers to the host's own default
|
|
29
29
|
* bound rather than requesting an unbounded list — see the file header on why this is a recent
|
|
30
30
|
* activity feed, not a queryable store. */
|
|
31
|
-
listRecentAnalyticsHits(
|
|
31
|
+
listRecentAnalyticsHits(requiredArgs: Record<string, never>, optionalArgs?: {
|
|
32
32
|
limit?: number;
|
|
33
33
|
}): Promise<readonly AdminAnalyticsHit[]>;
|
|
34
34
|
}
|
|
@@ -30,7 +30,7 @@ export interface AdminAuthPort {
|
|
|
30
30
|
}): Promise<{
|
|
31
31
|
user: AdminAuthUser;
|
|
32
32
|
}>;
|
|
33
|
-
logout(): Promise<{
|
|
33
|
+
logout(requiredArgs: Record<string, never>): Promise<{
|
|
34
34
|
ok: boolean;
|
|
35
35
|
}>;
|
|
36
36
|
/**
|
|
@@ -41,7 +41,7 @@ export interface AdminAuthPort {
|
|
|
41
41
|
* entirely rather than send an empty array; callers should not treat "absent" and "empty" as the
|
|
42
42
|
* same thing.
|
|
43
43
|
*/
|
|
44
|
-
me(): Promise<{
|
|
44
|
+
me(requiredArgs: Record<string, never>): Promise<{
|
|
45
45
|
user: AdminAuthUser;
|
|
46
46
|
effectivePermissions?: readonly string[];
|
|
47
47
|
}>;
|
|
@@ -68,23 +68,26 @@ export interface CommentsSettings {
|
|
|
68
68
|
* fifth member of this union. */
|
|
69
69
|
export type CommentModerationAction = "approve" | "spam" | "trash" | "restore";
|
|
70
70
|
export interface AdminCommentsPort {
|
|
71
|
-
listCommentsQueue(
|
|
71
|
+
listCommentsQueue(requiredArgs: Record<string, never>, optionalArgs?: {
|
|
72
72
|
status?: CommentStatus;
|
|
73
73
|
cursor?: string;
|
|
74
74
|
limit?: number;
|
|
75
75
|
}): Promise<AdminCommentsQueuePage>;
|
|
76
76
|
/** See the file header: resolves to `void` even on success. */
|
|
77
|
-
moderateComment(
|
|
77
|
+
moderateComment(requiredArgs: {
|
|
78
|
+
commentId: string;
|
|
78
79
|
action: CommentModerationAction;
|
|
79
80
|
expectedVersion: number;
|
|
80
|
-
},
|
|
81
|
+
}, optionalArgs?: {
|
|
81
82
|
note?: string;
|
|
82
83
|
}): Promise<void>;
|
|
83
84
|
/** Hard delete, no version guard, separate permission — see the file header. */
|
|
84
|
-
purgeComment(
|
|
85
|
+
purgeComment(requiredArgs: {
|
|
86
|
+
commentId: string;
|
|
87
|
+
}, optionalArgs?: {
|
|
85
88
|
note?: string;
|
|
86
89
|
}): Promise<void>;
|
|
87
|
-
getCommentsSettings(): Promise<CommentsSettings>;
|
|
88
|
-
putCommentsSettings(
|
|
90
|
+
getCommentsSettings(requiredArgs: Record<string, never>): Promise<CommentsSettings>;
|
|
91
|
+
putCommentsSettings(requiredArgs: Record<string, never>, optionalArgs?: Partial<CommentsSettings>): Promise<CommentsSettings>;
|
|
89
92
|
}
|
|
90
93
|
//# sourceMappingURL=comments.d.ts.map
|
|
@@ -10,12 +10,14 @@
|
|
|
10
10
|
* This port owns the type since `createDatabaseRestorePoint` is where a restore point actually
|
|
11
11
|
* comes into being; `recovery.ts` imports it rather than redeclaring it.
|
|
12
12
|
*
|
|
13
|
-
* ##
|
|
13
|
+
* ## Both migration and restore satisfy `GatedOperation`, with different input needs
|
|
14
14
|
*
|
|
15
15
|
* The reference implementation's `planMigrateForward` takes no input and `executeMigrateForward` takes only the
|
|
16
16
|
* confirmation token — no operation-specific extra fields on any of the three calls. That means
|
|
17
|
-
* this triad is a clean, direct instance of `../gated/types.js`'s `GatedOperation
|
|
18
|
-
* Recovery's restore ceremony
|
|
17
|
+
* this triad is a clean, direct instance of `../gated/types.js`'s `GatedOperation` using its
|
|
18
|
+
* default confirm/execute inputs. Recovery's restore ceremony uses the same abstraction with operation-specific
|
|
19
|
+
* confirm/execute inputs to record disclosure consent and bind the restore target (see that
|
|
20
|
+
* file's header for why those extra fields matter). A
|
|
19
21
|
* compile-time assertion of that fact lives in `../__tests__/database-gated.test.ts`.
|
|
20
22
|
*/
|
|
21
23
|
import type { GatedConfirmResult, GatedOperation, GatedPlanResult } from '../gated/types.js';
|
|
@@ -68,7 +70,7 @@ export interface AdminDatabasePort {
|
|
|
68
70
|
* `outcome` and bounded by `fromDate`/`toDate`. Keyset-paginated via `cursor`/`nextCursor`, not
|
|
69
71
|
* offset-paginated — do not compute a page number from `limit`.
|
|
70
72
|
*/
|
|
71
|
-
getDatabaseTimeline(
|
|
73
|
+
getDatabaseTimeline(requiredArgs: Record<string, never>, optionalArgs?: {
|
|
72
74
|
kind?: string;
|
|
73
75
|
outcome?: string;
|
|
74
76
|
fromDate?: string;
|
|
@@ -79,23 +81,24 @@ export interface AdminDatabasePort {
|
|
|
79
81
|
items: readonly AdminLedgerRow[];
|
|
80
82
|
nextCursor: string | null;
|
|
81
83
|
}>;
|
|
82
|
-
listDatabaseRestorePoints(): Promise<readonly AdminRestorePoint[]>;
|
|
84
|
+
listDatabaseRestorePoints(requiredArgs: Record<string, never>): Promise<readonly AdminRestorePoint[]>;
|
|
83
85
|
/**
|
|
84
86
|
* Captures a new restore point on demand. `costAck` should be `true` once the operator has
|
|
85
87
|
* acknowledged a shown cost warning for a `RestorePointCostClass` of `"expensive"` — a host may
|
|
86
88
|
* reject the call without it rather than silently proceeding.
|
|
87
89
|
*/
|
|
88
|
-
createDatabaseRestorePoint(
|
|
90
|
+
createDatabaseRestorePoint(requiredArgs: Record<string, never>, optionalArgs?: {
|
|
89
91
|
trigger?: string;
|
|
90
92
|
costAck?: boolean;
|
|
91
93
|
}): Promise<AdminRestorePointSummary>;
|
|
92
94
|
/**
|
|
93
95
|
* The forward-migration ceremony (schema/data migration to the host's current expected state),
|
|
94
|
-
* as a `GatedOperation` — see the file header for why this triad
|
|
95
|
-
*
|
|
96
|
-
* plan is computed entirely from the site's current
|
|
96
|
+
* as a `GatedOperation` — see the file header for why this triad uses the default confirm/execute
|
|
97
|
+
* inputs while Recovery's restore supplies operation-specific ones. `plan` takes no meaningful
|
|
98
|
+
* input beyond the ceremony trigger; the plan is computed entirely from the site's current
|
|
99
|
+
* migration state server-side.
|
|
97
100
|
*/
|
|
98
|
-
readonly migrateForward: GatedOperation<
|
|
101
|
+
readonly migrateForward: GatedOperation<Record<string, never>, unknown, MigrateForwardResult>;
|
|
99
102
|
}
|
|
100
103
|
export type { GatedConfirmResult, GatedOperation, GatedPlanResult };
|
|
101
104
|
//# sourceMappingURL=database.d.ts.map
|