@signaldb/core 2.0.0-beta.2 → 2.0.0-beta.21
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/dist/.vite/manifest.json +183 -80
- package/dist/AsyncDataAdapter.d.ts +53 -7
- package/dist/AutoFetchDataAdapter.d.ts +4 -6
- package/dist/Collection/Cursor.d.ts +56 -4
- package/dist/Collection/Observer.d.ts +33 -0
- package/dist/Collection/index.d.ts +66 -19
- package/dist/Collection/types.d.ts +9 -2
- package/dist/DataAdapter.d.ts +24 -6
- package/dist/DefaultDataAdapter.d.ts +5 -5
- package/dist/WorkerDataAdapter.d.ts +57 -5
- package/dist/WorkerDataAdapterHost.d.ts +9 -7
- package/dist/createIndex.d.ts +2 -2
- package/dist/createIndexProvider.d.ts +2 -2
- package/dist/createReactivityAdapter.d.ts +2 -2
- package/dist/createStorageAdapter.d.ts +1 -1
- package/dist/getIndexInfo.d.ts +3 -4
- package/dist/index.cjs.js +33 -31
- package/dist/index.d.ts +6 -1
- package/dist/index.mjs +17 -32
- package/dist/index10.cjs.js +11 -0
- package/dist/index10.mjs +10 -18
- package/dist/index11.cjs.js +23 -0
- package/dist/index11.mjs +22 -15
- package/dist/index12.cjs.js +45 -0
- package/dist/index12.mjs +44 -353
- package/dist/index13.cjs.js +22 -0
- package/dist/index13.mjs +21 -419
- package/dist/index14.cjs.js +45 -0
- package/dist/index14.mjs +44 -206
- package/dist/index15.cjs.js +86 -0
- package/dist/index15.mjs +85 -388
- package/dist/index16.cjs.js +15 -0
- package/dist/index16.mjs +14 -579
- package/dist/index17.cjs.js +141 -0
- package/dist/index17.mjs +140 -152
- package/dist/index18.cjs.js +47 -0
- package/dist/index18.mjs +46 -26
- package/dist/index19.cjs.js +15 -0
- package/dist/index19.mjs +14 -41
- package/dist/index2.cjs.js +33 -0
- package/dist/index2.mjs +32 -258
- package/dist/index20.cjs.js +23 -0
- package/dist/index20.mjs +22 -16
- package/dist/index21.cjs.js +37 -0
- package/dist/index21.mjs +36 -104
- package/dist/index22.cjs.js +35 -0
- package/dist/index22.mjs +34 -128
- package/dist/index23.cjs.js +21 -0
- package/dist/index23.mjs +20 -7
- package/dist/index24.cjs.js +19 -0
- package/dist/index24.mjs +18 -27
- package/dist/index25.cjs.js +157 -0
- package/dist/index25.mjs +156 -11
- package/dist/index26.cjs.js +38 -0
- package/dist/index26.mjs +37 -29
- package/dist/index27.cjs.js +42 -0
- package/dist/index27.mjs +41 -46
- package/dist/index28.cjs.js +347 -0
- package/dist/index28.mjs +345 -7
- package/dist/index29.cjs.js +602 -0
- package/dist/index29.mjs +601 -7
- package/dist/index3.cjs.js +19 -0
- package/dist/index3.mjs +18 -556
- package/dist/index30.cjs.js +11 -0
- package/dist/index30.mjs +10 -42
- package/dist/index31.cjs.js +11 -0
- package/dist/index31.mjs +10 -29
- package/dist/index32.cjs.js +90 -0
- package/dist/index32.mjs +89 -10
- package/dist/index33.cjs.js +53 -0
- package/dist/index33.mjs +52 -5
- package/dist/index34.cjs.js +453 -0
- package/dist/index34.mjs +453 -0
- package/dist/index35.cjs.js +72 -0
- package/dist/index35.mjs +72 -0
- package/dist/index36.cjs.js +580 -0
- package/dist/index36.mjs +580 -0
- package/dist/index37.cjs.js +21 -0
- package/dist/index37.mjs +21 -0
- package/dist/index38.cjs.js +363 -0
- package/dist/index38.mjs +363 -0
- package/dist/index39.cjs.js +513 -0
- package/dist/index39.mjs +513 -0
- package/dist/index4.cjs.js +209 -0
- package/dist/index4.mjs +204 -5
- package/dist/index5.cjs.js +187 -0
- package/dist/index5.mjs +186 -5
- package/dist/index6.cjs.js +303 -0
- package/dist/index6.mjs +301 -28
- package/dist/index7.cjs.js +125 -0
- package/dist/index7.mjs +124 -12
- package/dist/index8.cjs.js +33 -0
- package/dist/index8.mjs +32 -5
- package/dist/index9.cjs.js +12 -0
- package/dist/index9.mjs +11 -133
- package/dist/types/IndexProvider.d.ts +2 -2
- package/dist/types/Modifier.d.ts +1 -1
- package/dist/types/ReactivityAdapter.d.ts +1 -1
- package/dist/types/StorageAdapter.d.ts +9 -1
- package/dist/utils/applyQueryOptions.d.ts +15 -0
- package/dist/utils/createSignal.d.ts +2 -2
- package/dist/utils/getMatchingKeys.d.ts +2 -2
- package/dist/utils/idIndexQuery.d.ts +20 -0
- package/dist/utils/incrementalQueryUpdate.d.ts +62 -0
- package/dist/utils/isFieldExpression.d.ts +1 -1
- package/dist/utils/match.d.ts +1 -1
- package/dist/utils/modify.d.ts +1 -1
- package/dist/utils/projectItems.d.ts +12 -0
- package/dist/utils/queryDelta.d.ts +83 -0
- package/dist/utils/queryId.d.ts +2 -2
- package/dist/utils/reactiveOrAsync.d.ts +59 -0
- package/dist/utils/storageIndexQuery.d.ts +20 -0
- package/package.json +1 -1
- package/dist/index.cjs10.js +0 -18
- package/dist/index.cjs11.js +0 -15
- package/dist/index.cjs12.js +0 -353
- package/dist/index.cjs13.js +0 -419
- package/dist/index.cjs14.js +0 -206
- package/dist/index.cjs15.js +0 -388
- package/dist/index.cjs16.js +0 -579
- package/dist/index.cjs17.js +0 -152
- package/dist/index.cjs18.js +0 -26
- package/dist/index.cjs19.js +0 -42
- package/dist/index.cjs2.js +0 -259
- package/dist/index.cjs20.js +0 -16
- package/dist/index.cjs21.js +0 -104
- package/dist/index.cjs22.js +0 -129
- package/dist/index.cjs23.js +0 -7
- package/dist/index.cjs24.js +0 -27
- package/dist/index.cjs25.js +0 -10
- package/dist/index.cjs26.js +0 -29
- package/dist/index.cjs27.js +0 -46
- package/dist/index.cjs28.js +0 -8
- package/dist/index.cjs29.js +0 -7
- package/dist/index.cjs3.js +0 -557
- package/dist/index.cjs30.js +0 -42
- package/dist/index.cjs31.js +0 -29
- package/dist/index.cjs32.js +0 -9
- package/dist/index.cjs33.js +0 -5
- package/dist/index.cjs4.js +0 -5
- package/dist/index.cjs5.js +0 -5
- package/dist/index.cjs6.js +0 -29
- package/dist/index.cjs7.js +0 -12
- package/dist/index.cjs8.js +0 -5
- package/dist/index.cjs9.js +0 -133
package/dist/.vite/manifest.json
CHANGED
|
@@ -1,117 +1,143 @@
|
|
|
1
1
|
{
|
|
2
2
|
"src/AsyncDataAdapter.ts": {
|
|
3
|
-
"file": "
|
|
3
|
+
"file": "index34.cjs.js",
|
|
4
4
|
"name": "AsyncDataAdapter",
|
|
5
5
|
"src": "src/AsyncDataAdapter.ts",
|
|
6
|
+
"isDynamicEntry": true,
|
|
6
7
|
"imports": [
|
|
8
|
+
"src/getIndexInfo.ts",
|
|
7
9
|
"src/utils/deepClone.ts",
|
|
10
|
+
"src/utils/idIndexQuery.ts",
|
|
11
|
+
"src/utils/incrementalQueryUpdate.ts",
|
|
12
|
+
"src/utils/isEqual.ts",
|
|
8
13
|
"src/utils/match.ts",
|
|
9
14
|
"src/utils/modify.ts",
|
|
15
|
+
"src/utils/projectItems.ts",
|
|
16
|
+
"src/utils/queryDelta.ts",
|
|
10
17
|
"src/utils/queryId.ts",
|
|
11
|
-
"src/utils/isEqual.ts",
|
|
12
|
-
"src/getIndexInfo.ts",
|
|
13
|
-
"src/utils/getMatchingKeys.ts",
|
|
14
18
|
"src/utils/sortItems.ts",
|
|
15
|
-
"src/utils/
|
|
19
|
+
"src/utils/storageIndexQuery.ts"
|
|
16
20
|
]
|
|
17
21
|
},
|
|
18
22
|
"src/AutoFetchDataAdapter.ts": {
|
|
19
|
-
"file": "
|
|
23
|
+
"file": "index39.cjs.js",
|
|
20
24
|
"name": "AutoFetchDataAdapter",
|
|
21
25
|
"src": "src/AutoFetchDataAdapter.ts",
|
|
26
|
+
"isDynamicEntry": true,
|
|
22
27
|
"imports": [
|
|
28
|
+
"src/getIndexInfo.ts",
|
|
23
29
|
"src/utils/deepClone.ts",
|
|
30
|
+
"src/utils/idIndexQuery.ts",
|
|
31
|
+
"src/utils/isEqual.ts",
|
|
24
32
|
"src/utils/match.ts",
|
|
25
33
|
"src/utils/modify.ts",
|
|
34
|
+
"src/utils/project.ts",
|
|
26
35
|
"src/utils/queryId.ts",
|
|
27
|
-
"src/utils/isEqual.ts",
|
|
28
|
-
"src/getIndexInfo.ts",
|
|
29
|
-
"src/utils/getMatchingKeys.ts",
|
|
30
36
|
"src/utils/sortItems.ts",
|
|
31
|
-
"src/utils/
|
|
37
|
+
"src/utils/storageIndexQuery.ts"
|
|
32
38
|
]
|
|
33
39
|
},
|
|
34
40
|
"src/Collection/Cursor.ts": {
|
|
35
|
-
"file": "
|
|
41
|
+
"file": "index6.cjs.js",
|
|
36
42
|
"name": "Collection/Cursor",
|
|
37
43
|
"src": "src/Collection/Cursor.ts",
|
|
44
|
+
"isDynamicEntry": true,
|
|
38
45
|
"imports": [
|
|
39
46
|
"src/Collection/Observer.ts"
|
|
40
47
|
]
|
|
41
48
|
},
|
|
42
49
|
"src/Collection/Observer.ts": {
|
|
43
|
-
"file": "
|
|
50
|
+
"file": "index5.cjs.js",
|
|
44
51
|
"name": "Collection/Observer",
|
|
45
52
|
"src": "src/Collection/Observer.ts",
|
|
53
|
+
"isDynamicEntry": true,
|
|
46
54
|
"imports": [
|
|
47
55
|
"src/utils/isEqual.ts",
|
|
56
|
+
"src/utils/queryDelta.ts",
|
|
48
57
|
"src/utils/uniqueBy.ts"
|
|
49
58
|
]
|
|
50
59
|
},
|
|
51
60
|
"src/Collection/index.ts": {
|
|
52
|
-
"file": "
|
|
61
|
+
"file": "index29.cjs.js",
|
|
53
62
|
"name": "Collection/index",
|
|
54
63
|
"src": "src/Collection/index.ts",
|
|
64
|
+
"isDynamicEntry": true,
|
|
55
65
|
"imports": [
|
|
66
|
+
"src/Collection/Cursor.ts",
|
|
67
|
+
"src/DefaultDataAdapter.ts",
|
|
68
|
+
"src/createIndex.ts",
|
|
56
69
|
"src/utils/EventEmitter.ts",
|
|
57
70
|
"src/utils/createSignal.ts",
|
|
58
|
-
"src/utils/randomId.ts",
|
|
59
|
-
"src/DefaultDataAdapter.ts",
|
|
60
|
-
"src/utils/modify.ts",
|
|
61
71
|
"src/utils/deepClone.ts",
|
|
72
|
+
"src/utils/modify.ts",
|
|
62
73
|
"src/utils/queryId.ts",
|
|
63
|
-
"src/
|
|
74
|
+
"src/utils/randomId.ts"
|
|
64
75
|
]
|
|
65
76
|
},
|
|
66
77
|
"src/DefaultDataAdapter.ts": {
|
|
67
|
-
"file": "
|
|
78
|
+
"file": "index28.cjs.js",
|
|
68
79
|
"name": "DefaultDataAdapter",
|
|
69
80
|
"src": "src/DefaultDataAdapter.ts",
|
|
81
|
+
"isDynamicEntry": true,
|
|
70
82
|
"imports": [
|
|
71
83
|
"src/createIndex.ts",
|
|
72
84
|
"src/getIndexInfo.ts",
|
|
73
|
-
"src/utils/deepClone.ts",
|
|
74
85
|
"src/utils/EventEmitter.ts",
|
|
86
|
+
"src/utils/deepClone.ts",
|
|
87
|
+
"src/utils/idIndexQuery.ts",
|
|
88
|
+
"src/utils/incrementalQueryUpdate.ts",
|
|
75
89
|
"src/utils/isEqual.ts",
|
|
76
90
|
"src/utils/match.ts",
|
|
77
91
|
"src/utils/modify.ts",
|
|
78
|
-
"src/utils/
|
|
92
|
+
"src/utils/projectItems.ts",
|
|
93
|
+
"src/utils/queryDelta.ts",
|
|
79
94
|
"src/utils/queryId.ts",
|
|
80
95
|
"src/utils/serializeValue.ts",
|
|
81
96
|
"src/utils/sortItems.ts"
|
|
82
97
|
]
|
|
83
98
|
},
|
|
84
99
|
"src/WorkerDataAdapter.ts": {
|
|
85
|
-
"file": "
|
|
100
|
+
"file": "index36.cjs.js",
|
|
86
101
|
"name": "WorkerDataAdapter",
|
|
87
102
|
"src": "src/WorkerDataAdapter.ts",
|
|
103
|
+
"isDynamicEntry": true,
|
|
88
104
|
"imports": [
|
|
105
|
+
"src/utils/batchOnNextTick.ts",
|
|
106
|
+
"src/utils/deepClone.ts",
|
|
107
|
+
"src/utils/incrementalQueryUpdate.ts",
|
|
108
|
+
"src/utils/match.ts",
|
|
109
|
+
"src/utils/modify.ts",
|
|
110
|
+
"src/utils/queryDelta.ts",
|
|
89
111
|
"src/utils/queryId.ts",
|
|
90
|
-
"src/utils/randomId.ts"
|
|
91
|
-
"src/utils/batchOnNextTick.ts"
|
|
112
|
+
"src/utils/randomId.ts"
|
|
92
113
|
]
|
|
93
114
|
},
|
|
94
115
|
"src/WorkerDataAdapterHost.ts": {
|
|
95
|
-
"file": "
|
|
116
|
+
"file": "index38.cjs.js",
|
|
96
117
|
"name": "WorkerDataAdapterHost",
|
|
97
118
|
"src": "src/WorkerDataAdapterHost.ts",
|
|
119
|
+
"isDynamicEntry": true,
|
|
98
120
|
"imports": [
|
|
121
|
+
"src/getIndexInfo.ts",
|
|
122
|
+
"src/utils/compact.ts",
|
|
99
123
|
"src/utils/deepClone.ts",
|
|
124
|
+
"src/utils/idIndexQuery.ts",
|
|
125
|
+
"src/utils/incrementalQueryUpdate.ts",
|
|
126
|
+
"src/utils/isEqual.ts",
|
|
100
127
|
"src/utils/match.ts",
|
|
101
128
|
"src/utils/modify.ts",
|
|
129
|
+
"src/utils/projectItems.ts",
|
|
130
|
+
"src/utils/queryDelta.ts",
|
|
102
131
|
"src/utils/queryId.ts",
|
|
103
|
-
"src/utils/isEqual.ts",
|
|
104
|
-
"src/getIndexInfo.ts",
|
|
105
|
-
"src/utils/getMatchingKeys.ts",
|
|
106
132
|
"src/utils/sortItems.ts",
|
|
107
|
-
"src/utils/
|
|
108
|
-
"src/utils/compact.ts"
|
|
133
|
+
"src/utils/storageIndexQuery.ts"
|
|
109
134
|
]
|
|
110
135
|
},
|
|
111
136
|
"src/createIndex.ts": {
|
|
112
|
-
"file": "
|
|
137
|
+
"file": "index15.cjs.js",
|
|
113
138
|
"name": "createIndex",
|
|
114
139
|
"src": "src/createIndex.ts",
|
|
140
|
+
"isDynamicEntry": true,
|
|
115
141
|
"imports": [
|
|
116
142
|
"src/createIndexProvider.ts",
|
|
117
143
|
"src/utils/get.ts",
|
|
@@ -120,24 +146,28 @@
|
|
|
120
146
|
]
|
|
121
147
|
},
|
|
122
148
|
"src/createIndexProvider.ts": {
|
|
123
|
-
"file": "
|
|
149
|
+
"file": "index10.cjs.js",
|
|
124
150
|
"name": "createIndexProvider",
|
|
125
|
-
"src": "src/createIndexProvider.ts"
|
|
151
|
+
"src": "src/createIndexProvider.ts",
|
|
152
|
+
"isDynamicEntry": true
|
|
126
153
|
},
|
|
127
154
|
"src/createReactivityAdapter.ts": {
|
|
128
|
-
"file": "
|
|
155
|
+
"file": "index31.cjs.js",
|
|
129
156
|
"name": "createReactivityAdapter",
|
|
130
|
-
"src": "src/createReactivityAdapter.ts"
|
|
157
|
+
"src": "src/createReactivityAdapter.ts",
|
|
158
|
+
"isDynamicEntry": true
|
|
131
159
|
},
|
|
132
160
|
"src/createStorageAdapter.ts": {
|
|
133
|
-
"file": "
|
|
161
|
+
"file": "index30.cjs.js",
|
|
134
162
|
"name": "createStorageAdapter",
|
|
135
|
-
"src": "src/createStorageAdapter.ts"
|
|
163
|
+
"src": "src/createStorageAdapter.ts",
|
|
164
|
+
"isDynamicEntry": true
|
|
136
165
|
},
|
|
137
166
|
"src/getIndexInfo.ts": {
|
|
138
|
-
"file": "
|
|
167
|
+
"file": "index17.cjs.js",
|
|
139
168
|
"name": "getIndexInfo",
|
|
140
169
|
"src": "src/getIndexInfo.ts",
|
|
170
|
+
"isDynamicEntry": true,
|
|
141
171
|
"imports": [
|
|
142
172
|
"src/utils/intersection.ts"
|
|
143
173
|
]
|
|
@@ -148,130 +178,203 @@
|
|
|
148
178
|
"src": "src/index.ts",
|
|
149
179
|
"isEntry": true,
|
|
150
180
|
"imports": [
|
|
181
|
+
"src/AsyncDataAdapter.ts",
|
|
182
|
+
"src/AutoFetchDataAdapter.ts",
|
|
151
183
|
"src/Collection/Cursor.ts",
|
|
152
184
|
"src/Collection/index.ts",
|
|
153
|
-
"src/
|
|
185
|
+
"src/DefaultDataAdapter.ts",
|
|
186
|
+
"src/WorkerDataAdapter.ts",
|
|
187
|
+
"src/WorkerDataAdapterHost.ts",
|
|
154
188
|
"src/createReactivityAdapter.ts",
|
|
189
|
+
"src/createStorageAdapter.ts",
|
|
190
|
+
"src/utils/EventEmitter.ts",
|
|
191
|
+
"src/utils/get.ts",
|
|
155
192
|
"src/utils/isEqual.ts",
|
|
156
193
|
"src/utils/modify.ts",
|
|
157
194
|
"src/utils/randomId.ts",
|
|
158
|
-
"src/utils/
|
|
159
|
-
"src/utils/
|
|
160
|
-
"src/utils/serializeValue.ts",
|
|
161
|
-
"src/DefaultDataAdapter.ts",
|
|
162
|
-
"src/AsyncDataAdapter.ts",
|
|
163
|
-
"src/WorkerDataAdapter.ts",
|
|
164
|
-
"src/WorkerDataAdapterHost.ts",
|
|
165
|
-
"src/AutoFetchDataAdapter.ts"
|
|
195
|
+
"src/utils/reactiveOrAsync.ts",
|
|
196
|
+
"src/utils/serializeValue.ts"
|
|
166
197
|
]
|
|
167
198
|
},
|
|
168
199
|
"src/utils/EventEmitter.ts": {
|
|
169
|
-
"file": "
|
|
200
|
+
"file": "index7.cjs.js",
|
|
170
201
|
"name": "utils/EventEmitter",
|
|
171
|
-
"src": "src/utils/EventEmitter.ts"
|
|
202
|
+
"src": "src/utils/EventEmitter.ts",
|
|
203
|
+
"isDynamicEntry": true
|
|
172
204
|
},
|
|
173
205
|
"src/utils/batchOnNextTick.ts": {
|
|
174
|
-
"file": "
|
|
206
|
+
"file": "index35.cjs.js",
|
|
175
207
|
"name": "utils/batchOnNextTick",
|
|
176
|
-
"src": "src/utils/batchOnNextTick.ts"
|
|
208
|
+
"src": "src/utils/batchOnNextTick.ts",
|
|
209
|
+
"isDynamicEntry": true
|
|
177
210
|
},
|
|
178
211
|
"src/utils/compact.ts": {
|
|
179
|
-
"file": "
|
|
212
|
+
"file": "index37.cjs.js",
|
|
180
213
|
"name": "utils/compact",
|
|
181
|
-
"src": "src/utils/compact.ts"
|
|
214
|
+
"src": "src/utils/compact.ts",
|
|
215
|
+
"isDynamicEntry": true
|
|
182
216
|
},
|
|
183
217
|
"src/utils/createSignal.ts": {
|
|
184
|
-
"file": "
|
|
218
|
+
"file": "index8.cjs.js",
|
|
185
219
|
"name": "utils/createSignal",
|
|
186
|
-
"src": "src/utils/createSignal.ts"
|
|
220
|
+
"src": "src/utils/createSignal.ts",
|
|
221
|
+
"isDynamicEntry": true
|
|
187
222
|
},
|
|
188
223
|
"src/utils/deepClone.ts": {
|
|
189
|
-
"file": "
|
|
224
|
+
"file": "index18.cjs.js",
|
|
190
225
|
"name": "utils/deepClone",
|
|
191
|
-
"src": "src/utils/deepClone.ts"
|
|
226
|
+
"src": "src/utils/deepClone.ts",
|
|
227
|
+
"isDynamicEntry": true
|
|
192
228
|
},
|
|
193
229
|
"src/utils/get.ts": {
|
|
194
|
-
"file": "
|
|
230
|
+
"file": "index11.cjs.js",
|
|
195
231
|
"name": "utils/get",
|
|
196
|
-
"src": "src/utils/get.ts"
|
|
232
|
+
"src": "src/utils/get.ts",
|
|
233
|
+
"isDynamicEntry": true
|
|
197
234
|
},
|
|
198
235
|
"src/utils/getMatchingKeys.ts": {
|
|
199
|
-
"file": "
|
|
236
|
+
"file": "index14.cjs.js",
|
|
200
237
|
"name": "utils/getMatchingKeys",
|
|
201
238
|
"src": "src/utils/getMatchingKeys.ts",
|
|
239
|
+
"isDynamicEntry": true,
|
|
202
240
|
"imports": [
|
|
203
241
|
"src/utils/isFieldExpression.ts",
|
|
204
242
|
"src/utils/serializeValue.ts"
|
|
205
243
|
]
|
|
206
244
|
},
|
|
245
|
+
"src/utils/idIndexQuery.ts": {
|
|
246
|
+
"file": "index27.cjs.js",
|
|
247
|
+
"name": "utils/idIndexQuery",
|
|
248
|
+
"src": "src/utils/idIndexQuery.ts",
|
|
249
|
+
"isDynamicEntry": true,
|
|
250
|
+
"imports": [
|
|
251
|
+
"src/utils/isFieldExpression.ts"
|
|
252
|
+
]
|
|
253
|
+
},
|
|
254
|
+
"src/utils/incrementalQueryUpdate.ts": {
|
|
255
|
+
"file": "index25.cjs.js",
|
|
256
|
+
"name": "utils/incrementalQueryUpdate",
|
|
257
|
+
"src": "src/utils/incrementalQueryUpdate.ts",
|
|
258
|
+
"isDynamicEntry": true,
|
|
259
|
+
"imports": [
|
|
260
|
+
"src/utils/match.ts",
|
|
261
|
+
"src/utils/projectItems.ts",
|
|
262
|
+
"src/utils/sortItems.ts"
|
|
263
|
+
]
|
|
264
|
+
},
|
|
207
265
|
"src/utils/intersection.ts": {
|
|
208
|
-
"file": "
|
|
266
|
+
"file": "index16.cjs.js",
|
|
209
267
|
"name": "utils/intersection",
|
|
210
|
-
"src": "src/utils/intersection.ts"
|
|
268
|
+
"src": "src/utils/intersection.ts",
|
|
269
|
+
"isDynamicEntry": true
|
|
211
270
|
},
|
|
212
271
|
"src/utils/isEqual.ts": {
|
|
213
|
-
"file": "
|
|
272
|
+
"file": "index2.cjs.js",
|
|
214
273
|
"name": "utils/isEqual",
|
|
215
|
-
"src": "src/utils/isEqual.ts"
|
|
274
|
+
"src": "src/utils/isEqual.ts",
|
|
275
|
+
"isDynamicEntry": true
|
|
216
276
|
},
|
|
217
277
|
"src/utils/isFieldExpression.ts": {
|
|
218
|
-
"file": "
|
|
278
|
+
"file": "index12.cjs.js",
|
|
219
279
|
"name": "utils/isFieldExpression",
|
|
220
|
-
"src": "src/utils/isFieldExpression.ts"
|
|
280
|
+
"src": "src/utils/isFieldExpression.ts",
|
|
281
|
+
"isDynamicEntry": true
|
|
221
282
|
},
|
|
222
283
|
"src/utils/match.ts": {
|
|
223
|
-
"file": "
|
|
284
|
+
"file": "index19.cjs.js",
|
|
224
285
|
"name": "utils/match",
|
|
225
|
-
"src": "src/utils/match.ts"
|
|
286
|
+
"src": "src/utils/match.ts",
|
|
287
|
+
"isDynamicEntry": true
|
|
226
288
|
},
|
|
227
289
|
"src/utils/modify.ts": {
|
|
228
|
-
"file": "
|
|
290
|
+
"file": "index20.cjs.js",
|
|
229
291
|
"name": "utils/modify",
|
|
230
292
|
"src": "src/utils/modify.ts",
|
|
293
|
+
"isDynamicEntry": true,
|
|
231
294
|
"imports": [
|
|
232
295
|
"src/utils/deepClone.ts"
|
|
233
296
|
]
|
|
234
297
|
},
|
|
235
298
|
"src/utils/project.ts": {
|
|
236
|
-
"file": "
|
|
299
|
+
"file": "index22.cjs.js",
|
|
237
300
|
"name": "utils/project",
|
|
238
301
|
"src": "src/utils/project.ts",
|
|
302
|
+
"isDynamicEntry": true,
|
|
239
303
|
"imports": [
|
|
240
304
|
"src/utils/get.ts",
|
|
241
305
|
"src/utils/set.ts"
|
|
242
306
|
]
|
|
243
307
|
},
|
|
308
|
+
"src/utils/projectItems.ts": {
|
|
309
|
+
"file": "index23.cjs.js",
|
|
310
|
+
"name": "utils/projectItems",
|
|
311
|
+
"src": "src/utils/projectItems.ts",
|
|
312
|
+
"isDynamicEntry": true,
|
|
313
|
+
"imports": [
|
|
314
|
+
"src/utils/project.ts"
|
|
315
|
+
]
|
|
316
|
+
},
|
|
317
|
+
"src/utils/queryDelta.ts": {
|
|
318
|
+
"file": "index4.cjs.js",
|
|
319
|
+
"name": "utils/queryDelta",
|
|
320
|
+
"src": "src/utils/queryDelta.ts",
|
|
321
|
+
"isDynamicEntry": true,
|
|
322
|
+
"imports": [
|
|
323
|
+
"src/utils/isEqual.ts"
|
|
324
|
+
]
|
|
325
|
+
},
|
|
244
326
|
"src/utils/queryId.ts": {
|
|
245
|
-
"file": "
|
|
327
|
+
"file": "index26.cjs.js",
|
|
246
328
|
"name": "utils/queryId",
|
|
247
|
-
"src": "src/utils/queryId.ts"
|
|
329
|
+
"src": "src/utils/queryId.ts",
|
|
330
|
+
"isDynamicEntry": true
|
|
248
331
|
},
|
|
249
332
|
"src/utils/randomId.ts": {
|
|
250
|
-
"file": "
|
|
333
|
+
"file": "index9.cjs.js",
|
|
251
334
|
"name": "utils/randomId",
|
|
252
|
-
"src": "src/utils/randomId.ts"
|
|
335
|
+
"src": "src/utils/randomId.ts",
|
|
336
|
+
"isDynamicEntry": true
|
|
337
|
+
},
|
|
338
|
+
"src/utils/reactiveOrAsync.ts": {
|
|
339
|
+
"file": "index32.cjs.js",
|
|
340
|
+
"name": "utils/reactiveOrAsync",
|
|
341
|
+
"src": "src/utils/reactiveOrAsync.ts",
|
|
342
|
+
"isDynamicEntry": true
|
|
253
343
|
},
|
|
254
344
|
"src/utils/serializeValue.ts": {
|
|
255
|
-
"file": "
|
|
345
|
+
"file": "index13.cjs.js",
|
|
256
346
|
"name": "utils/serializeValue",
|
|
257
|
-
"src": "src/utils/serializeValue.ts"
|
|
347
|
+
"src": "src/utils/serializeValue.ts",
|
|
348
|
+
"isDynamicEntry": true
|
|
258
349
|
},
|
|
259
350
|
"src/utils/set.ts": {
|
|
260
|
-
"file": "
|
|
351
|
+
"file": "index21.cjs.js",
|
|
261
352
|
"name": "utils/set",
|
|
262
|
-
"src": "src/utils/set.ts"
|
|
353
|
+
"src": "src/utils/set.ts",
|
|
354
|
+
"isDynamicEntry": true
|
|
263
355
|
},
|
|
264
356
|
"src/utils/sortItems.ts": {
|
|
265
|
-
"file": "
|
|
357
|
+
"file": "index24.cjs.js",
|
|
266
358
|
"name": "utils/sortItems",
|
|
267
359
|
"src": "src/utils/sortItems.ts",
|
|
360
|
+
"isDynamicEntry": true,
|
|
268
361
|
"imports": [
|
|
269
362
|
"src/utils/get.ts"
|
|
270
363
|
]
|
|
271
364
|
},
|
|
365
|
+
"src/utils/storageIndexQuery.ts": {
|
|
366
|
+
"file": "index33.cjs.js",
|
|
367
|
+
"name": "utils/storageIndexQuery",
|
|
368
|
+
"src": "src/utils/storageIndexQuery.ts",
|
|
369
|
+
"isDynamicEntry": true,
|
|
370
|
+
"imports": [
|
|
371
|
+
"src/utils/getMatchingKeys.ts"
|
|
372
|
+
]
|
|
373
|
+
},
|
|
272
374
|
"src/utils/uniqueBy.ts": {
|
|
273
|
-
"file": "
|
|
375
|
+
"file": "index3.cjs.js",
|
|
274
376
|
"name": "utils/uniqueBy",
|
|
275
|
-
"src": "src/utils/uniqueBy.ts"
|
|
377
|
+
"src": "src/utils/uniqueBy.ts",
|
|
378
|
+
"isDynamicEntry": true
|
|
276
379
|
}
|
|
277
380
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import type { CollectionBackend } from './DataAdapter';
|
|
5
|
-
import type StorageAdapter from './types/StorageAdapter';
|
|
1
|
+
import { BaseItem, default as Collection } from './Collection';
|
|
2
|
+
import { default as DataAdapter, CollectionBackend } from './DataAdapter';
|
|
3
|
+
import { default as StorageAdapter } from './types/StorageAdapter';
|
|
6
4
|
export interface AsyncDataAdapterOptions {
|
|
7
5
|
/** Factory to obtain a StorageAdapter per collection name */
|
|
8
6
|
storage: (name: string) => StorageAdapter<any, any>;
|
|
@@ -10,6 +8,30 @@ export interface AsyncDataAdapterOptions {
|
|
|
10
8
|
id?: string;
|
|
11
9
|
/** Optional error hook (mirrors WorkerDataAdapterHost) */
|
|
12
10
|
onError?: (error: Error) => void;
|
|
11
|
+
/**
|
|
12
|
+
* How often a failing query is retried before it is published as `'error'`.
|
|
13
|
+
* A query that fails is otherwise a dead end for the rest of the session —
|
|
14
|
+
* cursors only requery on `'complete'`, so they keep serving their neutral
|
|
15
|
+
* empty value, which consumers cannot tell apart from "there is no data".
|
|
16
|
+
*/
|
|
17
|
+
retry?: {
|
|
18
|
+
/** Total attempts including the first one. Default 3. */
|
|
19
|
+
attempts?: number;
|
|
20
|
+
/** Delay in ms before attempt N+1. Default 100 * 4 ** (attempt - 1). */
|
|
21
|
+
delay?: (attempt: number) => number;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Carries the context needed to act on a failed query. The bare storage error
|
|
26
|
+
* on its own does not say which collection or selector produced it, which made
|
|
27
|
+
* the default `console.error` hook close to useless.
|
|
28
|
+
*/
|
|
29
|
+
export declare class QueryError extends Error {
|
|
30
|
+
readonly collectionName: string;
|
|
31
|
+
readonly selector: unknown;
|
|
32
|
+
readonly options: unknown;
|
|
33
|
+
readonly attempts: number;
|
|
34
|
+
constructor(collectionName: string, selector: unknown, options: unknown, attempts: number, cause: unknown);
|
|
13
35
|
}
|
|
14
36
|
/**
|
|
15
37
|
* AsyncDataAdapter
|
|
@@ -22,6 +44,8 @@ export default class AsyncDataAdapter implements DataAdapter {
|
|
|
22
44
|
private options;
|
|
23
45
|
private id;
|
|
24
46
|
private onError;
|
|
47
|
+
private retryAttempts;
|
|
48
|
+
private retryDelay;
|
|
25
49
|
private storageAdapters;
|
|
26
50
|
private storageAdapterReady;
|
|
27
51
|
private collectionIndices;
|
|
@@ -37,22 +61,44 @@ export default class AsyncDataAdapter implements DataAdapter {
|
|
|
37
61
|
* @param options - query options
|
|
38
62
|
*/
|
|
39
63
|
private fulfillQuery;
|
|
64
|
+
/**
|
|
65
|
+
* Executes a query, retrying transient failures before giving up. The state
|
|
66
|
+
* stays `'active'` across retries — consumers should see "still loading",
|
|
67
|
+
* not "failed", until we actually stop trying. Only the final failure is
|
|
68
|
+
* published as `'error'` and reported through `onError`; previously that
|
|
69
|
+
* error was swallowed entirely (`fulfillQuery` caught it internally, so the
|
|
70
|
+
* `.catch(this.onError)` on its call site was unreachable) and the query
|
|
71
|
+
* stayed dead for the rest of the session.
|
|
72
|
+
* @param collectionName - name of the collection
|
|
73
|
+
* @param selector - query selector
|
|
74
|
+
* @param options - query options
|
|
75
|
+
*/
|
|
76
|
+
private runQuery;
|
|
40
77
|
/**
|
|
41
78
|
* Notify listeners about state changes and keep the cache updated
|
|
42
79
|
* @param collectionName - name of the collection
|
|
43
80
|
* @param qid - query id
|
|
44
81
|
* @param state - new state
|
|
45
82
|
* @param error - error if state is 'error', null otherwise
|
|
83
|
+
* @param delta - what changed about the result, when that is known
|
|
46
84
|
*/
|
|
47
85
|
private publishState;
|
|
48
86
|
private publishResult;
|
|
87
|
+
private queryItemIds;
|
|
49
88
|
private getIndexInfo;
|
|
50
89
|
private queryItems;
|
|
51
90
|
private executeQuery;
|
|
52
91
|
/**
|
|
53
|
-
* After mutations,
|
|
92
|
+
* After mutations, bring every affected active query up to date.
|
|
93
|
+
*
|
|
94
|
+
* A query whose previous result is enough to answer the change is brought up to date from that
|
|
95
|
+
* result alone — no round trip to the storage, and no detour through `'active'`, because there is
|
|
96
|
+
* no window in which the query is stale. Only a query the change cannot be reasoned about
|
|
97
|
+
* locally — a window onto a larger set, or one that has never been answered — goes back to the
|
|
98
|
+
* store, and that one gets the same retry and reporting behaviour a freshly registered query
|
|
99
|
+
* gets: a refresh that fails silently leaves exactly the same dead cursor.
|
|
54
100
|
* @param collectionName - name of the collection
|
|
55
|
-
* @param
|
|
101
|
+
* @param changes - the items the write created, updated or removed
|
|
56
102
|
*/
|
|
57
103
|
private checkQueryUpdates;
|
|
58
104
|
private insert;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import type StorageAdapter from './types/StorageAdapter';
|
|
6
|
-
import type Selector from './types/Selector';
|
|
1
|
+
import { BaseItem, default as Collection } from './Collection';
|
|
2
|
+
import { default as DataAdapter, CollectionBackend } from './DataAdapter';
|
|
3
|
+
import { default as StorageAdapter } from './types/StorageAdapter';
|
|
4
|
+
import { default as Selector } from './types/Selector';
|
|
7
5
|
/**
|
|
8
6
|
* AutoFetchDataAdapterOptions
|
|
9
7
|
*
|
|
@@ -1,15 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { default as ReactivityAdapter } from '../types/ReactivityAdapter';
|
|
2
|
+
import { QueryDelta } from '../utils/queryDelta';
|
|
3
|
+
import { BaseItem, FindOptions, Transform } from './types';
|
|
4
|
+
import { ObserveCallbacks } from './Observer';
|
|
4
5
|
/**
|
|
5
6
|
* Checks if the current scope is reactive, considering the provided reactivity adapter.
|
|
6
7
|
* @param reactivity - The reactivity adapter or a boolean indicating whether reactivity is enabled.
|
|
7
8
|
* @returns A boolean indicating if the current scope is reactive.
|
|
8
9
|
*/
|
|
9
10
|
export declare function isInReactiveScope(reactivity: ReactivityAdapter | undefined | false): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Reports whether the query a cursor stands for has produced an outcome yet.
|
|
13
|
+
* Supplied by the collection, which owns the query registration; a cursor
|
|
14
|
+
* built without one simply never reports itself as loading.
|
|
15
|
+
*/
|
|
16
|
+
export interface QueryStateAccessor {
|
|
17
|
+
/**
|
|
18
|
+
* Whether the query has settled — completed or failed — at least once
|
|
19
|
+
* since it was registered.
|
|
20
|
+
*/
|
|
21
|
+
hasSettled: () => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Subscribes to the query settling. Returns a cleanup function.
|
|
24
|
+
*/
|
|
25
|
+
onSettled: (callback: () => void) => () => void;
|
|
26
|
+
}
|
|
10
27
|
export interface CursorOptions<T extends BaseItem, U = T, Async extends boolean = false> extends FindOptions<T, Async> {
|
|
11
28
|
transform?: Transform<T, U>;
|
|
12
|
-
bindEvents?: (requery: () => void) => () => void;
|
|
29
|
+
bindEvents?: (requery: () => void, applyDelta: (delta: QueryDelta<T>) => void) => () => void;
|
|
30
|
+
queryState?: QueryStateAccessor;
|
|
13
31
|
}
|
|
14
32
|
/**
|
|
15
33
|
* Represents a cursor for querying and observing a filtered, sorted, and transformed
|
|
@@ -90,6 +108,31 @@ export default class Cursor<T extends BaseItem, U = T, Async extends boolean = f
|
|
|
90
108
|
* @returns The total number of items in the result set.
|
|
91
109
|
*/
|
|
92
110
|
count(): Async extends true ? Promise<number> : number;
|
|
111
|
+
/**
|
|
112
|
+
* Whether this cursor's query has yet to deliver a first result.
|
|
113
|
+
* ⚡️ this function is reactive!
|
|
114
|
+
*
|
|
115
|
+
* An asynchronous data adapter answers a newly registered query only after a
|
|
116
|
+
* round trip, and serves a neutral empty result until it does — which a
|
|
117
|
+
* consumer cannot otherwise tell apart from "there is nothing to show". This
|
|
118
|
+
* is that distinction, per query rather than per collection, so one screen
|
|
119
|
+
* waiting on its own data says nothing about any other query.
|
|
120
|
+
*
|
|
121
|
+
* Follows the usual `isLoading`/`isFetching` split: it reports "no result
|
|
122
|
+
* yet", not "an execution is in flight". A write that re-runs an
|
|
123
|
+
* already-settled query drives it through `'active'` again while this stays
|
|
124
|
+
* `false`, so a list does not fall back to a loading state every time one of
|
|
125
|
+
* its rows changes.
|
|
126
|
+
*
|
|
127
|
+
* A query that fails counts as settled — the `query.error` event on the
|
|
128
|
+
* collection is what surfaces the failure, and a loading state that never
|
|
129
|
+
* ends is the worse answer. Reading this registers the query if nothing else
|
|
130
|
+
* has, so it cannot wait on something nobody asked for. It is always `false`
|
|
131
|
+
* for an `{ async: true }` cursor, whose `fetch()` awaits the real result
|
|
132
|
+
* anyway, and for a data adapter that answers synchronously.
|
|
133
|
+
* @returns A boolean indicating whether the first result is still pending.
|
|
134
|
+
*/
|
|
135
|
+
isLoading(): boolean;
|
|
93
136
|
/**
|
|
94
137
|
* Observes changes to the cursor's result set and triggers the specified callbacks
|
|
95
138
|
* when items are added, removed, or updated. Supports reactivity and transformation.
|
|
@@ -110,4 +153,13 @@ export default class Cursor<T extends BaseItem, U = T, Async extends boolean = f
|
|
|
110
153
|
* criteria have changed, and you want to ensure the cursor reflects the latest state.
|
|
111
154
|
*/
|
|
112
155
|
requery(): void;
|
|
156
|
+
/**
|
|
157
|
+
* Brings the cursor up to date from a description of what changed, rather than by re-running the
|
|
158
|
+
* query and comparing the result with the previous one.
|
|
159
|
+
*
|
|
160
|
+
* Falls back to `requery` when the delta does not fit the result the cursor currently holds, so
|
|
161
|
+
* a caller never has to decide which of the two is safe.
|
|
162
|
+
* @param delta - The change to apply.
|
|
163
|
+
*/
|
|
164
|
+
applyDelta(delta: QueryDelta<T>): void;
|
|
113
165
|
}
|