Skip to content

Commit

Permalink
[PBE-000] downgrade axios version (react-native issue) (#584)
Browse files Browse the repository at this point in the history
* chore: downgrade axios version

* chore: fix missing import
  • Loading branch information
xernobyl authored Nov 21, 2023
1 parent 2f70717 commit e79036b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"@babel/runtime": "^7.23.2",
"@types/jsonwebtoken": "^9.0.5",
"@types/qs": "^6.9.10",
"axios": "^1.6.1",
"axios": "0.x",
"faye": "^1.4.0",
"follow-redirects": "1.15.3",
"form-data": "^4.0.0",
Expand Down
3 changes: 2 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as https from 'https';
import * as axios from 'axios';
import * as Faye from 'faye';
import { jwtDecode } from 'jwt-decode';
import AxiosProgressEvent from 'axios';

import { Personalization } from './personalization';
import { Collections } from './collections';
Expand Down Expand Up @@ -671,7 +672,7 @@ export class StreamClient<StreamFeedGenerics extends DefaultGenerics = DefaultGe
uri: string | File | Buffer | NodeJS.ReadStream,
name?: string,
contentType?: string,
onUploadProgress?: (progressEvent: axios.AxiosProgressEvent) => void,
onUploadProgress?: (progressEvent: typeof AxiosProgressEvent) => void,
) {
const fd = utils.addFileToFormData(uri, name, contentType);
return this.doAxiosRequest<FileUploadAPIResponse>('POST', {
Expand Down
4 changes: 2 additions & 2 deletions src/files.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AxiosProgressEvent } from 'axios';
import AxiosProgressEvent from 'axios';
import { StreamClient } from './client';

export class StreamFileStore {
Expand All @@ -25,7 +25,7 @@ export class StreamFileStore {
uri: string | File | Buffer | NodeJS.ReadStream,
name?: string,
contentType?: string,
onUploadProgress?: (progressEvent: AxiosProgressEvent) => void,
onUploadProgress?: (progressEvent: typeof AxiosProgressEvent) => void,
) {
return this.client.upload('files/', uri, name, contentType, onUploadProgress);
}
Expand Down
4 changes: 2 additions & 2 deletions src/images.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AxiosProgressEvent } from 'axios';
import AxiosProgressEvent from 'axios';
import { StreamClient, FileUploadAPIResponse } from './client';

export type ImageProcessOptions = {
Expand Down Expand Up @@ -33,7 +33,7 @@ export class StreamImageStore {
uri: string | File | Buffer | NodeJS.ReadStream,
name?: string,
contentType?: string,
onUploadProgress?: (progressEvent: AxiosProgressEvent) => void,
onUploadProgress?: (progressEvent: typeof AxiosProgressEvent) => void,
) {
return this.client.upload('images/', uri, name, contentType, onUploadProgress);
}
Expand Down
17 changes: 11 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2268,14 +2268,13 @@ aws4@^1.8.0:
resolved "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz"
integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==

axios@^1.6.1:
version "1.6.2"
resolved "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz"
integrity sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==
axios@0.x:
version "0.27.2"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972"
integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==
dependencies:
follow-redirects "^1.15.0"
follow-redirects "^1.14.9"
form-data "^4.0.0"
proxy-from-env "^1.1.0"

b4a@^1.6.4:
version "1.6.4"
Expand Down Expand Up @@ -4395,6 +4394,12 @@ [email protected], follow-redirects@^1.0.0, follow-redirects@^1.15.0:
resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz"
integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==


follow-redirects@^1.14.9:
version "1.15.3"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a"
integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==

for-each@^0.3.3:
version "0.3.3"
resolved "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz"
Expand Down

0 comments on commit e79036b

Please sign in to comment.