@@ -70,6 +70,85 @@ export declare namespace sandbox {
7070
7171 type SandboxResource = GitRepositoryResource | KodoResource ;
7272
73+ type InjectionConditions = { [ key : string ] : string } ;
74+
75+ interface InjectionMatchOptions {
76+ base_url ?: string ;
77+ baseUrl ?: string ;
78+ if_headers ?: InjectionConditions ;
79+ ifHeaders ?: InjectionConditions ;
80+ if_queries ?: InjectionConditions ;
81+ ifQueries ?: InjectionConditions ;
82+ }
83+
84+ interface InjectionById {
85+ type : 'id' ;
86+ id ?: string ;
87+ ruleID ?: string ;
88+ ruleId ?: string ;
89+ injectionRuleID ?: string ;
90+ }
91+
92+ interface InjectionRuleReference {
93+ injectionRuleID : string ;
94+ }
95+
96+ interface HttpInjection extends InjectionMatchOptions {
97+ type : 'http' ;
98+ headers ?: { [ key : string ] : string } ;
99+ }
100+
101+ interface OpenaiInjection extends InjectionMatchOptions {
102+ type : 'openai' ;
103+ api_key ?: string ;
104+ apiKey ?: string ;
105+ }
106+
107+ interface AnthropicInjection extends InjectionMatchOptions {
108+ type : 'anthropic' ;
109+ api_key ?: string ;
110+ apiKey ?: string ;
111+ }
112+
113+ interface GeminiInjection extends InjectionMatchOptions {
114+ type : 'gemini' ;
115+ api_key ?: string ;
116+ apiKey ?: string ;
117+ }
118+
119+ interface QiniuInjection extends InjectionMatchOptions {
120+ type : 'qiniu' ;
121+ api_key ?: string ;
122+ apiKey ?: string ;
123+ }
124+
125+ interface GithubInjection extends InjectionMatchOptions {
126+ type : 'github' ;
127+ token : string ;
128+ }
129+
130+ type Injection = HttpInjection | OpenaiInjection | AnthropicInjection | GeminiInjection | QiniuInjection | GithubInjection ;
131+ type SandboxInjection = InjectionById | InjectionRuleReference | Injection ;
132+
133+ interface InjectionRule {
134+ ruleID ?: string ;
135+ id ?: string ;
136+ name : string ;
137+ createdAt ?: string | Date ;
138+ updatedAt ?: string | Date ;
139+ injection : Injection ;
140+ }
141+
142+ interface CreateInjectionRuleOptions {
143+ name : string ;
144+ injection : Injection ;
145+ }
146+
147+ interface UpdateInjectionRuleOptions {
148+ name ?: string ;
149+ injection ?: Injection ;
150+ }
151+
73152 interface SandboxCreateOptions extends SandboxClientOptions {
74153 template ?: string ;
75154 templateID ?: string ;
@@ -84,7 +163,7 @@ export declare namespace sandbox {
84163 envVars ?: { [ key : string ] : string } ;
85164 envs ?: { [ key : string ] : string } ;
86165 mcp ?: any ;
87- injections ?: any [ ] ;
166+ injections ?: SandboxInjection [ ] ;
88167 resources ?: SandboxResource [ ] ;
89168 client ?: SandboxClient ;
90169 }
@@ -403,10 +482,10 @@ export declare namespace sandbox {
403482 deleteTemplateTags ( options ?: any ) : Promise < null > ;
404483 getTemplateByAlias ( alias : string ) : Promise < any > ;
405484
406- listInjectionRules ( ) : Promise < any > ;
407- createInjectionRule ( options ?: any ) : Promise < any > ;
408- getInjectionRule ( ruleID : string ) : Promise < any > ;
409- updateInjectionRule ( ruleID : string , options ?: any ) : Promise < any > ;
485+ listInjectionRules ( ) : Promise < InjectionRule [ ] > ;
486+ createInjectionRule ( options : CreateInjectionRuleOptions ) : Promise < InjectionRule > ;
487+ getInjectionRule ( ruleID : string ) : Promise < InjectionRule > ;
488+ updateInjectionRule ( ruleID : string , options : UpdateInjectionRuleOptions ) : Promise < InjectionRule > ;
410489 deleteInjectionRule ( ruleID : string ) : Promise < null > ;
411490
412491 create ( options ?: SandboxCreateOptions ) : Promise < any > ;
0 commit comments