The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Re add 7 day option (#35958)
Jordi Enric0254adf97e82
diff --git a/apps/studio/components/interfaces/Home/ProjectUsage.tsx b/apps/studio/components/interfaces/Home/ProjectUsage.tsxindex d0c2623f3cc..c681a870c78 100644--- a/apps/studio/components/interfaces/Home/ProjectUsage.tsx+++ b/apps/studio/components/interfaces/Home/ProjectUsage.tsx@@ -7,6 +7,7 @@ import { useState } from 'react'import { useParams } from 'common'import BarChart from 'components/ui/Charts/BarChart'+import { InlineLink } from 'components/ui/InlineLink'import Panel from 'components/ui/Panel'import {ProjectLogStatsVariables,@@ -16,6 +17,7 @@ import {import { useFillTimeseriesSorted } from 'hooks/analytics/useFillTimeseriesSorted'import { useCurrentOrgPlan } from 'hooks/misc/useCurrentOrgPlan'import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'+import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'import type { ChartIntervals } from 'types'import {Button,@@ -25,10 +27,15 @@ import {DropdownMenuRadioItem,DropdownMenuTrigger,Loading,+ Tooltip,+ TooltipContent,+ TooltipTrigger,} from 'ui'type ChartIntervalKey = ProjectLogStatsVariables['interval']+const LOG_RETENTION = { free: 1, pro: 7, team: 28, enterprise: 90 }+const CHART_INTERVALS: ChartIntervals[] = [{key: '1hr',@@ -36,7 +43,7 @@ const CHART_INTERVALS: ChartIntervals[] = [startValue: 1,startUnit: 'hour',format: 'MMM D, h:mma',- availableIn: ['free', 'pro', 'enterprise', 'team'],+ availableIn: ['free', 'pro', 'team', 'enterprise'],},{key: '1day',@@ -44,21 +51,22 @@ const CHART_INTERVALS: ChartIntervals[] = [startValue: 24,startUnit: 'hour',format: 'MMM D, ha',- availableIn: ['free', 'pro', 'enterprise', 'team'],+ availableIn: ['free', 'pro', 'team', 'enterprise'],+ },+ {+ key: '7day',+ label: 'Last 7 days',+ startValue: 7,+ startUnit: 'day',+ format: 'MMM D',+ availableIn: ['pro', 'team', 'enterprise'],},- // {- // key: '',- // label: 'Last 7 days',- // startValue: 7,- // startUnit: 'day',- // format: 'MMM D',- // availableIn: ['pro', 'enterprise', 'team'],- // },]const ProjectUsage = () => {const router = useRouter()const { ref: projectRef } = useParams()+ const organization = useSelectedOrganization()const { projectAuthAll: authEnabled, projectStorageAll: storageEnabled } = useIsFeatureEnabled(['project_auth:all',@@ -124,15 +132,49 @@ const ProjectUsage = () => {setInterval(interval as ProjectLogStatsVariables['interval'])}>- {CHART_INTERVALS.map((i) => (- <DropdownMenuRadioItem- key={i.key}- value={i.key}- disabled={!i.availableIn?.includes(plan?.id || 'free')}- >- {i.label}- </DropdownMenuRadioItem>- ))}+ {CHART_INTERVALS.map((i) => {+ const disabled = !i.availableIn?.includes(plan?.id || 'free')++ if (disabled) {+ const retentionDuration = LOG_RETENTION[plan?.id ?? 'free']+ return (+ <Tooltip>+ <TooltipTrigger asChild>+ <DropdownMenuRadioItem+ disabled+ key={i.key}+ value={i.key}+ className="!pointer-events-auto"+ >+ {i.label}+ </DropdownMenuRadioItem>+ </TooltipTrigger>+ <TooltipContent side="right">+ <p>+ {plan?.name} plan only includes up to {retentionDuration} day+ {retentionDuration > 1 ? 's' : ''} of log retention+ </p>+ <p className="text-foreground-light">+ <InlineLink+ className="text-foreground-light hover:text-foreground"+ href={`/org/${organization?.slug}/billing?panel=subscriptionPlan`}+ >+ Upgrade your plan+ </InlineLink>{' '}+ to increase log retention and view statistics for the{' '}+ {i.label.toLowerCase()}+ </p>+ </TooltipContent>+ </Tooltip>+ )+ } else {+ return (+ <DropdownMenuRadioItem key={i.key} value={i.key}>+ {i.label}+ </DropdownMenuRadioItem>+ )+ }+ })}</DropdownMenuRadioGroup></DropdownMenuContent></DropdownMenu>diff --git a/packages/api-types/types/api.d.ts b/packages/api-types/types/api.d.tsindex 52e1966f279..bdc4409dcf4 100644--- a/packages/api-types/types/api.d.ts+++ b/packages/api-types/types/api.d.ts@@ -198,6 +198,24 @@ export interface paths {patch?: nevertrace?: never}+ '/v1/organizations/{slug}/project-claim/{token}': {+ parameters: {+ query?: never+ header?: never+ path?: never+ cookie?: never+ }+ /** Gets project details for the specified organization and claim token */+ get: operations['v1-get-organization-project-claim']+ put?: never+ /** Claims project for the specified organization */+ post: operations['v1-claim-project-for-organization']+ delete?: never+ options?: never+ head?: never+ patch?: never+ trace?: never+ }'/v1/projects': {parameters: {query?: never@@ -304,6 +322,40 @@ export interface paths {patch?: nevertrace?: never}+ '/v1/projects/{ref}/analytics/endpoints/usage.api-counts': {+ parameters: {+ query?: never+ header?: never+ path?: never+ cookie?: never+ }+ /** Gets project's usage api counts */+ get: operations['getApiCounts']+ put?: never+ post?: never+ delete?: never+ options?: never+ head?: never+ patch?: never+ trace?: never+ }+ '/v1/projects/{ref}/analytics/endpoints/usage.api-requests-count': {+ parameters: {+ query?: never+ header?: never+ path?: never+ cookie?: never+ }+ /** Gets project's usage api requests count */+ get: operations['getApiRequestsCount']+ put?: never+ post?: never+ delete?: never+ options?: never+ head?: never+ patch?: never+ trace?: never+ }'/v1/projects/{ref}/api-keys': {parameters: {query?: never@@ -404,6 +456,25 @@ export interface paths {patch?: nevertrace?: never}+ '/v1/projects/{ref}/claim-token': {+ parameters: {+ query?: never+ header?: never+ path?: never+ cookie?: never+ }+ /** Gets project claim token */+ get: operations['v1-get-project-claim-token']+ put?: never+ /** Creates project claim token */+ post: operations['v1-create-project-claim-token']+ /** Revokes project claim token */+ delete: operations['v1-delete-project-claim-token']+ options?: never+ head?: never+ patch?: never+ trace?: never+ }'/v1/projects/{ref}/config/auth': {parameters: {query?: never@@ -557,14 +628,14 @@ export interface paths {cookie?: never}/** Gets project's supavisor config */- get: operations['getSupavisorConfig']+ get: operations['v1-get-pooler-config']put?: neverpost?: neverdelete?: neveroptions?: neverhead?: never/** Updates project's supavisor config */- patch: operations['updateSupavisorConfig']+ patch: operations['v1-update-pooler-config']trace?: never}'/v1/projects/{ref}/config/database/postgres': {@@ -738,7 +809,7 @@ export interface paths {* [Beta] List applied migration versions* @description Only available to selected partner OAuth apps*/- get: operations['v1-list-migrations']+ get: operations['v1-list-migration-history']put?: never/*** [Beta] Apply a database migration@@ -1367,6 +1438,23 @@ export interface components {ActivateVanitySubdomainResponse: {custom_domain: string}+ AnalyticsResponse: {+ error?:+ | string+ | {+ code: number+ errors: {+ domain: string+ location: string+ locationType: string+ message: string+ reason: string+ }[]+ message: string+ status: string+ }+ result?: unknown[]+ }ApiKeyResponse: {api_key: stringdescription?: string | null@@ -1660,6 +1748,7 @@ export interface components {workflow_run_id: string}BulkUpdateFunctionBody: {+ /** Format: int64 */created_at?: numberentrypoint_path?: stringid: string@@ -1674,6 +1763,7 @@ export interface components {}[]BulkUpdateFunctionResponse: {functions: {+ /** Format: int64 */created_at: numberentrypoint_path?: stringid: string@@ -1683,6 +1773,7 @@ export interface components {slug: string/** @enum {string} */status: 'ACTIVE' | 'REMOVED' | 'THROTTLED'+ /** Format: int64 */updated_at: numberverify_jwt?: booleanversion: number@@ -1690,6 +1781,7 @@ export interface components {}CreateApiKeyBody: {description?: string | null+ name: stringsecret_jwt_template?: {role: string} | null@@ -1740,6 +1832,14 @@ export interface components {CreateOrganizationV1: {name: string}+ CreateProjectClaimTokenResponse: {+ created_at: string+ /** Format: uuid */+ created_by: string+ expires_at: string+ token: string+ token_alias: string+ }CreateProviderBody: {attribute_mapping?: {keys: {@@ -1866,6 +1966,7 @@ export interface components {updated_at?: string}DeployFunctionResponse: {+ /** Format: int64 */created_at?: numberentrypoint_path?: stringid: string@@ -1875,6 +1976,7 @@ export interface components {slug: string/** @enum {string} */status: 'ACTIVE' | 'REMOVED' | 'THROTTLED'+ /** Format: int64 */updated_at?: numberverify_jwt?: booleanversion: number@@ -1890,6 +1992,7 @@ export interface components {}}FunctionResponse: {+ /** Format: int64 */created_at: numberentrypoint_path?: stringid: string@@ -1899,11 +2002,13 @@ export interface components {slug: string/** @enum {string} */status: 'ACTIVE' | 'REMOVED' | 'THROTTLED'+ /** Format: int64 */updated_at: numberverify_jwt?: booleanversion: number}FunctionSlugResponse: {+ /** Format: int64 */created_at: numberentrypoint_path?: stringid: string@@ -1913,6 +2018,7 @@ export interface components {slug: string/** @enum {string} */status: 'ACTIVE' | 'REMOVED' | 'THROTTLED'+ /** Format: int64 */updated_at: numberverify_jwt?: booleanversion: number@@ -2153,6 +2259,41 @@ export interface components {/** @enum {string} */token_type: 'Bearer'}+ OrganizationProjectClaimResponse: {+ created_at: string+ /** Format: uuid */+ created_by: string+ expires_at: string+ preview: {+ errors: {+ key: string+ message: string+ }[]+ info: {+ key: string+ message: string+ }[]+ members_exceeding_free_project_limit: {+ limit: number+ name: string+ }[]+ /** @enum {string} */+ source_subscription_plan: 'free' | 'pro' | 'team' | 'enterprise'+ target_organization_eligible: boolean | null+ target_organization_has_free_project_slots: boolean | null+ /** @enum {string|null} */+ target_subscription_plan: 'free' | 'pro' | 'team' | 'enterprise' | null+ valid: boolean+ warnings: {+ key: string+ message: string+ }[]+ }+ project: {+ name: string+ ref: string+ }+ }OrganizationResponseV1: {id: stringname: string@@ -2194,6 +2335,13 @@ export interface components {jwt_secret?: stringmax_rows: number}+ ProjectClaimTokenResponse: {+ created_at: string+ /** Format: uuid */+ created_by: string+ expires_at: string+ token_alias: string+ }ProjectUpgradeEligibilityResponse: {current_app_version: string/** @enum {string} */@@ -2366,6 +2514,7 @@ export interface components {enabled: boolean}}+ /** Format: int64 */fileSizeLimit: number}StreamableFile: Record<string, never>@@ -2406,6 +2555,7 @@ export interface components {}UpdateApiKeyBody: {description?: string | null+ name?: stringsecret_jwt_template?: {role: string} | null@@ -2735,6 +2885,7 @@ export interface components {enabled: boolean}}+ /** Format: int64 */fileSizeLimit?: number}UpdateSupavisorConfigBody: {@@ -2754,23 +2905,6 @@ export interface components {release_channel?: 'internal' | 'alpha' | 'beta' | 'ga' | 'withdrawn' | 'preview'target_version: string}- V1AnalyticsResponse: {- error?:- | string- | {- code: number- errors: {- domain: string- location: string- locationType: string- message: string- reason: string- }[]- message: string- status: string- }- result?: unknown[]- }V1BackupsResponse: {backups: {inserted_at: string@@ -3467,6 +3601,62 @@ export interface operations {}}}+ 'v1-get-organization-project-claim': {+ parameters: {+ query?: never+ header?: never+ path: {+ /** @description Organization slug */+ slug: string+ token: string+ }+ cookie?: never+ }+ requestBody?: never+ responses: {+ 200: {+ headers: {+ [name: string]: unknown+ }+ content: {+ 'application/json': components['schemas']['OrganizationProjectClaimResponse']+ }+ }+ 403: {+ headers: {+ [name: string]: unknown+ }+ content?: never+ }+ }+ }+ 'v1-claim-project-for-organization': {+ parameters: {+ query?: never+ header?: never+ path: {+ /** @description Organization slug */+ slug: string+ token: string+ }+ cookie?: never+ }+ requestBody?: never+ responses: {+ 204: {+ headers: {+ [name: string]: unknown+ }+ content?: never+ }+ 403: {+ headers: {+ [name: string]: unknown+ }+ content?: never+ }+ }+ }'v1-list-all-projects': {parameters: {query?: never@@ -3649,7 +3839,37 @@ export interface operations {[name: string]: unknown}content: {- 'application/json': components['schemas']['V1AnalyticsResponse']+ 'application/json': components['schemas']['AnalyticsResponse']+ }+ }+ 403: {+ headers: {+ [name: string]: unknown+ }+ content?: never+ }+ }+ }+ getApiCounts: {+ parameters: {+ query?: {+ interval?: '15min' | '30min' | '1hr' | '3hr' | '1day' | '3day' | '7day'+ }+ header?: never+ path: {+ /** @description Project ref */+ ref: string+ }+ cookie?: never+ }+ requestBody?: never+ responses: {+ 200: {+ headers: {+ [name: string]: unknown+ }+ content: {+ 'application/json': components['schemas']['AnalyticsResponse']}}403: {@@ -3658,6 +3878,42 @@ export interface operations {}content?: never}+ /** @description Failed to get project's usage api counts */+ 500: {+ headers: {+ [name: string]: unknown+ }+ content?: never+ }+ }+ }+ getApiRequestsCount: {+ parameters: {+ query?: never+ header?: never+ path: {+ /** @description Project ref */+ ref: string+ }+ cookie?: never+ }+ requestBody?: never+ responses: {+ 200: {+ headers: {+ [name: string]: unknown+ }+ content: {+ 'application/json': components['schemas']['AnalyticsResponse']+ }+ }+ /** @description Failed to get project's usage api requests count */+ 500: {+ headers: {+ [name: string]: unknown+ }+ content?: never+ }}}'v1-get-project-api-keys': {@@ -4039,6 +4295,88 @@ export interface operations {}}}+ 'v1-get-project-claim-token': {+ parameters: {+ query?: never+ header?: never+ path: {+ /** @description Project ref */+ ref: string+ }+ cookie?: never+ }+ requestBody?: never+ responses: {+ 200: {+ headers: {+ [name: string]: unknown+ }+ content: {+ 'application/json': components['schemas']['ProjectClaimTokenResponse']+ }+ }+ 403: {+ headers: {+ [name: string]: unknown+ }+ content?: never+ }+ }+ }+ 'v1-create-project-claim-token': {+ parameters: {+ query?: never+ header?: never+ path: {+ /** @description Project ref */+ ref: string+ }+ cookie?: never+ }+ requestBody?: never+ responses: {+ 200: {+ headers: {+ [name: string]: unknown+ }+ content: {+ 'application/json': components['schemas']['CreateProjectClaimTokenResponse']+ }+ }+ 403: {+ headers: {+ [name: string]: unknown+ }+ content?: never+ }+ }+ }+ 'v1-delete-project-claim-token': {+ parameters: {+ query?: never+ header?: never+ path: {+ /** @description Project ref */+ ref: string+ }+ cookie?: never+ }+ requestBody?: never+ responses: {+ 204: {+ headers: {+ [name: string]: unknown+ }+ content?: never+ }+ 403: {+ headers: {+ [name: string]: unknown+ }+ content?: never+ }+ }+ }'v1-get-auth-service-config': {parameters: {query?: never@@ -4603,7 +4941,7 @@ export interface operations {}}}- getSupavisorConfig: {+ 'v1-get-pooler-config': {parameters: {query?: neverheader?: never@@ -4632,7 +4970,7 @@ export interface operations {}}}- updateSupavisorConfig: {+ 'v1-update-pooler-config': {parameters: {query?: neverheader?: never@@ -5087,7 +5425,7 @@ export interface operations {}}}- 'v1-list-migrations': {+ 'v1-list-migration-history': {parameters: {query?: neverheader?: neverdiff --git a/packages/api-types/types/platform.d.ts b/packages/api-types/types/platform.d.tsindex 0c7d9ee9529..7862192de73 100644--- a/packages/api-types/types/platform.d.ts+++ b/packages/api-types/types/platform.d.ts@@ -5655,6 +5655,7 @@ export interface components {MAILER_TEMPLATES_MAGIC_LINK_CONTENT: stringMAILER_TEMPLATES_REAUTHENTICATION_CONTENT: stringMAILER_TEMPLATES_RECOVERY_CONTENT: string+ MFA_ALLOW_LOW_AAL: booleanMFA_MAX_ENROLLED_FACTORS: numberMFA_PHONE_ENROLL_ENABLED: booleanMFA_PHONE_MAX_FREQUENCY: number@@ -6221,6 +6222,7 @@ export interface components {| 'MONTHLY_ACTIVE_USERS'| 'MONTHLY_ACTIVE_SSO_USERS'| 'FUNCTION_INVOCATIONS'+ | 'FUNCTION_CPU_MILLISECONDS'| 'STORAGE_IMAGES_TRANSFORMED'| 'REALTIME_MESSAGE_COUNT'| 'REALTIME_PEAK_CONNECTIONS'@@ -7318,6 +7320,7 @@ export interface components {enabled: boolean}}+ /** Format: int64 */fileSizeLimit: number}StorageObject: {@@ -7554,6 +7557,7 @@ export interface components {| 'MONTHLY_ACTIVE_USERS'| 'MONTHLY_ACTIVE_SSO_USERS'| 'FUNCTION_INVOCATIONS'+ | 'FUNCTION_CPU_MILLISECONDS'| 'STORAGE_IMAGES_TRANSFORMED'| 'REALTIME_MESSAGE_COUNT'| 'REALTIME_PEAK_CONNECTIONS'@@ -7848,6 +7852,7 @@ export interface components {MAILER_TEMPLATES_MAGIC_LINK_CONTENT?: string | nullMAILER_TEMPLATES_REAUTHENTICATION_CONTENT?: string | nullMAILER_TEMPLATES_RECOVERY_CONTENT?: string | null+ MFA_ALLOW_LOW_AAL?: boolean | nullMFA_MAX_ENROLLED_FACTORS?: number | nullMFA_PHONE_ENROLL_ENABLED?: boolean | nullMFA_PHONE_MAX_FREQUENCY?: number | null@@ -8172,6 +8177,7 @@ export interface components {enabled: boolean}}+ /** Format: int64 */fileSizeLimit?: number}UpdateSubscriptionBody: {@@ -10766,6 +10772,7 @@ export interface operations {| 'MONTHLY_ACTIVE_USERS'| 'MONTHLY_ACTIVE_SSO_USERS'| 'FUNCTION_INVOCATIONS'+ | 'FUNCTION_CPU_MILLISECONDS'| 'STORAGE_IMAGES_TRANSFORMED'| 'REALTIME_MESSAGE_COUNT'| 'REALTIME_PEAK_CONNECTIONS'@@ -14319,7 +14326,7 @@ export interface operations {UsageApiController_getApiCounts: {parameters: {query?: {- interval?: '15min' | '30min' | '1hr' | '3hr' | '1day'+ interval?: '15min' | '30min' | '1hr' | '3hr' | '1day' | '3day' | '7day'}header?: neverpath: {@@ -16190,6 +16197,8 @@ export interface operations {| 'total_storage_post_requests'| 'total_storage_delete_requests'| 'total_logdrain_egress'+ | 'total_func_invocations'+ | 'total_func_cpu_time_ms'endDate: stringinterval?: stringstartDate: string@@ -16520,6 +16529,13 @@ export interface operations {| 'physical_replication_lag_physical_replica_lag_seconds'| 'pg_stat_database_num_backends'| 'supavisor_connections_active'+ | 'client_connections_postgres'+ | 'client_connections_authenticator'+ | 'client_connections_supabase_auth_admin'+ | 'client_connections_supabase_storage_admin'+ | 'client_connections_supabase_admin'+ | 'client_connections_other'+ | 'max_db_connections'| 'network_receive_bytes'| 'network_transmit_bytes'| 'pgbouncer_pools_client_active_connections'