@aurabase/aurabase-js 0.5.3 → 0.5.4
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/{AuraClient-K3hRdh9J.d.cts → AuraClient-5jDiXjrO.d.cts} +1 -1
- package/dist/{AuraClient-K3hRdh9J.d.ts → AuraClient-5jDiXjrO.d.ts} +1 -1
- package/dist/index.cjs +6 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -3
- package/dist/nextjs.cjs +389 -0
- package/dist/nextjs.d.cts +126 -0
- package/dist/nextjs.d.ts +126 -0
- package/dist/nextjs.js +383 -0
- package/dist/react.cjs +150 -0
- package/dist/react.d.cts +82 -0
- package/dist/react.d.ts +82 -0
- package/dist/react.js +143 -0
- package/dist/ssr.cjs +6 -3
- package/dist/ssr.d.cts +1 -1
- package/dist/ssr.d.ts +1 -1
- package/dist/ssr.js +6 -3
- package/package.json +29 -9
package/dist/react.d.cts
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { User, Session } from '@aurabase/core';
|
|
2
|
+
import { A as AuraClient } from './AuraClient-5jDiXjrO.cjs';
|
|
3
|
+
import '@aurabase/ai';
|
|
4
|
+
import '@aurabase/auth';
|
|
5
|
+
import '@aurabase/db';
|
|
6
|
+
import '@aurabase/functions';
|
|
7
|
+
import '@aurabase/notifications';
|
|
8
|
+
import '@aurabase/realtime';
|
|
9
|
+
import '@aurabase/storage';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* React Context, hooks, and lifecycle primitives for Aurabase Auth.
|
|
13
|
+
*
|
|
14
|
+
* Provides Clerk-level reactive DX:
|
|
15
|
+
* - `<AuthProvider>`: React context managing real-time auth state across the tree.
|
|
16
|
+
* - `useAuth()`: Access client, status, token, and sign-out helpers.
|
|
17
|
+
* - `useUser()`: Reactive access to the currently signed-in user.
|
|
18
|
+
* - `useSession()`: Reactive access to active session data.
|
|
19
|
+
* - `<SignedIn>` / `<SignedOut>`: Conditional rendering wrappers.
|
|
20
|
+
*
|
|
21
|
+
* @module react
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
type ReactNode = unknown;
|
|
25
|
+
interface ReactContext<T> {
|
|
26
|
+
Provider: unknown;
|
|
27
|
+
Consumer: unknown;
|
|
28
|
+
_currentValue?: T;
|
|
29
|
+
}
|
|
30
|
+
interface ReactRuntime {
|
|
31
|
+
createContext<T>(defaultValue: T): ReactContext<T>;
|
|
32
|
+
useContext<T>(context: ReactContext<T>): T;
|
|
33
|
+
useState<T>(initialState: T | (() => T)): [T, (value: T | ((prev: T) => T)) => void];
|
|
34
|
+
useEffect(effect: () => void | (() => void), deps?: readonly unknown[]): void;
|
|
35
|
+
useMemo<T>(factory: () => T, deps?: readonly unknown[]): T;
|
|
36
|
+
createElement(type: unknown, props?: Record<string, unknown> | null, ...children: unknown[]): unknown;
|
|
37
|
+
Fragment: unknown;
|
|
38
|
+
}
|
|
39
|
+
interface AuthContextValue {
|
|
40
|
+
client: AuraClient | null;
|
|
41
|
+
user: User | null;
|
|
42
|
+
session: Session | null;
|
|
43
|
+
accessToken: string | null;
|
|
44
|
+
isLoading: boolean;
|
|
45
|
+
isAuthenticated: boolean;
|
|
46
|
+
signOut: () => Promise<void>;
|
|
47
|
+
}
|
|
48
|
+
interface AuthProviderProps {
|
|
49
|
+
client: AuraClient;
|
|
50
|
+
children: ReactNode;
|
|
51
|
+
initialSession?: Session | null;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Wraps your application to provide reactive Aurabase authentication context.
|
|
55
|
+
*/
|
|
56
|
+
declare function AuthProvider({ client, children, initialSession }: AuthProviderProps): unknown;
|
|
57
|
+
/**
|
|
58
|
+
* Access the core Aurabase authentication state and actions.
|
|
59
|
+
*/
|
|
60
|
+
declare function useAuth(): AuthContextValue;
|
|
61
|
+
/**
|
|
62
|
+
* Returns the currently authenticated user, or null if unauthenticated.
|
|
63
|
+
*/
|
|
64
|
+
declare function useUser(): User | null;
|
|
65
|
+
/**
|
|
66
|
+
* Returns the current active session.
|
|
67
|
+
*/
|
|
68
|
+
declare function useSession(): Session | null;
|
|
69
|
+
/**
|
|
70
|
+
* Conditional component rendering children only when a user is signed in.
|
|
71
|
+
*/
|
|
72
|
+
declare function SignedIn({ children }: {
|
|
73
|
+
children: ReactNode;
|
|
74
|
+
}): unknown;
|
|
75
|
+
/**
|
|
76
|
+
* Conditional component rendering children only when NO user is signed in.
|
|
77
|
+
*/
|
|
78
|
+
declare function SignedOut({ children }: {
|
|
79
|
+
children: ReactNode;
|
|
80
|
+
}): unknown;
|
|
81
|
+
|
|
82
|
+
export { type AuthContextValue, AuthProvider, type AuthProviderProps, type ReactContext, type ReactNode, type ReactRuntime, SignedIn, SignedOut, useAuth, useSession, useUser };
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { User, Session } from '@aurabase/core';
|
|
2
|
+
import { A as AuraClient } from './AuraClient-5jDiXjrO.js';
|
|
3
|
+
import '@aurabase/ai';
|
|
4
|
+
import '@aurabase/auth';
|
|
5
|
+
import '@aurabase/db';
|
|
6
|
+
import '@aurabase/functions';
|
|
7
|
+
import '@aurabase/notifications';
|
|
8
|
+
import '@aurabase/realtime';
|
|
9
|
+
import '@aurabase/storage';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* React Context, hooks, and lifecycle primitives for Aurabase Auth.
|
|
13
|
+
*
|
|
14
|
+
* Provides Clerk-level reactive DX:
|
|
15
|
+
* - `<AuthProvider>`: React context managing real-time auth state across the tree.
|
|
16
|
+
* - `useAuth()`: Access client, status, token, and sign-out helpers.
|
|
17
|
+
* - `useUser()`: Reactive access to the currently signed-in user.
|
|
18
|
+
* - `useSession()`: Reactive access to active session data.
|
|
19
|
+
* - `<SignedIn>` / `<SignedOut>`: Conditional rendering wrappers.
|
|
20
|
+
*
|
|
21
|
+
* @module react
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
type ReactNode = unknown;
|
|
25
|
+
interface ReactContext<T> {
|
|
26
|
+
Provider: unknown;
|
|
27
|
+
Consumer: unknown;
|
|
28
|
+
_currentValue?: T;
|
|
29
|
+
}
|
|
30
|
+
interface ReactRuntime {
|
|
31
|
+
createContext<T>(defaultValue: T): ReactContext<T>;
|
|
32
|
+
useContext<T>(context: ReactContext<T>): T;
|
|
33
|
+
useState<T>(initialState: T | (() => T)): [T, (value: T | ((prev: T) => T)) => void];
|
|
34
|
+
useEffect(effect: () => void | (() => void), deps?: readonly unknown[]): void;
|
|
35
|
+
useMemo<T>(factory: () => T, deps?: readonly unknown[]): T;
|
|
36
|
+
createElement(type: unknown, props?: Record<string, unknown> | null, ...children: unknown[]): unknown;
|
|
37
|
+
Fragment: unknown;
|
|
38
|
+
}
|
|
39
|
+
interface AuthContextValue {
|
|
40
|
+
client: AuraClient | null;
|
|
41
|
+
user: User | null;
|
|
42
|
+
session: Session | null;
|
|
43
|
+
accessToken: string | null;
|
|
44
|
+
isLoading: boolean;
|
|
45
|
+
isAuthenticated: boolean;
|
|
46
|
+
signOut: () => Promise<void>;
|
|
47
|
+
}
|
|
48
|
+
interface AuthProviderProps {
|
|
49
|
+
client: AuraClient;
|
|
50
|
+
children: ReactNode;
|
|
51
|
+
initialSession?: Session | null;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Wraps your application to provide reactive Aurabase authentication context.
|
|
55
|
+
*/
|
|
56
|
+
declare function AuthProvider({ client, children, initialSession }: AuthProviderProps): unknown;
|
|
57
|
+
/**
|
|
58
|
+
* Access the core Aurabase authentication state and actions.
|
|
59
|
+
*/
|
|
60
|
+
declare function useAuth(): AuthContextValue;
|
|
61
|
+
/**
|
|
62
|
+
* Returns the currently authenticated user, or null if unauthenticated.
|
|
63
|
+
*/
|
|
64
|
+
declare function useUser(): User | null;
|
|
65
|
+
/**
|
|
66
|
+
* Returns the current active session.
|
|
67
|
+
*/
|
|
68
|
+
declare function useSession(): Session | null;
|
|
69
|
+
/**
|
|
70
|
+
* Conditional component rendering children only when a user is signed in.
|
|
71
|
+
*/
|
|
72
|
+
declare function SignedIn({ children }: {
|
|
73
|
+
children: ReactNode;
|
|
74
|
+
}): unknown;
|
|
75
|
+
/**
|
|
76
|
+
* Conditional component rendering children only when NO user is signed in.
|
|
77
|
+
*/
|
|
78
|
+
declare function SignedOut({ children }: {
|
|
79
|
+
children: ReactNode;
|
|
80
|
+
}): unknown;
|
|
81
|
+
|
|
82
|
+
export { type AuthContextValue, AuthProvider, type AuthProviderProps, type ReactContext, type ReactNode, type ReactRuntime, SignedIn, SignedOut, useAuth, useSession, useUser };
|
package/dist/react.js
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
// src/react.ts
|
|
9
|
+
function getReact() {
|
|
10
|
+
const g = globalThis;
|
|
11
|
+
if (g.React) {
|
|
12
|
+
return g.React;
|
|
13
|
+
}
|
|
14
|
+
if (typeof __require === "function") {
|
|
15
|
+
try {
|
|
16
|
+
return __require("react");
|
|
17
|
+
} catch {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
var defaultAuthContextValue = {
|
|
24
|
+
client: null,
|
|
25
|
+
user: null,
|
|
26
|
+
session: null,
|
|
27
|
+
accessToken: null,
|
|
28
|
+
isLoading: true,
|
|
29
|
+
isAuthenticated: false,
|
|
30
|
+
signOut: async () => {
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var authContextInstance = null;
|
|
34
|
+
function getAuthContext() {
|
|
35
|
+
if (!authContextInstance) {
|
|
36
|
+
const React = getReact();
|
|
37
|
+
if (React?.createContext) {
|
|
38
|
+
authContextInstance = React.createContext(defaultAuthContextValue);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return authContextInstance;
|
|
42
|
+
}
|
|
43
|
+
function AuthProvider({ client, children, initialSession = null }) {
|
|
44
|
+
const React = getReact();
|
|
45
|
+
if (!React) {
|
|
46
|
+
throw new Error("[@aurabase/react] React est requis pour utiliser <AuthProvider>.");
|
|
47
|
+
}
|
|
48
|
+
const [session, setSession] = React.useState(initialSession);
|
|
49
|
+
const [user, setUser] = React.useState(initialSession?.user ?? null);
|
|
50
|
+
const [isLoading, setIsLoading] = React.useState(!initialSession);
|
|
51
|
+
React.useEffect(() => {
|
|
52
|
+
let isMounted = true;
|
|
53
|
+
void client.auth.getSession().then(({ data }) => {
|
|
54
|
+
if (!isMounted) return;
|
|
55
|
+
const s = data?.session ?? null;
|
|
56
|
+
setSession(s);
|
|
57
|
+
setUser(s?.user ?? null);
|
|
58
|
+
setIsLoading(false);
|
|
59
|
+
}).catch(() => {
|
|
60
|
+
if (!isMounted) return;
|
|
61
|
+
setIsLoading(false);
|
|
62
|
+
});
|
|
63
|
+
const subscription = client.auth.onAuthStateChange(({ event, user: nextUser }) => {
|
|
64
|
+
if (!isMounted) return;
|
|
65
|
+
if (event === "SIGNED_OUT") {
|
|
66
|
+
setSession(null);
|
|
67
|
+
setUser(null);
|
|
68
|
+
} else if (event === "SIGNED_IN" || event === "TOKEN_REFRESHED" || event === "USER_UPDATED") {
|
|
69
|
+
void client.auth.getSession().then(({ data }) => {
|
|
70
|
+
if (!isMounted) return;
|
|
71
|
+
const s = data?.session ?? null;
|
|
72
|
+
setSession(s);
|
|
73
|
+
setUser(nextUser ?? s?.user ?? null);
|
|
74
|
+
}).catch(() => {
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
return () => {
|
|
79
|
+
isMounted = false;
|
|
80
|
+
subscription.unsubscribe();
|
|
81
|
+
};
|
|
82
|
+
}, [client]);
|
|
83
|
+
const value = React.useMemo(
|
|
84
|
+
() => ({
|
|
85
|
+
client,
|
|
86
|
+
user,
|
|
87
|
+
session,
|
|
88
|
+
accessToken: session?.access_token ?? null,
|
|
89
|
+
isLoading,
|
|
90
|
+
isAuthenticated: !!user,
|
|
91
|
+
signOut: async () => {
|
|
92
|
+
await client.auth.signOut();
|
|
93
|
+
setSession(null);
|
|
94
|
+
setUser(null);
|
|
95
|
+
}
|
|
96
|
+
}),
|
|
97
|
+
[client, user, session, isLoading]
|
|
98
|
+
);
|
|
99
|
+
const Context = getAuthContext();
|
|
100
|
+
if (!Context) {
|
|
101
|
+
return children;
|
|
102
|
+
}
|
|
103
|
+
return React.createElement(Context.Provider, { value }, children);
|
|
104
|
+
}
|
|
105
|
+
function useAuth() {
|
|
106
|
+
const React = getReact();
|
|
107
|
+
const Context = getAuthContext();
|
|
108
|
+
if (!React || !Context) {
|
|
109
|
+
return {
|
|
110
|
+
client: null,
|
|
111
|
+
user: null,
|
|
112
|
+
session: null,
|
|
113
|
+
accessToken: null,
|
|
114
|
+
isLoading: false,
|
|
115
|
+
isAuthenticated: false,
|
|
116
|
+
signOut: async () => {
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
return React.useContext(Context);
|
|
121
|
+
}
|
|
122
|
+
function useUser() {
|
|
123
|
+
const { user } = useAuth();
|
|
124
|
+
return user;
|
|
125
|
+
}
|
|
126
|
+
function useSession() {
|
|
127
|
+
const { session } = useAuth();
|
|
128
|
+
return session;
|
|
129
|
+
}
|
|
130
|
+
function SignedIn({ children }) {
|
|
131
|
+
const React = getReact();
|
|
132
|
+
const { isAuthenticated, isLoading } = useAuth();
|
|
133
|
+
if (isLoading || !isAuthenticated || !React) return null;
|
|
134
|
+
return React.createElement(React.Fragment, null, children);
|
|
135
|
+
}
|
|
136
|
+
function SignedOut({ children }) {
|
|
137
|
+
const React = getReact();
|
|
138
|
+
const { isAuthenticated, isLoading } = useAuth();
|
|
139
|
+
if (isLoading || isAuthenticated || !React) return null;
|
|
140
|
+
return React.createElement(React.Fragment, null, children);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export { AuthProvider, SignedIn, SignedOut, useAuth, useSession, useUser };
|
package/dist/ssr.cjs
CHANGED
|
@@ -63,6 +63,11 @@ var AuraClient = class {
|
|
|
63
63
|
"[aurabase] No API key provided. Most operations require an API key (apikey header). Only public auth routes (register, login, refresh) will work without one."
|
|
64
64
|
);
|
|
65
65
|
}
|
|
66
|
+
if (typeof console !== "undefined" && /^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?\/?$/.test(this.baseUrl)) {
|
|
67
|
+
console.warn(
|
|
68
|
+
"[aurabase] Attention : en local, l'URL du projet doit inclure le sous-domaine (ex: http://<slug>.localhost:8080) pour permettre la r\xE9solution automatique du projet par la passerelle."
|
|
69
|
+
);
|
|
70
|
+
}
|
|
66
71
|
if (this.apiKey?.startsWith(SERVICE_ROLE_KEY_PREFIX) && isBrowserContext()) {
|
|
67
72
|
const refuse = resolvedOptions?.refuseServiceRoleInBrowser ?? true;
|
|
68
73
|
const message = "[aurabase] S\xC9CURIT\xC9 : une cl\xE9 service_role (aura_sk_\u2026) est fournie \xE0 createClient() dans un contexte navigateur. Cette cl\xE9 \xE0 privil\xE8ges \xE9lev\xE9s NE DOIT JAMAIS \xEAtre expos\xE9e c\xF4t\xE9 client (elle fuiterait dans le bundle). Utilisez une cl\xE9 anon (aura_anon_\u2026) c\xF4t\xE9 client, et createAdminClient() c\xF4t\xE9 serveur pour les op\xE9rations d'administration.";
|
|
@@ -80,7 +85,7 @@ var AuraClient = class {
|
|
|
80
85
|
const g = globalThis;
|
|
81
86
|
const proc = g?.process;
|
|
82
87
|
const isTest = !!(proc?.env?.VITEST || proc?.env?.NODE_ENV === "test" || proc?.env?.JEST_WORKER_ID);
|
|
83
|
-
return isTest && g?.localStorage && typeof g.localStorage.getItem === "function";
|
|
88
|
+
return isTest && !!g?.localStorage && typeof g.localStorage.getItem === "function";
|
|
84
89
|
})()) {
|
|
85
90
|
this.authStore = new core.LocalAuthStore(`aura-${core.clientScope(this.baseUrl)}-auth`);
|
|
86
91
|
} else {
|
|
@@ -158,7 +163,6 @@ var AuraClient = class {
|
|
|
158
163
|
if (!this._notifications) this._notifications = new notifications.NotificationsService(this);
|
|
159
164
|
return this._notifications;
|
|
160
165
|
}
|
|
161
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
162
166
|
from(table) {
|
|
163
167
|
return this.db.from(table);
|
|
164
168
|
}
|
|
@@ -171,7 +175,6 @@ var AuraClient = class {
|
|
|
171
175
|
* const { data, error } = await aura.rpc('echo_test', { message: 'hello' })
|
|
172
176
|
* ```
|
|
173
177
|
*/
|
|
174
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
175
178
|
rpc(fn, args, options) {
|
|
176
179
|
return this.db.rpc(fn, args, options);
|
|
177
180
|
}
|
package/dist/ssr.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SerializeCookieOptions, AuraClientOptions } from '@aurabase/core';
|
|
2
2
|
export { SerializeCookieOptions, parseCookieHeader, serializeCookieHeader } from '@aurabase/core';
|
|
3
|
-
import { A as AuraClient } from './AuraClient-
|
|
3
|
+
import { A as AuraClient } from './AuraClient-5jDiXjrO.cjs';
|
|
4
4
|
import '@aurabase/ai';
|
|
5
5
|
import '@aurabase/auth';
|
|
6
6
|
import '@aurabase/db';
|
package/dist/ssr.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SerializeCookieOptions, AuraClientOptions } from '@aurabase/core';
|
|
2
2
|
export { SerializeCookieOptions, parseCookieHeader, serializeCookieHeader } from '@aurabase/core';
|
|
3
|
-
import { A as AuraClient } from './AuraClient-
|
|
3
|
+
import { A as AuraClient } from './AuraClient-5jDiXjrO.js';
|
|
4
4
|
import '@aurabase/ai';
|
|
5
5
|
import '@aurabase/auth';
|
|
6
6
|
import '@aurabase/db';
|
package/dist/ssr.js
CHANGED
|
@@ -62,6 +62,11 @@ var AuraClient = class {
|
|
|
62
62
|
"[aurabase] No API key provided. Most operations require an API key (apikey header). Only public auth routes (register, login, refresh) will work without one."
|
|
63
63
|
);
|
|
64
64
|
}
|
|
65
|
+
if (typeof console !== "undefined" && /^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?\/?$/.test(this.baseUrl)) {
|
|
66
|
+
console.warn(
|
|
67
|
+
"[aurabase] Attention : en local, l'URL du projet doit inclure le sous-domaine (ex: http://<slug>.localhost:8080) pour permettre la r\xE9solution automatique du projet par la passerelle."
|
|
68
|
+
);
|
|
69
|
+
}
|
|
65
70
|
if (this.apiKey?.startsWith(SERVICE_ROLE_KEY_PREFIX) && isBrowserContext()) {
|
|
66
71
|
const refuse = resolvedOptions?.refuseServiceRoleInBrowser ?? true;
|
|
67
72
|
const message = "[aurabase] S\xC9CURIT\xC9 : une cl\xE9 service_role (aura_sk_\u2026) est fournie \xE0 createClient() dans un contexte navigateur. Cette cl\xE9 \xE0 privil\xE8ges \xE9lev\xE9s NE DOIT JAMAIS \xEAtre expos\xE9e c\xF4t\xE9 client (elle fuiterait dans le bundle). Utilisez une cl\xE9 anon (aura_anon_\u2026) c\xF4t\xE9 client, et createAdminClient() c\xF4t\xE9 serveur pour les op\xE9rations d'administration.";
|
|
@@ -79,7 +84,7 @@ var AuraClient = class {
|
|
|
79
84
|
const g = globalThis;
|
|
80
85
|
const proc = g?.process;
|
|
81
86
|
const isTest = !!(proc?.env?.VITEST || proc?.env?.NODE_ENV === "test" || proc?.env?.JEST_WORKER_ID);
|
|
82
|
-
return isTest && g?.localStorage && typeof g.localStorage.getItem === "function";
|
|
87
|
+
return isTest && !!g?.localStorage && typeof g.localStorage.getItem === "function";
|
|
83
88
|
})()) {
|
|
84
89
|
this.authStore = new LocalAuthStore(`aura-${clientScope(this.baseUrl)}-auth`);
|
|
85
90
|
} else {
|
|
@@ -157,7 +162,6 @@ var AuraClient = class {
|
|
|
157
162
|
if (!this._notifications) this._notifications = new NotificationsService(this);
|
|
158
163
|
return this._notifications;
|
|
159
164
|
}
|
|
160
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
161
165
|
from(table) {
|
|
162
166
|
return this.db.from(table);
|
|
163
167
|
}
|
|
@@ -170,7 +174,6 @@ var AuraClient = class {
|
|
|
170
174
|
* const { data, error } = await aura.rpc('echo_test', { message: 'hello' })
|
|
171
175
|
* ```
|
|
172
176
|
*/
|
|
173
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
174
177
|
rpc(fn, args, options) {
|
|
175
178
|
return this.db.rpc(fn, args, options);
|
|
176
179
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aurabase/aurabase-js",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "Official JavaScript/TypeScript client for Aurabase BaaS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -26,6 +26,26 @@
|
|
|
26
26
|
"types": "./dist/ssr.d.cts",
|
|
27
27
|
"default": "./dist/ssr.cjs"
|
|
28
28
|
}
|
|
29
|
+
},
|
|
30
|
+
"./nextjs": {
|
|
31
|
+
"import": {
|
|
32
|
+
"types": "./dist/nextjs.d.ts",
|
|
33
|
+
"default": "./dist/nextjs.js"
|
|
34
|
+
},
|
|
35
|
+
"require": {
|
|
36
|
+
"types": "./dist/nextjs.d.cts",
|
|
37
|
+
"default": "./dist/nextjs.cjs"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"./react": {
|
|
41
|
+
"import": {
|
|
42
|
+
"types": "./dist/react.d.ts",
|
|
43
|
+
"default": "./dist/react.js"
|
|
44
|
+
},
|
|
45
|
+
"require": {
|
|
46
|
+
"types": "./dist/react.d.cts",
|
|
47
|
+
"default": "./dist/react.cjs"
|
|
48
|
+
}
|
|
29
49
|
}
|
|
30
50
|
},
|
|
31
51
|
"sideEffects": false,
|
|
@@ -56,14 +76,14 @@
|
|
|
56
76
|
"client"
|
|
57
77
|
],
|
|
58
78
|
"dependencies": {
|
|
59
|
-
"@aurabase/
|
|
60
|
-
"@aurabase/
|
|
61
|
-
"@aurabase/auth": "0.5.
|
|
62
|
-
"@aurabase/
|
|
63
|
-
"@aurabase/
|
|
64
|
-
"@aurabase/
|
|
65
|
-
"@aurabase/
|
|
66
|
-
"@aurabase/
|
|
79
|
+
"@aurabase/db": "0.5.4",
|
|
80
|
+
"@aurabase/core": "0.5.4",
|
|
81
|
+
"@aurabase/auth": "0.5.4",
|
|
82
|
+
"@aurabase/realtime": "0.5.4",
|
|
83
|
+
"@aurabase/storage": "0.5.4",
|
|
84
|
+
"@aurabase/notifications": "0.5.4",
|
|
85
|
+
"@aurabase/ai": "0.5.4",
|
|
86
|
+
"@aurabase/functions": "0.5.4"
|
|
67
87
|
},
|
|
68
88
|
"devDependencies": {
|
|
69
89
|
"@types/node": "20.14.15",
|