({
projectRef,
env,
}: {
projectRef: string;
env: "dev" | "prod" | "staging";
})
| 122 | } |
| 123 | |
| 124 | async getProjectEnv({ |
| 125 | projectRef, |
| 126 | env, |
| 127 | }: { |
| 128 | projectRef: string; |
| 129 | env: "dev" | "prod" | "staging"; |
| 130 | }) { |
| 131 | if (!this.accessToken) { |
| 132 | throw new Error("getProjectDevEnv: No access token"); |
| 133 | } |
| 134 | |
| 135 | return wrapZodFetch( |
| 136 | GetProjectEnvResponse, |
| 137 | `${this.apiURL}/api/v1/projects/${projectRef}/${env}`, |
| 138 | { |
| 139 | headers: { |
| 140 | Authorization: `Bearer ${this.accessToken}`, |
| 141 | "Content-Type": "application/json", |
| 142 | }, |
| 143 | } |
| 144 | ); |
| 145 | } |
| 146 | |
| 147 | async getEnvironmentVariables(projectRef: string) { |
| 148 | if (!this.accessToken) { |
no test coverage detected