@instructure/athena-api-client 4.0.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 (46) hide show
  1. package/README.md +3 -0
  2. package/dist/apis/AdminApi.d.ts +14 -12
  3. package/dist/apis/AdminApi.js +14 -12
  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 +14 -12
  9. package/dist/esm/apis/AdminApi.js +14 -12
  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/AdminShownConceptDiagram.d.ts +19 -1
  23. package/dist/esm/models/AdminShownConceptDiagram.js +12 -0
  24. package/dist/esm/models/AdminShownConceptImage.d.ts +19 -1
  25. package/dist/esm/models/AdminShownConceptImage.js +12 -0
  26. package/dist/esm/models/ConceptMediaFlagResult.d.ts +32 -0
  27. package/dist/esm/models/ConceptMediaFlagResult.js +43 -0
  28. package/dist/esm/models/index.d.ts +1 -0
  29. package/dist/esm/models/index.js +1 -0
  30. package/dist/models/AdminConceptDiagram.d.ts +19 -1
  31. package/dist/models/AdminConceptDiagram.js +12 -0
  32. package/dist/models/AdminConceptDiagramDetail.d.ts +19 -1
  33. package/dist/models/AdminConceptDiagramDetail.js +12 -0
  34. package/dist/models/AdminConceptImage.d.ts +19 -1
  35. package/dist/models/AdminConceptImage.js +12 -0
  36. package/dist/models/AdminConceptImageDetail.d.ts +19 -1
  37. package/dist/models/AdminConceptImageDetail.js +12 -0
  38. package/dist/models/AdminShownConceptDiagram.d.ts +19 -1
  39. package/dist/models/AdminShownConceptDiagram.js +12 -0
  40. package/dist/models/AdminShownConceptImage.d.ts +19 -1
  41. package/dist/models/AdminShownConceptImage.js +12 -0
  42. package/dist/models/ConceptMediaFlagResult.d.ts +32 -0
  43. package/dist/models/ConceptMediaFlagResult.js +50 -0
  44. package/dist/models/index.d.ts +1 -0
  45. package/dist/models/index.js +1 -0
  46. package/package.json +1 -1
@@ -720,7 +720,7 @@ export class AdminApi extends runtime.BaseAPI {
720
720
  });
721
721
  }
722
722
  /**
723
- * 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.
723
+ * 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.
724
724
  * Hide a concept diagram from learners
725
725
  */
726
726
  adminHideConceptDiagramRaw(requestParameters, initOverrides) {
@@ -751,7 +751,7 @@ export class AdminApi extends runtime.BaseAPI {
751
751
  });
752
752
  }
753
753
  /**
754
- * 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.
754
+ * 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.
755
755
  * Hide a concept diagram from learners
756
756
  */
757
757
  adminHideConceptDiagram(requestParameters, initOverrides) {
@@ -761,7 +761,7 @@ export class AdminApi extends runtime.BaseAPI {
761
761
  });
762
762
  }
763
763
  /**
764
- * 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).
764
+ * 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).
765
765
  * Hide a concept image from learners
766
766
  */
767
767
  adminHideConceptImageRaw(requestParameters, initOverrides) {
@@ -792,7 +792,7 @@ export class AdminApi extends runtime.BaseAPI {
792
792
  });
793
793
  }
794
794
  /**
795
- * 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).
795
+ * 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).
796
796
  * Hide a concept image from learners
797
797
  */
798
798
  adminHideConceptImage(requestParameters, initOverrides) {
@@ -1494,7 +1494,7 @@ export class AdminApi extends runtime.BaseAPI {
1494
1494
  });
1495
1495
  }
1496
1496
  /**
1497
- * 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.
1497
+ * 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.
1498
1498
  * Restore a soft-deleted concept diagram
1499
1499
  */
1500
1500
  adminRestoreConceptDiagramRaw(requestParameters, initOverrides) {
@@ -1525,7 +1525,7 @@ export class AdminApi extends runtime.BaseAPI {
1525
1525
  });
1526
1526
  }
1527
1527
  /**
1528
- * 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.
1528
+ * 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.
1529
1529
  * Restore a soft-deleted concept diagram
1530
1530
  */
1531
1531
  adminRestoreConceptDiagram(requestParameters, initOverrides) {
@@ -1535,7 +1535,7 @@ export class AdminApi extends runtime.BaseAPI {
1535
1535
  });
1536
1536
  }
1537
1537
  /**
1538
- * 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.
1538
+ * 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.
1539
1539
  * Restore a soft-deleted concept image
1540
1540
  */
1541
1541
  adminRestoreConceptImageRaw(requestParameters, initOverrides) {
@@ -1566,7 +1566,7 @@ export class AdminApi extends runtime.BaseAPI {
1566
1566
  });
1567
1567
  }
1568
1568
  /**
1569
- * 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.
1569
+ * 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.
1570
1570
  * Restore a soft-deleted concept image
1571
1571
  */
1572
1572
  adminRestoreConceptImage(requestParameters, initOverrides) {
@@ -1619,7 +1619,7 @@ export class AdminApi extends runtime.BaseAPI {
1619
1619
  });
1620
1620
  }
1621
1621
  /**
1622
- * 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.
1622
+ * 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.
1623
1623
  * Show a hidden concept diagram to learners
1624
1624
  */
1625
1625
  adminShowConceptDiagramRaw(requestParameters, initOverrides) {
@@ -1652,7 +1652,7 @@ export class AdminApi extends runtime.BaseAPI {
1652
1652
  });
1653
1653
  }
1654
1654
  /**
1655
- * 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.
1655
+ * 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.
1656
1656
  * Show a hidden concept diagram to learners
1657
1657
  */
1658
1658
  adminShowConceptDiagram(requestParameters, initOverrides) {
@@ -1662,7 +1662,7 @@ export class AdminApi extends runtime.BaseAPI {
1662
1662
  });
1663
1663
  }
1664
1664
  /**
1665
- * 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).
1665
+ * 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).
1666
1666
  * Show a hidden concept image to learners
1667
1667
  */
1668
1668
  adminShowConceptImageRaw(requestParameters, initOverrides) {
@@ -1695,7 +1695,7 @@ export class AdminApi extends runtime.BaseAPI {
1695
1695
  });
1696
1696
  }
1697
1697
  /**
1698
- * 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).
1698
+ * 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).
1699
1699
  * Show a hidden concept image to learners
1700
1700
  */
1701
1701
  adminShowConceptImage(requestParameters, initOverrides) {
@@ -1795,6 +1795,7 @@ export const AdminListConceptDiagramsStateEnum = {
1795
1795
  NotDeleted: 'not_deleted',
1796
1796
  Visible: 'visible',
1797
1797
  Hidden: 'hidden',
1798
+ Flagged: 'flagged',
1798
1799
  Deleted: 'deleted',
1799
1800
  All: 'all'
1800
1801
  };
@@ -1812,6 +1813,7 @@ export const AdminListConceptImagesStateEnum = {
1812
1813
  NotDeleted: 'not_deleted',
1813
1814
  Visible: 'visible',
1814
1815
  Hidden: 'hidden',
1816
+ Flagged: 'flagged',
1815
1817
  Deleted: 'deleted',
1816
1818
  All: 'all'
1817
1819
  };
@@ -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
@@ -21,11 +21,52 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
- import { ConceptDiagramDetailFromJSON, PaginatedConceptDiagramsFromJSON, } from '../models/index';
24
+ import { ConceptDiagramDetailFromJSON, ConceptMediaFlagResultFromJSON, PaginatedConceptDiagramsFromJSON, } from '../models/index';
25
25
  /**
26
26
  *
27
27
  */
28
28
  export class ConceptDiagramsApi extends runtime.BaseAPI {
29
+ /**
30
+ * 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.
31
+ * Flag a concept diagram so learners stop being shown it
32
+ */
33
+ flagConceptDiagramRaw(requestParameters, initOverrides) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ if (requestParameters['xUserId'] == null) {
36
+ throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling flagConceptDiagram().');
37
+ }
38
+ if (requestParameters['diagramId'] == null) {
39
+ throw new runtime.RequiredError('diagramId', 'Required parameter "diagramId" was null or undefined when calling flagConceptDiagram().');
40
+ }
41
+ const queryParameters = {};
42
+ const headerParameters = {};
43
+ if (requestParameters['xUserId'] != null) {
44
+ headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
45
+ }
46
+ if (this.configuration && this.configuration.apiKey) {
47
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
48
+ }
49
+ let urlPath = `/api/v1/concept-diagrams/{diagramId}/flag`;
50
+ urlPath = urlPath.replace(`{${"diagramId"}}`, encodeURIComponent(String(requestParameters['diagramId'])));
51
+ const response = yield this.request({
52
+ path: urlPath,
53
+ method: 'POST',
54
+ headers: headerParameters,
55
+ query: queryParameters,
56
+ }, initOverrides);
57
+ return new runtime.JSONApiResponse(response, (jsonValue) => ConceptMediaFlagResultFromJSON(jsonValue));
58
+ });
59
+ }
60
+ /**
61
+ * 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.
62
+ * Flag a concept diagram so learners stop being shown it
63
+ */
64
+ flagConceptDiagram(requestParameters, initOverrides) {
65
+ return __awaiter(this, void 0, void 0, function* () {
66
+ const response = yield this.flagConceptDiagramRaw(requestParameters, initOverrides);
67
+ return yield response.value();
68
+ });
69
+ }
29
70
  /**
30
71
  * Returns one non-hidden diagram the authenticated user authored, including its assembled HTML document.
31
72
  * 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
@@ -21,11 +21,52 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
- import { PaginatedConceptImagesFromJSON, } from '../models/index';
24
+ import { ConceptMediaFlagResultFromJSON, PaginatedConceptImagesFromJSON, } from '../models/index';
25
25
  /**
26
26
  *
27
27
  */
28
28
  export class ConceptImagesApi extends runtime.BaseAPI {
29
+ /**
30
+ * 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).
31
+ * Flag a concept image so learners stop being shown it
32
+ */
33
+ flagConceptImageRaw(requestParameters, initOverrides) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ if (requestParameters['xUserId'] == null) {
36
+ throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling flagConceptImage().');
37
+ }
38
+ if (requestParameters['imageId'] == null) {
39
+ throw new runtime.RequiredError('imageId', 'Required parameter "imageId" was null or undefined when calling flagConceptImage().');
40
+ }
41
+ const queryParameters = {};
42
+ const headerParameters = {};
43
+ if (requestParameters['xUserId'] != null) {
44
+ headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
45
+ }
46
+ if (this.configuration && this.configuration.apiKey) {
47
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
48
+ }
49
+ let urlPath = `/api/v1/concept-images/{imageId}/flag`;
50
+ urlPath = urlPath.replace(`{${"imageId"}}`, encodeURIComponent(String(requestParameters['imageId'])));
51
+ const response = yield this.request({
52
+ path: urlPath,
53
+ method: 'POST',
54
+ headers: headerParameters,
55
+ query: queryParameters,
56
+ }, initOverrides);
57
+ return new runtime.JSONApiResponse(response, (jsonValue) => ConceptMediaFlagResultFromJSON(jsonValue));
58
+ });
59
+ }
60
+ /**
61
+ * 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).
62
+ * Flag a concept image so learners stop being shown it
63
+ */
64
+ flagConceptImage(requestParameters, initOverrides) {
65
+ return __awaiter(this, void 0, void 0, function* () {
66
+ const response = yield this.flagConceptImageRaw(requestParameters, initOverrides);
67
+ return yield response.value();
68
+ });
69
+ }
29
70
  /**
30
71
  * 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.
31
72
  * List the concept images the user generated
@@ -72,11 +72,29 @@ export interface AdminConceptDiagram {
72
72
  */
73
73
  hiddenAt: Date | null;
74
74
  /**
75
- * Who hid it, when that account user is in the caller's account.
75
+ * Who hid it, when that account user is in the caller's account. For a hide from a learner flag (see hiddenByFlag), the learner who flagged it.
76
76
  * @type {AdminConceptMediaActor}
77
77
  * @memberof AdminConceptDiagram
78
78
  */
79
79
  hiddenBy: AdminConceptMediaActor | null;
80
+ /**
81
+ * True when the current hide came from a learner's thumbs-down flag rather than an admin. False when visible or hidden by an admin. List these with state=flagged.
82
+ * @type {boolean}
83
+ * @memberof AdminConceptDiagram
84
+ */
85
+ hiddenByFlag: boolean;
86
+ /**
87
+ * When an admin last showed (approved) it. A learner flag never hides an approved row. Cleared when an admin hides it again (hide, restore, or showing another version with hideOtherVersions).
88
+ * @type {Date}
89
+ * @memberof AdminConceptDiagram
90
+ */
91
+ approvedAt: Date | null;
92
+ /**
93
+ * Who approved it, when that account user is in the caller's account.
94
+ * @type {AdminConceptMediaActor}
95
+ * @memberof AdminConceptDiagram
96
+ */
97
+ approvedBy: AdminConceptMediaActor | null;
80
98
  /**
81
99
  *
82
100
  * @type {Date}
@@ -52,6 +52,12 @@ export function instanceOfAdminConceptDiagram(value) {
52
52
  return false;
53
53
  if (!('hiddenBy' in value) || value['hiddenBy'] === undefined)
54
54
  return false;
55
+ if (!('hiddenByFlag' in value) || value['hiddenByFlag'] === undefined)
56
+ return false;
57
+ if (!('approvedAt' in value) || value['approvedAt'] === undefined)
58
+ return false;
59
+ if (!('approvedBy' in value) || value['approvedBy'] === undefined)
60
+ return false;
55
61
  if (!('deletedAt' in value) || value['deletedAt'] === undefined)
56
62
  return false;
57
63
  if (!('deletedBy' in value) || value['deletedBy'] === undefined)
@@ -92,6 +98,9 @@ export function AdminConceptDiagramFromJSONTyped(json, ignoreDiscriminator) {
92
98
  'createdAt': (new Date(json['createdAt'])),
93
99
  'hiddenAt': (json['hiddenAt'] == null ? null : new Date(json['hiddenAt'])),
94
100
  'hiddenBy': AdminConceptMediaActorFromJSON(json['hiddenBy']),
101
+ 'hiddenByFlag': json['hiddenByFlag'],
102
+ 'approvedAt': (json['approvedAt'] == null ? null : new Date(json['approvedAt'])),
103
+ 'approvedBy': AdminConceptMediaActorFromJSON(json['approvedBy']),
95
104
  'deletedAt': (json['deletedAt'] == null ? null : new Date(json['deletedAt'])),
96
105
  'deletedBy': AdminConceptMediaActorFromJSON(json['deletedBy']),
97
106
  'model': json['model'],
@@ -122,6 +131,9 @@ export function AdminConceptDiagramToJSONTyped(value, ignoreDiscriminator = fals
122
131
  'createdAt': value['createdAt'].toISOString(),
123
132
  'hiddenAt': value['hiddenAt'] == null ? value['hiddenAt'] : value['hiddenAt'].toISOString(),
124
133
  'hiddenBy': AdminConceptMediaActorToJSON(value['hiddenBy']),
134
+ 'hiddenByFlag': value['hiddenByFlag'],
135
+ 'approvedAt': value['approvedAt'] == null ? value['approvedAt'] : value['approvedAt'].toISOString(),
136
+ 'approvedBy': AdminConceptMediaActorToJSON(value['approvedBy']),
125
137
  'deletedAt': value['deletedAt'] == null ? value['deletedAt'] : value['deletedAt'].toISOString(),
126
138
  'deletedBy': AdminConceptMediaActorToJSON(value['deletedBy']),
127
139
  'model': value['model'],
@@ -74,11 +74,29 @@ export interface AdminConceptDiagramDetail {
74
74
  */
75
75
  hiddenAt: Date | null;
76
76
  /**
77
- * Who hid it, when that account user is in the caller's account.
77
+ * Who hid it, when that account user is in the caller's account. For a hide from a learner flag (see hiddenByFlag), the learner who flagged it.
78
78
  * @type {AdminConceptMediaActor}
79
79
  * @memberof AdminConceptDiagramDetail
80
80
  */
81
81
  hiddenBy: AdminConceptMediaActor | null;
82
+ /**
83
+ * True when the current hide came from a learner's thumbs-down flag rather than an admin. False when visible or hidden by an admin. List these with state=flagged.
84
+ * @type {boolean}
85
+ * @memberof AdminConceptDiagramDetail
86
+ */
87
+ hiddenByFlag: boolean;
88
+ /**
89
+ * When an admin last showed (approved) it. A learner flag never hides an approved row. Cleared when an admin hides it again (hide, restore, or showing another version with hideOtherVersions).
90
+ * @type {Date}
91
+ * @memberof AdminConceptDiagramDetail
92
+ */
93
+ approvedAt: Date | null;
94
+ /**
95
+ * Who approved it, when that account user is in the caller's account.
96
+ * @type {AdminConceptMediaActor}
97
+ * @memberof AdminConceptDiagramDetail
98
+ */
99
+ approvedBy: AdminConceptMediaActor | null;
82
100
  /**
83
101
  *
84
102
  * @type {Date}
@@ -54,6 +54,12 @@ export function instanceOfAdminConceptDiagramDetail(value) {
54
54
  return false;
55
55
  if (!('hiddenBy' in value) || value['hiddenBy'] === undefined)
56
56
  return false;
57
+ if (!('hiddenByFlag' in value) || value['hiddenByFlag'] === undefined)
58
+ return false;
59
+ if (!('approvedAt' in value) || value['approvedAt'] === undefined)
60
+ return false;
61
+ if (!('approvedBy' in value) || value['approvedBy'] === undefined)
62
+ return false;
57
63
  if (!('deletedAt' in value) || value['deletedAt'] === undefined)
58
64
  return false;
59
65
  if (!('deletedBy' in value) || value['deletedBy'] === undefined)
@@ -106,6 +112,9 @@ export function AdminConceptDiagramDetailFromJSONTyped(json, ignoreDiscriminator
106
112
  'createdAt': (new Date(json['createdAt'])),
107
113
  'hiddenAt': (json['hiddenAt'] == null ? null : new Date(json['hiddenAt'])),
108
114
  'hiddenBy': AdminConceptMediaActorFromJSON(json['hiddenBy']),
115
+ 'hiddenByFlag': json['hiddenByFlag'],
116
+ 'approvedAt': (json['approvedAt'] == null ? null : new Date(json['approvedAt'])),
117
+ 'approvedBy': AdminConceptMediaActorFromJSON(json['approvedBy']),
109
118
  'deletedAt': (json['deletedAt'] == null ? null : new Date(json['deletedAt'])),
110
119
  'deletedBy': AdminConceptMediaActorFromJSON(json['deletedBy']),
111
120
  'model': json['model'],
@@ -142,6 +151,9 @@ export function AdminConceptDiagramDetailToJSONTyped(value, ignoreDiscriminator
142
151
  'createdAt': value['createdAt'].toISOString(),
143
152
  'hiddenAt': value['hiddenAt'] == null ? value['hiddenAt'] : value['hiddenAt'].toISOString(),
144
153
  'hiddenBy': AdminConceptMediaActorToJSON(value['hiddenBy']),
154
+ 'hiddenByFlag': value['hiddenByFlag'],
155
+ 'approvedAt': value['approvedAt'] == null ? value['approvedAt'] : value['approvedAt'].toISOString(),
156
+ 'approvedBy': AdminConceptMediaActorToJSON(value['approvedBy']),
145
157
  'deletedAt': value['deletedAt'] == null ? value['deletedAt'] : value['deletedAt'].toISOString(),
146
158
  'deletedBy': AdminConceptMediaActorToJSON(value['deletedBy']),
147
159
  'model': value['model'],
@@ -72,11 +72,29 @@ export interface AdminConceptImage {
72
72
  */
73
73
  hiddenAt: Date | null;
