Merge pull request #13578 from supabase/docs/functions

This commit is contained in:
Inian authored and GitHub committed 2023-04-13 11:46:56 +08:00
commit 9fe16dba52
14 files changed
+4093 -2

No files matched your search

@@ -848,6 +848,12 @@ export const self_hosting = {
{ name: 'Configuration', url: '/guides/self-hosting/analytics/config', items: [] },
],
},
{
name: 'Functions Server',
items: [
{ name: 'Reference', url: '/reference/self-hosting-functions/introduction', items: [] },
],
},
],
}
@@ -1082,6 +1088,13 @@ export const reference_self_hosting_analytics = {
parent: '/reference',
}
export const reference_self_hosting_functions = {
icon: 'reference-functions',
title: 'Self-Hosting Functions',
url: '/guides/reference/self-hosting/functions',
parent: '/reference',
}
// export const reference: [
// {
// label: 'Official'
@@ -25,6 +25,7 @@ import libCommonSections from '~/../../spec/common-client-libs-sections.json'
import authServerCommonSections from '~/../../spec/common-self-hosting-auth-sections.json'
import realtimeServerCommonSections from '~/../../spec/common-self-hosting-realtime-sections.json'
import analyticsServerCommonSections from '~/../../spec/common-self-hosting-analytics-sections.json'
import functionsServerCommonSections from '~/../../spec/common-self-hosting-functions-sections.json'
import storageServerCommonSections from '~/../../spec/common-self-hosting-storage-sections.json'
import { flattenSections } from '~/lib/helpers'
import NavigationMenuHome from './HomeMenu'
@@ -64,6 +65,7 @@ export type RefIdOptions =
| 'reference_self_hosting_storage'
| 'reference_self_hosting_realtime'
| 'reference_self_hosting_analytics'
| 'reference_self_hosting_functions'
export type RefKeyOptions =
| 'javascript'
@@ -77,6 +79,7 @@ export type RefKeyOptions =
| 'self-hosting-storage'
| 'self-hosting-realtime'
| 'self-hosting-analytics'
| 'self-hosting-functions'
const NavigationMenu = () => {
const router = useRouter()
@@ -171,6 +174,9 @@ const NavigationMenu = () => {
case url.includes(`/docs/reference/self-hosting-analytics`) && url:
menuState.setMenuLevelId('reference_self_hosting_analytics')
break
case url.includes(`/docs/reference/self-hosting-functions`) && url:
menuState.setMenuLevelId('reference_self_hosting_functions')
break
default:
break
@@ -216,6 +222,7 @@ const NavigationMenu = () => {
const isReference_Self_Hosting_Storage = 'reference_self_hosting_storage' === level
const isReference_Self_Hosting_Realtime = 'reference_self_hosting_realtime' === level
const isReference_Self_Hosting_Analytics = 'reference_self_hosting_analytics' === level
const isReference_Self_Hosting_Functions = 'reference_self_hosting_functions' === level
return (
<div className={['flex relative', 'justify-center lg:justify-start'].join(' ')}>
@@ -339,6 +346,13 @@ const NavigationMenu = () => {
commonSections={analyticsServerCommonSections}
lib="self-hosting-analytics"
/>
<NavigationMenuRefList
key={'reference-self-hosting-functions-menu'}
id={'reference_self_hosting_functions'}
active={isReference_Self_Hosting_Functions}
commonSections={functionsServerCommonSections}
lib="self-hosting-functions"
/>
</div>
)
}
@@ -0,0 +1,78 @@
---
id: introduction
title: Introduction
hideTitle: true
---
<div className="flex items-start gap-6 not-prose" id="introduction">
<img src="/docs/img/icons/menu/reference-analytics.svg" className="w-8 h-8 rounded" />
<div className="flex flex-col gap-2">
<h1 className="text-3xl text-scale-1200 m-0">Self-Hosting Functions</h1>
</div>
</div>
<RefSubLayout.EducationRow>
<RefSubLayout.Details>
A web server based on [Deno](https://deno.land) runtime, capable of running JavaScript, TypeScript, and WASM services.
You can use it to:
- Locally test and self-host Supabase's Edge Functions (or any Deno Edge Function)
- As a programmable HTTP Proxy: You can intercept / route HTTP requests
<Admonition type="info" label="Beta Version">
Self hosted Edge functions are in beta. There will be breaking changes to APIs / Configuration
Options.
</Admonition>
## How to run locally
```bash
./run.sh start --main-service /path/to/supabase/functions -p 9000
```
using Docker:
```bash
docker build -t edge-runtime .
docker run -it --rm -p 9000:9000 -v /path/to/supabase/functions:/usr/services supabase/edge-runtime start --main-service /usr/services
```
## How to update to a newer Deno version
- Select the Deno version to upgrade and visit its tag on GitHub (eg: https://github.com/denoland/deno/blob/v1.30.3/Cargo.toml)
- Open the `Cargo.toml` at the root of this repo and modify all `deno_*` modules to match to the selected tag of Deno.
## Self hosting Edge Functions on Fly.io
We have put together a demo on how to self-host edge functions on [Fly.io](http://Fly.io) (you can also use other providers like Digital Ocean or AWS).
To try it yourself,
1. Sign up for an [Fly.io](http://Fly.io) account and install [flyctl](https://fly.io/docs/hands-on/install-flyctl/)
2. Clone the demo repository to your machine - https://github.com/supabase/self-hosted-edge-functions-demo
3. Copy your Edge Function into the `./functions` directory in the demo repo.
4. Update the Dockerfile to pull the latest edge-runtime image (check [releases](https://github.com/supabase/edge-runtime/pkgs/container/edge-runtime))
5. [Optional] Edit `./functions/main/index.ts`, adding any other request preprocessing logic (for example, you can enable JWT validation, handle CORS requests)
6. Run `fly launch` to create a new app to serve your Edge Functions
7. Access your Edge Function by visiting:
`https://{your-app-name}.fly.dev/{your-function-name}`
You can view the logs for the Edge Runtime, by visiting Fly.io’s Dashboard > Your App > Metrics. Also, you can serve edge-runtime from multiple regions by running `fly regions add [REGION]`.
</RefSubLayout.Details>
<RefSubLayout.Examples>
### Client libraries
- [JavaScript](https://supabase.com/docs/reference/javascript/functions-invoke)
- [Dart](https://supabase.com/docs/reference/dart/functions-invoke)
### Additional Links
- [Source code](https://github.com/supabase/edge-runtime/)
</RefSubLayout.Examples>
</RefSubLayout.EducationRow>
+4
View File
@@ -118,6 +118,10 @@ const levelsData = {
icon: '/docs/img/icons/menu/reference-analytics',
name: 'Analytics Server Reference',
},
reference_self_hosting_functions: {
icon: '/docs/img/icons/menu/reference-functions',
name: 'Functions Server Reference',
},
}
const MobileHeader = memo(function MobileHeader() {
+13 -1
View File
@@ -6,6 +6,8 @@ import specRealtimeV0 from '~/../../spec/realtime_v0_config.yaml' assert { type:
import specAuthV1 from '~/../../spec/gotrue_v1_config.yaml' assert { type: 'yml' }
// @ts-expect-error
import specAnalyticsV0 from '~/../../spec/analytics_v0_config.yaml' assert { type: 'yml' }
// @ts-expect-error
import specFunctionsV0 from '~/../../spec/functions_v0_config.yaml' assert { type: 'yml' }
function getStorageConfigV0() {
return { ...specStorageV0 }
@@ -23,4 +25,14 @@ function getAnalyticsConfigV0() {
return { ...specAnalyticsV0 }
}
export { getStorageConfigV0, getRealtimeConfigV0, getAuthConfigV1, getAnalyticsConfigV0 }
function getFunctionsConfigV0() {
return { ...specFunctionsV0 }
}
export {
getStorageConfigV0,
getRealtimeConfigV0,
getAuthConfigV1,
getAnalyticsConfigV0,
getFunctionsConfigV0,
}
@@ -0,0 +1,21 @@
import selfHostingFunctionsCommonSections from '~/../../spec/common-self-hosting-functions-sections.json'
import RefSectionHandler from '~/components/reference/RefSectionHandler'
import { flattenSections } from '~/lib/helpers'
import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths'
import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps'
import { gen_v3 } from '~/lib/refGenerator/helpers'
const sections = flattenSections(selfHostingFunctionsCommonSections)
export default function JSReference(props) {
return <RefSectionHandler sections={sections} pageProps={props} type="api" />
}
export async function getStaticProps() {
return handleRefStaticProps(sections, '/self-hosting-functions')
}
export function getStaticPaths() {
return handleRefGetStaticPaths()
}
@@ -0,0 +1,6 @@
<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12.625" cy="3.78271" r="2" fill="#92CEAC" stroke="#299764" stroke-miterlimit="10" stroke-linejoin="bevel"/>
<circle cx="3.37109" cy="12.9119" r="2" fill="#92CEAC" stroke="#299764" stroke-miterlimit="10" stroke-linejoin="bevel"/>
<path d="M1.85724 11.7101C1.31075 10.7129 1 9.56818 1 8.35083C1 4.48484 4.13401 1.35083 8 1.35083C9.18025 1.35083 10.2923 1.64292 11.2677 2.15877M4.77293 14.5642C5.73858 15.0668 6.83612 15.3508 8 15.3508C11.866 15.3508 15 12.2168 15 8.35083C15 7.16428 14.7048 6.04668 14.1838 5.06748" stroke="#299764" stroke-miterlimit="10" stroke-linejoin="bevel"/>
<circle cx="8" cy="8.35083" r="4.5" fill="#92CEAC" stroke="#299764" stroke-miterlimit="10" stroke-linejoin="bevel"/>
</svg>

After

Width:  |  Height:  |  Size: 812 B

@@ -0,0 +1,6 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12.625" cy="3.43188" r="2" fill="#133929" stroke="#4CC38A" stroke-miterlimit="10" stroke-linejoin="bevel"/>
<circle cx="3.37109" cy="12.561" r="2" fill="#133929" stroke="#4CC38A" stroke-miterlimit="10" stroke-linejoin="bevel"/>
<path d="M1.85724 11.3593C1.31075 10.3621 1 9.21735 1 8C1 4.13401 4.13401 1 8 1C9.18025 1 10.2923 1.29209 11.2677 1.80794M4.77293 14.2134C5.73858 14.716 6.83612 15 8 15C11.866 15 15 11.866 15 8C15 6.81345 14.7048 5.69585 14.1838 4.71665" stroke="#4CC38A" stroke-miterlimit="10" stroke-linejoin="bevel"/>
<circle cx="8" cy="8" r="4.5" fill="#133929" stroke="#4CC38A" stroke-miterlimit="10" stroke-linejoin="bevel"/>
</svg>

After

Width:  |  Height:  |  Size: 758 B

@@ -0,0 +1,6 @@
<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12.625" cy="3.78271" r="2" fill="#92CEAC" stroke="#299764" stroke-miterlimit="10" stroke-linejoin="bevel"/>
<circle cx="3.37109" cy="12.9119" r="2" fill="#92CEAC" stroke="#299764" stroke-miterlimit="10" stroke-linejoin="bevel"/>
<path d="M1.85724 11.7101C1.31075 10.7129 1 9.56818 1 8.35083C1 4.48484 4.13401 1.35083 8 1.35083C9.18025 1.35083 10.2923 1.64292 11.2677 2.15877M4.77293 14.5642C5.73858 15.0668 6.83612 15.3508 8 15.3508C11.866 15.3508 15 12.2168 15 8.35083C15 7.16428 14.7048 6.04668 14.1838 5.06748" stroke="#299764" stroke-miterlimit="10" stroke-linejoin="bevel"/>
<circle cx="8" cy="8.35083" r="4.5" fill="#92CEAC" stroke="#299764" stroke-miterlimit="10" stroke-linejoin="bevel"/>
</svg>

After

Width:  |  Height:  |  Size: 812 B

+1 -1
View File
@@ -57,7 +57,7 @@ download.analytics.v0:
###############################################################################
# Transform docs into working files
###############################################################################
transform: dereference.api.v0 dereference.auth.v1 dereference.storage.v0 dereference.tsdoc.v2 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
@@ -0,0 +1,9 @@
[
{
"id": "introduction",
"title": "Introduction",
"slug": "introduction",
"summary": "Introduction",
"type": "markdown"
}
]
+37
View File
@@ -0,0 +1,37 @@
configspec: '001'
# This section outlines the general information for the tool.
info:
id: 'functions' # {string} A unique ID for this tool.
version: 'next' # {string} The current version number of the tool.
title: 'Functions' # {string} A readable name.
source: 'https://github.com/supabase/edge-runtime' # {string} Where developers can find the source code.
bugs: 'https://github.com/supabase/edge-runtime/issues' # {string} Where developers can file bugs.
spec: 'https://github.com/supabase/supabase/blob/master/spec/realtime_v0_config.yml' # {string} Where developers can find this spec (to link directly in the docs).
description: |
You can use environment variables to configure your Functions Server.
tags:
- id: general
title: General Settings
description: General server settings.
# This section is an array of public functions which a user might need to execute.
parameters:
- id: 'LOGFLARE_SINGLE_TENANT' # {string} A unique identifier for this param.
title: 'LOGFLARE_SINGLE_TENANT' # {string} Any name.
tags: ['general'] # {string[]} These tags are useful for grouping parameters
links: [] # {string[]} These tags are useful for grouping parameters
required: true
default: 'true'
type: 'boolean'
description: |
This is will seed a singular user into the database, and will disable browser authentication. All browser usage will default to this user. Inviting team users and other team-related functionality is currently not supported for self-hosted. Logflare self-hosted is currently intended for single-user experience only.
- id: 'LOGFLARE_API_KEY' # {string} A unique identifier for this param.
title: 'LOGFLARE_API_KEY' # {string} Any name.
tags: ['general'] # {string[]} These tags are useful for grouping parameters
links: [] # {string[]} These tags are useful for grouping parameters
required: true
default: ''
type: 'string'
description: |
Allows you to pass in an API key that will used for authentication. This is intended for programmatic usage where an external program sets the API key. It is advised to use the UI to configure the access tokens instead. If this value is not provided, the default API key will be automatically generated.
+983
View File
@@ -0,0 +1,983 @@
{
"components": {
"responses": {},
"schemas": {
"Accepted": {
"title": "Accepted"
},
"Endpoint": {
"properties": {
"cache_duration_seconds": {
"type": "integer"
},
"enable_auth": {
"type": "boolean"
},
"inserted_at": {
"format": "date-time",
"type": "string"
},
"max_limit": {
"type": "integer"
},
"name": {
"type": "string"
},
"proactive_requerying_seconds": {
"type": "integer"
},
"query": {
"type": "string"
},
"sandboxable": {
"type": "boolean"
},
"source_mapping": {
"type": "object"
},
"token": {
"type": "string"
},
"updated_at": {
"format": "date-time",
"type": "string"
}
},
"required": ["name", "query"],
"title": "Endpoint",
"type": "object"
},
"NotFound": {
"title": "NotFound"
},
"Notification": {
"properties": {
"other_email_notifications": {
"type": "string"
},
"team_user_ids_for_email": {
"allOf": {
"type": "string"
},
"type": "array"
},
"team_user_ids_for_schema_updates": {
"allOf": {
"type": "string"
},
"type": "array"
},
"team_user_ids_for_sms": {
"allOf": {
"type": "string"
},
"type": "array"
},
"user_email_notifications": {
"type": "boolean"
},
"user_schema_update_notifications": {
"type": "boolean"
},
"user_text_notifications": {
"type": "boolean"
}
},
"title": "Notification",
"type": "object"
},
"Source": {
"properties": {
"api_quota": {
"type": "integer"
},
"bigquery_table_ttl": {
"type": "integer"
},
"bq_table_id": {
"type": "string"
},
"bq_table_schema": {
"type": "object"
},
"custom_event_message_keys": {
"type": "string"
},
"favorite": {
"type": "boolean"
},
"has_rejected_events": {
"type": "boolean"
},
"id": {},
"inserted_at": {
"format": "date-time",
"type": "string"
},
"metrics": {
"type": "object"
},
"name": {
"type": "string"
},
"notifications": {
"items": {
"$ref": "#/components/schemas/Notification"
},
"type": "array"
},
"public_token": {
"type": "string"
},
"slack_hook_url": {
"type": "string"
},
"token": {
"type": "string"
},
"updated_at": {
"format": "date-time",
"type": "string"
},
"webhook_notification_url": {
"type": "string"
}
},
"required": ["name"],
"title": "Source",
"type": "object"
},
"Team": {
"properties": {
"name": {
"type": "string"
},
"team_users": {
"items": {
"$ref": "#/components/schemas/TeamUser"
},
"type": "array"
},
"token": {
"type": "string"
},
"user": {
"$ref": "#/components/schemas/User"
}
},
"required": ["name"],
"title": "Team",
"type": "object"
},
"TeamUser": {
"properties": {
"email": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": ["email", "name"],
"title": "TeamUser",
"type": "object"
},
"User": {
"properties": {
"api_key": {
"type": "string"
},
"api_quota": {
"type": "integer"
},
"bigquery_dataset_id": {
"type": "string"
},
"bigquery_dataset_location": {
"type": "string"
},
"bigquery_project_id": {
"type": "string"
},
"company": {
"type": "string"
},
"email": {
"type": "string"
},
"email_me_product": {
"type": "boolean"
},
"email_preferred": {
"type": "string"
},
"image": {
"type": "string"
},
"name": {
"type": "string"
},
"phone": {
"type": "string"
},
"provider": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": ["email", "provider", "token", "provider_uid", "api_key"],
"title": "User",
"type": "object"
}
}
},
"info": {
"title": "logflare",
"version": "1.0.0"
},
"openapi": "3.0.0",
"paths": {
"/api/endpoints": {
"get": {
"callbacks": {},
"operationId": "LogflareWeb.Api.EndpointController.index",
"parameters": [],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/Endpoint"
},
"type": "array"
}
}
},
"description": "Endpoint List Response"
}
},
"summary": "List endpoints",
"tags": ["management"]
},
"post": {
"callbacks": {},
"operationId": "LogflareWeb.Api.EndpointController.create",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Endpoint"
}
}
},
"description": "Endpoint Parameters",
"required": false
},
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Endpoint"
}
}
},
"description": "Created Response"
},
"404": {
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/NotFound"
}
}
},
"description": "Not found"
}
},
"summary": "Create endpoint",
"tags": ["management"]
}
},
"/api/endpoints/{token}": {
"delete": {
"callbacks": {},
"operationId": "LogflareWeb.Api.EndpointController.delete",
"parameters": [
{
"description": "Endpoint Token",
"in": "path",
"name": "token",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Accepted"
}
}
},
"description": "Accepted Response"
},
"404": {
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/NotFound"
}
}
},
"description": "Not found"
}
},
"summary": "Delete endpoint",
"tags": ["management", "management"]
},
"get": {
"callbacks": {},
"operationId": "LogflareWeb.Api.EndpointController.show",
"parameters": [
{
"description": "Endpoint Token",
"in": "path",
"name": "token",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Endpoint"
}
}
},
"description": "Endpoint Response"
},
"404": {
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/NotFound"
}
}
},
"description": "Not found"
}
},
"summary": "Fetch endpoint",
"tags": ["management"]
},
"patch": {
"callbacks": {},
"operationId": "LogflareWeb.Api.EndpointController.update",
"parameters": [
{
"description": "Endpoint Token",
"in": "path",
"name": "token",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Endpoint"
}
}
},
"description": "Endpoint Parameters",
"required": false
},
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Endpoint"
}
}
},
"description": "Created Response"
},
"404": {
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/NotFound"
}
}
},
"description": "Not found"
}
},
"summary": "Update endpoint",
"tags": ["management"]
},
"put": {
"callbacks": {},
"operationId": "LogflareWeb.Api.EndpointController.update (2)",
"parameters": [
{
"description": "Endpoint Token",
"in": "path",
"name": "token",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Endpoint"
}
}
},
"description": "Endpoint Parameters",
"required": false
},
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Endpoint"
}
}
},
"description": "Created Response"
},
"404": {
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/NotFound"
}
}
},
"description": "Not found"
}
},
"summary": "Update endpoint",
"tags": ["management"]
}
},
"/api/sources": {
"get": {
"callbacks": {},
"operationId": "LogflareWeb.Api.SourceController.index",
"parameters": [],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/Source"
},
"type": "array"
}
}
},
"description": "Source List Response"
}
},
"summary": "List sources",
"tags": ["management"]
},
"post": {
"callbacks": {},
"operationId": "LogflareWeb.Api.SourceController.create",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Source"
}
}
},
"description": "Source Parameters",
"required": false
},
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Source"
}
}
},
"description": "Created Response"
},
"404": {
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/NotFound"
}
}
},
"description": "Not found"
}
},
"summary": "Create source",
"tags": ["management"]
}
},
"/api/sources/{token}": {
"delete": {
"callbacks": {},
"operationId": "LogflareWeb.Api.SourceController.delete",
"parameters": [
{
"description": "Source Token",
"in": "path",
"name": "token",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Accepted"
}
}
},
"description": "Accepted Response"
},
"404": {
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/NotFound"
}
}
},
"description": "Not found"
}
},
"summary": "Delete source",
"tags": ["management"]
},
"get": {
"callbacks": {},
"operationId": "LogflareWeb.Api.SourceController.show",
"parameters": [
{
"description": "Source Token",
"in": "path",
"name": "token",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Source"
}
}
},
"description": "Source Response"
},
"404": {
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/NotFound"
}
}
},
"description": "Not found"
}
},
"summary": "Fetch source",
"tags": ["management"]
},
"patch": {
"callbacks": {},
"operationId": "LogflareWeb.Api.SourceController.update",
"parameters": [
{
"description": "Source Token",
"in": "path",
"name": "token",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Source"
}
}
},
"description": "Source Parameters",
"required": false
},
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Source"
}
}
},
"description": "Created Response"
},
"404": {
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/NotFound"
}
}
},
"description": "Not found"
}
},
"summary": "Update source",
"tags": ["management"]
},
"put": {
"callbacks": {},
"operationId": "LogflareWeb.Api.SourceController.update (2)",
"parameters": [
{
"description": "Source Token",
"in": "path",
"name": "token",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Source"
}
}
},
"description": "Source Parameters",
"required": false
},
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Source"
}
}
},
"description": "Created Response"
},
"404": {
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/NotFound"
}
}
},
"description": "Not found"
}
},
"summary": "Update source",
"tags": ["management"]
}
},
"/api/teams": {
"get": {
"callbacks": {},
"operationId": "LogflareWeb.Api.TeamController.index",
"parameters": [],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/Team"
},
"type": "array"
}
}
},
"description": "Team List Response"
}
},
"summary": "List teams",
"tags": ["management"]
},
"post": {
"callbacks": {},
"operationId": "LogflareWeb.Api.TeamController.create",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Team"
}
}
},
"description": "Team Parameters",
"required": false
},
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Team"
}
}
},
"description": "Created Response"
},
"404": {
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/NotFound"
}
}
},
"description": "Not found"
}
},
"summary": "Create Team",
"tags": ["management"]
}
},
"/api/teams/{token}": {
"delete": {
"callbacks": {},
"operationId": "LogflareWeb.Api.TeamController.delete",
"parameters": [
{
"description": "Team Token",
"in": "path",
"name": "token",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Accepted"
}
}
},
"description": "Accepted Response"
},
"404": {
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/NotFound"
}
}
},
"description": "Not found"
}
},
"summary": "Delete Team",
"tags": ["management"]
},
"get": {
"callbacks": {},
"operationId": "LogflareWeb.Api.TeamController.show",
"parameters": [
{
"description": "Team Token",
"in": "path",
"name": "token",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Team"
}
}
},
"description": "Team Response"
},
"404": {
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/NotFound"
}
}
},
"description": "Not found"
}
},
"summary": "Fetch team",
"tags": ["management"]
},
"patch": {
"callbacks": {},
"operationId": "LogflareWeb.Api.TeamController.update",
"parameters": [
{
"description": "Team Token",
"in": "path",
"name": "token",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Team"
}
}
},
"description": "Team Parameters",
"required": false
},
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Team"
}
}
},
"description": "Created Response"
},
"404": {
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/NotFound"
}
}
},
"description": "Not found"
}
},
"summary": "Update team",
"tags": ["management"]
},
"put": {
"callbacks": {},
"operationId": "LogflareWeb.Api.TeamController.update (2)",
"parameters": [
{
"description": "Team Token",
"in": "path",
"name": "token",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Team"
}
}
},
"description": "Team Parameters",
"required": false
},
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Team"
}
}
},
"description": "Created Response"
},
"404": {
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/NotFound"
}
}
},
"description": "Not found"
}
},
"summary": "Update team",
"tags": ["management"]
}
}
},
"security": [],
"servers": [
{
"url": "https://logflare.app",
"variables": {}
}
],
"tags": []
}
File diff suppressed because it is too large. Load diff