Skip to content

Commit

Permalink
feat(picker): Add onFileCropped callback (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
pcholuj authored Jul 25, 2019
1 parent 71f38b1 commit a598ea6
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 6 deletions.
34 changes: 34 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"@babel/core": "^7.5.4",
"@babel/preset-env": "^7.5.4",
"@purtuga/esm-webpack-plugin": "^1.1.1",
"@sentry/cli": "^1.46.0",
"@types/jest": "^24.0.15",
"@types/mime": "^2.0.1",
"@types/node": "^12.6.2",
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* @private
*/
const PICKER_VERSION = '1.8.0';
const PICKER_VERSION = '1.9.0';

/**
* @private
Expand Down
6 changes: 3 additions & 3 deletions src/lib/api/upload/uploaders/s3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ export class S3Uploader extends UploaderAbstract {
.catch(err => {
debug(`[${id}] Start request error %O`, err);
this.setPayloadStatus(id, FileState.FAILED);
return Promise.reject(new FilestackError('Cannot upload file', {
return Promise.reject(new FilestackError('Cannot upload file. Start request failed', {
code: err.response.status,
data: err.response.data,
headers: err.response.headers,
Expand Down Expand Up @@ -562,7 +562,7 @@ export class S3Uploader extends UploaderAbstract {
part = null;
chunk = null;

return Promise.reject(new FilestackError('Cannot upload file part', {
return Promise.reject(new FilestackError('Cannot upload file part (FII)', {
code: err.response.status,
data: err.response.data,
headers: err.response.headers,
Expand Down Expand Up @@ -601,7 +601,7 @@ export class S3Uploader extends UploaderAbstract {

return res;
}).catch((err) => {
return Promise.reject(new FilestackError('Cannot upload file part', {
return Promise.reject(new FilestackError('Cannot commit file part metadata', {
code: err.response.status,
data: err.response.data,
headers: err.response.headers,
Expand Down
4 changes: 2 additions & 2 deletions src/lib/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ export class Client extends EventEmitter {

/* istanbul ignore next */
Sentry.configureScope(scope => {
scope.setExtra('apikey', apikey);
scope.setTag('apikey', apikey);
scope.setTag('sdk-version', getVersion());
scope.setExtra('clientOptions', options);
scope.setTag('version', getVersion());
});

if (!apikey || typeof apikey !== 'string' || apikey.length === 0) {
Expand Down
4 changes: 4 additions & 0 deletions src/lib/picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,10 @@ export interface PickerOptions {
* Called during multi-part upload progress events. Local files only.
*/
onFileUploadProgress?: PickerFileProgressCallback;
/**
* Called when file is cropped in picker
*/
onFileCropped?: PickerFileCallback;
/**
* Called when uploading starts (user initiates uploading).
*/
Expand Down

0 comments on commit a598ea6

Please sign in to comment.