@studyfetch/sdk 1.24.0 → 1.26.0

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 (168) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/package.json +1 -1
  3. package/resources/v1/assignment-grader.d.mts +34 -1
  4. package/resources/v1/assignment-grader.d.mts.map +1 -1
  5. package/resources/v1/assignment-grader.d.ts +34 -1
  6. package/resources/v1/assignment-grader.d.ts.map +1 -1
  7. package/resources/v1/assignment-grader.js +15 -0
  8. package/resources/v1/assignment-grader.js.map +1 -1
  9. package/resources/v1/assignment-grader.mjs +15 -0
  10. package/resources/v1/assignment-grader.mjs.map +1 -1
  11. package/resources/v1/chat/chat.d.mts +62 -1
  12. package/resources/v1/chat/chat.d.mts.map +1 -1
  13. package/resources/v1/chat/chat.d.ts +62 -1
  14. package/resources/v1/chat/chat.d.ts.map +1 -1
  15. package/resources/v1/chat/chat.js.map +1 -1
  16. package/resources/v1/chat/chat.mjs.map +1 -1
  17. package/resources/v1/chat/index.d.mts +1 -1
  18. package/resources/v1/chat/index.d.mts.map +1 -1
  19. package/resources/v1/chat/index.d.ts +1 -1
  20. package/resources/v1/chat/index.d.ts.map +1 -1
  21. package/resources/v1/chat/index.js.map +1 -1
  22. package/resources/v1/chat/index.mjs +1 -1
  23. package/resources/v1/chat/index.mjs.map +1 -1
  24. package/resources/v1/components.d.mts +62 -4
  25. package/resources/v1/components.d.mts.map +1 -1
  26. package/resources/v1/components.d.ts +62 -4
  27. package/resources/v1/components.d.ts.map +1 -1
  28. package/resources/v1/data-analyst/data-analyst.d.mts +156 -0
  29. package/resources/v1/data-analyst/data-analyst.d.mts.map +1 -0
  30. package/resources/v1/data-analyst/data-analyst.d.ts +156 -0
  31. package/resources/v1/data-analyst/data-analyst.d.ts.map +1 -0
  32. package/resources/v1/data-analyst/data-analyst.js +99 -0
  33. package/resources/v1/data-analyst/data-analyst.js.map +1 -0
  34. package/resources/v1/data-analyst/data-analyst.mjs +94 -0
  35. package/resources/v1/data-analyst/data-analyst.mjs.map +1 -0
  36. package/resources/v1/data-analyst/index.d.mts +4 -0
  37. package/resources/v1/data-analyst/index.d.mts.map +1 -0
  38. package/resources/v1/data-analyst/index.d.ts +4 -0
  39. package/resources/v1/data-analyst/index.d.ts.map +1 -0
  40. package/resources/v1/data-analyst/index.js +11 -0
  41. package/resources/v1/data-analyst/index.js.map +1 -0
  42. package/resources/v1/data-analyst/index.mjs +5 -0
  43. package/resources/v1/data-analyst/index.mjs.map +1 -0
  44. package/resources/v1/data-analyst/sessions.d.mts +28 -0
  45. package/resources/v1/data-analyst/sessions.d.mts.map +1 -0
  46. package/resources/v1/data-analyst/sessions.d.ts +28 -0
  47. package/resources/v1/data-analyst/sessions.d.ts.map +1 -0
  48. package/resources/v1/data-analyst/sessions.js +38 -0
  49. package/resources/v1/data-analyst/sessions.js.map +1 -0
  50. package/resources/v1/data-analyst/sessions.mjs +34 -0
  51. package/resources/v1/data-analyst/sessions.mjs.map +1 -0
  52. package/resources/v1/data-analyst/test.d.mts +20 -0
  53. package/resources/v1/data-analyst/test.d.mts.map +1 -0
  54. package/resources/v1/data-analyst/test.d.ts +20 -0
  55. package/resources/v1/data-analyst/test.d.ts.map +1 -0
  56. package/resources/v1/data-analyst/test.js +34 -0
  57. package/resources/v1/data-analyst/test.js.map +1 -0
  58. package/resources/v1/data-analyst/test.mjs +30 -0
  59. package/resources/v1/data-analyst/test.mjs.map +1 -0
  60. package/resources/v1/data-analyst.d.mts +2 -0
  61. package/resources/v1/data-analyst.d.mts.map +1 -0
  62. package/resources/v1/data-analyst.d.ts +2 -0
  63. package/resources/v1/data-analyst.d.ts.map +1 -0
  64. package/resources/v1/data-analyst.js +6 -0
  65. package/resources/v1/data-analyst.js.map +1 -0
  66. package/resources/v1/data-analyst.mjs +3 -0
  67. package/resources/v1/data-analyst.mjs.map +1 -0
  68. package/resources/v1/index.d.mts +3 -2
  69. package/resources/v1/index.d.mts.map +1 -1
  70. package/resources/v1/index.d.ts +3 -2
  71. package/resources/v1/index.d.ts.map +1 -1
  72. package/resources/v1/index.js +15 -13
  73. package/resources/v1/index.js.map +1 -1
  74. package/resources/v1/index.mjs +1 -0
  75. package/resources/v1/index.mjs.map +1 -1
  76. package/resources/v1/materials/bulk.d.mts +30 -2
  77. package/resources/v1/materials/bulk.d.mts.map +1 -1
  78. package/resources/v1/materials/bulk.d.ts +30 -2
  79. package/resources/v1/materials/bulk.d.ts.map +1 -1
  80. package/resources/v1/materials/bulk.js +8 -7
  81. package/resources/v1/materials/bulk.js.map +1 -1
  82. package/resources/v1/materials/bulk.mjs +8 -7
  83. package/resources/v1/materials/bulk.mjs.map +1 -1
  84. package/resources/v1/materials/index.d.mts +4 -4
  85. package/resources/v1/materials/index.d.mts.map +1 -1
  86. package/resources/v1/materials/index.d.ts +4 -4
  87. package/resources/v1/materials/index.d.ts.map +1 -1
  88. package/resources/v1/materials/index.js.map +1 -1
  89. package/resources/v1/materials/index.mjs +2 -2
  90. package/resources/v1/materials/index.mjs.map +1 -1
  91. package/resources/v1/materials/materials.d.mts +270 -43
  92. package/resources/v1/materials/materials.d.mts.map +1 -1
  93. package/resources/v1/materials/materials.d.ts +270 -43
  94. package/resources/v1/materials/materials.d.ts.map +1 -1
  95. package/resources/v1/materials/materials.js +64 -44
  96. package/resources/v1/materials/materials.js.map +1 -1
  97. package/resources/v1/materials/materials.mjs +66 -46
  98. package/resources/v1/materials/materials.mjs.map +1 -1
  99. package/resources/v1/materials/test.d.mts +111 -8
  100. package/resources/v1/materials/test.d.mts.map +1 -1
  101. package/resources/v1/materials/test.d.ts +111 -8
  102. package/resources/v1/materials/test.d.ts.map +1 -1
  103. package/resources/v1/materials/test.js +20 -21
  104. package/resources/v1/materials/test.js.map +1 -1
  105. package/resources/v1/materials/test.mjs +20 -21
  106. package/resources/v1/materials/test.mjs.map +1 -1
  107. package/resources/v1/materials/upload.d.mts +149 -5
  108. package/resources/v1/materials/upload.d.mts.map +1 -1
  109. package/resources/v1/materials/upload.d.ts +149 -5
  110. package/resources/v1/materials/upload.d.ts.map +1 -1
  111. package/resources/v1/materials/upload.js +53 -13
  112. package/resources/v1/materials/upload.js.map +1 -1
  113. package/resources/v1/materials/upload.mjs +53 -13
  114. package/resources/v1/materials/upload.mjs.map +1 -1
  115. package/resources/v1/usage/analyst.d.mts +51 -6
  116. package/resources/v1/usage/analyst.d.mts.map +1 -1
  117. package/resources/v1/usage/analyst.d.ts +51 -6
  118. package/resources/v1/usage/analyst.d.ts.map +1 -1
  119. package/resources/v1/usage/analyst.js +8 -9
  120. package/resources/v1/usage/analyst.js.map +1 -1
  121. package/resources/v1/usage/analyst.mjs +8 -9
  122. package/resources/v1/usage/analyst.mjs.map +1 -1
  123. package/resources/v1/usage/index.d.mts +1 -1
  124. package/resources/v1/usage/index.d.mts.map +1 -1
  125. package/resources/v1/usage/index.d.ts +1 -1
  126. package/resources/v1/usage/index.d.ts.map +1 -1
  127. package/resources/v1/usage/index.js.map +1 -1
  128. package/resources/v1/usage/index.mjs +1 -1
  129. package/resources/v1/usage/index.mjs.map +1 -1
  130. package/resources/v1/usage/usage.d.mts +2 -2
  131. package/resources/v1/usage/usage.d.mts.map +1 -1
  132. package/resources/v1/usage/usage.d.ts +2 -2
  133. package/resources/v1/usage/usage.d.ts.map +1 -1
  134. package/resources/v1/usage/usage.js.map +1 -1
  135. package/resources/v1/usage/usage.mjs +1 -1
  136. package/resources/v1/usage/usage.mjs.map +1 -1
  137. package/resources/v1/v1.d.mts +19 -4
  138. package/resources/v1/v1.d.mts.map +1 -1
  139. package/resources/v1/v1.d.ts +19 -4
  140. package/resources/v1/v1.d.ts.map +1 -1
  141. package/resources/v1/v1.js +19 -0
  142. package/resources/v1/v1.js.map +1 -1
  143. package/resources/v1/v1.mjs +20 -1
  144. package/resources/v1/v1.mjs.map +1 -1
  145. package/src/resources/v1/assignment-grader.ts +47 -1
  146. package/src/resources/v1/chat/chat.ts +74 -0
  147. package/src/resources/v1/chat/index.ts +7 -1
  148. package/src/resources/v1/components.ts +76 -0
  149. package/src/resources/v1/data-analyst/data-analyst.ts +233 -0
  150. package/src/resources/v1/data-analyst/index.ts +10 -0
  151. package/src/resources/v1/data-analyst/sessions.ts +46 -0
  152. package/src/resources/v1/data-analyst/test.ts +34 -0
  153. package/src/resources/v1/data-analyst.ts +3 -0
  154. package/src/resources/v1/index.ts +16 -0
  155. package/src/resources/v1/materials/bulk.ts +36 -7
  156. package/src/resources/v1/materials/index.ts +28 -3
  157. package/src/resources/v1/materials/materials.ts +364 -72
  158. package/src/resources/v1/materials/test.ts +141 -25
  159. package/src/resources/v1/materials/upload.ts +200 -13
  160. package/src/resources/v1/usage/analyst.ts +80 -10
  161. package/src/resources/v1/usage/index.ts +7 -1
  162. package/src/resources/v1/usage/usage.ts +14 -2
  163. package/src/resources/v1/v1.ts +60 -1
  164. package/src/version.ts +1 -1
  165. package/version.d.mts +1 -1
  166. package/version.d.ts +1 -1
  167. package/version.js +1 -1
  168. package/version.mjs +1 -1
@@ -2,59 +2,175 @@
2
2
 
3
3
  import { APIResource } from '../../../core/resource';
4
4
  import { APIPromise } from '../../../core/api-promise';
5
- import { buildHeaders } from '../../../internal/headers';
6
5
  import { RequestOptions } from '../../../internal/request-options';
7
6
 
8
7
  export class Test extends APIResource {
9
8
  /**
9
+ * Test OCR functionality with a sample PDF
10
+ *
10
11
  * @example
11
12
  * ```ts
12
- * await client.v1.materials.test.performOcr();
13
+ * const response =
14
+ * await client.v1.materials.test.performOcr();
13
15
  * ```
14
16
  */
15
- performOcr(options?: RequestOptions): APIPromise<void> {
16
- return this._client.post('/api/v1/materials/test/ocr', {
17
- ...options,
18
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
19
- });
17
+ performOcr(options?: RequestOptions): APIPromise<TestPerformOcrResponse> {
18
+ return this._client.post('/api/v1/materials/test/ocr', options);
20
19
  }
21
20
 
22
21
  /**
22
+ * Test EPUB processing functionality
23
+ *
23
24
  * @example
24
25
  * ```ts
25
- * await client.v1.materials.test.processEpub();
26
+ * const response =
27
+ * await client.v1.materials.test.processEpub();
26
28
  * ```
27
29
  */
28
- processEpub(options?: RequestOptions): APIPromise<void> {
29
- return this._client.post('/api/v1/materials/test/epub-processing', {
30
- ...options,
31
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
32
- });
30
+ processEpub(options?: RequestOptions): APIPromise<TestProcessEpubResponse> {
31
+ return this._client.post('/api/v1/materials/test/epub-processing', options);
33
32
  }
34
33
 
35
34
  /**
35
+ * Test image processing with OCR and AI vision
36
+ *
36
37
  * @example
37
38
  * ```ts
38
- * await client.v1.materials.test.processImage();
39
+ * const response =
40
+ * await client.v1.materials.test.processImage();
39
41
  * ```
40
42
  */
41
- processImage(options?: RequestOptions): APIPromise<void> {
42
- return this._client.post('/api/v1/materials/test/image-processing', {
43
- ...options,
44
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
45
- });
43
+ processImage(options?: RequestOptions): APIPromise<TestProcessImageResponse> {
44
+ return this._client.post('/api/v1/materials/test/image-processing', options);
46
45
  }
47
46
 
48
47
  /**
48
+ * Test video processing setup and dependencies
49
+ *
49
50
  * @example
50
51
  * ```ts
51
- * await client.v1.materials.test.processVideo();
52
+ * const response =
53
+ * await client.v1.materials.test.processVideo();
52
54
  * ```
53
55
  */
54
- processVideo(options?: RequestOptions): APIPromise<void> {
55
- return this._client.post('/api/v1/materials/test/video-processing', {
56
- ...options,
57
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
58
- });
56
+ processVideo(options?: RequestOptions): APIPromise<TestProcessVideoResponse> {
57
+ return this._client.post('/api/v1/materials/test/video-processing', options);
59
58
  }
60
59
  }
60
+
61
+ export interface TestPerformOcrResponse {
62
+ /**
63
+ * First 500 characters of extracted text
64
+ */
65
+ firstChars: string;
66
+
67
+ /**
68
+ * Test success status
69
+ */
70
+ success: boolean;
71
+
72
+ /**
73
+ * Length of extracted text
74
+ */
75
+ textLength: number;
76
+ }
77
+
78
+ export interface TestProcessEpubResponse {
79
+ /**
80
+ * Test success status
81
+ */
82
+ success: boolean;
83
+
84
+ /**
85
+ * EPUB file size in bytes
86
+ */
87
+ epubSize?: number;
88
+
89
+ /**
90
+ * EPUB file size in MB
91
+ */
92
+ epubSizeMB?: string;
93
+
94
+ /**
95
+ * Error message if failed
96
+ */
97
+ error?: string;
98
+
99
+ /**
100
+ * Success message
101
+ */
102
+ message?: string;
103
+
104
+ /**
105
+ * Error stack trace
106
+ */
107
+ stack?: string;
108
+ }
109
+
110
+ export interface TestProcessImageResponse {
111
+ /**
112
+ * Test success status
113
+ */
114
+ success: boolean;
115
+
116
+ /**
117
+ * Error message if failed
118
+ */
119
+ error?: string;
120
+
121
+ /**
122
+ * Image info if no base64 data
123
+ */
124
+ imageInfo?: unknown;
125
+
126
+ /**
127
+ * Success message
128
+ */
129
+ message?: string;
130
+
131
+ /**
132
+ * Test results
133
+ */
134
+ results?: unknown;
135
+
136
+ /**
137
+ * Error stack trace
138
+ */
139
+ stack?: string;
140
+ }
141
+
142
+ export interface TestProcessVideoResponse {
143
+ /**
144
+ * Test success status
145
+ */
146
+ success: boolean;
147
+
148
+ /**
149
+ * Error message if failed
150
+ */
151
+ error?: string;
152
+
153
+ /**
154
+ * Success message
155
+ */
156
+ message?: string;
157
+
158
+ /**
159
+ * Error stack trace
160
+ */
161
+ stack?: string;
162
+
163
+ /**
164
+ * Test results
165
+ */
166
+ tests?: unknown;
167
+ }
168
+
169
+ export declare namespace Test {
170
+ export {
171
+ type TestPerformOcrResponse as TestPerformOcrResponse,
172
+ type TestProcessEpubResponse as TestProcessEpubResponse,
173
+ type TestProcessImageResponse as TestProcessImageResponse,
174
+ type TestProcessVideoResponse as TestProcessVideoResponse,
175
+ };
176
+ }
@@ -4,35 +4,49 @@ import { APIResource } from '../../../core/resource';
4
4
  import * as MaterialsAPI from './materials';
5
5
  import { APIPromise } from '../../../core/api-promise';
6
6
  import { type Uploadable } from '../../../core/uploads';
7
- import { buildHeaders } from '../../../internal/headers';
8
7
  import { RequestOptions } from '../../../internal/request-options';
9
8
  import { multipartFormRequestOptions } from '../../../internal/uploads';
10
9
 
11
10
  export class Upload extends APIResource {
12
11
  /**
12
+ * Complete upload after using presigned URL
13
+ *
13
14
  * @example
14
15
  * ```ts
15
- * await client.v1.materials.upload.completeUpload();
16
+ * const material =
17
+ * await client.v1.materials.upload.completeUpload({
18
+ * materialId: '507f1f77bcf86cd799439013',
19
+ * organizationId: '507f1f77bcf86cd799439011',
20
+ * s3Key:
21
+ * 'organizations/507f1f77bcf86cd799439011/materials/document.pdf',
22
+ * });
16
23
  * ```
17
24
  */
18
- completeUpload(options?: RequestOptions): APIPromise<void> {
19
- return this._client.post('/api/v1/materials/upload/complete', {
20
- ...options,
21
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
22
- });
25
+ completeUpload(
26
+ body: UploadCompleteUploadParams,
27
+ options?: RequestOptions,
28
+ ): APIPromise<MaterialsAPI.Material> {
29
+ return this._client.post('/api/v1/materials/upload/complete', { body, ...options });
23
30
  }
24
31
 
25
32
  /**
33
+ * Get presigned URL for direct S3 upload
34
+ *
26
35
  * @example
27
36
  * ```ts
28
- * await client.v1.materials.upload.createPresignedURL();
37
+ * const response =
38
+ * await client.v1.materials.upload.createPresignedURL({
39
+ * contentType: 'application/pdf',
40
+ * filename: 'document.pdf',
41
+ * name: 'Chapter 1 Notes',
42
+ * });
29
43
  * ```
30
44
  */
31
- createPresignedURL(options?: RequestOptions): APIPromise<void> {
32
- return this._client.post('/api/v1/materials/upload/presigned-url', {
33
- ...options,
34
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
35
- });
45
+ createPresignedURL(
46
+ body: UploadCreatePresignedURLParams,
47
+ options?: RequestOptions,
48
+ ): APIPromise<UploadCreatePresignedURLResponse> {
49
+ return this._client.post('/api/v1/materials/upload/presigned-url', { body, ...options });
36
50
  }
37
51
 
38
52
  /**
@@ -54,6 +68,29 @@ export class Upload extends APIResource {
54
68
  );
55
69
  }
56
70
 
71
+ /**
72
+ * Uploads a file and waits for processing to finish before returning. Useful for
73
+ * synchronous API usage.
74
+ *
75
+ * @example
76
+ * ```ts
77
+ * const material =
78
+ * await client.v1.materials.upload.uploadFileAndProcess({
79
+ * file: fs.createReadStream('path/to/file'),
80
+ * name: 'name',
81
+ * });
82
+ * ```
83
+ */
84
+ uploadFileAndProcess(
85
+ body: UploadUploadFileAndProcessParams,
86
+ options?: RequestOptions,
87
+ ): APIPromise<MaterialsAPI.Material> {
88
+ return this._client.post(
89
+ '/api/v1/materials/upload/file-and-process',
90
+ multipartFormRequestOptions({ body, ...options }, this._client),
91
+ );
92
+ }
93
+
57
94
  /**
58
95
  * Upload material from URL
59
96
  *
@@ -72,6 +109,99 @@ export class Upload extends APIResource {
72
109
  ): APIPromise<MaterialsAPI.Material> {
73
110
  return this._client.post('/api/v1/materials/upload/url', { body, ...options });
74
111
  }
112
+
113
+ /**
114
+ * Fetches content from URL and waits for processing to finish before returning.
115
+ * Useful for synchronous API usage.
116
+ *
117
+ * @example
118
+ * ```ts
119
+ * const material =
120
+ * await client.v1.materials.upload.uploadURLAndProcess({
121
+ * name: 'My Document',
122
+ * url: 'https://example.com/document.pdf',
123
+ * });
124
+ * ```
125
+ */
126
+ uploadURLAndProcess(
127
+ body: UploadUploadURLAndProcessParams,
128
+ options?: RequestOptions,
129
+ ): APIPromise<MaterialsAPI.Material> {
130
+ return this._client.post('/api/v1/materials/upload/url-and-process', { body, ...options });
131
+ }
132
+ }
133
+
134
+ export interface Complete {
135
+ /**
136
+ * The ID of the material that was uploaded
137
+ */
138
+ materialId: string;
139
+
140
+ /**
141
+ * The ID of the organization
142
+ */
143
+ organizationId: string;
144
+
145
+ /**
146
+ * The S3 key of the uploaded file
147
+ */
148
+ s3Key: string;
149
+ }
150
+
151
+ export interface UploadCreatePresignedURLResponse {
152
+ /**
153
+ * Material ID to use for completion
154
+ */
155
+ materialId: string;
156
+
157
+ /**
158
+ * S3 key for the file
159
+ */
160
+ s3Key: string;
161
+
162
+ /**
163
+ * Presigned URL for direct S3 upload
164
+ */
165
+ uploadUrl: string;
166
+ }
167
+
168
+ export interface UploadCompleteUploadParams {
169
+ /**
170
+ * The ID of the material that was uploaded
171
+ */
172
+ materialId: string;
173
+
174
+ /**
175
+ * The ID of the organization
176
+ */
177
+ organizationId: string;
178
+
179
+ /**
180
+ * The S3 key of the uploaded file
181
+ */
182
+ s3Key: string;
183
+ }
184
+
185
+ export interface UploadCreatePresignedURLParams {
186
+ /**
187
+ * MIME type of the file
188
+ */
189
+ contentType: string;
190
+
191
+ /**
192
+ * Filename to upload
193
+ */
194
+ filename: string;
195
+
196
+ /**
197
+ * Display name for the material
198
+ */
199
+ name: string;
200
+
201
+ /**
202
+ * Folder ID to place the material in
203
+ */
204
+ folderId?: string;
75
205
  }
76
206
 
77
207
  export interface UploadUploadFileParams {
@@ -88,6 +218,30 @@ export interface UploadUploadFileParams {
88
218
  folderId?: string;
89
219
  }
90
220
 
221
+ export interface UploadUploadFileAndProcessParams {
222
+ file: Uploadable;
223
+
224
+ /**
225
+ * Material name
226
+ */
227
+ name: string;
228
+
229
+ /**
230
+ * Folder ID (optional)
231
+ */
232
+ folderId?: string;
233
+
234
+ /**
235
+ * Polling interval in milliseconds (default: 2000)
236
+ */
237
+ pollIntervalMs?: number;
238
+
239
+ /**
240
+ * Processing timeout in milliseconds (default: 300000)
241
+ */
242
+ timeoutMs?: number;
243
+ }
244
+
91
245
  export interface UploadUploadFromURLParams {
92
246
  /**
93
247
  * Material name
@@ -105,9 +259,42 @@ export interface UploadUploadFromURLParams {
105
259
  folderId?: string;
106
260
  }
107
261
 
262
+ export interface UploadUploadURLAndProcessParams {
263
+ /**
264
+ * Material name
265
+ */
266
+ name: string;
267
+
268
+ /**
269
+ * URL to fetch content from
270
+ */
271
+ url: string;
272
+
273
+ /**
274
+ * Folder ID (optional)
275
+ */
276
+ folderId?: string;
277
+
278
+ /**
279
+ * Polling interval in milliseconds (default: 2 seconds)
280
+ */
281
+ pollIntervalMs?: number;
282
+
283
+ /**
284
+ * Maximum time to wait for processing in milliseconds (default: 5 minutes)
285
+ */
286
+ timeoutMs?: number;
287
+ }
288
+
108
289
  export declare namespace Upload {
109
290
  export {
291
+ type Complete as Complete,
292
+ type UploadCreatePresignedURLResponse as UploadCreatePresignedURLResponse,
293
+ type UploadCompleteUploadParams as UploadCompleteUploadParams,
294
+ type UploadCreatePresignedURLParams as UploadCreatePresignedURLParams,
110
295
  type UploadUploadFileParams as UploadUploadFileParams,
296
+ type UploadUploadFileAndProcessParams as UploadUploadFileAndProcessParams,
111
297
  type UploadUploadFromURLParams as UploadUploadFromURLParams,
298
+ type UploadUploadURLAndProcessParams as UploadUploadURLAndProcessParams,
112
299
  };
113
300
  }
@@ -7,33 +7,38 @@ import { RequestOptions } from '../../../internal/request-options';
7
7
 
8
8
  export class Analyst extends APIResource {
9
9
  /**
10
- * Get test results for users and groups in JWT
10
+ * Get test results with full question data for user or group
11
11
  *
12
12
  * @example
13
13
  * ```ts
14
14
  * await client.v1.usage.analyst.getTestQuestions();
15
15
  * ```
16
16
  */
17
- getTestQuestions(options?: RequestOptions): APIPromise<void> {
17
+ getTestQuestions(
18
+ query: AnalystGetTestQuestionsParams | null | undefined = {},
19
+ options?: RequestOptions,
20
+ ): APIPromise<void> {
18
21
  return this._client.get('/api/v1/usage-analyst/test-questions', {
22
+ query,
19
23
  ...options,
20
24
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
21
25
  });
22
26
  }
23
27
 
24
28
  /**
25
- * Get chat messages for users and groups in JWT
29
+ * Get all chat messages from sessions for user or group
26
30
  *
27
31
  * @example
28
32
  * ```ts
29
- * await client.v1.usage.analyst.listChatMessages();
33
+ * const response =
34
+ * await client.v1.usage.analyst.listChatMessages();
30
35
  * ```
31
36
  */
32
- listChatMessages(options?: RequestOptions): APIPromise<void> {
33
- return this._client.get('/api/v1/usage-analyst/chat-messages', {
34
- ...options,
35
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
36
- });
37
+ listChatMessages(
38
+ query: AnalystListChatMessagesParams | null | undefined = {},
39
+ options?: RequestOptions,
40
+ ): APIPromise<AnalystListChatMessagesResponse> {
41
+ return this._client.get('/api/v1/usage-analyst/chat-messages', { query, ...options });
37
42
  }
38
43
 
39
44
  /**
@@ -57,6 +62,56 @@ export class Analyst extends APIResource {
57
62
  }
58
63
  }
59
64
 
65
+ export interface AnalystListChatMessagesResponse {
66
+ messages?: Array<AnalystListChatMessagesResponse.Message>;
67
+
68
+ sessionCount?: number;
69
+
70
+ total?: number;
71
+ }
72
+
73
+ export namespace AnalystListChatMessagesResponse {
74
+ export interface Message {
75
+ componentId?: string;
76
+
77
+ content?: string;
78
+
79
+ createdAt?: string;
80
+
81
+ metadata?: unknown;
82
+
83
+ role?: 'user' | 'assistant' | 'system';
84
+
85
+ sessionId?: string;
86
+
87
+ userId?: string;
88
+ }
89
+ }
90
+
91
+ export interface AnalystGetTestQuestionsParams {
92
+ /**
93
+ * Array of group IDs to filter
94
+ */
95
+ groupIds?: Array<string>;
96
+
97
+ /**
98
+ * User ID to get test results for
99
+ */
100
+ userId?: string;
101
+ }
102
+
103
+ export interface AnalystListChatMessagesParams {
104
+ /**
105
+ * Array of group IDs to filter
106
+ */
107
+ groupIds?: Array<string>;
108
+
109
+ /**
110
+ * User ID to get chat messages for
111
+ */
112
+ userId?: string;
113
+ }
114
+
60
115
  export interface AnalystListEventsParams {
61
116
  /**
62
117
  * End date for filtering (ISO 8601)
@@ -95,8 +150,23 @@ export interface AnalystListEventsParams {
95
150
  * Start date for filtering (ISO 8601)
96
151
  */
97
152
  startDate: string;
153
+
154
+ /**
155
+ * Array of group IDs to filter
156
+ */
157
+ groupIds?: Array<string>;
158
+
159
+ /**
160
+ * Array of user IDs to filter
161
+ */
162
+ userIds?: Array<string>;
98
163
  }
99
164
 
100
165
  export declare namespace Analyst {
101
- export { type AnalystListEventsParams as AnalystListEventsParams };
166
+ export {
167
+ type AnalystListChatMessagesResponse as AnalystListChatMessagesResponse,
168
+ type AnalystGetTestQuestionsParams as AnalystGetTestQuestionsParams,
169
+ type AnalystListChatMessagesParams as AnalystListChatMessagesParams,
170
+ type AnalystListEventsParams as AnalystListEventsParams,
171
+ };
102
172
  }
@@ -1,6 +1,12 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- export { Analyst, type AnalystListEventsParams } from './analyst';
3
+ export {
4
+ Analyst,
5
+ type AnalystListChatMessagesResponse,
6
+ type AnalystGetTestQuestionsParams,
7
+ type AnalystListChatMessagesParams,
8
+ type AnalystListEventsParams,
9
+ } from './analyst';
4
10
  export {
5
11
  Usage,
6
12
  type UsageGetStatsParams,
@@ -2,7 +2,13 @@
2
2
 
3
3
  import { APIResource } from '../../../core/resource';
4
4
  import * as AnalystAPI from './analyst';
5
- import { Analyst, AnalystListEventsParams } from './analyst';
5
+ import {
6
+ Analyst,
7
+ AnalystGetTestQuestionsParams,
8
+ AnalystListChatMessagesParams,
9
+ AnalystListChatMessagesResponse,
10
+ AnalystListEventsParams,
11
+ } from './analyst';
6
12
  import { APIPromise } from '../../../core/api-promise';
7
13
  import { buildHeaders } from '../../../internal/headers';
8
14
  import { RequestOptions } from '../../../internal/request-options';
@@ -184,5 +190,11 @@ export declare namespace Usage {
184
190
  type UsageListEventsParams as UsageListEventsParams,
185
191
  };
186
192
 
187
- export { Analyst as Analyst, type AnalystListEventsParams as AnalystListEventsParams };
193
+ export {
194
+ Analyst as Analyst,
195
+ type AnalystListChatMessagesResponse as AnalystListChatMessagesResponse,
196
+ type AnalystGetTestQuestionsParams as AnalystGetTestQuestionsParams,
197
+ type AnalystListChatMessagesParams as AnalystListChatMessagesParams,
198
+ type AnalystListEventsParams as AnalystListEventsParams,
199
+ };
188
200
  }