-
Notifications
You must be signed in to change notification settings - Fork 576
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
feat: multiversion #750
Conversation
README.md
Outdated
parameters: | ||
|
||
- name {String} the bucket name | ||
- status {String} version status, allow values: `Enabled` or `Disabled` |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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]) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get和put保持同样的类型
test/node/multiversion.test.js
Outdated
|
||
it('should listVersions', async () => { | ||
try { | ||
const result = await store.listVersions(bucket); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个只判断状态码有点简单了,具体判断下返回的信息格式是否符合预期。
*/ | ||
|
||
proto.getBucketVersioning = async function getBucketVersioning(bucketName, options) { | ||
this._checkBucketName(bucketName); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
测试用例,没有体现 x-oss-version-id 字段
There was a problem hiding this comment.
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({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
demo 参数错误
lib/common/multipart-copy.js
Outdated
options.headers = options.headers || {}; | ||
const copySource = `/${sourceData.sourceBucketName}/${encodeURIComponent(sourceData.sourceKey)}`; | ||
let copySource; | ||
if (options.subres) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果 options.subres 为 {}
后面的拼接 versionId=undefined
* 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>
* 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>
No description provided.