Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ali-oss

Package Overview
Dependencies
Maintainers
4
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ali-oss - npm Package Compare versions

Comparing version 4.8.0 to 4.9.0

10

History.md
4.9.0 / 2017-07-28
==================
* feat: support oss.append (#275)
* test: add node 8
* test: skip callbackurl test cases
* test: set default platform on user-agent
* docs: Document `secure` option when creating bucket store. (#252)
* chore: add dist build files
4.8.0 / 2017-01-19

@@ -3,0 +13,0 @@ ==================

21

lib/client.js

@@ -49,2 +49,3 @@ 'use strict';

this.ctx = ctx;
this.userAgent = this._getUserAgent();
}

@@ -69,3 +70,3 @@

for (const key in options) {
for (var key in options) {
if (options[key] === undefined) continue;

@@ -208,4 +209,9 @@ opts[key] = options[key];

if (subresList.length > 0) {
subresList = subresList.sort(function (a, b) {
return a > b;
});
resourceStr += '?' + subresList.join('&');
}
debug('CanonicalizedResource: %s', resourceStr);
params.push(resourceStr);

@@ -225,8 +231,6 @@ var stringToSign = params.join('\n');

proto.createRequest = function createRequest(params) {
var userAgent = this._userAgent();
var headers = {
'x-oss-date': dateFormat(new Date(), 'UTC:ddd, dd mmm yyyy HH:MM:ss \'GMT\''),
'x-oss-user-agent': userAgent,
'User-Agent': userAgent
'x-oss-user-agent': this.userAgent,
'User-Agent': this.userAgent
};

@@ -391,6 +395,9 @@

proto._userAgent = function _userAgent() {
var agent = (process && process.browser) ? 'js' : 'nodejs';
proto._getUserAgent = function _getUserAgent() {
var agent = (process && process.browser) ? 'js' : 'nodejs';
var sdk = 'aliyun-sdk-' + agent + '/' + pkg.version;
var plat = platform.description;
if (!plat && process) {
plat = 'Node.js ' + process.version.slice(1) + ' on ' + process.platform + ' ' + process.arch;
}

@@ -397,0 +404,0 @@ return sdk + ' ' + plat;

@@ -15,3 +15,5 @@ 'use strict';

var mime = require('mime');
var assert = require('assert');
var proto = exports;

@@ -23,2 +25,23 @@

/**
* append an object from String(file path)/Buffer/ReadableStream
* @param {String} name the object key
* @param {Mixed} file String(file path)/Buffer/ReadableStream
* @param {Object} options
* @return {Object}
*/
proto.append = function* (name, file, options) {
options = options || {};
if (options.position === undefined) options.position = '0';
options.subres = {
append: '',
position: options.position,
};
options.method = 'POST';
var result = yield this.put(name, file, options);
result.nextAppendPosition = result.res.headers['x-oss-next-append-position'];
return result;
}
/**

@@ -51,3 +74,4 @@ * put an object from String(file path)/Buffer/ReadableStream

var params = this._objectRequestParams('PUT', name, options);
var method = options.method || 'PUT';
var params = this._objectRequestParams(method, name, options);
params.mime = options.mime;

@@ -89,4 +113,6 @@ params.content = content;

this._convertMetaToHeaders(options.meta, options.headers);
var params = this._objectRequestParams('PUT', name, options);
var method = options.method || 'PUT';
var params = this._objectRequestParams(method, name, options);
params.mime = options.mime;

@@ -93,0 +119,0 @@ params.stream = stream;

{
"name": "ali-oss",
"version": "4.8.0",
"version": "4.9.0",
"description": "aliyun oss(open storage service) node client",

@@ -10,3 +10,3 @@ "main": "lib/client.js",

"scripts": {
"test": "mocha -t 30000 -r thunk-mocha -r should test/*.test.js",
"test": "mocha -t 60000 -r thunk-mocha -r should test/*.test.js",
"test-cov": "istanbul cover node_modules/.bin/_mocha -- -R dot -t 60000 -r thunk-mocha -r should test/*.test.js",

@@ -13,0 +13,0 @@ "jshint": "jshint .",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc