Compare commits
10 Commits
@nhost/das
...
@nhost/rea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2b6a4adf40 | ||
|
|
6cc8f954e1 | ||
|
|
1821df7a96 | ||
|
|
ab8a55ede4 | ||
|
|
39eb70678b | ||
|
|
e3cd5f858f | ||
|
|
69d9ab60c8 | ||
|
|
a8961c0ab0 | ||
|
|
6b8163d21f | ||
|
|
a21553c774 |
@@ -30,6 +30,14 @@ runs:
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
- shell: bash
|
||||
name: Use Latest Corepack
|
||||
run: |
|
||||
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
|
||||
npm install -g corepack@latest
|
||||
echo "After : corepack version => $(corepack --version)"
|
||||
corepack enable
|
||||
pnpm --version
|
||||
- shell: bash
|
||||
name: Install packages
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
4
.github/workflows/test-nhost-cli-action.yaml
vendored
4
.github/workflows/test-nhost-cli-action.yaml
vendored
@@ -28,7 +28,7 @@ jobs:
|
||||
path: packages/nhost-js
|
||||
start: true
|
||||
- name: should be running
|
||||
run: curl -sSf 'https://local.hasura.nhost.run' > /dev/null
|
||||
run: curl -sSf 'https://local.hasura.local.nhost.run' > /dev/null
|
||||
|
||||
stop:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -59,7 +59,7 @@ jobs:
|
||||
start: true
|
||||
- name: should find the injected hasura-auth version
|
||||
run: |
|
||||
VERSION=$(curl -sSf 'https://local.auth.nhost.run/v1/version')
|
||||
VERSION=$(curl -sSf 'https://local.auth.local.nhost.run/v1/version')
|
||||
EXPECTED_VERSION='{"version":"v0.20.1"}'
|
||||
if [ "$VERSION" != "$EXPECTED_VERSION" ]; then
|
||||
echo "Expected version $EXPECTED_VERSION but got $VERSION"
|
||||
|
||||
12
README.md
12
README.md
@@ -4,7 +4,7 @@
|
||||
|
||||
# Nhost
|
||||
|
||||
<a href="https://docs.nhost.io/#quickstart">Quickstart</a>
|
||||
<a href="https://docs.nhost.io/introduction#quick-start-guides">Quickstart</a>
|
||||
<span> • </span>
|
||||
<a href="http://nhost.io/">Website</a>
|
||||
<span> • </span>
|
||||
@@ -36,7 +36,7 @@ Nhost consists of open source software:
|
||||
- Authentication: [Hasura Auth](https://github.com/nhost/hasura-auth/)
|
||||
- Storage: [Hasura Storage](https://github.com/nhost/hasura-storage)
|
||||
- Serverless Functions: Node.js (JavaScript and TypeScript)
|
||||
- [Nhost CLI](https://docs.nhost.io/cli) for local development
|
||||
- [Nhost CLI](https://docs.nhost.io/development/cli/overview) for local development
|
||||
|
||||
## Architecture of Nhost
|
||||
|
||||
@@ -89,12 +89,12 @@ await nhost.graphql.request(`{
|
||||
Nhost is frontend agnostic, which means Nhost works with all frontend frameworks.
|
||||
|
||||
<div align="center">
|
||||
<a href="https://docs.nhost.io/platform/quickstarts/nextjs"><img src="assets/nextjs.svg"/></a>
|
||||
<a href="https://docs.nhost.io/guides/quickstarts/nextjs"><img src="assets/nextjs.svg"/></a>
|
||||
<a href="https://docs.nhost.io/reference/javascript"><img src="assets/nuxtjs.svg"/></a>
|
||||
<a href="https://docs.nhost.io/platform/quickstarts/react"><img src="assets/react.svg"/></a>
|
||||
<a href="https://docs.nhost.io/guides/quickstarts/react"><img src="assets/react.svg"/></a>
|
||||
<a href="https://docs.nhost.io/reference/javascript"><img src="assets/react-native.svg"/></a>
|
||||
<a href="https://docs.nhost.io/reference/javascript"><img src="assets/svelte.svg"/></a>
|
||||
<a href="https://docs.nhost.io/platform/quickstarts/vue"><img src="assets/vuejs.svg"/></a>
|
||||
<a href="https://docs.nhost.io/guides/quickstarts/vue"><img src="assets/vuejs.svg"/></a>
|
||||
</div>
|
||||
|
||||
# Resources
|
||||
@@ -140,7 +140,7 @@ This repository, and most of our other open source projects, are licensed under
|
||||
|
||||
Here are some ways of contributing to making Nhost better:
|
||||
|
||||
- **[Try out Nhost](https://docs.nhost.io/get-started/quick-start)**, and think of ways to make the service better. Let us know here on GitHub.
|
||||
- **[Try out Nhost](https://docs.nhost.io/introduction)**, and think of ways to make the service better. Let us know here on GitHub.
|
||||
- Join our [Discord](https://discord.com/invite/9V7Qb2U) and connect with other members to share and learn from.
|
||||
- Send a pull request to any of our [open source repositories](https://github.com/nhost) on Github. Check our [contribution guide](https://github.com/nhost/nhost/blob/main/CONTRIBUTING.md) and our [developers guide](https://github.com/nhost/nhost/blob/main/DEVELOPERS.md) for more details about how to contribute. We're looking forward to your contribution!
|
||||
|
||||
|
||||
@@ -3,18 +3,19 @@ NEXT_PUBLIC_ENV=dev
|
||||
NEXT_PUBLIC_NHOST_PLATFORM=false
|
||||
|
||||
# Environment Variables for Self Hosting and Local Development
|
||||
NEXT_PUBLIC_NHOST_AUTH_URL=https://local.auth.nhost.run/v1
|
||||
NEXT_PUBLIC_NHOST_FUNCTIONS_URL=https://local.functions.nhost.run/v1
|
||||
NEXT_PUBLIC_NHOST_GRAPHQL_URL=https://local.graphql.nhost.run/v1
|
||||
NEXT_PUBLIC_NHOST_STORAGE_URL=https://local.storage.nhost.run/v1
|
||||
NEXT_PUBLIC_NHOST_HASURA_CONSOLE_URL=https://local.hasura.nhost.run
|
||||
NEXT_PUBLIC_NHOST_HASURA_MIGRATIONS_API_URL=https://local.hasura.nhost.run/v1/migrations
|
||||
NEXT_PUBLIC_NHOST_HASURA_API_URL=https://local.hasura.nhost.run
|
||||
NEXT_PUBLIC_NHOST_AUTH_URL=https://local.auth.nhost.local.run/v1
|
||||
NEXT_PUBLIC_NHOST_FUNCTIONS_URL=https://local.functions.local.nhost.run/v1
|
||||
NEXT_PUBLIC_NHOST_GRAPHQL_URL=https://local.graphql.local.nhost.run/v1
|
||||
NEXT_PUBLIC_NHOST_STORAGE_URL=https://local.storage.local.nhost.run/v1
|
||||
NEXT_PUBLIC_NHOST_HASURA_CONSOLE_URL=https://local.hasura.local.nhost.run
|
||||
NEXT_PUBLIC_NHOST_HASURA_MIGRATIONS_API_URL=https://local.hasura.local.nhost.run/v1/migrations
|
||||
NEXT_PUBLIC_NHOST_HASURA_API_URL=https://local.hasura.local.nhost.run
|
||||
|
||||
# Environment Variables when running the Nhost Dashboard against the Nhost Backend
|
||||
NEXT_PUBLIC_STRIPE_PK=<nhost_stripe_public_key>
|
||||
NEXT_PUBLIC_GITHUB_APP_INSTALL_URL=<github_app_install_url>
|
||||
NEXT_PUBLIC_ANALYTICS_WRITE_KEY=<analytics_write_key>
|
||||
NEXT_PUBLIC_SEGMENT_CDN_URL=<segment_cdn_url>
|
||||
NEXT_PUBLIC_NHOST_BRAGI_WEBSOCKET=<nhost_bragi_websocket>
|
||||
|
||||
NEXT_PUBLIC_ZENDESK_URL=
|
||||
@@ -22,6 +23,6 @@ NEXT_PUBLIC_ZENDESK_API_KEY=
|
||||
NEXT_PUBLIC_ZENDESK_USER_EMAIL=
|
||||
|
||||
|
||||
CODEGEN_GRAPHQL_URL=https://local.graphql.nhost.run/v1
|
||||
CODEGEN_GRAPHQL_URL=https://local.graphql.local.nhost.run/v1
|
||||
CODEGEN_HASURA_ADMIN_SECRET=nhost-admin-secret
|
||||
NEXT_PUBLIC_TURNSTILE_SITE_KEY=FIXME
|
||||
@@ -51,13 +51,13 @@ You can connect the Nhost Dashboard to your locally running backend by setting t
|
||||
```bash
|
||||
NEXT_PUBLIC_ENV=dev
|
||||
NEXT_PUBLIC_NHOST_PLATFORM=false
|
||||
NEXT_PUBLIC_NHOST_AUTH_URL=https://local.auth.nhost.run/v1
|
||||
NEXT_PUBLIC_NHOST_FUNCTIONS_URL=https://local.functions.nhost.run/v1
|
||||
NEXT_PUBLIC_NHOST_GRAPHQL_URL=https://local.graphql.nhost.run/v1
|
||||
NEXT_PUBLIC_NHOST_STORAGE_URL=https://local.storage.nhost.run/v1
|
||||
NEXT_PUBLIC_NHOST_HASURA_CONSOLE_URL=https://local.hasura.nhost.run
|
||||
NEXT_PUBLIC_NHOST_HASURA_MIGRATIONS_API_URL=https://local.hasura.nhost.run/v1/migrations
|
||||
NEXT_PUBLIC_NHOST_HASURA_API_URL=https://local.hasura.nhost.run
|
||||
NEXT_PUBLIC_NHOST_AUTH_URL=https://local.auth.local.nhost.run/v1
|
||||
NEXT_PUBLIC_NHOST_FUNCTIONS_URL=https://local.functions.local.nhost.run/v1
|
||||
NEXT_PUBLIC_NHOST_GRAPHQL_URL=https://local.graphql.local.nhost.run/v1
|
||||
NEXT_PUBLIC_NHOST_STORAGE_URL=https://local.storage.local.nhost.run/v1
|
||||
NEXT_PUBLIC_NHOST_HASURA_CONSOLE_URL=https://local.hasura.local.nhost.run
|
||||
NEXT_PUBLIC_NHOST_HASURA_MIGRATIONS_API_URL=https://local.hasura.local.nhost.run/v1/migrations
|
||||
NEXT_PUBLIC_NHOST_HASURA_API_URL=https://local.hasura.local.nhost.run
|
||||
```
|
||||
|
||||
This will connect the Nhost Dashboard to your locally running Nhost backend.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
schema:
|
||||
- https://local.graphql.nhost.run/v1:
|
||||
- https://local.graphql.local.nhost.run/v1:
|
||||
headers:
|
||||
x-hasura-admin-secret: nhost-admin-secret
|
||||
generates:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/dashboard",
|
||||
"version": "2.20.0",
|
||||
"version": "2.21.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"preinstall": "npx only-allow pnpm",
|
||||
@@ -56,7 +56,7 @@
|
||||
"@radix-ui/react-separator": "^1.1.0",
|
||||
"@radix-ui/react-slot": "^1.1.0",
|
||||
"@radix-ui/react-tooltip": "^1.1.2",
|
||||
"@segment/snippet": "^4.16.2",
|
||||
"@segment/analytics-next": "^1.77.0",
|
||||
"@stripe/react-stripe-js": "^2.6.2",
|
||||
"@stripe/stripe-js": "^1.54.2",
|
||||
"@tailwindcss/forms": "^0.5.7",
|
||||
@@ -67,7 +67,6 @@
|
||||
"@uiw/codemirror-theme-bbedit": "^4.22.2",
|
||||
"@uiw/codemirror-theme-github": "^4.21.25",
|
||||
"@uiw/react-codemirror": "^4.21.25",
|
||||
"analytics-node": "^6.2.0",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"class-variance-authority": "^0.7.0",
|
||||
"clsx": "^1.2.1",
|
||||
|
||||
30
dashboard/src/components/analytics/analytics.tsx
Normal file
30
dashboard/src/components/analytics/analytics.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import { useCurrentOrg } from '@/features/orgs/projects/hooks/useCurrentOrg';
|
||||
import { useProject } from '@/features/orgs/projects/hooks/useProject';
|
||||
import { analytics } from '@/lib/segment';
|
||||
import { useRouter } from 'next/router';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
export default function Analytics() {
|
||||
const router = useRouter();
|
||||
const { org } = useCurrentOrg();
|
||||
const { project } = useProject();
|
||||
|
||||
useEffect(() => {
|
||||
const customProperties = {
|
||||
organizationSlug: org?.slug || '',
|
||||
projectSubdomain: project?.subdomain || '',
|
||||
};
|
||||
|
||||
analytics.page(customProperties);
|
||||
|
||||
const handleRouteChange = () => analytics.page(customProperties);
|
||||
|
||||
router.events.on('routeChangeComplete', handleRouteChange);
|
||||
|
||||
return () => {
|
||||
router.events.off('routeChangeComplete', handleRouteChange);
|
||||
};
|
||||
}, [router.events, org?.slug, project?.subdomain]);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -1,14 +1,17 @@
|
||||
import { OpenTransferDialogButton } from '@/components/common/OpenTransferDialogButton';
|
||||
import { useUI } from '@/components/common/UIProvider';
|
||||
import { Form } from '@/components/form/Form';
|
||||
import { SettingsContainer } from '@/components/layout/SettingsContainer';
|
||||
import { NhostIcon } from '@/components/presentational/NhostIcon';
|
||||
import { ActivityIndicator } from '@/components/ui/v2/ActivityIndicator';
|
||||
import { Alert } from '@/components/ui/v2/Alert';
|
||||
import { Box } from '@/components/ui/v2/Box';
|
||||
import { ArrowSquareOutIcon } from '@/components/ui/v2/icons/ArrowSquareOutIcon';
|
||||
import { Input } from '@/components/ui/v2/Input';
|
||||
import { InputAdornment } from '@/components/ui/v2/InputAdornment';
|
||||
import { Link } from '@/components/ui/v2/Link';
|
||||
import { Text } from '@/components/ui/v2/Text';
|
||||
import { UpgradeNotification } from '@/features/orgs/projects/common/components/UpgradeNotification';
|
||||
import { TransferProjectDialog } from '@/features/orgs/components/common/TransferProjectDialog';
|
||||
import { useAppState } from '@/features/orgs/projects/common/hooks/useAppState';
|
||||
import { useIsPlatform } from '@/features/orgs/projects/common/hooks/useIsPlatform';
|
||||
import { DatabaseStorageCapacityWarning } from '@/features/orgs/projects/database/settings/components/DatabaseStorageCapacityWarning';
|
||||
@@ -23,7 +26,7 @@ import {
|
||||
} from '@/generated/graphql';
|
||||
import { ApplicationStatus } from '@/types/application';
|
||||
import { yupResolver } from '@hookform/resolvers/yup';
|
||||
import { useEffect, useMemo } from 'react';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { FormProvider, useForm } from 'react-hook-form';
|
||||
import * as Yup from 'yup';
|
||||
|
||||
@@ -39,6 +42,57 @@ export type DatabaseStorageCapacityFormValues = Yup.InferType<
|
||||
typeof validationSchema
|
||||
>;
|
||||
|
||||
function UpgradeNotification() {
|
||||
const [transferProjectDialogOpen, setTransferProjectDialogOpen] =
|
||||
useState(false);
|
||||
|
||||
const handleTransferDialogOpen = () => setTransferProjectDialogOpen(true);
|
||||
|
||||
return (
|
||||
<Alert className="flex w-full flex-col justify-between gap-4 lg:flex-row">
|
||||
<div className="flex flex-col gap-4">
|
||||
<div className="flex flex-col space-y-2 lg:flex-row lg:space-x-2 lg:space-y-0">
|
||||
<Text className="text-left">Available with</Text>
|
||||
<div className="flex flex-row space-x-2">
|
||||
<NhostIcon />
|
||||
<Text
|
||||
sx={{ color: 'primary.main' }}
|
||||
className="text-left font-semibold"
|
||||
>
|
||||
Nhost Pro & Team
|
||||
</Text>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Text component="span" className="max-w-[50ch] text-left">
|
||||
To unlock more storage capacity, transfer this project to a Pro or
|
||||
Team organization.
|
||||
</Text>
|
||||
</div>
|
||||
<Text className="flex flex-row items-center gap-4 self-end">
|
||||
<Link
|
||||
href="https://nhost.io/pricing"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
underline="hover"
|
||||
className="whitespace-nowrap text-center font-medium"
|
||||
sx={{
|
||||
color: 'text.secondary',
|
||||
}}
|
||||
>
|
||||
See all features
|
||||
<ArrowSquareOutIcon className="ml-1 h-4 w-4" />
|
||||
</Link>
|
||||
<OpenTransferDialogButton onClick={handleTransferDialogOpen} />
|
||||
<TransferProjectDialog
|
||||
open={transferProjectDialogOpen}
|
||||
setOpen={setTransferProjectDialogOpen}
|
||||
/>
|
||||
</Text>
|
||||
</Alert>
|
||||
);
|
||||
}
|
||||
|
||||
export default function DatabaseStorageCapacity() {
|
||||
const isPlatform = useIsPlatform();
|
||||
const { org } = useCurrentOrg();
|
||||
@@ -46,6 +100,8 @@ export default function DatabaseStorageCapacity() {
|
||||
const localMimirClient = useLocalMimirClient();
|
||||
const { project } = useProject();
|
||||
|
||||
const isFreeProject = !!org?.plan.isFree;
|
||||
|
||||
const {
|
||||
data,
|
||||
loading,
|
||||
@@ -172,9 +228,7 @@ export default function DatabaseStorageCapacity() {
|
||||
}}
|
||||
className="flex flex-col"
|
||||
>
|
||||
{project.legacyPlan?.isFree && (
|
||||
<UpgradeNotification message="Unlock by upgrading your project to the Pro plan." />
|
||||
)}
|
||||
{isFreeProject && <UpgradeNotification />}
|
||||
<Box className="grid grid-flow-row lg:grid-cols-5">
|
||||
<Input
|
||||
{...register('capacity')}
|
||||
@@ -187,13 +241,13 @@ export default function DatabaseStorageCapacity() {
|
||||
</InputAdornment>
|
||||
}
|
||||
fullWidth
|
||||
disabled={project.legacyPlan?.isFree}
|
||||
disabled={isFreeProject}
|
||||
className="lg:col-span-2"
|
||||
error={Boolean(formState.errors.capacity?.message)}
|
||||
helperText={formState.errors.capacity?.message}
|
||||
/>
|
||||
</Box>
|
||||
{!project.legacyPlan?.isFree && (
|
||||
{!isFreeProject && (
|
||||
<DatabaseStorageCapacityWarning
|
||||
state={state}
|
||||
decreasingSize={decreasingSize}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { ControlledSelect } from '@/components/form/ControlledSelect';
|
||||
import { Form } from '@/components/form/Form';
|
||||
import { ActivityIndicator } from '@/components/ui/v2/ActivityIndicator';
|
||||
import type { BoxProps } from '@/components/ui/v2/Box';
|
||||
@@ -12,14 +11,19 @@ import { Option } from '@/components/ui/v2/Option';
|
||||
import { Tooltip } from '@/components/ui/v2/Tooltip';
|
||||
import { useProject } from '@/features/orgs/projects/hooks/useProject';
|
||||
import { LogsRangeSelector } from '@/features/orgs/projects/logs/components/LogsRangeSelector';
|
||||
import { AvailableLogsService } from '@/features/orgs/projects/logs/utils/constants/services';
|
||||
import {
|
||||
AvailableLogsService,
|
||||
LOGS_SERVICE_TO_LABEL,
|
||||
} from '@/features/orgs/projects/logs/utils/constants/services';
|
||||
import { isEmptyValue } from '@/lib/utils';
|
||||
import { useGetServiceLabelValuesQuery } from '@/utils/__generated__/graphql';
|
||||
import { MINUTES_TO_DECREASE_FROM_CURRENT_DATE } from '@/utils/constants/common';
|
||||
import { yupResolver } from '@hookform/resolvers/yup';
|
||||
import { subMinutes } from 'date-fns';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useEffect, useMemo } from 'react';
|
||||
import { FormProvider, useForm } from 'react-hook-form';
|
||||
import * as Yup from 'yup';
|
||||
import LogsServiceFilter from './LogsServiceFilter';
|
||||
|
||||
export const validationSchema = Yup.object({
|
||||
from: Yup.date(),
|
||||
@@ -49,36 +53,33 @@ export default function LogsHeader({
|
||||
}: LogsHeaderProps) {
|
||||
const { project } = useProject();
|
||||
|
||||
const [serviceLabels, setServiceLabels] = useState<
|
||||
{ label: string; value: string }[]
|
||||
>([]);
|
||||
const { data } = useGetServiceLabelValuesQuery({
|
||||
variables: { appID: project?.id },
|
||||
skip: !project?.id,
|
||||
});
|
||||
|
||||
const { data, loading: loadingServiceLabelValues } =
|
||||
useGetServiceLabelValuesQuery({
|
||||
variables: { appID: project?.id },
|
||||
skip: !project?.id,
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (!loadingServiceLabelValues && data) {
|
||||
const labels = data.getServiceLabelValues ?? [];
|
||||
|
||||
const labelMappings = {
|
||||
'hasura-auth': 'Auth',
|
||||
'hasura-storage': 'Storage',
|
||||
postgres: 'Postgres',
|
||||
functions: 'Functions',
|
||||
hasura: 'Hasura',
|
||||
grafana: 'Grafana',
|
||||
'job-backup': 'Backup Jobs',
|
||||
ai: 'AI',
|
||||
};
|
||||
|
||||
setServiceLabels(
|
||||
labels.map((l) => ({ label: labelMappings[l] ?? l, value: l })),
|
||||
);
|
||||
const serviceOptions = useMemo(() => {
|
||||
if (isEmptyValue(data)) {
|
||||
return [];
|
||||
}
|
||||
}, [loadingServiceLabelValues, data]);
|
||||
|
||||
const options = [
|
||||
{
|
||||
label: LOGS_SERVICE_TO_LABEL[AvailableLogsService.ALL],
|
||||
value: AvailableLogsService.ALL,
|
||||
},
|
||||
...data.getServiceLabelValues.map((l) => ({
|
||||
label: LOGS_SERVICE_TO_LABEL[l] ?? l,
|
||||
value: l,
|
||||
})),
|
||||
];
|
||||
|
||||
return options.map(({ value, label }) => (
|
||||
<Option key={value} value={value} className="text-sm+ font-medium">
|
||||
{label}
|
||||
</Option>
|
||||
));
|
||||
}, [data]);
|
||||
|
||||
const form = useForm<LogsFilterFormValues>({
|
||||
defaultValues: {
|
||||
@@ -113,30 +114,10 @@ export default function LogsHeader({
|
||||
className="grid w-full grid-flow-row items-center gap-2 md:w-[initial] md:grid-flow-col md:gap-3 lg:justify-end"
|
||||
>
|
||||
<Box className="flex flex-row space-x-2">
|
||||
<ControlledSelect
|
||||
{...register('service')}
|
||||
className="w-full min-w-fit text-sm font-normal"
|
||||
placeholder="All Services"
|
||||
aria-label="Select service"
|
||||
hideEmptyHelperText
|
||||
slotProps={{
|
||||
root: {
|
||||
className: 'min-h-[initial] h-10 leading-[initial]',
|
||||
},
|
||||
}}
|
||||
>
|
||||
{[{ label: 'All services', value: '' }, ...serviceLabels].map(
|
||||
({ value, label }) => (
|
||||
<Option
|
||||
key={value}
|
||||
value={value}
|
||||
className="text-sm+ font-medium"
|
||||
>
|
||||
{label}
|
||||
</Option>
|
||||
),
|
||||
)}
|
||||
</ControlledSelect>
|
||||
<LogsServiceFilter
|
||||
register={register}
|
||||
serviceOptions={serviceOptions}
|
||||
/>
|
||||
<div className="w-full min-w-fit">
|
||||
<LogsRangeSelector onSubmitFilterValues={onSubmitFilterValues} />
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import { ControlledSelect } from '@/components/form/ControlledSelect';
|
||||
import { memo } from 'react';
|
||||
import type { UseFormRegister } from 'react-hook-form';
|
||||
import type { LogsFilterFormValues } from './LogsHeader';
|
||||
|
||||
interface LogsServiceFilterProps {
|
||||
register: UseFormRegister<LogsFilterFormValues>;
|
||||
serviceOptions: JSX.Element[];
|
||||
}
|
||||
const LogsServiceFilter = memo(
|
||||
({ register, serviceOptions }: LogsServiceFilterProps) => (
|
||||
<ControlledSelect
|
||||
{...register('service')}
|
||||
className="w-full min-w-fit text-sm font-normal"
|
||||
placeholder="All Services"
|
||||
aria-label="Select service"
|
||||
hideEmptyHelperText
|
||||
slotProps={{
|
||||
root: {
|
||||
className: 'min-h-[initial] h-10 leading-[initial]',
|
||||
},
|
||||
}}
|
||||
>
|
||||
{serviceOptions}
|
||||
</ControlledSelect>
|
||||
),
|
||||
);
|
||||
|
||||
export default LogsServiceFilter;
|
||||
@@ -10,34 +10,21 @@ export enum AvailableLogsService {
|
||||
STORAGE = 'hasura-storage',
|
||||
HASURA = 'hasura',
|
||||
FUNCTIONS = 'functions',
|
||||
GRAFANA = 'grafana',
|
||||
JOB_BACKUP = 'job-backup',
|
||||
AI = 'ai',
|
||||
}
|
||||
|
||||
export const LOGS_AVAILABLE_SERVICES: {
|
||||
label: string;
|
||||
value: AvailableLogsService;
|
||||
}[] = [
|
||||
{
|
||||
label: 'All Services',
|
||||
value: AvailableLogsService.ALL,
|
||||
},
|
||||
{
|
||||
label: 'Postgres',
|
||||
value: AvailableLogsService.POSTGRES,
|
||||
},
|
||||
{
|
||||
label: 'Auth',
|
||||
value: AvailableLogsService.AUTH,
|
||||
},
|
||||
{
|
||||
label: 'Storage',
|
||||
value: AvailableLogsService.STORAGE,
|
||||
},
|
||||
{
|
||||
label: 'Hasura',
|
||||
value: AvailableLogsService.HASURA,
|
||||
},
|
||||
{
|
||||
label: 'Functions',
|
||||
value: AvailableLogsService.FUNCTIONS,
|
||||
},
|
||||
];
|
||||
export const LOGS_SERVICE_TO_LABEL: Required<
|
||||
Record<AvailableLogsService, string>
|
||||
> = {
|
||||
[AvailableLogsService.ALL]: 'All Services',
|
||||
[AvailableLogsService.POSTGRES]: 'Postgres',
|
||||
[AvailableLogsService.AUTH]: 'Auth',
|
||||
[AvailableLogsService.STORAGE]: 'Storage',
|
||||
[AvailableLogsService.HASURA]: 'Hasura',
|
||||
[AvailableLogsService.FUNCTIONS]: 'Functions',
|
||||
[AvailableLogsService.GRAFANA]: 'Grafana',
|
||||
[AvailableLogsService.JOB_BACKUP]: 'Backup Jobs',
|
||||
[AvailableLogsService.AI]: 'AI',
|
||||
};
|
||||
|
||||
@@ -36,7 +36,7 @@ vi.mock('next/router', () => ({
|
||||
|
||||
const server = setupServer(
|
||||
tokenQuery,
|
||||
rest.get('https://local.graphql.nhost.run/v1', (_req, res, ctx) =>
|
||||
rest.get('https://local.graphql.local.nhost.run/v1', (_req, res, ctx) =>
|
||||
res(ctx.status(200)),
|
||||
),
|
||||
);
|
||||
@@ -49,7 +49,7 @@ beforeAll(() => {
|
||||
|
||||
afterEach(() => {
|
||||
server.resetHandlers(
|
||||
rest.get('https://local.graphql.nhost.run/v1', (_req, res, ctx) =>
|
||||
rest.get('https://local.graphql.local.nhost.run/v1', (_req, res, ctx) =>
|
||||
res(ctx.status(200)),
|
||||
),
|
||||
);
|
||||
@@ -63,33 +63,36 @@ afterAll(() => {
|
||||
|
||||
test('should render an empty state when GitHub is not connected', async () => {
|
||||
server.use(
|
||||
rest.post('https://local.graphql.nhost.run/v1', async (req, res, ctx) => {
|
||||
const { operationName } = await req.json();
|
||||
rest.post(
|
||||
'https://local.graphql.local.nhost.run/v1',
|
||||
async (req, res, ctx) => {
|
||||
const { operationName } = await req.json();
|
||||
|
||||
if (operationName === 'getProject') {
|
||||
return res(
|
||||
ctx.json({
|
||||
apps: [{ ...mockApplication, githubRepository: null }],
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
if (operationName === 'getOrganization') {
|
||||
return res(
|
||||
ctx.json({
|
||||
organizations: [{ ...mockOrganization }],
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
if (operationName === 'getProject') {
|
||||
return res(
|
||||
ctx.json({
|
||||
apps: [{ ...mockApplication, githubRepository: null }],
|
||||
data: {
|
||||
deployments: [],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
if (operationName === 'getOrganization') {
|
||||
return res(
|
||||
ctx.json({
|
||||
organizations: [{ ...mockOrganization }],
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
deployments: [],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}),
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
render(<OverviewDeployments />);
|
||||
@@ -102,31 +105,34 @@ test('should render an empty state when GitHub is not connected', async () => {
|
||||
|
||||
test('should render an empty state when GitHub is connected, but there are no deployments', async () => {
|
||||
server.use(
|
||||
rest.post('https://local.graphql.nhost.run/v1', async (_req, res, ctx) => {
|
||||
const { operationName } = await _req.json();
|
||||
rest.post(
|
||||
'https://local.graphql.local.nhost.run/v1',
|
||||
async (_req, res, ctx) => {
|
||||
const { operationName } = await _req.json();
|
||||
|
||||
if (operationName === 'getProject') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
apps: [{ ...mockApplication }],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
if (operationName === 'getProject') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
apps: [{ ...mockApplication }],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
if (operationName === 'getOrganization') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
organizations: [{ ...mockOrganization }],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
if (operationName === 'getOrganization') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
organizations: [{ ...mockOrganization }],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
return res(ctx.json({ data: { deployments: [] } }));
|
||||
}),
|
||||
return res(ctx.json({ data: { deployments: [] } }));
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
render(<OverviewDeployments />);
|
||||
@@ -147,52 +153,55 @@ test('should render an empty state when GitHub is connected, but there are no de
|
||||
test('should render a list of deployments', async () => {
|
||||
server.use(
|
||||
tokenQuery,
|
||||
rest.post('https://local.graphql.nhost.run/v1', async (_req, res, ctx) => {
|
||||
const { operationName } = await _req.json();
|
||||
rest.post(
|
||||
'https://local.graphql.local.nhost.run/v1',
|
||||
async (_req, res, ctx) => {
|
||||
const { operationName } = await _req.json();
|
||||
|
||||
if (operationName === 'ScheduledOrPendingDeploymentsSub') {
|
||||
return res(ctx.json({ data: { deployments: [] } }));
|
||||
}
|
||||
if (operationName === 'ScheduledOrPendingDeploymentsSub') {
|
||||
return res(ctx.json({ data: { deployments: [] } }));
|
||||
}
|
||||
|
||||
if (operationName === 'getProject') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
apps: [{ ...mockApplication }],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
if (operationName === 'getOrganization') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
organizations: [{ ...mockOrganization }],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
deployments: [
|
||||
{
|
||||
id: '1',
|
||||
commitSHA: 'abc123',
|
||||
deploymentStartedAt: '2021-08-01T00:00:00.000Z',
|
||||
deploymentEndedAt: '2021-08-01T00:05:00.000Z',
|
||||
deploymentStatus: 'DEPLOYED',
|
||||
commitUserName: 'test.user',
|
||||
commitUserAvatarUrl: 'http://images.example.com/avatar.png',
|
||||
commitMessage: 'Test commit message',
|
||||
if (operationName === 'getProject') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
apps: [{ ...mockApplication }],
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}),
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
if (operationName === 'getOrganization') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
organizations: [{ ...mockOrganization }],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
deployments: [
|
||||
{
|
||||
id: '1',
|
||||
commitSHA: 'abc123',
|
||||
deploymentStartedAt: '2021-08-01T00:00:00.000Z',
|
||||
deploymentEndedAt: '2021-08-01T00:05:00.000Z',
|
||||
deploymentStatus: 'DEPLOYED',
|
||||
commitUserName: 'test.user',
|
||||
commitUserAvatarUrl: 'http://images.example.com/avatar.png',
|
||||
commitMessage: 'Test commit message',
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
render(<OverviewDeployments />);
|
||||
@@ -216,20 +225,62 @@ test('should render a list of deployments', async () => {
|
||||
test('should disable redeployments if a deployment is already in progress', async () => {
|
||||
server.use(
|
||||
tokenQuery,
|
||||
rest.post('https://local.graphql.nhost.run/v1', async (req, res, ctx) => {
|
||||
const { operationName } = await req.json();
|
||||
rest.post(
|
||||
'https://local.graphql.local.nhost.run/v1',
|
||||
async (req, res, ctx) => {
|
||||
const { operationName } = await req.json();
|
||||
|
||||
if (operationName === 'ScheduledOrPendingDeploymentsSub') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
deployments: [
|
||||
{
|
||||
id: '2',
|
||||
commitSHA: 'abc234',
|
||||
deploymentStartedAt: '2021-08-02T00:00:00.000Z',
|
||||
deploymentEndedAt: null,
|
||||
deploymentStatus: 'PENDING',
|
||||
commitUserName: 'test.user',
|
||||
commitUserAvatarUrl: 'http://images.example.com/avatar.png',
|
||||
commitMessage: 'Test commit message',
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
if (operationName === 'getProject') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
apps: [{ ...mockApplication }],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
if (operationName === 'getOrganization') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
organizations: [{ ...mockOrganization }],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
if (operationName === 'ScheduledOrPendingDeploymentsSub') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
deployments: [
|
||||
{
|
||||
id: '2',
|
||||
commitSHA: 'abc234',
|
||||
deploymentStartedAt: '2021-08-02T00:00:00.000Z',
|
||||
deploymentEndedAt: null,
|
||||
deploymentStatus: 'PENDING',
|
||||
id: '1',
|
||||
commitSHA: 'abc123',
|
||||
deploymentStartedAt: '2021-08-01T00:00:00.000Z',
|
||||
deploymentEndedAt: '2021-08-01T00:05:00.000Z',
|
||||
deploymentStatus: 'DEPLOYED',
|
||||
commitUserName: 'test.user',
|
||||
commitUserAvatarUrl: 'http://images.example.com/avatar.png',
|
||||
commitMessage: 'Test commit message',
|
||||
@@ -238,47 +289,8 @@ test('should disable redeployments if a deployment is already in progress', asyn
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
if (operationName === 'getProject') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
apps: [{ ...mockApplication }],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
if (operationName === 'getOrganization') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
organizations: [{ ...mockOrganization }],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
deployments: [
|
||||
{
|
||||
id: '1',
|
||||
commitSHA: 'abc123',
|
||||
deploymentStartedAt: '2021-08-01T00:00:00.000Z',
|
||||
deploymentEndedAt: '2021-08-01T00:05:00.000Z',
|
||||
deploymentStatus: 'DEPLOYED',
|
||||
commitUserName: 'test.user',
|
||||
commitUserAvatarUrl: 'http://images.example.com/avatar.png',
|
||||
commitMessage: 'Test commit message',
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}),
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
render(<OverviewDeployments />);
|
||||
|
||||
@@ -36,7 +36,7 @@ vi.mock('next/router', () => ({
|
||||
|
||||
const server = setupServer(
|
||||
tokenQuery,
|
||||
rest.get('https://local.graphql.nhost.run/v1', (_req, res, ctx) =>
|
||||
rest.get('https://local.graphql.local.nhost.run/v1', (_req, res, ctx) =>
|
||||
res(ctx.status(200)),
|
||||
),
|
||||
);
|
||||
@@ -49,7 +49,7 @@ beforeAll(() => {
|
||||
|
||||
afterEach(() => {
|
||||
server.resetHandlers(
|
||||
rest.get('https://local.graphql.nhost.run/v1', (_req, res, ctx) =>
|
||||
rest.get('https://local.graphql.local.nhost.run/v1', (_req, res, ctx) =>
|
||||
res(ctx.status(200)),
|
||||
),
|
||||
);
|
||||
@@ -63,33 +63,36 @@ afterAll(() => {
|
||||
|
||||
test('should render an empty state when GitHub is not connected', async () => {
|
||||
server.use(
|
||||
rest.post('https://local.graphql.nhost.run/v1', async (req, res, ctx) => {
|
||||
const { operationName } = await req.json();
|
||||
rest.post(
|
||||
'https://local.graphql.local.nhost.run/v1',
|
||||
async (req, res, ctx) => {
|
||||
const { operationName } = await req.json();
|
||||
|
||||
if (operationName === 'GetWorkspaceAndProject') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
workspaces: [
|
||||
{
|
||||
...mockWorkspace,
|
||||
projects: [{ ...mockApplication, githubRepository: null }],
|
||||
},
|
||||
],
|
||||
projects: [{ ...mockApplication, githubRepository: null }],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
if (operationName === 'GetWorkspaceAndProject') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
workspaces: [
|
||||
{
|
||||
...mockWorkspace,
|
||||
projects: [{ ...mockApplication, githubRepository: null }],
|
||||
},
|
||||
],
|
||||
projects: [{ ...mockApplication, githubRepository: null }],
|
||||
deployments: [],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
deployments: [],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}),
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
render(<OverviewDeployments />);
|
||||
@@ -102,22 +105,25 @@ test('should render an empty state when GitHub is not connected', async () => {
|
||||
|
||||
test('should render an empty state when GitHub is connected, but there are no deployments', async () => {
|
||||
server.use(
|
||||
rest.post('https://local.graphql.nhost.run/v1', async (_req, res, ctx) => {
|
||||
const { operationName } = await _req.json();
|
||||
rest.post(
|
||||
'https://local.graphql.local.nhost.run/v1',
|
||||
async (_req, res, ctx) => {
|
||||
const { operationName } = await _req.json();
|
||||
|
||||
if (operationName === 'GetWorkspaceAndProject') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
workspaces: [mockWorkspace],
|
||||
projects: [mockApplication],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
if (operationName === 'GetWorkspaceAndProject') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
workspaces: [mockWorkspace],
|
||||
projects: [mockApplication],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
return res(ctx.json({ data: { deployments: [] } }));
|
||||
}),
|
||||
return res(ctx.json({ data: { deployments: [] } }));
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
render(<OverviewDeployments />);
|
||||
@@ -138,43 +144,46 @@ test('should render an empty state when GitHub is connected, but there are no de
|
||||
test('should render a list of deployments', async () => {
|
||||
server.use(
|
||||
tokenQuery,
|
||||
rest.post('https://local.graphql.nhost.run/v1', async (_req, res, ctx) => {
|
||||
const { operationName } = await _req.json();
|
||||
rest.post(
|
||||
'https://local.graphql.local.nhost.run/v1',
|
||||
async (_req, res, ctx) => {
|
||||
const { operationName } = await _req.json();
|
||||
|
||||
if (operationName === 'ScheduledOrPendingDeploymentsSub') {
|
||||
return res(ctx.json({ data: { deployments: [] } }));
|
||||
}
|
||||
if (operationName === 'ScheduledOrPendingDeploymentsSub') {
|
||||
return res(ctx.json({ data: { deployments: [] } }));
|
||||
}
|
||||
|
||||
if (operationName === 'GetWorkspaceAndProject') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
workspaces: [mockWorkspace],
|
||||
projects: [mockApplication],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
if (operationName === 'GetWorkspaceAndProject') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
workspaces: [mockWorkspace],
|
||||
projects: [mockApplication],
|
||||
deployments: [
|
||||
{
|
||||
id: '1',
|
||||
commitSHA: 'abc123',
|
||||
deploymentStartedAt: '2021-08-01T00:00:00.000Z',
|
||||
deploymentEndedAt: '2021-08-01T00:05:00.000Z',
|
||||
deploymentStatus: 'DEPLOYED',
|
||||
commitUserName: 'test.user',
|
||||
commitUserAvatarUrl: 'http://images.example.com/avatar.png',
|
||||
commitMessage: 'Test commit message',
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
deployments: [
|
||||
{
|
||||
id: '1',
|
||||
commitSHA: 'abc123',
|
||||
deploymentStartedAt: '2021-08-01T00:00:00.000Z',
|
||||
deploymentEndedAt: '2021-08-01T00:05:00.000Z',
|
||||
deploymentStatus: 'DEPLOYED',
|
||||
commitUserName: 'test.user',
|
||||
commitUserAvatarUrl: 'http://images.example.com/avatar.png',
|
||||
commitMessage: 'Test commit message',
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}),
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
render(<OverviewDeployments />);
|
||||
@@ -198,20 +207,53 @@ test('should render a list of deployments', async () => {
|
||||
test('should disable redeployments if a deployment is already in progress', async () => {
|
||||
server.use(
|
||||
tokenQuery,
|
||||
rest.post('https://local.graphql.nhost.run/v1', async (req, res, ctx) => {
|
||||
const { operationName } = await req.json();
|
||||
rest.post(
|
||||
'https://local.graphql.local.nhost.run/v1',
|
||||
async (req, res, ctx) => {
|
||||
const { operationName } = await req.json();
|
||||
|
||||
if (operationName === 'ScheduledOrPendingDeploymentsSub') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
deployments: [
|
||||
{
|
||||
id: '2',
|
||||
commitSHA: 'abc234',
|
||||
deploymentStartedAt: '2021-08-02T00:00:00.000Z',
|
||||
deploymentEndedAt: null,
|
||||
deploymentStatus: 'PENDING',
|
||||
commitUserName: 'test.user',
|
||||
commitUserAvatarUrl: 'http://images.example.com/avatar.png',
|
||||
commitMessage: 'Test commit message',
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
if (operationName === 'GetWorkspaceAndProject') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
workspaces: [mockWorkspace],
|
||||
projects: [mockApplication],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
if (operationName === 'ScheduledOrPendingDeploymentsSub') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
deployments: [
|
||||
{
|
||||
id: '2',
|
||||
commitSHA: 'abc234',
|
||||
deploymentStartedAt: '2021-08-02T00:00:00.000Z',
|
||||
deploymentEndedAt: null,
|
||||
deploymentStatus: 'PENDING',
|
||||
id: '1',
|
||||
commitSHA: 'abc123',
|
||||
deploymentStartedAt: '2021-08-01T00:00:00.000Z',
|
||||
deploymentEndedAt: '2021-08-01T00:05:00.000Z',
|
||||
deploymentStatus: 'DEPLOYED',
|
||||
commitUserName: 'test.user',
|
||||
commitUserAvatarUrl: 'http://images.example.com/avatar.png',
|
||||
commitMessage: 'Test commit message',
|
||||
@@ -220,38 +262,8 @@ test('should disable redeployments if a deployment is already in progress', asyn
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
if (operationName === 'GetWorkspaceAndProject') {
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
workspaces: [mockWorkspace],
|
||||
projects: [mockApplication],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
return res(
|
||||
ctx.json({
|
||||
data: {
|
||||
deployments: [
|
||||
{
|
||||
id: '1',
|
||||
commitSHA: 'abc123',
|
||||
deploymentStartedAt: '2021-08-01T00:00:00.000Z',
|
||||
deploymentEndedAt: '2021-08-01T00:05:00.000Z',
|
||||
deploymentStatus: 'DEPLOYED',
|
||||
commitUserName: 'test.user',
|
||||
commitUserAvatarUrl: 'http://images.example.com/avatar.png',
|
||||
commitMessage: 'Test commit message',
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
);
|
||||
}),
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
render(<OverviewDeployments />);
|
||||
|
||||
6
dashboard/src/lib/segment.ts
Normal file
6
dashboard/src/lib/segment.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { AnalyticsBrowser } from "@segment/analytics-next";
|
||||
|
||||
export const analytics = AnalyticsBrowser.load({
|
||||
cdnURL: process.env.NEXT_PUBLIC_SEGMENT_CDN_URL!,
|
||||
writeKey: process.env.NEXT_PUBLIC_ANALYTICS_WRITE_KEY!,
|
||||
});
|
||||
@@ -1,3 +1,4 @@
|
||||
import Analytics from '@/components/analytics/analytics';
|
||||
import { DialogProvider } from '@/components/common/DialogProvider';
|
||||
import { UIProvider } from '@/components/common/UIProvider';
|
||||
import { TreeNavStateProvider } from '@/components/layout/MainNav/TreeNavStateContext';
|
||||
@@ -28,14 +29,12 @@ import '@fontsource/roboto-mono/400.css';
|
||||
import '@fontsource/roboto-mono/500.css';
|
||||
import { NhostProvider } from '@nhost/nextjs';
|
||||
import { NhostApolloProvider } from '@nhost/react-apollo';
|
||||
import * as snippet from '@segment/snippet';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import type { NextPage } from 'next';
|
||||
import { PagesProgressBar as ProgressBar } from 'next-nprogress-bar';
|
||||
import { DefaultSeo } from 'next-seo';
|
||||
import type { AppProps } from 'next/app';
|
||||
import { useRouter } from 'next/router';
|
||||
import Script from 'next/script';
|
||||
import type { ReactElement } from 'react';
|
||||
import { useEffect } from 'react';
|
||||
import { Toaster } from 'react-hot-toast';
|
||||
@@ -62,20 +61,6 @@ function MyApp({
|
||||
const isPlatform = useIsPlatform();
|
||||
const router = useRouter();
|
||||
|
||||
// segment snippet
|
||||
function renderSnippet() {
|
||||
const opts = {
|
||||
apiKey: process.env.NEXT_PUBLIC_ANALYTICS_WRITE_KEY,
|
||||
page: true,
|
||||
};
|
||||
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
return snippet.max(opts);
|
||||
}
|
||||
|
||||
return snippet.min(opts);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
// track page changes
|
||||
const handleRouteChange = () => {
|
||||
@@ -103,12 +88,7 @@ function MyApp({
|
||||
<UIProvider>
|
||||
<Toaster position="bottom-center" />
|
||||
|
||||
{isPlatform && (
|
||||
<Script
|
||||
id="segment"
|
||||
dangerouslySetInnerHTML={{ __html: renderSnippet() }}
|
||||
/>
|
||||
)}
|
||||
{isPlatform && <Analytics />}
|
||||
|
||||
<ThemeProvider
|
||||
colorPreferenceStorageKey={COLOR_PREFERENCE_STORAGE_KEY}
|
||||
|
||||
@@ -49,7 +49,6 @@ export default function LogsPage() {
|
||||
subscribeToMore,
|
||||
client,
|
||||
loading: loadingLogs,
|
||||
refetch,
|
||||
} = useGetProjectLogsQuery({
|
||||
variables: { appID: project?.id, ...filters },
|
||||
client: clientWithSplit,
|
||||
@@ -136,9 +135,8 @@ export default function LogsPage() {
|
||||
const onSubmitFilterValues = useCallback(
|
||||
async (values: LogsFilterFormValues) => {
|
||||
setFilters({ ...(values as LogsFilters) });
|
||||
await refetch();
|
||||
},
|
||||
[setFilters, refetch],
|
||||
[setFilters],
|
||||
);
|
||||
|
||||
const loading = loadingProject || loadingLogs;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { graphql } from 'msw';
|
||||
|
||||
const nhostGraphQLLink = graphql.link('https://local.graphql.nhost.run/v1');
|
||||
const nhostGraphQLLink = graphql.link(
|
||||
'https://local.graphql.local.nhost.run/v1',
|
||||
);
|
||||
|
||||
export default nhostGraphQLLink;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { rest } from 'msw';
|
||||
|
||||
const hasuraMetadataQuery = rest.post(
|
||||
'https://local.hasura.nhost.run/v1/metadata',
|
||||
'https://local.hasura.local.nhost.run/v1/metadata',
|
||||
(_req, res, ctx) =>
|
||||
res(
|
||||
ctx.delay(250),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { rest } from 'msw';
|
||||
|
||||
const tableQuery = rest.post(
|
||||
'https://local.hasura.nhost.run/v2/query',
|
||||
'https://local.hasura.local.nhost.run/v2/query',
|
||||
async (req, res, ctx) => {
|
||||
const body = await req.json();
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { NhostSession } from '@nhost/nextjs';
|
||||
import { rest } from 'msw';
|
||||
|
||||
const tokenQuery = rest.post(
|
||||
`https://local.auth.nhost.run/v1/token`,
|
||||
`https://local.auth.local.nhost.run/v1/token`,
|
||||
(_req, res, ctx) =>
|
||||
res(
|
||||
ctx.json<NhostSession>({
|
||||
|
||||
@@ -35,13 +35,14 @@ process.env = {
|
||||
NODE_ENV: 'development',
|
||||
NEXT_PUBLIC_NHOST_PLATFORM: 'false',
|
||||
NEXT_PUBLIC_ENV: 'dev',
|
||||
NEXT_PUBLIC_NHOST_AUTH_URL: 'https://local.auth.nhost.run/v1',
|
||||
NEXT_PUBLIC_NHOST_FUNCTIONS_URL: 'https://local.functions.nhost.run/v1',
|
||||
NEXT_PUBLIC_NHOST_GRAPHQL_URL: 'https://local.graphql.nhost.run/v1',
|
||||
NEXT_PUBLIC_NHOST_STORAGE_URL: 'https://local.storage.nhost.run/v1',
|
||||
NEXT_PUBLIC_NHOST_HASURA_CONSOLE_URL: 'https://local.hasura.nhost.run',
|
||||
NEXT_PUBLIC_NHOST_HASURA_MIGRATIONS_API_URL: 'https://local.hasura.nhost.run',
|
||||
NEXT_PUBLIC_NHOST_HASURA_API_URL: 'https://local.hasura.nhost.run',
|
||||
NEXT_PUBLIC_NHOST_AUTH_URL: 'https://local.auth.local.nhost.run/v1',
|
||||
NEXT_PUBLIC_NHOST_FUNCTIONS_URL: 'https://local.functions.local.nhost.run/v1',
|
||||
NEXT_PUBLIC_NHOST_GRAPHQL_URL: 'https://local.graphql.local.nhost.run/v1',
|
||||
NEXT_PUBLIC_NHOST_STORAGE_URL: 'https://local.storage.local.nhost.run/v1',
|
||||
NEXT_PUBLIC_NHOST_HASURA_CONSOLE_URL: 'https://local.hasura.local.nhost.run',
|
||||
NEXT_PUBLIC_NHOST_HASURA_MIGRATIONS_API_URL:
|
||||
'https://local.hasura.local.nhost.run',
|
||||
NEXT_PUBLIC_NHOST_HASURA_API_URL: 'https://local.hasura.local.nhost.run',
|
||||
};
|
||||
|
||||
export const queryClient = new QueryClient({
|
||||
@@ -68,7 +69,7 @@ function Providers({ children }: PropsWithChildren<{}>) {
|
||||
nhost={nhost}
|
||||
generateLinks={() => [
|
||||
createHttpLink({
|
||||
uri: 'https://local.graphql.nhost.run/v1',
|
||||
uri: 'https://local.graphql.local.nhost.run/v1',
|
||||
}),
|
||||
]}
|
||||
>
|
||||
|
||||
@@ -33,13 +33,14 @@ process.env = {
|
||||
NODE_ENV: 'development',
|
||||
NEXT_PUBLIC_NHOST_PLATFORM: 'false',
|
||||
NEXT_PUBLIC_ENV: 'dev',
|
||||
NEXT_PUBLIC_NHOST_AUTH_URL: 'https://local.auth.nhost.run/v1',
|
||||
NEXT_PUBLIC_NHOST_FUNCTIONS_URL: 'https://local.functions.nhost.run/v1',
|
||||
NEXT_PUBLIC_NHOST_GRAPHQL_URL: 'https://local.graphql.nhost.run/v1',
|
||||
NEXT_PUBLIC_NHOST_STORAGE_URL: 'https://local.storage.nhost.run/v1',
|
||||
NEXT_PUBLIC_NHOST_HASURA_CONSOLE_URL: 'https://local.hasura.nhost.run',
|
||||
NEXT_PUBLIC_NHOST_HASURA_MIGRATIONS_API_URL: 'https://local.hasura.nhost.run',
|
||||
NEXT_PUBLIC_NHOST_HASURA_API_URL: 'https://local.hasura.nhost.run',
|
||||
NEXT_PUBLIC_NHOST_AUTH_URL: 'https://local.auth.local.nhost.run/v1',
|
||||
NEXT_PUBLIC_NHOST_FUNCTIONS_URL: 'https://local.functions.local.nhost.run/v1',
|
||||
NEXT_PUBLIC_NHOST_GRAPHQL_URL: 'https://local.graphql.local.nhost.run/v1',
|
||||
NEXT_PUBLIC_NHOST_STORAGE_URL: 'https://local.storage.local.nhost.run/v1',
|
||||
NEXT_PUBLIC_NHOST_HASURA_CONSOLE_URL: 'https://local.hasura.local.nhost.run',
|
||||
NEXT_PUBLIC_NHOST_HASURA_MIGRATIONS_API_URL:
|
||||
'https://local.hasura.local.nhost.run',
|
||||
NEXT_PUBLIC_NHOST_HASURA_API_URL: 'https://local.hasura.local.nhost.run',
|
||||
};
|
||||
|
||||
export const queryClient = new QueryClient({
|
||||
@@ -66,7 +67,7 @@ function Providers({ children }: PropsWithChildren<{}>) {
|
||||
nhost={nhost}
|
||||
generateLinks={() => [
|
||||
createHttpLink({
|
||||
uri: 'https://local.graphql.nhost.run/v1',
|
||||
uri: 'https://local.graphql.local.nhost.run/v1',
|
||||
}),
|
||||
]}
|
||||
>
|
||||
|
||||
19
dashboard/src/utils/env/env.ts
vendored
19
dashboard/src/utils/env/env.ts
vendored
@@ -17,7 +17,8 @@ export function getHasuraAdminSecret() {
|
||||
*/
|
||||
export function getAuthServiceUrl() {
|
||||
return (
|
||||
process.env.NEXT_PUBLIC_NHOST_AUTH_URL || 'https://local.auth.nhost.run/v1'
|
||||
process.env.NEXT_PUBLIC_NHOST_AUTH_URL ||
|
||||
'https://local.auth.local.nhost.run/v1'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -25,7 +26,9 @@ export function getAuthServiceUrl() {
|
||||
* Custom URL of the Database service.
|
||||
*/
|
||||
export function getDatabaseServiceUrl() {
|
||||
return process.env.NEXT_PUBLIC_NHOST_DATABASE_URL || 'local.db.nhost.run';
|
||||
return (
|
||||
process.env.NEXT_PUBLIC_NHOST_DATABASE_URL || 'local.db.local.nhost.run'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -34,7 +37,7 @@ export function getDatabaseServiceUrl() {
|
||||
export function getGraphqlServiceUrl() {
|
||||
return (
|
||||
process.env.NEXT_PUBLIC_NHOST_GRAPHQL_URL ||
|
||||
'https://local.graphql.nhost.run/v1'
|
||||
'https://local.graphql.local.nhost.run/v1'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -44,7 +47,7 @@ export function getGraphqlServiceUrl() {
|
||||
export function getStorageServiceUrl() {
|
||||
return (
|
||||
process.env.NEXT_PUBLIC_NHOST_STORAGE_URL ||
|
||||
'https://local.storage.nhost.run/v1'
|
||||
'https://local.storage.local.nhost.run/v1'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -54,7 +57,7 @@ export function getStorageServiceUrl() {
|
||||
export function getFunctionsServiceUrl() {
|
||||
return (
|
||||
process.env.NEXT_PUBLIC_NHOST_FUNCTIONS_URL ||
|
||||
'https://local.functions.nhost.run/v1'
|
||||
'https://local.functions.local.nhost.run/v1'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -64,7 +67,7 @@ export function getFunctionsServiceUrl() {
|
||||
export function getHasuraConsoleServiceUrl() {
|
||||
return (
|
||||
process.env.NEXT_PUBLIC_NHOST_HASURA_CONSOLE_URL ||
|
||||
'https://local.hasura.nhost.run'
|
||||
'https://local.hasura.local.nhost.run'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -84,7 +87,7 @@ export function getHasuraMigrationsApiUrl() {
|
||||
export function getHasuraApiUrl() {
|
||||
return (
|
||||
process.env.NEXT_PUBLIC_NHOST_HASURA_API_URL ||
|
||||
'https://local.hasura.nhost.run'
|
||||
'https://local.hasura.local.nhost.run'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -94,6 +97,6 @@ export function getHasuraApiUrl() {
|
||||
export function getConfigServerUrl() {
|
||||
return (
|
||||
process.env.NEXT_PUBLIC_NHOST_CONFIGSERVER_URL ||
|
||||
'https://local.dashboard.nhost.run/v1/configserver/graphql'
|
||||
'https://local.dashboard.local.nhost.run/v1/configserver/graphql'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @nhost/docs
|
||||
|
||||
## 2.28.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 6b8163d: fix(nhost-js) update service URL generation for local environments
|
||||
|
||||
## 2.28.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -6,21 +6,21 @@ icon: rectangle-code
|
||||
|
||||
## `nhost init`
|
||||
|
||||
Initializes current directory with a new project containing configuration and objects necessary to run Nhost locally.
|
||||
Initializes current directory with a new project containing configuration and objects necessary to run Nhost locally.
|
||||
|
||||
<Accordion title="Output">
|
||||
|
||||
Initializing Nhost project
|
||||
Initializing Nhost project
|
||||
|
||||
Successfully initialized Nhost project, run `nhost up` to start development
|
||||
|
||||
Successfully initialized Nhost project, run `nhost up` to start development
|
||||
</Accordion>
|
||||
|
||||
### Flags
|
||||
### Flags
|
||||
|
||||
`--remote` optional `false` <br />
|
||||
Pulls state from a remote Nhost instance.
|
||||
|
||||
|
||||
## `nhost up`
|
||||
|
||||
Starts Nhost for development and testing purposes. Requires scaffolding from `nhost init`.
|
||||
@@ -31,13 +31,13 @@ Starts Nhost for development and testing purposes. Requires scaffolding from `nh
|
||||
Nhost development environment started.
|
||||
URLs:
|
||||
- Postgres: postgres://postgres:postgres@localhost:5432/local
|
||||
- Hasura: https://local.hasura.nhost.run
|
||||
- GraphQL: https://local.graphql.nhost.run
|
||||
- Auth: https://local.auth.nhost.run
|
||||
- Storage: https://local.storage.nhost.run
|
||||
- Functions: https://local.functions.nhost.run
|
||||
- Dashboard: https://local.dashboard.nhost.run
|
||||
- Mailhog: https://local.mailhog.nhost.run
|
||||
- Hasura: https://local.hasura.local.nhost.run
|
||||
- GraphQL: https://local.graphql.local.nhost.run
|
||||
- Auth: https://local.auth.local.nhost.run
|
||||
- Storage: https://local.storage.local.nhost.run
|
||||
- Functions: https://local.functions.local.nhost.run
|
||||
- Dashboard: https://local.dashboard.local.nhost.run
|
||||
- Mailhog: https://local.mailhog.local.nhost.run
|
||||
|
||||
SDK Configuration:
|
||||
Subdomain: local
|
||||
@@ -50,26 +50,22 @@ Run `nhost logs` to watch the logs
|
||||
|
||||
</Accordion>
|
||||
|
||||
|
||||
|
||||
|
||||
## `nhost down`
|
||||
|
||||
Stops all services and deletes all containers.
|
||||
|
||||
### Flags
|
||||
### Flags
|
||||
|
||||
`--volumes` optional `false` <br />
|
||||
Remove volumes.
|
||||
|
||||
|
||||
## `nhost login`
|
||||
|
||||
Login to an Nhost account to perform authenticated operations.
|
||||
|
||||
<Accordion title="Output">
|
||||
- email: user@domain.com
|
||||
- password:
|
||||
- password:
|
||||
|
||||
Authenticating <br />
|
||||
Successfully logged in, creating PAT <br />
|
||||
@@ -78,7 +74,7 @@ Storing PAT for future user
|
||||
|
||||
</Accordion>
|
||||
|
||||
### Flags
|
||||
### Flags
|
||||
|
||||
`--email` optional <br />
|
||||
Email adress.
|
||||
@@ -104,7 +100,7 @@ app-auth-1 | {"level":"info","message":"Running on port 4000"}
|
||||
|
||||
</Accordion>
|
||||
|
||||
### Flags
|
||||
### Flags
|
||||
|
||||
`--follow` optional <br />
|
||||
Follow (or tail) log output.
|
||||
@@ -146,6 +142,7 @@ List all remote Nhost projects this user has access to.
|
||||
12 │ xmhqdbhkvskuubnelgkc │ monitoring-app-london │ monitoring │ eu-west-2 │
|
||||
13 │ jjetetkbmovfgyewremk │ monitoring-app-mumbai │ monitoring │ ap-south-1 │
|
||||
```
|
||||
|
||||
</Accordion>
|
||||
|
||||
## `nhost secrets`
|
||||
@@ -159,4 +156,3 @@ Manage secrets in the Nhost cloud.
|
||||
<Accordion title="Output">
|
||||
|
||||
</Accordion>
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ To install the Nhost CLI copy the following command and paste it into your termi
|
||||
sudo curl -L https://raw.githubusercontent.com/nhost/cli/main/get.sh | bash
|
||||
```
|
||||
|
||||
The `get.sh` script checks for both the architecture and operating system and installs the right binary.
|
||||
The `get.sh` script checks for both the architecture and operating system and installs the right binary.
|
||||
|
||||
### Supported Platforms:
|
||||
|
||||
@@ -56,13 +56,13 @@ With the project scaffolding in place, start the local Nhost instance with `nhos
|
||||
Nhost development environment started.
|
||||
URLs:
|
||||
- Postgres: postgres://postgres:postgres@localhost:5432/local
|
||||
- Hasura: https://local.hasura.nhost.run
|
||||
- GraphQL: https://local.graphql.nhost.run
|
||||
- Auth: https://local.auth.nhost.run
|
||||
- Storage: https://local.storage.nhost.run
|
||||
- Functions: https://local.functions.nhost.run
|
||||
- Dashboard: https://local.dashboard.nhost.run
|
||||
- Mailhog: https://local.mailhog.nhost.run
|
||||
- Hasura: https://local.hasura.local.nhost.run
|
||||
- GraphQL: https://local.graphql.local.nhost.run
|
||||
- Auth: https://local.auth.local.nhost.run
|
||||
- Storage: https://local.storage.local.nhost.run
|
||||
- Functions: https://local.functions.local.nhost.run
|
||||
- Dashboard: https://local.dashboard.local.nhost.run
|
||||
- Mailhog: https://local.mailhog.local.nhost.run
|
||||
|
||||
SDK Configuration:
|
||||
Subdomain: local
|
||||
|
||||
@@ -4,9 +4,9 @@ description: 'Developing locally with the Nhost CLI'
|
||||
icon: hand-wave
|
||||
---
|
||||
|
||||
Run the Nhost Stack on your computer with `nhost init` and `nhost start`. The Nhost CLI ships with all the tools you need to run, test, and operate your projects.
|
||||
Run the Nhost Stack on your computer with `nhost init` and `nhost start`. The Nhost CLI ships with all the tools you need to run, test, and operate your projects.
|
||||
|
||||
Manage configuration, database migrations, API schema changes, and more, with ease.
|
||||
Manage configuration, database migrations, API schema changes, and more, with ease.
|
||||
|
||||
```bash
|
||||
> nhost up
|
||||
@@ -14,13 +14,13 @@ Manage configuration, database migrations, API schema changes, and more, with ea
|
||||
Nhost development environment started.
|
||||
URLs:
|
||||
- Postgres: postgres://postgres:postgres@localhost:5432/local
|
||||
- Hasura: https://local.hasura.nhost.run
|
||||
- GraphQL: https://local.graphql.nhost.run
|
||||
- Auth: https://local.auth.nhost.run
|
||||
- Storage: https://local.storage.nhost.run
|
||||
- Functions: https://local.functions.nhost.run
|
||||
- Dashboard: https://local.dashboard.nhost.run
|
||||
- Mailhog: https://local.mailhog.nhost.run
|
||||
- Hasura: https://local.hasura.local.nhost.run
|
||||
- GraphQL: https://local.graphql.local.nhost.run
|
||||
- Auth: https://local.auth.local.nhost.run
|
||||
- Storage: https://local.storage.local.nhost.run
|
||||
- Functions: https://local.functions.local.nhost.run
|
||||
- Dashboard: https://local.dashboard.local.nhost.run
|
||||
- Mailhog: https://local.mailhog.local.nhost.run
|
||||
|
||||
SDK Configuration:
|
||||
Subdomain: local
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Assistants"
|
||||
description: "Deploy your customized AI assistants"
|
||||
title: 'Assistants'
|
||||
description: 'Deploy your customized AI assistants'
|
||||
icon: wand-magic-sparkles
|
||||
---
|
||||
|
||||
@@ -23,110 +23,82 @@ The first step is to create an AI assistant. You can create an AI assistant by u
|
||||
```graphql
|
||||
mutation {
|
||||
graphite {
|
||||
insertAssistant(object: {
|
||||
name: "awesome-assistant-for-my-users",
|
||||
description: "My Awesome assistant for my users",
|
||||
instructions: "You are a useful assistant for this demo application. You are an expert on movies. You also know a bit about deep questions.",
|
||||
model: "gpt-3.5-turbo-1106",
|
||||
graphql: [
|
||||
{
|
||||
description: "get movies with higher score than the input"
|
||||
name: "GetMoviesWithScoreHigherThan",
|
||||
query: "query ($score: numeric!) { movies(where: {score: {_gt: $score}}) { name overview score }}",
|
||||
arguments: [
|
||||
{
|
||||
name: "score",
|
||||
description: "score to compare against",
|
||||
type: "number",
|
||||
required: true,
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
description: "search movies using natural language",
|
||||
name: "SearchMovies",
|
||||
query: "query GraphiteSearchMovies($query: String!) { graphiteSearchMovies(args: {query: $query, amount: 5}) { id name overview genre } }",
|
||||
arguments: [
|
||||
{
|
||||
name: "query",
|
||||
description: "Text to search",
|
||||
type: "string",
|
||||
required: true,
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
description: "insert a movie into the database",
|
||||
name: "InsertMovie",
|
||||
query: "mutation InsertMovie($name: String, $overview: String, $genre: String, $crew: String, $budget: bigint, $revenue: bigint, $country: String, $score: numeric) { insertMovie(object: {name: $name, overview: $overview, score: $score, genre: $genre, crew: $crew, budget: $budget, revenue: $revenue, country: $country}) {id}}",
|
||||
arguments: [
|
||||
{
|
||||
name: "name",
|
||||
description: "Name of the movie",
|
||||
type: "string",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "overview",
|
||||
description: "Overview of the movie",
|
||||
type: "string",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "genre",
|
||||
description: "Genre of the movie",
|
||||
type: "string",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "crew",
|
||||
description: "Crew of the movie",
|
||||
type: "string",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "budget",
|
||||
description: "Budget of the movie",
|
||||
type: "number",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "revenue",
|
||||
description: "Revenue generated by the movie",
|
||||
type: "number",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "country",
|
||||
description: "Country of origin for the movie",
|
||||
type: "string",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "score",
|
||||
description: "Score of the movie",
|
||||
type: "number",
|
||||
required: true,
|
||||
},
|
||||
]
|
||||
}
|
||||
],
|
||||
webhooks: [
|
||||
{
|
||||
name: "answer_deep_questions",
|
||||
description: "Answers deep questions about life, the universe and everything",
|
||||
URL: "https://local.functions.nhost.run/v1/meaning",
|
||||
arguments: [
|
||||
{
|
||||
name: "question",
|
||||
description: "question that needs answer",
|
||||
type: "string",
|
||||
required: true,
|
||||
}
|
||||
],
|
||||
}
|
||||
]
|
||||
}) {
|
||||
insertAssistant(
|
||||
object: {
|
||||
name: "awesome-assistant-for-my-users"
|
||||
description: "My Awesome assistant for my users"
|
||||
instructions: "You are a useful assistant for this demo application. You are an expert on movies. You also know a bit about deep questions."
|
||||
model: "gpt-3.5-turbo-1106"
|
||||
graphql: [
|
||||
{
|
||||
description: "get movies with higher score than the input"
|
||||
name: "GetMoviesWithScoreHigherThan"
|
||||
query: "query ($score: numeric!) { movies(where: {score: {_gt: $score}}) { name overview score }}"
|
||||
arguments: [
|
||||
{
|
||||
name: "score"
|
||||
description: "score to compare against"
|
||||
type: "number"
|
||||
required: true
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
description: "search movies using natural language"
|
||||
name: "SearchMovies"
|
||||
query: "query GraphiteSearchMovies($query: String!) { graphiteSearchMovies(args: {query: $query, amount: 5}) { id name overview genre } }"
|
||||
arguments: [
|
||||
{ name: "query", description: "Text to search", type: "string", required: true }
|
||||
]
|
||||
}
|
||||
{
|
||||
description: "insert a movie into the database"
|
||||
name: "InsertMovie"
|
||||
query: "mutation InsertMovie($name: String, $overview: String, $genre: String, $crew: String, $budget: bigint, $revenue: bigint, $country: String, $score: numeric) { insertMovie(object: {name: $name, overview: $overview, score: $score, genre: $genre, crew: $crew, budget: $budget, revenue: $revenue, country: $country}) {id}}"
|
||||
arguments: [
|
||||
{ name: "name", description: "Name of the movie", type: "string", required: true }
|
||||
{
|
||||
name: "overview"
|
||||
description: "Overview of the movie"
|
||||
type: "string"
|
||||
required: true
|
||||
}
|
||||
{ name: "genre", description: "Genre of the movie", type: "string", required: true }
|
||||
{ name: "crew", description: "Crew of the movie", type: "string", required: true }
|
||||
{ name: "budget", description: "Budget of the movie", type: "number", required: true }
|
||||
{
|
||||
name: "revenue"
|
||||
description: "Revenue generated by the movie"
|
||||
type: "number"
|
||||
required: true
|
||||
}
|
||||
{
|
||||
name: "country"
|
||||
description: "Country of origin for the movie"
|
||||
type: "string"
|
||||
required: true
|
||||
}
|
||||
{ name: "score", description: "Score of the movie", type: "number", required: true }
|
||||
]
|
||||
}
|
||||
]
|
||||
webhooks: [
|
||||
{
|
||||
name: "answer_deep_questions"
|
||||
description: "Answers deep questions about life, the universe and everything"
|
||||
URL: "https://local.functions.local.nhost.run/v1/meaning"
|
||||
arguments: [
|
||||
{
|
||||
name: "question"
|
||||
description: "question that needs answer"
|
||||
type: "string"
|
||||
required: true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
) {
|
||||
assistantID
|
||||
}
|
||||
}
|
||||
@@ -140,7 +112,6 @@ mutation {
|
||||
|
||||
In order to enhance our AI assistants we are leveraging tools. Tools can be either queries or mutations performed against your project's GraphQL engine or they can also be any arbitrary endpoint you choose. Using the example above, we added 4 different tools to our AI Assistant:
|
||||
|
||||
|
||||
- The GraphQL query `GetMoviesWithScoreHigherThan`, which will allow the AI Assistant to query movies based on their score.
|
||||
- The GraphQL query `SearchMovies`, which leverages [auto-embeddings](auto-embeddings) and will allow the AI Assistant to query movies using natural language.
|
||||
- The GraphQL mutation `InsertMovie`, which will let the AI Assistant to insert new movies directly into the database.
|
||||
@@ -160,7 +131,7 @@ To start a session you can use the mutation `startSession` and pass the id of th
|
||||
```graphql
|
||||
mutation {
|
||||
graphite {
|
||||
startSession(assistantID:"asst_xolmq2yeBBRi8CKGc5YWXGaA") {
|
||||
startSession(assistantID: "asst_xolmq2yeBBRi8CKGc5YWXGaA") {
|
||||
sessionID
|
||||
}
|
||||
}
|
||||
@@ -188,10 +159,10 @@ Now that you have started a session you can send your first message:
|
||||
```graphql
|
||||
mutation {
|
||||
graphite {
|
||||
sendMessage(
|
||||
sessionID:"thread_dxHHNpQryFpJ8wXXD9Q2fQJg",
|
||||
sendMessage(
|
||||
sessionID: "thread_dxHHNpQryFpJ8wXXD9Q2fQJg"
|
||||
message: "what is the meaning of life?"
|
||||
prevMessageID: "",
|
||||
prevMessageID: ""
|
||||
) {
|
||||
sessionID
|
||||
messages {
|
||||
@@ -207,7 +178,6 @@ mutation {
|
||||
|
||||
The field `prevMessageID` is used to only return messages after this one. As this is the beginning of the conversation we send an empty string to get all messages back. After executing that mutation we should receive a response like:
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"data": {
|
||||
@@ -249,10 +219,10 @@ We can continue the conversation by performing from mutations. Notice this time
|
||||
```graphql
|
||||
mutation {
|
||||
graphite {
|
||||
sendMessage(
|
||||
sessionID:"thread_dxHHNpQryFpJ8wXXD9Q2fQJg",
|
||||
sendMessage(
|
||||
sessionID: "thread_dxHHNpQryFpJ8wXXD9Q2fQJg"
|
||||
message: "recommend a comedy movie for a rainy day with score higher than 80"
|
||||
prevMessageID: "msg_kTZonuiwZDxnipDADXk4bgFd",
|
||||
prevMessageID: "msg_kTZonuiwZDxnipDADXk4bgFd"
|
||||
) {
|
||||
sessionID
|
||||
messages {
|
||||
@@ -302,7 +272,6 @@ In this case ChatGPT detected some of the information needed to formulate the an
|
||||
|
||||
Interactions are not limited to just one tool or to simply query data. Tools can be combined and they can perform any action you wish. For instance, let's take a look to the following session:
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"data": {
|
||||
|
||||
@@ -150,7 +150,7 @@ curl -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "x-hasura-admin-secret: nhost-admin-secret" \
|
||||
-d '{"userId": "FFAB5354-C5EB-42C1-8BC3-AD21D2297883", "defaultRole": "user", "allowedRoles": ["user", "me"]}' \
|
||||
https://local.functions.nhost.run/v1/custom-jwt
|
||||
https://local.functions.local.nhost.run/v1/custom-jwt
|
||||
{"accessToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MTcxNDIyMTMsImh0dHBzOi8vaGFzdXJhLmlvL2p3dC9jbGFpbXMiOnsieC1oYXN1cmEtYWxsb3dlZC1yb2xlcyI6WyJ1c2VyIiwibWUiXSwieC1oYXN1cmEtZGVmYXVsdC1yb2xlIjoidXNlciIsIngtaGFzdXJhLXVzZXItaWQiOiJGRkFCNTM1NC1DNUVCLTQyQzEtOEJDMy1BRDIxRDIyOTc4ODMiLCJ4LWhhc3VyYS11c2VyLWlzLWFub255bW91cyI6ImZhbHNlIiwieC1oYXN1cmEtb24tYmVoYWxmLW9mIjoiYWRtaW4ifSwiaWF0IjoxNzE3MTM4NjEzLCJpc3MiOiJjdXN0b20tbGFtYmRhIiwic3ViIjoiRkZBQjUzNTQtQzVFQi00MkMxLThCQzMtQUQyMUQyMjk3ODgzIn0.bRhzJvXMdkQA8aXPH95uMT17WHED2rSRq3gE21Vp3Ak"}
|
||||
```
|
||||
|
||||
@@ -160,10 +160,7 @@ The new token should be a valid token for your application with the custom value
|
||||
{
|
||||
"exp": 1717141288,
|
||||
"https://hasura.io/jwt/claims": {
|
||||
"x-hasura-allowed-roles": [
|
||||
"a",
|
||||
"b"
|
||||
],
|
||||
"x-hasura-allowed-roles": ["a", "b"],
|
||||
"x-hasura-default-role": "user",
|
||||
"x-hasura-user-id": "FFAB5354-C5EB-42C1-8BC3-AD21D2297883",
|
||||
"x-hasura-user-is-anonymous": "false",
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
---
|
||||
title: Local Development
|
||||
description: Learn how to start a development instance of Nhost
|
||||
description: Learn how to start a development instance of Nhost
|
||||
icon: code
|
||||
---
|
||||
|
||||
Nhost's command-line interface (CLI) lets you run a complete Nhost development environment locally with the following services: PostgreSQL database, Hasura, Authentication, Storage (MinIO), Serverless Functions, and Emails (Mailhog).
|
||||
|
||||
|
||||
## Dependencies
|
||||
|
||||
- [Git](https://git-scm.com/downloads)
|
||||
@@ -18,8 +17,10 @@ Nhost's command-line interface (CLI) lets you run a complete Nhost development e
|
||||
nhost login
|
||||
```
|
||||
|
||||
<Info>If you used GitHub to register, you will have to first set a password in your [account page](https://app.nhost.io/account).</Info>
|
||||
|
||||
<Info>
|
||||
If you used GitHub to register, you will have to first set a password in your [account
|
||||
page](https://app.nhost.io/account).
|
||||
</Info>
|
||||
|
||||
## Initialize local project
|
||||
|
||||
@@ -38,7 +39,6 @@ nhost init
|
||||
|
||||
`nhost init` creates all the configuration necessary for your project, including database migrations and Hasura metadata.
|
||||
|
||||
|
||||
We can now start your project with `nhost up`.
|
||||
|
||||
```bash
|
||||
@@ -52,13 +52,13 @@ Nhost development environment started.
|
||||
|
||||
URLs:
|
||||
- Postgres: postgres://postgres:postgres@localhost:5432/local
|
||||
- Hasura: https://local.hasura.nhost.run
|
||||
- GraphQL: https://local.graphql.nhost.run
|
||||
- Auth: https://local.auth.nhost.run
|
||||
- Storage: https://local.storage.nhost.run
|
||||
- Functions: https://local.functions.nhost.run
|
||||
- Dashboard: https://local.dashboard.nhost.run
|
||||
- Mailhog: https://local.mailhog.nhost.run
|
||||
- Hasura: https://local.hasura.local.nhost.run
|
||||
- GraphQL: https://local.graphql.local.nhost.run
|
||||
- Auth: https://local.auth.local.nhost.run
|
||||
- Storage: https://local.storage.local.nhost.run
|
||||
- Functions: https://local.functions.local.nhost.run
|
||||
- Dashboard: https://local.dashboard.local.nhost.run
|
||||
- Mailhog: https://local.mailhog.local.nhost.run
|
||||
|
||||
SDK Configuration:
|
||||
Subdomain: local
|
||||
@@ -77,7 +77,7 @@ You can use `nhost down` at any time to tear down your environment.
|
||||
To test that the services are running, let's curl the Auth endpoint and get its version:
|
||||
|
||||
```bash
|
||||
curl https://local.auth.nhost.run/v1/version
|
||||
curl https://local.auth.local.nhost.run/v1/version
|
||||
|
||||
{"version":"v0.20.1"}
|
||||
```
|
||||
@@ -108,8 +108,7 @@ Let's create a new table called `messages`, with the following columns:
|
||||
- author_id (UUID)
|
||||
- created_at (Timestamp)
|
||||
|
||||
There are other ways to generate a migration, here we will use the local Nhost Dashboard running on `https://local.dashboard.nhost.run/local/local`. Please head to the `database` tab and add the columns as follows:
|
||||
|
||||
There are other ways to generate a migration, here we will use the local Nhost Dashboard running on `https://local.dashboard.local.nhost.run/local/local`. Please head to the `database` tab and add the columns as follows:
|
||||
|
||||

|
||||
|
||||
@@ -201,4 +200,3 @@ To check out your deployment, head over to the **Deployments** tab (https://app.
|
||||

|
||||
|
||||
You should now have the same `messages` table (and permissions) on your production instance!
|
||||
|
||||
|
||||
@@ -81,13 +81,13 @@ INFO nothing to apply on database: default
|
||||
Nhost development environment started.
|
||||
URLs:
|
||||
- Postgres: postgres://postgres:postgres@localhost:5432/postgres
|
||||
- Hasura: https://local.hasura.nhost.run
|
||||
- GraphQL: https://local.graphql.nhost.run
|
||||
- Auth: https://local.auth.nhost.run
|
||||
- Storage: https://local.storage.nhost.run
|
||||
- Functions: https://local.functions.nhost.run
|
||||
- Dashboard: https://local.dashboard.nhost.run
|
||||
- Mailhog: https://local.mailhog.nhost.run
|
||||
- Hasura: https://local.hasura.local.nhost.run
|
||||
- GraphQL: https://local.graphql.local.nhost.run
|
||||
- Auth: https://local.auth.local.nhost.run
|
||||
- Storage: https://local.storage.local.nhost.run
|
||||
- Functions: https://local.functions.local.nhost.run
|
||||
- Dashboard: https://local.dashboard.local.nhost.run
|
||||
- Mailhog: https://local.mailhog.local.nhost.run
|
||||
SDK Configuration:
|
||||
Subdomain: local
|
||||
Region: (empty)
|
||||
@@ -95,4 +95,3 @@ Run `nhost up` to reload the development environment
|
||||
Run `nhost down` to stop the development environment
|
||||
Run `nhost logs` to watch the logs
|
||||
```
|
||||
|
||||
|
||||
@@ -29,13 +29,13 @@ INFO nothing to apply on database: default
|
||||
Nhost development environment started.
|
||||
URLs:
|
||||
- Postgres: postgres://postgres:postgres@localhost:5432/postgres
|
||||
- Hasura: https://local.hasura.nhost.run
|
||||
- GraphQL: https://local.graphql.nhost.run
|
||||
- Auth: https://local.auth.nhost.run
|
||||
- Storage: https://local.storage.nhost.run
|
||||
- Functions: https://local.functions.nhost.run
|
||||
- Dashboard: https://local.dashboard.nhost.run
|
||||
- Mailhog: https://local.mailhog.nhost.run
|
||||
- Hasura: https://local.hasura.local.nhost.run
|
||||
- GraphQL: https://local.graphql.local.nhost.run
|
||||
- Auth: https://local.auth.local.nhost.run
|
||||
- Storage: https://local.storage.local.nhost.run
|
||||
- Functions: https://local.functions.local.nhost.run
|
||||
- Dashboard: https://local.dashboard.local.nhost.run
|
||||
- Mailhog: https://local.mailhog.local.nhost.run
|
||||
|
||||
SDK Configuration:
|
||||
Subdomain: local
|
||||
@@ -103,5 +103,3 @@ alternativeproject-auth-1 | {"level":"info","message":"Applying metadata..."}
|
||||
alternativeproject-auth-1 | {"level":"info","message":"Metadata applied"}
|
||||
alternativeproject-auth-1 | {"level":"info","message":"Running on port 4000"}
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ As mentioned before, you can create a seed from any environment. In this guide,
|
||||
|
||||
```bash
|
||||
$ nhost dev hasura seed create some-initial-data \
|
||||
--endpoint https://local.hasura.nhost.run \
|
||||
--endpoint https://local.hasura.local.nhost.run \
|
||||
--admin-secret nhost-admin-secret \
|
||||
--database-name default \
|
||||
--from-table animals
|
||||
@@ -20,7 +20,12 @@ $ nhost dev hasura seed create some-initial-data \
|
||||
INFO created seed file successfully file=/app/seeds/default/1685692310174_some-initial-data.sql
|
||||
```
|
||||
|
||||
<Info>In the previous command, we instructed the CLI to create a seed named `some-initial-data` while specifying the connection parameters for our local environment. You could also extract data from a cloud project by specifying the correct parameters. Finally, we are only extracting data from the `animals` table, but you could also extract data from any other table or even from all tables.</Info>
|
||||
<Info>
|
||||
In the previous command, we instructed the CLI to create a seed named `some-initial-data` while
|
||||
specifying the connection parameters for our local environment. You could also extract data from a
|
||||
cloud project by specifying the correct parameters. Finally, we are only extracting data from the
|
||||
`animals` table, but you could also extract data from any other table or even from all tables.
|
||||
</Info>
|
||||
|
||||
We can now inspect the file and see its contents:
|
||||
|
||||
@@ -67,7 +72,7 @@ INFO Metadata applied
|
||||
(...) omitted for brevity
|
||||
|
||||
$ nhost dev hasura seed apply \
|
||||
--endpoint https://local.hasura.nhost.run \
|
||||
--endpoint https://local.hasura.local.nhost.run \
|
||||
--admin-secret nhost-admin-secret \
|
||||
--database-name default
|
||||
INFO Help us improve Hasura! The cli collects anonymized usage stats which
|
||||
@@ -76,5 +81,7 @@ visit https://hasura.io/docs/latest/graphql/core/guides/telemetry.html
|
||||
INFO Seeds planted
|
||||
```
|
||||
|
||||
<Info>Seeds are different from migrations because seeds are not automatically applied. If there is data that you want to have in all of your environments, it is best to use a database migration.</Info>
|
||||
|
||||
<Info>
|
||||
Seeds are different from migrations because seeds are not automatically applied. If there is data
|
||||
that you want to have in all of your environments, it is best to use a database migration.
|
||||
</Info>
|
||||
|
||||
@@ -21,9 +21,16 @@ The last thing to notice in the screenshot is that the URLs include information
|
||||
|
||||
Based on the information above, if you want to connect directly to your service from your laptop you can use the URL `http://localhost:5000` while if you want to connect to the Run service from another service (i.e. another Run service or hasura) you can use `http://run-bun-gen:5000`
|
||||
|
||||
<Note>You can also use the environment variable `NHOST_RUN_SERVICE` passing comma-separated values. For instance, the equivalent environment variable for this example would be `NHOST_RUN_SERVICE=../mysvc/nhost-run-service.toml:mysvc,../mysvc/nhost-run-service.toml`</Note>
|
||||
<Note>
|
||||
You can also use the environment variable `NHOST_RUN_SERVICE` passing comma-separated values. For
|
||||
instance, the equivalent environment variable for this example would be
|
||||
`NHOST_RUN_SERVICE=../mysvc/nhost-run-service.toml:mysvc,../mysvc/nhost-run-service.toml`
|
||||
</Note>
|
||||
|
||||
<Warning>The Nhost CLI doesn't build services so make sure you build any image that might be needed for running `nhost run --run-service...`</Warning>
|
||||
<Warning>
|
||||
The Nhost CLI doesn't build services so make sure you build any image that might be needed for
|
||||
running `nhost run --run-service...`
|
||||
</Warning>
|
||||
|
||||
# Quick Development
|
||||
|
||||
@@ -43,7 +50,8 @@ value = 'some-value'
|
||||
[[environment]]
|
||||
name = 'SECRET_KEY'
|
||||
value = '{{ secrets.SECRET_KEY }}'
|
||||
```
|
||||
|
||||
````
|
||||
</Tab>
|
||||
|
||||
<Tab title="overlay">
|
||||
@@ -58,12 +66,13 @@ value = '{{ secrets.SECRET_KEY }}'
|
||||
"path": "/environment/-"
|
||||
},
|
||||
{
|
||||
"value": "https://local.graphql.nhost.run/v1/graphql",
|
||||
"value": "https://local.graphql.local.nhost.run/v1/graphql",
|
||||
"op": "replace",
|
||||
"path": "/environment/0/value"
|
||||
}
|
||||
]
|
||||
```
|
||||
````
|
||||
|
||||
</Tab>
|
||||
<Tab title=".secrets">
|
||||
```toml
|
||||
@@ -77,12 +86,17 @@ We can then generate an `env` file for our service with the folllowing command:
|
||||
```
|
||||
$ nhost run env --config ../mysvc/nhost-run-service.toml --overlay-name local-dev > .env
|
||||
$ cat .env
|
||||
HASURA_GRAPHQL_URL="https://local.graphql.nhost.run/v1/graphql"
|
||||
HASURA_GRAPHQL_URL="https://local.graphql.local.nhost.run/v1/graphql"
|
||||
SOME_CONFIGURATION_PARAMETER="some-value"
|
||||
SECRET_KEY="#asdasd;l;kq23\\n40-0as9d\"\$\\"
|
||||
ENVIRONMENT="dev"
|
||||
```
|
||||
|
||||
<Warning>
|
||||
Keep in mind you may need to use different configuration when attempting to connect to other services in the stack. For instance, in the example above we are using `http://hasura-service:8080/v1/graphql` to connect to hasura in production and in the CLI but when running the service in the host machine using the env file we are using an overlay to change the value to `https://local.graphql.nhost.run/v1/graphql`. Refer to the [network](networking) configuration for more details.
|
||||
Keep in mind you may need to use different configuration when attempting to connect to other
|
||||
services in the stack. For instance, in the example above we are using
|
||||
`http://hasura-service:8080/v1/graphql` to connect to hasura in production and in the CLI but when
|
||||
running the service in the host machine using the env file we are using an overlay to change the
|
||||
value to `https://local.graphql.local.nhost.run/v1/graphql`. Refer to the [network](networking)
|
||||
configuration for more details.
|
||||
</Warning>
|
||||
|
||||
@@ -17,7 +17,8 @@ File metadata is stored in your database in the `files` table in the `storage` s
|
||||
- Create GraphQL relationships between files and your database tables.
|
||||
|
||||
<Warning>
|
||||
Don't modify the database schema, nor GraphQL root fields in any of the tables in the `storage` schema.
|
||||
Don't modify the database schema, nor GraphQL root fields in any of the tables in the `storage`
|
||||
schema.
|
||||
</Warning>
|
||||
|
||||
<Tip>
|
||||
@@ -25,7 +26,7 @@ You're allowed to add and modify the following:
|
||||
|
||||
- GraphQL Relationships
|
||||
- Permissions
|
||||
</Tip>
|
||||
</Tip>
|
||||
|
||||
### Upload File
|
||||
|
||||
@@ -44,7 +45,7 @@ Learn more about [`upload()`](/reference/javascript/storage/upload).
|
||||
<Tab title="HTTP">
|
||||
|
||||
```http
|
||||
POST https://local.storage.nhost.run/v1/files HTTP/1.1
|
||||
POST https://local.storage.local.nhost.run/v1/files HTTP/1.1
|
||||
```
|
||||
|
||||
</Tab>
|
||||
@@ -76,7 +77,7 @@ Learn more about [`getPublicUrl()`](/reference/javascript/storage/get-public-url
|
||||
<Tab title="HTTP">
|
||||
|
||||
```http
|
||||
GET https://local.storage.nhost.run/v1/files/{file_id} HTTP/1.1
|
||||
GET https://local.storage.local.nhost.run/v1/files/{file_id} HTTP/1.1
|
||||
```
|
||||
|
||||
</Tab>
|
||||
@@ -105,7 +106,7 @@ Learn more about [`getPresignedUrl()`](/reference/javascript/storage/get-presign
|
||||
<Tab title="HTTP">
|
||||
|
||||
```http
|
||||
GET https://local.storage.nhost.run/v1/files/{file_id}/presignedurl HTTP/1.1
|
||||
GET https://local.storage.local.nhost.run/v1/files/{file_id}/presignedurl HTTP/1.1
|
||||
```
|
||||
|
||||
</Tab>
|
||||
@@ -128,7 +129,7 @@ Learn more about [`delete()`](/reference/javascript/storage/delete).
|
||||
<Tab title="HTTP">
|
||||
|
||||
```http
|
||||
DELETE https://local.storage.nhost.run/v1/files/{file_id} HTTP/1.1
|
||||
DELETE https://local.storage.local.nhost.run/v1/files/{file_id} HTTP/1.1
|
||||
```
|
||||
|
||||
</Tab>
|
||||
|
||||
@@ -2,7 +2,7 @@ sequenceDiagram
|
||||
user->>+graphite: What is the meaning of life?
|
||||
graphite->>+chatgpt: What is the meaning of life?
|
||||
chatgpt->>-graphite: run `answer_deep_questions`<br/>with {"question": "what is the meaning of life?"}?
|
||||
graphite->>+webhook: POST https://local.functions.nhost.fun/v1/meaning<br/>{"question": "what is the meaning of life?"}
|
||||
graphite->>+webhook: POST https://local.functions.local.nhost.fun/v1/meaning<br/>{"question": "what is the meaning of life?"}
|
||||
webhook->>-graphite: HTTP STATUS OK, Response body: 42
|
||||
graphite->>+chatgpt: 42
|
||||
chatgpt->>-graphite: The answer to the meaning of life is 42...
|
||||
@@ -13,7 +13,7 @@ sequenceDiagram
|
||||
user->>+graphite: recommend a comedy movie...
|
||||
graphite->>+chatgpt: recommend a comedy movie...
|
||||
chatgpt->>-graphite: run `GetMoviesWithScoreHigherThan`<br/>with {"score": 80}
|
||||
graphite->>+graphql: POST https://local.graphql.nhost.fun/v1<br/>query ($score: numeric!) { movies(where: ...
|
||||
graphite->>+graphql: POST https://local.graphql.local.nhost.fun/v1<br/>query ($score: numeric!) { movies(where: ...
|
||||
graphql->>-graphite: { graphql response with movies }
|
||||
graphite->>+chatgpt: { graphql response with movies }
|
||||
chatgpt->>-graphite: Here are a few comedy...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/docs",
|
||||
"version": "2.28.0",
|
||||
"version": "2.28.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "mintlify dev"
|
||||
|
||||
@@ -9,10 +9,9 @@ info:
|
||||
name: LICENSE-TBD
|
||||
url: https://LICENSE-TBD
|
||||
servers:
|
||||
- url: https://local.auth.nhost.run/v1
|
||||
- url: https://local.auth.local.nhost.run/v1
|
||||
description: API Server
|
||||
components:
|
||||
|
||||
securitySchemes:
|
||||
BearerAuth:
|
||||
scheme: bearer
|
||||
@@ -20,7 +19,6 @@ components:
|
||||
bearerFormat: JWT
|
||||
description: JSON Web Token to authorize requests.
|
||||
schemas:
|
||||
|
||||
SignInWebauthnSessionPayload:
|
||||
type: object
|
||||
properties:
|
||||
@@ -42,13 +40,13 @@ components:
|
||||
rpId:
|
||||
type: string
|
||||
example:
|
||||
challenge: "KOGeoAfC2nrZ_SluhmU5RYYMvBsRDvzghjERGdXbbfQ"
|
||||
challenge: 'KOGeoAfC2nrZ_SluhmU5RYYMvBsRDvzghjERGdXbbfQ'
|
||||
allowCredentials:
|
||||
- id: "zCnsWvxgtMrOCeX6eA_yqQ"
|
||||
type: "public-key"
|
||||
- id: 'zCnsWvxgtMrOCeX6eA_yqQ'
|
||||
type: 'public-key'
|
||||
timeout: 60000
|
||||
userVerification: "preferred"
|
||||
rpId: "react-apollo.example.nhost.io"
|
||||
userVerification: 'preferred'
|
||||
rpId: 'react-apollo.example.nhost.io'
|
||||
|
||||
ElevateWebauthnSessionPayload:
|
||||
type: object
|
||||
@@ -71,13 +69,13 @@ components:
|
||||
rpId:
|
||||
type: string
|
||||
example:
|
||||
challenge: "KOGeoAfC2nrZ_SluhmU5RYYMvBsRDvzghjERGdXbbfQ"
|
||||
challenge: 'KOGeoAfC2nrZ_SluhmU5RYYMvBsRDvzghjERGdXbbfQ'
|
||||
allowCredentials:
|
||||
- id: "zCnsWvxgtMrOCeX6eA_yqQ"
|
||||
type: "public-key"
|
||||
- id: 'zCnsWvxgtMrOCeX6eA_yqQ'
|
||||
type: 'public-key'
|
||||
timeout: 60000
|
||||
userVerification: "preferred"
|
||||
rpId: "react-apollo.example.nhost.io"
|
||||
userVerification: 'preferred'
|
||||
rpId: 'react-apollo.example.nhost.io'
|
||||
|
||||
WebauthnSessionPayload:
|
||||
type: object
|
||||
@@ -126,39 +124,39 @@ components:
|
||||
userVerification:
|
||||
type: string
|
||||
example:
|
||||
challenge: "eKdWG60F0lB-wNOviefzn6En0jvdf_GYDyCK2Zuznh8"
|
||||
challenge: 'eKdWG60F0lB-wNOviefzn6En0jvdf_GYDyCK2Zuznh8'
|
||||
rp:
|
||||
name: "hasura-auth"
|
||||
id: "localhost"
|
||||
name: 'hasura-auth'
|
||||
id: 'localhost'
|
||||
user:
|
||||
id: "44b96e0d-18ad-48b9-a517-6537d32223da"
|
||||
name: "john.smith@nhost.io"
|
||||
displayName: "John Smith"
|
||||
id: '44b96e0d-18ad-48b9-a517-6537d32223da'
|
||||
name: 'john.smith@nhost.io'
|
||||
displayName: 'John Smith'
|
||||
pubKeyCredParams:
|
||||
- alg: -7
|
||||
type: "public-key"
|
||||
type: 'public-key'
|
||||
- alg: -8
|
||||
type: "public-key"
|
||||
type: 'public-key'
|
||||
- alg: -36
|
||||
type: "public-key"
|
||||
type: 'public-key'
|
||||
- alg: -37
|
||||
type: "public-key"
|
||||
type: 'public-key'
|
||||
- alg: -38
|
||||
type: "public-key"
|
||||
type: 'public-key'
|
||||
- alg: -39
|
||||
type: "public-key"
|
||||
type: 'public-key'
|
||||
- alg: -257
|
||||
type: "public-key"
|
||||
type: 'public-key'
|
||||
- alg: -258
|
||||
type: "public-key"
|
||||
type: 'public-key'
|
||||
- alg: -259
|
||||
type: "public-key"
|
||||
type: 'public-key'
|
||||
timeout: 60000
|
||||
attestation: "indirect"
|
||||
attestation: 'indirect'
|
||||
excludeCredentials: []
|
||||
authenticatorSelection:
|
||||
requireResidentKey: false
|
||||
userVerification: "preferred"
|
||||
userVerification: 'preferred'
|
||||
|
||||
CannotSendSmsError:
|
||||
additionalProperties: false
|
||||
@@ -745,17 +743,17 @@ components:
|
||||
type: object
|
||||
example:
|
||||
credential:
|
||||
id: "zCnsWvxgtMrOCeX6eA_yqQ"
|
||||
rawId: "zCnsWvxgtMrOCeX6eA_yqQ"
|
||||
id: 'zCnsWvxgtMrOCeX6eA_yqQ'
|
||||
rawId: 'zCnsWvxgtMrOCeX6eA_yqQ'
|
||||
response:
|
||||
attestationObject: "o2NmbXRkbm9uZWdhdHRTdG10oGhhdXRoRGF0YViU0RE6Bmg2J-FxNrC8136ZQSeTWKWtdni_Lpfv5XR4bDtdAAAAALraVWanqkAfvZZFYZpVEg0AEMwp7Fr8YLTKzgnl-ngP8qmlAQIDJiABIVgg3XjPRqX1a22te029Du57F1w56XXy3GARb842fEtQlIEiWCC1Jce4J3bN1P-V-78elqwVy0u6MAxEcZwCvkSLqZjkjA"
|
||||
clientDataJSON: "eyJ0eXBlIjoid2ViYXV0aG4uY3JlYXRlIiwiY2hhbGxlbmdlIjoiSGlwZ0NKLWR0bU1FeWxRN05pRnV4VXE0allNbFIwMDA1V2VmcEJWQm9payIsIm9yaWdpbiI6Imh0dHBzOi8vcmVhY3QtYXBvbGxvLmV4YW1wbGUubmhvc3QuaW8ifQ"
|
||||
type: "public-key"
|
||||
attestationObject: 'o2NmbXRkbm9uZWdhdHRTdG10oGhhdXRoRGF0YViU0RE6Bmg2J-FxNrC8136ZQSeTWKWtdni_Lpfv5XR4bDtdAAAAALraVWanqkAfvZZFYZpVEg0AEMwp7Fr8YLTKzgnl-ngP8qmlAQIDJiABIVgg3XjPRqX1a22te029Du57F1w56XXy3GARb842fEtQlIEiWCC1Jce4J3bN1P-V-78elqwVy0u6MAxEcZwCvkSLqZjkjA'
|
||||
clientDataJSON: 'eyJ0eXBlIjoid2ViYXV0aG4uY3JlYXRlIiwiY2hhbGxlbmdlIjoiSGlwZ0NKLWR0bU1FeWxRN05pRnV4VXE0allNbFIwMDA1V2VmcEJWQm9payIsIm9yaWdpbiI6Imh0dHBzOi8vcmVhY3QtYXBvbGxvLmV4YW1wbGUubmhvc3QuaW8ifQ'
|
||||
type: 'public-key'
|
||||
clientExtensionResults: {}
|
||||
authenticatorAttachment: "platform"
|
||||
authenticatorAttachment: 'platform'
|
||||
transports:
|
||||
- "internal"
|
||||
- "hybrid"
|
||||
- 'internal'
|
||||
- 'hybrid'
|
||||
options: {}
|
||||
required:
|
||||
- credential
|
||||
@@ -807,18 +805,18 @@ components:
|
||||
authenticatorAttachment:
|
||||
type: string
|
||||
example:
|
||||
email: "nuno@nhost.io"
|
||||
email: 'nuno@nhost.io'
|
||||
credential:
|
||||
id: "zCnsWvxgtMrOCeX6eA_yqQ"
|
||||
rawId: "zCnsWvxgtMrOCeX6eA_yqQ"
|
||||
id: 'zCnsWvxgtMrOCeX6eA_yqQ'
|
||||
rawId: 'zCnsWvxgtMrOCeX6eA_yqQ'
|
||||
response:
|
||||
authenticatorData: "0RE6Bmg2J-FxNrC8136ZQSeTWKWtdni_Lpfv5XR4bDsdAAAAAA"
|
||||
clientDataJSON: "eyJ0eXBlIjoid2ViYXV0aG4uZ2V0IiwiY2hhbGxlbmdlIjoiTkNSSVRVU1pjeFE1ZTFhdUtUcXVlNnA4R0ZacHdxUS1kZzM4bnlWa3NCRSIsIm9yaWdpbiI6Imh0dHBzOi8vcmVhY3QtYXBvbGxvLmV4YW1wbGUubmhvc3QuaW8ifQ"
|
||||
signature: "MEUCIQDRXq3aY-gXWsuYJZhOzqqn6UpoRQfcPdNLP7hpZ7IdvQIgX5rY6TomkYUtqydu-w88fW7KeFm-0oE-5jTdLNHg9zw"
|
||||
userHandle: "8881037a-8495-48ef-8a04-ebbdb69415db"
|
||||
type: "public-key"
|
||||
authenticatorData: '0RE6Bmg2J-FxNrC8136ZQSeTWKWtdni_Lpfv5XR4bDsdAAAAAA'
|
||||
clientDataJSON: 'eyJ0eXBlIjoid2ViYXV0aG4uZ2V0IiwiY2hhbGxlbmdlIjoiTkNSSVRVU1pjeFE1ZTFhdUtUcXVlNnA4R0ZacHdxUS1kZzM4bnlWa3NCRSIsIm9yaWdpbiI6Imh0dHBzOi8vcmVhY3QtYXBvbGxvLmV4YW1wbGUubmhvc3QuaW8ifQ'
|
||||
signature: 'MEUCIQDRXq3aY-gXWsuYJZhOzqqn6UpoRQfcPdNLP7hpZ7IdvQIgX5rY6TomkYUtqydu-w88fW7KeFm-0oE-5jTdLNHg9zw'
|
||||
userHandle: '8881037a-8495-48ef-8a04-ebbdb69415db'
|
||||
type: 'public-key'
|
||||
clientExtensionResults: {}
|
||||
authenticatorAttachment: "platform"
|
||||
authenticatorAttachment: 'platform'
|
||||
required:
|
||||
- email
|
||||
- credential
|
||||
@@ -870,18 +868,18 @@ components:
|
||||
authenticatorAttachment:
|
||||
type: string
|
||||
example:
|
||||
email: "nuno@nhost.io"
|
||||
email: 'nuno@nhost.io'
|
||||
credential:
|
||||
id: "zCnsWvxgtMrOCeX6eA_yqQ"
|
||||
rawId: "zCnsWvxgtMrOCeX6eA_yqQ"
|
||||
id: 'zCnsWvxgtMrOCeX6eA_yqQ'
|
||||
rawId: 'zCnsWvxgtMrOCeX6eA_yqQ'
|
||||
response:
|
||||
authenticatorData: "0RE6Bmg2J-FxNrC8136ZQSeTWKWtdni_Lpfv5XR4bDsdAAAAAA"
|
||||
clientDataJSON: "eyJ0eXBlIjoid2ViYXV0aG4uZ2V0IiwiY2hhbGxlbmdlIjoiTkNSSVRVU1pjeFE1ZTFhdUtUcXVlNnA4R0ZacHdxUS1kZzM4bnlWa3NCRSIsIm9yaWdpbiI6Imh0dHBzOi8vcmVhY3QtYXBvbGxvLmV4YW1wbGUubmhvc3QuaW8ifQ"
|
||||
signature: "MEUCIQDRXq3aY-gXWsuYJZhOzqqn6UpoRQfcPdNLP7hpZ7IdvQIgX5rY6TomkYUtqydu-w88fW7KeFm-0oE-5jTdLNHg9zw"
|
||||
userHandle: "8881037a-8495-48ef-8a04-ebbdb69415db"
|
||||
type: "public-key"
|
||||
authenticatorData: '0RE6Bmg2J-FxNrC8136ZQSeTWKWtdni_Lpfv5XR4bDsdAAAAAA'
|
||||
clientDataJSON: 'eyJ0eXBlIjoid2ViYXV0aG4uZ2V0IiwiY2hhbGxlbmdlIjoiTkNSSVRVU1pjeFE1ZTFhdUtUcXVlNnA4R0ZacHdxUS1kZzM4bnlWa3NCRSIsIm9yaWdpbiI6Imh0dHBzOi8vcmVhY3QtYXBvbGxvLmV4YW1wbGUubmhvc3QuaW8ifQ'
|
||||
signature: 'MEUCIQDRXq3aY-gXWsuYJZhOzqqn6UpoRQfcPdNLP7hpZ7IdvQIgX5rY6TomkYUtqydu-w88fW7KeFm-0oE-5jTdLNHg9zw'
|
||||
userHandle: '8881037a-8495-48ef-8a04-ebbdb69415db'
|
||||
type: 'public-key'
|
||||
clientExtensionResults: {}
|
||||
authenticatorAttachment: "platform"
|
||||
authenticatorAttachment: 'platform'
|
||||
required:
|
||||
- email
|
||||
- credential
|
||||
@@ -1386,10 +1384,6 @@ components:
|
||||
- expiresAt
|
||||
|
||||
paths:
|
||||
|
||||
|
||||
|
||||
|
||||
/signin/anonymous:
|
||||
post:
|
||||
description: 'Sign In a user anonymously'
|
||||
@@ -1475,7 +1469,7 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
type: string
|
||||
example: "OK"
|
||||
example: 'OK'
|
||||
description: SMS sent successfully
|
||||
'400':
|
||||
content:
|
||||
@@ -1626,7 +1620,7 @@ paths:
|
||||
|
||||
/signin/webauthn:
|
||||
post:
|
||||
description: ""
|
||||
description: ''
|
||||
parameters: []
|
||||
requestBody:
|
||||
content:
|
||||
@@ -1822,7 +1816,7 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
type: string
|
||||
example: "OK"
|
||||
example: 'OK'
|
||||
description: Successfully signed out
|
||||
'400':
|
||||
content:
|
||||
|
||||
@@ -9,7 +9,7 @@ info:
|
||||
name: LICENSE-TBD
|
||||
url: https://LICENSE-TBD
|
||||
servers:
|
||||
- url: https://local.storage.nhost.run/v1
|
||||
- url: https://local.storage.local.nhost.run/v1
|
||||
description: API Server
|
||||
security:
|
||||
- AdminSecret: []
|
||||
@@ -184,8 +184,8 @@ paths:
|
||||
$ref: '#/components/schemas/Error'
|
||||
/files/{id}:
|
||||
head:
|
||||
summary: "Download File Metadata"
|
||||
description: "Retrieve metadata of a file"
|
||||
summary: 'Download File Metadata'
|
||||
description: 'Retrieve metadata of a file'
|
||||
tags:
|
||||
- storage
|
||||
security:
|
||||
@@ -321,7 +321,7 @@ paths:
|
||||
type: string
|
||||
get:
|
||||
summary: Download File
|
||||
description: "Download a file from storage"
|
||||
description: 'Download a file from storage'
|
||||
tags:
|
||||
- storage
|
||||
security:
|
||||
@@ -498,7 +498,7 @@ paths:
|
||||
$ref: '#/components/schemas/Error'
|
||||
delete:
|
||||
summary: Delete File
|
||||
description: "Delete file from storage"
|
||||
description: 'Delete file from storage'
|
||||
tags:
|
||||
- storage
|
||||
security:
|
||||
@@ -521,7 +521,7 @@ paths:
|
||||
|
||||
/files/{id}/presignedurl:
|
||||
get:
|
||||
summary: Presigned URL
|
||||
summary: Presigned URL
|
||||
description: |
|
||||
Retrieve presigned URL to retrieve the file. Expiration of the URL is
|
||||
determined by bucket configuration
|
||||
@@ -552,8 +552,8 @@ paths:
|
||||
|
||||
/files/{id}/presignedurl/contents:
|
||||
get:
|
||||
summary: "Get File Content"
|
||||
description: "Retrieve content of a file"
|
||||
summary: 'Get File Content'
|
||||
description: 'Retrieve content of a file'
|
||||
tags:
|
||||
- storage
|
||||
security:
|
||||
|
||||
@@ -2,12 +2,11 @@
|
||||
openapi: post /files/
|
||||
---
|
||||
|
||||
|
||||
<RequestExample>
|
||||
|
||||
```bash Request
|
||||
curl --request POST \
|
||||
--url https://local.storage.nhost.run/v1/files/ \
|
||||
--url https://local.storage.local.nhost.run/v1/files/ \
|
||||
--header 'Authorization: <authorization>' \
|
||||
--header 'Content-Type: multipart/form-data' \
|
||||
--form 'file[]=@path-to-file'
|
||||
@@ -16,7 +15,7 @@ curl --request POST \
|
||||
```python Python
|
||||
import requests
|
||||
|
||||
url = "https://local.storage.nhost.run/v1/files/"
|
||||
url = "https://local.storage.local.nhost.run/v1/files/"
|
||||
|
||||
files = {
|
||||
'file': ('<filename>', open('<path-to-file>', 'rb'))
|
||||
@@ -50,7 +49,7 @@ const options = {
|
||||
body: form
|
||||
};
|
||||
|
||||
fetch('https://local.storage.nhost.run/v1/files/', options)
|
||||
fetch('https://local.storage.local.nhost.run/v1/files/', options)
|
||||
.then(response => response.json())
|
||||
.then(response => console.log(response))
|
||||
.catch(err => console.error(err));
|
||||
@@ -60,7 +59,7 @@ fetch('https://local.storage.nhost.run/v1/files/', options)
|
||||
<?php
|
||||
$curl = curl_init();
|
||||
|
||||
$file_path = '<path_to_file>';
|
||||
$file_path = '<path_to_file>';
|
||||
|
||||
$postfields = [
|
||||
"bucket-id" => "<string>",
|
||||
@@ -73,7 +72,7 @@ $postfields = [
|
||||
];
|
||||
|
||||
curl_setopt_array($curl, [
|
||||
CURLOPT_URL => "https://local.storage.nhost.run/v1/files/",
|
||||
CURLOPT_URL => "https://local.storage.local.nhost.run/v1/files/",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => "",
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
@@ -112,7 +111,7 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
url := "https://local.storage.nhost.run/v1/files/"
|
||||
url := "https://local.storage.nhost.local.run/v1/files/"
|
||||
|
||||
var b bytes.Buffer
|
||||
w := multipart.NewWriter(&b)
|
||||
@@ -160,7 +159,7 @@ public class Main {
|
||||
try {
|
||||
File file = new File("<path_to_file>");
|
||||
|
||||
HttpResponse<String> response = Unirest.post("https://local.storage.nhost.run/v1/files/")
|
||||
HttpResponse<String> response = Unirest.post("https://local.storage.local.nhost.run/v1/files/")
|
||||
.header("Authorization", "<authorization>")
|
||||
// Removed Content-Type header, Unirest handles it
|
||||
.field("bucket-id", "<string>")
|
||||
@@ -175,6 +174,5 @@ public class Main {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</RequestExample>
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @nhost-examples/cli
|
||||
|
||||
## 0.3.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [6b8163d]
|
||||
- @nhost/nhost-js@3.2.5
|
||||
|
||||
## 0.3.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost-examples/cli",
|
||||
"version": "0.3.17",
|
||||
"version": "0.3.18",
|
||||
"main": "src/index.mjs",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @nhost-examples/codegen-react-apollo
|
||||
|
||||
## 0.5.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/react@3.10.1
|
||||
- @nhost/react-apollo@17.0.1
|
||||
|
||||
## 0.5.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost-examples/codegen-react-apollo",
|
||||
"version": "0.5.0",
|
||||
"version": "0.5.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"codegen": "graphql-codegen",
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @nhost-examples/codegen-react-query
|
||||
|
||||
## 0.5.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 6b8163d: fix(nhost-js) update service URL generation for local environments
|
||||
- @nhost/react@3.10.1
|
||||
|
||||
## 0.5.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost-examples/codegen-react-query",
|
||||
"version": "0.5.0",
|
||||
"version": "0.5.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"codegen": "graphql-codegen",
|
||||
|
||||
@@ -17,7 +17,7 @@ export function SignIn() {
|
||||
return
|
||||
}
|
||||
alert('Magic Link Sent')
|
||||
window.open('https://local.mailhog.nhost.run/', '_blank')
|
||||
window.open('https://local.mailhog.local.nhost.run/', '_blank')
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @nhost-examples/react-urql
|
||||
|
||||
## 0.4.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/react@3.10.1
|
||||
- @nhost/react-urql@14.0.1
|
||||
|
||||
## 0.4.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@nhost-examples/codegen-react-urql",
|
||||
"private": true,
|
||||
"version": "0.4.0",
|
||||
"version": "0.4.1",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @nhost-examples/multi-tenant-one-to-many
|
||||
|
||||
## 2.2.19
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [6b8163d]
|
||||
- @nhost/nhost-js@3.2.5
|
||||
|
||||
## 2.2.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@nhost-examples/multi-tenant-one-to-many",
|
||||
"private": true,
|
||||
"version": "2.2.18",
|
||||
"version": "2.2.19",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {},
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @nhost-examples/nextjs
|
||||
|
||||
## 0.4.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/react@3.10.1
|
||||
- @nhost/react-apollo@17.0.1
|
||||
- @nhost/nextjs@2.2.4
|
||||
|
||||
## 0.4.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost-examples/nextjs",
|
||||
"version": "0.4.3",
|
||||
"version": "0.4.4",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @nhost-examples/node-storage
|
||||
|
||||
## 0.2.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [6b8163d]
|
||||
- @nhost/nhost-js@3.2.5
|
||||
|
||||
## 0.2.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost-examples/node-storage",
|
||||
"version": "0.2.17",
|
||||
"version": "0.2.18",
|
||||
"private": true,
|
||||
"description": "This is an example of how to use the Storage with Node.js",
|
||||
"main": "src/index.mjs",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @nhost-examples/nextjs-server-components
|
||||
|
||||
## 0.5.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 6b8163d: fix(nhost-js) update service URL generation for local environments
|
||||
- Updated dependencies [6b8163d]
|
||||
- @nhost/nhost-js@3.2.5
|
||||
|
||||
## 0.5.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -55,16 +55,38 @@ This quickstart showcases how to correctly add authentication to a Next.js 13 pr
|
||||
|
||||
3. Terminal 1: Start the Nhost Backend
|
||||
|
||||
> Make sure you have the [Nhost CLI installed](https://docs.nhost.io/platform/cli).
|
||||
3.1 Make sure you have the [Nhost CLI installed](https://docs.nhost.io/development/cli/).
|
||||
|
||||
3.2 Go to examples/quickstarts/nhost-backend.
|
||||
|
||||
```sh
|
||||
cd examples/quickstarts/nhost-backend
|
||||
```
|
||||
|
||||
3.2 Create a .secrets file
|
||||
|
||||
```bash
|
||||
GRAFANA_ADMIN_PASSWORD = '<YOUR_GRAFANA_ADMIN_PASSWORD>'
|
||||
HASURA_GRAPHQL_ADMIN_SECRET = '<YOUR_HASURA_GRAPHQL_ADMIN_SECRET>'
|
||||
HASURA_GRAPHQL_JWT_SECRET = '<YOUR_HASURA_GRAPHQL_JWT_SECRET_HAS_TO_BE_AT_LEAST_32_CHAR>'
|
||||
NHOST_WEBHOOK_SECRET = '<YOUR_NHOST_WEBHOOK_SECRET>'
|
||||
```
|
||||
|
||||
3.3 Start the backend
|
||||
|
||||
```sh
|
||||
nhost up
|
||||
```
|
||||
|
||||
4. Terminal 2: Start the Next.js application
|
||||
4. **Terminal 2: Start the Next.js application**
|
||||
|
||||
```sh
|
||||
cd examples/quickstarts/nextjs-server-components
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
## How to setup authentication with Google
|
||||
|
||||
[Sign In with Google](https://docs.nhost.io/guides/auth/social/sign-in-google).
|
||||
|
||||
Under [Settings/Sign in methods](https://local.dashboard.local.nhost.run/orgs/local/projects/local/settings/sign-in-methods) add your Google client ID and secret. In this page you can find the redirect url needed by Google.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost-examples/nextjs-server-components",
|
||||
"version": "0.5.2",
|
||||
"version": "0.5.3",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
||||
@@ -7,10 +7,7 @@ export const signInWithApple = async () => {
|
||||
const nhost = await getNhost()
|
||||
|
||||
const { providerUrl } = await nhost.auth.signIn({
|
||||
provider: 'apple',
|
||||
options: {
|
||||
redirectTo: `/oauth`
|
||||
}
|
||||
provider: 'apple'
|
||||
})
|
||||
|
||||
if (providerUrl) {
|
||||
|
||||
@@ -7,10 +7,7 @@ export const signInWithGoogle = async () => {
|
||||
const nhost = await getNhost()
|
||||
|
||||
const { providerUrl } = await nhost.auth.signIn({
|
||||
provider: 'google',
|
||||
options: {
|
||||
redirectTo: `/oauth`
|
||||
}
|
||||
provider: 'google'
|
||||
})
|
||||
|
||||
if (providerUrl) {
|
||||
|
||||
@@ -1,78 +1,99 @@
|
||||
lockfileVersion: '6.0'
|
||||
lockfileVersion: '9.0'
|
||||
|
||||
devDependencies:
|
||||
'@types/express':
|
||||
specifier: ^4.17.13
|
||||
version: 4.17.13
|
||||
settings:
|
||||
autoInstallPeers: true
|
||||
excludeLinksFromLockfile: false
|
||||
|
||||
importers:
|
||||
|
||||
.:
|
||||
devDependencies:
|
||||
'@types/express':
|
||||
specifier: ^4.17.13
|
||||
version: 4.17.13
|
||||
|
||||
packages:
|
||||
|
||||
/@types/body-parser@1.19.3:
|
||||
'@types/body-parser@1.19.3':
|
||||
resolution: {integrity: sha512-oyl4jvAfTGX9Bt6Or4H9ni1Z447/tQuxnZsytsCaExKlmJiU8sFgnIBRzJUpKwB5eWn9HuBYlUlVA74q/yN0eQ==}
|
||||
|
||||
'@types/connect@3.4.36':
|
||||
resolution: {integrity: sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w==}
|
||||
|
||||
'@types/express-serve-static-core@4.17.36':
|
||||
resolution: {integrity: sha512-zbivROJ0ZqLAtMzgzIUC4oNqDG9iF0lSsAqpOD9kbs5xcIM3dTiyuHvBc7R8MtWBp3AAWGaovJa+wzWPjLYW7Q==}
|
||||
|
||||
'@types/express@4.17.13':
|
||||
resolution: {integrity: sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==}
|
||||
|
||||
'@types/http-errors@2.0.2':
|
||||
resolution: {integrity: sha512-lPG6KlZs88gef6aD85z3HNkztpj7w2R7HmR3gygjfXCQmsLloWNARFkMuzKiiY8FGdh1XDpgBdrSf4aKDiA7Kg==}
|
||||
|
||||
'@types/mime@1.3.2':
|
||||
resolution: {integrity: sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==}
|
||||
|
||||
'@types/mime@3.0.1':
|
||||
resolution: {integrity: sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==}
|
||||
|
||||
'@types/node@20.6.3':
|
||||
resolution: {integrity: sha512-HksnYH4Ljr4VQgEy2lTStbCKv/P590tmPe5HqOnv9Gprffgv5WXAY+Y5Gqniu0GGqeTCUdBnzC3QSrzPkBkAMA==}
|
||||
|
||||
'@types/qs@6.9.8':
|
||||
resolution: {integrity: sha512-u95svzDlTysU5xecFNTgfFG5RUWu1A9P0VzgpcIiGZA9iraHOdSzcxMxQ55DyeRaGCSxQi7LxXDI4rzq/MYfdg==}
|
||||
|
||||
'@types/range-parser@1.2.4':
|
||||
resolution: {integrity: sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==}
|
||||
|
||||
'@types/send@0.17.1':
|
||||
resolution: {integrity: sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==}
|
||||
|
||||
'@types/serve-static@1.15.2':
|
||||
resolution: {integrity: sha512-J2LqtvFYCzaj8pVYKw8klQXrLLk7TBZmQ4ShlcdkELFKGwGMfevMLneMMRkMgZxotOD9wg497LpC7O8PcvAmfw==}
|
||||
|
||||
snapshots:
|
||||
|
||||
'@types/body-parser@1.19.3':
|
||||
dependencies:
|
||||
'@types/connect': 3.4.36
|
||||
'@types/node': 20.6.3
|
||||
dev: true
|
||||
|
||||
/@types/connect@3.4.36:
|
||||
resolution: {integrity: sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w==}
|
||||
'@types/connect@3.4.36':
|
||||
dependencies:
|
||||
'@types/node': 20.6.3
|
||||
dev: true
|
||||
|
||||
/@types/express-serve-static-core@4.17.36:
|
||||
resolution: {integrity: sha512-zbivROJ0ZqLAtMzgzIUC4oNqDG9iF0lSsAqpOD9kbs5xcIM3dTiyuHvBc7R8MtWBp3AAWGaovJa+wzWPjLYW7Q==}
|
||||
'@types/express-serve-static-core@4.17.36':
|
||||
dependencies:
|
||||
'@types/node': 20.6.3
|
||||
'@types/qs': 6.9.8
|
||||
'@types/range-parser': 1.2.4
|
||||
'@types/send': 0.17.1
|
||||
dev: true
|
||||
|
||||
/@types/express@4.17.13:
|
||||
resolution: {integrity: sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==}
|
||||
'@types/express@4.17.13':
|
||||
dependencies:
|
||||
'@types/body-parser': 1.19.3
|
||||
'@types/express-serve-static-core': 4.17.36
|
||||
'@types/qs': 6.9.8
|
||||
'@types/serve-static': 1.15.2
|
||||
dev: true
|
||||
|
||||
/@types/http-errors@2.0.2:
|
||||
resolution: {integrity: sha512-lPG6KlZs88gef6aD85z3HNkztpj7w2R7HmR3gygjfXCQmsLloWNARFkMuzKiiY8FGdh1XDpgBdrSf4aKDiA7Kg==}
|
||||
dev: true
|
||||
'@types/http-errors@2.0.2': {}
|
||||
|
||||
/@types/mime@1.3.2:
|
||||
resolution: {integrity: sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==}
|
||||
dev: true
|
||||
'@types/mime@1.3.2': {}
|
||||
|
||||
/@types/mime@3.0.1:
|
||||
resolution: {integrity: sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==}
|
||||
dev: true
|
||||
'@types/mime@3.0.1': {}
|
||||
|
||||
/@types/node@20.6.3:
|
||||
resolution: {integrity: sha512-HksnYH4Ljr4VQgEy2lTStbCKv/P590tmPe5HqOnv9Gprffgv5WXAY+Y5Gqniu0GGqeTCUdBnzC3QSrzPkBkAMA==}
|
||||
dev: true
|
||||
'@types/node@20.6.3': {}
|
||||
|
||||
/@types/qs@6.9.8:
|
||||
resolution: {integrity: sha512-u95svzDlTysU5xecFNTgfFG5RUWu1A9P0VzgpcIiGZA9iraHOdSzcxMxQ55DyeRaGCSxQi7LxXDI4rzq/MYfdg==}
|
||||
dev: true
|
||||
'@types/qs@6.9.8': {}
|
||||
|
||||
/@types/range-parser@1.2.4:
|
||||
resolution: {integrity: sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==}
|
||||
dev: true
|
||||
'@types/range-parser@1.2.4': {}
|
||||
|
||||
/@types/send@0.17.1:
|
||||
resolution: {integrity: sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==}
|
||||
'@types/send@0.17.1':
|
||||
dependencies:
|
||||
'@types/mime': 1.3.2
|
||||
'@types/node': 20.6.3
|
||||
dev: true
|
||||
|
||||
/@types/serve-static@1.15.2:
|
||||
resolution: {integrity: sha512-J2LqtvFYCzaj8pVYKw8klQXrLLk7TBZmQ4ShlcdkELFKGwGMfevMLneMMRkMgZxotOD9wg497LpC7O8PcvAmfw==}
|
||||
'@types/serve-static@1.15.2':
|
||||
dependencies:
|
||||
'@types/http-errors': 2.0.2
|
||||
'@types/mime': 3.0.1
|
||||
'@types/node': 20.6.3
|
||||
dev: true
|
||||
|
||||
@@ -101,9 +101,7 @@ enabled = false
|
||||
enabled = false
|
||||
|
||||
[auth.method.oauth.google]
|
||||
enabled = true
|
||||
clientId = '{{ secrets.GOOGLE_CLIENT_ID }}'
|
||||
clientSecret = '{{ secrets.GOOGLE_CLIENT_SECRET }}'
|
||||
enabled = false
|
||||
|
||||
[auth.method.oauth.linkedin]
|
||||
enabled = false
|
||||
@@ -130,8 +128,8 @@ enabled = false
|
||||
enabled = true
|
||||
|
||||
[auth.method.webauthn.relyingParty]
|
||||
name = 'quickstarts'
|
||||
id = 'examples.nhost.io'
|
||||
name = 'quickstarts'
|
||||
origins = ['https://sveltekit.examples.nhost.io', 'https://nextjs-server-components.examples.nhost.io']
|
||||
|
||||
[auth.method.webauthn.attestation]
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @nhost-examples/react-apollo
|
||||
|
||||
## 1.3.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/react@3.10.1
|
||||
- @nhost/react-apollo@17.0.1
|
||||
|
||||
## 1.3.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export const baseURL = 'http://localhost:3000'
|
||||
export const mailhogURL = 'https://local.mailhog.nhost.run'
|
||||
export const authBackendURL = 'https://local.auth.nhost.run'
|
||||
export const mailhogURL = 'https://local.mailhog.local.nhost.run'
|
||||
export const authBackendURL = 'https://local.auth.local.nhost.run'
|
||||
|
||||
@@ -178,6 +178,9 @@ issuer = 'nhost'
|
||||
[postgres]
|
||||
version = '16.2-20240718-1'
|
||||
|
||||
[postgres.resources.storage]
|
||||
capacity = 1
|
||||
|
||||
[provider]
|
||||
[provider.smtp]
|
||||
host = "smtp.test.com"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost-examples/react-apollo",
|
||||
"version": "1.3.0",
|
||||
"version": "1.3.1",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @nhost-examples/react-gqty
|
||||
|
||||
## 1.3.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/react@3.10.1
|
||||
|
||||
## 1.3.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@nhost-examples/react-gqty",
|
||||
"private": true,
|
||||
"version": "1.3.0",
|
||||
"version": "1.3.1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @nhost-examples/react-native
|
||||
|
||||
## 0.1.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/react@3.10.1
|
||||
- @nhost/react-apollo@17.0.1
|
||||
|
||||
## 0.1.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost-examples/react-native",
|
||||
"version": "0.1.4",
|
||||
"version": "0.1.5",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"android": "react-native run-android",
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @nhost-examples/seed-data-storage
|
||||
|
||||
## 0.0.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 6b8163d: fix(nhost-js) update service URL generation for local environments
|
||||
|
||||
## 0.0.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -22,8 +22,8 @@ The database and storage have now been seeded successfully.
|
||||
|
||||
You can now try to fetch the seeded files:
|
||||
|
||||
- [https://local.storage.nhost.run/v1/files/3d62252d-8db2-4b2b-ba63-f2ef64af4267](https://local.storage.nhost.run/v1/files/3d62252d-8db2-4b2b-ba63-f2ef64af4267)
|
||||
- [https://local.storage.nhost.run/v1/files/039f89ef-f151-418f-b2db-83c94fbf0fa5](https://local.storage.nhost.run/v1/files/039f89ef-f151-418f-b2db-83c94fbf0fa5)
|
||||
- [https://local.storage.local.nhost.run/v1/files/3d62252d-8db2-4b2b-ba63-f2ef64af4267](https://local.storage.local.nhost.run/v1/files/3d62252d-8db2-4b2b-ba63-f2ef64af4267)
|
||||
- [https://local.storage.local.nhost.run/v1/files/039f89ef-f151-418f-b2db-83c94fbf0fa5](https://local.storage.local.nhost.run/v1/files/039f89ef-f151-418f-b2db-83c94fbf0fa5)
|
||||
|
||||
And make a GraphQL request:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@nhost-examples/seed-data-storage",
|
||||
"private": true,
|
||||
"version": "0.0.4",
|
||||
"version": "0.0.5",
|
||||
"scripts": {
|
||||
"seed-storage": "./seed-storage.sh"
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ jq -c '.[]' input.json | while read i; do
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-H "x-hasura-admin-secret: nhost-admin-secret" \
|
||||
-F "file=@$path" \
|
||||
https://local.storage.nhost.run/v1/files/$id
|
||||
https://local.storage.local.nhost.run/v1/files/$id
|
||||
done
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# @nhost-examples/vue-apollo
|
||||
|
||||
## 0.9.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [6b8163d]
|
||||
- @nhost/nhost-js@3.2.5
|
||||
- @nhost/apollo@8.0.5
|
||||
- @nhost/vue@2.9.2
|
||||
|
||||
## 0.9.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@nhost-examples/vue-apollo",
|
||||
"private": true,
|
||||
"version": "0.9.0",
|
||||
"version": "0.9.1",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @nhost-examples/vue-quickstart
|
||||
|
||||
## 0.3.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/apollo@8.0.5
|
||||
- @nhost/vue@2.9.2
|
||||
|
||||
## 0.3.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost-examples/vue-quickstart",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "vite build",
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
pname = "node_modules";
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
pnpm_9
|
||||
pnpm_10
|
||||
cacert
|
||||
nodejs
|
||||
];
|
||||
@@ -131,7 +131,7 @@
|
||||
buildInputs = with pkgs; [
|
||||
nhost-cli
|
||||
nodejs
|
||||
pnpm_9
|
||||
pnpm_10
|
||||
go
|
||||
golangci-lint
|
||||
] ++ buildInputs ++ nativeBuildInputs;
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @nhost/apollo
|
||||
|
||||
## 8.0.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [6b8163d]
|
||||
- @nhost/nhost-js@3.2.5
|
||||
|
||||
## 8.0.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/apollo",
|
||||
"version": "8.0.4",
|
||||
"version": "8.0.5",
|
||||
"description": "Nhost Apollo Client library",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @nhost/google-translation
|
||||
|
||||
## 0.2.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 6b8163d: fix(nhost-js) update service URL generation for local environments
|
||||
|
||||
## 0.2.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -110,7 +110,7 @@ Learn more about the [Nhost CLI](https://docs.nhost.io/platform/cli).
|
||||
|
||||
Test the Google Translation GraphQL API in the browser:
|
||||
|
||||
[https://local.functions.nhost.run/v1/graphql/google-translation](https://local.functions.nhost.run/v1/graphql/google-translation)
|
||||
[https://local.functions.nhost.local.run/v1/graphql/google-translation](https://local.functions.local.nhost.run/v1/graphql/google-translation)
|
||||
|
||||
### Remote Schema
|
||||
|
||||
@@ -119,7 +119,7 @@ Add the Google Translation GraphQL API as a Remote Schema in Hasura.
|
||||
**URL**
|
||||
|
||||
```
|
||||
https://local.functions.nhost.run/v1/graphql/google-translation
|
||||
https://local.functions.local.nhost.run/v1/graphql/google-translation
|
||||
```
|
||||
|
||||
**Headers**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/google-translation",
|
||||
"version": "0.2.1",
|
||||
"version": "0.2.2",
|
||||
"description": "Google Translation GraphQL API",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @nhost/react-apollo
|
||||
|
||||
## 17.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/apollo@8.0.5
|
||||
- @nhost/react@3.10.1
|
||||
|
||||
## 17.0.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/react-apollo",
|
||||
"version": "17.0.0",
|
||||
"version": "17.0.1",
|
||||
"description": "Nhost React Apollo client",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @nhost/react-urql
|
||||
|
||||
## 14.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/react@3.10.1
|
||||
|
||||
## 14.0.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/react-urql",
|
||||
"version": "14.0.0",
|
||||
"version": "14.0.1",
|
||||
"description": "Nhost React URQL client",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -103,6 +103,12 @@
|
||||
"pnpm": {
|
||||
"overrides": {
|
||||
"jsonwebtoken@<=8.5.1": ">=9.0.0",
|
||||
"@octokit/request@>=1.0.0 <9.2.1": ">=9.2.1",
|
||||
"@octokit/request-error@>=1.0.0 <5.1.1": ">=5.1.1",
|
||||
"@octokit/request-error@>=6.0.0 <6.1.7": ">=6.1.7",
|
||||
"@octokit/plugin-paginate-rest@>=1.0.0 <11.4.1": ">=11.4.1",
|
||||
"serialize-javascript@<6.0.2": ">=6.0.2",
|
||||
"esbuild@<=0.24.2": ">=0.25.0",
|
||||
"trim@<0.0.3": ">=0.0.3",
|
||||
"ua-parser-js@<0.7.33": ">=0.7.33",
|
||||
"jsonwebtoken@<9.0.0": ">=9.0.0",
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @nhost/hasura-auth-js
|
||||
|
||||
## 2.10.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 6b8163d: fix(nhost-js) update service URL generation for local environments
|
||||
|
||||
## 2.10.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -6,7 +6,7 @@ import { HasuraAuthClient, SignUpParams } from '../src'
|
||||
|
||||
const { fetch } = fetchPonyfill()
|
||||
|
||||
const AUTH_BACKEND_URL = 'https://local.auth.nhost.run/v1'
|
||||
const AUTH_BACKEND_URL = 'https://local.auth.local.nhost.run/v1'
|
||||
|
||||
const auth = new HasuraAuthClient({
|
||||
url: AUTH_BACKEND_URL
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/hasura-auth-js",
|
||||
"version": "2.10.0",
|
||||
"version": "2.10.1",
|
||||
"description": "Hasura-auth client",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* Base authentication API for the Nhost client.
|
||||
*/
|
||||
export const BASE_URL = 'https://local.auth.nhost.run/v1'
|
||||
export const BASE_URL = 'https://local.auth.local.nhost.run/v1'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { HasuraStorageClient } from '../../src'
|
||||
|
||||
const STORAGE_BACKEND_URL = 'https://local.storage.nhost.run/v1'
|
||||
const STORAGE_BACKEND_URL = 'https://local.storage.local.nhost.run/v1'
|
||||
|
||||
const storage = new HasuraStorageClient({
|
||||
url: STORAGE_BACKEND_URL
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @nhost/nextjs
|
||||
|
||||
## 2.2.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @nhost/react@3.10.1
|
||||
|
||||
## 2.2.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/nextjs",
|
||||
"version": "2.2.3",
|
||||
"version": "2.2.4",
|
||||
"description": "Nhost NextJS library",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @nhost/nhost-js
|
||||
|
||||
## 3.2.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 6b8163d: fix(nhost-js) update service URL generation for local environments
|
||||
- Updated dependencies [6b8163d]
|
||||
- @nhost/hasura-auth-js@2.10.1
|
||||
|
||||
## 3.2.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/nhost-js",
|
||||
"version": "3.2.4",
|
||||
"version": "3.2.5",
|
||||
"description": "Nhost JavaScript SDK",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -40,8 +40,8 @@ export function urlFromSubdomain(
|
||||
}
|
||||
|
||||
return port
|
||||
? `${protocol || 'https'}://local.${service}.nhost.run:${port}/v1`
|
||||
: `${protocol || 'https'}://local.${service}.nhost.run/v1`
|
||||
? `${protocol || 'https'}://local.${service}.local.nhost.run:${port}/v1`
|
||||
: `${protocol || 'https'}://local.${service}.local.nhost.run/v1`
|
||||
}
|
||||
|
||||
if (!region) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user