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

Function doListRuns

references/v3-catalog/src/management.ts:117–168  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

115}
116
117async function doListRuns() {
118 let pageCount = 0;
119
120 let page = await runs.list({
121 limit: 100,
122 });
123
124 console.log(`run page #${++pageCount}`);
125
126 // Convenience methods are provided for manually paginating:
127 while (page.hasNextPage()) {
128 page = await page.getNextPage();
129 console.log(`run page #${++pageCount}`);
130 }
131
132 while (page.hasPreviousPage()) {
133 page = await page.getPreviousPage();
134 console.log(`run page #${--pageCount}`);
135 }
136
137 for await (const run of runs.list({
138 status: ["COMPLETED"],
139 period: "1y",
140 })) {
141 console.log(run);
142 }
143
144 let withResponse = await runs
145 .list({
146 limit: 100,
147 })
148 .withResponse();
149
150 console.log(
151 "withResponse",
152 withResponse.response.status,
153 withResponse.response.headers,
154 withResponse.data.data.length
155 );
156
157 configure({
158 secretKey: process.env.TRIGGER_ACCESS_TOKEN,
159 });
160
161 for await (const run of runs.list("yubjwjsfkxnylobaqvqz", {
162 status: ["COMPLETED"],
163 period: "1y",
164 env: ["dev", "staging", "prod"],
165 })) {
166 console.log(run.env.name, run.isTest, run.id, run.status, run.createdAt);
167 }
168}
169
170async function waitForRunToComplete(runId: string) {
171 let run = await runs.retrieve(runId);

Callers

nothing calls this directly

Calls 8

configureFunction · 0.90
withResponseMethod · 0.80
logMethod · 0.65
hasNextPageMethod · 0.65
hasPreviousPageMethod · 0.65
listMethod · 0.45
getNextPageMethod · 0.45
getPreviousPageMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…