@sprucelabs/spruce-file-utils 15.1.9 → 15.1.10
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.
@@ -0,0 +1,21 @@
|
|
1
|
+
import AbstractSpruceError from '@sprucelabs/error';
|
2
|
+
export default class SpruceError extends AbstractSpruceError {
|
3
|
+
friendlyMessage() {
|
4
|
+
const { options } = this;
|
5
|
+
let message;
|
6
|
+
switch (options === null || options === void 0 ? void 0 : options.code) {
|
7
|
+
case 'UNAUTHORIZED':
|
8
|
+
message = 'You are not authorized to perform this action.';
|
9
|
+
break;
|
10
|
+
case 'BAD_REQUEST':
|
11
|
+
message = 'A Bad request just happened!';
|
12
|
+
break;
|
13
|
+
default:
|
14
|
+
message = super.friendlyMessage();
|
15
|
+
}
|
16
|
+
const fullMessage = options.friendlyMessage
|
17
|
+
? options.friendlyMessage
|
18
|
+
: message;
|
19
|
+
return fullMessage;
|
20
|
+
}
|
21
|
+
}
|
@@ -3,3 +3,4 @@ export * from './uploading/FileUploader';
|
|
3
3
|
export { default as ChunkingUploaderImpl } from './uploading/ChunkingUploader';
|
4
4
|
export * from './uploading/ChunkingUploader';
|
5
5
|
export { default as MockChunkingUploader } from './uploading/MockChunkingUploader';
|
6
|
+
export { UploadedFile } from './files.types';
|
package/build/index-module.d.ts
CHANGED
@@ -3,3 +3,4 @@ export * from './uploading/FileUploader';
|
|
3
3
|
export { default as ChunkingUploaderImpl } from './uploading/ChunkingUploader';
|
4
4
|
export * from './uploading/ChunkingUploader';
|
5
5
|
export { default as MockChunkingUploader } from './uploading/MockChunkingUploader';
|
6
|
+
export { UploadedFile } from './files.types';
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sprucelabs/spruce-file-utils",
|
3
3
|
"description": "Utils for working with files and Sprucebot.",
|
4
|
-
"version": "15.1.
|
4
|
+
"version": "15.1.10",
|
5
5
|
"skill": {
|
6
6
|
"namespace": "files"
|
7
7
|
},
|
@@ -36,6 +36,8 @@
|
|
36
36
|
"build/uploading/MockChunkingUploader.js",
|
37
37
|
|
38
38
|
|
39
|
+
"build/esm/errors/SpruceError.d.ts",
|
40
|
+
"build/esm/errors/SpruceError.js",
|
39
41
|
"build/errors/SpruceError.d.ts",
|
40
42
|
"build/errors/SpruceError.js",
|
41
43
|
|