@aurabase/aurabase-js 0.7.1 → 0.7.3

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.
@@ -23,6 +23,9 @@ import { StorageService } from '@aurabase/storage';
23
23
  * const { data } = await aura.db.from('posts').eq('published', true)
24
24
  * ```
25
25
  */
26
+ type ValidRelationKeys<Relations> = {
27
+ [K in keyof Relations]: [Relations[K]] extends [never] ? never : K;
28
+ }[keyof Relations];
26
29
  declare class AuraClient<Database = any, Schema extends GenericSchema = Database extends {
27
30
  public: infer S;
28
31
  } ? S extends GenericSchema ? S : any : any> implements AuraClientLike {
@@ -53,6 +56,7 @@ declare class AuraClient<Database = any, Schema extends GenericSchema = Database
53
56
  readonly onEvent?: (event: AuraObservabilityEvent) => void;
54
57
  /** Journalise chaque `AuraObservabilityEvent` via `console.debug` — voir `AuraClientOptions.debug`. */
55
58
  readonly debug?: boolean;
59
+ readonly parseBigIntAsString?: boolean;
56
60
  private _auth;
57
61
  private _db;
58
62
  private _storage;
@@ -115,9 +119,8 @@ declare class AuraClient<Database = any, Schema extends GenericSchema = Database
115
119
  * const { data, error } = await aura.from('posts').select('*').limit(10)
116
120
  * ```
117
121
  */
118
- from<TableName extends string & keyof Schema['Tables'], Table extends Schema['Tables'][TableName]>(table: TableName): AuraQueryBuilder<Schema, Table, TableName, AuraClientOptionsT>;
119
- from<ViewName extends string & keyof Schema['Views'], View extends Schema['Views'][ViewName]>(view: ViewName): AuraQueryBuilder<Schema, View, ViewName, AuraClientOptionsT>;
120
- from(table: string): AuraQueryBuilder<any, any, any, AuraClientOptionsT>;
122
+ from<TableName extends string & ValidRelationKeys<Schema['Tables']>, Table extends Schema['Tables'][TableName]>(table: TableName): AuraQueryBuilder<Schema, Table, TableName, AuraClientOptionsT>;
123
+ from<ViewName extends string & ValidRelationKeys<Schema['Views']>, View extends Schema['Views'][ViewName]>(view: ViewName): AuraQueryBuilder<Schema, View, ViewName, AuraClientOptionsT>;
121
124
  /**
122
125
  * Shortcut: call a stored procedure / PostgreSQL function via RPC (Supabase-compatible API).
123
126
  * Equivalent to `aura.db.rpc(fn, args, options)`.
@@ -23,6 +23,9 @@ import { StorageService } from '@aurabase/storage';
23
23
  * const { data } = await aura.db.from('posts').eq('published', true)
24
24
  * ```
25
25
  */
