@studyfetch/sdk 1.23.0 → 1.25.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 +16 -0
- package/package.json +1 -1
- package/resources/v1/index.d.mts +1 -1
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +1 -1
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js.map +1 -1
- 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 +224 -29
- package/resources/v1/materials/materials.d.mts.map +1 -1
- package/resources/v1/materials/materials.d.ts +224 -29
- package/resources/v1/materials/materials.d.ts.map +1 -1
- package/resources/v1/materials/materials.js +47 -44
- package/resources/v1/materials/materials.js.map +1 -1
- package/resources/v1/materials/materials.mjs +49 -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 +66 -5
- package/resources/v1/materials/upload.d.mts.map +1 -1
- package/resources/v1/materials/upload.d.ts +66 -5
- package/resources/v1/materials/upload.d.ts.map +1 -1
- package/resources/v1/materials/upload.js +21 -13
- package/resources/v1/materials/upload.js.map +1 -1
- package/resources/v1/materials/upload.mjs +21 -13
- package/resources/v1/materials/upload.mjs.map +1 -1
- package/resources/v1/upload/component.d.mts +26 -47
- package/resources/v1/upload/component.d.mts.map +1 -1
- package/resources/v1/upload/component.d.ts +26 -47
- package/resources/v1/upload/component.d.ts.map +1 -1
- package/resources/v1/upload/component.js +11 -10
- package/resources/v1/upload/component.js.map +1 -1
- package/resources/v1/upload/component.mjs +11 -10
- package/resources/v1/upload/component.mjs.map +1 -1
- package/resources/v1/upload/index.d.mts +1 -1
- package/resources/v1/upload/index.d.mts.map +1 -1
- package/resources/v1/upload/index.d.ts +1 -1
- package/resources/v1/upload/index.d.ts.map +1 -1
- package/resources/v1/upload/index.js.map +1 -1
- package/resources/v1/upload/index.mjs.map +1 -1
- package/resources/v1/upload/upload.d.mts +2 -2
- package/resources/v1/upload/upload.d.mts.map +1 -1
- package/resources/v1/upload/upload.d.ts +2 -2
- package/resources/v1/upload/upload.d.ts.map +1 -1
- package/resources/v1/upload/upload.js.map +1 -1
- package/resources/v1/upload/upload.mjs.map +1 -1
- package/resources/v1/v1.d.mts +2 -2
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +2 -2
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs.map +1 -1
- package/src/resources/v1/index.ts +7 -0
- package/src/resources/v1/materials/bulk.ts +36 -7
- package/src/resources/v1/materials/index.ts +23 -3
- package/src/resources/v1/materials/materials.ts +302 -58
- package/src/resources/v1/materials/test.ts +141 -25
- package/src/resources/v1/materials/upload.ts +86 -13
- package/src/resources/v1/upload/component.ts +26 -53
- package/src/resources/v1/upload/index.ts +1 -2
- package/src/resources/v1/upload/upload.ts +2 -4
- package/src/resources/v1/v1.ts +14 -0
- 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,11 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../../core/resource';
|
|
4
4
|
import * as BulkAPI from './bulk';
|
|
5
|
-
import { Bulk } from './bulk';
|
|
5
|
+
import { Bulk, BulkMoveParams, BulkMoveResponse } from './bulk';
|
|
6
6
|
import * as TestAPI from './test';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
Test,
|
|
9
|
+
TestPerformOcrResponse,
|
|
10
|
+
TestProcessEpubResponse,
|
|
11
|
+
TestProcessImageResponse,
|
|
12
|
+
TestProcessVideoResponse,
|
|
13
|
+
} from './test';
|
|
8
14
|
import * as UploadAPI from './upload';
|
|
9
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
Upload,
|
|
17
|
+
UploadCompleteUploadParams,
|
|
18
|
+
UploadCreatePresignedURLParams,
|
|
19
|
+
UploadCreatePresignedURLResponse,
|
|
20
|
+
UploadUploadFileParams,
|
|
21
|
+
UploadUploadFromURLParams,
|
|
22
|
+
} from './upload';
|
|
10
23
|
import { APIPromise } from '../../../core/api-promise';
|
|
11
24
|
import { buildHeaders } from '../../../internal/headers';
|
|
12
25
|
import { RequestOptions } from '../../../internal/request-options';
|
|
@@ -75,104 +88,110 @@ export class Materials extends APIResource {
|
|
|
75
88
|
}
|
|
76
89
|
|
|
77
90
|
/**
|
|
91
|
+
* Create batch upload URLs for multiple materials
|
|
92
|
+
*
|
|
78
93
|
* @example
|
|
79
94
|
* ```ts
|
|
80
|
-
* await client.v1.materials.batchCreate(
|
|
95
|
+
* const response = await client.v1.materials.batchCreate({
|
|
96
|
+
* materials: [
|
|
97
|
+
* {
|
|
98
|
+
* contentType: 'application/pdf',
|
|
99
|
+
* filename: 'document.pdf',
|
|
100
|
+
* name: 'Chapter 1',
|
|
101
|
+
* },
|
|
102
|
+
* ],
|
|
103
|
+
* });
|
|
81
104
|
* ```
|
|
82
105
|
*/
|
|
83
|
-
batchCreate(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
});
|
|
106
|
+
batchCreate(
|
|
107
|
+
body: MaterialBatchCreateParams,
|
|
108
|
+
options?: RequestOptions,
|
|
109
|
+
): APIPromise<MaterialBatchCreateResponse> {
|
|
110
|
+
return this._client.post('/api/v1/materials/batch', { body, ...options });
|
|
88
111
|
}
|
|
89
112
|
|
|
90
113
|
/**
|
|
114
|
+
* Get debug information for a material including extracted content
|
|
115
|
+
*
|
|
91
116
|
* @example
|
|
92
117
|
* ```ts
|
|
93
|
-
* await client.v1.materials.debug('id');
|
|
118
|
+
* const response = await client.v1.materials.debug('id');
|
|
94
119
|
* ```
|
|
95
120
|
*/
|
|
96
|
-
debug(id: string, options?: RequestOptions): APIPromise<
|
|
97
|
-
return this._client.get(path`/api/v1/materials/${id}/debug`,
|
|
98
|
-
...options,
|
|
99
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
100
|
-
});
|
|
121
|
+
debug(id: string, options?: RequestOptions): APIPromise<MaterialDebugResponse> {
|
|
122
|
+
return this._client.get(path`/api/v1/materials/${id}/debug`, options);
|
|
101
123
|
}
|
|
102
124
|
|
|
103
125
|
/**
|
|
126
|
+
* Get temporary download URL for material
|
|
127
|
+
*
|
|
104
128
|
* @example
|
|
105
129
|
* ```ts
|
|
106
|
-
* await client.v1.materials.getDownloadURL(
|
|
107
|
-
*
|
|
108
|
-
*
|
|
130
|
+
* const response = await client.v1.materials.getDownloadURL(
|
|
131
|
+
* 'id',
|
|
132
|
+
* );
|
|
109
133
|
* ```
|
|
110
134
|
*/
|
|
111
135
|
getDownloadURL(
|
|
112
136
|
id: string,
|
|
113
|
-
query: MaterialGetDownloadURLParams,
|
|
137
|
+
query: MaterialGetDownloadURLParams | null | undefined = {},
|
|
114
138
|
options?: RequestOptions,
|
|
115
|
-
): APIPromise<
|
|
116
|
-
return this._client.get(path`/api/v1/materials/${id}/download-url`, {
|
|
117
|
-
query,
|
|
118
|
-
...options,
|
|
119
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
120
|
-
});
|
|
139
|
+
): APIPromise<MaterialGetDownloadURLResponse> {
|
|
140
|
+
return this._client.get(path`/api/v1/materials/${id}/download-url`, { query, ...options });
|
|
121
141
|
}
|
|
122
142
|
|
|
123
143
|
/**
|
|
144
|
+
* Move material to a different folder
|
|
145
|
+
*
|
|
124
146
|
* @example
|
|
125
147
|
* ```ts
|
|
126
|
-
* await client.v1.materials.move('id'
|
|
148
|
+
* const material = await client.v1.materials.move('id', {
|
|
149
|
+
* folderId: 'folderId',
|
|
150
|
+
* });
|
|
127
151
|
* ```
|
|
128
152
|
*/
|
|
129
|
-
move(id: string, options?: RequestOptions): APIPromise<
|
|
130
|
-
return this._client.post(path`/api/v1/materials/${id}/move`, {
|
|
131
|
-
...options,
|
|
132
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
133
|
-
});
|
|
153
|
+
move(id: string, body: MaterialMoveParams, options?: RequestOptions): APIPromise<Material> {
|
|
154
|
+
return this._client.post(path`/api/v1/materials/${id}/move`, { body, ...options });
|
|
134
155
|
}
|
|
135
156
|
|
|
136
157
|
/**
|
|
158
|
+
* Rename a material
|
|
159
|
+
*
|
|
137
160
|
* @example
|
|
138
161
|
* ```ts
|
|
139
|
-
* await client.v1.materials.rename('id'
|
|
162
|
+
* const material = await client.v1.materials.rename('id', {
|
|
163
|
+
* name: 'New Material Name',
|
|
164
|
+
* });
|
|
140
165
|
* ```
|
|
141
166
|
*/
|
|
142
|
-
rename(id: string, options?: RequestOptions): APIPromise<
|
|
143
|
-
return this._client.post(path`/api/v1/materials/${id}/rename`, {
|
|
144
|
-
...options,
|
|
145
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
146
|
-
});
|
|
167
|
+
rename(id: string, body: MaterialRenameParams, options?: RequestOptions): APIPromise<Material> {
|
|
168
|
+
return this._client.post(path`/api/v1/materials/${id}/rename`, { body, ...options });
|
|
147
169
|
}
|
|
148
170
|
|
|
149
171
|
/**
|
|
172
|
+
* Reprocess material to regenerate embeddings and extract content
|
|
173
|
+
*
|
|
150
174
|
* @example
|
|
151
175
|
* ```ts
|
|
152
|
-
* await client.v1.materials.reprocess('id');
|
|
176
|
+
* const material = await client.v1.materials.reprocess('id');
|
|
153
177
|
* ```
|
|
154
178
|
*/
|
|
155
|
-
reprocess(id: string, options?: RequestOptions): APIPromise<
|
|
156
|
-
return this._client.post(path`/api/v1/materials/${id}/reprocess`,
|
|
157
|
-
...options,
|
|
158
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
159
|
-
});
|
|
179
|
+
reprocess(id: string, options?: RequestOptions): APIPromise<Material> {
|
|
180
|
+
return this._client.post(path`/api/v1/materials/${id}/reprocess`, options);
|
|
160
181
|
}
|
|
161
182
|
|
|
162
183
|
/**
|
|
163
|
-
* Search materials using RAG
|
|
184
|
+
* Search materials using RAG (Retrieval-Augmented Generation)
|
|
164
185
|
*
|
|
165
186
|
* @example
|
|
166
187
|
* ```ts
|
|
167
|
-
* await client.v1.materials.search({
|
|
188
|
+
* const response = await client.v1.materials.search({
|
|
189
|
+
* query: 'What is photosynthesis?',
|
|
190
|
+
* });
|
|
168
191
|
* ```
|
|
169
192
|
*/
|
|
170
|
-
search(body: MaterialSearchParams, options?: RequestOptions): APIPromise<
|
|
171
|
-
return this._client.post('/api/v1/materials/search', {
|
|
172
|
-
body,
|
|
173
|
-
...options,
|
|
174
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
175
|
-
});
|
|
193
|
+
search(body: MaterialSearchParams, options?: RequestOptions): APIPromise<MaterialSearchResponse> {
|
|
194
|
+
return this._client.post('/api/v1/materials/search', { body, ...options });
|
|
176
195
|
}
|
|
177
196
|
}
|
|
178
197
|
|
|
@@ -256,6 +275,168 @@ export namespace Material {
|
|
|
256
275
|
|
|
257
276
|
export type MaterialListResponse = Array<Material>;
|
|
258
277
|
|
|
278
|
+
export type MaterialBatchCreateResponse = Array<MaterialBatchCreateResponse.MaterialBatchCreateResponseItem>;
|
|
279
|
+
|
|
280
|
+
export namespace MaterialBatchCreateResponse {
|
|
281
|
+
export interface MaterialBatchCreateResponseItem {
|
|
282
|
+
/**
|
|
283
|
+
* Material ID
|
|
284
|
+
*/
|
|
285
|
+
materialId: string;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Material name
|
|
289
|
+
*/
|
|
290
|
+
name: string;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* S3 key
|
|
294
|
+
*/
|
|
295
|
+
s3Key: string;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Presigned upload URL
|
|
299
|
+
*/
|
|
300
|
+
uploadUrl: string;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export interface MaterialDebugResponse {
|
|
305
|
+
/**
|
|
306
|
+
* Content details
|
|
307
|
+
*/
|
|
308
|
+
content: unknown;
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Content type
|
|
312
|
+
*/
|
|
313
|
+
contentType: string;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Processed images
|
|
317
|
+
*/
|
|
318
|
+
images: Array<MaterialDebugResponse.Image>;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Material ID
|
|
322
|
+
*/
|
|
323
|
+
materialId: string;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Material metadata
|
|
327
|
+
*/
|
|
328
|
+
metadata: unknown;
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Material name
|
|
332
|
+
*/
|
|
333
|
+
name: string;
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Processing status
|
|
337
|
+
*/
|
|
338
|
+
status: string;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Transcript structure for videos
|
|
342
|
+
*/
|
|
343
|
+
transcriptStructure: unknown | null;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export namespace MaterialDebugResponse {
|
|
347
|
+
export interface Image {
|
|
348
|
+
id?: string;
|
|
349
|
+
|
|
350
|
+
description?: string;
|
|
351
|
+
|
|
352
|
+
pageIndex?: number;
|
|
353
|
+
|
|
354
|
+
s3Key?: string;
|
|
355
|
+
|
|
356
|
+
s3Url?: string;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export interface MaterialGetDownloadURLResponse {
|
|
361
|
+
/**
|
|
362
|
+
* Temporary download URL
|
|
363
|
+
*/
|
|
364
|
+
downloadUrl: string;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export interface MaterialSearchResponse {
|
|
368
|
+
/**
|
|
369
|
+
* Whether results were filtered by scope
|
|
370
|
+
*/
|
|
371
|
+
filtered: boolean;
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Original search query
|
|
375
|
+
*/
|
|
376
|
+
query: string;
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Search results
|
|
380
|
+
*/
|
|
381
|
+
results: Array<MaterialSearchResponse.Result>;
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Search scope
|
|
385
|
+
*/
|
|
386
|
+
scope: MaterialSearchResponse.Scope;
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Total number of results
|
|
390
|
+
*/
|
|
391
|
+
totalResults: number;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
export namespace MaterialSearchResponse {
|
|
395
|
+
export interface Result {
|
|
396
|
+
/**
|
|
397
|
+
* Chunk index within the material
|
|
398
|
+
*/
|
|
399
|
+
chunkIndex: number;
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Material information
|
|
403
|
+
*/
|
|
404
|
+
material: Result.Material | null;
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Relevance score (0-1)
|
|
408
|
+
*/
|
|
409
|
+
score: number;
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Matched text chunk
|
|
413
|
+
*/
|
|
414
|
+
text: string;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export namespace Result {
|
|
418
|
+
/**
|
|
419
|
+
* Material information
|
|
420
|
+
*/
|
|
421
|
+
export interface Material {
|
|
422
|
+
id?: string;
|
|
423
|
+
|
|
424
|
+
contentType?: string;
|
|
425
|
+
|
|
426
|
+
name?: string;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Search scope
|
|
432
|
+
*/
|
|
433
|
+
export interface Scope {
|
|
434
|
+
folderIds?: Array<string>;
|
|
435
|
+
|
|
436
|
+
materialIds?: Array<string>;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
|
|
259
440
|
export interface MaterialCreateParams {
|
|
260
441
|
/**
|
|
261
442
|
* Content details
|
|
@@ -307,8 +488,56 @@ export interface MaterialListParams {
|
|
|
307
488
|
folderId?: string;
|
|
308
489
|
}
|
|
309
490
|
|
|
491
|
+
export interface MaterialBatchCreateParams {
|
|
492
|
+
/**
|
|
493
|
+
* Array of materials to create
|
|
494
|
+
*/
|
|
495
|
+
materials: Array<MaterialBatchCreateParams.Material>;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
export namespace MaterialBatchCreateParams {
|
|
499
|
+
export interface Material {
|
|
500
|
+
/**
|
|
501
|
+
* MIME type
|
|
502
|
+
*/
|
|
503
|
+
contentType: string;
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* Filename
|
|
507
|
+
*/
|
|
508
|
+
filename: string;
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Material name
|
|
512
|
+
*/
|
|
513
|
+
name: string;
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Folder ID
|
|
517
|
+
*/
|
|
518
|
+
folderId?: string;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
|
|
310
522
|
export interface MaterialGetDownloadURLParams {
|
|
311
|
-
|
|
523
|
+
/**
|
|
524
|
+
* URL expiration time in seconds (default: 3600)
|
|
525
|
+
*/
|
|
526
|
+
expiresIn?: number;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
export interface MaterialMoveParams {
|
|
530
|
+
/**
|
|
531
|
+
* Target folder ID (null for root)
|
|
532
|
+
*/
|
|
533
|
+
folderId: string | null;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
export interface MaterialRenameParams {
|
|
537
|
+
/**
|
|
538
|
+
* New name for the material
|
|
539
|
+
*/
|
|
540
|
+
name: string;
|
|
312
541
|
}
|
|
313
542
|
|
|
314
543
|
export interface MaterialSearchParams {
|
|
@@ -318,18 +547,17 @@ export interface MaterialSearchParams {
|
|
|
318
547
|
query: string;
|
|
319
548
|
|
|
320
549
|
/**
|
|
321
|
-
*
|
|
322
|
-
* subfolders)
|
|
550
|
+
* Limit search to materials within specific folders (includes subfolders)
|
|
323
551
|
*/
|
|
324
552
|
folderIds?: Array<string>;
|
|
325
553
|
|
|
326
554
|
/**
|
|
327
|
-
*
|
|
555
|
+
* Limit search to specific material IDs
|
|
328
556
|
*/
|
|
329
557
|
materialIds?: Array<string>;
|
|
330
558
|
|
|
331
559
|
/**
|
|
332
|
-
* Number of results to return
|
|
560
|
+
* Number of results to return
|
|
333
561
|
*/
|
|
334
562
|
topK?: number;
|
|
335
563
|
}
|
|
@@ -342,19 +570,35 @@ export declare namespace Materials {
|
|
|
342
570
|
export {
|
|
343
571
|
type Material as Material,
|
|
344
572
|
type MaterialListResponse as MaterialListResponse,
|
|
573
|
+
type MaterialBatchCreateResponse as MaterialBatchCreateResponse,
|
|
574
|
+
type MaterialDebugResponse as MaterialDebugResponse,
|
|
575
|
+
type MaterialGetDownloadURLResponse as MaterialGetDownloadURLResponse,
|
|
576
|
+
type MaterialSearchResponse as MaterialSearchResponse,
|
|
345
577
|
type MaterialCreateParams as MaterialCreateParams,
|
|
346
578
|
type MaterialListParams as MaterialListParams,
|
|
579
|
+
type MaterialBatchCreateParams as MaterialBatchCreateParams,
|
|
347
580
|
type MaterialGetDownloadURLParams as MaterialGetDownloadURLParams,
|
|
581
|
+
type MaterialMoveParams as MaterialMoveParams,
|
|
582
|
+
type MaterialRenameParams as MaterialRenameParams,
|
|
348
583
|
type MaterialSearchParams as MaterialSearchParams,
|
|
349
584
|
};
|
|
350
585
|
|
|
351
586
|
export {
|
|
352
587
|
Upload as Upload,
|
|
588
|
+
type UploadCreatePresignedURLResponse as UploadCreatePresignedURLResponse,
|
|
589
|
+
type UploadCompleteUploadParams as UploadCompleteUploadParams,
|
|
590
|
+
type UploadCreatePresignedURLParams as UploadCreatePresignedURLParams,
|
|
353
591
|
type UploadUploadFileParams as UploadUploadFileParams,
|
|
354
592
|
type UploadUploadFromURLParams as UploadUploadFromURLParams,
|
|
355
593
|
};
|
|
356
594
|
|
|
357
|
-
export { Bulk as Bulk };
|
|
595
|
+
export { Bulk as Bulk, type BulkMoveResponse as BulkMoveResponse, type BulkMoveParams as BulkMoveParams };
|
|
358
596
|
|
|
359
|
-
export {
|
|
597
|
+
export {
|
|
598
|
+
Test as Test,
|
|
599
|
+
type TestPerformOcrResponse as TestPerformOcrResponse,
|
|
600
|
+
type TestProcessEpubResponse as TestProcessEpubResponse,
|
|
601
|
+
type TestProcessImageResponse as TestProcessImageResponse,
|
|
602
|
+
type TestProcessVideoResponse as TestProcessVideoResponse,
|
|
603
|
+
};
|
|
360
604
|
}
|
|
@@ -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
|
+
}
|