Skip to content

Commit a0da25e

Browse files
committed
feat: update version to 1.22.0-beta-5 in package.json and package-lock.json; add external Argo and Flux app types in AIAgent context handling
1 parent 29e793f commit a0da25e

4 files changed

Lines changed: 44 additions & 11 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "1.22.0-beta-4",
3+
"version": "1.22.0-beta-5",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/Constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ export const URLS = {
8080
APP_DEPLOYMNENT_HISTORY: 'deployments',
8181
APP_DETAILS: 'details',
8282
APP_DETAILS_K8: 'k8s-resources', // for V2
83+
EXTERNAL_ARGO_APP: 'eaa',
84+
EXTERNAL_FLUX_APP: 'external-flux',
8385
DETAILS: '/details',
8486
CD_DETAILS: 'cd-details',
8587
APP_TRIGGER: 'trigger',

src/Shared/Providers/MainContextProvider/types.ts

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,48 @@ export enum AIAgentContextSourceType {
5656
RESOURCE_BROWSER_CLUSTER = 'resource-browser-cluster',
5757
}
5858

59+
export type AIAgentAppType =
60+
| 'devtronApp'
61+
| 'devtronHelmChart'
62+
| 'externalHelmChart'
63+
| 'externalArgoApp'
64+
| 'externalFluxApp'
65+
66+
type AIAgentAppDataMasterType = {
67+
appId: number | string
68+
appName: string
69+
envId: number
70+
envName: string
71+
clusterId: number
72+
namespace: string
73+
appType: AIAgentAppType
74+
fluxAppDeploymentType: string
75+
}
76+
77+
type AIAgentAppDataType<TAppType extends AIAgentAppType, TRequiredFields extends keyof AIAgentAppDataMasterType> = Pick<
78+
AIAgentAppDataMasterType,
79+
TRequiredFields
80+
> & {
81+
[K in Exclude<keyof AIAgentAppDataMasterType, TRequiredFields | 'appType'>]?: never
82+
} & {
83+
appType: TAppType
84+
}
85+
5986
export type AIAgentContextType =
6087
| {
6188
source: AIAgentContextSourceType.APP_DETAILS
62-
data: {
63-
appId: number
64-
envId: number
65-
appName: string
66-
envName: string
67-
clusterId: number
68-
appType: 'devtronApp' | 'devtronHelmChart'
69-
} & Record<string, unknown>
89+
data:
90+
| AIAgentAppDataType<
91+
'devtronApp' | 'devtronHelmChart',
92+
'appId' | 'appName' | 'envId' | 'envName' | 'clusterId'
93+
>
94+
| AIAgentAppDataType<'externalHelmChart', 'appId' | 'appName' | 'clusterId' | 'namespace'>
95+
| AIAgentAppDataType<'externalArgoApp', 'appName' | 'clusterId' | 'namespace'>
96+
| (AIAgentAppDataType<
97+
'externalFluxApp',
98+
'appName' | 'clusterId' | 'namespace' | 'fluxAppDeploymentType'
99+
> &
100+
Record<string, unknown>)
70101
}
71102
| {
72103
source: AIAgentContextSourceType.RESOURCE_BROWSER_CLUSTER

0 commit comments

Comments
 (0)