@koolbase/js 11.0.0 → 11.1.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.
Files changed (2) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -7,6 +7,49 @@ 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
+ ## 11.1.0
11
+
12
+ ### Fixed
13
+
14
+ - **Fourteen error codes the API emits were not mapped**, so they arrived as
15
+ a generic error and an app's `instanceof` branch silently never ran. The
16
+ most consequential is `contact_not_verified` — in a project with verified
17
+ contact required, a user who registers, does not click the link, and comes
18
+ back is the *commonest* auth failure there is, and it had no type. Now:
19
+
20
+ | Code | Class |
21
+ |---|---|
22
+ | `contact_not_verified`, `email_not_verified` | `ContactNotVerifiedError` |
23
+ | `signups_disabled` | `SignupsDisabledError` |
24
+ | `weak_password` | `WeakPasswordError` (existed, never mapped from the server) |
25
+ | `account_exists` | `AccountExistsError` |
26
+ | `token_expired` | `TokenExpiredError` |
27
+ | `token_used` | `TokenAlreadyUsedError` |
28
+ | `invalid_token` | `UnlockTokenInvalidError` |
29
+ | `invalid_password` | `CurrentPasswordIncorrectError` |
30
+ | `oauth_only_account` | `OAuthOnlyAccountError` |
31
+ | `unsupported_oauth_provider` | `UnsupportedOAuthProviderError` |
32
+ | `session_required` | `SessionRequiredError` |
33
+ | `insufficient_authority` | `InsufficientAuthorityError` |
34
+ | `last_credential` | `LastCredentialError` |
35
+ | `hide_requires_verification` | `HideRequiresVerificationError` |
36
+
37
+ `CurrentPasswordIncorrectError` is named for the operation rather than the
38
+ code: the server calls it `invalid_password`, which reads like a rejected
39
+ new password and means the opposite.
40
+
41
+ - **`WeakPasswordError` carries the server's message** when there is one. The
42
+ SDK checks length before sending; a project may require more, and "must be
43
+ at least 8 characters" would then be both wrong and unhelpful. Its
44
+ constructor argument is optional, so existing code is unaffected.
45
+
46
+ ### Why these were missing
47
+
48
+ Nothing inside the SDK can tell that a code fell through — the generic error
49
+ is a valid object and the app's branch simply does not run. There is now a
50
+ test that asserts every code maps to its own class, so a new code added to the
51
+ API without a case here fails the build rather than a user's password reset.
52
+
10
53
  ## 11.0.0
11
54
 
12
55
  ### Read before upgrading
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koolbase/js",
3
- "version": "11.0.0",
3
+ "version": "11.1.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",
@@ -25,7 +25,7 @@
25
25
  "url": "https://github.com/koolbase/koolbase-react-native"
26
26
  },
27
27
  "dependencies": {
28
- "@koolbase/core": "11.0.0"
28
+ "@koolbase/core": "11.1.0"
29
29
  },
30
30
  "publishConfig": {
31
31
  "access": "public"