Compare commits

..

7 Commits

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


# Releases
## @nhost/dashboard@2.11.3

### Patch Changes

- 714dffa: fix: improve project polling logic and unify usage across
components

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-12-19 20:10:54 +01:00
Hassan Ben Jobrane
714dffa5ec feat: split get project query to improve performance while polling for the project state (#3086)
### **PR Type**
Enhancement, Other


___

### **Description**
- Introduced a new hook `useProjectWithState` to improve project state
polling, replacing the previous `useProject` hook.
- Updated components and hooks to use `useProjectWithState` for better
performance and state management.
- Enhanced GraphQL schema with new queries and types, including virus
management capabilities.
- Removed deprecated fields and functions from the GraphQL schema.



___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>ProjectLayout.tsx</strong><dd><code>Update project hook
to improve state polling</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

dashboard/src/features/orgs/layout/ProjectLayout/ProjectLayout.tsx

<li>Replaced <code>useProject</code> with
<code>useProjectWithState</code> to improve project state
<br>polling.<br>


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3086/files#diff-c5aa135e650744742b6195a88f0dc2b63518bd713c8bf7d31310d62ab95a56ad">+2/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>useAppState.ts</strong><dd><code>Use updated project
hook for app state</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></summary>
<hr>


dashboard/src/features/orgs/projects/common/hooks/useAppState/useAppState.ts

<li>Replaced <code>useProject</code> with
<code>useProjectWithState</code> for application state
<br>retrieval.<br>


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3086/files#diff-3d41e9731972061d2f25f1b71cda250cd8e38454c608564c6ddc847508bf150f">+2/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>useProject.ts</strong><dd><code>Simplify useProject
hook by removing polling</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

dashboard/src/features/orgs/projects/hooks/useProject/useProject.ts

<li>Removed polling options from <code>useProject</code>.<br> <li>
Simplified the hook to not include polling logic.<br>


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3086/files#diff-ef96f340af7a87a1fc60c42d8f4de846a2a54fde830a9461c64cfbc99dc11128">+1/-12</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>index.ts</strong><dd><code>Export useProjectWithState
hook</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

dashboard/src/features/orgs/projects/hooks/useProjectWithState/index.ts

- Added export for `useProjectWithState`.



</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3086/files#diff-82f3d2d843a1f457832aa3d15683f6a1c30da94c0e3c01a60f9bbfccd49c5c43">+1/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>useProjectWithState.ts</strong><dd><code>Implement
useProjectWithState hook with polling</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>


dashboard/src/features/orgs/projects/hooks/useProjectWithState/useProjectWithState.ts

<li>Implemented <code>useProjectWithState</code> hook with polling
logic.<br> <li> Utilizes <code>useQuery</code> for fetching project
state.<br>


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3086/files#diff-4fa0e580d9f12e35ff5d2751597bf443bd055cd1c854cf6b356110724d424188">+77/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>graphql.ts</strong><dd><code>Update GraphQL types and
queries for project state and virus
</code><br><code>management</code></dd></summary>
<hr>

dashboard/src/utils/__generated__/graphql.ts

<li>Added <code>GetProjectStateQuery</code> and related types.<br> <li>
Removed unused fields and functions.<br> <li> Added new fields and types
for virus management.<br>


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3086/files#diff-fbd5db84b560b1c91675004448c6c7fa0dcbfb28b9eb05d53b03e6cb7b83ebac">+501/-39</a></td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>getProjectState.gql</strong><dd><code>Add GraphQL query
for project state</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

dashboard/src/gql/organizations/getProjectState.gql

- Added new GraphQL query for fetching project state by subdomain.



</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3086/files#diff-88f84673d467d0b44d14b789a6beed90050c7898bb3fb95847ad892b116a3b6d">+16/-0</a>&nbsp;
&nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

___

> 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull
request to receive relevant information
2024-12-19 19:54:00 +01:00
github-actions[bot]
760835d80f chore: update versions (#3087)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @nhost/dashboard@2.11.2

### Patch Changes

- 6a34f89: fix: improve project polling logic and unify usage across
components

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-12-19 12:16:31 +01:00
Hassan Ben Jobrane
6a34f891a5 fix: improveuseProject hook to use proper caching and refetching (#3085)
### **PR Type**
Bug fix, Enhancement


___

### **Description**
- Removed the `target` option from multiple `useProject` hook calls
across various components to simplify usage.
- Enhanced the `useProject` hook by improving project fetching logic
with `useMemo` and adjusting refetching and caching strategies.
- Made minor formatting adjustments in several files for consistency.
- Added a changeset documenting the improvements in project polling
logic.



___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>9
files</summary><table>
<tr>
  <td>
    <details>

<summary><strong>useRemoteApplicationGQLClient.tsx</strong><dd><code>Simplified
`useProject` hook usage by removing `target`
option</code></dd></summary>
<hr>


dashboard/src/features/orgs/hooks/useRemoteApplicationGQLClient/useRemoteApplicationGQLClient.tsx

- Removed the `target` option from the `useProject` hook call.



</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3085/files#diff-3323409c3168ed8475247d08c5b868de300441b3363ae647fa298a90c4e3c973">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>useGetAppUsers.ts</strong><dd><code>Simplified
`useProject` hook usage by removing `target`
option</code></dd></summary>
<hr>


dashboard/src/features/orgs/projects/graphql/common/hooks/useGetAppUsers.ts

- Removed the `target` option from the `useProject` hook call.



</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3085/files#diff-8408473ab849d4b41515ef0387ce66851205c28244bd1c962f72f14e7f74d27a">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>useAppClient.ts</strong><dd><code>Simplified
`useProject` hook usage by removing `target`
option</code></dd></summary>
<hr>

dashboard/src/features/orgs/projects/hooks/useAppClient/useAppClient.ts

- Removed the `target` option from the `useProject` hook call.



</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3085/files#diff-0aa83222c0e0eac6f0058070de2b199e5e78514cbba405eb98d3693329a93e65">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>useProject.ts</strong><dd><code>Enhanced project
fetching logic and caching in `useProject` hook</code></dd></summary>
<hr>

dashboard/src/features/orgs/projects/hooks/useProject/useProject.ts

<li>Removed <code>target</code> option from <code>useProject</code>
hook.<br> <li> Improved project fetching logic with
<code>useMemo</code>.<br> <li> Adjusted refetching and caching
strategies.<br>


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3085/files#diff-ef96f340af7a87a1fc60c42d8f4de846a2a54fde830a9461c64cfbc99dc11128">+30/-27</a>&nbsp;
</td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>DataGridPreviewCell.tsx</strong><dd><code>Simplified
`useProject` hook usage by removing `target`
option</code></dd></summary>
<hr>


dashboard/src/features/orgs/projects/storage/dataGrid/components/DataGridPreviewCell/DataGridPreviewCell.tsx

- Removed the `target` option from the `useProject` hook call.



</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3085/files#diff-d7bffe5896d2c9bac505fa9675790c59549d4fb35a2ad0cce903cc0aa31a8321">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>FilesDataGrid.tsx</strong><dd><code>Simplified
`useProject` hook usage and formatting adjustments</code></dd></summary>
<hr>


dashboard/src/features/orgs/projects/storage/dataGrid/components/FilesDataGrid/FilesDataGrid.tsx

<li>Removed the <code>target</code> option from the
<code>useProject</code> hook call.<br> <li> Minor formatting
adjustments.<br>


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3085/files#diff-18c8df727e1a4fc6a94d03bd4a3a7a8cb3ad44d754803c4c7988c1c00a4b7caf">+4/-4</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>FilesDataGridControls.tsx</strong><dd><code>Simplified
`useProject` hook usage and formatting adjustments</code></dd></summary>
<hr>


dashboard/src/features/orgs/projects/storage/dataGrid/components/FilesDataGridControls/FilesDataGridControls.tsx

<li>Removed the <code>target</code> option from the
<code>useProject</code> hook call.<br> <li> Minor formatting
adjustments.<br>


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3085/files#diff-b85b40168e9c149331a68cb1a0cbec570c75233fa34385945e094b8f4c032974">+4/-4</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>useFiles.ts</strong><dd><code>Simplified `useProject`
hook usage by removing `target` option</code></dd></summary>
<hr>


dashboard/src/features/orgs/projects/storage/dataGrid/hooks/useFiles/useFiles.ts

- Removed the `target` option from the `useProject` hook call.



</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3085/files#diff-ed71bc1eff3e4515937f01dec41686108466c8272d974628483103ea4dd0b1ed">+2/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>graphql.tsx</strong><dd><code>Simplified `useProject`
hook usage and formatting adjustments</code></dd></summary>
<hr>

dashboard/src/pages/orgs/[orgSlug]/projects/[appSubdomain]/graphql.tsx

<li>Removed the <code>target</code> option from the
<code>useProject</code> hook call.<br> <li> Minor formatting
adjustments.<br>


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3085/files#diff-6e3410ca11e10761fa7e9fbac46fa88089ed697b58aae7a2c58245d24208fbb1">+2/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

</table></details></td></tr><tr><td><strong>Documentation</strong></td><td><details><summary>1
files</summary><table>
<tr>
  <td>
    <details>
<summary><strong>stale-avocados-shake.md</strong><dd><code>Documented
changeset for project polling improvements</code>&nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

.changeset/stale-avocados-shake.md

- Added changeset for project polling logic improvements.



</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3085/files#diff-d70925481a44dd2deb12d1b3af17bebf4d25becb0d133e82a1410a8070f42471">+5/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></details></td></tr></tr></tbody></table>

___

> 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull
request to receive relevant information
2024-12-19 18:17:44 +08:00
github-actions[bot]
037bd74764 chore: update versions (#3084)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @nhost/dashboard@2.11.1

### Patch Changes

-   0f6ce52: fix: consolidate useProject hook and fix jwt expired error

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-12-17 12:44:21 +01:00
Hassan Ben Jobrane
0f6ce52c4e fix(dashboard): resolve JWT expired error (#3083)
### **User description**
fixes https://github.com/nhost/projects/issues/124


___

### **PR Type**
Bug fix, Enhancement


___

### **Description**
- Refactored the `useProject` hook to consolidate query logic and
simplify error handling and loading state management.
- Removed redundant query logic for the 'console-next' target, improving
code clarity and maintainability.
- Updated pnpm version in the Dockerfile from 8.10.5 to 9.15.0 to ensure
compatibility with the latest features and fixes.
- Added a changeset documenting the fix for the JWT expired error.



___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>useProject.ts</strong><dd><code>Refactor and simplify
`useProject` hook logic</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

dashboard/src/features/orgs/projects/hooks/useProject/useProject.ts

<li>Consolidated query logic in <code>useProject</code> hook.<br> <li>
Removed redundant query logic for 'console-next' target.<br> <li>
Simplified error handling and loading state management.<br>


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3083/files#diff-ef96f340af7a87a1fc60c42d8f4de846a2a54fde830a9461c64cfbc99dc11128">+15/-44</a>&nbsp;
</td>

</tr>
</table></td></tr><tr><td><strong>Documentation</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>shaggy-rivers-rescue.md</strong><dd><code>Add changeset
for JWT expired error fix</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

.changeset/shaggy-rivers-rescue.md

<li>Added changeset for patch release.<br> <li> Documented fix for JWT
expired error.<br>


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3083/files#diff-4b792f2b2f308ef98dc4d91b0a710530f2f0635c1d6f8ba8d0eabd93ebaa049d">+5/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr><tr><td><strong>Dependencies</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>Dockerfile</strong><dd><code>Update pnpm version in
Dockerfile</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

dashboard/Dockerfile

- Updated pnpm version from 8.10.5 to 9.15.0.



</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3083/files#diff-e4409471758b4d6438b1bf954190cf0659eb6c4b30efafe877d20e4e485c383f">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

___

> 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull
request to receive relevant information
2024-12-17 12:23:52 +01:00
Hassan Ben Jobrane
6696172bcb chore: upgrade to pnpm 9.15.0 (#3081)
### **PR Type**
enhancement, configuration changes


___

### **Description**
- Upgraded `pnpm` to version 9.15.0 across the project, including GitHub
Actions and root package configuration.
- Updated Node.js version to 20 in GitHub Actions and root package
configuration.
- Moved `@nhost/nhost-js` from `devDependencies` to `dependencies` in
the SvelteKit example.
- Removed `pnpm` from `devDependencies` in the Vue quickstart example.
- Added `compilerOptions` with an empty `types` array in the
`tsconfig.json` for `hasura-auth-js`.



___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Configuration
changes</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>action.yaml</strong><dd><code>Upgrade pnpm and Node.js
versions in GitHub Actions</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

.github/actions/install-dependencies/action.yaml

<li>Upgraded <code>pnpm</code> version from 8.10.5 to 9.15.0.<br> <li>
Updated Node.js version from 18 to 20.<br>


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3081/files#diff-342d59190b4737ee45e2062eb625ada477bcea5b4a843b25900ad55d7982f200">+3/-3</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>package.json</strong><dd><code>Update pnpm and Node.js
engine in root package.json</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

package.json

<li>Updated <code>pnpm</code> version in <code>packageManager</code>
field to 9.15.0.<br> <li> Changed Node.js engine requirement to version
20 or higher.<br>


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3081/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519">+2/-3</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>package.json</strong><dd><code>Adjust dependencies in
SvelteKit example</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></summary>
<hr>

examples/quickstarts/sveltekit/package.json

- Moved `@nhost/nhost-js` from `devDependencies` to `dependencies`.



</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3081/files#diff-6288951fff74ec246c9cc023b7b7e3e9aad31423891bc4ea25b5d84a5f5b061f">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>package.json</strong><dd><code>Remove pnpm from Vue
quickstart devDependencies</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

examples/vue-quickstart/package.json

- Removed `pnpm` from `devDependencies`.



</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3081/files#diff-85166d1137e29a5275f991e1e94a0c9d5b83ac7504463ba76f9187b2b750c895">+0/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>tsconfig.json</strong><dd><code>Add compiler options to
TypeScript configuration</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

packages/hasura-auth-js/tsconfig.json

- Added `compilerOptions` with empty `types` array.



</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3081/files#diff-f4ce71cf32b93f403010fe5002bdc1081000207e40a6fea24b82346d6ea0dac7">+4/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

___

> 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull
request to receive relevant information
2024-12-16 19:48:12 +01:00
30 changed files with 13872 additions and 28875 deletions

View File

@@ -14,7 +14,7 @@ runs:
steps:
- uses: pnpm/action-setup@v4
with:
version: 8.10.5
version: 9.15.0
run_install: false
- name: Get pnpm cache directory
id: pnpm-cache-dir
@@ -26,10 +26,10 @@ runs:
path: ${{ steps.pnpm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-node-
- name: Use Node.js v18
- name: Use Node.js v20
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
- shell: bash
name: Install packages
run: pnpm install --frozen-lockfile

View File

@@ -1,5 +1,23 @@
# @nhost/dashboard
## 2.11.3
### Patch Changes
- 714dffa: fix: improve project polling logic and unify usage across components
## 2.11.2
### Patch Changes
- 6a34f89: fix: improve project polling logic and unify usage across components
## 2.11.1
### Patch Changes
- 0f6ce52: fix: consolidate useProject hook and fix jwt expired error
## 2.11.0
### Minor Changes

View File

@@ -30,7 +30,7 @@ ENV NEXT_PUBLIC_NHOST_HASURA_MIGRATIONS_API_URL __NEXT_PUBLIC_NHOST_HASURA_MIGRA
ENV NEXT_PUBLIC_NHOST_HASURA_API_URL __NEXT_PUBLIC_NHOST_HASURA_API_URL__
ENV NEXT_PUBLIC_NHOST_CONFIGSERVER_URL __NEXT_PUBLIC_NHOST_CONFIGSERVER_URL__
RUN yarn global add pnpm@8.10.5
RUN yarn global add pnpm@9.15.0
COPY .gitignore .gitignore
COPY --from=pruner /app/out/json/ .
COPY --from=pruner /app/out/pnpm-*.yaml .

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/dashboard",
"version": "2.11.0",
"version": "2.11.3",
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",

View File

@@ -9,7 +9,7 @@ import { useMemo } from 'react';
* @returns A function that returns a new ApolloClient instance.
*/
export default function useRemoteApplicationGQLClient() {
const { project, loading } = useProject({ target: 'user-project' });
const { project, loading } = useProject();
const serviceUrl = generateAppServiceUrl(
project?.subdomain,
project?.region,

View File

@@ -12,7 +12,7 @@ import { ApplicationUnknown } from '@/features/orgs/projects/common/components/A
import { ApplicationUnpausing } from '@/features/orgs/projects/common/components/ApplicationUnpausing';
import { useAppState } from '@/features/orgs/projects/common/hooks/useAppState';
import { useIsPlatform } from '@/features/orgs/projects/common/hooks/useIsPlatform';
import { useProject } from '@/features/orgs/projects/hooks/useProject';
import { useProjectWithState } from '@/features/orgs/projects/hooks/useProjectWithState';
import { ApplicationStatus } from '@/types/application';
import { NextSeo } from 'next-seo';
import { useRouter } from 'next/router';
@@ -37,7 +37,7 @@ function ProjectLayoutContent({
const { state } = useAppState();
const isPlatform = useIsPlatform();
const { project, loading, error } = useProject({ poll: true });
const { project, loading, error } = useProjectWithState();
const isOnOverviewPage = route === '/orgs/[orgSlug]/projects/[appSubdomain]';

View File

@@ -1,4 +1,4 @@
import { useProject } from '@/features/orgs/projects/hooks/useProject';
import { useProjectWithState } from '@/features/orgs/projects/hooks/useProjectWithState';
import { ApplicationStatus } from '@/types/application';
/**
@@ -9,7 +9,7 @@ export default function useAppState(): {
state: ApplicationStatus;
message?: string;
} {
const { project } = useProject({ poll: true });
const { project } = useProjectWithState();
const noApplication = !project;
if (noApplication) {

View File

@@ -26,7 +26,7 @@ export default function useGetAppUsers({
offset = 0,
options = {},
}: UseFilesOptions) {
const { project } = useProject({ target: 'user-project' });
const { project } = useProject();
const userApplicationClient = useRemoteApplicationGQLClient();
const { data, error, loading } = useRemoteAppGetUsersCustomQuery({
...options,

View File

@@ -24,7 +24,7 @@ export default function useAppClient(
options?: UseAppClientOptions,
): UseAppClientReturn {
const isPlatform = useIsPlatform();
const { project } = useProject({ target: 'user-project' });
const { project } = useProject();
if (!isPlatform) {
return new NhostClient({

View File

@@ -2,21 +2,16 @@ import { localApplication } from '@/features/orgs/utils/local-dashboard';
import { useIsPlatform } from '@/features/projects/common/hooks/useIsPlatform';
import {
GetProjectDocument,
useGetProjectQuery,
type GetProjectQuery,
type ProjectFragment,
} from '@/utils/__generated__/graphql';
import { useAuthenticationStatus, useNhostClient } from '@nhost/nextjs';
import { useQuery } from '@tanstack/react-query';
import { useRouter } from 'next/router';
import { useMemo } from 'react';
type Project = GetProjectQuery['apps'][0];
interface UseProjectOptions {
poll?: boolean;
target?: 'console-next' | 'user-project';
}
export interface UseProjectReturnType {
project: Project;
loading?: boolean;
@@ -24,10 +19,7 @@ export interface UseProjectReturnType {
refetch: (variables?: any) => Promise<any>;
}
export default function useProject({
poll = false,
target = 'console-next',
}: UseProjectOptions = {}): UseProjectReturnType {
export default function useProject(): UseProjectReturnType {
const {
query: { appSubdomain },
isReady: isRouterReady,
@@ -37,65 +29,36 @@ export default function useProject({
const { isAuthenticated, isLoading: isAuthLoading } =
useAuthenticationStatus();
const shouldFetchProject =
isPlatform &&
isAuthenticated &&
!isAuthLoading &&
!!appSubdomain &&
isRouterReady;
// Fetch project data for 'console-next' target
const {
data: consoleData,
loading: consoleLoading,
error: consoleError,
refetch: refetchConsole,
} = useGetProjectQuery({
variables: { subdomain: appSubdomain as string },
skip: !shouldFetchProject && target === 'console-next',
fetchPolicy: 'cache-and-network',
pollInterval: poll ? 5000 * 2 : 0, // every 10s
});
// Fetch project data for 'user-project' target using client.graphql
const {
data: userProjectData,
isFetching: userProjectFetching,
refetch: refetchUserProject,
} = useQuery(
['currentProject', appSubdomain],
const shouldFetchProject = useMemo(
() =>
client.graphql.request<{ apps: ProjectFragment[] }>(GetProjectDocument, {
isPlatform &&
isAuthenticated &&
!isAuthLoading &&
!!appSubdomain &&
isRouterReady,
[isPlatform, isAuthenticated, isAuthLoading, appSubdomain, isRouterReady],
);
const { data, isLoading, refetch, error } = useQuery(
['project', appSubdomain as string],
async () => {
const response = await client.graphql.request<{
apps: ProjectFragment[];
}>(GetProjectDocument, {
subdomain: (appSubdomain as string) || '',
}),
});
return response;
},
{
keepPreviousData: true,
enabled: shouldFetchProject && target === 'user-project',
staleTime: poll ? 5000 : Infinity, // Adjust staleTime for better performance
enabled: shouldFetchProject,
},
);
const project =
target === 'console-next'
? consoleData?.apps?.[0] || null
: userProjectData?.data?.apps?.[0] || null;
const loading =
target === 'console-next'
? consoleLoading || isAuthLoading
: userProjectFetching || isAuthLoading;
const error = consoleError
? new Error(consoleError.message || 'Unknown error occurred.')
: null;
const refetch =
target === 'console-next' ? refetchConsole : refetchUserProject;
if (isPlatform) {
return {
project,
loading,
error,
project: data?.data?.apps?.[0] || null,
loading: isLoading && shouldFetchProject,
error: Array.isArray(error || {}) ? error[0] : error,
refetch,
};
}

View File

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

View File

@@ -0,0 +1,77 @@
import { localApplication } from '@/features/orgs/utils/local-dashboard';
import { useIsPlatform } from '@/features/projects/common/hooks/useIsPlatform';
import {
GetProjectStateDocument,
type GetProjectQuery,
type ProjectFragment,
} from '@/utils/__generated__/graphql';
import { useAuthenticationStatus, useNhostClient } from '@nhost/nextjs';
import { useQuery } from '@tanstack/react-query';
import { useRouter } from 'next/router';
import { useMemo } from 'react';
type Project = GetProjectQuery['apps'][0];
export interface UseProjectWithStateReturnType {
project: Project;
loading?: boolean;
error?: Error;
refetch: (variables?: any) => Promise<any>;
}
export default function useProjectWithState(): UseProjectWithStateReturnType {
const {
query: { appSubdomain },
isReady: isRouterReady,
} = useRouter();
const client = useNhostClient();
const isPlatform = useIsPlatform();
const { isAuthenticated, isLoading: isAuthLoading } =
useAuthenticationStatus();
const shouldFetchProject = useMemo(
() =>
isPlatform &&
isAuthenticated &&
!isAuthLoading &&
!!appSubdomain &&
isRouterReady,
[isPlatform, isAuthenticated, isAuthLoading, appSubdomain, isRouterReady],
);
const { data, isLoading, refetch, error } = useQuery(
['projectWithState', appSubdomain as string],
async () => {
const response = await client.graphql.request<{
apps: ProjectFragment[];
}>(GetProjectStateDocument, {
subdomain: (appSubdomain as string) || '',
});
return response;
},
{
enabled: shouldFetchProject,
keepPreviousData: true,
refetchOnWindowFocus: true,
refetchInterval: 10000, // poll every 10s
staleTime: 1000 * 60 * 5, // 1 minutes
cacheTime: 1000 * 60 * 6, //
},
);
if (isPlatform) {
return {
project: data?.data?.apps?.[0] || null,
loading: isLoading && shouldFetchProject,
error: Array.isArray(error || {}) ? error[0] : error,
refetch,
};
}
return {
project: localApplication,
loading: false,
error: null,
refetch: () => Promise.resolve(),
};
}

View File

@@ -166,7 +166,7 @@ export default function DataGridPreviewCell<TData extends object>({
value: { fetchBlob, id, mimeType, alt, blob },
fallbackPreview = null,
}: DataGridPreviewCellProps<TData>) {
const { project } = useProject({ target: 'user-project' });
const { project } = useProject();
const appClient = useAppClient();
const { objectUrl, loading, error } = useBlob({ fetchBlob, blob, mimeType });
const [showModal, setShowModal] = useState(false);

View File

@@ -13,10 +13,10 @@ import { FilesDataGridControls } from '@/features/orgs/projects/storage/dataGrid
import { useBuckets } from '@/features/orgs/projects/storage/dataGrid/hooks/useBuckets';
import { useFiles } from '@/features/orgs/projects/storage/dataGrid/hooks/useFiles';
import { useFilesAggregate } from '@/features/orgs/projects/storage/dataGrid/hooks/useFilesAggregate';
import { getHasuraAdminSecret } from '@/utils/env';
import { showLoadingToast, triggerToast } from '@/utils/toast';
import type { Files } from '@/utils/__generated__/graphql';
import { Order_By as OrderBy } from '@/utils/__generated__/graphql';
import { getHasuraAdminSecret } from '@/utils/env';
import { showLoadingToast, triggerToast } from '@/utils/toast';
import debounce from 'lodash.debounce';
import { useRouter } from 'next/router';
import type { ChangeEvent } from 'react';
@@ -32,7 +32,7 @@ export type FilesDataGridProps = Partial<DataGridProps<StoredFile>>;
export default function FilesDataGrid(props: FilesDataGridProps) {
const router = useRouter();
const { project } = useProject({ target: 'user-project' });
const { project } = useProject();
const appClient = useAppClient();
const [searchString, setSearchString] = useState<string | null>(null);
const [currentOffset, setCurrentOffset] = useState<number | null>(
@@ -118,7 +118,7 @@ export default function FilesDataGrid(props: FilesDataGridProps) {
DataGridPreviewCell({
...cellProps,
fallbackPreview: (
<FilePreviewIcon className="w-5 h-5 fill-current" />
<FilePreviewIcon className="h-5 w-5 fill-current" />
),
}),
minWidth: 80,

View File

@@ -12,9 +12,9 @@ import { useAppClient } from '@/features/orgs/projects/hooks/useAppClient';
import { useProject } from '@/features/orgs/projects/hooks/useProject';
import type { FileUploadButtonProps } from '@/features/orgs/projects/storage/dataGrid/components/FileUploadButton';
import { FileUploadButton } from '@/features/orgs/projects/storage/dataGrid/components/FileUploadButton';
import type { Files } from '@/utils/__generated__/graphql';
import { getHasuraAdminSecret } from '@/utils/env';
import { triggerToast } from '@/utils/toast';
import type { Files } from '@/utils/__generated__/graphql';
import type { PropsWithoutRef } from 'react';
import { useState } from 'react';
import type { Row } from 'react-table';
@@ -38,7 +38,7 @@ export default function FilesDataGridControls({
...props
}: FilesDataGridControlsProps) {
const { openAlertDialog } = useDialog();
const { project } = useProject({ target: 'user-project' });
const { project } = useProject();
const appClient = useAppClient();
const [deleteLoading, setDeleteLoading] = useState(false);
@@ -160,7 +160,7 @@ export default function FilesDataGridControls({
</Button>
</div>
) : (
<div className="grid w-full grid-cols-12 gap-2 mx-auto">
<div className="mx-auto grid w-full grid-cols-12 gap-2">
<Input
className={twMerge(
'col-span-12 xs+:col-span-12 md:col-span-9 xl:col-span-10',
@@ -170,7 +170,7 @@ export default function FilesDataGridControls({
{...restFilterProps}
/>
<div className="grid grid-flow-col col-span-12 gap-2 md:col-span-3 xl:col-span-2">
<div className="col-span-12 grid grid-flow-col gap-2 md:col-span-3 xl:col-span-2">
<DataGridPagination
className={twMerge('col-span-6', paginationClassName)}
{...restPaginationProps}

View File

@@ -1,11 +1,11 @@
import { generateAppServiceUrl } from '@/features/orgs/projects/common/utils/generateAppServiceUrl';
import { useProject } from '@/features/orgs/projects/hooks/useProject';
import { getHasuraAdminSecret } from '@/utils/env';
import type {
Files_Order_By as FilesOrderBy,
GetFilesQuery,
} from '@/utils/__generated__/graphql';
import { useGetFilesQuery } from '@/utils/__generated__/graphql';
import { getHasuraAdminSecret } from '@/utils/env';
import type { QueryHookOptions } from '@apollo/client';
export type UseFilesOptions = {
@@ -38,7 +38,7 @@ export default function useFiles({
orderBy,
options = {},
}: UseFilesOptions) {
const { project } = useProject({ target: 'user-project' });
const { project } = useProject();
const { data, previousData, ...rest } = useGetFilesQuery({
variables: {
where: searchString

View File

@@ -0,0 +1,23 @@
query getProjectState($subdomain: String!) {
apps(where: { subdomain: { _eq: $subdomain } }) {
id
name
subdomain
region {
id
countryCode
name
domain
city
}
createdAt
desiredState
appStates(order_by: { createdAt: desc }, limit: 1) {
id
appId
message
stateId
createdAt
}
}
}

View File

@@ -102,7 +102,7 @@ export default function AutoEmbeddingsPage() {
}
if (
(isPlatform && !org?.plan?.isFree && !project.config?.ai) ||
(isPlatform && !org?.plan?.isFree && !project?.config?.ai) ||
!isGraphiteEnabled
) {
return (

View File

@@ -117,7 +117,7 @@ function GraphiQLHeader({ onUserChange, onRoleChange }: GraphiQLHeaderProps) {
}
return (
<header className="grid items-end grid-flow-row gap-2 p-2 md:grid-flow-col md:justify-between">
<header className="grid grid-flow-row items-end gap-2 p-2 md:grid-flow-col md:justify-between">
<div className="grid grid-flow-row gap-2 md:grid-flow-col md:items-end">
<div className="grid grid-cols-2 gap-2 md:grid-flow-col md:grid-cols-[initial]">
<UserSelect
@@ -250,7 +250,7 @@ function GraphiQLEditor({ onHeaderChange }: GraphiQLEditorProps) {
}
export default function GraphQLPage() {
const { project } = useProject({ target: 'user-project' });
const { project } = useProject();
const [userHeaders, setUserHeaders] = useState<Record<string, any>>({});
if (!project?.subdomain || !project?.config?.hasura.adminSecret) {

View File

@@ -5732,7 +5732,6 @@ export type AuthRefreshTokens = {
id: Scalars['uuid'];
metadata?: Maybe<Scalars['jsonb']>;
refreshTokenHash?: Maybe<Scalars['String']>;
refresh_token?: Maybe<Scalars['uuid']>;
type: AuthRefreshTokenTypes_Enum;
/** An object relationship */
user: Users;
@@ -5807,7 +5806,6 @@ export type AuthRefreshTokens_Bool_Exp = {
id?: InputMaybe<Uuid_Comparison_Exp>;
metadata?: InputMaybe<Jsonb_Comparison_Exp>;
refreshTokenHash?: InputMaybe<String_Comparison_Exp>;
refresh_token?: InputMaybe<Uuid_Comparison_Exp>;
type?: InputMaybe<AuthRefreshTokenTypes_Enum_Comparison_Exp>;
user?: InputMaybe<Users_Bool_Exp>;
userId?: InputMaybe<Uuid_Comparison_Exp>;
@@ -5841,7 +5839,6 @@ export type AuthRefreshTokens_Insert_Input = {
id?: InputMaybe<Scalars['uuid']>;
metadata?: InputMaybe<Scalars['jsonb']>;
refreshTokenHash?: InputMaybe<Scalars['String']>;
refresh_token?: InputMaybe<Scalars['uuid']>;
type?: InputMaybe<AuthRefreshTokenTypes_Enum>;
user?: InputMaybe<Users_Obj_Rel_Insert_Input>;
userId?: InputMaybe<Scalars['uuid']>;
@@ -5854,7 +5851,6 @@ export type AuthRefreshTokens_Max_Fields = {
expiresAt?: Maybe<Scalars['timestamptz']>;
id?: Maybe<Scalars['uuid']>;
refreshTokenHash?: Maybe<Scalars['String']>;
refresh_token?: Maybe<Scalars['uuid']>;
userId?: Maybe<Scalars['uuid']>;
};
@@ -5864,7 +5860,6 @@ export type AuthRefreshTokens_Max_Order_By = {
expiresAt?: InputMaybe<Order_By>;
id?: InputMaybe<Order_By>;
refreshTokenHash?: InputMaybe<Order_By>;
refresh_token?: InputMaybe<Order_By>;
userId?: InputMaybe<Order_By>;
};
@@ -5875,7 +5870,6 @@ export type AuthRefreshTokens_Min_Fields = {
expiresAt?: Maybe<Scalars['timestamptz']>;
id?: Maybe<Scalars['uuid']>;
refreshTokenHash?: Maybe<Scalars['String']>;
refresh_token?: Maybe<Scalars['uuid']>;
userId?: Maybe<Scalars['uuid']>;
};
@@ -5885,7 +5879,6 @@ export type AuthRefreshTokens_Min_Order_By = {
expiresAt?: InputMaybe<Order_By>;
id?: InputMaybe<Order_By>;
refreshTokenHash?: InputMaybe<Order_By>;
refresh_token?: InputMaybe<Order_By>;
userId?: InputMaybe<Order_By>;
};
@@ -5912,7 +5905,6 @@ export type AuthRefreshTokens_Order_By = {
id?: InputMaybe<Order_By>;
metadata?: InputMaybe<Order_By>;
refreshTokenHash?: InputMaybe<Order_By>;
refresh_token?: InputMaybe<Order_By>;
type?: InputMaybe<Order_By>;
user?: InputMaybe<Users_Order_By>;
userId?: InputMaybe<Order_By>;
@@ -5941,8 +5933,6 @@ export enum AuthRefreshTokens_Select_Column {
/** column name */
RefreshTokenHash = 'refreshTokenHash',
/** column name */
RefreshToken = 'refresh_token',
/** column name */
Type = 'type',
/** column name */
UserId = 'userId'
@@ -5955,7 +5945,6 @@ export type AuthRefreshTokens_Set_Input = {
id?: InputMaybe<Scalars['uuid']>;
metadata?: InputMaybe<Scalars['jsonb']>;
refreshTokenHash?: InputMaybe<Scalars['String']>;
refresh_token?: InputMaybe<Scalars['uuid']>;
type?: InputMaybe<AuthRefreshTokenTypes_Enum>;
userId?: InputMaybe<Scalars['uuid']>;
};
@@ -5975,7 +5964,6 @@ export type AuthRefreshTokens_Stream_Cursor_Value_Input = {
id?: InputMaybe<Scalars['uuid']>;
metadata?: InputMaybe<Scalars['jsonb']>;
refreshTokenHash?: InputMaybe<Scalars['String']>;
refresh_token?: InputMaybe<Scalars['uuid']>;
type?: InputMaybe<AuthRefreshTokenTypes_Enum>;
userId?: InputMaybe<Scalars['uuid']>;
};
@@ -5993,8 +5981,6 @@ export enum AuthRefreshTokens_Update_Column {
/** column name */
RefreshTokenHash = 'refreshTokenHash',
/** column name */
RefreshToken = 'refresh_token',
/** column name */
Type = 'type',
/** column name */
UserId = 'userId'
@@ -8309,10 +8295,6 @@ export enum Billing_Reports_Constraint {
ReportsPkey = 'reports_pkey'
}
export type Billing_Reports_Delete_Older_Than_Days_Args = {
days?: InputMaybe<Scalars['Int']>;
};
/** input type for incrementing numeric columns in table "billing.reports" */
export type Billing_Reports_Inc_Input = {
value?: InputMaybe<Scalars['Int']>;
@@ -11879,6 +11861,7 @@ export type Files = {
etag?: Maybe<Scalars['String']>;
id: Scalars['uuid'];
isUploaded?: Maybe<Scalars['Boolean']>;
metadata?: Maybe<Scalars['jsonb']>;
mimeType?: Maybe<Scalars['String']>;
name?: Maybe<Scalars['String']>;
size?: Maybe<Scalars['Int']>;
@@ -11886,6 +11869,12 @@ export type Files = {
uploadedByUserId?: Maybe<Scalars['uuid']>;
};
/** columns and relationships of "storage.files" */
export type FilesMetadataArgs = {
path?: InputMaybe<Scalars['String']>;
};
/** aggregated selection of "storage.files" */
export type Files_Aggregate = {
__typename?: 'files_aggregate';
@@ -11958,6 +11947,11 @@ export type Files_Aggregate_Order_By = {
variance?: InputMaybe<Files_Variance_Order_By>;
};
/** append existing jsonb value of filtered columns with new jsonb value */
export type Files_Append_Input = {
metadata?: InputMaybe<Scalars['jsonb']>;
};
/** input type for inserting array relation for remote table "storage.files" */
export type Files_Arr_Rel_Insert_Input = {
data: Array<Files_Insert_Input>;
@@ -11987,6 +11981,7 @@ export type Files_Bool_Exp = {
etag?: InputMaybe<String_Comparison_Exp>;
id?: InputMaybe<Uuid_Comparison_Exp>;
isUploaded?: InputMaybe<Boolean_Comparison_Exp>;
metadata?: InputMaybe<Jsonb_Comparison_Exp>;
mimeType?: InputMaybe<String_Comparison_Exp>;
name?: InputMaybe<String_Comparison_Exp>;
size?: InputMaybe<Int_Comparison_Exp>;
@@ -12000,6 +11995,21 @@ export enum Files_Constraint {
FilesPkey = 'files_pkey'
}
/** delete the field or element with specified path (for JSON arrays, negative integers count from the end) */
export type Files_Delete_At_Path_Input = {
metadata?: InputMaybe<Array<Scalars['String']>>;
};
/** delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array */
export type Files_Delete_Elem_Input = {
metadata?: InputMaybe<Scalars['Int']>;
};
/** delete key/value pair or string element. key/value pairs are matched based on their key value */
export type Files_Delete_Key_Input = {
metadata?: InputMaybe<Scalars['String']>;
};
/** input type for incrementing numeric columns in table "storage.files" */
export type Files_Inc_Input = {
size?: InputMaybe<Scalars['Int']>;
@@ -12013,6 +12023,7 @@ export type Files_Insert_Input = {
etag?: InputMaybe<Scalars['String']>;
id?: InputMaybe<Scalars['uuid']>;
isUploaded?: InputMaybe<Scalars['Boolean']>;
metadata?: InputMaybe<Scalars['jsonb']>;
mimeType?: InputMaybe<Scalars['String']>;
name?: InputMaybe<Scalars['String']>;
size?: InputMaybe<Scalars['Int']>;
@@ -12083,6 +12094,13 @@ export type Files_Mutation_Response = {
returning: Array<Files>;
};
/** input type for inserting object relation for remote table "storage.files" */
export type Files_Obj_Rel_Insert_Input = {
data: Files_Insert_Input;
/** upsert condition */
on_conflict?: InputMaybe<Files_On_Conflict>;
};
/** on_conflict condition type for table "storage.files" */
export type Files_On_Conflict = {
constraint: Files_Constraint;
@@ -12098,6 +12116,7 @@ export type Files_Order_By = {
etag?: InputMaybe<Order_By>;
id?: InputMaybe<Order_By>;
isUploaded?: InputMaybe<Order_By>;
metadata?: InputMaybe<Order_By>;
mimeType?: InputMaybe<Order_By>;
name?: InputMaybe<Order_By>;
size?: InputMaybe<Order_By>;
@@ -12110,6 +12129,11 @@ export type Files_Pk_Columns_Input = {
id: Scalars['uuid'];
};
/** prepend existing jsonb value of filtered columns with new jsonb value */
export type Files_Prepend_Input = {
metadata?: InputMaybe<Scalars['jsonb']>;
};
/** select columns of table "storage.files" */
export enum Files_Select_Column {
/** column name */
@@ -12123,6 +12147,8 @@ export enum Files_Select_Column {
/** column name */
IsUploaded = 'isUploaded',
/** column name */
Metadata = 'metadata',
/** column name */
MimeType = 'mimeType',
/** column name */
Name = 'name',
@@ -12153,6 +12179,7 @@ export type Files_Set_Input = {
etag?: InputMaybe<Scalars['String']>;
id?: InputMaybe<Scalars['uuid']>;
isUploaded?: InputMaybe<Scalars['Boolean']>;
metadata?: InputMaybe<Scalars['jsonb']>;
mimeType?: InputMaybe<Scalars['String']>;
name?: InputMaybe<Scalars['String']>;
size?: InputMaybe<Scalars['Int']>;
@@ -12208,6 +12235,7 @@ export type Files_Stream_Cursor_Value_Input = {
etag?: InputMaybe<Scalars['String']>;
id?: InputMaybe<Scalars['uuid']>;
isUploaded?: InputMaybe<Scalars['Boolean']>;
metadata?: InputMaybe<Scalars['jsonb']>;
mimeType?: InputMaybe<Scalars['String']>;
name?: InputMaybe<Scalars['String']>;
size?: InputMaybe<Scalars['Int']>;
@@ -12239,6 +12267,8 @@ export enum Files_Update_Column {
/** column name */
IsUploaded = 'isUploaded',
/** column name */
Metadata = 'metadata',
/** column name */
MimeType = 'mimeType',
/** column name */
Name = 'name',
@@ -12251,8 +12281,18 @@ export enum Files_Update_Column {
}
export type Files_Updates = {
/** append existing jsonb value of filtered columns with new jsonb value */
_append?: InputMaybe<Files_Append_Input>;
/** delete the field or element with specified path (for JSON arrays, negative integers count from the end) */
_delete_at_path?: InputMaybe<Files_Delete_At_Path_Input>;
/** delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array */
_delete_elem?: InputMaybe<Files_Delete_Elem_Input>;
/** delete key/value pair or string element. key/value pairs are matched based on their key value */
_delete_key?: InputMaybe<Files_Delete_Key_Input>;
/** increments the numeric columns with given value of the filtered values */
_inc?: InputMaybe<Files_Inc_Input>;
/** prepend existing jsonb value of filtered columns with new jsonb value */
_prepend?: InputMaybe<Files_Prepend_Input>;
/** sets the columns of the filtered rows to the given values */
_set?: InputMaybe<Files_Set_Input>;
/** filter the rows which have to be updated */
@@ -13123,6 +13163,7 @@ export type Mutation_Root = {
billingDeleteOrganization: Scalars['Boolean'];
billingFinishSubscription: Scalars['Boolean'];
billingFixSubscriptionItems: Scalars['Boolean'];
billingFixSubscriptions: Scalars['Boolean'];
billingFullReportWorkflow: Scalars['Boolean'];
billingMigrateProjectToOrganization: Scalars['Boolean'];
billingPostOrganizationRequest: PostOrganizationRequestResponse;
@@ -13134,8 +13175,6 @@ export type Mutation_Root = {
billingUpdatePersistentVolume: Scalars['Boolean'];
billingUpdateReports: Scalars['Boolean'];
billingUploadReports: Scalars['Boolean'];
/** execute VOLATILE function "billing.reports_delete_older_than_days" which returns "billing.reports" */
billing_reports_delete_older_than_days: Array<Billing_Reports>;
changeDatabaseVersion: Scalars['Boolean'];
/** delete single row from the table: "announcements_read" */
deleteAnnouncementRead?: Maybe<Announcements_Read>;
@@ -13288,6 +13327,10 @@ export type Mutation_Root = {
deleteUser?: Maybe<Users>;
/** delete data from the table: "auth.users" */
deleteUsers?: Maybe<Users_Mutation_Response>;
/** delete single row from the table: "storage.virus" */
deleteVirus?: Maybe<Virus>;
/** delete data from the table: "storage.virus" */
deleteViruses?: Maybe<Virus_Mutation_Response>;
/** delete single row from the table: "workspaces" */
deleteWorkspace?: Maybe<Workspaces>;
/** delete single row from the table: "workspace_members" */
@@ -13352,7 +13395,6 @@ export type Mutation_Root = {
delete_regions?: Maybe<Regions_Mutation_Response>;
/** delete single row from the table: "regions" */
delete_regions_by_pk?: Maybe<Regions>;
encryptPersistentVolumes: Scalars['Boolean'];
/** insert a single row into the table: "announcements_read" */
insertAnnouncementRead?: Maybe<Announcements_Read>;
/** insert data into the table: "announcements_read" */
@@ -13504,6 +13546,10 @@ export type Mutation_Root = {
insertUser?: Maybe<Users>;
/** insert data into the table: "auth.users" */
insertUsers?: Maybe<Users_Mutation_Response>;
/** insert a single row into the table: "storage.virus" */
insertVirus?: Maybe<Virus>;
/** insert data into the table: "storage.virus" */
insertViruses?: Maybe<Virus_Mutation_Response>;
/** insert a single row into the table: "workspaces" */
insertWorkspace?: Maybe<Workspaces>;
/** insert a single row into the table: "workspace_members" */
@@ -13753,6 +13799,10 @@ export type Mutation_Root = {
updateUser?: Maybe<Users>;
/** update data of the table: "auth.users" */
updateUsers?: Maybe<Users_Mutation_Response>;
/** update single row of the table: "storage.virus" */
updateVirus?: Maybe<Virus>;
/** update data of the table: "storage.virus" */
updateViruses?: Maybe<Virus_Mutation_Response>;
/** update single row of the table: "workspaces" */
updateWorkspace?: Maybe<Workspaces>;
/** update single row of the table: "workspace_members" */
@@ -13897,6 +13947,8 @@ export type Mutation_Root = {
update_run_service_many?: Maybe<Array<Maybe<Run_Service_Mutation_Response>>>;
/** update multiples rows of table: "auth.users" */
update_users_many?: Maybe<Array<Maybe<Users_Mutation_Response>>>;
/** update multiples rows of table: "storage.virus" */
update_virus_many?: Maybe<Array<Maybe<Virus_Mutation_Response>>>;
/** update multiples rows of table: "workspace_member_invites" */
update_workspaceMemberInvites_many?: Maybe<Array<Maybe<WorkspaceMemberInvites_Mutation_Response>>>;
/** update multiples rows of table: "workspace_members" */
@@ -14003,17 +14055,6 @@ export type Mutation_RootBillingUpdatePersistentVolumeArgs = {
};
/** mutation root */
export type Mutation_RootBilling_Reports_Delete_Older_Than_DaysArgs = {
args: Billing_Reports_Delete_Older_Than_Days_Args;
distinct_on?: InputMaybe<Array<Billing_Reports_Select_Column>>;
limit?: InputMaybe<Scalars['Int']>;
offset?: InputMaybe<Scalars['Int']>;
order_by?: InputMaybe<Array<Billing_Reports_Order_By>>;
where?: InputMaybe<Billing_Reports_Bool_Exp>;
};
/** mutation root */
export type Mutation_RootChangeDatabaseVersionArgs = {
appID: Scalars['uuid'];
@@ -14486,6 +14527,18 @@ export type Mutation_RootDeleteUsersArgs = {
};
/** mutation root */
export type Mutation_RootDeleteVirusArgs = {
id: Scalars['uuid'];
};
/** mutation root */
export type Mutation_RootDeleteVirusesArgs = {
where: Virus_Bool_Exp;
};
/** mutation root */
export type Mutation_RootDeleteWorkspaceArgs = {
id: Scalars['uuid'];
@@ -14678,12 +14731,6 @@ export type Mutation_RootDelete_Regions_By_PkArgs = {
};
/** mutation root */
export type Mutation_RootEncryptPersistentVolumesArgs = {
appID: Scalars['uuid'];
};
/** mutation root */
export type Mutation_RootInsertAnnouncementReadArgs = {
object: Announcements_Read_Insert_Input;
@@ -15226,6 +15273,20 @@ export type Mutation_RootInsertUsersArgs = {
};
/** mutation root */
export type Mutation_RootInsertVirusArgs = {
object: Virus_Insert_Input;
on_conflict?: InputMaybe<Virus_On_Conflict>;
};
/** mutation root */
export type Mutation_RootInsertVirusesArgs = {
objects: Array<Virus_Insert_Input>;
on_conflict?: InputMaybe<Virus_On_Conflict>;
};
/** mutation root */
export type Mutation_RootInsertWorkspaceArgs = {
object: Workspaces_Insert_Input;
@@ -15898,7 +15959,12 @@ export type Mutation_RootUpdateFeatureFlagsArgs = {
/** mutation root */
export type Mutation_RootUpdateFileArgs = {
_append?: InputMaybe<Files_Append_Input>;
_delete_at_path?: InputMaybe<Files_Delete_At_Path_Input>;
_delete_elem?: InputMaybe<Files_Delete_Elem_Input>;
_delete_key?: InputMaybe<Files_Delete_Key_Input>;
_inc?: InputMaybe<Files_Inc_Input>;
_prepend?: InputMaybe<Files_Prepend_Input>;
_set?: InputMaybe<Files_Set_Input>;
pk_columns: Files_Pk_Columns_Input;
};
@@ -15906,7 +15972,12 @@ export type Mutation_RootUpdateFileArgs = {
/** mutation root */
export type Mutation_RootUpdateFilesArgs = {
_append?: InputMaybe<Files_Append_Input>;
_delete_at_path?: InputMaybe<Files_Delete_At_Path_Input>;
_delete_elem?: InputMaybe<Files_Delete_Elem_Input>;
_delete_key?: InputMaybe<Files_Delete_Key_Input>;
_inc?: InputMaybe<Files_Inc_Input>;
_prepend?: InputMaybe<Files_Prepend_Input>;
_set?: InputMaybe<Files_Set_Input>;
where: Files_Bool_Exp;
};
@@ -16212,6 +16283,30 @@ export type Mutation_RootUpdateUsersArgs = {
};
/** mutation root */
export type Mutation_RootUpdateVirusArgs = {
_append?: InputMaybe<Virus_Append_Input>;
_delete_at_path?: InputMaybe<Virus_Delete_At_Path_Input>;
_delete_elem?: InputMaybe<Virus_Delete_Elem_Input>;
_delete_key?: InputMaybe<Virus_Delete_Key_Input>;
_prepend?: InputMaybe<Virus_Prepend_Input>;
_set?: InputMaybe<Virus_Set_Input>;
pk_columns: Virus_Pk_Columns_Input;
};
/** mutation root */
export type Mutation_RootUpdateVirusesArgs = {
_append?: InputMaybe<Virus_Append_Input>;
_delete_at_path?: InputMaybe<Virus_Delete_At_Path_Input>;
_delete_elem?: InputMaybe<Virus_Delete_Elem_Input>;
_delete_key?: InputMaybe<Virus_Delete_Key_Input>;
_prepend?: InputMaybe<Virus_Prepend_Input>;
_set?: InputMaybe<Virus_Set_Input>;
where: Virus_Bool_Exp;
};
/** mutation root */
export type Mutation_RootUpdateWorkspaceArgs = {
_set?: InputMaybe<Workspaces_Set_Input>;
@@ -16682,6 +16777,12 @@ export type Mutation_RootUpdate_Users_ManyArgs = {
};
/** mutation root */
export type Mutation_RootUpdate_Virus_ManyArgs = {
updates: Array<Virus_Updates>;
};
/** mutation root */
export type Mutation_RootUpdate_WorkspaceMemberInvites_ManyArgs = {
updates: Array<WorkspaceMemberInvites_Updates>;
@@ -19850,6 +19951,12 @@ export type Query_Root = {
users: Array<Users>;
/** fetch aggregated fields from the table: "auth.users" */
usersAggregate: Users_Aggregate;
/** fetch data from the table: "storage.virus" using primary key columns */
virus?: Maybe<Virus>;
/** fetch data from the table: "storage.virus" */
viruses: Array<Virus>;
/** fetch aggregated fields from the table: "storage.virus" */
virusesAggregate: Virus_Aggregate;
/** fetch data from the table: "workspaces" using primary key columns */
workspace?: Maybe<Workspaces>;
/** fetch data from the table: "workspace_members" using primary key columns */
@@ -21204,6 +21311,29 @@ export type Query_RootUsersAggregateArgs = {
};
export type Query_RootVirusArgs = {
id: Scalars['uuid'];
};
export type Query_RootVirusesArgs = {
distinct_on?: InputMaybe<Array<Virus_Select_Column>>;
limit?: InputMaybe<Scalars['Int']>;
offset?: InputMaybe<Scalars['Int']>;
order_by?: InputMaybe<Array<Virus_Order_By>>;
where?: InputMaybe<Virus_Bool_Exp>;
};
export type Query_RootVirusesAggregateArgs = {
distinct_on?: InputMaybe<Array<Virus_Select_Column>>;
limit?: InputMaybe<Scalars['Int']>;
offset?: InputMaybe<Scalars['Int']>;
order_by?: InputMaybe<Array<Virus_Order_By>>;
where?: InputMaybe<Virus_Bool_Exp>;
};
export type Query_RootWorkspaceArgs = {
id: Scalars['uuid'];
};
@@ -22725,7 +22855,7 @@ export enum Software_Type_Constraint {
export enum Software_Type_Enum {
/** Hasura Auth */
Auth = 'Auth',
/** Graphite */
/** Nhost AI service */
Graphite = 'Graphite',
/** Hasura GraphQL Engine */
Hasura = 'Hasura',
@@ -23436,6 +23566,14 @@ export type Subscription_Root = {
usersAggregate: Users_Aggregate;
/** fetch data from the table in a streaming manner: "auth.users" */
users_stream: Array<Users>;
/** fetch data from the table: "storage.virus" using primary key columns */
virus?: Maybe<Virus>;
/** fetch data from the table in a streaming manner: "storage.virus" */
virus_stream: Array<Virus>;
/** fetch data from the table: "storage.virus" */
viruses: Array<Virus>;
/** fetch aggregated fields from the table: "storage.virus" */
virusesAggregate: Virus_Aggregate;
/** fetch data from the table: "workspaces" using primary key columns */
workspace?: Maybe<Workspaces>;
/** fetch data from the table: "workspace_members" using primary key columns */
@@ -24971,6 +25109,36 @@ export type Subscription_RootUsers_StreamArgs = {
};
export type Subscription_RootVirusArgs = {
id: Scalars['uuid'];
};
export type Subscription_RootVirus_StreamArgs = {
batch_size: Scalars['Int'];
cursor: Array<InputMaybe<Virus_Stream_Cursor_Input>>;
where?: InputMaybe<Virus_Bool_Exp>;
};
export type Subscription_RootVirusesArgs = {
distinct_on?: InputMaybe<Array<Virus_Select_Column>>;
limit?: InputMaybe<Scalars['Int']>;
offset?: InputMaybe<Scalars['Int']>;
order_by?: InputMaybe<Array<Virus_Order_By>>;
where?: InputMaybe<Virus_Bool_Exp>;
};
export type Subscription_RootVirusesAggregateArgs = {
distinct_on?: InputMaybe<Array<Virus_Select_Column>>;
limit?: InputMaybe<Scalars['Int']>;
offset?: InputMaybe<Scalars['Int']>;
order_by?: InputMaybe<Array<Virus_Order_By>>;
where?: InputMaybe<Virus_Bool_Exp>;
};
export type Subscription_RootWorkspaceArgs = {
id: Scalars['uuid'];
};
@@ -26083,6 +26251,244 @@ export type Uuid_Comparison_Exp = {
_nin?: InputMaybe<Array<Scalars['uuid']>>;
};
/** columns and relationships of "storage.virus" */
export type Virus = {
__typename?: 'virus';
createdAt: Scalars['timestamptz'];
/** An object relationship */
file: Files;
fileId: Scalars['uuid'];
filename: Scalars['String'];
id: Scalars['uuid'];
updatedAt: Scalars['timestamptz'];
userSession: Scalars['jsonb'];
virus: Scalars['String'];
};
/** columns and relationships of "storage.virus" */
export type VirusUserSessionArgs = {
path?: InputMaybe<Scalars['String']>;
};
/** aggregated selection of "storage.virus" */
export type Virus_Aggregate = {
__typename?: 'virus_aggregate';
aggregate?: Maybe<Virus_Aggregate_Fields>;
nodes: Array<Virus>;
};
/** aggregate fields of "storage.virus" */
export type Virus_Aggregate_Fields = {
__typename?: 'virus_aggregate_fields';
count: Scalars['Int'];
max?: Maybe<Virus_Max_Fields>;
min?: Maybe<Virus_Min_Fields>;
};
/** aggregate fields of "storage.virus" */
export type Virus_Aggregate_FieldsCountArgs = {
columns?: InputMaybe<Array<Virus_Select_Column>>;
distinct?: InputMaybe<Scalars['Boolean']>;
};
/** append existing jsonb value of filtered columns with new jsonb value */
export type Virus_Append_Input = {
userSession?: InputMaybe<Scalars['jsonb']>;
};
/** Boolean expression to filter rows from the table "storage.virus". All fields are combined with a logical 'AND'. */
export type Virus_Bool_Exp = {
_and?: InputMaybe<Array<Virus_Bool_Exp>>;
_not?: InputMaybe<Virus_Bool_Exp>;
_or?: InputMaybe<Array<Virus_Bool_Exp>>;
createdAt?: InputMaybe<Timestamptz_Comparison_Exp>;
file?: InputMaybe<Files_Bool_Exp>;
fileId?: InputMaybe<Uuid_Comparison_Exp>;
filename?: InputMaybe<String_Comparison_Exp>;
id?: InputMaybe<Uuid_Comparison_Exp>;
updatedAt?: InputMaybe<Timestamptz_Comparison_Exp>;
userSession?: InputMaybe<Jsonb_Comparison_Exp>;
virus?: InputMaybe<String_Comparison_Exp>;
};
/** unique or primary key constraints on table "storage.virus" */
export enum Virus_Constraint {
/** unique or primary key constraint on columns "id" */
VirusPkey = 'virus_pkey'
}
/** delete the field or element with specified path (for JSON arrays, negative integers count from the end) */
export type Virus_Delete_At_Path_Input = {
userSession?: InputMaybe<Array<Scalars['String']>>;
};
/** delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array */
export type Virus_Delete_Elem_Input = {
userSession?: InputMaybe<Scalars['Int']>;
};
/** delete key/value pair or string element. key/value pairs are matched based on their key value */
export type Virus_Delete_Key_Input = {
userSession?: InputMaybe<Scalars['String']>;
};
/** input type for inserting data into table "storage.virus" */
export type Virus_Insert_Input = {
createdAt?: InputMaybe<Scalars['timestamptz']>;
file?: InputMaybe<Files_Obj_Rel_Insert_Input>;
fileId?: InputMaybe<Scalars['uuid']>;
filename?: InputMaybe<Scalars['String']>;
id?: InputMaybe<Scalars['uuid']>;
updatedAt?: InputMaybe<Scalars['timestamptz']>;
userSession?: InputMaybe<Scalars['jsonb']>;
virus?: InputMaybe<Scalars['String']>;
};
/** aggregate max on columns */
export type Virus_Max_Fields = {
__typename?: 'virus_max_fields';
createdAt?: Maybe<Scalars['timestamptz']>;
fileId?: Maybe<Scalars['uuid']>;
filename?: Maybe<Scalars['String']>;
id?: Maybe<Scalars['uuid']>;
updatedAt?: Maybe<Scalars['timestamptz']>;
virus?: Maybe<Scalars['String']>;
};
/** aggregate min on columns */
export type Virus_Min_Fields = {
__typename?: 'virus_min_fields';
createdAt?: Maybe<Scalars['timestamptz']>;
fileId?: Maybe<Scalars['uuid']>;
filename?: Maybe<Scalars['String']>;
id?: Maybe<Scalars['uuid']>;
updatedAt?: Maybe<Scalars['timestamptz']>;
virus?: Maybe<Scalars['String']>;
};
/** response of any mutation on the table "storage.virus" */
export type Virus_Mutation_Response = {
__typename?: 'virus_mutation_response';
/** number of rows affected by the mutation */
affected_rows: Scalars['Int'];
/** data from the rows affected by the mutation */
returning: Array<Virus>;
};
/** on_conflict condition type for table "storage.virus" */
export type Virus_On_Conflict = {
constraint: Virus_Constraint;
update_columns?: Array<Virus_Update_Column>;
where?: InputMaybe<Virus_Bool_Exp>;
};
/** Ordering options when selecting data from "storage.virus". */
export type Virus_Order_By = {
createdAt?: InputMaybe<Order_By>;
file?: InputMaybe<Files_Order_By>;
fileId?: InputMaybe<Order_By>;
filename?: InputMaybe<Order_By>;
id?: InputMaybe<Order_By>;
updatedAt?: InputMaybe<Order_By>;
userSession?: InputMaybe<Order_By>;
virus?: InputMaybe<Order_By>;
};
/** primary key columns input for table: storage.virus */
export type Virus_Pk_Columns_Input = {
id: Scalars['uuid'];
};
/** prepend existing jsonb value of filtered columns with new jsonb value */
export type Virus_Prepend_Input = {
userSession?: InputMaybe<Scalars['jsonb']>;
};
/** select columns of table "storage.virus" */
export enum Virus_Select_Column {
/** column name */
CreatedAt = 'createdAt',
/** column name */
FileId = 'fileId',
/** column name */
Filename = 'filename',
/** column name */
Id = 'id',
/** column name */
UpdatedAt = 'updatedAt',
/** column name */
UserSession = 'userSession',
/** column name */
Virus = 'virus'
}
/** input type for updating data in table "storage.virus" */
export type Virus_Set_Input = {
createdAt?: InputMaybe<Scalars['timestamptz']>;
fileId?: InputMaybe<Scalars['uuid']>;
filename?: InputMaybe<Scalars['String']>;
id?: InputMaybe<Scalars['uuid']>;
updatedAt?: InputMaybe<Scalars['timestamptz']>;
userSession?: InputMaybe<Scalars['jsonb']>;
virus?: InputMaybe<Scalars['String']>;
};
/** Streaming cursor of the table "virus" */
export type Virus_Stream_Cursor_Input = {
/** Stream column input with initial value */
initial_value: Virus_Stream_Cursor_Value_Input;
/** cursor ordering */
ordering?: InputMaybe<Cursor_Ordering>;
};
/** Initial value of the column from where the streaming should start */
export type Virus_Stream_Cursor_Value_Input = {
createdAt?: InputMaybe<Scalars['timestamptz']>;
fileId?: InputMaybe<Scalars['uuid']>;
filename?: InputMaybe<Scalars['String']>;
id?: InputMaybe<Scalars['uuid']>;
updatedAt?: InputMaybe<Scalars['timestamptz']>;
userSession?: InputMaybe<Scalars['jsonb']>;
virus?: InputMaybe<Scalars['String']>;
};
/** update columns of table "storage.virus" */
export enum Virus_Update_Column {
/** column name */
CreatedAt = 'createdAt',
/** column name */
FileId = 'fileId',
/** column name */
Filename = 'filename',
/** column name */
Id = 'id',
/** column name */
UpdatedAt = 'updatedAt',
/** column name */
UserSession = 'userSession',
/** column name */
Virus = 'virus'
}
export type Virus_Updates = {
/** append existing jsonb value of filtered columns with new jsonb value */
_append?: InputMaybe<Virus_Append_Input>;
/** delete the field or element with specified path (for JSON arrays, negative integers count from the end) */
_delete_at_path?: InputMaybe<Virus_Delete_At_Path_Input>;
/** delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array */
_delete_elem?: InputMaybe<Virus_Delete_Elem_Input>;
/** delete key/value pair or string element. key/value pairs are matched based on their key value */
_delete_key?: InputMaybe<Virus_Delete_Key_Input>;
/** prepend existing jsonb value of filtered columns with new jsonb value */
_prepend?: InputMaybe<Virus_Prepend_Input>;
/** sets the columns of the filtered rows to the given values */
_set?: InputMaybe<Virus_Set_Input>;
/** filter the rows which have to be updated */
where: Virus_Bool_Exp;
};
/** columns and relationships of "workspace_member_invites" */
export type WorkspaceMemberInvites = {
__typename?: 'workspaceMemberInvites';
@@ -27869,6 +28275,13 @@ export type GetProjectQueryVariables = Exact<{
export type GetProjectQuery = { __typename?: 'query_root', apps: Array<{ __typename?: 'apps', id: any, slug: string, name: string, repositoryProductionBranch: string, subdomain: string, createdAt: any, desiredState: number, nhostBaseFolder: string, config?: { __typename?: 'ConfigConfig', observability: { __typename?: 'ConfigObservability', grafana: { __typename?: 'ConfigGrafana', adminPassword: string } }, hasura: { __typename?: 'ConfigHasura', adminSecret: string, settings?: { __typename?: 'ConfigHasuraSettings', enableConsole?: boolean | null } | null }, ai?: { __typename?: 'ConfigAI', version?: string | null } | null } | 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, name: string, domain: string, city: string }, legacyPlan?: { __typename?: 'plans', id: any, name: string, price: number, isFree: boolean, featureMaxDbSize: number } | null, 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 }>, creator?: { __typename?: 'users', id: any, email?: any | null, displayName: string } | null }> };
export type GetProjectStateQueryVariables = Exact<{
subdomain: Scalars['String'];
}>;
export type GetProjectStateQuery = { __typename?: 'query_root', apps: Array<{ __typename?: 'apps', id: any, name: string, subdomain: string, createdAt: any, desiredState: number, region: { __typename?: 'regions', id: any, countryCode: string, name: string, domain: string, city: string }, appStates: Array<{ __typename?: 'appStateHistory', id: any, appId: any, message?: string | null, stateId: number, createdAt: any }> }> };
export type GetProjectsQueryVariables = Exact<{
orgSlug: Scalars['String'];
}>;
@@ -32537,6 +32950,62 @@ export type GetProjectQueryResult = Apollo.QueryResult<GetProjectQuery, GetProje
export function refetchGetProjectQuery(variables: GetProjectQueryVariables) {
return { query: GetProjectDocument, variables: variables }
}
export const GetProjectStateDocument = gql`
query getProjectState($subdomain: String!) {
apps(where: {subdomain: {_eq: $subdomain}}) {
id
name
subdomain
region {
id
countryCode
name
domain
city
}
createdAt
desiredState
appStates(order_by: {createdAt: desc}, limit: 1) {
id
appId
message
stateId
createdAt
}
}
}
`;
/**
* __useGetProjectStateQuery__
*
* To run a query within a React component, call `useGetProjectStateQuery` and pass it any options that fit your needs.
* When your component renders, `useGetProjectStateQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useGetProjectStateQuery({
* variables: {
* subdomain: // value for 'subdomain'
* },
* });
*/
export function useGetProjectStateQuery(baseOptions: Apollo.QueryHookOptions<GetProjectStateQuery, GetProjectStateQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<GetProjectStateQuery, GetProjectStateQueryVariables>(GetProjectStateDocument, options);
}
export function useGetProjectStateLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetProjectStateQuery, GetProjectStateQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<GetProjectStateQuery, GetProjectStateQueryVariables>(GetProjectStateDocument, options);
}
export type GetProjectStateQueryHookResult = ReturnType<typeof useGetProjectStateQuery>;
export type GetProjectStateLazyQueryHookResult = ReturnType<typeof useGetProjectStateLazyQuery>;
export type GetProjectStateQueryResult = Apollo.QueryResult<GetProjectStateQuery, GetProjectStateQueryVariables>;
export function refetchGetProjectStateQuery(variables: GetProjectStateQueryVariables) {
return { query: GetProjectStateDocument, variables: variables }
}
export const GetProjectsDocument = gql`
query getProjects($orgSlug: String!) {
apps(where: {organization: {slug: {_eq: $orgSlug}}}) {

View File

@@ -5,7 +5,7 @@
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"moduleResolution": "node",
"skipLibCheck": true,
"sourceMap": true,
"strict": true

View File

@@ -13,10 +13,10 @@
"lint": "eslint ."
},
"devDependencies": {
"@nhost/nhost-js": "^3.1.5",
"@playwright/test": "^1.41.0",
"@sveltejs/adapter-auto": "^2.1.1",
"@sveltejs/kit": "^1.30.4",
"@sveltejs/adapter-auto": "^3.3.1",
"@sveltejs/kit": "^2.11.1",
"@sveltejs/vite-plugin-svelte": "^5.0.2",
"@types/js-cookie": "^3.0.6",
"autoprefixer": "^10.4.19",
"eslint": "^8.57.0",
@@ -25,15 +25,16 @@
"postcss": "^8.4.38",
"prettier": "^2.8.8",
"prettier-plugin-svelte": "^2.10.1",
"svelte": "^4.2.19",
"svelte": "^5.14.0",
"svelte-check": "^3.6.8",
"tailwindcss": "^3.4.3",
"typescript": "^5.4.3",
"vite": "^5.4.6",
"vite": "^6.0.3",
"vitest": "^0.25.8"
},
"type": "module",
"dependencies": {
"@nhost/nhost-js": "^3.2.1",
"graphql": "16.8.1",
"graphql-tag": "^2.12.6",
"js-cookie": "^3.0.5",

View File

@@ -1,205 +0,0 @@
lockfileVersion: '6.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
dependencies:
graphql:
specifier: 16.8.1
version: 16.8.1
devDependencies:
'@nhost/nhost-js':
specifier: ^3.1.5
version: 3.1.5(graphql@16.8.1)
packages:
/@graphql-typed-document-node/core@3.2.0(graphql@16.8.1):
resolution: {integrity: sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==}
peerDependencies:
graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0
dependencies:
graphql: 16.8.1
dev: true
/@nhost/graphql-js@0.3.0(graphql@16.8.1):
resolution: {integrity: sha512-CVYq6wx0VbaYdpUBmfNO/6mZatHB5+YBCqFjWyxhpN1nzHCHEO6rgdL7j0qk31OFE6XAX0z7AQZSXg1Pn63GUw==}
peerDependencies:
graphql: ^14.0.0 || ^15.0.0 || ^16.0.0
dependencies:
'@graphql-typed-document-node/core': 3.2.0(graphql@16.8.1)
base-64: 1.0.0
graphql: 16.8.1
isomorphic-unfetch: 3.1.0
jwt-decode: 4.0.0
transitivePeerDependencies:
- encoding
dev: true
/@nhost/hasura-auth-js@2.5.2:
resolution: {integrity: sha512-3O4fIJ8xbdCdKGR/1o5jMczxrLLQ2g6BNp6J9m83COVqg9ka5IXoFuM6pgbX5W7WPe9nIQntvHsfeDynXS+/fg==}
dependencies:
'@simplewebauthn/browser': 9.0.1
fetch-ponyfill: 7.1.0
js-cookie: 3.0.5
jwt-decode: 4.0.0
xstate: 4.38.3
transitivePeerDependencies:
- encoding
dev: true
/@nhost/hasura-storage-js@2.5.1:
resolution: {integrity: sha512-I3rOSa095lcR9BUmNw7dOoXLPWL39WOcrb0paUBFX4h3ltR92ILEHTZ38hN6bZSv157ZdqkIFNL/M2G45SSf7g==}
dependencies:
fetch-ponyfill: 7.1.0
form-data: 4.0.0
graphql: 16.8.1
xstate: 4.38.3
transitivePeerDependencies:
- encoding
dev: true
/@nhost/nhost-js@3.1.5(graphql@16.8.1):
resolution: {integrity: sha512-SgDGQ0APiRPc6RB2Cl1EcvQUsmWFDx32JmgqYBgLKKV9+PBDKc2GJ4GHECbxQi3RoIMXeJ777XJTEK7mGgNL+A==}
peerDependencies:
graphql: ^14.0.0 || ^15.0.0 || ^16.0.0
dependencies:
'@nhost/graphql-js': 0.3.0(graphql@16.8.1)
'@nhost/hasura-auth-js': 2.5.2
'@nhost/hasura-storage-js': 2.5.1
graphql: 16.8.1
isomorphic-unfetch: 3.1.0
transitivePeerDependencies:
- encoding
dev: true
/@simplewebauthn/browser@9.0.1:
resolution: {integrity: sha512-wD2WpbkaEP4170s13/HUxPcAV5y4ZXaKo1TfNklS5zDefPinIgXOpgz1kpEvobAsaLPa2KeH7AKKX/od1mrBJw==}
dependencies:
'@simplewebauthn/types': 9.0.1
dev: true
/@simplewebauthn/types@9.0.1:
resolution: {integrity: sha512-tGSRP1QvsAvsJmnOlRQyw/mvK9gnPtjEc5fg2+m8n+QUa+D7rvrKkOYyfpy42GTs90X3RDOnqJgfHt+qO67/+w==}
dev: true
/asynckit@0.4.0:
resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
dev: true
/base-64@1.0.0:
resolution: {integrity: sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg==}
dev: true
/combined-stream@1.0.8:
resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
engines: {node: '>= 0.8'}
dependencies:
delayed-stream: 1.0.0
dev: true
/delayed-stream@1.0.0:
resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
engines: {node: '>=0.4.0'}
dev: true
/fetch-ponyfill@7.1.0:
resolution: {integrity: sha512-FhbbL55dj/qdVO3YNK7ZEkshvj3eQ7EuIGV2I6ic/2YiocvyWv+7jg2s4AyS0wdRU75s3tA8ZxI/xPigb0v5Aw==}
dependencies:
node-fetch: 2.6.13
transitivePeerDependencies:
- encoding
dev: true
/form-data@4.0.0:
resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==}
engines: {node: '>= 6'}
dependencies:
asynckit: 0.4.0
combined-stream: 1.0.8
mime-types: 2.1.35
dev: true
/graphql@16.8.1:
resolution: {integrity: sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==}
engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0}
/isomorphic-unfetch@3.1.0:
resolution: {integrity: sha512-geDJjpoZ8N0kWexiwkX8F9NkTsXhetLPVbZFQ+JTW239QNOwvB0gniuR1Wc6f0AMTn7/mFGyXvHTifrCp/GH8Q==}
dependencies:
node-fetch: 2.7.0
unfetch: 4.2.0
transitivePeerDependencies:
- encoding
dev: true
/js-cookie@3.0.5:
resolution: {integrity: sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw==}
engines: {node: '>=14'}
dev: true
/jwt-decode@4.0.0:
resolution: {integrity: sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==}
engines: {node: '>=18'}
dev: true
/mime-db@1.52.0:
resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}
engines: {node: '>= 0.6'}
dev: true
/mime-types@2.1.35:
resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}
engines: {node: '>= 0.6'}
dependencies:
mime-db: 1.52.0
dev: true
/node-fetch@2.6.13:
resolution: {integrity: sha512-StxNAxh15zr77QvvkmveSQ8uCQ4+v5FkvNTj0OESmiHu+VRi/gXArXtkWMElOsOUNLtUEvI4yS+rdtOHZTwlQA==}
engines: {node: 4.x || >=6.0.0}
peerDependencies:
encoding: ^0.1.0
peerDependenciesMeta:
encoding:
optional: true
dependencies:
whatwg-url: 5.0.0
dev: true
/node-fetch@2.7.0:
resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==}
engines: {node: 4.x || >=6.0.0}
peerDependencies:
encoding: ^0.1.0
peerDependenciesMeta:
encoding:
optional: true
dependencies:
whatwg-url: 5.0.0
dev: true
/tr46@0.0.3:
resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
dev: true
/unfetch@4.2.0:
resolution: {integrity: sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA==}
dev: true
/webidl-conversions@3.0.1:
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
dev: true
/whatwg-url@5.0.0:
resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}
dependencies:
tr46: 0.0.3
webidl-conversions: 3.0.1
dev: true
/xstate@4.38.3:
resolution: {integrity: sha512-SH7nAaaPQx57dx6qvfcIgqKRXIh4L0A1iYEqim4s1u7c9VoCgzZc+63FY90AKU4ZzOC2cfJzTnpO4zK7fCUzzw==}
dev: true

View File

@@ -3,7 +3,18 @@ import { defineConfig } from 'vite'
export default defineConfig({
plugins: [sveltekit()],
optimizeDeps: {
include: ['@nhost/nhos-js']
},
build: {
commonjsOptions: {
include: [/@nhost\/nhos-js/, /node_modules/]
}
},
server: {
port: 3000
},
resolve: {
preserveSymlinks: false
}
})

View File

@@ -18,20 +18,15 @@ test('should be able to change email', async ({ page, browser }) => {
await newPage.getByPlaceholder(/new email/i).fill(newEmail)
// await newPage.locator('h1:has-text("Change email") + div button:has-text("Change")').click()
await newPage
.locator('div')
.filter({ hasText: /^Change emailChange$/ })
.getByRole('button')
.click()
// await expect(
// newPage.getByText(/please check your inbox and follow the link to confirm the email change./i)
// ).toBeVisible()
await expect(newPage.getByRole('status')).toContainText(
'Please check your inbox and follow the link to confirm the email change.'
)
await expect(
newPage.getByText('Please check your inbox and follow the link to confirm the email change.')
).toBeVisible()
await newPage.getByRole('link', { name: /sign out/i }).click()
@@ -45,7 +40,6 @@ test('should be able to change email', async ({ page, browser }) => {
requestType: 'email-confirm-change'
})
// await expect(updatedEmailPage.getByText(/profile page/i)).toBeVisible()
await expect(updatedEmailPage.getByRole('heading', { name: /profile/i })).toBeVisible()
})
@@ -64,7 +58,6 @@ test('should not accept an invalid email', async ({ page }) => {
const newEmail = faker.random.alphaNumeric()
await newPage.getByPlaceholder(/new email/i).fill(newEmail)
// await newPage.locator('h1:has-text("Change email") + div button:has-text("Change")').click()
await newPage
.locator('div')

View File

@@ -30,7 +30,6 @@
"@vue/test-utils": "^2.4.5",
"eslint": "^8.57.0",
"jsdom": "^19.0.0",
"pnpm": "^7.33.7",
"typescript": "^4.9.5",
"unocss": "^0.33.5",
"unplugin-auto-import": "^0.17.5",

View File

@@ -20,7 +20,8 @@
"build:dashboard": "turbo run build --filter=@nhost/dashboard",
"build:docs": "turbo run build --filter=@nhost/docs",
"build:all": "turbo run build --include-dependencies",
"build:nextjs-server-components": "turbo run build --filter=@nhost-examples/nextjs-server-components",
"build:@nhost-examples/nextjs-server-components": "turbo run build --filter=@nhost-examples/nextjs-server-components",
"build:@nhost-examples/sveltekit": "turbo run build --filter=@nhost-examples/sveltekit",
"dev": "turbo run dev --filter=!@nhost/dashboard --filter=!@nhost/docs --filter=!@nhost-examples/* --filter=!@nhost/docgen --no-deps --include-dependencies",
"clean:all": "pnpm clean && rm -rf ./{{packages,examples/**,templates/**}/*,docs,dashboard}/{.nhost,node_modules} node_modules",
"clean": "rm -rf ./{{packages,examples/**}/*,docs,dashboard}/{dist,umd,.next,.turbo,coverage}",
@@ -91,10 +92,9 @@
"resolutions": {
"graphql": "16.8.1"
},
"packageManager": "pnpm@8.10.5",
"packageManager": "pnpm@9.15.0",
"engines": {
"node": ">=18 <19",
"pnpm": ">=8.0.0"
"node": ">=20"
},
"eslintConfig": {
"extends": "./config/.eslintrc.js"

View File

@@ -1,4 +1,7 @@
{
"extends": "../../config/tsconfig.base.json",
"include": ["src"]
"include": ["src"],
"compilerOptions": {
"types": [],
}
}

41683
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -11,6 +11,11 @@
"outputs": ["dist/**"],
"env": ["VITE_NHOST_SUBDOMAIN", "VITE_NHOST_REGION"]
},
"@nhost-examples/sveltekit#build": {
"dependsOn": ["^build"],
"outputs": [".svelte-kit/**", ".vercel/**"],
"env": ["PUBLIC_NHOST_SUBDOMAIN", "PUBLIC_NHOST_REGION"]
},
"@nhost-examples/vue-apollo#build": {
"dependsOn": ["^build"],
"outputs": ["dist/**"],