@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.
- package/CHANGELOG.md +16 -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/upload/component.d.mts +26 -47
- package/resources/v1/upload/component.d.mts.map +1 -1
- package/resources/v1/upload/component.d.ts +26 -47
- package/resources/v1/upload/component.d.ts.map +1 -1
- package/resources/v1/upload/component.js +11 -10
- package/resources/v1/upload/component.js.map +1 -1
- package/resources/v1/upload/component.mjs +11 -10
- package/resources/v1/upload/component.mjs.map +1 -1
- package/resources/v1/upload/index.d.mts +1 -1
- package/resources/v1/upload/index.d.mts.map +1 -1
- package/resources/v1/upload/index.d.ts +1 -1
- package/resources/v1/upload/index.d.ts.map +1 -1
- package/resources/v1/upload/index.js.map +1 -1
- package/resources/v1/upload/index.mjs.map +1 -1
- package/resources/v1/upload/upload.d.mts +2 -2
- package/resources/v1/upload/upload.d.mts.map +1 -1
- package/resources/v1/upload/upload.d.ts +2 -2
- package/resources/v1/upload/upload.d.ts.map +1 -1
- package/resources/v1/upload/upload.js.map +1 -1
- package/resources/v1/upload/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/upload/component.ts +26 -53
- package/src/resources/v1/upload/index.ts +1 -2
- package/src/resources/v1/upload/upload.ts +2 -4
- 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
|
@@ -5,19 +5,34 @@ import { type Uploadable } from "../../../core/uploads.mjs";
|
|
|
5
5
|
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
6
6
|
export declare class Upload extends APIResource {
|
|
7
7
|
/**
|
|
8
|
+
* Complete upload after using presigned URL
|
|
9
|
+
*
|
|
8
10
|
* @example
|
|
9
11
|
* ```ts
|
|
10
|
-
*
|
|
12
|
+
* const material =
|
|
13
|
+
* await client.v1.materials.upload.completeUpload({
|
|
14
|
+
* materialId: '507f1f77bcf86cd799439013',
|
|
15
|
+
* organizationId: '507f1f77bcf86cd799439011',
|
|
16
|
+
* s3Key:
|
|
17
|
+
* 'organizations/507f1f77bcf86cd799439011/materials/document.pdf',
|
|
18
|
+
* });
|
|
11
19
|
* ```
|
|
12
20
|
*/
|
|
13
|
-
completeUpload(options?: RequestOptions): APIPromise<
|
|
21
|
+
completeUpload(body: UploadCompleteUploadParams, options?: RequestOptions): APIPromise<MaterialsAPI.Material>;
|
|
14
22
|
/**
|
|
23
|
+
* Get presigned URL for direct S3 upload
|
|
24
|
+
*
|
|
15
25
|
* @example
|
|
16
26
|
* ```ts
|
|
17
|
-
*
|
|
27
|
+
* const response =
|
|
28
|
+
* await client.v1.materials.upload.createPresignedURL({
|
|
29
|
+
* contentType: 'application/pdf',
|
|
30
|
+
* filename: 'document.pdf',
|
|
31
|
+
* name: 'Chapter 1 Notes',
|
|
32
|
+
* });
|
|
18
33
|
* ```
|
|
19
34
|
*/
|
|
20
|
-
createPresignedURL(options?: RequestOptions): APIPromise<
|
|
35
|
+
createPresignedURL(body: UploadCreatePresignedURLParams, options?: RequestOptions): APIPromise<UploadCreatePresignedURLResponse>;
|
|
21
36
|
/**
|
|
22
37
|
* Upload a material file
|
|
23
38
|
*
|
|
@@ -45,6 +60,52 @@ export declare class Upload extends APIResource {
|
|
|
45
60
|
*/
|
|
46
61
|
uploadFromURL(body: UploadUploadFromURLParams, options?: RequestOptions): APIPromise<MaterialsAPI.Material>;
|
|
47
62
|
}
|
|
63
|
+
export interface UploadCreatePresignedURLResponse {
|
|
64
|
+
/**
|
|
65
|
+
* Material ID to use for completion
|
|
66
|
+
*/
|
|
67
|
+
materialId: string;
|
|
68
|
+
/**
|
|
69
|
+
* S3 key for the file
|
|
70
|
+
*/
|
|
71
|
+
s3Key: string;
|
|
72
|
+
/**
|
|
73
|
+
* Presigned URL for direct S3 upload
|
|
74
|
+
*/
|
|
75
|
+
uploadUrl: string;
|
|
76
|
+
}
|
|
77
|
+
export interface UploadCompleteUploadParams {
|
|
78
|
+
/**
|
|
79
|
+
* The ID of the material that was uploaded
|
|
80
|
+
*/
|
|
81
|
+
materialId: string;
|
|
82
|
+
/**
|
|
83
|
+
* The ID of the organization
|
|
84
|
+
*/
|
|
85
|
+
organizationId: string;
|
|
86
|
+
/**
|
|
87
|
+
* The S3 key of the uploaded file
|
|
88
|
+
*/
|
|
89
|
+
s3Key: string;
|
|
90
|
+
}
|
|
91
|
+
export interface UploadCreatePresignedURLParams {
|
|
92
|
+
/**
|
|
93
|
+
* MIME type of the file
|
|
94
|
+
*/
|
|
95
|
+
contentType: string;
|
|
96
|
+
/**
|
|
97
|
+
* Filename to upload
|
|
98
|
+
*/
|
|
99
|
+
filename: string;
|
|
100
|
+
/**
|
|
101
|
+
* Display name for the material
|
|
102
|
+
*/
|
|
103
|
+
name: string;
|
|
104
|
+
/**
|
|
105
|
+
* Folder ID to place the material in
|
|
106
|
+
*/
|
|
107
|
+
folderId?: string;
|
|
108
|
+
}
|
|
48
109
|
export interface UploadUploadFileParams {
|
|
49
110
|
file: Uploadable;
|
|
50
111
|
/**
|
|
@@ -71,6 +132,6 @@ export interface UploadUploadFromURLParams {
|
|
|
71
132
|
folderId?: string;
|
|
72
133
|
}
|
|
73
134
|
export declare namespace Upload {
|
|
74
|
-
export { type UploadUploadFileParams as UploadUploadFileParams, type UploadUploadFromURLParams as UploadUploadFromURLParams, };
|
|
135
|
+
export { type UploadCreatePresignedURLResponse as UploadCreatePresignedURLResponse, type UploadCompleteUploadParams as UploadCompleteUploadParams, type UploadCreatePresignedURLParams as UploadCreatePresignedURLParams, type UploadUploadFileParams as UploadUploadFileParams, type UploadUploadFromURLParams as UploadUploadFromURLParams, };
|
|
75
136
|
}
|
|
76
137
|
//# sourceMappingURL=upload.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.mts","sourceRoot":"","sources":["../../../src/resources/v1/materials/upload.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,YAAY;OACjB,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;
|
|
1
|
+
{"version":3,"file":"upload.d.mts","sourceRoot":"","sources":["../../../src/resources/v1/materials/upload.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,YAAY;OACjB,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;OACnB,EAAE,cAAc,EAAE;AAGzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;OAaG;IACH,cAAc,CACZ,IAAI,EAAE,0BAA0B,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC;IAIpC;;;;;;;;;;;;OAYG;IACH,kBAAkB,CAChB,IAAI,EAAE,8BAA8B,EACpC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,gCAAgC,CAAC;IAI/C;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC;IAOrG;;;;;;;;;;;OAWG;IACH,aAAa,CACX,IAAI,EAAE,yBAAy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js";
|
|
|
5
5
|
import { RequestOptions } from "../../../internal/request-options.js";
|
|
6
6
|
export declare class Upload extends APIResource {
|
|
7
7
|
/**
|
|
8
|
+
* Complete upload after using presigned URL
|
|
9
|
+
*
|
|
8
10
|
* @example
|
|
9
11
|
* ```ts
|
|
10
|
-
*
|
|
12
|
+
* const material =
|
|
13
|
+
* await client.v1.materials.upload.completeUpload({
|
|
14
|
+
* materialId: '507f1f77bcf86cd799439013',
|
|
15
|
+
* organizationId: '507f1f77bcf86cd799439011',
|
|
16
|
+
* s3Key:
|
|
17
|
+
* 'organizations/507f1f77bcf86cd799439011/materials/document.pdf',
|
|
18
|
+
* });
|
|
11
19
|
* ```
|
|
12
20
|
*/
|
|
13
|
-
completeUpload(options?: RequestOptions): APIPromise<
|
|
21
|
+
completeUpload(body: UploadCompleteUploadParams, options?: RequestOptions): APIPromise<MaterialsAPI.Material>;
|
|
14
22
|
/**
|
|
23
|
+
* Get presigned URL for direct S3 upload
|
|
24
|
+
*
|
|
15
25
|
* @example
|
|
16
26
|
* ```ts
|
|
17
|
-
*
|
|
27
|
+
* const response =
|
|
28
|
+
* await client.v1.materials.upload.createPresignedURL({
|
|
29
|
+
* contentType: 'application/pdf',
|
|
30
|
+
* filename: 'document.pdf',
|
|
31
|
+
* name: 'Chapter 1 Notes',
|
|
32
|
+
* });
|
|
18
33
|
* ```
|
|
19
34
|
*/
|
|
20
|
-
createPresignedURL(options?: RequestOptions): APIPromise<
|
|
35
|
+
createPresignedURL(body: UploadCreatePresignedURLParams, options?: RequestOptions): APIPromise<UploadCreatePresignedURLResponse>;
|
|
21
36
|
/**
|
|
22
37
|
* Upload a material file
|
|
23
38
|
*
|
|
@@ -45,6 +60,52 @@ export declare class Upload extends APIResource {
|
|
|
45
60
|
*/
|
|
46
61
|
uploadFromURL(body: UploadUploadFromURLParams, options?: RequestOptions): APIPromise<MaterialsAPI.Material>;
|
|
47
62
|
}
|
|
63
|
+
export interface UploadCreatePresignedURLResponse {
|
|
64
|
+
/**
|
|
65
|
+
* Material ID to use for completion
|
|
66
|
+
*/
|
|
67
|
+
materialId: string;
|
|
68
|
+
/**
|
|
69
|
+
* S3 key for the file
|
|
70
|
+
*/
|
|
71
|
+
s3Key: string;
|
|
72
|
+
/**
|
|
73
|
+
* Presigned URL for direct S3 upload
|
|
74
|
+
*/
|
|
75
|
+
uploadUrl: string;
|
|
76
|
+
}
|
|
77
|
+
export interface UploadCompleteUploadParams {
|
|
78
|
+
/**
|
|
79
|
+
* The ID of the material that was uploaded
|
|
80
|
+
*/
|
|
81
|
+
materialId: string;
|
|
82
|
+
/**
|
|
83
|
+
* The ID of the organization
|
|
84
|
+
*/
|
|
85
|
+
organizationId: string;
|
|
86
|
+
/**
|
|
87
|
+
* The S3 key of the uploaded file
|
|
88
|
+
*/
|
|
89
|
+
s3Key: string;
|
|
90
|
+
}
|
|
91
|
+
export interface UploadCreatePresignedURLParams {
|
|
92
|
+
/**
|
|
93
|
+
* MIME type of the file
|
|
94
|
+
*/
|
|
95
|
+
contentType: string;
|
|
96
|
+
/**
|
|
97
|
+
* Filename to upload
|
|
98
|
+
*/
|
|
99
|
+
filename: string;
|
|
100
|
+
/**
|
|
101
|
+
* Display name for the material
|
|
102
|
+
*/
|
|
103
|
+
name: string;
|
|
104
|
+
/**
|
|
105
|
+
* Folder ID to place the material in
|
|
106
|
+
*/
|
|
107
|
+
folderId?: string;
|
|
108
|
+
}
|
|
48
109
|
export interface UploadUploadFileParams {
|
|
49
110
|
file: Uploadable;
|
|
50
111
|
/**
|
|
@@ -71,6 +132,6 @@ export interface UploadUploadFromURLParams {
|
|
|
71
132
|
folderId?: string;
|
|
72
133
|
}
|
|
73
134
|
export declare namespace Upload {
|
|
74
|
-
export { type UploadUploadFileParams as UploadUploadFileParams, type UploadUploadFromURLParams as UploadUploadFromURLParams, };
|
|
135
|
+
export { type UploadCreatePresignedURLResponse as UploadCreatePresignedURLResponse, type UploadCompleteUploadParams as UploadCompleteUploadParams, type UploadCreatePresignedURLParams as UploadCreatePresignedURLParams, type UploadUploadFileParams as UploadUploadFileParams, type UploadUploadFromURLParams as UploadUploadFromURLParams, };
|
|
75
136
|
}
|
|
76
137
|
//# sourceMappingURL=upload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/materials/upload.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,YAAY;OACjB,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/materials/upload.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,YAAY;OACjB,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;OACnB,EAAE,cAAc,EAAE;AAGzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;OAaG;IACH,cAAc,CACZ,IAAI,EAAE,0BAA0B,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC;IAIpC;;;;;;;;;;;;OAYG;IACH,kBAAkB,CAChB,IAAI,EAAE,8BAA8B,EACpC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,gCAAgC,CAAC;IAI/C;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC;IAOrG;;;;;;;;;;;OAWG;IACH,aAAa,CACX,IAAI,EAAE,yBAAyB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC;CAGrC;AAED,MAAM,WAAW,gCAAgC;IAC/C;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,UAAU,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
|
|
@@ -3,32 +3,40 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Upload = void 0;
|
|
5
5
|
const resource_1 = require("../../../core/resource.js");
|
|
6
|
-
const headers_1 = require("../../../internal/headers.js");
|
|
7
6
|
const uploads_1 = require("../../../internal/uploads.js");
|
|
8
7
|
class Upload extends resource_1.APIResource {
|
|
9
8
|
/**
|
|
9
|
+
* Complete upload after using presigned URL
|
|
10
|
+
*
|
|
10
11
|
* @example
|
|
11
12
|
* ```ts
|
|
12
|
-
*
|
|
13
|
+
* const material =
|
|
14
|
+
* await client.v1.materials.upload.completeUpload({
|
|
15
|
+
* materialId: '507f1f77bcf86cd799439013',
|
|
16
|
+
* organizationId: '507f1f77bcf86cd799439011',
|
|
17
|
+
* s3Key:
|
|
18
|
+
* 'organizations/507f1f77bcf86cd799439011/materials/document.pdf',
|
|
19
|
+
* });
|
|
13
20
|
* ```
|
|
14
21
|
*/
|
|
15
|
-
completeUpload(options) {
|
|
16
|
-
return this._client.post('/api/v1/materials/upload/complete', {
|
|
17
|
-
...options,
|
|
18
|
-
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
19
|
-
});
|
|
22
|
+
completeUpload(body, options) {
|
|
23
|
+
return this._client.post('/api/v1/materials/upload/complete', { body, ...options });
|
|
20
24
|
}
|
|
21
25
|
/**
|
|
26
|
+
* Get presigned URL for direct S3 upload
|
|
27
|
+
*
|
|
22
28
|
* @example
|
|
23
29
|
* ```ts
|
|
24
|
-
*
|
|
30
|
+
* const response =
|
|
31
|
+
* await client.v1.materials.upload.createPresignedURL({
|
|
32
|
+
* contentType: 'application/pdf',
|
|
33
|
+
* filename: 'document.pdf',
|
|
34
|
+
* name: 'Chapter 1 Notes',
|
|
35
|
+
* });
|
|
25
36
|
* ```
|
|
26
37
|
*/
|
|
27
|
-
createPresignedURL(options) {
|
|
28
|
-
return this._client.post('/api/v1/materials/upload/presigned-url', {
|
|
29
|
-
...options,
|
|
30
|
-
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
31
|
-
});
|
|
38
|
+
createPresignedURL(body, options) {
|
|
39
|
+
return this._client.post('/api/v1/materials/upload/presigned-url', { body, ...options });
|
|
32
40
|
}
|
|
33
41
|
/**
|
|
34
42
|
* Upload a material file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../../../src/resources/v1/materials/upload.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;
|
|
1
|
+
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../../../src/resources/v1/materials/upload.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAKrD,0DAAwE;AAExE,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;;;;;;;;;;;OAaG;IACH,cAAc,CACZ,IAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mCAAmC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtF,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,kBAAkB,CAChB,IAAoC,EACpC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,wCAAwC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3F,CAAC;IAED;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,IAA4B,EAAE,OAAwB;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,0BAA0B,EAC1B,IAAA,qCAA2B,EAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAChE,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;OAWG;IACH,aAAa,CACX,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,8BAA8B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;CACF;AA/ED,wBA+EC"}
|
|
@@ -1,31 +1,39 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
-
import { buildHeaders } from "../../../internal/headers.mjs";
|
|
4
3
|
import { multipartFormRequestOptions } from "../../../internal/uploads.mjs";
|
|
5
4
|
export class Upload extends APIResource {
|
|
6
5
|
/**
|
|
6
|
+
* Complete upload after using presigned URL
|
|
7
|
+
*
|
|
7
8
|
* @example
|
|
8
9
|
* ```ts
|
|
9
|
-
*
|
|
10
|
+
* const material =
|
|
11
|
+
* await client.v1.materials.upload.completeUpload({
|
|
12
|
+
* materialId: '507f1f77bcf86cd799439013',
|
|
13
|
+
* organizationId: '507f1f77bcf86cd799439011',
|
|
14
|
+
* s3Key:
|
|
15
|
+
* 'organizations/507f1f77bcf86cd799439011/materials/document.pdf',
|
|
16
|
+
* });
|
|
10
17
|
* ```
|
|
11
18
|
*/
|
|
12
|
-
completeUpload(options) {
|
|
13
|
-
return this._client.post('/api/v1/materials/upload/complete', {
|
|
14
|
-
...options,
|
|
15
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
16
|
-
});
|
|
19
|
+
completeUpload(body, options) {
|
|
20
|
+
return this._client.post('/api/v1/materials/upload/complete', { body, ...options });
|
|
17
21
|
}
|
|
18
22
|
/**
|
|
23
|
+
* Get presigned URL for direct S3 upload
|
|
24
|
+
*
|
|
19
25
|
* @example
|
|
20
26
|
* ```ts
|
|
21
|
-
*
|
|
27
|
+
* const response =
|
|
28
|
+
* await client.v1.materials.upload.createPresignedURL({
|
|
29
|
+
* contentType: 'application/pdf',
|
|
30
|
+
* filename: 'document.pdf',
|
|
31
|
+
* name: 'Chapter 1 Notes',
|
|
32
|
+
* });
|
|
22
33
|
* ```
|
|
23
34
|
*/
|
|
24
|
-
createPresignedURL(options) {
|
|
25
|
-
return this._client.post('/api/v1/materials/upload/presigned-url', {
|
|
26
|
-
...options,
|
|
27
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
28
|
-
});
|
|
35
|
+
createPresignedURL(body, options) {
|
|
36
|
+
return this._client.post('/api/v1/materials/upload/presigned-url', { body, ...options });
|
|
29
37
|
}
|
|
30
38
|
/**
|
|
31
39
|
* Upload a material file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.mjs","sourceRoot":"","sources":["../../../src/resources/v1/materials/upload.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"upload.mjs","sourceRoot":"","sources":["../../../src/resources/v1/materials/upload.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAKf,EAAE,2BAA2B,EAAE;AAEtC,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;OAaG;IACH,cAAc,CACZ,IAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mCAAmC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtF,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,kBAAkB,CAChB,IAAoC,EACpC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,wCAAwC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3F,CAAC;IAED;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,IAA4B,EAAE,OAAwB;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,0BAA0B,EAC1B,2BAA2B,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAChE,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;OAWG;IACH,aAAa,CACX,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,8BAA8B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;CACF"}
|
|
@@ -44,7 +44,7 @@ export declare class Component extends APIResource {
|
|
|
44
44
|
*
|
|
45
45
|
* @example
|
|
46
46
|
* ```ts
|
|
47
|
-
* const
|
|
47
|
+
* const fileUploadResponse =
|
|
48
48
|
* await client.v1.upload.component.uploadFile(
|
|
49
49
|
* 'componentId',
|
|
50
50
|
* {
|
|
@@ -55,50 +55,27 @@ export declare class Component extends APIResource {
|
|
|
55
55
|
* );
|
|
56
56
|
* ```
|
|
57
57
|
*/
|
|
58
|
-
uploadFile(componentID: string, body: ComponentUploadFileParams, options?: RequestOptions): APIPromise<
|
|
58
|
+
uploadFile(componentID: string, body: ComponentUploadFileParams, options?: RequestOptions): APIPromise<FileUploadResponse>;
|
|
59
59
|
/**
|
|
60
60
|
* Upload a file from URL to a component
|
|
61
61
|
*
|
|
62
62
|
* @example
|
|
63
63
|
* ```ts
|
|
64
|
-
* const
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
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
|
+
* );
|
|
73
74
|
* ```
|
|
74
75
|
*/
|
|
75
|
-
uploadURL(componentID: string, body: ComponentUploadURLParams, options?: RequestOptions): APIPromise<
|
|
76
|
-
}
|
|
77
|
-
export interface ComponentCompleteUploadResponse {
|
|
78
|
-
/**
|
|
79
|
-
* The ID of the uploaded material
|
|
80
|
-
*/
|
|
81
|
-
id: string;
|
|
82
|
-
/**
|
|
83
|
-
* The name of the material
|
|
84
|
-
*/
|
|
85
|
-
name: string;
|
|
86
|
-
/**
|
|
87
|
-
* The status of the material
|
|
88
|
-
*/
|
|
89
|
-
status: string;
|
|
90
|
-
}
|
|
91
|
-
export interface ComponentGetPresignedURLResponse {
|
|
92
|
-
/**
|
|
93
|
-
* The S3 key for the file
|
|
94
|
-
*/
|
|
95
|
-
key: string;
|
|
96
|
-
/**
|
|
97
|
-
* The presigned URL for uploading
|
|
98
|
-
*/
|
|
99
|
-
uploadUrl: string;
|
|
76
|
+
uploadURL(componentID: string, body: ComponentUploadURLParams, options?: RequestOptions): APIPromise<FileUploadResponse>;
|
|
100
77
|
}
|
|
101
|
-
export interface
|
|
78
|
+
export interface FileUploadResponse {
|
|
102
79
|
/**
|
|
103
80
|
* The ID of the uploaded material
|
|
104
81
|
*/
|
|
@@ -120,28 +97,30 @@ export interface ComponentUploadFileResponse {
|
|
|
120
97
|
*/
|
|
121
98
|
status: string;
|
|
122
99
|
}
|
|
123
|
-
export interface
|
|
100
|
+
export interface ComponentCompleteUploadResponse {
|
|
124
101
|
/**
|
|
125
102
|
* The ID of the uploaded material
|
|
126
103
|
*/
|
|
127
104
|
id: string;
|
|
128
|
-
/**
|
|
129
|
-
* The content type of the material
|
|
130
|
-
*/
|
|
131
|
-
contentType: string;
|
|
132
105
|
/**
|
|
133
106
|
* The name of the material
|
|
134
107
|
*/
|
|
135
108
|
name: string;
|
|
136
|
-
/**
|
|
137
|
-
* The S3 key of the uploaded file
|
|
138
|
-
*/
|
|
139
|
-
s3Key: string;
|
|
140
109
|
/**
|
|
141
110
|
* The status of the material
|
|
142
111
|
*/
|
|
143
112
|
status: string;
|
|
144
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
|
+
}
|
|
145
124
|
export interface ComponentCompleteUploadParams {
|
|
146
125
|
/**
|
|
147
126
|
* The ID of the material that was uploaded
|
|
@@ -207,6 +186,6 @@ export interface ComponentUploadURLParams {
|
|
|
207
186
|
url: string;
|
|
208
187
|
}
|
|
209
188
|
export declare namespace Component {
|
|
210
|
-
export { type
|
|
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, };
|
|
211
190
|
}
|
|
212
191
|
//# sourceMappingURL=component.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.mts","sourceRoot":"","sources":["../../../src/resources/v1/upload/component.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;OACnB,EAAE,cAAc,EAAE;AAIzB,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;;;OAgBG;IACH,cAAc,CACZ,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,6BAA6B,EACnC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,+BAA+B,CAAC;IAI9C;;;;;;;;;;;;;;;;OAgBG;IACH,eAAe,CACb,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,8BAA8B,EACpC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,gCAAgC,CAAC;IAO/C;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CACR,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,yBAAyB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"component.d.mts","sourceRoot":"","sources":["../../../src/resources/v1/upload/component.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EA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MAAM,CAAC;CACnB;AAED,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,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"}
|
|
@@ -44,7 +44,7 @@ export declare class Component extends APIResource {
|
|
|
44
44
|
*
|
|
45
45
|
* @example
|
|
46
46
|
* ```ts
|
|
47
|
-
* const
|
|
47
|
+
* const fileUploadResponse =
|
|
48
48
|
* await client.v1.upload.component.uploadFile(
|
|
49
49
|
* 'componentId',
|
|
50
50
|
* {
|
|
@@ -55,50 +55,27 @@ export declare class Component extends APIResource {
|
|
|
55
55
|
* );
|
|
56
56
|
* ```
|
|
57
57
|
*/
|
|
58
|
-
uploadFile(componentID: string, body: ComponentUploadFileParams, options?: RequestOptions): APIPromise<
|
|
58
|
+
uploadFile(componentID: string, body: ComponentUploadFileParams, options?: RequestOptions): APIPromise<FileUploadResponse>;
|
|
59
59
|
/**
|
|
60
60
|
* Upload a file from URL to a component
|
|
61
61
|
*
|
|
62
62
|
* @example
|
|
63
63
|
* ```ts
|
|
64
|
-
* const
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
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
|
+
* );
|
|
73
74
|
* ```
|
|
74
75
|
*/
|
|
75
|
-
uploadURL(componentID: string, body: ComponentUploadURLParams, options?: RequestOptions): APIPromise<
|
|
76
|
-
}
|
|
77
|
-
export interface ComponentCompleteUploadResponse {
|
|
78
|
-
/**
|
|
79
|
-
* The ID of the uploaded material
|
|
80
|
-
*/
|
|
81
|
-
id: string;
|
|
82
|
-
/**
|
|
83
|
-
* The name of the material
|
|
84
|
-
*/
|
|
85
|
-
name: string;
|
|
86
|
-
/**
|
|
87
|
-
* The status of the material
|
|
88
|
-
*/
|
|
89
|
-
status: string;
|
|
90
|
-
}
|
|
91
|
-
export interface ComponentGetPresignedURLResponse {
|
|
92
|
-
/**
|
|
93
|
-
* The S3 key for the file
|
|
94
|
-
*/
|
|
95
|
-
key: string;
|
|
96
|
-
/**
|
|
97
|
-
* The presigned URL for uploading
|
|
98
|
-
*/
|
|
99
|
-
uploadUrl: string;
|
|
76
|
+
uploadURL(componentID: string, body: ComponentUploadURLParams, options?: RequestOptions): APIPromise<FileUploadResponse>;
|
|
100
77
|
}
|
|
101
|
-
export interface
|
|
78
|
+
export interface FileUploadResponse {
|
|
102
79
|
/**
|
|
103
80
|
* The ID of the uploaded material
|
|
104
81
|
*/
|
|
@@ -120,28 +97,30 @@ export interface ComponentUploadFileResponse {
|
|
|
120
97
|
*/
|
|
121
98
|
status: string;
|
|
122
99
|
}
|
|
123
|
-
export interface
|
|
100
|
+
export interface ComponentCompleteUploadResponse {
|
|
124
101
|
/**
|
|
125
102
|
* The ID of the uploaded material
|
|
126
103
|
*/
|
|
127
104
|
id: string;
|
|
128
|
-
/**
|
|
129
|
-
* The content type of the material
|
|
130
|
-
*/
|
|
131
|
-
contentType: string;
|
|
132
105
|
/**
|
|
133
106
|
* The name of the material
|
|
134
107
|
*/
|
|
135
108
|
name: string;
|
|
136
|
-
/**
|
|
137
|
-
* The S3 key of the uploaded file
|
|
138
|
-
*/
|
|
139
|
-
s3Key: string;
|
|
140
109
|
/**
|
|
141
110
|
* The status of the material
|
|
142
111
|
*/
|
|
143
112
|
status: string;
|
|
144
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
|
+
}
|
|
145
124
|
export interface ComponentCompleteUploadParams {
|
|
146
125
|
/**
|
|
147
126
|
* The ID of the material that was uploaded
|
|
@@ -207,6 +186,6 @@ export interface ComponentUploadURLParams {
|
|
|
207
186
|
url: string;
|
|
208
187
|
}
|
|
209
188
|
export declare namespace Component {
|
|
210
|
-
export { type
|
|
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, };
|
|
211
190
|
}
|
|
212
191
|
//# sourceMappingURL=component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/upload/component.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;OACnB,EAAE,cAAc,EAAE;AAIzB,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;;;OAgBG;IACH,cAAc,CACZ,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,6BAA6B,EACnC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,+BAA+B,CAAC;IAI9C;;;;;;;;;;;;;;;;OAgBG;IACH,eAAe,CACb,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,8BAA8B,EACpC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,gCAAgC,CAAC;IAO/C;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CACR,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,yBAAyB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/upload/component.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;OACnB,EAAE,cAAc,EAAE;AAIzB,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;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CAAC;IAEvB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,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"}
|
|
@@ -54,7 +54,7 @@ class Component extends resource_1.APIResource {
|
|
|
54
54
|
*
|
|
55
55
|
* @example
|
|
56
56
|
* ```ts
|
|
57
|
-
* const
|
|
57
|
+
* const fileUploadResponse =
|
|
58
58
|
* await client.v1.upload.component.uploadFile(
|
|
59
59
|
* 'componentId',
|
|
60
60
|
* {
|
|
@@ -73,15 +73,16 @@ class Component extends resource_1.APIResource {
|
|
|
73
73
|
*
|
|
74
74
|
* @example
|
|
75
75
|
* ```ts
|
|
76
|
-
* const
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
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
|
+
* );
|
|
85
86
|
* ```
|
|
86
87
|
*/
|
|
87
88
|
uploadURL(componentID, body, options) {
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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"}
|