@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.
- package/CHANGELOG.md +18 -0
- package/package.json +1 -1
- package/resources/v1/assignment-grader.d.mts +34 -1
- package/resources/v1/assignment-grader.d.mts.map +1 -1
- package/resources/v1/assignment-grader.d.ts +34 -1
- package/resources/v1/assignment-grader.d.ts.map +1 -1
- package/resources/v1/assignment-grader.js +15 -0
- package/resources/v1/assignment-grader.js.map +1 -1
- package/resources/v1/assignment-grader.mjs +15 -0
- package/resources/v1/assignment-grader.mjs.map +1 -1
- package/resources/v1/chat/chat.d.mts +62 -1
- package/resources/v1/chat/chat.d.mts.map +1 -1
- package/resources/v1/chat/chat.d.ts +62 -1
- package/resources/v1/chat/chat.d.ts.map +1 -1
- package/resources/v1/chat/chat.js.map +1 -1
- package/resources/v1/chat/chat.mjs.map +1 -1
- package/resources/v1/chat/index.d.mts +1 -1
- package/resources/v1/chat/index.d.mts.map +1 -1
- package/resources/v1/chat/index.d.ts +1 -1
- package/resources/v1/chat/index.d.ts.map +1 -1
- package/resources/v1/chat/index.js.map +1 -1
- package/resources/v1/chat/index.mjs +1 -1
- package/resources/v1/chat/index.mjs.map +1 -1
- package/resources/v1/components.d.mts +62 -4
- package/resources/v1/components.d.mts.map +1 -1
- package/resources/v1/components.d.ts +62 -4
- package/resources/v1/components.d.ts.map +1 -1
- package/resources/v1/data-analyst/data-analyst.d.mts +156 -0
- package/resources/v1/data-analyst/data-analyst.d.mts.map +1 -0
- package/resources/v1/data-analyst/data-analyst.d.ts +156 -0
- package/resources/v1/data-analyst/data-analyst.d.ts.map +1 -0
- package/resources/v1/data-analyst/data-analyst.js +99 -0
- package/resources/v1/data-analyst/data-analyst.js.map +1 -0
- package/resources/v1/data-analyst/data-analyst.mjs +94 -0
- package/resources/v1/data-analyst/data-analyst.mjs.map +1 -0
- package/resources/v1/data-analyst/index.d.mts +4 -0
- package/resources/v1/data-analyst/index.d.mts.map +1 -0
- package/resources/v1/data-analyst/index.d.ts +4 -0
- package/resources/v1/data-analyst/index.d.ts.map +1 -0
- package/resources/v1/data-analyst/index.js +11 -0
- package/resources/v1/data-analyst/index.js.map +1 -0
- package/resources/v1/data-analyst/index.mjs +5 -0
- package/resources/v1/data-analyst/index.mjs.map +1 -0
- package/resources/v1/data-analyst/sessions.d.mts +28 -0
- package/resources/v1/data-analyst/sessions.d.mts.map +1 -0
- package/resources/v1/data-analyst/sessions.d.ts +28 -0
- package/resources/v1/data-analyst/sessions.d.ts.map +1 -0
- package/resources/v1/data-analyst/sessions.js +38 -0
- package/resources/v1/data-analyst/sessions.js.map +1 -0
- package/resources/v1/data-analyst/sessions.mjs +34 -0
- package/resources/v1/data-analyst/sessions.mjs.map +1 -0
- package/resources/v1/data-analyst/test.d.mts +20 -0
- package/resources/v1/data-analyst/test.d.mts.map +1 -0
- package/resources/v1/data-analyst/test.d.ts +20 -0
- package/resources/v1/data-analyst/test.d.ts.map +1 -0
- package/resources/v1/data-analyst/test.js +34 -0
- package/resources/v1/data-analyst/test.js.map +1 -0
- package/resources/v1/data-analyst/test.mjs +30 -0
- package/resources/v1/data-analyst/test.mjs.map +1 -0
- package/resources/v1/data-analyst.d.mts +2 -0
- package/resources/v1/data-analyst.d.mts.map +1 -0
- package/resources/v1/data-analyst.d.ts +2 -0
- package/resources/v1/data-analyst.d.ts.map +1 -0
- package/resources/v1/data-analyst.js +6 -0
- package/resources/v1/data-analyst.js.map +1 -0
- package/resources/v1/data-analyst.mjs +3 -0
- package/resources/v1/data-analyst.mjs.map +1 -0
- package/resources/v1/index.d.mts +3 -2
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +3 -2
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +15 -13
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +1 -0
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/materials/bulk.d.mts +30 -2
- package/resources/v1/materials/bulk.d.mts.map +1 -1
- package/resources/v1/materials/bulk.d.ts +30 -2
- package/resources/v1/materials/bulk.d.ts.map +1 -1
- package/resources/v1/materials/bulk.js +8 -7
- package/resources/v1/materials/bulk.js.map +1 -1
- package/resources/v1/materials/bulk.mjs +8 -7
- package/resources/v1/materials/bulk.mjs.map +1 -1
- package/resources/v1/materials/index.d.mts +4 -4
- package/resources/v1/materials/index.d.mts.map +1 -1
- package/resources/v1/materials/index.d.ts +4 -4
- package/resources/v1/materials/index.d.ts.map +1 -1
- package/resources/v1/materials/index.js.map +1 -1
- package/resources/v1/materials/index.mjs +2 -2
- package/resources/v1/materials/index.mjs.map +1 -1
- package/resources/v1/materials/materials.d.mts +270 -43
- package/resources/v1/materials/materials.d.mts.map +1 -1
- package/resources/v1/materials/materials.d.ts +270 -43
- package/resources/v1/materials/materials.d.ts.map +1 -1
- package/resources/v1/materials/materials.js +64 -44
- package/resources/v1/materials/materials.js.map +1 -1
- package/resources/v1/materials/materials.mjs +66 -46
- package/resources/v1/materials/materials.mjs.map +1 -1
- package/resources/v1/materials/test.d.mts +111 -8
- package/resources/v1/materials/test.d.mts.map +1 -1
- package/resources/v1/materials/test.d.ts +111 -8
- package/resources/v1/materials/test.d.ts.map +1 -1
- package/resources/v1/materials/test.js +20 -21
- package/resources/v1/materials/test.js.map +1 -1
- package/resources/v1/materials/test.mjs +20 -21
- package/resources/v1/materials/test.mjs.map +1 -1
- package/resources/v1/materials/upload.d.mts +149 -5
- package/resources/v1/materials/upload.d.mts.map +1 -1
- package/resources/v1/materials/upload.d.ts +149 -5
- package/resources/v1/materials/upload.d.ts.map +1 -1
- package/resources/v1/materials/upload.js +53 -13
- package/resources/v1/materials/upload.js.map +1 -1
- package/resources/v1/materials/upload.mjs +53 -13
- package/resources/v1/materials/upload.mjs.map +1 -1
- package/resources/v1/usage/analyst.d.mts +51 -6
- package/resources/v1/usage/analyst.d.mts.map +1 -1
- package/resources/v1/usage/analyst.d.ts +51 -6
- package/resources/v1/usage/analyst.d.ts.map +1 -1
- package/resources/v1/usage/analyst.js +8 -9
- package/resources/v1/usage/analyst.js.map +1 -1
- package/resources/v1/usage/analyst.mjs +8 -9
- package/resources/v1/usage/analyst.mjs.map +1 -1
- package/resources/v1/usage/index.d.mts +1 -1
- package/resources/v1/usage/index.d.mts.map +1 -1
- package/resources/v1/usage/index.d.ts +1 -1
- package/resources/v1/usage/index.d.ts.map +1 -1
- package/resources/v1/usage/index.js.map +1 -1
- package/resources/v1/usage/index.mjs +1 -1
- package/resources/v1/usage/index.mjs.map +1 -1
- package/resources/v1/usage/usage.d.mts +2 -2
- package/resources/v1/usage/usage.d.mts.map +1 -1
- package/resources/v1/usage/usage.d.ts +2 -2
- package/resources/v1/usage/usage.d.ts.map +1 -1
- package/resources/v1/usage/usage.js.map +1 -1
- package/resources/v1/usage/usage.mjs +1 -1
- package/resources/v1/usage/usage.mjs.map +1 -1
- package/resources/v1/v1.d.mts +19 -4
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +19 -4
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +19 -0
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +20 -1
- package/resources/v1/v1.mjs.map +1 -1
- package/src/resources/v1/assignment-grader.ts +47 -1
- package/src/resources/v1/chat/chat.ts +74 -0
- package/src/resources/v1/chat/index.ts +7 -1
- package/src/resources/v1/components.ts +76 -0
- package/src/resources/v1/data-analyst/data-analyst.ts +233 -0
- package/src/resources/v1/data-analyst/index.ts +10 -0
- package/src/resources/v1/data-analyst/sessions.ts +46 -0
- package/src/resources/v1/data-analyst/test.ts +34 -0
- package/src/resources/v1/data-analyst.ts +3 -0
- package/src/resources/v1/index.ts +16 -0
- package/src/resources/v1/materials/bulk.ts +36 -7
- package/src/resources/v1/materials/index.ts +28 -3
- package/src/resources/v1/materials/materials.ts +364 -72
- package/src/resources/v1/materials/test.ts +141 -25
- package/src/resources/v1/materials/upload.ts +200 -13
- package/src/resources/v1/usage/analyst.ts +80 -10
- package/src/resources/v1/usage/index.ts +7 -1
- package/src/resources/v1/usage/usage.ts +14 -2
- package/src/resources/v1/v1.ts +60 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- 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
|
-
*
|
|
13
|
+
* const response =
|
|
14
|
+
* await client.v1.materials.test.performOcr();
|
|
13
15
|
* ```
|
|
14
16
|
*/
|
|
15
|
-
performOcr(options?: RequestOptions): APIPromise<
|
|
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
|
-
*
|
|
26
|
+
* const response =
|
|
27
|
+
* await client.v1.materials.test.processEpub();
|
|
26
28
|
* ```
|
|
27
29
|
*/
|
|
28
|
-
processEpub(options?: RequestOptions): APIPromise<
|
|
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
|
-
*
|
|
39
|
+
* const response =
|
|
40
|
+
* await client.v1.materials.test.processImage();
|
|
39
41
|
* ```
|
|
40
42
|
*/
|
|
41
|
-
processImage(options?: RequestOptions): APIPromise<
|
|
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
|
-
*
|
|
52
|
+
* const response =
|
|
53
|
+
* await client.v1.materials.test.processVideo();
|
|
52
54
|
* ```
|
|
53
55
|
*/
|
|
54
|
-
processVideo(options?: RequestOptions): APIPromise<
|
|
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
|
-
*
|
|
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(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
*
|
|
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(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
|
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(
|
|
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
|
|
29
|
+
* Get all chat messages from sessions for user or group
|
|
26
30
|
*
|
|
27
31
|
* @example
|
|
28
32
|
* ```ts
|
|
29
|
-
*
|
|
33
|
+
* const response =
|
|
34
|
+
* await client.v1.usage.analyst.listChatMessages();
|
|
30
35
|
* ```
|
|
31
36
|
*/
|
|
32
|
-
listChatMessages(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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
|
}
|