@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.
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/resources/v1/index.d.mts +1 -1
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +1 -1
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/materials/bulk.d.mts +30 -2
- package/resources/v1/materials/bulk.d.mts.map +1 -1
- package/resources/v1/materials/bulk.d.ts +30 -2
- package/resources/v1/materials/bulk.d.ts.map +1 -1
- package/resources/v1/materials/bulk.js +8 -7
- package/resources/v1/materials/bulk.js.map +1 -1
- package/resources/v1/materials/bulk.mjs +8 -7
- package/resources/v1/materials/bulk.mjs.map +1 -1
- package/resources/v1/materials/index.d.mts +4 -4
- package/resources/v1/materials/index.d.mts.map +1 -1
- package/resources/v1/materials/index.d.ts +4 -4
- package/resources/v1/materials/index.d.ts.map +1 -1
- package/resources/v1/materials/index.js.map +1 -1
- package/resources/v1/materials/index.mjs +2 -2
- package/resources/v1/materials/index.mjs.map +1 -1
- package/resources/v1/materials/materials.d.mts +224 -29
- package/resources/v1/materials/materials.d.mts.map +1 -1
- package/resources/v1/materials/materials.d.ts +224 -29
- package/resources/v1/materials/materials.d.ts.map +1 -1
- package/resources/v1/materials/materials.js +47 -44
- package/resources/v1/materials/materials.js.map +1 -1
- package/resources/v1/materials/materials.mjs +49 -46
- package/resources/v1/materials/materials.mjs.map +1 -1
- package/resources/v1/materials/test.d.mts +111 -8
- package/resources/v1/materials/test.d.mts.map +1 -1
- package/resources/v1/materials/test.d.ts +111 -8
- package/resources/v1/materials/test.d.ts.map +1 -1
- package/resources/v1/materials/test.js +20 -21
- package/resources/v1/materials/test.js.map +1 -1
- package/resources/v1/materials/test.mjs +20 -21
- package/resources/v1/materials/test.mjs.map +1 -1
- package/resources/v1/materials/upload.d.mts +66 -5
- package/resources/v1/materials/upload.d.mts.map +1 -1
- package/resources/v1/materials/upload.d.ts +66 -5
- package/resources/v1/materials/upload.d.ts.map +1 -1
- package/resources/v1/materials/upload.js +21 -13
- package/resources/v1/materials/upload.js.map +1 -1
- package/resources/v1/materials/upload.mjs +21 -13
- package/resources/v1/materials/upload.mjs.map +1 -1
- package/resources/v1/v1.d.mts +2 -2
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +2 -2
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs.map +1 -1
- package/src/resources/v1/index.ts +7 -0
- package/src/resources/v1/materials/bulk.ts +36 -7
- package/src/resources/v1/materials/index.ts +23 -3
- package/src/resources/v1/materials/materials.ts +302 -58
- package/src/resources/v1/materials/test.ts +141 -25
- package/src/resources/v1/materials/upload.ts +86 -13
- package/src/resources/v1/v1.ts +14 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- 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
|
-
*
|
|
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(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
*
|
|
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(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
};
|
package/src/resources/v1/v1.ts
CHANGED
|
@@ -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.
|
|
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.
|
|
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.
|
|
1
|
+
export declare const VERSION = "1.25.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.25.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|