@koolbase/js 12.30.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 +21 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,27 @@ 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
|
+
|
|
23
|
+
## 12.31.0
|
|
24
|
+
|
|
25
|
+
A failed Koolbase request leaves a trace in a development build (#169). Same contract as koolbase_flutter 12.41.0.
|
|
26
|
+
|
|
27
|
+
- **Development log of failed requests**: in a development build (React Native's and Expo's `__DEV__`, else the bundler's `NODE_ENV`), every Koolbase request that fails as the caller receives it prints one `console.warn` line, `[Koolbase] POST /v1/sdk/auth/email/code -> 401 invalid_public_key: ...`: the method, the path, the status and the server's reason. Never the host, the query, a header, the key, a token or the request body. A 401 that renewing the session answers is not printed. A release build, or unbundled code with neither signal, prints nothing.
|
|
28
|
+
- **Covered**: every request through `koolbaseFetch` and `sessionFetch`: auth, data, storage, Functions, analytics, flags and messaging.
|
|
29
|
+
- **Tested**: the line carries the method, path, status and reason and none of the key, token, query, host or body; a success prints nothing; a 401 renewal answers prints nothing; the caller still reads the whole response.
|
|
30
|
+
|
|
10
31
|
## 12.30.0
|
|
11
32
|
|
|
12
33
|
A refused app key is reported as the setup problem it is, never as a wrong password and never by signing the user out (#168, #169). Same contract as koolbase_flutter 12.40.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"
|