@3kles/3kles-ldap
Version:
66 lines (64 loc) • 2.65 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.LDAPController = void 0;
var _3kles_corebe_1 = require("@3kles/3kles-corebe");
var ldap_api_1 = require("./ldap.api");
var LDAPController = /** @class */ (function (_super) {
__extends(LDAPController, _super);
function LDAPController(client, binder) {
var _this = _super.call(this, new _3kles_corebe_1.GenericService(new ldap_api_1.LdapAPI())) || this;
_this.client = client;
_this.binder = binder;
_this.parameters = {};
return _this;
}
LDAPController.prototype.addList = function (path, search, ad, method) {
this.addGenericParameters(path, method || "GET", "search", ad);
this.parameters[path].option.searchOptions = search;
};
LDAPController.prototype.addAdd = function (path, ad, method) {
this.addGenericParameters(path, method || "POST", "add", ad);
};
LDAPController.prototype.addDelete = function (path, ad, method) {
this.addGenericParameters(path, method || "DELETE", "del", ad);
};
LDAPController.prototype.addModify = function (path, ad, method) {
this.addGenericParameters(path, "PUT", "modify", ad);
};
LDAPController.prototype.addGenericParameters = function (path, m, t, ad) {
this.parameters[path] = {
path: path,
method: m,
option: {
type: t,
client: this.client,
binder: this.binder,
ad: ad
}
};
// if (ad) {
// this.parameters[path].ad = ad;
// }
if (this.service) {
this.service.setParameters(this.parameters);
}
};
return LDAPController;
}(_3kles_corebe_1.GenericController));
exports.LDAPController = LDAPController;
//# sourceMappingURL=ldap.controller.js.map