@studyfetch/sdk 1.28.0 → 1.30.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 (95) hide show
  1. package/CHANGELOG.md +19 -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 -2
  12. package/resources/v1/index.d.mts.map +1 -1
  13. package/resources/v1/index.d.ts +2 -2
  14. package/resources/v1/index.d.ts.map +1 -1
  15. package/resources/v1/index.js +5 -5
  16. package/resources/v1/index.js.map +1 -1
  17. package/resources/v1/index.mjs +1 -1
  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 +120 -67
  26. package/resources/v1/materials/materials.d.mts.map +1 -1
  27. package/resources/v1/materials/materials.d.ts +120 -67
  28. package/resources/v1/materials/materials.d.ts.map +1 -1
  29. package/resources/v1/materials/materials.js +18 -1
  30. package/resources/v1/materials/materials.js.map +1 -1
  31. package/resources/v1/materials/materials.mjs +18 -1
  32. package/resources/v1/materials/materials.mjs.map +1 -1
  33. package/resources/v1/materials/upload.d.mts +7 -17
  34. package/resources/v1/materials/upload.d.mts.map +1 -1
  35. package/resources/v1/materials/upload.d.ts +7 -17
  36. package/resources/v1/materials/upload.d.ts.map +1 -1
  37. package/resources/v1/materials/upload.js +2 -4
  38. package/resources/v1/materials/upload.js.map +1 -1
  39. package/resources/v1/materials/upload.mjs +2 -4
  40. package/resources/v1/materials/upload.mjs.map +1 -1
  41. package/resources/v1/v1.d.mts +6 -6
  42. package/resources/v1/v1.d.mts.map +1 -1
  43. package/resources/v1/v1.d.ts +6 -6
  44. package/resources/v1/v1.d.ts.map +1 -1
  45. package/resources/v1/v1.js +4 -4
  46. package/resources/v1/v1.js.map +1 -1
  47. package/resources/v1/v1.mjs +4 -4
  48. package/resources/v1/v1.mjs.map +1 -1
  49. package/src/resources/v1/chat.ts +128 -0
  50. package/src/resources/v1/index.ts +3 -2
  51. package/src/resources/v1/materials/index.ts +2 -1
  52. package/src/resources/v1/materials/materials.ts +152 -86
  53. package/src/resources/v1/materials/upload.ts +7 -19
  54. package/src/resources/v1/v1.ts +10 -8
  55. package/src/version.ts +1 -1
  56. package/version.d.mts +1 -1
  57. package/version.d.ts +1 -1
  58. package/version.js +1 -1
  59. package/version.mjs +1 -1
  60. package/resources/v1/upload/component.d.mts +0 -191
  61. package/resources/v1/upload/component.d.mts.map +0 -1
  62. package/resources/v1/upload/component.d.ts +0 -191
  63. package/resources/v1/upload/component.d.ts.map +0 -1
  64. package/resources/v1/upload/component.js +0 -93
  65. package/resources/v1/upload/component.js.map +0 -1
  66. package/resources/v1/upload/component.mjs +0 -89
  67. package/resources/v1/upload/component.mjs.map +0 -1
  68. package/resources/v1/upload/index.d.mts +0 -3
  69. package/resources/v1/upload/index.d.mts.map +0 -1
  70. package/resources/v1/upload/index.d.ts +0 -3
  71. package/resources/v1/upload/index.d.ts.map +0 -1
  72. package/resources/v1/upload/index.js +0 -9
  73. package/resources/v1/upload/index.js.map +0 -1
  74. package/resources/v1/upload/index.mjs +0 -4
  75. package/resources/v1/upload/index.mjs.map +0 -1
  76. package/resources/v1/upload/upload.d.mts +0 -10
  77. package/resources/v1/upload/upload.d.mts.map +0 -1
  78. package/resources/v1/upload/upload.d.ts +0 -10
  79. package/resources/v1/upload/upload.d.ts.map +0 -1
  80. package/resources/v1/upload/upload.js +0 -17
  81. package/resources/v1/upload/upload.js.map +0 -1
  82. package/resources/v1/upload/upload.mjs +0 -12
  83. package/resources/v1/upload/upload.mjs.map +0 -1
  84. package/resources/v1/upload.d.mts +0 -2
  85. package/resources/v1/upload.d.mts.map +0 -1
  86. package/resources/v1/upload.d.ts +0 -2
  87. package/resources/v1/upload.d.ts.map +0 -1
  88. package/resources/v1/upload.js +0 -6
  89. package/resources/v1/upload.js.map +0 -1
  90. package/resources/v1/upload.mjs +0 -3
  91. package/resources/v1/upload.mjs.map +0 -1
  92. package/src/resources/v1/upload/component.ts +0 -261
  93. package/src/resources/v1/upload/index.ts +0 -13
  94. package/src/resources/v1/upload/upload.ts +0 -33
  95. package/src/resources/v1/upload.ts +0 -3
@@ -143,13 +143,31 @@ 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. Returns immediately without waiting for processing.
149
+ *
150
+ * @example
151
+ * ```ts
152
+ * const generatedMaterial =
153
+ * await client.v1.materials.generate({
154
+ * name: 'Photosynthesis Study Plan',
155
+ * topic: 'Photosynthesis in plants',
156
+ * type: 'notes',
157
+ * });
158
+ * ```
159
+ */
160
+ generate(body: MaterialGenerateParams, options?: RequestOptions): APIPromise<GeneratedMaterial> {
161
+ return this._client.post('/api/v1/materials/generate', { body, ...options });
162
+ }
163
+
146
164
  /**
147
165
  * Uses AI to generate study materials like outlines, notes, summaries, etc. from a
148
166
  * given topic and waits for processing to complete
149
167
  *
150
168
  * @example
151
169
  * ```ts
152
- * const response =
170
+ * const generatedMaterial =
153
171
  * await client.v1.materials.generateAndProcess({
154
172
  * name: 'Photosynthesis Study Plan',
155
173
  * topic: 'Photosynthesis in plants',
@@ -160,7 +178,7 @@ export class Materials extends APIResource {
160
178
  generateAndProcess(
161
179
  body: MaterialGenerateAndProcessParams,
162
180
  options?: RequestOptions,
163
- ): APIPromise<MaterialGenerateAndProcessResponse> {
181
+ ): APIPromise<GeneratedMaterial> {
164
182
  return this._client.post('/api/v1/materials/generate-and-process', { body, ...options });
165
183
  }
166
184
 
@@ -259,6 +277,89 @@ export interface Content {
259
277
  url?: string;
260
278
  }
261
279
 
280
+ export interface GeneratedMaterial {
281
+ /**
282
+ * Material ID
283
+ */
284
+ _id: string;
285
+
286
+ /**
287
+ * Material content
288
+ */
289
+ content: GeneratedMaterial.Content;
290
+
291
+ /**
292
+ * Content type
293
+ */
294
+ contentType: 'text' | 'pdf' | 'video' | 'audio' | 'image' | 'epub';
295
+
296
+ /**
297
+ * Creation timestamp
298
+ */
299
+ createdAt: string;
300
+
301
+ /**
302
+ * Folder ID
303
+ */
304
+ folderId: string | null;
305
+
306
+ /**
307
+ * Material name
308
+ */
309
+ name: string;
310
+
311
+ /**
312
+ * Organization ID
313
+ */
314
+ organizationId: string;
315
+
316
+ /**
317
+ * Material status
318
+ */
319
+ status: 'active' | 'processing' | 'pending_upload' | 'error' | 'deleted';
320
+
321
+ /**
322
+ * Last update timestamp
323
+ */
324
+ updatedAt: string;
325
+
326
+ /**
327
+ * Generation metadata
328
+ */
329
+ generationMetadata?: unknown;
330
+
331
+ /**
332
+ * Material metadata
333
+ */
334
+ metadata?: unknown;
335
+
336
+ /**
337
+ * Usage information
338
+ */
339
+ usage?: unknown;
340
+ }
341
+
342
+ export namespace GeneratedMaterial {
343
+ /**
344
+ * Material content
345
+ */
346
+ export interface Content {
347
+ filename?: string;
348
+
349
+ fileSize?: number;
350
+
351
+ mimeType?: string;
352
+
353
+ s3Key?: string;
354
+
355
+ s3Url?: string;
356
+
357
+ text?: string;
358
+
359
+ url?: string;
360
+ }
361
+ }
362
+
262
363
  export interface Material {
263
364
  /**
264
365
  * Material ID
@@ -421,89 +522,6 @@ export namespace MaterialDebugResponse {
421
522
  }
422
523
  }
423
524
 
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
-
507
525
  export interface MaterialGetDownloadURLResponse {
508
526
  /**
509
527
  * Temporary download URL
@@ -666,6 +684,43 @@ export interface MaterialCreateAndProcessParams {
666
684
  timeoutMs?: number;
667
685
  }
668
686
 
687
+ export interface MaterialGenerateParams {
688
+ /**
689
+ * Name for the generated material
690
+ */
691
+ name: string;
692
+
693
+ /**
694
+ * Topic or context to generate material from
695
+ */
696
+ topic: string;
697
+
698
+ /**
699
+ * Type of material to generate
700
+ */
701
+ type: 'outline' | 'overview' | 'notes' | 'summary';
702
+
703
+ /**
704
+ * Additional context or details about the topic
705
+ */
706
+ context?: string;
707
+
708
+ /**
709
+ * Target folder ID
710
+ */
711
+ folderId?: string;
712
+
713
+ /**
714
+ * Length of the generated content
715
+ */
716
+ length?: 'short' | 'medium' | 'long';
717
+
718
+ /**
719
+ * Target education level
720
+ */
721
+ level?: 'high_school' | 'college' | 'professional';
722
+ }
723
+
669
724
  export interface MaterialGenerateAndProcessParams {
670
725
  /**
671
726
  * Name for the generated material
@@ -701,6 +756,16 @@ export interface MaterialGenerateAndProcessParams {
701
756
  * Target education level
702
757
  */
703
758
  level?: 'high_school' | 'college' | 'professional';
759
+
760
+ /**
761
+ * Polling interval in milliseconds (default: 2 seconds)
762
+ */
763
+ pollIntervalMs?: number;
764
+
765
+ /**
766
+ * Maximum time to wait for processing in milliseconds (default: 5 minutes)
767
+ */
768
+ timeoutMs?: number;
704
769
  }
705
770
 
706
771
  export interface MaterialGetDownloadURLParams {
@@ -753,17 +818,18 @@ Materials.Test = Test;
753
818
  export declare namespace Materials {
754
819
  export {
755
820
  type Content as Content,
821
+ type GeneratedMaterial as GeneratedMaterial,
756
822
  type Material as Material,
757
823
  type MaterialListResponse as MaterialListResponse,
758
824
  type MaterialBatchCreateResponse as MaterialBatchCreateResponse,
759
825
  type MaterialDebugResponse as MaterialDebugResponse,
760
- type MaterialGenerateAndProcessResponse as MaterialGenerateAndProcessResponse,
761
826
  type MaterialGetDownloadURLResponse as MaterialGetDownloadURLResponse,
762
827
  type MaterialSearchResponse as MaterialSearchResponse,
763
828
  type MaterialCreateParams as MaterialCreateParams,
764
829
  type MaterialListParams as MaterialListParams,
765
830
  type MaterialBatchCreateParams as MaterialBatchCreateParams,
766
831
  type MaterialCreateAndProcessParams as MaterialCreateAndProcessParams,
832
+ type MaterialGenerateParams as MaterialGenerateParams,
767
833
  type MaterialGenerateAndProcessParams as MaterialGenerateAndProcessParams,
768
834
  type MaterialGetDownloadURLParams as MaterialGetDownloadURLParams,
769
835
  type MaterialMoveParams as MaterialMoveParams,
@@ -15,10 +15,8 @@ export class Upload extends APIResource {
15
15
  * ```ts
16
16
  * const material =
17
17
  * await client.v1.materials.upload.completeUpload({
18
- * materialId: '507f1f77bcf86cd799439013',
19
- * organizationId: '507f1f77bcf86cd799439011',
20
- * s3Key:
21
- * 'organizations/507f1f77bcf86cd799439011/materials/document.pdf',
18
+ * materialId: 'materialId',
19
+ * s3Key: 's3Key',
22
20
  * });
23
21
  * ```
24
22
  */
@@ -133,17 +131,12 @@ export class Upload extends APIResource {
133
131
 
134
132
  export interface Complete {
135
133
  /**
136
- * The ID of the material that was uploaded
134
+ * Material ID from presigned URL response
137
135
  */
138
136
  materialId: string;
139
137
 
140
138
  /**
141
- * The ID of the organization
142
- */
143
- organizationId: string;
144
-
145
- /**
146
- * The S3 key of the uploaded file
139
+ * S3 key from presigned URL response
147
140
  */
148
141
  s3Key: string;
149
142
  }
@@ -167,17 +160,12 @@ export interface UploadCreatePresignedURLResponse {
167
160
 
168
161
  export interface UploadCompleteUploadParams {
169
162
  /**
170
- * The ID of the material that was uploaded
163
+ * Material ID from presigned URL response
171
164
  */
172
165
  materialId: string;
173
166
 
174
167
  /**
175
- * The ID of the organization
176
- */
177
- organizationId: string;
178
-
179
- /**
180
- * The S3 key of the uploaded file
168
+ * S3 key from presigned URL response
181
169
  */
182
170
  s3Key: string;
183
171
  }
@@ -252,7 +240,7 @@ export interface UploadUploadFileAndProcessParams {
252
240
  pollIntervalMs?: number;
253
241
 
254
242
  /**
255
- * Processing timeout in milliseconds (default: 300000)
243
+ * Processing timeout in milliseconds (default: 300000 - 5 minutes)
256
244
  */
257
245
  timeoutMs?: number;
258
246
  }
@@ -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,
@@ -26,6 +28,7 @@ import { Embed, EmbedGetThemeParams, EmbedVerifyParams } from './embed/embed';
26
28
  import * as MaterialsAPI from './materials/materials';
27
29
  import {
28
30
  Content,
31
+ GeneratedMaterial,
29
32
  Material,
30
33
  MaterialBatchCreateParams,
31
34
  MaterialBatchCreateResponse,
@@ -33,7 +36,7 @@ import {
33
36
  MaterialCreateParams,
34
37
  MaterialDebugResponse,
35
38
  MaterialGenerateAndProcessParams,
36
- MaterialGenerateAndProcessResponse,
39
+ MaterialGenerateParams,
37
40
  MaterialGetDownloadURLParams,
38
41
  MaterialGetDownloadURLResponse,
39
42
  MaterialListParams,
@@ -44,8 +47,6 @@ import {
44
47
  MaterialSearchResponse,
45
48
  Materials,
46
49
  } from './materials/materials';
47
- import * as UploadAPI from './upload/upload';
48
- import { Upload } from './upload/upload';
49
50
  import * as UsageAPI from './usage/usage';
50
51
  import { Usage, UsageGetStatsParams, UsageGetSummaryParams, UsageListEventsParams } from './usage/usage';
51
52
  import { APIPromise } from '../../core/api-promise';
@@ -58,10 +59,10 @@ export class V1 extends APIResource {
58
59
  components: ComponentsAPI.Components = new ComponentsAPI.Components(this._client);
59
60
  usage: UsageAPI.Usage = new UsageAPI.Usage(this._client);
60
61
  embed: EmbedAPI.Embed = new EmbedAPI.Embed(this._client);
61
- upload: UploadAPI.Upload = new UploadAPI.Upload(this._client);
62
62
  assignmentGrader: AssignmentGraderAPI.AssignmentGrader = new AssignmentGraderAPI.AssignmentGrader(
63
63
  this._client,
64
64
  );
65
+ chat: ChatAPI.Chat = new ChatAPI.Chat(this._client);
65
66
 
66
67
  /**
67
68
  * Test MongoDB connection and get outbound IP
@@ -84,24 +85,25 @@ V1.Folders = Folders;
84
85
  V1.Components = Components;
85
86
  V1.Usage = Usage;
86
87
  V1.Embed = Embed;
87
- V1.Upload = Upload;
88
88
  V1.AssignmentGrader = AssignmentGrader;
89
+ V1.Chat = Chat;
89
90
 
90
91
  export declare namespace V1 {
91
92
  export {
92
93
  Materials as Materials,
93
94
  type Content as Content,
95
+ type GeneratedMaterial as GeneratedMaterial,
94
96
  type Material as Material,
95
97
  type MaterialListResponse as MaterialListResponse,
96
98
  type MaterialBatchCreateResponse as MaterialBatchCreateResponse,
97
99
  type MaterialDebugResponse as MaterialDebugResponse,
98
- type MaterialGenerateAndProcessResponse as MaterialGenerateAndProcessResponse,
99
100
  type MaterialGetDownloadURLResponse as MaterialGetDownloadURLResponse,
100
101
  type MaterialSearchResponse as MaterialSearchResponse,
101
102
  type MaterialCreateParams as MaterialCreateParams,
102
103
  type MaterialListParams as MaterialListParams,
103
104
  type MaterialBatchCreateParams as MaterialBatchCreateParams,
104
105
  type MaterialCreateAndProcessParams as MaterialCreateAndProcessParams,
106
+ type MaterialGenerateParams as MaterialGenerateParams,
105
107
  type MaterialGenerateAndProcessParams as MaterialGenerateAndProcessParams,
106
108
  type MaterialGetDownloadURLParams as MaterialGetDownloadURLParams,
107
109
  type MaterialMoveParams as MaterialMoveParams,
@@ -140,12 +142,12 @@ export declare namespace V1 {
140
142
  type EmbedVerifyParams as EmbedVerifyParams,
141
143
  };
142
144
 
143
- export { Upload as Upload };
144
-
145
145
  export {
146
146
  AssignmentGrader as AssignmentGrader,
147
147
  type AssignmentGraderResponse as AssignmentGraderResponse,
148
148
  type AssignmentGraderGetAllResponse as AssignmentGraderGetAllResponse,
149
149
  type AssignmentGraderCreateParams as AssignmentGraderCreateParams,
150
150
  };
151
+
152
+ export { Chat as Chat, type ChatStreamParams as ChatStreamParams };
151
153
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.28.0'; // x-release-please-version
1
+ export const VERSION = '1.30.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.28.0";
1
+ export declare const VERSION = "1.30.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.28.0";
1
+ export declare const VERSION = "1.30.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.28.0'; // x-release-please-version
4
+ exports.VERSION = '1.30.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.28.0'; // x-release-please-version
1
+ export const VERSION = '1.30.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map
@@ -1,191 +0,0 @@
1
- import { APIResource } from "../../../core/resource.mjs";
2
- import { APIPromise } from "../../../core/api-promise.mjs";
3
- import { type Uploadable } from "../../../core/uploads.mjs";
4
- import { RequestOptions } from "../../../internal/request-options.mjs";
5
- export declare class Component extends APIResource {
6
- /**
7
- * Complete a file upload after using presigned URL
8
- *
9
- * @example
10
- * ```ts
11
- * const response =
12
- * await client.v1.upload.component.completeUpload(
13
- * 'componentId',
14
- * {
15
- * materialId: '507f1f77bcf86cd799439013',
16
- * organizationId: '507f1f77bcf86cd799439011',
17
- * s3Key:
18
- * 'organizations/507f1f77bcf86cd799439011/materials/document.pdf',
19
- * },
20
- * );
21
- * ```
22
- */
23
- completeUpload(componentID: string, body: ComponentCompleteUploadParams, options?: RequestOptions): APIPromise<ComponentCompleteUploadResponse>;
24
- /**
25
- * Get a presigned URL for direct file upload
26
- *
27
- * @example
28
- * ```ts
29
- * const response =
30
- * await client.v1.upload.component.getPresignedURL(
31
- * 'componentId',
32
- * {
33
- * contentType: 'application/pdf',
34
- * filename: 'document.pdf',
35
- * folderId: '507f1f77bcf86cd799439012',
36
- * organizationId: '507f1f77bcf86cd799439011',
37
- * },
38
- * );
39
- * ```
40
- */
41
- getPresignedURL(componentID: string, body: ComponentGetPresignedURLParams, options?: RequestOptions): APIPromise<ComponentGetPresignedURLResponse>;
42
- /**
43
- * Upload a file to a component
44
- *
45
- * @example
46
- * ```ts
47
- * const fileUploadResponse =
48
- * await client.v1.upload.component.uploadFile(
49
- * 'componentId',
50
- * {
51
- * file: fs.createReadStream('path/to/file'),
52
- * folderId: '507f1f77bcf86cd799439012',
53
- * organizationId: '507f1f77bcf86cd799439011',
54
- * },
55
- * );
56
- * ```
57
- */
58
- uploadFile(componentID: string, body: ComponentUploadFileParams, options?: RequestOptions): APIPromise<FileUploadResponse>;
59
- /**
60
- * Upload a file from URL to a component
61
- *
62
- * @example
63
- * ```ts
64
- * const fileUploadResponse =
65
- * await client.v1.upload.component.uploadURL(
66
- * 'componentId',
67
- * {
68
- * folderId: '507f1f77bcf86cd799439012',
69
- * name: 'my-document.pdf',
70
- * organizationId: '507f1f77bcf86cd799439011',
71
- * url: 'https://example.com/document.pdf',
72
- * },
73
- * );
74
- * ```
75
- */
76
- uploadURL(componentID: string, body: ComponentUploadURLParams, options?: RequestOptions): APIPromise<FileUploadResponse>;
77
- }
78
- export interface FileUploadResponse {
79
- /**
80
- * The ID of the uploaded material
81
- */
82
- id: string;
83
- /**
84
- * The content type of the material
85
- */
86
- contentType: string;
87
- /**
88
- * The name of the material
89
- */
90
- name: string;
91
- /**
92
- * The S3 key of the uploaded file
93
- */
94
- s3Key: string;
95
- /**
96
- * The status of the material
97
- */
98
- status: string;
99
- }
100
- export interface ComponentCompleteUploadResponse {
101
- /**
102
- * The ID of the uploaded material
103
- */
104
- id: string;
105
- /**
106
- * The name of the material
107
- */
108
- name: string;
109
- /**
110
- * The status of the material
111
- */
112
- status: string;
113
- }
114
- export interface ComponentGetPresignedURLResponse {
115
- /**
116
- * The S3 key for the file
117
- */
118
- key: string;
119
- /**
120
- * The presigned URL for uploading
121
- */
122
- uploadUrl: string;
123
- }
124
- export interface ComponentCompleteUploadParams {
125
- /**
126
- * The ID of the material that was uploaded
127
- */
128
- materialId: string;
129
- /**
130
- * The ID of the organization
131
- */
132
- organizationId: string;
133
- /**
134
- * The S3 key of the uploaded file
135
- */
136
- s3Key: string;
137
- }
138
- export interface ComponentGetPresignedURLParams {
139
- /**
140
- * The MIME type of the file
141
- */
142
- contentType: string;
143
- /**
144
- * The name of the file to upload
145
- */
146
- filename: string;
147
- /**
148
- * The ID of the folder to upload to
149
- */
150
- folderId: string;
151
- /**
152
- * The ID of the organization
153
- */
154
- organizationId: string;
155
- }
156
- export interface ComponentUploadFileParams {
157
- /**
158
- * The file to upload
159
- */
160
- file: Uploadable;
161
- /**
162
- * The ID of the folder to upload to
163
- */
164
- folderId: string;
165
- /**
166
- * The ID of the organization
167
- */
168
- organizationId: string;
169
- }
170
- export interface ComponentUploadURLParams {
171
- /**
172
- * The ID of the folder to upload to
173
- */
174
- folderId: string;
175
- /**
176
- * The name for the uploaded file
177
- */
178
- name: string;
179
- /**
180
- * The ID of the organization
181
- */
182
- organizationId: string;
183
- /**
184
- * The URL of the file to upload
185
- */
186
- url: string;
187
- }
188
- export declare namespace Component {
189
- export { type FileUploadResponse as FileUploadResponse, type ComponentCompleteUploadResponse as ComponentCompleteUploadResponse, type ComponentGetPresignedURLResponse as ComponentGetPresignedURLResponse, type ComponentCompleteUploadParams as ComponentCompleteUploadParams, type ComponentGetPresignedURLParams as ComponentGetPresignedURLParams, type ComponentUploadFileParams as ComponentUploadFileParams, type ComponentUploadURLParams as ComponentUploadURLParams, };
190
- }
191
- //# sourceMappingURL=component.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component.d.mts","sourceRoot":"","sources":["../../../src/resources/v1/upload/component.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;OACnB,EAAE,cAAc,EAAE;AAIzB,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;;;OAgBG;IACH,cAAc,CACZ,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,6BAA6B,EACnC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,+BAA+B,CAAC;IAI9C;;;;;;;;;;;;;;;;OAgBG;IACH,eAAe,CACb,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,8BAA8B,EACpC,OAAO,CAAC,EAAE,cAAc,GACvB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