From 4add928daef93bfbb9b5cefc2a865f30a08437f7 Mon Sep 17 00:00:00 2001 From: Ivan Vasilov Date: Mon, 26 May 2025 15:43:14 +0200 Subject: [PATCH] chore: Update API types (#35879) * Regenerate all types from develop branch. * Fix all types in studio. * Remove extra type. --- .../ui/DiskManagement.constants.tsx | 4 +- .../PostgresVersionSelector.tsx | 5 +- .../ProjectUpgradeAlert.tsx | 3 +- .../IntegrationsLayout/Integrations.utils.ts | 4 +- .../PausedState/ProjectPausedState.tsx | 4 +- .../SQLEditorNavV2/SQLEditorNav.tsx | 4 +- .../data/auth/validate-spam-mutation.ts | 2 +- ...roject-creation-postgres-versions-query.ts | 7 - .../data/config/project-settings-v2-query.ts | 4 +- ...project-unpause-postgres-versions-query.ts | 13 +- .../data/content/content-insert-mutation.ts | 5 +- apps/studio/data/content/content-query.ts | 2 +- .../data/content/content-upsert-mutation.ts | 5 +- apps/studio/data/content/sql-folders-query.ts | 6 +- .../integrations/github-branches-query.ts | 2 +- .../data/lint/create-lint-rule-mutation.ts | 3 +- apps/studio/data/lint/lint-query.ts | 2 +- apps/studio/data/lint/lint-rules-query.ts | 2 +- .../oauth-secrets/client-secrets-query.ts | 6 +- apps/studio/data/open-api/api-spec-query.ts | 10 +- .../organization-update-mutation.ts | 2 +- .../data/projects/project-restore-mutation.ts | 7 +- .../project-transfer-preview-query.ts | 2 - .../data/projects/project-upgrade-mutation.ts | 8 +- .../data/realtime/realtime-config-mutation.ts | 2 +- .../data/storage/bucket-create-mutation.ts | 2 - .../subscriptions/org-subscription-query.ts | 3 - apps/studio/data/subscriptions/types.ts | 2 +- apps/studio/lib/posthog.ts | 4 +- .../projects/[ref]/content/folders/[id].ts | 2 +- .../platform/projects/[ref]/content/index.ts | 10 +- .../api/platform/projects/[ref]/settings.ts | 4 +- apps/studio/types/base.ts | 3 +- packages/api-types/types/api.d.ts | 193 +++-- packages/api-types/types/platform.d.ts | 679 ++++++++++-------- packages/common/feature-flags.tsx | 4 +- packages/common/telemetry.tsx | 4 +- 37 files changed, 526 insertions(+), 498 deletions(-) diff --git a/apps/studio/components/interfaces/DiskManagement/ui/DiskManagement.constants.tsx b/apps/studio/components/interfaces/DiskManagement/ui/DiskManagement.constants.tsx index c3e151ef5ac..2dc509a0c8d 100644 --- a/apps/studio/components/interfaces/DiskManagement/ui/DiskManagement.constants.tsx +++ b/apps/studio/components/interfaces/DiskManagement/ui/DiskManagement.constants.tsx @@ -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 = { +export const PLAN_DETAILS: Record = { free: { includedDiskGB: { gp3: 1, io2: 0 } }, pro: { includedDiskGB: { gp3: 8, io2: 0 } }, team: { includedDiskGB: { gp3: 8, io2: 0 } }, diff --git a/apps/studio/components/interfaces/ProjectCreation/PostgresVersionSelector.tsx b/apps/studio/components/interfaces/ProjectCreation/PostgresVersionSelector.tsx index 8e3a16197cb..67ba4e8a628 100644 --- a/apps/studio/components/interfaces/ProjectCreation/PostgresVersionSelector.tsx +++ b/apps/studio/components/interfaces/ProjectCreation/PostgresVersionSelector.tsx @@ -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 diff --git a/apps/studio/components/interfaces/Settings/General/Infrastructure/ProjectUpgradeAlert/ProjectUpgradeAlert.tsx b/apps/studio/components/interfaces/Settings/General/Infrastructure/ProjectUpgradeAlert/ProjectUpgradeAlert.tsx index 029139530f7..5f485beaebf 100644 --- a/apps/studio/components/interfaces/Settings/General/Infrastructure/ProjectUpgradeAlert/ProjectUpgradeAlert.tsx +++ b/apps/studio/components/interfaces/Settings/General/Infrastructure/ProjectUpgradeAlert/ProjectUpgradeAlert.tsx @@ -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' diff --git a/apps/studio/components/layouts/IntegrationsLayout/Integrations.utils.ts b/apps/studio/components/layouts/IntegrationsLayout/Integrations.utils.ts index 3875773143c..33e016388fb 100644 --- a/apps/studio/components/layouts/IntegrationsLayout/Integrations.utils.ts +++ b/apps/studio/components/layouts/IntegrationsLayout/Integrations.utils.ts @@ -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) ) ), ]) diff --git a/apps/studio/components/layouts/ProjectLayout/PausedState/ProjectPausedState.tsx b/apps/studio/components/layouts/ProjectLayout/PausedState/ProjectPausedState.tsx index aff7eee8053..f684b37369e 100644 --- a/apps/studio/components/layouts/ProjectLayout/PausedState/ProjectPausedState.tsx +++ b/apps/studio/components/layouts/ProjectLayout/PausedState/ProjectPausedState.tsx @@ -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 releaseChannel: ReleaseChannel } diff --git a/apps/studio/components/layouts/SQLEditorLayout/SQLEditorNavV2/SQLEditorNav.tsx b/apps/studio/components/layouts/SQLEditorLayout/SQLEditorNavV2/SQLEditorNav.tsx index 4db2758c4ea..4dd9bd7ba7c 100644 --- a/apps/studio/components/layouts/SQLEditorLayout/SQLEditorNavV2/SQLEditorNav.tsx +++ b/apps/studio/components/layouts/SQLEditorLayout/SQLEditorNavV2/SQLEditorNav.tsx @@ -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] ) diff --git a/apps/studio/data/auth/validate-spam-mutation.ts b/apps/studio/data/auth/validate-spam-mutation.ts index 9b74c3becb3..78a46ac777d 100644 --- a/apps/studio/data/auth/validate-spam-mutation.ts +++ b/apps/studio/data/auth/validate-spam-mutation.ts @@ -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'] diff --git a/apps/studio/data/config/project-creation-postgres-versions-query.ts b/apps/studio/data/config/project-creation-postgres-versions-query.ts index 0365aea4c3b..649d3d82279 100644 --- a/apps/studio/data/config/project-creation-postgres-versions-query.ts +++ b/apps/studio/data/config/project-creation-postgres-versions-query.ts @@ -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 diff --git a/apps/studio/data/config/project-settings-v2-query.ts b/apps/studio/data/config/project-settings-v2-query.ts index 50d04c0e25c..fd575085cc9 100644 --- a/apps/studio/data/config/project-settings-v2-query.ts +++ b/apps/studio/data/config/project-settings-v2-query.ts @@ -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 } diff --git a/apps/studio/data/config/project-unpause-postgres-versions-query.ts b/apps/studio/data/config/project-unpause-postgres-versions-query.ts index e569fa09f3b..72aa72dc42a 100644 --- a/apps/studio/data/config/project-unpause-postgres-versions-query.ts +++ b/apps/studio/data/config/project-unpause-postgres-versions-query.ts @@ -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< diff --git a/apps/studio/data/content/content-insert-mutation.ts b/apps/studio/data/content/content-insert-mutation.ts index a2c621d7deb..b1df9f45bdc 100644 --- a/apps/studio/data/content/content-insert-mutation.ts +++ b/apps/studio/data/content/content-insert-mutation.ts @@ -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 & { content: Content['content'] } diff --git a/apps/studio/data/content/content-query.ts b/apps/studio/data/content/content-query.ts index 27c77c8ff9c..8b019e89591 100644 --- a/apps/studio/data/content/content-query.ts +++ b/apps/studio/data/content/content-query.ts @@ -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 & ( diff --git a/apps/studio/data/content/content-upsert-mutation.ts b/apps/studio/data/content/content-upsert-mutation.ts index 2831298e4b7..2cbe9a173e4 100644 --- a/apps/studio/data/content/content-upsert-mutation.ts +++ b/apps/studio/data/content/content-upsert-mutation.ts @@ -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 & { content: Partial } diff --git a/apps/studio/data/content/sql-folders-query.ts b/apps/studio/data/content/sql-folders-query.ts index ba881f36157..7b041b3ec27 100644 --- a/apps/studio/data/content/sql-folders-query.ts +++ b/apps/studio/data/content/sql-folders-query.ts @@ -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 diff --git a/apps/studio/data/integrations/github-branches-query.ts b/apps/studio/data/integrations/github-branches-query.ts index 342238466c5..18a49ece0a0 100644 --- a/apps/studio/data/integrations/github-branches-query.ts +++ b/apps/studio/data/integrations/github-branches-query.ts @@ -19,7 +19,7 @@ export async function getGitHubBranches( }) if (error) handleError(error) - return data + return data as Record[] } export type GitHubBranchesData = Awaited> diff --git a/apps/studio/data/lint/create-lint-rule-mutation.ts b/apps/studio/data/lint/create-lint-rule-mutation.ts index cc5cd20d04e..b90d0716d25 100644 --- a/apps/studio/data/lint/create-lint-rule-mutation.ts +++ b/apps/studio/data/lint/create-lint-rule-mutation.ts @@ -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 diff --git a/apps/studio/data/lint/lint-query.ts b/apps/studio/data/lint/lint-query.ts index 56097812876..a342aafa23c 100644 --- a/apps/studio/data/lint/lint-query.ts +++ b/apps/studio/data/lint/lint-query.ts @@ -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'] diff --git a/apps/studio/data/lint/lint-rules-query.ts b/apps/studio/data/lint/lint-rules-query.ts index f4d4a7d4a8b..66d247ada3f 100644 --- a/apps/studio/data/lint/lint-rules-query.ts +++ b/apps/studio/data/lint/lint-rules-query.ts @@ -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( diff --git a/apps/studio/data/oauth-secrets/client-secrets-query.ts b/apps/studio/data/oauth-secrets/client-secrets-query.ts index a07ea96e1b8..b69f8d7751d 100644 --- a/apps/studio/data/oauth-secrets/client-secrets-query.ts +++ b/apps/studio/data/oauth-secrets/client-secrets-query.ts @@ -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 diff --git a/apps/studio/data/open-api/api-spec-query.ts b/apps/studio/data/open-api/api-spec-query.ts index 0ecd8d0014d..9bedd99f5e5 100644 --- a/apps/studio/data/open-api/api-spec-query.ts +++ b/apps/studio/data/open-api/api-spec-query.ts @@ -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, diff --git a/apps/studio/data/organizations/organization-update-mutation.ts b/apps/studio/data/organizations/organization-update-mutation.ts index 628ae5f8c12..81883ba7626 100644 --- a/apps/studio/data/organizations/organization-update-mutation.ts +++ b/apps/studio/data/organizations/organization-update-mutation.ts @@ -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}', { diff --git a/apps/studio/data/projects/project-restore-mutation.ts b/apps/studio/data/projects/project-restore-mutation.ts index 6b74010e400..4a3a2fef176 100644 --- a/apps/studio/data/projects/project-restore-mutation.ts +++ b/apps/studio/data/projects/project-restore-mutation.ts @@ -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 releaseChannel?: ReleaseChannel } diff --git a/apps/studio/data/projects/project-transfer-preview-query.ts b/apps/studio/data/projects/project-transfer-preview-query.ts index 8e4f301b36b..02fc0cbdb08 100644 --- a/apps/studio/data/projects/project-transfer-preview-query.ts +++ b/apps/studio/data/projects/project-transfer-preview-query.ts @@ -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 diff --git a/apps/studio/data/projects/project-upgrade-mutation.ts b/apps/studio/data/projects/project-upgrade-mutation.ts index 483e94fbc61..28c377a66de 100644 --- a/apps/studio/data/projects/project-upgrade-mutation.ts +++ b/apps/studio/data/projects/project-upgrade-mutation.ts @@ -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({ diff --git a/apps/studio/data/realtime/realtime-config-mutation.ts b/apps/studio/data/realtime/realtime-config-mutation.ts index 318172a9fc5..6d380b5dcea 100644 --- a/apps/studio/data/realtime/realtime-config-mutation.ts +++ b/apps/studio/data/realtime/realtime-config-mutation.ts @@ -8,7 +8,7 @@ import { realtimeKeys } from './keys' export type RealtimeConfigurationUpdateVariables = { ref: string -} & components['schemas']['UpdateRealtimeConfigBodyDto'] +} & components['schemas']['UpdateRealtimeConfigBody'] export async function updateRealtimeConfiguration({ ref, diff --git a/apps/studio/data/storage/bucket-create-mutation.ts b/apps/studio/data/storage/bucket-create-mutation.ts index 444dfdb125b..a585f4a7278 100644 --- a/apps/studio/data/storage/bucket-create-mutation.ts +++ b/apps/studio/data/storage/bucket-create-mutation.ts @@ -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 } } diff --git a/apps/studio/data/subscriptions/org-subscription-query.ts b/apps/studio/data/subscriptions/org-subscription-query.ts index 94d0edcaa93..26b68114612 100644 --- a/apps/studio/data/subscriptions/org-subscription-query.ts +++ b/apps/studio/data/subscriptions/org-subscription-query.ts @@ -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 diff --git a/apps/studio/data/subscriptions/types.ts b/apps/studio/data/subscriptions/types.ts index 6f4cb4a62a7..4591d175e36 100644 --- a/apps/studio/data/subscriptions/types.ts +++ b/apps/studio/data/subscriptions/types.ts @@ -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] diff --git a/apps/studio/lib/posthog.ts b/apps/studio/lib/posthog.ts index 347040a6af9..058abf79e04 100644 --- a/apps/studio/lib/posthog.ts +++ b/apps/studio/lib/posthog.ts @@ -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() diff --git a/apps/studio/pages/api/platform/projects/[ref]/content/folders/[id].ts b/apps/studio/pages/api/platform/projects/[ref]/content/folders/[id].ts index 24d6c35b820..15f13a84824 100644 --- a/apps/studio/pages/api/platform/projects/[ref]/content/folders/[id].ts +++ b/apps/studio/pages/api/platform/projects/[ref]/content/folders/[id].ts @@ -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) => { - return res.status(200).json({ data: { folders: [] } }) + return res.status(200).json({ data: { folders: [], contents: [] } }) } type PatchResponseData = diff --git a/apps/studio/pages/api/platform/projects/[ref]/content/index.ts b/apps/studio/pages/api/platform/projects/[ref]/content/index.ts index 9bc53912644..0a08de15eb3 100644 --- a/apps/studio/pages/api/platform/projects/[ref]/content/index.ts +++ b/apps/studio/pages/api/platform/projects/[ref]/content/index.ts @@ -53,8 +53,14 @@ const handleGetAll = async (req: NextApiRequest, res: NextApiResponse 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 - } + content?: never } 403: { headers: { @@ -5187,9 +5182,7 @@ export interface operations { headers: { [name: string]: unknown } - content: { - 'application/json': Record - } + 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 - } + content?: never } 403: { headers: { diff --git a/packages/api-types/types/platform.d.ts b/packages/api-types/types/platform.d.ts index c4743c48fdd..4bb55aa5127 100644 --- a/packages/api-types/types/platform.d.ts +++ b/packages/api-types/types/platform.d.ts @@ -4100,7 +4100,7 @@ export interface components { result: unknown[] retention_period: number } - AuthBackupAdminLintResponseDto: { + AuthBackupAdminLintResponse: { lints: { cache_key: string categories: ('PERFORMANCE' | 'SECURITY')[] @@ -4153,9 +4153,6 @@ export interface components { title: string }[] } - BackupId: { - id: number - } BackupsResponse: { backups: { id: number @@ -4190,7 +4187,7 @@ export interface components { BulkDeleteUserContentResponse: { id: string } - ChangeMFAEnforcementStateRequestDto: { + ChangeMFAEnforcementStateRequest: { enforced: boolean } CloneBackupsResponse: { @@ -4213,7 +4210,7 @@ export interface components { tierKey: string walg_enabled: boolean } - CloneProjectDto: { + CloneProject: { /** @default 0 */ cloneBackupId?: number newDbPass: string @@ -4313,7 +4310,7 @@ export interface components { tableId: number type: string } - CreateContentBodyDto: { + CreateContentBody: { content?: { [key: string]: unknown } @@ -4328,7 +4325,7 @@ export interface components { /** @enum {string} */ visibility: 'user' | 'project' | 'org' | 'public' } - CreateContentFolderBodyDto: { + CreateContentFolderBody: { name: string /** Format: uuid */ parent_id?: string @@ -4366,7 +4363,7 @@ export interface components { role_id: number role_scoped_projects?: string[] } - CreateNotificationExceptionsBodyDto: { + CreateNotificationExceptionsBody: { exceptions: { /** Format: uuid */ assigned_to?: string @@ -4410,7 +4407,7 @@ export interface components { note?: string }[] } - CreateNotificationExceptionsResponseDto: { + CreateNotificationExceptionsResponse: { exceptions: { /** Format: uuid */ assigned_to: string | null @@ -4460,7 +4457,7 @@ export interface components { )[] website: string } - CreateOAuthAppClientSecretResponseDto: { + CreateOAuthAppClientSecretResponse: { client_secret: string client_secret_alias: string /** Format: date-time */ @@ -4834,12 +4831,12 @@ export interface components { source: string teamId?: string } - CreditsTopUpRequestDto: { + CreditsTopUpRequest: { amount: number hcaptcha_token?: string payment_method_id: string } - CreditsTopUpResponseDto: { + CreditsTopUpResponse: { payment_intent_secret?: string /** @enum {string} */ status: @@ -5078,7 +5075,7 @@ export interface components { status: 0 | 1 | 2 } | null } - GetLeakedServiceKeyLintResponseDto: { + GetLeakedServiceKeyLintResponse: { lints: { cache_key: string categories: ('PERFORMANCE' | 'SECURITY')[] @@ -5181,18 +5178,29 @@ export interface components { } GetOrganizationIntegrationResponse: { added_by: { - primary_email?: string - username?: string + primary_email: string + username: string } - connections: components['schemas']['ProjectIntegrationConnection'][] + connections: { + added_by: { + primary_email: string + username: string + } + id: string + inserted_at: string + organization_integration_id: string + supabase_project_ref: string + updated_at: string + }[] id: string inserted_at: string integration: { - name?: string + name: string } - metadata: Record + /** @description Any JSON-serializable value */ + metadata: unknown organization: { - slug?: string + slug: string } updated_at: string } @@ -5207,7 +5215,7 @@ export interface components { GetProjectByFlyExtensionIdResponse: { ref: string } - GetProjectLintsResponseDto: { + GetProjectLintsResponse: { cache_key: string categories: ('PERFORMANCE' | 'SECURITY')[] description: string @@ -5390,7 +5398,9 @@ export interface components { usage_billing_enabled: boolean } GetUserContentByIdResponse: { - content: Record + content: { + [key: string]: unknown + } description?: string favorite: boolean | null folder_id?: string | null @@ -5409,52 +5419,75 @@ export interface components { GetUserContentFolderResponse: { cursor?: string data: { - contents?: components['schemas']['UserContentObjectMeta'][] - folders?: components['schemas']['UserContentFolder'][] + contents: { + description?: string + favorite?: boolean | null + folder_id?: string | null + id: string + inserted_at: string + last_updated_by?: number + name: string + owner_id: number + project_id: number + /** @enum {string} */ + type: 'sql' | 'report' | 'log_sql' + updated_at: string + /** @enum {string} */ + visibility: 'user' | 'project' | 'org' | 'public' + }[] + folders: { + id: string + name: string + owner_id: number + parent_id?: string | null + project_id: number + }[] } } - GetUserContentObject: { - content: Record - description?: string - favorite?: boolean | null - folder_id?: string | null - id: string - inserted_at: string - last_updated_by?: number - name: string - owner: { - id?: number - username?: string - } - owner_id: number - project_id: number - /** @enum {string} */ - type: 'sql' | 'report' | 'log_sql' - updated_at: string - updated_by: { - id?: number - username?: string - } - /** @enum {string} */ - visibility: 'user' | 'project' | 'org' | 'public' - } GetUserContentResponse: { cursor?: string - data: components['schemas']['GetUserContentObject'][] + data: { + content: { + [key: string]: unknown + } + description?: string + favorite?: boolean | null + folder_id?: string | null + id: string + inserted_at: string + last_updated_by?: number + name: string + owner: { + id: number + username: string + } + owner_id: number + project_id: number + /** @enum {string} */ + type: 'sql' | 'report' | 'log_sql' + updated_at: string + updated_by: { + id: number + username: string + } + /** @enum {string} */ + visibility: 'user' | 'project' | 'org' | 'public' + }[] } GetUserOrganizationIntegrationResponse: { added_by: { - primary_email?: string - username?: string + primary_email: string + username: string } id: string inserted_at: string integration: { - name?: string + name: string } - metadata: Record + /** @description Any JSON-serializable value */ + metadata: unknown organization: { - slug?: string + slug: string } updated_at: string } @@ -5835,7 +5868,7 @@ export interface components { workdir: string }[] } - ListNotificationExceptionsResponseDto: { + ListNotificationExceptionsResponse: { exceptions: { /** Format: uuid */ assigned_to: string | null @@ -5855,7 +5888,7 @@ export interface components { project_ref: string }[] } - ListOAuthAppClientSecretsResponseDto: { + ListOAuthAppClientSecretsResponse: { client_secrets: { client_secret_alias: string /** Format: date-time */ @@ -5899,7 +5932,7 @@ export interface components { primary_email: string username: string } - MfaStatusResponseDto: { + MfaStatusResponse: { enforced: boolean } MoveObjectBody: { @@ -6081,67 +6114,77 @@ export interface components { project_ids: number[] | null }[] } - OrganizationSlugAvailableVersionsBodyDto: { + OrganizationSlugAvailableVersionsBody: { provider: string region: string } OrganizationSlugAvailableVersionsResponse: { - available_versions: components['schemas']['ProjectCreationVersionInfo'][] - } - OrganizationSlugProject: { - cloud_provider: string - disk_volume_size_gb?: number - engine?: string - id: number - /** @enum {string} */ - infra_compute_size?: - | 'pico' - | 'nano' - | 'micro' - | 'small' - | 'medium' - | 'large' - | 'xlarge' - | '2xlarge' - | '4xlarge' - | '8xlarge' - | '12xlarge' - | '16xlarge' - | '24xlarge' - | '24xlarge_optimized_memory' - | '24xlarge_optimized_cpu' - | '24xlarge_high_memory' - | '48xlarge' - | '48xlarge_optimized_memory' - | '48xlarge_optimized_cpu' - | '48xlarge_high_memory' - inserted_at: string | null - is_branch_enabled: boolean - is_physical_backups_enabled: boolean | null - name: string - organization_id: number - organization_slug: string - preview_branch_refs: string[] - ref: string - region: string - status: string - subscription_id: string | null + available_versions: { + /** @enum {string} */ + postgres_engine: '15' | '17' | '17-oriole' + /** @enum {string} */ + release_channel: 'internal' | 'alpha' | 'beta' | 'ga' | 'withdrawn' | 'preview' + version: string + }[] } OrganizationSlugResponse: { billing_email: string | null - billing_metadata: Record | null + billing_metadata: { + [key: string]: unknown + } | null has_oriole_project: boolean id: number name: string opt_in_tags: string[] plan: { /** @enum {string} */ - id?: 'free' | 'pro' | 'team' | 'enterprise' - name?: string + id: 'free' | 'pro' | 'team' | 'enterprise' + name: string } - projects: components['schemas']['OrganizationSlugProject'][] - restriction_data: Record | null - restriction_status: Record | null + projects: { + cloud_provider: string + disk_volume_size_gb?: number + engine?: string + id: number + /** @enum {string} */ + infra_compute_size?: + | 'pico' + | 'nano' + | 'micro' + | 'small' + | 'medium' + | 'large' + | 'xlarge' + | '2xlarge' + | '4xlarge' + | '8xlarge' + | '12xlarge' + | '16xlarge' + | '24xlarge' + | '24xlarge_optimized_memory' + | '24xlarge_optimized_cpu' + | '24xlarge_high_memory' + | '48xlarge' + | '48xlarge_optimized_memory' + | '48xlarge_optimized_cpu' + | '48xlarge_high_memory' + inserted_at: string | null + is_branch_enabled: boolean + is_physical_backups_enabled: boolean | null + name: string + organization_id: number + organization_slug: string + preview_branch_refs: string[] + ref: string + region: string + status: string + subscription_id: string | null + }[] + restriction_data: { + [key: string]: unknown + } | null + /** @enum {string|null} */ + restriction_status: 'grace_period' | 'grace_period_over' | 'restricted' | null slug: string usage_billing_enabled: boolean } @@ -6351,8 +6394,6 @@ export interface components { wal_sender_timeout?: string work_mem?: string } - /** @enum {string} */ - PostgresEngine: '15' | '17' | '17-oriole' PostgresExtension: { comment: string | null default_version: string @@ -6740,10 +6781,6 @@ export interface components { } }[] } - ProjectAppConfigResponse: { - db_schema: string - endpoint: string - } ProjectClonedResponse: { source_project_ref: string target_disk_size_gb: number @@ -6773,11 +6810,6 @@ export interface components { id: number ref: string } - ProjectCreationVersionInfo: { - postgres_engine: components['schemas']['PostgresEngine'] - release_channel: components['schemas']['ReleaseChannel'] - version: string - } ProjectDetailResponse: { cloud_provider: string /** @default null */ @@ -6876,17 +6908,6 @@ export interface components { status: string subscription_id: string | null } - ProjectIntegrationConnection: { - added_by: { - primary_email?: string - username?: string - } - id: string - inserted_at: string - organization_integration_id: string - supabase_project_ref: string - updated_at: string - } ProjectRefResponse: { id: number name: string @@ -6915,13 +6936,11 @@ export interface components { ProjectSensitivityResponse: { is_sensitive: boolean } - ProjectServiceApiKeyResponse: { - api_key: string - name: string - tags: string - } ProjectSettingsResponse: { - app_config?: components['schemas']['ProjectAppConfigResponse'] + app_config?: { + db_schema: string + endpoint: string + } cloud_provider: string db_dns_name: string db_host: string @@ -6935,17 +6954,14 @@ export interface components { name: string ref: string region: string - service_api_keys?: components['schemas']['ProjectServiceApiKeyResponse'][] + service_api_keys?: { + api_key: string + name: string + tags: string + }[] ssl_enforced: boolean status: string } - ProjectUnpauseVersionInfo: { - /** @enum {string} */ - postgres_engine: '13' | '14' | '15' | '17' | '17-oriole' - /** @enum {string} */ - release_channel: 'internal' | 'alpha' | 'beta' | 'ga' | 'withdrawn' | 'preview' - version: string - } PublicUrlResponse: { publicUrl: string } @@ -6958,7 +6974,7 @@ export interface components { redirect_uris: string[] website: string } - RealtimeConfigResponseDto: { + RealtimeConfigResponse: { /** @description Sets connection pool size for Realtime Authorization */ connection_pool: number | null /** @description Sets maximum number of bytes per second rate per channel limit */ @@ -6974,8 +6990,6 @@ export interface components { /** @description Whether to only allow private channels */ private_only: boolean | null } - /** @enum {string} */ - ReleaseChannel: 'internal' | 'alpha' | 'beta' | 'ga' | 'withdrawn' | 'preview' ReplicationPipelineResponse: { config: { config: { @@ -7137,7 +7151,7 @@ export interface components { /** @enum {string} */ privilege_type: 'ALL' | 'SELECT' | 'INSERT' | 'UPDATE' | 'REFERENCES' }[] - RunLintByNameResponseDto: { + RunLintByNameResponse: { lints: { cache_key: string categories: ('PERFORMANCE' | 'SECURITY')[] @@ -7312,6 +7326,7 @@ export interface components { owner: string updated_at: string } + StreamableFile: Record SupavisorConfigResponse: { connection_string: string /** @description Use connection_string instead */ @@ -7336,10 +7351,10 @@ export interface components { value: string } | null } - TelemetryCallFeatureFlagsResponseDto: { + TelemetryCallFeatureFlagsResponse: { [key: string]: unknown } - TelemetryEventBodyV2Dto: { + TelemetryEventBodyV2: { action: string custom_properties: { [key: string]: unknown @@ -7360,7 +7375,7 @@ export interface components { viewport_width: number } } - TelemetryFeatureFlagBodyDto: { + TelemetryFeatureFlagBody: { feature_flag_name: string feature_flag_value?: unknown } @@ -7377,7 +7392,7 @@ export interface components { project_ref?: string user_id: string } - TelemetryPageBodyV2Dto: { + TelemetryPageBodyV2: { feature_flags?: { [key: string]: unknown } @@ -7393,7 +7408,7 @@ export interface components { viewport_width: number } } - TelemetryPageLeaveBodyDto: { + TelemetryPageLeaveBody: { feature_flags?: { [key: string]: unknown } @@ -7411,9 +7426,15 @@ export interface components { target_organization_slug: string } UnpauseProjectAvailableVersionsResponse: { - available_versions: components['schemas']['ProjectUnpauseVersionInfo'][] + available_versions: { + /** @enum {string} */ + postgres_engine: '13' | '14' | '15' | '17' | '17-oriole' + /** @enum {string} */ + release_channel: 'internal' | 'alpha' | 'beta' | 'ga' | 'withdrawn' | 'preview' + version: string + }[] } - UnpauseProjectBodyDto: { + UnpauseProjectBody: { /** * @description Postgres engine version. If not provided, the latest version from the given release channel will be used. * @enum {string} @@ -7426,7 +7447,9 @@ export interface components { release_channel?: 'internal' | 'alpha' | 'beta' | 'ga' | 'withdrawn' | 'preview' } UnpauseProjectResponse: { - back_ups: components['schemas']['BackupId'][] + back_ups: { + id: number + }[] cloud_provider: string id: number organization_id: number @@ -7434,7 +7457,128 @@ export interface components { status: string subscription_id: string } - UpcomingInvoice: Record + UpcomingInvoice: { + amount_projected?: number + amount_total: number + /** Format: date-time */ + billing_cycle_end: string + /** Format: date-time */ + billing_cycle_start: string + currency: string + customer_balance: number + lines: { + amount: number + amount_before_discount: number + breakdown?: { + amount?: number + /** @enum {string} */ + project_db_instance_size?: + | 'pico' + | 'nano' + | 'micro' + | 'small' + | 'medium' + | 'large' + | 'xlarge' + | '2xlarge' + | '4xlarge' + | '8xlarge' + | '12xlarge' + | '16xlarge' + | '24xlarge' + | '24xlarge_optimized_memory' + | '24xlarge_optimized_cpu' + | '24xlarge_high_memory' + | '48xlarge' + | '48xlarge_optimized_memory' + | '48xlarge_optimized_cpu' + | '48xlarge_high_memory' + project_name: string + project_ref: string + /** @enum {string} */ + project_status?: + | 'INACTIVE' + | 'ACTIVE_HEALTHY' + | 'ACTIVE_UNHEALTHY' + | 'COMING_UP' + | 'UNKNOWN' + | 'GOING_DOWN' + | 'INIT_FAILED' + | 'REMOVED' + | 'RESTORING' + | 'UPGRADING' + | 'PAUSING' + | 'RESTORE_FAILED' + | 'RESTARTING' + | 'PAUSE_FAILED' + | 'RESIZING' + usage: number + }[] + description: string + metadata?: { + is_branch?: boolean + is_read_replica?: boolean + } + period?: { + /** Format: date-time */ + end: string + /** Format: date-time */ + start: string + } + proration: boolean + quantity: number | null + unit_price: number | null + unit_price_desc: string | null + usage_based: boolean + /** @enum {string} */ + usage_metric?: + | 'EGRESS' + | 'DATABASE_SIZE' + | 'STORAGE_SIZE' + | 'MONTHLY_ACTIVE_USERS' + | 'MONTHLY_ACTIVE_SSO_USERS' + | 'FUNCTION_INVOCATIONS' + | 'STORAGE_IMAGES_TRANSFORMED' + | 'REALTIME_MESSAGE_COUNT' + | 'REALTIME_PEAK_CONNECTIONS' + | 'DISK_SIZE_GB_HOURS_GP3' + | 'DISK_SIZE_GB_HOURS_IO2' + | 'AUTH_MFA_PHONE' + | 'AUTH_MFA_WEB_AUTHN' + | 'LOG_DRAIN_EVENTS' + | 'MONTHLY_ACTIVE_THIRD_PARTY_USERS' + | 'DISK_THROUGHPUT_GP3' + | 'DISK_IOPS_GP3' + | 'DISK_IOPS_IO2' + | 'COMPUTE_HOURS_BRANCH' + | 'COMPUTE_HOURS_XS' + | 'COMPUTE_HOURS_SM' + | 'COMPUTE_HOURS_MD' + | 'COMPUTE_HOURS_L' + | 'COMPUTE_HOURS_XL' + | 'COMPUTE_HOURS_2XL' + | 'COMPUTE_HOURS_4XL' + | 'COMPUTE_HOURS_8XL' + | 'COMPUTE_HOURS_12XL' + | 'COMPUTE_HOURS_16XL' + | 'COMPUTE_HOURS_24XL' + | 'COMPUTE_HOURS_24XL_OPTIMIZED_CPU' + | 'COMPUTE_HOURS_24XL_OPTIMIZED_MEMORY' + | 'COMPUTE_HOURS_24XL_HIGH_MEMORY' + | 'COMPUTE_HOURS_48XL' + | 'COMPUTE_HOURS_48XL_OPTIMIZED_CPU' + | 'COMPUTE_HOURS_48XL_OPTIMIZED_MEMORY' + | 'COMPUTE_HOURS_48XL_HIGH_MEMORY' + | 'CUSTOM_DOMAIN' + | 'PITR_7' + | 'PITR_14' + | 'PITR_28' + | 'IPV4' + | 'LOG_DRAIN' + usage_original?: number + }[] + subscription_id: string + } UpdateAddonBody: { /** @enum {string} */ addon_type: @@ -7537,7 +7681,7 @@ export interface components { name?: string type?: string } - UpdateContentFolderBodyDto: { + UpdateContentFolderBody: { name: string } UpdateDiskAutoscaleConfig: { @@ -7557,7 +7701,7 @@ export interface components { */ min_increment_gb?: number } - UpdateEmailBodyDto: { + UpdateEmailBody: { newEmail: string } UpdateFunctionBody: { @@ -7713,6 +7857,7 @@ export interface components { RATE_LIMIT_SMS_SENT?: number | null RATE_LIMIT_TOKEN_REFRESH?: number | null RATE_LIMIT_VERIFY?: number | null + RATE_LIMIT_WEB3?: number | null REFRESH_TOKEN_ROTATION_ENABLED?: boolean | null SAML_ALLOW_ENCRYPTED_ASSERTIONS?: boolean | null SAML_ENABLED?: boolean | null @@ -7793,7 +7938,7 @@ export interface components { /** @enum {string} */ status: 'new' | 'seen' | 'archived' }[] - UpdateNotificationExceptionBodyDto: { + UpdateNotificationExceptionBody: { /** Format: uuid */ assigned_to?: string is_disabled?: boolean @@ -7807,7 +7952,7 @@ export interface components { UpdateNotificationsBodyV1: { ids: string[] } - UpdateOrganizationBodyDto: { + UpdateOrganizationBody: { additional_billing_emails?: string[] /** Format: email */ billing_email?: string @@ -7915,7 +8060,7 @@ export interface components { publish_update?: boolean tables?: string[] | null } - UpdateRealtimeConfigBodyDto: { + UpdateRealtimeConfigBody: { /** @description Sets connection pool size for Realtime Authorization */ connection_pool?: number /** @description Sets maximum number of bytes per second rate per channel limit */ @@ -8108,7 +8253,7 @@ export interface components { env_sync_targets?: ('production' | 'preview' | 'development')[] public_env_var_prefix?: string } - UpsertContentBodyDto: { + UpsertContentBody: { content?: { [key: string]: unknown } @@ -8171,31 +8316,10 @@ export interface components { role?: string updated_at?: string } - UserContentFolder: { - id: string - name: string - owner_id: number - parent_id?: string | null - project_id: number - } UserContentObject: { - content: Record - description?: string - favorite?: boolean | null - folder_id?: string | null - id: string - inserted_at: string - last_updated_by?: number - name: string - owner_id: number - project_id: number - /** @enum {string} */ - type: 'sql' | 'report' | 'log_sql' - updated_at: string - /** @enum {string} */ - visibility: 'user' | 'project' | 'org' | 'public' - } - UserContentObjectMeta: { + content: { + [key: string]: unknown + } description?: string favorite?: boolean | null folder_id?: string | null @@ -8217,7 +8341,7 @@ export interface components { ValidateQueryResponse: { valid: boolean } - ValidateSpamBodyDto: { + ValidateSpamBody: { content: string subject: string } @@ -8378,9 +8502,7 @@ export interface operations { headers: { [name: string]: unknown } - content: { - 'application/json': Record - } + content?: never } 403: { headers: { @@ -8417,9 +8539,7 @@ export interface operations { headers: { [name: string]: unknown } - content: { - 'application/json': Record - } + content?: never } 403: { headers: { @@ -8456,9 +8576,7 @@ export interface operations { headers: { [name: string]: unknown } - content: { - 'application/json': Record - } + content?: never } 403: { headers: { @@ -8495,9 +8613,7 @@ export interface operations { headers: { [name: string]: unknown } - content: { - 'application/json': Record - } + content?: never } 403: { headers: { @@ -8536,9 +8652,7 @@ export interface operations { headers: { [name: string]: unknown } - content: { - 'application/json': string - } + content?: never } /** @description Failed to retrieve GoTrue template */ 500: { @@ -8590,7 +8704,10 @@ export interface operations { } UsersController_deleteUserById: { parameters: { - query?: never + query?: { + /** @description Boolean string, true or false */ + soft_delete?: boolean + } header?: never path: { id: string @@ -8679,9 +8796,7 @@ export interface operations { headers: { [name: string]: unknown } - content: { - 'application/json': Record - } + content?: never } 403: { headers: { @@ -8707,7 +8822,7 @@ export interface operations { } requestBody: { content: { - 'application/json': components['schemas']['ValidateSpamBodyDto'] + 'application/json': components['schemas']['ValidateSpamBody'] } } responses: { @@ -9042,7 +9157,7 @@ export interface operations { } requestBody: { content: { - 'application/json': components['schemas']['CloneProjectDto'] + 'application/json': components['schemas']['CloneProject'] } } responses: { @@ -9147,9 +9262,7 @@ export interface operations { headers: { [name: string]: unknown } - content: { - 'application/json': Record - } + content?: never } 403: { headers: { @@ -9412,9 +9525,7 @@ export interface operations { headers: { [name: string]: unknown } - content: { - 'application/json': Record[] - } + content?: never } /** @description Failed to list GitHub connection branches */ 500: { @@ -9441,9 +9552,7 @@ export interface operations { headers: { [name: string]: unknown } - content: { - 'application/json': Record - } + content?: never } /** @description Failed to get GitHub connection branch */ 500: { @@ -10099,7 +10208,7 @@ export interface operations { } requestBody: { content: { - 'application/json': components['schemas']['UpdateOrganizationBodyDto'] + 'application/json': components['schemas']['UpdateOrganizationBody'] } } responses: { @@ -10172,7 +10281,7 @@ export interface operations { } requestBody: { content: { - 'application/json': components['schemas']['OrganizationSlugAvailableVersionsBodyDto'] + 'application/json': components['schemas']['OrganizationSlugAvailableVersionsBody'] } } responses: { @@ -10211,7 +10320,7 @@ export interface operations { } requestBody: { content: { - 'application/json': components['schemas']['CreditsTopUpRequestDto'] + 'application/json': components['schemas']['CreditsTopUpRequest'] } } responses: { @@ -10221,7 +10330,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['CreditsTopUpResponseDto'] + 'application/json': components['schemas']['CreditsTopUpResponse'] } } 403: { @@ -10694,9 +10803,7 @@ export interface operations { headers: { [name: string]: unknown } - content: { - 'application/json': Record - } + content?: never } /** @description Failed to get daily organization stats */ 500: { @@ -11091,21 +11198,13 @@ export interface operations { } requestBody?: never responses: { - 200: { - headers: { - [name: string]: unknown - } - content: { - 'application/json': components['schemas']['MfaStatusResponseDto'] - } - } /** @description MFA enfocement state on organization. */ 201: { headers: { [name: string]: unknown } content: { - 'application/json': components['schemas']['MfaStatusResponseDto'] + 'application/json': components['schemas']['MfaStatusResponse'] } } /** @description Failed to get organization MFA status */ @@ -11129,25 +11228,17 @@ export interface operations { } requestBody: { content: { - 'application/json': components['schemas']['ChangeMFAEnforcementStateRequestDto'] + 'application/json': components['schemas']['ChangeMFAEnforcementStateRequest'] } } responses: { - 200: { - headers: { - [name: string]: unknown - } - content: { - 'application/json': components['schemas']['MfaStatusResponseDto'] - } - } /** @description MFA enfocement state on organization updated successfully. */ 201: { headers: { [name: string]: unknown } content: { - 'application/json': components['schemas']['MfaStatusResponseDto'] + 'application/json': components['schemas']['MfaStatusResponse'] } } 403: { @@ -11274,7 +11365,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['ListOAuthAppClientSecretsResponseDto'] + 'application/json': components['schemas']['ListOAuthAppClientSecretsResponse'] } } 403: { @@ -11303,7 +11394,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['CreateOAuthAppClientSecretResponseDto'] + 'application/json': components['schemas']['CreateOAuthAppClientSecretResponse'] } } 403: { @@ -12887,9 +12978,7 @@ export interface operations { headers: { [name: string]: unknown } - content: { - 'application/json': Record - } + content?: never } 403: { headers: { @@ -12926,9 +13015,7 @@ export interface operations { headers: { [name: string]: unknown } - content: { - 'application/json': string - } + content?: never } /** @description Failed to format sql query */ 500: { @@ -15001,9 +15088,7 @@ export interface operations { headers: { [name: string]: unknown } - content: { - 'application/json': Record - } + content?: never } 403: { headers: { @@ -15036,9 +15121,7 @@ export interface operations { headers: { [name: string]: unknown } - content: { - 'application/json': Record - } + content?: never } 403: { headers: { @@ -15444,7 +15527,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['RealtimeConfigResponseDto'] + 'application/json': components['schemas']['RealtimeConfigResponse'] } } 403: { @@ -15467,7 +15550,7 @@ export interface operations { } requestBody: { content: { - 'application/json': components['schemas']['UpdateRealtimeConfigBodyDto'] + 'application/json': components['schemas']['UpdateRealtimeConfigBody'] } } responses: { @@ -15746,7 +15829,7 @@ export interface operations { } requestBody: { content: { - 'application/json': components['schemas']['UpsertContentBodyDto'] + 'application/json': components['schemas']['UpsertContentBody'] } } responses: { @@ -15777,7 +15860,7 @@ export interface operations { } requestBody: { content: { - 'application/json': components['schemas']['CreateContentBodyDto'] + 'application/json': components['schemas']['CreateContentBody'] } } responses: { @@ -15910,7 +15993,7 @@ export interface operations { } requestBody: { content: { - 'application/json': components['schemas']['CreateContentFolderBodyDto'] + 'application/json': components['schemas']['CreateContentFolderBody'] } } responses: { @@ -16008,7 +16091,7 @@ export interface operations { } requestBody: { content: { - 'application/json': components['schemas']['UpdateContentFolderBodyDto'] + 'application/json': components['schemas']['UpdateContentFolderBody'] } } responses: { @@ -16108,9 +16191,7 @@ export interface operations { headers: { [name: string]: unknown } - content: { - 'application/json': Record - } + content?: never } /** @description Failed to get daily project stats */ 500: { @@ -16444,9 +16525,7 @@ export interface operations { headers: { [name: string]: unknown } - content: { - 'application/json': Record - } + content?: never } /** @description Failed to get project's usage metrics */ 500: { @@ -16529,7 +16608,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['ListNotificationExceptionsResponseDto'] + 'application/json': components['schemas']['ListNotificationExceptionsResponse'] } } /** @description Failed to retrieve advisor notification exceptions */ @@ -16553,7 +16632,7 @@ export interface operations { } requestBody: { content: { - 'application/json': components['schemas']['CreateNotificationExceptionsBodyDto'] + 'application/json': components['schemas']['CreateNotificationExceptionsBody'] } } responses: { @@ -16562,7 +16641,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['CreateNotificationExceptionsResponseDto'] + 'application/json': components['schemas']['CreateNotificationExceptionsResponse'] } } /** @description Failed to creare advisor notification exceptions */ @@ -16616,7 +16695,7 @@ export interface operations { } requestBody: { content: { - 'application/json': components['schemas']['UpdateNotificationExceptionBodyDto'] + 'application/json': components['schemas']['UpdateNotificationExceptionBody'] } } responses: { @@ -16801,7 +16880,7 @@ export interface operations { } requestBody: { content: { - 'application/json': components['schemas']['UnpauseProjectBodyDto'] + 'application/json': components['schemas']['UnpauseProjectBody'] } } responses: { @@ -16915,7 +16994,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['GetProjectLintsResponseDto'] + 'application/json': components['schemas']['GetProjectLintsResponse'] } } 403: { @@ -16972,7 +17051,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['RunLintByNameResponseDto'] + 'application/json': components['schemas']['RunLintByNameResponse'] } } 403: { @@ -17000,7 +17079,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['GetLeakedServiceKeyLintResponseDto'] + 'application/json': components['schemas']['GetLeakedServiceKeyLintResponse'] } } 403: { @@ -17028,7 +17107,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['AuthBackupAdminLintResponseDto'] + 'application/json': components['schemas']['AuthBackupAdminLintResponse'] } } 403: { @@ -17930,12 +18009,6 @@ export interface operations { } responses: { /** @description Returned when the publication is created. */ - 200: { - headers: { - [name: string]: unknown - } - content?: never - } 201: { headers: { [name: string]: unknown @@ -18245,9 +18318,7 @@ export interface operations { headers: { [name: string]: unknown } - content: { - 'application/json': string - } + content?: never } 403: { headers: { @@ -18512,7 +18583,9 @@ export interface operations { headers: { [name: string]: unknown } - content?: never + content: { + 'application/json': components['schemas']['StreamableFile'] + } } 403: { headers: { @@ -18899,7 +18972,7 @@ export interface operations { } requestBody: { content: { - 'application/json': components['schemas']['TelemetryEventBodyV2Dto'] + 'application/json': components['schemas']['TelemetryEventBodyV2'] } } responses: { @@ -18933,7 +19006,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['TelemetryCallFeatureFlagsResponseDto'] + 'application/json': components['schemas']['TelemetryCallFeatureFlagsResponse'] } } /** @description Failed to call feature flags */ @@ -18954,7 +19027,7 @@ export interface operations { } requestBody: { content: { - 'application/json': components['schemas']['TelemetryFeatureFlagBodyDto'] + 'application/json': components['schemas']['TelemetryFeatureFlagBody'] } } responses: { @@ -19066,7 +19139,7 @@ export interface operations { } requestBody: { content: { - 'application/json': components['schemas']['TelemetryPageBodyV2Dto'] + 'application/json': components['schemas']['TelemetryPageBodyV2'] } } responses: { @@ -19094,7 +19167,7 @@ export interface operations { } requestBody: { content: { - 'application/json': components['schemas']['TelemetryPageLeaveBodyDto'] + 'application/json': components['schemas']['TelemetryPageLeaveBody'] } } responses: { @@ -19105,12 +19178,6 @@ export interface operations { } content?: never } - 201: { - headers: { - [name: string]: unknown - } - content?: never - } /** @description Failed to send analytics page leave event */ 500: { headers: { @@ -19173,7 +19240,7 @@ export interface operations { } requestBody: { content: { - 'application/json': components['schemas']['UpdateEmailBodyDto'] + 'application/json': components['schemas']['UpdateEmailBody'] } } responses: { @@ -19202,9 +19269,7 @@ export interface operations { headers: { [name: string]: unknown } - content: { - 'application/json': Record[] - } + content?: never } /** @description Failed to get projects */ 500: { @@ -19234,9 +19299,7 @@ export interface operations { headers: { [name: string]: unknown } - content: { - 'application/json': Record - } + content?: never } /** @description Failed to get project */ 500: { @@ -19265,9 +19328,7 @@ export interface operations { headers: { [name: string]: unknown } - content: { - 'application/json': Record[] - } + content?: never } /** @description Failed to get Vercel environment variables */ 500: { @@ -19300,9 +19361,7 @@ export interface operations { headers: { [name: string]: unknown } - content: { - 'application/json': Record - } + content?: never } /** @description Failed to create Vercel environment variables */ 500: { diff --git a/packages/common/feature-flags.tsx b/packages/common/feature-flags.tsx index d05507c030a..91fe5b28e0b 100644 --- a/packages/common/feature-flags.tsx +++ b/packages/common/feature-flags.tsx @@ -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`) diff --git a/packages/common/telemetry.tsx b/packages/common/telemetry.tsx index d401d209d92..e0e00c0f511 100644 --- a/packages/common/telemetry.tsx +++ b/packages/common/telemetry.tsx @@ -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()