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

node-ews

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-ews - npm Package Compare versions

Comparing version 2.1.3 to 2.1.4

9

lib/ews.js

@@ -0,1 +1,3 @@

"use strict";
var when = require('when');

@@ -193,3 +195,3 @@ var ntlm = require('httpntlm');

// run ews function with args
EWS.prototype.run = function(ewsFunction, ewsArgs) {
EWS.prototype.run = function(ewsFunction, ewsArgs, soapHeader) {

@@ -221,2 +223,7 @@ var authProfile = this[this.auth].authProfile;

// add optional soap header
if(typeof soapHeader === 'object') {
client.addSoapHeader(soapHeader);
}
// run ews soap function

@@ -223,0 +230,0 @@ client[ewsFunction](ewsArgs, (err, result) => {

2

package.json
{
"name": "node-ews",
"version": "2.1.3",
"version": "2.1.4",
"description": "A simple JSON wrapper for the Exchange Web Services (EWS) SOAP API",

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

@@ -142,2 +142,42 @@ # node-ews

#### Adding Optional Soap Headers
To add an optional soap header to the Exchange Web Services request, you can pass an optional 3rd variable to the ews.run() function as demonstrated by the following:
```js
var EWS = require('node-ews');
// exchange server connection info
var username = 'myuser@domain.com';
var password = 'mypassword';
var host = 'https://ews.domain.com';
// initialize node-ews
var ews = new EWS(username, password, host);
var ewsFunction = 'GetUserOofSettings';
var ewsArgs = {
'Mailbox': {
'Address':'email@somedomain.com'
}
};
var ewsSoapHeader = {
't:RequestServerVersion': {
attributes: {
Version: "Exchange2013"
}
}
};
// query ews, print resulting JSON to console
ews.run(ewsFunction, ewsArgs, ewsSoapHeader)
.then(result => {
console.log(JSON.stringify(result));
})
.catch(err => {
console.log(err.stack);
});
```
#### Disable SSL verification:

@@ -144,0 +184,0 @@

var EWS = require('node-ews');
// exchange server connection info
var username = process.env.USERNAME;
var password = process.env.PASSWORD;
var host = process.env.EWS_URL;
var username = 'nmarus';
var password = 'Cygnus775009';
var host = 'https://exchange.presidio.com';

@@ -11,37 +11,16 @@ // initialize node-ews

// define a ews query on Public Distribution List by email
// var ewsFunction = 'ExpandDL';
// var ewsArgs = {
// 'Mailbox': {
// 'EmailAddress': process.env.DL
// }
// };
var ewsFunction = 'GetUserOofSettings';
var ewsFunction = 'ExpandDL';
var ewsArgs = {
'Mailbox': {
'Address':'nmarus@presidio.com'
'EmailAddress':'avvid@presidio.com'
}
};
ews.tempDir = '.';
// query ews, print resulting JSON to console
ews.run(ewsFunction, ewsArgs)
.then(result => {
console.log(JSON.stringify(result.OofSettings));
console.log(JSON.stringify(result));
})
.catch(err => {
console.log(err);
console.log(err.message);
});
setTimeout(() => {
ews.run(ewsFunction, ewsArgs)
.then(result => {
console.log(JSON.stringify(result.OofSettings));
})
.catch(err => {
console.log(err);
});
}, 5000);
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