( projectRefOrName: string, slug?: string, name?: string )
| 202 | ): ApiPromise<EnvironmentVariableResponseBody>; |
| 203 | export function del(name: string): ApiPromise<EnvironmentVariableResponseBody>; |
| 204 | export function del( |
| 205 | projectRefOrName: string, |
| 206 | slug?: string, |
| 207 | name?: string |
| 208 | ): ApiPromise<EnvironmentVariableResponseBody> { |
| 209 | let $projectRef: string; |
| 210 | let $slug: string; |
| 211 | let $name: string; |
| 212 | |
| 213 | if (typeof name === "string") { |
| 214 | $projectRef = projectRefOrName; |
| 215 | $slug = slug!; |
| 216 | $name = name; |
| 217 | } else { |
| 218 | $projectRef = taskContext.ctx?.project.ref!; |
| 219 | $slug = taskContext.ctx?.environment.slug!; |
| 220 | $name = projectRefOrName; |
| 221 | } |
| 222 | |
| 223 | if (!$projectRef) { |
| 224 | throw new Error("projectRef is required"); |
| 225 | } |
| 226 | |
| 227 | if (!$slug) { |
| 228 | throw new Error("slug is required"); |
| 229 | } |
| 230 | |
| 231 | const apiClient = apiClientManager.client; |
| 232 | |
| 233 | if (!apiClient) { |
| 234 | throw apiClientMissingError(); |
| 235 | } |
| 236 | |
| 237 | return apiClient.deleteEnvVar($projectRef, $slug, $name); |
| 238 | } |
| 239 | |
| 240 | export function update( |
| 241 | projectRef: string, |
no test coverage detected