@iblai/iblai-js 2.67.3 → 2.68.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/dist/web-containers/source/account-sheet.js +2 -2
- package/dist/web-containers/source/account-sheet.js.map +1 -1
- package/dist/web-containers/source/account.js +39 -21
- package/dist/web-containers/source/account.js.map +1 -1
- package/dist/web-containers/source/api/api-field-label.js +14 -0
- package/dist/web-containers/source/api/api-field-label.js.map +1 -0
- package/dist/web-containers/source/{profile/integration/api-tab → api}/api-key-modal.js +8 -8
- package/dist/web-containers/source/api/api-key-modal.js.map +1 -0
- package/dist/web-containers/source/api/api-keys-table.js +61 -0
- package/dist/web-containers/source/api/api-keys-table.js.map +1 -0
- package/dist/web-containers/source/{api-tab → api}/api-token-utils.js +34 -1
- package/dist/web-containers/source/api/api-token-utils.js.map +1 -0
- package/dist/web-containers/source/{integration/api-tab → api}/constants.js +0 -1
- package/dist/web-containers/source/api/constants.js.map +1 -0
- package/dist/web-containers/source/{profile/integration/api-tab → api}/create-api-modal.js +19 -26
- package/dist/web-containers/source/api/create-api-modal.js.map +1 -0
- package/dist/web-containers/source/api/delete-api-modal.js +31 -0
- package/dist/web-containers/source/api/delete-api-modal.js.map +1 -0
- package/dist/web-containers/source/{api-tab → api}/edit-api-modal.js +34 -28
- package/dist/web-containers/source/api/edit-api-modal.js.map +1 -0
- package/dist/web-containers/source/api/expiration-date-field.js +35 -0
- package/dist/web-containers/source/api/expiration-date-field.js.map +1 -0
- package/dist/web-containers/source/api/index.js +30 -0
- package/dist/web-containers/source/api/index.js.map +1 -0
- package/dist/web-containers/source/{integration/api-tab → api}/token-policy-fields.js +6 -6
- package/dist/web-containers/source/api/token-policy-fields.js.map +1 -0
- package/dist/web-containers/source/api-field-label.js +14 -0
- package/dist/web-containers/source/api-field-label.js.map +1 -0
- package/dist/web-containers/source/api-keys-table.js +61 -0
- package/dist/web-containers/source/api-keys-table.js.map +1 -0
- package/dist/web-containers/source/api-tab/create-api-modal.js +4 -4
- package/dist/web-containers/source/api-tab/labels.js +23 -19
- package/dist/web-containers/source/api-tab/labels.js.map +1 -1
- package/dist/web-containers/source/api-tab.js +15 -20
- package/dist/web-containers/source/api-tab.js.map +1 -1
- package/dist/web-containers/source/api-token-utils.js +34 -1
- package/dist/web-containers/source/api-token-utils.js.map +1 -1
- package/dist/web-containers/source/azure-config.js +37 -0
- package/dist/web-containers/source/azure-config.js.map +1 -0
- package/dist/web-containers/source/azure-model-fields.js +118 -0
- package/dist/web-containers/source/azure-model-fields.js.map +1 -0
- package/dist/web-containers/source/claw-sandbox/virtual-machine-network-section.js +147 -24
- package/dist/web-containers/source/claw-sandbox/virtual-machine-network-section.js.map +1 -1
- package/dist/web-containers/source/components/claw-sandbox/virtual-machine-network-section.js +147 -24
- package/dist/web-containers/source/components/claw-sandbox/virtual-machine-network-section.js.map +1 -1
- package/dist/web-containers/source/components/document-sidebar.js +5 -4
- package/dist/web-containers/source/components/document-sidebar.js.map +1 -1
- package/dist/web-containers/source/components/field-info.js +18 -0
- package/dist/web-containers/source/components/field-info.js.map +1 -0
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/api-tab/create-api-modal.js +4 -4
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/api-tab/labels.js +23 -19
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/api-tab/labels.js.map +1 -1
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/api-tab.js +15 -20
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/api-tab.js.map +1 -1
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/mcp-tab/connector-dialogs.js +1 -1
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/mcp-tab/oauth-app-fields.js +2 -2
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/mcp-tab/oauth-app-fields.js.map +1 -1
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/skills-tab/index.js +1 -1
- package/dist/web-containers/source/components/modals/user-profile-modal.js +4 -4
- package/dist/web-containers/source/components/modals/user-profile-modal.js.map +1 -1
- package/dist/web-containers/source/components/platform-sidebar/account-sheet.js +2 -2
- package/dist/web-containers/source/components/platform-sidebar/account-sheet.js.map +1 -1
- package/dist/web-containers/source/components/platform-sidebar/footer.js +15 -14
- package/dist/web-containers/source/components/platform-sidebar/footer.js.map +1 -1
- package/dist/web-containers/source/components/platform-sidebar/index.js +0 -2
- package/dist/web-containers/source/components/platform-sidebar/index.js.map +1 -1
- package/dist/web-containers/source/components/profile/account.js +39 -21
- package/dist/web-containers/source/components/profile/account.js.map +1 -1
- package/dist/web-containers/source/components/profile/api/api-field-label.js +14 -0
- package/dist/web-containers/source/components/profile/api/api-field-label.js.map +1 -0
- package/dist/web-containers/source/{integration/api-tab → components/profile/api}/api-key-modal.js +8 -8
- package/dist/web-containers/source/components/profile/api/api-key-modal.js.map +1 -0
- package/dist/web-containers/source/components/profile/api/api-keys-table.js +61 -0
- package/dist/web-containers/source/components/profile/api/api-keys-table.js.map +1 -0
- package/dist/web-containers/source/{integration/api-tab → components/profile/api}/api-token-utils.js +34 -1
- package/dist/web-containers/source/components/profile/api/api-token-utils.js.map +1 -0
- package/dist/web-containers/source/components/profile/{integration/api-tab → api}/constants.js +0 -1
- package/dist/web-containers/source/components/profile/api/constants.js.map +1 -0
- package/dist/web-containers/source/{integration/api-tab → components/profile/api}/create-api-modal.js +19 -26
- package/dist/web-containers/source/components/profile/api/create-api-modal.js.map +1 -0
- package/dist/web-containers/source/components/profile/api/delete-api-modal.js +31 -0
- package/dist/web-containers/source/components/profile/api/delete-api-modal.js.map +1 -0
- package/dist/web-containers/source/components/profile/{integration/api-tab → api}/edit-api-modal.js +34 -28
- package/dist/web-containers/source/components/profile/api/edit-api-modal.js.map +1 -0
- package/dist/web-containers/source/components/profile/api/expiration-date-field.js +35 -0
- package/dist/web-containers/source/components/profile/api/expiration-date-field.js.map +1 -0
- package/dist/web-containers/source/components/profile/api/index.js +30 -0
- package/dist/web-containers/source/components/profile/api/index.js.map +1 -0
- package/dist/web-containers/source/{profile/integration/api-tab → components/profile/api}/token-policy-fields.js +6 -6
- package/dist/web-containers/source/components/profile/api/token-policy-fields.js.map +1 -0
- package/dist/web-containers/source/components/profile/info-banner.js +3 -1
- package/dist/web-containers/source/components/profile/info-banner.js.map +1 -1
- package/dist/web-containers/source/components/profile/integration/index.js +17 -38
- package/dist/web-containers/source/components/profile/integration/index.js.map +1 -1
- package/dist/web-containers/source/components/profile/secrets/index.js +106 -0
- package/dist/web-containers/source/components/profile/secrets/index.js.map +1 -0
- package/dist/web-containers/source/components/profile/secrets/secrets-list.js +237 -0
- package/dist/web-containers/source/components/profile/secrets/secrets-list.js.map +1 -0
- package/dist/web-containers/source/components/profile/virtual-machine-admin/index.js +12 -18
- package/dist/web-containers/source/components/profile/virtual-machine-admin/index.js.map +1 -1
- package/dist/web-containers/source/components/profile/virtual-machine-admin/network-policies-section.js +5 -4
- package/dist/web-containers/source/components/profile/virtual-machine-admin/network-policies-section.js.map +1 -1
- package/dist/web-containers/source/components/tooltip-icon-button.js +15 -0
- package/dist/web-containers/source/components/tooltip-icon-button.js.map +1 -0
- package/dist/web-containers/source/components/user-profile-dropdown/index.js +2 -0
- package/dist/web-containers/source/components/user-profile-dropdown/index.js.map +1 -1
- package/dist/web-containers/source/components/virtual-machine/azure-config.js +37 -0
- package/dist/web-containers/source/components/virtual-machine/azure-config.js.map +1 -0
- package/dist/web-containers/source/components/virtual-machine/azure-model-fields.js +118 -0
- package/dist/web-containers/source/components/virtual-machine/azure-model-fields.js.map +1 -0
- package/dist/web-containers/source/components/virtual-machine/credential-options.js +268 -22
- package/dist/web-containers/source/components/virtual-machine/credential-options.js.map +1 -1
- package/dist/web-containers/source/components/virtual-machine/host-port-chip-input.js +14 -8
- package/dist/web-containers/source/components/virtual-machine/host-port-chip-input.js.map +1 -1
- package/dist/web-containers/source/components/virtual-machine/network-policy-dialog.js +30 -6
- package/dist/web-containers/source/components/virtual-machine/network-policy-dialog.js.map +1 -1
- package/dist/web-containers/source/components/virtual-machine/secret-rows.js +66 -0
- package/dist/web-containers/source/components/virtual-machine/secret-rows.js.map +1 -0
- package/dist/web-containers/source/components/virtual-machine/vm-secret-dialog.js +848 -158
- package/dist/web-containers/source/components/virtual-machine/vm-secret-dialog.js.map +1 -1
- package/dist/web-containers/source/connector-dialogs.js +1 -1
- package/dist/web-containers/source/constants.js +55 -22
- package/dist/web-containers/source/constants.js.map +1 -1
- package/dist/web-containers/source/create-api-modal.js +4 -4
- package/dist/web-containers/source/credential-options.js +268 -22
- package/dist/web-containers/source/credential-options.js.map +1 -1
- package/dist/web-containers/source/document-preview.js +14 -6
- package/dist/web-containers/source/document-preview.js.map +1 -1
- package/dist/web-containers/source/document-sidebar.js +5 -4
- package/dist/web-containers/source/document-sidebar.js.map +1 -1
- package/dist/web-containers/source/edit-api-modal.js +34 -28
- package/dist/web-containers/source/edit-api-modal.js.map +1 -1
- package/dist/web-containers/source/edit-mentor-modal/tabs/api-tab/create-api-modal.js +4 -4
- package/dist/web-containers/source/edit-mentor-modal/tabs/api-tab/labels.js +23 -19
- package/dist/web-containers/source/edit-mentor-modal/tabs/api-tab/labels.js.map +1 -1
- package/dist/web-containers/source/edit-mentor-modal/tabs/api-tab.js +15 -20
- package/dist/web-containers/source/edit-mentor-modal/tabs/api-tab.js.map +1 -1
- package/dist/web-containers/source/edit-mentor-modal/tabs/mcp-tab/connector-dialogs.js +1 -1
- package/dist/web-containers/source/edit-mentor-modal/tabs/mcp-tab/oauth-app-fields.js +2 -2
- package/dist/web-containers/source/edit-mentor-modal/tabs/mcp-tab/oauth-app-fields.js.map +1 -1
- package/dist/web-containers/source/edit-mentor-modal/tabs/skills-tab/index.js +1 -1
- package/dist/web-containers/source/en.json.js +279 -227
- package/dist/web-containers/source/en.json.js.map +1 -1
- package/dist/web-containers/source/es.json.js +450 -398
- package/dist/web-containers/source/es.json.js.map +1 -1
- package/dist/web-containers/source/expiration-date-field.js +16 -10
- package/dist/web-containers/source/expiration-date-field.js.map +1 -1
- package/dist/web-containers/source/field-info.js +11 -7
- package/dist/web-containers/source/field-info.js.map +1 -1
- package/dist/web-containers/source/footer.js +15 -14
- package/dist/web-containers/source/footer.js.map +1 -1
- package/dist/web-containers/source/fr.json.js +458 -406
- package/dist/web-containers/source/fr.json.js.map +1 -1
- package/dist/web-containers/source/host-port-chip-input.js +14 -8
- package/dist/web-containers/source/host-port-chip-input.js.map +1 -1
- package/dist/web-containers/source/i18n/messages/en.json.js +279 -227
- package/dist/web-containers/source/i18n/messages/en.json.js.map +1 -1
- package/dist/web-containers/source/i18n/messages/es.json.js +450 -398
- package/dist/web-containers/source/i18n/messages/es.json.js.map +1 -1
- package/dist/web-containers/source/i18n/messages/fr.json.js +458 -406
- package/dist/web-containers/source/i18n/messages/fr.json.js.map +1 -1
- package/dist/web-containers/source/i18n/messages/zh.json.js +457 -405
- package/dist/web-containers/source/i18n/messages/zh.json.js.map +1 -1
- package/dist/web-containers/source/info-banner.js +3 -1
- package/dist/web-containers/source/info-banner.js.map +1 -1
- package/dist/web-containers/source/integration/index.js +17 -38
- package/dist/web-containers/source/integration/index.js.map +1 -1
- package/dist/web-containers/source/lib/document-preview.js +14 -6
- package/dist/web-containers/source/lib/document-preview.js.map +1 -1
- package/dist/web-containers/source/mcp-tab/connector-dialogs.js +1 -1
- package/dist/web-containers/source/mcp-tab/oauth-app-fields.js +2 -2
- package/dist/web-containers/source/mcp-tab/oauth-app-fields.js.map +1 -1
- package/dist/web-containers/source/messages/en.json.js +279 -227
- package/dist/web-containers/source/messages/en.json.js.map +1 -1
- package/dist/web-containers/source/messages/es.json.js +450 -398
- package/dist/web-containers/source/messages/es.json.js.map +1 -1
- package/dist/web-containers/source/messages/fr.json.js +458 -406
- package/dist/web-containers/source/messages/fr.json.js.map +1 -1
- package/dist/web-containers/source/messages/zh.json.js +457 -405
- package/dist/web-containers/source/messages/zh.json.js.map +1 -1
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/api-tab/create-api-modal.js +4 -4
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/api-tab/labels.js +23 -19
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/api-tab/labels.js.map +1 -1
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/api-tab.js +15 -20
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/api-tab.js.map +1 -1
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/mcp-tab/connector-dialogs.js +1 -1
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/mcp-tab/oauth-app-fields.js +2 -2
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/mcp-tab/oauth-app-fields.js.map +1 -1
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/skills-tab/index.js +1 -1
- package/dist/web-containers/source/modals/user-profile-modal.js +4 -4
- package/dist/web-containers/source/modals/user-profile-modal.js.map +1 -1
- package/dist/web-containers/source/network-policies-section.js +5 -4
- package/dist/web-containers/source/network-policies-section.js.map +1 -1
- package/dist/web-containers/source/network-policy-dialog.js +30 -6
- package/dist/web-containers/source/network-policy-dialog.js.map +1 -1
- package/dist/web-containers/source/oauth-app-fields.js +2 -2
- package/dist/web-containers/source/oauth-app-fields.js.map +1 -1
- package/dist/web-containers/source/platform-sidebar/account-sheet.js +2 -2
- package/dist/web-containers/source/platform-sidebar/account-sheet.js.map +1 -1
- package/dist/web-containers/source/platform-sidebar/footer.js +15 -14
- package/dist/web-containers/source/platform-sidebar/footer.js.map +1 -1
- package/dist/web-containers/source/platform-sidebar/index.js +0 -2
- package/dist/web-containers/source/platform-sidebar/index.js.map +1 -1
- package/dist/web-containers/source/profile/account.js +39 -21
- package/dist/web-containers/source/profile/account.js.map +1 -1
- package/dist/web-containers/source/profile/api/api-field-label.js +14 -0
- package/dist/web-containers/source/profile/api/api-field-label.js.map +1 -0
- package/dist/web-containers/source/{components/profile/integration/api-tab → profile/api}/api-key-modal.js +8 -8
- package/dist/web-containers/source/profile/api/api-key-modal.js.map +1 -0
- package/dist/web-containers/source/profile/api/api-keys-table.js +61 -0
- package/dist/web-containers/source/profile/api/api-keys-table.js.map +1 -0
- package/dist/web-containers/source/profile/{integration/api-tab → api}/api-token-utils.js +34 -1
- package/dist/web-containers/source/profile/api/api-token-utils.js.map +1 -0
- package/dist/web-containers/source/{api-tab → profile/api}/constants.js +0 -1
- package/dist/web-containers/source/profile/api/constants.js.map +1 -0
- package/dist/web-containers/source/{components/profile/integration/api-tab → profile/api}/create-api-modal.js +19 -26
- package/dist/web-containers/source/profile/api/create-api-modal.js.map +1 -0
- package/dist/web-containers/source/profile/api/delete-api-modal.js +31 -0
- package/dist/web-containers/source/profile/api/delete-api-modal.js.map +1 -0
- package/dist/web-containers/source/{integration/api-tab → profile/api}/edit-api-modal.js +34 -28
- package/dist/web-containers/source/profile/api/edit-api-modal.js.map +1 -0
- package/dist/web-containers/source/profile/api/expiration-date-field.js +35 -0
- package/dist/web-containers/source/profile/api/expiration-date-field.js.map +1 -0
- package/dist/web-containers/source/profile/api/index.js +30 -0
- package/dist/web-containers/source/profile/api/index.js.map +1 -0
- package/dist/web-containers/source/{api-tab → profile/api}/token-policy-fields.js +6 -6
- package/dist/web-containers/source/profile/api/token-policy-fields.js.map +1 -0
- package/dist/web-containers/source/profile/info-banner.js +3 -1
- package/dist/web-containers/source/profile/info-banner.js.map +1 -1
- package/dist/web-containers/source/profile/integration/index.js +17 -38
- package/dist/web-containers/source/profile/integration/index.js.map +1 -1
- package/dist/web-containers/source/profile/secrets/index.js +106 -0
- package/dist/web-containers/source/profile/secrets/index.js.map +1 -0
- package/dist/web-containers/source/profile/secrets/secrets-list.js +237 -0
- package/dist/web-containers/source/profile/secrets/secrets-list.js.map +1 -0
- package/dist/web-containers/source/profile/virtual-machine-admin/index.js +12 -18
- package/dist/web-containers/source/profile/virtual-machine-admin/index.js.map +1 -1
- package/dist/web-containers/source/profile/virtual-machine-admin/network-policies-section.js +5 -4
- package/dist/web-containers/source/profile/virtual-machine-admin/network-policies-section.js.map +1 -1
- package/dist/web-containers/source/secret-rows.js +66 -0
- package/dist/web-containers/source/secret-rows.js.map +1 -0
- package/dist/web-containers/source/secrets/index.js +106 -0
- package/dist/web-containers/source/secrets/index.js.map +1 -0
- package/dist/web-containers/source/secrets/secrets-list.js +237 -0
- package/dist/web-containers/source/secrets/secrets-list.js.map +1 -0
- package/dist/web-containers/source/secrets-list.js +237 -0
- package/dist/web-containers/source/secrets-list.js.map +1 -0
- package/dist/web-containers/source/skills-tab/index.js +1 -1
- package/dist/web-containers/source/tabs/api-tab/create-api-modal.js +4 -4
- package/dist/web-containers/source/tabs/api-tab/labels.js +23 -19
- package/dist/web-containers/source/tabs/api-tab/labels.js.map +1 -1
- package/dist/web-containers/source/tabs/api-tab.js +15 -20
- package/dist/web-containers/source/tabs/api-tab.js.map +1 -1
- package/dist/web-containers/source/tabs/mcp-tab/connector-dialogs.js +1 -1
- package/dist/web-containers/source/tabs/mcp-tab/oauth-app-fields.js +2 -2
- package/dist/web-containers/source/tabs/mcp-tab/oauth-app-fields.js.map +1 -1
- package/dist/web-containers/source/tabs/skills-tab/index.js +1 -1
- package/dist/web-containers/source/token-policy-fields.js +6 -6
- package/dist/web-containers/source/token-policy-fields.js.map +1 -1
- package/dist/web-containers/source/tooltip-icon-button.js +15 -0
- package/dist/web-containers/source/tooltip-icon-button.js.map +1 -0
- package/dist/web-containers/source/tsconfig.build.tsbuildinfo +1 -1
- package/dist/web-containers/source/user-profile-dropdown/index.js +2 -0
- package/dist/web-containers/source/user-profile-dropdown/index.js.map +1 -1
- package/dist/web-containers/source/user-profile-modal.js +4 -4
- package/dist/web-containers/source/user-profile-modal.js.map +1 -1
- package/dist/web-containers/source/virtual-machine/azure-config.js +37 -0
- package/dist/web-containers/source/virtual-machine/azure-config.js.map +1 -0
- package/dist/web-containers/source/virtual-machine/azure-model-fields.js +118 -0
- package/dist/web-containers/source/virtual-machine/azure-model-fields.js.map +1 -0
- package/dist/web-containers/source/virtual-machine/credential-options.js +268 -22
- package/dist/web-containers/source/virtual-machine/credential-options.js.map +1 -1
- package/dist/web-containers/source/virtual-machine/host-port-chip-input.js +14 -8
- package/dist/web-containers/source/virtual-machine/host-port-chip-input.js.map +1 -1
- package/dist/web-containers/source/virtual-machine/network-policy-dialog.js +30 -6
- package/dist/web-containers/source/virtual-machine/network-policy-dialog.js.map +1 -1
- package/dist/web-containers/source/virtual-machine/secret-rows.js +66 -0
- package/dist/web-containers/source/virtual-machine/secret-rows.js.map +1 -0
- package/dist/web-containers/source/virtual-machine/vm-secret-dialog.js +848 -158
- package/dist/web-containers/source/virtual-machine/vm-secret-dialog.js.map +1 -1
- package/dist/web-containers/source/virtual-machine-admin/index.js +12 -18
- package/dist/web-containers/source/virtual-machine-admin/index.js.map +1 -1
- package/dist/web-containers/source/virtual-machine-admin/network-policies-section.js +5 -4
- package/dist/web-containers/source/virtual-machine-admin/network-policies-section.js.map +1 -1
- package/dist/web-containers/source/virtual-machine-network-section.js +147 -24
- package/dist/web-containers/source/virtual-machine-network-section.js.map +1 -1
- package/dist/web-containers/source/vm-secret-dialog.js +848 -158
- package/dist/web-containers/source/vm-secret-dialog.js.map +1 -1
- package/dist/web-containers/source/web-containers/tsconfig.build.tsbuildinfo +1 -1
- package/dist/web-containers/source/zh.json.js +457 -405
- package/dist/web-containers/source/zh.json.js.map +1 -1
- package/package.json +4 -4
- package/dist/web-containers/source/api-tab/api-token-utils.js.map +0 -1
- package/dist/web-containers/source/api-tab/constants.js.map +0 -1
- package/dist/web-containers/source/api-tab/edit-api-modal.js.map +0 -1
- package/dist/web-containers/source/api-tab/expiration-date-field.js +0 -29
- package/dist/web-containers/source/api-tab/expiration-date-field.js.map +0 -1
- package/dist/web-containers/source/api-tab/integration-autogenerated-table.js +0 -42
- package/dist/web-containers/source/api-tab/integration-autogenerated-table.js.map +0 -1
- package/dist/web-containers/source/api-tab/token-policy-fields.js.map +0 -1
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/mcp-tab/field-info.js +0 -14
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/mcp-tab/field-info.js.map +0 -1
- package/dist/web-containers/source/components/profile/integration/api-tab/api-key-modal.js.map +0 -1
- package/dist/web-containers/source/components/profile/integration/api-tab/api-token-utils.js +0 -57
- package/dist/web-containers/source/components/profile/integration/api-tab/api-token-utils.js.map +0 -1
- package/dist/web-containers/source/components/profile/integration/api-tab/constants.js.map +0 -1
- package/dist/web-containers/source/components/profile/integration/api-tab/create-api-modal.js.map +0 -1
- package/dist/web-containers/source/components/profile/integration/api-tab/delete-api-modal.js +0 -31
- package/dist/web-containers/source/components/profile/integration/api-tab/delete-api-modal.js.map +0 -1
- package/dist/web-containers/source/components/profile/integration/api-tab/edit-api-modal.js.map +0 -1
- package/dist/web-containers/source/components/profile/integration/api-tab/expiration-date-field.js +0 -29
- package/dist/web-containers/source/components/profile/integration/api-tab/expiration-date-field.js.map +0 -1
- package/dist/web-containers/source/components/profile/integration/api-tab/integration-autogenerated-table.js +0 -42
- package/dist/web-containers/source/components/profile/integration/api-tab/integration-autogenerated-table.js.map +0 -1
- package/dist/web-containers/source/components/profile/integration/api-tab/token-policy-fields.js +0 -101
- package/dist/web-containers/source/components/profile/integration/api-tab/token-policy-fields.js.map +0 -1
- package/dist/web-containers/source/components/profile/integration/data-sources-tab/create-data-source-modal.js +0 -143
- package/dist/web-containers/source/components/profile/integration/data-sources-tab/create-data-source-modal.js.map +0 -1
- package/dist/web-containers/source/components/profile/integration/data-sources-tab/integration-data-sources-tab.js +0 -46
- package/dist/web-containers/source/components/profile/integration/data-sources-tab/integration-data-sources-tab.js.map +0 -1
- package/dist/web-containers/source/components/profile/integration/llms-tab/create-llm-modal.js +0 -287
- package/dist/web-containers/source/components/profile/integration/llms-tab/create-llm-modal.js.map +0 -1
- package/dist/web-containers/source/components/profile/integration/llms-tab/integration-llms-tab.js +0 -83
- package/dist/web-containers/source/components/profile/integration/llms-tab/integration-llms-tab.js.map +0 -1
- package/dist/web-containers/source/components/profile/virtual-machine-admin/vm-secrets-section.js +0 -109
- package/dist/web-containers/source/components/profile/virtual-machine-admin/vm-secrets-section.js.map +0 -1
- package/dist/web-containers/source/create-data-source-modal.js +0 -143
- package/dist/web-containers/source/create-data-source-modal.js.map +0 -1
- package/dist/web-containers/source/create-llm-modal.js +0 -287
- package/dist/web-containers/source/create-llm-modal.js.map +0 -1
- package/dist/web-containers/source/data-sources-tab/create-data-source-modal.js +0 -143
- package/dist/web-containers/source/data-sources-tab/create-data-source-modal.js.map +0 -1
- package/dist/web-containers/source/data-sources-tab/integration-data-sources-tab.js +0 -46
- package/dist/web-containers/source/data-sources-tab/integration-data-sources-tab.js.map +0 -1
- package/dist/web-containers/source/edit-mentor-modal/tabs/mcp-tab/field-info.js +0 -14
- package/dist/web-containers/source/edit-mentor-modal/tabs/mcp-tab/field-info.js.map +0 -1
- package/dist/web-containers/source/integration/api-tab/api-key-modal.js.map +0 -1
- package/dist/web-containers/source/integration/api-tab/api-token-utils.js.map +0 -1
- package/dist/web-containers/source/integration/api-tab/constants.js.map +0 -1
- package/dist/web-containers/source/integration/api-tab/create-api-modal.js.map +0 -1
- package/dist/web-containers/source/integration/api-tab/delete-api-modal.js +0 -31
- package/dist/web-containers/source/integration/api-tab/delete-api-modal.js.map +0 -1
- package/dist/web-containers/source/integration/api-tab/edit-api-modal.js.map +0 -1
- package/dist/web-containers/source/integration/api-tab/expiration-date-field.js +0 -29
- package/dist/web-containers/source/integration/api-tab/expiration-date-field.js.map +0 -1
- package/dist/web-containers/source/integration/api-tab/integration-autogenerated-table.js +0 -42
- package/dist/web-containers/source/integration/api-tab/integration-autogenerated-table.js.map +0 -1
- package/dist/web-containers/source/integration/api-tab/token-policy-fields.js.map +0 -1
- package/dist/web-containers/source/integration/data-sources-tab/create-data-source-modal.js +0 -143
- package/dist/web-containers/source/integration/data-sources-tab/create-data-source-modal.js.map +0 -1
- package/dist/web-containers/source/integration/data-sources-tab/integration-data-sources-tab.js +0 -46
- package/dist/web-containers/source/integration/data-sources-tab/integration-data-sources-tab.js.map +0 -1
- package/dist/web-containers/source/integration/llms-tab/create-llm-modal.js +0 -287
- package/dist/web-containers/source/integration/llms-tab/create-llm-modal.js.map +0 -1
- package/dist/web-containers/source/integration/llms-tab/integration-llms-tab.js +0 -83
- package/dist/web-containers/source/integration/llms-tab/integration-llms-tab.js.map +0 -1
- package/dist/web-containers/source/integration-autogenerated-table.js +0 -42
- package/dist/web-containers/source/integration-autogenerated-table.js.map +0 -1
- package/dist/web-containers/source/integration-data-sources-tab.js +0 -46
- package/dist/web-containers/source/integration-data-sources-tab.js.map +0 -1
- package/dist/web-containers/source/integration-llms-tab.js +0 -83
- package/dist/web-containers/source/integration-llms-tab.js.map +0 -1
- package/dist/web-containers/source/llms-tab/create-llm-modal.js +0 -287
- package/dist/web-containers/source/llms-tab/create-llm-modal.js.map +0 -1
- package/dist/web-containers/source/llms-tab/integration-llms-tab.js +0 -83
- package/dist/web-containers/source/llms-tab/integration-llms-tab.js.map +0 -1
- package/dist/web-containers/source/mcp-tab/field-info.js +0 -14
- package/dist/web-containers/source/mcp-tab/field-info.js.map +0 -1
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/mcp-tab/field-info.js +0 -14
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/mcp-tab/field-info.js.map +0 -1
- package/dist/web-containers/source/profile/integration/api-tab/api-key-modal.js.map +0 -1
- package/dist/web-containers/source/profile/integration/api-tab/api-token-utils.js.map +0 -1
- package/dist/web-containers/source/profile/integration/api-tab/constants.js +0 -24
- package/dist/web-containers/source/profile/integration/api-tab/constants.js.map +0 -1
- package/dist/web-containers/source/profile/integration/api-tab/create-api-modal.js.map +0 -1
- package/dist/web-containers/source/profile/integration/api-tab/delete-api-modal.js +0 -31
- package/dist/web-containers/source/profile/integration/api-tab/delete-api-modal.js.map +0 -1
- package/dist/web-containers/source/profile/integration/api-tab/edit-api-modal.js +0 -113
- package/dist/web-containers/source/profile/integration/api-tab/edit-api-modal.js.map +0 -1
- package/dist/web-containers/source/profile/integration/api-tab/expiration-date-field.js +0 -29
- package/dist/web-containers/source/profile/integration/api-tab/expiration-date-field.js.map +0 -1
- package/dist/web-containers/source/profile/integration/api-tab/integration-autogenerated-table.js +0 -42
- package/dist/web-containers/source/profile/integration/api-tab/integration-autogenerated-table.js.map +0 -1
- package/dist/web-containers/source/profile/integration/api-tab/token-policy-fields.js.map +0 -1
- package/dist/web-containers/source/profile/integration/data-sources-tab/create-data-source-modal.js +0 -143
- package/dist/web-containers/source/profile/integration/data-sources-tab/create-data-source-modal.js.map +0 -1
- package/dist/web-containers/source/profile/integration/data-sources-tab/integration-data-sources-tab.js +0 -46
- package/dist/web-containers/source/profile/integration/data-sources-tab/integration-data-sources-tab.js.map +0 -1
- package/dist/web-containers/source/profile/integration/llms-tab/create-llm-modal.js +0 -287
- package/dist/web-containers/source/profile/integration/llms-tab/create-llm-modal.js.map +0 -1
- package/dist/web-containers/source/profile/integration/llms-tab/integration-llms-tab.js +0 -83
- package/dist/web-containers/source/profile/integration/llms-tab/integration-llms-tab.js.map +0 -1
- package/dist/web-containers/source/profile/virtual-machine-admin/vm-secrets-section.js +0 -109
- package/dist/web-containers/source/profile/virtual-machine-admin/vm-secrets-section.js.map +0 -1
- package/dist/web-containers/source/tabs/mcp-tab/field-info.js +0 -14
- package/dist/web-containers/source/tabs/mcp-tab/field-info.js.map +0 -1
- package/dist/web-containers/source/virtual-machine-admin/vm-secrets-section.js +0 -109
- package/dist/web-containers/source/virtual-machine-admin/vm-secrets-section.js.map +0 -1
- package/dist/web-containers/source/vm-secrets-section.js +0 -109
- package/dist/web-containers/source/vm-secrets-section.js.map +0 -1
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
* audio, video, ZIPs, GitHub repos, YouTube videos, web pages and crawls, and
|
|
6
6
|
* links to Google Drive, OneDrive and Dropbox. Only some of those a browser
|
|
7
7
|
* can render on its own; the rest get no Preview button rather than a blank
|
|
8
|
-
* frame.
|
|
9
|
-
*
|
|
8
|
+
* frame. Web pages are opened in a new tab instead: many refuse framing, the
|
|
9
|
+
* passage highlight only works in a full tab, and in-frame sign-ins break.
|
|
10
|
+
* Decided from the source URL (extension and host) and, when the backend
|
|
11
|
+
* sends one, the document's kind.
|
|
10
12
|
*/
|
|
11
13
|
const IMAGE = new Set(['png', 'jpg', 'jpeg', 'gif', 'webp', 'svg', 'bmp', 'avif']);
|
|
12
14
|
const AUDIO = new Set(['mp3', 'wav', 'ogg', 'oga', 'm4a', 'aac', 'flac']);
|
|
@@ -30,6 +32,8 @@ const NOT_VIEWABLE = new Set([
|
|
|
30
32
|
'gz',
|
|
31
33
|
'tgz',
|
|
32
34
|
]);
|
|
35
|
+
/** Files a browser shows itself in a frame (its PDF viewer, or as text). */
|
|
36
|
+
const FRAMED_FILES = new Set(['pdf', 'txt', 'csv', 'tsv', 'md', 'markdown', 'json', 'xml', 'log']);
|
|
33
37
|
/** Hosts that refuse to be framed, or need the viewer's own sign-in. */
|
|
34
38
|
const UNFRAMEABLE_HOSTS = [
|
|
35
39
|
'github.com',
|
|
@@ -39,6 +43,8 @@ const UNFRAMEABLE_HOSTS = [
|
|
|
39
43
|
'sharepoint.com',
|
|
40
44
|
];
|
|
41
45
|
const hostMatches = (host, domain) => host === domain || host.endsWith(`.${domain}`);
|
|
46
|
+
/** Documents uploaded to a dataset are served by the DM, or from its S3 bucket. */
|
|
47
|
+
const isOurStorage = (url) => url.pathname.startsWith('/dm/') || hostMatches(url.hostname.toLowerCase(), 'amazonaws.com');
|
|
42
48
|
const extensionOf = (pathname) => {
|
|
43
49
|
var _a;
|
|
44
50
|
const last = (_a = pathname.split('/').pop()) !== null && _a !== void 0 ? _a : '';
|
|
@@ -95,6 +101,7 @@ const kindFromHint = (hint) => {
|
|
|
95
101
|
/**
|
|
96
102
|
* `null` when the document cannot be shown here: no URL, a host that refuses
|
|
97
103
|
* framing, or a file type a browser cannot render (Office files, archives).
|
|
104
|
+
* `page` for a web page, which is opened in a new tab rather than shown here.
|
|
98
105
|
*/
|
|
99
106
|
function previewPlan(source, hint) {
|
|
100
107
|
const raw = (source !== null && source !== void 0 ? source : '').trim();
|
|
@@ -109,8 +116,9 @@ function previewPlan(source, hint) {
|
|
|
109
116
|
}
|
|
110
117
|
const host = url.hostname.toLowerCase();
|
|
111
118
|
const yt = youtubeEmbed(url);
|
|
119
|
+
// YouTube's player refuses to start without a Referer ("Error 153").
|
|
112
120
|
if (yt)
|
|
113
|
-
return { kind: 'frame', src: yt };
|
|
121
|
+
return { kind: 'frame', src: yt, referrerPolicy: 'strict-origin-when-cross-origin' };
|
|
114
122
|
// A YouTube page that is not a video (a channel, a playlist) cannot be framed.
|
|
115
123
|
if (/(^|\.)(youtube\.com|youtu\.be|youtube-nocookie\.com)$/.test(host))
|
|
116
124
|
return null;
|
|
@@ -137,9 +145,9 @@ function previewPlan(source, hint) {
|
|
|
137
145
|
return { kind: 'video', src: raw };
|
|
138
146
|
if (NOT_VIEWABLE.has(ext))
|
|
139
147
|
return null;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
return { kind: '
|
|
148
|
+
if (FRAMED_FILES.has(ext) || isOurStorage(url))
|
|
149
|
+
return { kind: 'frame', src: raw };
|
|
150
|
+
return { kind: 'page', src: raw };
|
|
143
151
|
}
|
|
144
152
|
|
|
145
153
|
export { previewPlan };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-preview.js","sources":["../../../../../../src/lib/document-preview.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"document-preview.js","sources":["../../../../../../src/lib/document-preview.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;;;;AAWG;AAYH,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AA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/lucide-react/dist/esm/icons/chevron-right.js';
|
|
15
15
|
import Radio from '../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/radio.js';
|
|
16
16
|
import SquareArrowOutUpRight from '../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/square-arrow-out-up-right.js';
|
|
17
|
+
import ExternalLink from '../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/external-link.js';
|
|
17
18
|
import Eye from '../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/eye.js';
|
|
18
19
|
|
|
19
20
|
/** The shape a retrieved document is listed by: the session query's `VectorResult`
|
|
@@ -49,10 +50,10 @@ const hostOf = (value) => {
|
|
|
49
50
|
* One retrieved document: its title (a new-tab link when the source is a
|
|
50
51
|
* URL), its relevance, the matched passage, and — for URLs — a preview the
|
|
51
52
|
* reader can open (the title link beside it still opens the source in a new
|
|
52
|
-
* tab).
|
|
53
|
+
* tab), or for a web page an Open Page link to the passage in a new tab.
|
|
53
54
|
*/
|
|
54
55
|
function RetrievedDocumentRow({ doc }) {
|
|
55
|
-
var _a, _b;
|
|
56
|
+
var _a, _b, _c;
|
|
56
57
|
const t = useT();
|
|
57
58
|
const [previewOpen, setPreviewOpen] = React.useState(false);
|
|
58
59
|
const source = ((_a = doc.source) !== null && _a !== void 0 ? _a : '').trim();
|
|
@@ -63,9 +64,9 @@ function RetrievedDocumentRow({ doc }) {
|
|
|
63
64
|
// Preview only what a browser can show; Office files, archives and
|
|
64
65
|
// unframeable hosts get no button rather than a blank frame.
|
|
65
66
|
const preview = previewPlan(source, doc.type);
|
|
66
|
-
return (jsx("div", { className: "rounded-lg p-2 hover:bg-gray-50", "data-testid": "retrieved-document", children: jsxs("div", { className: "flex items-start gap-2", children: [jsx(Radio, { className: "mt-1 h-4 w-4 text-gray-400" }), jsxs("div", { className: "min-w-0 flex-1 space-y-1", children: [jsxs("div", { className: "flex items-start justify-between gap-2", children: [jsx("div", { className: "min-w-0", children: url ? (jsxs("a", { href: openHref !== null && openHref !== void 0 ? openHref : url, target: "_blank", rel: "noopener noreferrer", className: "inline-flex min-w-0 items-center gap-1 text-sm font-semibold text-[#646464] hover:text-blue-600", "aria-label": t('documentSidebar.openInNewTab', { title }), "data-testid": "retrieved-document-link", children: [jsx("span", { className: "min-w-0 break-words", children: title }), jsx(SquareArrowOutUpRight, { className: "h-3.5 w-3.5 shrink-0", "aria-hidden": "true" })] })) : (jsx("span", { className: "text-sm font-semibold break-words text-[#646464]", children: title })) }), relevance !== undefined && (jsx("span", { className: "shrink-0 rounded-[5px] bg-blue-50 px-2 py-0.5 text-xs text-blue-700", title: t('documentSidebar.relevanceHint'), "data-testid": "retrieved-document-relevance", children: t('documentSidebar.relevance', { percent: relevance }) }))] }), preview && (jsxs("div", { className: "pt-1", children: [jsxs(Button, { type: "button", variant: "outline", size: "sm", onClick: () => setPreviewOpen(true), className: "h-7 gap-1.5 px-2.5 text-xs", "data-testid": "retrieved-document-preview-toggle", children: [jsx(Eye, { className: "h-3.5 w-3.5", "aria-hidden": "true" }), t('documentSidebar.preview')] }), jsx(Dialog, { open: previewOpen, onOpenChange: setPreviewOpen, children: jsxs(DialogContent, { className: "flex flex-col gap-0 overflow-hidden rounded-lg p-0",
|
|
67
|
+
return (jsx("div", { className: "rounded-lg p-2 hover:bg-gray-50", "data-testid": "retrieved-document", children: jsxs("div", { className: "flex items-start gap-2", children: [jsx(Radio, { className: "mt-1 h-4 w-4 text-gray-400" }), jsxs("div", { className: "min-w-0 flex-1 space-y-1", children: [jsxs("div", { className: "flex items-start justify-between gap-2", children: [jsx("div", { className: "min-w-0", children: url ? (jsxs("a", { href: openHref !== null && openHref !== void 0 ? openHref : url, target: "_blank", rel: "noopener noreferrer", className: "inline-flex min-w-0 items-center gap-1 text-sm font-semibold text-[#646464] hover:text-blue-600", "aria-label": t('documentSidebar.openInNewTab', { title }), "data-testid": "retrieved-document-link", children: [jsx("span", { className: "min-w-0 break-words", children: title }), jsx(SquareArrowOutUpRight, { className: "h-3.5 w-3.5 shrink-0", "aria-hidden": "true" })] })) : (jsx("span", { className: "text-sm font-semibold break-words text-[#646464]", children: title })) }), relevance !== undefined && (jsx("span", { className: "shrink-0 rounded-[5px] bg-blue-50 px-2 py-0.5 text-xs text-blue-700", title: t('documentSidebar.relevanceHint'), "data-testid": "retrieved-document-relevance", children: t('documentSidebar.relevance', { percent: relevance }) }))] }), (preview === null || preview === void 0 ? void 0 : preview.kind) === 'page' && (jsx("div", { className: "pt-1", children: jsx(Button, { asChild: true, variant: "outline", size: "sm", className: "h-7 gap-1.5 px-2.5 text-xs", children: jsxs("a", { href: openHref !== null && openHref !== void 0 ? openHref : preview.src, target: "_blank", rel: "noopener noreferrer", "data-testid": "retrieved-document-open-page", children: [jsx(ExternalLink, { className: "h-3.5 w-3.5", "aria-hidden": "true" }), t('documentSidebar.openPage')] }) }) })), preview && preview.kind !== 'page' && (jsxs("div", { className: "pt-1", children: [jsxs(Button, { type: "button", variant: "outline", size: "sm", onClick: () => setPreviewOpen(true), className: "h-7 gap-1.5 px-2.5 text-xs", "data-testid": "retrieved-document-preview-toggle", children: [jsx(Eye, { className: "h-3.5 w-3.5", "aria-hidden": "true" }), t('documentSidebar.preview')] }), jsx(Dialog, { open: previewOpen, onOpenChange: setPreviewOpen, children: jsxs(DialogContent, { className: "flex flex-col gap-0 overflow-hidden rounded-lg p-0",
|
|
67
68
|
// Inline: the size must not depend on a host's Tailwind scan.
|
|
68
|
-
style: { width: '94vw', maxWidth: '94vw', height: '92vh' }, "data-testid": "retrieved-document-preview", children: [jsxs(DialogHeader, { className: "border-b border-gray-200 bg-white px-5 py-3 pr-12 text-left", children: [jsxs(DialogTitle, { className: "flex min-w-0 items-center gap-2 text-base font-semibold text-gray-800", children: [jsx("span", { className: "min-w-0 truncate", children: title }), jsx("a", { href: (_b = openHref !== null && openHref !== void 0 ? openHref : url) !== null && _b !== void 0 ? _b : undefined, target: "_blank", rel: "noopener noreferrer", className: "inline-flex shrink-0 items-center text-blue-600 hover:text-blue-700", "aria-label": t('documentSidebar.openInNewTab', { title }), children: jsx(SquareArrowOutUpRight, { className: "h-4 w-4", "aria-hidden": "true" }) })] }), jsx(DialogDescription, { className: "flex flex-wrap items-center gap-2 text-xs text-gray-500", children: relevance !== undefined && (jsx("span", { className: "rounded-[5px] bg-blue-50 px-2 py-0.5 text-blue-700", children: t('documentSidebar.relevance', { percent: relevance }) })) })] }), jsx("div", { className: "flex min-h-0 flex-1 items-center justify-center bg-gray-100", children: preview.kind === 'image' ? (jsx("img", { src: preview.src, alt: title, className: "h-full w-full object-contain" })) : preview.kind === 'audio' ? (jsx("audio", { src: preview.src, controls: true, className: "w-full max-w-2xl px-6" })) : preview.kind === 'video' ? (jsx("video", { src: preview.src, controls: true, className: "h-full w-full bg-black" })) : (jsx("iframe", { src: preview.src, title: title, referrerPolicy:
|
|
69
|
+
style: { width: '94vw', maxWidth: '94vw', height: '92vh' }, "data-testid": "retrieved-document-preview", children: [jsxs(DialogHeader, { className: "border-b border-gray-200 bg-white px-5 py-3 pr-12 text-left", children: [jsxs(DialogTitle, { className: "flex min-w-0 items-center gap-2 text-base font-semibold text-gray-800", children: [jsx("span", { className: "min-w-0 truncate", children: title }), jsx("a", { href: (_b = openHref !== null && openHref !== void 0 ? openHref : url) !== null && _b !== void 0 ? _b : undefined, target: "_blank", rel: "noopener noreferrer", className: "inline-flex shrink-0 items-center text-blue-600 hover:text-blue-700", "aria-label": t('documentSidebar.openInNewTab', { title }), children: jsx(SquareArrowOutUpRight, { className: "h-4 w-4", "aria-hidden": "true" }) })] }), jsx(DialogDescription, { className: "flex flex-wrap items-center gap-2 text-xs text-gray-500", children: relevance !== undefined && (jsx("span", { className: "rounded-[5px] bg-blue-50 px-2 py-0.5 text-blue-700", children: t('documentSidebar.relevance', { percent: relevance }) })) })] }), jsx("div", { className: "flex min-h-0 flex-1 items-center justify-center bg-gray-100", children: preview.kind === 'image' ? (jsx("img", { src: preview.src, alt: title, className: "h-full w-full object-contain" })) : preview.kind === 'audio' ? (jsx("audio", { src: preview.src, controls: true, className: "w-full max-w-2xl px-6" })) : preview.kind === 'video' ? (jsx("video", { src: preview.src, controls: true, className: "h-full w-full bg-black" })) : (jsx("iframe", { src: preview.src, title: title, referrerPolicy: (_c = preview.referrerPolicy) !== null && _c !== void 0 ? _c : 'no-referrer', allow: "fullscreen; autoplay; encrypted-media; picture-in-picture", className: "h-full w-full border-0 bg-white" })) })] }) })] })), jsx("p", { className: "line-clamp-6 pt-[10px] text-[14px] text-gray-600", children: doc.snippet })] })] }) }));
|
|
69
70
|
}
|
|
70
71
|
function DocumentSidebar({ isModal = false, sessionId = '', documents, }) {
|
|
71
72
|
const t = useT();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-sidebar.js","sources":["../../../../../../src/components/document-sidebar.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","_Fragment"],"mappings":"
|
|
1
|
+
{"version":3,"file":"document-sidebar.js","sources":["../../../../../../src/components/document-sidebar.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;AAyBA;AACwE;AACxE;AACA,MAAM,SAAS,GAAG,CAAC,KAAqB,KAAc,eAAe,CAAC,IAAI,CAAC,CAAC,KAAK,KAAA,IAAA,IAAL,KAAK,KAAA,MAAA,GAAL,KAAK,GAAI,EAAE,EAAE,IAAI,EAAE,CAAC;AAWhG;AACA,MAAM,gBAAgB,GAAG,CAAC,KAAc,KACtC,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK;MAC9C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,GAAG;MAChD,SAAS;AAEf;;;;;A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EAAA,EACX,SAAS,EAAE,EAAE,CACX,oDAAoD,EACpD,WAAW,GAAG,YAAY,GAAG,EAAE,CAChC,GACD,CAAA,EAAA,CACD,CACJ,IACG,CACP,EAEA,CAAC,CAAC,WAAW,IAAI,OAAO,MACvBA,GAAA,CAAAE,QAAA,EAAA,EAAA,QAAA,EACEF,GAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAC,8BAA8B,EACxC,KAAK,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,EAAA,QAAA,EAErCA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,oBAAoB,YAChC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,MAC9BC,IAAA,CAAC,KAAK,CAAC,QAAQ,EAAA,EAAA,QAAA,EAAA,CACbD,GAAA,CAAC,oBAAoB,EAAA,EAAC,GAAG,EAAE,GAAG,EAAA,CAAI,EACjC,KAAK,GAAG,eAAe,CAAC,MAAM,GAAG,CAAC,KACjCA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,+BAA+B,EAAA,CAAG,CAClD,KAJkB,KAAK,CAKT,CAClB,CAAC,EAAA,CACE,GACF,EAAA,CACL,CACJ,CAAA,EAAA,CACG,EAAA,CACA,IACN,IAAI,EAAA,CACP;AAEP;;;;"}
|
|
@@ -1,31 +1,26 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { isSameDay } from 'date-fns';
|
|
4
4
|
import { toast } from 'sonner';
|
|
5
|
-
import { useForm } from '
|
|
6
|
-
import { useT } from '
|
|
7
|
-
import '
|
|
8
|
-
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogFooter } from '
|
|
9
|
-
import { Input } from '
|
|
10
|
-
import {
|
|
11
|
-
import { Button } from '../../../ui/button.js';
|
|
5
|
+
import { useForm } from '../../../node_modules/.pnpm/@tanstack_react-form@1.11.2_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@tanstack/react-form/dist/esm/useForm.js';
|
|
6
|
+
import { useT } from '../../../i18n/context.js';
|
|
7
|
+
import '../../../packages/i18n/dist/index.esm.js';
|
|
8
|
+
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogFooter } from '../../ui/dialog.js';
|
|
9
|
+
import { Input } from '../../ui/input.js';
|
|
10
|
+
import { Button } from '../../ui/button.js';
|
|
12
11
|
import { useGetApiKeyQuery, useGetApiKeyFieldPermissionsQuery, useUpdateApiKeyMutation } from '@iblai/data-layer';
|
|
12
|
+
import { ApiFieldLabel } from './api-field-label.js';
|
|
13
13
|
import { DENIED_TOKEN_POLICY_PERMISSIONS, API_TOKEN_MODES } from './constants.js';
|
|
14
|
-
import { toSelections, buildTokenPolicyPayload, secondsUntil } from './api-token-utils.js';
|
|
14
|
+
import { buildApiKeyFormSchema, toSelections, buildTokenPolicyPayload, secondsUntil } from './api-token-utils.js';
|
|
15
15
|
import { ExpirationDateField } from './expiration-date-field.js';
|
|
16
16
|
import { TokenPolicyFields } from './token-policy-fields.js';
|
|
17
|
-
import TriangleAlert from '
|
|
17
|
+
import TriangleAlert from '../../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/triangle-alert.js';
|
|
18
18
|
|
|
19
|
-
const editApiFormSchema = z.object({
|
|
20
|
-
name: z
|
|
21
|
-
.string()
|
|
22
|
-
.min(1, 'API Key name is required')
|
|
23
|
-
.regex(/^[a-zA-Z0-9_-]+$/, 'can only contain letters, numbers, and hyphens'),
|
|
24
|
-
expiration_date: z.date().nullable(),
|
|
25
|
-
});
|
|
26
19
|
function EditApiKeyForm({ token, tenantKey, fieldPermissions, onClose, }) {
|
|
27
20
|
var _a;
|
|
28
21
|
const t = useT();
|
|
22
|
+
const nameFieldId = React__default.useId();
|
|
23
|
+
const editApiFormSchema = React__default.useMemo(() => buildApiKeyFormSchema(t), [t]);
|
|
29
24
|
const [updateApiKey, { isLoading }] = useUpdateApiKeyMutation();
|
|
30
25
|
const initialPolicies = React__default.useMemo(() => toSelections(token.policies), [token.policies]);
|
|
31
26
|
const initialGroups = React__default.useMemo(() => toSelections(token.groups), [token.groups]);
|
|
@@ -43,7 +38,7 @@ function EditApiKeyForm({ token, tenantKey, fieldPermissions, onClose, }) {
|
|
|
43
38
|
onChange: editApiFormSchema,
|
|
44
39
|
},
|
|
45
40
|
onSubmit: async ({ value }) => {
|
|
46
|
-
var _a
|
|
41
|
+
var _a;
|
|
47
42
|
const requestBody = buildTokenPolicyPayload({
|
|
48
43
|
mode,
|
|
49
44
|
initialMode,
|
|
@@ -56,9 +51,11 @@ function EditApiKeyForm({ token, tenantKey, fieldPermissions, onClose, }) {
|
|
|
56
51
|
if (value.name !== token.name) {
|
|
57
52
|
requestBody.name = value.name;
|
|
58
53
|
}
|
|
59
|
-
const nextExpiration = (
|
|
60
|
-
const
|
|
61
|
-
|
|
54
|
+
const nextExpiration = (_a = value.expiration_date) !== null && _a !== void 0 ? _a : null;
|
|
55
|
+
const expirationChanged = nextExpiration && initialExpiration
|
|
56
|
+
? !isSameDay(nextExpiration, initialExpiration)
|
|
57
|
+
: nextExpiration !== initialExpiration;
|
|
58
|
+
if (expirationChanged) {
|
|
62
59
|
requestBody.expires_in = value.expiration_date
|
|
63
60
|
? secondsUntil(value.expiration_date).toString()
|
|
64
61
|
: null;
|
|
@@ -89,24 +86,33 @@ function EditApiKeyForm({ token, tenantKey, fieldPermissions, onClose, }) {
|
|
|
89
86
|
}, className: "mt-5 grid min-w-0 gap-5", children: [jsx(form.Field, { name: "name", children: (field) => {
|
|
90
87
|
var _a, _b;
|
|
91
88
|
const hasErrorAndIsDirty = ((_a = field.state.meta.errors) === null || _a === void 0 ? void 0 : _a.length) > 0 && field.state.meta.isDirty;
|
|
92
|
-
return (jsxs("div", { className: "space-y-1.5", children: [
|
|
89
|
+
return (jsxs("div", { className: "space-y-1.5", children: [jsx(ApiFieldLabel, { htmlFor: nameFieldId, text: t('apiTabCreateApiModal2.apiKeyName'), info: t('apiTabCreateApiModal2.apiKeyNameInfo'), required: true }), jsx(Input, { id: nameFieldId, value: field.state.value, onChange: (event) => field.handleChange(event.target.value), autoComplete: "off" }), hasErrorAndIsDirty && (jsx("p", { className: "text-red-500 text-xs", children: (_b = field.state.meta.errors[0]) === null || _b === void 0 ? void 0 : _b.message })), field.state.value !== token.name && (jsxs("p", { className: "flex items-start gap-1.5 text-xs text-amber-700", children: [jsx(TriangleAlert, { className: "mt-0.5 h-3.5 w-3.5 shrink-0", "aria-hidden": "true" }), t('apiTabEditApiModal.renameWarning')] }))] }));
|
|
93
90
|
} }), jsx(form.Field, { name: "expiration_date", children: (field) => (jsx(ExpirationDateField, { value: field.state.value, onChange: (date) => field.handleChange(date), helpText: t('apiTabEditApiModal.expirationHelp') })) }), jsx(TokenPolicyFields, { tenantKey: tenantKey, mode: mode, onModeChange: setMode, policies: policies, onPoliciesChange: setPolicies, groups: groups, onGroupsChange: setGroups, fieldPermissions: fieldPermissions, idPrefix: "edit-api-key" }), jsxs(DialogFooter, { className: "justify-end gap-3", children: [jsx(Button, { type: "button", variant: "outline", onClick: onClose, disabled: isLoading, children: t('apiTabDeleteApiModal2.cancel') }), jsx(form.Subscribe, { selector: (state) => ({ canSubmit: state.canSubmit }), children: ({ canSubmit }) => (jsx(Button, { type: "submit", disabled: !canSubmit || isLoading, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: isLoading ? t('apiTabEditApiModal.saving') : t('apiTabEditApiModal.save') })) })] })] }));
|
|
94
91
|
}
|
|
95
92
|
function EditApiModal({ isOpen, onClose, apiKeyName, tenantKey }) {
|
|
96
93
|
var _a;
|
|
97
94
|
const t = useT();
|
|
98
95
|
const skip = !isOpen || !apiKeyName || !tenantKey;
|
|
99
|
-
const { data: token, isError: isTokenError, isFetching: isTokenFetching, } = useGetApiKeyQuery({ name: apiKeyName, platformKey: tenantKey }, { skip });
|
|
96
|
+
const { data: token, isError: isTokenError, isFetching: isTokenFetching, refetch: refetchToken, } = useGetApiKeyQuery({ name: apiKeyName, platformKey: tenantKey }, { skip });
|
|
100
97
|
const { data: fieldPermissionsData, isError: isFieldPermissionsError, isLoading: isFieldPermissionsLoading, } = useGetApiKeyFieldPermissionsQuery({ platformKey: tenantKey }, { skip });
|
|
101
98
|
// The detail payload wins when it embeds write flags, since those describe
|
|
102
99
|
// this token rather than the create form.
|
|
103
100
|
const fieldPermissions = (_a = token === null || token === void 0 ? void 0 : token.field_permissions) !== null && _a !== void 0 ? _a : (isFieldPermissionsError ? DENIED_TOKEN_POLICY_PERMISSIONS : fieldPermissionsData);
|
|
104
101
|
// Both must settle first: an unresolved permission map reads as "all
|
|
105
|
-
// writable", which would render controls the caller may not actually have.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
102
|
+
// writable", which would render controls the caller may not actually have. A
|
|
103
|
+
// token being re-read must not seed the form either: the form compares against
|
|
104
|
+
// what it was seeded with, so a stale copy would undo the last save. Once seeded
|
|
105
|
+
// it stays up: a failed save re-reads the token too, and must not lose the edits.
|
|
106
|
+
const canSeed = Boolean(token) && !isFieldPermissionsLoading && !isTokenFetching && !isTokenError;
|
|
107
|
+
const [seeded, setSeeded] = React__default.useState(false);
|
|
108
|
+
React__default.useEffect(() => {
|
|
109
|
+
if (!isOpen)
|
|
110
|
+
setSeeded(false);
|
|
111
|
+
else if (canSeed)
|
|
112
|
+
setSeeded(true);
|
|
113
|
+
}, [isOpen, canSeed]);
|
|
114
|
+
const isReady = Boolean(token) && !isFieldPermissionsLoading && (seeded || canSeed);
|
|
115
|
+
return (jsx(Dialog, { open: isOpen, onOpenChange: onClose, children: jsxs(DialogContent, { className: "w-full max-w-md max-h-[85vh] overflow-y-auto", children: [jsx(DialogDescription, { className: "sr-only", children: t('apiTabEditApiModal.title') }), jsx(DialogHeader, { children: jsx(DialogTitle, { className: "ibl-dialog-title", children: t('apiTabEditApiModal.title') }) }), isReady && token ? (jsx(EditApiKeyForm, { token: token, tenantKey: tenantKey, fieldPermissions: fieldPermissions, onClose: onClose }, token.name)) : isTokenError && !isTokenFetching ? (jsxs("div", { className: "flex flex-col items-center gap-3 py-6 text-center text-sm text-muted-foreground", children: [jsx("p", { children: t('apiTabEditApiModal.loadError') }), jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: () => refetchToken(), "data-testid": "api-key-edit-retry", children: t('apiTabLabels.table.tryAgain') })] })) : (jsx("p", { className: "py-6 text-center text-sm text-muted-foreground", children: t('apiTabEditApiModal.loading') }))] }) }));
|
|
110
116
|
}
|
|
111
117
|
|
|
112
118
|
export { EditApiModal };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit-api-modal.js","sources":["
|
|
1
|
+
{"version":3,"file":"edit-api-modal.js","sources":["../../../../../../../../src/components/profile/api/edit-api-modal.tsx"],"sourcesContent":[null],"names":["React","_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;AAgDA,SAAS,cAAc,CAAC,EACtB,KAAK,EACL,SAAS,EACT,gBAAgB,EAChB,OAAO,GAMR,EAAA;;AACC,IAAA,MAAM,CAAC,GAAG,IAAI,EAAE;AAChB,IAAA,MAAM,WAAW,GAAGA,cAAK,CAAC,KAAK,EAAE;AACjC,IAAA,MAAM,iBAAiB,GAAGA,cAAK,CAAC,OAAO,CAAC,MAAM,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5E,MAAM,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,CAAC,GAAG,uBAAuB,EAAE;IAE/D,MAAM,eAAe,GAAGA,cAAK,CAAC,OAAO,CAAC,MAAM,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC3F,MAAM,aAAa,GAAGA,cAAK,CAAC,OAAO,CAAC,MAAM,YAAY,CAAC,KAAK,CAAC,M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BAA6B,CAAC,GAC1B,CAAA,EAAA,CACL,KAENA,GAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,gDAAgD,EAAA,QAAA,EAC1D,CAAC,CAAC,4BAA4B,CAAC,EAAA,CAC9B,CACL,CAAA,EAAA,CACa,EAAA,CACT;AAEb;;;;"}
|
|
@@ -12,9 +12,9 @@ import { Input } from '../../../../ui/input.js';
|
|
|
12
12
|
import { Label } from '../../../../ui/label.js';
|
|
13
13
|
import { Button } from '../../../../ui/button.js';
|
|
14
14
|
import { Calendar as Calendar$1 } from '../../../../ui/calendar.js';
|
|
15
|
-
import { API_TOKEN_MODES, DENIED_TOKEN_POLICY_PERMISSIONS } from '../../../../profile/
|
|
16
|
-
import { secondsUntil, buildTokenPolicyPayload } from '../../../../profile/
|
|
17
|
-
import { TokenPolicyFields } from '../../../../profile/
|
|
15
|
+
import { API_TOKEN_MODES, DENIED_TOKEN_POLICY_PERMISSIONS } from '../../../../profile/api/constants.js';
|
|
16
|
+
import { secondsUntil, buildTokenPolicyPayload } from '../../../../profile/api/api-token-utils.js';
|
|
17
|
+
import { TokenPolicyFields } from '../../../../profile/api/token-policy-fields.js';
|
|
18
18
|
import { ApiKeyModal } from './api-key-modal.js';
|
|
19
19
|
import Calendar from '../../../../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/calendar.js';
|
|
20
20
|
|
|
@@ -43,7 +43,7 @@ function CreateApiModal({ isOpen, onClose, tenantKey, username, executeGatedActi
|
|
|
43
43
|
const form = useForm({
|
|
44
44
|
defaultValues: createApiFormDefaultValues,
|
|
45
45
|
validators: {
|
|
46
|
-
// Validating the empty defaults keeps
|
|
46
|
+
// Validating the empty defaults keeps the button disabled until a name is
|
|
47
47
|
// entered, instead of a first click on a pristine form doing nothing.
|
|
48
48
|
onMount: createApiFormSchema,
|
|
49
49
|
onChange: createApiFormSchema,
|
|
@@ -5,52 +5,54 @@ const AGENT_API_TAB_LABELS = {
|
|
|
5
5
|
title: 'API',
|
|
6
6
|
description: 'Manage API keys and integrations.',
|
|
7
7
|
},
|
|
8
|
-
infoBox: 'Use this agent from your own apps.
|
|
8
|
+
infoBox: 'Use this agent from your own apps. Add API keys here to call it programmatically and build it into your product or workflow.',
|
|
9
9
|
disclaimer: {
|
|
10
10
|
lineOne: 'Your secret API keys are listed below. Please note that we do not display your secret API keys again after you generate them.',
|
|
11
11
|
lineTwo: 'Do not share your API key with others, or expose it in the browser or other client-side code. In order to protect the security of your account, IBL may also automatically rotate any API key that we\u2019ve found has leaked publicly.',
|
|
12
12
|
},
|
|
13
13
|
table: {
|
|
14
|
-
nameColumn: '
|
|
15
|
-
modeColumn: '
|
|
14
|
+
nameColumn: 'Name',
|
|
15
|
+
modeColumn: 'Permission Mode',
|
|
16
16
|
ownerMode: 'Owner permissions',
|
|
17
17
|
tokenPoliciesMode: 'Token policies',
|
|
18
|
-
createdColumn: '
|
|
19
|
-
expiresColumn: '
|
|
18
|
+
createdColumn: 'Created',
|
|
19
|
+
expiresColumn: 'Expires',
|
|
20
20
|
actionsColumn: 'Actions',
|
|
21
|
-
emptyState: 'No API keys
|
|
22
|
-
noPermission: 'You do not have permission to view API keys',
|
|
21
|
+
emptyState: 'No API keys yet.',
|
|
22
|
+
noPermission: 'You do not have permission to view API keys.',
|
|
23
23
|
editAriaLabel: 'Edit API Key',
|
|
24
24
|
deleteAriaLabel: 'Delete API Key',
|
|
25
25
|
notAvailable: 'N/A',
|
|
26
|
+
loadFailed: 'Your API keys could not be loaded. Try again in a moment.',
|
|
27
|
+
tryAgain: 'Try Again',
|
|
26
28
|
},
|
|
27
29
|
actions: {
|
|
28
|
-
createNew: '
|
|
30
|
+
createNew: 'Add API Key',
|
|
29
31
|
},
|
|
30
32
|
createModal: {
|
|
31
|
-
title: '
|
|
33
|
+
title: 'Add API Key',
|
|
32
34
|
description: "Name your key and optionally set an expiry date. You'll only see the key once.",
|
|
33
35
|
nameLabel: 'API Key Name',
|
|
34
|
-
namePlaceholder: '
|
|
35
|
-
nameRequired: '
|
|
36
|
-
nameInvalid: '
|
|
36
|
+
namePlaceholder: 'my-script',
|
|
37
|
+
nameRequired: 'Enter a name for this key.',
|
|
38
|
+
nameInvalid: 'Use letters, numbers, hyphens and underscores only, like my-script.',
|
|
37
39
|
expirationLabel: 'Expiration Date',
|
|
38
40
|
expirationPlaceholder: 'Pick a date',
|
|
39
|
-
submit: '
|
|
40
|
-
submitting: '
|
|
41
|
+
submit: 'Add API Key',
|
|
42
|
+
submitting: 'Adding...',
|
|
41
43
|
cancel: 'Cancel',
|
|
42
|
-
successToast: 'API
|
|
43
|
-
errorToast: 'Failed to
|
|
44
|
+
successToast: 'API key added',
|
|
45
|
+
errorToast: 'Failed to add API key',
|
|
44
46
|
},
|
|
45
47
|
deleteModal: {
|
|
46
48
|
title: 'Delete API Key',
|
|
47
|
-
confirmation: 'Are you sure you want to delete the API
|
|
49
|
+
confirmation: 'Are you sure you want to delete the API key with the name {name}? This action cannot be undone.',
|
|
48
50
|
warning: 'Any app or integration using this key will stop working immediately.',
|
|
49
51
|
cancel: 'Cancel',
|
|
50
52
|
confirm: 'Delete',
|
|
51
53
|
confirming: 'Deleting...',
|
|
52
|
-
successToast: 'API
|
|
53
|
-
errorToast: 'Failed to delete API
|
|
54
|
+
successToast: 'API key deleted successfully',
|
|
55
|
+
errorToast: 'Failed to delete API key',
|
|
54
56
|
},
|
|
55
57
|
apiKeyModal: {
|
|
56
58
|
title: 'API Key',
|
|
@@ -85,6 +87,8 @@ function buildApiTabLabels(t) {
|
|
|
85
87
|
editAriaLabel: t('apiTabEditApiModal.editAriaLabel'),
|
|
86
88
|
deleteAriaLabel: t('apiTabLabels.table.deleteAriaLabel'),
|
|
87
89
|
notAvailable: t('apiTabLabels.table.notAvailable'),
|
|
90
|
+
loadFailed: t('apiTabLabels.table.loadFailed'),
|
|
91
|
+
tryAgain: t('apiTabLabels.table.tryAgain'),
|
|
88
92
|
},
|
|
89
93
|
actions: {
|
|
90
94
|
createNew: t('apiTabLabels.actions.createNew'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labels.js","sources":["../../../../../../../../../../src/components/modals/edit-mentor-modal/tabs/api-tab/labels.ts"],"sourcesContent":[null],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"labels.js","sources":["../../../../../../../../../../src/components/modals/edit-mentor-modal/tabs/api-tab/labels.ts"],"sourcesContent":[null],"names":[],"mappings":";;AA2EO,MAAM,oBAAoB,GAAiB;AAChD,IAAA,MAAM,EAAE;AACN,QAAA,KAAK,EAAE,KAAK;AACZ,QAAA,WAAW,EAAE,mCAAmC;AACjD,KAAA;AACD,IAAA,OAAO,EACL,8HAA8H;AAChI,IAAA,UAAU,EAAE;AACV,QAAA,OAAO,EACL,+HAA+H;AACjI,QAAA,OAAO,EACL,0OAA0O;AAC7O,KAAA;AACD,IAAA,KAAK,EAAE;AACL,QAAA,UAAU,EAAE,MAAM;AAClB,QAAA,UAAU,EAAE,iBAAiB;AAC7B,QAAA,SAAS,EAAE,mBAAmB;AAC9B,QAAA,iBAAiB,EAAE,gBAAgB;AACnC,QAAA,aAAa,EAAE,SAAS;AACxB,QAAA,aAAa,EAAE,SAAS;AACxB,QAAA,aAAa,EAAE,SAAS;AACxB,QAAA,UAAU,EAAE,kBAAkB;AAC9B,QAAA,YAAY,EAAE,8CAA8C;AAC5D,QAAA,aAAa,EAAE,cAAc;AAC7B,QAAA,eAAe,EAAE,gBAAgB;AACjC,QAAA,YAAY,EAAE,KAAK;AACnB,QAAA,UAAU,EAAE,2DAA2D;AACvE,QAAA,QAAQ,EAAE,WAAW;AACtB,KAAA;AACD,IAAA,OAAO,EAAE;AACP,QAAA,SAAS,EAAE,aAAa;AACzB,KAAA;AACD,IAAA,WAAW,EAAE;AACX,QAAA,KAAK,EAAE,aAAa;AACpB,QAAA,WAAW,EAAE,gFAAgF;AAC7F,QAAA,SAAS,EAAE,cAAc;AACzB,QAAA,eAAe,EAAE,WAAW;A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;AAAE,QAAA,OAAO,IAAI;AAC1B,IAAA,OAAO,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAiB;AAClD;;;;"}
|
|
@@ -8,8 +8,10 @@ import { Button } from '../../../ui/button.js';
|
|
|
8
8
|
import { Badge } from '../../../ui/badge.js';
|
|
9
9
|
import { Spinner } from '../../../spinner/index.js';
|
|
10
10
|
import { IblPagination } from '../../../ibl-pagination.js';
|
|
11
|
-
import { API_KEYS_PAGE_SIZE, API_TOKEN_MODES } from '../../../profile/
|
|
12
|
-
import {
|
|
11
|
+
import { API_KEYS_PAGE_SIZE, API_TOKEN_MODES } from '../../../profile/api/constants.js';
|
|
12
|
+
import { isApiKeysPageGone, isRefusedError } from '../../../profile/api/api-token-utils.js';
|
|
13
|
+
import { TooltipIconButton } from '../../../tooltip-icon-button.js';
|
|
14
|
+
import { EditApiModal } from '../../../profile/api/edit-api-modal.js';
|
|
13
15
|
import { useT } from '../../../../i18n/context.js';
|
|
14
16
|
import '../../../../packages/i18n/dist/index.esm.js';
|
|
15
17
|
import { useAgentSettings } from '../agent-settings-context.js';
|
|
@@ -19,19 +21,8 @@ import { resolveApiTabLabels } from './api-tab/labels.js';
|
|
|
19
21
|
export { AGENT_API_TAB_LABELS } from './api-tab/labels.js';
|
|
20
22
|
import Plus from '../../../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/plus.js';
|
|
21
23
|
import Pencil from '../../../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/pencil.js';
|
|
22
|
-
import
|
|
24
|
+
import Trash2 from '../../../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/trash-2.js';
|
|
23
25
|
|
|
24
|
-
/**
|
|
25
|
-
* An out-of-range `page` (e.g. after deleting the last key on the last page)
|
|
26
|
-
* comes back as a 404 `{"detail": "Invalid page."}`.
|
|
27
|
-
*/
|
|
28
|
-
function isInvalidPageError(error) {
|
|
29
|
-
const { status, data } = (error !== null && error !== void 0 ? error : {});
|
|
30
|
-
if (status === 404)
|
|
31
|
-
return true;
|
|
32
|
-
const body = typeof data === 'string' ? data : JSON.stringify(data !== null && data !== void 0 ? data : '');
|
|
33
|
-
return body.includes('Invalid page');
|
|
34
|
-
}
|
|
35
26
|
function AgentApiTab({ labels: labelsOverride }) {
|
|
36
27
|
const { tenantKey, username, enableRBAC, rbacPermissions, executeGatedAction } = useAgentSettings();
|
|
37
28
|
const t = useT();
|
|
@@ -41,16 +32,20 @@ function AgentApiTab({ labels: labelsOverride }) {
|
|
|
41
32
|
const canList = checkRbacPermission(rbacPermissions !== null && rbacPermissions !== void 0 ? rbacPermissions : {}, '/apitokens/#list', enableRBAC);
|
|
42
33
|
const canCreate = checkRbacPermission(rbacPermissions !== null && rbacPermissions !== void 0 ? rbacPermissions : {}, '/apitokens/#create', enableRBAC);
|
|
43
34
|
const [page, setPage] = React__default.useState(1);
|
|
44
|
-
const { data: apiKeysResponse, isLoading: isApiKeysLoading, isFetching: isApiKeysFetching, isError, error, } = useGetApiKeysQuery({
|
|
35
|
+
const { data: apiKeysResponse, isLoading: isApiKeysLoading, isFetching: isApiKeysFetching, isError, error, refetch, } = useGetApiKeysQuery({
|
|
45
36
|
platformKey: tenantKey,
|
|
46
37
|
page,
|
|
47
38
|
pageSize: API_KEYS_PAGE_SIZE,
|
|
48
39
|
}, { skip: !canList });
|
|
49
40
|
const { tokens: apiKeys, count } = unwrapApiTokenList(apiKeysResponse);
|
|
50
41
|
const totalPages = Math.ceil(count / API_KEYS_PAGE_SIZE);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
42
|
+
const isPageGone = isApiKeysPageGone({
|
|
43
|
+
page,
|
|
44
|
+
isFetching: isApiKeysFetching,
|
|
45
|
+
isError,
|
|
46
|
+
error,
|
|
47
|
+
isEmpty: apiKeys.length === 0,
|
|
48
|
+
});
|
|
54
49
|
React__default.useEffect(() => {
|
|
55
50
|
if (isPageGone)
|
|
56
51
|
setPage((current) => Math.max(1, current - 1));
|
|
@@ -83,7 +78,7 @@ function AgentApiTab({ labels: labelsOverride }) {
|
|
|
83
78
|
return (jsxs(Fragment, { children: [jsx("div", { className: "flex hidden h-[73px] flex-shrink-0 items-center border-b border-gray-200 bg-white p-4 lg:block", children: jsxs("div", { children: [jsx("h3", { className: "mb-1 text-base font-medium text-gray-900", children: labels.header.title }), jsx("p", { className: "text-xs text-gray-700", children: labels.header.description })] }) }), jsxs("div", { className: "flex-1 space-y-4 p-3 lg:p-4", style: {
|
|
84
79
|
overflowY: 'auto',
|
|
85
80
|
overflowX: 'hidden',
|
|
86
|
-
}, children: [jsxs("div", { className: "space-y-2 rounded-md border border-gray-200 bg-gray-50 p-3 text-xs text-gray-600", "data-testid": "api-info-box", children: [jsx("p", { children: labels.infoBox }), jsx("p", { children: labels.disclaimer.lineOne }), jsx("p", { children: labels.disclaimer.lineTwo })] }), jsxs("div", { className: "space-y-4", children: [canCreate && (jsx("div", { className: "flex justify-end", children: jsxs(Button, { onClick: openCreateApiModal, size: "sm", "data-testid": "api-key-create-button", className: "cursor-pointer whitespace-nowrap bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: [jsx(Plus, { className: "h-4 w-4" }), labels.actions.createNew] }) })), isApiKeysLoading ? (jsx("div", { className: "flex w-full items-center justify-center py-10", children: jsx(Spinner, {}) })) : (jsx("div", { className: "rounded-md border", children: jsxs(Table, { className: "w-full", children: [jsx(TableHeader, { children: jsxs(TableRow, { children: [jsx(TableHead, { className: "p-2 text-left text-sm text-gray-700", children: labels.table.nameColumn }), jsx(TableHead, { className: "p-2 text-left text-sm text-gray-700", children: labels.table.modeColumn }), jsx(TableHead, { className: "p-2 text-left text-sm text-gray-700", children: labels.table.createdColumn }), jsx(TableHead, { className: "p-2 text-left text-sm text-gray-700", children: labels.table.expiresColumn }), jsx(TableHead, { className: "p-2 text-left text-sm text-gray-700", "aria-label": labels.table.actionsColumn, children: jsx("span", { className: "sr-only", children: labels.table.actionsColumn }) })] }) }), jsx(TableBody, { children: !canList || apiKeys.length === 0 ? (jsx(TableRow, { children: jsx(TableCell, { colSpan: 5, className: "p-4 text-center text-sm text-gray-700", children: canList ? labels.table.
|
|
81
|
+
}, children: [jsxs("div", { className: "space-y-2 rounded-md border border-gray-200 bg-gray-50 p-3 text-xs text-gray-600", "data-testid": "api-info-box", children: [jsx("p", { children: labels.infoBox }), jsx("p", { children: labels.disclaimer.lineOne }), jsx("p", { children: labels.disclaimer.lineTwo })] }), jsxs("div", { className: "space-y-4", children: [canCreate && (jsx("div", { className: "flex justify-end", children: jsxs(Button, { onClick: openCreateApiModal, size: "sm", "data-testid": "api-key-create-button", className: "cursor-pointer whitespace-nowrap bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: [jsx(Plus, { className: "h-4 w-4" }), labels.actions.createNew] }) })), isApiKeysLoading ? (jsx("div", { className: "flex w-full items-center justify-center py-10", children: jsx(Spinner, {}) })) : (jsx("div", { className: "rounded-md border", children: jsxs(Table, { className: "w-full", children: [jsx(TableHeader, { children: jsxs(TableRow, { children: [jsx(TableHead, { className: "p-2 text-left text-sm text-gray-700", children: labels.table.nameColumn }), jsx(TableHead, { className: "p-2 text-left text-sm text-gray-700", children: labels.table.modeColumn }), jsx(TableHead, { className: "p-2 text-left text-sm text-gray-700", children: labels.table.createdColumn }), jsx(TableHead, { className: "p-2 text-left text-sm text-gray-700", children: labels.table.expiresColumn }), jsx(TableHead, { className: "p-2 text-left text-sm text-gray-700", "aria-label": labels.table.actionsColumn, children: jsx("span", { className: "sr-only", children: labels.table.actionsColumn }) })] }) }), jsx(TableBody, { children: !canList || apiKeys.length === 0 ? (jsx(TableRow, { children: jsx(TableCell, { colSpan: 5, className: "p-4 text-center text-sm text-gray-700", children: !canList || (isError && isRefusedError(error)) ? (labels.table.noPermission) : isError && !isPageGone ? (jsxs("div", { className: "flex flex-col items-center gap-3", "data-testid": "api-keys-load-failed", children: [jsx("p", { children: labels.table.loadFailed }), jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: () => void refetch(), children: labels.table.tryAgain })] })) : (labels.table.emptyState) }) })) : (apiKeys.map((apiKey) => {
|
|
87
82
|
var _a, _b, _c, _d, _e, _f;
|
|
88
83
|
return (jsxs(TableRow, { className: "text-sm hover:bg-blue-50", children: [jsx(TableCell, { className: "p-2 whitespace-nowrap text-gray-700", children: apiKey.name }), jsx(TableCell, { className: "p-2 whitespace-nowrap", children: jsx(Badge, { variant: "secondary", className: "font-normal", children: apiKey.mode === API_TOKEN_MODES.TOKEN_POLICIES
|
|
89
84
|
? labels.table.tokenPoliciesMode
|
|
@@ -91,7 +86,7 @@ function AgentApiTab({ labels: labelsOverride }) {
|
|
|
91
86
|
? format(apiKey.created, 'PPP')
|
|
92
87
|
: labels.table.notAvailable }), jsx(TableCell, { className: "p-2 whitespace-nowrap text-gray-700", children: apiKey.expires
|
|
93
88
|
? format(apiKey.expires, 'PPP')
|
|
94
|
-
: labels.table.notAvailable }), jsx(TableCell, { className: "p-2", children: jsxs("div", { className: "flex items-center gap-1", children: [((_c = (_b = (_a = apiKey.permissions) === null || _a === void 0 ? void 0 : _a.object) === null || _b === void 0 ? void 0 : _b.write) !== null && _c !== void 0 ? _c : true) && (jsx(
|
|
89
|
+
: labels.table.notAvailable }), jsx(TableCell, { className: "p-2", children: jsxs("div", { className: "flex items-center gap-1", children: [((_c = (_b = (_a = apiKey.permissions) === null || _a === void 0 ? void 0 : _a.object) === null || _b === void 0 ? void 0 : _b.write) !== null && _c !== void 0 ? _c : true) && (jsx(TooltipIconButton, { label: labels.table.editAriaLabel, className: "cursor-pointer", onClick: () => handleEditClick(apiKey.name), children: jsx(Pencil, { className: "h-4 w-4", "aria-hidden": "true" }) })), ((_f = (_e = (_d = apiKey.permissions) === null || _d === void 0 ? void 0 : _d.object) === null || _e === void 0 ? void 0 : _e.delete) !== null && _f !== void 0 ? _f : true) && (jsx(TooltipIconButton, { label: labels.table.deleteAriaLabel, className: "cursor-pointer text-red-600 hover:text-red-700", onClick: () => handleDeleteClick(apiKey.name), children: jsx(Trash2, { className: "h-4 w-4", "aria-hidden": "true" }) }))] }) })] }, apiKey.name));
|
|
95
90
|
})) })] }) })), canList && totalPages > 1 && (jsx(IblPagination, { currentPage: page, totalPages: totalPages, onPageChange: setPage, disabled: isApiKeysFetching })), jsx(CreateApiModal, { isOpen: showCreateApiModal, onClose: closeCreateApiModal, tenantKey: tenantKey, username: username !== null && username !== void 0 ? username : '', executeGatedAction: executeGatedAction, onCreated: () => setPage(1), labels: labels.createModal, apiKeyModalLabels: labels.apiKeyModal }), apiKeyToDelete && (jsx(DeleteApiModal, { isOpen: !!apiKeyToDelete, onClose: closeDeleteApiModal, apiKey: apiKeyToDelete, tenantKey: tenantKey, labels: labels.deleteModal })), apiKeyToEdit && (jsx(EditApiModal, { isOpen: !!apiKeyToEdit, onClose: () => setApiKeyToEdit(null), apiKeyName: apiKeyToEdit, tenantKey: tenantKey }))] })] })] }));
|
|
96
91
|
}
|
|
97
92
|
|