@studyfetch/sdk 1.24.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 (65) hide show
  1. package/CHANGELOG.md +8 -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/v1.d.mts +2 -2
  49. package/resources/v1/v1.d.mts.map +1 -1
  50. package/resources/v1/v1.d.ts +2 -2
  51. package/resources/v1/v1.d.ts.map +1 -1
  52. package/resources/v1/v1.js.map +1 -1
  53. package/resources/v1/v1.mjs.map +1 -1
  54. package/src/resources/v1/index.ts +7 -0
  55. package/src/resources/v1/materials/bulk.ts +36 -7
  56. package/src/resources/v1/materials/index.ts +23 -3
  57. package/src/resources/v1/materials/materials.ts +302 -58
  58. package/src/resources/v1/materials/test.ts +141 -25
  59. package/src/resources/v1/materials/upload.ts +86 -13
  60. package/src/resources/v1/v1.ts +14 -0
  61. package/src/version.ts +1 -1
  62. package/version.d.mts +1 -1
  63. package/version.d.ts +1 -1
  64. package/version.js +1 -1
  65. 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
  };
@@ -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.24.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.24.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.24.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.24.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.24.0'; // x-release-please-version
1
+ export const VERSION = '1.25.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map