Skip to content

Commit e79036b

Browse files
authored
[PBE-000] downgrade axios version (react-native issue) (#584)
* chore: downgrade axios version * chore: fix missing import
1 parent 2f70717 commit e79036b

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
"@babel/runtime": "^7.23.2",
113113
"@types/jsonwebtoken": "^9.0.5",
114114
"@types/qs": "^6.9.10",
115-
"axios": "^1.6.1",
115+
"axios": "0.x",
116116
"faye": "^1.4.0",
117117
"follow-redirects": "1.15.3",
118118
"form-data": "^4.0.0",

src/client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import * as https from 'https';
55
import * as axios from 'axios';
66
import * as Faye from 'faye';
77
import { jwtDecode } from 'jwt-decode';
8+
import AxiosProgressEvent from 'axios';
89

910
import { Personalization } from './personalization';
1011
import { Collections } from './collections';
@@ -671,7 +672,7 @@ export class StreamClient<StreamFeedGenerics extends DefaultGenerics = DefaultGe
671672
uri: string | File | Buffer | NodeJS.ReadStream,
672673
name?: string,
673674
contentType?: string,
674-
onUploadProgress?: (progressEvent: axios.AxiosProgressEvent) => void,
675+
onUploadProgress?: (progressEvent: typeof AxiosProgressEvent) => void,
675676
) {
676677
const fd = utils.addFileToFormData(uri, name, contentType);
677678
return this.doAxiosRequest<FileUploadAPIResponse>('POST', {

src/files.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AxiosProgressEvent } from 'axios';
1+
import AxiosProgressEvent from 'axios';
22
import { StreamClient } from './client';
33

44
export class StreamFileStore {
@@ -25,7 +25,7 @@ export class StreamFileStore {
2525
uri: string | File | Buffer | NodeJS.ReadStream,
2626
name?: string,
2727
contentType?: string,
28-
onUploadProgress?: (progressEvent: AxiosProgressEvent) => void,
28+
onUploadProgress?: (progressEvent: typeof AxiosProgressEvent) => void,
2929
) {
3030
return this.client.upload('files/', uri, name, contentType, onUploadProgress);
3131
}

src/images.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AxiosProgressEvent } from 'axios';
1+
import AxiosProgressEvent from 'axios';
22
import { StreamClient, FileUploadAPIResponse } from './client';
33

44
export type ImageProcessOptions = {
@@ -33,7 +33,7 @@ export class StreamImageStore {
3333
uri: string | File | Buffer | NodeJS.ReadStream,
3434
name?: string,
3535
contentType?: string,
36-
onUploadProgress?: (progressEvent: AxiosProgressEvent) => void,
36+
onUploadProgress?: (progressEvent: typeof AxiosProgressEvent) => void,
3737
) {
3838
return this.client.upload('images/', uri, name, contentType, onUploadProgress);
3939
}

yarn.lock

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,14 +2268,13 @@ aws4@^1.8.0:
22682268
resolved "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz"
22692269
integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==
22702270

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

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

4397+
4398+
follow-redirects@^1.14.9:
4399+
version "1.15.3"
4400+
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a"
4401+
integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==
4402+
43984403
for-each@^0.3.3:
43994404
version "0.3.3"
44004405
resolved "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz"

0 commit comments

Comments
 (0)