uomlibraryshared-ldap
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -8,11 +8,12 @@ import { IUomLibraryLdapData } from 'uomlibrarycommons-core'; | ||
private speed; | ||
private processNoLdap; | ||
private ldapQueue; | ||
constructor(name: string, // prevents multiple instances colliding with CommonsAsync (should there be multiple) | ||
ldapService: UomLibrarySharedLdapService, speed?: number); | ||
ldapService: UomLibrarySharedLdapService, speed?: number, processNoLdap?: boolean); | ||
queue(entry: T): void; | ||
reset(): void; | ||
protected abstract accept(entry: T): Promise<boolean>; | ||
protected abstract process(entry: T, ldapData: IUomLibraryLdapData): Promise<void>; | ||
protected abstract process(entry: T, ldapData: IUomLibraryLdapData | undefined): Promise<void>; | ||
start(): void; | ||
abort(): void; | ||
} |
@@ -7,6 +7,7 @@ "use strict"; | ||
constructor(name, // prevents multiple instances colliding with CommonsAsync (should there be multiple) | ||
ldapService, speed = 500) { | ||
ldapService, speed = 500, processNoLdap = false) { | ||
this.name = name; | ||
this.ldapService = ldapService; | ||
this.speed = speed; | ||
this.processNoLdap = processNoLdap; | ||
this.ldapQueue = []; | ||
@@ -34,4 +35,10 @@ } | ||
const ldapData = await this.ldapService.lookupSpotId(next.spotId); | ||
if (!ldapData) | ||
throw new Error('No LDAP data returned'); | ||
if (!ldapData) { | ||
if (this.processNoLdap) { | ||
nodecommons_cli_1.CommonsOutput.debug('No LDAP data returned, but processing anyway as per processNoLdap directive'); | ||
} | ||
else { | ||
throw new Error('No LDAP data returned'); | ||
} | ||
} | ||
nodecommons_cli_1.CommonsOutput.debug('Success'); | ||
@@ -38,0 +45,0 @@ await this.process(next, ldapData); |
{ | ||
"name": "uomlibraryshared-ldap", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Library Node.js library for LDAP", | ||
@@ -5,0 +5,0 @@ "scripts": { |
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
14110
197