diff --git a/web/src/RouteDefinitions.ts b/web/src/RouteDefinitions.ts index d58c7c19c..f1570a9ec 100644 --- a/web/src/RouteDefinitions.ts +++ b/web/src/RouteDefinitions.ts @@ -14,6 +14,7 @@ export interface CODEProps { pipeline?: string execution?: string commitSHA?: string + secret?: string } export interface CODEQueryProps { @@ -32,7 +33,8 @@ export const pathProps: Readonly, 'repoPath' | 'branch' webhookId: ':webhookId', pipeline: ':pipeline', execution: ':execution', - commitSHA: ':commitSHA' + commitSHA: ':commitSHA', + secret: ':secret' } export interface CODERoutes { @@ -73,6 +75,7 @@ export interface CODERoutes { toCODEExecutions: (args: Required>) => string toCODEExecution: (args: Required>) => string + toCODESecret: (args: Required>) => string } /** @@ -126,5 +129,7 @@ export const routes: CODERoutes = { toCODEWebhookDetails: ({ repoPath, webhookId }) => `/${repoPath}/webhook/${webhookId}`, toCODEExecutions: ({ space, pipeline }) => `/pipelines/${space}/pipeline/${pipeline}`, - toCODEExecution: ({ space, pipeline, execution }) => `/pipelines/${space}/pipeline/${pipeline}/execution/${execution}` + toCODEExecution: ({ space, pipeline, execution }) => + `/pipelines/${space}/pipeline/${pipeline}/execution/${execution}`, + toCODESecret: ({ space, secret }) => `/secrets/${space}/secret/${secret}` } diff --git a/web/src/RouteDestinations.tsx b/web/src/RouteDestinations.tsx index 0565f9e10..76fb7aaaa 100644 --- a/web/src/RouteDestinations.tsx +++ b/web/src/RouteDestinations.tsx @@ -30,6 +30,7 @@ import { useStrings } from 'framework/strings' import { useFeatureFlag } from 'hooks/useFeatureFlag' import ExecutionList from 'pages/ExecutionList/ExecutionList' import Execution from 'pages/Execution/Execution' +import Secret from 'pages/Secret/Secret' export const RouteDestinations: React.FC = React.memo(function RouteDestinations() { const { getString } = useStrings() @@ -192,6 +193,14 @@ export const RouteDestinations: React.FC = React.memo(function RouteDestinations )} + {OPEN_SOURCE_SECRETS && ( + + + + + + )} + {OPEN_SOURCE_SECRETS && ( diff --git a/web/src/components/NewSecretModalButton/NewSecretModalButton.tsx b/web/src/components/NewSecretModalButton/NewSecretModalButton.tsx new file mode 100644 index 000000000..5e189e4da --- /dev/null +++ b/web/src/components/NewSecretModalButton/NewSecretModalButton.tsx @@ -0,0 +1,159 @@ +import { + useToaster, + type ButtonProps, + Button, + Dialog, + Layout, + Heading, + FontVariation, + Container, + Formik, + FormikForm, + FormInput, + Intent, + FlexExpander, + Icon +} from '@harness/uicore' +import { useModalHook } from '@harness/use-modal' +import React from 'react' +import { useMutate } from 'restful-react' +import * as yup from 'yup' +import { useStrings } from 'framework/strings' +import type { OpenapiCreateSecretRequest, TypesSecret } from 'services/code' +import { getErrorMessage } from 'utils/Utils' + +interface SecretFormData { + value: string + description: string + name: string +} + +const formInitialValues: SecretFormData = { + value: '', + description: '', + name: '' +} + +export interface NewSecretModalButtonProps extends Omit { + space: string + modalTitle: string + submitButtonTitle?: string + cancelButtonTitle?: string + onSubmit: (data: TypesSecret) => void +} + +export const NewSecretModalButton: React.FC = ({ + space, + modalTitle, + submitButtonTitle, + cancelButtonTitle, + onSubmit, + ...props +}) => { + const ModalComponent: React.FC = () => { + const { getString } = useStrings() + const { showError } = useToaster() + + const { mutate: createSecret, loading } = useMutate({ + verb: 'POST', + path: `/api/v1/secrets` + }) + + const handleSubmit = async (formData: SecretFormData) => { + try { + const payload: OpenapiCreateSecretRequest = { + space_ref: space, + data: formData.value, + description: formData.description, + uid: formData.name + } + const response = await createSecret(payload) + hideModal() + onSubmit(response) + } catch (exception) { + showError(getErrorMessage(exception), 0, getString('secrets.failedToCreate')) + } + } + + return ( + + + + {modalTitle} + + + + + + + + + + + + ) + } + + const [openModal, hideModal] = useModalHook(ModalComponent, [onSubmit]) + + return ) - const columns: Column[] = useMemo( + const columns: Column[] = useMemo( () => [ { Header: getString('repos.name'), width: 'calc(100% - 180px)', - Cell: ({ row }: CellProps) => { + Cell: ({ row }: CellProps) => { const record = row.original return ( - - {record.uid} - - {record.description && {record.description}} + {record.number} + {record.status && {record.status}} @@ -109,63 +80,64 @@ const ExecutionList = () => { { Header: getString('repos.updated'), width: '180px', - Cell: ({ row }: CellProps) => { + Cell: ({ row }: CellProps) => { return ( {formatDate(row.original.updated as number)} - {row.original.isPublic === false ? : undefined} ) }, disableSortBy: true } ], - [getString, searchTerm] + [getString] ) return ( executions.length === 0, + when: () => executions?.length === 0, image: noExecutionImage, message: getString('executions.noData'), button: NewExecutionButton }}> - + {NewExecutionButton} - {!!executions?.length && ( - + className={css.table} columns={columns} data={executions || []} onRowClick={executionInfo => history.push( routes.toCODEExecution({ - space: executionInfo.spaceUid, - pipeline: executionInfo.pipelineUid, - execution: executionInfo.uid + space, + pipeline: pipeline as string, + execution: String(executionInfo.id) }) ) } - getRowClassName={row => cx(css.row, !row.original.description && css.noDesc)} + getRowClassName={row => cx(css.row, !row.original.number && css.noDesc)} /> )} - !!executions.length && !!searchTerm?.length} forSearch={true} /> + !!executions && executions.length === 0} forSearch={true} /> - {/* */} + diff --git a/web/src/pages/PipelineList/PipelineList.module.scss b/web/src/pages/PipelineList/PipelineList.module.scss index 9e2d12861..dfdc0aec4 100644 --- a/web/src/pages/PipelineList/PipelineList.module.scss +++ b/web/src/pages/PipelineList/PipelineList.module.scss @@ -7,6 +7,10 @@ } } +.withError { + display: grid; +} + .table { [class*='TableV2--header'] [class*='variation-table-headers'] { text-transform: none; diff --git a/web/src/pages/PipelineList/PipelineList.module.scss.d.ts b/web/src/pages/PipelineList/PipelineList.module.scss.d.ts index bcb8f1c05..c83440288 100644 --- a/web/src/pages/PipelineList/PipelineList.module.scss.d.ts +++ b/web/src/pages/PipelineList/PipelineList.module.scss.d.ts @@ -3,6 +3,7 @@ declare const styles: { readonly main: string readonly layout: string + readonly withError: string readonly table: string readonly row: string readonly noDesc: string diff --git a/web/src/pages/PipelineList/PipelineList.tsx b/web/src/pages/PipelineList/PipelineList.tsx index b41a3a815..07173b538 100644 --- a/web/src/pages/PipelineList/PipelineList.tsx +++ b/web/src/pages/PipelineList/PipelineList.tsx @@ -5,7 +5,6 @@ import { Color, Container, FlexExpander, - Icon, Layout, PageBody, PageHeader, @@ -16,62 +15,41 @@ import cx from 'classnames' import type { CellProps, Column } from 'react-table' import Keywords from 'react-keywords' import { useHistory } from 'react-router-dom' +import { useGet } from 'restful-react' import { useStrings } from 'framework/strings' import { LoadingSpinner } from 'components/LoadingSpinner/LoadingSpinner' -import { useAppContext } from 'AppContext' import { SearchInputWithSpinner } from 'components/SearchInputWithSpinner/SearchInputWithSpinner' import { NoResultCard } from 'components/NoResultCard/NoResultCard' -import { formatDate } from 'utils/Utils' +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 noPipelineImage from '../RepositoriesListing/no-repo.svg' import css from './PipelineList.module.scss' -interface Pipeline { - id: number - uid: string - name: string - updated: number - description?: string - isPublic?: boolean - spaceUid: string -} - -const pipelines: Pipeline[] = [ - { - id: 1, - uid: 'pipeline-1', - name: 'Pipeline 1', - updated: 1687234800, - description: 'This is a description', - isPublic: true, - spaceUid: 'root' - }, - { - id: 2, - uid: 'pipeline-2', - name: 'Pipeline 2', - updated: 1730275200, - description: 'This is a description', - isPublic: true, - spaceUid: 'root' - }, - { - id: 3, - uid: 'pipeline-3', - name: 'Pipeline 3', - updated: 1773315600, - description: 'This is a description', - isPublic: false, - spaceUid: 'root' - } -] - -const loading = false - const PipelineList = () => { const { routes } = useAppContext() + const space = useGetSpaceParam() const history = useHistory() const { getString } = useStrings() const [searchTerm, setSearchTerm] = useState() + const pageBrowser = useQueryParams() + const pageInit = pageBrowser.page ? parseInt(pageBrowser.page) : 1 + const [page, setPage] = usePageIndex(pageInit) + + const { + data: pipelines, + error, + loading, + refetch, + response + } = useGet({ + path: `/api/v1/spaces/${space}/pipelines`, + queryParams: { page, limit: LIST_FETCHING_LIMIT, query: searchTerm } + }) const NewPipelineButton = ( ) - const columns: Column[] = useMemo( + const columns: Column[] = useMemo( () => [ { Header: getString('pipelines.name'), width: 'calc(100% - 180px)', - Cell: ({ row }: CellProps) => { + Cell: ({ row }: CellProps) => { const record = row.original return ( @@ -105,13 +83,12 @@ const PipelineList = () => { { Header: getString('repos.updated'), width: '180px', - Cell: ({ row }: CellProps) => { + Cell: ({ row }: CellProps) => { return ( {formatDate(row.original.updated as number)} - {row.original.isPublic === false ? : undefined} ) }, @@ -125,8 +102,11 @@ const PipelineList = () => { pipelines.length === 0, + when: () => pipelines?.length === 0 && searchTerm === undefined, image: noPipelineImage, message: getString('pipelines.noData'), button: NewPipelineButton @@ -142,20 +122,23 @@ const PipelineList = () => { {!!pipelines?.length && ( - + className={css.table} columns={columns} data={pipelines || []} onRowClick={pipelineInfo => - history.push(routes.toCODEExecutions({ space: pipelineInfo.spaceUid, pipeline: pipelineInfo.uid })) + history.push(routes.toCODEExecutions({ space, pipeline: pipelineInfo.uid as string })) } getRowClassName={row => cx(css.row, !row.original.description && css.noDesc)} /> )} - !!pipelines.length && !!searchTerm?.length} forSearch={true} /> + !!pipelines && pipelines?.length === 0 && !!searchTerm?.length} + forSearch={true} + /> - {/* */} + diff --git a/web/src/pages/Secret/Secret.module.scss b/web/src/pages/Secret/Secret.module.scss new file mode 100644 index 000000000..d1b1df197 --- /dev/null +++ b/web/src/pages/Secret/Secret.module.scss @@ -0,0 +1,4 @@ +.main { + min-height: var(--page-min-height, 100%); + background-color: var(--primary-bg) !important; +} diff --git a/web/src/pages/Secret/Secret.module.scss.d.ts b/web/src/pages/Secret/Secret.module.scss.d.ts new file mode 100644 index 000000000..9e614bf2d --- /dev/null +++ b/web/src/pages/Secret/Secret.module.scss.d.ts @@ -0,0 +1,6 @@ +/* eslint-disable */ +// this is an auto-generated file +declare const styles: { + readonly main: string +} +export default styles diff --git a/web/src/pages/Secret/Secret.tsx b/web/src/pages/Secret/Secret.tsx new file mode 100644 index 000000000..02e054a74 --- /dev/null +++ b/web/src/pages/Secret/Secret.tsx @@ -0,0 +1,31 @@ +import React from 'react' +import { Container, PageHeader } from '@harness/uicore' +import { useParams } from 'react-router-dom' +import { useGet } from 'restful-react' +import type { CODEProps } from 'RouteDefinitions' +import { useGetSpaceParam } from 'hooks/useGetSpaceParam' +import type { TypesSecret } from 'services/code' +import css from './Secret.module.scss' + +const Execution = () => { + const space = useGetSpaceParam() + const { secret: secretName } = useParams() + + const { + data: secret + // error, + // loading, + // refetch + // response + } = useGet({ + path: `/api/v1/secrets/${space}/${secretName}/+` + }) + + return ( + + + + ) +} + +export default Execution diff --git a/web/src/pages/SecretList/SecretList.module.scss b/web/src/pages/SecretList/SecretList.module.scss index f1fb64bb6..dfdc0aec4 100644 --- a/web/src/pages/SecretList/SecretList.module.scss +++ b/web/src/pages/SecretList/SecretList.module.scss @@ -1,4 +1,86 @@ .main { min-height: var(--page-height); background-color: var(--primary-bg) !important; + + .layout { + align-items: center; + } +} + +.withError { + display: grid; +} + +.table { + [class*='TableV2--header'] [class*='variation-table-headers'] { + text-transform: none; + color: var(--grey-400); + font-weight: 500; + font-size: 13px; + } + + .row { + height: 80px; + box-shadow: 0px 0px 1px rgba(40, 41, 61, 0.08), 0px 0.5px 2px rgba(96, 97, 112, 0.16); + overflow: hidden; + + &.noDesc > div { + height: 44px; + } + } +} + +.nameContainer { + position: relative; + + .name { + flex-grow: 1; + align-items: baseline !important; + width: calc(100% - 100px) !important; + + > span { + width: 100%; + > span { + width: 100%; + } + } + + & + span:last-of-type { + align-self: center; + } + } + + .pinned { + transform: rotate(-90deg); + position: absolute; + top: 7px; + left: -43px; + font-size: var(--font-size-xsmall) !important; + padding: 6px 14px; + } + + .repoName { + font-weight: 600 !important; + font-size: 16px !important; + line-height: 24px !important; + color: var(--grey-800); + + .repoScope { + color: var(--grey-400); + padding: 2px 6px; + font-size: var(--font-size-xsmall) !important; + border-radius: 4px; + border: 1px solid var(--grey-200); + display: inline-block; + margin-left: var(--spacing-medium); + text-transform: uppercase; + line-height: 16px; + } + } + + .desc { + color: var(--grey-500); + font-size: var(--font-size-small); + padding-top: var(--spacing-xsmall) !important; + } } diff --git a/web/src/pages/SecretList/SecretList.module.scss.d.ts b/web/src/pages/SecretList/SecretList.module.scss.d.ts index 9e614bf2d..c83440288 100644 --- a/web/src/pages/SecretList/SecretList.module.scss.d.ts +++ b/web/src/pages/SecretList/SecretList.module.scss.d.ts @@ -2,5 +2,16 @@ // this is an auto-generated file declare const styles: { readonly main: string + readonly layout: string + readonly withError: string + readonly table: string + readonly row: string + readonly noDesc: string + readonly nameContainer: string + readonly name: string + readonly pinned: string + readonly repoName: string + readonly repoScope: string + readonly desc: string } export default styles diff --git a/web/src/pages/SecretList/SecretList.tsx b/web/src/pages/SecretList/SecretList.tsx index da1e9e9e2..fc3cfa5bd 100644 --- a/web/src/pages/SecretList/SecretList.tsx +++ b/web/src/pages/SecretList/SecretList.tsx @@ -1,16 +1,151 @@ -import React from 'react' -import { Container, PageHeader } from '@harness/uicore' +import React, { useMemo, useState } from 'react' +import { + ButtonVariation, + Color, + Container, + FlexExpander, + Layout, + PageBody, + PageHeader, + TableV2 as Table, + Text +} from '@harness/uicore' +import cx from 'classnames' +import type { CellProps, Column } from 'react-table' +import Keywords from 'react-keywords' +import { useHistory } from 'react-router-dom' +import { useGet } from 'restful-react' import { useStrings } from 'framework/strings' +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 type { TypesSecret } from 'services/code' +import { usePageIndex } from 'hooks/usePageIndex' +import { useQueryParams } from 'hooks/useQueryParams' +import { useGetSpaceParam } from 'hooks/useGetSpaceParam' +import { ResourceListingPagination } from 'components/ResourceListingPagination/ResourceListingPagination' +import { NewSecretModalButton } from 'components/NewSecretModalButton/NewSecretModalButton' +import { useAppContext } from 'AppContext' +import noSecretsImage from '../RepositoriesListing/no-repo.svg' import css from './SecretList.module.scss' -const PipelineList = () => { +const SecretList = () => { + const { routes } = useAppContext() + const space = useGetSpaceParam() + const history = useHistory() const { getString } = useStrings() + const [searchTerm, setSearchTerm] = useState() + const pageBrowser = useQueryParams() + const pageInit = pageBrowser.page ? parseInt(pageBrowser.page) : 1 + const [page, setPage] = usePageIndex(pageInit) + + const { + data: secrets, + error, + loading, + refetch, + response + } = useGet({ + path: `/api/v1/spaces/${space}/secrets`, + queryParams: { page, limit: LIST_FETCHING_LIMIT, query: searchTerm } + }) + + const NewSecretButton = ( + + history.push(routes.toCODESecret({ space, secret: secretInfo.uid as string })) + }> + ) + + const columns: Column[] = useMemo( + () => [ + { + Header: getString('secrets.name'), + width: 'calc(100% - 180px)', + Cell: ({ row }: CellProps) => { + const record = row.original + return ( + + + + + {record.uid} + + {record.description && {record.description}} + + + + ) + } + }, + { + Header: getString('repos.updated'), + width: '180px', + Cell: ({ row }: CellProps) => { + return ( + + + {formatDate(row.original.updated as number)} + + + ) + }, + disableSortBy: true + } + ], + [getString, searchTerm] + ) return ( + secrets?.length === 0 && searchTerm === undefined, + image: noSecretsImage, + message: getString('secrets.noData'), + button: NewSecretButton + }}> + + + + + {NewSecretButton} + + + + + + {!!secrets?.length && ( + + className={css.table} + columns={columns} + data={secrets || []} + onRowClick={secretInfo => + history.push(routes.toCODESecret({ space: 'root', secret: secretInfo.uid as string })) + } + getRowClassName={row => cx(css.row, !row.original.description && css.noDesc)} + /> + )} + !!secrets && secrets?.length === 0 && !!searchTerm?.length} + forSearch={true} + /> + + + + ) } -export default PipelineList +export default SecretList diff --git a/web/src/services/code/index.tsx b/web/src/services/code/index.tsx index c7e735dc5..414b919af 100644 --- a/web/src/services/code/index.tsx +++ b/web/src/services/code/index.tsx @@ -45,6 +45,8 @@ 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 @@ -67,13 +69,13 @@ export interface GitrpcBlamePart { lines?: string[] | null } -export type GitrpcCommit = { +export interface GitrpcCommit { author?: GitrpcSignature committer?: GitrpcSignature message?: string sha?: string title?: string -} | null +} export type GitrpcFileAction = 'CREATE' | 'UPDATE' | 'DELETE' | 'MOVE' @@ -82,6 +84,12 @@ export interface GitrpcIdentity { name?: string } +export interface GitrpcPathDetails { + last_commit?: GitrpcCommit + path?: string + size?: number +} + export interface GitrpcSignature { identity?: GitrpcIdentity when?: string @@ -150,10 +158,24 @@ export interface OpenapiCreateBranchRequest { target?: string } +export interface OpenapiCreateExecutionRequest { + status?: string +} + export interface OpenapiCreatePathRequest { path?: string } +export interface OpenapiCreatePipelineRequest { + config_path?: string + default_branch?: string + description?: string + repo_ref?: string + repo_type?: EnumScmType + space_ref?: string + uid?: string +} + export interface OpenapiCreatePullReqRequest { description?: string is_draft?: boolean @@ -179,6 +201,13 @@ export interface OpenapiCreateRepositoryRequest { uid?: string } +export interface OpenapiCreateSecretRequest { + data?: string + description?: string + space_ref?: string + uid?: string +} + export interface OpenapiCreateSpaceRequest { description?: string is_public?: boolean @@ -243,6 +272,10 @@ export interface OpenapiMoveSpaceRequest { uid?: string | null } +export interface OpenapiPathsDetailsRequest { + paths?: string[] | null +} + export interface OpenapiRegisterRequest { display_name?: string email?: string @@ -270,6 +303,16 @@ export interface OpenapiUpdateAdminRequest { admin?: boolean } +export interface OpenapiUpdateExecutionRequest { + status?: string +} + +export interface OpenapiUpdatePipelineRequest { + config_path?: string + description?: string + uid?: string +} + export interface OpenapiUpdatePullReqRequest { description?: string title?: string @@ -280,6 +323,12 @@ export interface OpenapiUpdateRepoRequest { is_public?: boolean | null } +export interface OpenapiUpdateSecretRequest { + data?: string + description?: string + uid?: string +} + export interface OpenapiUpdateSpaceRequest { description?: string | null is_public?: boolean | null @@ -376,6 +425,10 @@ export interface RepoMergeCheck { mergeable?: boolean } +export interface RepoPathsDetailsOutput { + details?: GitrpcPathDetails[] | null +} + export interface RepoSubmoduleContent { commit_sha?: string url?: string @@ -431,6 +484,44 @@ export interface TypesDiffStats { files_changed?: number } +export interface TypesExecution { + action?: string + after?: string + author_avatar?: string + author_email?: string + author_login?: string + author_name?: string + before?: string + created?: number + cron?: string + debug?: boolean + deploy_id?: number + deploy_to?: string + error?: string + event?: string + finished?: number + id?: number + link?: string + message?: string + number?: number + params?: string + parent?: number + pipeline_id?: number + ref?: string + repo_id?: number + sender?: string + source?: string + source_repo?: string + started?: number + status?: string + target?: string + timestamp?: number + title?: string + trigger?: string + updated?: number + version?: number +} + export interface TypesIdentity { email?: string name?: string @@ -473,6 +564,22 @@ export interface TypesPath { value?: string } +export interface TypesPipeline { + config_path?: string + created?: number + default_branch?: string + 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 TypesPrincipalInfo { created?: number display_name?: string @@ -574,6 +681,16 @@ export interface TypesRepository { updated?: number } +export interface TypesSecret { + created?: number + description?: string + id?: number + space_id?: number + uid?: string + updated?: number + version?: number +} + export interface TypesServiceAccount { admin?: boolean blocked?: boolean @@ -859,6 +976,274 @@ export type UseOpLogoutProps = Omit useMutate('POST', `/logout`, { base: getConfig('code'), ...props }) +export type CreatePipelineProps = Omit< + MutateProps, + 'path' | 'verb' +> + +export const CreatePipeline = (props: CreatePipelineProps) => ( + + verb="POST" + path={`/pipelines`} + base={getConfig('code')} + {...props} + /> +) + +export type UseCreatePipelineProps = Omit< + UseMutateProps, + 'path' | 'verb' +> + +export const useCreatePipeline = (props: UseCreatePipelineProps) => + useMutate('POST', `/pipelines`, { + base: getConfig('code'), + ...props + }) + +export type DeletePipelineProps = Omit, 'path' | 'verb'> + +export const DeletePipeline = (props: DeletePipelineProps) => ( + + verb="DELETE" + path={`/pipelines`} + base={getConfig('code')} + {...props} + /> +) + +export type UseDeletePipelineProps = Omit, 'path' | 'verb'> + +export const useDeletePipeline = (props: UseDeletePipelineProps) => + useMutate('DELETE', `/pipelines`, { base: getConfig('code'), ...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')} + {...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'), 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')} + {...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'), pathParams: { pipeline_ref }, ...props } + ) + +export interface ListExecutionsQueryParams { + /** + * The page to return. + */ + page?: number + /** + * The maximum number of results to return. + */ + limit?: number +} + +export interface ListExecutionsPathParams { + pipeline_ref: string +} + +export type ListExecutionsProps = Omit< + GetProps, + 'path' +> & + ListExecutionsPathParams + +export const ListExecutions = ({ pipeline_ref, ...props }: ListExecutionsProps) => ( + + path={`/pipelines/${pipeline_ref}/executions`} + base={getConfig('code')} + {...props} + /> +) + +export type UseListExecutionsProps = Omit< + UseGetProps, + 'path' +> & + ListExecutionsPathParams + +export const useListExecutions = ({ pipeline_ref, ...props }: UseListExecutionsProps) => + useGet( + (paramsInPath: ListExecutionsPathParams) => `/pipelines/${paramsInPath.pipeline_ref}/executions`, + { base: getConfig('code'), 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')} + {...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'), 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')} + {...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'), 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')} + {...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'), 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')} + {...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'), pathParams: { pipeline_ref, execution_number }, ...props } + ) + export interface ListPrincipalsQueryParams { /** * The substring by which the principals are filtered. @@ -1637,6 +2022,69 @@ export const useMoveRepository = ({ repo_ref, ...props }: UseMoveRepositoryProps { base: getConfig('code'), pathParams: { repo_ref }, ...props } ) +export interface PathDetailsQueryParams { + /** + * The git reference (branch / tag / commitID) that will be used to retrieve the data. If no value is provided the default branch of the repository is used. + */ + git_ref?: string +} + +export interface PathDetailsPathParams { + repo_ref: string +} + +export type PathDetailsProps = Omit< + MutateProps< + RepoPathsDetailsOutput, + UsererrorError, + PathDetailsQueryParams, + OpenapiPathsDetailsRequest, + PathDetailsPathParams + >, + 'path' | 'verb' +> & + PathDetailsPathParams + +export const PathDetails = ({ repo_ref, ...props }: PathDetailsProps) => ( + + verb="POST" + path={`/repos/${repo_ref}/path-details`} + base={getConfig('code')} + {...props} + /> +) + +export type UsePathDetailsProps = Omit< + UseMutateProps< + RepoPathsDetailsOutput, + UsererrorError, + PathDetailsQueryParams, + OpenapiPathsDetailsRequest, + PathDetailsPathParams + >, + 'path' | 'verb' +> & + PathDetailsPathParams + +export const usePathDetails = ({ repo_ref, ...props }: UsePathDetailsProps) => + useMutate< + RepoPathsDetailsOutput, + UsererrorError, + PathDetailsQueryParams, + OpenapiPathsDetailsRequest, + PathDetailsPathParams + >('POST', (paramsInPath: PathDetailsPathParams) => `/repos/${paramsInPath.repo_ref}/path-details`, { + base: getConfig('code'), + pathParams: { repo_ref }, + ...props + }) + export interface ListRepositoryPathsQueryParams { /** * The page to return. @@ -2988,6 +3436,103 @@ export type UseListLicensesProps = Omit useGet(`/resources/license`, { base: getConfig('code'), ...props }) +export type CreateSecretProps = Omit< + MutateProps, + 'path' | 'verb' +> + +export const CreateSecret = (props: CreateSecretProps) => ( + + verb="POST" + path={`/secrets`} + base={getConfig('code')} + {...props} + /> +) + +export type UseCreateSecretProps = Omit< + UseMutateProps, + 'path' | 'verb' +> + +export const useCreateSecret = (props: UseCreateSecretProps) => + useMutate('POST', `/secrets`, { + base: getConfig('code'), + ...props + }) + +export type DeleteSecretProps = Omit, 'path' | 'verb'> + +export const DeleteSecret = (props: DeleteSecretProps) => ( + + verb="DELETE" + path={`/secrets`} + base={getConfig('code')} + {...props} + /> +) + +export type UseDeleteSecretProps = Omit, 'path' | 'verb'> + +export const useDeleteSecret = (props: UseDeleteSecretProps) => + useMutate('DELETE', `/secrets`, { base: getConfig('code'), ...props }) + +export interface FindSecretPathParams { + secret_ref: string +} + +export type FindSecretProps = Omit, 'path'> & + FindSecretPathParams + +export const FindSecret = ({ secret_ref, ...props }: FindSecretProps) => ( + + path={`/secrets/${secret_ref}`} + base={getConfig('code')} + {...props} + /> +) + +export type UseFindSecretProps = Omit, 'path'> & + FindSecretPathParams + +export const useFindSecret = ({ secret_ref, ...props }: UseFindSecretProps) => + useGet( + (paramsInPath: FindSecretPathParams) => `/secrets/${paramsInPath.secret_ref}`, + { base: getConfig('code'), pathParams: { secret_ref }, ...props } + ) + +export interface UpdateSecretPathParams { + secret_ref: string +} + +export type UpdateSecretProps = Omit< + MutateProps, + 'path' | 'verb' +> & + UpdateSecretPathParams + +export const UpdateSecret = ({ secret_ref, ...props }: UpdateSecretProps) => ( + + verb="PATCH" + path={`/secrets/${secret_ref}`} + base={getConfig('code')} + {...props} + /> +) + +export type UseUpdateSecretProps = Omit< + UseMutateProps, + 'path' | 'verb' +> & + UpdateSecretPathParams + +export const useUpdateSecret = ({ secret_ref, ...props }: UseUpdateSecretProps) => + useMutate( + 'PATCH', + (paramsInPath: UpdateSecretPathParams) => `/secrets/${paramsInPath.secret_ref}`, + { base: getConfig('code'), pathParams: { secret_ref }, ...props } + ) + export type CreateSpaceProps = Omit< MutateProps, 'path' | 'verb' @@ -3381,6 +3926,51 @@ export const useDeletePath = ({ space_ref, ...props }: UseDeletePathProps) => { base: getConfig('code'), 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')} + {...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'), pathParams: { space_ref }, ...props } + ) + export interface ListReposQueryParams { /** * The substring which is used to filter the repositories by their path name. @@ -3434,6 +4024,51 @@ export const useListRepos = ({ space_ref, ...props }: UseListReposProps) => { base: getConfig('code'), pathParams: { space_ref }, ...props } ) +export interface ListSecretsQueryParams { + /** + * 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 ListSecretsPathParams { + space_ref: string +} + +export type ListSecretsProps = Omit< + GetProps, + 'path' +> & + ListSecretsPathParams + +export const ListSecrets = ({ space_ref, ...props }: ListSecretsProps) => ( + + path={`/spaces/${space_ref}/secrets`} + base={getConfig('code')} + {...props} + /> +) + +export type UseListSecretsProps = Omit< + UseGetProps, + 'path' +> & + ListSecretsPathParams + +export const useListSecrets = ({ space_ref, ...props }: UseListSecretsProps) => + useGet( + (paramsInPath: ListSecretsPathParams) => `/spaces/${paramsInPath.space_ref}/secrets`, + { base: getConfig('code'), pathParams: { space_ref }, ...props } + ) + export interface ListServiceAccountsPathParams { space_ref: string } diff --git a/web/src/services/code/swagger.yaml b/web/src/services/code/swagger.yaml index 8ebb5dc1e..043b98aa9 100644 --- a/web/src/services/code/swagger.yaml +++ b/web/src/services/code/swagger.yaml @@ -297,6 +297,431 @@ 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 + 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 + 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: pipeline_ref + 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: 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 /principals: get: operationId: listPrincipals @@ -1459,6 +1884,62 @@ paths: description: Internal Server Error tags: - repository + /repos/{repo_ref}/path-details: + post: + operationId: pathDetails + parameters: + - description: The git reference (branch / tag / commitID) that will be used + to retrieve the data. If no value is provided the default branch of the + repository is used. + in: query + name: git_ref + required: false + schema: + default: '{Repository Default Branch}' + type: string + - in: path + name: repo_ref + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OpenapiPathsDetailsRequest' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RepoPathsDetailsOutput' + 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: + - repository /repos/{repo_ref}/paths: get: operationId: listRepositoryPaths @@ -3398,6 +3879,178 @@ paths: description: Internal Server Error tags: - resource + /secrets: + post: + operationId: createSecret + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OpenapiCreateSecretRequest' + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/TypesSecret' + 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: + - secret + /secrets/{secret_ref}: + delete: + operationId: deleteSecret + parameters: + - in: path + name: secret_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: + - secret + get: + operationId: findSecret + parameters: + - in: path + name: secret_ref + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TypesSecret' + 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: + - secret + patch: + operationId: updateSecret + parameters: + - in: path + name: secret_ref + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OpenapiUpdateSecretRequest' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TypesSecret' + 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: + - secret /spaces: post: operationId: createSpace @@ -4002,6 +4655,74 @@ 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 @@ -4092,6 +4813,74 @@ paths: description: Internal Server Error tags: - space + /spaces/{space_ref}/secrets: + get: + operationId: listSecrets + 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/TypesSecret' + 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}/service-accounts: get: operationId: listServiceAccounts @@ -4401,6 +5190,13 @@ components: - merged - open type: string + EnumScmType: + enum: + - GITNESS + - GITHUB + - GITLAB + - UNKNOWN + type: string EnumTokenType: type: string EnumWebhookExecutionResult: @@ -4438,7 +5234,6 @@ components: type: array type: object GitrpcCommit: - nullable: true properties: author: $ref: '#/components/schemas/GitrpcSignature' @@ -4465,6 +5260,15 @@ components: name: type: string type: object + GitrpcPathDetails: + properties: + last_commit: + $ref: '#/components/schemas/GitrpcCommit' + path: + type: string + size: + type: integer + type: object GitrpcSignature: properties: identity: @@ -4587,11 +5391,33 @@ components: target: type: string type: object + OpenapiCreateExecutionRequest: + properties: + status: + type: string + type: object OpenapiCreatePathRequest: properties: path: type: string type: object + OpenapiCreatePipelineRequest: + properties: + config_path: + type: string + default_branch: + type: string + description: + type: string + repo_ref: + type: string + repo_type: + $ref: '#/components/schemas/EnumScmType' + space_ref: + type: string + uid: + type: string + type: object OpenapiCreatePullReqRequest: properties: description: @@ -4633,6 +5459,17 @@ components: uid: type: string type: object + OpenapiCreateSecretRequest: + properties: + data: + type: string + description: + type: string + space_ref: + type: string + uid: + type: string + type: object OpenapiCreateSpaceRequest: properties: description: @@ -4741,6 +5578,14 @@ components: nullable: true type: string type: object + OpenapiPathsDetailsRequest: + properties: + paths: + items: + type: string + nullable: true + type: array + type: object OpenapiRegisterRequest: properties: display_name: @@ -4780,6 +5625,20 @@ components: admin: type: boolean type: object + OpenapiUpdateExecutionRequest: + properties: + status: + type: string + type: object + OpenapiUpdatePipelineRequest: + properties: + config_path: + type: string + description: + type: string + uid: + type: string + type: object OpenapiUpdatePullReqRequest: properties: description: @@ -4796,6 +5655,15 @@ components: nullable: true type: boolean type: object + OpenapiUpdateSecretRequest: + properties: + data: + type: string + description: + type: string + uid: + type: string + type: object OpenapiUpdateSpaceRequest: properties: description: @@ -4961,6 +5829,14 @@ components: mergeable: type: boolean type: object + RepoPathsDetailsOutput: + properties: + details: + items: + $ref: '#/components/schemas/GitrpcPathDetails' + nullable: true + type: array + type: object RepoSubmoduleContent: properties: commit_sha: @@ -5047,6 +5923,79 @@ components: files_changed: type: integer type: object + TypesExecution: + properties: + action: + type: string + after: + type: string + author_avatar: + type: string + author_email: + type: string + author_login: + type: string + author_name: + type: string + before: + type: string + created: + type: integer + cron: + type: string + debug: + type: boolean + deploy_id: + type: integer + deploy_to: + type: string + error: + type: string + event: + type: string + finished: + type: integer + id: + type: integer + link: + type: string + message: + type: string + number: + type: integer + params: + type: string + parent: + type: integer + pipeline_id: + type: integer + ref: + type: string + repo_id: + type: integer + sender: + type: string + source: + type: string + source_repo: + type: string + started: + type: integer + status: + type: string + target: + type: string + timestamp: + type: integer + title: + type: string + trigger: + type: string + updated: + type: integer + version: + type: integer + type: object TypesIdentity: properties: email: @@ -5121,6 +6070,35 @@ components: value: type: string type: object + TypesPipeline: + properties: + config_path: + type: string + created: + type: integer + default_branch: + type: string + description: + type: string + id: + 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: + type: integer + version: + type: integer + type: object TypesPrincipalInfo: properties: created: @@ -5311,6 +6289,23 @@ components: updated: type: integer type: object + TypesSecret: + properties: + created: + type: integer + description: + type: string + id: + type: integer + space_id: + type: integer + uid: + type: string + updated: + type: integer + version: + type: integer + type: object TypesServiceAccount: properties: admin: