@instructure/athena-api-client 4.0.0 → 4.0.2

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 (102) hide show
  1. package/README.md +19 -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/apis/StudyGuidesApi.d.ts +112 -0
  9. package/dist/apis/StudyGuidesApi.js +312 -0
  10. package/dist/apis/index.d.ts +1 -0
  11. package/dist/apis/index.js +1 -0
  12. package/dist/esm/apis/AdminApi.d.ts +14 -12
  13. package/dist/esm/apis/AdminApi.js +14 -12
  14. package/dist/esm/apis/ConceptDiagramsApi.d.ts +15 -1
  15. package/dist/esm/apis/ConceptDiagramsApi.js +42 -1
  16. package/dist/esm/apis/ConceptImagesApi.d.ts +15 -1
  17. package/dist/esm/apis/ConceptImagesApi.js +42 -1
  18. package/dist/esm/apis/StudyGuidesApi.d.ts +112 -0
  19. package/dist/esm/apis/StudyGuidesApi.js +308 -0
  20. package/dist/esm/apis/index.d.ts +1 -0
  21. package/dist/esm/apis/index.js +1 -0
  22. package/dist/esm/models/AdminConceptDiagram.d.ts +19 -1
  23. package/dist/esm/models/AdminConceptDiagram.js +12 -0
  24. package/dist/esm/models/AdminConceptDiagramDetail.d.ts +19 -1
  25. package/dist/esm/models/AdminConceptDiagramDetail.js +12 -0
  26. package/dist/esm/models/AdminConceptImage.d.ts +19 -1
  27. package/dist/esm/models/AdminConceptImage.js +12 -0
  28. package/dist/esm/models/AdminConceptImageDetail.d.ts +19 -1
  29. package/dist/esm/models/AdminConceptImageDetail.js +12 -0
  30. package/dist/esm/models/AdminShownConceptDiagram.d.ts +19 -1
  31. package/dist/esm/models/AdminShownConceptDiagram.js +12 -0
  32. package/dist/esm/models/AdminShownConceptImage.d.ts +19 -1
  33. package/dist/esm/models/AdminShownConceptImage.js +12 -0
  34. package/dist/esm/models/AssociateUserFileRequest.d.ts +1 -0
  35. package/dist/esm/models/AssociateUserFileRequest.js +2 -1
  36. package/dist/esm/models/ConceptMediaFlagResult.d.ts +32 -0
  37. package/dist/esm/models/ConceptMediaFlagResult.js +43 -0
  38. package/dist/esm/models/CreateStudyGuideQuizRequest.d.ts +46 -0
  39. package/dist/esm/models/CreateStudyGuideQuizRequest.js +50 -0
  40. package/dist/esm/models/CreateStudyGuideRequest.d.ts +74 -0
  41. package/dist/esm/models/CreateStudyGuideRequest.js +55 -0
  42. package/dist/esm/models/PaginatedStudyGuides.d.ts +39 -0
  43. package/dist/esm/models/PaginatedStudyGuides.js +48 -0
  44. package/dist/esm/models/RegenerateStudyGuideRequest.d.ts +38 -0
  45. package/dist/esm/models/RegenerateStudyGuideRequest.js +43 -0
  46. package/dist/esm/models/StudyGuide.d.ts +153 -0
  47. package/dist/esm/models/StudyGuide.js +127 -0
  48. package/dist/esm/models/StudyGuideConcept.d.ts +68 -0
  49. package/dist/esm/models/StudyGuideConcept.js +67 -0
  50. package/dist/esm/models/StudyGuideFile.d.ts +56 -0
  51. package/dist/esm/models/StudyGuideFile.js +59 -0
  52. package/dist/esm/models/StudyGuideListItem.d.ts +102 -0
  53. package/dist/esm/models/StudyGuideListItem.js +92 -0
  54. package/dist/esm/models/StudyGuideQuiz.d.ts +58 -0
  55. package/dist/esm/models/StudyGuideQuiz.js +62 -0
  56. package/dist/esm/models/StudyGuideSourceSummary.d.ts +56 -0
  57. package/dist/esm/models/StudyGuideSourceSummary.js +59 -0
  58. package/dist/esm/models/UserFileAssociation.d.ts +1 -0
  59. package/dist/esm/models/UserFileAssociation.js +2 -1
  60. package/dist/esm/models/index.d.ts +11 -0
  61. package/dist/esm/models/index.js +11 -0
  62. package/dist/models/AdminConceptDiagram.d.ts +19 -1
  63. package/dist/models/AdminConceptDiagram.js +12 -0
  64. package/dist/models/AdminConceptDiagramDetail.d.ts +19 -1
  65. package/dist/models/AdminConceptDiagramDetail.js +12 -0
  66. package/dist/models/AdminConceptImage.d.ts +19 -1
  67. package/dist/models/AdminConceptImage.js +12 -0
  68. package/dist/models/AdminConceptImageDetail.d.ts +19 -1
  69. package/dist/models/AdminConceptImageDetail.js +12 -0
  70. package/dist/models/AdminShownConceptDiagram.d.ts +19 -1
  71. package/dist/models/AdminShownConceptDiagram.js +12 -0
  72. package/dist/models/AdminShownConceptImage.d.ts +19 -1
  73. package/dist/models/AdminShownConceptImage.js +12 -0
  74. package/dist/models/AssociateUserFileRequest.d.ts +1 -0
  75. package/dist/models/AssociateUserFileRequest.js +2 -1
  76. package/dist/models/ConceptMediaFlagResult.d.ts +32 -0
  77. package/dist/models/ConceptMediaFlagResult.js +50 -0
  78. package/dist/models/CreateStudyGuideQuizRequest.d.ts +46 -0
  79. package/dist/models/CreateStudyGuideQuizRequest.js +58 -0
  80. package/dist/models/CreateStudyGuideRequest.d.ts +74 -0
  81. package/dist/models/CreateStudyGuideRequest.js +62 -0
  82. package/dist/models/PaginatedStudyGuides.d.ts +39 -0
  83. package/dist/models/PaginatedStudyGuides.js +55 -0
  84. package/dist/models/RegenerateStudyGuideRequest.d.ts +38 -0
  85. package/dist/models/RegenerateStudyGuideRequest.js +50 -0
  86. package/dist/models/StudyGuide.d.ts +153 -0
  87. package/dist/models/StudyGuide.js +135 -0
  88. package/dist/models/StudyGuideConcept.d.ts +68 -0
  89. package/dist/models/StudyGuideConcept.js +74 -0
  90. package/dist/models/StudyGuideFile.d.ts +56 -0
  91. package/dist/models/StudyGuideFile.js +66 -0
  92. package/dist/models/StudyGuideListItem.d.ts +102 -0
  93. package/dist/models/StudyGuideListItem.js +100 -0
  94. package/dist/models/StudyGuideQuiz.d.ts +58 -0
  95. package/dist/models/StudyGuideQuiz.js +70 -0
  96. package/dist/models/StudyGuideSourceSummary.d.ts +56 -0
  97. package/dist/models/StudyGuideSourceSummary.js +66 -0
  98. package/dist/models/UserFileAssociation.d.ts +1 -0
  99. package/dist/models/UserFileAssociation.js +2 -1
  100. package/dist/models/index.d.ts +11 -0
  101. package/dist/models/index.js +11 -0
  102. package/package.json +1 -1
