@koolbase/js 12.14.0 → 12.16.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/dist/cjs/index.js +7 -4
- package/dist/esm/index.js +8 -5
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -65,12 +65,15 @@ exports.Koolbase = {
|
|
|
65
65
|
_initializing = (async () => {
|
|
66
66
|
(0, core_1.setPlatform)(config.platform ?? (0, platform_js_2.browserPlatform)());
|
|
67
67
|
_auth = new core_1.KoolbaseAuth(config);
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
// A data request refused with the signed-in person's token renews the
|
|
69
|
+
// session once and goes again (#96); only a refused renewal ends it.
|
|
70
|
+
(0, core_1.setSessionRenewal)((refused) => (_auth ? _auth.renewRejected(refused) : Promise.resolve(null)));
|
|
71
|
+
_db = new core_1.KoolbaseDatabase(config, () => _auth?.currentUser?.id ?? null, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.sessionRejected(); });
|
|
72
|
+
_storage = new core_1.KoolbaseStorage(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.sessionRejected(); },
|
|
70
73
|
// Project identity for publicUrlFor, from the bootstrap payload; a
|
|
71
74
|
// missing one nudges a refresh (as Flutter's storage client).
|
|
72
75
|
() => _flags?.projectId() ?? '', () => { void _flags?.refresh(); });
|
|
73
|
-
_fiscal = new core_1.KoolbaseFiscal(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.
|
|
76
|
+
_fiscal = new core_1.KoolbaseFiscal(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.sessionRejected(); });
|
|
74
77
|
_realtime = new core_1.KoolbaseRealtime(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), () => _auth?.currentUser?.id ?? null);
|
|
75
78
|
// Signed in, signed out, another user: the realtime connection is
|
|
76
79
|
// replaced to match (signed out, collections anyone can read only).
|
|
@@ -82,7 +85,7 @@ exports.Koolbase = {
|
|
|
82
85
|
// Whether the device reports a connection: unknown until it first answers.
|
|
83
86
|
_connectivity = new core_1.KoolbaseConnectivity();
|
|
84
87
|
_connectivity.start();
|
|
85
|
-
_functions = new core_1.KoolbaseFunctions(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.
|
|
88
|
+
_functions = new core_1.KoolbaseFunctions(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.sessionRejected(); });
|
|
86
89
|
const deviceId = await (0, core_1.getOrCreateDeviceId)();
|
|
87
90
|
_flags = new core_1.KoolbaseFlags(config, deviceId);
|
|
88
91
|
// The bootstrap payload (flags, config, version policy, project identity),
|
package/dist/esm/index.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
export * from '@koolbase/core';
|
|
10
10
|
export { BrowserAuthStorage } from './auth-storage.js';
|
|
11
11
|
export { browserPlatform } from './platform.js';
|
|
12
|
-
import { KoolbaseAuth, KoolbaseDatabase, KoolbaseFiscal, KoolbaseStorage, KoolbaseRealtime, KoolbaseFunctions, KoolbaseConnectivity, KoolbaseFlags, KoolbaseAnalytics, disabledAnalytics, getOrCreateDeviceId, setPlatform, } from '@koolbase/core';
|
|
12
|
+
import { KoolbaseAuth, KoolbaseDatabase, KoolbaseFiscal, KoolbaseStorage, KoolbaseRealtime, KoolbaseFunctions, KoolbaseConnectivity, KoolbaseFlags, KoolbaseAnalytics, disabledAnalytics, getOrCreateDeviceId, setPlatform, setSessionRenewal } from '@koolbase/core';
|
|
13
13
|
import { browserPlatform } from './platform.js';
|
|
14
14
|
let _auth = null;
|
|
15
15
|
let _db = null;
|
|
@@ -46,12 +46,15 @@ export const Koolbase = {
|
|
|
46
46
|
_initializing = (async () => {
|
|
47
47
|
setPlatform(config.platform ?? browserPlatform());
|
|
48
48
|
_auth = new KoolbaseAuth(config);
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
// A data request refused with the signed-in person's token renews the
|
|
50
|
+
// session once and goes again (#96); only a refused renewal ends it.
|
|
51
|
+
setSessionRenewal((refused) => (_auth ? _auth.renewRejected(refused) : Promise.resolve(null)));
|
|
52
|
+
_db = new KoolbaseDatabase(config, () => _auth?.currentUser?.id ?? null, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.sessionRejected(); });
|
|
53
|
+
_storage = new KoolbaseStorage(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.sessionRejected(); },
|
|
51
54
|
// Project identity for publicUrlFor, from the bootstrap payload; a
|
|
52
55
|
// missing one nudges a refresh (as Flutter's storage client).
|
|
53
56
|
() => _flags?.projectId() ?? '', () => { void _flags?.refresh(); });
|
|
54
|
-
_fiscal = new KoolbaseFiscal(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.
|
|
57
|
+
_fiscal = new KoolbaseFiscal(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.sessionRejected(); });
|
|
55
58
|
_realtime = new KoolbaseRealtime(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), () => _auth?.currentUser?.id ?? null);
|
|
56
59
|
// Signed in, signed out, another user: the realtime connection is
|
|
57
60
|
// replaced to match (signed out, collections anyone can read only).
|
|
@@ -63,7 +66,7 @@ export const Koolbase = {
|
|
|
63
66
|
// Whether the device reports a connection: unknown until it first answers.
|
|
64
67
|
_connectivity = new KoolbaseConnectivity();
|
|
65
68
|
_connectivity.start();
|
|
66
|
-
_functions = new KoolbaseFunctions(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.
|
|
69
|
+
_functions = new KoolbaseFunctions(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.sessionRejected(); });
|
|
67
70
|
const deviceId = await getOrCreateDeviceId();
|
|
68
71
|
_flags = new KoolbaseFlags(config, deviceId);
|
|
69
72
|
// The bootstrap payload (flags, config, version policy, project identity),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koolbase/js",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.16.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.16.0"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|