fix: ldif module import

This commit is contained in:
Meet
2024-10-04 00:19:25 +05:30
parent e3cbcf5853
commit d1966b60a8
@@ -1,7 +1,7 @@
/* eslint-disable */ /* eslint-disable */
import ldapjs from "ldapjs"; import ldapjs from "ldapjs";
import { render } from "mustache"; import mustache from "mustache";
import { customAlphabet } from "nanoid"; import { customAlphabet } from "nanoid";
import { z } from "zod"; import { z } from "zod";
@@ -9,7 +9,8 @@ import { alphaNumericNanoId } from "@app/lib/nanoid";
import { LdapSchema, TDynamicProviderFns } from "./models"; import { LdapSchema, TDynamicProviderFns } from "./models";
import { BadRequestError } from "@app/lib/errors"; import { BadRequestError } from "@app/lib/errors";
const ldif = require("ldif"); // @ts-ignore
import ldif from "ldif";
const generatePassword = () => { const generatePassword = () => {
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~!*$#"; const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~!*$#";
@@ -43,7 +44,7 @@ const generateLDIF = ({
EncodedPassword: encodePassword(password) EncodedPassword: encodePassword(password)
}; };
const ldif = render(ldifTemplate, data); const ldif = mustache.render(ldifTemplate, data);
return ldif; return ldif;
}; };