@studyfetch/sdk 1.41.0 → 1.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +6 -6
  3. package/package.json +1 -1
  4. package/resources/v1/folders.d.mts +2 -77
  5. package/resources/v1/folders.d.mts.map +1 -1
  6. package/resources/v1/folders.d.ts +2 -77
  7. package/resources/v1/folders.d.ts.map +1 -1
  8. package/resources/v1/folders.js.map +1 -1
  9. package/resources/v1/folders.mjs.map +1 -1
  10. package/resources/v1/index.d.mts +1 -1
  11. package/resources/v1/index.d.mts.map +1 -1
  12. package/resources/v1/index.d.ts +1 -1
  13. package/resources/v1/index.d.ts.map +1 -1
  14. package/resources/v1/index.js.map +1 -1
  15. package/resources/v1/index.mjs.map +1 -1
  16. package/resources/v1/materials/index.d.mts +2 -2
  17. package/resources/v1/materials/index.d.mts.map +1 -1
  18. package/resources/v1/materials/index.d.ts +2 -2
  19. package/resources/v1/materials/index.d.ts.map +1 -1
  20. package/resources/v1/materials/index.js.map +1 -1
  21. package/resources/v1/materials/index.mjs.map +1 -1
  22. package/resources/v1/materials/materials.d.mts +179 -834
  23. package/resources/v1/materials/materials.d.mts.map +1 -1
  24. package/resources/v1/materials/materials.d.ts +179 -834
  25. package/resources/v1/materials/materials.d.ts.map +1 -1
  26. package/resources/v1/materials/materials.js +29 -22
  27. package/resources/v1/materials/materials.js.map +1 -1
  28. package/resources/v1/materials/materials.mjs +29 -22
  29. package/resources/v1/materials/materials.mjs.map +1 -1
  30. package/resources/v1/materials/upload.d.mts +14 -407
  31. package/resources/v1/materials/upload.d.mts.map +1 -1
  32. package/resources/v1/materials/upload.d.ts +14 -407
  33. package/resources/v1/materials/upload.d.ts.map +1 -1
  34. package/resources/v1/materials/upload.js +5 -5
  35. package/resources/v1/materials/upload.js.map +1 -1
  36. package/resources/v1/materials/upload.mjs +5 -5
  37. package/resources/v1/materials/upload.mjs.map +1 -1
  38. package/resources/v1/v1.d.mts +2 -2
  39. package/resources/v1/v1.d.mts.map +1 -1
  40. package/resources/v1/v1.d.ts +2 -2
  41. package/resources/v1/v1.d.ts.map +1 -1
  42. package/resources/v1/v1.js.map +1 -1
  43. package/resources/v1/v1.mjs.map +1 -1
  44. package/src/resources/v1/folders.ts +2 -98
  45. package/src/resources/v1/index.ts +5 -9
  46. package/src/resources/v1/materials/index.ts +5 -14
  47. package/src/resources/v1/materials/materials.ts +165 -1018
  48. package/src/resources/v1/materials/upload.ts +16 -520
  49. package/src/resources/v1/v1.ts +10 -18
  50. package/src/version.ts +1 -1
  51. package/version.d.mts +1 -1
  52. package/version.d.ts +1 -1
  53. package/version.js +1 -1
  54. package/version.mjs +1 -1
@@ -2,7 +2,7 @@ import { APIResource } from "../../../core/resource.mjs";
2
2
  import * as BulkAPI from "./bulk.mjs";
3
3
  import { Bulk, BulkMoveParams, BulkMoveResponse } from "./bulk.mjs";
4
4
  import * as UploadAPI from "./upload.mjs";
5
- import { Upload, UploadCompleteUploadParams, UploadCompleteUploadResponse, UploadGetPresignedURLParams, UploadGetPresignedURLResponse, UploadUploadFileAndProcessParams, UploadUploadFileAndProcessResponse, UploadUploadFileParams, UploadUploadFileResponse, UploadUploadFromURLAndProcessParams, UploadUploadFromURLAndProcessResponse, UploadUploadFromURLParams, UploadUploadFromURLResponse } from "./upload.mjs";
5
+ import { Upload, UploadCompleteUploadParams, UploadGetPresignedURLParams, UploadGetPresignedURLResponse, UploadUploadFileAndProcessParams, UploadUploadFileParams, UploadUploadFromURLAndProcessParams, UploadUploadFromURLParams } from "./upload.mjs";
6
6
  import { APIPromise } from "../../../core/api-promise.mjs";
7
7
  import { RequestOptions } from "../../../internal/request-options.mjs";
8
8
  export declare class Materials extends APIResource {
@@ -13,31 +13,35 @@ export declare class Materials extends APIResource {
13
13
  *
14
14
  * @example
15
15
  * ```ts
16
- * const material = await client.v1.materials.create({
16
+ * const materialResponse = await client.v1.materials.create({
17
17
  * content: { type: 'text' },
18
18
  * name: 'Chapter 1 - Introduction',
19
19
  * });
20
20
  * ```
21
21
  */
22
- create(body: MaterialCreateParams, options?: RequestOptions): APIPromise<MaterialCreateResponse>;
22
+ create(body: MaterialCreateParams, options?: RequestOptions): APIPromise<MaterialResponse>;
23
23
  /**
24
24
  * Get material by ID
25
25
  *
26
26
  * @example
27
27
  * ```ts
28
- * const material = await client.v1.materials.retrieve('id');
28
+ * const materialResponse = await client.v1.materials.retrieve(
29
+ * 'id',
30
+ * );
29
31
  * ```
30
32
  */
31
- retrieve(id: string, options?: RequestOptions): APIPromise<MaterialRetrieveResponse>;
33
+ retrieve(id: string, options?: RequestOptions): APIPromise<MaterialResponse>;
32
34
  /**
33
35
  * Update a material
34
36
  *
35
37
  * @example
36
38
  * ```ts
37
- * const material = await client.v1.materials.update('id');
39
+ * const materialResponse = await client.v1.materials.update(
40
+ * 'id',
41
+ * );
38
42
  * ```
39
43
  */
40
- update(id: string, options?: RequestOptions): APIPromise<MaterialUpdateResponse>;
44
+ update(id: string, body: MaterialUpdateParams, options?: RequestOptions): APIPromise<MaterialResponse>;
41
45
  /**
42
46
  * Get all materials for organization
43
47
  *
@@ -62,15 +66,14 @@ export declare class Materials extends APIResource {
62
66
  *
63
67
  * @example
64
68
  * ```ts
65
- * const response = await client.v1.materials.createAndProcess(
66
- * {
69
+ * const materialResponse =
70
+ * await client.v1.materials.createAndProcess({
67
71
  * content: { type: 'text' },
68
72
  * name: 'Chapter 1 - Introduction',
69
- * },
70
- * );
73
+ * });
71
74
  * ```
72
75
  */
73
- createAndProcess(body: MaterialCreateAndProcessParams, options?: RequestOptions): APIPromise<MaterialCreateAndProcessResponse>;
76
+ createAndProcess(body: MaterialCreateAndProcessParams, options?: RequestOptions): APIPromise<MaterialResponse>;
74
77
  /**
75
78
  * Create batch upload URLs for multiple materials
76
79
  *
@@ -95,699 +98,117 @@ export declare class Materials extends APIResource {
95
98
  *
96
99
  * @example
97
100
  * ```ts
98
- * const response = await client.v1.materials.generate({
99
- * name: 'Photosynthesis Study Plan',
100
- * topic: 'Photosynthesis in plants',
101
- * type: 'notes',
102
- * });
101
+ * const generatedMaterialResponse =
102
+ * await client.v1.materials.generate({
103
+ * name: 'Photosynthesis Study Plan',
104
+ * topic: 'Photosynthesis in plants',
105
+ * type: 'notes',
106
+ * });
103
107
  * ```
104
108
  */
105
- generate(body: MaterialGenerateParams, options?: RequestOptions): APIPromise<MaterialGenerateResponse>;
109
+ generate(body: MaterialGenerateParams, options?: RequestOptions): APIPromise<GeneratedMaterialResponse>;
106
110
  /**
107
111
  * Uses AI to generate study materials like outlines, notes, summaries, etc. from a
108
112
  * given topic and waits for processing to complete
109
113
  *
110
114
  * @example
111
115
  * ```ts
112
- * const response =
116
+ * const generatedMaterialResponse =
113
117
  * await client.v1.materials.generateAndProcess({
114
118
  * name: 'Photosynthesis Study Plan',
115
119
  * topic: 'Photosynthesis in plants',
116
- * type: 'notes',
117
- * });
118
- * ```
119
- */
120
- generateAndProcess(body: MaterialGenerateAndProcessParams, options?: RequestOptions): APIPromise<MaterialGenerateAndProcessResponse>;
121
- /**
122
- * Get debug information for a material including extracted content
123
- *
124
- * @example
125
- * ```ts
126
- * const response = await client.v1.materials.getDebugInfo(
127
- * 'id',
128
- * );
129
- * ```
130
- */
131
- getDebugInfo(id: string, options?: RequestOptions): APIPromise<MaterialGetDebugInfoResponse>;
132
- /**
133
- * Get temporary download URL for material
134
- *
135
- * @example
136
- * ```ts
137
- * const response = await client.v1.materials.getDownloadURL(
138
- * 'id',
139
- * );
140
- * ```
141
- */
142
- getDownloadURL(id: string, query?: MaterialGetDownloadURLParams | null | undefined, options?: RequestOptions): APIPromise<MaterialGetDownloadURLResponse>;
143
- /**
144
- * Move material to a different folder
145
- *
146
- * @example
147
- * ```ts
148
- * const response = await client.v1.materials.move('id', {
149
- * folderId: 'folderId',
150
- * });
151
- * ```
152
- */
153
- move(id: string, body: MaterialMoveParams, options?: RequestOptions): APIPromise<MaterialMoveResponse>;
154
- /**
155
- * Rename a material
156
- *
157
- * @example
158
- * ```ts
159
- * const response = await client.v1.materials.rename('id', {
160
- * name: 'New Material Name',
161
- * });
162
- * ```
163
- */
164
- rename(id: string, body: MaterialRenameParams, options?: RequestOptions): APIPromise<MaterialRenameResponse>;
165
- /**
166
- * Reprocess material to regenerate embeddings and extract content
167
- *
168
- * @example
169
- * ```ts
170
- * const response = await client.v1.materials.reprocess('id');
171
- * ```
172
- */
173
- reprocess(id: string, options?: RequestOptions): APIPromise<MaterialReprocessResponse>;
174
- /**
175
- * Search materials using RAG (Retrieval-Augmented Generation)
176
- *
177
- * @example
178
- * ```ts
179
- * const response = await client.v1.materials.search({
180
- * query: 'What is photosynthesis?',
181
- * });
182
- * ```
183
- */
184
- search(body: MaterialSearchParams, options?: RequestOptions): APIPromise<MaterialSearchResponse>;
185
- }
186
- export interface MaterialCreateResponse {
187
- /**
188
- * Material ID
189
- */
190
- _id: string;
191
- /**
192
- * Material content
193
- */
194
- content: MaterialCreateResponse.Content;
195
- /**
196
- * Content type
197
- */
198
- contentType: 'text' | 'pdf' | 'video' | 'audio' | 'image' | 'epub';
199
- /**
200
- * Creation timestamp
201
- */
202
- createdAt: string;
203
- /**
204
- * Folder ID
205
- */
206
- folderId: string | null;
207
- /**
208
- * Material name
209
- */
210
- name: string;
211
- /**
212
- * Organization ID
213
- */
214
- organizationId: string;
215
- /**
216
- * Material status
217
- */
218
- status: 'active' | 'processing' | 'pending_upload' | 'error' | 'deleted';
219
- /**
220
- * Last update timestamp
221
- */
222
- updatedAt: string;
223
- /**
224
- * Material metadata
225
- */
226
- metadata?: unknown;
227
- /**
228
- * References that this material cites
229
- */
230
- references?: Array<MaterialCreateResponse.Reference>;
231
- /**
232
- * Usage information
233
- */
234
- usage?: unknown;
235
- }
236
- export declare namespace MaterialCreateResponse {
237
- /**
238
- * Material content
239
- */
240
- interface Content {
241
- filename?: string;
242
- fileSize?: number;
243
- mimeType?: string;
244
- s3Key?: string;
245
- s3Url?: string;
246
- text?: string;
247
- url?: string;
248
- }
249
- interface Reference {
250
- /**
251
- * Reference title
252
- */
253
- title: string;
254
- /**
255
- * Reference URL
256
- */
257
- url?: string;
258
- }
259
- }
260
- export interface MaterialRetrieveResponse {
261
- /**
262
- * Material ID
263
- */
264
- _id: string;
265
- /**
266
- * Material content
267
- */
268
- content: MaterialRetrieveResponse.Content;
269
- /**
270
- * Content type
271
- */
272
- contentType: 'text' | 'pdf' | 'video' | 'audio' | 'image' | 'epub';
273
- /**
274
- * Creation timestamp
275
- */
276
- createdAt: string;
277
- /**
278
- * Folder ID
279
- */
280
- folderId: string | null;
281
- /**
282
- * Material name
283
- */
284
- name: string;
285
- /**
286
- * Organization ID
287
- */
288
- organizationId: string;
289
- /**
290
- * Material status
291
- */
292
- status: 'active' | 'processing' | 'pending_upload' | 'error' | 'deleted';
293
- /**
294
- * Last update timestamp
295
- */
296
- updatedAt: string;
297
- /**
298
- * Material metadata
299
- */
300
- metadata?: unknown;
301
- /**
302
- * References that this material cites
303
- */
304
- references?: Array<MaterialRetrieveResponse.Reference>;
305
- /**
306
- * Usage information
307
- */
308
- usage?: unknown;
309
- }
310
- export declare namespace MaterialRetrieveResponse {
311
- /**
312
- * Material content
313
- */
314
- interface Content {
315
- filename?: string;
316
- fileSize?: number;
317
- mimeType?: string;
318
- s3Key?: string;
319
- s3Url?: string;
320
- text?: string;
321
- url?: string;
322
- }
323
- interface Reference {
324
- /**
325
- * Reference title
326
- */
327
- title: string;
328
- /**
329
- * Reference URL
330
- */
331
- url?: string;
332
- }
333
- }
334
- export interface MaterialUpdateResponse {
335
- /**
336
- * Material ID
337
- */
338
- _id: string;
339
- /**
340
- * Material content
341
- */
342
- content: MaterialUpdateResponse.Content;
343
- /**
344
- * Content type
345
- */
346
- contentType: 'text' | 'pdf' | 'video' | 'audio' | 'image' | 'epub';
347
- /**
348
- * Creation timestamp
349
- */
350
- createdAt: string;
351
- /**
352
- * Folder ID
353
- */
354
- folderId: string | null;
355
- /**
356
- * Material name
357
- */
358
- name: string;
359
- /**
360
- * Organization ID
361
- */
362
- organizationId: string;
363
- /**
364
- * Material status
365
- */
366
- status: 'active' | 'processing' | 'pending_upload' | 'error' | 'deleted';
367
- /**
368
- * Last update timestamp
369
- */
370
- updatedAt: string;
371
- /**
372
- * Material metadata
373
- */
374
- metadata?: unknown;
375
- /**
376
- * References that this material cites
377
- */
378
- references?: Array<MaterialUpdateResponse.Reference>;
379
- /**
380
- * Usage information
381
- */
382
- usage?: unknown;
383
- }
384
- export declare namespace MaterialUpdateResponse {
385
- /**
386
- * Material content
387
- */
388
- interface Content {
389
- filename?: string;
390
- fileSize?: number;
391
- mimeType?: string;
392
- s3Key?: string;
393
- s3Url?: string;
394
- text?: string;
395
- url?: string;
396
- }
397
- interface Reference {
398
- /**
399
- * Reference title
400
- */
401
- title: string;
402
- /**
403
- * Reference URL
404
- */
405
- url?: string;
406
- }
407
- }
408
- export interface MaterialListResponse {
409
- materials?: Array<MaterialListResponse.Material>;
410
- page?: number;
411
- totalCount?: number;
412
- totalPages?: number;
413
- }
414
- export declare namespace MaterialListResponse {
415
- interface Material {
416
- /**
417
- * Material ID
418
- */
419
- _id: string;
420
- /**
421
- * Material content
422
- */
423
- content: Material.Content;
424
- /**
425
- * Content type
426
- */
427
- contentType: 'text' | 'pdf' | 'video' | 'audio' | 'image' | 'epub';
428
- /**
429
- * Creation timestamp
430
- */
431
- createdAt: string;
432
- /**
433
- * Folder ID
434
- */
435
- folderId: string | null;
436
- /**
437
- * Material name
438
- */
439
- name: string;
440
- /**
441
- * Organization ID
442
- */
443
- organizationId: string;
444
- /**
445
- * Material status
446
- */
447
- status: 'active' | 'processing' | 'pending_upload' | 'error' | 'deleted';
448
- /**
449
- * Last update timestamp
450
- */
451
- updatedAt: string;
452
- /**
453
- * Material metadata
454
- */
455
- metadata?: unknown;
456
- /**
457
- * References that this material cites
458
- */
459
- references?: Array<Material.Reference>;
460
- /**
461
- * Usage information
462
- */
463
- usage?: unknown;
464
- }
465
- namespace Material {
466
- /**
467
- * Material content
468
- */
469
- interface Content {
470
- filename?: string;
471
- fileSize?: number;
472
- mimeType?: string;
473
- s3Key?: string;
474
- s3Url?: string;
475
- text?: string;
476
- url?: string;
477
- }
478
- interface Reference {
479
- /**
480
- * Reference title
481
- */
482
- title: string;
483
- /**
484
- * Reference URL
485
- */
486
- url?: string;
487
- }
488
- }
489
- }
490
- export interface MaterialCreateAndProcessResponse {
491
- /**
492
- * Material ID
493
- */
494
- _id: string;
495
- /**
496
- * Material content
497
- */
498
- content: MaterialCreateAndProcessResponse.Content;
499
- /**
500
- * Content type
501
- */
502
- contentType: 'text' | 'pdf' | 'video' | 'audio' | 'image' | 'epub';
503
- /**
504
- * Creation timestamp
505
- */
506
- createdAt: string;
507
- /**
508
- * Folder ID
509
- */
510
- folderId: string | null;
511
- /**
512
- * Material name
513
- */
514
- name: string;
515
- /**
516
- * Organization ID
517
- */
518
- organizationId: string;
519
- /**
520
- * Material status
521
- */
522
- status: 'active' | 'processing' | 'pending_upload' | 'error' | 'deleted';
523
- /**
524
- * Last update timestamp
525
- */
526
- updatedAt: string;
527
- /**
528
- * Material metadata
529
- */
530
- metadata?: unknown;
531
- /**
532
- * References that this material cites
533
- */
534
- references?: Array<MaterialCreateAndProcessResponse.Reference>;
535
- /**
536
- * Usage information
537
- */
538
- usage?: unknown;
539
- }
540
- export declare namespace MaterialCreateAndProcessResponse {
541
- /**
542
- * Material content
543
- */
544
- interface Content {
545
- filename?: string;
546
- fileSize?: number;
547
- mimeType?: string;
548
- s3Key?: string;
549
- s3Url?: string;
550
- text?: string;
551
- url?: string;
552
- }
553
- interface Reference {
554
- /**
555
- * Reference title
556
- */
557
- title: string;
558
- /**
559
- * Reference URL
560
- */
561
- url?: string;
562
- }
563
- }
564
- export type MaterialCreateBatchUploadURLsResponse = Array<MaterialCreateBatchUploadURLsResponse.MaterialCreateBatchUploadURLsResponseItem>;
565
- export declare namespace MaterialCreateBatchUploadURLsResponse {
566
- interface MaterialCreateBatchUploadURLsResponseItem {
567
- /**
568
- * Material ID
569
- */
570
- materialId: string;
571
- /**
572
- * Material name
573
- */
574
- name: string;
575
- /**
576
- * S3 key
577
- */
578
- s3Key: string;
579
- /**
580
- * Presigned upload URL
581
- */
582
- uploadUrl: string;
583
- }
584
- }
585
- export interface MaterialGenerateResponse {
586
- /**
587
- * Material ID
588
- */
589
- _id: string;
590
- /**
591
- * Material content
592
- */
593
- content: MaterialGenerateResponse.Content;
594
- /**
595
- * Content type
596
- */
597
- contentType: 'text' | 'pdf' | 'video' | 'audio' | 'image' | 'epub';
598
- /**
599
- * Creation timestamp
600
- */
601
- createdAt: string;
602
- /**
603
- * Folder ID
604
- */
605
- folderId: string | null;
606
- /**
607
- * Material name
608
- */
609
- name: string;
610
- /**
611
- * Organization ID
612
- */
613
- organizationId: string;
614
- /**
615
- * Material status
616
- */
617
- status: 'active' | 'processing' | 'pending_upload' | 'error' | 'deleted';
618
- /**
619
- * Last update timestamp
620
- */
621
- updatedAt: string;
622
- /**
623
- * Generation metadata
624
- */
625
- generationMetadata?: unknown;
626
- /**
627
- * Material metadata
628
- */
629
- metadata?: unknown;
630
- /**
631
- * References that this material cites
632
- */
633
- references?: Array<MaterialGenerateResponse.Reference>;
634
- /**
635
- * Usage information
636
- */
637
- usage?: unknown;
638
- }
639
- export declare namespace MaterialGenerateResponse {
640
- /**
641
- * Material content
642
- */
643
- interface Content {
644
- filename?: string;
645
- fileSize?: number;
646
- mimeType?: string;
647
- s3Key?: string;
648
- s3Url?: string;
649
- text?: string;
650
- url?: string;
651
- }
652
- interface Reference {
653
- /**
654
- * Reference title
655
- */
656
- title: string;
657
- /**
658
- * Reference URL
659
- */
660
- url?: string;
661
- }
662
- }
663
- export interface MaterialGenerateAndProcessResponse {
664
- /**
665
- * Material ID
666
- */
667
- _id: string;
668
- /**
669
- * Material content
670
- */
671
- content: MaterialGenerateAndProcessResponse.Content;
672
- /**
673
- * Content type
674
- */
675
- contentType: 'text' | 'pdf' | 'video' | 'audio' | 'image' | 'epub';
676
- /**
677
- * Creation timestamp
678
- */
679
- createdAt: string;
680
- /**
681
- * Folder ID
682
- */
683
- folderId: string | null;
684
- /**
685
- * Material name
686
- */
687
- name: string;
688
- /**
689
- * Organization ID
690
- */
691
- organizationId: string;
692
- /**
693
- * Material status
694
- */
695
- status: 'active' | 'processing' | 'pending_upload' | 'error' | 'deleted';
696
- /**
697
- * Last update timestamp
698
- */
699
- updatedAt: string;
700
- /**
701
- * Generation metadata
702
- */
703
- generationMetadata?: unknown;
704
- /**
705
- * Material metadata
706
- */
707
- metadata?: unknown;
708
- /**
709
- * References that this material cites
710
- */
711
- references?: Array<MaterialGenerateAndProcessResponse.Reference>;
712
- /**
713
- * Usage information
714
- */
715
- usage?: unknown;
716
- }
717
- export declare namespace MaterialGenerateAndProcessResponse {
718
- /**
719
- * Material content
720
- */
721
- interface Content {
722
- filename?: string;
723
- fileSize?: number;
724
- mimeType?: string;
725
- s3Key?: string;
726
- s3Url?: string;
727
- text?: string;
728
- url?: string;
729
- }
730
- interface Reference {
731
- /**
732
- * Reference title
733
- */
734
- title: string;
735
- /**
736
- * Reference URL
737
- */
738
- url?: string;
739
- }
740
- }
741
- export interface MaterialGetDebugInfoResponse {
120
+ * type: 'notes',
121
+ * });
122
+ * ```
123
+ */
124
+ generateAndProcess(body: MaterialGenerateAndProcessParams, options?: RequestOptions): APIPromise<GeneratedMaterialResponse>;
742
125
  /**
743
- * Content details
126
+ * Get debug information for a material including extracted content
127
+ *
128
+ * @example
129
+ * ```ts
130
+ * const response = await client.v1.materials.getDebugInfo(
131
+ * 'id',
132
+ * );
133
+ * ```
744
134
  */
745
- content: unknown;
135
+ getDebugInfo(id: string, options?: RequestOptions): APIPromise<MaterialGetDebugInfoResponse>;
746
136
  /**
747
- * Content type
137
+ * Get temporary download URL for material
138
+ *
139
+ * @example
140
+ * ```ts
141
+ * const response = await client.v1.materials.getDownloadURL(
142
+ * 'id',
143
+ * );
144
+ * ```
748
145
  */
749
- contentType: string;
146
+ getDownloadURL(id: string, query?: MaterialGetDownloadURLParams | null | undefined, options?: RequestOptions): APIPromise<MaterialGetDownloadURLResponse>;
750
147
  /**
751
- * Processed images
148
+ * Move material to a different folder
149
+ *
150
+ * @example
151
+ * ```ts
152
+ * const materialResponse = await client.v1.materials.move(
153
+ * 'id',
154
+ * { folderId: 'folderId' },
155
+ * );
156
+ * ```
752
157
  */
753
- images: Array<MaterialGetDebugInfoResponse.Image>;
158
+ move(id: string, body: MaterialMoveParams, options?: RequestOptions): APIPromise<MaterialResponse>;
754
159
  /**
755
- * Material ID
160
+ * Rename a material
161
+ *
162
+ * @example
163
+ * ```ts
164
+ * const materialResponse = await client.v1.materials.rename(
165
+ * 'id',
166
+ * { name: 'New Material Name' },
167
+ * );
168
+ * ```
756
169
  */
757
- materialId: string;
170
+ rename(id: string, body: MaterialRenameParams, options?: RequestOptions): APIPromise<MaterialResponse>;
758
171
  /**
759
- * Material metadata
172
+ * Reprocess material to regenerate embeddings and extract content
173
+ *
174
+ * @example
175
+ * ```ts
176
+ * const materialResponse =
177
+ * await client.v1.materials.reprocess('id');
178
+ * ```
760
179
  */
761
- metadata: unknown;
180
+ reprocess(id: string, options?: RequestOptions): APIPromise<MaterialResponse>;
762
181
  /**
763
- * Material name
182
+ * Search materials using RAG (Retrieval-Augmented Generation)
183
+ *
184
+ * @example
185
+ * ```ts
186
+ * const response = await client.v1.materials.search({
187
+ * query: 'What is photosynthesis?',
188
+ * });
189
+ * ```
764
190
  */
765
- name: string;
191
+ search(body: MaterialSearchParams, options?: RequestOptions): APIPromise<MaterialSearchResponse>;
192
+ }
193
+ export interface Content {
766
194
  /**
767
- * Processing status
195
+ * Type of content
768
196
  */
769
- status: string;
197
+ type: 'text' | 'pdf' | 'video' | 'audio' | 'url';
770
198
  /**
771
- * Transcript structure for videos
199
+ * URL to fetch content from
772
200
  */
773
- transcriptStructure: unknown | null;
774
- }
775
- export declare namespace MaterialGetDebugInfoResponse {
776
- interface Image {
777
- id?: string;
778
- description?: string;
779
- pageIndex?: number;
780
- s3Key?: string;
781
- s3Url?: string;
782
- }
783
- }
784
- export interface MaterialGetDownloadURLResponse {
201
+ sourceUrl?: string;
785
202
  /**
786
- * Temporary download URL
203
+ * Text content (for text type)
787
204
  */
788
- downloadUrl: string;
205
+ text?: string;
206
+ /**
207
+ * URL to the content (for url type)
208
+ */
209
+ url?: string;
789
210
  }
790
- export interface MaterialMoveResponse {
211
+ export interface GeneratedMaterialResponse {
791
212
  /**
792
213
  * Material ID
793
214
  */
@@ -795,7 +216,7 @@ export interface MaterialMoveResponse {
795
216
  /**
796
217
  * Material content
797
218
  */
798
- content: MaterialMoveResponse.Content;
219
+ content: GeneratedMaterialResponse.Content;
799
220
  /**
800
221
  * Content type
801
222
  */
@@ -824,6 +245,10 @@ export interface MaterialMoveResponse {
824
245
  * Last update timestamp
825
246
  */
826
247
  updatedAt: string;
248
+ /**
249
+ * Generation metadata
250
+ */
251
+ generationMetadata?: unknown;
827
252
  /**
828
253
  * Material metadata
829
254
  */
@@ -831,13 +256,13 @@ export interface MaterialMoveResponse {
831
256
  /**
832
257
  * References that this material cites
833
258
  */
834
- references?: Array<MaterialMoveResponse.Reference>;
259
+ references?: Array<Reference>;
835
260
  /**
836
261
  * Usage information
837
262
  */
838
263
  usage?: unknown;
839
264
  }
840
- export declare namespace MaterialMoveResponse {
265
+ export declare namespace GeneratedMaterialResponse {
841
266
  /**
842
267
  * Material content
843
268
  */
@@ -850,18 +275,8 @@ export declare namespace MaterialMoveResponse {
850
275
  text?: string;
851
276
  url?: string;
852
277
  }
853
- interface Reference {
854
- /**
855
- * Reference title
856
- */
857
- title: string;
858
- /**
859
- * Reference URL
860
- */
861
- url?: string;
862
- }
863
278
  }
864
- export interface MaterialRenameResponse {
279
+ export interface MaterialResponse {
865
280
  /**
866
281
  * Material ID
867
282
  */
@@ -869,7 +284,7 @@ export interface MaterialRenameResponse {
869
284
  /**
870
285
  * Material content
871
286
  */
872
- content: MaterialRenameResponse.Content;
287
+ content: MaterialResponse.Content;
873
288
  /**
874
289
  * Content type
875
290
  */
@@ -905,13 +320,13 @@ export interface MaterialRenameResponse {
905
320
  /**
906
321
  * References that this material cites
907
322
  */
908
- references?: Array<MaterialRenameResponse.Reference>;
323
+ references?: Array<Reference>;
909
324
  /**
910
325
  * Usage information
911
326
  */
912
327
  usage?: unknown;
913
328
  }
914
- export declare namespace MaterialRenameResponse {
329
+ export declare namespace MaterialResponse {
915
330
  /**
916
331
  * Material content
917
332
  */
@@ -924,91 +339,93 @@ export declare namespace MaterialRenameResponse {
924
339
  text?: string;
925
340
  url?: string;
926
341
  }
927
- interface Reference {
342
+ }
343
+ export interface Reference {
344
+ /**
345
+ * Reference title
346
+ */
347
+ title: string;
348
+ /**
349
+ * Reference URL
350
+ */
351
+ url?: string;
352
+ }
353
+ export interface MaterialListResponse {
354
+ materials?: Array<MaterialResponse>;
355
+ page?: number;
356
+ totalCount?: number;
357
+ totalPages?: number;
358
+ }
359
+ export type MaterialCreateBatchUploadURLsResponse = Array<MaterialCreateBatchUploadURLsResponse.MaterialCreateBatchUploadURLsResponseItem>;
360
+ export declare namespace MaterialCreateBatchUploadURLsResponse {
361
+ interface MaterialCreateBatchUploadURLsResponseItem {
928
362
  /**
929
- * Reference title
363
+ * Material ID
930
364
  */
931
- title: string;
365
+ materialId: string;
932
366
  /**
933
- * Reference URL
367
+ * Material name
934
368
  */
935
- url?: string;
369
+ name: string;
370
+ /**
371
+ * S3 key
372
+ */
373
+ s3Key: string;
374
+ /**
375
+ * Presigned upload URL
376
+ */
377
+ uploadUrl: string;
936
378
  }
937
379
  }
938
- export interface MaterialReprocessResponse {
380
+ export interface MaterialGetDebugInfoResponse {
939
381
  /**
940
- * Material ID
382
+ * Content details
941
383
  */
942
- _id: string;
384
+ content: unknown;
943
385
  /**
944
- * Material content
386
+ * Content type
945
387
  */
946
- content: MaterialReprocessResponse.Content;
388
+ contentType: string;
947
389
  /**
948
- * Content type
390
+ * Processed images
949
391
  */
950
- contentType: 'text' | 'pdf' | 'video' | 'audio' | 'image' | 'epub';
392
+ images: Array<MaterialGetDebugInfoResponse.Image>;
951
393
  /**
952
- * Creation timestamp
394
+ * Material ID
953
395
  */
954
- createdAt: string;
396
+ materialId: string;
955
397
  /**
956
- * Folder ID
398
+ * Material metadata
957
399
  */
958
- folderId: string | null;
400
+ metadata: unknown;
959
401
  /**
960
402
  * Material name
961
403
  */
962
404
  name: string;
963
405
  /**
964
- * Organization ID
965
- */
966
- organizationId: string;
967
- /**
968
- * Material status
969
- */
970
- status: 'active' | 'processing' | 'pending_upload' | 'error' | 'deleted';
971
- /**
972
- * Last update timestamp
973
- */
974
- updatedAt: string;
975
- /**
976
- * Material metadata
977
- */
978
- metadata?: unknown;
979
- /**
980
- * References that this material cites
406
+ * Processing status
981
407
  */
982
- references?: Array<MaterialReprocessResponse.Reference>;
408
+ status: string;
983
409
  /**
984
- * Usage information
410
+ * Transcript structure for videos
985
411
  */
986
- usage?: unknown;
412
+ transcriptStructure: unknown | null;
987
413
  }
988
- export declare namespace MaterialReprocessResponse {
989
- /**
990
- * Material content
991
- */
992
- interface Content {
993
- filename?: string;
994
- fileSize?: number;
995
- mimeType?: string;
414
+ export declare namespace MaterialGetDebugInfoResponse {
415
+ interface Image {
416
+ id?: string;
417
+ description?: string;
418
+ pageIndex?: number;
996
419
  s3Key?: string;
997
420
  s3Url?: string;
998
- text?: string;
999
- url?: string;
1000
- }
1001
- interface Reference {
1002
- /**
1003
- * Reference title
1004
- */
1005
- title: string;
1006
- /**
1007
- * Reference URL
1008
- */
1009
- url?: string;
1010
421
  }
1011
422
  }
423
+ export interface MaterialGetDownloadURLResponse {
424
+ /**
425
+ * Temporary download URL
426
+ */
427
+ downloadUrl: string;
428
+ }
1012
429
  export interface MaterialSearchResponse {
1013
430
  /**
1014
431
  * Whether results were filtered by scope
@@ -1072,7 +489,7 @@ export interface MaterialCreateParams {
1072
489
  /**
1073
490
  * Content details
1074
491
  */
1075
- content: MaterialCreateParams.Content;
492
+ content: Content;
1076
493
  /**
1077
494
  * Name of the material
1078
495
  */
@@ -1084,37 +501,22 @@ export interface MaterialCreateParams {
1084
501
  /**
1085
502
  * References that this material cites
1086
503
  */
1087
- references?: Array<MaterialCreateParams.Reference>;
504
+ references?: Array<Reference>;
1088
505
  }
1089
- export declare namespace MaterialCreateParams {
506
+ export interface MaterialUpdateParams {
1090
507
  /**
1091
- * Content details
508
+ * Array of references to update (optional)
1092
509
  */
1093
- interface Content {
1094
- /**
1095
- * Type of content
1096
- */
1097
- type: 'text' | 'pdf' | 'video' | 'audio' | 'url';
1098
- /**
1099
- * URL to fetch content from
1100
- */
1101
- sourceUrl?: string;
1102
- /**
1103
- * Text content (for text type)
1104
- */
1105
- text?: string;
1106
- /**
1107
- * URL to the content (for url type)
1108
- */
1109
- url?: string;
1110
- }
510
+ references?: Array<MaterialUpdateParams.Reference>;
511
+ }
512
+ export declare namespace MaterialUpdateParams {
1111
513
  interface Reference {
1112
514
  /**
1113
515
  * Reference title
1114
516
  */
1115
517
  title: string;
1116
518
  /**
1117
- * Reference URL
519
+ * Reference URL (optional)
1118
520
  */
1119
521
  url?: string;
1120
522
  }
@@ -1141,7 +543,7 @@ export interface MaterialCreateAndProcessParams {
1141
543
  /**
1142
544
  * Content details
1143
545
  */
1144
- content: MaterialCreateAndProcessParams.Content;
546
+ content: Content;
1145
547
  /**
1146
548
  * Name of the material
1147
549
  */
@@ -1157,45 +559,12 @@ export interface MaterialCreateAndProcessParams {
1157
559
  /**
1158
560
  * References that this material cites
1159
561
  */
1160
- references?: Array<MaterialCreateAndProcessParams.Reference>;
562
+ references?: Array<Reference>;
1161
563
  /**
1162
564
  * Maximum time to wait for processing in milliseconds (default: 5 minutes)
1163
565
  */
1164
566
  timeoutMs?: number;
1165
567
  }
1166
- export declare namespace MaterialCreateAndProcessParams {
1167
- /**
1168
- * Content details
1169
- */
1170
- interface Content {
1171
- /**
1172
- * Type of content
1173
- */
1174
- type: 'text' | 'pdf' | 'video' | 'audio' | 'url';
1175
- /**
1176
- * URL to fetch content from
1177
- */
1178
- sourceUrl?: string;
1179
- /**
1180
- * Text content (for text type)
1181
- */
1182
- text?: string;
1183
- /**
1184
- * URL to the content (for url type)
1185
- */
1186
- url?: string;
1187
- }
1188
- interface Reference {
1189
- /**
1190
- * Reference title
1191
- */
1192
- title: string;
1193
- /**
1194
- * Reference URL
1195
- */
1196
- url?: string;
1197
- }
1198
- }
1199
568
  export interface MaterialCreateBatchUploadURLsParams {
1200
569
  /**
1201
570
  * Array of materials to create
@@ -1254,19 +623,7 @@ export interface MaterialGenerateParams {
1254
623
  /**
1255
624
  * References that this material cites
1256
625
  */
1257
- references?: Array<MaterialGenerateParams.Reference>;
1258
- }
1259
- export declare namespace MaterialGenerateParams {
1260
- interface Reference {
1261
- /**
1262
- * Reference title
1263
- */
1264
- title: string;
1265
- /**
1266
- * Reference URL
1267
- */
1268
- url?: string;
1269
- }
626
+ references?: Array<Reference>;
1270
627
  }
1271
628
  export interface MaterialGenerateAndProcessParams {
1272
629
  /**
@@ -1304,24 +661,12 @@ export interface MaterialGenerateAndProcessParams {
1304
661
  /**
1305
662
  * References that this material cites
1306
663
  */
1307
- references?: Array<MaterialGenerateAndProcessParams.Reference>;
664
+ references?: Array<Reference>;
1308
665
  /**
1309
666
  * Maximum time to wait for processing in milliseconds (default: 5 minutes)
1310
667
  */
1311
668
  timeoutMs?: number;
1312
669
  }
1313
- export declare namespace MaterialGenerateAndProcessParams {
1314
- interface Reference {
1315
- /**
1316
- * Reference title
1317
- */
1318
- title: string;
1319
- /**
1320
- * Reference URL
1321
- */
1322
- url?: string;
1323
- }
1324
- }
1325
670
  export interface MaterialGetDownloadURLParams {
1326
671
  /**
1327
672
  * URL expiration time in seconds (default: 3600)
@@ -1359,8 +704,8 @@ export interface MaterialSearchParams {
1359
704
  topK?: number;
1360
705
  }
1361
706
  export declare namespace Materials {
1362
- export { type MaterialCreateResponse as MaterialCreateResponse, type MaterialRetrieveResponse as MaterialRetrieveResponse, type MaterialUpdateResponse as MaterialUpdateResponse, type MaterialListResponse as MaterialListResponse, type MaterialCreateAndProcessResponse as MaterialCreateAndProcessResponse, type MaterialCreateBatchUploadURLsResponse as MaterialCreateBatchUploadURLsResponse, type MaterialGenerateResponse as MaterialGenerateResponse, type MaterialGenerateAndProcessResponse as MaterialGenerateAndProcessResponse, type MaterialGetDebugInfoResponse as MaterialGetDebugInfoResponse, type MaterialGetDownloadURLResponse as MaterialGetDownloadURLResponse, type MaterialMoveResponse as MaterialMoveResponse, type MaterialRenameResponse as MaterialRenameResponse, type MaterialReprocessResponse as MaterialReprocessResponse, type MaterialSearchResponse as MaterialSearchResponse, type MaterialCreateParams as MaterialCreateParams, type MaterialListParams as MaterialListParams, type MaterialCreateAndProcessParams as MaterialCreateAndProcessParams, type MaterialCreateBatchUploadURLsParams as MaterialCreateBatchUploadURLsParams, type MaterialGenerateParams as MaterialGenerateParams, type MaterialGenerateAndProcessParams as MaterialGenerateAndProcessParams, type MaterialGetDownloadURLParams as MaterialGetDownloadURLParams, type MaterialMoveParams as MaterialMoveParams, type MaterialRenameParams as MaterialRenameParams, type MaterialSearchParams as MaterialSearchParams, };
1363
- export { Upload as Upload, type UploadCompleteUploadResponse as UploadCompleteUploadResponse, type UploadGetPresignedURLResponse as UploadGetPresignedURLResponse, type UploadUploadFileResponse as UploadUploadFileResponse, type UploadUploadFileAndProcessResponse as UploadUploadFileAndProcessResponse, type UploadUploadFromURLResponse as UploadUploadFromURLResponse, type UploadUploadFromURLAndProcessResponse as UploadUploadFromURLAndProcessResponse, type UploadCompleteUploadParams as UploadCompleteUploadParams, type UploadGetPresignedURLParams as UploadGetPresignedURLParams, type UploadUploadFileParams as UploadUploadFileParams, type UploadUploadFileAndProcessParams as UploadUploadFileAndProcessParams, type UploadUploadFromURLParams as UploadUploadFromURLParams, type UploadUploadFromURLAndProcessParams as UploadUploadFromURLAndProcessParams, };
707
+ export { type Content as Content, type GeneratedMaterialResponse as GeneratedMaterialResponse, type MaterialResponse as MaterialResponse, type Reference as Reference, type MaterialListResponse as MaterialListResponse, type MaterialCreateBatchUploadURLsResponse as MaterialCreateBatchUploadURLsResponse, type MaterialGetDebugInfoResponse as MaterialGetDebugInfoResponse, type MaterialGetDownloadURLResponse as MaterialGetDownloadURLResponse, type MaterialSearchResponse as MaterialSearchResponse, type MaterialCreateParams as MaterialCreateParams, type MaterialUpdateParams as MaterialUpdateParams, type MaterialListParams as MaterialListParams, type MaterialCreateAndProcessParams as MaterialCreateAndProcessParams, type MaterialCreateBatchUploadURLsParams as MaterialCreateBatchUploadURLsParams, type MaterialGenerateParams as MaterialGenerateParams, type MaterialGenerateAndProcessParams as MaterialGenerateAndProcessParams, type MaterialGetDownloadURLParams as MaterialGetDownloadURLParams, type MaterialMoveParams as MaterialMoveParams, type MaterialRenameParams as MaterialRenameParams, type MaterialSearchParams as MaterialSearchParams, };
708
+ export { Upload as Upload, type UploadGetPresignedURLResponse as UploadGetPresignedURLResponse, type UploadCompleteUploadParams as UploadCompleteUploadParams, type UploadGetPresignedURLParams as UploadGetPresignedURLParams, type UploadUploadFileParams as UploadUploadFileParams, type UploadUploadFileAndProcessParams as UploadUploadFileAndProcessParams, type UploadUploadFromURLParams as UploadUploadFromURLParams, type UploadUploadFromURLAndProcessParams as UploadUploadFromURLAndProcessParams, };
1364
709
  export { Bulk as Bulk, type BulkMoveResponse as BulkMoveResponse, type BulkMoveParams as BulkMoveParams };
1365
710
  }
1366
711
  //# sourceMappingURL=materials.d.mts.map