@@ -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
@@ -0,0 +1,112 @@
1
+ /**
2
+ * Athena API
3
+ * REST API for the Athena system
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { CreateStudyGuideQuizRequest, CreateStudyGuideRequest, PaginatedStudyGuides, RegenerateStudyGuideRequest, StudyGuide, StudyGuideQuiz } from '../models/index';
14
+ export interface CreateStudyGuideOperationRequest {
15
+ xUserId: string;
16
+ createStudyGuideRequest: CreateStudyGuideRequest;
17
+ xCanvasDomain?: string;
18
+ xCanvasToken?: string;
19
+ }
20
+ export interface CreateStudyGuideQuizOperationRequest {
21
+ xUserId: string;
22
+ studyGuideId: string;
23
+ createStudyGuideQuizRequest: CreateStudyGuideQuizRequest;
24
+ }
25
+ export interface DeleteStudyGuideRequest {
26
+ xUserId: string;
27
+ studyGuideId: string;
28
+ }
29
+ export interface GetStudyGuideRequest {
30
+ xUserId: string;
31
+ studyGuideId: string;
32
+ }
33
+ export interface ListStudyGuidesRequest {
34
+ xUserId: string;
35
+ limit?: number;
36
+ cursor?: string;
37
+ studySpaceId?: string;
38
+ studyObjectiveId?: string;
39
+ courseId?: string;
40
+ }
41
+ export interface RegenerateStudyGuideOperationRequest {
42
+ xUserId: string;
43
+ studyGuideId: string;
44
+ regenerateStudyGuideRequest: RegenerateStudyGuideRequest;
45
+ xCanvasDomain?: string;
46
+ xCanvasToken?: string;
47
+ }
48
+ /**
49
+ *
50
+ */
51
+ export declare class StudyGuidesApi extends runtime.BaseAPI {
52
+ /**
53
+ * Creates a study guide for one assessment and starts generation in the background; the row comes back in status \'generating\' and the client polls GET /api/v1/study-guides/{studyGuideId}. Generation reads the linked Canvas assessment and course syllabus (with Canvas credentials), the linked study objective\'s notes, attachments and extracted concepts, the learner\'s own context, and any attached user files. It refuses (\'needs-context\') when none of that says what the assessment covers.
54
+ * Create a study guide and start generating it
55
+ */
56
+ createStudyGuideRaw(requestParameters: CreateStudyGuideOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<StudyGuide>>;
57
+ /**
58
+ * Creates a study guide for one assessment and starts generation in the background; the row comes back in status \'generating\' and the client polls GET /api/v1/study-guides/{studyGuideId}. Generation reads the linked Canvas assessment and course syllabus (with Canvas credentials), the linked study objective\'s notes, attachments and extracted concepts, the learner\'s own context, and any attached user files. It refuses (\'needs-context\') when none of that says what the assessment covers.
59
+ * Create a study guide and start generating it
60
+ */
61
+ createStudyGuide(requestParameters: CreateStudyGuideOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<StudyGuide>;
62
+ /**
63
+ * Generates and persists a quiz (or flashcard deck) from the guide\'s concepts, at least one question per concept, with every question bound to its concept id. Omit conceptIds for the whole guide. Synchronous: the response carries the quiz id to open a session on.
64
+ * Build a quiz or flashcard deck from a study guide
65
+ */
66
+ createStudyGuideQuizRaw(requestParameters: CreateStudyGuideQuizOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<StudyGuideQuiz>>;
67
+ /**
68
+ * Generates and persists a quiz (or flashcard deck) from the guide\'s concepts, at least one question per concept, with every question bound to its concept id. Omit conceptIds for the whole guide. Synchronous: the response carries the quiz id to open a session on.
69
+ * Build a quiz or flashcard deck from a study guide
70
+ */
71
+ createStudyGuideQuiz(requestParameters: CreateStudyGuideQuizOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<StudyGuideQuiz>;
72
+ /**
73
+ * Removes the guide and its concept list. Attached user files are detached, not deleted; quizzes built from the guide remain.
74
+ * Delete a study guide
75
+ */
76
+ deleteStudyGuideRaw(requestParameters: DeleteStudyGuideRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
77
+ /**
78
+ * Removes the guide and its concept list. Attached user files are detached, not deleted; quizzes built from the guide remain.
79
+ * Delete a study guide
80
+ */
81
+ deleteStudyGuide(requestParameters: DeleteStudyGuideRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
82
+ /**
83
+ * Returns the guide, its concepts in display order, its attached files, and its generation status. Poll while status is \'generating\'.
84
+ * Get a study guide with its concepts
85
+ */
86
+ getStudyGuideRaw(requestParameters: GetStudyGuideRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<StudyGuide>>;
87
+ /**
88
+ * Returns the guide, its concepts in display order, its attached files, and its generation status. Poll while status is \'generating\'.
89
+ * Get a study guide with its concepts
90
+ */
91
+ getStudyGuide(requestParameters: GetStudyGuideRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<StudyGuide>;
92
+ /**
93
+ * Newest first, with a concept count per guide. Optionally scoped to a study space, study objective, or Canvas course.
94
+ * List the learner\'s study guides
95
+ */
96
+ listStudyGuidesRaw(requestParameters: ListStudyGuidesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedStudyGuides>>;
97
+ /**
98
+ * Newest first, with a concept count per guide. Optionally scoped to a study space, study objective, or Canvas course.
99
+ * List the learner\'s study guides
100
+ */
101
+ listStudyGuides(requestParameters: ListStudyGuidesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedStudyGuides>;
102
+ /**
103
+ * Appends the learner\'s additional context and files, then generates again. This is how a \'needs-context\' guide becomes a ready one. A ready guide can also be regenerated to refine it.
104
+ * Regenerate a study guide with more context
105
+ */
106
+ regenerateStudyGuideRaw(requestParameters: RegenerateStudyGuideOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<StudyGuide>>;
107
+ /**
108
+ * Appends the learner\'s additional context and files, then generates again. This is how a \'needs-context\' guide becomes a ready one. A ready guide can also be regenerated to refine it.
109
+ * Regenerate a study guide with more context
110
+ */
111
+ regenerateStudyGuide(requestParameters: RegenerateStudyGuideOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<StudyGuide>;
112
+ }
@@ -0,0 +1,308 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Athena API
5
+ * REST API for the Athena system
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ import * as runtime from '../runtime';
24
+ import { CreateStudyGuideQuizRequestToJSON, CreateStudyGuideRequestToJSON, PaginatedStudyGuidesFromJSON, RegenerateStudyGuideRequestToJSON, StudyGuideFromJSON, StudyGuideQuizFromJSON, } from '../models/index';
25
+ /**
26
+ *
27
+ */
28
+ export class StudyGuidesApi extends runtime.BaseAPI {
29
+ /**
30
+ * Creates a study guide for one assessment and starts generation in the background; the row comes back in status \'generating\' and the client polls GET /api/v1/study-guides/{studyGuideId}. Generation reads the linked Canvas assessment and course syllabus (with Canvas credentials), the linked study objective\'s notes, attachments and extracted concepts, the learner\'s own context, and any attached user files. It refuses (\'needs-context\') when none of that says what the assessment covers.
31
+ * Create a study guide and start generating it
32
+ */
33
+ createStudyGuideRaw(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 createStudyGuide().');
37
+ }
38
+ if (requestParameters['createStudyGuideRequest'] == null) {
39
+ throw new runtime.RequiredError('createStudyGuideRequest', 'Required parameter "createStudyGuideRequest" was null or undefined when calling createStudyGuide().');
40
+ }
41
+ const queryParameters = {};
42
+ const headerParameters = {};
43
+ headerParameters['Content-Type'] = 'application/json';
44
+ if (requestParameters['xUserId'] != null) {
45
+ headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
46
+ }
47
+ if (requestParameters['xCanvasDomain'] != null) {
48
+ headerParameters['X-Canvas-Domain'] = String(requestParameters['xCanvasDomain']);
49
+ }
50
+ if (requestParameters['xCanvasToken'] != null) {
51
+ headerParameters['X-Canvas-Token'] = String(requestParameters['xCanvasToken']);
52
+ }
53
+ if (this.configuration && this.configuration.apiKey) {
54
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
55
+ }
56
+ let urlPath = `/api/v1/study-guides`;
57
+ const response = yield this.request({
58
+ path: urlPath,
59
+ method: 'POST',
60
+ headers: headerParameters,
61
+ query: queryParameters,
62
+ body: CreateStudyGuideRequestToJSON(requestParameters['createStudyGuideRequest']),
63
+ }, initOverrides);
64
+ return new runtime.JSONApiResponse(response, (jsonValue) => StudyGuideFromJSON(jsonValue));
65
+ });
66
+ }
67
+ /**
68
+ * Creates a study guide for one assessment and starts generation in the background; the row comes back in status \'generating\' and the client polls GET /api/v1/study-guides/{studyGuideId}. Generation reads the linked Canvas assessment and course syllabus (with Canvas credentials), the linked study objective\'s notes, attachments and extracted concepts, the learner\'s own context, and any attached user files. It refuses (\'needs-context\') when none of that says what the assessment covers.
69
+ * Create a study guide and start generating it
70
+ */
71
+ createStudyGuide(requestParameters, initOverrides) {
72
+ return __awaiter(this, void 0, void 0, function* () {
73
+ const response = yield this.createStudyGuideRaw(requestParameters, initOverrides);
74
+ return yield response.value();
75
+ });
76
+ }
77
+ /**
78
+ * Generates and persists a quiz (or flashcard deck) from the guide\'s concepts, at least one question per concept, with every question bound to its concept id. Omit conceptIds for the whole guide. Synchronous: the response carries the quiz id to open a session on.
79
+ * Build a quiz or flashcard deck from a study guide
80
+ */
81
+ createStudyGuideQuizRaw(requestParameters, initOverrides) {
82
+ return __awaiter(this, void 0, void 0, function* () {
83
+ if (requestParameters['xUserId'] == null) {
84
+ throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling createStudyGuideQuiz().');
85
+ }
86
+ if (requestParameters['studyGuideId'] == null) {
87
+ throw new runtime.RequiredError('studyGuideId', 'Required parameter "studyGuideId" was null or undefined when calling createStudyGuideQuiz().');
88
+ }
89
+ if (requestParameters['createStudyGuideQuizRequest'] == null) {
90
+ throw new runtime.RequiredError('createStudyGuideQuizRequest', 'Required parameter "createStudyGuideQuizRequest" was null or undefined when calling createStudyGuideQuiz().');
91
+ }
92
+ const queryParameters = {};
93
+ const headerParameters = {};
94
+ headerParameters['Content-Type'] = 'application/json';
95
+ if (requestParameters['xUserId'] != null) {
96
+ headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
97
+ }
98
+ if (this.configuration && this.configuration.apiKey) {
99
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
100
+ }
101
+ let urlPath = `/api/v1/study-guides/{studyGuideId}/quizzes`;
102
+ urlPath = urlPath.replace(`{${"studyGuideId"}}`, encodeURIComponent(String(requestParameters['studyGuideId'])));
103
+ const response = yield this.request({
104
+ path: urlPath,
105
+ method: 'POST',
106
+ headers: headerParameters,
107
+ query: queryParameters,
108
+ body: CreateStudyGuideQuizRequestToJSON(requestParameters['createStudyGuideQuizRequest']),
109
+ }, initOverrides);
110
+ return new runtime.JSONApiResponse(response, (jsonValue) => StudyGuideQuizFromJSON(jsonValue));
111
+ });
112
+ }
113
+ /**
114
+ * Generates and persists a quiz (or flashcard deck) from the guide\'s concepts, at least one question per concept, with every question bound to its concept id. Omit conceptIds for the whole guide. Synchronous: the response carries the quiz id to open a session on.
115
+ * Build a quiz or flashcard deck from a study guide
116
+ */
117
+ createStudyGuideQuiz(requestParameters, initOverrides) {
118
+ return __awaiter(this, void 0, void 0, function* () {
119
+ const response = yield this.createStudyGuideQuizRaw(requestParameters, initOverrides);
120
+ return yield response.value();
121
+ });
122
+ }
123
+ /**
124
+ * Removes the guide and its concept list. Attached user files are detached, not deleted; quizzes built from the guide remain.
125
+ * Delete a study guide
126
+ */
127
+ deleteStudyGuideRaw(requestParameters, initOverrides) {
128
+ return __awaiter(this, void 0, void 0, function* () {
129
+ if (requestParameters['xUserId'] == null) {
130
+ throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling deleteStudyGuide().');
131
+ }
132
+ if (requestParameters['studyGuideId'] == null) {
133
+ throw new runtime.RequiredError('studyGuideId', 'Required parameter "studyGuideId" was null or undefined when calling deleteStudyGuide().');
134
+ }
135
+ const queryParameters = {};
136
+ const headerParameters = {};
137
+ if (requestParameters['xUserId'] != null) {
138
+ headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
139
+ }
140
+ if (this.configuration && this.configuration.apiKey) {
141
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
142
+ }
143
+ let urlPath = `/api/v1/study-guides/{studyGuideId}`;
144
+ urlPath = urlPath.replace(`{${"studyGuideId"}}`, encodeURIComponent(String(requestParameters['studyGuideId'])));
145
+ const response = yield this.request({
146
+ path: urlPath,
147
+ method: 'DELETE',
148
+ headers: headerParameters,
149
+ query: queryParameters,
150
+ }, initOverrides);
151
+ return new runtime.VoidApiResponse(response);
152
+ });
153
+ }
154
+ /**
155
+ * Removes the guide and its concept list. Attached user files are detached, not deleted; quizzes built from the guide remain.
156
+ * Delete a study guide
157
+ */
158
+ deleteStudyGuide(requestParameters, initOverrides) {
159
+ return __awaiter(this, void 0, void 0, function* () {
160
+ yield this.deleteStudyGuideRaw(requestParameters, initOverrides);
161
+ });
162
+ }
163
+ /**
164
+ * Returns the guide, its concepts in display order, its attached files, and its generation status. Poll while status is \'generating\'.
165
+ * Get a study guide with its concepts
166
+ */
167
+ getStudyGuideRaw(requestParameters, initOverrides) {
168
+ return __awaiter(this, void 0, void 0, function* () {
169
+ if (requestParameters['xUserId'] == null) {
170
+ throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling getStudyGuide().');
171
+ }
172
+ if (requestParameters['studyGuideId'] == null) {
173
+ throw new runtime.RequiredError('studyGuideId', 'Required parameter "studyGuideId" was null or undefined when calling getStudyGuide().');
174
+ }
175
+ const queryParameters = {};
176
+ const headerParameters = {};
177
+ if (requestParameters['xUserId'] != null) {
178
+ headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
179
+ }
180
+ if (this.configuration && this.configuration.apiKey) {
181
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
182
+ }
183
+ let urlPath = `/api/v1/study-guides/{studyGuideId}`;
184
+ urlPath = urlPath.replace(`{${"studyGuideId"}}`, encodeURIComponent(String(requestParameters['studyGuideId'])));
185
+ const response = yield this.request({
186
+ path: urlPath,
187
+ method: 'GET',
188
+ headers: headerParameters,
189
+ query: queryParameters,
190
+ }, initOverrides);
191
+ return new runtime.JSONApiResponse(response, (jsonValue) => StudyGuideFromJSON(jsonValue));
192
+ });
193
+ }
194
+ /**
195
+ * Returns the guide, its concepts in display order, its attached files, and its generation status. Poll while status is \'generating\'.
196
+ * Get a study guide with its concepts
197
+ */
198
+ getStudyGuide(requestParameters, initOverrides) {
199
+ return __awaiter(this, void 0, void 0, function* () {
200
+ const response = yield this.getStudyGuideRaw(requestParameters, initOverrides);
201
+ return yield response.value();
202
+ });
203
+ }
204
+ /**
205
+ * Newest first, with a concept count per guide. Optionally scoped to a study space, study objective, or Canvas course.
206
+ * List the learner\'s study guides
207
+ */
208
+ listStudyGuidesRaw(requestParameters, initOverrides) {
209
+ return __awaiter(this, void 0, void 0, function* () {
210
+ if (requestParameters['xUserId'] == null) {
211
+ throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling listStudyGuides().');
212
+ }
213
+ const queryParameters = {};
214
+ if (requestParameters['limit'] != null) {
215
+ queryParameters['limit'] = requestParameters['limit'];
216
+ }
217
+ if (requestParameters['cursor'] != null) {
218
+ queryParameters['cursor'] = requestParameters['cursor'];
219
+ }
220
+ if (requestParameters['studySpaceId'] != null) {
221
+ queryParameters['studySpaceId'] = requestParameters['studySpaceId'];
222
+ }
223
+ if (requestParameters['studyObjectiveId'] != null) {
224
+ queryParameters['studyObjectiveId'] = requestParameters['studyObjectiveId'];
225
+ }
226
+ if (requestParameters['courseId'] != null) {
227
+ queryParameters['courseId'] = requestParameters['courseId'];
228
+ }
229
+ const headerParameters = {};
230
+ if (requestParameters['xUserId'] != null) {
231
+ headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
232
+ }
233
+ if (this.configuration && this.configuration.apiKey) {
234
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
235
+ }
236
+ let urlPath = `/api/v1/study-guides`;
237
+ const response = yield this.request({
238
+ path: urlPath,
239
+ method: 'GET',
240
+ headers: headerParameters,
241
+ query: queryParameters,
242
+ }, initOverrides);
243
+ return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedStudyGuidesFromJSON(jsonValue));
244
+ });
245
+ }
246
+ /**
247
+ * Newest first, with a concept count per guide. Optionally scoped to a study space, study objective, or Canvas course.
248
+ * List the learner\'s study guides
249
+ */
250
+ listStudyGuides(requestParameters, initOverrides) {
251
+ return __awaiter(this, void 0, void 0, function* () {
252
+ const response = yield this.listStudyGuidesRaw(requestParameters, initOverrides);
253
+ return yield response.value();
254
+ });
255
+ }
256
+ /**
257
+ * Appends the learner\'s additional context and files, then generates again. This is how a \'needs-context\' guide becomes a ready one. A ready guide can also be regenerated to refine it.
258
+ * Regenerate a study guide with more context
259
+ */
260
+ regenerateStudyGuideRaw(requestParameters, initOverrides) {
261
+ return __awaiter(this, void 0, void 0, function* () {
262
+ if (requestParameters['xUserId'] == null) {
263
+ throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling regenerateStudyGuide().');
264
+ }
265
+ if (requestParameters['studyGuideId'] == null) {
266
+ throw new runtime.RequiredError('studyGuideId', 'Required parameter "studyGuideId" was null or undefined when calling regenerateStudyGuide().');
267
+ }
268
+ if (requestParameters['regenerateStudyGuideRequest'] == null) {
269
+ throw new runtime.RequiredError('regenerateStudyGuideRequest', 'Required parameter "regenerateStudyGuideRequest" was null or undefined when calling regenerateStudyGuide().');
270
+ }
271
+ const queryParameters = {};
272
+ const headerParameters = {};
273
+ headerParameters['Content-Type'] = 'application/json';
274
+ if (requestParameters['xUserId'] != null) {
275
+ headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
276
+ }
277
+ if (requestParameters['xCanvasDomain'] != null) {
278
+ headerParameters['X-Canvas-Domain'] = String(requestParameters['xCanvasDomain']);
279
+ }
280
+ if (requestParameters['xCanvasToken'] != null) {
281
+ headerParameters['X-Canvas-Token'] = String(requestParameters['xCanvasToken']);
282
+ }
283
+ if (this.configuration && this.configuration.apiKey) {
284
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
285
+ }
286
+ let urlPath = `/api/v1/study-guides/{studyGuideId}/regenerate`;
287
+ urlPath = urlPath.replace(`{${"studyGuideId"}}`, encodeURIComponent(String(requestParameters['studyGuideId'])));
288
+ const response = yield this.request({
289
+ path: urlPath,
290
+ method: 'POST',
291
+ headers: headerParameters,
292
+ query: queryParameters,
293
+ body: RegenerateStudyGuideRequestToJSON(requestParameters['regenerateStudyGuideRequest']),
294
+ }, initOverrides);
295
+ return new runtime.JSONApiResponse(response, (jsonValue) => StudyGuideFromJSON(jsonValue));
296
+ });
297
+ }
298
+ /**
299
+ * Appends the learner\'s additional context and files, then generates again. This is how a \'needs-context\' guide becomes a ready one. A ready guide can also be regenerated to refine it.
300
+ * Regenerate a study guide with more context
301
+ */
302
+ regenerateStudyGuide(requestParameters, initOverrides) {
303
+ return __awaiter(this, void 0, void 0, function* () {
304
+ const response = yield this.regenerateStudyGuideRaw(requestParameters, initOverrides);
305
+ return yield response.value();
306
+ });
307
+ }
308
+ }
@@ -23,6 +23,7 @@ export * from './QuizzesApi';
23
23
  export * from './ResourcesApi';
24
24
  export * from './ServiceTokensApi';
25
25
  export * from './SharedQuizzesApi';
26
+ export * from './StudyGuidesApi';
26
27
  export * from './StudyObjectiveConceptsApi';
27
28
  export * from './StudyObjectivesApi';
28
29
  export * from './StudyPlansApi';
@@ -25,6 +25,7 @@ export * from './QuizzesApi';
25
25
  export * from './ResourcesApi';
26
26
  export * from './ServiceTokensApi';
27
27
  export * from './SharedQuizzesApi';
28
+ export * from './StudyGuidesApi';
28
29
  export * from './StudyObjectiveConceptsApi';
29
30
  export * from './StudyObjectivesApi';
30
31
  export * from './StudyPlansApi';
@@ -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'],