74
74
  /**
75
- * Who hid it, when that account user is in the caller's account.
75
+ * Who hid it, when that account user is in the caller's account. For a hide from a learner flag (see hiddenByFlag), the learner who flagged it.
76
76
  * @type {AdminConceptMediaActor}
77
77
  * @memberof AdminConceptImage
78
78
  */
79
79
  hiddenBy: AdminConceptMediaActor | null;
80
+ /**
81
+ * True when the current hide came from a learner's thumbs-down flag rather than an admin. False when visible or hidden by an admin. List these with state=flagged.
82
+ * @type {boolean}
83
+ * @memberof AdminConceptImage
84
+ */
85
+ hiddenByFlag: boolean;
86
+ /**
87
+ * When an admin last showed (approved) it. A learner flag never hides an approved row. Cleared when an admin hides it again (hide, restore, or showing another version with hideOtherVersions).
88
+ * @type {Date}
89
+ * @memberof AdminConceptImage
90
+ */
91
+ approvedAt: Date | null;
92
+ /**
93
+ * Who approved it, when that account user is in the caller's account.
94
+ * @type {AdminConceptMediaActor}
95
+ * @memberof AdminConceptImage
96
+ */
97
+ approvedBy: AdminConceptMediaActor | null;
80
98
  /**
81
99
  *
82
100
  * @type {Date}
@@ -52,6 +52,12 @@ export function instanceOfAdminConceptImage(value) {
52
52
  return false;
53
53
  if (!('hiddenBy' in value) || value['hiddenBy'] === undefined)
54
54
  return false;
55
+ if (!('hiddenByFlag' in value) || value['hiddenByFlag'] === undefined)
56
+ return false;
57
+ if (!('approvedAt' in value) || value['approvedAt'] === undefined)
58
+ return false;
59
+ if (!('approvedBy' in value) || value['approvedBy'] === undefined)
60
+ return false;
55
61
  if (!('deletedAt' in value) || value['deletedAt'] === undefined)
56
62
  return false;
57
63
  if (!('deletedBy' in value) || value['deletedBy'] === undefined)
@@ -98,6 +104,9 @@ export function AdminConceptImageFromJSONTyped(json, ignoreDiscriminator) {
98
104
  'createdAt': (new Date(json['createdAt'])),
99
105
  'hiddenAt': (json['hiddenAt'] == null ? null : new Date(json['hiddenAt'])),
100
106
  'hiddenBy': AdminConceptMediaActorFromJSON(json['hiddenBy']),
107
+ 'hiddenByFlag': json['hiddenByFlag'],
108
+ 'approvedAt': (json['approvedAt'] == null ? null : new Date(json['approvedAt'])),
109
+ 'approvedBy': AdminConceptMediaActorFromJSON(json['approvedBy']),
101
110
  'deletedAt': (json['deletedAt'] == null ? null : new Date(json['deletedAt'])),
102
111
  'deletedBy': AdminConceptMediaActorFromJSON(json['deletedBy']),
103
112
  'model': json['model'],
@@ -131,6 +140,9 @@ export function AdminConceptImageToJSONTyped(value, ignoreDiscriminator = false)
131
140
  'createdAt': value['createdAt'].toISOString(),
132
141
  'hiddenAt': value['hiddenAt'] == null ? value['hiddenAt'] : value['hiddenAt'].toISOString(),
133
142
  'hiddenBy': AdminConceptMediaActorToJSON(value['hiddenBy']),
143
+ 'hiddenByFlag': value['hiddenByFlag'],
144
+ 'approvedAt': value['approvedAt'] == null ? value['approvedAt'] : value['approvedAt'].toISOString(),
145
+ 'approvedBy': AdminConceptMediaActorToJSON(value['approvedBy']),
134
146
  'deletedAt': value['deletedAt'] == null ? value['deletedAt'] : value['deletedAt'].toISOString(),
135
147
  'deletedBy': AdminConceptMediaActorToJSON(value['deletedBy']),
136
148
  'model': value['model'],
@@ -74,11 +74,29 @@ export interface AdminConceptImageDetail {
74
74
  */
75
75
  hiddenAt: Date | null;
