mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 06:25:45 +01:00
use reflow to migrate from flow to typescript
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
// @flow
|
||||
export type Action = {
|
||||
type: string,
|
||||
payload?: any,
|
||||
itemId?: string | number,
|
||||
resetPending?: boolean
|
||||
};
|
||||
6
scm-ui/ui-types/src/Action.ts
Normal file
6
scm-ui/ui-types/src/Action.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export type Action = {
|
||||
type: string;
|
||||
payload?: any;
|
||||
itemId?: string | number;
|
||||
resetPending?: boolean;
|
||||
};
|
||||
@@ -1,10 +0,0 @@
|
||||
// @flow
|
||||
export type AutocompleteObject = {
|
||||
id: string,
|
||||
displayName: string
|
||||
};
|
||||
|
||||
export type SelectValue = {
|
||||
value: AutocompleteObject,
|
||||
label: string
|
||||
};
|
||||
9
scm-ui/ui-types/src/Autocomplete.ts
Normal file
9
scm-ui/ui-types/src/Autocomplete.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export type AutocompleteObject = {
|
||||
id: string;
|
||||
displayName: string;
|
||||
};
|
||||
|
||||
export type SelectValue = {
|
||||
value: AutocompleteObject;
|
||||
label: string;
|
||||
};
|
||||
@@ -1,14 +0,0 @@
|
||||
//@flow
|
||||
import type {Links} from "./hal";
|
||||
|
||||
export type Branch = {
|
||||
name: string,
|
||||
revision: string,
|
||||
defaultBranch?: boolean,
|
||||
_links: Links
|
||||
}
|
||||
|
||||
export type BranchRequest = {
|
||||
name: string,
|
||||
parent: string
|
||||
}
|
||||
13
scm-ui/ui-types/src/Branches.ts
Normal file
13
scm-ui/ui-types/src/Branches.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Links } from './hal';
|
||||
|
||||
export type Branch = {
|
||||
name: string;
|
||||
revision: string;
|
||||
defaultBranch?: boolean;
|
||||
_links: Links;
|
||||
};
|
||||
|
||||
export type BranchRequest = {
|
||||
name: string;
|
||||
parent: string;
|
||||
};
|
||||
@@ -1,25 +0,0 @@
|
||||
//@flow
|
||||
import type {Collection, Links} from "./hal";
|
||||
import type {Tag} from "./Tags";
|
||||
import type {Branch} from "./Branches";
|
||||
|
||||
export type Changeset = Collection & {
|
||||
id: string,
|
||||
date: Date,
|
||||
author: {
|
||||
name: string,
|
||||
mail?: string
|
||||
},
|
||||
description: string,
|
||||
_links: Links,
|
||||
_embedded: {
|
||||
tags?: Tag[],
|
||||
branches?: Branch[],
|
||||
parents?: ParentChangeset[]
|
||||
};
|
||||
}
|
||||
|
||||
export type ParentChangeset = {
|
||||
id: string,
|
||||
_links: Links
|
||||
}
|
||||
24
scm-ui/ui-types/src/Changesets.ts
Normal file
24
scm-ui/ui-types/src/Changesets.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { Collection, Links } from './hal';
|
||||
import { Tag } from './Tags';
|
||||
import { Branch } from './Branches';
|
||||
|
||||
export type Changeset = Collection & {
|
||||
id: string;
|
||||
date: Date;
|
||||
author: {
|
||||
name: string;
|
||||
mail?: string;
|
||||
};
|
||||
description: string;
|
||||
_links: Links;
|
||||
_embedded: {
|
||||
tags?: Tag[];
|
||||
branches?: Branch[];
|
||||
parents?: ParentChangeset[];
|
||||
};
|
||||
};
|
||||
|
||||
export type ParentChangeset = {
|
||||
id: string;
|
||||
_links: Links;
|
||||
};
|
||||
@@ -1,25 +0,0 @@
|
||||
//@flow
|
||||
import type { Links } from "./hal";
|
||||
|
||||
export type Config = {
|
||||
proxyPassword: string | null,
|
||||
proxyPort: number,
|
||||
proxyServer: string,
|
||||
proxyUser: string | null,
|
||||
enableProxy: boolean,
|
||||
realmDescription: string,
|
||||
disableGroupingGrid: boolean,
|
||||
dateFormat: string,
|
||||
anonymousAccessEnabled: boolean,
|
||||
baseUrl: string,
|
||||
forceBaseUrl: boolean,
|
||||
loginAttemptLimit: number,
|
||||
proxyExcludes: string[],
|
||||
skipFailedAuthenticators: boolean,
|
||||
pluginUrl: string,
|
||||
loginAttemptLimitTimeout: number,
|
||||
enabledXsrfProtection: boolean,
|
||||
namespaceStrategy: string,
|
||||
loginInfoUrl: string,
|
||||
_links: Links
|
||||
};
|
||||
24
scm-ui/ui-types/src/Config.ts
Normal file
24
scm-ui/ui-types/src/Config.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { Links } from './hal';
|
||||
|
||||
export type Config = {
|
||||
proxyPassword: string | null;
|
||||
proxyPort: number;
|
||||
proxyServer: string;
|
||||
proxyUser: string | null;
|
||||
enableProxy: boolean;
|
||||
realmDescription: string;
|
||||
disableGroupingGrid: boolean;
|
||||
dateFormat: string;
|
||||
anonymousAccessEnabled: boolean;
|
||||
baseUrl: string;
|
||||
forceBaseUrl: boolean;
|
||||
loginAttemptLimit: number;
|
||||
proxyExcludes: string[];
|
||||
skipFailedAuthenticators: boolean;
|
||||
pluginUrl: string;
|
||||
loginAttemptLimitTimeout: number;
|
||||
enabledXsrfProtection: boolean;
|
||||
namespaceStrategy: string;
|
||||
loginInfoUrl: string;
|
||||
_links: Links;
|
||||
};
|
||||
@@ -1,20 +0,0 @@
|
||||
//@flow
|
||||
import type { Collection, Links } from "./hal";
|
||||
|
||||
export type Member = {
|
||||
name: string,
|
||||
_links: Links
|
||||
};
|
||||
|
||||
export type Group = Collection & {
|
||||
name: string,
|
||||
description: string,
|
||||
type: string,
|
||||
external: boolean,
|
||||
members: string[],
|
||||
_embedded: {
|
||||
members: Member[]
|
||||
},
|
||||
creationDate?: string,
|
||||
lastModified?: string
|
||||
};
|
||||
19
scm-ui/ui-types/src/Group.ts
Normal file
19
scm-ui/ui-types/src/Group.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Collection, Links } from './hal';
|
||||
|
||||
export type Member = {
|
||||
name: string;
|
||||
_links: Links;
|
||||
};
|
||||
|
||||
export type Group = Collection & {
|
||||
name: string;
|
||||
description: string;
|
||||
type: string;
|
||||
external: boolean;
|
||||
members: string[];
|
||||
_embedded: {
|
||||
members: Member[];
|
||||
};
|
||||
creationDate?: string;
|
||||
lastModified?: string;
|
||||
};
|
||||
@@ -1,7 +0,0 @@
|
||||
//@flow
|
||||
import type { Links } from "./hal";
|
||||
|
||||
export type IndexResources = {
|
||||
version: string,
|
||||
_links: Links
|
||||
};
|
||||
6
scm-ui/ui-types/src/IndexResources.ts
Normal file
6
scm-ui/ui-types/src/IndexResources.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { Links } from './hal';
|
||||
|
||||
export type IndexResources = {
|
||||
version: string;
|
||||
_links: Links;
|
||||
};
|
||||
@@ -1,11 +0,0 @@
|
||||
// @flow
|
||||
|
||||
import type { Links } from "./hal";
|
||||
|
||||
export type Me = {
|
||||
name: string,
|
||||
displayName: string,
|
||||
mail: string,
|
||||
groups: [],
|
||||
_links: Links
|
||||
};
|
||||
9
scm-ui/ui-types/src/Me.ts
Normal file
9
scm-ui/ui-types/src/Me.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Links } from './hal';
|
||||
|
||||
export type Me = {
|
||||
name: string;
|
||||
displayName: string;
|
||||
mail: string;
|
||||
groups: [];
|
||||
_links: Links;
|
||||
};
|
||||
@@ -1,9 +0,0 @@
|
||||
// @flow
|
||||
|
||||
import type { Links } from "./hal";
|
||||
|
||||
export type NamespaceStrategies = {
|
||||
current: string,
|
||||
available: string[],
|
||||
_links: Links
|
||||
};
|
||||
7
scm-ui/ui-types/src/NamespaceStrategies.ts
Normal file
7
scm-ui/ui-types/src/NamespaceStrategies.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { Links } from './hal';
|
||||
|
||||
export type NamespaceStrategies = {
|
||||
current: string;
|
||||
available: string[];
|
||||
_links: Links;
|
||||
};
|
||||
@@ -1,38 +0,0 @@
|
||||
//@flow
|
||||
import type {Collection, Links} from "./hal";
|
||||
|
||||
export type Plugin = {
|
||||
name: string,
|
||||
version: string,
|
||||
newVersion?: string,
|
||||
displayName: string,
|
||||
description?: string,
|
||||
author: string,
|
||||
category: string,
|
||||
avatarUrl: string,
|
||||
pending: boolean,
|
||||
markedForUninstall?: boolean,
|
||||
dependencies: string[],
|
||||
_links: Links
|
||||
};
|
||||
|
||||
export type PluginCollection = Collection & {
|
||||
_links: Links,
|
||||
_embedded: {
|
||||
plugins: Plugin[] | string[]
|
||||
}
|
||||
};
|
||||
|
||||
export type PluginGroup = {
|
||||
name: string,
|
||||
plugins: Plugin[]
|
||||
};
|
||||
|
||||
export type PendingPlugins = {
|
||||
_links: Links,
|
||||
_embedded: {
|
||||
new: [],
|
||||
update: [],
|
||||
uninstall: []
|
||||
}
|
||||
}
|
||||
37
scm-ui/ui-types/src/Plugin.ts
Normal file
37
scm-ui/ui-types/src/Plugin.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { Collection, Links } from './hal';
|
||||
|
||||
export type Plugin = {
|
||||
name: string;
|
||||
version: string;
|
||||
newVersion?: string;
|
||||
displayName: string;
|
||||
description?: string;
|
||||
author: string;
|
||||
category: string;
|
||||
avatarUrl: string;
|
||||
pending: boolean;
|
||||
markedForUninstall?: boolean;
|
||||
dependencies: string[];
|
||||
_links: Links;
|
||||
};
|
||||
|
||||
export type PluginCollection = Collection & {
|
||||
_links: Links;
|
||||
_embedded: {
|
||||
plugins: Plugin[] | string[];
|
||||
};
|
||||
};
|
||||
|
||||
export type PluginGroup = {
|
||||
name: string;
|
||||
plugins: Plugin[];
|
||||
};
|
||||
|
||||
export type PendingPlugins = {
|
||||
_links: Links;
|
||||
_embedded: {
|
||||
new: [];
|
||||
update: [];
|
||||
uninstall: [];
|
||||
};
|
||||
};
|
||||
@@ -1,24 +0,0 @@
|
||||
//@flow
|
||||
import type { PagedCollection, Links } from "./hal";
|
||||
|
||||
export type Repository = {
|
||||
namespace: string,
|
||||
name: string,
|
||||
type: string,
|
||||
contact?: string,
|
||||
description?: string,
|
||||
creationDate?: string,
|
||||
lastModified?: string,
|
||||
_links: Links
|
||||
};
|
||||
|
||||
export type RepositoryCollection = PagedCollection & {
|
||||
_embedded: {
|
||||
repositories: Repository[] | string[]
|
||||
}
|
||||
};
|
||||
|
||||
export type RepositoryGroup = {
|
||||
name: string,
|
||||
repositories: Repository[]
|
||||
};
|
||||
23
scm-ui/ui-types/src/Repositories.ts
Normal file
23
scm-ui/ui-types/src/Repositories.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { PagedCollection, Links } from './hal';
|
||||
|
||||
export type Repository = {
|
||||
namespace: string;
|
||||
name: string;
|
||||
type: string;
|
||||
contact?: string;
|
||||
description?: string;
|
||||
creationDate?: string;
|
||||
lastModified?: string;
|
||||
_links: Links;
|
||||
};
|
||||
|
||||
export type RepositoryCollection = PagedCollection & {
|
||||
_embedded: {
|
||||
repositories: Repository[] | string[];
|
||||
};
|
||||
};
|
||||
|
||||
export type RepositoryGroup = {
|
||||
name: string;
|
||||
repositories: Repository[];
|
||||
};
|
||||
@@ -1,15 +1,14 @@
|
||||
//@flow
|
||||
import type {Links} from "./hal";
|
||||
import { Links } from './hal';
|
||||
|
||||
export type PermissionCreateEntry = {
|
||||
name: string,
|
||||
role?: string,
|
||||
verbs?: string[],
|
||||
groupPermission: boolean
|
||||
}
|
||||
name: string;
|
||||
role?: string;
|
||||
verbs?: string[];
|
||||
groupPermission: boolean;
|
||||
};
|
||||
|
||||
export type Permission = PermissionCreateEntry & {
|
||||
_links: Links
|
||||
_links: Links;
|
||||
};
|
||||
|
||||
export type PermissionCollection = Permission[];
|
||||
@@ -1,13 +0,0 @@
|
||||
// @flow
|
||||
|
||||
import type {Links} from "./hal";
|
||||
|
||||
export type RepositoryRole = {
|
||||
name: string,
|
||||
verbs: string[],
|
||||
type?: string,
|
||||
creationDate?: string,
|
||||
lastModified?: string,
|
||||
_links: Links
|
||||
};
|
||||
|
||||
10
scm-ui/ui-types/src/RepositoryRole.ts
Normal file
10
scm-ui/ui-types/src/RepositoryRole.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Links } from './hal';
|
||||
|
||||
export type RepositoryRole = {
|
||||
name: string;
|
||||
verbs: string[];
|
||||
type?: string;
|
||||
creationDate?: string;
|
||||
lastModified?: string;
|
||||
_links: Links;
|
||||
};
|
||||
@@ -1,14 +0,0 @@
|
||||
// @flow
|
||||
|
||||
import type { Collection } from "./hal";
|
||||
|
||||
export type RepositoryType = {
|
||||
name: string,
|
||||
displayName: string
|
||||
};
|
||||
|
||||
export type RepositoryTypeCollection = Collection & {
|
||||
_embedded: {
|
||||
repositoryTypes: RepositoryType[]
|
||||
}
|
||||
};
|
||||
12
scm-ui/ui-types/src/RepositoryTypes.ts
Normal file
12
scm-ui/ui-types/src/RepositoryTypes.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Collection } from './hal';
|
||||
|
||||
export type RepositoryType = {
|
||||
name: string;
|
||||
displayName: string;
|
||||
};
|
||||
|
||||
export type RepositoryTypeCollection = Collection & {
|
||||
_embedded: {
|
||||
repositoryTypes: RepositoryType[];
|
||||
};
|
||||
};
|
||||
@@ -1,25 +0,0 @@
|
||||
// @flow
|
||||
|
||||
import type { Links } from "./hal";
|
||||
|
||||
// TODO ?? check ?? links
|
||||
export type SubRepository = {
|
||||
repositoryUrl: string,
|
||||
browserUrl: string,
|
||||
revision: string
|
||||
};
|
||||
|
||||
export type File = {
|
||||
name: string,
|
||||
path: string,
|
||||
directory: boolean,
|
||||
description?: string,
|
||||
revision: string,
|
||||
length: number,
|
||||
lastModified?: string,
|
||||
subRepository?: SubRepository, // TODO
|
||||
_links: Links,
|
||||
_embedded: {
|
||||
children: ?File[]
|
||||
}
|
||||
};
|
||||
23
scm-ui/ui-types/src/Sources.ts
Normal file
23
scm-ui/ui-types/src/Sources.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { Links } from './hal';
|
||||
|
||||
// TODO ?? check ?? links
|
||||
export type SubRepository = {
|
||||
repositoryUrl: string;
|
||||
browserUrl: string;
|
||||
revision: string;
|
||||
};
|
||||
|
||||
export type File = {
|
||||
name: string;
|
||||
path: string;
|
||||
directory: boolean;
|
||||
description?: string;
|
||||
revision: string;
|
||||
length: number;
|
||||
lastModified?: string;
|
||||
subRepository?: SubRepository; // TODO
|
||||
_links: Links;
|
||||
_embedded: {
|
||||
children: File[] | null | undefined;
|
||||
};
|
||||
};
|
||||
@@ -1,8 +0,0 @@
|
||||
//@flow
|
||||
import type { Links } from "./hal";
|
||||
|
||||
export type Tag = {
|
||||
name: string,
|
||||
revision: string,
|
||||
_links: Links
|
||||
}
|
||||
7
scm-ui/ui-types/src/Tags.ts
Normal file
7
scm-ui/ui-types/src/Tags.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { Links } from './hal';
|
||||
|
||||
export type Tag = {
|
||||
name: string;
|
||||
revision: string;
|
||||
_links: Links;
|
||||
};
|
||||
@@ -1,20 +0,0 @@
|
||||
//@flow
|
||||
import type { Links } from "./hal";
|
||||
|
||||
export type DisplayedUser = {
|
||||
id: string,
|
||||
displayName: string,
|
||||
mail: string
|
||||
};
|
||||
|
||||
export type User = {
|
||||
displayName: string,
|
||||
name: string,
|
||||
mail: string,
|
||||
password: string,
|
||||
active: boolean,
|
||||
type?: string,
|
||||
creationDate?: string,
|
||||
lastModified?: string,
|
||||
_links: Links
|
||||
};
|
||||
19
scm-ui/ui-types/src/User.ts
Normal file
19
scm-ui/ui-types/src/User.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Links } from './hal';
|
||||
|
||||
export type DisplayedUser = {
|
||||
id: string;
|
||||
displayName: string;
|
||||
mail: string;
|
||||
};
|
||||
|
||||
export type User = {
|
||||
displayName: string;
|
||||
name: string;
|
||||
mail: string;
|
||||
password: string;
|
||||
active: boolean;
|
||||
type?: string;
|
||||
creationDate?: string;
|
||||
lastModified?: string;
|
||||
_links: Links;
|
||||
};
|
||||
@@ -1,21 +1,22 @@
|
||||
// @flow
|
||||
export type Link = {
|
||||
href: string,
|
||||
name?: string
|
||||
href: string;
|
||||
name?: string;
|
||||
};
|
||||
|
||||
type LinkValue = Link | Link[];
|
||||
|
||||
// TODO use LinkValue
|
||||
export type Links = { [string]: any };
|
||||
export type Links = {
|
||||
[key: string]: any;
|
||||
};
|
||||
|
||||
export type Collection = {
|
||||
_embedded: Object,
|
||||
_embedded: object;
|
||||
// $FlowFixMe
|
||||
_links: Links
|
||||
_links: Links;
|
||||
};
|
||||
|
||||
export type PagedCollection = Collection & {
|
||||
page: number,
|
||||
pageTotal: number
|
||||
page: number;
|
||||
pageTotal: number;
|
||||
};
|
||||
@@ -1,32 +0,0 @@
|
||||
// @flow
|
||||
export type { Action } from "./Action";
|
||||
export type { Link, Links, Collection, PagedCollection } from "./hal";
|
||||
|
||||
export type { Me } from "./Me";
|
||||
export type { DisplayedUser, User } from "./User";
|
||||
export type { Group, Member } from "./Group";
|
||||
|
||||
export type { Repository, RepositoryCollection, RepositoryGroup } from "./Repositories";
|
||||
export type { RepositoryType, RepositoryTypeCollection } from "./RepositoryTypes";
|
||||
|
||||
export type { Branch, BranchRequest } from "./Branches";
|
||||
|
||||
export type { Changeset } from "./Changesets";
|
||||
|
||||
export type { Tag } from "./Tags";
|
||||
|
||||
export type { Config } from "./Config";
|
||||
|
||||
export type { IndexResources } from "./IndexResources";
|
||||
|
||||
export type { Permission, PermissionCreateEntry, PermissionCollection } from "./RepositoryPermissions";
|
||||
|
||||
export type { SubRepository, File } from "./Sources";
|
||||
|
||||
export type { SelectValue, AutocompleteObject } from "./Autocomplete";
|
||||
|
||||
export type { Plugin, PluginCollection, PluginGroup, PendingPlugins } from "./Plugin";
|
||||
|
||||
export type { RepositoryRole } from "./RepositoryRole";
|
||||
|
||||
export type { NamespaceStrategies } from "./NamespaceStrategies";
|
||||
31
scm-ui/ui-types/src/index.ts
Normal file
31
scm-ui/ui-types/src/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
export { Action } from "./Action";
|
||||
export { Link, Links, Collection, PagedCollection } from "./hal";
|
||||
|
||||
export { Me } from "./Me";
|
||||
export { DisplayedUser, User } from "./User";
|
||||
export { Group, Member } from "./Group";
|
||||
|
||||
export { Repository, RepositoryCollection, RepositoryGroup } from "./Repositories";
|
||||
export { RepositoryType, RepositoryTypeCollection } from "./RepositoryTypes";
|
||||
|
||||
export { Branch, BranchRequest } from "./Branches";
|
||||
|
||||
export { Changeset } from "./Changesets";
|
||||
|
||||
export { Tag } from "./Tags";
|
||||
|
||||
export { Config } from "./Config";
|
||||
|
||||
export { IndexResources } from "./IndexResources";
|
||||
|
||||
export { Permission, PermissionCreateEntry, PermissionCollection } from "./RepositoryPermissions";
|
||||
|
||||
export { SubRepository, File } from "./Sources";
|
||||
|
||||
export { SelectValue, AutocompleteObject } from "./Autocomplete";
|
||||
|
||||
export { Plugin, PluginCollection, PluginGroup, PendingPlugins } from "./Plugin";
|
||||
|
||||
export { RepositoryRole } from "./RepositoryRole";
|
||||
|
||||
export { NamespaceStrategies } from "./NamespaceStrategies";
|
||||
Reference in New Issue
Block a user