@koolbase/js 12.31.0 → 12.32.0
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 +13 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,19 @@ is based on [Keep a Changelog][kac], and this project adheres to
|
|
|
7
7
|
[kac]: https://keepachangelog.com/en/1.1.0/
|
|
8
8
|
[semver]: https://semver.org/
|
|
9
9
|
|
|
10
|
+
## 12.32.0
|
|
11
|
+
|
|
12
|
+
Typed queries (#165): filters with and/or groups, ranges and dates, and sorts by a field's declared type. Same contract as koolbase_flutter 12.42.0.
|
|
13
|
+
|
|
14
|
+
- **`where: KbWhere.and([...])`** in `db.query()` options: a tree of conditions. `KbWhere.and` / `KbWhere.or` group them, up to 3 deep. `KbField(name)` gives the operators: `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `contains`, `startsWith`, `isIn`, `notIn`, `between`, `before`, `after`, `onOrBefore`, `onOrAfter`, `on`, `isEmpty`, `isNotEmpty`, `isTrue`, `isFalse`. The server checks each against the field's declared type and runs the filter after the collection's read rule, so a filter only narrows what the caller may read.
|
|
15
|
+
- **Operands the server resolves**: `KbValue.now()`, `startOfToday()`, `startOfTomorrow()`, `startOfWeek()`, `startOfNextWeek()`, `startOfMonth()`, with an offset, and the signed-in caller, `KbValue.callerUserId()` / `KbValue.callerClaim(name)`, read from the session, never from the app.
|
|
16
|
+
- **`sort: [KbSort.desc('featured'), KbSort.asc('starts_at')]`**: up to 3 fields, typed by the declaration, empty values last both ways, ties broken by the record's id.
|
|
17
|
+
- **Time zone**: relative times and `on` resolve in the device's IANA zone (`Intl`), or the one named with `timezone: 'Europe/London'`.
|
|
18
|
+
- **Collections**: the collection controller takes the same as `filter`, `sort` and `timezone` (its `where` stays the equality map).
|
|
19
|
+
- **One language per query**: combining `where`/`sort`/`timezone` with `filters`/`orderBy`/`orderDesc` throws `TypeError` before anything is sent. Existing queries are sent exactly as before.
|
|
20
|
+
- **Refusals** (`query_invalid`, `query_too_complex`, `query_operator_invalid`, `query_field_untyped`, `query_timezone_invalid`, `query_caller_path_invalid`, `query_sort_invalid`, `query_sort_untyped`) arrive as `KoolbaseValidationError` with the code.
|
|
21
|
+
- **Caching**: a typed query, its zone included, is its own cache entry.
|
|
22
|
+
|
|
10
23
|
## 12.31.0
|
|
11
24
|
|
|
12
25
|
A failed Koolbase request leaves a trace in a development build (#169). Same contract as koolbase_flutter 12.41.0.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koolbase/js",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.32.0",
|
|
4
4
|
"description": "Koolbase SDK for the browser \u2014 auth, database, storage, realtime, functions, flags and offline sync in one package.",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"types": "./dist/esm/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"url": "https://github.com/koolbase/koolbase-react-native"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@koolbase/core": "12.
|
|
29
|
+
"@koolbase/core": "12.32.0"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|