@koolbase/js 12.11.1 → 12.13.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 +3 -0
- package/dist/cjs/react.d.ts +3 -1
- package/dist/esm/index.js +3 -0
- package/dist/esm/react.d.ts +3 -1
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -71,6 +71,9 @@ exports.Koolbase = {
|
|
|
71
71
|
() => _flags?.projectId() ?? '', () => { void _flags?.refresh(); });
|
|
72
72
|
_fiscal = new core_1.KoolbaseFiscal(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.clearStoredSession(); });
|
|
73
73
|
_realtime = new core_1.KoolbaseRealtime(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), () => _auth?.currentUser?.id ?? null);
|
|
74
|
+
// Signed in, signed out, another user: the realtime connection is
|
|
75
|
+
// replaced to match (signed out, collections anyone can read only).
|
|
76
|
+
_auth?.onAuthStateChange(() => _realtime?.sessionChanged());
|
|
74
77
|
_functions = new core_1.KoolbaseFunctions(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.clearStoredSession(); });
|
|
75
78
|
const deviceId = await (0, core_1.getOrCreateDeviceId)();
|
|
76
79
|
_flags = new core_1.KoolbaseFlags(config, deviceId);
|
package/dist/cjs/react.d.ts
CHANGED
|
@@ -2,4 +2,6 @@ export type { UseCollectionResult, UseRecordResult } from '@koolbase/core/react'
|
|
|
2
2
|
/** A collection as React state: loading, loaded or error, with refresh and loadMore. Use it after Koolbase.initialize(). */
|
|
3
3
|
export declare const useCollection: (collection: string, query?: import("@koolbase/core/dist/cjs").CollectionQuery) => import("@koolbase/core/react").UseCollectionResult;
|
|
4
4
|
/** One record, by id, as React state: loading, loaded, notFound or error, with refresh. Use it after Koolbase.initialize(). */
|
|
5
|
-
export declare const useRecord: (collection: string, id: string | null | undefined
|
|
5
|
+
export declare const useRecord: (collection: string, id: string | null | undefined, options?: {
|
|
6
|
+
live?: boolean;
|
|
7
|
+
}) => import("@koolbase/core/react").UseRecordResult;
|
package/dist/esm/index.js
CHANGED
|
@@ -52,6 +52,9 @@ export const Koolbase = {
|
|
|
52
52
|
() => _flags?.projectId() ?? '', () => { void _flags?.refresh(); });
|
|
53
53
|
_fiscal = new KoolbaseFiscal(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.clearStoredSession(); });
|
|
54
54
|
_realtime = new KoolbaseRealtime(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), () => _auth?.currentUser?.id ?? null);
|
|
55
|
+
// Signed in, signed out, another user: the realtime connection is
|
|
56
|
+
// replaced to match (signed out, collections anyone can read only).
|
|
57
|
+
_auth?.onAuthStateChange(() => _realtime?.sessionChanged());
|
|
55
58
|
_functions = new KoolbaseFunctions(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.clearStoredSession(); });
|
|
56
59
|
const deviceId = await getOrCreateDeviceId();
|
|
57
60
|
_flags = new KoolbaseFlags(config, deviceId);
|
package/dist/esm/react.d.ts
CHANGED
|
@@ -2,4 +2,6 @@ export type { UseCollectionResult, UseRecordResult } from '@koolbase/core/react'
|
|
|
2
2
|
/** A collection as React state: loading, loaded or error, with refresh and loadMore. Use it after Koolbase.initialize(). */
|
|
3
3
|
export declare const useCollection: (collection: string, query?: import("@koolbase/core").CollectionQuery) => import("@koolbase/core/react").UseCollectionResult;
|
|
4
4
|
/** One record, by id, as React state: loading, loaded, notFound or error, with refresh. Use it after Koolbase.initialize(). */
|
|
5
|
-
export declare const useRecord: (collection: string, id: string | null | undefined
|
|
5
|
+
export declare const useRecord: (collection: string, id: string | null | undefined, options?: {
|
|
6
|
+
live?: boolean;
|
|
7
|
+
}) => import("@koolbase/core/react").UseRecordResult;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koolbase/js",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.13.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.13.0"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|