ldap-ts-client
Advanced tools
Comparing version 0.9.0 to 0.9.1-beta1
import ldap, { SearchOptions, Control, SearchEntryObject } from "ldapjs"; | ||
import type { Logger } from "pino"; | ||
import type { Logger } from "fast-node-logger"; | ||
export interface IClientConfig extends Omit<ldap.ClientOptions, "url" | "bindDN"> { | ||
/**Password to connect to AD */ | ||
/** Password to connect to AD */ | ||
pass: string; | ||
/**User to connect to AD */ | ||
/** User to connect to AD */ | ||
user: string; | ||
/**Root of tree for search */ | ||
/** Root of tree for search */ | ||
baseDN: string; | ||
/** Domain name with format: ldap://{domain.com} */ | ||
ldapServerUrl: string; | ||
/**instance of pino logger */ | ||
/** instance of pino logger */ | ||
logger?: Logger; | ||
@@ -14,0 +14,0 @@ } |
@@ -27,6 +27,7 @@ "use strict"; | ||
return new Promise((resolve, reject) => { | ||
this.client.bind(this.config.user, this.config.pass, (err) => { | ||
this.client.bind(this.config.user, this.config.pass, (err, result) => { | ||
if (err) { | ||
reject(err); | ||
} | ||
console.log(`File: index.ts,`, `Line: 105 => `, this.client.connected); | ||
resolve(this.client); | ||
@@ -50,5 +51,5 @@ }); | ||
async connect() { | ||
var _a; | ||
var _a, _b; | ||
(_a = this.logger) === null || _a === void 0 ? void 0 : _a.trace("connect()"); | ||
if (this.client && this.client.connected) { | ||
if ((_b = this.client) === null || _b === void 0 ? void 0 : _b.connected) { | ||
return this.client; | ||
@@ -55,0 +56,0 @@ } |
{ | ||
"name": "ldap-ts-client", | ||
"version": "0.9.0", | ||
"version": "0.9.1-beta1", | ||
"description": "Type-safe LDAP client written in typescript", | ||
@@ -5,0 +5,0 @@ "repository": { |
import ldap, { SearchOptions, Control, SearchEntryObject } from "ldapjs"; | ||
import type { Logger } from "pino"; | ||
import type { Logger } from "fast-node-logger"; | ||
import { search } from "./services/search"; | ||
@@ -7,11 +7,11 @@ | ||
extends Omit<ldap.ClientOptions, "url" | "bindDN"> { | ||
/**Password to connect to AD */ | ||
/** Password to connect to AD */ | ||
pass: string; | ||
/**User to connect to AD */ | ||
/** User to connect to AD */ | ||
user: string; | ||
/**Root of tree for search */ | ||
/** Root of tree for search */ | ||
baseDN: string; | ||
/** Domain name with format: ldap://{domain.com} */ | ||
ldapServerUrl: string; | ||
/**instance of pino logger */ | ||
/** instance of pino logger */ | ||
logger?: Logger; | ||
@@ -101,3 +101,3 @@ } | ||
return new Promise((resolve, reject) => { | ||
this.client.bind(this.config.user, this.config.pass, (err) => { | ||
this.client.bind(this.config.user, this.config.pass, (err, result) => { | ||
if (err) { | ||
@@ -107,2 +107,4 @@ reject(err); | ||
console.log(`File: index.ts,`, `Line: 105 => `, this.client.connected); | ||
resolve(this.client); | ||
@@ -129,3 +131,3 @@ }); | ||
this.logger?.trace("connect()"); | ||
if (this.client && this.client.connected) { | ||
if (this.client?.connected) { | ||
return this.client; | ||
@@ -132,0 +134,0 @@ } |
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
57307
1109