/* Generated by restful-react */ import React from 'react' import { Get, GetProps, useGet, UseGetProps, Mutate, MutateProps, useMutate, UseMutateProps } from 'restful-react' import { getConfigNew } from '../config' export const SPEC_VERSION = '1.0.0' export type EnumAccessGrant = number export type EnumParentResourceType = string export type EnumPathTargetType = string export type EnumTokenType = string export interface FormDataOpenapiLoginRequest { password?: string username?: string } export interface FormDataOpenapiRegisterRequest { password?: string username?: string } export interface OpenapiCalculateCommitDivergenceRequest { maxCount?: number requests?: RepoDivergenceRequest[] | null } export type OpenapiContent = RepoFileContent | OpenapiDirContent | RepoSymlinkContent | RepoSubmoduleContent export interface OpenapiContentInfo { latestCommit?: RepoCommit name?: string path?: string sha?: string type?: OpenapiContentType } export type OpenapiContentType = 'file' | 'dir' | 'symlink' | 'submodule' export interface OpenapiCreateBranchRequest { name?: string target?: string | null } export interface OpenapiCreatePathRequest { path?: string } export interface OpenapiCreateRepoPathRequest { path?: string } export interface OpenapiCreateRepositoryRequest { defaultBranch?: string description?: string forkId?: number gitIgnore?: string isPublic?: boolean license?: string parentID?: number readme?: boolean uid?: string } export interface OpenapiCreateSpaceRequest { description?: string isPublic?: boolean parentId?: number uid?: string } export interface OpenapiCurrentUserResponse { data?: TypesUser status?: 'SUCCESS' | 'FAILURE' | 'ERROR' } export interface OpenapiDirContent { entries?: OpenapiContentInfo[] | null } export interface OpenapiGetContentOutput { content?: OpenapiContent latestCommit?: RepoCommit name?: string path?: string sha?: string type?: OpenapiContentType } export interface OpenapiMoveRepoRequest { keepAsAlias?: boolean parentId?: number | null uid?: string | null } export interface OpenapiMoveSpaceRequest { keepAsAlias?: boolean parentId?: number | null uid?: string | null } export interface OpenapiUpdateRepoRequest { description?: string | null isPublic?: boolean | null } export interface OpenapiUpdateSpaceRequest { description?: string | null isPublic?: boolean | null } export interface RepoBranch { commit?: RepoCommit name?: string sha?: string } export interface RepoCommit { author?: RepoSignature committer?: RepoSignature message?: string sha?: string title?: string } export interface RepoCommitTag { commit?: RepoCommit isAnnotated?: boolean message?: string name?: string sha?: string tagger?: RepoSignature title?: string } // tslint:disable-next-line:no-empty-interface export interface RepoContent {} export interface RepoContentInfo { latestCommit?: RepoCommit name?: string path?: string sha?: string type?: RepoContentType } export type RepoContentType = string export interface RepoDivergence { ahead?: number behind?: number } export interface RepoDivergenceRequest { from?: string to?: string } export interface RepoFileContent { data?: string encoding?: RepoFileEncodingType size?: number } export type RepoFileEncodingType = string export interface RepoIdentity { email?: string name?: string } export interface RepoSignature { identity?: RepoIdentity when?: string } export interface RepoSubmoduleContent { commitSha?: string url?: string } export interface RepoSymlinkContent { size?: number target?: string } export interface TypesPath { created?: number createdBy?: number id?: number isAlias?: boolean targetId?: number targetType?: EnumPathTargetType updated?: number value?: string } export interface TypesRepository { created?: number createdBy?: number defaultBranch?: string description?: string forkId?: number gitUrl?: string id?: number isPublic?: boolean numClosedPulls?: number numForks?: number numOpenPulls?: number numPulls?: number parentId?: number path?: string uid?: string updated?: number } export interface TypesServiceAccount { blocked?: boolean created?: number displayName?: string email?: string parentId?: number parentType?: EnumParentResourceType uid?: string updated?: number } export interface TypesSpace { created?: number createdBy?: number description?: string id?: number isPublic?: boolean parentId?: number path?: string uid?: string updated?: number } export interface TypesToken { createdBy?: number expiresAt?: number grants?: EnumAccessGrant issuedAt?: number principalId?: number type?: EnumTokenType uid?: string } export interface TypesTokenResponse { access_token?: string token?: TypesToken } export interface TypesUser { admin?: boolean blocked?: boolean created?: number displayName?: string email?: string uid?: string updated?: number } export interface TypesUserInput { admin?: boolean | null email?: string | null name?: string | null password?: string | null } export interface UserUpdateInput { displayName?: string | null email?: string | null password?: string | null } export interface UsererrorError { message?: string } export type GetCurrentUserProps = Omit, 'path'> export const GetCurrentUser = (props: GetCurrentUserProps) => ( path={`/api/user/currentUser`} base={getConfigNew('scm')} {...props} /> ) export type UseGetCurrentUserProps = Omit, 'path'> export const useGetCurrentUser = (props: UseGetCurrentUserProps) => useGet(`/api/user/currentUser`, { base: getConfigNew('scm'), ...props }) export type OnLoginProps = Omit, 'path' | 'verb'> export const OnLogin = (props: OnLoginProps) => ( verb="POST" path={`/login`} base={getConfigNew('scm')} {...props} /> ) export type UseOnLoginProps = Omit< UseMutateProps, 'path' | 'verb' > export const useOnLogin = (props: UseOnLoginProps) => useMutate('POST', `/login`, { base: getConfigNew('scm'), ...props }) export type OnRegisterProps = Omit, 'path' | 'verb'> export const OnRegister = (props: OnRegisterProps) => ( verb="POST" path={`/register`} base={getConfigNew('scm')} {...props} /> ) export type UseOnRegisterProps = Omit< UseMutateProps, 'path' | 'verb' > export const useOnRegister = (props: UseOnRegisterProps) => useMutate('POST', `/register`, { base: getConfigNew('scm'), ...props }) export interface CreateRepositoryQueryParams { /** * path of parent space (Not needed in standalone). */ spacePath?: string } export type CreateRepositoryProps = Omit< MutateProps, 'path' | 'verb' > export const CreateRepository = (props: CreateRepositoryProps) => ( verb="POST" path={`/repos`} base={getConfigNew('scm')} {...props} /> ) export type UseCreateRepositoryProps = Omit< UseMutateProps, 'path' | 'verb' > export const useCreateRepository = (props: UseCreateRepositoryProps) => useMutate( 'POST', `/repos`, { base: getConfigNew('scm'), ...props } ) export type DeleteRepositoryProps = Omit, 'path' | 'verb'> export const DeleteRepository = (props: DeleteRepositoryProps) => ( verb="DELETE" path={`/repos`} base={getConfigNew('scm')} {...props} /> ) export type UseDeleteRepositoryProps = Omit, 'path' | 'verb'> export const useDeleteRepository = (props: UseDeleteRepositoryProps) => useMutate('DELETE', `/repos`, { base: getConfigNew('scm'), ...props }) export interface FindRepositoryPathParams { repoRef: string } export type FindRepositoryProps = Omit< GetProps, 'path' > & FindRepositoryPathParams export const FindRepository = ({ repoRef, ...props }: FindRepositoryProps) => ( path={`/repos/${repoRef}`} base={getConfigNew('scm')} {...props} /> ) export type UseFindRepositoryProps = Omit< UseGetProps, 'path' > & FindRepositoryPathParams export const useFindRepository = ({ repoRef, ...props }: UseFindRepositoryProps) => useGet( (paramsInPath: FindRepositoryPathParams) => `/repos/${paramsInPath.repoRef}`, { base: getConfigNew('scm'), pathParams: { repoRef }, ...props } ) export interface UpdateRepositoryPathParams { repoRef: string } export type UpdateRepositoryProps = Omit< MutateProps, 'path' | 'verb' > & UpdateRepositoryPathParams export const UpdateRepository = ({ repoRef, ...props }: UpdateRepositoryProps) => ( verb="PATCH" path={`/repos/${repoRef}`} base={getConfigNew('scm')} {...props} /> ) export type UseUpdateRepositoryProps = Omit< UseMutateProps, 'path' | 'verb' > & UpdateRepositoryPathParams export const useUpdateRepository = ({ repoRef, ...props }: UseUpdateRepositoryProps) => useMutate( 'PATCH', (paramsInPath: UpdateRepositoryPathParams) => `/repos/${paramsInPath.repoRef}`, { base: getConfigNew('scm'), pathParams: { repoRef }, ...props } ) export interface ListBranchesQueryParams { /** * Indicates whether optional commit information should be included in the response. */ include_commit?: boolean /** * The substring by which the branches are filtered. */ query?: string /** * The order of the output. */ direction?: 'asc' | 'desc' /** * The data by which the branches are sorted. */ sort?: 'name' | 'date' /** * The page to return. */ page?: number /** * The number of entries returned per page. */ per_page?: number } export interface ListBranchesPathParams { repoRef: string } export type ListBranchesProps = Omit< GetProps, 'path' > & ListBranchesPathParams export const ListBranches = ({ repoRef, ...props }: ListBranchesProps) => ( path={`/repos/${repoRef}/branches`} base={getConfigNew('scm')} {...props} /> ) export type UseListBranchesProps = Omit< UseGetProps, 'path' > & ListBranchesPathParams export const useListBranches = ({ repoRef, ...props }: UseListBranchesProps) => useGet( (paramsInPath: ListBranchesPathParams) => `/repos/${paramsInPath.repoRef}/branches`, { base: getConfigNew('scm'), pathParams: { repoRef }, ...props } ) export interface CreateBranchPathParams { repoRef: string } export type CreateBranchProps = Omit< MutateProps, 'path' | 'verb' > & CreateBranchPathParams export const CreateBranch = ({ repoRef, ...props }: CreateBranchProps) => ( verb="POST" path={`/repos/${repoRef}/branches`} base={getConfigNew('scm')} {...props} /> ) export type UseCreateBranchProps = Omit< UseMutateProps, 'path' | 'verb' > & CreateBranchPathParams export const useCreateBranch = ({ repoRef, ...props }: UseCreateBranchProps) => useMutate( 'POST', (paramsInPath: CreateBranchPathParams) => `/repos/${paramsInPath.repoRef}/branches`, { base: getConfigNew('scm'), pathParams: { repoRef }, ...props } ) export interface DeleteBranchPathParams { repoRef: string } export type DeleteBranchProps = Omit< MutateProps, 'path' | 'verb' > & DeleteBranchPathParams export const DeleteBranch = ({ repoRef, ...props }: DeleteBranchProps) => ( verb="DELETE" path={`/repos/${repoRef}/branches`} base={getConfigNew('scm')} {...props} /> ) export type UseDeleteBranchProps = Omit< UseMutateProps, 'path' | 'verb' > & DeleteBranchPathParams export const useDeleteBranch = ({ repoRef, ...props }: UseDeleteBranchProps) => useMutate( 'DELETE', (paramsInPath: DeleteBranchPathParams) => `/repos/${paramsInPath.repoRef}/branches`, { base: getConfigNew('scm'), pathParams: { repoRef }, ...props } ) export interface ListCommitsQueryParams { /** * The git reference (branch / tag / commitID) that will be used to retrieve the data. If no value is provided the default branch of the repository is used. */ git_ref?: string /** * The page to return. */ page?: number /** * The number of entries returned per page. */ per_page?: number } export interface ListCommitsPathParams { repoRef: string } export type ListCommitsProps = Omit< GetProps, 'path' > & ListCommitsPathParams export const ListCommits = ({ repoRef, ...props }: ListCommitsProps) => ( path={`/repos/${repoRef}/commits`} base={getConfigNew('scm')} {...props} /> ) export type UseListCommitsProps = Omit< UseGetProps, 'path' > & ListCommitsPathParams export const useListCommits = ({ repoRef, ...props }: UseListCommitsProps) => useGet( (paramsInPath: ListCommitsPathParams) => `/repos/${paramsInPath.repoRef}/commits`, { base: getConfigNew('scm'), pathParams: { repoRef }, ...props } ) export interface CalculateCommitDivergencePathParams { repoRef: string } export type CalculateCommitDivergenceProps = Omit< MutateProps< RepoDivergence[], UsererrorError, void, OpenapiCalculateCommitDivergenceRequest, CalculateCommitDivergencePathParams >, 'path' | 'verb' > & CalculateCommitDivergencePathParams export const CalculateCommitDivergence = ({ repoRef, ...props }: CalculateCommitDivergenceProps) => ( verb="POST" path={`/repos/${repoRef}/commits/calculate_divergence`} base={getConfigNew('scm')} {...props} /> ) export type UseCalculateCommitDivergenceProps = Omit< UseMutateProps< RepoDivergence[], UsererrorError, void, OpenapiCalculateCommitDivergenceRequest, CalculateCommitDivergencePathParams >, 'path' | 'verb' > & CalculateCommitDivergencePathParams export const useCalculateCommitDivergence = ({ repoRef, ...props }: UseCalculateCommitDivergenceProps) => useMutate< RepoDivergence[], UsererrorError, void, OpenapiCalculateCommitDivergenceRequest, CalculateCommitDivergencePathParams >( 'POST', (paramsInPath: CalculateCommitDivergencePathParams) => `/repos/${paramsInPath.repoRef}/commits/calculate_divergence`, { base: getConfigNew('scm'), pathParams: { repoRef }, ...props } ) export interface GetContentQueryParams { /** * The git reference (branch / tag / commitID) that will be used to retrieve the data. If no value is provided the default branch of the repository is used. */ git_ref?: string /** * Indicates whether optional commit information should be included in the response. */ include_commit?: boolean } export interface GetContentPathParams { repoRef: string path: string } export type GetContentProps = Omit< GetProps, 'path' > & GetContentPathParams export const GetContent = ({ repoRef, path, ...props }: GetContentProps) => ( path={`/repos/${repoRef}/content/${path}`} base={getConfigNew('scm')} {...props} /> ) export type UseGetContentProps = Omit< UseGetProps, 'path' > & GetContentPathParams export const useGetContent = ({ repoRef, path, ...props }: UseGetContentProps) => useGet( (paramsInPath: GetContentPathParams) => `/repos/${paramsInPath.repoRef}/content/${paramsInPath.path}`, { base: getConfigNew('scm'), pathParams: { repoRef, path }, ...props } ) export interface MoveRepositoryPathParams { repoRef: string } export type MoveRepositoryProps = Omit< MutateProps, 'path' | 'verb' > & MoveRepositoryPathParams export const MoveRepository = ({ repoRef, ...props }: MoveRepositoryProps) => ( verb="POST" path={`/repos/${repoRef}/move`} base={getConfigNew('scm')} {...props} /> ) export type UseMoveRepositoryProps = Omit< UseMutateProps, 'path' | 'verb' > & MoveRepositoryPathParams export const useMoveRepository = ({ repoRef, ...props }: UseMoveRepositoryProps) => useMutate( 'POST', (paramsInPath: MoveRepositoryPathParams) => `/repos/${paramsInPath.repoRef}/move`, { base: getConfigNew('scm'), pathParams: { repoRef }, ...props } ) export interface ListRepositoryPathsQueryParams { /** * The page to return. */ page?: number /** * The number of entries returned per page. */ per_page?: number } export interface ListRepositoryPathsPathParams { repoRef: string } export type ListRepositoryPathsProps = Omit< GetProps, 'path' > & ListRepositoryPathsPathParams export const ListRepositoryPaths = ({ repoRef, ...props }: ListRepositoryPathsProps) => ( path={`/repos/${repoRef}/paths`} base={getConfigNew('scm')} {...props} /> ) export type UseListRepositoryPathsProps = Omit< UseGetProps, 'path' > & ListRepositoryPathsPathParams export const useListRepositoryPaths = ({ repoRef, ...props }: UseListRepositoryPathsProps) => useGet( (paramsInPath: ListRepositoryPathsPathParams) => `/repos/${paramsInPath.repoRef}/paths`, { base: getConfigNew('scm'), pathParams: { repoRef }, ...props } ) export interface CreateRepositoryPathPathParams { repoRef: string } export type CreateRepositoryPathProps = Omit< MutateProps, 'path' | 'verb' > & CreateRepositoryPathPathParams export const CreateRepositoryPath = ({ repoRef, ...props }: CreateRepositoryPathProps) => ( verb="POST" path={`/repos/${repoRef}/paths`} base={getConfigNew('scm')} {...props} /> ) export type UseCreateRepositoryPathProps = Omit< UseMutateProps, 'path' | 'verb' > & CreateRepositoryPathPathParams export const useCreateRepositoryPath = ({ repoRef, ...props }: UseCreateRepositoryPathProps) => useMutate( 'POST', (paramsInPath: CreateRepositoryPathPathParams) => `/repos/${paramsInPath.repoRef}/paths`, { base: getConfigNew('scm'), pathParams: { repoRef }, ...props } ) export interface DeleteRepositoryPathPathParams { repoRef: string } export type DeleteRepositoryPathProps = Omit< MutateProps, 'path' | 'verb' > & DeleteRepositoryPathPathParams export const DeleteRepositoryPath = ({ repoRef, ...props }: DeleteRepositoryPathProps) => ( verb="DELETE" path={`/repos/${repoRef}/paths`} base={getConfigNew('scm')} {...props} /> ) export type UseDeleteRepositoryPathProps = Omit< UseMutateProps, 'path' | 'verb' > & DeleteRepositoryPathPathParams export const useDeleteRepositoryPath = ({ repoRef, ...props }: UseDeleteRepositoryPathProps) => useMutate( 'DELETE', (paramsInPath: DeleteRepositoryPathPathParams) => `/repos/${paramsInPath.repoRef}/paths`, { base: getConfigNew('scm'), pathParams: { repoRef }, ...props } ) export interface ListRepositoryServiceAccountsPathParams { repoRef: string } export type ListRepositoryServiceAccountsProps = Omit< GetProps, 'path' > & ListRepositoryServiceAccountsPathParams export const ListRepositoryServiceAccounts = ({ repoRef, ...props }: ListRepositoryServiceAccountsProps) => ( path={`/repos/${repoRef}/service_accounts`} base={getConfigNew('scm')} {...props} /> ) export type UseListRepositoryServiceAccountsProps = Omit< UseGetProps, 'path' > & ListRepositoryServiceAccountsPathParams export const useListRepositoryServiceAccounts = ({ repoRef, ...props }: UseListRepositoryServiceAccountsProps) => useGet( (paramsInPath: ListRepositoryServiceAccountsPathParams) => `/repos/${paramsInPath.repoRef}/service_accounts`, { base: getConfigNew('scm'), pathParams: { repoRef }, ...props } ) export interface ListTagsQueryParams { /** * Indicates whether optional commit information should be included in the response. */ include_commit?: boolean /** * The substring by which the tags are filtered. */ query?: string /** * The order of the output. */ direction?: 'asc' | 'desc' /** * The data by which the tags are sorted. */ sort?: 'name' | 'date' /** * The page to return. */ page?: number /** * The number of entries returned per page. */ per_page?: number } export interface ListTagsPathParams { repoRef: string } export type ListTagsProps = Omit< GetProps, 'path' > & ListTagsPathParams export const ListTags = ({ repoRef, ...props }: ListTagsProps) => ( path={`/repos/${repoRef}/tags`} base={getConfigNew('scm')} {...props} /> ) export type UseListTagsProps = Omit< UseGetProps, 'path' > & ListTagsPathParams export const useListTags = ({ repoRef, ...props }: UseListTagsProps) => useGet( (paramsInPath: ListTagsPathParams) => `/repos/${paramsInPath.repoRef}/tags`, { base: getConfigNew('scm'), pathParams: { repoRef }, ...props } ) export type ListGitignoreProps = Omit, 'path'> export const ListGitignore = (props: ListGitignoreProps) => ( path={`/resources/gitignore`} base={getConfigNew('scm')} {...props} /> ) export type UseListGitignoreProps = Omit, 'path'> export const useListGitignore = (props: UseListGitignoreProps) => useGet(`/resources/gitignore`, { base: getConfigNew('scm'), ...props }) export interface ListLicensesResponse { label?: string value?: string } ;[] export type ListLicensesProps = Omit, 'path'> export const ListLicenses = (props: ListLicensesProps) => ( path={`/resources/license`} base={getConfigNew('scm')} {...props} /> ) export type UseListLicensesProps = Omit, 'path'> export const useListLicenses = (props: UseListLicensesProps) => useGet(`/resources/license`, { base: getConfigNew('scm'), ...props }) export type CreateSpaceProps = Omit< MutateProps, 'path' | 'verb' > export const CreateSpace = (props: CreateSpaceProps) => ( verb="POST" path={`/spaces`} base={getConfigNew('scm')} {...props} /> ) export type UseCreateSpaceProps = Omit< UseMutateProps, 'path' | 'verb' > export const useCreateSpace = (props: UseCreateSpaceProps) => useMutate('POST', `/spaces`, { base: getConfigNew('scm'), ...props }) export type DeleteSpaceProps = Omit, 'path' | 'verb'> export const DeleteSpace = (props: DeleteSpaceProps) => ( verb="DELETE" path={`/spaces`} base={getConfigNew('scm')} {...props} /> ) export type UseDeleteSpaceProps = Omit, 'path' | 'verb'> export const useDeleteSpace = (props: UseDeleteSpaceProps) => useMutate('DELETE', `/spaces`, { base: getConfigNew('scm'), ...props }) export interface GetSpacePathParams { spaceRef: string } export type GetSpaceProps = Omit, 'path'> & GetSpacePathParams export const GetSpace = ({ spaceRef, ...props }: GetSpaceProps) => ( path={`/spaces/${spaceRef}`} base={getConfigNew('scm')} {...props} /> ) export type UseGetSpaceProps = Omit, 'path'> & GetSpacePathParams export const useGetSpace = ({ spaceRef, ...props }: UseGetSpaceProps) => useGet( (paramsInPath: GetSpacePathParams) => `/spaces/${paramsInPath.spaceRef}`, { base: getConfigNew('scm'), pathParams: { spaceRef }, ...props } ) export interface UpdateSpacePathParams { spaceRef: string } export type UpdateSpaceProps = Omit< MutateProps, 'path' | 'verb' > & UpdateSpacePathParams export const UpdateSpace = ({ spaceRef, ...props }: UpdateSpaceProps) => ( verb="PATCH" path={`/spaces/${spaceRef}`} base={getConfigNew('scm')} {...props} /> ) export type UseUpdateSpaceProps = Omit< UseMutateProps, 'path' | 'verb' > & UpdateSpacePathParams export const useUpdateSpace = ({ spaceRef, ...props }: UseUpdateSpaceProps) => useMutate( 'PATCH', (paramsInPath: UpdateSpacePathParams) => `/spaces/${paramsInPath.spaceRef}`, { base: getConfigNew('scm'), pathParams: { spaceRef }, ...props } ) export interface MoveSpacePathParams { spaceRef: string } export type MoveSpaceProps = Omit< MutateProps, 'path' | 'verb' > & MoveSpacePathParams export const MoveSpace = ({ spaceRef, ...props }: MoveSpaceProps) => ( verb="POST" path={`/spaces/${spaceRef}/move`} base={getConfigNew('scm')} {...props} /> ) export type UseMoveSpaceProps = Omit< UseMutateProps, 'path' | 'verb' > & MoveSpacePathParams export const useMoveSpace = ({ spaceRef, ...props }: UseMoveSpaceProps) => useMutate( 'POST', (paramsInPath: MoveSpacePathParams) => `/spaces/${paramsInPath.spaceRef}/move`, { base: getConfigNew('scm'), pathParams: { spaceRef }, ...props } ) export interface ListPathsQueryParams { /** * The page to return. */ page?: number /** * The number of entries returned per page. */ per_page?: number } export interface ListPathsPathParams { spaceRef: string } export type ListPathsProps = Omit< GetProps, 'path' > & ListPathsPathParams export const ListPaths = ({ spaceRef, ...props }: ListPathsProps) => ( path={`/spaces/${spaceRef}/paths`} base={getConfigNew('scm')} {...props} /> ) export type UseListPathsProps = Omit< UseGetProps, 'path' > & ListPathsPathParams export const useListPaths = ({ spaceRef, ...props }: UseListPathsProps) => useGet( (paramsInPath: ListPathsPathParams) => `/spaces/${paramsInPath.spaceRef}/paths`, { base: getConfigNew('scm'), pathParams: { spaceRef }, ...props } ) export interface CreatePathPathParams { spaceRef: string } export type CreatePathProps = Omit< MutateProps, 'path' | 'verb' > & CreatePathPathParams export const CreatePath = ({ spaceRef, ...props }: CreatePathProps) => ( verb="POST" path={`/spaces/${spaceRef}/paths`} base={getConfigNew('scm')} {...props} /> ) export type UseCreatePathProps = Omit< UseMutateProps, 'path' | 'verb' > & CreatePathPathParams export const useCreatePath = ({ spaceRef, ...props }: UseCreatePathProps) => useMutate( 'POST', (paramsInPath: CreatePathPathParams) => `/spaces/${paramsInPath.spaceRef}/paths`, { base: getConfigNew('scm'), pathParams: { spaceRef }, ...props } ) export interface DeletePathPathParams { spaceRef: string } export type DeletePathProps = Omit< MutateProps, 'path' | 'verb' > & DeletePathPathParams export const DeletePath = ({ spaceRef, ...props }: DeletePathProps) => ( verb="DELETE" path={`/spaces/${spaceRef}/paths`} base={getConfigNew('scm')} {...props} /> ) export type UseDeletePathProps = Omit< UseMutateProps, 'path' | 'verb' > & DeletePathPathParams export const useDeletePath = ({ spaceRef, ...props }: UseDeletePathProps) => useMutate( 'DELETE', (paramsInPath: DeletePathPathParams) => `/spaces/${paramsInPath.spaceRef}/paths`, { base: getConfigNew('scm'), pathParams: { spaceRef }, ...props } ) export interface ListReposQueryParams { /** * The substring which is used to filter the repositories by their path name. */ query?: string /** * The data by which the repositories are sorted. */ sort?: 'uid' | 'path' | 'created' | 'updated' /** * The order of the output. */ direction?: 'asc' | 'desc' /** * The page to return. */ page?: number /** * The number of entries returned per page. */ per_page?: number } export interface ListReposPathParams { spaceRef: string } export type ListReposProps = Omit< GetProps, 'path' > & ListReposPathParams export const ListRepos = ({ spaceRef, ...props }: ListReposProps) => ( path={`/spaces/${spaceRef}/repos`} base={getConfigNew('scm')} {...props} /> ) export type UseListReposProps = Omit< UseGetProps, 'path' > & ListReposPathParams export const useListRepos = ({ spaceRef, ...props }: UseListReposProps) => useGet( (paramsInPath: ListReposPathParams) => `/spaces/${paramsInPath.spaceRef}/repos`, { base: getConfigNew('scm'), pathParams: { spaceRef }, ...props } ) export interface ListServiceAccountsPathParams { spaceRef: string } export type ListServiceAccountsProps = Omit< GetProps, 'path' > & ListServiceAccountsPathParams export const ListServiceAccounts = ({ spaceRef, ...props }: ListServiceAccountsProps) => ( path={`/spaces/${spaceRef}/service_accounts`} base={getConfigNew('scm')} {...props} /> ) export type UseListServiceAccountsProps = Omit< UseGetProps, 'path' > & ListServiceAccountsPathParams export const useListServiceAccounts = ({ spaceRef, ...props }: UseListServiceAccountsProps) => useGet( (paramsInPath: ListServiceAccountsPathParams) => `/spaces/${paramsInPath.spaceRef}/service_accounts`, { base: getConfigNew('scm'), pathParams: { spaceRef }, ...props } ) export interface ListSpacesQueryParams { /** * The substring which is used to filter the spaces by their path name. */ query?: string /** * The data by which the spaces are sorted. */ sort?: 'uid' | 'path' | 'created' | 'updated' /** * The order of the output. */ direction?: 'asc' | 'desc' /** * The page to return. */ page?: number /** * The number of entries returned per page. */ per_page?: number } export interface ListSpacesPathParams { spaceRef: string } export type ListSpacesProps = Omit< GetProps, 'path' > & ListSpacesPathParams export const ListSpaces = ({ spaceRef, ...props }: ListSpacesProps) => ( path={`/spaces/${spaceRef}/spaces`} base={getConfigNew('scm')} {...props} /> ) export type UseListSpacesProps = Omit< UseGetProps, 'path' > & ListSpacesPathParams export const useListSpaces = ({ spaceRef, ...props }: UseListSpacesProps) => useGet( (paramsInPath: ListSpacesPathParams) => `/spaces/${paramsInPath.spaceRef}/spaces`, { base: getConfigNew('scm'), pathParams: { spaceRef }, ...props } ) export type GetUserProps = Omit, 'path'> export const GetUser = (props: GetUserProps) => ( path={`/user`} base={getConfigNew('scm')} {...props} /> ) export type UseGetUserProps = Omit, 'path'> export const useGetUser = (props: UseGetUserProps) => useGet(`/user`, { base: getConfigNew('scm'), ...props }) export type UpdateUserProps = Omit, 'path' | 'verb'> export const UpdateUser = (props: UpdateUserProps) => ( verb="PATCH" path={`/user`} base={getConfigNew('scm')} {...props} /> ) export type UseUpdateUserProps = Omit< UseMutateProps, 'path' | 'verb' > export const useUpdateUser = (props: UseUpdateUserProps) => useMutate('PATCH', `/user`, { base: getConfigNew('scm'), ...props }) export type CreateTokenProps = Omit< MutateProps, 'path' | 'verb' > export const CreateToken = (props: CreateTokenProps) => ( verb="POST" path={`/user/token`} base={getConfigNew('scm')} {...props} /> ) export type UseCreateTokenProps = Omit< UseMutateProps, 'path' | 'verb' > export const useCreateToken = (props: UseCreateTokenProps) => useMutate('POST', `/user/token`, { base: getConfigNew('scm'), ...props }) export interface ListUsersQueryParams { sort?: 'id' | 'email' | 'created' | 'updated' direction?: 'asc' | 'desc' page?: number per_page?: number } export type ListUsersProps = Omit, 'path'> export const ListUsers = (props: ListUsersProps) => ( path={`/users`} base={getConfigNew('scm')} {...props} /> ) export type UseListUsersProps = Omit, 'path'> export const useListUsers = (props: UseListUsersProps) => useGet(`/users`, { base: getConfigNew('scm'), ...props }) export type CreateUserProps = Omit, 'path' | 'verb'> export const CreateUser = (props: CreateUserProps) => ( verb="POST" path={`/users`} base={getConfigNew('scm')} {...props} /> ) export type UseCreateUserProps = Omit< UseMutateProps, 'path' | 'verb' > export const useCreateUser = (props: UseCreateUserProps) => useMutate('POST', `/users`, { base: getConfigNew('scm'), ...props }) export type DeleteUserProps = Omit, 'path' | 'verb'> export const DeleteUser = (props: DeleteUserProps) => ( verb="DELETE" path={`/users`} base={getConfigNew('scm')} {...props} /> ) export type UseDeleteUserProps = Omit, 'path' | 'verb'> export const useDeleteUser = (props: UseDeleteUserProps) => useMutate('DELETE', `/users`, { base: getConfigNew('scm'), ...props }) export interface GetUserEmailPathParams { email: string } export type GetUserEmailProps = Omit, 'path'> & GetUserEmailPathParams export const GetUserEmail = ({ email, ...props }: GetUserEmailProps) => ( path={`/users/${email}`} base={getConfigNew('scm')} {...props} /> ) export type UseGetUserEmailProps = Omit, 'path'> & GetUserEmailPathParams export const useGetUserEmail = ({ email, ...props }: UseGetUserEmailProps) => useGet( (paramsInPath: GetUserEmailPathParams) => `/users/${paramsInPath.email}`, { base: getConfigNew('scm'), pathParams: { email }, ...props } )