diff --git a/dashboard/CHANGELOG.md b/dashboard/CHANGELOG.md index aa2acfe442..cf1f98cf4c 100644 --- a/dashboard/CHANGELOG.md +++ b/dashboard/CHANGELOG.md @@ -1,5 +1,11 @@ # @nhost/dashboard +## 0.20.22 + +### Patch Changes + +- c3efb7ec8: feat(dashboard): query latest announcement from platform + ## 0.20.21 ### Patch Changes diff --git a/dashboard/package.json b/dashboard/package.json index aca8c82908..20e471626a 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -1,6 +1,6 @@ { "name": "@nhost/dashboard", - "version": "0.20.21", + "version": "0.20.22", "private": true, "scripts": { "preinstall": "npx only-allow pnpm", diff --git a/dashboard/src/features/projects/common/components/Announcements/Announcements.tsx b/dashboard/src/features/projects/common/components/Announcements/Announcements.tsx new file mode 100644 index 0000000000..5ffcd3090a --- /dev/null +++ b/dashboard/src/features/projects/common/components/Announcements/Announcements.tsx @@ -0,0 +1,47 @@ +import { List } from '@/components/ui/v2/List'; +import { ListItem } from '@/components/ui/v2/ListItem'; +import { Text } from '@/components/ui/v2/Text'; +import { useGetAnnouncementsQuery } from '@/utils/__generated__/graphql'; +import formatDistance from 'date-fns/formatDistance'; + +export default function Announcements() { + const { data, loading, error } = useGetAnnouncementsQuery(); + + const announcements = data?.announcements || []; + + if (loading || error) { + return null; + } + + return ( +
+ + Latest announcements + + + + {announcements.map((item) => ( + +
+ + + +

{item.content}

+
+
+
+
+ + ))} + +
+ ); +} diff --git a/dashboard/src/features/projects/common/components/Announcements/index.ts b/dashboard/src/features/projects/common/components/Announcements/index.ts new file mode 100644 index 0000000000..fb7f8b90ec --- /dev/null +++ b/dashboard/src/features/projects/common/components/Announcements/index.ts @@ -0,0 +1 @@ +export { default as Announcements } from './Announcements'; diff --git a/dashboard/src/features/projects/common/components/WorkspaceSidebar/WorkspaceSidebar.tsx b/dashboard/src/features/projects/common/components/WorkspaceSidebar/WorkspaceSidebar.tsx index cde18252e6..f7456ba030 100644 --- a/dashboard/src/features/projects/common/components/WorkspaceSidebar/WorkspaceSidebar.tsx +++ b/dashboard/src/features/projects/common/components/WorkspaceSidebar/WorkspaceSidebar.tsx @@ -8,6 +8,7 @@ import { PlusCircleIcon } from '@/components/ui/v2/icons/PlusCircleIcon'; import { List } from '@/components/ui/v2/List'; import { ListItem } from '@/components/ui/v2/ListItem'; import { Text } from '@/components/ui/v2/Text'; +import { Announcements } from '@/features/projects/common/components/Announcements'; import { EditWorkspaceNameForm } from '@/features/projects/workspaces/components/EditWorkspaceNameForm'; import type { Workspace } from '@/types/application'; import Image from 'next/image'; @@ -38,6 +39,8 @@ export default function WorkspaceSidebar({ )} {...props} > + +
My Workspaces diff --git a/dashboard/src/gql/platform/getAnnouncements.gql b/dashboard/src/gql/platform/getAnnouncements.gql new file mode 100644 index 0000000000..e0c9b2dee4 --- /dev/null +++ b/dashboard/src/gql/platform/getAnnouncements.gql @@ -0,0 +1,14 @@ +query getAnnouncements($limit: Int) { + announcements( + order_by: { createdAt: desc } + limit: $limit + where: { + _or: [{ expiresAt: { _is_null: true } }, { expiresAt: { _gt: now } }] + } + ) { + id + href + content + createdAt + } +} diff --git a/dashboard/src/pages/_app.tsx b/dashboard/src/pages/_app.tsx index e892eafbac..d5c5330a61 100644 --- a/dashboard/src/pages/_app.tsx +++ b/dashboard/src/pages/_app.tsx @@ -1,4 +1,3 @@ -import AnnouncementProvider from '@/components/common/Announcement/AnnouncementProvider'; import { DialogProvider } from '@/components/common/DialogProvider'; import { UIProvider } from '@/components/common/UIProvider'; import { RetryableErrorBoundary } from '@/components/presentational/RetryableErrorBoundary'; @@ -106,9 +105,7 @@ function MyApp({ > - - {getLayout()} - + {getLayout()} diff --git a/dashboard/src/utils/__generated__/graphql.ts b/dashboard/src/utils/__generated__/graphql.ts index 86aad29fa0..3de901411c 100644 --- a/dashboard/src/utils/__generated__/graphql.ts +++ b/dashboard/src/utils/__generated__/graphql.ts @@ -15,6 +15,7 @@ export type Scalars = { Float: number; ConfigEmail: any; ConfigHasuraAPIs: any; + ConfigInt32: any; ConfigLocale: any; ConfigPort: any; ConfigRunServiceName: any; @@ -1030,6 +1031,13 @@ export type ConfigEnvironmentVariableUpdateInput = { value?: InputMaybe; }; +export type ConfigFloatComparisonExp = { + _eq?: InputMaybe; + _in?: InputMaybe>; + _neq?: InputMaybe; + _nin?: InputMaybe>; +}; + /** Configuration for functions service */ export type ConfigFunctions = { __typename?: 'ConfigFunctions'; @@ -1229,6 +1237,8 @@ export type ConfigHasuraSettings = { enableRemoteSchemaPermissions?: Maybe; /** HASURA_GRAPHQL_ENABLED_APIS */ enabledAPIs?: Maybe>; + /** HASURA_GRAPHQL_LIVE_QUERIES_MULTIPLEXED_REFETCH_INTERVAL */ + liveQueriesMultiplexedRefetchInterval?: Maybe; }; export type ConfigHasuraSettingsComparisonExp = { @@ -1241,6 +1251,7 @@ export type ConfigHasuraSettingsComparisonExp = { enableConsole?: InputMaybe; enableRemoteSchemaPermissions?: InputMaybe; enabledAPIs?: InputMaybe; + liveQueriesMultiplexedRefetchInterval?: InputMaybe; }; export type ConfigHasuraSettingsInsertInput = { @@ -1250,6 +1261,7 @@ export type ConfigHasuraSettingsInsertInput = { enableConsole?: InputMaybe; enableRemoteSchemaPermissions?: InputMaybe; enabledAPIs?: InputMaybe>; + liveQueriesMultiplexedRefetchInterval?: InputMaybe; }; export type ConfigHasuraSettingsUpdateInput = { @@ -1259,6 +1271,7 @@ export type ConfigHasuraSettingsUpdateInput = { enableConsole?: InputMaybe; enableRemoteSchemaPermissions?: InputMaybe; enabledAPIs?: InputMaybe>; + liveQueriesMultiplexedRefetchInterval?: InputMaybe; }; export type ConfigHasuraUpdateInput = { @@ -1279,6 +1292,13 @@ export type ConfigInsertConfigResponse = { systemConfig: ConfigSystemConfig; }; +export type ConfigInt32ComparisonExp = { + _eq?: InputMaybe; + _in?: InputMaybe>; + _neq?: InputMaybe; + _nin?: InputMaybe>; +}; + export type ConfigIntComparisonExp = { _eq?: InputMaybe; _in?: InputMaybe>; @@ -1386,6 +1406,7 @@ export type ConfigPostgres = { __typename?: 'ConfigPostgres'; /** Resources for the service */ resources?: Maybe; + settings?: Maybe; /** * Version of postgres, you can see available versions in the URL below: * https://hub.docker.com/r/nhost/postgres/tags @@ -1398,16 +1419,107 @@ export type ConfigPostgresComparisonExp = { _not?: InputMaybe; _or?: InputMaybe>; resources?: InputMaybe; + settings?: InputMaybe; version?: InputMaybe; }; export type ConfigPostgresInsertInput = { resources?: InputMaybe; + settings?: InputMaybe; version?: InputMaybe; }; +export type ConfigPostgresSettings = { + __typename?: 'ConfigPostgresSettings'; + checkpointCompletionTarget?: Maybe; + defaultStatisticsTarget?: Maybe; + effectiveCacheSize?: Maybe; + effectiveIOConcurrency?: Maybe; + hugePages?: Maybe; + jit?: Maybe; + maintenanceWorkMem?: Maybe; + maxConnections?: Maybe; + maxParallelMaintenanceWorkers?: Maybe; + maxParallelWorkers?: Maybe; + maxParallelWorkersPerGather?: Maybe; + maxWalSize?: Maybe; + maxWorkerProcesses?: Maybe; + minWalSize?: Maybe; + randomPageCost?: Maybe; + sharedBuffers?: Maybe; + walBuffers?: Maybe; + workMem?: Maybe; +}; + +export type ConfigPostgresSettingsComparisonExp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + checkpointCompletionTarget?: InputMaybe; + defaultStatisticsTarget?: InputMaybe; + effectiveCacheSize?: InputMaybe; + effectiveIOConcurrency?: InputMaybe; + hugePages?: InputMaybe; + jit?: InputMaybe; + maintenanceWorkMem?: InputMaybe; + maxConnections?: InputMaybe; + maxParallelMaintenanceWorkers?: InputMaybe; + maxParallelWorkers?: InputMaybe; + maxParallelWorkersPerGather?: InputMaybe; + maxWalSize?: InputMaybe; + maxWorkerProcesses?: InputMaybe; + minWalSize?: InputMaybe; + randomPageCost?: InputMaybe; + sharedBuffers?: InputMaybe; + walBuffers?: InputMaybe; + workMem?: InputMaybe; +}; + +export type ConfigPostgresSettingsInsertInput = { + checkpointCompletionTarget?: InputMaybe; + defaultStatisticsTarget?: InputMaybe; + effectiveCacheSize?: InputMaybe; + effectiveIOConcurrency?: InputMaybe; + hugePages?: InputMaybe; + jit?: InputMaybe; + maintenanceWorkMem?: InputMaybe; + maxConnections?: InputMaybe; + maxParallelMaintenanceWorkers?: InputMaybe; + maxParallelWorkers?: InputMaybe; + maxParallelWorkersPerGather?: InputMaybe; + maxWalSize?: InputMaybe; + maxWorkerProcesses?: InputMaybe; + minWalSize?: InputMaybe; + randomPageCost?: InputMaybe; + sharedBuffers?: InputMaybe; + walBuffers?: InputMaybe; + workMem?: InputMaybe; +}; + +export type ConfigPostgresSettingsUpdateInput = { + checkpointCompletionTarget?: InputMaybe; + defaultStatisticsTarget?: InputMaybe; + effectiveCacheSize?: InputMaybe; + effectiveIOConcurrency?: InputMaybe; + hugePages?: InputMaybe; + jit?: InputMaybe; + maintenanceWorkMem?: InputMaybe; + maxConnections?: InputMaybe; + maxParallelMaintenanceWorkers?: InputMaybe; + maxParallelWorkers?: InputMaybe; + maxParallelWorkersPerGather?: InputMaybe; + maxWalSize?: InputMaybe; + maxWorkerProcesses?: InputMaybe; + minWalSize?: InputMaybe; + randomPageCost?: InputMaybe; + sharedBuffers?: InputMaybe; + walBuffers?: InputMaybe; + workMem?: InputMaybe; +}; + export type ConfigPostgresUpdateInput = { resources?: InputMaybe; + settings?: InputMaybe; version?: InputMaybe; }; @@ -2133,6 +2245,188 @@ export type UsageSummary = { appID: Scalars['uuid']; }; +/** columns and relationships of "announcements" */ +export type Announcements = { + __typename?: 'announcements'; + content: Scalars['String']; + createdAt: Scalars['timestamptz']; + expiresAt?: Maybe; + href: Scalars['String']; + id: Scalars['uuid']; + updatedAt: Scalars['timestamptz']; +}; + +/** aggregated selection of "announcements" */ +export type Announcements_Aggregate = { + __typename?: 'announcements_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "announcements" */ +export type Announcements_Aggregate_Fields = { + __typename?: 'announcements_aggregate_fields'; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; +}; + + +/** aggregate fields of "announcements" */ +export type Announcements_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** Boolean expression to filter rows from the table "announcements". All fields are combined with a logical 'AND'. */ +export type Announcements_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + content?: InputMaybe; + createdAt?: InputMaybe; + expiresAt?: InputMaybe; + href?: InputMaybe; + id?: InputMaybe; + updatedAt?: InputMaybe; +}; + +/** unique or primary key constraints on table "announcements" */ +export enum Announcements_Constraint { + /** unique or primary key constraint on columns "id" */ + AnnouncementsPkey = 'announcements_pkey' +} + +/** input type for inserting data into table "announcements" */ +export type Announcements_Insert_Input = { + content?: InputMaybe; + createdAt?: InputMaybe; + expiresAt?: InputMaybe; + href?: InputMaybe; + id?: InputMaybe; + updatedAt?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Announcements_Max_Fields = { + __typename?: 'announcements_max_fields'; + content?: Maybe; + createdAt?: Maybe; + expiresAt?: Maybe; + href?: Maybe; + id?: Maybe; + updatedAt?: Maybe; +}; + +/** aggregate min on columns */ +export type Announcements_Min_Fields = { + __typename?: 'announcements_min_fields'; + content?: Maybe; + createdAt?: Maybe; + expiresAt?: Maybe; + href?: Maybe; + id?: Maybe; + updatedAt?: Maybe; +}; + +/** response of any mutation on the table "announcements" */ +export type Announcements_Mutation_Response = { + __typename?: 'announcements_mutation_response'; + /** number of rows affected by the mutation */ + affected_rows: Scalars['Int']; + /** data from the rows affected by the mutation */ + returning: Array; +}; + +/** on_conflict condition type for table "announcements" */ +export type Announcements_On_Conflict = { + constraint: Announcements_Constraint; + update_columns?: Array; + where?: InputMaybe; +}; + +/** Ordering options when selecting data from "announcements". */ +export type Announcements_Order_By = { + content?: InputMaybe; + createdAt?: InputMaybe; + expiresAt?: InputMaybe; + href?: InputMaybe; + id?: InputMaybe; + updatedAt?: InputMaybe; +}; + +/** primary key columns input for table: announcements */ +export type Announcements_Pk_Columns_Input = { + id: Scalars['uuid']; +}; + +/** select columns of table "announcements" */ +export enum Announcements_Select_Column { + /** column name */ + Content = 'content', + /** column name */ + CreatedAt = 'createdAt', + /** column name */ + ExpiresAt = 'expiresAt', + /** column name */ + Href = 'href', + /** column name */ + Id = 'id', + /** column name */ + UpdatedAt = 'updatedAt' +} + +/** input type for updating data in table "announcements" */ +export type Announcements_Set_Input = { + content?: InputMaybe; + createdAt?: InputMaybe; + expiresAt?: InputMaybe; + href?: InputMaybe; + id?: InputMaybe; + updatedAt?: InputMaybe; +}; + +/** Streaming cursor of the table "announcements" */ +export type Announcements_Stream_Cursor_Input = { + /** Stream column input with initial value */ + initial_value: Announcements_Stream_Cursor_Value_Input; + /** cursor ordering */ + ordering?: InputMaybe; +}; + +/** Initial value of the column from where the streaming should start */ +export type Announcements_Stream_Cursor_Value_Input = { + content?: InputMaybe; + createdAt?: InputMaybe; + expiresAt?: InputMaybe; + href?: InputMaybe; + id?: InputMaybe; + updatedAt?: InputMaybe; +}; + +/** update columns of table "announcements" */ +export enum Announcements_Update_Column { + /** column name */ + Content = 'content', + /** column name */ + CreatedAt = 'createdAt', + /** column name */ + ExpiresAt = 'expiresAt', + /** column name */ + Href = 'href', + /** column name */ + Id = 'id', + /** column name */ + UpdatedAt = 'updatedAt' +} + +export type Announcements_Updates = { + /** sets the columns of the filtered rows to the given values */ + _set?: InputMaybe; + /** filter the rows which have to be updated */ + where: Announcements_Bool_Exp; +}; + /** columns and relationships of "app_state_history" */ export type AppStateHistory = { __typename?: 'appStateHistory'; @@ -2737,7 +3031,6 @@ export type Apps = { appStates: Array; /** An aggregate relationship */ appStates_aggregate: AppStateHistory_Aggregate; - autoUpdate: Scalars['Boolean']; /** An array relationship */ backups: Array; /** An aggregate relationship */ @@ -2769,15 +3062,14 @@ export type Apps = { githubRepository?: Maybe; githubRepositoryId?: Maybe; id: Scalars['uuid']; - isProvisioned: Scalars['Boolean']; + isLocked?: Maybe; + isLockedReason?: Maybe; metadataFunctions: Scalars['jsonb']; mimirConfigEnc?: Maybe; mimirSecretsEnc?: Maybe; mimirSystemConfigEnc?: Maybe; name: Scalars['String']; nhostBaseFolder: Scalars['String']; - /** whether or not this app is paused */ - paused: Scalars['Boolean']; /** An object relationship */ plan: Plans; planId: Scalars['uuid']; @@ -3017,7 +3309,6 @@ export type Apps_Bool_Exp = { _or?: InputMaybe>; appStates?: InputMaybe; appStates_aggregate?: InputMaybe; - autoUpdate?: InputMaybe; backups?: InputMaybe; backups_aggregate?: InputMaybe; billingDedicatedCompute?: InputMaybe; @@ -3036,14 +3327,14 @@ export type Apps_Bool_Exp = { githubRepository?: InputMaybe; githubRepositoryId?: InputMaybe; id?: InputMaybe; - isProvisioned?: InputMaybe; + isLocked?: InputMaybe; + isLockedReason?: InputMaybe; metadataFunctions?: InputMaybe; mimirConfigEnc?: InputMaybe; mimirSecretsEnc?: InputMaybe; mimirSystemConfigEnc?: InputMaybe; name?: InputMaybe; nhostBaseFolder?: InputMaybe; - paused?: InputMaybe; plan?: InputMaybe; planId?: InputMaybe; providersUpdated?: InputMaybe; @@ -3095,7 +3386,6 @@ export type Apps_Inc_Input = { /** input type for inserting data into table "apps" */ export type Apps_Insert_Input = { appStates?: InputMaybe; - autoUpdate?: InputMaybe; backups?: InputMaybe; billingDedicatedCompute?: InputMaybe; billingDedicatedComputeReports?: InputMaybe; @@ -3111,15 +3401,14 @@ export type Apps_Insert_Input = { githubRepository?: InputMaybe; githubRepositoryId?: InputMaybe; id?: InputMaybe; - isProvisioned?: InputMaybe; + isLocked?: InputMaybe; + isLockedReason?: InputMaybe; metadataFunctions?: InputMaybe; mimirConfigEnc?: InputMaybe; mimirSecretsEnc?: InputMaybe; mimirSystemConfigEnc?: InputMaybe; name?: InputMaybe; nhostBaseFolder?: InputMaybe; - /** whether or not this app is paused */ - paused?: InputMaybe; plan?: InputMaybe; planId?: InputMaybe; providersUpdated?: InputMaybe; @@ -3144,6 +3433,7 @@ export type Apps_Max_Fields = { desiredState?: Maybe; githubRepositoryId?: Maybe; id?: Maybe; + isLockedReason?: Maybe; mimirConfigEnc?: Maybe; mimirSecretsEnc?: Maybe; mimirSystemConfigEnc?: Maybe; @@ -3167,6 +3457,7 @@ export type Apps_Max_Order_By = { desiredState?: InputMaybe; githubRepositoryId?: InputMaybe; id?: InputMaybe; + isLockedReason?: InputMaybe; mimirConfigEnc?: InputMaybe; mimirSecretsEnc?: InputMaybe; mimirSystemConfigEnc?: InputMaybe; @@ -3191,6 +3482,7 @@ export type Apps_Min_Fields = { desiredState?: Maybe; githubRepositoryId?: Maybe; id?: Maybe; + isLockedReason?: Maybe; mimirConfigEnc?: Maybe; mimirSecretsEnc?: Maybe; mimirSystemConfigEnc?: Maybe; @@ -3214,6 +3506,7 @@ export type Apps_Min_Order_By = { desiredState?: InputMaybe; githubRepositoryId?: InputMaybe; id?: InputMaybe; + isLockedReason?: InputMaybe; mimirConfigEnc?: InputMaybe; mimirSecretsEnc?: InputMaybe; mimirSystemConfigEnc?: InputMaybe; @@ -3255,7 +3548,6 @@ export type Apps_On_Conflict = { /** Ordering options when selecting data from "apps". */ export type Apps_Order_By = { appStates_aggregate?: InputMaybe; - autoUpdate?: InputMaybe; backups_aggregate?: InputMaybe; billingDedicatedCompute?: InputMaybe; billingDedicatedComputeReports?: InputMaybe; @@ -3271,14 +3563,14 @@ export type Apps_Order_By = { githubRepository?: InputMaybe; githubRepositoryId?: InputMaybe; id?: InputMaybe; - isProvisioned?: InputMaybe; + isLocked?: InputMaybe; + isLockedReason?: InputMaybe; metadataFunctions?: InputMaybe; mimirConfigEnc?: InputMaybe; mimirSecretsEnc?: InputMaybe; mimirSystemConfigEnc?: InputMaybe; name?: InputMaybe; nhostBaseFolder?: InputMaybe; - paused?: InputMaybe; plan?: InputMaybe; planId?: InputMaybe; providersUpdated?: InputMaybe; @@ -3307,8 +3599,6 @@ export type Apps_Prepend_Input = { /** select columns of table "apps" */ export enum Apps_Select_Column { - /** column name */ - AutoUpdate = 'autoUpdate', /** column name */ CreatedAt = 'createdAt', /** column name */ @@ -3322,7 +3612,9 @@ export enum Apps_Select_Column { /** column name */ Id = 'id', /** column name */ - IsProvisioned = 'isProvisioned', + IsLocked = 'isLocked', + /** column name */ + IsLockedReason = 'isLockedReason', /** column name */ MetadataFunctions = 'metadataFunctions', /** column name */ @@ -3336,8 +3628,6 @@ export enum Apps_Select_Column { /** column name */ NhostBaseFolder = 'nhostBaseFolder', /** column name */ - Paused = 'paused', - /** column name */ PlanId = 'planId', /** column name */ ProvidersUpdated = 'providersUpdated', @@ -3362,11 +3652,7 @@ export enum Apps_Select_Column { /** select "apps_aggregate_bool_exp_bool_and_arguments_columns" columns of table "apps" */ export enum Apps_Select_Column_Apps_Aggregate_Bool_Exp_Bool_And_Arguments_Columns { /** column name */ - AutoUpdate = 'autoUpdate', - /** column name */ - IsProvisioned = 'isProvisioned', - /** column name */ - Paused = 'paused', + IsLocked = 'isLocked', /** column name */ ProvidersUpdated = 'providersUpdated', /** column name */ @@ -3376,11 +3662,7 @@ export enum Apps_Select_Column_Apps_Aggregate_Bool_Exp_Bool_And_Arguments_Column /** select "apps_aggregate_bool_exp_bool_or_arguments_columns" columns of table "apps" */ export enum Apps_Select_Column_Apps_Aggregate_Bool_Exp_Bool_Or_Arguments_Columns { /** column name */ - AutoUpdate = 'autoUpdate', - /** column name */ - IsProvisioned = 'isProvisioned', - /** column name */ - Paused = 'paused', + IsLocked = 'isLocked', /** column name */ ProvidersUpdated = 'providersUpdated', /** column name */ @@ -3389,22 +3671,20 @@ export enum Apps_Select_Column_Apps_Aggregate_Bool_Exp_Bool_Or_Arguments_Columns /** input type for updating data in table "apps" */ export type Apps_Set_Input = { - autoUpdate?: InputMaybe; createdAt?: InputMaybe; creatorUserId?: InputMaybe; currentState?: InputMaybe; desiredState?: InputMaybe; githubRepositoryId?: InputMaybe; id?: InputMaybe; - isProvisioned?: InputMaybe; + isLocked?: InputMaybe; + isLockedReason?: InputMaybe; metadataFunctions?: InputMaybe; mimirConfigEnc?: InputMaybe; mimirSecretsEnc?: InputMaybe; mimirSystemConfigEnc?: InputMaybe; name?: InputMaybe; nhostBaseFolder?: InputMaybe; - /** whether or not this app is paused */ - paused?: InputMaybe; planId?: InputMaybe; providersUpdated?: InputMaybe; regionId?: InputMaybe; @@ -3465,22 +3745,20 @@ export type Apps_Stream_Cursor_Input = { /** Initial value of the column from where the streaming should start */ export type Apps_Stream_Cursor_Value_Input = { - autoUpdate?: InputMaybe; createdAt?: InputMaybe; creatorUserId?: InputMaybe; currentState?: InputMaybe; desiredState?: InputMaybe; githubRepositoryId?: InputMaybe; id?: InputMaybe; - isProvisioned?: InputMaybe; + isLocked?: InputMaybe; + isLockedReason?: InputMaybe; metadataFunctions?: InputMaybe; mimirConfigEnc?: InputMaybe; mimirSecretsEnc?: InputMaybe; mimirSystemConfigEnc?: InputMaybe; name?: InputMaybe; nhostBaseFolder?: InputMaybe; - /** whether or not this app is paused */ - paused?: InputMaybe; planId?: InputMaybe; providersUpdated?: InputMaybe; regionId?: InputMaybe; @@ -3508,8 +3786,6 @@ export type Apps_Sum_Order_By = { /** update columns of table "apps" */ export enum Apps_Update_Column { - /** column name */ - AutoUpdate = 'autoUpdate', /** column name */ CreatedAt = 'createdAt', /** column name */ @@ -3523,7 +3799,9 @@ export enum Apps_Update_Column { /** column name */ Id = 'id', /** column name */ - IsProvisioned = 'isProvisioned', + IsLocked = 'isLocked', + /** column name */ + IsLockedReason = 'isLockedReason', /** column name */ MetadataFunctions = 'metadataFunctions', /** column name */ @@ -3537,8 +3815,6 @@ export enum Apps_Update_Column { /** column name */ NhostBaseFolder = 'nhostBaseFolder', /** column name */ - Paused = 'paused', - /** column name */ PlanId = 'planId', /** column name */ ProvidersUpdated = 'providersUpdated', @@ -4132,7 +4408,6 @@ export type AuthRefreshTokens = { id: Scalars['uuid']; metadata?: Maybe; refreshTokenHash?: Maybe; - refresh_token?: Maybe; type: AuthRefreshTokenTypes_Enum; /** An object relationship */ user: Users; @@ -4207,7 +4482,6 @@ export type AuthRefreshTokens_Bool_Exp = { id?: InputMaybe; metadata?: InputMaybe; refreshTokenHash?: InputMaybe; - refresh_token?: InputMaybe; type?: InputMaybe; user?: InputMaybe; userId?: InputMaybe; @@ -4241,7 +4515,6 @@ export type AuthRefreshTokens_Insert_Input = { id?: InputMaybe; metadata?: InputMaybe; refreshTokenHash?: InputMaybe; - refresh_token?: InputMaybe; type?: InputMaybe; user?: InputMaybe; userId?: InputMaybe; @@ -4254,7 +4527,6 @@ export type AuthRefreshTokens_Max_Fields = { expiresAt?: Maybe; id?: Maybe; refreshTokenHash?: Maybe; - refresh_token?: Maybe; userId?: Maybe; }; @@ -4264,7 +4536,6 @@ export type AuthRefreshTokens_Max_Order_By = { expiresAt?: InputMaybe; id?: InputMaybe; refreshTokenHash?: InputMaybe; - refresh_token?: InputMaybe; userId?: InputMaybe; }; @@ -4275,7 +4546,6 @@ export type AuthRefreshTokens_Min_Fields = { expiresAt?: Maybe; id?: Maybe; refreshTokenHash?: Maybe; - refresh_token?: Maybe; userId?: Maybe; }; @@ -4285,7 +4555,6 @@ export type AuthRefreshTokens_Min_Order_By = { expiresAt?: InputMaybe; id?: InputMaybe; refreshTokenHash?: InputMaybe; - refresh_token?: InputMaybe; userId?: InputMaybe; }; @@ -4312,7 +4581,6 @@ export type AuthRefreshTokens_Order_By = { id?: InputMaybe; metadata?: InputMaybe; refreshTokenHash?: InputMaybe; - refresh_token?: InputMaybe; type?: InputMaybe; user?: InputMaybe; userId?: InputMaybe; @@ -4341,8 +4609,6 @@ export enum AuthRefreshTokens_Select_Column { /** column name */ RefreshTokenHash = 'refreshTokenHash', /** column name */ - RefreshToken = 'refresh_token', - /** column name */ Type = 'type', /** column name */ UserId = 'userId' @@ -4355,7 +4621,6 @@ export type AuthRefreshTokens_Set_Input = { id?: InputMaybe; metadata?: InputMaybe; refreshTokenHash?: InputMaybe; - refresh_token?: InputMaybe; type?: InputMaybe; userId?: InputMaybe; }; @@ -4375,7 +4640,6 @@ export type AuthRefreshTokens_Stream_Cursor_Value_Input = { id?: InputMaybe; metadata?: InputMaybe; refreshTokenHash?: InputMaybe; - refresh_token?: InputMaybe; type?: InputMaybe; userId?: InputMaybe; }; @@ -4393,8 +4657,6 @@ export enum AuthRefreshTokens_Update_Column { /** column name */ RefreshTokenHash = 'refreshTokenHash', /** column name */ - RefreshToken = 'refresh_token', - /** column name */ Type = 'type', /** column name */ UserId = 'userId' @@ -11190,6 +11452,10 @@ export type Mutation_Root = { deleteWorkspaceMembers?: Maybe; /** delete data from the table: "workspaces" */ deleteWorkspaces?: Maybe; + /** delete data from the table: "announcements" */ + delete_announcements?: Maybe; + /** delete single row from the table: "announcements" */ + delete_announcements_by_pk?: Maybe; /** delete data from the table: "auth.migrations" */ delete_auth_migrations?: Maybe; /** delete single row from the table: "auth.migrations" */ @@ -11357,6 +11623,10 @@ export type Mutation_Root = { insertWorkspaceMembers?: Maybe; /** insert data into the table: "workspaces" */ insertWorkspaces?: Maybe; + /** insert data into the table: "announcements" */ + insert_announcements?: Maybe; + /** insert a single row into the table: "announcements" */ + insert_announcements_one?: Maybe; /** insert data into the table: "auth.migrations" */ insert_auth_migrations?: Maybe; /** insert a single row into the table: "auth.migrations" */ @@ -11538,6 +11808,12 @@ export type Mutation_Root = { updateWorkspaceMembers?: Maybe; /** update data of the table: "workspaces" */ updateWorkspaces?: Maybe; + /** update data of the table: "announcements" */ + update_announcements?: Maybe; + /** update single row of the table: "announcements" */ + update_announcements_by_pk?: Maybe; + /** update multiples rows of table: "announcements" */ + update_announcements_many?: Maybe>>; /** update multiples rows of table: "app_state_history" */ update_appStateHistory_many?: Maybe>>; /** update multiples rows of table: "app_states" */ @@ -12136,6 +12412,18 @@ export type Mutation_RootDeleteWorkspacesArgs = { }; +/** mutation root */ +export type Mutation_RootDelete_AnnouncementsArgs = { + where: Announcements_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootDelete_Announcements_By_PkArgs = { + id: Scalars['uuid']; +}; + + /** mutation root */ export type Mutation_RootDelete_Auth_MigrationsArgs = { where: Auth_Migrations_Bool_Exp; @@ -12722,6 +13010,20 @@ export type Mutation_RootInsertWorkspacesArgs = { }; +/** mutation root */ +export type Mutation_RootInsert_AnnouncementsArgs = { + objects: Array; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_Announcements_OneArgs = { + object: Announcements_Insert_Input; + on_conflict?: InputMaybe; +}; + + /** mutation root */ export type Mutation_RootInsert_Auth_MigrationsArgs = { objects: Array; @@ -13457,6 +13759,26 @@ export type Mutation_RootUpdateWorkspacesArgs = { }; +/** mutation root */ +export type Mutation_RootUpdate_AnnouncementsArgs = { + _set?: InputMaybe; + where: Announcements_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Announcements_By_PkArgs = { + _set?: InputMaybe; + pk_columns: Announcements_Pk_Columns_Input; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Announcements_ManyArgs = { + updates: Array; +}; + + /** mutation root */ export type Mutation_RootUpdate_AppStateHistory_ManyArgs = { updates: Array; @@ -14789,6 +15111,12 @@ export type Plans_Variance_Fields = { export type Query_Root = { __typename?: 'query_root'; + /** fetch data from the table: "announcements" */ + announcements: Array; + /** fetch aggregated fields from the table: "announcements" */ + announcements_aggregate: Announcements_Aggregate; + /** fetch data from the table: "announcements" using primary key columns */ + announcements_by_pk?: Maybe; /** fetch data from the table: "apps" using primary key columns */ app?: Maybe; appSecrets: Array; @@ -15077,6 +15405,29 @@ export type Query_Root = { }; +export type Query_RootAnnouncementsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootAnnouncements_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootAnnouncements_By_PkArgs = { + id: Scalars['uuid']; +}; + + export type Query_RootAppArgs = { id: Scalars['uuid']; }; @@ -17658,6 +18009,14 @@ export type Software_Versions_Updates = { export type Subscription_Root = { __typename?: 'subscription_root'; + /** fetch data from the table: "announcements" */ + announcements: Array; + /** fetch aggregated fields from the table: "announcements" */ + announcements_aggregate: Announcements_Aggregate; + /** fetch data from the table: "announcements" using primary key columns */ + announcements_by_pk?: Maybe; + /** fetch data from the table in a streaming manner: "announcements" */ + announcements_stream: Array; /** fetch data from the table: "apps" using primary key columns */ app?: Maybe; /** fetch data from the table: "app_states" using primary key columns */ @@ -18002,6 +18361,36 @@ export type Subscription_Root = { }; +export type Subscription_RootAnnouncementsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootAnnouncements_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootAnnouncements_By_PkArgs = { + id: Scalars['uuid']; +}; + + +export type Subscription_RootAnnouncements_StreamArgs = { + batch_size: Scalars['Int']; + cursor: Array>; + where?: InputMaybe; +}; + + export type Subscription_RootAppArgs = { id: Scalars['uuid']; }; @@ -21982,6 +22371,13 @@ export type SetNewDefaultPaymentMethodMutationVariables = Exact<{ export type SetNewDefaultPaymentMethodMutation = { __typename?: 'mutation_root', setAllPaymentMethodToDefaultFalse?: { __typename?: 'paymentMethods_mutation_response', affected_rows: number } | null, updatePaymentMethods?: { __typename?: 'paymentMethods_mutation_response', affected_rows: number } | null }; +export type GetAnnouncementsQueryVariables = Exact<{ + limit?: InputMaybe; +}>; + + +export type GetAnnouncementsQuery = { __typename?: 'query_root', announcements: Array<{ __typename?: 'announcements', id: any, href: string, content: string, createdAt: any }> }; + export type GetPlansQueryVariables = Exact<{ where?: InputMaybe; }>; @@ -24740,6 +25136,51 @@ export function useSetNewDefaultPaymentMethodMutation(baseOptions?: Apollo.Mutat export type SetNewDefaultPaymentMethodMutationHookResult = ReturnType; export type SetNewDefaultPaymentMethodMutationResult = Apollo.MutationResult; export type SetNewDefaultPaymentMethodMutationOptions = Apollo.BaseMutationOptions; +export const GetAnnouncementsDocument = gql` + query getAnnouncements($limit: Int) { + announcements( + order_by: {createdAt: desc} + limit: $limit + where: {_or: [{expiresAt: {_is_null: true}}, {expiresAt: {_gt: now}}]} + ) { + id + href + content + createdAt + } +} + `; + +/** + * __useGetAnnouncementsQuery__ + * + * To run a query within a React component, call `useGetAnnouncementsQuery` and pass it any options that fit your needs. + * When your component renders, `useGetAnnouncementsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetAnnouncementsQuery({ + * variables: { + * limit: // value for 'limit' + * }, + * }); + */ +export function useGetAnnouncementsQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetAnnouncementsDocument, options); + } +export function useGetAnnouncementsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetAnnouncementsDocument, options); + } +export type GetAnnouncementsQueryHookResult = ReturnType; +export type GetAnnouncementsLazyQueryHookResult = ReturnType; +export type GetAnnouncementsQueryResult = Apollo.QueryResult; +export function refetchGetAnnouncementsQuery(variables?: GetAnnouncementsQueryVariables) { + return { query: GetAnnouncementsDocument, variables: variables } + } export const GetPlansDocument = gql` query GetPlans($where: plans_bool_exp) { plans(where: $where) {