diff --git a/web/config/webpack.common.js b/web/config/webpack.common.js
index d3fba8a8b..6f14de945 100644
--- a/web/config/webpack.common.js
+++ b/web/config/webpack.common.js
@@ -30,6 +30,7 @@ const moduleFederationConfig = require('./moduleFederation.config')
const moduleFederationConfigCDE = require('./cde/moduleFederation.config')
const CONTEXT = process.cwd()
const DEV = process.env.NODE_ENV === 'development'
+const ENABLE_GITSPACE = process.env.ENABLE_GITSPACE === 'true'
const getModuleFields = () => {
if (process.env.MODULE === 'cde') {
@@ -223,7 +224,8 @@ module.exports = {
moduleFederationPlugin,
new DefinePlugin({
'process.env': '{}', // required for @blueprintjs/core
- __DEV__: DEV
+ __DEV__: DEV,
+ __ENABLE_GITSPACE__: ENABLE_GITSPACE
}),
new GenerateStringTypesPlugin(),
new RetryChunkLoadPlugin({
diff --git a/web/config/webpack.dev.js b/web/config/webpack.dev.js
index cd1a2c11b..27fb17e76 100644
--- a/web/config/webpack.dev.js
+++ b/web/config/webpack.dev.js
@@ -34,12 +34,13 @@ const API_URL = process.env.API_URL ?? 'http://localhost:3000'
const HOST = 'localhost'
const PORT = getPortByModule()
const STANDALONE = process.env.STANDALONE === 'true'
+const ENABLE_GITSPACE = process.env.ENABLE_GITSPACE === 'true'
const CONTEXT = process.cwd()
const prodConfig = require('./webpack.prod')
console.info(`Starting development build... http://${HOST}:${PORT}`)
console.info('Environment variables:')
-console.table({ STANDALONE, HOST, PORT, API_URL })
+console.table({ STANDALONE, ENABLE_GITSPACE, HOST, PORT, API_URL })
const devConfig = {
mode: 'development',
diff --git a/web/package.json b/web/package.json
index 7d470b875..38a8584ad 100644
--- a/web/package.json
+++ b/web/package.json
@@ -19,12 +19,12 @@
"webpack:cde": "NODE_ENV=development MODULE=cde webpack serve --config config/webpack.dev.js",
"typed-scss": "typed-scss-modules src --watch",
"dev": "run-p webpack typed-scss",
- "dev:cde": "MODULE=cde run-p webpack:cde typed-scss",
+ "dev:cde": "MODULE=cde ENABLE_GITSPACE=true run-p webpack:cde typed-scss",
"test": "jest src --silent",
"test:watch": "jest --watch",
"build": "rm -rf dist && webpack --config config/webpack.prod.js",
- "build:cde": "rm -rf dist && MODULE=cde webpack --config config/webpack.prod.js",
- "lint": "eslint --rulesdir ./scripts/eslint-rules --ext .ts --ext .tsx src",
+ "build:cde": "rm -rf dist && MODULE=cde ENABLE_GITSPACE=true webpack --config config/webpack.prod.js",
+ "lint": "eslint --fix --rulesdir ./scripts/eslint-rules --ext .ts --ext .tsx src",
"prettier": "prettier --check \"./src/**/*.{ts,tsx,css,scss}\"",
"coverage": "npm test --coverage",
"typecheck": "tsc",
@@ -47,7 +47,7 @@
"@codemirror/state": "^6.2.0",
"@codemirror/view": "^6.9.6",
"@harnessio/design-system": "^2.1.1",
- "@harnessio/icons": "^2.1.3",
+ "@harnessio/icons": "^2.1.5",
"@harnessio/uicore": "^4.1.2",
"@types/dompurify": "^3.0.2",
"@types/react-monaco-editor": "^0.16.0",
diff --git a/web/src/RouteDestinations.tsx b/web/src/RouteDestinations.tsx
index 57eac4cf6..ad5cf7228 100644
--- a/web/src/RouteDestinations.tsx
+++ b/web/src/RouteDestinations.tsx
@@ -51,7 +51,7 @@ import CodeSearchPage from 'pages/Search/CodeSearchPage'
import AddUpdatePipeline from 'pages/AddUpdatePipeline/AddUpdatePipeline'
import { useAppContext } from 'AppContext'
import PipelineSettings from 'components/PipelineSettings/PipelineSettings'
-import GitspaceDetail from 'cde/pages/GitspaceDetail/GitspaceDetail'
+import { GitspaceDetails } from 'cde-gitness/pages/GitspaceDetails/GitspaceDetails'
import { GitspaceListing } from 'cde-gitness/pages/GitspaceListing/GitspaceListing'
import { GitspaceCreate } from 'cde-gitness/pages/GitspaceCreate/GitspaceCreate'
@@ -283,7 +283,7 @@ export const RouteDestinations: React.FC = React.memo(function RouteDestinations
{standalone && (
-
+
)}
diff --git a/web/src/cde-gitness/assests/banner.svg b/web/src/cde-gitness/assests/banner.svg
new file mode 100644
index 000000000..54fd00d48
--- /dev/null
+++ b/web/src/cde-gitness/assests/banner.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/web/src/cde-gitness/assests/bannerLower.svg b/web/src/cde-gitness/assests/bannerLower.svg
new file mode 100644
index 000000000..845b45002
--- /dev/null
+++ b/web/src/cde-gitness/assests/bannerLower.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/web/src/cde-gitness/assests/delete.svg b/web/src/cde-gitness/assests/delete.svg
new file mode 100644
index 000000000..c75abe701
--- /dev/null
+++ b/web/src/cde-gitness/assests/delete.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/web/src/cde-gitness/components/GitnessRepoImportForm/gitness.svg b/web/src/cde-gitness/assests/gitness.svg
similarity index 100%
rename from web/src/cde-gitness/components/GitnessRepoImportForm/gitness.svg
rename to web/src/cde-gitness/assests/gitness.svg
diff --git a/web/src/cde-gitness/assests/gitspace.svg b/web/src/cde-gitness/assests/gitspace.svg
new file mode 100644
index 000000000..bcd220c72
--- /dev/null
+++ b/web/src/cde-gitness/assests/gitspace.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/web/src/cde-gitness/assests/home.svg b/web/src/cde-gitness/assests/home.svg
new file mode 100644
index 000000000..483b1a739
--- /dev/null
+++ b/web/src/cde-gitness/assests/home.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/web/src/cde-gitness/assests/noRepo.svg b/web/src/cde-gitness/assests/noRepo.svg
new file mode 100644
index 000000000..cc9e134ac
--- /dev/null
+++ b/web/src/cde-gitness/assests/noRepo.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/web/src/cde-gitness/assests/pause.svg b/web/src/cde-gitness/assests/pause.svg
new file mode 100644
index 000000000..3f934e761
--- /dev/null
+++ b/web/src/cde-gitness/assests/pause.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/web/src/cde-gitness/assests/textLeft.svg b/web/src/cde-gitness/assests/textLeft.svg
new file mode 100644
index 000000000..011d1307b
--- /dev/null
+++ b/web/src/cde-gitness/assests/textLeft.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/web/src/cde-gitness/assests/web.svg b/web/src/cde-gitness/assests/web.svg
new file mode 100644
index 000000000..6ef4455ab
--- /dev/null
+++ b/web/src/cde-gitness/assests/web.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/web/src/cde-gitness/components/ContainerLogs/ContainerLogs.module.scss b/web/src/cde-gitness/components/ContainerLogs/ContainerLogs.module.scss
new file mode 100644
index 000000000..4960a9395
--- /dev/null
+++ b/web/src/cde-gitness/components/ContainerLogs/ContainerLogs.module.scss
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2023 Harness, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+@import 'src/utils/utils';
+
+.consoleContainer {
+ min-height: 500px !important;
+ max-height: 70vh !important;
+ overflow: scroll;
+ align-items: start !important;
+ padding-top: var(--spacing-large) !important;
+ padding-left: var(--spacing-xlarge) !important;
+ background-color: var(--black) !important;
+ color: var(--white) !important;
+ pre {
+ background-color: var(--black) !important;
+ color: var(--white) !important;
+ text-align: start !important;
+ font-size: 12px;
+ font-family: var(--font-family-mono) !important;
+ }
+}
+
+.logTitle {
+ color: var(--white) !important;
+ background: var(--black) !important;
+ border-top-left-radius: 50px;
+ border-top-right-radius: 50px;
+ padding-top: var(--spacing-medium) !important;
+ text-align: left;
+ padding-left: var(--spacing-xxlarge) !important;
+ padding-bottom: var(--spacing-large) !important;
+ font-size: 16px !important;
+}
+
+.mainLog {
+ flex-shrink: 0;
+
+ .line {
+ margin: 0;
+ padding: 0;
+ cursor: text;
+ min-height: 20px;
+ display: block;
+
+ @include mono-font;
+ color: var(--white);
+
+ word-wrap: break-word !important;
+ white-space: pre-wrap !important;
+ }
+}
+
+.stepLogContainer {
+ padding: var(--spacing-small) !important;
+ flex-shrink: 0;
+
+ .consoleLine {
+ color: var(--white);
+
+ @include mono-font;
+
+ word-wrap: break-word !important;
+ white-space: pre-wrap !important;
+ cursor: text;
+ margin: 0;
+ padding: 0;
+
+ &:empty {
+ display: inline-block;
+ min-height: 20px;
+ }
+ }
+}
+
+.logContainer {
+ width: 60%;
+ max-width: 800px !important;
+}
diff --git a/web/src/cde-gitness/components/ContainerLogs/ContainerLogs.module.scss.d.ts b/web/src/cde-gitness/components/ContainerLogs/ContainerLogs.module.scss.d.ts
new file mode 100644
index 000000000..0e2cecda3
--- /dev/null
+++ b/web/src/cde-gitness/components/ContainerLogs/ContainerLogs.module.scss.d.ts
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2023 Harness, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* eslint-disable */
+// This is an auto-generated file
+export declare const consoleContainer: string
+export declare const consoleLine: string
+export declare const line: string
+export declare const logContainer: string
+export declare const logTitle: string
+export declare const mainLog: string
+export declare const stepLogContainer: string
diff --git a/web/src/cde-gitness/components/ContainerLogs/ContainerLogs.tsx b/web/src/cde-gitness/components/ContainerLogs/ContainerLogs.tsx
new file mode 100644
index 000000000..d9d13b2d8
--- /dev/null
+++ b/web/src/cde-gitness/components/ContainerLogs/ContainerLogs.tsx
@@ -0,0 +1,52 @@
+import { Container } from '@harnessio/uicore'
+import cx from 'classnames'
+import React, { useEffect, useRef } from 'react'
+import { lineElement } from 'components/LogViewer/LogViewer'
+import type { LogData } from '../../hooks/useGetLogStream'
+import css from './ContainerLogs.module.scss'
+
+const ContainerLogs = ({ data }: { data: LogData[] }) => {
+ const localRef = useRef()
+
+ useEffect(() => {
+ try {
+ if (data) {
+ const fragment = new DocumentFragment()
+ const logContainer = localRef.current as HTMLDivElement
+ // Clear the container first
+ if (localRef.current) {
+ localRef.current.innerHTML = ''
+ }
+ if (data) {
+ data?.forEach((line: any) => {
+ const linePos = line.pos + 1
+ const localDate = new Date(line.time)
+ // Format date to a more readable format (local time)
+ const formattedDate = localDate.toLocaleString()
+ fragment.appendChild(lineElement(`${linePos} ${formattedDate.replace(',', '')} ${line.out}`))
+ })
+
+ logContainer.appendChild(fragment)
+ }
+
+ const scrollParent = logContainer.parentElement as HTMLDivElement
+ const autoScroll =
+ scrollParent && scrollParent.scrollTop === scrollParent.scrollHeight - scrollParent.offsetHeight
+
+ if (autoScroll || scrollParent.scrollTop === 0) {
+ scrollParent.scrollTop = scrollParent.scrollHeight
+ }
+ }
+ } catch (_err) {
+ //
+ }
+ }, [data])
+
+ return (
+
+
+
+ )
+}
+
+export default ContainerLogs
diff --git a/web/src/cde-gitness/components/DetailsCard/DetailsCard.tsx b/web/src/cde-gitness/components/DetailsCard/DetailsCard.tsx
new file mode 100644
index 000000000..76e54e9ec
--- /dev/null
+++ b/web/src/cde-gitness/components/DetailsCard/DetailsCard.tsx
@@ -0,0 +1,89 @@
+import { Color } from '@harnessio/design-system'
+import { Layout, Text } from '@harnessio/uicore'
+import React from 'react'
+import ReactTimeago from 'react-timeago'
+import { Circle } from 'iconoir-react'
+import type { IconName } from '@harnessio/icons'
+import { useStrings } from 'framework/strings'
+import { getIconByRepoType } from 'cde/components/CreateGitspace/components/SelectRepository/SelectRepository.utils'
+import type { TypesGitspaceConfig } from 'cde-gitness/services'
+import { GitspaceStatus } from 'cde/constants'
+import { getStatusColor, getStatusText } from '../GitspaceListing/ListGitspaces'
+
+export const DetailsCard = ({ data }: { data: TypesGitspaceConfig | null; loading?: boolean }) => {
+ const { getString } = useStrings()
+ const { branch, state, name, code_repo_url, code_repo_type, instance } = data || {}
+ const color = getStatusColor(state)
+ const customProps =
+ state === GitspaceStatus.STARTING
+ ? {
+ icon: 'loading' as IconName,
+ iconProps: { color: Color.PRIMARY_4 }
+ }
+ : { icon: undefined }
+ return (
+ <>
+
+
+ {getString('cde.status')}
+
+ {state !== GitspaceStatus.STARTING && }
+
+ {getStatusText(getString, state)}
+
+
+
+
+
+ {getString('cde.repository.repo')}
+ {
+ e.preventDefault()
+ e.stopPropagation()
+ }}>
+ {getIconByRepoType({ repoType: code_repo_type, height: 20 })}
+ window.open(code_repo_url, '_blank')}>
+ {name}
+
+
+
+
+
+ {getString('branch')}
+ window.open(code_repo_url, '_blank')}>
+ {branch}
+
+
+
+
+ {getString('cde.lastUsed')}
+ {instance?.last_used ? (
+
+ ) : (
+ {getString('cde.na')}
+ )}
+
+
+ >
+ )
+}
diff --git a/web/src/cde-gitness/components/EventTimeline/EventTimeline.module.scss b/web/src/cde-gitness/components/EventTimeline/EventTimeline.module.scss
new file mode 100644
index 000000000..144159ae7
--- /dev/null
+++ b/web/src/cde-gitness/components/EventTimeline/EventTimeline.module.scss
@@ -0,0 +1,23 @@
+.marker {
+ align-self: center;
+ position: relative;
+ left: 5.5px;
+ height: 12px;
+ width: 12px;
+ background: var(--grey-400) !important;
+ border-radius: 6px;
+ padding: 2px;
+ border: 2px solid #fff;
+}
+
+.main {
+ overflow: scroll;
+ max-height: 350px;
+}
+
+.lightBackground {
+ background: #dee8f9 !important;
+}
+.darkBackground {
+ background: #bbd1f6 !important;
+}
diff --git a/web/src/cde-gitness/components/EventTimeline/EventTimeline.module.scss.d.ts b/web/src/cde-gitness/components/EventTimeline/EventTimeline.module.scss.d.ts
new file mode 100644
index 000000000..fc4dcd62e
--- /dev/null
+++ b/web/src/cde-gitness/components/EventTimeline/EventTimeline.module.scss.d.ts
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2023 Harness, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* eslint-disable */
+// This is an auto-generated file
+export declare const darkBackground: string
+export declare const lightBackground: string
+export declare const main: string
+export declare const marker: string
diff --git a/web/src/cde-gitness/components/EventTimeline/EventTimeline.tsx b/web/src/cde-gitness/components/EventTimeline/EventTimeline.tsx
new file mode 100644
index 000000000..cf29db3f1
--- /dev/null
+++ b/web/src/cde-gitness/components/EventTimeline/EventTimeline.tsx
@@ -0,0 +1,80 @@
+import React, { useEffect, useRef, useState } from 'react'
+import { Color } from '@harnessio/design-system'
+import { Container, Text, Layout } from '@harnessio/uicore'
+import { isArray, isEqual } from 'lodash-es'
+import type { TypesGitspaceEventResponse } from 'cde-gitness/services'
+import { useStrings } from 'framework/strings'
+import { formatTimestamp } from './EventTimeline.utils'
+import css from './EventTimeline.module.scss'
+
+const EventTimeline = ({ data }: { data?: TypesGitspaceEventResponse[] | null; polling?: boolean }) => {
+ const localRef = useRef(null)
+ const scrollContainerRef = useRef(null)
+
+ const { getString } = useStrings()
+ const [cache, setCache] = useState(data)
+
+ useEffect(() => {
+ if (!isEqual(data, cache)) {
+ setCache(data)
+ }
+ }, [data])
+
+ useEffect(() => {
+ if (scrollContainerRef.current) {
+ const scrollParent = scrollContainerRef.current
+
+ const autoScroll = scrollParent.scrollTop <= scrollParent.scrollHeight - scrollParent.clientHeight
+
+ if (autoScroll || scrollParent.scrollTop === 0) {
+ scrollParent.scrollTop = scrollParent.scrollHeight
+ }
+ }
+ }, [cache])
+
+ return (
+
+ {!data?.length && isArray(data) && (
+
+
+ {getString('cde.details.fetchingDetails')}
+
+
+ )}
+
+ {data?.map((item, index) => {
+ return (
+
+
+ {formatTimestamp(item.timestamp || 0)}
+
+
+
+
+ {`${item.message}`}
+
+
+
+ )
+ })}
+
+
+ )
+}
+
+export default EventTimeline
diff --git a/web/src/cde-gitness/components/EventTimeline/EventTimeline.utils.tsx b/web/src/cde-gitness/components/EventTimeline/EventTimeline.utils.tsx
new file mode 100644
index 000000000..54107519c
--- /dev/null
+++ b/web/src/cde-gitness/components/EventTimeline/EventTimeline.utils.tsx
@@ -0,0 +1,28 @@
+import React from 'react'
+import moment from 'moment'
+import { Text, Layout } from '@harnessio/uicore'
+import { Color } from '@harnessio/design-system'
+
+export const formatTimestamp = (timestamp: number) => {
+ const inputDate = moment(timestamp)
+ const currentDate = moment()
+
+ if (inputDate.isSame(currentDate, 'day')) {
+ return (
+
+ {inputDate.format('HH:mm:ss')}
+
+ )
+ } else {
+ return (
+
+
+ {inputDate.format('YYYY-MM-DD')}
+
+
+ {inputDate.format('HH:mm:ss')}
+
+
+ )
+ }
+}
diff --git a/web/src/cde-gitness/components/EventTimelineAccordion/EventTimelineAccordion.tsx b/web/src/cde-gitness/components/EventTimelineAccordion/EventTimelineAccordion.tsx
new file mode 100644
index 000000000..c4954c381
--- /dev/null
+++ b/web/src/cde-gitness/components/EventTimelineAccordion/EventTimelineAccordion.tsx
@@ -0,0 +1,25 @@
+import React from 'react'
+import { defaultTo } from 'lodash-es'
+import { Accordion } from '@harnessio/uicore'
+import type { TypesGitspaceEventResponse } from 'cde-gitness/services'
+import EventTimelineSummary from '../EventTimelineSummary/EventTimelineSummary'
+import EventTimeline from '../EventTimeline/EventTimeline'
+import parentCss from 'cde-gitness/pages/GitspaceDetails/GitspaceDetails.module.scss'
+
+const EventTimelineAccordion = ({ data }: { data: TypesGitspaceEventResponse[] | null; polling?: boolean }) => {
+ const sortedData = data?.sort((a, b) => defaultTo(a?.timestamp, 0) - defaultTo(b?.timestamp, 0))
+ const latestEvent = sortedData?.[sortedData?.length - 1] || { message: '', timestamp: 0 }
+ return (
+
+ }
+ summary={}
+ className={parentCss.accordionnCustomSummary}
+ />
+
+ )
+}
+
+export default EventTimelineAccordion
diff --git a/web/src/cde-gitness/components/EventTimelineSummary/EventTimelineSummary.tsx b/web/src/cde-gitness/components/EventTimelineSummary/EventTimelineSummary.tsx
new file mode 100644
index 000000000..3b74d86d6
--- /dev/null
+++ b/web/src/cde-gitness/components/EventTimelineSummary/EventTimelineSummary.tsx
@@ -0,0 +1,28 @@
+import React from 'react'
+import moment from 'moment'
+import { Container, Text, Layout } from '@harnessio/uicore'
+import { Color, FontVariation } from '@harnessio/design-system'
+import { useStrings } from 'framework/strings'
+
+const EventTimelineSummary = ({ timestamp, message }: { timestamp?: number; message?: string }) => {
+ const { getString } = useStrings()
+ return (
+
+
+ {getString('cde.details.gitspaceActivity')}
+
+ {Boolean(message) && (
+
+
+ {message}
+
+
+ {moment(timestamp).format('DD MMM, YYYY hh:mma')}
+
+
+ )}
+
+ )
+}
+
+export default EventTimelineSummary
diff --git a/web/src/cde-gitness/components/GitnessRepoImportForm/GitnessRepoImportForm.module.scss b/web/src/cde-gitness/components/GitnessRepoImportForm/GitnessRepoImportForm.module.scss
index 86a082562..7e4395073 100644
--- a/web/src/cde-gitness/components/GitnessRepoImportForm/GitnessRepoImportForm.module.scss
+++ b/web/src/cde-gitness/components/GitnessRepoImportForm/GitnessRepoImportForm.module.scss
@@ -1,3 +1,8 @@
.repoAndBranch {
margin-bottom: 0 !important;
}
+
+.noReposContainer {
+ padding: var(--spacing-large) !important;
+ background-color: var(--grey-50) !important;
+}
diff --git a/web/src/cde-gitness/components/GitnessRepoImportForm/GitnessRepoImportForm.module.scss.d.ts b/web/src/cde-gitness/components/GitnessRepoImportForm/GitnessRepoImportForm.module.scss.d.ts
index ebc423548..9836ccf91 100644
--- a/web/src/cde-gitness/components/GitnessRepoImportForm/GitnessRepoImportForm.module.scss.d.ts
+++ b/web/src/cde-gitness/components/GitnessRepoImportForm/GitnessRepoImportForm.module.scss.d.ts
@@ -16,4 +16,5 @@
/* eslint-disable */
// This is an auto-generated file
+export declare const noReposContainer: string
export declare const repoAndBranch: string
diff --git a/web/src/cde-gitness/components/GitnessRepoImportForm/GitnessRepoImportForm.tsx b/web/src/cde-gitness/components/GitnessRepoImportForm/GitnessRepoImportForm.tsx
index 705fa5238..df206cb2e 100644
--- a/web/src/cde-gitness/components/GitnessRepoImportForm/GitnessRepoImportForm.tsx
+++ b/web/src/cde-gitness/components/GitnessRepoImportForm/GitnessRepoImportForm.tsx
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react'
import { useGet } from 'restful-react'
-import { Container, ExpandingSearchInput, Layout, Text } from '@harnessio/uicore'
+import { Button, ButtonVariation, Container, ExpandingSearchInput, Layout, Text } from '@harnessio/uicore'
import { Menu, MenuItem } from '@blueprintjs/core'
import { Color } from '@harnessio/design-system'
import { Icon } from '@harnessio/icons'
@@ -10,8 +10,10 @@ import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
import { String, useStrings } from 'framework/strings'
import { LIST_FETCHING_LIMIT } from 'utils/Utils'
import NewRepoModalButton from 'components/NewRepoModalButton/NewRepoModalButton'
+import noRepo from 'cde-gitness/assests/noRepo.svg?url'
+import { RepoCreationType } from 'utils/GitUtils'
+import gitnessRepoLogo from 'cde-gitness/assests/gitness.svg?url'
import { GitspaceSelect } from '../../../cde/components/GitspaceSelect/GitspaceSelect'
-import gitnessRepoLogo from './gitness.svg?url'
import css from './GitnessRepoImportForm.module.scss'
const RepositoryText = ({ repoList, value }: { repoList: TypesRepository[] | null; value?: string }) => {
@@ -64,6 +66,7 @@ export const GitnessRepoImportForm = () => {
const space = useGetSpaceParam()
const [branchSearch, setBranchSearch] = useState('')
const [repoSearch, setRepoSearch] = useState('')
+ const [hadReops, setHadRepos] = useState(false)
const [repoRef, setReporef] = useState('')
const {
@@ -76,6 +79,12 @@ export const GitnessRepoImportForm = () => {
debounce: 500
})
+ useEffect(() => {
+ if (!hadReops && repositories?.length) {
+ setHadRepos(true)
+ }
+ }, [repositories])
+
const {
data: branches,
refetch,
@@ -100,6 +109,7 @@ export const GitnessRepoImportForm = () => {
}, [repoRef, branchSearch])
const repoListOptions = repositories || []
+ const hideInitialMenu = Boolean(repoSearch) || Boolean(repositories)
const formik = useFormikContext()
@@ -124,15 +134,17 @@ export const GitnessRepoImportForm = () => {
}}
renderMenu={
}
diff --git a/web/src/cde-gitness/components/GitspaceListing/ListGitspaces.module.scss b/web/src/cde-gitness/components/GitspaceListing/ListGitspaces.module.scss
index 5f4c5b721..13963188d 100644
--- a/web/src/cde-gitness/components/GitspaceListing/ListGitspaces.module.scss
+++ b/web/src/cde-gitness/components/GitspaceListing/ListGitspaces.module.scss
@@ -34,6 +34,7 @@
}
.listContainer {
+ border-radius: 20px !important;
:global {
a.bp3-menu-item:hover,
.bp3-active {
@@ -52,4 +53,18 @@
.repositoryCell {
width: fit-content !important;
+ margin-right: var(--spacing-xxlarge) !important;
+}
+
+.stopModal {
+ width: 650px !important;
+ [class*='ConfirmationDialog--body'] {
+ margin-bottom: 0px !important;
+ }
+ span[data-icon='info-messaging'] {
+ display: none;
+ }
+ svg {
+ fill: #004ba4;
+ }
}
diff --git a/web/src/cde-gitness/components/GitspaceListing/ListGitspaces.module.scss.d.ts b/web/src/cde-gitness/components/GitspaceListing/ListGitspaces.module.scss.d.ts
index 7b5539a28..b3004fd2b 100644
--- a/web/src/cde-gitness/components/GitspaceListing/ListGitspaces.module.scss.d.ts
+++ b/web/src/cde-gitness/components/GitspaceListing/ListGitspaces.module.scss.d.ts
@@ -20,4 +20,5 @@ export declare const gitspaceUrl: string
export declare const listContainer: string
export declare const popover: string
export declare const repositoryCell: string
+export declare const stopModal: string
export declare const table: string
diff --git a/web/src/cde-gitness/components/GitspaceListing/ListGitspaces.tsx b/web/src/cde-gitness/components/GitspaceListing/ListGitspaces.tsx
index 9f14e7509..ebb0e331c 100644
--- a/web/src/cde-gitness/components/GitspaceListing/ListGitspaces.tsx
+++ b/web/src/cde-gitness/components/GitspaceListing/ListGitspaces.tsx
@@ -14,45 +14,55 @@
* limitations under the License.
*/
-import { Container, Layout, TableV2, Text, useToaster } from '@harnessio/uicore'
-import React from 'react'
+import {
+ ConfirmationDialog,
+ Container,
+ Layout,
+ TableV2,
+ Text,
+ useToaster,
+ Button,
+ ButtonVariation
+} from '@harnessio/uicore'
+import React, { useEffect, useState } from 'react'
import { Color } from '@harnessio/design-system'
import type { Renderer, CellProps } from 'react-table'
import ReactTimeago from 'react-timeago'
import {
Circle,
- GitBranch,
Cpu,
Clock,
Play,
- Square,
Db,
ModernTv,
- OpenInBrowser,
- DeleteCircle,
- EditPencil,
- ViewColumns2,
GithubCircle,
GitLabFull,
Code,
Bitbucket as BitbucketIcon
} from 'iconoir-react'
-import { Menu, MenuItem, PopoverInteractionKind, Position } from '@blueprintjs/core'
+import { Intent, Menu, MenuItem, PopoverInteractionKind, Position } from '@blueprintjs/core'
import { useHistory } from 'react-router-dom'
import { isNil } from 'lodash-es'
+import { useMutate } from 'restful-react'
+import type { IconName } from '@harnessio/icons'
import { UseStringsReturn, useStrings } from 'framework/strings'
import { useAppContext } from 'AppContext'
import { getErrorMessage } from 'utils/Utils'
import { useConfirmAct } from 'hooks/useConfirmAction'
import VSCode from 'cde/icons/VSCode.svg?url'
-import { GitspaceStatus } from 'cde/constants'
-import {
+import { GitspaceActionType, GitspaceStatus } from 'cde/constants'
+import type {
EnumGitspaceStateType,
EnumIDEType,
- useDeleteGitspace,
- type TypesGitspaceConfig,
- type EnumCodeRepoType
+ TypesGitspaceConfig,
+ EnumGitspaceCodeRepoType
} from 'cde-gitness/services'
+import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
+import gitspaceIcon from 'cde-gitness/assests/gitspace.svg?url'
+import { useModalHook } from 'hooks/useModalHook'
+import pause from 'cde-gitness/assests/pause.svg?url'
+import web from 'cde-gitness/assests/web.svg?url'
+import deleteIcon from 'cde-gitness/assests/delete.svg?url'
import css from './ListGitspaces.module.scss'
enum CodeRepoType {
@@ -63,18 +73,18 @@ enum CodeRepoType {
Unknown = 'unknown'
}
-const getIconByRepoType = ({ repoType }: { repoType?: EnumCodeRepoType }): React.ReactNode => {
+const getIconByRepoType = ({ repoType }: { repoType?: EnumGitspaceCodeRepoType }): React.ReactNode => {
switch (repoType) {
case CodeRepoType.Github:
- return
+ return
case CodeRepoType.Gitlab:
- return
+ return
case CodeRepoType.Bitbucket:
- return
+ return
default:
case CodeRepoType.Unknown:
case CodeRepoType.HarnessCode:
- return
+ return
}
}
@@ -82,8 +92,11 @@ export const getStatusColor = (status?: EnumGitspaceStateType) => {
switch (status) {
case GitspaceStatus.RUNNING:
return '#42AB45'
+ case GitspaceStatus.STOPPING:
+ return '#FF832B'
case GitspaceStatus.STOPPED:
- return '#F3F3FA'
+ case GitspaceStatus.UNINITIALIZED:
+ return '#D0D0D9'
case GitspaceStatus.ERROR:
return '#FF0000'
default:
@@ -99,6 +112,10 @@ export const getStatusText = (getString: UseStringsReturn['getString'], status?:
return getString('cde.listing.offline')
case GitspaceStatus.ERROR:
return getString('cde.listing.error')
+ case GitspaceStatus.STARTING:
+ return getString('cde.listing.starting')
+ case GitspaceStatus.STOPPING:
+ return getString('cde.listing.stopping')
default:
return getString('cde.listing.offline')
}
@@ -148,7 +165,7 @@ export const RenderRepository: Renderer> = ({ row
const { name, branch, code_repo_url, code_repo_type, instance } = details || {}
return (
-
+
> = ({ row
e.stopPropagation()
window.open(code_repo_url, '_blank')
}}>
- {getIconByRepoType({ repoType: code_repo_type })}
-
+
+ {getIconByRepoType({ repoType: code_repo_type })}
+
+
{name}
:
-
-
+
{branch}
@@ -182,7 +206,7 @@ export const RenderCPUUsage: Renderer> = ({ row }
const instance = row.original.instance
const { resource_usage, total_time_used } = instance || {}
- return getUsageTemplate(getString, , resource_usage, total_time_used)
+ return getUsageTemplate(getString, , resource_usage as string, total_time_used)
}
export const RenderStorageUsage: Renderer> = ({ row }) => {
@@ -190,7 +214,7 @@ export const RenderStorageUsage: Renderer> = ({ r
const instance = row.original.instance
const { resource_usage, total_time_used } = instance || {}
- return getUsageTemplate(getString, , resource_usage, total_time_used)
+ return getUsageTemplate(getString, , resource_usage as string, total_time_used)
}
export const RenderLastActivity: Renderer> = ({ row }) => {
@@ -214,13 +238,23 @@ export const RenderLastActivity: Renderer> = ({ r
export const RenderGitspaceStatus: Renderer> = ({ row }) => {
const { getString } = useStrings()
const details = row.original
- const { instance, name } = details
- const { state } = instance || {}
+ const { name, state } = details
const color = getStatusColor(state)
+ const customProps =
+ state === GitspaceStatus.STARTING
+ ? {
+ icon: 'loading' as IconName,
+ iconProps: { color: Color.PRIMARY_4 }
+ }
+ : { icon: undefined }
return (
-
-
+ {state !== GitspaceStatus.STARTING && }
+
{getStatusText(getString, state)}
@@ -231,10 +265,14 @@ export const StartStopButton = ({ state, loading }: { state?: EnumGitspaceStateT
const { getString } = useStrings()
return (
- {loading ? <>> : state === GitspaceStatus.RUNNING ? : }
+ {loading ? <>> : state === GitspaceStatus.RUNNING ?
: }
{state === GitspaceStatus.RUNNING
- ? getString('cde.details.stopGitspace')
+ ? loading
+ ? getString('cde.stopingGitspace')
+ : getString('cde.details.stopGitspace')
+ : loading
+ ? getString('cde.startingGitspace')
: getString('cde.details.startGitspace')}
@@ -246,7 +284,7 @@ export const OpenGitspaceButton = ({ ide }: { ide?: EnumIDEType }) => {
return (
- {ide === IDEType.VSCODE ? : }
+ {ide === IDEType.VSCODE ? :
}
{ide === IDEType.VSCODE ? getString('cde.ide.openVSCode') : getString('cde.ide.openBrowser')}
)
@@ -254,8 +292,8 @@ export const OpenGitspaceButton = ({ ide }: { ide?: EnumIDEType }) => {
interface ActionMenuProps {
data: TypesGitspaceConfig
- refreshList: () => void
- handleStartStop?: () => Promise
+ handleStartGitspace?: () => void
+ handleStopGitspace?: () => void
loading?: boolean
actionLoading?: boolean
deleteLoading?: boolean
@@ -265,19 +303,21 @@ interface ActionMenuProps {
const ActionMenu = ({
data,
deleteGitspace,
- refreshList,
- handleStartStop,
+ handleStartGitspace,
+ handleStopGitspace,
actionLoading,
deleteLoading
}: ActionMenuProps) => {
const { getString } = useStrings()
const { showError } = useToaster()
- const { instance, ide } = data
- const { id, state, url = ' ' } = instance || {}
+ const { instance, ide, identifier = '', space_path = '', state } = data
+ const { identifier: id, url = '' } = instance || {}
const history = useHistory()
const { routes } = useAppContext()
const pathparamsList = instance?.space_path?.split('/') || []
const projectIdentifier = pathparamsList[pathparamsList.length - 1] || ''
+ const topBorder = state === GitspaceStatus.RUNNING && !actionLoading ? { top: true } : {}
+ const disabledActionButtons = [GitspaceStatus.STARTING, GitspaceStatus.STOPPING].includes(state as GitspaceStatus)
return (
+ }
+ contentText={
+
+
+ By clicking on “Stop Gitspace”, the gitspace will start de-provisioning.
+
+
+
+
+
+
+
+
+
+ }
+ onClose={hideModal}
+ />
+ )
+ }, [details, actionGitspace, history, routes])
+
+ const [handleStartGitspace, hideStartModal] = useModalHook(() => {
+ return (
+
+
+ {`Do you want to start the Gitspace “${name}” ?`}
+
+ }
+ contentText={
+
+
+ By clicking on “Start Gitspace”, the gitspace will start provisioning.
+
+
+
+
+
+
+
+
+
+ }
+ onClose={hideStartModal}
+ />
+ )
+ }, [details, actionGitspace, history, routes])
const confirmDelete = useConfirmAct()
@@ -405,7 +545,7 @@ export const RenderActions = ({ row, refreshList }: RenderActionsProps) => {
try {
e.preventDefault()
e.stopPropagation()
- await deleteGitspace(instance?.id || '')
+ await deleteGitspace({})
showSuccess(getString('cde.deleteSuccess'))
await refreshList()
} catch (exception) {
@@ -426,10 +566,11 @@ export const RenderActions = ({ row, refreshList }: RenderActionsProps) => {
tooltip={
}
tooltipProps={{
@@ -447,6 +588,77 @@ export const ListGitspaces = ({ data, refreshList }: { data: TypesGitspaceConfig
const { getString } = useStrings()
const { routes } = useAppContext()
+ const [currentRow, setCurrentRow] = useState()
+
+ const [handleStartGitspace, hideStartModal] = useModalHook(() => {
+ return (
+ setCurrentRow(undefined)}
+ titleText={
+
+
+ {`Do you want to start the Gitspace “${currentRow?.name}” ?`}
+
+ }
+ contentText={
+
+
+ By clicking on “Start Gitspace”, the gitspace will start provisioning.
+
+
+
+
+
+
+
+
+
+ }
+ onClose={hideStartModal}
+ />
+ )
+ }, [currentRow, history, routes])
+
+ useEffect(() => {
+ if (currentRow) {
+ setTimeout(() => {
+ handleStartGitspace()
+ }, 100)
+ }
+ }, [currentRow])
+
return (
{data && (
@@ -456,17 +668,22 @@ export const ListGitspaces = ({ data, refreshList }: { data: TypesGitspaceConfig
const pathparamsList = row?.instance?.space_path?.split('/') || []
const projectIdentifier = pathparamsList[pathparamsList.length - 1] || ''
- if (row?.instance?.state === GitspaceStatus.RUNNING) {
+ if (row?.state === GitspaceStatus.RUNNING) {
if (row?.ide === IDEType.VSCODE) {
- window.open(`vscode://harness-inc.gitspaces/${projectIdentifier}/${row?.instance?.id}`, '_blank')
+ window.open(
+ `vscode://harness-inc.gitspaces/${projectIdentifier}/${row?.instance?.identifier}`,
+ '_blank'
+ )
} else {
- window.open(row?.instance.url, '_blank')
+ window.open(row?.instance?.url || '', '_blank')
}
+ } else if (row?.state === GitspaceStatus.STOPPED) {
+ setCurrentRow(row)
} else {
history.push(
routes.toCDEGitspaceDetail({
- space: row?.instance?.space_path as string,
- gitspaceId: row?.instance?.id as string
+ space: row?.space_path as string,
+ gitspaceId: row?.identifier as string
})
)
}
@@ -489,7 +706,7 @@ export const ListGitspaces = ({ data, refreshList }: { data: TypesGitspaceConfig
},
{
id: 'lastactivity',
- Header: getString('cde.sessionDuration'),
+ Header: getString('cde.lastActivated'),
Cell: RenderLastActivity
},
{
diff --git a/web/src/cde-gitness/components/ThirdPartyRepoImportForm/ThirdPartyRepoImportForm.module.scss b/web/src/cde-gitness/components/ThirdPartyRepoImportForm/ThirdPartyRepoImportForm.module.scss
index f1b5d8534..1d64a6ebc 100644
--- a/web/src/cde-gitness/components/ThirdPartyRepoImportForm/ThirdPartyRepoImportForm.module.scss
+++ b/web/src/cde-gitness/components/ThirdPartyRepoImportForm/ThirdPartyRepoImportForm.module.scss
@@ -1,12 +1,37 @@
-.hideContainer {
- :global {
- --bp3-intent-color: unset !important;
- .bp3-form-helper-text {
- margin-top: unset !important;
- }
+.formFields {
+ [class*='repoInput'],
+ [class*='branchDropdown'] {
+ width: 100% !important;
}
}
-.repoAndBranch {
- width: 47% !important;
+.importForm {
+ cursor: pointer;
+ display: contents;
+ font-size: var(--font-size-small) !important;
+}
+
+.repoInput {
+ span[icon='git-repo'],
+ span[icon='git-branch'] {
+ top: 20%;
+ left: 2% !important;
+ color: var(--grey-500) !important;
+ }
+
+ input {
+ height: 50px !important;
+ border-radius: 7px !important;
+ border: 1px solid var(--grey-200) !important;
+ box-shadow: none !important;
+ background: var(--grey-100);
+ padding-left: 10% !important;
+
+ &:active {
+ background: white;
+ }
+ &:focus {
+ background: white;
+ }
+ }
}
diff --git a/web/src/cde-gitness/components/ThirdPartyRepoImportForm/ThirdPartyRepoImportForm.module.scss.d.ts b/web/src/cde-gitness/components/ThirdPartyRepoImportForm/ThirdPartyRepoImportForm.module.scss.d.ts
index ea39a05c1..dcec826a4 100644
--- a/web/src/cde-gitness/components/ThirdPartyRepoImportForm/ThirdPartyRepoImportForm.module.scss.d.ts
+++ b/web/src/cde-gitness/components/ThirdPartyRepoImportForm/ThirdPartyRepoImportForm.module.scss.d.ts
@@ -16,5 +16,6 @@
/* eslint-disable */
// This is an auto-generated file
-export declare const hideContainer: string
-export declare const repoAndBranch: string
+export declare const formFields: string
+export declare const importForm: string
+export declare const repoInput: string
diff --git a/web/src/cde-gitness/components/ThirdPartyRepoImportForm/ThirdPartyRepoImportForm.tsx b/web/src/cde-gitness/components/ThirdPartyRepoImportForm/ThirdPartyRepoImportForm.tsx
index b1be9648a..6a61a1da9 100644
--- a/web/src/cde-gitness/components/ThirdPartyRepoImportForm/ThirdPartyRepoImportForm.tsx
+++ b/web/src/cde-gitness/components/ThirdPartyRepoImportForm/ThirdPartyRepoImportForm.tsx
@@ -1,125 +1,145 @@
-import { FormInput, FormikForm, Layout } from '@harnessio/uicore'
-import React, { useState } from 'react'
+import React, { useCallback, useState } from 'react'
+import { get, debounce } from 'lodash-es'
+import cx from 'classnames'
+import { FormikForm, Layout, FormInput, Container, Text } from '@harnessio/uicore'
import { useFormikContext } from 'formik'
+import { Color } from '@harnessio/design-system'
+import { useHistory } from 'react-router-dom'
+import { Icon } from '@harnessio/icons'
import { useStrings } from 'framework/strings'
-import { GitProviders, ImportFormData, getOrgLabel, getOrgPlaceholder, getProviders } from 'utils/GitUtils'
+import {
+ getRepoIdFromURL,
+ getRepoNameFromURL,
+ isValidUrl
+} from 'cde/components/CreateGitspace/components/SelectRepository/SelectRepository.utils'
+import { BranchInput } from 'cde/components/CreateGitspace/components/BranchInput/BranchInput'
+import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
+import NewRepoModalButton from 'components/NewRepoModalButton/NewRepoModalButton'
+import { RepoCreationType } from 'utils/GitUtils'
+import { useAppContext } from 'AppContext'
+import { OpenapiCreateGitspaceRequest, useGitspacelookup } from 'cde-gitness/services'
import css from './ThirdPartyRepoImportForm.module.scss'
-export interface ThirdPartyRepoImportFormProps extends ImportFormData {
- branch: string
- ide: string
- id: string
+enum RepoCheckStatus {
+ Valid = 'valid',
+ InValid = 'InValid'
}
export const ThirdPartyRepoImportForm = () => {
- const [auth, setAuth] = useState(false)
const { getString } = useStrings()
- const { values, setFieldValue, validateField } = useFormikContext()
+ const history = useHistory()
+ const space = useGetSpaceParam()
+ const { routes } = useAppContext()
+ const { setValues, setFieldError } = useFormikContext()
+
+ const { mutate, loading } = useGitspacelookup({})
+
+ const [repoCheckState, setRepoCheckState] = useState()
+
+ const onChange = useCallback(
+ debounce(async (url: string) => {
+ let errorMessage = ''
+ try {
+ if (isValidUrl(url)) {
+ const response = (await mutate({ space_ref: space, url })) as {
+ is_private?: boolean
+ branch: string
+ url: string
+ }
+ if (response?.is_private) {
+ errorMessage = getString('cde.repository.privateRepoWarning')
+ setRepoCheckState(RepoCheckStatus.InValid)
+ } else {
+ setValues((prvValues: any) => {
+ return {
+ ...prvValues,
+ code_repo_url: response.url,
+ branch: response.branch,
+ identifier: getRepoIdFromURL(response.url),
+ name: getRepoNameFromURL(response.url)
+ }
+ })
+ setRepoCheckState(RepoCheckStatus.Valid)
+ }
+ } else {
+ if (url?.trim()?.length) {
+ errorMessage = 'Invalid URL Format'
+ setRepoCheckState(RepoCheckStatus.InValid)
+ } else {
+ if (repoCheckState) {
+ setRepoCheckState(undefined)
+ }
+ }
+ }
+ } catch (err) {
+ errorMessage = get(err, 'message') || ''
+ }
+ setFieldError('code_repo_url', errorMessage)
+ }, 1000),
+ [repoCheckState]
+ )
+
return (
-
- {![GitProviders.GITHUB, GitProviders.GITLAB, GitProviders.BITBUCKET, GitProviders.AZURE].includes(
- values.gitProvider
- ) && (
-
- )}
-
- {values.gitProvider === GitProviders.AZURE && (
-
- )}
-
-
- {
- const target = event.target as HTMLInputElement
- setFieldValue('repo', target.value)
- if (target.value) {
- setFieldValue('name', target.value)
- validateField('repo')
- }
- }}
- />
-
-
- {
- const target = event.target as HTMLInputElement
- setFieldValue('branch', target.value)
- }}
- />
-
-
-
- {
- setAuth(!auth)
- }}
- style={auth ? {} : { margin: 0 }}
- />
-
-
- {auth ? (
- <>
- {[GitProviders.BITBUCKET, GitProviders.AZURE].includes(values.gitProvider) && (
-
+
+ {getString('cde.create.importWarning')}
+ {
+ (
+
+ {getString('cde.importInto')}
+
+ )}
+ modalTitle={getString('importGitRepo')}
+ onSubmit={() => {
+ history.push(routes.toCDEGitspacesCreate({ space }))
}}
/>
- )}
+ }
+
+
+
+
+ {loading ? (
+
+ ) : repoCheckState ? (
+ repoCheckState === RepoCheckStatus.Valid ? (
+
+ ) : (
+
+ )
+ ) : undefined}
+
+ )
+ }}
+ placeholder={getString('cde.repository.repositoryURL')}
+ className={cx(css.repoInput)}
+ onChange={async event => {
+ const target = event.target as HTMLInputElement
+ await onChange(target.value)
}}
/>
- >
- ) : null}
+
+
+
+
+
)
}
diff --git a/web/src/cde-gitness/constants/index.ts b/web/src/cde-gitness/constants/index.ts
new file mode 100644
index 000000000..8480ad4b2
--- /dev/null
+++ b/web/src/cde-gitness/constants/index.ts
@@ -0,0 +1,4 @@
+export enum StandaloneIDEType {
+ VSCODE = 'vs_code',
+ VSCODEWEB = 'vs_code_web'
+}
diff --git a/web/src/cde-gitness/hooks/useGetLogStream.tsx b/web/src/cde-gitness/hooks/useGetLogStream.tsx
new file mode 100644
index 000000000..667e7464c
--- /dev/null
+++ b/web/src/cde-gitness/hooks/useGetLogStream.tsx
@@ -0,0 +1,54 @@
+import { useEffect, useState } from 'react'
+
+export interface LogData {
+ pos: number
+ out: string
+ time: number
+}
+
+export function parseLog(log: string): LogData[] {
+ const logLines = log.trim().split('\n\n')
+ const parsedData: LogData[] = []
+
+ logLines.forEach(line => {
+ const dataMatch = line.match(/data: (.+)/)
+
+ if (dataMatch && dataMatch[1] !== 'eof') {
+ const eventData: LogData = JSON.parse(dataMatch[1])
+
+ parsedData.push(eventData)
+ }
+ })
+
+ return parsedData
+}
+
+export const useGetLogStream = ({ response }: { response: any }) => {
+ const [data, setData] = useState('')
+
+ useEffect(() => {
+ const fetchStreamData = async () => {
+ const reader = response?.body?.getReader()
+ const decoder = new TextDecoder()
+ let done = false
+
+ while (!done) {
+ /* eslint-disable no-await-in-loop */
+ const { value, done: streamDone } = (await reader?.read()) || {}
+ done = streamDone
+ const chunk = decoder.decode(value)
+ setData(prevData => prevData + chunk)
+ }
+ }
+
+ try {
+ if (response && !response.body.locked) {
+ fetchStreamData()
+ }
+ } catch (error) {
+ //
+ }
+ }, [response])
+
+ return { data: parseLog(data) }
+}
diff --git a/web/src/cde-gitness/pages/GitspaceCreate/GitspaceCreate.constants.ts b/web/src/cde-gitness/pages/GitspaceCreate/GitspaceCreate.constants.ts
index ea8f52a72..9e1708ddf 100644
--- a/web/src/cde-gitness/pages/GitspaceCreate/GitspaceCreate.constants.ts
+++ b/web/src/cde-gitness/pages/GitspaceCreate/GitspaceCreate.constants.ts
@@ -1,28 +1,10 @@
-import type { ThirdPartyRepoImportFormProps } from 'cde-gitness/components/ThirdPartyRepoImportForm/ThirdPartyRepoImportForm'
import type { EnumIDEType, OpenapiCreateGitspaceRequest } from 'cde-gitness/services'
-import { GitProviders } from 'utils/GitUtils'
export const gitnessFormInitialValues: OpenapiCreateGitspaceRequest = {
branch: '',
code_repo_url: '',
- devcontainer_path: '',
- id: '',
- ide: 'vsCode' as EnumIDEType,
- infra_provider_resource_id: 'default',
+ identifier: '',
+ ide: 'vs_code' as EnumIDEType,
+ resource_identifier: 'default',
name: ''
}
-export const thirdPartyformInitialValues: ThirdPartyRepoImportFormProps = {
- gitProvider: GitProviders.GITHUB,
- hostUrl: '',
- org: '',
- project: '',
- repo: '',
- username: '',
- password: '',
- name: '',
- description: '',
- branch: '',
- ide: 'vsCode' as EnumIDEType,
- id: '',
- importPipelineLabel: false
-}
diff --git a/web/src/cde-gitness/pages/GitspaceCreate/GitspaceCreate.module.scss b/web/src/cde-gitness/pages/GitspaceCreate/GitspaceCreate.module.scss
index c2ef7f09f..8b952f355 100644
--- a/web/src/cde-gitness/pages/GitspaceCreate/GitspaceCreate.module.scss
+++ b/web/src/cde-gitness/pages/GitspaceCreate/GitspaceCreate.module.scss
@@ -1,7 +1,21 @@
.main {
display: flex;
- justify-content: center;
align-items: center;
+ flex-direction: column;
+ margin-top: 10% !important;
+
+ .titleContainer {
+ width: 50%;
+ margin-bottom: var(--spacing-medium) !important;
+
+ h2 {
+ font-size: 24px !important;
+ }
+ p {
+ font-size: 16px !important;
+ color: #383946;
+ }
+ }
.cardMain {
width: 50%;
diff --git a/web/src/cde-gitness/pages/GitspaceCreate/GitspaceCreate.module.scss.d.ts b/web/src/cde-gitness/pages/GitspaceCreate/GitspaceCreate.module.scss.d.ts
index 841fb6516..5538cdcf0 100644
--- a/web/src/cde-gitness/pages/GitspaceCreate/GitspaceCreate.module.scss.d.ts
+++ b/web/src/cde-gitness/pages/GitspaceCreate/GitspaceCreate.module.scss.d.ts
@@ -24,3 +24,4 @@ export declare const formOuterContainer: string
export declare const formTitleContainer: string
export declare const main: string
export declare const subContainers: string
+export declare const titleContainer: string
diff --git a/web/src/cde-gitness/pages/GitspaceCreate/GitspaceCreate.tsx b/web/src/cde-gitness/pages/GitspaceCreate/GitspaceCreate.tsx
index a603bf23a..c67326222 100644
--- a/web/src/cde-gitness/pages/GitspaceCreate/GitspaceCreate.tsx
+++ b/web/src/cde-gitness/pages/GitspaceCreate/GitspaceCreate.tsx
@@ -1,23 +1,22 @@
import React, { useState } from 'react'
import {
+ Breadcrumbs,
Button,
ButtonVariation,
Card,
Container,
Formik,
FormikForm,
+ Heading,
Layout,
Page,
Text,
useToaster
} from '@harnessio/uicore'
-import { FontVariation } from '@harnessio/design-system'
+import { Color, FontVariation } from '@harnessio/design-system'
import { useHistory } from 'react-router-dom'
import { useStrings } from 'framework/strings'
-import {
- ThirdPartyRepoImportForm,
- ThirdPartyRepoImportFormProps
-} from 'cde-gitness/components/ThirdPartyRepoImportForm/ThirdPartyRepoImportForm'
+import { ThirdPartyRepoImportForm } from 'cde-gitness/components/ThirdPartyRepoImportForm/ThirdPartyRepoImportForm'
import { GitnessRepoImportForm } from 'cde-gitness/components/GitnessRepoImportForm/GitnessRepoImportForm'
import { SelectIDE } from 'cde/components/CreateGitspace/components/SelectIDE/SelectIDE'
import { useCreateGitspace, type OpenapiCreateGitspaceRequest } from 'cde-gitness/services'
@@ -25,8 +24,8 @@ import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
import { getErrorMessage } from 'utils/Utils'
import { useAppContext } from 'AppContext'
import RepositoryTypeButton, { RepositoryType } from '../../components/RepositoryTypeButton/RepositoryTypeButton'
-import { gitnessFormInitialValues, thirdPartyformInitialValues } from './GitspaceCreate.constants'
-import { handleImportSubmit, validateGitnessForm, validationSchemaStepOne } from './GitspaceCreate.utils'
+import { gitnessFormInitialValues } from './GitspaceCreate.constants'
+import { validateGitnessForm } from './GitspaceCreate.utils'
import css from './GitspaceCreate.module.scss'
export const GitspaceCreate = () => {
@@ -40,38 +39,49 @@ export const GitspaceCreate = () => {
return (
<>
-
+
+ }
+ />
+
+
+
+ {getString('cde.createGitspace')}
+
+ {getString('cde.create.subtext')}
+
+
-
- {getString('cde.createGitspace')}
-
{
try {
- const payload =
- activeButton === RepositoryType.GITNESS
- ? data
- : handleImportSubmit(data as ThirdPartyRepoImportFormProps)
- await mutate({ ...payload, space_ref: space } as OpenapiCreateGitspaceRequest & {
+ const payload = data
+ const response = await mutate({ ...payload, space_ref: space } as OpenapiCreateGitspaceRequest & {
space_ref?: string
})
showSuccess(getString('cde.create.gitspaceCreateSuccess'))
- history.push(routes.toCDEGitspaces({ space }))
+ history.push(
+ `${routes.toCDEGitspaceDetail({
+ space,
+ gitspaceId: response.identifier || ''
+ })}?redirectFrom=login`
+ )
} catch (error) {
showError(getString('cde.create.gitspaceCreateFailed'))
showError(getErrorMessage(error))
}
}}
- initialValues={
- activeButton === RepositoryType.GITNESS ? gitnessFormInitialValues : thirdPartyformInitialValues
- }
- validationSchema={
- activeButton === RepositoryType.GITNESS
- ? validateGitnessForm(getString)
- : validationSchemaStepOne(getString)
- }
+ initialValues={gitnessFormInitialValues}
+ validationSchema={validateGitnessForm(getString)}
formName="importRepoForm"
enableReinitialize>
{formik => {
@@ -105,7 +115,7 @@ export const GitspaceCreate = () => {
)}
-
+
diff --git a/web/src/cde-gitness/pages/GitspaceCreate/GitspaceCreate.utils.ts b/web/src/cde-gitness/pages/GitspaceCreate/GitspaceCreate.utils.ts
index 87b9c12fc..f23342eda 100644
--- a/web/src/cde-gitness/pages/GitspaceCreate/GitspaceCreate.utils.ts
+++ b/web/src/cde-gitness/pages/GitspaceCreate/GitspaceCreate.utils.ts
@@ -1,90 +1,12 @@
import * as yup from 'yup'
-import { compact } from 'lodash-es'
import type { UseStringsReturn } from 'framework/strings'
-import { GitProviders, getProviderTypeMapping } from 'utils/GitUtils'
-import type { ThirdPartyRepoImportFormProps } from 'cde-gitness/components/ThirdPartyRepoImportForm/ThirdPartyRepoImportForm'
export const validateGitnessForm = (getString: UseStringsReturn['getString']) =>
yup.object().shape({
branch: yup.string().trim().required(getString('cde.branchValidationMessage')),
code_repo_url: yup.string().trim().required(getString('cde.repoValidationMessage')),
- id: yup.string().trim().required(),
+ identifier: yup.string().trim().required(),
ide: yup.string().trim().required(),
- infra_provider_resource_id: yup.string().trim().required(getString('cde.machineValidationMessage')),
+ resource_identifier: yup.string().trim().required(getString('cde.machineValidationMessage')),
name: yup.string().trim().required()
})
-
-export const validationSchemaStepOne = (getString: UseStringsReturn['getString']) =>
- yup.object().shape({
- gitProvider: yup.string().required(),
- repo: yup
- .string()
- .trim()
- .when('gitProvider', {
- is: gitProvider => [GitProviders.GITHUB, GitProviders.GITLAB, GitProviders.BITBUCKET].includes(gitProvider),
- then: yup.string().required(getString('importSpace.orgRequired'))
- }),
- branch: yup.string().trim().required(getString('cde.branchValidationMessage')),
- hostUrl: yup
- .string()
- // .matches(MATCH_REPOURL_REGEX, getString('importSpace.invalidUrl'))
- .when('gitProvider', {
- is: gitProvider =>
- ![GitProviders.GITHUB, GitProviders.GITLAB, GitProviders.BITBUCKET, GitProviders.AZURE].includes(gitProvider),
- then: yup.string().required(getString('importRepo.required')),
- otherwise: yup.string().notRequired() // Optional based on your needs
- }),
- org: yup
- .string()
- .trim()
- .when('gitProvider', {
- is: GitProviders.AZURE,
- then: yup.string().required(getString('importSpace.orgRequired'))
- }),
- project: yup
- .string()
- .trim()
- .when('gitProvider', {
- is: GitProviders.AZURE,
- then: yup.string().required(getString('importSpace.spaceNameRequired'))
- }),
- name: yup.string().trim().required(getString('validation.nameIsRequired'))
- })
-
-export const handleImportSubmit = (formData: ThirdPartyRepoImportFormProps) => {
- const type = getProviderTypeMapping(formData.gitProvider)
-
- const provider = {
- type,
- username: formData.username,
- password: formData.password,
- host: ''
- }
-
- if (
- ![GitProviders.GITHUB, GitProviders.GITLAB, GitProviders.BITBUCKET, GitProviders.AZURE].includes(
- formData.gitProvider
- )
- ) {
- provider.host = formData.hostUrl
- }
-
- const importPayload = {
- name: formData.repo || formData.name,
- description: formData.description || '',
- id: formData.repo,
- provider,
- ide: formData.ide,
- branch: formData.branch,
- infra_provider_resource_id: 'default',
- provider_repo: compact([
- formData.org,
- formData.gitProvider === GitProviders.AZURE ? formData.project : '',
- formData.repo
- ])
- .join('/')
- .replace(/\.git$/, '')
- }
-
- return importPayload
-}
diff --git a/web/src/cde-gitness/pages/GitspaceDetails/GitspaceDetails.module.scss b/web/src/cde-gitness/pages/GitspaceDetails/GitspaceDetails.module.scss
new file mode 100644
index 000000000..5462786bd
--- /dev/null
+++ b/web/src/cde-gitness/pages/GitspaceDetails/GitspaceDetails.module.scss
@@ -0,0 +1,69 @@
+.customSubheader {
+ height: 10vh;
+}
+
+.pageMain {
+ margin: var(--spacing-xxlarge) !important;
+}
+
+@media (min-width: 2000px) {
+ .titleContainer {
+ width: 80% !important;
+ margin: 0 10% !important;
+ }
+}
+
+.titleContainer {
+ width: 95% !important;
+ margin: 0 5% !important;
+}
+
+.cardContainer {
+ margin-top: var(--spacing-xxlarge) !important;
+ width: 100% !important;
+
+ [data-testid='eventsCard-panel'] {
+ padding: 0px !important;
+ }
+
+ &:first-child {
+ margin-top: 0px !important;
+ }
+}
+
+.popover {
+ > div[class*='popover-arrow'] {
+ display: none;
+ }
+
+ :global {
+ a.bp3-menu-item:hover,
+ .bp3-active {
+ background: var(--primary-1) !important;
+ color: var(--grey-1000) !important;
+ }
+ }
+}
+
+.accordionnCustomSummary {
+ :global(.Accordion--chevron) {
+ margin-left: auto;
+ color: var(--grey-700);
+ }
+
+ :global([class*='Accordion--panel']) {
+ padding: 0px !important;
+ }
+
+ div[data-testid='eventsCard-summary'],
+ div[data-testid='logsCard-summary'] {
+ flex-direction: row-reverse;
+ justify-content: flex-end;
+ margin: 0 var(--spacing-medium);
+ width: 100%;
+
+ div:first-child {
+ width: 97%;
+ }
+ }
+}
diff --git a/web/src/cde-gitness/pages/GitspaceDetails/GitspaceDetails.module.scss.d.ts b/web/src/cde-gitness/pages/GitspaceDetails/GitspaceDetails.module.scss.d.ts
new file mode 100644
index 000000000..9c9cd578f
--- /dev/null
+++ b/web/src/cde-gitness/pages/GitspaceDetails/GitspaceDetails.module.scss.d.ts
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2023 Harness, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* eslint-disable */
+// This is an auto-generated file
+export declare const accordionnCustomSummary: string
+export declare const cardContainer: string
+export declare const customSubheader: string
+export declare const pageMain: string
+export declare const popover: string
+export declare const titleContainer: string
diff --git a/web/src/cde-gitness/pages/GitspaceDetails/GitspaceDetails.tsx b/web/src/cde-gitness/pages/GitspaceDetails/GitspaceDetails.tsx
new file mode 100644
index 000000000..81ad4d979
--- /dev/null
+++ b/web/src/cde-gitness/pages/GitspaceDetails/GitspaceDetails.tsx
@@ -0,0 +1,347 @@
+import React, { useEffect, useState } from 'react'
+import {
+ Breadcrumbs,
+ Button,
+ ButtonVariation,
+ Card,
+ Container,
+ Layout,
+ Accordion,
+ Page,
+ Text,
+ useToaster
+} from '@harnessio/uicore'
+import { Play } from 'iconoir-react'
+import { useHistory, useParams } from 'react-router-dom'
+import { Color, FontVariation, PopoverProps } from '@harnessio/design-system'
+import { Menu, MenuItem, PopoverInteractionKind, PopoverPosition } from '@blueprintjs/core'
+import { useGet, useMutate } from 'restful-react'
+import { defaultTo } from 'lodash-es'
+import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
+import { useAppContext } from 'AppContext'
+import { useStrings } from 'framework/strings'
+import EventTimelineAccordion from 'cde-gitness/components/EventTimelineAccordion/EventTimelineAccordion'
+import { DetailsCard } from 'cde-gitness/components/DetailsCard/DetailsCard'
+import type { TypesGitspaceConfig, TypesGitspaceEventResponse } from 'cde-gitness/services'
+import { GitspaceActionType, GitspaceStatus } from 'cde/constants'
+import { useQueryParams } from 'hooks/useQueryParams'
+import { useUpdateQueryParams } from 'hooks/useUpdateQueryParams'
+import { getErrorMessage } from 'utils/Utils'
+import { usePolling } from 'cde/components/GitspaceDetails/usePolling'
+import deleteIcon from 'cde-gitness/assests/delete.svg?url'
+import vscodeIcon from 'cde/icons/VSCode.svg?url'
+import pauseIcon from 'cde-gitness/assests/pause.svg?url'
+import { StandaloneIDEType } from 'cde-gitness/constants'
+import homeIcon from 'cde-gitness/assests/home.svg?url'
+import ContainerLogs from '../../components/ContainerLogs/ContainerLogs'
+import { useGetLogStream } from '../../hooks/useGetLogStream'
+import css from './GitspaceDetails.module.scss'
+
+export const GitspaceDetails = () => {
+ const space = useGetSpaceParam()
+ const { getString } = useStrings()
+ const { routes } = useAppContext()
+ const { showError } = useToaster()
+ const history = useHistory()
+ const [startTriggred, setStartTriggred] = useState(false)
+ const { gitspaceId = '' } = useParams<{ gitspaceId?: string }>()
+
+ const [isStreamingLogs, setIsStreamingLogs] = useState(false)
+
+ const [startPolling, setStartPolling] = useState(undefined)
+
+ const { loading, data, refetch, error } = useGet({
+ path: `/api/v1/gitspaces/${space}/${gitspaceId}/+`,
+ debounce: 500
+ })
+
+ const { data: eventData, refetch: refetchEventData } = useGet({
+ path: `/api/v1/gitspaces/${space}/${gitspaceId}/+/events`,
+ debounce: 500
+ })
+
+ const { refetch: refetchLogsData, response } = useGet({
+ path: `api/v1/gitspaces/${space}/${gitspaceId}/+/logs/stream`,
+ debounce: 500,
+ lazy: true
+ })
+
+ const { mutate: actionMutate, loading: mutateLoading } = useMutate({
+ verb: 'POST',
+ path: `/api/v1/gitspaces/${space}/${gitspaceId}/+/actions`
+ })
+
+ const { mutate: deleteGitspace, loading: deleteLoading } = useMutate({
+ verb: 'DELETE',
+ path: `/api/v1/gitspaces/${space}/${gitspaceId}/+`
+ })
+
+ const { updateQueryParams } = useUpdateQueryParams<{ redirectFrom?: string }>()
+ const { redirectFrom = '' } = useQueryParams<{ redirectFrom?: string }>()
+
+ const pollingCondition = [
+ GitspaceStatus.RUNNING,
+ GitspaceStatus.STOPPED,
+ GitspaceStatus.ERROR,
+ GitspaceStatus.UNINITIALIZED
+ ].includes(data?.state as GitspaceStatus)
+
+ const disabledActionButtons = [GitspaceStatus.STARTING, GitspaceStatus.STOPPING].includes(
+ data?.state as GitspaceStatus
+ )
+
+ useEffect(() => {
+ const filteredEvent = eventData?.filter(
+ item =>
+ item.event === 'agent_gitspace_creation_start' &&
+ defaultTo(item?.timestamp, 0) >= defaultTo(data?.instance?.updated, 0)
+ )
+ if (disabledActionButtons && filteredEvent?.length && !isStreamingLogs) {
+ refetchLogsData()
+ setIsStreamingLogs(true)
+ } else if (filteredEvent?.length && !disabledActionButtons && isStreamingLogs) {
+ setIsStreamingLogs(false)
+ }
+ }, [eventData, data?.instance?.updated, disabledActionButtons])
+
+ usePolling(
+ async () => {
+ await refetchEventData()
+ await refetch()
+ },
+ {
+ pollingInterval: 10000,
+ startCondition: Boolean(startPolling) || !pollingCondition
+ }
+ )
+
+ useEffect(() => {
+ const startTrigger = async () => {
+ if (redirectFrom && !startTriggred && !mutateLoading) {
+ try {
+ setStartTriggred(true)
+ await actionMutate({ action: GitspaceActionType.START })
+ await refetch()
+ updateQueryParams({ redirectFrom: undefined })
+ } catch (err) {
+ showError(getErrorMessage(err))
+ }
+ }
+ }
+
+ if (data?.state && data?.state !== GitspaceStatus.RUNNING && redirectFrom) {
+ startTrigger()
+ }
+ }, [data?.state, redirectFrom, mutateLoading, startTriggred])
+
+ const formattedlogsdata = useGetLogStream({ response })
+
+ return (
+ <>
+
+ }
+ />
+
+
+
+
+
+ {data?.name}
+
+
+
+
+
+
+ }
+ disabled={loading || mutateLoading || disabledActionButtons}
+ onClick={async () => {
+ try {
+ setStartPolling(GitspaceActionType.START)
+ await actionMutate({ action: data?.state === GitspaceStatus.RUNNING ? 'stop' : 'start' })
+ await refetch()
+ setStartPolling(undefined)
+ updateQueryParams({ redirectFrom: undefined })
+ } catch (err) {
+ showError(getErrorMessage(err))
+ setStartPolling(undefined)
+ }
+ }}
+ />
+ )}
+
+ }
+ onClick={() => {
+ history.push(routes.toCDEGitspaces({ space }))
+ }}
+ />
+
+ ) : undefined
+ }
+ tooltipProps={{ isDark: true, position: PopoverPosition.BOTTOM_LEFT }}
+ onClick={e => {
+ e.preventDefault()
+ e.stopPropagation()
+ if (data?.ide === StandaloneIDEType.VSCODE) {
+ window.open(`vscode://harness-inc.gitspaces/${data?.identifier}`, '_blank')
+ } else {
+ window.open(data?.instance?.url || '', '_blank')
+ }
+ }}>
+ {data?.ide === StandaloneIDEType.VSCODE && getString('cde.details.openEditor')}
+ {data?.ide === StandaloneIDEType.VSCODEWEB && getString('cde.details.openBrowser')}
+
+ ) : (
+
+ )}
+
+
+
+
+
+ !data?.identifier,
+ message: getString('cde.details.noData')
+ }}
+ className={css.pageMain}>
+
+
+ {getString('cde.gitspaceDetail')}
+
+
+
+
+
+
+
+
+
+
+ {getString('cde.details.containerLogs')}
+
+ {getString('cde.details.containerLogsSubText')}
+
+ }
+ id="logsCard"
+ details={
+
+
+
+ }
+ />
+
+
+
+
+ >
+ )
+}
diff --git a/web/src/cde-gitness/services/index.tsx b/web/src/cde-gitness/services/index.tsx
index d34511c57..7e677240f 100644
--- a/web/src/cde-gitness/services/index.tsx
+++ b/web/src/cde-gitness/services/index.tsx
@@ -1,10 +1,3 @@
-/*
- * Copyright 2024 Harness Inc. All rights reserved.
- * Use of this source code is governed by the PolyForm Shield 1.0.0 license
- * that can be found in the licenses directory at the root of this repository, also available at
- * https://polyformproject.org/wp-content/uploads/2020/06/PolyForm-Shield-1.0.0.txt.
- */
-
/* Generated by restful-react */
import React from 'react'
@@ -23,18 +16,61 @@ export type EnumCheckPayloadKind = '' | 'markdown' | 'pipeline' | 'raw'
export type EnumCheckStatus = 'error' | 'failure' | 'pending' | 'running' | 'success'
-export type EnumCodeRepoType = 'github' | 'gitlab' | 'harness_code' | 'bitbucket' | 'unknown'
-
export type EnumContentEncodingType = 'base64' | 'utf8'
export type EnumFileDiffStatus = string
-export type EnumGitspaceAccessType = 'jwt_token' | 'password' | 'ssh_key'
+export type EnumGitspaceAccessType = 'jwt_token' | 'user_credentials' | 'ssh_key'
-export type EnumGitspaceStateType = 'running' | 'stopped' | 'error' | 'uninitialized'
+export type EnumGitspaceCodeRepoType = 'github' | 'gitlab' | 'harness_code' | 'bitbucket' | 'unknown'
+
+export type EnumGitspaceEntityType = 'gitspace_config' | 'gitspace_instance'
+
+export type EnumGitspaceEventType =
+ | 'gitspace_action_start'
+ | 'gitspace_action_start_completed'
+ | 'gitspace_action_start_failed'
+ | 'gitspace_action_stop'
+ | 'gitspace_action_stop_completed'
+ | 'gitspace_action_stop_failed'
+ | 'fetch_devcontainer_start'
+ | 'fetch_devcontainer_completed'
+ | 'fetch_devcontainer_failed'
+ | 'infra_provisioning_start'
+ | 'infra_provisioning_completed'
+ | 'infra_provisioning_failed'
+ | 'infra_unprovisioning_start'
+ | 'infra_unprovisioning_completed'
+ | 'infra_unprovisioning_failed'
+ | 'agent_connect_start'
+ | 'agent_connect_completed'
+ | 'agent_connect_failed'
+ | 'agent_gitspace_creation_start'
+ | 'agent_gitspace_creation_completed'
+ | 'agent_gitspace_creation_failed'
+ | 'agent_gitspace_deletion_start'
+ | 'agent_gitspace_deletion_completed'
+ | 'agent_gitspace_deletion_failed'
+ | 'agent_gitspace_state_report_running'
+ | 'agent_gitspace_state_report_error'
+ | 'agent_gitspace_state_report_stopped'
+ | 'agent_gitspace_state_report_unknown'
+
+export type EnumGitspaceInstanceStateType =
+ | 'running'
+ | 'uninitialized'
+ | 'unknown'
+ | 'error'
+ | 'deleted'
+ | 'starting'
+ | 'stopping'
+
+export type EnumGitspaceStateType = 'running' | 'stopped' | 'error' | 'uninitialized' | 'starting' | 'stopping'
export type EnumIDEType = 'vs_code' | 'vs_code_web'
+export type EnumInfraProviderType = 'docker' | 'harness_gcp'
+
export type EnumMembershipRole = 'contributor' | 'executor' | 'reader' | 'space_owner'
export type EnumMergeCheckStatus = string
@@ -45,8 +81,6 @@ export type EnumParentResourceType = 'space' | 'repo'
export type EnumPrincipalType = 'service' | 'serviceaccount' | 'user'
-export type EnumProviderType = 'docker'
-
export type EnumPublicKeyUsage = 'auth'
export type EnumPullReqActivityKind = 'change-comment' | 'comment' | 'system'
@@ -69,6 +103,8 @@ export type EnumPullReqReviewerType = 'assigned' | 'requested' | 'self_assigned'
export type EnumPullReqState = 'closed' | 'merged' | 'open'
+export type EnumRepoState = number
+
export type EnumResolverType = string
export type EnumRuleState = 'active' | 'disabled' | 'monitor' | null
@@ -165,6 +201,23 @@ export interface ImporterProvider {
export type ImporterProviderType = 'github' | 'gitlab' | 'bitbucket' | 'stash' | 'gitea' | 'gogs' | 'azure'
+export interface InfraproviderResourceInput {
+ cpu?: string | null
+ disk?: string | null
+ gateway_host?: string | null
+ gateway_port?: string | null
+ identifier?: string
+ infra_provider_type?: EnumInfraProviderType
+ memory?: string | null
+ metadata?: {
+ [key: string]: string
+ } | null
+ name?: string
+ network?: string | null
+ region?: string[] | null
+ template_identifier?: string | null
+}
+
export interface JobProgress {
failure?: string
progress?: number
@@ -266,16 +319,26 @@ export interface OpenapiCreateConnectorRequest {
export interface OpenapiCreateGitspaceRequest {
branch?: string
code_repo_url?: string
- devcontainer_path?: string
- id?: string
+ devcontainer_path?: string | null
ide?: EnumIDEType
- infra_provider_resource_id?: string
+ identifier?: string
metadata?: {
[key: string]: string
} | null
name?: string
- provider?: ImporterProvider
- provider_repo?: string
+ resource_identifier?: string
+ space_ref?: string
+}
+
+export interface OpenapiCreateInfraProviderConfigRequest {
+ identifier?: string
+ metadata?: {
+ [key: string]: string
+ } | null
+ name?: string
+ resources?: InfraproviderResourceInput[] | null
+ space_ref?: string
+ type?: EnumInfraProviderType
}
export interface OpenapiCreatePipelineRequest {
@@ -401,6 +464,11 @@ export interface OpenapiLoginRequest {
password?: string
}
+export interface OpenapiLookupRepoGitspaceRequest {
+ space_ref?: string
+ url?: string
+}
+
export interface OpenapiMergePullReq {
bypass_rules?: boolean
dry_run?: boolean
@@ -671,6 +739,8 @@ export interface RepoCommitTag {
title?: string
}
+export type RepoContent = {}
+
export interface RepoContentInfo {
latest_commit?: TypesCommit
name?: string
@@ -725,6 +795,7 @@ export interface RepoRepositoryOutput {
path?: string
size?: number
size_updated?: number
+ state?: EnumRepoState
updated?: number
}
@@ -750,6 +821,12 @@ export interface ReposettingsSecuritySettings {
secret_scanning_enabled?: boolean | null
}
+export interface ScmCodeRepositoryResponse {
+ branch?: string
+ is_private?: boolean
+ url?: string
+}
+
/**
* Git object hash
*/
@@ -926,60 +1003,82 @@ export interface TypesExecution {
export interface TypesGitspaceConfig {
branch?: string
- code_repo_id?: string
- code_repo_type?: EnumCodeRepoType
+ code_repo_type?: EnumGitspaceCodeRepoType
code_repo_url?: string
created?: number
- devcontainer_path?: string
- id?: string
+ devcontainer_path?: string | null
ide?: EnumIDEType
- infra_provider_resource_id?: string
+ identifier?: string
instance?: TypesGitspaceInstance
name?: string
+ resource_identifier?: string
space_path?: string
+ state?: EnumGitspaceStateType
updated?: number
user_id?: string
}
-export interface TypesGitspaceInstance {
- access_key?: string
+export interface TypesGitspaceEventResponse {
+ entity_type?: EnumGitspaceEntityType
+ event?: EnumGitspaceEventType
+ event_time?: string
+ message?: string
+ query_key?: string
+ timestamp?: number
+}
+
+export type TypesGitspaceInstance = {
+ access_key?: string | null
access_type?: EnumGitspaceAccessType
created?: number
- id?: string
+ identifier?: string
last_used?: number
- machine_user?: string
- resource_usage?: string
+ machine_user?: string | null
+ resource_usage?: string | null
space_path?: string
- state?: EnumGitspaceStateType
+ state?: EnumGitspaceInstanceStateType
total_time_used?: number
- tracked_changes?: string
+ tracked_changes?: string | null
updated?: number
- url?: string
-}
+ url?: string | null
+} | null
export interface TypesIdentity {
email?: string
name?: string
}
-export interface TypesInfraProviderResource {
- cpu?: string
+export interface TypesInfraProviderConfig {
created?: number
- disk?: string
- gateway_host?: string
- gateway_port?: string
- id?: string
- infra_provider_config_id?: string
- infra_provider_type?: EnumProviderType
- memory?: string
+ identifier?: string
metadata?: {
[key: string]: string
} | null
name?: string
- network?: string
+ resources?: TypesInfraProviderResource[] | null
+ space_path?: string
+ type?: EnumInfraProviderType
+ updated?: number
+}
+
+export interface TypesInfraProviderResource {
+ config_identifier?: string
+ cpu?: string | null
+ created?: number
+ disk?: string | null
+ gateway_host?: string | null
+ gateway_port?: string | null
+ identifier?: string
+ infra_provider_type?: EnumInfraProviderType
+ memory?: string | null
+ metadata?: {
+ [key: string]: string
+ } | null
+ name?: string
+ network?: string | null
region?: string
space_path?: string
- template_id?: string
+ template_identifier?: string | null
updated?: number
}
@@ -1039,6 +1138,7 @@ export interface TypesPipeline {
description?: string
disabled?: boolean
execution?: TypesExecution
+ id?: number
identifier?: string
repo_id?: number
seq?: number
@@ -1192,7 +1292,6 @@ export interface TypesRepository {
git_url?: string
id?: number
identifier?: string
- importing?: boolean
is_empty?: boolean
num_closed_pulls?: number
num_forks?: number
@@ -1203,6 +1302,7 @@ export interface TypesRepository {
path?: string
size?: number
size_updated?: number
+ state?: EnumRepoState
updated?: number
}
@@ -1429,6 +1529,263 @@ export interface UsererrorError {
values?: { [key: string]: any }
}
+export interface AdminListUsersQueryParams {
+ sort?: 'id' | 'email' | 'created' | 'updated'
+ order?: 'asc' | 'desc'
+ page?: number
+ limit?: number
+}
+
+export type AdminListUsersProps = Omit, 'path'>
+
+export const AdminListUsers = (props: AdminListUsersProps) => (
+
+ path={`/admin/users`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseAdminListUsersProps = Omit<
+ UseGetProps,
+ 'path'
+>
+
+export const useAdminListUsers = (props: UseAdminListUsersProps) =>
+ useGet(`/admin/users`, {
+ base: getConfig('api/v1'),
+ ...props
+ })
+
+export type AdminCreateUserProps = Omit<
+ MutateProps,
+ 'path' | 'verb'
+>
+
+export const AdminCreateUser = (props: AdminCreateUserProps) => (
+
+ verb="POST"
+ path={`/admin/users`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseAdminCreateUserProps = Omit<
+ UseMutateProps,
+ 'path' | 'verb'
+>
+
+export const useAdminCreateUser = (props: UseAdminCreateUserProps) =>
+ useMutate('POST', `/admin/users`, {
+ base: getConfig('api/v1'),
+ ...props
+ })
+
+export type AdminDeleteUserProps = Omit, 'path' | 'verb'>
+
+export const AdminDeleteUser = (props: AdminDeleteUserProps) => (
+
+ verb="DELETE"
+ path={`/admin/users`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseAdminDeleteUserProps = Omit, 'path' | 'verb'>
+
+export const useAdminDeleteUser = (props: UseAdminDeleteUserProps) =>
+ useMutate('DELETE', `/admin/users`, { base: getConfig('api/v1'), ...props })
+
+export interface AdminGetUserPathParams {
+ user_uid: string
+}
+
+export type AdminGetUserProps = Omit, 'path'> &
+ AdminGetUserPathParams
+
+export const AdminGetUser = ({ user_uid, ...props }: AdminGetUserProps) => (
+
+ path={`/admin/users/${user_uid}`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseAdminGetUserProps = Omit, 'path'> &
+ AdminGetUserPathParams
+
+export const useAdminGetUser = ({ user_uid, ...props }: UseAdminGetUserProps) =>
+ useGet(
+ (paramsInPath: AdminGetUserPathParams) => `/admin/users/${paramsInPath.user_uid}`,
+ { base: getConfig('api/v1'), pathParams: { user_uid }, ...props }
+ )
+
+export interface AdminUpdateUserPathParams {
+ user_uid: string
+}
+
+export type AdminUpdateUserProps = Omit<
+ MutateProps,
+ 'path' | 'verb'
+> &
+ AdminUpdateUserPathParams
+
+export const AdminUpdateUser = ({ user_uid, ...props }: AdminUpdateUserProps) => (
+
+ verb="PATCH"
+ path={`/admin/users/${user_uid}`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseAdminUpdateUserProps = Omit<
+ UseMutateProps,
+ 'path' | 'verb'
+> &
+ AdminUpdateUserPathParams
+
+export const useAdminUpdateUser = ({ user_uid, ...props }: UseAdminUpdateUserProps) =>
+ useMutate(
+ 'PATCH',
+ (paramsInPath: AdminUpdateUserPathParams) => `/admin/users/${paramsInPath.user_uid}`,
+ { base: getConfig('api/v1'), pathParams: { user_uid }, ...props }
+ )
+
+export interface UpdateUserAdminPathParams {
+ user_uid: string
+}
+
+export type UpdateUserAdminProps = Omit<
+ MutateProps,
+ 'path' | 'verb'
+> &
+ UpdateUserAdminPathParams
+
+export const UpdateUserAdmin = ({ user_uid, ...props }: UpdateUserAdminProps) => (
+
+ verb="PATCH"
+ path={`/admin/users/${user_uid}/admin`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseUpdateUserAdminProps = Omit<
+ UseMutateProps,
+ 'path' | 'verb'
+> &
+ UpdateUserAdminPathParams
+
+export const useUpdateUserAdmin = ({ user_uid, ...props }: UseUpdateUserAdminProps) =>
+ useMutate(
+ 'PATCH',
+ (paramsInPath: UpdateUserAdminPathParams) => `/admin/users/${paramsInPath.user_uid}/admin`,
+ { base: getConfig('api/v1'), pathParams: { user_uid }, ...props }
+ )
+
+export type CreateConnectorProps = Omit<
+ MutateProps,
+ 'path' | 'verb'
+>
+
+export const CreateConnector = (props: CreateConnectorProps) => (
+
+ verb="POST"
+ path={`/connectors`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseCreateConnectorProps = Omit<
+ UseMutateProps,
+ 'path' | 'verb'
+>
+
+export const useCreateConnector = (props: UseCreateConnectorProps) =>
+ useMutate('POST', `/connectors`, {
+ base: getConfig('api/v1'),
+ ...props
+ })
+
+export type DeleteConnectorProps = Omit, 'path' | 'verb'>
+
+export const DeleteConnector = (props: DeleteConnectorProps) => (
+
+ verb="DELETE"
+ path={`/connectors`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseDeleteConnectorProps = Omit, 'path' | 'verb'>
+
+export const useDeleteConnector = (props: UseDeleteConnectorProps) =>
+ useMutate('DELETE', `/connectors`, { base: getConfig('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('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('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('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('api/v1'), pathParams: { connector_ref }, ...props }
+ )
+
export interface ListGitspacesQueryParams {
sort?: 'id' | 'created' | 'updated'
order?: 'asc' | 'desc'
@@ -1447,7 +1804,7 @@ export type ListGitspacesProps = Omit<
export const ListGitspaces = (props: ListGitspacesProps) => (
path={`/gitspaces`}
- base={getConfig('code/api/v1')}
+ base={getConfig('api/v1')}
{...props}
/>
)
@@ -1462,12 +1819,12 @@ export type UseListGitspacesProps = Omit<
*/
export const useListGitspaces = (props: UseListGitspacesProps) =>
useGet(`/gitspaces`, {
- base: getConfig('code/api/v1'),
+ base: getConfig('api/v1'),
...props
})
export type CreateGitspaceProps = Omit<
- MutateProps,
+ MutateProps,
'path' | 'verb'
>
@@ -1475,16 +1832,16 @@ export type CreateGitspaceProps = Omit<
* Create gitspace config
*/
export const CreateGitspace = (props: CreateGitspaceProps) => (
-
+
verb="POST"
path={`/gitspaces`}
- base={getConfig('code/api/v1')}
+ base={getConfig('api/v1')}
{...props}
/>
)
export type UseCreateGitspaceProps = Omit<
- UseMutateProps,
+ UseMutateProps,
'path' | 'verb'
>
@@ -1492,8 +1849,8 @@ export type UseCreateGitspaceProps = Omit<
* Create gitspace config
*/
export const useCreateGitspace = (props: UseCreateGitspaceProps) =>
- useMutate('POST', `/gitspaces`, {
- base: getConfig('code/api/v1'),
+ useMutate('POST', `/gitspaces`, {
+ base: getConfig('api/v1'),
...props
})
@@ -1506,7 +1863,7 @@ export const DeleteGitspace = (props: DeleteGitspaceProps) => (
verb="DELETE"
path={`/gitspaces`}
- base={getConfig('code/api/v1')}
+ base={getConfig('api/v1')}
{...props}
/>
)
@@ -1517,13 +1874,10 @@ export type UseDeleteGitspaceProps = Omit
- useMutate('DELETE', `/gitspaces`, {
- base: getConfig('code/api/v1'),
- ...props
- })
+ useMutate('DELETE', `/gitspaces`, { base: getConfig('api/v1'), ...props })
export interface FindGitspacePathParams {
- gitspace_ref: string
+ gitspace_identifier: string
}
export type FindGitspaceProps = Omit<
@@ -1535,10 +1889,10 @@ export type FindGitspaceProps = Omit<
/**
* Get gitspace
*/
-export const FindGitspace = ({ gitspace_ref, ...props }: FindGitspaceProps) => (
+export const FindGitspace = ({ gitspace_identifier, ...props }: FindGitspaceProps) => (
- path={`/gitspaces/${gitspace_ref}`}
- base={getConfig('code/api/v1')}
+ path={`/gitspaces/${gitspace_identifier}`}
+ base={getConfig('api/v1')}
{...props}
/>
)
@@ -1552,8 +1906,5499 @@ export type UseFindGitspaceProps = Omit<
/**
* Get gitspace
*/
-export const useFindGitspace = ({ gitspace_ref, ...props }: UseFindGitspaceProps) =>
+export const useFindGitspace = ({ gitspace_identifier, ...props }: UseFindGitspaceProps) =>
useGet(
- (paramsInPath: FindGitspacePathParams) => `/gitspaces/${paramsInPath.gitspace_ref}`,
- { base: getConfig('code/api/v1'), pathParams: { gitspace_ref }, ...props }
+ (paramsInPath: FindGitspacePathParams) => `/gitspaces/${paramsInPath.gitspace_identifier}`,
+ { base: getConfig('api/v1'), pathParams: { gitspace_identifier }, ...props }
)
+
+export interface ListGitspaceEventsQueryParams {
+ page?: number
+ limit?: number
+}
+
+export interface ListGitspaceEventsPathParams {
+ gitspace_identifier: string
+}
+
+export type ListGitspaceEventsProps = Omit<
+ GetProps,
+ 'path'
+> &
+ ListGitspaceEventsPathParams
+
+/**
+ * List gitspace events
+ */
+export const ListGitspaceEvents = ({ gitspace_identifier, ...props }: ListGitspaceEventsProps) => (
+
+ path={`/gitspaces/${gitspace_identifier}/events`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseListGitspaceEventsProps = Omit<
+ UseGetProps<
+ TypesGitspaceEventResponse[],
+ UsererrorError,
+ ListGitspaceEventsQueryParams,
+ ListGitspaceEventsPathParams
+ >,
+ 'path'
+> &
+ ListGitspaceEventsPathParams
+
+/**
+ * List gitspace events
+ */
+export const useListGitspaceEvents = ({ gitspace_identifier, ...props }: UseListGitspaceEventsProps) =>
+ useGet(
+ (paramsInPath: ListGitspaceEventsPathParams) => `/gitspaces/${paramsInPath.gitspace_identifier}/events`,
+ { base: getConfig('api/v1'), pathParams: { gitspace_identifier }, ...props }
+ )
+
+export interface OpStreamLogsPathParams {
+ gitspace_identifier: string
+}
+
+export type OpStreamLogsProps = Omit, 'path'> &
+ OpStreamLogsPathParams
+
+export const OpStreamLogs = ({ gitspace_identifier, ...props }: OpStreamLogsProps) => (
+
+ path={`/gitspaces/${gitspace_identifier}/logs/stream`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseOpStreamLogsProps = Omit<
+ UseGetProps,
+ 'path'
+> &
+ OpStreamLogsPathParams
+
+export const useOpStreamLogs = ({ gitspace_identifier, ...props }: UseOpStreamLogsProps) =>
+ useGet(
+ (paramsInPath: OpStreamLogsPathParams) => `/gitspaces/${paramsInPath.gitspace_identifier}/logs/stream`,
+ { base: getConfig('api/v1'), pathParams: { gitspace_identifier }, ...props }
+ )
+
+export type GitspacelookupProps = Omit<
+ MutateProps,
+ 'path' | 'verb'
+>
+
+/**
+ * Create gitspace config
+ */
+export const Gitspacelookup = (props: GitspacelookupProps) => (
+
+ verb="POST"
+ path={`/gitspaces/lookup-repo`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseGitspacelookupProps = Omit<
+ UseMutateProps,
+ 'path' | 'verb'
+>
+
+/**
+ * Create gitspace config
+ */
+export const useGitspacelookup = (props: UseGitspacelookupProps) =>
+ useMutate(
+ 'POST',
+ `/gitspaces/lookup-repo`,
+ { base: getConfig('api/v1'), ...props }
+ )
+
+export type CreateInfraProviderProps = Omit<
+ MutateProps,
+ 'path' | 'verb'
+>
+
+/**
+ * Create infraProvider config
+ */
+export const CreateInfraProvider = (props: CreateInfraProviderProps) => (
+
+ verb="POST"
+ path={`/infraproviders`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseCreateInfraProviderProps = Omit<
+ UseMutateProps,
+ 'path' | 'verb'
+>
+
+/**
+ * Create infraProvider config
+ */
+export const useCreateInfraProvider = (props: UseCreateInfraProviderProps) =>
+ useMutate(
+ 'POST',
+ `/infraproviders`,
+ { base: getConfig('api/v1'), ...props }
+ )
+
+export interface GetInfraProviderPathParams {
+ infraprovider_identifier: string
+}
+
+export type GetInfraProviderProps = Omit<
+ GetProps,
+ 'path'
+> &
+ GetInfraProviderPathParams
+
+/**
+ * Get infraProviderConfig
+ */
+export const GetInfraProvider = ({ infraprovider_identifier, ...props }: GetInfraProviderProps) => (
+
+ path={`/infraproviders/${infraprovider_identifier}`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseGetInfraProviderProps = Omit<
+ UseGetProps,
+ 'path'
+> &
+ GetInfraProviderPathParams
+
+/**
+ * Get infraProviderConfig
+ */
+export const useGetInfraProvider = ({ infraprovider_identifier, ...props }: UseGetInfraProviderProps) =>
+ useGet(
+ (paramsInPath: GetInfraProviderPathParams) => `/infraproviders/${paramsInPath.infraprovider_identifier}`,
+ { base: getConfig('api/v1'), pathParams: { infraprovider_identifier }, ...props }
+ )
+
+export interface OnLoginQueryParams {
+ /**
+ * If set to true the token is also returned as a cookie.
+ */
+ include_cookie?: boolean
+}
+
+export type OnLoginProps = Omit<
+ MutateProps,
+ 'path' | 'verb'
+>
+
+export const OnLogin = (props: OnLoginProps) => (
+
+ verb="POST"
+ path={`/login`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseOnLoginProps = Omit<
+ UseMutateProps,
+ 'path' | 'verb'
+>
+
+export const useOnLogin = (props: UseOnLoginProps) =>
+ useMutate('POST', `/login`, {
+ base: getConfig('api/v1'),
+ ...props
+ })
+
+export type OpLogoutProps = Omit, 'path' | 'verb'>
+
+export const OpLogout = (props: OpLogoutProps) => (
+ verb="POST" path={`/logout`} base={getConfig('api/v1')} {...props} />
+)
+
+export type UseOpLogoutProps = Omit, 'path' | 'verb'>
+
+export const useOpLogout = (props: UseOpLogoutProps) =>
+ useMutate('POST', `/logout`, { base: getConfig('api/v1'), ...props })
+
+export interface ListPluginsQueryParams {
+ /**
+ * The page to return.
+ */
+ page?: number
+ /**
+ * The maximum number of results to return.
+ */
+ limit?: number
+ /**
+ * The substring which is used to filter the plugins by their name.
+ */
+ query?: string
+}
+
+export type ListPluginsProps = Omit, 'path'>
+
+export const ListPlugins = (props: ListPluginsProps) => (
+
+ path={`/plugins`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseListPluginsProps = Omit, 'path'>
+
+export const useListPlugins = (props: UseListPluginsProps) =>
+ useGet(`/plugins`, {
+ base: getConfig('api/v1'),
+ ...props
+ })
+
+export interface ListPrincipalsQueryParams {
+ /**
+ * The substring by which the principals are filtered.
+ */
+ query?: string
+ /**
+ * The page to return.
+ */
+ page?: number
+ /**
+ * The maximum number of results to return.
+ */
+ limit?: number
+ /**
+ * The types of principals to include.
+ */
+ type?: ('service' | 'serviceaccount' | 'user')[]
+}
+
+export type ListPrincipalsProps = Omit<
+ GetProps,
+ 'path'
+>
+
+export const ListPrincipals = (props: ListPrincipalsProps) => (
+
+ path={`/principals`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseListPrincipalsProps = Omit<
+ UseGetProps,
+ 'path'
+>
+
+export const useListPrincipals = (props: UseListPrincipalsProps) =>
+ useGet(`/principals`, {
+ base: getConfig('api/v1'),
+ ...props
+ })
+
+export interface OnRegisterQueryParams {
+ /**
+ * If set to true the token is also returned as a cookie.
+ */
+ include_cookie?: boolean
+}
+
+export type OnRegisterProps = Omit<
+ MutateProps,
+ 'path' | 'verb'
+>
+
+export const OnRegister = (props: OnRegisterProps) => (
+
+ verb="POST"
+ path={`/register`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseOnRegisterProps = Omit<
+ UseMutateProps,
+ 'path' | 'verb'
+>
+
+export const useOnRegister = (props: UseOnRegisterProps) =>
+ useMutate(
+ 'POST',
+ `/register`,
+ { base: getConfig('api/v1'), ...props }
+ )
+
+export interface CreateRepositoryQueryParams {
+ /**
+ * path of parent space (Not needed in standalone).
+ */
+ space_path?: string
+}
+
+export type CreateRepositoryProps = Omit<
+ MutateProps,
+ 'path' | 'verb'
+>
+
+export const CreateRepository = (props: CreateRepositoryProps) => (
+
+ verb="POST"
+ path={`/repos`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseCreateRepositoryProps = Omit<
+ UseMutateProps<
+ RepoRepositoryOutput,
+ UsererrorError,
+ CreateRepositoryQueryParams,
+ OpenapiCreateRepositoryRequest,
+ void
+ >,
+ 'path' | 'verb'
+>
+
+export const useCreateRepository = (props: UseCreateRepositoryProps) =>
+ useMutate(
+ 'POST',
+ `/repos`,
+ { base: getConfig('api/v1'), ...props }
+ )
+
+export type DeleteRepositoryProps = Omit<
+ MutateProps,
+ 'path' | 'verb'
+>
+
+export const DeleteRepository = (props: DeleteRepositoryProps) => (
+
+ verb="DELETE"
+ path={`/repos`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseDeleteRepositoryProps = Omit<
+ UseMutateProps,
+ 'path' | 'verb'
+>
+
+export const useDeleteRepository = (props: UseDeleteRepositoryProps) =>
+ useMutate('DELETE', `/repos`, {
+ base: getConfig('api/v1'),
+ ...props
+ })
+
+export interface FindRepositoryPathParams {
+ repo_ref: string
+}
+
+export type FindRepositoryProps = Omit<
+ GetProps,
+ 'path'
+> &
+ FindRepositoryPathParams
+
+export const FindRepository = ({ repo_ref, ...props }: FindRepositoryProps) => (
+
+ path={`/repos/${repo_ref}`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseFindRepositoryProps = Omit<
+ UseGetProps,
+ 'path'
+> &
+ FindRepositoryPathParams
+
+export const useFindRepository = ({ repo_ref, ...props }: UseFindRepositoryProps) =>
+ useGet(
+ (paramsInPath: FindRepositoryPathParams) => `/repos/${paramsInPath.repo_ref}`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref }, ...props }
+ )
+
+export interface UpdateRepositoryPathParams {
+ repo_ref: string
+}
+
+export type UpdateRepositoryProps = Omit<
+ MutateProps,
+ 'path' | 'verb'
+> &
+ UpdateRepositoryPathParams
+
+export const UpdateRepository = ({ repo_ref, ...props }: UpdateRepositoryProps) => (
+
+ verb="PATCH"
+ path={`/repos/${repo_ref}`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseUpdateRepositoryProps = Omit<
+ UseMutateProps,
+ 'path' | 'verb'
+> &
+ UpdateRepositoryPathParams
+
+export const useUpdateRepository = ({ repo_ref, ...props }: UseUpdateRepositoryProps) =>
+ useMutate(
+ 'PATCH',
+ (paramsInPath: UpdateRepositoryPathParams) => `/repos/${paramsInPath.repo_ref}`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref }, ...props }
+ )
+
+export interface ArchiveQueryParams {
+ /**
+ * Without an optional path parameter, all files and subdirectories of the current working directory are included in the archive. If one or more paths are specified, only these are included.
+ */
+ path?: string[]
+ /**
+ * Prepend / to paths in the archive.
+ */
+ prefix?: string
+ /**
+ * Look for attributes in .gitattributes files in the working tree as well
+ */
+ attributes?: string
+ /**
+ * Set modification time of archive entries. Without this option the committer time is used if is a commit or tag, and the current time if it is a tree.
+ */
+ time?: string
+ /**
+ * Specify compression level. Larger values allow the command to spend more time to compress to smaller size.
+ */
+ compression?: number
+}
+
+export interface ArchivePathParams {
+ repo_ref: string
+ git_ref: string
+ format: string
+}
+
+export type ArchiveProps = Omit, 'path'> &
+ ArchivePathParams
+
+export const Archive = ({ repo_ref, git_ref, format, ...props }: ArchiveProps) => (
+
+ path={`/repos/${repo_ref}/archive/${git_ref}.${format}`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseArchiveProps = Omit, 'path'> &
+ ArchivePathParams
+
+export const useArchive = ({ repo_ref, git_ref, format, ...props }: UseArchiveProps) =>
+ useGet(
+ (paramsInPath: ArchivePathParams) =>
+ `/repos/${paramsInPath.repo_ref}/archive/${paramsInPath.git_ref}.${paramsInPath.format}`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref, git_ref, format }, ...props }
+ )
+
+export interface GetBlameQueryParams {
+ /**
+ * 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
+ /**
+ * Line number from which the file data is considered
+ */
+ line_from?: number
+ /**
+ * Line number to which the file data is considered
+ */
+ line_to?: number
+}
+
+export interface GetBlamePathParams {
+ repo_ref: string
+ path: string
+}
+
+export type GetBlameProps = Omit<
+ GetProps,
+ 'path'
+> &
+ GetBlamePathParams
+
+export const GetBlame = ({ repo_ref, path, ...props }: GetBlameProps) => (
+
+ path={`/repos/${repo_ref}/blame/${path}`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseGetBlameProps = Omit<
+ UseGetProps,
+ 'path'
+> &
+ GetBlamePathParams
+
+export const useGetBlame = ({ repo_ref, path, ...props }: UseGetBlameProps) =>
+ useGet(
+ (paramsInPath: GetBlamePathParams) => `/repos/${paramsInPath.repo_ref}/blame/${paramsInPath.path}`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref, path }, ...props }
+ )
+
+export interface ListBranchesQueryParams {
+ /**
+ * Indicates whether optional commit information should be included in the response.
+ */
+ include_commit?: boolean
+ /**
+ * The substring by which the branches are filtered.
+ */
+ query?: string
+ /**
+ * The order of the output.
+ */
+ order?: 'asc' | 'desc'
+ /**
+ * The data by which the branches are sorted.
+ */
+ sort?: 'name' | 'date'
+ /**
+ * The page to return.
+ */
+ page?: number
+ /**
+ * The maximum number of results to return.
+ */
+ limit?: number
+}
+
+export interface ListBranchesPathParams {
+ repo_ref: string
+}
+
+export type ListBranchesProps = Omit<
+ GetProps,
+ 'path'
+> &
+ ListBranchesPathParams
+
+export const ListBranches = ({ repo_ref, ...props }: ListBranchesProps) => (
+
+ path={`/repos/${repo_ref}/branches`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseListBranchesProps = Omit<
+ UseGetProps,
+ 'path'
+> &
+ ListBranchesPathParams
+
+export const useListBranches = ({ repo_ref, ...props }: UseListBranchesProps) =>
+ useGet(
+ (paramsInPath: ListBranchesPathParams) => `/repos/${paramsInPath.repo_ref}/branches`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref }, ...props }
+ )
+
+export interface CreateBranchPathParams {
+ repo_ref: string
+}
+
+export type CreateBranchProps = Omit<
+ MutateProps<
+ RepoBranch,
+ UsererrorError | TypesRulesViolations,
+ void,
+ OpenapiCreateBranchRequest,
+ CreateBranchPathParams
+ >,
+ 'path' | 'verb'
+> &
+ CreateBranchPathParams
+
+export const CreateBranch = ({ repo_ref, ...props }: CreateBranchProps) => (
+
+ verb="POST"
+ path={`/repos/${repo_ref}/branches`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseCreateBranchProps = Omit<
+ UseMutateProps<
+ RepoBranch,
+ UsererrorError | TypesRulesViolations,
+ void,
+ OpenapiCreateBranchRequest,
+ CreateBranchPathParams
+ >,
+ 'path' | 'verb'
+> &
+ CreateBranchPathParams
+
+export const useCreateBranch = ({ repo_ref, ...props }: UseCreateBranchProps) =>
+ useMutate<
+ RepoBranch,
+ UsererrorError | TypesRulesViolations,
+ void,
+ OpenapiCreateBranchRequest,
+ CreateBranchPathParams
+ >('POST', (paramsInPath: CreateBranchPathParams) => `/repos/${paramsInPath.repo_ref}/branches`, {
+ base: getConfig('api/v1'),
+ pathParams: { repo_ref },
+ ...props
+ })
+
+export interface DeleteBranchQueryParams {
+ /**
+ * Bypass rule violations if possible.
+ */
+ bypass_rules?: boolean
+}
+
+export interface DeleteBranchPathParams {
+ repo_ref: string
+}
+
+export type DeleteBranchProps = Omit<
+ MutateProps,
+ 'path' | 'verb'
+> &
+ DeleteBranchPathParams
+
+export const DeleteBranch = ({ repo_ref, ...props }: DeleteBranchProps) => (
+
+ verb="DELETE"
+ path={`/repos/${repo_ref}/branches`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseDeleteBranchProps = Omit<
+ UseMutateProps,
+ 'path' | 'verb'
+> &
+ DeleteBranchPathParams
+
+export const useDeleteBranch = ({ repo_ref, ...props }: UseDeleteBranchProps) =>
+ useMutate(
+ 'DELETE',
+ (paramsInPath: DeleteBranchPathParams) => `/repos/${paramsInPath.repo_ref}/branches`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref }, ...props }
+ )
+
+export interface GetBranchPathParams {
+ repo_ref: string
+ branch_name: string
+}
+
+export type GetBranchProps = Omit, 'path'> &
+ GetBranchPathParams
+
+export const GetBranch = ({ repo_ref, branch_name, ...props }: GetBranchProps) => (
+
+ path={`/repos/${repo_ref}/branches/${branch_name}`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseGetBranchProps = Omit, 'path'> &
+ GetBranchPathParams
+
+export const useGetBranch = ({ repo_ref, branch_name, ...props }: UseGetBranchProps) =>
+ useGet(
+ (paramsInPath: GetBranchPathParams) => `/repos/${paramsInPath.repo_ref}/branches/${paramsInPath.branch_name}`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref, branch_name }, ...props }
+ )
+
+export interface ListStatusCheckResultsQueryParams {
+ /**
+ * The page to return.
+ */
+ page?: number
+ /**
+ * The maximum number of results to return.
+ */
+ limit?: number
+ /**
+ * The substring which is used to filter the status checks by their Identifier.
+ */
+ query?: string
+}
+
+export interface ListStatusCheckResultsPathParams {
+ repo_ref: string
+ commit_sha: string
+}
+
+export type ListStatusCheckResultsProps = Omit<
+ GetProps,
+ 'path'
+> &
+ ListStatusCheckResultsPathParams
+
+export const ListStatusCheckResults = ({ repo_ref, commit_sha, ...props }: ListStatusCheckResultsProps) => (
+
+ path={`/repos/${repo_ref}/checks/commits/${commit_sha}`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseListStatusCheckResultsProps = Omit<
+ UseGetProps,
+ 'path'
+> &
+ ListStatusCheckResultsPathParams
+
+export const useListStatusCheckResults = ({ repo_ref, commit_sha, ...props }: UseListStatusCheckResultsProps) =>
+ useGet(
+ (paramsInPath: ListStatusCheckResultsPathParams) =>
+ `/repos/${paramsInPath.repo_ref}/checks/commits/${paramsInPath.commit_sha}`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref, commit_sha }, ...props }
+ )
+
+export interface ReportStatusCheckResultsPathParams {
+ repo_ref: string
+ commit_sha: string
+}
+
+export interface ReportStatusCheckResultsRequestBody {
+ check_uid?: string
+ ended?: number
+ identifier?: string
+ link?: string
+ payload?: TypesCheckPayload
+ started?: number
+ status?: EnumCheckStatus
+ summary?: string
+}
+
+export type ReportStatusCheckResultsProps = Omit<
+ MutateProps<
+ TypesCheck,
+ UsererrorError,
+ void,
+ ReportStatusCheckResultsRequestBody,
+ ReportStatusCheckResultsPathParams
+ >,
+ 'path' | 'verb'
+> &
+ ReportStatusCheckResultsPathParams
+
+export const ReportStatusCheckResults = ({ repo_ref, commit_sha, ...props }: ReportStatusCheckResultsProps) => (
+
+ verb="PUT"
+ path={`/repos/${repo_ref}/checks/commits/${commit_sha}`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseReportStatusCheckResultsProps = Omit<
+ UseMutateProps<
+ TypesCheck,
+ UsererrorError,
+ void,
+ ReportStatusCheckResultsRequestBody,
+ ReportStatusCheckResultsPathParams
+ >,
+ 'path' | 'verb'
+> &
+ ReportStatusCheckResultsPathParams
+
+export const useReportStatusCheckResults = ({ repo_ref, commit_sha, ...props }: UseReportStatusCheckResultsProps) =>
+ useMutate(
+ 'PUT',
+ (paramsInPath: ReportStatusCheckResultsPathParams) =>
+ `/repos/${paramsInPath.repo_ref}/checks/commits/${paramsInPath.commit_sha}`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref, commit_sha }, ...props }
+ )
+
+export interface ListStatusCheckRecentQueryParams {
+ /**
+ * The substring which is used to filter the status checks by their Identifier.
+ */
+ query?: string
+ /**
+ * The timestamp (in Unix time millis) since the status checks have been run.
+ */
+ since?: number
+}
+
+export interface ListStatusCheckRecentPathParams {
+ repo_ref: string
+}
+
+export type ListStatusCheckRecentProps = Omit<
+ GetProps,
+ 'path'
+> &
+ ListStatusCheckRecentPathParams
+
+export const ListStatusCheckRecent = ({ repo_ref, ...props }: ListStatusCheckRecentProps) => (
+
+ path={`/repos/${repo_ref}/checks/recent`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseListStatusCheckRecentProps = Omit<
+ UseGetProps,
+ 'path'
+> &
+ ListStatusCheckRecentPathParams
+
+export const useListStatusCheckRecent = ({ repo_ref, ...props }: UseListStatusCheckRecentProps) =>
+ useGet(
+ (paramsInPath: ListStatusCheckRecentPathParams) => `/repos/${paramsInPath.repo_ref}/checks/recent`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref }, ...props }
+ )
+
+export interface CodeOwnersValidateQueryParams {
+ /**
+ * 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 CodeOwnersValidatePathParams {
+ repo_ref: string
+}
+
+export type CodeOwnersValidateProps = Omit<
+ GetProps,
+ 'path'
+> &
+ CodeOwnersValidatePathParams
+
+export const CodeOwnersValidate = ({ repo_ref, ...props }: CodeOwnersValidateProps) => (
+
+ path={`/repos/${repo_ref}/codeowners/validate`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseCodeOwnersValidateProps = Omit<
+ UseGetProps,
+ 'path'
+> &
+ CodeOwnersValidatePathParams
+
+export const useCodeOwnersValidate = ({ repo_ref, ...props }: UseCodeOwnersValidateProps) =>
+ useGet(
+ (paramsInPath: CodeOwnersValidatePathParams) => `/repos/${paramsInPath.repo_ref}/codeowners/validate`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref }, ...props }
+ )
+
+export interface ListCommitsQueryParams {
+ /**
+ * The git reference (branch / tag / commitID) that will be used to retrieve the data. If no value is provided the default branch of the repository is used.
+ */
+ git_ref?: string
+ /**
+ * The result should only contain commits that occurred after the provided reference.
+ */
+ after?: string
+ /**
+ * Path for which commit information should be retrieved
+ */
+ path?: string
+ /**
+ * Epoch since when commit information should be retrieved.
+ */
+ since?: number
+ /**
+ * Epoch until when commit information should be retrieved.
+ */
+ until?: number
+ /**
+ * Committer pattern for which commit information should be retrieved.
+ */
+ committer?: string
+ /**
+ * The page to return.
+ */
+ page?: number
+ /**
+ * The maximum number of results to return.
+ */
+ limit?: number
+ /**
+ * Indicates whether optional stats should be included in the response.
+ */
+ include_stats?: boolean
+}
+
+export interface ListCommitsPathParams {
+ repo_ref: string
+}
+
+export type ListCommitsProps = Omit<
+ GetProps,
+ 'path'
+> &
+ ListCommitsPathParams
+
+export const ListCommits = ({ repo_ref, ...props }: ListCommitsProps) => (
+
+ path={`/repos/${repo_ref}/commits`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseListCommitsProps = Omit<
+ UseGetProps,
+ 'path'
+> &
+ ListCommitsPathParams
+
+export const useListCommits = ({ repo_ref, ...props }: UseListCommitsProps) =>
+ useGet(
+ (paramsInPath: ListCommitsPathParams) => `/repos/${paramsInPath.repo_ref}/commits`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref }, ...props }
+ )
+
+export interface CommitFilesPathParams {
+ repo_ref: string
+}
+
+export type CommitFilesProps = Omit<
+ MutateProps<
+ TypesCommitFilesResponse,
+ UsererrorError | TypesRulesViolations,
+ void,
+ OpenapiCommitFilesRequest,
+ CommitFilesPathParams
+ >,
+ 'path' | 'verb'
+> &
+ CommitFilesPathParams
+
+export const CommitFiles = ({ repo_ref, ...props }: CommitFilesProps) => (
+
+ verb="POST"
+ path={`/repos/${repo_ref}/commits`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseCommitFilesProps = Omit<
+ UseMutateProps<
+ TypesCommitFilesResponse,
+ UsererrorError | TypesRulesViolations,
+ void,
+ OpenapiCommitFilesRequest,
+ CommitFilesPathParams
+ >,
+ 'path' | 'verb'
+> &
+ CommitFilesPathParams
+
+export const useCommitFiles = ({ repo_ref, ...props }: UseCommitFilesProps) =>
+ useMutate<
+ TypesCommitFilesResponse,
+ UsererrorError | TypesRulesViolations,
+ void,
+ OpenapiCommitFilesRequest,
+ CommitFilesPathParams
+ >('POST', (paramsInPath: CommitFilesPathParams) => `/repos/${paramsInPath.repo_ref}/commits`, {
+ base: getConfig('api/v1'),
+ pathParams: { repo_ref },
+ ...props
+ })
+
+export interface GetCommitPathParams {
+ repo_ref: string
+ commit_sha: string
+}
+
+export type GetCommitProps = Omit, 'path'> &
+ GetCommitPathParams
+
+export const GetCommit = ({ repo_ref, commit_sha, ...props }: GetCommitProps) => (
+
+ path={`/repos/${repo_ref}/commits/${commit_sha}`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseGetCommitProps = Omit, 'path'> &
+ GetCommitPathParams
+
+export const useGetCommit = ({ repo_ref, commit_sha, ...props }: UseGetCommitProps) =>
+ useGet(
+ (paramsInPath: GetCommitPathParams) => `/repos/${paramsInPath.repo_ref}/commits/${paramsInPath.commit_sha}`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref, commit_sha }, ...props }
+ )
+
+export interface GetCommitDiffPathParams {
+ repo_ref: string
+ commit_sha: string
+}
+
+export type GetCommitDiffProps = Omit, 'path'> &
+ GetCommitDiffPathParams
+
+export const GetCommitDiff = ({ repo_ref, commit_sha, ...props }: GetCommitDiffProps) => (
+
+ path={`/repos/${repo_ref}/commits/${commit_sha}/diff`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseGetCommitDiffProps = Omit, 'path'> &
+ GetCommitDiffPathParams
+
+export const useGetCommitDiff = ({ repo_ref, commit_sha, ...props }: UseGetCommitDiffProps) =>
+ useGet(
+ (paramsInPath: GetCommitDiffPathParams) =>
+ `/repos/${paramsInPath.repo_ref}/commits/${paramsInPath.commit_sha}/diff`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref, commit_sha }, ...props }
+ )
+
+export interface CalculateCommitDivergencePathParams {
+ repo_ref: string
+}
+
+export type CalculateCommitDivergenceProps = Omit<
+ MutateProps<
+ RepoCommitDivergence[],
+ UsererrorError,
+ void,
+ OpenapiCalculateCommitDivergenceRequest,
+ CalculateCommitDivergencePathParams
+ >,
+ 'path' | 'verb'
+> &
+ CalculateCommitDivergencePathParams
+
+export const CalculateCommitDivergence = ({ repo_ref, ...props }: CalculateCommitDivergenceProps) => (
+
+ verb="POST"
+ path={`/repos/${repo_ref}/commits/calculate-divergence`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseCalculateCommitDivergenceProps = Omit<
+ UseMutateProps<
+ RepoCommitDivergence[],
+ UsererrorError,
+ void,
+ OpenapiCalculateCommitDivergenceRequest,
+ CalculateCommitDivergencePathParams
+ >,
+ 'path' | 'verb'
+> &
+ CalculateCommitDivergencePathParams
+
+export const useCalculateCommitDivergence = ({ repo_ref, ...props }: UseCalculateCommitDivergenceProps) =>
+ useMutate<
+ RepoCommitDivergence[],
+ UsererrorError,
+ void,
+ OpenapiCalculateCommitDivergenceRequest,
+ CalculateCommitDivergencePathParams
+ >(
+ 'POST',
+ (paramsInPath: CalculateCommitDivergencePathParams) =>
+ `/repos/${paramsInPath.repo_ref}/commits/calculate-divergence`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref }, ...props }
+ )
+
+export interface GetContentQueryParams {
+ /**
+ * The git reference (branch / tag / commitID) that will be used to retrieve the data. If no value is provided the default branch of the repository is used.
+ */
+ git_ref?: string
+ /**
+ * Indicates whether optional commit information should be included in the response.
+ */
+ include_commit?: boolean
+}
+
+export interface GetContentPathParams {
+ repo_ref: string
+ path: string
+}
+
+export type GetContentProps = Omit<
+ GetProps,
+ 'path'
+> &
+ GetContentPathParams
+
+export const GetContent = ({ repo_ref, path, ...props }: GetContentProps) => (
+
+ path={`/repos/${repo_ref}/content/${path}`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseGetContentProps = Omit<
+ UseGetProps,
+ 'path'
+> &
+ GetContentPathParams
+
+export const useGetContent = ({ repo_ref, path, ...props }: UseGetContentProps) =>
+ useGet(
+ (paramsInPath: GetContentPathParams) => `/repos/${paramsInPath.repo_ref}/content/${paramsInPath.path}`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref, path }, ...props }
+ )
+
+export interface DiffStatsQueryParams {
+ /**
+ * provide path for diff operation
+ */
+ path?: string[]
+}
+
+export interface DiffStatsPathParams {
+ repo_ref: string
+ range: string
+}
+
+export type DiffStatsProps = Omit<
+ GetProps,
+ 'path'
+> &
+ DiffStatsPathParams
+
+export const DiffStats = ({ repo_ref, range, ...props }: DiffStatsProps) => (
+
+ path={`/repos/${repo_ref}/diff-stats/${range}`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseDiffStatsProps = Omit<
+ UseGetProps,
+ 'path'
+> &
+ DiffStatsPathParams
+
+export const useDiffStats = ({ repo_ref, range, ...props }: UseDiffStatsProps) =>
+ useGet(
+ (paramsInPath: DiffStatsPathParams) => `/repos/${paramsInPath.repo_ref}/diff-stats/${paramsInPath.range}`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref, range }, ...props }
+ )
+
+export interface RawDiffQueryParams {
+ /**
+ * provide path for diff operation
+ */
+ path?: string[]
+}
+
+export interface RawDiffPathParams {
+ repo_ref: string
+ range: string
+}
+
+export type RawDiffProps = Omit<
+ GetProps,
+ 'path'
+> &
+ RawDiffPathParams
+
+export const RawDiff = ({ repo_ref, range, ...props }: RawDiffProps) => (
+
+ path={`/repos/${repo_ref}/diff/${range}`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseRawDiffProps = Omit<
+ UseGetProps,
+ 'path'
+> &
+ RawDiffPathParams
+
+export const useRawDiff = ({ repo_ref, range, ...props }: UseRawDiffProps) =>
+ useGet(
+ (paramsInPath: RawDiffPathParams) => `/repos/${paramsInPath.repo_ref}/diff/${paramsInPath.range}`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref, range }, ...props }
+ )
+
+export interface RawDiffPostPathParams {
+ repo_ref: string
+ range: string
+}
+
+export type RawDiffPostProps = Omit<
+ MutateProps,
+ 'path' | 'verb'
+> &
+ RawDiffPostPathParams
+
+export const RawDiffPost = ({ repo_ref, range, ...props }: RawDiffPostProps) => (
+
+ verb="POST"
+ path={`/repos/${repo_ref}/diff/${range}`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseRawDiffPostProps = Omit<
+ UseMutateProps,
+ 'path' | 'verb'
+> &
+ RawDiffPostPathParams
+
+export const useRawDiffPost = ({ repo_ref, range, ...props }: UseRawDiffPostProps) =>
+ useMutate(
+ 'POST',
+ (paramsInPath: RawDiffPostPathParams) => `/repos/${paramsInPath.repo_ref}/diff/${paramsInPath.range}`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref, range }, ...props }
+ )
+
+export interface MergeCheckQueryParams {
+ /**
+ * provide path for diff operation
+ */
+ path?: string[]
+}
+
+export interface MergeCheckPathParams {
+ repo_ref: string
+ range: string
+}
+
+export type MergeCheckProps = Omit<
+ MutateProps,
+ 'path' | 'verb'
+> &
+ MergeCheckPathParams
+
+export const MergeCheck = ({ repo_ref, range, ...props }: MergeCheckProps) => (
+
+ verb="POST"
+ path={`/repos/${repo_ref}/merge-check/${range}`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseMergeCheckProps = Omit<
+ UseMutateProps,
+ 'path' | 'verb'
+> &
+ MergeCheckPathParams
+
+export const useMergeCheck = ({ repo_ref, range, ...props }: UseMergeCheckProps) =>
+ useMutate(
+ 'POST',
+ (paramsInPath: MergeCheckPathParams) => `/repos/${paramsInPath.repo_ref}/merge-check/${paramsInPath.range}`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref, range }, ...props }
+ )
+
+export interface MoveRepositoryPathParams {
+ repo_ref: string
+}
+
+export type MoveRepositoryProps = Omit<
+ MutateProps,
+ 'path' | 'verb'
+> &
+ MoveRepositoryPathParams
+
+export const MoveRepository = ({ repo_ref, ...props }: MoveRepositoryProps) => (
+
+ verb="POST"
+ path={`/repos/${repo_ref}/move`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseMoveRepositoryProps = Omit<
+ UseMutateProps,
+ 'path' | 'verb'
+> &
+ MoveRepositoryPathParams
+
+export const useMoveRepository = ({ repo_ref, ...props }: UseMoveRepositoryProps) =>
+ useMutate(
+ 'POST',
+ (paramsInPath: MoveRepositoryPathParams) => `/repos/${paramsInPath.repo_ref}/move`,
+ { base: getConfig('api/v1'), 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('api/v1')}
+ {...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('api/v1'),
+ pathParams: { repo_ref },
+ ...props
+ })
+
+export interface ListPathsQueryParams {
+ /**
+ * The git reference (branch / tag / commitID) that will be used to retrieve the data. If no value is provided the default branch of the repository is used.
+ */
+ git_ref?: string
+ /**
+ * Indicates whether directories should be included in the response.
+ */
+ include_directories?: boolean
+}
+
+export interface ListPathsPathParams {
+ repo_ref: string
+}
+
+export type ListPathsProps = Omit<
+ GetProps,
+ 'path'
+> &
+ ListPathsPathParams
+
+export const ListPaths = ({ repo_ref, ...props }: ListPathsProps) => (
+
+ path={`/repos/${repo_ref}/paths`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseListPathsProps = Omit<
+ UseGetProps,
+ 'path'
+> &
+ ListPathsPathParams
+
+export const useListPaths = ({ repo_ref, ...props }: UseListPathsProps) =>
+ useGet(
+ (paramsInPath: ListPathsPathParams) => `/repos/${paramsInPath.repo_ref}/paths`,
+ { base: getConfig('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
+ /**
+ * Whether to fetch latest build information for each pipeline.
+ */
+ latest?: boolean
+}
+
+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('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('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('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('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('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('api/v1'), pathParams: { repo_ref }, ...props }
+ )
+
+export interface FindPipelinePathParams {
+ repo_ref: string
+ pipeline_identifier: string
+}
+
+export type FindPipelineProps = Omit, 'path'> &
+ FindPipelinePathParams
+
+export const FindPipeline = ({ repo_ref, pipeline_identifier, ...props }: FindPipelineProps) => (
+
+ path={`/repos/${repo_ref}/pipelines/${pipeline_identifier}`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseFindPipelineProps = Omit<
+ UseGetProps,
+ 'path'
+> &
+ FindPipelinePathParams
+
+export const useFindPipeline = ({ repo_ref, pipeline_identifier, ...props }: UseFindPipelineProps) =>
+ useGet(
+ (paramsInPath: FindPipelinePathParams) =>
+ `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_identifier}`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref, pipeline_identifier }, ...props }
+ )
+
+export interface UpdatePipelinePathParams {
+ repo_ref: string
+ pipeline_identifier: string
+}
+
+export type UpdatePipelineProps = Omit<
+ MutateProps,
+ 'path' | 'verb'
+> &
+ UpdatePipelinePathParams
+
+export const UpdatePipeline = ({ repo_ref, pipeline_identifier, ...props }: UpdatePipelineProps) => (
+
+ verb="PATCH"
+ path={`/repos/${repo_ref}/pipelines/${pipeline_identifier}`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseUpdatePipelineProps = Omit<
+ UseMutateProps,
+ 'path' | 'verb'
+> &
+ UpdatePipelinePathParams
+
+export const useUpdatePipeline = ({ repo_ref, pipeline_identifier, ...props }: UseUpdatePipelineProps) =>
+ useMutate(
+ 'PATCH',
+ (paramsInPath: UpdatePipelinePathParams) =>
+ `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_identifier}`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref, pipeline_identifier }, ...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_identifier: string
+}
+
+export type ListExecutionsProps = Omit<
+ GetProps,
+ 'path'
+> &
+ ListExecutionsPathParams
+
+export const ListExecutions = ({ repo_ref, pipeline_identifier, ...props }: ListExecutionsProps) => (
+
+ path={`/repos/${repo_ref}/pipelines/${pipeline_identifier}/executions`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseListExecutionsProps = Omit<
+ UseGetProps,
+ 'path'
+> &
+ ListExecutionsPathParams
+
+export const useListExecutions = ({ repo_ref, pipeline_identifier, ...props }: UseListExecutionsProps) =>
+ useGet(
+ (paramsInPath: ListExecutionsPathParams) =>
+ `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_identifier}/executions`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref, pipeline_identifier }, ...props }
+ )
+
+export interface CreateExecutionQueryParams {
+ /**
+ * Branch to run the execution for.
+ */
+ branch?: string
+}
+
+export interface CreateExecutionPathParams {
+ repo_ref: string
+ pipeline_identifier: string
+}
+
+export type CreateExecutionProps = Omit<
+ MutateProps,
+ 'path' | 'verb'
+> &
+ CreateExecutionPathParams
+
+export const CreateExecution = ({ repo_ref, pipeline_identifier, ...props }: CreateExecutionProps) => (
+
+ verb="POST"
+ path={`/repos/${repo_ref}/pipelines/${pipeline_identifier}/executions`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseCreateExecutionProps = Omit<
+ UseMutateProps,
+ 'path' | 'verb'
+> &
+ CreateExecutionPathParams
+
+export const useCreateExecution = ({ repo_ref, pipeline_identifier, ...props }: UseCreateExecutionProps) =>
+ useMutate(
+ 'POST',
+ (paramsInPath: CreateExecutionPathParams) =>
+ `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_identifier}/executions`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref, pipeline_identifier }, ...props }
+ )
+
+export interface DeleteExecutionPathParams {
+ repo_ref: string
+ pipeline_identifier: string
+}
+
+export type DeleteExecutionProps = Omit<
+ MutateProps,
+ 'path' | 'verb'
+> &
+ DeleteExecutionPathParams
+
+export const DeleteExecution = ({ repo_ref, pipeline_identifier, ...props }: DeleteExecutionProps) => (
+
+ verb="DELETE"
+ path={`/repos/${repo_ref}/pipelines/${pipeline_identifier}/executions`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseDeleteExecutionProps = Omit<
+ UseMutateProps,
+ 'path' | 'verb'
+> &
+ DeleteExecutionPathParams
+
+export const useDeleteExecution = ({ repo_ref, pipeline_identifier, ...props }: UseDeleteExecutionProps) =>
+ useMutate(
+ 'DELETE',
+ (paramsInPath: DeleteExecutionPathParams) =>
+ `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_identifier}/executions`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref, pipeline_identifier }, ...props }
+ )
+
+export interface FindExecutionPathParams {
+ repo_ref: string
+ pipeline_identifier: string
+ execution_number: string
+}
+
+export type FindExecutionProps = Omit, 'path'> &
+ FindExecutionPathParams
+
+export const FindExecution = ({ repo_ref, pipeline_identifier, execution_number, ...props }: FindExecutionProps) => (
+
+ path={`/repos/${repo_ref}/pipelines/${pipeline_identifier}/executions/${execution_number}`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseFindExecutionProps = Omit<
+ UseGetProps,
+ 'path'
+> &
+ FindExecutionPathParams
+
+export const useFindExecution = ({
+ repo_ref,
+ pipeline_identifier,
+ execution_number,
+ ...props
+}: UseFindExecutionProps) =>
+ useGet(
+ (paramsInPath: FindExecutionPathParams) =>
+ `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_identifier}/executions/${paramsInPath.execution_number}`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref, pipeline_identifier, execution_number }, ...props }
+ )
+
+export interface CancelExecutionPathParams {
+ repo_ref: string
+ pipeline_identifier: string
+ execution_number: string
+}
+
+export type CancelExecutionProps = Omit<
+ MutateProps,
+ 'path' | 'verb'
+> &
+ CancelExecutionPathParams
+
+export const CancelExecution = ({
+ repo_ref,
+ pipeline_identifier,
+ execution_number,
+ ...props
+}: CancelExecutionProps) => (
+
+ verb="POST"
+ path={`/repos/${repo_ref}/pipelines/${pipeline_identifier}/executions/${execution_number}/cancel`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseCancelExecutionProps = Omit<
+ UseMutateProps,
+ 'path' | 'verb'
+> &
+ CancelExecutionPathParams
+
+export const useCancelExecution = ({
+ repo_ref,
+ pipeline_identifier,
+ execution_number,
+ ...props
+}: UseCancelExecutionProps) =>
+ useMutate(
+ 'POST',
+ (paramsInPath: CancelExecutionPathParams) =>
+ `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_identifier}/executions/${paramsInPath.execution_number}/cancel`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref, pipeline_identifier, execution_number }, ...props }
+ )
+
+export interface ViewLogsPathParams {
+ repo_ref: string
+ pipeline_identifier: string
+ execution_number: string
+ stage_number: string
+ step_number: string
+}
+
+export type ViewLogsProps = Omit, 'path'> &
+ ViewLogsPathParams
+
+export const ViewLogs = ({
+ repo_ref,
+ pipeline_identifier,
+ execution_number,
+ stage_number,
+ step_number,
+ ...props
+}: ViewLogsProps) => (
+
+ path={`/repos/${repo_ref}/pipelines/${pipeline_identifier}/executions/${execution_number}/logs/${stage_number}/${step_number}`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseViewLogsProps = Omit, 'path'> &
+ ViewLogsPathParams
+
+export const useViewLogs = ({
+ repo_ref,
+ pipeline_identifier,
+ execution_number,
+ stage_number,
+ step_number,
+ ...props
+}: UseViewLogsProps) =>
+ useGet(
+ (paramsInPath: ViewLogsPathParams) =>
+ `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_identifier}/executions/${paramsInPath.execution_number}/logs/${paramsInPath.stage_number}/${paramsInPath.step_number}`,
+ {
+ base: getConfig('api/v1'),
+ pathParams: { repo_ref, pipeline_identifier, 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_identifier: string
+}
+
+export type ListTriggersProps = Omit<
+ GetProps,
+ 'path'
+> &
+ ListTriggersPathParams
+
+export const ListTriggers = ({ repo_ref, pipeline_identifier, ...props }: ListTriggersProps) => (
+
+ path={`/repos/${repo_ref}/pipelines/${pipeline_identifier}/triggers`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseListTriggersProps = Omit<
+ UseGetProps,
+ 'path'
+> &
+ ListTriggersPathParams
+
+export const useListTriggers = ({ repo_ref, pipeline_identifier, ...props }: UseListTriggersProps) =>
+ useGet(
+ (paramsInPath: ListTriggersPathParams) =>
+ `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_identifier}/triggers`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref, pipeline_identifier }, ...props }
+ )
+
+export interface CreateTriggerPathParams {
+ repo_ref: string
+ pipeline_identifier: string
+}
+
+export type CreateTriggerProps = Omit<
+ MutateProps,
+ 'path' | 'verb'
+> &
+ CreateTriggerPathParams
+
+export const CreateTrigger = ({ repo_ref, pipeline_identifier, ...props }: CreateTriggerProps) => (
+
+ verb="POST"
+ path={`/repos/${repo_ref}/pipelines/${pipeline_identifier}/triggers`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseCreateTriggerProps = Omit<
+ UseMutateProps,
+ 'path' | 'verb'
+> &
+ CreateTriggerPathParams
+
+export const useCreateTrigger = ({ repo_ref, pipeline_identifier, ...props }: UseCreateTriggerProps) =>
+ useMutate(
+ 'POST',
+ (paramsInPath: CreateTriggerPathParams) =>
+ `/repos/${paramsInPath.repo_ref}/pipelines/${paramsInPath.pipeline_identifier}/triggers`,
+ { base: getConfig('api/v1'), pathParams: { repo_ref, pipeline_identifier }, ...props }
+ )
+
+export interface DeleteTriggerPathParams {
+ repo_ref: string
+ pipeline_identifier: string
+}
+
+export type DeleteTriggerProps = Omit<
+ MutateProps,
+ 'path' | 'verb'
+> &
+ DeleteTriggerPathParams
+
+export const DeleteTrigger = ({ repo_ref, pipeline_identifier, ...props }: DeleteTriggerProps) => (
+
+ verb="DELETE"
+ path={`/repos/${repo_ref}/pipelines/${pipeline_identifier}/triggers`}
+ base={getConfig('api/v1')}
+ {...props}
+ />
+)
+
+export type UseDeleteTriggerProps = Omit<
+ UseMutateProps,
+ 'path' | 'verb'
+> &
+ DeleteTriggerPathParams
+
+export const useDeleteTrigger = ({ repo_ref, pipeline_identifier, ...props }: UseDeleteTriggerProps) =>
+ useMutate