@nymphjs/nymph 1.0.0-beta.7 → 1.0.0-beta.71

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 (65) hide show
  1. package/CHANGELOG.md +324 -0
  2. package/README.md +13 -21
  3. package/dist/Entity.d.ts +269 -7
  4. package/dist/Entity.js +491 -105
  5. package/dist/Entity.js.map +1 -1
  6. package/dist/Entity.test.js +39 -17
  7. package/dist/Entity.test.js.map +1 -1
  8. package/dist/Entity.types.d.ts +225 -19
  9. package/dist/Nymph.d.ts +423 -11
  10. package/dist/Nymph.js +685 -176
  11. package/dist/Nymph.js.map +1 -1
  12. package/dist/Nymph.types.d.ts +31 -7
  13. package/dist/Nymph.types.js +2 -1
  14. package/dist/Nymph.types.js.map +1 -1
  15. package/dist/conf/d.d.ts +26 -0
  16. package/dist/conf/defaults.js +22 -0
  17. package/dist/conf/defaults.js.map +1 -1
  18. package/dist/driver/NymphDriver.d.ts +129 -38
  19. package/dist/driver/NymphDriver.js +264 -131
  20. package/dist/driver/NymphDriver.js.map +1 -1
  21. package/dist/driver/testArtifacts.d.ts +1 -1
  22. package/dist/driver/testArtifacts.js +336 -42
  23. package/dist/driver/testArtifacts.js.map +1 -1
  24. package/dist/errors/EntityInvalidDataError.d.ts +6 -0
  25. package/dist/errors/EntityInvalidDataError.js +7 -1
  26. package/dist/errors/EntityInvalidDataError.js.map +1 -1
  27. package/dist/errors/EntityUniqueConstraintError.d.ts +3 -0
  28. package/dist/errors/EntityUniqueConstraintError.js +11 -0
  29. package/dist/errors/EntityUniqueConstraintError.js.map +1 -0
  30. package/dist/errors/InvalidStateError.d.ts +3 -0
  31. package/dist/errors/InvalidStateError.js +11 -0
  32. package/dist/errors/InvalidStateError.js.map +1 -0
  33. package/dist/errors/QueryFailedError.js +1 -0
  34. package/dist/errors/QueryFailedError.js.map +1 -1
  35. package/dist/errors/index.d.ts +2 -0
  36. package/dist/errors/index.js +2 -0
  37. package/dist/errors/index.js.map +1 -1
  38. package/dist/testArtifacts.d.ts +17 -5
  39. package/dist/testArtifacts.js +31 -27
  40. package/dist/testArtifacts.js.map +1 -1
  41. package/dist/testMocks.d.ts +15 -10
  42. package/dist/testMocks.js +37 -13
  43. package/dist/testMocks.js.map +1 -1
  44. package/dist/utils.d.ts +1 -1
  45. package/dist/utils.js +21 -5
  46. package/dist/utils.js.map +1 -1
  47. package/package.json +16 -14
  48. package/src/Entity.test.ts +32 -11
  49. package/src/Entity.ts +423 -134
  50. package/src/Entity.types.ts +32 -66
  51. package/src/Nymph.ts +618 -195
  52. package/src/Nymph.types.ts +97 -26
  53. package/src/conf/d.ts +8 -0
  54. package/src/conf/defaults.ts +24 -0
  55. package/src/driver/NymphDriver.ts +281 -311
  56. package/src/driver/testArtifacts.ts +384 -173
  57. package/src/errors/EntityUniqueConstraintError.ts +6 -0
  58. package/src/errors/InvalidStateError.ts +6 -0
  59. package/src/errors/index.ts +4 -0
  60. package/src/nymphJoiProps.ts +2 -2
  61. package/src/testArtifacts.ts +18 -19
  62. package/src/testMocks.ts +64 -32
  63. package/src/utils.ts +22 -8
  64. package/tsconfig.json +3 -3
  65. package/typedoc.json +4 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,330 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.0.0-beta.71](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.70...v1.0.0-beta.71) (2024-09-20)
7
+
8
+ **Note:** Version bump only for package @nymphjs/nymph
9
+
10
+ # [1.0.0-beta.70](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.69...v1.0.0-beta.70) (2024-09-20)
11
+
12
+ **Note:** Version bump only for package @nymphjs/nymph
13
+
14
+ # [1.0.0-beta.69](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.68...v1.0.0-beta.69) (2024-09-19)
15
+
16
+ **Note:** Version bump only for package @nymphjs/nymph
17
+
18
+ # [1.0.0-beta.68](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.67...v1.0.0-beta.68) (2024-09-19)
19
+
20
+ **Note:** Version bump only for package @nymphjs/nymph
21
+
22
+ # [1.0.0-beta.67](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.66...v1.0.0-beta.67) (2024-09-03)
23
+
24
+ ### Bug Fixes
25
+
26
+ - include modifications to subquery selectors from query callbacks ([dc73455](https://github.com/sciactive/nymphjs/commit/dc73455fe05867d2b38f1ea84e139ae57acb5ebb))
27
+
28
+ # [1.0.0-beta.66](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.65...v1.0.0-beta.66) (2024-08-06)
29
+
30
+ ### Bug Fixes
31
+
32
+ - improve performance of loading an entity's ac values ([8f716ae](https://github.com/sciactive/nymphjs/commit/8f716ae8208e2b8e5ffa1ebe4e28a6f09dd49c6a))
33
+
34
+ # [1.0.0-beta.65](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.64...v1.0.0-beta.65) (2024-08-05)
35
+
36
+ **Note:** Version bump only for package @nymphjs/nymph
37
+
38
+ # [1.0.0-beta.64](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.63...v1.0.0-beta.64) (2024-08-04)
39
+
40
+ ### Bug Fixes
41
+
42
+ - correctly split lines in importData ([121aa11](https://github.com/sciactive/nymphjs/commit/121aa1105942b275c94e7c7b8c083579d233b330))
43
+
44
+ # [1.0.0-beta.63](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.62...v1.0.0-beta.63) (2024-06-18)
45
+
46
+ ### Bug Fixes
47
+
48
+ - undo ts compilation to module change ([84be6d4](https://github.com/sciactive/nymphjs/commit/84be6d434be29f8afd53907d15be2eb77d1736ce))
49
+
50
+ ### Features
51
+
52
+ - allow importing from text and iterables ([9d766bd](https://github.com/sciactive/nymphjs/commit/9d766bdad4b0f17bc2dd68b0336a0064857eb4e9))
53
+ - export data iterator ([b86aa19](https://github.com/sciactive/nymphjs/commit/b86aa19fc77d744b5a683046dfb697fc4746df5c))
54
+
55
+ # [1.0.0-beta.62](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.61...v1.0.0-beta.62) (2024-06-15)
56
+
57
+ **Note:** Version bump only for package @nymphjs/nymph
58
+
59
+ # [1.0.0-beta.61](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.60...v1.0.0-beta.61) (2024-06-14)
60
+
61
+ **Note:** Version bump only for package @nymphjs/nymph
62
+
63
+ # [1.0.0-beta.60](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.59...v1.0.0-beta.60) (2024-06-14)
64
+
65
+ **Note:** Version bump only for package @nymphjs/nymph
66
+
67
+ # [1.0.0-beta.59](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.58...v1.0.0-beta.59) (2024-06-14)
68
+
69
+ ### Features
70
+
71
+ - add uniqueness constraint feature, refactor some types ([8133d32](https://github.com/sciactive/nymphjs/commit/8133d32b2c04907182dca2e9171b8217ed1b57e4))
72
+
73
+ # [1.0.0-beta.58](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.57...v1.0.0-beta.58) (2024-06-12)
74
+
75
+ **Note:** Version bump only for package @nymphjs/nymph
76
+
77
+ # [1.0.0-beta.57](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.56...v1.0.0-beta.57) (2024-06-12)
78
+
79
+ **Note:** Version bump only for package @nymphjs/nymph
80
+
81
+ # [1.0.0-beta.56](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.55...v1.0.0-beta.56) (2024-06-11)
82
+
83
+ ### Features
84
+
85
+ - add debug and error logging feature ([95680ef](https://github.com/sciactive/nymphjs/commit/95680efad0a260589f32e3d8cff0f4c4e7de413b))
86
+ - allow connections where tokens are not renewed ([39071a5](https://github.com/sciactive/nymphjs/commit/39071a545644075190bd8213be25e0a0c46d2b5d))
87
+ - make transaction optional during import and off by default ([08d79f8](https://github.com/sciactive/nymphjs/commit/08d79f8f803c846ac79c0c489fc754437dae082b))
88
+
89
+ # [1.0.0-beta.55](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.54...v1.0.0-beta.55) (2024-05-26)
90
+
91
+ ### Bug Fixes
92
+
93
+ - cache check with no selectors ([f3a6215](https://github.com/sciactive/nymphjs/commit/f3a6215c7b1443f039b979ed400823c6f7f88236))
94
+
95
+ # [1.0.0-beta.54](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.53...v1.0.0-beta.54) (2024-05-26)
96
+
97
+ **Note:** Version bump only for package @nymphjs/nymph
98
+
99
+ # [1.0.0-beta.53](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.52...v1.0.0-beta.53) (2024-05-26)
100
+
101
+ ### Features
102
+
103
+ - add pragma statements config to sqlite3 driver ([b0f27e2](https://github.com/sciactive/nymphjs/commit/b0f27e24df85663ea777565e5d352775efcad858))
104
+
105
+ # [1.0.0-beta.52](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.51...v1.0.0-beta.52) (2024-05-25)
106
+
107
+ ### Bug Fixes
108
+
109
+ - support setup app and users and groups when userFields is limited ([20e25a2](https://github.com/sciactive/nymphjs/commit/20e25a2bcc35f96b3146fd9d973e34083a85f854))
110
+
111
+ # [1.0.0-beta.51](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.50...v1.0.0-beta.51) (2024-04-12)
112
+
113
+ **Note:** Version bump only for package @nymphjs/nymph
114
+
115
+ # [1.0.0-beta.50](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.49...v1.0.0-beta.50) (2024-04-08)
116
+
117
+ **Note:** Version bump only for package @nymphjs/nymph
118
+
119
+ # [1.0.0-beta.49](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.48...v1.0.0-beta.49) (2024-03-04)
120
+
121
+ **Note:** Version bump only for package @nymphjs/nymph
122
+
123
+ # [1.0.0-beta.48](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.47...v1.0.0-beta.48) (2023-11-10)
124
+
125
+ **Note:** Version bump only for package @nymphjs/nymph
126
+
127
+ # [1.0.0-beta.47](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.46...v1.0.0-beta.47) (2023-11-10)
128
+
129
+ **Note:** Version bump only for package @nymphjs/nymph
130
+
131
+ # [1.0.0-beta.46](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.45...v1.0.0-beta.46) (2023-08-29)
132
+
133
+ **Note:** Version bump only for package @nymphjs/nymph
134
+
135
+ # [1.0.0-beta.45](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.44...v1.0.0-beta.45) (2023-07-17)
136
+
137
+ ### Bug Fixes
138
+
139
+ - missing pubsub updates when new top level match uses qref with multiple results ([6dc26e2](https://github.com/sciactive/nymphjs/commit/6dc26e280453794ea9ce6c2b77482f85eb62bd23))
140
+
141
+ # [1.0.0-beta.44](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.43...v1.0.0-beta.44) (2023-07-13)
142
+
143
+ **Note:** Version bump only for package @nymphjs/nymph
144
+
145
+ # [1.0.0-beta.43](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.42...v1.0.0-beta.43) (2023-07-12)
146
+
147
+ **Note:** Version bump only for package @nymphjs/nymph
148
+
149
+ # [1.0.0-beta.42](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.41...v1.0.0-beta.42) (2023-07-12)
150
+
151
+ ### Features
152
+
153
+ - make fillSession async so that gatekeeper can be sync ([fb6def4](https://github.com/sciactive/nymphjs/commit/fb6def45cd031516c9bcd3438f905e2ff881707b))
154
+
155
+ # [1.0.0-beta.41](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.40...v1.0.0-beta.41) (2023-07-12)
156
+
157
+ ### Features
158
+
159
+ - remove synchronous database queries ([b579fb2](https://github.com/sciactive/nymphjs/commit/b579fb2eacd96cdd1b386a62c5c00cdbb2438f6e))
160
+ - rewrite server side async api to match client side api ([9c537a8](https://github.com/sciactive/nymphjs/commit/9c537a8be49e9b989af0822a4c2236e8c2d20f87))
161
+
162
+ # [1.0.0-beta.40](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.39...v1.0.0-beta.40) (2023-07-10)
163
+
164
+ **Note:** Version bump only for package @nymphjs/nymph
165
+
166
+ # [1.0.0-beta.39](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.38...v1.0.0-beta.39) (2023-07-09)
167
+
168
+ **Note:** Version bump only for package @nymphjs/nymph
169
+
170
+ # [1.0.0-beta.38](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.37...v1.0.0-beta.38) (2023-07-09)
171
+
172
+ **Note:** Version bump only for package @nymphjs/nymph
173
+
174
+ # [1.0.0-beta.37](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.36...v1.0.0-beta.37) (2023-07-09)
175
+
176
+ **Note:** Version bump only for package @nymphjs/nymph
177
+
178
+ # [1.0.0-beta.36](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.35...v1.0.0-beta.36) (2023-07-09)
179
+
180
+ **Note:** Version bump only for package @nymphjs/nymph
181
+
182
+ # [1.0.0-beta.35](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.34...v1.0.0-beta.35) (2023-06-14)
183
+
184
+ ### Bug Fixes
185
+
186
+ - get class from nymph instead of using constructor ([fc8538e](https://github.com/sciactive/nymphjs/commit/fc8538ea24be79b845ab1e00f930542f34517bfb))
187
+
188
+ # [1.0.0-beta.34](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.33...v1.0.0-beta.34) (2023-05-13)
189
+
190
+ **Note:** Version bump only for package @nymphjs/nymph
191
+
192
+ # [1.0.0-beta.33](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.32...v1.0.0-beta.33) (2023-05-13)
193
+
194
+ **Note:** Version bump only for package @nymphjs/nymph
195
+
196
+ # [1.0.0-beta.32](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.31...v1.0.0-beta.32) (2023-05-13)
197
+
198
+ ### Features
199
+
200
+ - issue initial request with pubsub instead of rest on subscribe ([8a232d2](https://github.com/sciactive/nymphjs/commit/8a232d2faeb8622924f9c35a01a8f71a70659bb3))
201
+
202
+ # [1.0.0-beta.31](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.30...v1.0.0-beta.31) (2023-05-12)
203
+
204
+ **Note:** Version bump only for package @nymphjs/nymph
205
+
206
+ # [1.0.0-beta.30](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.29...v1.0.0-beta.30) (2023-05-12)
207
+
208
+ ### Features
209
+
210
+ - allow providing getEntityClass with a class instead of string ([ecd64c1](https://github.com/sciactive/nymphjs/commit/ecd64c1bf92e3657889613b76bcc46652f371ead))
211
+
212
+ # [1.0.0-beta.29](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.28...v1.0.0-beta.29) (2023-05-08)
213
+
214
+ ### Bug Fixes
215
+
216
+ - use 4 byte utf8 encoding in mysql ([c335b6e](https://github.com/sciactive/nymphjs/commit/c335b6e8416f935c9116e7f54de753d4b2255a73))
217
+
218
+ # [1.0.0-beta.28](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.27...v1.0.0-beta.28) (2023-05-05)
219
+
220
+ **Note:** Version bump only for package @nymphjs/nymph
221
+
222
+ # [1.0.0-beta.27](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.26...v1.0.0-beta.27) (2023-05-04)
223
+
224
+ ### Bug Fixes
225
+
226
+ - properly escape mysql ids with dots ([64bfaa5](https://github.com/sciactive/nymphjs/commit/64bfaa5d606f97a753ca7e6c5d2d86f7c0f7729a))
227
+
228
+ # [1.0.0-beta.26](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.25...v1.0.0-beta.26) (2023-05-04)
229
+
230
+ ### Features
231
+
232
+ - update packages and migrate to mysql2 ([72ad611](https://github.com/sciactive/nymphjs/commit/72ad611bd2bf7bf85c3ba8a3486503d9b50c49d6))
233
+
234
+ # [1.0.0-beta.25](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.24...v1.0.0-beta.25) (2023-05-04)
235
+
236
+ ### Bug Fixes
237
+
238
+ - don't create empty entities ([1d4d2e9](https://github.com/sciactive/nymphjs/commit/1d4d2e99af2e9cdc647bcf58ac34572836f41176))
239
+ - tilmeld uses wrong class when cloned with user ([059c2ce](https://github.com/sciactive/nymphjs/commit/059c2cedf1b07b9681e87c240eb36723a4581918))
240
+
241
+ ### Features
242
+
243
+ - add flags to disable rest and pubsub support on an entity class ([52106a3](https://github.com/sciactive/nymphjs/commit/52106a3d44065bcfec40d361344bf1eba59a5136)), closes [#1](https://github.com/sciactive/nymphjs/issues/1)
244
+
245
+ # [1.0.0-beta.24](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.23...v1.0.0-beta.24) (2023-05-02)
246
+
247
+ **Note:** Version bump only for package @nymphjs/nymph
248
+
249
+ # [1.0.0-beta.23](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.22...v1.0.0-beta.23) (2023-05-02)
250
+
251
+ ### Bug Fixes
252
+
253
+ - rare case where currentUser isn't corrent ([97f233a](https://github.com/sciactive/nymphjs/commit/97f233a5fcfd4b97dd282562b0c99097ac3ef41d))
254
+
255
+ # [1.0.0-beta.22](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.21...v1.0.0-beta.22) (2023-05-01)
256
+
257
+ **Note:** Version bump only for package @nymphjs/nymph
258
+
259
+ # [1.0.0-beta.21](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.20...v1.0.0-beta.21) (2023-05-01)
260
+
261
+ **Note:** Version bump only for package @nymphjs/nymph
262
+
263
+ # [1.0.0-beta.20](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.19...v1.0.0-beta.20) (2023-04-30)
264
+
265
+ **Note:** Version bump only for package @nymphjs/nymph
266
+
267
+ # [1.0.0-beta.19](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.18...v1.0.0-beta.19) (2023-04-29)
268
+
269
+ **Note:** Version bump only for package @nymphjs/nymph
270
+
271
+ # [1.0.0-beta.18](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.17...v1.0.0-beta.18) (2023-04-27)
272
+
273
+ ### Bug Fixes
274
+
275
+ - small type issues ([b91579c](https://github.com/sciactive/nymphjs/commit/b91579c9c1e96500d903332648f5a93c9a7e7d9b))
276
+
277
+ ### Features
278
+
279
+ - add the ability to switch to a user without their password ([ca4466a](https://github.com/sciactive/nymphjs/commit/ca4466af1704d68905ac087350a8cf151c1072d9))
280
+ - forbid modifying ac props from client ([f9e896f](https://github.com/sciactive/nymphjs/commit/f9e896f6c57b08ae100bc50d33a0234b6a431333))
281
+
282
+ # [1.0.0-beta.17](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.16...v1.0.0-beta.17) (2023-04-24)
283
+
284
+ **Note:** Version bump only for package @nymphjs/nymph
285
+
286
+ # [1.0.0-beta.16](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.15...v1.0.0-beta.16) (2023-03-31)
287
+
288
+ **Note:** Version bump only for package @nymphjs/nymph
289
+
290
+ # [1.0.0-beta.15](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.14...v1.0.0-beta.15) (2023-03-23)
291
+
292
+ ### Features
293
+
294
+ - add option to sort results by a property ([16384e7](https://github.com/sciactive/nymphjs/commit/16384e7bdab88abb55ccccabb06ac09f92fa8a03))
295
+
296
+ # [1.0.0-beta.14](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.13...v1.0.0-beta.14) (2023-03-17)
297
+
298
+ **Note:** Version bump only for package @nymphjs/nymph
299
+
300
+ # [1.0.0-beta.13](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.12...v1.0.0-beta.13) (2023-03-16)
301
+
302
+ ### Bug Fixes
303
+
304
+ - pubsub publishing changes before transaction is finished ([a918cc1](https://github.com/sciactive/nymphjs/commit/a918cc1451e03015ecce20f1c9bf6ceb62b7dff1))
305
+
306
+ # [1.0.0-beta.12](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.11...v1.0.0-beta.12) (2023-03-04)
307
+
308
+ **Note:** Version bump only for package @nymphjs/nymph
309
+
310
+ # [1.0.0-beta.11](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.10...v1.0.0-beta.11) (2023-02-27)
311
+
312
+ **Note:** Version bump only for package @nymphjs/nymph
313
+
314
+ # [1.0.0-beta.10](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.9...v1.0.0-beta.10) (2023-01-19)
315
+
316
+ **Note:** Version bump only for package @nymphjs/nymph
317
+
318
+ # [1.0.0-beta.9](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.8...v1.0.0-beta.9) (2023-01-09)
319
+
320
+ ### Bug Fixes
321
+
322
+ - reworked $is and $equals to better work with new instance based classes ([b1f3f0c](https://github.com/sciactive/nymphjs/commit/b1f3f0cca3e2b0dd392cd9da31167a6bd9487b40))
323
+
324
+ # [1.0.0-beta.8](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.7...v1.0.0-beta.8) (2023-01-09)
325
+
326
+ ### Features
327
+
328
+ - make entities in nymph client instance specific too ([1029f06](https://github.com/sciactive/nymphjs/commit/1029f061a1ad193e4a8a2dab0186b9a4b517f646))
329
+
6
330
  # [1.0.0-beta.7](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.6...v1.0.0-beta.7) (2023-01-05)
7
331
 
8
332
  ### Bug Fixes
package/README.md CHANGED
@@ -22,7 +22,7 @@ Here's an overview:
22
22
  // main.ts
23
23
  import { Nymph } from '@nymphjs/nymph';
24
24
  import MySQLDriver from '@nymphjs/driver-mysql';
25
- import Todo from './Todo';
25
+ import TodoClass from './Todo';
26
26
 
27
27
  const mysqlConfig = {
28
28
  host: 'your_db_host',
@@ -31,8 +31,10 @@ const mysqlConfig = {
31
31
  password: 'your_password',
32
32
  };
33
33
 
34
+ // Create a new instance of Nymph.
34
35
  const nymph = new Nymph({}, new MySQLDriver(mysqlConfig));
35
- nymph.addEntityClass(Todo);
36
+ // addEntityClass returns the class you should use for this instance of Nymph.
37
+ const Todo = nymph.addEntityClass(TodoClass);
36
38
 
37
39
  // You are set up. Now you can use entity classes like `Todo` to store data,
38
40
  // and Nymph's query methods like `getEntities` to retrieve them.
@@ -44,7 +46,7 @@ async function run() {
44
46
 
45
47
  const otherPendingTodos = await nymph.getEntities(
46
48
  { class: Todo },
47
- { type: '&', '!guid': myEntity.guid, equal: ['done', false] }
49
+ { type: '&', '!guid': myEntity.guid, equal: ['done', false] },
48
50
  );
49
51
 
50
52
  const total = otherPendingTodos.length;
@@ -52,7 +54,7 @@ async function run() {
52
54
  console.log(
53
55
  `Besides the one I just created, there ${
54
56
  single ? 'is' : 'are'
55
- } ${total} pending todo${single ? '' : 's'} in the database.`
57
+ } ${total} pending todo${single ? '' : 's'} in the database.`,
56
58
  );
57
59
  }
58
60
  ```
@@ -70,23 +72,13 @@ export default class Todo extends Entity<TodoData> {
70
72
  static ETYPE = 'todo'; // This is used for the table name(s) in the DB.
71
73
  static class = 'Todo'; // This is used to map references to their class.
72
74
 
73
- static async factory(guid?: string): Promise<Todo & TodoData> {
74
- return (await super.factory(guid)) as Todo & TodoData;
75
- }
76
-
77
- static factorySync(guid?: string): Todo & TodoData {
78
- return super.factorySync(guid) as Todo & TodoData;
79
- }
80
-
81
- constructor(guid?: string) {
82
- super(guid);
75
+ constructor() {
76
+ super();
83
77
 
84
- if (this.guid == null) {
85
- // Within the methods of an entity, you will use `this.$data` to access
86
- // its data. Outside, you don't need the $data part.
87
- this.$data.text = '';
88
- this.$data.done = false;
89
- }
78
+ // Within the methods of an entity, you will use `this.$data` to access
79
+ // its data. Outside, you don't need the $data part.
80
+ this.$data.text = '';
81
+ this.$data.done = false;
90
82
  }
91
83
 
92
84
  async $getOtherTodos() {
@@ -95,7 +87,7 @@ export default class Todo extends Entity<TodoData> {
95
87
  // instance of Nymph, so it could be a transactional instance.
96
88
  const otherTodos = await this.$nymph.getEntities(
97
89
  { class: Todo },
98
- { type: '!&', guid: this.guid }
90
+ { type: '!&', guid: this.guid },
99
91
  );
100
92
  return otherTodos;
101
93
  }