Socket
Socket
Sign inDemoInstall

ldap-schema-ts-generator

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ldap-schema-ts-generator - npm Package Compare versions

Comparing version 3.1.2 to 3.2.0

dist/templates/generate-graphql-client-side-documents.d.ts

7

CHANGELOG.md

@@ -7,2 +7,9 @@ ### Changelog

#### [v3.1.2](https://github.com/saostad/ldap-schema-ts-generator/compare/v3.1.1...v3.1.2)
> 25 April 2020
- fix: camelcase graphql fields to mach best practices [`3a79a56`](https://github.com/saostad/ldap-schema-ts-generator/commit/3a79a56ac375cdb40dd8d6e72ffb95c92146d887)
- doc: change log [`5521425`](https://github.com/saostad/ldap-schema-ts-generator/commit/5521425e8a0fb46d352e23c6e023061766b2dbcd)
#### [v3.1.1](https://github.com/saostad/ldap-schema-ts-generator/compare/v3.1.0...v3.1.1)

@@ -9,0 +16,0 @@

56

dist/app.js

@@ -20,36 +20,40 @@ "use strict";

const schemaDn = await index_1.getSchemaNamingContext({ options });
const linkIds = await index_1.getLinkIds({ options, schemaDn });
const relations = index_1.getRelations(linkIds);
await index_1.generateRelationsFile({ relations });
const controls = await index_1.getSchemaControls({ options });
await index_1.generateControlsFile({ controls });
const extensions = await index_1.getSchemaExtensions({ options });
await index_1.generateExtensionsFile({ extensions });
const capabilities = await index_1.getSchemaCapabilities({ options });
await index_1.generateCapabilitiesFile({ capabilities });
const policies = await index_1.getSchemaPolicies({ options });
await index_1.generatePoliciesFile({ policies });
const classes = await index_1.getStructuralSchemaClasses({ schemaDn, options });
await index_1.generateStructuralClassesFile({ classes });
// const linkIds = await getLinkIds({ options, schemaDn });
// const relations = getRelations(linkIds);
// await generateRelationsFile({ relations });
// const controls = await getSchemaControls({ options });
// await generateControlsFile({ controls });
// const extensions = await getSchemaExtensions({ options });
// await generateExtensionsFile({ extensions });
// const capabilities = await getSchemaCapabilities({ options });
// await generateCapabilitiesFile({ capabilities });
// const policies = await getSchemaPolicies({ options });
// await generatePoliciesFile({ policies });
// const classes = await getStructuralSchemaClasses({ schemaDn, options });
// await generateStructuralClassesFile({ classes });
const objectAttributes = await index_1.getSchemaAttributes({ schemaDn, options });
const objectClasses = await index_1.getSchemaClasses({ schemaDn, options });
await index_1.generateInterfaceFiles({ objectAttributes, objectClasses });
// await generateInterfaceFiles({ objectAttributes, objectClasses });
await index_1.generateGraphqlTypeFiles({
objectClasses,
objectAttributes,
});
await index_1.generateGraphqlTypeFiles({
objectClasses,
objectAttributes,
options: {
justThisClasses: ["user", "group", "computer", "contact"],
generateClientSideDocuments: true,
},
});
await index_1.generateGraphqlTypeFiles({
objectClasses,
objectAttributes,
options: {
justThisClasses: ["user", "group", "computer", "contact"],
},
});
// await generateGraphqlTypeFiles<StructuralClasses>({
// objectClasses,
// objectAttributes,
// options: {
// justThisClasses: ["user"],
// generateClientSideDocuments: true,
// },
// });
// await generateGraphqlTypeFiles<keyof typeof StructuralClassesEnum>({
// objectClasses,
// objectAttributes,
// options: {
// justThisClasses: ["user", "group", "computer", "contact", "container"],
// },
// });
}

@@ -56,0 +60,0 @@ exports.main = main;

import { SchemaClass, SchemaAttribute } from "../services";
declare type GenerateGraphqlTypeFilesFnInput<T = any> = {
declare type GenerateGraphqlTypeFilesFnInput<T extends string> = {
objectClasses: Partial<SchemaClass>[];

@@ -15,2 +15,13 @@ objectAttributes: Partial<SchemaAttribute>[];

generateEnumTypeMaps?: boolean;
/** generate [client side documents](https://graphql-code-generator.com/docs/getting-started/documents-field). default false
* - queries with all possible fields
* - queries with just required fields
* - mutations
* - fragments for:
* - all fields
* - just required fields
*/
generateClientSideDocuments?: boolean;
/** directory of generated Client-Side Documents */
clientSideOutDir?: string;
/** use prettier to format generated files.

@@ -28,5 +39,5 @@ * - for graphql files, default { parser: "graphql" }

/** generate graphql schema files for each structural class
* @template StructuralClasses A generic parameter that controls possible values of options.justThisClasses array
* @template StructuralClasses A generic parameter that controls possible values of justThisClasses array in options
*/
export declare function generateGraphqlTypeFiles<StructuralClasses = any>({ objectClasses, objectAttributes, options, }: GenerateGraphqlTypeFilesFnInput<StructuralClasses>): Promise<void>;
export declare function generateGraphqlTypeFiles<StructuralClasses extends string = any>({ objectClasses, objectAttributes, options, }: GenerateGraphqlTypeFilesFnInput<StructuralClasses>): Promise<void>;
export {};

@@ -16,4 +16,5 @@ "use strict";

const write_ts_file_1 = require("./write-ts-file");
const generate_graphql_client_side_documents_1 = require("../templates/generate-graphql-client-side-documents");
/** generate graphql schema files for each structural class
* @template StructuralClasses A generic parameter that controls possible values of options.justThisClasses array
* @template StructuralClasses A generic parameter that controls possible values of justThisClasses array in options
*/

@@ -26,2 +27,6 @@ async function generateGraphqlTypeFiles({ objectClasses, objectAttributes, options, }) {

}
let clientSideOutDir = variables_1.defaultGraphqlClientDir;
if (options === null || options === void 0 ? void 0 : options.clientSideOutDir) {
clientSideOutDir = options.clientSideOutDir;
}
let usePrettier = true;

@@ -43,4 +48,8 @@ if (options === null || options === void 0 ? void 0 : options.usePrettier) {

}
let generateClientSideDocuments = false;
if (options === null || options === void 0 ? void 0 : options.generateClientSideDocuments) {
generateClientSideDocuments = options.generateClientSideDocuments;
}
const promises = [];
let StructuralClassesWithMeta = map_class_attributes_include_inherited_1.mapClassAttributesIncludeInherited({
const StructuralClassesWithMeta = map_class_attributes_include_inherited_1.mapClassAttributesIncludeInherited({
attributes: objectAttributes,

@@ -50,9 +59,5 @@ classes: objectClasses,

justStructuralClasses: true,
justThisClasses: options === null || options === void 0 ? void 0 : options.justThisClasses,
},
});
if (options === null || options === void 0 ? void 0 : options.justThisClasses) {
StructuralClassesWithMeta = StructuralClassesWithMeta.filter((el) => { var _a; return (_a =
// @ts-ignore
options.justThisClasses) === null || _a === void 0 ? void 0 : _a.includes(el.lDAPDisplayName); });
}
StructuralClassesWithMeta.forEach((classObj) => {

@@ -81,2 +86,12 @@ const rawOutput = generate_graphql_type_1.generateGraphqlType({ data: classObj });

}
if (generateClientSideDocuments) {
const rawDocumentsOutput = generate_graphql_client_side_documents_1.generateGraphqlClientSideDocuments({
data: classObj,
});
const DocFilePath = path_1.default.join(clientSideOutDir, `${change_case_1.pascalCase(classObj.lDAPDisplayName)}-Documents.${graphqlExtension}`);
promises.push(write_to_file_1.writeToFile(rawDocumentsOutput, {
filePath: DocFilePath,
prettierOptions: { parser: "graphql" },
}));
}
});

@@ -83,0 +98,0 @@ await Promise.all(promises);

@@ -9,18 +9,14 @@ import type { SchemaClass, SchemaAttribute } from "../services";

options?: {
/** default true */
/** structural classes with objectClassCategory=1. default true */
justStructuralClasses?: boolean;
/** list of classes to generate classes
* - if not provided it generate all structural classes (classes with objectClassCategory=1)
*/
justThisClasses?: string[];
};
};
/** @returns class attributes including inherited ones.
* @summary:
* 1. list auxiliary classes
* 2. list systemAuxiliary classes
* 3. create inheritance graph of structural classes with objectClassCategory=1 by following subClassOf field (class 'top' is parent of all classes)
* 4. get direct attributes of each class in graph
* 5. get direct attributes for class
* 6. merge direct attributes of class and override existing ones since direct attributes has more priority over attributes of auxiliary classes.
* - Note: child properties (override parent properties).
* if a field exist in parent and child, child's attributes should override parent's one. (Source: https://docs.oracle.com/cd/E23507_01/Platform.20073/RepositoryGuide/html/s1804itemdescriptorhierarchiesandinhe01.html)
* @note if a field exist in parent and child, child's attributes should override parent's one. (Source: https://docs.oracle.com/cd/E23507_01/Platform.20073/RepositoryGuide/html/s1804itemdescriptorhierarchiesandinhe01.html)
*/
export declare function mapClassAttributesIncludeInherited({ attributes, classes, options, }: MapClassAttributesIncludeInheritedFnInput): SchemaClassWithAttributes[];
export {};

@@ -7,15 +7,9 @@ "use strict";

/** @returns class attributes including inherited ones.
* @summary:
* 1. list auxiliary classes
* 2. list systemAuxiliary classes
* 3. create inheritance graph of structural classes with objectClassCategory=1 by following subClassOf field (class 'top' is parent of all classes)
* 4. get direct attributes of each class in graph
* 5. get direct attributes for class
* 6. merge direct attributes of class and override existing ones since direct attributes has more priority over attributes of auxiliary classes.
* - Note: child properties (override parent properties).
* if a field exist in parent and child, child's attributes should override parent's one. (Source: https://docs.oracle.com/cd/E23507_01/Platform.20073/RepositoryGuide/html/s1804itemdescriptorhierarchiesandinhe01.html)
* @note if a field exist in parent and child, child's attributes should override parent's one. (Source: https://docs.oracle.com/cd/E23507_01/Platform.20073/RepositoryGuide/html/s1804itemdescriptorhierarchiesandinhe01.html)
*/
function mapClassAttributesIncludeInherited({ attributes, classes, options, }) {
var _a;
fast_node_logger_1.writeLog(`mapClassAttributesIncludeInherited()`, { level: "trace" });
const classesWithDirectAttributes = classes.map((classObj) => {
/** all classes with direct attributes */
const classesWithAttributes = classes.map((classObj) => {
return map_class_attributes_1.mapClassAttributes({ attributes, classObj });

@@ -27,40 +21,28 @@ });

}
if (options && ((_a = options.justThisClasses) === null || _a === void 0 ? void 0 : _a.length) === 0) {
throw new Error("justThisClasses can't be empty array!");
}
if (justStructuralClasses) {
const structuralClasses = classes.filter((el) => el.objectClassCategory === "1");
const structuralClassesWithParents = structuralClasses.map((
/** this is the result of operation */
const structuralClassesWithParents = structuralClasses
.filter((el) => {
if (options && options.justThisClasses) {
return options.justThisClasses.includes(el.lDAPDisplayName);
}
/** default process all */
return true;
})
.map((
/** original raw structural class (attributes not processed)*/
originalStructuralClass) => {
var _a;
/** placeholder for list of parents. */
const superClasses = utils_1.getListOfParents({
targetClassSubClassOf: originalStructuralClass.subClassOf,
allClasses: classesWithDirectAttributes,
rawClass) => {
/** Original Structural Class with Direct Attributes */
const origClassObj = utils_1.findClass({
classesWithAttributes,
ldapDisplayName: rawClass.lDAPDisplayName,
});
/** placeholder for all auxiliary attributes including inherited ones. */
const mergedAuxiliaryAttributes = [];
superClasses.forEach((parentLdapName) => {
const parentClassItem = classesWithDirectAttributes.find((el) => el.lDAPDisplayName === parentLdapName);
if (!parentClassItem) {
throw new Error(`class ${parentClassItem} not found!`);
}
/** @step merge direct attributes of parent classes with it's auxiliary attributes */
/** */
const parentClassWithAllAttributes = utils_1.mergeAttributesOfAuxiliaryClasses({
targetClassLdapName: parentClassItem.lDAPDisplayName,
classesWithAttributes: classesWithDirectAttributes,
});
if (parentClassWithAllAttributes.attributes) {
mergedAuxiliaryAttributes.push(...parentClassWithAllAttributes.attributes);
}
const resultAttributes = utils_1.getAllAttributes({
classesWithAttributes,
targetClass: origClassObj,
});
/** @step override parent attributes with direct attributes if there are same ones */
/** Original Structural Class with Direct Attributes */
const origClassObj = classesWithDirectAttributes.find((el) => el.lDAPDisplayName === originalStructuralClass.lDAPDisplayName);
if (!origClassObj) {
throw new Error(`class ${origClassObj} not found!`);
}
const resultAttributes = utils_1.mergeAttributes({
importantAttributes: (_a = origClassObj.attributes) !== null && _a !== void 0 ? _a : [],
extraAttributes: mergedAuxiliaryAttributes,
});
return Object.assign(Object.assign({}, origClassObj), { attributes: resultAttributes });

@@ -67,0 +49,0 @@ });

@@ -20,37 +20,33 @@ import { SchemaClassWithAttributes, AnalysedAttributeFields } from "./map-class-attributes";

allClasses: Partial<SchemaClass>[];
/** ldapDisplayName of target class */
/** ldapDisplayName of target class. this will use as first parent */
targetClassSubClassOf: LDAPDisplayName;
};
/** follow subClassOf field in class schema to gets to the top class
/** follow subClassOf field of schema class object to gets to the top class
* @returns array of ldapDisplayName
*/
export declare function getListOfParents({ allClasses, targetClassSubClassOf, }: GetListOfParentsFnInput): LDAPDisplayName[];
declare type MergeAndOverrideAttributesFnInput = {
declare type MergeAttributesFnInput = {
/** keep these attributes in case same as extra attributes */
importantAttributes: AnalysedAttributeFields[];
/** these attributes will be overridden (less important to keep) in case same as extra attributes */
extraAttributes: AnalysedAttributeFields[];
};
/** Merge And Override Attributes */
export declare function mergeAttributes({ importantAttributes, extraAttributes, }: MergeAndOverrideAttributesFnInput): AnalysedAttributeFields[];
declare type MergeAttributesOfAuxiliaryClassesFnInput = {
export declare function mergeAttributes({ importantAttributes, extraAttributes, }: MergeAttributesFnInput): AnalysedAttributeFields[];
declare type FindClassFnInput = {
classesWithAttributes: SchemaClassWithAttributes[];
targetClassLdapName: LDAPDisplayName;
ldapDisplayName: LDAPDisplayName;
};
/** merge direct attributes with in auxiliaryClass and systemAuxiliaryClass fields to target class.
export declare function findClass({ classesWithAttributes, ldapDisplayName, }: FindClassFnInput): SchemaClassWithAttributes;
declare type GetAllAttributesFnInput = {
classesWithAttributes: SchemaClassWithAttributes[];
targetClass: SchemaClassWithAttributes;
};
/** merge direct attributes with in auxiliaryClass and systemAuxiliaryClass fields to target class respecting inheritance.
* @note :
* - it includes inherited attributes of parent classes
* - it ignores attributes of 'top' class
* @note :
* - it includes inherited attributes of parent classes
* - auxiliary classes can be subClassOf other auxiliary classes
* - auxiliary classes can have auxiliaryClass and systemAuxiliaryClass fields that reference to other auxiliary classes
* @plan for getting attributes of auxiliaryClass and systemAuxiliaryClass classes:
* 1. get directAttributes of target class
* 2. get auxiliary classes of target class
* 3. get direct attributes of that auxiliary class
* 4. merge it with attributes place holder already named auxiliaryAttributes array
* 5. get parent classes and filter-out 'top' and class name itself (some classes are subClassOf themselves!)
* 6. do the same steps above for parents classes recursively
* 7. merge auxiliaryAttributes with directAttributes (override directAttributes)
* - auxiliary classes can have auxiliaryClass and systemAuxiliaryClass fields that reference to other auxiliary classes.
*/
export declare function mergeAttributesOfAuxiliaryClasses({ targetClassLdapName, classesWithAttributes, }: MergeAttributesOfAuxiliaryClassesFnInput): SchemaClassWithAttributes;
export declare function getAllAttributes({ targetClass, classesWithAttributes, }: GetAllAttributesFnInput): AnalysedAttributeFields[];
export {};

@@ -77,6 +77,7 @@ "use strict";

exports.isOdd = isOdd;
/** follow subClassOf field in class schema to gets to the top class
/** follow subClassOf field of schema class object to gets to the top class
* @returns array of ldapDisplayName
*/
function getListOfParents({ allClasses, targetClassSubClassOf, }) {
fast_node_logger_1.writeLog(`getListOfParents()`, { level: "trace" });
/** placeholder for list of parents. */

@@ -100,3 +101,4 @@ const superClasses = [];

superClasses.push(parentLdapName);
return superClasses;
/** @note reverse() required in order to make sure the order of items is the way that 'top' is always in the top. it's required for override attributes when following subClassOf field. */
return superClasses.reverse();
}

@@ -106,2 +108,3 @@ exports.getListOfParents = getListOfParents;

function mergeAttributes({ importantAttributes, extraAttributes, }) {
fast_node_logger_1.writeLog(`mergeAttributes()`, { level: "trace" });
/**

@@ -125,102 +128,82 @@ * - this is an object that each field represent one attribute.

exports.mergeAttributes = mergeAttributes;
/** merge direct attributes with in auxiliaryClass and systemAuxiliaryClass fields to target class.
* @note :
* - it includes inherited attributes of parent classes
* - it ignores attributes of 'top' class
* @note :
* - auxiliary classes can be subClassOf other auxiliary classes
* - auxiliary classes can have auxiliaryClass and systemAuxiliaryClass fields that reference to other auxiliary classes
* @plan for getting attributes of auxiliaryClass and systemAuxiliaryClass classes:
* 1. get directAttributes of target class
* 2. get auxiliary classes of target class
* 3. get direct attributes of that auxiliary class
* 4. merge it with attributes place holder already named auxiliaryAttributes array
* 5. get parent classes and filter-out 'top' and class name itself (some classes are subClassOf themselves!)
* 6. do the same steps above for parents classes recursively
* 7. merge auxiliaryAttributes with directAttributes (override directAttributes)
function findClass({ classesWithAttributes, ldapDisplayName, }) {
fast_node_logger_1.writeLog(`findClass()`, { level: "trace" });
const classObj = classesWithAttributes.find((el) => el.lDAPDisplayName === ldapDisplayName);
if (!classObj) {
throw new Error(`class ${ldapDisplayName} not found!`);
}
return classObj;
}
exports.findClass = findClass;
/** merge direct attributes of targetClass with attributes of auxiliaryClass & systemAuxiliaryClass classes
* @note:
* - // TODO at this point it does not follow auxiliaryClass & systemAuxiliaryClass attributes of other auxiliary classes. (auxiliary classes can have auxiliaryClass and systemAuxiliaryClass fields that reference to other auxiliary classes)
* - // TODO at this point it does not follow subClassOf field. (auxiliary classes can be subClassOf other auxiliary classes)
*/
function mergeAttributesOfAuxiliaryClasses({ targetClassLdapName, classesWithAttributes, }) {
var _a, _b, _c;
const targetClass = classesWithAttributes.find((el) => el.lDAPDisplayName === targetClassLdapName);
if (!targetClass) {
throw new Error(`class ${targetClass} not found!`);
function mergeAttributesOfAuxiliaryClasses({ targetClass, classesWithAttributes, }) {
var _a;
fast_node_logger_1.writeLog(`mergeAttributesOfAuxiliaryClasses()`, { level: "trace" });
/** placeholder for ldap name of all classes that this class gets its attributes from */
const attributeClasses = [];
/**@step merge auxiliaryClass & systemAuxiliaryClass classes */
if (targetClass.auxiliaryClass) {
attributeClasses.push(...targetClass.auxiliaryClass);
}
/** place holder for all auxiliary attributes including inherited */
let auxiliaryAttributes = [];
/** @step process auxiliaryClass */
(_a = targetClass.auxiliaryClass) === null || _a === void 0 ? void 0 : _a.forEach((ldapDisplayName) => {
if (targetClass.systemAuxiliaryClass) {
attributeClasses.push(...targetClass.systemAuxiliaryClass);
}
/** placeholder for all attributes */
let classAttributes = [];
/**@step get attributes of attributeClasses */
attributeClasses.forEach((ldapDisplayName) => {
var _a;
const auxiliaryClassObj = classesWithAttributes.find((el) => el.lDAPDisplayName === ldapDisplayName);
if (!auxiliaryClassObj) {
throw new Error(`class ${ldapDisplayName} not found!`);
}
/** @step merge direct attributes with auxiliary attributes */
auxiliaryAttributes = mergeAttributes({
extraAttributes: (_a = auxiliaryClassObj.attributes) !== null && _a !== void 0 ? _a : [],
importantAttributes: auxiliaryAttributes,
const classObj = findClass({ classesWithAttributes, ldapDisplayName });
classAttributes = mergeAttributes({
importantAttributes: classAttributes,
extraAttributes: (_a = classObj.attributes) !== null && _a !== void 0 ? _a : [],
});
/** parents of each auxiliary class filter-out 'top' and itself */
const parentClasses = getListOfParents({
targetClassSubClassOf: ldapDisplayName,
allClasses: classesWithAttributes,
}).filter((el) => el !== "top" || el);
/** I know recursive programing is not good for performance,
* but at this point I want to finish this part!
* // TODO: get rid of recursive
*/
parentClasses.forEach((parentLdapName) => {
var _a;
const parentClassWithAllAttributes = mergeAttributesOfAuxiliaryClasses({
classesWithAttributes,
targetClassLdapName: parentLdapName,
});
/** @step merge parent attributes */
auxiliaryAttributes = mergeAttributes({
importantAttributes: auxiliaryAttributes,
extraAttributes: (_a = parentClassWithAllAttributes.attributes) !== null && _a !== void 0 ? _a : [],
});
});
});
/** @step process systemAuxiliaryClass */
(_b = targetClass.systemAuxiliaryClass) === null || _b === void 0 ? void 0 : _b.forEach((ldapDisplayName) => {
var _a;
const systemAuxiliaryClass = classesWithAttributes.find((el) => el.lDAPDisplayName === ldapDisplayName);
if (!systemAuxiliaryClass) {
throw new Error(`class ${ldapDisplayName} not found!`);
}
/** @step merge direct attributes with systemAuxiliaryClass attributes */
auxiliaryAttributes = mergeAttributes({
extraAttributes: (_a = systemAuxiliaryClass.attributes) !== null && _a !== void 0 ? _a : [],
importantAttributes: auxiliaryAttributes,
const allAttributes = mergeAttributes({
importantAttributes: (_a = targetClass.attributes) !== null && _a !== void 0 ? _a : [],
extraAttributes: classAttributes,
});
return allAttributes;
}
/** merge direct attributes with in auxiliaryClass and systemAuxiliaryClass fields to target class respecting inheritance.
* @note :
* - it includes inherited attributes of parent classes
* - auxiliary classes can be subClassOf other auxiliary classes
* - auxiliary classes can have auxiliaryClass and systemAuxiliaryClass fields that reference to other auxiliary classes.
*/
function getAllAttributes({ targetClass, classesWithAttributes, }) {
fast_node_logger_1.writeLog(`getAllAttributes()`, { level: "trace" });
const directAttributes = mergeAttributesOfAuxiliaryClasses({
classesWithAttributes,
targetClass,
});
let allAttributes = [];
const parents = getListOfParents({
allClasses: classesWithAttributes,
targetClassSubClassOf: targetClass.subClassOf,
});
/**@step merge attributes of all parent classes */
parents.forEach((ldapDisplayName) => {
const newTarget = findClass({ ldapDisplayName, classesWithAttributes });
const attributes = mergeAttributesOfAuxiliaryClasses({
classesWithAttributes,
targetClass: newTarget,
});
/** parents of each auxiliary class filter-out 'top' and itself */
const parentClasses = getListOfParents({
targetClassSubClassOf: ldapDisplayName,
allClasses: classesWithAttributes,
}).filter((el) => el !== "top" || el);
/** I know recursive programing is not good for performance,
* but at this point I want to finish this part!
* // TODO: get rid of recursive
*/
parentClasses.forEach((parentLdapName) => {
var _a;
const parentClassWithAllAttributes = mergeAttributesOfAuxiliaryClasses({
classesWithAttributes,
targetClassLdapName: parentLdapName,
});
/** @step merge parent attributes */
auxiliaryAttributes = mergeAttributes({
importantAttributes: auxiliaryAttributes,
extraAttributes: (_a = parentClassWithAllAttributes.attributes) !== null && _a !== void 0 ? _a : [],
});
allAttributes = mergeAttributes({
extraAttributes: allAttributes,
importantAttributes: attributes,
});
});
/** @step merge target direct attributes with all inherited auxiliary attributes */
const allAttributes = mergeAttributes({
importantAttributes: (_c = targetClass.attributes) !== null && _c !== void 0 ? _c : [],
extraAttributes: auxiliaryAttributes,
/**@step merge direct attributes of target class */
const result = mergeAttributes({
extraAttributes: allAttributes,
importantAttributes: directAttributes,
});
return Object.assign(Object.assign({}, targetClass), { attributes: allAttributes });
return result;
}
exports.mergeAttributesOfAuxiliaryClasses = mergeAttributesOfAuxiliaryClasses;
exports.getAllAttributes = getAllAttributes;
//# sourceMappingURL=utils.js.map

@@ -6,1 +6,2 @@ export declare const defaultOutDir: string;

export declare const defaultGraphqlDir: string;
export declare const defaultGraphqlClientDir: string;

@@ -12,2 +12,3 @@ "use strict";

exports.defaultGraphqlDir = path_1.default.join(exports.defaultOutDir, "graphql");
exports.defaultGraphqlClientDir = path_1.default.join(exports.defaultGraphqlDir, "client");
//# sourceMappingURL=variables.js.map
{
"name": "ldap-schema-ts-generator",
"version": "3.1.2",
"version": "3.2.0",
"description": "Typescript typedef and meta-data generator for LDAP Schema. It can be useful to interact from schema-aware/type-safe LDAP Client with LDAP servers like active directory.",

@@ -52,5 +52,5 @@ "repository": {

"@types/jest": "^25.2.1",
"@types/node": "^13.13.2",
"@typescript-eslint/eslint-plugin": "^2.29.0",
"@typescript-eslint/parser": "^2.29.0",
"@types/node": "^13.13.4",
"@typescript-eslint/eslint-plugin": "^2.30.0",
"@typescript-eslint/parser": "^2.30.0",
"auto-changelog": "^2.0.0",

@@ -65,3 +65,3 @@ "dotenv": "^8.2.0",

"ts-jest": "^25.4.0",
"typedoc": "^0.17.4",
"typedoc": "^0.17.6",
"typescript": "^3.8.3"

@@ -72,3 +72,3 @@ },

"fast-node-logger": "^1.4.0",
"ldap-query-generator": "^0.7.2",
"ldap-query-generator": "^0.8.0",
"ldap-ts-client": "^0.10.2",

@@ -75,0 +75,0 @@ "prettier": "^2.0.5"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc