@aurabase/aurabase-js 0.7.2 → 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 {
@@ -116,9 +119,8 @@ declare class AuraClient<Database = any, Schema extends GenericSchema = Database
116
119
  * const { data, error } = await aura.from('posts').select('*').limit(10)
117
120
  * ```
118
121
  */
119
- from<TableName extends string & keyof Schema['Tables'], Table extends Schema['Tables'][TableName]>(table: TableName): AuraQueryBuilder<Schema, Table, TableName, AuraClientOptionsT>;
120
- from<ViewName extends string & keyof Schema['Views'], View extends Schema['Views'][ViewName]>(view: ViewName): AuraQueryBuilder<Schema, View, ViewName, AuraClientOptionsT>;
121
- 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>;
122
124
  /**
123
125
  * Shortcut: call a stored procedure / PostgreSQL function via RPC (Supabase-compatible API).
124
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 {
@@ -116,9 +119,8 @@ declare class AuraClient<Database = any, Schema extends GenericSchema = Database
116
119
  * const { data, error } = await aura.from('posts').select('*').limit(10)
117
120
  * ```
118
121
  */
119
- from<TableName extends string & keyof Schema['Tables'], Table extends Schema['Tables'][TableName]>(table: TableName): AuraQueryBuilder<Schema, Table, TableName, AuraClientOptionsT>;
120
- from<ViewName extends string & keyof Schema['Views'], View extends Schema['Views'][ViewName]>(view: ViewName): AuraQueryBuilder<Schema, View, ViewName, AuraClientOptionsT>;
121
- 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>;
122
124
  /**
123
125
  * Shortcut: call a stored procedure / PostgreSQL function via RPC (Supabase-compatible API).
124
126
  * Equivalent to `aura.db.rpc(fn, args, options)`.
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-BPro_SCQ.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-BPro_SCQ.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/nextjs.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as AuraClient } from './AuraClient-BPro_SCQ.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-BPro_SCQ.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/react.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { User, Session } from '@aurabase/core';
2
- import { A as AuraClient } from './AuraClient-BPro_SCQ.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';
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-BPro_SCQ.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';
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-BPro_SCQ.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-BPro_SCQ.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurabase/aurabase-js",
3
- "version": "0.7.2",
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.2",
81
- "@aurabase/auth": "0.7.2",
82
- "@aurabase/db": "0.7.2",
83
- "@aurabase/storage": "0.7.2",
84
- "@aurabase/realtime": "0.7.2",
85
- "@aurabase/functions": "0.7.2",
86
- "@aurabase/ai": "0.7.2",
87
- "@aurabase/notifications": "0.7.2"
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",