@scm-manager/ui-api 3.7.4-20250212-104414 → 3.7.4
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/build/index.d.ts +1 -15
- package/build/index.js +116 -144
- package/build/index.mjs +46 -73
- package/package.json +2 -2
package/build/index.d.ts
CHANGED
|
@@ -422,20 +422,6 @@ declare const changesetQueryKey: (repository: NamespaceAndName, id: string) => u
|
|
|
422
422
|
declare const useChangesets: (repository: Repository, request?: UseChangesetsRequest) => ApiResultWithFetching<ChangesetCollection>;
|
|
423
423
|
declare const useChangeset: (repository: Repository, id: string) => ApiResult<Changeset>;
|
|
424
424
|
|
|
425
|
-
declare type RevertRequest = {
|
|
426
|
-
branch: string;
|
|
427
|
-
message: string;
|
|
428
|
-
};
|
|
429
|
-
declare type RevertResponse = {
|
|
430
|
-
revision: string;
|
|
431
|
-
};
|
|
432
|
-
declare const useRevert: (changeset: Changeset) => {
|
|
433
|
-
revert: react_query.UseMutateFunction<RevertResponse, Error, RevertRequest, unknown>;
|
|
434
|
-
isLoading: boolean;
|
|
435
|
-
error: Error | null;
|
|
436
|
-
revision: RevertResponse | undefined;
|
|
437
|
-
};
|
|
438
|
-
|
|
439
425
|
declare const useTags: (repository: Repository) => ApiResult<TagCollection>;
|
|
440
426
|
declare const useContainedInTags: (changeset: Changeset, repository: Repository) => ApiResult<TagCollection>;
|
|
441
427
|
declare const useTag: (repository: Repository, name: string) => ApiResult<Tag>;
|
|
@@ -825,4 +811,4 @@ declare const RepositoryRevisionContextProvider: FC<{
|
|
|
825
811
|
revision?: string;
|
|
826
812
|
}>;
|
|
827
813
|
|
|
828
|
-
export { AdditionalMessage, ApiProvider, Props as ApiProviderProps, ApiResult, ApiResultWithFetching, BackendError, BackendErrorContent, BadGatewayError, BaseContext, CONTENT_TYPE_PUBLIC_KEY, CancelablePromise, ConflictError, ConvertToInternalRequest, DeleteFunction, ForbiddenError, LegacyContext, LegacyContextProvider, MissingLinkError, NamespaceAndNameContext, NamespaceAndNameContextProvider, NotFoundError, RepositoryContextProvider, RepositoryRevisionContextProvider,
|
|
814
|
+
export { AdditionalMessage, ApiProvider, Props as ApiProviderProps, ApiResult, ApiResultWithFetching, BackendError, BackendErrorContent, BadGatewayError, BaseContext, CONTENT_TYPE_PUBLIC_KEY, CancelablePromise, ConflictError, ConvertToInternalRequest, DeleteFunction, ForbiddenError, LegacyContext, LegacyContextProvider, MissingLinkError, NamespaceAndNameContext, NamespaceAndNameContextProvider, NotFoundError, RepositoryContextProvider, RepositoryRevisionContextProvider, SearchOptions, TOKEN_EXPIRED_ERROR_CODE, TokenExpiredError, UnauthorizedError, UseAvailablePluginsOptions, UseDeleteRepositoryOptions, UseGroupsRequest, UseHistoryRequest, UseInstalledPluginsOptions, UseRepositoriesRequest, UseRepositoryRolesRequest, UseSourcesOptions, UseUsersRequest, Violation, apiClient, changesetQueryKey, clearCache, createBackendError, createChangesetUrl, createDiffUrl, createQueryString, createUrl, createUrlWithIdentifiers, extractXsrfTokenFromCookie, fetchResourceFromLocationHeader, getResponseJson, isBackendError, makeCancelable, objectLink, requiredLink, urls, useAlerts, useAnnotations, useApiKeys, useArchiveRepository, useAvailableGlobalPermissions, useAvailablePermissions, useAvailablePlugins, useBranch, useBranchDetails, useBranchDetailsCollection, useBranches, useCancelPendingPlugins, useCancellablePromise, useChangeUserPassword, useChangeset, useChangesets, useClearNotifications, useConfig, useConfigLink, useContainedInTags, useContentType, useConvertToExternal, useConvertToInternal, useCreateApiKey, useCreateBranch, useCreateGroup, useCreatePermission, useCreatePublicKey, useCreateRepository, useCreateRepositoryRole, useCreateTag, useCreateUser, useDefaultBranch, useDeleteApiKey, useDeleteBranch, useDeleteGroup, useDeletePermission, useDeletePublicKey, useDeleteRepository, useDeleteRepositoryRole, useDeleteTag, useDeleteUser, useDiff, useDismissNotification, useExecutePendingPlugins, useExportInfo, useExportRepository, useFileContent, useGroup, useGroupOptions, useGroupPermissions, useGroupSuggestions, useGroups, useHistory, useImportFullRepository, useImportLog, useImportRepositoryFromBundle, useImportRepositoryFromUrl, useIncomingChangesets, useIndex, useIndexJsonResource, useIndexLink, useIndexLinks, useInstallPlugin, useInstalledPlugins, useInvalidateAllCaches, useInvalidateSearchIndices, useJsonResource, useLegacyContext, useLocalStorage, useLogin, useLoginInfo, useLogout, useMe, useNamespace, useNamespaceAndNameContext, useNamespaceOptions, useNamespaceStrategies, useNamespaceSuggestions, useNamespaces, useNotificationSubscription, useNotifications, useOmniSearch, usePaths, usePendingPlugins, usePermissions, usePluginCenterAuthInfo, usePluginCenterLogout, usePublicKeys, useReindexRepository, useRenameRepository, useRepositories, useRepository, useRepositoryContext, useRepositoryRevisionContext, useRepositoryRole, useRepositoryRoles, useRepositoryTypes, useRepositoryVerbs, useRequiredIndexLink, useRequiredMe, useRunHealthCheck, useSearch, useSearchCounts, useSearchHelpContent, useSearchSyntaxContent, useSearchTypes, useSearchableTypes, useSetGroupPermissions, useSetUserPassword, useSetUserPermissions, useSources, useSubject, useSuggestions, useTag, useTags, useUnarchiveRepository, useUninstallPlugin, useUpdateConfig, useUpdateGroup, useUpdateInfo, useUpdatePermission, useUpdatePlugins, useUpdateRepository, useUpdateRepositoryRole, useUpdateUser, useUser, useUserOptions, useUserPermissionOverview, useUserPermissions, useUserSuggestions, useUsers, useVersion, waitForRestartAfter };
|
package/build/index.js
CHANGED
|
@@ -159,7 +159,6 @@ __export(src_exports, {
|
|
|
159
159
|
useRepositoryVerbs: () => useRepositoryVerbs,
|
|
160
160
|
useRequiredIndexLink: () => useRequiredIndexLink,
|
|
161
161
|
useRequiredMe: () => useRequiredMe,
|
|
162
|
-
useRevert: () => useRevert,
|
|
163
162
|
useRunHealthCheck: () => useRunHealthCheck,
|
|
164
163
|
useSearch: () => useSearch,
|
|
165
164
|
useSearchCounts: () => useSearchCounts,
|
|
@@ -1702,39 +1701,21 @@ var useChangeset = (repository, id) => {
|
|
|
1702
1701
|
);
|
|
1703
1702
|
};
|
|
1704
1703
|
|
|
1705
|
-
// src/revert.ts
|
|
1706
|
-
var import_react_query11 = require("react-query");
|
|
1707
|
-
var useRevert = (changeset) => {
|
|
1708
|
-
const link = requiredLink(changeset, "revert");
|
|
1709
|
-
const { isLoading, error, mutate, data } = (0, import_react_query11.useMutation)({
|
|
1710
|
-
mutationFn: async (request) => {
|
|
1711
|
-
const response = await apiClient.post(link, request, "application/vnd.scmm-revert+json;v=2");
|
|
1712
|
-
return await response.json();
|
|
1713
|
-
}
|
|
1714
|
-
});
|
|
1715
|
-
return {
|
|
1716
|
-
revert: mutate,
|
|
1717
|
-
isLoading,
|
|
1718
|
-
error,
|
|
1719
|
-
revision: data
|
|
1720
|
-
};
|
|
1721
|
-
};
|
|
1722
|
-
|
|
1723
1704
|
// src/tags.ts
|
|
1724
|
-
var
|
|
1705
|
+
var import_react_query11 = require("react-query");
|
|
1725
1706
|
var tagQueryKey = (repository, tag) => {
|
|
1726
1707
|
return repoQueryKey(repository, "tag", tag);
|
|
1727
1708
|
};
|
|
1728
1709
|
var useTags = (repository) => {
|
|
1729
1710
|
const link = requiredLink(repository, "tags");
|
|
1730
|
-
return (0,
|
|
1711
|
+
return (0, import_react_query11.useQuery)(
|
|
1731
1712
|
repoQueryKey(repository, "tags"),
|
|
1732
1713
|
() => apiClient.get(link).then((response) => response.json())
|
|
1733
1714
|
);
|
|
1734
1715
|
};
|
|
1735
1716
|
var useContainedInTags = (changeset, repository) => {
|
|
1736
1717
|
const link = objectLink(changeset, "containedInTags");
|
|
1737
|
-
return (0,
|
|
1718
|
+
return (0, import_react_query11.useQuery)(repoQueryKey(repository, "tags", changeset.id), () => {
|
|
1738
1719
|
if (link === null) {
|
|
1739
1720
|
return {
|
|
1740
1721
|
_embedded: {
|
|
@@ -1748,7 +1729,7 @@ var useContainedInTags = (changeset, repository) => {
|
|
|
1748
1729
|
};
|
|
1749
1730
|
var useTag = (repository, name) => {
|
|
1750
1731
|
const link = requiredLink(repository, "tags");
|
|
1751
|
-
return (0,
|
|
1732
|
+
return (0, import_react_query11.useQuery)(
|
|
1752
1733
|
tagQueryKey(repository, name),
|
|
1753
1734
|
() => apiClient.get(concat(link, name)).then((response) => response.json())
|
|
1754
1735
|
);
|
|
@@ -1779,9 +1760,9 @@ var createTag = (changeset, link) => {
|
|
|
1779
1760
|
};
|
|
1780
1761
|
};
|
|
1781
1762
|
var useCreateTag = (repository, changeset) => {
|
|
1782
|
-
const queryClient2 = (0,
|
|
1763
|
+
const queryClient2 = (0, import_react_query11.useQueryClient)();
|
|
1783
1764
|
const link = requiredLink(changeset, "tag");
|
|
1784
|
-
const { isLoading, error, mutate, data } = (0,
|
|
1765
|
+
const { isLoading, error, mutate, data } = (0, import_react_query11.useMutation)(createTag(changeset, link), {
|
|
1785
1766
|
onSuccess: async (tag) => {
|
|
1786
1767
|
queryClient2.setQueryData(tagQueryKey(repository, tag.name), tag);
|
|
1787
1768
|
await queryClient2.invalidateQueries(tagQueryKey(repository, tag.name));
|
|
@@ -1796,8 +1777,8 @@ var useCreateTag = (repository, changeset) => {
|
|
|
1796
1777
|
};
|
|
1797
1778
|
};
|
|
1798
1779
|
var useDeleteTag = (repository) => {
|
|
1799
|
-
const queryClient2 = (0,
|
|
1800
|
-
const { mutate, isLoading, error, data } = (0,
|
|
1780
|
+
const queryClient2 = (0, import_react_query11.useQueryClient)();
|
|
1781
|
+
const { mutate, isLoading, error, data } = (0, import_react_query11.useMutation)(
|
|
1801
1782
|
(tag) => {
|
|
1802
1783
|
const deleteUrl = tag._links.delete.href;
|
|
1803
1784
|
return apiClient.delete(deleteUrl);
|
|
@@ -1818,16 +1799,16 @@ var useDeleteTag = (repository) => {
|
|
|
1818
1799
|
};
|
|
1819
1800
|
|
|
1820
1801
|
// src/config.ts
|
|
1821
|
-
var
|
|
1802
|
+
var import_react_query12 = require("react-query");
|
|
1822
1803
|
var useConfig = () => {
|
|
1823
1804
|
const indexLink = useIndexLink("config");
|
|
1824
|
-
return (0,
|
|
1805
|
+
return (0, import_react_query12.useQuery)("config", () => apiClient.get(indexLink).then((response) => response.json()), {
|
|
1825
1806
|
enabled: !!indexLink
|
|
1826
1807
|
});
|
|
1827
1808
|
};
|
|
1828
1809
|
var useUpdateConfig = () => {
|
|
1829
|
-
const queryClient2 = (0,
|
|
1830
|
-
const { mutate, isLoading, error, data, reset: reset2 } = (0,
|
|
1810
|
+
const queryClient2 = (0, import_react_query12.useQueryClient)();
|
|
1811
|
+
const { mutate, isLoading, error, data, reset: reset2 } = (0, import_react_query12.useMutation)(
|
|
1831
1812
|
(config) => {
|
|
1832
1813
|
const updateUrl = requiredLink(config, "update");
|
|
1833
1814
|
return apiClient.put(updateUrl, config, "application/vnd.scmm-config+json;v=2");
|
|
@@ -1850,10 +1831,10 @@ var useUpdateConfig = () => {
|
|
|
1850
1831
|
};
|
|
1851
1832
|
|
|
1852
1833
|
// src/admin.ts
|
|
1853
|
-
var
|
|
1834
|
+
var import_react_query13 = require("react-query");
|
|
1854
1835
|
var useUpdateInfo = () => {
|
|
1855
1836
|
const indexLink = useIndexLink("updateInfo");
|
|
1856
|
-
return (0,
|
|
1837
|
+
return (0, import_react_query13.useQuery)(
|
|
1857
1838
|
"updateInfo",
|
|
1858
1839
|
() => {
|
|
1859
1840
|
if (!indexLink) {
|
|
@@ -1866,7 +1847,7 @@ var useUpdateInfo = () => {
|
|
|
1866
1847
|
};
|
|
1867
1848
|
|
|
1868
1849
|
// src/plugins.ts
|
|
1869
|
-
var
|
|
1850
|
+
var import_react_query14 = require("react-query");
|
|
1870
1851
|
var isPluginCollection = (input) => input._embedded ? "plugins" in input._embedded : false;
|
|
1871
1852
|
var waitForRestartAfter = (promise, { initialDelay = 1e3, timeout = 500 } = {}) => {
|
|
1872
1853
|
const endTime = Number(new Date()) + 4 * 60 * 1e3;
|
|
@@ -1894,7 +1875,7 @@ var waitForRestartAfter = (promise, { initialDelay = 1e3, timeout = 500 } = {})
|
|
|
1894
1875
|
};
|
|
1895
1876
|
var useAvailablePlugins = ({ enabled } = {}) => {
|
|
1896
1877
|
const indexLink = useRequiredIndexLink("availablePlugins");
|
|
1897
|
-
return (0,
|
|
1878
|
+
return (0, import_react_query14.useQuery)(
|
|
1898
1879
|
["plugins", "available"],
|
|
1899
1880
|
() => apiClient.get(indexLink).then((response) => response.json()),
|
|
1900
1881
|
{
|
|
@@ -1905,7 +1886,7 @@ var useAvailablePlugins = ({ enabled } = {}) => {
|
|
|
1905
1886
|
};
|
|
1906
1887
|
var useInstalledPlugins = ({ enabled } = {}) => {
|
|
1907
1888
|
const indexLink = useRequiredIndexLink("installedPlugins");
|
|
1908
|
-
return (0,
|
|
1889
|
+
return (0, import_react_query14.useQuery)(
|
|
1909
1890
|
["plugins", "installed"],
|
|
1910
1891
|
() => apiClient.get(indexLink).then((response) => response.json()),
|
|
1911
1892
|
{
|
|
@@ -1916,7 +1897,7 @@ var useInstalledPlugins = ({ enabled } = {}) => {
|
|
|
1916
1897
|
};
|
|
1917
1898
|
var usePendingPlugins = () => {
|
|
1918
1899
|
const indexLink = useIndexLink("pendingPlugins");
|
|
1919
|
-
return (0,
|
|
1900
|
+
return (0, import_react_query14.useQuery)(
|
|
1920
1901
|
["plugins", "pending"],
|
|
1921
1902
|
() => apiClient.get(indexLink).then((response) => response.json()),
|
|
1922
1903
|
{
|
|
@@ -1932,8 +1913,8 @@ var linkWithRestart = (link, restart) => {
|
|
|
1932
1913
|
return link;
|
|
1933
1914
|
};
|
|
1934
1915
|
var useInstallPlugin = () => {
|
|
1935
|
-
const queryClient2 = (0,
|
|
1936
|
-
const { mutate, isLoading, error, data } = (0,
|
|
1916
|
+
const queryClient2 = (0, import_react_query14.useQueryClient)();
|
|
1917
|
+
const { mutate, isLoading, error, data } = (0, import_react_query14.useMutation)(
|
|
1937
1918
|
({ plugin, restartOptions: { restart, ...waitForRestartOptions } }) => {
|
|
1938
1919
|
const promise = apiClient.post(requiredLink(plugin, linkWithRestart("install", restart)));
|
|
1939
1920
|
if (restart) {
|
|
@@ -1957,8 +1938,8 @@ var useInstallPlugin = () => {
|
|
|
1957
1938
|
};
|
|
1958
1939
|
};
|
|
1959
1940
|
var useUninstallPlugin = () => {
|
|
1960
|
-
const queryClient2 = (0,
|
|
1961
|
-
const { mutate, isLoading, error, data } = (0,
|
|
1941
|
+
const queryClient2 = (0, import_react_query14.useQueryClient)();
|
|
1942
|
+
const { mutate, isLoading, error, data } = (0, import_react_query14.useMutation)(
|
|
1962
1943
|
({ plugin, restartOptions: { restart, ...waitForRestartOptions } }) => {
|
|
1963
1944
|
const promise = apiClient.post(requiredLink(plugin, linkWithRestart("uninstall", restart)));
|
|
1964
1945
|
if (restart) {
|
|
@@ -1981,8 +1962,8 @@ var useUninstallPlugin = () => {
|
|
|
1981
1962
|
};
|
|
1982
1963
|
};
|
|
1983
1964
|
var useUpdatePlugins = () => {
|
|
1984
|
-
const queryClient2 = (0,
|
|
1985
|
-
const { mutate, isLoading, error, data } = (0,
|
|
1965
|
+
const queryClient2 = (0, import_react_query14.useQueryClient)();
|
|
1966
|
+
const { mutate, isLoading, error, data } = (0, import_react_query14.useMutation)(
|
|
1986
1967
|
({ plugins, restartOptions: { restart, ...waitForRestartOptions } }) => {
|
|
1987
1968
|
const isCollection = isPluginCollection(plugins);
|
|
1988
1969
|
const promise = apiClient.post(
|
|
@@ -2008,8 +1989,8 @@ var useUpdatePlugins = () => {
|
|
|
2008
1989
|
};
|
|
2009
1990
|
};
|
|
2010
1991
|
var useExecutePendingPlugins = () => {
|
|
2011
|
-
const queryClient2 = (0,
|
|
2012
|
-
const { mutate, isLoading, error, data } = (0,
|
|
1992
|
+
const queryClient2 = (0, import_react_query14.useQueryClient)();
|
|
1993
|
+
const { mutate, isLoading, error, data } = (0, import_react_query14.useMutation)(
|
|
2013
1994
|
({ pending, restartOptions }) => waitForRestartAfter(apiClient.post(requiredLink(pending, "execute")), restartOptions),
|
|
2014
1995
|
{
|
|
2015
1996
|
onSuccess: () => queryClient2.invalidateQueries("plugins")
|
|
@@ -2023,8 +2004,8 @@ var useExecutePendingPlugins = () => {
|
|
|
2023
2004
|
};
|
|
2024
2005
|
};
|
|
2025
2006
|
var useCancelPendingPlugins = () => {
|
|
2026
|
-
const queryClient2 = (0,
|
|
2027
|
-
const { mutate, isLoading, error, data } = (0,
|
|
2007
|
+
const queryClient2 = (0, import_react_query14.useQueryClient)();
|
|
2008
|
+
const { mutate, isLoading, error, data } = (0, import_react_query14.useMutation)(
|
|
2028
2009
|
(pending) => apiClient.post(requiredLink(pending, "cancel")),
|
|
2029
2010
|
{
|
|
2030
2011
|
onSuccess: () => queryClient2.invalidateQueries("plugins")
|
|
@@ -2039,15 +2020,15 @@ var useCancelPendingPlugins = () => {
|
|
|
2039
2020
|
};
|
|
2040
2021
|
|
|
2041
2022
|
// src/repository-roles.ts
|
|
2042
|
-
var
|
|
2023
|
+
var import_react_query15 = require("react-query");
|
|
2043
2024
|
var useRepositoryRoles = (request) => {
|
|
2044
|
-
const queryClient2 = (0,
|
|
2025
|
+
const queryClient2 = (0, import_react_query15.useQueryClient)();
|
|
2045
2026
|
const indexLink = useRequiredIndexLink("repositoryRoles");
|
|
2046
2027
|
const queryParams = {};
|
|
2047
2028
|
if (request == null ? void 0 : request.page) {
|
|
2048
2029
|
queryParams.page = request.page.toString();
|
|
2049
2030
|
}
|
|
2050
|
-
return (0,
|
|
2031
|
+
return (0, import_react_query15.useQuery)(
|
|
2051
2032
|
["repositoryRoles", (request == null ? void 0 : request.page) || 0],
|
|
2052
2033
|
() => apiClient.get(`${indexLink}?${createQueryString(queryParams)}`).then((response) => response.json()),
|
|
2053
2034
|
{
|
|
@@ -2062,7 +2043,7 @@ var useRepositoryRoles = (request) => {
|
|
|
2062
2043
|
};
|
|
2063
2044
|
var useRepositoryRole = (name) => {
|
|
2064
2045
|
const indexLink = useRequiredIndexLink("repositoryRoles");
|
|
2065
|
-
return (0,
|
|
2046
|
+
return (0, import_react_query15.useQuery)(
|
|
2066
2047
|
["repositoryRole", name],
|
|
2067
2048
|
() => apiClient.get(concat(indexLink, name)).then((response) => response.json())
|
|
2068
2049
|
);
|
|
@@ -2079,9 +2060,9 @@ var createRepositoryRole = (link) => {
|
|
|
2079
2060
|
};
|
|
2080
2061
|
};
|
|
2081
2062
|
var useCreateRepositoryRole = () => {
|
|
2082
|
-
const queryClient2 = (0,
|
|
2063
|
+
const queryClient2 = (0, import_react_query15.useQueryClient)();
|
|
2083
2064
|
const link = useRequiredIndexLink("repositoryRoles");
|
|
2084
|
-
const { mutate, data, isLoading, error } = (0,
|
|
2065
|
+
const { mutate, data, isLoading, error } = (0, import_react_query15.useMutation)(
|
|
2085
2066
|
createRepositoryRole(link),
|
|
2086
2067
|
{
|
|
2087
2068
|
onSuccess: (repositoryRole) => {
|
|
@@ -2098,8 +2079,8 @@ var useCreateRepositoryRole = () => {
|
|
|
2098
2079
|
};
|
|
2099
2080
|
};
|
|
2100
2081
|
var useUpdateRepositoryRole = () => {
|
|
2101
|
-
const queryClient2 = (0,
|
|
2102
|
-
const { mutate, isLoading, error, data } = (0,
|
|
2082
|
+
const queryClient2 = (0, import_react_query15.useQueryClient)();
|
|
2083
|
+
const { mutate, isLoading, error, data } = (0, import_react_query15.useMutation)(
|
|
2103
2084
|
(repositoryRole) => {
|
|
2104
2085
|
const updateUrl = requiredLink(repositoryRole, "update");
|
|
2105
2086
|
return apiClient.put(updateUrl, repositoryRole, "application/vnd.scmm-repositoryRole+json;v=2");
|
|
@@ -2119,8 +2100,8 @@ var useUpdateRepositoryRole = () => {
|
|
|
2119
2100
|
};
|
|
2120
2101
|
};
|
|
2121
2102
|
var useDeleteRepositoryRole = () => {
|
|
2122
|
-
const queryClient2 = (0,
|
|
2123
|
-
const { mutate, isLoading, error, data } = (0,
|
|
2103
|
+
const queryClient2 = (0, import_react_query15.useQueryClient)();
|
|
2104
|
+
const { mutate, isLoading, error, data } = (0, import_react_query15.useMutation)(
|
|
2124
2105
|
(repositoryRole) => {
|
|
2125
2106
|
const deleteUrl = requiredLink(repositoryRole, "delete");
|
|
2126
2107
|
return apiClient.delete(deleteUrl);
|
|
@@ -2141,7 +2122,7 @@ var useDeleteRepositoryRole = () => {
|
|
|
2141
2122
|
};
|
|
2142
2123
|
|
|
2143
2124
|
// src/permissions.ts
|
|
2144
|
-
var
|
|
2125
|
+
var import_react_query16 = require("react-query");
|
|
2145
2126
|
var useRepositoryVerbs = () => {
|
|
2146
2127
|
return useIndexJsonResource("repositoryVerbs");
|
|
2147
2128
|
};
|
|
@@ -2175,7 +2156,7 @@ var createQueryKey = (namespaceOrRepository) => {
|
|
|
2175
2156
|
var usePermissions = (namespaceOrRepository) => {
|
|
2176
2157
|
const link = requiredLink(namespaceOrRepository, "permissions");
|
|
2177
2158
|
const queryKey = createQueryKey(namespaceOrRepository);
|
|
2178
|
-
return (0,
|
|
2159
|
+
return (0, import_react_query16.useQuery)(queryKey, () => apiClient.get(link).then((response) => response.json()));
|
|
2179
2160
|
};
|
|
2180
2161
|
var createPermission = (link) => {
|
|
2181
2162
|
return (permission) => {
|
|
@@ -2189,9 +2170,9 @@ var createPermission = (link) => {
|
|
|
2189
2170
|
};
|
|
2190
2171
|
};
|
|
2191
2172
|
var useCreatePermission = (namespaceOrRepository) => {
|
|
2192
|
-
const queryClient2 = (0,
|
|
2173
|
+
const queryClient2 = (0, import_react_query16.useQueryClient)();
|
|
2193
2174
|
const link = requiredLink(namespaceOrRepository, "permissions");
|
|
2194
|
-
const { isLoading, error, mutate, data } = (0,
|
|
2175
|
+
const { isLoading, error, mutate, data } = (0, import_react_query16.useMutation)(
|
|
2195
2176
|
createPermission(link),
|
|
2196
2177
|
{
|
|
2197
2178
|
onSuccess: () => {
|
|
@@ -2208,8 +2189,8 @@ var useCreatePermission = (namespaceOrRepository) => {
|
|
|
2208
2189
|
};
|
|
2209
2190
|
};
|
|
2210
2191
|
var useUpdatePermission = (namespaceOrRepository) => {
|
|
2211
|
-
const queryClient2 = (0,
|
|
2212
|
-
const { isLoading, error, mutate, data } = (0,
|
|
2192
|
+
const queryClient2 = (0, import_react_query16.useQueryClient)();
|
|
2193
|
+
const { isLoading, error, mutate, data } = (0, import_react_query16.useMutation)(
|
|
2213
2194
|
(permission) => {
|
|
2214
2195
|
const link = requiredLink(permission, "update");
|
|
2215
2196
|
return apiClient.put(link, permission, "application/vnd.scmm-repositoryPermission+json");
|
|
@@ -2229,8 +2210,8 @@ var useUpdatePermission = (namespaceOrRepository) => {
|
|
|
2229
2210
|
};
|
|
2230
2211
|
};
|
|
2231
2212
|
var useDeletePermission = (namespaceOrRepository) => {
|
|
2232
|
-
const queryClient2 = (0,
|
|
2233
|
-
const { isLoading, error, mutate, data } = (0,
|
|
2213
|
+
const queryClient2 = (0, import_react_query16.useQueryClient)();
|
|
2214
|
+
const { isLoading, error, mutate, data } = (0, import_react_query16.useMutation)(
|
|
2234
2215
|
(permission) => {
|
|
2235
2216
|
const link = requiredLink(permission, "delete");
|
|
2236
2217
|
return apiClient.delete(link);
|
|
@@ -2255,9 +2236,9 @@ var useGroupPermissions = (group) => useJsonResource(group, "permissions", group
|
|
|
2255
2236
|
var useUserPermissions = (user) => useJsonResource(user, "permissions", userPermissionsKey(user));
|
|
2256
2237
|
var useAvailableGlobalPermissions = () => useIndexJsonResource("permissions");
|
|
2257
2238
|
var useSetEntityPermissions = (permissionCollection, key) => {
|
|
2258
|
-
const queryClient2 = (0,
|
|
2239
|
+
const queryClient2 = (0, import_react_query16.useQueryClient)();
|
|
2259
2240
|
const url = permissionCollection ? objectLink(permissionCollection, "overwrite") : null;
|
|
2260
|
-
const { isLoading, error, mutate, data } = (0,
|
|
2241
|
+
const { isLoading, error, mutate, data } = (0, import_react_query16.useMutation)(
|
|
2261
2242
|
(permissions) => apiClient.put(
|
|
2262
2243
|
url,
|
|
2263
2244
|
{
|
|
@@ -2281,7 +2262,7 @@ var useSetUserPermissions = (user, permissions) => useSetEntityPermissions(permi
|
|
|
2281
2262
|
var useSetGroupPermissions = (group, permissions) => useSetEntityPermissions(permissions, groupPermissionsKey(group));
|
|
2282
2263
|
|
|
2283
2264
|
// src/sources.ts
|
|
2284
|
-
var
|
|
2265
|
+
var import_react_query17 = require("react-query");
|
|
2285
2266
|
var import_react6 = require("react");
|
|
2286
2267
|
var UseSourcesDefaultOptions = {
|
|
2287
2268
|
enabled: true,
|
|
@@ -2294,7 +2275,7 @@ var useSources = (repository, opts = UseSourcesDefaultOptions) => {
|
|
|
2294
2275
|
...opts
|
|
2295
2276
|
};
|
|
2296
2277
|
const link = createSourcesLink(repository, options);
|
|
2297
|
-
const { isLoading, error, data, isFetchingNextPage, fetchNextPage, refetch } = (0,
|
|
2278
|
+
const { isLoading, error, data, isFetchingNextPage, fetchNextPage, refetch } = (0, import_react_query17.useInfiniteQuery)(
|
|
2298
2279
|
repoQueryKey(repository, "sources", options.revision || "", options.path || "", options.collapse ? "collapse" : ""),
|
|
2299
2280
|
({ pageParam }) => {
|
|
2300
2281
|
return apiClient.get(pageParam || link).then((response) => response.json());
|
|
@@ -2380,14 +2361,14 @@ var isPartial = (file) => {
|
|
|
2380
2361
|
};
|
|
2381
2362
|
|
|
2382
2363
|
// src/import.ts
|
|
2383
|
-
var
|
|
2364
|
+
var import_react_query18 = require("react-query");
|
|
2384
2365
|
var useImportLog = (logId) => {
|
|
2385
2366
|
const link = useRequiredIndexLink("importLog").replace("{logId}", logId);
|
|
2386
|
-
return (0,
|
|
2367
|
+
return (0, import_react_query18.useQuery)(["importLog", logId], () => apiClient.get(link).then((response) => response.text()));
|
|
2387
2368
|
};
|
|
2388
2369
|
var useImportRepositoryFromUrl = (repositoryType) => {
|
|
2389
2370
|
const url = requiredLink(repositoryType, "import", "url");
|
|
2390
|
-
const { isLoading, error, data, mutate } = (0,
|
|
2371
|
+
const { isLoading, error, data, mutate } = (0, import_react_query18.useMutation)(
|
|
2391
2372
|
(repo) => apiClient.post(url, repo, "application/vnd.scmm-repository+json;v=2").then(fetchResourceFromLocationHeader).then(getResponseJson)
|
|
2392
2373
|
);
|
|
2393
2374
|
return {
|
|
@@ -2405,7 +2386,7 @@ var importRepository = (url, repository, file, password) => {
|
|
|
2405
2386
|
};
|
|
2406
2387
|
var useImportRepositoryFromBundle = (repositoryType) => {
|
|
2407
2388
|
const url = requiredLink(repositoryType, "import", "bundle");
|
|
2408
|
-
const { isLoading, error, data, mutate } = (0,
|
|
2389
|
+
const { isLoading, error, data, mutate } = (0, import_react_query18.useMutation)(
|
|
2409
2390
|
({ repository, file, compressed, password }) => importRepository(compressed ? url + "?compressed=true" : url, repository, file, password)
|
|
2410
2391
|
);
|
|
2411
2392
|
return {
|
|
@@ -2421,7 +2402,7 @@ var useImportRepositoryFromBundle = (repositoryType) => {
|
|
|
2421
2402
|
};
|
|
2422
2403
|
};
|
|
2423
2404
|
var useImportFullRepository = (repositoryType) => {
|
|
2424
|
-
const { isLoading, error, data, mutate } = (0,
|
|
2405
|
+
const { isLoading, error, data, mutate } = (0, import_react_query18.useMutation)(
|
|
2425
2406
|
({ repository, file, password }) => importRepository(requiredLink(repositoryType, "import", "fullImport"), repository, file, password)
|
|
2426
2407
|
);
|
|
2427
2408
|
return {
|
|
@@ -2438,7 +2419,7 @@ var useImportFullRepository = (repositoryType) => {
|
|
|
2438
2419
|
|
|
2439
2420
|
// src/diff.ts
|
|
2440
2421
|
var import_gitdiff_parser = __toESM(require("gitdiff-parser"));
|
|
2441
|
-
var
|
|
2422
|
+
var import_react_query19 = require("react-query");
|
|
2442
2423
|
var defaultOptions = {
|
|
2443
2424
|
refetchOnWindowFocus: true
|
|
2444
2425
|
};
|
|
@@ -2448,7 +2429,7 @@ var useDiff = (link, options = defaultOptions) => {
|
|
|
2448
2429
|
const separator = initialLink.includes("?") ? "&" : "?";
|
|
2449
2430
|
initialLink = `${initialLink}${separator}limit=${options.limit}&ignoreWhitespace=${options.ignoreWhitespace}`;
|
|
2450
2431
|
}
|
|
2451
|
-
const { isLoading, error, data, isFetchingNextPage, fetchNextPage } = (0,
|
|
2432
|
+
const { isLoading, error, data, isFetchingNextPage, fetchNextPage } = (0, import_react_query19.useInfiniteQuery)(
|
|
2452
2433
|
["link", link, options.ignoreWhitespace],
|
|
2453
2434
|
({ pageParam }) => {
|
|
2454
2435
|
return apiClient.get(pageParam || initialLink).then((response) => {
|
|
@@ -2496,13 +2477,13 @@ var merge2 = (diffs) => {
|
|
|
2496
2477
|
};
|
|
2497
2478
|
|
|
2498
2479
|
// src/notifications.ts
|
|
2499
|
-
var
|
|
2480
|
+
var import_react_query20 = require("react-query");
|
|
2500
2481
|
var import_react7 = require("react");
|
|
2501
2482
|
var useNotifications = () => {
|
|
2502
2483
|
var _a;
|
|
2503
2484
|
const { data: me } = useMe();
|
|
2504
2485
|
const link = (_a = me == null ? void 0 : me._links["notifications"]) == null ? void 0 : _a.href;
|
|
2505
|
-
const { data, error, isLoading, refetch } = (0,
|
|
2486
|
+
const { data, error, isLoading, refetch } = (0, import_react_query20.useQuery)(
|
|
2506
2487
|
"notifications",
|
|
2507
2488
|
() => apiClient.get(link).then((response) => response.json()),
|
|
2508
2489
|
{
|
|
@@ -2520,9 +2501,9 @@ var useNotifications = () => {
|
|
|
2520
2501
|
};
|
|
2521
2502
|
};
|
|
2522
2503
|
var useDismissNotification = (notification) => {
|
|
2523
|
-
const queryClient2 = (0,
|
|
2504
|
+
const queryClient2 = (0, import_react_query20.useQueryClient)();
|
|
2524
2505
|
const link = requiredLink(notification, "dismiss");
|
|
2525
|
-
const { data, isLoading, error, mutate } = (0,
|
|
2506
|
+
const { data, isLoading, error, mutate } = (0, import_react_query20.useMutation)(() => apiClient.delete(link), {
|
|
2526
2507
|
onSuccess: () => {
|
|
2527
2508
|
queryClient2.invalidateQueries("notifications");
|
|
2528
2509
|
}
|
|
@@ -2535,9 +2516,9 @@ var useDismissNotification = (notification) => {
|
|
|
2535
2516
|
};
|
|
2536
2517
|
};
|
|
2537
2518
|
var useClearNotifications = (notificationCollection) => {
|
|
2538
|
-
const queryClient2 = (0,
|
|
2519
|
+
const queryClient2 = (0, import_react_query20.useQueryClient)();
|
|
2539
2520
|
const link = requiredLink(notificationCollection, "clear");
|
|
2540
|
-
const { data, isLoading, error, mutate } = (0,
|
|
2521
|
+
const { data, isLoading, error, mutate } = (0, import_react_query20.useMutation)(() => apiClient.delete(link), {
|
|
2541
2522
|
onSuccess: () => {
|
|
2542
2523
|
queryClient2.invalidateQueries("notifications");
|
|
2543
2524
|
}
|
|
@@ -2639,7 +2620,7 @@ var useNotificationSubscription = (refetch, notificationCollection) => {
|
|
|
2639
2620
|
};
|
|
2640
2621
|
|
|
2641
2622
|
// src/alerts.ts
|
|
2642
|
-
var
|
|
2623
|
+
var import_react_query21 = require("react-query");
|
|
2643
2624
|
var alertsFromStorage = () => {
|
|
2644
2625
|
const item = localStorage.getItem("alerts");
|
|
2645
2626
|
if (item) {
|
|
@@ -2681,7 +2662,7 @@ var restoreOrFetch = (request) => {
|
|
|
2681
2662
|
};
|
|
2682
2663
|
var useAlerts = () => {
|
|
2683
2664
|
const link = useIndexLink("alerts");
|
|
2684
|
-
const { data, error, isLoading } = (0,
|
|
2665
|
+
const { data, error, isLoading } = (0, import_react_query21.useQuery)(
|
|
2685
2666
|
"alerts",
|
|
2686
2667
|
() => {
|
|
2687
2668
|
if (!link) {
|
|
@@ -2702,12 +2683,12 @@ var useAlerts = () => {
|
|
|
2702
2683
|
};
|
|
2703
2684
|
|
|
2704
2685
|
// src/configLink.ts
|
|
2705
|
-
var
|
|
2686
|
+
var import_react_query22 = require("react-query");
|
|
2706
2687
|
var import_react8 = require("react");
|
|
2707
2688
|
var useConfigLink = (link) => {
|
|
2708
|
-
const queryClient2 = (0,
|
|
2689
|
+
const queryClient2 = (0, import_react_query22.useQueryClient)();
|
|
2709
2690
|
const queryKey = ["configLink", link];
|
|
2710
|
-
const { isLoading, error, data } = (0,
|
|
2691
|
+
const { isLoading, error, data } = (0, import_react_query22.useQuery)(
|
|
2711
2692
|
queryKey,
|
|
2712
2693
|
() => apiClient.get(link).then((response) => {
|
|
2713
2694
|
const contentType = response.headers.get("Content-Type") || "application/json";
|
|
@@ -2719,7 +2700,7 @@ var useConfigLink = (link) => {
|
|
|
2719
2700
|
error: mutationError,
|
|
2720
2701
|
mutateAsync,
|
|
2721
2702
|
data: updateResponse
|
|
2722
|
-
} = (0,
|
|
2703
|
+
} = (0, import_react_query22.useMutation)(
|
|
2723
2704
|
(vars) => apiClient.put(vars.link, vars.configuration, vars.contentType),
|
|
2724
2705
|
{
|
|
2725
2706
|
onSuccess: async () => {
|
|
@@ -2752,9 +2733,9 @@ var useConfigLink = (link) => {
|
|
|
2752
2733
|
};
|
|
2753
2734
|
|
|
2754
2735
|
// src/apiKeys.ts
|
|
2755
|
-
var
|
|
2736
|
+
var import_react_query23 = require("react-query");
|
|
2756
2737
|
var CONTENT_TYPE_API_KEY = "application/vnd.scmm-apiKey+json;v=2";
|
|
2757
|
-
var useApiKeys = (user) => (0,
|
|
2738
|
+
var useApiKeys = (user) => (0, import_react_query23.useQuery)(["user", user.name, "apiKeys"], () => apiClient.get(requiredLink(user, "apiKeys")).then((r) => r.json()));
|
|
2758
2739
|
var createApiKey = (link) => async (key) => {
|
|
2759
2740
|
const creationResponse = await apiClient.post(link, key, CONTENT_TYPE_API_KEY);
|
|
2760
2741
|
const location = creationResponse.headers.get("Location");
|
|
@@ -2766,8 +2747,8 @@ var createApiKey = (link) => async (key) => {
|
|
|
2766
2747
|
return { ...apiKey, token };
|
|
2767
2748
|
};
|
|
2768
2749
|
var useCreateApiKey = (user, apiKeys) => {
|
|
2769
|
-
const queryClient2 = (0,
|
|
2770
|
-
const { mutate, data, isLoading, error, reset: reset2 } = (0,
|
|
2750
|
+
const queryClient2 = (0, import_react_query23.useQueryClient)();
|
|
2751
|
+
const { mutate, data, isLoading, error, reset: reset2 } = (0, import_react_query23.useMutation)(
|
|
2771
2752
|
createApiKey(requiredLink(apiKeys, "create")),
|
|
2772
2753
|
{
|
|
2773
2754
|
onSuccess: () => queryClient2.invalidateQueries(["user", user.name, "apiKeys"])
|
|
@@ -2782,8 +2763,8 @@ var useCreateApiKey = (user, apiKeys) => {
|
|
|
2782
2763
|
};
|
|
2783
2764
|
};
|
|
2784
2765
|
var useDeleteApiKey = (user) => {
|
|
2785
|
-
const queryClient2 = (0,
|
|
2786
|
-
const { mutate, isLoading, error, data } = (0,
|
|
2766
|
+
const queryClient2 = (0, import_react_query23.useQueryClient)();
|
|
2767
|
+
const { mutate, isLoading, error, data } = (0, import_react_query23.useMutation)(
|
|
2787
2768
|
(apiKey) => {
|
|
2788
2769
|
const deleteUrl = requiredLink(apiKey, "delete");
|
|
2789
2770
|
return apiClient.delete(deleteUrl);
|
|
@@ -2801,9 +2782,9 @@ var useDeleteApiKey = (user) => {
|
|
|
2801
2782
|
};
|
|
2802
2783
|
|
|
2803
2784
|
// src/publicKeys.ts
|
|
2804
|
-
var
|
|
2785
|
+
var import_react_query24 = require("react-query");
|
|
2805
2786
|
var CONTENT_TYPE_PUBLIC_KEY = "application/vnd.scmm-publicKey+json;v=2";
|
|
2806
|
-
var usePublicKeys = (user) => (0,
|
|
2787
|
+
var usePublicKeys = (user) => (0, import_react_query24.useQuery)(
|
|
2807
2788
|
["user", user.name, "publicKeys"],
|
|
2808
2789
|
() => apiClient.get(requiredLink(user, "publicKeys")).then((r) => r.json())
|
|
2809
2790
|
);
|
|
@@ -2817,8 +2798,8 @@ var createPublicKey = (link) => async (key) => {
|
|
|
2817
2798
|
return apiKeyResponse.json();
|
|
2818
2799
|
};
|
|
2819
2800
|
var useCreatePublicKey = (user, publicKeys) => {
|
|
2820
|
-
const queryClient2 = (0,
|
|
2821
|
-
const { mutate, data, isLoading, error, reset: reset2 } = (0,
|
|
2801
|
+
const queryClient2 = (0, import_react_query24.useQueryClient)();
|
|
2802
|
+
const { mutate, data, isLoading, error, reset: reset2 } = (0, import_react_query24.useMutation)(
|
|
2822
2803
|
createPublicKey(requiredLink(publicKeys, "create")),
|
|
2823
2804
|
{
|
|
2824
2805
|
onSuccess: () => queryClient2.invalidateQueries(["user", user.name, "publicKeys"])
|
|
@@ -2833,8 +2814,8 @@ var useCreatePublicKey = (user, publicKeys) => {
|
|
|
2833
2814
|
};
|
|
2834
2815
|
};
|
|
2835
2816
|
var useDeletePublicKey = (user) => {
|
|
2836
|
-
const queryClient2 = (0,
|
|
2837
|
-
const { mutate, isLoading, error, data } = (0,
|
|
2817
|
+
const queryClient2 = (0, import_react_query24.useQueryClient)();
|
|
2818
|
+
const { mutate, isLoading, error, data } = (0, import_react_query24.useMutation)(
|
|
2838
2819
|
(publicKey) => {
|
|
2839
2820
|
const deleteUrl = requiredLink(publicKey, "delete");
|
|
2840
2821
|
return apiClient.delete(deleteUrl);
|
|
@@ -2852,22 +2833,22 @@ var useDeletePublicKey = (user) => {
|
|
|
2852
2833
|
};
|
|
2853
2834
|
|
|
2854
2835
|
// src/fileContent.ts
|
|
2855
|
-
var
|
|
2836
|
+
var import_react_query25 = require("react-query");
|
|
2856
2837
|
var useFileContent = (file) => {
|
|
2857
2838
|
const selfLink = requiredLink(file, "self");
|
|
2858
|
-
return (0,
|
|
2839
|
+
return (0, import_react_query25.useQuery)(["fileContent", selfLink], () => apiClient.get(selfLink).then((response) => response.text()));
|
|
2859
2840
|
};
|
|
2860
2841
|
|
|
2861
2842
|
// src/history.ts
|
|
2862
|
-
var
|
|
2843
|
+
var import_react_query26 = require("react-query");
|
|
2863
2844
|
var useHistory = (repository, revision, file, request) => {
|
|
2864
|
-
const queryClient2 = (0,
|
|
2845
|
+
const queryClient2 = (0, import_react_query26.useQueryClient)();
|
|
2865
2846
|
const link = file._links.history.href;
|
|
2866
2847
|
const queryParams = {};
|
|
2867
2848
|
if (request == null ? void 0 : request.page) {
|
|
2868
2849
|
queryParams.page = request.page.toString();
|
|
2869
2850
|
}
|
|
2870
|
-
return (0,
|
|
2851
|
+
return (0, import_react_query26.useQuery)(
|
|
2871
2852
|
repoQueryKey(repository, "history", revision, file.path, (request == null ? void 0 : request.page) || 0),
|
|
2872
2853
|
() => apiClient.get(`${link}?${createQueryString(queryParams)}`).then((response) => response.json()),
|
|
2873
2854
|
{
|
|
@@ -2883,7 +2864,7 @@ var useHistory = (repository, revision, file, request) => {
|
|
|
2883
2864
|
};
|
|
2884
2865
|
|
|
2885
2866
|
// src/contentType.ts
|
|
2886
|
-
var
|
|
2867
|
+
var import_react_query27 = require("react-query");
|
|
2887
2868
|
function getContentType(url) {
|
|
2888
2869
|
return apiClient.head(url).then((response) => {
|
|
2889
2870
|
return {
|
|
@@ -2896,7 +2877,7 @@ function getContentType(url) {
|
|
|
2896
2877
|
});
|
|
2897
2878
|
}
|
|
2898
2879
|
var useContentType = (url, options = {}) => {
|
|
2899
|
-
const { isLoading, isFetching, error, data } = (0,
|
|
2880
|
+
const { isLoading, isFetching, error, data } = (0, import_react_query27.useQuery)(
|
|
2900
2881
|
["contentType", url],
|
|
2901
2882
|
() => getContentType(url),
|
|
2902
2883
|
options
|
|
@@ -2910,9 +2891,9 @@ var useContentType = (url, options = {}) => {
|
|
|
2910
2891
|
};
|
|
2911
2892
|
|
|
2912
2893
|
// src/annotations.ts
|
|
2913
|
-
var
|
|
2894
|
+
var import_react_query28 = require("react-query");
|
|
2914
2895
|
var useAnnotations = (repository, revision, file) => {
|
|
2915
|
-
const { isLoading, isFetching, error, data } = (0,
|
|
2896
|
+
const { isLoading, isFetching, error, data } = (0, import_react_query28.useQuery)(
|
|
2916
2897
|
repoQueryKey(repository, "annotations", revision, file.path),
|
|
2917
2898
|
() => apiClient.get(file._links.annotate.href).then((response) => response.json())
|
|
2918
2899
|
);
|
|
@@ -2925,7 +2906,7 @@ var useAnnotations = (repository, revision, file) => {
|
|
|
2925
2906
|
};
|
|
2926
2907
|
|
|
2927
2908
|
// src/search.ts
|
|
2928
|
-
var
|
|
2909
|
+
var import_react_query29 = require("react-query");
|
|
2929
2910
|
var import_react9 = require("react");
|
|
2930
2911
|
|
|
2931
2912
|
// src/help/search/syntax.en.ts
|
|
@@ -3135,7 +3116,7 @@ var useSearchableTypes = () => useIndexJsonResource("searchableTypes");
|
|
|
3135
3116
|
var useSearchCounts = (types, query, options) => {
|
|
3136
3117
|
const { links, isLoading } = useSearchLinks(options);
|
|
3137
3118
|
const result = {};
|
|
3138
|
-
const queries = (0,
|
|
3119
|
+
const queries = (0, import_react_query29.useQueries)(
|
|
3139
3120
|
types.map((type) => ({
|
|
3140
3121
|
queryKey: ["search", type, query, "count"],
|
|
3141
3122
|
queryFn: () => apiClient.get(`${findLink(links, type)}?q=${encodeURIComponent(query)}&countOnly=true`).then((response) => response.json()),
|
|
@@ -3208,7 +3189,7 @@ var useInternalSearch = (query, options, link) => {
|
|
|
3208
3189
|
if (options.pageSize) {
|
|
3209
3190
|
queryParams.pageSize = options.pageSize.toString();
|
|
3210
3191
|
}
|
|
3211
|
-
return (0,
|
|
3192
|
+
return (0, import_react_query29.useQuery)(
|
|
3212
3193
|
["search", options.type, queryParams],
|
|
3213
3194
|
() => apiClient.get(`${link}?${createQueryString(queryParams)}`).then((response) => response.json()),
|
|
3214
3195
|
{
|
|
@@ -3245,10 +3226,10 @@ var useSearchSyntaxContent = (language) => useObserveAsync(
|
|
|
3245
3226
|
);
|
|
3246
3227
|
|
|
3247
3228
|
// src/loginInfo.ts
|
|
3248
|
-
var
|
|
3229
|
+
var import_react_query30 = require("react-query");
|
|
3249
3230
|
var useLoginInfo = (disabled = false) => {
|
|
3250
3231
|
const loginInfoLink = useIndexLink("loginInfo");
|
|
3251
|
-
const { error, isLoading, data } = (0,
|
|
3232
|
+
const { error, isLoading, data } = (0, import_react_query30.useQuery)(
|
|
3252
3233
|
["loginInfo"],
|
|
3253
3234
|
() => fetch(loginInfoLink).then((response) => response.json()),
|
|
3254
3235
|
{
|
|
@@ -3264,9 +3245,9 @@ var useLoginInfo = (disabled = false) => {
|
|
|
3264
3245
|
};
|
|
3265
3246
|
|
|
3266
3247
|
// src/useInvalidation.tsx
|
|
3267
|
-
var
|
|
3248
|
+
var import_react_query31 = require("react-query");
|
|
3268
3249
|
var useInvalidation = (link) => {
|
|
3269
|
-
const { mutate, isLoading, error, isSuccess } = (0,
|
|
3250
|
+
const { mutate, isLoading, error, isSuccess } = (0, import_react_query31.useMutation)(
|
|
3270
3251
|
(link2) => apiClient.post(link2, {})
|
|
3271
3252
|
);
|
|
3272
3253
|
return {
|
|
@@ -3286,7 +3267,7 @@ var useInvalidateSearchIndices = () => {
|
|
|
3286
3267
|
};
|
|
3287
3268
|
|
|
3288
3269
|
// src/usePluginCenterAuthInfo.ts
|
|
3289
|
-
var
|
|
3270
|
+
var import_react_query32 = require("react-query");
|
|
3290
3271
|
var import_react_router_dom = require("react-router-dom");
|
|
3291
3272
|
var appendQueryParam = (link, name, value) => {
|
|
3292
3273
|
let href = link.href;
|
|
@@ -3300,7 +3281,7 @@ var appendQueryParam = (link, name, value) => {
|
|
|
3300
3281
|
var usePluginCenterAuthInfo = () => {
|
|
3301
3282
|
const link = useIndexLink("pluginCenterAuth");
|
|
3302
3283
|
const location = (0, import_react_router_dom.useLocation)();
|
|
3303
|
-
return (0,
|
|
3284
|
+
return (0, import_react_query32.useQuery)(
|
|
3304
3285
|
["pluginCenterAuth"],
|
|
3305
3286
|
() => {
|
|
3306
3287
|
if (!link) {
|
|
@@ -3323,8 +3304,8 @@ var usePluginCenterAuthInfo = () => {
|
|
|
3323
3304
|
);
|
|
3324
3305
|
};
|
|
3325
3306
|
var usePluginCenterLogout = (authenticationInfo) => {
|
|
3326
|
-
const queryClient2 = (0,
|
|
3327
|
-
const { mutate, isLoading, error } = (0,
|
|
3307
|
+
const queryClient2 = (0, import_react_query32.useQueryClient)();
|
|
3308
|
+
const { mutate, isLoading, error } = (0, import_react_query32.useMutation)(
|
|
3328
3309
|
() => {
|
|
3329
3310
|
if (!authenticationInfo._links.logout) {
|
|
3330
3311
|
throw new Error("authenticationInfo has no logout link");
|
|
@@ -3346,7 +3327,7 @@ var usePluginCenterLogout = (authenticationInfo) => {
|
|
|
3346
3327
|
};
|
|
3347
3328
|
|
|
3348
3329
|
// src/compare.ts
|
|
3349
|
-
var
|
|
3330
|
+
var import_react_query33 = require("react-query");
|
|
3350
3331
|
function createIncomingUrl(repository, linkName, source, target) {
|
|
3351
3332
|
const link = repository._links[linkName];
|
|
3352
3333
|
if (link == null ? void 0 : link.templated) {
|
|
@@ -3366,7 +3347,7 @@ function createDiffUrl(repository, source, target) {
|
|
|
3366
3347
|
}
|
|
3367
3348
|
}
|
|
3368
3349
|
var useIncomingChangesets = (repository, source, target, request) => {
|
|
3369
|
-
const queryClient2 = (0,
|
|
3350
|
+
const queryClient2 = (0, import_react_query33.useQueryClient)();
|
|
3370
3351
|
let link = createChangesetUrl(repository, source, target);
|
|
3371
3352
|
if ((request == null ? void 0 : request.page) || (request == null ? void 0 : request.limit)) {
|
|
3372
3353
|
if ((request == null ? void 0 : request.page) && (request == null ? void 0 : request.limit)) {
|
|
@@ -3377,7 +3358,7 @@ var useIncomingChangesets = (repository, source, target, request) => {
|
|
|
3377
3358
|
link = `${link}?pageSize=${request.limit}`;
|
|
3378
3359
|
}
|
|
3379
3360
|
}
|
|
3380
|
-
return (0,
|
|
3361
|
+
return (0, import_react_query33.useQuery)(
|
|
3381
3362
|
["repository", repository.namespace, repository.name, "compare", source, target, "changesets", (request == null ? void 0 : request.page) || 0],
|
|
3382
3363
|
() => apiClient.get(link).then((response) => response.json()),
|
|
3383
3364
|
{
|
|
@@ -3415,32 +3396,24 @@ function useLocalStorage(key, initialValue) {
|
|
|
3415
3396
|
return () => window.removeEventListener("storage", listener);
|
|
3416
3397
|
}, [key, initialValue]);
|
|
3417
3398
|
const setValue = (newValue) => {
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
key,
|
|
3426
|
-
oldValue: JSON.stringify(oldValue),
|
|
3427
|
-
newValue: json,
|
|
3428
|
-
storageArea: localStorage
|
|
3429
|
-
})
|
|
3430
|
-
);
|
|
3431
|
-
return computedNewValue;
|
|
3432
|
-
});
|
|
3399
|
+
const computedNewValue = newValue instanceof Function ? newValue(item) : newValue;
|
|
3400
|
+
setItem(computedNewValue);
|
|
3401
|
+
const json = JSON.stringify(computedNewValue);
|
|
3402
|
+
localStorage.setItem(key, json);
|
|
3403
|
+
window.dispatchEvent(
|
|
3404
|
+
new StorageEvent("storage", { key, oldValue: item, newValue: json, storageArea: localStorage })
|
|
3405
|
+
);
|
|
3433
3406
|
};
|
|
3434
3407
|
return [item, setValue];
|
|
3435
3408
|
}
|
|
3436
3409
|
|
|
3437
3410
|
// src/useAutocompleteOptions.ts
|
|
3438
|
-
var
|
|
3411
|
+
var import_react_query34 = require("react-query");
|
|
3439
3412
|
var import_react_i18next = require("react-i18next");
|
|
3440
3413
|
var defaultLabelFactory = (element) => element.displayName ? `${element.displayName} (${element.id})` : element.id;
|
|
3441
3414
|
function useAutocompleteOptions(query = "", link, options = {}) {
|
|
3442
3415
|
const [t] = (0, import_react_i18next.useTranslation)("commons");
|
|
3443
|
-
return (0,
|
|
3416
|
+
return (0, import_react_query34.useQuery)(
|
|
3444
3417
|
["options", link, query],
|
|
3445
3418
|
() => apiClient.get(link + "?q=" + query).then((r) => r.json()).then((json) => {
|
|
3446
3419
|
const result = json.map((element) => ({
|
|
@@ -3491,9 +3464,9 @@ var useUserOptions = (query) => {
|
|
|
3491
3464
|
|
|
3492
3465
|
// src/ApiProvider.tsx
|
|
3493
3466
|
var import_react11 = __toESM(require("react"));
|
|
3494
|
-
var
|
|
3467
|
+
var import_react_query35 = require("react-query");
|
|
3495
3468
|
var import_devtools = require("react-query/devtools");
|
|
3496
|
-
var queryClient = new
|
|
3469
|
+
var queryClient = new import_react_query35.QueryClient({
|
|
3497
3470
|
defaultOptions: {
|
|
3498
3471
|
queries: {
|
|
3499
3472
|
retry: false
|
|
@@ -3517,7 +3490,7 @@ var ApiProvider = ({ children, index, me, onMeFetched, onIndexFetched, devtools
|
|
|
3517
3490
|
}
|
|
3518
3491
|
}
|
|
3519
3492
|
}, [me, onMeFetched]);
|
|
3520
|
-
return /* @__PURE__ */ import_react11.default.createElement(
|
|
3493
|
+
return /* @__PURE__ */ import_react11.default.createElement(import_react_query35.QueryClientProvider, {
|
|
3521
3494
|
client: queryClient
|
|
3522
3495
|
}, /* @__PURE__ */ import_react11.default.createElement(LegacyContextProvider, {
|
|
3523
3496
|
onIndexFetched,
|
|
@@ -3699,7 +3672,6 @@ var RepositoryRevisionContextProvider = ({ revision, children }) => /* @__PURE__
|
|
|
3699
3672
|
useRepositoryVerbs,
|
|
3700
3673
|
useRequiredIndexLink,
|
|
3701
3674
|
useRequiredMe,
|
|
3702
|
-
useRevert,
|
|
3703
3675
|
useRunHealthCheck,
|
|
3704
3676
|
useSearch,
|
|
3705
3677
|
useSearchCounts,
|
package/build/index.mjs
CHANGED
|
@@ -1510,26 +1510,8 @@ var useChangeset = (repository, id) => {
|
|
|
1510
1510
|
);
|
|
1511
1511
|
};
|
|
1512
1512
|
|
|
1513
|
-
// src/revert.ts
|
|
1514
|
-
import { useMutation as useMutation6 } from "react-query";
|
|
1515
|
-
var useRevert = (changeset) => {
|
|
1516
|
-
const link = requiredLink(changeset, "revert");
|
|
1517
|
-
const { isLoading, error, mutate, data } = useMutation6({
|
|
1518
|
-
mutationFn: async (request) => {
|
|
1519
|
-
const response = await apiClient.post(link, request, "application/vnd.scmm-revert+json;v=2");
|
|
1520
|
-
return await response.json();
|
|
1521
|
-
}
|
|
1522
|
-
});
|
|
1523
|
-
return {
|
|
1524
|
-
revert: mutate,
|
|
1525
|
-
isLoading,
|
|
1526
|
-
error,
|
|
1527
|
-
revision: data
|
|
1528
|
-
};
|
|
1529
|
-
};
|
|
1530
|
-
|
|
1531
1513
|
// src/tags.ts
|
|
1532
|
-
import { useMutation as
|
|
1514
|
+
import { useMutation as useMutation6, useQuery as useQuery9, useQueryClient as useQueryClient8 } from "react-query";
|
|
1533
1515
|
var tagQueryKey = (repository, tag) => {
|
|
1534
1516
|
return repoQueryKey(repository, "tag", tag);
|
|
1535
1517
|
};
|
|
@@ -1589,7 +1571,7 @@ var createTag = (changeset, link) => {
|
|
|
1589
1571
|
var useCreateTag = (repository, changeset) => {
|
|
1590
1572
|
const queryClient2 = useQueryClient8();
|
|
1591
1573
|
const link = requiredLink(changeset, "tag");
|
|
1592
|
-
const { isLoading, error, mutate, data } =
|
|
1574
|
+
const { isLoading, error, mutate, data } = useMutation6(createTag(changeset, link), {
|
|
1593
1575
|
onSuccess: async (tag) => {
|
|
1594
1576
|
queryClient2.setQueryData(tagQueryKey(repository, tag.name), tag);
|
|
1595
1577
|
await queryClient2.invalidateQueries(tagQueryKey(repository, tag.name));
|
|
@@ -1605,7 +1587,7 @@ var useCreateTag = (repository, changeset) => {
|
|
|
1605
1587
|
};
|
|
1606
1588
|
var useDeleteTag = (repository) => {
|
|
1607
1589
|
const queryClient2 = useQueryClient8();
|
|
1608
|
-
const { mutate, isLoading, error, data } =
|
|
1590
|
+
const { mutate, isLoading, error, data } = useMutation6(
|
|
1609
1591
|
(tag) => {
|
|
1610
1592
|
const deleteUrl = tag._links.delete.href;
|
|
1611
1593
|
return apiClient.delete(deleteUrl);
|
|
@@ -1626,7 +1608,7 @@ var useDeleteTag = (repository) => {
|
|
|
1626
1608
|
};
|
|
1627
1609
|
|
|
1628
1610
|
// src/config.ts
|
|
1629
|
-
import { useMutation as
|
|
1611
|
+
import { useMutation as useMutation7, useQuery as useQuery10, useQueryClient as useQueryClient9 } from "react-query";
|
|
1630
1612
|
var useConfig = () => {
|
|
1631
1613
|
const indexLink = useIndexLink("config");
|
|
1632
1614
|
return useQuery10("config", () => apiClient.get(indexLink).then((response) => response.json()), {
|
|
@@ -1635,7 +1617,7 @@ var useConfig = () => {
|
|
|
1635
1617
|
};
|
|
1636
1618
|
var useUpdateConfig = () => {
|
|
1637
1619
|
const queryClient2 = useQueryClient9();
|
|
1638
|
-
const { mutate, isLoading, error, data, reset: reset2 } =
|
|
1620
|
+
const { mutate, isLoading, error, data, reset: reset2 } = useMutation7(
|
|
1639
1621
|
(config) => {
|
|
1640
1622
|
const updateUrl = requiredLink(config, "update");
|
|
1641
1623
|
return apiClient.put(updateUrl, config, "application/vnd.scmm-config+json;v=2");
|
|
@@ -1674,7 +1656,7 @@ var useUpdateInfo = () => {
|
|
|
1674
1656
|
};
|
|
1675
1657
|
|
|
1676
1658
|
// src/plugins.ts
|
|
1677
|
-
import { useMutation as
|
|
1659
|
+
import { useMutation as useMutation8, useQuery as useQuery12, useQueryClient as useQueryClient10 } from "react-query";
|
|
1678
1660
|
var isPluginCollection = (input) => input._embedded ? "plugins" in input._embedded : false;
|
|
1679
1661
|
var waitForRestartAfter = (promise, { initialDelay = 1e3, timeout = 500 } = {}) => {
|
|
1680
1662
|
const endTime = Number(new Date()) + 4 * 60 * 1e3;
|
|
@@ -1741,7 +1723,7 @@ var linkWithRestart = (link, restart) => {
|
|
|
1741
1723
|
};
|
|
1742
1724
|
var useInstallPlugin = () => {
|
|
1743
1725
|
const queryClient2 = useQueryClient10();
|
|
1744
|
-
const { mutate, isLoading, error, data } =
|
|
1726
|
+
const { mutate, isLoading, error, data } = useMutation8(
|
|
1745
1727
|
({ plugin, restartOptions: { restart, ...waitForRestartOptions } }) => {
|
|
1746
1728
|
const promise = apiClient.post(requiredLink(plugin, linkWithRestart("install", restart)));
|
|
1747
1729
|
if (restart) {
|
|
@@ -1766,7 +1748,7 @@ var useInstallPlugin = () => {
|
|
|
1766
1748
|
};
|
|
1767
1749
|
var useUninstallPlugin = () => {
|
|
1768
1750
|
const queryClient2 = useQueryClient10();
|
|
1769
|
-
const { mutate, isLoading, error, data } =
|
|
1751
|
+
const { mutate, isLoading, error, data } = useMutation8(
|
|
1770
1752
|
({ plugin, restartOptions: { restart, ...waitForRestartOptions } }) => {
|
|
1771
1753
|
const promise = apiClient.post(requiredLink(plugin, linkWithRestart("uninstall", restart)));
|
|
1772
1754
|
if (restart) {
|
|
@@ -1790,7 +1772,7 @@ var useUninstallPlugin = () => {
|
|
|
1790
1772
|
};
|
|
1791
1773
|
var useUpdatePlugins = () => {
|
|
1792
1774
|
const queryClient2 = useQueryClient10();
|
|
1793
|
-
const { mutate, isLoading, error, data } =
|
|
1775
|
+
const { mutate, isLoading, error, data } = useMutation8(
|
|
1794
1776
|
({ plugins, restartOptions: { restart, ...waitForRestartOptions } }) => {
|
|
1795
1777
|
const isCollection = isPluginCollection(plugins);
|
|
1796
1778
|
const promise = apiClient.post(
|
|
@@ -1817,7 +1799,7 @@ var useUpdatePlugins = () => {
|
|
|
1817
1799
|
};
|
|
1818
1800
|
var useExecutePendingPlugins = () => {
|
|
1819
1801
|
const queryClient2 = useQueryClient10();
|
|
1820
|
-
const { mutate, isLoading, error, data } =
|
|
1802
|
+
const { mutate, isLoading, error, data } = useMutation8(
|
|
1821
1803
|
({ pending, restartOptions }) => waitForRestartAfter(apiClient.post(requiredLink(pending, "execute")), restartOptions),
|
|
1822
1804
|
{
|
|
1823
1805
|
onSuccess: () => queryClient2.invalidateQueries("plugins")
|
|
@@ -1832,7 +1814,7 @@ var useExecutePendingPlugins = () => {
|
|
|
1832
1814
|
};
|
|
1833
1815
|
var useCancelPendingPlugins = () => {
|
|
1834
1816
|
const queryClient2 = useQueryClient10();
|
|
1835
|
-
const { mutate, isLoading, error, data } =
|
|
1817
|
+
const { mutate, isLoading, error, data } = useMutation8(
|
|
1836
1818
|
(pending) => apiClient.post(requiredLink(pending, "cancel")),
|
|
1837
1819
|
{
|
|
1838
1820
|
onSuccess: () => queryClient2.invalidateQueries("plugins")
|
|
@@ -1847,7 +1829,7 @@ var useCancelPendingPlugins = () => {
|
|
|
1847
1829
|
};
|
|
1848
1830
|
|
|
1849
1831
|
// src/repository-roles.ts
|
|
1850
|
-
import { useMutation as
|
|
1832
|
+
import { useMutation as useMutation9, useQuery as useQuery13, useQueryClient as useQueryClient11 } from "react-query";
|
|
1851
1833
|
var useRepositoryRoles = (request) => {
|
|
1852
1834
|
const queryClient2 = useQueryClient11();
|
|
1853
1835
|
const indexLink = useRequiredIndexLink("repositoryRoles");
|
|
@@ -1889,7 +1871,7 @@ var createRepositoryRole = (link) => {
|
|
|
1889
1871
|
var useCreateRepositoryRole = () => {
|
|
1890
1872
|
const queryClient2 = useQueryClient11();
|
|
1891
1873
|
const link = useRequiredIndexLink("repositoryRoles");
|
|
1892
|
-
const { mutate, data, isLoading, error } =
|
|
1874
|
+
const { mutate, data, isLoading, error } = useMutation9(
|
|
1893
1875
|
createRepositoryRole(link),
|
|
1894
1876
|
{
|
|
1895
1877
|
onSuccess: (repositoryRole) => {
|
|
@@ -1907,7 +1889,7 @@ var useCreateRepositoryRole = () => {
|
|
|
1907
1889
|
};
|
|
1908
1890
|
var useUpdateRepositoryRole = () => {
|
|
1909
1891
|
const queryClient2 = useQueryClient11();
|
|
1910
|
-
const { mutate, isLoading, error, data } =
|
|
1892
|
+
const { mutate, isLoading, error, data } = useMutation9(
|
|
1911
1893
|
(repositoryRole) => {
|
|
1912
1894
|
const updateUrl = requiredLink(repositoryRole, "update");
|
|
1913
1895
|
return apiClient.put(updateUrl, repositoryRole, "application/vnd.scmm-repositoryRole+json;v=2");
|
|
@@ -1928,7 +1910,7 @@ var useUpdateRepositoryRole = () => {
|
|
|
1928
1910
|
};
|
|
1929
1911
|
var useDeleteRepositoryRole = () => {
|
|
1930
1912
|
const queryClient2 = useQueryClient11();
|
|
1931
|
-
const { mutate, isLoading, error, data } =
|
|
1913
|
+
const { mutate, isLoading, error, data } = useMutation9(
|
|
1932
1914
|
(repositoryRole) => {
|
|
1933
1915
|
const deleteUrl = requiredLink(repositoryRole, "delete");
|
|
1934
1916
|
return apiClient.delete(deleteUrl);
|
|
@@ -1949,7 +1931,7 @@ var useDeleteRepositoryRole = () => {
|
|
|
1949
1931
|
};
|
|
1950
1932
|
|
|
1951
1933
|
// src/permissions.ts
|
|
1952
|
-
import { useMutation as
|
|
1934
|
+
import { useMutation as useMutation10, useQuery as useQuery14, useQueryClient as useQueryClient12 } from "react-query";
|
|
1953
1935
|
var useRepositoryVerbs = () => {
|
|
1954
1936
|
return useIndexJsonResource("repositoryVerbs");
|
|
1955
1937
|
};
|
|
@@ -1999,7 +1981,7 @@ var createPermission = (link) => {
|
|
|
1999
1981
|
var useCreatePermission = (namespaceOrRepository) => {
|
|
2000
1982
|
const queryClient2 = useQueryClient12();
|
|
2001
1983
|
const link = requiredLink(namespaceOrRepository, "permissions");
|
|
2002
|
-
const { isLoading, error, mutate, data } =
|
|
1984
|
+
const { isLoading, error, mutate, data } = useMutation10(
|
|
2003
1985
|
createPermission(link),
|
|
2004
1986
|
{
|
|
2005
1987
|
onSuccess: () => {
|
|
@@ -2017,7 +1999,7 @@ var useCreatePermission = (namespaceOrRepository) => {
|
|
|
2017
1999
|
};
|
|
2018
2000
|
var useUpdatePermission = (namespaceOrRepository) => {
|
|
2019
2001
|
const queryClient2 = useQueryClient12();
|
|
2020
|
-
const { isLoading, error, mutate, data } =
|
|
2002
|
+
const { isLoading, error, mutate, data } = useMutation10(
|
|
2021
2003
|
(permission) => {
|
|
2022
2004
|
const link = requiredLink(permission, "update");
|
|
2023
2005
|
return apiClient.put(link, permission, "application/vnd.scmm-repositoryPermission+json");
|
|
@@ -2038,7 +2020,7 @@ var useUpdatePermission = (namespaceOrRepository) => {
|
|
|
2038
2020
|
};
|
|
2039
2021
|
var useDeletePermission = (namespaceOrRepository) => {
|
|
2040
2022
|
const queryClient2 = useQueryClient12();
|
|
2041
|
-
const { isLoading, error, mutate, data } =
|
|
2023
|
+
const { isLoading, error, mutate, data } = useMutation10(
|
|
2042
2024
|
(permission) => {
|
|
2043
2025
|
const link = requiredLink(permission, "delete");
|
|
2044
2026
|
return apiClient.delete(link);
|
|
@@ -2065,7 +2047,7 @@ var useAvailableGlobalPermissions = () => useIndexJsonResource("permissions");
|
|
|
2065
2047
|
var useSetEntityPermissions = (permissionCollection, key) => {
|
|
2066
2048
|
const queryClient2 = useQueryClient12();
|
|
2067
2049
|
const url = permissionCollection ? objectLink(permissionCollection, "overwrite") : null;
|
|
2068
|
-
const { isLoading, error, mutate, data } =
|
|
2050
|
+
const { isLoading, error, mutate, data } = useMutation10(
|
|
2069
2051
|
(permissions) => apiClient.put(
|
|
2070
2052
|
url,
|
|
2071
2053
|
{
|
|
@@ -2188,14 +2170,14 @@ var isPartial = (file) => {
|
|
|
2188
2170
|
};
|
|
2189
2171
|
|
|
2190
2172
|
// src/import.ts
|
|
2191
|
-
import { useMutation as
|
|
2173
|
+
import { useMutation as useMutation11, useQuery as useQuery15 } from "react-query";
|
|
2192
2174
|
var useImportLog = (logId) => {
|
|
2193
2175
|
const link = useRequiredIndexLink("importLog").replace("{logId}", logId);
|
|
2194
2176
|
return useQuery15(["importLog", logId], () => apiClient.get(link).then((response) => response.text()));
|
|
2195
2177
|
};
|
|
2196
2178
|
var useImportRepositoryFromUrl = (repositoryType) => {
|
|
2197
2179
|
const url = requiredLink(repositoryType, "import", "url");
|
|
2198
|
-
const { isLoading, error, data, mutate } =
|
|
2180
|
+
const { isLoading, error, data, mutate } = useMutation11(
|
|
2199
2181
|
(repo) => apiClient.post(url, repo, "application/vnd.scmm-repository+json;v=2").then(fetchResourceFromLocationHeader).then(getResponseJson)
|
|
2200
2182
|
);
|
|
2201
2183
|
return {
|
|
@@ -2213,7 +2195,7 @@ var importRepository = (url, repository, file, password) => {
|
|
|
2213
2195
|
};
|
|
2214
2196
|
var useImportRepositoryFromBundle = (repositoryType) => {
|
|
2215
2197
|
const url = requiredLink(repositoryType, "import", "bundle");
|
|
2216
|
-
const { isLoading, error, data, mutate } =
|
|
2198
|
+
const { isLoading, error, data, mutate } = useMutation11(
|
|
2217
2199
|
({ repository, file, compressed, password }) => importRepository(compressed ? url + "?compressed=true" : url, repository, file, password)
|
|
2218
2200
|
);
|
|
2219
2201
|
return {
|
|
@@ -2229,7 +2211,7 @@ var useImportRepositoryFromBundle = (repositoryType) => {
|
|
|
2229
2211
|
};
|
|
2230
2212
|
};
|
|
2231
2213
|
var useImportFullRepository = (repositoryType) => {
|
|
2232
|
-
const { isLoading, error, data, mutate } =
|
|
2214
|
+
const { isLoading, error, data, mutate } = useMutation11(
|
|
2233
2215
|
({ repository, file, password }) => importRepository(requiredLink(repositoryType, "import", "fullImport"), repository, file, password)
|
|
2234
2216
|
);
|
|
2235
2217
|
return {
|
|
@@ -2304,7 +2286,7 @@ var merge2 = (diffs) => {
|
|
|
2304
2286
|
};
|
|
2305
2287
|
|
|
2306
2288
|
// src/notifications.ts
|
|
2307
|
-
import { useMutation as
|
|
2289
|
+
import { useMutation as useMutation12, useQuery as useQuery16, useQueryClient as useQueryClient13 } from "react-query";
|
|
2308
2290
|
import { useCallback as useCallback3, useEffect as useEffect5, useState as useState2 } from "react";
|
|
2309
2291
|
var useNotifications = () => {
|
|
2310
2292
|
var _a;
|
|
@@ -2330,7 +2312,7 @@ var useNotifications = () => {
|
|
|
2330
2312
|
var useDismissNotification = (notification) => {
|
|
2331
2313
|
const queryClient2 = useQueryClient13();
|
|
2332
2314
|
const link = requiredLink(notification, "dismiss");
|
|
2333
|
-
const { data, isLoading, error, mutate } =
|
|
2315
|
+
const { data, isLoading, error, mutate } = useMutation12(() => apiClient.delete(link), {
|
|
2334
2316
|
onSuccess: () => {
|
|
2335
2317
|
queryClient2.invalidateQueries("notifications");
|
|
2336
2318
|
}
|
|
@@ -2345,7 +2327,7 @@ var useDismissNotification = (notification) => {
|
|
|
2345
2327
|
var useClearNotifications = (notificationCollection) => {
|
|
2346
2328
|
const queryClient2 = useQueryClient13();
|
|
2347
2329
|
const link = requiredLink(notificationCollection, "clear");
|
|
2348
|
-
const { data, isLoading, error, mutate } =
|
|
2330
|
+
const { data, isLoading, error, mutate } = useMutation12(() => apiClient.delete(link), {
|
|
2349
2331
|
onSuccess: () => {
|
|
2350
2332
|
queryClient2.invalidateQueries("notifications");
|
|
2351
2333
|
}
|
|
@@ -2510,7 +2492,7 @@ var useAlerts = () => {
|
|
|
2510
2492
|
};
|
|
2511
2493
|
|
|
2512
2494
|
// src/configLink.ts
|
|
2513
|
-
import { useMutation as
|
|
2495
|
+
import { useMutation as useMutation13, useQuery as useQuery18, useQueryClient as useQueryClient14 } from "react-query";
|
|
2514
2496
|
import { useCallback as useCallback4 } from "react";
|
|
2515
2497
|
var useConfigLink = (link) => {
|
|
2516
2498
|
const queryClient2 = useQueryClient14();
|
|
@@ -2527,7 +2509,7 @@ var useConfigLink = (link) => {
|
|
|
2527
2509
|
error: mutationError,
|
|
2528
2510
|
mutateAsync,
|
|
2529
2511
|
data: updateResponse
|
|
2530
|
-
} =
|
|
2512
|
+
} = useMutation13(
|
|
2531
2513
|
(vars) => apiClient.put(vars.link, vars.configuration, vars.contentType),
|
|
2532
2514
|
{
|
|
2533
2515
|
onSuccess: async () => {
|
|
@@ -2560,7 +2542,7 @@ var useConfigLink = (link) => {
|
|
|
2560
2542
|
};
|
|
2561
2543
|
|
|
2562
2544
|
// src/apiKeys.ts
|
|
2563
|
-
import { useMutation as
|
|
2545
|
+
import { useMutation as useMutation14, useQuery as useQuery19, useQueryClient as useQueryClient15 } from "react-query";
|
|
2564
2546
|
var CONTENT_TYPE_API_KEY = "application/vnd.scmm-apiKey+json;v=2";
|
|
2565
2547
|
var useApiKeys = (user) => useQuery19(["user", user.name, "apiKeys"], () => apiClient.get(requiredLink(user, "apiKeys")).then((r) => r.json()));
|
|
2566
2548
|
var createApiKey = (link) => async (key) => {
|
|
@@ -2575,7 +2557,7 @@ var createApiKey = (link) => async (key) => {
|
|
|
2575
2557
|
};
|
|
2576
2558
|
var useCreateApiKey = (user, apiKeys) => {
|
|
2577
2559
|
const queryClient2 = useQueryClient15();
|
|
2578
|
-
const { mutate, data, isLoading, error, reset: reset2 } =
|
|
2560
|
+
const { mutate, data, isLoading, error, reset: reset2 } = useMutation14(
|
|
2579
2561
|
createApiKey(requiredLink(apiKeys, "create")),
|
|
2580
2562
|
{
|
|
2581
2563
|
onSuccess: () => queryClient2.invalidateQueries(["user", user.name, "apiKeys"])
|
|
@@ -2591,7 +2573,7 @@ var useCreateApiKey = (user, apiKeys) => {
|
|
|
2591
2573
|
};
|
|
2592
2574
|
var useDeleteApiKey = (user) => {
|
|
2593
2575
|
const queryClient2 = useQueryClient15();
|
|
2594
|
-
const { mutate, isLoading, error, data } =
|
|
2576
|
+
const { mutate, isLoading, error, data } = useMutation14(
|
|
2595
2577
|
(apiKey) => {
|
|
2596
2578
|
const deleteUrl = requiredLink(apiKey, "delete");
|
|
2597
2579
|
return apiClient.delete(deleteUrl);
|
|
@@ -2609,7 +2591,7 @@ var useDeleteApiKey = (user) => {
|
|
|
2609
2591
|
};
|
|
2610
2592
|
|
|
2611
2593
|
// src/publicKeys.ts
|
|
2612
|
-
import { useMutation as
|
|
2594
|
+
import { useMutation as useMutation15, useQuery as useQuery20, useQueryClient as useQueryClient16 } from "react-query";
|
|
2613
2595
|
var CONTENT_TYPE_PUBLIC_KEY = "application/vnd.scmm-publicKey+json;v=2";
|
|
2614
2596
|
var usePublicKeys = (user) => useQuery20(
|
|
2615
2597
|
["user", user.name, "publicKeys"],
|
|
@@ -2626,7 +2608,7 @@ var createPublicKey = (link) => async (key) => {
|
|
|
2626
2608
|
};
|
|
2627
2609
|
var useCreatePublicKey = (user, publicKeys) => {
|
|
2628
2610
|
const queryClient2 = useQueryClient16();
|
|
2629
|
-
const { mutate, data, isLoading, error, reset: reset2 } =
|
|
2611
|
+
const { mutate, data, isLoading, error, reset: reset2 } = useMutation15(
|
|
2630
2612
|
createPublicKey(requiredLink(publicKeys, "create")),
|
|
2631
2613
|
{
|
|
2632
2614
|
onSuccess: () => queryClient2.invalidateQueries(["user", user.name, "publicKeys"])
|
|
@@ -2642,7 +2624,7 @@ var useCreatePublicKey = (user, publicKeys) => {
|
|
|
2642
2624
|
};
|
|
2643
2625
|
var useDeletePublicKey = (user) => {
|
|
2644
2626
|
const queryClient2 = useQueryClient16();
|
|
2645
|
-
const { mutate, isLoading, error, data } =
|
|
2627
|
+
const { mutate, isLoading, error, data } = useMutation15(
|
|
2646
2628
|
(publicKey) => {
|
|
2647
2629
|
const deleteUrl = requiredLink(publicKey, "delete");
|
|
2648
2630
|
return apiClient.delete(deleteUrl);
|
|
@@ -3072,9 +3054,9 @@ var useLoginInfo = (disabled = false) => {
|
|
|
3072
3054
|
};
|
|
3073
3055
|
|
|
3074
3056
|
// src/useInvalidation.tsx
|
|
3075
|
-
import { useMutation as
|
|
3057
|
+
import { useMutation as useMutation16 } from "react-query";
|
|
3076
3058
|
var useInvalidation = (link) => {
|
|
3077
|
-
const { mutate, isLoading, error, isSuccess } =
|
|
3059
|
+
const { mutate, isLoading, error, isSuccess } = useMutation16(
|
|
3078
3060
|
(link2) => apiClient.post(link2, {})
|
|
3079
3061
|
);
|
|
3080
3062
|
return {
|
|
@@ -3094,7 +3076,7 @@ var useInvalidateSearchIndices = () => {
|
|
|
3094
3076
|
};
|
|
3095
3077
|
|
|
3096
3078
|
// src/usePluginCenterAuthInfo.ts
|
|
3097
|
-
import { useMutation as
|
|
3079
|
+
import { useMutation as useMutation17, useQuery as useQuery27, useQueryClient as useQueryClient18 } from "react-query";
|
|
3098
3080
|
import { useLocation } from "react-router-dom";
|
|
3099
3081
|
var appendQueryParam = (link, name, value) => {
|
|
3100
3082
|
let href = link.href;
|
|
@@ -3132,7 +3114,7 @@ var usePluginCenterAuthInfo = () => {
|
|
|
3132
3114
|
};
|
|
3133
3115
|
var usePluginCenterLogout = (authenticationInfo) => {
|
|
3134
3116
|
const queryClient2 = useQueryClient18();
|
|
3135
|
-
const { mutate, isLoading, error } =
|
|
3117
|
+
const { mutate, isLoading, error } = useMutation17(
|
|
3136
3118
|
() => {
|
|
3137
3119
|
if (!authenticationInfo._links.logout) {
|
|
3138
3120
|
throw new Error("authenticationInfo has no logout link");
|
|
@@ -3223,21 +3205,13 @@ function useLocalStorage(key, initialValue) {
|
|
|
3223
3205
|
return () => window.removeEventListener("storage", listener);
|
|
3224
3206
|
}, [key, initialValue]);
|
|
3225
3207
|
const setValue = (newValue) => {
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
key,
|
|
3234
|
-
oldValue: JSON.stringify(oldValue),
|
|
3235
|
-
newValue: json,
|
|
3236
|
-
storageArea: localStorage
|
|
3237
|
-
})
|
|
3238
|
-
);
|
|
3239
|
-
return computedNewValue;
|
|
3240
|
-
});
|
|
3208
|
+
const computedNewValue = newValue instanceof Function ? newValue(item) : newValue;
|
|
3209
|
+
setItem(computedNewValue);
|
|
3210
|
+
const json = JSON.stringify(computedNewValue);
|
|
3211
|
+
localStorage.setItem(key, json);
|
|
3212
|
+
window.dispatchEvent(
|
|
3213
|
+
new StorageEvent("storage", { key, oldValue: item, newValue: json, storageArea: localStorage })
|
|
3214
|
+
);
|
|
3241
3215
|
};
|
|
3242
3216
|
return [item, setValue];
|
|
3243
3217
|
}
|
|
@@ -3506,7 +3480,6 @@ export {
|
|
|
3506
3480
|
useRepositoryVerbs,
|
|
3507
3481
|
useRequiredIndexLink,
|
|
3508
3482
|
useRequiredMe,
|
|
3509
|
-
useRevert,
|
|
3510
3483
|
useRunHealthCheck,
|
|
3511
3484
|
useSearch,
|
|
3512
3485
|
useSearchCounts,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scm-manager/ui-api",
|
|
3
|
-
"version": "3.7.4
|
|
3
|
+
"version": "3.7.4",
|
|
4
4
|
"description": "React hook api for the SCM-Manager backend",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"module": "build/index.mjs",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"react-i18next": "11"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@scm-manager/ui-types": "3.7.4
|
|
29
|
+
"@scm-manager/ui-types": "3.7.4",
|
|
30
30
|
"tsup": "^5.12.6",
|
|
31
31
|
"@types/react-test-renderer": "^17.0.1",
|
|
32
32
|
"@scm-manager/babel-preset": "^2.13.1",
|