-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
137 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Module } from '@nestjs/common' | ||
import { ConfigModule, ConfigService } from '@nestjs/config' | ||
import { SupabaseService } from './supabase.service' | ||
import { EnvModule } from 'src/env/env.module' | ||
import { configuration } from 'src/env/utils' | ||
import { EnvService } from 'src/env/env.service' | ||
|
||
@Module({ | ||
imports: [ | ||
ConfigModule.forRoot({ | ||
envFilePath: '.env', | ||
expandVariables: true, | ||
load: [configuration], | ||
}), | ||
EnvModule, | ||
], | ||
providers: [ | ||
ConfigService, | ||
EnvService, | ||
SupabaseService, | ||
], | ||
exports: [SupabaseService], | ||
}) | ||
export class SupabaseModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Injectable, Logger } from '@nestjs/common' | ||
import { SupabaseClient, createClient } from '@supabase/supabase-js' | ||
import { EnvService } from 'src/env/env.service' | ||
|
||
@Injectable() | ||
export class SupabaseService { | ||
private readonly logger = new Logger(SupabaseService.name) | ||
|
||
private client: SupabaseClient | ||
|
||
constructor(private readonly envService: EnvService) { | ||
// | ||
} | ||
|
||
private getClient() { | ||
if (this.client) { | ||
this.logger.log('Client already exists') | ||
return | ||
} | ||
|
||
this.client = createClient( | ||
this.envService.SUPABASE_URL, | ||
this.envService.SUPABASE_KEY, | ||
) | ||
|
||
this.client | ||
} | ||
|
||
public async fetchAdminUsers() { | ||
this.getClient() | ||
|
||
const { data } = await this.client.from('admin_users').select() | ||
return data | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
# yarn lockfile v1 | ||
# bun ./bun.lockb --hash: 5B38A1FD462F2CC0-cc5d82060f66f195-E63DC497A5056974-f571d51b1211fdbd | ||
# bun ./bun.lockb --hash: CEA8F34611DBFD29-3fde5bb29df8a869-2EDC06F627F40462-17c439776c20cdcd | ||
|
||
|
||
"@aashutoshrathi/word-wrap@^1.2.3": | ||
|
@@ -4105,13 +4105,27 @@ | |
dependencies: | ||
"@supabase/node-fetch" "^2.6.14" | ||
|
||
"@supabase/[email protected]": | ||
version "2.64.2" | ||
resolved "https://registry.npmjs.org/@supabase/auth-js/-/auth-js-2.64.2.tgz" | ||
integrity sha512-s+lkHEdGiczDrzXJ1YWt2y3bxRi+qIUnXcgkpLSrId7yjBeaXBFygNjTaoZLG02KNcYwbuZ9qkEIqmj2hF7svw== | ||
dependencies: | ||
"@supabase/node-fetch" "^2.6.14" | ||
|
||
"@supabase/[email protected]": | ||
version "2.2.2" | ||
resolved "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.2.2.tgz" | ||
integrity sha512-sJGq1nludmi7pY/fdtCpyY/pYonx7MfHdN408bqb736guWcVI1AChYVbI4kUM978EuOE4Ci6l7bUudfGg07QRw== | ||
dependencies: | ||
"@supabase/node-fetch" "^2.6.14" | ||
|
||
"@supabase/[email protected]": | ||
version "2.3.1" | ||
resolved "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.3.1.tgz" | ||
integrity sha512-QyzNle/rVzlOi4BbVqxLSH828VdGY1RElqGFAj+XeVypj6+PVtMlD21G8SDnsPQDtlqqTtoGRgdMlQZih5hTuw== | ||
dependencies: | ||
"@supabase/node-fetch" "^2.6.14" | ||
|
||
"@supabase/[email protected]", "@supabase/node-fetch@^2.6.14": | ||
version "2.6.15" | ||
resolved "https://registry.npmjs.org/@supabase/node-fetch/-/node-fetch-2.6.15.tgz" | ||
|
@@ -4126,6 +4140,13 @@ | |
dependencies: | ||
"@supabase/node-fetch" "^2.6.14" | ||
|
||
"@supabase/[email protected]": | ||
version "1.15.2" | ||
resolved "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-1.15.2.tgz" | ||
integrity sha512-9/7pUmXExvGuEK1yZhVYXPZnLEkDTwxgMQHXLrN5BwPZZm4iUCL1YEyep/Z2lIZah8d8M433mVAUEGsihUj5KQ== | ||
dependencies: | ||
"@supabase/node-fetch" "^2.6.14" | ||
|
||
"@supabase/[email protected]": | ||
version "2.9.3" | ||
resolved "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.9.3.tgz" | ||
|
@@ -4136,6 +4157,16 @@ | |
"@types/ws" "^8.5.10" | ||
ws "^8.14.2" | ||
|
||
"@supabase/[email protected]": | ||
version "2.9.5" | ||
resolved "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.9.5.tgz" | ||
integrity sha512-TEHlGwNGGmKPdeMtca1lFTYCedrhTAv3nZVoSjrKQ+wkMmaERuCe57zkC5KSWFzLYkb5FVHW8Hrr+PX1DDwplQ== | ||
dependencies: | ||
"@supabase/node-fetch" "^2.6.14" | ||
"@types/phoenix" "^1.5.4" | ||
"@types/ws" "^8.5.10" | ||
ws "^8.14.2" | ||
|
||
"@supabase/[email protected]": | ||
version "2.5.5" | ||
resolved "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-2.5.5.tgz" | ||
|
@@ -4155,6 +4186,18 @@ | |
"@supabase/realtime-js" "2.9.3" | ||
"@supabase/storage-js" "2.5.5" | ||
|
||
"@supabase/[email protected]": | ||
version "2.43.1" | ||
resolved "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.43.1.tgz" | ||
integrity sha512-A+RV50mWNtyKo6M0u4G6AOqEifQD+MoOjZcpRkPMPpEAFgMsc2dt3kBlBlR/MgZizWQgUKhsvrwKk0efc8g6Ug== | ||
dependencies: | ||
"@supabase/auth-js" "2.64.2" | ||
"@supabase/functions-js" "2.3.1" | ||
"@supabase/node-fetch" "2.6.15" | ||
"@supabase/postgrest-js" "1.15.2" | ||
"@supabase/realtime-js" "2.9.5" | ||
"@supabase/storage-js" "2.5.5" | ||
|
||
"@trysound/[email protected]": | ||
version "0.2.0" | ||
resolved "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz" | ||
|
@@ -5592,6 +5635,7 @@ | |
"@nestjs/common" "10.3.7" | ||
"@nestjs/core" "10.3.7" | ||
"@nestjs/platform-express" "10.3.7" | ||
"@supabase/supabase-js" "2.43.1" | ||
puppeteer "19.9.1" | ||
reflect-metadata "0.2.2" | ||
rxjs "7.8.1" | ||
|