forked from nhost/nhost
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sync Fork
committed
Feb 6, 2024
1 parent
82d3e07
commit 8a22fe8
Showing
70 changed files
with
2,595 additions
and
745 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
'@nhost/hasura-auth-js': minor | ||
'@nhost-examples/react-apollo': minor | ||
'@nhost-examples/vue-apollo': minor | ||
'@nhost/react': minor | ||
'@nhost/vue': minor | ||
--- | ||
|
||
feat: add 'elevateEmailSecurityKey' to the SDKs along with integration into react-apollo and vue-apollo examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@nhost-examples/nextjs-server-components': minor | ||
'@nhost/hasura-storage-js': minor | ||
'@nhost/docs': minor | ||
--- | ||
|
||
feat: Add support for authenticated download of files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
title: "Local Development" | ||
icon: code | ||
--- | ||
|
||
If you are using the Nhost CLI for local development, as of [v0.12.0](https://github.com/nhost/cli/releases/tag/v1.12.0) you can also start Graphite locally. To do so, follow the next steps: | ||
|
||
|
||
|
||
<Steps> | ||
<Step title="Configuring the Service"> | ||
Follow the steps highlighed in the ["Enabling Service"](enabling-service) guide and don't forget to add the relevant secrets to your `.secrets` file. | ||
</Step> | ||
<Step title="Start nhost"> | ||
Run `nhost up`: | ||
|
||
![nhost up](/images/guides/ai/local-development/nhost_up.png) | ||
|
||
After starting the service the first thing you will notice is that there is a new `ai` service running. | ||
</Step> | ||
<Step title="Commit metadata changes"> | ||
As you start the AI service metadata changes may be proposed: | ||
|
||
![git status](/images/guides/ai/local-development/git_status.png) | ||
|
||
We strongly recommmend you to commit them to your git repository so they can be deployed alongside your application. | ||
</Step> | ||
</Steps> | ||
|
||
|
||
### Synhcronizing Auto-Embeddings | ||
|
||
If you add [auto-embeddings](/guides/ai/auto-embeddings) configuration locally and want to synchronize them with the cloud we recommend inserting them using a migration rather than with the auto-embeddings UI: | ||
|
||
![migration](/images/guides/ai/local-development/migration.png) | ||
|
||
And then running `nhost up` to download the updated metadata. Afterwards you should see both database migrations and functions' metadata changes in your local project: | ||
|
||
![git status](/images/guides/ai/local-development/git_status_functions.png) | ||
|
||
Pushing them to your deployment branch will also deploy them to your cloud project. | ||
|
||
### Synhcronizing Assistants | ||
|
||
Similar to auto-embeddings, if you want to synchronize [assistants](/guides/ai/assistants) we recommend you to insert them using a migration and then running `nhost up` to update any metadata if necessary. After pushing the proposed changes to the deployment branch all the changes should be deployed to the cloud project. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
title: download() | ||
sidebarTitle: download() | ||
--- | ||
|
||
Use `nhost.storage.download` to download a file. To download a file the user must have permission to select the file in the `storage.files` table. | ||
|
||
```ts | ||
const { file, error } = await nhost.storage.download({ fileId: '<File-ID>' }) | ||
``` | ||
|
||
## Parameters | ||
|
||
--- | ||
|
||
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`StorageDownloadFileParams`](/reference/javascript/storage/types/storage-download-file-params) | ||
|
||
| 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>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>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>headers</span> | <code>Record<string, string></code> | | Optional headers to be sent with the request | | ||
|
||
--- |
45 changes: 45 additions & 0 deletions
45
docs/reference/javascript/storage/types/storage-download-file-params.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
title: StorageDownloadFileParams | ||
sidebarTitle: StorageDownloadFileParams | ||
description: No description provided. | ||
--- | ||
|
||
# `StorageDownloadFileParams` | ||
|
||
## Parameters | ||
|
||
--- | ||
|
||
**<span className="parameter-name">fileId</span>** <span className="optional-status">required</span> <code>string</code> | ||
|
||
--- | ||
|
||
**<span className="parameter-name">blur</span>** <span className="optional-status">optional</span> <code>number</code> | ||
|
||
Image blur, between 0 and 100 | ||
|
||
--- | ||
|
||
**<span className="parameter-name">quality</span>** <span className="optional-status">optional</span> <code>number</code> | ||
|
||
Image quality, between 1 and 100, 100 being the best quality | ||
|
||
--- | ||
|
||
**<span className="parameter-name">height</span>** <span className="optional-status">optional</span> <code>number</code> | ||
|
||
Image height, in pixels | ||
|
||
--- | ||
|
||
**<span className="parameter-name">width</span>** <span className="optional-status">optional</span> <code>number</code> | ||
|
||
Image width, in pixels | ||
|
||
--- | ||
|
||
**<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 | ||
|
||
--- |
13 changes: 13 additions & 0 deletions
13
docs/reference/javascript/storage/types/storage-download-file-response.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
title: StorageDownloadFileResponse | ||
sidebarTitle: StorageDownloadFileResponse | ||
description: No description provided. | ||
--- | ||
|
||
# `StorageDownloadFileResponse` | ||
|
||
```ts | ||
type StorageDownloadFileResponse = | ||
| { file: Blob; error: null } | ||
| { file: null; error: Error } | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
examples/react-apollo/nhost/metadata/databases/default/tables/public_notes.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
table: | ||
name: notes | ||
schema: public | ||
configuration: | ||
column_config: | ||
created_at: | ||
custom_name: createdAt | ||
updated_at: | ||
custom_name: updatedAt | ||
custom_column_names: | ||
created_at: createdAt | ||
updated_at: updatedAt | ||
custom_root_fields: | ||
delete: deleteNotes | ||
delete_by_pk: deleteNote | ||
insert: inserNotes | ||
insert_one: insertNote | ||
select_aggregate: notesAggregate | ||
select_by_pk: note | ||
update: updateNotes | ||
update_by_pk: updateNote | ||
object_relationships: | ||
- name: user | ||
using: | ||
foreign_key_constraint_on: user_id | ||
insert_permissions: | ||
- role: user | ||
permission: | ||
check: | ||
user_id: | ||
_eq: x-hasura-auth-elevated | ||
set: | ||
user_id: x-hasura-User-Id | ||
columns: | ||
- content | ||
select_permissions: | ||
- role: user | ||
permission: | ||
columns: | ||
- content | ||
- created_at | ||
- id | ||
- updated_at | ||
filter: | ||
user_id: | ||
_eq: X-Hasura-User-Id | ||
allow_aggregations: true | ||
update_permissions: | ||
- role: user | ||
permission: | ||
columns: | ||
- content | ||
filter: | ||
user_id: | ||
_eq: x-hasura-auth-elevated | ||
check: null | ||
delete_permissions: | ||
- role: user | ||
permission: | ||
filter: | ||
user_id: | ||
_eq: x-hasura-auth-elevated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.