@or-sdk/files 0.20.1-createfilespackage.4 → 0.20.1-createfilespackage.5
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/dist/types/Files.d.ts +1 -1
- package/package.json +3 -3
- package/src/Files.ts +6 -6
package/dist/types/Files.d.ts
CHANGED
|
@@ -11,5 +11,5 @@ export declare class Files extends Base {
|
|
|
11
11
|
deleteFolder(key: string): Promise<void>;
|
|
12
12
|
getDownloadUrl(key: string, isPublic: boolean): Promise<string>;
|
|
13
13
|
private getUploadUrl;
|
|
14
|
-
uploadFile(file: UploadFileProps): Promise<
|
|
14
|
+
uploadFile(file: UploadFileProps): Promise<void>;
|
|
15
15
|
}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.20.1-createfilespackage.
|
|
2
|
+
"version": "0.20.1-createfilespackage.5",
|
|
3
3
|
"name": "@or-sdk/files",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@or-sdk/base": "^0.20.1-createfilespackage.
|
|
26
|
+
"@or-sdk/base": "^0.20.1-createfilespackage.5"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "5e904e84342b467c86b60bb27ec30e6ee8002c29"
|
|
29
29
|
}
|
package/src/Files.ts
CHANGED
|
@@ -76,7 +76,7 @@ export class Files extends Base {
|
|
|
76
76
|
* Create new folders
|
|
77
77
|
* @param folderName should have folder path + folder name, example: /main/New folder
|
|
78
78
|
*/
|
|
79
|
-
async createFolder(folderName: string) {
|
|
79
|
+
async createFolder(folderName: string): Promise<void> {
|
|
80
80
|
await this.callApi({
|
|
81
81
|
method: 'post',
|
|
82
82
|
route: 'api/files',
|
|
@@ -90,7 +90,7 @@ export class Files extends Base {
|
|
|
90
90
|
* @param newKey new file name
|
|
91
91
|
* @param isPublic does this file public or private
|
|
92
92
|
*/
|
|
93
|
-
async renameFile(key: string, newKey: string, isPublic: boolean) {
|
|
93
|
+
async renameFile(key: string, newKey: string, isPublic: boolean): Promise<void> {
|
|
94
94
|
await this.callApi({
|
|
95
95
|
method: 'put',
|
|
96
96
|
route: 'api/files',
|
|
@@ -108,7 +108,7 @@ export class Files extends Base {
|
|
|
108
108
|
* @param newPrivacy new file privacy
|
|
109
109
|
* @param isPublic does this file public or private
|
|
110
110
|
*/
|
|
111
|
-
async changePrivacy(key: string, newPrivacy: 'private' | 'public', isPublic: boolean) {
|
|
111
|
+
async changePrivacy(key: string, newPrivacy: 'private' | 'public', isPublic: boolean): Promise<void> {
|
|
112
112
|
await this.callApi({
|
|
113
113
|
method: 'patch',
|
|
114
114
|
route: 'api/files',
|
|
@@ -125,7 +125,7 @@ export class Files extends Base {
|
|
|
125
125
|
* @param key file name
|
|
126
126
|
* @param isPublic does this file public or private
|
|
127
127
|
*/
|
|
128
|
-
async deleteFile(key: string, isPublic: boolean) {
|
|
128
|
+
async deleteFile(key: string, isPublic: boolean): Promise<void> {
|
|
129
129
|
// TODO: add error handler and status response true
|
|
130
130
|
await this.callApi({
|
|
131
131
|
method: 'delete',
|
|
@@ -141,7 +141,7 @@ export class Files extends Base {
|
|
|
141
141
|
* Delete folder
|
|
142
142
|
* @param key folder name
|
|
143
143
|
*/
|
|
144
|
-
async deleteFolder(key: string) {
|
|
144
|
+
async deleteFolder(key: string): Promise<void> {
|
|
145
145
|
// TODO: add error handler and status response true
|
|
146
146
|
await this.callApi({
|
|
147
147
|
method: 'delete',
|
|
@@ -189,7 +189,7 @@ export class Files extends Base {
|
|
|
189
189
|
* Upload file to S3 bucket
|
|
190
190
|
* @param file file itself for uploading with prefix (path) and isPublic boolean
|
|
191
191
|
*/
|
|
192
|
-
async uploadFile(file: UploadFileProps) {
|
|
192
|
+
async uploadFile(file: UploadFileProps): Promise<void> {
|
|
193
193
|
const { type, name } = file.fileModel;
|
|
194
194
|
const contentType = type || 'binary/octet-stream';
|
|
195
195
|
|