Skip to content

Commit

Permalink
Merge pull request #19 from dimer47/dev
Browse files Browse the repository at this point in the history
Update from v2.0.2 to v2.0.2 #2
  • Loading branch information
dimer47 authored Dec 20, 2020
2 parents 582ecec + 42f230b commit daeed92
Show file tree
Hide file tree
Showing 17 changed files with 86 additions and 84 deletions.
2 changes: 1 addition & 1 deletion doc/Account.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ <h1 class="page-title">
// call
request({
method: 'GET',
uri: this.context.endpoint.url,
uri: encodeURI(this.context.endpoint.url),
headers: {
"X-Auth-Token": this.context.token,
"Accept": "application/json"
Expand Down
12 changes: 6 additions & 6 deletions doc/AccountMeta.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@ <h1 class="page-title">

// header
let header = {};
header["X-Account-Meta-" + _.toSlug(_.toLower(key))] = value;
header["X-Account-Meta-" + _.toSlug(_.replace(_.toLower(key), /_/g, '-'))] = value;

// call
request({
method: 'POST',
uri: this.context.endpoint.url,
uri: encodeURI(this.context.endpoint.url),
headers: Object.assign(
{
"X-Auth-Token": this.context.token,
Expand Down Expand Up @@ -237,7 +237,7 @@ <h1 class="page-title">
// call
request({
method: 'POST',
uri: this.context.endpoint.url,
uri: encodeURI(this.context.endpoint.url),
headers: Object.assign(
{
"X-Auth-Token": this.context.token,
Expand Down Expand Up @@ -296,7 +296,7 @@ <h1 class="page-title">
// call
request({
method: 'HEAD',
uri: this.context.endpoint.url,
uri: encodeURI(this.context.endpoint.url),
headers: {
"X-Auth-Token": this.context.token,
"Accept": "application/json"
Expand All @@ -307,7 +307,7 @@ <h1 class="page-title">
throw new Error(err);

let value = _.filter(res.headers, (value, header) => {
return (_.toLower(header) === _.toLower("X-Account-Meta-" + _.toSlug(_.toLower(key))));
return (_.toLower(header) === _.toLower("X-Account-Meta-" + _.toSlug(_.replace(_.toLower(key), /_/g, '-'))));
})

value = ((_.count(value) &lt;= 0) ? null : value[0]);
Expand Down Expand Up @@ -350,7 +350,7 @@ <h1 class="page-title">
// call
request({
method: 'HEAD',
uri: this.context.endpoint.url,
uri: encodeURI(this.context.endpoint.url),
headers: {
"X-Auth-Token": this.context.token,
"Accept": "application/json"
Expand Down
10 changes: 5 additions & 5 deletions doc/Containers.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ <h1 class="page-title">
// call
request({
method: 'DELETE',
uri: this.context.endpoint.url + '/' + container,
uri: encodeURI(this.context.endpoint.url + '/' + container),
headers: {
"X-Auth-Token": this.context.token,
"Accept": "application/json"
Expand Down Expand Up @@ -226,7 +226,7 @@ <h1 class="page-title">
// call
request({
method: 'PUT',
uri: this.context.endpoint.url + '/' + container,
uri: encodeURI(this.context.endpoint.url + '/' + container),
headers: Object.assign({
"X-Auth-Token": this.context.token,
"Accept": "application/json"
Expand Down Expand Up @@ -405,7 +405,7 @@ <h1 class="page-title">
// call
request({
method: 'GET',
uri: this.context.endpoint.url + '/' + container,
uri: encodeURI(this.context.endpoint.url + '/' + container),
headers: {
"X-Auth-Token": this.context.token,
"Accept": "application/json"
Expand Down Expand Up @@ -448,7 +448,7 @@ <h1 class="page-title">
// call
request({
method: 'GET',
uri: this.context.endpoint.url + '/' + container,
uri: encodeURI(this.context.endpoint.url + '/' + container),
headers: {
"X-Auth-Token": this.context.token,
"Accept": "application/json"
Expand Down Expand Up @@ -499,7 +499,7 @@ <h1 class="page-title">
// call
request({
method: 'HEAD',
uri: this.context.endpoint.url + '/' + container,
uri: encodeURI(this.context.endpoint.url + '/' + container),
headers: {
"X-Auth-Token": this.context.token,
"Accept": "application/json"
Expand Down
16 changes: 8 additions & 8 deletions doc/ContainersMeta.html
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ <h4 class="name" id="all">
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="ContainersMeta.js.html">ContainersMeta.js</a>, <a href="ContainersMeta.js.html#line286">line 286</a>
<a href="ContainersMeta.js.html">ContainersMeta.js</a>, <a href="ContainersMeta.js.html#line287">line 287</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -746,7 +746,7 @@ <h5>Parameters:</h5>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="ContainersMeta.js.html">ContainersMeta.js</a>, <a href="ContainersMeta.js.html#line93">line 93</a>
<a href="ContainersMeta.js.html">ContainersMeta.js</a>, <a href="ContainersMeta.js.html#line94">line 94</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -921,7 +921,7 @@ <h5>Parameters:</h5>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="ContainersMeta.js.html">ContainersMeta.js</a>, <a href="ContainersMeta.js.html#line144">line 144</a>
<a href="ContainersMeta.js.html">ContainersMeta.js</a>, <a href="ContainersMeta.js.html#line145">line 145</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -1096,7 +1096,7 @@ <h5>Parameters:</h5>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="ContainersMeta.js.html">ContainersMeta.js</a>, <a href="ContainersMeta.js.html#line198">line 198</a>
<a href="ContainersMeta.js.html">ContainersMeta.js</a>, <a href="ContainersMeta.js.html#line199">line 199</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -1271,7 +1271,7 @@ <h5>Parameters:</h5>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="ContainersMeta.js.html">ContainersMeta.js</a>, <a href="ContainersMeta.js.html#line216">line 216</a>
<a href="ContainersMeta.js.html">ContainersMeta.js</a>, <a href="ContainersMeta.js.html#line217">line 217</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -1446,7 +1446,7 @@ <h5>Parameters:</h5>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="ContainersMeta.js.html">ContainersMeta.js</a>, <a href="ContainersMeta.js.html#line270">line 270</a>
<a href="ContainersMeta.js.html">ContainersMeta.js</a>, <a href="ContainersMeta.js.html#line271">line 271</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -1650,7 +1650,7 @@ <h5>Parameters:</h5>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="ContainersMeta.js.html">ContainersMeta.js</a>, <a href="ContainersMeta.js.html#line112">line 112</a>
<a href="ContainersMeta.js.html">ContainersMeta.js</a>, <a href="ContainersMeta.js.html#line113">line 113</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -1854,7 +1854,7 @@ <h5>Parameters:</h5>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="ContainersMeta.js.html">ContainersMeta.js</a>, <a href="ContainersMeta.js.html#line126">line 126</a>
<a href="ContainersMeta.js.html">ContainersMeta.js</a>, <a href="ContainersMeta.js.html#line127">line 127</a>
</li>
</ul>
</dd>
Expand Down
13 changes: 7 additions & 6 deletions doc/ContainersMeta.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ <h1 class="page-title">

// header
let header = {};
header["X-Container-Meta-" + _.toSlug(_.toLower(key))] = value;
header["X-Container-Meta-" + _.toSlug(_.replace(_.toLower(key), /_/g, '-'))] = value;


// check if container exist
if (!await this.context.containers().exist(container)) // noinspection ExceptionCaughtLocallyJS
Expand All @@ -154,7 +155,7 @@ <h1 class="page-title">
// call
request({
method: 'POST',
uri: this.context.endpoint.url + '/' + container,
uri: encodeURI(this.context.endpoint.url + '/' + container),
headers: Object.assign(
{
"X-Auth-Token": this.context.token,
Expand Down Expand Up @@ -260,7 +261,7 @@ <h1 class="page-title">
// call
request({
method: 'POST',
uri: this.context.endpoint.url + '/' + container,
uri: encodeURI(this.context.endpoint.url + '/' + container),
headers: Object.assign(
{
"X-Auth-Token": this.context.token,
Expand Down Expand Up @@ -328,7 +329,7 @@ <h1 class="page-title">
// call
request({
method: 'HEAD',
uri: this.context.endpoint.url + '/' + container,
uri: encodeURI(this.context.endpoint.url + '/' + container),
headers: {
"X-Auth-Token": this.context.token,
"Accept": "application/json"
Expand All @@ -339,7 +340,7 @@ <h1 class="page-title">
throw new Error(err);

let value = _.filter(res.headers, (value, header) => {
return (_.toLower(header) === _.toLower("X-Container-Meta-" + _.toSlug(_.toLower(key))));
return (_.toLower(header) === _.toLower("X-Container-Meta-" + _.toSlug(_.replace(_.toLower(key), /_/g, '-'))));
})

value = ((_.count(value) &lt;= 0) ? null : value[0]);
Expand Down Expand Up @@ -391,7 +392,7 @@ <h1 class="page-title">
// call
request({
method: 'HEAD',
uri: this.context.endpoint.url + '/' + container,
uri: encodeURI(this.context.endpoint.url + '/' + container),
headers: {
"X-Auth-Token": this.context.token,
"Accept": "application/json"
Expand Down
2 changes: 1 addition & 1 deletion doc/OVHObjectStorage.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ <h1 class="page-title">
return new Promise((resolve, reject) => {
request({
method: 'POST',
uri: this.config.authURL + '/tokens',
uri: encodeURI(this.config.authURL + '/tokens'),
json: {
"auth": {
"identity": {
Expand Down
26 changes: 13 additions & 13 deletions doc/Objects.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ <h1 class="page-title">

request({
method: 'GET',
uri: this.context.endpoint.url + "/" + file,
uri: encodeURI(this.context.endpoint.url + "/" + file),
headers: {
"X-Auth-Token": this.context.token,
"Accept": "application/json"
Expand Down Expand Up @@ -222,11 +222,11 @@ <h1 class="page-title">

request({
method: 'GET',
uri: this.context.endpoint.url + "/" + file,
uri: encodeURI(this.context.endpoint.url + "/" + file),
headers: {
"X-Auth-Token": this.context.token,
"Accept": "application/json"
},
},
encoding: encoding
}, (err, res, body) => {
err = err || request.checkIfResponseIsError(res);
Expand Down Expand Up @@ -257,7 +257,7 @@ <h1 class="page-title">
save(file, path) {
return this.saveFile(file, path);
}

/**
* Save file data
*
Expand Down Expand Up @@ -300,7 +300,7 @@ <h1 class="page-title">

request({
method: 'PUT',
uri: this.context.endpoint.url + path,
uri: encodeURI(this.context.endpoint.url + path),
headers: {
"X-Auth-Token": this.context.token,
"Accept": "application/json"
Expand All @@ -318,7 +318,7 @@ <h1 class="page-title">
}
});
}

/**
* Save file
*
Expand Down Expand Up @@ -366,7 +366,7 @@ <h1 class="page-title">
let stream = fs.createReadStream(file);
stream.pipe(request({
method: 'PUT',
uri: this.context.endpoint.url + path,
uri: encodeURI(this.context.endpoint.url + path),
headers: {
"X-Auth-Token": this.context.token,
"Accept": "application/json"
Expand Down Expand Up @@ -495,7 +495,7 @@ <h1 class="page-title">

request({
method: 'COPY',
uri: this.context.endpoint.url + '/' + pathOriginFile,
uri: encodeURI(this.context.endpoint.url + '/' + pathOriginFile),
headers: {
"X-Auth-Token": this.context.token,
"Accept": "application/json",
Expand Down Expand Up @@ -570,7 +570,7 @@ <h1 class="page-title">
// delete file
request({
method: 'DELETE',
uri: this.context.endpoint.url + '/' + path,
uri: encodeURI(this.context.endpoint.url + '/' + path),
headers: {
"X-Auth-Token": this.context.token,
"Accept": "application/json"
Expand Down Expand Up @@ -707,7 +707,7 @@ <h1 class="page-title">

request({
method: 'GET',
uri: this.context.endpoint.url + '/' + file,
uri: encodeURI(this.context.endpoint.url + '/' + file),
headers: {
"X-Auth-Token": this.context.token,
"Accept": "application/json"
Expand Down Expand Up @@ -766,7 +766,7 @@ <h1 class="page-title">
// call
request({
method: 'HEAD',
uri: this.context.endpoint.url + '/' + file,
uri: encodeURI(this.context.endpoint.url + '/' + file),
headers: {
"X-Auth-Token": this.context.token,
"Accept": "application/json"
Expand Down Expand Up @@ -818,7 +818,7 @@ <h1 class="page-title">

request({
method: 'POST',
uri: this.context.endpoint.url + '/' + path,
uri: encodeURI(this.context.endpoint.url + '/' + path),
headers: {
"X-Auth-Token": this.context.token,
"X-Delete-At": Math.round(expire_date.toDate().getTime() / 1000),
Expand Down Expand Up @@ -886,7 +886,7 @@ <h1 class="page-title">

request({
method: 'POST',
uri: this.context.endpoint.url + '/' + path,
uri: encodeURI(this.context.endpoint.url + '/' + path),
headers: {
"X-Auth-Token": this.context.token,
"X-Delete-After": parseInt(delete_seconds),
Expand Down
Loading

0 comments on commit daeed92

Please sign in to comment.