@scm-manager/ui-api 4.0.0-REACT19-20250920-130317 → 4.0.0-REACT19-20250922-115826
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 +2 -13
- package/build/index.js +247 -311
- package/build/index.mjs +94 -156
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -32,7 +32,6 @@ __export(src_exports, {
|
|
|
32
32
|
CONTENT_TYPE_PUBLIC_KEY: () => CONTENT_TYPE_PUBLIC_KEY,
|
|
33
33
|
ConflictError: () => ConflictError,
|
|
34
34
|
ForbiddenError: () => ForbiddenError,
|
|
35
|
-
LegacyContextProvider: () => LegacyContextProvider,
|
|
36
35
|
MissingLinkError: () => MissingLinkError,
|
|
37
36
|
NamespaceAndNameContextProvider: () => NamespaceAndNameContextProvider,
|
|
38
37
|
NamespaceContextProvider: () => NamespaceContextProvider,
|
|
@@ -128,7 +127,6 @@ __export(src_exports, {
|
|
|
128
127
|
useInvalidateAllCaches: () => useInvalidateAllCaches,
|
|
129
128
|
useInvalidateSearchIndices: () => useInvalidateSearchIndices,
|
|
130
129
|
useJsonResource: () => useJsonResource,
|
|
131
|
-
useLegacyContext: () => useLegacyContext,
|
|
132
130
|
useLocalStorage: () => useLocalStorage,
|
|
133
131
|
useLogin: () => useLogin,
|
|
134
132
|
useLoginInfo: () => useLoginInfo,
|
|
@@ -590,46 +588,7 @@ var ApiClient = class {
|
|
|
590
588
|
var apiClient = new ApiClient();
|
|
591
589
|
|
|
592
590
|
// src/base.ts
|
|
593
|
-
var import_react_query2 = require("react-query");
|
|
594
|
-
|
|
595
|
-
// src/LegacyContext.tsx
|
|
596
|
-
var import_react = __toESM(require("react"));
|
|
597
591
|
var import_react_query = require("react-query");
|
|
598
|
-
var Context = (0, import_react.createContext)(void 0);
|
|
599
|
-
var useLegacyContext = () => {
|
|
600
|
-
const context = (0, import_react.useContext)(Context);
|
|
601
|
-
if (!context) {
|
|
602
|
-
throw new Error("useLegacyContext can't be used outside of ApiProvider");
|
|
603
|
-
}
|
|
604
|
-
return context;
|
|
605
|
-
};
|
|
606
|
-
var createInitialContext = (queryClient2, base) => {
|
|
607
|
-
const ctx = {
|
|
608
|
-
...base,
|
|
609
|
-
initialize: () => {
|
|
610
|
-
if (ctx.onIndexFetched) {
|
|
611
|
-
const index = queryClient2.getQueryData("index");
|
|
612
|
-
if (index) {
|
|
613
|
-
ctx.onIndexFetched(index);
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
if (ctx.onMeFetched) {
|
|
617
|
-
const me = queryClient2.getQueryData("me");
|
|
618
|
-
if (me) {
|
|
619
|
-
ctx.onMeFetched(me);
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
};
|
|
624
|
-
return ctx;
|
|
625
|
-
};
|
|
626
|
-
var LegacyContextProvider = ({ onIndexFetched, onMeFetched, children }) => {
|
|
627
|
-
const queryClient2 = (0, import_react_query.useQueryClient)();
|
|
628
|
-
const ctx = createInitialContext(queryClient2, { onIndexFetched, onMeFetched });
|
|
629
|
-
return /* @__PURE__ */ import_react.default.createElement(Context.Provider, {
|
|
630
|
-
value: ctx
|
|
631
|
-
}, children);
|
|
632
|
-
};
|
|
633
592
|
|
|
634
593
|
// src/links.ts
|
|
635
594
|
var requiredLink = (object, name, subName) => {
|
|
@@ -662,13 +621,7 @@ var objectLink = (object, name) => {
|
|
|
662
621
|
|
|
663
622
|
// src/base.ts
|
|
664
623
|
var useIndex = () => {
|
|
665
|
-
|
|
666
|
-
return (0, import_react_query2.useQuery)("index", () => apiClient.get("/").then((response) => response.json()), {
|
|
667
|
-
onSuccess: (index) => {
|
|
668
|
-
if (legacy.onIndexFetched) {
|
|
669
|
-
legacy.onIndexFetched(index);
|
|
670
|
-
}
|
|
671
|
-
},
|
|
624
|
+
return (0, import_react_query.useQuery)("index", () => apiClient.get("/").then((response) => response.json()), {
|
|
672
625
|
refetchOnMount: false,
|
|
673
626
|
retry: (failureCount, error) => {
|
|
674
627
|
return error instanceof UnauthorizedError && failureCount === 0;
|
|
@@ -712,11 +665,11 @@ var useVersion = () => {
|
|
|
712
665
|
};
|
|
713
666
|
var useIndexJsonResource = (name) => {
|
|
714
667
|
const link = useIndexLink(name);
|
|
715
|
-
return (0,
|
|
668
|
+
return (0, import_react_query.useQuery)(name, () => apiClient.get(link).then((response) => response.json()), {
|
|
716
669
|
enabled: !!link
|
|
717
670
|
});
|
|
718
671
|
};
|
|
719
|
-
var useJsonResource = (entity, name, key) => (0,
|
|
672
|
+
var useJsonResource = (entity, name, key) => (0, import_react_query.useQuery)(key, () => apiClient.get(requiredLink(entity, name)).then((response) => response.json()));
|
|
720
673
|
function fetchResourceFromLocationHeader(response) {
|
|
721
674
|
const location = response.headers.get("Location");
|
|
722
675
|
if (!location) {
|
|
@@ -727,10 +680,10 @@ function fetchResourceFromLocationHeader(response) {
|
|
|
727
680
|
var getResponseJson = (response) => response.json();
|
|
728
681
|
|
|
729
682
|
// src/login.ts
|
|
730
|
-
var
|
|
683
|
+
var import_react_query3 = require("react-query");
|
|
731
684
|
|
|
732
685
|
// src/reset.ts
|
|
733
|
-
var
|
|
686
|
+
var import_react_query2 = require("react-query");
|
|
734
687
|
var reset = (queryClient2) => {
|
|
735
688
|
queryClient2.removeQueries({
|
|
736
689
|
predicate: ({ queryKey }) => queryKey !== "index"
|
|
@@ -738,22 +691,16 @@ var reset = (queryClient2) => {
|
|
|
738
691
|
return queryClient2.invalidateQueries("index");
|
|
739
692
|
};
|
|
740
693
|
var useReset = () => {
|
|
741
|
-
const queryClient2 = (0,
|
|
694
|
+
const queryClient2 = (0, import_react_query2.useQueryClient)();
|
|
742
695
|
return () => reset(queryClient2);
|
|
743
696
|
};
|
|
744
697
|
|
|
745
698
|
// src/login.ts
|
|
746
|
-
var
|
|
699
|
+
var import_react = require("react");
|
|
747
700
|
var useMe = () => {
|
|
748
|
-
const legacy = useLegacyContext();
|
|
749
701
|
const link = useIndexLink("me");
|
|
750
|
-
return (0,
|
|
751
|
-
enabled: !!link
|
|
752
|
-
onSuccess: (me) => {
|
|
753
|
-
if (legacy.onMeFetched) {
|
|
754
|
-
legacy.onMeFetched(me);
|
|
755
|
-
}
|
|
756
|
-
}
|
|
702
|
+
return (0, import_react_query3.useQuery)("me", () => apiClient.get(link).then((response) => response.json()), {
|
|
703
|
+
enabled: !!link
|
|
757
704
|
});
|
|
758
705
|
};
|
|
759
706
|
var useRequiredMe = () => {
|
|
@@ -779,7 +726,7 @@ var useSubject = () => {
|
|
|
779
726
|
var useLogin = () => {
|
|
780
727
|
const link = useIndexLink("login");
|
|
781
728
|
const reset2 = useReset();
|
|
782
|
-
const { mutate, isLoading, error } = (0,
|
|
729
|
+
const { mutate, isLoading, error } = (0, import_react_query3.useMutation)(
|
|
783
730
|
(credentials) => apiClient.post(link, credentials),
|
|
784
731
|
{
|
|
785
732
|
onSuccess: reset2
|
|
@@ -797,7 +744,7 @@ var useLogin = () => {
|
|
|
797
744
|
var useLogout = () => {
|
|
798
745
|
const link = useIndexLink("logout");
|
|
799
746
|
const reset2 = useReset();
|
|
800
|
-
const { mutate, isLoading, error, data } = (0,
|
|
747
|
+
const { mutate, isLoading, error, data } = (0, import_react_query3.useMutation)(
|
|
801
748
|
() => apiClient.delete(link).then((r) => r.status === 200 ? r.json() : {}),
|
|
802
749
|
{
|
|
803
750
|
onSuccess: (response) => {
|
|
@@ -808,7 +755,7 @@ var useLogout = () => {
|
|
|
808
755
|
}
|
|
809
756
|
}
|
|
810
757
|
);
|
|
811
|
-
const logout = (0,
|
|
758
|
+
const logout = (0, import_react.useCallback)(() => {
|
|
812
759
|
mutate({});
|
|
813
760
|
}, [mutate]);
|
|
814
761
|
return {
|
|
@@ -819,10 +766,10 @@ var useLogout = () => {
|
|
|
819
766
|
};
|
|
820
767
|
|
|
821
768
|
// src/groups.ts
|
|
822
|
-
var
|
|
769
|
+
var import_react_query4 = require("react-query");
|
|
823
770
|
|
|
824
771
|
// src/utils.ts
|
|
825
|
-
var
|
|
772
|
+
var import_react2 = require("react");
|
|
826
773
|
var createQueryString = (params) => {
|
|
827
774
|
return Object.keys(params).map((k) => encodeURIComponent(k) + "=" + encodeURIComponent(params[k])).join("&");
|
|
828
775
|
};
|
|
@@ -838,8 +785,8 @@ function makeCancelable(promise) {
|
|
|
838
785
|
});
|
|
839
786
|
}
|
|
840
787
|
function useCancellablePromise() {
|
|
841
|
-
const promises = (0,
|
|
842
|
-
(0,
|
|
788
|
+
const promises = (0, import_react2.useRef)([]);
|
|
789
|
+
(0, import_react2.useEffect)(() => {
|
|
843
790
|
promises.current = promises.current || [];
|
|
844
791
|
return function cancel() {
|
|
845
792
|
var _a;
|
|
@@ -847,7 +794,7 @@ function useCancellablePromise() {
|
|
|
847
794
|
promises.current = [];
|
|
848
795
|
};
|
|
849
796
|
}, []);
|
|
850
|
-
return (0,
|
|
797
|
+
return (0, import_react2.useCallback)((p) => {
|
|
851
798
|
var _a;
|
|
852
799
|
const cPromise = makeCancelable(p);
|
|
853
800
|
(_a = promises.current) == null ? void 0 : _a.push(cPromise);
|
|
@@ -857,7 +804,7 @@ function useCancellablePromise() {
|
|
|
857
804
|
|
|
858
805
|
// src/groups.ts
|
|
859
806
|
var useGroups = (request) => {
|
|
860
|
-
const queryClient2 = (0,
|
|
807
|
+
const queryClient2 = (0, import_react_query4.useQueryClient)();
|
|
861
808
|
const indexLink = useRequiredIndexLink("groups");
|
|
862
809
|
const queryParams = {};
|
|
863
810
|
if (request == null ? void 0 : request.search) {
|
|
@@ -866,7 +813,7 @@ var useGroups = (request) => {
|
|
|
866
813
|
if (request == null ? void 0 : request.page) {
|
|
867
814
|
queryParams.page = request.page.toString();
|
|
868
815
|
}
|
|
869
|
-
return (0,
|
|
816
|
+
return (0, import_react_query4.useQuery)(
|
|
870
817
|
["groups", (request == null ? void 0 : request.search) || "", (request == null ? void 0 : request.page) || 0],
|
|
871
818
|
() => apiClient.get(`${indexLink}?${createQueryString(queryParams)}`).then((response) => response.json()),
|
|
872
819
|
{
|
|
@@ -878,7 +825,7 @@ var useGroups = (request) => {
|
|
|
878
825
|
};
|
|
879
826
|
var useGroup = (name) => {
|
|
880
827
|
const indexLink = useRequiredIndexLink("groups");
|
|
881
|
-
return (0,
|
|
828
|
+
return (0, import_react_query4.useQuery)(
|
|
882
829
|
["group", name],
|
|
883
830
|
() => {
|
|
884
831
|
if (!name) {
|
|
@@ -903,9 +850,9 @@ var createGroup = (link) => {
|
|
|
903
850
|
};
|
|
904
851
|
};
|
|
905
852
|
var useCreateGroup = () => {
|
|
906
|
-
const queryClient2 = (0,
|
|
853
|
+
const queryClient2 = (0, import_react_query4.useQueryClient)();
|
|
907
854
|
const link = useRequiredIndexLink("groups");
|
|
908
|
-
const { mutate, data, isLoading, error } = (0,
|
|
855
|
+
const { mutate, data, isLoading, error } = (0, import_react_query4.useMutation)(createGroup(link), {
|
|
909
856
|
onSuccess: (group) => {
|
|
910
857
|
queryClient2.setQueryData(["group", group.name], group);
|
|
911
858
|
return queryClient2.invalidateQueries(["groups"]);
|
|
@@ -919,8 +866,8 @@ var useCreateGroup = () => {
|
|
|
919
866
|
};
|
|
920
867
|
};
|
|
921
868
|
var useUpdateGroup = () => {
|
|
922
|
-
const queryClient2 = (0,
|
|
923
|
-
const { mutate, isLoading, error, data } = (0,
|
|
869
|
+
const queryClient2 = (0, import_react_query4.useQueryClient)();
|
|
870
|
+
const { mutate, isLoading, error, data } = (0, import_react_query4.useMutation)(
|
|
924
871
|
(group) => {
|
|
925
872
|
const updateUrl = group._links.update.href;
|
|
926
873
|
return apiClient.put(updateUrl, group, "application/vnd.scmm-group+json;v=2");
|
|
@@ -940,8 +887,8 @@ var useUpdateGroup = () => {
|
|
|
940
887
|
};
|
|
941
888
|
};
|
|
942
889
|
var useDeleteGroup = () => {
|
|
943
|
-
const queryClient2 = (0,
|
|
944
|
-
const { mutate, isLoading, error, data } = (0,
|
|
890
|
+
const queryClient2 = (0, import_react_query4.useQueryClient)();
|
|
891
|
+
const { mutate, isLoading, error, data } = (0, import_react_query4.useMutation)(
|
|
945
892
|
(group) => {
|
|
946
893
|
const deleteUrl = group._links.delete.href;
|
|
947
894
|
return apiClient.delete(deleteUrl);
|
|
@@ -962,9 +909,9 @@ var useDeleteGroup = () => {
|
|
|
962
909
|
};
|
|
963
910
|
|
|
964
911
|
// src/users.ts
|
|
965
|
-
var
|
|
912
|
+
var import_react_query5 = require("react-query");
|
|
966
913
|
var useUsers = (request) => {
|
|
967
|
-
const queryClient2 = (0,
|
|
914
|
+
const queryClient2 = (0, import_react_query5.useQueryClient)();
|
|
968
915
|
const indexLink = useRequiredIndexLink("users");
|
|
969
916
|
const queryParams = {};
|
|
970
917
|
if (request == null ? void 0 : request.search) {
|
|
@@ -973,7 +920,7 @@ var useUsers = (request) => {
|
|
|
973
920
|
if (request == null ? void 0 : request.page) {
|
|
974
921
|
queryParams.page = request.page.toString();
|
|
975
922
|
}
|
|
976
|
-
return (0,
|
|
923
|
+
return (0, import_react_query5.useQuery)(
|
|
977
924
|
["users", (request == null ? void 0 : request.search) || "", (request == null ? void 0 : request.page) || 0],
|
|
978
925
|
() => apiClient.get(`${indexLink}?${createQueryString(queryParams)}`).then((response) => response.json()),
|
|
979
926
|
{
|
|
@@ -986,14 +933,14 @@ var useUsers = (request) => {
|
|
|
986
933
|
};
|
|
987
934
|
var useUser = (name) => {
|
|
988
935
|
const indexLink = useRequiredIndexLink("users");
|
|
989
|
-
return (0,
|
|
936
|
+
return (0, import_react_query5.useQuery)(
|
|
990
937
|
["user", name],
|
|
991
938
|
() => apiClient.get(concat(indexLink, name)).then((response) => response.json())
|
|
992
939
|
);
|
|
993
940
|
};
|
|
994
941
|
var useUserPermissionOverview = (user) => {
|
|
995
942
|
const overviewLink = user._links.permissionOverview;
|
|
996
|
-
return (0,
|
|
943
|
+
return (0, import_react_query5.useQuery)(
|
|
997
944
|
["user", user.name, "permissionOverview"],
|
|
998
945
|
() => apiClient.get(overviewLink.href).then((response) => response.json())
|
|
999
946
|
);
|
|
@@ -1010,9 +957,9 @@ var createUser = (link) => {
|
|
|
1010
957
|
};
|
|
1011
958
|
};
|
|
1012
959
|
var useCreateUser = () => {
|
|
1013
|
-
const queryClient2 = (0,
|
|
960
|
+
const queryClient2 = (0, import_react_query5.useQueryClient)();
|
|
1014
961
|
const link = useRequiredIndexLink("users");
|
|
1015
|
-
const { mutate, data, isLoading, error } = (0,
|
|
962
|
+
const { mutate, data, isLoading, error } = (0, import_react_query5.useMutation)(createUser(link), {
|
|
1016
963
|
onSuccess: (user) => {
|
|
1017
964
|
queryClient2.setQueryData(["user", user.name], user);
|
|
1018
965
|
return queryClient2.invalidateQueries(["users"]);
|
|
@@ -1026,8 +973,8 @@ var useCreateUser = () => {
|
|
|
1026
973
|
};
|
|
1027
974
|
};
|
|
1028
975
|
var useUpdateUser = () => {
|
|
1029
|
-
const queryClient2 = (0,
|
|
1030
|
-
const { mutate, isLoading, error, data } = (0,
|
|
976
|
+
const queryClient2 = (0, import_react_query5.useQueryClient)();
|
|
977
|
+
const { mutate, isLoading, error, data } = (0, import_react_query5.useMutation)(
|
|
1031
978
|
(user) => {
|
|
1032
979
|
const updateUrl = user._links.update.href;
|
|
1033
980
|
return apiClient.put(updateUrl, user, "application/vnd.scmm-user+json;v=2");
|
|
@@ -1047,8 +994,8 @@ var useUpdateUser = () => {
|
|
|
1047
994
|
};
|
|
1048
995
|
};
|
|
1049
996
|
var useDeleteUser = () => {
|
|
1050
|
-
const queryClient2 = (0,
|
|
1051
|
-
const { mutate, isLoading, error, data } = (0,
|
|
997
|
+
const queryClient2 = (0, import_react_query5.useQueryClient)();
|
|
998
|
+
const { mutate, isLoading, error, data } = (0, import_react_query5.useMutation)(
|
|
1052
999
|
(user) => {
|
|
1053
1000
|
const deleteUrl = user._links.delete.href;
|
|
1054
1001
|
return apiClient.delete(deleteUrl);
|
|
@@ -1080,8 +1027,8 @@ var convertToExternal = (url) => {
|
|
|
1080
1027
|
return apiClient.put(url, {}, "application/vnd.scmm-user+json;v=2");
|
|
1081
1028
|
};
|
|
1082
1029
|
var useConvertToInternal = () => {
|
|
1083
|
-
const queryClient2 = (0,
|
|
1084
|
-
const { mutate, isLoading, error, data } = (0,
|
|
1030
|
+
const queryClient2 = (0, import_react_query5.useQueryClient)();
|
|
1031
|
+
const { mutate, isLoading, error, data } = (0, import_react_query5.useMutation)(
|
|
1085
1032
|
({ user, password }) => convertToInternal(user._links.convertToInternal.href, password),
|
|
1086
1033
|
{
|
|
1087
1034
|
onSuccess: async (_, { user }) => {
|
|
@@ -1098,8 +1045,8 @@ var useConvertToInternal = () => {
|
|
|
1098
1045
|
};
|
|
1099
1046
|
};
|
|
1100
1047
|
var useConvertToExternal = () => {
|
|
1101
|
-
const queryClient2 = (0,
|
|
1102
|
-
const { mutate, isLoading, error, data } = (0,
|
|
1048
|
+
const queryClient2 = (0, import_react_query5.useQueryClient)();
|
|
1049
|
+
const { mutate, isLoading, error, data } = (0, import_react_query5.useMutation)(
|
|
1103
1050
|
(user) => convertToExternal(user._links.convertToExternal.href),
|
|
1104
1051
|
{
|
|
1105
1052
|
onSuccess: async (_, user) => {
|
|
@@ -1117,7 +1064,7 @@ var useConvertToExternal = () => {
|
|
|
1117
1064
|
};
|
|
1118
1065
|
var CONTENT_TYPE_PASSWORD_OVERWRITE = "application/vnd.scmm-passwordOverwrite+json;v=2";
|
|
1119
1066
|
var useSetUserPassword = (user) => {
|
|
1120
|
-
const { data, isLoading, error, mutate, reset: reset2 } = (0,
|
|
1067
|
+
const { data, isLoading, error, mutate, reset: reset2 } = (0, import_react_query5.useMutation)(
|
|
1121
1068
|
(password) => apiClient.put(
|
|
1122
1069
|
requiredLink(user, "password"),
|
|
1123
1070
|
{
|
|
@@ -1136,7 +1083,7 @@ var useSetUserPassword = (user) => {
|
|
|
1136
1083
|
};
|
|
1137
1084
|
var CONTENT_TYPE_PASSWORD_CHANGE = "application/vnd.scmm-passwordChange+json;v=2";
|
|
1138
1085
|
var useChangeUserPassword = (user) => {
|
|
1139
|
-
const { data, isLoading, error, mutate, reset: reset2 } = (0,
|
|
1086
|
+
const { data, isLoading, error, mutate, reset: reset2 } = (0, import_react_query5.useMutation)(
|
|
1140
1087
|
(request) => apiClient.put(requiredLink(user, "password"), request, CONTENT_TYPE_PASSWORD_CHANGE)
|
|
1141
1088
|
);
|
|
1142
1089
|
return {
|
|
@@ -1189,7 +1136,7 @@ var useNamespaceSuggestions = () => {
|
|
|
1189
1136
|
};
|
|
1190
1137
|
|
|
1191
1138
|
// src/repositories.ts
|
|
1192
|
-
var
|
|
1139
|
+
var import_react_query6 = require("react-query");
|
|
1193
1140
|
|
|
1194
1141
|
// src/keys.ts
|
|
1195
1142
|
var repoQueryKey = (repository, ...values) => {
|
|
@@ -1211,10 +1158,10 @@ var branchQueryKey = (repository, branch, ...values) => {
|
|
|
1211
1158
|
};
|
|
1212
1159
|
|
|
1213
1160
|
// src/repositories.ts
|
|
1214
|
-
var
|
|
1161
|
+
var import_react3 = require("react");
|
|
1215
1162
|
var useRepositories = (request) => {
|
|
1216
1163
|
var _a, _b, _c;
|
|
1217
|
-
const queryClient2 = (0,
|
|
1164
|
+
const queryClient2 = (0, import_react_query6.useQueryClient)();
|
|
1218
1165
|
const indexLink = useRequiredIndexLink("repositories");
|
|
1219
1166
|
const namespaceLink = (_b = (_a = request == null ? void 0 : request.namespace) == null ? void 0 : _a._links.repositories) == null ? void 0 : _b.href;
|
|
1220
1167
|
const link = namespaceLink || indexLink;
|
|
@@ -1231,7 +1178,7 @@ var useRepositories = (request) => {
|
|
|
1231
1178
|
if (request == null ? void 0 : request.page) {
|
|
1232
1179
|
queryParams.page = request.page.toString();
|
|
1233
1180
|
}
|
|
1234
|
-
return (0,
|
|
1181
|
+
return (0, import_react_query6.useQuery)(
|
|
1235
1182
|
["repositories", (_c = request == null ? void 0 : request.namespace) == null ? void 0 : _c.namespace, (request == null ? void 0 : request.search) || "", (request == null ? void 0 : request.page) || 0],
|
|
1236
1183
|
() => apiClient.get(`${link}?${createQueryString(queryParams)}`).then((response) => response.json()),
|
|
1237
1184
|
{
|
|
@@ -1261,9 +1208,9 @@ var createRepository = (link) => {
|
|
|
1261
1208
|
};
|
|
1262
1209
|
};
|
|
1263
1210
|
var useCreateRepository = () => {
|
|
1264
|
-
const queryClient2 = (0,
|
|
1211
|
+
const queryClient2 = (0, import_react_query6.useQueryClient)();
|
|
1265
1212
|
const link = useRequiredIndexLink("repositories");
|
|
1266
|
-
const { mutate, data, isLoading, error } = (0,
|
|
1213
|
+
const { mutate, data, isLoading, error } = (0, import_react_query6.useMutation)(
|
|
1267
1214
|
createRepository(link),
|
|
1268
1215
|
{
|
|
1269
1216
|
onSuccess: (repository) => {
|
|
@@ -1284,7 +1231,7 @@ var useCreateRepository = () => {
|
|
|
1284
1231
|
var useRepositoryTypes = () => useIndexJsonResource("repositoryTypes");
|
|
1285
1232
|
var useRepository = (namespace, name) => {
|
|
1286
1233
|
const link = useRequiredIndexLink("repositories");
|
|
1287
|
-
return (0,
|
|
1234
|
+
return (0, import_react_query6.useQuery)(
|
|
1288
1235
|
["repository", namespace, name],
|
|
1289
1236
|
() => apiClient.get(concat(link, namespace, name)).then((response) => response.json()),
|
|
1290
1237
|
{
|
|
@@ -1293,8 +1240,8 @@ var useRepository = (namespace, name) => {
|
|
|
1293
1240
|
);
|
|
1294
1241
|
};
|
|
1295
1242
|
var useDeleteRepository = (options) => {
|
|
1296
|
-
const queryClient2 = (0,
|
|
1297
|
-
const { mutate, isLoading, error, data } = (0,
|
|
1243
|
+
const queryClient2 = (0, import_react_query6.useQueryClient)();
|
|
1244
|
+
const { mutate, isLoading, error, data } = (0, import_react_query6.useMutation)(
|
|
1298
1245
|
(repository) => {
|
|
1299
1246
|
const link = requiredLink(repository, "delete");
|
|
1300
1247
|
return apiClient.delete(link);
|
|
@@ -1317,8 +1264,8 @@ var useDeleteRepository = (options) => {
|
|
|
1317
1264
|
};
|
|
1318
1265
|
};
|
|
1319
1266
|
var useUpdateRepository = () => {
|
|
1320
|
-
const queryClient2 = (0,
|
|
1321
|
-
const { mutate, isLoading, error, data } = (0,
|
|
1267
|
+
const queryClient2 = (0, import_react_query6.useQueryClient)();
|
|
1268
|
+
const { mutate, isLoading, error, data } = (0, import_react_query6.useMutation)(
|
|
1322
1269
|
(repository) => {
|
|
1323
1270
|
const link = requiredLink(repository, "update");
|
|
1324
1271
|
return apiClient.put(link, repository, "application/vnd.scmm-repository+json;v=2");
|
|
@@ -1338,8 +1285,8 @@ var useUpdateRepository = () => {
|
|
|
1338
1285
|
};
|
|
1339
1286
|
};
|
|
1340
1287
|
var useArchiveRepository = () => {
|
|
1341
|
-
const queryClient2 = (0,
|
|
1342
|
-
const { mutate, isLoading, error, data } = (0,
|
|
1288
|
+
const queryClient2 = (0, import_react_query6.useQueryClient)();
|
|
1289
|
+
const { mutate, isLoading, error, data } = (0, import_react_query6.useMutation)(
|
|
1343
1290
|
(repository) => {
|
|
1344
1291
|
const link = requiredLink(repository, "archive");
|
|
1345
1292
|
return apiClient.post(link);
|
|
@@ -1359,8 +1306,8 @@ var useArchiveRepository = () => {
|
|
|
1359
1306
|
};
|
|
1360
1307
|
};
|
|
1361
1308
|
var useUnarchiveRepository = () => {
|
|
1362
|
-
const queryClient2 = (0,
|
|
1363
|
-
const { mutate, isLoading, error, data } = (0,
|
|
1309
|
+
const queryClient2 = (0, import_react_query6.useQueryClient)();
|
|
1310
|
+
const { mutate, isLoading, error, data } = (0, import_react_query6.useMutation)(
|
|
1364
1311
|
(repository) => {
|
|
1365
1312
|
const link = requiredLink(repository, "unarchive");
|
|
1366
1313
|
return apiClient.post(link);
|
|
@@ -1380,8 +1327,8 @@ var useUnarchiveRepository = () => {
|
|
|
1380
1327
|
};
|
|
1381
1328
|
};
|
|
1382
1329
|
var useRunHealthCheck = () => {
|
|
1383
|
-
const queryClient2 = (0,
|
|
1384
|
-
const { mutate, isLoading, error, data } = (0,
|
|
1330
|
+
const queryClient2 = (0, import_react_query6.useQueryClient)();
|
|
1331
|
+
const { mutate, isLoading, error, data } = (0, import_react_query6.useMutation)(
|
|
1385
1332
|
(repository) => {
|
|
1386
1333
|
const link = requiredLink(repository, "runHealthCheck");
|
|
1387
1334
|
return apiClient.post(link);
|
|
@@ -1401,7 +1348,7 @@ var useRunHealthCheck = () => {
|
|
|
1401
1348
|
};
|
|
1402
1349
|
var useExportInfo = (repository) => {
|
|
1403
1350
|
const link = requiredLink(repository, "exportInfo");
|
|
1404
|
-
const { isLoading, isFetching, error, data } = (0,
|
|
1351
|
+
const { isLoading, isFetching, error, data } = (0, import_react_query6.useQuery)(
|
|
1405
1352
|
["repository", repository.namespace, repository.name, "exportInfo"],
|
|
1406
1353
|
() => apiClient.get(link).then((response) => response.json()),
|
|
1407
1354
|
{}
|
|
@@ -1415,16 +1362,16 @@ var useExportInfo = (repository) => {
|
|
|
1415
1362
|
};
|
|
1416
1363
|
var EXPORT_MEDIA_TYPE = "application/vnd.scmm-repositoryExport+json;v=2";
|
|
1417
1364
|
var useExportRepository = () => {
|
|
1418
|
-
const queryClient2 = (0,
|
|
1419
|
-
const [intervalId, setIntervalId] = (0,
|
|
1420
|
-
(0,
|
|
1365
|
+
const queryClient2 = (0, import_react_query6.useQueryClient)();
|
|
1366
|
+
const [intervalId, setIntervalId] = (0, import_react3.useState)();
|
|
1367
|
+
(0, import_react3.useEffect)(() => {
|
|
1421
1368
|
return () => {
|
|
1422
1369
|
if (intervalId) {
|
|
1423
1370
|
clearInterval(intervalId);
|
|
1424
1371
|
}
|
|
1425
1372
|
};
|
|
1426
1373
|
}, [intervalId]);
|
|
1427
|
-
const { mutate, isLoading, error, data } = (0,
|
|
1374
|
+
const { mutate, isLoading, error, data } = (0, import_react_query6.useMutation)(
|
|
1428
1375
|
({ repository, options }) => {
|
|
1429
1376
|
const infolink = requiredLink(repository, "exportInfo");
|
|
1430
1377
|
let link = requiredLink(repository, options.withMetadata ? "fullExport" : "export");
|
|
@@ -1464,18 +1411,18 @@ var useExportRepository = () => {
|
|
|
1464
1411
|
};
|
|
1465
1412
|
var usePaths = (repository, revision) => {
|
|
1466
1413
|
const link = requiredLink(repository, "paths").replace("{revision}", revision);
|
|
1467
|
-
return (0,
|
|
1414
|
+
return (0, import_react_query6.useQuery)(
|
|
1468
1415
|
repoQueryKey(repository, "paths", revision),
|
|
1469
1416
|
() => apiClient.get(link).then((response) => response.json())
|
|
1470
1417
|
);
|
|
1471
1418
|
};
|
|
1472
1419
|
var useRenameRepository = (repository) => {
|
|
1473
|
-
const queryClient2 = (0,
|
|
1420
|
+
const queryClient2 = (0, import_react_query6.useQueryClient)();
|
|
1474
1421
|
const url = objectLink(repository, "renameWithNamespace") || objectLink(repository, "rename");
|
|
1475
1422
|
if (!url) {
|
|
1476
1423
|
throw new MissingLinkError(`could not find rename link on repository ${repository.namespace}/${repository.name}`);
|
|
1477
1424
|
}
|
|
1478
|
-
const { mutate, isLoading, error, data } = (0,
|
|
1425
|
+
const { mutate, isLoading, error, data } = (0, import_react_query6.useMutation)(
|
|
1479
1426
|
({ name, namespace }) => apiClient.post(url, { namespace, name }, "application/vnd.scmm-repository+json;v=2"),
|
|
1480
1427
|
{
|
|
1481
1428
|
onSuccess: () => queryClient2.removeQueries(repoQueryKey(repository))
|
|
@@ -1489,8 +1436,8 @@ var useRenameRepository = (repository) => {
|
|
|
1489
1436
|
};
|
|
1490
1437
|
};
|
|
1491
1438
|
var useReindexRepository = () => {
|
|
1492
|
-
const queryClient2 = (0,
|
|
1493
|
-
const { mutate, isLoading, error, data } = (0,
|
|
1439
|
+
const queryClient2 = (0, import_react_query6.useQueryClient)();
|
|
1440
|
+
const { mutate, isLoading, error, data } = (0, import_react_query6.useMutation)(
|
|
1494
1441
|
(repository) => {
|
|
1495
1442
|
const link = requiredLink(repository, "reindex");
|
|
1496
1443
|
return apiClient.post(link);
|
|
@@ -1510,13 +1457,13 @@ var useReindexRepository = () => {
|
|
|
1510
1457
|
};
|
|
1511
1458
|
|
|
1512
1459
|
// src/namespaces.ts
|
|
1513
|
-
var
|
|
1460
|
+
var import_react_query7 = require("react-query");
|
|
1514
1461
|
var useNamespaces = () => {
|
|
1515
1462
|
return useIndexJsonResource("namespaces");
|
|
1516
1463
|
};
|
|
1517
1464
|
var useNamespace = (name) => {
|
|
1518
1465
|
const namespacesLink = useRequiredIndexLink("namespaces");
|
|
1519
|
-
return (0,
|
|
1466
|
+
return (0, import_react_query7.useQuery)(
|
|
1520
1467
|
["namespace", name],
|
|
1521
1468
|
() => apiClient.get(concat(namespacesLink, name)).then((response) => response.json()),
|
|
1522
1469
|
{
|
|
@@ -1529,12 +1476,12 @@ var useNamespaceStrategies = () => {
|
|
|
1529
1476
|
};
|
|
1530
1477
|
|
|
1531
1478
|
// src/branches.ts
|
|
1532
|
-
var
|
|
1533
|
-
var
|
|
1479
|
+
var import_react_query8 = require("react-query");
|
|
1480
|
+
var import_react4 = require("react");
|
|
1534
1481
|
var useBranchesIfAvailable = (repository) => {
|
|
1535
|
-
const queryClient2 = (0,
|
|
1482
|
+
const queryClient2 = (0, import_react_query8.useQueryClient)();
|
|
1536
1483
|
const link = objectLink(repository, "branches");
|
|
1537
|
-
return (0,
|
|
1484
|
+
return (0, import_react_query8.useQuery)(
|
|
1538
1485
|
repoQueryKey(repository, "branches"),
|
|
1539
1486
|
() => {
|
|
1540
1487
|
if (!link) {
|
|
@@ -1551,9 +1498,9 @@ var useBranchesIfAvailable = (repository) => {
|
|
|
1551
1498
|
);
|
|
1552
1499
|
};
|
|
1553
1500
|
var useBranches = (repository) => {
|
|
1554
|
-
const queryClient2 = (0,
|
|
1501
|
+
const queryClient2 = (0, import_react_query8.useQueryClient)();
|
|
1555
1502
|
const link = requiredLink(repository, "branches");
|
|
1556
|
-
return (0,
|
|
1503
|
+
return (0, import_react_query8.useQuery)(
|
|
1557
1504
|
repoQueryKey(repository, "branches"),
|
|
1558
1505
|
() => apiClient.get(link).then((response) => response.json()),
|
|
1559
1506
|
{
|
|
@@ -1565,7 +1512,7 @@ var useBranches = (repository) => {
|
|
|
1565
1512
|
};
|
|
1566
1513
|
var useBranch = (repository, name) => {
|
|
1567
1514
|
const link = requiredLink(repository, "branches");
|
|
1568
|
-
return (0,
|
|
1515
|
+
return (0, import_react_query8.useQuery)(
|
|
1569
1516
|
branchQueryKey(repository, name),
|
|
1570
1517
|
() => apiClient.get(concat(link, encodeURIComponent(name))).then((response) => response.json())
|
|
1571
1518
|
);
|
|
@@ -1598,8 +1545,8 @@ var useBranchDetailsCollection = (repository, branches) => {
|
|
|
1598
1545
|
var _a;
|
|
1599
1546
|
const link = requiredLink(repository, "branchDetailsCollection");
|
|
1600
1547
|
const chunks = chunkBranches(branches);
|
|
1601
|
-
const queryClient2 = (0,
|
|
1602
|
-
const { data, isLoading, error, fetchNextPage } = (0,
|
|
1548
|
+
const queryClient2 = (0, import_react_query8.useQueryClient)();
|
|
1549
|
+
const { data, isLoading, error, fetchNextPage } = (0, import_react_query8.useInfiniteQuery)(
|
|
1603
1550
|
branchDetailsQueryKey(repository),
|
|
1604
1551
|
({ pageParam = 0 }) => {
|
|
1605
1552
|
var _a2;
|
|
@@ -1621,7 +1568,7 @@ var useBranchDetailsCollection = (repository, branches) => {
|
|
|
1621
1568
|
}
|
|
1622
1569
|
}
|
|
1623
1570
|
);
|
|
1624
|
-
(0,
|
|
1571
|
+
(0, import_react4.useEffect)(() => {
|
|
1625
1572
|
fetchNextPage();
|
|
1626
1573
|
}, [data, fetchNextPage]);
|
|
1627
1574
|
return {
|
|
@@ -1636,7 +1583,7 @@ var useBranchDetailsCollection = (repository, branches) => {
|
|
|
1636
1583
|
var useBranchDetails = (repository, branch) => {
|
|
1637
1584
|
const link = branch._links.details.href;
|
|
1638
1585
|
const queryKey = branchDetailsQueryKey(repository, branch.name);
|
|
1639
|
-
return (0,
|
|
1586
|
+
return (0, import_react_query8.useQuery)(queryKey, () => apiClient.get(link).then((response) => response.json()));
|
|
1640
1587
|
};
|
|
1641
1588
|
var createBranch = (link) => {
|
|
1642
1589
|
return (branch) => {
|
|
@@ -1650,9 +1597,9 @@ var createBranch = (link) => {
|
|
|
1650
1597
|
};
|
|
1651
1598
|
};
|
|
1652
1599
|
var useCreateBranch = (repository) => {
|
|
1653
|
-
const queryClient2 = (0,
|
|
1600
|
+
const queryClient2 = (0, import_react_query8.useQueryClient)();
|
|
1654
1601
|
const link = requiredLink(repository, "branches");
|
|
1655
|
-
const { mutate, isLoading, error, data } = (0,
|
|
1602
|
+
const { mutate, isLoading, error, data } = (0, import_react_query8.useMutation)(createBranch(link), {
|
|
1656
1603
|
onSuccess: async (branch) => {
|
|
1657
1604
|
queryClient2.setQueryData(branchQueryKey(repository, branch), branch);
|
|
1658
1605
|
await queryClient2.invalidateQueries(repoQueryKey(repository, "branches"));
|
|
@@ -1666,8 +1613,8 @@ var useCreateBranch = (repository) => {
|
|
|
1666
1613
|
};
|
|
1667
1614
|
};
|
|
1668
1615
|
var useDeleteBranch = (repository) => {
|
|
1669
|
-
const queryClient2 = (0,
|
|
1670
|
-
const { mutate, isLoading, error, data } = (0,
|
|
1616
|
+
const queryClient2 = (0, import_react_query8.useQueryClient)();
|
|
1617
|
+
const { mutate, isLoading, error, data } = (0, import_react_query8.useMutation)(
|
|
1671
1618
|
(branch) => {
|
|
1672
1619
|
const deleteUrl = branch._links.delete.href;
|
|
1673
1620
|
return apiClient.delete(deleteUrl);
|
|
@@ -1688,19 +1635,19 @@ var useDeleteBranch = (repository) => {
|
|
|
1688
1635
|
};
|
|
1689
1636
|
var useDefaultBranch = (repository) => {
|
|
1690
1637
|
const link = requiredLink(repository, "defaultBranch");
|
|
1691
|
-
return (0,
|
|
1638
|
+
return (0, import_react_query8.useQuery)(
|
|
1692
1639
|
branchQueryKey(repository, "__default-branch"),
|
|
1693
1640
|
() => apiClient.get(link).then((response) => response.json())
|
|
1694
1641
|
);
|
|
1695
1642
|
};
|
|
1696
1643
|
|
|
1697
1644
|
// src/changesets.ts
|
|
1698
|
-
var
|
|
1645
|
+
var import_react_query9 = require("react-query");
|
|
1699
1646
|
var changesetQueryKey = (repository, id) => {
|
|
1700
1647
|
return repoQueryKey(repository, "changeset", id);
|
|
1701
1648
|
};
|
|
1702
1649
|
var useChangesets = (repository, request) => {
|
|
1703
|
-
const queryClient2 = (0,
|
|
1650
|
+
const queryClient2 = (0, import_react_query9.useQueryClient)();
|
|
1704
1651
|
let link;
|
|
1705
1652
|
let branch = "_";
|
|
1706
1653
|
if (request == null ? void 0 : request.branch) {
|
|
@@ -1719,7 +1666,7 @@ var useChangesets = (repository, request) => {
|
|
|
1719
1666
|
}
|
|
1720
1667
|
}
|
|
1721
1668
|
const key = branchQueryKey(repository, branch, "changesets", (request == null ? void 0 : request.page) || 0);
|
|
1722
|
-
return (0,
|
|
1669
|
+
return (0, import_react_query9.useQuery)(key, () => apiClient.get(link).then((response) => response.json()), {
|
|
1723
1670
|
onSuccess: (changesetCollection) => {
|
|
1724
1671
|
var _a;
|
|
1725
1672
|
(_a = changesetCollection._embedded) == null ? void 0 : _a.changesets.forEach((changeset) => {
|
|
@@ -1730,17 +1677,17 @@ var useChangesets = (repository, request) => {
|
|
|
1730
1677
|
};
|
|
1731
1678
|
var useChangeset = (repository, id) => {
|
|
1732
1679
|
const changesetsLink = requiredLink(repository, "changesets");
|
|
1733
|
-
return (0,
|
|
1680
|
+
return (0, import_react_query9.useQuery)(
|
|
1734
1681
|
changesetQueryKey(repository, id),
|
|
1735
1682
|
() => apiClient.get(concat(changesetsLink, id)).then((response) => response.json())
|
|
1736
1683
|
);
|
|
1737
1684
|
};
|
|
1738
1685
|
|
|
1739
1686
|
// src/revert.ts
|
|
1740
|
-
var
|
|
1687
|
+
var import_react_query10 = require("react-query");
|
|
1741
1688
|
var useRevert = (changeset) => {
|
|
1742
1689
|
const link = requiredLink(changeset, "revert");
|
|
1743
|
-
const { isLoading, error, mutate, data } = (0,
|
|
1690
|
+
const { isLoading, error, mutate, data } = (0, import_react_query10.useMutation)({
|
|
1744
1691
|
mutationFn: async (request) => {
|
|
1745
1692
|
const response = await apiClient.post(link, request, "application/vnd.scmm-revert+json;v=2");
|
|
1746
1693
|
return await response.json();
|
|
@@ -1755,20 +1702,20 @@ var useRevert = (changeset) => {
|
|
|
1755
1702
|
};
|
|
1756
1703
|
|
|
1757
1704
|
// src/tags.ts
|
|
1758
|
-
var
|
|
1705
|
+
var import_react_query11 = require("react-query");
|
|
1759
1706
|
var tagQueryKey = (repository, tag) => {
|
|
1760
1707
|
return repoQueryKey(repository, "tag", tag);
|
|
1761
1708
|
};
|
|
1762
1709
|
var useTags = (repository) => {
|
|
1763
1710
|
const link = requiredLink(repository, "tags");
|
|
1764
|
-
return (0,
|
|
1711
|
+
return (0, import_react_query11.useQuery)(
|
|
1765
1712
|
repoQueryKey(repository, "tags"),
|
|
1766
1713
|
() => apiClient.get(link).then((response) => response.json())
|
|
1767
1714
|
);
|
|
1768
1715
|
};
|
|
1769
1716
|
var useContainedInTags = (changeset, repository) => {
|
|
1770
1717
|
const link = objectLink(changeset, "containedInTags");
|
|
1771
|
-
return (0,
|
|
1718
|
+
return (0, import_react_query11.useQuery)(repoQueryKey(repository, "tags", changeset.id), () => {
|
|
1772
1719
|
if (link === null) {
|
|
1773
1720
|
return {
|
|
1774
1721
|
_embedded: {
|
|
@@ -1782,7 +1729,7 @@ var useContainedInTags = (changeset, repository) => {
|
|
|
1782
1729
|
};
|
|
1783
1730
|
var useTag = (repository, name) => {
|
|
1784
1731
|
const link = requiredLink(repository, "tags");
|
|
1785
|
-
return (0,
|
|
1732
|
+
return (0, import_react_query11.useQuery)(
|
|
1786
1733
|
tagQueryKey(repository, name),
|
|
1787
1734
|
() => apiClient.get(concat(link, encodeURIComponent(name))).then((response) => response.json())
|
|
1788
1735
|
);
|
|
@@ -1813,9 +1760,9 @@ var createTag = (changeset, link) => {
|
|
|
1813
1760
|
};
|
|
1814
1761
|
};
|
|
1815
1762
|
var useCreateTag = (repository, changeset) => {
|
|
1816
|
-
const queryClient2 = (0,
|
|
1763
|
+
const queryClient2 = (0, import_react_query11.useQueryClient)();
|
|
1817
1764
|
const link = requiredLink(changeset, "tag");
|
|
1818
|
-
const { isLoading, error, mutate, data } = (0,
|
|
1765
|
+
const { isLoading, error, mutate, data } = (0, import_react_query11.useMutation)(createTag(changeset, link), {
|
|
1819
1766
|
onSuccess: async (tag) => {
|
|
1820
1767
|
queryClient2.setQueryData(tagQueryKey(repository, tag.name), tag);
|
|
1821
1768
|
await queryClient2.invalidateQueries(tagQueryKey(repository, tag.name));
|
|
@@ -1830,8 +1777,8 @@ var useCreateTag = (repository, changeset) => {
|
|
|
1830
1777
|
};
|
|
1831
1778
|
};
|
|
1832
1779
|
var useDeleteTag = (repository) => {
|
|
1833
|
-
const queryClient2 = (0,
|
|
1834
|
-
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)(
|
|
1835
1782
|
(tag) => {
|
|
1836
1783
|
const deleteUrl = tag._links.delete.href;
|
|
1837
1784
|
return apiClient.delete(deleteUrl);
|
|
@@ -1852,16 +1799,16 @@ var useDeleteTag = (repository) => {
|
|
|
1852
1799
|
};
|
|
1853
1800
|
|
|
1854
1801
|
// src/config.ts
|
|
1855
|
-
var
|
|
1802
|
+
var import_react_query12 = require("react-query");
|
|
1856
1803
|
var useConfig = () => {
|
|
1857
1804
|
const indexLink = useIndexLink("config");
|
|
1858
|
-
return (0,
|
|
1805
|
+
return (0, import_react_query12.useQuery)("config", () => apiClient.get(indexLink).then((response) => response.json()), {
|
|
1859
1806
|
enabled: !!indexLink
|
|
1860
1807
|
});
|
|
1861
1808
|
};
|
|
1862
1809
|
var useUpdateConfig = () => {
|
|
1863
|
-
const queryClient2 = (0,
|
|
1864
|
-
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)(
|
|
1865
1812
|
(config) => {
|
|
1866
1813
|
const updateUrl = requiredLink(config, "update");
|
|
1867
1814
|
return apiClient.put(updateUrl, config, "application/vnd.scmm-config+json;v=2");
|
|
@@ -1884,10 +1831,10 @@ var useUpdateConfig = () => {
|
|
|
1884
1831
|
};
|
|
1885
1832
|
|
|
1886
1833
|
// src/admin.ts
|
|
1887
|
-
var
|
|
1834
|
+
var import_react_query13 = require("react-query");
|
|
1888
1835
|
var useUpdateInfo = () => {
|
|
1889
1836
|
const indexLink = useIndexLink("updateInfo");
|
|
1890
|
-
return (0,
|
|
1837
|
+
return (0, import_react_query13.useQuery)(
|
|
1891
1838
|
"updateInfo",
|
|
1892
1839
|
() => {
|
|
1893
1840
|
if (!indexLink) {
|
|
@@ -1900,7 +1847,7 @@ var useUpdateInfo = () => {
|
|
|
1900
1847
|
};
|
|
1901
1848
|
|
|
1902
1849
|
// src/plugins.ts
|
|
1903
|
-
var
|
|
1850
|
+
var import_react_query14 = require("react-query");
|
|
1904
1851
|
var isPluginCollection = (input) => input._embedded ? "plugins" in input._embedded : false;
|
|
1905
1852
|
var waitForRestartAfter = (promise, { initialDelay = 1e3, timeout = 500 } = {}) => {
|
|
1906
1853
|
const endTime = Number(new Date()) + 4 * 60 * 1e3;
|
|
@@ -1928,7 +1875,7 @@ var waitForRestartAfter = (promise, { initialDelay = 1e3, timeout = 500 } = {})
|
|
|
1928
1875
|
};
|
|
1929
1876
|
var useAvailablePlugins = ({ enabled } = {}) => {
|
|
1930
1877
|
const indexLink = useRequiredIndexLink("availablePlugins");
|
|
1931
|
-
return (0,
|
|
1878
|
+
return (0, import_react_query14.useQuery)(
|
|
1932
1879
|
["plugins", "available"],
|
|
1933
1880
|
() => apiClient.get(indexLink).then((response) => response.json()),
|
|
1934
1881
|
{
|
|
@@ -1939,7 +1886,7 @@ var useAvailablePlugins = ({ enabled } = {}) => {
|
|
|
1939
1886
|
};
|
|
1940
1887
|
var useInstalledPlugins = ({ enabled } = {}) => {
|
|
1941
1888
|
const indexLink = useRequiredIndexLink("installedPlugins");
|
|
1942
|
-
return (0,
|
|
1889
|
+
return (0, import_react_query14.useQuery)(
|
|
1943
1890
|
["plugins", "installed"],
|
|
1944
1891
|
() => apiClient.get(indexLink).then((response) => response.json()),
|
|
1945
1892
|
{
|
|
@@ -1950,7 +1897,7 @@ var useInstalledPlugins = ({ enabled } = {}) => {
|
|
|
1950
1897
|
};
|
|
1951
1898
|
var usePendingPlugins = () => {
|
|
1952
1899
|
const indexLink = useIndexLink("pendingPlugins");
|
|
1953
|
-
return (0,
|
|
1900
|
+
return (0, import_react_query14.useQuery)(
|
|
1954
1901
|
["plugins", "pending"],
|
|
1955
1902
|
() => apiClient.get(indexLink).then((response) => response.json()),
|
|
1956
1903
|
{
|
|
@@ -1966,8 +1913,8 @@ var linkWithRestart = (link, restart) => {
|
|
|
1966
1913
|
return link;
|
|
1967
1914
|
};
|
|
1968
1915
|
var useInstallPlugin = () => {
|
|
1969
|
-
const queryClient2 = (0,
|
|
1970
|
-
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)(
|
|
1971
1918
|
({ plugin, restartOptions: { restart, ...waitForRestartOptions } }) => {
|
|
1972
1919
|
const promise = apiClient.post(requiredLink(plugin, linkWithRestart("install", restart)));
|
|
1973
1920
|
if (restart) {
|
|
@@ -1991,8 +1938,8 @@ var useInstallPlugin = () => {
|
|
|
1991
1938
|
};
|
|
1992
1939
|
};
|
|
1993
1940
|
var useUninstallPlugin = () => {
|
|
1994
|
-
const queryClient2 = (0,
|
|
1995
|
-
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)(
|
|
1996
1943
|
({ plugin, restartOptions: { restart, ...waitForRestartOptions } }) => {
|
|
1997
1944
|
const promise = apiClient.post(requiredLink(plugin, linkWithRestart("uninstall", restart)));
|
|
1998
1945
|
if (restart) {
|
|
@@ -2015,8 +1962,8 @@ var useUninstallPlugin = () => {
|
|
|
2015
1962
|
};
|
|
2016
1963
|
};
|
|
2017
1964
|
var useUpdatePlugins = () => {
|
|
2018
|
-
const queryClient2 = (0,
|
|
2019
|
-
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)(
|
|
2020
1967
|
({ plugins, restartOptions: { restart, ...waitForRestartOptions } }) => {
|
|
2021
1968
|
const isCollection = isPluginCollection(plugins);
|
|
2022
1969
|
const promise = apiClient.post(
|
|
@@ -2042,8 +1989,8 @@ var useUpdatePlugins = () => {
|
|
|
2042
1989
|
};
|
|
2043
1990
|
};
|
|
2044
1991
|
var useExecutePendingPlugins = () => {
|
|
2045
|
-
const queryClient2 = (0,
|
|
2046
|
-
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)(
|
|
2047
1994
|
({ pending, restartOptions }) => waitForRestartAfter(apiClient.post(requiredLink(pending, "execute")), restartOptions),
|
|
2048
1995
|
{
|
|
2049
1996
|
onSuccess: () => queryClient2.invalidateQueries("plugins")
|
|
@@ -2057,8 +2004,8 @@ var useExecutePendingPlugins = () => {
|
|
|
2057
2004
|
};
|
|
2058
2005
|
};
|
|
2059
2006
|
var useCancelPendingPlugins = () => {
|
|
2060
|
-
const queryClient2 = (0,
|
|
2061
|
-
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)(
|
|
2062
2009
|
(pending) => apiClient.post(requiredLink(pending, "cancel")),
|
|
2063
2010
|
{
|
|
2064
2011
|
onSuccess: () => queryClient2.invalidateQueries("plugins")
|
|
@@ -2073,15 +2020,15 @@ var useCancelPendingPlugins = () => {
|
|
|
2073
2020
|
};
|
|
2074
2021
|
|
|
2075
2022
|
// src/repository-roles.ts
|
|
2076
|
-
var
|
|
2023
|
+
var import_react_query15 = require("react-query");
|
|
2077
2024
|
var useRepositoryRoles = (request) => {
|
|
2078
|
-
const queryClient2 = (0,
|
|
2025
|
+
const queryClient2 = (0, import_react_query15.useQueryClient)();
|
|
2079
2026
|
const indexLink = useRequiredIndexLink("repositoryRoles");
|
|
2080
2027
|
const queryParams = {};
|
|
2081
2028
|
if (request == null ? void 0 : request.page) {
|
|
2082
2029
|
queryParams.page = request.page.toString();
|
|
2083
2030
|
}
|
|
2084
|
-
return (0,
|
|
2031
|
+
return (0, import_react_query15.useQuery)(
|
|
2085
2032
|
["repositoryRoles", (request == null ? void 0 : request.page) || 0],
|
|
2086
2033
|
() => apiClient.get(`${indexLink}?${createQueryString(queryParams)}`).then((response) => response.json()),
|
|
2087
2034
|
{
|
|
@@ -2096,7 +2043,7 @@ var useRepositoryRoles = (request) => {
|
|
|
2096
2043
|
};
|
|
2097
2044
|
var useRepositoryRole = (name) => {
|
|
2098
2045
|
const indexLink = useRequiredIndexLink("repositoryRoles");
|
|
2099
|
-
return (0,
|
|
2046
|
+
return (0, import_react_query15.useQuery)(
|
|
2100
2047
|
["repositoryRole", name],
|
|
2101
2048
|
() => apiClient.get(concat(indexLink, name)).then((response) => response.json())
|
|
2102
2049
|
);
|
|
@@ -2113,9 +2060,9 @@ var createRepositoryRole = (link) => {
|
|
|
2113
2060
|
};
|
|
2114
2061
|
};
|
|
2115
2062
|
var useCreateRepositoryRole = () => {
|
|
2116
|
-
const queryClient2 = (0,
|
|
2063
|
+
const queryClient2 = (0, import_react_query15.useQueryClient)();
|
|
2117
2064
|
const link = useRequiredIndexLink("repositoryRoles");
|
|
2118
|
-
const { mutate, data, isLoading, error } = (0,
|
|
2065
|
+
const { mutate, data, isLoading, error } = (0, import_react_query15.useMutation)(
|
|
2119
2066
|
createRepositoryRole(link),
|
|
2120
2067
|
{
|
|
2121
2068
|
onSuccess: (repositoryRole) => {
|
|
@@ -2132,8 +2079,8 @@ var useCreateRepositoryRole = () => {
|
|
|
2132
2079
|
};
|
|
2133
2080
|
};
|
|
2134
2081
|
var useUpdateRepositoryRole = () => {
|
|
2135
|
-
const queryClient2 = (0,
|
|
2136
|
-
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)(
|
|
2137
2084
|
(repositoryRole) => {
|
|
2138
2085
|
const updateUrl = requiredLink(repositoryRole, "update");
|
|
2139
2086
|
return apiClient.put(updateUrl, repositoryRole, "application/vnd.scmm-repositoryRole+json;v=2");
|
|
@@ -2153,8 +2100,8 @@ var useUpdateRepositoryRole = () => {
|
|
|
2153
2100
|
};
|
|
2154
2101
|
};
|
|
2155
2102
|
var useDeleteRepositoryRole = () => {
|
|
2156
|
-
const queryClient2 = (0,
|
|
2157
|
-
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)(
|
|
2158
2105
|
(repositoryRole) => {
|
|
2159
2106
|
const deleteUrl = requiredLink(repositoryRole, "delete");
|
|
2160
2107
|
return apiClient.delete(deleteUrl);
|
|
@@ -2175,7 +2122,7 @@ var useDeleteRepositoryRole = () => {
|
|
|
2175
2122
|
};
|
|
2176
2123
|
|
|
2177
2124
|
// src/permissions.ts
|
|
2178
|
-
var
|
|
2125
|
+
var import_react_query16 = require("react-query");
|
|
2179
2126
|
var useRepositoryVerbs = () => {
|
|
2180
2127
|
return useIndexJsonResource("repositoryVerbs");
|
|
2181
2128
|
};
|
|
@@ -2209,7 +2156,7 @@ var createQueryKey = (namespaceOrRepository) => {
|
|
|
2209
2156
|
var usePermissions = (namespaceOrRepository) => {
|
|
2210
2157
|
const link = requiredLink(namespaceOrRepository, "permissions");
|
|
2211
2158
|
const queryKey = createQueryKey(namespaceOrRepository);
|
|
2212
|
-
return (0,
|
|
2159
|
+
return (0, import_react_query16.useQuery)(queryKey, () => apiClient.get(link).then((response) => response.json()));
|
|
2213
2160
|
};
|
|
2214
2161
|
var createPermission = (link) => {
|
|
2215
2162
|
return (permission) => {
|
|
@@ -2223,9 +2170,9 @@ var createPermission = (link) => {
|
|
|
2223
2170
|
};
|
|
2224
2171
|
};
|
|
2225
2172
|
var useCreatePermission = (namespaceOrRepository) => {
|
|
2226
|
-
const queryClient2 = (0,
|
|
2173
|
+
const queryClient2 = (0, import_react_query16.useQueryClient)();
|
|
2227
2174
|
const link = requiredLink(namespaceOrRepository, "permissions");
|
|
2228
|
-
const { isLoading, error, mutate, data } = (0,
|
|
2175
|
+
const { isLoading, error, mutate, data } = (0, import_react_query16.useMutation)(
|
|
2229
2176
|
createPermission(link),
|
|
2230
2177
|
{
|
|
2231
2178
|
onSuccess: () => {
|
|
@@ -2242,8 +2189,8 @@ var useCreatePermission = (namespaceOrRepository) => {
|
|
|
2242
2189
|
};
|
|
2243
2190
|
};
|
|
2244
2191
|
var useUpdatePermission = (namespaceOrRepository) => {
|
|
2245
|
-
const queryClient2 = (0,
|
|
2246
|
-
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)(
|
|
2247
2194
|
(permission) => {
|
|
2248
2195
|
const link = requiredLink(permission, "update");
|
|
2249
2196
|
return apiClient.put(link, permission, "application/vnd.scmm-repositoryPermission+json");
|
|
@@ -2263,8 +2210,8 @@ var useUpdatePermission = (namespaceOrRepository) => {
|
|
|
2263
2210
|
};
|
|
2264
2211
|
};
|
|
2265
2212
|
var useDeletePermission = (namespaceOrRepository) => {
|
|
2266
|
-
const queryClient2 = (0,
|
|
2267
|
-
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)(
|
|
2268
2215
|
(permission) => {
|
|
2269
2216
|
const link = requiredLink(permission, "delete");
|
|
2270
2217
|
return apiClient.delete(link);
|
|
@@ -2289,9 +2236,9 @@ var useGroupPermissions = (group) => useJsonResource(group, "permissions", group
|
|
|
2289
2236
|
var useUserPermissions = (user) => useJsonResource(user, "permissions", userPermissionsKey(user));
|
|
2290
2237
|
var useAvailableGlobalPermissions = () => useIndexJsonResource("permissions");
|
|
2291
2238
|
var useSetEntityPermissions = (permissionCollection, key) => {
|
|
2292
|
-
const queryClient2 = (0,
|
|
2239
|
+
const queryClient2 = (0, import_react_query16.useQueryClient)();
|
|
2293
2240
|
const url = permissionCollection ? objectLink(permissionCollection, "overwrite") : null;
|
|
2294
|
-
const { isLoading, error, mutate, data } = (0,
|
|
2241
|
+
const { isLoading, error, mutate, data } = (0, import_react_query16.useMutation)(
|
|
2295
2242
|
(permissions) => apiClient.put(
|
|
2296
2243
|
url,
|
|
2297
2244
|
{
|
|
@@ -2315,8 +2262,8 @@ var useSetUserPermissions = (user, permissions) => useSetEntityPermissions(permi
|
|
|
2315
2262
|
var useSetGroupPermissions = (group, permissions) => useSetEntityPermissions(permissions, groupPermissionsKey(group));
|
|
2316
2263
|
|
|
2317
2264
|
// src/sources.ts
|
|
2318
|
-
var
|
|
2319
|
-
var
|
|
2265
|
+
var import_react_query17 = require("react-query");
|
|
2266
|
+
var import_react5 = require("react");
|
|
2320
2267
|
var UseSourcesDefaultOptions = {
|
|
2321
2268
|
enabled: true,
|
|
2322
2269
|
refetchPartialInterval: 3e3,
|
|
@@ -2328,7 +2275,7 @@ var useSources = (repository, opts = UseSourcesDefaultOptions) => {
|
|
|
2328
2275
|
...opts
|
|
2329
2276
|
};
|
|
2330
2277
|
const link = createSourcesLink(repository, options);
|
|
2331
|
-
const { isLoading, error, data, isFetchingNextPage, fetchNextPage, refetch } = (0,
|
|
2278
|
+
const { isLoading, error, data, isFetchingNextPage, fetchNextPage, refetch } = (0, import_react_query17.useInfiniteQuery)(
|
|
2332
2279
|
repoQueryKey(repository, "sources", options.revision || "", options.path || "", options.collapse ? "collapse" : ""),
|
|
2333
2280
|
({ pageParam }) => {
|
|
2334
2281
|
return apiClient.get(pageParam || link).then((response) => response.json());
|
|
@@ -2342,7 +2289,7 @@ var useSources = (repository, opts = UseSourcesDefaultOptions) => {
|
|
|
2342
2289
|
}
|
|
2343
2290
|
);
|
|
2344
2291
|
const file = merge(data == null ? void 0 : data.pages);
|
|
2345
|
-
(0,
|
|
2292
|
+
(0, import_react5.useEffect)(() => {
|
|
2346
2293
|
const intervalId = setInterval(() => {
|
|
2347
2294
|
if (isPartial(file)) {
|
|
2348
2295
|
refetch({
|
|
@@ -2416,14 +2363,14 @@ var isPartial = (file) => {
|
|
|
2416
2363
|
};
|
|
2417
2364
|
|
|
2418
2365
|
// src/import.ts
|
|
2419
|
-
var
|
|
2366
|
+
var import_react_query18 = require("react-query");
|
|
2420
2367
|
var useImportLog = (logId) => {
|
|
2421
2368
|
const link = useRequiredIndexLink("importLog").replace("{logId}", logId);
|
|
2422
|
-
return (0,
|
|
2369
|
+
return (0, import_react_query18.useQuery)(["importLog", logId], () => apiClient.get(link).then((response) => response.text()));
|
|
2423
2370
|
};
|
|
2424
2371
|
var useImportRepositoryFromUrl = (repositoryType) => {
|
|
2425
2372
|
const url = requiredLink(repositoryType, "import", "url");
|
|
2426
|
-
const { isLoading, error, data, mutate } = (0,
|
|
2373
|
+
const { isLoading, error, data, mutate } = (0, import_react_query18.useMutation)(
|
|
2427
2374
|
(repo) => apiClient.post(url, repo, "application/vnd.scmm-repository+json;v=2").then(fetchResourceFromLocationHeader).then(getResponseJson)
|
|
2428
2375
|
);
|
|
2429
2376
|
return {
|
|
@@ -2441,7 +2388,7 @@ var importRepository = (url, repository, file, password) => {
|
|
|
2441
2388
|
};
|
|
2442
2389
|
var useImportRepositoryFromBundle = (repositoryType) => {
|
|
2443
2390
|
const url = requiredLink(repositoryType, "import", "bundle");
|
|
2444
|
-
const { isLoading, error, data, mutate } = (0,
|
|
2391
|
+
const { isLoading, error, data, mutate } = (0, import_react_query18.useMutation)(
|
|
2445
2392
|
({ repository, file, compressed, password }) => importRepository(compressed ? url + "?compressed=true" : url, repository, file, password)
|
|
2446
2393
|
);
|
|
2447
2394
|
return {
|
|
@@ -2457,7 +2404,7 @@ var useImportRepositoryFromBundle = (repositoryType) => {
|
|
|
2457
2404
|
};
|
|
2458
2405
|
};
|
|
2459
2406
|
var useImportFullRepository = (repositoryType) => {
|
|
2460
|
-
const { isLoading, error, data, mutate } = (0,
|
|
2407
|
+
const { isLoading, error, data, mutate } = (0, import_react_query18.useMutation)(
|
|
2461
2408
|
({ repository, file, password }) => importRepository(requiredLink(repositoryType, "import", "fullImport"), repository, file, password)
|
|
2462
2409
|
);
|
|
2463
2410
|
return {
|
|
@@ -2474,7 +2421,7 @@ var useImportFullRepository = (repositoryType) => {
|
|
|
2474
2421
|
|
|
2475
2422
|
// src/diff.ts
|
|
2476
2423
|
var import_gitdiff_parser = __toESM(require("gitdiff-parser"));
|
|
2477
|
-
var
|
|
2424
|
+
var import_react_query19 = require("react-query");
|
|
2478
2425
|
var defaultOptions = {
|
|
2479
2426
|
refetchOnWindowFocus: true
|
|
2480
2427
|
};
|
|
@@ -2484,7 +2431,7 @@ var useDiff = (link, options = defaultOptions) => {
|
|
|
2484
2431
|
const separator = initialLink.includes("?") ? "&" : "?";
|
|
2485
2432
|
initialLink = `${initialLink}${separator}limit=${options.limit}&ignoreWhitespace=${options.ignoreWhitespace}`;
|
|
2486
2433
|
}
|
|
2487
|
-
const { isLoading, error, data, isFetchingNextPage, fetchNextPage } = (0,
|
|
2434
|
+
const { isLoading, error, data, isFetchingNextPage, fetchNextPage } = (0, import_react_query19.useInfiniteQuery)(
|
|
2488
2435
|
["link", link, options.ignoreWhitespace],
|
|
2489
2436
|
({ pageParam }) => {
|
|
2490
2437
|
return apiClient.get(pageParam || initialLink).then((response) => {
|
|
@@ -2532,20 +2479,20 @@ var merge2 = (diffs) => {
|
|
|
2532
2479
|
};
|
|
2533
2480
|
|
|
2534
2481
|
// src/notifications.ts
|
|
2535
|
-
var
|
|
2536
|
-
var
|
|
2482
|
+
var import_react_query20 = require("react-query");
|
|
2483
|
+
var import_react6 = require("react");
|
|
2537
2484
|
var useNotifications = () => {
|
|
2538
2485
|
var _a;
|
|
2539
2486
|
const { data: me } = useMe();
|
|
2540
2487
|
const link = (_a = me == null ? void 0 : me._links["notifications"]) == null ? void 0 : _a.href;
|
|
2541
|
-
const { data, error, isLoading, refetch } = (0,
|
|
2488
|
+
const { data, error, isLoading, refetch } = (0, import_react_query20.useQuery)(
|
|
2542
2489
|
"notifications",
|
|
2543
2490
|
() => apiClient.get(link).then((response) => response.json()),
|
|
2544
2491
|
{
|
|
2545
2492
|
enabled: !!link
|
|
2546
2493
|
}
|
|
2547
2494
|
);
|
|
2548
|
-
const memoizedRefetch = (0,
|
|
2495
|
+
const memoizedRefetch = (0, import_react6.useCallback)(() => {
|
|
2549
2496
|
return refetch().then((r) => r.data);
|
|
2550
2497
|
}, [refetch]);
|
|
2551
2498
|
return {
|
|
@@ -2556,9 +2503,9 @@ var useNotifications = () => {
|
|
|
2556
2503
|
};
|
|
2557
2504
|
};
|
|
2558
2505
|
var useDismissNotification = (notification) => {
|
|
2559
|
-
const queryClient2 = (0,
|
|
2506
|
+
const queryClient2 = (0, import_react_query20.useQueryClient)();
|
|
2560
2507
|
const link = requiredLink(notification, "dismiss");
|
|
2561
|
-
const { data, isLoading, error, mutate } = (0,
|
|
2508
|
+
const { data, isLoading, error, mutate } = (0, import_react_query20.useMutation)(() => apiClient.delete(link), {
|
|
2562
2509
|
onSuccess: () => {
|
|
2563
2510
|
queryClient2.invalidateQueries("notifications");
|
|
2564
2511
|
}
|
|
@@ -2571,9 +2518,9 @@ var useDismissNotification = (notification) => {
|
|
|
2571
2518
|
};
|
|
2572
2519
|
};
|
|
2573
2520
|
var useClearNotifications = (notificationCollection) => {
|
|
2574
|
-
const queryClient2 = (0,
|
|
2521
|
+
const queryClient2 = (0, import_react_query20.useQueryClient)();
|
|
2575
2522
|
const link = requiredLink(notificationCollection, "clear");
|
|
2576
|
-
const { data, isLoading, error, mutate } = (0,
|
|
2523
|
+
const { data, isLoading, error, mutate } = (0, import_react_query20.useMutation)(() => apiClient.delete(link), {
|
|
2577
2524
|
onSuccess: () => {
|
|
2578
2525
|
queryClient2.invalidateQueries("notifications");
|
|
2579
2526
|
}
|
|
@@ -2590,11 +2537,11 @@ var isEqual = (left, right) => {
|
|
|
2590
2537
|
};
|
|
2591
2538
|
var useNotificationSubscription = (refetch, notificationCollection) => {
|
|
2592
2539
|
var _a;
|
|
2593
|
-
const [notifications, setNotifications] = (0,
|
|
2594
|
-
const [disconnectedAt, setDisconnectedAt] = (0,
|
|
2540
|
+
const [notifications, setNotifications] = (0, import_react6.useState)([]);
|
|
2541
|
+
const [disconnectedAt, setDisconnectedAt] = (0, import_react6.useState)();
|
|
2595
2542
|
const link = (_a = notificationCollection == null ? void 0 : notificationCollection._links.subscribe) == null ? void 0 : _a.href;
|
|
2596
2543
|
const cancelOnUnmount = useCancellablePromise();
|
|
2597
|
-
const onVisible = (0,
|
|
2544
|
+
const onVisible = (0, import_react6.useCallback)(() => {
|
|
2598
2545
|
cancelOnUnmount(refetch()).then(
|
|
2599
2546
|
(collection) => {
|
|
2600
2547
|
var _a2;
|
|
@@ -2615,17 +2562,17 @@ var useNotificationSubscription = (refetch, notificationCollection) => {
|
|
|
2615
2562
|
}
|
|
2616
2563
|
);
|
|
2617
2564
|
}, [cancelOnUnmount, disconnectedAt, refetch]);
|
|
2618
|
-
const onHide = (0,
|
|
2565
|
+
const onHide = (0, import_react6.useCallback)(() => {
|
|
2619
2566
|
setDisconnectedAt(new Date());
|
|
2620
2567
|
}, []);
|
|
2621
|
-
const received = (0,
|
|
2568
|
+
const received = (0, import_react6.useCallback)(
|
|
2622
2569
|
(notification) => {
|
|
2623
2570
|
setNotifications((previous) => [...previous, notification]);
|
|
2624
2571
|
refetch();
|
|
2625
2572
|
},
|
|
2626
2573
|
[refetch]
|
|
2627
2574
|
);
|
|
2628
|
-
(0,
|
|
2575
|
+
(0, import_react6.useEffect)(() => {
|
|
2629
2576
|
if (link) {
|
|
2630
2577
|
let cancel;
|
|
2631
2578
|
const disconnect = () => {
|
|
@@ -2658,13 +2605,13 @@ var useNotificationSubscription = (refetch, notificationCollection) => {
|
|
|
2658
2605
|
};
|
|
2659
2606
|
}
|
|
2660
2607
|
}, [link, onVisible, onHide, received]);
|
|
2661
|
-
const remove = (0,
|
|
2608
|
+
const remove = (0, import_react6.useCallback)(
|
|
2662
2609
|
(notification) => {
|
|
2663
2610
|
setNotifications((oldNotifications) => [...oldNotifications.filter((n) => !isEqual(n, notification))]);
|
|
2664
2611
|
},
|
|
2665
2612
|
[setNotifications]
|
|
2666
2613
|
);
|
|
2667
|
-
const clear = (0,
|
|
2614
|
+
const clear = (0, import_react6.useCallback)(() => {
|
|
2668
2615
|
setNotifications([]);
|
|
2669
2616
|
}, [setNotifications]);
|
|
2670
2617
|
return {
|
|
@@ -2675,7 +2622,7 @@ var useNotificationSubscription = (refetch, notificationCollection) => {
|
|
|
2675
2622
|
};
|
|
2676
2623
|
|
|
2677
2624
|
// src/alerts.ts
|
|
2678
|
-
var
|
|
2625
|
+
var import_react_query21 = require("react-query");
|
|
2679
2626
|
var alertsFromStorage = () => {
|
|
2680
2627
|
const item = localStorage.getItem("alerts");
|
|
2681
2628
|
if (item) {
|
|
@@ -2717,7 +2664,7 @@ var restoreOrFetch = (request) => {
|
|
|
2717
2664
|
};
|
|
2718
2665
|
var useAlerts = () => {
|
|
2719
2666
|
const link = useIndexLink("alerts");
|
|
2720
|
-
const { data, error, isLoading } = (0,
|
|
2667
|
+
const { data, error, isLoading } = (0, import_react_query21.useQuery)(
|
|
2721
2668
|
"alerts",
|
|
2722
2669
|
() => {
|
|
2723
2670
|
if (!link) {
|
|
@@ -2738,12 +2685,12 @@ var useAlerts = () => {
|
|
|
2738
2685
|
};
|
|
2739
2686
|
|
|
2740
2687
|
// src/configLink.ts
|
|
2741
|
-
var
|
|
2742
|
-
var
|
|
2688
|
+
var import_react_query22 = require("react-query");
|
|
2689
|
+
var import_react7 = require("react");
|
|
2743
2690
|
var useConfigLink = (link) => {
|
|
2744
|
-
const queryClient2 = (0,
|
|
2691
|
+
const queryClient2 = (0, import_react_query22.useQueryClient)();
|
|
2745
2692
|
const queryKey = ["configLink", link];
|
|
2746
|
-
const { isLoading, error, data } = (0,
|
|
2693
|
+
const { isLoading, error, data } = (0, import_react_query22.useQuery)(
|
|
2747
2694
|
queryKey,
|
|
2748
2695
|
() => apiClient.get(link).then((response) => {
|
|
2749
2696
|
const contentType = response.headers.get("Content-Type") || "application/json";
|
|
@@ -2755,7 +2702,7 @@ var useConfigLink = (link) => {
|
|
|
2755
2702
|
error: mutationError,
|
|
2756
2703
|
mutateAsync,
|
|
2757
2704
|
data: updateResponse
|
|
2758
|
-
} = (0,
|
|
2705
|
+
} = (0, import_react_query22.useMutation)(
|
|
2759
2706
|
(vars) => apiClient.put(vars.link, vars.configuration, vars.contentType),
|
|
2760
2707
|
{
|
|
2761
2708
|
onSuccess: async () => {
|
|
@@ -2764,7 +2711,7 @@ var useConfigLink = (link) => {
|
|
|
2764
2711
|
}
|
|
2765
2712
|
);
|
|
2766
2713
|
const isReadOnly = !(data == null ? void 0 : data.configuration._links.update);
|
|
2767
|
-
const update = (0,
|
|
2714
|
+
const update = (0, import_react7.useCallback)(
|
|
2768
2715
|
(configuration) => {
|
|
2769
2716
|
if (data && !isReadOnly) {
|
|
2770
2717
|
return mutateAsync({
|
|
@@ -2788,9 +2735,9 @@ var useConfigLink = (link) => {
|
|
|
2788
2735
|
};
|
|
2789
2736
|
|
|
2790
2737
|
// src/apiKeys.ts
|
|
2791
|
-
var
|
|
2738
|
+
var import_react_query23 = require("react-query");
|
|
2792
2739
|
var CONTENT_TYPE_API_KEY = "application/vnd.scmm-apiKey+json;v=2";
|
|
2793
|
-
var useApiKeys = (user) => (0,
|
|
2740
|
+
var useApiKeys = (user) => (0, import_react_query23.useQuery)(["user", user.name, "apiKeys"], () => apiClient.get(requiredLink(user, "apiKeys")).then((r) => r.json()));
|
|
2794
2741
|
var createApiKey = (link) => async (key) => {
|
|
2795
2742
|
const creationResponse = await apiClient.post(link, key, CONTENT_TYPE_API_KEY);
|
|
2796
2743
|
const location = creationResponse.headers.get("Location");
|
|
@@ -2802,8 +2749,8 @@ var createApiKey = (link) => async (key) => {
|
|
|
2802
2749
|
return { ...apiKey, token };
|
|
2803
2750
|
};
|
|
2804
2751
|
var useCreateApiKey = (user, apiKeys) => {
|
|
2805
|
-
const queryClient2 = (0,
|
|
2806
|
-
const { mutate, data, isLoading, error, reset: reset2 } = (0,
|
|
2752
|
+
const queryClient2 = (0, import_react_query23.useQueryClient)();
|
|
2753
|
+
const { mutate, data, isLoading, error, reset: reset2 } = (0, import_react_query23.useMutation)(
|
|
2807
2754
|
createApiKey(requiredLink(apiKeys, "create")),
|
|
2808
2755
|
{
|
|
2809
2756
|
onSuccess: () => queryClient2.invalidateQueries(["user", user.name, "apiKeys"])
|
|
@@ -2818,8 +2765,8 @@ var useCreateApiKey = (user, apiKeys) => {
|
|
|
2818
2765
|
};
|
|
2819
2766
|
};
|
|
2820
2767
|
var useDeleteApiKey = (user) => {
|
|
2821
|
-
const queryClient2 = (0,
|
|
2822
|
-
const { mutate, isLoading, error, data } = (0,
|
|
2768
|
+
const queryClient2 = (0, import_react_query23.useQueryClient)();
|
|
2769
|
+
const { mutate, isLoading, error, data } = (0, import_react_query23.useMutation)(
|
|
2823
2770
|
(apiKey) => {
|
|
2824
2771
|
const deleteUrl = requiredLink(apiKey, "delete");
|
|
2825
2772
|
return apiClient.delete(deleteUrl);
|
|
@@ -2837,9 +2784,9 @@ var useDeleteApiKey = (user) => {
|
|
|
2837
2784
|
};
|
|
2838
2785
|
|
|
2839
2786
|
// src/publicKeys.ts
|
|
2840
|
-
var
|
|
2787
|
+
var import_react_query24 = require("react-query");
|
|
2841
2788
|
var CONTENT_TYPE_PUBLIC_KEY = "application/vnd.scmm-publicKey+json;v=2";
|
|
2842
|
-
var usePublicKeys = (user) => (0,
|
|
2789
|
+
var usePublicKeys = (user) => (0, import_react_query24.useQuery)(
|
|
2843
2790
|
["user", user.name, "publicKeys"],
|
|
2844
2791
|
() => apiClient.get(requiredLink(user, "publicKeys")).then((r) => r.json())
|
|
2845
2792
|
);
|
|
@@ -2853,8 +2800,8 @@ var createPublicKey = (link) => async (key) => {
|
|
|
2853
2800
|
return apiKeyResponse.json();
|
|
2854
2801
|
};
|
|
2855
2802
|
var useCreatePublicKey = (user, publicKeys) => {
|
|
2856
|
-
const queryClient2 = (0,
|
|
2857
|
-
const { mutate, data, isLoading, error, reset: reset2 } = (0,
|
|
2803
|
+
const queryClient2 = (0, import_react_query24.useQueryClient)();
|
|
2804
|
+
const { mutate, data, isLoading, error, reset: reset2 } = (0, import_react_query24.useMutation)(
|
|
2858
2805
|
createPublicKey(requiredLink(publicKeys, "create")),
|
|
2859
2806
|
{
|
|
2860
2807
|
onSuccess: () => queryClient2.invalidateQueries(["user", user.name, "publicKeys"])
|
|
@@ -2869,8 +2816,8 @@ var useCreatePublicKey = (user, publicKeys) => {
|
|
|
2869
2816
|
};
|
|
2870
2817
|
};
|
|
2871
2818
|
var useDeletePublicKey = (user) => {
|
|
2872
|
-
const queryClient2 = (0,
|
|
2873
|
-
const { mutate, isLoading, error, data } = (0,
|
|
2819
|
+
const queryClient2 = (0, import_react_query24.useQueryClient)();
|
|
2820
|
+
const { mutate, isLoading, error, data } = (0, import_react_query24.useMutation)(
|
|
2874
2821
|
(publicKey) => {
|
|
2875
2822
|
const deleteUrl = requiredLink(publicKey, "delete");
|
|
2876
2823
|
return apiClient.delete(deleteUrl);
|
|
@@ -2888,22 +2835,22 @@ var useDeletePublicKey = (user) => {
|
|
|
2888
2835
|
};
|
|
2889
2836
|
|
|
2890
2837
|
// src/fileContent.ts
|
|
2891
|
-
var
|
|
2838
|
+
var import_react_query25 = require("react-query");
|
|
2892
2839
|
var useFileContent = (file) => {
|
|
2893
2840
|
const selfLink = requiredLink(file, "self");
|
|
2894
|
-
return (0,
|
|
2841
|
+
return (0, import_react_query25.useQuery)(["fileContent", selfLink], () => apiClient.get(selfLink).then((response) => response.text()));
|
|
2895
2842
|
};
|
|
2896
2843
|
|
|
2897
2844
|
// src/history.ts
|
|
2898
|
-
var
|
|
2845
|
+
var import_react_query26 = require("react-query");
|
|
2899
2846
|
var useHistory = (repository, revision, file, request) => {
|
|
2900
|
-
const queryClient2 = (0,
|
|
2847
|
+
const queryClient2 = (0, import_react_query26.useQueryClient)();
|
|
2901
2848
|
const link = file._links.history.href;
|
|
2902
2849
|
const queryParams = {};
|
|
2903
2850
|
if (request == null ? void 0 : request.page) {
|
|
2904
2851
|
queryParams.page = request.page.toString();
|
|
2905
2852
|
}
|
|
2906
|
-
return (0,
|
|
2853
|
+
return (0, import_react_query26.useQuery)(
|
|
2907
2854
|
repoQueryKey(repository, "history", revision, file.path, (request == null ? void 0 : request.page) || 0),
|
|
2908
2855
|
() => apiClient.get(`${link}?${createQueryString(queryParams)}`).then((response) => response.json()),
|
|
2909
2856
|
{
|
|
@@ -2919,7 +2866,7 @@ var useHistory = (repository, revision, file, request) => {
|
|
|
2919
2866
|
};
|
|
2920
2867
|
|
|
2921
2868
|
// src/contentType.ts
|
|
2922
|
-
var
|
|
2869
|
+
var import_react_query27 = require("react-query");
|
|
2923
2870
|
function getContentType(url) {
|
|
2924
2871
|
return apiClient.head(url).then((response) => {
|
|
2925
2872
|
return {
|
|
@@ -2932,7 +2879,7 @@ function getContentType(url) {
|
|
|
2932
2879
|
});
|
|
2933
2880
|
}
|
|
2934
2881
|
var useContentType = (url, options = {}) => {
|
|
2935
|
-
const { isLoading, isFetching, error, data } = (0,
|
|
2882
|
+
const { isLoading, isFetching, error, data } = (0, import_react_query27.useQuery)(
|
|
2936
2883
|
["contentType", url],
|
|
2937
2884
|
() => getContentType(url),
|
|
2938
2885
|
options
|
|
@@ -2946,9 +2893,9 @@ var useContentType = (url, options = {}) => {
|
|
|
2946
2893
|
};
|
|
2947
2894
|
|
|
2948
2895
|
// src/annotations.ts
|
|
2949
|
-
var
|
|
2896
|
+
var import_react_query28 = require("react-query");
|
|
2950
2897
|
var useAnnotations = (repository, revision, file) => {
|
|
2951
|
-
const { isLoading, isFetching, error, data } = (0,
|
|
2898
|
+
const { isLoading, isFetching, error, data } = (0, import_react_query28.useQuery)(
|
|
2952
2899
|
repoQueryKey(repository, "annotations", revision, file.path),
|
|
2953
2900
|
() => apiClient.get(file._links.annotate.href).then((response) => response.json())
|
|
2954
2901
|
);
|
|
@@ -2961,8 +2908,8 @@ var useAnnotations = (repository, revision, file) => {
|
|
|
2961
2908
|
};
|
|
2962
2909
|
|
|
2963
2910
|
// src/search.ts
|
|
2964
|
-
var
|
|
2965
|
-
var
|
|
2911
|
+
var import_react_query29 = require("react-query");
|
|
2912
|
+
var import_react8 = require("react");
|
|
2966
2913
|
|
|
2967
2914
|
// src/help/search/syntax.en.ts
|
|
2968
2915
|
var syntax_en_default = `### Word Split
|
|
@@ -3171,7 +3118,7 @@ var useSearchableTypes = () => useIndexJsonResource("searchableTypes");
|
|
|
3171
3118
|
var useSearchCounts = (types, query, options) => {
|
|
3172
3119
|
const { links, isLoading } = useSearchLinks(options);
|
|
3173
3120
|
const result = {};
|
|
3174
|
-
const queries = (0,
|
|
3121
|
+
const queries = (0, import_react_query29.useQueries)(
|
|
3175
3122
|
types.map((type) => ({
|
|
3176
3123
|
queryKey: ["search", type, query, "count"],
|
|
3177
3124
|
queryFn: () => apiClient.get(`${findLink(links, type)}?q=${encodeURIComponent(query)}&countOnly=true`).then((response) => response.json()),
|
|
@@ -3244,7 +3191,7 @@ var useInternalSearch = (query, options, link) => {
|
|
|
3244
3191
|
if (options.pageSize) {
|
|
3245
3192
|
queryParams.pageSize = options.pageSize.toString();
|
|
3246
3193
|
}
|
|
3247
|
-
return (0,
|
|
3194
|
+
return (0, import_react_query29.useQuery)(
|
|
3248
3195
|
["search", options.type, queryParams],
|
|
3249
3196
|
() => apiClient.get(`${link}?${createQueryString(queryParams)}`).then((response) => response.json()),
|
|
3250
3197
|
{
|
|
@@ -3253,10 +3200,10 @@ var useInternalSearch = (query, options, link) => {
|
|
|
3253
3200
|
);
|
|
3254
3201
|
};
|
|
3255
3202
|
var useObserveAsync = (fn, deps) => {
|
|
3256
|
-
const [data, setData] = (0,
|
|
3257
|
-
const [isLoading, setLoading] = (0,
|
|
3258
|
-
const [error, setError] = (0,
|
|
3259
|
-
(0,
|
|
3203
|
+
const [data, setData] = (0, import_react8.useState)();
|
|
3204
|
+
const [isLoading, setLoading] = (0, import_react8.useState)(false);
|
|
3205
|
+
const [error, setError] = (0, import_react8.useState)();
|
|
3206
|
+
(0, import_react8.useEffect)(
|
|
3260
3207
|
() => {
|
|
3261
3208
|
setLoading(true);
|
|
3262
3209
|
fn(...deps).then(setData).catch(setError).finally(() => setLoading(false));
|
|
@@ -3281,10 +3228,10 @@ var useSearchSyntaxContent = (language) => useObserveAsync(
|
|
|
3281
3228
|
);
|
|
3282
3229
|
|
|
3283
3230
|
// src/loginInfo.ts
|
|
3284
|
-
var
|
|
3231
|
+
var import_react_query30 = require("react-query");
|
|
3285
3232
|
var useLoginInfo = (disabled = false) => {
|
|
3286
3233
|
const loginInfoLink = useIndexLink("loginInfo");
|
|
3287
|
-
const { error, isLoading, data } = (0,
|
|
3234
|
+
const { error, isLoading, data } = (0, import_react_query30.useQuery)(
|
|
3288
3235
|
["loginInfo"],
|
|
3289
3236
|
() => fetch(loginInfoLink).then((response) => response.json()),
|
|
3290
3237
|
{
|
|
@@ -3300,9 +3247,9 @@ var useLoginInfo = (disabled = false) => {
|
|
|
3300
3247
|
};
|
|
3301
3248
|
|
|
3302
3249
|
// src/useInvalidation.tsx
|
|
3303
|
-
var
|
|
3250
|
+
var import_react_query31 = require("react-query");
|
|
3304
3251
|
var useInvalidation = (link) => {
|
|
3305
|
-
const { mutate, isLoading, error, isSuccess } = (0,
|
|
3252
|
+
const { mutate, isLoading, error, isSuccess } = (0, import_react_query31.useMutation)(
|
|
3306
3253
|
(link2) => apiClient.post(link2, {})
|
|
3307
3254
|
);
|
|
3308
3255
|
return {
|
|
@@ -3322,7 +3269,7 @@ var useInvalidateSearchIndices = () => {
|
|
|
3322
3269
|
};
|
|
3323
3270
|
|
|
3324
3271
|
// src/compare.ts
|
|
3325
|
-
var
|
|
3272
|
+
var import_react_query32 = require("react-query");
|
|
3326
3273
|
function createIncomingUrl(repository, linkName, source, target) {
|
|
3327
3274
|
const link = repository._links[linkName];
|
|
3328
3275
|
if (link == null ? void 0 : link.templated) {
|
|
@@ -3342,7 +3289,7 @@ function createDiffUrl(repository, source, target) {
|
|
|
3342
3289
|
}
|
|
3343
3290
|
}
|
|
3344
3291
|
var useIncomingChangesets = (repository, source, target, request) => {
|
|
3345
|
-
const queryClient2 = (0,
|
|
3292
|
+
const queryClient2 = (0, import_react_query32.useQueryClient)();
|
|
3346
3293
|
let link = createChangesetUrl(repository, source, target);
|
|
3347
3294
|
if ((request == null ? void 0 : request.page) || (request == null ? void 0 : request.limit)) {
|
|
3348
3295
|
if ((request == null ? void 0 : request.page) && (request == null ? void 0 : request.limit)) {
|
|
@@ -3353,7 +3300,7 @@ var useIncomingChangesets = (repository, source, target, request) => {
|
|
|
3353
3300
|
link = `${link}?pageSize=${request.limit}`;
|
|
3354
3301
|
}
|
|
3355
3302
|
}
|
|
3356
|
-
return (0,
|
|
3303
|
+
return (0, import_react_query32.useQuery)(
|
|
3357
3304
|
["repository", repository.namespace, repository.name, "compare", source, target, "changesets", (request == null ? void 0 : request.page) || 0],
|
|
3358
3305
|
() => apiClient.get(link).then((response) => response.json()),
|
|
3359
3306
|
{
|
|
@@ -3368,7 +3315,7 @@ var useIncomingChangesets = (repository, source, target, request) => {
|
|
|
3368
3315
|
};
|
|
3369
3316
|
|
|
3370
3317
|
// src/localStorage.ts
|
|
3371
|
-
var
|
|
3318
|
+
var import_react9 = require("react");
|
|
3372
3319
|
var determineInitialValue = (key, initialValue) => {
|
|
3373
3320
|
try {
|
|
3374
3321
|
const itemFromStorage = localStorage.getItem(key);
|
|
@@ -3379,9 +3326,9 @@ var determineInitialValue = (key, initialValue) => {
|
|
|
3379
3326
|
}
|
|
3380
3327
|
};
|
|
3381
3328
|
function useLocalStorage(key, initialValue) {
|
|
3382
|
-
const initialValueOrValueFromStorage = (0,
|
|
3383
|
-
const [item, setItem] = (0,
|
|
3384
|
-
(0,
|
|
3329
|
+
const initialValueOrValueFromStorage = (0, import_react9.useMemo)(() => determineInitialValue(key, initialValue), [key, initialValue]);
|
|
3330
|
+
const [item, setItem] = (0, import_react9.useState)(initialValueOrValueFromStorage);
|
|
3331
|
+
(0, import_react9.useEffect)(() => {
|
|
3385
3332
|
const listener = (event) => {
|
|
3386
3333
|
if (event.key === key) {
|
|
3387
3334
|
setItem(determineInitialValue(key, initialValue));
|
|
@@ -3411,12 +3358,12 @@ function useLocalStorage(key, initialValue) {
|
|
|
3411
3358
|
}
|
|
3412
3359
|
|
|
3413
3360
|
// src/useAutocompleteOptions.ts
|
|
3414
|
-
var
|
|
3361
|
+
var import_react_query33 = require("react-query");
|
|
3415
3362
|
var import_react_i18next = require("react-i18next");
|
|
3416
3363
|
var defaultLabelFactory = (element) => element.displayName ? `${element.displayName} (${element.id})` : element.id;
|
|
3417
3364
|
function useAutocompleteOptions(query = "", link, options = {}) {
|
|
3418
3365
|
const [t] = (0, import_react_i18next.useTranslation)("commons");
|
|
3419
|
-
return (0,
|
|
3366
|
+
return (0, import_react_query33.useQuery)(
|
|
3420
3367
|
["options", link, query],
|
|
3421
3368
|
() => apiClient.get(link + "?q=" + query).then((r) => r.json()).then((json) => {
|
|
3422
3369
|
const result = json.map((element) => ({
|
|
@@ -3466,39 +3413,30 @@ var useUserOptions = (query) => {
|
|
|
3466
3413
|
};
|
|
3467
3414
|
|
|
3468
3415
|
// src/ApiProvider.tsx
|
|
3469
|
-
var
|
|
3470
|
-
var
|
|
3416
|
+
var import_react10 = __toESM(require("react"));
|
|
3417
|
+
var import_react_query34 = require("react-query");
|
|
3471
3418
|
var import_devtools = require("react-query/devtools");
|
|
3472
|
-
var queryClient = new
|
|
3419
|
+
var queryClient = new import_react_query34.QueryClient({
|
|
3473
3420
|
defaultOptions: {
|
|
3474
3421
|
queries: {
|
|
3475
3422
|
retry: false
|
|
3476
3423
|
}
|
|
3477
3424
|
}
|
|
3478
3425
|
});
|
|
3479
|
-
var ApiProvider = ({ children, index, me,
|
|
3480
|
-
(0,
|
|
3426
|
+
var ApiProvider = ({ children, index, me, devtools = true }) => {
|
|
3427
|
+
(0, import_react10.useEffect)(() => {
|
|
3481
3428
|
if (index) {
|
|
3482
3429
|
queryClient.setQueryData("index", index);
|
|
3483
|
-
if (onIndexFetched) {
|
|
3484
|
-
onIndexFetched(index);
|
|
3485
|
-
}
|
|
3486
3430
|
}
|
|
3487
|
-
}, [index
|
|
3488
|
-
(0,
|
|
3431
|
+
}, [index]);
|
|
3432
|
+
(0, import_react10.useEffect)(() => {
|
|
3489
3433
|
if (me) {
|
|
3490
3434
|
queryClient.setQueryData("me", me);
|
|
3491
|
-
if (onMeFetched) {
|
|
3492
|
-
onMeFetched(me);
|
|
3493
|
-
}
|
|
3494
3435
|
}
|
|
3495
|
-
}, [me
|
|
3496
|
-
return /* @__PURE__ */
|
|
3436
|
+
}, [me]);
|
|
3437
|
+
return /* @__PURE__ */ import_react10.default.createElement(import_react_query34.QueryClientProvider, {
|
|
3497
3438
|
client: queryClient
|
|
3498
|
-
}, /* @__PURE__ */
|
|
3499
|
-
onIndexFetched,
|
|
3500
|
-
onMeFetched
|
|
3501
|
-
}, children), devtools ? /* @__PURE__ */ import_react11.default.createElement(import_devtools.ReactQueryDevtools, {
|
|
3439
|
+
}, children, devtools ? /* @__PURE__ */ import_react10.default.createElement(import_devtools.ReactQueryDevtools, {
|
|
3502
3440
|
initialIsOpen: false
|
|
3503
3441
|
}) : null);
|
|
3504
3442
|
};
|
|
@@ -3508,28 +3446,28 @@ var clearCache = () => {
|
|
|
3508
3446
|
var ApiProvider_default = ApiProvider;
|
|
3509
3447
|
|
|
3510
3448
|
// src/NamespaceAndNameContext.tsx
|
|
3511
|
-
var
|
|
3512
|
-
var
|
|
3449
|
+
var import_react11 = __toESM(require("react"));
|
|
3450
|
+
var Context = (0, import_react11.createContext)(void 0);
|
|
3513
3451
|
var useNamespaceAndNameContext = () => {
|
|
3514
|
-
const context = (0,
|
|
3452
|
+
const context = (0, import_react11.useContext)(Context);
|
|
3515
3453
|
if (!context) {
|
|
3516
3454
|
throw new Error("useNamespaceAndNameContext can't be used outside of ApiProvider");
|
|
3517
3455
|
}
|
|
3518
3456
|
return context;
|
|
3519
3457
|
};
|
|
3520
3458
|
var NamespaceAndNameContextProvider = ({ children }) => {
|
|
3521
|
-
const [namespace, setNamespace] = (0,
|
|
3522
|
-
const [name, setName] = (0,
|
|
3523
|
-
return /* @__PURE__ */
|
|
3459
|
+
const [namespace, setNamespace] = (0, import_react11.useState)("");
|
|
3460
|
+
const [name, setName] = (0, import_react11.useState)("");
|
|
3461
|
+
return /* @__PURE__ */ import_react11.default.createElement(Context.Provider, {
|
|
3524
3462
|
value: { namespace, setNamespace, name, setName }
|
|
3525
3463
|
}, children);
|
|
3526
3464
|
};
|
|
3527
3465
|
|
|
3528
3466
|
// src/NamespaceContext.tsx
|
|
3529
|
-
var
|
|
3530
|
-
var
|
|
3467
|
+
var import_react12 = __toESM(require("react"));
|
|
3468
|
+
var Context2 = (0, import_react12.createContext)(void 0);
|
|
3531
3469
|
var useNamespaceContext = () => {
|
|
3532
|
-
const context = (0,
|
|
3470
|
+
const context = (0, import_react12.useContext)(Context2);
|
|
3533
3471
|
if (context === void 0) {
|
|
3534
3472
|
throw new Error("useNamespaceContext must be used within a NamespaceContextProvider");
|
|
3535
3473
|
}
|
|
@@ -3538,29 +3476,29 @@ var useNamespaceContext = () => {
|
|
|
3538
3476
|
var NamespaceContextProvider = ({
|
|
3539
3477
|
context,
|
|
3540
3478
|
children
|
|
3541
|
-
}) => /* @__PURE__ */
|
|
3479
|
+
}) => /* @__PURE__ */ import_react12.default.createElement(Context2.Provider, {
|
|
3542
3480
|
value: context
|
|
3543
3481
|
}, children);
|
|
3544
3482
|
|
|
3545
3483
|
// src/RepositoryContext.tsx
|
|
3546
|
-
var
|
|
3547
|
-
var
|
|
3548
|
-
var useRepositoryContext = () => (0,
|
|
3484
|
+
var import_react13 = __toESM(require("react"));
|
|
3485
|
+
var Context3 = (0, import_react13.createContext)(void 0);
|
|
3486
|
+
var useRepositoryContext = () => (0, import_react13.useContext)(Context3);
|
|
3549
3487
|
var RepositoryContextProvider = ({
|
|
3550
3488
|
repository,
|
|
3551
3489
|
children
|
|
3552
|
-
}) => /* @__PURE__ */
|
|
3490
|
+
}) => /* @__PURE__ */ import_react13.default.createElement(Context3.Provider, {
|
|
3553
3491
|
value: repository
|
|
3554
3492
|
}, children);
|
|
3555
3493
|
|
|
3556
3494
|
// src/RepositoryRevisionContext.tsx
|
|
3557
|
-
var
|
|
3558
|
-
var
|
|
3559
|
-
var useRepositoryRevisionContext = () => (0,
|
|
3495
|
+
var import_react14 = __toESM(require("react"));
|
|
3496
|
+
var Context4 = (0, import_react14.createContext)(void 0);
|
|
3497
|
+
var useRepositoryRevisionContext = () => (0, import_react14.useContext)(Context4);
|
|
3560
3498
|
var RepositoryRevisionContextProvider = ({
|
|
3561
3499
|
revision,
|
|
3562
3500
|
children
|
|
3563
|
-
}) => /* @__PURE__ */
|
|
3501
|
+
}) => /* @__PURE__ */ import_react14.default.createElement(Context4.Provider, {
|
|
3564
3502
|
value: revision
|
|
3565
3503
|
}, children);
|
|
3566
3504
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -3571,7 +3509,6 @@ var RepositoryRevisionContextProvider = ({
|
|
|
3571
3509
|
CONTENT_TYPE_PUBLIC_KEY,
|
|
3572
3510
|
ConflictError,
|
|
3573
3511
|
ForbiddenError,
|
|
3574
|
-
LegacyContextProvider,
|
|
3575
3512
|
MissingLinkError,
|
|
3576
3513
|
NamespaceAndNameContextProvider,
|
|
3577
3514
|
NamespaceContextProvider,
|
|
@@ -3667,7 +3604,6 @@ var RepositoryRevisionContextProvider = ({
|
|
|
3667
3604
|
useInvalidateAllCaches,
|
|
3668
3605
|
useInvalidateSearchIndices,
|
|
3669
3606
|
useJsonResource,
|
|
3670
|
-
useLegacyContext,
|
|
3671
3607
|
useLocalStorage,
|
|
3672
3608
|
useLogin,
|
|
3673
3609
|
useLoginInfo,
|