Compare commits
14 Commits
@nhost/das
...
@nhost/rea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1d9b472d1 | ||
|
|
c6dc7f44df | ||
|
|
3cea460c36 | ||
|
|
4c351714f5 | ||
|
|
3143d66a8e | ||
|
|
8512a7f181 | ||
|
|
e503b8fe8b | ||
|
|
304065ae22 | ||
|
|
68e0622eb0 | ||
|
|
70c6834636 | ||
|
|
a7bde37bba | ||
|
|
1bc615beca | ||
|
|
a58c5cfc96 | ||
|
|
c61228e45d |
@@ -1,5 +1,31 @@
|
|||||||
# @nhost/dashboard
|
# @nhost/dashboard
|
||||||
|
|
||||||
|
## 1.15.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/react-apollo@11.0.4
|
||||||
|
- @nhost/nextjs@2.1.13
|
||||||
|
|
||||||
|
## 1.15.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/react-apollo@11.0.3
|
||||||
|
- @nhost/nextjs@2.1.12
|
||||||
|
|
||||||
|
## 1.15.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- a7bde37: feat: send metadata in the edit form
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 1bc615b: feat: improve error message handling in `ErrorToast` component
|
||||||
|
- @nhost/react-apollo@11.0.2
|
||||||
|
- @nhost/nextjs@2.1.11
|
||||||
|
|
||||||
## 1.14.0
|
## 1.14.0
|
||||||
|
|
||||||
### Minor Changes
|
### Minor Changes
|
||||||
|
|||||||
2
dashboard/e2e/e2e-tests-project/.gitignore
vendored
Normal file
2
dashboard/e2e/e2e-tests-project/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
.secrets
|
||||||
|
.nhost
|
||||||
1
dashboard/e2e/e2e-tests-project/nhost/config.yaml
Normal file
1
dashboard/e2e/e2e-tests-project/nhost/config.yaml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
version: 3
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<h2>Потвърдете смяната на вашия имейл</h2>
|
||||||
|
<p>Използвайте посочения линк, за да повърдите смяната на имейл:</p>
|
||||||
|
<p>
|
||||||
|
<a href="${link}">
|
||||||
|
Смени имейл
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Потвърждение за смяна на имейл
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<h2>Потвърдете вашия имейл</h2>
|
||||||
|
<p>Използвайте посочения линк, за да потвърдите вашия имейл:</p>
|
||||||
|
<p>
|
||||||
|
<a href="${link}">
|
||||||
|
Потвърдете имейл
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Потвърждаване на имейл
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<h2>Смяна на парола</h2>
|
||||||
|
<p>Използвайте посочения линк, за да смените вашата парола:</p>
|
||||||
|
<p>
|
||||||
|
<a href="${link}">
|
||||||
|
Смяна на парола
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Смяна на парола
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Вашият код е ${code}.
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<h2>Магически линк за вход</h2>
|
||||||
|
<p>Използвайте посочения линк за защитен и бърз вход:</p>
|
||||||
|
<p>
|
||||||
|
<a href="${link}">
|
||||||
|
Вход
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Магически линк за вход
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<h2>Potvrzení změny emailové adresy</h2>
|
||||||
|
<p>Použijte tento odkaz k potvrzení změny emailové adresy:</p>
|
||||||
|
<p>
|
||||||
|
<a href="${link}">
|
||||||
|
Změnit email
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Změna vaší emailové adresy
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<h2>Ověření emailové adresy</h2>
|
||||||
|
<p>Použijte tento odkaz k ověření vaší emailové adresy:</p>
|
||||||
|
<p>
|
||||||
|
<a href="${link}">
|
||||||
|
Ověřit emailovou adresu
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Ověření vaší emailové adresy
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<h2>Obnova hesla</h2>
|
||||||
|
<p>Použijte tento odkaz k obnovení vašeho hesla:</p>
|
||||||
|
<p>
|
||||||
|
<a href="${link}">
|
||||||
|
Obnova hesla
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Obnova hesla
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Váš kód je ${code}.
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<h2>Magický odkaz</h2>
|
||||||
|
<p>Použijte tento odkaz k bezpečnému přihlášení:</p>
|
||||||
|
<p>
|
||||||
|
<a href="${link}">
|
||||||
|
Přihlášení
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Bezpečný odkaz k přihlášení
|
||||||
@@ -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>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Change your email address
|
||||||
@@ -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>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Verify your email
|
||||||
@@ -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>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Reset your password
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Your code is ${code}.
|
||||||
@@ -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>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Secure sign-in link
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<h2>Confirmar cambio de correo electrónico</h2>
|
||||||
|
<p>Utiliza el siguiente enlace para confirmar el cambio de correo:</p>
|
||||||
|
<p>
|
||||||
|
<a href="${link}">
|
||||||
|
Cambiar correo electrónico
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Cambiar dirección de correo electrónico
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<h2>Verificar correo electrónico</h2>
|
||||||
|
<p>Utilza el siguiente enlace para verificar tu correo:</p>
|
||||||
|
<p>
|
||||||
|
<a href="${link}">
|
||||||
|
Verificar correo electrónico
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Verifica tu correo electrónico
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<h2>Recuperar contraseña</h2>
|
||||||
|
<p>Utiliza el siguiente enlace para recuperar tu contraseña:</p>
|
||||||
|
<p>
|
||||||
|
<a href="${link}">
|
||||||
|
Recuperar contraseña
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Recuperar contraseña
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Tu código es ${code}.
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<h2>Enlace mágico</h2>
|
||||||
|
<p>Utiliza este enlace para iniciar sesión de forma segura:</p>
|
||||||
|
<p>
|
||||||
|
<a href="${link}">
|
||||||
|
Iniciar sesión
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Enlace de acceso seguro
|
||||||
@@ -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>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Changez votre adresse courriel
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<h2>Vérifiez votre courriel</h2>
|
||||||
|
<p>Utilisez ce lien pour vérifier votre courriel :</p>
|
||||||
|
<p>
|
||||||
|
<a href="${link}">
|
||||||
|
Vérifier courriel
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Vérifier votre courriel
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<h2>Réinitialiser votre mot de passe</h2>
|
||||||
|
<p>Utilisez ce lien pour réinitialiser votre mot de passe :</p>
|
||||||
|
<p>
|
||||||
|
<a href="${link}">
|
||||||
|
Réinitialiser mot de passe
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Réinitialiser votre mot de passe
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Votre code est ${code}.
|
||||||
@@ -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çon sécurisée :</p>
|
||||||
|
<p>
|
||||||
|
<a href="${link}">
|
||||||
|
Connexion
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Lien de connexion sécurisé
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
${link},
|
||||||
|
${displayName},
|
||||||
|
${email},
|
||||||
|
${ticket},
|
||||||
|
${redirectTo},
|
||||||
|
${serverUrl},
|
||||||
|
${clientUrl},
|
||||||
|
${locale},
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
${link}, ${displayName}, ${email}, ${ticket}, ${redirectTo}, ${serverUrl}, ${clientUrl}, ${locale}
|
||||||
151
dashboard/e2e/e2e-tests-project/nhost/nhost.toml
Normal file
151
dashboard/e2e/e2e-tests-project/nhost/nhost.toml
Normal file
@@ -0,0 +1,151 @@
|
|||||||
|
[global]
|
||||||
|
|
||||||
|
[hasura]
|
||||||
|
version = 'v2.33.4-ce'
|
||||||
|
adminSecret = '{{ secrets.HASURA_GRAPHQL_ADMIN_SECRET }}'
|
||||||
|
webhookSecret = '{{ secrets.NHOST_WEBHOOK_SECRET }}'
|
||||||
|
|
||||||
|
[[hasura.jwtSecrets]]
|
||||||
|
type = 'HS256'
|
||||||
|
key = '{{ secrets.HASURA_GRAPHQL_JWT_SECRET }}'
|
||||||
|
|
||||||
|
[hasura.settings]
|
||||||
|
corsDomain = ['*']
|
||||||
|
devMode = true
|
||||||
|
enableAllowList = false
|
||||||
|
enableConsole = true
|
||||||
|
enableRemoteSchemaPermissions = false
|
||||||
|
enabledAPIs = ['metadata', 'graphql', 'pgdump', 'config']
|
||||||
|
liveQueriesMultiplexedRefetchInterval = 1000
|
||||||
|
stringifyNumericTypes = false
|
||||||
|
|
||||||
|
[hasura.logs]
|
||||||
|
level = 'warn'
|
||||||
|
|
||||||
|
[hasura.events]
|
||||||
|
httpPoolSize = 100
|
||||||
|
|
||||||
|
[functions]
|
||||||
|
[functions.node]
|
||||||
|
version = 18
|
||||||
|
|
||||||
|
[auth]
|
||||||
|
version = '0.24.1'
|
||||||
|
|
||||||
|
[auth.elevatedPrivileges]
|
||||||
|
mode = 'disabled'
|
||||||
|
|
||||||
|
[auth.redirections]
|
||||||
|
clientUrl = 'http://localhost:3000'
|
||||||
|
|
||||||
|
[auth.signUp]
|
||||||
|
enabled = true
|
||||||
|
disableNewUsers = false
|
||||||
|
|
||||||
|
[auth.user]
|
||||||
|
[auth.user.roles]
|
||||||
|
default = 'user'
|
||||||
|
allowed = ['user', 'me']
|
||||||
|
|
||||||
|
[auth.user.locale]
|
||||||
|
default = 'en'
|
||||||
|
allowed = ['en']
|
||||||
|
|
||||||
|
[auth.user.gravatar]
|
||||||
|
enabled = true
|
||||||
|
default = 'blank'
|
||||||
|
rating = 'g'
|
||||||
|
|
||||||
|
[auth.user.email]
|
||||||
|
|
||||||
|
[auth.user.emailDomains]
|
||||||
|
|
||||||
|
[auth.session]
|
||||||
|
[auth.session.accessToken]
|
||||||
|
expiresIn = 900
|
||||||
|
|
||||||
|
[auth.session.refreshToken]
|
||||||
|
expiresIn = 2592000
|
||||||
|
|
||||||
|
[auth.method]
|
||||||
|
[auth.method.anonymous]
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
[auth.method.emailPasswordless]
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
[auth.method.emailPassword]
|
||||||
|
hibpEnabled = false
|
||||||
|
emailVerificationRequired = true
|
||||||
|
passwordMinLength = 9
|
||||||
|
|
||||||
|
[auth.method.smsPasswordless]
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
[auth.method.oauth]
|
||||||
|
[auth.method.oauth.apple]
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
[auth.method.oauth.azuread]
|
||||||
|
tenant = 'common'
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
[auth.method.oauth.bitbucket]
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
[auth.method.oauth.discord]
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
[auth.method.oauth.facebook]
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
[auth.method.oauth.github]
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
[auth.method.oauth.gitlab]
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
[auth.method.oauth.google]
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
[auth.method.oauth.linkedin]
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
[auth.method.oauth.spotify]
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
[auth.method.oauth.strava]
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
[auth.method.oauth.twitch]
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
[auth.method.oauth.twitter]
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
[auth.method.oauth.windowslive]
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
[auth.method.oauth.workos]
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
[auth.method.webauthn]
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
[auth.method.webauthn.attestation]
|
||||||
|
timeout = 60000
|
||||||
|
|
||||||
|
[auth.totp]
|
||||||
|
enabled = false
|
||||||
|
|
||||||
|
[postgres]
|
||||||
|
version = '14.6-20240129-1'
|
||||||
|
|
||||||
|
[provider]
|
||||||
|
|
||||||
|
[storage]
|
||||||
|
version = '0.6.0'
|
||||||
|
|
||||||
|
[observability]
|
||||||
|
[observability.grafana]
|
||||||
|
adminPassword = '{{ secrets.GRAFANA_ADMIN_PASSWORD }}'
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/dashboard",
|
"name": "@nhost/dashboard",
|
||||||
"version": "1.14.0",
|
"version": "1.15.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"preinstall": "npx only-allow pnpm",
|
"preinstall": "npx only-allow pnpm",
|
||||||
|
|||||||
@@ -29,10 +29,10 @@ const getInternalErrorMessage = (
|
|||||||
|
|
||||||
if (error.name === 'ApolloError') {
|
if (error.name === 'ApolloError') {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const internalError = error.graphQLErrors?.[0]?.extensions?.internal as {
|
const graphqlError = error.graphQLErrors?.[0];
|
||||||
error: { message: string };
|
const graphqlExtensionsError = graphqlError?.extensions?.internal
|
||||||
};
|
?.error as { message: string };
|
||||||
return internalError?.error?.message || null;
|
return graphqlError.message || graphqlExtensionsError?.message || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error instanceof Error) {
|
if (error instanceof Error) {
|
||||||
|
|||||||
@@ -31,9 +31,10 @@ import { yupResolver } from '@hookform/resolvers/yup';
|
|||||||
import { useTheme } from '@mui/material';
|
import { useTheme } from '@mui/material';
|
||||||
import { format } from 'date-fns';
|
import { format } from 'date-fns';
|
||||||
import kebabCase from 'just-kebab-case';
|
import kebabCase from 'just-kebab-case';
|
||||||
|
import debounce from 'lodash.debounce';
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
import type { RemoteAppUser } from 'pages/[workspaceSlug]/[appSlug]/users';
|
import type { RemoteAppUser } from 'pages/[workspaceSlug]/[appSlug]/users';
|
||||||
import { useEffect, useState } from 'react';
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
import { FormProvider, useForm } from 'react-hook-form';
|
import { FormProvider, useForm } from 'react-hook-form';
|
||||||
import * as Yup from 'yup';
|
import * as Yup from 'yup';
|
||||||
|
|
||||||
@@ -76,6 +77,21 @@ export const EditUserFormValidationSchema = Yup.object({
|
|||||||
locale: Yup.string(),
|
locale: Yup.string(),
|
||||||
defaultRole: Yup.string(),
|
defaultRole: Yup.string(),
|
||||||
roles: Yup.array().of(Yup.boolean()),
|
roles: Yup.array().of(Yup.boolean()),
|
||||||
|
metadata: Yup.string().test(
|
||||||
|
'is-valid-json',
|
||||||
|
'Metadata must be valid JSON or empty',
|
||||||
|
(value) => {
|
||||||
|
if (value === '') {
|
||||||
|
return true;
|
||||||
|
} // Allow empty string as valid input
|
||||||
|
try {
|
||||||
|
JSON.parse(value);
|
||||||
|
return true;
|
||||||
|
} catch (error) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
});
|
});
|
||||||
|
|
||||||
export type EditUserFormValues = Yup.InferType<
|
export type EditUserFormValues = Yup.InferType<
|
||||||
@@ -116,14 +132,55 @@ export default function EditUserForm({
|
|||||||
locale: user.locale,
|
locale: user.locale,
|
||||||
defaultRole: user.defaultRole,
|
defaultRole: user.defaultRole,
|
||||||
roles: roles.map((role) => Object.values(role)[0]),
|
roles: roles.map((role) => Object.values(role)[0]),
|
||||||
|
metadata: user?.metadata ? JSON.stringify(user.metadata, null, 2) : '',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const {
|
const {
|
||||||
register,
|
register,
|
||||||
|
setError,
|
||||||
|
clearErrors,
|
||||||
formState: { errors, dirtyFields, isSubmitting, isValidating },
|
formState: { errors, dirtyFields, isSubmitting, isValidating },
|
||||||
} = form;
|
} = form;
|
||||||
|
|
||||||
|
const handleMetadataError = useMemo(() => {
|
||||||
|
const debouncedSetError = debounce((value) => {
|
||||||
|
try {
|
||||||
|
JSON.parse(value);
|
||||||
|
// Only set an error if JSON parsing fails
|
||||||
|
} catch (error) {
|
||||||
|
setError('metadata', {
|
||||||
|
type: 'manual',
|
||||||
|
message: 'Invalid JSON format',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, 500);
|
||||||
|
|
||||||
|
return {
|
||||||
|
call: debouncedSetError,
|
||||||
|
cancel: debouncedSetError.cancel, // lodash debounce provides a cancel method to stop the delayed function
|
||||||
|
};
|
||||||
|
}, [setError]);
|
||||||
|
|
||||||
|
const handleMetadataChange = useCallback(
|
||||||
|
(event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
const { value } = event.target;
|
||||||
|
if (value === '') {
|
||||||
|
clearErrors('metadata'); // Clear errors when the input is explicitly cleared
|
||||||
|
handleMetadataError.cancel(); // Cancel any debounced error checks
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
JSON.parse(value);
|
||||||
|
clearErrors('metadata'); // Clear errors when valid JSON is entered
|
||||||
|
handleMetadataError.cancel(); // Cancel pending debounced error checks
|
||||||
|
} catch (error) {
|
||||||
|
handleMetadataError.call(value); // Call the debounced error setter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[clearErrors, handleMetadataError],
|
||||||
|
);
|
||||||
|
|
||||||
const isDirty = Object.keys(dirtyFields).length > 0;
|
const isDirty = Object.keys(dirtyFields).length > 0;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -467,6 +524,28 @@ export default function EditUserForm({
|
|||||||
</div>
|
</div>
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
|
<Box component="section" className="grid grid-flow-row gap-8 p-6">
|
||||||
|
<Input
|
||||||
|
{...register('metadata', { onChange: handleMetadataChange })}
|
||||||
|
id="metadata"
|
||||||
|
label="Metadata"
|
||||||
|
variant="inline"
|
||||||
|
hideEmptyHelperText
|
||||||
|
error={!!errors.metadata}
|
||||||
|
fullWidth
|
||||||
|
multiline
|
||||||
|
inputProps={{
|
||||||
|
className: 'resize-y min-h-[130px]',
|
||||||
|
}}
|
||||||
|
helperText={
|
||||||
|
errors.metadata
|
||||||
|
? errors.metadata.message
|
||||||
|
: 'Enter valid JSON. This can be a number, boolean, array, or object.'
|
||||||
|
}
|
||||||
|
maxRows={100}
|
||||||
|
autoComplete="off"
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<Box className="grid w-full flex-shrink-0 snap-end grid-flow-col justify-between gap-3 place-self-end border-t-1 p-2">
|
<Box className="grid w-full flex-shrink-0 snap-end grid-flow-col justify-between gap-3 place-self-end border-t-1 p-2">
|
||||||
|
|||||||
@@ -113,6 +113,9 @@ export default function UsersBody({ users, onSubmit }: UsersBodyProps) {
|
|||||||
phoneNumber: values.phoneNumber,
|
phoneNumber: values.phoneNumber,
|
||||||
phoneNumberVerified: values.phoneNumberVerified,
|
phoneNumberVerified: values.phoneNumberVerified,
|
||||||
locale: values.locale,
|
locale: values.locale,
|
||||||
|
...(values?.metadata !== undefined && values.metadata !== ''
|
||||||
|
? { metadata: JSON.parse(values.metadata) }
|
||||||
|
: { metadata: null }),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ fragment RemoteAppGetUsers on users {
|
|||||||
defaultRole
|
defaultRole
|
||||||
lastSeen
|
lastSeen
|
||||||
locale
|
locale
|
||||||
|
metadata
|
||||||
roles {
|
roles {
|
||||||
id
|
id
|
||||||
role
|
role
|
||||||
|
|||||||
35
dashboard/src/utils/__generated__/graphql.ts
generated
35
dashboard/src/utils/__generated__/graphql.ts
generated
@@ -2524,6 +2524,7 @@ export type ConfigSystemConfigPostgres = {
|
|||||||
__typename?: 'ConfigSystemConfigPostgres';
|
__typename?: 'ConfigSystemConfigPostgres';
|
||||||
connectionString: ConfigSystemConfigPostgresConnectionString;
|
connectionString: ConfigSystemConfigPostgresConnectionString;
|
||||||
database: Scalars['String'];
|
database: Scalars['String'];
|
||||||
|
disk?: Maybe<ConfigSystemConfigPostgresDisk>;
|
||||||
enabled?: Maybe<Scalars['Boolean']>;
|
enabled?: Maybe<Scalars['Boolean']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -2533,6 +2534,7 @@ export type ConfigSystemConfigPostgresComparisonExp = {
|
|||||||
_or?: InputMaybe<Array<ConfigSystemConfigPostgresComparisonExp>>;
|
_or?: InputMaybe<Array<ConfigSystemConfigPostgresComparisonExp>>;
|
||||||
connectionString?: InputMaybe<ConfigSystemConfigPostgresConnectionStringComparisonExp>;
|
connectionString?: InputMaybe<ConfigSystemConfigPostgresConnectionStringComparisonExp>;
|
||||||
database?: InputMaybe<ConfigStringComparisonExp>;
|
database?: InputMaybe<ConfigStringComparisonExp>;
|
||||||
|
disk?: InputMaybe<ConfigSystemConfigPostgresDiskComparisonExp>;
|
||||||
enabled?: InputMaybe<ConfigBooleanComparisonExp>;
|
enabled?: InputMaybe<ConfigBooleanComparisonExp>;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -2568,15 +2570,41 @@ export type ConfigSystemConfigPostgresConnectionStringUpdateInput = {
|
|||||||
storage?: InputMaybe<Scalars['String']>;
|
storage?: InputMaybe<Scalars['String']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type ConfigSystemConfigPostgresDisk = {
|
||||||
|
__typename?: 'ConfigSystemConfigPostgresDisk';
|
||||||
|
iops?: Maybe<Scalars['ConfigUint32']>;
|
||||||
|
tput?: Maybe<Scalars['ConfigUint32']>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ConfigSystemConfigPostgresDiskComparisonExp = {
|
||||||
|
_and?: InputMaybe<Array<ConfigSystemConfigPostgresDiskComparisonExp>>;
|
||||||
|
_not?: InputMaybe<ConfigSystemConfigPostgresDiskComparisonExp>;
|
||||||
|
_or?: InputMaybe<Array<ConfigSystemConfigPostgresDiskComparisonExp>>;
|
||||||
|
iops?: InputMaybe<ConfigUint32ComparisonExp>;
|
||||||
|
tput?: InputMaybe<ConfigUint32ComparisonExp>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ConfigSystemConfigPostgresDiskInsertInput = {
|
||||||
|
iops?: InputMaybe<Scalars['ConfigUint32']>;
|
||||||
|
tput?: InputMaybe<Scalars['ConfigUint32']>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ConfigSystemConfigPostgresDiskUpdateInput = {
|
||||||
|
iops?: InputMaybe<Scalars['ConfigUint32']>;
|
||||||
|
tput?: InputMaybe<Scalars['ConfigUint32']>;
|
||||||
|
};
|
||||||
|
|
||||||
export type ConfigSystemConfigPostgresInsertInput = {
|
export type ConfigSystemConfigPostgresInsertInput = {
|
||||||
connectionString: ConfigSystemConfigPostgresConnectionStringInsertInput;
|
connectionString: ConfigSystemConfigPostgresConnectionStringInsertInput;
|
||||||
database: Scalars['String'];
|
database: Scalars['String'];
|
||||||
|
disk?: InputMaybe<ConfigSystemConfigPostgresDiskInsertInput>;
|
||||||
enabled?: InputMaybe<Scalars['Boolean']>;
|
enabled?: InputMaybe<Scalars['Boolean']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ConfigSystemConfigPostgresUpdateInput = {
|
export type ConfigSystemConfigPostgresUpdateInput = {
|
||||||
connectionString?: InputMaybe<ConfigSystemConfigPostgresConnectionStringUpdateInput>;
|
connectionString?: InputMaybe<ConfigSystemConfigPostgresConnectionStringUpdateInput>;
|
||||||
database?: InputMaybe<Scalars['String']>;
|
database?: InputMaybe<Scalars['String']>;
|
||||||
|
disk?: InputMaybe<ConfigSystemConfigPostgresDiskUpdateInput>;
|
||||||
enabled?: InputMaybe<Scalars['Boolean']>;
|
enabled?: InputMaybe<Scalars['Boolean']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -23098,7 +23126,7 @@ export type GetRemoteAppMetricsQueryVariables = Exact<{ [key: string]: never; }>
|
|||||||
|
|
||||||
export type GetRemoteAppMetricsQuery = { __typename?: 'query_root', filesAggregate: { __typename?: 'files_aggregate', aggregate?: { __typename?: 'files_aggregate_fields', count: number, sum?: { __typename?: 'files_sum_fields', size?: number | null } | null } | null }, usersAggregate: { __typename?: 'users_aggregate', aggregate?: { __typename?: 'users_aggregate_fields', count: number } | null } };
|
export type GetRemoteAppMetricsQuery = { __typename?: 'query_root', filesAggregate: { __typename?: 'files_aggregate', aggregate?: { __typename?: 'files_aggregate_fields', count: number, sum?: { __typename?: 'files_sum_fields', size?: number | null } | null } | null }, usersAggregate: { __typename?: 'users_aggregate', aggregate?: { __typename?: 'users_aggregate_fields', count: number } | null } };
|
||||||
|
|
||||||
export type RemoteAppGetUsersFragment = { __typename?: 'users', id: any, createdAt: any, displayName: string, avatarUrl: string, email?: any | null, emailVerified: boolean, phoneNumber?: string | null, phoneNumberVerified: boolean, disabled: boolean, defaultRole: string, lastSeen?: any | null, locale: string, roles: Array<{ __typename?: 'authUserRoles', id: any, role: string }>, userProviders: Array<{ __typename?: 'authUserProviders', id: any, providerId: string }> };
|
export type RemoteAppGetUsersFragment = { __typename?: 'users', id: any, createdAt: any, displayName: string, avatarUrl: string, email?: any | null, emailVerified: boolean, phoneNumber?: string | null, phoneNumberVerified: boolean, disabled: boolean, defaultRole: string, lastSeen?: any | null, locale: string, metadata?: any | null, roles: Array<{ __typename?: 'authUserRoles', id: any, role: string }>, userProviders: Array<{ __typename?: 'authUserProviders', id: any, providerId: string }> };
|
||||||
|
|
||||||
export type RemoteAppGetUsersQueryVariables = Exact<{
|
export type RemoteAppGetUsersQueryVariables = Exact<{
|
||||||
where: Users_Bool_Exp;
|
where: Users_Bool_Exp;
|
||||||
@@ -23107,7 +23135,7 @@ export type RemoteAppGetUsersQueryVariables = Exact<{
|
|||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
|
||||||
export type RemoteAppGetUsersQuery = { __typename?: 'query_root', users: Array<{ __typename?: 'users', id: any, createdAt: any, displayName: string, avatarUrl: string, email?: any | null, emailVerified: boolean, phoneNumber?: string | null, phoneNumberVerified: boolean, disabled: boolean, defaultRole: string, lastSeen?: any | null, locale: string, roles: Array<{ __typename?: 'authUserRoles', id: any, role: string }>, userProviders: Array<{ __typename?: 'authUserProviders', id: any, providerId: string }> }>, filteredUsersAggreggate: { __typename?: 'users_aggregate', aggregate?: { __typename?: 'users_aggregate_fields', count: number } | null }, usersAggregate: { __typename?: 'users_aggregate', aggregate?: { __typename?: 'users_aggregate_fields', count: number } | null } };
|
export type RemoteAppGetUsersQuery = { __typename?: 'query_root', users: Array<{ __typename?: 'users', id: any, createdAt: any, displayName: string, avatarUrl: string, email?: any | null, emailVerified: boolean, phoneNumber?: string | null, phoneNumberVerified: boolean, disabled: boolean, defaultRole: string, lastSeen?: any | null, locale: string, metadata?: any | null, roles: Array<{ __typename?: 'authUserRoles', id: any, role: string }>, userProviders: Array<{ __typename?: 'authUserProviders', id: any, providerId: string }> }>, filteredUsersAggreggate: { __typename?: 'users_aggregate', aggregate?: { __typename?: 'users_aggregate_fields', count: number } | null }, usersAggregate: { __typename?: 'users_aggregate', aggregate?: { __typename?: 'users_aggregate_fields', count: number } | null } };
|
||||||
|
|
||||||
export type RemoteAppGetUsersCustomQueryVariables = Exact<{
|
export type RemoteAppGetUsersCustomQueryVariables = Exact<{
|
||||||
where: Users_Bool_Exp;
|
where: Users_Bool_Exp;
|
||||||
@@ -23124,7 +23152,7 @@ export type RemoteAppGetUsersWholeQueryVariables = Exact<{
|
|||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
|
||||||
export type RemoteAppGetUsersWholeQuery = { __typename?: 'query_root', users: Array<{ __typename?: 'users', id: any, createdAt: any, displayName: string, avatarUrl: string, email?: any | null, emailVerified: boolean, phoneNumber?: string | null, phoneNumberVerified: boolean, disabled: boolean, defaultRole: string, lastSeen?: any | null, locale: string, roles: Array<{ __typename?: 'authUserRoles', id: any, role: string }>, userProviders: Array<{ __typename?: 'authUserProviders', id: any, providerId: string }> }>, usersAggregate: { __typename?: 'users_aggregate', aggregate?: { __typename?: 'users_aggregate_fields', count: number } | null } };
|
export type RemoteAppGetUsersWholeQuery = { __typename?: 'query_root', users: Array<{ __typename?: 'users', id: any, createdAt: any, displayName: string, avatarUrl: string, email?: any | null, emailVerified: boolean, phoneNumber?: string | null, phoneNumberVerified: boolean, disabled: boolean, defaultRole: string, lastSeen?: any | null, locale: string, metadata?: any | null, roles: Array<{ __typename?: 'authUserRoles', id: any, role: string }>, userProviders: Array<{ __typename?: 'authUserProviders', id: any, providerId: string }> }>, usersAggregate: { __typename?: 'users_aggregate', aggregate?: { __typename?: 'users_aggregate_fields', count: number } | null } };
|
||||||
|
|
||||||
export type TotalUsersQueryVariables = Exact<{ [key: string]: never; }>;
|
export type TotalUsersQueryVariables = Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
@@ -23623,6 +23651,7 @@ export const RemoteAppGetUsersFragmentDoc = gql`
|
|||||||
defaultRole
|
defaultRole
|
||||||
lastSeen
|
lastSeen
|
||||||
locale
|
locale
|
||||||
|
metadata
|
||||||
roles {
|
roles {
|
||||||
id
|
id
|
||||||
role
|
role
|
||||||
|
|||||||
@@ -1,5 +1,17 @@
|
|||||||
# @nhost/docs
|
# @nhost/docs
|
||||||
|
|
||||||
|
## 2.11.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- c6dc7f4: chore: docs: add Nhost client reference
|
||||||
|
|
||||||
|
## 2.10.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- a58c5cf: fix: broken link
|
||||||
|
|
||||||
## 2.10.2
|
## 2.10.2
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -298,6 +298,10 @@
|
|||||||
"group": "JavaScript",
|
"group": "JavaScript",
|
||||||
"icon": "js",
|
"icon": "js",
|
||||||
"pages": [
|
"pages": [
|
||||||
|
{
|
||||||
|
"group": "nhost-js",
|
||||||
|
"pages": ["reference/javascript/nhost-js/nhost-client", "reference/javascript/nhost-js/set-role", "reference/javascript/nhost-js/unset-role"]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"group": "Auth",
|
"group": "Auth",
|
||||||
"pages": [
|
"pages": [
|
||||||
@@ -338,7 +342,10 @@
|
|||||||
"reference/javascript/storage/get-public-url",
|
"reference/javascript/storage/get-public-url",
|
||||||
"reference/javascript/storage/delete",
|
"reference/javascript/storage/delete",
|
||||||
"reference/javascript/storage/set-access-token",
|
"reference/javascript/storage/set-access-token",
|
||||||
"reference/javascript/storage/set-admin-secret"
|
"reference/javascript/storage/set-admin-secret",
|
||||||
|
"reference/javascript/storage/set-headers",
|
||||||
|
"reference/javascript/storage/unset-headers",
|
||||||
|
"reference/javascript/storage/get-headers"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -347,7 +354,10 @@
|
|||||||
"reference/javascript/graphql/nhost-graphql-client",
|
"reference/javascript/graphql/nhost-graphql-client",
|
||||||
"reference/javascript/graphql/get-url",
|
"reference/javascript/graphql/get-url",
|
||||||
"reference/javascript/graphql/set-access-token",
|
"reference/javascript/graphql/set-access-token",
|
||||||
"reference/javascript/graphql/request"
|
"reference/javascript/graphql/request",
|
||||||
|
"reference/javascript/graphql/set-headers",
|
||||||
|
"reference/javascript/graphql/unset-headers",
|
||||||
|
"reference/javascript/graphql/get-headers"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/docs",
|
"name": "@nhost/docs",
|
||||||
"version": "2.10.2",
|
"version": "2.11.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "mintlify dev"
|
"start": "mintlify dev"
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ In addition, thanks to [pgvector](https://github.com/pgvector/pgvector) you can
|
|||||||
<CardGroup cols={4}>
|
<CardGroup cols={4}>
|
||||||
<Card title="Enabling Service" icon="square-1" href="../guides/ai/enabling-service">
|
<Card title="Enabling Service" icon="square-1" href="../guides/ai/enabling-service">
|
||||||
</Card>
|
</Card>
|
||||||
<Card title="Local Development" icon="square-2" href="../guides/ai/local_development">
|
<Card title="Local Development" icon="square-2" href="../guides/ai/local-development">
|
||||||
</Card>
|
</Card>
|
||||||
<Card title="Auto-Embeddings" icon="square-3" href="../guides/ai/auto-embeddings">
|
<Card title="Auto-Embeddings" icon="square-3" href="../guides/ai/auto-embeddings">
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
10
docs/reference/javascript/graphql/get-headers.mdx
Normal file
10
docs/reference/javascript/graphql/get-headers.mdx
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
title: getHeaders()
|
||||||
|
sidebarTitle: getHeaders()
|
||||||
|
---
|
||||||
|
|
||||||
|
Use `nhost.graphql.getHeaders` to get the global headers sent with all graphql requests
|
||||||
|
|
||||||
|
```ts
|
||||||
|
nhost.graphql.getHeaders()
|
||||||
|
```
|
||||||
20
docs/reference/javascript/graphql/set-headers.mdx
Normal file
20
docs/reference/javascript/graphql/set-headers.mdx
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
title: setHeaders()
|
||||||
|
sidebarTitle: setHeaders()
|
||||||
|
---
|
||||||
|
|
||||||
|
Use `nhost.graphql.setHeaders` to set global headers to be sent in all subsequent graphql requests
|
||||||
|
|
||||||
|
```ts
|
||||||
|
nhost.graphql.setHeaders({
|
||||||
|
'x-hasura-role': 'admin'
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">headers</span>** <span className="optional-status">optional</span> <code>Record<string, string></code>
|
||||||
|
|
||||||
|
---
|
||||||
11
docs/reference/javascript/graphql/unset-headers.mdx
Normal file
11
docs/reference/javascript/graphql/unset-headers.mdx
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
title: unsetHeaders()
|
||||||
|
sidebarTitle: unsetHeaders()
|
||||||
|
---
|
||||||
|
|
||||||
|
Use `nhost.graphql.unsetHeaders` to remove global headers sent with all requests, except for the role header to preserve
|
||||||
|
the role set by 'setRole' method.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
nhost.graphql.unsetHeaders()
|
||||||
|
```
|
||||||
51
docs/reference/javascript/nhost-js/nhost-client.mdx
Normal file
51
docs/reference/javascript/nhost-js/nhost-client.mdx
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
---
|
||||||
|
title: NhostClient
|
||||||
|
description: The Nhost client is the entry point to Nhost services.
|
||||||
|
---
|
||||||
|
|
||||||
|
# `NhostClient`
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// Create a new Nhost client from subdomain and region.
|
||||||
|
const nhost = new NhostClient({ subdomain, region })
|
||||||
|
```
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// Create a new Nhost client from individual service URLs (custom domains, self-hosting, etc).
|
||||||
|
const nhost = new NhostClient({
|
||||||
|
authUrl: 'my-auth-service-url',
|
||||||
|
storageUrl: 'my-storage-service-url',
|
||||||
|
graphqlUrl: 'my-graphql-service-url',
|
||||||
|
functionsUrl: 'my-functions-service-url'
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// Create a new Nhost client for local development.
|
||||||
|
const nhost = new NhostClient({ subdomain: 'local' })
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`NhostClientConstructorParams`](/reference/javascript/nhost-js/types/nhost-client-constructor-params)
|
||||||
|
|
||||||
|
| Property | Type | Required | Notes |
|
||||||
|
| :------------------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------ | :------: | :--------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>adminSecret</span> | <code>string</code> | | When set, the admin secret is sent as a header, `x-hasura-admin-secret`, for all requests to GraphQL, Storage, and Serverless Functions. |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>functionsUrl</span> | <code>string</code> | | |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>storageUrl</span> | <code>string</code> | | |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>graphqlUrl</span> | <code>string</code> | | |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>authUrl</span> | <code>string</code> | | |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>region</span> | <code>string</code> | | Project region (e.g. `eu-central-1`) Project region is not required during local development (when `subdomain` is `localhost`) |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>subdomain</span> | <code>string</code> | | Project subdomain (e.g. `ieingiwnginwnfnegqwvdqwdwq`) Use `localhost` during local development |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>devTools</span> | <code>boolean</code> | | Activate devTools e.g. the ability to connect to the xstate inspector |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>autoSignIn</span> | <code>boolean</code> | | When set to true, will parse the url on startup to check if it contains a refresh token to start the session with |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>autoRefreshToken</span> | <code>boolean</code> | | When set to true, will automatically refresh token before it expires |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorage</span> | [`ClientStorage`](/reference/javascript/nhost-js/types/client-storage) | | Object where the refresh token will be persisted and read locally. |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorageType</span> | [`ClientStorageType`](/reference/javascript/nhost-js/types/client-storage-type) | | Define a way to get information about the refresh token and its exipration date. |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>refreshIntervalTime</span> | <code>number</code> | | Time interval until token refreshes, in seconds |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>start</span> | <code>boolean</code> | | |
|
||||||
|
|
||||||
|
---
|
||||||
29
docs/reference/javascript/nhost-js/set-role.mdx
Normal file
29
docs/reference/javascript/nhost-js/set-role.mdx
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
title: setRole()
|
||||||
|
sidebarTitle: setRole()
|
||||||
|
---
|
||||||
|
|
||||||
|
Use `nhost.setRole` to set the user role for all subsequent GraphQL, storage, and functions calls.
|
||||||
|
Underneath, this method sets the `x-hasura-role` header on the graphql, storage,
|
||||||
|
and functions clients.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
nhost.graphql.setHeaders({ 'x-hasura-role': role })
|
||||||
|
nhost.storage.setHeaders({ 'x-hasura-role': role })
|
||||||
|
nhost.functions.setHeaders({ 'x-hasura-role': role })
|
||||||
|
```
|
||||||
|
|
||||||
|
Note: Exercise caution when mixing the use of `setRole` along with `setHeaders` when setting the
|
||||||
|
`x-hasura-role` header, as the last call will override any previous ones.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
nhost.setRole('admin')
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">role</span>** <span className="optional-status">required</span> <code>string</code>
|
||||||
|
|
||||||
|
---
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
title: ClientStorageType
|
||||||
|
sidebarTitle: ClientStorageType
|
||||||
|
description: No description provided.
|
||||||
|
---
|
||||||
|
|
||||||
|
# `ClientStorageType`
|
||||||
|
|
||||||
|
```ts
|
||||||
|
type ClientStorageType =
|
||||||
|
| 'capacitor'
|
||||||
|
| 'custom'
|
||||||
|
| 'expo-secure-storage'
|
||||||
|
| 'localStorage'
|
||||||
|
| 'react-native'
|
||||||
|
| 'web'
|
||||||
|
| 'cookie'
|
||||||
|
```
|
||||||
55
docs/reference/javascript/nhost-js/types/client-storage.mdx
Normal file
55
docs/reference/javascript/nhost-js/types/client-storage.mdx
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
---
|
||||||
|
title: ClientStorage
|
||||||
|
sidebarTitle: ClientStorage
|
||||||
|
description: No description provided.
|
||||||
|
---
|
||||||
|
|
||||||
|
# `ClientStorage`
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">customSet</span>** <span className="optional-status">optional</span> <code>(key: string, value: null | string) => void | Promise<void></code>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">customGet</span>** <span className="optional-status">optional</span> <code>(key: string) => null | string | Promise<null | string></code>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">deleteItemAsync</span>** <span className="optional-status">optional</span> <code>(key: string) => void</code>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">getItemAsync</span>** <span className="optional-status">optional</span> <code>(key: string) => any</code>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">setItemAsync</span>** <span className="optional-status">optional</span> <code>(key: string, value: string) => void</code>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">remove</span>** <span className="optional-status">optional</span> <code>(options: { key: string }) => void</code>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">get</span>** <span className="optional-status">optional</span> <code>(options: { key: string }) => any</code>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">set</span>** <span className="optional-status">optional</span> <code>(options: { key: string, value: string }) => void</code>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">removeItem</span>** <span className="optional-status">optional</span> <code>(key: string) => void</code>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">getItem</span>** <span className="optional-status">optional</span> <code>(key: string) => any</code>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">setItem</span>** <span className="optional-status">optional</span> <code>(\_key: string, \_value: string) => void</code>
|
||||||
|
|
||||||
|
---
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
---
|
||||||
|
title: NhostClientConstructorParams
|
||||||
|
sidebarTitle: NhostClientConstructorParams
|
||||||
|
description: No description provided.
|
||||||
|
---
|
||||||
|
|
||||||
|
# `NhostClientConstructorParams`
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">start</span>** <span className="optional-status">optional</span> <code>boolean</code>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">refreshIntervalTime</span>** <span className="optional-status">optional</span> <code>number</code>
|
||||||
|
|
||||||
|
Time interval until token refreshes, in seconds
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">clientStorageType</span>** <span className="optional-status">optional</span> [`ClientStorageType`](/reference/javascript/nhost-js/types/client-storage-type)
|
||||||
|
|
||||||
|
Define a way to get information about the refresh token and its exipration date.
|
||||||
|
|
||||||
|
**`@default`**
|
||||||
|
|
||||||
|
`web`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">clientStorage</span>** <span className="optional-status">optional</span> [`ClientStorage`](/reference/javascript/nhost-js/types/client-storage)
|
||||||
|
|
||||||
|
Object where the refresh token will be persisted and read locally.
|
||||||
|
|
||||||
|
Recommended values:
|
||||||
|
|
||||||
|
- `'web'` and `'cookies'`: no value is required
|
||||||
|
- `'react-native'`: `import Storage from @react-native-async-storage/async-storage`
|
||||||
|
- `'cookies'`: `localStorage`
|
||||||
|
- `'custom'`: an object that defines the following methods:
|
||||||
|
- `setItem` or `setItemAsync`
|
||||||
|
- `getItem` or `getItemAsync`
|
||||||
|
- `removeItem`
|
||||||
|
- `'capacitor'`: `import { Storage } from @capacitor/storage`
|
||||||
|
- `'expo-secure-store'`: `import * as SecureStore from 'expo-secure-store'`
|
||||||
|
|
||||||
|
| Property | Type | Required | Notes |
|
||||||
|
| :-------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------- | :------: | :---- |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItem</span> | <code>(\_key: string, \_value: string) => void</code> | | |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItem</span> | <code>(key: string) => any</code> | | |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>removeItem</span> | <code>(key: string) => void</code> | | |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>set</span> | <code>(options: { key: string, value: string }) => void</code> | | |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>get</span> | <code>(options: { key: string }) => any</code> | | |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>remove</span> | <code>(options: { key: string }) => void</code> | | |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItemAsync</span> | <code>(key: string, value: string) => void</code> | | |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItemAsync</span> | <code>(key: string) => any</code> | | |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>deleteItemAsync</span> | <code>(key: string) => void</code> | | |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>customGet</span> | <code>(key: string) => null | string | Promise<null | string></code> | | |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>customSet</span> | <code>(key: string, value: null | string) => void | Promise<void></code> | | |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">autoRefreshToken</span>** <span className="optional-status">optional</span> <code>boolean</code>
|
||||||
|
|
||||||
|
When set to true, will automatically refresh token before it expires
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">autoSignIn</span>** <span className="optional-status">optional</span> <code>boolean</code>
|
||||||
|
|
||||||
|
When set to true, will parse the url on startup to check if it contains a refresh token to start the session with
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">devTools</span>** <span className="optional-status">optional</span> <code>boolean</code>
|
||||||
|
|
||||||
|
Activate devTools e.g. the ability to connect to the xstate inspector
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">subdomain</span>** <span className="optional-status">optional</span> <code>string</code>
|
||||||
|
|
||||||
|
Project subdomain (e.g. `ieingiwnginwnfnegqwvdqwdwq`)
|
||||||
|
Use `localhost` during local development
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">region</span>** <span className="optional-status">optional</span> <code>string</code>
|
||||||
|
|
||||||
|
Project region (e.g. `eu-central-1`)
|
||||||
|
Project region is not required during local development (when `subdomain` is `localhost`)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">authUrl</span>** <span className="optional-status">optional</span> <code>string</code>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">graphqlUrl</span>** <span className="optional-status">optional</span> <code>string</code>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">storageUrl</span>** <span className="optional-status">optional</span> <code>string</code>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">functionsUrl</span>** <span className="optional-status">optional</span> <code>string</code>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">adminSecret</span>** <span className="optional-status">optional</span> <code>string</code>
|
||||||
|
|
||||||
|
When set, the admin secret is sent as a header, `x-hasura-admin-secret`,
|
||||||
|
for all requests to GraphQL, Storage, and Serverless Functions.
|
||||||
|
|
||||||
|
---
|
||||||
14
docs/reference/javascript/nhost-js/unset-role.mdx
Normal file
14
docs/reference/javascript/nhost-js/unset-role.mdx
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
title: unsetRole()
|
||||||
|
sidebarTitle: unsetRole()
|
||||||
|
---
|
||||||
|
|
||||||
|
Use `nhost.unsetRole` to unset the user role for all subsequent graphql, storage and functions calls.
|
||||||
|
Underneath, this method removes the `x-hasura-role` header from the graphql, storage and functions clients.
|
||||||
|
|
||||||
|
Note: Exercise caution when mixing the use of `unsetRole` along with `setHeaders` when setting the
|
||||||
|
`x-hasura-role` header, as the last call will override any previous ones.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
nhost.unsetRole()
|
||||||
|
```
|
||||||
@@ -22,6 +22,6 @@ const { file, error } = await nhost.storage.download({ fileId: '<File-ID>' })
|
|||||||
| <span className="parameter-name"><span className="light-grey">params.</span>quality</span> | <code>number</code> | | Image quality, between 1 and 100, 100 being the best quality |
|
| <span className="parameter-name"><span className="light-grey">params.</span>quality</span> | <code>number</code> | | Image quality, between 1 and 100, 100 being the best quality |
|
||||||
| <span className="parameter-name"><span className="light-grey">params.</span>height</span> | <code>number</code> | | Image height, in pixels |
|
| <span className="parameter-name"><span className="light-grey">params.</span>height</span> | <code>number</code> | | Image height, in pixels |
|
||||||
| <span className="parameter-name"><span className="light-grey">params.</span>width</span> | <code>number</code> | | Image width, in pixels |
|
| <span className="parameter-name"><span className="light-grey">params.</span>width</span> | <code>number</code> | | Image width, in pixels |
|
||||||
| <span className="parameter-name"><span className="light-grey">params.</span>headers</span> | <code>Record<string, string></code> | | Optional headers to be sent with the request |
|
| <span className="parameter-name"><span className="light-grey">params.</span>headers</span> | <code>Record<string, string></code> | | |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
10
docs/reference/javascript/storage/get-headers.mdx
Normal file
10
docs/reference/javascript/storage/get-headers.mdx
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
title: getHeaders()
|
||||||
|
sidebarTitle: getHeaders()
|
||||||
|
---
|
||||||
|
|
||||||
|
Use `nhost.storage.getHeaders` to get global headers sent with all storage requests.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
nhost.storage.getHeaders()
|
||||||
|
```
|
||||||
@@ -24,12 +24,13 @@ console.log('expiration: ', presignedUrl.expiration)
|
|||||||
|
|
||||||
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`StorageGetPresignedUrlParams`](/reference/javascript/storage/types/storage-get-presigned-url-params)
|
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`StorageGetPresignedUrlParams`](/reference/javascript/storage/types/storage-get-presigned-url-params)
|
||||||
|
|
||||||
| Property | Type | Required | Notes |
|
| Property | Type | Required | Notes |
|
||||||
| :----------------------------------------------------------------------------------------- | :------------------ | :------: | :----------------------------------------------------------- |
|
| :----------------------------------------------------------------------------------------- | :---------------------------------------- | :------: | :----------------------------------------------------------- |
|
||||||
| <span className="parameter-name"><span className="light-grey">params.</span>fileId</span> | <code>string</code> | ✔️ | |
|
| <span className="parameter-name"><span className="light-grey">params.</span>fileId</span> | <code>string</code> | ✔️ | |
|
||||||
| <span className="parameter-name"><span className="light-grey">params.</span>blur</span> | <code>number</code> | | Image blur, between 0 and 100 |
|
| <span className="parameter-name"><span className="light-grey">params.</span>blur</span> | <code>number</code> | | Image blur, between 0 and 100 |
|
||||||
| <span className="parameter-name"><span className="light-grey">params.</span>quality</span> | <code>number</code> | | Image quality, between 1 and 100, 100 being the best quality |
|
| <span className="parameter-name"><span className="light-grey">params.</span>quality</span> | <code>number</code> | | Image quality, between 1 and 100, 100 being the best quality |
|
||||||
| <span className="parameter-name"><span className="light-grey">params.</span>height</span> | <code>number</code> | | Image height, in pixels |
|
| <span className="parameter-name"><span className="light-grey">params.</span>height</span> | <code>number</code> | | Image height, in pixels |
|
||||||
| <span className="parameter-name"><span className="light-grey">params.</span>width</span> | <code>number</code> | | Image width, in pixels |
|
| <span className="parameter-name"><span className="light-grey">params.</span>width</span> | <code>number</code> | | Image width, in pixels |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">params.</span>headers</span> | <code>Record<string, string></code> | | |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
22
docs/reference/javascript/storage/set-headers.mdx
Normal file
22
docs/reference/javascript/storage/set-headers.mdx
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
title: setHeaders()
|
||||||
|
sidebarTitle: setHeaders()
|
||||||
|
---
|
||||||
|
|
||||||
|
Use `nhost.storage.setHeaders` to set global headers to be sent for all subsequent storage requests.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
nhost.storage.setHeaders({
|
||||||
|
'x-hasura-role': 'admin'
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">headers</span>** <span className="optional-status">optional</span> <code>Record<string, string></code>
|
||||||
|
|
||||||
|
key value headers object
|
||||||
|
|
||||||
|
---
|
||||||
@@ -10,6 +10,10 @@ description: No description provided.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">headers</span>** <span className="optional-status">optional</span> <code>Record<string, string></code>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
**<span className="parameter-name">fileId</span>** <span className="optional-status">required</span> <code>string</code>
|
**<span className="parameter-name">fileId</span>** <span className="optional-status">required</span> <code>string</code>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ description: No description provided.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">headers</span>** <span className="optional-status">optional</span> <code>Record<string, string></code>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
**<span className="parameter-name">fileId</span>** <span className="optional-status">required</span> <code>string</code>
|
**<span className="parameter-name">fileId</span>** <span className="optional-status">required</span> <code>string</code>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -40,6 +40,4 @@ Image width, in pixels
|
|||||||
|
|
||||||
**<span className="parameter-name">headers</span>** <span className="optional-status">optional</span> <code>Record<string, string></code>
|
**<span className="parameter-name">headers</span>** <span className="optional-status">optional</span> <code>Record<string, string></code>
|
||||||
|
|
||||||
Optional headers to be sent with the request
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -37,3 +37,7 @@ Image height, in pixels
|
|||||||
Image width, in pixels
|
Image width, in pixels
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">headers</span>** <span className="optional-status">optional</span> <code>Record<string, string></code>
|
||||||
|
|
||||||
|
---
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
title: StorageHeadersParam
|
||||||
|
sidebarTitle: StorageHeadersParam
|
||||||
|
description: No description provided.
|
||||||
|
---
|
||||||
|
|
||||||
|
# `StorageHeadersParam`
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">headers</span>** <span className="optional-status">optional</span> <code>Record<string, string></code>
|
||||||
|
|
||||||
|
---
|
||||||
@@ -25,3 +25,7 @@ description: No description provided.
|
|||||||
**<span className="parameter-name">id</span>** <span className="optional-status">optional</span> <code>string</code>
|
**<span className="parameter-name">id</span>** <span className="optional-status">optional</span> <code>string</code>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">headers</span>** <span className="optional-status">optional</span> <code>Record<string, string></code>
|
||||||
|
|
||||||
|
---
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ description: No description provided.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**<span className="parameter-name">headers</span>** <span className="optional-status">optional</span> <code>Record<string, string></code>
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**<span className="parameter-name">bucketId</span>** <span className="optional-status">optional</span> <code>string</code>
|
**<span className="parameter-name">bucketId</span>** <span className="optional-status">optional</span> <code>string</code>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">headers</span>** <span className="optional-status">optional</span> <code>Record<string, string></code>
|
||||||
|
|
||||||
|
---
|
||||||
|
|||||||
10
docs/reference/javascript/storage/unset-headers.mdx
Normal file
10
docs/reference/javascript/storage/unset-headers.mdx
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
title: unsetHeaders()
|
||||||
|
sidebarTitle: unsetHeaders()
|
||||||
|
---
|
||||||
|
|
||||||
|
Use `nhost.storage.unsetHeaders` to remove the global headers sent for all subsequent storage requests.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
nhost.storage.unsetHeaders()
|
||||||
|
```
|
||||||
@@ -19,12 +19,13 @@ If no `bucketId` is specified the bucket `default` is used.
|
|||||||
|
|
||||||
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`StorageUploadFileParams`](/reference/javascript/storage/types/storage-upload-file-params)
|
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`StorageUploadFileParams`](/reference/javascript/storage/types/storage-upload-file-params)
|
||||||
|
|
||||||
| Property | Type | Required | Notes |
|
| Property | Type | Required | Notes |
|
||||||
| :------------------------------------------------------------------------------------------ | :------------------ | :------: | :---- |
|
| :------------------------------------------------------------------------------------------ | :---------------------------------------- | :------: | :---- |
|
||||||
| <span className="parameter-name"><span className="light-grey">params.</span>file</span> | <code>File</code> | ✔️ | |
|
| <span className="parameter-name"><span className="light-grey">params.</span>file</span> | <code>File</code> | ✔️ | |
|
||||||
| <span className="parameter-name"><span className="light-grey">params.</span>bucketId</span> | <code>string</code> | | |
|
| <span className="parameter-name"><span className="light-grey">params.</span>bucketId</span> | <code>string</code> | | |
|
||||||
| <span className="parameter-name"><span className="light-grey">params.</span>name</span> | <code>string</code> | | |
|
| <span className="parameter-name"><span className="light-grey">params.</span>name</span> | <code>string</code> | | |
|
||||||
| <span className="parameter-name"><span className="light-grey">params.</span>id</span> | <code>string</code> | | |
|
| <span className="parameter-name"><span className="light-grey">params.</span>id</span> | <code>string</code> | | |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">params.</span>headers</span> | <code>Record<string, string></code> | | |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -64,7 +65,7 @@ await storage.upload({
|
|||||||
| Property | Type | Required | Notes |
|
| Property | Type | Required | Notes |
|
||||||
| :------------------------------------------------------------------------------------------ | :---------------------------------------- | :------: | :---- |
|
| :------------------------------------------------------------------------------------------ | :---------------------------------------- | :------: | :---- |
|
||||||
| <span className="parameter-name"><span className="light-grey">params.</span>formData</span> | <code>FormData | FormData</code> | ✔️ | |
|
| <span className="parameter-name"><span className="light-grey">params.</span>formData</span> | <code>FormData | FormData</code> | ✔️ | |
|
||||||
| <span className="parameter-name"><span className="light-grey">params.</span>headers</span> | <code>Record<string, string></code> | | |
|
|
||||||
| <span className="parameter-name"><span className="light-grey">params.</span>bucketId</span> | <code>string</code> | | |
|
| <span className="parameter-name"><span className="light-grey">params.</span>bucketId</span> | <code>string</code> | | |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">params.</span>headers</span> | <code>Record<string, string></code> | | |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -1,5 +1,26 @@
|
|||||||
# @nhost-examples/cli
|
# @nhost-examples/cli
|
||||||
|
|
||||||
|
## 0.3.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [4c35171]
|
||||||
|
- Updated dependencies [3cea460]
|
||||||
|
- @nhost/nhost-js@3.1.2
|
||||||
|
|
||||||
|
## 0.3.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/nhost-js@3.1.1
|
||||||
|
|
||||||
|
## 0.3.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [304065a]
|
||||||
|
- @nhost/nhost-js@3.1.0
|
||||||
|
|
||||||
## 0.3.1
|
## 0.3.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost-examples/cli",
|
"name": "@nhost-examples/cli",
|
||||||
"version": "0.3.1",
|
"version": "0.3.4",
|
||||||
"main": "src/index.mjs",
|
"main": "src/index.mjs",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,5 +1,26 @@
|
|||||||
# @nhost-examples/codegen-react-apollo
|
# @nhost-examples/codegen-react-apollo
|
||||||
|
|
||||||
|
## 0.4.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/react@3.4.4
|
||||||
|
- @nhost/react-apollo@11.0.4
|
||||||
|
|
||||||
|
## 0.4.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/react@3.4.3
|
||||||
|
- @nhost/react-apollo@11.0.3
|
||||||
|
|
||||||
|
## 0.4.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/react@3.4.2
|
||||||
|
- @nhost/react-apollo@11.0.2
|
||||||
|
|
||||||
## 0.4.1
|
## 0.4.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost-examples/codegen-react-apollo",
|
"name": "@nhost-examples/codegen-react-apollo",
|
||||||
"version": "0.4.1",
|
"version": "0.4.4",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"codegen": "graphql-codegen",
|
"codegen": "graphql-codegen",
|
||||||
|
|||||||
@@ -1,5 +1,23 @@
|
|||||||
# @nhost-examples/codegen-react-query
|
# @nhost-examples/codegen-react-query
|
||||||
|
|
||||||
|
## 0.4.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/react@3.4.4
|
||||||
|
|
||||||
|
## 0.4.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/react@3.4.3
|
||||||
|
|
||||||
|
## 0.4.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/react@3.4.2
|
||||||
|
|
||||||
## 0.4.1
|
## 0.4.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost-examples/codegen-react-query",
|
"name": "@nhost-examples/codegen-react-query",
|
||||||
"version": "0.4.1",
|
"version": "0.4.4",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"codegen": "graphql-codegen",
|
"codegen": "graphql-codegen",
|
||||||
|
|||||||
@@ -1,5 +1,26 @@
|
|||||||
# @nhost-examples/react-urql
|
# @nhost-examples/react-urql
|
||||||
|
|
||||||
|
## 0.3.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/react@3.4.4
|
||||||
|
- @nhost/react-urql@8.0.4
|
||||||
|
|
||||||
|
## 0.3.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/react@3.4.3
|
||||||
|
- @nhost/react-urql@8.0.3
|
||||||
|
|
||||||
|
## 0.3.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/react@3.4.2
|
||||||
|
- @nhost/react-urql@8.0.2
|
||||||
|
|
||||||
## 0.3.1
|
## 0.3.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost-examples/codegen-react-urql",
|
"name": "@nhost-examples/codegen-react-urql",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.3.1",
|
"version": "0.3.4",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "tsc && vite build",
|
"build": "tsc && vite build",
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ The following endpoints are now exposed:
|
|||||||
- `http://localhost:3030`: Nhost Dashboard
|
- `http://localhost:3030`: Nhost Dashboard
|
||||||
- `http://localhost:1337`: Hasura Console
|
- `http://localhost:1337`: Hasura Console
|
||||||
- `http://localhost:8025`: Mailhog SMTP testing dashboard
|
- `http://localhost:8025`: Mailhog SMTP testing dashboard
|
||||||
- `http://localhost:9090`: Traefik dashboad
|
- `http://localhost:9090`: Traefik dashboard
|
||||||
|
|
||||||
## Running the Nhost dashboard locally
|
## Running the Nhost dashboard locally
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,26 @@
|
|||||||
# @nhost-examples/multi-tenant-one-to-many
|
# @nhost-examples/multi-tenant-one-to-many
|
||||||
|
|
||||||
|
## 2.2.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [4c35171]
|
||||||
|
- Updated dependencies [3cea460]
|
||||||
|
- @nhost/nhost-js@3.1.2
|
||||||
|
|
||||||
|
## 2.2.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/nhost-js@3.1.1
|
||||||
|
|
||||||
|
## 2.2.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [304065a]
|
||||||
|
- @nhost/nhost-js@3.1.0
|
||||||
|
|
||||||
## 2.2.1
|
## 2.2.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost-examples/multi-tenant-one-to-many",
|
"name": "@nhost-examples/multi-tenant-one-to-many",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2.2.1",
|
"version": "2.2.4",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {},
|
"scripts": {},
|
||||||
|
|||||||
@@ -1,5 +1,29 @@
|
|||||||
# @nhost-examples/nextjs
|
# @nhost-examples/nextjs
|
||||||
|
|
||||||
|
## 0.3.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/react@3.4.4
|
||||||
|
- @nhost/react-apollo@11.0.4
|
||||||
|
- @nhost/nextjs@2.1.13
|
||||||
|
|
||||||
|
## 0.3.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/react@3.4.3
|
||||||
|
- @nhost/react-apollo@11.0.3
|
||||||
|
- @nhost/nextjs@2.1.12
|
||||||
|
|
||||||
|
## 0.3.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/react@3.4.2
|
||||||
|
- @nhost/react-apollo@11.0.2
|
||||||
|
- @nhost/nextjs@2.1.11
|
||||||
|
|
||||||
## 0.3.1
|
## 0.3.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost-examples/nextjs",
|
"name": "@nhost-examples/nextjs",
|
||||||
"version": "0.3.1",
|
"version": "0.3.4",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
|
|||||||
@@ -1,5 +1,26 @@
|
|||||||
# @nhost-examples/node-storage
|
# @nhost-examples/node-storage
|
||||||
|
|
||||||
|
## 0.2.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [4c35171]
|
||||||
|
- Updated dependencies [3cea460]
|
||||||
|
- @nhost/nhost-js@3.1.2
|
||||||
|
|
||||||
|
## 0.2.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/nhost-js@3.1.1
|
||||||
|
|
||||||
|
## 0.2.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [304065a]
|
||||||
|
- @nhost/nhost-js@3.1.0
|
||||||
|
|
||||||
## 0.2.1
|
## 0.2.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost-examples/node-storage",
|
"name": "@nhost-examples/node-storage",
|
||||||
"version": "0.2.1",
|
"version": "0.2.4",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "This is an example of how to use the Storage with Node.js",
|
"description": "This is an example of how to use the Storage with Node.js",
|
||||||
"main": "src/index.mjs",
|
"main": "src/index.mjs",
|
||||||
|
|||||||
@@ -1,5 +1,26 @@
|
|||||||
# @nhost-examples/nextjs-server-components
|
# @nhost-examples/nextjs-server-components
|
||||||
|
|
||||||
|
## 0.4.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [4c35171]
|
||||||
|
- Updated dependencies [3cea460]
|
||||||
|
- @nhost/nhost-js@3.1.2
|
||||||
|
|
||||||
|
## 0.4.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/nhost-js@3.1.1
|
||||||
|
|
||||||
|
## 0.4.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [304065a]
|
||||||
|
- @nhost/nhost-js@3.1.0
|
||||||
|
|
||||||
## 0.4.1
|
## 0.4.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost-examples/nextjs-server-components",
|
"name": "@nhost-examples/nextjs-server-components",
|
||||||
"version": "0.4.1",
|
"version": "0.4.4",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user