typeorm-extensions 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -17,7 +17,7 @@ TypeORM Extensions is a library that provides additional functionality and exten
17
17
 
18
18
  To install `typeorm-extensions`:
19
19
 
20
- Npm:
20
+ Install using npm, yarn or pnpm:
21
21
  ```bash
22
22
  npm install typeorm-extensions
23
23
  ```
@@ -0,0 +1,21 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>API reference / typeorm-extensions</title>
7
+ </head>
8
+ <body>
9
+ <header>
10
+ <h1>API Reference</h1>
11
+ </header>
12
+
13
+ <nav>
14
+ <ul>
15
+ <li><a href="pagination">Pagination</a></li>
16
+ <li><a href="order">Order</a></li>
17
+ <li><a href="typed">Typed Extensions</a></li>
18
+ </ul>
19
+ </nav>
20
+ </body>
21
+ </html>
@@ -0,0 +1,77 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>applyOrderFilter / API reference / typeorm-extensions</title>
7
+ </head>
8
+ <body>
9
+ <header>
10
+ <h1>applyOrderFilter</h1>
11
+
12
+ </header>
13
+
14
+ <nav>
15
+ <ul>
16
+ <li><a href="../pagination">Pagination</a></li>
17
+ <li><a href="../order">Order</a></li>
18
+ <li><a href="../typed">Typed Extensions</a></li>
19
+ </ul>
20
+ </nav>
21
+
22
+ <main>
23
+ <section>
24
+ <h2>Description</h2>
25
+ <p>
26
+ <code>applyOrderFilter</code> is a method that applies order to a query.
27
+ </p>
28
+ </section>
29
+ <section>
30
+ <h2>Signature</h2>
31
+ <p>
32
+ <pre><code>applyOrderFilter(orderFilter: OrderFilter, orderOptions?: ApplyOrderOptions): void</code></pre>
33
+ </p>
34
+ </section>
35
+ <section>
36
+ <h2>Arguments</h2>
37
+ <ul>
38
+ <li>
39
+ <h3>orderFilter: OrderFilter</h3>
40
+ <p>The order options to apply to the query.</p>
41
+ <p>
42
+ <h4>Properties</h4>
43
+ <ul>
44
+ <li>
45
+ <h5>orderBy: Array< OrderParam ></h5>
46
+ <p>Order configurations.</p>
47
+ </li>
48
+ </ul>
49
+ </p>
50
+ </li>
51
+ <li>
52
+ <h3>(optional) orderOptions?: ApplyOrderOptions</h3>
53
+ <p>Additional options to apply to the order filter.</p>
54
+ <p>
55
+ <h4>Properties</h4>
56
+ <ul>
57
+ <li>
58
+ <h5>useDoubleQuotes?: boolean</h5>
59
+ <p>
60
+ Whether to wrap the order field with double qoutes (defaults to false).
61
+ </p>
62
+ </li>
63
+ <li>
64
+ ...TBD...
65
+ </li>
66
+ </ul>
67
+ </p>
68
+ </li>
69
+ </ul>
70
+ </section>
71
+ <section>
72
+ <h2>Usage</h2>
73
+ <pre><code>query.applyOrderFilter({ orderBy: [{ field: 'name', direction: 'asc', nulls: 'last' }] }, { useDoubleQuotes: true })</code></pre>
74
+ </section>
75
+ </main>
76
+ </body>
77
+ </html>
@@ -0,0 +1,36 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Order / Api reference / typeorm-extensions</title>
7
+ </head>
8
+ <body>
9
+ <header>
10
+ <h1>Category: Order</h1>
11
+ </header>
12
+
13
+ <main>
14
+ <section>
15
+ <h2>
16
+ Categories:
17
+ </h2>
18
+ <ul>
19
+ <li><a href="../pagination">Pagination</a></li>
20
+ <li><a href="../order">Order</a></li>
21
+ <li><a href="../typed">Typed Extensions</a></li>
22
+ </ul>
23
+ </section>
24
+
25
+ <section>
26
+ <h2>
27
+ Functions:
28
+ </h2>
29
+ <ul>
30
+ <li><a href="applyOrderFilter.html">applyOrderFilter</a></li>
31
+ <li><a href="applyOrder.html">applyOrder</a></li>
32
+ </ul>
33
+ </section>
34
+ </main>
35
+ </body>
36
+ </html>
@@ -0,0 +1,78 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>applyPaginationFilter / API reference / typeorm-extensions</title>
7
+ </head>
8
+ <body>
9
+ <header>
10
+ <h1>applyPaginationFilter</h1>
11
+
12
+ </header>
13
+
14
+ <nav>
15
+ <ul>
16
+ <li><a href="../pagination">Pagination</a></li>
17
+ <li><a href="../order">Order</a></li>
18
+ <li><a href="../typed">Typed Extensions</a></li>
19
+ </ul>
20
+ </nav>
21
+
22
+ <main>
23
+ <section>
24
+ <h2>Description</h2>
25
+ <p>
26
+ <code>applyPaginationFilter</code> is a method that applies pagination to a query.
27
+ </p>
28
+ </section>
29
+ <section>
30
+ <h2>Signature</h2>
31
+ <p>
32
+ <pre><code>applyPaginationFilter(paginationFilter: PaginationFilter, paginationOptions?: ApplyPaginationOptions): void</code></pre>
33
+ </p>
34
+ </section>
35
+ <section>
36
+ <h2>Arguments</h2>
37
+ <ul>
38
+ <li>
39
+ <h3>paginationFilter: PaginationFilter</h3>
40
+ <p>The pagination options to apply to the query.</p>
41
+ <p>
42
+ <h4>Properties</h4>
43
+ <ul>
44
+ <li>
45
+ <h5>page: number</h5>
46
+ <p>The page number to retrieve.</p>
47
+ </li>
48
+ <li>
49
+ <h5>pageSize: number</h5>
50
+ <p>The number of items per page.</p>
51
+ </li>
52
+ </ul>
53
+ </p>
54
+ </li>
55
+ <li>
56
+ <h3>(optional) paginationOptions?: ApplyPaginationOptions</h3>
57
+ <p>Additional options to apply to the pagination filter.</p>
58
+ <p>
59
+ <h4>Properties</h4>
60
+ <ul>
61
+ <li>
62
+ <h5>useTakeAndSkip?: boolean</h5>
63
+ <p>
64
+ Whether to use the <code>take</code> and <code>skip</code> methods instead of <code>limit</code> and <code>offset</code> (defaults to false).
65
+ </p>
66
+ </li>
67
+ </ul>
68
+ </p>
69
+ </li>
70
+ </ul>
71
+ </section>
72
+ <section>
73
+ <h2>Usage</h2>
74
+ <pre><code>query.applyPaginationFilter({ page: 1, pageSize: 10 }, { useTakeAndSkip: true })</code></pre>
75
+ </section>
76
+ </main>
77
+ </body>
78
+ </html>
@@ -0,0 +1,35 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Pagination / Api reference / typeorm-extensions</title>
7
+ </head>
8
+ <body>
9
+ <header>
10
+ <h1>Category: Pagination</h1>
11
+ </header>
12
+
13
+ <main>
14
+ <section>
15
+ <h2>
16
+ Categories:
17
+ </h2>
18
+ <ul>
19
+ <li><a href="../pagination">Pagination</a></li>
20
+ <li><a href="../order">Order</a></li>
21
+ <li><a href="../typed">Typed Extensions</a></li>
22
+ </ul>
23
+ </section>
24
+
25
+ <section>
26
+ <h2>
27
+ Functions:
28
+ </h2>
29
+ <ul>
30
+ <li><a href="applyPaginationFilter.html">applyPaginationFilter</a></li>
31
+ </ul>
32
+ </section>
33
+ </main>
34
+ </body>
35
+ </html>
@@ -0,0 +1,37 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Typed extensions / Api reference / typeorm-extensions</title>
7
+ </head>
8
+ <body>
9
+ <header>
10
+ <h1>Category: Typed Extensions</h1>
11
+ </header>
12
+
13
+ <main>
14
+
15
+ <section>
16
+ <h2>
17
+ Categories:
18
+ </h2>
19
+ <ul>
20
+ <li><a href="../pagination">Pagination</a></li>
21
+ <li><a href="../order">Order</a></li>
22
+ <li><a href="../typed">Typed Extensions</a></li>
23
+ </ul>
24
+ </section>
25
+
26
+ <section>
27
+ <h2>
28
+ Functions:
29
+ </h2>
30
+ <ul>
31
+ <li><a href="typed-where.html">whereTyped</a></li>
32
+ <li><a href="/">...TBD...</a></li>
33
+ </ul>
34
+ </section>
35
+ </main>
36
+ </body>
37
+ </html>
@@ -0,0 +1,21 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Examples / typeorm-extensions</title>
7
+ </head>
8
+ <body>
9
+ <header>
10
+ <h1>Examples</h1>
11
+ </header>
12
+
13
+ <nav>
14
+ <ul>
15
+ <li><a href="pagination">Pagination</a></li>
16
+ <li><a href="order">Order</a></li>
17
+ <li><a href="typed">Typed Extensions</a></li>
18
+ </ul>
19
+ </nav>
20
+ </body>
21
+ </html>
@@ -0,0 +1,78 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>typeorm-extensions</title>
5
+ <link rel="stylesheet" href="styles.css" />
6
+ </head>
7
+ <body>
8
+ <header>
9
+ <h1>Documentation</h1>
10
+ </header>
11
+
12
+ <nav>
13
+ <ul>
14
+ <li><a href="#getting-started">Getting Started</a></li>
15
+ <li><a href="#usage">Usage</a></li>
16
+ <li><a href="api_reference">API Reference</a></li>
17
+ <li><a href="examples">Examples</a></li>
18
+ </ul>
19
+ </nav>
20
+
21
+ <main>
22
+ <section id="getting-started">
23
+ <h2>Getting Started</h2>
24
+ <p>
25
+ <h3>Installation</h3>
26
+ <p>Install using npm, yarn or pnpm:</p>
27
+ <pre><code>npm install typeorm-extensions</code></pre>
28
+ </p>
29
+ <p>
30
+ <h3>Importing</h3>
31
+ <h4>Import the entire library:</h4>
32
+ <pre><code>import from 'typeorm-extensions';</code></pre>
33
+ <h4>Import the specific extension:</h4>
34
+ <pre><code>import from 'typeorm-extensions/dist/extensions/typed/typed-where/typed-where.extension';</code></pre>
35
+ </p>
36
+ </section>
37
+
38
+ <section id="api-reference">
39
+ <h2>API Reference</h2>
40
+ <p>
41
+ API documentation is available <a href="api_reference">here</a>
42
+ </p>
43
+ </section>
44
+
45
+ <section id="usage">
46
+ <h2>Usage</h2>
47
+ <p>
48
+ <h3>Pagination</h3>
49
+ <pre><code>query.applyPaginationFilter({ page: 1, pageSize: 10 }, { useTakeAndSkip: true })</code></pre>
50
+ </p>
51
+ <p>
52
+ <h3>Typed Where</h3>
53
+ <pre><code>query.whereTyped(user => user.name, 'ILIKE :search', { search: value })</code></pre>
54
+ </p>
55
+ <p>
56
+ <h3>Typed Order By</h3>
57
+ <pre><code>query.orderByTyped(user => user.name, 'ASC')</code></pre>
58
+ </p>
59
+ <p>
60
+ <h3>Typed Select</h3>
61
+ <pre><code>query.selectTyped(user => user.name)</code></pre>
62
+ </p>
63
+ <p>
64
+ <h3>Typed Join</h3>
65
+ <pre><code>query.leftJoinTyped(user => user.address, 'address')</code></pre>
66
+ </p>
67
+ <br>
68
+ <p>
69
+ For other examples please visit the <a href="examples">Examples</a> page.
70
+ </p>
71
+ </section>
72
+ </main>
73
+
74
+ <footer>
75
+ <p>&copy; 2024 typeorm-extensions</p>
76
+ </footer>
77
+ </body>
78
+ </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typeorm-extensions",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "typeorm commonly used extensions",
5
5
  "main": "./dist/index.js",
6
6
  "repository": {
@@ -1,4 +1,4 @@
1
1
  export * from './get-many-with-totals.extension';
2
- export * from './ordering.extension';
2
+ export * from './order.extension';
3
3
  export * from './pagination.extension';
4
4
  export * from './typed';