@studyfetch/sdk 1.29.0 → 1.31.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 +19 -0
- package/package.json +1 -1
- package/resources/v1/chat.d.mts +8 -2
- package/resources/v1/chat.d.mts.map +1 -1
- package/resources/v1/chat.d.ts +8 -2
- package/resources/v1/chat.d.ts.map +1 -1
- package/resources/v1/index.d.mts +1 -2
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +1 -2
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +3 -5
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +0 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/materials/index.d.mts +1 -1
- package/resources/v1/materials/index.d.mts.map +1 -1
- package/resources/v1/materials/index.d.ts +1 -1
- 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.map +1 -1
- package/resources/v1/materials/materials.d.mts +112 -67
- package/resources/v1/materials/materials.d.mts.map +1 -1
- package/resources/v1/materials/materials.d.ts +112 -67
- package/resources/v1/materials/materials.d.ts.map +1 -1
- package/resources/v1/materials/materials.js +18 -1
- package/resources/v1/materials/materials.js.map +1 -1
- package/resources/v1/materials/materials.mjs +18 -1
- package/resources/v1/materials/materials.mjs.map +1 -1
- package/resources/v1/materials/upload.d.mts +6 -16
- package/resources/v1/materials/upload.d.mts.map +1 -1
- package/resources/v1/materials/upload.d.ts +6 -16
- package/resources/v1/materials/upload.d.ts.map +1 -1
- package/resources/v1/materials/upload.js +2 -4
- package/resources/v1/materials/upload.js.map +1 -1
- package/resources/v1/materials/upload.mjs +2 -4
- package/resources/v1/materials/upload.mjs.map +1 -1
- package/resources/v1/v1.d.mts +2 -6
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +2 -6
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +0 -4
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +0 -4
- package/resources/v1/v1.mjs.map +1 -1
- package/src/resources/v1/chat.ts +8 -2
- package/src/resources/v1/index.ts +2 -2
- package/src/resources/v1/materials/index.ts +2 -1
- package/src/resources/v1/materials/materials.ts +142 -86
- package/src/resources/v1/materials/upload.ts +6 -18
- package/src/resources/v1/v1.ts +4 -8
- 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
- package/resources/v1/upload/component.d.mts +0 -191
- package/resources/v1/upload/component.d.mts.map +0 -1
- package/resources/v1/upload/component.d.ts +0 -191
- package/resources/v1/upload/component.d.ts.map +0 -1
- package/resources/v1/upload/component.js +0 -93
- package/resources/v1/upload/component.js.map +0 -1
- package/resources/v1/upload/component.mjs +0 -89
- package/resources/v1/upload/component.mjs.map +0 -1
- package/resources/v1/upload/index.d.mts +0 -3
- package/resources/v1/upload/index.d.mts.map +0 -1
- package/resources/v1/upload/index.d.ts +0 -3
- package/resources/v1/upload/index.d.ts.map +0 -1
- package/resources/v1/upload/index.js +0 -9
- package/resources/v1/upload/index.js.map +0 -1
- package/resources/v1/upload/index.mjs +0 -4
- package/resources/v1/upload/index.mjs.map +0 -1
- package/resources/v1/upload/upload.d.mts +0 -10
- package/resources/v1/upload/upload.d.mts.map +0 -1
- package/resources/v1/upload/upload.d.ts +0 -10
- package/resources/v1/upload/upload.d.ts.map +0 -1
- package/resources/v1/upload/upload.js +0 -17
- package/resources/v1/upload/upload.js.map +0 -1
- package/resources/v1/upload/upload.mjs +0 -12
- package/resources/v1/upload/upload.mjs.map +0 -1
- package/resources/v1/upload.d.mts +0 -2
- package/resources/v1/upload.d.mts.map +0 -1
- package/resources/v1/upload.d.ts +0 -2
- package/resources/v1/upload.d.ts.map +0 -1
- package/resources/v1/upload.js +0 -6
- package/resources/v1/upload.js.map +0 -1
- package/resources/v1/upload.mjs +0 -3
- package/resources/v1/upload.mjs.map +0 -1
- package/src/resources/v1/upload/component.ts +0 -261
- package/src/resources/v1/upload/index.ts +0 -13
- package/src/resources/v1/upload/upload.ts +0 -33
- package/src/resources/v1/upload.ts +0 -3
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Upload = void 0;
|
|
5
|
-
const tslib_1 = require("../../../internal/tslib.js");
|
|
6
|
-
const resource_1 = require("../../../core/resource.js");
|
|
7
|
-
const ComponentAPI = tslib_1.__importStar(require("./component.js"));
|
|
8
|
-
const component_1 = require("./component.js");
|
|
9
|
-
class Upload extends resource_1.APIResource {
|
|
10
|
-
constructor() {
|
|
11
|
-
super(...arguments);
|
|
12
|
-
this.component = new ComponentAPI.Component(this._client);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.Upload = Upload;
|
|
16
|
-
Upload.Component = component_1.Component;
|
|
17
|
-
//# sourceMappingURL=upload.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../../../src/resources/v1/upload/upload.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AACrD,qEAA4C;AAC5C,8CASqB;AAErB,MAAa,MAAO,SAAQ,sBAAW;IAAvC;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/E,CAAC;CAAA;AAFD,wBAEC;AAED,MAAM,CAAC,SAAS,GAAG,qBAAS,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
-
import * as ComponentAPI from "./component.mjs";
|
|
4
|
-
import { Component, } from "./component.mjs";
|
|
5
|
-
export class Upload extends APIResource {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
this.component = new ComponentAPI.Component(this._client);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
Upload.Component = Component;
|
|
12
|
-
//# sourceMappingURL=upload.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload.mjs","sourceRoot":"","sources":["../../../src/resources/v1/upload/upload.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,YAAY;OACjB,EACL,SAAS,GAQV;AAED,MAAM,OAAO,MAAO,SAAQ,WAAW;IAAvC;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/E,CAAC;CAAA;AAED,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.mts","sourceRoot":"","sources":["../../src/resources/v1/upload.ts"],"names":[],"mappings":""}
|
package/resources/v1/upload.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/resources/v1/upload.ts"],"names":[],"mappings":""}
|
package/resources/v1/upload.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
const tslib_1 = require("../../internal/tslib.js");
|
|
5
|
-
tslib_1.__exportStar(require("./upload/index.js"), exports);
|
|
6
|
-
//# sourceMappingURL=upload.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../../src/resources/v1/upload.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,4DAA+B"}
|
package/resources/v1/upload.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload.mjs","sourceRoot":"","sources":["../../src/resources/v1/upload.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../../../core/resource';
|
|
4
|
-
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
-
import { type Uploadable } from '../../../core/uploads';
|
|
6
|
-
import { RequestOptions } from '../../../internal/request-options';
|
|
7
|
-
import { multipartFormRequestOptions } from '../../../internal/uploads';
|
|
8
|
-
import { path } from '../../../internal/utils/path';
|
|
9
|
-
|
|
10
|
-
export class Component extends APIResource {
|
|
11
|
-
/**
|
|
12
|
-
* Complete a file upload after using presigned URL
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```ts
|
|
16
|
-
* const response =
|
|
17
|
-
* await client.v1.upload.component.completeUpload(
|
|
18
|
-
* 'componentId',
|
|
19
|
-
* {
|
|
20
|
-
* materialId: '507f1f77bcf86cd799439013',
|
|
21
|
-
* organizationId: '507f1f77bcf86cd799439011',
|
|
22
|
-
* s3Key:
|
|
23
|
-
* 'organizations/507f1f77bcf86cd799439011/materials/document.pdf',
|
|
24
|
-
* },
|
|
25
|
-
* );
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
completeUpload(
|
|
29
|
-
componentID: string,
|
|
30
|
-
body: ComponentCompleteUploadParams,
|
|
31
|
-
options?: RequestOptions,
|
|
32
|
-
): APIPromise<ComponentCompleteUploadResponse> {
|
|
33
|
-
return this._client.post(path`/api/v1/upload/component/${componentID}/complete`, { body, ...options });
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Get a presigned URL for direct file upload
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```ts
|
|
41
|
-
* const response =
|
|
42
|
-
* await client.v1.upload.component.getPresignedURL(
|
|
43
|
-
* 'componentId',
|
|
44
|
-
* {
|
|
45
|
-
* contentType: 'application/pdf',
|
|
46
|
-
* filename: 'document.pdf',
|
|
47
|
-
* folderId: '507f1f77bcf86cd799439012',
|
|
48
|
-
* organizationId: '507f1f77bcf86cd799439011',
|
|
49
|
-
* },
|
|
50
|
-
* );
|
|
51
|
-
* ```
|
|
52
|
-
*/
|
|
53
|
-
getPresignedURL(
|
|
54
|
-
componentID: string,
|
|
55
|
-
body: ComponentGetPresignedURLParams,
|
|
56
|
-
options?: RequestOptions,
|
|
57
|
-
): APIPromise<ComponentGetPresignedURLResponse> {
|
|
58
|
-
return this._client.post(path`/api/v1/upload/component/${componentID}/presigned-url`, {
|
|
59
|
-
body,
|
|
60
|
-
...options,
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Upload a file to a component
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* ```ts
|
|
69
|
-
* const fileUploadResponse =
|
|
70
|
-
* await client.v1.upload.component.uploadFile(
|
|
71
|
-
* 'componentId',
|
|
72
|
-
* {
|
|
73
|
-
* file: fs.createReadStream('path/to/file'),
|
|
74
|
-
* folderId: '507f1f77bcf86cd799439012',
|
|
75
|
-
* organizationId: '507f1f77bcf86cd799439011',
|
|
76
|
-
* },
|
|
77
|
-
* );
|
|
78
|
-
* ```
|
|
79
|
-
*/
|
|
80
|
-
uploadFile(
|
|
81
|
-
componentID: string,
|
|
82
|
-
body: ComponentUploadFileParams,
|
|
83
|
-
options?: RequestOptions,
|
|
84
|
-
): APIPromise<FileUploadResponse> {
|
|
85
|
-
return this._client.post(
|
|
86
|
-
path`/api/v1/upload/component/${componentID}/file`,
|
|
87
|
-
multipartFormRequestOptions({ body, ...options }, this._client),
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Upload a file from URL to a component
|
|
93
|
-
*
|
|
94
|
-
* @example
|
|
95
|
-
* ```ts
|
|
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
|
-
* );
|
|
106
|
-
* ```
|
|
107
|
-
*/
|
|
108
|
-
uploadURL(
|
|
109
|
-
componentID: string,
|
|
110
|
-
body: ComponentUploadURLParams,
|
|
111
|
-
options?: RequestOptions,
|
|
112
|
-
): APIPromise<FileUploadResponse> {
|
|
113
|
-
return this._client.post(path`/api/v1/upload/component/${componentID}/url`, { body, ...options });
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export interface FileUploadResponse {
|
|
118
|
-
/**
|
|
119
|
-
* The ID of the uploaded material
|
|
120
|
-
*/
|
|
121
|
-
id: string;
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* The content type of the material
|
|
125
|
-
*/
|
|
126
|
-
contentType: string;
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* The name of the material
|
|
130
|
-
*/
|
|
131
|
-
name: string;
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* The S3 key of the uploaded file
|
|
135
|
-
*/
|
|
136
|
-
s3Key: string;
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* The status of the material
|
|
140
|
-
*/
|
|
141
|
-
status: string;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
export interface ComponentCompleteUploadResponse {
|
|
145
|
-
/**
|
|
146
|
-
* The ID of the uploaded material
|
|
147
|
-
*/
|
|
148
|
-
id: string;
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* The name of the material
|
|
152
|
-
*/
|
|
153
|
-
name: string;
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* The status of the material
|
|
157
|
-
*/
|
|
158
|
-
status: string;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export interface ComponentGetPresignedURLResponse {
|
|
162
|
-
/**
|
|
163
|
-
* The S3 key for the file
|
|
164
|
-
*/
|
|
165
|
-
key: string;
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* The presigned URL for uploading
|
|
169
|
-
*/
|
|
170
|
-
uploadUrl: string;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export interface ComponentCompleteUploadParams {
|
|
174
|
-
/**
|
|
175
|
-
* The ID of the material that was uploaded
|
|
176
|
-
*/
|
|
177
|
-
materialId: string;
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* The ID of the organization
|
|
181
|
-
*/
|
|
182
|
-
organizationId: string;
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* The S3 key of the uploaded file
|
|
186
|
-
*/
|
|
187
|
-
s3Key: string;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
export interface ComponentGetPresignedURLParams {
|
|
191
|
-
/**
|
|
192
|
-
* The MIME type of the file
|
|
193
|
-
*/
|
|
194
|
-
contentType: string;
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* The name of the file to upload
|
|
198
|
-
*/
|
|
199
|
-
filename: string;
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* The ID of the folder to upload to
|
|
203
|
-
*/
|
|
204
|
-
folderId: string;
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* The ID of the organization
|
|
208
|
-
*/
|
|
209
|
-
organizationId: string;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
export interface ComponentUploadFileParams {
|
|
213
|
-
/**
|
|
214
|
-
* The file to upload
|
|
215
|
-
*/
|
|
216
|
-
file: Uploadable;
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* The ID of the folder to upload to
|
|
220
|
-
*/
|
|
221
|
-
folderId: string;
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* The ID of the organization
|
|
225
|
-
*/
|
|
226
|
-
organizationId: string;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
export interface ComponentUploadURLParams {
|
|
230
|
-
/**
|
|
231
|
-
* The ID of the folder to upload to
|
|
232
|
-
*/
|
|
233
|
-
folderId: string;
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* The name for the uploaded file
|
|
237
|
-
*/
|
|
238
|
-
name: string;
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* The ID of the organization
|
|
242
|
-
*/
|
|
243
|
-
organizationId: string;
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* The URL of the file to upload
|
|
247
|
-
*/
|
|
248
|
-
url: string;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
export declare namespace Component {
|
|
252
|
-
export {
|
|
253
|
-
type FileUploadResponse as FileUploadResponse,
|
|
254
|
-
type ComponentCompleteUploadResponse as ComponentCompleteUploadResponse,
|
|
255
|
-
type ComponentGetPresignedURLResponse as ComponentGetPresignedURLResponse,
|
|
256
|
-
type ComponentCompleteUploadParams as ComponentCompleteUploadParams,
|
|
257
|
-
type ComponentGetPresignedURLParams as ComponentGetPresignedURLParams,
|
|
258
|
-
type ComponentUploadFileParams as ComponentUploadFileParams,
|
|
259
|
-
type ComponentUploadURLParams as ComponentUploadURLParams,
|
|
260
|
-
};
|
|
261
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
Component,
|
|
5
|
-
type FileUploadResponse,
|
|
6
|
-
type ComponentCompleteUploadResponse,
|
|
7
|
-
type ComponentGetPresignedURLResponse,
|
|
8
|
-
type ComponentCompleteUploadParams,
|
|
9
|
-
type ComponentGetPresignedURLParams,
|
|
10
|
-
type ComponentUploadFileParams,
|
|
11
|
-
type ComponentUploadURLParams,
|
|
12
|
-
} from './component';
|
|
13
|
-
export { Upload } from './upload';
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../../../core/resource';
|
|
4
|
-
import * as ComponentAPI from './component';
|
|
5
|
-
import {
|
|
6
|
-
Component,
|
|
7
|
-
ComponentCompleteUploadParams,
|
|
8
|
-
ComponentCompleteUploadResponse,
|
|
9
|
-
ComponentGetPresignedURLParams,
|
|
10
|
-
ComponentGetPresignedURLResponse,
|
|
11
|
-
ComponentUploadFileParams,
|
|
12
|
-
ComponentUploadURLParams,
|
|
13
|
-
FileUploadResponse,
|
|
14
|
-
} from './component';
|
|
15
|
-
|
|
16
|
-
export class Upload extends APIResource {
|
|
17
|
-
component: ComponentAPI.Component = new ComponentAPI.Component(this._client);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
Upload.Component = Component;
|
|
21
|
-
|
|
22
|
-
export declare namespace Upload {
|
|
23
|
-
export {
|
|
24
|
-
Component as Component,
|
|
25
|
-
type FileUploadResponse as FileUploadResponse,
|
|
26
|
-
type ComponentCompleteUploadResponse as ComponentCompleteUploadResponse,
|
|
27
|
-
type ComponentGetPresignedURLResponse as ComponentGetPresignedURLResponse,
|
|
28
|
-
type ComponentCompleteUploadParams as ComponentCompleteUploadParams,
|
|
29
|
-
type ComponentGetPresignedURLParams as ComponentGetPresignedURLParams,
|
|
30
|
-
type ComponentUploadFileParams as ComponentUploadFileParams,
|
|
31
|
-
type ComponentUploadURLParams as ComponentUploadURLParams,
|
|
32
|
-
};
|
|
33
|
-
}
|