Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: multiversion #750

Merged
merged 1 commit into from
Apr 28, 2020
Merged

feat: multiversion #750

merged 1 commit into from
Apr 28, 2020

Conversation

weiyie
Copy link
Contributor

@weiyie weiyie commented Mar 4, 2020

No description provided.

README.md Outdated
parameters:

- name {String} the bucket name
- status {String} version status, allow values: `Enabled` or `Disabled`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bucket 允许设置的版本控制状态为 Enabled 或 Suspended,否则将返回 400 Bad Request。

describe('putBucketVersioning() getBucketVersioning()', () => {
it('should set bucket version', async () => {
try {
const put1 = await store.putBucketVersioning(bucket, enabled);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

缺乏直接 getBucketVersioning 的测试用例

README.md Outdated
@@ -1783,6 +1840,80 @@ const result = await store.list({
console.log(result.objects);
```

### .listVersions(query[, options])
Copy link
Collaborator

@PeterRao PeterRao Mar 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同时增加 GetBucketVersions 吧,和官方api保持一致

README.md Outdated
- [query] {Object} query parameters, default is `null`
- [prefix] {String} search object using `prefix` key
- [version-id-marker] {String} set the result to return from the version ID marker of the key marker object and sort by the versions
- [key-marker] {String} search start from `key-marker`, including `key-marker` key
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改成驼峰方式,写个函数进行转变。

README.md Outdated
@@ -1687,7 +1741,10 @@ Delete multi objects in one request.

parameters:

- names {Array<String>} object names, max 1000 objects in once.
- names {Array<String>|<Object>} object names, max 1000 objects in once.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get和put保持同样的类型


it('should listVersions', async () => {
try {
const result = await store.listVersions(bucket);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个只判断状态码有点简单了,具体判断下返回的信息格式是否符合预期。

@PeterRao PeterRao changed the base branch from master to develop April 21, 2020 09:23
*/

proto.getBucketVersioning = async function getBucketVersioning(bucketName, options) {
this._checkBucketName(bucketName);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改成 util 的 checkBucketName

const proto = exports;
/**
* putBucketVersioning
* @param {Sting} name - bucket name
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

noncurrentVersionTransition: { noncurrentDays, storageClass }
}
] = rules;
assert(noncurrentDays === '10' && storageClass === 'IA');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个put是number,get是字符串,不一致

it('should head info', async () => {
try {
const result = await store.head(name, options);
assert.strictEqual(result.res.status, 200);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

测试用例,没有体现 x-oss-version-id 字段

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetBucketInfo 这个也加个测试春色里

- List from key-marker

```js
const result = await store.getBucketVersions({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

demo 参数错误

options.headers = options.headers || {};
const copySource = `/${sourceData.sourceBucketName}/${encodeURIComponent(sourceData.sourceKey)}`;
let copySource;
if (options.subres) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果 options.subres 为 {}
后面的拼接 versionId=undefined

@PeterRao PeterRao changed the base branch from develop to feat/multiversion April 28, 2020 09:51
@PeterRao PeterRao merged commit 9e8bb20 into ali-sdk:feat/multiversion Apr 28, 2020
PeterRao added a commit that referenced this pull request May 12, 2020
* fix: _unSupportBrowserTip (#755)

* fix: checkBucketName bug (#749)

* feat: image processing (#744)

close #676

* feat: putBucketWebsite support new parameter (#736)

* feat: support for the latest putBucketLifecycle api features (#757)

* feat: signatureUrl support trafficLimit (#756)

* feat(node): bucket policy (#751)

* test: getBucketTags/getObjectTagging/calculatePostSignature (#739)

* test: getBucketTags/getObjectTagging/calculatePostSignature

* fix: trafficLimit error

* chore: browserify close  debug (#759)

* fix: add successStatus (#762)

* fix: checkBucketName bug (#763)

* fix: add CORS for server-side-encryption

* chore: bump 6.6.0

* fix: proto.put TypeError text (#771)

* refactor: replace is.blob & is.file with isBlob & isFile (#776)

* feat: multiversion (#750)

* chore: bump 6.8.0-beta

* refactor: multiversion (#781)

* fix: browser端,去除没有使用的 sha256.js 文件 (#780)

* chore: change and delete the bucket used for test (#783)

* fix: putBucketWebsite testting (#785)

* chore: fix test case

Co-authored-by: 冷若霜寒 <912881342@qq.com>
Co-authored-by: microJ <microJ@users.noreply.github.com>
PeterRao added a commit that referenced this pull request Jun 5, 2020
* fix: _unSupportBrowserTip (#755)

* fix: checkBucketName bug (#749)

* feat: image processing (#744)

close #676

* feat: putBucketWebsite support new parameter (#736)

* feat: support for the latest putBucketLifecycle api features (#757)

* feat: signatureUrl support trafficLimit (#756)

* feat(node): bucket policy (#751)

* test: getBucketTags/getObjectTagging/calculatePostSignature (#739)

* test: getBucketTags/getObjectTagging/calculatePostSignature

* fix: trafficLimit error

* chore: browserify close  debug (#759)

* fix: add successStatus (#762)

* fix: checkBucketName bug (#763)

* fix: add CORS for server-side-encryption

* chore: bump 6.6.0

* fix: proto.put TypeError text (#771)

* refactor: replace is.blob & is.file with isBlob & isFile (#776)

* feat: multiversion (#750)

* chore: bump 6.8.0-beta

* refactor: multiversion (#781)

* fix: browser端,去除没有使用的 sha256.js 文件 (#780)

* chore: change and delete the bucket used for test (#783)

* fix: putBucketWebsite testting (#785)

* chore: fix test case

* fix: getBucketVersions result has no prefixes (#799)

* feat(node): uploadPart support file stream (#798)

* refactor: refactor cleanBucket delete (#803)

* test: add firefox test in browsers (#804)

* feat: browser端,将 is-type-of 包的依赖处理为 shim (#801)

* feat: update mime, use mime/lite replace mime and use shims/debug.js replace debug in browser (#802)

* fix: putStream can not close request when stream destroyed (#782)

* fix: delete unless code and delete invalid Content-Type (#805)

* test: test content-type without MIME (#806)

* chore: merge master fix

* chore: travis fix

Co-authored-by: 冷若霜寒 <912881342@qq.com>
Co-authored-by: microJ <microJ@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants