@nymphjs/client 1.0.0-beta.4 → 1.0.0-beta.40

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/CHANGELOG.md CHANGED
@@ -3,6 +3,191 @@
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.40](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.39...v1.0.0-beta.40) (2023-07-10)
7
+
8
+ ### Bug Fixes
9
+
10
+ - rewrite updateArray function to fix it ([22185c7](https://github.com/sciactive/nymphjs/commit/22185c7627f6dc616f9d3187ee8c9a383ca71441))
11
+
12
+ # [1.0.0-beta.39](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.38...v1.0.0-beta.39) (2023-07-09)
13
+
14
+ ### Bug Fixes
15
+
16
+ - go back to older code for updateArray, but better number handling ([7a58c98](https://github.com/sciactive/nymphjs/commit/7a58c983eac73839544361b4d32fb2dbb0881da2))
17
+
18
+ # [1.0.0-beta.38](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.37...v1.0.0-beta.38) (2023-07-09)
19
+
20
+ ### Bug Fixes
21
+
22
+ - pull value from the array in updateArray function ([352d1ea](https://github.com/sciactive/nymphjs/commit/352d1eab0cf8868f672ce0350564eb75ac9d4a45))
23
+ - simplify updateArray code ([348154c](https://github.com/sciactive/nymphjs/commit/348154c4d42b1e2b54bc491c1588a59c7c48984c))
24
+
25
+ # [1.0.0-beta.37](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.36...v1.0.0-beta.37) (2023-07-09)
26
+
27
+ ### Bug Fixes
28
+
29
+ - correctly iterate through new arrays on updateArray pubsub method ([27d7cc8](https://github.com/sciactive/nymphjs/commit/27d7cc847d93300e3d76cf6fa528176c3d06ae67))
30
+
31
+ # [1.0.0-beta.36](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.35...v1.0.0-beta.36) (2023-07-09)
32
+
33
+ ### Bug Fixes
34
+
35
+ - use code 1000 for closing pubsub connection ([cbd56af](https://github.com/sciactive/nymphjs/commit/cbd56af98d0775dee36025d909a82a0af0633d72))
36
+
37
+ # [1.0.0-beta.35](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.34...v1.0.0-beta.35) (2023-06-14)
38
+
39
+ ### Features
40
+
41
+ - add iteratable server call support using event streams ([fa7c1ec](https://github.com/sciactive/nymphjs/commit/fa7c1ec869e1fb52db20c8245e98a681f73dbf83))
42
+
43
+ # [1.0.0-beta.34](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.33...v1.0.0-beta.34) (2023-05-13)
44
+
45
+ ### Bug Fixes
46
+
47
+ - subscribeWith making guid null ([dbb38d4](https://github.com/sciactive/nymphjs/commit/dbb38d424f2395bbfa01ab4a0663dcaebf0c7aa7))
48
+
49
+ # [1.0.0-beta.33](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.32...v1.0.0-beta.33) (2023-05-13)
50
+
51
+ **Note:** Version bump only for package @nymphjs/client
52
+
53
+ # [1.0.0-beta.32](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.31...v1.0.0-beta.32) (2023-05-13)
54
+
55
+ ### Features
56
+
57
+ - issue initial request with pubsub instead of rest on subscribe ([8a232d2](https://github.com/sciactive/nymphjs/commit/8a232d2faeb8622924f9c35a01a8f71a70659bb3))
58
+
59
+ # [1.0.0-beta.31](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.30...v1.0.0-beta.31) (2023-05-12)
60
+
61
+ ### Bug Fixes
62
+
63
+ - pubsub client reconnect multiple times issue ([bba0897](https://github.com/sciactive/nymphjs/commit/bba08974fadf318d040f8844a2d583f6bc15b486))
64
+
65
+ # [1.0.0-beta.30](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.29...v1.0.0-beta.30) (2023-05-12)
66
+
67
+ ### Features
68
+
69
+ - allow providing getEntityClass with a class instead of string ([ecd64c1](https://github.com/sciactive/nymphjs/commit/ecd64c1bf92e3657889613b76bcc46652f371ead))
70
+
71
+ # [1.0.0-beta.29](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.28...v1.0.0-beta.29) (2023-05-08)
72
+
73
+ **Note:** Version bump only for package @nymphjs/client
74
+
75
+ # [1.0.0-beta.28](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.27...v1.0.0-beta.28) (2023-05-05)
76
+
77
+ ### Bug Fixes
78
+
79
+ - pubsub client auth ([979d913](https://github.com/sciactive/nymphjs/commit/979d9138abc86c7cef8b80b4f63c519b7b7ded78))
80
+
81
+ # [1.0.0-beta.27](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.26...v1.0.0-beta.27) (2023-05-04)
82
+
83
+ **Note:** Version bump only for package @nymphjs/client
84
+
85
+ # [1.0.0-beta.26](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.25...v1.0.0-beta.26) (2023-05-04)
86
+
87
+ ### Features
88
+
89
+ - update packages and migrate to mysql2 ([72ad611](https://github.com/sciactive/nymphjs/commit/72ad611bd2bf7bf85c3ba8a3486503d9b50c49d6))
90
+
91
+ # [1.0.0-beta.25](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.24...v1.0.0-beta.25) (2023-05-04)
92
+
93
+ ### Features
94
+
95
+ - 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)
96
+
97
+ # [1.0.0-beta.24](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.23...v1.0.0-beta.24) (2023-05-02)
98
+
99
+ **Note:** Version bump only for package @nymphjs/client
100
+
101
+ # [1.0.0-beta.23](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.22...v1.0.0-beta.23) (2023-05-02)
102
+
103
+ **Note:** Version bump only for package @nymphjs/client
104
+
105
+ # [1.0.0-beta.22](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.21...v1.0.0-beta.22) (2023-05-01)
106
+
107
+ **Note:** Version bump only for package @nymphjs/client
108
+
109
+ # [1.0.0-beta.21](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.20...v1.0.0-beta.21) (2023-05-01)
110
+
111
+ **Note:** Version bump only for package @nymphjs/client
112
+
113
+ # [1.0.0-beta.20](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.19...v1.0.0-beta.20) (2023-04-30)
114
+
115
+ **Note:** Version bump only for package @nymphjs/client
116
+
117
+ # [1.0.0-beta.19](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.18...v1.0.0-beta.19) (2023-04-29)
118
+
119
+ ### Bug Fixes
120
+
121
+ - some type issues ([ee69d5d](https://github.com/sciactive/nymphjs/commit/ee69d5d73361dacda5745d697df18fafd47810bc))
122
+
123
+ # [1.0.0-beta.18](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.17...v1.0.0-beta.18) (2023-04-27)
124
+
125
+ ### Features
126
+
127
+ - add the ability to switch to a user without their password ([ca4466a](https://github.com/sciactive/nymphjs/commit/ca4466af1704d68905ac087350a8cf151c1072d9))
128
+
129
+ # [1.0.0-beta.17](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.16...v1.0.0-beta.17) (2023-04-24)
130
+
131
+ **Note:** Version bump only for package @nymphjs/client
132
+
133
+ # [1.0.0-beta.16](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.15...v1.0.0-beta.16) (2023-03-31)
134
+
135
+ **Note:** Version bump only for package @nymphjs/client
136
+
137
+ # [1.0.0-beta.15](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.14...v1.0.0-beta.15) (2023-03-23)
138
+
139
+ ### Features
140
+
141
+ - add option to sort results by a property ([16384e7](https://github.com/sciactive/nymphjs/commit/16384e7bdab88abb55ccccabb06ac09f92fa8a03))
142
+
143
+ # [1.0.0-beta.14](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.13...v1.0.0-beta.14) (2023-03-17)
144
+
145
+ **Note:** Version bump only for package @nymphjs/client
146
+
147
+ # [1.0.0-beta.13](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.12...v1.0.0-beta.13) (2023-03-16)
148
+
149
+ ### Features
150
+
151
+ - add noAutoconnect option to pubsub client ([266e715](https://github.com/sciactive/nymphjs/commit/266e715988b34f3e0d58ac68178677d2086b5160))
152
+
153
+ # [1.0.0-beta.12](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.11...v1.0.0-beta.12) (2023-03-04)
154
+
155
+ **Note:** Version bump only for package @nymphjs/client
156
+
157
+ # [1.0.0-beta.11](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.10...v1.0.0-beta.11) (2023-02-27)
158
+
159
+ ### Features
160
+
161
+ - allow customizing HTTP status codes in response from server called methods ([8c5c3d4](https://github.com/sciactive/nymphjs/commit/8c5c3d4af741edabc1a8947aaebf026ba546c46a))
162
+
163
+ # [1.0.0-beta.10](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.9...v1.0.0-beta.10) (2023-01-19)
164
+
165
+ **Note:** Version bump only for package @nymphjs/client
166
+
167
+ # [1.0.0-beta.9](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.8...v1.0.0-beta.9) (2023-01-09)
168
+
169
+ ### Bug Fixes
170
+
171
+ - reworked $is and $equals to better work with new instance based classes ([b1f3f0c](https://github.com/sciactive/nymphjs/commit/b1f3f0cca3e2b0dd392cd9da31167a6bd9487b40))
172
+
173
+ # [1.0.0-beta.8](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.7...v1.0.0-beta.8) (2023-01-09)
174
+
175
+ ### Features
176
+
177
+ - make entities in nymph client instance specific too ([1029f06](https://github.com/sciactive/nymphjs/commit/1029f061a1ad193e4a8a2dab0186b9a4b517f646))
178
+
179
+ # [1.0.0-beta.7](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.6...v1.0.0-beta.7) (2023-01-05)
180
+
181
+ **Note:** Version bump only for package @nymphjs/client
182
+
183
+ # [1.0.0-beta.6](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.5...v1.0.0-beta.6) (2023-01-05)
184
+
185
+ **Note:** Version bump only for package @nymphjs/client
186
+
187
+ # [1.0.0-beta.5](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.4...v1.0.0-beta.5) (2022-11-24)
188
+
189
+ **Note:** Version bump only for package @nymphjs/client
190
+
6
191
  # [1.0.0-beta.4](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.3...v1.0.0-beta.4) (2022-11-23)
7
192
 
8
193
  ### Bug Fixes
package/README.md CHANGED
@@ -18,7 +18,7 @@ Here's an overview:
18
18
 
19
19
  ```ts
20
20
  import { Nymph, PubSub } from '@nymphjs/client';
21
- import Todo from 'Todo';
21
+ import TodoClass from 'Todo';
22
22
 
23
23
  const nymphOptions = {
24
24
  restUrl: 'https://yournymphrestserver/path/to/your/endpoint',
@@ -26,7 +26,7 @@ const nymphOptions = {
26
26
  };
27
27
  const nymph = new Nymph(nymphOptions);
28
28
  const pubsub = new PubSub(nymphOptions, nymph);
29
- nymph.addEntityClass(Todo);
29
+ const Todo = nymph.addEntityClass(TodoClass);
30
30
 
31
31
  // Now you can use Nymph and PubSub.
32
32
  const myTodo = new Todo();
@@ -0,0 +1,53 @@
1
+ async function* iterate() {
2
+ let values = [1, 2, 3];
3
+ let finished = false;
4
+
5
+ let promise = new Promise((resolve) => {
6
+ setTimeout(() => {
7
+ promise = new Promise((resolve) => {
8
+ setTimeout(() => {
9
+ values.push(4);
10
+ promise = new Promise((resolve) => {
11
+ setTimeout(() => {
12
+ values.push(5, 6);
13
+ finished = true;
14
+ resolve();
15
+ }, 3000);
16
+ });
17
+ resolve();
18
+ }, 3000);
19
+ });
20
+ resolve();
21
+ }, 0);
22
+ });
23
+
24
+ const iterable = {
25
+ async *[Symbol.asyncIterator]() {
26
+ do {
27
+ await promise;
28
+
29
+ while (values.length) {
30
+ yield values.shift();
31
+ }
32
+ } while (!finished);
33
+ },
34
+ };
35
+
36
+ yield* iterable;
37
+ }
38
+
39
+ (async () => {
40
+ const iter = iterate();
41
+
42
+ for await (let value of iter) {
43
+ console.log(value);
44
+ }
45
+
46
+ console.log('done');
47
+
48
+ for await (let value of ['a', 'b', 'c']) {
49
+ console.log(value);
50
+ }
51
+
52
+ console.log('done');
53
+ })();