@instructure/athena-api-client 3.47.0 → 4.0.1

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.
Files changed (50) hide show
  1. package/README.md +9 -6
  2. package/dist/apis/AdminApi.d.ts +53 -37
  3. package/dist/apis/AdminApi.js +75 -32
  4. package/dist/apis/ConceptDiagramsApi.d.ts +15 -1
  5. package/dist/apis/ConceptDiagramsApi.js +41 -0
  6. package/dist/apis/ConceptImagesApi.d.ts +15 -1
  7. package/dist/apis/ConceptImagesApi.js +41 -0
  8. package/dist/esm/apis/AdminApi.d.ts +53 -37
  9. package/dist/esm/apis/AdminApi.js +76 -33
  10. package/dist/esm/apis/ConceptDiagramsApi.d.ts +15 -1
  11. package/dist/esm/apis/ConceptDiagramsApi.js +42 -1
  12. package/dist/esm/apis/ConceptImagesApi.d.ts +15 -1
  13. package/dist/esm/apis/ConceptImagesApi.js +42 -1
  14. package/dist/esm/models/AdminConceptDiagram.d.ts +19 -1
  15. package/dist/esm/models/AdminConceptDiagram.js +12 -0
  16. package/dist/esm/models/AdminConceptDiagramDetail.d.ts +19 -1
  17. package/dist/esm/models/AdminConceptDiagramDetail.js +12 -0
  18. package/dist/esm/models/AdminConceptImage.d.ts +19 -1
  19. package/dist/esm/models/AdminConceptImage.js +12 -0
  20. package/dist/esm/models/AdminConceptImageDetail.d.ts +19 -1
  21. package/dist/esm/models/AdminConceptImageDetail.js +12 -0
  22. package/dist/esm/models/AdminConceptMediaJob.d.ts +157 -0
  23. package/dist/esm/models/AdminConceptMediaJob.js +139 -0
  24. package/dist/esm/models/AdminShownConceptDiagram.d.ts +19 -1
  25. package/dist/esm/models/AdminShownConceptDiagram.js +12 -0
  26. package/dist/esm/models/AdminShownConceptImage.d.ts +19 -1
  27. package/dist/esm/models/AdminShownConceptImage.js +12 -0
  28. package/dist/esm/models/ConceptMediaFlagResult.d.ts +32 -0
  29. package/dist/esm/models/ConceptMediaFlagResult.js +43 -0
  30. package/dist/esm/models/index.d.ts +2 -2
  31. package/dist/esm/models/index.js +2 -2
  32. package/dist/models/AdminConceptDiagram.d.ts +19 -1
  33. package/dist/models/AdminConceptDiagram.js +12 -0
  34. package/dist/models/AdminConceptDiagramDetail.d.ts +19 -1
  35. package/dist/models/AdminConceptDiagramDetail.js +12 -0
  36. package/dist/models/AdminConceptImage.d.ts +19 -1
  37. package/dist/models/AdminConceptImage.js +12 -0
  38. package/dist/models/AdminConceptImageDetail.d.ts +19 -1
  39. package/dist/models/AdminConceptImageDetail.js +12 -0
  40. package/dist/models/AdminConceptMediaJob.d.ts +157 -0
  41. package/dist/models/AdminConceptMediaJob.js +147 -0
  42. package/dist/models/AdminShownConceptDiagram.d.ts +19 -1
  43. package/dist/models/AdminShownConceptDiagram.js +12 -0
  44. package/dist/models/AdminShownConceptImage.d.ts +19 -1
  45. package/dist/models/AdminShownConceptImage.js +12 -0
  46. package/dist/models/ConceptMediaFlagResult.d.ts +32 -0
  47. package/dist/models/ConceptMediaFlagResult.js +50 -0
  48. package/dist/models/index.d.ts +2 -2
  49. package/dist/models/index.js +2 -2
  50. package/package.json +1 -1
@@ -112,8 +112,8 @@ class AdminApi extends runtime.BaseAPI {
112
112
  });
113
113
  }
114
114
  /**
115
- * Generates a new diagram filed under exactly one concept: conceptId as-is, or conceptName resolved first (exact normalized name match, else the nearest concept within the dedup distance, else a new concept, which stays even if generation then fails). conceptResolution in the response says which. Exactly one of conceptId and conceptName is required. The diagram is attributed to the calling account user with no source chat. It is stored hidden for review and never matched to an existing diagram. Counts against the caller\'s admin limit (ADMIN_CONCEPT_DIAGRAM_DAILY_LIMIT per rolling 24 hours), not the learner limit.
116
- * Generate a hidden draft diagram for a concept
115
+ * Returns 202 with a pending job at once; the generation runs in a background worker. Poll adminGetConceptMediaJob with the job id until status is succeeded (resultMediaId is the new draft) or failed (errorCode says why: off_topic, moderation_blocked, timeout, not_found, generation_failed, authoring_failed, save_failed, limit_reached, internal_error, delivery_failed). Each job runs its paid generation at most once: retry a failed job by enqueueing a new one. The draft is filed under exactly one concept: conceptId as-is, or conceptName resolved before the job is queued (exact normalized name match, else the nearest concept within the dedup distance, else a new concept, which stays even if generation then fails). conceptResolution in the job says which. Exactly one of conceptId and conceptName is required. The diagram is attributed to the calling account user with no source chat, stored hidden for review, and never matched to an existing diagram. Counts against the caller\'s admin limit (ADMIN_CONCEPT_DIAGRAM_DAILY_LIMIT per rolling 24 hours, counting queued and running jobs as well as saved drafts), not the learner limit.
116
+ * Enqueue a hidden draft diagram for a concept
117
117
  */
