@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.
- package/CHANGELOG.md +19 -0
- package/package.json +1 -1
- package/resources/v1/chat.d.mts +97 -0
- package/resources/v1/chat.d.mts.map +1 -0
- package/resources/v1/chat.d.ts +97 -0
- package/resources/v1/chat.d.ts.map +1 -0
- package/resources/v1/chat.js +31 -0
- package/resources/v1/chat.js.map +1 -0
- package/resources/v1/chat.mjs +27 -0
- package/resources/v1/chat.mjs.map +1 -0
- package/resources/v1/index.d.mts +2 -2
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +2 -2
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +5 -5
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +1 -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 +120 -67
- package/resources/v1/materials/materials.d.mts.map +1 -1
- package/resources/v1/materials/materials.d.ts +120 -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 +7 -17
- package/resources/v1/materials/upload.d.mts.map +1 -1
- package/resources/v1/materials/upload.d.ts +7 -17
- 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 +6 -6
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +6 -6
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +4 -4
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +4 -4
- package/resources/v1/v1.mjs.map +1 -1
- package/src/resources/v1/chat.ts +128 -0
- package/src/resources/v1/index.ts +3 -2
- package/src/resources/v1/materials/index.ts +2 -1
- package/src/resources/v1/materials/materials.ts +152 -86
- package/src/resources/v1/materials/upload.ts +7 -19
- package/src/resources/v1/v1.ts +10 -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,191 +0,0 @@
|
|
|
1
|
-
import { APIResource } from "../../../core/resource.js";
|
|
2
|
-
import { APIPromise } from "../../../core/api-promise.js";
|
|
3
|
-
import { type Uploadable } from "../../../core/uploads.js";
|
|
4
|
-
import { RequestOptions } from "../../../internal/request-options.js";
|
|
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.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/upload/component.ts"],"names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(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Component = void 0;
|
|
5
|
-
const resource_1 = require("../../../core/resource.js");
|
|
6
|
-
const uploads_1 = require("../../../internal/uploads.js");
|
|
7
|
-
const path_1 = require("../../../internal/utils/path.js");
|
|
8
|
-
class Component extends resource_1.APIResource {
|
|
9
|
-
/**
|
|
10
|
-
* Complete a file upload after using presigned URL
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```ts
|
|
14
|
-
* const response =
|
|
15
|
-
* await client.v1.upload.component.completeUpload(
|
|
16
|
-
* 'componentId',
|
|
17
|
-
* {
|
|
18
|
-
* materialId: '507f1f77bcf86cd799439013',
|
|
19
|
-
* organizationId: '507f1f77bcf86cd799439011',
|
|
20
|
-
* s3Key:
|
|
21
|
-
* 'organizations/507f1f77bcf86cd799439011/materials/document.pdf',
|
|
22
|
-
* },
|
|
23
|
-
* );
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
completeUpload(componentID, body, options) {
|
|
27
|
-
return this._client.post((0, path_1.path) `/api/v1/upload/component/${componentID}/complete`, { body, ...options });
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Get a presigned URL for direct file upload
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```ts
|
|
34
|
-
* const response =
|
|
35
|
-
* await client.v1.upload.component.getPresignedURL(
|
|
36
|
-
* 'componentId',
|
|
37
|
-
* {
|
|
38
|
-
* contentType: 'application/pdf',
|
|
39
|
-
* filename: 'document.pdf',
|
|
40
|
-
* folderId: '507f1f77bcf86cd799439012',
|
|
41
|
-
* organizationId: '507f1f77bcf86cd799439011',
|
|
42
|
-
* },
|
|
43
|
-
* );
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
getPresignedURL(componentID, body, options) {
|
|
47
|
-
return this._client.post((0, path_1.path) `/api/v1/upload/component/${componentID}/presigned-url`, {
|
|
48
|
-
body,
|
|
49
|
-
...options,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Upload a file to a component
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* ```ts
|
|
57
|
-
* const fileUploadResponse =
|
|
58
|
-
* await client.v1.upload.component.uploadFile(
|
|
59
|
-
* 'componentId',
|
|
60
|
-
* {
|
|
61
|
-
* file: fs.createReadStream('path/to/file'),
|
|
62
|
-
* folderId: '507f1f77bcf86cd799439012',
|
|
63
|
-
* organizationId: '507f1f77bcf86cd799439011',
|
|
64
|
-
* },
|
|
65
|
-
* );
|
|
66
|
-
* ```
|
|
67
|
-
*/
|
|
68
|
-
uploadFile(componentID, body, options) {
|
|
69
|
-
return this._client.post((0, path_1.path) `/api/v1/upload/component/${componentID}/file`, (0, uploads_1.multipartFormRequestOptions)({ body, ...options }, this._client));
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Upload a file from URL to a component
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* ```ts
|
|
76
|
-
* const fileUploadResponse =
|
|
77
|
-
* await client.v1.upload.component.uploadURL(
|
|
78
|
-
* 'componentId',
|
|
79
|
-
* {
|
|
80
|
-
* folderId: '507f1f77bcf86cd799439012',
|
|
81
|
-
* name: 'my-document.pdf',
|
|
82
|
-
* organizationId: '507f1f77bcf86cd799439011',
|
|
83
|
-
* url: 'https://example.com/document.pdf',
|
|
84
|
-
* },
|
|
85
|
-
* );
|
|
86
|
-
* ```
|
|
87
|
-
*/
|
|
88
|
-
uploadURL(componentID, body, options) {
|
|
89
|
-
return this._client.post((0, path_1.path) `/api/v1/upload/component/${componentID}/url`, { body, ...options });
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
exports.Component = Component;
|
|
93
|
-
//# sourceMappingURL=component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/resources/v1/upload/component.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAIrD,0DAAwE;AACxE,0DAAoD;AAEpD,MAAa,SAAU,SAAQ,sBAAW;IACxC;;;;;;;;;;;;;;;;OAgBG;IACH,cAAc,CACZ,WAAmB,EACnB,IAAmC,EACnC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,4BAA4B,WAAW,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzG,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,eAAe,CACb,WAAmB,EACnB,IAAoC,EACpC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,4BAA4B,WAAW,gBAAgB,EAAE;YACpF,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CACR,WAAmB,EACnB,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,IAAA,WAAI,EAAA,4BAA4B,WAAW,OAAO,EAClD,IAAA,qCAA2B,EAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAChE,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,SAAS,CACP,WAAmB,EACnB,IAA8B,EAC9B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,4BAA4B,WAAW,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;CACF;AAzGD,8BAyGC"}
|
|
@@ -1,89 +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 { multipartFormRequestOptions } from "../../../internal/uploads.mjs";
|
|
4
|
-
import { path } from "../../../internal/utils/path.mjs";
|
|
5
|
-
export 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, body, options) {
|
|
24
|
-
return this._client.post(path `/api/v1/upload/component/${componentID}/complete`, { body, ...options });
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Get a presigned URL for direct file upload
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```ts
|
|
31
|
-
* const response =
|
|
32
|
-
* await client.v1.upload.component.getPresignedURL(
|
|
33
|
-
* 'componentId',
|
|
34
|
-
* {
|
|
35
|
-
* contentType: 'application/pdf',
|
|
36
|
-
* filename: 'document.pdf',
|
|
37
|
-
* folderId: '507f1f77bcf86cd799439012',
|
|
38
|
-
* organizationId: '507f1f77bcf86cd799439011',
|
|
39
|
-
* },
|
|
40
|
-
* );
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
getPresignedURL(componentID, body, options) {
|
|
44
|
-
return this._client.post(path `/api/v1/upload/component/${componentID}/presigned-url`, {
|
|
45
|
-
body,
|
|
46
|
-
...options,
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Upload a file to a component
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* ```ts
|
|
54
|
-
* const fileUploadResponse =
|
|
55
|
-
* await client.v1.upload.component.uploadFile(
|
|
56
|
-
* 'componentId',
|
|
57
|
-
* {
|
|
58
|
-
* file: fs.createReadStream('path/to/file'),
|
|
59
|
-
* folderId: '507f1f77bcf86cd799439012',
|
|
60
|
-
* organizationId: '507f1f77bcf86cd799439011',
|
|
61
|
-
* },
|
|
62
|
-
* );
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
uploadFile(componentID, body, options) {
|
|
66
|
-
return this._client.post(path `/api/v1/upload/component/${componentID}/file`, multipartFormRequestOptions({ body, ...options }, this._client));
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Upload a file from URL to a component
|
|
70
|
-
*
|
|
71
|
-
* @example
|
|
72
|
-
* ```ts
|
|
73
|
-
* const fileUploadResponse =
|
|
74
|
-
* await client.v1.upload.component.uploadURL(
|
|
75
|
-
* 'componentId',
|
|
76
|
-
* {
|
|
77
|
-
* folderId: '507f1f77bcf86cd799439012',
|
|
78
|
-
* name: 'my-document.pdf',
|
|
79
|
-
* organizationId: '507f1f77bcf86cd799439011',
|
|
80
|
-
* url: 'https://example.com/document.pdf',
|
|
81
|
-
* },
|
|
82
|
-
* );
|
|
83
|
-
* ```
|
|
84
|
-
*/
|
|
85
|
-
uploadURL(componentID, body, options) {
|
|
86
|
-
return this._client.post(path `/api/v1/upload/component/${componentID}/url`, { body, ...options });
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
//# sourceMappingURL=component.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component.mjs","sourceRoot":"","sources":["../../../src/resources/v1/upload/component.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,2BAA2B,EAAE;OAC/B,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;;;OAgBG;IACH,cAAc,CACZ,WAAmB,EACnB,IAAmC,EACnC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,4BAA4B,WAAW,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzG,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,eAAe,CACb,WAAmB,EACnB,IAAoC,EACpC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,4BAA4B,WAAW,gBAAgB,EAAE;YACpF,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CACR,WAAmB,EACnB,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,IAAI,CAAA,4BAA4B,WAAW,OAAO,EAClD,2BAA2B,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAChE,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,SAAS,CACP,WAAmB,EACnB,IAA8B,EAC9B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,4BAA4B,WAAW,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;CACF"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { Component, type FileUploadResponse, type ComponentCompleteUploadResponse, type ComponentGetPresignedURLResponse, type ComponentCompleteUploadParams, type ComponentGetPresignedURLParams, type ComponentUploadFileParams, type ComponentUploadURLParams, } from "./component.mjs";
|
|
2
|
-
export { Upload } from "./upload.mjs";
|
|
3
|
-
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/v1/upload/index.ts"],"names":[],"mappings":"OAEO,EACL,SAAS,EACT,KAAK,kBAAkB,EACvB,KAAK,+BAA+B,EACpC,KAAK,gCAAgC,EACrC,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,GAC9B;OACM,EAAE,MAAM,EAAE"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { Component, type FileUploadResponse, type ComponentCompleteUploadResponse, type ComponentGetPresignedURLResponse, type ComponentCompleteUploadParams, type ComponentGetPresignedURLParams, type ComponentUploadFileParams, type ComponentUploadURLParams, } from "./component.js";
|
|
2
|
-
export { Upload } from "./upload.js";
|
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/upload/index.ts"],"names":[],"mappings":"OAEO,EACL,SAAS,EACT,KAAK,kBAAkB,EACvB,KAAK,+BAA+B,EACpC,KAAK,gCAAgC,EACrC,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,GAC9B;OACM,EAAE,MAAM,EAAE"}
|
|
@@ -1,9 +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 = exports.Component = void 0;
|
|
5
|
-
var component_1 = require("./component.js");
|
|
6
|
-
Object.defineProperty(exports, "Component", { enumerable: true, get: function () { return component_1.Component; } });
|
|
7
|
-
var upload_1 = require("./upload.js");
|
|
8
|
-
Object.defineProperty(exports, "Upload", { enumerable: true, get: function () { return upload_1.Upload; } });
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/v1/upload/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,4CASqB;AARnB,sGAAA,SAAS,OAAA;AASX,sCAAkC;AAAzB,gGAAA,MAAM,OAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/v1/upload/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,SAAS,GAQV;OACM,EAAE,MAAM,EAAE"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
-
import * as ComponentAPI from "./component.mjs";
|
|
3
|
-
import { Component, ComponentCompleteUploadParams, ComponentCompleteUploadResponse, ComponentGetPresignedURLParams, ComponentGetPresignedURLResponse, ComponentUploadFileParams, ComponentUploadURLParams, FileUploadResponse } from "./component.mjs";
|
|
4
|
-
export declare class Upload extends APIResource {
|
|
5
|
-
component: ComponentAPI.Component;
|
|
6
|
-
}
|
|
7
|
-
export declare namespace Upload {
|
|
8
|
-
export { Component as Component, 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, };
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=upload.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.mts","sourceRoot":"","sources":["../../../src/resources/v1/upload/upload.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,YAAY;OACjB,EACL,SAAS,EACT,6BAA6B,EAC7B,+BAA+B,EAC/B,8BAA8B,EAC9B,gCAAgC,EAChC,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EACnB;AAED,qBAAa,MAAO,SAAQ,WAAW;IACrC,SAAS,EAAE,YAAY,CAAC,SAAS,CAA4C;CAC9E;AAID,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,SAAS,IAAI,SAAS,EACtB,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { APIResource } from "../../../core/resource.js";
|
|
2
|
-
import * as ComponentAPI from "./component.js";
|
|
3
|
-
import { Component, ComponentCompleteUploadParams, ComponentCompleteUploadResponse, ComponentGetPresignedURLParams, ComponentGetPresignedURLResponse, ComponentUploadFileParams, ComponentUploadURLParams, FileUploadResponse } from "./component.js";
|
|
4
|
-
export declare class Upload extends APIResource {
|
|
5
|
-
component: ComponentAPI.Component;
|
|
6
|
-
}
|
|
7
|
-
export declare namespace Upload {
|
|
8
|
-
export { Component as Component, 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, };
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=upload.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/upload/upload.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,YAAY;OACjB,EACL,SAAS,EACT,6BAA6B,EAC7B,+BAA+B,EAC/B,8BAA8B,EAC9B,gCAAgC,EAChC,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EACnB;AAED,qBAAa,MAAO,SAAQ,WAAW;IACrC,SAAS,EAAE,YAAY,CAAC,SAAS,CAA4C;CAC9E;AAID,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,SAAS,IAAI,SAAS,EACtB,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
|
|
@@ -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"}
|