Compare commits

..

7 Commits

Author SHA1 Message Date
github-actions[bot]
dd9dedc226 chore: update versions (#2086) 2023-06-30 10:12:55 +02:00
Hassan Ben Jobrane
5638a91240 Merge pull request #2080 from nhost/renovate/tsconfig-docusaurus-2.x
chore(deps): update dependency @tsconfig/docusaurus to v2
2023-06-29 18:19:00 +01:00
Hassan Ben Jobrane
cdefbdebee chore: remove unchanged packages from changeset 2023-06-29 17:09:27 +01:00
Hassan Ben Jobrane
923abd3655 chore: add changeset 2023-06-29 17:02:26 +01:00
renovate[bot]
ef28540f9a chore(deps): update dependency @tsconfig/docusaurus to v2 2023-06-29 15:10:11 +00:00
Szilárd Dóró
d54e4cdd4e fix(hasura-storage-js): allow using custom buckets for upload (#2085)
This PR is a fix for the [issue mentioned on our Discord
channel](https://discord.com/channels/552499021260914688/1123893547955933214/1123893547955933214).
It wasn't caused by the latest hasura-storage-js release.
2023-06-29 17:07:29 +02:00
David Barroso
4a00963602 feat(observability): added graph with restarts (#2084) 2023-06-29 13:57:37 +02:00
30 changed files with 260 additions and 19 deletions

View File

@@ -1,5 +1,12 @@
# @nhost/dashboard
## 0.17.20
### Patch Changes
- @nhost/react-apollo@5.0.31
- @nhost/nextjs@1.13.33
## 0.17.19
### Patch Changes

View File

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

View File

@@ -1,5 +1,11 @@
# @nhost/docs
## 0.3.5
### Patch Changes
- 923abd365: chore(deps): update dependency @tsconfig/docusaurus to v2
## 0.3.4
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/docs",
"version": "0.3.4",
"version": "0.3.5",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
@@ -31,7 +31,7 @@
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.4.1",
"@tsconfig/docusaurus": "^1.0.6",
"@tsconfig/docusaurus": "^2.0.0",
"typescript": "^4.8.4"
},
"browserslist": {

View File

@@ -1,5 +1,12 @@
# @nhost-examples/node-storage
## 0.0.4
### Patch Changes
- d54e4cdd4: fix(buckets): allow using custom buckets for upload
- @nhost/nhost-js@2.2.12
## 0.0.3
### Patch Changes

View File

@@ -26,5 +26,4 @@ You can use the `.env.example` file as a starting point.
pnpm start
```
The example will download a file from a public URL and upload it to your Nhost
Storage bucket.
The example will run a few upload operations and then exit.

View File

@@ -0,0 +1 @@
DELETE FROM "storage"."buckets" WHERE "id" = 'custom';

View File

@@ -0,0 +1 @@
INSERT INTO "storage"."buckets"("presigned_urls_enabled", "download_expiration", "max_upload_file_size", "min_upload_file_size", "cache_control", "id", "created_at", "updated_at") VALUES (true, 30, 30000000, 1, E'max-age=3600', E'custom', E'2023-06-29T14:30:13.859559+00:00', E'2023-06-29T14:30:13.859559+00:00');

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/node-storage",
"version": "0.0.3",
"version": "0.0.4",
"private": true,
"description": "This is an example of how to use the Storage with Node.js",
"main": "src/index.mjs",

View File

@@ -1,5 +1,6 @@
import { uploadFile } from './uploadFile.mjs'
import { uploadFormData } from './uploadFormData.mjs'
import { uploadToBucket } from './uploadToBucket.mjs'
async function uploadFiles() {
await uploadFormData()
@@ -7,6 +8,10 @@ async function uploadFiles() {
console.info('-----')
await uploadFile()
console.info('-----')
await uploadToBucket()
}
uploadFiles()

View File

@@ -0,0 +1,68 @@
import fs from 'fs'
import fetch from 'node-fetch'
import { createClient } from './client.mjs'
const client = createClient()
export async function uploadToBucket() {
console.info('Uploading a Single File to a custom bucket...')
try {
// Download image from remote URL
const response = await fetch(
'https://hips.hearstapps.com/hmg-prod/images/cute-cat-photos-1593441022.jpg?crop=1.00xw:0.753xh;0,0.153xh&resize=1200:*'
)
if (!response.ok) {
console.error(`[file-to-bucket]`, 'Image not found!')
return
}
const arrayBuffer = await response.arrayBuffer()
const fileBuffer = Buffer.from(arrayBuffer)
const fileName = 'cat.jpg'
fs.writeFile(fileName, fileBuffer, async (err) => {
if (err) {
console.error(`[file-to-bucket]`, err)
return
}
const file = fs.createReadStream(fileName)
const { error: uploadError, fileMetadata } = await client.storage.upload({
file,
bucketId: 'custom'
})
if (uploadError) {
console.error(`[file-to-bucket]`, uploadError)
return
}
console.info(`[file-to-bucket]`, `File has been uploaded successfully!`)
console.info(`[file-to-bucket]`, `ID: ${fileMetadata?.id}`)
console.log(fileMetadata.bucketId)
// Generate a presigned URL for the uploaded file
const { error: presignError, presignedUrl: image } = await client.storage.getPresignedUrl({
fileId: fileMetadata.id
})
if (presignError) {
console.error(`[file-to-bucket]`, presignError)
return
}
console.info(`[file-to-bucket]`, `Presigned URL: ${image.url}`)
})
// Upload file to Nhost Storage
} catch (error) {
console.error(`[file-to-bucket]`, error.message)
}
}

View File

@@ -1,5 +1,11 @@
# @nhost/apollo
## 5.2.14
### Patch Changes
- @nhost/nhost-js@2.2.12
## 5.2.13
### Patch Changes

View File

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

View File

@@ -1,5 +1,12 @@
# @nhost/react-apollo
## 5.0.31
### Patch Changes
- @nhost/apollo@5.2.14
- @nhost/react@2.0.27
## 5.0.30
### Patch Changes

View File

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

View File

@@ -1,5 +1,11 @@
# @nhost/react-urql
## 2.0.28
### Patch Changes
- @nhost/react@2.0.27
## 2.0.27
### Patch Changes

View File

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

View File

@@ -629,6 +629,103 @@
"title": "Network Traffic",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"description": "This graph shows when a service was restarted. There are two main reasons why a service may be restarted:\n\n- OOMKilled - This means the service tried to use more memory than it has available and had to be restarted. For more information on resources you can check the [documentation](https://docs.nhost.io/platform/compute).\n- Error - This can show for mainly two reasons; when new configuration needs to be applied the service is terminated and due to limitations this shows as \"Error\" but it is, in fact, part of normal operations. This can also show if your service is misconfigured and/or can't start correctly for some reason. If this error doesn't show constantly it is safe to ignore this error.",
"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"
}
},
"decimals": 2,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 29
},
"id": 37,
"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(container, reason) (increase(pod_terminated_total[$__rate_interval]))",
"hide": false,
"interval": "2m",
"legendFormat": "{{container}}-{{reason}}",
"range": true,
"refId": "A"
}
],
"title": "Service Restarts",
"type": "timeseries"
},
{
"collapsed": false,
"gridPos": {

View File

@@ -1,5 +1,11 @@
# @nhost/hasura-storage-js
## 2.2.1
### Patch Changes
- d54e4cdd4: fix(buckets): allow using custom buckets for upload
## 2.2.0
### Minor Changes

View File

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

View File

@@ -39,7 +39,7 @@ export const fetchUpload = async (
...initialHeaders
}
if (bucketId) {
data.append('bucketId', bucketId)
data.append('bucket-id', bucketId)
}
if (adminSecret) {
headers['x-hasura-admin-secret'] = adminSecret

View File

@@ -1,5 +1,11 @@
# @nhost/nextjs
## 1.13.33
### Patch Changes
- @nhost/react@2.0.27
## 1.13.32
### Patch Changes

View File

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

View File

@@ -1,5 +1,12 @@
# @nhost/nhost-js
## 2.2.12
### Patch Changes
- Updated dependencies [d54e4cdd4]
- @nhost/hasura-storage-js@2.2.1
## 2.2.11
### Patch Changes

View File

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

View File

@@ -1,5 +1,11 @@
# @nhost/react
## 2.0.27
### Patch Changes
- @nhost/nhost-js@2.2.12
## 2.0.26
### Patch Changes

View File

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

View File

@@ -1,5 +1,11 @@
# @nhost/vue
## 1.13.32
### Patch Changes
- @nhost/nhost-js@2.2.12
## 1.13.31
### Patch Changes

View File

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

8
pnpm-lock.yaml generated
View File

@@ -542,8 +542,8 @@ importers:
specifier: 2.4.1
version: 2.4.1(react-dom@18.2.0)(react@18.2.0)
'@tsconfig/docusaurus':
specifier: ^1.0.6
version: 1.0.6
specifier: ^2.0.0
version: 2.0.0
typescript:
specifier: ^4.8.4
version: 4.8.4
@@ -13193,8 +13193,8 @@ packages:
path-browserify: 1.0.1
dev: true
/@tsconfig/docusaurus@1.0.6:
resolution: {integrity: sha512-1QxDaP54hpzM6bq9E+yFEo4F9WbWHhsDe4vktZXF/iDlc9FqGr9qlg+3X/nuKQXx8QxHV7ue8NXFazzajsxFBA==}
/@tsconfig/docusaurus@2.0.0:
resolution: {integrity: sha512-X5wptT7pXA/46/IRFTW76oR5GNjoy9qjNM/1JGhFV4QAsmLh3YUpJJA+Vpx7Ds6eEBxSxz1QrgoNEBy6rLVs8w==}
dev: true
/@tsconfig/node10@1.0.8: