Compare commits

..

43 Commits

Author SHA1 Message Date
Hassan Ben Jobrane
10a6ae4853 Merge pull request #2233 from nhost/changeset-release/main
chore: update versions
2023-09-13 17:11:54 +01:00
github-actions[bot]
d6ca1c7cfd chore: update versions 2023-09-13 13:59:01 +00:00
Hassan Ben Jobrane
bb85a95eda Merge pull request #2236 from nhost/fix/run/subdomain-optional
fix: run: handle subdomain nullability
2023-09-13 14:56:22 +01:00
Hassan Ben Jobrane
e84acf4692 chore: add changeset 2023-09-13 13:06:05 +01:00
Hassan Ben Jobrane
2f20a70a28 fix(run): subdomain is not set when creating a new service 2023-09-13 13:00:18 +01:00
David Barroso
819e1e97dc chore (docs): update fqdn format for nhost run (#2232) 2023-09-12 14:54:39 +02:00
Hassan Ben Jobrane
7c1cca0a43 Merge pull request #2231 from nhost/changeset-release/main
chore: update versions
2023-09-12 13:09:07 +01:00
github-actions[bot]
0f51f4e868 chore: update versions 2023-09-12 12:05:55 +00:00
Hassan Ben Jobrane
97a6fcead9 Merge pull request #2230 from nhost/feat/run/copy-urls-dialog
feat(run): add dialog to copy service urls
2023-09-12 13:03:17 +01:00
Hassan Ben Jobrane
b7c799d62c chore: add changeset 2023-09-12 12:04:41 +01:00
Hassan Ben Jobrane
18b14b27fd refactor: pass service data directly to the details dialog 2023-09-12 12:01:20 +01:00
Hassan Ben Jobrane
67a867c93a feat: add dialog to copy service urls 2023-09-11 19:52:51 +01:00
David Barroso
0a1fb12467 feat: observability: add egress/requests metrics to general dashboard (#2227) 2023-09-06 18:03:25 +02:00
Hassan Ben Jobrane
78467ee348 Merge pull request #2219 from nhost/changeset-release/main
chore: update versions
2023-09-04 11:58:34 +01:00
github-actions[bot]
c24eef0db9 chore: update versions 2023-09-04 10:24:35 +00:00
Hassan Ben Jobrane
2159b8171e Merge pull request #2218 from nhost/fix/format-functions-execution
fix: dashboard: usage stats
2023-09-04 11:21:25 +01:00
Hassan Ben Jobrane
8903e6abd9 chore: add changeset 2023-09-02 15:18:54 +01:00
Hassan Ben Jobrane
7290260990 fix: show correct egress volume limit 2023-09-02 15:15:43 +01:00
Hassan Ben Jobrane
06529a1ea4 fix: round up functions duration 2023-09-02 15:14:29 +01:00
Hassan Ben Jobrane
607d89e2aa Merge pull request #2215 from nhost/changeset-release/main
chore: update versions
2023-09-01 19:13:41 +01:00
github-actions[bot]
0cca72311c chore: update versions 2023-09-01 15:26:44 +00:00
Hassan Ben Jobrane
a6525b6467 Merge pull request #2214 from nhost/feat/update-usage-metrics
feat(dashboard): update usage metrics
2023-09-01 16:24:06 +01:00
Hassan Ben Jobrane
387be37b6e chore: remove redundant egress card 2023-09-01 15:30:01 +01:00
Hassan Ben Jobrane
c8fd8bbcc7 fix: update storage upper limit for pro plan 2023-09-01 13:01:27 +01:00
Hassan Ben Jobrane
bfb34bad00 fix: use correct value for functions duration 2023-09-01 12:28:19 +01:00
Hassan Ben Jobrane
666a75a233 chore: add changeset 2023-09-01 12:26:41 +01:00
Hassan Ben Jobrane
3b050217df feat(dashboard): tweak usage metrics 2023-09-01 12:25:15 +01:00
Hassan Ben Jobrane
0ed4481615 feat(dashboard): update usage metrics 2023-09-01 11:14:49 +01:00
Hassan Ben Jobrane
ac3f12c878 Merge pull request #2211 from nhost/changeset-release/main
chore: update versions
2023-08-31 12:29:34 +01:00
github-actions[bot]
65cabb089f chore: update versions 2023-08-31 11:01:17 +00:00
Hassan Ben Jobrane
2905beb0a1 Merge pull request #2212 from nhost/fix/hasura-storage-js-edge-runtime
fix(hasura-storage-js): swap fetch when running on edge runtime
2023-08-31 11:58:43 +01:00
Hassan Ben Jobrane
83fee54460 chore: add changeset 2023-08-31 11:11:44 +01:00
Hassan Ben Jobrane
82898b6dae fix(hasura-storage-js): swap fetch when running on edge runtime 2023-08-31 11:09:37 +01:00
Hassan Ben Jobrane
500f76a38d Merge pull request #2208 from nhost/fix/user-auth-locales
fix: remove hardcoded locales
2023-08-30 10:31:43 +01:00
Hassan Ben Jobrane
5e1e80aa8b chore: add changeset 2023-08-29 20:05:29 +01:00
Hassan Ben Jobrane
6d0a126907 fix: remove hardcoded locales 2023-08-29 13:32:12 +01:00
Hassan Ben Jobrane
1b7dcf2121 Merge pull request #2207 from nhost/changeset-release/main
chore: update versions
2023-08-28 16:40:51 +01:00
github-actions[bot]
2b9205b6cf chore: update versions 2023-08-28 15:16:01 +00:00
Hassan Ben Jobrane
bdc4d4a88c Merge pull request #2206 from nhost/fix/stripe-graphql-js
fix(stripe-graphql-js): fix stripe GraphQL extension export issue in serverless functions
2023-08-28 16:12:13 +01:00
Hassan Ben Jobrane
45759c4d4c chore: add changeset 2023-08-28 15:49:17 +01:00
Hassan Ben Jobrane
5f9886577a fix: import 2023-08-28 15:47:49 +01:00
Hassan Ben Jobrane
fa65496327 fix(stripe-extension): return yoga instance instead of node http server 2023-08-28 15:24:56 +01:00
Hassan Ben Jobrane
03777680c1 chore: add STRIPE_SECRET_KEY 2023-08-26 16:51:31 +01:00
48 changed files with 2137 additions and 314 deletions

View File

@@ -1,5 +1,37 @@
# @nhost/dashboard
## 0.20.13
### Patch Changes
- e84acf469: fix(run): handle subdomain undefined error when creating a new service
## 0.20.12
### Patch Changes
- b7c799d62: feat(run): add dialog to copy registry and URLs
## 0.20.11
### Patch Changes
- 8903e6abd: fix(dashboard): show correct egress limit in usage stats
## 0.20.10
### Patch Changes
- 666a75a23: feat(dashboard): add functions execution time and egress volume to usage stats
## 0.20.9
### Patch Changes
- 5e1e80aa8: fix(dashboard): show correct locales in user details
- @nhost/react-apollo@5.0.35
- @nhost/nextjs@1.13.37
## 0.20.8
### Patch Changes

View File

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

View File

@@ -7,14 +7,15 @@ import MaterialLinearProgress, {
export interface LinearProgressProps extends MaterialLinearProgressProps {}
const LinearProgress = styled(MaterialLinearProgress)(({ theme }) => ({
const LinearProgress = styled(MaterialLinearProgress)(({ theme, value }) => ({
height: 12,
borderRadius: 1,
[`&.${linearProgressClasses.colorPrimary}`]: {
backgroundColor: theme.palette.grey[300],
},
[`& .${linearProgressClasses.bar}`]: {
backgroundColor: theme.palette.primary.main,
backgroundColor:
value >= 100 ? theme.palette.error.dark : theme.palette.primary.main,
},
}));

View File

@@ -38,6 +38,10 @@ query GetAuthenticationSettings($appId: uuid!) {
default
rating
}
locale {
allowed
default
}
}
version
}

View File

@@ -24,6 +24,7 @@ import { copy } from '@/utils/copy';
import { getServerError } from '@/utils/getServerError';
import {
RemoteAppGetUsersDocument,
useGetProjectLocalesQuery,
useGetRolesPermissionsQuery,
useUpdateRemoteAppUserMutation,
} from '@/utils/__generated__/graphql';
@@ -146,6 +147,14 @@ export default function EditUserForm({
dataRoles?.config?.auth?.user?.roles?.allowed,
);
const { data } = useGetProjectLocalesQuery({
variables: {
appId: currentProject?.id,
},
});
const allowedLocales = data?.config?.auth?.user?.locale?.allowed || [];
/**
* This will change the `disabled` field in the user to its opposite.
* If the user is disabled, it will be enabled and vice versa.
@@ -374,12 +383,11 @@ export default function EditUserForm({
error={!!errors.locale}
helperText={errors?.locale?.message}
>
<Option key="en" value="en">
en
</Option>
<Option key="fr" value="fr">
fr
</Option>
{allowedLocales.map((locale) => (
<Option key={locale} value={locale}>
{locale}
</Option>
))}
</ControlledSelect>
</Box>
<Box

View File

@@ -41,11 +41,6 @@ export default function OverviewMetrics() {
numberOfDecimals: 0,
}),
},
{
label: 'Egress Volume',
tooltip: 'Amount of data your services have sent to users',
value: prettifySize(data?.egressVolume?.value || 0),
},
{
label: 'Logs',
tooltip: 'Amount of logs stored',

View File

@@ -96,7 +96,7 @@ export function OverviewUsageMetrics() {
remoteAppMetricsData?.filesAggregate?.aggregate?.sum?.size || 0;
const totalStorage = currentProject?.plan?.isFree
? 1 * 1000 ** 3 // 1 GB
: 10 * 1000 ** 3; // 10 GB
: 50 * 1000 ** 3; // 10 GB
// metrics for users
const usedUsers = remoteAppMetricsData?.usersAggregate?.aggregate?.count || 0;
@@ -105,6 +105,16 @@ export function OverviewUsageMetrics() {
// metrics for functions
const usedFunctions = functionsInfoData?.app.metadataFunctions.length || 0;
const totalFunctions = currentProject?.plan?.isFree ? 10 : 50;
const usedFunctionsDuration = projectMetrics?.functionsDuration.value || 0;
const totalFunctionsDuration = currentProject?.plan?.isFree
? 3600 // 1 hour
: 3600 * 10; // 10 hours
// metrics for egress
const usedEgressVolume = projectMetrics?.egressVolume.value || 0;
const totalEgressVolume = currentProject?.plan?.isFree
? 5 * 1000 ** 3 // 5 GB
: 50 * 1000 ** 3; // 50 GB
if (metricsLoading) {
return (
@@ -112,7 +122,9 @@ export function OverviewUsageMetrics() {
<UsageProgress label="Database" percentage={0} />
<UsageProgress label="Storage" percentage={0} />
<UsageProgress label="Users" percentage={0} />
<UsageProgress label="Functions" percentage={0} />
<UsageProgress label="Number of Functions" percentage={0} />
<UsageProgress label="Functions Execution Time" percentage={0} />
<UsageProgress label="Egress Volume" percentage={0} />
</div>
);
}
@@ -139,6 +151,18 @@ export function OverviewUsageMetrics() {
used={usedFunctions}
percentage={100}
/>
<UsageProgress
label="Functions"
used={usedFunctionsDuration}
percentage={100}
/>
<UsageProgress
label="Egress"
used={usedEgressVolume}
percentage={100}
/>
</div>
);
}
@@ -167,11 +191,25 @@ export function OverviewUsageMetrics() {
/>
<UsageProgress
label="Functions"
label="Number of Functions"
used={usedFunctions}
total={totalFunctions}
percentage={(usedFunctions / totalFunctions) * 100}
/>
<UsageProgress
label="Functions Execution Time"
used={Math.trunc(usedFunctionsDuration)}
total={`${totalFunctionsDuration} seconds`}
percentage={(usedFunctionsDuration / totalFunctionsDuration) * 100}
/>
<UsageProgress
label="Egress Volume"
used={prettifySize(usedEgressVolume)}
total={prettifySize(totalEgressVolume)}
percentage={(usedEgressVolume / totalEgressVolume) * 100}
/>
</div>
);
}

View File

@@ -43,6 +43,7 @@ import { toast } from 'react-hot-toast';
import { parse } from 'shell-quote';
import * as Yup from 'yup';
import { ServiceConfirmationDialog } from './components/ServiceConfirmationDialog';
import { ServiceDetailsDialog } from './components/ServiceDetailsDialog';
export enum PortTypes {
HTTP = 'http',
@@ -94,7 +95,7 @@ export interface ServiceFormProps extends DialogFormProps {
/**
* if there is initialData then it's an update operation
*/
initialData?: ServiceFormValues;
initialData?: ServiceFormValues & { subdomain?: string }; // subdomain is only set on the backend
/**
* Function to be called when the operation is cancelled.
@@ -119,6 +120,10 @@ export default function ServiceForm({
const { currentProject } = useCurrentWorkspaceAndProject();
const [insertRunServiceConfig] = useInsertRunServiceConfigMutation();
const [replaceRunServiceConfig] = useReplaceRunServiceConfigMutation();
const [detailsServiceId, setDetailsServiceId] = useState('');
const [detailsServiceSubdomain, setDetailsServiceSubdomain] = useState(
initialData?.subdomain,
);
const [createServiceFormError, setCreateServiceFormError] =
useState<Error | null>(null);
@@ -196,11 +201,13 @@ export default function ServiceForm({
config,
},
});
setDetailsServiceId(serviceID);
} else {
// Insert service config
const {
data: {
insertRunService: { id: newServiceID },
insertRunService: { id: newServiceID, subdomain },
},
} = await insertRunService({
variables: {
@@ -227,6 +234,9 @@ export default function ServiceForm({
},
},
});
setDetailsServiceId(newServiceID);
setDetailsServiceSubdomain(subdomain);
}
};
@@ -254,8 +264,6 @@ export default function ServiceForm({
getToastStyleProps(),
);
// await refetchWorkspaceAndProject();
// refestch the services
onSubmit?.();
} catch {
// Note: The toast will handle the error.
@@ -277,6 +285,29 @@ export default function ServiceForm({
});
};
useEffect(() => {
(async () => {
if (detailsServiceId) {
openDialog({
title: 'Service Details',
component: (
<ServiceDetailsDialog
serviceID={detailsServiceId}
image={formValues.image}
subdomain={detailsServiceSubdomain}
ports={formValues.ports}
/>
),
props: {
PaperProps: {
className: 'max-w-2xl',
},
},
});
}
})();
}, [detailsServiceId, detailsServiceSubdomain, formValues, openDialog]);
const pricingExplanation = () => {
const vCPUs = `${formValues.compute.cpu / RESOURCE_VCPU_MULTIPLIER} vCPUs`;
const mem = `${formValues.compute.memory} MiB Mem`;
@@ -314,7 +345,7 @@ export default function ServiceForm({
<Tooltip title="Name of the service, must be unique per project.">
<InfoIcon
aria-label="Info"
className="h-4 w-4"
className="w-4 h-4"
color="primary"
/>
</Tooltip>
@@ -354,7 +385,7 @@ export default function ServiceForm({
>
<InfoIcon
aria-label="Info"
className="h-4 w-4"
className="w-4 h-4"
color="primary"
/>
</Tooltip>
@@ -385,7 +416,7 @@ export default function ServiceForm({
<Tooltip title="Command to run when to start the service. This is optional as the image may already have a baked-in command.">
<InfoIcon
aria-label="Info"
className="h-4 w-4"
className="w-4 h-4"
color="primary"
/>
</Tooltip>
@@ -429,7 +460,7 @@ export default function ServiceForm({
{createServiceFormError && (
<Alert
severity="error"
className="grid grid-flow-col items-center justify-between px-4 py-3"
className="grid items-center justify-between grid-flow-col px-4 py-3"
>
<span className="text-left">
<strong>Error:</strong> {createServiceFormError.message}

View File

@@ -32,20 +32,20 @@ export default function PortsFormSection() {
name: 'ports',
});
const formValues = useWatch<ServiceFormValues>();
const formValues = useWatch<ServiceFormValues & { subdomain: string }>();
const onChangePortType = (value: string | undefined, index: number) =>
setValue(`ports.${index}.type`, value as PortTypes);
const showURL = (index: number) =>
formValues.subdomain &&
formValues.ports[index]?.type === PortTypes.HTTP &&
formValues.ports[index]?.publish;
const getPortURL = (_port: string | number, _name: string) => {
const getPortURL = (_port: string | number, subdomain: string) => {
const port = Number(_port) > 0 ? Number(_port) : '[port]';
const name = _name && _name.length > 0 ? _name : '[name]';
return `https://${currentProject?.subdomain}-${name}-${port}.svc.${currentProject?.region.awsName}.${currentProject?.region.domain}`;
return `https://${subdomain}-${port}.svc.${currentProject?.region.awsName}.${currentProject?.region.domain}`;
};
return (
@@ -144,7 +144,7 @@ export default function PortsFormSection() {
title="URL"
value={getPortURL(
formValues.ports[index]?.port,
formValues.name,
formValues.subdomain,
)}
/>
)}

View File

@@ -0,0 +1,84 @@
import { useDialog } from '@/components/common/DialogProvider';
import { Button } from '@/components/ui/v2/Button';
import { Text } from '@/components/ui/v2/Text';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import { InfoCard } from '@/features/projects/overview/components/InfoCard';
import type { ConfigRunServicePort } from '@/utils/__generated__/graphql';
export interface ServiceDetailsDialogProps {
/**
* The id of the service
*/
serviceID: string;
/**
* The subdomain of the service
*/
subdomain: string;
/**
* The image of the service
*/
image: string;
/**
* The image of the service
* We use partial here because `port` is set as required in ConfigRunServicePort
*/
ports: Partial<ConfigRunServicePort>[];
}
export default function ServiceDetailsDialog({
serviceID,
subdomain,
image,
ports,
}: ServiceDetailsDialogProps) {
const { currentProject } = useCurrentWorkspaceAndProject();
const { closeDialog } = useDialog();
const getPortURL = (_port: string | number) => {
const port = Number(_port) > 0 ? Number(_port) : '[port]';
return `https://${subdomain}-${port}.svc.${currentProject?.region.awsName}.${currentProject?.region.domain}`;
};
return (
<div className="flex flex-col gap-4 px-6 pb-6">
<div className="flex flex-col gap-2">
<Text color="secondary">Private registry</Text>
<InfoCard
title=""
value={
image ||
`registry.${currentProject.region.awsName}.${currentProject.region.domain}/${serviceID}`
}
/>
</div>
{ports?.length > 0 && (
<div className="flex flex-col gap-2">
<Text color="secondary">Ports</Text>
{ports
.filter((port) => port.publish)
.map((port) => (
<InfoCard
title={`${port.type}:${port.port}`}
value={getPortURL(port.port)}
/>
))}
</div>
)}
<Button
className="w-full"
color="primary"
onClick={() => closeDialog()}
autoFocus
>
OK
</Button>
</div>
);
}

View File

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

View File

@@ -76,6 +76,7 @@ export default function ServicesList({
initialData={{
...service.config,
image: service.config?.image?.image,
subdomain: service.subdomain,
command: service.config?.command?.join(' '),
ports: service.config?.ports?.map((item) => ({
port: item.port,

View File

@@ -0,0 +1,12 @@
query getProjectLocales($appId: uuid!) {
config(appID: $appId, resolve: true) {
auth {
user {
locale {
allowed
default
}
}
}
}
}

View File

@@ -17,6 +17,9 @@ query GetProjectMetrics(
) {
value
}
functionsDuration: getFunctionsDuration(appID: $appId, from: $from, to: $to) {
value
}
postgresVolumeCapacity: getPostgresVolumeCapacity(appID: $appId) {
value
}

View File

@@ -1,6 +1,7 @@
query getRunService($id: uuid!, $resolve: Boolean!) {
runService(id: $id) {
id
subdomain
config(resolve: $resolve) {
name
image {

View File

@@ -9,6 +9,7 @@ query getRunServices(
id
createdAt
updatedAt
subdomain
config(resolve: $resolve) {
name
image {

View File

@@ -1,6 +1,6 @@
mutation insertRunService($object: run_service_insert_input!) {
insertRunService(object: $object) {
id
appID
subdomain
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,11 @@
# @nhost/docs
## 0.5.1
### Patch Changes
- 819e1e97d: update fqdn format for nhost run
## 0.5.0
### Minor Changes

View File

@@ -112,8 +112,8 @@ Currently, only services of type `http` can be exposed to the internet.
2. Once the service of type `http` is published, you can connect to it using a URL with the following format:
`https://<subdomain>-<svc_name>-<port>.svc.<region>.nhost.run`
`https://<run_service_subdomain>-<port>.svc.<region>.nhost.run`
For example:
`https://zlbmqjfczuwqvsquujno-mysvc-3000.svc.eu-central-1.nhost.run`
`https://zlbmqjfczuwqvsquujno-3000.svc.eu-central-1.nhost.run`

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/docs",
"version": "0.5.0",
"version": "0.5.1",
"private": true,
"scripts": {
"docusaurus": "docusaurus",

View File

@@ -1,5 +1,13 @@
# @nhost-examples/serverless-functions
## 0.0.9
### Patch Changes
- 45759c4d4: fix(stripe-graphql-js): fix stripe GraphQL extension export issue in serverless functions
- Updated dependencies [45759c4d4]
- @nhost/stripe-graphql-js@1.0.5
## 0.0.8
### Patch Changes

View File

@@ -17,6 +17,4 @@ https://github.com/nhost/nhost/tree/main/integrations/stripe-graphql-js
import { createStripeGraphQLServer } from '@nhost/stripe-graphql-js'
const server = createStripeGraphQLServer()
export default server
export default createStripeGraphQLServer()

View File

@@ -1,4 +1,7 @@
[global]
[[global.environment]]
name='STRIPE_SECRET_KEY'
value='{{ secrets.STRIPE_SECRET_KEY }}'
[hasura]
version = 'v2.25.1-ce'

View File

@@ -1,13 +1,13 @@
{
"name": "@nhost-examples/serverless-functions",
"private": true,
"version": "0.0.8",
"version": "0.0.9",
"devDependencies": {
"@types/express": "^4.17.13"
},
"dependencies": {
"@graphql-yoga/node": "^2.13.13",
"@nhost/stripe-graphql-js": "^1.0.2",
"@nhost/stripe-graphql-js": "^1.0.5",
"@pothos/core": "^3.21.0",
"cross-fetch": "^3.1.5",
"graphql": "15.7.2",

View File

@@ -1,5 +1,11 @@
# @nhost/apollo
## 5.2.18
### Patch Changes
- @nhost/nhost-js@2.2.16
## 5.2.17
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/apollo",
"version": "5.2.17",
"version": "5.2.18",
"description": "Nhost Apollo Client library",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,12 @@
# @nhost/react-apollo
## 5.0.35
### Patch Changes
- @nhost/apollo@5.2.18
- @nhost/react@2.0.31
## 5.0.34
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react-apollo",
"version": "5.0.34",
"version": "5.0.35",
"description": "Nhost React Apollo client",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,11 @@
# @nhost/react-urql
## 2.0.32
### Patch Changes
- @nhost/react@2.0.31
## 2.0.31
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react-urql",
"version": "2.0.31",
"version": "2.0.32",
"description": "Nhost React URQL client",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,11 @@
# @nhost/stripe-graphql-js
## 1.0.5
### Patch Changes
- 45759c4d4: fix(stripe-graphql-js): fix stripe GraphQL extension export issue in serverless functions
## 1.0.4
### Patch Changes

View File

@@ -1,3 +1,4 @@
import { createServer } from 'http'
import { Context, createStripeGraphQLServer } from '../src/index'
const isAllowed = (stripeCustomerId: string, context: Context) => {
@@ -10,11 +11,13 @@ const isAllowed = (stripeCustomerId: string, context: Context) => {
return false
}
const server = createStripeGraphQLServer({
const yoga = createStripeGraphQLServer({
isAllowed,
graphiql: true
})
const server = createServer(yoga)
server.listen(4000, () => {
console.info('Stripe GraphQL API server is running on http://localhost:4000')
})

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/stripe-graphql-js",
"version": "1.0.4",
"version": "1.0.5",
"description": "Stripe GraphQL API",
"license": "MIT",
"keywords": [

View File

@@ -1,4 +1,3 @@
import { createServer } from 'node:http'
import { createYoga, YogaInitialContext } from 'graphql-yoga'
import { schema } from './schema'
@@ -54,7 +53,7 @@ const createStripeGraphQLServer = (params?: CreateServerProps) => {
graphqlEndpoint: '*'
})
return createServer(yoga)
return yoga
}
export { createStripeGraphQLServer, schema }

View File

@@ -726,13 +726,226 @@
"title": "Service Restarts",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 37
},
"id": 39,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "sum by(ingress) (irate(nginx_ingress_controller_response_size_sum[$__rate_interval]))",
"interval": "2m",
"legendFormat": "__auto",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "sum(irate(fastly_prom_exporter_bytes_sent[$__rate_interval]))",
"hide": false,
"interval": "2m",
"legendFormat": "storage-cdn",
"range": true,
"refId": "B"
}
],
"title": "Egress Traffic",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 37
},
"id": 41,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "builder",
"expr": "sum by(ingress) (irate(nginx_ingress_controller_requests[$__interval]))",
"interval": "2m",
"legendFormat": "__auto",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "builder",
"expr": "sum(irate(fastly_prom_exporter_requests_total[$__interval]))",
"hide": false,
"interval": "2m",
"legendFormat": "storage-cdn",
"range": true,
"refId": "B"
}
],
"title": "Requests Rate",
"type": "timeseries"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 37
"y": 45
},
"id": 10,
"panels": [],
@@ -801,7 +1014,7 @@
"h": 8,
"w": 12,
"x": 0,
"y": 38
"y": 46
},
"id": 12,
"options": {
@@ -908,7 +1121,7 @@
"h": 8,
"w": 12,
"x": 12,
"y": 38
"y": 46
},
"id": 14,
"options": {
@@ -1015,7 +1228,7 @@
"h": 8,
"w": 12,
"x": 0,
"y": 46
"y": 54
},
"id": 16,
"options": {
@@ -1120,7 +1333,7 @@
"h": 8,
"w": 12,
"x": 12,
"y": 46
"y": 54
},
"id": 19,
"options": {
@@ -1171,7 +1384,7 @@
"h": 1,
"w": 24,
"x": 0,
"y": 54
"y": 62
},
"id": 21,
"panels": [],
@@ -1240,7 +1453,7 @@
"h": 8,
"w": 12,
"x": 0,
"y": 55
"y": 63
},
"id": 22,
"options": {
@@ -1347,7 +1560,7 @@
"h": 8,
"w": 12,
"x": 12,
"y": 55
"y": 63
},
"id": 23,
"options": {
@@ -1397,7 +1610,7 @@
"h": 1,
"w": 24,
"x": 0,
"y": 63
"y": 71
},
"id": 25,
"panels": [],
@@ -1466,7 +1679,7 @@
"h": 8,
"w": 12,
"x": 0,
"y": 64
"y": 72
},
"id": 26,
"options": {
@@ -1573,7 +1786,7 @@
"h": 8,
"w": 12,
"x": 12,
"y": 64
"y": 72
},
"id": 27,
"options": {
@@ -1623,7 +1836,7 @@
"h": 1,
"w": 24,
"x": 0,
"y": 72
"y": 80
},
"id": 29,
"panels": [],
@@ -1692,7 +1905,7 @@
"h": 8,
"w": 12,
"x": 0,
"y": 73
"y": 81
},
"id": 30,
"options": {
@@ -1799,7 +2012,7 @@
"h": 8,
"w": 12,
"x": 12,
"y": 73
"y": 81
},
"id": 31,
"options": {

View File

@@ -1,5 +1,11 @@
# @nhost/hasura-storage-js
## 2.2.4
### Patch Changes
- 83fee5446: fix(hasura-storage-js): swap fetch when running on edge runtime
## 2.2.3
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/hasura-storage-js",
"version": "2.2.3",
"version": "2.2.4",
"description": "Hasura-storage client",
"license": "MIT",
"keywords": [

View File

@@ -2,6 +2,8 @@ import fetchPonyfill from 'fetch-ponyfill'
import FormData from 'form-data'
import { StorageErrorPayload, StorageUploadResponse } from './types'
declare const EdgeRuntime: any
/** Convert any string into ISO-8859-1 */
export const toIso88591 = (fileName: string) => {
try {
@@ -12,7 +14,11 @@ export const toIso88591 = (fileName: string) => {
}
}
const { fetch } = fetchPonyfill()
let fetch = globalThis.fetch
if (typeof EdgeRuntime !== 'string') {
fetch = fetchPonyfill().fetch
}
export const fetchUpload = async (
backendUrl: string,

View File

@@ -1,5 +1,11 @@
# @nhost/nextjs
## 1.13.37
### Patch Changes
- @nhost/react@2.0.31
## 1.13.36
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/nextjs",
"version": "1.13.36",
"version": "1.13.37",
"description": "Nhost NextJS library",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,12 @@
# @nhost/nhost-js
## 2.2.16
### Patch Changes
- Updated dependencies [83fee5446]
- @nhost/hasura-storage-js@2.2.4
## 2.2.15
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/nhost-js",
"version": "2.2.15",
"version": "2.2.16",
"description": "Nhost JavaScript SDK",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,11 @@
# @nhost/react
## 2.0.31
### Patch Changes
- @nhost/nhost-js@2.2.16
## 2.0.30
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react",
"version": "2.0.30",
"version": "2.0.31",
"description": "Nhost React library",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,11 @@
# @nhost/vue
## 1.13.36
### Patch Changes
- @nhost/nhost-js@2.2.16
## 1.13.35
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/vue",
"version": "1.13.35",
"version": "1.13.36",
"description": "Nhost Vue library",
"license": "MIT",
"keywords": [

24
pnpm-lock.yaml generated
View File

@@ -1062,7 +1062,7 @@ importers:
specifier: ^2.13.13
version: 2.13.13(graphql@16.7.1)
'@nhost/stripe-graphql-js':
specifier: ^1.0.2
specifier: ^1.0.5
version: link:../../integrations/stripe-graphql-js
'@pothos/core':
specifier: ^3.21.0
@@ -1481,7 +1481,7 @@ importers:
version: 3.1.1(graphql@16.7.1)
isomorphic-unfetch:
specifier: ^3.1.0
version: 3.1.0
version: 3.1.0(encoding@0.1.13)
devDependencies:
'@nhost/docgen':
specifier: workspace:*
@@ -1562,7 +1562,7 @@ importers:
version: link:../react
isomorphic-unfetch:
specifier: ^3.1.0
version: 3.1.0
version: 3.1.0(encoding@0.1.13)
js-cookie:
specifier: ^3.0.1
version: 3.0.1
@@ -1599,7 +1599,7 @@ importers:
version: link:../hasura-storage-js
isomorphic-unfetch:
specifier: ^3.1.0
version: 3.1.0
version: 3.1.0(encoding@0.1.13)
devDependencies:
'@nhost/docgen':
specifier: workspace:*
@@ -10147,7 +10147,7 @@ packages:
dependencies:
'@graphql-typed-document-node/core': 3.2.0(graphql@16.7.1)
graphql: 16.7.1
isomorphic-unfetch: 3.1.0
isomorphic-unfetch: 3.1.0(encoding@0.1.13)
transitivePeerDependencies:
- encoding
dev: true
@@ -10183,7 +10183,7 @@ packages:
'@nhost/hasura-auth-js': 2.1.7
'@nhost/hasura-storage-js': 2.2.2
graphql: 16.7.1
isomorphic-unfetch: 3.1.0
isomorphic-unfetch: 3.1.0(encoding@0.1.13)
transitivePeerDependencies:
- encoding
dev: true
@@ -24376,7 +24376,7 @@ packages:
- encoding
dev: true
/isomorphic-unfetch@3.1.0:
/isomorphic-unfetch@3.1.0(encoding@0.1.13):
resolution: {integrity: sha512-geDJjpoZ8N0kWexiwkX8F9NkTsXhetLPVbZFQ+JTW239QNOwvB0gniuR1Wc6f0AMTn7/mFGyXvHTifrCp/GH8Q==}
dependencies:
node-fetch: 2.6.7(encoding@0.1.13)
@@ -24384,15 +24384,6 @@ packages:
transitivePeerDependencies:
- encoding
/isomorphic-unfetch@3.1.0(encoding@0.1.13):
resolution: {integrity: sha512-geDJjpoZ8N0kWexiwkX8F9NkTsXhetLPVbZFQ+JTW239QNOwvB0gniuR1Wc6f0AMTn7/mFGyXvHTifrCp/GH8Q==}
dependencies:
node-fetch: 2.6.12(encoding@0.1.13)
unfetch: 4.2.0
transitivePeerDependencies:
- encoding
dev: true
/isomorphic-ws@5.0.0(ws@8.12.1):
resolution: {integrity: sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==}
peerDependencies:
@@ -26495,6 +26486,7 @@ packages:
dependencies:
encoding: 0.1.13
whatwg-url: 5.0.0
dev: false
/node-fetch@2.6.7(encoding@0.1.13):
resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==}