@decaf-ts/for-typeorm 0.0.23 → 0.0.24

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.
Files changed (138) hide show
  1. package/LICENSE.md +159 -17
  2. package/README.md +24 -2
  3. package/dist/for-typeorm.cjs +2 -3436
  4. package/dist/for-typeorm.cjs.map +1 -0
  5. package/dist/for-typeorm.js +2 -0
  6. package/dist/for-typeorm.js.map +1 -0
  7. package/lib/TypeORMAdapter.cjs +1 -1
  8. package/lib/TypeORMAdapter.js.map +1 -0
  9. package/lib/TypeORMDispatch.cjs +1 -1
  10. package/lib/TypeORMDispatch.js.map +1 -0
  11. package/lib/TypeORMEventSubscriber.cjs +1 -1
  12. package/lib/TypeORMEventSubscriber.js.map +1 -0
  13. package/lib/TypeORMRepository.cjs +1 -1
  14. package/lib/TypeORMRepository.js.map +1 -0
  15. package/lib/constants.cjs +1 -1
  16. package/lib/constants.js.map +1 -0
  17. package/lib/decorators.cjs +1 -1
  18. package/lib/decorators.js.map +1 -0
  19. package/lib/errors.cjs +1 -1
  20. package/lib/errors.js.map +1 -0
  21. package/lib/esm/TypeORMAdapter.js +1 -1
  22. package/lib/esm/TypeORMAdapter.js.map +1 -0
  23. package/lib/esm/TypeORMDispatch.js +1 -1
  24. package/lib/esm/TypeORMDispatch.js.map +1 -0
  25. package/lib/esm/TypeORMEventSubscriber.js +1 -1
  26. package/lib/esm/TypeORMEventSubscriber.js.map +1 -0
  27. package/lib/esm/TypeORMRepository.js +1 -1
  28. package/lib/esm/TypeORMRepository.js.map +1 -0
  29. package/lib/esm/constants.js +1 -1
  30. package/lib/esm/constants.js.map +1 -0
  31. package/lib/esm/decorators.js +1 -1
  32. package/lib/esm/decorators.js.map +1 -0
  33. package/lib/esm/errors.js +1 -1
  34. package/lib/esm/errors.js.map +1 -0
  35. package/lib/esm/index.d.ts +1 -1
  36. package/lib/esm/index.js +2 -2
  37. package/lib/esm/index.js.map +1 -0
  38. package/lib/esm/indexes/generator.js +1 -1
  39. package/lib/esm/indexes/generator.js.map +1 -0
  40. package/lib/esm/indexes/index.js +1 -1
  41. package/lib/esm/indexes/index.js.map +1 -0
  42. package/lib/esm/overrides/Column.js +1 -1
  43. package/lib/esm/overrides/Column.js.map +1 -0
  44. package/lib/esm/overrides/CreateDateColumn.js +1 -1
  45. package/lib/esm/overrides/CreateDateColumn.js.map +1 -0
  46. package/lib/esm/overrides/Entity.js +1 -1
  47. package/lib/esm/overrides/Entity.js.map +1 -0
  48. package/lib/esm/overrides/ManyToMany.js +1 -1
  49. package/lib/esm/overrides/ManyToMany.js.map +1 -0
  50. package/lib/esm/overrides/ManyToOne.js +1 -1
  51. package/lib/esm/overrides/ManyToOne.js.map +1 -0
  52. package/lib/esm/overrides/ObjectUtils.js +1 -1
  53. package/lib/esm/overrides/ObjectUtils.js.map +1 -0
  54. package/lib/esm/overrides/OneToMany.js +1 -1
  55. package/lib/esm/overrides/OneToMany.js.map +1 -0
  56. package/lib/esm/overrides/OneToOne.js +1 -1
  57. package/lib/esm/overrides/OneToOne.js.map +1 -0
  58. package/lib/esm/overrides/PrimaryColumn.js +1 -1
  59. package/lib/esm/overrides/PrimaryColumn.js.map +1 -0
  60. package/lib/esm/overrides/PrimaryGeneratedColumn.js +1 -1
  61. package/lib/esm/overrides/PrimaryGeneratedColumn.js.map +1 -0
  62. package/lib/esm/overrides/UpdateDateColumn.js +1 -1
  63. package/lib/esm/overrides/UpdateDateColumn.js.map +1 -0
  64. package/lib/esm/overrides/utils.js +1 -1
  65. package/lib/esm/overrides/utils.js.map +1 -0
  66. package/lib/esm/query/Paginator.js +1 -1
  67. package/lib/esm/query/Paginator.js.map +1 -0
  68. package/lib/esm/query/Statement.js +1 -1
  69. package/lib/esm/query/Statement.js.map +1 -0
  70. package/lib/esm/query/constants.js +1 -1
  71. package/lib/esm/query/constants.js.map +1 -0
  72. package/lib/esm/query/index.js +1 -1
  73. package/lib/esm/query/index.js.map +1 -0
  74. package/lib/esm/query/translate.js +1 -1
  75. package/lib/esm/query/translate.js.map +1 -0
  76. package/lib/esm/raw/postgres.js +1 -1
  77. package/lib/esm/raw/postgres.js.map +1 -0
  78. package/lib/esm/sequences/Sequence.js +1 -1
  79. package/lib/esm/sequences/Sequence.js.map +1 -0
  80. package/lib/esm/sequences/index.js +1 -1
  81. package/lib/esm/sequences/index.js.map +1 -0
  82. package/lib/esm/types.js +1 -1
  83. package/lib/esm/types.js.map +1 -0
  84. package/lib/esm/utils.js +1 -1
  85. package/lib/esm/utils.js.map +1 -0
  86. package/lib/index.cjs +2 -2
  87. package/lib/index.d.ts +1 -1
  88. package/lib/index.js.map +1 -0
  89. package/lib/indexes/generator.cjs +1 -1
  90. package/lib/indexes/generator.js.map +1 -0
  91. package/lib/indexes/index.cjs +1 -1
  92. package/lib/indexes/index.js.map +1 -0
  93. package/lib/overrides/Column.cjs +1 -1
  94. package/lib/overrides/Column.js.map +1 -0
  95. package/lib/overrides/CreateDateColumn.cjs +1 -1
  96. package/lib/overrides/CreateDateColumn.js.map +1 -0
  97. package/lib/overrides/Entity.cjs +1 -1
  98. package/lib/overrides/Entity.js.map +1 -0
  99. package/lib/overrides/ManyToMany.cjs +1 -1
  100. package/lib/overrides/ManyToMany.js.map +1 -0
  101. package/lib/overrides/ManyToOne.cjs +1 -1
  102. package/lib/overrides/ManyToOne.js.map +1 -0
  103. package/lib/overrides/ObjectUtils.cjs +1 -1
  104. package/lib/overrides/ObjectUtils.js.map +1 -0
  105. package/lib/overrides/OneToMany.cjs +1 -1
  106. package/lib/overrides/OneToMany.js.map +1 -0
  107. package/lib/overrides/OneToOne.cjs +1 -1
  108. package/lib/overrides/OneToOne.js.map +1 -0
  109. package/lib/overrides/PrimaryColumn.cjs +1 -1
  110. package/lib/overrides/PrimaryColumn.js.map +1 -0
  111. package/lib/overrides/PrimaryGeneratedColumn.cjs +1 -1
  112. package/lib/overrides/PrimaryGeneratedColumn.js.map +1 -0
  113. package/lib/overrides/UpdateDateColumn.cjs +1 -1
  114. package/lib/overrides/UpdateDateColumn.js.map +1 -0
  115. package/lib/overrides/utils.cjs +1 -1
  116. package/lib/overrides/utils.js.map +1 -0
  117. package/lib/query/Paginator.cjs +1 -1
  118. package/lib/query/Paginator.js.map +1 -0
  119. package/lib/query/Statement.cjs +1 -1
  120. package/lib/query/Statement.js.map +1 -0
  121. package/lib/query/constants.cjs +1 -1
  122. package/lib/query/constants.js.map +1 -0
  123. package/lib/query/index.cjs +1 -1
  124. package/lib/query/index.js.map +1 -0
  125. package/lib/query/translate.cjs +1 -1
  126. package/lib/query/translate.js.map +1 -0
  127. package/lib/raw/postgres.cjs +1 -1
  128. package/lib/raw/postgres.js.map +1 -0
  129. package/lib/sequences/Sequence.cjs +1 -1
  130. package/lib/sequences/Sequence.js.map +1 -0
  131. package/lib/sequences/index.cjs +1 -1
  132. package/lib/sequences/index.js.map +1 -0
  133. package/lib/types.cjs +1 -1
  134. package/lib/types.js.map +1 -0
  135. package/lib/utils.cjs +1 -1
  136. package/lib/utils.js.map +1 -0
  137. package/package.json +12 -26
  138. package/dist/for-typeorm.esm.cjs +0 -3419