118
118
  adminGenerateConceptDiagramRaw(requestParameters, initOverrides) {
119
119
  return __awaiter(this, void 0, void 0, function* () {
@@ -140,12 +140,12 @@ class AdminApi extends runtime.BaseAPI {
140
140
  query: queryParameters,
141
141
  body: (0, index_1.AdminGenerateConceptDiagramRequestToJSON)(requestParameters['adminGenerateConceptDiagramRequest']),
142
142
  }, initOverrides);
143
- return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AdminGeneratedConceptDiagramFromJSON)(jsonValue));
143
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AdminConceptMediaJobFromJSON)(jsonValue));
144
144
  });
145
145
  }
146
146
  /**
147
- * Generates a new diagram filed under exactly one concept: conceptId as-is, or conceptName resolved first (exact normalized name match, else the nearest concept within the dedup distance, else a new concept, which stays even if generation then fails). conceptResolution in the response says which. Exactly one of conceptId and conceptName is required. The diagram is attributed to the calling account user with no source chat. It is stored hidden for review and never matched to an existing diagram. Counts against the caller\'s admin limit (ADMIN_CONCEPT_DIAGRAM_DAILY_LIMIT per rolling 24 hours), not the learner limit.
148
- * Generate a hidden draft diagram for a concept
147
+ * Returns 202 with a pending job at once; the generation runs in a background worker. Poll adminGetConceptMediaJob with the job id until status is succeeded (resultMediaId is the new draft) or failed (errorCode says why: off_topic, moderation_blocked, timeout, not_found, generation_failed, authoring_failed, save_failed, limit_reached, internal_error, delivery_failed). Each job runs its paid generation at most once: retry a failed job by enqueueing a new one. The draft is filed under exactly one concept: conceptId as-is, or conceptName resolved before the job is queued (exact normalized name match, else the nearest concept within the dedup distance, else a new concept, which stays even if generation then fails). conceptResolution in the job says which. Exactly one of conceptId and conceptName is required. The diagram is attributed to the calling account user with no source chat, stored hidden for review, and never matched to an existing diagram. Counts against the caller\'s admin limit (ADMIN_CONCEPT_DIAGRAM_DAILY_LIMIT per rolling 24 hours, counting queued and running jobs as well as saved drafts), not the learner limit.
148
+ * Enqueue a hidden draft diagram for a concept
149
149
  */
150
150
  adminGenerateConceptDiagram(requestParameters, initOverrides) {
151
151
  return __awaiter(this, void 0, void 0, function* () {
@@ -154,8 +154,8 @@ class AdminApi extends runtime.BaseAPI {
154
154
  });
155
155
  }
156
156
  /**
157
- * Generates a new image filed under exactly one concept: conceptId as-is, or conceptName resolved first (exact normalized name match, else the nearest concept within the dedup distance, else a new concept, which stays even if generation then fails). conceptResolution in the response says which. Exactly one of conceptId and conceptName is required. The image is attributed to the calling account user with no source chat. It is stored hidden for review and never matched to an existing image. Counts against the caller\'s admin limit (ADMIN_CONCEPT_IMAGE_DAILY_LIMIT per rolling 24 hours), not the learner limit.
158
- * Generate a hidden draft image for a concept
157
+ * Returns 202 with a pending job at once; the generation runs in a background worker. Poll adminGetConceptMediaJob with the job id until status is succeeded (resultMediaId is the new draft) or failed (errorCode says why: off_topic, moderation_blocked, timeout, not_found, generation_failed, authoring_failed, save_failed, limit_reached, internal_error, delivery_failed). Each job runs its paid generation at most once: retry a failed job by enqueueing a new one. The draft is filed under exactly one concept: conceptId as-is, or conceptName resolved before the job is queued (exact normalized name match, else the nearest concept within the dedup distance, else a new concept, which stays even if generation then fails). conceptResolution in the job says which. Exactly one of conceptId and conceptName is required. The image is attributed to the calling account user with no source chat, stored hidden for review, and never matched to an existing image. Counts against the caller\'s admin limit (ADMIN_CONCEPT_IMAGE_DAILY_LIMIT per rolling 24 hours, counting queued and running jobs as well as saved drafts), not the learner limit.
158
+ * Enqueue a hidden draft image for a concept
159
159
  */
160
160
  adminGenerateConceptImageRaw(requestParameters, initOverrides) {
161
161
  return __awaiter(this, void 0, void 0, function* () {
@@ -182,12 +182,12 @@ class AdminApi extends runtime.BaseAPI {
182
182
  query: queryParameters,
183
183
  body: (0, index_1.AdminGenerateConceptImageRequestToJSON)(requestParameters['adminGenerateConceptImageRequest']),
184
184
  }, initOverrides);
185
- return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AdminGeneratedConceptImageFromJSON)(jsonValue));
185
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AdminConceptMediaJobFromJSON)(jsonValue));
186
186
  });
187
187
  }
188
188
  /**
189
- * Generates a new image filed under exactly one concept: conceptId as-is, or conceptName resolved first (exact normalized name match, else the nearest concept within the dedup distance, else a new concept, which stays even if generation then fails). conceptResolution in the response says which. Exactly one of conceptId and conceptName is required. The image is attributed to the calling account user with no source chat. It is stored hidden for review and never matched to an existing image. Counts against the caller\'s admin limit (ADMIN_CONCEPT_IMAGE_DAILY_LIMIT per rolling 24 hours), not the learner limit.
190
- * Generate a hidden draft image for a concept
189
+ * Returns 202 with a pending job at once; the generation runs in a background worker. Poll adminGetConceptMediaJob with the job id until status is succeeded (resultMediaId is the new draft) or failed (errorCode says why: off_topic, moderation_blocked, timeout, not_found, generation_failed, authoring_failed, save_failed, limit_reached, internal_error, delivery_failed). Each job runs its paid generation at most once: retry a failed job by enqueueing a new one. The draft is filed under exactly one concept: conceptId as-is, or conceptName resolved before the job is queued (exact normalized name match, else the nearest concept within the dedup distance, else a new concept, which stays even if generation then fails). conceptResolution in the job says which. Exactly one of conceptId and conceptName is required. The image is attributed to the calling account user with no source chat, stored hidden for review, and never matched to an existing image. Counts against the caller\'s admin limit (ADMIN_CONCEPT_IMAGE_DAILY_LIMIT per rolling 24 hours, counting queued and running jobs as well as saved drafts), not the learner limit.
190
+ * Enqueue a hidden draft image for a concept
191
191
  */