76
76
  /**
77
- * Who hid it, when that account user is in the caller's account.
77
+ * Who hid it, when that account user is in the caller's account. For a hide from a learner flag (see hiddenByFlag), the learner who flagged it.
78
78
  * @type {AdminConceptMediaActor}
79
79
  * @memberof AdminConceptImageDetail
80
80
  */
81
81
  hiddenBy: AdminConceptMediaActor | null;
82
+ /**
83
+ * True when the current hide came from a learner's thumbs-down flag rather than an admin. False when visible or hidden by an admin. List these with state=flagged.
84
+ * @type {boolean}
85
+ * @memberof AdminConceptImageDetail
86
+ */
87
+ hiddenByFlag: boolean;
88
+ /**
89
+ * When an admin last showed (approved) it. A learner flag never hides an approved row. Cleared when an admin hides it again (hide, restore, or showing another version with hideOtherVersions).
90
+ * @type {Date}
91
+ * @memberof AdminConceptImageDetail
92
+ */
93
+ approvedAt: Date | null;
94
+ /**
95
+ * Who approved it, when that account user is in the caller's account.
96
+ * @type {AdminConceptMediaActor}
97
+ * @memberof AdminConceptImageDetail
98
+ */
99
+ approvedBy: AdminConceptMediaActor | null;
82
100
  /**
83
101
  *
84
102
  * @type {Date}
@@ -54,6 +54,12 @@ export function instanceOfAdminConceptImageDetail(value) {
54
54
  return false;
55
55
  if (!('hiddenBy' in value) || value['hiddenBy'] === undefined)
56
56
  return false;
57
+ if (!('hiddenByFlag' in value) || value['hiddenByFlag'] === undefined)
58
+ return false;
59
+ if (!('approvedAt' in value) || value['approvedAt'] === undefined)
60
+ return false;
61
+ if (!('approvedBy' in value) || value['approvedBy'] === undefined)
62
+ return false;
57
63
  if (!('deletedAt' in value) || value['deletedAt'] === undefined)
58
64
  return false;
59
65
  if (!('deletedBy' in value) || value['deletedBy'] === undefined)
@@ -112,6 +118,9 @@ export function AdminConceptImageDetailFromJSONTyped(json, ignoreDiscriminator)
112
118
  'createdAt': (new Date(json['createdAt'])),
113
119
  'hiddenAt': (json['hiddenAt'] == null ? null : new Date(json['hiddenAt'])),
114
120
  'hiddenBy': AdminConceptMediaActorFromJSON(json['hiddenBy']),
121
+ 'hiddenByFlag': json['hiddenByFlag'],
122
+ 'approvedAt': (json['approvedAt'] == null ? null : new Date(json['approvedAt'])),
123
+ 'approvedBy': AdminConceptMediaActorFromJSON(json['approvedBy']),
115
124
  'deletedAt': (json['deletedAt'] == null ? null : new Date(json['deletedAt'])),
116
125
  'deletedBy': AdminConceptMediaActorFromJSON(json['deletedBy']),
117
126
  'model': json['model'],
@@ -151,6 +160,9 @@ export function AdminConceptImageDetailToJSONTyped(value, ignoreDiscriminator =
151
160
  'createdAt': value['createdAt'].toISOString(),
152
161
  'hiddenAt': value['hiddenAt'] == null ? value['hiddenAt'] : value['hiddenAt'].toISOString(),
153
162
  'hiddenBy': AdminConceptMediaActorToJSON(value['hiddenBy']),
163
+ 'hiddenByFlag': value['hiddenByFlag'],
164
+ 'approvedAt': value['approvedAt'] == null ? value['approvedAt'] : value['approvedAt'].toISOString(),
165
+ 'approvedBy': AdminConceptMediaActorToJSON(value['approvedBy']),
154
166
  'deletedAt': value['deletedAt'] == null ? value['deletedAt'] : value['deletedAt'].toISOString(),
155
167
  'deletedBy': AdminConceptMediaActorToJSON(value['deletedBy']),
156
168
  'model': value['model'],
@@ -74,11 +74,29 @@ export interface AdminShownConceptDiagram {
74
74
  */
