Compare commits
44 Commits
@nhost/das
...
@nhost/rea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99fcc36250 | ||
|
|
7e4a756cfe | ||
|
|
5bf61583e0 | ||
|
|
7eac17a1cb | ||
|
|
a41aeeb9ef | ||
|
|
e33df513ff | ||
|
|
323fd5cbe3 | ||
|
|
ffb3c426d3 | ||
|
|
889ee6589e | ||
|
|
5223ee9353 | ||
|
|
c8c5ace7cc | ||
|
|
c6a4c28579 | ||
|
|
850a049ca2 | ||
|
|
eff3f0aefd | ||
|
|
2b1338f716 | ||
|
|
2b58c60747 | ||
|
|
1b2e3fbd1d | ||
|
|
6f4fdcf73f | ||
|
|
cb529dc60c | ||
|
|
68a449dbfc | ||
|
|
7d0c6d083a | ||
|
|
1353477da1 | ||
|
|
549c7cb7eb | ||
|
|
e131c12d5d | ||
|
|
8bb097c9a7 | ||
|
|
ea31e64a71 | ||
|
|
369b931689 | ||
|
|
e1ec5c1be2 | ||
|
|
9822a160d4 | ||
|
|
7c67a2c437 | ||
|
|
8e8884f4e1 | ||
|
|
9923be41ce | ||
|
|
bd6b55868a | ||
|
|
cb7c8c6398 | ||
|
|
4bf40995b5 | ||
|
|
ab5f704280 | ||
|
|
7e0e4d05aa | ||
|
|
0954a44f84 | ||
|
|
5a91c477f0 | ||
|
|
66f73d06a8 | ||
|
|
35d52aab87 | ||
|
|
832210d8ad | ||
|
|
6999562b59 | ||
|
|
7d577a68b7 |
2
.github/workflows/changesets.yaml
vendored
2
.github/workflows/changesets.yaml
vendored
@@ -98,7 +98,7 @@ jobs:
|
|||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
- name: Build and push to Docker Hub
|
- name: Build and push to Docker Hub
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v4
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
|||||||
@@ -20,7 +20,9 @@ export default defineConfig({
|
|||||||
exclude: ['**/*.spec.ts', '**/*.test.ts', '**/tests/**'],
|
exclude: ['**/*.spec.ts', '**/*.test.ts', '**/tests/**'],
|
||||||
entryRoot: 'src',
|
entryRoot: 'src',
|
||||||
// Was defaulting to true until version 1.7
|
// Was defaulting to true until version 1.7
|
||||||
skipDiagnostics: true
|
skipDiagnostics: true,
|
||||||
|
// Was defaulting to true until version 2.0
|
||||||
|
copyDtsFiles: true
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
test: {
|
test: {
|
||||||
|
|||||||
@@ -1,5 +1,29 @@
|
|||||||
# @nhost/dashboard
|
# @nhost/dashboard
|
||||||
|
|
||||||
|
## 0.12.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 2b1338f7: chore(dashboard): bump `turbo` to 1.8.3
|
||||||
|
- 5223ee93: fix(dashboard): show correct deployment status on the main page
|
||||||
|
- 850a049c: chore(deps): update docker/build-push-action action to v4
|
||||||
|
- Updated dependencies [850a049c]
|
||||||
|
- @nhost/nextjs@1.13.13
|
||||||
|
- @nhost/react-apollo@5.0.8
|
||||||
|
|
||||||
|
## 0.12.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 4bf40995: chore(deps): bump `typescript` to `4.9.5`
|
||||||
|
- 8bb097c9: chore(deps): bump `vitest`
|
||||||
|
- 35d52aab: chore(deps): replace `cross-fetch` with `isomorphic-unfetch`
|
||||||
|
- Updated dependencies [4bf40995]
|
||||||
|
- Updated dependencies [8bb097c9]
|
||||||
|
- Updated dependencies [35d52aab]
|
||||||
|
- @nhost/react-apollo@5.0.7
|
||||||
|
- @nhost/nextjs@1.13.12
|
||||||
|
|
||||||
## 0.12.1
|
## 0.12.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ RUN apk add --no-cache libc6-compat
|
|||||||
RUN apk update
|
RUN apk update
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN yarn global add turbo@1.6.3
|
RUN yarn global add turbo@1.8.3
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN turbo prune --scope="@nhost/dashboard" --docker
|
RUN turbo prune --scope="@nhost/dashboard" --docker
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/dashboard",
|
"name": "@nhost/dashboard",
|
||||||
"version": "0.12.1",
|
"version": "0.12.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"preinstall": "npx only-allow pnpm",
|
"preinstall": "npx only-allow pnpm",
|
||||||
@@ -46,7 +46,6 @@
|
|||||||
"analytics-node": "^6.2.0",
|
"analytics-node": "^6.2.0",
|
||||||
"bcryptjs": "^2.4.3",
|
"bcryptjs": "^2.4.3",
|
||||||
"clsx": "^1.2.1",
|
"clsx": "^1.2.1",
|
||||||
"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.2.0",
|
"graphiql": "^2.2.0",
|
||||||
@@ -112,11 +111,12 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^5.43.0",
|
"@typescript-eslint/eslint-plugin": "^5.43.0",
|
||||||
"@typescript-eslint/parser": "^5.43.0",
|
"@typescript-eslint/parser": "^5.43.0",
|
||||||
"@vitejs/plugin-react": "^3.0.0",
|
"@vitejs/plugin-react": "^3.0.0",
|
||||||
"@vitest/coverage-c8": "^0.27.0",
|
"@vitest/coverage-c8": "^0.29.0",
|
||||||
"autoprefixer": "^10.4.13",
|
"autoprefixer": "^10.4.13",
|
||||||
"babel-loader": "^8.3.0",
|
"babel-loader": "^8.3.0",
|
||||||
"babel-plugin-transform-remove-console": "^6.9.4",
|
"babel-plugin-transform-remove-console": "^6.9.4",
|
||||||
"csstype": "^3.0.10",
|
"csstype": "^3.0.10",
|
||||||
|
"encoding": "^0.1.13",
|
||||||
"eslint": "^8.28.0",
|
"eslint": "^8.28.0",
|
||||||
"eslint-config-airbnb": "19.0.4",
|
"eslint-config-airbnb": "19.0.4",
|
||||||
"eslint-config-airbnb-typescript": "^17.0.0",
|
"eslint-config-airbnb-typescript": "^17.0.0",
|
||||||
@@ -130,6 +130,7 @@
|
|||||||
"lint-staged": ">=13",
|
"lint-staged": ">=13",
|
||||||
"msw": "^1.0.1",
|
"msw": "^1.0.1",
|
||||||
"msw-storybook-addon": "^1.6.3",
|
"msw-storybook-addon": "^1.6.3",
|
||||||
|
"node-fetch": "^3.3.0",
|
||||||
"postcss": "^8.4.19",
|
"postcss": "^8.4.19",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
"prettier-plugin-organize-imports": "^3.2.0",
|
"prettier-plugin-organize-imports": "^3.2.0",
|
||||||
@@ -140,10 +141,9 @@
|
|||||||
"tailwindcss": "^3.1.2",
|
"tailwindcss": "^3.1.2",
|
||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
"tsconfig-paths-webpack-plugin": "^4.0.0",
|
"tsconfig-paths-webpack-plugin": "^4.0.0",
|
||||||
"typescript": "^4.8.4",
|
|
||||||
"vite": "^4.0.2",
|
"vite": "^4.0.2",
|
||||||
"vite-tsconfig-paths": "^4.0.3",
|
"vite-tsconfig-paths": "^4.0.3",
|
||||||
"vitest": "^0.27.0",
|
"vitest": "^0.29.0",
|
||||||
"webpack": "^5.75.0"
|
"webpack": "^5.75.0"
|
||||||
},
|
},
|
||||||
"browserslist": {
|
"browserslist": {
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
import { useDeleteApplicationMutation } from '@/generated/graphql';
|
import {
|
||||||
|
GetOneUserDocument,
|
||||||
|
useDeleteApplicationMutation,
|
||||||
|
} from '@/generated/graphql';
|
||||||
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
|
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
|
||||||
import Button from '@/ui/v2/Button';
|
import Button from '@/ui/v2/Button';
|
||||||
import ArrowRightIcon from '@/ui/v2/icons/ArrowRightIcon';
|
import ArrowRightIcon from '@/ui/v2/icons/ArrowRightIcon';
|
||||||
@@ -12,7 +15,9 @@ import { useRouter } from 'next/router';
|
|||||||
|
|
||||||
export default function ApplicationInfo() {
|
export default function ApplicationInfo() {
|
||||||
const { currentApplication } = useCurrentWorkspaceAndApplication();
|
const { currentApplication } = useCurrentWorkspaceAndApplication();
|
||||||
const [deleteApplication, { client }] = useDeleteApplicationMutation();
|
const [deleteApplication, { client }] = useDeleteApplicationMutation({
|
||||||
|
refetchQueries: [GetOneUserDocument],
|
||||||
|
});
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
async function handleClickRemove() {
|
async function handleClickRemove() {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
|
import DeploymentStatusMessage from '@/components/deployments/DeploymentStatusMessage';
|
||||||
import { FindOldApps } from '@/components/home';
|
import { FindOldApps } from '@/components/home';
|
||||||
import type { UserData } from '@/hooks/useGetAllUserWorkspacesAndApplications';
|
import type { UserData } from '@/hooks/useGetAllUserWorkspacesAndApplications';
|
||||||
import type { ApplicationState } from '@/types/application';
|
import type { ApplicationState } from '@/types/application';
|
||||||
import { ApplicationStatus } from '@/types/application';
|
import { ApplicationStatus } from '@/types/application';
|
||||||
import { Avatar } from '@/ui/Avatar';
|
|
||||||
import StateBadge from '@/ui/StateBadge';
|
import StateBadge from '@/ui/StateBadge';
|
||||||
import type { DeploymentStatus } from '@/ui/StatusCircle';
|
import type { DeploymentStatus } from '@/ui/StatusCircle';
|
||||||
import { StatusCircle } from '@/ui/StatusCircle';
|
import { StatusCircle } from '@/ui/StatusCircle';
|
||||||
@@ -10,59 +10,11 @@ import Divider from '@/ui/v2/Divider';
|
|||||||
import Link from '@/ui/v2/Link';
|
import Link from '@/ui/v2/Link';
|
||||||
import List from '@/ui/v2/List';
|
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 { getApplicationStatusString } from '@/utils/helpers';
|
import { getApplicationStatusString } from '@/utils/helpers';
|
||||||
import { formatDistance } from 'date-fns';
|
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
import NavLink from 'next/link';
|
import NavLink from 'next/link';
|
||||||
import { Fragment } from 'react';
|
import { Fragment } from 'react';
|
||||||
|
|
||||||
function ApplicationCreatedAt({ createdAt }: any) {
|
|
||||||
return (
|
|
||||||
<Text component="span" className="text-sm">
|
|
||||||
created{' '}
|
|
||||||
{formatDistance(new Date(createdAt), new Date(), {
|
|
||||||
addSuffix: true,
|
|
||||||
})}
|
|
||||||
</Text>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function LastSuccessfulDeployment({ deployment }: any) {
|
|
||||||
return (
|
|
||||||
<span className="flex flex-row">
|
|
||||||
<Avatar
|
|
||||||
component="span"
|
|
||||||
name={deployment.commitUserName}
|
|
||||||
avatarUrl={deployment.commitUserAvatarUrl}
|
|
||||||
className="mr-1 h-4 w-4 self-center"
|
|
||||||
/>
|
|
||||||
<Text component="span" className="self-center text-sm">
|
|
||||||
{deployment.commitUserName} deployed{' '}
|
|
||||||
{formatDistance(new Date(deployment.deploymentEndedAt), new Date(), {
|
|
||||||
addSuffix: true,
|
|
||||||
})}
|
|
||||||
</Text>
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function CurrentDeployment({ deployment }: any) {
|
|
||||||
return (
|
|
||||||
<span className="flex flex-row">
|
|
||||||
<Avatar
|
|
||||||
component="span"
|
|
||||||
name={deployment.commitUserName}
|
|
||||||
avatarUrl={deployment.commitUserAvatarUrl}
|
|
||||||
className="mr-1 h-4 w-4 self-center"
|
|
||||||
/>
|
|
||||||
<Text component="span" className="self-center text-sm">
|
|
||||||
{deployment.commitUserName} updated just now
|
|
||||||
</Text>
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function checkStatusOfTheApplication(
|
export function checkStatusOfTheApplication(
|
||||||
stateHistory: ApplicationState[] | [],
|
stateHistory: ApplicationState[] | [],
|
||||||
) {
|
) {
|
||||||
@@ -141,27 +93,23 @@ export function RenderWorkspacesWithApps({
|
|||||||
</NavLink>
|
</NavLink>
|
||||||
<List className="grid grid-flow-row border-y">
|
<List className="grid grid-flow-row border-y">
|
||||||
{workspaceProjects.map((app, index) => {
|
{workspaceProjects.map((app, index) => {
|
||||||
const isDeployingToProduction = app.deployments[0]
|
const [latestDeployment] = app.deployments;
|
||||||
? ['SCHEDULED', 'PENDING', 'DEPLOYING'].includes(
|
|
||||||
app.deployments[0].deploymentStatus,
|
|
||||||
)
|
|
||||||
: false;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment key={app.slug}>
|
<Fragment key={app.slug}>
|
||||||
<ListItem.Root
|
<ListItem.Root
|
||||||
secondaryAction={
|
secondaryAction={
|
||||||
<div className="grid grid-flow-col gap-px">
|
<div className="grid grid-flow-col gap-px">
|
||||||
{app.deployments[0] && (
|
{latestDeployment && (
|
||||||
<div className="mr-2 flex self-center align-middle">
|
<div className="mr-2 flex self-center align-middle">
|
||||||
<StatusCircle
|
<StatusCircle
|
||||||
status={
|
status={
|
||||||
app.deployments[0]
|
latestDeployment.deploymentStatus as DeploymentStatus
|
||||||
.deploymentStatus as DeploymentStatus
|
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<StateBadge
|
<StateBadge
|
||||||
status={checkStatusOfTheApplication(
|
status={checkStatusOfTheApplication(
|
||||||
app.appStates,
|
app.appStates,
|
||||||
@@ -192,27 +140,10 @@ export function RenderWorkspacesWithApps({
|
|||||||
<ListItem.Text
|
<ListItem.Text
|
||||||
primary={app.name}
|
primary={app.name}
|
||||||
secondary={
|
secondary={
|
||||||
<>
|
<DeploymentStatusMessage
|
||||||
{isDeployingToProduction && (
|
appCreatedAt={app.createdAt}
|
||||||
<CurrentDeployment
|
deployment={latestDeployment}
|
||||||
deployment={app.deployments[0]}
|
/>
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{!isDeployingToProduction &&
|
|
||||||
app.deployments[0] && (
|
|
||||||
<LastSuccessfulDeployment
|
|
||||||
deployment={app.deployments[0]}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{!isDeployingToProduction &&
|
|
||||||
!app.deployments[0] && (
|
|
||||||
<ApplicationCreatedAt
|
|
||||||
createdAt={app.createdAt}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</>
|
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</ListItem.Button>
|
</ListItem.Button>
|
||||||
|
|||||||
@@ -0,0 +1,94 @@
|
|||||||
|
import type { Deployment } from '@/types/application';
|
||||||
|
import { render, screen } from '@/utils/testUtils';
|
||||||
|
import { test, vi } from 'vitest';
|
||||||
|
import DeploymentStatusMessage from './DeploymentStatusMessage';
|
||||||
|
|
||||||
|
const defaultDeployment: Deployment = {
|
||||||
|
id: 'de305d54-75b4-431b-adb2-eb6b9e546013',
|
||||||
|
commitUserName: 'john.doe',
|
||||||
|
commitUserAvatarUrl: 'https://example.com/avatar.png',
|
||||||
|
deploymentStartedAt: '2023-02-24T12:00:00.000Z',
|
||||||
|
deploymentEndedAt: null,
|
||||||
|
deploymentStatus: 'SCHEDULED',
|
||||||
|
commitSHA: '1234567890',
|
||||||
|
commitMessage: 'Update README.md',
|
||||||
|
};
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
vi.useFakeTimers();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterAll(() => {
|
||||||
|
vi.useRealTimers();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('should render the avatar of the user who deployed the application', () => {
|
||||||
|
render(
|
||||||
|
<DeploymentStatusMessage
|
||||||
|
deployment={defaultDeployment}
|
||||||
|
appCreatedAt="2023-02-24"
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(
|
||||||
|
screen.getByRole('img', {
|
||||||
|
name: `Avatar of ${defaultDeployment.commitUserName}`,
|
||||||
|
}),
|
||||||
|
).toHaveAttribute(
|
||||||
|
'style',
|
||||||
|
`background-image: url(${defaultDeployment.commitUserAvatarUrl});`,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('should render "updated just now" when the deployment is in progress and has not ended', () => {
|
||||||
|
render(
|
||||||
|
<DeploymentStatusMessage
|
||||||
|
deployment={defaultDeployment}
|
||||||
|
appCreatedAt="2023-02-24"
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(screen.getByText(/updated just now/i)).toBeInTheDocument();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('should render "updated just now" when the deployment\'s status is DEPLOYED, but it doesn\'t have an end date for some reason', () => {
|
||||||
|
render(
|
||||||
|
<DeploymentStatusMessage
|
||||||
|
deployment={{
|
||||||
|
...defaultDeployment,
|
||||||
|
deploymentStatus: 'DEPLOYED',
|
||||||
|
deploymentEndedAt: null,
|
||||||
|
}}
|
||||||
|
appCreatedAt="2023-02-24"
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(screen.getByText(/updated just now/i)).toBeInTheDocument();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('should render "deployed 1 day ago" when the deployment has ended', () => {
|
||||||
|
vi.setSystemTime(new Date('2023-02-25T12:25:00.000Z'));
|
||||||
|
|
||||||
|
render(
|
||||||
|
<DeploymentStatusMessage
|
||||||
|
deployment={{
|
||||||
|
...defaultDeployment,
|
||||||
|
deploymentStatus: 'DEPLOYED',
|
||||||
|
deploymentEndedAt: '2023-02-24T12:15:00.000Z',
|
||||||
|
}}
|
||||||
|
appCreatedAt="2023-02-24"
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(screen.getByText(/deployed 1 day ago/i)).toBeInTheDocument();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('should render "created 1 day ago" if the application does not have a deployment', () => {
|
||||||
|
vi.setSystemTime(new Date('2023-02-25T12:25:00.000Z'));
|
||||||
|
|
||||||
|
render(
|
||||||
|
<DeploymentStatusMessage deployment={null} appCreatedAt="2023-02-24" />,
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(screen.getByText(/created 1 day ago/i)).toBeInTheDocument();
|
||||||
|
});
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
import type { Deployment } from '@/types/application';
|
||||||
|
import { Avatar } from '@/ui/Avatar';
|
||||||
|
import Text from '@/ui/v2/Text';
|
||||||
|
import formatDistance from 'date-fns/formatDistance';
|
||||||
|
|
||||||
|
export interface DeploymentStatusMessageProps {
|
||||||
|
/**
|
||||||
|
* The deployment to render the status message for.
|
||||||
|
*/
|
||||||
|
deployment: Partial<Deployment>;
|
||||||
|
/**
|
||||||
|
* The date the application was created.
|
||||||
|
*/
|
||||||
|
appCreatedAt: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function DeploymentStatusMessage({
|
||||||
|
deployment,
|
||||||
|
appCreatedAt,
|
||||||
|
}: DeploymentStatusMessageProps) {
|
||||||
|
const isDeployingToProduction = [
|
||||||
|
'SCHEDULED',
|
||||||
|
'PENDING',
|
||||||
|
'DEPLOYING',
|
||||||
|
].includes(deployment?.deploymentStatus);
|
||||||
|
|
||||||
|
if (
|
||||||
|
isDeployingToProduction ||
|
||||||
|
(deployment && !deployment.deploymentEndedAt)
|
||||||
|
) {
|
||||||
|
return (
|
||||||
|
<span className="flex flex-row">
|
||||||
|
<Avatar
|
||||||
|
component="span"
|
||||||
|
name={deployment.commitUserName}
|
||||||
|
avatarUrl={deployment.commitUserAvatarUrl}
|
||||||
|
className="mr-1 h-4 w-4 self-center"
|
||||||
|
/>
|
||||||
|
<Text component="span" className="self-center text-sm">
|
||||||
|
{deployment.commitUserName} updated just now
|
||||||
|
</Text>
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isDeployingToProduction && deployment?.deploymentEndedAt) {
|
||||||
|
return (
|
||||||
|
<span className="flex flex-row">
|
||||||
|
<Avatar
|
||||||
|
component="span"
|
||||||
|
name={deployment.commitUserName}
|
||||||
|
avatarUrl={deployment.commitUserAvatarUrl}
|
||||||
|
className="mr-1 h-4 w-4 self-center"
|
||||||
|
/>
|
||||||
|
<Text component="span" className="self-center text-sm">
|
||||||
|
{deployment.commitUserName} deployed{' '}
|
||||||
|
{formatDistance(new Date(deployment.deploymentEndedAt), new Date(), {
|
||||||
|
addSuffix: true,
|
||||||
|
})}
|
||||||
|
</Text>
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Text component="span" className="text-sm">
|
||||||
|
created{' '}
|
||||||
|
{formatDistance(new Date(appCreatedAt), new Date(), {
|
||||||
|
addSuffix: true,
|
||||||
|
})}
|
||||||
|
</Text>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
export * from './DeploymentStatusMessage';
|
||||||
|
export { default } from './DeploymentStatusMessage';
|
||||||
@@ -59,7 +59,8 @@ export function Avatar({
|
|||||||
<Box
|
<Box
|
||||||
style={Object.assign(style, { backgroundImage: `url(${avatarUrl})` })}
|
style={Object.assign(style, { backgroundImage: `url(${avatarUrl})` })}
|
||||||
className={classes}
|
className={classes}
|
||||||
aria-label="Avatar"
|
aria-label={name ? `Avatar of ${name}` : 'Avatar'}
|
||||||
|
role="img"
|
||||||
{...rest}
|
{...rest}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import generateAppServiceUrl from '@/utils/common/generateAppServiceUrl';
|
|||||||
import getServerError from '@/utils/settings/getServerError';
|
import getServerError from '@/utils/settings/getServerError';
|
||||||
import { getToastStyleProps } from '@/utils/settings/settingsConstants';
|
import { getToastStyleProps } from '@/utils/settings/settingsConstants';
|
||||||
import { yupResolver } from '@hookform/resolvers/yup';
|
import { yupResolver } from '@hookform/resolvers/yup';
|
||||||
import fetch from 'cross-fetch';
|
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
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';
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
import fetch from 'cross-fetch';
|
|
||||||
import { rest } from 'msw';
|
import { rest } from 'msw';
|
||||||
import { setupServer } from 'msw/node';
|
import { setupServer } from 'msw/node';
|
||||||
import type { ManagePermissionOptions } from './managePermission';
|
import type { ManagePermissionOptions } from './managePermission';
|
||||||
import managePermission from './managePermission';
|
import managePermission from './managePermission';
|
||||||
|
|
||||||
global.fetch = fetch;
|
|
||||||
|
|
||||||
const defaultParameters: ManagePermissionOptions = {
|
const defaultParameters: ManagePermissionOptions = {
|
||||||
dataSource: 'default',
|
dataSource: 'default',
|
||||||
schema: 'public',
|
schema: 'public',
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import type {
|
|||||||
MutationOrQueryBaseOptions,
|
MutationOrQueryBaseOptions,
|
||||||
QueryError,
|
QueryError,
|
||||||
} from '@/types/dataBrowser';
|
} from '@/types/dataBrowser';
|
||||||
import fetch from 'cross-fetch';
|
|
||||||
|
|
||||||
export interface FetchMetadataOptions
|
export interface FetchMetadataOptions
|
||||||
extends Omit<MutationOrQueryBaseOptions, 'schema' | 'table'> {}
|
extends Omit<MutationOrQueryBaseOptions, 'schema' | 'table'> {}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import type {
|
|||||||
import extractForeignKeyRelation from '@/utils/dataBrowser/extractForeignKeyRelation';
|
import extractForeignKeyRelation from '@/utils/dataBrowser/extractForeignKeyRelation';
|
||||||
import { getPreparedReadOnlyHasuraQuery } from '@/utils/dataBrowser/hasuraQueryHelpers';
|
import { getPreparedReadOnlyHasuraQuery } from '@/utils/dataBrowser/hasuraQueryHelpers';
|
||||||
import { POSTGRESQL_ERROR_CODES } from '@/utils/dataBrowser/postgresqlConstants';
|
import { POSTGRESQL_ERROR_CODES } from '@/utils/dataBrowser/postgresqlConstants';
|
||||||
import fetch from 'cross-fetch';
|
|
||||||
import { formatWithArray } from 'node-pg-format';
|
import { formatWithArray } from 'node-pg-format';
|
||||||
|
|
||||||
export interface FetchTableOptions extends MutationOrQueryBaseOptions {
|
export interface FetchTableOptions extends MutationOrQueryBaseOptions {
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
import '@testing-library/jest-dom/extend-expect';
|
import '@testing-library/jest-dom/extend-expect';
|
||||||
|
|
||||||
import matchers from '@testing-library/jest-dom/matchers';
|
import matchers from '@testing-library/jest-dom/matchers';
|
||||||
|
import fetch from 'node-fetch';
|
||||||
import { expect } from 'vitest';
|
import { expect } from 'vitest';
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
global.fetch = fetch;
|
||||||
|
|
||||||
expect.extend(matchers);
|
expect.extend(matchers);
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import { NhostApolloProvider } from '@nhost/react-apollo';
|
|||||||
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';
|
||||||
import fetch from 'cross-fetch';
|
|
||||||
import { RouterContext } from 'next/dist/shared/lib/router-context';
|
import { RouterContext } from 'next/dist/shared/lib/router-context';
|
||||||
import type { NextRouter } from 'next/router';
|
import type { NextRouter } from 'next/router';
|
||||||
import type { PropsWithChildren, ReactElement } from 'react';
|
import type { PropsWithChildren, ReactElement } from 'react';
|
||||||
@@ -32,8 +31,6 @@ const queryClient = new QueryClient({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
global.fetch = fetch;
|
|
||||||
|
|
||||||
export const mockRouter: NextRouter = {
|
export const mockRouter: NextRouter = {
|
||||||
basePath: '',
|
basePath: '',
|
||||||
pathname: '/',
|
pathname: '/',
|
||||||
|
|||||||
@@ -1,5 +1,25 @@
|
|||||||
# @nhost-examples/vue-quickstart
|
# @nhost-examples/vue-quickstart
|
||||||
|
|
||||||
|
## 0.0.8
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 850a049c: chore(deps): update docker/build-push-action action to v4
|
||||||
|
- Updated dependencies [7eac17a1]
|
||||||
|
- Updated dependencies [850a049c]
|
||||||
|
- @nhost/vue@1.13.13
|
||||||
|
- @nhost/apollo@5.0.7
|
||||||
|
|
||||||
|
## 0.0.7
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 8bb097c9: chore(deps): bump `vitest`
|
||||||
|
- Updated dependencies [4bf40995]
|
||||||
|
- Updated dependencies [8bb097c9]
|
||||||
|
- @nhost/apollo@5.0.6
|
||||||
|
- @nhost/vue@1.13.12
|
||||||
|
|
||||||
## 0.0.6
|
## 0.0.6
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost-examples/vue-quickstart",
|
"name": "@nhost-examples/vue-quickstart",
|
||||||
"version": "0.0.6",
|
"version": "0.0.8",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
@@ -37,7 +37,6 @@
|
|||||||
"unplugin-vue-components": "^0.19.9",
|
"unplugin-vue-components": "^0.19.9",
|
||||||
"vite": "^4.0.2",
|
"vite": "^4.0.2",
|
||||||
"vite-plugin-pages": "^0.28.0",
|
"vite-plugin-pages": "^0.28.0",
|
||||||
"vitest": "^0.12.4",
|
|
||||||
"vue-tsc": "^0.38.9"
|
"vue-tsc": "^0.38.9"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,23 @@
|
|||||||
# @nhost/apollo
|
# @nhost/apollo
|
||||||
|
|
||||||
|
## 5.0.7
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 850a049c: chore(deps): update docker/build-push-action action to v4
|
||||||
|
- Updated dependencies [850a049c]
|
||||||
|
- @nhost/nhost-js@2.0.7
|
||||||
|
|
||||||
|
## 5.0.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 4bf40995: chore(deps): bump `typescript` to `4.9.5`
|
||||||
|
- Updated dependencies [4bf40995]
|
||||||
|
- Updated dependencies [8bb097c9]
|
||||||
|
- Updated dependencies [35d52aab]
|
||||||
|
- @nhost/nhost-js@2.0.6
|
||||||
|
|
||||||
## 5.0.5
|
## 5.0.5
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/apollo",
|
"name": "@nhost/apollo",
|
||||||
"version": "5.0.5",
|
"version": "5.0.7",
|
||||||
"description": "Nhost Apollo Client library",
|
"description": "Nhost Apollo Client library",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
@@ -1,5 +1,25 @@
|
|||||||
# @nhost/react-apollo
|
# @nhost/react-apollo
|
||||||
|
|
||||||
|
## 5.0.8
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 850a049c: chore(deps): update docker/build-push-action action to v4
|
||||||
|
- Updated dependencies [850a049c]
|
||||||
|
- @nhost/apollo@5.0.7
|
||||||
|
- @nhost/react@2.0.7
|
||||||
|
|
||||||
|
## 5.0.7
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 4bf40995: chore(deps): bump `typescript` to `4.9.5`
|
||||||
|
- 8bb097c9: chore(deps): bump `vitest`
|
||||||
|
- Updated dependencies [4bf40995]
|
||||||
|
- Updated dependencies [8bb097c9]
|
||||||
|
- @nhost/apollo@5.0.6
|
||||||
|
- @nhost/react@2.0.6
|
||||||
|
|
||||||
## 5.0.6
|
## 5.0.6
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/react-apollo",
|
"name": "@nhost/react-apollo",
|
||||||
"version": "5.0.6",
|
"version": "5.0.8",
|
||||||
"description": "Nhost React Apollo client",
|
"description": "Nhost React Apollo client",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
@@ -1,5 +1,23 @@
|
|||||||
# @nhost/react-urql
|
# @nhost/react-urql
|
||||||
|
|
||||||
|
## 2.0.7
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 850a049c: chore(deps): update docker/build-push-action action to v4
|
||||||
|
- Updated dependencies [850a049c]
|
||||||
|
- @nhost/react@2.0.7
|
||||||
|
|
||||||
|
## 2.0.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 4bf40995: chore(deps): bump `typescript` to `4.9.5`
|
||||||
|
- 8bb097c9: chore(deps): bump `vitest`
|
||||||
|
- Updated dependencies [4bf40995]
|
||||||
|
- Updated dependencies [8bb097c9]
|
||||||
|
- @nhost/react@2.0.6
|
||||||
|
|
||||||
## 2.0.5
|
## 2.0.5
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/react-urql",
|
"name": "@nhost/react-urql",
|
||||||
"version": "2.0.5",
|
"version": "2.0.7",
|
||||||
"description": "Nhost React URQL client",
|
"description": "Nhost React URQL client",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
10
package.json
10
package.json
@@ -61,7 +61,7 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^5.42.1",
|
"@typescript-eslint/eslint-plugin": "^5.42.1",
|
||||||
"@typescript-eslint/parser": "^5.42.1",
|
"@typescript-eslint/parser": "^5.42.1",
|
||||||
"@vitejs/plugin-react": "^3.0.0",
|
"@vitejs/plugin-react": "^3.0.0",
|
||||||
"@vitest/coverage-c8": "^0.27.0",
|
"@vitest/coverage-c8": "^0.29.0",
|
||||||
"eslint": "^8.26.0",
|
"eslint": "^8.26.0",
|
||||||
"eslint-config-react-app": "^7.0.1",
|
"eslint-config-react-app": "^7.0.1",
|
||||||
"eslint-plugin-cypress": "^2.12.1",
|
"eslint-plugin-cypress": "^2.12.1",
|
||||||
@@ -76,13 +76,13 @@
|
|||||||
"husky": "^8.0.1",
|
"husky": "^8.0.1",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
"turbo": "1.6.3",
|
"turbo": "1.8.3",
|
||||||
"typedoc": "^0.22.18",
|
"typedoc": "^0.22.18",
|
||||||
"typescript": "4.9.4",
|
"typescript": "4.9.5",
|
||||||
"vite": "^4.0.2",
|
"vite": "^4.0.2",
|
||||||
"vite-plugin-dts": "^1.7.1",
|
"vite-plugin-dts": "^2.0.0",
|
||||||
"vite-tsconfig-paths": "^4.0.3",
|
"vite-tsconfig-paths": "^4.0.3",
|
||||||
"vitest": "^0.27.0"
|
"vitest": "^0.29.0"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"graphql": "16.6.0"
|
"graphql": "16.6.0"
|
||||||
|
|||||||
@@ -1,5 +1,17 @@
|
|||||||
# @nhost/docgen
|
# @nhost/docgen
|
||||||
|
|
||||||
|
## 0.1.8
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 850a049c: chore(deps): update docker/build-push-action action to v4
|
||||||
|
|
||||||
|
## 0.1.7
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 8bb097c9: chore(deps): bump `vitest`
|
||||||
|
|
||||||
## 0.1.6
|
## 0.1.6
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "@nhost/docgen",
|
"name": "@nhost/docgen",
|
||||||
"description": "Documentation generator for classes and functions",
|
"description": "Documentation generator for classes and functions",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.1.6",
|
"version": "0.1.8",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "dist/index.cjs.js",
|
"main": "dist/index.cjs.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
|||||||
@@ -1,5 +1,19 @@
|
|||||||
# @nhost/graphql-js
|
# @nhost/graphql-js
|
||||||
|
|
||||||
|
## 0.0.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 850a049c: chore(deps): update docker/build-push-action action to v4
|
||||||
|
|
||||||
|
## 0.0.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 4bf40995: chore(deps): bump `typescript` to `4.9.5`
|
||||||
|
- 8bb097c9: chore(deps): bump `vitest`
|
||||||
|
- 35d52aab: chore(deps): replace `cross-fetch` with `isomorphic-unfetch`
|
||||||
|
|
||||||
## 0.0.3
|
## 0.0.3
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/graphql-js",
|
"name": "@nhost/graphql-js",
|
||||||
"version": "0.0.3",
|
"version": "0.0.5",
|
||||||
"description": "Nhost GraphQL client",
|
"description": "Nhost GraphQL client",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@graphql-typed-document-node/core": "^3.1.1",
|
"@graphql-typed-document-node/core": "^3.1.1",
|
||||||
"cross-fetch": "^3.1.5"
|
"isomorphic-unfetch": "^3.1.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { TypedDocumentNode } from '@graphql-typed-document-node/core'
|
import { TypedDocumentNode } from '@graphql-typed-document-node/core'
|
||||||
import fetch from 'cross-fetch'
|
import fetch from 'isomorphic-unfetch'
|
||||||
import { parseRequestArgs } from './parse-args'
|
import { parseRequestArgs } from './parse-args'
|
||||||
import { resolveRequestDocument } from './resolve-request-document'
|
import { resolveRequestDocument } from './resolve-request-document'
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -1,5 +1,19 @@
|
|||||||
# @nhost/hasura-auth-js
|
# @nhost/hasura-auth-js
|
||||||
|
|
||||||
|
## 2.0.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 850a049c: chore(deps): update docker/build-push-action action to v4
|
||||||
|
|
||||||
|
## 2.0.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 4bf40995: chore(deps): bump `typescript` to `4.9.5`
|
||||||
|
- 8bb097c9: chore(deps): bump `vitest`
|
||||||
|
- 35d52aab: chore(deps): replace `cross-fetch` with `isomorphic-unfetch`
|
||||||
|
|
||||||
## 2.0.0
|
## 2.0.0
|
||||||
|
|
||||||
### Major Changes
|
### Major Changes
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { faker } from '@faker-js/faker'
|
import { faker } from '@faker-js/faker'
|
||||||
import fetch from 'cross-fetch'
|
import fetch from 'isomorphic-unfetch'
|
||||||
import { afterEach, describe, expect, it } from 'vitest'
|
import { afterEach, describe, expect, it } from 'vitest'
|
||||||
import { auth, getHtmlLink, mailhog } from './helpers'
|
import { auth, getHtmlLink, mailhog } from './helpers'
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { load } from 'cheerio'
|
import { load } from 'cheerio'
|
||||||
import fetch from 'cross-fetch'
|
import fetch from 'isomorphic-unfetch'
|
||||||
import createMailhogClient from 'mailhog'
|
import createMailhogClient from 'mailhog'
|
||||||
import { expect } from 'vitest'
|
import { expect } from 'vitest'
|
||||||
import { HasuraAuthClient, SignUpParams } from '../src'
|
import { HasuraAuthClient, SignUpParams } from '../src'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { faker } from '@faker-js/faker'
|
import { faker } from '@faker-js/faker'
|
||||||
import fetch from 'cross-fetch'
|
import fetch from 'isomorphic-unfetch'
|
||||||
import { afterEach, describe, expect, it } from 'vitest'
|
import { afterEach, describe, expect, it } from 'vitest'
|
||||||
import { auth, getHtmlLink, signUpAndInUser, signUpAndVerifyUser } from './helpers'
|
import { auth, getHtmlLink, signUpAndInUser, signUpAndVerifyUser } from './helpers'
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { faker } from '@faker-js/faker'
|
import { faker } from '@faker-js/faker'
|
||||||
import fetch from 'cross-fetch'
|
import fetch from 'isomorphic-unfetch'
|
||||||
import { afterEach, describe, expect, it } from 'vitest'
|
import { afterEach, describe, expect, it } from 'vitest'
|
||||||
import { USER_ALREADY_SIGNED_IN } from '../src'
|
import { USER_ALREADY_SIGNED_IN } from '../src'
|
||||||
import { auth, getHtmlLink, signUpAndInUser, signUpAndVerifyUser } from './helpers'
|
import { auth, getHtmlLink, signUpAndInUser, signUpAndVerifyUser } from './helpers'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/hasura-auth-js",
|
"name": "@nhost/hasura-auth-js",
|
||||||
"version": "2.0.0",
|
"version": "2.0.2",
|
||||||
"description": "Hasura-auth client",
|
"description": "Hasura-auth client",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@simplewebauthn/browser": "^6.0.0",
|
"@simplewebauthn/browser": "^6.0.0",
|
||||||
"cross-fetch": "^3.1.5",
|
"isomorphic-unfetch": "^3.1.0",
|
||||||
"js-cookie": "^3.0.1",
|
"js-cookie": "^3.0.1",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
"xstate": "^4.33.5"
|
"xstate": "^4.33.5"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import fetch from 'cross-fetch'
|
import fetch from 'isomorphic-unfetch'
|
||||||
import { NETWORK_ERROR_CODE } from '../errors'
|
import { NETWORK_ERROR_CODE } from '../errors'
|
||||||
import { NullableErrorResponse } from '../types'
|
import { NullableErrorResponse } from '../types'
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,20 @@
|
|||||||
# @nhost/hasura-storage-js
|
# @nhost/hasura-storage-js
|
||||||
|
|
||||||
|
## 2.0.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 889ee658: added tests
|
||||||
|
- 850a049c: chore(deps): update docker/build-push-action action to v4
|
||||||
|
|
||||||
|
## 2.0.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 4bf40995: chore(deps): bump `typescript` to `4.9.5`
|
||||||
|
- 8bb097c9: chore(deps): bump `vitest`
|
||||||
|
- 35d52aab: chore(deps): replace `cross-fetch` with `isomorphic-unfetch`
|
||||||
|
|
||||||
## 2.0.1
|
## 2.0.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/hasura-storage-js",
|
"name": "@nhost/hasura-storage-js",
|
||||||
"version": "2.0.1",
|
"version": "2.0.3",
|
||||||
"description": "Hasura-storage client",
|
"description": "Hasura-storage client",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@@ -60,11 +60,11 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.0",
|
||||||
|
"isomorphic-unfetch": "^3.1.0",
|
||||||
"xstate": "^4.33.5"
|
"xstate": "^4.33.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nhost/docgen": "workspace:*",
|
"@nhost/docgen": "workspace:*",
|
||||||
"cross-fetch": "^3.1.5",
|
|
||||||
"jpeg-js": "^0.4.4",
|
"jpeg-js": "^0.4.4",
|
||||||
"pixelmatch": "^5.3.0",
|
"pixelmatch": "^5.3.0",
|
||||||
"start-server-and-test": "^1.15.2",
|
"start-server-and-test": "^1.15.2",
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import fetch from 'cross-fetch'
|
import fetch from 'isomorphic-unfetch'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ApiDeleteParams,
|
ApiDeleteParams,
|
||||||
ApiDeleteResponse,
|
ApiDeleteResponse,
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ export const createMultipleFilesUploadMachine = () => {
|
|||||||
const additions = files
|
const additions = files
|
||||||
? Array.isArray(files)
|
? Array.isArray(files)
|
||||||
? files // File[]
|
? files // File[]
|
||||||
: 'length' in files // FileList
|
: 'item' in files // FileList
|
||||||
? Array.from(files)
|
? Array.from(files)
|
||||||
: [files] // File
|
: [files] // File
|
||||||
: [] // No file
|
: [] // No file
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export const appendImageTransformationParameters = (
|
|||||||
params: StorageImageTransformationParams
|
params: StorageImageTransformationParams
|
||||||
): string => {
|
): string => {
|
||||||
const queryParameters = Object.entries(params)
|
const queryParameters = Object.entries(params)
|
||||||
.map(([key, value]) => `${Array.from(key)[0]}=${value}`)
|
.map(([key, value]) => `${key.charAt(0)}=${value}`)
|
||||||
.join('&')
|
.join('&')
|
||||||
return queryParameters ? `${url}?${queryParameters}` : url
|
return queryParameters ? `${url}?${queryParameters}` : url
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import fetch from 'cross-fetch'
|
|
||||||
import FormData from 'form-data'
|
import FormData from 'form-data'
|
||||||
|
import fetch from 'isomorphic-unfetch'
|
||||||
import { ErrorPayload, StorageUploadResponse } from './types'
|
import { ErrorPayload, StorageUploadResponse } from './types'
|
||||||
|
|
||||||
/** Convert any string into ISO-8859-1 */
|
/** Convert any string into ISO-8859-1 */
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import fs from 'fs'
|
|
||||||
import { describe, expect, it } from 'vitest'
|
|
||||||
import fetch from 'cross-fetch'
|
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
|
||||||
|
|
||||||
import { storage } from './utils/helpers'
|
|
||||||
import FormData from 'form-data'
|
import FormData from 'form-data'
|
||||||
|
import fs from 'fs'
|
||||||
|
import fetch from 'isomorphic-unfetch'
|
||||||
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
|
import { describe, expect, it } from 'vitest'
|
||||||
|
import { storage } from './utils/helpers'
|
||||||
|
|
||||||
describe('test get file', () => {
|
describe('test get file', () => {
|
||||||
it('should be able to get uploaded file', async () => {
|
it('should be able to get uploaded file', async () => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import fetch from 'cross-fetch'
|
|
||||||
import FormData from 'form-data'
|
import FormData from 'form-data'
|
||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
|
import fetch from 'isomorphic-unfetch'
|
||||||
import jpeg from 'jpeg-js'
|
import jpeg from 'jpeg-js'
|
||||||
import pixelmatch from 'pixelmatch'
|
import pixelmatch from 'pixelmatch'
|
||||||
import { beforeAll, describe, expect, it } from 'vitest'
|
import { beforeAll, describe, expect, it } from 'vitest'
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import fetch from 'cross-fetch'
|
|
||||||
import FormData from 'form-data'
|
import FormData from 'form-data'
|
||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
|
import fetch from 'isomorphic-unfetch'
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
|
|
||||||
import { storage } from './utils/helpers'
|
import { storage } from './utils/helpers'
|
||||||
|
|
||||||
describe('test upload', () => {
|
describe('test upload', () => {
|
||||||
|
|||||||
23
packages/hasura-storage-js/tests/utils.test.ts
Normal file
23
packages/hasura-storage-js/tests/utils.test.ts
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import { describe, expect, it } from 'vitest'
|
||||||
|
import { appendImageTransformationParameters, StorageImageTransformationParams } from '../src/utils'
|
||||||
|
|
||||||
|
describe('appendImageTransformationParameters', () => {
|
||||||
|
it('appends image transformation parameters to the url', () => {
|
||||||
|
const url = 'https://example.com/image.jpg'
|
||||||
|
const params: StorageImageTransformationParams = {
|
||||||
|
width: 200,
|
||||||
|
height: 300,
|
||||||
|
quality: 80,
|
||||||
|
blur: 10
|
||||||
|
}
|
||||||
|
const result = appendImageTransformationParameters(url, params)
|
||||||
|
expect(result).toBe('https://example.com/image.jpg?w=200&h=300&q=80&b=10')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('returns the original url when no parameters are provided', () => {
|
||||||
|
const url = 'https://example.com/image.jpg'
|
||||||
|
const params: StorageImageTransformationParams = {}
|
||||||
|
const result = appendImageTransformationParameters(url, params)
|
||||||
|
expect(result).toBe('https://example.com/image.jpg')
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -1,5 +1,24 @@
|
|||||||
# @nhost/nextjs
|
# @nhost/nextjs
|
||||||
|
|
||||||
|
## 1.13.13
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 850a049c: chore(deps): update docker/build-push-action action to v4
|
||||||
|
- Updated dependencies [850a049c]
|
||||||
|
- @nhost/react@2.0.7
|
||||||
|
|
||||||
|
## 1.13.12
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 4bf40995: chore(deps): bump `typescript` to `4.9.5`
|
||||||
|
- 8bb097c9: chore(deps): bump `vitest`
|
||||||
|
- 35d52aab: chore(deps): replace `cross-fetch` with `isomorphic-unfetch`
|
||||||
|
- Updated dependencies [4bf40995]
|
||||||
|
- Updated dependencies [8bb097c9]
|
||||||
|
- @nhost/react@2.0.6
|
||||||
|
|
||||||
## 1.13.11
|
## 1.13.11
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/nextjs",
|
"name": "@nhost/nextjs",
|
||||||
"version": "1.13.11",
|
"version": "1.13.13",
|
||||||
"description": "Nhost NextJS library",
|
"description": "Nhost NextJS library",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nhost/react": "workspace:*",
|
"@nhost/react": "workspace:*",
|
||||||
"cross-fetch": "^3.1.5",
|
"isomorphic-unfetch": "^3.1.0",
|
||||||
"js-cookie": "^3.0.1",
|
"js-cookie": "^3.0.1",
|
||||||
"xstate": "^4.33.5"
|
"xstate": "^4.33.5"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { NhostClient, NhostSession } from '@nhost/react'
|
import { NhostClient, NhostSession } from '@nhost/react'
|
||||||
import fetch from 'cross-fetch'
|
import fetch from 'isomorphic-unfetch'
|
||||||
import Cookies from 'js-cookie'
|
import Cookies from 'js-cookie'
|
||||||
|
|
||||||
export const refresh = async (nhostUrl: string, refreshToken: string): Promise<NhostSession> => {
|
export const refresh = async (nhostUrl: string, refreshToken: string): Promise<NhostSession> => {
|
||||||
|
|||||||
@@ -1,5 +1,30 @@
|
|||||||
# @nhost/nhost-js
|
# @nhost/nhost-js
|
||||||
|
|
||||||
|
## 2.0.7
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 850a049c: chore(deps): update docker/build-push-action action to v4
|
||||||
|
- Updated dependencies [889ee658]
|
||||||
|
- Updated dependencies [850a049c]
|
||||||
|
- @nhost/hasura-storage-js@2.0.3
|
||||||
|
- @nhost/graphql-js@0.0.5
|
||||||
|
- @nhost/hasura-auth-js@2.0.2
|
||||||
|
|
||||||
|
## 2.0.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 4bf40995: chore(deps): bump `typescript` to `4.9.5`
|
||||||
|
- 8bb097c9: chore(deps): bump `vitest`
|
||||||
|
- 35d52aab: chore(deps): replace `cross-fetch` with `isomorphic-unfetch`
|
||||||
|
- Updated dependencies [4bf40995]
|
||||||
|
- Updated dependencies [8bb097c9]
|
||||||
|
- Updated dependencies [35d52aab]
|
||||||
|
- @nhost/graphql-js@0.0.4
|
||||||
|
- @nhost/hasura-auth-js@2.0.1
|
||||||
|
- @nhost/hasura-storage-js@2.0.2
|
||||||
|
|
||||||
## 2.0.5
|
## 2.0.5
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/nhost-js",
|
"name": "@nhost/nhost-js",
|
||||||
"version": "2.0.5",
|
"version": "2.0.7",
|
||||||
"description": "Nhost JavaScript SDK",
|
"description": "Nhost JavaScript SDK",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
"@nhost/graphql-js": "workspace:*",
|
"@nhost/graphql-js": "workspace:*",
|
||||||
"@nhost/hasura-auth-js": "workspace:*",
|
"@nhost/hasura-auth-js": "workspace:*",
|
||||||
"@nhost/hasura-storage-js": "workspace:*",
|
"@nhost/hasura-storage-js": "workspace:*",
|
||||||
"cross-fetch": "^3.1.5"
|
"isomorphic-unfetch": "^3.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"graphql": "16.6.0"
|
"graphql": "16.6.0"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import fetch from 'cross-fetch'
|
import fetch from 'isomorphic-unfetch'
|
||||||
import { buildUrl, urlFromSubdomain } from '../../utils/helpers'
|
import { buildUrl, urlFromSubdomain } from '../../utils/helpers'
|
||||||
import { NhostClientConstructorParams } from '../../utils/types'
|
import { NhostClientConstructorParams } from '../../utils/types'
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -1,5 +1,24 @@
|
|||||||
# @nhost/react
|
# @nhost/react
|
||||||
|
|
||||||
|
## 2.0.7
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 850a049c: chore(deps): update docker/build-push-action action to v4
|
||||||
|
- Updated dependencies [850a049c]
|
||||||
|
- @nhost/nhost-js@2.0.7
|
||||||
|
|
||||||
|
## 2.0.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 4bf40995: chore(deps): bump `typescript` to `4.9.5`
|
||||||
|
- 8bb097c9: chore(deps): bump `vitest`
|
||||||
|
- Updated dependencies [4bf40995]
|
||||||
|
- Updated dependencies [8bb097c9]
|
||||||
|
- Updated dependencies [35d52aab]
|
||||||
|
- @nhost/nhost-js@2.0.6
|
||||||
|
|
||||||
## 2.0.5
|
## 2.0.5
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/react",
|
"name": "@nhost/react",
|
||||||
"version": "2.0.5",
|
"version": "2.0.7",
|
||||||
"description": "Nhost React library",
|
"description": "Nhost React library",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
@@ -1,5 +1,17 @@
|
|||||||
# @nhost/sync-versions
|
# @nhost/sync-versions
|
||||||
|
|
||||||
|
## 0.0.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 850a049c: chore(deps): update docker/build-push-action action to v4
|
||||||
|
|
||||||
|
## 0.0.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 549c7cb7: chore(deps): bump `glob` to v9
|
||||||
|
|
||||||
## 0.0.4
|
## 0.0.4
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "@nhost/sync-versions",
|
"name": "@nhost/sync-versions",
|
||||||
"description": "Sync the versions of Nhost services in each of the packages of a pnpm workspace",
|
"description": "Sync the versions of Nhost services in each of the packages of a pnpm workspace",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.4",
|
"version": "0.0.6",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "dist/index.cjs.js",
|
"main": "dist/index.cjs.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
@@ -27,14 +27,14 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@swc-node/register": "^1.5.4",
|
"@swc-node/register": "^1.5.4",
|
||||||
"@swc/core": "^1.3.11",
|
"@swc/core": "^1.3.11",
|
||||||
"@types/glob": "^8.0.0",
|
"@types/glob": "^8.1.0",
|
||||||
"@types/node": "^16.11.7",
|
"@types/node": "^16.11.7",
|
||||||
"@types/object-path": "^0.11.1",
|
"@types/object-path": "^0.11.1",
|
||||||
"typescript": "^4.8.4"
|
"typescript": "^4.8.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pnpm/find-workspace-dir": "^5.0.0",
|
"@pnpm/find-workspace-dir": "^5.0.0",
|
||||||
"glob": "^8.0.3",
|
"glob": "^9.0.0",
|
||||||
"object-path": "^0.11.8",
|
"object-path": "^0.11.8",
|
||||||
"yaml": "^2.1.1"
|
"yaml": "^2.1.1"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
import { findWorkspaceDir } from '@pnpm/find-workspace-dir'
|
import { findWorkspaceDir } from '@pnpm/find-workspace-dir'
|
||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
import glob from 'glob'
|
import { globSync } from 'glob'
|
||||||
import { set } from 'object-path'
|
import { set } from 'object-path'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import yaml from 'yaml'
|
import yaml from 'yaml'
|
||||||
@@ -19,7 +19,7 @@ const main = async () => {
|
|||||||
fs.readFileSync(path.join(root!, 'nhost-cloud.yaml'), 'utf-8')
|
fs.readFileSync(path.join(root!, 'nhost-cloud.yaml'), 'utf-8')
|
||||||
)
|
)
|
||||||
|
|
||||||
const nhostConfigs = glob.sync('**/nhost/config.yaml', {
|
const nhostConfigs = globSync('**/nhost/config.yaml', {
|
||||||
cwd: root,
|
cwd: root,
|
||||||
absolute: true,
|
absolute: true,
|
||||||
realpath: true
|
realpath: true
|
||||||
|
|||||||
@@ -1,5 +1,25 @@
|
|||||||
# @nhost/vue
|
# @nhost/vue
|
||||||
|
|
||||||
|
## 1.13.13
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 7eac17a1: chore(deps): bump `@xstate/inspect` to 0.8.0
|
||||||
|
- 850a049c: chore(deps): update docker/build-push-action action to v4
|
||||||
|
- Updated dependencies [850a049c]
|
||||||
|
- @nhost/nhost-js@2.0.7
|
||||||
|
|
||||||
|
## 1.13.12
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 4bf40995: chore(deps): bump `typescript` to `4.9.5`
|
||||||
|
- 8bb097c9: chore(deps): bump `vitest`
|
||||||
|
- Updated dependencies [4bf40995]
|
||||||
|
- Updated dependencies [8bb097c9]
|
||||||
|
- Updated dependencies [35d52aab]
|
||||||
|
- @nhost/nhost-js@2.0.6
|
||||||
|
|
||||||
## 1.13.11
|
## 1.13.11
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/vue",
|
"name": "@nhost/vue",
|
||||||
"version": "1.13.11",
|
"version": "1.13.13",
|
||||||
"description": "Nhost Vue library",
|
"description": "Nhost Vue library",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nhost/docgen": "workspace:*",
|
"@nhost/docgen": "workspace:*",
|
||||||
"@vitejs/plugin-vue": "^4.0.0",
|
"@vitejs/plugin-vue": "^4.0.0",
|
||||||
"@xstate/inspect": "^0.7.0",
|
"@xstate/inspect": "^0.8.0",
|
||||||
"vue": "^3.2.41",
|
"vue": "^3.2.41",
|
||||||
"vue-router": "^4.1.6",
|
"vue-router": "^4.1.6",
|
||||||
"ws": "^8.10.0",
|
"ws": "^8.10.0",
|
||||||
|
|||||||
1689
pnpm-lock.yaml
generated
1689
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user