search-result-done.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. 'use strict'
  2. const LdapResult = require('../ldap-result')
  3. const { operations } = require('@ldapjs/protocol')
  4. /**
  5. * Implements the search result done response message as described in
  6. * https://www.rfc-editor.org/rfc/rfc4511.html#section-4.5.2.
  7. */
  8. class SearchResultDone extends LdapResult {
  9. #uri
  10. /**
  11. * @typedef {LdapResultOptions} SearchResultDoneOptions
  12. * @property {string[]} [uri=[]] The set of reference URIs the message is
  13. * providing.
  14. * @property {string[]} [uris] An alias for uri.
  15. */
  16. /**
  17. * @param {SearchResultDoneOptions} options
  18. */
  19. constructor (options = {}) {
  20. options.protocolOp = operations.LDAP_RES_SEARCH_DONE
  21. super(options)
  22. }
  23. /**
  24. * The name of the request type.
  25. *
  26. * @type {string}
  27. */
  28. get type () {
  29. return 'SearchResultDone'
  30. }
  31. /**
  32. * Implements the standardized `parseToPojo` method.
  33. *
  34. * @see LdapMessage.parseToPojo
  35. *
  36. * @param {import('@ldapjs/asn1').BerReader} ber
  37. *
  38. * @returns {object}
  39. */
  40. static parseToPojo (ber) {
  41. return LdapResult._parseToPojo({
  42. opCode: operations.LDAP_RES_SEARCH_DONE,
  43. berReader: ber
  44. })
  45. }
  46. }
  47. module.exports = SearchResultDone