75
75
  hiddenAt: Date | null;
76
76
  /**
77
- * Who hid it, when that account user is in the caller's account.
77
+ * Who hid it, when that account user is in the caller's account. For a hide from a learner flag (see hiddenByFlag), the learner who flagged it.
78
78
  * @type {AdminConceptMediaActor}
79
79
  * @memberof AdminShownConceptDiagram
80
80
  */
81
81
  hiddenBy: AdminConceptMediaActor | null;
82
+ /**
83
+ * True when the current hide came from a learner's thumbs-down flag rather than an admin. False when visible or hidden by an admin. List these with state=flagged.
84
+ * @type {boolean}
85
+ * @memberof AdminShownConceptDiagram
86
+ */
87
+ hiddenByFlag: boolean;
88
+ /**
89
+ * When an admin last showed (approved) it. A learner flag never hides an approved row. Cleared when an admin hides it again (hide, restore, or showing another version with hideOtherVersions).
90
+ * @type {Date}
91
+ * @memberof AdminShownConceptDiagram
92
+ */
93
+ approvedAt: Date | null;
94
+ /**
95
+ * Who approved it, when that account user is in the caller's account.
96
+ * @type {AdminConceptMediaActor}
97
+ * @memberof AdminShownConceptDiagram
98
+ */
99
+ approvedBy: AdminConceptMediaActor | null;
82
100
  /**
83
101
  *
84
102
  * @type {Date}
@@ -54,6 +54,12 @@ export function instanceOfAdminShownConceptDiagram(value) {
54
54
  return false;
55
55
  if (!('hiddenBy' in value) || value['hiddenBy'] === undefined)
56
56
  return false;
57
+ if (!('hiddenByFlag' in value) || value['hiddenByFlag'] === undefined)
58
+ return false;
59
+ if (!('approvedAt' in value) || value['approvedAt'] === undefined)
60
+ return false;
61
+ if (!('approvedBy' in value) || value['approvedBy'] === undefined)
62
+ return false;
57
63
  if (!('deletedAt' in value) || value['deletedAt'] === undefined)
58
64
  return false;
59
65
  if (!('deletedBy' in value) || value['deletedBy'] === undefined)
@@ -110,6 +116,9 @@ export function AdminShownConceptDiagramFromJSONTyped(json, ignoreDiscriminator)
110
116
  'createdAt': (new Date(json['createdAt'])),
111
117
  'hiddenAt': (json['hiddenAt'] == null ? null : new Date(json['hiddenAt'])),
112
118
  'hiddenBy': AdminConceptMediaActorFromJSON(json['hiddenBy']),
119
+ 'hiddenByFlag': json['hiddenByFlag'],
120
+ 'approvedAt': (json['approvedAt'] == null ? null : new Date(json['approvedAt'])),
121
+ 'approvedBy': AdminConceptMediaActorFromJSON(json['approvedBy']),
113
122
  'deletedAt': (json['deletedAt'] == null ? null : new Date(json['deletedAt'])),
114
123
  'deletedBy': AdminConceptMediaActorFromJSON(json['deletedBy']),
115
124
  'model': json['model'],
@@ -148,6 +157,9 @@ export function AdminShownConceptDiagramToJSONTyped(value, ignoreDiscriminator =
148
157
  'createdAt': value['createdAt'].toISOString(),
149
158
  'hiddenAt': value['hiddenAt'] == null ? value['hiddenAt'] : value['hiddenAt'].toISOString(),
150
159
  'hiddenBy': AdminConceptMediaActorToJSON(value['hiddenBy']),
160
+ 'hiddenByFlag': value['hiddenByFlag'],
161
+ 'approvedAt': value['approvedAt'] == null ? value['approvedAt'] : value['approvedAt'].toISOString(),
162
+ 'approvedBy': AdminConceptMediaActorToJSON(value['approvedBy']),
151
163
  'deletedAt': value['deletedAt'] == null ? value['deletedAt'] : value['deletedAt'].toISOString(),
152
164
  'deletedBy': AdminConceptMediaActorToJSON(value['deletedBy']),
153
165
  'model': value['model'],