192
192
  adminGenerateConceptImage(requestParameters, initOverrides) {
193
193
  return __awaiter(this, void 0, void 0, function* () {
@@ -441,6 +441,47 @@ class AdminApi extends runtime.BaseAPI {
441
441
  return yield response.value();
442
442
  });
443
443
  }
444
+ /**
445
+ * Poll after a generate or regenerate (every few seconds) until status is succeeded or failed. On success, resultMediaId is the new hidden draft: open it with adminGetConceptImage or adminGetConceptDiagram per kind. On failure, errorCode and errorMessage say why. A job left pending or running past its deadline (the generation timeout plus a margin while running; 30 minutes while pending) is reported failed with errorCode timeout. Only jobs requested by account users in the caller\'s account are found.
446
+ * Get an admin concept media generation job
447
+ */
448
+ adminGetConceptMediaJobRaw(requestParameters, initOverrides) {
449
+ return __awaiter(this, void 0, void 0, function* () {
450
+ if (requestParameters['xUserId'] == null) {
451
+ throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling adminGetConceptMediaJob().');
452
+ }
453
+ if (requestParameters['jobId'] == null) {
454
+ throw new runtime.RequiredError('jobId', 'Required parameter "jobId" was null or undefined when calling adminGetConceptMediaJob().');
455
+ }
456
+ const queryParameters = {};
457
+ const headerParameters = {};
458
+ if (requestParameters['xUserId'] != null) {
459
+ headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
460
+ }
461
+ if (this.configuration && this.configuration.apiKey) {
462
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
463
+ }
464
+ let urlPath = `/api/v1/admin/concept-media-jobs/{jobId}`;
465
+ urlPath = urlPath.replace(`{${"jobId"}}`, encodeURIComponent(String(requestParameters['jobId'])));
466
+ const response = yield this.request({
467
+ path: urlPath,
468
+ method: 'GET',
469
+ headers: headerParameters,
470
+ query: queryParameters,
471
+ }, initOverrides);
472
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AdminConceptMediaJobFromJSON)(jsonValue));
473
+ });
474
+ }
475
+ /**
476
+ * Poll after a generate or regenerate (every few seconds) until status is succeeded or failed. On success, resultMediaId is the new hidden draft: open it with adminGetConceptImage or adminGetConceptDiagram per kind. On failure, errorCode and errorMessage say why. A job left pending or running past its deadline (the generation timeout plus a margin while running; 30 minutes while pending) is reported failed with errorCode timeout. Only jobs requested by account users in the caller\'s account are found.
477
+ * Get an admin concept media generation job
478
+ */
479
+ adminGetConceptMediaJob(requestParameters, initOverrides) {
480
+ return __awaiter(this, void 0, void 0, function* () {
481
+ const response = yield this.adminGetConceptMediaJobRaw(requestParameters, initOverrides);
482
+ return yield response.value();
483
+ });
484
+ }
444
485
  /**
445
486
  * Returns the session summary (quiz details, questions, responses, score) for any quiz session belonging to a user within the caller\'s account. Intended for admin-style views in calling applications; authorization on whether the calling user is allowed to act as an admin is the calling application\'s responsibility - this endpoint only enforces account isolation. Unlike the per-user `getQuizSessionSummary` endpoint, this endpoint does not gate on the `enhanced-quizzing` feature flag; an admin can read any historical session in their account regardless of whether the chat owner currently has the feature.
446
487
  * Get quiz session summary for any session within the account
@@ -682,7 +723,7 @@ class AdminApi extends runtime.BaseAPI {
682
723
  });
683
724
  }
684
725
  /**
685
- * Keeps the diagram out of every learner read. Idempotent: an already hidden diagram keeps its original hide time and actor. Applies to later reads only: a diagram already rendered in an open chat stays until the chat is reloaded.
726
+ * Keeps the diagram out of every learner read and clears any approval (approvedAt), so a later show re-approves it. Idempotent: a diagram an admin already hid keeps its original hide time and actor. A diagram hidden by a learner flag becomes an admin hide (hiddenByFlag false, with this call\'s time and actor). Applies to later reads only: a diagram already rendered in an open chat stays until the chat is reloaded.
686
727
  * Hide a concept diagram from learners
687
728
  */
688
729
  adminHideConceptDiagramRaw(requestParameters, initOverrides) {
@@ -713,7 +754,7 @@ class AdminApi extends runtime.BaseAPI {
713
754
  });
714
755
  }
715
756
  /**
716
- * Keeps the diagram out of every learner read. Idempotent: an already hidden diagram keeps its original hide time and actor. Applies to later reads only: a diagram already rendered in an open chat stays until the chat is reloaded.
757
+ * Keeps the diagram out of every learner read and clears any approval (approvedAt), so a later show re-approves it. Idempotent: a diagram an admin already hid keeps its original hide time and actor. A diagram hidden by a learner flag becomes an admin hide (hiddenByFlag false, with this call\'s time and actor). Applies to later reads only: a diagram already rendered in an open chat stays until the chat is reloaded.
717
758
  * Hide a concept diagram from learners
718
759
  */
719
760
  adminHideConceptDiagram(requestParameters, initOverrides) {
@@ -723,7 +764,7 @@ class AdminApi extends runtime.BaseAPI {
723
764
  });
