@studyfetch/sdk 1.41.0 → 1.43.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 +34 -0
- package/README.md +6 -6
- package/internal/to-file.d.mts +1 -1
- package/internal/to-file.d.ts +1 -1
- package/internal/to-file.js +1 -1
- package/internal/to-file.mjs +1 -1
- package/package.json +1 -1
- package/resources/v1/components.d.mts +28 -0
- package/resources/v1/components.d.mts.map +1 -1
- package/resources/v1/components.d.ts +28 -0
- package/resources/v1/components.d.ts.map +1 -1
- package/resources/v1/folders.d.mts +2 -77
- package/resources/v1/folders.d.mts.map +1 -1
- package/resources/v1/folders.d.ts +2 -77
- package/resources/v1/folders.d.ts.map +1 -1
- package/resources/v1/folders.js.map +1 -1
- package/resources/v1/folders.mjs.map +1 -1
- package/resources/v1/index.d.mts +2 -1
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +2 -1
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +3 -1
- 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/index.d.mts +2 -2
- package/resources/v1/materials/index.d.mts.map +1 -1
- package/resources/v1/materials/index.d.ts +2 -2
- 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.map +1 -1
- package/resources/v1/materials/materials.d.mts +241 -805
- package/resources/v1/materials/materials.d.mts.map +1 -1
- package/resources/v1/materials/materials.d.ts +241 -805
- package/resources/v1/materials/materials.d.ts.map +1 -1
- package/resources/v1/materials/materials.js +54 -22
- package/resources/v1/materials/materials.js.map +1 -1
- package/resources/v1/materials/materials.mjs +54 -22
- package/resources/v1/materials/materials.mjs.map +1 -1
- package/resources/v1/materials/upload.d.mts +14 -407
- package/resources/v1/materials/upload.d.mts.map +1 -1
- package/resources/v1/materials/upload.d.ts +14 -407
- package/resources/v1/materials/upload.d.ts.map +1 -1
- package/resources/v1/materials/upload.js +5 -5
- package/resources/v1/materials/upload.js.map +1 -1
- package/resources/v1/materials/upload.mjs +5 -5
- package/resources/v1/materials/upload.mjs.map +1 -1
- package/resources/v1/pdf-generator/get.d.mts +61 -0
- package/resources/v1/pdf-generator/get.d.mts.map +1 -0
- package/resources/v1/pdf-generator/get.d.ts +61 -0
- package/resources/v1/pdf-generator/get.d.ts.map +1 -0
- package/resources/v1/pdf-generator/get.js +9 -0
- package/resources/v1/pdf-generator/get.js.map +1 -0
- package/resources/v1/pdf-generator/get.mjs +5 -0
- package/resources/v1/pdf-generator/get.mjs.map +1 -0
- package/resources/v1/pdf-generator/index.d.mts +3 -0
- package/resources/v1/pdf-generator/index.d.mts.map +1 -0
- package/resources/v1/pdf-generator/index.d.ts +3 -0
- package/resources/v1/pdf-generator/index.d.ts.map +1 -0
- package/resources/v1/pdf-generator/index.js +9 -0
- package/resources/v1/pdf-generator/index.js.map +1 -0
- package/resources/v1/pdf-generator/index.mjs +4 -0
- package/resources/v1/pdf-generator/index.mjs.map +1 -0
- package/resources/v1/pdf-generator/pdf-generator.d.mts +80 -0
- package/resources/v1/pdf-generator/pdf-generator.d.mts.map +1 -0
- package/resources/v1/pdf-generator/pdf-generator.d.ts +80 -0
- package/resources/v1/pdf-generator/pdf-generator.d.ts.map +1 -0
- package/resources/v1/pdf-generator/pdf-generator.js +70 -0
- package/resources/v1/pdf-generator/pdf-generator.js.map +1 -0
- package/resources/v1/pdf-generator/pdf-generator.mjs +65 -0
- package/resources/v1/pdf-generator/pdf-generator.mjs.map +1 -0
- package/resources/v1/pdf-generator.d.mts +2 -0
- package/resources/v1/pdf-generator.d.mts.map +1 -0
- package/resources/v1/pdf-generator.d.ts +2 -0
- package/resources/v1/pdf-generator.d.ts.map +1 -0
- package/resources/v1/pdf-generator.js +6 -0
- package/resources/v1/pdf-generator.js.map +1 -0
- package/resources/v1/pdf-generator.mjs +3 -0
- package/resources/v1/pdf-generator.mjs.map +1 -0
- package/resources/v1/v1.d.mts +6 -2
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +6 -2
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +4 -0
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +4 -0
- package/resources/v1/v1.mjs.map +1 -1
- package/src/internal/to-file.ts +1 -1
- package/src/resources/v1/components.ts +35 -0
- package/src/resources/v1/folders.ts +2 -98
- package/src/resources/v1/index.ts +14 -9
- package/src/resources/v1/materials/index.ts +7 -14
- package/src/resources/v1/materials/materials.ts +252 -988
- package/src/resources/v1/materials/upload.ts +16 -520
- package/src/resources/v1/pdf-generator/get.ts +75 -0
- package/src/resources/v1/pdf-generator/index.ts +10 -0
- package/src/resources/v1/pdf-generator/pdf-generator.ts +112 -0
- package/src/resources/v1/pdf-generator.ts +3 -0
- package/src/resources/v1/v1.ts +32 -18
- 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
|
@@ -7,17 +7,12 @@ import * as UploadAPI from './upload';
|
|
|
7
7
|
import {
|
|
8
8
|
Upload,
|
|
9
9
|
UploadCompleteUploadParams,
|
|
10
|
-
UploadCompleteUploadResponse,
|
|
11
10
|
UploadGetPresignedURLParams,
|
|
12
11
|
UploadGetPresignedURLResponse,
|
|
13
12
|
UploadUploadFileAndProcessParams,
|
|
14
|
-
UploadUploadFileAndProcessResponse,
|
|
15
13
|
UploadUploadFileParams,
|
|
16
|
-
UploadUploadFileResponse,
|
|
17
14
|
UploadUploadFromURLAndProcessParams,
|
|
18
|
-
UploadUploadFromURLAndProcessResponse,
|
|
19
15
|
UploadUploadFromURLParams,
|
|
20
|
-
UploadUploadFromURLResponse,
|
|
21
16
|
} from './upload';
|
|
22
17
|
import { APIPromise } from '../../../core/api-promise';
|
|
23
18
|
import { buildHeaders } from '../../../internal/headers';
|
|
@@ -33,13 +28,13 @@ export class Materials extends APIResource {
|
|
|
33
28
|
*
|
|
34
29
|
* @example
|
|
35
30
|
* ```ts
|
|
36
|
-
* const
|
|
31
|
+
* const materialResponse = await client.v1.materials.create({
|
|
37
32
|
* content: { type: 'text' },
|
|
38
33
|
* name: 'Chapter 1 - Introduction',
|
|
39
34
|
* });
|
|
40
35
|
* ```
|
|
41
36
|
*/
|
|
42
|
-
create(body: MaterialCreateParams, options?: RequestOptions): APIPromise<
|
|
37
|
+
create(body: MaterialCreateParams, options?: RequestOptions): APIPromise<MaterialResponse> {
|
|
43
38
|
return this._client.post('/api/v1/materials', { body, ...options });
|
|
44
39
|
}
|
|
45
40
|
|
|
@@ -48,10 +43,12 @@ export class Materials extends APIResource {
|
|
|
48
43
|
*
|
|
49
44
|
* @example
|
|
50
45
|
* ```ts
|
|
51
|
-
* const
|
|
46
|
+
* const materialResponse = await client.v1.materials.retrieve(
|
|
47
|
+
* 'id',
|
|
48
|
+
* );
|
|
52
49
|
* ```
|
|
53
50
|
*/
|
|
54
|
-
retrieve(id: string, options?: RequestOptions): APIPromise<
|
|
51
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<MaterialResponse> {
|
|
55
52
|
return this._client.get(path`/api/v1/materials/${id}`, options);
|
|
56
53
|
}
|
|
57
54
|
|
|
@@ -60,11 +57,13 @@ export class Materials extends APIResource {
|
|
|
60
57
|
*
|
|
61
58
|
* @example
|
|
62
59
|
* ```ts
|
|
63
|
-
* const
|
|
60
|
+
* const materialResponse = await client.v1.materials.update(
|
|
61
|
+
* 'id',
|
|
62
|
+
* );
|
|
64
63
|
* ```
|
|
65
64
|
*/
|
|
66
|
-
update(id: string, options?: RequestOptions): APIPromise<
|
|
67
|
-
return this._client.patch(path`/api/v1/materials/${id}`, options);
|
|
65
|
+
update(id: string, body: MaterialUpdateParams, options?: RequestOptions): APIPromise<MaterialResponse> {
|
|
66
|
+
return this._client.patch(path`/api/v1/materials/${id}`, { body, ...options });
|
|
68
67
|
}
|
|
69
68
|
|
|
70
69
|
/**
|
|
@@ -97,24 +96,35 @@ export class Materials extends APIResource {
|
|
|
97
96
|
});
|
|
98
97
|
}
|
|
99
98
|
|
|
99
|
+
/**
|
|
100
|
+
* Attempts to cancel a currently running PDF processing job
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* const response = await client.v1.materials.cancelJob('id');
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
cancelJob(id: string, options?: RequestOptions): APIPromise<MaterialCancelJobResponse> {
|
|
108
|
+
return this._client.post(path`/api/v1/materials/${id}/cancel-job`, options);
|
|
109
|
+
}
|
|
110
|
+
|
|
100
111
|
/**
|
|
101
112
|
* Creates a material and waits for processing to finish before returning. Useful
|
|
102
113
|
* for synchronous API usage.
|
|
103
114
|
*
|
|
104
115
|
* @example
|
|
105
116
|
* ```ts
|
|
106
|
-
* const
|
|
107
|
-
* {
|
|
117
|
+
* const materialResponse =
|
|
118
|
+
* await client.v1.materials.createAndProcess({
|
|
108
119
|
* content: { type: 'text' },
|
|
109
120
|
* name: 'Chapter 1 - Introduction',
|
|
110
|
-
* }
|
|
111
|
-
* );
|
|
121
|
+
* });
|
|
112
122
|
* ```
|
|
113
123
|
*/
|
|
114
124
|
createAndProcess(
|
|
115
125
|
body: MaterialCreateAndProcessParams,
|
|
116
126
|
options?: RequestOptions,
|
|
117
|
-
): APIPromise<
|
|
127
|
+
): APIPromise<MaterialResponse> {
|
|
118
128
|
return this._client.post('/api/v1/materials/upload-and-process', { body, ...options });
|
|
119
129
|
}
|
|
120
130
|
|
|
@@ -148,14 +158,15 @@ export class Materials extends APIResource {
|
|
|
148
158
|
*
|
|
149
159
|
* @example
|
|
150
160
|
* ```ts
|
|
151
|
-
* const
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
161
|
+
* const generatedMaterialResponse =
|
|
162
|
+
* await client.v1.materials.generate({
|
|
163
|
+
* name: 'Photosynthesis Study Plan',
|
|
164
|
+
* topic: 'Photosynthesis in plants',
|
|
165
|
+
* type: 'notes',
|
|
166
|
+
* });
|
|
156
167
|
* ```
|
|
157
168
|
*/
|
|
158
|
-
generate(body: MaterialGenerateParams, options?: RequestOptions): APIPromise<
|
|
169
|
+
generate(body: MaterialGenerateParams, options?: RequestOptions): APIPromise<GeneratedMaterialResponse> {
|
|
159
170
|
return this._client.post('/api/v1/materials/generate', { body, ...options });
|
|
160
171
|
}
|
|
161
172
|
|
|
@@ -165,7 +176,7 @@ export class Materials extends APIResource {
|
|
|
165
176
|
*
|
|
166
177
|
* @example
|
|
167
178
|
* ```ts
|
|
168
|
-
* const
|
|
179
|
+
* const generatedMaterialResponse =
|
|
169
180
|
* await client.v1.materials.generateAndProcess({
|
|
170
181
|
* name: 'Photosynthesis Study Plan',
|
|
171
182
|
* topic: 'Photosynthesis in plants',
|
|
@@ -176,7 +187,7 @@ export class Materials extends APIResource {
|
|
|
176
187
|
generateAndProcess(
|
|
177
188
|
body: MaterialGenerateAndProcessParams,
|
|
178
189
|
options?: RequestOptions,
|
|
179
|
-
): APIPromise<
|
|
190
|
+
): APIPromise<GeneratedMaterialResponse> {
|
|
180
191
|
return this._client.post('/api/v1/materials/generate-and-process', { body, ...options });
|
|
181
192
|
}
|
|
182
193
|
|
|
@@ -213,842 +224,101 @@ export class Materials extends APIResource {
|
|
|
213
224
|
}
|
|
214
225
|
|
|
215
226
|
/**
|
|
216
|
-
*
|
|
227
|
+
* Returns the current status of a PDF processing job including progress
|
|
228
|
+
* information
|
|
217
229
|
*
|
|
218
230
|
* @example
|
|
219
231
|
* ```ts
|
|
220
|
-
* const response = await client.v1.materials.
|
|
221
|
-
*
|
|
222
|
-
*
|
|
232
|
+
* const response = await client.v1.materials.getJobStatus(
|
|
233
|
+
* 'id',
|
|
234
|
+
* );
|
|
223
235
|
* ```
|
|
224
236
|
*/
|
|
225
|
-
|
|
226
|
-
return this._client.
|
|
237
|
+
getJobStatus(id: string, options?: RequestOptions): APIPromise<MaterialGetJobStatusResponse> {
|
|
238
|
+
return this._client.get(path`/api/v1/materials/${id}/job-status`, options);
|
|
227
239
|
}
|
|
228
240
|
|
|
229
241
|
/**
|
|
230
|
-
*
|
|
242
|
+
* Move material to a different folder
|
|
231
243
|
*
|
|
232
244
|
* @example
|
|
233
245
|
* ```ts
|
|
234
|
-
* const
|
|
235
|
-
*
|
|
236
|
-
* }
|
|
246
|
+
* const materialResponse = await client.v1.materials.move(
|
|
247
|
+
* 'id',
|
|
248
|
+
* { folderId: 'folderId' },
|
|
249
|
+
* );
|
|
237
250
|
* ```
|
|
238
251
|
*/
|
|
239
|
-
|
|
240
|
-
id
|
|
241
|
-
body: MaterialRenameParams,
|
|
242
|
-
options?: RequestOptions,
|
|
243
|
-
): APIPromise<MaterialRenameResponse> {
|
|
244
|
-
return this._client.post(path`/api/v1/materials/${id}/rename`, { body, ...options });
|
|
252
|
+
move(id: string, body: MaterialMoveParams, options?: RequestOptions): APIPromise<MaterialResponse> {
|
|
253
|
+
return this._client.post(path`/api/v1/materials/${id}/move`, { body, ...options });
|
|
245
254
|
}
|
|
246
255
|
|
|
247
256
|
/**
|
|
248
|
-
*
|
|
257
|
+
* Rename a material
|
|
249
258
|
*
|
|
250
259
|
* @example
|
|
251
260
|
* ```ts
|
|
252
|
-
* const
|
|
261
|
+
* const materialResponse = await client.v1.materials.rename(
|
|
262
|
+
* 'id',
|
|
263
|
+
* { name: 'New Material Name' },
|
|
264
|
+
* );
|
|
253
265
|
* ```
|
|
254
266
|
*/
|
|
255
|
-
|
|
256
|
-
return this._client.post(path`/api/v1/materials/${id}/
|
|
267
|
+
rename(id: string, body: MaterialRenameParams, options?: RequestOptions): APIPromise<MaterialResponse> {
|
|
268
|
+
return this._client.post(path`/api/v1/materials/${id}/rename`, { body, ...options });
|
|
257
269
|
}
|
|
258
270
|
|
|
259
271
|
/**
|
|
260
|
-
*
|
|
272
|
+
* Reprocess material to regenerate embeddings and extract content
|
|
261
273
|
*
|
|
262
274
|
* @example
|
|
263
275
|
* ```ts
|
|
264
|
-
* const
|
|
265
|
-
*
|
|
266
|
-
* });
|
|
276
|
+
* const materialResponse =
|
|
277
|
+
* await client.v1.materials.reprocess('id');
|
|
267
278
|
* ```
|
|
268
279
|
*/
|
|
269
|
-
|
|
270
|
-
return this._client.post(
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
export interface MaterialCreateResponse {
|
|
275
|
-
/**
|
|
276
|
-
* Material ID
|
|
277
|
-
*/
|
|
278
|
-
_id: string;
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* Material content
|
|
282
|
-
*/
|
|
283
|
-
content: MaterialCreateResponse.Content;
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* Content type
|
|
287
|
-
*/
|
|
288
|
-
contentType: 'text' | 'pdf' | 'video' | 'audio' | 'image' | 'epub';
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* Creation timestamp
|
|
292
|
-
*/
|
|
293
|
-
createdAt: string;
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* Folder ID
|
|
297
|
-
*/
|
|
298
|
-
folderId: string | null;
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* Material name
|
|
302
|
-
*/
|
|
303
|
-
name: string;
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* Organization ID
|
|
307
|
-
*/
|
|
308
|
-
organizationId: string;
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
* Material status
|
|
312
|
-
*/
|
|
313
|
-
status: 'active' | 'processing' | 'pending_upload' | 'error' | 'deleted';
|
|
314
|
-
|
|
315
|
-
/**
|
|
316
|
-
* Last update timestamp
|
|
317
|
-
*/
|
|
318
|
-
updatedAt: string;
|
|
319
|
-
|
|
320
|
-
/**
|
|
321
|
-
* Material metadata
|
|
322
|
-
*/
|
|
323
|
-
metadata?: unknown;
|
|
324
|
-
|
|
325
|
-
/**
|
|
326
|
-
* References that this material cites
|
|
327
|
-
*/
|
|
328
|
-
references?: Array<MaterialCreateResponse.Reference>;
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* Usage information
|
|
332
|
-
*/
|
|
333
|
-
usage?: unknown;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
export namespace MaterialCreateResponse {
|
|
337
|
-
/**
|
|
338
|
-
* Material content
|
|
339
|
-
*/
|
|
340
|
-
export interface Content {
|
|
341
|
-
filename?: string;
|
|
342
|
-
|
|
343
|
-
fileSize?: number;
|
|
344
|
-
|
|
345
|
-
mimeType?: string;
|
|
346
|
-
|
|
347
|
-
s3Key?: string;
|
|
348
|
-
|
|
349
|
-
s3Url?: string;
|
|
350
|
-
|
|
351
|
-
text?: string;
|
|
352
|
-
|
|
353
|
-
url?: string;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
export interface Reference {
|
|
357
|
-
/**
|
|
358
|
-
* Reference title
|
|
359
|
-
*/
|
|
360
|
-
title: string;
|
|
361
|
-
|
|
362
|
-
/**
|
|
363
|
-
* Reference URL
|
|
364
|
-
*/
|
|
365
|
-
url?: string;
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
export interface MaterialRetrieveResponse {
|
|
370
|
-
/**
|
|
371
|
-
* Material ID
|
|
372
|
-
*/
|
|
373
|
-
_id: string;
|
|
374
|
-
|
|
375
|
-
/**
|
|
376
|
-
* Material content
|
|
377
|
-
*/
|
|
378
|
-
content: MaterialRetrieveResponse.Content;
|
|
379
|
-
|
|
380
|
-
/**
|
|
381
|
-
* Content type
|
|
382
|
-
*/
|
|
383
|
-
contentType: 'text' | 'pdf' | 'video' | 'audio' | 'image' | 'epub';
|
|
384
|
-
|
|
385
|
-
/**
|
|
386
|
-
* Creation timestamp
|
|
387
|
-
*/
|
|
388
|
-
createdAt: string;
|
|
389
|
-
|
|
390
|
-
/**
|
|
391
|
-
* Folder ID
|
|
392
|
-
*/
|
|
393
|
-
folderId: string | null;
|
|
394
|
-
|
|
395
|
-
/**
|
|
396
|
-
* Material name
|
|
397
|
-
*/
|
|
398
|
-
name: string;
|
|
399
|
-
|
|
400
|
-
/**
|
|
401
|
-
* Organization ID
|
|
402
|
-
*/
|
|
403
|
-
organizationId: string;
|
|
404
|
-
|
|
405
|
-
/**
|
|
406
|
-
* Material status
|
|
407
|
-
*/
|
|
408
|
-
status: 'active' | 'processing' | 'pending_upload' | 'error' | 'deleted';
|
|
409
|
-
|
|
410
|
-
/**
|
|
411
|
-
* Last update timestamp
|
|
412
|
-
*/
|
|
413
|
-
updatedAt: string;
|
|
414
|
-
|
|
415
|
-
/**
|
|
416
|
-
* Material metadata
|
|
417
|
-
*/
|
|
418
|
-
metadata?: unknown;
|
|
419
|
-
|
|
420
|
-
/**
|
|
421
|
-
* References that this material cites
|
|
422
|
-
*/
|
|
423
|
-
references?: Array<MaterialRetrieveResponse.Reference>;
|
|
424
|
-
|
|
425
|
-
/**
|
|
426
|
-
* Usage information
|
|
427
|
-
*/
|
|
428
|
-
usage?: unknown;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
export namespace MaterialRetrieveResponse {
|
|
432
|
-
/**
|
|
433
|
-
* Material content
|
|
434
|
-
*/
|
|
435
|
-
export interface Content {
|
|
436
|
-
filename?: string;
|
|
437
|
-
|
|
438
|
-
fileSize?: number;
|
|
439
|
-
|
|
440
|
-
mimeType?: string;
|
|
441
|
-
|
|
442
|
-
s3Key?: string;
|
|
443
|
-
|
|
444
|
-
s3Url?: string;
|
|
445
|
-
|
|
446
|
-
text?: string;
|
|
447
|
-
|
|
448
|
-
url?: string;
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
export interface Reference {
|
|
452
|
-
/**
|
|
453
|
-
* Reference title
|
|
454
|
-
*/
|
|
455
|
-
title: string;
|
|
456
|
-
|
|
457
|
-
/**
|
|
458
|
-
* Reference URL
|
|
459
|
-
*/
|
|
460
|
-
url?: string;
|
|
280
|
+
reprocess(id: string, options?: RequestOptions): APIPromise<MaterialResponse> {
|
|
281
|
+
return this._client.post(path`/api/v1/materials/${id}/reprocess`, options);
|
|
461
282
|
}
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
export interface MaterialUpdateResponse {
|
|
465
|
-
/**
|
|
466
|
-
* Material ID
|
|
467
|
-
*/
|
|
468
|
-
_id: string;
|
|
469
|
-
|
|
470
|
-
/**
|
|
471
|
-
* Material content
|
|
472
|
-
*/
|
|
473
|
-
content: MaterialUpdateResponse.Content;
|
|
474
|
-
|
|
475
|
-
/**
|
|
476
|
-
* Content type
|
|
477
|
-
*/
|
|
478
|
-
contentType: 'text' | 'pdf' | 'video' | 'audio' | 'image' | 'epub';
|
|
479
|
-
|
|
480
|
-
/**
|
|
481
|
-
* Creation timestamp
|
|
482
|
-
*/
|
|
483
|
-
createdAt: string;
|
|
484
283
|
|
|
485
284
|
/**
|
|
486
|
-
*
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
*
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
/**
|
|
496
|
-
* Organization ID
|
|
497
|
-
*/
|
|
498
|
-
organizationId: string;
|
|
499
|
-
|
|
500
|
-
/**
|
|
501
|
-
* Material status
|
|
502
|
-
*/
|
|
503
|
-
status: 'active' | 'processing' | 'pending_upload' | 'error' | 'deleted';
|
|
504
|
-
|
|
505
|
-
/**
|
|
506
|
-
* Last update timestamp
|
|
507
|
-
*/
|
|
508
|
-
updatedAt: string;
|
|
509
|
-
|
|
510
|
-
/**
|
|
511
|
-
* Material metadata
|
|
512
|
-
*/
|
|
513
|
-
metadata?: unknown;
|
|
514
|
-
|
|
515
|
-
/**
|
|
516
|
-
* References that this material cites
|
|
517
|
-
*/
|
|
518
|
-
references?: Array<MaterialUpdateResponse.Reference>;
|
|
519
|
-
|
|
520
|
-
/**
|
|
521
|
-
* Usage information
|
|
522
|
-
*/
|
|
523
|
-
usage?: unknown;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
export namespace MaterialUpdateResponse {
|
|
527
|
-
/**
|
|
528
|
-
* Material content
|
|
529
|
-
*/
|
|
530
|
-
export interface Content {
|
|
531
|
-
filename?: string;
|
|
532
|
-
|
|
533
|
-
fileSize?: number;
|
|
534
|
-
|
|
535
|
-
mimeType?: string;
|
|
536
|
-
|
|
537
|
-
s3Key?: string;
|
|
538
|
-
|
|
539
|
-
s3Url?: string;
|
|
540
|
-
|
|
541
|
-
text?: string;
|
|
542
|
-
|
|
543
|
-
url?: string;
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
export interface Reference {
|
|
547
|
-
/**
|
|
548
|
-
* Reference title
|
|
549
|
-
*/
|
|
550
|
-
title: string;
|
|
551
|
-
|
|
552
|
-
/**
|
|
553
|
-
* Reference URL
|
|
554
|
-
*/
|
|
555
|
-
url?: string;
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
export interface MaterialListResponse {
|
|
560
|
-
materials?: Array<MaterialListResponse.Material>;
|
|
561
|
-
|
|
562
|
-
page?: number;
|
|
563
|
-
|
|
564
|
-
totalCount?: number;
|
|
565
|
-
|
|
566
|
-
totalPages?: number;
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
export namespace MaterialListResponse {
|
|
570
|
-
export interface Material {
|
|
571
|
-
/**
|
|
572
|
-
* Material ID
|
|
573
|
-
*/
|
|
574
|
-
_id: string;
|
|
575
|
-
|
|
576
|
-
/**
|
|
577
|
-
* Material content
|
|
578
|
-
*/
|
|
579
|
-
content: Material.Content;
|
|
580
|
-
|
|
581
|
-
/**
|
|
582
|
-
* Content type
|
|
583
|
-
*/
|
|
584
|
-
contentType: 'text' | 'pdf' | 'video' | 'audio' | 'image' | 'epub';
|
|
585
|
-
|
|
586
|
-
/**
|
|
587
|
-
* Creation timestamp
|
|
588
|
-
*/
|
|
589
|
-
createdAt: string;
|
|
590
|
-
|
|
591
|
-
/**
|
|
592
|
-
* Folder ID
|
|
593
|
-
*/
|
|
594
|
-
folderId: string | null;
|
|
595
|
-
|
|
596
|
-
/**
|
|
597
|
-
* Material name
|
|
598
|
-
*/
|
|
599
|
-
name: string;
|
|
600
|
-
|
|
601
|
-
/**
|
|
602
|
-
* Organization ID
|
|
603
|
-
*/
|
|
604
|
-
organizationId: string;
|
|
605
|
-
|
|
606
|
-
/**
|
|
607
|
-
* Material status
|
|
608
|
-
*/
|
|
609
|
-
status: 'active' | 'processing' | 'pending_upload' | 'error' | 'deleted';
|
|
610
|
-
|
|
611
|
-
/**
|
|
612
|
-
* Last update timestamp
|
|
613
|
-
*/
|
|
614
|
-
updatedAt: string;
|
|
615
|
-
|
|
616
|
-
/**
|
|
617
|
-
* Material metadata
|
|
618
|
-
*/
|
|
619
|
-
metadata?: unknown;
|
|
620
|
-
|
|
621
|
-
/**
|
|
622
|
-
* References that this material cites
|
|
623
|
-
*/
|
|
624
|
-
references?: Array<Material.Reference>;
|
|
625
|
-
|
|
626
|
-
/**
|
|
627
|
-
* Usage information
|
|
628
|
-
*/
|
|
629
|
-
usage?: unknown;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
export namespace Material {
|
|
633
|
-
/**
|
|
634
|
-
* Material content
|
|
635
|
-
*/
|
|
636
|
-
export interface Content {
|
|
637
|
-
filename?: string;
|
|
638
|
-
|
|
639
|
-
fileSize?: number;
|
|
640
|
-
|
|
641
|
-
mimeType?: string;
|
|
642
|
-
|
|
643
|
-
s3Key?: string;
|
|
644
|
-
|
|
645
|
-
s3Url?: string;
|
|
646
|
-
|
|
647
|
-
text?: string;
|
|
648
|
-
|
|
649
|
-
url?: string;
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
export interface Reference {
|
|
653
|
-
/**
|
|
654
|
-
* Reference title
|
|
655
|
-
*/
|
|
656
|
-
title: string;
|
|
657
|
-
|
|
658
|
-
/**
|
|
659
|
-
* Reference URL
|
|
660
|
-
*/
|
|
661
|
-
url?: string;
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
export interface MaterialCreateAndProcessResponse {
|
|
667
|
-
/**
|
|
668
|
-
* Material ID
|
|
669
|
-
*/
|
|
670
|
-
_id: string;
|
|
671
|
-
|
|
672
|
-
/**
|
|
673
|
-
* Material content
|
|
674
|
-
*/
|
|
675
|
-
content: MaterialCreateAndProcessResponse.Content;
|
|
676
|
-
|
|
677
|
-
/**
|
|
678
|
-
* Content type
|
|
679
|
-
*/
|
|
680
|
-
contentType: 'text' | 'pdf' | 'video' | 'audio' | 'image' | 'epub';
|
|
681
|
-
|
|
682
|
-
/**
|
|
683
|
-
* Creation timestamp
|
|
684
|
-
*/
|
|
685
|
-
createdAt: string;
|
|
686
|
-
|
|
687
|
-
/**
|
|
688
|
-
* Folder ID
|
|
689
|
-
*/
|
|
690
|
-
folderId: string | null;
|
|
691
|
-
|
|
692
|
-
/**
|
|
693
|
-
* Material name
|
|
694
|
-
*/
|
|
695
|
-
name: string;
|
|
696
|
-
|
|
697
|
-
/**
|
|
698
|
-
* Organization ID
|
|
699
|
-
*/
|
|
700
|
-
organizationId: string;
|
|
701
|
-
|
|
702
|
-
/**
|
|
703
|
-
* Material status
|
|
704
|
-
*/
|
|
705
|
-
status: 'active' | 'processing' | 'pending_upload' | 'error' | 'deleted';
|
|
706
|
-
|
|
707
|
-
/**
|
|
708
|
-
* Last update timestamp
|
|
709
|
-
*/
|
|
710
|
-
updatedAt: string;
|
|
711
|
-
|
|
712
|
-
/**
|
|
713
|
-
* Material metadata
|
|
714
|
-
*/
|
|
715
|
-
metadata?: unknown;
|
|
716
|
-
|
|
717
|
-
/**
|
|
718
|
-
* References that this material cites
|
|
719
|
-
*/
|
|
720
|
-
references?: Array<MaterialCreateAndProcessResponse.Reference>;
|
|
721
|
-
|
|
722
|
-
/**
|
|
723
|
-
* Usage information
|
|
724
|
-
*/
|
|
725
|
-
usage?: unknown;
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
export namespace MaterialCreateAndProcessResponse {
|
|
729
|
-
/**
|
|
730
|
-
* Material content
|
|
731
|
-
*/
|
|
732
|
-
export interface Content {
|
|
733
|
-
filename?: string;
|
|
734
|
-
|
|
735
|
-
fileSize?: number;
|
|
736
|
-
|
|
737
|
-
mimeType?: string;
|
|
738
|
-
|
|
739
|
-
s3Key?: string;
|
|
740
|
-
|
|
741
|
-
s3Url?: string;
|
|
742
|
-
|
|
743
|
-
text?: string;
|
|
744
|
-
|
|
745
|
-
url?: string;
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
export interface Reference {
|
|
749
|
-
/**
|
|
750
|
-
* Reference title
|
|
751
|
-
*/
|
|
752
|
-
title: string;
|
|
753
|
-
|
|
754
|
-
/**
|
|
755
|
-
* Reference URL
|
|
756
|
-
*/
|
|
757
|
-
url?: string;
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
export type MaterialCreateBatchUploadURLsResponse =
|
|
762
|
-
Array<MaterialCreateBatchUploadURLsResponse.MaterialCreateBatchUploadURLsResponseItem>;
|
|
763
|
-
|
|
764
|
-
export namespace MaterialCreateBatchUploadURLsResponse {
|
|
765
|
-
export interface MaterialCreateBatchUploadURLsResponseItem {
|
|
766
|
-
/**
|
|
767
|
-
* Material ID
|
|
768
|
-
*/
|
|
769
|
-
materialId: string;
|
|
770
|
-
|
|
771
|
-
/**
|
|
772
|
-
* Material name
|
|
773
|
-
*/
|
|
774
|
-
name: string;
|
|
775
|
-
|
|
776
|
-
/**
|
|
777
|
-
* S3 key
|
|
778
|
-
*/
|
|
779
|
-
s3Key: string;
|
|
780
|
-
|
|
781
|
-
/**
|
|
782
|
-
* Presigned upload URL
|
|
783
|
-
*/
|
|
784
|
-
uploadUrl: string;
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
export interface MaterialGenerateResponse {
|
|
789
|
-
/**
|
|
790
|
-
* Material ID
|
|
791
|
-
*/
|
|
792
|
-
_id: string;
|
|
793
|
-
|
|
794
|
-
/**
|
|
795
|
-
* Material content
|
|
796
|
-
*/
|
|
797
|
-
content: MaterialGenerateResponse.Content;
|
|
798
|
-
|
|
799
|
-
/**
|
|
800
|
-
* Content type
|
|
801
|
-
*/
|
|
802
|
-
contentType: 'text' | 'pdf' | 'video' | 'audio' | 'image' | 'epub';
|
|
803
|
-
|
|
804
|
-
/**
|
|
805
|
-
* Creation timestamp
|
|
806
|
-
*/
|
|
807
|
-
createdAt: string;
|
|
808
|
-
|
|
809
|
-
/**
|
|
810
|
-
* Folder ID
|
|
811
|
-
*/
|
|
812
|
-
folderId: string | null;
|
|
813
|
-
|
|
814
|
-
/**
|
|
815
|
-
* Material name
|
|
816
|
-
*/
|
|
817
|
-
name: string;
|
|
818
|
-
|
|
819
|
-
/**
|
|
820
|
-
* Organization ID
|
|
821
|
-
*/
|
|
822
|
-
organizationId: string;
|
|
823
|
-
|
|
824
|
-
/**
|
|
825
|
-
* Material status
|
|
826
|
-
*/
|
|
827
|
-
status: 'active' | 'processing' | 'pending_upload' | 'error' | 'deleted';
|
|
828
|
-
|
|
829
|
-
/**
|
|
830
|
-
* Last update timestamp
|
|
831
|
-
*/
|
|
832
|
-
updatedAt: string;
|
|
833
|
-
|
|
834
|
-
/**
|
|
835
|
-
* Generation metadata
|
|
836
|
-
*/
|
|
837
|
-
generationMetadata?: unknown;
|
|
838
|
-
|
|
839
|
-
/**
|
|
840
|
-
* Material metadata
|
|
841
|
-
*/
|
|
842
|
-
metadata?: unknown;
|
|
843
|
-
|
|
844
|
-
/**
|
|
845
|
-
* References that this material cites
|
|
846
|
-
*/
|
|
847
|
-
references?: Array<MaterialGenerateResponse.Reference>;
|
|
848
|
-
|
|
849
|
-
/**
|
|
850
|
-
* Usage information
|
|
851
|
-
*/
|
|
852
|
-
usage?: unknown;
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
export namespace MaterialGenerateResponse {
|
|
856
|
-
/**
|
|
857
|
-
* Material content
|
|
858
|
-
*/
|
|
859
|
-
export interface Content {
|
|
860
|
-
filename?: string;
|
|
861
|
-
|
|
862
|
-
fileSize?: number;
|
|
863
|
-
|
|
864
|
-
mimeType?: string;
|
|
865
|
-
|
|
866
|
-
s3Key?: string;
|
|
867
|
-
|
|
868
|
-
s3Url?: string;
|
|
869
|
-
|
|
870
|
-
text?: string;
|
|
871
|
-
|
|
872
|
-
url?: string;
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
export interface Reference {
|
|
876
|
-
/**
|
|
877
|
-
* Reference title
|
|
878
|
-
*/
|
|
879
|
-
title: string;
|
|
880
|
-
|
|
881
|
-
/**
|
|
882
|
-
* Reference URL
|
|
883
|
-
*/
|
|
884
|
-
url?: string;
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
export interface MaterialGenerateAndProcessResponse {
|
|
889
|
-
/**
|
|
890
|
-
* Material ID
|
|
891
|
-
*/
|
|
892
|
-
_id: string;
|
|
893
|
-
|
|
894
|
-
/**
|
|
895
|
-
* Material content
|
|
896
|
-
*/
|
|
897
|
-
content: MaterialGenerateAndProcessResponse.Content;
|
|
898
|
-
|
|
899
|
-
/**
|
|
900
|
-
* Content type
|
|
901
|
-
*/
|
|
902
|
-
contentType: 'text' | 'pdf' | 'video' | 'audio' | 'image' | 'epub';
|
|
903
|
-
|
|
904
|
-
/**
|
|
905
|
-
* Creation timestamp
|
|
906
|
-
*/
|
|
907
|
-
createdAt: string;
|
|
908
|
-
|
|
909
|
-
/**
|
|
910
|
-
* Folder ID
|
|
911
|
-
*/
|
|
912
|
-
folderId: string | null;
|
|
913
|
-
|
|
914
|
-
/**
|
|
915
|
-
* Material name
|
|
916
|
-
*/
|
|
917
|
-
name: string;
|
|
918
|
-
|
|
919
|
-
/**
|
|
920
|
-
* Organization ID
|
|
921
|
-
*/
|
|
922
|
-
organizationId: string;
|
|
923
|
-
|
|
924
|
-
/**
|
|
925
|
-
* Material status
|
|
926
|
-
*/
|
|
927
|
-
status: 'active' | 'processing' | 'pending_upload' | 'error' | 'deleted';
|
|
928
|
-
|
|
929
|
-
/**
|
|
930
|
-
* Last update timestamp
|
|
931
|
-
*/
|
|
932
|
-
updatedAt: string;
|
|
933
|
-
|
|
934
|
-
/**
|
|
935
|
-
* Generation metadata
|
|
936
|
-
*/
|
|
937
|
-
generationMetadata?: unknown;
|
|
938
|
-
|
|
939
|
-
/**
|
|
940
|
-
* Material metadata
|
|
941
|
-
*/
|
|
942
|
-
metadata?: unknown;
|
|
943
|
-
|
|
944
|
-
/**
|
|
945
|
-
* References that this material cites
|
|
946
|
-
*/
|
|
947
|
-
references?: Array<MaterialGenerateAndProcessResponse.Reference>;
|
|
948
|
-
|
|
949
|
-
/**
|
|
950
|
-
* Usage information
|
|
951
|
-
*/
|
|
952
|
-
usage?: unknown;
|
|
953
|
-
}
|
|
954
|
-
|
|
955
|
-
export namespace MaterialGenerateAndProcessResponse {
|
|
956
|
-
/**
|
|
957
|
-
* Material content
|
|
958
|
-
*/
|
|
959
|
-
export interface Content {
|
|
960
|
-
filename?: string;
|
|
961
|
-
|
|
962
|
-
fileSize?: number;
|
|
963
|
-
|
|
964
|
-
mimeType?: string;
|
|
965
|
-
|
|
966
|
-
s3Key?: string;
|
|
967
|
-
|
|
968
|
-
s3Url?: string;
|
|
969
|
-
|
|
970
|
-
text?: string;
|
|
971
|
-
|
|
972
|
-
url?: string;
|
|
973
|
-
}
|
|
974
|
-
|
|
975
|
-
export interface Reference {
|
|
976
|
-
/**
|
|
977
|
-
* Reference title
|
|
978
|
-
*/
|
|
979
|
-
title: string;
|
|
980
|
-
|
|
981
|
-
/**
|
|
982
|
-
* Reference URL
|
|
983
|
-
*/
|
|
984
|
-
url?: string;
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
export interface MaterialGetDebugInfoResponse {
|
|
989
|
-
/**
|
|
990
|
-
* Content details
|
|
991
|
-
*/
|
|
992
|
-
content: unknown;
|
|
993
|
-
|
|
994
|
-
/**
|
|
995
|
-
* Content type
|
|
996
|
-
*/
|
|
997
|
-
contentType: string;
|
|
998
|
-
|
|
999
|
-
/**
|
|
1000
|
-
* Processed images
|
|
1001
|
-
*/
|
|
1002
|
-
images: Array<MaterialGetDebugInfoResponse.Image>;
|
|
1003
|
-
|
|
1004
|
-
/**
|
|
1005
|
-
* Material ID
|
|
1006
|
-
*/
|
|
1007
|
-
materialId: string;
|
|
1008
|
-
|
|
1009
|
-
/**
|
|
1010
|
-
* Material metadata
|
|
285
|
+
* Search materials using RAG (Retrieval-Augmented Generation)
|
|
286
|
+
*
|
|
287
|
+
* @example
|
|
288
|
+
* ```ts
|
|
289
|
+
* const response = await client.v1.materials.search({
|
|
290
|
+
* query: 'What is photosynthesis?',
|
|
291
|
+
* });
|
|
292
|
+
* ```
|
|
1011
293
|
*/
|
|
1012
|
-
|
|
294
|
+
search(body: MaterialSearchParams, options?: RequestOptions): APIPromise<MaterialSearchResponse> {
|
|
295
|
+
return this._client.post('/api/v1/materials/search', { body, ...options });
|
|
296
|
+
}
|
|
297
|
+
}
|
|
1013
298
|
|
|
299
|
+
export interface Content {
|
|
1014
300
|
/**
|
|
1015
|
-
*
|
|
301
|
+
* Type of content
|
|
1016
302
|
*/
|
|
1017
|
-
|
|
303
|
+
type: 'text' | 'pdf' | 'video' | 'audio' | 'url';
|
|
1018
304
|
|
|
1019
305
|
/**
|
|
1020
|
-
*
|
|
306
|
+
* URL to fetch content from
|
|
1021
307
|
*/
|
|
1022
|
-
|
|
308
|
+
sourceUrl?: string;
|
|
1023
309
|
|
|
1024
310
|
/**
|
|
1025
|
-
*
|
|
311
|
+
* Text content (for text type)
|
|
1026
312
|
*/
|
|
1027
|
-
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
export namespace MaterialGetDebugInfoResponse {
|
|
1031
|
-
export interface Image {
|
|
1032
|
-
id?: string;
|
|
1033
|
-
|
|
1034
|
-
description?: string;
|
|
1035
|
-
|
|
1036
|
-
pageIndex?: number;
|
|
1037
|
-
|
|
1038
|
-
s3Key?: string;
|
|
1039
|
-
|
|
1040
|
-
s3Url?: string;
|
|
1041
|
-
}
|
|
1042
|
-
}
|
|
313
|
+
text?: string;
|
|
1043
314
|
|
|
1044
|
-
export interface MaterialGetDownloadURLResponse {
|
|
1045
315
|
/**
|
|
1046
|
-
*
|
|
316
|
+
* URL to the content (for url type)
|
|
1047
317
|
*/
|
|
1048
|
-
|
|
318
|
+
url?: string;
|
|
1049
319
|
}
|
|
1050
320
|
|
|
1051
|
-
export interface
|
|
321
|
+
export interface GeneratedMaterialResponse {
|
|
1052
322
|
/**
|
|
1053
323
|
* Material ID
|
|
1054
324
|
*/
|
|
@@ -1057,7 +327,7 @@ export interface MaterialMoveResponse {
|
|
|
1057
327
|
/**
|
|
1058
328
|
* Material content
|
|
1059
329
|
*/
|
|
1060
|
-
content:
|
|
330
|
+
content: GeneratedMaterialResponse.Content;
|
|
1061
331
|
|
|
1062
332
|
/**
|
|
1063
333
|
* Content type
|
|
@@ -1094,6 +364,11 @@ export interface MaterialMoveResponse {
|
|
|
1094
364
|
*/
|
|
1095
365
|
updatedAt: string;
|
|
1096
366
|
|
|
367
|
+
/**
|
|
368
|
+
* Generation metadata
|
|
369
|
+
*/
|
|
370
|
+
generationMetadata?: unknown;
|
|
371
|
+
|
|
1097
372
|
/**
|
|
1098
373
|
* Material metadata
|
|
1099
374
|
*/
|
|
@@ -1102,7 +377,7 @@ export interface MaterialMoveResponse {
|
|
|
1102
377
|
/**
|
|
1103
378
|
* References that this material cites
|
|
1104
379
|
*/
|
|
1105
|
-
references?: Array<
|
|
380
|
+
references?: Array<Reference>;
|
|
1106
381
|
|
|
1107
382
|
/**
|
|
1108
383
|
* Usage information
|
|
@@ -1110,7 +385,7 @@ export interface MaterialMoveResponse {
|
|
|
1110
385
|
usage?: unknown;
|
|
1111
386
|
}
|
|
1112
387
|
|
|
1113
|
-
export namespace
|
|
388
|
+
export namespace GeneratedMaterialResponse {
|
|
1114
389
|
/**
|
|
1115
390
|
* Material content
|
|
1116
391
|
*/
|
|
@@ -1129,21 +404,9 @@ export namespace MaterialMoveResponse {
|
|
|
1129
404
|
|
|
1130
405
|
url?: string;
|
|
1131
406
|
}
|
|
1132
|
-
|
|
1133
|
-
export interface Reference {
|
|
1134
|
-
/**
|
|
1135
|
-
* Reference title
|
|
1136
|
-
*/
|
|
1137
|
-
title: string;
|
|
1138
|
-
|
|
1139
|
-
/**
|
|
1140
|
-
* Reference URL
|
|
1141
|
-
*/
|
|
1142
|
-
url?: string;
|
|
1143
|
-
}
|
|
1144
407
|
}
|
|
1145
408
|
|
|
1146
|
-
export interface
|
|
409
|
+
export interface MaterialResponse {
|
|
1147
410
|
/**
|
|
1148
411
|
* Material ID
|
|
1149
412
|
*/
|
|
@@ -1152,7 +415,7 @@ export interface MaterialRenameResponse {
|
|
|
1152
415
|
/**
|
|
1153
416
|
* Material content
|
|
1154
417
|
*/
|
|
1155
|
-
content:
|
|
418
|
+
content: MaterialResponse.Content;
|
|
1156
419
|
|
|
1157
420
|
/**
|
|
1158
421
|
* Content type
|
|
@@ -1197,7 +460,7 @@ export interface MaterialRenameResponse {
|
|
|
1197
460
|
/**
|
|
1198
461
|
* References that this material cites
|
|
1199
462
|
*/
|
|
1200
|
-
references?: Array<
|
|
463
|
+
references?: Array<Reference>;
|
|
1201
464
|
|
|
1202
465
|
/**
|
|
1203
466
|
* Usage information
|
|
@@ -1205,7 +468,7 @@ export interface MaterialRenameResponse {
|
|
|
1205
468
|
usage?: unknown;
|
|
1206
469
|
}
|
|
1207
470
|
|
|
1208
|
-
export namespace
|
|
471
|
+
export namespace MaterialResponse {
|
|
1209
472
|
/**
|
|
1210
473
|
* Material content
|
|
1211
474
|
*/
|
|
@@ -1224,45 +487,88 @@ export namespace MaterialRenameResponse {
|
|
|
1224
487
|
|
|
1225
488
|
url?: string;
|
|
1226
489
|
}
|
|
490
|
+
}
|
|
1227
491
|
|
|
1228
|
-
|
|
492
|
+
export interface Reference {
|
|
493
|
+
/**
|
|
494
|
+
* Reference title
|
|
495
|
+
*/
|
|
496
|
+
title: string;
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Reference URL
|
|
500
|
+
*/
|
|
501
|
+
url?: string;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
export interface MaterialListResponse {
|
|
505
|
+
materials?: Array<MaterialResponse>;
|
|
506
|
+
|
|
507
|
+
page?: number;
|
|
508
|
+
|
|
509
|
+
totalCount?: number;
|
|
510
|
+
|
|
511
|
+
totalPages?: number;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
export interface MaterialCancelJobResponse {
|
|
515
|
+
message?: string;
|
|
516
|
+
|
|
517
|
+
success?: boolean;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
export type MaterialCreateBatchUploadURLsResponse =
|
|
521
|
+
Array<MaterialCreateBatchUploadURLsResponse.MaterialCreateBatchUploadURLsResponseItem>;
|
|
522
|
+
|
|
523
|
+
export namespace MaterialCreateBatchUploadURLsResponse {
|
|
524
|
+
export interface MaterialCreateBatchUploadURLsResponseItem {
|
|
1229
525
|
/**
|
|
1230
|
-
*
|
|
526
|
+
* Material ID
|
|
1231
527
|
*/
|
|
1232
|
-
|
|
528
|
+
materialId: string;
|
|
1233
529
|
|
|
1234
530
|
/**
|
|
1235
|
-
*
|
|
531
|
+
* Material name
|
|
1236
532
|
*/
|
|
1237
|
-
|
|
533
|
+
name: string;
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* S3 key
|
|
537
|
+
*/
|
|
538
|
+
s3Key: string;
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Presigned upload URL
|
|
542
|
+
*/
|
|
543
|
+
uploadUrl: string;
|
|
1238
544
|
}
|
|
1239
545
|
}
|
|
1240
546
|
|
|
1241
|
-
export interface
|
|
547
|
+
export interface MaterialGetDebugInfoResponse {
|
|
1242
548
|
/**
|
|
1243
|
-
*
|
|
549
|
+
* Content details
|
|
1244
550
|
*/
|
|
1245
|
-
|
|
551
|
+
content: unknown;
|
|
1246
552
|
|
|
1247
553
|
/**
|
|
1248
|
-
*
|
|
554
|
+
* Content type
|
|
1249
555
|
*/
|
|
1250
|
-
|
|
556
|
+
contentType: string;
|
|
1251
557
|
|
|
1252
558
|
/**
|
|
1253
|
-
*
|
|
559
|
+
* Processed images
|
|
1254
560
|
*/
|
|
1255
|
-
|
|
561
|
+
images: Array<MaterialGetDebugInfoResponse.Image>;
|
|
1256
562
|
|
|
1257
563
|
/**
|
|
1258
|
-
*
|
|
564
|
+
* Material ID
|
|
1259
565
|
*/
|
|
1260
|
-
|
|
566
|
+
materialId: string;
|
|
1261
567
|
|
|
1262
568
|
/**
|
|
1263
|
-
*
|
|
569
|
+
* Material metadata
|
|
1264
570
|
*/
|
|
1265
|
-
|
|
571
|
+
metadata: unknown;
|
|
1266
572
|
|
|
1267
573
|
/**
|
|
1268
574
|
* Material name
|
|
@@ -1270,66 +576,116 @@ export interface MaterialReprocessResponse {
|
|
|
1270
576
|
name: string;
|
|
1271
577
|
|
|
1272
578
|
/**
|
|
1273
|
-
*
|
|
579
|
+
* Processing status
|
|
1274
580
|
*/
|
|
1275
|
-
|
|
581
|
+
status: string;
|
|
1276
582
|
|
|
1277
583
|
/**
|
|
1278
|
-
*
|
|
584
|
+
* Transcript structure for videos
|
|
1279
585
|
*/
|
|
1280
|
-
|
|
586
|
+
transcriptStructure: unknown | null;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
export namespace MaterialGetDebugInfoResponse {
|
|
590
|
+
export interface Image {
|
|
591
|
+
id?: string;
|
|
1281
592
|
|
|
593
|
+
description?: string;
|
|
594
|
+
|
|
595
|
+
pageIndex?: number;
|
|
596
|
+
|
|
597
|
+
s3Key?: string;
|
|
598
|
+
|
|
599
|
+
s3Url?: string;
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
export interface MaterialGetDownloadURLResponse {
|
|
1282
604
|
/**
|
|
1283
|
-
*
|
|
605
|
+
* Temporary download URL
|
|
1284
606
|
*/
|
|
1285
|
-
|
|
607
|
+
downloadUrl: string;
|
|
608
|
+
}
|
|
1286
609
|
|
|
610
|
+
export interface MaterialGetJobStatusResponse {
|
|
1287
611
|
/**
|
|
1288
|
-
*
|
|
612
|
+
* Job completion time
|
|
1289
613
|
*/
|
|
1290
|
-
|
|
614
|
+
completedAt?: string;
|
|
1291
615
|
|
|
1292
616
|
/**
|
|
1293
|
-
*
|
|
617
|
+
* Error message if job failed
|
|
1294
618
|
*/
|
|
1295
|
-
|
|
619
|
+
error?: string;
|
|
1296
620
|
|
|
1297
621
|
/**
|
|
1298
|
-
*
|
|
622
|
+
* Unique job identifier
|
|
1299
623
|
*/
|
|
1300
|
-
|
|
1301
|
-
|
|
624
|
+
jobId?: string;
|
|
625
|
+
|
|
626
|
+
progress?: MaterialGetJobStatusResponse.Progress;
|
|
627
|
+
|
|
628
|
+
resultSummary?: MaterialGetJobStatusResponse.ResultSummary;
|
|
1302
629
|
|
|
1303
|
-
export namespace MaterialReprocessResponse {
|
|
1304
630
|
/**
|
|
1305
|
-
*
|
|
631
|
+
* Job start time
|
|
1306
632
|
*/
|
|
1307
|
-
|
|
1308
|
-
filename?: string;
|
|
633
|
+
startedAt?: string;
|
|
1309
634
|
|
|
1310
|
-
|
|
635
|
+
/**
|
|
636
|
+
* Current job status
|
|
637
|
+
*/
|
|
638
|
+
status?: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
639
|
+
}
|
|
1311
640
|
|
|
1312
|
-
|
|
641
|
+
export namespace MaterialGetJobStatusResponse {
|
|
642
|
+
export interface Progress {
|
|
643
|
+
/**
|
|
644
|
+
* Current batch being processed
|
|
645
|
+
*/
|
|
646
|
+
currentBatch?: number;
|
|
1313
647
|
|
|
1314
|
-
|
|
648
|
+
/**
|
|
649
|
+
* Completion percentage (0-100)
|
|
650
|
+
*/
|
|
651
|
+
percentage?: number;
|
|
1315
652
|
|
|
1316
|
-
|
|
653
|
+
/**
|
|
654
|
+
* Images processed so far
|
|
655
|
+
*/
|
|
656
|
+
processedImages?: number;
|
|
1317
657
|
|
|
1318
|
-
|
|
658
|
+
/**
|
|
659
|
+
* Total number of batches
|
|
660
|
+
*/
|
|
661
|
+
totalBatches?: number;
|
|
1319
662
|
|
|
1320
|
-
|
|
663
|
+
/**
|
|
664
|
+
* Total images to process
|
|
665
|
+
*/
|
|
666
|
+
totalImages?: number;
|
|
1321
667
|
}
|
|
1322
668
|
|
|
1323
|
-
export interface
|
|
669
|
+
export interface ResultSummary {
|
|
1324
670
|
/**
|
|
1325
|
-
*
|
|
671
|
+
* Number of images processed
|
|
1326
672
|
*/
|
|
1327
|
-
|
|
673
|
+
imagesProcessed?: number;
|
|
1328
674
|
|
|
1329
675
|
/**
|
|
1330
|
-
*
|
|
676
|
+
* Total processing time in milliseconds
|
|
1331
677
|
*/
|
|
1332
|
-
|
|
678
|
+
processingTimeMs?: number;
|
|
679
|
+
|
|
680
|
+
/**
|
|
681
|
+
* Whether text was extracted
|
|
682
|
+
*/
|
|
683
|
+
textExtracted?: boolean;
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* Length of extracted text
|
|
687
|
+
*/
|
|
688
|
+
textLength?: number;
|
|
1333
689
|
}
|
|
1334
690
|
}
|
|
1335
691
|
|
|
@@ -1410,7 +766,7 @@ export interface MaterialCreateParams {
|
|
|
1410
766
|
/**
|
|
1411
767
|
* Content details
|
|
1412
768
|
*/
|
|
1413
|
-
content:
|
|
769
|
+
content: Content;
|
|
1414
770
|
|
|
1415
771
|
/**
|
|
1416
772
|
* Name of the material
|
|
@@ -1425,35 +781,17 @@ export interface MaterialCreateParams {
|
|
|
1425
781
|
/**
|
|
1426
782
|
* References that this material cites
|
|
1427
783
|
*/
|
|
1428
|
-
references?: Array<
|
|
784
|
+
references?: Array<Reference>;
|
|
1429
785
|
}
|
|
1430
786
|
|
|
1431
|
-
export
|
|
787
|
+
export interface MaterialUpdateParams {
|
|
1432
788
|
/**
|
|
1433
|
-
*
|
|
789
|
+
* Array of references to update (optional)
|
|
1434
790
|
*/
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
* Type of content
|
|
1438
|
-
*/
|
|
1439
|
-
type: 'text' | 'pdf' | 'video' | 'audio' | 'url';
|
|
1440
|
-
|
|
1441
|
-
/**
|
|
1442
|
-
* URL to fetch content from
|
|
1443
|
-
*/
|
|
1444
|
-
sourceUrl?: string;
|
|
1445
|
-
|
|
1446
|
-
/**
|
|
1447
|
-
* Text content (for text type)
|
|
1448
|
-
*/
|
|
1449
|
-
text?: string;
|
|
1450
|
-
|
|
1451
|
-
/**
|
|
1452
|
-
* URL to the content (for url type)
|
|
1453
|
-
*/
|
|
1454
|
-
url?: string;
|
|
1455
|
-
}
|
|
791
|
+
references?: Array<MaterialUpdateParams.Reference>;
|
|
792
|
+
}
|
|
1456
793
|
|
|
794
|
+
export namespace MaterialUpdateParams {
|
|
1457
795
|
export interface Reference {
|
|
1458
796
|
/**
|
|
1459
797
|
* Reference title
|
|
@@ -1461,7 +799,7 @@ export namespace MaterialCreateParams {
|
|
|
1461
799
|
title: string;
|
|
1462
800
|
|
|
1463
801
|
/**
|
|
1464
|
-
* Reference URL
|
|
802
|
+
* Reference URL (optional)
|
|
1465
803
|
*/
|
|
1466
804
|
url?: string;
|
|
1467
805
|
}
|
|
@@ -1493,7 +831,7 @@ export interface MaterialCreateAndProcessParams {
|
|
|
1493
831
|
/**
|
|
1494
832
|
* Content details
|
|
1495
833
|
*/
|
|
1496
|
-
content:
|
|
834
|
+
content: Content;
|
|
1497
835
|
|
|
1498
836
|
/**
|
|
1499
837
|
* Name of the material
|
|
@@ -1513,7 +851,7 @@ export interface MaterialCreateAndProcessParams {
|
|
|
1513
851
|
/**
|
|
1514
852
|
* References that this material cites
|
|
1515
853
|
*/
|
|
1516
|
-
references?: Array<
|
|
854
|
+
references?: Array<Reference>;
|
|
1517
855
|
|
|
1518
856
|
/**
|
|
1519
857
|
* Maximum time to wait for processing in milliseconds (default: 5 minutes)
|
|
@@ -1521,45 +859,6 @@ export interface MaterialCreateAndProcessParams {
|
|
|
1521
859
|
timeoutMs?: number;
|
|
1522
860
|
}
|
|
1523
861
|
|
|
1524
|
-
export namespace MaterialCreateAndProcessParams {
|
|
1525
|
-
/**
|
|
1526
|
-
* Content details
|
|
1527
|
-
*/
|
|
1528
|
-
export interface Content {
|
|
1529
|
-
/**
|
|
1530
|
-
* Type of content
|
|
1531
|
-
*/
|
|
1532
|
-
type: 'text' | 'pdf' | 'video' | 'audio' | 'url';
|
|
1533
|
-
|
|
1534
|
-
/**
|
|
1535
|
-
* URL to fetch content from
|
|
1536
|
-
*/
|
|
1537
|
-
sourceUrl?: string;
|
|
1538
|
-
|
|
1539
|
-
/**
|
|
1540
|
-
* Text content (for text type)
|
|
1541
|
-
*/
|
|
1542
|
-
text?: string;
|
|
1543
|
-
|
|
1544
|
-
/**
|
|
1545
|
-
* URL to the content (for url type)
|
|
1546
|
-
*/
|
|
1547
|
-
url?: string;
|
|
1548
|
-
}
|
|
1549
|
-
|
|
1550
|
-
export interface Reference {
|
|
1551
|
-
/**
|
|
1552
|
-
* Reference title
|
|
1553
|
-
*/
|
|
1554
|
-
title: string;
|
|
1555
|
-
|
|
1556
|
-
/**
|
|
1557
|
-
* Reference URL
|
|
1558
|
-
*/
|
|
1559
|
-
url?: string;
|
|
1560
|
-
}
|
|
1561
|
-
}
|
|
1562
|
-
|
|
1563
862
|
export interface MaterialCreateBatchUploadURLsParams {
|
|
1564
863
|
/**
|
|
1565
864
|
* Array of materials to create
|
|
@@ -1630,21 +929,7 @@ export interface MaterialGenerateParams {
|
|
|
1630
929
|
/**
|
|
1631
930
|
* References that this material cites
|
|
1632
931
|
*/
|
|
1633
|
-
references?: Array<
|
|
1634
|
-
}
|
|
1635
|
-
|
|
1636
|
-
export namespace MaterialGenerateParams {
|
|
1637
|
-
export interface Reference {
|
|
1638
|
-
/**
|
|
1639
|
-
* Reference title
|
|
1640
|
-
*/
|
|
1641
|
-
title: string;
|
|
1642
|
-
|
|
1643
|
-
/**
|
|
1644
|
-
* Reference URL
|
|
1645
|
-
*/
|
|
1646
|
-
url?: string;
|
|
1647
|
-
}
|
|
932
|
+
references?: Array<Reference>;
|
|
1648
933
|
}
|
|
1649
934
|
|
|
1650
935
|
export interface MaterialGenerateAndProcessParams {
|
|
@@ -1691,7 +976,7 @@ export interface MaterialGenerateAndProcessParams {
|
|
|
1691
976
|
/**
|
|
1692
977
|
* References that this material cites
|
|
1693
978
|
*/
|
|
1694
|
-
references?: Array<
|
|
979
|
+
references?: Array<Reference>;
|
|
1695
980
|
|
|
1696
981
|
/**
|
|
1697
982
|
* Maximum time to wait for processing in milliseconds (default: 5 minutes)
|
|
@@ -1699,20 +984,6 @@ export interface MaterialGenerateAndProcessParams {
|
|
|
1699
984
|
timeoutMs?: number;
|
|
1700
985
|
}
|
|
1701
986
|
|
|
1702
|
-
export namespace MaterialGenerateAndProcessParams {
|
|
1703
|
-
export interface Reference {
|
|
1704
|
-
/**
|
|
1705
|
-
* Reference title
|
|
1706
|
-
*/
|
|
1707
|
-
title: string;
|
|
1708
|
-
|
|
1709
|
-
/**
|
|
1710
|
-
* Reference URL
|
|
1711
|
-
*/
|
|
1712
|
-
url?: string;
|
|
1713
|
-
}
|
|
1714
|
-
}
|
|
1715
|
-
|
|
1716
987
|
export interface MaterialGetDownloadURLParams {
|
|
1717
988
|
/**
|
|
1718
989
|
* URL expiration time in seconds (default: 3600)
|
|
@@ -1761,21 +1032,19 @@ Materials.Bulk = Bulk;
|
|
|
1761
1032
|
|
|
1762
1033
|
export declare namespace Materials {
|
|
1763
1034
|
export {
|
|
1764
|
-
type
|
|
1765
|
-
type
|
|
1766
|
-
type
|
|
1035
|
+
type Content as Content,
|
|
1036
|
+
type GeneratedMaterialResponse as GeneratedMaterialResponse,
|
|
1037
|
+
type MaterialResponse as MaterialResponse,
|
|
1038
|
+
type Reference as Reference,
|
|
1767
1039
|
type MaterialListResponse as MaterialListResponse,
|
|
1768
|
-
type
|
|
1040
|
+
type MaterialCancelJobResponse as MaterialCancelJobResponse,
|
|
1769
1041
|
type MaterialCreateBatchUploadURLsResponse as MaterialCreateBatchUploadURLsResponse,
|
|
1770
|
-
type MaterialGenerateResponse as MaterialGenerateResponse,
|
|
1771
|
-
type MaterialGenerateAndProcessResponse as MaterialGenerateAndProcessResponse,
|
|
1772
1042
|
type MaterialGetDebugInfoResponse as MaterialGetDebugInfoResponse,
|
|
1773
1043
|
type MaterialGetDownloadURLResponse as MaterialGetDownloadURLResponse,
|
|
1774
|
-
type
|
|
1775
|
-
type MaterialRenameResponse as MaterialRenameResponse,
|
|
1776
|
-
type MaterialReprocessResponse as MaterialReprocessResponse,
|
|
1044
|
+
type MaterialGetJobStatusResponse as MaterialGetJobStatusResponse,
|
|
1777
1045
|
type MaterialSearchResponse as MaterialSearchResponse,
|
|
1778
1046
|
type MaterialCreateParams as MaterialCreateParams,
|
|
1047
|
+
type MaterialUpdateParams as MaterialUpdateParams,
|
|
1779
1048
|
type MaterialListParams as MaterialListParams,
|
|
1780
1049
|
type MaterialCreateAndProcessParams as MaterialCreateAndProcessParams,
|
|
1781
1050
|
type MaterialCreateBatchUploadURLsParams as MaterialCreateBatchUploadURLsParams,
|
|
@@ -1789,12 +1058,7 @@ export declare namespace Materials {
|
|
|
1789
1058
|
|
|
1790
1059
|
export {
|
|
1791
1060
|
Upload as Upload,
|
|
1792
|
-
type UploadCompleteUploadResponse as UploadCompleteUploadResponse,
|
|
1793
1061
|
type UploadGetPresignedURLResponse as UploadGetPresignedURLResponse,
|
|
1794
|
-
type UploadUploadFileResponse as UploadUploadFileResponse,
|
|
1795
|
-
type UploadUploadFileAndProcessResponse as UploadUploadFileAndProcessResponse,
|
|
1796
|
-
type UploadUploadFromURLResponse as UploadUploadFromURLResponse,
|
|
1797
|
-
type UploadUploadFromURLAndProcessResponse as UploadUploadFromURLAndProcessResponse,
|
|
1798
1062
|
type UploadCompleteUploadParams as UploadCompleteUploadParams,
|
|
1799
1063
|
type UploadGetPresignedURLParams as UploadGetPresignedURLParams,
|
|
1800
1064
|
type UploadUploadFileParams as UploadUploadFileParams,
|