Updates the spec, adds refreshSession (#9873)

This commit is contained in:
Copple authored and GitHub committed 2022-10-28 09:23:51 -02:30
1 parent 7e1c987346
commit dc8e302e86
11 files changed
+20256 -9897

No files matched your search

@@ -41,6 +41,7 @@ const sidebars = {
'generated/auth-signout',
'generated/auth-verifyotp',
'generated/auth-getsession',
'generated/auth-refreshsession',
'generated/auth-getuser',
'generated/auth-updateuser',
'generated/auth-setsession',
+28 -25
View File
@@ -14,7 +14,7 @@ init:
###############################################################################
# Download all the specs
###############################################################################
download: download.api.v1 download.auth.v1 download.storage.v1 download.tsdoc.v1 download.tsdoc.v2
download: download.api.v1 download.auth.v1 download.storage.v1 download.tsdoc.v2
download.api.v1:
curl -sS https://api.supabase.com/api/v1-json > $(REPO_DIR)/api_v0_openapi.json
@@ -25,13 +25,14 @@ download.auth.v1:
download.storage.v1:
curl -sS https://supabase.github.io/storage-api/api.json > $(REPO_DIR)/storage_v0_openapi.json
download.tsdoc.v1:
curl -sS https://supabase.github.io/supabase-js/v1/spec.json > $(REPO_DIR)/enrichments/tsdoc_v1/supabase.json
curl -sS https://supabase.github.io/gotrue-js/v1/spec.json > $(REPO_DIR)/enrichments/tsdoc_v1/gotrue.json
curl -sS https://supabase.github.io/postgrest-js/v1/spec.json > $(REPO_DIR)/enrichments/tsdoc_v1/postgrest.json
curl -sS https://supabase.github.io/realtime-js/v1/spec.json > $(REPO_DIR)/enrichments/tsdoc_v1/realtime.json
curl -sS https://supabase.github.io/storage-js/v1/spec.json > $(REPO_DIR)/enrichments/tsdoc_v1/storage.json
curl -sS https://supabase.github.io/functions-js/v1/spec.json > $(REPO_DIR)/enrichments/tsdoc_v1/functions.json
# No longer updated
# download.tsdoc.v1:
# curl -sS https://supabase.github.io/supabase-js/v1/spec.json > $(REPO_DIR)/enrichments/tsdoc_v1/supabase.json
# curl -sS https://supabase.github.io/gotrue-js/v1/spec.json > $(REPO_DIR)/enrichments/tsdoc_v1/gotrue.json
# curl -sS https://supabase.github.io/postgrest-js/v1/spec.json > $(REPO_DIR)/enrichments/tsdoc_v1/postgrest.json
# curl -sS https://supabase.github.io/realtime-js/v1/spec.json > $(REPO_DIR)/enrichments/tsdoc_v1/realtime.json
# curl -sS https://supabase.github.io/storage-js/v1/spec.json > $(REPO_DIR)/enrichments/tsdoc_v1/storage.json
# curl -sS https://supabase.github.io/functions-js/v1/spec.json > $(REPO_DIR)/enrichments/tsdoc_v1/functions.json
download.tsdoc.v2:
curl -sS https://supabase.github.io/supabase-js/v2/spec.json > $(REPO_DIR)/enrichments/tsdoc_v2/supabase.json
@@ -44,7 +45,7 @@ download.tsdoc.v2:
###############################################################################
# Transform docs into working files
###############################################################################
transform: dereference.api.v0 dereference.auth.v1 dereference.storage.v0 dereference.tsdoc.v1 dereference.tsdoc.v2 combine.tsdoc.v1 combine.tsdoc.v2
transform: dereference.api.v0 dereference.auth.v1 dereference.storage.v0 dereference.tsdoc.v2 combine.tsdoc.v2
dereference.api.v0:
npx swagger-cli bundle --dereference --outfile $(REPO_DIR)/transforms/api_v0_openapi_deparsed.json $(REPO_DIR)/api_v0_openapi.json
@@ -55,13 +56,14 @@ dereference.auth.v1:
dereference.storage.v0:
npx swagger-cli bundle --dereference --outfile $(REPO_DIR)/transforms/storage_v0_openapi_deparsed.json $(REPO_DIR)/storage_v0_openapi.json
dereference.tsdoc.v1:
cd $(REPO_DIR)/parser && npm run tsdoc:dereference:functions:v1
cd $(REPO_DIR)/parser && npm run tsdoc:dereference:gotrue:v1
cd $(REPO_DIR)/parser && npm run tsdoc:dereference:postgrest:v1
cd $(REPO_DIR)/parser && npm run tsdoc:dereference:realtime:v1
cd $(REPO_DIR)/parser && npm run tsdoc:dereference:storage:v1
cd $(REPO_DIR)/parser && npm run tsdoc:dereference:supabase:v1
# No longer updated
# dereference.tsdoc.v1:
# cd $(REPO_DIR)/parser && npm run tsdoc:dereference:functions:v1
# cd $(REPO_DIR)/parser && npm run tsdoc:dereference:gotrue:v1
# cd $(REPO_DIR)/parser && npm run tsdoc:dereference:postgrest:v1
# cd $(REPO_DIR)/parser && npm run tsdoc:dereference:realtime:v1
# cd $(REPO_DIR)/parser && npm run tsdoc:dereference:storage:v1
# cd $(REPO_DIR)/parser && npm run tsdoc:dereference:supabase:v1
dereference.tsdoc.v2:
cd $(REPO_DIR)/parser && npm run tsdoc:dereference:functions:v2
@@ -71,15 +73,16 @@ dereference.tsdoc.v2:
cd $(REPO_DIR)/parser && npm run tsdoc:dereference:storage:v2
cd $(REPO_DIR)/parser && npm run tsdoc:dereference:supabase:v2
combine.tsdoc.v1:
jq -s '{ name: "Combined Specs", children: [.[0], .[1], .[2], .[3], .[4], .[5]] }' \
$(REPO_DIR)/enrichments/tsdoc_v1/supabase_dereferenced.json \
$(REPO_DIR)/enrichments/tsdoc_v1/gotrue_dereferenced.json \
$(REPO_DIR)/enrichments/tsdoc_v1/postgrest_dereferenced.json \
$(REPO_DIR)/enrichments/tsdoc_v1/realtime_dereferenced.json \
$(REPO_DIR)/enrichments/tsdoc_v1/storage_dereferenced.json \
$(REPO_DIR)/enrichments/tsdoc_v1/functions_dereferenced.json \
> $(REPO_DIR)/enrichments/tsdoc_v1/combined.json
# No longer updated
# combine.tsdoc.v1:
# jq -s '{ name: "Combined Specs", children: [.[0], .[1], .[2], .[3], .[4], .[5]] }' \
# $(REPO_DIR)/enrichments/tsdoc_v1/supabase_dereferenced.json \
# $(REPO_DIR)/enrichments/tsdoc_v1/gotrue_dereferenced.json \
# $(REPO_DIR)/enrichments/tsdoc_v1/postgrest_dereferenced.json \
# $(REPO_DIR)/enrichments/tsdoc_v1/realtime_dereferenced.json \
# $(REPO_DIR)/enrichments/tsdoc_v1/storage_dereferenced.json \
# $(REPO_DIR)/enrichments/tsdoc_v1/functions_dereferenced.json \
# > $(REPO_DIR)/enrichments/tsdoc_v1/combined.json
combine.tsdoc.v2:
jq -s '{ name: "Combined Specs", children: [.[0], .[1], .[2], .[3], .[4], .[5]] }' \
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+30
View File
@@ -1166,6 +1166,36 @@
}
}
},
"/object/info/public/{bucketName}/{wildcard}": {
"get": {
"summary": "Get object info",
"description": "returns object info",
"parameters": [
{
"schema": { "type": "string", "example": "avatars" },
"example": "avatars",
"in": "path",
"name": "bucketName",
"required": true
},
{
"schema": { "type": "string", "example": "folder/cat.png" },
"example": "folder/cat.png",
"in": "path",
"name": "*",
"required": true
}
],
"responses": {
"4XX": {
"description": "Default Response",
"content": {
"application/json": { "schema": { "$ref": "#/components/schemas/def-1" } }
}
}
}
}
},
"/render/authenticated/{bucketName}/{wildcard}": {
"get": {
"summary": "Render an authenticated image with the given transformations",
+19
View File
@@ -345,6 +345,25 @@ pages:
```js
const { data, error } = supabase.auth.setSession(refresh_token)
```
auth.refreshSession():
title: 'refreshSession()'
$ref: '@supabase/gotrue-js.GoTrueClient.refreshSession'
notes: |
- This method will refresh the session whether the current one is expired or not.
- Both examples destructure `user` and `session` from `data`. This is not required; so `const { data, error } =` is also valid.
examples:
- name: Refresh session using the current session
isSpotlight: true
js: |
```js
const { data: { user, session }, error } = await supabase.auth.refreshSession()
```
- name: Refresh session using a passed-in session
isSpotlight: true
js: |
```js
const { data: { user, session }, error } = await supabase.auth.refreshSession({ refresh_token })
```
auth.onAuthStateChange():
title: 'onAuthStateChange()'
$ref: '@supabase/gotrue-js.GoTrueClient.onAuthStateChange'
@@ -1825,6 +1825,59 @@
}
}
},
"/object/info/public/{bucketName}/{wildcard}": {
"get": {
"summary": "Get object info",
"description": "returns object info",
"parameters": [
{
"schema": {
"type": "string",
"example": "avatars"
},
"example": "avatars",
"in": "path",
"name": "bucketName",
"required": true
},
{
"schema": {
"type": "string",
"example": "folder/cat.png"
},
"example": "folder/cat.png",
"in": "path",
"name": "*",
"required": true
}
],
"responses": {
"4XX": {
"description": "Default Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"statusCode": {
"type": "string"
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": ["statusCode", "error", "message"],
"title": "errorSchema"
}
}
}
}
}
}
},
"/render/authenticated/{bucketName}/{wildcard}": {
"get": {
"summary": "Render an authenticated image with the given transformations",