From 0585c013b531b755801427f902199260437b5168 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Wed, 30 Oct 2024 14:31:05 +0700 Subject: [PATCH] fix: Revert "Merge pull request #1299 from supabase/rc" This reverts commit 963d6a5b075eb813b6fd5d4feded367e837235df, reversing changes made to ce1e2f0729068a2bcd794cc3937da07d5d38677e. --- package-lock.json | 8 ++++---- package.json | 2 +- src/SupabaseClient.ts | 4 +--- src/lib/types.ts | 10 ---------- test/index.test-d.ts | 7 ++----- 5 files changed, 8 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5f07dd4d..99851b82 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@supabase/auth-js": "2.65.1", "@supabase/functions-js": "2.4.3", "@supabase/node-fetch": "2.6.15", - "@supabase/postgrest-js": "1.17.0", + "@supabase/postgrest-js": "1.16.3", "@supabase/realtime-js": "2.10.7", "@supabase/storage-js": "2.7.1" }, @@ -1196,9 +1196,9 @@ } }, "node_modules/@supabase/postgrest-js": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-1.17.0.tgz", - "integrity": "sha512-vbtb72VpyCkDjcD95SAW4C+3B6NNEICNlEN9H6LcSfIxk5qPImwZ9hVYLa20i+P8GXmKWDoSjjJEK2j6qlR1qQ==", + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-1.16.3.tgz", + "integrity": "sha512-HI6dsbW68AKlOPofUjDTaosiDBCtW4XAm0D18pPwxoW3zKOE2Ru13Z69Wuys9fd6iTpfDViNco5sgrtnP0666A==", "dependencies": { "@supabase/node-fetch": "^2.6.14" } diff --git a/package.json b/package.json index 980a117b..fb375584 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "@supabase/auth-js": "2.65.1", "@supabase/functions-js": "2.4.3", "@supabase/node-fetch": "2.6.15", - "@supabase/postgrest-js": "1.17.0", + "@supabase/postgrest-js": "1.16.3", "@supabase/realtime-js": "2.10.7", "@supabase/storage-js": "2.7.1" }, diff --git a/src/SupabaseClient.ts b/src/SupabaseClient.ts index 996685fb..9f0a32c7 100644 --- a/src/SupabaseClient.ts +++ b/src/SupabaseClient.ts @@ -221,9 +221,7 @@ export default class SupabaseClient< ? Fn['Returns'][number] : never : never, - Fn['Returns'], - FnName, - null + Fn['Returns'] > { return this.rest.rpc(fn, args, options) } diff --git a/src/lib/types.ts b/src/lib/types.ts index 0b8d3290..85531a0e 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -80,26 +80,16 @@ export type SupabaseClientOptions = { accessToken?: () => Promise } -export type GenericRelationship = { - foreignKeyName: string - columns: string[] - isOneToOne?: boolean - referencedRelation: string - referencedColumns: string[] -} - export type GenericTable = { Row: Record Insert: Record Update: Record - Relationships: GenericRelationship[] } export type GenericUpdatableView = GenericTable export type GenericNonUpdatableView = { Row: Record - Relationships: GenericRelationship[] } export type GenericView = GenericUpdatableView | GenericNonUpdatableView diff --git a/test/index.test-d.ts b/test/index.test-d.ts index 672e4697..13a8df1d 100644 --- a/test/index.test-d.ts +++ b/test/index.test-d.ts @@ -84,7 +84,7 @@ const supabase = createClient(URL, KEY) if (error) { throw new Error(error.message) } - expectType(message.user) + expectType(message.user) } // one-to-many relationship @@ -99,11 +99,8 @@ const supabase = createClient(URL, KEY) // referencing missing column { type SelectQueryError = { error: true } & Message - const res = await supabase.from('users').select('username, dat') - expectType< - PostgrestSingleResponse[]> - >(res) + expectType[]>>(res) } // one-to-one relationship