fix: storage docs

This commit is contained in:
phamhieu committed 2021-05-18 12:01:52 +07:00
1 parent 365f60a1ca
commit 43e0eaa968
3 files changed
+6177 -19

No files matched your search

+1 -1
View File
@@ -25,7 +25,7 @@ storage:
> $(REPO_DIR)/storage.json
combine:
jq -s '{ name: "Combined Specs", children: [.[0], .[1], .[2], .[3]] }' \
jq -s '{ name: "Combined Specs", children: [.[0], .[1], .[2], .[3], .[4]] }' \
$(REPO_DIR)/supabase.json \
$(REPO_DIR)/gotrue.json \
$(REPO_DIR)/postgrest.json \
File diff suppressed because it is too large. Load diff
+18 -18
View File
@@ -219,19 +219,19 @@ pages:
res.status(200).json(allOnlineUsers);
};
```
### Update types automatically with GitHub Actions
One way to keep your type definitions in sync with your database is to set up a GitHub action that runs on a schedule.
Add a script to your package.json to generate the types:
```
"update-types": "npx openapi-typescript https://your-project.supabase.co/rest/v1/?apikey=your-anon-key --output types/supabase.ts"
```
In your repo, create the file `.github/workflows/update-types.yml`. Add the following snippet into this file to define the action. If there is a change to your definitions, this script will commit the change to your repo.
```yml
name: Update database types
@@ -871,7 +871,7 @@ pages:
storage.listBuckets():
title: 'listBuckets()'
$ref: '@supabase/supabase-js."lib/storage/StorageBucketApi".StorageBucketApi.listBuckets'
$ref: '@supabase/storage-js."lib/StorageBucketApi".StorageBucketApi.listBuckets'
notes: |
- Policy permissions required:
- `buckets` permissions: `select`
@@ -888,7 +888,7 @@ pages:
storage.getBucket():
title: 'getBucket()'
$ref: '@supabase/supabase-js."lib/storage/StorageBucketApi".StorageBucketApi.getBucket'
$ref: '@supabase/storage-js."lib/StorageBucketApi".StorageBucketApi.getBucket'
notes: |
- Policy permissions required:
- `buckets` permissions: `select`
@@ -905,7 +905,7 @@ pages:
storage.createBucket():
title: 'createBucket()'
$ref: '@supabase/supabase-js."lib/storage/StorageBucketApi".StorageBucketApi.createBucket'
$ref: '@supabase/storage-js."lib/StorageBucketApi".StorageBucketApi.createBucket'
notes: |
- Policy permissions required:
- `buckets` permissions: `insert`
@@ -922,7 +922,7 @@ pages:
storage.emptyBucket():
title: 'emptyBucket()'
$ref: '@supabase/supabase-js."lib/storage/StorageBucketApi".StorageBucketApi.emptyBucket'
$ref: '@supabase/storage-js."lib/StorageBucketApi".StorageBucketApi.emptyBucket'
notes: |
- Policy permissions required:
- `buckets` permissions: `select`
@@ -939,7 +939,7 @@ pages:
storage.deleteBucket():
title: 'deleteBucket()'
$ref: '@supabase/supabase-js."lib/storage/StorageBucketApi".StorageBucketApi.deleteBucket'
$ref: '@supabase/storage-js."lib/StorageBucketApi".StorageBucketApi.deleteBucket'
notes: |
- Policy permissions required:
- `buckets` permissions: `select` and `delete`
@@ -956,7 +956,7 @@ pages:
storage.from.upload():
title: 'from.upload()'
$ref: '@supabase/supabase-js."lib/storage/StorageFileApi".StorageFileApi.upload'
$ref: '@supabase/storage-js."lib/StorageFileApi".StorageFileApi.upload'
notes: |
- Policy permissions required:
- `buckets` permissions: none
@@ -975,7 +975,7 @@ pages:
storage.from.update():
title: 'from.update()'
$ref: '@supabase/supabase-js."lib/storage/StorageFileApi".StorageFileApi.update'
$ref: '@supabase/storage-js."lib/StorageFileApi".StorageFileApi.update'
notes: |
- Policy permissions required:
- `buckets` permissions: none
@@ -994,7 +994,7 @@ pages:
storage.from.move():
title: 'from.move()'
$ref: '@supabase/supabase-js."lib/storage/StorageFileApi".StorageFileApi.move'
$ref: '@supabase/storage-js."lib/StorageFileApi".StorageFileApi.move'
notes: |
- Policy permissions required:
- `buckets` permissions: none
@@ -1012,7 +1012,7 @@ pages:
storage.from.createSignedUrl():
title: 'from.createSignedUrl()'
$ref: '@supabase/supabase-js."lib/storage/StorageFileApi".StorageFileApi.createSignedUrl'
$ref: '@supabase/storage-js."lib/StorageFileApi".StorageFileApi.createSignedUrl'
notes: |
- Policy permissions required:
- `buckets` permissions: none
@@ -1030,7 +1030,7 @@ pages:
storage.from.download():
title: 'from.download()'
$ref: '@supabase/supabase-js."lib/storage/StorageFileApi".StorageFileApi.download'
$ref: '@supabase/storage-js."lib/StorageFileApi".StorageFileApi.download'
notes: |
- Policy permissions required:
- `buckets` permissions: none
@@ -1048,7 +1048,7 @@ pages:
storage.from.remove():
title: 'from.remove()'
$ref: '@supabase/supabase-js."lib/storage/StorageFileApi".StorageFileApi.remove'
$ref: '@supabase/storage-js."lib/StorageFileApi".StorageFileApi.remove'
notes: |
- Policy permissions required:
- `buckets` permissions: none
@@ -1066,7 +1066,7 @@ pages:
storage.from.list():
title: 'from.list()'
$ref: '@supabase/supabase-js."lib/storage/StorageFileApi".StorageFileApi.list'
$ref: '@supabase/storage-js."lib/StorageFileApi".StorageFileApi.list'
notes: |
- Policy permissions required:
- `buckets` permissions: none