724
765
  }
725
766
  /**
726
- * Keeps the image out of every learner read. Idempotent: an already hidden image keeps its original hide time and actor. Applies to later reads only: a signed URL already handed out stays valid until it expires (12 hours).
767
+ * Keeps the image out of every learner read and clears any approval (approvedAt), so a later show re-approves it. Idempotent: an image an admin already hid keeps its original hide time and actor. An image hidden by a learner flag becomes an admin hide (hiddenByFlag false, with this call\'s time and actor). Applies to later reads only: a signed URL already handed out stays valid until it expires (12 hours).
727
768
  * Hide a concept image from learners
728
769
  */
729
770
  adminHideConceptImageRaw(requestParameters, initOverrides) {
@@ -754,7 +795,7 @@ class AdminApi extends runtime.BaseAPI {
754
795
  });
755
796
  }
756
797
  /**
757
- * Keeps the image out of every learner read. Idempotent: an already hidden image keeps its original hide time and actor. Applies to later reads only: a signed URL already handed out stays valid until it expires (12 hours).
798
+ * Keeps the image out of every learner read and clears any approval (approvedAt), so a later show re-approves it. Idempotent: an image an admin already hid keeps its original hide time and actor. An image hidden by a learner flag becomes an admin hide (hiddenByFlag false, with this call\'s time and actor). Applies to later reads only: a signed URL already handed out stays valid until it expires (12 hours).
758
799
  * Hide a concept image from learners
759
800
  */
760
801
  adminHideConceptImage(requestParameters, initOverrides) {
@@ -1323,8 +1364,8 @@ class AdminApi extends runtime.BaseAPI {
1323
1364
  });
1324
1365
  }
1325
1366
  /**
1326
- * Generates a new diagram from an edited brief, linked to the original by revisesDiagramId even when the original is hidden or deleted, filed under the original\'s concept, attributed to the caller, and stored hidden. The original is left as it is. Counts against the caller\'s admin limit (ADMIN_CONCEPT_DIAGRAM_DAILY_LIMIT per rolling 24 hours).
1327
- * Generate a hidden revision of a concept diagram
1367
+ * Returns 202 with a pending job at once; the generation runs in a background worker. Poll adminGetConceptMediaJob with the job id until status is succeeded (resultMediaId is the new draft) or failed (errorCode says why: off_topic, moderation_blocked, timeout, not_found, generation_failed, authoring_failed, save_failed, limit_reached, internal_error, delivery_failed). Each job runs its paid generation at most once: retry a failed job by enqueueing a new one. The new diagram is generated from an edited brief, linked to the original by revisesDiagramId even when the original is hidden or deleted, filed under the original\'s concept, attributed to the caller, and stored hidden. The original is left as it is. Counts against the caller\'s admin limit (ADMIN_CONCEPT_DIAGRAM_DAILY_LIMIT per rolling 24 hours).
1368
+ * Enqueue a hidden revision of a concept diagram
1328
1369
  */
1329
1370
  adminRegenerateConceptDiagramRaw(requestParameters, initOverrides) {
1330
1371
  return __awaiter(this, void 0, void 0, function* () {
@@ -1355,12 +1396,12 @@ class AdminApi extends runtime.BaseAPI {
1355
1396
  query: queryParameters,
1356
1397
  body: (0, index_1.AdminRegenerateConceptDiagramRequestToJSON)(requestParameters['adminRegenerateConceptDiagramRequest']),
1357
1398
  }, initOverrides);
1358
- return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AdminConceptDiagramDetailFromJSON)(jsonValue));
1399
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AdminConceptMediaJobFromJSON)(jsonValue));
1359
1400
  });
1360
1401
  }
1361
1402
  /**
1362
- * Generates a new diagram from an edited brief, linked to the original by revisesDiagramId even when the original is hidden or deleted, filed under the original\'s concept, attributed to the caller, and stored hidden. The original is left as it is. Counts against the caller\'s admin limit (ADMIN_CONCEPT_DIAGRAM_DAILY_LIMIT per rolling 24 hours).
1363
- * Generate a hidden revision of a concept diagram
1403
+ * Returns 202 with a pending job at once; the generation runs in a background worker. Poll adminGetConceptMediaJob with the job id until status is succeeded (resultMediaId is the new draft) or failed (errorCode says why: off_topic, moderation_blocked, timeout, not_found, generation_failed, authoring_failed, save_failed, limit_reached, internal_error, delivery_failed). Each job runs its paid generation at most once: retry a failed job by enqueueing a new one. The new diagram is generated from an edited brief, linked to the original by revisesDiagramId even when the original is hidden or deleted, filed under the original\'s concept, attributed to the caller, and stored hidden. The original is left as it is. Counts against the caller\'s admin limit (ADMIN_CONCEPT_DIAGRAM_DAILY_LIMIT per rolling 24 hours).
1404
+ * Enqueue a hidden revision of a concept diagram
1364
1405
  */
