( projectRefOrName: string, slug?: string, name?: string )
| 160 | ): ApiPromise<EnvironmentVariableValue>; |
| 161 | export function retrieve(name: string): ApiPromise<EnvironmentVariableValue>; |
| 162 | export function retrieve( |
| 163 | projectRefOrName: string, |
| 164 | slug?: string, |
| 165 | name?: string |
| 166 | ): ApiPromise<EnvironmentVariableValue> { |
| 167 | let $projectRef: string; |
| 168 | let $slug: string; |
| 169 | let $name: string; |
| 170 | |
| 171 | if (typeof name === "string") { |
| 172 | $projectRef = projectRefOrName; |
| 173 | $slug = slug!; |
| 174 | $name = name; |
| 175 | } else { |
| 176 | $projectRef = taskContext.ctx?.project.ref!; |
| 177 | $slug = taskContext.ctx?.environment.slug!; |
| 178 | $name = projectRefOrName; |
| 179 | } |
| 180 | |
| 181 | if (!$projectRef) { |
| 182 | throw new Error("projectRef is required"); |
| 183 | } |
| 184 | |
| 185 | if (!$slug) { |
| 186 | throw new Error("slug is required"); |
| 187 | } |
| 188 | |
| 189 | const apiClient = apiClientManager.client; |
| 190 | |
| 191 | if (!apiClient) { |
| 192 | throw apiClientMissingError(); |
| 193 | } |
| 194 | |
| 195 | return apiClient.retrieveEnvVar($projectRef, $slug, $name); |
| 196 | } |
| 197 | |
| 198 | export function del( |
| 199 | projectRef: string, |
nothing calls this directly
no test coverage detected
searching dependent graphs…