The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Add reference docs
Terry Sutton0880d7e247c4
diff --git a/apps/temp-docs/.gitignore b/apps/temp-docs/.gitignorenew file mode 100644index 00000000000..820d2d9ff0a--- /dev/null+++ b/apps/temp-docs/.gitignore@@ -0,0 +1,21 @@+# Dependencies+/node_modules++# Production+/build++# Generated files+.cache-loader++# Misc+.DS_Store+.env.local+.env.development.local+.env.test.local+.env.production.local++npm-debug.log*+yarn-debug.log*+yarn-error.log*++**/*/generated\ No newline at end of filediff --git a/apps/temp-docs/_api/intro.md b/apps/temp-docs/_api/intro.mdnew file mode 100644index 00000000000..8f9bd942142--- /dev/null+++ b/apps/temp-docs/_api/intro.md@@ -0,0 +1,37 @@+---+slug: /+sidebar_position: 1+sidebar_label: Supabase API+---++# Supabase API++The Supabase API allows you to manage your projects programmatically.++## Status++The Supabase API is in `beta`. It is usable in it's current state, but it's likely that there will be breaking changes.++## Authentication++All API requests require a Supabase Personal token to be included in the Authorization header: `Authorization Bearer <supabase_personal_token`.+To generate or manage your API token, visit your [account](https://app.supabase.com/account/tokens) page.+Your API tokens carry the same privileges as your user account, so be sure to keep it secret.++```bash+$ curl https://api.supabase.com/v1/projects \+-H "Authorization: Bearer sbp_bdd0••••••••••••••••••••••••••••••••4f23"+```++All API requests must be authenticated and made over HTTPS.++## Rate limits++The API is currently subject to our fair-use policy. In the future, are likely to introduce rate limits.+All resources created via the API are subject to the pricing detailed on our [Pricing](https://supabase.com/pricing) pages.++## Additional links++- [OpenAPI Docs](https://api.supabase.com/api/v1)+- [OpenAPI Spec](https://api.supabase.com/api/v1-json)+- Reporting bugs and issues: [github.com/supabase/supabase](https://github.com/supabase/supabase)diff --git a/apps/temp-docs/_api/release-notes.md b/apps/temp-docs/_api/release-notes.mdnew file mode 100644index 00000000000..a6cd0060519--- /dev/null+++ b/apps/temp-docs/_api/release-notes.md@@ -0,0 +1,12 @@+---+id: release-notes+---++# Release Notes++## v1.0.0 {#1.0.0}++Adds the following routes:++- `/v1/organizations`: Manage Supabase organizations+- `/v1/projects`: Manage Supabase projectsdiff --git a/apps/temp-docs/_api/usage.mdx b/apps/temp-docs/_api/usage.mdxnew file mode 100644index 00000000000..09584d7a96b--- /dev/null+++ b/apps/temp-docs/_api/usage.mdx@@ -0,0 +1,1500 @@+---+id: usage+slug: /usage+title: Usage+toc_max_heading_level: 3+---++import Tabs from '@theme/Tabs';+import TabItem from '@theme/TabItem';+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++++## Organizations {#organizations}++Organization endpoints++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++### List all organizations {#list-all-organizations}++```+GET https://api.supabase.com/v1/organizations+```++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++#### Responses++<Tabs>++<TabItem value="200">++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++```json+{+ "schema": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ }+ },+ "required": [+ "id",+ "name"+ ]+ }+ }+}+```+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++<TabItem value="500">++Unexpected error listing organizations++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++</Tabs>++<br />+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++### Create an organization {#create-an-organization}++```+POST https://api.supabase.com/v1/organizations+```++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++#### Body Parameters++```json+{+ "schema": {+ "type": "object",+ "properties": {+ "name": {+ "type": "string"+ }+ },+ "required": [+ "name"+ ]+ }+}+```+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++#### Responses++<Tabs>++<TabItem value="201">++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++```json+{+ "schema": {+ "type": "object",+ "properties": {+ "id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ }+ },+ "required": [+ "id",+ "name"+ ]+ }+}+```+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++<TabItem value="500">++Unexpected error creating an organization++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++</Tabs>++<br />++++## Projects {#projects}++Project endpoints++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++### List all projects {#list-all-projects}++```+GET https://api.supabase.com/v1/projects+```++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++#### Responses++<Tabs>++<TabItem value="200">++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++```json+{+ "schema": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "id": {+ "type": "string"+ },+ "organization_id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "region": {+ "type": "string"+ },+ "created_at": {+ "type": "string"+ }+ },+ "required": [+ "id",+ "organization_id",+ "name",+ "region",+ "created_at"+ ]+ }+ }+}+```+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++</Tabs>++<br />+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++### Create a project {#create-a-project}++```+POST https://api.supabase.com/v1/projects+```++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++#### Body Parameters++```json+{+ "schema": {+ "type": "object",+ "properties": {+ "db_pass": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "organization_id": {+ "type": "string"+ },+ "plan": {+ "type": "string",+ "enum": [+ "free",+ "pro"+ ]+ },+ "region": {+ "type": "string",+ "enum": [+ "us-east-1",+ "us-west-1",+ "ap-southeast-1",+ "ap-northeast-1",+ "ap-northeast-2",+ "ap-southeast-2",+ "eu-west-1",+ "eu-west-2",+ "eu-central-1",+ "ca-central-1",+ "ap-south-1",+ "sa-east-1"+ ]+ },+ "kps_enabled": {+ "type": "boolean"+ }+ },+ "required": [+ "db_pass",+ "name",+ "organization_id",+ "plan",+ "region"+ ]+ }+}+```+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++#### Responses++<Tabs>++<TabItem value="201">++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++```json+{+ "schema": {+ "type": "object",+ "properties": {+ "id": {+ "type": "string"+ },+ "organization_id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "region": {+ "type": "string"+ },+ "created_at": {+ "type": "string"+ }+ },+ "required": [+ "id",+ "organization_id",+ "name",+ "region",+ "created_at"+ ]+ }+}+```+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++</Tabs>++<br />+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++### List all functions {#list-all-functions}++```+GET https://api.supabase.com/v1/projects/{ref}/functions+```++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++#### Path Parameters++<ul className="method-list-group">++<li className="method-list-item">+ <h4 className="method-list-item-label">+ <span className="method-list-item-label-name">+ ref+ </span>+ <span className="method-list-item-label-badge">+ required+ </span>+ <span className="method-list-item-validation">++ </span>+ </h4>++ <div class="method-list-item-description">+ Project ref+ </div>+</li>++</ul>++++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++#### Responses++<Tabs>++<TabItem value="200">++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++```json+{+ "schema": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "id": {+ "type": "string"+ },+ "slug": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "status": {+ "enum": [+ "ACTIVE",+ "REMOVED",+ "THROTTLED"+ ],+ "type": "string"+ },+ "version": {+ "type": "number"+ },+ "created_at": {+ "type": "number"+ },+ "updated_at": {+ "type": "number"+ },+ "verify_jwt": {+ "type": "boolean"+ }+ },+ "required": [+ "id",+ "slug",+ "name",+ "status",+ "version",+ "created_at",+ "updated_at"+ ]+ }+ }+}+```+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++<TabItem value="403">++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++<TabItem value="500">++Failed to retrieve project's functions++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++</Tabs>++<br />+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++### Create a function {#create-a-function}++```+POST https://api.supabase.com/v1/projects/{ref}/functions+```++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++#### Path Parameters++<ul className="method-list-group">++<li className="method-list-item">+ <h4 className="method-list-item-label">+ <span className="method-list-item-label-name">+ ref+ </span>+ <span className="method-list-item-label-badge">+ required+ </span>+ <span className="method-list-item-validation">++ </span>+ </h4>++ <div class="method-list-item-description">+ Project ref+ </div>+</li>++</ul>++++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++#### Body Parameters++```json+{+ "schema": {+ "type": "object",+ "properties": {+ "slug": {+ "type": "string",+ "pattern": "/^[A-Za-z0-9_-]+$/"+ },+ "name": {+ "type": "string"+ },+ "body": {+ "type": "string"+ },+ "verify_jwt": {+ "type": "boolean"+ }+ },+ "required": [+ "slug",+ "name",+ "body"+ ]+ }+}+```+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++#### Responses++<Tabs>++<TabItem value="201">++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++```json+{+ "schema": {+ "type": "object",+ "properties": {+ "id": {+ "type": "string"+ },+ "slug": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "status": {+ "enum": [+ "ACTIVE",+ "REMOVED",+ "THROTTLED"+ ],+ "type": "string"+ },+ "version": {+ "type": "number"+ },+ "created_at": {+ "type": "number"+ },+ "updated_at": {+ "type": "number"+ },+ "verify_jwt": {+ "type": "boolean"+ }+ },+ "required": [+ "id",+ "slug",+ "name",+ "status",+ "version",+ "created_at",+ "updated_at"+ ]+ }+}+```+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++<TabItem value="403">++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++<TabItem value="500">++Failed to create project's function++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++</Tabs>++<br />+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++### Retrieve a function {#retrieve-a-function}++```+GET https://api.supabase.com/v1/projects/{ref}/functions/{function_slug}+```++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++#### Path Parameters++<ul className="method-list-group">++<li className="method-list-item">+ <h4 className="method-list-item-label">+ <span className="method-list-item-label-name">+ ref+ </span>+ <span className="method-list-item-label-badge">+ required+ </span>+ <span className="method-list-item-validation">++ </span>+ </h4>++ <div class="method-list-item-description">+ Project ref+ </div>+</li>++<li className="method-list-item">+ <h4 className="method-list-item-label">+ <span className="method-list-item-label-name">+ function_slug+ </span>+ <span className="method-list-item-label-badge">+ required+ </span>+ <span className="method-list-item-validation">++ </span>+ </h4>++ <div class="method-list-item-description">+ Function slug+ </div>+</li>++</ul>++++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++#### Responses++<Tabs>++<TabItem value="200">++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++```json+{+ "schema": {+ "type": "object",+ "properties": {+ "id": {+ "type": "string"+ },+ "slug": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "status": {+ "enum": [+ "ACTIVE",+ "REMOVED",+ "THROTTLED"+ ],+ "type": "string"+ },+ "version": {+ "type": "number"+ },+ "created_at": {+ "type": "number"+ },+ "updated_at": {+ "type": "number"+ },+ "verify_jwt": {+ "type": "boolean"+ },+ "body": {+ "type": "string"+ }+ },+ "required": [+ "id",+ "slug",+ "name",+ "status",+ "version",+ "created_at",+ "updated_at"+ ]+ }+}+```+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++<TabItem value="403">++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++<TabItem value="500">++Failed to retrieve function with given slug++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++</Tabs>++<br />+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++### Update a function {#update-a-function}++```+PATCH https://api.supabase.com/v1/projects/{ref}/functions/{function_slug}+```++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++#### Path Parameters++<ul className="method-list-group">++<li className="method-list-item">+ <h4 className="method-list-item-label">+ <span className="method-list-item-label-name">+ ref+ </span>+ <span className="method-list-item-label-badge">+ required+ </span>+ <span className="method-list-item-validation">++ </span>+ </h4>++ <div class="method-list-item-description">+ Project ref+ </div>+</li>++<li className="method-list-item">+ <h4 className="method-list-item-label">+ <span className="method-list-item-label-name">+ function_slug+ </span>+ <span className="method-list-item-label-badge">+ required+ </span>+ <span className="method-list-item-validation">++ </span>+ </h4>++ <div class="method-list-item-description">+ Function slug+ </div>+</li>++</ul>++++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++#### Body Parameters++```json+{+ "schema": {+ "type": "object",+ "properties": {+ "name": {+ "type": "string"+ },+ "body": {+ "type": "string"+ },+ "verify_jwt": {+ "type": "boolean"+ }+ }+ }+}+```+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++#### Responses++<Tabs>++<TabItem value="200">++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++```json+{+ "schema": {+ "type": "object",+ "properties": {+ "id": {+ "type": "string"+ },+ "slug": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "status": {+ "enum": [+ "ACTIVE",+ "REMOVED",+ "THROTTLED"+ ],+ "type": "string"+ },+ "version": {+ "type": "number"+ },+ "created_at": {+ "type": "number"+ },+ "updated_at": {+ "type": "number"+ },+ "verify_jwt": {+ "type": "boolean"+ }+ },+ "required": [+ "id",+ "slug",+ "name",+ "status",+ "version",+ "created_at",+ "updated_at"+ ]+ }+}+```+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++<TabItem value="403">++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++<TabItem value="500">++Failed to update function with given slug++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++</Tabs>++<br />+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++### Delete a function {#delete-a-function}++```+DELETE https://api.supabase.com/v1/projects/{ref}/functions/{function_slug}+```++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++#### Path Parameters++<ul className="method-list-group">++<li className="method-list-item">+ <h4 className="method-list-item-label">+ <span className="method-list-item-label-name">+ ref+ </span>+ <span className="method-list-item-label-badge">+ required+ </span>+ <span className="method-list-item-validation">++ </span>+ </h4>++ <div class="method-list-item-description">+ Project ref+ </div>+</li>++<li className="method-list-item">+ <h4 className="method-list-item-label">+ <span className="method-list-item-label-name">+ function_slug+ </span>+ <span className="method-list-item-label-badge">+ required+ </span>+ <span className="method-list-item-validation">++ </span>+ </h4>++ <div class="method-list-item-description">+ Function slug+ </div>+</li>++</ul>++++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++#### Responses++<Tabs>++<TabItem value="200">++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++<TabItem value="403">++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++<TabItem value="500">++Failed to delete function with given slug++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++</Tabs>++<br />+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++### List all secrets {#list-all-secrets}++```+GET https://api.supabase.com/v1/projects/{ref}/secrets+```++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++#### Path Parameters++<ul className="method-list-group">++<li className="method-list-item">+ <h4 className="method-list-item-label">+ <span className="method-list-item-label-name">+ ref+ </span>+ <span className="method-list-item-label-badge">+ required+ </span>+ <span className="method-list-item-validation">++ </span>+ </h4>++ <div class="method-list-item-description">+ Project ref+ </div>+</li>++</ul>++++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++#### Responses++<Tabs>++<TabItem value="200">++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++```json+{+ "schema": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "name": {+ "type": "string"+ },+ "value": {+ "type": "string"+ }+ },+ "required": [+ "name",+ "value"+ ]+ }+ }+}+```+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++<TabItem value="403">++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++<TabItem value="500">++Failed to retrieve project's secrets++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++</Tabs>++<br />+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++### Bulk create secrets {#bulk-create-secrets}++```+POST https://api.supabase.com/v1/projects/{ref}/secrets+```++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++#### Path Parameters++<ul className="method-list-group">++<li className="method-list-item">+ <h4 className="method-list-item-label">+ <span className="method-list-item-label-name">+ ref+ </span>+ <span className="method-list-item-label-badge">+ required+ </span>+ <span className="method-list-item-validation">++ </span>+ </h4>++ <div class="method-list-item-description">+ Project ref+ </div>+</li>++</ul>++++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++#### Body Parameters++```json+{+ "schema": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "name": {+ "type": "string"+ },+ "value": {+ "type": "string",+ "pattern": "/^(?!SUPABASE_).*/"+ }+ },+ "required": [+ "name",+ "value"+ ]+ }+ }+}+```+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++#### Responses++<Tabs>++<TabItem value="201">++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++<TabItem value="403">++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++<TabItem value="500">++Failed to create project's secrets++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++</Tabs>++<br />+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++### Bulk delete secrets {#bulk-delete-secrets}++```+DELETE https://api.supabase.com/v1/projects/{ref}/secrets+```++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++#### Path Parameters++<ul className="method-list-group">++<li className="method-list-item">+ <h4 className="method-list-item-label">+ <span className="method-list-item-label-name">+ ref+ </span>+ <span className="method-list-item-label-badge">+ required+ </span>+ <span className="method-list-item-validation">++ </span>+ </h4>++ <div class="method-list-item-description">+ Project ref+ </div>+</li>++</ul>++++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++#### Body Parameters++```json+{+ "schema": {+ "type": "array",+ "items": {+ "type": "string"+ }+ }+}+```+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++#### Responses++<Tabs>++<TabItem value="200">++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++```json+{+ "schema": {+ "type": "object"+ }+}+```+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++<TabItem value="403">++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++<TabItem value="500">++Failed to delete secrets with given names++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>++</Tabs>++<br />+diff --git a/apps/temp-docs/_api_versioned_docs/.gitkeep b/apps/temp-docs/_api_versioned_docs/.gitkeepnew file mode 100644index 00000000000..e69de29bb2ddiff --git a/apps/temp-docs/_api_versioned_sidebars/.gitkeep b/apps/temp-docs/_api_versioned_sidebars/.gitkeepnew file mode 100644index 00000000000..e69de29bb2ddiff --git a/apps/temp-docs/_api_versions.json b/apps/temp-docs/_api_versions.jsonnew file mode 100644index 00000000000..fe51488c706--- /dev/null+++ b/apps/temp-docs/_api_versions.json@@ -0,0 +1 @@+[]diff --git a/apps/temp-docs/_cli/intro.mdx b/apps/temp-docs/_cli/intro.mdxnew file mode 100644index 00000000000..8ac2186ca6e--- /dev/null+++ b/apps/temp-docs/_cli/intro.mdx@@ -0,0 +1,29 @@+---+id: intro+slug: /+sidebar_position: 1+sidebar_label: Supabase CLI+hide_table_of_contents: true+---++# Supabase CLI++The Supabase CLI provides tools to develop your project locally and deploy to the Supabase Platform.+The CLI is still under development, but it contains all the functionality for working with your Supabase projects and the Supabase Platform.++- Run Supabase locally: [`supabase start`](https://supabase.com/docs/reference/cli/usage#supabase-start)+- Manage database migrations: [`supabase migration`](https://supabase.com/docs/reference/cli/usage#supabase-migration)+- CI/CD for releasing to production: [`supabase db push`](https://supabase.com/docs/reference/cli/usage#supabase-db-push)+- Manage your Supabase projects: [`supabase projects`](https://supabase.com/docs/reference/cli/usage#supabase-projects)+- Generate types directly from your database schema: [`supabase gen types`](https://supabase.com/docs/reference/cli/usage#supabase-gen)+ - A [community-supported GitHub Action](https://github.com/lyqht/generate-supabase-db-types-github-action) to generate TypeScript types+- Shell autocomplete: [`supabase completion`](https://supabase.com/docs/reference/cli/usage#supabase-completion)+ - A [community-supported Fig autocomplete spec](https://fig.io/manual/supabase) for macOS terminal++## Additional Links++- [Install the Supabase CLI](/docs/guides/cli)+- [Source code](https://github.com/supabase/cli)+- [Known bugs and issues](https://github.com/supabase/cli/issues)+- [Supabase CLI v1 and Admin API Beta](https://supabase.com/blog/supabase-cli-v1-and-admin-api-beta)+- [The CLI team announcing CLI V1 and Admin API Beta - Video](https://www.youtube.com/watch?v=OpPOaJI_Z28)diff --git a/apps/temp-docs/_cli/release-notes.mdx b/apps/temp-docs/_cli/release-notes.mdxnew file mode 100644index 00000000000..e10337f8d04--- /dev/null+++ b/apps/temp-docs/_cli/release-notes.mdx@@ -0,0 +1,7 @@+---+id: release-notes+---++# Release Notes++All release notes can be found in the [GitHub Releases page](https://github.com/supabase/cli/releases).diff --git a/apps/temp-docs/_cli_versioned_docs/.gitkeep b/apps/temp-docs/_cli_versioned_docs/.gitkeepnew file mode 100644index 00000000000..e69de29bb2ddiff --git a/apps/temp-docs/_cli_versioned_sidebars/.gitkeep b/apps/temp-docs/_cli_versioned_sidebars/.gitkeepnew file mode 100644index 00000000000..e69de29bb2ddiff --git a/apps/temp-docs/_cli_versions.json b/apps/temp-docs/_cli_versions.jsonnew file mode 100644index 00000000000..fe51488c706--- /dev/null+++ b/apps/temp-docs/_cli_versions.json@@ -0,0 +1 @@+[]diff --git a/apps/temp-docs/_gotrue/config.mdx b/apps/temp-docs/_gotrue/config.mdxnew file mode 100644index 00000000000..9a00a5a380e--- /dev/null+++ b/apps/temp-docs/_gotrue/config.mdx@@ -0,0 +1,35 @@+---+id: config+slug: /config+title: Configuration+toc_max_heading_level: 3+---++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY -->++A `config.toml` file is generated after running `supabase init`.++This file is located in the `supabase` folder under `supabase/config.toml`.+++++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY -->++## General {#general}++++### `project_id` {#project_id}++A string used to distinguish different Supabase projects on the same host. Defaults to the working directory name when running `supabase init`.+++<ul>+<li>Required: <code>true</code></li>+<li>Default: <code>None</code></li>+</ul>++<br />++diff --git a/apps/temp-docs/_gotrue/intro.mdx b/apps/temp-docs/_gotrue/intro.mdxnew file mode 100644index 00000000000..cb9a386f235--- /dev/null+++ b/apps/temp-docs/_gotrue/intro.mdx@@ -0,0 +1,22 @@+---+slug: /+sidebar_position: 1+sidebar_label: Auth Server+---++# Supabase Auth Server++The Supabase Auth Server (GoTrue) is a JSON Web Token (JWT)-based API for managing users and issuing access tokens.++GoTrue is an open-source API written in Golang, that acts as a self-standing API service for handling user registration and authentication for JAM projects. It's based on OAuth2 and JWT and handles user signup, authentication, and custom user data.++## Client libraries++- [JavaScript](https://github.com/supabase/gotrue-js)+- [Dart](https://github.com/supabase/gotrue-dart)++## Additional Links++- [Source Code](https://github.com/supabase/gotrue)+- [Known bugs and issues](https://github.com/supabase/gotrue/issues)+- [Auth Guides](https://supabase.com/docs/guides/auth)diff --git a/apps/temp-docs/_gotrue/release-notes.mdx b/apps/temp-docs/_gotrue/release-notes.mdxnew file mode 100644index 00000000000..cb164542845--- /dev/null+++ b/apps/temp-docs/_gotrue/release-notes.mdx@@ -0,0 +1,7 @@+---+id: release-notes+---++# Release Notes++All release notes can be found in the [GitHub Releases](https://github.com/supabase/gotrue/releases) page.diff --git a/apps/temp-docs/_gotrue/usage.mdx b/apps/temp-docs/_gotrue/usage.mdxnew file mode 100644index 00000000000..64eed5538f0--- /dev/null+++ b/apps/temp-docs/_gotrue/usage.mdx@@ -0,0 +1,18 @@+---+id: usage+slug: /usage+title: Usage+toc_max_heading_level: 3+---++import Tabs from '@theme/Tabs';+import TabItem from '@theme/TabItem';+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++Documentation of the gotrue API.++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++diff --git a/apps/temp-docs/_gotrue_versioned_docs/.gitkeep b/apps/temp-docs/_gotrue_versioned_docs/.gitkeepnew file mode 100644index 00000000000..e69de29bb2ddiff --git a/apps/temp-docs/_gotrue_versioned_sidebars/.gitkeep b/apps/temp-docs/_gotrue_versioned_sidebars/.gitkeepnew file mode 100644index 00000000000..e69de29bb2ddiff --git a/apps/temp-docs/_gotrue_versions.json b/apps/temp-docs/_gotrue_versions.jsonnew file mode 100644index 00000000000..fe51488c706--- /dev/null+++ b/apps/temp-docs/_gotrue_versions.json@@ -0,0 +1 @@+[]diff --git a/apps/temp-docs/_storage/intro.mdx b/apps/temp-docs/_storage/intro.mdxnew file mode 100644index 00000000000..4c038f6c7aa--- /dev/null+++ b/apps/temp-docs/_storage/intro.mdx@@ -0,0 +1,28 @@+---+slug: /+sidebar_position: 1+sidebar_label: Storage Server+---++# Supabase Storage Server++An S3 compatible object storage service that integrates with Postgres.++- Uses Postgres as it's datastore for storing metadata+- Authorization rules are written as Postgres Row Level Security policies+- Integrates with S3 as the storage backend (with more in the pipeline!)+- Extremely lightweight and performant++Read [this post](https://supabase.com/blog/supabase-storage) on why we decided to build a new object storage service.++## Client libraries++- [JavaScript](https://github.com/supabase/storage-js)+- [Dart](https://github.com/supabase/storage-dart)++## Additional Links++- [Source Code](https://github.com/supabase/storage-api)+- [Known bugs and issues](https://github.com/supabase/storage-js/issues)+- [Storage Guides](https://supabase.com/docs/guides/storage)+- [OpenAPI Docs](https://supabase.github.io/storage-api/)diff --git a/apps/temp-docs/_storage/release-notes.mdx b/apps/temp-docs/_storage/release-notes.mdxnew file mode 100644index 00000000000..8dad269f0d9--- /dev/null+++ b/apps/temp-docs/_storage/release-notes.mdx@@ -0,0 +1,7 @@+---+id: release-notes+---++# Release Notes++All release notes can be found in the [GitHub Releases](https://github.com/supabase/storage-api/releases) page.diff --git a/apps/temp-docs/_storage_versioned_docs/.gitkeep b/apps/temp-docs/_storage_versioned_docs/.gitkeepnew file mode 100644index 00000000000..e69de29bb2ddiff --git a/apps/temp-docs/_storage_versioned_sidebars/.gitkeep b/apps/temp-docs/_storage_versioned_sidebars/.gitkeepnew file mode 100644index 00000000000..e69de29bb2ddiff --git a/apps/temp-docs/_storage_versions.json b/apps/temp-docs/_storage_versions.jsonnew file mode 100644index 00000000000..fe51488c706--- /dev/null+++ b/apps/temp-docs/_storage_versions.json@@ -0,0 +1 @@+[]diff --git a/apps/temp-docs/_supabase_dart/initializing.mdx b/apps/temp-docs/_supabase_dart/initializing.mdxnew file mode 100644index 00000000000..b0d69813f45--- /dev/null+++ b/apps/temp-docs/_supabase_dart/initializing.mdx@@ -0,0 +1,43 @@+---+id: initializing+title: 'Initializing'+slug: initializing+---++import Tabs from '@theme/Tabs'+import TabItem from '@theme/TabItem'++## Flutter++For `supabase-flutter`, you will be using the static `initialize()` method on `Supabase` class.++### Flutter `initialize()`++```dart title="main.dart"+Future<void> main() async {+ await Supabase.initialize(url: 'https://xyzcompany.supabase.co', anonKey: 'public-anon-key');+ runApp(MyApp());+}+```++### Access `SupabaseClient` instance++Once you initialize Supabase in your `main()` method, you can access the `SupabaseClient` instance from anywhere in your app.++```dart+final supabase = Supabase.instance.client;+```++## Other Dart Projects++You can initialize a new Supabase client using the `SupabaseClient()` method.++The Supabase client is your entrypoint to the rest of the Supabase functionality+and is the easiest way to interact with everything we offer within the Supabase ecosystem.++### Dart `SupabaseClient()`++```dart+final supabase = SupabaseClient('https://xyzcompany.supabase.co', 'public-anon-key');+```+diff --git a/apps/temp-docs/_supabase_dart/installing.mdx b/apps/temp-docs/_supabase_dart/installing.mdxnew file mode 100644index 00000000000..8c49c1fd9f7--- /dev/null+++ b/apps/temp-docs/_supabase_dart/installing.mdx@@ -0,0 +1,24 @@+---+id: installing+title: 'Installing'+slug: installing+---++import Tabs from '@theme/Tabs'+import TabItem from '@theme/TabItem'++## Flutter++For Flutter project, you can use [supabase_flutter](https://pub.dev/packages/supabase_flutter) package.++```bash+flutter pub add supabase_flutter+```++## Other Dart projects++For non-Flutter projects using Dart, such as server-side Dart or Angular-Dart, you can use the [supabase](https://pub.dev/packages/supabase) package.++```bash+dart pub add supabase+```\ No newline at end of filediff --git a/apps/temp-docs/_supabase_dart/intro.mdx b/apps/temp-docs/_supabase_dart/intro.mdxnew file mode 100644index 00000000000..d728b447d2e--- /dev/null+++ b/apps/temp-docs/_supabase_dart/intro.mdx@@ -0,0 +1,27 @@+---+id: intro+slug: /+sidebar_label: Supabase Flutter Library+---++# Supabase Flutter Library++This reference documents every object and method available in Supabase's isomorphic Flutter library, [`supabase-flutter`](https://pub.dev/packages/supabase_flutter).++You can use the `supabase-flutter` library to:++- interact with your Postgres database+- listen to database changes+- invoke Deno Edge Functions+- build login and user management functionality+- manage large files++## For non-Flutter projects++We also have [supabase-dart](https://github.com/supabase-community/supabase-dart) for non-Flutter Dart projects, such as server-side Dart or Angular-Dart.+supabase-dart shares most of the APIs with supabase-flutter without being dependent on Flutter so that you can use Supabase anywhere you can run Dart!++## Additional Links++- Source Code: [github.com/supabase/supabase-flutter](https://github.com/supabase/supabase-flutter)+- [Known bugs and issues](https://github.com/supabase/supabase-flutter/issues)diff --git a/apps/temp-docs/_supabase_dart_versioned_docs/version-v0/intro.mdx b/apps/temp-docs/_supabase_dart_versioned_docs/version-v0/intro.mdxnew file mode 100644index 00000000000..ed80828fa05--- /dev/null+++ b/apps/temp-docs/_supabase_dart_versioned_docs/version-v0/intro.mdx@@ -0,0 +1,27 @@+---+id: intro+slug: /+sidebar_label: Supabase Dart Library+---++# Supabase Dart Library++:::caution+You're viewing the docs for an older version of the `supabase-flutter` library.+:::+++This reference documents every object and method available in Supabase's isomorphic Dart library, `supabase-dart`.++You can use the `supabase-dart` library to:++- interact with your Postgres database+- listen to database changes+- invoke Deno Edge Functions+- build login and user management functionality+- manage large files++## Additional Links++- Source Code: [github.com/supabase/supabase-dart](https://github.com/supabase/supabase-dart)+- [Known bugs and issues](https://github.com/supabase/supabase-dart/issues)diff --git a/apps/temp-docs/_supabase_dart_versioned_sidebars/version-v0-sidebars.json b/apps/temp-docs/_supabase_dart_versioned_sidebars/version-v0-sidebars.jsonnew file mode 100644index 00000000000..44acc0181ad--- /dev/null+++ b/apps/temp-docs/_supabase_dart_versioned_sidebars/version-v0-sidebars.json@@ -0,0 +1,120 @@+{+ "sidebar": [+ {+ "type": "category",+ "label": "Getting Started",+ "items": ["intro", "generated/installing", "generated/initializing"],+ "collapsed": true+ },+ {+ "type": "category",+ "label": "Auth",+ "items": [+ "generated/auth-signup",+ "generated/auth-signin",+ "generated/auth-signinwithprovider",+ "generated/auth-signout",+ "generated/auth-session",+ "generated/auth-user",+ "generated/auth-update",+ "generated/auth-onauthstatechange",+ "generated/reset-password-email"+ ],+ "collapsed": true+ },+ {+ "type": "category",+ "label": "Functions",+ "items": ["generated/invoke"],+ "collapsed": true+ },+ {+ "type": "category",+ "label": "Database",+ "items": [+ "generated/select",+ "generated/insert",+ "generated/update",+ "generated/upsert",+ "generated/delete",+ "generated/rpc"+ ],+ "collapsed": true+ },+ {+ "type": "category",+ "label": "Realtime",+ "items": [+ "generated/subscribe",+ "generated/removesubscription",+ "generated/getsubscriptions",+ "generated/stream"+ ],+ "collapsed": true+ },+ {+ "type": "category",+ "label": "Storage",+ "items": [+ "generated/storage-createbucket",+ "generated/storage-getbucket",+ "generated/storage-listbuckets",+ "generated/storage-updatebucket",+ "generated/storage-deletebucket",+ "generated/storage-emptybucket",+ "generated/storage-from-upload",+ "generated/storage-from-download",+ "generated/storage-from-list",+ "generated/storage-from-update",+ "generated/storage-from-move",+ "generated/storage-from-remove",+ "generated/storage-from-createsignedurl",+ "generated/storage-from-getpublicurl"+ ],+ "collapsed": true+ },+ {+ "type": "category",+ "label": "Modifiers",+ "items": [+ "generated/using-modifiers",+ "generated/limit",+ "generated/order",+ "generated/range",+ "generated/single"+ ],+ "collapsed": true+ },+ {+ "type": "category",+ "label": "Filters",+ "items": [+ "generated/using-filters",+ "generated/or",+ "generated/not",+ "generated/match",+ "generated/eq",+ "generated/neq",+ "generated/gt",+ "generated/gte",+ "generated/lt",+ "generated/lte",+ "generated/like",+ "generated/ilike",+ "generated/is_",+ "generated/in_",+ "generated/contains",+ "generated/containedby",+ "generated/rangelt",+ "generated/rangegt",+ "generated/rangegte",+ "generated/rangelte",+ "generated/rangeadjacent",+ "generated/overlaps",+ "generated/textsearch",+ "generated/filter"+ ],+ "collapsed": true+ }+ ]+}diff --git a/apps/temp-docs/_supabase_dart_versions.json b/apps/temp-docs/_supabase_dart_versions.jsonnew file mode 100644index 00000000000..574c045ecaf--- /dev/null+++ b/apps/temp-docs/_supabase_dart_versions.json@@ -0,0 +1 @@+["v0"]diff --git a/apps/temp-docs/_supabase_js/installing.mdx b/apps/temp-docs/_supabase_js/installing.mdxnew file mode 100644index 00000000000..96b254beca2--- /dev/null+++ b/apps/temp-docs/_supabase_js/installing.mdx@@ -0,0 +1,37 @@+---+id: installing+title: 'Installing'+slug: installing+custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml+---++import Tabs from '@theme/Tabs'+import TabItem from '@theme/TabItem'++All JavaScript libraries are built directly by the Supabase team.++Other languages are built by the community and supported by Supabase.++## JavaScript++Via NPM++```bash+npm install @supabase/supabase-js+```++Via Yarn++```bash+yarn add @supabase/supabase-js+```++Find the source code on [GitHub](https://github.com/supabase/supabase-js).++Or via CDN++```js+<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>+//or+<script src="https://unpkg.com/@supabase/supabase-js@2"></script>+```diff --git a/apps/temp-docs/_supabase_js/intro.md b/apps/temp-docs/_supabase_js/intro.mdnew file mode 100644index 00000000000..bec6b4f975e--- /dev/null+++ b/apps/temp-docs/_supabase_js/intro.md@@ -0,0 +1,25 @@+---+slug: /+sidebar_position: 1+sidebar_label: Supabase JavaScript Library+hide_table_of_contents: true+---++# Supabase JavaScript Library++This reference documents every object and method available in Supabase's isomorphic JavaScript library, `supabase-js`.++You can use the `supabase-js` library to:++- interact with your Postgres database+- listen to database changes+- invoke Deno Edge Functions+- build login and user management functionality+- manage large files++## Additional Links++- Source Code: [github.com/supabase/supabase-js](https://github.com/supabase/supabase-js)+- TypeDoc: [supabase.github.io/supabase-js](https://supabase.github.io/supabase-js/v2/)+- NPM: [npmjs.com/package/@supabase/supabase-js](https://www.npmjs.com/package/@supabase/supabase-js)+- [Known bugs and issues](https://github.com/supabase/supabase-js/issues)diff --git a/apps/temp-docs/_supabase_js/release-notes.md b/apps/temp-docs/_supabase_js/release-notes.mdnew file mode 100644index 00000000000..d77cf283abc--- /dev/null+++ b/apps/temp-docs/_supabase_js/release-notes.md@@ -0,0 +1,213 @@+---+id: release-notes+---++# Release Notes++Supabase.js v2 release notes.++## 2.0.0++Install the latest with `npm install @supabase/supabase-js`.++### Explicit constructor options++All client specific options within the constructor are keyed to the library: [PR](https://github.com/supabase/supabase-js/pull/458):++```jsx+const supabase = createClient(apiURL, apiKey, {+ db: {+ schema: 'public',+ },+ auth: {+ storage: AsyncStorage,+ autoRefreshToken: true,+ persistSession: true,+ detectSessionInUrl: true,+ },+ realtime: {+ channels,+ endpoint,+ },+ global: {+ fetch: customFetch,+ headers: DEFAULT_HEADERS,+ },+})+```++### Typescript support++The libraries now support typescript.++```ts+// v2 - definitions are injected in `createClient()`+import type { Database } from './DatabaseDefinitions'+const supabase = createClient<Database>(SUPABASE_URL, ANON_KEY)+const { data } = await supabase.from('messages').select().match({ id: 1 })++// v1 -- previously definitions were injected in the `from()` method+supabase.from<Definitions['Message']>('messages').select('*')+```++Types can be generated via the CLI:++```bash+supabase start+supabase gen types typescript --local > DatabaseDefinitions.ts+```++### Data operations return minimal++`.insert()` / `.upsert()` / `.update()` / `.delete()` don't return rows by default: [PR](https://github.com/supabase/postgrest-js/pull/276).++Previously, these methods return inserted/updated/deleted rows by default (which caused [some confusion](https://github.com/supabase/supabase/discussions/1548)), and you can opt to not return it by specifying `returning: 'minimal'`. Now the default behavior is to not return rows. To return inserted/updated/deleted rows, add a `.select()` call at the end, e.g.:++```sql+const { data, error } = await supabase+ .from('my_table')+ .delete()+ .eq('id', 1)+ .select()+```++### New ordering defaults++`.order()` now defaults to Postgres’s default: [PR](https://github.com/supabase/postgrest-js/pull/283).++Previously `nullsFirst` defaults to `false` , meaning `null`s are ordered last. This is bad for performance if e.g. the column uses an index with `NULLS FIRST` (which is the default direction for indexes).++### Cookies and localstorage namespace++Storage key name in the Auth library has changed to include project reference which means that existing websites that had their JWT expiry set to a longer time could find their users logged out with this upgrade.++```jsx+const defaultStorageKey = `sb-${+ new URL(this.authUrl).hostname.split('.')[0]+}-auth-token`+```++### New Auth Types++Typescript typings have been reworked. `Session` interface now guarantees that it will always have an `access_token`, `refresh_token` and `user`++```jsx+interface Session {+ provider_token?: string | null+ access_token: string+ expires_in?: number+ expires_at?: number+ refresh_token: string+ token_type: string+ user: User+}+```++### New Auth methods++We're removing the `signIn()` method in favor of more explicit function signatures:+`signInWithPassword()`, `signInWithPasswordless()`, and `signInWithOtp()`.++```ts+// v2+const { data } = await supabase.auth.signInWithPassword({+ email: 'hello@example',+ password: 'pass',+})+// v1+const { data } = await supabase.auth.signIn({+ email: 'hello@example',+ password: 'pass',+})+```++### New Realtime methods++There is a new `channel()` method in the Realtime library, which will be used for our Multiplayer updates.++```ts+supabaseClient+ .channel('any_string_you_want')+ .on('presence', { event: 'track' }, (payload) => {+ console.log(payload)+ })+ .subscribe()++supabaseClient+ .channel('any_string_you_want')+ .on(+ 'postgres_changes',+ {+ event: 'INSERT',+ schema: 'public',+ table: 'movies',+ },+ (payload) => {+ console.log(payload)+ }+ )+ .subscribe()+```++We will deprecate the `.from().on().subscribe()` method previosuly used for listening to postgres changes.++### Deprecated setAuth()++Deprecated and removed `setAuth()` . To set a custom `access_token` jwt instead, pass the custom header into the `createClient()` method provided: ([PR](https://github.com/supabase/gotrue-js/pull/340))++### All changes++- `supabase-js`+ - `shouldThrowOnError` has been removed until all the client libraries support this option ([PR](https://github.com/supabase/supabase-js/pull/490)).+- `postgrest-js`+ - TypeScript typings have been reworked [PR](https://github.com/supabase/postgrest-js/pull/279)+ - Use `undefined` instead of `null` for function params, types, etc. (https://github.com/supabase/postgrest-js/pull/278)+ - Some features are now obsolete: (https://github.com/supabase/postgrest-js/pull/275)+ - filter shorthands (e.g. `cs` vs. `contains`)+ - `body` in response (vs. `data`)+ - `upsert`ing through the `.insert()` method+ - `auth` method on `PostgrestClient`+ - client-level `throwOnError`+- `gotrue-js`+ - `supabase-js` client allows passing a `storageKey` param which will allow the user to set the key used in local storage for storing the session. By default, this will be namespace-d with the supabase project ref. ([PR](https://github.com/supabase/supabase-js/pull/460))+ - `signIn` method is now split into `signInWithPassword` , `signInWithPasswordless` , `signInWithOAuth` ([PR](https://github.com/supabase/gotrue-js/pull/304))+ - Deprecated and removed `session()` , `user()` in favour of using `getSession()` instead. `getSession()` will always return a valid session if a user is already logged in, meaning no more random logouts. ([PR](https://github.com/supabase/gotrue-js/pull/299))+ - Deprecated and removed setting for `multitab` support because `getSession()` and gotrue’s reuse interval setting takes care of session management across multiple tabs ([PR](https://github.com/supabase/gotrue-js/pull/366))+ - No more throwing of random errors, gotrue-js v2 always returns a custom error type: ([PR](https://github.com/supabase/gotrue-js/pull/341))+ - `AuthSessionMissingError`+ - Indicates that a session is expected but missing+ - `AuthNoCookieError`+ - Indicates that a cookie is expected but missing+ - `AuthInvalidCredentialsError`+ - Indicates that the incorrect credentials were passed+ - Renamed the `api` namespace to `admin` , the `admin` namespace will only contain methods that should only be used in a trusted server-side environment with the service role key+ - Moved `resetPasswordForEmail` , `getUser` and `updateUser` to the `GoTrueClient` which means they will be accessible from the `supabase.auth` namespace in `supabase-js` instead of having to do `supabase.auth.api` to access them+ - Removed `sendMobileOTP` , `sendMagicLinkEmail` in favor of `signInWithOtp`+ - Removed `signInWithEmail`, `signInWithPhone` in favor of `signInWithPassword`+ - Removed `signUpWithEmail` , `signUpWithPhone` in favor of `signUp`+ - Replaced `update` with `updateUser`+- `storage-js`+ - Return types are more strict. Functions types used to indicate that the data returned could be null even if there was no error. We now make use of union types which only mark the data as null if there is an error and vice versa. ([PR](https://github.com/supabase/storage-js/pull/60))+ - The `upload` and `update` function returns the path of the object uploaded as the `path` parameter. Previously the returned value had the bucket name prepended to the path which made it harder to pass the value on to other storage-js methods since all methods take the bucket name and path separately. We also chose to call the returned value `path` instead of `Key` ([PR](https://github.com/supabase/storage-js/pull/75))+ - `getPublicURL` only returns the public URL inside the data object. This keeps it consistent with our other methods of returning only within the data object. No error is returned since this method cannot does not throw an error ([PR](https://github.com/supabase/storage-js/pull/93))+ - signed urls are returned as `signedUrl` instead of `signedURL` in both `createSignedUrl` and `createSignedUrls` ([PR](https://github.com/supabase/storage-js/pull/94))+ - Encodes URLs returned by `createSignedUrl`, `createSignedUrls` and `getPublicUrl` ([PR](https://github.com/supabase/storage-js/pull/86))+ - `createsignedUrl` used to return a url directly and and within the data object. This was inconsistent. Now we always return values only inside the data object across all methods. ([PR](https://www.notion.so/LW5-supabase-js-v2-7b0bfcdf571d4f20b9b7a9308883f24b))+ - `createBucket` returns a data object instead of the name of the bucket directly. ([PR](https://github.com/supabase/storage-js/pull/89))+ - Fixed types for metadata ([PR](https://github.com/supabase/storage-js/pull/90))+ - Better error types make it easier to track down what went wrong quicker.+ - `SupabaseStorageClient` is no longer exported. Use `StorageClient` instead. ([PR](https://github.com/supabase/storage-js/pull/92)).+- `realtime-js`+ - `RealtimeSubscription` class no longer exists and replaced by `RealtimeChannel`.+ - `RealtimeClient`'s `disconnect` method now returns type of `void` . It used to return type of `Promise<{ error: Error | null; data: boolean }`.+ - Removed `removeAllSubscriptions` and `removeSubscription` methods from `SupabaseClient` class.+ - Removed `SupabaseRealtimeClient` class.+ - Removed `SupabaseQueryBuilder` class.+ - Removed `SupabaseEventTypes` type.+ - Thinking about renaming this to something like `RealtimePostgresChangeEvents` and moving it to `realtime-js` v2.+ - Removed `.from(’table’).on(’INSERT’, () ⇒ {}).subscribe()` in favor of new Realtime client API.+- `functions-js`+ - supabase-js v1 only threw an error if the fetch call itself threw an error (network errors, etc) and not if the function returned HTTP errors like 400s or 500s. We have changed this behaviour to return an error if your function throws an error.+ - We have introduced new error types to distinguish between different kinds of errors. A `FunctionsHttpError` error is returned if your function throws an error, `FunctionsRelayError` if the Supabase Relay has an error processing your function and `FunctionsFetchError` if there is a network error in calling your function.+ - The correct content-type headers are automatically attached when sending the request if you don’t pass in a `Content-Type` header and pass in an argument to your function. We automatically attach the content type for `Blob`, `ArrayBuffer`, `File`, `FormData` ,`String` . If it doesn’t match any of these we assume the payload is `json` , we serialise the payload as JSON and attach the content type as `application/json`.+ - `responseType` does not need to be explicitly passed in. We parse the response based on the `Content-Type` response header sent by the function. We support parsing the responses as `text`, `json`, `blob`, `form-data` and are parsed as `text` by default.diff --git a/apps/temp-docs/_supabase_js/upgrade-guide.mdx b/apps/temp-docs/_supabase_js/upgrade-guide.mdxnew file mode 100644index 00000000000..c66a896e9ba--- /dev/null+++ b/apps/temp-docs/_supabase_js/upgrade-guide.mdx@@ -0,0 +1,414 @@+---+id: upgrade-guide+title: Upgrade to supabase-js v2+description: 'Learn how to upgrade to supabase-js v2.'+---++import Tabs from '@theme/Tabs'+import TabItem from '@theme/TabItem'++supabase-js v2 focuses on "quality-of-life" improvements for developers and addresses some of the largest pain points in v1. v2 includes type support, a rebuilt Auth library with async methods, improved errors, and more.++No new features will be added to supabase-js v1 , but we'll continuing merging security fixes to v1, with maintenance patches for the next 3 months.++## Upgrade the client library+++```sh+npm install @supabase/supabase-js@2+```++*Optionally* if you are using custom configuration with `createClient` then follow below:++<Tabs+ groupId="version"+ values={[+ {label: 'Before', value: '1.x'},+ {label: 'After', value: '2.x'},+ ]}>++<TabItem value="1.x">++```ts title="src/supabaseClient.ts"+const supabaseClient = createClient(SUPABASE_URL, SUPABASE_ANON_KEY, {+ schema: 'custom',+ persistSession: false+})+```+</TabItem>++<TabItem value="2.x">++```ts title="src/supabaseClient.ts"+const supabaseClient = createClient(SUPABASE_URL, SUPABASE_ANON_KEY, {+ db: {+ schema: 'custom'+ },+ auth: {+ persistSession: true+ }+})+```+</TabItem>+</Tabs>++Read more about the [constructor options](/docs/reference/javascript/release-notes#explicit-constructor-options).++### Auth methods++The signIn() method has been deprecated in favor of more explicit method signatures to help with type hinting. Previously it was difficult for developers to know what they were missing (e.g., a lot of developers didn't realize they could use passwordless magic links).++#### Sign in with email and password+<Tabs+ groupId="version"+ values={[+ {label: 'Before', value: '1.x'},+ {label: 'After', value: '2.x'},+ ]}>++<TabItem value="1.x">++```ts+const { user, error } = await supabase.auth.signIn({ email, password })+```+</TabItem>++<TabItem value="2.x">++```ts+const { data: { user }, error } = await supabase.auth.signInWithPassword({ email, password })+```+</TabItem>+</Tabs>++#### Sign in with magic link+<Tabs+ groupId="version"+ values={[+ {label: 'Before', value: '1.x'},+ {label: 'After', value: '2.x'},+ ]}>++<TabItem value="1.x">++```ts+const { error } = await supabase.auth.signIn({ email })+```+</TabItem>++<TabItem value="2.x">++```ts+const { error } = await supabase.auth.signInWithOtp({ email })+```+</TabItem>+</Tabs>++#### Sign in with a third-party provider+<Tabs+ groupId="version"+ values={[+ {label: 'Before', value: '1.x'},+ {label: 'After', value: '2.x'},+ ]}>++<TabItem value="1.x">++```ts+const { error } = await supabase.auth.signIn({ provider })+```+</TabItem>++<TabItem value="2.x">++```ts+const { error } = await supabase.auth.signInWithOAuth({ provider })+```+</TabItem>+</Tabs>++#### Sign in with phone+<Tabs+ groupId="version"+ values={[+ {label: 'Before', value: '1.x'},+ {label: 'After', value: '2.x'},+ ]}>++<TabItem value="1.x">++```ts+const { error } = await supabase.auth.signIn({ phone, password })+```+</TabItem>++<TabItem value="2.x">++```ts+const { error } = await supabase.auth.signInWithPassword({ phone, password })+```+</TabItem>+</Tabs>++#### Sign in with phone using OTP+<Tabs+ groupId="version"+ values={[+ {label: 'Before', value: '1.x'},+ {label: 'After', value: '2.x'},+ ]}>++<TabItem value="1.x">++```ts+const { error } = await supabase.auth.api.sendMobileOTP(phone)+```+</TabItem>++<TabItem value="2.x">++```ts+const { data, error } = await supabase.auth.signInWithOtp({ phone })++// After receiving a SMS with a OTP.+const { data, error } = await supabase.auth.verifyOtp({ phone, token })+```+</TabItem>+</Tabs>++#### Reset password for email+<Tabs+ groupId="version"+ values={[+ {label: 'Before', value: '1.x'},+ {label: 'After', value: '2.x'},+ ]}>++<TabItem value="1.x">++```ts+const { data, error } = await supabase.auth.api.resetPasswordForEmail(email)+```+</TabItem>++<TabItem value="2.x">++```ts+const { data, error } = await supabase.auth.resetPasswordForEmail(email)+```+</TabItem>+</Tabs>++#### Get the user's current session+<Tabs+ groupId="version"+ values={[+ {label: 'Before', value: '1.x'},+ {label: 'After', value: '2.x'},+ ]}>++<TabItem value="1.x">++```ts+const session = supabase.auth.session()+```+</TabItem>++<TabItem value="2.x">++```ts+const { data: { session } } = await supabase.auth.getSession()+```+</TabItem>+</Tabs>++#### Get the logged-in user+<Tabs+ groupId="version"+ values={[+ {label: 'Before', value: '1.x'},+ {label: 'After', value: '2.x'},+ ]}>++<TabItem value="1.x">++```ts+const user = supabase.auth.user()+```+</TabItem>++<TabItem value="2.x">++```ts+const { data: { session } } = await supabase.auth.getSession()+const { user } = session+```+</TabItem>+</Tabs>++#### Update user data for a logged-in user+<Tabs+ groupId="version"+ values={[+ {label: 'Before', value: '1.x'},+ {label: 'After', value: '2.x'},+ ]}>++<TabItem value="1.x">++```ts+const { user, error } = await supabase.auth.update({ attributes })+```+</TabItem>++<TabItem value="2.x">++```ts+const { data: { user }, error } = await supabase.auth.updateUser({ attributes })+```+</TabItem>+</Tabs>++#### Use a custom `access_token` JWT with Supabase++<Tabs+ groupId="version"+ values={[+ {label: 'Before', value: '1.x'},+ {label: 'After', value: '2.x'},+ ]}>++<TabItem value="1.x">++```ts+const { user, error } = supabase.auth.setAuth(access_token)+```+</TabItem>++<TabItem value="2.x">++```ts+const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY, {+ global: {+ headers: {+ Authorization: `Bearer ${access_token}`+ }+ }+})+```+</TabItem>+</Tabs>++### Data methods++`.insert()` / `.upsert()` / `.update()` / `.delete()` don't return rows by default: [PR](https://github.com/supabase/postgrest-js/pull/276).++Previously, these methods return inserted/updated/deleted rows by default (which caused [some confusion](https://github.com/supabase/supabase/discussions/1548)), and you can opt to not return it by specifying `returning: 'minimal'`. Now the default behavior is to not return rows. To return inserted/updated/deleted rows, add a `.select()` call at the end.++#### Insert and return data++<Tabs+ groupId="version"+ values={[+ {label: 'Before', value: '1.x'},+ {label: 'After', value: '2.x'},+ ]}>++<TabItem value="1.x">++```ts+const { data, error } = await supabase.auth.insert({ new_data })+```+</TabItem>++<TabItem value="2.x">++```ts+const { data, error } = await supabase.auth.insert({ new_data }).select()+```+</TabItem>+</Tabs>++#### Update and return data++<Tabs+ groupId="version"+ values={[+ {label: 'Before', value: '1.x'},+ {label: 'After', value: '2.x'},+ ]}>++<TabItem value="1.x">++```ts+const { data, error } = await supabase.auth.update({ new_data }).eq('id', id)+```+</TabItem>++<TabItem value="2.x">++```ts+const { data, error } = await supabase.auth.update({ new_data }).eq('id', id).select()+```+</TabItem>+</Tabs>++### Realtime methods++#### Subscribe++<Tabs+ groupId="version"+ values={[+ {label: 'Before', value: '1.x'},+ {label: 'After', value: '2.x'},+ ]}>++<TabItem value="1.x">++```ts+const userListener = supabase.from('users')+ .on('*',+ (payload) => handleAllEventsPayload(payload.new)+ )+ .subscribe()+```+</TabItem>++<TabItem value="2.x">++```ts+const userListener = supabase.channel('public:user')+ .on(+ 'postgres_changes',+ { event: '*', schema: 'public', table: 'user' }+ (payload) => handleAllEventsPayload()+ )+ .subscribe()+```+</TabItem>+</Tabs>++#### Unsubscribe++<Tabs+ groupId="version"+ values={[+ {label: 'Before', value: '1.x'},+ {label: 'After', value: '2.x'},+ ]}>++<TabItem value="1.x">++```ts+userListener.unsubscribe()+```+</TabItem>++<TabItem value="2.x">++```ts+supabase.removeChannel('public:users')+```+</TabItem>+</Tabs>\ No newline at end of filediff --git a/apps/temp-docs/_supabase_js/working-with-types.md b/apps/temp-docs/_supabase_js/working-with-types.mdnew file mode 100644index 00000000000..519650ed995--- /dev/null+++ b/apps/temp-docs/_supabase_js/working-with-types.md@@ -0,0 +1,84 @@+---+id: typescript-support+---++# Typescript Support++`supabase-js` supports Typescript.++## Generating types++You can use our CLI to generate types:++```bash+supabase start+supabase gen types typescript --local > lib/database.types.ts+```++These types are generated directly from your database. Given a table `public.movies`, the definition will provide the following data:++```ts+interface Database {+ public: {+ Tables: {+ movies: {+ Row: {} // The data expected to be returned from a "select" statement.+ Insert: {} // The data expected passed to an "insert" statement.+ Update: {} // The data expected passed to an "update" statement.+ }+ }+ }+}+```++There is a difference between `selects`, `inserts`, and `updates`, because often you will set default values in your database for specific columns.+With default values you do not need to send any data over the network, even if that column is a "required" field. Our type system is granular+enough to handle these situations.++## Injecting type definitions++You can enrich the supabase client with the types you generated with Supabase.++```ts+import { createClient } from '@supabase/supabase-js'+import { Database } from 'lib/database.types'++const supabase = createClient<Database>(+ process.env.SUPABASE_URL,+ process.env.SUPABASE_ANON_KEY+)+```++## Type hints++`supabase-js` always returns a `data` object (for success), and an `error` response (for unsuccessful requests).+This provides a simple interface to get the relevant types returned from any function:++```ts+export async function getMovies() {+ return await supabase.from('movies').select(`id, title`)+}++type MoviesResponse = Awaited<ReturnType<typeof getMovies>>+export type MoviesResponseSuccess = MoviesResponse['data']+export type MoviesResponseError = MoviesResponse['error']+```++## Nested tables++For advanced queries such as nested tables, you may want to construct your own types.++```ts+import supabase from '~/lib/supabase'+import type { Database } from '~/lib/database.types'++async function getMovies() {+ return await supabase.from('movies').select('id, title, actors(*)')+}++type Actors = Database['public']['Tables']['actors']['Row']+type MoviesResponse = Awaited<ReturnType<typeof getMovies>>+type MoviesResponseSuccess = MoviesResponse['data'] & {+ actors: Actors[]+}+```diff --git a/apps/temp-docs/_supabase_js_versioned_docs/version-v1/generating-types.mdx b/apps/temp-docs/_supabase_js_versioned_docs/version-v1/generating-types.mdxnew file mode 100644index 00000000000..033cfdb9165--- /dev/null+++ b/apps/temp-docs/_supabase_js_versioned_docs/version-v1/generating-types.mdx@@ -0,0 +1,42 @@+---+id: generating-types+title: 'Generating Types'+slug: generating-types+custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v1.yml+---++import Tabs from '@theme/Tabs'+import TabItem from '@theme/TabItem'++Supabase will soon release native type generators that dump your database types for various languages. For now, we support TypeScript [through third-party tools](/docs/guides/api/generating-types).++## Usage with TypeScript++`supabase-js` ships with type definitions for usage with TypeScript and for convenient IntelliSense auto-complete and documentation in your editor.++When using TypeScript, you can pass the type of database row as a type parameter to the `from` method to get better auto-completion support down the chain.+If you don't provide a type for the row you need to explicitly pass `from<any>('tableName')`.++```ts+type Message = {+ id: number+ inserted_at: string+ message: string+ user_id: string+ channel_id: number+ author: { username: string }+}++const response = await supabase+ .from<Message>('messages') // Message maps to the type of the row in your database.+ .select('*, author:user_id(username)')+ .match({ channel_id: 2 }) // Your IDE will be able to help with auto-completion.+response.data // Response data will be of type Array<Message>.++// If you don't provide a type for the row you need to explicitly pass `from<any>('tableName')`.+const response = await supabase+ .from<any>('messages')+ .select('*, author:user_id(username)')+ .match({ channel_id: 2 })+response.data // Response data will be of type Array<any>.+```diff --git a/apps/temp-docs/_supabase_js_versioned_docs/version-v1/index.mdx b/apps/temp-docs/_supabase_js_versioned_docs/version-v1/index.mdxnew file mode 100644index 00000000000..8f37f5853e8--- /dev/null+++ b/apps/temp-docs/_supabase_js_versioned_docs/version-v1/index.mdx@@ -0,0 +1,11 @@+---+id: index+title: 'Supabase Client'+slug: supabase-client+custom_edit_url: ../../spec/supabase_js_v1.yml+---++import Tabs from '@theme/Tabs'+import TabItem from '@theme/TabItem'++Supabase JavaScript.diff --git a/apps/temp-docs/_supabase_js_versioned_docs/version-v1/initializing.mdx b/apps/temp-docs/_supabase_js_versioned_docs/version-v1/initializing.mdxnew file mode 100644index 00000000000..711f03f2aed--- /dev/null+++ b/apps/temp-docs/_supabase_js_versioned_docs/version-v1/initializing.mdx@@ -0,0 +1,151 @@+---+id: initializing+title: 'Initializing'+slug: initializing+custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v1.yml+---++import Tabs from '@theme/Tabs'+import TabItem from '@theme/TabItem'++You can initialize a new Supabase client using the `createClient()` method.++The Supabase client is your entrypoint to the rest of the Supabase functionality+and is the easiest way to interact with everything we offer within the Supabase ecosystem.++## Parameters++<ul className="method-list-group">++<li className="method-list-item">+ <h4 className="method-list-item-label">+ <span className="method-list-item-label-name">+ supabaseUrl+ </span>+ <span className="method-list-item-label-badge required">+ required+ </span>+ <span className="method-list-item-validation">+ <code>string</code>+ </span>+ </h4>+ <div class="method-list-item-description">++The unique Supabase URL which is supplied when you create a new project in your project dashboard.++ </div>++</li>++<li className="method-list-item">+ <h4 className="method-list-item-label">+ <span className="method-list-item-label-name">+ supabaseKey+ </span>+ <span className="method-list-item-label-badge required">+ required+ </span>+ <span className="method-list-item-validation">+ <code>string</code>+ </span>+ </h4>+ <div class="method-list-item-description">++The unique Supabase Key which is supplied when you create a new project in your project dashboard.++ </div>++</li>++<li className="method-list-item">+ <h4 className="method-list-item-label">+ <span className="method-list-item-label-name">+ options+ </span>+ <span className="method-list-item-label-badge false">+ optional+ </span>+ <span className="method-list-item-validation">+ <code>SupabaseClientOptions</code>+ </span>+ </h4>+ <div class="method-list-item-description">++No description provided.++ </div>++</li>++</ul>++## Examples++### createClient()++```js+import { createClient } from '@supabase/supabase-js'++// Create a single supabase client for interacting with your database+const supabase = createClient(+ 'https://xyzcompany.supabase.co',+ 'public-anon-key'+)+```++### With additional parameters++```js+import { createClient } from '@supabase/supabase-js'++const options = {+ schema: 'public',+ headers: { 'x-my-custom-header': 'my-app-name' },+ autoRefreshToken: true,+ persistSession: true,+ detectSessionInUrl: true,+}+const supabase = createClient(+ 'https://xyzcompany.supabase.co',+ 'public-anon-key',+ options+)+```++### API schemas++```js+import { createClient } from '@supabase/supabase-js'++// Provide a custom schema. Defaults to "public".+const supabase = createClient(+ 'https://xyzcompany.supabase.co',+ 'public-anon-key',+ {+ schema: 'other_schema',+ }+)+```++By default the API server points to the `public` schema. You can enable other database schemas within the Dashboard.+Go to `Settings > API > Schema` and add the schema which you want to expose to the API.++Note: each client connection can only access a single schema, so the code above can access the `other_schema` schema but cannot access the `public` schema.++### Custom `fetch` implementation++```js+import { createClient } from '@supabase/supabase-js'++const supabase = createClient(+ 'https://xyzcompany.supabase.co',+ 'public-anon-key',+ {+ fetch: fetch.bind(globalThis),+ }+)+```++`supabase-js` uses the [`cross-fetch`](https://www.npmjs.com/package/cross-fetch) library to make HTTP requests,+but an alternative `fetch` implementation can be provided as an option.+This is most useful in environments where `cross-fetch` is not compatible (for instance Cloudflare Workers).diff --git a/apps/temp-docs/_supabase_js_versioned_docs/version-v1/installing.mdx b/apps/temp-docs/_supabase_js_versioned_docs/version-v1/installing.mdxnew file mode 100644index 00000000000..4441c7253d7--- /dev/null+++ b/apps/temp-docs/_supabase_js_versioned_docs/version-v1/installing.mdx@@ -0,0 +1,37 @@+---+id: installing+title: 'Installing'+slug: installing+custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v1.yml+---++import Tabs from '@theme/Tabs'+import TabItem from '@theme/TabItem'++All JavaScript libraries are built directly by the Supabase team.++Other languages are built by the community and supported by Supabase.++## JavaScript++Via NPM++```bash+npm install @supabase/supabase-js+```++Via Yarn++```bash+yarn add @supabase/supabase-js+```++Find the source code on [GitHub](https://github.com/supabase/supabase-js).++Or via CDN++```js+<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@1"></script>+//or+<script src="https://unpkg.com/@supabase/supabase-js@1"></script>+```diff --git a/apps/temp-docs/_supabase_js_versioned_docs/version-v1/intro.md b/apps/temp-docs/_supabase_js_versioned_docs/version-v1/intro.mdnew file mode 100644index 00000000000..97230e84aea--- /dev/null+++ b/apps/temp-docs/_supabase_js_versioned_docs/version-v1/intro.md@@ -0,0 +1,20 @@+---+id: intro+title: 'Supabase JavaScript Library'+slug: /+sidebar_label: Supabase JavaScript Library+---++:::caution+You're viewing the docs for an older version of the `supabase-js` library.+:::++This reference documents every object and method available in Supabase's isomorphic JavaScript library, `supabase-js`.++You can use the `supabase-js` library to:++- interact with your Postgres database+- listen to database changes+- invoke Deno Edge Functions+- build login and user management functionality+- manage large filesdiff --git a/apps/temp-docs/_supabase_js_versioned_sidebars/.gitkeep b/apps/temp-docs/_supabase_js_versioned_sidebars/.gitkeepnew file mode 100644index 00000000000..e69de29bb2ddiff --git a/apps/temp-docs/_supabase_js_versioned_sidebars/version-v1-sidebars.json b/apps/temp-docs/_supabase_js_versioned_sidebars/version-v1-sidebars.jsonnew file mode 100644index 00000000000..8687644761e--- /dev/null+++ b/apps/temp-docs/_supabase_js_versioned_sidebars/version-v1-sidebars.json@@ -0,0 +1,138 @@+{+ "sidebar": [+ {+ "type": "category",+ "label": "Getting Started",+ "items": ["intro", "installing", "initializing", "generating-types"],+ "collapsed": false+ },+ {+ "type": "category",+ "label": "Auth",+ "items": [+ "generated/auth-signup",+ "generated/auth-signin",+ "generated/auth-signout",+ "generated/auth-session",+ "generated/auth-user",+ "generated/auth-update",+ "generated/auth-setauth",+ "generated/auth-onauthstatechange",+ "generated/auth-api-getuser",+ "generated/auth-api-resetpasswordforemail"+ ],+ "collapsed": true+ },+ {+ "type": "category",+ "label": "Auth (Server Only)",+ "items": [+ "generated/auth-api-listusers",+ "generated/auth-api-createuser",+ "generated/auth-api-deleteuser",+ "generated/auth-api-generatelink",+ "generated/auth-api-inviteuserbyemail",+ "generated/auth-api-sendmobileotp",+ "generated/auth-api-updateuserbyid"+ ],+ "collapsed": true+ },+ {+ "type": "category",+ "label": "Functions",+ "items": ["generated/invoke"],+ "collapsed": true+ },+ {+ "type": "category",+ "label": "Database",+ "items": [+ "generated/select",+ "generated/insert",+ "generated/update",+ "generated/upsert",+ "generated/delete",+ "generated/rpc"+ ],+ "collapsed": true+ },+ {+ "type": "category",+ "label": "Realtime",+ "items": [+ "generated/subscribe",+ "generated/removesubscription",+ "generated/removeallsubscriptions",+ "generated/getsubscriptions"+ ],+ "collapsed": true+ },+ {+ "type": "category",+ "label": "Storage",+ "items": [+ "generated/storage-createbucket",+ "generated/storage-getbucket",+ "generated/storage-listbuckets",+ "generated/storage-updatebucket",+ "generated/storage-deletebucket",+ "generated/storage-emptybucket",+ "generated/storage-from-upload",+ "generated/storage-from-download",+ "generated/storage-from-list",+ "generated/storage-from-update",+ "generated/storage-from-move",+ "generated/storage-from-copy",+ "generated/storage-from-remove",+ "generated/storage-from-createsignedurl",+ "generated/storage-from-createsignedurls",+ "generated/storage-from-getpublicurl"+ ],+ "collapsed": true+ },+ {+ "type": "category",+ "label": "Modifiers",+ "items": [+ "generated/using-modifiers",+ "generated/limit",+ "generated/order",+ "generated/range",+ "generated/single",+ "generated/maybesingle"+ ],+ "collapsed": true+ },+ {+ "type": "category",+ "label": "Filters",+ "items": [+ "generated/using-filters",+ "generated/or",+ "generated/not",+ "generated/match",+ "generated/eq",+ "generated/neq",+ "generated/gt",+ "generated/gte",+ "generated/lt",+ "generated/lte",+ "generated/like",+ "generated/ilike",+ "generated/is",+ "generated/in",+ "generated/contains",+ "generated/containedby",+ "generated/rangelt",+ "generated/rangegt",+ "generated/rangegte",+ "generated/rangelte",+ "generated/rangeadjacent",+ "generated/overlaps",+ "generated/textsearch",+ "generated/filter"+ ],+ "collapsed": true+ }+ ]+}diff --git a/apps/temp-docs/_supabase_js_versions.json b/apps/temp-docs/_supabase_js_versions.jsonnew file mode 100644index 00000000000..868a38e32ae--- /dev/null+++ b/apps/temp-docs/_supabase_js_versions.json@@ -0,0 +1 @@+["v1"]diff --git a/apps/temp-docs/generator/api.ts b/apps/temp-docs/generator/api.tsnew file mode 100644index 00000000000..602842c4014--- /dev/null+++ b/apps/temp-docs/generator/api.ts@@ -0,0 +1,138 @@+import template from './templates/ApiTemplate'+import { slugify, toArrayWithKey, toTitle, writeToDisk } from './helpers'+import { OpenAPIV3, OpenAPIV2 } from 'openapi-types'+import * as fs from 'fs'+import * as ejs from 'ejs'++export default async function gen(+ inputFileName: string,+ outputDir: string,+ apiUrl: string+) {+ const specRaw = fs.readFileSync(inputFileName, 'utf8')+ const spec = JSON.parse(specRaw) as any+ // console.log('spec', spec)++ switch (spec.openapi || spec.swagger) {+ case '3.0.0':+ case '3.0.3':+ await gen_v3(spec, outputDir, { apiUrl })+ break++ case '2.0':+ await gen_v2(spec, outputDir, { apiUrl })+ break++ default:+ console.log('Unrecognized specification version:', spec.openapi)+ break+ }+}++/**+ * Versioned Generator+ */++// OPENAPI-SPEC-VERSION: 3.0.0+type v3OperationWithPath = OpenAPIV3.OperationObject & {+ path: string+}+type enrichedOperation = OpenAPIV3.OperationObject & {+ path: string+ fullPath: string+ operationId: string+}+async function gen_v3(+ spec: OpenAPIV3.Document,+ dest: string,+ { apiUrl }: { apiUrl: string }+) {+ const specLayout = spec.tags || []+ const operations: enrichedOperation[] = []+ Object.entries(spec.paths).forEach(([key, val]) => {+ const fullPath = `${apiUrl}${key}`++ toArrayWithKey(val!, 'operation').forEach((o) => {+ const operation = o as v3OperationWithPath+ const enriched = {+ ...operation,+ path: key,+ fullPath,+ operationId: slugify(operation.summary!),++ responseList:+ toArrayWithKey(operation.responses!, 'responseCode') || [],+ }+ operations.push(enriched)+ })+ })++ const sections = specLayout.map((section) => {+ return {+ ...section,+ title: toTitle(section.name),+ id: slugify(section.name),+ operations: operations.filter((operation) =>+ operation.tags?.includes(section.name)+ ),+ }+ })++ const content = ejs.render(template, {+ info: spec.info,+ sections,+ operations,+ })+ // console.log(content)+ // Write to disk+ await writeToDisk(dest, content)+ console.log('Saved: ', dest)+}++// OPENAPI-SPEC-VERSION: 2.0+async function gen_v2(+ spec: OpenAPIV2.Document,+ dest: string,+ { apiUrl }: { apiUrl: string }+) {+ const specLayout = spec.tags || []+ const operations: enrichedOperation[] = []+ Object.entries(spec.paths).forEach(([key, val]) => {+ const fullPath = `${apiUrl}${key}`++ toArrayWithKey(val!, 'operation').forEach((o) => {+ const operation = o as v3OperationWithPath+ const enriched = {+ ...operation,+ path: key,+ fullPath,+ operationId: slugify(operation.summary!),++ responseList:+ toArrayWithKey(operation.responses!, 'responseCode') || [],+ }+ operations.push(enriched)+ })+ })++ const sections = specLayout.map((section) => {+ return {+ ...section,+ title: toTitle(section.name),+ id: slugify(section.name),+ operations: operations.filter((operation) =>+ operation.tags?.includes(section.name)+ ),+ }+ })++ const content = ejs.render(template, {+ info: spec.info,+ sections,+ operations,+ })+ // console.log(content)+ // Write to disk+ await writeToDisk(dest, content)+ console.log('Saved: ', dest)+}diff --git a/apps/temp-docs/generator/cli.ts b/apps/temp-docs/generator/cli.tsnew file mode 100644index 00000000000..9d554feb79f--- /dev/null+++ b/apps/temp-docs/generator/cli.ts@@ -0,0 +1,49 @@+import * as fs from 'fs'+import * as ejs from 'ejs'+import * as yaml from 'js-yaml'+import { writeToDisk } from './helpers'+import template from './templates/CliTemplate'+import type { CliSpec } from './types/CliSpec'++export default async function gen(inputFileName: string, outputDir: string) {+ const spec = yaml.load(fs.readFileSync(inputFileName, 'utf8')) as any++ switch (spec.clispec) {+ case '001':+ await gen_v001(spec, outputDir)+ break++ default:+ console.log('Unrecognized specification version:', spec.clispec)+ break+ }+}++/**+ * Versioned Generator+ */+async function gen_v001(spec: CliSpec, dest: string) {+ let commandMap = new Map(spec.commands.map((item) => [item.id, item]))++ const commands = spec.commands.map((x) => {+ const isChild = x.subcommands.length < 1+ const heading = isChild+ ? `### ${x.summary} {#${x.id}}`+ : `## ${x.summary} {#${x.id}}`++ return {+ ...x,+ heading,+ subcommandList: x.subcommands.map((c) => commandMap.get(c)),+ }+ })++ const content = ejs.render(template, {+ info: spec.info,+ commands,+ })+ // console.log(content)+ // Write to disk+ await writeToDisk(dest, content)+ console.log('Saved: ', dest)+}diff --git a/apps/temp-docs/generator/config.ts b/apps/temp-docs/generator/config.tsnew file mode 100644index 00000000000..378857b998c--- /dev/null+++ b/apps/temp-docs/generator/config.ts@@ -0,0 +1,46 @@+import template from './templates/ConfigTemplate'+import type { ConfigSpec } from './types/ConfigSpec'++import * as fs from 'fs'+import * as ejs from 'ejs'+import * as yaml from 'js-yaml'+import { writeToDisk } from './helpers'++type Section = {+ id: string+ title: string+}++export default async function gen(inputFileName: string, outputDir: string) {+ const spec = yaml.load(fs.readFileSync(inputFileName, 'utf8')) as any+ // console.log('spec', spec)++ switch (spec.configspec) {+ case '001':+ await gen_v001(spec, outputDir)+ break++ default:+ console.log('Unrecognized specification version:', spec.configspec)+ break+ }+}++/**+ * Versioned Generator+ */+async function gen_v001(spec: ConfigSpec, dest: string) {+ const specLayout = spec.info.tags+ const sections = specLayout.map((section: Section) => {+ const parameters = spec.parameters.filter(+ (parameter) => parameter.tags[0] === section.id+ )+ return { ...section, parameters }+ })++ const content = ejs.render(template, { info: spec.info, sections })+ // console.log(content)+ // Write to disk+ await writeToDisk(dest, content)+ console.log('Saved: ', dest)+}diff --git a/apps/temp-docs/generator/helpers.ts b/apps/temp-docs/generator/helpers.tsnew file mode 100644index 00000000000..6bb5653e808--- /dev/null+++ b/apps/temp-docs/generator/helpers.ts@@ -0,0 +1,41 @@+import * as _ from 'lodash'+import * as fs from 'fs'++export const slugify = (text: string) => {+ return text+ .toString()+ .toLowerCase()+ .replace(/[. )(]/g, '-') // Replace spaces and brackets -+ .replace(/[^\w\-]+/g, '') // Remove all non-word chars+ .replace(/\-\-+/g, '-') // Replace multiple - with single -+ .replace(/^-+/, '') // Trim - from start of text+ .replace(/-+$/, '') // Trim - from end of text+}++// Uppercase the first letter of a string+export const toTitle = (text: string) => {+ return text.charAt(0).toUpperCase() + text.slice(1)+}++/**+ * writeToDisk()+ */+export const writeToDisk = (fileName: string, content: any) => {+ return new Promise((resolve, reject) => {+ fs.writeFile(fileName, content, (err: any) => {+ if (err) return reject(err)+ else return resolve(true)+ })+ })+}++/**+ * Convert Object to Array of values+ */+export const toArrayWithKey = (obj: object, keyAs: string) =>+ _.values(+ _.mapValues(obj, (value: any, key: string) => {+ value[keyAs] = key+ return value+ })+ )diff --git a/apps/temp-docs/generator/index.ts b/apps/temp-docs/generator/index.tsnew file mode 100644index 00000000000..2623ffe79d3--- /dev/null+++ b/apps/temp-docs/generator/index.ts@@ -0,0 +1,64 @@+import ApiGenerator from './api'+import CliGenerator from './cli'+import ConfigGenerator from './config'+import SdkGenerator from './sdk'+import LegacyGenerator from './legacy'++const main = (command: string[], options: any) => {+ handleInput(command[0], options)+}++// Run everything+const argv = require('minimist')(process.argv.slice(2))+main(argv['_'], argv)++function handleInput(command: string, options: any) {+ switch (command) {+ case 'gen':+ DocGenerator(options)+ break++ default:+ console.log('Unrecognized command:', command)+ break+ }+}++export default async function DocGenerator({+ input,+ output,+ type,+ url,+}: {+ input: string+ output: string+ type: 'cli' | 'config' | 'sdk' | 'api' | 'legacy'+ url?: string+}) {+ switch (type) {+ case 'api':+ await ApiGenerator(input, output, url || '')+ break++ case 'cli':+ await CliGenerator(input, output)+ break++ case 'config':+ await ConfigGenerator(input, output)+ break++ case 'sdk':+ await SdkGenerator(input, output)+ break++ case 'legacy':+ await LegacyGenerator(input, output)+ break++ default:+ await console.log('Unrecognized type: ', type)+ break+ }+ return 'Done'+}diff --git a/apps/temp-docs/generator/legacy.ts b/apps/temp-docs/generator/legacy.tsnew file mode 100644index 00000000000..6a2b906af3f--- /dev/null+++ b/apps/temp-docs/generator/legacy.ts@@ -0,0 +1,348 @@+// @ts-nocheck++/**+ * Usage:+ * ts-node ReferenceGenerator.ts -o {output_dir} {input}.yml+ *+ * Example:+ * ts-node ReferenceGenerator.ts -o docs/client spec/supabase.yml+ */++import Example from './legacy/components/Example'+import Page from './legacy/components/Page'+import Tab from './legacy/components/Tab'+import {+ slugify,+ tsDocCommentToMdComment,+ writeToDisk,+} from './legacy/lib/helpers'+import { TsDoc, OpenRef } from './legacy/definitions'+import { uniqBy } from 'lodash'+import * as fs from 'fs'+import * as yaml from 'js-yaml'++export default async function gen(inputFileName: string, outputDir: string) {+ const docSpec = yaml.load(fs.readFileSync(inputFileName, 'utf8'))+ const defRef = docSpec.info.definition+ ? fs.readFileSync(docSpec.info.definition, 'utf8')+ : '{}'++ const definition = JSON.parse(defRef)+ const id = docSpec.info.id+ const allLanguages = docSpec.info.libraries+ const pages = Object.entries(docSpec.pages).map(+ ([name, x]: [string, OpenRef.Page]) => ({+ ...x,+ pageName: name,+ })+ )++ // Index Page+ const indexFilename = outputDir + `/index.mdx`+ const index = generateDocsIndexPage(docSpec, inputFileName)+ await writeToDisk(indexFilename, index)+ console.log('The index was saved: ', indexFilename)++ // Generate Pages+ pages.forEach(async (pageSpec: OpenRef.Page) => {+ try {+ const slug = slugify(pageSpec.pageName)+ const hasTsRef = pageSpec['$ref'] || null+ const tsDefinition = hasTsRef && extractTsDocNode(hasTsRef, definition)+ if (hasTsRef && !tsDefinition)+ throw new Error('Definition not found: ' + hasTsRef)++ const description =+ pageSpec.description ||+ tsDocCommentToMdComment(getDescriptionFromDefintion(tsDefinition))++ // Create page+ const content = Page({+ slug: (docSpec.info.slugPrefix || '') + slug,+ id: slug,+ specFileName: docSpec.info.specUrl || inputFileName,+ title: pageSpec.title || pageSpec.pageName,+ description,+ parameters: hasTsRef ? generateParameters(tsDefinition) : '',+ spotlight: generateSpotlight(+ id,+ pageSpec['examples'] || [],+ allLanguages+ ),+ examples: generateExamples(+ id,+ pageSpec['examples'] || [],+ allLanguages+ ),+ notes: pageSpec.notes,+ })++ // Write to disk+ const dest = outputDir + `/${slug}.mdx`+ await writeToDisk(dest, content)+ console.log('Saved: ', dest)+ } catch (error) {+ console.error(error)+ }+ })+}++function generateParameters(tsDefinition: any) {+ let functionDeclaration = null+ if (tsDefinition.kindString == 'Method') {+ functionDeclaration = tsDefinition+ } else if (tsDefinition.kindString == 'Constructor') {+ functionDeclaration = tsDefinition+ } else functionDeclaration = tsDefinition?.type?.declaration+ if (!functionDeclaration) return ''++ const paramDefinitions: TsDoc.TypeDefinition[] =+ functionDeclaration.signatures[0].parameters // PMC: seems flaky.. why the [0]?+ if (!paramDefinitions) return ''++ // const paramsComments: TsDoc.CommentTag = tsDefinition.comment?.tags?.filter(x => x.tag == 'param')+ let parameters = paramDefinitions+ .map((x) => recurseThroughParams(x))+ .join(`\n`)+ return methodListGroup(parameters)+}++function getDescriptionFromDefintion(tsDefinition) {+ if (!tsDefinition) return null+ if (+ ['Method', 'Constructor', 'Constructor signature'].includes(+ tsDefinition.kindString+ )+ )+ return tsDefinition?.signatures[0].comment+ else return tsDefinition?.comment || ''+}++function recurseThroughParams(paramDefinition: TsDoc.TypeDefinition) {+ // If this is a reference to another Param, let's use the reference instead+ let param = isDereferenced(paramDefinition)+ ? paramDefinition.type?.dereferenced+ : paramDefinition+ const labelParams = generateLabelParam(param)+ let subContent = ''++ let children = param?.children+ if (param.type?.declaration?.children) {+ children = param.type?.declaration?.children+ } else if (isUnion(param)) {+ // We don't want to show the union types if it's a literal+ const nonLiteralVariants = param.type.types.filter(+ ({ type }) => type !== 'literal'+ )++ if (nonLiteralVariants.length === 0) {+ children = null+ } else {+ children = nonLiteralVariants+ }+ } else if (param.type === 'reflection') {+ children = param.declaration.children+ }++ if (!!children) {+ let properties = children+ .sort((a, b) => a.name?.localeCompare(b.name)) // first alphabetical+ .sort((a, b) => (a.flags?.isOptional ? 1 : -1)) // required params first+ .map((x) => recurseThroughParams(x))++ let heading = `<h5 class="method-list-title method-list-title-isChild expanded">Properties</h5>`+ subContent = methodListGroup([heading].concat(properties).join('\n'))+ return methodListItemLabel(labelParams, subContent)+ }+ return methodListItemLabel(labelParams, subContent)+}++const isDereferenced = (paramDefinition: TsDoc.TypeDefinition) => {+ return (+ paramDefinition.type?.type == 'reference' &&+ paramDefinition.type?.dereferenced?.id+ )+}++const isUnion = (paramDefinition: TsDoc.TypeDefinition) => {+ return paramDefinition.type?.type == 'union'+}++const mergeUnion = (paramDefinition: TsDoc.TypeDefinition) => {+ const joined = paramDefinition.type.types.reduce((acc, x) => {+ acc.push(...(x.declaration?.children || []))+ return acc+ }, [])++ return uniqBy(joined, 'name')+}++const methodListGroup = (items) => `+<ul className="method-list-group">+ ${items}+</ul>+`++const methodListItemLabel = (+ { name, isOptional, type, description },+ subContent+) => `+<li className="method-list-item">+ <h4 className="method-list-item-label">+ <span className="method-list-item-label-name">+ ${name}+ </span>+ <span className="method-list-item-label-badge ${!isOptional && 'required'}">+ ${isOptional ? 'optional' : 'required'}+ </span>+ <span className="method-list-item-validation">+ ${type}+ </span>+ </h4>+ <div class="method-list-item-description">++${description ? description : 'No description provided. '}++ </div>+ ${subContent}+</li>+`++function generateExamples(id: string, specExamples: any, allLanguages: any) {+ return specExamples.map((example) => {+ let allTabs = example.hideCodeBlock+ ? ''+ : generateCodeBlocks(allLanguages, example)+ return Example({+ name: example.name,+ description: example.description,+ tabs: allTabs,+ note: example.note,+ })+ })+}++/**+ * A spotlight is an example which appears at the top of the page.+ */+function generateSpotlight(+ id: string,+ specExamples: any | any[],+ allLanguages: any+) {+ if (!Array.isArray(specExamples)) {+ throw new Error(+ `Examples for each spec should be an array, received: \n${specExamples}`+ )+ }+ const spotlight =+ (specExamples && specExamples.find((x) => x.isSpotlight)) || null+ const spotlightContent = !spotlight+ ? ''+ : generateCodeBlocks(allLanguages, spotlight)+ return spotlightContent+}++function generateTabs(allLanguages: any, example: any) {+ return allLanguages+ .map((library) => {+ let content = example[library.id] || notImplemented+ return Tab(library.id, content)+ })+ .join('\n')+}++function generateCodeBlocks(allLanguages: any, example: any) {+ return allLanguages+ .map((library) => {+ let content = example[library.id] || notImplemented+ return content+ })+ .join('\n')+}++const notImplemented = `+\`\`\`+Not yet implemented+\`\`\`+`++function generateLabelParam(param: any) {+ let labelParams = {}+ if (typeof param.type === 'string' && param.type === 'literal') {+ labelParams = {+ name: param.name ?? param.value,+ isOptional: !!param.flags?.isOptional,+ type: param.type,+ description: param.comment+ ? tsDocCommentToMdComment(param.comment)+ : null,+ }+ } else {+ labelParams = {+ name: param.name ?? extractParamTypeAsString(param),+ isOptional: !!param.flags?.isOptional,+ type: extractParamTypeAsString(param),+ description: param.comment+ ? tsDocCommentToMdComment(param.comment)+ : null,+ }+ }+ return labelParams+}++function extractParamTypeAsString(paramDefinition) {+ if (paramDefinition.type?.name) {+ return `<code>${paramDefinition.type.name}</code>`+ } else if (paramDefinition.type?.type == 'union') {+ return paramDefinition.type.types+ .map((x) =>+ x.value+ ? `<code>${x.value}</code>`+ : x.name+ ? `<code>${x.name}</code>`+ : x.type+ ? `<code>${x.type}</code>`+ : ''+ )+ .join(' | ')+ }++ return '<code>object</code>'+}++/**+ * Iterates through the definition to find the correct definition.+ * You can pass it a deeply nested node using dot notation. eg: 'LoggedInUser.data.email'+ */+function extractTsDocNode(nodeToFind: string, definition: any) {+ const nodePath = nodeToFind.split('.')+ let i = 0+ let previousNode = definition+ let currentNode = definition+ while (i < nodePath.length) {+ previousNode = currentNode+ currentNode =+ previousNode.children.find((x) => x.name == nodePath[i]) || null+ if (currentNode == null) {+ console.log(+ `Cant find ${nodePath[i]} in ${previousNode.children.map(+ (x) => '\n' + x.name+ )}`+ )+ break+ }+ i+++ }+ return currentNode+}++function generateDocsIndexPage(docSpec: any, inputFileName: string) {+ return Page({+ slug: (docSpec.info.slugPrefix || '') + slugify(docSpec.info.title),+ id: 'index',+ title: docSpec.info.title,+ specFileName: inputFileName,+ description: docSpec.info.description,+ })+}diff --git a/apps/temp-docs/generator/legacy/components/Example.ts b/apps/temp-docs/generator/legacy/components/Example.tsnew file mode 100644index 00000000000..fe0105915b6--- /dev/null+++ b/apps/temp-docs/generator/legacy/components/Example.ts@@ -0,0 +1,24 @@+type params = { name: string; description: string; tabs: string; note: string }++const Example = ({ name, description = '', tabs = '', note = '' }: params) => {+ if (note !== '') {+ const [noteTitle, ...noteText] = note.split('\n')+ console.log(noteText)+ note = `+:::note ${noteTitle}+ ${noteText.join('\n')}+:::+`+ }+ return `+### ${name}++${description}++${tabs}++${note}+`.trim()+}++export default Examplediff --git a/apps/temp-docs/generator/legacy/components/Page.ts b/apps/temp-docs/generator/legacy/components/Page.tsnew file mode 100644index 00000000000..e9fc92e0602--- /dev/null+++ b/apps/temp-docs/generator/legacy/components/Page.ts@@ -0,0 +1,65 @@+type PageParmas = {+ id: string+ title: string+ slug: string+ specFileName: string+ description?: string+ parameters?: string+ examples?: string[]+ spotlight?: string+ notes?: string+ result?: string+ errors?: string+}++const Page = ({+ id,+ title,+ slug,+ specFileName,+ description = '',+ parameters = '',+ examples = [],+ spotlight = '',+ notes = '',+ result = '',+ errors = '',+}: PageParmas) =>+ `+---+id: ${id}+title: "${title}"+slug: ${slug}+custom_edit_url: ${specFileName}+---++import Tabs from '@theme/Tabs';+import TabItem from '@theme/TabItem';++${description}++${spotlight}++${parameters ? `## Parameters` : ''}++${parameters}++${notes ? '## Notes' : ''}++${notes}++${result ? `## Result` : ''}++${result}++${errors ? `## Errors` : ''}++${errors}++${examples.length > 0 ? '## Examples' : ''}++${examples.join(`\n\n`)}++`.trim()++export default Pagediff --git a/apps/temp-docs/generator/legacy/components/Sidebar.ts b/apps/temp-docs/generator/legacy/components/Sidebar.tsnew file mode 100644index 00000000000..a5f59cd7d2d--- /dev/null+++ b/apps/temp-docs/generator/legacy/components/Sidebar.ts@@ -0,0 +1,10 @@+const Sidebar = (categories: string[]) =>+ `+module.exports = {+ docs: [+ ${categories.map((x) => x).join(',\n ')}+ ],+}+`.trim()++export default Sidebardiff --git a/apps/temp-docs/generator/legacy/components/SidebarCategory.ts b/apps/temp-docs/generator/legacy/components/SidebarCategory.tsnew file mode 100644index 00000000000..5374101dd6a--- /dev/null+++ b/apps/temp-docs/generator/legacy/components/SidebarCategory.ts@@ -0,0 +1,8 @@+export default function SidebarCategory(name: string, items: string[]) {+ return `{+ type: 'category',+ label: '${name}',+ items: [${items.join(', ')}],+ collapsed: true,+ }`+}diff --git a/apps/temp-docs/generator/legacy/components/Tab.ts b/apps/temp-docs/generator/legacy/components/Tab.tsnew file mode 100644index 00000000000..a7280f6a166--- /dev/null+++ b/apps/temp-docs/generator/legacy/components/Tab.ts@@ -0,0 +1,10 @@+const Tab = (library: string, exampleText: string) =>+ `+<TabItem value="${library}">++${exampleText}++</TabItem>+`.trim()++export default Tabdiff --git a/apps/temp-docs/generator/legacy/components/Tabs.ts b/apps/temp-docs/generator/legacy/components/Tabs.tsnew file mode 100644index 00000000000..c353c2e8e84--- /dev/null+++ b/apps/temp-docs/generator/legacy/components/Tabs.ts@@ -0,0 +1,17 @@+// @ts-nocheck++const Tabs = (id: string, libraries = [], examples = []) =>+ `+<Tabs+ defaultValue="${libraries[0].id}"+ groupId="${id}"+ values={[${libraries+ .map((x) => `{ label: '${x.name}', value: '${x.id}' }`)+ .toString()}]}>++${examples}++</Tabs>+`.trim()++export default Tabsdiff --git a/apps/temp-docs/generator/legacy/definitions.ts b/apps/temp-docs/generator/legacy/definitions.tsnew file mode 100644index 00000000000..96f1f44dfe3--- /dev/null+++ b/apps/temp-docs/generator/legacy/definitions.ts@@ -0,0 +1,33 @@+export namespace TsDoc {+ export type DocComment = {+ shortText?: string+ text?: string+ tags?: CommentTag[]+ }+ export type CommentTag = {+ tag: 'param' | 'returns'+ text: string+ param: string+ }++ export type TypeDefinition = {+ id: string+ name: string+ kind: number+ kindString: 'Parameter' | 'Method'+ comment?: CommentTag+ flags: { isExported: boolean; isOptional?: boolean }+ type: { type: string; name: string; declaration: TypeDefinition }+ children: TypeDefinition[]+ }+}++export namespace OpenRef {+ export type Page = {+ pageName: string+ title?: string+ description?: string+ notes?: string+ // $ref?: string // reference to a TSDoc node+ }+}diff --git a/apps/temp-docs/generator/legacy/lib/helpers.ts b/apps/temp-docs/generator/legacy/lib/helpers.tsnew file mode 100644index 00000000000..5165789f2b0--- /dev/null+++ b/apps/temp-docs/generator/legacy/lib/helpers.ts@@ -0,0 +1,54 @@+import { TsDoc } from '../definitions'++const fs = require('fs')++/**+ * tsDocCommentToMdParams()+ */+export const tsDocCommentToMdParams = (tags: TsDoc.CommentTag[]) =>+ tags+ .filter((x) => x.tag == 'param')+ .map((x) =>+ `+tag++`.trim()+ )+ .join('\n')++/**+ * tsDocCommentToMarkdown()+ */+export const tsDocCommentToMdComment = (commentObject: TsDoc.DocComment) =>+ `+${commentObject?.shortText || ''}++${commentObject?.text || ''}++`.trim()++/**+ * slugify()+ */+export const slugify = (text: string) => {+ return text+ .toString()+ .toLowerCase()+ .replace(/[. )(]/g, '-') // Replace spaces and brackets -+ .replace(/[^\w\-]+/g, '') // Remove all non-word chars+ .replace(/\-\-+/g, '-') // Replace multiple - with single -+ .replace(/^-+/, '') // Trim - from start of text+ .replace(/-+$/, '') // Trim - from end of text+}++/**+ * writeToDisk()+ */+export const writeToDisk = (fileName: string, content: any) => {+ return new Promise((resolve, reject) => {+ fs.writeFile(fileName, content, (err: Error) => {+ if (err) return reject(err)+ else return resolve(true)+ })+ })+}diff --git a/apps/temp-docs/generator/sdk.ts b/apps/temp-docs/generator/sdk.tsnew file mode 100644index 00000000000..2adb10c3898--- /dev/null+++ b/apps/temp-docs/generator/sdk.ts@@ -0,0 +1,39 @@+import * as fs from 'fs'+import * as ejs from 'ejs'+import * as yaml from 'js-yaml'+import template from './templates/SdkTemplate'+import { writeToDisk } from './helpers'+import type { SdkSpec } from './types/SdkSpec'++export default async function gen(inputFileName: string, outputDir: string) {+ const spec = yaml.load(fs.readFileSync(inputFileName, 'utf8')) as any+ // console.log('spec', spec)++ switch (spec.sdkspec) {+ case '001':+ await gen_v001(spec, outputDir)+ break++ default:+ console.log('Unrecognized specification version:', spec.sdkspec)+ break+ }+}++/**+ * Versioned Generator+ */+async function gen_v001(spec: SdkSpec, dest: string) {+ const functions = spec.functions+ const types = spec.types++ const content = ejs.render(template, {+ info: spec.info,+ functions,+ types,+ })+ // console.log(content)+ // Write to disk+ await writeToDisk(dest, content)+ console.log('Saved: ', dest)+}diff --git a/apps/temp-docs/generator/templates/ApiTemplate.ts b/apps/temp-docs/generator/templates/ApiTemplate.tsnew file mode 100644index 00000000000..cadb38583a1--- /dev/null+++ b/apps/temp-docs/generator/templates/ApiTemplate.ts@@ -0,0 +1,147 @@+const template = `+---+id: usage+slug: /usage+title: Usage+toc_max_heading_level: 3+---++import Tabs from '@theme/Tabs';+import TabItem from '@theme/TabItem';+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++<%- info.description %>++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++<% sections.forEach(function(section){ %>++## <%- section.title %> {#<%= section.id %>}++<%- section.description %>++<% section.operations.forEach(function(operation){ %>++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++### <%- operation.summary %> {#<%- operation.operationId %>}++\`\`\`+<%- operation.operation.toUpperCase() %> <%- operation.fullPath %>+\`\`\`++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++<% if(operation.parameters && operation.parameters.filter((parameter) => parameter.in === 'path').length > 0){ %>+#### Path Parameters++<ul className="method-list-group">+<% operation.parameters+.filter((parameter) => parameter.in === 'path').forEach(function(parameter){ %>+<li className="method-list-item">+ <h4 className="method-list-item-label">+ <span className="method-list-item-label-name">+ <%- parameter.name %>+ </span>+ <span className="method-list-item-label-badge">+ <%- parameter.required ? 'required' : 'optional' %>+ </span>+ <span className="method-list-item-validation">+ <%- parameter.type %>+ </span>+ </h4>+ <% if(parameter.example){ %>+ <h4 className="method-list-item-label">+ Example:+ <span className="method-list-item-label-badge">+ <%- parameter.example %>+ </span>+ </h4>+ <% } %>+ <div class="method-list-item-description">+ <%- parameter.description %>+ </div>+</li>+<% }); %>+</ul>+<% }; %>++<% if(operation.parameters && operation.parameters.filter((parameter) => parameter.in === 'header').length > 0){ %>+#### Header Parameters+<ul className="method-list-group">+<% operation.parameters+.filter((parameter) => parameter.in === 'header').forEach(function(parameter){ %>+<li className="method-list-item">+ <h4 className="method-list-item-label">+ <span className="method-list-item-label-name">+ <%- parameter.name %>+ </span>+ <span className="method-list-item-label-badge">+ <%- parameter.required ? 'required' : 'optional' %>+ </span>+ <span className="method-list-item-validation">+ <%- parameter.type %>+ </span>+ </h4>+ <% if(parameter.example){ %>+ <h4 className="method-list-item-label">+ Example:+ <span className="method-list-item-label-badge">+ <%- parameter.example %>+ </span>+ </h4>+ <% } %>+ <div class="method-list-item-description">+ <%- parameter.description %>+ </div>+</li>+<% }); %>+</ul>+<% }; %>+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++<% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ %>+#### Body Parameters++\`\`\`json+<%- JSON.stringify(operation.requestBody?.content['application/json'], null, 2) %>+\`\`\`+<% }; %>++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++#### Responses++<Tabs>+<% operation.responseList.forEach(function(response){ %>+<TabItem value="<%- response.responseCode %>">++<%- response.description %>++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++<% if(response?.content && response?.content['application/json']){ %>+\`\`\`json+<%- JSON.stringify(response.content['application/json'], null, 2) %>+\`\`\`+<% }; %>++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++</TabItem>+<% }); %>+</Tabs>++<br />+<% }); %>+<% }); %>+++`.trim()++export default templatediff --git a/apps/temp-docs/generator/templates/CliTemplate.ts b/apps/temp-docs/generator/templates/CliTemplate.tsnew file mode 100644index 00000000000..0904e47fe37--- /dev/null+++ b/apps/temp-docs/generator/templates/CliTemplate.ts@@ -0,0 +1,52 @@+const template = `+---+id: usage+slug: /usage+title: Usage+toc_max_heading_level: 3+---++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY -->++<%- info.description %>++<% commands.forEach(function(command){ %>++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY -->++<br /><br />++<%- command.heading %>++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY -->++<%- command.description %>+++<% if(command.usage){ %>+<%- command.usage %>+<% }; %>++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY -->++<% if(command.subcommands.length > 0){ %>+**Available Commands**++<% command.subcommandList.forEach(function(subcommand){ %>+- <a href="#<%- subcommand.id %>"><code><%- subcommand.title %></code></a>+<% }); %>+<% } %>+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY -->++**Options**++<%- command.options %>++<% }); %>++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY -->+`.trim()++export default templatediff --git a/apps/temp-docs/generator/templates/ConfigTemplate.ts b/apps/temp-docs/generator/templates/ConfigTemplate.tsnew file mode 100644index 00000000000..949de8d0bd8--- /dev/null+++ b/apps/temp-docs/generator/templates/ConfigTemplate.ts@@ -0,0 +1,41 @@+const template = `+---+id: config+slug: /config+title: Configuration+toc_max_heading_level: 3+---++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY -->++<%= info.description %>++<% sections.forEach(function(section){ %>++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY -->++## <%= section.title %> {#<%= section.id %>}++<% section.parameters.forEach(function(parameter){ %>++### \`<%- parameter.title %>\` {#<%= parameter.id %>}++<%- parameter.description %>++<ul>+<li>Required: <code><%= parameter.required %></code></li>+<li>Default: <code><%- parameter?.default ? parameter?.default : 'None' %></code></li><% if(parameter?.links?.length){ %>+<li>+<span>See also:</span>+<ul><% parameter.links?.forEach(function(link){ %><li><a href="<%- link.link %>"><%- link.name %></a></li><% }); %></ul>+</li>+<% } %>+</ul>++<br />+<% }); %>++<% }); %>+`.trim()++export default templatediff --git a/apps/temp-docs/generator/templates/SdkTemplate.ts b/apps/temp-docs/generator/templates/SdkTemplate.tsnew file mode 100644index 00000000000..4d8b7c5f63e--- /dev/null+++ b/apps/temp-docs/generator/templates/SdkTemplate.ts@@ -0,0 +1,51 @@+const template = `+---+id: usage+title: Usage+toc_max_heading_level: 2+---++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->++<%- info.description %>+++<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->+++<% functions.forEach(function(fn){ %>++## <%- fn.summary %>++<%- fn.usage %>++<% if (fn.attributes) { %>++### Attributes++<% fn.attributes.forEach(function(attribute){ %>+- <%- attribute.id %>+<% }); %>++<% } %>++### Notes++<%- fn.description %>++### Examples++<% fn.examples.forEach(function(example){ %>++#### <%- example.summary %>++<%- example.code %>++<% }); %>++<% }); %>+++`.trim()++export default templatediff --git a/apps/temp-docs/generator/tsconfig.json b/apps/temp-docs/generator/tsconfig.jsonnew file mode 100644index 00000000000..8615cb5639e--- /dev/null+++ b/apps/temp-docs/generator/tsconfig.json@@ -0,0 +1,13 @@+// generator files need their own tsconfig.json because they don't like "module": "esnext" setting that nextjs requires in the main tsconfig+{+ "compilerOptions": {+ "incremental": true,+ "noImplicitAny": false,+ "baseUrl": ".",+ "paths": {+ "~/*": ["./*"]+ }+ },+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],+ "exclude": ["node_modules"]+}diff --git a/apps/temp-docs/generator/types/CliSpec.ts b/apps/temp-docs/generator/types/CliSpec.tsnew file mode 100644index 00000000000..8c3515e708e--- /dev/null+++ b/apps/temp-docs/generator/types/CliSpec.ts@@ -0,0 +1,34 @@+import { SpecLink } from './Spec'+import { Url } from 'url'++export type CliInfo = {+ id: string+ version: string+ title: string+ language: string+ source: Url+ bugs: Url+ spec: Url+ description: string+ options: string+}++export type CliCommand = {+ id: string+ title: string+ summary: string+ description: string+ tags: string[]+ links: SpecLink[]+ usage: string+ subcommands: string[]+ options: string+}++export interface CliSpec {+ clispec: '001'++ info: CliInfo++ commands: CliCommand[]+}diff --git a/apps/temp-docs/generator/types/ConfigSpec.ts b/apps/temp-docs/generator/types/ConfigSpec.tsnew file mode 100644index 00000000000..6981b9b4e22--- /dev/null+++ b/apps/temp-docs/generator/types/ConfigSpec.ts@@ -0,0 +1,36 @@+import { SpecLink } from './Spec'+import { Url } from 'url'++export type Tag = {+ id: string+ title: string+ description?: string+}++export type ConfigInfo = {+ id: string+ version: string+ title: string+ source: Url+ bugs: Url+ spec: Url+ description: string+ tags: Tag[]+}++export type ConfigParameter = {+ id: string+ title: string+ tags: string[]+ required: boolean+ description: string+ links: SpecLink[]+}++export interface ConfigSpec {+ configspec: '001'++ info: ConfigInfo++ parameters: ConfigParameter[]+}diff --git a/apps/temp-docs/generator/types/SdkSpec.ts b/apps/temp-docs/generator/types/SdkSpec.tsnew file mode 100644index 00000000000..9664d2e2110--- /dev/null+++ b/apps/temp-docs/generator/types/SdkSpec.ts@@ -0,0 +1,75 @@+import { SpecLink } from './Spec'+import { Url } from 'url'++export type SdkInfo = {+ id: string+ version: string+ title: string+ language: string+ source: Url+ bugs: Url+ spec: Url+ description: string+ options: string+}++export type SdkType = {+ id: string+ title: string+ summary: string+ source: Url+ value: string+ ref?: SdkType+ links: SpecLink[]+}++export type FunctionAttribute = {+ id: string+ title: string+ required: boolean+ description: string+ type?: string[]+ ref?: string // If a "type" is not supplied, a "ref" must be. This is a pointer to a type.+ children: FunctionAttribute[]+}++export type FunctionReturn = {+ id: string+ title: string+ value: string+ description: string+ ref?: string // This is a pointer to a type.+}++export type FunctionExample = {+ id: string+ title: string+ description?: string+ links: SpecLink[]+ code: string+ returns?: FunctionReturn+}++export type Function = {+ id: string+ title: string+ summary: string+ source: Url+ description?: string+ usage: string+ tags: string[]+ links: SpecLink[]+ attributes?: FunctionAttribute[]+ returns?: FunctionReturn[]+ examples?: FunctionExample[]+}++export interface SdkSpec {+ sdkspec: '001'++ info: SdkInfo++ functions: Function[]++ types: SdkType[]+}diff --git a/apps/temp-docs/generator/types/Spec.ts b/apps/temp-docs/generator/types/Spec.tsnew file mode 100644index 00000000000..6f6c2c72e87--- /dev/null+++ b/apps/temp-docs/generator/types/Spec.ts@@ -0,0 +1,6 @@+import { Url } from 'url'++export type SpecLink = {+ name: string+ url: Url+}