1365
1406
  adminRegenerateConceptDiagram(requestParameters, initOverrides) {
1366
1407
  return __awaiter(this, void 0, void 0, function* () {
@@ -1369,8 +1410,8 @@ class AdminApi extends runtime.BaseAPI {
1369
1410
  });
1370
1411
  }
1371
1412
  /**
1372
- * Generates a new image from an edited prompt, linked to the original by revisesImageId even when the original is hidden or deleted, filed under the original\'s concept, attributed to the caller, and stored hidden. The original is left as it is. Counts against the caller\'s admin limit (ADMIN_CONCEPT_IMAGE_DAILY_LIMIT per rolling 24 hours).
1373
- * Generate a hidden revision of a concept image
1413
+ * Returns 202 with a pending job at once; the generation runs in a background worker. Poll adminGetConceptMediaJob with the job id until status is succeeded (resultMediaId is the new draft) or failed (errorCode says why: off_topic, moderation_blocked, timeout, not_found, generation_failed, authoring_failed, save_failed, limit_reached, internal_error, delivery_failed). Each job runs its paid generation at most once: retry a failed job by enqueueing a new one. The new image is generated from an edited prompt, linked to the original by revisesImageId even when the original is hidden or deleted, filed under the original\'s concept, attributed to the caller, and stored hidden. The original is left as it is. Counts against the caller\'s admin limit (ADMIN_CONCEPT_IMAGE_DAILY_LIMIT per rolling 24 hours).
1414
+ * Enqueue a hidden revision of a concept image
1374
1415
  */
1375
1416
  adminRegenerateConceptImageRaw(requestParameters, initOverrides) {
1376
1417
  return __awaiter(this, void 0, void 0, function* () {
@@ -1401,12 +1442,12 @@ class AdminApi extends runtime.BaseAPI {
1401
1442
  query: queryParameters,
1402
1443
  body: (0, index_1.AdminRegenerateConceptImageRequestToJSON)(requestParameters['adminRegenerateConceptImageRequest']),
1403
1444
  }, initOverrides);
1404
- return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AdminConceptImageDetailFromJSON)(jsonValue));
1445
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AdminConceptMediaJobFromJSON)(jsonValue));
1405
1446
  });
1406
1447
  }
1407
1448
  /**
1408
- * Generates a new image from an edited prompt, linked to the original by revisesImageId even when the original is hidden or deleted, filed under the original\'s concept, attributed to the caller, and stored hidden. The original is left as it is. Counts against the caller\'s admin limit (ADMIN_CONCEPT_IMAGE_DAILY_LIMIT per rolling 24 hours).
1409
- * Generate a hidden revision of a concept image
1449
+ * Returns 202 with a pending job at once; the generation runs in a background worker. Poll adminGetConceptMediaJob with the job id until status is succeeded (resultMediaId is the new draft) or failed (errorCode says why: off_topic, moderation_blocked, timeout, not_found, generation_failed, authoring_failed, save_failed, limit_reached, internal_error, delivery_failed). Each job runs its paid generation at most once: retry a failed job by enqueueing a new one. The new image is generated from an edited prompt, linked to the original by revisesImageId even when the original is hidden or deleted, filed under the original\'s concept, attributed to the caller, and stored hidden. The original is left as it is. Counts against the caller\'s admin limit (ADMIN_CONCEPT_IMAGE_DAILY_LIMIT per rolling 24 hours).
1450
+ * Enqueue a hidden revision of a concept image
1410
1451
  */
1411
1452
  adminRegenerateConceptImage(requestParameters, initOverrides) {
1412
1453
  return __awaiter(this, void 0, void 0, function* () {
@@ -1456,7 +1497,7 @@ class AdminApi extends runtime.BaseAPI {
1456
1497
  });
1457
1498
  }
1458
1499
  /**
1459
- * Clears the deletion and leaves the diagram hidden for review; show it to serve it to learners again. A diagram that is not deleted is unchanged.
1500
+ * Clears the deletion and any approval and leaves the diagram hidden for review (a diagram already hidden keeps its hide); show it to serve it to learners again. A diagram that is not deleted is unchanged.
1460
1501
  * Restore a soft-deleted concept diagram
1461
1502
  */
1462
1503
  adminRestoreConceptDiagramRaw(requestParameters, initOverrides) {
@@ -1487,7 +1528,7 @@ class AdminApi extends runtime.BaseAPI {
1487
1528
  });
1488
1529
  }
1489
1530
  /**
1490
- * Clears the deletion and leaves the diagram hidden for review; show it to serve it to learners again. A diagram that is not deleted is unchanged.
1531
+ * Clears the deletion and any approval and leaves the diagram hidden for review (a diagram already hidden keeps its hide); show it to serve it to learners again. A diagram that is not deleted is unchanged.
1491
1532
  * Restore a soft-deleted concept diagram
1492
1533
  */
1493
1534
  adminRestoreConceptDiagram(requestParameters, initOverrides) {
@@ -1497,7 +1538,7 @@ class AdminApi extends runtime.BaseAPI {
1497
1538
  });
1498
1539
  }
1499
1540
  /**
1500
- * Clears the deletion and leaves the image hidden for review; show it to serve it to learners again. A image that is not deleted is unchanged.
1541
+ * Clears the deletion and any approval and leaves the image hidden for review (an image already hidden keeps its hide); show it to serve it to learners again. An image that is not deleted is unchanged.
1501
1542
  * Restore a soft-deleted concept image
1502
1543
  */
1503
1544
  adminRestoreConceptImageRaw(requestParameters, initOverrides) {
@@ -1528,7 +1569,7 @@ class AdminApi extends runtime.BaseAPI {
1528
1569
  });
1529
1570
  }
1530
1571
  /**
1531
- * Clears the deletion and leaves the image hidden for review; show it to serve it to learners again. A image that is not deleted is unchanged.
1572
+ * Clears the deletion and any approval and leaves the image hidden for review (an image already hidden keeps its hide); show it to serve it to learners again. An image that is not deleted is unchanged.
1532
1573
  * Restore a soft-deleted concept image
1533
1574
  */
1534
1575
  adminRestoreConceptImage(requestParameters, initOverrides) {
@@ -1581,7 +1622,7 @@ class AdminApi extends runtime.BaseAPI {
1581
1622
  });
1582
1623
  }
1583
1624
  /**
1584
- * Clears the hide so learners can be served the diagram again. A deleted diagram must be restored first (409, and nothing changes). The body is optional; without it, or with hideOtherVersions false, only this diagram changes. With hideOtherVersions true, every other visible version in its revision family (the rows history lists) is hidden in the same transaction, with the caller recorded as hider; hidden and deleted versions are left as they are. hiddenVersionIds lists what was hidden, and hiddenVersionsTruncated says when the family exceeded the history cap so only the capped set was checked. Learner reads are unaffected beyond the rows hidden, and only for later reads.
1625
+ * Clears the hide so learners can be served the diagram again, and records the caller\'s approval (approvedAt, approvedBy): a learner flag never hides an approved diagram. Showing a visible diagram approves it too. A deleted diagram must be restored first (409, and nothing changes). The body is optional; without it, or with hideOtherVersions false, only this diagram changes. With hideOtherVersions true, every other visible version in its revision family (the rows history lists) is hidden in the same transaction, with the caller recorded as hider and their approval cleared; hidden and deleted versions are left as they are. hiddenVersionIds lists what was hidden, and hiddenVersionsTruncated says when the family exceeded the history cap so only the capped set was checked. Learner reads are unaffected beyond the rows hidden, and only for later reads.
1585
1626
  * Show a hidden concept diagram to learners
1586
1627
  */
1587
1628
  adminShowConceptDiagramRaw(requestParameters, initOverrides) {
@@ -1614,7 +1655,7 @@ class AdminApi extends runtime.BaseAPI {
1614
1655
  });
1615
1656
  }
1616
1657
  /**
1617
- * Clears the hide so learners can be served the diagram again. A deleted diagram must be restored first (409, and nothing changes). The body is optional; without it, or with hideOtherVersions false, only this diagram changes. With hideOtherVersions true, every other visible version in its revision family (the rows history lists) is hidden in the same transaction, with the caller recorded as hider; hidden and deleted versions are left as they are. hiddenVersionIds lists what was hidden, and hiddenVersionsTruncated says when the family exceeded the history cap so only the capped set was checked. Learner reads are unaffected beyond the rows hidden, and only for later reads.
1658
+ * Clears the hide so learners can be served the diagram again, and records the caller\'s approval (approvedAt, approvedBy): a learner flag never hides an approved diagram. Showing a visible diagram approves it too. A deleted diagram must be restored first (409, and nothing changes). The body is optional; without it, or with hideOtherVersions false, only this diagram changes. With hideOtherVersions true, every other visible version in its revision family (the rows history lists) is hidden in the same transaction, with the caller recorded as hider and their approval cleared; hidden and deleted versions are left as they are. hiddenVersionIds lists what was hidden, and hiddenVersionsTruncated says when the family exceeded the history cap so only the capped set was checked. Learner reads are unaffected beyond the rows hidden, and only for later reads.
1618
1659
  * Show a hidden concept diagram to learners
1619
1660
  */
1620
1661
  adminShowConceptDiagram(requestParameters, initOverrides) {
@@ -1624,7 +1665,7 @@ class AdminApi extends runtime.BaseAPI {
1624
1665
  });
1625
1666
  }
1626
1667
  /**
1627
- * Clears the hide so learners can be served the image again. A deleted image must be restored first (409, and nothing changes). The body is optional; without it, or with hideOtherVersions false, only this image changes. With hideOtherVersions true, every other visible version in its revision family (the rows history lists) is hidden in the same transaction, with the caller recorded as hider; hidden and deleted versions are left as they are. hiddenVersionIds lists what was hidden, and hiddenVersionsTruncated says when the family exceeded the history cap so only the capped set was checked. Learner reads are unaffected beyond the rows hidden, and only for later reads (a signed URL already handed out stays valid until it expires, 12 hours).
1668
+ * Clears the hide so learners can be served the image again, and records the caller\'s approval (approvedAt, approvedBy): a learner flag never hides an approved image. Showing a visible image approves it too. A deleted image must be restored first (409, and nothing changes). The body is optional; without it, or with hideOtherVersions false, only this image changes. With hideOtherVersions true, every other visible version in its revision family (the rows history lists) is hidden in the same transaction, with the caller recorded as hider and their approval cleared; hidden and deleted versions are left as they are. hiddenVersionIds lists what was hidden, and hiddenVersionsTruncated says when the family exceeded the history cap so only the capped set was checked. Learner reads are unaffected beyond the rows hidden, and only for later reads (a signed URL already handed out stays valid until it expires, 12 hours).
1628
1669
  * Show a hidden concept image to learners
1629
1670
  */
1630
1671
  adminShowConceptImageRaw(requestParameters, initOverrides) {
@@ -1657,7 +1698,7 @@ class AdminApi extends runtime.BaseAPI {
1657
1698
  });
1658
1699
  }
1659
1700
  /**
1660
- * Clears the hide so learners can be served the image again. A deleted image must be restored first (409, and nothing changes). The body is optional; without it, or with hideOtherVersions false, only this image changes. With hideOtherVersions true, every other visible version in its revision family (the rows history lists) is hidden in the same transaction, with the caller recorded as hider; hidden and deleted versions are left as they are. hiddenVersionIds lists what was hidden, and hiddenVersionsTruncated says when the family exceeded the history cap so only the capped set was checked. Learner reads are unaffected beyond the rows hidden, and only for later reads (a signed URL already handed out stays valid until it expires, 12 hours).
1701
+ * Clears the hide so learners can be served the image again, and records the caller\'s approval (approvedAt, approvedBy): a learner flag never hides an approved image. Showing a visible image approves it too. A deleted image must be restored first (409, and nothing changes). The body is optional; without it, or with hideOtherVersions false, only this image changes. With hideOtherVersions true, every other visible version in its revision family (the rows history lists) is hidden in the same transaction, with the caller recorded as hider and their approval cleared; hidden and deleted versions are left as they are. hiddenVersionIds lists what was hidden, and hiddenVersionsTruncated says when the family exceeded the history cap so only the capped set was checked. Learner reads are unaffected beyond the rows hidden, and only for later reads (a signed URL already handed out stays valid until it expires, 12 hours).
1661
1702
  * Show a hidden concept image to learners
1662
1703
  */
