You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -217,6 +218,7 @@ impersonateAAD | String | `v.1.6.12+` A String representing the GUID value for t
217
218
includeAnnotations | String | Defaults Prefer header with value "odata.include-annotations=" and the specified annotation. Annotations provide additional information about lookups, options sets and other complex attribute types.
218
219
maxPageSize | Number | Defaults the odata.maxpagesize preference. Use to set the number of entities returned in the response.
219
220
onTokenRefresh | Function | A callback function that triggered when DynamicsWebApi requests a new OAuth token. (At this moment it is done before each call to Dynamics 365, as [recommended by Microsoft](https://msdn.microsoft.com/en-ca/library/gg327838.aspx#Anchor_2)).
returnRepresentation | Boolean | Defaults Prefer header with value "return=representation". Use this property to return just created or updated entity in a single request.
221
223
timeout | Number | Sets a number of milliseconds before a request times out.
222
224
useEntityNames | Boolean | `v.1.4.0+` Indicates whether to use entity logical names instead of collection logical names during requests.
@@ -2069,6 +2071,31 @@ var collectionName = dynamicsWebApi.utility.getCollectionName('account');
2069
2071
2070
2072
Please note, everything said above will happen only if you set `useEntityNames: true` in the DynamicsWebApi config.
2071
2073
2074
+
## Using Proxy
2075
+
2076
+
**Node.js Only.** Starting from v.1.7.2 DynamicsWebApi supports different types of connections through proxy. To make it possible, I added two dependencies in a `package.json`:
2077
+
(http-proxy-agent)[https://github.com/TooTallNate/node-https-proxy-agent] and (https-proxy-agent)[https://github.com/TooTallNate/node-http-proxy-agent], based on a type of a protocol, DynamicsWebApi
2078
+
will use one of those agents.
2079
+
2080
+
In order to let DynamicsWebApi know that you are using proxy you have two options:
2081
+
1. add environmental variables `http_proxy` or `https_proxy` in your .env file
2082
+
2. or pass parameters in DynamicsWebApi configuration, for example:
Copy file name to clipboardExpand all lines: lib/dynamics-web-api-callbacks.js
+22-37Lines changed: 22 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -9,41 +9,6 @@ if (!String.prototype.endsWith || !String.prototype.startsWith) {
9
9
require("./polyfills/string-es6");
10
10
}
11
11
12
-
/* develblock:start */
13
-
vardwaExpandRequest=function(){
14
-
return{
15
-
select: [],
16
-
filter: "",
17
-
top: 0,
18
-
orderBy: [],
19
-
property: ""
20
-
};
21
-
};
22
-
vardwaRequest=function(){
23
-
return{
24
-
type: "",
25
-
id: "",
26
-
select: [],
27
-
expand: [],
28
-
filter: "",
29
-
maxPageSize: 1,
30
-
count: true,
31
-
top: 1,
32
-
orderBy: [],
33
-
includeAnnotations: "",
34
-
ifmatch: "",
35
-
ifnonematch: "",
36
-
returnRepresentation: true,
37
-
entity: {},
38
-
impersonate: "",
39
-
navigationProperty: "",
40
-
savedQuery: "",
41
-
userQuery: "",
42
-
async: true
43
-
};
44
-
};
45
-
/* develblock:end */
46
-
47
12
/**
48
13
* Configuration object for DynamicsWebApi
49
14
* @typedef {object} DWAConfig
@@ -55,6 +20,7 @@ var dwaRequest = function () {
55
20
* @property {string} maxPageSize - Sets the odata.maxpagesize preference value to request the number of entities returned in the response.
56
21
* @property {boolean} returnRepresentation - Sets Prefer header request with value "return=representation". Use this property to return just created or updated entity in a single request.
57
22
* @property {boolean} useEntityNames - Indicates whether to use Entity Logical Names instead of Collection Logical Names.
23
+
* @property {Object} proxy - Proxy configuration.
58
24
*/
59
25
60
26
/**
@@ -112,7 +78,8 @@ function DynamicsWebApi(config) {
112
78
onTokenRefresh: null,
113
79
includeAnnotations: null,
114
80
maxPageSize: null,
115
-
returnRepresentation: null
81
+
returnRepresentation: null,
82
+
proxy: null
116
83
};
117
84
118
85
var_isBatch=false;
@@ -178,7 +145,25 @@ function DynamicsWebApi(config) {
0 commit comments