Compare commits

...

73 Commits

Author SHA1 Message Date
Szilárd Dóró
8a4ca41172 Merge pull request #1754 from nhost/changeset-release/main
chore: update versions
2023-03-20 11:33:21 +01:00
github-actions[bot]
fd3ce98600 chore: update versions 2023-03-20 10:08:17 +00:00
Szilárd Dóró
04f36a0491 Merge pull request #1669 from nhost/new-create-app-mutation
feat(dashboard): Limit Free Projects
2023-03-20 11:05:30 +01:00
Szilárd Dóró
5e2ecb4d1e Merge pull request #1749 from nhost/changeset-release/main
chore: update versions
2023-03-20 10:00:29 +01:00
github-actions[bot]
52ebbef762 chore: update versions 2023-03-17 15:01:14 +00:00
Szilárd Dóró
82faa4ca0a Merge pull request #1748 from nhost/fix/presigned-url-params
fix(hasura-storage-js): allow image transformation parameters in `getPresignedUrl`
2023-03-17 15:58:38 +01:00
Szilárd Dóró
d06a21764a fix unit tests 2023-03-17 15:10:15 +01:00
Szilárd Dóró
8b54d290a5 Merge pull request #1747 from nhost/changeset-release/main
chore: update versions
2023-03-17 14:51:41 +01:00
Szilárd Dóró
4cfa6bbe1e chore: update changeset 2023-03-17 14:12:48 +01:00
Szilárd Dóró
614f213e26 feat: allow image transformation parameters in getPresignedUrl 2023-03-17 14:11:17 +01:00
github-actions[bot]
4eebf51821 chore: update versions 2023-03-17 11:29:52 +00:00
Szilárd Dóró
9a52298aa7 Merge pull request #1746 from nhost/fix/data-grid-date-cell
fix(dashboard): show correct date in data grid
2023-03-17 12:28:34 +01:00
Szilárd Dóró
099eebe602 Merge pull request #1745 from nhost/fix/disable-new-users
fix(dashboard): disable new users
2023-03-17 12:20:38 +01:00
Szilárd Dóró
7cce8652e7 chore: update response message for pausing 2023-03-17 12:20:16 +01:00
Szilárd Dóró
f2e2323801 fix: refresh list when deleting app 2023-03-17 12:09:41 +01:00
Szilárd Dóró
4e16de6db2 chore: cleanup, improve error messages 2023-03-17 12:01:11 +01:00
Szilárd Dóró
798e591b1d fix: show correct date in data grid 2023-03-17 10:19:39 +01:00
Szilárd Dóró
b48bc034ca chore: add changeset 2023-03-17 10:01:26 +01:00
Szilárd Dóró
f57819230b fix: disable new users 2023-03-17 10:00:25 +01:00
Szilárd Dóró
3d8067ff7b fix: show pausing only for free projects
- improve project list
2023-03-17 09:44:02 +01:00
Szilárd Dóró
0fa4b428a9 chore: change function to string 2023-03-16 15:04:13 +01:00
Szilárd Dóró
8c5864340e fix: fix build error 2023-03-16 14:57:25 +01:00
Szilárd Dóró
c131100af9 chore: fetch free and live apps separately 2023-03-16 14:52:35 +01:00
Szilárd Dóró
e363fef8cf fix: refetch projects after delete/pause 2023-03-16 13:11:28 +01:00
Szilárd Dóró
d8072101c8 feat: added pause section to settings 2023-03-16 13:03:11 +01:00
Szilárd Dóró
afbba531a1 Merge branch 'main' into new-create-app-mutation 2023-03-16 10:28:02 +01:00
Szilárd Dóró
4b6df8b9d6 Merge pull request #1731 from nhost/changeset-release/main
chore: update versions
2023-03-16 10:23:45 +01:00
Szilárd Dóró
a2af5a674d fix(deps): fix @nhost/apollo version 2023-03-16 09:55:43 +01:00
github-actions[bot]
c33c1fd6b9 chore: update versions 2023-03-16 08:37:32 +00:00
Szilárd Dóró
041d9b98e3 Merge pull request #1741 from nhost/renovate/stripe-react-stripe-js-2.x
fix(deps): update dependency @stripe/react-stripe-js to v2
2023-03-16 09:37:26 +01:00
Szilárd Dóró
e4b4940397 Merge pull request #1730 from nhost/chore/remove-axios-deprecation
fix: remove `useAxios`, restore autogenerated docs
2023-03-16 09:36:09 +01:00
renovate[bot]
be91f4ed2a fix(deps): update dependency @stripe/react-stripe-js to v2 2023-03-13 22:14:47 +00:00
Siarhei Lipchyk
ec6ba846cf Merge pull request #1732 from nhost/chore/dashboard-hasura-admin-secret
Allow to override hasura admin secret in docker
2023-03-13 10:01:47 +01:00
Siarhei Lipchyk
d8d8394b3b Allow to override hasura admin secret in docker 2023-03-10 13:11:02 +01:00
Szilárd Dóró
f051a121b2 Merge pull request #1729 from nhost/fix/sdk-backend-url 2023-03-10 12:37:48 +01:00
Szilárd Dóró
6ed46ce2d4 fix(docs): fix broken link 2023-03-10 11:15:22 +01:00
Szilárd Dóró
bfb4c1a6cc fix docs and remove useAxios 2023-03-10 11:04:51 +01:00
Szilárd Dóró
776c8f9237 Merge pull request #1721 from nhost/changeset-release/main
chore: update versions
2023-03-10 11:03:55 +01:00
github-actions[bot]
c0773d82e9 chore: update versions 2023-03-10 09:38:58 +00:00
Siarhei Lipchyk
c46b1383f2 Merge pull request #1724 from nhost/fix/dashboard-docker-entrypoint
Fix default values for placeholders
2023-03-10 10:37:46 +01:00
Siarhei Lipchyk
beed2eba21 Fix default values for placeholders 2023-03-10 10:36:01 +01:00
Szilárd Dóró
70f9610041 Merge pull request #1723 from nhost/fix/provisioning-status-indicator
fix(dashboard): miscellaneous fixes
2023-03-10 10:23:22 +01:00
Szilárd Dóró
e91de1088d chore: remove unused helper 2023-03-10 10:22:56 +01:00
Szilárd Dóró
ce1ee40dab fix: deprecate backendUrl, allow other params 2023-03-10 10:22:11 +01:00
Szilárd Dóró
bd7929f5ed revert provisioning status changes 2023-03-10 09:35:36 +01:00
Szilárd Dóró
2c8559a319 fix(dashboard): misc fixes 2023-03-09 15:54:17 +01:00
Szilárd Dóró
bd5ea5ee3a Merge pull request #1722 from nhost/chore/renovate-ci
chore(ci): remove renovate changeset automation
2023-03-09 13:09:59 +01:00
Szilárd Dóró
3538dbac39 chore(ci): remove renovate changeset automation 2023-03-09 11:12:06 +01:00
Szilárd Dóró
03b5cda69a Merge pull request #1700 from nhost/renovate/graphiql-react-0.x
fix(deps): update dependency @graphiql/react to ^0.17.0
2023-03-09 11:08:04 +01:00
Szilárd Dóró
4329d04854 chore: bump graphiql dependencies 2023-03-09 10:41:46 +01:00
Szilárd Dóró
ca50c5ce0c Merge remote-tracking branch 'origin/main' into renovate/graphiql-react-0.x 2023-03-09 10:25:37 +01:00
Szilárd Dóró
a3271ed014 Merge pull request #1719 from nhost/changeset-release/main
chore: update versions
2023-03-09 10:14:06 +01:00
github-actions[bot]
d4fc99a77c chore: update versions 2023-03-09 08:20:32 +00:00
Szilárd Dóró
d90fcf3c24 Merge pull request #1713 from nhost/chore/mimir-cleanup
chore(dashboard): mimir migration cleanup
2023-03-09 09:19:06 +01:00
Szilárd Dóró
001b3dccec chore: update codegen 2023-03-07 14:50:26 +01:00
Szilárd Dóró
cbb1fc5bc8 chore: cleanup GraphQL operations 2023-03-07 11:23:55 +01:00
renovate[bot]
0ec3abf47c fix(deps): update dependency @graphiql/react to ^0.17.0 2023-03-03 00:19:25 +00:00
Johan Eliasson
ae19105302 cleanup 2023-03-02 21:32:34 +01:00
Johan Eliasson
730a482598 optimization 2023-03-02 21:25:43 +01:00
Johan Eliasson
253dd235ca added changeset 2023-03-01 09:43:00 +01:00
Johan Eliasson
991e8f2d15 removed unused code 2023-02-28 19:57:51 +01:00
Johan Eliasson
e500e87022 review fixes 2023-02-28 19:15:25 +01:00
Johan Eliasson
c684d0307b Update dashboard/src/utils/CONSTANTS.ts
Co-authored-by: Szilárd Dóró <doroszilard@icloud.com>
2023-02-28 16:59:35 +01:00
Johan Eliasson
2d657b9c29 styled 2023-02-28 13:42:22 +01:00
Johan Eliasson
f46d96bafc query fix 2023-02-27 17:33:26 +01:00
Johan Eliasson
8261743bd3 show warning if max free projects has been created by the user already 2023-02-27 10:44:52 +01:00
Johan Eliasson
34cf1d79a0 readability 2023-02-26 15:01:07 +01:00
Johan Eliasson
9d4542b3db revert back 2023-02-26 14:51:14 +01:00
Johan Eliasson
bb5dbdf5a3 small cleanup 2023-02-26 14:49:44 +01:00
Johan Eliasson
2801b03bf4 removed unused code 2023-02-26 09:57:46 +01:00
Johan Eliasson
8298d458d5 cleanup 2023-02-26 09:56:58 +01:00
Johan Eliasson
6e9b941b89 handle slug server side 2023-02-26 09:54:00 +01:00
Johan Eliasson
5dd25941e5 update 2023-02-26 09:25:40 +01:00
85 changed files with 1298 additions and 3703 deletions

View File

@@ -1,89 +0,0 @@
name: Renovate
on:
pull_request:
branches: [main]
types: [closed]
paths-ignore:
- 'assets/**'
- '**.md'
- 'LICENSE'
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: nhost
jobs:
renovate-changeset:
name: Add changeset
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'renovate/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}
# * Install Node and dependencies. Package downloads will be cached for the next jobs.
- name: Install Node and dependencies
uses: ./.github/actions/install-dependencies
with:
TURBO_TOKEN: ${{ env.TURBO_TOKEN }}
TURBO_TEAM: ${{ env.TURBO_TEAM }}
BUILD: 'none'
- name: Determine bumps
id: bumps
run: |
LAST_NON_PR_SHA=$(git log --no-merges main origin/${{ github.head_ref }} --format=format:%h -- | head -2 | tail -1)
echo "result<<EOF" >> $GITHUB_OUTPUT
pnpm recursive list --depth -1 --parseable \
--filter='!nhost-root' \
--filter=[$LAST_NON_PR_SHA] \
| xargs -I@ jq ".name" @/package.json \
| sort \
| uniq -u \
| awk '$0=$0": patch"' \
>> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Install dictionary
if: steps.bumps.outputs.result != ''
run: sudo apt-get install wbritish
- name: Generate changeset file name
id: file_name
if: steps.bumps.outputs.result != ''
run: |
FILE_NAME=$(shuf -n 3 /usr/share/dict/words | tr '\n' '-' | sed 's/-$//' | sed 's/'"'"'s//g' | tr '[:upper:]' '[:lower:]')
echo "result=./.changeset/${FILE_NAME}.md" >> $GITHUB_OUTPUT
- name: Create changeset file
if: steps.bumps.outputs.result != ''
run: |
cat <<EOF > ${{ steps.file_name.outputs.result }}
---
${{ steps.bumps.outputs.result }}
---
${{ github.event.pull_request.title }}
EOF
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GH_PAT }}
commit-message: ${{ github.event.pull_request.title }}
branch: renovate-changesets
delete-branch: true
title: 'chore: create changesest from Renovate bumps'
labels: |
dependencies
body: |
This PR creates the changesets from the Renovate dependencies that have been merged to main.
- name: Enable Pull Request Automerge
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v2
with:
token: ${{ secrets.GH_PAT }}
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
- name: Auto approve
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: juliangruber/approve-pull-request-action@v2
with:
github-token: ${{ secrets.GH_PAT }}
number: ${{ steps.cpr.outputs.pull-request-number }}

View File

@@ -1,5 +1,49 @@
# @nhost/dashboard
## 0.13.6
### Patch Changes
- 253dd235: using new mutation to create projects + refactor Create Project page.
## 0.13.5
### Patch Changes
- @nhost/react-apollo@5.0.12
- @nhost/nextjs@1.13.17
## 0.13.4
### Patch Changes
- b48bc034: fix(dashboard): disable new users
- 798e591b: fix(dashboard): show correct date in data grid
## 0.13.3
### Patch Changes
- bfb4c1a6: chore(dashboard): remove `useAxios` property
- d8d8394b: Dashboard: allow to override hasura admin secret in docker
- Updated dependencies [ce1ee40d]
- @nhost/nextjs@1.13.16
- @nhost/react-apollo@5.0.11
## 0.13.2
### Patch Changes
- beed2eba: Fix docker entrypoint for dashboard
- 2c8559a3: fix(dashboard): refresh project list after deleting a project
- 4329d048: chore(dashboard): bump `graphiql` dependencies
## 0.13.1
### Patch Changes
- cbb1fc5b: chore(dashboard): cleanup GraphQL operations
## 0.13.0
### Minor Changes

View File

