0.0.34 • Published 6 years ago
@8base/file-server-sdk v0.0.34
Example
import { FileUploadLink } from '@8base/file-server-sdk';
const link = ApolloLink.from([
new FileUploadLink(),
new HttpLink({ uri }),
]);
const client = new ApolloClient({
networkInterface: link,
});
var file = document.getElementById("InputFile").files[0];
file.metadata = {...};
file.public = true; // if you want file to be publically accessible
client.mutate({
mutation: gql`
mutation SomeMutation($fileVariable: ID) {
someMutation(file:$fileVariable) {
fields
...
}
}`,
variables: {
fileVariable: file
}
});
file.upload.onprogress = callbackProgress;
file.upload.onload = callbackLoad;
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
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
git add -A
git commit -m 'version update'
npm version <newversion> # insert your version here (e.g. 0.0.2)
0.0.34
6 years ago
0.0.33
6 years ago
0.0.31
7 years ago
0.0.30
7 years ago
0.0.28
7 years ago
0.0.27
7 years ago
0.0.24
7 years ago
0.0.23
7 years ago
0.0.22
7 years ago
0.0.21
7 years ago
0.0.20
7 years ago
0.0.19
7 years ago
0.0.18
7 years ago
0.0.17
7 years ago
0.0.16
7 years ago
0.0.15
7 years ago
0.0.14
7 years ago
0.0.13
7 years ago
0.0.12
7 years ago
0.0.11
7 years ago
0.0.1
7 years ago