mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
chore: Update API types (#35879)
* Regenerate all types from develop branch. * Fix all types in studio. * Remove extra type.
This commit is contained in:
1 parent
b492341ed1
commit
4add928dae
37 files changed
+526
-498
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { PlanType } from 'data/subscriptions/org-subscription-query'
|
||||
import { PlanId } from 'data/subscriptions/types'
|
||||
|
||||
// Disk Storage expands automatically when the database reaches 90% of the disk size
|
||||
export const AUTOSCALING_THRESHOLD = 0.9
|
||||
@@ -52,7 +52,7 @@ interface PlanDetails {
|
||||
includedDiskGB: { gp3: number; io2: number }
|
||||
}
|
||||
|
||||
export const PLAN_DETAILS: Record<PlanType, PlanDetails> = {
|
||||
export const PLAN_DETAILS: Record<PlanId, PlanDetails> = {
|
||||
free: { includedDiskGB: { gp3: 1, io2: 0 } },
|
||||
pro: { includedDiskGB: { gp3: 8, io2: 0 } },
|
||||
team: { includedDiskGB: { gp3: 8, io2: 0 } },
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { useEffect } from 'react'
|
||||
import { ControllerRenderProps, UseFormReturn } from 'react-hook-form'
|
||||
|
||||
import { components } from 'api-types'
|
||||
import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext'
|
||||
import { useProjectCreationPostgresVersionsQuery } from 'data/config/project-creation-postgres-versions-query'
|
||||
import { useProjectUnpausePostgresVersionsQuery } from 'data/config/project-unpause-postgres-versions-query'
|
||||
import { PostgresEngine, ReleaseChannel } from 'data/projects/new-project.constants'
|
||||
import type { CloudProvider } from 'shared-data'
|
||||
import {
|
||||
Badge,
|
||||
@@ -17,9 +17,6 @@ import {
|
||||
} from 'ui'
|
||||
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
|
||||
|
||||
type ReleaseChannel = components['schemas']['ReleaseChannel']
|
||||
type PostgresEngine = components['schemas']['PostgresEngine']
|
||||
|
||||
interface PostgresVersionDetails {
|
||||
postgresEngine: PostgresEngine | undefined
|
||||
releaseChannel: ReleaseChannel | undefined
|
||||
|
||||
+2
-1
@@ -16,7 +16,8 @@ import {
|
||||
ProjectUpgradeTargetVersion,
|
||||
useProjectUpgradeEligibilityQuery,
|
||||
} from 'data/config/project-upgrade-eligibility-query'
|
||||
import { ReleaseChannel, useProjectUpgradeMutation } from 'data/projects/project-upgrade-mutation'
|
||||
import { ReleaseChannel } from 'data/projects/new-project.constants'
|
||||
import { useProjectUpgradeMutation } from 'data/projects/project-upgrade-mutation'
|
||||
import { setProjectStatus } from 'data/projects/projects-query'
|
||||
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
|
||||
import { useFlag } from 'hooks/ui/useFlag'
|
||||
|
||||
@@ -41,8 +41,8 @@ export function getHasInstalledObject({
|
||||
integration.organization.slug === org.slug &&
|
||||
integration.integration.name === 'GitHub' &&
|
||||
integration.metadata !== undefined &&
|
||||
'installation_id' in integration.metadata &&
|
||||
String(integration.metadata.installation_id) === String(installationId)
|
||||
'installation_id' in (integration.metadata as any) &&
|
||||
String((integration.metadata as any).installation_id) === String(installationId)
|
||||
)
|
||||
),
|
||||
])
|
||||
|
||||
@@ -13,8 +13,8 @@ import { useParams } from 'common'
|
||||
import { PostgresVersionSelector } from 'components/interfaces/ProjectCreation/PostgresVersionSelector'
|
||||
import AlertError from 'components/ui/AlertError'
|
||||
import { ButtonTooltip } from 'components/ui/ButtonTooltip'
|
||||
import { PostgresEngine, ReleaseChannel } from 'data/config/project-unpause-postgres-versions-query'
|
||||
import { useFreeProjectLimitCheckQuery } from 'data/organizations/free-project-limit-check-query'
|
||||
import { PostgresEngine, ReleaseChannel } from 'data/projects/new-project.constants'
|
||||
import { useProjectPauseStatusQuery } from 'data/projects/project-pause-status-query'
|
||||
import { useProjectRestoreMutation } from 'data/projects/project-restore-mutation'
|
||||
import { setProjectStatus } from 'data/projects/projects-query'
|
||||
@@ -42,7 +42,7 @@ export interface ProjectPausedStateProps {
|
||||
}
|
||||
|
||||
interface PostgresVersionDetails {
|
||||
postgresEngine: PostgresEngine
|
||||
postgresEngine: Exclude<PostgresEngine, '13' | '14'>
|
||||
releaseChannel: ReleaseChannel
|
||||
}
|
||||
|
||||
|
||||
@@ -215,7 +215,7 @@ export const SQLEditorNav = ({ sort = 'inserted_at' }: SQLEditorNavProps) => {
|
||||
() =>
|
||||
favoriteSnippets.length === 0
|
||||
? [ROOT_NODE]
|
||||
: formatFolderResponseForTreeView({ contents: favoriteSnippets }),
|
||||
: formatFolderResponseForTreeView({ contents: favoriteSnippets, folders: [] }),
|
||||
[favoriteSnippets]
|
||||
)
|
||||
|
||||
@@ -264,7 +264,7 @@ export const SQLEditorNav = ({ sort = 'inserted_at' }: SQLEditorNavProps) => {
|
||||
() =>
|
||||
sharedSnippets.length === 0
|
||||
? [ROOT_NODE]
|
||||
: formatFolderResponseForTreeView({ contents: sharedSnippets }),
|
||||
: formatFolderResponseForTreeView({ contents: sharedSnippets, folders: [] }),
|
||||
[sharedSnippets]
|
||||
)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { ResponseError } from 'types'
|
||||
|
||||
export type ValidateSpamVariables = {
|
||||
projectRef: string
|
||||
template: components['schemas']['ValidateSpamBodyDto']
|
||||
template: components['schemas']['ValidateSpamBody']
|
||||
}
|
||||
export type ValidateSpamResponse = components['schemas']['ValidateSpamResponse']
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useQuery, UseQueryOptions } from '@tanstack/react-query'
|
||||
|
||||
import { components } from 'api-types'
|
||||
import { handleError, post } from 'data/fetchers'
|
||||
import { CloudProvider } from 'shared-data'
|
||||
import type { ResponseError } from 'types'
|
||||
@@ -12,12 +11,6 @@ export type ProjectCreationPostgresVersionsVariables = {
|
||||
organizationSlug: string | undefined
|
||||
}
|
||||
|
||||
export type ProjectCreationPostgresVersion = components['schemas']['ProjectCreationVersionInfo']
|
||||
|
||||
export type ProjectCreationPostgresVersionsResponse = {
|
||||
available_versions: ProjectCreationPostgresVersion[]
|
||||
}
|
||||
|
||||
export async function getPostgresCreationVersions(
|
||||
{ cloudProvider, dbRegion, organizationSlug }: ProjectCreationPostgresVersionsVariables,
|
||||
signal?: AbortSignal
|
||||
|
||||
@@ -10,7 +10,9 @@ import { configKeys } from './keys'
|
||||
export type ProjectSettingsVariables = { projectRef?: string }
|
||||
|
||||
// Manually add the protocol property to the response - specifically just for the local/CLI environment
|
||||
type ProjectAppConfig = components['schemas']['ProjectAppConfigResponse'] & { protocol?: string }
|
||||
type ProjectAppConfig = components['schemas']['ProjectSettingsResponse']['app_config'] & {
|
||||
protocol?: string
|
||||
}
|
||||
export type ProjectSettings = components['schemas']['ProjectSettingsResponse'] & {
|
||||
app_config?: ProjectAppConfig
|
||||
}
|
||||
|
||||
@@ -1,22 +1,13 @@
|
||||
import { useQuery, UseQueryOptions } from '@tanstack/react-query'
|
||||
|
||||
import { get, handleError } from 'data/fetchers'
|
||||
import { configKeys } from './keys'
|
||||
import { components } from 'api-types'
|
||||
import { ResponseError } from 'types'
|
||||
import { configKeys } from './keys'
|
||||
|
||||
export type ProjectUnpausePostgresVersionsVariables = {
|
||||
projectRef?: string
|
||||
}
|
||||
|
||||
export type ProjectUnpausePostgresVersion = components['schemas']['ProjectUnpauseVersionInfo']
|
||||
export type ReleaseChannel = components['schemas']['ReleaseChannel']
|
||||
export type PostgresEngine = components['schemas']['PostgresEngine']
|
||||
|
||||
export type ProjectUnpausePostgresVersionsResponse = {
|
||||
available_versions: ProjectUnpausePostgresVersion[]
|
||||
}
|
||||
|
||||
export async function getPostgresUnpauseVersions(
|
||||
{ projectRef }: ProjectUnpausePostgresVersionsVariables,
|
||||
signal?: AbortSignal
|
||||
@@ -29,7 +20,7 @@ export async function getPostgresUnpauseVersions(
|
||||
})
|
||||
|
||||
if (error) handleError(error)
|
||||
return data as ProjectUnpausePostgresVersionsResponse
|
||||
return data
|
||||
}
|
||||
|
||||
export type ProjectUnpausePostgresVersionData = Awaited<
|
||||
|
||||
@@ -7,10 +7,7 @@ import type { ResponseError } from 'types'
|
||||
import type { Content } from './content-query'
|
||||
import { contentKeys } from './keys'
|
||||
|
||||
export type InsertContentPayload = Omit<
|
||||
components['schemas']['CreateContentBodyDto'],
|
||||
'content'
|
||||
> & {
|
||||
export type InsertContentPayload = Omit<components['schemas']['CreateContentBody'], 'content'> & {
|
||||
content: Content['content']
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { get, handleError } from 'data/fetchers'
|
||||
import type { Dashboards, LogSqlSnippets, SqlSnippets } from 'types'
|
||||
import { contentKeys } from './keys'
|
||||
|
||||
export type ContentBase = components['schemas']['GetUserContentObject']
|
||||
export type ContentBase = components['schemas']['GetUserContentResponse']['data'][number]
|
||||
|
||||
export type Content = Omit<ContentBase, 'content' | 'type'> &
|
||||
(
|
||||
|
||||
@@ -7,10 +7,7 @@ import type { ResponseError } from 'types'
|
||||
import type { Content } from './content-query'
|
||||
import { contentKeys } from './keys'
|
||||
|
||||
export type UpsertContentPayload = Omit<
|
||||
components['schemas']['UpsertContentBodyDto'],
|
||||
'content'
|
||||
> & {
|
||||
export type UpsertContentPayload = Omit<components['schemas']['UpsertContentBody'], 'content'> & {
|
||||
content: Partial<Content['content']>
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,10 @@ import { ResponseError } from 'types'
|
||||
import { contentKeys } from './keys'
|
||||
|
||||
export type SnippetFolderResponse = components['schemas']['GetUserContentFolderResponse']['data']
|
||||
export type SnippetFolder = components['schemas']['UserContentFolder']
|
||||
export type Snippet = components['schemas']['UserContentObjectMeta']
|
||||
export type SnippetFolder =
|
||||
components['schemas']['GetUserContentFolderResponse']['data']['folders'][number]
|
||||
export type Snippet =
|
||||
components['schemas']['GetUserContentFolderResponse']['data']['contents'][number]
|
||||
|
||||
export type SQLSnippetFolderVariables = {
|
||||
projectRef?: string
|
||||
|
||||
@@ -19,7 +19,7 @@ export async function getGitHubBranches(
|
||||
})
|
||||
|
||||
if (error) handleError(error)
|
||||
return data
|
||||
return data as Record<string, never>[]
|
||||
}
|
||||
|
||||
export type GitHubBranchesData = Awaited<ReturnType<typeof getGitHubBranches>>
|
||||
|
||||
@@ -6,8 +6,7 @@ import { handleError, post } from 'data/fetchers'
|
||||
import type { ResponseError } from 'types'
|
||||
import { lintKeys } from './keys'
|
||||
|
||||
type ExceptionPayload =
|
||||
components['schemas']['CreateNotificationExceptionsBodyDto']['exceptions'][0]
|
||||
type ExceptionPayload = components['schemas']['CreateNotificationExceptionsBody']['exceptions'][0]
|
||||
|
||||
export type LintRuleCreateVariables = {
|
||||
projectRef: string
|
||||
|
||||
@@ -10,7 +10,7 @@ import { lintKeys } from './keys'
|
||||
type ProjectLintsVariables = {
|
||||
projectRef?: string
|
||||
}
|
||||
type ProjectLintResponse = components['schemas']['GetProjectLintsResponseDto']
|
||||
type ProjectLintResponse = components['schemas']['GetProjectLintsResponse']
|
||||
export type Lint = ProjectLintResponse[0]
|
||||
export type LINT_TYPES = ProjectLintResponse[0]['name']
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import { lintKeys } from './keys'
|
||||
type ProjectLintRulesVariables = {
|
||||
projectRef?: string
|
||||
}
|
||||
type LintDismissalResponse = components['schemas']['ListNotificationExceptionsResponseDto']
|
||||
type LintDismissalResponse = components['schemas']['ListNotificationExceptionsResponse']
|
||||
export type LintException = LintDismissalResponse['exceptions'][0]
|
||||
|
||||
export async function getProjectLintRules(
|
||||
|
||||
@@ -7,11 +7,11 @@ import { clientSecretKeys } from './keys'
|
||||
import { components } from 'api-types'
|
||||
|
||||
export type Secret =
|
||||
components['schemas']['ListOAuthAppClientSecretsResponseDto']['client_secrets'][0] & {
|
||||
client_secret?: components['schemas']['CreateOAuthAppClientSecretResponseDto']['client_secret']
|
||||
components['schemas']['ListOAuthAppClientSecretsResponse']['client_secrets'][0] & {
|
||||
client_secret?: components['schemas']['CreateOAuthAppClientSecretResponse']['client_secret']
|
||||
}
|
||||
|
||||
export type CreatedSecret = components['schemas']['CreateOAuthAppClientSecretResponseDto']
|
||||
export type CreatedSecret = components['schemas']['CreateOAuthAppClientSecretResponse']
|
||||
|
||||
export interface SecretRowProps {
|
||||
secret: Secret
|
||||
|
||||
@@ -24,8 +24,9 @@ export async function getOpenAPISpec({ projectRef }: OpenAPISpecVariables, signa
|
||||
|
||||
if (error) handleError(error)
|
||||
|
||||
const tables = data.definitions
|
||||
? Object.entries(data.definitions).map(([key, table]: any) => ({
|
||||
const definitions = (data as any).definitions
|
||||
const tables = definitions
|
||||
? Object.entries(definitions).map(([key, table]: any) => ({
|
||||
...table,
|
||||
name: key,
|
||||
fields: Object.entries(table.properties || {}).map(([key, field]: any) => ({
|
||||
@@ -35,8 +36,9 @@ export async function getOpenAPISpec({ projectRef }: OpenAPISpecVariables, signa
|
||||
}))
|
||||
: []
|
||||
|
||||
const functions = data.paths
|
||||
? Object.entries(data.paths)
|
||||
const paths = (data as any).paths
|
||||
const functions = paths
|
||||
? Object.entries(paths)
|
||||
.map(([path, value]: any) => ({
|
||||
...value,
|
||||
path,
|
||||
|
||||
@@ -25,7 +25,7 @@ export async function updateOrganization({
|
||||
const payload: components['schemas']['UpdateOrganizationBody'] = {}
|
||||
if (name) payload.name = name
|
||||
if (billing_email) payload.billing_email = billing_email
|
||||
if (opt_in_tags) payload.opt_in_tags = opt_in_tags
|
||||
if (opt_in_tags) payload.opt_in_tags = opt_in_tags as any
|
||||
if (additional_billing_emails) payload.additional_billing_emails = additional_billing_emails
|
||||
|
||||
const { data, error } = await patch('/platform/organizations/{slug}', {
|
||||
|
||||
@@ -3,14 +3,11 @@ import { toast } from 'sonner'
|
||||
|
||||
import { handleError, post } from 'data/fetchers'
|
||||
import type { ResponseError } from 'types'
|
||||
import { components } from 'api-types'
|
||||
|
||||
export type ReleaseChannel = components['schemas']['ReleaseChannel']
|
||||
export type PostgresEngine = components['schemas']['PostgresEngine']
|
||||
import { PostgresEngine, ReleaseChannel } from './new-project.constants'
|
||||
|
||||
export type ProjectRestoreVariables = {
|
||||
ref: string
|
||||
postgresEngine?: PostgresEngine
|
||||
postgresEngine?: Exclude<PostgresEngine, '13' | '14'>
|
||||
releaseChannel?: ReleaseChannel
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ export type ProjectTransferPreviewVariables = {
|
||||
targetOrganizationSlug?: string
|
||||
}
|
||||
|
||||
export type PlanId = 'free' | 'pro' | 'team' | 'enterprise'
|
||||
|
||||
export async function previewProjectTransfer(
|
||||
{ projectRef, targetOrganizationSlug }: ProjectTransferPreviewVariables,
|
||||
signal?: AbortSignal
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
import { useMutation, UseMutationOptions } from '@tanstack/react-query'
|
||||
import { toast } from 'sonner'
|
||||
|
||||
import { components } from 'api-types'
|
||||
import { handleError, post } from 'data/fetchers'
|
||||
import type { ResponseError } from 'types'
|
||||
import { components } from 'api-types'
|
||||
|
||||
export type ReleaseChannel = components['schemas']['ReleaseChannel']
|
||||
|
||||
export type ProjectUpgradeVariables = {
|
||||
export type ProjectUpgradeVariables = components['schemas']['UpgradeDatabaseBody'] & {
|
||||
ref: string
|
||||
target_version: string
|
||||
release_channel: ReleaseChannel
|
||||
}
|
||||
|
||||
export async function upgradeProject({
|
||||
|
||||
@@ -8,7 +8,7 @@ import { realtimeKeys } from './keys'
|
||||
|
||||
export type RealtimeConfigurationUpdateVariables = {
|
||||
ref: string
|
||||
} & components['schemas']['UpdateRealtimeConfigBodyDto']
|
||||
} & components['schemas']['UpdateRealtimeConfigBody']
|
||||
|
||||
export async function updateRealtimeConfiguration({
|
||||
ref,
|
||||
|
||||
@@ -36,8 +36,6 @@ export async function createBucket({
|
||||
})
|
||||
|
||||
if (error) handleError(error)
|
||||
// @ts-expect-error API type is wrong here
|
||||
// https://github.com/supabase/infrastructure/blob/develop/api/src/routes/platform/storage/ref/buckets/buckets.controller.ts#L55
|
||||
return data as { name: string }
|
||||
}
|
||||
|
||||
|
||||
@@ -5,14 +5,11 @@ import { get, handleError } from 'data/fetchers'
|
||||
import { useCheckPermissions } from 'hooks/misc/useCheckPermissions'
|
||||
import type { ResponseError } from 'types'
|
||||
import { subscriptionKeys } from './keys'
|
||||
import { components } from 'api-types'
|
||||
|
||||
export type OrgSubscriptionVariables = {
|
||||
orgSlug?: string
|
||||
}
|
||||
|
||||
export type PlanType = components['schemas']['BillingPlanId']
|
||||
|
||||
export async function getOrgSubscription(
|
||||
{ orgSlug }: OrgSubscriptionVariables,
|
||||
signal?: AbortSignal
|
||||
|
||||
@@ -13,7 +13,7 @@ export type OrgSubscription = components['schemas']['GetSubscriptionResponse']
|
||||
|
||||
export type ProjectAddon = components['schemas']['GetSubscriptionResponse']['project_addons'][0]
|
||||
|
||||
export type PlanId = components['schemas']['BillingPlanId']
|
||||
export type PlanId = components['schemas']['PlansResponse']['plans'][number]['id']
|
||||
|
||||
export type OrgPlan = components['schemas']['PlansResponse']['plans'][0]
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { components } from 'api-types'
|
||||
import { hasConsented } from 'common'
|
||||
import { handleError, post } from 'data/fetchers'
|
||||
import { IS_PLATFORM } from './constants'
|
||||
import { LOCAL_STORAGE_KEYS, hasConsented } from 'common'
|
||||
|
||||
type TrackFeatureFlagVariables = components['schemas']['TelemetryFeatureFlagBodyDto']
|
||||
type TrackFeatureFlagVariables = components['schemas']['TelemetryFeatureFlagBody']
|
||||
|
||||
export async function trackFeatureFlag(body: TrackFeatureFlagVariables) {
|
||||
const consent = hasConsented()
|
||||
|
||||
@@ -22,7 +22,7 @@ type GetResponseData =
|
||||
paths['/platform/projects/{ref}/content/folders/{id}']['get']['responses']['200']['content']['application/json']
|
||||
|
||||
const handleGetAll = async (req: NextApiRequest, res: NextApiResponse<GetResponseData>) => {
|
||||
return res.status(200).json({ data: { folders: [] } })
|
||||
return res.status(200).json({ data: { folders: [], contents: [] } })
|
||||
}
|
||||
|
||||
type PatchResponseData =
|
||||
|
||||
@@ -53,8 +53,14 @@ const handleGetAll = async (req: NextApiRequest, res: NextApiResponse<GetRespons
|
||||
inserted_at: '',
|
||||
project_id: 0,
|
||||
updated_at: '',
|
||||
owner: {},
|
||||
updated_by: {},
|
||||
owner: {
|
||||
id: 1,
|
||||
username: 'default',
|
||||
},
|
||||
updated_by: {
|
||||
id: 1,
|
||||
username: 'default',
|
||||
},
|
||||
},
|
||||
]
|
||||
return res.status(200).json({ data: snippets })
|
||||
|
||||
@@ -4,7 +4,9 @@ import { components } from 'api-types'
|
||||
import apiWrapper from 'lib/api/apiWrapper'
|
||||
import { PROJECT_ENDPOINT, PROJECT_ENDPOINT_PROTOCOL } from 'pages/api/constants'
|
||||
|
||||
type ProjectAppConfig = components['schemas']['ProjectAppConfigResponse'] & { protocol?: string }
|
||||
type ProjectAppConfig = components['schemas']['ProjectSettingsResponse']['app_config'] & {
|
||||
protocol?: string
|
||||
}
|
||||
export type ProjectSettings = components['schemas']['ProjectSettingsResponse'] & {
|
||||
app_config?: ProjectAppConfig
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { PermissionAction } from '@supabase/shared-types/out/constants'
|
||||
import { PlanId } from 'data/subscriptions/types'
|
||||
import jsonLogic from 'json-logic-js'
|
||||
|
||||
export interface Organization {
|
||||
@@ -14,7 +15,7 @@ export interface Organization {
|
||||
managed_by: 'supabase' | 'vercel-marketplace' | 'aws-marketplace'
|
||||
partner_id?: string
|
||||
plan: {
|
||||
id: 'free' | 'pro' | 'team' | 'enterprise'
|
||||
id: PlanId
|
||||
name: string
|
||||
}
|
||||
usage_billing_enabled: boolean
|
||||
|
||||
Vendored
+93
-100
@@ -1384,7 +1384,7 @@ export interface components {
|
||||
/** Format: date-time */
|
||||
updated_at?: string | null
|
||||
}
|
||||
ApplyProjectAddonBodyDto: {
|
||||
ApplyProjectAddonBody: {
|
||||
/** @enum {string} */
|
||||
addon_type:
|
||||
| 'custom_domain'
|
||||
@@ -1593,8 +1593,6 @@ export interface components {
|
||||
smtp_user: string | null
|
||||
uri_allow_list: string | null
|
||||
}
|
||||
/** @enum {string} */
|
||||
BillingPlanId: 'free' | 'pro' | 'team' | 'enterprise'
|
||||
BranchActionBody: {
|
||||
migration_version?: string
|
||||
}
|
||||
@@ -1739,7 +1737,7 @@ export interface components {
|
||||
[key: string]: string
|
||||
}
|
||||
}
|
||||
CreateOrganizationV1Dto: {
|
||||
CreateOrganizationV1: {
|
||||
name: string
|
||||
}
|
||||
CreateProviderBody: {
|
||||
@@ -1920,9 +1918,15 @@ export interface components {
|
||||
version: number
|
||||
}
|
||||
GetProjectAvailableRestoreVersionsResponse: {
|
||||
available_versions: components['schemas']['ProjectAvailableRestoreVersion'][]
|
||||
available_versions: {
|
||||
/** @enum {string} */
|
||||
postgres_engine: '13' | '14' | '15' | '17' | '17-oriole'
|
||||
/** @enum {string} */
|
||||
release_channel: 'internal' | 'alpha' | 'beta' | 'ga' | 'withdrawn' | 'preview'
|
||||
version: string
|
||||
}[]
|
||||
}
|
||||
GetProjectDbMetadataResponseDto: {
|
||||
GetProjectDbMetadataResponse: {
|
||||
databases: ({
|
||||
name: string
|
||||
schemas: ({
|
||||
@@ -1961,7 +1965,7 @@ export interface components {
|
||||
}
|
||||
updated_at?: string
|
||||
}
|
||||
ListProjectAddonsResponseDto: {
|
||||
ListProjectAddonsResponse: {
|
||||
available_addons: {
|
||||
name: string
|
||||
/** @enum {string} */
|
||||
@@ -2125,7 +2129,7 @@ export interface components {
|
||||
/** @enum {string} */
|
||||
status: 'stored' | 'applied'
|
||||
}
|
||||
OAuthRevokeTokenBodyDto: {
|
||||
OAuthRevokeTokenBody: {
|
||||
/** Format: uuid */
|
||||
client_id: string
|
||||
client_secret: string
|
||||
@@ -2190,13 +2194,6 @@ export interface components {
|
||||
jwt_secret?: string
|
||||
max_rows: number
|
||||
}
|
||||
ProjectAvailableRestoreVersion: {
|
||||
/** @enum {string} */
|
||||
postgres_engine: '13' | '14' | '15' | '17' | '17-oriole'
|
||||
/** @enum {string} */
|
||||
release_channel: 'internal' | 'alpha' | 'beta' | 'ga' | 'withdrawn' | 'preview'
|
||||
version: string
|
||||
}
|
||||
ProjectUpgradeEligibilityResponse: {
|
||||
current_app_version: string
|
||||
/** @enum {string} */
|
||||
@@ -2229,8 +2226,6 @@ export interface components {
|
||||
override_active_until: string
|
||||
override_enabled: boolean
|
||||
}
|
||||
/** @enum {string} */
|
||||
ReleaseChannel: 'internal' | 'alpha' | 'beta' | 'ga' | 'withdrawn' | 'preview'
|
||||
RemoveNetworkBanRequest: {
|
||||
identifier?: string
|
||||
ipv4_addresses: string[]
|
||||
@@ -2297,54 +2292,60 @@ export interface components {
|
||||
updated_at: string
|
||||
}[]
|
||||
}
|
||||
SnippetContent: {
|
||||
favorite: boolean
|
||||
schema_version: string
|
||||
sql: string
|
||||
}
|
||||
SnippetList: {
|
||||
cursor?: string
|
||||
data: components['schemas']['SnippetMeta'][]
|
||||
}
|
||||
SnippetMeta: {
|
||||
description: string | null
|
||||
id: string
|
||||
inserted_at: string
|
||||
name: string
|
||||
owner: components['schemas']['SnippetUser']
|
||||
project: components['schemas']['SnippetProject']
|
||||
/** @enum {string} */
|
||||
type: 'sql'
|
||||
updated_at: string
|
||||
updated_by: components['schemas']['SnippetUser']
|
||||
/** @enum {string} */
|
||||
visibility: 'user' | 'project' | 'org' | 'public'
|
||||
}
|
||||
SnippetProject: {
|
||||
/** Format: int64 */
|
||||
id: number
|
||||
name: string
|
||||
data: {
|
||||
description: string | null
|
||||
id: string
|
||||
inserted_at: string
|
||||
name: string
|
||||
owner: {
|
||||
id: number
|
||||
username: string
|
||||
}
|
||||
project: {
|
||||
id: number
|
||||
name: string
|
||||
}
|
||||
/** @enum {string} */
|
||||
type: 'sql'
|
||||
updated_at: string
|
||||
updated_by: {
|
||||
id: number
|
||||
username: string
|
||||
}
|
||||
/** @enum {string} */
|
||||
visibility: 'user' | 'project' | 'org' | 'public'
|
||||
}[]
|
||||
}
|
||||
SnippetResponse: {
|
||||
content: components['schemas']['SnippetContent']
|
||||
content: {
|
||||
favorite: boolean
|
||||
schema_version: string
|
||||
sql: string
|
||||
}
|
||||
description: string | null
|
||||
id: string
|
||||
inserted_at: string
|
||||
name: string
|
||||
owner: components['schemas']['SnippetUser']
|
||||
project: components['schemas']['SnippetProject']
|
||||
owner: {
|
||||
id: number
|
||||
username: string
|
||||
}
|
||||
project: {
|
||||
id: number
|
||||
name: string
|
||||
}
|
||||
/** @enum {string} */
|
||||
type: 'sql'
|
||||
updated_at: string
|
||||
updated_by: components['schemas']['SnippetUser']
|
||||
updated_by: {
|
||||
id: number
|
||||
username: string
|
||||
}
|
||||
/** @enum {string} */
|
||||
visibility: 'user' | 'project' | 'org' | 'public'
|
||||
}
|
||||
SnippetUser: {
|
||||
/** Format: int64 */
|
||||
id: number
|
||||
username: string
|
||||
}
|
||||
SslEnforcementRequest: {
|
||||
requestedConfig: {
|
||||
database: boolean
|
||||
@@ -2367,6 +2368,7 @@ export interface components {
|
||||
}
|
||||
fileSizeLimit: number
|
||||
}
|
||||
StreamableFile: Record<string, never>
|
||||
SubdomainAvailabilityResponse: {
|
||||
available: boolean
|
||||
}
|
||||
@@ -2769,15 +2771,17 @@ export interface components {
|
||||
}
|
||||
result?: unknown[]
|
||||
}
|
||||
V1Backup: {
|
||||
inserted_at: string
|
||||
is_physical_backup: boolean
|
||||
/** @enum {string} */
|
||||
status: 'COMPLETED' | 'FAILED' | 'PENDING' | 'REMOVED' | 'ARCHIVED' | 'CANCELLED'
|
||||
}
|
||||
V1BackupsResponse: {
|
||||
backups: components['schemas']['V1Backup'][]
|
||||
physical_backup_data: components['schemas']['V1PhysicalBackup']
|
||||
backups: {
|
||||
inserted_at: string
|
||||
is_physical_backup: boolean
|
||||
/** @enum {string} */
|
||||
status: 'COMPLETED' | 'FAILED' | 'PENDING' | 'REMOVED' | 'ARCHIVED' | 'CANCELLED'
|
||||
}[]
|
||||
physical_backup_data: {
|
||||
earliest_physical_backup_date_unix?: number
|
||||
latest_physical_backup_date_unix?: number
|
||||
}
|
||||
pitr_enabled: boolean
|
||||
region: string
|
||||
walg_enabled: boolean
|
||||
@@ -2786,7 +2790,7 @@ export interface components {
|
||||
name?: string
|
||||
query: string
|
||||
}
|
||||
V1CreateProjectBodyDto: {
|
||||
V1CreateProjectBody: {
|
||||
/** @description Database password */
|
||||
db_pass: string
|
||||
/** @enum {string} */
|
||||
@@ -2855,16 +2859,6 @@ export interface components {
|
||||
*/
|
||||
template_url?: string
|
||||
}
|
||||
V1DatabaseResponse: {
|
||||
/** @description Database host */
|
||||
host: string
|
||||
/** @description Database engine */
|
||||
postgres_engine: string
|
||||
/** @description Release channel */
|
||||
release_channel: string
|
||||
/** @description Database version */
|
||||
version: string
|
||||
}
|
||||
V1ListMigrationsResponse: {
|
||||
name?: string
|
||||
version: string
|
||||
@@ -2877,11 +2871,12 @@ export interface components {
|
||||
user_name: string
|
||||
}
|
||||
V1OrganizationSlugResponse: {
|
||||
allowed_release_channels: components['schemas']['ReleaseChannel'][]
|
||||
allowed_release_channels: ('internal' | 'alpha' | 'beta' | 'ga' | 'withdrawn' | 'preview')[]
|
||||
id: string
|
||||
name: string
|
||||
opt_in_tags: 'AI_SQL_GENERATOR_OPT_IN'[]
|
||||
plan?: components['schemas']['BillingPlanId']
|
||||
/** @enum {string} */
|
||||
plan?: 'free' | 'pro' | 'team' | 'enterprise'
|
||||
}
|
||||
V1PgbouncerConfigResponse: {
|
||||
connection_string?: string
|
||||
@@ -2891,12 +2886,6 @@ export interface components {
|
||||
/** @enum {string} */
|
||||
pool_mode?: 'transaction' | 'session' | 'statement'
|
||||
}
|
||||
V1PhysicalBackup: {
|
||||
/** Format: int64 */
|
||||
earliest_physical_backup_date_unix?: number
|
||||
/** Format: int64 */
|
||||
latest_physical_backup_date_unix?: number
|
||||
}
|
||||
V1PostgrestConfigResponse: {
|
||||
db_extra_search_path: string
|
||||
/** @description If `null`, the value is automatically configured based on compute size. */
|
||||
@@ -2904,7 +2893,7 @@ export interface components {
|
||||
db_schema: string
|
||||
max_rows: number
|
||||
}
|
||||
V1ProjectAdvisorsResponseDto: {
|
||||
V1ProjectAdvisorsResponse: {
|
||||
lints: {
|
||||
cache_key: string
|
||||
categories: ('PERFORMANCE' | 'SECURITY')[]
|
||||
@@ -2958,7 +2947,6 @@ export interface components {
|
||||
}[]
|
||||
}
|
||||
V1ProjectRefResponse: {
|
||||
/** Format: int64 */
|
||||
id: number
|
||||
name: string
|
||||
ref: string
|
||||
@@ -3004,7 +2992,16 @@ export interface components {
|
||||
* @example 2023-03-29T16:32:59Z
|
||||
*/
|
||||
created_at: string
|
||||
database: components['schemas']['V1DatabaseResponse']
|
||||
database: {
|
||||
/** @description Database host */
|
||||
host: string
|
||||
/** @description Database engine */
|
||||
postgres_engine: string
|
||||
/** @description Release channel */
|
||||
release_channel: string
|
||||
/** @description Database version */
|
||||
version: string
|
||||
}
|
||||
/** @description Id of your project */
|
||||
id: string
|
||||
/** @description Name of your project */
|
||||
@@ -3306,7 +3303,7 @@ export interface operations {
|
||||
}
|
||||
requestBody?: never
|
||||
responses: {
|
||||
303: {
|
||||
204: {
|
||||
headers: {
|
||||
[name: string]: unknown
|
||||
}
|
||||
@@ -3323,7 +3320,7 @@ export interface operations {
|
||||
}
|
||||
requestBody: {
|
||||
content: {
|
||||
'application/json': components['schemas']['OAuthRevokeTokenBodyDto']
|
||||
'application/json': components['schemas']['OAuthRevokeTokenBody']
|
||||
}
|
||||
}
|
||||
responses: {
|
||||
@@ -3393,7 +3390,7 @@ export interface operations {
|
||||
}
|
||||
requestBody: {
|
||||
content: {
|
||||
'application/json': components['schemas']['CreateOrganizationV1Dto']
|
||||
'application/json': components['schemas']['CreateOrganizationV1']
|
||||
}
|
||||
}
|
||||
responses: {
|
||||
@@ -3498,7 +3495,7 @@ export interface operations {
|
||||
}
|
||||
requestBody: {
|
||||
content: {
|
||||
'application/json': components['schemas']['V1CreateProjectBodyDto']
|
||||
'application/json': components['schemas']['V1CreateProjectBody']
|
||||
}
|
||||
}
|
||||
responses: {
|
||||
@@ -3592,7 +3589,7 @@ export interface operations {
|
||||
[name: string]: unknown
|
||||
}
|
||||
content: {
|
||||
'application/json': components['schemas']['V1ProjectAdvisorsResponseDto']
|
||||
'application/json': components['schemas']['V1ProjectAdvisorsResponse']
|
||||
}
|
||||
}
|
||||
403: {
|
||||
@@ -3620,7 +3617,7 @@ export interface operations {
|
||||
[name: string]: unknown
|
||||
}
|
||||
content: {
|
||||
'application/json': components['schemas']['V1ProjectAdvisorsResponseDto']
|
||||
'application/json': components['schemas']['V1ProjectAdvisorsResponse']
|
||||
}
|
||||
}
|
||||
403: {
|
||||
@@ -3846,7 +3843,7 @@ export interface operations {
|
||||
[name: string]: unknown
|
||||
}
|
||||
content: {
|
||||
'application/json': components['schemas']['ListProjectAddonsResponseDto']
|
||||
'application/json': components['schemas']['ListProjectAddonsResponse']
|
||||
}
|
||||
}
|
||||
403: {
|
||||
@@ -3876,7 +3873,7 @@ export interface operations {
|
||||
}
|
||||
requestBody: {
|
||||
content: {
|
||||
'application/json': components['schemas']['ApplyProjectAddonBodyDto']
|
||||
'application/json': components['schemas']['ApplyProjectAddonBody']
|
||||
}
|
||||
}
|
||||
responses: {
|
||||
@@ -5079,7 +5076,7 @@ export interface operations {
|
||||
[name: string]: unknown
|
||||
}
|
||||
content: {
|
||||
'application/json': components['schemas']['GetProjectDbMetadataResponseDto']
|
||||
'application/json': components['schemas']['GetProjectDbMetadataResponse']
|
||||
}
|
||||
}
|
||||
403: {
|
||||
@@ -5148,9 +5145,7 @@ export interface operations {
|
||||
headers: {
|
||||
[name: string]: unknown
|
||||
}
|
||||
content: {
|
||||
'application/json': Record<string, never>
|
||||
}
|
||||
content?: never
|
||||
}
|
||||
403: {
|
||||
headers: {
|
||||
@@ -5187,9 +5182,7 @@ export interface operations {
|
||||
headers: {
|
||||
[name: string]: unknown
|
||||
}
|
||||
content: {
|
||||
'application/json': Record<string, never>
|
||||
}
|
||||
content?: never
|
||||
}
|
||||
403: {
|
||||
headers: {
|
||||
@@ -5498,7 +5491,9 @@ export interface operations {
|
||||
headers: {
|
||||
[name: string]: unknown
|
||||
}
|
||||
content?: never
|
||||
content: {
|
||||
'application/json': components['schemas']['StreamableFile']
|
||||
}
|
||||
}
|
||||
403: {
|
||||
headers: {
|
||||
@@ -6265,9 +6260,7 @@ export interface operations {
|
||||
headers: {
|
||||
[name: string]: unknown
|
||||
}
|
||||
content: {
|
||||
'application/json': Record<string, never>
|
||||
}
|
||||
content?: never
|
||||
}
|
||||
403: {
|
||||
headers: {
|
||||
|
||||
+369
-310
File diff suppressed because it is too large.
Load diff
@@ -9,8 +9,8 @@ import { hasConsented } from './consent-state'
|
||||
import { get, post } from './fetchWrappers'
|
||||
import { ensurePlatformSuffix } from './helpers'
|
||||
|
||||
type TrackFeatureFlagVariables = components['schemas']['TelemetryFeatureFlagBodyDto']
|
||||
export type CallFeatureFlagsResponse = components['schemas']['TelemetryCallFeatureFlagsResponseDto']
|
||||
type TrackFeatureFlagVariables = components['schemas']['TelemetryFeatureFlagBody']
|
||||
export type CallFeatureFlagsResponse = components['schemas']['TelemetryCallFeatureFlagsResponse']
|
||||
|
||||
export async function getFeatureFlags(API_URL: string) {
|
||||
const data = await get(`${ensurePlatformSuffix(API_URL)}/telemetry/feature-flags`)
|
||||
|
||||
@@ -27,7 +27,7 @@ export function handlePageTelemetry(
|
||||
featureFlags?: {
|
||||
[key: string]: unknown
|
||||
},
|
||||
telemetryDataOverride?: components['schemas']['TelemetryPageBodyV2Dto']
|
||||
telemetryDataOverride?: components['schemas']['TelemetryPageBodyV2']
|
||||
) {
|
||||
return post(
|
||||
`${ensurePlatformSuffix(API_URL)}/telemetry/page`,
|
||||
@@ -179,7 +179,7 @@ export const PageTelemetry = ({
|
||||
// EVENT TELEMETRY
|
||||
// ---
|
||||
|
||||
type EventBody = components['schemas']['TelemetryEventBodyV2Dto']
|
||||
type EventBody = components['schemas']['TelemetryEventBodyV2']
|
||||
|
||||
export function sendTelemetryEvent(API_URL: string, event: TelemetryEvent, pathname?: string) {
|
||||
const consent = hasConsented()
|
||||
|
||||
Reference in new issue
Block a user