Skip to content

Commit 35db5a4

Browse files
author
Adam Soos
committed
WS-3330: update parameters object with new supported fields
1 parent 568e0a2 commit 35db5a4

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

lib/parameters.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,12 @@ function parameters() {
4646
this.language = null;
4747
this.documentFile = null;
4848
this.options = null;
49+
this.profileId = null;
4950

5051
// address similarity parameters
5152
this.address1 = null;
5253
this.address2 = null;
54+
this.parameters = null;
5355

5456
// name matching parameters
5557
this.name1 = null;
@@ -68,6 +70,7 @@ function parameters() {
6870
this.sourceScript = null;
6971
this.targetScript = null;
7072
this.targetScheme = null;
73+
this.maximumResults = null;
7174

7275
// transliteration parameters
7376
this.sourceLanguage = null;
@@ -88,10 +91,15 @@ function parameters() {
8891
//URL parameters
8992
this.urlParameters = null;
9093

94+
//record similarity
95+
this.fields = null;
96+
this.records = null;
97+
this.properties = null;
98+
9199
}
92100

93101
/**
94-
* Loads all non-null parameters into a new JSON that will be used as parameters for a Analytics API endpoint
102+
* Loads all non-null parameters into a new JSON that will be used as parameters for an Analytics API endpoint
95103
* Parameters that start with '_' are internal and not included in the endpoint request
96104
*/
97105
parameters.prototype.loadParams = function() {
@@ -181,16 +189,16 @@ parameters.prototype.loadFile = function(filePath, loadedParameters, userKey, pr
181189
}
182190
headers["X-BabelStreetAPI-Key"] = userKey;
183191

184-
if (parameters.customHeaders != null) {
185-
parameters.customHeaders.forEach(function(element, index) {
192+
if (loadedParameters.customHeaders != null) {
193+
loadedParameters.customHeaders.forEach(function(element, index) {
186194
headers[element[0]] = element[1];
187195
});
188196
}
189197

190198
var urlPath = urlParts.path;
191199

192-
if (parameters.urlParameters != null) {
193-
urlPath = `${urlPath}?${querystring.stringify(parameters.urlParameters)}`;
200+
if (loadedParameters.urlParameters != null) {
201+
urlPath = `${urlPath}?${querystring.stringify(loadedParameters.urlParameters)}`;
194202
}
195203

196204
var result = Buffer.from("");

lib/rosetteRequest.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ rosetteRequest.prototype.makeRequest = function(requestType, userKey, protocol,
7373
headers["X-BabelStreetAPI-Key"] = userKey;
7474
}
7575

76+
// to see custom headers format example in languages examples
7677
if (parameters.customHeaders != null) {
7778
parameters.customHeaders.forEach(function(element, index) {
7879
headers[element[0]] = element[1];

0 commit comments

Comments
 (0)