Compare commits

..

37 Commits

Author SHA1 Message Date
Pilou
4a5a2fac43 Merge pull request #794 from nhost/changeset-release/main
chore: update versions
2022-07-05 22:14:42 +02:00
github-actions[bot]
8493129750 chore: update versions 2022-07-05 08:03:48 +00:00
Pilou
26b817c5fa Merge pull request #788 from nhost/785-sms-passwordless-otp-sign-in-is-never-returning-or-rejecting-a-promise-on-failure
fix: return promise when using SMS OTP and an error occurs
2022-07-05 10:02:36 +02:00
Johan Eliasson
e61ea19421 Merge pull request #792 from nhost/timpratim-patch-2
Updated React quick-start ( without images )
2022-07-05 07:26:47 +02:00
Johan Eliasson
401f2cb540 updated react quick start 2022-07-05 07:18:15 +02:00
Johan Eliasson
6363a289fb Merge branch 'main' into timpratim-patch-2 2022-07-05 07:07:32 +02:00
Johan Eliasson
f09037ccef Merge pull request #783 from nhost/domain-structure
Docs: Use subdomain and region instead of backend url
2022-07-05 07:05:52 +02:00
Pratim
a4dea7339e Updated react quick-start ( without images ) 2022-07-05 00:24:34 +05:30
Pilou
f356c7176b Merge pull request #789 from nhost/contributors-readme-action-K0Fk8ZdmGi
contributors readme action update
2022-07-04 16:50:59 +02:00
github-actions[bot]
cb99c6d989 contrib-readme-action has updated readme 2022-07-04 14:50:20 +00:00
Pilou
7cef49bb02 Merge pull request #761 from uulwake/chore/add-test-coverage
chore: add test coverage in every packages
2022-07-04 16:50:04 +02:00
Pierre-Louis Mercereau
6eaa5c7920 fix: return promise when using SMS OTP and an error occurs 2022-07-04 16:24:35 +02:00
Johan Eliasson
64574ee892 info for CLI 2022-07-03 10:39:25 +02:00
Johan Eliasson
d3d38b2631 update vue quickstart with subdomain and region 2022-07-03 10:36:15 +02:00
Johan Eliasson
023afae3cd updated redwoodjs guide with subdomain and region 2022-07-03 10:32:53 +02:00
Johan Eliasson
19d2242918 updated app dashboard image 2022-07-03 10:27:54 +02:00
Johan Eliasson
a5f02e8056 workding 2022-07-02 08:58:19 +02:00
Johan Eliasson
aeb85a1e01 u 2022-07-02 08:54:42 +02:00
Johan Eliasson
821912e23e Merge pull request #781 from nhost/docs/subdomain-readmes
docs: update to subdomains in readmes
2022-07-02 08:11:54 +02:00
Pierre-Louis Mercereau
8608a78eaf docs: update readmes to subdomains 2022-07-01 22:57:08 +02:00
Pilou
2d2da4f6e0 Merge pull request #778 from nhost/plmercereau-patch-1
Update docker compose readme
2022-07-01 11:18:19 +02:00
Pilou
19d7262b05 Update README.md 2022-07-01 08:07:37 +02:00
Johan Eliasson
1c750bd652 Merge pull request #769 from nhost/codegen-example
Example: Adding codegen example from blog post
2022-06-30 13:45:52 +02:00
Pierre-Louis Mercereau
8a3943a942 build: fix lockfile 2022-06-30 11:34:50 +02:00
Johan Eliasson
62385a7866 Merge branch 'main' into codegen-example 2022-06-30 11:00:23 +02:00
Pierre-Louis Mercereau
c101a26ce5 build: clean lockfile, and build all packages 2022-06-29 17:55:15 +02:00
Johan Eliasson
80468ac3ac merge main and pnpm install 2022-06-29 14:54:37 +02:00
Johan Eliasson
d03653f1fd config update 2022-06-29 14:46:40 +02:00
Johan Eliasson
5dff7ad5d3 README update 2022-06-29 13:40:29 +02:00
Johan Eliasson
9263bea2ae clear 2022-06-29 13:32:04 +02:00
Johan Eliasson
4f994b536e correct parameters 2022-06-29 13:15:13 +02:00
Johan Eliasson
c907021313 update 2022-06-29 11:10:34 +02:00
Johan Eliasson
12a218b12c importing Nhost providers 2022-06-29 10:55:43 +02:00
Pierre-Louis Mercereau
196156ff93 build: use vite 2022-06-29 10:15:12 +02:00
Johan Eliasson
28ca032f70 adding public permissions 2022-06-29 08:26:41 +02:00
Johan Eliasson
333292ab89 adding codegen example from blog post 2022-06-29 08:17:42 +02:00
Ulrich Wake
db955e3b71 chore: add test coverage in every packages 2022-06-28 10:26:29 +07:00
103 changed files with 5848 additions and 91 deletions

View File

@@ -412,6 +412,13 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Tapas Adhikary</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/uulwake">
<img src="https://avatars.githubusercontent.com/u/22399181?v=4" width="100;" alt="uulwake"/>
<br />
<sub><b>Ulrich Wake</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/komninoschat">
<img src="https://avatars.githubusercontent.com/u/29049104?v=4" width="100;" alt="komninoschat"/>

View File

@@ -81,6 +81,18 @@ nhost up
Hasura Console starts automatically and your Nhost app is running locally with the backend URL: `http://localhost:1337`.
## Subdomain and Region
Use `localhost:1337` as the `subdomain`, and skip `region` when using the CLI and the [JavaScript SDK](/reference/javascript):
```
import { NhostClient } from '@nhost/nhost-js'
const nhost = new NhostClient({
subdomain: 'localhost:1337',
})
```
## Emails
During local development with the CLI, all transactional emails from Authentication are sent to a local Mailhog instance, instead of to the recipient's email address. You'll see an address where after starting [`nhost up`](/reference/cli/up) where all emails are sent to.

View File

