Compare commits

...

8 Commits

Author SHA1 Message Date
github-actions[bot]
4ad27e9d72 chore: update versions (#2599)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @nhost/apollo@6.1.1

### Patch Changes

-   @nhost/nhost-js@3.0.9

## @nhost/react-apollo@10.0.1

### Patch Changes

-   @nhost/apollo@6.1.1
-   @nhost/react@3.3.1

## @nhost/react-urql@7.0.1

### Patch Changes

-   @nhost/react@3.3.1

## @nhost/stripe-graphql-js@1.1.1

### Patch Changes

-   7789469: chore: address linter errors and remove unnecessary imports

## @nhost/graphql-js@0.1.9

### Patch Changes

- 7789469: fix: resolve process is undefined error when running with
vitejs

## @nhost/nextjs@2.1.7

### Patch Changes

-   @nhost/react@3.3.1

## @nhost/nhost-js@3.0.9

### Patch Changes

-   Updated dependencies [7789469]
    -   @nhost/graphql-js@0.1.9

## @nhost/react@3.3.1

### Patch Changes

-   @nhost/nhost-js@3.0.9

## @nhost/vue@2.3.1

### Patch Changes

-   @nhost/nhost-js@3.0.9

## @nhost/dashboard@1.11.0

### Minor Changes

- 7789469: chore: upgrade dependency `@graphql-codegen/cli` to `5.0.2`
to address vulnerability
- 6c11b75: feat: add update user displayName section in account settings

### Patch Changes

-   @nhost/react-apollo@10.0.1
-   @nhost/nextjs@2.1.7

## @nhost-examples/codegen-react-apollo@0.3.0

### Minor Changes

- 7789469: chore: upgrade dependency `@graphql-codegen/cli` to `5.0.2`
to address vulnerability

### Patch Changes

-   @nhost/react@3.3.1
-   @nhost/react-apollo@10.0.1

## @nhost-examples/codegen-react-query@0.3.0

### Minor Changes

- 7789469: chore: upgrade dependency `@graphql-codegen/cli` to `5.0.2`
to address vulnerability

### Patch Changes

-   @nhost/react@3.3.1

## @nhost-examples/codegen-react-urql@0.2.0

### Minor Changes

- 7789469: chore: upgrade dependency `@graphql-codegen/cli` to `5.0.2`
to address vulnerability

### Patch Changes

-   @nhost/react@3.3.1
-   @nhost/react-urql@7.0.1

## @nhost-examples/react-apollo@0.6.0

### Minor Changes

- 7789469: chore: upgrade dependency `@graphql-codegen/cli` to `5.0.2`
to address vulnerability

### Patch Changes

-   @nhost/react@3.3.1
-   @nhost/react-apollo@10.0.1

## @nhost-examples/cli@0.2.1

### Patch Changes

-   @nhost/nhost-js@3.0.9

## @nhost-examples/multi-tenant-one-to-many@2.1.1

### Patch Changes

-   @nhost/nhost-js@3.0.9

## @nhost-examples/nextjs@0.2.1

### Patch Changes

-   @nhost/react@3.3.1
-   @nhost/react-apollo@10.0.1
-   @nhost/nextjs@2.1.7

## @nhost-examples/node-storage@0.1.1

### Patch Changes

-   @nhost/nhost-js@3.0.9

## @nhost-examples/nextjs-server-components@0.3.1

### Patch Changes

-   @nhost/nhost-js@3.0.9

## @nhost-examples/react-gqty@1.1.1

### Patch Changes

-   @nhost/react@3.3.1

## @nhost-examples/serverless-functions@0.1.1

### Patch Changes

-   Updated dependencies [7789469]
    -   @nhost/stripe-graphql-js@1.1.1

## @nhost-examples/vue-apollo@0.4.1

### Patch Changes

-   7789469: chore: address linter errors and remove unnecessary imports
    -   @nhost/nhost-js@3.0.9
    -   @nhost/apollo@6.1.1
    -   @nhost/vue@2.3.1

## @nhost-examples/vue-quickstart@0.1.1

### Patch Changes

-   @nhost/apollo@6.1.1
-   @nhost/vue@2.3.1

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-08 15:51:16 +01:00
Hassan Ben Jobrane
778946998a fix: graphql-js: resolve process is undefined error when running with vitejs (#2601)
fixes https://github.com/nhost/nhost/issues/2600
2024-03-08 15:23:13 +01:00
Hassan Ben Jobrane
6c11b75807 feat: dashboard: add update user displayName section in account settings (#2598)
fixes https://github.com/nhost/nhost/issues/1489
2024-03-07 17:23:35 +01:00
github-actions[bot]
2dc031d16c chore: update versions (#2592)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @nhost-examples/react-apollo@0.5.0

### Minor Changes

- 08a7dd9: feat: add example workaround to the reset password ticket
expired issue

### Patch Changes

- f0a994a: fix: update allowedUrls and redirectTo to point to the
profile page

## @nhost-examples/vue-apollo@0.4.0

### Minor Changes

- 08a7dd9: feat: add example workaround to the reset password ticket
expired issue

### Patch Changes

- f0a994a: fix: update allowedUrls and redirectTo to point to the
profile page

## @nhost/docs@2.7.1

### Patch Changes

-   6cb2b63: feat: added nhost run env documentation
-   40bd3e4: fix: fixed wrong links in documentation

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-06 16:56:26 +01:00
Nicolas Bourdin
40bd3e4572 doc(link): fix wrong links in documentation (#2596)
Co-authored-by: Nicolas Bourdin <nicolas@epeak.co>
Co-authored-by: David Barroso <dbarrosop@dravetech.com>
2024-03-06 14:50:32 +01:00
David Barroso
6cb2b6331a feat (docs): added nhost run env documentation (#2594) 2024-03-06 14:13:02 +01:00
Hassan Ben Jobrane
08a7dd9894 feat(examples): add reset password ticket expired workarounds in the examples (#2590)
fixes https://github.com/nhost/nhost/issues/2314
2024-03-05 15:48:46 +01:00
Hassan Ben Jobrane
f0a994a26e fix(examples): update allowedUrls and redirectTo to point to /profile (#2591) 2024-03-05 14:17:01 +01:00
77 changed files with 1203 additions and 641 deletions

View File

@@ -1,5 +1,17 @@
# @nhost/dashboard
## 1.11.0
### Minor Changes
- 7789469: chore: upgrade dependency `@graphql-codegen/cli` to `5.0.2` to address vulnerability
- 6c11b75: feat: add update user displayName section in account settings
### Patch Changes
- @nhost/react-apollo@10.0.1
- @nhost/nextjs@2.1.7
## 1.10.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/dashboard",
"version": "1.10.0",
"version": "1.11.0",
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",
@@ -93,7 +93,7 @@
"devDependencies": {
"@babel/core": "^7.24.0",
"@faker-js/faker": "^7.6.0",
"@graphql-codegen/cli": "^3.3.1",
"@graphql-codegen/cli": "^5.0.2",
"@graphql-codegen/typescript": "^3.0.4",
"@graphql-codegen/typescript-operations": "^3.0.4",
"@graphql-codegen/typescript-react-apollo": "^3.3.7",

View File

@@ -0,0 +1,85 @@
import { Form } from '@/components/form/Form';
import { SettingsContainer } from '@/components/layout/SettingsContainer';
import { Input } from '@/components/ui/v2/Input';
import { execPromiseWithErrorToast } from '@/utils/execPromiseWithErrorToast';
import { useUpdateUserDisplayNameMutation } from '@/utils/__generated__/graphql';
import { yupResolver } from '@hookform/resolvers/yup';
import { useUserData } from '@nhost/nextjs';
import { FormProvider, useForm } from 'react-hook-form';
import * as Yup from 'yup';
const validationSchema = Yup.object({
displayName: Yup.string()
.label('Display Name')
.required('This field is required.'),
});
export type DisplayNameSettingFormValues = Yup.InferType<
typeof validationSchema
>;
export default function DisplayNameSetting() {
const { id: userID, displayName } = useUserData();
const [updateUserDisplayName] = useUpdateUserDisplayNameMutation();
const form = useForm<DisplayNameSettingFormValues>({
reValidateMode: 'onSubmit',
defaultValues: {
displayName,
},
resolver: yupResolver(validationSchema),
});
const { register, formState } = form;
const isDirty = Object.keys(formState.dirtyFields).length > 0;
async function handleSubmit(formValues: DisplayNameSettingFormValues) {
await execPromiseWithErrorToast(
async () => {
await updateUserDisplayName({
variables: {
id: userID,
displayName: formValues.displayName,
},
});
form.reset({ displayName: formValues.displayName });
},
{
loadingMessage: 'Updating your display name...',
successMessage: 'Your display name has been updated successfully.',
errorMessage:
'An error occurred while trying to update your display name. Please try again.',
},
);
}
return (
<FormProvider {...form}>
<Form onSubmit={handleSubmit}>
<SettingsContainer
title="Update your display name"
slotProps={{
submitButton: {
disabled: !isDirty,
loading: formState.isSubmitting,
},
}}
className="grid grid-flow-row lg:grid-cols-5"
>
<Input
{...register('displayName')}
className="col-span-2"
type="text"
id="display-name"
label="Display Name"
fullWidth
helperText={formState.errors.displayName?.message}
error={Boolean(formState.errors.displayName)}
/>
</SettingsContainer>
</Form>
</FormProvider>
);
}

View File

@@ -0,0 +1,2 @@
export * from './DisplayNameSetting';
export { default as DisplayNameSetting } from './DisplayNameSetting';

View File

@@ -0,0 +1,6 @@
mutation updateUserDisplayName($id: uuid!, $displayName: String!) {
updateUser(pk_columns: { id: $id }, _set: { displayName: $displayName }) {
id
displayName
}
}

View File

@@ -1,4 +1,4 @@
fragment EnvironmentVariable on ConfigEnvironmentVariable {
fragment EnvironmentVariable on ConfigGlobalEnvironmentVariable {
id: name
name
value

View File

@@ -2,6 +2,7 @@ import { Container } from '@/components/layout/Container';
import { RetryableErrorBoundary } from '@/components/presentational/RetryableErrorBoundary';
import { AccountSettingsLayout } from '@/features/account/settings/components/AccountSettingsLayout';
import { DeleteAccount } from '@/features/account/settings/components/DeleteAccount';
import { DisplayNameSetting } from '@/features/account/settings/components/DisplayNameSetting';
import { PasswordSettings } from '@/features/account/settings/components/PasswordSettings';
import { PATSettings } from '@/features/account/settings/components/PATSettings';
import type { ReactElement } from 'react';
@@ -12,6 +13,10 @@ export default function AccountSettingsPage() {
className="grid max-w-5xl grid-flow-row gap-8 bg-transparent"
rootClassName="bg-transparent"
>
<RetryableErrorBoundary>
<DisplayNameSetting />
</RetryableErrorBoundary>
<RetryableErrorBoundary>
<PasswordSettings />
</RetryableErrorBoundary>

View File

@@ -1272,22 +1272,47 @@ export type ConfigFunctionsUpdateInput = {
export type ConfigGlobal = {
__typename?: 'ConfigGlobal';
/** User-defined environment variables that are spread over all services */
environment?: Maybe<Array<ConfigEnvironmentVariable>>;
environment?: Maybe<Array<ConfigGlobalEnvironmentVariable>>;
};
export type ConfigGlobalComparisonExp = {
_and?: InputMaybe<Array<ConfigGlobalComparisonExp>>;
_not?: InputMaybe<ConfigGlobalComparisonExp>;
_or?: InputMaybe<Array<ConfigGlobalComparisonExp>>;
environment?: InputMaybe<ConfigEnvironmentVariableComparisonExp>;
environment?: InputMaybe<ConfigGlobalEnvironmentVariableComparisonExp>;
};
export type ConfigGlobalEnvironmentVariable = {
__typename?: 'ConfigGlobalEnvironmentVariable';
name: Scalars['String'];
/** Value of the environment variable */
value: Scalars['String'];
};
export type ConfigGlobalEnvironmentVariableComparisonExp = {
_and?: InputMaybe<Array<ConfigGlobalEnvironmentVariableComparisonExp>>;
_not?: InputMaybe<ConfigGlobalEnvironmentVariableComparisonExp>;
_or?: InputMaybe<Array<ConfigGlobalEnvironmentVariableComparisonExp>>;
name?: InputMaybe<ConfigStringComparisonExp>;
value?: InputMaybe<ConfigStringComparisonExp>;
};
export type ConfigGlobalEnvironmentVariableInsertInput = {
name: Scalars['String'];
value: Scalars['String'];
};
export type ConfigGlobalEnvironmentVariableUpdateInput = {
name?: InputMaybe<Scalars['String']>;
value?: InputMaybe<Scalars['String']>;
};
export type ConfigGlobalInsertInput = {
environment?: InputMaybe<Array<ConfigEnvironmentVariableInsertInput>>;
environment?: InputMaybe<Array<ConfigGlobalEnvironmentVariableInsertInput>>;
};
export type ConfigGlobalUpdateInput = {
environment?: InputMaybe<Array<ConfigEnvironmentVariableUpdateInput>>;
environment?: InputMaybe<Array<ConfigGlobalEnvironmentVariableUpdateInput>>;
};
export type ConfigGrafana = {
@@ -22451,6 +22476,14 @@ export type DeletePersonalAccessTokenMutationVariables = Exact<{
export type DeletePersonalAccessTokenMutation = { __typename?: 'mutation_root', deletePersonalAccessToken?: { __typename?: 'authRefreshTokens', id: any, metadata?: any | null } | null };
export type UpdateUserDisplayNameMutationVariables = Exact<{
id: Scalars['uuid'];
displayName: Scalars['String'];
}>;
export type UpdateUserDisplayNameMutation = { __typename?: 'mutation_root', updateUser?: { __typename?: 'users', id: any, displayName: string } | null };
export type GetAiSettingsQueryVariables = Exact<{
appId: Scalars['uuid'];
}>;
@@ -22629,7 +22662,7 @@ export type DnsLookupCnameQueryVariables = Exact<{
export type DnsLookupCnameQuery = { __typename?: 'query_root', dnsLookupCNAME: string };
export type EnvironmentVariableFragment = { __typename?: 'ConfigEnvironmentVariable', name: string, value: string, id: string };
export type EnvironmentVariableFragment = { __typename?: 'ConfigGlobalEnvironmentVariable', name: string, value: string, id: string };
export type JwtSecretFragment = { __typename?: 'ConfigJWTSecret', issuer?: string | null, key?: string | null, type?: string | null, jwk_url?: any | null, header?: string | null, claims_namespace_path?: string | null, claims_namespace?: string | null, claims_format?: string | null, audience?: string | null, allowed_skew?: any | null };
@@ -22638,7 +22671,7 @@ export type GetEnvironmentVariablesQueryVariables = Exact<{
}>;
export type GetEnvironmentVariablesQuery = { __typename?: 'query_root', config?: { __typename: 'ConfigConfig', id: 'ConfigConfig', global?: { __typename?: 'ConfigGlobal', environment?: Array<{ __typename?: 'ConfigEnvironmentVariable', name: string, value: string, id: string }> | null } | null, hasura: { __typename?: 'ConfigHasura', adminSecret: string, webhookSecret: string, jwtSecrets?: Array<{ __typename?: 'ConfigJWTSecret', issuer?: string | null, key?: string | null, type?: string | null, jwk_url?: any | null, header?: string | null, claims_namespace_path?: string | null, claims_namespace?: string | null, claims_format?: string | null, audience?: string | null, allowed_skew?: any | null }> | null } } | null };
export type GetEnvironmentVariablesQuery = { __typename?: 'query_root', config?: { __typename: 'ConfigConfig', id: 'ConfigConfig', global?: { __typename?: 'ConfigGlobal', environment?: Array<{ __typename?: 'ConfigGlobalEnvironmentVariable', name: string, value: string, id: string }> | null } | null, hasura: { __typename?: 'ConfigHasura', adminSecret: string, webhookSecret: string, jwtSecrets?: Array<{ __typename?: 'ConfigJWTSecret', issuer?: string | null, key?: string | null, type?: string | null, jwk_url?: any | null, header?: string | null, claims_namespace_path?: string | null, claims_namespace?: string | null, claims_format?: string | null, audience?: string | null, allowed_skew?: any | null }> | null } } | null };
export type PermissionVariableFragment = { __typename?: 'ConfigAuthsessionaccessTokenCustomClaims', key: string, value: string, id: string };
@@ -23227,7 +23260,7 @@ export const PrefetchNewAppWorkspaceFragmentDoc = gql`
}
`;
export const EnvironmentVariableFragmentDoc = gql`
fragment EnvironmentVariable on ConfigEnvironmentVariable {
fragment EnvironmentVariable on ConfigGlobalEnvironmentVariable {
id: name
name
value
@@ -23561,6 +23594,41 @@ export function useDeletePersonalAccessTokenMutation(baseOptions?: Apollo.Mutati
export type DeletePersonalAccessTokenMutationHookResult = ReturnType<typeof useDeletePersonalAccessTokenMutation>;
export type DeletePersonalAccessTokenMutationResult = Apollo.MutationResult<DeletePersonalAccessTokenMutation>;
export type DeletePersonalAccessTokenMutationOptions = Apollo.BaseMutationOptions<DeletePersonalAccessTokenMutation, DeletePersonalAccessTokenMutationVariables>;
export const UpdateUserDisplayNameDocument = gql`
mutation updateUserDisplayName($id: uuid!, $displayName: String!) {
updateUser(pk_columns: {id: $id}, _set: {displayName: $displayName}) {
id
displayName
}
}
`;
export type UpdateUserDisplayNameMutationFn = Apollo.MutationFunction<UpdateUserDisplayNameMutation, UpdateUserDisplayNameMutationVariables>;
/**
* __useUpdateUserDisplayNameMutation__
*
* To run a mutation, you first call `useUpdateUserDisplayNameMutation` within a React component and pass it any options that fit your needs.
* When your component renders, `useUpdateUserDisplayNameMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation
* - An object with fields that represent the current status of the mutation's execution
*
* @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
*
* @example
* const [updateUserDisplayNameMutation, { data, loading, error }] = useUpdateUserDisplayNameMutation({
* variables: {
* id: // value for 'id'
* displayName: // value for 'displayName'
* },
* });
*/
export function useUpdateUserDisplayNameMutation(baseOptions?: Apollo.MutationHookOptions<UpdateUserDisplayNameMutation, UpdateUserDisplayNameMutationVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<UpdateUserDisplayNameMutation, UpdateUserDisplayNameMutationVariables>(UpdateUserDisplayNameDocument, options);
}
export type UpdateUserDisplayNameMutationHookResult = ReturnType<typeof useUpdateUserDisplayNameMutation>;
export type UpdateUserDisplayNameMutationResult = Apollo.MutationResult<UpdateUserDisplayNameMutation>;
export type UpdateUserDisplayNameMutationOptions = Apollo.BaseMutationOptions<UpdateUserDisplayNameMutation, UpdateUserDisplayNameMutationVariables>;
export const GetAiSettingsDocument = gql`
query GetAISettings($appId: uuid!) {
config(appID: $appId, resolve: false) {

View File

@@ -1,5 +1,12 @@
# @nhost/docs
## 2.7.1
### Patch Changes
- 6cb2b63: feat: added nhost run env documentation
- 40bd3e4: fix: fixed wrong links in documentation
## 2.7.0
### Minor Changes

View File

@@ -86,4 +86,4 @@ await nhost.auth.sendVerificationEmail(
</Tab>
</Tabs>
<Tip>It is possible to customize these automatic emails, learn how to [here](/authentication/templates)</Tip>
<Tip>It is possible to customize these automatic emails, learn how to [here](/guides/auth/email-templates)</Tip>

View File

@@ -34,5 +34,5 @@ await nhost.auth.signIn(
<Tip>Users who have signed up with email and password can also sign in with a Magic Link</Tip>
<Tip>It is possible to customize the email with the Magic Link, learn how to [here](/authentication/templates)</Tip>
<Tip>It is possible to customize the email with the Magic Link, learn how to [here](/guides/auth/email-templates)</Tip>

View File

@@ -19,7 +19,7 @@ You're allowed to:
## Roles
Each user has one **default role** and a list of **allowed roles**. These roles are used to resolve permissions for requests to [GraphQL](/graphql/permissions) and [Storage](/storage#permissions).
Each user has one **default role** and a list of **allowed roles**. These roles are used to resolve permissions for requests to [GraphQL](/guides/api/permissions) and [Storage](/guides/storage/overview#permissions).
When the user makes a request, only one role is used to resolve permissions. The default role is used if no role is explicitly specified. Users can only make requests using the default role or one of the allowed roles.

View File

@@ -24,3 +24,65 @@ Based on the information above, if you want to connect directly to your service
<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>
# Quick Development
While developing your service, you may want to run it locally outside of the Nhost CLI to quickly iterate on it. To simplify this the Nhost CLI includes a command to generate an `.env` file based on your environment variables configuration and secrets. For instance, imagine a service with the following configuration:
<Tabs>
<Tab title="run-service.toml">
```toml
[[environment]]
name = 'HASURA_GRAPHQL_URL'
value = 'http://hasura-service:8080/v1/graphql'
[[environment]]
name = 'SOME_CONFIGURATION_PARAMETER'
value = 'some-value'
[[environment]]
name = 'SECRET_KEY'
value = '{{ secrets.SECRET_KEY }}'
```
</Tab>
<Tab title="overlay">
```json
[
{
"value": {
"name": "ENVIRONMENT",
"value": "dev"
},
"op": "add",
"path": "/environment/-"
},
{
"value": "https://local.graphql.nhost.run/v1/graphql",
"op": "replace",
"path": "/environment/0/value"
}
]
```
</Tab>
<Tab title=".secrets">
```toml
SECRET_KEY = '#asdasd;l;kq23\\n40-0as9d"$\\'
```
</Tab>
</Tabs>
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"
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.
</Warning>

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/docs",
"version": "2.7.0",
"version": "2.7.1",
"private": true,
"scripts": {
"start": "mintlify dev"

View File

@@ -1,5 +1,11 @@
# @nhost-examples/cli
## 0.2.1
### Patch Changes
- @nhost/nhost-js@3.0.9
## 0.2.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/cli",
"version": "0.2.0",
"version": "0.2.1",
"main": "src/index.mjs",
"private": true,
"scripts": {

View File

@@ -1,5 +1,16 @@
# @nhost-examples/codegen-react-apollo
## 0.3.0
### Minor Changes
- 7789469: chore: upgrade dependency `@graphql-codegen/cli` to `5.0.2` to address vulnerability
### Patch Changes
- @nhost/react@3.3.1
- @nhost/react-apollo@10.0.1
## 0.2.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/codegen-react-apollo",
"version": "0.2.0",
"version": "0.3.0",
"private": true,
"scripts": {
"codegen": "graphql-codegen",
@@ -24,7 +24,7 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@graphql-codegen/cli": "^2.16.5",
"@graphql-codegen/cli": "^5.0.2",
"@graphql-codegen/client-preset": "^1.3.0",
"@graphql-typed-document-node/core": "^3.2.0",
"@tailwindcss/forms": "^0.5.7",

View File

@@ -1,5 +1,15 @@
# @nhost-examples/codegen-react-query
## 0.3.0
### Minor Changes
- 7789469: chore: upgrade dependency `@graphql-codegen/cli` to `5.0.2` to address vulnerability
### Patch Changes
- @nhost/react@3.3.1
## 0.2.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/codegen-react-query",
"version": "0.2.0",
"version": "0.3.0",
"private": true,
"scripts": {
"codegen": "graphql-codegen",
@@ -25,7 +25,7 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@graphql-codegen/cli": "^2.16.5",
"@graphql-codegen/cli": "^5.0.2",
"@graphql-codegen/client-preset": "^1.3.0",
"@graphql-typed-document-node/core": "^3.2.0",
"@tailwindcss/forms": "^0.5.7",

View File

@@ -1,5 +1,16 @@
# @nhost-examples/react-urql
## 0.2.0
### Minor Changes
- 7789469: chore: upgrade dependency `@graphql-codegen/cli` to `5.0.2` to address vulnerability
### Patch Changes
- @nhost/react@3.3.1
- @nhost/react-urql@7.0.1
## 0.1.0
### Minor Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@nhost-examples/codegen-react-urql",
"private": true,
"version": "0.1.0",
"version": "0.2.0",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
@@ -18,7 +18,7 @@
"urql": "^3.0.4"
},
"devDependencies": {
"@graphql-codegen/cli": "^2.16.5",
"@graphql-codegen/cli": "^5.0.2",
"@graphql-codegen/client-preset": "^1.3.0",
"@graphql-typed-document-node/core": "^3.2.0",
"@tailwindcss/forms": "^0.5.7",

View File

@@ -1,5 +1,11 @@
# @nhost-examples/multi-tenant-one-to-many
## 2.1.1
### Patch Changes
- @nhost/nhost-js@3.0.9
## 2.1.0
### Minor Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@nhost-examples/multi-tenant-one-to-many",
"private": true,
"version": "2.1.0",
"version": "2.1.1",
"description": "",
"main": "index.js",
"scripts": {},

View File

@@ -1,5 +1,13 @@
# @nhost-examples/nextjs
## 0.2.1
### Patch Changes
- @nhost/react@3.3.1
- @nhost/react-apollo@10.0.1
- @nhost/nextjs@2.1.7
## 0.2.0
### Minor Changes

View File

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

View File

@@ -1,5 +1,11 @@
# @nhost-examples/node-storage
## 0.1.1
### Patch Changes
- @nhost/nhost-js@3.0.9
## 0.1.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/node-storage",
"version": "0.1.0",
"version": "0.1.1",
"private": true,
"description": "This is an example of how to use the Storage with Node.js",
"main": "src/index.mjs",

View File

@@ -1,5 +1,11 @@
# @nhost-examples/nextjs-server-components
## 0.3.1
### Patch Changes
- @nhost/nhost-js@3.0.9
## 0.3.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/nextjs-server-components",
"version": "0.3.0",
"version": "0.3.1",
"private": true,
"scripts": {
"dev": "next dev",

View File

@@ -1,5 +1,26 @@
# @nhost-examples/react-apollo
## 0.6.0
### Minor Changes
- 7789469: chore: upgrade dependency `@graphql-codegen/cli` to `5.0.2` to address vulnerability
### Patch Changes
- @nhost/react@3.3.1
- @nhost/react-apollo@10.0.1
## 0.5.0
### Minor Changes
- 08a7dd9: feat: add example workaround to the reset password ticket expired issue
### Patch Changes
- f0a994a: fix: update allowedUrls and redirectTo to point to the profile page
## 0.4.1
### Patch Changes

View File

@@ -8,7 +8,7 @@
<h2>Verify Email</h2>
<p>Use this link to verify your email:</p>
<p>
<a href="${link}"> Verify Email </a>
<a href="${clientUrl}/verify?ticket=${ticket}&redirectTo=${redirectTo}&type=emailVerify"> Verify Email </a>
</p>
</body>
</html>

View File

@@ -8,7 +8,7 @@
<h2>Reset Password</h2>
<p>Use this link to reset your password:</p>
<p>
<a href="${link}"> Reset password </a>
<a href="${clientUrl}/verify?ticket=${ticket}&redirectTo=${redirectTo}&type=emailVerify"> Reset password </a>
</p>
</body>
</html>

View File

@@ -1,14 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Magic Link</h2>
<p>Use this link to securely sign in:</p>
<p>
<a href="${link}"> Sign In </a>
</p>
</body>
</html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Magic Link</h2>
<p>Use this link to securely sign in:</p>
<p>
<a href="${link}">
Verify Email
</a>
</p>
</body>
</html>

View File

@@ -16,6 +16,7 @@ enableAllowList = false
enableConsole = true
enableRemoteSchemaPermissions = false
enabledAPIs = ['metadata', 'graphql', 'pgdump', 'config']
liveQueriesMultiplexedRefetchInterval = 1000
[hasura.logs]
level = 'warn'
@@ -28,17 +29,18 @@ httpPoolSize = 100
version = 18
[auth]
version = '0.26.0'
version = '0.27.0-beta13'
[auth.elevatedPrivileges]
mode = 'required'
[auth.redirections]
clientUrl = 'https://react-apollo.example.nhost.io/'
allowedUrls = ['https://react-apollo.example.nhost.io/profile', 'https://vue-apollo.example.nhost.io/profile', 'https://*.vercel.app','http://localhost:3000']
allowedUrls = ['https://react-apollo.example.nhost.io', 'https://react-apollo.example.nhost.io/profile', 'https://vue-apollo.example.nhost.io', 'https://vue-apollo.example.nhost.io/profile', 'https://*.vercel.app', 'http://localhost:3000', 'http://localhost:3000/profile', 'http://localhost:5173', 'http://localhost:5173/profile']
[auth.signUp]
enabled = true
disableNewUsers = false
[auth.user]
[auth.user.roles]

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/react-apollo",
"version": "0.4.1",
"version": "0.6.0",
"private": true,
"dependencies": {
"@apollo/client": "^3.9.5",
@@ -50,7 +50,7 @@
},
"devDependencies": {
"@faker-js/faker": "^7.6.0",
"@graphql-codegen/cli": "^2.16.5",
"@graphql-codegen/cli": "^5.0.2",
"@nuintun/qrcode": "^3.4.0",
"@playwright/test": "1.31.0",
"@types/pngjs": "^6.0.4",

View File

@@ -16,6 +16,7 @@ import { StoragePage } from './Storage'
import './App.css?inline'
import { NotesPage } from './components/notes'
import VerifyPage from './Verify'
const title = 'Nhost with React and Apollo'
function App() {
@@ -70,6 +71,7 @@ function App() {
</AuthGate>
}
/>
<Route path="/verify" element={<VerifyPage />} />
<Route path="/about" element={<AboutPage />} />
<Route
path="/sign-in/*"

View File

@@ -0,0 +1,34 @@
import { useSearchParams } from 'react-router-dom'
import { useEffect, useState } from 'react'
import { useNhostClient } from '@nhost/react'
import { Container } from '@mantine/core'
const VerifyPage: React.FC = () => {
const nhost = useNhostClient()
const [loading, setLoading] = useState(false)
const [searchParams] = useSearchParams()
useEffect(() => {
const ticket = searchParams.get('ticket')
const redirectTo = searchParams.get('redirectTo')
const type = searchParams.get('type')
if (ticket && redirectTo && type) {
window.location.href = `${nhost.auth.url}/verify?ticket=${ticket}&type=${type}&redirectTo=${redirectTo}`
}
setLoading(false)
}, [searchParams, nhost?.auth?.url])
if (loading) {
return null
}
return (
<Container>
<span>Failed to authenticate with magick link</span>
</Container>
)
}
export default VerifyPage

View File

@@ -6,7 +6,7 @@ import AuthLink from './AuthLink'
export default function OauthLinks() {
const { github, google, apple, linkedin } = useProviderLink({
redirectTo: window.location.origin
redirectTo: `${window.location.origin}/profile`
})
return (

View File

@@ -1,5 +1,11 @@
# @nhost-examples/react-gqty
## 1.1.1
### Patch Changes
- @nhost/react@3.3.1
## 1.1.0
### Minor Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@nhost-examples/react-gqty",
"private": true,
"version": "1.1.0",
"version": "1.1.1",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,12 @@
# @nhost-examples/serverless-functions
## 0.1.1
### Patch Changes
- Updated dependencies [7789469]
- @nhost/stripe-graphql-js@1.1.1
## 0.1.0
### Minor Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@nhost-examples/serverless-functions",
"private": true,
"version": "0.1.0",
"version": "0.1.1",
"devDependencies": {
"@types/express": "^4.17.21"
},

View File

@@ -1,5 +1,24 @@
# @nhost-examples/vue-apollo
## 0.4.1
### Patch Changes
- 7789469: chore: address linter errors and remove unnecessary imports
- @nhost/nhost-js@3.0.9
- @nhost/apollo@6.1.1
- @nhost/vue@2.3.1
## 0.4.0
### Minor Changes
- 08a7dd9: feat: add example workaround to the reset password ticket expired issue
### Patch Changes
- f0a994a: fix: update allowedUrls and redirectTo to point to the profile page
## 0.3.1
### Patch Changes

View File

@@ -9,7 +9,7 @@
<h2>Verify Email</h2>
<p>Use this link to verify your email:</p>
<p>
<a href="${link}">
<a href="${clientUrl}/verify?ticket=${ticket}&redirectTo=${redirectTo}&type=emailVerify">
Verify Email
</a>
</p>

View File

@@ -9,7 +9,7 @@
<h2>Reset Password</h2>
<p>Use this link to reset your password:</p>
<p>
<a href="${link}">
<a href="${clientUrl}/verify?ticket=${ticket}&redirectTo=${redirectTo}&type=emailVerify">
Reset password
</a>
</p>

View File

@@ -16,6 +16,7 @@ enableAllowList = false
enableConsole = true
enableRemoteSchemaPermissions = false
enabledAPIs = ['metadata', 'graphql', 'pgdump', 'config']
liveQueriesMultiplexedRefetchInterval = 1000
[hasura.logs]
level = 'warn'
@@ -28,17 +29,18 @@ httpPoolSize = 100
version = 18
[auth]
version = '0.27.0-beta1'
version = '0.27.0-beta13'
[auth.elevatedPrivileges]
mode = 'required'
[auth.redirections]
clientUrl = 'https://vue-apollo.example.nhost.io'
allowedUrls = ['https://vue-apollo.example.nhost.io/profile', 'https://react-apollo.example.nhost.io/profile', 'https://*.vercel.app','http://localhost:5173']
allowedUrls = ['https://react-apollo.example.nhost.io', 'https://react-apollo.example.nhost.io/profile', 'https://vue-apollo.example.nhost.io', 'https://vue-apollo.example.nhost.io/profile', 'https://*.vercel.app', 'http://localhost:3000', 'http://localhost:3000/profile', 'http://localhost:5173', 'http://localhost:5173/profile']
[auth.signUp]
enabled = true
disableNewUsers = false
[auth.user]
[auth.user.roles]
@@ -67,7 +69,7 @@ expiresIn = 43200
[auth.method]
[auth.method.anonymous]
enabled = false
enabled = true
[auth.method.emailPasswordless]
enabled = true
@@ -75,7 +77,7 @@ enabled = true
[auth.method.emailPassword]
hibpEnabled = false
emailVerificationRequired = true
passwordMinLength = 9
passwordMinLength = 8
[auth.method.smsPasswordless]
enabled = false

View File

@@ -1,7 +1,7 @@
{
"name": "@nhost-examples/vue-apollo",
"private": true,
"version": "0.3.1",
"version": "0.4.1",
"scripts": {
"dev": "vite",
"build": "vite build",

View File

@@ -15,5 +15,5 @@
<script lang="ts" setup>
import { useProviderLink } from '@nhost/vue'
const { github } = useProviderLink({ redirectTo: window.location.origin })
const { github } = useProviderLink({ redirectTo: `${window.location.origin}/profile` })
</script>

View File

@@ -104,8 +104,7 @@ import {
useUserId
} from '@nhost/vue'
import { useMutation, useQuery } from '@vue/apollo-composable'
import { computed } from 'vue'
import { ref, unref } from 'vue'
import { ref, unref, computed } from 'vue'
const email = ref('')
const password = ref('')

View File

@@ -0,0 +1,30 @@
<template>
<div className="d-flex align-center flex-column">
<v-card width="400" v-if="!loading">
<v-card-text>Failed to authenticate with magick link</v-card-text>
</v-card>
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted } from 'vue'
import { useRoute } from 'vue-router'
import { useNhostClient } from '@nhost/vue'
const { nhost } = useNhostClient()
const route = useRoute()
const loading = ref(true)
onMounted(() => {
const ticket = route.query.ticket
const redirectTo = route.query.redirectTo
const type = route.query.type
if (ticket && redirectTo && type) {
window.location.href = `${nhost.auth.url}/verify?ticket=${ticket}&type=${type}&redirectTo=${redirectTo}`
}
loading.value = false
})
</script>

View File

@@ -2,8 +2,20 @@
<form @submit="handleSignIn">
<v-text-field v-model="email" label="Email" />
<v-text-field v-model="password" label="Password" type="password" />
<v-btn block color="primary" class="my-1" type="submit" :disabled="isLoading" :loading="isLoading"> Sign in </v-btn>
<v-btn
block
color="primary"
class="my-1"
type="submit"
:disabled="isLoading"
:loading="isLoading"
>
Sign in
</v-btn>
</form>
<v-btn class="my-1" block variant="text" color="primary" to="/signin/forgot-password">
Forgot password?
</v-btn>
<v-btn class="my-1" block variant="text" color="primary" to="/signin">
&#8592; Other Sign-in Options
</v-btn>

View File

@@ -0,0 +1,38 @@
<template>
<form @submit="handleSendResetPasswordEmail">
<v-text-field v-model="email" label="Email" />
<v-btn block color="primary" class="my-1" type="submit"> Reset password </v-btn>
<v-dialog v-model="emailSent">
<v-card>
<v-card-title>
<span class="text-h5">Verification email sent</span>
</v-card-title>
<v-card-text>
A email has been sent to {{ email }}. Please follow the link to reset the password.
</v-card-text>
<v-card-actions class="justify-center d-flex">
<v-btn text @click="emailSent = false"> Close </v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</form>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { useResetPassword } from '@nhost/vue'
const email = ref('')
const emailSent = ref(false)
const { resetPassword } = useResetPassword({
redirectTo: '/profile'
})
const handleSendResetPasswordEmail = async (e: Event) => {
e.preventDefault()
await resetPassword(email)
emailSent.value = true
}
</script>

View File

@@ -14,12 +14,15 @@ import SignUpEmailPasword from './pages/sign-up/EmailPassword.vue'
import SignUpEmailPaswordless from './pages/sign-up/EmailPasswordless.vue'
import SignUpEmailSecurityKey from './pages/sign-up/SecurityKey.vue'
import SignInEmailSecurityKey from './pages/sign-in/SecurityKey.vue'
import ForgotPassword from './pages/sign-in/ForgotPassword.vue'
import SignUp from './pages/sign-up/IndexPage.vue'
import Signout from './pages/SignoutPage.vue'
import StoragePage from './pages/StoragePage.vue'
import VerifyPage from './pages/VerifyEmail.vue'
export const routes: RouteRecordRaw[] = [
{ path: '/', component: Index, meta: { auth: true } },
{ path: '/verify', component: VerifyPage },
{ path: '/profile', component: Profile, meta: { auth: true } },
{ path: '/about', component: AboutPage },
{ path: '/signout', component: Signout },
@@ -39,6 +42,10 @@ export const routes: RouteRecordRaw[] = [
{
path: 'security-key',
component: SignInEmailSecurityKey
},
{
path: 'forgot-password',
component: ForgotPassword
}
]
},

View File

@@ -1,5 +1,12 @@
# @nhost-examples/vue-quickstart
## 0.1.1
### Patch Changes
- @nhost/apollo@6.1.1
- @nhost/vue@2.3.1
## 0.1.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/vue-quickstart",
"version": "0.1.0",
"version": "0.1.1",
"private": true,
"scripts": {
"build": "vite build",

View File

@@ -1,5 +1,11 @@
# @nhost/apollo
## 6.1.1
### Patch Changes
- @nhost/nhost-js@3.0.9
## 6.1.0
### Minor Changes

View File

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

View File

@@ -1,5 +1,12 @@
# @nhost/react-apollo
## 10.0.1
### Patch Changes
- @nhost/apollo@6.1.1
- @nhost/react@3.3.1
## 10.0.0
### Minor Changes

View File

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

View File

@@ -1,5 +1,11 @@
# @nhost/react-urql
## 7.0.1
### Patch Changes
- @nhost/react@3.3.1
## 7.0.0
### Minor Changes

View File

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

View File

@@ -1,5 +1,11 @@
# @nhost/stripe-graphql-js
## 1.1.1
### Patch Changes
- 7789469: chore: address linter errors and remove unnecessary imports
## 1.1.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/stripe-graphql-js",
"version": "1.1.0",
"version": "1.1.1",
"description": "Stripe GraphQL API",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,4 @@
import { createYoga, YogaInitialContext } from 'graphql-yoga'
import { createServer } from 'node:http'
import { schema } from './schema'
import { Context, CreateServerProps } from './types'
@@ -9,7 +8,7 @@ const createStripeGraphQLServer = ({
cors,
isAllowed,
graphiql,
maskedErrors = true,
maskedErrors = true
}: CreateServerProps = {}) => {
const context = (context: YogaInitialContext): Context => {
const { request } = context
@@ -53,7 +52,7 @@ const createStripeGraphQLServer = ({
context,
schema,
graphqlEndpoint: '*',
maskedErrors,
maskedErrors
})
return yoga

View File

@@ -1,5 +1,11 @@
# @nhost/graphql-js
## 0.1.9
### Patch Changes
- 7789469: fix: resolve process is undefined error when running with vitejs
## 0.1.8
### Patch Changes

View File

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

View File

@@ -104,7 +104,7 @@ export class NhostGraphqlClient {
const { headers, ...otherOptions } = config || {}
const { query, operationName } = resolveRequestDocument(requestOptions.document)
if (!process.env.TEST_MODE) {
if (typeof process !== 'undefined' && !process.env.TEST_MODE) {
// We skip this while running unit tests because the accessToken is generated using faker
await this.awaitForValidAccessTokenOrNull()
}

View File

@@ -1,5 +1,11 @@
# @nhost/nextjs
## 2.1.7
### Patch Changes
- @nhost/react@3.3.1
## 2.1.6
### Patch Changes

View File

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

View File

@@ -1,5 +1,12 @@
# @nhost/nhost-js
## 3.0.9
### Patch Changes
- Updated dependencies [7789469]
- @nhost/graphql-js@0.1.9
## 3.0.8
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/nhost-js",
"version": "3.0.8",
"version": "3.0.9",
"description": "Nhost JavaScript SDK",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,11 @@
# @nhost/react
## 3.3.1
### Patch Changes
- @nhost/nhost-js@3.0.9
## 3.3.0
### Minor Changes

View File

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

View File

@@ -1,5 +1,11 @@
# @nhost/vue
## 2.3.1
### Patch Changes
- @nhost/nhost-js@3.0.9
## 2.3.0
### Minor Changes

View File

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

1148
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff