@verdaccio/ui-components 4.0.0-next-8.12 → 4.0.0-next-8.13
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/README.md +23 -49
- package/build/AppTest/AppRoute.d.ts +1 -3
- package/build/AppTest/AppRoute.js +13 -40
- package/build/AppTest/AppRoute.js.map +1 -1
- package/build/Theme/ResetStyles.js +42 -32
- package/build/Theme/ResetStyles.js.map +1 -1
- package/build/Theme/StyleBaseline.js +15 -6
- package/build/Theme/StyleBaseline.js.map +1 -1
- package/build/Theme/ThemeProvider.js +38 -22
- package/build/Theme/ThemeProvider.js.map +1 -1
- package/build/Theme/colors.d.ts +11 -0
- package/build/Theme/colors.js +19 -1
- package/build/Theme/colors.js.map +1 -1
- package/build/Theme/index.d.ts +2 -1
- package/build/Theme/index.js +57 -5
- package/build/Theme/index.js.map +1 -1
- package/build/Theme/modes.d.ts +3 -0
- package/build/Theme/modes.js +40 -0
- package/build/Theme/modes.js.map +1 -0
- package/build/Theme/theme.d.ts +5 -149
- package/build/Theme/theme.js +16 -95
- package/build/Theme/theme.js.map +1 -1
- package/build/Theme/tokens.d.ts +57 -0
- package/build/Theme/tokens.js +35 -0
- package/build/Theme/tokens.js.map +1 -0
- package/build/api/use-data-mutation.d.ts +19 -0
- package/build/api/use-data-mutation.js +99 -0
- package/build/api/use-data-mutation.js.map +1 -0
- package/build/api/use-data.d.ts +3 -0
- package/build/api/use-data.js +36 -0
- package/build/api/use-data.js.map +1 -0
- package/build/components/ActionBar/ActionBar.js +49 -30
- package/build/components/ActionBar/ActionBar.js.map +1 -1
- package/build/components/ActionBar/ActionBarAction.js +72 -57
- package/build/components/ActionBar/ActionBarAction.js.map +1 -1
- package/build/components/ActionBar/index.js +13 -1
- package/build/components/ActionBar/index.js.map +1 -1
- package/build/components/AppRoute/AppRoute.d.ts +3 -0
- package/build/components/AppRoute/AppRoute.js +89 -0
- package/build/components/AppRoute/AppRoute.js.map +1 -0
- package/build/components/Author/Author.d.ts +1 -1
- package/build/components/Author/Author.js +25 -22
- package/build/components/Author/Author.js.map +1 -1
- package/build/components/Author/index.js +13 -1
- package/build/components/Author/index.js.map +1 -1
- package/build/components/Author/styles.js +18 -9
- package/build/components/Author/styles.js.map +1 -1
- package/build/components/CopyClipboard/CopyToClipBoard.js +31 -28
- package/build/components/CopyClipboard/CopyToClipBoard.js.map +1 -1
- package/build/components/CopyClipboard/index.js +20 -2
- package/build/components/CopyClipboard/index.js.map +1 -1
- package/build/components/CopyClipboard/utils.d.ts +1 -1
- package/build/components/CopyClipboard/utils.js +12 -4
- package/build/components/CopyClipboard/utils.js.map +1 -1
- package/build/components/Dependencies/Dependencies.js +52 -42
- package/build/components/Dependencies/Dependencies.js.map +1 -1
- package/build/components/Dependencies/DependencyBlock.d.ts +2 -2
- package/build/components/Dependencies/DependencyBlock.js +65 -49
- package/build/components/Dependencies/DependencyBlock.js.map +1 -1
- package/build/components/Dependencies/index.js +13 -1
- package/build/components/Dependencies/index.js.map +1 -1
- package/build/components/Dependencies/types.d.ts +1 -1
- package/build/components/Dependencies/types.js +5 -1
- package/build/components/Dependencies/types.js.map +1 -1
- package/build/components/Dependencies/utits.js +7 -1
- package/build/components/Dependencies/utits.js.map +1 -1
- package/build/components/Deprecated/Deprecated.js +13 -8
- package/build/components/Deprecated/Deprecated.js.map +1 -1
- package/build/components/Deprecated/index.js +13 -1
- package/build/components/Deprecated/index.js.map +1 -1
- package/build/components/Developers/DeveloperType.js +7 -1
- package/build/components/Developers/DeveloperType.js.map +1 -1
- package/build/components/Developers/Developers.d.ts +1 -1
- package/build/components/Developers/Developers.js +62 -39
- package/build/components/Developers/Developers.js.map +1 -1
- package/build/components/Developers/Title.js +25 -23
- package/build/components/Developers/Title.js.map +1 -1
- package/build/components/Developers/get-unique-developer-values.d.ts +1 -1
- package/build/components/Developers/get-unique-developer-values.js +18 -2
- package/build/components/Developers/get-unique-developer-values.js.map +1 -1
- package/build/components/Developers/index.js +20 -2
- package/build/components/Developers/index.js.map +1 -1
- package/build/components/Distribution/Dist.d.ts +2 -2
- package/build/components/Distribution/Dist.js +31 -30
- package/build/components/Distribution/Dist.js.map +1 -1
- package/build/components/Distribution/index.js +13 -1
- package/build/components/Distribution/index.js.map +1 -1
- package/build/components/Distribution/styles.js +22 -13
- package/build/components/Distribution/styles.js.map +1 -1
- package/build/components/Engines/Engines.d.ts +1 -1
- package/build/components/Engines/Engines.js +37 -36
- package/build/components/Engines/Engines.js.map +1 -1
- package/build/components/Engines/index.js +13 -1
- package/build/components/Engines/index.js.map +1 -1
- package/build/components/Engines/styles.js +19 -10
- package/build/components/Engines/styles.js.map +1 -1
- package/build/components/ErrorBoundary/ErrorBoundary.d.ts +11 -9
- package/build/components/ErrorBoundary/ErrorBoundary.js +63 -28
- package/build/components/ErrorBoundary/ErrorBoundary.js.map +1 -1
- package/build/components/ErrorBoundary/index.js +13 -1
- package/build/components/ErrorBoundary/index.js.map +1 -1
- package/build/components/Forbidden/Forbidden.d.ts +3 -2
- package/build/components/Forbidden/Forbidden.js +55 -52
- package/build/components/Forbidden/Forbidden.js.map +1 -1
- package/build/components/Forbidden/index.js +13 -1
- package/build/components/Forbidden/index.js.map +1 -1
- package/build/components/FundButton/FundButton.js +33 -34
- package/build/components/FundButton/FundButton.js.map +1 -1
- package/build/components/FundButton/index.js +13 -1
- package/build/components/FundButton/index.js.map +1 -1
- package/build/components/HeaderInfoDialog/HeaderInfoDialog.js +45 -32
- package/build/components/HeaderInfoDialog/HeaderInfoDialog.js.map +1 -1
- package/build/components/HeaderInfoDialog/index.js +13 -1
- package/build/components/HeaderInfoDialog/index.js.map +1 -1
- package/build/components/Heading/Heading.d.ts +5 -2
- package/build/components/Heading/Heading.js +17 -11
- package/build/components/Heading/Heading.js.map +1 -1
- package/build/components/Heading/index.js +13 -1
- package/build/components/Heading/index.js.map +1 -1
- package/build/components/Help/Help.js +32 -26
- package/build/components/Help/Help.js.map +1 -1
- package/build/components/Help/index.js +13 -1
- package/build/components/Help/index.js.map +1 -1
- package/build/components/Help/styles.js +10 -3
- package/build/components/Help/styles.js.map +1 -1
- package/build/components/Icons/DevsIcons/CommonJS.js +10 -3
- package/build/components/Icons/DevsIcons/CommonJS.js.map +1 -1
- package/build/components/Icons/DevsIcons/ES6Module.js +10 -3
- package/build/components/Icons/DevsIcons/ES6Module.js.map +1 -1
- package/build/components/Icons/DevsIcons/Git.js +10 -3
- package/build/components/Icons/DevsIcons/Git.js.map +1 -1
- package/build/components/Icons/DevsIcons/NodeJS.js +10 -3
- package/build/components/Icons/DevsIcons/NodeJS.js.map +1 -1
- package/build/components/Icons/DevsIcons/TypeScript.js +10 -3
- package/build/components/Icons/DevsIcons/TypeScript.js.map +1 -1
- package/build/components/Icons/DevsIcons/index.js +40 -5
- package/build/components/Icons/DevsIcons/index.js.map +1 -1
- package/build/components/Icons/Earth.d.ts +5 -5
- package/build/components/Icons/Earth.js +25 -14
- package/build/components/Icons/Earth.js.map +1 -1
- package/build/components/Icons/FileBinary.d.ts +5 -5
- package/build/components/Icons/FileBinary.js +23 -16
- package/build/components/Icons/FileBinary.js.map +1 -1
- package/build/components/Icons/Law.d.ts +5 -5
- package/build/components/Icons/Law.js +24 -17
- package/build/components/Icons/Law.js.map +1 -1
- package/build/components/Icons/License.d.ts +7 -5
- package/build/components/Icons/License.js +19 -8
- package/build/components/Icons/License.js.map +1 -1
- package/build/components/Icons/Managers/Npm.js +10 -3
- package/build/components/Icons/Managers/Npm.js.map +1 -1
- package/build/components/Icons/Managers/Pnpm.js +10 -3
- package/build/components/Icons/Managers/Pnpm.js.map +1 -1
- package/build/components/Icons/Managers/Yarn.js +10 -3
- package/build/components/Icons/Managers/Yarn.js.map +1 -1
- package/build/components/Icons/Managers/index.js +26 -3
- package/build/components/Icons/Managers/index.js.map +1 -1
- package/build/components/Icons/SvgIcon.d.ts +8 -2
- package/build/components/Icons/SvgIcon.js +26 -22
- package/build/components/Icons/SvgIcon.js.map +1 -1
- package/build/components/Icons/Time.d.ts +5 -5
- package/build/components/Icons/Time.js +20 -9
- package/build/components/Icons/Time.js.map +1 -1
- package/build/components/Icons/Version.d.ts +5 -5
- package/build/components/Icons/Version.js +18 -7
- package/build/components/Icons/Version.js.map +1 -1
- package/build/components/Icons/index.js +79 -8
- package/build/components/Icons/index.js.map +1 -1
- package/build/components/Install/Install.d.ts +2 -2
- package/build/components/Install/Install.js +41 -33
- package/build/components/Install/Install.js.map +1 -1
- package/build/components/Install/InstallListItem.js +48 -43
- package/build/components/Install/InstallListItem.js.map +1 -1
- package/build/components/Install/index.js +13 -1
- package/build/components/Install/index.js.map +1 -1
- package/build/components/Keywords/KeywordListItems.js +25 -17
- package/build/components/Keywords/KeywordListItems.js.map +1 -1
- package/build/components/Keywords/Keywords.d.ts +1 -1
- package/build/components/Keywords/Keywords.js +22 -18
- package/build/components/Keywords/Keywords.js.map +1 -1
- package/build/components/Keywords/index.js +13 -1
- package/build/components/Keywords/index.js.map +1 -1
- package/build/components/Label/Label.d.ts +1 -1
- package/build/components/Label/Label.js +25 -17
- package/build/components/Label/Label.js.map +1 -1
- package/build/components/Label/index.js +13 -1
- package/build/components/Label/index.js.map +1 -1
- package/build/components/Link/Link.d.ts +1 -1
- package/build/components/Link/Link.js +26 -19
- package/build/components/Link/Link.js.map +1 -1
- package/build/components/Link/index.js +13 -1
- package/build/components/Link/index.js.map +1 -1
- package/build/components/LinkExternal/LinkExternal.d.ts +1 -1
- package/build/components/LinkExternal/LinkExternal.js +28 -24
- package/build/components/LinkExternal/LinkExternal.js.map +1 -1
- package/build/components/LinkExternal/index.js +13 -1
- package/build/components/LinkExternal/index.js.map +1 -1
- package/build/components/Loading/Loading.js +21 -12
- package/build/components/Loading/Loading.js.map +1 -1
- package/build/components/Loading/Spinner/Spinner.js +31 -26
- package/build/components/Loading/Spinner/Spinner.js.map +1 -1
- package/build/components/Loading/Spinner/index.js +13 -1
- package/build/components/Loading/Spinner/index.js.map +1 -1
- package/build/components/Loading/index.js +13 -1
- package/build/components/Loading/index.js.map +1 -1
- package/build/components/Loading/styles.d.ts +1 -2
- package/build/components/Loading/styles.js +14 -9
- package/build/components/Loading/styles.js.map +1 -1
- package/build/components/LoginDialog/LoginDialog.js +29 -77
- package/build/components/LoginDialog/LoginDialog.js.map +1 -1
- package/build/components/LoginDialog/LoginDialogCloseButton.js +24 -22
- package/build/components/LoginDialog/LoginDialogCloseButton.js.map +1 -1
- package/build/components/LoginDialog/LoginDialogForm.d.ts +2 -11
- package/build/components/LoginDialog/LoginDialogForm.js +25 -111
- package/build/components/LoginDialog/LoginDialogForm.js.map +1 -1
- package/build/components/LoginDialog/LoginDialogFormError.d.ts +1 -6
- package/build/components/LoginDialog/LoginDialogFormError.js +31 -26
- package/build/components/LoginDialog/LoginDialogFormError.js.map +1 -1
- package/build/components/LoginDialog/index.js +13 -1
- package/build/components/LoginDialog/index.js.map +1 -1
- package/build/components/LoginForm/Login.d.ts +15 -0
- package/build/components/LoginForm/Login.js +87 -0
- package/build/components/LoginForm/Login.js.map +1 -0
- package/build/components/LoginForm/PasswordField.d.ts +9 -0
- package/build/components/LoginForm/PasswordField.js +51 -0
- package/build/components/LoginForm/PasswordField.js.map +1 -0
- package/build/components/LoginForm/UsernameField.d.ts +9 -0
- package/build/components/LoginForm/UsernameField.js +49 -0
- package/build/components/LoginForm/UsernameField.js.map +1 -0
- package/build/components/LoginForm/styles.d.ts +6 -0
- package/build/components/LoginForm/styles.js +60 -0
- package/build/components/LoginForm/styles.js.map +1 -0
- package/build/components/LoginForm/useLoginForm.d.ts +78 -0
- package/build/components/LoginForm/useLoginForm.js +66 -0
- package/build/components/LoginForm/useLoginForm.js.map +1 -0
- package/build/components/Logo/Logo.js +34 -29
- package/build/components/Logo/Logo.js.map +1 -1
- package/build/components/Logo/index.js +13 -1
- package/build/components/Logo/index.js.map +1 -1
- package/build/components/MenuItem/MenuItem.d.ts +4 -2
- package/build/components/MenuItem/MenuItem.js +24 -11
- package/build/components/MenuItem/MenuItem.js.map +1 -1
- package/build/components/MenuItem/index.js +13 -1
- package/build/components/MenuItem/index.js.map +1 -1
- package/build/components/NoItems/NoItems.js +15 -10
- package/build/components/NoItems/NoItems.js.map +1 -1
- package/build/components/NoItems/index.js +13 -1
- package/build/components/NoItems/index.js.map +1 -1
- package/build/components/NotFound/NotFound.js +37 -32
- package/build/components/NotFound/NotFound.js.map +1 -1
- package/build/components/NotFound/index.js +13 -1
- package/build/components/NotFound/index.js.map +1 -1
- package/build/components/Package/Package.d.ts +2 -1
- package/build/components/Package/Package.js +187 -155
- package/build/components/Package/Package.js.map +1 -1
- package/build/components/Package/index.js +13 -1
- package/build/components/Package/index.js.map +1 -1
- package/build/components/Package/styles.d.ts +2 -3
- package/build/components/Package/styles.js +73 -72
- package/build/components/Package/styles.js.map +1 -1
- package/build/components/PackageList/PackageList.d.ts +2 -1
- package/build/components/PackageList/PackageList.js +55 -59
- package/build/components/PackageList/PackageList.js.map +1 -1
- package/build/components/PackageList/index.js +13 -1
- package/build/components/PackageList/index.js.map +1 -1
- package/build/components/Person/Person.d.ts +1 -1
- package/build/components/Person/Person.js +28 -22
- package/build/components/Person/Person.js.map +1 -1
- package/build/components/Person/PersonTooltip.d.ts +1 -1
- package/build/components/Person/PersonTooltip.js +18 -13
- package/build/components/Person/PersonTooltip.js.map +1 -1
- package/build/components/Person/index.js +13 -1
- package/build/components/Person/index.js.map +1 -1
- package/build/components/Person/utils.d.ts +1 -1
- package/build/components/Person/utils.js +14 -6
- package/build/components/Person/utils.js.map +1 -1
- package/build/components/RawViewer/RawViewer.js +38 -34
- package/build/components/RawViewer/RawViewer.js.map +1 -1
- package/build/components/RawViewer/index.js +13 -1
- package/build/components/RawViewer/index.js.map +1 -1
- package/build/components/Readme/Readme.d.ts +1 -1
- package/build/components/Readme/Readme.js +26 -22
- package/build/components/Readme/Readme.js.map +1 -1
- package/build/components/Readme/index.js +13 -1
- package/build/components/Readme/index.js.map +1 -1
- package/build/components/Readme/types.js +5 -1
- package/build/components/Readme/utils.js +15 -8
- package/build/components/Readme/utils.js.map +1 -1
- package/build/components/RegistryInfoDialog/RegistryInfoDialog.d.ts +1 -1
- package/build/components/RegistryInfoDialog/RegistryInfoDialog.js +25 -19
- package/build/components/RegistryInfoDialog/RegistryInfoDialog.js.map +1 -1
- package/build/components/RegistryInfoDialog/index.js +13 -1
- package/build/components/RegistryInfoDialog/index.js.map +1 -1
- package/build/components/RegistryInfoDialog/styles.d.ts +1 -2
- package/build/components/RegistryInfoDialog/styles.js +26 -24
- package/build/components/RegistryInfoDialog/styles.js.map +1 -1
- package/build/components/RegistryInfoDialog/types.d.ts +1 -1
- package/build/components/RegistryInfoDialog/types.js +5 -1
- package/build/components/RegistryInfoDialog/types.js.map +1 -1
- package/build/components/Repository/Repository.js +47 -42
- package/build/components/Repository/Repository.js.map +1 -1
- package/build/components/Repository/index.js +13 -1
- package/build/components/Repository/index.js.map +1 -1
- package/build/components/Search/AutoComplete/AutoComplete.d.ts +5 -4
- package/build/components/Search/AutoComplete/AutoComplete.js +44 -26
- package/build/components/Search/AutoComplete/AutoComplete.js.map +1 -1
- package/build/components/Search/AutoComplete/index.js +13 -1
- package/build/components/Search/AutoComplete/index.js.map +1 -1
- package/build/components/Search/AutoComplete/styles.d.ts +0 -1
- package/build/components/Search/AutoComplete/styles.js +9 -2
- package/build/components/Search/AutoComplete/styles.js.map +1 -1
- package/build/components/Search/Search.d.ts +2 -5
- package/build/components/Search/Search.js +133 -123
- package/build/components/Search/Search.js.map +1 -1
- package/build/components/Search/SearchItem.d.ts +1 -1
- package/build/components/Search/SearchItem.js +92 -97
- package/build/components/Search/SearchItem.js.map +1 -1
- package/build/components/Search/index.js +13 -1
- package/build/components/Search/index.js.map +1 -1
- package/build/components/Search/styles.d.ts +5 -4
- package/build/components/Search/styles.js +46 -33
- package/build/components/Search/styles.js.map +1 -1
- package/build/components/Search/utils.js +7 -1
- package/build/components/Search/utils.js.map +1 -1
- package/build/components/SettingsMenu/SettingsMenu.js +60 -52
- package/build/components/SettingsMenu/SettingsMenu.js.map +1 -1
- package/build/components/SettingsMenu/index.js +13 -1
- package/build/components/SettingsMenu/index.js.map +1 -1
- package/build/components/SideBarTitle/SideBarTitle.js +52 -52
- package/build/components/SideBarTitle/SideBarTitle.js.map +1 -1
- package/build/components/SideBarTitle/index.js +13 -1
- package/build/components/SideBarTitle/index.js.map +1 -1
- package/build/components/SideBarTitle/utils.js +15 -6
- package/build/components/SideBarTitle/utils.js.map +1 -1
- package/build/components/UnAuthorized/UnAuthorized.d.ts +3 -0
- package/build/components/UnAuthorized/UnAuthorized.js +75 -0
- package/build/components/UnAuthorized/UnAuthorized.js.map +1 -0
- package/build/components/UnAuthorized/index.d.ts +1 -0
- package/build/components/UnAuthorized/index.js +14 -0
- package/build/components/UnAuthorized/index.js.map +1 -0
- package/build/components/UpLinks/UpLinks.js +46 -42
- package/build/components/UpLinks/UpLinks.js.map +1 -1
- package/build/components/UpLinks/UplinkLink.js +17 -12
- package/build/components/UpLinks/UplinkLink.js.map +1 -1
- package/build/components/UpLinks/index.js +13 -1
- package/build/components/UpLinks/index.js.map +1 -1
- package/build/components/UpLinks/styles.d.ts +1 -2
- package/build/components/UpLinks/styles.js +26 -20
- package/build/components/UpLinks/styles.js.map +1 -1
- package/build/components/Versions/HistoryList.d.ts +1 -1
- package/build/components/Versions/HistoryList.js +44 -37
- package/build/components/Versions/HistoryList.js.map +1 -1
- package/build/components/Versions/TagList.d.ts +1 -1
- package/build/components/Versions/TagList.js +33 -26
- package/build/components/Versions/TagList.js.map +1 -1
- package/build/components/Versions/Versions.js +67 -50
- package/build/components/Versions/Versions.js.map +1 -1
- package/build/components/Versions/index.js +13 -1
- package/build/components/Versions/index.js.map +1 -1
- package/build/components/Versions/styles.d.ts +1 -2
- package/build/components/Versions/styles.js +19 -15
- package/build/components/Versions/styles.js.map +1 -1
- package/build/components/Versions/types.d.ts +1 -1
- package/build/components/Versions/types.js +5 -1
- package/build/components/Versions/types.js.map +1 -1
- package/build/configuration.d.ts +2 -0
- package/build/configuration.js +23 -0
- package/build/configuration.js.map +1 -0
- package/build/hooks/index.js +20 -2
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/useLocalStorage.js +31 -18
- package/build/hooks/useLocalStorage.js.map +1 -1
- package/build/hooks/useOnClickOutside.d.ts +1 -1
- package/build/hooks/useOnClickOutside.js +10 -5
- package/build/hooks/useOnClickOutside.js.map +1 -1
- package/build/index.d.ts +6 -14
- package/build/index.js +481 -66
- package/build/index.js.map +1 -1
- package/build/layouts/Security/Dialog.js +16 -11
- package/build/layouts/Security/Dialog.js.map +1 -1
- package/build/layouts/Version/Version.js +16 -9
- package/build/layouts/Version/Version.js.map +1 -1
- package/build/layouts/Version/index.js +13 -1
- package/build/layouts/Version/index.js.map +1 -1
- package/build/pages/Front/Home.d.ts +2 -0
- package/build/pages/Front/Home.js +9 -0
- package/build/pages/Front/Home.js.map +1 -0
- package/build/pages/Front/index.js +14 -0
- package/build/pages/Front/index.js.map +1 -0
- package/build/pages/Security/AddUser.d.ts +2 -0
- package/build/pages/Security/AddUser.js +9 -0
- package/build/pages/Security/AddUser.js.map +1 -0
- package/build/pages/Security/ChangePassword.d.ts +2 -0
- package/build/pages/Security/ChangePassword.js +9 -0
- package/build/pages/Security/ChangePassword.js.map +1 -0
- package/build/pages/Security/Login.d.ts +2 -0
- package/build/pages/Security/Login.js +9 -0
- package/build/pages/Security/Login.js.map +1 -0
- package/build/pages/Security/Success.d.ts +2 -0
- package/build/pages/Security/Success.js +9 -0
- package/build/pages/Security/Success.js.map +1 -0
- package/build/pages/Security/index.js +35 -0
- package/build/pages/Security/index.js.map +1 -0
- package/build/pages/Version/Version.js +32 -0
- package/build/pages/Version/Version.js.map +1 -0
- package/build/pages/Version/index.js +14 -0
- package/build/pages/Version/index.js.map +1 -0
- package/build/providers/AppConfigurationProvider/AppConfigurationProvider.d.ts +8 -6
- package/build/providers/AppConfigurationProvider/AppConfigurationProvider.js +67 -46
- package/build/providers/AppConfigurationProvider/AppConfigurationProvider.js.map +1 -1
- package/build/providers/AppConfigurationProvider/index.d.ts +1 -1
- package/build/providers/AppConfigurationProvider/index.js +18 -1
- package/build/providers/AppConfigurationProvider/index.js.map +1 -1
- package/build/providers/AuthProvider/AuthProvider.d.ts +18 -0
- package/build/providers/AuthProvider/AuthProvider.js +102 -0
- package/build/providers/AuthProvider/AuthProvider.js.map +1 -0
- package/build/providers/AuthProvider/index.d.ts +1 -0
- package/build/providers/AuthProvider/index.js +17 -0
- package/build/providers/AuthProvider/index.js.map +1 -0
- package/build/providers/AuthProvider/types.d.ts +15 -0
- package/build/providers/AuthProvider/types.js +6 -0
- package/build/providers/AuthProvider/types.js.map +1 -0
- package/build/providers/AuthProvider/utils.d.ts +3 -0
- package/build/providers/AuthProvider/utils.js +27 -0
- package/build/providers/AuthProvider/utils.js.map +1 -0
- package/build/providers/DownloadProvider/DownloadProvider.d.ts +13 -0
- package/build/providers/DownloadProvider/DownloadProvider.js +73 -0
- package/build/providers/DownloadProvider/DownloadProvider.js.map +1 -0
- package/build/providers/DownloadProvider/index.d.ts +1 -0
- package/build/providers/DownloadProvider/index.js +19 -0
- package/build/providers/DownloadProvider/index.js.map +1 -0
- package/build/providers/ManifestsProvider/ManifestsProvider.d.ts +26 -0
- package/build/providers/ManifestsProvider/ManifestsProvider.js +33 -0
- package/build/providers/ManifestsProvider/ManifestsProvider.js.map +1 -0
- package/build/providers/ManifestsProvider/README.md +22 -0
- package/build/providers/ManifestsProvider/index.d.ts +1 -0
- package/build/providers/ManifestsProvider/index.js +21 -0
- package/build/providers/ManifestsProvider/index.js.map +1 -0
- package/build/providers/PersistenceSettingProvider/PersistenceSettingProvider.d.ts +3 -2
- package/build/providers/PersistenceSettingProvider/PersistenceSettingProvider.js +39 -17
- package/build/providers/PersistenceSettingProvider/PersistenceSettingProvider.js.map +1 -1
- package/build/providers/PersistenceSettingProvider/index.d.ts +1 -1
- package/build/providers/PersistenceSettingProvider/index.js +18 -1
- package/build/providers/PersistenceSettingProvider/index.js.map +1 -1
- package/build/providers/SearchProvider/SearchProvider.d.ts +19 -0
- package/build/providers/SearchProvider/SearchProvider.js +97 -0
- package/build/providers/SearchProvider/SearchProvider.js.map +1 -0
- package/build/providers/SearchProvider/index.d.ts +1 -0
- package/build/providers/SearchProvider/index.js +25 -0
- package/build/providers/SearchProvider/index.js.map +1 -0
- package/build/providers/TranslatorProvider/TranslatorProvider.d.ts +3 -2
- package/build/providers/TranslatorProvider/TranslatorProvider.js +52 -25
- package/build/providers/TranslatorProvider/TranslatorProvider.js.map +1 -1
- package/build/providers/TranslatorProvider/index.js +20 -1
- package/build/providers/TranslatorProvider/index.js.map +1 -1
- package/build/providers/VersionProvider/VersionProvider.d.ts +13 -31
- package/build/providers/VersionProvider/VersionProvider.js +55 -69
- package/build/providers/VersionProvider/VersionProvider.js.map +1 -1
- package/build/providers/VersionProvider/index.js +20 -1
- package/build/providers/VersionProvider/index.js.map +1 -1
- package/build/providers/index.d.ts +5 -0
- package/build/providers/index.js +93 -3
- package/build/providers/index.js.map +1 -1
- package/build/routes/SecurityRoutes.d.ts +3 -0
- package/build/routes/SecurityRoutes.js +36 -0
- package/build/routes/SecurityRoutes.js.map +1 -0
- package/build/sections/Detail/ContainerContent.js +40 -22
- package/build/sections/Detail/ContainerContent.js.map +1 -1
- package/build/sections/Detail/Detail.js +42 -23
- package/build/sections/Detail/Detail.js.map +1 -1
- package/build/sections/Detail/ReadmeSection.js +13 -8
- package/build/sections/Detail/ReadmeSection.js.map +1 -1
- package/build/sections/Detail/Tabs.js +29 -23
- package/build/sections/Detail/Tabs.js.map +1 -1
- package/build/sections/Detail/index.js +13 -1
- package/build/sections/Detail/index.js.map +1 -1
- package/build/sections/Footer/Footer.js +62 -61
- package/build/sections/Footer/Footer.js.map +1 -1
- package/build/sections/Footer/index.js +13 -1
- package/build/sections/Footer/index.js.map +1 -1
- package/build/sections/Footer/styles.d.ts +1 -2
- package/build/sections/Footer/styles.js +47 -47
- package/build/sections/Footer/styles.js.map +1 -1
- package/build/sections/Header/Header.js +106 -65
- package/build/sections/Header/Header.js.map +1 -1
- package/build/sections/Header/HeaderGreetings.js +17 -13
- package/build/sections/Header/HeaderGreetings.js.map +1 -1
- package/build/sections/Header/HeaderLeft.js +19 -14
- package/build/sections/Header/HeaderLeft.js.map +1 -1
- package/build/sections/Header/HeaderMenu.d.ts +2 -1
- package/build/sections/Header/HeaderMenu.js +29 -24
- package/build/sections/Header/HeaderMenu.js.map +1 -1
- package/build/sections/Header/HeaderRight.js +61 -44
- package/build/sections/Header/HeaderRight.js.map +1 -1
- package/build/sections/Header/HeaderSettingsDialog.js +58 -53
- package/build/sections/Header/HeaderSettingsDialog.js.map +1 -1
- package/build/sections/Header/HeaderToolTip.d.ts +1 -1
- package/build/sections/Header/HeaderToolTip.js +14 -9
- package/build/sections/Header/HeaderToolTip.js.map +1 -1
- package/build/sections/Header/HeaderToolTipIcon.d.ts +4 -1
- package/build/sections/Header/HeaderToolTipIcon.js +30 -26
- package/build/sections/Header/HeaderToolTipIcon.js.map +1 -1
- package/build/sections/Header/LanguageSwitch.js +64 -56
- package/build/sections/Header/LanguageSwitch.js.map +1 -1
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.d.ts +2 -1
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.js +77 -74
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.js.map +1 -1
- package/build/sections/Header/RegistryInfoContent/index.js +13 -1
- package/build/sections/Header/RegistryInfoContent/index.js.map +1 -1
- package/build/sections/Header/RegistryInfoContent/styles.d.ts +1 -2
- package/build/sections/Header/RegistryInfoContent/styles.js +20 -13
- package/build/sections/Header/RegistryInfoContent/styles.js.map +1 -1
- package/build/sections/Header/index.js +13 -1
- package/build/sections/Header/index.js.map +1 -1
- package/build/sections/Header/styles.d.ts +1 -2
- package/build/sections/Header/styles.js +60 -50
- package/build/sections/Header/styles.js.map +1 -1
- package/build/sections/Home/Home.js +19 -19
- package/build/sections/Home/Home.js.map +1 -1
- package/build/sections/Home/index.js +13 -1
- package/build/sections/Home/index.js.map +1 -1
- package/build/sections/Security/AddUser.js +146 -85
- package/build/sections/Security/AddUser.js.map +1 -1
- package/build/sections/Security/ChangePassword.js +150 -95
- package/build/sections/Security/ChangePassword.js.map +1 -1
- package/build/sections/Security/Login.js +126 -87
- package/build/sections/Security/Login.js.map +1 -1
- package/build/sections/Security/Success.js +25 -19
- package/build/sections/Security/Success.js.map +1 -1
- package/build/sections/Security/index.js +34 -4
- package/build/sections/Security/index.js.map +1 -1
- package/build/sections/Security/styles.js +15 -15
- package/build/sections/Security/styles.js.map +1 -1
- package/build/sections/Security/utils.js +16 -8
- package/build/sections/Security/utils.js.map +1 -1
- package/build/sections/SideBar/Sidebar.js +49 -40
- package/build/sections/SideBar/Sidebar.js.map +1 -1
- package/build/sections/SideBar/index.js +13 -1
- package/build/sections/SideBar/index.js.map +1 -1
- package/build/sections/index.js +20 -2
- package/build/sections/index.js.map +1 -1
- package/build/store/api.d.ts +1 -1
- package/build/store/api.js +89 -48
- package/build/store/api.js.map +1 -1
- package/build/store/index.d.ts +0 -6
- package/build/store/index.js +13 -2
- package/build/store/index.js.map +1 -1
- package/build/store/{models/routes.d.ts → routes.d.ts} +4 -0
- package/build/store/{models/routes.js → routes.js} +11 -1
- package/build/store/routes.js.map +1 -0
- package/build/store/storage.d.ts +6 -0
- package/build/store/storage.js +28 -4
- package/build/store/storage.js.map +1 -1
- package/build/store/utils.js +14 -0
- package/build/store/utils.js.map +1 -0
- package/build/test/i18n-config.js +12 -4
- package/build/test/i18n-config.js.map +1 -1
- package/build/test/test-react-testing-library.d.ts +19 -4
- package/build/test/test-react-testing-library.js +140 -28
- package/build/test/test-react-testing-library.js.map +1 -1
- package/build/types/external-modules.d.js +2 -0
- package/build/types/external-modules.d.js.map +1 -0
- package/build/types/index.d.ts +1 -1
- package/build/types/index.js +5 -1
- package/build/types/index.js.map +1 -1
- package/build/types/packageMeta.d.ts +1 -6
- package/build/types/packageMeta.js +5 -1
- package/build/types/packageMeta.js.map +1 -1
- package/build/utils/cli-utils.d.ts +1 -1
- package/build/utils/cli-utils.js +30 -18
- package/build/utils/cli-utils.js.map +1 -1
- package/build/utils/index.js +74 -8
- package/build/utils/index.js.map +1 -1
- package/build/utils/loadable.js +15 -7
- package/build/utils/loadable.js.map +1 -1
- package/build/utils/routes.d.ts +11 -3
- package/build/utils/routes.js +20 -4
- package/build/utils/routes.js.map +1 -1
- package/build/utils/schemas.d.ts +34 -0
- package/build/utils/schemas.js +30 -0
- package/build/utils/schemas.js.map +1 -0
- package/build/utils/token-generate.js +17 -6
- package/build/utils/token-generate.js.map +1 -1
- package/build/utils/token.js +23 -9
- package/build/utils/token.js.map +1 -1
- package/build/utils/url.js +20 -10
- package/build/utils/url.js.map +1 -1
- package/build/utils/utils.d.ts +2 -2
- package/build/utils/utils.js +48 -29
- package/build/utils/utils.js.map +1 -1
- package/package.json +28 -29
- package/build/AppTest/pages/Front/Home.d.ts +0 -2
- package/build/AppTest/pages/Front/Home.js +0 -3
- package/build/AppTest/pages/Front/Home.js.map +0 -1
- package/build/AppTest/pages/Front/index.js +0 -2
- package/build/AppTest/pages/Front/index.js.map +0 -1
- package/build/AppTest/pages/Security/AddUser.d.ts +0 -2
- package/build/AppTest/pages/Security/AddUser.js +0 -3
- package/build/AppTest/pages/Security/AddUser.js.map +0 -1
- package/build/AppTest/pages/Security/ChangePassword.d.ts +0 -2
- package/build/AppTest/pages/Security/ChangePassword.js +0 -3
- package/build/AppTest/pages/Security/ChangePassword.js.map +0 -1
- package/build/AppTest/pages/Security/Login.d.ts +0 -2
- package/build/AppTest/pages/Security/Login.js +0 -3
- package/build/AppTest/pages/Security/Login.js.map +0 -1
- package/build/AppTest/pages/Security/Success.d.ts +0 -2
- package/build/AppTest/pages/Security/Success.js +0 -3
- package/build/AppTest/pages/Security/Success.js.map +0 -1
- package/build/AppTest/pages/Security/index.js +0 -5
- package/build/AppTest/pages/Security/index.js.map +0 -1
- package/build/AppTest/pages/Version/Version.js +0 -27
- package/build/AppTest/pages/Version/Version.js.map +0 -1
- package/build/AppTest/pages/Version/index.js +0 -2
- package/build/AppTest/pages/Version/index.js.map +0 -1
- package/build/components/LoginDialog/LoginDialogHeader.d.ts +0 -6
- package/build/components/LoginDialog/LoginDialogHeader.js +0 -59
- package/build/components/LoginDialog/LoginDialogHeader.js.map +0 -1
- package/build/components/TextField/TextField.d.ts +0 -3
- package/build/components/TextField/TextField.js +0 -30
- package/build/components/TextField/TextField.js.map +0 -1
- package/build/components/TextField/index.d.ts +0 -1
- package/build/components/TextField/index.js +0 -2
- package/build/components/TextField/index.js.map +0 -1
- package/build/sections/Security/LoginError.d.ts +0 -7
- package/build/sections/Security/LoginError.js +0 -38
- package/build/sections/Security/LoginError.js.map +0 -1
- package/build/store/models/add-user.d.ts +0 -45
- package/build/store/models/add-user.js +0 -103
- package/build/store/models/add-user.js.map +0 -1
- package/build/store/models/change-password.d.ts +0 -44
- package/build/store/models/change-password.js +0 -118
- package/build/store/models/change-password.js.map +0 -1
- package/build/store/models/configuration.d.ts +0 -24
- package/build/store/models/configuration.js +0 -46
- package/build/store/models/configuration.js.map +0 -1
- package/build/store/models/download.d.ts +0 -16
- package/build/store/models/download.js +0 -38
- package/build/store/models/download.js.map +0 -1
- package/build/store/models/index.d.ts +0 -22
- package/build/store/models/index.js +0 -21
- package/build/store/models/index.js.map +0 -1
- package/build/store/models/login-v1.d.ts +0 -44
- package/build/store/models/login-v1.js +0 -111
- package/build/store/models/login-v1.js.map +0 -1
- package/build/store/models/login.d.ts +0 -69
- package/build/store/models/login.js +0 -102
- package/build/store/models/login.js.map +0 -1
- package/build/store/models/manifest.d.ts +0 -54
- package/build/store/models/manifest.js +0 -117
- package/build/store/models/manifest.js.map +0 -1
- package/build/store/models/packages.d.ts +0 -28
- package/build/store/models/packages.js +0 -47
- package/build/store/models/packages.js.map +0 -1
- package/build/store/models/routes.js.map +0 -1
- package/build/store/models/search.d.ts +0 -42
- package/build/store/models/search.js +0 -92
- package/build/store/models/search.js.map +0 -1
- package/build/store/models/utils.js +0 -7
- package/build/store/models/utils.js.map +0 -1
- package/build/store/store.d.ts +0 -9
- package/build/store/store.js +0 -8
- package/build/store/store.js.map +0 -1
- /package/build/{AppTest/pages → pages}/Front/index.d.ts +0 -0
- /package/build/{AppTest/pages → pages}/Security/index.d.ts +0 -0
- /package/build/{AppTest/pages → pages}/Version/Version.d.ts +0 -0
- /package/build/{AppTest/pages → pages}/Version/index.d.ts +0 -0
- /package/build/store/{models/utils.d.ts → utils.d.ts} +0 -0
package/build/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["_cliUtils","require","_loadable","_interopRequireDefault","_routes","_token","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","e","__esModule","_interopRequireWildcard","t","WeakMap","r","n","o","i","f","__proto__","_typeof","has","set","_t","getOwnPropertyDescriptor"],"sources":["../../src/utils/index.ts"],"sourcesContent":["export * as url from './url';\nexport * as utils from './utils';\nexport {\n getCLIChangePassword,\n getCLISBerryYamlRegistry,\n getCLISetConfigRegistry,\n getCLISetRegistry,\n} from './cli-utils';\nexport { default as loadable } from './loadable';\nexport { Route } from './routes';\nexport * from './token';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAAA,SAAA,GAAAC,OAAA;AAMA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAAAK,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;E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AAA,WAAAL,CAAA,KAAAT,CAAA,EAAAG,CAAA","ignoreList":[]}
|
package/build/utils/loadable.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import React, { Suspense, lazy } from 'react';
|
|
1
|
+
"use strict";
|
|
3
2
|
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
4
10
|
/**
|
|
5
11
|
* With the combination of a bundler, enable to code split a package.
|
|
6
12
|
*
|
|
@@ -10,10 +16,12 @@ import React, { Suspense, lazy } from 'react';
|
|
|
10
16
|
```
|
|
11
17
|
@category HOC
|
|
12
18
|
*/
|
|
13
|
-
|
|
14
|
-
var TargetComponent = /*#__PURE__*/lazy(importCallback);
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
var _default = exports["default"] = function _default(importCallback) {
|
|
20
|
+
var TargetComponent = /*#__PURE__*/(0, _react.lazy)(importCallback);
|
|
21
|
+
return function (props) {
|
|
22
|
+
return /*#__PURE__*/_react["default"].createElement(_react.Suspense, {
|
|
23
|
+
fallback: null
|
|
24
|
+
}, /*#__PURE__*/_react["default"].createElement(TargetComponent, props));
|
|
25
|
+
};
|
|
18
26
|
};
|
|
19
27
|
//# sourceMappingURL=loadable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadable.js","names":["
|
|
1
|
+
{"version":3,"file":"loadable.js","names":["_react","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_default","exports","importCallback","TargetComponent","lazy","props","createElement","Suspense","fallback"],"sources":["../../src/utils/loadable.tsx"],"sourcesContent":["import React, { Suspense, lazy } from 'react';\n\n/**\n * With the combination of a bundler, enable to code split a package.\n * \n * @example\n ```jsx\n const VersionPage = loadable(() => import(/'../pages/Version'));\n ```\n @category HOC\n */\nexport default (importCallback: any) => {\n const TargetComponent = lazy(importCallback);\n return (props: any) => (\n <Suspense fallback={null}>\n <TargetComponent {...props} />\n </Suspense>\n );\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA8C,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,wBAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,mBAAAT,CAAA,iBAAAA,CAAA,gBAAAU,OAAA,CAAAV,CAAA,0BAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,cAAAM,EAAA,IAAAd,CAAA,gBAAAc,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,EAAA,OAAAP,CAAA,IAAAD,CAAA,GAAAW,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAnB,CAAA,EAAAc,EAAA,OAAAP,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAM,EAAA,EAAAP,CAAA,IAAAC,CAAA,CAAAM,EAAA,IAAAd,CAAA,CAAAc,EAAA,WAAAN,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,IAAAmB,QAAA,GAAAC,OAAA,cASe,SAAAD,SAACE,cAAmB,EAAK;EACtC,IAAMC,eAAe,gBAAG,IAAAC,WAAI,EAACF,cAAc,CAAC;EAC5C,OAAO,UAACG,KAAU;IAAA,oBAChB5B,MAAA,YAAA6B,aAAA,CAAC7B,MAAA,CAAA8B,QAAQ;MAACC,QAAQ,EAAE;IAAK,gBACvB/B,MAAA,YAAA6B,aAAA,CAACH,eAAe,EAAKE,KAAQ,CACrB,CAAC;EAAA,CACZ;AACH,CAAC","ignoreList":[]}
|
package/build/utils/routes.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare enum Route {
|
|
2
2
|
ROOT = "/",
|
|
3
3
|
DETAIL = "/-/web/detail/",
|
|
4
|
-
SCOPE_PACKAGE = "/-/web/detail
|
|
5
|
-
SCOPE_PACKAGE_VERSION = "/-/web/detail
|
|
4
|
+
SCOPE_PACKAGE = "/-/web/detail/:scope/:package",
|
|
5
|
+
SCOPE_PACKAGE_VERSION = "/-/web/detail/:scope/:package/v/:version",
|
|
6
6
|
PACKAGE = "/-/web/detail/:package",
|
|
7
7
|
PACKAGE_VERSION = "/-/web/detail/:package/v/:version",
|
|
8
8
|
LOGIN = "/-/web/login",
|
|
@@ -10,6 +10,14 @@ export declare enum Route {
|
|
|
10
10
|
ADD_USER = "/-/web/add-user",
|
|
11
11
|
CHANGE_PASSWORD = "/-/web/change-password",
|
|
12
12
|
LOGIN_API = "/-/v1/login_cli",
|
|
13
|
-
ADD_USER_API = "/-/user/org.couchdb.user",
|
|
14
13
|
CHANGE_PASSWORD_API = "/-/npm/v1/user"
|
|
15
14
|
}
|
|
15
|
+
export declare enum APIRoute {
|
|
16
|
+
LOGIN = "/-/verdaccio/sec/login",
|
|
17
|
+
RESET_PASSWORD = "/-/verdaccio/sec/reset_password",
|
|
18
|
+
CONFIG = "/-/verdaccio/packages",
|
|
19
|
+
PACKAGES = "/-/verdaccio/data/packages",
|
|
20
|
+
SEARCH = "/-/verdaccio/data/search/",// :value
|
|
21
|
+
SIDEBAR = "/-/verdaccio/data/sidebar/",// :packageName?v=version
|
|
22
|
+
README = "/-/verdaccio/data/package/readme/"
|
|
23
|
+
}
|
package/build/utils/routes.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Route = exports.APIRoute = void 0;
|
|
7
|
+
var Route = exports.Route = /*#__PURE__*/function (Route) {
|
|
2
8
|
Route["ROOT"] = "/";
|
|
3
9
|
Route["DETAIL"] = "/-/web/detail/";
|
|
4
|
-
Route["SCOPE_PACKAGE"] = "/-/web/detail
|
|
5
|
-
Route["SCOPE_PACKAGE_VERSION"] = "/-/web/detail
|
|
10
|
+
Route["SCOPE_PACKAGE"] = "/-/web/detail/:scope/:package";
|
|
11
|
+
Route["SCOPE_PACKAGE_VERSION"] = "/-/web/detail/:scope/:package/v/:version";
|
|
6
12
|
Route["PACKAGE"] = "/-/web/detail/:package";
|
|
7
13
|
Route["PACKAGE_VERSION"] = "/-/web/detail/:package/v/:version";
|
|
8
14
|
Route["LOGIN"] = "/-/web/login";
|
|
@@ -10,8 +16,18 @@ export var Route = /*#__PURE__*/function (Route) {
|
|
|
10
16
|
Route["ADD_USER"] = "/-/web/add-user";
|
|
11
17
|
Route["CHANGE_PASSWORD"] = "/-/web/change-password";
|
|
12
18
|
Route["LOGIN_API"] = "/-/v1/login_cli";
|
|
13
|
-
Route["ADD_USER_API"] = "/-/user/org.couchdb.user";
|
|
14
19
|
Route["CHANGE_PASSWORD_API"] = "/-/npm/v1/user";
|
|
15
20
|
return Route;
|
|
21
|
+
}({}); // Example API request:
|
|
22
|
+
// http://localhost:8000/-/verdaccio/data/package/readme/jquery
|
|
23
|
+
var APIRoute = exports.APIRoute = /*#__PURE__*/function (APIRoute) {
|
|
24
|
+
APIRoute["LOGIN"] = "/-/verdaccio/sec/login";
|
|
25
|
+
APIRoute["RESET_PASSWORD"] = "/-/verdaccio/sec/reset_password";
|
|
26
|
+
APIRoute["CONFIG"] = "/-/verdaccio/packages";
|
|
27
|
+
APIRoute["PACKAGES"] = "/-/verdaccio/data/packages";
|
|
28
|
+
APIRoute["SEARCH"] = "/-/verdaccio/data/search/";
|
|
29
|
+
APIRoute["SIDEBAR"] = "/-/verdaccio/data/sidebar/";
|
|
30
|
+
APIRoute["README"] = "/-/verdaccio/data/package/readme/";
|
|
31
|
+
return APIRoute;
|
|
16
32
|
}({});
|
|
17
33
|
//# sourceMappingURL=routes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","names":["Route"],"sources":["../../src/utils/routes.ts"],"sourcesContent":["export enum Route {\n ROOT = '/',\n DETAIL = '/-/web/detail/',\n SCOPE_PACKAGE = '/-/web/detail
|
|
1
|
+
{"version":3,"file":"routes.js","names":["Route","exports","APIRoute"],"sources":["../../src/utils/routes.ts"],"sourcesContent":["export enum Route {\n ROOT = '/',\n DETAIL = '/-/web/detail/',\n SCOPE_PACKAGE = '/-/web/detail/:scope/:package',\n SCOPE_PACKAGE_VERSION = '/-/web/detail/:scope/:package/v/:version',\n PACKAGE = '/-/web/detail/:package',\n PACKAGE_VERSION = '/-/web/detail/:package/v/:version',\n // Security UI routes\n LOGIN = '/-/web/login',\n SUCCESS = '/-/web/success',\n ADD_USER = '/-/web/add-user',\n CHANGE_PASSWORD = '/-/web/change-password',\n // Security API routes\n LOGIN_API = '/-/v1/login_cli',\n CHANGE_PASSWORD_API = '/-/npm/v1/user',\n}\n\n// Example API request:\n// http://localhost:8000/-/verdaccio/data/package/readme/jquery\nexport enum APIRoute {\n LOGIN = '/-/verdaccio/sec/login',\n RESET_PASSWORD = '/-/verdaccio/sec/reset_password',\n CONFIG = '/-/verdaccio/packages',\n PACKAGES = '/-/verdaccio/data/packages',\n SEARCH = '/-/verdaccio/data/search/', // :value\n SIDEBAR = '/-/verdaccio/data/sidebar/', // :packageName?v=version\n README = '/-/verdaccio/data/package/readme/', // :packageName?v=version\n}\n"],"mappings":";;;;;;IAAYA,KAAK,GAAAC,OAAA,CAAAD,KAAA,0BAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAAA,OAALA,KAAK;AAAA,OAiBjB;AACA;AAAA,IACYE,QAAQ,GAAAD,OAAA,CAAAC,QAAA,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export declare const USERNAME_MIN_LENGTH = 2;
|
|
3
|
+
export declare const usernameSchema: yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
|
4
|
+
export declare const passwordSchema: yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
|
5
|
+
export declare const loginSchema: yup.ObjectSchema<{
|
|
6
|
+
username: string;
|
|
7
|
+
password: string;
|
|
8
|
+
}, yup.AnyObject, {
|
|
9
|
+
username: undefined;
|
|
10
|
+
password: undefined;
|
|
11
|
+
}, "">;
|
|
12
|
+
export type LoginFormValues = yup.InferType<typeof loginSchema>;
|
|
13
|
+
export declare const addUserSchema: yup.ObjectSchema<{
|
|
14
|
+
username: string;
|
|
15
|
+
password: string;
|
|
16
|
+
email: string;
|
|
17
|
+
}, yup.AnyObject, {
|
|
18
|
+
username: undefined;
|
|
19
|
+
password: undefined;
|
|
20
|
+
email: undefined;
|
|
21
|
+
}, "">;
|
|
22
|
+
export type AddUserFormValues = yup.InferType<typeof addUserSchema>;
|
|
23
|
+
export declare const changePasswordSchema: yup.ObjectSchema<{
|
|
24
|
+
username: string;
|
|
25
|
+
oldPassword: string;
|
|
26
|
+
newPassword: string;
|
|
27
|
+
confirmPassword: string;
|
|
28
|
+
}, yup.AnyObject, {
|
|
29
|
+
username: undefined;
|
|
30
|
+
oldPassword: undefined;
|
|
31
|
+
newPassword: undefined;
|
|
32
|
+
confirmPassword: undefined;
|
|
33
|
+
}, "">;
|
|
34
|
+
export type ChangePasswordFormValues = yup.InferType<typeof changePasswordSchema>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.usernameSchema = exports.passwordSchema = exports.loginSchema = exports.changePasswordSchema = exports.addUserSchema = exports.USERNAME_MIN_LENGTH = void 0;
|
|
8
|
+
var yup = _interopRequireWildcard(require("yup"));
|
|
9
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
10
|
+
var USERNAME_MIN_LENGTH = exports.USERNAME_MIN_LENGTH = 2;
|
|
11
|
+
|
|
12
|
+
// Matches your current logic
|
|
13
|
+
var usernameSchema = exports.usernameSchema = yup.string().required().min(USERNAME_MIN_LENGTH).matches(/^[-a-zA-Z0-9_.!~*'()@]+$/, 'security.error.username-must-be-url-safe');
|
|
14
|
+
var passwordSchema = exports.passwordSchema = yup.string().required().min(2);
|
|
15
|
+
var loginSchema = exports.loginSchema = yup.object({
|
|
16
|
+
username: usernameSchema,
|
|
17
|
+
password: passwordSchema
|
|
18
|
+
});
|
|
19
|
+
var addUserSchema = exports.addUserSchema = yup.object({
|
|
20
|
+
username: usernameSchema,
|
|
21
|
+
password: passwordSchema,
|
|
22
|
+
email: yup.string().email().required()
|
|
23
|
+
});
|
|
24
|
+
var changePasswordSchema = exports.changePasswordSchema = yup.object({
|
|
25
|
+
username: usernameSchema,
|
|
26
|
+
oldPassword: passwordSchema,
|
|
27
|
+
newPassword: passwordSchema,
|
|
28
|
+
confirmPassword: yup.string().required().oneOf([yup.ref('newPassword')], 'security.error.password-mismatch')
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","names":["yup","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","USERNAME_MIN_LENGTH","exports","usernameSchema","string","required","min","matches","passwordSchema","loginSchema","object","username","password","addUserSchema","email","changePasswordSchema","oldPassword","newPassword","confirmPassword","oneOf","ref"],"sources":["../../src/utils/schemas.ts"],"sourcesContent":["import * as yup from 'yup';\n\nexport const USERNAME_MIN_LENGTH = 2;\n\n// Matches your current logic\nexport const usernameSchema = yup\n .string()\n .required()\n .min(USERNAME_MIN_LENGTH)\n .matches(/^[-a-zA-Z0-9_.!~*'()@]+$/, 'security.error.username-must-be-url-safe');\n\nexport const passwordSchema = yup.string().required().min(2);\n\nexport const loginSchema = yup.object({\n username: usernameSchema,\n password: passwordSchema,\n});\n\nexport type LoginFormValues = yup.InferType<typeof loginSchema>;\n\nexport const addUserSchema = yup.object({\n username: usernameSchema,\n password: passwordSchema,\n email: yup.string().email().required(),\n});\n\nexport type AddUserFormValues = yup.InferType<typeof addUserSchema>;\n\nexport const changePasswordSchema = yup.object({\n username: usernameSchema,\n oldPassword: passwordSchema,\n newPassword: passwordSchema,\n confirmPassword: yup\n .string()\n .required()\n .oneOf([yup.ref('newPassword')], 'security.error.password-mismatch'),\n});\n\nexport type ChangePasswordFormValues = yup.InferType<typeof changePasswordSchema>;\n"],"mappings":";;;;;;;AAAA,IAAAA,GAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA2B,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,wBAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,mBAAAT,CAAA,i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GAAAX,OAAA,CAAAW,aAAA,GAAGnC,GAAG,CAACgC,MAAM,CAAC;EACtCC,QAAQ,EAAER,cAAc;EACxBS,QAAQ,EAAEJ,cAAc;EACxBM,KAAK,EAAEpC,GAAG,CAAC0B,MAAM,CAAC,CAAC,CAACU,KAAK,CAAC,CAAC,CAACT,QAAQ,CAAC;AACvC,CAAC,CAAC;AAIK,IAAMU,oBAAoB,GAAAb,OAAA,CAAAa,oBAAA,GAAGrC,GAAG,CAACgC,MAAM,CAAC;EAC7CC,QAAQ,EAAER,cAAc;EACxBa,WAAW,EAAER,cAAc;EAC3BS,WAAW,EAAET,cAAc;EAC3BU,eAAe,EAAExC,GAAG,CACjB0B,MAAM,CAAC,CAAC,CACRC,QAAQ,CAAC,CAAC,CACVc,KAAK,CAAC,CAACzC,GAAG,CAAC0C,GAAG,CAAC,aAAa,CAAC,CAAC,EAAE,kCAAkC;AACvE,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,30 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.generateInvalidToken = generateInvalidToken;
|
|
7
|
+
exports.generateTokenWithExpirationAsString = generateTokenWithExpirationAsString;
|
|
8
|
+
exports.generateTokenWithOutExpiration = generateTokenWithOutExpiration;
|
|
9
|
+
exports.generateTokenWithTimeRange = generateTokenWithTimeRange;
|
|
10
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
1
12
|
/**
|
|
2
13
|
* Token Utility
|
|
3
14
|
*/
|
|
4
|
-
|
|
15
|
+
|
|
5
16
|
function encodeBase64(string) {
|
|
6
17
|
return Buffer.from(string).toString('base64');
|
|
7
18
|
}
|
|
8
|
-
|
|
19
|
+
function generateTokenWithTimeRange() {
|
|
9
20
|
var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
10
21
|
var payload = {
|
|
11
22
|
username: 'verdaccio',
|
|
12
|
-
exp: Number.parseInt(String(
|
|
23
|
+
exp: Number.parseInt(String((0, _dayjs["default"])(new Date()).add(amount, 'hour').valueOf() / 1000), 10)
|
|
13
24
|
};
|
|
14
25
|
return "xxxxxx.".concat(encodeBase64(JSON.stringify(payload)), ".xxxxxx");
|
|
15
26
|
}
|
|
16
|
-
|
|
27
|
+
function generateTokenWithExpirationAsString() {
|
|
17
28
|
var payload = {
|
|
18
29
|
username: 'verdaccio',
|
|
19
30
|
exp: 'I am not a number'
|
|
20
31
|
};
|
|
21
32
|
return "xxxxxx.".concat(encodeBase64(JSON.stringify(payload)), ".xxxxxx");
|
|
22
33
|
}
|
|
23
|
-
|
|
34
|
+
function generateInvalidToken() {
|
|
24
35
|
var payload = "invalidtoken";
|
|
25
36
|
return "xxxxxx.".concat(encodeBase64(payload), ".xxxxxx");
|
|
26
37
|
}
|
|
27
|
-
|
|
38
|
+
function generateTokenWithOutExpiration() {
|
|
28
39
|
var payload = {
|
|
29
40
|
username: 'verdaccio'
|
|
30
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-generate.js","names":["
|
|
1
|
+
{"version":3,"file":"token-generate.js","names":["_dayjs","_interopRequireDefault","require","e","__esModule","encodeBase64","string","Buffer","from","toString","generateTokenWithTimeRange","amount","arguments","length","undefined","payload","username","exp","Number","parseInt","String","dayjs","Date","add","valueOf","concat","JSON","stringify","generateTokenWithExpirationAsString","generateInvalidToken","generateTokenWithOutExpiration"],"sources":["../../src/utils/token-generate.ts"],"sourcesContent":["/**\n * Token Utility\n */\nimport dayjs from 'dayjs';\n\nfunction encodeBase64(string: string) {\n return Buffer.from(string).toString('base64');\n}\n\nexport function generateTokenWithTimeRange(amount = 0) {\n const payload = {\n username: 'verdaccio',\n exp: Number.parseInt(String(dayjs(new Date()).add(amount, 'hour').valueOf() / 1000), 10),\n };\n return `xxxxxx.${encodeBase64(JSON.stringify(payload))}.xxxxxx`;\n}\n\nexport function generateTokenWithExpirationAsString() {\n const payload = { username: 'verdaccio', exp: 'I am not a number' };\n return `xxxxxx.${encodeBase64(JSON.stringify(payload))}.xxxxxx`;\n}\n\nexport function generateInvalidToken() {\n const payload = `invalidtoken`;\n return `xxxxxx.${encodeBase64(payload)}.xxxxxx`;\n}\n\nexport function generateTokenWithOutExpiration() {\n const payload = {\n username: 'verdaccio',\n };\n return `xxxxxx.${encodeBase64(JSON.stringify(payload))}.xxxxxx`;\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAH1B;AACA;AACA;;AAGA,SAASE,YAAYA,CAACC,MAAc,EAAE;EACpC,OAAOC,MAAM,CAACC,IAAI,CAACF,MAAM,CAAC,CAACG,QAAQ,CAAC,QAAQ,CAAC;AAC/C;AAEO,SAASC,0BAA0BA,CAAA,EAAa;EAAA,IAAZC,MAAM,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC;EACnD,IAAMG,OAAO,GAAG;IACdC,QAAQ,EAAE,WAAW;IACrBC,GAAG,EAAEC,MAAM,CAACC,QAAQ,CAACC,MAAM,CAAC,IAAAC,iBAAK,EAAC,IAAIC,IAAI,CAAC,CAAC,CAAC,CAACC,GAAG,CAACZ,MAAM,EAAE,MAAM,CAAC,CAACa,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,EAAE;EACzF,CAAC;EACD,iBAAAC,MAAA,CAAiBpB,YAAY,CAACqB,IAAI,CAACC,SAAS,CAACZ,OAAO,CAAC,CAAC;AACxD;AAEO,SAASa,mCAAmCA,CAAA,EAAG;EACpD,IAAMb,OAAO,GAAG;IAAEC,QAAQ,EAAE,WAAW;IAAEC,GAAG,EAAE;EAAoB,CAAC;EACnE,iBAAAQ,MAAA,CAAiBpB,YAAY,CAACqB,IAAI,CAACC,SAAS,CAACZ,OAAO,CAAC,CAAC;AACxD;AAEO,SAASc,oBAAoBA,CAAA,EAAG;EACrC,IAAMd,OAAO,iBAAiB;EAC9B,iBAAAU,MAAA,CAAiBpB,YAAY,CAACU,OAAO,CAAC;AACxC;AAEO,SAASe,8BAA8BA,CAAA,EAAG;EAC/C,IAAMf,OAAO,GAAG;IACdC,QAAQ,EAAE;EACZ,CAAC;EACD,iBAAAS,MAAA,CAAiBpB,YAAY,CAACqB,IAAI,CAACC,SAAS,CAACZ,OAAO,CAAC,CAAC;AACxD","ignoreList":[]}
|
package/build/utils/token.js
CHANGED
|
@@ -1,23 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isTokenExpire = isTokenExpire;
|
|
7
|
+
var _jsBase = require("js-base64");
|
|
8
|
+
var _isNumber = _interopRequireDefault(require("lodash/isNumber"));
|
|
9
|
+
var _isString = _interopRequireDefault(require("lodash/isString"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
12
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
14
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
15
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
16
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
17
|
+
function isTokenExpire(token) {
|
|
18
|
+
if (!(0, _isString["default"])(token)) {
|
|
6
19
|
return true;
|
|
7
20
|
}
|
|
8
|
-
var
|
|
21
|
+
var _token$split = token.split('.'),
|
|
22
|
+
_token$split2 = _slicedToArray(_token$split, 2),
|
|
23
|
+
payload = _token$split2[1];
|
|
9
24
|
if (!payload) {
|
|
10
25
|
return true;
|
|
11
26
|
}
|
|
12
27
|
var exp;
|
|
13
28
|
try {
|
|
14
|
-
exp = JSON.parse(Base64.decode(payload)).exp;
|
|
29
|
+
exp = JSON.parse(_jsBase.Base64.decode(payload)).exp;
|
|
15
30
|
} catch (error) {
|
|
16
|
-
// eslint-disable-next-line no-console
|
|
17
31
|
console.error('Invalid token:', error, token);
|
|
18
32
|
return true;
|
|
19
33
|
}
|
|
20
|
-
if (!exp || !
|
|
34
|
+
if (!exp || !(0, _isNumber["default"])(exp)) {
|
|
21
35
|
return true;
|
|
22
36
|
}
|
|
23
37
|
// Report as expire before (real expire time - 30s)
|
package/build/utils/token.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.js","names":["
|
|
1
|
+
{"version":3,"file":"token.js","names":["_jsBase","require","_isNumber","_interopRequireDefault","_isString","e","__esModule","_slicedToArray","r","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","a","_arrayLikeToArray","t","toString","call","slice","constructor","name","Array","from","test","length","n","l","Symbol","iterator","i","u","f","o","next","Object","done","push","value","isArray","isTokenExpire","token","isString","_token$split","split","_token$split2","payload","exp","JSON","parse","Base64","decode","error","console","isNumber","jsTimestamp","expired","Date","now"],"sources":["../../src/utils/token.ts"],"sourcesContent":["import { Base64 } from 'js-base64';\nimport isNumber from 'lodash/isNumber';\nimport isString from 'lodash/isString';\n\nexport function isTokenExpire(token: string | null): boolean {\n if (!isString(token)) {\n return true;\n }\n\n const [, payload] = token.split('.');\n\n if (!payload) {\n return true;\n }\n\n let exp: number;\n try {\n exp = JSON.parse(Base64.decode(payload)).exp;\n } catch (error: unknown) {\n console.error('Invalid token:', error, token);\n return true;\n }\n\n if (!exp || !isNumber(exp)) {\n return true;\n }\n // Report as expire before (real expire time - 30s)\n const jsTimestamp = exp * 1000 - 30000;\n const expired = Date.now() >= jsTimestamp;\n\n return expired;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAD,sBAAA,CAAAF,OAAA;AAAuC,SAAAE,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAAA,SAAAE,eAAAC,CAAA,EAAAH,CAAA,WAAAI,eAAA,CAAAD,CAAA,KAAAE,qBAAA,CAAAF,CAAA,EAAAH,CAAA,KAAAM,2BAAA,CAAAH,CAAA,EAAAH,CAAA,KAAAO,gBAAA;AAAA,SAAAA,iBAAA,cAAAC,SAAA;AAAA,SAAAF,4BAAAH,CAAA,EAAAM,CAAA,QAAAN,CAAA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|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.downloadFile = downloadFile;
|
|
7
|
+
exports.extractFileName = extractFileName;
|
|
8
|
+
exports.isEmail = isEmail;
|
|
9
|
+
exports.isURL = isURL;
|
|
10
|
+
var _isEmail = _interopRequireDefault(require("validator/lib/isEmail"));
|
|
11
|
+
var _isURL = _interopRequireDefault(require("validator/lib/isURL"));
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
13
|
+
function isURL(url) {
|
|
14
|
+
return (0, _isURL["default"])(url || '', {
|
|
5
15
|
protocols: ['http', 'https', 'git+https', 'git'],
|
|
6
16
|
require_protocol: true,
|
|
7
17
|
require_tld: false
|
|
8
18
|
});
|
|
9
19
|
}
|
|
10
|
-
|
|
11
|
-
return
|
|
20
|
+
function isEmail(email) {
|
|
21
|
+
return (0, _isEmail["default"])(email || '');
|
|
12
22
|
}
|
|
13
|
-
|
|
23
|
+
function extractFileName(url) {
|
|
14
24
|
return url.substring(url.lastIndexOf('/') + 1);
|
|
15
25
|
}
|
|
16
26
|
|
|
@@ -26,7 +36,7 @@ function blobToFile(blob, fileName) {
|
|
|
26
36
|
// Use Object.assign to copy properties while maintaining the Blob prototype
|
|
27
37
|
return Object.assign(blob, fileProperties);
|
|
28
38
|
}
|
|
29
|
-
|
|
39
|
+
function downloadFile(fileStream, fileName) {
|
|
30
40
|
var file;
|
|
31
41
|
// File constructor is not supported by Edge
|
|
32
42
|
// https://developer.mozilla.org/en-US/docs/Web/API/File#Browser_compatibility
|
|
@@ -56,13 +66,13 @@ export function downloadFile(fileStream, fileName) {
|
|
|
56
66
|
document.documentElement.appendChild(fileLink);
|
|
57
67
|
fileLink.click();
|
|
58
68
|
// firefox requires remove the object url
|
|
59
|
-
setTimeout(()
|
|
69
|
+
setTimeout(function () {
|
|
60
70
|
URL.revokeObjectURL(objectURL);
|
|
61
71
|
document.documentElement.removeChild(fileLink);
|
|
62
72
|
}, 150);
|
|
63
73
|
} else {
|
|
64
74
|
// In test environment, just clean up without triggering navigation
|
|
65
|
-
setTimeout(()
|
|
75
|
+
setTimeout(function () {
|
|
66
76
|
URL.revokeObjectURL(objectURL);
|
|
67
77
|
}, 150);
|
|
68
78
|
}
|
package/build/utils/url.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.js","names":["
|
|
1
|
+
{"version":3,"file":"url.js","names":["_isEmail","_interopRequireDefault","require","_isURL","e","__esModule","isURL","url","isURLValidator","protocols","require_protocol","require_tld","isEmail","email","isEmailValidator","extractFileName","substring","lastIndexOf","blobToFile","blob","fileName","fileProperties","lastModified","Date","now","name","Object","assign","downloadFile","fileStream","file","nav","navigator","msSaveBlob","Blob","type","File","objectURL","URL","createObjectURL","fileLink","document","createElement","href","download","isTestEnvironment","window","userAgent","includes","documentElement","appendChild","click","setTimeout","revokeObjectURL","removeChild"],"sources":["../../src/utils/url.ts"],"sourcesContent":["import isEmailValidator from 'validator/lib/isEmail';\nimport isURLValidator from 'validator/lib/isURL';\n\nexport function isURL(url: string): boolean {\n return isURLValidator(url || '', {\n protocols: ['http', 'https', 'git+https', 'git'],\n require_protocol: true,\n require_tld: false,\n });\n}\n\nexport function isEmail(email: string): boolean {\n return isEmailValidator(email || '');\n}\n\nexport function extractFileName(url: string): string {\n return url.substring(url.lastIndexOf('/') + 1);\n}\n\n// Legacy Edge support for file downloads\ninterface NavigatorWithMSSaveBlob extends Navigator {\n msSaveBlob?: (blob: Blob, fileName: string) => boolean;\n}\n\nfunction blobToFile(blob: Blob, fileName: string): File {\n // Create a proper File object by extending the Blob with File properties\n const fileProperties = {\n lastModified: Date.now(),\n name: fileName,\n };\n\n // Use Object.assign to copy properties while maintaining the Blob prototype\n return Object.assign(blob, fileProperties) as File;\n}\n\nexport function downloadFile(fileStream: Blob, fileName: string): void {\n let file: File;\n // File constructor is not supported by Edge\n // https://developer.mozilla.org/en-US/docs/Web/API/File#Browser_compatibility\n const nav = navigator as NavigatorWithMSSaveBlob;\n if (nav.msSaveBlob) {\n // Detect if Edge\n file = blobToFile(new Blob([fileStream], { type: 'application/octet-stream' }), fileName);\n } else {\n file = new File([fileStream], fileName, {\n type: 'application/octet-stream',\n lastModified: Date.now(),\n });\n }\n\n const objectURL = URL.createObjectURL(file);\n const fileLink = document.createElement('a');\n fileLink.href = objectURL;\n fileLink.download = fileName;\n\n // Skip actual download in test environment to avoid JSDOM navigation error\n // Check if we're in a test environment (JSDOM)\n const isTestEnvironment =\n (typeof window !== 'undefined' &&\n window.navigator &&\n window.navigator.userAgent &&\n window.navigator.userAgent.includes('Node.js')) ||\n window.navigator.userAgent.includes('jsdom');\n\n if (!isTestEnvironment) {\n // Without appending to an HTML Element, download dialog does not show up on Firefox\n // https://github.com/verdaccio/ui/issues/119\n document.documentElement.appendChild(fileLink);\n fileLink.click();\n // firefox requires remove the object url\n setTimeout(() => {\n URL.revokeObjectURL(objectURL);\n document.documentElement.removeChild(fileLink);\n }, 150);\n } else {\n // In test environment, just clean up without triggering navigation\n setTimeout(() => {\n URL.revokeObjectURL(objectURL);\n }, 150);\n }\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAiD,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAE1C,SAASE,KAAKA,CAACC,GAAW,EAAW;EAC1C,OAAO,IAAAC,iBAAc,EAACD,GAAG,IAAI,EAAE,EAAE;IAC/BE,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,CAAC;IAChDC,gBAAgB,EAAE,IAAI;IACtBC,WAAW,EAAE;EACf,CAAC,CAAC;AACJ;A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,KAAK,WAAW,IAC5BA,MAAM,CAACd,SAAS,IAChBc,MAAM,CAACd,SAAS,CAACe,SAAS,IAC1BD,MAAM,CAACd,SAAS,CAACe,SAAS,CAACC,QAAQ,CAAC,SAAS,CAAC,IAChDF,MAAM,CAACd,SAAS,CAACe,SAAS,CAACC,QAAQ,CAAC,OAAO,CAAC;EAE9C,IAAI,CAACH,iBAAiB,EAAE;IACtB;IACA;IACAJ,QAAQ,CAACQ,eAAe,CAACC,WAAW,CAACV,QAAQ,CAAC;IAC9CA,QAAQ,CAACW,KAAK,CAAC,CAAC;IAChB;IACAC,UAAU,CAAC,YAAM;MACfd,GAAG,CAACe,eAAe,CAAChB,SAAS,CAAC;MAC9BI,QAAQ,CAACQ,eAAe,CAACK,WAAW,CAACd,QAAQ,CAAC;IAChD,CAAC,EAAE,GAAG,CAAC;EACT,CAAC,MAAM;IACL;IACAY,UAAU,CAAC,YAAM;MACfd,GAAG,CAACe,eAAe,CAAChB,SAAS,CAAC;IAChC,CAAC,EAAE,GAAG,CAAC;EACT;AACF","ignoreList":[]}
|
package/build/utils/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UpLinks } from '@verdaccio/types';
|
|
2
|
-
import { Time } from '../types/packageMeta';
|
|
1
|
+
import type { UpLinks } from '@verdaccio/types';
|
|
2
|
+
import type { Time } from '../types/packageMeta';
|
|
3
3
|
export declare const TIMEFORMAT = "L LTS";
|
|
4
4
|
/**
|
|
5
5
|
* Formats license field for webui.
|
package/build/utils/utils.js
CHANGED
|
@@ -1,21 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TIMEFORMAT = void 0;
|
|
7
|
+
exports.fileSizeSI = fileSizeSI;
|
|
8
|
+
exports.formatDate = formatDate;
|
|
9
|
+
exports.formatDateDistance = formatDateDistance;
|
|
10
|
+
exports.formatLicense = formatLicense;
|
|
11
|
+
exports.formatRepository = formatRepository;
|
|
12
|
+
exports.getAuthorName = getAuthorName;
|
|
13
|
+
exports.getLastUpdatedPackageTime = getLastUpdatedPackageTime;
|
|
14
|
+
exports.getRecentReleases = getRecentReleases;
|
|
15
|
+
exports.getUplink = getUplink;
|
|
16
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
17
|
+
var _localizedFormat = _interopRequireDefault(require("dayjs/plugin/localizedFormat"));
|
|
18
|
+
var _relativeTime = _interopRequireDefault(require("dayjs/plugin/relativeTime"));
|
|
19
|
+
var _i18next = _interopRequireDefault(require("i18next"));
|
|
20
|
+
var _isString = _interopRequireDefault(require("lodash/isString"));
|
|
21
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
22
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
23
|
+
var TIMEFORMAT = exports.TIMEFORMAT = 'L LTS';
|
|
24
|
+
_dayjs["default"].extend(_relativeTime["default"]);
|
|
25
|
+
_dayjs["default"].extend(_localizedFormat["default"]);
|
|
9
26
|
|
|
10
27
|
/**
|
|
11
28
|
* Formats license field for webui.
|
|
12
29
|
* @see https://docs.npmjs.com/files/package.json#license
|
|
13
30
|
*/
|
|
14
|
-
|
|
15
|
-
if (
|
|
31
|
+
function formatLicense(license) {
|
|
32
|
+
if ((0, _isString["default"])(license)) {
|
|
16
33
|
return license;
|
|
17
34
|
}
|
|
18
|
-
if (license &&
|
|
35
|
+
if (license && _typeof(license) === 'object' && 'type' in license && typeof license.type === 'string') {
|
|
19
36
|
return license.type;
|
|
20
37
|
}
|
|
21
38
|
return undefined;
|
|
@@ -24,27 +41,27 @@ export function formatLicense(license) {
|
|
|
24
41
|
* Formats repository field for webui.
|
|
25
42
|
* @see https://docs.npmjs.com/files/package.json#repository
|
|
26
43
|
*/
|
|
27
|
-
|
|
28
|
-
if (
|
|
44
|
+
function formatRepository(repository) {
|
|
45
|
+
if ((0, _isString["default"])(repository)) {
|
|
29
46
|
return repository;
|
|
30
47
|
}
|
|
31
|
-
if (repository &&
|
|
48
|
+
if (repository && _typeof(repository) === 'object' && 'url' in repository && typeof repository.url === 'string') {
|
|
32
49
|
return repository.url;
|
|
33
50
|
}
|
|
34
51
|
return null;
|
|
35
52
|
}
|
|
36
|
-
|
|
37
|
-
return
|
|
53
|
+
function formatDate(lastUpdate) {
|
|
54
|
+
return (0, _dayjs["default"])(new Date(lastUpdate)).format(TIMEFORMAT);
|
|
38
55
|
}
|
|
39
|
-
|
|
40
|
-
return
|
|
56
|
+
function formatDateDistance(lastUpdate) {
|
|
57
|
+
return (0, _dayjs["default"])(new Date(lastUpdate)).fromNow();
|
|
41
58
|
}
|
|
42
59
|
|
|
43
60
|
/**
|
|
44
61
|
* For <LastSync /> component
|
|
45
62
|
* @param {array} uplinks
|
|
46
63
|
*/
|
|
47
|
-
|
|
64
|
+
function getLastUpdatedPackageTime() {
|
|
48
65
|
var uplinks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
49
66
|
var lastUpdate = 0;
|
|
50
67
|
Object.keys(uplinks).forEach(function computeUplink(upLinkName) {
|
|
@@ -61,24 +78,26 @@ export function getLastUpdatedPackageTime() {
|
|
|
61
78
|
* @param {Object} time
|
|
62
79
|
* @returns {Array} last 3 releases
|
|
63
80
|
*/
|
|
64
|
-
|
|
81
|
+
function getRecentReleases() {
|
|
65
82
|
var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
66
|
-
var recent = Object.keys(time).map(version
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
83
|
+
var recent = Object.keys(time).map(function (version) {
|
|
84
|
+
return {
|
|
85
|
+
version: version,
|
|
86
|
+
time: formatDate(time[version])
|
|
87
|
+
};
|
|
88
|
+
});
|
|
70
89
|
return recent.slice(recent.length - 3, recent.length).reverse();
|
|
71
90
|
}
|
|
72
|
-
|
|
91
|
+
function getAuthorName(authorName) {
|
|
73
92
|
if (!authorName) {
|
|
74
|
-
return
|
|
93
|
+
return _i18next["default"].t('author-unknown');
|
|
75
94
|
}
|
|
76
95
|
if (authorName.toLowerCase() === 'anonymous') {
|
|
77
|
-
return
|
|
96
|
+
return _i18next["default"].t('author-anonymous');
|
|
78
97
|
}
|
|
79
98
|
return authorName;
|
|
80
99
|
}
|
|
81
|
-
|
|
100
|
+
function getUplink(upLinkName, packageName) {
|
|
82
101
|
// TODO: make this a config like "uplinks: npmjs: web: https://www.npmjs.com/package/"
|
|
83
102
|
switch (upLinkName) {
|
|
84
103
|
case 'npmjs':
|
|
@@ -86,7 +105,7 @@ export function getUplink(upLinkName, packageName) {
|
|
|
86
105
|
}
|
|
87
106
|
return null;
|
|
88
107
|
}
|
|
89
|
-
|
|
108
|
+
function fileSizeSI(a, b, c, d, e) {
|
|
90
109
|
b = Math;
|
|
91
110
|
c = b.log;
|
|
92
111
|
d = 1e3;
|