@@ -132,7 +132,8 @@ import { NhostNextProvider, NhostClient } from '@nhost/nextjs';
// highlight-start
const nhost = new NhostClient({
backendUrl: process.env.NEXT_PUBLIC_NHOST_BACKEND_URL || '',
subdomain: process.env.NEXT_PUBLIC_NHOST_SUBDOMAIN || '',
region: process.env.NEXT_PUBLIC_NHOST_REGION || ''
});
// highlight-end
@@ -149,16 +150,16 @@ function MyApp({ Component, pageProps }) {
}
```
Finally, make sure to create an environment variable named
`NEXT_PUBLIC_NHOST_BACKEND_URL` to store your Nhost backend URL:
Finally, store the environment variables for `subdomain` and `region` in `.env.development`:
```yaml title=".env.development"
NEXT_PUBLIC_NHOST_BACKEND_URL=YOUR_NHOST_BACKEND_URL
NEXT_PUBLIC_NHOST_SUBDOMAIN=YOUR_NHOST_APP_SUBDOMAIN
NEXT_PUBLIC_NHOST_REGION=YOUR_NHOST_APP_REGION
```
You can find your Nhost backend URL for your project from [your dashboard](https://app.nhost.io) as shown below:
You find your Nhost app's subdomain and region in [the app dashboard](https://app.nhost.io):
![Nhost Backend URL](/img/quickstarts/app-dashboard.png)
![Nhost App Dashboard](/img/quickstarts/app-dashboard.png)
:::caution
Don't forget to restart your Next.js server after saving your `.env.development`

View File

@@ -128,7 +128,8 @@ Nhost backend:
import { NhostClient, NhostReactProvider } from '@nhost/react'
const nhost = new NhostClient({
backendUrl: process.env.REACT_APP_NHOST_BACKEND_URL || ''
subdomain: process.env.REACT_APP_NHOST_SUBDOMAIN,
region: process.env.REACT_APP_NHOST_REGION
})
function App() {
@@ -143,15 +144,16 @@ export default App
```
Finally, make sure to create an environment variable named
`REACT_APP_NHOST_BACKEND_URL` to store your Nhost backend URL:
`REACT_APP_NHOST_SUBDOMAIN` and `REACT_APP_NHOST_REGION` to store your Nhost domain details:
```yaml title=".env.local"
REACT_APP_NHOST_BACKEND_URL=YOUR_NHOST_BACKEND_URL
REACT_APP_NHOST_SUBDOMAIN=YOUR_NHOST_APP_SUBDOMAIN
REACT_APP_NHOST_REGION=YOUR_NHOST_APP_REGION
```
You can find your Nhost backend URL for your project from [your dashboard](https://app.nhost.io) as shown below:
You find your Nhost app's subdomain and region in [the app dashboard](https://app.nhost.io):
![Nhost Backend URL](/img/quickstarts/app-dashboard.png)
![Nhost App Dashboard](/img/quickstarts/app-dashboard.png)
:::caution
Don't forget to restart your React server after saving your `.env.local`

View File

@@ -136,7 +136,8 @@ import { NhostClient } from '@nhost/nhost-js'
// highlight-start
const nhostClient = new NhostClient({
backendUrl: process.env.NHOST_BACKEND_URL
subdomain: process.env.NHOST_SUBDOMAIN
region: process.env.NHOST_REGION
})
// highlight-end
@@ -175,16 +176,16 @@ const App = () => (
That prop avoids having an additional request to fetch the current user.
Next, make sure to create an environment variable named
`NHOST_BACKEND_URL` to store your Nhost backend URL:
Next, store the environment variables for `subdomain` and `region` in `.env`:
```yaml title=".env"
NHOST_BACKEND_URL=YOUR_NHOST_BACKEND_URL
NHOST_SUBDOMAIN=YOUR_NHOST_APP_SUBDOMAIN
NHOST_REGION=YOUR_NHOST_APP_REGION
```
You can find your Nhost backend URL for your project from [your dashboard](https://app.nhost.io) as shown below:
You find your Nhost app's subdomain and region in [the app dashboard](https://app.nhost.io):
![Nhost Backend URL](/img/quickstarts/app-dashboard.png)
![Nhost App Dashboard](/img/quickstarts/app-dashboard.png)
Finally, we need to customize the GraphQL Endpoint for our RedwoodJS app. Indeed, by default, RedwoodJS provides a built-in GraphQL server under the `api` side. However, as we already have our own GraphQL server through Nhost and Hasura, we do not need it.
@@ -194,7 +195,7 @@ So, open the RedwoodJS configuration file, `redwood.toml`, and change the GraphQ
[web]
apiUrl = "/.redwood/functions"
# highlight-next-line
apiGraphQLUrl = "${NHOST_BACKEND_URL}/v1/graphql"
apiGraphQLUrl = "https://${NHOST_SUBDOMAIN}.graphql.${NHOST_REGION}.nhost.run/v1"
```
:::caution

View File

@@ -153,7 +153,8 @@ import 'uno.css'
// highlight-start
const nhost = new NhostClient({
backendUrl: import.meta.env.VITE_NHOST_URL
subdomain: import.meta.env.VITE_NHOST_SUBDOMAIN
region: import.meta.env.VITE_NHOST_REGION
})
// highlight-end
@@ -170,16 +171,16 @@ app
app.mount('#app')
```
Finally, make sure to create an environment variable named
`VITE_NHOST_URL` to store your Nhost backend URL:
Finally, store the environment variables for `subdomain` and `region` in `.env`:
```bash title=".env"
VITE_NHOST_URL=YOUR_NHOST_BACKEND_URL
```yaml title=".env.development"
VITE_NHOST_SUBDOMAIN=YOUR_NHOST_APP_SUBDOMAIN
VITE_NHOST_REGION=YOUR_NHOST_APP_REGION
```
You can find your Nhost backend URL for your project from [your dashboard](https://app.nhost.io) as shown below:
You find your Nhost app's subdomain and region in [the app dashboard](https://app.nhost.io):
![Nhost Backend URL](/img/quickstarts/app-dashboard.png)
![Nhost App Dashboard](/img/quickstarts/app-dashboard.png)
## Build the app

View File

@@ -39,7 +39,8 @@ import { NhostApolloProvider } from '@nhost/react-apollo'
import { NhostClient, NhostReactProvider } from '@nhost/react'
const nhost = new NhostClient({
backendUrl: '<Your Nhost Backend URL>'
subdomain: '<app-subdomain>',
region: '<app-region>'
})
ReactDOM.render(

View File

@@ -35,10 +35,12 @@ After installation, initialize a single Nhost Client (`nhost`) under `src/lib/nh
```jsx title=src/lib/nhost.js
import { NhostClient } from '@nhost/react'
const nhost = new NhostClient({
subdomain: '<your-subdomain>',
region: '<your-region>'
})
export { nhost }
```

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 208 KiB

View File

@@ -0,0 +1,27 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.nhost
web/node_modules
node_modules
functions/node_modules

View File

@@ -0,0 +1,46 @@
# GraphQL Code Generator Example Repo
This is an example repo for how to use GraphQL Code Generator together with:
- TypeScript
- React
- Apollo Client
- Nhost
This repo is a reference repo for the blog post: [How to use GraphQL Code Generator with React and Apollo](https://nhost.io/blog/how-to-use-graphql-code-generator-with-react-and-apollo).
## Get Started
### Run npm Packages in Dev Mode
In the root of the `nhost/nhost` repo:
Install dependencies with `pnpm`:
> It's important that you're using `pnpm` because our repo are using [PNPM Workspaces](https://pnpm.io/workspaces).
```
pnpm install
```
Running packages in development mode:
```
pnpm run dev
```
### Run Nhost
In this folder:
```
nhost up
```
### Run React App
In this folder:
```
pnpm run dev
```

View File

@@ -0,0 +1,14 @@
schema:
- http://localhost:1337/v1/graphql:
headers:
x-hasura-admin-secret: nhost-admin-secret
documents:
- 'src/**/*.graphql'
generates:
src/utils/__generated__/graphql.ts:
plugins:
- 'typescript'
- 'typescript-operations'
- 'typescript-react-apollo'
config:
withRefetchFn: true

View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>GraphQL Code Generator Example with React and Apollo Client</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>

View File

@@ -0,0 +1,143 @@
metadata_directory: metadata
mailhog:
port: 8025
hasura:
version: v2.8.0
environment:
hasura_graphql_enable_remote_schema_permissions: false
auth:
version: 0.9.1
storage:
version: 0.2.2
minio:
environment:
minio_root_password: minioaccesskey123123
minio_root_user: minioaccesskey123123
postgres:
environment:
postgres_password: postgres
postgres_user: postgres
auth:
access_control:
email:
allowed_email_domains: ""
allowed_emails: ""
blocked_email_domains: ""
blocked_emails: ""
url:
allowed_redirect_urls: ""
anonymous_users_enabled: false
client_url: http://localhost:3000
disable_new_users: false
email:
enabled: false
passwordless:
enabled: false
signin_email_verified_required: true
template_fetch_url: ""
gravatar:
default: ""
enabled: true
rating: ""
locale:
allowed: en
default: en
password:
hibp_enabled: false
min_length: 3
provider:
apple:
client_id: ""
enabled: false
key_id: ""
private_key: ""
scope: name,email
team_id: ""
bitbucket:
client_id: ""
client_secret: ""
enabled: false
facebook:
client_id: ""
client_secret: ""
enabled: false
scope: email,photos,displayName
github:
client_id: ""
client_secret: ""
enabled: false
scope: user:email
token_url: ""
user_profile_url: ""
gitlab:
base_url: ""
client_id: ""
client_secret: ""
enabled: false
scope: read_user
google:
client_id: ""
client_secret: ""
enabled: false
scope: email,profile
linkedin:
client_id: ""
client_secret: ""
enabled: false
scope: r_emailaddress,r_liteprofile
spotify:
client_id: ""
client_secret: ""
enabled: false
scope: user-read-email,user-read-private
strava:
client_id: ""
client_secret: ""
enabled: false
twilio:
account_sid: ""
auth_token: ""
enabled: false
messaging_service_id: ""
twitter:
consumer_key: ""
consumer_secret: ""
enabled: false
windows_live:
client_id: ""
client_secret: ""
enabled: false
scope: wl.basic,wl.emails,wl.contacts_emails
sms:
enabled: false
passwordless:
enabled: false
provider:
twilio:
account_sid: ""
auth_token: ""
from: ""
messaging_service_id: ""
smtp:
host: nhost_mailhog
method: ""
pass: password
port: 1706
secure: false
sender: hasura-auth@example.com
user: user
token:
access:
expires_in: 900
refresh:
expires_in: 43200
user:
allowed_roles: user,me
default_allowed_roles: user,me
default_role: user
mfa:
enabled: false
issuer: nhost
storage:
force_download_for_content_types: text/html,application/javascript
version: 3

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Confirm Email Change</h2>
<p>Use this link to confirm changing email:</p>
<p>
<a href="${link}">
Change email
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Change your email address

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Verify Email</h2>
<p>Use this link to verify your email:</p>
<p>
<a href="${link}">
Verify Email
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Verify your email

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Reset Password</h2>
<p>Use this link to reset your password:</p>
<p>
<a href="${link}">
Reset password
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Reset your password

View File

@@ -0,0 +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>

View File

@@ -0,0 +1 @@
Secure sign-in link

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Confirmer changement de courriel</h2>
<p>Utilisez ce lien pour confirmer le changement de courriel:</p>
<p>
<a href="${link}">
Changer courriel
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Changez votre adresse courriel

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>V&eacute;rifiez votre courriel</h2>
<p>Utilisez ce lien pour v&eacute;rifier votre courriel:</p>
<p>
<a href="${link}">
V&eacute;rifier courriel
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Vérifier votre courriel

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>R&eacute;initializer votre mot de passe</h2>
<p>Utilisez ce lien pour r&eacute;initializer votre mot de passe:</p>
<p>
<a href="${link}">
R&eacute;initializer mot de passe
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Réinitialiser votre mot de passe

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Lien magique</h2>
<p>Utilisez ce lien pour vous connecter de fa&ccedil;on s&eacute;curitaire:</p>
<p>
<a href="${link}">
Connexion
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Lien de connexion sécurisé

View File

@@ -0,0 +1,6 @@
actions: []
custom_types:
enums: []
input_objects: []
objects: []
scalars: []

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,14 @@
- name: default
kind: postgres
configuration:
connection_info:
database_url:
from_env: HASURA_GRAPHQL_DATABASE_URL
isolation_level: read-committed
pool_settings:
connection_lifetime: 600
idle_timeout: 180
max_connections: 50
retries: 1
use_prepared_statements: true
tables: "!include default/tables/tables.yaml"

View File

@@ -0,0 +1,17 @@
table:
name: provider_requests
schema: auth
configuration:
column_config: {}
custom_column_names: {}
custom_name: authProviderRequests
custom_root_fields:
delete: deleteAuthProviderRequests
delete_by_pk: deleteAuthProviderRequest
insert: insertAuthProviderRequests
insert_one: insertAuthProviderRequest
select: authProviderRequests
select_aggregate: authProviderRequestsAggregate
select_by_pk: authProviderRequest
update: updateAuthProviderRequests
update_by_pk: updateAuthProviderRequest

View File

@@ -0,0 +1,25 @@
table:
name: providers
schema: auth
configuration:
column_config: {}
custom_column_names: {}
custom_name: authProviders
custom_root_fields:
delete: deleteAuthProviders
delete_by_pk: deleteAuthProvider
insert: insertAuthProviders
insert_one: insertAuthProvider
select: authProviders
select_aggregate: authProvidersAggregate
select_by_pk: authProvider
update: updateAuthProviders
update_by_pk: updateAuthProvider
array_relationships:
- name: userProviders
using:
foreign_key_constraint_on:
column: provider_id
table:
name: user_providers
schema: auth

View File

@@ -0,0 +1,33 @@
table:
name: refresh_tokens
schema: auth
configuration:
column_config:
created_at:
custom_name: createdAt
expires_at:
custom_name: expiresAt
refresh_token:
custom_name: refreshToken
user_id:
custom_name: userId
custom_column_names:
created_at: createdAt
expires_at: expiresAt
refresh_token: refreshToken
user_id: userId
custom_name: authRefreshTokens
custom_root_fields:
delete: deleteAuthRefreshTokens
delete_by_pk: deleteAuthRefreshToken
insert: insertAuthRefreshTokens
insert_one: insertAuthRefreshToken
select: authRefreshTokens
select_aggregate: authRefreshTokensAggregate
select_by_pk: authRefreshToken
update: updateAuthRefreshTokens
update_by_pk: updateAuthRefreshToken
object_relationships:
- name: user
using:
foreign_key_constraint_on: user_id

View File

@@ -0,0 +1,32 @@
table:
name: roles
schema: auth
configuration:
column_config: {}
custom_column_names: {}
custom_name: authRoles
custom_root_fields:
delete: deleteAuthRoles
delete_by_pk: deleteAuthRole
insert: insertAuthRoles
insert_one: insertAuthRole
select: authRoles
select_aggregate: authRolesAggregate
select_by_pk: authRole
update: updateAuthRoles
update_by_pk: updateAuthRole
array_relationships:
- name: userRoles
using:
foreign_key_constraint_on:
column: role
table:
name: user_roles
schema: auth
- name: usersByDefaultRole
using:
foreign_key_constraint_on:
column: default_role
table:
name: users
schema: auth

View File

@@ -0,0 +1,45 @@
table:
name: user_providers
schema: auth
configuration:
column_config:
access_token:
custom_name: accessToken
created_at:
custom_name: createdAt
provider_id:
custom_name: providerId
provider_user_id:
custom_name: providerUserId
refresh_token:
custom_name: refreshToken
updated_at:
custom_name: updatedAt
user_id:
custom_name: userId
custom_column_names:
access_token: accessToken
created_at: createdAt
provider_id: providerId
provider_user_id: providerUserId
refresh_token: refreshToken
updated_at: updatedAt
user_id: userId
custom_name: authUserProviders
custom_root_fields:
delete: deleteAuthUserProviders
delete_by_pk: deleteAuthUserProvider
insert: insertAuthUserProviders
insert_one: insertAuthUserProvider
select: authUserProviders
select_aggregate: authUserProvidersAggregate
select_by_pk: authUserProvider
update: updateAuthUserProviders
update_by_pk: updateAuthUserProvider
object_relationships:
- name: provider
using:
foreign_key_constraint_on: provider_id
- name: user
using:
foreign_key_constraint_on: user_id

View File

@@ -0,0 +1,30 @@
table:
name: user_roles
schema: auth
configuration:
column_config:
created_at:
custom_name: createdAt
user_id:
custom_name: userId
custom_column_names:
created_at: createdAt
user_id: userId
custom_name: authUserRoles
custom_root_fields:
delete: deleteAuthUserRoles
delete_by_pk: deleteAuthUserRole
insert: insertAuthUserRoles
insert_one: insertAuthUserRole
select: authUserRoles
select_aggregate: authUserRolesAggregate
select_by_pk: authUserRole
update: updateAuthUserRoles
update_by_pk: updateAuthUserRole
object_relationships:
- name: roleByRole
using:
foreign_key_constraint_on: role
- name: user
using:
foreign_key_constraint_on: user_id

View File

@@ -0,0 +1,107 @@
table:
name: users
schema: auth
configuration:
column_config:
active_mfa_type:
custom_name: activeMfaType
avatar_url:
custom_name: avatarUrl
created_at:
custom_name: createdAt
default_role:
custom_name: defaultRole
display_name:
custom_name: displayName
email_verified:
custom_name: emailVerified
is_anonymous:
custom_name: isAnonymous
last_seen:
custom_name: lastSeen
new_email:
custom_name: newEmail
otp_hash:
custom_name: otpHash
otp_hash_expires_at:
custom_name: otpHashExpiresAt
otp_method_last_used:
custom_name: otpMethodLastUsed
password_hash:
custom_name: passwordHash
phone_number:
custom_name: phoneNumber
phone_number_verified:
custom_name: phoneNumberVerified
ticket_expires_at:
custom_name: ticketExpiresAt
totp_secret:
custom_name: totpSecret
updated_at:
custom_name: updatedAt
custom_column_names:
active_mfa_type: activeMfaType
avatar_url: avatarUrl
created_at: createdAt
default_role: defaultRole
display_name: displayName
email_verified: emailVerified
is_anonymous: isAnonymous
last_seen: lastSeen
new_email: newEmail
otp_hash: otpHash
otp_hash_expires_at: otpHashExpiresAt
otp_method_last_used: otpMethodLastUsed
password_hash: passwordHash
phone_number: phoneNumber
phone_number_verified: phoneNumberVerified
ticket_expires_at: ticketExpiresAt
totp_secret: totpSecret
updated_at: updatedAt
custom_name: users
custom_root_fields:
delete: deleteUsers
delete_by_pk: deleteUser
insert: insertUsers
insert_one: insertUser
select: users
select_aggregate: usersAggregate
select_by_pk: user
update: updateUsers
update_by_pk: updateUser
object_relationships:
- name: defaultRoleByRole
using:
foreign_key_constraint_on: default_role
array_relationships:
- name: refreshTokens
using:
foreign_key_constraint_on:
column: user_id
table:
name: refresh_tokens
schema: auth
- name: roles
using:
foreign_key_constraint_on:
column: user_id
table:
name: user_roles
schema: auth
- name: userProviders
using:
foreign_key_constraint_on:
column: user_id
table:
name: user_providers
schema: auth
select_permissions:
- permission:
columns:
- avatar_url
- display_name
- id
filter:
id:
_eq: X-Hasura-User-Id
role: user

View File

@@ -0,0 +1,17 @@
table:
name: customers
schema: public
insert_permissions:
- permission:
check: {}
columns:
- name
role: public
select_permissions:
- permission:
columns:
- id
- name
- created_at
filter: {}
role: public

View File

@@ -0,0 +1,80 @@
table:
name: doc_links
schema: public
configuration:
column_config:
created_at:
custom_name: createdAt
doc_id:
custom_name: docId
download_allowed:
custom_name: downloadAllowed
is_active:
custom_name: isActive
require_email_to_view:
custom_name: requireEmailToView
updated_at:
custom_name: updatedAt
custom_column_names:
created_at: createdAt
doc_id: docId
download_allowed: downloadAllowed
is_active: isActive
require_email_to_view: requireEmailToView
updated_at: updatedAt
custom_root_fields:
insert: insertDocLinks
insert_one: insertDocLink
select: docLinks
select_by_pk: docLink
object_relationships:
- name: doc
using:
foreign_key_constraint_on: doc_id
array_relationships:
- name: docVisits
using:
foreign_key_constraint_on:
column: doc_link_id
table:
name: doc_visits
schema: public
insert_permissions:
- permission:
check:
doc:
user_id:
_eq: X-Hasura-User-Id
columns:
- doc_id
- download_allowed
- is_active
- passcode
- require_email_to_view
role: user
select_permissions:
- permission:
columns:
- download_allowed
- id
- is_active
- passcode
- require_email_to_view
filter: {}
limit: 0
role: public
- permission:
columns:
- download_allowed
- is_active
- require_email_to_view
- passcode
- created_at
- updated_at
- doc_id
- id
filter:
doc:
user_id:
_eq: X-Hasura-User-Id
role: user

View File

@@ -0,0 +1,35 @@
table:
name: doc_visits
schema: public
configuration:
column_config:
created_at:
custom_name: createdAt
doc_link_id:
custom_name: docLinkId
updated_at:
custom_name: updatedAt
custom_column_names:
created_at: createdAt
doc_link_id: docLinkId
updated_at: updatedAt
custom_root_fields: {}
object_relationships:
- name: docLink
using:
foreign_key_constraint_on: doc_link_id
select_permissions:
- permission:
allow_aggregations: true
columns:
- email
- created_at
- updated_at
- doc_link_id
- id
filter:
docLink:
doc:
user_id:
_eq: X-Hasura-User-Id
role: user

View File

@@ -0,0 +1,72 @@
table:
name: docs
schema: public
configuration:
column_config:
created_at:
custom_name: createdAt
file_id:
custom_name: fileId
updated_at:
custom_name: updatedAt
user_id:
custom_name: userId
custom_column_names:
created_at: createdAt
file_id: fileId
updated_at: updatedAt
user_id: userId
custom_root_fields:
delete: deleteDocs
delete_by_pk: DeleteDoc
insert: insertDocs
insert_one: insertDoc
select: docs
select_aggregate: docsAggregate
select_by_pk: doc
update: updateDocs
update_by_pk: updateDoc
object_relationships:
- name: file
using:
foreign_key_constraint_on: file_id
- name: user
using:
foreign_key_constraint_on: user_id
array_relationships:
- name: docLinks
using:
foreign_key_constraint_on:
column: doc_id
table:
name: doc_links
schema: public
insert_permissions:
- permission:
check: {}
columns:
- file_id
- name
set:
user_id: x-hasura-user-id
role: user
select_permissions:
- permission:
columns:
- file_id
- id
filter: {}
limit: 0
role: public
- permission:
columns:
- name
- created_at
- updated_at
- file_id
- id
- user_id
filter:
user_id:
_eq: X-Hasura-User-Id
role: user

View File

@@ -0,0 +1,46 @@
table:
name: buckets
schema: storage
configuration:
column_config:
cache_control:
custom_name: cacheControl
created_at:
custom_name: createdAt
download_expiration:
custom_name: downloadExpiration
max_upload_file_size:
custom_name: maxUploadFileSize
min_upload_file_size:
custom_name: minUploadFileSize
presigned_urls_enabled:
custom_name: presignedUrlsEnabled
updated_at:
custom_name: updatedAt
custom_column_names:
cache_control: cacheControl
created_at: createdAt
download_expiration: downloadExpiration
max_upload_file_size: maxUploadFileSize
min_upload_file_size: minUploadFileSize
presigned_urls_enabled: presignedUrlsEnabled
updated_at: updatedAt
custom_name: buckets
custom_root_fields:
delete: deleteBuckets
delete_by_pk: deleteBucket
insert: insertBuckets
insert_one: insertBucket
select: buckets
select_aggregate: bucketsAggregate
select_by_pk: bucket
update: updateBuckets
update_by_pk: updateBucket
array_relationships:
- name: files
using:
foreign_key_constraint_on:
column: bucket_id
table:
name: files
schema: storage

View File

@@ -0,0 +1,45 @@
table:
name: files
schema: storage
configuration:
column_config:
bucket_id:
custom_name: bucketId
created_at:
custom_name: createdAt
etag:
custom_name: etag
is_uploaded:
custom_name: isUploaded
mime_type:
custom_name: mimeType
size:
custom_name: size
updated_at:
custom_name: updatedAt
uploaded_by_user_id:
custom_name: uploadedByUserId
custom_column_names:
bucket_id: bucketId
created_at: createdAt
etag: etag
is_uploaded: isUploaded
mime_type: mimeType
size: size
updated_at: updatedAt
uploaded_by_user_id: uploadedByUserId
custom_name: files
custom_root_fields:
delete: deleteFiles
delete_by_pk: deleteFile
insert: insertFiles
insert_one: insertFile
select: files
select_aggregate: filesAggregate
select_by_pk: file
update: updateFiles
update_by_pk: updateFile
object_relationships:
- name: bucket
using:
foreign_key_constraint_on: bucket_id

View File

@@ -0,0 +1,10 @@
- "!include auth_provider_requests.yaml"
- "!include auth_providers.yaml"
- "!include auth_refresh_tokens.yaml"
- "!include auth_roles.yaml"
- "!include auth_user_providers.yaml"
- "!include auth_user_roles.yaml"
- "!include auth_users.yaml"
- "!include public_customers.yaml"
- "!include storage_buckets.yaml"
- "!include storage_files.yaml"

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1 @@
version: 3

View File

@@ -0,0 +1 @@
DROP TABLE "public"."customers";

View File

@@ -0,0 +1 @@
CREATE TABLE "public"."customers" ("id" serial NOT NULL, "created_at" timestamptz NOT NULL DEFAULT now(), "name" text NOT NULL, PRIMARY KEY ("id") );

View File

@@ -0,0 +1,49 @@
{
"name": "@nhost-examples/codegen-react-apollo",
"version": "0.1.0",
"private": true,
"dependencies": {
"@apollo/client": "^3.6.9",
"@nhost/react": "*",
"@nhost/react-apollo": "*",
"graphql": "^16.5.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"scripts": {
"codegen": "graphql-codegen --config graphql.config.yaml --errors-only",
"dev": "vite",
"build": "vite build",
"preview": "vite preview --host localhost --port 3000"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@graphql-codegen/cli": "^2.6.2",
"@graphql-codegen/typescript-operations": "^2.4.2",
"@graphql-codegen/typescript-react-apollo": "^3.2.16",
"@types/node": "^16.7.13",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"eslint": "^8.0.0",
"eslint-config-react-app": "^7.0.1",
"typescript": "^4.4.2",
"vite": "^2.9.7"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

View File

@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:

View File

@@ -0,0 +1,25 @@
import { NewCustomer } from './components/new-customer'
import { Customers } from './components/customers'
import { NhostApolloProvider } from '@nhost/react-apollo'
import { nhost } from './utils/nhost'
import { NhostReactProvider } from '@nhost/react'
function App() {
return (
<NhostReactProvider nhost={nhost}>
<NhostApolloProvider nhost={nhost}>
<div>
<h1>GraphQL Code Generator example with React and Apollo</h1>
<div>
<NewCustomer />
</div>
<div>
<Customers />
</div>
</div>
</NhostApolloProvider>
</NhostReactProvider>
)
}
export default App

View File

@@ -0,0 +1,26 @@
import { useGetCustomersQuery } from '../utils/__generated__/graphql'
export function Customers() {
const { data, loading, error } = useGetCustomersQuery()
if (loading || !data) {
return <div>Loading</div>
}
if (error) {
return <div>Error</div>
}
const { customers } = data
return (
<div>
<h2>Customers</h2>
<ul>
{customers.map((customer) => (
<li key={customer.id}>{customer.name}</li>
))}
</ul>
</div>
)
}

View File

@@ -0,0 +1,55 @@
import { useState } from 'react'
import { refetchGetCustomersQuery, useInsertCustomerMutation } from '../utils/__generated__/graphql'
export function NewCustomer() {
const [name, setName] = useState('')
const [insertCustomer, { loading, error }] = useInsertCustomerMutation({
refetchQueries: [refetchGetCustomersQuery()]
})
const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {
e.preventDefault()
try {
await insertCustomer({
variables: {
customer: {
name
}
}
})
} catch (error) {
return console.error(error)
}
setName('')
alert('Customer added!')
}
return (
<div>
<h2>New Customer</h2>
<div>
<form onSubmit={handleSubmit}>
<div>
<input
type="text"
name="name"
placeholder="Name"
value={name}
onChange={(e) => setName(e.target.value)}
/>
</div>
{error && <div>Error: {error.message}</div>}
<div>
<button type="submit" disabled={loading}>
Add
</button>
</div>
</form>
</div>
</div>
)
}

View File

@@ -0,0 +1,12 @@
query GetCustomers {
customers {
id
name
}
}
mutation InsertCustomer($customer: customers_insert_input!) {
insert_customers_one(object: $customer) {
id
}
}

View File

@@ -0,0 +1,13 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}

View File

@@ -0,0 +1,11 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import './index.css'
import App from './App'
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
)

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/><circle cx="420.9" cy="296.5" r="45.7"/><path d="M520.5 78.1z"/></g></svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
import { NhostClient } from '@nhost/react'
const nhost = new NhostClient({
subdomain: 'localhost:1337'
})
export { nhost }

View File

@@ -0,0 +1,27 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"types": ["vite/client"]
},
"include": [
"src"
]
}

View File

@@ -0,0 +1,13 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
optimizeDeps: {
include: ['react/jsx-runtime'],
// * Shim: do not optimize @nhost/react when running this example in the Nhost monorepo
exclude: process.env.PNPM_PACKAGE_NAME === 'nhost-root' ? ['@nhost/react'] : []
},
plugins: [react()]
})

View File

@@ -20,8 +20,4 @@ The following endpoints are now exposed:
- `http://localhost:1337/v1/functions`: Functions
- `http://localhost:9090`: Traefik dashboad
- `http://localhost:8025`: Mailhog SMTP testing dashboard
## Limitations
This example does not implement the custom functions that are available on the cloud-hosted Nhost offer.
- `http://localhost:8025`: Mailhog SMTP testing dashboard

View File

@@ -5,7 +5,6 @@ import '@vue/runtime-core'
declare module '@vue/runtime-core' {
export interface GlobalComponents {
Counter: typeof import('./src/components/Counter.vue')['default']
Footer: typeof import('./src/components/Footer.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']

View File

@@ -1,5 +1,11 @@
# @nhost/apollo
## 0.5.21
### Patch Changes
- @nhost/nhost-js@1.4.5
## 0.5.20
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/apollo",
"version": "0.5.20",
"version": "0.5.21",
"description": "Nhost Apollo Client library",
"license": "MIT",
"keywords": [
@@ -49,6 +49,7 @@
"build:umd": "vite build --config ../../config/vite.lib.umd.config.js",
"test": "vitest run --config ../../config/vite.lib.config.js",
"test:watch": "vitest --config ../../config/vite.lib.config.js",
"test:coverage": "vitest run --coverage --config ../../config/vite.lib.config.js",
"prettier": "prettier --check src/",
"prettier:fix": "prettier --write src/",
"lint": "eslint . --ext .ts,.tsx",

View File

@@ -1,5 +1,12 @@
# @nhost/core
## 0.7.4
### Patch Changes
- 6eaa5c79: Return promise when using SMS OTP and an error occurs
Closes [#785](https://github.com/nhost/nhost/issues/785), thanks @franzwilhelm
## 0.7.3
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/core",
"version": "0.7.3",
"version": "0.7.4",
"description": "Nhost core client library",
"license": "MIT",
"keywords": [
@@ -48,6 +48,7 @@
"build:umd": "vite build --config ../../config/vite.lib.umd.config.js",
"test": "vitest run --config ../../config/vite.lib.config.js",
"test:watch": "vitest --config ../../config/vite.lib.config.js",
"test:coverage": "vitest run --coverage --config ../../config/vite.lib.config.js",
"prettier": "prettier --check src/",
"prettier:fix": "prettier --write src/",
"lint": "eslint . --ext .ts,.tsx",

View File

@@ -14,7 +14,7 @@ export const signInSmsPasswordlessOtpPromise = (
otp: string
) =>
new Promise<SignInSmsPasswordlessOtpHandlerResult>((resolve) => {
const { changed } = interpreter.send('PASSWORDLESS_SMS_OTP', { phoneNumber, otp })
const { changed } = interpreter.send({ type: 'PASSWORDLESS_SMS_OTP', phoneNumber, otp })
if (!changed) {
return resolve({
error: USER_ALREADY_SIGNED_IN,
@@ -33,7 +33,7 @@ export const signInSmsPasswordlessOtpPromise = (
user: state.context.user,
accessToken: state.context.accessToken.value
})
} else if (state.matches({ authentication: { signedOut: 'failed' } })) {
} else if (state.matches({ registration: { incomplete: 'failed' } })) {
resolve({
error: state.context.errors.authentication || null,
isError: true,

View File

@@ -17,6 +17,7 @@
"build": "pnpm clean && tsup",
"test": "vitest run --config ../../config/vite.lib.config.js",
"test:watch": "vitest --config ../../config/vite.lib.config.js",
"test:coverage": "vitest run --coverage --config ../../config/vite.lib.config.js",
"clean": "rimraf dist",
"format": "prettier --write 'src/**/*.ts'",
"lint": "eslint . --ext .ts,.tsx"

View File

@@ -1,5 +1,12 @@
# @nhost/hasura-auth-js
## 1.3.3
### Patch Changes
- Updated dependencies [6eaa5c79]
- @nhost/core@0.7.4
## 1.3.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/hasura-auth-js",
"version": "1.3.2",
"version": "1.3.3",
"description": "Hasura-auth client",
"license": "MIT",
"keywords": [
@@ -49,6 +49,7 @@
"ci:test": "vitest run",
"e2e:backend": "nhost dev --no-browser",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"prettier": "prettier --check src/",
"prettier:fix": "prettier --write src/",
"lint": "eslint . --ext .ts,.tsx",

View File

@@ -1,5 +1,12 @@
# @nhost/hasura-storage-js
## 0.5.1
### Patch Changes
- Updated dependencies [6eaa5c79]
- @nhost/core@0.7.4
## 0.5.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/hasura-storage-js",
"version": "0.5.0",
"version": "0.5.1",
"description": "Hasura-storage client",
"license": "MIT",
"keywords": [
@@ -45,6 +45,7 @@
"build:umd": "vite build --config ../../config/vite.lib.umd.config.js",
"test": "vitest run --config ../../config/vite.lib.config.js",
"test:watch": "vitest --config ../../config/vite.lib.config.js",
"test:coverage": "vitest run --coverage --config ../../config/vite.lib.config.js",
"prettier": "prettier --check src/",
"prettier:fix": "prettier --write src/",
"lint": "eslint . --ext .ts,.tsx",

View File

@@ -1,5 +1,14 @@
# @nhost/nextjs
## 1.6.1
### Patch Changes
- Updated dependencies [6eaa5c79]
- @nhost/core@0.7.4
- @nhost/react@0.11.1
- @nhost/nhost-js@1.4.5
## 1.6.0
### Patch Changes

View File

@@ -27,6 +27,7 @@ npm install @nhost/react @nhost/nextjs graphql
# With Yarn
yarn add @nhost/react @nhost/nextjs graphql
```
## Initializing
Initialize a single `nhost` instance and wrap your app with the `NhostNextProvider`.
@@ -37,7 +38,8 @@ import type { AppProps } from 'next/app'
import { NhostClient, NhostNextProvider } from '@nhost/nextjs'
const nhost = new NhostClient({
backendUrl: '<Your Nhost Backend URL>'
subdomain: '<Your Nhost app subdomain>',
region: '<Your Nhost app region>'
})
function MyApp({ Component, pageProps }: AppProps) {
@@ -122,7 +124,8 @@ import { NhostClient, NhostNextProvider } from '@nhost/nextjs'
import { NhostApolloProvider } from '@nhost/react-apollo'
const nhost = new NhostClient({
backendUrl: '<Your Nhost Backend URL>'
subdomain: '<Your Nhost app subdomain>',
region: '<Your Nhost app region>'
})
function MyApp({ Component, pageProps }: AppProps) {

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/nextjs",
"version": "1.6.0",
"version": "1.6.1",
"description": "Nhost NextJS library",
"license": "MIT",
"keywords": [
@@ -51,6 +51,7 @@
"build:umd": "vite build --config ../../config/vite.react.umd.config.js",
"test": "vitest run --config ../../config/vite.react.config.js",
"test:watch": "vitest --config ../../config/vite.react.config.js",
"test:coverage": "vitest run --coverage --config ../../config/vite.lib.config.js",
"prettier": "prettier --check src/",
"prettier:fix": "prettier --write src/",
"lint": "eslint . --ext .ts,.tsx",

View File

@@ -1,5 +1,12 @@
# @nhost/nhost-js
## 1.4.5
### Patch Changes
- @nhost/hasura-auth-js@1.3.3
- @nhost/hasura-storage-js@0.5.1
## 1.4.4
### Patch Changes

View File

@@ -28,7 +28,8 @@ yarn add @nhost/nhost-js
import { NhostClient } from '@nhost/nhost-js'
const nhost = new NhostClient({
backendUrl: 'https://subdomain.nhost.run'
subdomain: '<Your Nhost app subdomain>',
region: '<Your Nhost app region>'
})
```
@@ -49,4 +50,3 @@ Access Nhost Storage methods using `nhost.storage`.
### Functions
Access Nhost Functions methods via `nhost.functions`.

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/nhost-js",
"version": "1.4.4",
"version": "1.4.5",
"description": "Nhost JavaScript SDK",
"license": "MIT",
"keywords": [
@@ -50,6 +50,7 @@
"ci:test": "vitest run --config ../../config/vite.lib.config.js",
"e2e:backend": "nhost dev --no-browser",
"test:watch": "vitest --config ../../config/vite.lib.config.js",
"test:coverage": "vitest run --coverage --config ../../config/vite.lib.config.js",
"prettier": "prettier --check src/",
"prettier:fix": "prettier --write src/",
"lint": "eslint . --ext .ts,.tsx",

View File

@@ -2,10 +2,8 @@ import { describe, expect, it } from 'vitest'
import { NhostClient } from '../src'
const BACKEND_URL = 'http://localhost:1337'
const nhost = new NhostClient({
backendUrl: BACKEND_URL
subdomain: 'localhost:1337'
})
type User = { id: string; displayName: string }

View File

@@ -1,5 +1,12 @@
# @nhost/react-apollo
## 4.6.1
### Patch Changes
- @nhost/react@0.11.1
- @nhost/apollo@0.5.21
## 4.6.0
### Patch Changes

View File

@@ -9,7 +9,6 @@
</a>
</p>
## Documentation
[Reference documentation](https://docs.nhost.io/reference/react/apollo)
@@ -33,7 +32,8 @@ import { NhostApolloProvider } from '@nhost/react-apollo'
import App from './App'
const nhost = new NhostClient({
backendUrl: 'https://[app-subdomain].nhost.run'
subdomain: '<Your Nhost app subdomain>',
region: '<Your Nhost app region>'
})
ReactDOM.render(
@@ -47,4 +47,3 @@ ReactDOM.render(
document.getElementById('root')
)
```

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react-apollo",
"version": "4.6.0",
"version": "4.6.1",
"description": "Nhost React Apollo client",
"license": "MIT",
"keywords": [
@@ -50,6 +50,7 @@
"build:umd": "vite build --config ../../config/vite.react.umd.config.js",
"test": "vitest run --config ../../config/vite.react.config.js",
"test:watch": "vitest --config ../../config/vite.react.config.js",
"test:coverage": "vitest run --coverage --config ../../config/vite.lib.config.js",
"prettier": "prettier --check src/",
"prettier:fix": "prettier --write src/",
"lint": "eslint . --ext .ts,.tsx",

View File

@@ -1,5 +1,12 @@
# @nhost/react-auth
## 3.4.1
### Patch Changes
- @nhost/hasura-auth-js@1.3.3
- @nhost/react@0.11.1
## 3.4.0
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react-auth",
"version": "3.4.0",
"version": "3.4.1",
"description": "Nhost React client",
"license": "MIT",
"keywords": [
@@ -49,6 +49,7 @@
"build:umd": "vite build --config ../../config/vite.react.umd.config.js",
"test": "vitest run --config ../../config/vite.react.config.js",
"test:watch": "vitest --config ../../config/vite.react.config.js",
"test:coverage": "vitest run --coverage --config ../../config/vite.lib.config.js",
"prettier": "prettier --check src/",
"prettier:fix": "prettier --write src/",
"lint": "eslint . --ext .ts,.tsx",

View File

@@ -1,5 +1,14 @@
# @nhost/react
## 0.11.1
### Patch Changes
- Updated dependencies [6eaa5c79]
- @nhost/core@0.7.4
- @nhost/hasura-storage-js@0.5.1
- @nhost/nhost-js@1.4.5
## 0.11.0
### Minor Changes

View File

@@ -18,6 +18,7 @@ npm install @nhost/react graphql
# With Yarm
yarn add @nhost/react graphql
```
## Initialise
Initialize a single `nhost` instance and wrap your app with the `NhostReactProvider`.
@@ -31,7 +32,8 @@ import { NhostClient, NhostReactProvider } from '@nhost/react'
import App from './App'
const nhost = new NhostClient({
backendUrl: '<Your Nhost Backend URL>'
subdomain: '<Your Nhost app subdomain>',
region: '<Your Nhost app region>'
})
ReactDOM.render(
@@ -42,4 +44,4 @@ ReactDOM.render(
</React.StrictMode>,
document.getElementById('root')
)
```
```

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react",
"version": "0.11.0",
"version": "0.11.1",
"description": "Nhost React library",
"license": "MIT",
"keywords": [
@@ -49,6 +49,7 @@
"build:umd": "vite build --config ../../config/vite.react.umd.config.js",
"test": "vitest run --config ../../config/vite.react.config.js",
"test:watch": "vitest --config ../../config/vite.react.config.js",
"test:coverage": "vitest run --coverage --config ../../config/vite.lib.config.js",
"prettier": "prettier --check src/",
"prettier:fix": "prettier --write src/",
"lint": "eslint . --ext .ts,.tsx",

View File

@@ -1,5 +1,13 @@
# @nhost/vue
## 0.3.5
### Patch Changes
- Updated dependencies [6eaa5c79]
- @nhost/core@0.7.4
- @nhost/nhost-js@1.4.5
## 0.3.4
### Patch Changes

Some files were not shown because too many files have changed in this diff Show More