@instructure/athena-api-client 3.0.3 → 3.0.4

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 (134) hide show
  1. package/README.md +39 -0
  2. package/dist/apis/ChatsApi.d.ts +2 -0
  3. package/dist/apis/ChatsApi.js +6 -0
  4. package/dist/apis/DailyQuizApi.d.ts +1 -0
  5. package/dist/apis/DailyQuizApi.js +3 -0
  6. package/dist/apis/MessagesApi.d.ts +1 -0
  7. package/dist/apis/MessagesApi.js +3 -0
  8. package/dist/apis/PracticeQuizzesApi.d.ts +1 -0
  9. package/dist/apis/PracticeQuizzesApi.js +3 -0
  10. package/dist/apis/StudyObjectiveConceptsApi.d.ts +50 -0
  11. package/dist/apis/StudyObjectiveConceptsApi.js +133 -0
  12. package/dist/apis/StudyObjectivesApi.d.ts +127 -0
  13. package/dist/apis/StudyObjectivesApi.js +378 -0
  14. package/dist/apis/UserFilesApi.d.ts +90 -0
  15. package/dist/apis/UserFilesApi.js +246 -0
  16. package/dist/apis/index.d.ts +3 -0
  17. package/dist/apis/index.js +3 -0
  18. package/dist/esm/apis/ChatsApi.d.ts +2 -0
  19. package/dist/esm/apis/ChatsApi.js +6 -0
  20. package/dist/esm/apis/DailyQuizApi.d.ts +1 -0
  21. package/dist/esm/apis/DailyQuizApi.js +3 -0
  22. package/dist/esm/apis/MessagesApi.d.ts +1 -0
  23. package/dist/esm/apis/MessagesApi.js +3 -0
  24. package/dist/esm/apis/PracticeQuizzesApi.d.ts +1 -0
  25. package/dist/esm/apis/PracticeQuizzesApi.js +3 -0
  26. package/dist/esm/apis/StudyObjectiveConceptsApi.d.ts +50 -0
  27. package/dist/esm/apis/StudyObjectiveConceptsApi.js +129 -0
  28. package/dist/esm/apis/StudyObjectivesApi.d.ts +127 -0
  29. package/dist/esm/apis/StudyObjectivesApi.js +374 -0
  30. package/dist/esm/apis/UserFilesApi.d.ts +90 -0
  31. package/dist/esm/apis/UserFilesApi.js +242 -0
  32. package/dist/esm/apis/index.d.ts +3 -0
  33. package/dist/esm/apis/index.js +3 -0
  34. package/dist/esm/models/AssociateUserFileRequest.d.ts +48 -0
  35. package/dist/esm/models/AssociateUserFileRequest.js +56 -0
  36. package/dist/esm/models/CreateObjectiveResourceDto.d.ts +47 -0
  37. package/dist/esm/models/CreateObjectiveResourceDto.js +55 -0
  38. package/dist/esm/models/CreateStudyObjectiveDto.d.ts +57 -0
  39. package/dist/esm/models/CreateStudyObjectiveDto.js +54 -0
  40. package/dist/esm/models/CreateStudyObjectiveDtoCanvasDocumentsInner.d.ts +50 -0
  41. package/dist/esm/models/CreateStudyObjectiveDtoCanvasDocumentsInner.js +55 -0
  42. package/dist/esm/models/ObjectiveResource.d.ts +71 -0
  43. package/dist/esm/models/ObjectiveResource.js +71 -0
  44. package/dist/esm/models/PaginatedObjectiveResources.d.ts +39 -0
  45. package/dist/esm/models/PaginatedObjectiveResources.js +48 -0
  46. package/dist/esm/models/PaginatedStudyObjectives.d.ts +39 -0
  47. package/dist/esm/models/PaginatedStudyObjectives.js +48 -0
  48. package/dist/esm/models/StudyObjective.d.ts +88 -0
  49. package/dist/esm/models/StudyObjective.js +81 -0
  50. package/dist/esm/models/StudyObjectiveCanvasDocument.d.ts +50 -0
  51. package/dist/esm/models/StudyObjectiveCanvasDocument.js +55 -0
  52. package/dist/esm/models/StudyObjectiveConceptAttachment.d.ts +76 -0
  53. package/dist/esm/models/StudyObjectiveConceptAttachment.js +77 -0
  54. package/dist/esm/models/StudyObjectiveConceptAttachmentList.d.ts +33 -0
  55. package/dist/esm/models/StudyObjectiveConceptAttachmentList.js +44 -0
  56. package/dist/esm/models/StudyObjectiveConceptSummary.d.ts +56 -0
  57. package/dist/esm/models/StudyObjectiveConceptSummary.js +59 -0
  58. package/dist/esm/models/StudyObjectiveFileAttachment.d.ts +56 -0
  59. package/dist/esm/models/StudyObjectiveFileAttachment.js +59 -0
  60. package/dist/esm/models/TriggerStudyObjectiveConceptExtractionItemStatus.d.ts +50 -0
  61. package/dist/esm/models/TriggerStudyObjectiveConceptExtractionItemStatus.js +58 -0
  62. package/dist/esm/models/TriggerStudyObjectiveConceptExtractionRequest.d.ts +39 -0
  63. package/dist/esm/models/TriggerStudyObjectiveConceptExtractionRequest.js +48 -0
  64. package/dist/esm/models/TriggerStudyObjectiveConceptExtractionRequestItemsInner.d.ts +32 -0
  65. package/dist/esm/models/TriggerStudyObjectiveConceptExtractionRequestItemsInner.js +43 -0
  66. package/dist/esm/models/TriggerStudyObjectiveConceptExtractionResponse.d.ts +33 -0
  67. package/dist/esm/models/TriggerStudyObjectiveConceptExtractionResponse.js +44 -0
  68. package/dist/esm/models/UpdateStudyObjectiveDto.d.ts +51 -0
  69. package/dist/esm/models/UpdateStudyObjectiveDto.js +48 -0
  70. package/dist/esm/models/UserFile.d.ts +75 -0
  71. package/dist/esm/models/UserFile.js +72 -0
  72. package/dist/esm/models/UserFileAssociation.d.ts +60 -0
  73. package/dist/esm/models/UserFileAssociation.js +64 -0
  74. package/dist/esm/models/UserFileUploadUrlFile.d.ts +56 -0
  75. package/dist/esm/models/UserFileUploadUrlFile.js +59 -0
  76. package/dist/esm/models/UserFileUploadUrlRequest.d.ts +33 -0
  77. package/dist/esm/models/UserFileUploadUrlRequest.js +44 -0
  78. package/dist/esm/models/UserFileUploadUrlRequestFilesInner.d.ts +52 -0
  79. package/dist/esm/models/UserFileUploadUrlRequestFilesInner.js +58 -0
  80. package/dist/esm/models/UserFileUploadUrlResponse.d.ts +33 -0
  81. package/dist/esm/models/UserFileUploadUrlResponse.js +44 -0
  82. package/dist/esm/models/index.d.ts +24 -0
  83. package/dist/esm/models/index.js +24 -0
  84. package/dist/models/AssociateUserFileRequest.d.ts +48 -0
  85. package/dist/models/AssociateUserFileRequest.js +64 -0
  86. package/dist/models/CreateObjectiveResourceDto.d.ts +47 -0
  87. package/dist/models/CreateObjectiveResourceDto.js +63 -0
  88. package/dist/models/CreateStudyObjectiveDto.d.ts +57 -0
  89. package/dist/models/CreateStudyObjectiveDto.js +61 -0
  90. package/dist/models/CreateStudyObjectiveDtoCanvasDocumentsInner.d.ts +50 -0
  91. package/dist/models/CreateStudyObjectiveDtoCanvasDocumentsInner.js +62 -0
  92. package/dist/models/ObjectiveResource.d.ts +71 -0
  93. package/dist/models/ObjectiveResource.js +79 -0
  94. package/dist/models/PaginatedObjectiveResources.d.ts +39 -0
  95. package/dist/models/PaginatedObjectiveResources.js +55 -0
  96. package/dist/models/PaginatedStudyObjectives.d.ts +39 -0
  97. package/dist/models/PaginatedStudyObjectives.js +55 -0
  98. package/dist/models/StudyObjective.d.ts +88 -0
  99. package/dist/models/StudyObjective.js +88 -0
  100. package/dist/models/StudyObjectiveCanvasDocument.d.ts +50 -0
  101. package/dist/models/StudyObjectiveCanvasDocument.js +62 -0
  102. package/dist/models/StudyObjectiveConceptAttachment.d.ts +76 -0
  103. package/dist/models/StudyObjectiveConceptAttachment.js +85 -0
  104. package/dist/models/StudyObjectiveConceptAttachmentList.d.ts +33 -0
  105. package/dist/models/StudyObjectiveConceptAttachmentList.js +51 -0
  106. package/dist/models/StudyObjectiveConceptSummary.d.ts +56 -0
  107. package/dist/models/StudyObjectiveConceptSummary.js +66 -0
  108. package/dist/models/StudyObjectiveFileAttachment.d.ts +56 -0
  109. package/dist/models/StudyObjectiveFileAttachment.js +66 -0
  110. package/dist/models/TriggerStudyObjectiveConceptExtractionItemStatus.d.ts +50 -0
  111. package/dist/models/TriggerStudyObjectiveConceptExtractionItemStatus.js +66 -0
  112. package/dist/models/TriggerStudyObjectiveConceptExtractionRequest.d.ts +39 -0
  113. package/dist/models/TriggerStudyObjectiveConceptExtractionRequest.js +55 -0
  114. package/dist/models/TriggerStudyObjectiveConceptExtractionRequestItemsInner.d.ts +32 -0
  115. package/dist/models/TriggerStudyObjectiveConceptExtractionRequestItemsInner.js +50 -0
  116. package/dist/models/TriggerStudyObjectiveConceptExtractionResponse.d.ts +33 -0
  117. package/dist/models/TriggerStudyObjectiveConceptExtractionResponse.js +51 -0
  118. package/dist/models/UpdateStudyObjectiveDto.d.ts +51 -0
  119. package/dist/models/UpdateStudyObjectiveDto.js +55 -0
  120. package/dist/models/UserFile.d.ts +75 -0
  121. package/dist/models/UserFile.js +79 -0
  122. package/dist/models/UserFileAssociation.d.ts +60 -0
  123. package/dist/models/UserFileAssociation.js +72 -0
  124. package/dist/models/UserFileUploadUrlFile.d.ts +56 -0
  125. package/dist/models/UserFileUploadUrlFile.js +66 -0
  126. package/dist/models/UserFileUploadUrlRequest.d.ts +33 -0
  127. package/dist/models/UserFileUploadUrlRequest.js +51 -0
  128. package/dist/models/UserFileUploadUrlRequestFilesInner.d.ts +52 -0
  129. package/dist/models/UserFileUploadUrlRequestFilesInner.js +66 -0
  130. package/dist/models/UserFileUploadUrlResponse.d.ts +33 -0
  131. package/dist/models/UserFileUploadUrlResponse.js +51 -0
  132. package/dist/models/index.d.ts +24 -0
  133. package/dist/models/index.js +24 -0
  134. package/package.json +1 -1
