Compare commits

...

122 Commits

Author SHA1 Message Date
Szilárd Dóró
ebc1730fce Merge pull request #1375 from nhost/changeset-release/main
chore: update versions
2022-12-13 16:55:15 +01:00
Pierre-Louis Mercereau
c1cd1e813c docs: update changelog 2022-12-13 16:34:41 +01:00
Pierre-Louis Mercereau
e08a074474 chore: un-bump major versions 2022-12-13 16:33:30 +01:00
github-actions[bot]
95932fa3f2 chore: update versions 2022-12-13 13:06:10 +00:00
Pilou
99402b77d1 Merge pull request #1376 from nhost/chore/docgen
chore: remove generated documentation from the repository
2022-12-13 14:04:48 +01:00
Szilárd Dóró
f6fb2cd8e6 Merge pull request #1377 from nhost/fix/local-development-region
fix(dashboard): don't break the UI when project is not loaded yet
2022-12-13 13:49:38 +01:00
Szilárd Dóró
5c2cf59b41 chore(dashboard): update CHANGELOG.md 2022-12-13 13:11:50 +01:00
Szilárd Dóró
a6d31dc260 fix(dashboard): don't break the UI when project is not loaded yet 2022-12-13 13:10:54 +01:00
Pierre-Louis Mercereau
bd73557a47 Merge branch 'main' into chore/docgen 2022-12-13 12:01:04 +01:00
Pilou
c95bab70c2 Merge pull request #1366 from nhost/refactor/merge-core
refactor: decommission `@nhost/core`
2022-12-13 10:50:36 +01:00
Szilárd Dóró
52d4b5de45 Merge pull request #1347 from nhost/changeset-release/main
chore: update versions
2022-12-13 10:29:25 +01:00
Szilárd Dóró
6b4ab50f74 fix(packages): nextjs and react-apollo versions 2022-12-13 09:50:42 +01:00
github-actions[bot]
ceba605d0b chore: update versions 2022-12-13 08:47:12 +00:00
Szilárd Dóró
9249a85ee5 Merge pull request #1371 from nhost/fix/aws-name-null-reference
fix(dashboard): don't break UI when region is nullish
2022-12-13 09:45:32 +01:00
Szilárd Dóró
f4d70f88e9 chore(dashboard): add changeset 2022-12-12 22:43:06 +01:00
Szilárd Dóró
0d09b80b12 fix(dashboard): fix nullish region in local mode 2022-12-12 22:42:09 +01:00
Pierre-Louis Mercereau
195adfb04a chore: remove generated documentation from the repository 2022-12-12 21:26:21 +01:00
Pilou
b09930c8a4 Merge pull request #1369 from nhost/contributors-readme-action-TvJAKaD1lO
docs(contributor): contributors readme action update
2022-12-12 19:06:31 +01:00
github-actions[bot]
687951281e docs(contributor): contrib-readme-action has updated readme 2022-12-12 18:05:20 +00:00
Pilou
c0f05acd9b Merge pull request #1365 from badgifter/patch-windowslive-url
Windows Live Provider displayed link updated to match backend url
2022-12-12 19:05:01 +01:00
Pierre-Louis Mercereau
d8c2d369aa chore: changeset 2022-12-12 15:43:55 +01:00
Pierre-Louis Mercereau
a4e4926aeb Merge branch 'main' into refactor/merge-core 2022-12-12 15:28:26 +01:00
Pilou
4a9471cc16 Create rude-singers-carry.md 2022-12-12 14:42:55 +01:00
Bad Gifter
567e370bdc microsoft changed to windowslive 2022-12-12 14:04:35 +03:00
Bad Gifter
a91f2db0e2 Windows Live Provider displayed link updated to match backend url 2022-12-12 13:49:08 +03:00
Szilárd Dóró
aea99ad2c8 Merge pull request #1361 from nhost/fix/apple-sign-in-mutation
fix(dashboard): do not show error when submitting Apple provider settings
2022-12-09 09:45:33 +01:00
Szilárd Dóró
594488e435 chore(dashboard): add changeset 2022-12-09 09:29:32 +01:00
Szilárd Dóró
bb83b0f81a fix(dashboard): do not show error when submitting Apple provider settings 2022-12-09 09:18:46 +01:00
Pilou
0384d7c7c4 Merge pull request #1360 from nhost/contributors-readme-action-cDMbyYcNKN
docs(contributor): contributors readme action update
2022-12-08 19:40:40 +01:00
Pilou
7e356a9604 Merge pull request #1357 from nhost/contributors-readme-action-sNfze0TcKw
docs(contributor): contributors readme action update
2022-12-08 19:29:19 +01:00
github-actions[bot]
013e55a307 docs(contributor): contrib-readme-action has updated readme 2022-12-08 18:28:57 +00:00
Pilou
2a71257cde Merge pull request #1358 from nhost/fix/workspace-packages
fix: use workspace to resolve internal dependencies
2022-12-08 19:28:41 +01:00
Pierre-Louis Mercereau
583a4401d0 docs: add explanation to the CI workflow 2022-12-08 18:50:01 +01:00
Pierre-Louis Mercereau
914e91a0b0 ci: correct test 2022-12-08 18:40:49 +01:00
Pierre-Louis Mercereau
98698213e2 ci: run all e2e tests when lockfile changed 2022-12-08 18:29:54 +01:00
Pierre-Louis Mercereau
756daa97cd fix: use workspace to resolve internal dependencies 2022-12-08 16:58:47 +01:00
github-actions[bot]
ab5a2b119c docs(contributor): contrib-readme-action has updated readme 2022-12-08 15:18:12 +00:00
Johan Eliasson
ffdcce1463 Merge pull request #1352 from wollerman/patch-1
Add a section on managing local seed data
2022-12-08 16:17:54 +01:00
Szilárd Dóró
a3dcb6106e Merge pull request #1355 from nhost/chore/revert-types-react-bump
chore(dashboard): revert `@types/react` bump
2022-12-08 15:03:24 +01:00
Szilárd Dóró
208d224763 chore(dashboard): revert @types/react bump 2022-12-08 14:46:36 +01:00
Matt Wollerman
564d000bfc add link to overview description of seed data 2022-12-07 20:21:09 -05:00
Matt Wollerman
266fda07ab add a section on managing local seed data 2022-12-07 08:45:40 -05:00
Pilou
6174e1ddcc Merge pull request #1341 from nhost/refactor/nhost-react-providers
refactor: nhost react providers
2022-12-06 12:57:26 +01:00
Pierre-Louis Mercereau
af2e3eae37 chore: minor bump 2022-12-06 12:39:30 +01:00
Pilou
d2b4c126f3 Merge pull request #1346 from nhost/chore/prettier-ignore-lockfile
chore: prettier ignore pnpm-lock.yaml
2022-12-06 11:01:00 +01:00
Pierre-Louis Mercereau
7f2e182c47 chore: prettier ignore pnpm-lock.yaml 2022-12-06 10:54:16 +01:00
Szilárd Dóró
ae40bd54d4 Merge pull request #1302 from nhost/renovate/react-18.x
chore(deps): update dependency @types/react to v18.0.26
2022-12-06 10:01:27 +01:00
Pilou
b5cc47078a Update .changeset/big-pumpkins-march.md
Co-authored-by: Szilárd Dóró <doroszilard@icloud.com>
2022-12-06 09:59:25 +01:00
Pierre-Louis Mercereau
7f251111e2 chore: 🤖 changeset 2022-12-06 09:41:40 +01:00
Pierre-Louis Mercereau
c03dacc3a3 refactor: use NhostProvider in React and Nextjs 2022-12-06 09:39:44 +01:00
Pilou
8b9e1a0ce8 Merge pull request #1339 from nhost/contributors-readme-action-oSzExU64y7
docs(contributor): contributors readme action update
2022-12-06 07:04:10 +01:00
github-actions[bot]
cf9cfec330 docs(contributor): contrib-readme-action has updated readme 2022-12-06 05:52:28 +00:00
Pilou
1c94f56c59 Merge pull request #1338 from iangabrielsanchez/patch-1
Fix typo
2022-12-06 06:52:14 +01:00
Ian Gabriel Sanchez
f06d5deba3 Fix typo 2022-12-06 10:15:59 +08:00
Nuno Pato
8ff58d7f23 Merge pull request #1330 from nhost/changeset-release/main
chore: update versions
2022-12-05 15:22:02 -01:00
github-actions[bot]
8dd1c7415b chore: update versions 2022-12-05 15:56:54 +00:00
Nuno Pato
ebd2749e38 Merge pull request #1329 from nhost/fix/hasura-duplicate-slug
fix(dashboard): use correct Hasura slug
2022-12-05 14:55:28 -01:00
Szilárd Dóró
80b604adda fix(dashboard): use correct Hasura slug 2022-12-05 16:35:35 +01:00
Nuno Pato
9d73050792 Merge pull request #1322 from nhost/changeset-release/main
chore: update versions
2022-12-05 14:20:47 -01:00
renovate[bot]
2a86b8876c chore(deps): update dependency @types/react to v18.0.26 2022-12-05 14:47:07 +00:00
github-actions[bot]
91a1a41f5d chore: update versions 2022-12-05 14:41:11 +00:00
Nuno Pato
22e9c27c81 Merge pull request #1328 from nhost/fix/graphiql-editor
fix(dashboard): prevent error on GraphQL page
2022-12-05 13:39:28 -01:00
Szilárd Dóró
2d2beb53d2 fix(dashboard): prevent error on GraphQL page 2022-12-05 15:26:37 +01:00
Pilou
b403b0d6a0 Merge pull request #1327 from nhost/ci/unambiguous-git-log
chore: don't use PAT in renovate post PR
2022-12-05 14:21:43 +01:00
Pierre-Louis Mercereau
4dbac55cb4 chore: don't use PAT in renovate post PR 2022-12-05 14:20:56 +01:00
Pilou
c6e31ac741 Merge pull request #1324 from nhost/renovate/xstate-vue-2.x
fix(deps): update dependency @xstate/vue to v2
2022-12-05 13:06:56 +01:00
Pilou
0d3e8b3992 Merge pull request #1325 from nhost/ci/unambiguous-git-log
chore(gh-actions): `git log` unabiguously
2022-12-05 12:58:15 +01:00
Pierre-Louis Mercereau
b2afd14d61 chore(gh-actions): git log unabiguously 2022-12-05 12:57:46 +01:00
renovate[bot]
f28f28b6ee fix(deps): update dependency @xstate/vue to v2 2022-12-05 11:52:06 +00:00
Pilou
834b959271 Merge pull request #1323 from nhost/renovate/vueuse-core-9.x
fix(deps): update dependency @vueuse/core to v9
2022-12-05 12:44:43 +01:00
renovate[bot]
4dbc9ccc87 fix(deps): update dependency @vueuse/core to v9 2022-12-05 11:23:06 +00:00
Pierre-Louis Mercereau
2764a1c4b6 Merge branch 'main' into refactor/merge-core 2022-12-05 12:17:21 +01:00
Nuno Pato
1666ca2ec5 Merge pull request #1250 from nhost/chore/deprecate-old-dns-name
chore(dashboard): deprecate old DNS name
2022-12-05 10:10:37 -01:00
Pilou
346791d4d5 Merge pull request #1321 from nhost/renovate/pnpm-find-workspace-dir-5.x
fix(deps): update dependency @pnpm/find-workspace-dir to v5
2022-12-05 11:55:33 +01:00
Pierre-Louis Mercereau
94bdafe22f chore: adapt sync-versions to find-workspace-dir 5 2022-12-05 11:51:44 +01:00
renovate[bot]
33782e9d41 fix(deps): update dependency @pnpm/find-workspace-dir to v5 2022-12-05 10:46:45 +00:00
Johan Eliasson
ea02e1e104 Merge pull request #1311 from nhost/example-serverless-functions-stripe-webhooks
example(serverless functions): Stripe Webhooks
2022-12-05 11:39:36 +01:00
Johan Eliasson
98bf6e3792 Update examples/serverless-functions/functions/stripe-webhook/index.ts
Co-authored-by: Nuno Pato <nunopato@gmail.com>
2022-12-05 11:39:26 +01:00
Johan Eliasson
d9dcafd643 Update examples/serverless-functions/functions/stripe-webhook/index.ts
Co-authored-by: Nuno Pato <nunopato@gmail.com>
2022-12-05 11:39:20 +01:00
Johan Eliasson
4f3d97b5ad Merge pull request #1316 from nhost/elitan-patch-3
docs clarifications
2022-12-05 11:38:51 +01:00
Nuno Pato
d1801ceae9 dashboard: fix link 2022-12-05 09:12:40 -01:00
Johan Eliasson
1abc68992f Update users.mdx 2022-12-05 08:15:14 +01:00
Johan Eliasson
8ed965c669 keep migrations file here, otherwise nhost dev won't work 2022-12-03 14:44:22 +01:00
Johan Eliasson
c59f622feb fix 2022-12-03 13:48:40 +01:00
Johan Eliasson
9a30edd038 example 2022-12-03 13:47:42 +01:00
Szilárd Dóró
99ee9fd10d fix(dashboard): move Brazilian flag 2022-12-02 20:29:58 +01:00
Nuno Pato
9608a327c9 dashboard: add brazilian flag 2022-12-02 18:27:14 -01:00
Szilárd Dóró
492b83ef58 fix(dashboard): correct GraphQL URL 2022-12-02 20:25:11 +01:00
Pierre-Louis Mercereau
a0901914ac Merge branch 'main' into refactor/merge-core 2022-12-02 16:09:32 +01:00
Szilárd Dóró
c9f88326b2 chore(dashboard): migrate app URLs to service URLs 2022-11-30 17:12:58 +01:00
Szilárd Dóró
ac8efcbdd5 chore(dashboard): add changeset 2022-11-30 16:13:30 +01:00
Szilárd Dóró
9bc346e8d4 fix(dashboard): minor layout fixes in provider alert 2022-11-30 16:12:11 +01:00
Nuno Pato
efed987d31 fix linter 2022-11-30 12:12:48 -01:00
Nuno Pato
bdab7da7d3 fix linter 2022-11-30 12:02:10 -01:00
Nuno Pato
c2d9993968 asd 2022-11-30 11:53:30 -01:00
Nuno Pato
508ba62207 update copy 2022-11-30 11:52:41 -01:00
Nuno Pato
a3318de06e incorporate minor changes from comments 2022-11-30 11:49:25 -01:00
Pierre-Louis Mercereau
26d577d7ae Merge branch 'main' into refactor/merge-core 2022-11-30 11:43:30 +01:00
Nuno Pato
fa9f7ca052 Deprecate old DNS name 2022-11-30 03:01:17 -01:00
Pierre-Louis Mercereau
622c48a94b chore: update changeset 2022-11-29 16:18:18 +01:00
Pierre-Louis Mercereau
e1a87a05b1 chore: update lock file 2022-11-29 16:15:49 +01:00
Pierre-Louis Mercereau
2148317282 Merge branch 'main' into refactor/merge-core 2022-11-29 16:15:05 +01:00
Pierre-Louis Mercereau
5f9c6c8346 Merge branch 'main' into refactor/merge-core 2022-11-28 21:16:06 +01:00
Pierre-Louis Mercereau
57db5b83d4 chore: 🤖 changeset 2022-11-28 15:39:21 +01:00
Pierre-Louis Mercereau
3cab18713a Merge branch 'main' into refactor/merge-core 2022-11-24 17:33:18 +01:00
Pierre-Louis Mercereau
fb94dae43a chore: merge main 2022-11-24 17:17:04 +01:00
Pierre-Louis Mercereau
f694846eae chore: 🤖 remove hasura-storage-js to hasura-auth-js 2022-11-24 16:54:13 +01:00
Pierre-Louis Mercereau
322ab50138 Merge branch 'main' into refactor/merge-core 2022-11-22 09:52:45 +01:00
Pierre-Louis Mercereau
435efd2bc5 fix: 🐛 Set same-site cookie to lax 2022-11-21 15:22:05 +01:00
Szilárd Dóró
5501a5937e fix(docgen): complex types in markdown tables 2022-11-16 12:27:24 +01:00
Pierre-Louis Mercereau
80a6808a82 Merge branch 'main' into refactor/merge-core 2022-11-16 10:26:11 +01:00
Pierre-Louis Mercereau
987bd70312 Merge branch 'main' into refactor/merge-core 2022-11-15 14:14:58 +01:00
Pierre-Louis Mercereau
feb22e62c1 fix: add missing oauth provider: azuread 2022-11-14 23:48:45 +01:00
Pierre-Louis Mercereau
e7d4c77a6d refactor: 💡 restructure hasura-auth-js after the core merger 2022-11-14 23:20:49 +01:00
Pierre-Louis Mercereau
628e32464d Merge branch 'main' into refactor/merge-core 2022-11-14 21:45:05 +01:00
Pierre-Louis Mercereau
dc82043254 chore: only include the auth client typedoc 2022-11-09 22:13:20 +01:00
Pierre-Louis Mercereau
997e9d58a8 refactor: 💡 remove @nhost/core 2022-11-09 22:09:17 +01:00
Pierre-Louis Mercereau
8a3f1706fe chore: add auth as a dependency to storage 2022-11-09 22:01:11 +01:00
Pierre-Louis Mercereau
12cbe4d534 chore: lint 2022-11-09 21:52:15 +01:00
Pierre-Louis Mercereau
9f21931201 refactor: copy tests from core 2022-11-09 21:46:32 +01:00
Pierre-Louis Mercereau
09351e1910 Merge branch 'main' into refactor/merge-core 2022-11-09 20:49:33 +01:00
Pierre-Louis Mercereau
1c2ea5a407 refactor: 💡 merge @nhost/core 2022-11-09 20:49:13 +01:00
694 changed files with 6294 additions and 14821 deletions

View File

@@ -36,13 +36,23 @@ jobs:
TURBO_TOKEN: ${{ env.TURBO_TOKEN }} TURBO_TOKEN: ${{ env.TURBO_TOKEN }}
TURBO_TEAM: ${{ env.TURBO_TEAM }} TURBO_TEAM: ${{ env.TURBO_TEAM }}
BUILD: 'all' BUILD: 'all'
- name: Check if the pnpm lockfile changed
id: changed-lockfile
uses: tj-actions/changed-files@v34
with:
files: pnpm-lock.yaml
# * Determine a pnpm filter argument for packages that have been modified.
# * If the lockfile has changed, we don't filter anything in order to run all the e2e tests.
- name: filter packages
id: filter-packages
if: steps.changed-lockfile.outputs.any_changed != 'true' && github.event_name == 'pull_request'
run: echo "filter=${{ format('--filter=...[origin/{0}]', github.base_ref) }}" >> $GITHUB_OUTPUT
# * List packagesthat has an `e2e` script, except the root, and return an array of their name and path # * List packagesthat has an `e2e` script, except the root, and return an array of their name and path
# * In a PR, only include packages that have been modified, and their dependencies # * In a PR, only include packages that have been modified, and their dependencies
- name: List examples with an e2e script - name: List examples with an e2e script
id: set-matrix id: set-matrix
run: | run: |
FILTER_MODIFIED="${{ github.event_name == 'pull_request' && format('--filter=...[origin/{0}]', github.base_ref) || '' }}" PACKAGES=$(pnpm recursive list --depth -1 --parseable --filter='!nhost-root' ${{ steps.filter-packages.outputs.filter }} \
PACKAGES=$(pnpm recursive list --depth -1 --parseable --filter='!nhost-root' $FILTER_MODIFIED \
| xargs -I@ realpath --relative-to=$PWD @ \ | xargs -I@ realpath --relative-to=$PWD @ \
| xargs -I@ jq "if (.scripts.e2e | length) != 0 then {name: .name, path: \"@\"} else null end" @/package.json \ | xargs -I@ jq "if (.scripts.e2e | length) != 0 then {name: .name, path: \"@\"} else null end" @/package.json \
| awk "!/null/" \ | awk "!/null/" \

View File

@@ -21,7 +21,6 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
fetch-depth: 0 fetch-depth: 0
token: ${{ secrets.GH_PAT }}
# * Install Node and dependencies. Package downloads will be cached for the next jobs. # * Install Node and dependencies. Package downloads will be cached for the next jobs.
- name: Install Node and dependencies - name: Install Node and dependencies
uses: ./.github/actions/install-dependencies uses: ./.github/actions/install-dependencies
@@ -32,7 +31,7 @@ jobs:
- name: Determine bumps - name: Determine bumps
id: bumps id: bumps
run: | run: |
LAST_NON_PR_SHA=$(git log --no-merges main origin/${{ github.head_ref }} --format=format:%h | head -2 | tail -1) LAST_NON_PR_SHA=$(git log --no-merges main origin/${{ github.head_ref }} --format=format:%h -- | head -2 | tail -1)
echo "result<<EOF" >> $GITHUB_OUTPUT echo "result<<EOF" >> $GITHUB_OUTPUT
pnpm recursive list --depth -1 --parseable \ pnpm recursive list --depth -1 --parseable \
--filter='!nhost-root' \ --filter='!nhost-root' \

1
.npmrc Normal file
View File

@@ -0,0 +1 @@
prefer-workspace-packages = true

View File

@@ -14,4 +14,5 @@ package.json
tsconfig.json tsconfig.json
tsconfig.*.json tsconfig.*.json
*.d.ts *.d.ts
.next .next
**/pnpm-lock.yaml

View File

@@ -258,21 +258,28 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Subhendu Kundu</b></sub> <sub><b>Subhendu Kundu</b></sub>
</a> </a>
</td> </td>
<td align="center">
<a href="https://github.com/badgifter">
<img src="https://avatars.githubusercontent.com/u/50094885?v=4" width="100;" alt="badgifter"/>
<br />
<sub><b>Bad Gifter</b></sub>
</a>
</td>
<td align="center"> <td align="center">
<a href="https://github.com/heygambo"> <a href="https://github.com/heygambo">
<img src="https://avatars.githubusercontent.com/u/449438?v=4" width="100;" alt="heygambo"/> <img src="https://avatars.githubusercontent.com/u/449438?v=4" width="100;" alt="heygambo"/>
<br /> <br />
<sub><b>Christian Gambardella</b></sub> <sub><b>Christian Gambardella</b></sub>
</a> </a>
</td> </td></tr>
<tr>
<td align="center"> <td align="center">
<a href="https://github.com/dbarrosop"> <a href="https://github.com/dbarrosop">
<img src="https://avatars.githubusercontent.com/u/6246622?v=4" width="100;" alt="dbarrosop"/> <img src="https://avatars.githubusercontent.com/u/6246622?v=4" width="100;" alt="dbarrosop"/>
<br /> <br />
<sub><b>David Barroso</b></sub> <sub><b>David Barroso</b></sub>
</a> </a>
</td></tr> </td>
<tr>
<td align="center"> <td align="center">
<a href="https://github.com/hajek-raven"> <a href="https://github.com/hajek-raven">
<img src="https://avatars.githubusercontent.com/u/7288737?v=4" width="100;" alt="hajek-raven"/> <img src="https://avatars.githubusercontent.com/u/7288737?v=4" width="100;" alt="hajek-raven"/>
@@ -294,13 +301,21 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Jerry Jäppinen</b></sub> <sub><b>Jerry Jäppinen</b></sub>
</a> </a>
</td> </td>
<td align="center">
<a href="https://github.com/wollerman">
<img src="https://avatars.githubusercontent.com/u/1610241?v=4" width="100;" alt="wollerman"/>
<br />
<sub><b>Matt Wollerman</b></sub>
</a>
</td>
<td align="center"> <td align="center">
<a href="https://github.com/mdp18"> <a href="https://github.com/mdp18">
<img src="https://avatars.githubusercontent.com/u/11698527?v=4" width="100;" alt="mdp18"/> <img src="https://avatars.githubusercontent.com/u/11698527?v=4" width="100;" alt="mdp18"/>
<br /> <br />
<sub><b>Max</b></sub> <sub><b>Max</b></sub>
</a> </a>
</td> </td></tr>
<tr>
<td align="center"> <td align="center">
<a href="https://github.com/mustafa-hanif"> <a href="https://github.com/mustafa-hanif">
<img src="https://avatars.githubusercontent.com/u/30019262?v=4" width="100;" alt="mustafa-hanif"/> <img src="https://avatars.githubusercontent.com/u/30019262?v=4" width="100;" alt="mustafa-hanif"/>
@@ -314,8 +329,7 @@ Here are some ways of contributing to making Nhost better:
<br /> <br />
<sub><b>Nicolas Bourdin</b></sub> <sub><b>Nicolas Bourdin</b></sub>
</a> </a>
</td></tr> </td>
<tr>
<td align="center"> <td align="center">
<a href="https://github.com/piromsurang"> <a href="https://github.com/piromsurang">
<img src="https://avatars.githubusercontent.com/u/17776837?v=4" width="100;" alt="piromsurang"/> <img src="https://avatars.githubusercontent.com/u/17776837?v=4" width="100;" alt="piromsurang"/>
@@ -343,7 +357,8 @@ Here are some ways of contributing to making Nhost better:
<br /> <br />
<sub><b>Muttenzer</b></sub> <sub><b>Muttenzer</b></sub>
</a> </a>
</td> </td></tr>
<tr>
<td align="center"> <td align="center">
<a href="https://github.com/alexander-mart"> <a href="https://github.com/alexander-mart">
<img src="https://avatars.githubusercontent.com/u/14993551?v=4" width="100;" alt="alexander-mart"/> <img src="https://avatars.githubusercontent.com/u/14993551?v=4" width="100;" alt="alexander-mart"/>
@@ -357,8 +372,7 @@ Here are some ways of contributing to making Nhost better:
<br /> <br />
<sub><b>Amir Ahmic</b></sub> <sub><b>Amir Ahmic</b></sub>
</a> </a>
</td></tr> </td>
<tr>
<td align="center"> <td align="center">
<a href="https://github.com/akd-io"> <a href="https://github.com/akd-io">
<img src="https://avatars.githubusercontent.com/u/30059155?v=4" width="100;" alt="akd-io"/> <img src="https://avatars.githubusercontent.com/u/30059155?v=4" width="100;" alt="akd-io"/>
@@ -386,7 +400,8 @@ Here are some ways of contributing to making Nhost better:
<br /> <br />
<sub><b>Chris Wetherell</b></sub> <sub><b>Chris Wetherell</b></sub>
</a> </a>
</td> </td></tr>
<tr>
<td align="center"> <td align="center">
<a href="https://github.com/rustyb"> <a href="https://github.com/rustyb">
<img src="https://avatars.githubusercontent.com/u/53086?v=4" width="100;" alt="rustyb"/> <img src="https://avatars.githubusercontent.com/u/53086?v=4" width="100;" alt="rustyb"/>
@@ -400,8 +415,7 @@ Here are some ways of contributing to making Nhost better:
<br /> <br />
<sub><b>Dago</b></sub> <sub><b>Dago</b></sub>
</a> </a>
</td></tr> </td>
<tr>
<td align="center"> <td align="center">
<a href="https://github.com/dminkovsky"> <a href="https://github.com/dminkovsky">
<img src="https://avatars.githubusercontent.com/u/218725?v=4" width="100;" alt="dminkovsky"/> <img src="https://avatars.githubusercontent.com/u/218725?v=4" width="100;" alt="dminkovsky"/>
@@ -429,7 +443,8 @@ Here are some ways of contributing to making Nhost better:
<br /> <br />
<sub><b>Helio Alves</b></sub> <sub><b>Helio Alves</b></sub>
</a> </a>
</td> </td></tr>
<tr>
<td align="center"> <td align="center">
<a href="https://github.com/nkhdo"> <a href="https://github.com/nkhdo">
<img src="https://avatars.githubusercontent.com/u/26102306?v=4" width="100;" alt="nkhdo"/> <img src="https://avatars.githubusercontent.com/u/26102306?v=4" width="100;" alt="nkhdo"/>
@@ -437,14 +452,20 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Hoang Do</b></sub> <sub><b>Hoang Do</b></sub>
</a> </a>
</td> </td>
<td align="center">
<a href="https://github.com/iangabrielsanchez">
<img src="https://avatars.githubusercontent.com/u/9511946?v=4" width="100;" alt="iangabrielsanchez"/>
<br />
<sub><b>Ian Gabriel Sanchez</b></sub>
</a>
</td>
<td align="center"> <td align="center">
<a href="https://github.com/eltociear"> <a href="https://github.com/eltociear">
<img src="https://avatars.githubusercontent.com/u/22633385?v=4" width="100;" alt="eltociear"/> <img src="https://avatars.githubusercontent.com/u/22633385?v=4" width="100;" alt="eltociear"/>
<br /> <br />
<sub><b>Ikko Ashimine</b></sub> <sub><b>Ikko Ashimine</b></sub>
</a> </a>
</td></tr> </td>
<tr>
<td align="center"> <td align="center">
<a href="https://github.com/jladuval"> <a href="https://github.com/jladuval">
<img src="https://avatars.githubusercontent.com/u/1935359?v=4" width="100;" alt="jladuval"/> <img src="https://avatars.githubusercontent.com/u/1935359?v=4" width="100;" alt="jladuval"/>
@@ -465,7 +486,8 @@ Here are some ways of contributing to making Nhost better:
<br /> <br />
<sub><b>Lucas Bois</b></sub> <sub><b>Lucas Bois</b></sub>
</a> </a>
</td> </td></tr>
<tr>
<td align="center"> <td align="center">
<a href="https://github.com/MarcelloTheArcane"> <a href="https://github.com/MarcelloTheArcane">
<img src="https://avatars.githubusercontent.com/u/21159570?v=4" width="100;" alt="MarcelloTheArcane"/> <img src="https://avatars.githubusercontent.com/u/21159570?v=4" width="100;" alt="MarcelloTheArcane"/>
@@ -486,8 +508,7 @@ Here are some ways of contributing to making Nhost better:
<br /> <br />
<sub><b>Nirmalya Ghosh</b></sub> <sub><b>Nirmalya Ghosh</b></sub>
</a> </a>
</td></tr> </td>
<tr>
<td align="center"> <td align="center">
<a href="https://github.com/quentin-decre"> <a href="https://github.com/quentin-decre">
<img src="https://avatars.githubusercontent.com/u/1137511?v=4" width="100;" alt="quentin-decre"/> <img src="https://avatars.githubusercontent.com/u/1137511?v=4" width="100;" alt="quentin-decre"/>
@@ -508,7 +529,8 @@ Here are some ways of contributing to making Nhost better:
<br /> <br />
<sub><b>Simon Altschuler</b></sub> <sub><b>Simon Altschuler</b></sub>
</a> </a>
</td> </td></tr>
<tr>
<td align="center"> <td align="center">
<a href="https://github.com/atapas"> <a href="https://github.com/atapas">
<img src="https://avatars.githubusercontent.com/u/3633137?v=4" width="100;" alt="atapas"/> <img src="https://avatars.githubusercontent.com/u/3633137?v=4" width="100;" alt="atapas"/>
@@ -529,8 +551,7 @@ Here are some ways of contributing to making Nhost better:
<br /> <br />
<sub><b>Vadim</b></sub> <sub><b>Vadim</b></sub>
</a> </a>
</td></tr> </td>
<tr>
<td align="center"> <td align="center">
<a href="https://github.com/TheRedLancer"> <a href="https://github.com/TheRedLancer">
<img src="https://avatars.githubusercontent.com/u/58493767?v=4" width="100;" alt="TheRedLancer"/> <img src="https://avatars.githubusercontent.com/u/58493767?v=4" width="100;" alt="TheRedLancer"/>

View File

@@ -19,7 +19,9 @@ module.exports = {
'*.spec.ts', '*.spec.ts',
'*.spec.tsx', '*.spec.tsx',
'tests/**/*.ts', 'tests/**/*.ts',
'tests/**/*.d.ts' 'tests/**/*.d.ts',
'e2e/**/*.ts',
'e2e/**/*.d.ts'
], ],
plugins: ['@typescript-eslint', 'cypress'], plugins: ['@typescript-eslint', 'cypress'],
extends: ['plugin:cypress/recommended'], extends: ['plugin:cypress/recommended'],

View File

@@ -1,6 +1,4 @@
module.exports = { module.exports = {
'(packages|integrations)/(docgen|hasura-auth-js|hasura-storage-js|nextjs|nhost-js|react|core|vue)/src/**/*.{js,ts,jsx,tsx}':
['pnpm docgen', 'git add docs'],
'(nhost-cloud.yaml|**/nhost/config.yaml)': () => [ '(nhost-cloud.yaml|**/nhost/config.yaml)': () => [
'pnpm sync-versions', 'pnpm sync-versions',
"git add ':(glob)**/nhost/config.yaml'" "git add ':(glob)**/nhost/config.yaml'"

View File

@@ -28,22 +28,47 @@
"resolveJsonModule": true, "resolveJsonModule": true,
"esModuleInterop": true, "esModuleInterop": true,
"sourceMap": true, "sourceMap": true,
"types": ["node"], "types": [
"node"
],
"typeRoots": [ "typeRoots": [
"./node_modules/@types", "**/*/dist", "**/*/build", "**/*/.next", "**/*/umd" "./node_modules/@types",
"**/*/dist",
"**/*/build",
"**/*/.next",
"**/*/umd"
], ],
"paths": { "paths": {
"@nhost/apollo": ["../packages/apollo/src/index.ts"], "@nhost/apollo": [
"@nhost/core": ["../packages/core/src/index.ts"], "../packages/apollo/src/index.ts"
"@nhost/docgen": ["../packages/docgen/src/index.ts"], ],
"@nhost/hasura-auth-js": ["../packages/hasura-auth-js/src/index.ts"], "@nhost/docgen": [
"@nhost/hasura-storage-js": ["../packages/hasura-storage-js/src/index.ts"], "../packages/docgen/src/index.ts"
"@nhost/nextjs": ["../packages/nextjs/src/index.ts"], ],
"@nhost/nhost-js": ["../packages/nhost-js/src/index.ts"], "@nhost/hasura-auth-js": [
"@nhost/react": ["../packages/react/src/index.ts"], "../packages/hasura-auth-js/src/index.ts"
"@nhost/react-apollo": ["../packages/react-apollo/src/index.ts"], ],
"@nhost/react-auth": ["../packages/react-auth/src/index.ts"], "@nhost/hasura-storage-js": [
"@nhost/vue": ["../packages/vue/src/index.ts"] "../packages/hasura-storage-js/src/index.ts"
],
"@nhost/nextjs": [
"../packages/nextjs/src/index.ts"
],
"@nhost/nhost-js": [
"../packages/nhost-js/src/index.ts"
],
"@nhost/react": [
"../packages/react/src/index.ts"
],
"@nhost/react-apollo": [
"../packages/react-apollo/src/index.ts"
],
"@nhost/react-auth": [
"../packages/react-auth/src/index.ts"
],
"@nhost/vue": [
"../packages/vue/src/index.ts"
]
} }
}, },
"exclude": [ "exclude": [

View File

@@ -1,5 +1,50 @@
# @nhost/dashboard # @nhost/dashboard
## 0.7.10
### Patch Changes
- Updated dependencies [57db5b83]
- @nhost/nextjs@1.11.0
- @nhost/nhost-js@1.7.0
- @nhost/react@0.17.0
- @nhost/react-apollo@4.11.0
## 0.7.9
### Patch Changes
- a6d31dc2: fix(dashboard): don't break the UI when project is not loaded yet
## 0.7.8
### Patch Changes
- 7f251111: Use `NhostProvider` instead of `NhostReactProvider` and `NhostNextProvider`
`NhostReactProvider` and `NhostNextProvider` are now deprecated
- f4d70f88: fix(dashboard): do not break when region is nullish
- 4a9471cc: Windows Live Provider displayed link updated to match backend url
- 594488e4: fix(dashboard): do not show error when submitting Apple provider settings
- Updated dependencies [7f251111]
- @nhost/nextjs@1.10.0
- @nhost/react@0.16.0
- @nhost/react-apollo@4.10.0
## 0.7.7
### Patch Changes
- 80b604ad: fix(dashboard): use correct Hasura slug
## 0.7.6
### Patch Changes
- 2d2beb53: fix(dashboard): prevent error on GraphQL page
- ac8efcbd: chore(dashboard): deprecate old DNS name
## 0.7.5 ## 0.7.5
### Patch Changes ### Patch Changes

View File

@@ -1,6 +1,6 @@
{ {
"name": "@nhost/dashboard", "name": "@nhost/dashboard",
"version": "0.7.5", "version": "0.7.10",
"private": true, "private": true,
"scripts": { "scripts": {
"preinstall": "npx only-allow pnpm", "preinstall": "npx only-allow pnpm",
@@ -34,7 +34,6 @@
"@mui/material": "^5.10.14", "@mui/material": "^5.10.14",
"@mui/system": "^5.10.14", "@mui/system": "^5.10.14",
"@mui/x-date-pickers": "^5.0.8", "@mui/x-date-pickers": "^5.0.8",
"@nhost/core": "workspace:*",
"@nhost/nextjs": "workspace:*", "@nhost/nextjs": "workspace:*",
"@nhost/nhost-js": "workspace:*", "@nhost/nhost-js": "workspace:*",
"@nhost/react": "workspace:*", "@nhost/react": "workspace:*",
@@ -53,7 +52,7 @@
"cross-fetch": "^3.1.5", "cross-fetch": "^3.1.5",
"date-fns": "^2.29.3", "date-fns": "^2.29.3",
"generate-password": "^1.7.0", "generate-password": "^1.7.0",
"graphiql": "^2.1.0", "graphiql": "^2.2.0",
"graphql": "^16.6.0", "graphql": "^16.6.0",
"graphql-request": "^4.3.0", "graphql-request": "^4.3.0",
"graphql-tag": "^2.12.6", "graphql-tag": "^2.12.6",

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -6,7 +6,7 @@ import ArrowSquareOutIcon from '@/ui/v2/icons/ArrowSquareOutIcon';
import Link from '@/ui/v2/Link'; import Link from '@/ui/v2/Link';
import Text from '@/ui/v2/Text'; import Text from '@/ui/v2/Text';
import { LOCAL_HASURA_URL } from '@/utils/env'; import { LOCAL_HASURA_URL } from '@/utils/env';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import Image from 'next/image'; import Image from 'next/image';
interface HasuraDataProps { interface HasuraDataProps {
@@ -26,7 +26,11 @@ export function HasuraData({ close }: HasuraDataProps) {
const hasuraUrl = const hasuraUrl =
process.env.NEXT_PUBLIC_ENV === 'dev' process.env.NEXT_PUBLIC_ENV === 'dev'
? LOCAL_HASURA_URL ? LOCAL_HASURA_URL
: generateRemoteAppUrl(currentApplication.subdomain); : `${generateAppServiceUrl(
currentApplication?.subdomain,
currentApplication?.region.awsName,
'hasura',
)}/console`;
return ( return (
<div className="mx-auto w-full max-w-md px-6 py-4 text-left"> <div className="mx-auto w-full max-w-md px-6 py-4 text-left">
@@ -60,7 +64,7 @@ export function HasuraData({ close }: HasuraDataProps) {
<div className="mt-6 grid grid-flow-row gap-2"> <div className="mt-6 grid grid-flow-row gap-2">
<Link <Link
href={`${hasuraUrl}/console`} href={hasuraUrl}
target="_blank" target="_blank"
rel="noreferrer noopener" rel="noreferrer noopener"
className="grid grid-flow-col items-center justify-center gap-1 rounded-[4px] bg-btn p-2 text-sm+ font-medium text-white hover:ring-2 motion-safe:transition-all" className="grid grid-flow-col items-center justify-center gap-1 rounded-[4px] bg-btn p-2 text-sm+ font-medium text-white hover:ring-2 motion-safe:transition-all"

View File

@@ -5,6 +5,9 @@ import Image from 'next/image';
export default function OverviewProjectInfo() { export default function OverviewProjectInfo() {
const { currentApplication } = useCurrentWorkspaceAndApplication(); const { currentApplication } = useCurrentWorkspaceAndApplication();
const { region, subdomain } = currentApplication || {};
const isRegionAvailable =
region?.awsName && region?.countryCode && region?.city;
return ( return (
<div className="grid grid-flow-row content-start gap-6"> <div className="grid grid-flow-row content-start gap-6">
@@ -16,28 +19,28 @@ export default function OverviewProjectInfo() {
<div className="grid grid-flow-row gap-3"> <div className="grid grid-flow-row gap-3">
<InfoCard <InfoCard
title="Region" title="Region"
value={currentApplication.region?.awsName} value={region?.awsName}
customValue={ customValue={
currentApplication.region && ( region.countryCode &&
region.city && (
<div className="grid grid-flow-col items-center gap-1 self-center"> <div className="grid grid-flow-col items-center gap-1 self-center">
<Image <Image
src={`/assets/${currentApplication.region.countryCode}.svg`} src={`/assets/${region.countryCode}.svg`}
alt={`Logo of ${currentApplication.region.countryCode}`} alt={`Logo of ${region.countryCode}`}
width={16} width={16}
height={16} height={16}
/> />
<Text className="text-sm font-medium text-greyscaleDark"> <Text className="text-sm font-medium text-greyscaleDark">
{currentApplication.region.city} ( {region.city} ({region.awsName})
{currentApplication.region.awsName})
</Text> </Text>
</div> </div>
) )
} }
disableCopy={!currentApplication.region} disableCopy={!isRegionAvailable}
/> />
<InfoCard title="Subdomain" value={currentApplication.subdomain} /> <InfoCard title="Subdomain" value={subdomain} />
</div> </div>
)} )}
</div> </div>

View File

@@ -14,7 +14,7 @@ import List from '@/ui/v2/List';
import { ListItem } from '@/ui/v2/ListItem'; import { ListItem } from '@/ui/v2/ListItem';
import Text from '@/ui/v2/Text'; import Text from '@/ui/v2/Text';
import { LOCAL_HASURA_URL } from '@/utils/env'; import { LOCAL_HASURA_URL } from '@/utils/env';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl, generateRemoteAppUrl } from '@/utils/helpers';
import { useGetAppInjectedVariablesQuery } from '@/utils/__generated__/graphql'; import { useGetAppInjectedVariablesQuery } from '@/utils/__generated__/graphql';
import { Fragment, useState } from 'react'; import { Fragment, useState } from 'react';
@@ -71,11 +71,6 @@ export default function SystemEnvironmentVariableSettings() {
}); });
} }
const hasuraUrl =
process.env.NEXT_PUBLIC_ENV === 'dev'
? LOCAL_HASURA_URL
: generateRemoteAppUrl(currentApplication.subdomain);
const systemEnvironmentVariables = [ const systemEnvironmentVariables = [
{ {
key: 'NHOST_BACKEND_URL', key: 'NHOST_BACKEND_URL',
@@ -83,7 +78,17 @@ export default function SystemEnvironmentVariableSettings() {
}, },
{ key: 'NHOST_SUBDOMAIN', value: currentApplication.subdomain }, { key: 'NHOST_SUBDOMAIN', value: currentApplication.subdomain },
{ key: 'NHOST_REGION', value: currentApplication.region.awsName }, { key: 'NHOST_REGION', value: currentApplication.region.awsName },
{ key: 'NHOST_HASURA_URL', value: `${hasuraUrl}/console` }, {
key: 'NHOST_HASURA_URL',
value:
process.env.NEXT_PUBLIC_ENV === 'dev'
? LOCAL_HASURA_URL
: `${generateAppServiceUrl(
currentApplication.subdomain,
currentApplication.region.awsName,
'hasura',
)}/console`,
},
{ key: 'NHOST_AUTH_URL', value: appClient.auth.url }, { key: 'NHOST_AUTH_URL', value: appClient.auth.url },
{ key: 'NHOST_GRAPHQL_URL', value: appClient.graphql.url }, { key: 'NHOST_GRAPHQL_URL', value: appClient.graphql.url },
{ key: 'NHOST_STORAGE_URL', value: appClient.storage.url }, { key: 'NHOST_STORAGE_URL', value: appClient.storage.url },

View File

@@ -11,7 +11,7 @@ import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input'; import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment'; import InputAdornment from '@/ui/v2/InputAdornment';
import { copy } from '@/utils/copy'; import { copy } from '@/utils/copy';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import { toastStyleProps } from '@/utils/settings/settingsConstants'; import { toastStyleProps } from '@/utils/settings/settingsConstants';
import { FormProvider, useForm } from 'react-hook-form'; import { FormProvider, useForm } from 'react-hook-form';
import { toast } from 'react-hot-toast'; import { toast } from 'react-hot-toast';
@@ -23,7 +23,6 @@ export interface AppleProviderFormValues {
authAppleKeyId: string; authAppleKeyId: string;
authAppleClientId: string; authAppleClientId: string;
authApplePrivateKey: string; authApplePrivateKey: string;
authAppleScope: string;
} }
export default function AppleProviderSettings() { export default function AppleProviderSettings() {
@@ -38,7 +37,6 @@ export default function AppleProviderSettings() {
authAppleKeyId, authAppleKeyId,
authAppleClientId, authAppleClientId,
authApplePrivateKey, authApplePrivateKey,
authAppleScope,
}, },
}, },
loading, loading,
@@ -57,7 +55,6 @@ export default function AppleProviderSettings() {
authAppleKeyId, authAppleKeyId,
authAppleClientId, authAppleClientId,
authApplePrivateKey, authApplePrivateKey,
authAppleScope,
authAppleEnabled, authAppleEnabled,
}, },
}); });
@@ -83,9 +80,7 @@ export default function AppleProviderSettings() {
const updateAppMutation = updateApp({ const updateAppMutation = updateApp({
variables: { variables: {
id: currentApplication.id, id: currentApplication.id,
app: { app: values,
...values,
},
}, },
}); });
@@ -96,7 +91,7 @@ export default function AppleProviderSettings() {
success: `Apple settings have been updated successfully.`, success: `Apple settings have been updated successfully.`,
error: `An error occurred while trying to update the project's Apple settings.`, error: `An error occurred while trying to update the project's Apple settings.`,
}, },
{ ...toastStyleProps }, toastStyleProps,
); );
form.reset(values); form.reset(values);
@@ -108,9 +103,11 @@ export default function AppleProviderSettings() {
<SettingsContainer <SettingsContainer
title="Apple" title="Apple"
description="Allow users to sign in with Apple." description="Allow users to sign in with Apple."
primaryActionButtonProps={{ slotProps={{
disabled: !formState.isValid || !formState.isDirty, submitButton: {
loading: formState.isSubmitting, disabled: !formState.isValid || !formState.isDirty,
loading: formState.isSubmitting,
},
}} }}
docsLink="https://docs.nhost.io/authentication/sign-in-with-apple" docsLink="https://docs.nhost.io/authentication/sign-in-with-apple"
docsTitle="how to sign in users with Apple" docsTitle="how to sign in users with Apple"
@@ -134,9 +131,9 @@ export default function AppleProviderSettings() {
hideEmptyHelperText hideEmptyHelperText
/> />
<Input <Input
{...register('authAppleScope')} {...register('authAppleClientId')}
name="authAppleScope" name="authAppleClientId"
id="authAppleScope" id="authAppleClientId"
label="Service ID" label="Service ID"
placeholder="Apple Service ID" placeholder="Apple Service ID"
className="col-span-1" className="col-span-1"
@@ -168,9 +165,11 @@ export default function AppleProviderSettings() {
<Input <Input
name="redirectUrl" name="redirectUrl"
id="redirectUrl" id="redirectUrl"
defaultValue={`${generateRemoteAppUrl( defaultValue={`${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/auth/signin/provider/apple/callback`} currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/apple/callback`}
className="col-span-2" className="col-span-2"
fullWidth fullWidth
hideEmptyHelperText hideEmptyHelperText
@@ -185,9 +184,11 @@ export default function AppleProviderSettings() {
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
copy( copy(
`${generateRemoteAppUrl( `${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/auth/signin/provider/apple/callback`, currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/apple/callback`,
'Redirect URL', 'Redirect URL',
); );
}} }}

View File

@@ -13,7 +13,7 @@ import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input'; import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment'; import InputAdornment from '@/ui/v2/InputAdornment';
import { copy } from '@/utils/copy'; import { copy } from '@/utils/copy';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import { toastStyleProps } from '@/utils/settings/settingsConstants'; import { toastStyleProps } from '@/utils/settings/settingsConstants';
import { FormProvider, useForm } from 'react-hook-form'; import { FormProvider, useForm } from 'react-hook-form';
import { toast } from 'react-hot-toast'; import { toast } from 'react-hot-toast';
@@ -112,9 +112,11 @@ export default function DiscordProviderSettings() {
fullWidth fullWidth
hideEmptyHelperText hideEmptyHelperText
label="Redirect URL" label="Redirect URL"
defaultValue={`${generateRemoteAppUrl( defaultValue={`${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/auth/signin/provider/discord/callback`} currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/discord/callback`}
disabled disabled
endAdornment={ endAdornment={
<InputAdornment position="end" className="absolute right-2"> <InputAdornment position="end" className="absolute right-2">
@@ -125,9 +127,11 @@ export default function DiscordProviderSettings() {
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
copy( copy(
`${generateRemoteAppUrl( `${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/auth/signin/provider/discord/callback`, currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/discord/callback`,
'Redirect URL', 'Redirect URL',
); );
}} }}

View File

@@ -13,7 +13,7 @@ import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input'; import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment'; import InputAdornment from '@/ui/v2/InputAdornment';
import { copy } from '@/utils/copy'; import { copy } from '@/utils/copy';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import { toastStyleProps } from '@/utils/settings/settingsConstants'; import { toastStyleProps } from '@/utils/settings/settingsConstants';
import { FormProvider, useForm } from 'react-hook-form'; import { FormProvider, useForm } from 'react-hook-form';
import { toast } from 'react-hot-toast'; import { toast } from 'react-hot-toast';
@@ -112,9 +112,11 @@ export default function FacebookProviderSettings() {
fullWidth fullWidth
hideEmptyHelperText hideEmptyHelperText
label="Redirect URL" label="Redirect URL"
defaultValue={`${generateRemoteAppUrl( defaultValue={`${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/auth/signin/provider/facebook/callback`} currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/facebook/callback`}
disabled disabled
endAdornment={ endAdornment={
<InputAdornment position="end" className="absolute right-2"> <InputAdornment position="end" className="absolute right-2">
@@ -125,9 +127,11 @@ export default function FacebookProviderSettings() {
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
copy( copy(
`${generateRemoteAppUrl( `${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/auth/signin/provider/facebook/callback`, currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/facebook/callback`,
'Redirect URL', 'Redirect URL',
); );
}} }}

View File

@@ -13,7 +13,7 @@ import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input'; import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment'; import InputAdornment from '@/ui/v2/InputAdornment';
import { copy } from '@/utils/copy'; import { copy } from '@/utils/copy';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import { toastStyleProps } from '@/utils/settings/settingsConstants'; import { toastStyleProps } from '@/utils/settings/settingsConstants';
import { FormProvider, useForm } from 'react-hook-form'; import { FormProvider, useForm } from 'react-hook-form';
import { toast } from 'react-hot-toast'; import { toast } from 'react-hot-toast';
@@ -112,9 +112,11 @@ export default function GitHubProviderSettings() {
fullWidth fullWidth
hideEmptyHelperText hideEmptyHelperText
label="Redirect URL" label="Redirect URL"
defaultValue={`${generateRemoteAppUrl( defaultValue={`${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/auth/signin/provider/github/callback`} currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/github/callback`}
disabled disabled
endAdornment={ endAdornment={
<InputAdornment position="end" className="absolute right-2"> <InputAdornment position="end" className="absolute right-2">
@@ -125,9 +127,11 @@ export default function GitHubProviderSettings() {
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
copy( copy(
`${generateRemoteAppUrl( `${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/auth/signin/provider/github/callback`, currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/github/callback`,
'Redirect URL', 'Redirect URL',
); );
}} }}

View File

@@ -13,7 +13,7 @@ import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input'; import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment'; import InputAdornment from '@/ui/v2/InputAdornment';
import { copy } from '@/utils/copy'; import { copy } from '@/utils/copy';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import { toastStyleProps } from '@/utils/settings/settingsConstants'; import { toastStyleProps } from '@/utils/settings/settingsConstants';
import { FormProvider, useForm } from 'react-hook-form'; import { FormProvider, useForm } from 'react-hook-form';
import { toast } from 'react-hot-toast'; import { toast } from 'react-hot-toast';
@@ -112,9 +112,11 @@ export default function GoogleProviderSettings() {
fullWidth fullWidth
hideEmptyHelperText hideEmptyHelperText
label="Redirect URL" label="Redirect URL"
defaultValue={`${generateRemoteAppUrl( defaultValue={`${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/auth/signin/provider/google/callback`} currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/google/callback`}
disabled disabled
endAdornment={ endAdornment={
<InputAdornment position="end" className="absolute right-2"> <InputAdornment position="end" className="absolute right-2">
@@ -125,9 +127,11 @@ export default function GoogleProviderSettings() {
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
copy( copy(
`${generateRemoteAppUrl( `${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/auth/signin/provider/google/callback`, currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/google/callback`,
'Redirect URL', 'Redirect URL',
); );
}} }}

View File

@@ -13,7 +13,7 @@ import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input'; import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment'; import InputAdornment from '@/ui/v2/InputAdornment';
import { copy } from '@/utils/copy'; import { copy } from '@/utils/copy';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import { toastStyleProps } from '@/utils/settings/settingsConstants'; import { toastStyleProps } from '@/utils/settings/settingsConstants';
import { FormProvider, useForm } from 'react-hook-form'; import { FormProvider, useForm } from 'react-hook-form';
import { toast } from 'react-hot-toast'; import { toast } from 'react-hot-toast';
@@ -112,9 +112,11 @@ export default function LinkedInProviderSettings() {
fullWidth fullWidth
hideEmptyHelperText hideEmptyHelperText
label="Redirect URL" label="Redirect URL"
defaultValue={`${generateRemoteAppUrl( defaultValue={`${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/auth/signin/provider/linkedin/callback`} currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/linkedin/callback`}
disabled disabled
endAdornment={ endAdornment={
<InputAdornment position="end" className="absolute right-2"> <InputAdornment position="end" className="absolute right-2">
@@ -125,9 +127,11 @@ export default function LinkedInProviderSettings() {
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
copy( copy(
`${generateRemoteAppUrl( `${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/auth/signin/provider/linkedin/callback`, currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/linkedin/callback`,
'Redirect URL', 'Redirect URL',
); );
}} }}

View File

@@ -0,0 +1,87 @@
import { useDialog } from '@/components/common/DialogProvider';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { Alert } from '@/ui/Alert';
import Button from '@/ui/v2/Button';
import ArrowSquareOutIcon from '@/ui/v2/icons/ArrowSquareOutIcon';
import Link from '@/ui/v2/Link';
import Text from '@/ui/v2/Text';
import { toastStyleProps } from '@/utils/settings/settingsConstants';
import { useConfirmProvidersUpdatedMutation } from '@/utils/__generated__/graphql';
import { useState } from 'react';
import toast from 'react-hot-toast';
export default function ProvidersUpdatedAlert() {
const { currentApplication } = useCurrentWorkspaceAndApplication();
const { openAlertDialog } = useDialog();
const [confirmed, setConfirmed] = useState(true);
const [confirmProvidersUpdated] = useConfirmProvidersUpdatedMutation({
variables: { id: currentApplication?.id },
});
async function handleSubmitConfirmation() {
const confirmProvidersUpdatedPromise = confirmProvidersUpdated();
await toast.promise(
confirmProvidersUpdatedPromise,
{
loading: 'Confirming...',
success: 'Your settings have been updated successfully.',
error: 'An error occurred while trying to confirm the message.',
},
toastStyleProps,
);
setConfirmed(false);
}
function handleOpenConfirmationDialog() {
openAlertDialog({
title: 'Confirm all providers updated?',
payload: (
<Text variant="subtitle1" component="span">
Please make sure to update all providers before continuing. Your
sign-in flows might break if you don&apos;t.
</Text>
),
props: {
onPrimaryAction: handleSubmitConfirmation,
},
});
}
if (!confirmed) {
return null;
}
return (
<Alert className="grid items-center grid-flow-row gap-2 p-4 place-items-center lg:grid-flow-col lg:place-content-between bg-amber-500">
<div className="grid grid-flow-row gap-1 text-left">
<Text className="font-semibold">
Please update the Redirect URL for all providers being used
</Text>
<Text className="text-sm+">
We are deprecating your project&apos;s old DNS name in favor of
individual DNS names for each service. Please make sure to update your
providers to use the new auth specific URL under <b>Redirect URL</b>{' '}
before the 1st of February 2023.{' '}
<Link
href="https://github.com/nhost/nhost/discussions/1319"
target="_blank"
rel="noopener noreferrer"
underline="hover"
className="font-medium"
>
Read the discussion here.
<ArrowSquareOutIcon className="w-4 h-4 ml-1" />
</Link>
</Text>
</div>
<Button variant="borderless" onClick={handleOpenConfirmationDialog}>
I have updated all Redirect URLs
</Button>
</Alert>
);
}

View File

@@ -0,0 +1 @@
export { default } from './ProvidersUpdatedAlert';

View File

@@ -13,7 +13,7 @@ import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input'; import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment'; import InputAdornment from '@/ui/v2/InputAdornment';
import { copy } from '@/utils/copy'; import { copy } from '@/utils/copy';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import { toastStyleProps } from '@/utils/settings/settingsConstants'; import { toastStyleProps } from '@/utils/settings/settingsConstants';
import { FormProvider, useForm } from 'react-hook-form'; import { FormProvider, useForm } from 'react-hook-form';
import { toast } from 'react-hot-toast'; import { toast } from 'react-hot-toast';
@@ -112,9 +112,11 @@ export default function SpotifyProviderSettings() {
fullWidth fullWidth
hideEmptyHelperText hideEmptyHelperText
label="Redirect URL" label="Redirect URL"
defaultValue={`${generateRemoteAppUrl( defaultValue={`${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/auth/signin/provider/spotify/callback`} currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/spotify/callback`}
disabled disabled
endAdornment={ endAdornment={
<InputAdornment position="end" className="absolute right-2"> <InputAdornment position="end" className="absolute right-2">
@@ -125,9 +127,11 @@ export default function SpotifyProviderSettings() {
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
copy( copy(
`${generateRemoteAppUrl( `${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/auth/signin/provider/spotify/callback`, currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/spotify/callback`,
'Redirect URL', 'Redirect URL',
); );
}} }}

View File

@@ -13,7 +13,7 @@ import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input'; import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment'; import InputAdornment from '@/ui/v2/InputAdornment';
import { copy } from '@/utils/copy'; import { copy } from '@/utils/copy';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import { toastStyleProps } from '@/utils/settings/settingsConstants'; import { toastStyleProps } from '@/utils/settings/settingsConstants';
import { FormProvider, useForm } from 'react-hook-form'; import { FormProvider, useForm } from 'react-hook-form';
import { toast } from 'react-hot-toast'; import { toast } from 'react-hot-toast';
@@ -112,9 +112,11 @@ export default function TwitchProviderSettings() {
fullWidth fullWidth
hideEmptyHelperText hideEmptyHelperText
label="Redirect URL" label="Redirect URL"
defaultValue={`${generateRemoteAppUrl( defaultValue={`${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/auth/signin/provider/twitch/callback`} currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/twitch/callback`}
disabled disabled
endAdornment={ endAdornment={
<InputAdornment position="end" className="absolute right-2"> <InputAdornment position="end" className="absolute right-2">
@@ -125,9 +127,11 @@ export default function TwitchProviderSettings() {
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
copy( copy(
`${generateRemoteAppUrl( `${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/auth/signin/provider/twitch/callback`, currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/twitch/callback`,
'Redirect URL', 'Redirect URL',
); );
}} }}

View File

@@ -11,7 +11,7 @@ import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input'; import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment'; import InputAdornment from '@/ui/v2/InputAdornment';
import { copy } from '@/utils/copy'; import { copy } from '@/utils/copy';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import { toastStyleProps } from '@/utils/settings/settingsConstants'; import { toastStyleProps } from '@/utils/settings/settingsConstants';
import { FormProvider, useForm } from 'react-hook-form'; import { FormProvider, useForm } from 'react-hook-form';
import { toast } from 'react-hot-toast'; import { toast } from 'react-hot-toast';
@@ -125,9 +125,11 @@ export default function TwitterProviderSettings() {
<Input <Input
name="redirectUrl" name="redirectUrl"
id="redirectUrl" id="redirectUrl"
defaultValue={`${generateRemoteAppUrl( defaultValue={`${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/auth/signin/provider/twitter/callback`} currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/twitter/callback`}
className="col-span-2" className="col-span-2"
fullWidth fullWidth
hideEmptyHelperText hideEmptyHelperText
@@ -142,9 +144,11 @@ export default function TwitterProviderSettings() {
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
copy( copy(
`${generateRemoteAppUrl( `${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/auth/signin/provider/twitter/callback`, currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/twitter/callback`,
'Redirect URL', 'Redirect URL',
); );
}} }}

View File

@@ -13,7 +13,7 @@ import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input'; import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment'; import InputAdornment from '@/ui/v2/InputAdornment';
import { copy } from '@/utils/copy'; import { copy } from '@/utils/copy';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import { toastStyleProps } from '@/utils/settings/settingsConstants'; import { toastStyleProps } from '@/utils/settings/settingsConstants';
import { FormProvider, useForm } from 'react-hook-form'; import { FormProvider, useForm } from 'react-hook-form';
import { toast } from 'react-hot-toast'; import { toast } from 'react-hot-toast';
@@ -111,9 +111,11 @@ export default function WindowsLiveProviderSettings() {
fullWidth fullWidth
hideEmptyHelperText hideEmptyHelperText
label="Redirect URL" label="Redirect URL"
defaultValue={`${generateRemoteAppUrl( defaultValue={`${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/auth/signin/provider/microsoft/callback`} currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/windowslive/callback`}
disabled disabled
endAdornment={ endAdornment={
<InputAdornment position="end" className="absolute right-2"> <InputAdornment position="end" className="absolute right-2">
@@ -124,9 +126,11 @@ export default function WindowsLiveProviderSettings() {
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
copy( copy(
`${generateRemoteAppUrl( `${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/auth/signin/provider/microsoft/callback`, currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/windowslive/callback`,
'Redirect URL', 'Redirect URL',
); );
}} }}

View File

@@ -11,7 +11,7 @@ import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input'; import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment'; import InputAdornment from '@/ui/v2/InputAdornment';
import { copy } from '@/utils/copy'; import { copy } from '@/utils/copy';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import { toastStyleProps } from '@/utils/settings/settingsConstants'; import { toastStyleProps } from '@/utils/settings/settingsConstants';
import { FormProvider, useForm } from 'react-hook-form'; import { FormProvider, useForm } from 'react-hook-form';
import { toast } from 'react-hot-toast'; import { toast } from 'react-hot-toast';
@@ -163,9 +163,11 @@ export default function WorkOsProviderSettings() {
<Input <Input
name="redirectUrl" name="redirectUrl"
id="redirectUrl" id="redirectUrl"
defaultValue={`${generateRemoteAppUrl( defaultValue={`${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/auth/signin/provider/workos/callback`} currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/workos/callback`}
className="col-span-6" className="col-span-6"
fullWidth fullWidth
hideEmptyHelperText hideEmptyHelperText
@@ -180,9 +182,11 @@ export default function WorkOsProviderSettings() {
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
copy( copy(
`${generateRemoteAppUrl( `${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/auth/signin/provider/workos/callback`, currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/workos/callback`,
'Redirect URL', 'Redirect URL',
); );
}} }}

View File

@@ -4,7 +4,7 @@ import { Modal } from '@/ui/Modal';
import Button from '@/ui/v2/Button'; import Button from '@/ui/v2/Button';
import Input from '@/ui/v2/Input'; import Input from '@/ui/v2/Input';
import Text from '@/ui/v2/Text'; import Text from '@/ui/v2/Text';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import { triggerToast } from '@/utils/toast'; import { triggerToast } from '@/utils/toast';
import { useApolloClient } from '@apollo/client'; import { useApolloClient } from '@apollo/client';
import axios from 'axios'; import axios from 'axios';
@@ -43,9 +43,11 @@ export function AddUserModal({ modalIsOpen, setModalIsOpen }: any) {
return; return;
} }
const signUpUrl = `${generateRemoteAppUrl( const signUpUrl = `${generateAppServiceUrl(
currentApplication?.subdomain, currentApplication?.subdomain,
)}/v1/auth/signup/email-password`; currentApplication?.region.awsName,
'auth',
)}/v1/signup/email-password`;
try { try {
await axios.post(signUpUrl, { await axios.post(signUpUrl, {

View File

@@ -7,6 +7,7 @@ fragment GetAppByWorkspaceAndName on apps {
name name
createdAt createdAt
isProvisioned isProvisioned
providersUpdated
githubRepository { githubRepository {
id id
name name

View File

@@ -0,0 +1,5 @@
mutation confirmProvidersUpdated($id: uuid!) {
updateApp(pk_columns: { id: $id }, _set: { providersUpdated: true }) {
id
}
}

View File

@@ -24,6 +24,7 @@ query getOneUser($userId: uuid!) {
createdAt createdAt
desiredState desiredState
nhostBaseFolder nhostBaseFolder
providersUpdated
featureFlags { featureFlags {
description description
id id

View File

@@ -1,6 +1,6 @@
import useIsPlatform from '@/hooks/common/useIsPlatform'; import useIsPlatform from '@/hooks/common/useIsPlatform';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication'; import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import type { MutationOptions } from '@tanstack/react-query'; import type { MutationOptions } from '@tanstack/react-query';
import { useMutation } from '@tanstack/react-query'; import { useMutation } from '@tanstack/react-query';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
@@ -38,7 +38,11 @@ export default function useCreateColumnMutation({
query: { dataSourceSlug, schemaSlug, tableSlug }, query: { dataSourceSlug, schemaSlug, tableSlug },
} = useRouter(); } = useRouter();
const { currentApplication } = useCurrentWorkspaceAndApplication(); const { currentApplication } = useCurrentWorkspaceAndApplication();
const appUrl = generateRemoteAppUrl(currentApplication?.subdomain); const appUrl = generateAppServiceUrl(
currentApplication?.subdomain,
currentApplication?.region.awsName,
'hasura',
);
const mutationFn = isPlatform ? createColumn : createColumnMigration; const mutationFn = isPlatform ? createColumn : createColumnMigration;
const mutation = useMutation( const mutation = useMutation(

View File

@@ -1,5 +1,5 @@
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication'; import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import type { MutationOptions } from '@tanstack/react-query'; import type { MutationOptions } from '@tanstack/react-query';
import { useMutation } from '@tanstack/react-query'; import { useMutation } from '@tanstack/react-query';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
@@ -40,7 +40,11 @@ export default function useCreateRecordMutation<TData extends object = {}>({
query: { dataSourceSlug, schemaSlug, tableSlug }, query: { dataSourceSlug, schemaSlug, tableSlug },
} = useRouter(); } = useRouter();
const { currentApplication } = useCurrentWorkspaceAndApplication(); const { currentApplication } = useCurrentWorkspaceAndApplication();
const appUrl = generateRemoteAppUrl(currentApplication?.subdomain); const appUrl = generateAppServiceUrl(
currentApplication?.subdomain,
currentApplication?.region.awsName,
'hasura',
);
const mutation = useMutation( const mutation = useMutation(
(variables) => (variables) =>

View File

@@ -1,6 +1,6 @@
import useIsPlatform from '@/hooks/common/useIsPlatform'; import useIsPlatform from '@/hooks/common/useIsPlatform';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication'; import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import type { MutationOptions } from '@tanstack/react-query'; import type { MutationOptions } from '@tanstack/react-query';
import { useMutation } from '@tanstack/react-query'; import { useMutation } from '@tanstack/react-query';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
@@ -36,7 +36,11 @@ export default function useCreateTableMutation({
} = useRouter(); } = useRouter();
const { currentApplication } = useCurrentWorkspaceAndApplication(); const { currentApplication } = useCurrentWorkspaceAndApplication();
const appUrl = generateRemoteAppUrl(currentApplication?.subdomain); const appUrl = generateAppServiceUrl(
currentApplication?.subdomain,
currentApplication?.region.awsName,
'hasura',
);
const mutationFn = isPlatform ? createTable : createTableMigration; const mutationFn = isPlatform ? createTable : createTableMigration;
const mutation = useMutation( const mutation = useMutation(

View File

@@ -1,5 +1,5 @@
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication'; import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import type { QueryKey, UseQueryOptions } from '@tanstack/react-query'; import type { QueryKey, UseQueryOptions } from '@tanstack/react-query';
import { useQuery } from '@tanstack/react-query'; import { useQuery } from '@tanstack/react-query';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
@@ -38,7 +38,11 @@ export default function useDatabaseQuery(
isReady, isReady,
} = useRouter(); } = useRouter();
const { currentApplication } = useCurrentWorkspaceAndApplication(); const { currentApplication } = useCurrentWorkspaceAndApplication();
const appUrl = generateRemoteAppUrl(currentApplication?.subdomain); const appUrl = generateAppServiceUrl(
currentApplication?.subdomain,
currentApplication?.region.awsName,
'hasura',
);
const query = useQuery<FetchDatabaseReturnType>( const query = useQuery<FetchDatabaseReturnType>(
queryKey, queryKey,

View File

@@ -1,6 +1,6 @@
import useIsPlatform from '@/hooks/common/useIsPlatform'; import useIsPlatform from '@/hooks/common/useIsPlatform';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication'; import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import type { MutationOptions } from '@tanstack/react-query'; import type { MutationOptions } from '@tanstack/react-query';
import { useMutation } from '@tanstack/react-query'; import { useMutation } from '@tanstack/react-query';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
@@ -39,7 +39,11 @@ export default function useDeleteColumnMutation({
query: { dataSourceSlug, schemaSlug, tableSlug }, query: { dataSourceSlug, schemaSlug, tableSlug },
} = useRouter(); } = useRouter();
const { currentApplication } = useCurrentWorkspaceAndApplication(); const { currentApplication } = useCurrentWorkspaceAndApplication();
const appUrl = generateRemoteAppUrl(currentApplication?.subdomain); const appUrl = generateAppServiceUrl(
currentApplication?.subdomain,
currentApplication?.region.awsName,
'hasura',
);
const mutationFn = isPlatform ? deleteColumn : deleteColumnMigration; const mutationFn = isPlatform ? deleteColumn : deleteColumnMigration;
const mutation = useMutation( const mutation = useMutation(

View File

@@ -1,5 +1,5 @@
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication'; import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import type { MutationOptions } from '@tanstack/react-query'; import type { MutationOptions } from '@tanstack/react-query';
import { useMutation } from '@tanstack/react-query'; import { useMutation } from '@tanstack/react-query';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
@@ -36,7 +36,11 @@ export default function useDeleteRecordMutation({
query: { dataSourceSlug, schemaSlug, tableSlug }, query: { dataSourceSlug, schemaSlug, tableSlug },
} = useRouter(); } = useRouter();
const { currentApplication } = useCurrentWorkspaceAndApplication(); const { currentApplication } = useCurrentWorkspaceAndApplication();
const appUrl = generateRemoteAppUrl(currentApplication?.subdomain); const appUrl = generateAppServiceUrl(
currentApplication?.subdomain,
currentApplication?.region.awsName,
'hasura',
);
const mutation = useMutation( const mutation = useMutation(
(variables) => (variables) =>

View File

@@ -1,6 +1,6 @@
import useIsPlatform from '@/hooks/common/useIsPlatform'; import useIsPlatform from '@/hooks/common/useIsPlatform';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication'; import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import type { MutationOptions } from '@tanstack/react-query'; import type { MutationOptions } from '@tanstack/react-query';
import { useMutation } from '@tanstack/react-query'; import { useMutation } from '@tanstack/react-query';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
@@ -34,7 +34,11 @@ export default function useDeleteTableMutation({
query: { dataSourceSlug }, query: { dataSourceSlug },
} = useRouter(); } = useRouter();
const { currentApplication } = useCurrentWorkspaceAndApplication(); const { currentApplication } = useCurrentWorkspaceAndApplication();
const appUrl = generateRemoteAppUrl(currentApplication?.subdomain); const appUrl = generateAppServiceUrl(
currentApplication?.subdomain,
currentApplication?.region.awsName,
'hasura',
);
const mutationFn = isPlatform ? deleteTable : deleteTableMigration; const mutationFn = isPlatform ? deleteTable : deleteTableMigration;
const mutation = useMutation( const mutation = useMutation(

View File

@@ -1,5 +1,5 @@
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication'; import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import type { QueryKey, UseQueryOptions } from '@tanstack/react-query'; import type { QueryKey, UseQueryOptions } from '@tanstack/react-query';
import { useQuery } from '@tanstack/react-query'; import { useQuery } from '@tanstack/react-query';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
@@ -39,7 +39,11 @@ export default function useMetadataQuery(
isReady, isReady,
} = useRouter(); } = useRouter();
const { currentApplication } = useCurrentWorkspaceAndApplication(); const { currentApplication } = useCurrentWorkspaceAndApplication();
const appUrl = generateRemoteAppUrl(currentApplication?.subdomain); const appUrl = generateAppServiceUrl(
currentApplication?.subdomain,
currentApplication?.region.awsName,
'hasura',
);
const query = useQuery<FetchMetadataReturnType>( const query = useQuery<FetchMetadataReturnType>(
queryKey, queryKey,

View File

@@ -1,5 +1,5 @@
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication'; import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import type { QueryKey, UseQueryOptions } from '@tanstack/react-query'; import type { QueryKey, UseQueryOptions } from '@tanstack/react-query';
import { useQuery } from '@tanstack/react-query'; import { useQuery } from '@tanstack/react-query';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
@@ -39,7 +39,11 @@ export default function useTableQuery(
isReady, isReady,
} = useRouter(); } = useRouter();
const { currentApplication } = useCurrentWorkspaceAndApplication(); const { currentApplication } = useCurrentWorkspaceAndApplication();
const appUrl = generateRemoteAppUrl(currentApplication?.subdomain); const appUrl = generateAppServiceUrl(
currentApplication?.subdomain,
currentApplication?.region.awsName,
'hasura',
);
return useQuery<FetchTableReturnType>( return useQuery<FetchTableReturnType>(
queryKey, queryKey,

View File

@@ -1,6 +1,6 @@
import useIsPlatform from '@/hooks/common/useIsPlatform'; import useIsPlatform from '@/hooks/common/useIsPlatform';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication'; import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import type { MutationOptions } from '@tanstack/react-query'; import type { MutationOptions } from '@tanstack/react-query';
import { useMutation } from '@tanstack/react-query'; import { useMutation } from '@tanstack/react-query';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
@@ -34,7 +34,11 @@ export default function useTrackForeignKeyRelationMutation({
query: { dataSourceSlug }, query: { dataSourceSlug },
} = useRouter(); } = useRouter();
const { currentApplication } = useCurrentWorkspaceAndApplication(); const { currentApplication } = useCurrentWorkspaceAndApplication();
const appUrl = generateRemoteAppUrl(currentApplication?.subdomain); const appUrl = generateAppServiceUrl(
currentApplication?.subdomain,
currentApplication?.region.awsName,
'hasura',
);
const mutationFn = isPlatform const mutationFn = isPlatform
? trackForeignKeyRelations ? trackForeignKeyRelations
: trackForeignKeyRelationsMigration; : trackForeignKeyRelationsMigration;

View File

@@ -1,6 +1,6 @@
import useIsPlatform from '@/hooks/common/useIsPlatform'; import useIsPlatform from '@/hooks/common/useIsPlatform';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication'; import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import type { MutationOptions } from '@tanstack/react-query'; import type { MutationOptions } from '@tanstack/react-query';
import { useMutation } from '@tanstack/react-query'; import { useMutation } from '@tanstack/react-query';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
@@ -35,7 +35,11 @@ export default function useTrackTableMutation({
query: { dataSourceSlug, schemaSlug }, query: { dataSourceSlug, schemaSlug },
} = useRouter(); } = useRouter();
const { currentApplication } = useCurrentWorkspaceAndApplication(); const { currentApplication } = useCurrentWorkspaceAndApplication();
const appUrl = generateRemoteAppUrl(currentApplication?.subdomain); const appUrl = generateAppServiceUrl(
currentApplication?.subdomain,
currentApplication?.region.awsName,
'hasura',
);
const mutationFn = isPlatform ? trackTable : trackTableMigration; const mutationFn = isPlatform ? trackTable : trackTableMigration;
const mutation = useMutation( const mutation = useMutation(

View File

@@ -1,6 +1,6 @@
import useIsPlatform from '@/hooks/common/useIsPlatform'; import useIsPlatform from '@/hooks/common/useIsPlatform';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication'; import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import type { MutationOptions } from '@tanstack/react-query'; import type { MutationOptions } from '@tanstack/react-query';
import { useMutation } from '@tanstack/react-query'; import { useMutation } from '@tanstack/react-query';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
@@ -39,7 +39,11 @@ export default function useUpdateColumnMutation({
query: { dataSourceSlug, schemaSlug, tableSlug }, query: { dataSourceSlug, schemaSlug, tableSlug },
} = useRouter(); } = useRouter();
const { currentApplication } = useCurrentWorkspaceAndApplication(); const { currentApplication } = useCurrentWorkspaceAndApplication();
const appUrl = generateRemoteAppUrl(currentApplication?.subdomain); const appUrl = generateAppServiceUrl(
currentApplication?.subdomain,
currentApplication?.region.awsName,
'hasura',
);
const mutationFn = isPlatform ? updateColumn : updateColumnMigration; const mutationFn = isPlatform ? updateColumn : updateColumnMigration;
const mutation = useMutation( const mutation = useMutation(

View File

@@ -1,5 +1,5 @@
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication'; import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import type { MutationOptions } from '@tanstack/react-query'; import type { MutationOptions } from '@tanstack/react-query';
import { useMutation } from '@tanstack/react-query'; import { useMutation } from '@tanstack/react-query';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
@@ -40,7 +40,11 @@ export default function useUpdateRecordMutation<TData extends object = {}>({
query: { dataSourceSlug, schemaSlug, tableSlug }, query: { dataSourceSlug, schemaSlug, tableSlug },
} = useRouter(); } = useRouter();
const { currentApplication } = useCurrentWorkspaceAndApplication(); const { currentApplication } = useCurrentWorkspaceAndApplication();
const appUrl = generateRemoteAppUrl(currentApplication?.subdomain); const appUrl = generateAppServiceUrl(
currentApplication?.subdomain,
currentApplication?.region.awsName,
'hasura',
);
const mutation = useMutation( const mutation = useMutation(
(variables) => (variables) =>

View File

@@ -1,6 +1,6 @@
import useIsPlatform from '@/hooks/common/useIsPlatform'; import useIsPlatform from '@/hooks/common/useIsPlatform';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication'; import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import type { MutationOptions } from '@tanstack/react-query'; import type { MutationOptions } from '@tanstack/react-query';
import { useMutation } from '@tanstack/react-query'; import { useMutation } from '@tanstack/react-query';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
@@ -35,7 +35,11 @@ export default function useUpdateTableMutation({
query: { dataSourceSlug, schemaSlug }, query: { dataSourceSlug, schemaSlug },
} = useRouter(); } = useRouter();
const { currentApplication } = useCurrentWorkspaceAndApplication(); const { currentApplication } = useCurrentWorkspaceAndApplication();
const appUrl = generateRemoteAppUrl(currentApplication?.subdomain); const appUrl = generateAppServiceUrl(
currentApplication?.subdomain,
currentApplication?.region.awsName,
'hasura',
);
const mutationFn = isPlatform ? updateTable : updateTableMigration; const mutationFn = isPlatform ? updateTable : updateTableMigration;
const mutation = useMutation( const mutation = useMutation(

View File

@@ -1,12 +1,16 @@
import type { QueryError, QueryResult } from '@/types/data-browser'; import type { QueryError, QueryResult } from '@/types/data-browser';
import normalizeQueryError from '@/utils/dataBrowser/normalizeQueryError'; import normalizeQueryError from '@/utils/dataBrowser/normalizeQueryError';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
export interface FetchProjectDatabaseSizeOptions { export interface FetchProjectDatabaseSizeOptions {
/** /**
* Project subdomain. * Project subdomain.
*/ */
subdomain: string; subdomain: string;
/**
* Project region.
*/
region: string;
/** /**
* Admin secret for the project. * Admin secret for the project.
*/ */
@@ -25,24 +29,26 @@ export interface FetchProjectDatabaseSizeReturnType {
*/ */
export default async function fetchProjectDatabaseSize({ export default async function fetchProjectDatabaseSize({
subdomain, subdomain,
region,
adminSecret, adminSecret,
}: FetchProjectDatabaseSizeOptions): Promise<FetchProjectDatabaseSizeReturnType> { }: FetchProjectDatabaseSizeOptions): Promise<FetchProjectDatabaseSizeReturnType> {
const appEndpoint = `${generateRemoteAppUrl(subdomain)}/v2/query`; const response = await fetch(
`${generateAppServiceUrl(subdomain, region, 'hasura')}/v2/query`,
const response = await fetch(appEndpoint, { {
method: 'POST', method: 'POST',
headers: { headers: {
'x-hasura-admin-secret': adminSecret, 'x-hasura-admin-secret': adminSecret,
},
body: JSON.stringify({
type: 'run_sql',
args: {
sql: `SELECT pg_database_size('${
subdomain === 'localhost' ? 'postgres' : subdomain
}');`,
}, },
}), body: JSON.stringify({
}); type: 'run_sql',
args: {
sql: `SELECT pg_database_size('${
subdomain === 'localhost' ? 'postgres' : subdomain
}');`,
},
}),
},
);
const responseData: QueryResult<string[]> | QueryError = const responseData: QueryResult<string[]> | QueryError =
await response.json(); await response.json();

View File

@@ -22,6 +22,7 @@ export default function useDatabaseSizeOfApplication(
() => () =>
fetchProjectDatabaseSize({ fetchProjectDatabaseSize({
subdomain: currentApplication?.subdomain, subdomain: currentApplication?.subdomain,
region: currentApplication?.region.awsName,
adminSecret: currentApplication?.hasuraGraphqlAdminSecret, adminSecret: currentApplication?.hasuraGraphqlAdminSecret,
}), }),
{ {

View File

@@ -42,11 +42,17 @@ export function useCurrentWorkspaceAndApplication(): UseCurrentWorkspaceAndAppli
], ],
deployments: [], deployments: [],
subdomain: 'localhost', subdomain: 'localhost',
region: null, region: {
id: null,
countryCode: null,
city: null,
awsName: null,
},
isProvisioned: true, isProvisioned: true,
createdAt: new Date().toISOString(), createdAt: new Date().toISOString(),
desiredState: ApplicationStatus.Live, desiredState: ApplicationStatus.Live,
featureFlags: [], featureFlags: [],
providersUpdated: true,
}; };
setCurrentWorkspaceAndApplication({ setCurrentWorkspaceAndApplication({

View File

@@ -1,4 +1,4 @@
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import type { import type {
Files_Order_By as FilesOrderBy, Files_Order_By as FilesOrderBy,
GetFilesQuery, GetFilesQuery,
@@ -66,9 +66,11 @@ export default function useFiles({
init: RequestInit, init: RequestInit,
size?: { width?: number; height?: number }, size?: { width?: number; height?: number },
) => { ) => {
const fetchUrl = `${generateRemoteAppUrl( const fetchUrl = `${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/storage/files/${file.id}`; currentApplication.region.awsName,
'storage',
)}/v1/files/${file.id}`;
const fetchParams = new URLSearchParams(); const fetchParams = new URLSearchParams();

View File

@@ -1,5 +1,5 @@
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication'; import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import { ApolloClient, HttpLink, InMemoryCache } from '@apollo/client'; import { ApolloClient, HttpLink, InMemoryCache } from '@apollo/client';
import { useMemo } from 'react'; import { useMemo } from 'react';
@@ -15,9 +15,11 @@ export function useRemoteApplicationGQLClient() {
new ApolloClient({ new ApolloClient({
cache: new InMemoryCache(), cache: new InMemoryCache(),
link: new HttpLink({ link: new HttpLink({
uri: `${generateRemoteAppUrl( uri: `${generateAppServiceUrl(
currentApplication?.subdomain, currentApplication?.subdomain,
)}/v1/graphql`, currentApplication?.region.awsName,
'graphql',
)}/v1`,
headers: { headers: {
'x-hasura-admin-secret': 'x-hasura-admin-secret':
process.env.NEXT_PUBLIC_ENV === 'dev' process.env.NEXT_PUBLIC_ENV === 'dev'
@@ -28,6 +30,7 @@ export function useRemoteApplicationGQLClient() {
}), }),
[ [
currentApplication?.subdomain, currentApplication?.subdomain,
currentApplication?.region,
currentApplication?.hasuraGraphqlAdminSecret, currentApplication?.hasuraGraphqlAdminSecret,
], ],
); );

View File

@@ -13,7 +13,7 @@ import DelayedLoading from '@/ui/DelayedLoading';
import { Modal } from '@/ui/Modal'; import { Modal } from '@/ui/Modal';
import Status, { StatusEnum } from '@/ui/Status'; import Status, { StatusEnum } from '@/ui/Status';
import { Text } from '@/ui/Text'; import { Text } from '@/ui/Text';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import { useGetAppFunctionsMetadataQuery } from '@/utils/__generated__/graphql'; import { useGetAppFunctionsMetadataQuery } from '@/utils/__generated__/graphql';
import { ChevronRightIcon } from '@heroicons/react/solid'; import { ChevronRightIcon } from '@heroicons/react/solid';
import clsx from 'clsx'; import clsx from 'clsx';
@@ -252,9 +252,11 @@ export default function FunctionsPage() {
<div className="text-center"> <div className="text-center">
<Text size="tiny" color="greyscaleDark" className="font-medium"> <Text size="tiny" color="greyscaleDark" className="font-medium">
Base URL for function endpoints is{' '} Base URL for function endpoints is{' '}
{`${generateRemoteAppUrl( {`${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/functions/`} currentApplication.region.awsName,
'functions',
)}/v1`}
</Text> </Text>
</div> </div>
</div> </div>

View File

@@ -8,7 +8,7 @@ import ProjectLayout from '@/components/layout/ProjectLayout';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication'; import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { useGetAllUserWorkspacesAndApplications } from '@/hooks/useGetAllUserWorkspacesAndApplications'; import { useGetAllUserWorkspacesAndApplications } from '@/hooks/useGetAllUserWorkspacesAndApplications';
import { Text } from '@/ui/Text'; import { Text } from '@/ui/Text';
import { generateRemoteAppUrl, yieldFunction } from '@/utils/helpers'; import { generateAppServiceUrl, yieldFunction } from '@/utils/helpers';
import { useGetAppFunctionsMetadataQuery } from '@/utils/__generated__/graphql'; import { useGetAppFunctionsMetadataQuery } from '@/utils/__generated__/graphql';
import Image from 'next/image'; import Image from 'next/image';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
@@ -84,15 +84,19 @@ export default function FunctionDetailsPage() {
</Text> </Text>
<a <a
className="ml-2 text-xs font-medium text-greyscaleGrey" className="ml-2 text-xs font-medium text-greyscaleGrey"
href={`${generateRemoteAppUrl( href={`${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/functions${currentFunction?.route}`} currentApplication.region.awsName,
'functions',
)}/v1${currentFunction?.route}`}
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
> >
{`${generateRemoteAppUrl( {`${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/functions${currentFunction?.route}`} currentApplication.region.awsName,
'functions',
)}/v1${currentFunction?.route}`}
</a> </a>
</div> </div>
</div> </div>

View File

@@ -9,7 +9,7 @@ import PlayIcon from '@/ui/v2/icons/PlayIcon';
import Option from '@/ui/v2/Option'; import Option from '@/ui/v2/Option';
import Select from '@/ui/v2/Select'; import Select from '@/ui/v2/Select';
import Tooltip from '@/ui/v2/Tooltip'; import Tooltip from '@/ui/v2/Tooltip';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import { triggerToast } from '@/utils/toast'; import { triggerToast } from '@/utils/toast';
import { import {
DOC_EXPLORER_PLUGIN, DOC_EXPLORER_PLUGIN,
@@ -260,11 +260,15 @@ export default function GraphQLPage() {
return <LoadingScreen />; return <LoadingScreen />;
} }
const appUrl = generateRemoteAppUrl(currentApplication.subdomain); const appUrl = generateAppServiceUrl(
currentApplication.subdomain,
currentApplication.region.awsName,
'graphql',
);
const subscriptionUrl = `${appUrl const subscriptionUrl = `${appUrl
.replace('https', 'wss') .replace('https', 'wss')
.replace('http', 'ws')}/v1/graphql`; .replace('http', 'ws')}/v1`;
const headers = { const headers = {
'content-type': 'application/json', 'content-type': 'application/json',
@@ -273,7 +277,7 @@ export default function GraphQLPage() {
}; };
const fetcher = createGraphiQLFetcher({ const fetcher = createGraphiQLFetcher({
url: `${appUrl}/v1/graphql`, url: `${appUrl}/v1`,
headers, headers,
wsClient: createClient({ wsClient: createClient({
url: subscriptionUrl, url: subscriptionUrl,

View File

@@ -9,6 +9,7 @@ import GitHubProviderSettings from '@/components/settings/signInMethods/GitHubPr
import GoogleProviderSettings from '@/components/settings/signInMethods/GoogleProviderSettings'; import GoogleProviderSettings from '@/components/settings/signInMethods/GoogleProviderSettings';
import LinkedInProviderSettings from '@/components/settings/signInMethods/LinkedInProviderSettings'; import LinkedInProviderSettings from '@/components/settings/signInMethods/LinkedInProviderSettings';
import MagicLinkSettings from '@/components/settings/signInMethods/MagicLinkSettings'; import MagicLinkSettings from '@/components/settings/signInMethods/MagicLinkSettings';
import ProvidersUpdatedAlert from '@/components/settings/signInMethods/ProvidersUpdatedAlert';
import SMSSettings from '@/components/settings/signInMethods/SMSSettings'; import SMSSettings from '@/components/settings/signInMethods/SMSSettings';
import SpotifyProviderSettings from '@/components/settings/signInMethods/SpotifyProviderSettings'; import SpotifyProviderSettings from '@/components/settings/signInMethods/SpotifyProviderSettings';
import TwitchProviderSettings from '@/components/settings/signInMethods/TwitchProviderSettings'; import TwitchProviderSettings from '@/components/settings/signInMethods/TwitchProviderSettings';
@@ -55,6 +56,7 @@ export default function SettingsSignInMethodsPage() {
<WebAuthnSettings /> <WebAuthnSettings />
<AnonymousSignInSettings /> <AnonymousSignInSettings />
<SMSSettings /> <SMSSettings />
{!currentApplication.providersUpdated && <ProvidersUpdatedAlert />}
<AppleProviderSettings /> <AppleProviderSettings />
<DiscordProviderSettings /> <DiscordProviderSettings />
<FacebookProviderSettings /> <FacebookProviderSettings />

View File

@@ -3,7 +3,7 @@ import RetryableErrorBoundary from '@/components/common/RetryableErrorBoundary';
import FilesDataGrid from '@/components/files/FilesDataGrid'; import FilesDataGrid from '@/components/files/FilesDataGrid';
import ProjectLayout from '@/components/layout/ProjectLayout'; import ProjectLayout from '@/components/layout/ProjectLayout';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication'; import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import { NhostApolloProvider } from '@nhost/react-apollo'; import { NhostApolloProvider } from '@nhost/react-apollo';
import type { ReactElement } from 'react'; import type { ReactElement } from 'react';
@@ -16,9 +16,11 @@ export default function StoragePage() {
return ( return (
<NhostApolloProvider <NhostApolloProvider
graphqlUrl={`${generateRemoteAppUrl( graphqlUrl={`${generateAppServiceUrl(
currentApplication?.subdomain, currentApplication.subdomain,
)}/v1/graphql`} currentApplication.region.awsName,
'graphql',
)}/v1`}
fetchPolicy="cache-first" fetchPolicy="cache-first"
headers={{ headers={{
'x-hasura-admin-secret': 'x-hasura-admin-secret':

View File

@@ -20,7 +20,7 @@ import Option from '@/ui/v2/Option';
import Select from '@/ui/v2/Select'; import Select from '@/ui/v2/Select';
import Text from '@/ui/v2/Text'; import Text from '@/ui/v2/Text';
import { copy } from '@/utils/copy'; import { copy } from '@/utils/copy';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import { triggerToast } from '@/utils/toast'; import { triggerToast } from '@/utils/toast';
import type { import type {
GetRemoteAppUserAuthRolesFragment, GetRemoteAppUserAuthRolesFragment,
@@ -629,9 +629,11 @@ export default function UserDetailsByIdPage() {
return ( return (
<NhostApolloProvider <NhostApolloProvider
graphqlUrl={`${generateRemoteAppUrl( graphqlUrl={`${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/graphql`} currentApplication.region.awsName,
'graphql',
)}/v1`}
fetchPolicy="cache-first" fetchPolicy="cache-first"
headers={{ headers={{
'x-hasura-admin-secret': 'x-hasura-admin-secret':

View File

@@ -3,7 +3,7 @@ import Container from '@/components/layout/Container';
import ProjectLayout from '@/components/layout/ProjectLayout'; import ProjectLayout from '@/components/layout/ProjectLayout';
import UsersList from '@/components/users/UsersList'; import UsersList from '@/components/users/UsersList';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication'; import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { generateRemoteAppUrl } from '@/utils/helpers'; import { generateAppServiceUrl } from '@/utils/helpers';
import { NhostApolloProvider } from '@nhost/react-apollo'; import { NhostApolloProvider } from '@nhost/react-apollo';
import type { ReactElement } from 'react'; import type { ReactElement } from 'react';
@@ -16,9 +16,11 @@ export default function UsersPage() {
return ( return (
<NhostApolloProvider <NhostApolloProvider
graphqlUrl={`${generateRemoteAppUrl( graphqlUrl={`${generateAppServiceUrl(
currentApplication.subdomain, currentApplication.subdomain,
)}/v1/graphql`} currentApplication.region.awsName,
'graphql',
)}/v1`}
fetchPolicy="cache-first" fetchPolicy="cache-first"
headers={{ headers={{
'x-hasura-admin-secret': 'x-hasura-admin-secret':

View File

@@ -21,7 +21,7 @@ import '@fontsource/roboto-mono/400.css';
import '@fontsource/roboto-mono/500.css'; import '@fontsource/roboto-mono/500.css';
import { ThemeProvider } from '@mui/material'; import { ThemeProvider } from '@mui/material';
import CssBaseline from '@mui/material/CssBaseline'; import CssBaseline from '@mui/material/CssBaseline';
import { NhostNextProvider } from '@nhost/nextjs'; import { NhostProvider } from '@nhost/nextjs';
import { NhostApolloProvider } from '@nhost/react-apollo'; import { NhostApolloProvider } from '@nhost/react-apollo';
import * as snippet from '@segment/snippet'; import * as snippet from '@segment/snippet';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
@@ -89,7 +89,7 @@ function MyApp({
<QueryClientProvider client={queryClient}> <QueryClientProvider client={queryClient}>
<CacheProvider value={emotionCache}> <CacheProvider value={emotionCache}>
<NhostNextProvider nhost={nhost}> <NhostProvider nhost={nhost}>
<NhostApolloProvider <NhostApolloProvider
fetchPolicy="cache-first" fetchPolicy="cache-first"
nhost={nhost} nhost={nhost}
@@ -118,7 +118,7 @@ function MyApp({
</UserDataProvider> </UserDataProvider>
</WorkspaceProvider> </WorkspaceProvider>
</NhostApolloProvider> </NhostApolloProvider>
</NhostNextProvider> </NhostProvider>
</CacheProvider> </CacheProvider>
</QueryClientProvider> </QueryClientProvider>
</ErrorBoundary> </ErrorBoundary>

View File

@@ -76,6 +76,7 @@ export type Application = {
desiredState: DesiredState; desiredState: DesiredState;
nhostBaseFolder?: string; nhostBaseFolder?: string;
featureFlags: FeatureFlag[]; featureFlags: FeatureFlag[];
providersUpdated: boolean;
}; };
export type CustomClaim = { export type CustomClaim = {

View File

@@ -884,6 +884,7 @@ export type Apps = {
postgresSchemaMigrationUser?: Maybe<Scalars['String']>; postgresSchemaMigrationUser?: Maybe<Scalars['String']>;
postgresUser?: Maybe<Scalars['String']>; postgresUser?: Maybe<Scalars['String']>;
postgresVersion: Scalars['String']; postgresVersion: Scalars['String'];
providersUpdated?: Maybe<Scalars['Boolean']>;
/** An object relationship */ /** An object relationship */
region: Regions; region: Regions;
regionId: Scalars['uuid']; regionId: Scalars['uuid'];
@@ -1262,6 +1263,7 @@ export type Apps_Bool_Exp = {
postgresSchemaMigrationUser?: InputMaybe<String_Comparison_Exp>; postgresSchemaMigrationUser?: InputMaybe<String_Comparison_Exp>;
postgresUser?: InputMaybe<String_Comparison_Exp>; postgresUser?: InputMaybe<String_Comparison_Exp>;
postgresVersion?: InputMaybe<String_Comparison_Exp>; postgresVersion?: InputMaybe<String_Comparison_Exp>;
providersUpdated?: InputMaybe<Boolean_Comparison_Exp>;
region?: InputMaybe<Regions_Bool_Exp>; region?: InputMaybe<Regions_Bool_Exp>;
regionId?: InputMaybe<Uuid_Comparison_Exp>; regionId?: InputMaybe<Uuid_Comparison_Exp>;
repositoryProductionBranch?: InputMaybe<String_Comparison_Exp>; repositoryProductionBranch?: InputMaybe<String_Comparison_Exp>;
@@ -1453,6 +1455,7 @@ export type Apps_Insert_Input = {
postgresSchemaMigrationUser?: InputMaybe<Scalars['String']>; postgresSchemaMigrationUser?: InputMaybe<Scalars['String']>;
postgresUser?: InputMaybe<Scalars['String']>; postgresUser?: InputMaybe<Scalars['String']>;
postgresVersion?: InputMaybe<Scalars['String']>; postgresVersion?: InputMaybe<Scalars['String']>;
providersUpdated?: InputMaybe<Scalars['Boolean']>;
region?: InputMaybe<Regions_Obj_Rel_Insert_Input>; region?: InputMaybe<Regions_Obj_Rel_Insert_Input>;
regionId?: InputMaybe<Scalars['uuid']>; regionId?: InputMaybe<Scalars['uuid']>;
repositoryProductionBranch?: InputMaybe<Scalars['String']>; repositoryProductionBranch?: InputMaybe<Scalars['String']>;
@@ -2070,6 +2073,7 @@ export type Apps_Order_By = {
postgresSchemaMigrationUser?: InputMaybe<Order_By>; postgresSchemaMigrationUser?: InputMaybe<Order_By>;
postgresUser?: InputMaybe<Order_By>; postgresUser?: InputMaybe<Order_By>;
postgresVersion?: InputMaybe<Order_By>; postgresVersion?: InputMaybe<Order_By>;
providersUpdated?: InputMaybe<Order_By>;
region?: InputMaybe<Regions_Order_By>; region?: InputMaybe<Regions_Order_By>;
regionId?: InputMaybe<Order_By>; regionId?: InputMaybe<Order_By>;
repositoryProductionBranch?: InputMaybe<Order_By>; repositoryProductionBranch?: InputMaybe<Order_By>;
@@ -2354,6 +2358,8 @@ export enum Apps_Select_Column {
/** column name */ /** column name */
PostgresVersion = 'postgresVersion', PostgresVersion = 'postgresVersion',
/** column name */ /** column name */
ProvidersUpdated = 'providersUpdated',
/** column name */
RegionId = 'regionId', RegionId = 'regionId',
/** column name */ /** column name */
RepositoryProductionBranch = 'repositoryProductionBranch', RepositoryProductionBranch = 'repositoryProductionBranch',
@@ -2432,7 +2438,9 @@ export enum Apps_Select_Column_Apps_Aggregate_Bool_Exp_Bool_And_Arguments_Column
/** column name */ /** column name */
Paused = 'paused', Paused = 'paused',
/** column name */ /** column name */
PostgresPublicAccess = 'postgresPublicAccess' PostgresPublicAccess = 'postgresPublicAccess',
/** column name */
ProvidersUpdated = 'providersUpdated'
} }
/** select "apps_aggregate_bool_exp_bool_or_arguments_columns" columns of table "apps" */ /** select "apps_aggregate_bool_exp_bool_or_arguments_columns" columns of table "apps" */
@@ -2496,7 +2504,9 @@ export enum Apps_Select_Column_Apps_Aggregate_Bool_Exp_Bool_Or_Arguments_Columns
/** column name */ /** column name */
Paused = 'paused', Paused = 'paused',
/** column name */ /** column name */
PostgresPublicAccess = 'postgresPublicAccess' PostgresPublicAccess = 'postgresPublicAccess',
/** column name */
ProvidersUpdated = 'providersUpdated'
} }
/** input type for updating data in table "apps" */ /** input type for updating data in table "apps" */
@@ -2632,6 +2642,7 @@ export type Apps_Set_Input = {
postgresSchemaMigrationUser?: InputMaybe<Scalars['String']>; postgresSchemaMigrationUser?: InputMaybe<Scalars['String']>;
postgresUser?: InputMaybe<Scalars['String']>; postgresUser?: InputMaybe<Scalars['String']>;
postgresVersion?: InputMaybe<Scalars['String']>; postgresVersion?: InputMaybe<Scalars['String']>;
providersUpdated?: InputMaybe<Scalars['Boolean']>;
regionId?: InputMaybe<Scalars['uuid']>; regionId?: InputMaybe<Scalars['uuid']>;
repositoryProductionBranch?: InputMaybe<Scalars['String']>; repositoryProductionBranch?: InputMaybe<Scalars['String']>;
slug?: InputMaybe<Scalars['String']>; slug?: InputMaybe<Scalars['String']>;
@@ -2840,6 +2851,7 @@ export type Apps_Stream_Cursor_Value_Input = {
postgresSchemaMigrationUser?: InputMaybe<Scalars['String']>; postgresSchemaMigrationUser?: InputMaybe<Scalars['String']>;
postgresUser?: InputMaybe<Scalars['String']>; postgresUser?: InputMaybe<Scalars['String']>;
postgresVersion?: InputMaybe<Scalars['String']>; postgresVersion?: InputMaybe<Scalars['String']>;
providersUpdated?: InputMaybe<Scalars['Boolean']>;
regionId?: InputMaybe<Scalars['uuid']>; regionId?: InputMaybe<Scalars['uuid']>;
repositoryProductionBranch?: InputMaybe<Scalars['String']>; repositoryProductionBranch?: InputMaybe<Scalars['String']>;
slug?: InputMaybe<Scalars['String']>; slug?: InputMaybe<Scalars['String']>;
@@ -3130,6 +3142,8 @@ export enum Apps_Update_Column {
/** column name */ /** column name */
PostgresVersion = 'postgresVersion', PostgresVersion = 'postgresVersion',
/** column name */ /** column name */
ProvidersUpdated = 'providersUpdated',
/** column name */
RegionId = 'regionId', RegionId = 'regionId',
/** column name */ /** column name */
RepositoryProductionBranch = 'repositoryProductionBranch', RepositoryProductionBranch = 'repositoryProductionBranch',
@@ -17042,7 +17056,7 @@ export type GetAppQueryVariables = Exact<{
export type GetAppQuery = { __typename?: 'query_root', app?: { __typename?: 'apps', id: any, slug: string, subdomain: string, name: string, createdAt: any, authEmailSigninEmailVerifiedRequired: boolean, authPasswordHibpEnabled: boolean, authEmailPasswordlessEnabled: boolean, authSmsPasswordlessEnabled: boolean, authWebAuthnEnabled: boolean, authClientUrl: string, authEmailTemplateFetchUrl?: string | null, authAccessControlAllowedEmails: string, authAccessControlAllowedEmailDomains: string, authAccessControlBlockedEmails: string, authAccessControlBlockedEmailDomains: string, authAccessControlAllowedRedirectUrls: string, authGithubEnabled: boolean, authGithubClientId: string, authGithubClientSecret: string, authGoogleEnabled: boolean, authGoogleClientId: string, authGoogleClientSecret: string, authFacebookEnabled: boolean, authFacebookClientId: string, authFacebookClientSecret: string, authLinkedinEnabled: boolean, authLinkedinClientId: string, authLinkedinClientSecret: string, authTwitterEnabled: boolean, authTwitterConsumerKey: string, authTwitterConsumerSecret: string, authAppleEnabled: boolean, authAppleTeamId: string, authAppleKeyId: string, authAppleClientId: string, authApplePrivateKey: string, authAppleScope: string, authWindowsLiveEnabled: boolean, authWindowsLiveClientId: string, authWindowsLiveClientSecret: string, authSpotifyEnabled: boolean, authSpotifyClientId: string, authSpotifyClientSecret: string, authWorkOsEnabled: boolean, authWorkOsClientId: string, authWorkOsClientSecret: string, authWorkOsDefaultDomain: string, authWorkOsDefaultOrganization: string, authWorkOsDefaultConnection: string } | null }; export type GetAppQuery = { __typename?: 'query_root', app?: { __typename?: 'apps', id: any, slug: string, subdomain: string, name: string, createdAt: any, authEmailSigninEmailVerifiedRequired: boolean, authPasswordHibpEnabled: boolean, authEmailPasswordlessEnabled: boolean, authSmsPasswordlessEnabled: boolean, authWebAuthnEnabled: boolean, authClientUrl: string, authEmailTemplateFetchUrl?: string | null, authAccessControlAllowedEmails: string, authAccessControlAllowedEmailDomains: string, authAccessControlBlockedEmails: string, authAccessControlBlockedEmailDomains: string, authAccessControlAllowedRedirectUrls: string, authGithubEnabled: boolean, authGithubClientId: string, authGithubClientSecret: string, authGoogleEnabled: boolean, authGoogleClientId: string, authGoogleClientSecret: string, authFacebookEnabled: boolean, authFacebookClientId: string, authFacebookClientSecret: string, authLinkedinEnabled: boolean, authLinkedinClientId: string, authLinkedinClientSecret: string, authTwitterEnabled: boolean, authTwitterConsumerKey: string, authTwitterConsumerSecret: string, authAppleEnabled: boolean, authAppleTeamId: string, authAppleKeyId: string, authAppleClientId: string, authApplePrivateKey: string, authAppleScope: string, authWindowsLiveEnabled: boolean, authWindowsLiveClientId: string, authWindowsLiveClientSecret: string, authSpotifyEnabled: boolean, authSpotifyClientId: string, authSpotifyClientSecret: string, authWorkOsEnabled: boolean, authWorkOsClientId: string, authWorkOsClientSecret: string, authWorkOsDefaultDomain: string, authWorkOsDefaultOrganization: string, authWorkOsDefaultConnection: string } | null };
export type GetAppByWorkspaceAndNameFragment = { __typename?: 'apps', updatedAt: any, id: any, slug: string, subdomain: string, hasuraGraphqlAdminSecret: string, name: string, createdAt: any, isProvisioned: boolean, repositoryProductionBranch: string, githubRepositoryId?: any | null, workspaceId: any, githubRepository?: { __typename?: 'githubRepositories', id: any, name: string, githubAppInstallation: { __typename?: 'githubAppInstallations', id: any, accountLogin?: string | null } } | null, region: { __typename?: 'regions', countryCode: string, city: string }, workspace: { __typename?: 'workspaces', name: string, slug: string, id: any } }; export type GetAppByWorkspaceAndNameFragment = { __typename?: 'apps', updatedAt: any, id: any, slug: string, subdomain: string, hasuraGraphqlAdminSecret: string, name: string, createdAt: any, isProvisioned: boolean, providersUpdated?: boolean | null, repositoryProductionBranch: string, githubRepositoryId?: any | null, workspaceId: any, githubRepository?: { __typename?: 'githubRepositories', id: any, name: string, githubAppInstallation: { __typename?: 'githubAppInstallations', id: any, accountLogin?: string | null } } | null, region: { __typename?: 'regions', countryCode: string, city: string }, workspace: { __typename?: 'workspaces', name: string, slug: string, id: any } };
export type GetAppByWorkspaceAndNameQueryVariables = Exact<{ export type GetAppByWorkspaceAndNameQueryVariables = Exact<{
workspace: Scalars['String']; workspace: Scalars['String'];
@@ -17050,7 +17064,7 @@ export type GetAppByWorkspaceAndNameQueryVariables = Exact<{
}>; }>;
export type GetAppByWorkspaceAndNameQuery = { __typename?: 'query_root', apps: Array<{ __typename?: 'apps', updatedAt: any, id: any, slug: string, subdomain: string, hasuraGraphqlAdminSecret: string, name: string, createdAt: any, isProvisioned: boolean, repositoryProductionBranch: string, githubRepositoryId?: any | null, workspaceId: any, githubRepository?: { __typename?: 'githubRepositories', id: any, name: string, githubAppInstallation: { __typename?: 'githubAppInstallations', id: any, accountLogin?: string | null } } | null, region: { __typename?: 'regions', countryCode: string, city: string }, workspace: { __typename?: 'workspaces', name: string, slug: string, id: any } }> }; export type GetAppByWorkspaceAndNameQuery = { __typename?: 'query_root', apps: Array<{ __typename?: 'apps', updatedAt: any, id: any, slug: string, subdomain: string, hasuraGraphqlAdminSecret: string, name: string, createdAt: any, isProvisioned: boolean, providersUpdated?: boolean | null, repositoryProductionBranch: string, githubRepositoryId?: any | null, workspaceId: any, githubRepository?: { __typename?: 'githubRepositories', id: any, name: string, githubAppInstallation: { __typename?: 'githubAppInstallations', id: any, accountLogin?: string | null } } | null, region: { __typename?: 'regions', countryCode: string, city: string }, workspace: { __typename?: 'workspaces', name: string, slug: string, id: any } }> };
export type GetAppCustomClaimsQueryVariables = Exact<{ export type GetAppCustomClaimsQueryVariables = Exact<{
id: Scalars['uuid']; id: Scalars['uuid'];
@@ -17498,6 +17512,13 @@ export type DeleteRemoteAppUserRolesMutationVariables = Exact<{
export type DeleteRemoteAppUserRolesMutation = { __typename?: 'mutation_root', deleteAuthUserRoles?: { __typename?: 'authUserRoles_mutation_response', affected_rows: number } | null }; export type DeleteRemoteAppUserRolesMutation = { __typename?: 'mutation_root', deleteAuthUserRoles?: { __typename?: 'authUserRoles_mutation_response', affected_rows: number } | null };
export type ConfirmProvidersUpdatedMutationVariables = Exact<{
id: Scalars['uuid'];
}>;
export type ConfirmProvidersUpdatedMutation = { __typename?: 'mutation_root', updateApp?: { __typename?: 'apps', id: any } | null };
export type GetDatabaseConnectionInfoQueryVariables = Exact<{ export type GetDatabaseConnectionInfoQueryVariables = Exact<{
id: Scalars['uuid']; id: Scalars['uuid'];
}>; }>;
@@ -17529,7 +17550,7 @@ export type GetOneUserQueryVariables = Exact<{
}>; }>;
export type GetOneUserQuery = { __typename?: 'query_root', user?: { __typename?: 'users', id: any, displayName: string, avatarUrl: string, workspaceMembers: Array<{ __typename?: 'workspaceMembers', id: any, userId: any, workspaceId: any, type: string, workspace: { __typename?: 'workspaces', creatorUserId?: any | null, id: any, slug: string, name: string, apps: Array<{ __typename?: 'apps', id: any, slug: string, name: string, hasuraGraphqlAdminSecret: string, repositoryProductionBranch: string, subdomain: string, isProvisioned: boolean, createdAt: any, desiredState: number, nhostBaseFolder: string, featureFlags: Array<{ __typename?: 'featureFlags', description: string, id: any, name: string, value: string }>, appStates: Array<{ __typename?: 'appStateHistory', id: any, appId: any, message?: string | null, stateId: number, createdAt: any }>, region: { __typename?: 'regions', id: any, countryCode: string, awsName: string, city: string }, plan: { __typename?: 'plans', id: any, name: string, isFree: boolean }, githubRepository?: { __typename?: 'githubRepositories', fullName: string } | null, deployments: Array<{ __typename?: 'deployments', id: any, commitSHA: string, commitMessage?: string | null, commitUserName?: string | null, deploymentStartedAt?: any | null, deploymentEndedAt?: any | null, commitUserAvatarUrl?: string | null, deploymentStatus?: string | null }> }> } }> } | null }; export type GetOneUserQuery = { __typename?: 'query_root', user?: { __typename?: 'users', id: any, displayName: string, avatarUrl: string, workspaceMembers: Array<{ __typename?: 'workspaceMembers', id: any, userId: any, workspaceId: any, type: string, workspace: { __typename?: 'workspaces', creatorUserId?: any | null, id: any, slug: string, name: string, apps: Array<{ __typename?: 'apps', id: any, slug: string, name: string, hasuraGraphqlAdminSecret: string, repositoryProductionBranch: string, subdomain: string, isProvisioned: boolean, createdAt: any, desiredState: number, nhostBaseFolder: string, providersUpdated?: boolean | null, featureFlags: Array<{ __typename?: 'featureFlags', description: string, id: any, name: string, value: string }>, appStates: Array<{ __typename?: 'appStateHistory', id: any, appId: any, message?: string | null, stateId: number, createdAt: any }>, region: { __typename?: 'regions', id: any, countryCode: string, awsName: string, city: string }, plan: { __typename?: 'plans', id: any, name: string, isFree: boolean }, githubRepository?: { __typename?: 'githubRepositories', fullName: string } | null, deployments: Array<{ __typename?: 'deployments', id: any, commitSHA: string, commitMessage?: string | null, commitUserName?: string | null, deploymentStartedAt?: any | null, deploymentEndedAt?: any | null, commitUserAvatarUrl?: string | null, deploymentStatus?: string | null }> }> } }> } | null };
export type GetUserAllWorkspacesQueryVariables = Exact<{ [key: string]: never; }>; export type GetUserAllWorkspacesQueryVariables = Exact<{ [key: string]: never; }>;
@@ -17758,6 +17779,7 @@ export const GetAppByWorkspaceAndNameFragmentDoc = gql`
name name
createdAt createdAt
isProvisioned isProvisioned
providersUpdated
githubRepository { githubRepository {
id id
name name
@@ -20748,6 +20770,39 @@ export function useDeleteRemoteAppUserRolesMutation(baseOptions?: Apollo.Mutatio
export type DeleteRemoteAppUserRolesMutationHookResult = ReturnType<typeof useDeleteRemoteAppUserRolesMutation>; export type DeleteRemoteAppUserRolesMutationHookResult = ReturnType<typeof useDeleteRemoteAppUserRolesMutation>;
export type DeleteRemoteAppUserRolesMutationResult = Apollo.MutationResult<DeleteRemoteAppUserRolesMutation>; export type DeleteRemoteAppUserRolesMutationResult = Apollo.MutationResult<DeleteRemoteAppUserRolesMutation>;
export type DeleteRemoteAppUserRolesMutationOptions = Apollo.BaseMutationOptions<DeleteRemoteAppUserRolesMutation, DeleteRemoteAppUserRolesMutationVariables>; export type DeleteRemoteAppUserRolesMutationOptions = Apollo.BaseMutationOptions<DeleteRemoteAppUserRolesMutation, DeleteRemoteAppUserRolesMutationVariables>;
export const ConfirmProvidersUpdatedDocument = gql`
mutation confirmProvidersUpdated($id: uuid!) {
updateApp(pk_columns: {id: $id}, _set: {providersUpdated: true}) {
id
}
}
`;
export type ConfirmProvidersUpdatedMutationFn = Apollo.MutationFunction<ConfirmProvidersUpdatedMutation, ConfirmProvidersUpdatedMutationVariables>;
/**
* __useConfirmProvidersUpdatedMutation__
*
* To run a mutation, you first call `useConfirmProvidersUpdatedMutation` within a React component and pass it any options that fit your needs.
* When your component renders, `useConfirmProvidersUpdatedMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation
* - An object with fields that represent the current status of the mutation's execution
*
* @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
*
* @example
* const [confirmProvidersUpdatedMutation, { data, loading, error }] = useConfirmProvidersUpdatedMutation({
* variables: {
* id: // value for 'id'
* },
* });
*/
export function useConfirmProvidersUpdatedMutation(baseOptions?: Apollo.MutationHookOptions<ConfirmProvidersUpdatedMutation, ConfirmProvidersUpdatedMutationVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<ConfirmProvidersUpdatedMutation, ConfirmProvidersUpdatedMutationVariables>(ConfirmProvidersUpdatedDocument, options);
}
export type ConfirmProvidersUpdatedMutationHookResult = ReturnType<typeof useConfirmProvidersUpdatedMutation>;
export type ConfirmProvidersUpdatedMutationResult = Apollo.MutationResult<ConfirmProvidersUpdatedMutation>;
export type ConfirmProvidersUpdatedMutationOptions = Apollo.BaseMutationOptions<ConfirmProvidersUpdatedMutation, ConfirmProvidersUpdatedMutationVariables>;
export const GetDatabaseConnectionInfoDocument = gql` export const GetDatabaseConnectionInfoDocument = gql`
query getDatabaseConnectionInfo($id: uuid!) { query getDatabaseConnectionInfo($id: uuid!) {
app(id: $id) { app(id: $id) {
@@ -20991,6 +21046,7 @@ export const GetOneUserDocument = gql`
createdAt createdAt
desiredState desiredState
nhostBaseFolder nhostBaseFolder
providersUpdated
featureFlags { featureFlags {
description description
id id

View File

@@ -72,6 +72,26 @@ export function generateRemoteAppUrl(subdomain: string): string {
return `https://${subdomain}.nhost.run`; return `https://${subdomain}.nhost.run`;
} }
export function generateAppServiceUrl(
subdomain: string,
region: string,
service: 'auth' | 'graphql' | 'functions' | 'storage' | 'hasura',
) {
if (process.env.NEXT_PUBLIC_NHOST_PLATFORM !== 'true') {
return LOCAL_BACKEND_URL;
}
if (process.env.NEXT_PUBLIC_ENV === 'dev') {
return process.env.NEXT_PUBLIC_NHOST_BACKEND_URL || LOCAL_BACKEND_URL;
}
if (process.env.NEXT_PUBLIC_ENV === 'staging') {
return `https://${subdomain}.${service}.${region}.staging.nhost.run`;
}
return `https://${subdomain}.${service}.${region}.nhost.run`;
}
export function emptyWorkspace() { export function emptyWorkspace() {
return { return {
id: '', id: '',

View File

@@ -1,10 +1,12 @@
import CheckIcon from '@/ui/v2/icons/CheckIcon'; import CheckIcon from '@/ui/v2/icons/CheckIcon';
import XIcon from '@/ui/v2/icons/XIcon';
import type { DefaultToastOptions } from 'react-hot-toast';
/** /**
* Common styles for `toast.promise` notifications in the settings page. * Common styles for `toast.promise` notifications in the settings page.
* @see {@link https://react-hot-toast.com/docs/toast} * @see {@link https://react-hot-toast.com/docs/toast}
*/ */
export const toastStyleProps = { export const toastStyleProps: DefaultToastOptions = {
style: { style: {
minWidth: '400px', minWidth: '400px',
backgroundColor: 'rgb(33 50 75)', backgroundColor: 'rgb(33 50 75)',
@@ -12,7 +14,11 @@ export const toastStyleProps = {
}, },
success: { success: {
duration: 5000, duration: 5000,
icon: <CheckIcon className="h-4 w-4 bg-transparent" />, icon: <CheckIcon className="h-4 w-4" />,
},
error: {
duration: 5000,
icon: <XIcon className="h-4 w-4" />,
}, },
}; };

View File

@@ -7,7 +7,7 @@ import { UserDataProvider } from '@/context/workspace1-context';
import defaultTheme from '@/theme/default'; import defaultTheme from '@/theme/default';
import { CacheProvider } from '@emotion/react'; import { CacheProvider } from '@emotion/react';
import { ThemeProvider } from '@mui/material/styles'; import { ThemeProvider } from '@mui/material/styles';
import { NhostNextProvider } from '@nhost/nextjs'; import { NhostProvider } from '@nhost/nextjs';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import type { queries, Queries, RenderOptions } from '@testing-library/react'; import type { queries, Queries, RenderOptions } from '@testing-library/react';
import { render as rtlRender } from '@testing-library/react'; import { render as rtlRender } from '@testing-library/react';
@@ -25,7 +25,7 @@ function Providers({ children }: PropsWithChildren<{}>) {
<RetryableErrorBoundary> <RetryableErrorBoundary>
<QueryClientProvider client={queryClient}> <QueryClientProvider client={queryClient}>
<CacheProvider value={emotionCache}> <CacheProvider value={emotionCache}>
<NhostNextProvider nhost={nhost}> <NhostProvider nhost={nhost}>
<WorkspaceProvider> <WorkspaceProvider>
<UserDataProvider> <UserDataProvider>
<ManagedUIContext> <ManagedUIContext>
@@ -36,7 +36,7 @@ function Providers({ children }: PropsWithChildren<{}>) {
</ManagedUIContext> </ManagedUIContext>
</UserDataProvider> </UserDataProvider>
</WorkspaceProvider> </WorkspaceProvider>
</NhostNextProvider> </NhostProvider>
</CacheProvider> </CacheProvider>
</QueryClientProvider> </QueryClientProvider>
</RetryableErrorBoundary> </RetryableErrorBoundary>

View File

@@ -17,7 +17,6 @@
"@/generated/*": ["utils/__generated__/*"], "@/generated/*": ["utils/__generated__/*"],
"@/ui/*": ["components/ui/*"], "@/ui/*": ["components/ui/*"],
"@/ui": ["components/ui/index.ts"], "@/ui": ["components/ui/index.ts"],
"@nhost/core": ["../../packages/core/src/index.ts"],
"@nhost/nextjs": ["../../packages/nextjs/src/index.ts"], "@nhost/nextjs": ["../../packages/nextjs/src/index.ts"],
"@nhost/nhost-js": ["../../packages/nhost-js/src/index.ts"], "@nhost/nhost-js": ["../../packages/nhost-js/src/index.ts"],
"@nhost/react": ["../../packages/react/src/index.ts"], "@nhost/react": ["../../packages/react/src/index.ts"],

1
docs/.gitignore vendored
View File

@@ -19,3 +19,4 @@ npm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
.vercel .vercel
docs/reference/docgen

View File

@@ -1,5 +1,13 @@
# @nhost/docs # @nhost/docs
## 0.0.8
### Patch Changes
- 7f251111: Use `NhostProvider` instead of `NhostReactProvider` and `NhostNextProvider`
`NhostReactProvider` and `NhostNextProvider` are now deprecated
## 0.0.7 ## 0.0.7
### Patch Changes ### Patch Changes

View File

@@ -33,7 +33,7 @@ Follow this guide to sign in users with LinkedIn.
- Click on **Auth** in the top menu. - Click on **Auth** in the top menu.
- Click on the **pen icon** under **OAuth 2.0 settings** and right next to **Authorized redirect URLs for your app**. - Click on the **pen icon** under **OAuth 2.0 settings** and right next to **Authorized redirect URLs for your app**.
- Click **Add redirect URL**. - Click **Add redirect URL**.
- Copy and past the **OAuth Callback URL** from Nhost. - Copy and paste the **OAuth Callback URL** from Nhost.
- Click **Update**. - Click **Update**.
## Configure Nhost ## Configure Nhost

View File

@@ -40,7 +40,7 @@ query {
Users should be created using the sign-up or sign-in flows as described under [sign-in methods](/authentication/sign-in-methods). Users should be created using the sign-up or sign-in flows as described under [sign-in methods](/authentication/sign-in-methods).
- **Never** create users directly via GraphQL or database, unless you [import users](#import-users) from an external system. - **Never** create users directly via GraphQL or database, unless you [import users](#import-users) from an external system.
- **Never** modify the `auth.users` table. - **Never** modify the database schema for the `auth.users` table.
- **Never** modify the GraphQL root queries or fields for any of the tables in the `auth` schema. - **Never** modify the GraphQL root queries or fields for any of the tables in the `auth` schema.
You're allowed to: You're allowed to:

View File

@@ -325,6 +325,18 @@ curl http://localhost:1337/v1/functions/time\?name\=Greg
Hello Greg! It's now: Wed, 27 Apr 2022 18:52:12 GMT Hello Greg! It's now: Wed, 27 Apr 2022 18:52:12 GMT
``` ```
## 4. Managing Local Data
Nhost makes it easy to manage data on different branches. Within your project directory there is an `.nhost` directory that tracks database configuration, database seeds, mail data, and functions.
### Seed Data
See [the section on seed data](https://docs.nhost.io/database#seed-data) for an overview.
If seeds have been applied there will be a file `seeds.applied` within the `.nhost/data/<branch-name>/db` directory.
If you need to re-apply your seeds, delete this file and restart nhost.
## Deploy your project ## Deploy your project
To deploy your local changes to production, you can commit and push them to To deploy your local changes to production, you can commit and push them to

View File

@@ -118,7 +118,7 @@ yarn add @nhost/react @nhost/nextjs graphql
Next, open your `_app.js` file as we'll now configure Nhost inside our app. Next, open your `_app.js` file as we'll now configure Nhost inside our app.
The Nhost Next.js SDK comes with a React provider named `NhostNextProvider` that The Nhost Next.js SDK comes with a React provider named `NhostProvider` that
makes the authentication state and all the provided React hooks available in our makes the authentication state and all the provided React hooks available in our
application. application.
@@ -128,7 +128,7 @@ Nhost backend:
```jsx title="pages/_app.js" ```jsx title="pages/_app.js"
import { UserProvider } from '../UserProvider'; import { UserProvider } from '../UserProvider';
// highlight-start // highlight-start
import { NhostNextProvider, NhostClient } from '@nhost/nextjs'; import { NhostProvider, NhostClient } from '@nhost/nextjs';
// highlight-end // highlight-end
// highlight-start // highlight-start
@@ -141,12 +141,12 @@ const nhost = new NhostClient({
function MyApp({ Component, pageProps }) { function MyApp({ Component, pageProps }) {
return ( return (
{/* highlight-next-line */} {/* highlight-next-line */}
<NhostNextProvider nhost={nhost} initial={pageProps.nhostSession}> <NhostProvider nhost={nhost} initial={pageProps.nhostSession}>
<UserProvider> <UserProvider>
{/* ... */} {/* ... */}
</UserProvider> </UserProvider>
{/* highlight-next-line */} {/* highlight-next-line */}
</NhostNextProvider> </NhostProvider>
); );
} }
``` ```
@@ -561,9 +561,9 @@ import { NhostApolloProvider } from '@nhost/react-apollo'
function MyApp({ Component, pageProps }) { function MyApp({ Component, pageProps }) {
return ( return (
<NhostNextProvider nhost={nhost} initial={pageProps.nhostSession}> <NhostProvider nhost={nhost} initial={pageProps.nhostSession}>
<NhostApolloProvider nhost={nhost}>{/* ... */}</NhostApolloProvider> <NhostApolloProvider nhost={nhost}>{/* ... */}</NhostApolloProvider>
</NhostNextProvider> </NhostProvider>
) )
} }
``` ```

View File

@@ -118,7 +118,7 @@ yarn add @nhost/react graphql
Next, open your `App.js` file as we'll now configure Nhost inside our app. Next, open your `App.js` file as we'll now configure Nhost inside our app.
The Nhost React SDK comes with a React provider named `NhostReactProvider` that The Nhost React SDK comes with a React provider named `NhostProvider` that
makes the authentication state and all the provided React hooks available in our makes the authentication state and all the provided React hooks available in our
application. application.
@@ -126,7 +126,7 @@ Use the following code to instantiate a new Nhost client and link it to your
Nhost backend: Nhost backend:
```jsx title="src/App.js" ```jsx title="src/App.js"
import { NhostClient, NhostReactProvider } from '@nhost/react' import { NhostClient, NhostProvider } from '@nhost/react'
const nhost = new NhostClient({ const nhost = new NhostClient({
subdomain: process.env.REACT_APP_NHOST_SUBDOMAIN, subdomain: process.env.REACT_APP_NHOST_SUBDOMAIN,
@@ -135,9 +135,9 @@ const nhost = new NhostClient({
function App() { function App() {
return ( return (
<NhostReactProvider nhost={nhost}> <NhostProvider nhost={nhost}>
<BrowserRouter>{/* ... */}</BrowserRouter> <BrowserRouter>{/* ... */}</BrowserRouter>
</NhostReactProvider> </NhostProvider>
) )
} }
@@ -443,7 +443,7 @@ import ProtectedRoute from './components/ProtectedRoute'
function App() { function App() {
return ( return (
<NhostReactProvider nhost={nhost}> <NhostProvider nhost={nhost}>
<BrowserRouter> <BrowserRouter>
<Routes> <Routes>
<Route path="sign-up" element={<SignUp />} /> <Route path="sign-up" element={<SignUp />} />
@@ -463,7 +463,7 @@ function App() {
</Route> </Route>
</Routes> </Routes>
</BrowserRouter> </BrowserRouter>
</NhostReactProvider> </NhostProvider>
) )
} }
``` ```
@@ -527,9 +527,9 @@ import { NhostApolloProvider } from '@nhost/react-apollo'
function App() { function App() {
return ( return (
<NhostReactProvider nhost={nhost}> <NhostProvider nhost={nhost}>
<NhostApolloProvider nhost={nhost}>{/* ... */}</NhostApolloProvider> <NhostApolloProvider nhost={nhost}>{/* ... */}</NhostApolloProvider>
</NhostReactProvider> </NhostProvider>
) )
} }
``` ```

View File

@@ -1,3 +0,0 @@
{
"label": "Auth"
}

View File

@@ -0,0 +1,22 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: activateMfaPromise()
sidebar_label: activateMfaPromise()
slug: /reference/javascript/auth/activate-mfa-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/mfa.ts#L44
---
# `activateMfaPromise()`
## Parameters
---
**<span className="parameter-name">service</span>** <span className="optional-status">required</span> <code>Interpreter&lt;EnableMfaContext, any, { type: "GENERATE" } &#124; { type: "ACTIVATE", code: string, activeMfaType: "totp" } &#124; { type: "GENERATED" } &#124; { type: "GENERATED_ERROR", error: null &#124; ErrorPayload } &#124; { type: "SUCCESS" } &#124; { type: "ERROR", error: null &#124; ErrorPayload }, { value: any, context: EnableMfaContext }, ResolveTypegenMeta&lt;Typegen0, { type: "GENERATE" } &#124; { type: "ACTIVATE", code: string, activeMfaType: "totp" } &#124; { type: "GENERATED" } &#124; { type: "GENERATED_ERROR", error: null &#124; ErrorPayload } &#124; { type: "SUCCESS" } &#124; { type: "ERROR", error: null &#124; ErrorPayload }, BaseActionObject, ServiceMap&gt;&gt;</code>
---
**<span className="parameter-name">code</span>** <span className="optional-status">required</span> <code>string</code>
---

View File

@@ -0,0 +1,22 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: addSecurityKeyPromise()
sidebar_label: addSecurityKeyPromise()
slug: /reference/javascript/auth/add-security-key-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/addSecurityKey.ts#L19
---
# `addSecurityKeyPromise()`
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
---
**<span className="parameter-name">nickname</span>** <span className="optional-status">optional</span> <code>string</code>
---

View File

@@ -0,0 +1,18 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: onStart()
sidebar_label: onStart()
slug: /reference/javascript/auth/auth-cookie-client/on-start
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/internal-client.ts#L74
---
# `onStart()`
## Parameters
---
**<span className="parameter-name">fn</span>** <span className="optional-status">required</span> <code>(client: AuthClient) =&gt; void</code>
---

View File

@@ -0,0 +1,23 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: AuthCookieClient
sidebar_label: AuthCookieClient
description: No description provided.
sidebar_class_name: deprecated
slug: /reference/javascript/auth/auth-cookie-client
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/internal-client.ts#L87
---
# `AuthCookieClient`
:::caution Deprecated
Not in use anymore. Use `clientStorageType: 'cookie'` instead
:::
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>Omit&lt;NhostClientOptions, "clientStorageGetter" &#124; "clientStorageSetter" &#124; "clientStorageType" &#124; "clientStorage"&gt;</code>
---

View File

@@ -0,0 +1,30 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: changeEmailPromise()
sidebar_label: changeEmailPromise()
slug: /reference/javascript/auth/change-email-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/changeEmail.ts#L11
---
# `changeEmailPromise()`
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;ChangeEmailContext, any, { type: "REQUEST", email: string, options: ChangeEmailOptions } &#124; { type: "SUCCESS" } &#124; { type: "ERROR", error: null &#124; ErrorPayload }, { value: any, context: ChangeEmailContext }, ResolveTypegenMeta&lt;Typegen0, { type: "REQUEST", email: string, options: ChangeEmailOptions } &#124; { type: "SUCCESS" } &#124; { type: "ERROR", error: null &#124; ErrorPayload }, BaseActionObject, ChangeEmailServices&gt;&gt;</code>
---
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> [`ChangeEmailOptions`](/reference/docgen/javascript/auth/types/change-email-options)
| Property | Type | Required | Notes |
| :--------------------------------------------------------------------------------------------- | :------------------ | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">options.</span>redirectTo</span> | <code>string</code> | | Redirection path in the client application that will be used in the link in the verification email. For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`. |
---

View File

@@ -0,0 +1,26 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: changePasswordPromise()
sidebar_label: changePasswordPromise()
slug: /reference/javascript/auth/change-password-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/changePassword.ts#L11
---
# `changePasswordPromise()`
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;ChangePasswordContext, any, { type: "REQUEST", password: string, ticket: string } &#124; { type: "SUCCESS" } &#124; { type: "ERROR", error: null &#124; ErrorPayload }, { value: any, context: ChangePasswordContext }, ResolveTypegenMeta&lt;Typegen0, { type: "REQUEST", password: string, ticket: string } &#124; { type: "SUCCESS" } &#124; { type: "ERROR", error: null &#124; ErrorPayload }, BaseActionObject, ChangePasswordServices&gt;&gt;</code>
---
**<span className="parameter-name">password</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">ticket</span>** <span className="optional-status">optional</span> <code>string</code>
---

View File

@@ -0,0 +1,29 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: createAuthMachine()
sidebar_label: createAuthMachine()
slug: /reference/javascript/auth/create-auth-machine
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/machines/authentication/machine.ts#L84
---
# `createAuthMachine()`
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`AuthMachineOptions`](/reference/docgen/javascript/auth/types/auth-machine-options)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------- | :------: | :---------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientUrl</span> | <code>string</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>backendUrl</span> | <code>string</code> | ✔️ | |
| <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/docgen/javascript/auth/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/docgen/javascript/auth/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 |
---

View File

@@ -0,0 +1,18 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: createChangeEmailMachine()
sidebar_label: createChangeEmailMachine()
slug: /reference/javascript/auth/create-change-email-machine
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/machines/change-email.ts#L28
---
# `createChangeEmailMachine()`
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
---

View File

@@ -0,0 +1,18 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: createChangePasswordMachine()
sidebar_label: createChangePasswordMachine()
slug: /reference/javascript/auth/create-change-password-machine
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/machines/change-password.ts#L27
---
# `createChangePasswordMachine()`
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
---

View File

@@ -0,0 +1,18 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: createEnableMfaMachine()
sidebar_label: createEnableMfaMachine()
slug: /reference/javascript/auth/create-enable-mfa-machine
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/machines/enable-mfa.ts#L30
---
# `createEnableMfaMachine()`
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
---

View File

@@ -0,0 +1,18 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: createResetPasswordMachine()
sidebar_label: createResetPasswordMachine()
slug: /reference/javascript/auth/create-reset-password-machine
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/machines/reset-password.ts#L27
---
# `createResetPasswordMachine()`
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
---

View File

@@ -0,0 +1,18 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: createSendVerificationEmailMachine()
sidebar_label: createSendVerificationEmailMachine()
slug: /reference/javascript/auth/create-send-verification-email-machine
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/machines/send-verification-email.ts#L27
---
# `createSendVerificationEmailMachine()`
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
---

View File

@@ -0,0 +1,22 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: encodeQueryParameters()
sidebar_label: encodeQueryParameters()
slug: /reference/javascript/auth/encode-query-parameters
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/url.ts#L3
---
# `encodeQueryParameters()`
## Parameters
---
**<span className="parameter-name">baseUrl</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">parameters</span>** <span className="optional-status">optional</span> <code>Record&lt;string, unknown&gt;</code>
---

View File

@@ -0,0 +1,18 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: generateQrCodePromise()
sidebar_label: generateQrCodePromise()
slug: /reference/javascript/auth/generate-qr-code-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/mfa.ts#L23
---
# `generateQrCodePromise()`
## Parameters
---
**<span className="parameter-name">service</span>** <span className="optional-status">required</span> <code>Interpreter&lt;EnableMfaContext, any, { type: "GENERATE" } &#124; { type: "ACTIVATE", code: string, activeMfaType: "totp" } &#124; { type: "GENERATED" } &#124; { type: "GENERATED_ERROR", error: null &#124; ErrorPayload } &#124; { type: "SUCCESS" } &#124; { type: "ERROR", error: null &#124; ErrorPayload }, { value: any, context: EnableMfaContext }, ResolveTypegenMeta&lt;Typegen0, { type: "GENERATE" } &#124; { type: "ACTIVATE", code: string, activeMfaType: "totp" } &#124; { type: "GENERATED" } &#124; { type: "GENERATED_ERROR", error: null &#124; ErrorPayload } &#124; { type: "SUCCESS" } &#124; { type: "ERROR", error: null &#124; ErrorPayload }, BaseActionObject, ServiceMap&gt;&gt;</code>
---

View File

@@ -0,0 +1,26 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: getAuthenticationResult()
sidebar_label: getAuthenticationResult()
slug: /reference/javascript/auth/get-authentication-result
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/client-helpers.ts#L23
---
# `getAuthenticationResult()`
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`SessionActionHandlerResult`](/reference/docgen/javascript/auth/types/session-action-handler-result)
| Property | Type | Required | Notes |
| :---------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------- | :------: | :------------------------------------------ |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>accessToken</span> | <code>null &#124; string</code> | ✔️ | Access token (JWT) |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>user</span> | <code>null &#124; [`User`](/reference/docgen/javascript/auth/types/user)</code> | ✔️ | User information |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>isSuccess</span> | <code>boolean</code> | ✔️ | Returns `true` if the action is successful. |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>error</span> | <code>null &#124; [`ErrorPayload`](/reference/docgen/javascript/auth/types/error-payload)</code> | ✔️ | Provides details about the error |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>isError</span> | <code>boolean</code> | ✔️ | |
---

View File

@@ -0,0 +1,22 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: getParameterByName()
sidebar_label: getParameterByName()
slug: /reference/javascript/auth/get-parameter-by-name
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/url.ts#L65
---
# `getParameterByName()`
## Parameters
---
**<span className="parameter-name">name</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">url</span>** <span className="optional-status">optional</span> <code>string</code>
---

View File

@@ -0,0 +1,28 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: getSession()
sidebar_label: getSession()
slug: /reference/javascript/auth/get-session
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/client-helpers.ts#L5
---
# `getSession()`
## Parameters
---
**<span className="parameter-name">context</span>** <span className="optional-status">optional</span> [`AuthContext`](/reference/docgen/javascript/auth/types/auth-context)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------------------------- | :------: | :------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">context.</span>errors</span> | <code>Partial&lt;Record&lt;StateErrorTypes, ErrorPayload&gt;&gt;</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">context.</span>importTokenAttempts</span> | <code>number</code> | ✔️ | Number of times the user tried to get an access token from a refresh token but got a network error |
| <span className="parameter-name"><span className="light-grey">context.</span>refreshToken</span> | <code>{ value: string &#124; null }</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">context.</span>refreshTimer</span> | <code>{ startedAt: Date &#124; null, attempts: number, lastAttempt: Date &#124; null }</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">context.</span>accessToken</span> | <code>{ value: string &#124; null, expiresAt: Date &#124; null }</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">context.</span>mfa</span> | <code>{ ticket: string } &#124; null</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">context.</span>user</span> | <code>[`User`](/reference/docgen/javascript/auth/types/user) &#124; null</code> | ✔️ | |
---

View File

@@ -1,49 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: signUp()
sidebar_label: signUp()
slug: /reference/javascript/auth/sign-up
description: Use `nhost.auth.signUp` to sign up a user using email and password. If you want to sign up a user using passwordless email (Magic Link), SMS, or an OAuth provider, use the `signIn` function instead.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L117
---
# `signUp()`
Use `nhost.auth.signUp` to sign up a user using email and password. If you want to sign up a user using passwordless email (Magic Link), SMS, or an OAuth provider, use the `signIn` function instead.
```ts
nhost.auth.signUp({
email: 'joe@example.com',
password: 'secret-password'
})
```
## Parameters
---
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`SignUpParams`](/reference/docgen/javascript/auth/types/sign-up-params)
---
## Examples
### Sign up with an email and password
```ts
nhost.auth.signUp({
email: 'joe@example.com',
password: 'secret-password'
})
```
### Sign up with a security key
```ts
nhost.auth.signUp({
email: 'joe@example.com',
securityKey: true
})
@docs https://docs.nhost.io/reference/javascript/auth/sign-up
```

View File

@@ -1,84 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: signIn()
sidebar_label: signIn()
slug: /reference/javascript/auth/sign-in
description: Use `nhost.auth.signIn` to sign in a user using email and password, passwordless (email or sms) or an external provider. `signIn` can be used to sign in a user in various ways depending on the parameters.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L187
---
# `signIn()`
Use `nhost.auth.signIn` to sign in a user using email and password, passwordless (email or sms) or an external provider. `signIn` can be used to sign in a user in various ways depending on the parameters.
```ts
nhost.auth.signIn({
email: 'joe@example.com',
password: 'secret-password'
})
```
## Parameters
---
**<span className="parameter-name">params</span>** <span className="optional-status">optional</span> [`SignInParams`](/reference/docgen/javascript/auth/types/sign-in-params)
---
## Examples
### Sign in a user using email and password
```ts
nhost.auth.signIn({
email: 'joe@example.com',
password: 'secret-password'
})
```
### Sign in a user using an OAuth provider (e.g: Google or Facebook)
```ts
nhost.auth.signIn({ provider: 'google' })
```
### Sign in a user using passwordless email (Magic Link)
```ts
nhost.auth.signIn({ email: 'joe@example.com' })
```
### Sign in a user using passwordless SMS
```ts
// [step 1/2] Passwordless sign in using SMS
nhost.auth.signIn({ phoneNumber: '+11233213123' })
// [step 2/2] Finish passwordless sign in using SMS (OTP)
nhost.auth.signIn({ phoneNumber: '+11233213123', otp: '123456' })
```
### Sign in anonymously
```ts
// Sign in anonymously
nhost.auth.signIn()
// Later in the application, the user can complete their registration
nhost.auth.signUp({
email: 'joe@example.com',
password: 'secret-password'
})
```
### Sign in with a security key
```ts
nhost.auth.signIn({
email: 'joe@example.com',
securityKey: true
})
@docs https://docs.nhost.io/reference/javascript/auth/sign-in
```

View File

@@ -1,38 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: signOut()
sidebar_label: signOut()
slug: /reference/javascript/auth/sign-out
description: Use `nhost.auth.signOut` to sign out the user.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L287
---
# `signOut()`
Use `nhost.auth.signOut` to sign out the user.
```ts
nhost.auth.signOut()
```
## Parameters
---
**<span className="parameter-name">params</span>** <span className="optional-status">optional</span> `{ all: boolean }`
---
## Examples
### Sign out the user from current device
```ts
nhost.auth.signOut()
```
### Sign out the user from all devices
```ts
nhost.auth.signOut({ all: true })
```

View File

@@ -1,29 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: resetPassword()
sidebar_label: resetPassword()
slug: /reference/javascript/auth/reset-password
description: Use `nhost.auth.resetPassword` to reset the password for a user. This will send a reset-password link in an email to the user. When the user clicks the reset-password link the user is automatically signed-in. Once signed-in, the user can change their password using `nhost.auth.changePassword()`.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L303
---
# `resetPassword()`
Use `nhost.auth.resetPassword` to reset the password for a user. This will send a reset-password link in an email to the user. When the user clicks the reset-password link the user is automatically signed-in. Once signed-in, the user can change their password using `nhost.auth.changePassword()`.
```ts
nhost.auth.resetPassword({ email: 'joe@example.com' })
```
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`ResetPasswordParams`](/reference/docgen/javascript/auth/types/reset-password-params)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------------------ | :--------------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>email</span> | `string` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>options</span> | `RedirectOption` | | |
---

View File

@@ -1,29 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: changePassword()
sidebar_label: changePassword()
slug: /reference/javascript/auth/change-password
description: Use `nhost.auth.changePassword` to change the password for the signed-in user. The old password is not needed. In case the user is not signed-in, a password reset ticket needs to be provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L319
---
# `changePassword()`
Use `nhost.auth.changePassword` to change the password for the signed-in user. The old password is not needed. In case the user is not signed-in, a password reset ticket needs to be provided.
```ts
nhost.auth.changePassword({ newPassword: 'new-secret-password' })
```
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`ChangePasswordParams`](/reference/docgen/javascript/auth/types/change-password-params)
| Property | Type | Required | Notes |
| :---------------------------------------------------------------------------------------------------------- | :------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>newPassword</span> | `string` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>ticket</span> | `string` | | |
---

View File

@@ -1,29 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: sendVerificationEmail()
sidebar_label: sendVerificationEmail()
slug: /reference/javascript/auth/send-verification-email
description: Use `nhost.auth.sendVerificationEmail` to send a verification email to the specified email. The email contains a verification-email link. When the user clicks the verification-email link their email is verified.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L338
---
# `sendVerificationEmail()`
Use `nhost.auth.sendVerificationEmail` to send a verification email to the specified email. The email contains a verification-email link. When the user clicks the verification-email link their email is verified.
```ts
nhost.auth.sendVerificationEmail({ email: 'joe@example.com' })
```
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`SendVerificationEmailParams`](/reference/docgen/javascript/auth/types/send-verification-email-params)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------------------ | :--------------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>email</span> | `string` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>options</span> | `RedirectOption` | | |
---

View File

@@ -1,29 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: changeEmail()
sidebar_label: changeEmail()
slug: /reference/javascript/auth/change-email
description: Use `nhost.auth.changeEmail` to change a user's email. This will send a confirm-email-change link in an email to the new email. Once the user clicks on the confirm-email-change link the email will be change to the new email.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L357
---
# `changeEmail()`
Use `nhost.auth.changeEmail` to change a user's email. This will send a confirm-email-change link in an email to the new email. Once the user clicks on the confirm-email-change link the email will be change to the new email.
```ts
nhost.auth.changeEmail({ newEmail: 'doe@example.com' })
```
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`ChangeEmailParams`](/reference/docgen/javascript/auth/types/change-email-params)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------------------- | :--------------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>newEmail</span> | `string` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>options</span> | `RedirectOption` | | |
---

View File

@@ -1,27 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: deanonymize()
sidebar_label: deanonymize()
slug: /reference/javascript/auth/deanonymize
description: Use `nhost.auth.deanonymize` to deanonymize a user.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L373
---
# `deanonymize()`
Use `nhost.auth.deanonymize` to deanonymize a user.
```ts
nhost.auth.deanonymize({
signInMethod: 'email-password',
email: 'joe@example.com'
})
```
## Parameters
---
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`DeanonymizeParams`](/reference/docgen/javascript/auth/types/deanonymize-params)
---

View File

@@ -1,22 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: addSecurityKey()
sidebar_label: addSecurityKey()
slug: /reference/javascript/auth/add-security-key
description: Use `nhost.auth.addSecurityKey to add a security key to the user, using the WebAuthn API.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L411
---
# `addSecurityKey()`
Use `nhost.auth.addSecurityKey to add a security key to the user, using the WebAuthn API.
## Parameters
---
**<span className="parameter-name">nickname</span>** <span className="optional-status">optional</span> `string`
optional human-readable nickname for the security key
---

View File

@@ -1,26 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: onTokenChanged()
sidebar_label: onTokenChanged()
slug: /reference/javascript/auth/on-token-changed
description: Use `nhost.auth.onTokenChanged` to add a custom function that runs every time the access or refresh token is changed.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L429
---
# `onTokenChanged()`
Use `nhost.auth.onTokenChanged` to add a custom function that runs every time the access or refresh token is changed.
```ts
nhost.auth.onTokenChanged(() =>
console.log('The access and refresh token has changed')
)
```
## Parameters
---
**<span className="parameter-name">fn</span>** <span className="optional-status">required</span> [`OnTokenChangedFunction`](/reference/docgen/javascript/auth/types/on-token-changed-function)
---

View File

@@ -1,28 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: onAuthStateChanged()
sidebar_label: onAuthStateChanged()
slug: /reference/javascript/auth/on-auth-state-changed
description: Use `nhost.auth.onAuthStateChanged` to add a custom function that runs every time the authentication status of the user changes. E.g. add a custom function that runs every time the authentication status changes from signed-in to signed-out.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L464
---
# `onAuthStateChanged()`
Use `nhost.auth.onAuthStateChanged` to add a custom function that runs every time the authentication status of the user changes. E.g. add a custom function that runs every time the authentication status changes from signed-in to signed-out.
```ts
nhost.auth.onAuthStateChanged((event, session) => {
console.log(
`The auth state has changed. State is now ${event} with session: ${session}`
)
})
```
## Parameters
---
**<span className="parameter-name">fn</span>** <span className="optional-status">required</span> [`AuthChangedFunction`](/reference/docgen/javascript/auth/types/auth-changed-function)
---

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