@@ -20,6 +20,7 @@ ENV NEXT_PUBLIC_ENV dev
ENV NEXT_PUBLIC_NHOST_PLATFORM false
# placeholders for URLs, will be replaced on runtime by entrypoint script
ENV NEXT_PUBLIC_NHOST_ADMIN_SECRET __NEXT_PUBLIC_NHOST_ADMIN_SECRET__
ENV NEXT_PUBLIC_NHOST_AUTH_URL __NEXT_PUBLIC_NHOST_AUTH_URL__
ENV NEXT_PUBLIC_NHOST_FUNCTIONS_URL __NEXT_PUBLIC_NHOST_FUNCTIONS_URL__
ENV NEXT_PUBLIC_NHOST_GRAPHQL_URL __NEXT_PUBLIC_NHOST_GRAPHQL_URL__

View File

@@ -3,15 +3,17 @@
set -euo pipefail
# read URLs from env variables (with defaults)
NEXT_PUBLIC_NHOST_AUTH_URL="${NEXT_PUBLIC_NHOST_AUTH_URL:-"http://localhost:1337/v1/auth"}"
NEXT_PUBLIC_NHOST_FUNCTIONS_URL="${NEXT_PUBLIC_NHOST_FUNCTIONS_URL:-"http://localhost:1337/v1/functions"}"
NEXT_PUBLIC_NHOST_GRAPHQL_URL="${NEXT_PUBLIC_NHOST_GRAPHQL_URL:-"http://localhost:1337/v1/graphql"}"
NEXT_PUBLIC_NHOST_STORAGE_URL="${NEXT_PUBLIC_NHOST_STORAGE_URL:-"http://localhost:1337/v1/storage"}"
NEXT_PUBLIC_NHOST_HASURA_CONSOLE_URL="${NEXT_PUBLIC_NHOST_HASURA_CONSOLE_URL:-"http://localhost:9695"}"
NEXT_PUBLIC_NHOST_HASURA_MIGRATIONS_API_URL="${NEXT_PUBLIC_NHOST_HASURA_MIGRATIONS_API_URL:-"http://localhost:9693"}"
NEXT_PUBLIC_NHOST_HASURA_API_URL="${NEXT_PUBLIC_NHOST_HASURA_API_URL:-"http://localhost:8080"}"
NEXT_PUBLIC_NHOST_ADMIN_SECRET="${NEXT_PUBLIC_NHOST_ADMIN_SECRET:-nhost-admin-secret}"
NEXT_PUBLIC_NHOST_AUTH_URL="${NEXT_PUBLIC_NHOST_AUTH_URL:-http://localhost:1337/v1/auth}"
NEXT_PUBLIC_NHOST_FUNCTIONS_URL="${NEXT_PUBLIC_NHOST_FUNCTIONS_URL:-http://localhost:1337/v1/functions}"
NEXT_PUBLIC_NHOST_GRAPHQL_URL="${NEXT_PUBLIC_NHOST_GRAPHQL_URL:-http://localhost:1337/v1/graphql}"
NEXT_PUBLIC_NHOST_STORAGE_URL="${NEXT_PUBLIC_NHOST_STORAGE_URL:-http://localhost:1337/v1/storage}"
NEXT_PUBLIC_NHOST_HASURA_CONSOLE_URL="${NEXT_PUBLIC_NHOST_HASURA_CONSOLE_URL:-http://localhost:9695}"
NEXT_PUBLIC_NHOST_HASURA_MIGRATIONS_API_URL="${NEXT_PUBLIC_NHOST_HASURA_MIGRATIONS_API_URL:-http://localhost:9693}"
NEXT_PUBLIC_NHOST_HASURA_API_URL="${NEXT_PUBLIC_NHOST_HASURA_API_URL:-http://localhost:8080}"
# replace placeholders
find dashboard -type f -exec sed -i "s~__NEXT_PUBLIC_NHOST_ADMIN_SECRET__~${NEXT_PUBLIC_NHOST_ADMIN_SECRET}~g" {} +
find dashboard -type f -exec sed -i "s~__NEXT_PUBLIC_NHOST_AUTH_URL__~${NEXT_PUBLIC_NHOST_AUTH_URL}~g" {} +
find dashboard -type f -exec sed -i "s~__NEXT_PUBLIC_NHOST_FUNCTIONS_URL__~${NEXT_PUBLIC_NHOST_FUNCTIONS_URL}~g" {} +
find dashboard -type f -exec sed -i "s~__NEXT_PUBLIC_NHOST_GRAPHQL_URL__~${NEXT_PUBLIC_NHOST_GRAPHQL_URL}~g" {} +

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/dashboard",
"version": "0.13.0",
"version": "0.13.6",
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",
@@ -25,8 +25,8 @@
"@emotion/styled": "^11.10.5",
"@fontsource/inter": "^4.5.14",
"@fontsource/roboto-mono": "^4.5.8",
"@graphiql/react": "^0.15.0",
"@graphiql/toolkit": "^0.8.0",
"@graphiql/react": "^0.17.0",
"@graphiql/toolkit": "^0.8.2",
"@headlessui/react": "^1.6.5",
"@heroicons/react": "^1.0.6",
"@hookform/resolvers": "^2.9.10",
@@ -37,7 +37,7 @@
"@nhost/nextjs": "workspace:*",
"@nhost/react-apollo": "workspace:*",
"@segment/snippet": "^4.15.3",
"@stripe/react-stripe-js": "^1.10.0",
"@stripe/react-stripe-js": "^2.0.0",
"@stripe/stripe-js": "^1.35.0",
"@tailwindcss/forms": "^0.5.3",
"@tanstack/react-query": "^4.16.1",
@@ -48,7 +48,7 @@
"clsx": "^1.2.1",
"date-fns": "^2.29.3",
"generate-password": "^1.7.0",
"graphiql": "^2.2.0",
"graphiql": "^2.4.0",
"graphql": "^16.6.0",
"graphql-request": "^4.3.0",
"graphql-tag": "^2.12.6",

View File