1663
1704
  adminShowConceptImage(requestParameters, initOverrides) {
@@ -1758,6 +1799,7 @@ exports.AdminListConceptDiagramsStateEnum = {
1758
1799
  NotDeleted: 'not_deleted',
1759
1800
  Visible: 'visible',
1760
1801
  Hidden: 'hidden',
1802
+ Flagged: 'flagged',
1761
1803
  Deleted: 'deleted',
1762
1804
  All: 'all'
1763
1805
  };
@@ -1775,6 +1817,7 @@ exports.AdminListConceptImagesStateEnum = {
1775
1817
  NotDeleted: 'not_deleted',
1776
1818
  Visible: 'visible',
1777
1819
  Hidden: 'hidden',
1820
+ Flagged: 'flagged',
1778
1821
  Deleted: 'deleted',
1779
1822
  All: 'all'
1780
1823
  };
@@ -10,7 +10,11 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { ConceptDiagramDetail, PaginatedConceptDiagrams } from '../models/index';
13
+ import type { ConceptDiagramDetail, ConceptMediaFlagResult, PaginatedConceptDiagrams } from '../models/index';
14
+ export interface FlagConceptDiagramRequest {
15
+ xUserId: string;
16
+ diagramId: string;
17
+ }
14
18
  export interface GetMyConceptDiagramRequest {
15
19
  xUserId: string;
16
20
  diagramId: string;
@@ -24,6 +28,16 @@ export interface ListMyConceptDiagramsRequest {
24
28
  *
25
29
  */
26
30
  export declare class ConceptDiagramsApi extends runtime.BaseAPI {
31
+ /**
32
+ * Acts on a learner\'s thumbs-down on a shared concept diagram. A visible diagram that no admin has approved is hidden at once, from every learner, until an admin shows it again or shows a revision of it. Any authenticated learner may flag any diagram id; the calling client is expected to check that the diagram was shown to this learner. Idempotent: a diagram that is already hidden or deleted is left as it is (the first hide keeps its time and actor), and an admin-approved diagram stays visible. hidden says whether learners are kept from it after the call. Applies to later reads only: a diagram already rendered in an open chat stays until the chat is reloaded.
33
+ * Flag a concept diagram so learners stop being shown it
34
+ */
35
+ flagConceptDiagramRaw(requestParameters: FlagConceptDiagramRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ConceptMediaFlagResult>>;
36
+ /**
37
+ * Acts on a learner\'s thumbs-down on a shared concept diagram. A visible diagram that no admin has approved is hidden at once, from every learner, until an admin shows it again or shows a revision of it. Any authenticated learner may flag any diagram id; the calling client is expected to check that the diagram was shown to this learner. Idempotent: a diagram that is already hidden or deleted is left as it is (the first hide keeps its time and actor), and an admin-approved diagram stays visible. hidden says whether learners are kept from it after the call. Applies to later reads only: a diagram already rendered in an open chat stays until the chat is reloaded.
38
+ * Flag a concept diagram so learners stop being shown it
39
+ */
40
+ flagConceptDiagram(requestParameters: FlagConceptDiagramRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ConceptMediaFlagResult>;
27
41
  /**
28
42
  * Returns one non-hidden diagram the authenticated user authored, including its assembled HTML document.
29
43
  * Get a concept diagram the user authored
@@ -29,6 +29,47 @@ const index_1 = require("../models/index");
29
29
  *
30
30
  */
31
31
  class ConceptDiagramsApi extends runtime.BaseAPI {
32
+ /**
33
+ * Acts on a learner\'s thumbs-down on a shared concept diagram. A visible diagram that no admin has approved is hidden at once, from every learner, until an admin shows it again or shows a revision of it. Any authenticated learner may flag any diagram id; the calling client is expected to check that the diagram was shown to this learner. Idempotent: a diagram that is already hidden or deleted is left as it is (the first hide keeps its time and actor), and an admin-approved diagram stays visible. hidden says whether learners are kept from it after the call. Applies to later reads only: a diagram already rendered in an open chat stays until the chat is reloaded.
34
+ * Flag a concept diagram so learners stop being shown it
35
+ */
36
+ flagConceptDiagramRaw(requestParameters, initOverrides) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ if (requestParameters['xUserId'] == null) {
39
+ throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling flagConceptDiagram().');
40
+ }
41
+ if (requestParameters['diagramId'] == null) {
42
+ throw new runtime.RequiredError('diagramId', 'Required parameter "diagramId" was null or undefined when calling flagConceptDiagram().');
43
+ }
44
+ const queryParameters = {};
45
+ const headerParameters = {};
46
+ if (requestParameters['xUserId'] != null) {
47
+ headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
48
+ }
49
+ if (this.configuration && this.configuration.apiKey) {
50
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
51
+ }
52
+ let urlPath = `/api/v1/concept-diagrams/{diagramId}/flag`;
53
+ urlPath = urlPath.replace(`{${"diagramId"}}`, encodeURIComponent(String(requestParameters['diagramId'])));
54
+ const response = yield this.request({
55
+ path: urlPath,
56
+ method: 'POST',
57
+ headers: headerParameters,
58
+ query: queryParameters,
59
+ }, initOverrides);
60
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ConceptMediaFlagResultFromJSON)(jsonValue));
61
+ });
62
+ }
63
+ /**
64
+ * Acts on a learner\'s thumbs-down on a shared concept diagram. A visible diagram that no admin has approved is hidden at once, from every learner, until an admin shows it again or shows a revision of it. Any authenticated learner may flag any diagram id; the calling client is expected to check that the diagram was shown to this learner. Idempotent: a diagram that is already hidden or deleted is left as it is (the first hide keeps its time and actor), and an admin-approved diagram stays visible. hidden says whether learners are kept from it after the call. Applies to later reads only: a diagram already rendered in an open chat stays until the chat is reloaded.
65
+ * Flag a concept diagram so learners stop being shown it
66
+ */
67
+ flagConceptDiagram(requestParameters, initOverrides) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ const response = yield this.flagConceptDiagramRaw(requestParameters, initOverrides);
70
+ return yield response.value();
71
+ });
72
+ }
32
73
  /**
33
74
  * Returns one non-hidden diagram the authenticated user authored, including its assembled HTML document.
34
75
  * Get a concept diagram the user authored
@@ -10,7 +10,11 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { PaginatedConceptImages } from '../models/index';
13
+ import type { ConceptMediaFlagResult, PaginatedConceptImages } from '../models/index';
14
+ export interface FlagConceptImageRequest {
15
+ xUserId: string;
16
+ imageId: string;
17
+ }
14
18
  export interface ListMyConceptImagesRequest {
15
19
  xUserId: string;
16
20
  limit?: number;
@@ -20,6 +24,16 @@ export interface ListMyConceptImagesRequest {
20
24
  *
21
25
  */
