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

Function startIndexing

packages/cli/src/commands/dev.ts:287–323  ·  view source on GitHub ↗
({
  spinner,
  path,
  endpointId,
  endpointHandlerUrl,
  resolvedOptions,
  apiClient,
}: RefreshOptions & { apiClient: TriggerApi })

Source from the content-addressed store, hash-verified

285}
286
287async function startIndexing({
288 spinner,
289 path,
290 endpointId,
291 endpointHandlerUrl,
292 resolvedOptions,
293 apiClient,
294}: RefreshOptions & { apiClient: TriggerApi }) {
295 spinner.start();
296 const refreshedEndpointId = await getEndpointId(runtime, resolvedOptions.clientId);
297
298 const authorizedKey = await apiClient.whoami();
299 if (!authorizedKey) {
300 telemetryClient.dev.failed("invalid_api_key", resolvedOptions);
301 throw new AbortError(
302 "[trigger.dev] The API key you provided is not authorized. Try visiting your dashboard to get a new API key."
303 );
304 }
305
306 telemetryClient.identify(
307 authorizedKey.organization.id,
308 authorizedKey.project.id,
309 authorizedKey.userId
310 );
311
312 const result = await refreshEndpoint(
313 apiClient,
314 refreshedEndpointId ?? endpointId,
315 endpointHandlerUrl
316 );
317
318 if (!result.success) {
319 throw new Error(result.error);
320 }
321
322 return { id: result.data.endpointIndex?.id, updatedAt: new Date(result.data.updatedAt) };
323}
324
325async function fetchIndexResult({
326 indexId,

Callers 1

refreshFunction · 0.85

Calls 5

getEndpointIdFunction · 0.85
refreshEndpointFunction · 0.85
whoamiMethod · 0.80
identifyMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…