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

@alicloud/mns

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alicloud/mns - npm Package Compare versions

Comparing version 1.0.0-beta4 to 1.0.0-beta5

46

lib/client.js

@@ -108,5 +108,5 @@ 'use strict';

const canonicalizedMNSHeaders = getCanonicalizedMNSHeaders(headers);
const md5 = headers['content-md5'];
const md5 = headers['content-md5'] || '';
const date = headers['date'];
const type = headers['content-type'];
const type = headers['content-type'] || '';

@@ -127,10 +127,4 @@ var toSignString = `${verb}\n${md5}\n${type}\n${date}\n${canonicalizedMNSHeaders}${resource}`;

const date = new Date().toGMTString();
const contentType = 'text/xml';
const digest = kitx.md5(body, 'hex');
const md5 = Buffer.from(digest, 'utf8').toString('base64');
const headers = Object.assign({
'content-length': body.length,
'content-type': contentType,
'content-md5': md5,
const headers = {
'date': date,

@@ -140,4 +134,17 @@ 'host': this.endpointDomain,

'x-mns-version': '2015-06-06'
}, customHeaders);
};
if (method !== 'GET' && method !== 'HEAD') {
const contentType = 'text/xml';
const digest = kitx.md5(body, 'hex');
const md5 = Buffer.from(digest, 'utf8').toString('base64');
Object.assign(headers, {
'content-length': body.length,
'content-type': contentType,
'content-md5': md5
});
}
Object.assign(headers, customHeaders);
const signature = this.sign(method, headers, resource);

@@ -157,3 +164,4 @@

const body = toXMLBuffer('Queue', params);
return this.put(`/queues/${name}`, 'Queue', body, ['location']);
const url = `/queues/${name}`;
return this.put(url, 'Queue', body, ['location']);
}

@@ -193,3 +201,4 @@

const body = toXMLBuffer('Queue', params);
return this.put(`/queues/${queueName}?metaoverride=true`, 'Queue', body);
const url = `/queues/${queueName}?metaoverride=true`;
return this.put(url, 'Queue', body);
}

@@ -241,3 +250,4 @@

async batchPeekMessage(queueName, numOfMessages) {
const url = `/queues/${queueName}/messages?peekonly=true&numOfMessages=${numOfMessages}`;
const url = `/queues/${queueName}/messages?` +
`peekonly=true&numOfMessages=${numOfMessages}`;

@@ -258,3 +268,4 @@ const subType = 'Message';

const body = toXMLBuffer('ReceiptHandles', receiptHandles);
const response = await this.delete(`/queues/${queueName}/messages`, 'Errors', body, );
const url = `/queues/${queueName}/messages`;
const response = await this.delete(url, 'Errors', body);
const subType = 'Error';

@@ -266,3 +277,5 @@ response.body = response.body[subType];

changeMessageVisibility(queueName, receiptHandle, visibilityTimeout) {
return this.put(`/queues/${queueName}/messages?receiptHandle=${receiptHandle}&visibilityTimeout=${visibilityTimeout}`, 'ChangeVisibility');
const url = `/queues/${queueName}/messages?` +
`receiptHandle=${receiptHandle}&visibilityTimeout=${visibilityTimeout}`;
return this.put(url, 'ChangeVisibility');
}

@@ -305,3 +318,4 @@

const body = toXMLBuffer('Topic', params);
return this.put(`/topics/${name}?metaoverride=true`, 'Topic', body);
const url = `/topics/${name}?metaoverride=true`;
return this.put(url, 'Topic', body);
}

@@ -308,0 +322,0 @@

{
"name": "@alicloud/mns",
"version": "1.0.0-beta4",
"version": "1.0.0-beta5",
"description": "> 该 SDK 并未完全实现所有文档所提及的功能,如果您想使用的功能并未实现,请提[issue](https://github.com/aliyun/aliyun-mns-nodejs-sdk/issues/new)以增加优先级。",

@@ -5,0 +5,0 @@ "main": "index.js",

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