diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts index d065508cbaa..fa70a94cd1a 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts @@ -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' diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx index 945d817abcf..85f1b9493ba 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx @@ -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 (
@@ -339,6 +346,13 @@ const NavigationMenu = () => { commonSections={analyticsServerCommonSections} lib="self-hosting-analytics" /> +
) } diff --git a/apps/docs/docs/ref/self-hosting-functions/introduction.mdx b/apps/docs/docs/ref/self-hosting-functions/introduction.mdx new file mode 100644 index 00000000000..f5624ed9f1f --- /dev/null +++ b/apps/docs/docs/ref/self-hosting-functions/introduction.mdx @@ -0,0 +1,78 @@ +--- +id: introduction +title: Introduction +hideTitle: true +--- + +
+ +
+

Self-Hosting Functions

+
+
+ + + + +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 + + + Self hosted Edge functions are in beta. There will be breaking changes to APIs / Configuration + Options. + + +## 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]`. + + + + + + ### 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/) + + + + diff --git a/apps/docs/layouts/SiteLayout.tsx b/apps/docs/layouts/SiteLayout.tsx index 0af5320a944..1c0c1182cb6 100644 --- a/apps/docs/layouts/SiteLayout.tsx +++ b/apps/docs/layouts/SiteLayout.tsx @@ -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() { diff --git a/apps/docs/lib/mdx/getConfig.tsx b/apps/docs/lib/mdx/getConfig.tsx index d208d4243cc..4cd95686c7f 100644 --- a/apps/docs/lib/mdx/getConfig.tsx +++ b/apps/docs/lib/mdx/getConfig.tsx @@ -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, +} diff --git a/apps/docs/pages/reference/self-hosting-functions/[...slug].tsx b/apps/docs/pages/reference/self-hosting-functions/[...slug].tsx new file mode 100644 index 00000000000..cf4639365fb --- /dev/null +++ b/apps/docs/pages/reference/self-hosting-functions/[...slug].tsx @@ -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 +} + +export async function getStaticProps() { + return handleRefStaticProps(sections, '/self-hosting-functions') +} + +export function getStaticPaths() { + return handleRefGetStaticPaths() +} diff --git a/apps/docs/public/img/icons/menu/reference-functions-light.svg b/apps/docs/public/img/icons/menu/reference-functions-light.svg new file mode 100644 index 00000000000..37dea5670d4 --- /dev/null +++ b/apps/docs/public/img/icons/menu/reference-functions-light.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/apps/docs/public/img/icons/menu/reference-functions.svg b/apps/docs/public/img/icons/menu/reference-functions.svg new file mode 100644 index 00000000000..734a4c89e51 --- /dev/null +++ b/apps/docs/public/img/icons/menu/reference-functions.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/apps/docs/public/img/icons/menu/references-functions-light.svg b/apps/docs/public/img/icons/menu/references-functions-light.svg new file mode 100644 index 00000000000..37dea5670d4 --- /dev/null +++ b/apps/docs/public/img/icons/menu/references-functions-light.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/spec/Makefile b/spec/Makefile index 4d435a6915a..0b0a5114bae 100644 --- a/spec/Makefile +++ b/spec/Makefile @@ -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 diff --git a/spec/common-self-hosting-functions-sections.json b/spec/common-self-hosting-functions-sections.json new file mode 100644 index 00000000000..0ffa94e1b1a --- /dev/null +++ b/spec/common-self-hosting-functions-sections.json @@ -0,0 +1,9 @@ +[ + { + "id": "introduction", + "title": "Introduction", + "slug": "introduction", + "summary": "Introduction", + "type": "markdown" + } +] diff --git a/spec/functions_v0_config.yaml b/spec/functions_v0_config.yaml new file mode 100644 index 00000000000..889b31075d3 --- /dev/null +++ b/spec/functions_v0_config.yaml @@ -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. diff --git a/spec/functions_v0_openapi.json b/spec/functions_v0_openapi.json new file mode 100644 index 00000000000..9322f478f8c --- /dev/null +++ b/spec/functions_v0_openapi.json @@ -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": [] +} diff --git a/spec/transforms/functions_v0_openapi_deparsed.json b/spec/transforms/functions_v0_openapi_deparsed.json new file mode 100644 index 00000000000..0f150f95c54 --- /dev/null +++ b/spec/transforms/functions_v0_openapi_deparsed.json @@ -0,0 +1,2902 @@ +{ + "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": { + "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" + }, + "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": { + "properties": { + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "email", + "name" + ], + "title": "TeamUser", + "type": "object" + }, + "type": "array" + }, + "token": { + "type": "string" + }, + "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" + } + }, + "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": { + "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" + }, + "type": "array" + } + } + }, + "description": "Endpoint List Response" + } + }, + "summary": "List endpoints", + "tags": [ + "management" + ] + }, + "post": { + "callbacks": {}, + "operationId": "LogflareWeb.Api.EndpointController.create", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "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" + } + } + }, + "description": "Endpoint Parameters", + "required": false + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "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" + } + } + }, + "description": "Created Response" + }, + "404": { + "content": { + "text/plain": { + "schema": { + "title": "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": { + "title": "Accepted" + } + } + }, + "description": "Accepted Response" + }, + "404": { + "content": { + "text/plain": { + "schema": { + "title": "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": { + "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" + } + } + }, + "description": "Endpoint Response" + }, + "404": { + "content": { + "text/plain": { + "schema": { + "title": "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": { + "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" + } + } + }, + "description": "Endpoint Parameters", + "required": false + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "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" + } + } + }, + "description": "Created Response" + }, + "404": { + "content": { + "text/plain": { + "schema": { + "title": "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": { + "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" + } + } + }, + "description": "Endpoint Parameters", + "required": false + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "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" + } + } + }, + "description": "Created Response" + }, + "404": { + "content": { + "text/plain": { + "schema": { + "title": "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": { + "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": { + "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" + }, + "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" + }, + "type": "array" + } + } + }, + "description": "Source List Response" + } + }, + "summary": "List sources", + "tags": [ + "management" + ] + }, + "post": { + "callbacks": {}, + "operationId": "LogflareWeb.Api.SourceController.create", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "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": { + "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" + }, + "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" + } + } + }, + "description": "Source Parameters", + "required": false + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "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": { + "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" + }, + "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" + } + } + }, + "description": "Created Response" + }, + "404": { + "content": { + "text/plain": { + "schema": { + "title": "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": { + "title": "Accepted" + } + } + }, + "description": "Accepted Response" + }, + "404": { + "content": { + "text/plain": { + "schema": { + "title": "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": { + "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": { + "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" + }, + "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" + } + } + }, + "description": "Source Response" + }, + "404": { + "content": { + "text/plain": { + "schema": { + "title": "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": { + "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": { + "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" + }, + "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" + } + } + }, + "description": "Source Parameters", + "required": false + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "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": { + "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" + }, + "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" + } + } + }, + "description": "Created Response" + }, + "404": { + "content": { + "text/plain": { + "schema": { + "title": "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": { + "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": { + "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" + }, + "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" + } + } + }, + "description": "Source Parameters", + "required": false + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "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": { + "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" + }, + "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" + } + } + }, + "description": "Created Response" + }, + "404": { + "content": { + "text/plain": { + "schema": { + "title": "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": { + "properties": { + "name": { + "type": "string" + }, + "team_users": { + "items": { + "properties": { + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "email", + "name" + ], + "title": "TeamUser", + "type": "object" + }, + "type": "array" + }, + "token": { + "type": "string" + }, + "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" + } + }, + "required": [ + "name" + ], + "title": "Team", + "type": "object" + }, + "type": "array" + } + } + }, + "description": "Team List Response" + } + }, + "summary": "List teams", + "tags": [ + "management" + ] + }, + "post": { + "callbacks": {}, + "operationId": "LogflareWeb.Api.TeamController.create", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "name": { + "type": "string" + }, + "team_users": { + "items": { + "properties": { + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "email", + "name" + ], + "title": "TeamUser", + "type": "object" + }, + "type": "array" + }, + "token": { + "type": "string" + }, + "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" + } + }, + "required": [ + "name" + ], + "title": "Team", + "type": "object" + } + } + }, + "description": "Team Parameters", + "required": false + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "properties": { + "name": { + "type": "string" + }, + "team_users": { + "items": { + "properties": { + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "email", + "name" + ], + "title": "TeamUser", + "type": "object" + }, + "type": "array" + }, + "token": { + "type": "string" + }, + "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" + } + }, + "required": [ + "name" + ], + "title": "Team", + "type": "object" + } + } + }, + "description": "Created Response" + }, + "404": { + "content": { + "text/plain": { + "schema": { + "title": "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": { + "title": "Accepted" + } + } + }, + "description": "Accepted Response" + }, + "404": { + "content": { + "text/plain": { + "schema": { + "title": "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": { + "properties": { + "name": { + "type": "string" + }, + "team_users": { + "items": { + "properties": { + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "email", + "name" + ], + "title": "TeamUser", + "type": "object" + }, + "type": "array" + }, + "token": { + "type": "string" + }, + "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" + } + }, + "required": [ + "name" + ], + "title": "Team", + "type": "object" + } + } + }, + "description": "Team Response" + }, + "404": { + "content": { + "text/plain": { + "schema": { + "title": "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": { + "properties": { + "name": { + "type": "string" + }, + "team_users": { + "items": { + "properties": { + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "email", + "name" + ], + "title": "TeamUser", + "type": "object" + }, + "type": "array" + }, + "token": { + "type": "string" + }, + "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" + } + }, + "required": [ + "name" + ], + "title": "Team", + "type": "object" + } + } + }, + "description": "Team Parameters", + "required": false + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "properties": { + "name": { + "type": "string" + }, + "team_users": { + "items": { + "properties": { + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "email", + "name" + ], + "title": "TeamUser", + "type": "object" + }, + "type": "array" + }, + "token": { + "type": "string" + }, + "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" + } + }, + "required": [ + "name" + ], + "title": "Team", + "type": "object" + } + } + }, + "description": "Created Response" + }, + "404": { + "content": { + "text/plain": { + "schema": { + "title": "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": { + "properties": { + "name": { + "type": "string" + }, + "team_users": { + "items": { + "properties": { + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "email", + "name" + ], + "title": "TeamUser", + "type": "object" + }, + "type": "array" + }, + "token": { + "type": "string" + }, + "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" + } + }, + "required": [ + "name" + ], + "title": "Team", + "type": "object" + } + } + }, + "description": "Team Parameters", + "required": false + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "properties": { + "name": { + "type": "string" + }, + "team_users": { + "items": { + "properties": { + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "email", + "name" + ], + "title": "TeamUser", + "type": "object" + }, + "type": "array" + }, + "token": { + "type": "string" + }, + "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" + } + }, + "required": [ + "name" + ], + "title": "Team", + "type": "object" + } + } + }, + "description": "Created Response" + }, + "404": { + "content": { + "text/plain": { + "schema": { + "title": "NotFound" + } + } + }, + "description": "Not found" + } + }, + "summary": "Update team", + "tags": [ + "management" + ] + } + } + }, + "security": [], + "servers": [ + { + "url": "https://logflare.app", + "variables": {} + } + ], + "tags": [] +}