MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / retrieve

Function retrieve

packages/trigger-sdk/src/v3/envvars.ts:162–196  ·  view source on GitHub ↗
(
  projectRefOrName: string,
  slug?: string,
  name?: string
)

Source from the content-addressed store, hash-verified

160): ApiPromise<EnvironmentVariableValue>;
161export function retrieve(name: string): ApiPromise<EnvironmentVariableValue>;
162export 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
198export function del(
199 projectRef: string,

Callers

nothing calls this directly

Calls 2

apiClientMissingErrorFunction · 0.90
retrieveEnvVarMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…