Skip to content

Commit

Permalink
feat: upgrade urllib to 4.x
Browse files Browse the repository at this point in the history
BREAKING CHANGE: upgrade node to >= 18.19.0
  • Loading branch information
killagu committed Dec 5, 2024
1 parent b384e48 commit 283edd3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [16, 18, 20, 22, 23]
node-version: [18, 20, 22, 23]
os: [ubuntu-latest]

steps:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "oss-client",
"version": "2.3.0",
"engines": {
"node": ">= 16.0.0"
"node": ">= 18.19.0"
},
"description": "Aliyun OSS(Object Storage Service) Node.js Client",
"scripts": {
Expand Down Expand Up @@ -34,7 +34,7 @@
"ms": "^2.1.3",
"oss-interface": "^1.3.0",
"stream-wormhole": "^2.0.0",
"urllib": "^3.19.2",
"urllib": "^4.6.2",
"utility": "^2.1.0",
"xml2js": "^0.6.2"
},
Expand Down
47 changes: 25 additions & 22 deletions test/OSSObject.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ describe('test/OSSObject.test.ts', () => {
}

it('should list with query', async () => {
const result = await ossObject.list();
const result = await ossObject.list({
prefix: listPrefix,
'max-keys': 5,
});
assert(result.objects.length > 0);
// console.log(result.objects);
result.objects.map(checkObjectProperties);
Expand Down Expand Up @@ -1728,8 +1731,8 @@ describe('test/OSSObject.test.ts', () => {
describe('copy()', () => {
let name: string;
let resHeaders: IncomingHttpHeaders;
let otherBucket: string;
let otherBucketObject: string;
// let otherBucket: string;
// let otherBucketObject: string;
before(async () => {
name = `${prefix}oss-client/oss/copy-meta.js`;
const object = await ossObject.put(name, __filename, {
Expand Down Expand Up @@ -1783,25 +1786,25 @@ describe('test/OSSObject.test.ts', () => {
assert.strictEqual(res.headers['content-disposition'], disposition);
});

it.skip('should copy object from other bucket, sourceBucket in copySource', async () => {
const copySource = `/${otherBucket}/${otherBucketObject}`;
const copyTarget = `${prefix}oss-client/oss/copy-target.js`;
const result = await ossObject.copy(copyTarget, copySource);
assert.equal(result.res.status, 200);

const info = await ossObject.head(copyTarget);
assert.equal(info.status, 200);
});

it.skip('should copy object from other bucket, sourceBucket is a separate parameter', async () => {
const copySource = otherBucketObject;
const copyTarget = `${prefix}oss-client/oss/has-bucket-name-copy-target.js`;
const result = await ossObject.copy(copyTarget, copySource, otherBucket);
assert.equal(result.res.status, 200);

const info = await ossObject.head(copyTarget);
assert.equal(info.status, 200);
});
// it.skip('should copy object from other bucket, sourceBucket in copySource', async () => {
// const copySource = `/${otherBucket}/${otherBucketObject}`;
// const copyTarget = `${prefix}oss-client/oss/copy-target.js`;
// const result = await ossObject.copy(copyTarget, copySource);
// assert.equal(result.res.status, 200);
//
// const info = await ossObject.head(copyTarget);
// assert.equal(info.status, 200);
// });

// it.skip('should copy object from other bucket, sourceBucket is a separate parameter', async () => {
// const copySource = otherBucketObject;
// const copyTarget = `${prefix}oss-client/oss/has-bucket-name-copy-target.js`;
// const result = await ossObject.copy(copyTarget, copySource, otherBucket);
// assert.equal(result.res.status, 200);
//
// const info = await ossObject.head(copyTarget);
// assert.equal(info.status, 200);
// });

it('should copy object with non-english name', async () => {
const sourceName = `${prefix}oss-client/oss/copy-meta_测试.js`;
Expand Down

0 comments on commit 283edd3

Please sign in to comment.