-
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.
Refactor: Remove example environment files and update Supabase client…
… configuration to use centralized config
- Loading branch information
Showing
6 changed files
with
20 additions
and
68 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,13 +1,7 @@ | ||
// TODO: should be moved to @eda/supabase, but currently having error: SyntaxError: Cannot use import statement outside a module | ||
import { config } from "@eda/config"; | ||
import { createClient } from "@supabase/supabase-js"; | ||
// Generate the Typescript types using the Supabase CLI: https://supabase.com/docs/guides/api/rest/generating-types | ||
// import type { Database } from "database.types"; | ||
|
||
// Create a single Supabase client for interacting with your database | ||
// 'Database' supplies the type definitions to supabase-js | ||
// export const supabase = createClient<Database>( | ||
export const supabase = createClient( | ||
// These details can be found in your Supabase project settings under `API` | ||
process.env.SUPABASE_PROJECT_URL as string, // e.g. https://abc123.supabase.co - replace 'abc123' with your project ID | ||
process.env.SUPABASE_SERVICE_ROLE_KEY as string, // Your service role secret key | ||
config.databases.supabase.url, | ||
config.api_keys.supabase.service_key, | ||
); |
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,13 @@ | ||
import { z } from "zod"; | ||
|
||
export const apiCallSchema = z.object({ | ||
endpoint: z.string(), | ||
method: z.string(), | ||
statusCode: z.number(), | ||
duration: z.number(), | ||
timestamp: z.string(), | ||
sessionId: z.string(), | ||
error: z.string().optional(), | ||
}); | ||
|
||
export type ApiCall = z.infer<typeof apiCallSchema>; |
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