Skip to content

Commit

Permalink
fix(ali-oss): delete return type incorrect (netless-io#641)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackHole1 authored Aug 15, 2022
1 parent f27cf56 commit d730136
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 24 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"devDependencies": {
"@commitlint/cli": "^17.0.3",
"@commitlint/config-angular": "^17.0.3",
"@types/ali-oss": "^6.0.7",
"@types/ali-oss": "^6.16.4",
"@types/bull": "^3.15.8",
"@types/dotenv-flow": "^3.1.1",
"@types/fs-extra": "^9.0.11",
Expand Down Expand Up @@ -68,7 +68,7 @@
"@sinclair/typebox": "^0.23.5",
"agora-access-token": "^2.0.4",
"ajv": "^8.11.0",
"ali-oss": "^6.14.0",
"ali-oss": "^6.17.1",
"awesome-phonenumber": "^2.70.0",
"axios": "^0.21.2",
"bull": "^4.8.2",
Expand Down
4 changes: 3 additions & 1 deletion src/v2/services/oss/__tests__/ali-oss.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ test.afterEach(() => {

test.serial(`${namespace} - remove single file`, async ava => {
const returnStub = sinon.stub().resolves({
status: "ok",
res: {
status: "ok",
},
});

deleteStub.callsFake((name: string) => returnStub(name));
Expand Down
3 changes: 1 addition & 2 deletions src/v2/services/oss/ali-oss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export class AliOSSService extends OSSAbstract {
super();
}

// @ts-ignore
public async remove(fileList: string | string[]): Promise<void> {
this.logger.debug("remove file", {
AliOSS: {
Expand All @@ -27,7 +26,7 @@ export class AliOSSService extends OSSAbstract {
this.logger.debug("remove file done", {
AliOSS: {
removeFile: fileList,
removeStatus: result.status,
removeStatus: result.res.status,
},
});
return;
Expand Down
7 changes: 7 additions & 0 deletions typings/ali-oss.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import "ali-oss";

declare module "ali-oss" {
interface NormalSuccessResponse {
res: Omit<import("ali-oss").NormalSuccessResponse, "res">;
}
}
32 changes: 13 additions & 19 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -531,10 +531,10 @@
resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.2.tgz#423c77877d0569db20e1fc80885ac4118314010e"
integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==

"@types/ali-oss@^6.0.7":
version "6.0.8"
resolved "https://registry.yarnpkg.com/@types/ali-oss/-/ali-oss-6.0.8.tgz#55ff45aba7e61e97998109932c1334db7bce9ea6"
integrity sha512-uXTUrMoYJK9a2iebOzEqUHnJ9Wz1ebh+XlghjXd1KM/E3zxt6qjbj0A5p/bGudwtW8zrEWWTdjTv+tSweD2FmQ==
"@types/ali-oss@^6.16.4":
version "6.16.4"
resolved "https://registry.yarnpkg.com/@types/ali-oss/-/ali-oss-6.16.4.tgz#2927e6b940a49c2828609c0f73ff407ded0626d1"
integrity sha512-jcPp0qugBVcuFtewnlCVnpVDFqkNiGIklXHzq8kftFVXlBBYmVdAUYasyz1UGPMtF4qkbbAVToUxJnee+ky+NQ==

"@types/bull@^3.15.8":
version "3.15.8"
Expand Down Expand Up @@ -1090,15 +1090,14 @@ ajv@^8.0.0, ajv@^8.1.0, ajv@^8.10.0, ajv@^8.11.0, ajv@^8.8.0:
require-from-string "^2.0.2"
uri-js "^4.2.2"

ali-oss@^6.14.0:
version "6.15.2"
resolved "https://registry.yarnpkg.com/ali-oss/-/ali-oss-6.15.2.tgz#276c3bdff5f89460ac9feac8d1d2a0bc32a18d6c"
integrity sha512-sLB3a2Q6BvD4fNfHO4a0uuVn+5dlFaWUE/tExFk8bNMTevNGb4hH419kyvTSvKsO8FGLIhyezdi2NVhLHwhPqA==
ali-oss@^6.17.1:
version "6.17.1"
resolved "https://registry.yarnpkg.com/ali-oss/-/ali-oss-6.17.1.tgz#3e88738ec01111a26a2b967cf857d97050886156"
integrity sha512-v2oT3UhSJTH/LrsscVvi7iEGrnundydNaFzpYAKatqOl4JNcBV4UiwtlJU+ZHLys040JH2k+CutznA0GoE+P2w==
dependencies:
address "^1.0.0"
agentkeepalive "^3.4.1"
bowser "^1.6.0"
co-defer "^1.0.0"
copy-to "^2.0.1"
dateformat "^2.0.0"
debug "^2.2.0"
Expand All @@ -1108,7 +1107,7 @@ ali-oss@^6.14.0:
humanize-ms "^1.2.0"
is-type-of "^1.0.0"
js-base64 "^2.5.2"
jstoxml "^0.2.3"
jstoxml "^2.0.0"
merge-descriptors "^1.0.1"
mime "^2.4.5"
mz-modules "^2.1.0"
Expand Down Expand Up @@ -1685,11 +1684,6 @@ cluster-key-slot@^1.1.0:
resolved "https://registry.yarnpkg.com/cluster-key-slot/-/cluster-key-slot-1.1.0.tgz#30474b2a981fb12172695833052bc0d01336d10d"
integrity sha512-2Nii8p3RwAPiFwsnZvukotvow2rIHM+yQ6ZcBXGHdniadkYGZYiGmkHJIbZPIV9nfv7m/U1IPMVVcAhoWFeklw==

co-defer@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/co-defer/-/co-defer-1.0.0.tgz#3e4a787a8eed6b0a21ee287c094f7e8de0d3c818"
integrity sha1-Pkp4eo7tawoh7ih8CU9+jeDTyBg=

code-excerpt@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/code-excerpt/-/code-excerpt-4.0.0.tgz#2de7d46e98514385cb01f7b3b741320115f4c95e"
Expand Down Expand Up @@ -3790,10 +3784,10 @@ jsonparse@^1.2.0:
resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280"
integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=

jstoxml@^0.2.3:
version "0.2.4"
resolved "https://registry.yarnpkg.com/jstoxml/-/jstoxml-0.2.4.tgz#ff3fb67856883a032953c7ce8ce7486210f48447"
integrity sha1-/z+2eFaIOgMpU8fOjOdIYhD0hEc=
jstoxml@^2.0.0:
version "2.2.9"
resolved "https://registry.yarnpkg.com/jstoxml/-/jstoxml-2.2.9.tgz#2eebd5e55383fe66a375022ca0aa88f77bc4fb84"
integrity sha512-OYWlK0j+roh+eyaMROlNbS5cd5R25Y+IUpdl7cNdB8HNrkgwQzIS7L9MegxOiWNBj9dQhA/yAxiMwCC5mwNoBw==

just-extend@^4.0.2:
version "4.2.1"
Expand Down

0 comments on commit d730136

Please sign in to comment.