()
| 115 | } |
| 116 | |
| 117 | async 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 | |
| 170 | async function waitForRunToComplete(runId: string) { |
| 171 | let run = await runs.retrieve(runId); |
nothing calls this directly
no test coverage detected
searching dependent graphs…