diff --git a/web/src/RouteDefinitions.ts b/web/src/RouteDefinitions.ts index 3432b60f4..65d79cc0b 100644 --- a/web/src/RouteDefinitions.ts +++ b/web/src/RouteDefinitions.ts @@ -45,7 +45,7 @@ export interface CODERoutes { toCODESpaceAccessControl: (args: Required>) => string toCODESpaceSettings: (args: Required>) => string - toCODEPipelines: (args: Required>) => string + toCODEPipelines: (args: Required>) => string toCODEPipelinesNew: (args: Required>) => string toCODESecrets: (args: Required>) => string @@ -74,8 +74,8 @@ export interface CODERoutes { toCODEWebhookDetails: (args: Required>) => string toCODESettings: (args: Required>) => string - toCODEExecutions: (args: Required>) => string - toCODEExecution: (args: Required>) => string + toCODEExecutions: (args: Required>) => string + toCODEExecution: (args: Required>) => string toCODESecret: (args: Required>) => string } @@ -96,7 +96,7 @@ export const routes: CODERoutes = { toCODESpaceAccessControl: ({ space }) => `/access-control/${space}`, toCODESpaceSettings: ({ space }) => `/settings/${space}`, - toCODEPipelines: ({ space }) => `/pipelines/${space}`, + toCODEPipelines: ({ repoPath }) => `/${repoPath}/pipelines`, toCODEPipelinesNew: ({ space }) => `/pipelines/${space}/new`, toCODESecrets: ({ space }) => `/secrets/${space}`, @@ -130,8 +130,7 @@ export const routes: CODERoutes = { toCODEWebhookNew: ({ repoPath }) => `/${repoPath}/webhooks/new`, toCODEWebhookDetails: ({ repoPath, webhookId }) => `/${repoPath}/webhook/${webhookId}`, - toCODEExecutions: ({ space, pipeline }) => `/pipelines/${space}/pipeline/${pipeline}`, - toCODEExecution: ({ space, pipeline, execution }) => - `/pipelines/${space}/pipeline/${pipeline}/execution/${execution}`, + toCODEExecutions: ({ repoPath, pipeline }) => `/${repoPath}/pipelines/${pipeline}`, + toCODEExecution: ({ repoPath, pipeline, execution }) => `/${repoPath}/pipelines/${pipeline}/execution/${execution}`, toCODESecret: ({ space, secret }) => `/secrets/${space}/secret/${secret}` } diff --git a/web/src/RouteDestinations.tsx b/web/src/RouteDestinations.tsx index bbcdc33ab..a30325981 100644 --- a/web/src/RouteDestinations.tsx +++ b/web/src/RouteDestinations.tsx @@ -167,7 +167,7 @@ export const RouteDestinations: React.FC = React.memo(function RouteDestinations {OPEN_SOURCE_PIPELINES && ( + @@ -195,7 +195,7 @@ export const RouteDestinations: React.FC = React.memo(function RouteDestinations )} {OPEN_SOURCE_PIPELINES && ( - + diff --git a/web/src/components/Console/Console.tsx b/web/src/components/Console/Console.tsx index 099e566fd..b482a0036 100644 --- a/web/src/components/Console/Console.tsx +++ b/web/src/components/Console/Console.tsx @@ -2,19 +2,20 @@ import React, { FC } from 'react' import { useParams } from 'react-router-dom' import { Container, Layout, Text } from '@harnessio/uicore' import { Color, FontVariation } from '@harnessio/design-system' -import { useGetSpaceParam } from 'hooks/useGetSpaceParam' import type { CODEProps } from 'RouteDefinitions' import type { TypesStage } from 'services/code' import ConsoleStep from 'components/ConsoleStep/ConsoleStep' import { timeDistance } from 'utils/Utils' +// import { useGetRepositoryMetadata } from 'hooks/useGetRepositoryMetadata' import css from './Console.module.scss' interface ConsoleProps { stage: TypesStage | undefined + repoPath: string } -const Console: FC = ({ stage }) => { - const space = useGetSpaceParam() +const Console: FC = ({ stage, repoPath }) => { + // const { repoMetadata, error, loading, refetch } = useGetRepositoryMetadata() const { pipeline, execution: executionNum } = useParams() return ( @@ -39,7 +40,7 @@ const Console: FC = ({ stage }) => { step={step} executionNumber={Number(executionNum)} pipelineName={pipeline} - spaceName={space} + repoPath={repoPath} stageNumber={stage.number} /> ))} diff --git a/web/src/components/ConsoleStep/ConsoleStep.tsx b/web/src/components/ConsoleStep/ConsoleStep.tsx index 337fc0c76..b09c5f5f5 100644 --- a/web/src/components/ConsoleStep/ConsoleStep.tsx +++ b/web/src/components/ConsoleStep/ConsoleStep.tsx @@ -12,18 +12,18 @@ import css from './ConsoleStep.module.scss' interface ConsoleStepProps { step: TypesStep | undefined stageNumber: number | undefined - spaceName: string + repoPath: string pipelineName: string | undefined executionNumber: number } -const ConsoleStep: FC = ({ step, stageNumber, spaceName, pipelineName, executionNumber }) => { +const ConsoleStep: FC = ({ step, stageNumber, repoPath, pipelineName, executionNumber }) => { const { getString } = useStrings() const [isOpened, setIsOpened] = React.useState(false) const { data, error, loading, refetch } = useGet({ - path: `/api/v1/pipelines/${spaceName}/${pipelineName}/+/executions/${executionNumber}/logs/${String( + path: `/api/v1/repos/${repoPath}/+/pipelines/${pipelineName}/executions/${executionNumber}/logs/${String( stageNumber )}/${String(step?.number)}`, lazy: true diff --git a/web/src/components/ExecutionStageList/ExecutionStageList.module.scss b/web/src/components/ExecutionStageList/ExecutionStageList.module.scss index a95292525..097a1d1cc 100644 --- a/web/src/components/ExecutionStageList/ExecutionStageList.module.scss +++ b/web/src/components/ExecutionStageList/ExecutionStageList.module.scss @@ -14,12 +14,15 @@ margin: 0.5rem 0 0.5rem 1rem !important; cursor: pointer; + &:not(:last-child) { + border-bottom: 1px solid var(--grey-100); + } + .layout { display: flex; align-items: center; min-height: var(--stage-title-height); padding: 0 var(--spacing-medium) 0 var(--spacing-medium); - border-radius: 10px 0 0 10px !important; &.selected { background-color: var(--primary-1); diff --git a/web/src/components/ExecutionStageList/ExecutionStageList.tsx b/web/src/components/ExecutionStageList/ExecutionStageList.tsx index 8364dad2a..e2c44a2c8 100644 --- a/web/src/components/ExecutionStageList/ExecutionStageList.tsx +++ b/web/src/components/ExecutionStageList/ExecutionStageList.tsx @@ -18,7 +18,7 @@ interface ExecutionStageProps { setSelectedStage: (selectedStage: number | null) => void } -const ExecutionStage: FC = ({ stage, isSelected = false, setSelectedStage = () => {} }) => { +const ExecutionStage: FC = ({ stage, isSelected = false, setSelectedStage }) => { return ( { const history = useHistory() const { routes } = useAppContext() - const params = useParams() const [selectedSpace, setSelectedSpace] = useState() const { repoMetadata, gitRef, commitRef } = useGetRepositoryMetadata() const { getString } = useStrings() @@ -26,7 +24,6 @@ export const DefaultMenu: React.FC = () => { [routeMatch] ) const isCommitSelected = useMemo(() => routeMatch.path === '/:space*/:repoName/commit/:commitRef*', [routeMatch]) - const isPipelineSelected = routeMatch.path.startsWith('/pipelines/:space*/pipeline/:pipeline') const { OPEN_SOURCE_PIPELINES, OPEN_SOURCE_SECRETS } = useFeatureFlag() return ( @@ -121,6 +118,17 @@ export const DefaultMenu: React.FC = () => { })} /> + {OPEN_SOURCE_PIPELINES && ( + + )} + { - {OPEN_SOURCE_PIPELINES && ( - - {/* icon is placeholder */} - - - )} - - {OPEN_SOURCE_PIPELINES && ( - - - - - - - - )} - {OPEN_SOURCE_SECRETS && ( {/* icon is placeholder */} diff --git a/web/src/pages/Execution/Execution.tsx b/web/src/pages/Execution/Execution.tsx index b8743f384..630bfa022 100644 --- a/web/src/pages/Execution/Execution.tsx +++ b/web/src/pages/Execution/Execution.tsx @@ -1,60 +1,80 @@ -import { Container, PageHeader, PageBody } from '@harnessio/uicore' +import { Container, PageBody } from '@harnessio/uicore' import React, { useState } from 'react' import cx from 'classnames' import { useParams } from 'react-router-dom' import { useGet } from 'restful-react' import SplitPane from 'react-split-pane' -import { useGetSpaceParam } from 'hooks/useGetSpaceParam' -import type { CODEProps } from 'RouteDefinitions' +import { routes, type CODEProps } from 'RouteDefinitions' import type { TypesExecution } from 'services/code' import ExecutionStageList from 'components/ExecutionStageList/ExecutionStageList' import Console from 'components/Console/Console' import { getErrorMessage, voidFn } from 'utils/Utils' import { useStrings } from 'framework/strings' import { LoadingSpinner } from 'components/LoadingSpinner/LoadingSpinner' +import { useGetRepositoryMetadata } from 'hooks/useGetRepositoryMetadata' +import { RepositoryPageHeader } from 'components/RepositoryPageHeader/RepositoryPageHeader' import noExecutionImage from '../RepositoriesListing/no-repo.svg' import css from './Execution.module.scss' const Execution = () => { - const space = useGetSpaceParam() const { pipeline, execution: executionNum } = useParams() const { getString } = useStrings() + const { repoMetadata, error, loading, refetch } = useGetRepositoryMetadata() + const { data: execution, - error, - loading, - refetch + error: executionError, + loading: executionLoading } = useGet({ - path: `/api/v1/pipelines/${space}/${pipeline}/+/executions/${executionNum}` + path: `/api/v1/repos/${repoMetadata?.path}/+/pipelines/${pipeline}/executions/${executionNum}`, + lazy: !repoMetadata }) const [selectedStage, setSelectedStage] = useState(1) return ( - -
hello
-
+ !execution && !loading, + when: () => !execution && !loading && !executionLoading, image: noExecutionImage, message: getString('executions.noData') // button: NewExecutionButton }}> - - - - {selectedStage && } - + + {execution && ( + + + {selectedStage && ( + + )} + + )}
) diff --git a/web/src/pages/ExecutionList/ExecutionList.tsx b/web/src/pages/ExecutionList/ExecutionList.tsx index 3333f3d08..c1ca70656 100644 --- a/web/src/pages/ExecutionList/ExecutionList.tsx +++ b/web/src/pages/ExecutionList/ExecutionList.tsx @@ -7,7 +7,6 @@ import { FlexExpander, Layout, PageBody, - PageHeader, TableV2 as Table, Text, Utils @@ -26,16 +25,16 @@ import { NoResultCard } from 'components/NoResultCard/NoResultCard' import { LIST_FETCHING_LIMIT, PageBrowserProps, getErrorMessage, timeDistance, voidFn } from 'utils/Utils' import type { CODEProps } from 'RouteDefinitions' import type { TypesExecution } from 'services/code' -import { useGetSpaceParam } from 'hooks/useGetSpaceParam' import { useQueryParams } from 'hooks/useQueryParams' import { usePageIndex } from 'hooks/usePageIndex' import { ResourceListingPagination } from 'components/ResourceListingPagination/ResourceListingPagination' +import { useGetRepositoryMetadata } from 'hooks/useGetRepositoryMetadata' +import { RepositoryPageHeader } from 'components/RepositoryPageHeader/RepositoryPageHeader' import noExecutionImage from '../RepositoriesListing/no-repo.svg' import css from './ExecutionList.module.scss' const ExecutionList = () => { const { routes } = useAppContext() - const space = useGetSpaceParam() const { pipeline } = useParams() const history = useHistory() const { getString } = useStrings() @@ -43,15 +42,17 @@ const ExecutionList = () => { const pageInit = pageBrowser.page ? parseInt(pageBrowser.page) : 1 const [page, setPage] = usePageIndex(pageInit) + const { repoMetadata, error, loading, refetch } = useGetRepositoryMetadata() + const { data: executions, - error, - loading, - refetch, + error: executionsError, + loading: executionsLoading, response } = useGet({ - path: `/api/v1/pipelines/${space}/${pipeline}/+/executions`, - queryParams: { page, limit: LIST_FETCHING_LIMIT } + path: `/api/v1/repos/${repoMetadata?.path}/+/pipelines/${pipeline}/executions`, + queryParams: { page, limit: LIST_FETCHING_LIMIT }, + lazy: !repoMetadata }) const NewExecutionButton = ( @@ -123,10 +124,23 @@ const ExecutionList = () => { return ( - + {/* */} + executions?.length === 0, @@ -134,7 +148,7 @@ const ExecutionList = () => { message: getString('executions.noData'), button: NewExecutionButton }}> - + @@ -151,7 +165,7 @@ const ExecutionList = () => { onRowClick={executionInfo => history.push( routes.toCODEExecution({ - space, + repoPath: repoMetadata?.path as string, pipeline: pipeline as string, execution: String(executionInfo.number) }) diff --git a/web/src/pages/PipelineList/PipelineList.tsx b/web/src/pages/PipelineList/PipelineList.tsx index f8cd02bb3..4fb8383d1 100644 --- a/web/src/pages/PipelineList/PipelineList.tsx +++ b/web/src/pages/PipelineList/PipelineList.tsx @@ -6,7 +6,6 @@ import { FlexExpander, Layout, PageBody, - PageHeader, TableV2 as Table, Text } from '@harnessio/uicore' @@ -21,18 +20,18 @@ import { LoadingSpinner } from 'components/LoadingSpinner/LoadingSpinner' import { SearchInputWithSpinner } from 'components/SearchInputWithSpinner/SearchInputWithSpinner' import { NoResultCard } from 'components/NoResultCard/NoResultCard' import { LIST_FETCHING_LIMIT, PageBrowserProps, formatDate, getErrorMessage, voidFn } from 'utils/Utils' -import { useGetSpaceParam } from 'hooks/useGetSpaceParam' import type { TypesPipeline } from 'services/code' import { useQueryParams } from 'hooks/useQueryParams' import { usePageIndex } from 'hooks/usePageIndex' import { ResourceListingPagination } from 'components/ResourceListingPagination/ResourceListingPagination' import { useAppContext } from 'AppContext' +import { useGetRepositoryMetadata } from 'hooks/useGetRepositoryMetadata' +import { RepositoryPageHeader } from 'components/RepositoryPageHeader/RepositoryPageHeader' import noPipelineImage from '../RepositoriesListing/no-repo.svg' import css from './PipelineList.module.scss' const PipelineList = () => { const { routes } = useAppContext() - const space = useGetSpaceParam() const history = useHistory() const { getString } = useStrings() const [searchTerm, setSearchTerm] = useState() @@ -40,15 +39,17 @@ const PipelineList = () => { const pageInit = pageBrowser.page ? parseInt(pageBrowser.page) : 1 const [page, setPage] = usePageIndex(pageInit) + const { repoMetadata, error, loading, refetch } = useGetRepositoryMetadata() + const { data: pipelines, - error, - loading, - refetch, + error: pipelinesError, + loading: pipelinesLoading, response } = useGet({ - path: `/api/v1/spaces/${space}/+/pipelines`, - queryParams: { page, limit: LIST_FETCHING_LIMIT, query: searchTerm } + path: `/api/v1/repos/${repoMetadata?.path}/+/pipelines`, + queryParams: { page, limit: LIST_FETCHING_LIMIT, query: searchTerm }, + lazy: !repoMetadata }) const NewPipelineButton = ( @@ -102,10 +103,14 @@ const PipelineList = () => { return ( - + pipelines?.length === 0 && searchTerm === undefined, @@ -113,7 +118,10 @@ const PipelineList = () => { message: getString('pipelines.noData'), button: NewPipelineButton }}> - + @@ -129,7 +137,12 @@ const PipelineList = () => { columns={columns} data={pipelines || []} onRowClick={pipelineInfo => - history.push(routes.toCODEExecutions({ space, pipeline: pipelineInfo.uid as string })) + history.push( + routes.toCODEExecutions({ + repoPath: repoMetadata?.path as string, + pipeline: pipelineInfo.uid as string + }) + ) } getRowClassName={row => cx(css.row, !row.original.description && css.noDesc)} /> diff --git a/web/src/services/code/index.tsx b/web/src/services/code/index.tsx index d2fee9ae9..95a3c0ebf 100644 --- a/web/src/services/code/index.tsx +++ b/web/src/services/code/index.tsx @@ -45,8 +45,6 @@ export type EnumPullReqReviewerType = 'assigned' | 'requested' | 'self_assigned' export type EnumPullReqState = 'closed' | 'merged' | 'open' -export type EnumScmType = 'GITNESS' | 'GITHUB' | 'GITLAB' | 'UNKNOWN' - export type EnumTokenType = string export type EnumWebhookExecutionResult = 'fatal_error' | 'retriable_error' | 'success' | null @@ -173,6 +171,14 @@ export interface OpenapiCreateBranchRequest { target?: string } +export interface OpenapiCreateConnectorRequest { + data?: string + description?: string + space_ref?: string + type?: string + uid?: string +} + export interface OpenapiCreateExecutionRequest { status?: string } @@ -185,9 +191,6 @@ export interface OpenapiCreatePipelineRequest { config_path?: string default_branch?: string description?: string - repo_ref?: string - repo_type?: EnumScmType - space_ref?: string uid?: string } @@ -236,12 +239,25 @@ export interface OpenapiCreateTagRequest { target?: string } +export interface OpenapiCreateTemplateRequest { + data?: string + description?: string + space_ref?: string + type?: string + uid?: string +} + export interface OpenapiCreateTokenRequest { grants?: EnumAccessGrant lifetime?: TimeDuration uid?: string } +export interface OpenapiCreateTriggerRequest { + description?: string + uid?: string +} + export interface OpenapiCreateWebhookRequest { description?: string display_name?: string @@ -318,6 +334,12 @@ export interface OpenapiUpdateAdminRequest { admin?: boolean } +export interface OpenapiUpdateConnectorRequest { + data?: string + description?: string + uid?: string +} + export interface OpenapiUpdateExecutionRequest { status?: string } @@ -349,6 +371,17 @@ export interface OpenapiUpdateSpaceRequest { is_public?: boolean | null } +export interface OpenapiUpdateTemplateRequest { + data?: string + description?: string + uid?: string +} + +export interface OpenapiUpdateTriggerRequest { + description?: string + uid?: string +} + export interface OpenapiUpdateWebhookRequest { description?: string | null display_name?: string | null @@ -498,6 +531,17 @@ export interface TypesCommit { title?: string } +export interface TypesConnector { + created?: number + data?: string + description?: string + id?: number + space_id?: number + type?: string + uid?: string + updated?: number +} + export interface TypesDiffStats { commits?: number files_changed?: number @@ -592,15 +636,19 @@ export interface TypesPipeline { description?: string id?: number repo_id?: number - repo_name?: string - repo_type?: EnumScmType seq?: number - space_id?: number uid?: string updated?: number version?: number } +export interface TypesPlugin { + description?: string + logo?: string + spec?: string + uid?: string +} + export interface TypesPrincipalInfo { created?: number display_name?: string @@ -783,6 +831,16 @@ export interface TypesStep { stopped?: number } +export interface TypesTemplate { + created?: number + data?: string + description?: string + id?: number + space_id?: number + uid?: string + updated?: number +} + export interface TypesToken { created_by?: number expires_at?: number | null @@ -798,6 +856,15 @@ export interface TypesTokenResponse { token?: TypesToken } +export interface TypesTrigger { + created?: number + description?: string + id?: number + pipeline_id?: number + uid?: string + updated?: number +} + export interface TypesUser { admin?: boolean blocked?: boolean @@ -1006,6 +1073,109 @@ export const useUpdateUserAdmin = ({ user_uid, ...props }: UseUpdateUserAdminPro { base: getConfig('code/api/v1'), pathParams: { user_uid }, ...props } ) +export type CreateConnectorProps = Omit< + MutateProps, + 'path' | 'verb' +> + +export const CreateConnector = (props: CreateConnectorProps) => ( + + verb="POST" + path={`/connectors`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseCreateConnectorProps = Omit< + UseMutateProps, + 'path' | 'verb' +> + +export const useCreateConnector = (props: UseCreateConnectorProps) => + useMutate('POST', `/connectors`, { + base: getConfig('code/api/v1'), + ...props + }) + +export type DeleteConnectorProps = Omit, 'path' | 'verb'> + +export const DeleteConnector = (props: DeleteConnectorProps) => ( + + verb="DELETE" + path={`/connectors`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseDeleteConnectorProps = Omit, 'path' | 'verb'> + +export const useDeleteConnector = (props: UseDeleteConnectorProps) => + useMutate('DELETE', `/connectors`, { + base: getConfig('code/api/v1'), + ...props + }) + +export interface FindConnectorPathParams { + connector_ref: string +} + +export type FindConnectorProps = Omit, 'path'> & + FindConnectorPathParams + +export const FindConnector = ({ connector_ref, ...props }: FindConnectorProps) => ( + + path={`/connectors/${connector_ref}`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseFindConnectorProps = Omit< + UseGetProps, + 'path' +> & + FindConnectorPathParams + +export const useFindConnector = ({ connector_ref, ...props }: UseFindConnectorProps) => + useGet( + (paramsInPath: FindConnectorPathParams) => `/connectors/${paramsInPath.connector_ref}`, + { base: getConfig('code/api/v1'), pathParams: { connector_ref }, ...props } + ) + +export interface UpdateConnectorPathParams { + connector_ref: string +} + +export type UpdateConnectorProps = Omit< + MutateProps, + 'path' | 'verb' +> & + UpdateConnectorPathParams + +export const UpdateConnector = ({ connector_ref, ...props }: UpdateConnectorProps) => ( + + verb="PATCH" + path={`/connectors/${connector_ref}`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseUpdateConnectorProps = Omit< + UseMutateProps, + 'path' | 'verb' +> & + UpdateConnectorPathParams + +export const useUpdateConnector = ({ connector_ref, ...props }: UseUpdateConnectorProps) => + useMutate( + 'PATCH', + (paramsInPath: UpdateConnectorPathParams) => `/connectors/${paramsInPath.connector_ref}`, + { base: getConfig('code/api/v1'), pathParams: { connector_ref }, ...props } + ) + export type OnLoginProps = Omit< MutateProps, 'path' | 'verb' @@ -1047,110 +1217,7 @@ export type UseOpLogoutProps = Omit useMutate('POST', `/logout`, { base: getConfig('code/api/v1'), ...props }) -export type CreatePipelineProps = Omit< - MutateProps, - 'path' | 'verb' -> - -export const CreatePipeline = (props: CreatePipelineProps) => ( - - verb="POST" - path={`/pipelines`} - base={getConfig('code/api/v1')} - {...props} - /> -) - -export type UseCreatePipelineProps = Omit< - UseMutateProps, - 'path' | 'verb' -> - -export const useCreatePipeline = (props: UseCreatePipelineProps) => - useMutate('POST', `/pipelines`, { - base: getConfig('code/api/v1'), - ...props - }) - -export type DeletePipelineProps = Omit, 'path' | 'verb'> - -export const DeletePipeline = (props: DeletePipelineProps) => ( - - verb="DELETE" - path={`/pipelines`} - base={getConfig('code/api/v1')} - {...props} - /> -) - -export type UseDeletePipelineProps = Omit, 'path' | 'verb'> - -export const useDeletePipeline = (props: UseDeletePipelineProps) => - useMutate('DELETE', `/pipelines`, { - base: getConfig('code/api/v1'), - ...props - }) - -export interface FindPipelinePathParams { - pipeline_ref: string -} - -export type FindPipelineProps = Omit, 'path'> & - FindPipelinePathParams - -export const FindPipeline = ({ pipeline_ref, ...props }: FindPipelineProps) => ( - - path={`/pipelines/${pipeline_ref}`} - base={getConfig('code/api/v1')} - {...props} - /> -) - -export type UseFindPipelineProps = Omit< - UseGetProps, - 'path' -> & - FindPipelinePathParams - -export const useFindPipeline = ({ pipeline_ref, ...props }: UseFindPipelineProps) => - useGet( - (paramsInPath: FindPipelinePathParams) => `/pipelines/${paramsInPath.pipeline_ref}`, - { base: getConfig('code/api/v1'), pathParams: { pipeline_ref }, ...props } - ) - -export interface UpdatePipelinePathParams { - pipeline_ref: string -} - -export type UpdatePipelineProps = Omit< - MutateProps, - 'path' | 'verb' -> & - UpdatePipelinePathParams - -export const UpdatePipeline = ({ pipeline_ref, ...props }: UpdatePipelineProps) => ( - - verb="PATCH" - path={`/pipelines/${pipeline_ref}`} - base={getConfig('code/api/v1')} - {...props} - /> -) - -export type UseUpdatePipelineProps = Omit< - UseMutateProps, - 'path' | 'verb' -> & - UpdatePipelinePathParams - -export const useUpdatePipeline = ({ pipeline_ref, ...props }: UseUpdatePipelineProps) => - useMutate( - 'PATCH', - (paramsInPath: UpdatePipelinePathParams) => `/pipelines/${paramsInPath.pipeline_ref}`, - { base: getConfig('code/api/v1'), pathParams: { pipeline_ref }, ...props } - ) - -export interface ListExecutionsQueryParams { +export interface ListPluginsQueryParams { /** * The page to return. */ @@ -1159,201 +1226,29 @@ export interface ListExecutionsQueryParams { * The maximum number of results to return. */ limit?: number + /** + * The substring which is used to filter the plugins by their name. + */ + query?: string } -export interface ListExecutionsPathParams { - pipeline_ref: string -} +export type ListPluginsProps = Omit, 'path'> -export type ListExecutionsProps = Omit< - GetProps, - 'path' -> & - ListExecutionsPathParams - -export const ListExecutions = ({ pipeline_ref, ...props }: ListExecutionsProps) => ( - - path={`/pipelines/${pipeline_ref}/executions`} +export const ListPlugins = (props: ListPluginsProps) => ( + + path={`/plugins`} base={getConfig('code/api/v1')} {...props} /> ) -export type UseListExecutionsProps = Omit< - UseGetProps, - 'path' -> & - ListExecutionsPathParams +export type UseListPluginsProps = Omit, 'path'> -export const useListExecutions = ({ pipeline_ref, ...props }: UseListExecutionsProps) => - useGet( - (paramsInPath: ListExecutionsPathParams) => `/pipelines/${paramsInPath.pipeline_ref}/executions`, - { base: getConfig('code/api/v1'), pathParams: { pipeline_ref }, ...props } - ) - -export interface CreateExecutionPathParams { - pipeline_ref: string -} - -export type CreateExecutionProps = Omit< - MutateProps, - 'path' | 'verb' -> & - CreateExecutionPathParams - -export const CreateExecution = ({ pipeline_ref, ...props }: CreateExecutionProps) => ( - - verb="POST" - path={`/pipelines/${pipeline_ref}/executions`} - base={getConfig('code/api/v1')} - {...props} - /> -) - -export type UseCreateExecutionProps = Omit< - UseMutateProps, - 'path' | 'verb' -> & - CreateExecutionPathParams - -export const useCreateExecution = ({ pipeline_ref, ...props }: UseCreateExecutionProps) => - useMutate( - 'POST', - (paramsInPath: CreateExecutionPathParams) => `/pipelines/${paramsInPath.pipeline_ref}/executions`, - { base: getConfig('code/api/v1'), pathParams: { pipeline_ref }, ...props } - ) - -export interface DeleteExecutionPathParams { - pipeline_ref: string -} - -export type DeleteExecutionProps = Omit< - MutateProps, - 'path' | 'verb' -> & - DeleteExecutionPathParams - -export const DeleteExecution = ({ pipeline_ref, ...props }: DeleteExecutionProps) => ( - - verb="DELETE" - path={`/pipelines/${pipeline_ref}/executions`} - base={getConfig('code/api/v1')} - {...props} - /> -) - -export type UseDeleteExecutionProps = Omit< - UseMutateProps, - 'path' | 'verb' -> & - DeleteExecutionPathParams - -export const useDeleteExecution = ({ pipeline_ref, ...props }: UseDeleteExecutionProps) => - useMutate( - 'DELETE', - (paramsInPath: DeleteExecutionPathParams) => `/pipelines/${paramsInPath.pipeline_ref}/executions`, - { base: getConfig('code/api/v1'), pathParams: { pipeline_ref }, ...props } - ) - -export interface FindExecutionPathParams { - pipeline_ref: string - execution_number: string -} - -export type FindExecutionProps = Omit, 'path'> & - FindExecutionPathParams - -export const FindExecution = ({ pipeline_ref, execution_number, ...props }: FindExecutionProps) => ( - - path={`/pipelines/${pipeline_ref}/executions/${execution_number}`} - base={getConfig('code/api/v1')} - {...props} - /> -) - -export type UseFindExecutionProps = Omit< - UseGetProps, - 'path' -> & - FindExecutionPathParams - -export const useFindExecution = ({ pipeline_ref, execution_number, ...props }: UseFindExecutionProps) => - useGet( - (paramsInPath: FindExecutionPathParams) => - `/pipelines/${paramsInPath.pipeline_ref}/executions/${paramsInPath.execution_number}`, - { base: getConfig('code/api/v1'), pathParams: { pipeline_ref, execution_number }, ...props } - ) - -export interface UpdateExecutionPathParams { - pipeline_ref: string - execution_number: string -} - -export type UpdateExecutionProps = Omit< - MutateProps, - 'path' | 'verb' -> & - UpdateExecutionPathParams - -export const UpdateExecution = ({ pipeline_ref, execution_number, ...props }: UpdateExecutionProps) => ( - - verb="PATCH" - path={`/pipelines/${pipeline_ref}/executions/${execution_number}`} - base={getConfig('code/api/v1')} - {...props} - /> -) - -export type UseUpdateExecutionProps = Omit< - UseMutateProps, - 'path' | 'verb' -> & - UpdateExecutionPathParams - -export const useUpdateExecution = ({ pipeline_ref, execution_number, ...props }: UseUpdateExecutionProps) => - useMutate( - 'PATCH', - (paramsInPath: UpdateExecutionPathParams) => - `/pipelines/${paramsInPath.pipeline_ref}/executions/${paramsInPath.execution_number}`, - { base: getConfig('code/api/v1'), pathParams: { pipeline_ref, execution_number }, ...props } - ) - -export interface ViewLogsPathParams { - pipeline_ref: string - execution_number: string - stage_number: string - step_number: string -} - -export type ViewLogsProps = Omit, 'path'> & ViewLogsPathParams - -export const ViewLogs = ({ pipeline_ref, execution_number, stage_number, step_number, ...props }: ViewLogsProps) => ( - - path={`/pipelines/${pipeline_ref}/executions/${execution_number}/logs/${stage_number}/${step_number}`} - base={getConfig('code/api/v1')} - {...props} - /> -) - -export type UseViewLogsProps = Omit, 'path'> & - ViewLogsPathParams - -export const useViewLogs = ({ - pipeline_ref, - execution_number, - stage_number, - step_number, - ...props -}: UseViewLogsProps) => - useGet( - (paramsInPath: ViewLogsPathParams) => - `/pipelines/${paramsInPath.pipeline_ref}/executions/${paramsInPath.execution_number}/logs/${paramsInPath.stage_number}/${paramsInPath.step_number}`, - { - base: getConfig('code/api/v1'), - pathParams: { pipeline_ref, execution_number, stage_number, step_number }, - ...props - } - ) +export const useListPlugins = (props: UseListPluginsProps) => + useGet(`/plugins`, { + base: getConfig('code/api/v1'), + ...props + }) export interface ListPrincipalsQueryParams { /** @@ -2331,6 +2226,576 @@ export const useDeleteRepositoryPath = ({ repo_ref, ...props }: UseDeleteReposit { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } ) +export interface ListPipelinesQueryParams { + /** + * The substring which is used to filter the repositories by their path name. + */ + query?: string + /** + * The page to return. + */ + page?: number + /** + * The maximum number of results to return. + */ + limit?: number +} + +export interface ListPipelinesPathParams { + repo_ref: string +} + +export type ListPipelinesProps = Omit< + GetProps, + 'path' +> & + ListPipelinesPathParams + +export const ListPipelines = ({ repo_ref, ...props }: ListPipelinesProps) => ( + + path={`/repos/${repo_ref}/pipelines`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseListPipelinesProps = Omit< + UseGetProps, + 'path' +> & + ListPipelinesPathParams + +export const useListPipelines = ({ repo_ref, ...props }: UseListPipelinesProps) => + useGet( + (paramsInPath: ListPipelinesPathParams) => `/repos/${paramsInPath.repo_ref}/pipelines`, + { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } + ) + +export interface CreatePipelinePathParams { + repo_ref: string +} + +export type CreatePipelineProps = Omit< + MutateProps, + 'path' | 'verb' +> & + CreatePipelinePathParams + +export const CreatePipeline = ({ repo_ref, ...props }: CreatePipelineProps) => ( + + verb="POST" + path={`/repos/${repo_ref}/pipelines`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseCreatePipelineProps = Omit< + UseMutateProps, + 'path' | 'verb' +> & + CreatePipelinePathParams + +export const useCreatePipeline = ({ repo_ref, ...props }: UseCreatePipelineProps) => + useMutate( + 'POST', + (paramsInPath: CreatePipelinePathParams) => `/repos/${paramsInPath.repo_ref}/pipelines`, + { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } + ) + +export interface DeletePipelinePathParams { + repo_ref: string +} + +export type DeletePipelineProps = Omit< + MutateProps, + 'path' | 'verb' +> & + DeletePipelinePathParams + +export const DeletePipeline = ({ repo_ref, ...props }: DeletePipelineProps) => ( + + verb="DELETE" + path={`/repos/${repo_ref}/pipelines`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseDeletePipelineProps = Omit< + UseMutateProps, + 'path' | 'verb' +> & + DeletePipelinePathParams + +export const useDeletePipeline = ({ repo_ref, ...props }: UseDeletePipelineProps) => + useMutate( + 'DELETE', + (paramsInPath: DeletePipelinePathParams) => `/repos/${paramsInPath.repo_ref}/pipelines`, + { base: getConfig('code/api/v1'), pathParams: { repo_ref }, ...props } + ) + +export interface FindPipelinePathParams { + repo_ref: string + pipeline_uid: string +} + +export type FindPipelineProps = Omit, 'path'> & + FindPipelinePathParams + +export const FindPipeline = ({ repo_ref, pipeline_uid, ...props }: FindPipelineProps) => ( + + path={`/repos/${repo_ref}/pipelines/${pipeline_uid}`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseFindPipelineProps = Omit< + UseGetProps, + 'path' +> & + FindPipelinePathParams + +export const useFindPipeline = ({ repo_ref, pipeline_uid, ...props }: UseFindPipelineProps) => + useGet( + (paramsInPath: FindPipelinePathParams) => `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}`, + { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid }, ...props } + ) + +export interface UpdatePipelinePathParams { + repo_ref: string + pipeline_uid: string +} + +export type UpdatePipelineProps = Omit< + MutateProps, + 'path' | 'verb' +> & + UpdatePipelinePathParams + +export const UpdatePipeline = ({ repo_ref, pipeline_uid, ...props }: UpdatePipelineProps) => ( + + verb="PATCH" + path={`/repos/${repo_ref}/pipelines/${pipeline_uid}`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseUpdatePipelineProps = Omit< + UseMutateProps, + 'path' | 'verb' +> & + UpdatePipelinePathParams + +export const useUpdatePipeline = ({ repo_ref, pipeline_uid, ...props }: UseUpdatePipelineProps) => + useMutate( + 'PATCH', + (paramsInPath: UpdatePipelinePathParams) => + `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}`, + { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid }, ...props } + ) + +export interface ListExecutionsQueryParams { + /** + * The page to return. + */ + page?: number + /** + * The maximum number of results to return. + */ + limit?: number +} + +export interface ListExecutionsPathParams { + repo_ref: string + pipeline_uid: string +} + +export type ListExecutionsProps = Omit< + GetProps, + 'path' +> & + ListExecutionsPathParams + +export const ListExecutions = ({ repo_ref, pipeline_uid, ...props }: ListExecutionsProps) => ( + + path={`/repos/${repo_ref}/pipelines/${pipeline_uid}/executions`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseListExecutionsProps = Omit< + UseGetProps, + 'path' +> & + ListExecutionsPathParams + +export const useListExecutions = ({ repo_ref, pipeline_uid, ...props }: UseListExecutionsProps) => + useGet( + (paramsInPath: ListExecutionsPathParams) => + `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}/executions`, + { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid }, ...props } + ) + +export interface CreateExecutionPathParams { + repo_ref: string + pipeline_uid: string +} + +export type CreateExecutionProps = Omit< + MutateProps, + 'path' | 'verb' +> & + CreateExecutionPathParams + +export const CreateExecution = ({ repo_ref, pipeline_uid, ...props }: CreateExecutionProps) => ( + + verb="POST" + path={`/repos/${repo_ref}/pipelines/${pipeline_uid}/executions`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseCreateExecutionProps = Omit< + UseMutateProps, + 'path' | 'verb' +> & + CreateExecutionPathParams + +export const useCreateExecution = ({ repo_ref, pipeline_uid, ...props }: UseCreateExecutionProps) => + useMutate( + 'POST', + (paramsInPath: CreateExecutionPathParams) => + `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}/executions`, + { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid }, ...props } + ) + +export interface DeleteExecutionPathParams { + repo_ref: string + pipeline_uid: string +} + +export type DeleteExecutionProps = Omit< + MutateProps, + 'path' | 'verb' +> & + DeleteExecutionPathParams + +export const DeleteExecution = ({ repo_ref, pipeline_uid, ...props }: DeleteExecutionProps) => ( + + verb="DELETE" + path={`/repos/${repo_ref}/pipelines/${pipeline_uid}/executions`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseDeleteExecutionProps = Omit< + UseMutateProps, + 'path' | 'verb' +> & + DeleteExecutionPathParams + +export const useDeleteExecution = ({ repo_ref, pipeline_uid, ...props }: UseDeleteExecutionProps) => + useMutate( + 'DELETE', + (paramsInPath: DeleteExecutionPathParams) => + `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}/executions`, + { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid }, ...props } + ) + +export interface FindExecutionPathParams { + repo_ref: string + pipeline_uid: string + execution_number: string +} + +export type FindExecutionProps = Omit, 'path'> & + FindExecutionPathParams + +export const FindExecution = ({ repo_ref, pipeline_uid, execution_number, ...props }: FindExecutionProps) => ( + + path={`/repos/${repo_ref}/pipelines/${pipeline_uid}/executions/${execution_number}`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseFindExecutionProps = Omit< + UseGetProps, + 'path' +> & + FindExecutionPathParams + +export const useFindExecution = ({ repo_ref, pipeline_uid, execution_number, ...props }: UseFindExecutionProps) => + useGet( + (paramsInPath: FindExecutionPathParams) => + `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}/executions/${paramsInPath.execution_number}`, + { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid, execution_number }, ...props } + ) + +export interface UpdateExecutionPathParams { + repo_ref: string + pipeline_uid: string + execution_number: string +} + +export type UpdateExecutionProps = Omit< + MutateProps, + 'path' | 'verb' +> & + UpdateExecutionPathParams + +export const UpdateExecution = ({ repo_ref, pipeline_uid, execution_number, ...props }: UpdateExecutionProps) => ( + + verb="PATCH" + path={`/repos/${repo_ref}/pipelines/${pipeline_uid}/executions/${execution_number}`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseUpdateExecutionProps = Omit< + UseMutateProps, + 'path' | 'verb' +> & + UpdateExecutionPathParams + +export const useUpdateExecution = ({ repo_ref, pipeline_uid, execution_number, ...props }: UseUpdateExecutionProps) => + useMutate( + 'PATCH', + (paramsInPath: UpdateExecutionPathParams) => + `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}/executions/${paramsInPath.execution_number}`, + { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid, execution_number }, ...props } + ) + +export interface ViewLogsPathParams { + repo_ref: string + pipeline_uid: string + execution_number: string + stage_number: string + step_number: string +} + +export type ViewLogsProps = Omit, 'path'> & ViewLogsPathParams + +export const ViewLogs = ({ + repo_ref, + pipeline_uid, + execution_number, + stage_number, + step_number, + ...props +}: ViewLogsProps) => ( + + path={`/repos/${repo_ref}/pipelines/${pipeline_uid}/executions/${execution_number}/logs/${stage_number}/${step_number}`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseViewLogsProps = Omit, 'path'> & + ViewLogsPathParams + +export const useViewLogs = ({ + repo_ref, + pipeline_uid, + execution_number, + stage_number, + step_number, + ...props +}: UseViewLogsProps) => + useGet( + (paramsInPath: ViewLogsPathParams) => + `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}/executions/${paramsInPath.execution_number}/logs/${paramsInPath.stage_number}/${paramsInPath.step_number}`, + { + base: getConfig('code/api/v1'), + pathParams: { repo_ref, pipeline_uid, execution_number, stage_number, step_number }, + ...props + } + ) + +export interface ListTriggersQueryParams { + /** + * The substring which is used to filter the repositories by their path name. + */ + query?: string + /** + * The page to return. + */ + page?: number + /** + * The maximum number of results to return. + */ + limit?: number +} + +export interface ListTriggersPathParams { + repo_ref: string + pipeline_uid: string +} + +export type ListTriggersProps = Omit< + GetProps, + 'path' +> & + ListTriggersPathParams + +export const ListTriggers = ({ repo_ref, pipeline_uid, ...props }: ListTriggersProps) => ( + + path={`/repos/${repo_ref}/pipelines/${pipeline_uid}/triggers`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseListTriggersProps = Omit< + UseGetProps, + 'path' +> & + ListTriggersPathParams + +export const useListTriggers = ({ repo_ref, pipeline_uid, ...props }: UseListTriggersProps) => + useGet( + (paramsInPath: ListTriggersPathParams) => + `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}/triggers`, + { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid }, ...props } + ) + +export interface CreateTriggerPathParams { + repo_ref: string + pipeline_uid: string +} + +export type CreateTriggerProps = Omit< + MutateProps, + 'path' | 'verb' +> & + CreateTriggerPathParams + +export const CreateTrigger = ({ repo_ref, pipeline_uid, ...props }: CreateTriggerProps) => ( + + verb="POST" + path={`/repos/${repo_ref}/pipelines/${pipeline_uid}/triggers`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseCreateTriggerProps = Omit< + UseMutateProps, + 'path' | 'verb' +> & + CreateTriggerPathParams + +export const useCreateTrigger = ({ repo_ref, pipeline_uid, ...props }: UseCreateTriggerProps) => + useMutate( + 'POST', + (paramsInPath: CreateTriggerPathParams) => + `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}/triggers`, + { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid }, ...props } + ) + +export interface DeleteTriggerPathParams { + repo_ref: string + pipeline_uid: string +} + +export type DeleteTriggerProps = Omit< + MutateProps, + 'path' | 'verb' +> & + DeleteTriggerPathParams + +export const DeleteTrigger = ({ repo_ref, pipeline_uid, ...props }: DeleteTriggerProps) => ( + + verb="DELETE" + path={`/repos/${repo_ref}/pipelines/${pipeline_uid}/triggers`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseDeleteTriggerProps = Omit< + UseMutateProps, + 'path' | 'verb' +> & + DeleteTriggerPathParams + +export const useDeleteTrigger = ({ repo_ref, pipeline_uid, ...props }: UseDeleteTriggerProps) => + useMutate( + 'DELETE', + (paramsInPath: DeleteTriggerPathParams) => + `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}/triggers`, + { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid }, ...props } + ) + +export interface FindTriggerPathParams { + repo_ref: string + pipeline_uid: string + trigger_uid: string +} + +export type FindTriggerProps = Omit, 'path'> & + FindTriggerPathParams + +export const FindTrigger = ({ repo_ref, pipeline_uid, trigger_uid, ...props }: FindTriggerProps) => ( + + path={`/repos/${repo_ref}/pipelines/${pipeline_uid}/triggers/${trigger_uid}`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseFindTriggerProps = Omit, 'path'> & + FindTriggerPathParams + +export const useFindTrigger = ({ repo_ref, pipeline_uid, trigger_uid, ...props }: UseFindTriggerProps) => + useGet( + (paramsInPath: FindTriggerPathParams) => + `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}/triggers/${paramsInPath.trigger_uid}`, + { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid, trigger_uid }, ...props } + ) + +export interface UpdateTriggerPathParams { + repo_ref: string + pipeline_uid: string + trigger_uid: string +} + +export type UpdateTriggerProps = Omit< + MutateProps, + 'path' | 'verb' +> & + UpdateTriggerPathParams + +export const UpdateTrigger = ({ repo_ref, pipeline_uid, trigger_uid, ...props }: UpdateTriggerProps) => ( + + verb="PATCH" + path={`/repos/${repo_ref}/pipelines/${pipeline_uid}/triggers/${trigger_uid}`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseUpdateTriggerProps = Omit< + UseMutateProps, + 'path' | 'verb' +> & + UpdateTriggerPathParams + +export const useUpdateTrigger = ({ repo_ref, pipeline_uid, trigger_uid, ...props }: UseUpdateTriggerProps) => + useMutate( + 'PATCH', + (paramsInPath: UpdateTriggerPathParams) => + `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_uid}/triggers/${paramsInPath.trigger_uid}`, + { base: getConfig('code/api/v1'), pathParams: { repo_ref, pipeline_uid, trigger_uid }, ...props } + ) + export interface ListPullReqQueryParams { /** * The state of the pull requests to include in the result. @@ -3777,6 +4242,51 @@ export const useUpdateSpace = ({ space_ref, ...props }: UseUpdateSpaceProps) => { base: getConfig('code/api/v1'), pathParams: { space_ref }, ...props } ) +export interface ListConnectorsQueryParams { + /** + * The substring which is used to filter the repositories by their path name. + */ + query?: string + /** + * The page to return. + */ + page?: number + /** + * The maximum number of results to return. + */ + limit?: number +} + +export interface ListConnectorsPathParams { + space_ref: string +} + +export type ListConnectorsProps = Omit< + GetProps, + 'path' +> & + ListConnectorsPathParams + +export const ListConnectors = ({ space_ref, ...props }: ListConnectorsProps) => ( + + path={`/spaces/${space_ref}/connectors`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseListConnectorsProps = Omit< + UseGetProps, + 'path' +> & + ListConnectorsPathParams + +export const useListConnectors = ({ space_ref, ...props }: UseListConnectorsProps) => + useGet( + (paramsInPath: ListConnectorsPathParams) => `/spaces/${paramsInPath.space_ref}/connectors`, + { base: getConfig('code/api/v1'), pathParams: { space_ref }, ...props } + ) + export interface MembershipListQueryParams { /** * The substring by which the space members are filtered. @@ -4073,51 +4583,6 @@ export const useDeletePath = ({ space_ref, ...props }: UseDeletePathProps) => { base: getConfig('code/api/v1'), pathParams: { space_ref }, ...props } ) -export interface ListPipelinesQueryParams { - /** - * The substring which is used to filter the repositories by their path name. - */ - query?: string - /** - * The page to return. - */ - page?: number - /** - * The maximum number of results to return. - */ - limit?: number -} - -export interface ListPipelinesPathParams { - space_ref: string -} - -export type ListPipelinesProps = Omit< - GetProps, - 'path' -> & - ListPipelinesPathParams - -export const ListPipelines = ({ space_ref, ...props }: ListPipelinesProps) => ( - - path={`/spaces/${space_ref}/pipelines`} - base={getConfig('code/api/v1')} - {...props} - /> -) - -export type UseListPipelinesProps = Omit< - UseGetProps, - 'path' -> & - ListPipelinesPathParams - -export const useListPipelines = ({ space_ref, ...props }: UseListPipelinesProps) => - useGet( - (paramsInPath: ListPipelinesPathParams) => `/spaces/${paramsInPath.space_ref}/pipelines`, - { base: getConfig('code/api/v1'), pathParams: { space_ref }, ...props } - ) - export interface ListReposQueryParams { /** * The substring which is used to filter the repositories by their path name. @@ -4299,6 +4764,51 @@ export const useListSpaces = ({ space_ref, ...props }: UseListSpacesProps) => { base: getConfig('code/api/v1'), pathParams: { space_ref }, ...props } ) +export interface ListTemplatesQueryParams { + /** + * The substring which is used to filter the repositories by their path name. + */ + query?: string + /** + * The page to return. + */ + page?: number + /** + * The maximum number of results to return. + */ + limit?: number +} + +export interface ListTemplatesPathParams { + space_ref: string +} + +export type ListTemplatesProps = Omit< + GetProps, + 'path' +> & + ListTemplatesPathParams + +export const ListTemplates = ({ space_ref, ...props }: ListTemplatesProps) => ( + + path={`/spaces/${space_ref}/templates`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseListTemplatesProps = Omit< + UseGetProps, + 'path' +> & + ListTemplatesPathParams + +export const useListTemplates = ({ space_ref, ...props }: UseListTemplatesProps) => + useGet( + (paramsInPath: ListTemplatesPathParams) => `/spaces/${paramsInPath.space_ref}/templates`, + { base: getConfig('code/api/v1'), pathParams: { space_ref }, ...props } + ) + export type GetSystemConfigProps = Omit, 'path'> export const GetSystemConfig = (props: GetSystemConfigProps) => ( @@ -4314,6 +4824,109 @@ export type UseGetSystemConfigProps = Omit useGet(`/system/config`, { base: getConfig('code/api/v1'), ...props }) +export type CreateTemplateProps = Omit< + MutateProps, + 'path' | 'verb' +> + +export const CreateTemplate = (props: CreateTemplateProps) => ( + + verb="POST" + path={`/templates`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseCreateTemplateProps = Omit< + UseMutateProps, + 'path' | 'verb' +> + +export const useCreateTemplate = (props: UseCreateTemplateProps) => + useMutate('POST', `/templates`, { + base: getConfig('code/api/v1'), + ...props + }) + +export type DeleteTemplateProps = Omit, 'path' | 'verb'> + +export const DeleteTemplate = (props: DeleteTemplateProps) => ( + + verb="DELETE" + path={`/templates`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseDeleteTemplateProps = Omit, 'path' | 'verb'> + +export const useDeleteTemplate = (props: UseDeleteTemplateProps) => + useMutate('DELETE', `/templates`, { + base: getConfig('code/api/v1'), + ...props + }) + +export interface FindTemplatePathParams { + template_ref: string +} + +export type FindTemplateProps = Omit, 'path'> & + FindTemplatePathParams + +export const FindTemplate = ({ template_ref, ...props }: FindTemplateProps) => ( + + path={`/templates/${template_ref}`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseFindTemplateProps = Omit< + UseGetProps, + 'path' +> & + FindTemplatePathParams + +export const useFindTemplate = ({ template_ref, ...props }: UseFindTemplateProps) => + useGet( + (paramsInPath: FindTemplatePathParams) => `/templates/${paramsInPath.template_ref}`, + { base: getConfig('code/api/v1'), pathParams: { template_ref }, ...props } + ) + +export interface UpdateTemplatePathParams { + template_ref: string +} + +export type UpdateTemplateProps = Omit< + MutateProps, + 'path' | 'verb' +> & + UpdateTemplatePathParams + +export const UpdateTemplate = ({ template_ref, ...props }: UpdateTemplateProps) => ( + + verb="PATCH" + path={`/templates/${template_ref}`} + base={getConfig('code/api/v1')} + {...props} + /> +) + +export type UseUpdateTemplateProps = Omit< + UseMutateProps, + 'path' | 'verb' +> & + UpdateTemplatePathParams + +export const useUpdateTemplate = ({ template_ref, ...props }: UseUpdateTemplateProps) => + useMutate( + 'PATCH', + (paramsInPath: UpdateTemplatePathParams) => `/templates/${paramsInPath.template_ref}`, + { base: getConfig('code/api/v1'), pathParams: { template_ref }, ...props } + ) + export type GetUserProps = Omit, 'path'> export const GetUser = (props: GetUserProps) => ( @@ -4347,20 +4960,49 @@ export const useUpdateUser = (props: UseUpdateUserProps) => ...props }) -export type MembershipSpacesProps = Omit, 'path'> +export interface MembershipSpacesQueryParams { + /** + * The substring by which the spaces the users is a member of are filtered. + */ + query?: string + /** + * The order of the output. + */ + order?: 'asc' | 'desc' + /** + * The field by which the spaces the user is a member of are sorted. + */ + sort?: 'created' | 'path' | 'uid' + /** + * The page to return. + */ + page?: number + /** + * The maximum number of results to return. + */ + limit?: number +} + +export type MembershipSpacesProps = Omit< + GetProps, + 'path' +> export const MembershipSpaces = (props: MembershipSpacesProps) => ( - + path={`/user/memberships`} base={getConfig('code/api/v1')} {...props} /> ) -export type UseMembershipSpacesProps = Omit, 'path'> +export type UseMembershipSpacesProps = Omit< + UseGetProps, + 'path' +> export const useMembershipSpaces = (props: UseMembershipSpacesProps) => - useGet(`/user/memberships`, { + useGet(`/user/memberships`, { base: getConfig('code/api/v1'), ...props }) diff --git a/web/src/services/code/swagger.yaml b/web/src/services/code/swagger.yaml index 2aa94c5bd..f4d555cb1 100644 --- a/web/src/services/code/swagger.yaml +++ b/web/src/services/code/swagger.yaml @@ -236,6 +236,178 @@ paths: description: Internal Server Error tags: - admin + /connectors: + post: + operationId: createConnector + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OpenapiCreateConnectorRequest' + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/TypesConnector' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - connector + /connectors/{connector_ref}: + delete: + operationId: deleteConnector + parameters: + - in: path + name: connector_ref + required: true + schema: + type: string + responses: + '204': + description: No Content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - connector + get: + operationId: findConnector + parameters: + - in: path + name: connector_ref + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TypesConnector' + description: OK + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - connector + patch: + operationId: updateConnector + parameters: + - in: path + name: connector_ref + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OpenapiUpdateConnectorRequest' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TypesConnector' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - connector /login: post: operationId: onLogin @@ -297,181 +469,9 @@ paths: description: Internal Server Error tags: - account - /pipelines: - post: - operationId: createPipeline - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OpenapiCreatePipelineRequest' - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/TypesPipeline' - description: Created - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Bad Request - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Unauthorized - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Forbidden - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Internal Server Error - tags: - - pipeline - /pipelines/{pipeline_ref}: - delete: - operationId: deletePipeline - parameters: - - in: path - name: pipeline_ref - required: true - schema: - type: string - responses: - '204': - description: No Content - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Unauthorized - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Not Found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Internal Server Error - tags: - - pipeline + /plugins: get: - operationId: findPipeline - parameters: - - in: path - name: pipeline_ref - required: true - schema: - type: string - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/TypesPipeline' - description: OK - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Unauthorized - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Not Found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Internal Server Error - tags: - - pipeline - patch: - operationId: updatePipeline - parameters: - - in: path - name: pipeline_ref - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OpenapiUpdatePipelineRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/TypesPipeline' - description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Bad Request - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Unauthorized - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Not Found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Internal Server Error - tags: - - pipeline - /pipelines/{pipeline_ref}/executions: - get: - operationId: listExecutions + operationId: listPlugins parameters: - description: The page to return. in: query @@ -490,9 +490,10 @@ paths: maximum: 100 minimum: 1 type: integer - - in: path - name: pipeline_ref - required: true + - description: The substring which is used to filter the plugins by their name. + in: query + name: query + required: false schema: type: string responses: @@ -501,7 +502,7 @@ paths: application/json: schema: items: - $ref: '#/components/schemas/TypesExecution' + $ref: '#/components/schemas/TypesPlugin' type: array description: OK '401': @@ -529,256 +530,7 @@ paths: $ref: '#/components/schemas/UsererrorError' description: Internal Server Error tags: - - pipeline - post: - operationId: createExecution - parameters: - - in: path - name: pipeline_ref - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OpenapiCreateExecutionRequest' - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/TypesExecution' - description: Created - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Bad Request - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Unauthorized - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Forbidden - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Internal Server Error - tags: - - pipeline - /pipelines/{pipeline_ref}/executions/{execution_number}: - delete: - operationId: deleteExecution - parameters: - - in: path - name: pipeline_ref - required: true - schema: - type: string - - in: path - name: execution_number - required: true - schema: - type: string - responses: - '204': - description: No Content - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Unauthorized - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Not Found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Internal Server Error - tags: - - pipeline - get: - operationId: findExecution - parameters: - - in: path - name: pipeline_ref - required: true - schema: - type: string - - in: path - name: execution_number - required: true - schema: - type: string - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/TypesExecution' - description: OK - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Unauthorized - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Not Found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Internal Server Error - tags: - - pipeline - patch: - operationId: updateExecution - parameters: - - in: path - name: pipeline_ref - required: true - schema: - type: string - - in: path - name: execution_number - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OpenapiUpdateExecutionRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/TypesExecution' - description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Bad Request - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Unauthorized - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Not Found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Internal Server Error - tags: - - pipeline - /pipelines/{pipeline_ref}/executions/{execution_number}/logs/{stage_number}/{step_number}: - get: - operationId: viewLogs - parameters: - - in: path - name: pipeline_ref - required: true - schema: - type: string - - in: path - name: execution_number - required: true - schema: - type: string - - in: path - name: stage_number - required: true - schema: - type: string - - in: path - name: step_number - required: true - schema: - type: string - responses: - '200': - content: - text/plain: - schema: - type: string - description: OK - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Unauthorized - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Not Found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Internal Server Error - tags: - - pipeline + - plugins /principals: get: operationId: listPrincipals @@ -2191,6 +1943,891 @@ paths: description: Internal Server Error tags: - repository + /repos/{repo_ref}/pipelines: + get: + operationId: listPipelines + parameters: + - description: The substring which is used to filter the repositories by their + path name. + in: query + name: query + required: false + schema: + type: string + - description: The page to return. + in: query + name: page + required: false + schema: + default: 1 + minimum: 1 + type: integer + - description: The maximum number of results to return. + in: query + name: limit + required: false + schema: + default: 30 + maximum: 100 + minimum: 1 + type: integer + - in: path + name: repo_ref + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + items: + $ref: '#/components/schemas/TypesPipeline' + type: array + description: OK + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - repos + post: + operationId: createPipeline + parameters: + - in: path + name: repo_ref + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OpenapiCreatePipelineRequest' + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/TypesPipeline' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - pipeline + /repos/{repo_ref}/pipelines/{pipeline_uid}: + delete: + operationId: deletePipeline + parameters: + - in: path + name: repo_ref + required: true + schema: + type: string + - in: path + name: pipeline_uid + required: true + schema: + type: string + responses: + '204': + description: No Content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - pipeline + get: + operationId: findPipeline + parameters: + - in: path + name: repo_ref + required: true + schema: + type: string + - in: path + name: pipeline_uid + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TypesPipeline' + description: OK + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - pipeline + patch: + operationId: updatePipeline + parameters: + - in: path + name: repo_ref + required: true + schema: + type: string + - in: path + name: pipeline_uid + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OpenapiUpdatePipelineRequest' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TypesPipeline' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - pipeline + /repos/{repo_ref}/pipelines/{pipeline_uid}/executions: + get: + operationId: listExecutions + parameters: + - description: The page to return. + in: query + name: page + required: false + schema: + default: 1 + minimum: 1 + type: integer + - description: The maximum number of results to return. + in: query + name: limit + required: false + schema: + default: 30 + maximum: 100 + minimum: 1 + type: integer + - in: path + name: repo_ref + required: true + schema: + type: string + - in: path + name: pipeline_uid + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + items: + $ref: '#/components/schemas/TypesExecution' + type: array + description: OK + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - pipeline + post: + operationId: createExecution + parameters: + - in: path + name: repo_ref + required: true + schema: + type: string + - in: path + name: pipeline_uid + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OpenapiCreateExecutionRequest' + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/TypesExecution' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - pipeline + /repos/{repo_ref}/pipelines/{pipeline_uid}/executions/{execution_number}: + delete: + operationId: deleteExecution + parameters: + - in: path + name: repo_ref + required: true + schema: + type: string + - in: path + name: pipeline_uid + required: true + schema: + type: string + - in: path + name: execution_number + required: true + schema: + type: string + responses: + '204': + description: No Content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - pipeline + get: + operationId: findExecution + parameters: + - in: path + name: repo_ref + required: true + schema: + type: string + - in: path + name: pipeline_uid + required: true + schema: + type: string + - in: path + name: execution_number + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TypesExecution' + description: OK + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - pipeline + patch: + operationId: updateExecution + parameters: + - in: path + name: repo_ref + required: true + schema: + type: string + - in: path + name: pipeline_uid + required: true + schema: + type: string + - in: path + name: execution_number + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OpenapiUpdateExecutionRequest' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TypesExecution' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - pipeline + /repos/{repo_ref}/pipelines/{pipeline_uid}/executions/{execution_number}/logs/{stage_number}/{step_number}: + get: + operationId: viewLogs + parameters: + - in: path + name: repo_ref + required: true + schema: + type: string + - in: path + name: pipeline_uid + required: true + schema: + type: string + - in: path + name: execution_number + required: true + schema: + type: string + - in: path + name: stage_number + required: true + schema: + type: string + - in: path + name: step_number + required: true + schema: + type: string + responses: + '200': + content: + text/plain: + schema: + type: string + description: OK + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - pipeline + /repos/{repo_ref}/pipelines/{pipeline_uid}/triggers: + get: + operationId: listTriggers + parameters: + - description: The substring which is used to filter the repositories by their + path name. + in: query + name: query + required: false + schema: + type: string + - description: The page to return. + in: query + name: page + required: false + schema: + default: 1 + minimum: 1 + type: integer + - description: The maximum number of results to return. + in: query + name: limit + required: false + schema: + default: 30 + maximum: 100 + minimum: 1 + type: integer + - in: path + name: repo_ref + required: true + schema: + type: string + - in: path + name: pipeline_uid + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + items: + $ref: '#/components/schemas/TypesTrigger' + type: array + description: OK + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - pipeline + post: + operationId: createTrigger + parameters: + - in: path + name: repo_ref + required: true + schema: + type: string + - in: path + name: pipeline_uid + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OpenapiCreateTriggerRequest' + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/TypesTrigger' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - pipeline + /repos/{repo_ref}/pipelines/{pipeline_uid}/triggers/{trigger_uid}: + delete: + operationId: deleteTrigger + parameters: + - in: path + name: repo_ref + required: true + schema: + type: string + - in: path + name: pipeline_uid + required: true + schema: + type: string + - in: path + name: trigger_uid + required: true + schema: + type: string + responses: + '204': + description: No Content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - pipeline + get: + operationId: findTrigger + parameters: + - in: path + name: repo_ref + required: true + schema: + type: string + - in: path + name: pipeline_uid + required: true + schema: + type: string + - in: path + name: trigger_uid + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TypesTrigger' + description: OK + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - pipeline + patch: + operationId: updateTrigger + parameters: + - in: path + name: repo_ref + required: true + schema: + type: string + - in: path + name: pipeline_uid + required: true + schema: + type: string + - in: path + name: trigger_uid + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OpenapiUpdateTriggerRequest' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TypesTrigger' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - pipeline /repos/{repo_ref}/pullreq: get: operationId: listPullReq @@ -4324,6 +4961,74 @@ paths: description: Internal Server Error tags: - space + /spaces/{space_ref}/connectors: + get: + operationId: listConnectors + parameters: + - description: The substring which is used to filter the repositories by their + path name. + in: query + name: query + required: false + schema: + type: string + - description: The page to return. + in: query + name: page + required: false + schema: + default: 1 + minimum: 1 + type: integer + - description: The maximum number of results to return. + in: query + name: limit + required: false + schema: + default: 30 + maximum: 100 + minimum: 1 + type: integer + - in: path + name: space_ref + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + items: + $ref: '#/components/schemas/TypesConnector' + type: array + description: OK + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - space /spaces/{space_ref}/members: get: operationId: membershipList @@ -4756,74 +5461,6 @@ paths: description: Internal Server Error tags: - space - /spaces/{space_ref}/pipelines: - get: - operationId: listPipelines - parameters: - - description: The substring which is used to filter the repositories by their - path name. - in: query - name: query - required: false - schema: - type: string - - description: The page to return. - in: query - name: page - required: false - schema: - default: 1 - minimum: 1 - type: integer - - description: The maximum number of results to return. - in: query - name: limit - required: false - schema: - default: 30 - maximum: 100 - minimum: 1 - type: integer - - in: path - name: space_ref - required: true - schema: - type: string - responses: - '200': - content: - application/json: - schema: - items: - $ref: '#/components/schemas/TypesPipeline' - type: array - description: OK - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Unauthorized - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Not Found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Internal Server Error - tags: - - space /spaces/{space_ref}/repos: get: operationId: listRepos @@ -5116,6 +5753,74 @@ paths: description: Internal Server Error tags: - space + /spaces/{space_ref}/templates: + get: + operationId: listTemplates + parameters: + - description: The substring which is used to filter the repositories by their + path name. + in: query + name: query + required: false + schema: + type: string + - description: The page to return. + in: query + name: page + required: false + schema: + default: 1 + minimum: 1 + type: integer + - description: The maximum number of results to return. + in: query + name: limit + required: false + schema: + default: 30 + maximum: 100 + minimum: 1 + type: integer + - in: path + name: space_ref + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + items: + $ref: '#/components/schemas/TypesTemplate' + type: array + description: OK + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - space /system/config: get: operationId: getSystemConfig @@ -5140,6 +5845,178 @@ paths: description: Internal Server Error tags: - system + /templates: + post: + operationId: createTemplate + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OpenapiCreateTemplateRequest' + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/TypesTemplate' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - template + /templates/{template_ref}: + delete: + operationId: deleteTemplate + parameters: + - in: path + name: template_ref + required: true + schema: + type: string + responses: + '204': + description: No Content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - template + get: + operationId: findTemplate + parameters: + - in: path + name: template_ref + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TypesTemplate' + description: OK + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - template + patch: + operationId: updateTemplate + parameters: + - in: path + name: template_ref + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OpenapiUpdateTemplateRequest' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TypesTemplate' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - template /user: get: operationId: getUser @@ -5183,6 +6060,52 @@ paths: /user/memberships: get: operationId: membershipSpaces + parameters: + - description: The substring by which the spaces the users is a member of are + filtered. + in: query + name: query + required: false + schema: + type: string + - description: The order of the output. + in: query + name: order + required: false + schema: + default: asc + enum: + - asc + - desc + type: string + - description: The field by which the spaces the user is a member of are sorted. + in: query + name: sort + required: false + schema: + default: uid + enum: + - created + - path + - uid + type: string + - description: The page to return. + in: query + name: page + required: false + schema: + default: 1 + minimum: 1 + type: integer + - description: The maximum number of results to return. + in: query + name: limit + required: false + schema: + default: 30 + maximum: 100 + minimum: 1 + type: integer responses: '200': content: @@ -5315,13 +6238,6 @@ components: - merged - open type: string - EnumScmType: - enum: - - GITNESS - - GITHUB - - GITLAB - - UNKNOWN - type: string EnumTokenType: type: string EnumWebhookExecutionResult: @@ -5546,6 +6462,19 @@ components: target: type: string type: object + OpenapiCreateConnectorRequest: + properties: + data: + type: string + description: + type: string + space_ref: + type: string + type: + type: string + uid: + type: string + type: object OpenapiCreateExecutionRequest: properties: status: @@ -5564,12 +6493,6 @@ components: type: string description: type: string - repo_ref: - type: string - repo_type: - $ref: '#/components/schemas/EnumScmType' - space_ref: - type: string uid: type: string type: object @@ -5645,6 +6568,19 @@ components: target: type: string type: object + OpenapiCreateTemplateRequest: + properties: + data: + type: string + description: + type: string + space_ref: + type: string + type: + type: string + uid: + type: string + type: object OpenapiCreateTokenRequest: properties: grants: @@ -5654,6 +6590,13 @@ components: uid: type: string type: object + OpenapiCreateTriggerRequest: + properties: + description: + type: string + uid: + type: string + type: object OpenapiCreateWebhookRequest: properties: description: @@ -5780,6 +6723,15 @@ components: admin: type: boolean type: object + OpenapiUpdateConnectorRequest: + properties: + data: + type: string + description: + type: string + uid: + type: string + type: object OpenapiUpdateExecutionRequest: properties: status: @@ -5828,6 +6780,22 @@ components: nullable: true type: boolean type: object + OpenapiUpdateTemplateRequest: + properties: + data: + type: string + description: + type: string + uid: + type: string + type: object + OpenapiUpdateTriggerRequest: + properties: + description: + type: string + uid: + type: string + type: object OpenapiUpdateWebhookRequest: properties: description: @@ -6076,6 +7044,25 @@ components: title: type: string type: object + TypesConnector: + properties: + created: + type: integer + data: + type: string + description: + type: string + id: + type: integer + space_id: + type: integer + type: + type: string + uid: + type: string + updated: + type: integer + type: object TypesDiffStats: properties: commits: @@ -6248,14 +7235,8 @@ components: type: integer repo_id: type: integer - repo_name: - type: string - repo_type: - $ref: '#/components/schemas/EnumScmType' seq: type: integer - space_id: - type: integer uid: type: string updated: @@ -6263,6 +7244,17 @@ components: version: type: integer type: object + TypesPlugin: + properties: + description: + type: string + logo: + type: string + spec: + type: string + uid: + type: string + type: object TypesPrincipalInfo: properties: created: @@ -6604,6 +7596,23 @@ components: stopped: type: integer type: object + TypesTemplate: + properties: + created: + type: integer + data: + type: string + description: + type: string + id: + type: integer + space_id: + type: integer + uid: + type: string + updated: + type: integer + type: object TypesToken: properties: created_by: @@ -6629,6 +7638,21 @@ components: token: $ref: '#/components/schemas/TypesToken' type: object + TypesTrigger: + properties: + created: + type: integer + description: + type: string + id: + type: integer + pipeline_id: + type: integer + uid: + type: string + updated: + type: integer + type: object TypesUser: properties: admin: