@studyfetch/sdk 1.23.0 → 1.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.json +1 -1
  3. package/resources/v1/index.d.mts +1 -1
  4. package/resources/v1/index.d.mts.map +1 -1
  5. package/resources/v1/index.d.ts +1 -1
  6. package/resources/v1/index.d.ts.map +1 -1
  7. package/resources/v1/index.js.map +1 -1
  8. package/resources/v1/index.mjs.map +1 -1
  9. package/resources/v1/materials/bulk.d.mts +30 -2
  10. package/resources/v1/materials/bulk.d.mts.map +1 -1
  11. package/resources/v1/materials/bulk.d.ts +30 -2
  12. package/resources/v1/materials/bulk.d.ts.map +1 -1
  13. package/resources/v1/materials/bulk.js +8 -7
  14. package/resources/v1/materials/bulk.js.map +1 -1
  15. package/resources/v1/materials/bulk.mjs +8 -7
  16. package/resources/v1/materials/bulk.mjs.map +1 -1
  17. package/resources/v1/materials/index.d.mts +4 -4
  18. package/resources/v1/materials/index.d.mts.map +1 -1
  19. package/resources/v1/materials/index.d.ts +4 -4
  20. package/resources/v1/materials/index.d.ts.map +1 -1
  21. package/resources/v1/materials/index.js.map +1 -1
  22. package/resources/v1/materials/index.mjs +2 -2
  23. package/resources/v1/materials/index.mjs.map +1 -1
  24. package/resources/v1/materials/materials.d.mts +224 -29
  25. package/resources/v1/materials/materials.d.mts.map +1 -1
  26. package/resources/v1/materials/materials.d.ts +224 -29
  27. package/resources/v1/materials/materials.d.ts.map +1 -1
  28. package/resources/v1/materials/materials.js +47 -44
  29. package/resources/v1/materials/materials.js.map +1 -1
  30. package/resources/v1/materials/materials.mjs +49 -46
  31. package/resources/v1/materials/materials.mjs.map +1 -1
  32. package/resources/v1/materials/test.d.mts +111 -8
  33. package/resources/v1/materials/test.d.mts.map +1 -1
  34. package/resources/v1/materials/test.d.ts +111 -8
  35. package/resources/v1/materials/test.d.ts.map +1 -1
  36. package/resources/v1/materials/test.js +20 -21
  37. package/resources/v1/materials/test.js.map +1 -1
  38. package/resources/v1/materials/test.mjs +20 -21
  39. package/resources/v1/materials/test.mjs.map +1 -1
  40. package/resources/v1/materials/upload.d.mts +66 -5
  41. package/resources/v1/materials/upload.d.mts.map +1 -1
  42. package/resources/v1/materials/upload.d.ts +66 -5
  43. package/resources/v1/materials/upload.d.ts.map +1 -1
  44. package/resources/v1/materials/upload.js +21 -13
  45. package/resources/v1/materials/upload.js.map +1 -1
  46. package/resources/v1/materials/upload.mjs +21 -13
  47. package/resources/v1/materials/upload.mjs.map +1 -1
  48. package/resources/v1/upload/component.d.mts +26 -47
  49. package/resources/v1/upload/component.d.mts.map +1 -1
  50. package/resources/v1/upload/component.d.ts +26 -47
  51. package/resources/v1/upload/component.d.ts.map +1 -1
  52. package/resources/v1/upload/component.js +11 -10
  53. package/resources/v1/upload/component.js.map +1 -1
  54. package/resources/v1/upload/component.mjs +11 -10
  55. package/resources/v1/upload/component.mjs.map +1 -1
  56. package/resources/v1/upload/index.d.mts +1 -1
  57. package/resources/v1/upload/index.d.mts.map +1 -1
  58. package/resources/v1/upload/index.d.ts +1 -1
  59. package/resources/v1/upload/index.d.ts.map +1 -1
  60. package/resources/v1/upload/index.js.map +1 -1
  61. package/resources/v1/upload/index.mjs.map +1 -1
  62. package/resources/v1/upload/upload.d.mts +2 -2
  63. package/resources/v1/upload/upload.d.mts.map +1 -1
  64. package/resources/v1/upload/upload.d.ts +2 -2
  65. package/resources/v1/upload/upload.d.ts.map +1 -1
  66. package/resources/v1/upload/upload.js.map +1 -1
  67. package/resources/v1/upload/upload.mjs.map +1 -1
  68. package/resources/v1/v1.d.mts +2 -2
  69. package/resources/v1/v1.d.mts.map +1 -1
  70. package/resources/v1/v1.d.ts +2 -2
  71. package/resources/v1/v1.d.ts.map +1 -1
  72. package/resources/v1/v1.js.map +1 -1
  73. package/resources/v1/v1.mjs.map +1 -1
  74. package/src/resources/v1/index.ts +7 -0
  75. package/src/resources/v1/materials/bulk.ts +36 -7
  76. package/src/resources/v1/materials/index.ts +23 -3
  77. package/src/resources/v1/materials/materials.ts +302 -58
  78. package/src/resources/v1/materials/test.ts +141 -25
  79. package/src/resources/v1/materials/upload.ts +86 -13
  80. package/src/resources/v1/upload/component.ts +26 -53
  81. package/src/resources/v1/upload/index.ts +1 -2
  82. package/src/resources/v1/upload/upload.ts +2 -4
  83. package/src/resources/v1/v1.ts +14 -0
  84. package/src/version.ts +1 -1
  85. package/version.d.mts +1 -1
  86. package/version.d.ts +1 -1
  87. package/version.js +1 -1
  88. package/version.mjs +1 -1
@@ -4,35 +4,49 @@ import { APIResource } from '../../../core/resource';
4
4
  import * as MaterialsAPI from './materials';
5
5
  import { APIPromise } from '../../../core/api-promise';
6
6
  import { type Uploadable } from '../../../core/uploads';
7
- import { buildHeaders } from '../../../internal/headers';
8
7
  import { RequestOptions } from '../../../internal/request-options';
9
8
  import { multipartFormRequestOptions } from '../../../internal/uploads';
10
9
 
11
10
  export class Upload extends APIResource {
12
11
  /**
12
+ * Complete upload after using presigned URL
13
+ *
13
14
  * @example
14
15
  * ```ts
15
- * await client.v1.materials.upload.completeUpload();
16
+ * const material =
17
+ * await client.v1.materials.upload.completeUpload({
18
+ * materialId: '507f1f77bcf86cd799439013',
19
+ * organizationId: '507f1f77bcf86cd799439011',
20
+ * s3Key:
21
+ * 'organizations/507f1f77bcf86cd799439011/materials/document.pdf',
22
+ * });
16
23
  * ```
17
24
  */
18
- completeUpload(options?: RequestOptions): APIPromise<void> {
19
- return this._client.post('/api/v1/materials/upload/complete', {
20
- ...options,
21
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
22
- });
25
+ completeUpload(
26
+ body: UploadCompleteUploadParams,
27
+ options?: RequestOptions,
28
+ ): APIPromise<MaterialsAPI.Material> {
29
+ return this._client.post('/api/v1/materials/upload/complete', { body, ...options });
23
30
  }
24
31
 
25
32
  /**
33
+ * Get presigned URL for direct S3 upload
34
+ *
26
35
  * @example
27
36
  * ```ts
28
- * await client.v1.materials.upload.createPresignedURL();
37
+ * const response =
38
+ * await client.v1.materials.upload.createPresignedURL({
39
+ * contentType: 'application/pdf',
40
+ * filename: 'document.pdf',
41
+ * name: 'Chapter 1 Notes',
42
+ * });
29
43
  * ```
30
44
  */
31
- createPresignedURL(options?: RequestOptions): APIPromise<void> {
32
- return this._client.post('/api/v1/materials/upload/presigned-url', {
33
- ...options,
34
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
35
- });
45
+ createPresignedURL(
46
+ body: UploadCreatePresignedURLParams,
47
+ options?: RequestOptions,
48
+ ): APIPromise<UploadCreatePresignedURLResponse> {
49
+ return this._client.post('/api/v1/materials/upload/presigned-url', { body, ...options });
36
50
  }
37
51
 
38
52
  /**
@@ -74,6 +88,62 @@ export class Upload extends APIResource {
74
88
  }
75
89
  }
76
90
 
91
+ export interface UploadCreatePresignedURLResponse {
92
+ /**
93
+ * Material ID to use for completion
94
+ */
95
+ materialId: string;
96
+
97
+ /**
98
+ * S3 key for the file
99
+ */
100
+ s3Key: string;
101
+
102
+ /**
103
+ * Presigned URL for direct S3 upload
104
+ */
105
+ uploadUrl: string;
106
+ }
107
+
108
+ export interface UploadCompleteUploadParams {
109
+ /**
110
+ * The ID of the material that was uploaded
111
+ */
112
+ materialId: string;
113
+
114
+ /**
115
+ * The ID of the organization
116
+ */
117
+ organizationId: string;
118
+
119
+ /**
120
+ * The S3 key of the uploaded file
121
+ */
122
+ s3Key: string;
123
+ }
124
+
125
+ export interface UploadCreatePresignedURLParams {
126
+ /**
127
+ * MIME type of the file
128
+ */
129
+ contentType: string;
130
+
131
+ /**
132
+ * Filename to upload
133
+ */
134
+ filename: string;
135
+
136
+ /**
137
+ * Display name for the material
138
+ */
139
+ name: string;
140
+
141
+ /**
142
+ * Folder ID to place the material in
143
+ */
144
+ folderId?: string;
145
+ }
146
+
77
147
  export interface UploadUploadFileParams {
78
148
  file: Uploadable;
79
149
 
@@ -107,6 +177,9 @@ export interface UploadUploadFromURLParams {
107
177
 
108
178
  export declare namespace Upload {
109
179
  export {
180
+ type UploadCreatePresignedURLResponse as UploadCreatePresignedURLResponse,
181
+ type UploadCompleteUploadParams as UploadCompleteUploadParams,
182
+ type UploadCreatePresignedURLParams as UploadCreatePresignedURLParams,
110
183
  type UploadUploadFileParams as UploadUploadFileParams,
111
184
  type UploadUploadFromURLParams as UploadUploadFromURLParams,
112
185
  };
@@ -66,7 +66,7 @@ export class Component extends APIResource {
66
66
  *
67
67
  * @example
68
68
  * ```ts
69
- * const response =
69
+ * const fileUploadResponse =
70
70
  * await client.v1.upload.component.uploadFile(
71
71
  * 'componentId',
72
72
  * {
@@ -81,7 +81,7 @@ export class Component extends APIResource {
81
81
  componentID: string,
82
82
  body: ComponentUploadFileParams,
83
83
  options?: RequestOptions,
84
- ): APIPromise<ComponentUploadFileResponse> {
84
+ ): APIPromise<FileUploadResponse> {
85
85
  return this._client.post(
86
86
  path`/api/v1/upload/component/${componentID}/file`,
87
87
  multipartFormRequestOptions({ body, ...options }, this._client),
@@ -93,56 +93,28 @@ export class Component extends APIResource {
93
93
  *
94
94
  * @example
95
95
  * ```ts
96
- * const response = await client.v1.upload.component.uploadURL(
97
- * 'componentId',
98
- * {
99
- * folderId: '507f1f77bcf86cd799439012',
100
- * name: 'my-document.pdf',
101
- * organizationId: '507f1f77bcf86cd799439011',
102
- * url: 'https://example.com/document.pdf',
103
- * },
104
- * );
96
+ * const fileUploadResponse =
97
+ * await client.v1.upload.component.uploadURL(
98
+ * 'componentId',
99
+ * {
100
+ * folderId: '507f1f77bcf86cd799439012',
101
+ * name: 'my-document.pdf',
102
+ * organizationId: '507f1f77bcf86cd799439011',
103
+ * url: 'https://example.com/document.pdf',
104
+ * },
105
+ * );
105
106
  * ```
106
107
  */
107
108
  uploadURL(
108
109
  componentID: string,
109
110
  body: ComponentUploadURLParams,
110
111
  options?: RequestOptions,
111
- ): APIPromise<ComponentUploadURLResponse> {
112
+ ): APIPromise<FileUploadResponse> {
112
113
  return this._client.post(path`/api/v1/upload/component/${componentID}/url`, { body, ...options });
113
114
  }
114
115
  }
115
116
 
116
- export interface ComponentCompleteUploadResponse {
117
- /**
118
- * The ID of the uploaded material
119
- */
120
- id: string;
121
-
122
- /**
123
- * The name of the material
124
- */
125
- name: string;
126
-
127
- /**
128
- * The status of the material
129
- */
130
- status: string;
131
- }
132
-
133
- export interface ComponentGetPresignedURLResponse {
134
- /**
135
- * The S3 key for the file
136
- */
137
- key: string;
138
-
139
- /**
140
- * The presigned URL for uploading
141
- */
142
- uploadUrl: string;
143
- }
144
-
145
- export interface ComponentUploadFileResponse {
117
+ export interface FileUploadResponse {
146
118
  /**
147
119
  * The ID of the uploaded material
148
120
  */
@@ -169,31 +141,33 @@ export interface ComponentUploadFileResponse {
169
141
  status: string;
170
142
  }
171
143
 
172
- export interface ComponentUploadURLResponse {
144
+ export interface ComponentCompleteUploadResponse {
173
145
  /**
174
146
  * The ID of the uploaded material
175
147
  */
176
148
  id: string;
177
149
 
178
150
  /**
179
- * The content type of the material
151
+ * The name of the material
180
152
  */
181
- contentType: string;
153
+ name: string;
182
154
 
183
155
  /**
184
- * The name of the material
156
+ * The status of the material
185
157
  */
186
- name: string;
158
+ status: string;
159
+ }
187
160
 
161
+ export interface ComponentGetPresignedURLResponse {
188
162
  /**
189
- * The S3 key of the uploaded file
163
+ * The S3 key for the file
190
164
  */
191
- s3Key: string;
165
+ key: string;
192
166
 
193
167
  /**
194
- * The status of the material
168
+ * The presigned URL for uploading
195
169
  */
196
- status: string;
170
+ uploadUrl: string;
197
171
  }
198
172
 
199
173
  export interface ComponentCompleteUploadParams {
@@ -276,10 +250,9 @@ export interface ComponentUploadURLParams {
276
250
 
277
251
  export declare namespace Component {
278
252
  export {
253
+ type FileUploadResponse as FileUploadResponse,
279
254
  type ComponentCompleteUploadResponse as ComponentCompleteUploadResponse,
280
255
  type ComponentGetPresignedURLResponse as ComponentGetPresignedURLResponse,
281
- type ComponentUploadFileResponse as ComponentUploadFileResponse,
282
- type ComponentUploadURLResponse as ComponentUploadURLResponse,
283
256
  type ComponentCompleteUploadParams as ComponentCompleteUploadParams,
284
257
  type ComponentGetPresignedURLParams as ComponentGetPresignedURLParams,
285
258
  type ComponentUploadFileParams as ComponentUploadFileParams,
@@ -2,10 +2,9 @@
2
2
 
3
3
  export {
4
4
  Component,
5
+ type FileUploadResponse,
5
6
  type ComponentCompleteUploadResponse,
6
7
  type ComponentGetPresignedURLResponse,
7
- type ComponentUploadFileResponse,
8
- type ComponentUploadURLResponse,
9
8
  type ComponentCompleteUploadParams,
10
9
  type ComponentGetPresignedURLParams,
11
10
  type ComponentUploadFileParams,
@@ -9,9 +9,8 @@ import {
9
9
  ComponentGetPresignedURLParams,
10
10
  ComponentGetPresignedURLResponse,
11
11
  ComponentUploadFileParams,
12
- ComponentUploadFileResponse,
13
12
  ComponentUploadURLParams,
14
- ComponentUploadURLResponse,
13
+ FileUploadResponse,
15
14
  } from './component';
16
15
 
17
16
  export class Upload extends APIResource {
@@ -23,10 +22,9 @@ Upload.Component = Component;
23
22
  export declare namespace Upload {
24
23
  export {
25
24
  Component as Component,
25
+ type FileUploadResponse as FileUploadResponse,
26
26
  type ComponentCompleteUploadResponse as ComponentCompleteUploadResponse,
27
27
  type ComponentGetPresignedURLResponse as ComponentGetPresignedURLResponse,
28
- type ComponentUploadFileResponse as ComponentUploadFileResponse,
29
- type ComponentUploadURLResponse as ComponentUploadURLResponse,
30
28
  type ComponentCompleteUploadParams as ComponentCompleteUploadParams,
31
29
  type ComponentGetPresignedURLParams as ComponentGetPresignedURLParams,
32
30
  type ComponentUploadFileParams as ComponentUploadFileParams,
@@ -48,11 +48,18 @@ import { Embed, EmbedGetThemeParams, EmbedVerifyParams } from './embed/embed';
48
48
  import * as MaterialsAPI from './materials/materials';
49
49
  import {
50
50
  Material,
51
+ MaterialBatchCreateParams,
52
+ MaterialBatchCreateResponse,
51
53
  MaterialCreateParams,
54
+ MaterialDebugResponse,
52
55
  MaterialGetDownloadURLParams,
56
+ MaterialGetDownloadURLResponse,
53
57
  MaterialListParams,
54
58
  MaterialListResponse,
59
+ MaterialMoveParams,
60
+ MaterialRenameParams,
55
61
  MaterialSearchParams,
62
+ MaterialSearchResponse,
56
63
  Materials,
57
64
  } from './materials/materials';
58
65
  import * as ScenariosAPI from './scenarios/scenarios';
@@ -114,9 +121,16 @@ export declare namespace V1 {
114
121
  Materials as Materials,
115
122
  type Material as Material,
116
123
  type MaterialListResponse as MaterialListResponse,
124
+ type MaterialBatchCreateResponse as MaterialBatchCreateResponse,
125
+ type MaterialDebugResponse as MaterialDebugResponse,
126
+ type MaterialGetDownloadURLResponse as MaterialGetDownloadURLResponse,
127
+ type MaterialSearchResponse as MaterialSearchResponse,
117
128
  type MaterialCreateParams as MaterialCreateParams,
118
129
  type MaterialListParams as MaterialListParams,
130
+ type MaterialBatchCreateParams as MaterialBatchCreateParams,
119
131
  type MaterialGetDownloadURLParams as MaterialGetDownloadURLParams,
132
+ type MaterialMoveParams as MaterialMoveParams,
133
+ type MaterialRenameParams as MaterialRenameParams,
120
134
  type MaterialSearchParams as MaterialSearchParams,
121
135
  };
122
136
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.23.0'; // x-release-please-version
1
+ export const VERSION = '1.25.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.23.0";
1
+ export declare const VERSION = "1.25.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.23.0";
1
+ export declare const VERSION = "1.25.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.23.0'; // x-release-please-version
4
+ exports.VERSION = '1.25.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.23.0'; // x-release-please-version
1
+ export const VERSION = '1.25.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map