@8base/file-server-sdk
Advanced tools
Comparing version 0.0.18 to 0.0.19
@@ -50,3 +50,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
mutation: gql("\n mutation Mutation {\n uploadFile(filename:\"" + file.name + "\",meta:\"" + metadata + "\") {\n id\n url\n fields\n }\n }") | ||
}).then(function (result) { return FileServer.uploadFile(request, result.data.uploadFile, file); }); | ||
}).then(function (result) { | ||
if (result.errors && result.errors.length) { | ||
request.onerror(result.errors[0]); | ||
throw new Error(result.errors[0]); | ||
} | ||
FileServer.uploadFile(request, result.data.uploadFile, file); | ||
}); | ||
return request; | ||
@@ -66,3 +72,9 @@ }; | ||
}, | ||
next: function (data) { return FileServer.uploadFile(request, data.data.uploadFile, file); } | ||
next: function (data) { | ||
if (data.errors && data.errors.length) { | ||
request.onerror(data.errors[0]); | ||
throw new Error(data.errors[0]); | ||
} | ||
FileServer.uploadFile(request, data.data.uploadFile, file); | ||
} | ||
}); | ||
@@ -69,0 +81,0 @@ return request; |
{ | ||
"name": "@8base/file-server-sdk", | ||
"version": "0.0.18", | ||
"version": "0.0.19", | ||
"description": "JavaScript SDK for working with files at 8base", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -1,2 +0,1 @@ | ||
## Example | ||
@@ -35,2 +34,19 @@ ``` | ||
## Image operations - add at the end of the file download URL: | ||
``` | ||
- /100x /x200 - resize | ||
- /200x100 - fit into rectangle (resize on the larger side) | ||
- /200x100! - force resize | ||
- /100x100:400x400 /100x100: /:400x400 - crop | ||
- /r90 /r-90 - rotate | ||
- /@2 - scale | ||
- /100x100:400x400/100x /r180/@2 - combine | ||
``` | ||
## Publish | ||
@@ -37,0 +53,0 @@ Use this when you need to update the library in NPM. The following command will automatically set the version, create a tag for it, build the package and publish it to NPM |
Sorry, the diff of this file is not supported yet
108311
2627
57