@jini-ai/admin 0.3.9 → 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.d.ts +15 -3
- 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 +6 -6
- 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,70 @@
|
|
|
1
|
+
import { createControllerStore } from '../../core/module/controller-store.js';
|
|
2
|
+
import { blankSourceControlDraft, sourceControlProviders, defaultSourceControlCredential, sourceControlReady, buildSourceControlConnection, sourceControlSummary, sourceControlErrorMessage } from '../rules.js';
|
|
3
|
+
export function createSourceControlController({ api, permissions = [] }, _optional = {}) {
|
|
4
|
+
const grants = new Set(permissions), store = createControllerStore({ initial: { providers: [], credentials: [], drafts: {}, loading: false, loaded: false, error: null, catalogError: null } });
|
|
5
|
+
let generation = 0, credentialRevision = 0;
|
|
6
|
+
const canRead = () => !store.signal.aborted && grants.has('source-control.read');
|
|
7
|
+
const canWrite = () => canRead() && grants.has('source-control.credentials.write');
|
|
8
|
+
function patchDraft(id, patch) { const state = store.getSnapshot(); store.set({ patch: { drafts: { ...state.drafts, [id]: { ...(state.drafts[id] ?? blankSourceControlDraft({})), ...patch } } } }); }
|
|
9
|
+
async function load(_required, _optional = {}) {
|
|
10
|
+
if (!canRead())
|
|
11
|
+
return;
|
|
12
|
+
const ticket = ++generation, revision = credentialRevision;
|
|
13
|
+
store.set({ patch: { loading: true } });
|
|
14
|
+
// Catalog failure must not hide saved connections; retain each successful store independently.
|
|
15
|
+
await Promise.all([
|
|
16
|
+
(async () => { try {
|
|
17
|
+
const credentials = await api.list({}, { signal: store.signal });
|
|
18
|
+
if (ticket === generation && revision === credentialRevision)
|
|
19
|
+
store.set({ patch: { credentials: credentials.map(row => sourceControlSummary({ row })), loaded: true, error: null } });
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
if (ticket === generation)
|
|
23
|
+
store.set({ patch: { error: 'Connections unavailable' } });
|
|
24
|
+
} })(),
|
|
25
|
+
(async () => { try {
|
|
26
|
+
const providers = await api.providers({}, { signal: store.signal });
|
|
27
|
+
if (ticket === generation)
|
|
28
|
+
store.set({ patch: { providers, catalogError: null } });
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
if (ticket === generation)
|
|
32
|
+
store.set({ patch: { catalogError: 'Provider catalog unavailable' } });
|
|
33
|
+
} })(),
|
|
34
|
+
]);
|
|
35
|
+
if (ticket === generation)
|
|
36
|
+
store.set({ patch: { loading: false } });
|
|
37
|
+
}
|
|
38
|
+
async function save({ providerId }, _optional = {}) {
|
|
39
|
+
const state = store.getSnapshot(), draft = state.drafts[providerId] ?? blankSourceControlDraft({});
|
|
40
|
+
const info = sourceControlProviders({ providers: state.providers, credentials: state.credentials }).find(p => p.id === providerId);
|
|
41
|
+
if (!canWrite() || !state.loaded || draft.saving || !info || !sourceControlReady({ info, draft }))
|
|
42
|
+
return false;
|
|
43
|
+
const current = defaultSourceControlCredential({ credentials: state.credentials, providerId }), connection = buildSourceControlConnection({ info, draft });
|
|
44
|
+
patchDraft(providerId, { saving: true, error: null });
|
|
45
|
+
try {
|
|
46
|
+
const row = current ? await api.update({ id: current.id, patch: { connection } }, { signal: store.signal }) : await api.create({ label: 'default', connection }, { signal: store.signal });
|
|
47
|
+
if (store.signal.aborted)
|
|
48
|
+
return false;
|
|
49
|
+
credentialRevision++;
|
|
50
|
+
// One round trip per write: splice the summary, then erase accepted secret drafts immediately.
|
|
51
|
+
const credentials = store.getSnapshot().credentials, summary = sourceControlSummary({ row });
|
|
52
|
+
// Preserve server order: the first row is the defensive default when no row is marked default.
|
|
53
|
+
store.set({ patch: { credentials: Object.freeze(credentials.some(c => c.id === row.id) ? credentials.map(c => c.id === row.id ? summary : c) : [...credentials, summary]) } });
|
|
54
|
+
patchDraft(providerId, blankSourceControlDraft({}));
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
patchDraft(providerId, { saving: false, error: sourceControlErrorMessage({ error }) });
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return { getSnapshot: store.getSnapshot, subscribe: store.subscribe, load, save,
|
|
63
|
+
setToken({ providerId, value }, _optional = {}) { if (canWrite() && !store.getSnapshot().drafts[providerId]?.saving)
|
|
64
|
+
patchDraft(providerId, { token: value }); },
|
|
65
|
+
setField({ providerId, name, value }, _optional = {}) { const draft = store.getSnapshot().drafts[providerId] ?? blankSourceControlDraft({}); if (canWrite() && !draft.saving)
|
|
66
|
+
patchDraft(providerId, { values: { ...draft.values, [name]: value } }); },
|
|
67
|
+
dispose(_required = {}, _optional = {}) { generation++; store.set({ patch: { drafts: {} } }); store.dispose(); },
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=source-control.controller.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { sourceControlModule } from './source-control.module.js';
|
|
2
|
+
export { createSourceControlController } from './controllers/source-control.controller.js';
|
|
3
|
+
export { sourceControlApiToken } from './ports.js';
|
|
4
|
+
export type { SourceControlApiPort, SourceControlTransportPort } from './ports.js';
|
|
5
|
+
export type * from './models.js';
|
|
6
|
+
export { sourceControlProviders, defaultSourceControlCredential, sourceControlReady, buildSourceControlConnection } from './rules.js';
|
|
7
|
+
export { sourceControlMessagesEn } from './messages.en.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { sourceControlModule } from './source-control.module.js';
|
|
2
|
+
export { createSourceControlController } from './controllers/source-control.controller.js';
|
|
3
|
+
export { sourceControlApiToken } from './ports.js';
|
|
4
|
+
export { sourceControlProviders, defaultSourceControlCredential, sourceControlReady, buildSourceControlConnection } from './rules.js';
|
|
5
|
+
export { sourceControlMessagesEn } from './messages.en.js';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const sourceControlMessagesEn: Readonly<{
|
|
2
|
+
title: "Source Control";
|
|
3
|
+
providers: "Providers";
|
|
4
|
+
description: "Connect an account to read repositories and push to them later. Content versioning is a separate feature.";
|
|
5
|
+
denied: "Permission denied";
|
|
6
|
+
saved: "Token saved";
|
|
7
|
+
replace: "Replace token";
|
|
8
|
+
manage: "Create access token";
|
|
9
|
+
loading: "Loading connections…";
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=messages.en.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const sourceControlMessagesEn = Object.freeze({ title: 'Source Control', providers: 'Providers', description: 'Connect an account to read repositories and push to them later. Content versioning is a separate feature.', denied: 'Permission denied', saved: 'Token saved', replace: 'Replace token', manage: 'Create access token', loading: 'Loading connections…' });
|
|
2
|
+
//# sourceMappingURL=messages.en.js.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export interface SourceControlField {
|
|
2
|
+
readonly name: string;
|
|
3
|
+
readonly label: string;
|
|
4
|
+
readonly secret?: boolean;
|
|
5
|
+
readonly required?: boolean;
|
|
6
|
+
readonly hint?: string;
|
|
7
|
+
readonly userHelp?: string;
|
|
8
|
+
readonly help?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SourceControlProvider {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly label: string;
|
|
13
|
+
readonly credential?: {
|
|
14
|
+
readonly tokenField: string;
|
|
15
|
+
readonly fields: readonly SourceControlField[];
|
|
16
|
+
readonly tokenPageUrl?: string;
|
|
17
|
+
readonly help?: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface SourceControlCredential {
|
|
21
|
+
readonly id: string;
|
|
22
|
+
readonly providerId: string;
|
|
23
|
+
readonly label: string;
|
|
24
|
+
readonly configured: true;
|
|
25
|
+
readonly isDefault: boolean;
|
|
26
|
+
readonly createdAt: string;
|
|
27
|
+
readonly updatedAt: string;
|
|
28
|
+
}
|
|
29
|
+
export type SourceControlConnection = {
|
|
30
|
+
providerId: string;
|
|
31
|
+
token: string;
|
|
32
|
+
} & Readonly<Record<string, string>>;
|
|
33
|
+
export interface SourceControlCredentialInput {
|
|
34
|
+
readonly label: string;
|
|
35
|
+
readonly connection: SourceControlConnection;
|
|
36
|
+
readonly isDefault?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface SourceControlCredentialPatch {
|
|
39
|
+
readonly label?: string;
|
|
40
|
+
readonly connection?: SourceControlConnection;
|
|
41
|
+
readonly isDefault?: boolean;
|
|
42
|
+
}
|
|
43
|
+
export interface SourceControlDraft {
|
|
44
|
+
readonly token: string;
|
|
45
|
+
readonly values: Readonly<Record<string, string>>;
|
|
46
|
+
readonly saving: boolean;
|
|
47
|
+
readonly error: string | null;
|
|
48
|
+
}
|
|
49
|
+
export interface SourceControlProviderInfo {
|
|
50
|
+
readonly id: string;
|
|
51
|
+
readonly label: string;
|
|
52
|
+
readonly listed: boolean;
|
|
53
|
+
readonly tokenLabel: string;
|
|
54
|
+
readonly fields: readonly SourceControlField[];
|
|
55
|
+
readonly tokenPageUrl: string;
|
|
56
|
+
readonly help: string;
|
|
57
|
+
}
|
|
58
|
+
export interface SourceControlState {
|
|
59
|
+
readonly providers: readonly SourceControlProvider[];
|
|
60
|
+
readonly credentials: readonly SourceControlCredential[];
|
|
61
|
+
readonly drafts: Readonly<Record<string, SourceControlDraft>>;
|
|
62
|
+
readonly loading: boolean;
|
|
63
|
+
readonly loaded: boolean;
|
|
64
|
+
readonly error: string | null;
|
|
65
|
+
readonly catalogError: string | null;
|
|
66
|
+
}
|
|
67
|
+
export interface SourceControlRequestOptions {
|
|
68
|
+
readonly signal?: AbortSignal;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SourceControlProvider, SourceControlCredential, SourceControlCredentialInput, SourceControlCredentialPatch, SourceControlRequestOptions } from './models.js';
|
|
2
|
+
export interface SourceControlApiPort {
|
|
3
|
+
providers(required: Record<string, never>, optional?: SourceControlRequestOptions): Promise<readonly SourceControlProvider[]>;
|
|
4
|
+
list(required: Record<string, never>, optional?: SourceControlRequestOptions): Promise<readonly SourceControlCredential[]>;
|
|
5
|
+
create(required: SourceControlCredentialInput, optional?: SourceControlRequestOptions): Promise<SourceControlCredential>;
|
|
6
|
+
update(required: {
|
|
7
|
+
id: string;
|
|
8
|
+
patch: SourceControlCredentialPatch;
|
|
9
|
+
}, optional?: SourceControlRequestOptions): Promise<SourceControlCredential>;
|
|
10
|
+
/** Idempotent; intentionally not offered by the connection page UI. */
|
|
11
|
+
remove(required: {
|
|
12
|
+
id: string;
|
|
13
|
+
}, optional?: SourceControlRequestOptions): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export interface SourceControlTransportPort {
|
|
16
|
+
request<T>(required: {
|
|
17
|
+
path: string;
|
|
18
|
+
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
19
|
+
body?: unknown;
|
|
20
|
+
}, optional?: SourceControlRequestOptions): Promise<T>;
|
|
21
|
+
}
|
|
22
|
+
export declare const sourceControlApiToken: import("../core/module/token.js").AdminPortToken<SourceControlApiPort, "admin.source-control.api">;
|
|
23
|
+
//# sourceMappingURL=ports.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SourceControlRowView } from '../hooks/ProvidersTab.hooks.js';
|
|
2
|
+
export declare function SourceControlCredentialFields({ row }: {
|
|
3
|
+
row: SourceControlRowView;
|
|
4
|
+
}, _optional?: {}): import("react").JSX.Element;
|
|
5
|
+
//# sourceMappingURL=SourceControlCredentialFields.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Notice, TextField } from '@jini-ai/ui-kit/react';
|
|
3
|
+
import { useSourceControlCredentialFields } from '../hooks/SourceControlCredentialFields.hooks.js';
|
|
4
|
+
export function SourceControlCredentialFields({ row }, _optional = {}) {
|
|
5
|
+
const vm = useSourceControlCredentialFields({ row });
|
|
6
|
+
return _jsxs(_Fragment, { children: [_jsx(TextField, { label: vm.tokenLabel, type: "password", value: vm.token, onValueChange: vm.onToken, disabled: vm.saving, ref: vm.tokenRef }), _jsx("p", { children: vm.hint }), vm.hasGuidance && _jsxs("details", { children: [_jsx("summary", { children: "Which token do I need?" }), _jsxs("p", { children: [vm.help, " ", vm.tokenPageUrl && _jsx("a", { href: vm.tokenPageUrl, target: "_blank", rel: "noreferrer", children: "Create a token" })] })] }), vm.fields.map(field => _jsxs("div", { children: [_jsx(TextField, { label: field.label, type: field.secret ? 'password' : 'text', value: field.value, onValueChange: field.onValueChange, disabled: vm.saving, required: field.required, ref: field.ref }), field.hint && _jsx("p", { children: field.hint })] }, field.name)), _jsxs(Button, { onPress: vm.save, disabled: vm.disabled, pending: vm.saving, children: ["Save ", vm.label, " token"] }), vm.error && _jsx(Notice, { tone: "danger", children: vm.error })] });
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=SourceControlCredentialFields.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SourceControlRowView } from '../hooks/ProvidersTab.hooks.js';
|
|
2
|
+
export declare function SourceControlProviderRow({ row }: {
|
|
3
|
+
row: SourceControlRowView;
|
|
4
|
+
}, _optional?: {}): import("react").JSX.Element;
|
|
5
|
+
//# sourceMappingURL=SourceControlProviderRow.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Notice } from '@jini-ai/ui-kit/react';
|
|
3
|
+
import { SourceControlCredentialFields } from './SourceControlCredentialFields.js';
|
|
4
|
+
export function SourceControlProviderRow({ row }, _optional = {}) {
|
|
5
|
+
return _jsxs("details", { name: "jini-source-control-provider", open: row.defaultOpen, "data-jini-part": "source-control.provider", children: [_jsxs("summary", { children: [_jsx("h2", { children: row.heading }), row.saved && _jsxs(_Fragment, { children: [_jsx("span", { children: "Token saved" }), _jsxs("span", { children: ["Saved ", row.saved.updatedAt] }), _jsx("span", { children: "Replace token \u25BE" })] }), !row.saved && _jsx("span", { children: "Expand \u25BE" })] }), row.unlisted ? _jsx(Notice, { children: "Its plugin is off or missing. Manage this token on the Access tokens page." }) : row.canEdit ? _jsx(SourceControlCredentialFields, { row: row }) : _jsx(Notice, { children: "Read-only connection" })] });
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=SourceControlProviderRow.js.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { TabViewProps } from '../../../react/bind-react.js';
|
|
2
|
+
export declare function useProvidersTab({ permissions }: TabViewProps, _optional?: {}): {
|
|
3
|
+
denied: boolean;
|
|
4
|
+
loading: boolean;
|
|
5
|
+
rows: {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
heading: string;
|
|
9
|
+
saved: import("../../models.js").SourceControlCredential | undefined;
|
|
10
|
+
defaultOpen: boolean;
|
|
11
|
+
canEdit: boolean;
|
|
12
|
+
unlisted: boolean;
|
|
13
|
+
connected: boolean;
|
|
14
|
+
token: string;
|
|
15
|
+
tokenLabel: string;
|
|
16
|
+
hint: string;
|
|
17
|
+
saving: boolean;
|
|
18
|
+
error: string | null;
|
|
19
|
+
disabled: boolean;
|
|
20
|
+
help: string;
|
|
21
|
+
tokenPageUrl: string | undefined;
|
|
22
|
+
hasGuidance: boolean;
|
|
23
|
+
fields: {
|
|
24
|
+
name: string;
|
|
25
|
+
label: string;
|
|
26
|
+
value: string;
|
|
27
|
+
secret: boolean;
|
|
28
|
+
required: boolean;
|
|
29
|
+
hint: string | undefined;
|
|
30
|
+
onValueChange({ value }: {
|
|
31
|
+
value: string;
|
|
32
|
+
}): void;
|
|
33
|
+
}[];
|
|
34
|
+
onToken({ value }: {
|
|
35
|
+
value: string;
|
|
36
|
+
}): void;
|
|
37
|
+
save(): void;
|
|
38
|
+
}[];
|
|
39
|
+
errors: string[];
|
|
40
|
+
reload(): void;
|
|
41
|
+
canManage: boolean;
|
|
42
|
+
manage(): void;
|
|
43
|
+
};
|
|
44
|
+
export type SourceControlRowView = ReturnType<typeof useProvidersTab>['rows'][number];
|
|
45
|
+
//# sourceMappingURL=ProvidersTab.hooks.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useController } from '../../../react/use-controller.js';
|
|
2
|
+
import { createSourceControlController } from '../../controllers/source-control.controller.js';
|
|
3
|
+
import { blankSourceControlDraft, sourceControlProviders, defaultSourceControlCredential, sourceControlReady, safeSourceControlUrl } from '../../rules.js';
|
|
4
|
+
import { useSourceControlPorts } from './SourceControlPorts.hooks.js';
|
|
5
|
+
export function useProvidersTab({ permissions = [] }, _optional = {}) {
|
|
6
|
+
const ports = useSourceControlPorts({}), key = permissions.join('\0'), canRead = permissions.includes('source-control.read'), canWrite = canRead && permissions.includes('source-control.credentials.write');
|
|
7
|
+
const { controller, snapshot: state } = useController({ create: () => createSourceControlController({ api: ports.sourceControlApi, permissions }), dependencies: [ports.sourceControlApi, key] }, { start: ({ controller }) => { void controller.load({}); } });
|
|
8
|
+
const infos = sourceControlProviders({ providers: state?.providers ?? [], credentials: state?.credentials ?? [] });
|
|
9
|
+
const first = infos.find(p => p.listed && !defaultSourceControlCredential({ credentials: state?.credentials ?? [], providerId: p.id }))?.id;
|
|
10
|
+
const rows = infos.map(info => {
|
|
11
|
+
const saved = defaultSourceControlCredential({ credentials: state?.credentials ?? [], providerId: info.id }), draft = state?.drafts[info.id] ?? blankSourceControlDraft({});
|
|
12
|
+
return { id: info.id, label: info.label, heading: saved ? info.label : `Connect ${info.label}`, saved, defaultOpen: info.id === first, canEdit: canWrite && info.listed, unlisted: !info.listed, connected: !!saved,
|
|
13
|
+
token: draft.token, tokenLabel: `${info.label} ${info.tokenLabel}`, hint: saved ? 'Leave blank to keep the current token.' : 'Once saved, the token is never displayed again.', saving: draft.saving, error: draft.error,
|
|
14
|
+
disabled: !canWrite || !sourceControlReady({ info, draft }), help: info.help, tokenPageUrl: safeSourceControlUrl({ url: info.tokenPageUrl }), hasGuidance: !!info.help || !!safeSourceControlUrl({ url: info.tokenPageUrl }),
|
|
15
|
+
fields: info.fields.map(field => ({ name: field.name, label: `${info.label} ${field.label}`, value: draft.values[field.name] ?? '', secret: !!field.secret, required: !!field.required, hint: field.userHelp ?? field.hint ?? field.help, onValueChange({ value }) { controller?.setField({ providerId: info.id, name: field.name, value }); } })),
|
|
16
|
+
onToken({ value }) { controller?.setToken({ providerId: info.id, value }); }, save() { void controller?.save({ providerId: info.id }); }, };
|
|
17
|
+
});
|
|
18
|
+
return { denied: !canRead, loading: !state || state.loading, rows, errors: [state?.error, state?.catalogError].filter((s) => !!s), reload() { void controller?.load({}); }, canManage: !!ports.sourceControlNavigation, manage() { ports.sourceControlNavigation?.open({ kind: 'source-control' }); } };
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=ProvidersTab.hooks.js.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { SourceControlRowView } from './ProvidersTab.hooks.js';
|
|
2
|
+
/** ui-kit's opaque attrs carry semantic metadata, not arbitrary input attributes.
|
|
3
|
+
* Use its forwarded input ref for credential autofill policy. Chrome ignores off for
|
|
4
|
+
* credential-shaped fields, so secret fields explicitly opt into new-password. */
|
|
5
|
+
export declare function useSourceControlCredentialFields({ row }: {
|
|
6
|
+
row: SourceControlRowView;
|
|
7
|
+
}, _optional?: {}): {
|
|
8
|
+
tokenRef: (node: HTMLInputElement | null) => void;
|
|
9
|
+
fields: {
|
|
10
|
+
ref(node: HTMLInputElement | null): void;
|
|
11
|
+
name: string;
|
|
12
|
+
label: string;
|
|
13
|
+
value: string;
|
|
14
|
+
secret: boolean;
|
|
15
|
+
required: boolean;
|
|
16
|
+
hint: string | undefined;
|
|
17
|
+
onValueChange({ value }: {
|
|
18
|
+
value: string;
|
|
19
|
+
}): void;
|
|
20
|
+
}[];
|
|
21
|
+
id: string;
|
|
22
|
+
label: string;
|
|
23
|
+
heading: string;
|
|
24
|
+
saved: import("../../models.js").SourceControlCredential | undefined;
|
|
25
|
+
defaultOpen: boolean;
|
|
26
|
+
canEdit: boolean;
|
|
27
|
+
unlisted: boolean;
|
|
28
|
+
connected: boolean;
|
|
29
|
+
token: string;
|
|
30
|
+
tokenLabel: string;
|
|
31
|
+
hint: string;
|
|
32
|
+
saving: boolean;
|
|
33
|
+
error: string | null;
|
|
34
|
+
disabled: boolean;
|
|
35
|
+
help: string;
|
|
36
|
+
tokenPageUrl: string | undefined;
|
|
37
|
+
hasGuidance: boolean;
|
|
38
|
+
onToken({ value }: {
|
|
39
|
+
value: string;
|
|
40
|
+
}): void;
|
|
41
|
+
save(): void;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=SourceControlCredentialFields.hooks.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
/** ui-kit's opaque attrs carry semantic metadata, not arbitrary input attributes.
|
|
3
|
+
* Use its forwarded input ref for credential autofill policy. Chrome ignores off for
|
|
4
|
+
* credential-shaped fields, so secret fields explicitly opt into new-password. */
|
|
5
|
+
export function useSourceControlCredentialFields({ row }, _optional = {}) {
|
|
6
|
+
const tokenRef = useCallback((node) => { node?.setAttribute('autocomplete', 'new-password'); }, []);
|
|
7
|
+
return { ...row, tokenRef, fields: row.fields.map(field => ({ ...field, ref(node) { node?.setAttribute('autocomplete', field.secret ? 'new-password' : 'off'); } })) };
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=SourceControlCredentialFields.hooks.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ModulePageProps } from '../../../react/bind-react.js';
|
|
2
|
+
export declare function useSourceControlPage(props: ModulePageProps, _optional?: {}): {
|
|
3
|
+
denied: boolean;
|
|
4
|
+
ActiveTab: import("react").LazyExoticComponent<import("react").ComponentType<import("../../../react/bind-react.js").TabViewProps>> | undefined;
|
|
5
|
+
params: Readonly<Record<string, unknown>>;
|
|
6
|
+
permissions: readonly string[];
|
|
7
|
+
active: string;
|
|
8
|
+
items: {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
content: null;
|
|
12
|
+
}[];
|
|
13
|
+
onValueChange({ value }: {
|
|
14
|
+
value: string;
|
|
15
|
+
}): void;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=SourceControlPage.hooks.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export function useSourceControlPage(props, _optional = {}) {
|
|
2
|
+
const active = props.description.tabs.find(t => t.visible && t.id.endsWith(`.${props.requestedTab ?? 'providers'}`)) ?? props.description.tabs.find(t => t.visible);
|
|
3
|
+
return { denied: !props.description.visible, ActiveTab: active ? props.tabs.providers : undefined, params: active?.params ?? {}, permissions: props.description.grants, active: 'providers', items: [{ id: 'providers', label: 'Providers', content: null }], onValueChange({ value }) { props.onTabChange?.({ tab: value }); } };
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=SourceControlPage.hooks.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SourceControlApiPort } from '../../ports.js';
|
|
2
|
+
import type { CredentialManagementPort } from '../../../contracts/credential-management.js';
|
|
3
|
+
export interface SourceControlPorts {
|
|
4
|
+
readonly sourceControlApi: SourceControlApiPort;
|
|
5
|
+
readonly sourceControlNavigation?: CredentialManagementPort;
|
|
6
|
+
}
|
|
7
|
+
export declare const SourceControlPortsContext: import("react").Context<SourceControlPorts | null>;
|
|
8
|
+
export declare function useSourceControlPorts(_required?: Record<string, never>, _optional?: {}): SourceControlPorts;
|
|
9
|
+
//# sourceMappingURL=SourceControlPorts.hooks.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
import { AdminConfigError } from '../../../core/module/index.js';
|
|
3
|
+
export const SourceControlPortsContext = createContext(null);
|
|
4
|
+
export function useSourceControlPorts(_required = {}, _optional = {}) { const ports = useContext(SourceControlPortsContext); if (!ports)
|
|
5
|
+
throw new AdminConfigError({ issues: ['React scope unavailable: source-control'] }); return ports; }
|
|
6
|
+
//# sourceMappingURL=SourceControlPorts.hooks.js.map
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
export { useSourceControlPorts } from './hooks/SourceControlPorts.hooks.js';
|
|
2
|
+
export declare function sourceControl(_required: Record<string, never>, _optional?: {}): {
|
|
3
|
+
id: "source-control";
|
|
4
|
+
requires: {
|
|
5
|
+
readonly sourceControlApi: import("../../core/module/token.js").AdminPortToken<import("../ports.js").SourceControlApiPort, "admin.source-control.api">;
|
|
6
|
+
};
|
|
7
|
+
optional: {
|
|
8
|
+
readonly sourceControlNavigation: import("../../core/module/token.js").AdminPortToken<import("../../contracts/credential-management.js").CredentialManagementPort, "admin.credentials.management">;
|
|
9
|
+
};
|
|
10
|
+
messages: Readonly<{
|
|
11
|
+
title: "Source Control";
|
|
12
|
+
providers: "Providers";
|
|
13
|
+
description: "Connect an account to read repositories and push to them later. Content versioning is a separate feature.";
|
|
14
|
+
denied: "Permission denied";
|
|
15
|
+
saved: "Token saved";
|
|
16
|
+
replace: "Replace token";
|
|
17
|
+
manage: "Create access token";
|
|
18
|
+
loading: "Loading connections…";
|
|
19
|
+
}>;
|
|
20
|
+
pages: {
|
|
21
|
+
readonly sourceControl: {
|
|
22
|
+
readonly path: "/source-control";
|
|
23
|
+
readonly label: "Source Control";
|
|
24
|
+
readonly permissions: readonly ["source-control.read"];
|
|
25
|
+
readonly nav: {
|
|
26
|
+
readonly group: "operations";
|
|
27
|
+
readonly icon: "git";
|
|
28
|
+
};
|
|
29
|
+
readonly tabs: {
|
|
30
|
+
readonly providers: {
|
|
31
|
+
readonly label: "Providers";
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
} & {
|
|
37
|
+
react: {
|
|
38
|
+
module: {
|
|
39
|
+
id: "source-control";
|
|
40
|
+
requires: {
|
|
41
|
+
readonly sourceControlApi: import("../../core/module/token.js").AdminPortToken<import("../ports.js").SourceControlApiPort, "admin.source-control.api">;
|
|
42
|
+
};
|
|
43
|
+
optional: {
|
|
44
|
+
readonly sourceControlNavigation: import("../../core/module/token.js").AdminPortToken<import("../../contracts/credential-management.js").CredentialManagementPort, "admin.credentials.management">;
|
|
45
|
+
};
|
|
46
|
+
messages: Readonly<{
|
|
47
|
+
title: "Source Control";
|
|
48
|
+
providers: "Providers";
|
|
49
|
+
description: "Connect an account to read repositories and push to them later. Content versioning is a separate feature.";
|
|
50
|
+
denied: "Permission denied";
|
|
51
|
+
saved: "Token saved";
|
|
52
|
+
replace: "Replace token";
|
|
53
|
+
manage: "Create access token";
|
|
54
|
+
loading: "Loading connections…";
|
|
55
|
+
}>;
|
|
56
|
+
pages: {
|
|
57
|
+
readonly sourceControl: {
|
|
58
|
+
readonly path: "/source-control";
|
|
59
|
+
readonly label: "Source Control";
|
|
60
|
+
readonly permissions: readonly ["source-control.read"];
|
|
61
|
+
readonly nav: {
|
|
62
|
+
readonly group: "operations";
|
|
63
|
+
readonly icon: "git";
|
|
64
|
+
};
|
|
65
|
+
readonly tabs: {
|
|
66
|
+
readonly providers: {
|
|
67
|
+
readonly label: "Providers";
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
pages: {
|
|
74
|
+
readonly sourceControl: {
|
|
75
|
+
Page: import("react").LazyExoticComponent<import("react").ComponentType<import("../../react/bind-react.js").ModulePageProps>>;
|
|
76
|
+
tabs: {
|
|
77
|
+
readonly providers: import("react").LazyExoticComponent<import("react").ComponentType<import("../../react/bind-react.js").TabViewProps>>;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
Provider: ({ admin, children }: {
|
|
82
|
+
admin: import("../../core/module/types.js").AdminInstance;
|
|
83
|
+
children: import("react").ReactNode;
|
|
84
|
+
}, _optional?: Record<string, never>) => import("react").FunctionComponentElement<import("react").ProviderProps<import("../../core/module/types.js").ScopedPorts<{
|
|
85
|
+
id: "source-control";
|
|
86
|
+
requires: {
|
|
87
|
+
readonly sourceControlApi: import("../../core/module/token.js").AdminPortToken<import("../ports.js").SourceControlApiPort, "admin.source-control.api">;
|
|
88
|
+
};
|
|
89
|
+
optional: {
|
|
90
|
+
readonly sourceControlNavigation: import("../../core/module/token.js").AdminPortToken<import("../../contracts/credential-management.js").CredentialManagementPort, "admin.credentials.management">;
|
|
91
|
+
};
|
|
92
|
+
messages: Readonly<{
|
|
93
|
+
title: "Source Control";
|
|
94
|
+
providers: "Providers";
|
|
95
|
+
description: "Connect an account to read repositories and push to them later. Content versioning is a separate feature.";
|
|
96
|
+
denied: "Permission denied";
|
|
97
|
+
saved: "Token saved";
|
|
98
|
+
replace: "Replace token";
|
|
99
|
+
manage: "Create access token";
|
|
100
|
+
loading: "Loading connections…";
|
|
101
|
+
}>;
|
|
102
|
+
pages: {
|
|
103
|
+
readonly sourceControl: {
|
|
104
|
+
readonly path: "/source-control";
|
|
105
|
+
readonly label: "Source Control";
|
|
106
|
+
readonly permissions: readonly ["source-control.read"];
|
|
107
|
+
readonly nav: {
|
|
108
|
+
readonly group: "operations";
|
|
109
|
+
readonly icon: "git";
|
|
110
|
+
};
|
|
111
|
+
readonly tabs: {
|
|
112
|
+
readonly providers: {
|
|
113
|
+
readonly label: "Providers";
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
}> | null>>;
|
|
119
|
+
usePorts: (_required?: Record<string, never>, _optional?: Record<string, never>) => import("../../core/module/types.js").ScopedPorts<{
|
|
120
|
+
id: "source-control";
|
|
121
|
+
requires: {
|
|
122
|
+
readonly sourceControlApi: import("../../core/module/token.js").AdminPortToken<import("../ports.js").SourceControlApiPort, "admin.source-control.api">;
|
|
123
|
+
};
|
|
124
|
+
optional: {
|
|
125
|
+
readonly sourceControlNavigation: import("../../core/module/token.js").AdminPortToken<import("../../contracts/credential-management.js").CredentialManagementPort, "admin.credentials.management">;
|
|
126
|
+
};
|
|
127
|
+
messages: Readonly<{
|
|
128
|
+
title: "Source Control";
|
|
129
|
+
providers: "Providers";
|
|
130
|
+
description: "Connect an account to read repositories and push to them later. Content versioning is a separate feature.";
|
|
131
|
+
denied: "Permission denied";
|
|
132
|
+
saved: "Token saved";
|
|
133
|
+
replace: "Replace token";
|
|
134
|
+
manage: "Create access token";
|
|
135
|
+
loading: "Loading connections…";
|
|
136
|
+
}>;
|
|
137
|
+
pages: {
|
|
138
|
+
readonly sourceControl: {
|
|
139
|
+
readonly path: "/source-control";
|
|
140
|
+
readonly label: "Source Control";
|
|
141
|
+
readonly permissions: readonly ["source-control.read"];
|
|
142
|
+
readonly nav: {
|
|
143
|
+
readonly group: "operations";
|
|
144
|
+
readonly icon: "git";
|
|
145
|
+
};
|
|
146
|
+
readonly tabs: {
|
|
147
|
+
readonly providers: {
|
|
148
|
+
readonly label: "Providers";
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
}>;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { bindReact } from '../../react/bind-react.js';
|
|
2
|
+
import { sourceControlModule } from '../source-control.module.js';
|
|
3
|
+
import { SourceControlPortsContext } from './hooks/SourceControlPorts.hooks.js';
|
|
4
|
+
export { useSourceControlPorts } from './hooks/SourceControlPorts.hooks.js';
|
|
5
|
+
export function sourceControl(_required, _optional = {}) {
|
|
6
|
+
const module = { ...sourceControlModule };
|
|
7
|
+
const react = bindReact({ module, views: { sourceControl: { page: () => import('./pages/SourceControlPage.js'), tabs: { providers: () => import('./tabs/ProvidersTab.js') } } } }, { context: SourceControlPortsContext });
|
|
8
|
+
return Object.assign(module, { react });
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense } from 'react';
|
|
3
|
+
import { Notice, Spinner, Tabs } from '@jini-ai/ui-kit/react';
|
|
4
|
+
import { useSourceControlPage } from '../hooks/SourceControlPage.hooks.js';
|
|
5
|
+
import { sourceControlMessagesEn as m } from '../../messages.en.js';
|
|
6
|
+
export function SourceControlPage(props, _optional = {}) {
|
|
7
|
+
const vm = useSourceControlPage(props);
|
|
8
|
+
return _jsxs("section", { "data-jini-part": "source-control.page", children: [_jsx("p", { children: "Operations" }), _jsx("h1", { children: props.description.label }), vm.denied ? _jsx(Notice, { tone: "danger", children: m.denied }) : _jsxs(_Fragment, { children: [_jsx("p", { children: m.description }), _jsx(Tabs, { label: "Source control views", value: vm.active, items: vm.items, onValueChange: vm.onValueChange }), _jsx(Suspense, { fallback: _jsx(Spinner, { label: m.loading }), children: vm.ActiveTab && _jsx(vm.ActiveTab, { params: vm.params, permissions: vm.permissions }) })] })] });
|
|
9
|
+
}
|
|
10
|
+
export default SourceControlPage;
|
|
11
|
+
//# sourceMappingURL=SourceControlPage.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Notice, Spinner } from '@jini-ai/ui-kit/react';
|
|
3
|
+
import { useProvidersTab } from '../hooks/ProvidersTab.hooks.js';
|
|
4
|
+
import { SourceControlProviderRow } from '../components/SourceControlProviderRow.js';
|
|
5
|
+
export function ProvidersTab(props, _optional = {}) {
|
|
6
|
+
const vm = useProvidersTab(props);
|
|
7
|
+
return vm.denied ? _jsx(Notice, { tone: "danger", children: "Permission denied" }) : _jsxs("section", { children: [vm.errors.map(error => _jsx(Notice, { tone: "danger", children: error }, error)), vm.loading && _jsx(Spinner, { label: "Loading connections\u2026" }), _jsx(Button, { onPress: vm.reload, disabled: vm.loading, children: "Reload connections" }), vm.rows.map(row => _jsx(SourceControlProviderRow, { row: row }, row.id)), vm.canManage && _jsxs("p", { children: ["Need a second named token or want to rename one? ", _jsx(Button, { variant: "ghost", onPress: vm.manage, children: "Create access token" })] })] });
|
|
8
|
+
}
|
|
9
|
+
export default ProvidersTab;
|
|
10
|
+
//# sourceMappingURL=ProvidersTab.js.map
|