@@ -53,6 +53,58 @@ export interface EnterpriseLicenseResponse {
53
53
} > ;
54
54
}
55
55
56
+
57
+ // Enterprise - Environments API
58
+ // Add these environment interfaces to enterpriseApi.ts
59
+ export interface Environment {
60
+ environmentId : string ;
61
+ environmentType : string ;
62
+ environmentApikey : string ;
63
+ isMaster : boolean ;
64
+ createdAt : string ;
65
+ updatedAt : string ;
66
+ }
67
+
68
+ export interface CreateEnvironmentRequest {
69
+ environmentType : string ;
70
+ environmentApikey ?: string ;
71
+ isMaster ?: boolean ;
72
+ }
73
+
74
+ export interface UpdateEnvironmentRequest {
75
+ environmentId : string ;
76
+ environmentType ?: string ;
77
+ environmentApikey ?: string ;
78
+ isMaster ?: boolean ;
79
+ }
80
+
81
+ // Add these environment API functions to enterpriseApi.ts
82
+ export const getEnvironments = async ( ) => {
83
+ const response = await axios . get ( '/api/plugins/enterprise/environments/list' ) ;
84
+ return response . data ;
85
+ } ;
86
+
87
+ export const getEnvironment = async ( environmentId : string ) => {
88
+ const response = await axios . get ( `/api/plugins/enterprise/environments?environmentId=${ environmentId } ` ) ;
89
+ return response . data ;
90
+ } ;
91
+
92
+ export const createEnvironment = async ( payload : CreateEnvironmentRequest ) => {
93
+ const response = await axios . post ( '/api/plugins/enterprise/environments' , payload ) ;
94
+ return response . data ;
95
+ } ;
96
+
97
+ export const updateEnvironment = async ( payload : UpdateEnvironmentRequest ) => {
98
+ const response = await axios . put ( `/api/plugins/enterprise/environments?environmentId=${ payload . environmentId } ` , payload ) ;
99
+ return response . data ;
100
+ } ;
101
+
102
+ export const deleteEnvironment = async ( environmentId : string ) => {
103
+ const response = await axios . delete ( `/api/plugins/enterprise/environments?environmentId=${ environmentId } ` ) ;
104
+ return response . data ;
105
+ } ;
106
+
107
+
56
108
// Existing functions
57
109
export const getEnterpriseLicense = async ( ) => {
58
110
const response = await axios . get ( '/api/plugins/enterprise/license' ) ;
0 commit comments