@nxtedition/lib 19.0.49 → 19.0.51
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/deepstream.js +11 -5
- package/errors.js +1 -2
- package/package.json +1 -1
package/deepstream.js
CHANGED
|
@@ -138,23 +138,29 @@ function getRecord(ds, name, ...args) {
|
|
|
138
138
|
)
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
function query(ds, designId,
|
|
141
|
+
function query(ds, designId, params, state = ds.record.PROVIDER) {
|
|
142
|
+
if (params.key) {
|
|
143
|
+
// TODO (fix): params.key?
|
|
144
|
+
throw new Error('params.key is not supported')
|
|
145
|
+
}
|
|
146
|
+
|
|
142
147
|
const next = (startkey, prevRows, limit) =>
|
|
143
148
|
Number.isFinite(limit) && limit <= 0
|
|
144
149
|
? rxjs.of({ rows: prevRows })
|
|
145
|
-
: ds.
|
|
150
|
+
: ds.record
|
|
146
151
|
.observe(
|
|
147
152
|
`${designId}:design?${qs.stringify(
|
|
148
153
|
{
|
|
149
|
-
...
|
|
154
|
+
...params,
|
|
150
155
|
startkey,
|
|
151
156
|
limit: Number.isFinite(limit) ? limit : null,
|
|
152
157
|
},
|
|
153
158
|
{ skipNulls: true },
|
|
154
159
|
)}`,
|
|
155
|
-
|
|
160
|
+
state,
|
|
156
161
|
)
|
|
157
162
|
.pipe(
|
|
163
|
+
rxjs.filter(({ rows }) => Array.isArray(rows)),
|
|
158
164
|
rxjs.switchMap(({ rows, finished }) => {
|
|
159
165
|
// assert(Array.isArray(rows))
|
|
160
166
|
// assert(typeof finished === 'boolean')
|
|
@@ -170,7 +176,7 @@ function query(ds, designId, options) {
|
|
|
170
176
|
}
|
|
171
177
|
}),
|
|
172
178
|
)
|
|
173
|
-
return next(
|
|
179
|
+
return next(params.startkey, [], params.limit ?? Infinity)
|
|
174
180
|
}
|
|
175
181
|
|
|
176
182
|
export function makeDeepstream(ds) {
|
package/errors.js
CHANGED
|
@@ -55,8 +55,7 @@ export function serializeError(error) {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
if (Array.isArray(error)) {
|
|
58
|
-
|
|
59
|
-
return errors
|
|
58
|
+
return error.map(serializeError).filter(Boolean)
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
if (Object.prototype.hasOwnProperty.call(error, kSeen)) {
|