@studyfetch/sdk 1.27.0 → 1.29.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 (53) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/package.json +1 -1
  3. package/resources/v1/chat.d.mts +97 -0
  4. package/resources/v1/chat.d.mts.map +1 -0
  5. package/resources/v1/chat.d.ts +97 -0
  6. package/resources/v1/chat.d.ts.map +1 -0
  7. package/resources/v1/chat.js +31 -0
  8. package/resources/v1/chat.js.map +1 -0
  9. package/resources/v1/chat.mjs +27 -0
  10. package/resources/v1/chat.mjs.map +1 -0
  11. package/resources/v1/index.d.mts +2 -1
  12. package/resources/v1/index.d.mts.map +1 -1
  13. package/resources/v1/index.d.ts +2 -1
  14. package/resources/v1/index.d.ts.map +1 -1
  15. package/resources/v1/index.js +3 -1
  16. package/resources/v1/index.js.map +1 -1
  17. package/resources/v1/index.mjs +1 -0
  18. package/resources/v1/index.mjs.map +1 -1
  19. package/resources/v1/materials/index.d.mts +1 -1
  20. package/resources/v1/materials/index.d.mts.map +1 -1
  21. package/resources/v1/materials/index.d.ts +1 -1
  22. package/resources/v1/materials/index.d.ts.map +1 -1
  23. package/resources/v1/materials/index.js.map +1 -1
  24. package/resources/v1/materials/index.mjs.map +1 -1
  25. package/resources/v1/materials/materials.d.mts +118 -1
  26. package/resources/v1/materials/materials.d.mts.map +1 -1
  27. package/resources/v1/materials/materials.d.ts +118 -1
  28. package/resources/v1/materials/materials.d.ts.map +1 -1
  29. package/resources/v1/materials/materials.js +17 -0
  30. package/resources/v1/materials/materials.js.map +1 -1
  31. package/resources/v1/materials/materials.mjs +17 -0
  32. package/resources/v1/materials/materials.mjs.map +1 -1
  33. package/resources/v1/materials/upload.d.mts +1 -1
  34. package/resources/v1/materials/upload.d.ts +1 -1
  35. package/resources/v1/v1.d.mts +6 -2
  36. package/resources/v1/v1.d.mts.map +1 -1
  37. package/resources/v1/v1.d.ts +6 -2
  38. package/resources/v1/v1.d.ts.map +1 -1
  39. package/resources/v1/v1.js +4 -0
  40. package/resources/v1/v1.js.map +1 -1
  41. package/resources/v1/v1.mjs +4 -0
  42. package/resources/v1/v1.mjs.map +1 -1
  43. package/src/resources/v1/chat.ts +128 -0
  44. package/src/resources/v1/index.ts +3 -0
  45. package/src/resources/v1/materials/index.ts +2 -0
  46. package/src/resources/v1/materials/materials.ts +153 -0
  47. package/src/resources/v1/materials/upload.ts +1 -1
  48. package/src/resources/v1/v1.ts +10 -0
  49. package/src/version.ts +1 -1
  50. package/version.d.mts +1 -1
  51. package/version.d.ts +1 -1
  52. package/version.js +1 -1
  53. package/version.mjs +1 -1
@@ -143,6 +143,27 @@ export class Materials extends APIResource {
143
143
  return this._client.get(path`/api/v1/materials/${id}/debug`, options);
144
144
  }
145
145
 
146
+ /**
147
+ * Uses AI to generate study materials like outlines, notes, summaries, etc. from a
148
+ * given topic and waits for processing to complete
149
+ *
150
+ * @example
151
+ * ```ts
152
+ * const response =
153
+ * await client.v1.materials.generateAndProcess({
154
+ * name: 'Photosynthesis Study Plan',
155
+ * topic: 'Photosynthesis in plants',
156
+ * type: 'notes',
157
+ * });
158
+ * ```
159
+ */
160
+ generateAndProcess(
161
+ body: MaterialGenerateAndProcessParams,
162
+ options?: RequestOptions,
163
+ ): APIPromise<MaterialGenerateAndProcessResponse> {
164
+ return this._client.post('/api/v1/materials/generate-and-process', { body, ...options });
165
+ }
166
+
146
167
  /**
147
168
  * Get temporary download URL for material
148
169
  *
@@ -400,6 +421,89 @@ export namespace MaterialDebugResponse {
400
421
  }
401
422
  }
402
423
 
424
+ export interface MaterialGenerateAndProcessResponse {
425
+ /**
426
+ * Material ID
427
+ */
428
+ _id: string;
429
+
430
+ /**
431
+ * Material content
432
+ */
433
+ content: MaterialGenerateAndProcessResponse.Content;
434
+
435
+ /**
436
+ * Content type
437
+ */
438
+ contentType: 'text' | 'pdf' | 'video' | 'audio' | 'image' | 'epub';
439
+
440
+ /**
441
+ * Creation timestamp
442
+ */
443
+ createdAt: string;
444
+
445
+ /**
446
+ * Folder ID
447
+ */
448
+ folderId: string | null;
449
+
450
+ /**
451
+ * Material name
452
+ */
453
+ name: string;
454
+
455
+ /**
456
+ * Organization ID
457
+ */
458
+ organizationId: string;
459
+
460
+ /**
461
+ * Material status
462
+ */
463
+ status: 'active' | 'processing' | 'pending_upload' | 'error' | 'deleted';
464
+
465
+ /**
466
+ * Last update timestamp
467
+ */
468
+ updatedAt: string;
469
+
470
+ /**
471
+ * Generation metadata
472
+ */
473
+ generationMetadata?: unknown;
474
+
475
+ /**
476
+ * Material metadata
477
+ */
478
+ metadata?: unknown;
479
+
480
+ /**
481
+ * Usage information
482
+ */
483
+ usage?: unknown;
484
+ }
485
+
486
+ export namespace MaterialGenerateAndProcessResponse {
487
+ /**
488
+ * Material content
489
+ */
490
+ export interface Content {
491
+ filename?: string;
492
+
493
+ fileSize?: number;
494
+
495
+ mimeType?: string;
496
+
497
+ s3Key?: string;
498
+
499
+ s3Url?: string;
500
+
501
+ text?: string;
502
+
503
+ url?: string;
504
+ }
505
+ }
506
+
403
507
  export interface MaterialGetDownloadURLResponse {
404
508
  /**
405
509
  * Temporary download URL
@@ -562,6 +666,53 @@ export interface MaterialCreateAndProcessParams {
562
666
  timeoutMs?: number;
563
667
  }
564
668
 
669
+ export interface MaterialGenerateAndProcessParams {
670
+ /**
671
+ * Name for the generated material
672
+ */
673
+ name: string;
674
+
675
+ /**
676
+ * Topic or context to generate material from
677
+ */
678
+ topic: string;
679
+
680
+ /**
681
+ * Type of material to generate
682
+ */
683
+ type: 'outline' | 'overview' | 'notes' | 'summary';
684
+
685
+ /**
686
+ * Additional context or details about the topic
687
+ */
688
+ context?: string;
689
+
690
+ /**
691
+ * Target folder ID
692
+ */
693
+ folderId?: string;
694
+
695
+ /**
696
+ * Length of the generated content
697
+ */
698
+ length?: 'short' | 'medium' | 'long';
699
+
700
+ /**
701
+ * Target education level
702
+ */
703
+ level?: 'high_school' | 'college' | 'professional';
704
+
705
+ /**
706
+ * Polling interval in milliseconds (default: 2 seconds)
707
+ */
708
+ pollIntervalMs?: number;
709
+
710
+ /**
711
+ * Maximum time to wait for processing in milliseconds (default: 5 minutes)
712
+ */
713
+ timeoutMs?: number;
714
+ }
715
+
565
716
  export interface MaterialGetDownloadURLParams {
566
717
  /**
567
718
  * URL expiration time in seconds (default: 3600)
@@ -616,12 +767,14 @@ export declare namespace Materials {
616
767
  type MaterialListResponse as MaterialListResponse,
617
768
  type MaterialBatchCreateResponse as MaterialBatchCreateResponse,
618
769
  type MaterialDebugResponse as MaterialDebugResponse,
770
+ type MaterialGenerateAndProcessResponse as MaterialGenerateAndProcessResponse,
619
771
  type MaterialGetDownloadURLResponse as MaterialGetDownloadURLResponse,
620
772
  type MaterialSearchResponse as MaterialSearchResponse,
621
773
  type MaterialCreateParams as MaterialCreateParams,
622
774
  type MaterialListParams as MaterialListParams,
623
775
  type MaterialBatchCreateParams as MaterialBatchCreateParams,
624
776
  type MaterialCreateAndProcessParams as MaterialCreateAndProcessParams,
777
+ type MaterialGenerateAndProcessParams as MaterialGenerateAndProcessParams,
625
778
  type MaterialGetDownloadURLParams as MaterialGetDownloadURLParams,
626
779
  type MaterialMoveParams as MaterialMoveParams,
627
780
  type MaterialRenameParams as MaterialRenameParams,
@@ -252,7 +252,7 @@ export interface UploadUploadFileAndProcessParams {
252
252
  pollIntervalMs?: number;
253
253
 
254
254
  /**
255
- * Processing timeout in milliseconds (default: 300000)
255
+ * Processing timeout in milliseconds (default: 300000 - 5 minutes)
256
256
  */
257
257
  timeoutMs?: number;
258
258
  }
@@ -8,6 +8,8 @@ import {
8
8
  AssignmentGraderGetAllResponse,
9
9
  AssignmentGraderResponse,
10
10
  } from './assignment-grader';
11
+ import * as ChatAPI from './chat';
12
+ import { Chat, ChatStreamParams } from './chat';
11
13
  import * as ComponentsAPI from './components';
12
14
  import {
13
15
  Component,
@@ -32,6 +34,8 @@ import {
32
34
  MaterialCreateAndProcessParams,
33
35
  MaterialCreateParams,
34
36
  MaterialDebugResponse,
37
+ MaterialGenerateAndProcessParams,
38
+ MaterialGenerateAndProcessResponse,
35
39
  MaterialGetDownloadURLParams,
36
40
  MaterialGetDownloadURLResponse,
37
41
  MaterialListParams,
@@ -60,6 +64,7 @@ export class V1 extends APIResource {
60
64
  assignmentGrader: AssignmentGraderAPI.AssignmentGrader = new AssignmentGraderAPI.AssignmentGrader(
61
65
  this._client,
62
66
  );
67
+ chat: ChatAPI.Chat = new ChatAPI.Chat(this._client);
63
68
 
64
69
  /**
65
70
  * Test MongoDB connection and get outbound IP
@@ -84,6 +89,7 @@ V1.Usage = Usage;
84
89
  V1.Embed = Embed;
85
90
  V1.Upload = Upload;
86
91
  V1.AssignmentGrader = AssignmentGrader;
92
+ V1.Chat = Chat;
87
93
 
88
94
  export declare namespace V1 {
89
95
  export {
@@ -93,12 +99,14 @@ export declare namespace V1 {
93
99
  type MaterialListResponse as MaterialListResponse,
94
100
  type MaterialBatchCreateResponse as MaterialBatchCreateResponse,
95
101
  type MaterialDebugResponse as MaterialDebugResponse,
102
+ type MaterialGenerateAndProcessResponse as MaterialGenerateAndProcessResponse,
96
103
  type MaterialGetDownloadURLResponse as MaterialGetDownloadURLResponse,
97
104
  type MaterialSearchResponse as MaterialSearchResponse,
98
105
  type MaterialCreateParams as MaterialCreateParams,
99
106
  type MaterialListParams as MaterialListParams,
100
107
  type MaterialBatchCreateParams as MaterialBatchCreateParams,
101
108
  type MaterialCreateAndProcessParams as MaterialCreateAndProcessParams,
109
+ type MaterialGenerateAndProcessParams as MaterialGenerateAndProcessParams,
102
110
  type MaterialGetDownloadURLParams as MaterialGetDownloadURLParams,
103
111
  type MaterialMoveParams as MaterialMoveParams,
104
112
  type MaterialRenameParams as MaterialRenameParams,
@@ -144,4 +152,6 @@ export declare namespace V1 {
144
152
  type AssignmentGraderGetAllResponse as AssignmentGraderGetAllResponse,
145
153
  type AssignmentGraderCreateParams as AssignmentGraderCreateParams,
146
154
  };
155
+
156
+ export { Chat as Chat, type ChatStreamParams as ChatStreamParams };
147
157
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.27.0'; // x-release-please-version
1
+ export const VERSION = '1.29.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.27.0";
1
+ export declare const VERSION = "1.29.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.27.0";
1
+ export declare const VERSION = "1.29.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '1.27.0'; // x-release-please-version
4
+ exports.VERSION = '1.29.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.27.0'; // x-release-please-version
1
+ export const VERSION = '1.29.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map