ldap-ts-client
Advanced tools
Comparing version 0.9.1-beta7 to 0.9.1-beta8
@@ -13,3 +13,26 @@ "use strict"; | ||
baseDN: "DC=ki,DC=local", | ||
queueDisable: false, | ||
}; | ||
const client1 = new index_1.Client(options); | ||
const data1 = await client1.queryAttributes({ | ||
attributes: ["cn"], | ||
options: { | ||
filter: "(&(objectClass=user)(cn=*))", | ||
scope: "sub", | ||
paged: true, | ||
}, | ||
}); | ||
console.log(`File: app.ts,`, `Line: 17 => `, data1.length); | ||
client1.unbind(); | ||
const client2 = new index_1.Client(options); | ||
const data2 = await client2.queryAttributes({ | ||
attributes: ["cn"], | ||
options: { | ||
filter: "(&(objectClass=user)(cn=*))", | ||
scope: "sub", | ||
paged: true, | ||
}, | ||
}); | ||
console.log(`File: app.ts,`, `Line: 17 => `, data2.length); | ||
client2.unbind(); | ||
const client = new index_1.Client(options); | ||
@@ -16,0 +39,0 @@ // const delResult = await client.del({ |
@@ -38,2 +38,3 @@ "use strict"; | ||
}); | ||
console.log(`File: index.ts,`, `Line: 125 => config`, this.config); | ||
this.client.bind(this.config.user, this.config.pass, (err, result) => { | ||
@@ -44,3 +45,3 @@ if (err) { | ||
} | ||
console.log(`File: index.ts,`, `Line: 105 => `, this.client.connected); | ||
console.log(`File: index.ts,`, `Line: 105 => client.connected`, this.client.connected); | ||
resolve(this.client); | ||
@@ -64,8 +65,8 @@ }); | ||
async connect() { | ||
var _a, _b; | ||
var _a; | ||
console.log(`File: index.ts,`, `Line: 126 connect `); | ||
(_a = this.logger) === null || _a === void 0 ? void 0 : _a.trace("connect()"); | ||
if ((_b = this.client) === null || _b === void 0 ? void 0 : _b.connected) { | ||
return this.client; | ||
} | ||
// if (this.client?.connected) { | ||
// return this.client; | ||
// } | ||
const client = await this.bind(); | ||
@@ -72,0 +73,0 @@ return client; |
{ | ||
"name": "ldap-ts-client", | ||
"version": "0.9.1-beta7", | ||
"version": "0.9.1-beta8", | ||
"description": "Type-safe LDAP client written in typescript", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -12,3 +12,28 @@ import { config } from "dotenv"; | ||
baseDN: "DC=ki,DC=local", | ||
queueDisable: false, | ||
}; | ||
const client1 = new Client(options); | ||
const data1 = await client1.queryAttributes<User>({ | ||
attributes: ["cn"], | ||
options: { | ||
filter: "(&(objectClass=user)(cn=*))", | ||
scope: "sub", | ||
paged: true, | ||
}, | ||
}); | ||
console.log(`File: app.ts,`, `Line: 17 => `, data1.length); | ||
client1.unbind(); | ||
const client2 = new Client(options); | ||
const data2 = await client2.queryAttributes<User>({ | ||
attributes: ["cn"], | ||
options: { | ||
filter: "(&(objectClass=user)(cn=*))", | ||
scope: "sub", | ||
paged: true, | ||
}, | ||
}); | ||
console.log(`File: app.ts,`, `Line: 17 => `, data2.length); | ||
client2.unbind(); | ||
const client = new Client(options); | ||
@@ -15,0 +40,0 @@ |
@@ -125,2 +125,4 @@ import ldap, { SearchOptions, Control, SearchEntryObject } from "ldapjs"; | ||
console.log(`File: index.ts,`, `Line: 125 => config`, this.config); | ||
this.client.bind(this.config.user, this.config.pass, (err, result) => { | ||
@@ -133,3 +135,7 @@ if (err) { | ||
console.log(`File: index.ts,`, `Line: 105 => `, this.client.connected); | ||
console.log( | ||
`File: index.ts,`, | ||
`Line: 105 => client.connected`, | ||
this.client.connected, | ||
); | ||
@@ -159,5 +165,5 @@ resolve(this.client); | ||
this.logger?.trace("connect()"); | ||
if (this.client?.connected) { | ||
return this.client; | ||
} | ||
// if (this.client?.connected) { | ||
// return this.client; | ||
// } | ||
const client = await this.bind(); | ||
@@ -164,0 +170,0 @@ return client; |
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
62446
1197