@insignia-education/api-sdk-js 0.16.19 → 0.16.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insignia-education/api-sdk-js",
3
- "version": "0.16.19",
3
+ "version": "0.16.21",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -151,16 +151,34 @@ export default class Admin {
151
151
  }
152
152
 
153
153
  /**
154
- * Recent GitHub Actions workflow runs for 'api' and 'front' (the only repos
155
- * GithubActionsService covers), newest first, `{ limit }` each (default 20, max 50).
154
+ * Recent GitHub Actions workflow runs for every repo GithubActionsService covers
155
+ * ('api', 'front', 'api-sdk-js'), newest first, `{ limit }` each (default 20, max 50).
156
156
  * Resolves `{ available: false }` (not an error) if the server has no GitHub token
157
- * configured, per repo — check `repos.api.available` / `repos.front.available`
158
- * separately rather than assuming both are up together.
157
+ * configured, per repo — check `repos.<name>.available` separately rather than
158
+ * assuming all three are up together.
159
159
  */
160
160
  actionsStatus({ limit } = {}) {
161
161
  return this.#client.get('/admin/actions/status', { limit });
162
162
  }
163
163
 
164
+ /**
165
+ * One workflow run's jobs, each with its own steps — lets the dashboard show a run's
166
+ * breakdown inline instead of linking out to GitHub. Resolves `{ available: false }`
167
+ * the same way actionsStatus() does.
168
+ */
169
+ actionsJobs(repo, runId) {
170
+ return this.#client.get(`/admin/actions/${repo}/runs/${runId}/jobs`);
171
+ }
172
+
173
+ /**
174
+ * Re-runs one job. GitHub only allows this once the job has finished (queued/
175
+ * in_progress 4xx). Resolves `{ success: false, message }` rather than throwing on
176
+ * an unknown repo, missing token, or a failed GitHub request.
177
+ */
178
+ actionsRerunJob(repo, jobId) {
179
+ return this.#client.post(`/admin/actions/${repo}/jobs/${jobId}/rerun`);
180
+ }
181
+
164
182
  static #buildUrl(baseUrl, path, params) {
165
183
  const qs = new URLSearchParams(
166
184
  Object.entries(params).filter(([, v]) => v !== undefined && v !== null && v !== '')