@@ -0,0 +1,127 @@
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 { CreateObjectiveResourceDto, CreateStudyObjectiveDto, ObjectiveResource, PaginatedObjectiveResources, PaginatedStudyObjectives, StudyObjective, UpdateStudyObjectiveDto } from '../models/index';
14
+ export interface CreateObjectiveResourceRequest {
15
+ xUserId: string;
16
+ studyObjectiveId: string;
17
+ createObjectiveResourceDto: CreateObjectiveResourceDto;
18
+ }
19
+ export interface CreateStudyObjectiveRequest {
20
+ xUserId: string;
21
+ createStudyObjectiveDto: CreateStudyObjectiveDto;
22
+ }
23
+ export interface DeleteObjectiveResourceRequest {
24
+ xUserId: string;
25
+ studyObjectiveId: string;
26
+ resourceId: string;
27
+ }
28
+ export interface DeleteStudyObjectiveRequest {
29
+ xUserId: string;
30
+ studyObjectiveId: string;
31
+ }
32
+ export interface GetStudyObjectiveRequest {
33
+ xUserId: string;
34
+ studyObjectiveId: string;
35
+ }
36
+ export interface ListObjectiveResourcesRequest {
37
+ xUserId: string;
38
+ studyObjectiveId: string;
39
+ limit?: number;
40
+ cursor?: string;
41
+ }
42
+ export interface ListStudyObjectivesRequest {
43
+ xUserId: string;
44
+ courseId: string;
45
+ limit?: number;
46
+ cursor?: string;
47
+ }
48
+ export interface UpdateStudyObjectiveRequest {
49
+ xUserId: string;
50
+ studyObjectiveId: string;
51
+ updateStudyObjectiveDto: UpdateStudyObjectiveDto;
52
+ }
53
+ /**
54
+ *
55
+ */
56
+ export declare class StudyObjectivesApi extends runtime.BaseAPI {
57
+ /**
58
+ * Records that a chat (regular chat, quiz, or flashcard) is being used in service of a study objective.
59
+ * Attach a chat resource to a study objective
60
+ */
61
+ createObjectiveResourceRaw(requestParameters: CreateObjectiveResourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ObjectiveResource>>;
62
+ /**
63
+ * Records that a chat (regular chat, quiz, or flashcard) is being used in service of a study objective.
64
+ * Attach a chat resource to a study objective
65
+ */
66
+ createObjectiveResource(requestParameters: CreateObjectiveResourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ObjectiveResource>;
67
+ /**
68
+ * Create a study objective
69
+ */
70
+ createStudyObjectiveRaw(requestParameters: CreateStudyObjectiveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<StudyObjective>>;
71
+ /**
72
+ * Create a study objective
73
+ */
74
+ createStudyObjective(requestParameters: CreateStudyObjectiveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<StudyObjective>;
75
+ /**
76
+ * Detach a resource from a study objective
77
+ */
78
+ deleteObjectiveResourceRaw(requestParameters: DeleteObjectiveResourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
79
+ /**
80
+ * Detach a resource from a study objective
81
+ */
82
+ deleteObjectiveResource(requestParameters: DeleteObjectiveResourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
83
+ /**
84
+ * Deletes a study objective. Cascade-deletes any objective resources attached to it.
85
+ * Delete a study objective
86
+ */
87
+ deleteStudyObjectiveRaw(requestParameters: DeleteStudyObjectiveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
88
+ /**
89
+ * Deletes a study objective. Cascade-deletes any objective resources attached to it.
90
+ * Delete a study objective
91
+ */
92
+ deleteStudyObjective(requestParameters: DeleteStudyObjectiveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
93
+ /**
94
+ * Get a study objective by ID
95
+ */
96
+ getStudyObjectiveRaw(requestParameters: GetStudyObjectiveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<StudyObjective>>;
97
+ /**
98
+ * Get a study objective by ID
99
+ */
100
+ getStudyObjective(requestParameters: GetStudyObjectiveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<StudyObjective>;
101
+ /**
102
+ * List resources attached to a study objective
103
+ */
104
+ listObjectiveResourcesRaw(requestParameters: ListObjectiveResourcesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedObjectiveResources>>;
105
+ /**
106
+ * List resources attached to a study objective
107
+ */
108
+ listObjectiveResources(requestParameters: ListObjectiveResourcesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedObjectiveResources>;
109
+ /**
110
+ * Returns study objectives for the authenticated user filtered by course, ordered by creation date (newest first).
111
+ * List study objectives for a course
112
+ */
113
+ listStudyObjectivesRaw(requestParameters: ListStudyObjectivesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedStudyObjectives>>;
114
+ /**
115
+ * Returns study objectives for the authenticated user filtered by course, ordered by creation date (newest first).
116
+ * List study objectives for a course
117
+ */
118
+ listStudyObjectives(requestParameters: ListStudyObjectivesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedStudyObjectives>;
119
+ /**
120
+ * Update a study objective
121
+ */
122
+ updateStudyObjectiveRaw(requestParameters: UpdateStudyObjectiveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<StudyObjective>>;
123
+ /**
124
+ * Update a study objective
125
+ */
126
+ updateStudyObjective(requestParameters: UpdateStudyObjectiveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<StudyObjective>;
127
+ }
@@ -0,0 +1,374 @@
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 { CreateObjectiveResourceDtoToJSON, CreateStudyObjectiveDtoToJSON, ObjectiveResourceFromJSON, PaginatedObjectiveResourcesFromJSON, PaginatedStudyObjectivesFromJSON, StudyObjectiveFromJSON, UpdateStudyObjectiveDtoToJSON, } from '../models/index';
25
+ /**
26
+ *
27
+ */
28
+ export class StudyObjectivesApi extends runtime.BaseAPI {
29
+ /**
30
+ * Records that a chat (regular chat, quiz, or flashcard) is being used in service of a study objective.
31
+ * Attach a chat resource to a study objective
32
+ */
33
+ createObjectiveResourceRaw(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 createObjectiveResource().');
37
+ }
38
+ if (requestParameters['studyObjectiveId'] == null) {
39
+ throw new runtime.RequiredError('studyObjectiveId', 'Required parameter "studyObjectiveId" was null or undefined when calling createObjectiveResource().');
40
+ }
41
+ if (requestParameters['createObjectiveResourceDto'] == null) {
42
+ throw new runtime.RequiredError('createObjectiveResourceDto', 'Required parameter "createObjectiveResourceDto" was null or undefined when calling createObjectiveResource().');
43
+ }
44
+ const queryParameters = {};
45
+ const headerParameters = {};
46
+ headerParameters['Content-Type'] = 'application/json';
47
+ if (requestParameters['xUserId'] != null) {
48
+ headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
49
+ }
50
+ if (this.configuration && this.configuration.apiKey) {
51
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
52
+ }
53
+ let urlPath = `/api/v1/study-objectives/{studyObjectiveId}/resources`;
54
+ urlPath = urlPath.replace(`{${"studyObjectiveId"}}`, encodeURIComponent(String(requestParameters['studyObjectiveId'])));
55
+ const response = yield this.request({
56
+ path: urlPath,
57
+ method: 'POST',
58
+ headers: headerParameters,
59
+ query: queryParameters,
60
+ body: CreateObjectiveResourceDtoToJSON(requestParameters['createObjectiveResourceDto']),
61
+ }, initOverrides);
62
+ return new runtime.JSONApiResponse(response, (jsonValue) => ObjectiveResourceFromJSON(jsonValue));
63
+ });
64
+ }
65
+ /**
66
+ * Records that a chat (regular chat, quiz, or flashcard) is being used in service of a study objective.
67
+ * Attach a chat resource to a study objective
68
+ */
69
+ createObjectiveResource(requestParameters, initOverrides) {
70
+ return __awaiter(this, void 0, void 0, function* () {
71
+ const response = yield this.createObjectiveResourceRaw(requestParameters, initOverrides);
72
+ return yield response.value();
73
+ });
74
+ }
75
+ /**
76
+ * Create a study objective
77
+ */
78
+ createStudyObjectiveRaw(requestParameters, initOverrides) {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ if (requestParameters['xUserId'] == null) {
81
+ throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling createStudyObjective().');
82
+ }
83
+ if (requestParameters['createStudyObjectiveDto'] == null) {
84
+ throw new runtime.RequiredError('createStudyObjectiveDto', 'Required parameter "createStudyObjectiveDto" was null or undefined when calling createStudyObjective().');
85
+ }
86
+ const queryParameters = {};
87
+ const headerParameters = {};
88
+ headerParameters['Content-Type'] = 'application/json';
89
+ if (requestParameters['xUserId'] != null) {
90
+ headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
91
+ }
92
+ if (this.configuration && this.configuration.apiKey) {
93
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
94
+ }
95
+ let urlPath = `/api/v1/study-objectives`;
96
+ const response = yield this.request({
97
+ path: urlPath,
98
+ method: 'POST',
99
+ headers: headerParameters,
100
+ query: queryParameters,
101
+ body: CreateStudyObjectiveDtoToJSON(requestParameters['createStudyObjectiveDto']),
102
+ }, initOverrides);
103
+ return new runtime.JSONApiResponse(response, (jsonValue) => StudyObjectiveFromJSON(jsonValue));
104
+ });
105
+ }
106
+ /**
107
+ * Create a study objective
108
+ */
109
+ createStudyObjective(requestParameters, initOverrides) {
110
+ return __awaiter(this, void 0, void 0, function* () {
111
+ const response = yield this.createStudyObjectiveRaw(requestParameters, initOverrides);
112
+ return yield response.value();
113
+ });
114
+ }
115
+ /**
116
+ * Detach a resource from a study objective
117
+ */
118
+ deleteObjectiveResourceRaw(requestParameters, initOverrides) {
119
+ return __awaiter(this, void 0, void 0, function* () {
120
+ if (requestParameters['xUserId'] == null) {
121
+ throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling deleteObjectiveResource().');
122
+ }
123
+ if (requestParameters['studyObjectiveId'] == null) {
124
+ throw new runtime.RequiredError('studyObjectiveId', 'Required parameter "studyObjectiveId" was null or undefined when calling deleteObjectiveResource().');
125
+ }
126
+ if (requestParameters['resourceId'] == null) {
127
+ throw new runtime.RequiredError('resourceId', 'Required parameter "resourceId" was null or undefined when calling deleteObjectiveResource().');
128
+ }
129
+ const queryParameters = {};
130
+ const headerParameters = {};
131
+ if (requestParameters['xUserId'] != null) {
132
+ headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
133
+ }
134
+ if (this.configuration && this.configuration.apiKey) {
135
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
136
+ }
137
+ let urlPath = `/api/v1/study-objectives/{studyObjectiveId}/resources/{resourceId}`;
138
+ urlPath = urlPath.replace(`{${"studyObjectiveId"}}`, encodeURIComponent(String(requestParameters['studyObjectiveId'])));
139
+ urlPath = urlPath.replace(`{${"resourceId"}}`, encodeURIComponent(String(requestParameters['resourceId'])));
140
+ const response = yield this.request({
141
+ path: urlPath,
142
+ method: 'DELETE',
143
+ headers: headerParameters,
144
+ query: queryParameters,
145
+ }, initOverrides);
146
+ return new runtime.VoidApiResponse(response);
147
+ });
148
+ }
149
+ /**
150
+ * Detach a resource from a study objective
151
+ */
152
+ deleteObjectiveResource(requestParameters, initOverrides) {
153
+ return __awaiter(this, void 0, void 0, function* () {
154
+ yield this.deleteObjectiveResourceRaw(requestParameters, initOverrides);
155
+ });
156
+ }
157
+ /**
158
+ * Deletes a study objective. Cascade-deletes any objective resources attached to it.
159
+ * Delete a study objective
160
+ */
161
+ deleteStudyObjectiveRaw(requestParameters, initOverrides) {
162
+ return __awaiter(this, void 0, void 0, function* () {
163
+ if (requestParameters['xUserId'] == null) {
164
+ throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling deleteStudyObjective().');
165
+ }
166
+ if (requestParameters['studyObjectiveId'] == null) {
167
+ throw new runtime.RequiredError('studyObjectiveId', 'Required parameter "studyObjectiveId" was null or undefined when calling deleteStudyObjective().');
168
+ }
169
+ const queryParameters = {};
170
+ const headerParameters = {};
171
+ if (requestParameters['xUserId'] != null) {
172
+ headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
173
+ }
174
+ if (this.configuration && this.configuration.apiKey) {
175
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
176
+ }
177
+ let urlPath = `/api/v1/study-objectives/{studyObjectiveId}`;
178
+ urlPath = urlPath.replace(`{${"studyObjectiveId"}}`, encodeURIComponent(String(requestParameters['studyObjectiveId'])));
179
+ const response = yield this.request({
180
+ path: urlPath,
181
+ method: 'DELETE',
182
+ headers: headerParameters,
183
+ query: queryParameters,
184
+ }, initOverrides);
185
+ return new runtime.VoidApiResponse(response);
186
+ });
187
+ }
188
+ /**
189
+ * Deletes a study objective. Cascade-deletes any objective resources attached to it.
190
+ * Delete a study objective
191
+ */
192
+ deleteStudyObjective(requestParameters, initOverrides) {
193
+ return __awaiter(this, void 0, void 0, function* () {
194
+ yield this.deleteStudyObjectiveRaw(requestParameters, initOverrides);
195
+ });
196
+ }
197
+ /**
198
+ * Get a study objective by ID
199
+ */
200
+ getStudyObjectiveRaw(requestParameters, initOverrides) {
201
+ return __awaiter(this, void 0, void 0, function* () {
202
+ if (requestParameters['xUserId'] == null) {
203
+ throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling getStudyObjective().');
204
+ }
205
+ if (requestParameters['studyObjectiveId'] == null) {
206
+ throw new runtime.RequiredError('studyObjectiveId', 'Required parameter "studyObjectiveId" was null or undefined when calling getStudyObjective().');
207
+ }
208
+ const queryParameters = {};
209
+ const headerParameters = {};
210
+ if (requestParameters['xUserId'] != null) {
211
+ headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
212
+ }
213
+ if (this.configuration && this.configuration.apiKey) {
214
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
215
+ }
216
+ let urlPath = `/api/v1/study-objectives/{studyObjectiveId}`;
217
+ urlPath = urlPath.replace(`{${"studyObjectiveId"}}`, encodeURIComponent(String(requestParameters['studyObjectiveId'])));
218
+ const response = yield this.request({
219
+ path: urlPath,
220
+ method: 'GET',
221
+ headers: headerParameters,
222
+ query: queryParameters,
223
+ }, initOverrides);
224
+ return new runtime.JSONApiResponse(response, (jsonValue) => StudyObjectiveFromJSON(jsonValue));
225
+ });
226
+ }
227
+ /**
228
+ * Get a study objective by ID
229
+ */
230
+ getStudyObjective(requestParameters, initOverrides) {
231
+ return __awaiter(this, void 0, void 0, function* () {
232
+ const response = yield this.getStudyObjectiveRaw(requestParameters, initOverrides);
233
+ return yield response.value();
234
+ });
235
+ }
236
+ /**
237
+ * List resources attached to a study objective
238
+ */
239
+ listObjectiveResourcesRaw(requestParameters, initOverrides) {
240
+ return __awaiter(this, void 0, void 0, function* () {
241
+ if (requestParameters['xUserId'] == null) {
242
+ throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling listObjectiveResources().');
243
+ }
244
+ if (requestParameters['studyObjectiveId'] == null) {
245
+ throw new runtime.RequiredError('studyObjectiveId', 'Required parameter "studyObjectiveId" was null or undefined when calling listObjectiveResources().');
246
+ }
247
+ const queryParameters = {};
248
+ if (requestParameters['limit'] != null) {
249
+ queryParameters['limit'] = requestParameters['limit'];
250
+ }
251
+ if (requestParameters['cursor'] != null) {
252
+ queryParameters['cursor'] = requestParameters['cursor'];
253
+ }
254
+ const headerParameters = {};
255
+ if (requestParameters['xUserId'] != null) {
256
+ headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
257
+ }
258
+ if (this.configuration && this.configuration.apiKey) {
259
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
260
+ }
261
+ let urlPath = `/api/v1/study-objectives/{studyObjectiveId}/resources`;
262
+ urlPath = urlPath.replace(`{${"studyObjectiveId"}}`, encodeURIComponent(String(requestParameters['studyObjectiveId'])));
263
+ const response = yield this.request({
264
+ path: urlPath,
265
+ method: 'GET',
266
+ headers: headerParameters,
267
+ query: queryParameters,
268
+ }, initOverrides);
269
+ return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedObjectiveResourcesFromJSON(jsonValue));
270
+ });
271
+ }
272
+ /**
273
+ * List resources attached to a study objective
274
+ */
275
+ listObjectiveResources(requestParameters, initOverrides) {
276
+ return __awaiter(this, void 0, void 0, function* () {
277
+ const response = yield this.listObjectiveResourcesRaw(requestParameters, initOverrides);
278
+ return yield response.value();
279
+ });
280
+ }
281
+ /**
282
+ * Returns study objectives for the authenticated user filtered by course, ordered by creation date (newest first).
283
+ * List study objectives for a course
284
+ */
285
+ listStudyObjectivesRaw(requestParameters, initOverrides) {
286
+ return __awaiter(this, void 0, void 0, function* () {
287
+ if (requestParameters['xUserId'] == null) {
288
+ throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling listStudyObjectives().');
289
+ }
290
+ if (requestParameters['courseId'] == null) {
291
+ throw new runtime.RequiredError('courseId', 'Required parameter "courseId" was null or undefined when calling listStudyObjectives().');
292
+ }
293
+ const queryParameters = {};
294
+ if (requestParameters['limit'] != null) {
295
+ queryParameters['limit'] = requestParameters['limit'];
296
+ }
297
+ if (requestParameters['cursor'] != null) {
298
+ queryParameters['cursor'] = requestParameters['cursor'];
299
+ }
300
+ if (requestParameters['courseId'] != null) {
301
+ queryParameters['courseId'] = requestParameters['courseId'];
302
+ }
303
+ const headerParameters = {};
304
+ if (requestParameters['xUserId'] != null) {
305
+ headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
306
+ }
307
+ if (this.configuration && this.configuration.apiKey) {
308
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
309
+ }
310
+ let urlPath = `/api/v1/study-objectives`;
311
+ const response = yield this.request({
312
+ path: urlPath,
313
+ method: 'GET',
314
+ headers: headerParameters,
315
+ query: queryParameters,
316
+ }, initOverrides);
317
+ return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedStudyObjectivesFromJSON(jsonValue));
318
+ });
319
+ }
320
+ /**
321
+ * Returns study objectives for the authenticated user filtered by course, ordered by creation date (newest first).
322
+ * List study objectives for a course
323
+ */
324
+ listStudyObjectives(requestParameters, initOverrides) {
325
+ return __awaiter(this, void 0, void 0, function* () {
326
+ const response = yield this.listStudyObjectivesRaw(requestParameters, initOverrides);
327
+ return yield response.value();
328
+ });
329
+ }
330
+ /**
331
+ * Update a study objective
332
+ */
333
+ updateStudyObjectiveRaw(requestParameters, initOverrides) {
334
+ return __awaiter(this, void 0, void 0, function* () {
335
+ if (requestParameters['xUserId'] == null) {
336
+ throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling updateStudyObjective().');
337
+ }
338
+ if (requestParameters['studyObjectiveId'] == null) {
339
+ throw new runtime.RequiredError('studyObjectiveId', 'Required parameter "studyObjectiveId" was null or undefined when calling updateStudyObjective().');
340
+ }
341
+ if (requestParameters['updateStudyObjectiveDto'] == null) {
342
+ throw new runtime.RequiredError('updateStudyObjectiveDto', 'Required parameter "updateStudyObjectiveDto" was null or undefined when calling updateStudyObjective().');
343
+ }
344
+ const queryParameters = {};
345
+ const headerParameters = {};
346
+ headerParameters['Content-Type'] = 'application/json';
347
+ if (requestParameters['xUserId'] != null) {
348
+ headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
349
+ }
350
+ if (this.configuration && this.configuration.apiKey) {
351
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
352
+ }
353
+ let urlPath = `/api/v1/study-objectives/{studyObjectiveId}`;
354
+ urlPath = urlPath.replace(`{${"studyObjectiveId"}}`, encodeURIComponent(String(requestParameters['studyObjectiveId'])));
355
+ const response = yield this.request({
356
+ path: urlPath,
357
+ method: 'PATCH',
358
+ headers: headerParameters,
359
+ query: queryParameters,
360
+ body: UpdateStudyObjectiveDtoToJSON(requestParameters['updateStudyObjectiveDto']),
361
+ }, initOverrides);
362
+ return new runtime.JSONApiResponse(response, (jsonValue) => StudyObjectiveFromJSON(jsonValue));
363
+ });
364
+ }
365
+ /**
366
+ * Update a study objective
367
+ */
368
+ updateStudyObjective(requestParameters, initOverrides) {
369
+ return __awaiter(this, void 0, void 0, function* () {
370
+ const response = yield this.updateStudyObjectiveRaw(requestParameters, initOverrides);
371
+ return yield response.value();
372
+ });
373
+ }
374
+ }
@@ -0,0 +1,90 @@
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 { AssociateUserFileRequest, UserFile, UserFileAssociation, UserFileUploadUrlRequest, UserFileUploadUrlResponse } from '../models/index';
14
+ export interface CreateUserFileAssociationRequest {
15
+ xUserId: string;
16
+ userFileId: string;
17
+ associateUserFileRequest: AssociateUserFileRequest;
18
+ }
19
+ export interface DeleteUserFileRequest {
20
+ xUserId: string;
21
+ userFileId: string;
22
+ }
23
+ export interface DeleteUserFileAssociationRequest {
24
+ xUserId: string;
25
+ userFileId: string;
26
+ associationId: string;
27
+ }
28
+ export interface GetUserFileRequest {
29
+ xUserId: string;
30
+ userFileId: string;
31
+ }
32
+ export interface GetUserFileUploadUrlsRequest {
33
+ xUserId: string;
34
+ userFileUploadUrlRequest: UserFileUploadUrlRequest;
35
+ }
36
+ /**
37
+ *
38
+ */
39
+ export declare class UserFilesApi extends runtime.BaseAPI {
40
+ /**
41
+ * Idempotent. Returns the existing association if (userFileId, kind, kindId) already exists.
42
+ * Attach a user file to a parent resource
43
+ */
44
+ createUserFileAssociationRaw(requestParameters: CreateUserFileAssociationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserFileAssociation>>;
45
+ /**
46
+ * Idempotent. Returns the existing association if (userFileId, kind, kindId) already exists.
47
+ * Attach a user file to a parent resource
48
+ */
49
+ createUserFileAssociation(requestParameters: CreateUserFileAssociationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserFileAssociation>;
50
+ /**
51
+ * Synchronously removes the S3 object and the user_files row (cascade clears remaining associations).
52
+ * Hard delete a user file
53
+ */
54
+ deleteUserFileRaw(requestParameters: DeleteUserFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
55
+ /**
56
+ * Synchronously removes the S3 object and the user_files row (cascade clears remaining associations).
57
+ * Hard delete a user file
58
+ */
59
+ deleteUserFile(requestParameters: DeleteUserFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
60
+ /**
61
+ * The file row and S3 object remain.
62
+ * Detach a user file from a parent resource
63
+ */
64
+ deleteUserFileAssociationRaw(requestParameters: DeleteUserFileAssociationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
65
+ /**
66
+ * The file row and S3 object remain.
67
+ * Detach a user file from a parent resource
68
+ */
69
+ deleteUserFileAssociation(requestParameters: DeleteUserFileAssociationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
70
+ /**
71
+ * Returns the file row with a freshly-signed previewUrl and the full association list.
72
+ * Get a user file by id
73
+ */
74
+ getUserFileRaw(requestParameters: GetUserFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserFile>>;
75
+ /**
76
+ * Returns the file row with a freshly-signed previewUrl and the full association list.
77
+ * Get a user file by id
78
+ */
79
+ getUserFile(requestParameters: GetUserFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserFile>;
80
+ /**
81
+ * Mints signed S3 PUT/GET/DELETE URLs and creates user_files rows owned by the caller. The returned userFileId is the durable handle clients pass to POST /api/v1/user-files/:userFileId/associations to attach the file to a parent resource.
82
+ * Get presigned upload URLs for user files
83
+ */
84
+ getUserFileUploadUrlsRaw(requestParameters: GetUserFileUploadUrlsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserFileUploadUrlResponse>>;
85
+ /**
86
+ * Mints signed S3 PUT/GET/DELETE URLs and creates user_files rows owned by the caller. The returned userFileId is the durable handle clients pass to POST /api/v1/user-files/:userFileId/associations to attach the file to a parent resource.
87
+ * Get presigned upload URLs for user files
88
+ */
89
+ getUserFileUploadUrls(requestParameters: GetUserFileUploadUrlsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserFileUploadUrlResponse>;
90
+ }