22
26
  export declare class ConceptImagesApi extends runtime.BaseAPI {
27
+ /**
28
+ * Acts on a learner\'s thumbs-down on a shared concept image. A visible image that no admin has approved is hidden at once, from every learner, until an admin shows it again or shows a revision of it. Any authenticated learner may flag any image id; the calling client is expected to check that the image was shown to this learner. Idempotent: an image that is already hidden or deleted is left as it is (the first hide keeps its time and actor), and an admin-approved image stays visible. hidden says whether learners are kept from it after the call. Applies to later reads only: a signed URL already handed out stays valid until it expires (12 hours).
29
+ * Flag a concept image so learners stop being shown it
30
+ */
31
+ flagConceptImageRaw(requestParameters: FlagConceptImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ConceptMediaFlagResult>>;
32
+ /**
33
+ * Acts on a learner\'s thumbs-down on a shared concept image. A visible image that no admin has approved is hidden at once, from every learner, until an admin shows it again or shows a revision of it. Any authenticated learner may flag any image id; the calling client is expected to check that the image was shown to this learner. Idempotent: an image that is already hidden or deleted is left as it is (the first hide keeps its time and actor), and an admin-approved image stays visible. hidden says whether learners are kept from it after the call. Applies to later reads only: a signed URL already handed out stays valid until it expires (12 hours).
34
+ * Flag a concept image so learners stop being shown it
35
+ */
36
+ flagConceptImage(requestParameters: FlagConceptImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ConceptMediaFlagResult>;
23
37
  /**
24
38
  * Returns the non-hidden concept images the authenticated user generated in chat, newest first, each with a freshly signed read URL and the chat it came from. Images generated by other learners are never included, even when this user has been shown them.
25
39
  * List the concept images the user generated
@@ -29,6 +29,47 @@ const index_1 = require("../models/index");
29
29
  *
30
30
  */
31
31
  class ConceptImagesApi extends runtime.BaseAPI {
32
+ /**
33
+ * Acts on a learner\'s thumbs-down on a shared concept image. A visible image that no admin has approved is hidden at once, from every learner, until an admin shows it again or shows a revision of it. Any authenticated learner may flag any image id; the calling client is expected to check that the image was shown to this learner. Idempotent: an image that is already hidden or deleted is left as it is (the first hide keeps its time and actor), and an admin-approved image stays visible. hidden says whether learners are kept from it after the call. Applies to later reads only: a signed URL already handed out stays valid until it expires (12 hours).
34
+ * Flag a concept image so learners stop being shown it
35
+ */
36
+ flagConceptImageRaw(requestParameters, initOverrides) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ if (requestParameters['xUserId'] == null) {
39
+ throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling flagConceptImage().');
40
+ }
41
+ if (requestParameters['imageId'] == null) {
42
+ throw new runtime.RequiredError('imageId', 'Required parameter "imageId" was null or undefined when calling flagConceptImage().');
43
+ }
44
+ const queryParameters = {};
45
+ const headerParameters = {};
46
+ if (requestParameters['xUserId'] != null) {
47
+ headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
48
+ }
49
+ if (this.configuration && this.configuration.apiKey) {
50
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
51
+ }
52
+ let urlPath = `/api/v1/concept-images/{imageId}/flag`;
53
+ urlPath = urlPath.replace(`{${"imageId"}}`, encodeURIComponent(String(requestParameters['imageId'])));
54
+ const response = yield this.request({
55
+ path: urlPath,
56
+ method: 'POST',
57
+ headers: headerParameters,
58
+ query: queryParameters,
59
+ }, initOverrides);
60
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ConceptMediaFlagResultFromJSON)(jsonValue));
61
+ });
62
+ }
63
+ /**
64
+ * Acts on a learner\'s thumbs-down on a shared concept image. A visible image that no admin has approved is hidden at once, from every learner, until an admin shows it again or shows a revision of it. Any authenticated learner may flag any image id; the calling client is expected to check that the image was shown to this learner. Idempotent: an image that is already hidden or deleted is left as it is (the first hide keeps its time and actor), and an admin-approved image stays visible. hidden says whether learners are kept from it after the call. Applies to later reads only: a signed URL already handed out stays valid until it expires (12 hours).
65
+ * Flag a concept image so learners stop being shown it
66
+ */
67
+ flagConceptImage(requestParameters, initOverrides) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ const response = yield this.flagConceptImageRaw(requestParameters, initOverrides);
70
+ return yield response.value();
71
+ });
72
+ }
32
73
  /**
33
74
  * Returns the non-hidden concept images the authenticated user generated in chat, newest first, each with a freshly signed read URL and the chat it came from. Images generated by other learners are never included, even when this user has been shown them.
34
75
  * List the concept images the user generated