@scm-manager/ui-api 4.0.0-REACT18-20250701-125025 → 4.0.0-REACT19
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 +45 -45
- package/build/index.js +11 -3
- package/build/index.mjs +11 -3
- package/package.json +13 -14
package/build/index.d.ts
CHANGED
|
@@ -71,20 +71,20 @@ declare namespace urls {
|
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
type Context = {
|
|
75
75
|
type: string;
|
|
76
76
|
id: string;
|
|
77
77
|
}[];
|
|
78
|
-
|
|
78
|
+
type Violation = {
|
|
79
79
|
path?: string;
|
|
80
80
|
message: string;
|
|
81
81
|
key?: string;
|
|
82
82
|
};
|
|
83
|
-
|
|
83
|
+
type AdditionalMessage = {
|
|
84
84
|
key?: string;
|
|
85
85
|
message?: string;
|
|
86
86
|
};
|
|
87
|
-
|
|
87
|
+
type BackendErrorContent = {
|
|
88
88
|
transactionId: string;
|
|
89
89
|
errorCode: string;
|
|
90
90
|
message: string;
|
|
@@ -130,32 +130,32 @@ declare function createBackendError(content: BackendErrorContent, statusCode: nu
|
|
|
130
130
|
declare function isBackendError(response: Response): boolean;
|
|
131
131
|
declare const TOKEN_EXPIRED_ERROR_CODE = "DDS8D8unr1";
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
type SubscriptionEvent = {
|
|
134
134
|
type: string;
|
|
135
135
|
};
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
type OpenEvent = SubscriptionEvent;
|
|
137
|
+
type ErrorEvent = SubscriptionEvent & {
|
|
138
138
|
error: Error;
|
|
139
139
|
};
|
|
140
|
-
|
|
140
|
+
type MessageEvent = SubscriptionEvent & {
|
|
141
141
|
data: string;
|
|
142
142
|
lastEventId?: string;
|
|
143
143
|
};
|
|
144
|
-
|
|
144
|
+
type MessageListeners = {
|
|
145
145
|
[eventType: string]: (event: MessageEvent) => void;
|
|
146
146
|
};
|
|
147
|
-
|
|
147
|
+
type SubscriptionContext = {
|
|
148
148
|
onOpen?: OpenEvent;
|
|
149
149
|
onMessage: MessageListeners;
|
|
150
150
|
onError?: ErrorEvent;
|
|
151
151
|
};
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
type SubscriptionArgument = MessageListeners | SubscriptionContext;
|
|
153
|
+
type Cancel = () => void;
|
|
154
154
|
declare const extractXsrfTokenFromCookie: (cookieString?: string) => any;
|
|
155
155
|
declare function createUrl(url: string): string;
|
|
156
156
|
declare function createUrlWithIdentifiers(url: string): string;
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
type ErrorListener = (error: Error) => void;
|
|
158
|
+
type RequestListener = (url: string, options?: RequestInit) => void;
|
|
159
159
|
declare class ApiClient {
|
|
160
160
|
errorListeners: ErrorListener[];
|
|
161
161
|
requestListeners: RequestListener[];
|
|
@@ -180,15 +180,15 @@ declare class ApiClient {
|
|
|
180
180
|
}
|
|
181
181
|
declare const apiClient: ApiClient;
|
|
182
182
|
|
|
183
|
-
|
|
183
|
+
type ApiResult<T> = {
|
|
184
184
|
isLoading: boolean;
|
|
185
185
|
error: Error | null;
|
|
186
186
|
data?: T;
|
|
187
187
|
};
|
|
188
|
-
|
|
188
|
+
type ApiResultWithFetching<T> = ApiResult<T> & {
|
|
189
189
|
isFetching: boolean;
|
|
190
190
|
};
|
|
191
|
-
|
|
191
|
+
type DeleteFunction<T> = (entity: T) => void;
|
|
192
192
|
declare const useIndex: () => ApiResult<IndexResources>;
|
|
193
193
|
declare const useIndexLink: (name: string) => string | undefined;
|
|
194
194
|
declare const useIndexLinks: () => _scm_manager_ui_types.Links;
|
|
@@ -219,12 +219,12 @@ declare const useLogout: () => {
|
|
|
219
219
|
error: Error | null;
|
|
220
220
|
};
|
|
221
221
|
|
|
222
|
-
|
|
222
|
+
type UseGroupsRequest = {
|
|
223
223
|
page?: number | string;
|
|
224
224
|
search?: string;
|
|
225
225
|
};
|
|
226
226
|
declare const useGroups: (request?: UseGroupsRequest) => ApiResult<GroupCollection>;
|
|
227
|
-
declare const useGroup: (name
|
|
227
|
+
declare const useGroup: (name?: string) => ApiResult<Group>;
|
|
228
228
|
declare const useCreateGroup: () => {
|
|
229
229
|
create: (group: GroupCreation) => void;
|
|
230
230
|
isLoading: boolean;
|
|
@@ -244,7 +244,7 @@ declare const useDeleteGroup: () => {
|
|
|
244
244
|
isDeleted: boolean;
|
|
245
245
|
};
|
|
246
246
|
|
|
247
|
-
|
|
247
|
+
type UseUsersRequest = {
|
|
248
248
|
page?: number | string;
|
|
249
249
|
search?: string;
|
|
250
250
|
};
|
|
@@ -269,7 +269,7 @@ declare const useDeleteUser: () => {
|
|
|
269
269
|
error: Error | null;
|
|
270
270
|
isDeleted: boolean;
|
|
271
271
|
};
|
|
272
|
-
|
|
272
|
+
type ConvertToInternalRequest = {
|
|
273
273
|
user: User;
|
|
274
274
|
password: string;
|
|
275
275
|
};
|
|
@@ -308,7 +308,7 @@ declare const useGroupSuggestions: () => (query: string) => Promise<_scm_manager
|
|
|
308
308
|
|
|
309
309
|
declare const useNamespaceSuggestions: () => (query: string) => Promise<_scm_manager_ui_types.SelectValue[]>;
|
|
310
310
|
|
|
311
|
-
|
|
311
|
+
type UseRepositoriesRequest = {
|
|
312
312
|
namespace?: Namespace;
|
|
313
313
|
search?: string;
|
|
314
314
|
page?: number | string;
|
|
@@ -325,7 +325,7 @@ declare const useCreateRepository: () => {
|
|
|
325
325
|
};
|
|
326
326
|
declare const useRepositoryTypes: () => ApiResult<RepositoryTypeCollection>;
|
|
327
327
|
declare const useRepository: (namespace: string, name: string) => ApiResult<Repository>;
|
|
328
|
-
|
|
328
|
+
type UseDeleteRepositoryOptions = {
|
|
329
329
|
onSuccess: (repository: Repository) => void;
|
|
330
330
|
};
|
|
331
331
|
declare const useDeleteRepository: (options?: UseDeleteRepositoryOptions) => {
|
|
@@ -359,7 +359,7 @@ declare const useRunHealthCheck: () => {
|
|
|
359
359
|
isRunning: boolean;
|
|
360
360
|
};
|
|
361
361
|
declare const useExportInfo: (repository: Repository) => ApiResultWithFetching<ExportInfo>;
|
|
362
|
-
|
|
362
|
+
type ExportOptions = {
|
|
363
363
|
compressed: boolean;
|
|
364
364
|
withMetadata: boolean;
|
|
365
365
|
password?: string;
|
|
@@ -408,12 +408,12 @@ declare const useDeleteBranch: (repository: Repository) => {
|
|
|
408
408
|
error: Error | null;
|
|
409
409
|
isDeleted: boolean;
|
|
410
410
|
};
|
|
411
|
-
|
|
411
|
+
type DefaultBranch = {
|
|
412
412
|
defaultBranch: string;
|
|
413
413
|
};
|
|
414
414
|
declare const useDefaultBranch: (repository: Repository) => ApiResult<DefaultBranch>;
|
|
415
415
|
|
|
416
|
-
|
|
416
|
+
type UseChangesetsRequest = {
|
|
417
417
|
branch?: Branch;
|
|
418
418
|
page?: string | number;
|
|
419
419
|
limit?: number;
|
|
@@ -422,11 +422,11 @@ 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
|
-
|
|
425
|
+
type RevertRequest = {
|
|
426
426
|
branch: string;
|
|
427
427
|
message: string;
|
|
428
428
|
};
|
|
429
|
-
|
|
429
|
+
type RevertResponse = {
|
|
430
430
|
revision: string;
|
|
431
431
|
};
|
|
432
432
|
declare const useRevert: (changeset: Changeset) => {
|
|
@@ -463,21 +463,21 @@ declare const useUpdateConfig: () => {
|
|
|
463
463
|
|
|
464
464
|
declare const useUpdateInfo: () => ApiResult<UpdateInfo | null>;
|
|
465
465
|
|
|
466
|
-
|
|
466
|
+
type WaitForRestartOptions = {
|
|
467
467
|
initialDelay?: number;
|
|
468
468
|
timeout?: number;
|
|
469
469
|
};
|
|
470
470
|
declare const waitForRestartAfter: (promise: Promise<any>, { initialDelay, timeout }?: WaitForRestartOptions) => Promise<void>;
|
|
471
|
-
|
|
471
|
+
type UseAvailablePluginsOptions = {
|
|
472
472
|
enabled?: boolean;
|
|
473
473
|
};
|
|
474
474
|
declare const useAvailablePlugins: ({ enabled }?: UseAvailablePluginsOptions) => ApiResult<PluginCollection>;
|
|
475
|
-
|
|
475
|
+
type UseInstalledPluginsOptions = {
|
|
476
476
|
enabled?: boolean;
|
|
477
477
|
};
|
|
478
478
|
declare const useInstalledPlugins: ({ enabled }?: UseInstalledPluginsOptions) => ApiResult<PluginCollection>;
|
|
479
479
|
declare const usePendingPlugins: () => ApiResult<PendingPlugins>;
|
|
480
|
-
|
|
480
|
+
type RestartOptions = WaitForRestartOptions & {
|
|
481
481
|
restart?: boolean;
|
|
482
482
|
};
|
|
483
483
|
declare const useInstallPlugin: () => {
|
|
@@ -512,7 +512,7 @@ declare const useCancelPendingPlugins: () => {
|
|
|
512
512
|
isCancelled: boolean;
|
|
513
513
|
};
|
|
514
514
|
|
|
515
|
-
|
|
515
|
+
type UseRepositoryRolesRequest = {
|
|
516
516
|
page?: number | string;
|
|
517
517
|
};
|
|
518
518
|
declare const useRepositoryRoles: (request?: UseRepositoryRolesRequest) => ApiResult<RepositoryRoleCollection>;
|
|
@@ -583,7 +583,7 @@ declare const useSetGroupPermissions: (group: Group, permissions?: GlobalPermiss
|
|
|
583
583
|
isUpdated: boolean;
|
|
584
584
|
};
|
|
585
585
|
|
|
586
|
-
|
|
586
|
+
type UseSourcesOptions = {
|
|
587
587
|
revision?: string;
|
|
588
588
|
path?: string;
|
|
589
589
|
refetchPartialInterval?: number;
|
|
@@ -618,7 +618,7 @@ declare const useImportFullRepository: (repositoryType: RepositoryType) => {
|
|
|
618
618
|
importedRepository: Repository | undefined;
|
|
619
619
|
};
|
|
620
620
|
|
|
621
|
-
|
|
621
|
+
type UseDiffOptions = {
|
|
622
622
|
limit?: number;
|
|
623
623
|
refetchOnWindowFocus?: boolean;
|
|
624
624
|
ignoreWhitespace?: string;
|
|
@@ -700,7 +700,7 @@ declare const useDeletePublicKey: (user: User | Me) => {
|
|
|
700
700
|
|
|
701
701
|
declare const useFileContent: (file: File$1) => ApiResult<string>;
|
|
702
702
|
|
|
703
|
-
|
|
703
|
+
type UseHistoryRequest = {
|
|
704
704
|
page?: number | string;
|
|
705
705
|
};
|
|
706
706
|
declare const useHistory: (repository: Repository, revision: string, file: File$1, request?: UseHistoryRequest) => ApiResult<ChangesetCollection>;
|
|
@@ -709,7 +709,7 @@ declare const useContentType: (url: string, options?: Pick<UseQueryOptions<Conte
|
|
|
709
709
|
|
|
710
710
|
declare const useAnnotations: (repository: Repository, revision: string, file: File$1) => ApiResultWithFetching<AnnotatedSource>;
|
|
711
711
|
|
|
712
|
-
|
|
712
|
+
type SearchOptions = {
|
|
713
713
|
type: string;
|
|
714
714
|
page?: number;
|
|
715
715
|
pageSize?: number;
|
|
@@ -751,14 +751,14 @@ declare const useInvalidateSearchIndices: () => {
|
|
|
751
751
|
|
|
752
752
|
declare function createChangesetUrl(repository: Repository, source: string, target: string): string;
|
|
753
753
|
declare function createDiffUrl(repository: Repository, source: string, target: string): string;
|
|
754
|
-
|
|
754
|
+
type UseIncomingChangesetsRequest = {
|
|
755
755
|
page?: string | number;
|
|
756
756
|
limit?: number;
|
|
757
757
|
};
|
|
758
758
|
declare const useIncomingChangesets: (repository: Repository, source: string, target: string, request?: UseIncomingChangesetsRequest) => ApiResultWithFetching<ChangesetCollection>;
|
|
759
759
|
|
|
760
760
|
declare const createQueryString: (params: Record<string, string>) => string;
|
|
761
|
-
|
|
761
|
+
type CancelablePromise<T> = Promise<T> & {
|
|
762
762
|
cancel: () => void;
|
|
763
763
|
};
|
|
764
764
|
declare function makeCancelable<T>(promise: Promise<T>): CancelablePromise<T>;
|
|
@@ -767,7 +767,7 @@ declare function useCancellablePromise(): <T>(p: Promise<T>) => CancelablePromis
|
|
|
767
767
|
declare const requiredLink: (object: HalRepresentation, name: string, subName?: string) => string;
|
|
768
768
|
declare const objectLink: (object: HalRepresentation, name: string) => string | null;
|
|
769
769
|
|
|
770
|
-
|
|
770
|
+
type LocalStorageSetter<T> = (value: T | ((previousValue: T) => T)) => void;
|
|
771
771
|
/**
|
|
772
772
|
* Provides an api to access the browser's local storage for a given key.
|
|
773
773
|
*
|
|
@@ -780,18 +780,18 @@ declare const useGroupOptions: (query?: string) => react_query.UseQueryResult<Op
|
|
|
780
780
|
declare const useNamespaceOptions: (query?: string) => react_query.UseQueryResult<Option<AutocompleteObject>[], Error>;
|
|
781
781
|
declare const useUserOptions: (query?: string) => react_query.UseQueryResult<Option<AutocompleteObject>[], Error>;
|
|
782
782
|
|
|
783
|
-
|
|
783
|
+
type BaseContext = {
|
|
784
784
|
onIndexFetched?: (index: IndexResources) => void;
|
|
785
785
|
onMeFetched?: (me: Me) => void;
|
|
786
786
|
children?: ReactNode;
|
|
787
787
|
};
|
|
788
|
-
|
|
789
|
-
initialize
|
|
788
|
+
type LegacyContext = BaseContext & {
|
|
789
|
+
initialize?: () => void;
|
|
790
790
|
};
|
|
791
791
|
declare const useLegacyContext: () => LegacyContext;
|
|
792
792
|
declare const LegacyContextProvider: FC<BaseContext>;
|
|
793
793
|
|
|
794
|
-
|
|
794
|
+
type Props = LegacyContext & {
|
|
795
795
|
index?: IndexResources;
|
|
796
796
|
me?: Me;
|
|
797
797
|
devtools?: boolean;
|
|
@@ -801,7 +801,7 @@ declare const ApiProvider: FC<Props>;
|
|
|
801
801
|
|
|
802
802
|
declare const clearCache: () => Promise<void>;
|
|
803
803
|
|
|
804
|
-
|
|
804
|
+
type NamespaceAndNameContext = {
|
|
805
805
|
namespace?: string;
|
|
806
806
|
setNamespace: (namespace: string) => void;
|
|
807
807
|
name?: string;
|
package/build/index.js
CHANGED
|
@@ -835,7 +835,7 @@ function makeCancelable(promise) {
|
|
|
835
835
|
});
|
|
836
836
|
}
|
|
837
837
|
function useCancellablePromise() {
|
|
838
|
-
const promises = (0, import_react3.useRef)();
|
|
838
|
+
const promises = (0, import_react3.useRef)([]);
|
|
839
839
|
(0, import_react3.useEffect)(() => {
|
|
840
840
|
promises.current = promises.current || [];
|
|
841
841
|
return function cancel() {
|
|
@@ -877,7 +877,15 @@ var useGroup = (name) => {
|
|
|
877
877
|
const indexLink = useRequiredIndexLink("groups");
|
|
878
878
|
return (0, import_react_query5.useQuery)(
|
|
879
879
|
["group", name],
|
|
880
|
-
() =>
|
|
880
|
+
() => {
|
|
881
|
+
if (!name) {
|
|
882
|
+
return Promise.reject(new Error("No Group name"));
|
|
883
|
+
}
|
|
884
|
+
return apiClient.get(concat(indexLink, name)).then((response) => response.json());
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
enabled: !!name
|
|
888
|
+
}
|
|
881
889
|
);
|
|
882
890
|
};
|
|
883
891
|
var createGroup = (link) => {
|
|
@@ -1748,7 +1756,7 @@ var useTag = (repository, name) => {
|
|
|
1748
1756
|
const link = requiredLink(repository, "tags");
|
|
1749
1757
|
return (0, import_react_query12.useQuery)(
|
|
1750
1758
|
tagQueryKey(repository, name),
|
|
1751
|
-
() => apiClient.get(concat(link, name)).then((response) => response.json())
|
|
1759
|
+
() => apiClient.get(concat(link, encodeURIComponent(name))).then((response) => response.json())
|
|
1752
1760
|
);
|
|
1753
1761
|
};
|
|
1754
1762
|
var invalidateCacheForTag = (queryClient2, repository, tag) => {
|
package/build/index.mjs
CHANGED
|
@@ -645,7 +645,7 @@ function makeCancelable(promise) {
|
|
|
645
645
|
});
|
|
646
646
|
}
|
|
647
647
|
function useCancellablePromise() {
|
|
648
|
-
const promises = useRef();
|
|
648
|
+
const promises = useRef([]);
|
|
649
649
|
useEffect(() => {
|
|
650
650
|
promises.current = promises.current || [];
|
|
651
651
|
return function cancel() {
|
|
@@ -687,7 +687,15 @@ var useGroup = (name) => {
|
|
|
687
687
|
const indexLink = useRequiredIndexLink("groups");
|
|
688
688
|
return useQuery3(
|
|
689
689
|
["group", name],
|
|
690
|
-
() =>
|
|
690
|
+
() => {
|
|
691
|
+
if (!name) {
|
|
692
|
+
return Promise.reject(new Error("No Group name"));
|
|
693
|
+
}
|
|
694
|
+
return apiClient.get(concat(indexLink, name)).then((response) => response.json());
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
enabled: !!name
|
|
698
|
+
}
|
|
691
699
|
);
|
|
692
700
|
};
|
|
693
701
|
var createGroup = (link) => {
|
|
@@ -1558,7 +1566,7 @@ var useTag = (repository, name) => {
|
|
|
1558
1566
|
const link = requiredLink(repository, "tags");
|
|
1559
1567
|
return useQuery9(
|
|
1560
1568
|
tagQueryKey(repository, name),
|
|
1561
|
-
() => apiClient.get(concat(link, name)).then((response) => response.json())
|
|
1569
|
+
() => apiClient.get(concat(link, encodeURIComponent(name))).then((response) => response.json())
|
|
1562
1570
|
);
|
|
1563
1571
|
};
|
|
1564
1572
|
var invalidateCacheForTag = (queryClient2, repository, tag) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scm-manager/ui-api",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-REACT19",
|
|
4
4
|
"description": "React hook api for the SCM-Manager backend",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"module": "build/index.mjs",
|
|
@@ -19,26 +19,25 @@
|
|
|
19
19
|
"depcheck": "depcheck"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"react": "^18.3.1",
|
|
23
22
|
"query-string": "6.14.1",
|
|
24
|
-
"react
|
|
25
|
-
"react-
|
|
26
|
-
"react-
|
|
23
|
+
"react": "^19.1.1",
|
|
24
|
+
"react-i18next": "11",
|
|
25
|
+
"react-query": "^3.39.2"
|
|
27
26
|
},
|
|
28
27
|
"devDependencies": {
|
|
29
|
-
"@scm-manager/ui-types": "4.0.0-REACT18-20250701-125025",
|
|
30
|
-
"tsup": "^5.12.6",
|
|
31
|
-
"@types/react-test-renderer": "^18.2.0",
|
|
32
28
|
"@scm-manager/babel-preset": "^2.13.1",
|
|
33
29
|
"@scm-manager/eslint-config": "^2.17.0",
|
|
34
|
-
"@scm-manager/jest-preset": "^2.
|
|
30
|
+
"@scm-manager/jest-preset": "^2.15.0-alpha1",
|
|
35
31
|
"@scm-manager/prettier-config": "^2.12.0",
|
|
36
32
|
"@scm-manager/tsconfig": "^2.13.0",
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
39
|
-
"react
|
|
33
|
+
"@scm-manager/ui-types": "4.0.0-REACT19",
|
|
34
|
+
"@testing-library/react": "^16.3.0",
|
|
35
|
+
"@types/react": "^19.1.1",
|
|
40
36
|
"fetch-mock": "^7.5.1",
|
|
41
|
-
"fetch-mock-jest": "^1.5.1"
|
|
37
|
+
"fetch-mock-jest": "^1.5.1",
|
|
38
|
+
"minimatch": "^10.0.3",
|
|
39
|
+
"react-test-renderer": "^18.2.0",
|
|
40
|
+
"tsup": "^5.12.6"
|
|
42
41
|
},
|
|
43
42
|
"dependencies": {
|
|
44
43
|
"gitdiff-parser": "^0.2.2"
|
|
@@ -58,4 +57,4 @@
|
|
|
58
57
|
"publishConfig": {
|
|
59
58
|
"access": "public"
|
|
60
59
|
}
|
|
61
|
-
}
|
|
60
|
+
}
|