Skip to content

Commit

Permalink
[pub] 0.1.0
Browse files Browse the repository at this point in the history
[feat] where, whereAnd, whereOr, whereNot finished
[doc] docs genrated
  • Loading branch information
Ostad authored and Ostad committed Apr 14, 2020
1 parent 4649d07 commit 32d6f31
Show file tree
Hide file tree
Showing 22 changed files with 4,737 additions and 13 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ test/fixtures/test*
.idea

out
docs
dist
generated
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,25 @@ import { Generator } from "ldap-query-generator";

const generator = new Generator<User>();

generator
const generator = new Generator<User>();
const query = generator
.select(["otherMobile", "ou", "pager"])
.where({ field: "mobile", criteria: "404*" })
.whereAnd({ field: "memberOf", criteria: "admin*" })
.whereAnd({ field: "info", criteria: "my-info" })
.whereOr({ field: "mail", criteria: "*@domain.com" })
.whereOr({ field: "homePostalAddress", criteria: "*Georgia" })
.whereNot({ field: "middleName", criteria: "joe" })
.orderBy({ field: "msDS-NcType", order: "asc" })
.toString();

console.log(query);
```

Output:

```
(&(mobile=404*)(&(memberOf=admin*)(info=my-info))(|(mail=*@domain.com)(homePostalAddress=*Georgia))(!(middleName=joe)))
```

## TODO
Expand All @@ -32,5 +43,6 @@ generator
## Inspired By:

- [PHP LdapTools](http://www.phpldaptools.com/tutorials/Building-LDAP-Queries/)
- [KNEX.JS](http://knexjs.org/)
- [knex.js](http://knexjs.org/)
- [ldap.js](http://ldapjs.org/filters.html)
- [Adldap2](https://github.com/Adldap2/Adldap2)
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include:
- "_*_.html"
- "_*_.*.html"
3 changes: 3 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include:
- "_*_.html"
- "_*_.*.html"

0 comments on commit 32d6f31

Please sign in to comment.