@lunora/react-native 1.0.0-alpha.10 → 1.0.0-alpha.12
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/auth.d.mts +43 -2
- package/dist/auth.d.ts +43 -2
- package/dist/auth.mjs +1 -1
- package/package.json +3 -3
package/dist/auth.d.mts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { expoClient as expoClient$1 } from '@better-auth/expo/client';
|
|
2
|
+
export { setupExpoFocusManager, setupExpoOnlineManager } from '@better-auth/expo/client';
|
|
3
|
+
import { BetterAuthClientPlugin } from 'better-auth/client';
|
|
2
4
|
/**
|
|
3
5
|
* Read the current better-auth session token from an Expo auth client, for use
|
|
4
6
|
* as a **bearer** credential on the Lunora client — `client.setAuthToken(token)`
|
|
@@ -34,4 +36,43 @@ interface SecureStorageLike {
|
|
|
34
36
|
getItem: (key: string) => null | string;
|
|
35
37
|
setItem: (key: string, value: string) => unknown;
|
|
36
38
|
}
|
|
37
|
-
|
|
39
|
+
/** The actions `expoClient` contributes to the auth client. */
|
|
40
|
+
interface ExpoClientActions {
|
|
41
|
+
/** The session cookie persisted in `SecureStore`, as a `name=value; …` string. */
|
|
42
|
+
getCookie: () => string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* `expoClient`'s plugin type, restated so it satisfies `BetterAuthClientPlugin`.
|
|
46
|
+
*
|
|
47
|
+
* From better-auth 1.6.24 through 1.7.0-rc.2, `@better-auth/expo`'s own declaration
|
|
48
|
+
* does not: its `getActions` types the `$fetch` parameter as a *different*
|
|
49
|
+
* `BetterFetch` instantiation than the interface requires, and under
|
|
50
|
+
* `strictFunctionTypes` parameter contravariance rejects the assignment — so
|
|
51
|
+
* `createAuthClient({ plugins: [expoClient(…)] })` fails to typecheck with a TS2322
|
|
52
|
+
* whose error text is several hundred characters of generic-inference expansion.
|
|
53
|
+
* The knock-on is a TS2345 wherever the inferred `getCookie` action is then read.
|
|
54
|
+
*
|
|
55
|
+
* The base has to stay upstream's own return type, with only `getActions` replaced:
|
|
56
|
+
* better-auth infers the whole client API (`signIn`, `signUp`, the session shape)
|
|
57
|
+
* from the literal plugin members, so rebuilding the type on top of
|
|
58
|
+
* `BetterAuthClientPlugin` instead — or merely intersecting with it — collapses that
|
|
59
|
+
* inference to `never` and the errors reappear as "Property 'signIn' does not exist".
|
|
60
|
+
* The replacement takes its parameters from better-auth's interface (making the
|
|
61
|
+
* assignment trivially valid) and returns {@link ExpoClientActions}, which is what
|
|
62
|
+
* keeps `authClient.getCookie()` typed for `expoBearerToken`. Runtime behaviour
|
|
63
|
+
* is untouched — this is a declaration-level correction of an upstream bug.
|
|
64
|
+
*
|
|
65
|
+
* Delete this shim (and re-export `expoClient` directly) once upstream's
|
|
66
|
+
* `getActions` signature matches the interface again.
|
|
67
|
+
* @experimental
|
|
68
|
+
*/
|
|
69
|
+
type ExpoClientPlugin = Omit<ReturnType<typeof expoClient$1>, "getActions"> & {
|
|
70
|
+
getActions: (...arguments_: Parameters<NonNullable<BetterAuthClientPlugin["getActions"]>>) => ExpoClientActions;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* The better-auth Expo client plugin — session persisted in `SecureStore`, OAuth via
|
|
74
|
+
* the app scheme. Pass it to `createAuthClient({ plugins: [expoClient({ scheme, storage })] })`.
|
|
75
|
+
* @experimental
|
|
76
|
+
*/
|
|
77
|
+
declare const expoClient: (options: Parameters<typeof expoClient$1>[0]) => ExpoClientPlugin;
|
|
78
|
+
export { ExpoClientActions, ExpoClientPlugin, SecureStorageLike, expoBearerToken, expoClient };
|
package/dist/auth.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { expoClient as expoClient$1 } from '@better-auth/expo/client';
|
|
2
|
+
export { setupExpoFocusManager, setupExpoOnlineManager } from '@better-auth/expo/client';
|
|
3
|
+
import { BetterAuthClientPlugin } from 'better-auth/client';
|
|
2
4
|
/**
|
|
3
5
|
* Read the current better-auth session token from an Expo auth client, for use
|
|
4
6
|
* as a **bearer** credential on the Lunora client — `client.setAuthToken(token)`
|
|
@@ -34,4 +36,43 @@ interface SecureStorageLike {
|
|
|
34
36
|
getItem: (key: string) => null | string;
|
|
35
37
|
setItem: (key: string, value: string) => unknown;
|
|
36
38
|
}
|
|
37
|
-
|
|
39
|
+
/** The actions `expoClient` contributes to the auth client. */
|
|
40
|
+
interface ExpoClientActions {
|
|
41
|
+
/** The session cookie persisted in `SecureStore`, as a `name=value; …` string. */
|
|
42
|
+
getCookie: () => string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* `expoClient`'s plugin type, restated so it satisfies `BetterAuthClientPlugin`.
|
|
46
|
+
*
|
|
47
|
+
* From better-auth 1.6.24 through 1.7.0-rc.2, `@better-auth/expo`'s own declaration
|
|
48
|
+
* does not: its `getActions` types the `$fetch` parameter as a *different*
|
|
49
|
+
* `BetterFetch` instantiation than the interface requires, and under
|
|
50
|
+
* `strictFunctionTypes` parameter contravariance rejects the assignment — so
|
|
51
|
+
* `createAuthClient({ plugins: [expoClient(…)] })` fails to typecheck with a TS2322
|
|
52
|
+
* whose error text is several hundred characters of generic-inference expansion.
|
|
53
|
+
* The knock-on is a TS2345 wherever the inferred `getCookie` action is then read.
|
|
54
|
+
*
|
|
55
|
+
* The base has to stay upstream's own return type, with only `getActions` replaced:
|
|
56
|
+
* better-auth infers the whole client API (`signIn`, `signUp`, the session shape)
|
|
57
|
+
* from the literal plugin members, so rebuilding the type on top of
|
|
58
|
+
* `BetterAuthClientPlugin` instead — or merely intersecting with it — collapses that
|
|
59
|
+
* inference to `never` and the errors reappear as "Property 'signIn' does not exist".
|
|
60
|
+
* The replacement takes its parameters from better-auth's interface (making the
|
|
61
|
+
* assignment trivially valid) and returns {@link ExpoClientActions}, which is what
|
|
62
|
+
* keeps `authClient.getCookie()` typed for `expoBearerToken`. Runtime behaviour
|
|
63
|
+
* is untouched — this is a declaration-level correction of an upstream bug.
|
|
64
|
+
*
|
|
65
|
+
* Delete this shim (and re-export `expoClient` directly) once upstream's
|
|
66
|
+
* `getActions` signature matches the interface again.
|
|
67
|
+
* @experimental
|
|
68
|
+
*/
|
|
69
|
+
type ExpoClientPlugin = Omit<ReturnType<typeof expoClient$1>, "getActions"> & {
|
|
70
|
+
getActions: (...arguments_: Parameters<NonNullable<BetterAuthClientPlugin["getActions"]>>) => ExpoClientActions;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* The better-auth Expo client plugin — session persisted in `SecureStore`, OAuth via
|
|
74
|
+
* the app scheme. Pass it to `createAuthClient({ plugins: [expoClient({ scheme, storage })] })`.
|
|
75
|
+
* @experimental
|
|
76
|
+
*/
|
|
77
|
+
declare const expoClient: (options: Parameters<typeof expoClient$1>[0]) => ExpoClientPlugin;
|
|
78
|
+
export { ExpoClientActions, ExpoClientPlugin, SecureStorageLike, expoBearerToken, expoClient };
|
package/dist/auth.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{expoClient as e}from"@better-auth/expo/client";import{setupExpoFocusManager as n,setupExpoOnlineManager as x}from"@better-auth/expo/client";import{default as s}from"./packem_shared/expoBearerToken-CSfRb511.mjs";const p=e;export{s as expoBearerToken,p as expoClient,n as setupExpoFocusManager,x as setupExpoOnlineManager};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/react-native",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.12",
|
|
4
4
|
"description": "React Native / Expo integration for Lunora: an AsyncStorage-backed client factory, the useQuery/useMutation/useSubscription hooks, and a one-call better-auth Expo client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@lunora/client": "1.0.0-alpha.
|
|
54
|
-
"@lunora/react": "1.0.0-alpha.
|
|
53
|
+
"@lunora/client": "1.0.0-alpha.31",
|
|
54
|
+
"@lunora/react": "1.0.0-alpha.35"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@better-auth/expo": "^1.6.23",
|