26
+ type ValidRelationKeys<Relations> = {
27
+ [K in keyof Relations]: [Relations[K]] extends [never] ? never : K;
28
+ }[keyof Relations];
26
29
  declare class AuraClient<Database = any, Schema extends GenericSchema = Database extends {
27
30
  public: infer S;
28
31
  } ? S extends GenericSchema ? S : any : any> implements AuraClientLike {
@@ -53,6 +56,7 @@ declare class AuraClient<Database = any, Schema extends GenericSchema = Database
53
56
  readonly onEvent?: (event: AuraObservabilityEvent) => void;
54
57
  /** Journalise chaque `AuraObservabilityEvent` via `console.debug` — voir `AuraClientOptions.debug`. */
55
58
  readonly debug?: boolean;
59
+ readonly parseBigIntAsString?: boolean;
56
60
  private _auth;
57
61
  private _db;
58
62
  private _storage;
@@ -115,9 +119,8 @@ declare class AuraClient<Database = any, Schema extends GenericSchema = Database
115
119
  * const { data, error } = await aura.from('posts').select('*').limit(10)
116
120
  * ```
117
121
  */
118
- from<TableName extends string & keyof Schema['Tables'], Table extends Schema['Tables'][TableName]>(table: TableName): AuraQueryBuilder<Schema, Table, TableName, AuraClientOptionsT>;
119
- from<ViewName extends string & keyof Schema['Views'], View extends Schema['Views'][ViewName]>(view: ViewName): AuraQueryBuilder<Schema, View, ViewName, AuraClientOptionsT>;
120
- from(table: string): AuraQueryBuilder<any, any, any, AuraClientOptionsT>;
122
+ from<TableName extends string & ValidRelationKeys<Schema['Tables']>, Table extends Schema['Tables'][TableName]>(table: TableName): AuraQueryBuilder<Schema, Table, TableName, AuraClientOptionsT>;
123
+ from<ViewName extends string & ValidRelationKeys<Schema['Views']>, View extends Schema['Views'][ViewName]>(view: ViewName): AuraQueryBuilder<Schema, View, ViewName, AuraClientOptionsT>;
121
124
  /**
122
125
  * Shortcut: call a stored procedure / PostgreSQL function via RPC (Supabase-compatible API).
123
126
  * Equivalent to `aura.db.rpc(fn, args, options)`.
package/dist/index.cjs CHANGED
@@ -43,6 +43,7 @@ var AuraClient = class {
43
43
  onEvent;
44
44
  /** Journalise chaque `AuraObservabilityEvent` via `console.debug` — voir `AuraClientOptions.debug`. */
45
45
  debug;
46
+ parseBigIntAsString;
46
47
  // Lazy-initialised service instances
47
48
  _auth = null;
48
49
  _db = null;
@@ -86,6 +87,7 @@ var AuraClient = class {
86
87
  this.requestTimeoutMs = resolvedOptions?.requestTimeoutMs;
87
88
  this.onEvent = resolvedOptions?.onEvent;
88
89
  this.debug = resolvedOptions?.debug;
90
+ this.parseBigIntAsString = resolvedOptions?.parseBigIntAsString;
89
91
  if (!this.apiKey && typeof console !== "undefined") {
90
92
  console.warn(
91
93
  // AUTH-041 — la passerelle refuse TOUTE requête sans clé (401), y compris register/login.
package/dist/index.d.cts CHANGED
@@ -7,7 +7,7 @@ export { FunctionsHttpError, FunctionsRelayError, FunctionsResponseType, Functio
7
7
  export { NotificationsAdminService, NotificationsService } from '@aurabase/notifications';
8
8
  export { AuraChannel, RealtimeService } from '@aurabase/realtime';
9
9
  export { StorageBucketClient, StorageService } from '@aurabase/storage';
10
- import { A as AuraClient } from './AuraClient-B1OOZCSX.cjs';
10
+ import { A as AuraClient } from './AuraClient-CO_pbnEM.cjs';
11
11
 
12
12
  /**
13
13
  * Create a new Aurabase client instance.
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ export { FunctionsHttpError, FunctionsRelayError, FunctionsResponseType, Functio
7
7
  export { NotificationsAdminService, NotificationsService } from '@aurabase/notifications';
8
8
  export { AuraChannel, RealtimeService } from '@aurabase/realtime';
9
9
  export { StorageBucketClient, StorageService } from '@aurabase/storage';
10
- import { A as AuraClient } from './AuraClient-B1OOZCSX.js';
10
+ import { A as AuraClient } from './AuraClient-CO_pbnEM.js';
11
11
 
12
12
  /**
13
13
  * Create a new Aurabase client instance.
package/dist/index.js CHANGED
@@ -49,6 +49,7 @@ var AuraClient = class {
49
49
  onEvent;
50
50
  /** Journalise chaque `AuraObservabilityEvent` via `console.debug` — voir `AuraClientOptions.debug`. */
51
51
  debug;
52
+ parseBigIntAsString;
52
53
  // Lazy-initialised service instances
53
54
  _auth = null;
54
55
  _db = null;
@@ -92,6 +93,7 @@ var AuraClient = class {
92
93
  this.requestTimeoutMs = resolvedOptions?.requestTimeoutMs;
93
94
  this.onEvent = resolvedOptions?.onEvent;
94
95
  this.debug = resolvedOptions?.debug;
96
+ this.parseBigIntAsString = resolvedOptions?.parseBigIntAsString;
95
97
  if (!this.apiKey && typeof console !== "undefined") {
96
98
  console.warn(
97
99
  // AUTH-041 — la passerelle refuse TOUTE requête sans clé (401), y compris register/login.
package/dist/nextjs.cjs CHANGED
@@ -43,6 +43,7 @@ var AuraClient = class {
43
43
  onEvent;
44
44
  /** Journalise chaque `AuraObservabilityEvent` via `console.debug` — voir `AuraClientOptions.debug`. */
45
45
  debug;
46
+ parseBigIntAsString;
46
47
  // Lazy-initialised service instances
47
48
  _auth = null;
48
49
  _db = null;
@@ -86,6 +87,7 @@ var AuraClient = class {
86
87
  this.requestTimeoutMs = resolvedOptions?.requestTimeoutMs;
87
88
  this.onEvent = resolvedOptions?.onEvent;
88
89
  this.debug = resolvedOptions?.debug;
90
+ this.parseBigIntAsString = resolvedOptions?.parseBigIntAsString;
89
91
  if (!this.apiKey && typeof console !== "undefined") {
90
92
  console.warn(
91
93
  // AUTH-041 — la passerelle refuse TOUTE requête sans clé (401), y compris register/login.
@@ -449,7 +451,9 @@ function createClientForServerAction(cookieStore, projectUrl, apiKey) {
449
451
  async function auth(options) {
450
452
  const nextHeaders = await loadNextModule("next/headers");
451
453
  if (!nextHeaders?.cookies) {
452
- throw new Error("[@aurabase/nextjs] auth() can only be called in a Next.js App Router environment.");
454
+ throw new Error(
455
+ "[@aurabase/nextjs] auth() can only be called in a Next.js App Router environment."
456
+ );
453
457
  }
454
458
  const cookieStore = await nextHeaders.cookies();
455
459
  const client = createClientForServerComponent(cookieStore, options?.projectUrl, options?.apiKey);
package/dist/nextjs.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as AuraClient } from './AuraClient-B1OOZCSX.cjs';
1
+ import { A as AuraClient } from './AuraClient-CO_pbnEM.cjs';
2
2
  import { User, Session } from '@aurabase/core';
3
3
  import '@aurabase/ai';
4
4
  import '@aurabase/auth';
package/dist/nextjs.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as AuraClient } from './AuraClient-B1OOZCSX.js';
1
+ import { A as AuraClient } from './AuraClient-CO_pbnEM.js';
2
2
  import { User, Session } from '@aurabase/core';
3
3
  import '@aurabase/ai';
4
4
  import '@aurabase/auth';
package/dist/nextjs.js CHANGED
@@ -41,6 +41,7 @@ var AuraClient = class {
41
41
  onEvent;
42
42
  /** Journalise chaque `AuraObservabilityEvent` via `console.debug` — voir `AuraClientOptions.debug`. */
43
43
  debug;
44
+ parseBigIntAsString;
44
45
  // Lazy-initialised service instances
45
46
  _auth = null;
46
47
  _db = null;
@@ -84,6 +85,7 @@ var AuraClient = class {
84
85
  this.requestTimeoutMs = resolvedOptions?.requestTimeoutMs;
85
86
  this.onEvent = resolvedOptions?.onEvent;
86
87
  this.debug = resolvedOptions?.debug;
88
+ this.parseBigIntAsString = resolvedOptions?.parseBigIntAsString;
87
89
  if (!this.apiKey && typeof console !== "undefined") {
88
90
  console.warn(
89
91
  // AUTH-041 — la passerelle refuse TOUTE requête sans clé (401), y compris register/login.
@@ -447,7 +449,9 @@ function createClientForServerAction(cookieStore, projectUrl, apiKey) {
447
449
  async function auth(options) {
448
450
  const nextHeaders = await loadNextModule("next/headers");
449
451
  if (!nextHeaders?.cookies) {
450
- throw new Error("[@aurabase/nextjs] auth() can only be called in a Next.js App Router environment.");
452
+ throw new Error(
453
+ "[@aurabase/nextjs] auth() can only be called in a Next.js App Router environment."
454
+ );
451
455
  }
452
456
  const cookieStore = await nextHeaders.cookies();
453
457
  const client = createClientForServerComponent(cookieStore, options?.projectUrl, options?.apiKey);
package/dist/react.cjs CHANGED
@@ -42,7 +42,11 @@ function getAuthContext() {
42
42
  }
43
43
  return authContextInstance;
44
44
  }
45
- function AuthProvider({ client, children, initialSession = null }) {
45
+ function AuthProvider({
46
+ client,
47
+ children,
48
+ initialSession = null
49
+ }) {
46
50
  const React = getReact();
47
51
  if (!React) {
48
52
  throw new Error("[@aurabase/react] React est requis pour utiliser <AuthProvider>.");
package/dist/react.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { User, Session } from '@aurabase/core';
2
- import { A as AuraClient } from './AuraClient-B1OOZCSX.cjs';
2
+ import { A as AuraClient } from './AuraClient-CO_pbnEM.cjs';
3
3
  import '@aurabase/ai';
4
4
  import '@aurabase/auth';
5
5
  import '@aurabase/db';
@@ -53,7 +53,7 @@ interface AuthProviderProps {
53
53
  /**
54
54
  * Wraps your application to provide reactive Aurabase authentication context.
55
55
  */
56
- declare function AuthProvider({ client, children, initialSession }: AuthProviderProps): unknown;
56
+ declare function AuthProvider({ client, children, initialSession, }: AuthProviderProps): unknown;
57
57
  /**
58
58
  * Access the core Aurabase authentication state and actions.
59
59
  */
package/dist/react.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { User, Session } from '@aurabase/core';
2
- import { A as AuraClient } from './AuraClient-B1OOZCSX.js';
2
+ import { A as AuraClient } from './AuraClient-CO_pbnEM.js';
3
3
  import '@aurabase/ai';
4
4
  import '@aurabase/auth';
5
5
  import '@aurabase/db';
@@ -53,7 +53,7 @@ interface AuthProviderProps {
53
53
  /**
54
54
  * Wraps your application to provide reactive Aurabase authentication context.
55
55
  */
56
- declare function AuthProvider({ client, children, initialSession }: AuthProviderProps): unknown;
56
+ declare function AuthProvider({ client, children, initialSession, }: AuthProviderProps): unknown;
57
57
  /**
58
58
  * Access the core Aurabase authentication state and actions.
59
59
  */
package/dist/react.js CHANGED
@@ -40,7 +40,11 @@ function getAuthContext() {
40
40
  }
41
41
  return authContextInstance;
42
42
  }
43
- function AuthProvider({ client, children, initialSession = null }) {
43
+ function AuthProvider({
44
+ client,
45
+ children,
46
+ initialSession = null
47
+ }) {
44
48
  const React = getReact();
45
49
  if (!React) {
46
50
  throw new Error("[@aurabase/react] React est requis pour utiliser <AuthProvider>.");
package/dist/ssr.cjs CHANGED
@@ -43,6 +43,7 @@ var AuraClient = class {
43
43
  onEvent;
44
44
  /** Journalise chaque `AuraObservabilityEvent` via `console.debug` — voir `AuraClientOptions.debug`. */
45
45
  debug;
46
+ parseBigIntAsString;
46
47
  // Lazy-initialised service instances
47
48
  _auth = null;
48
49
  _db = null;
@@ -86,6 +87,7 @@ var AuraClient = class {
86
87
  this.requestTimeoutMs = resolvedOptions?.requestTimeoutMs;
87
88
  this.onEvent = resolvedOptions?.onEvent;
88
89
  this.debug = resolvedOptions?.debug;
90
+ this.parseBigIntAsString = resolvedOptions?.parseBigIntAsString;
89
91
  if (!this.apiKey && typeof console !== "undefined") {
90
92
  console.warn(
91
93
  // AUTH-041 — la passerelle refuse TOUTE requête sans clé (401), y compris register/login.
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-B1OOZCSX.cjs';
3
+ import { A as AuraClient } from './AuraClient-CO_pbnEM.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-B1OOZCSX.js';
3
+ import { A as AuraClient } from './AuraClient-CO_pbnEM.js';
4
4
  import '@aurabase/ai';
5
5
  import '@aurabase/auth';
6
6
  import '@aurabase/db';
package/dist/ssr.js CHANGED
@@ -42,6 +42,7 @@ var AuraClient = class {
42
42
  onEvent;
43
43
  /** Journalise chaque `AuraObservabilityEvent` via `console.debug` — voir `AuraClientOptions.debug`. */
44
44
  debug;
45
+ parseBigIntAsString;
45
46
  // Lazy-initialised service instances
46
47
  _auth = null;
47
48
  _db = null;
@@ -85,6 +86,7 @@ var AuraClient = class {
85
86
  this.requestTimeoutMs = resolvedOptions?.requestTimeoutMs;
86
87
  this.onEvent = resolvedOptions?.onEvent;
87
88
  this.debug = resolvedOptions?.debug;
89
+ this.parseBigIntAsString = resolvedOptions?.parseBigIntAsString;
88
90
  if (!this.apiKey && typeof console !== "undefined") {
89
91
  console.warn(
90
92
  // AUTH-041 — la passerelle refuse TOUTE requête sans clé (401), y compris register/login.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurabase/aurabase-js",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "description": "Official JavaScript/TypeScript client for Aurabase BaaS",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -77,14 +77,14 @@
77
77
  "client"
78
78
  ],
79
79
  "dependencies": {
80
- "@aurabase/core": "0.7.1",
81
- "@aurabase/auth": "0.7.1",
82
- "@aurabase/db": "0.7.1",
83
- "@aurabase/storage": "0.7.1",
84
- "@aurabase/realtime": "0.7.1",
85
- "@aurabase/functions": "0.7.1",
86
- "@aurabase/ai": "0.7.1",
87
- "@aurabase/notifications": "0.7.1"
80
+ "@aurabase/core": "0.7.3",
81
+ "@aurabase/auth": "0.7.3",
82
+ "@aurabase/db": "0.7.3",
83
+ "@aurabase/realtime": "0.7.3",
84
+ "@aurabase/storage": "0.7.3",
85
+ "@aurabase/functions": "0.7.3",
86
+ "@aurabase/ai": "0.7.3",
87
+ "@aurabase/notifications": "0.7.3"
88
88
  },
89
89
  "devDependencies": {
90
90
  "@types/node": "20.14.15",