Comparing version 1.4.2 to 1.5.0
@@ -0,1 +1,7 @@ | ||
### 1.5.0 | ||
* Update dependencies | ||
* Only include PagedResultsControl if `searchOptions.paged` is specified. Fixes #17 | ||
* Make Filter.escape() public. Thanks @stiller-leser! | ||
* Fix FilterParser parsing of ExtensibleFilters to include attribute type. Hopefully fixes #16 | ||
### 1.4.2 | ||
@@ -2,0 +8,0 @@ |
@@ -333,8 +333,12 @@ "use strict"; | ||
} | ||
const pagedResultsControl = new PagedResultsControl_1.PagedResultsControl({ | ||
value: { | ||
size: pageSize, | ||
}, | ||
}); | ||
controls.push(pagedResultsControl); | ||
let pagedResultsControl; | ||
const shouldPage = !!options.paged; | ||
if (shouldPage) { | ||
pagedResultsControl = new PagedResultsControl_1.PagedResultsControl({ | ||
value: { | ||
size: pageSize, | ||
}, | ||
}); | ||
controls.push(pagedResultsControl); | ||
} | ||
const searchRequest = new messages_1.SearchRequest({ | ||
@@ -355,3 +359,3 @@ messageId: -1, | ||
}; | ||
await this._sendSearch(searchRequest, searchResult, (typeof options.paged !== 'undefined') && options.paged !== false, pageSize, pagedResultsControl); | ||
await this._sendSearch(searchRequest, searchResult, shouldPage, pageSize, pagedResultsControl); | ||
return searchResult; | ||
@@ -385,3 +389,3 @@ } | ||
// Recursively search if paging is specified | ||
if (paged && (result.searchEntries.length || result.searchReferences.length)) { | ||
if (paged && (result.searchEntries.length || result.searchReferences.length) && pagedResultsControl) { | ||
let pagedResultsFromResponse; | ||
@@ -388,0 +392,0 @@ for (const control of (result.controls || [])) { |
@@ -225,7 +225,7 @@ "use strict"; | ||
if (remainingExpression[0] === ':') { | ||
return FilterParser._parseExtensibleFilterFromString(remainingExpression); | ||
return FilterParser._parseExtensibleFilterFromString(attribute, remainingExpression); | ||
} | ||
throw new Error(`Invalid expression: ${filterString}`); | ||
} | ||
static _parseExtensibleFilterFromString(filterString) { | ||
static _parseExtensibleFilterFromString(attribute, filterString) { | ||
let dnAttributes = false; | ||
@@ -252,2 +252,3 @@ let rule; | ||
const options = { | ||
matchType: attribute, | ||
dnAttributes, | ||
@@ -254,0 +255,0 @@ rule, |
@@ -11,4 +11,2 @@ /// <reference types="node" /> | ||
} | undefined, __: boolean): boolean | void; | ||
protected parseFilter(_: BerReader): void; | ||
protected writeFilter(_: BerWriter): void; | ||
/** | ||
@@ -22,3 +20,5 @@ * RFC 2254 Escaping of filter strings | ||
*/ | ||
protected escape(input: string | Buffer): string; | ||
escape(input: string | Buffer): string; | ||
protected parseFilter(_: BerReader): void; | ||
protected writeFilter(_: BerWriter): void; | ||
protected getObjectValue(objectToCheck: { | ||
@@ -25,0 +25,0 @@ [index: string]: string; |
@@ -15,8 +15,2 @@ "use strict"; | ||
} | ||
// tslint:disable-next-line:no-empty | ||
parseFilter(_) { | ||
} | ||
// tslint:disable-next-line:no-empty | ||
writeFilter(_) { | ||
} | ||
/** | ||
@@ -68,2 +62,8 @@ * RFC 2254 Escaping of filter strings | ||
} | ||
// tslint:disable-next-line:no-empty | ||
parseFilter(_) { | ||
} | ||
// tslint:disable-next-line:no-empty | ||
writeFilter(_) { | ||
} | ||
getObjectValue(objectToCheck = {}, key, strictAttributeCase) { | ||
@@ -70,0 +70,0 @@ let objectKey; |
{ | ||
"name": "ldapts", | ||
"version": "1.4.2", | ||
"version": "1.5.0", | ||
"description": "LDAP client", | ||
@@ -9,3 +9,3 @@ "main": "dist/index.js", | ||
"build": "tsc", | ||
"test": "mocha -r ts-node/register tests/**/*.tests.ts", | ||
"test": "mocha -r ts-node/register tests/*.tests.ts tests/**/*.tests.ts", | ||
"lint": "tslint --fix -p tsconfig.lint.json -c tslint.json -t stylish", | ||
@@ -46,14 +46,15 @@ "prepublishOnly": "npm run build && npm run lint && npm run test" | ||
"@types/chai-as-promised": "~7.1.0", | ||
"@types/debug": "~4.1.2", | ||
"@types/debug": "~4.1.4", | ||
"@types/mocha": "~5.2.6", | ||
"@types/node": "~11.11.8", | ||
"@types/node": "~11.13.7", | ||
"chai": "~4.2.0", | ||
"chai-as-promised": "~7.1.1", | ||
"husky": "~1.3.1", | ||
"mocha": "~6.0.2", | ||
"ts-node": "~8.0.3", | ||
"tslint": "~5.14.0", | ||
"husky": "~2.0.0", | ||
"mocha": "~6.1.4", | ||
"ts-mockito": "~2.3.1", | ||
"ts-node": "~8.1.0", | ||
"tslint": "~5.16.0", | ||
"tslint-config-airbnb": "~5.11.1", | ||
"typescript": "~3.3.4000" | ||
"typescript": "~3.4.5" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
274549
4337
15