ldapts
Advanced tools
Comparing version 1.8.0 to 1.9.0
@@ -0,1 +1,5 @@ | ||
### 1.9.0 | ||
* Export Change and Attribute classes. Thanks @willmcenaney! | ||
* Parse search filter before sending partial request. Thanks @markhatchell! | ||
### 1.8.0 | ||
@@ -2,0 +6,0 @@ * Remove "dist" folder from published npm |
@@ -23,2 +23,4 @@ "use strict"; | ||
const messages_1 = require("./messages"); | ||
const FilterParser_1 = require("./FilterParser"); | ||
const filters_1 = require("./filters"); | ||
const MAX_MESSAGE_ID = Math.pow(2, 31) - 1; | ||
@@ -344,2 +346,14 @@ const logDebug = debug_1.default('ldapts'); | ||
} | ||
let filter; | ||
if (options.filter) { | ||
if (typeof options.filter === 'string') { | ||
filter = FilterParser_1.FilterParser.parseString(options.filter); | ||
} | ||
else { | ||
filter = options.filter; | ||
} | ||
} | ||
else { | ||
filter = new filters_1.PresenceFilter({ attribute: 'objectclass' }); | ||
} | ||
const searchRequest = new messages_1.SearchRequest({ | ||
@@ -349,3 +363,3 @@ messageId: -1, | ||
scope: options.scope, | ||
filter: options.filter, | ||
filter, | ||
attributes: options.attributes, | ||
@@ -352,0 +366,0 @@ returnAttributeValues: options.returnAttributeValues, |
@@ -0,2 +1,4 @@ | ||
export * from './Attribute'; | ||
export * from './Client'; | ||
export * from './Change'; | ||
export * from './dn'; |
@@ -6,4 +6,6 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./Attribute")); | ||
__export(require("./Client")); | ||
__export(require("./Change")); | ||
__export(require("./dn")); | ||
//# sourceMappingURL=index.js.map |
@@ -8,2 +8,3 @@ import { BerReader, BerWriter } from 'asn1'; | ||
baseDN?: string; | ||
filter: Filter; | ||
} | ||
@@ -18,3 +19,3 @@ export declare class SearchRequest extends Message { | ||
returnAttributeValues: boolean; | ||
filter: string | Filter; | ||
filter: Filter; | ||
attributes: string[]; | ||
@@ -21,0 +22,0 @@ constructor(options: SearchRequestMessageOptions); |
@@ -5,3 +5,2 @@ "use strict"; | ||
const ProtocolOperation_1 = require("../ProtocolOperation"); | ||
const PresenceFilter_1 = require("../filters/PresenceFilter"); | ||
const FilterParser_1 = require("../FilterParser"); | ||
@@ -18,3 +17,3 @@ class SearchRequest extends Message_1.Message { | ||
this.returnAttributeValues = options.returnAttributeValues !== false; | ||
this.filter = options.filter || ''; | ||
this.filter = options.filter; | ||
this.attributes = options.attributes || []; | ||
@@ -59,8 +58,2 @@ } | ||
writer.writeBoolean(!this.returnAttributeValues); | ||
if (this.filter && typeof this.filter === 'string') { | ||
this.filter = FilterParser_1.FilterParser.parseString(this.filter); | ||
} | ||
else if (!this.filter) { | ||
this.filter = new PresenceFilter_1.PresenceFilter({ attribute: 'objectclass' }); | ||
} | ||
this.filter.write(writer); | ||
@@ -67,0 +60,0 @@ writer.startSequence(); |
{ | ||
"name": "ldapts", | ||
"version": "1.8.0", | ||
"version": "1.9.0", | ||
"description": "LDAP client", | ||
@@ -11,3 +11,4 @@ "main": "index.js", | ||
"lint": "tslint --fix -p tsconfig.lint.json -c tslint.json -t stylish", | ||
"prepublishOnly": "if [ -d \"src\" ]; then rm -rf dist && npm run lint && npm run build && npm run test && cp package.json dist && cp *.md dist && cp .npmignore dist && cd dist && npm publish && echo \"Successfully published! Ignore the following error...\" && exit 125; fi" | ||
"dist": "if [ -d \"src\" ]; then rm -rf dist && npm run lint && npm run build && npm run test && cp package.json dist && cp *.md dist && cp .npmignore dist && cd dist && npm publish; fi", | ||
"prepublishOnly": "if [ -d \"src\" ]; then echo \"Please use: npm run dist\" && exit 125; fi" | ||
}, | ||
@@ -14,0 +15,0 @@ "husky": { |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
294304
4763
2