use reflow to migrate from flow to typescript

This commit is contained in:
Sebastian Sdorra
2019-10-19 16:38:07 +02:00
parent f7b8050dfa
commit 6e7a08a3bb
495 changed files with 14239 additions and 13766 deletions

View File

@@ -1,7 +0,0 @@
// @flow
export type Action = {
type: string,
payload?: any,
itemId?: string | number,
resetPending?: boolean
};

View File

@@ -0,0 +1,6 @@
export type Action = {
type: string;
payload?: any;
itemId?: string | number;
resetPending?: boolean;
};

View File

@@ -1,10 +0,0 @@
// @flow
export type AutocompleteObject = {
id: string,
displayName: string
};
export type SelectValue = {
value: AutocompleteObject,
label: string
};

View File

@@ -0,0 +1,9 @@
export type AutocompleteObject = {
id: string;
displayName: string;
};
export type SelectValue = {
value: AutocompleteObject;
label: string;
};

View File

@@ -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
}

View 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;
};

View File

@@ -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
}

View 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;
};

View File

@@ -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
};

View 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;
};

View File

@@ -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
};

View 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;
};

View File

@@ -1,7 +0,0 @@
//@flow
import type { Links } from "./hal";
export type IndexResources = {
version: string,
_links: Links
};

View File

@@ -0,0 +1,6 @@
import { Links } from './hal';
export type IndexResources = {
version: string;
_links: Links;
};

View File

@@ -1,11 +0,0 @@
// @flow
import type { Links } from "./hal";
export type Me = {
name: string,
displayName: string,
mail: string,
groups: [],
_links: Links
};

View File

@@ -0,0 +1,9 @@
import { Links } from './hal';
export type Me = {
name: string;
displayName: string;
mail: string;
groups: [];
_links: Links;
};

View File

@@ -1,9 +0,0 @@
// @flow
import type { Links } from "./hal";
export type NamespaceStrategies = {
current: string,
available: string[],
_links: Links
};

View File

@@ -0,0 +1,7 @@
import { Links } from './hal';
export type NamespaceStrategies = {
current: string;
available: string[];
_links: Links;
};

View File

@@ -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: []
}
}

View 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: [];
};
};

View File

@@ -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[]
};

View 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[];
};

View File

@@ -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[];

View File

@@ -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
};

View File

@@ -0,0 +1,10 @@
import { Links } from './hal';
export type RepositoryRole = {
name: string;
verbs: string[];
type?: string;
creationDate?: string;
lastModified?: string;
_links: Links;
};

View File

@@ -1,14 +0,0 @@
// @flow
import type { Collection } from "./hal";
export type RepositoryType = {
name: string,
displayName: string
};
export type RepositoryTypeCollection = Collection & {
_embedded: {
repositoryTypes: RepositoryType[]
}
};

View File

@@ -0,0 +1,12 @@
import { Collection } from './hal';
export type RepositoryType = {
name: string;
displayName: string;
};
export type RepositoryTypeCollection = Collection & {
_embedded: {
repositoryTypes: RepositoryType[];
};
};

View File

@@ -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[]
}
};

View 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;
};
};

View File

@@ -1,8 +0,0 @@
//@flow
import type { Links } from "./hal";
export type Tag = {
name: string,
revision: string,
_links: Links
}

View File

@@ -0,0 +1,7 @@
import { Links } from './hal';
export type Tag = {
name: string;
revision: string;
_links: Links;
};

View File

@@ -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
};

View 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;
};

View File

@@ -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;
};

View File

@@ -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";

View 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";