@jini-ai/admin 0.3.10 → 0.4.1
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 +64 -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 +46 -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 +83 -0
- package/dist/media/react/hooks/MediaCard.hooks.js +66 -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 +29 -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 +86 -0
- package/dist/media/rules.js +134 -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/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
|
@@ -25,6 +25,20 @@
|
|
|
25
25
|
* `kind` values (with `AdminMenuCustomTarget` as the `default` arm) is the straightforward way to
|
|
26
26
|
* stay correct.
|
|
27
27
|
*
|
|
28
|
+
* **Migration hazard, measured 2026-09-05.** This is not merely a style preference — it means an
|
|
29
|
+
* exhaustive `switch` with NO `default` arm cannot compile against `AdminMenuTarget` at all, and
|
|
30
|
+
* that is exactly the shape a host arrives with. Existing host menu editors' `targetForKind` functions
|
|
31
|
+
* switch over their own local CLOSED four-member
|
|
32
|
+
* union with no `default`, and rely on exhaustiveness for the return type. Compiling that function
|
|
33
|
+
* against this port's union emits `TS2366` (lacks ending return statement) plus a `TS2339` per
|
|
34
|
+
* field access. Confirmed by compiling the real function against this union directly.
|
|
35
|
+
*
|
|
36
|
+
* The hazard is pre-existing and belongs to `AdminMenuCustomTarget`, not to any later change: the
|
|
37
|
+
* identical probe run against the union with and without an extra member emits a character-for-
|
|
38
|
+
* character identical error set. Recorded here because it will surface the first time anyone wires
|
|
39
|
+
* a host onto this port, and the natural instinct will be to blame whatever change is in flight at
|
|
40
|
+
* that moment. The fix is a `default` arm in the host, not a change to this file.
|
|
41
|
+
*
|
|
28
42
|
* **This is a deliberately deferred decision, not a settled one — record it as such.** `entryRef`/
|
|
29
43
|
* `termRef` encode a host content model (an "entry" and a "taxonomy term" are the reference
|
|
30
44
|
* implementation's own vocabulary for its content system, not a vendor-neutral abstraction this
|
|
@@ -39,6 +53,35 @@
|
|
|
39
53
|
* instead of one, and a genuine vendor-neutral reference shape (rather than another bespoke
|
|
40
54
|
* `kind`-per-host member) becomes the right call.
|
|
41
55
|
*
|
|
56
|
+
* ### Status of that trigger, re-checked 2026-09-05 — NOT fired
|
|
57
|
+
*
|
|
58
|
+
* A second host now exists in this workspace, and that is NOT the trigger. The trigger is a second
|
|
59
|
+
* host needing a fifth KIND. Recording the difference here because a promotion was very nearly
|
|
60
|
+
* approved on the weaker reading. Four findings, all verified against source rather than assumed:
|
|
61
|
+
*
|
|
62
|
+
* 1. **Zero importers.** Nothing anywhere imports `AdminMenuTarget`, `NavTargetKind`, or any target
|
|
63
|
+
* variant from this package. In this repo they are re-exported by `core/index.ts` and
|
|
64
|
+
* `core/ports/index.ts` and consumed by nothing.
|
|
65
|
+
* 2. **Both admin apps declare their own.** Each ships a local, *closed*
|
|
66
|
+
* `{ kind: "entryRef" | "termRef" | "url" | "route" }` in its own `src/lib/api.ts` — an HTTP
|
|
67
|
+
* DTO, not this port. The two are byte-identical to each other: the second is a fork of the
|
|
68
|
+
* first, so they are one data point, not two.
|
|
69
|
+
* 3. **The other `NavTargetKind` is a different type.** `@jini-ai/cms/navigation` exports its own
|
|
70
|
+
* `NavTargetKind` (closed, plus a separate `ReservedNavTargetKind`). A host importing that one
|
|
71
|
+
* is not exercising this port.
|
|
72
|
+
* 4. **The union is already open.** `AdminMenuCustomTarget`'s `kind: string & {}` already lets any
|
|
73
|
+
* host express any kind today. Nothing is blocked while the decision stays deferred.
|
|
74
|
+
*
|
|
75
|
+
* So no fifth kind has been needed, and adding a named generic variant now would be designing from
|
|
76
|
+
* zero validating examples — the exact failure the paragraph above exists to prevent. Considered
|
|
77
|
+
* and rejected on 2026-09-05 for that reason. Re-check this section, not the prose above it,
|
|
78
|
+
* before concluding the trigger has fired.
|
|
79
|
+
*
|
|
80
|
+
* Note for whoever revisits: wiring `AdminMenusPort` into a host is the experiment that ANSWERS the
|
|
81
|
+
* type question, and it is not blocked by it. A host that wires the port and finds
|
|
82
|
+
* `entryRef`/`termRef` fit vindicates the deferral; one that needs a product/collection kind fires
|
|
83
|
+
* the trigger with a real second example to design from.
|
|
84
|
+
*
|
|
42
85
|
* ## `deleteMenu` is a two-rung ladder driven by call count, not by `force` alone
|
|
43
86
|
*
|
|
44
87
|
* A single method models a two-step deletion flow: the FIRST call against a non-trashed menu
|
|
@@ -72,6 +115,9 @@ export type NavTargetKind = "entryRef" | "termRef" | "url" | "route" | (string &
|
|
|
72
115
|
export interface AdminMenuEntryTarget {
|
|
73
116
|
readonly kind: "entryRef";
|
|
74
117
|
readonly entryId: string;
|
|
118
|
+
readonly entryType?: string;
|
|
119
|
+
/** Last URL known to the author; the host resolves entryId first and preserves availability checks. */
|
|
120
|
+
readonly lastKnownHref?: string;
|
|
75
121
|
}
|
|
76
122
|
/** A link to a taxonomy term (category/tag archive, or a host's closest equivalent grouping). */
|
|
77
123
|
export interface AdminMenuTermTarget {
|
package/dist/core/ports/menus.js
CHANGED
|
@@ -25,6 +25,20 @@
|
|
|
25
25
|
* `kind` values (with `AdminMenuCustomTarget` as the `default` arm) is the straightforward way to
|
|
26
26
|
* stay correct.
|
|
27
27
|
*
|
|
28
|
+
* **Migration hazard, measured 2026-09-05.** This is not merely a style preference — it means an
|
|
29
|
+
* exhaustive `switch` with NO `default` arm cannot compile against `AdminMenuTarget` at all, and
|
|
30
|
+
* that is exactly the shape a host arrives with. Existing host menu editors' `targetForKind` functions
|
|
31
|
+
* switch over their own local CLOSED four-member
|
|
32
|
+
* union with no `default`, and rely on exhaustiveness for the return type. Compiling that function
|
|
33
|
+
* against this port's union emits `TS2366` (lacks ending return statement) plus a `TS2339` per
|
|
34
|
+
* field access. Confirmed by compiling the real function against this union directly.
|
|
35
|
+
*
|
|
36
|
+
* The hazard is pre-existing and belongs to `AdminMenuCustomTarget`, not to any later change: the
|
|
37
|
+
* identical probe run against the union with and without an extra member emits a character-for-
|
|
38
|
+
* character identical error set. Recorded here because it will surface the first time anyone wires
|
|
39
|
+
* a host onto this port, and the natural instinct will be to blame whatever change is in flight at
|
|
40
|
+
* that moment. The fix is a `default` arm in the host, not a change to this file.
|
|
41
|
+
*
|
|
28
42
|
* **This is a deliberately deferred decision, not a settled one — record it as such.** `entryRef`/
|
|
29
43
|
* `termRef` encode a host content model (an "entry" and a "taxonomy term" are the reference
|
|
30
44
|
* implementation's own vocabulary for its content system, not a vendor-neutral abstraction this
|
|
@@ -39,6 +53,35 @@
|
|
|
39
53
|
* instead of one, and a genuine vendor-neutral reference shape (rather than another bespoke
|
|
40
54
|
* `kind`-per-host member) becomes the right call.
|
|
41
55
|
*
|
|
56
|
+
* ### Status of that trigger, re-checked 2026-09-05 — NOT fired
|
|
57
|
+
*
|
|
58
|
+
* A second host now exists in this workspace, and that is NOT the trigger. The trigger is a second
|
|
59
|
+
* host needing a fifth KIND. Recording the difference here because a promotion was very nearly
|
|
60
|
+
* approved on the weaker reading. Four findings, all verified against source rather than assumed:
|
|
61
|
+
*
|
|
62
|
+
* 1. **Zero importers.** Nothing anywhere imports `AdminMenuTarget`, `NavTargetKind`, or any target
|
|
63
|
+
* variant from this package. In this repo they are re-exported by `core/index.ts` and
|
|
64
|
+
* `core/ports/index.ts` and consumed by nothing.
|
|
65
|
+
* 2. **Both admin apps declare their own.** Each ships a local, *closed*
|
|
66
|
+
* `{ kind: "entryRef" | "termRef" | "url" | "route" }` in its own `src/lib/api.ts` — an HTTP
|
|
67
|
+
* DTO, not this port. The two are byte-identical to each other: the second is a fork of the
|
|
68
|
+
* first, so they are one data point, not two.
|
|
69
|
+
* 3. **The other `NavTargetKind` is a different type.** `@jini-ai/cms/navigation` exports its own
|
|
70
|
+
* `NavTargetKind` (closed, plus a separate `ReservedNavTargetKind`). A host importing that one
|
|
71
|
+
* is not exercising this port.
|
|
72
|
+
* 4. **The union is already open.** `AdminMenuCustomTarget`'s `kind: string & {}` already lets any
|
|
73
|
+
* host express any kind today. Nothing is blocked while the decision stays deferred.
|
|
74
|
+
*
|
|
75
|
+
* So no fifth kind has been needed, and adding a named generic variant now would be designing from
|
|
76
|
+
* zero validating examples — the exact failure the paragraph above exists to prevent. Considered
|
|
77
|
+
* and rejected on 2026-09-05 for that reason. Re-check this section, not the prose above it,
|
|
78
|
+
* before concluding the trigger has fired.
|
|
79
|
+
*
|
|
80
|
+
* Note for whoever revisits: wiring `AdminMenusPort` into a host is the experiment that ANSWERS the
|
|
81
|
+
* type question, and it is not blocked by it. A host that wires the port and finds
|
|
82
|
+
* `entryRef`/`termRef` fit vindicates the deferral; one that needs a product/collection kind fires
|
|
83
|
+
* the trigger with a real second example to design from.
|
|
84
|
+
*
|
|
42
85
|
* ## `deleteMenu` is a two-rung ladder driven by call count, not by `force` alone
|
|
43
86
|
*
|
|
44
87
|
* A single method models a two-step deletion flow: the FIRST call against a non-trashed menu
|
|
@@ -60,8 +60,9 @@ export interface AdminExtensionEnabledResult {
|
|
|
60
60
|
readonly changeSetId: string;
|
|
61
61
|
}
|
|
62
62
|
export interface AdminExtensionsPort {
|
|
63
|
-
listPlugins(): Promise<readonly AdminPlugin[]>;
|
|
64
|
-
setPluginEnabled(
|
|
63
|
+
listPlugins(requiredArgs: Record<string, never>): Promise<readonly AdminPlugin[]>;
|
|
64
|
+
setPluginEnabled(requiredArgs: {
|
|
65
|
+
id: string;
|
|
65
66
|
enabled: boolean;
|
|
66
67
|
}): Promise<AdminExtensionEnabledResult>;
|
|
67
68
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* - `execute` also carries `restorePointId`: belt-and-suspenders against a confirmation token
|
|
16
16
|
* being replayed against a different target than the one it was confirmed for.
|
|
17
17
|
*
|
|
18
|
-
* `GatedOperation` carries `TConfirmInput`/`TExecuteInput` type parameters
|
|
18
|
+
* `GatedOperation` carries `TConfirmInput`/`TExecuteInput` object type parameters
|
|
19
19
|
* for exactly this, so restore is declared as a real `GatedOperation` rather than three loose
|
|
20
20
|
* methods. See `../gated/types.js` for the full rationale — in short, `disclosureAcknowledged`
|
|
21
21
|
* shows the protocol is *recorded informed consent* rather than a two-step token handshake, and
|
|
@@ -154,18 +154,22 @@ export interface RestoreExecuteResult {
|
|
|
154
154
|
}
|
|
155
155
|
export interface AdminRecoveryPort {
|
|
156
156
|
/** Same underlying set as `AdminDatabasePort.listDatabaseRestorePoints` — see the file header. */
|
|
157
|
-
listRecoveryRestorePoints(): Promise<readonly AdminRestorePoint[]>;
|
|
158
|
-
computeRecoveryDisclosure(
|
|
157
|
+
listRecoveryRestorePoints(requiredArgs: Record<string, never>): Promise<readonly AdminRestorePoint[]>;
|
|
158
|
+
computeRecoveryDisclosure(requiredArgs: {
|
|
159
|
+
restorePointId: string;
|
|
160
|
+
}): Promise<AdminDisclosureResult>;
|
|
159
161
|
/** Resolves a deep-link envelope back into a restore point reference. `found: false` means the
|
|
160
162
|
* envelope no longer resolves to anything (e.g. the restore point it named was since purged) —
|
|
161
163
|
* not an error, a valid negative result a panel should render distinctly from a thrown error. */
|
|
162
164
|
resolveRecoveryDeepLink(envelope: DatabaseContextEnvelope): Promise<AdminRecoveryDeepLinkResult>;
|
|
163
|
-
getRecoveryStatus(): Promise<AdminRecoveryStatus>;
|
|
165
|
+
getRecoveryStatus(requiredArgs: Record<string, never>): Promise<AdminRecoveryStatus>;
|
|
164
166
|
/**
|
|
165
|
-
* The restore ceremony: `restore.plan(restorePointId)` -> `restore.confirm(...)` ->
|
|
167
|
+
* The restore ceremony: `restore.plan({ restorePointId })` -> `restore.confirm(...)` ->
|
|
166
168
|
* `restore.execute(...)`. A real `GatedOperation`, so a shared confirmation component can drive
|
|
167
169
|
* it without knowing it is a restore — see the file header.
|
|
168
170
|
*/
|
|
169
|
-
readonly restore: GatedOperation<
|
|
171
|
+
readonly restore: GatedOperation<{
|
|
172
|
+
readonly restorePointId: string;
|
|
173
|
+
}, unknown, RestoreExecuteResult, RestoreConfirmInput, RestoreExecuteInput>;
|
|
170
174
|
}
|
|
171
175
|
//# sourceMappingURL=recovery.d.ts.map
|
|
@@ -123,17 +123,27 @@ export interface AdminRedirectImportResult {
|
|
|
123
123
|
readonly failed: readonly AdminRedirectImportFailure[];
|
|
124
124
|
}
|
|
125
125
|
export interface AdminRedirectsPort {
|
|
126
|
-
listRedirects(
|
|
127
|
-
getRedirect(
|
|
128
|
-
|
|
129
|
-
|
|
126
|
+
listRedirects(requiredArgs: Record<string, never>, optionalArgs?: AdminRedirectListFilter): Promise<readonly AdminRedirect[]>;
|
|
127
|
+
getRedirect(requiredArgs: {
|
|
128
|
+
id: string;
|
|
129
|
+
}): Promise<AdminRedirect>;
|
|
130
|
+
createRedirect(requiredArgs: Omit<AdminRedirectCreateInput, "override" | "priority">, optionalArgs?: Pick<AdminRedirectCreateInput, "override" | "priority">): Promise<AdminRedirect>;
|
|
131
|
+
updateRedirect(requiredArgs: {
|
|
132
|
+
id: string;
|
|
133
|
+
}, optionalArgs?: AdminRedirectUpdatePatch): Promise<AdminRedirect>;
|
|
130
134
|
/** Soft delete — returns the tombstoned record, not `void`. See file header. */
|
|
131
|
-
tombstoneRedirect(
|
|
135
|
+
tombstoneRedirect(requiredArgs: {
|
|
136
|
+
id: string;
|
|
137
|
+
}): Promise<AdminRedirect>;
|
|
132
138
|
/** Resolves with `hitCount: 0`/`lastHitAt: null` when no hits have been recorded yet — distinct
|
|
133
139
|
* from the redirect itself not existing, which is a not-found-class rejection instead. */
|
|
134
|
-
getRedirectHitStats(
|
|
140
|
+
getRedirectHitStats(requiredArgs: {
|
|
141
|
+
id: string;
|
|
142
|
+
}): Promise<AdminRedirectHitStats>;
|
|
135
143
|
/** Always a partial-success batch — see file header. Each item shares `AdminRedirectCreateInput`'s
|
|
136
144
|
* shape (provenance is stamped `"import"` automatically, not caller-supplied). */
|
|
137
|
-
importRedirects(
|
|
145
|
+
importRedirects(requiredArgs: {
|
|
146
|
+
rules: readonly AdminRedirectCreateInput[];
|
|
147
|
+
}): Promise<AdminRedirectImportResult>;
|
|
138
148
|
}
|
|
139
149
|
//# sourceMappingURL=redirects.d.ts.map
|
package/dist/core/ports/seo.d.ts
CHANGED
|
@@ -133,14 +133,20 @@ export interface AdminSeoSettings {
|
|
|
133
133
|
readonly robotsRules: readonly AdminSeoRobotsRule[];
|
|
134
134
|
}
|
|
135
135
|
export interface AdminSeoPort {
|
|
136
|
-
getSeoEntry(
|
|
136
|
+
getSeoEntry(requiredArgs: {
|
|
137
|
+
entryId: string;
|
|
138
|
+
}): Promise<AdminSeoMeta>;
|
|
137
139
|
/** Merge-patches the override bag and returns the newly-resolved meta — see file header. */
|
|
138
|
-
putSeoEntry(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
putSeoEntry(requiredArgs: {
|
|
141
|
+
entryId: string;
|
|
142
|
+
}, optionalArgs?: AdminSeoOverrides): Promise<AdminSeoMeta>;
|
|
143
|
+
analyzeSeoEntry(requiredArgs: {
|
|
144
|
+
entryId: string;
|
|
145
|
+
}): Promise<AdminSeoAnalysis>;
|
|
146
|
+
getSeoSettings(requiredArgs: Record<string, never>): Promise<AdminSeoSettings>;
|
|
147
|
+
putSeoSettings(requiredArgs: Record<string, never>, optionalArgs?: Partial<AdminSeoSettings>): Promise<AdminSeoSettings>;
|
|
142
148
|
/** Fire-and-accept trigger, not a trackable job — see file header. */
|
|
143
|
-
regenerateSeoSitemap(): Promise<{
|
|
149
|
+
regenerateSeoSitemap(requiredArgs: Record<string, never>): Promise<{
|
|
144
150
|
accepted: boolean;
|
|
145
151
|
}>;
|
|
146
152
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { AdminAuthUser } from './auth.js';
|
|
2
|
+
/** Host-owned API scope. No site, tenant or workspace-id vocabulary is imposed. */
|
|
3
|
+
export interface AdminShellContext {
|
|
4
|
+
readonly apiBase: string;
|
|
5
|
+
readonly workspace: Readonly<Record<string, string>>;
|
|
6
|
+
}
|
|
7
|
+
/** Session identity plus UI affordances; servers must authorize every operation themselves. */
|
|
8
|
+
export interface AdminShellSession {
|
|
9
|
+
readonly user: AdminAuthUser;
|
|
10
|
+
readonly effectivePermissions?: readonly string[];
|
|
11
|
+
}
|
|
12
|
+
/** Adapters return null for a missing session and reject for infrastructure failures. */
|
|
13
|
+
export interface AdminShellSessionPort {
|
|
14
|
+
read(args: AdminShellContext): Promise<AdminShellSession | null>;
|
|
15
|
+
logout(args: AdminShellContext): Promise<void>;
|
|
16
|
+
/** Emit only genuine session invalidation, never an upstream provider's authentication error. */
|
|
17
|
+
onUnauthenticated(args: AdminShellContext & {
|
|
18
|
+
readonly onUnauthenticated: () => void;
|
|
19
|
+
}): () => void;
|
|
20
|
+
}
|
|
21
|
+
/** Route snapshots include the query string but exclude the fragment and admin base. */
|
|
22
|
+
export interface AdminShellNavigationPort {
|
|
23
|
+
readRoute(args: {
|
|
24
|
+
readonly base: string;
|
|
25
|
+
}): string;
|
|
26
|
+
subscribe(args: {
|
|
27
|
+
readonly base: string;
|
|
28
|
+
readonly onChange: () => void;
|
|
29
|
+
}): () => void;
|
|
30
|
+
navigate(args: {
|
|
31
|
+
readonly base: string;
|
|
32
|
+
readonly routePath: string;
|
|
33
|
+
}, options?: {
|
|
34
|
+
readonly replace?: boolean;
|
|
35
|
+
}): void;
|
|
36
|
+
/** Hosts with a framework router can supply their own anchor interception adapter. */
|
|
37
|
+
installLinkInterceptor(args: {
|
|
38
|
+
readonly base: string;
|
|
39
|
+
}): () => void;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=shell.d.ts.map
|
|
@@ -33,12 +33,12 @@ export interface AdminWorkspace {
|
|
|
33
33
|
readonly createdAt: string;
|
|
34
34
|
}
|
|
35
35
|
export interface AdminWorkspacePort {
|
|
36
|
-
getWorkspace(): Promise<AdminWorkspace>;
|
|
37
|
-
updateWorkspace(
|
|
36
|
+
getWorkspace(requiredArgs: Record<string, never>): Promise<AdminWorkspace>;
|
|
37
|
+
updateWorkspace(requiredArgs: Record<string, never>, optionalArgs?: {
|
|
38
38
|
name?: string;
|
|
39
39
|
slug?: string;
|
|
40
40
|
}): Promise<AdminWorkspace>;
|
|
41
41
|
/** May unconditionally reject — see the file header. */
|
|
42
|
-
deleteWorkspace(): Promise<void>;
|
|
42
|
+
deleteWorkspace(requiredArgs: Record<string, never>): Promise<void>;
|
|
43
43
|
}
|
|
44
44
|
//# sourceMappingURL=workspace.d.ts.map
|
|
@@ -27,9 +27,15 @@ import type { AdminRoute } from './types.js';
|
|
|
27
27
|
* its own base rather than patching this package. */
|
|
28
28
|
export declare const DEFAULT_ADMIN_BASE = "/admin";
|
|
29
29
|
/** `"/admin/settings/"` -> `"/admin/settings"`; leaves a lone `"/"` alone. */
|
|
30
|
-
export declare function stripTrailingSlash(pathname
|
|
30
|
+
export declare function stripTrailingSlash({ pathname }: {
|
|
31
|
+
readonly pathname: string;
|
|
32
|
+
}): string;
|
|
31
33
|
/** Route path -> URL. `/settings` -> `/admin/settings`; `/` -> `/admin/`. */
|
|
32
|
-
export declare function adminHref(routePath
|
|
34
|
+
export declare function adminHref({ routePath }: {
|
|
35
|
+
readonly routePath: string;
|
|
36
|
+
}, { base }?: {
|
|
37
|
+
readonly base?: string;
|
|
38
|
+
}): string;
|
|
33
39
|
/**
|
|
34
40
|
* URL pathname -> route path, base stripped. Always starts with `/`.
|
|
35
41
|
*
|
|
@@ -40,7 +46,11 @@ export declare function adminHref(routePath: string, base?: string): string;
|
|
|
40
46
|
* `window.location.pathname` — that default is what made the original untestable without a DOM,
|
|
41
47
|
* and it belongs in the browser layer, not here.
|
|
42
48
|
*/
|
|
43
|
-
export declare function currentRoutePath(pathname
|
|
49
|
+
export declare function currentRoutePath({ pathname }: {
|
|
50
|
+
readonly pathname: string;
|
|
51
|
+
}, { base }?: {
|
|
52
|
+
readonly base?: string;
|
|
53
|
+
}): string;
|
|
44
54
|
/**
|
|
45
55
|
* Matches a route path against the registered panels.
|
|
46
56
|
*
|
|
@@ -50,5 +60,8 @@ export declare function currentRoutePath(pathname: string, base?: string): strin
|
|
|
50
60
|
* @complexity O(p * r * s) — p panels, r patterns per panel, s segments per pattern. Bounded by
|
|
51
61
|
* the manifest, and the common case exits on the first segment comparison.
|
|
52
62
|
*/
|
|
53
|
-
export declare function matchRoute<T>(routePath
|
|
63
|
+
export declare function matchRoute<T>({ routePath, panels }: {
|
|
64
|
+
readonly routePath: string;
|
|
65
|
+
readonly panels: readonly AdminPanel<T>[];
|
|
66
|
+
}): AdminRoute;
|
|
54
67
|
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
* its own base rather than patching this package. */
|
|
26
26
|
export const DEFAULT_ADMIN_BASE = '/admin';
|
|
27
27
|
/** `"/admin/settings/"` -> `"/admin/settings"`; leaves a lone `"/"` alone. */
|
|
28
|
-
export function stripTrailingSlash(pathname) {
|
|
28
|
+
export function stripTrailingSlash({ pathname }) {
|
|
29
29
|
return pathname.length > 1 && pathname.endsWith('/') ? pathname.slice(0, -1) : pathname;
|
|
30
30
|
}
|
|
31
31
|
/** Route path -> URL. `/settings` -> `/admin/settings`; `/` -> `/admin/`. */
|
|
32
|
-
export function adminHref(routePath, base = DEFAULT_ADMIN_BASE) {
|
|
32
|
+
export function adminHref({ routePath }, { base = DEFAULT_ADMIN_BASE } = {}) {
|
|
33
33
|
const normalized = routePath.startsWith('/') ? routePath : `/${routePath}`;
|
|
34
34
|
return `${base}${normalized}`;
|
|
35
35
|
}
|
|
@@ -43,7 +43,7 @@ export function adminHref(routePath, base = DEFAULT_ADMIN_BASE) {
|
|
|
43
43
|
* `window.location.pathname` — that default is what made the original untestable without a DOM,
|
|
44
44
|
* and it belongs in the browser layer, not here.
|
|
45
45
|
*/
|
|
46
|
-
export function currentRoutePath(pathname, base = DEFAULT_ADMIN_BASE) {
|
|
46
|
+
export function currentRoutePath({ pathname }, { base = DEFAULT_ADMIN_BASE } = {}) {
|
|
47
47
|
if (pathname === base)
|
|
48
48
|
return '/';
|
|
49
49
|
if (pathname.startsWith(`${base}/`))
|
|
@@ -61,7 +61,7 @@ export function currentRoutePath(pathname, base = DEFAULT_ADMIN_BASE) {
|
|
|
61
61
|
* @complexity O(p * r * s) — p panels, r patterns per panel, s segments per pattern. Bounded by
|
|
62
62
|
* the manifest, and the common case exits on the first segment comparison.
|
|
63
63
|
*/
|
|
64
|
-
export function matchRoute(routePath, panels) {
|
|
64
|
+
export function matchRoute({ routePath, panels }) {
|
|
65
65
|
const [rawPath, rawQuery] = routePath.split('?');
|
|
66
66
|
const segments = (rawPath ?? '').split('/').filter(Boolean);
|
|
67
67
|
const query = new URLSearchParams(rawQuery ?? '');
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* message, or when the thrown value is not an `AdminApiError` at all (network failure, a
|
|
21
21
|
* thrown non-Error). Panels layer their own per-code copy on top and fall through to this.
|
|
22
22
|
*/
|
|
23
|
-
/** A failed admin API call
|
|
23
|
+
/** A failed admin API call: a non-2xx response, or a network/timeout failure with status 0. */
|
|
24
24
|
export declare class AdminApiError extends Error {
|
|
25
25
|
readonly status: number;
|
|
26
26
|
/**
|
|
@@ -31,7 +31,13 @@ export declare class AdminApiError extends Error {
|
|
|
31
31
|
readonly code?: string | undefined;
|
|
32
32
|
/** Raw parsed JSON error body, when present. See decision 1 in the file header. */
|
|
33
33
|
readonly body?: Record<string, unknown> | undefined;
|
|
34
|
-
constructor(message
|
|
34
|
+
constructor({ message, status }: {
|
|
35
|
+
readonly message: string;
|
|
36
|
+
readonly status: number;
|
|
37
|
+
}, { code, body }?: {
|
|
38
|
+
readonly code?: string | undefined;
|
|
39
|
+
readonly body?: Record<string, unknown> | undefined;
|
|
40
|
+
});
|
|
35
41
|
}
|
|
36
42
|
/**
|
|
37
43
|
* Base-case translation from a thrown request error to operator-facing copy.
|
|
@@ -43,11 +49,14 @@ export declare class AdminApiError extends Error {
|
|
|
43
49
|
* ```ts
|
|
44
50
|
* function describe(e: unknown, fallback: string): string {
|
|
45
51
|
* if (e instanceof AdminApiError && e.code === 'PANEL_SPECIFIC_CODE') return '...';
|
|
46
|
-
* return describeApiError(e, fallback);
|
|
52
|
+
* return describeApiError({ e, fallback });
|
|
47
53
|
* }
|
|
48
54
|
* ```
|
|
49
55
|
*
|
|
50
56
|
* @complexity O(1) — two `instanceof` checks, no iteration.
|
|
51
57
|
*/
|
|
52
|
-
export declare function describeApiError(e
|
|
58
|
+
export declare function describeApiError({ e, fallback }: {
|
|
59
|
+
readonly e: unknown;
|
|
60
|
+
readonly fallback: string;
|
|
61
|
+
}): string;
|
|
53
62
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* message, or when the thrown value is not an `AdminApiError` at all (network failure, a
|
|
21
21
|
* thrown non-Error). Panels layer their own per-code copy on top and fall through to this.
|
|
22
22
|
*/
|
|
23
|
-
/** A failed admin API call
|
|
23
|
+
/** A failed admin API call: a non-2xx response, or a network/timeout failure with status 0. */
|
|
24
24
|
export class AdminApiError extends Error {
|
|
25
25
|
status;
|
|
26
26
|
/**
|
|
@@ -31,7 +31,7 @@ export class AdminApiError extends Error {
|
|
|
31
31
|
code;
|
|
32
32
|
/** Raw parsed JSON error body, when present. See decision 1 in the file header. */
|
|
33
33
|
body;
|
|
34
|
-
constructor(message, status, code, body) {
|
|
34
|
+
constructor({ message, status }, { code, body } = {}) {
|
|
35
35
|
super(message);
|
|
36
36
|
this.name = 'AdminApiError';
|
|
37
37
|
this.status = status;
|
|
@@ -49,13 +49,13 @@ export class AdminApiError extends Error {
|
|
|
49
49
|
* ```ts
|
|
50
50
|
* function describe(e: unknown, fallback: string): string {
|
|
51
51
|
* if (e instanceof AdminApiError && e.code === 'PANEL_SPECIFIC_CODE') return '...';
|
|
52
|
-
* return describeApiError(e, fallback);
|
|
52
|
+
* return describeApiError({ e, fallback });
|
|
53
53
|
* }
|
|
54
54
|
* ```
|
|
55
55
|
*
|
|
56
56
|
* @complexity O(1) — two `instanceof` checks, no iteration.
|
|
57
57
|
*/
|
|
58
|
-
export function describeApiError(e, fallback) {
|
|
58
|
+
export function describeApiError({ e, fallback }) {
|
|
59
59
|
if (e instanceof AdminApiError)
|
|
60
60
|
return e.message || fallback;
|
|
61
61
|
return e instanceof Error ? e.message : fallback;
|
|
@@ -3,22 +3,22 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Ported from the reference implementation's `lib/api.ts` `request()`, with the two
|
|
5
5
|
* hard-coded values it closed over — the base URL and the same-origin cookie policy — lifted into
|
|
6
|
-
* options.
|
|
7
|
-
*
|
|
8
|
-
* JSON.
|
|
6
|
+
* options. Request deadlines, typed failures and successful response metadata preserve the
|
|
7
|
+
* original contracts with neutral operator copy. Error-body parsing deliberately keeps the
|
|
8
|
+
* `.catch(() => ({}))` outcome on a body that is not JSON, while distinguishing it from parsed null.
|
|
9
9
|
*/
|
|
10
10
|
import type { AdminClient, AdminRouteGroupFactory, AdminTransport } from './types.js';
|
|
11
11
|
/**
|
|
12
12
|
* The subset of `fetch` this transport actually uses.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* the real `globalThis.fetch` is still assignable here because a function accepting a wider input
|
|
18
|
-
* satisfies one accepting a narrower one.
|
|
14
|
+
* The required object holds a string URL; the optional object is standard RequestInit.
|
|
15
|
+
* Adapt native fetch at the host boundary with `({ url }, init) => fetch(url, init)`.
|
|
16
|
+
* Keeping that adapter outside the core makes the transport reusable without ambient fetch.
|
|
19
17
|
*/
|
|
20
|
-
export type AdminFetch = (
|
|
21
|
-
|
|
18
|
+
export type AdminFetch = (requiredArgs: {
|
|
19
|
+
readonly url: string;
|
|
20
|
+
}, optionalArgs?: RequestInit) => Promise<Response>;
|
|
21
|
+
interface HttpTransportRequiredArgs {
|
|
22
22
|
/**
|
|
23
23
|
* Prefix for every path (`/api/admin/v1`). No trailing slash — paths always start with `/`.
|
|
24
24
|
*
|
|
@@ -29,11 +29,13 @@ export interface HttpTransportOptions {
|
|
|
29
29
|
*/
|
|
30
30
|
readonly baseUrl: string;
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* Required object-argument `fetch` port. Wrap native fetch at the host boundary. Present so a test can supply a stub without
|
|
33
33
|
* `vi.stubGlobal`, which is what forced the reference implementation's own hook tests to assert
|
|
34
34
|
* URLs and HTTP methods when what they meant to describe was behaviour.
|
|
35
35
|
*/
|
|
36
|
-
readonly fetch
|
|
36
|
+
readonly fetch: AdminFetch;
|
|
37
|
+
}
|
|
38
|
+
export interface HttpTransportOptions {
|
|
37
39
|
/**
|
|
38
40
|
* Merged into every request. `Content-Type: application/json` is applied unless overridden;
|
|
39
41
|
* a per-call `headers` still wins over both.
|
|
@@ -45,6 +47,10 @@ export interface HttpTransportOptions {
|
|
|
45
47
|
* host sets `omit` and supplies an `Authorization` header instead.
|
|
46
48
|
*/
|
|
47
49
|
readonly credentials?: RequestCredentials;
|
|
50
|
+
/** Defaults to 60 seconds; a caller-supplied request signal takes precedence. */
|
|
51
|
+
readonly timeoutMs?: number;
|
|
52
|
+
/** Host lifecycle port: navigation-induced network rejection is cancellation, not downtime. */
|
|
53
|
+
readonly isPageUnloading?: () => boolean;
|
|
48
54
|
}
|
|
49
55
|
/**
|
|
50
56
|
* The standard `fetch`-backed transport.
|
|
@@ -52,12 +58,16 @@ export interface HttpTransportOptions {
|
|
|
52
58
|
* Success bodies are parsed as JSON. A non-2xx response throws `AdminApiError` carrying the
|
|
53
59
|
* server's `error` string, HTTP status, canonical `code` when present, and the raw parsed body.
|
|
54
60
|
*/
|
|
55
|
-
export declare function createHttpTransport(
|
|
61
|
+
export declare function createHttpTransport({ baseUrl, fetch: doFetch }: HttpTransportRequiredArgs, { headers: baseHeaders, credentials, timeoutMs, isPageUnloading }?: HttpTransportOptions): AdminTransport;
|
|
56
62
|
/**
|
|
57
63
|
* Assembles route groups into one client.
|
|
58
64
|
*
|
|
59
|
-
*
|
|
60
|
-
* `(transport) => port`. See `types.ts`'s header for the worked example.
|
|
65
|
+
* Shared and host-owned groups are indistinguishable here on purpose — both are just
|
|
66
|
+
* `({ transport }) => port`. See `types.ts`'s header for the worked example.
|
|
61
67
|
*/
|
|
62
|
-
export declare function createAdminClient<TGroups extends Record<string, AdminRouteGroupFactory<unknown>>>(transport
|
|
68
|
+
export declare function createAdminClient<TGroups extends Record<string, AdminRouteGroupFactory<unknown>>>({ transport, groups }: {
|
|
69
|
+
readonly transport: AdminTransport;
|
|
70
|
+
readonly groups: TGroups;
|
|
71
|
+
}): AdminClient<TGroups>;
|
|
72
|
+
export {};
|
|
63
73
|
//# sourceMappingURL=http.d.ts.map
|