package/LICENSE.md CHANGED
@@ -1,22 +1,164 @@
1
- MIT License
1
+ Mozilla Public License Version 2.0
2
2
 
3
- Copyright (c) 2025 Tiago Venceslau and Contributors
3
+ 1. Definitions
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
5
+ "Contributor"
6
+ means each individual or legal entity that creates, contributes to the
7
+ creation of, or owns Covered Software.
11
8
 
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
9
+ "Contributor Version"
10
+ means the combination of the Contributions of others (if any) used by a
11
+ Contributor and that particular Contributor's Contribution.
14
12
 
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
13
+ "Covered Software"
14
+ means Source Code Form to which the initial Contributor has attached the
15
+ notice in Exhibit A, the Executable Form of such Source Code Form, and
16
+ Modifications of such Source Code Form.
22
17
 
18
+ "Executable Form"
19
+ means any form of the work other than Source Code Form.
20
+
21
+ "Larger Work"
22
+ means a work which combines Covered Software with other material, in a
23
+ separate file or files, that is not Covered Software.
24
+
25
+ "License"
26
+ means this document.
27
+
28
+ "Licensable"
29
+ means having the right to grant, to the maximum extent possible, whether
30
+ at the time of the making or afterwards, any and all of the rights
31
+ conveyed by this License.
32
+
33
+ "Modifications"
34
+ means any addition to or deletion from the contents of Covered Software
35
+ or any new file that contains Covered Software.
36
+
37
+ "Patent Claims"
38
+ means any patent claim(s), now owned or hereafter acquired, including
39
+ without limitation, method, process, and apparatus claims, in any patent
40
+ Licensable by grantor.
41
+
42
+ "Secondary License"
43
+ means either the GNU General Public License, Version 2.0, the GNU Lesser
44
+ General Public License, Version 2.1, the European Union Public License 1.1,
45
+ or any subsequent versions of those licenses that are designated as a
46
+ Secondary License in the notice in Exhibit A.
47
+
48
+ "Source Code Form"
49
+ means the form of the work preferred for making modifications.
50
+
51
+ "You" (or "Your")
52
+ means an individual or a legal entity exercising rights under, and
53
+ complying with all of the terms of, this License. For legal entities,
54
+ "You" includes any entity that controls, is controlled by, or is under
55
+ common control with You. For purposes of this definition, "control"
56
+ means (a) the power, direct or indirect, to cause the direction or
57
+ management of such entity, whether by contract or otherwise, or (b)
58
+ ownership of more than fifty percent (50%) of the outstanding shares or
59
+ beneficial ownership of such entity.
60
+
61
+ 2. License Grants and Conditions
62
+
63
+ Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive
64
+ license:
65
+
66
+ a. under intellectual property rights (other than patent or trademark)
67
+ Licensable by such Contributor to use, reproduce, make available,
68
+ modify, display, perform, distribute, and otherwise exploit its
69
+ Contributions, either on an exclusive or non-exclusive basis; and
70
+
71
+ b. under Patent Claims to make, use, sell, offer for sale, have made,
72
+ import, and otherwise transfer the Contribution(s) of such
73
+ Contributor, if any, in the Covered Software.
74
+
75
+ This license does not grant rights to any trademarks, service marks, or logos
76
+ of any Contributor (except as may be necessary to comply with the notice
77
+ requirements in Section 3.4).
78
+
79
+ 3. Distribution Obligations
80
+
81
+ 3.1. Distribution of Source Form
82
+
83
+ All distribution of Covered Software in Source Code Form, including any
84
+ Modifications that You create or to which You contribute, must be under the
85
+ terms of this License. You must inform recipients that the Source Code Form
86
+ of the Covered Software is governed by the terms of this License and include
87
+ a copy of this License in or with the Source Code Form.
88
+
89
+ 3.2. Distribution of Executable Form
90
+
91
+ If You distribute Covered Software in Executable Form then:
92
+
93
+ a. such Covered Software must also be made available in Source Code Form,
94
+ as described in Section 3.1, and You must inform recipients of the
95
+ Executable Form how to obtain a complete copy of the corresponding
96
+ Source Code Form in a reasonable manner on or through a medium
97
+ customarily used for software exchange; and
98
+
99
+ b. You may distribute the Executable Form under terms of your choice,
100
+ provided that You do not attempt to limit or alter the recipients'
101
+ rights in the Source Code Form under this License.
102
+
103
+ 3.3. Distribution of a Larger Work
104
+
105
+ You may create and distribute a work that combines Covered Software with
106
+ other material, and distribute the Larger Work as a single product. In such
107
+ case, the Covered Software must still be made available under this License
108
+ and must include the notices described in Exhibit A relating to the Covered
109
+ Software.
110
+
111
+ 3.4. Notices
112
+
113
+ You must cause each file that You distribute containing Covered Software to
114
+ carry the legal notices described in Exhibit A.
115
+
116
+ 4. Incompatible With Secondary Licenses
117
+
118
+ If the Covered Software is made available under the terms of this License
119
+ and also made available under the terms of a Secondary License, then the
120
+ terms of the Secondary License apply to the Covered Software in addition to
121
+ this License to the extent the Secondary License grants additional
122
+ permissions. If the Covered Software is not made available under a Secondary
123
+ License, then this License governs its use.
124
+
125
+ 5. Disclaimer of Warranty
126
+
127
+ Covered Software is provided "as is" without warranty of any kind, either
128
+ express or implied, including, but not limited to, the implied warranties of
129
+ merchantability, fitness for a particular purpose, and noninfringement.
130
+
131
+ 6. Limitation of Liability
132
+
133
+ In no event and under no legal theory, whether in tort (including
134
+ negligence), contract, or otherwise, unless required by applicable law (such
135
+ as deliberate and grossly negligent acts) or agreed to in writing, shall any
136
+ Contributor be liable to You for damages, including any direct, indirect,
137
+ special, incidental, or consequential damages of any character arising as a
138
+ result of this License or out of the use or inability to use the Covered
139
+ Software (including but not limited to damages for loss of goodwill, work
140
+ stoppage, computer failure or malfunction, or any and all other commercial
141
+ damages or losses), even if such Contributor has been advised of the
142
+ possibility of such damages.
143
+
144
+ 7. Termination
145
+
146
+ This License and the rights granted hereunder will terminate automatically
147
+ if You fail to comply with terms of this License and do not cure such
148
+ breach within thirty (30) days of becoming aware of the breach.
149
+
150
+ 8. Miscellaneous
151
+
152
+ This License constitutes the entire agreement between the parties with
153
+ respect to the subject matter hereof. If any provision of this License is
154
+ held to be unenforceable, that provision shall be reformed only to the
155
+ extent necessary to make it enforceable. The headings are for convenience
156
+ only and do not affect the interpretation.
157
+
158
+ Exhibit A - Source Code Form License Notice
159
+
160
+ This Source Code Form is subject to the terms of the Mozilla Public
161
+ License, v. 2.0. If a copy of the MPL was not distributed with this
162
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
163
+
164
+ Copyright (c) 2025 Tiago Venceslau and Contributors
package/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ ![Banner](./workdocs/assets/decaf-logo.svg)
2
+
1
3
  # Decaf.ts — TypeORM Integration
2
4
 
3
5
  A thin, focused TypeORM-backed adapter that plugs Decaf.ts models, repositories and query primitives into relational databases via TypeORM, keeping the same API you use across other Decaf adapters. It provides:
@@ -7,7 +9,6 @@ A thin, focused TypeORM-backed adapter that plugs Decaf.ts models, repositories
7
9
  - Decorator wiring: automatically wires Decaf decorators to TypeORM metadata on import (no need to use TypeORM decorators directly)
8
10
  - Utilities and types: constants, operator translation, raw Postgres types, and small helpers like convertJsRegexToPostgres
9
11
 
10
-
11
12
  ![Licence](https://img.shields.io/github/license/decaf-ts/ts-workspace.svg?style=plastic)
12
13
  ![GitHub language count](https://img.shields.io/github/languages/count/decaf-ts/ts-workspace?style=plastic)
13
14
  ![GitHub top language](https://img.shields.io/github/languages/top/decaf-ts/ts-workspace?style=plastic)
@@ -31,6 +32,9 @@ A thin, focused TypeORM-backed adapter that plugs Decaf.ts models, repositories
31
32
 
32
33
  Documentation available [here](https://decaf-ts.github.io/ts-workspace/)
33
34
 
35
+ Minimal size: 12.3 KB kb gzipped
36
+
37
+
34
38
  # Decaf.ts for TypeORM — Detailed Description
35
39
 
36
40
  Decaf.ts for TypeORM provides a complete implementation of Decaf.ts' data access abstractions backed by a TypeORM DataSource. It bridges Decaf models, repositories, and query primitives with TypeORM's ORM facilities, while keeping a consistent API across different database adapters in the Decaf.ts ecosystem.
@@ -630,6 +634,24 @@ The TypeORM adapter wires Decaf decorators into TypeORM metadata automatically o
630
634
  | @index(directionsOrName?, compositionsOrName?) | @Index() | Single or composite indexes are registered; when compositions are present, Index([prop, ...compositions]). |
631
635
 
632
636
 
637
+ ## Coding Principles
638
+
639
+ - group similar functionality in folders (analog to namespaces but without any namespace declaration)
640
+ - one class per file;
641
+ - one interface per file (unless interface is just used as a type);
642
+ - group types as other interfaces in a types.ts file per folder;
643
+ - group constants or enums in a constants.ts file per folder;
644
+ - group decorators in a decorators.ts file per folder;
645
+ - always import from the specific file, never from a folder or index file (exceptions for dependencies on other packages);
646
+ - prefer the usage of established design patters where applicable:
647
+ - Singleton (can be an anti-pattern. use with care);
648
+ - factory;
649
+ - observer;
650
+ - strategy;
651
+ - builder;
652
+ - etc;
653
+
654
+
633
655
  ### Related
634
656
 
635
657
  [![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=decaf-ts&repo=ts-workspace)](https://github.com/decaf-ts/ts-workspace)
@@ -666,6 +688,6 @@ So if you can, if this project in any way. either by learning something or simpl
666
688
 
667
689
  ## License
668
690
 
669
- This project is released under the [MIT License](./LICENSE.md).
691
+ This project is released under the [Mozilla Public License 2.0](./LICENSE.md).
670
692
 
671
693
  By developers, for developers...