Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
  2. var Logger = require('bunyan');
  3. var client = require('./client');
  4. var Attribute = require('./attribute');
  5. var Change = require('./change');
  6. var Protocol = require('./protocol');
  7. var Server = require('./server');
  8. var assert = require('assert');
  9. var controls = require('./controls');
  10. var persistentSearch = require('./persistent_search');
  11. var dn = require('./dn');
  12. var errors = require('./errors');
  13. var filters = require('./filters');
  14. var messages = require('./messages');
  15. var url = require('./url');
  16. ///--- API
  17. module.exports = {
  18. Client: client.Client,
  19. createClient: client.createClient,
  20. Server: Server,
  21. createServer: function (options) {
  22. if (options === undefined)
  23. options = {};
  24. if (typeof (options) !== 'object')
  25. throw new TypeError('options (object) required');
  26. if (!options.log) {
  27. options.log = new Logger({
  28. name: 'ldapjs',
  29. component: 'client',
  30. stream: process.stderr
  31. });
  32. }
  33. return new Server(options);
  34. },
  35. Attribute: Attribute,
  36. Change: Change,
  37. dn: dn,
  38. DN: dn.DN,
  39. RDN: dn.RDN,
  40. parseDN: dn.parse,
  41. persistentSearch: persistentSearch,
  42. PersistentSearchCache: persistentSearch.PersistentSearchCache,
  43. filters: filters,
  44. parseFilter: filters.parseString,
  45. url: url,
  46. parseURL: url.parse
  47. };
  48. ///--- Export all the childrenz
  49. var k;
  50. for (k in Protocol) {
  51. if (Protocol.hasOwnProperty(k))
  52. module.exports[k] = Protocol[k];
  53. }
  54. for (k in messages) {
  55. if (messages.hasOwnProperty(k))
  56. module.exports[k] = messages[k];
  57. }
  58. for (k in controls) {
  59. if (controls.hasOwnProperty(k))
  60. module.exports[k] = controls[k];
  61. }
  62. for (k in filters) {
  63. if (filters.hasOwnProperty(k)) {
  64. if (k !== 'parse' && k !== 'parseString')
  65. module.exports[k] = filters[k];
  66. }
  67. }
  68. for (k in errors) {
  69. if (errors.hasOwnProperty(k)) {
  70. module.exports[k] = errors[k];
  71. }
  72. }