@@ -9,28 +9,39 @@ import Link from '@/ui/v2/Link';
import Text from '@/ui/v2/Text';
import { copy } from '@/utils/copy';
import { getApplicationStatusString } from '@/utils/helpers';
import { triggerToast } from '@/utils/toast';
import getServerError from '@/utils/settings/getServerError';
import { formatDistance } from 'date-fns';
import { useRouter } from 'next/router';
import { toast } from 'react-hot-toast';
export default function ApplicationInfo() {
const { currentApplication } = useCurrentWorkspaceAndApplication();
const [deleteApplication, { client }] = useDeleteApplicationMutation({
const [deleteApplication] = useDeleteApplicationMutation({
refetchQueries: [GetOneUserDocument],
});
const router = useRouter();
async function handleClickRemove() {
await deleteApplication({
variables: {
appId: currentApplication.id,
},
});
await router.push('/');
await client.refetchQueries({
include: ['getOneUser'],
});
triggerToast(`${currentApplication.name} deleted`);
try {
await toast.promise(
deleteApplication({
variables: {
appId: currentApplication.id,
},
}),
{
loading: 'Deleting project...',
success: 'The project has been deleted successfully.',
error: getServerError(
'An error occurred while deleting the project. Please try again.',
),
},
);
await router.push('/');
} catch {
// Note: The toast will handle the error.
}
}
return (

View File

@@ -3,54 +3,81 @@ import { ChangePlanModal } from '@/components/applications/ChangePlanModal';
import { StagingMetadata } from '@/components/applications/StagingMetadata';
import { useDialog } from '@/components/common/DialogProvider';
import Container from '@/components/layout/Container';
import { useUpdateApplicationMutation } from '@/generated/graphql';
import {
GetOneUserDocument,
useGetFreeAndActiveProjectsQuery,
useUnpauseApplicationMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { ApplicationStatus } from '@/types/application';
import { Modal } from '@/ui';
import { Alert } from '@/ui/Alert';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Box from '@/ui/v2/Box';
import Button from '@/ui/v2/Button';
import Text from '@/ui/v2/Text';
import { discordAnnounce } from '@/utils/discordAnnounce';
import { triggerToast } from '@/utils/toast';
import { updateOwnCache } from '@/utils/updateOwnCache';
import { MAX_FREE_PROJECTS } from '@/utils/CONSTANTS';
import { getToastStyleProps } from '@/utils/settings/settingsConstants';
import type { ApolloError } from '@apollo/client';
import { useUserData } from '@nhost/nextjs';
import Image from 'next/image';
import { useState } from 'react';
import { toast } from 'react-hot-toast';
import { RemoveApplicationModal } from './RemoveApplicationModal';
export default function ApplicationPaused() {
const { openAlertDialog } = useDialog();
const { currentWorkspace, currentApplication } =
useCurrentWorkspaceAndApplication();
const [changingApplicationStateLoading, setChangingApplicationStateLoading] =
useState(false);
const [updateApplication, { client }] = useUpdateApplicationMutation();
const { id, email } = useUserData();
const { id } = useUserData();
const isOwner = currentWorkspace.members.some(
({ userId, type }) => userId === id && type === 'owner',
);
const isPro = currentApplication.plan.name === 'Pro';
const [showDeletingModal, setShowDeletingModal] = useState(false);
const [unpauseApplication, { loading: changingApplicationStateLoading }] =
useUnpauseApplicationMutation({
refetchQueries: [GetOneUserDocument],
});
const { data, loading } = useGetFreeAndActiveProjectsQuery({
variables: { userId: id },
fetchPolicy: 'cache-and-network',
});
const numberOfFreeAndLiveProjects = data?.freeAndActiveProjects.length || 0;
const wakeUpDisabled = numberOfFreeAndLiveProjects >= MAX_FREE_PROJECTS;
async function handleTriggerUnpausing() {
setChangingApplicationStateLoading(true);
try {
await updateApplication({
variables: {
appId: currentApplication.id,
app: {
desiredState: ApplicationStatus.Live,
await toast.promise(
unpauseApplication({ variables: { appId: currentApplication.id } }),
{
loading: 'Starting the project...',
success: `The project has been started successfully.`,
error: (arg: ApolloError) => {
// we need to get the internal error message from the GraphQL error
const { internal } = arg.graphQLErrors[0]?.extensions || {};
const { message } = (internal as Record<string, any>)?.error || {};
// we use the default Apollo error message if we can't find the
// internal error message
return (
message ||
arg.message ||
'An error occurred while waking up the project. Please try again.'
);
},
},
});
await updateOwnCache(client);
discordAnnounce(
`App ${currentApplication.name} (${email}) set to awake.`,
getToastStyleProps(),
);
triggerToast(`${currentApplication.name} set to awake.`);
} catch (e) {
triggerToast(`Error trying to awake ${currentApplication.name}`);
} catch {
// Note: The toast will handle the error.
}
}
if (loading) {
return <ActivityIndicator label="Loading user data..." delay={1000} />;
}
return (
<>
<Modal
@@ -65,7 +92,7 @@ export default function ApplicationPaused() {
/>
</Modal>
<Container className="mx-auto mt-20 grid max-w-sm grid-flow-row gap-2 text-center">
<Container className="mx-auto mt-20 grid max-w-lg grid-flow-row gap-4 text-center">
<div className="mx-auto flex w-centImage flex-col text-center">
<Image
src="/assets/PausedApp.svg"
@@ -75,16 +102,18 @@ export default function ApplicationPaused() {
/>
</div>
<Text variant="h3" component="h1" className="mt-4">
{currentApplication.name} is sleeping
</Text>
<Box className="grid grid-flow-row gap-1">
<Text variant="h3" component="h1">
{currentApplication.name} is sleeping
</Text>
<Text className="mt-1">
Projects on the free plan stop responding to API calls after 7 days of
no traffic.
</Text>
<Text>
Starter projects stop responding to API calls after 7 days of
inactivity. Upgrade to Pro to avoid autosleep.
</Text>
</Box>
{!isPro && (
<Box className="grid grid-flow-row gap-2">
<Button
className="mx-auto w-full max-w-[280px]"
onClick={() => {
@@ -101,32 +130,41 @@ export default function ApplicationPaused() {
});
}}
>
Upgrade to Pro to avoid autosleep
</Button>
)}
<div className="grid grid-flow-row gap-2">
<Button
variant="borderless"
className="mx-auto w-full max-w-[280px]"
loading={changingApplicationStateLoading}
disabled={changingApplicationStateLoading}
onClick={handleTriggerUnpausing}
>
Wake Up
Upgrade to Pro
</Button>
{isOwner && (
<div className="grid grid-flow-row gap-2">
<Button
color="error"
variant="borderless"
className="mx-auto w-full max-w-[280px]"
onClick={() => setShowDeletingModal(true)}
loading={changingApplicationStateLoading}
disabled={changingApplicationStateLoading || wakeUpDisabled}
onClick={handleTriggerUnpausing}
>
Delete Project
Wake Up
</Button>
)}
</div>
{wakeUpDisabled && (
<Alert severity="warning" className="mx-auto max-w-xs text-left">
Note: Only one free project can be active at any given time.
Please pause your active free project before unpausing{' '}
{currentApplication.name}.
</Alert>
)}
{isOwner && (
<Button
color="error"
variant="borderless"
className="mx-auto w-full max-w-[280px]"
onClick={() => setShowDeletingModal(true)}
>
Delete Project
</Button>
)}
</div>
</Box>
<StagingMetadata>
<ApplicationInfo />
</StagingMetadata>

View File

@@ -6,7 +6,10 @@ import Divider from '@/ui/v2/Divider';
import Text from '@/ui/v2/Text';
import { discordAnnounce } from '@/utils/discordAnnounce';
import { triggerToast } from '@/utils/toast';
import { useDeleteApplicationMutation } from '@/utils/__generated__/graphql';
import {
GetOneUserDocument,
useDeleteApplicationMutation,
} from '@/utils/__generated__/graphql';
import router from 'next/router';
import { useState } from 'react';
import { twMerge } from 'tailwind-merge';
@@ -42,7 +45,9 @@ export function RemoveApplicationModal({
description,
className,
}: RemoveApplicationModalProps) {
const [deleteApplication, { client }] = useDeleteApplicationMutation();
const [deleteApplication] = useDeleteApplicationMutation({
refetchQueries: [GetOneUserDocument],
});
const [loadingRemove, setLoadingRemove] = useState(false);
const { currentApplication } = useCurrentWorkspaceAndApplication();
@@ -73,9 +78,6 @@ export function RemoveApplicationModal({
}
close();
await router.push('/');
await client.refetchQueries({
include: ['getOneUser'],
});
triggerToast(`${currentApplication.name} deleted`);
}

View File

@@ -111,9 +111,8 @@ export function RenderWorkspacesWithApps({
)}
<StateBadge
status={checkStatusOfTheApplication(
app.appStates,
)}
state={checkStatusOfTheApplication(app.appStates)}
desiredState={app.desiredState}
title={getApplicationStatusString(
checkStatusOfTheApplication(app.appStates),
)}

View File

@@ -6,7 +6,7 @@ import type { PropsWithChildren } from 'react';
export function StagingMetadata({ children }: PropsWithChildren<unknown>) {
return (
isDevOrStaging() && (
<div className="mt-10">
<div className="mx-auto mt-10 max-w-sm">
<Box className="mx-auto flex flex-col rounded-md border p-5 text-center">
<Status status={StatusEnum.Deploying}>Internal info</Status>
{children}

View File

@@ -76,7 +76,8 @@ function AddPaymentMethodForm({
if (createPaymentMethodError) {
throw new Error(
createPaymentMethodError.message || 'Unknown error occurred.',
createPaymentMethodError.message ||
'An unknown error occurred. Please try again.',
);
}
@@ -90,7 +91,10 @@ function AddPaymentMethodForm({
);
if (attachPaymentMethodError) {
throw Error((attachPaymentMethodError as any).response.data);
throw new Error(
(attachPaymentMethodError as any)?.response?.data ||
'An unknown error occurred. Please try again.',
);
}
// update workspace with new country code in database
@@ -151,7 +155,7 @@ function AddPaymentMethodForm({
};
return (
<Box className="w-modal2 px-6 pt-6 pb-6 text-left rounded-lg">
<Box className="w-modal2 rounded-lg px-6 pt-6 pb-6 text-left">
<div className="flex flex-col">
<form onSubmit={handleSubmit}>
<Text className="text-center text-lg font-medium">
@@ -203,7 +207,7 @@ function AddPaymentMethodForm({
type BillingPaymentMethodFormProps = {
close: () => void;
onPaymentMethodAdded?: () => Promise<void>;
onPaymentMethodAdded?: (e?: any) => Promise<void>;
workspaceId: string;
};

View File

@@ -46,7 +46,7 @@ export default function DataGridDateCell<TData extends object>({
: undefined;
const { year, month, day, hour, minute, second } = getDateComponents(date, {
adjustTimezone: specificType === 'timetz' || specificType === 'timestamptz',
adjustTimezone: ['date', 'timetz', 'timestamptz'].includes(specificType),
});
const { inputRef, focusCell, isEditing, cancelEditCell } =

View File

@@ -99,7 +99,6 @@ export function InviteAnnounce() {
workspaceMemberInviteId: inviteId,
isAccepted: false,
},
{ useAxios: false },
);
if (ignoreError) {

View File

@@ -35,7 +35,7 @@ export default function DisableNewUsersSettings() {
const form = useForm<DisableNewUsersFormValues>({
reValidateMode: 'onSubmit',
defaultValues: {
disabled: !!data?.config?.auth?.signUp?.enabled,
disabled: !data?.config?.auth?.signUp?.enabled,
},
});

View File

@@ -5,7 +5,11 @@ export interface StateBadgeProps {
/**
* This is the current state of the application.
*/
status: ApplicationStatus;
state: ApplicationStatus;
/**
* This is the desired state of the application.
*/
desiredState: ApplicationStatus;
/**
* The title to show on the application state badge.
*/
@@ -24,20 +28,28 @@ function getNormalizedTitle(title: string) {
return title;
}
export default function StateBadge({ title, status }: StateBadgeProps) {
export default function StateBadge({
title,
state,
desiredState,
}: StateBadgeProps) {
if (
desiredState === ApplicationStatus.Paused &&
state === ApplicationStatus.Live
) {
return <Chip size="small" color="default" label="Pausing" />;
}
const normalizedTitle = getNormalizedTitle(title);
if (
status === ApplicationStatus.Empty ||
status === ApplicationStatus.Unpausing
state === ApplicationStatus.Empty ||
state === ApplicationStatus.Unpausing
) {
return <Chip size="small" label={normalizedTitle} color="warning" />;
}
if (
status === ApplicationStatus.Errored ||
status === ApplicationStatus.Live
) {
if (state === ApplicationStatus.Errored || state === ApplicationStatus.Live) {
return <Chip size="small" label={normalizedTitle} color="success" />;
}

View File

@@ -6,7 +6,7 @@ import SvgIcon from '@/ui/v2/icons/SvgIcon';
import { styled } from '@mui/material';
import type { RadioProps as MaterialRadioProps } from '@mui/material/Radio';
import MaterialRadio from '@mui/material/Radio';
import type { ForwardedRef, PropsWithoutRef } from 'react';
import type { ForwardedRef, PropsWithoutRef, ReactNode } from 'react';
import { forwardRef } from 'react';
export interface RadioProps extends MaterialRadioProps {
@@ -17,7 +17,7 @@ export interface RadioProps extends MaterialRadioProps {
/**
* Label to be displayed next to the radio button.
*/
label?: string;
label?: ReactNode;
/**
* Props to be passed to individual component slots.
*/

View File

@@ -1,7 +1,9 @@
import { styled } from '@mui/material';
import Box from '@mui/material/Box';
import type { TooltipProps as MaterialTooltipProps } from '@mui/material/Tooltip';
import MaterialTooltip, { tooltipClasses } from '@mui/material/Tooltip';
import MaterialTooltip, {
tooltipClasses as materialTooltipClasses,
} from '@mui/material/Tooltip';
import type { ForwardedRef } from 'react';
import { forwardRef } from 'react';
@@ -21,7 +23,7 @@ export interface TooltipProps extends MaterialTooltipProps {
}
const StyledTooltip = styled(Box)(({ theme }) => ({
[`&.${tooltipClasses.tooltip}`]: {
[`&.${materialTooltipClasses.tooltip}`]: {
fontSize: '0.9375rem',
lineHeight: '1.375rem',
backgroundColor:
@@ -36,9 +38,23 @@ const StyledTooltip = styled(Box)(({ theme }) => ({
'0px 1px 4px rgba(14, 24, 39, 0.1), 0px 8px 24px rgba(14, 24, 39, 0.1)',
maxWidth: '17.5rem',
},
[`&.${tooltipClasses.tooltipPlacementBottom}`]: {
[`& .${materialTooltipClasses.arrow}`]: {
color:
theme.palette.mode === 'dark'
? theme.palette.grey[300]
: theme.palette.grey[700],
},
[`&.${materialTooltipClasses.tooltipPlacementBottom}`]: {
marginTop: `${theme.spacing(0.75)} !important`,
},
[`&.${materialTooltipClasses.tooltipPlacementBottom} .${materialTooltipClasses.arrow}`]:
{
marginTop: `${theme.spacing(-0.5)} !important`,
color:
theme.palette.mode === 'dark'
? theme.palette.grey[300]
: theme.palette.grey[700],
},
}));
function Tooltip(
@@ -69,6 +85,8 @@ function Tooltip(
);
}
export { materialTooltipClasses as tooltipClasses };
Tooltip.displayName = 'NhostTooltip';
export default forwardRef(Tooltip);

View File

@@ -12,8 +12,8 @@ export function WorkspaceInvoices() {
return (
<div className="mt-18">
<div className="mx-auto max-w-3xl font-display grid grid-flow-row gap-2 justify-start">
<Text className="font-medium text-lg">Invoices</Text>
<div className="mx-auto grid max-w-3xl grid-flow-row justify-start gap-2 font-display">
<Text className="text-lg font-medium">Invoices</Text>
<Button
variant="outlined"
@@ -23,7 +23,6 @@ export function WorkspaceInvoices() {
const { res, error } = await nhost.functions.call(
'/stripe-create-portal',
{ workspaceId: currentWorkspace.id },
{ useAxios: false },
);
if (error) {

View File

@@ -1,14 +0,0 @@
fragment GetAppRoles on apps {
id
slug
subdomain
name
authUserDefaultAllowedRoles
authUserDefaultRole
}
query getAppRolesAndPermissions($id: uuid!) {
app(id: $id) {
...GetAppRoles
}
}

View File

@@ -0,0 +1,5 @@
mutation PauseApplication($appId: uuid!) {
updateApp(pk_columns: { id: $appId }, _set: { desiredState: 6 }) {
id
}
}

View File

@@ -0,0 +1,5 @@
mutation UnpauseApplication($appId: uuid!) {
updateApp(pk_columns: { id: $appId }, _set: { desiredState: 5 }) {
id
}
}

View File

@@ -1,15 +0,0 @@
query getFunctionsLogs($subdomain: String!) {
getFunctionLogs(subdomain: $subdomain) {
functionPath
createdAt
message
}
}
query getFunctionLog($subdomain: String!, $functionPaths: [String!]) {
getFunctionLogs(subdomain: $subdomain, functionPaths: $functionPaths) {
functionPath
createdAt
message
}
}

View File

@@ -1,7 +0,0 @@
query getGravatarSettings($id: uuid!) {
app(id: $id) {
authGravatarEnabled
authGravatarDefault
authGravatarRating
}
}

View File

@@ -1,7 +0,0 @@
mutation restoreDatabaseBackup($appId: uuid!, $backupId: uuid!) {
restoreDatabaseBackup(appId: $appId, backupId: $backupId)
}
mutation scheduleRestoreDatabaseBackup($appId: uuid!, $backupId: uuid!) {
scheduleRestoreDatabaseBackup(appId: $appId, backupId: $backupId)
}

View File

@@ -0,0 +1,11 @@
query GetFreeAndActiveProjects($userId: uuid!) {
freeAndActiveProjects: apps(
where: {
creatorUserId: { _eq: $userId }
plan: { isFree: { _eq: true } }
desiredState: { _eq: 5 }
}
) {
id
}
}

View File

@@ -1,4 +1,7 @@
import { useGetApplicationStateQuery } from '@/generated/graphql';
import {
GetOneUserDocument,
useGetApplicationStateQuery,
} from '@/generated/graphql';
import { ApplicationStatus } from '@/types/application';
import { discordAnnounce } from '@/utils/discordAnnounce';
import { useCallback, useEffect, useState } from 'react';
@@ -30,7 +33,7 @@ export function useCheckProvisioning() {
async function updateOwnCache() {
await client.refetchQueries({
include: ['getOneUser'],
include: [GetOneUserDocument],
});
}

View File

@@ -11,7 +11,7 @@ export default function useNotFoundRedirect() {
const router = useRouter();
const {
query: { workspaceSlug, appSlug, updating },
} = useRouter();
} = router;
const notIn404Already = router.pathname !== '/404';
const noResolvedWorkspace = workspaceSlug && currentWorkspace === undefined;

View File

@@ -6,8 +6,10 @@ import SettingsContainer from '@/components/settings/SettingsContainer';
import SettingsLayout from '@/components/settings/SettingsLayout';
import { useUI } from '@/context/UIContext';
import {
GetOneUserDocument,
useDeleteApplicationMutation,
useUpdateAppMutation,
usePauseApplicationMutation,
useUpdateApplicationMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import Input from '@/ui/v2/Input';
@@ -15,7 +17,6 @@ import { discordAnnounce } from '@/utils/discordAnnounce';
import { slugifyString } from '@/utils/helpers';
import getServerError from '@/utils/settings/getServerError';
import { getToastStyleProps } from '@/utils/settings/settingsConstants';
import { updateOwnCache } from '@/utils/updateOwnCache';
import { useApolloClient } from '@apollo/client';
import { yupResolver } from '@hookform/resolvers/yup';
import { useRouter } from 'next/router';
@@ -37,11 +38,16 @@ export type ProjectNameValidationSchema = Yup.InferType<
export default function SettingsGeneralPage() {
const { currentApplication } = useCurrentWorkspaceAndApplication();
const { openDialog, closeDialog } = useDialog();
const [updateApp] = useUpdateAppMutation();
const { openDialog, openAlertDialog, closeDialog } = useDialog();
const [updateApp] = useUpdateApplicationMutation();
const client = useApolloClient();
const [pauseApplication] = usePauseApplicationMutation({
variables: { appId: currentApplication?.id },
refetchQueries: [GetOneUserDocument],
});
const [deleteApplication] = useDeleteApplicationMutation({
variables: { appId: currentApplication?.id },
refetchQueries: [GetOneUserDocument],
});
const { currentWorkspace } = useCurrentWorkspaceAndApplication();
const router = useRouter();
@@ -60,7 +66,7 @@ export default function SettingsGeneralPage() {
const { register, formState } = form;
const handleProjectNameChange = async (data: ProjectNameValidationSchema) => {
async function handleProjectNameChange(data: ProjectNameValidationSchema) {
// In this bit of code we spread the props of the current path (e.g. /workspace/...) and add one key-value pair: `updating: true`.
// We want to indicate that the currently we're in the process of running a mutation state that will affect the routing behaviour of the website
// i.e. redirecting to 404 if there's no workspace/project with that slug.
@@ -82,7 +88,7 @@ export default function SettingsGeneralPage() {
const updateAppMutation = updateApp({
variables: {
id: currentApplication.id,
appId: currentApplication.id,
app: {
name: data.name,
slug: newProjectSlug,
@@ -107,35 +113,50 @@ export default function SettingsGeneralPage() {
}
try {
await client.refetchQueries({
include: ['getOneUser'],
});
form.reset(undefined, { keepValues: true, keepDirty: false });
await router.push(
`/${currentWorkspace.slug}/${newProjectSlug}/settings/general`,
);
await client.refetchQueries({ include: [GetOneUserDocument] });
} catch (error) {
await discordAnnounce(
error.message || 'Error while trying to update application cache',
error.message ||
'An error occurred while trying to update application cache.',
);
}
};
}
const handleDeleteApplication = async () => {
async function handleDeleteApplication() {
await toast.promise(
deleteApplication(),
{
loading: `Deleting ${currentApplication.name}...`,
success: `${currentApplication.name} deleted`,
success: `${currentApplication.name} has been deleted successfully.`,
error: getServerError(
`Error while trying to ${currentApplication.name} project name`,
`An error occurred while trying to delete the project "${currentApplication.name}". Please try again.`,
),
},
getToastStyleProps(),
);
await router.push('/');
await updateOwnCache(client);
};
}
async function handlePauseApplication() {
await toast.promise(
pauseApplication(),
{
loading: `Pausing ${currentApplication.name}...`,
success: `${currentApplication.name} will be paused, but please note that it may take some time to complete the process.`,
error: getServerError(
`An error occurred while trying to pause the project "${currentApplication.name}". Please try again.`,
),
},
getToastStyleProps(),
);
await router.push('/');
}
return (
<Container
@@ -171,6 +192,32 @@ export default function SettingsGeneralPage() {
</Form>
</FormProvider>
{currentApplication.plan.isFree && (
<SettingsContainer
title="Pause Project"
description="While your project is paused, it will not be accessible. You can wake it up anytime after."
submitButtonText="Pause"
slotProps={{
submitButton: {
type: 'button',
color: 'primary',
variant: 'contained',
disabled: maintenanceActive,
onClick: () => {
openAlertDialog({
title: 'Pause Project?',
payload:
'Are you sure you want to pause this project? It will not be accessible until you unpause it.',
props: {
onPrimaryAction: handlePauseApplication,
},
});
},
},
}}
/>
)}
<SettingsContainer
title="Delete Project"
description="The project will be permanently deleted, including its database, metadata, files, etc. This action is irreversible and can not be undone."

View File

@@ -11,23 +11,25 @@ import { Modal } from '@/ui/Modal';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Box from '@/ui/v2/Box';
import Button from '@/ui/v2/Button';
import Checkbox from '@/ui/v2/Checkbox';
import IconButton from '@/ui/v2/IconButton';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment';
import Option from '@/ui/v2/Option';
import Radio from '@/ui/v2/Radio';
import RadioGroup from '@/ui/v2/RadioGroup';
import Select from '@/ui/v2/Select';
import type { TextProps } from '@/ui/v2/Text';
import Text from '@/ui/v2/Text';
import Tooltip from '@/ui/v2/Tooltip';
import { MAX_FREE_PROJECTS } from '@/utils/CONSTANTS';
import { copy } from '@/utils/copy';
import { discordAnnounce } from '@/utils/discordAnnounce';
import { getErrorMessage } from '@/utils/getErrorMessage';
import { getCurrentEnvironment, slugifyString } from '@/utils/helpers';
import { nhost } from '@/utils/nhost';
import { getCurrentEnvironment } from '@/utils/helpers';
import { planDescriptions } from '@/utils/planDescriptions';
import generateRandomDatabasePassword from '@/utils/settings/generateRandomDatabasePassword';
import { resetDatabasePasswordValidationSchema } from '@/utils/settings/resetDatabasePasswordValidationSchema';
import { getToastStyleProps } from '@/utils/settings/settingsConstants';
import { triggerToast } from '@/utils/toast';
import type {
PrefetchNewAppPlansFragment,
@@ -35,19 +37,25 @@ import type {
PrefetchNewAppWorkspaceFragment,
} from '@/utils/__generated__/graphql';
import {
useGetFreeAndActiveProjectsQuery,
useInsertApplicationMutation,
usePrefetchNewAppQuery,
} from '@/utils/__generated__/graphql';
import type { ApolloError } from '@apollo/client';
import { useUserData } from '@nhost/nextjs';
import Image from 'next/image';
import { useRouter } from 'next/router';
import type { ReactElement } from 'react';
import { cloneElement, isValidElement, useState } from 'react';
import { toast } from 'react-hot-toast';
import slugify from 'slugify';
import { twMerge } from 'tailwind-merge';
type NewAppPageProps = {
regions: PrefetchNewAppRegionsFragment[];
plans: PrefetchNewAppPlansFragment[];
workspaces: PrefetchNewAppWorkspaceFragment[];
numberOfFreeAndLiveProjects: number;
preSelectedWorkspace: PrefetchNewAppWorkspaceFragment;
preSelectedRegion: PrefetchNewAppRegionsFragment;
};
@@ -56,6 +64,7 @@ export function NewProjectPageContent({
regions,
plans,
workspaces,
numberOfFreeAndLiveProjects,
preSelectedWorkspace,
preSelectedRegion,
}: NewAppPageProps) {
@@ -86,15 +95,23 @@ export function NewProjectPageContent({
generateRandomDatabasePassword(),
);
const [plan, setPlan] = useState(plans[0]);
// find the first acceptable plan as default plan
const defaultSelectedPlan = plans.find((plan) => {
if (!plan.isFree) {
return true;
}
return numberOfFreeAndLiveProjects < MAX_FREE_PROJECTS;
});
const [plan, setPlan] = useState(defaultSelectedPlan);
// state
const { submitState, setSubmitState } = useSubmitState();
const [applicationError, setApplicationError] = useState<any>('');
const [showPaymentModal, setShowPaymentModal] = useState(false);
// graphql mutations
const [insertApp] = useInsertApplicationMutation();
const [insertApp] = useInsertApplicationMutation({});
const { refetchUserData } = useLazyRefetchUserData();
// options
@@ -119,8 +136,6 @@ export function NewProjectPageContent({
(availableWorkspace) => availableWorkspace.id === selectedWorkspace.id,
);
const user = nhost.auth.getUser();
const isK8SPostgresEnabledInCurrentEnvironment = features[
'k8s-postgres'
].enabled.find((e) => e === getCurrentEnvironment());
@@ -133,30 +148,24 @@ export function NewProjectPageContent({
setDatabasePassword(newRandomDatabasePassword);
};
const handleSubmit = async () => {
const handleSubmit = async (e) => {
e.preventDefault();
if (!plan.isFree && workspace.paymentMethods.length === 0) {
setShowPaymentModal(true);
return;
}
setSubmitState({
error: null,
loading: true,
});
if (name.length < 1 || name.length > 32) {
setApplicationError(
`The project name must be between 1 and 32 characters`,
);
setSubmitState({
error: null,
error: Error('The project name must be between 1 and 32 characters'),
loading: false,
});
}
const slug = slugifyString(name);
if (slug.length < 1 || slug.length > 32) {
setSubmitState({
error: Error('The project slug must be between 1 and 32 characters.'),
loading: false,
});
return;
}
@@ -173,14 +182,11 @@ export function NewProjectPageContent({
}
}
// NOTE: Maybe we'll reintroduce this way of creating the subdomain in the future
// https://www.rfc-editor.org/rfc/rfc1034#section-3.1
// subdomain max length is 63 characters
// const subdomain = `${slug}-${workspaceSlug}`.substring(0, 63);
const slug = slugify(name, { lower: true, strict: true });
try {
if (isK8SPostgresEnabledInCurrentEnvironment) {
await insertApp({
await toast.promise(
insertApp({
variables: {
app: {
name,
@@ -188,37 +194,40 @@ export function NewProjectPageContent({
planId: plan.id,
workspaceId: selectedWorkspace.id,
regionId: selectedRegion.id,
postgresPassword: databasePassword,
postgresPassword: isK8SPostgresEnabledInCurrentEnvironment
? databasePassword
: undefined,
},
},
});
} else {
await insertApp({
variables: {
app: {
name,
slug,
planId: plan.id,
workspaceId: selectedWorkspace.id,
regionId: selectedRegion.id,
},
},
});
}
}),
{
loading: 'Creating the project...',
success: 'The project has been created successfully.',
error: (arg: ApolloError) => {
// we need to get the internal error message from the GraphQL error
const { internal } = arg.graphQLErrors[0]?.extensions || {};
const { message } = (internal as Record<string, any>)?.error || {};
triggerToast(`New project ${name} created`);
} catch (error) {
discordAnnounce(
`Error creating project: ${error.message}. (${user.email})`,
// we use the default Apollo error message if we can't find the
// internal error message
return (
message ||
arg.message ||
'An error occurred while creating the project. Please try again.'
);
},
},
getToastStyleProps(),
);
await refetchUserData();
await router.push(`/${selectedWorkspace.slug}/${slug}`);
} catch (error) {
setSubmitState({
error: Error(getErrorMessage(error, 'application')),
error: null,
loading: false,
});
}
await refetchUserData();
router.push(`/${selectedWorkspace.slug}/${slug}`);
};
if (!selectedWorkspace) {
@@ -243,384 +252,376 @@ export function NewProjectPageContent({
return (
<Container>
<div className="mx-auto grid max-w-[760px] grid-flow-row gap-4 py-6 sm:py-14">
<Text variant="h2" component="h1">
New Project
</Text>
<form onSubmit={handleSubmit}>
<div className="mx-auto grid max-w-[760px] grid-flow-row gap-4 py-6 sm:py-14">
<Text variant="h2" component="h1">
New Project
</Text>
<div className="grid grid-flow-row gap-4">
<Input
id="name"
autoComplete="off"
label="Project Name"
variant="inline"
fullWidth
hideEmptyHelperText
placeholder="Project Name"
onChange={(event) => {
setSubmitState({
error: null,
loading: false,
});
setApplicationError('');
setName(event.target.value);
}}
value={name}
autoFocus
/>
<Select
id="workspace"
label="Workspace"
variant="inline"
hideEmptyHelperText
placeholder="Select Workspace"
slotProps={{
root: { className: 'grid grid-flow-col gap-1' },
}}
onChange={(_event, value) => {
const workspaceInList = workspaces.find(({ id }) => id === value);
setPlan(plans[0]);
setSelectedWorkspace({
id: workspaceInList.id,
name: workspaceInList.name,
disabled: false,
slug: workspaceInList.slug,
});
}}
value={selectedWorkspace.id}
renderValue={(option) => (
<span className="inline-grid grid-flow-col items-center gap-2">
{option?.label}
</span>
)}
>
{workspaceOptions.map((option) => (
<Option
value={option.id}
key={option.id}
className="grid grid-flow-col items-center gap-2"
>
<span className="inline-block h-6 w-6 overflow-hidden rounded-md">
<Image
src="/logos/new.svg"
alt="Nhost Logo"
width={24}
height={24}
/>
</span>
{option.name}
</Option>
))}
</Select>
{isK8SPostgresEnabledInCurrentEnvironment && (
<div className="grid grid-flow-row gap-4">
<Input
name="databasePassword"
id="databasePassword"
autoComplete="new-password"
label="Database Password"
value={databasePassword}
id="name"
autoComplete="off"
label="Project Name"
variant="inline"
type="password"
error={!!passwordError}
fullWidth
hideEmptyHelperText
endAdornment={
<InputAdornment position="end" className="mr-2">
<IconButton
color="secondary"
onClick={() => {
copy(databasePassword, 'Postgres password');
}}
variant="borderless"
aria-label="Copy password"
>
<CopyIcon className="h-4 w-4" />
</IconButton>
</InputAdornment>
}
slotProps={{
// Note: this is supposed to fix a `validateDOMNesting` error
helperText: { component: 'div' },
}}
helperText={
<div className="grid max-w-xs grid-flow-row gap-2">
{passwordError && (
<Text
variant="subtitle2"
sx={{
color: (theme) =>
`${theme.palette.error.main} !important`,
}}
>
{passwordError}
</Text>
)}
<Box className="font-medium">
The root Postgres password for your database - it must be
strong and hard to guess.{' '}
<Button
type="button"
variant="borderless"
color="secondary"
onClick={handleGenerateRandomPassword}
className="px-1 py-0.5 text-xs underline underline-offset-2 hover:underline"
tabIndex={-1}
>
Generate a password
</Button>
</Box>
</div>
}
onChange={async (e) => {
e.preventDefault();
placeholder="Project Name"
onChange={(event) => {
setSubmitState({
error: null,
loading: false,
});
if (e.target.value.length === 0) {
setDatabasePassword(e.target.value);
setPasswordError('Please enter a password');
return;
}
setDatabasePassword(e.target.value);
setPasswordError('');
try {
await resetDatabasePasswordValidationSchema.validate({
databasePassword: e.target.value,
});
setPasswordError('');
} catch (validationError) {
setPasswordError(validationError.message);
}
setName(event.target.value);
}}
fullWidth
value={name}
autoFocus
/>
)}
<Select
id="region"
label="Region"
variant="inline"
hideEmptyHelperText
placeholder="Select Region"
slotProps={{
root: { className: 'grid grid-flow-col gap-1' },
}}
onChange={(_event, value) => {
const regionInList = regions.find(({ id }) => id === value);
setPlan(plans[0]);
setSelectedRegion({
id: regionInList.id,
name: regionInList.country.name,
disabled: false,
code: regionInList.country.code,
});
}}
value={selectedRegion.id}
renderValue={(option) => {
const [flag, , country] = (option?.label as any[]) || [];
return (
<span className="inline-grid grid-flow-col grid-rows-none items-center gap-x-2">
{flag}
{isValidElement<TextProps>(country)
? cloneElement(country, {
...country.props,
variant: 'body1',
})
: null}
</span>
);
}}
>
{regionOptions.map((option) => (
<Option
value={option.id}
key={option.id}
className={twMerge(
'relative grid grid-flow-col grid-rows-2 items-center justify-start gap-x-3',
option.disabled && 'pointer-events-none opacity-50',
)}
disabled={option.disabled}
>
<span className="row-span-2 flex">
<Image
src={`/assets/flags/${option.code}.svg`}
alt={`${option.country} country flag`}
width={16}
height={12}
/>
<Select
id="workspace"
label="Workspace"
variant="inline"
hideEmptyHelperText
placeholder="Select Workspace"
slotProps={{
root: { className: 'grid grid-flow-col gap-1' },
}}
onChange={(_event, value) => {
const workspaceInList = workspaces.find(
({ id }) => id === value,
);
setPlan(plans[0]);
setSelectedWorkspace({
id: workspaceInList.id,
name: workspaceInList.name,
disabled: false,
slug: workspaceInList.slug,
});
}}
value={selectedWorkspace.id}
renderValue={(option) => (
<span className="inline-grid grid-flow-col items-center gap-2">
{option?.label}
</span>
)}
>
{workspaceOptions.map((option) => (
<Option
value={option.id}
key={option.id}
className="grid grid-flow-col items-center gap-2"
>
<span className="inline-block h-6 w-6 overflow-hidden rounded-md">
<Image
src="/logos/new.svg"
alt="Nhost Logo"
width={24}
height={24}
/>
</span>
<Text className="row-span-1 font-medium">{option.name}</Text>
{option.name}
</Option>
))}
</Select>
<Text variant="subtitle2" className="row-span-1">
{option.country}
</Text>
{isK8SPostgresEnabledInCurrentEnvironment && (
<Input
name="databasePassword"
id="databasePassword"
autoComplete="new-password"
label="Database Password"
value={databasePassword}
variant="inline"
type="password"
error={!!passwordError}
hideEmptyHelperText
endAdornment={
<InputAdornment position="end" className="mr-2">
<IconButton
color="secondary"
onClick={() => {
copy(databasePassword, 'Postgres password');
}}
variant="borderless"
aria-label="Copy password"
>
<CopyIcon className="h-4 w-4" />
</IconButton>
</InputAdornment>
}
slotProps={{
// Note: this is supposed to fix a `validateDOMNesting` error
helperText: { component: 'div' },
}}
helperText={
<div className="grid max-w-xs grid-flow-row gap-2">
{passwordError && (
<Text
variant="subtitle2"
sx={{
color: (theme) =>
`${theme.palette.error.main} !important`,
}}
>
{passwordError}
</Text>
)}
{option.disabled && (
<Text
variant="subtitle2"
className="absolute top-1/2 right-4 -translate-y-1/2"
>
Disabled
</Text>
)}
</Option>
))}
</Select>
<Box className="font-medium">
The root Postgres password for your database - it must be
strong and hard to guess.{' '}
<Button
type="button"
variant="borderless"
color="secondary"
onClick={handleGenerateRandomPassword}
className="px-1 py-0.5 text-xs underline underline-offset-2 hover:underline"
tabIndex={-1}
>
Generate a password
</Button>
</Box>
</div>
}
onChange={async (e) => {
e.preventDefault();
setSubmitState({
error: null,
loading: false,
});
setDatabasePassword(e.target.value);
<div className="grid w-full grid-cols-8 gap-x-4 gap-y-2">
<div className="col-span-8 sm:col-span-2">
<Text className="text-xs font-medium">Plan</Text>
<Text variant="subtitle2">You can change this later.</Text>
</div>
try {
await resetDatabasePasswordValidationSchema.validate({
databasePassword: e.target.value,
});
setPasswordError('');
} catch (validationError) {
setPasswordError(validationError.message);
}
}}
fullWidth
/>
)}
<div className="col-span-8 sm:col-span-6">
{plans.map((currentPlan) => {
const checked = plan.id === currentPlan.id;
<Select
id="region"
label="Region"
variant="inline"
hideEmptyHelperText
placeholder="Select Region"
slotProps={{
root: { className: 'grid grid-flow-col gap-1' },
}}
onChange={(_event, value) => {
const regionInList = regions.find(({ id }) => id === value);
setSelectedRegion({
id: regionInList.id,
name: regionInList.country.name,
disabled: false,
code: regionInList.country.code,
});
}}
value={selectedRegion.id}
renderValue={(option) => {
const [flag, , country] = (option?.label as any[]) || [];
return (
<Box
className="border-t py-4 last-of-type:border-b"
key={currentPlan.id}
>
<Checkbox
label={
<>
<span className="inline-block max-w-xs">
<span className="font-medium">
{currentPlan.name}:
</span>{' '}
{planDescriptions[currentPlan.name]}
</span>
<span className="inline-grid grid-flow-col grid-rows-none items-center gap-x-2">
{flag}
{currentPlan.isFree ? (
<Text variant="h3" component="span">
Free
</Text>
) : (
<Text
variant="h3"
component="span"
className="inline-grid grid-flow-col items-center gap-1"
>
$ {currentPlan.price}{' '}
<Text variant="subtitle2" component="span">
/ mo
</Text>
</Text>
)}
</>
}
componentsProps={{
formControlLabel: {
className: 'flex',
componentsProps: {
typography: {
className:
'font-regular text-xs grid grid-flow-col justify-between items-center w-full',
},
},
},
}}
checked={checked}
key={currentPlan.id}
onChange={(event, inputChecked) => {
if (!inputChecked) {
event.preventDefault();
return;
}
setPlan(currentPlan);
}}
/>
</Box>
{isValidElement<TextProps>(country)
? cloneElement(country, {
...country.props,
variant: 'body1',
})
: null}
</span>
);
})}
</div>
</div>
</div>
{submitState.error && (
<Alert severity="error" className="text-left">
<Text className="font-medium">Warning</Text>{' '}
<Text className="font-medium">
{submitState.error &&
getErrorMessage(submitState.error, 'application')}{' '}
asdsda
</Text>
</Alert>
)}
<div className="flex justify-end">
{showPaymentModal && (
<Modal
showModal={showPaymentModal}
close={() => {
setShowPaymentModal(false);
}}
>
<BillingPaymentMethodForm
{regionOptions.map((option) => (
<Option
value={option.id}
key={option.id}
className={twMerge(
'relative grid grid-flow-col grid-rows-2 items-center justify-start gap-x-3',
option.disabled && 'pointer-events-none opacity-50',
)}
disabled={option.disabled}
>
<span className="row-span-2 flex">
<Image
src={`/assets/flags/${option.code}.svg`}
alt={`${option.country} country flag`}
width={16}
height={12}
/>
</span>
<Text className="row-span-1 font-medium">{option.name}</Text>
<Text variant="subtitle2" className="row-span-1">
{option.country}
</Text>
{option.disabled && (
<Text
variant="subtitle2"
className="absolute top-1/2 right-4 -translate-y-1/2"
>
Disabled
</Text>
)}
</Option>
))}
</Select>
<div className="grid w-full grid-cols-8 gap-x-4 gap-y-2">
<div className="col-span-8 sm:col-span-2">
<Text className="text-xs font-medium">Plan</Text>
<Text variant="subtitle2">You can change this later.</Text>
</div>
<RadioGroup
value={plan.id}
onChange={(_event, value) => {
setPlan(plans.find((p) => p.id === value));
}}
className="col-span-8 space-y-2 sm:col-span-6"
>
{plans.map((currentPlan) => {
const disabledPlan =
currentPlan.isFree &&
numberOfFreeAndLiveProjects >= MAX_FREE_PROJECTS;
return (
<Tooltip
visible={disabledPlan}
title="Only one free project can be active at any given time. Please pause your active free project before creating a new one."
key={currentPlan.id}
slotProps={{
tooltip: { className: '!max-w-xs w-full text-center' },
}}
>
<Box className="w-full rounded-md border">
<Radio
slotProps={{
formControl: {
className: 'p-3 w-full',
slotProps: {
typography: { className: 'w-full' },
},
},
}}
value={currentPlan.id}
disabled={disabledPlan}
label={
<div className="flex w-full items-center justify-between ">
<div className="inline-block max-w-xs">
<Text className="font-medium text-[inherit]">
{currentPlan.name}
</Text>
<Text className="text-xs text-[inherit]">
{planDescriptions[currentPlan.name]}
</Text>
</div>
{currentPlan.isFree ? (
<Text
variant="h3"
component="span"
className="text-[inherit]"
>
Free
</Text>
) : (
<Text variant="h3" component="span">
${currentPlan.price}/mo
</Text>
)}
</div>
}
/>
</Box>
</Tooltip>
);
})}
</RadioGroup>
</div>
</div>
{submitState.error && (
<Alert severity="error" className="text-left">
<Text className="font-medium">Error</Text>{' '}
<Text className="font-medium">
{submitState.error &&
getErrorMessage(submitState.error, 'application')}{' '}
</Text>
</Alert>
)}
<div className="flex justify-end">
{showPaymentModal && (
<Modal
showModal={showPaymentModal}
close={() => {
setShowPaymentModal(false);
}}
onPaymentMethodAdded={handleSubmit}
workspaceId={workspace.id}
/>
</Modal>
)}
>
<BillingPaymentMethodForm
close={() => {
setShowPaymentModal(false);
}}
onPaymentMethodAdded={handleSubmit}
workspaceId={workspace.id}
/>
</Modal>
)}
<Button
onClick={() => {
if (!plan.isFree && workspace.paymentMethods.length === 0) {
setShowPaymentModal(true);
return;
}
handleSubmit();
}}
type="submit"
loading={submitState.loading}
disabled={
!!applicationError ||
!!submitState.error ||
!!passwordError ||
maintenanceActive
}
id="create-app"
>
Create Project
</Button>
<Button
type="submit"
loading={submitState.loading}
disabled={!!passwordError || maintenanceActive}
id="create-app"
>
Create Project
</Button>
</div>
</div>
</div>
</form>
</Container>
);
}
export default function NewProjectPage() {
const { data, loading, error } = usePrefetchNewAppQuery();
const router = useRouter();
const user = useUserData();
if (error) {
throw error;
const { data, loading, error } = usePrefetchNewAppQuery();
const {
data: freeAndActiveProjectsData,
loading: freeAndActiveProjectsLoading,
error: freeAndActiveProjectsError,
} = useGetFreeAndActiveProjectsQuery({
variables: { userId: user?.id },
fetchPolicy: 'cache-and-network',
});
if (error || freeAndActiveProjectsError) {
throw error || freeAndActiveProjectsError;
}
if (loading) {
if (loading || freeAndActiveProjectsLoading) {
return (
<ActivityIndicator delay={500} label="Loading plans and regions..." />
);
}
const { workspace } = router.query;
const { regions, plans, workspaces } = data;
// get pre-selected workspace
@@ -629,13 +630,16 @@ export default function NewProjectPage() {
? workspaces.find((w) => w.slug === workspace)
: workspaces[0];
const preSelectedRegion = regions.filter((region) => region.active)[0];
const preSelectedRegion = regions.find((region) => region.active);
return (
<NewProjectPageContent
regions={regions}
plans={plans}
workspaces={workspaces}
numberOfFreeAndLiveProjects={
freeAndActiveProjectsData?.freeAndActiveProjects.length
}
preSelectedWorkspace={preSelectedWorkspace}
preSelectedRegion={preSelectedRegion}
/>

View File

@@ -22,3 +22,8 @@ export const READ_ONLY_SCHEMAS = ['auth', 'storage'];
* Key used to store the color preference in local storage.
*/
export const COLOR_PREFERENCE_STORAGE_KEY = 'nhost-color-preference';
/**
* Maximum number of free projects a user is allowed to have.
*/
export const MAX_FREE_PROJECTS = 1;

File diff suppressed because it is too large Load Diff

View File

@@ -4,6 +4,10 @@ import { isDevOrStaging } from './helpers';
* @param content {string} This string to log on the particular channel.
*/
export const discordAnnounce = async (content: string) => {
if (!process.env.NEXT_PUBLIC_DISCORD_LOGGING) {
return;
}
const username = isDevOrStaging() ? 'console-next(dev)' : 'console-next';
const params = {

View File

@@ -1,5 +1,11 @@
# @nhost/docs
## 0.0.14
### Patch Changes
- bfb4c1a6: fix(docs): restore autogenerated `@nhost/nhost-js` docs
## 0.0.13
### Patch Changes

View File

@@ -10,7 +10,7 @@ In this section:
- [Overview](/reference/javascript)
- [Authentication](/reference/javascript/auth)
- [Storage](/reference/javascript/storage)
- [Functions](/reference/javascript/functions)
- [Functions](/reference/javascript/nhost-js/functions)
- [GraphQL](/reference/javascript/graphql)
### React

View File

@@ -1,60 +0,0 @@
---
title: call()
sidebar_label: call()
slug: /reference/javascript/functions/call
description: Use `nhost.functions.call` to call (sending a POST request to) a serverless function.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/clients/functions/index.ts#L55
---
# `call()`
## Overload 1 of 2
Use `nhost.functions.call` to call (sending a POST request to) a serverless function.
:::caution Deprecated
Axios will be replaced by cross-fetch in the near future. Only the headers configuration will be kept.
:::
### Parameters
---
**<span className="parameter-name">url</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">data</span>** <span className="optional-status">optional</span> <code>D</code>
---
**<span className="parameter-name">config</span>** <span className="optional-status">optional</span> <code>AxiosRequestConfig&lt;any&gt; &amp; { useAxios: "true" } &amp; [`NhostFunctionCallConfig`](/reference/javascript/functions/types/nhost-function-call-config) &amp; { useAxios: "true" }</code>
---
## Overload 2 of 2
Use `nhost.functions.call` to call (sending a POST request to) a serverless function.
```ts
await nhost.functions.call('send-welcome-email', {
email: 'joe@example.com',
name: 'Joe Doe'
})
```
### Parameters
---
**<span className="parameter-name">url</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">data</span>** <span className="optional-status">required</span> <code>D</code>
---
**<span className="parameter-name">config</span>** <span className="optional-status">optional</span> <code>[`NhostFunctionCallConfig`](/reference/javascript/functions/types/nhost-function-call-config) &amp; { useAxios: "false" }</code>
---

View File

@@ -1,23 +0,0 @@
---
title: setAccessToken()
sidebar_label: setAccessToken()
slug: /reference/javascript/functions/set-access-token
description: Use `nhost.functions.setAccessToken` to a set an access token to be used in subsequent functions requests. Note that if you're signin in users with `nhost.auth.signIn()` the access token will be set automatically.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/clients/functions/index.ts#L155
---
# `setAccessToken()`
Use `nhost.functions.setAccessToken` to a set an access token to be used in subsequent functions requests. Note that if you're signin in users with `nhost.auth.signIn()` the access token will be set automatically.
```ts
nhost.functions.setAccessToken('some-access-token')
```
## Parameters
---
**<span className="parameter-name">accessToken</span>** <span className="optional-status">required</span> <code>undefined &#124; string</code>
---

View File

@@ -1,22 +0,0 @@
---
title: NhostFunctionsClient
sidebar_label: Functions
description: No description provided.
slug: /reference/javascript/functions
custom_edit_url: https://github.com/nhost/nhost/edit/main/docs/docs/reference/javascript/functions/index.mdx
---
# `NhostFunctionsClient`
## Parameters
---
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`NhostFunctionsConstructorParams`](/reference/javascript/functions/types/nhost-functions-constructor-params)
| Property | Type | Required | Notes |
| :--------------------------------------------------------------------------------------------- | :------------------ | :------: | :---------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">params.</span>url</span> | <code>string</code> | ✔️ | Serverless Functions endpoint. |
| <span className="parameter-name"><span className="light-grey">params.</span>adminSecret</span> | <code>string</code> | | Admin secret. When set, it is sent as an `x-hasura-admin-secret` header for all requests. |
---

View File

@@ -1,19 +0,0 @@
---
title: NhostFunctionCallConfig
sidebar_label: NhostFunctionCallConfig
description: Subset of RequestInit parameters that are supported by the functions client
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/clients/functions/types.ts#L41
---
# `NhostFunctionCallConfig`
Subset of RequestInit parameters that are supported by the functions client
## Parameters
---
**<span className="parameter-name">headers</span>** <span className="optional-status">optional</span> <code>Record&lt;string, string&gt;</code>
---

View File

@@ -1,15 +0,0 @@
---
title: NhostFunctionCallResponse
sidebar_label: NhostFunctionCallResponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/clients/functions/types.ts#L15
---
# `NhostFunctionCallResponse`
```ts
type NhostFunctionCallResponse =
| { res: { data: T; status: number; statusText: string }; error: null }
| { res: null; error: ErrorPayload }
```

View File

@@ -1,25 +0,0 @@
---
title: NhostFunctionsConstructorParams
sidebar_label: NhostFunctionsConstructorParams
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/clients/functions/types.ts#L4
---
# `NhostFunctionsConstructorParams`
## Parameters
---
**<span className="parameter-name">url</span>** <span className="optional-status">required</span> <code>string</code>
Serverless Functions endpoint.
---
**<span className="parameter-name">adminSecret</span>** <span className="optional-status">optional</span> <code>string</code>
Admin secret. When set, it is sent as an `x-hasura-admin-secret` header for all requests.
---

View File

@@ -10,7 +10,7 @@ The Nhost JavaScript client is the primary way of interacting with your Nhost pr
- [Authentication](/reference/javascript/auth)
- [Storage](/reference/javascript/storage)
- [Functions](/reference/javascript/functions)
- [Functions](/reference/javascript/nhost-js/functions)
- [GraphQL](/reference/javascript/graphql)
## Installation

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/docs",
"version": "0.0.13",
"version": "0.0.14",
"private": true,
"scripts": {
"docusaurus": "docusaurus",

View File

@@ -111,12 +111,12 @@ const sidebars = {
label: 'Functions',
link: {
type: 'doc',
id: 'reference/javascript/functions/index'
id: 'reference/docgen/javascript/nhost-js/content/nhost-functions-client/index'
},
items: [
{
type: 'autogenerated',
dirName: 'reference/javascript/functions/content'
dirName: 'reference/docgen/javascript/nhost-js/content/nhost-functions-client/content'
}
]
},

View File

@@ -1,5 +1,15 @@
# @nhost-examples/nextjs
## 0.1.8
### Patch Changes
- ce1ee40d: fix(nextjs): allow `subdomain`, `region` and service URLs
- Updated dependencies [ce1ee40d]
- @nhost/nextjs@1.13.16
- @nhost/react@2.0.10
- @nhost/react-apollo@5.0.11
## 0.1.7
### Patch Changes

View File

@@ -1,2 +1 @@
export * from './queries'
export const BACKEND_URL = 'http://127.0.0.1:1337'

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/nextjs",
"version": "0.1.7",
"version": "0.1.8",
"private": true,
"scripts": {
"dev": "next dev",

View File

@@ -6,7 +6,6 @@ import { inspect } from '@xstate/inspect'
import type { AppProps } from 'next/app'
import Head from 'next/head'
import NavBar from '../components/NavBar'
import { BACKEND_URL } from '../helpers'
import '../styles/globals.css?inline'
const devTools = typeof window !== 'undefined' && !!process.env.NEXT_PUBLIC_DEBUG
@@ -16,7 +15,7 @@ if (devTools) {
iframe: false
})
}
const nhost = new NhostClient({ backendUrl: BACKEND_URL, devTools })
const nhost = new NhostClient({ subdomain: 'localhost', devTools })
const title = 'Nhost with NextJs'
function MyApp({ Component, pageProps }: AppProps) {
// * Monorepo-related. See: https://stackoverflow.com/questions/71843247/react-nextjs-type-error-component-cannot-be-used-as-a-jsx-component

View File

@@ -4,10 +4,9 @@ import { Container, Title } from '@mantine/core'
import { getNhostSession, NhostSession, useAccessToken } from '@nhost/nextjs'
import { authProtected } from '../components/protected-route'
import { BACKEND_URL } from '../helpers'
export const getServerSideProps: GetServerSideProps = async (context) => {
const nhostSession = await getNhostSession(BACKEND_URL, context)
const nhostSession = await getNhostSession({ subdomain: 'localhost' }, context)
return {
props: {
nhostSession

View File

@@ -3,10 +3,8 @@ import { GetServerSideProps } from 'next'
import { Container, Title } from '@mantine/core'
import { getNhostSession, NhostSession, useAccessToken, useAuthenticated } from '@nhost/nextjs'
import { BACKEND_URL } from '../helpers'
export const getServerSideProps: GetServerSideProps = async (context) => {
const nhostSession = await getNhostSession(BACKEND_URL, context)
const nhostSession = await getNhostSession({ subdomain: 'localhost' }, context)
return {
props: {
nhostSession

View File

@@ -1,5 +1,18 @@
# @nhost/apollo
## 5.1.1
### Patch Changes
- @nhost/nhost-js@2.1.1
## 5.1.0
### Patch Changes
- Updated dependencies [bfb4c1a6]
- @nhost/nhost-js@2.1.0
## 5.0.9
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/apollo",
"version": "5.0.9",
"version": "5.1.1",
"description": "Nhost Apollo Client library",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,19 @@
# @nhost/react-apollo
## 5.0.12
### Patch Changes
- @nhost/apollo@5.1.1
- @nhost/react@2.0.11
## 5.0.11
### Patch Changes
- @nhost/apollo@5.1.0
- @nhost/react@2.0.10
## 5.0.10
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react-apollo",
"version": "5.0.10",
"version": "5.0.12",
"description": "Nhost React Apollo client",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,17 @@
# @nhost/react-urql
## 2.0.11
### Patch Changes
- @nhost/react@2.0.11
## 2.0.10
### Patch Changes
- @nhost/react@2.0.10
## 2.0.9
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react-urql",
"version": "2.0.9",
"version": "2.0.11",
"description": "Nhost React URQL client",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,11 @@
# @nhost/graphql-js
## 0.1.0
### Minor Changes
- bfb4c1a6: chore(sdk): remove deprecated `useAxios` property
## 0.0.5
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/graphql-js",
"version": "0.0.5",
"version": "0.1.0",
"description": "Nhost GraphQL client",
"license": "MIT",
"keywords": [

View File

@@ -47,6 +47,4 @@ export type NhostGraphqlRequestResponse<T = unknown> =
/** Subset of RequestInit parameters that are supported by the graphql client */
export interface NhostGraphqlRequestConfig {
headers?: Record<string, string>
/** @deprecated Axios has been replaced by cross-fetch. You should now remove this option. */
useAxios?: false
}

View File

@@ -1,5 +1,11 @@
# @nhost/hasura-storage-js
## 2.0.4
### Patch Changes
- 614f213e: fix(hasura-storage-js): allow image transformation parameters in `getPresignedUrl`
## 2.0.3
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/hasura-storage-js",
"version": "2.0.3",
"version": "2.0.4",
"description": "Hasura-storage client",
"license": "MIT",
"keywords": [
@@ -47,6 +47,7 @@
"e2e": "start-test e2e:backend http-get://localhost:9695 ci:test",
"ci:test": "vitest run",
"e2e:backend": "nhost dev --no-browser",
"test": "vitest --config ./vite.unit.config.js",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"prettier": "prettier --check src/",

View File

@@ -129,6 +129,7 @@ export class HasuraStorageClient {
async getPresignedUrl(
params: StorageGetPresignedUrlParams
): Promise<StorageGetPresignedUrlResponse> {
const { fileId, ...imageTransformationParams } = params
const { presignedUrl, error } = await this.api.getPresignedUrl(params)
if (error) {
return { presignedUrl: null, error }
@@ -138,7 +139,18 @@ export class HasuraStorageClient {
return { presignedUrl: null, error: new Error('Invalid file id') }
}
return { presignedUrl, error: null }
const urlWithTransformationParams = appendImageTransformationParameters(
presignedUrl.url,
imageTransformationParams
)
return {
presignedUrl: {
...presignedUrl,
url: urlWithTransformationParams
},
error: null
}
}
/**

View File

@@ -0,0 +1,41 @@
import { expect, test } from 'vitest'
import appendImageTransformationParameters from './appendImageTransformationParameters'
test('should append image transformation parameters to a simple URL', () => {
expect(
appendImageTransformationParameters('https://example.com/', {
width: 100,
height: 100,
blur: 50,
quality: 80
})
).toBe('https://example.com/?w=100&h=100&b=50&q=80')
})
test('should append image transformation parameters to a URL with existing query parameters', () => {
expect(
appendImageTransformationParameters('https://example.com/?foo=bar', {
width: 100,
height: 100,
blur: 50,
quality: 80
})
).toBe('https://example.com/?foo=bar&w=100&h=100&b=50&q=80')
})
test('should not append falsy values', () => {
expect(
appendImageTransformationParameters('https://example.com/', {
width: undefined,
height: 100,
blur: undefined,
quality: 80
})
).toBe('https://example.com/?h=100&q=80')
})
test('should keep the original URL if no transformation parameters are provided', () => {
expect(appendImageTransformationParameters('https://example.com/', {})).toBe(
'https://example.com/'
)
})

View File

@@ -0,0 +1,36 @@
import { StorageImageTransformationParams } from '../types'
/**
* Appends image transformation parameters to the URL. If the URL already
* contains query parameters, the transformation parameters are appended to
* the existing query parameters.
*
* @internal
* @param url - The URL to append the transformation parameters to.
* @param params - The image transformation parameters.
* @returns The URL with the transformation parameters appended.
*/
export default function appendImageTransformationParameters(
url: string,
params: StorageImageTransformationParams
): string {
const urlObject = new URL(url)
// create an object with the transformation parameters by using the first
// character of the parameter name as the key
const imageTransformationParams = Object.entries(params).reduce(
(accumulator, [key, value]) => ({ ...accumulator, [key.charAt(0)]: value }),
{} as Record<string, any>
)
// set the query parameters in the URL object
Object.entries(imageTransformationParams).forEach(([key, value]) => {
if (!value) {
return
}
urlObject.searchParams.set(key, value)
})
return urlObject.toString()
}

View File

@@ -0,0 +1 @@
export { default as appendImageTransformationParameters } from './appendImageTransformationParameters'

View File

@@ -1,13 +1,2 @@
import { StorageImageTransformationParams } from './types'
export * from './appendImageTransformationParameters'
export * from './types'
export const appendImageTransformationParameters = (
url: string,
params: StorageImageTransformationParams
): string => {
const queryParameters = Object.entries(params)
.map(([key, value]) => `${key.charAt(0)}=${value}`)
.join('&')
return queryParameters ? `${url}?${queryParameters}` : url
}

View File

@@ -65,9 +65,7 @@ export interface StorageGetUrlParams extends StorageImageTransformationParams {
fileId: string
}
// TODO not implemented yet in hasura-storage
// export interface StorageGetPresignedUrlParams extends StorageImageTransformationParams {
export interface StorageGetPresignedUrlParams {
export interface StorageGetPresignedUrlParams extends StorageImageTransformationParams {
fileId: string
}

View File

@@ -0,0 +1,15 @@
import { defineConfig } from 'vite'
import baseConfig from '../../config/vite.lib.config'
const PWD = process.env.PWD
export default defineConfig({
...baseConfig,
test: {
...(baseConfig.test || {}),
testTimeout: 30000,
environment: 'node',
include: [`${PWD}/src/**/*.{spec,test}.{ts,tsx}`]
}
})

View File

@@ -1,5 +1,18 @@
# @nhost/nextjs
## 1.13.17
### Patch Changes
- @nhost/react@2.0.11
## 1.13.16
### Patch Changes
- ce1ee40d: fix(nextjs): allow `subdomain`, `region` and service URLs
- @nhost/react@2.0.10
## 1.13.15
### Patch Changes

View File

@@ -70,7 +70,10 @@ import {
} from '@nhost/nextjs'
export async function getServerSideProps(context: NextPageContext) {
const nhostSession = await getNhostSession('<Your Nhost Backend URL>', context)
const nhostSession = await getNhostSession(
{ subdomain: '<project_subdomain>', region: '<project_region>' },
context
)
return {
props: {

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/nextjs",
"version": "1.13.15",
"version": "1.13.17",
"description": "Nhost NextJS library",
"license": "MIT",
"keywords": [

View File

@@ -1,6 +1,7 @@
import {
AuthMachine,
NhostClient,
NhostReactClientConstructorParams,
NhostSession,
NHOST_REFRESH_TOKEN_KEY,
VanillaNhostClient
@@ -11,21 +12,42 @@ import { StateFrom } from 'xstate'
import { waitFor } from 'xstate/lib/waitFor'
import { NHOST_SESSION_KEY } from './utils'
export type CreateServerSideClientParams = Pick<
NhostReactClientConstructorParams,
'subdomain' | 'region' | 'authUrl' | 'functionsUrl' | 'graphqlUrl' | 'storageUrl'
>
/**
* Creates an Nhost client that runs on the server side.
* It will try to get the refesh token in cookies, or from the request URL
* If a refresh token is found, it uses it to get an up to date access token (JWT) and a user session
* This method resolves when the authentication status is known eventually
* @param backendUrl
* @param context
* @param config - An object containing connection information
* @param context - Server side context
* @returns instance of `NhostClient` that is ready to use on the server side (signed in or signed out)
*/
export const createServerSideClient = async (
backendUrl: string,
params: string | CreateServerSideClientParams,
context: GetServerSidePropsContext
): Promise<NhostClient> => {
let clientParams: NhostReactClientConstructorParams
if (typeof params === 'string') {
console.warn(
'Deprecation Notice: Backend URL is no longer supported. Please use subdomain + region or individual service URLs.'
)
clientParams = {
backendUrl: params
}
} else {
clientParams = {
...params
}
}
const nhost = new VanillaNhostClient({
backendUrl,
...clientParams,
clientStorageType: 'custom',
clientStorage: {
getItem: (key) => {

View File

@@ -1,6 +1,6 @@
import { NhostSession } from '@nhost/react'
import { GetServerSidePropsContext } from 'next'
import { createServerSideClient } from './create-server-side-client'
import { createServerSideClient, CreateServerSideClientParams } from './create-server-side-client'
/**
* Refreshes the access token if there is any and returns the Nhost session.
@@ -10,7 +10,10 @@ import { createServerSideClient } from './create-server-side-client'
*
* ```js
* export const getServerSideProps: GetServerSideProps = async (context) => {
* const nhostSession = await getNhostSession(BACKEND_URL, context)
* const nhostSession = await getNhostSession(
* { subdomain: '<project_subdomain>', region: '<project_region>' },
* context
* )
*
* return {
* props: {
@@ -25,7 +28,10 @@ import { createServerSideClient } from './create-server-side-client'
*
* ```js
* export async function getServerSideProps(context: GetServerSidePropsContext) { // or NextPageContext
* const nhostSession = await getNhostSession(BACKEND_URL, context)
* const nhostSession = await getNhostSession(
* { subdomain: '<project_subdomain>', region: '<project_region>' },
* context
* )
*
* return {
* props: {
@@ -40,10 +46,10 @@ import { createServerSideClient } from './create-server-side-client'
* @returns Nhost session
*/
export const getNhostSession = async (
backendUrl: string,
params: string | CreateServerSideClientParams,
context: GetServerSidePropsContext
): Promise<NhostSession | null> => {
const nhost = await createServerSideClient(backendUrl, context)
const nhost = await createServerSideClient(params, context)
const { accessToken, refreshToken, user } = nhost.auth.client.interpreter!.getSnapshot().context
return nhost.auth.isAuthenticated()
? {

View File

@@ -1,5 +1,23 @@
# @nhost/nhost-js
## 2.1.1
### Patch Changes
- Updated dependencies [614f213e]
- @nhost/hasura-storage-js@2.0.4
## 2.1.0
### Minor Changes
- bfb4c1a6: chore(sdk): remove deprecated `useAxios` property
### Patch Changes
- Updated dependencies [bfb4c1a6]
- @nhost/graphql-js@0.1.0
## 2.0.9
### Patch Changes

View File

@@ -0,0 +1,10 @@
{
"title": "Nhost JS",
"path": "./.docgen/nhost-js.json",
"output": "../../docs/docs/reference/docgen/javascript/nhost-js",
"root": "reference/docgen/javascript/nhost-js",
"slug": "/reference/javascript/nhost-js",
"sidebarConfig": "referenceSidebar",
"baseEditUrl": "https://github.com/nhost/nhost/edit/main/packages",
"cleanup": true
}

View File

@@ -0,0 +1,25 @@
{
"$schema": "https://typedoc.org/schema.json",
"entryPoints": ["src/index.ts"],
"exclude": ["*.(spec|test).tsx?"],
"sort": ["source-order"],
"json": "./.docgen/nhost-js.json",
"name": "Nhost JS",
"readme": "none",
"githubPages": false,
"cleanOutputDir": false,
"excludeInternal": true,
"excludePrivate": true,
"compilerOptions": {
"rootDir": "../..",
"paths": {
"@nhost/apollo": ["../../integrations/apollo/src/index.ts"],
"@nhost/hasura-auth-js": ["../hasura-auth-js/src/index.ts"],
"@nhost/hasura-storage-js": ["../hasura-storage-js/src/index.ts"],
"@nhost/nhost-js": ["../nhost-js/src/index.ts"],
"@nhost/nextjs": ["../nextjs/src/index.ts"],
"@nhost/react": ["../react/src/index.ts"],
"@nhost/react-apollo": ["../../integrations/react-apollo/src/index.ts"]
}
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/nhost-js",
"version": "2.0.9",
"version": "2.1.1",
"description": "Nhost JavaScript SDK",
"license": "MIT",
"keywords": [
@@ -55,7 +55,9 @@
"lint": "eslint . --ext .ts,.tsx",
"lint:fix": "eslint . --ext .ts,.tsx --fix",
"verify": "run-p prettier lint",
"verify:fix": "run-p prettier:fix lint:fix"
"verify:fix": "run-p prettier:fix lint:fix",
"typedoc": "typedoc --options ./nhost-js.typedoc.json --tsconfig ./typedoc.tsconfig.json",
"docgen": "pnpm typedoc && docgen --config ./nhost-js.docgen.json"
},
"dependencies": {
"@nhost/graphql-js": "workspace:*",
@@ -64,6 +66,7 @@
"isomorphic-unfetch": "^3.1.0"
},
"devDependencies": {
"@nhost/docgen": "workspace:*",
"graphql": "16.6.0"
},
"peerDependencies": {

View File

@@ -38,12 +38,6 @@ export class NhostFunctionsClient {
this.adminSecret = adminSecret
}
async call<T = unknown, D = any>(
url: string,
data: D | null,
config?: NhostFunctionCallConfig
): Promise<NhostFunctionCallResponse<T>>
/**
* Use `nhost.functions.call` to call (sending a POST request to) a serverless function.
*

View File

@@ -28,6 +28,4 @@ export type NhostFunctionCallResponse<T = unknown> =
/** Subset of RequestInit parameters that are supported by the functions client */
export interface NhostFunctionCallConfig {
headers?: Record<string, string>
/** @deprecated Axios has been replaced by cross-fetch. You should now remove this option. */
useAxios?: false
}

View File

@@ -6,7 +6,7 @@ import { NhostClientConstructorParams } from '../utils/types'
/**
* Creates a client for Storage from either a subdomain or a URL
*/
export function createStorageClient(params: NhostClientConstructorParams<undefined>) {
export function createStorageClient(params: NhostClientConstructorParams) {
const storageUrl =
'subdomain' in params || 'backendUrl' in params
? urlFromSubdomain(params, 'storage')

View File

@@ -0,0 +1,6 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"paths": {}
}
}

View File

@@ -1,5 +1,18 @@
# @nhost/react
## 2.0.11
### Patch Changes
- @nhost/nhost-js@2.1.1
## 2.0.10
### Patch Changes
- Updated dependencies [bfb4c1a6]
- @nhost/nhost-js@2.1.0
## 2.0.9
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react",
"version": "2.0.9",
"version": "2.0.11",
"description": "Nhost React library",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,18 @@
# @nhost/vue
## 1.13.17
### Patch Changes
- @nhost/nhost-js@2.1.1
## 1.13.16
### Patch Changes
- Updated dependencies [bfb4c1a6]
- @nhost/nhost-js@2.1.0
## 1.13.15
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/vue",
"version": "1.13.15",
"version": "1.13.17",
"description": "Nhost Vue library",
"license": "MIT",
"keywords": [

129
pnpm-lock.yaml generated
View File

@@ -86,8 +86,8 @@ importers:
'@emotion/styled': ^11.10.5
'@fontsource/inter': ^4.5.14
'@fontsource/roboto-mono': ^4.5.8
'@graphiql/react': ^0.15.0
'@graphiql/toolkit': ^0.8.0
'@graphiql/react': ^0.17.0
'@graphiql/toolkit': ^0.8.2
'@graphql-codegen/cli': ^3.0.0
'@graphql-codegen/typescript': ^3.0.0
'@graphql-codegen/typescript-graphql-request': ^4.5.1
@@ -113,7 +113,7 @@ importers:
'@storybook/manager-webpack5': ^6.5.14
'@storybook/react': ^6.5.14
'@storybook/testing-library': ^0.0.13
'@stripe/react-stripe-js': ^1.10.0
'@stripe/react-stripe-js': ^2.0.0
'@stripe/stripe-js': ^1.35.0
'@tailwindcss/forms': ^0.5.3
'@tanstack/react-query': ^4.16.1
@@ -154,7 +154,7 @@ importers:
eslint-plugin-react: ^7.31.11
eslint-plugin-react-hooks: ^4.6.0
generate-password: ^1.7.0
graphiql: ^2.2.0
graphiql: ^2.4.0
graphql: 16.6.0
graphql-request: ^4.3.0
graphql-tag: ^2.12.6
@@ -212,8 +212,8 @@ importers:
'@emotion/styled': 11.10.5_4ahanhknrtlidghakifap67h7q
'@fontsource/inter': 4.5.14
'@fontsource/roboto-mono': 4.5.8
'@graphiql/react': 0.15.0_755ntyjuho6qjwic26h62or3by
'@graphiql/toolkit': 0.8.0_7fbl5omhlrpwpn5f5culy6mafe
'@graphiql/react': 0.17.0_755ntyjuho6qjwic26h62or3by
'@graphiql/toolkit': 0.8.2_7fbl5omhlrpwpn5f5culy6mafe
'@headlessui/react': 1.7.4_biqbaboplfbrettd7655fr4n2y
'@heroicons/react': 1.0.6_react@18.2.0
'@hookform/resolvers': 2.9.10_react-hook-form@7.42.1
@@ -224,7 +224,7 @@ importers:
'@nhost/nextjs': link:../packages/nextjs
'@nhost/react-apollo': link:../integrations/react-apollo
'@segment/snippet': 4.15.3
'@stripe/react-stripe-js': 1.14.2_mljfwq7caaxrtdqn7u72ntpebq
'@stripe/react-stripe-js': 2.0.0_mljfwq7caaxrtdqn7u72ntpebq
'@stripe/stripe-js': 1.44.1
'@tailwindcss/forms': 0.5.3_tailwindcss@3.2.1
'@tanstack/react-query': 4.16.1_biqbaboplfbrettd7655fr4n2y
@@ -235,7 +235,7 @@ importers:
clsx: 1.2.1
date-fns: 2.29.3
generate-password: 1.7.0
graphiql: 2.2.0_755ntyjuho6qjwic26h62or3by
graphiql: 2.4.0_755ntyjuho6qjwic26h62or3by
graphql: 16.6.0
graphql-request: 4.3.0_rjjjs2nwgns3bcvnnqb5eu5nry
graphql-tag: 2.12.6_graphql@16.6.0
@@ -1020,6 +1020,7 @@ importers:
packages/nhost-js:
specifiers:
'@nhost/docgen': workspace:*
'@nhost/graphql-js': workspace:*
'@nhost/hasura-auth-js': workspace:*
'@nhost/hasura-storage-js': workspace:*
@@ -1031,6 +1032,7 @@ importers:
'@nhost/hasura-storage-js': link:../hasura-storage-js
isomorphic-unfetch: 3.1.0
devDependencies:
'@nhost/docgen': link:../docgen
graphql: 16.6.0
packages/react:
@@ -6451,25 +6453,26 @@ packages:
/@gqty/utils/1.0.0:
resolution: {integrity: sha512-QJMlzts//d0H5mlekOZgx1a4KsTYXfxmRhhx8g/8mvzdaNVPxhFzCsv3+ljTOzbW3A08qy4jXQPWAMoTefSJDQ==}
/@graphiql/react/0.15.0_755ntyjuho6qjwic26h62or3by:
resolution: {integrity: sha512-kJqkdf6d4Cck05Wt5yCDZXWfs7HZgcpuoWq/v8nOa698qVaNMM3qdG4CpRsZEexku0DSSJzWWuanxd5x+sRcFg==}
/@graphiql/react/0.17.0_755ntyjuho6qjwic26h62or3by:
resolution: {integrity: sha512-mn8FfucLJzFLQQ5OoJ9U1Dvnva1smOxBL89D2TSM2B6mmDyQIRhFXmjzUTPdsqwpauFiqkDaQZiqX7T/ZPrg/w==}
peerDependencies:
graphql: ^15.5.0 || ^16.0.0
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
dependencies:
'@graphiql/toolkit': 0.8.0_7fbl5omhlrpwpn5f5culy6mafe
'@graphiql/toolkit': 0.8.2_7fbl5omhlrpwpn5f5culy6mafe
'@reach/combobox': 0.17.0_biqbaboplfbrettd7655fr4n2y
'@reach/dialog': 0.17.0_zula6vjvt3wdocc4mwcxqa6nzi
'@reach/listbox': 0.17.0_biqbaboplfbrettd7655fr4n2y
'@reach/menu-button': 0.17.0_7i5myeigehqah43i5u7wbekgba
'@reach/tooltip': 0.17.0_biqbaboplfbrettd7655fr4n2y
'@reach/visually-hidden': 0.17.0_biqbaboplfbrettd7655fr4n2y
clsx: 1.2.1
codemirror: 5.65.9
codemirror-graphql: 2.0.2_xqvzjd2jznjsrt45ytiwcf3lei
codemirror-graphql: 2.0.4_xqvzjd2jznjsrt45ytiwcf3lei
copy-to-clipboard: 3.3.3
graphql: 16.6.0
graphql-language-service: 5.1.0_graphql@16.6.0
graphql-language-service: 5.1.2_graphql@16.6.0
markdown-it: 12.3.2
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
@@ -6482,8 +6485,8 @@ packages:
- react-is
dev: false
/@graphiql/toolkit/0.8.0_7fbl5omhlrpwpn5f5culy6mafe:
resolution: {integrity: sha512-DbMFhEKejpPzB6k8W3Mj+Rl8geXiw49USDF9Wdi06EEk1XLVh1iebDqveYY+4lViITsV4+BeGikxlqi8umfP4g==}
/@graphiql/toolkit/0.8.2_7fbl5omhlrpwpn5f5culy6mafe:
resolution: {integrity: sha512-FGtXBYTzcPuwfpaC+0BGeriLD6kwTdcF5xugGvjutk5J93Dgy2vw+SkBdbi1QGzz/jooETi1kEtFeDuWTzIG7Q==}
peerDependencies:
graphql: ^15.5.0 || ^16.0.0
graphql-ws: '>= 4.5.0'
@@ -6494,7 +6497,7 @@ packages:
'@n1ru4l/push-pull-async-iterable-iterator': 3.2.0
graphql: 16.6.0
graphql-ws: 5.11.2_graphql@16.6.0
meros: 1.2.0_@types+node@16.18.11
meros: 1.2.1_@types+node@16.18.11
transitivePeerDependencies:
- '@types/node'
dev: false
@@ -7845,7 +7848,7 @@ packages:
graphql: 16.6.0
graphql-ws: 5.11.2_graphql@16.6.0
isomorphic-ws: 5.0.0_ws@8.11.0
meros: 1.2.0_@types+node@16.18.11
meros: 1.2.1_@types+node@16.18.11
tslib: 2.5.0
value-or-promise: 1.0.12
ws: 8.11.0
@@ -7873,7 +7876,7 @@ packages:
graphql: 16.6.0
graphql-ws: 5.11.2_graphql@16.6.0
isomorphic-ws: 5.0.0_ws@8.11.0
meros: 1.2.0_@types+node@18.11.17
meros: 1.2.1_@types+node@18.11.17
tslib: 2.5.0
value-or-promise: 1.0.12
ws: 8.11.0
@@ -7901,7 +7904,7 @@ packages:
graphql: 16.6.0
graphql-ws: 5.11.2_graphql@16.6.0
isomorphic-ws: 5.0.0_ws@8.11.0
meros: 1.2.0
meros: 1.2.1
tslib: 2.5.0
value-or-promise: 1.0.12
ws: 8.11.0
@@ -7929,7 +7932,7 @@ packages:
graphql: 16.6.0
graphql-ws: 5.11.2_graphql@16.6.0
isomorphic-ws: 5.0.0_ws@8.11.0
meros: 1.2.0_@types+node@16.18.11
meros: 1.2.1_@types+node@16.18.11
tslib: 2.5.0
value-or-promise: 1.0.12
ws: 8.11.0
@@ -11545,10 +11548,10 @@ packages:
resolve-from: 5.0.0
dev: true
/@stripe/react-stripe-js/1.14.2_mljfwq7caaxrtdqn7u72ntpebq:
resolution: {integrity: sha512-8dGBdSFldq6dyiYgv3r4tOwS5PGAO/446hodegSKlmWg7NkAl0McopszXJd11A9otGi47v5OzCsljyfHJgnLhw==}
/@stripe/react-stripe-js/2.0.0_mljfwq7caaxrtdqn7u72ntpebq:
resolution: {integrity: sha512-JEzZlVdJaU9g3sZIcgCUXfHqvmDGF2pBqDVWxTJLAhSBNARp5kyFEoTFQzeCdPwrq3D4ZMJVgc6i6mbUgiXsgQ==}
peerDependencies:
'@stripe/stripe-js': ^1.42.1
'@stripe/stripe-js': ^1.44.1
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
dependencies:
@@ -15040,7 +15043,7 @@ packages:
/axios/0.25.0_debug@4.3.4:
resolution: {integrity: sha512-cD8FOb0tRH3uuEe6+evtAbgJtfxr7ly3fQjYcMcuPlgkwVS9xboaVIpcDV+cYQe+yGykgwZCs1pzjntcGa6l5g==}
dependencies:
follow-redirects: 1.15.2_debug@4.3.4
follow-redirects: 1.15.2
transitivePeerDependencies:
- debug
dev: true
@@ -16253,8 +16256,8 @@ packages:
resolution: {integrity: sha512-NiujjUFB4SwScJq2bwbYUtXbZhBSlY6vYzm++3Q6oC+U+injTqfPYFK8wS9COOmb2lueqp0ZRB4nK1VYeHgNyw==}
dev: true
/codemirror-graphql/2.0.2_xqvzjd2jznjsrt45ytiwcf3lei:
resolution: {integrity: sha512-9c1cItR+8lG7thmTnDDQ3zI8YesNKiFCp2BnLFkYWCtdhSSuCUHebU/Vurew6ayyUl8MBCldNx3Ev66QAWM5Kw==}
/codemirror-graphql/2.0.4_xqvzjd2jznjsrt45ytiwcf3lei:
resolution: {integrity: sha512-u68lfUJv4hESfIZLJUGSWU2+txNrfoT29EEMxNksDBPXjnF41Ivpp/r8rxJBXigNcDOBmjMfKfs1J4L0Jggwrg==}
peerDependencies:
'@codemirror/language': 6.0.0
codemirror: ^5.65.3
@@ -16263,7 +16266,7 @@ packages:
'@codemirror/language': 6.3.1
codemirror: 5.65.9
graphql: 16.6.0
graphql-language-service: 5.0.6_graphql@16.6.0
graphql-language-service: 5.1.2_graphql@16.6.0
dev: false
/codemirror/5.65.9:
@@ -20300,19 +20303,6 @@ packages:
peerDependenciesMeta:
debug:
optional: true
dev: false
/follow-redirects/1.15.2_debug@4.3.4:
resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==}
engines: {node: '>=4.0'}
peerDependencies:
debug: '*'
peerDependenciesMeta:
debug:
optional: true
dependencies:
debug: 4.3.4
dev: true
/for-each/0.3.3:
resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==}
@@ -21029,18 +21019,18 @@ packages:
resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==}
dev: true
/graphiql/2.2.0_755ntyjuho6qjwic26h62or3by:
resolution: {integrity: sha512-w1ujpCKMlkwkoUjeg0HpRiBBTm1WHAjHNkFv1TbMu6trjzz63mQ48GLZlmyQY1yhwmc+diCcvmmAt+AyvKLWWA==}
/graphiql/2.4.0_755ntyjuho6qjwic26h62or3by:
resolution: {integrity: sha512-lJ6OYDQkhAMZePrz8g6r9vMVmxa4SY9eEzzyJxsgE+jA+6PFKds2e8/tDAaCYfX0HNv84nc7W/th1vsHIdgYiA==}
peerDependencies:
graphql: ^15.5.0 || ^16.0.0
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
dependencies:
'@graphiql/react': 0.15.0_755ntyjuho6qjwic26h62or3by
'@graphiql/toolkit': 0.8.0_7fbl5omhlrpwpn5f5culy6mafe
'@graphiql/react': 0.17.0_755ntyjuho6qjwic26h62or3by
'@graphiql/toolkit': 0.8.2_7fbl5omhlrpwpn5f5culy6mafe
entities: 2.2.0
graphql: 16.6.0
graphql-language-service: 5.1.0_graphql@16.6.0
graphql-language-service: 5.1.2_graphql@16.6.0
markdown-it: 12.3.2
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
@@ -21204,19 +21194,8 @@ packages:
- utf-8-validate
dev: true
/graphql-language-service/5.0.6_graphql@16.6.0:
resolution: {integrity: sha512-FjE23aTy45Lr5metxCv3ZgSKEZOzN7ERR+OFC1isV5mHxI0Ob8XxayLTYjQKrs8b3kOpvgTYmSmu6AyXOzYslg==}
hasBin: true
peerDependencies:
graphql: ^15.5.0 || ^16.0.0
dependencies:
graphql: 16.6.0
nullthrows: 1.1.1
vscode-languageserver-types: 3.17.2
dev: false
/graphql-language-service/5.1.0_graphql@16.6.0:
resolution: {integrity: sha512-APffigZ/l2me6soek+Yq5Us3HBwmfw4vns4QoqsTePXkK3knVO8rn0uAC6PmTyglb1pmFFPbYaRIzW4wmcnnGQ==}
/graphql-language-service/5.1.2_graphql@16.6.0:
resolution: {integrity: sha512-oeuztbvd7fwKWZ/GCp0voqgctdIL4BDjTkd/phz1jEyH+pfj6inJWKKIkUJPW5ebWHx+mFsZ00wdE6tiCvW2fA==}
hasBin: true
peerDependencies:
graphql: ^15.5.0 || ^16.0.0
@@ -24032,39 +24011,6 @@ packages:
uuid: 9.0.0
dev: false
/meros/1.2.0:
resolution: {integrity: sha512-3QRZIS707pZQnijHdhbttXRWwrHhZJ/gzolneoxKVz9N/xmsvY/7Ls8lpnI9gxbgxjcHsAVEW3mgwiZCo6kkJQ==}
engines: {node: '>=12'}
peerDependencies:
'@types/node': '>=12'
peerDependenciesMeta:
'@types/node':
optional: true
dev: true
/meros/1.2.0_@types+node@16.18.11:
resolution: {integrity: sha512-3QRZIS707pZQnijHdhbttXRWwrHhZJ/gzolneoxKVz9N/xmsvY/7Ls8lpnI9gxbgxjcHsAVEW3mgwiZCo6kkJQ==}
engines: {node: '>=12'}
peerDependencies:
'@types/node': '>=12'
peerDependenciesMeta:
'@types/node':
optional: true
dependencies:
'@types/node': 16.18.11
/meros/1.2.0_@types+node@18.11.17:
resolution: {integrity: sha512-3QRZIS707pZQnijHdhbttXRWwrHhZJ/gzolneoxKVz9N/xmsvY/7Ls8lpnI9gxbgxjcHsAVEW3mgwiZCo6kkJQ==}
engines: {node: '>=12'}
peerDependencies:
'@types/node': '>=12'
peerDependenciesMeta:
'@types/node':
optional: true
dependencies:
'@types/node': 18.11.17
dev: true
/meros/1.2.1:
resolution: {integrity: sha512-R2f/jxYqCAGI19KhAvaxSOxALBMkaXWH2a7rOyqQw+ZmizX5bKkEYWLzdhC+U82ZVVPVp6MCXe3EkVligh+12g==}
engines: {node: '>=13'}
@@ -24085,7 +24031,6 @@ packages:
optional: true
dependencies:
'@types/node': 16.18.11
dev: true
/meros/1.2.1_@types+node@18.11.17:
resolution: {integrity: sha512-R2f/jxYqCAGI19KhAvaxSOxALBMkaXWH2a7rOyqQw+ZmizX5bKkEYWLzdhC+U82ZVVPVp6MCXe3EkVligh+12g==}