mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
Get Initial Draft Working
This commit is contained in:
parent
f7e69624c6
commit
b4c77fbd5f
35 changed files with 4635 additions and 3750 deletions
|
|
@ -857,10 +857,10 @@
|
|||
],
|
||||
"description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.",
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "No content",
|
||||
"200": {
|
||||
"description": "Session",
|
||||
"content": {
|
||||
"": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/session"
|
||||
}
|
||||
|
|
@ -2479,7 +2479,7 @@
|
|||
"tags": [
|
||||
"account"
|
||||
],
|
||||
"description": "",
|
||||
"description": "Use this endpoint to update an existing push target for messages for the currently logged in user.",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Target",
|
||||
|
|
@ -2499,7 +2499,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "account\/create-push-target.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -2560,7 +2560,7 @@
|
|||
"tags": [
|
||||
"account"
|
||||
],
|
||||
"description": "",
|
||||
"description": "Use this endpoint to create a new push target for messages for the currently logged in user.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Target",
|
||||
|
|
@ -2580,7 +2580,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "account\/update-push-target.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -2640,17 +2640,10 @@
|
|||
"tags": [
|
||||
"account"
|
||||
],
|
||||
"description": "",
|
||||
"description": "Use this endpoint to delete an existing push target for messages for the currently logged in user.",
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "No content",
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/target"
|
||||
}
|
||||
}
|
||||
}
|
||||
"description": "No content"
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
|
|
@ -2660,7 +2653,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "account\/delete-push-target.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -4531,151 +4524,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"post": {
|
||||
"summary": "Create document",
|
||||
"operationId": "databasesCreateDocument",
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
"description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Document, or Documents List",
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#\/components\/schemas\/document"
|
||||
},
|
||||
{
|
||||
"$ref": "#\/components\/schemas\/documentList"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createDocument",
|
||||
"weight": 108,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "databases\/create-document.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md",
|
||||
"rate-limit": 120,
|
||||
"rate-time": 60,
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "documents.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents",
|
||||
"offline-key": "{documentId}",
|
||||
"offline-response-key": "$id",
|
||||
"multiplex": {
|
||||
"createDocument": {
|
||||
"name": "Create Document",
|
||||
"parameters": [
|
||||
"documentId",
|
||||
"data",
|
||||
"permissions"
|
||||
],
|
||||
"required": [
|
||||
"documentId",
|
||||
"data"
|
||||
],
|
||||
"response": "document",
|
||||
"description": "\/docs\/references\/databases\/create-document.md"
|
||||
},
|
||||
"createDocuments": {
|
||||
"name": "Create Documents",
|
||||
"parameters": [
|
||||
"documents"
|
||||
],
|
||||
"required": [
|
||||
"documents"
|
||||
],
|
||||
"response": "documentList",
|
||||
"description": "\/docs\/references\/databases\/create-documents.md"
|
||||
}
|
||||
},
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"JWT": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "databaseId",
|
||||
"description": "Database ID.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<DATABASE_ID>"
|
||||
},
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "collectionId",
|
||||
"description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<COLLECTION_ID>"
|
||||
},
|
||||
"in": "path"
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"documentId": {
|
||||
"type": "string",
|
||||
"description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.",
|
||||
"x-example": "<DOCUMENT_ID>"
|
||||
},
|
||||
"data": {
|
||||
"type": "object",
|
||||
"description": "Document data as JSON object.",
|
||||
"x-example": "{}"
|
||||
},
|
||||
"documents": {
|
||||
"type": "array",
|
||||
"description": "Array of documents data as JSON object.",
|
||||
"x-example": null,
|
||||
"items": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"x-example": "[\"read(\"any\")\"]",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"patch": {
|
||||
"summary": "Update documents",
|
||||
"operationId": "databasesUpdateDocuments",
|
||||
|
|
@ -5549,6 +5397,57 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"\/health\/version": {
|
||||
"get": {
|
||||
"summary": "Get version",
|
||||
"operationId": "healthGetVersion",
|
||||
"tags": [
|
||||
"health"
|
||||
],
|
||||
"description": "Get the version of Appwrite that this instance is currently running.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Health Version",
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/healthVersion"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getVersion",
|
||||
"weight": 128,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "health\/get-version.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "public",
|
||||
"platforms": [
|
||||
"server",
|
||||
"client"
|
||||
],
|
||||
"packaging": false,
|
||||
"offline-model": "",
|
||||
"offline-key": "",
|
||||
"offline-response-key": "$id",
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/locale": {
|
||||
"get": {
|
||||
"summary": "Get user locale",
|
||||
|
|
@ -9843,6 +9742,20 @@
|
|||
"countryName"
|
||||
]
|
||||
},
|
||||
"healthVersion": {
|
||||
"description": "Health Version",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"version": {
|
||||
"type": "string",
|
||||
"description": "Version of the Appwrite instance.",
|
||||
"x-example": "0.11.0"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"version"
|
||||
]
|
||||
},
|
||||
"headers": {
|
||||
"description": "Headers",
|
||||
"type": "object",
|
||||
|
|
|
|||
|
|
@ -889,10 +889,10 @@
|
|||
],
|
||||
"description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.",
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "No content",
|
||||
"200": {
|
||||
"description": "Session",
|
||||
"content": {
|
||||
"": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/session"
|
||||
}
|
||||
|
|
@ -2493,7 +2493,7 @@
|
|||
"tags": [
|
||||
"account"
|
||||
],
|
||||
"description": "",
|
||||
"description": "Use this endpoint to update an existing push target for messages for the currently logged in user.",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Target",
|
||||
|
|
@ -2513,7 +2513,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "account\/create-push-target.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -2573,7 +2573,7 @@
|
|||
"tags": [
|
||||
"account"
|
||||
],
|
||||
"description": "",
|
||||
"description": "Use this endpoint to create a new push target for messages for the currently logged in user.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Target",
|
||||
|
|
@ -2593,7 +2593,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "account\/update-push-target.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -2652,17 +2652,10 @@
|
|||
"tags": [
|
||||
"account"
|
||||
],
|
||||
"description": "",
|
||||
"description": "Use this endpoint to delete an existing push target for messages for the currently logged in user.",
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "No content",
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/target"
|
||||
}
|
||||
}
|
||||
}
|
||||
"description": "No content"
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
|
|
@ -2672,7 +2665,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "account\/delete-push-target.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -4745,7 +4738,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "databases\/get-usage.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-usage.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -5636,7 +5629,7 @@
|
|||
"200": {
|
||||
"description": "AttributeBoolean",
|
||||
"content": {
|
||||
"": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/attributeBoolean"
|
||||
}
|
||||
|
|
@ -5857,7 +5850,7 @@
|
|||
"200": {
|
||||
"description": "AttributeDatetime",
|
||||
"content": {
|
||||
"": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/attributeDatetime"
|
||||
}
|
||||
|
|
@ -6078,7 +6071,7 @@
|
|||
"200": {
|
||||
"description": "AttributeEmail",
|
||||
"content": {
|
||||
"": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/attributeEmail"
|
||||
}
|
||||
|
|
@ -6308,7 +6301,7 @@
|
|||
"200": {
|
||||
"description": "AttributeEnum",
|
||||
"content": {
|
||||
"": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/attributeEnum"
|
||||
}
|
||||
|
|
@ -6548,7 +6541,7 @@
|
|||
"200": {
|
||||
"description": "AttributeFloat",
|
||||
"content": {
|
||||
"": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/attributeFloat"
|
||||
}
|
||||
|
|
@ -6791,7 +6784,7 @@
|
|||
"200": {
|
||||
"description": "AttributeInteger",
|
||||
"content": {
|
||||
"": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/attributeInteger"
|
||||
}
|
||||
|
|
@ -7024,7 +7017,7 @@
|
|||
"200": {
|
||||
"description": "AttributeIP",
|
||||
"content": {
|
||||
"": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/attributeIp"
|
||||
}
|
||||
|
|
@ -7389,7 +7382,7 @@
|
|||
"200": {
|
||||
"description": "AttributeString",
|
||||
"content": {
|
||||
"": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/attributeString"
|
||||
}
|
||||
|
|
@ -7615,7 +7608,7 @@
|
|||
"200": {
|
||||
"description": "AttributeURL",
|
||||
"content": {
|
||||
"": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/attributeUrl"
|
||||
}
|
||||
|
|
@ -7914,7 +7907,7 @@
|
|||
"200": {
|
||||
"description": "AttributeRelationship",
|
||||
"content": {
|
||||
"": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/attributeRelationship"
|
||||
}
|
||||
|
|
@ -8100,151 +8093,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"post": {
|
||||
"summary": "Create document",
|
||||
"operationId": "databasesCreateDocument",
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
"description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Document, or Documents List",
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#\/components\/schemas\/document"
|
||||
},
|
||||
{
|
||||
"$ref": "#\/components\/schemas\/documentList"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createDocument",
|
||||
"weight": 108,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "databases\/create-document.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md",
|
||||
"rate-limit": 120,
|
||||
"rate-time": 60,
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "documents.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents",
|
||||
"offline-key": "{documentId}",
|
||||
"offline-response-key": "$id",
|
||||
"multiplex": {
|
||||
"createDocument": {
|
||||
"name": "Create Document",
|
||||
"parameters": [
|
||||
"documentId",
|
||||
"data",
|
||||
"permissions"
|
||||
],
|
||||
"required": [
|
||||
"documentId",
|
||||
"data"
|
||||
],
|
||||
"response": "document",
|
||||
"description": "\/docs\/references\/databases\/create-document.md"
|
||||
},
|
||||
"createDocuments": {
|
||||
"name": "Create Documents",
|
||||
"parameters": [
|
||||
"documents"
|
||||
],
|
||||
"required": [
|
||||
"documents"
|
||||
],
|
||||
"response": "documentList",
|
||||
"description": "\/docs\/references\/databases\/create-documents.md"
|
||||
}
|
||||
},
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "databaseId",
|
||||
"description": "Database ID.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<DATABASE_ID>"
|
||||
},
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "collectionId",
|
||||
"description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<COLLECTION_ID>"
|
||||
},
|
||||
"in": "path"
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"documentId": {
|
||||
"type": "string",
|
||||
"description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.",
|
||||
"x-example": "<DOCUMENT_ID>"
|
||||
},
|
||||
"data": {
|
||||
"type": "object",
|
||||
"description": "Document data as JSON object.",
|
||||
"x-example": "{}"
|
||||
},
|
||||
"documents": {
|
||||
"type": "array",
|
||||
"description": "Array of documents data as JSON object.",
|
||||
"x-example": null,
|
||||
"items": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"x-example": "[\"read(\"any\")\"]",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"patch": {
|
||||
"summary": "Update documents",
|
||||
"operationId": "databasesUpdateDocuments",
|
||||
|
|
@ -9297,7 +9145,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "databases\/get-collection-usage.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-usage.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -9466,7 +9314,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "databases\/get-database-usage.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-database-usage.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -10141,7 +9989,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "functions\/get-usage.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-functions-usage.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -10949,7 +10797,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "functions\/create-build.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment-build.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -11036,7 +10884,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "functions\/update-deployment-build.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-deployment-build.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -11522,7 +11370,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "functions\/get-function-usage.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-function-usage.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -13458,6 +13306,57 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"\/health\/version": {
|
||||
"get": {
|
||||
"summary": "Get version",
|
||||
"operationId": "healthGetVersion",
|
||||
"tags": [
|
||||
"health"
|
||||
],
|
||||
"description": "Get the version of Appwrite that this instance is currently running.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Health Version",
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/healthVersion"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getVersion",
|
||||
"weight": 128,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "health\/get-version.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "public",
|
||||
"platforms": [
|
||||
"server",
|
||||
"client"
|
||||
],
|
||||
"packaging": false,
|
||||
"offline-model": "",
|
||||
"offline-key": "",
|
||||
"offline-response-key": "$id",
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/locale": {
|
||||
"get": {
|
||||
"summary": "Get user locale",
|
||||
|
|
@ -14696,7 +14595,7 @@
|
|||
"tags": [
|
||||
"messaging"
|
||||
],
|
||||
"description": "Update an email message by its unique ID.\n",
|
||||
"description": "Update an SMS message by its unique ID.\n",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Message",
|
||||
|
|
@ -14716,7 +14615,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "messaging\/update-sms.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -18674,7 +18573,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "migrations\/delete-firebase-auth.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase-deauthorize.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -18802,7 +18701,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "migrations\/list-firebase-projects.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase-projects.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -19656,7 +19555,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "project\/get-usage.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/get-usage.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -23306,11 +23205,11 @@
|
|||
"description": "",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Project",
|
||||
"description": "EmailTemplate",
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/project"
|
||||
"$ref": "#\/components\/schemas\/emailTemplate"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -26666,7 +26565,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "storage\/get-bucket-usage.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket-usage.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -37187,6 +37086,20 @@
|
|||
"diff"
|
||||
]
|
||||
},
|
||||
"healthVersion": {
|
||||
"description": "Health Version",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"version": {
|
||||
"type": "string",
|
||||
"description": "Version of the Appwrite instance.",
|
||||
"x-example": "0.11.0"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"version"
|
||||
]
|
||||
},
|
||||
"metric": {
|
||||
"description": "Metric",
|
||||
"type": "object",
|
||||
|
|
|
|||
|
|
@ -866,10 +866,10 @@
|
|||
],
|
||||
"description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.",
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "No content",
|
||||
"200": {
|
||||
"description": "Session",
|
||||
"content": {
|
||||
"": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/session"
|
||||
}
|
||||
|
|
@ -5140,7 +5140,7 @@
|
|||
"200": {
|
||||
"description": "AttributeBoolean",
|
||||
"content": {
|
||||
"": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/attributeBoolean"
|
||||
}
|
||||
|
|
@ -5363,7 +5363,7 @@
|
|||
"200": {
|
||||
"description": "AttributeDatetime",
|
||||
"content": {
|
||||
"": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/attributeDatetime"
|
||||
}
|
||||
|
|
@ -5586,7 +5586,7 @@
|
|||
"200": {
|
||||
"description": "AttributeEmail",
|
||||
"content": {
|
||||
"": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/attributeEmail"
|
||||
}
|
||||
|
|
@ -5818,7 +5818,7 @@
|
|||
"200": {
|
||||
"description": "AttributeEnum",
|
||||
"content": {
|
||||
"": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/attributeEnum"
|
||||
}
|
||||
|
|
@ -6060,7 +6060,7 @@
|
|||
"200": {
|
||||
"description": "AttributeFloat",
|
||||
"content": {
|
||||
"": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/attributeFloat"
|
||||
}
|
||||
|
|
@ -6305,7 +6305,7 @@
|
|||
"200": {
|
||||
"description": "AttributeInteger",
|
||||
"content": {
|
||||
"": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/attributeInteger"
|
||||
}
|
||||
|
|
@ -6540,7 +6540,7 @@
|
|||
"200": {
|
||||
"description": "AttributeIP",
|
||||
"content": {
|
||||
"": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/attributeIp"
|
||||
}
|
||||
|
|
@ -6908,7 +6908,7 @@
|
|||
"200": {
|
||||
"description": "AttributeString",
|
||||
"content": {
|
||||
"": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/attributeString"
|
||||
}
|
||||
|
|
@ -7136,7 +7136,7 @@
|
|||
"200": {
|
||||
"description": "AttributeURL",
|
||||
"content": {
|
||||
"": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/attributeUrl"
|
||||
}
|
||||
|
|
@ -7438,7 +7438,7 @@
|
|||
"200": {
|
||||
"description": "AttributeRelationship",
|
||||
"content": {
|
||||
"": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/attributeRelationship"
|
||||
}
|
||||
|
|
@ -7627,153 +7627,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"post": {
|
||||
"summary": "Create document",
|
||||
"operationId": "databasesCreateDocument",
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
"description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Document, or Documents List",
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#\/components\/schemas\/document"
|
||||
},
|
||||
{
|
||||
"$ref": "#\/components\/schemas\/documentList"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createDocument",
|
||||
"weight": 108,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "databases\/create-document.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md",
|
||||
"rate-limit": 120,
|
||||
"rate-time": 60,
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "documents.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents",
|
||||
"offline-key": "{documentId}",
|
||||
"offline-response-key": "$id",
|
||||
"multiplex": {
|
||||
"createDocument": {
|
||||
"name": "Create Document",
|
||||
"parameters": [
|
||||
"documentId",
|
||||
"data",
|
||||
"permissions"
|
||||
],
|
||||
"required": [
|
||||
"documentId",
|
||||
"data"
|
||||
],
|
||||
"response": "document",
|
||||
"description": "\/docs\/references\/databases\/create-document.md"
|
||||
},
|
||||
"createDocuments": {
|
||||
"name": "Create Documents",
|
||||
"parameters": [
|
||||
"documents"
|
||||
],
|
||||
"required": [
|
||||
"documents"
|
||||
],
|
||||
"response": "documentList",
|
||||
"description": "\/docs\/references\/databases\/create-documents.md"
|
||||
}
|
||||
},
|
||||
"auth": {
|
||||
"Project": [],
|
||||
"Session": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "databaseId",
|
||||
"description": "Database ID.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<DATABASE_ID>"
|
||||
},
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "collectionId",
|
||||
"description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<COLLECTION_ID>"
|
||||
},
|
||||
"in": "path"
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"documentId": {
|
||||
"type": "string",
|
||||
"description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.",
|
||||
"x-example": "<DOCUMENT_ID>"
|
||||
},
|
||||
"data": {
|
||||
"type": "object",
|
||||
"description": "Document data as JSON object.",
|
||||
"x-example": "{}"
|
||||
},
|
||||
"documents": {
|
||||
"type": "array",
|
||||
"description": "Array of documents data as JSON object.",
|
||||
"x-example": null,
|
||||
"items": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"x-example": "[\"read(\"any\")\"]",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"patch": {
|
||||
"summary": "Update documents",
|
||||
"operationId": "databasesUpdateDocuments",
|
||||
|
|
@ -9833,7 +9686,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "functions\/create-build.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment-build.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -9921,7 +9774,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "functions\/update-deployment-build.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-deployment-build.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -12300,6 +12153,57 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"\/health\/version": {
|
||||
"get": {
|
||||
"summary": "Get version",
|
||||
"operationId": "healthGetVersion",
|
||||
"tags": [
|
||||
"health"
|
||||
],
|
||||
"description": "Get the version of Appwrite that this instance is currently running.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Health Version",
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/healthVersion"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getVersion",
|
||||
"weight": 128,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "health\/get-version.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "public",
|
||||
"platforms": [
|
||||
"server",
|
||||
"client"
|
||||
],
|
||||
"packaging": false,
|
||||
"offline-model": "",
|
||||
"offline-key": "",
|
||||
"offline-response-key": "$id",
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/locale": {
|
||||
"get": {
|
||||
"summary": "Get user locale",
|
||||
|
|
@ -13560,7 +13464,7 @@
|
|||
"tags": [
|
||||
"messaging"
|
||||
],
|
||||
"description": "Update an email message by its unique ID.\n",
|
||||
"description": "Update an SMS message by its unique ID.\n",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Message",
|
||||
|
|
@ -13580,7 +13484,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "messaging\/update-sms.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -26809,6 +26713,20 @@
|
|||
"diff"
|
||||
]
|
||||
},
|
||||
"healthVersion": {
|
||||
"description": "Health Version",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"version": {
|
||||
"type": "string",
|
||||
"description": "Version of the Appwrite instance.",
|
||||
"x-example": "0.11.0"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"version"
|
||||
]
|
||||
},
|
||||
"headers": {
|
||||
"description": "Headers",
|
||||
"type": "object",
|
||||
|
|
|
|||
|
|
@ -367,7 +367,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"account"
|
||||
],
|
||||
|
|
@ -778,7 +780,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"account"
|
||||
],
|
||||
|
|
@ -922,14 +926,19 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"account"
|
||||
],
|
||||
"description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.",
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "No content"
|
||||
"200": {
|
||||
"description": "Session",
|
||||
"schema": {
|
||||
"$ref": "#\/definitions\/session"
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
|
|
@ -1806,7 +1815,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"account"
|
||||
],
|
||||
|
|
@ -2490,7 +2501,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"account"
|
||||
],
|
||||
|
|
@ -2611,7 +2624,7 @@
|
|||
"tags": [
|
||||
"account"
|
||||
],
|
||||
"description": "",
|
||||
"description": "Use this endpoint to update an existing push target for messages for the currently logged in user.",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Target",
|
||||
|
|
@ -2627,7 +2640,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "account\/create-push-target.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -2697,7 +2710,7 @@
|
|||
"tags": [
|
||||
"account"
|
||||
],
|
||||
"description": "",
|
||||
"description": "Use this endpoint to create a new push target for messages for the currently logged in user.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Target",
|
||||
|
|
@ -2713,7 +2726,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "account\/update-push-target.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -2776,7 +2789,7 @@
|
|||
"tags": [
|
||||
"account"
|
||||
],
|
||||
"description": "",
|
||||
"description": "Use this endpoint to delete an existing push target for messages for the currently logged in user.",
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "No content"
|
||||
|
|
@ -2789,7 +2802,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "account\/delete-push-target.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -4697,151 +4710,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"post": {
|
||||
"summary": "Create document",
|
||||
"operationId": "databasesCreateDocument",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
"description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Document, or Documents List",
|
||||
"schema": {
|
||||
"x-oneOf": [
|
||||
{
|
||||
"$ref": "#\/definitions\/document"
|
||||
},
|
||||
{
|
||||
"$ref": "#\/definitions\/documentList"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createDocument",
|
||||
"weight": 108,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "databases\/create-document.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md",
|
||||
"rate-limit": 120,
|
||||
"rate-time": 60,
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "documents.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents",
|
||||
"offline-key": "{documentId}",
|
||||
"offline-response-key": "$id",
|
||||
"multiplex": {
|
||||
"createDocument": {
|
||||
"name": "Create Document",
|
||||
"parameters": [
|
||||
"documentId",
|
||||
"data",
|
||||
"permissions"
|
||||
],
|
||||
"required": [
|
||||
"documentId",
|
||||
"data"
|
||||
],
|
||||
"response": "document",
|
||||
"description": "\/docs\/references\/databases\/create-document.md"
|
||||
},
|
||||
"createDocuments": {
|
||||
"name": "Create Documents",
|
||||
"parameters": [
|
||||
"documents"
|
||||
],
|
||||
"required": [
|
||||
"documents"
|
||||
],
|
||||
"response": "documentList",
|
||||
"description": "\/docs\/references\/databases\/create-documents.md"
|
||||
}
|
||||
},
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"JWT": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "databaseId",
|
||||
"description": "Database ID.",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
"x-example": "<DATABASE_ID>",
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "collectionId",
|
||||
"description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
"x-example": "<COLLECTION_ID>",
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "payload",
|
||||
"in": "body",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"documentId": {
|
||||
"type": "string",
|
||||
"description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.",
|
||||
"default": "",
|
||||
"x-example": "<DOCUMENT_ID>"
|
||||
},
|
||||
"data": {
|
||||
"type": "object",
|
||||
"description": "Document data as JSON object.",
|
||||
"default": [],
|
||||
"x-example": "{}"
|
||||
},
|
||||
"documents": {
|
||||
"type": "array",
|
||||
"description": "Array of documents data as JSON object.",
|
||||
"default": [],
|
||||
"x-example": null,
|
||||
"items": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"default": null,
|
||||
"x-example": "[\"read(\"any\")\"]",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"patch": {
|
||||
"summary": "Update documents",
|
||||
"operationId": "databasesUpdateDocuments",
|
||||
|
|
@ -5241,7 +5109,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -5743,6 +5613,59 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"\/health\/version": {
|
||||
"get": {
|
||||
"summary": "Get version",
|
||||
"operationId": "healthGetVersion",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"health"
|
||||
],
|
||||
"description": "Get the version of Appwrite that this instance is currently running.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Health Version",
|
||||
"schema": {
|
||||
"$ref": "#\/definitions\/healthVersion"
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getVersion",
|
||||
"weight": 128,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "health\/get-version.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "public",
|
||||
"platforms": [
|
||||
"server",
|
||||
"client"
|
||||
],
|
||||
"packaging": false,
|
||||
"offline-model": "",
|
||||
"offline-key": "",
|
||||
"offline-response-key": "$id",
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/locale": {
|
||||
"get": {
|
||||
"summary": "Get user locale",
|
||||
|
|
@ -6709,7 +6632,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"storage"
|
||||
],
|
||||
|
|
@ -7444,7 +7369,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"teams"
|
||||
],
|
||||
|
|
@ -7872,7 +7799,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"teams"
|
||||
],
|
||||
|
|
@ -10021,6 +9950,20 @@
|
|||
"countryName"
|
||||
]
|
||||
},
|
||||
"healthVersion": {
|
||||
"description": "Health Version",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"version": {
|
||||
"type": "string",
|
||||
"description": "Version of the Appwrite instance.",
|
||||
"x-example": "0.11.0"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"version"
|
||||
]
|
||||
},
|
||||
"headers": {
|
||||
"description": "Headers",
|
||||
"type": "object",
|
||||
|
|
|
|||
|
|
@ -225,7 +225,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"account"
|
||||
],
|
||||
|
|
@ -421,7 +423,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"account"
|
||||
],
|
||||
|
|
@ -827,7 +831,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"account"
|
||||
],
|
||||
|
|
@ -970,14 +976,19 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"account"
|
||||
],
|
||||
"description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.",
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "No content"
|
||||
"200": {
|
||||
"description": "Session",
|
||||
"schema": {
|
||||
"$ref": "#\/definitions\/session"
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
|
|
@ -1841,7 +1852,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"account"
|
||||
],
|
||||
|
|
@ -2522,7 +2535,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"account"
|
||||
],
|
||||
|
|
@ -2641,7 +2656,7 @@
|
|||
"tags": [
|
||||
"account"
|
||||
],
|
||||
"description": "",
|
||||
"description": "Use this endpoint to update an existing push target for messages for the currently logged in user.",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Target",
|
||||
|
|
@ -2657,7 +2672,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "account\/create-push-target.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -2726,7 +2741,7 @@
|
|||
"tags": [
|
||||
"account"
|
||||
],
|
||||
"description": "",
|
||||
"description": "Use this endpoint to create a new push target for messages for the currently logged in user.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Target",
|
||||
|
|
@ -2742,7 +2757,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "account\/update-push-target.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -2804,7 +2819,7 @@
|
|||
"tags": [
|
||||
"account"
|
||||
],
|
||||
"description": "",
|
||||
"description": "Use this endpoint to delete an existing push target for messages for the currently logged in user.",
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "No content"
|
||||
|
|
@ -2817,7 +2832,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "account\/delete-push-target.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -4948,7 +4963,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "databases\/get-usage.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-usage.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -5146,7 +5161,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -5572,7 +5589,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -5829,7 +5848,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -6045,7 +6066,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -6261,7 +6284,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -6487,7 +6512,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -6725,7 +6752,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -6967,7 +6996,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -7197,7 +7228,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -7561,7 +7594,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -7783,7 +7818,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -7998,7 +8035,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -8071,7 +8110,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -8253,151 +8294,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"post": {
|
||||
"summary": "Create document",
|
||||
"operationId": "databasesCreateDocument",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
"description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Document, or Documents List",
|
||||
"schema": {
|
||||
"x-oneOf": [
|
||||
{
|
||||
"$ref": "#\/definitions\/document"
|
||||
},
|
||||
{
|
||||
"$ref": "#\/definitions\/documentList"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createDocument",
|
||||
"weight": 108,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "databases\/create-document.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md",
|
||||
"rate-limit": 120,
|
||||
"rate-time": 60,
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "documents.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents",
|
||||
"offline-key": "{documentId}",
|
||||
"offline-response-key": "$id",
|
||||
"multiplex": {
|
||||
"createDocument": {
|
||||
"name": "Create Document",
|
||||
"parameters": [
|
||||
"documentId",
|
||||
"data",
|
||||
"permissions"
|
||||
],
|
||||
"required": [
|
||||
"documentId",
|
||||
"data"
|
||||
],
|
||||
"response": "document",
|
||||
"description": "\/docs\/references\/databases\/create-document.md"
|
||||
},
|
||||
"createDocuments": {
|
||||
"name": "Create Documents",
|
||||
"parameters": [
|
||||
"documents"
|
||||
],
|
||||
"required": [
|
||||
"documents"
|
||||
],
|
||||
"response": "documentList",
|
||||
"description": "\/docs\/references\/databases\/create-documents.md"
|
||||
}
|
||||
},
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "databaseId",
|
||||
"description": "Database ID.",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
"x-example": "<DATABASE_ID>",
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "collectionId",
|
||||
"description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
"x-example": "<COLLECTION_ID>",
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "payload",
|
||||
"in": "body",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"documentId": {
|
||||
"type": "string",
|
||||
"description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.",
|
||||
"default": "",
|
||||
"x-example": "<DOCUMENT_ID>"
|
||||
},
|
||||
"data": {
|
||||
"type": "object",
|
||||
"description": "Document data as JSON object.",
|
||||
"default": [],
|
||||
"x-example": "{}"
|
||||
},
|
||||
"documents": {
|
||||
"type": "array",
|
||||
"description": "Array of documents data as JSON object.",
|
||||
"default": [],
|
||||
"x-example": null,
|
||||
"items": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"default": null,
|
||||
"x-example": "[\"read(\"any\")\"]",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"patch": {
|
||||
"summary": "Update documents",
|
||||
"operationId": "databasesUpdateDocuments",
|
||||
|
|
@ -8797,7 +8693,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -9243,7 +9141,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -9420,7 +9320,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "databases\/get-collection-usage.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-usage.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -9584,7 +9484,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "databases\/get-database-usage.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-database-usage.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -10280,7 +10180,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "functions\/get-usage.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-functions-usage.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -10641,7 +10541,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"functions"
|
||||
],
|
||||
|
|
@ -11013,7 +10915,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"functions"
|
||||
],
|
||||
|
|
@ -11079,7 +10983,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"functions"
|
||||
],
|
||||
|
|
@ -11096,7 +11002,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "functions\/create-build.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment-build.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -11180,7 +11086,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "functions\/update-deployment-build.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-deployment-build.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -11580,7 +11486,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"functions"
|
||||
],
|
||||
|
|
@ -11668,7 +11576,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "functions\/get-function-usage.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-function-usage.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -12039,7 +11947,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"functions"
|
||||
],
|
||||
|
|
@ -13654,6 +13564,59 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"\/health\/version": {
|
||||
"get": {
|
||||
"summary": "Get version",
|
||||
"operationId": "healthGetVersion",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"health"
|
||||
],
|
||||
"description": "Get the version of Appwrite that this instance is currently running.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Health Version",
|
||||
"schema": {
|
||||
"$ref": "#\/definitions\/healthVersion"
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getVersion",
|
||||
"weight": 128,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "health\/get-version.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "public",
|
||||
"platforms": [
|
||||
"server",
|
||||
"client"
|
||||
],
|
||||
"packaging": false,
|
||||
"offline-model": "",
|
||||
"offline-key": "",
|
||||
"offline-response-key": "$id",
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/locale": {
|
||||
"get": {
|
||||
"summary": "Get user locale",
|
||||
|
|
@ -14976,7 +14939,7 @@
|
|||
"tags": [
|
||||
"messaging"
|
||||
],
|
||||
"description": "Update an email message by its unique ID.\n",
|
||||
"description": "Update an SMS message by its unique ID.\n",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Message",
|
||||
|
|
@ -14992,7 +14955,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "messaging\/update-sms.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -19112,7 +19075,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "migrations\/delete-firebase-auth.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase-deauthorize.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -19246,7 +19209,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "migrations\/list-firebase-projects.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase-projects.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -20018,7 +19981,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"migrations"
|
||||
],
|
||||
|
|
@ -20097,7 +20062,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "project\/get-usage.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/get-usage.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -20434,7 +20399,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"project"
|
||||
],
|
||||
|
|
@ -20908,7 +20875,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"projects"
|
||||
],
|
||||
|
|
@ -22390,7 +22359,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"projects"
|
||||
],
|
||||
|
|
@ -22952,7 +22923,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"projects"
|
||||
],
|
||||
|
|
@ -23333,7 +23306,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"projects"
|
||||
],
|
||||
|
|
@ -23779,9 +23754,9 @@
|
|||
"description": "",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Project",
|
||||
"description": "EmailTemplate",
|
||||
"schema": {
|
||||
"$ref": "#\/definitions\/project"
|
||||
"$ref": "#\/definitions\/emailTemplate"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -25314,7 +25289,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"projects"
|
||||
],
|
||||
|
|
@ -25673,7 +25650,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"proxy"
|
||||
],
|
||||
|
|
@ -26208,7 +26187,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"storage"
|
||||
],
|
||||
|
|
@ -26613,7 +26594,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"storage"
|
||||
],
|
||||
|
|
@ -27127,7 +27110,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "storage\/get-bucket-usage.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket-usage.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -27504,7 +27487,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"teams"
|
||||
],
|
||||
|
|
@ -28006,7 +27991,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"teams"
|
||||
],
|
||||
|
|
@ -28749,7 +28736,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"users"
|
||||
],
|
||||
|
|
@ -29484,7 +29473,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"users"
|
||||
],
|
||||
|
|
@ -30841,7 +30832,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"users"
|
||||
],
|
||||
|
|
@ -30899,7 +30892,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"users"
|
||||
],
|
||||
|
|
@ -32177,7 +32172,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"vcs"
|
||||
],
|
||||
|
|
@ -32395,7 +32392,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"vcs"
|
||||
],
|
||||
|
|
@ -37702,6 +37701,20 @@
|
|||
"diff"
|
||||
]
|
||||
},
|
||||
"healthVersion": {
|
||||
"description": "Health Version",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"version": {
|
||||
"type": "string",
|
||||
"description": "Version of the Appwrite instance.",
|
||||
"x-example": "0.11.0"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"version"
|
||||
]
|
||||
},
|
||||
"metric": {
|
||||
"description": "Metric",
|
||||
"type": "object",
|
||||
|
|
|
|||
|
|
@ -385,7 +385,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"account"
|
||||
],
|
||||
|
|
@ -801,7 +803,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"account"
|
||||
],
|
||||
|
|
@ -946,14 +950,19 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"account"
|
||||
],
|
||||
"description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.",
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "No content"
|
||||
"200": {
|
||||
"description": "Session",
|
||||
"schema": {
|
||||
"$ref": "#\/definitions\/session"
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
|
|
@ -1843,7 +1852,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"account"
|
||||
],
|
||||
|
|
@ -2395,7 +2406,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"account"
|
||||
],
|
||||
|
|
@ -4629,7 +4642,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -5060,7 +5075,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -5320,7 +5337,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -5538,7 +5557,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -5756,7 +5777,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -5984,7 +6007,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -6224,7 +6249,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -6468,7 +6495,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -6700,7 +6729,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -7067,7 +7098,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -7291,7 +7324,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -7508,7 +7543,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -7582,7 +7619,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -7767,153 +7806,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"post": {
|
||||
"summary": "Create document",
|
||||
"operationId": "databasesCreateDocument",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
"description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Document, or Documents List",
|
||||
"schema": {
|
||||
"x-oneOf": [
|
||||
{
|
||||
"$ref": "#\/definitions\/document"
|
||||
},
|
||||
{
|
||||
"$ref": "#\/definitions\/documentList"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createDocument",
|
||||
"weight": 108,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "databases\/create-document.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md",
|
||||
"rate-limit": 120,
|
||||
"rate-time": 60,
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "documents.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents",
|
||||
"offline-key": "{documentId}",
|
||||
"offline-response-key": "$id",
|
||||
"multiplex": {
|
||||
"createDocument": {
|
||||
"name": "Create Document",
|
||||
"parameters": [
|
||||
"documentId",
|
||||
"data",
|
||||
"permissions"
|
||||
],
|
||||
"required": [
|
||||
"documentId",
|
||||
"data"
|
||||
],
|
||||
"response": "document",
|
||||
"description": "\/docs\/references\/databases\/create-document.md"
|
||||
},
|
||||
"createDocuments": {
|
||||
"name": "Create Documents",
|
||||
"parameters": [
|
||||
"documents"
|
||||
],
|
||||
"required": [
|
||||
"documents"
|
||||
],
|
||||
"response": "documentList",
|
||||
"description": "\/docs\/references\/databases\/create-documents.md"
|
||||
}
|
||||
},
|
||||
"auth": {
|
||||
"Project": [],
|
||||
"Session": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "databaseId",
|
||||
"description": "Database ID.",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
"x-example": "<DATABASE_ID>",
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "collectionId",
|
||||
"description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
"x-example": "<COLLECTION_ID>",
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "payload",
|
||||
"in": "body",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"documentId": {
|
||||
"type": "string",
|
||||
"description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.",
|
||||
"default": "",
|
||||
"x-example": "<DOCUMENT_ID>"
|
||||
},
|
||||
"data": {
|
||||
"type": "object",
|
||||
"description": "Document data as JSON object.",
|
||||
"default": [],
|
||||
"x-example": "{}"
|
||||
},
|
||||
"documents": {
|
||||
"type": "array",
|
||||
"description": "Array of documents data as JSON object.",
|
||||
"default": [],
|
||||
"x-example": null,
|
||||
"items": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"default": null,
|
||||
"x-example": "[\"read(\"any\")\"]",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"patch": {
|
||||
"summary": "Update documents",
|
||||
"operationId": "databasesUpdateDocuments",
|
||||
|
|
@ -8321,7 +8213,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -8682,7 +8576,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
|
|
@ -9525,7 +9421,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"functions"
|
||||
],
|
||||
|
|
@ -9902,7 +9800,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"functions"
|
||||
],
|
||||
|
|
@ -9969,7 +9869,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"functions"
|
||||
],
|
||||
|
|
@ -9986,7 +9888,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "functions\/create-build.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment-build.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -10071,7 +9973,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "functions\/update-deployment-build.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-deployment-build.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -10479,7 +10381,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"functions"
|
||||
],
|
||||
|
|
@ -10861,7 +10765,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"functions"
|
||||
],
|
||||
|
|
@ -12504,6 +12410,59 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"\/health\/version": {
|
||||
"get": {
|
||||
"summary": "Get version",
|
||||
"operationId": "healthGetVersion",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"health"
|
||||
],
|
||||
"description": "Get the version of Appwrite that this instance is currently running.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Health Version",
|
||||
"schema": {
|
||||
"$ref": "#\/definitions\/healthVersion"
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getVersion",
|
||||
"weight": 128,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "health\/get-version.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "public",
|
||||
"platforms": [
|
||||
"server",
|
||||
"client"
|
||||
],
|
||||
"packaging": false,
|
||||
"offline-model": "",
|
||||
"offline-key": "",
|
||||
"offline-response-key": "$id",
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/locale": {
|
||||
"get": {
|
||||
"summary": "Get user locale",
|
||||
|
|
@ -13848,7 +13807,7 @@
|
|||
"tags": [
|
||||
"messaging"
|
||||
],
|
||||
"description": "Update an email message by its unique ID.\n",
|
||||
"description": "Update an SMS message by its unique ID.\n",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Message",
|
||||
|
|
@ -13864,7 +13823,7 @@
|
|||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "messaging\/update-sms.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
|
|
@ -18081,7 +18040,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"storage"
|
||||
],
|
||||
|
|
@ -18495,7 +18456,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"storage"
|
||||
],
|
||||
|
|
@ -19246,7 +19209,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"teams"
|
||||
],
|
||||
|
|
@ -19684,7 +19649,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"teams"
|
||||
],
|
||||
|
|
@ -20440,7 +20407,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"users"
|
||||
],
|
||||
|
|
@ -21108,7 +21077,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"users"
|
||||
],
|
||||
|
|
@ -22484,7 +22455,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"users"
|
||||
],
|
||||
|
|
@ -22543,7 +22516,9 @@
|
|||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"users"
|
||||
],
|
||||
|
|
@ -27295,6 +27270,20 @@
|
|||
"diff"
|
||||
]
|
||||
},
|
||||
"healthVersion": {
|
||||
"description": "Health Version",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"version": {
|
||||
"type": "string",
|
||||
"description": "Version of the Appwrite instance.",
|
||||
"x-example": "0.11.0"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"version"
|
||||
]
|
||||
},
|
||||
"headers": {
|
||||
"description": "Headers",
|
||||
"type": "object",
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,10 @@
|
|||
<?php
|
||||
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\MethodType;
|
||||
use Appwrite\SDK\ResponseType;
|
||||
use Appwrite\URL\URL as URLParse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use chillerlan\QRCode\QRCode;
|
||||
|
|
@ -164,13 +168,16 @@ App::get('/v1/avatars/credit-cards/:code')
|
|||
->label('scope', 'avatars.read')
|
||||
->label('cache', true)
|
||||
->label('cache.resource', 'avatar/credit-card')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'avatars')
|
||||
->label('sdk.method', 'getCreditCard')
|
||||
->label('sdk.methodType', 'location')
|
||||
->label('sdk.description', '/docs/references/avatars/get-credit-card.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE_PNG)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'avatars',
|
||||
name: 'getCreditCard',
|
||||
description: '/docs/references/avatars/get-credit-card.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
methodType: MethodType::LOCATION,
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::IMAGE_PNG,
|
||||
responseModel: Response::MODEL_NONE
|
||||
))
|
||||
->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-credit-cards'))), 'Credit Card Code. Possible values: ' . \implode(', ', \array_keys(Config::getParam('avatar-credit-cards'))) . '.')
|
||||
->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true)
|
||||
->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true)
|
||||
|
|
@ -184,13 +191,16 @@ App::get('/v1/avatars/browsers/:code')
|
|||
->label('scope', 'avatars.read')
|
||||
->label('cache', true)
|
||||
->label('cache.resource', 'avatar/browser')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'avatars')
|
||||
->label('sdk.method', 'getBrowser')
|
||||
->label('sdk.methodType', 'location')
|
||||
->label('sdk.description', '/docs/references/avatars/get-browser.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE_PNG)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'avatars',
|
||||
name: 'getBrowser',
|
||||
description: '/docs/references/avatars/get-browser.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
methodType: MethodType::LOCATION,
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::IMAGE_PNG,
|
||||
responseModel: Response::MODEL_NONE
|
||||
))
|
||||
->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-browsers'))), 'Browser Code.')
|
||||
->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true)
|
||||
->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true)
|
||||
|
|
@ -204,13 +214,16 @@ App::get('/v1/avatars/flags/:code')
|
|||
->label('scope', 'avatars.read')
|
||||
->label('cache', true)
|
||||
->label('cache.resource', 'avatar/flag')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'avatars')
|
||||
->label('sdk.method', 'getFlag')
|
||||
->label('sdk.methodType', 'location')
|
||||
->label('sdk.description', '/docs/references/avatars/get-flag.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE_PNG)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'avatars',
|
||||
name: 'getFlag',
|
||||
description: '/docs/references/avatars/get-flag.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
methodType: MethodType::LOCATION,
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::IMAGE_PNG,
|
||||
responseModel: Response::MODEL_NONE
|
||||
))
|
||||
->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-flags'))), 'Country Code. ISO Alpha-2 country code format.')
|
||||
->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true)
|
||||
->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true)
|
||||
|
|
@ -224,13 +237,16 @@ App::get('/v1/avatars/image')
|
|||
->label('scope', 'avatars.read')
|
||||
->label('cache', true)
|
||||
->label('cache.resource', 'avatar/image')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'avatars')
|
||||
->label('sdk.method', 'getImage')
|
||||
->label('sdk.methodType', 'location')
|
||||
->label('sdk.description', '/docs/references/avatars/get-image.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'avatars',
|
||||
name: 'getImage',
|
||||
description: '/docs/references/avatars/get-image.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
methodType: MethodType::LOCATION,
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::IMAGE,
|
||||
responseModel: Response::MODEL_NONE
|
||||
))
|
||||
->param('url', '', new URL(['http', 'https']), 'Image URL which you want to crop.')
|
||||
->param('width', 400, new Range(0, 2000), 'Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.', true)
|
||||
->param('height', 400, new Range(0, 2000), 'Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.', true)
|
||||
|
|
@ -287,13 +303,16 @@ App::get('/v1/avatars/favicon')
|
|||
->label('scope', 'avatars.read')
|
||||
->label('cache', true)
|
||||
->label('cache.resource', 'avatar/favicon')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'avatars')
|
||||
->label('sdk.method', 'getFavicon')
|
||||
->label('sdk.methodType', 'location')
|
||||
->label('sdk.description', '/docs/references/avatars/get-favicon.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'avatars',
|
||||
name: 'getFavicon',
|
||||
description: '/docs/references/avatars/get-favicon.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
methodType: MethodType::LOCATION,
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::IMAGE,
|
||||
responseModel: Response::MODEL_NONE
|
||||
))
|
||||
->param('url', '', new URL(['http', 'https']), 'Website URL which you want to fetch the favicon from.')
|
||||
->inject('response')
|
||||
->action(function (string $url, Response $response) {
|
||||
|
|
@ -430,13 +449,16 @@ App::get('/v1/avatars/qr')
|
|||
->desc('Get QR code')
|
||||
->groups(['api', 'avatars'])
|
||||
->label('scope', 'avatars.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'avatars')
|
||||
->label('sdk.method', 'getQR')
|
||||
->label('sdk.methodType', 'location')
|
||||
->label('sdk.description', '/docs/references/avatars/get-qr.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE_PNG)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'avatars',
|
||||
name: 'getQR',
|
||||
description: '/docs/references/avatars/get-qr.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
methodType: MethodType::LOCATION,
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::IMAGE_PNG,
|
||||
responseModel: Response::MODEL_NONE
|
||||
))
|
||||
->param('text', '', new Text(512), 'Plain text to be converted to QR code image.')
|
||||
->param('size', 400, new Range(1, 1000), 'QR code size. Pass an integer between 1 to 1000. Defaults to 400.', true)
|
||||
->param('margin', 1, new Range(0, 10), 'Margin from edge. Pass an integer between 0 to 10. Defaults to 1.', true)
|
||||
|
|
@ -471,13 +493,16 @@ App::get('/v1/avatars/initials')
|
|||
->groups(['api', 'avatars'])
|
||||
->label('scope', 'avatars.read')
|
||||
->label('cache.resource', 'avatar/initials')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'avatars')
|
||||
->label('sdk.method', 'getInitials')
|
||||
->label('sdk.methodType', 'location')
|
||||
->label('sdk.description', '/docs/references/avatars/get-initials.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE_PNG)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'avatars',
|
||||
name: 'getInitials',
|
||||
description: '/docs/references/avatars/get-initials.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
methodType: MethodType::LOCATION,
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::IMAGE_PNG,
|
||||
responseModel: Response::MODEL_NONE
|
||||
))
|
||||
->param('name', '', new Text(128), 'Full Name. When empty, current user name or email will be used. Max length: 128 chars.', true)
|
||||
->param('width', 500, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true)
|
||||
->param('height', 500, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
<?php
|
||||
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\ResponseType;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\App;
|
||||
use Utopia\Database\Document;
|
||||
|
|
@ -21,13 +24,15 @@ App::get('/v1/console/variables')
|
|||
->desc('Get variables')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'console')
|
||||
->label('sdk.method', 'variables')
|
||||
->label('sdk.description', '/docs/references/console/variables.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_CONSOLE_VARIABLES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'console',
|
||||
name: 'variables',
|
||||
description: '/docs/references/console/variables.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_CONSOLE_VARIABLES,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->inject('response')
|
||||
->action(function (Response $response) {
|
||||
$isDomainEnabled = !empty(System::getEnv('_APP_DOMAIN', ''))
|
||||
|
|
@ -60,12 +65,15 @@ App::post('/v1/console/assistant')
|
|||
->desc('Ask query')
|
||||
->groups(['api', 'assistant'])
|
||||
->label('scope', 'assistant.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'assistant')
|
||||
->label('sdk.method', 'chat')
|
||||
->label('sdk.description', '/docs/references/assistant/chat.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_TEXT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'assistant',
|
||||
name: 'chat',
|
||||
description: '/docs/references/assistant/chat.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_NONE,
|
||||
responseType: ResponseType::TEXT
|
||||
))
|
||||
->label('abuse-limit', 15)
|
||||
->label('abuse-key', 'userId:{userId}')
|
||||
->param('prompt', '', new Text(2000), 'Prompt. A string containing questions asked to the AI assistant.')
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -14,6 +14,10 @@ use Appwrite\Functions\Validator\Headers;
|
|||
use Appwrite\Functions\Validator\RuntimeSpecification;
|
||||
use Appwrite\Messaging\Adapter\Realtime;
|
||||
use Appwrite\Platform\Tasks\ScheduleExecutions;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\MethodType;
|
||||
use Appwrite\SDK\ResponseType;
|
||||
use Appwrite\Task\Validator\Cron;
|
||||
use Appwrite\Utopia\Database\Validator\CustomId;
|
||||
use Appwrite\Utopia\Database\Validator\Queries\Deployments;
|
||||
|
|
@ -141,13 +145,15 @@ App::post('/v1/functions')
|
|||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('audits.event', 'function.create')
|
||||
->label('audits.resource', 'function/{response.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'create')
|
||||
->label('sdk.description', '/docs/references/functions/create-function.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_FUNCTION)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'create',
|
||||
description: '/docs/references/functions/create-function.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_FUNCTION,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('functionId', '', new CustomId(), 'Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
|
||||
->param('name', '', new Text(128), 'Function name. Max length: 128 chars.')
|
||||
->param('runtime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Execution runtime.')
|
||||
|
|
@ -402,13 +408,15 @@ App::get('/v1/functions')
|
|||
->desc('List functions')
|
||||
->label('scope', 'functions.read')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'list')
|
||||
->label('sdk.description', '/docs/references/functions/list-functions.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_FUNCTION_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'list',
|
||||
description: '/docs/references/functions/list-functions.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_FUNCTION_LIST,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('queries', [], new Functions(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Functions::ALLOWED_ATTRIBUTES), true)
|
||||
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
|
||||
->inject('response')
|
||||
|
|
@ -463,13 +471,15 @@ App::get('/v1/functions/runtimes')
|
|||
->desc('List runtimes')
|
||||
->label('scope', 'functions.read')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'listRuntimes')
|
||||
->label('sdk.description', '/docs/references/functions/list-runtimes.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_RUNTIME_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'listRuntimes',
|
||||
description: '/docs/references/functions/list-runtimes.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_RUNTIME_LIST,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->inject('response')
|
||||
->action(function (Response $response) {
|
||||
$runtimes = Config::getParam('runtimes');
|
||||
|
|
@ -497,13 +507,15 @@ App::get('/v1/functions/specifications')
|
|||
->desc('List available function runtime specifications')
|
||||
->label('scope', 'functions.read')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'listSpecifications')
|
||||
->label('sdk.description', '/docs/references/functions/list-specifications.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_SPECIFICATION_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'listSpecifications',
|
||||
description: '/docs/references/functions/list-specifications.md',
|
||||
auth: [AuthType::KEY, AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_SPECIFICATION_LIST,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->inject('response')
|
||||
->inject('plan')
|
||||
->action(function (Response $response, array $plan) {
|
||||
|
|
@ -534,13 +546,15 @@ App::get('/v1/functions/:functionId')
|
|||
->desc('Get function')
|
||||
->label('scope', 'functions.read')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'get')
|
||||
->label('sdk.description', '/docs/references/functions/get-function.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_FUNCTION)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'get',
|
||||
description: '/docs/references/functions/get-function.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_FUNCTION,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
@ -559,12 +573,15 @@ App::get('/v1/functions/:functionId/usage')
|
|||
->groups(['api', 'functions', 'usage'])
|
||||
->label('scope', 'functions.read')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'getFunctionUsage')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USAGE_FUNCTION)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'getFunctionUsage',
|
||||
description: '/docs/references/functions/get-function-usage.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_USAGE_FUNCTION,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true)
|
||||
->inject('response')
|
||||
|
|
@ -664,12 +681,15 @@ App::get('/v1/functions/usage')
|
|||
->groups(['api', 'functions'])
|
||||
->label('scope', 'functions.read')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'getUsage')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USAGE_FUNCTIONS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'getUsage',
|
||||
description: '/docs/references/functions/get-functions-usage.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_USAGE_FUNCTIONS,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true)
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
@ -767,13 +787,15 @@ App::put('/v1/functions/:functionId')
|
|||
->label('event', 'functions.[functionId].update')
|
||||
->label('audits.event', 'function.update')
|
||||
->label('audits.resource', 'function/{response.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'update')
|
||||
->label('sdk.description', '/docs/references/functions/update-function.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_FUNCTION)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'update',
|
||||
description: '/docs/references/functions/update-function.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_FUNCTION,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
->param('name', '', new Text(128), 'Function name. Max length: 128 chars.')
|
||||
->param('runtime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Execution runtime.', true)
|
||||
|
|
@ -967,13 +989,16 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId/download')
|
|||
->desc('Download deployment')
|
||||
->label('scope', 'functions.read')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'getDeploymentDownload')
|
||||
->label('sdk.description', '/docs/references/functions/get-deployment-download.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', '*/*')
|
||||
->label('sdk.methodType', 'location')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'getDeploymentDownload',
|
||||
description: '/docs/references/functions/get-deployment-download.md',
|
||||
auth: [AuthType::KEY, AuthType::JWT],
|
||||
responseModel: Response::MODEL_NONE,
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::ANY,
|
||||
methodType: MethodType::LOCATION
|
||||
))
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
->param('deploymentId', '', new UID(), 'Deployment ID.')
|
||||
->inject('response')
|
||||
|
|
@ -1056,13 +1081,15 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId')
|
|||
->label('event', 'functions.[functionId].deployments.[deploymentId].update')
|
||||
->label('audits.event', 'deployment.update')
|
||||
->label('audits.resource', 'function/{request.functionId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'updateDeployment')
|
||||
->label('sdk.description', '/docs/references/functions/update-function-deployment.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_FUNCTION)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'updateDeployment',
|
||||
description: '/docs/references/functions/update-function-deployment.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_FUNCTION,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
->param('deploymentId', '', new UID(), 'Deployment ID.')
|
||||
->inject('response')
|
||||
|
|
@ -1119,12 +1146,14 @@ App::delete('/v1/functions/:functionId')
|
|||
->label('event', 'functions.[functionId].delete')
|
||||
->label('audits.event', 'function.delete')
|
||||
->label('audits.resource', 'function/{request.functionId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'delete')
|
||||
->label('sdk.description', '/docs/references/functions/delete-function.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'delete',
|
||||
description: '/docs/references/functions/delete-function.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT,
|
||||
responseModel: Response::MODEL_NONE
|
||||
))
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
@ -1167,16 +1196,18 @@ App::post('/v1/functions/:functionId/deployments')
|
|||
->label('event', 'functions.[functionId].deployments.[deploymentId].create')
|
||||
->label('audits.event', 'deployment.create')
|
||||
->label('audits.resource', 'function/{request.functionId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'createDeployment')
|
||||
->label('sdk.methodType', 'upload')
|
||||
->label('sdk.description', '/docs/references/functions/create-deployment.md')
|
||||
->label('sdk.packaging', true)
|
||||
->label('sdk.request.type', 'multipart/form-data')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_DEPLOYMENT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'createDeployment',
|
||||
description: '/docs/references/functions/create-deployment.md',
|
||||
auth: [AuthType::KEY],
|
||||
requestType: 'multipart/form-data',
|
||||
responseCode: Response::STATUS_CODE_ACCEPTED,
|
||||
responseModel: Response::MODEL_DEPLOYMENT,
|
||||
responseType: ResponseType::JSON,
|
||||
methodType: MethodType::UPLOAD,
|
||||
packaging: true,
|
||||
))
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
->param('entrypoint', null, new Text(1028), 'Entrypoint File.', true)
|
||||
->param('commands', null, new Text(8192, 0), 'Build Commands.', true)
|
||||
|
|
@ -1384,13 +1415,15 @@ App::get('/v1/functions/:functionId/deployments')
|
|||
->desc('List deployments')
|
||||
->label('scope', 'functions.read')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'listDeployments')
|
||||
->label('sdk.description', '/docs/references/functions/list-deployments.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_DEPLOYMENT_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'listDeployments',
|
||||
description: '/docs/references/functions/list-deployments.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_DEPLOYMENT_LIST,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
->param('queries', [], new Deployments(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Deployments::ALLOWED_ATTRIBUTES), true)
|
||||
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
|
||||
|
|
@ -1468,13 +1501,15 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId')
|
|||
->desc('Get deployment')
|
||||
->label('scope', 'functions.read')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'getDeployment')
|
||||
->label('sdk.description', '/docs/references/functions/get-deployment.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_DEPLOYMENT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'getDeployment',
|
||||
description: '/docs/references/functions/get-deployment.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_DEPLOYMENT,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
->param('deploymentId', '', new UID(), 'Deployment ID.')
|
||||
->inject('response')
|
||||
|
|
@ -1515,12 +1550,14 @@ App::delete('/v1/functions/:functionId/deployments/:deploymentId')
|
|||
->label('event', 'functions.[functionId].deployments.[deploymentId].delete')
|
||||
->label('audits.event', 'deployment.delete')
|
||||
->label('audits.resource', 'function/{request.functionId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'deleteDeployment')
|
||||
->label('sdk.description', '/docs/references/functions/delete-deployment.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'deleteDeployment',
|
||||
description: '/docs/references/functions/delete-deployment.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT,
|
||||
responseModel: Response::MODEL_NONE
|
||||
))
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
->param('deploymentId', '', new UID(), 'Deployment ID.')
|
||||
->inject('response')
|
||||
|
|
@ -1581,11 +1618,14 @@ App::post('/v1/functions/:functionId/deployments/:deploymentId/build')
|
|||
->label('event', 'functions.[functionId].deployments.[deploymentId].update')
|
||||
->label('audits.event', 'deployment.update')
|
||||
->label('audits.resource', 'function/{request.functionId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'createBuild')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'createBuild',
|
||||
description: '/docs/references/functions/create-deployment-build.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT,
|
||||
responseModel: Response::MODEL_NONE
|
||||
))
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
->param('deploymentId', '', new UID(), 'Deployment ID.')
|
||||
->param('buildId', '', new UID(), 'Build unique ID.', true) // added as optional param for backward compatibility
|
||||
|
|
@ -1648,13 +1688,16 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId/build')
|
|||
->label('scope', 'functions.write')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('audits.event', 'deployment.update')
|
||||
->label('audits.resource', 'function/{request.functionId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'updateDeploymentBuild')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_BUILD)
|
||||
->label('audits.resource', 'function/{request.functionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'updateDeploymentBuild',
|
||||
description: '/docs/references/functions/update-deployment-build.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_BUILD,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
->param('deploymentId', '', new UID(), 'Deployment ID.')
|
||||
->inject('response')
|
||||
|
|
@ -1738,15 +1781,16 @@ App::post('/v1/functions/:functionId/executions')
|
|||
->label('scope', 'execution.write')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('event', 'functions.[functionId].executions.[executionId].create')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'createExecution')
|
||||
->label('sdk.description', '/docs/references/functions/create-execution.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_MULTIPART)
|
||||
->label('sdk.response.model', Response::MODEL_EXECUTION)
|
||||
->label('sdk.request.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'createExecution',
|
||||
description: '/docs/references/functions/create-execution.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseType: ResponseType::MULTIPART,
|
||||
responseModel: Response::MODEL_EXECUTION,
|
||||
requestType: 'application/json',
|
||||
))
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
->param('body', '', new Text(10485760, 0), 'HTTP body of execution. Default value is empty string.', true)
|
||||
->param('async', false, new Boolean(true), 'Execute code in the background. Default value is false.', true)
|
||||
|
|
@ -2141,13 +2185,15 @@ App::get('/v1/functions/:functionId/executions')
|
|||
->desc('List executions')
|
||||
->label('scope', 'execution.read')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'listExecutions')
|
||||
->label('sdk.description', '/docs/references/functions/list-executions.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_EXECUTION_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'listExecutions',
|
||||
description: '/docs/references/functions/list-executions.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::JSON,
|
||||
responseModel: Response::MODEL_EXECUTION_LIST
|
||||
))
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
->param('queries', [], new Executions(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Executions::ALLOWED_ATTRIBUTES), true)
|
||||
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
|
||||
|
|
@ -2229,13 +2275,15 @@ App::get('/v1/functions/:functionId/executions/:executionId')
|
|||
->desc('Get execution')
|
||||
->label('scope', 'execution.read')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'getExecution')
|
||||
->label('sdk.description', '/docs/references/functions/get-execution.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_EXECUTION)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'getExecution',
|
||||
description: '/docs/references/functions/get-execution.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::JSON,
|
||||
responseModel: Response::MODEL_EXECUTION
|
||||
))
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
->param('executionId', '', new UID(), 'Execution ID.')
|
||||
->inject('response')
|
||||
|
|
@ -2280,12 +2328,14 @@ App::delete('/v1/functions/:functionId/executions/:executionId')
|
|||
->label('event', 'functions.[functionId].executions.[executionId].delete')
|
||||
->label('audits.event', 'executions.delete')
|
||||
->label('audits.resource', 'function/{request.functionId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'deleteExecution')
|
||||
->label('sdk.description', '/docs/references/functions/delete-execution.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'deleteExecution',
|
||||
description: '/docs/references/functions/delete-execution.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT,
|
||||
responseModel: Response::MODEL_NONE
|
||||
))
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
->param('executionId', '', new UID(), 'Execution ID.')
|
||||
->inject('response')
|
||||
|
|
@ -2350,13 +2400,15 @@ App::post('/v1/functions/:functionId/variables')
|
|||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('audits.event', 'variable.create')
|
||||
->label('audits.resource', 'function/{request.functionId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'createVariable')
|
||||
->label('sdk.description', '/docs/references/functions/create-variable.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_VARIABLE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'createVariable',
|
||||
description: '/docs/references/functions/create-variable.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseType: ResponseType::JSON,
|
||||
responseModel: Response::MODEL_VARIABLE
|
||||
))
|
||||
->param('functionId', '', new UID(), 'Function unique ID.', false)
|
||||
->param('key', null, new Text(Database::LENGTH_KEY), 'Variable key. Max length: ' . Database::LENGTH_KEY . ' chars.', false)
|
||||
->param('value', null, new Text(8192, 0), 'Variable value. Max length: 8192 chars.', false)
|
||||
|
|
@ -2412,14 +2464,17 @@ App::get('/v1/functions/:functionId/variables')
|
|||
->desc('List variables')
|
||||
->groups(['api', 'functions'])
|
||||
->label('scope', 'functions.read')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'listVariables')
|
||||
->label('sdk.description', '/docs/references/functions/list-variables.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_VARIABLE_LIST)
|
||||
->label('sdk',
|
||||
new Method(
|
||||
namespace: 'functions',
|
||||
name: 'listVariables',
|
||||
description: '/docs/references/functions/list-variables.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::JSON,
|
||||
responseModel: Response::MODEL_VARIABLE_LIST
|
||||
)
|
||||
)
|
||||
->param('functionId', '', new UID(), 'Function unique ID.', false)
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
@ -2441,13 +2496,16 @@ App::get('/v1/functions/:functionId/variables/:variableId')
|
|||
->groups(['api', 'functions'])
|
||||
->label('scope', 'functions.read')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'getVariable')
|
||||
->label('sdk.description', '/docs/references/functions/get-variable.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_VARIABLE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'getVariable',
|
||||
description: '/docs/references/functions/get-variable.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::JSON,
|
||||
responseModel: Response::MODEL_VARIABLE
|
||||
)
|
||||
)
|
||||
->param('functionId', '', new UID(), 'Function unique ID.', false)
|
||||
->param('variableId', '', new UID(), 'Variable unique ID.', false)
|
||||
->inject('response')
|
||||
|
|
@ -2483,13 +2541,15 @@ App::put('/v1/functions/:functionId/variables/:variableId')
|
|||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('audits.event', 'variable.update')
|
||||
->label('audits.resource', 'function/{request.functionId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'updateVariable')
|
||||
->label('sdk.description', '/docs/references/functions/update-variable.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_VARIABLE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'updateVariable',
|
||||
description: '/docs/references/functions/update-variable.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::JSON,
|
||||
responseModel: Response::MODEL_VARIABLE
|
||||
))
|
||||
->param('functionId', '', new UID(), 'Function unique ID.', false)
|
||||
->param('variableId', '', new UID(), 'Variable unique ID.', false)
|
||||
->param('key', null, new Text(255), 'Variable key. Max length: 255 chars.', false)
|
||||
|
|
@ -2545,12 +2605,14 @@ App::delete('/v1/functions/:functionId/variables/:variableId')
|
|||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('audits.event', 'variable.delete')
|
||||
->label('audits.resource', 'function/{request.functionId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'deleteVariable')
|
||||
->label('sdk.description', '/docs/references/functions/delete-variable.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'deleteVariable',
|
||||
description: '/docs/references/functions/delete-variable.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT,
|
||||
responseModel: Response::MODEL_NONE
|
||||
))
|
||||
->param('functionId', '', new UID(), 'Function unique ID.', false)
|
||||
->param('variableId', '', new UID(), 'Variable unique ID.', false)
|
||||
->inject('response')
|
||||
|
|
@ -2592,13 +2654,15 @@ App::get('/v1/functions/templates')
|
|||
->desc('List function templates')
|
||||
->label('scope', 'public')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'listTemplates')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.description', '/docs/references/functions/list-templates.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_TEMPLATE_FUNCTION_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'listTemplates',
|
||||
description: '/docs/references/functions/list-templates.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::JSON,
|
||||
responseModel: Response::MODEL_TEMPLATE_FUNCTION_LIST
|
||||
))
|
||||
->param('runtimes', [], new ArrayList(new WhiteList(array_keys(Config::getParam('runtimes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of runtimes allowed for filtering function templates. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' runtimes are allowed.', true)
|
||||
->param('useCases', [], new ArrayList(new WhiteList(['dev-tools','starter','databases','ai','messaging','utilities']), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of use cases allowed for filtering function templates. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' use cases are allowed.', true)
|
||||
->param('limit', 25, new Range(1, 5000), 'Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.', true)
|
||||
|
|
@ -2630,13 +2694,15 @@ App::get('/v1/functions/templates/:templateId')
|
|||
->desc('Get function template')
|
||||
->label('scope', 'public')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'getTemplate')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.description', '/docs/references/functions/get-template.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_TEMPLATE_FUNCTION)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
name: 'getTemplate',
|
||||
description: '/docs/references/functions/get-template.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::JSON,
|
||||
responseModel: Response::MODEL_TEMPLATE_FUNCTION
|
||||
))
|
||||
->param('templateId', '', new Text(128), 'Template ID.')
|
||||
->inject('response')
|
||||
->action(function (string $templateId, Response $response) {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@ use Appwrite\Extend\Exception;
|
|||
use Appwrite\Extend\Exception as AppwriteException;
|
||||
use Appwrite\GraphQL\Promises\Adapter;
|
||||
use Appwrite\GraphQL\Schema;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\MethodType;
|
||||
use Appwrite\SDK\ResponseType;
|
||||
use Appwrite\Utopia\Request;
|
||||
use Appwrite\Utopia\Response;
|
||||
use GraphQL\Error\DebugFlag;
|
||||
|
|
@ -38,13 +42,16 @@ App::get('/v1/graphql')
|
|||
->desc('GraphQL endpoint')
|
||||
->groups(['graphql'])
|
||||
->label('scope', 'graphql')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'graphql')
|
||||
->label('sdk.hide', true)
|
||||
->label('sdk.description', '/docs/references/graphql/get.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_ANY)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'graphql',
|
||||
name: 'get',
|
||||
auth: [AuthType::KEY, AuthType::SESSION, AuthType::JWT],
|
||||
hide: true,
|
||||
description: '/docs/references/graphql/get.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::JSON,
|
||||
responseModel: Response::MODEL_ANY
|
||||
))
|
||||
->label('abuse-limit', 60)
|
||||
->label('abuse-time', 60)
|
||||
->param('query', '', new Text(0, 0), 'The query to execute.')
|
||||
|
|
@ -78,17 +85,19 @@ App::post('/v1/graphql/mutation')
|
|||
->desc('GraphQL endpoint')
|
||||
->groups(['graphql'])
|
||||
->label('scope', 'graphql')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'graphql')
|
||||
->label('sdk.method', 'mutation')
|
||||
->label('sdk.methodType', 'graphql')
|
||||
->label('sdk.description', '/docs/references/graphql/post.md')
|
||||
->label('sdk.parameters', [
|
||||
'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false],
|
||||
])
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_ANY)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'graphql',
|
||||
name: 'mutation',
|
||||
auth: [AuthType::KEY, AuthType::SESSION, AuthType::JWT],
|
||||
description: '/docs/references/graphql/post.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::JSON,
|
||||
responseModel: Response::MODEL_ANY,
|
||||
methodType: MethodType::GRAPHQL,
|
||||
parameters: [
|
||||
'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false],
|
||||
],
|
||||
))
|
||||
->label('abuse-limit', 60)
|
||||
->label('abuse-time', 60)
|
||||
->inject('request')
|
||||
|
|
@ -123,17 +132,19 @@ App::post('/v1/graphql')
|
|||
->desc('GraphQL endpoint')
|
||||
->groups(['graphql'])
|
||||
->label('scope', 'graphql')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'graphql')
|
||||
->label('sdk.method', 'query')
|
||||
->label('sdk.methodType', 'graphql')
|
||||
->label('sdk.description', '/docs/references/graphql/post.md')
|
||||
->label('sdk.parameters', [
|
||||
'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false],
|
||||
])
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_ANY)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'graphql',
|
||||
name: 'query',
|
||||
auth: [AuthType::KEY, AuthType::SESSION, AuthType::JWT],
|
||||
description: '/docs/references/graphql/post.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::JSON,
|
||||
responseModel: Response::MODEL_ANY,
|
||||
methodType: MethodType::GRAPHQL,
|
||||
parameters: [
|
||||
'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false],
|
||||
],
|
||||
))
|
||||
->label('abuse-limit', 60)
|
||||
->label('abuse-time', 60)
|
||||
->inject('request')
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@
|
|||
use Appwrite\ClamAV\Network;
|
||||
use Appwrite\Event\Event;
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\ResponseType;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\App;
|
||||
use Utopia\Config\Config;
|
||||
|
|
@ -26,13 +29,15 @@ App::get('/v1/health')
|
|||
->desc('Get HTTP')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'get')
|
||||
->label('sdk.description', '/docs/references/health/get.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_STATUS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
name: 'get',
|
||||
auth: [AuthType::KEY],
|
||||
description: '/docs/references/health/get.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_STATUS,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->inject('response')
|
||||
->action(function (Response $response) {
|
||||
|
||||
|
|
@ -49,9 +54,15 @@ App::get('/v1/health/version')
|
|||
->desc('Get version')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'public')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_VERSION)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
name: 'getVersion',
|
||||
description: '/docs/references/health/get-version.md',
|
||||
auth: [],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_VERSION,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->inject('response')
|
||||
->action(function (Response $response) {
|
||||
$response->dynamic(new Document([ 'version' => APP_VERSION_STABLE ]), Response::MODEL_HEALTH_VERSION);
|
||||
|
|
@ -61,13 +72,15 @@ App::get('/v1/health/db')
|
|||
->desc('Get DB')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getDB')
|
||||
->label('sdk.description', '/docs/references/health/get-db.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_STATUS)
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
name: 'getDB',
|
||||
description: '/docs/references/health/get-db.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_STATUS,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->inject('response')
|
||||
->inject('pools')
|
||||
->action(function (Response $response, Group $pools) {
|
||||
|
|
@ -115,13 +128,15 @@ App::get('/v1/health/cache')
|
|||
->desc('Get cache')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getCache')
|
||||
->label('sdk.description', '/docs/references/health/get-cache.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_STATUS)
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
name: 'getCache',
|
||||
description: '/docs/references/health/get-cache.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_STATUS,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->inject('response')
|
||||
->inject('pools')
|
||||
->action(function (Response $response, Group $pools) {
|
||||
|
|
@ -173,13 +188,15 @@ App::get('/v1/health/queue')
|
|||
->desc('Get queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getQueue')
|
||||
->label('sdk.description', '/docs/references/health/get-queue.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_STATUS)
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
name: 'getQueue',
|
||||
description: '/docs/references/health/get-queue.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_STATUS,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->inject('response')
|
||||
->inject('pools')
|
||||
->action(function (Response $response, Group $pools) {
|
||||
|
|
@ -230,13 +247,15 @@ App::get('/v1/health/pubsub')
|
|||
->desc('Get pubsub')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getPubSub')
|
||||
->label('sdk.description', '/docs/references/health/get-pubsub.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_STATUS)
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
name: 'getPubSub',
|
||||
description: '/docs/references/health/get-pubsub.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_STATUS,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->inject('response')
|
||||
->inject('pools')
|
||||
->action(function (Response $response, Group $pools) {
|
||||
|
|
@ -288,13 +307,15 @@ App::get('/v1/health/time')
|
|||
->desc('Get time')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getTime')
|
||||
->label('sdk.description', '/docs/references/health/get-time.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_TIME)
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
name: 'getTime',
|
||||
description: '/docs/references/health/get-time.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_TIME,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->inject('response')
|
||||
->action(function (Response $response) {
|
||||
|
||||
|
|
@ -345,13 +366,15 @@ App::get('/v1/health/queue/webhooks')
|
|||
->desc('Get webhooks queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getQueueWebhooks')
|
||||
->label('sdk.description', '/docs/references/health/get-queue-webhooks.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
name: 'getQueueWebhooks',
|
||||
description: '/docs/references/health/get-queue-webhooks.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_QUEUE,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('queue')
|
||||
->inject('response')
|
||||
|
|
@ -372,13 +395,15 @@ App::get('/v1/health/queue/logs')
|
|||
->desc('Get logs queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getQueueLogs')
|
||||
->label('sdk.description', '/docs/references/health/get-queue-logs.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
name: 'getQueueLogs',
|
||||
description: '/docs/references/health/get-queue-logs.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_QUEUE,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('queue')
|
||||
->inject('response')
|
||||
|
|
@ -399,13 +424,15 @@ App::get('/v1/health/certificate')
|
|||
->desc('Get the SSL certificate for a domain')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getCertificate')
|
||||
->label('sdk.description', '/docs/references/health/get-certificate.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_CERTIFICATE)
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
name: 'getCertificate',
|
||||
description: '/docs/references/health/get-certificate.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_CERTIFICATE,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('domain', null, new Multiple([new Domain(), new PublicDomain()]), Multiple::TYPE_STRING, 'Domain name')
|
||||
->inject('response')
|
||||
->action(function (string $domain, Response $response) {
|
||||
|
|
@ -449,13 +476,15 @@ App::get('/v1/health/queue/certificates')
|
|||
->desc('Get certificates queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getQueueCertificates')
|
||||
->label('sdk.description', '/docs/references/health/get-queue-certificates.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
name: 'getQueueCertificates',
|
||||
description: '/docs/references/health/get-queue-certificates.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_QUEUE,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('queue')
|
||||
->inject('response')
|
||||
|
|
@ -476,13 +505,15 @@ App::get('/v1/health/queue/builds')
|
|||
->desc('Get builds queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getQueueBuilds')
|
||||
->label('sdk.description', '/docs/references/health/get-queue-builds.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
name: 'getQueueBuilds',
|
||||
description: '/docs/references/health/get-queue-builds.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_QUEUE,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('queue')
|
||||
->inject('response')
|
||||
|
|
@ -503,13 +534,15 @@ App::get('/v1/health/queue/databases')
|
|||
->desc('Get databases queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getQueueDatabases')
|
||||
->label('sdk.description', '/docs/references/health/get-queue-databases.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
name: 'getQueueDatabases',
|
||||
description: '/docs/references/health/get-queue-databases.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_QUEUE,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('name', 'database_db_main', new Text(256), 'Queue name for which to check the queue size', true)
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('queue')
|
||||
|
|
@ -531,13 +564,15 @@ App::get('/v1/health/queue/deletes')
|
|||
->desc('Get deletes queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getQueueDeletes')
|
||||
->label('sdk.description', '/docs/references/health/get-queue-deletes.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
name: 'getQueueDeletes',
|
||||
description: '/docs/references/health/get-queue-deletes.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_QUEUE,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('queue')
|
||||
->inject('response')
|
||||
|
|
@ -558,13 +593,15 @@ App::get('/v1/health/queue/mails')
|
|||
->desc('Get mails queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getQueueMails')
|
||||
->label('sdk.description', '/docs/references/health/get-queue-mails.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
name: 'getQueueMails',
|
||||
description: '/docs/references/health/get-queue-mails.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_QUEUE,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('queue')
|
||||
->inject('response')
|
||||
|
|
@ -585,13 +622,15 @@ App::get('/v1/health/queue/messaging')
|
|||
->desc('Get messaging queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getQueueMessaging')
|
||||
->label('sdk.description', '/docs/references/health/get-queue-messaging.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
name: 'getQueueMessaging',
|
||||
description: '/docs/references/health/get-queue-messaging.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_QUEUE,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('queue')
|
||||
->inject('response')
|
||||
|
|
@ -612,13 +651,15 @@ App::get('/v1/health/queue/migrations')
|
|||
->desc('Get migrations queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getQueueMigrations')
|
||||
->label('sdk.description', '/docs/references/health/get-queue-migrations.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
name: 'getQueueMigrations',
|
||||
description: '/docs/references/health/get-queue-migrations.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_QUEUE,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('queue')
|
||||
->inject('response')
|
||||
|
|
@ -639,13 +680,15 @@ App::get('/v1/health/queue/functions')
|
|||
->desc('Get functions queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getQueueFunctions')
|
||||
->label('sdk.description', '/docs/references/health/get-queue-functions.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
name: 'getQueueFunctions',
|
||||
description: '/docs/references/health/get-queue-functions.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_QUEUE,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('queue')
|
||||
->inject('response')
|
||||
|
|
@ -666,13 +709,15 @@ App::get('/v1/health/queue/usage')
|
|||
->desc('Get usage queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getQueueUsage')
|
||||
->label('sdk.description', '/docs/references/health/get-queue-usage.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
name: 'getQueueUsage',
|
||||
description: '/docs/references/health/get-queue-usage.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_QUEUE,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('queue')
|
||||
->inject('response')
|
||||
|
|
@ -693,13 +738,15 @@ App::get('/v1/health/queue/usage-dump')
|
|||
->desc('Get usage dump queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getQueueUsageDump')
|
||||
->label('sdk.description', '/docs/references/health/get-queue-usage-dump.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
name: 'getQueueUsageDump',
|
||||
description: '/docs/references/health/get-queue-usage-dump.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_QUEUE,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('queue')
|
||||
->inject('response')
|
||||
|
|
@ -720,13 +767,15 @@ App::get('/v1/health/storage/local')
|
|||
->desc('Get local storage')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getStorageLocal')
|
||||
->label('sdk.description', '/docs/references/health/get-storage-local.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_STATUS)
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
name: 'getStorageLocal',
|
||||
description: '/docs/references/health/get-storage-local.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_STATUS,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->inject('response')
|
||||
->action(function (Response $response) {
|
||||
|
||||
|
|
@ -763,13 +812,15 @@ App::get('/v1/health/storage')
|
|||
->desc('Get storage')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getStorage')
|
||||
->label('sdk.description', '/docs/references/health/get-storage.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_STATUS)
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
name: 'getStorage',
|
||||
description: '/docs/references/health/get-storage.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_STATUS,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->inject('response')
|
||||
->inject('deviceForFiles')
|
||||
->inject('deviceForFunctions')
|
||||
|
|
@ -804,13 +855,15 @@ App::get('/v1/health/anti-virus')
|
|||
->desc('Get antivirus')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getAntivirus')
|
||||
->label('sdk.description', '/docs/references/health/get-storage-anti-virus.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_ANTIVIRUS)
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
name: 'getAntivirus',
|
||||
description: '/docs/references/health/get-storage-anti-virus.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_ANTIVIRUS,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->inject('response')
|
||||
->action(function (Response $response) {
|
||||
|
||||
|
|
@ -843,9 +896,15 @@ App::get('/v1/health/queue/failed/:name')
|
|||
->desc('Get number of failed queue jobs')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getFailedJobs')
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
name: 'getFailedJobs',
|
||||
description: '/docs/references/health/get-failed-queue-jobs.md',
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_HEALTH_QUEUE,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('name', '', new WhiteList([
|
||||
Event::DATABASE_QUEUE_NAME,
|
||||
Event::DELETE_QUEUE_NAME,
|
||||
|
|
@ -861,10 +920,6 @@ App::get('/v1/health/queue/failed/:name')
|
|||
Event::MIGRATIONS_QUEUE_NAME
|
||||
]), 'The name of the queue')
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->label('sdk.description', '/docs/references/health/get-failed-queue-jobs.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
|
||||
->inject('response')
|
||||
->inject('queue')
|
||||
->action(function (string $name, int|string $threshold, Response $response, Connection $queue) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
<?php
|
||||
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\ResponseType;
|
||||
use Appwrite\Utopia\Request;
|
||||
use Appwrite\Utopia\Response;
|
||||
use MaxMind\Db\Reader;
|
||||
|
|
@ -12,15 +15,17 @@ App::get('/v1/locale')
|
|||
->desc('Get user locale')
|
||||
->groups(['api', 'locale'])
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'locale')
|
||||
->label('sdk.method', 'get')
|
||||
->label('sdk.description', '/docs/references/locale/get-locale.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_LOCALE)
|
||||
->label('sdk.offline.model', '/localed')
|
||||
->label('sdk.offline.key', 'current')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'locale',
|
||||
name: 'get',
|
||||
description: '/docs/references/locale/get-locale.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_LOCALE,
|
||||
responseType: ResponseType::JSON,
|
||||
offlineKey: 'current',
|
||||
offlineModel: '/localed',
|
||||
))
|
||||
->inject('request')
|
||||
->inject('response')
|
||||
->inject('locale')
|
||||
|
|
@ -72,15 +77,17 @@ App::get('/v1/locale/codes')
|
|||
->desc('List locale codes')
|
||||
->groups(['api', 'locale'])
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'locale')
|
||||
->label('sdk.method', 'listCodes')
|
||||
->label('sdk.description', '/docs/references/locale/list-locale-codes.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_LOCALE_CODE_LIST)
|
||||
->label('sdk.offline.model', '/locale/localeCode')
|
||||
->label('sdk.offline.key', 'current')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'locale',
|
||||
name: 'listCodes',
|
||||
description: '/docs/references/locale/list-locale-codes.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_LOCALE_CODE_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
offlineKey: 'current',
|
||||
offlineModel: '/locale/localeCode',
|
||||
))
|
||||
->inject('response')
|
||||
->action(function (Response $response) {
|
||||
$codes = Config::getParam('locale-codes');
|
||||
|
|
@ -94,15 +101,17 @@ App::get('/v1/locale/countries')
|
|||
->desc('List countries')
|
||||
->groups(['api', 'locale'])
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'locale')
|
||||
->label('sdk.method', 'listCountries')
|
||||
->label('sdk.description', '/docs/references/locale/list-countries.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_COUNTRY_LIST)
|
||||
->label('sdk.offline.model', '/locale/countries')
|
||||
->label('sdk.offline.response.key', 'code')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'locale',
|
||||
name: 'listCountries',
|
||||
description: '/docs/references/locale/list-countries.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_COUNTRY_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
offlineModel: '/locale/countries',
|
||||
offlineResponseKey: 'code'
|
||||
))
|
||||
->inject('response')
|
||||
->inject('locale')
|
||||
->action(function (Response $response, Locale $locale) {
|
||||
|
|
@ -127,15 +136,17 @@ App::get('/v1/locale/countries/eu')
|
|||
->desc('List EU countries')
|
||||
->groups(['api', 'locale'])
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'locale')
|
||||
->label('sdk.method', 'listCountriesEU')
|
||||
->label('sdk.description', '/docs/references/locale/list-countries-eu.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_COUNTRY_LIST)
|
||||
->label('sdk.offline.model', '/locale/countries/eu')
|
||||
->label('sdk.offline.response.key', 'code')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'locale',
|
||||
name: 'listCountriesEU',
|
||||
description: '/docs/references/locale/list-countries-eu.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_COUNTRY_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
offlineModel: '/locale/countries/eu',
|
||||
offlineResponseKey: 'code'
|
||||
))
|
||||
->inject('response')
|
||||
->inject('locale')
|
||||
->action(function (Response $response, Locale $locale) {
|
||||
|
|
@ -162,15 +173,17 @@ App::get('/v1/locale/countries/phones')
|
|||
->desc('List countries phone codes')
|
||||
->groups(['api', 'locale'])
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'locale')
|
||||
->label('sdk.method', 'listCountriesPhones')
|
||||
->label('sdk.description', '/docs/references/locale/list-countries-phones.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PHONE_LIST)
|
||||
->label('sdk.offline.model', '/locale/countries/phones')
|
||||
->label('sdk.offline.response.key', 'countryCode')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'locale',
|
||||
name: 'listCountriesPhones',
|
||||
description: '/docs/references/locale/list-countries-phones.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PHONE_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
offlineModel: '/locale/countries/phones',
|
||||
offlineResponseKey: 'countryCode'
|
||||
))
|
||||
->inject('response')
|
||||
->inject('locale')
|
||||
->action(function (Response $response, Locale $locale) {
|
||||
|
|
@ -196,15 +209,17 @@ App::get('/v1/locale/continents')
|
|||
->desc('List continents')
|
||||
->groups(['api', 'locale'])
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'locale')
|
||||
->label('sdk.method', 'listContinents')
|
||||
->label('sdk.description', '/docs/references/locale/list-continents.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_CONTINENT_LIST)
|
||||
->label('sdk.offline.model', '/locale/continents')
|
||||
->label('sdk.offline.response.key', 'code')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'locale',
|
||||
name: 'listContinents',
|
||||
description: '/docs/references/locale/list-continents.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_CONTINENT_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
offlineModel: '/locale/continents',
|
||||
offlineResponseKey: 'code'
|
||||
))
|
||||
->inject('response')
|
||||
->inject('locale')
|
||||
->action(function (Response $response, Locale $locale) {
|
||||
|
|
@ -228,15 +243,17 @@ App::get('/v1/locale/currencies')
|
|||
->desc('List currencies')
|
||||
->groups(['api', 'locale'])
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'locale')
|
||||
->label('sdk.method', 'listCurrencies')
|
||||
->label('sdk.description', '/docs/references/locale/list-currencies.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_CURRENCY_LIST)
|
||||
->label('sdk.offline.model', '/locale/currencies')
|
||||
->label('sdk.offline.response.key', 'code')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'locale',
|
||||
name: 'listCurrencies',
|
||||
description: '/docs/references/locale/list-currencies.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_CURRENCY_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
offlineModel: '/locale/currencies',
|
||||
offlineResponseKey: 'code'
|
||||
))
|
||||
->inject('response')
|
||||
->action(function (Response $response) {
|
||||
$list = Config::getParam('locale-currencies');
|
||||
|
|
@ -251,15 +268,17 @@ App::get('/v1/locale/languages')
|
|||
->desc('List languages')
|
||||
->groups(['api', 'locale'])
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'locale')
|
||||
->label('sdk.method', 'listLanguages')
|
||||
->label('sdk.description', '/docs/references/locale/list-languages.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_LANGUAGE_LIST)
|
||||
->label('sdk.offline.model', '/locale/languages')
|
||||
->label('sdk.offline.response.key', 'code')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'locale',
|
||||
name: 'listLanguages',
|
||||
description: '/docs/references/locale/list-languages.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_LANGUAGE_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
offlineModel: '/locale/languages',
|
||||
offlineResponseKey: 'code'
|
||||
))
|
||||
->inject('response')
|
||||
->action(function (Response $response) {
|
||||
$list = Config::getParam('locale-languages');
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -6,6 +6,10 @@ use Appwrite\Event\Migration;
|
|||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\Permission;
|
||||
use Appwrite\Role;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\MethodType;
|
||||
use Appwrite\SDK\ResponseType;
|
||||
use Appwrite\Utopia\Database\Validator\Queries\Migrations;
|
||||
use Appwrite\Utopia\Request;
|
||||
use Appwrite\Utopia\Response;
|
||||
|
|
@ -38,13 +42,15 @@ App::post('/v1/migrations/appwrite')
|
|||
->label('scope', 'migrations.write')
|
||||
->label('event', 'migrations.[migrationId].create')
|
||||
->label('audits.event', 'migration.create')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'migrations')
|
||||
->label('sdk.method', 'createAppwriteMigration')
|
||||
->label('sdk.description', '/docs/references/migrations/migration-appwrite.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MIGRATION)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
name: 'createAppwriteMigration',
|
||||
description: '/docs/references/migrations/migration-appwrite.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_ACCEPTED,
|
||||
responseModel: Response::MODEL_MIGRATION,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('resources', [], new ArrayList(new WhiteList(Appwrite::getSupportedResources())), 'List of resources to migrate')
|
||||
->param('endpoint', '', new URL(), "Source's Appwrite Endpoint")
|
||||
->param('projectId', '', new UID(), "Source's Project ID")
|
||||
|
|
@ -93,13 +99,15 @@ App::post('/v1/migrations/firebase/oauth')
|
|||
->label('scope', 'migrations.write')
|
||||
->label('event', 'migrations.[migrationId].create')
|
||||
->label('audits.event', 'migration.create')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'migrations')
|
||||
->label('sdk.method', 'createFirebaseOAuthMigration')
|
||||
->label('sdk.description', '/docs/references/migrations/migration-firebase.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MIGRATION)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
name: 'createFirebaseOAuthMigration',
|
||||
description: '/docs/references/migrations/migration-firebase.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_ACCEPTED,
|
||||
responseModel: Response::MODEL_MIGRATION,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate')
|
||||
->param('projectId', '', new Text(65536), 'Project ID of the Firebase Project')
|
||||
->inject('response')
|
||||
|
|
@ -196,13 +204,15 @@ App::post('/v1/migrations/firebase')
|
|||
->label('scope', 'migrations.write')
|
||||
->label('event', 'migrations.[migrationId].create')
|
||||
->label('audits.event', 'migration.create')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'migrations')
|
||||
->label('sdk.method', 'createFirebaseMigration')
|
||||
->label('sdk.description', '/docs/references/migrations/migration-firebase.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MIGRATION)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
name: 'createFirebaseMigration',
|
||||
description: '/docs/references/migrations/migration-firebase.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_ACCEPTED,
|
||||
responseModel: Response::MODEL_MIGRATION,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate')
|
||||
->param('serviceAccount', '', new Text(65536), 'JSON of the Firebase service account credentials')
|
||||
->inject('response')
|
||||
|
|
@ -257,13 +267,15 @@ App::post('/v1/migrations/supabase')
|
|||
->label('scope', 'migrations.write')
|
||||
->label('event', 'migrations.[migrationId].create')
|
||||
->label('audits.event', 'migration.create')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'migrations')
|
||||
->label('sdk.method', 'createSupabaseMigration')
|
||||
->label('sdk.description', '/docs/references/migrations/migration-supabase.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MIGRATION)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
name: 'createSupabaseMigration',
|
||||
description: '/docs/references/migrations/migration-supabase.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_ACCEPTED,
|
||||
responseModel: Response::MODEL_MIGRATION,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('resources', [], new ArrayList(new WhiteList(Supabase::getSupportedResources(), true)), 'List of resources to migrate')
|
||||
->param('endpoint', '', new URL(), 'Source\'s Supabase Endpoint')
|
||||
->param('apiKey', '', new Text(512), 'Source\'s API Key')
|
||||
|
|
@ -318,13 +330,15 @@ App::post('/v1/migrations/nhost')
|
|||
->label('scope', 'migrations.write')
|
||||
->label('event', 'migrations.[migrationId].create')
|
||||
->label('audits.event', 'migration.create')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'migrations')
|
||||
->label('sdk.method', 'createNHostMigration')
|
||||
->label('sdk.description', '/docs/references/migrations/migration-nhost.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MIGRATION)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
name: 'createNHostMigration',
|
||||
description: '/docs/references/migrations/migration-nhost.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_ACCEPTED,
|
||||
responseModel: Response::MODEL_MIGRATION,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('resources', [], new ArrayList(new WhiteList(NHost::getSupportedResources())), 'List of resources to migrate')
|
||||
->param('subdomain', '', new Text(512), 'Source\'s Subdomain')
|
||||
->param('region', '', new Text(512), 'Source\'s Region')
|
||||
|
|
@ -379,13 +393,15 @@ App::get('/v1/migrations')
|
|||
->groups(['api', 'migrations'])
|
||||
->desc('List migrations')
|
||||
->label('scope', 'migrations.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'migrations')
|
||||
->label('sdk.method', 'list')
|
||||
->label('sdk.description', '/docs/references/migrations/list-migrations.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MIGRATION_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
name: 'list',
|
||||
description: '/docs/references/migrations/list-migrations.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_MIGRATION_LIST,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('queries', [], new Migrations(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Migrations::ALLOWED_ATTRIBUTES), true)
|
||||
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
|
||||
->inject('response')
|
||||
|
|
@ -438,13 +454,15 @@ App::get('/v1/migrations/:migrationId')
|
|||
->groups(['api', 'migrations'])
|
||||
->desc('Get migration')
|
||||
->label('scope', 'migrations.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'migrations')
|
||||
->label('sdk.method', 'get')
|
||||
->label('sdk.description', '/docs/references/migrations/get-migration.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MIGRATION)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
name: 'get',
|
||||
description: '/docs/references/migrations/get-migration.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_MIGRATION,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('migrationId', '', new UID(), 'Migration unique ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
@ -462,13 +480,15 @@ App::get('/v1/migrations/appwrite/report')
|
|||
->groups(['api', 'migrations'])
|
||||
->desc('Generate a report on Appwrite data')
|
||||
->label('scope', 'migrations.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'migrations')
|
||||
->label('sdk.method', 'getAppwriteReport')
|
||||
->label('sdk.description', '/docs/references/migrations/migration-appwrite-report.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MIGRATION_REPORT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
name: 'getAppwriteReport',
|
||||
description: '/docs/references/migrations/migration-appwrite-report.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_MIGRATION_REPORT,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('resources', [], new ArrayList(new WhiteList(Appwrite::getSupportedResources())), 'List of resources to migrate')
|
||||
->param('endpoint', '', new URL(), "Source's Appwrite Endpoint")
|
||||
->param('projectID', '', new Text(512), "Source's Project ID")
|
||||
|
|
@ -504,13 +524,15 @@ App::get('/v1/migrations/firebase/report')
|
|||
->groups(['api', 'migrations'])
|
||||
->desc('Generate a report on Firebase data')
|
||||
->label('scope', 'migrations.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'migrations')
|
||||
->label('sdk.method', 'getFirebaseReport')
|
||||
->label('sdk.description', '/docs/references/migrations/migration-firebase-report.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MIGRATION_REPORT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
name: 'getFirebaseReport',
|
||||
description: '/docs/references/migrations/migration-firebase-report.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_MIGRATION_REPORT,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate')
|
||||
->param('serviceAccount', '', new Text(65536), 'JSON of the Firebase service account credentials')
|
||||
->inject('response')
|
||||
|
|
@ -551,13 +573,15 @@ App::get('/v1/migrations/firebase/report/oauth')
|
|||
->groups(['api', 'migrations'])
|
||||
->desc('Generate a report on Firebase data using OAuth')
|
||||
->label('scope', 'migrations.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'migrations')
|
||||
->label('sdk.method', 'getFirebaseReportOAuth')
|
||||
->label('sdk.description', '/docs/references/migrations/migration-firebase-report.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MIGRATION_REPORT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
name: 'getFirebaseReportOAuth',
|
||||
description: '/docs/references/migrations/migration-firebase-report.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_MIGRATION_REPORT,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate')
|
||||
->param('projectId', '', new Text(65536), 'Project ID')
|
||||
->inject('response')
|
||||
|
|
@ -642,14 +666,17 @@ App::get('/v1/migrations/firebase/connect')
|
|||
->desc('Authorize with Firebase')
|
||||
->groups(['api', 'migrations'])
|
||||
->label('scope', 'migrations.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'migrations')
|
||||
->label('sdk.method', 'createFirebaseAuth')
|
||||
->label('sdk.description', '')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_MOVED_PERMANENTLY)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_HTML)
|
||||
->label('sdk.methodType', 'webAuth')
|
||||
->label('sdk.hide', true)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
name: 'createFirebaseAuth',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_MOVED_PERMANENTLY,
|
||||
responseModel: Response::MODEL_NONE,
|
||||
responseType: ResponseType::HTML,
|
||||
hide: true,
|
||||
methodType: MethodType::WEBAUTH
|
||||
))
|
||||
->param('redirect', '', fn ($clients) => new Host($clients), 'URL to redirect back to your Firebase authorization. Only console hostnames are allowed.', true, ['clients'])
|
||||
->param('projectId', '', new UID(), 'Project ID')
|
||||
->inject('response')
|
||||
|
|
@ -796,13 +823,15 @@ App::get('/v1/migrations/firebase/projects')
|
|||
->desc('List Firebase projects')
|
||||
->groups(['api', 'migrations'])
|
||||
->label('scope', 'migrations.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'migrations')
|
||||
->label('sdk.method', 'listFirebaseProjects')
|
||||
->label('sdk.description', '')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MIGRATION_FIREBASE_PROJECT_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
name: 'listFirebaseProjects',
|
||||
description: '/docs/references/migrations/migration-firebase-projects.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_MIGRATION_FIREBASE_PROJECT_LIST,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->inject('user')
|
||||
->inject('response')
|
||||
->inject('project')
|
||||
|
|
@ -885,12 +914,15 @@ App::get('/v1/migrations/firebase/deauthorize')
|
|||
->desc('Revoke Appwrite\'s authorization to access Firebase projects')
|
||||
->groups(['api', 'migrations'])
|
||||
->label('scope', 'migrations.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'migrations')
|
||||
->label('sdk.method', 'deleteFirebaseAuth')
|
||||
->label('sdk.description', '')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
name: 'deleteFirebaseAuth',
|
||||
description: '/docs/references/migrations/migration-firebase-deauthorize.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_NONE,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->inject('user')
|
||||
->inject('response')
|
||||
->inject('dbForConsole')
|
||||
|
|
@ -913,13 +945,15 @@ App::get('/v1/migrations/supabase/report')
|
|||
->groups(['api', 'migrations'])
|
||||
->desc('Generate a report on Supabase Data')
|
||||
->label('scope', 'migrations.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'migrations')
|
||||
->label('sdk.method', 'getSupabaseReport')
|
||||
->label('sdk.description', '/docs/references/migrations/migration-supabase-report.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MIGRATION_REPORT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
name: 'getSupabaseReport',
|
||||
description: '/docs/references/migrations/migration-supabase-report.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_MIGRATION_REPORT,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('resources', [], new ArrayList(new WhiteList(Supabase::getSupportedResources(), true)), 'List of resources to migrate')
|
||||
->param('endpoint', '', new URL(), 'Source\'s Supabase Endpoint.')
|
||||
->param('apiKey', '', new Text(512), 'Source\'s API Key.')
|
||||
|
|
@ -956,13 +990,15 @@ App::get('/v1/migrations/nhost/report')
|
|||
->groups(['api', 'migrations'])
|
||||
->desc('Generate a report on NHost Data')
|
||||
->label('scope', 'migrations.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'migrations')
|
||||
->label('sdk.method', 'getNHostReport')
|
||||
->label('sdk.description', '/docs/references/migrations/migration-nhost-report.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MIGRATION_REPORT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
name: 'getNHostReport',
|
||||
description: '/docs/references/migrations/migration-nhost-report.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_MIGRATION_REPORT,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('resources', [], new ArrayList(new WhiteList(NHost::getSupportedResources())), 'List of resources to migrate.')
|
||||
->param('subdomain', '', new Text(512), 'Source\'s Subdomain.')
|
||||
->param('region', '', new Text(512), 'Source\'s Region.')
|
||||
|
|
@ -1002,13 +1038,15 @@ App::patch('/v1/migrations/:migrationId')
|
|||
->label('event', 'migrations.[migrationId].retry')
|
||||
->label('audits.event', 'migration.retry')
|
||||
->label('audits.resource', 'migrations/{request.migrationId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'migrations')
|
||||
->label('sdk.method', 'retry')
|
||||
->label('sdk.description', '/docs/references/migrations/retry-migration.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MIGRATION)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
name: 'retry',
|
||||
description: '/docs/references/migrations/retry-migration.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_ACCEPTED,
|
||||
responseModel: Response::MODEL_MIGRATION,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('migrationId', '', new UID(), 'Migration unique ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
@ -1047,12 +1085,15 @@ App::delete('/v1/migrations/:migrationId')
|
|||
->label('event', 'migrations.[migrationId].delete')
|
||||
->label('audits.event', 'migrationId.delete')
|
||||
->label('audits.resource', 'migrations/{request.migrationId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'migrations')
|
||||
->label('sdk.method', 'delete')
|
||||
->label('sdk.description', '/docs/references/migrations/delete-migration.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
name: 'delete',
|
||||
description: '/docs/references/migrations/delete-migration.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT,
|
||||
responseModel: Response::MODEL_NONE,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('migrationId', '', new UID(), 'Migration ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
<?php
|
||||
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\ResponseType;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\App;
|
||||
use Utopia\Database\Database;
|
||||
|
|
@ -20,12 +23,15 @@ App::get('/v1/project/usage')
|
|||
->desc('Get project usage stats')
|
||||
->groups(['api', 'usage'])
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'project')
|
||||
->label('sdk.method', 'getUsage')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USAGE_PROJECT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'project',
|
||||
name: 'getUsage',
|
||||
description: '/docs/references/project/get-usage.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_USAGE_PROJECT,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('startDate', '', new DateTimeValidator(), 'Starting date for the usage')
|
||||
->param('endDate', '', new DateTimeValidator(), 'End date for the usage')
|
||||
->param('period', '1d', new WhiteList(['1h', '1d']), 'Period used', true)
|
||||
|
|
@ -313,13 +319,15 @@ App::post('/v1/project/variables')
|
|||
->groups(['api'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('audits.event', 'variable.create')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'project')
|
||||
->label('sdk.method', 'createVariable')
|
||||
->label('sdk.description', '/docs/references/project/create-variable.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_VARIABLE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'project',
|
||||
name: 'createVariable',
|
||||
description: '/docs/references/project/create-variable.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_VARIABLE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('key', null, new Text(Database::LENGTH_KEY), 'Variable key. Max length: ' . Database::LENGTH_KEY . ' chars.', false)
|
||||
->param('value', null, new Text(8192, 0), 'Variable value. Max length: 8192 chars.', false)
|
||||
->inject('project')
|
||||
|
|
@ -367,13 +375,15 @@ App::get('/v1/project/variables')
|
|||
->desc('List variables')
|
||||
->groups(['api'])
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'project')
|
||||
->label('sdk.method', 'listVariables')
|
||||
->label('sdk.description', '/docs/references/project/list-variables.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_VARIABLE_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'project',
|
||||
name: 'listVariables',
|
||||
description: '/docs/references/project/list-variables.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_VARIABLE_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
->action(function (Response $response, Database $dbForProject) {
|
||||
|
|
@ -392,13 +402,15 @@ App::get('/v1/project/variables/:variableId')
|
|||
->desc('Get variable')
|
||||
->groups(['api'])
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'project')
|
||||
->label('sdk.method', 'getVariable')
|
||||
->label('sdk.description', '/docs/references/project/get-variable.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_VARIABLE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'project',
|
||||
name: 'getVariable',
|
||||
description: '/docs/references/project/get-variable.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_VARIABLE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('variableId', '', new UID(), 'Variable unique ID.', false)
|
||||
->inject('response')
|
||||
->inject('project')
|
||||
|
|
@ -416,13 +428,15 @@ App::put('/v1/project/variables/:variableId')
|
|||
->desc('Update variable')
|
||||
->groups(['api'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'project')
|
||||
->label('sdk.method', 'updateVariable')
|
||||
->label('sdk.description', '/docs/references/project/update-variable.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_VARIABLE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'project',
|
||||
name: 'updateVariable',
|
||||
description: '/docs/references/project/update-variable.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_VARIABLE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('variableId', '', new UID(), 'Variable unique ID.', false)
|
||||
->param('key', null, new Text(255), 'Variable key. Max length: 255 chars.', false)
|
||||
->param('value', null, new Text(8192, 0), 'Variable value. Max length: 8192 chars.', true)
|
||||
|
|
@ -462,12 +476,14 @@ App::delete('/v1/project/variables/:variableId')
|
|||
->desc('Delete variable')
|
||||
->groups(['api'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'project')
|
||||
->label('sdk.method', 'deleteVariable')
|
||||
->label('sdk.description', '/docs/references/project/delete-variable.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'project',
|
||||
name: 'deleteVariable',
|
||||
description: '/docs/references/project/delete-variable.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT,
|
||||
responseModel: Response::MODEL_NONE
|
||||
))
|
||||
->param('variableId', '', new UID(), 'Variable unique ID.', false)
|
||||
->inject('project')
|
||||
->inject('response')
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@ use Appwrite\Extend\Exception;
|
|||
use Appwrite\Hooks\Hooks;
|
||||
use Appwrite\Network\Validator\Email;
|
||||
use Appwrite\Network\Validator\Origin;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\ResponseType;
|
||||
use Appwrite\Template\Template;
|
||||
use Appwrite\Utopia\Database\Validator\ProjectId;
|
||||
use Appwrite\Utopia\Database\Validator\Queries\Projects;
|
||||
|
|
@ -62,12 +65,15 @@ App::post('/v1/projects')
|
|||
->groups(['api', 'projects'])
|
||||
->label('audits.event', 'projects.create')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'create')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROJECT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'create',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_PROJECT,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new ProjectId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can\'t start with a special char. Max length is 36 chars.')
|
||||
->param('name', null, new Text(128), 'Project name. Max length: 128 chars.')
|
||||
->param('teamId', '', new UID(), 'Team unique ID.')
|
||||
|
|
@ -252,12 +258,15 @@ App::get('/v1/projects')
|
|||
->desc('List projects')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'list')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROJECT_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'list',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PROJECT_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('queries', [], new Projects(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Projects::ALLOWED_ATTRIBUTES), true)
|
||||
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
|
||||
->inject('response')
|
||||
|
|
@ -311,12 +320,15 @@ App::get('/v1/projects/:projectId')
|
|||
->desc('Get project')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'get')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROJECT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'get',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PROJECT,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->inject('response')
|
||||
->inject('dbForConsole')
|
||||
|
|
@ -335,12 +347,15 @@ App::patch('/v1/projects/:projectId')
|
|||
->desc('Update project')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'update')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROJECT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'update',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PROJECT,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('name', null, new Text(128), 'Project name. Max length: 128 chars.')
|
||||
->param('description', '', new Text(256), 'Project description. Max length: 256 chars.', true)
|
||||
|
|
@ -382,12 +397,15 @@ App::patch('/v1/projects/:projectId/team')
|
|||
->desc('Update project team')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'updateTeam')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROJECT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'updateTeam',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PROJECT,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('teamId', '', new UID(), 'Team ID of the team to transfer project to.')
|
||||
->inject('response')
|
||||
|
|
@ -450,12 +468,15 @@ App::patch('/v1/projects/:projectId/service')
|
|||
->desc('Update service status')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'updateServiceStatus')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROJECT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'updateServiceStatus',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PROJECT,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('service', '', new WhiteList(array_keys(array_filter(Config::getParam('services'), fn ($element) => $element['optional'])), true), 'Service name.')
|
||||
->param('status', null, new Boolean(), 'Service status.')
|
||||
|
|
@ -481,12 +502,15 @@ App::patch('/v1/projects/:projectId/service/all')
|
|||
->desc('Update all service status')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'updateServiceStatusAll')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROJECT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'updateServiceStatusAll',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PROJECT,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('status', null, new Boolean(), 'Service status.')
|
||||
->inject('response')
|
||||
|
|
@ -515,12 +539,15 @@ App::patch('/v1/projects/:projectId/api')
|
|||
->desc('Update API status')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'updateApiStatus')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROJECT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'updateApiStatus',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PROJECT,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('api', '', new WhiteList(array_keys(Config::getParam('apis')), true), 'API name.')
|
||||
->param('status', null, new Boolean(), 'API status.')
|
||||
|
|
@ -546,12 +573,15 @@ App::patch('/v1/projects/:projectId/api/all')
|
|||
->desc('Update all API status')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'updateApiStatusAll')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROJECT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'updateApiStatusAll',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PROJECT,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('status', null, new Boolean(), 'API status.')
|
||||
->inject('response')
|
||||
|
|
@ -580,12 +610,15 @@ App::patch('/v1/projects/:projectId/oauth2')
|
|||
->desc('Update project OAuth2')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'updateOAuth2')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROJECT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'updateOAuth2',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PROJECT,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('provider', '', new WhiteList(\array_keys(Config::getParam('oAuthProviders')), true), 'Provider Name')
|
||||
->param('appId', null, new Text(256), 'Provider app ID. Max length: 256 chars.', true)
|
||||
|
|
@ -624,12 +657,15 @@ App::patch('/v1/projects/:projectId/auth/session-alerts')
|
|||
->desc('Update project sessions emails')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'updateSessionAlerts')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROJECT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'updateSessionAlerts',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PROJECT,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('alerts', false, new Boolean(true), 'Set to true to enable session emails.')
|
||||
->inject('response')
|
||||
|
|
@ -655,12 +691,15 @@ App::patch('/v1/projects/:projectId/auth/memberships-privacy')
|
|||
->desc('Update project memberships privacy attributes')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'updateMembershipsPrivacy')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROJECT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'updateMembershipsPrivacy',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PROJECT,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('userName', true, new Boolean(true), 'Set to true to show userName to members of a team.')
|
||||
->param('userEmail', true, new Boolean(true), 'Set to true to show email to members of a team.')
|
||||
|
|
@ -690,12 +729,15 @@ App::patch('/v1/projects/:projectId/auth/limit')
|
|||
->desc('Update project users limit')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'updateAuthLimit')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROJECT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'updateAuthLimit',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PROJECT,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('limit', false, new Range(0, APP_LIMIT_USERS), 'Set the max number of users allowed in this project. Use 0 for unlimited.')
|
||||
->inject('response')
|
||||
|
|
@ -721,12 +763,15 @@ App::patch('/v1/projects/:projectId/auth/duration')
|
|||
->desc('Update project authentication duration')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'updateAuthDuration')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROJECT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'updateAuthDuration',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PROJECT,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('duration', 31536000, new Range(0, 31536000), 'Project session length in seconds. Max length: 31536000 seconds.')
|
||||
->inject('response')
|
||||
|
|
@ -752,12 +797,15 @@ App::patch('/v1/projects/:projectId/auth/:method')
|
|||
->desc('Update project auth method status. Use this endpoint to enable or disable a given auth method for this project.')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'updateAuthStatus')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROJECT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'updateAuthStatus',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PROJECT,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('method', '', new WhiteList(\array_keys(Config::getParam('auth')), true), 'Auth Method. Possible values: ' . implode(',', \array_keys(Config::getParam('auth'))), false)
|
||||
->param('status', false, new Boolean(true), 'Set the status of this auth method.')
|
||||
|
|
@ -786,12 +834,15 @@ App::patch('/v1/projects/:projectId/auth/password-history')
|
|||
->desc('Update authentication password history. Use this endpoint to set the number of password history to save and 0 to disable password history.')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'updateAuthPasswordHistory')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROJECT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'updateAuthPasswordHistory',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PROJECT,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('limit', 0, new Range(0, APP_LIMIT_USER_PASSWORD_HISTORY), 'Set the max number of passwords to store in user history. User can\'t choose a new password that is already stored in the password history list. Max number of passwords allowed in history is' . APP_LIMIT_USER_PASSWORD_HISTORY . '. Default value is 0')
|
||||
->inject('response')
|
||||
|
|
@ -817,12 +868,15 @@ App::patch('/v1/projects/:projectId/auth/password-dictionary')
|
|||
->desc('Update authentication password dictionary status. Use this endpoint to enable or disable the dicitonary check for user password')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'updateAuthPasswordDictionary')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROJECT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'updateAuthPasswordDictionary',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PROJECT,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('enabled', false, new Boolean(false), 'Set whether or not to enable checking user\'s password against most commonly used passwords. Default is false.')
|
||||
->inject('response')
|
||||
|
|
@ -848,12 +902,15 @@ App::patch('/v1/projects/:projectId/auth/personal-data')
|
|||
->desc('Enable or disable checking user passwords for similarity with their personal data.')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'updatePersonalDataCheck')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROJECT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'updatePersonalDataCheck',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PROJECT,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('enabled', false, new Boolean(false), 'Set whether or not to check a password for similarity with personal data. Default is false.')
|
||||
->inject('response')
|
||||
|
|
@ -879,12 +936,15 @@ App::patch('/v1/projects/:projectId/auth/max-sessions')
|
|||
->desc('Update project user sessions limit')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'updateAuthSessionsLimit')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROJECT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'updateAuthSessionsLimit',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PROJECT,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('limit', false, new Range(1, APP_LIMIT_USER_SESSIONS_MAX), 'Set the max number of users allowed in this project. Value allowed is between 1-' . APP_LIMIT_USER_SESSIONS_MAX . '. Default is ' . APP_LIMIT_USER_SESSIONS_DEFAULT)
|
||||
->inject('response')
|
||||
|
|
@ -910,12 +970,15 @@ App::patch('/v1/projects/:projectId/auth/mock-numbers')
|
|||
->desc('Update the mock numbers for the project')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'updateMockNumbers')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROJECT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'updateMockNumbers',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PROJECT,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('numbers', '', new ArrayList(new MockNumber(), 10), 'An array of mock numbers and their corresponding verification codes (OTPs). Each number should be a valid E.164 formatted phone number. Maximum of 10 numbers are allowed.')
|
||||
->inject('response')
|
||||
|
|
@ -950,11 +1013,15 @@ App::delete('/v1/projects/:projectId')
|
|||
->groups(['api', 'projects'])
|
||||
->label('audits.event', 'projects.delete')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'delete')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'delete',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT,
|
||||
responseModel: Response::MODEL_NONE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->inject('response')
|
||||
->inject('user')
|
||||
|
|
@ -985,12 +1052,15 @@ App::post('/v1/projects/:projectId/webhooks')
|
|||
->desc('Create webhook')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'createWebhook')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_WEBHOOK)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'createWebhook',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_WEBHOOK,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('name', null, new Text(128), 'Webhook name. Max length: 128 chars.')
|
||||
->param('enabled', true, new Boolean(true), 'Enable or disable a webhook.', true)
|
||||
|
|
@ -1043,12 +1113,15 @@ App::get('/v1/projects/:projectId/webhooks')
|
|||
->desc('List webhooks')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'listWebhooks')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_WEBHOOK_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'listWebhooks',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_WEBHOOK_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->inject('response')
|
||||
->inject('dbForConsole')
|
||||
|
|
@ -1075,12 +1148,15 @@ App::get('/v1/projects/:projectId/webhooks/:webhookId')
|
|||
->desc('Get webhook')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'getWebhook')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_WEBHOOK)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'getWebhook',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_WEBHOOK,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('webhookId', '', new UID(), 'Webhook unique ID.')
|
||||
->inject('response')
|
||||
|
|
@ -1109,12 +1185,15 @@ App::put('/v1/projects/:projectId/webhooks/:webhookId')
|
|||
->desc('Update webhook')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'updateWebhook')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_WEBHOOK)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'updateWebhook',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_WEBHOOK,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('webhookId', '', new UID(), 'Webhook unique ID.')
|
||||
->param('name', null, new Text(128), 'Webhook name. Max length: 128 chars.')
|
||||
|
|
@ -1168,12 +1247,15 @@ App::patch('/v1/projects/:projectId/webhooks/:webhookId/signature')
|
|||
->desc('Update webhook signature key')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'updateWebhookSignature')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_WEBHOOK)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'updateWebhookSignature',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_WEBHOOK,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('webhookId', '', new UID(), 'Webhook unique ID.')
|
||||
->inject('response')
|
||||
|
|
@ -1207,11 +1289,15 @@ App::delete('/v1/projects/:projectId/webhooks/:webhookId')
|
|||
->desc('Delete webhook')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'deleteWebhook')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'deleteWebhook',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT,
|
||||
responseModel: Response::MODEL_NONE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('webhookId', '', new UID(), 'Webhook unique ID.')
|
||||
->inject('response')
|
||||
|
|
@ -1246,12 +1332,15 @@ App::post('/v1/projects/:projectId/keys')
|
|||
->desc('Create key')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'keys.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'createKey')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_KEY)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'createKey',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_KEY,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('name', null, new Text(128), 'Key name. Max length: 128 chars.')
|
||||
->param('scopes', null, new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Key scopes list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' scopes are allowed.')
|
||||
|
|
@ -1296,12 +1385,15 @@ App::get('/v1/projects/:projectId/keys')
|
|||
->desc('List keys')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'keys.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'listKeys')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_KEY_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'listKeys',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_KEY_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->inject('response')
|
||||
->inject('dbForConsole')
|
||||
|
|
@ -1328,12 +1420,15 @@ App::get('/v1/projects/:projectId/keys/:keyId')
|
|||
->desc('Get key')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'keys.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'getKey')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_KEY)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'getKey',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_KEY,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('keyId', '', new UID(), 'Key unique ID.')
|
||||
->inject('response')
|
||||
|
|
@ -1362,12 +1457,15 @@ App::put('/v1/projects/:projectId/keys/:keyId')
|
|||
->desc('Update key')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'keys.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'updateKey')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_KEY)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'updateKey',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_KEY,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('keyId', '', new UID(), 'Key unique ID.')
|
||||
->param('name', null, new Text(128), 'Key name. Max length: 128 chars.')
|
||||
|
|
@ -1408,11 +1506,15 @@ App::delete('/v1/projects/:projectId/keys/:keyId')
|
|||
->desc('Delete key')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'keys.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'deleteKey')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'deleteKey',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT,
|
||||
responseModel: Response::MODEL_NONE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('keyId', '', new UID(), 'Key unique ID.')
|
||||
->inject('response')
|
||||
|
|
@ -1447,12 +1549,15 @@ App::post('/v1/projects/:projectId/jwts')
|
|||
->groups(['api', 'projects'])
|
||||
->desc('Create JWT')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'createJWT')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_JWT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'createJWT',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_JWT,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('scopes', [], new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of scopes allowed for JWT key. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' scopes are allowed.')
|
||||
->param('duration', 900, new Range(0, 3600), 'Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.', true)
|
||||
|
|
@ -1483,12 +1588,15 @@ App::post('/v1/projects/:projectId/platforms')
|
|||
->groups(['api', 'projects'])
|
||||
->label('audits.event', 'platforms.create')
|
||||
->label('scope', 'platforms.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'createPlatform')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PLATFORM)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'createPlatform',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_PLATFORM,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('type', null, new WhiteList([Origin::CLIENT_TYPE_WEB, Origin::CLIENT_TYPE_FLUTTER_WEB, Origin::CLIENT_TYPE_FLUTTER_IOS, Origin::CLIENT_TYPE_FLUTTER_ANDROID, Origin::CLIENT_TYPE_FLUTTER_LINUX, Origin::CLIENT_TYPE_FLUTTER_MACOS, Origin::CLIENT_TYPE_FLUTTER_WINDOWS, Origin::CLIENT_TYPE_APPLE_IOS, Origin::CLIENT_TYPE_APPLE_MACOS, Origin::CLIENT_TYPE_APPLE_WATCHOS, Origin::CLIENT_TYPE_APPLE_TVOS, Origin::CLIENT_TYPE_ANDROID, Origin::CLIENT_TYPE_UNITY, Origin::CLIENT_TYPE_REACT_NATIVE_IOS, Origin::CLIENT_TYPE_REACT_NATIVE_ANDROID], true), 'Platform type.')
|
||||
->param('name', null, new Text(128), 'Platform name. Max length: 128 chars.')
|
||||
|
|
@ -1533,12 +1641,15 @@ App::get('/v1/projects/:projectId/platforms')
|
|||
->desc('List platforms')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'platforms.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'listPlatforms')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PLATFORM_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'listPlatforms',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PLATFORM_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->inject('response')
|
||||
->inject('dbForConsole')
|
||||
|
|
@ -1565,12 +1676,15 @@ App::get('/v1/projects/:projectId/platforms/:platformId')
|
|||
->desc('Get platform')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'platforms.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'getPlatform')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PLATFORM)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'getPlatform',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PLATFORM,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('platformId', '', new UID(), 'Platform unique ID.')
|
||||
->inject('response')
|
||||
|
|
@ -1599,12 +1713,15 @@ App::put('/v1/projects/:projectId/platforms/:platformId')
|
|||
->desc('Update platform')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'platforms.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'updatePlatform')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PLATFORM)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'updatePlatform',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PLATFORM,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('platformId', '', new UID(), 'Platform unique ID.')
|
||||
->param('name', null, new Text(128), 'Platform name. Max length: 128 chars.')
|
||||
|
|
@ -1647,11 +1764,15 @@ App::delete('/v1/projects/:projectId/platforms/:platformId')
|
|||
->groups(['api', 'projects'])
|
||||
->label('audits.event', 'platforms.delete')
|
||||
->label('scope', 'platforms.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'deletePlatform')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'deletePlatform',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT,
|
||||
responseModel: Response::MODEL_NONE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('platformId', '', new UID(), 'Platform unique ID.')
|
||||
->inject('response')
|
||||
|
|
@ -1686,12 +1807,15 @@ App::patch('/v1/projects/:projectId/smtp')
|
|||
->desc('Update SMTP')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'updateSmtp')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROJECT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'updateSmtp',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PROJECT,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('enabled', false, new Boolean(), 'Enable custom SMTP service')
|
||||
->param('senderName', '', new Text(255, 0), 'Name of the email sender', true)
|
||||
|
|
@ -1776,11 +1900,15 @@ App::post('/v1/projects/:projectId/smtp/tests')
|
|||
->desc('Create SMTP test')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'createSmtpTest')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'createSmtpTest',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT,
|
||||
responseModel: Response::MODEL_NONE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('emails', [], new ArrayList(new Email(), 10), 'Array of emails to send test email to. Maximum of 10 emails are allowed.')
|
||||
->param('senderName', System::getEnv('_APP_SYSTEM_EMAIL_NAME', APP_NAME . ' Server'), new Text(255, 0), 'Name of the email sender')
|
||||
|
|
@ -1835,12 +1963,15 @@ App::get('/v1/projects/:projectId/templates/sms/:type/:locale')
|
|||
->desc('Get custom SMS template')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'getSmsTemplate')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_SMS_TEMPLATE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'getSmsTemplate',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_SMS_TEMPLATE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type')
|
||||
->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes'])
|
||||
|
|
@ -1876,12 +2007,15 @@ App::get('/v1/projects/:projectId/templates/email/:type/:locale')
|
|||
->desc('Get custom email template')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'getEmailTemplate')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_EMAIL_TEMPLATE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'getEmailTemplate',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_EMAIL_TEMPLATE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type')
|
||||
->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes'])
|
||||
|
|
@ -1928,12 +2062,15 @@ App::patch('/v1/projects/:projectId/templates/sms/:type/:locale')
|
|||
->desc('Update custom SMS template')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'updateSmsTemplate')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_SMS_TEMPLATE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'updateSmsTemplate',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_SMS_TEMPLATE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type')
|
||||
->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes'])
|
||||
|
|
@ -1968,12 +2105,15 @@ App::patch('/v1/projects/:projectId/templates/email/:type/:locale')
|
|||
->desc('Update custom email templates')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'updateEmailTemplate')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROJECT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'updateEmailTemplate',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_EMAIL_TEMPLATE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type')
|
||||
->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes'])
|
||||
|
|
@ -2018,12 +2158,15 @@ App::delete('/v1/projects/:projectId/templates/sms/:type/:locale')
|
|||
->desc('Reset custom SMS template')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'deleteSmsTemplate')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_SMS_TEMPLATE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'deleteSmsTemplate',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_SMS_TEMPLATE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type')
|
||||
->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes'])
|
||||
|
|
@ -2061,12 +2204,15 @@ App::delete('/v1/projects/:projectId/templates/email/:type/:locale')
|
|||
->desc('Reset custom email template')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'projects')
|
||||
->label('sdk.method', 'deleteEmailTemplate')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_EMAIL_TEMPLATE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
name: 'deleteEmailTemplate',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_EMAIL_TEMPLATE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type')
|
||||
->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes'])
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ use Appwrite\Event\Delete;
|
|||
use Appwrite\Event\Event;
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\Network\Validator\CNAME;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\ResponseType;
|
||||
use Appwrite\Utopia\Database\Validator\Queries\Rules;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\App;
|
||||
|
|
@ -28,13 +31,15 @@ App::post('/v1/proxy/rules')
|
|||
->label('event', 'rules.[ruleId].create')
|
||||
->label('audits.event', 'rule.create')
|
||||
->label('audits.resource', 'rule/{response.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'proxy')
|
||||
->label('sdk.method', 'createRule')
|
||||
->label('sdk.description', '/docs/references/proxy/create-rule.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROXY_RULE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'proxy',
|
||||
name: 'createRule',
|
||||
description: '/docs/references/proxy/create-rule.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_PROXY_RULE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('domain', null, new ValidatorDomain(), 'Domain name.')
|
||||
->param('resourceType', null, new WhiteList(['api', 'function']), 'Action definition for the rule. Possible values are "api", "function"')
|
||||
->param('resourceId', '', new UID(), 'ID of resource for the action type. If resourceType is "api", leave empty. If resourceType is "function", provide ID of the function.', true)
|
||||
|
|
@ -150,13 +155,15 @@ App::get('/v1/proxy/rules')
|
|||
->groups(['api', 'proxy'])
|
||||
->desc('List rules')
|
||||
->label('scope', 'rules.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'proxy')
|
||||
->label('sdk.method', 'listRules')
|
||||
->label('sdk.description', '/docs/references/proxy/list-rules.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROXY_RULE_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'proxy',
|
||||
name: 'listRules',
|
||||
description: '/docs/references/proxy/list-rules.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PROXY_RULE_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('queries', [], new Rules(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Rules::ALLOWED_ATTRIBUTES), true)
|
||||
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
|
||||
->inject('response')
|
||||
|
|
@ -219,13 +226,15 @@ App::get('/v1/proxy/rules/:ruleId')
|
|||
->groups(['api', 'proxy'])
|
||||
->desc('Get rule')
|
||||
->label('scope', 'rules.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'proxy')
|
||||
->label('sdk.method', 'getRule')
|
||||
->label('sdk.description', '/docs/references/proxy/get-rule.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROXY_RULE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'proxy',
|
||||
name: 'getRule',
|
||||
description: '/docs/references/proxy/get-rule.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PROXY_RULE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('ruleId', '', new UID(), 'Rule ID.')
|
||||
->inject('response')
|
||||
->inject('project')
|
||||
|
|
@ -251,12 +260,14 @@ App::delete('/v1/proxy/rules/:ruleId')
|
|||
->label('event', 'rules.[ruleId].delete')
|
||||
->label('audits.event', 'rules.delete')
|
||||
->label('audits.resource', 'rule/{request.ruleId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'proxy')
|
||||
->label('sdk.method', 'deleteRule')
|
||||
->label('sdk.description', '/docs/references/proxy/delete-rule.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'proxy',
|
||||
name: 'deleteRule',
|
||||
description: '/docs/references/proxy/delete-rule.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT,
|
||||
responseModel: Response::MODEL_NONE,
|
||||
))
|
||||
->param('ruleId', '', new UID(), 'Rule ID.')
|
||||
->inject('response')
|
||||
->inject('project')
|
||||
|
|
@ -288,12 +299,15 @@ App::patch('/v1/proxy/rules/:ruleId/verification')
|
|||
->label('event', 'rules.[ruleId].update')
|
||||
->label('audits.event', 'rule.update')
|
||||
->label('audits.resource', 'rule/{response.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'proxy')
|
||||
->label('sdk.method', 'updateRuleVerification')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROXY_RULE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'proxy',
|
||||
name: 'updateRuleVerification',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PROXY_RULE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('ruleId', '', new UID(), 'Rule ID.')
|
||||
->inject('response')
|
||||
->inject('queueForCertificates')
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@ use Appwrite\Event\Delete;
|
|||
use Appwrite\Event\Event;
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\OpenSSL\OpenSSL;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\MethodType;
|
||||
use Appwrite\SDK\ResponseType;
|
||||
use Appwrite\Utopia\Database\Validator\CustomId;
|
||||
use Appwrite\Utopia\Database\Validator\Queries\Buckets;
|
||||
use Appwrite\Utopia\Database\Validator\Queries\Files;
|
||||
|
|
@ -54,13 +58,15 @@ App::post('/v1/storage/buckets')
|
|||
->label('event', 'buckets.[bucketId].create')
|
||||
->label('audits.event', 'bucket.create')
|
||||
->label('audits.resource', 'bucket/{response.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'storage')
|
||||
->label('sdk.method', 'createBucket')
|
||||
->label('sdk.description', '/docs/references/storage/create-bucket.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_BUCKET)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
name: 'createBucket',
|
||||
description: '/docs/references/storage/create-bucket.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_BUCKET,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('bucketId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
|
||||
->param('name', '', new Text(128), 'Bucket name')
|
||||
->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true)
|
||||
|
|
@ -150,13 +156,15 @@ App::get('/v1/storage/buckets')
|
|||
->groups(['api', 'storage'])
|
||||
->label('scope', 'buckets.read')
|
||||
->label('resourceType', RESOURCE_TYPE_BUCKETS)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'storage')
|
||||
->label('sdk.method', 'listBuckets')
|
||||
->label('sdk.description', '/docs/references/storage/list-buckets.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_BUCKET_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
name: 'listBuckets',
|
||||
description: '/docs/references/storage/list-buckets.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_BUCKET_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('queries', [], new Buckets(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Buckets::ALLOWED_ATTRIBUTES), true)
|
||||
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
|
||||
->inject('response')
|
||||
|
|
@ -211,13 +219,15 @@ App::get('/v1/storage/buckets/:bucketId')
|
|||
->groups(['api', 'storage'])
|
||||
->label('scope', 'buckets.read')
|
||||
->label('resourceType', RESOURCE_TYPE_BUCKETS)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'storage')
|
||||
->label('sdk.method', 'getBucket')
|
||||
->label('sdk.description', '/docs/references/storage/get-bucket.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_BUCKET)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
name: 'getBucket',
|
||||
description: '/docs/references/storage/get-bucket.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_BUCKET,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('bucketId', '', new UID(), 'Bucket unique ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
@ -240,13 +250,15 @@ App::put('/v1/storage/buckets/:bucketId')
|
|||
->label('event', 'buckets.[bucketId].update')
|
||||
->label('audits.event', 'bucket.update')
|
||||
->label('audits.resource', 'bucket/{response.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'storage')
|
||||
->label('sdk.method', 'updateBucket')
|
||||
->label('sdk.description', '/docs/references/storage/update-bucket.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_BUCKET)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
name: 'updateBucket',
|
||||
description: '/docs/references/storage/update-bucket.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_BUCKET,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('bucketId', '', new UID(), 'Bucket unique ID.')
|
||||
->param('name', null, new Text(128), 'Bucket name', false)
|
||||
->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).', true)
|
||||
|
|
@ -304,12 +316,14 @@ App::delete('/v1/storage/buckets/:bucketId')
|
|||
->label('audits.event', 'bucket.delete')
|
||||
->label('event', 'buckets.[bucketId].delete')
|
||||
->label('audits.resource', 'bucket/{request.bucketId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'storage')
|
||||
->label('sdk.method', 'deleteBucket')
|
||||
->label('sdk.description', '/docs/references/storage/delete-bucket.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
name: 'deleteBucket',
|
||||
description: '/docs/references/storage/delete-bucket.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT,
|
||||
responseModel: Response::MODEL_NONE,
|
||||
))
|
||||
->param('bucketId', '', new UID(), 'Bucket unique ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
@ -350,15 +364,17 @@ App::post('/v1/storage/buckets/:bucketId/files')
|
|||
->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId},chunkId:{chunkId}')
|
||||
->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT)
|
||||
->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'storage')
|
||||
->label('sdk.method', 'createFile')
|
||||
->label('sdk.description', '/docs/references/storage/create-file.md')
|
||||
->label('sdk.request.type', 'multipart/form-data')
|
||||
->label('sdk.methodType', 'upload')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_FILE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
name: 'createFile',
|
||||
description: '/docs/references/storage/create-file.md',
|
||||
methodType: MethodType::UPLOAD,
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
requestType: 'multipart/form-data',
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_FILE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).')
|
||||
->param('fileId', '', new CustomId(), 'File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
|
||||
->param('file', [], new File(), 'Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file).', skipValidation: true)
|
||||
|
|
@ -714,13 +730,15 @@ App::get('/v1/storage/buckets/:bucketId/files')
|
|||
->groups(['api', 'storage'])
|
||||
->label('scope', 'files.read')
|
||||
->label('resourceType', RESOURCE_TYPE_BUCKETS)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'storage')
|
||||
->label('sdk.method', 'listFiles')
|
||||
->label('sdk.description', '/docs/references/storage/list-files.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_FILE_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
name: 'listFiles',
|
||||
description: '/docs/references/storage/list-files.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_FILE_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).')
|
||||
->param('queries', [], new Files(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Files::ALLOWED_ATTRIBUTES), true)
|
||||
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
|
||||
|
|
@ -806,13 +824,15 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId')
|
|||
->groups(['api', 'storage'])
|
||||
->label('scope', 'files.read')
|
||||
->label('resourceType', RESOURCE_TYPE_BUCKETS)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'storage')
|
||||
->label('sdk.method', 'getFile')
|
||||
->label('sdk.description', '/docs/references/storage/get-file.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_FILE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
name: 'getFile',
|
||||
description: '/docs/references/storage/get-file.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_FILE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).')
|
||||
->param('fileId', '', new UID(), 'File ID.')
|
||||
->inject('response')
|
||||
|
|
@ -857,13 +877,16 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
|
|||
->label('cache', true)
|
||||
->label('cache.resourceType', 'bucket/{request.bucketId}')
|
||||
->label('cache.resource', 'file/{request.fileId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'storage')
|
||||
->label('sdk.method', 'getFilePreview')
|
||||
->label('sdk.description', '/docs/references/storage/get-file-preview.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE)
|
||||
->label('sdk.methodType', 'location')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
name: 'getFilePreview',
|
||||
description: '/docs/references/storage/get-file-preview.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::IMAGE,
|
||||
responseModel: Response::MODEL_NONE,
|
||||
methodType: MethodType::LOCATION,
|
||||
))
|
||||
->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).')
|
||||
->param('fileId', '', new UID(), 'File ID')
|
||||
->param('width', 0, new Range(0, 4000), 'Resize preview image width, Pass an integer between 0 to 4000.', true)
|
||||
|
|
@ -1027,13 +1050,16 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download')
|
|||
->groups(['api', 'storage'])
|
||||
->label('scope', 'files.read')
|
||||
->label('resourceType', RESOURCE_TYPE_BUCKETS)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'storage')
|
||||
->label('sdk.method', 'getFileDownload')
|
||||
->label('sdk.description', '/docs/references/storage/get-file-download.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', '*/*')
|
||||
->label('sdk.methodType', 'location')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
name: 'getFileDownload',
|
||||
description: '/docs/references/storage/get-file-download.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::ANY,
|
||||
responseModel: Response::MODEL_NONE,
|
||||
methodType: MethodType::LOCATION,
|
||||
))
|
||||
->param('bucketId', '', new UID(), 'Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).')
|
||||
->param('fileId', '', new UID(), 'File ID.')
|
||||
->inject('request')
|
||||
|
|
@ -1168,13 +1194,16 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view')
|
|||
->groups(['api', 'storage'])
|
||||
->label('scope', 'files.read')
|
||||
->label('resourceType', RESOURCE_TYPE_BUCKETS)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'storage')
|
||||
->label('sdk.method', 'getFileView')
|
||||
->label('sdk.description', '/docs/references/storage/get-file-view.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', '*/*')
|
||||
->label('sdk.methodType', 'location')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
name: 'getFileView',
|
||||
description: '/docs/references/storage/get-file-view.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::ANY,
|
||||
responseModel: Response::MODEL_NONE,
|
||||
methodType: MethodType::LOCATION,
|
||||
))
|
||||
->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).')
|
||||
->param('fileId', '', new UID(), 'File ID.')
|
||||
->inject('response')
|
||||
|
|
@ -1481,13 +1510,15 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId')
|
|||
->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}')
|
||||
->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT)
|
||||
->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'storage')
|
||||
->label('sdk.method', 'updateFile')
|
||||
->label('sdk.description', '/docs/references/storage/update-file.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_FILE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
name: 'updateFile',
|
||||
description: '/docs/references/storage/update-file.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_FILE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).')
|
||||
->param('fileId', '', new UID(), 'File unique ID.')
|
||||
->param('name', null, new Text(255), 'Name of the file', true)
|
||||
|
|
@ -1590,12 +1621,14 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId')
|
|||
->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}')
|
||||
->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT)
|
||||
->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'storage')
|
||||
->label('sdk.method', 'deleteFile')
|
||||
->label('sdk.description', '/docs/references/storage/delete-file.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
name: 'deleteFile',
|
||||
description: '/docs/references/storage/delete-file.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT,
|
||||
responseModel: Response::MODEL_NONE
|
||||
))
|
||||
->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).')
|
||||
->param('fileId', '', new UID(), 'File ID.')
|
||||
->inject('response')
|
||||
|
|
@ -1682,12 +1715,15 @@ App::get('/v1/storage/usage')
|
|||
->groups(['api', 'storage'])
|
||||
->label('scope', 'files.read')
|
||||
->label('resourceType', RESOURCE_TYPE_BUCKETS)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'storage')
|
||||
->label('sdk.method', 'getUsage')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USAGE_STORAGE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
name: 'getUsage',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::JSON,
|
||||
responseModel: Response::MODEL_USAGE_STORAGE,
|
||||
))
|
||||
->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true)
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
@ -1762,12 +1798,15 @@ App::get('/v1/storage/:bucketId/usage')
|
|||
->groups(['api', 'storage'])
|
||||
->label('scope', 'files.read')
|
||||
->label('resourceType', RESOURCE_TYPE_BUCKETS)
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'storage')
|
||||
->label('sdk.method', 'getBucketUsage')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USAGE_BUCKETS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
name: 'getBucketUsage',
|
||||
description: '/docs/references/storage/get-bucket-usage.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::JSON,
|
||||
responseModel: Response::MODEL_USAGE_BUCKETS,
|
||||
))
|
||||
->param('bucketId', '', new UID(), 'Bucket ID.')
|
||||
->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true)
|
||||
->inject('response')
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@ use Appwrite\Event\Messaging;
|
|||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\Network\Validator\Email;
|
||||
use Appwrite\Platform\Workers\Deletes;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\ResponseType;
|
||||
use Appwrite\Template\Template;
|
||||
use Appwrite\Utopia\Database\Validator\CustomId;
|
||||
use Appwrite\Utopia\Database\Validator\Queries\Memberships;
|
||||
|
|
@ -53,13 +56,15 @@ App::post('/v1/teams')
|
|||
->label('scope', 'teams.write')
|
||||
->label('audits.event', 'team.create')
|
||||
->label('audits.resource', 'team/{response.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'teams')
|
||||
->label('sdk.method', 'create')
|
||||
->label('sdk.description', '/docs/references/teams/create-team.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_TEAM)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
name: 'create',
|
||||
description: '/docs/references/teams/create-team.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_TEAM,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('teamId', '', new CustomId(), 'Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
|
||||
->param('name', null, new Text(128), 'Team name. Max length: 128 chars.')
|
||||
->param('roles', ['owner'], new ArrayList(new Key(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 32 characters long.', true)
|
||||
|
|
@ -138,14 +143,16 @@ App::get('/v1/teams')
|
|||
->desc('List teams')
|
||||
->groups(['api', 'teams'])
|
||||
->label('scope', 'teams.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'teams')
|
||||
->label('sdk.method', 'list')
|
||||
->label('sdk.description', '/docs/references/teams/list-teams.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_TEAM_LIST)
|
||||
->label('sdk.offline.model', '/teams')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
name: 'list',
|
||||
description: '/docs/references/teams/list-teams.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_TEAM_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
offlineModel: '/teams',
|
||||
))
|
||||
->param('queries', [], new Teams(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Teams::ALLOWED_ATTRIBUTES), true)
|
||||
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
|
||||
->inject('response')
|
||||
|
|
@ -202,15 +209,17 @@ App::get('/v1/teams/:teamId')
|
|||
->desc('Get team')
|
||||
->groups(['api', 'teams'])
|
||||
->label('scope', 'teams.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'teams')
|
||||
->label('sdk.method', 'get')
|
||||
->label('sdk.description', '/docs/references/teams/get-team.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_TEAM)
|
||||
->label('sdk.offline.model', '/teams')
|
||||
->label('sdk.offline.key', '{teamId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
name: 'get',
|
||||
description: '/docs/references/teams/get-team.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_TEAM,
|
||||
responseType: ResponseType::JSON,
|
||||
offlineModel: '/teams',
|
||||
offlineKey: '{teamId}',
|
||||
))
|
||||
->param('teamId', '', new UID(), 'Team ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
@ -229,14 +238,16 @@ App::get('/v1/teams/:teamId/prefs')
|
|||
->desc('Get team preferences')
|
||||
->groups(['api', 'teams'])
|
||||
->label('scope', 'teams.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'teams')
|
||||
->label('sdk.method', 'getPrefs')
|
||||
->label('sdk.description', '/docs/references/teams/get-team-prefs.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PREFERENCES)
|
||||
->label('sdk.offline.model', '/teams/{teamId}/prefs')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
name: 'getPrefs',
|
||||
description: '/docs/references/teams/get-team-prefs.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PREFERENCES,
|
||||
responseType: ResponseType::JSON,
|
||||
offlineModel: '/teams/{teamId}/prefs',
|
||||
))
|
||||
->param('teamId', '', new UID(), 'Team ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
@ -260,15 +271,17 @@ App::put('/v1/teams/:teamId')
|
|||
->label('scope', 'teams.write')
|
||||
->label('audits.event', 'team.update')
|
||||
->label('audits.resource', 'team/{response.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'teams')
|
||||
->label('sdk.method', 'updateName')
|
||||
->label('sdk.description', '/docs/references/teams/update-team-name.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_TEAM)
|
||||
->label('sdk.offline.model', '/teams')
|
||||
->label('sdk.offline.key', '{teamId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
name: 'updateName',
|
||||
description: '/docs/references/teams/update-team-name.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_TEAM,
|
||||
responseType: ResponseType::JSON,
|
||||
offlineModel: '/teams',
|
||||
offlineKey: '{teamId}',
|
||||
))
|
||||
->param('teamId', '', new UID(), 'Team ID.')
|
||||
->param('name', null, new Text(128), 'New team name. Max length: 128 chars.')
|
||||
->inject('requestTimestamp')
|
||||
|
|
@ -304,14 +317,16 @@ App::put('/v1/teams/:teamId/prefs')
|
|||
->label('audits.event', 'team.update')
|
||||
->label('audits.resource', 'team/{response.$id}')
|
||||
->label('audits.userId', '{response.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'teams')
|
||||
->label('sdk.method', 'updatePrefs')
|
||||
->label('sdk.description', '/docs/references/teams/update-team-prefs.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PREFERENCES)
|
||||
->label('sdk.offline.model', '/teams/{teamId}/prefs')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
name: 'updatePrefs',
|
||||
description: '/docs/references/teams/update-team-prefs.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PREFERENCES,
|
||||
responseType: ResponseType::JSON,
|
||||
offlineModel: '/teams/{teamId}/prefs',
|
||||
))
|
||||
->param('teamId', '', new UID(), 'Team ID.')
|
||||
->param('prefs', '', new Assoc(), 'Prefs key-value JSON object.')
|
||||
->inject('response')
|
||||
|
|
@ -339,12 +354,14 @@ App::delete('/v1/teams/:teamId')
|
|||
->label('scope', 'teams.write')
|
||||
->label('audits.event', 'team.delete')
|
||||
->label('audits.resource', 'team/{request.teamId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'teams')
|
||||
->label('sdk.method', 'delete')
|
||||
->label('sdk.description', '/docs/references/teams/delete-team.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
name: 'delete',
|
||||
description: '/docs/references/teams/delete-team.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT,
|
||||
responseModel: Response::MODEL_NONE
|
||||
))
|
||||
->param('teamId', '', new UID(), 'Team ID.')
|
||||
->inject('response')
|
||||
->inject('getProjectDB')
|
||||
|
|
@ -390,13 +407,15 @@ App::post('/v1/teams/:teamId/memberships')
|
|||
->label('audits.event', 'membership.create')
|
||||
->label('audits.resource', 'team/{request.teamId}')
|
||||
->label('audits.userId', '{request.userId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'teams')
|
||||
->label('sdk.method', 'createMembership')
|
||||
->label('sdk.description', '/docs/references/teams/create-team-membership.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MEMBERSHIP)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
name: 'createMembership',
|
||||
description: '/docs/references/teams/create-team-membership.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_MEMBERSHIP,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->label('abuse-limit', 10)
|
||||
->param('teamId', '', new UID(), 'Team ID.')
|
||||
->param('email', '', new Email(), 'Email of the new team member.', true)
|
||||
|
|
@ -715,14 +734,16 @@ App::get('/v1/teams/:teamId/memberships')
|
|||
->desc('List team memberships')
|
||||
->groups(['api', 'teams'])
|
||||
->label('scope', 'teams.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'teams')
|
||||
->label('sdk.method', 'listMemberships')
|
||||
->label('sdk.description', '/docs/references/teams/list-team-members.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MEMBERSHIP_LIST)
|
||||
->label('sdk.offline.model', '/teams/{teamId}/memberships')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
name: 'listMemberships',
|
||||
description: '/docs/references/teams/list-team-members.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_MEMBERSHIP_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
offlineModel: '/teams/{teamId}/memberships',
|
||||
))
|
||||
->param('teamId', '', new UID(), 'Team ID.')
|
||||
->param('queries', [], new Memberships(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Memberships::ALLOWED_ATTRIBUTES), true)
|
||||
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
|
||||
|
|
@ -846,15 +867,17 @@ App::get('/v1/teams/:teamId/memberships/:membershipId')
|
|||
->desc('Get team membership')
|
||||
->groups(['api', 'teams'])
|
||||
->label('scope', 'teams.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'teams')
|
||||
->label('sdk.method', 'getMembership')
|
||||
->label('sdk.description', '/docs/references/teams/get-team-member.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MEMBERSHIP)
|
||||
->label('sdk.offline.model', '/teams/{teamId}/memberships')
|
||||
->label('sdk.offline.key', '{membershipId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
name: 'getMembership',
|
||||
description: '/docs/references/teams/get-team-member.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_MEMBERSHIP,
|
||||
responseType: ResponseType::JSON,
|
||||
offlineModel: '/teams/{teamId}/memberships',
|
||||
offlineKey: '{membershipId}',
|
||||
))
|
||||
->param('teamId', '', new UID(), 'Team ID.')
|
||||
->param('membershipId', '', new UID(), 'Membership ID.')
|
||||
->inject('response')
|
||||
|
|
@ -927,13 +950,15 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId')
|
|||
->label('scope', 'teams.write')
|
||||
->label('audits.event', 'membership.update')
|
||||
->label('audits.resource', 'team/{request.teamId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'teams')
|
||||
->label('sdk.method', 'updateMembership')
|
||||
->label('sdk.description', '/docs/references/teams/update-team-membership.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MEMBERSHIP)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
name: 'updateMembership',
|
||||
description: '/docs/references/teams/update-team-membership.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_MEMBERSHIP,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('teamId', '', new UID(), 'Team ID.')
|
||||
->param('membershipId', '', new UID(), 'Membership ID.')
|
||||
->param('roles', [], function (Document $project) {
|
||||
|
|
@ -1010,13 +1035,15 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status')
|
|||
->label('audits.event', 'membership.update')
|
||||
->label('audits.resource', 'team/{request.teamId}')
|
||||
->label('audits.userId', '{request.userId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'teams')
|
||||
->label('sdk.method', 'updateMembershipStatus')
|
||||
->label('sdk.description', '/docs/references/teams/update-team-membership-status.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MEMBERSHIP)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
name: 'updateMembershipStatus',
|
||||
description: '/docs/references/teams/update-team-membership-status.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_MEMBERSHIP,
|
||||
responseType: ResponseType::JSON
|
||||
))
|
||||
->param('teamId', '', new UID(), 'Team ID.')
|
||||
->param('membershipId', '', new UID(), 'Membership ID.')
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
|
|
@ -1147,12 +1174,15 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId')
|
|||
->label('scope', 'teams.write')
|
||||
->label('audits.event', 'membership.delete')
|
||||
->label('audits.resource', 'team/{request.teamId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'teams')
|
||||
->label('sdk.method', 'deleteMembership')
|
||||
->label('sdk.description', '/docs/references/teams/delete-team-membership.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
name: 'deleteMembership',
|
||||
description: '/docs/references/teams/delete-team-membership.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT,
|
||||
responseModel: Response::MODEL_NONE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('teamId', '', new UID(), 'Team ID.')
|
||||
->param('membershipId', '', new UID(), 'Membership ID.')
|
||||
->inject('response')
|
||||
|
|
@ -1210,13 +1240,15 @@ App::get('/v1/teams/:teamId/logs')
|
|||
->desc('List team logs')
|
||||
->groups(['api', 'teams'])
|
||||
->label('scope', 'teams.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'teams')
|
||||
->label('sdk.method', 'listLogs')
|
||||
->label('sdk.description', '/docs/references/teams/get-team-logs.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_LOG_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
name: 'listLogs',
|
||||
description: '/docs/references/teams/get-team-logs.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_LOG_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('teamId', '', new UID(), 'Team ID.')
|
||||
->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true)
|
||||
->inject('response')
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@ use Appwrite\Event\Event;
|
|||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\Hooks\Hooks;
|
||||
use Appwrite\Network\Validator\Email;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\ResponseType;
|
||||
use Appwrite\Utopia\Database\Validator\CustomId;
|
||||
use Appwrite\Utopia\Database\Validator\Queries\Identities;
|
||||
use Appwrite\Utopia\Database\Validator\Queries\Targets;
|
||||
|
|
@ -192,6 +195,15 @@ App::post('/v1/users')
|
|||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'create',
|
||||
description: '/docs/references/users/create-user.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_USER,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
|
||||
->param('email', null, new Email(), 'User email.', true)
|
||||
->param('phone', null, new Phone(), 'Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.', true)
|
||||
|
|
@ -214,13 +226,15 @@ App::post('/v1/users/bcrypt')
|
|||
->label('scope', 'users.write')
|
||||
->label('audits.event', 'user.create')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'createBcryptUser')
|
||||
->label('sdk.description', '/docs/references/users/create-bcrypt-user.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'createBcryptUser',
|
||||
description: '/docs/references/users/create-bcrypt-user.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_USER,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
|
||||
->param('email', '', new Email(), 'User email.')
|
||||
->param('password', '', new Password(), 'User password hashed using Bcrypt.')
|
||||
|
|
@ -243,13 +257,15 @@ App::post('/v1/users/md5')
|
|||
->label('scope', 'users.write')
|
||||
->label('audits.event', 'user.create')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'createMD5User')
|
||||
->label('sdk.description', '/docs/references/users/create-md5-user.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'createMD5User',
|
||||
description: '/docs/references/users/create-md5-user.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_USER,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
|
||||
->param('email', '', new Email(), 'User email.')
|
||||
->param('password', '', new Password(), 'User password hashed using MD5.')
|
||||
|
|
@ -272,13 +288,15 @@ App::post('/v1/users/argon2')
|
|||
->label('scope', 'users.write')
|
||||
->label('audits.event', 'user.create')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'createArgon2User')
|
||||
->label('sdk.description', '/docs/references/users/create-argon2-user.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'createArgon2User',
|
||||
description: '/docs/references/users/create-argon2-user.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_USER,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
|
||||
->param('email', '', new Email(), 'User email.')
|
||||
->param('password', '', new Password(), 'User password hashed using Argon2.')
|
||||
|
|
@ -301,13 +319,15 @@ App::post('/v1/users/sha')
|
|||
->label('scope', 'users.write')
|
||||
->label('audits.event', 'user.create')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'createSHAUser')
|
||||
->label('sdk.description', '/docs/references/users/create-sha-user.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'createSHAUser',
|
||||
description: '/docs/references/users/create-sha-user.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_USER,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
|
||||
->param('email', '', new Email(), 'User email.')
|
||||
->param('password', '', new Password(), 'User password hashed using SHA.')
|
||||
|
|
@ -337,13 +357,15 @@ App::post('/v1/users/phpass')
|
|||
->label('scope', 'users.write')
|
||||
->label('audits.event', 'user.create')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'createPHPassUser')
|
||||
->label('sdk.description', '/docs/references/users/create-phpass-user.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'createPHPassUser',
|
||||
description: '/docs/references/users/create-phpass-user.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_USER,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
|
||||
->param('email', '', new Email(), 'User email.')
|
||||
->param('password', '', new Password(), 'User password hashed using PHPass.')
|
||||
|
|
@ -366,13 +388,15 @@ App::post('/v1/users/scrypt')
|
|||
->label('scope', 'users.write')
|
||||
->label('audits.event', 'user.create')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'createScryptUser')
|
||||
->label('sdk.description', '/docs/references/users/create-scrypt-user.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'createScryptUser',
|
||||
description: '/docs/references/users/create-scrypt-user.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_USER,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
|
||||
->param('email', '', new Email(), 'User email.')
|
||||
->param('password', '', new Password(), 'User password hashed using Scrypt.')
|
||||
|
|
@ -408,13 +432,15 @@ App::post('/v1/users/scrypt-modified')
|
|||
->label('scope', 'users.write')
|
||||
->label('audits.event', 'user.create')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'createScryptModifiedUser')
|
||||
->label('sdk.description', '/docs/references/users/create-scrypt-modified-user.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'createScryptModifiedUser',
|
||||
description: '/docs/references/users/create-scrypt-modified-user.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_USER,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
|
||||
->param('email', '', new Email(), 'User email.')
|
||||
->param('password', '', new Password(), 'User password hashed using Scrypt Modified.')
|
||||
|
|
@ -441,13 +467,15 @@ App::post('/v1/users/:userId/targets')
|
|||
->label('audits.resource', 'target/response.$id')
|
||||
->label('event', 'users.[userId].targets.[targetId].create')
|
||||
->label('scope', 'targets.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'createTarget')
|
||||
->label('sdk.description', '/docs/references/users/create-target.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_TARGET)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'createTarget',
|
||||
description: '/docs/references/users/create-target.md',
|
||||
auth: [AuthType::KEY, AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_TARGET,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('targetId', '', new CustomId(), 'Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->param('providerType', '', new WhiteList([MESSAGE_TYPE_EMAIL, MESSAGE_TYPE_SMS, MESSAGE_TYPE_PUSH]), 'The target provider type. Can be one of the following: `email`, `sms` or `push`.')
|
||||
|
|
@ -527,13 +555,15 @@ App::get('/v1/users')
|
|||
->desc('List users')
|
||||
->groups(['api', 'users'])
|
||||
->label('scope', 'users.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'list')
|
||||
->label('sdk.description', '/docs/references/users/list-users.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'list',
|
||||
description: '/docs/references/users/list-users.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_USER_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('queries', [], new Users(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Users::ALLOWED_ATTRIBUTES), true)
|
||||
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
|
||||
->inject('response')
|
||||
|
|
@ -587,13 +617,15 @@ App::get('/v1/users/:userId')
|
|||
->desc('Get user')
|
||||
->groups(['api', 'users'])
|
||||
->label('scope', 'users.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'get')
|
||||
->label('sdk.description', '/docs/references/users/get-user.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'get',
|
||||
description: '/docs/references/users/get-user.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_USER,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
@ -612,13 +644,15 @@ App::get('/v1/users/:userId/prefs')
|
|||
->desc('Get user preferences')
|
||||
->groups(['api', 'users'])
|
||||
->label('scope', 'users.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'getPrefs')
|
||||
->label('sdk.description', '/docs/references/users/get-user-prefs.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PREFERENCES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'getPrefs',
|
||||
description: '/docs/references/users/get-user-prefs.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PREFERENCES,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
@ -639,13 +673,15 @@ App::get('/v1/users/:userId/targets/:targetId')
|
|||
->desc('Get user target')
|
||||
->groups(['api', 'users'])
|
||||
->label('scope', 'targets.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'getTarget')
|
||||
->label('sdk.description', '/docs/references/users/get-user-target.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_TARGET)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'getTarget',
|
||||
description: '/docs/references/users/get-user-target.md',
|
||||
auth: [AuthType::KEY, AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_TARGET,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->param('targetId', '', new UID(), 'Target ID.')
|
||||
->inject('response')
|
||||
|
|
@ -671,13 +707,15 @@ App::get('/v1/users/:userId/sessions')
|
|||
->desc('List user sessions')
|
||||
->groups(['api', 'users'])
|
||||
->label('scope', 'users.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'listSessions')
|
||||
->label('sdk.description', '/docs/references/users/list-user-sessions.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_SESSION_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'listSessions',
|
||||
description: '/docs/references/users/list-user-sessions.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_SESSION_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
@ -712,13 +750,15 @@ App::get('/v1/users/:userId/memberships')
|
|||
->desc('List user memberships')
|
||||
->groups(['api', 'users'])
|
||||
->label('scope', 'users.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'listMemberships')
|
||||
->label('sdk.description', '/docs/references/users/list-user-memberships.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MEMBERSHIP_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'listMemberships',
|
||||
description: '/docs/references/users/list-user-memberships.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_MEMBERSHIP_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
@ -751,13 +791,15 @@ App::get('/v1/users/:userId/logs')
|
|||
->desc('List user logs')
|
||||
->groups(['api', 'users'])
|
||||
->label('scope', 'users.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'listLogs')
|
||||
->label('sdk.description', '/docs/references/users/list-user-logs.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_LOG_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'listLogs',
|
||||
description: '/docs/references/users/list-user-logs.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_LOG_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true)
|
||||
->inject('response')
|
||||
|
|
@ -840,13 +882,15 @@ App::get('/v1/users/:userId/targets')
|
|||
->desc('List user targets')
|
||||
->groups(['api', 'users'])
|
||||
->label('scope', 'targets.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'listTargets')
|
||||
->label('sdk.description', '/docs/references/users/list-user-targets.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_TARGET_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'listTargets',
|
||||
description: '/docs/references/users/list-user-targets.md',
|
||||
auth: [AuthType::KEY, AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_TARGET_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->param('queries', [], new Targets(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Users::ALLOWED_ATTRIBUTES), true)
|
||||
->inject('response')
|
||||
|
|
@ -900,13 +944,15 @@ App::get('/v1/users/identities')
|
|||
->desc('List identities')
|
||||
->groups(['api', 'users'])
|
||||
->label('scope', 'users.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'listIdentities')
|
||||
->label('sdk.description', '/docs/references/users/list-identities.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_IDENTITY_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'listIdentities',
|
||||
description: '/docs/references/users/list-identities.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_IDENTITY_LIST,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('queries', [], new Identities(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Identities::ALLOWED_ATTRIBUTES), true)
|
||||
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
|
||||
->inject('response')
|
||||
|
|
@ -964,13 +1010,15 @@ App::patch('/v1/users/:userId/status')
|
|||
->label('audits.event', 'user.update')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('audits.userId', '{response.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'updateStatus')
|
||||
->label('sdk.description', '/docs/references/users/update-user-status.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'updateStatus',
|
||||
description: '/docs/references/users/update-user-status.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_USER,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->param('status', null, new Boolean(true), 'User Status. To activate the user pass `true` and to block the user pass `false`.')
|
||||
->inject('response')
|
||||
|
|
@ -999,13 +1047,15 @@ App::put('/v1/users/:userId/labels')
|
|||
->label('scope', 'users.write')
|
||||
->label('audits.event', 'user.update')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'updateLabels')
|
||||
->label('sdk.description', '/docs/references/users/update-user-labels.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'updateLabels',
|
||||
description: '/docs/references/users/update-user-labels.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_USER,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->param('labels', [], new ArrayList(new Text(36, allowList: [...Text::NUMBERS, ...Text::ALPHABET_UPPER, ...Text::ALPHABET_LOWER]), APP_LIMIT_ARRAY_LABELS_SIZE), 'Array of user labels. Replaces the previous labels. Maximum of ' . APP_LIMIT_ARRAY_LABELS_SIZE . ' labels are allowed, each up to 36 alphanumeric characters long.')
|
||||
->inject('response')
|
||||
|
|
@ -1036,13 +1086,15 @@ App::patch('/v1/users/:userId/verification/phone')
|
|||
->label('scope', 'users.write')
|
||||
->label('audits.event', 'verification.update')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'updatePhoneVerification')
|
||||
->label('sdk.description', '/docs/references/users/update-user-phone-verification.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'updatePhoneVerification',
|
||||
description: '/docs/references/users/update-user-phone-verification.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_USER,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->param('phoneVerification', false, new Boolean(), 'User phone verification status.')
|
||||
->inject('response')
|
||||
|
|
@ -1072,13 +1124,15 @@ App::patch('/v1/users/:userId/name')
|
|||
->label('audits.event', 'user.update')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('audits.userId', '{response.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'updateName')
|
||||
->label('sdk.description', '/docs/references/users/update-user-name.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'updateName',
|
||||
description: '/docs/references/users/update-user-name.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_USER,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->param('name', '', new Text(128, 0), 'User name. Max length: 128 chars.')
|
||||
->inject('response')
|
||||
|
|
@ -1109,13 +1163,15 @@ App::patch('/v1/users/:userId/password')
|
|||
->label('audits.event', 'user.update')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('audits.userId', '{response.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'updatePassword')
|
||||
->label('sdk.description', '/docs/references/users/update-user-password.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'updatePassword',
|
||||
description: '/docs/references/users/update-user-password.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_USER,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->param('password', '', fn ($project, $passwordsDictionary) => new PasswordDictionary($passwordsDictionary, enabled: $project->getAttribute('auths', [])['passwordDictionary'] ?? false, allowEmpty: true), 'New user password. Must be at least 8 chars.', false, ['project', 'passwordsDictionary'])
|
||||
->inject('response')
|
||||
|
|
@ -1186,13 +1242,15 @@ App::patch('/v1/users/:userId/email')
|
|||
->label('audits.event', 'user.update')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('audits.userId', '{response.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'updateEmail')
|
||||
->label('sdk.description', '/docs/references/users/update-user-email.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'updateEmail',
|
||||
description: '/docs/references/users/update-user-email.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_USER,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->param('email', '', new Email(allowEmpty: true), 'User email.')
|
||||
->inject('response')
|
||||
|
|
@ -1280,13 +1338,15 @@ App::patch('/v1/users/:userId/phone')
|
|||
->label('scope', 'users.write')
|
||||
->label('audits.event', 'user.update')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'updatePhone')
|
||||
->label('sdk.description', '/docs/references/users/update-user-phone.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'updatePhone',
|
||||
description: '/docs/references/users/update-user-phone.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_USER,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->param('number', '', new Phone(allowEmpty: true), 'User phone number.')
|
||||
->inject('response')
|
||||
|
|
@ -1364,13 +1424,15 @@ App::patch('/v1/users/:userId/verification')
|
|||
->label('audits.event', 'verification.update')
|
||||
->label('audits.resource', 'user/{request.userId}')
|
||||
->label('audits.userId', '{request.userId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'updateEmailVerification')
|
||||
->label('sdk.description', '/docs/references/users/update-user-email-verification.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'updateEmailVerification',
|
||||
description: '/docs/references/users/update-user-email-verification.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_USER,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->param('emailVerification', false, new Boolean(), 'User email verification status.')
|
||||
->inject('response')
|
||||
|
|
@ -1396,13 +1458,15 @@ App::patch('/v1/users/:userId/prefs')
|
|||
->groups(['api', 'users'])
|
||||
->label('event', 'users.[userId].update.prefs')
|
||||
->label('scope', 'users.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'updatePrefs')
|
||||
->label('sdk.description', '/docs/references/users/update-user-prefs.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PREFERENCES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'updatePrefs',
|
||||
description: '/docs/references/users/update-user-prefs.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_PREFERENCES,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->param('prefs', '', new Assoc(), 'Prefs key-value JSON object.')
|
||||
->inject('response')
|
||||
|
|
@ -1431,13 +1495,15 @@ App::patch('/v1/users/:userId/targets/:targetId')
|
|||
->label('audits.resource', 'target/{response.$id}')
|
||||
->label('event', 'users.[userId].targets.[targetId].update')
|
||||
->label('scope', 'targets.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'updateTarget')
|
||||
->label('sdk.description', '/docs/references/users/update-target.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_TARGET)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'updateTarget',
|
||||
description: '/docs/references/users/update-target.md',
|
||||
auth: [AuthType::KEY, AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_TARGET,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->param('targetId', '', new UID(), 'Target ID.')
|
||||
->param('identifier', '', new Text(Database::LENGTH_KEY), 'The target identifier (token, email, phone etc.)', true)
|
||||
|
|
@ -1530,13 +1596,15 @@ App::patch('/v1/users/:userId/mfa')
|
|||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('audits.userId', '{response.$id}')
|
||||
->label('usage.metric', 'users.{scope}.requests.update')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'updateMfa')
|
||||
->label('sdk.description', '/docs/references/users/update-user-mfa.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'updateMfa',
|
||||
description: '/docs/references/users/update-user-mfa.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_USER,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->param('mfa', null, new Boolean(), 'Enable or disable MFA.')
|
||||
->inject('response')
|
||||
|
|
@ -1564,13 +1632,15 @@ App::get('/v1/users/:userId/mfa/factors')
|
|||
->groups(['api', 'users'])
|
||||
->label('scope', 'users.read')
|
||||
->label('usage.metric', 'users.{scope}.requests.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'listMfaFactors')
|
||||
->label('sdk.description', '/docs/references/users/list-mfa-factors.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MFA_FACTORS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'listMfaFactors',
|
||||
description: '/docs/references/users/list-mfa-factors.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_MFA_FACTORS,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
@ -1597,13 +1667,15 @@ App::get('/v1/users/:userId/mfa/recovery-codes')
|
|||
->groups(['api', 'users'])
|
||||
->label('scope', 'users.read')
|
||||
->label('usage.metric', 'users.{scope}.requests.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'getMfaRecoveryCodes')
|
||||
->label('sdk.description', '/docs/references/users/get-mfa-recovery-codes.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MFA_RECOVERY_CODES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'getMfaRecoveryCodes',
|
||||
description: '/docs/references/users/get-mfa-recovery-codes.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_MFA_RECOVERY_CODES,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
@ -1636,13 +1708,15 @@ App::patch('/v1/users/:userId/mfa/recovery-codes')
|
|||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('audits.userId', '{response.$id}')
|
||||
->label('usage.metric', 'users.{scope}.requests.update')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'createMfaRecoveryCodes')
|
||||
->label('sdk.description', '/docs/references/users/create-mfa-recovery-codes.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MFA_RECOVERY_CODES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'createMfaRecoveryCodes',
|
||||
description: '/docs/references/users/create-mfa-recovery-codes.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_MFA_RECOVERY_CODES,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
@ -1682,13 +1756,15 @@ App::put('/v1/users/:userId/mfa/recovery-codes')
|
|||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('audits.userId', '{response.$id}')
|
||||
->label('usage.metric', 'users.{scope}.requests.update')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'updateMfaRecoveryCodes')
|
||||
->label('sdk.description', '/docs/references/users/update-mfa-recovery-codes.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_MFA_RECOVERY_CODES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'updateMfaRecoveryCodes',
|
||||
description: '/docs/references/users/update-mfa-recovery-codes.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_MFA_RECOVERY_CODES,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
@ -1727,13 +1803,15 @@ App::delete('/v1/users/:userId/mfa/authenticators/:type')
|
|||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('audits.userId', '{response.$id}')
|
||||
->label('usage.metric', 'users.{scope}.requests.update')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'deleteMfaAuthenticator')
|
||||
->label('sdk.description', '/docs/references/users/delete-mfa-authenticator.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'deleteMfaAuthenticator',
|
||||
description: '/docs/references/users/delete-mfa-authenticator.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_USER,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.')
|
||||
->inject('response')
|
||||
|
|
@ -1768,13 +1846,15 @@ App::post('/v1/users/:userId/sessions')
|
|||
->label('audits.event', 'session.create')
|
||||
->label('audits.resource', 'user/{request.userId}')
|
||||
->label('usage.metric', 'sessions.{scope}.requests.create')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'createSession')
|
||||
->label('sdk.description', '/docs/references/users/create-session.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_SESSION)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'createSession',
|
||||
description: '/docs/references/users/create-session.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_SESSION,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
|
||||
->inject('request')
|
||||
->inject('response')
|
||||
|
|
@ -1837,13 +1917,15 @@ App::post('/v1/users/:userId/tokens')
|
|||
->label('scope', 'users.write')
|
||||
->label('audits.event', 'tokens.create')
|
||||
->label('audits.resource', 'user/{request.userId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'createToken')
|
||||
->label('sdk.description', '/docs/references/users/create-token.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_TOKEN)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'createToken',
|
||||
description: '/docs/references/users/create-token.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_TOKEN,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->param('length', 6, new Range(4, 128), 'Token length in characters. The default length is 6 characters', true)
|
||||
->param('expire', Auth::TOKEN_EXPIRATION_GENERIC, new Range(60, Auth::TOKEN_EXPIRATION_LOGIN_LONG), 'Token expiration period in seconds. The default expiration is 15 minutes.', true)
|
||||
|
|
@ -1894,12 +1976,15 @@ App::delete('/v1/users/:userId/sessions/:sessionId')
|
|||
->label('scope', 'users.write')
|
||||
->label('audits.event', 'session.delete')
|
||||
->label('audits.resource', 'user/{request.userId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'deleteSession')
|
||||
->label('sdk.description', '/docs/references/users/delete-user-session.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'deleteSession',
|
||||
description: '/docs/references/users/delete-user-session.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT,
|
||||
responseModel: Response::MODEL_NONE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->param('sessionId', '', new UID(), 'Session ID.')
|
||||
->inject('response')
|
||||
|
|
@ -1937,12 +2022,15 @@ App::delete('/v1/users/:userId/sessions')
|
|||
->label('scope', 'users.write')
|
||||
->label('audits.event', 'session.delete')
|
||||
->label('audits.resource', 'user/{user.$id}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'deleteSessions')
|
||||
->label('sdk.description', '/docs/references/users/delete-user-sessions.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'deleteSessions',
|
||||
description: '/docs/references/users/delete-user-sessions.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT,
|
||||
responseModel: Response::MODEL_NONE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
@ -1979,12 +2067,15 @@ App::delete('/v1/users/:userId')
|
|||
->label('scope', 'users.write')
|
||||
->label('audits.event', 'user.delete')
|
||||
->label('audits.resource', 'user/{request.userId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'delete')
|
||||
->label('sdk.description', '/docs/references/users/delete.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'delete',
|
||||
description: '/docs/references/users/delete.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT,
|
||||
responseModel: Response::MODEL_NONE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
@ -2021,13 +2112,15 @@ App::delete('/v1/users/:userId/targets/:targetId')
|
|||
->label('audits.resource', 'target/{request.$targetId}')
|
||||
->label('event', 'users.[userId].targets.[targetId].delete')
|
||||
->label('scope', 'targets.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'deleteTarget')
|
||||
->label('sdk.description', '/docs/references/users/delete-target.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'deleteTarget',
|
||||
description: '/docs/references/users/delete-target.md',
|
||||
auth: [AuthType::KEY, AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT,
|
||||
responseModel: Response::MODEL_NONE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->param('targetId', '', new UID(), 'Target ID.')
|
||||
->inject('queueForEvents')
|
||||
|
|
@ -2072,12 +2165,15 @@ App::delete('/v1/users/identities/:identityId')
|
|||
->label('scope', 'users.write')
|
||||
->label('audits.event', 'identity.delete')
|
||||
->label('audits.resource', 'identity/{request.$identityId}')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'deleteIdentity')
|
||||
->label('sdk.description', '/docs/references/users/delete-identity.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'deleteIdentity',
|
||||
description: '/docs/references/users/delete-identity.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT,
|
||||
responseModel: Response::MODEL_NONE,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('identityId', '', new UID(), 'Identity ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
@ -2104,13 +2200,15 @@ App::post('/v1/users/:userId/jwts')
|
|||
->desc('Create user JWT')
|
||||
->groups(['api', 'users'])
|
||||
->label('scope', 'users.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'createJWT')
|
||||
->label('sdk.description', '/docs/references/users/create-user-jwt.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_JWT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'createJWT',
|
||||
description: '/docs/references/users/create-user-jwt.md',
|
||||
auth: [AuthType::KEY],
|
||||
responseCode: Response::STATUS_CODE_CREATED,
|
||||
responseModel: Response::MODEL_JWT,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('userId', '', new UID(), 'User ID.')
|
||||
->param('sessionId', '', new UID(), 'Session ID. Use the string \'recent\' to use the most recent session. Defaults to the most recent session.', true)
|
||||
->param('duration', 900, new Range(0, 3600), 'Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.', true)
|
||||
|
|
@ -2154,12 +2252,15 @@ App::get('/v1/users/usage')
|
|||
->desc('Get users usage stats')
|
||||
->groups(['api', 'users'])
|
||||
->label('scope', 'users.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'getUsage')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USAGE_USERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
name: 'getUsage',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseModel: Response::MODEL_USAGE_USERS,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true)
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
|
|
|
|||
|
|
@ -4,6 +4,10 @@ use Appwrite\Auth\OAuth2\Github as OAuth2Github;
|
|||
use Appwrite\Event\Build;
|
||||
use Appwrite\Event\Delete;
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\MethodType;
|
||||
use Appwrite\SDK\ResponseType;
|
||||
use Appwrite\Utopia\Database\Validator\Queries\Installations;
|
||||
use Appwrite\Utopia\Request;
|
||||
use Appwrite\Utopia\Response;
|
||||
|
|
@ -269,13 +273,17 @@ App::get('/v1/vcs/github/authorize')
|
|||
->label('scope', 'vcs.read')
|
||||
->label('sdk.namespace', 'vcs')
|
||||
->label('error', __DIR__ . '/../../views/general/error.phtml')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.method', 'createGitHubInstallation')
|
||||
->label('sdk.description', '')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_MOVED_PERMANENTLY)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_HTML)
|
||||
->label('sdk.methodType', 'webAuth')
|
||||
->label('sdk.hide', true)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vcs',
|
||||
name: 'createGitHubInstallation',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseModel: Response::MODEL_NONE,
|
||||
responseCode: Response::STATUS_CODE_MOVED_PERMANENTLY,
|
||||
responseType: ResponseType::HTML,
|
||||
methodType: MethodType::WEBAUTH,
|
||||
hide: true,
|
||||
))
|
||||
->param('success', '', fn ($clients) => new Host($clients), 'URL to redirect back to console after a successful installation attempt.', true, ['clients'])
|
||||
->param('failure', '', fn ($clients) => new Host($clients), 'URL to redirect back to console after a failed installation attempt.', true, ['clients'])
|
||||
->inject('request')
|
||||
|
|
@ -467,13 +475,15 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro
|
|||
->desc('Get files and directories of a VCS repository')
|
||||
->groups(['api', 'vcs'])
|
||||
->label('scope', 'vcs.read')
|
||||
->label('sdk.namespace', 'vcs')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.method', 'getRepositoryContents')
|
||||
->label('sdk.description', '')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_VCS_CONTENT_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vcs',
|
||||
name: 'getRepositoryContents',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseModel: Response::MODEL_VCS_CONTENT_LIST,
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('installationId', '', new Text(256), 'Installation Id')
|
||||
->param('providerRepositoryId', '', new Text(256), 'Repository Id')
|
||||
->param('providerRootDirectory', '', new Text(256, 0), 'Path to get contents of nested directory', true)
|
||||
|
|
@ -528,13 +538,15 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories/:pr
|
|||
->desc('Detect runtime settings from source code')
|
||||
->groups(['api', 'vcs'])
|
||||
->label('scope', 'vcs.write')
|
||||
->label('sdk.namespace', 'vcs')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.method', 'createRepositoryDetection')
|
||||
->label('sdk.description', '')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_DETECTION)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vcs',
|
||||
name: 'createRepositoryDetection',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseModel: Response::MODEL_DETECTION,
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('installationId', '', new Text(256), 'Installation Id')
|
||||
->param('providerRepositoryId', '', new Text(256), 'Repository Id')
|
||||
->param('providerRootDirectory', '', new Text(256, 0), 'Path to Root Directory', true)
|
||||
|
|
@ -600,13 +612,15 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories')
|
|||
->desc('List repositories')
|
||||
->groups(['api', 'vcs'])
|
||||
->label('scope', 'vcs.read')
|
||||
->label('sdk.namespace', 'vcs')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.method', 'listRepositories')
|
||||
->label('sdk.description', '')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROVIDER_REPOSITORY_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vcs',
|
||||
name: 'listRepositories',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseModel: Response::MODEL_PROVIDER_REPOSITORY_LIST,
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('installationId', '', new Text(256), 'Installation Id')
|
||||
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
|
||||
->inject('gitHub')
|
||||
|
|
@ -695,13 +709,15 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories')
|
|||
->desc('Create repository')
|
||||
->groups(['api', 'vcs'])
|
||||
->label('scope', 'vcs.write')
|
||||
->label('sdk.namespace', 'vcs')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.method', 'createRepository')
|
||||
->label('sdk.description', '')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROVIDER_REPOSITORY)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vcs',
|
||||
name: 'createRepository',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseModel: Response::MODEL_PROVIDER_REPOSITORY,
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('installationId', '', new Text(256), 'Installation Id')
|
||||
->param('name', '', new Text(256), 'Repository name (slug)')
|
||||
->param('private', '', new Boolean(false), 'Mark repository public or private')
|
||||
|
|
@ -796,13 +812,15 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro
|
|||
->desc('Get repository')
|
||||
->groups(['api', 'vcs'])
|
||||
->label('scope', 'vcs.read')
|
||||
->label('sdk.namespace', 'vcs')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.method', 'getRepository')
|
||||
->label('sdk.description', '')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_PROVIDER_REPOSITORY)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vcs',
|
||||
name: 'getRepository',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseModel: Response::MODEL_PROVIDER_REPOSITORY,
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('installationId', '', new Text(256), 'Installation Id')
|
||||
->param('providerRepositoryId', '', new Text(256), 'Repository Id')
|
||||
->inject('gitHub')
|
||||
|
|
@ -845,13 +863,15 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro
|
|||
->desc('List repository branches')
|
||||
->groups(['api', 'vcs'])
|
||||
->label('scope', 'vcs.read')
|
||||
->label('sdk.namespace', 'vcs')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.method', 'listRepositoryBranches')
|
||||
->label('sdk.description', '')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_BRANCH_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vcs',
|
||||
name: 'listRepositoryBranches',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseModel: Response::MODEL_BRANCH_LIST,
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('installationId', '', new Text(256), 'Installation Id')
|
||||
->param('providerRepositoryId', '', new Text(256), 'Repository Id')
|
||||
->inject('gitHub')
|
||||
|
|
@ -1033,13 +1053,15 @@ App::get('/v1/vcs/installations')
|
|||
->desc('List installations')
|
||||
->groups(['api', 'vcs'])
|
||||
->label('scope', 'vcs.read')
|
||||
->label('sdk.namespace', 'vcs')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.method', 'listInstallations')
|
||||
->label('sdk.description', '/docs/references/vcs/list-installations.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_INSTALLATION_LIST)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vcs',
|
||||
name: 'listInstallations',
|
||||
description: '/docs/references/vcs/list-installations.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseModel: Response::MODEL_INSTALLATION_LIST,
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('queries', [], new Installations(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Installations::ALLOWED_ATTRIBUTES), true)
|
||||
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
|
||||
->inject('response')
|
||||
|
|
@ -1099,13 +1121,15 @@ App::get('/v1/vcs/installations/:installationId')
|
|||
->desc('Get installation')
|
||||
->groups(['api', 'vcs'])
|
||||
->label('scope', 'vcs.read')
|
||||
->label('sdk.namespace', 'vcs')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.method', 'getInstallation')
|
||||
->label('sdk.description', '/docs/references/vcs/get-installation.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_INSTALLATION)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vcs',
|
||||
name: 'getInstallation',
|
||||
description: '/docs/references/vcs/get-installation.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseModel: Response::MODEL_INSTALLATION,
|
||||
responseCode: Response::STATUS_CODE_OK,
|
||||
responseType: ResponseType::JSON,
|
||||
))
|
||||
->param('installationId', '', new Text(256), 'Installation Id')
|
||||
->inject('response')
|
||||
->inject('project')
|
||||
|
|
@ -1128,12 +1152,14 @@ App::delete('/v1/vcs/installations/:installationId')
|
|||
->desc('Delete installation')
|
||||
->groups(['api', 'vcs'])
|
||||
->label('scope', 'vcs.write')
|
||||
->label('sdk.namespace', 'vcs')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.method', 'deleteInstallation')
|
||||
->label('sdk.description', '/docs/references/vcs/delete-installation.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vcs',
|
||||
name: 'deleteInstallation',
|
||||
description: '/docs/references/vcs/delete-installation.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseModel: Response::MODEL_NONE,
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT
|
||||
))
|
||||
->param('installationId', '', new Text(256), 'Installation Id')
|
||||
->inject('response')
|
||||
->inject('project')
|
||||
|
|
@ -1161,12 +1187,14 @@ App::patch('/v1/vcs/github/installations/:installationId/repositories/:repositor
|
|||
->desc('Authorize external deployment')
|
||||
->groups(['api', 'vcs'])
|
||||
->label('scope', 'vcs.write')
|
||||
->label('sdk.namespace', 'vcs')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
->label('sdk.method', 'updateExternalDeployments')
|
||||
->label('sdk.description', '')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vcs',
|
||||
name: 'updateExternalDeployments',
|
||||
description: '',
|
||||
auth: [AuthType::ADMIN],
|
||||
responseModel: Response::MODEL_NONE,
|
||||
responseCode: Response::STATUS_CODE_NOCONTENT
|
||||
))
|
||||
->param('installationId', '', new Text(256), 'Installation Id')
|
||||
->param('repositoryId', '', new Text(256), 'VCS Repository Id')
|
||||
->param('providerPullRequestId', '', new Text(256), 'GitHub Pull Request Id')
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ App::get('/v1/mock/tests/general/oauth2')
|
|||
->groups(['mock'])
|
||||
->label('scope', 'public')
|
||||
->label('docs', false)
|
||||
->label('sdk.mock', true)
|
||||
->label('mock', true)
|
||||
->param('client_id', '', new Text(100), 'OAuth2 Client ID.')
|
||||
->param('redirect_uri', '', new Host(['localhost']), 'OAuth2 Redirect URI.') // Important to deny an open redirect attack
|
||||
->param('scope', '', new Text(100), 'OAuth2 scope list.')
|
||||
|
|
@ -40,7 +40,7 @@ App::get('/v1/mock/tests/general/oauth2/token')
|
|||
->groups(['mock'])
|
||||
->label('scope', 'public')
|
||||
->label('docs', false)
|
||||
->label('sdk.mock', true)
|
||||
->label('mock', true)
|
||||
->param('client_id', '', new Text(100), 'OAuth2 Client ID.')
|
||||
->param('client_secret', '', new Text(100), 'OAuth2 scope list.')
|
||||
->param('grant_type', 'authorization_code', new WhiteList(['refresh_token', 'authorization_code']), 'OAuth2 Grant Type.', true)
|
||||
|
|
|
|||
|
|
@ -343,11 +343,16 @@ App::init()
|
|||
}
|
||||
|
||||
/** Do not allow access to disabled services */
|
||||
$service = $route->getLabel('sdk.namespace', '');
|
||||
if (!empty($service)) {
|
||||
/**
|
||||
* @var ?\Appwrite\SDK\Method $method
|
||||
*/
|
||||
$method = $route->getLabel('sdk', false);
|
||||
|
||||
if (!empty($method)) {
|
||||
$namespace = $method->getNamespace();
|
||||
if (
|
||||
array_key_exists($service, $project->getAttribute('services', []))
|
||||
&& !$project->getAttribute('services', [])[$service]
|
||||
array_key_exists($namespace, $project->getAttribute('services', []))
|
||||
&& !$project->getAttribute('services', [])[$namespace]
|
||||
&& !(Auth::isPrivilegedUser(Authorization::getRoles()) || Auth::isAppUser(Authorization::getRoles()))
|
||||
) {
|
||||
throw new Exception(Exception::GENERAL_SERVICE_DISABLED);
|
||||
|
|
|
|||
1
docs/references/account/create-push-target.md
Normal file
1
docs/references/account/create-push-target.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
Use this endpoint to update an existing push target for messages for the currently logged in user.
|
||||
1
docs/references/account/delete-push-target.md
Normal file
1
docs/references/account/delete-push-target.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
Use this endpoint to delete an existing push target for messages for the currently logged in user.
|
||||
1
docs/references/account/update-push-target.md
Normal file
1
docs/references/account/update-push-target.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
Use this endpoint to create a new push target for messages for the currently logged in user.
|
||||
1
docs/references/health/get-version.md
Normal file
1
docs/references/health/get-version.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
Get the version of Appwrite that this instance is currently running.
|
||||
|
|
@ -98,14 +98,17 @@ class Schema
|
|||
foreach ($routes as $route) {
|
||||
/** @var Route $route */
|
||||
|
||||
$namespace = $route->getLabel('sdk.namespace', '');
|
||||
$method = $route->getLabel('sdk.method', '');
|
||||
$name = $namespace . \ucfirst($method);
|
||||
/** @var \Appwrite\SDK\Method $sdk */
|
||||
$sdk = $route->getLabel('sdk', false);
|
||||
|
||||
if (empty($name)) {
|
||||
if (empty($sdk)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$namespace = $sdk->getNamespace();
|
||||
$method = $sdk->getMethodName();
|
||||
$name = $namespace . \ucfirst($method);
|
||||
|
||||
foreach (Mapper::route($utopia, $route, $complexity) as $field) {
|
||||
switch ($route->getMethod()) {
|
||||
case 'GET':
|
||||
|
|
|
|||
|
|
@ -86,7 +86,14 @@ class Mapper
|
|||
}
|
||||
}
|
||||
|
||||
$names = $route->getLabel('sdk.response.model', 'none');
|
||||
/** @var \Appwrite\SDK\Method $sdk */
|
||||
$sdk = $route->getLabel('sdk', false);
|
||||
|
||||
if (!$sdk) {
|
||||
return;
|
||||
}
|
||||
|
||||
$names = $sdk->getResponseModel() ?? [];
|
||||
$models = \is_array($names)
|
||||
? \array_map(static fn ($m) => static::$models[$m], $names)
|
||||
: [static::$models[$names]];
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Appwrite\Platform\Tasks;
|
||||
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\Specification\Format\OpenAPI3;
|
||||
use Appwrite\Specification\Format\Swagger2;
|
||||
use Appwrite\Specification\Specification;
|
||||
|
|
@ -182,25 +183,31 @@ class Specs extends Action
|
|||
|
||||
foreach ($appRoutes as $key => $method) {
|
||||
foreach ($method as $route) {
|
||||
$hide = $route->getLabel('sdk.hide', false);
|
||||
$sdk = $route->getLabel('sdk', false);
|
||||
|
||||
/** @var \Appwrite\SDK\Method $sdk */
|
||||
if (empty($sdk)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$hide = $sdk->isHidden();
|
||||
if ($hide === true || (\is_array($hide) && \in_array($platform, $hide))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/** @var \Utopia\Route $route */
|
||||
$routeSecurity = $route->getLabel('sdk.auth', []);
|
||||
$routeSecurity = $sdk->getAuth();
|
||||
$sdkPlatforms = [];
|
||||
|
||||
foreach ($routeSecurity as $value) {
|
||||
switch ($value) {
|
||||
case APP_AUTH_TYPE_SESSION:
|
||||
case AuthType::SESSION:
|
||||
$sdkPlatforms[] = APP_PLATFORM_CLIENT;
|
||||
break;
|
||||
case APP_AUTH_TYPE_JWT:
|
||||
case APP_AUTH_TYPE_KEY:
|
||||
case AuthType::JWT:
|
||||
case AuthType::KEY:
|
||||
$sdkPlatforms[] = APP_PLATFORM_SERVER;
|
||||
break;
|
||||
case APP_AUTH_TYPE_ADMIN:
|
||||
case AuthType::ADMIN:
|
||||
$sdkPlatforms[] = APP_PLATFORM_CONSOLE;
|
||||
break;
|
||||
}
|
||||
|
|
@ -215,15 +222,15 @@ class Specs extends Action
|
|||
continue;
|
||||
}
|
||||
|
||||
if ($route->getLabel('sdk.mock', false) && !$mocks) {
|
||||
if ($route->getLabel('mock', false) && !$mocks) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!$route->getLabel('sdk.mock', false) && $mocks) {
|
||||
if (!$route->getLabel('mock', false) && $mocks) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (empty($route->getLabel('sdk.namespace', null))) {
|
||||
if (empty($sdk->getNamespace())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
222
src/Appwrite/SDK/Method.php
Normal file
222
src/Appwrite/SDK/Method.php
Normal file
|
|
@ -0,0 +1,222 @@
|
|||
<?php
|
||||
|
||||
namespace Appwrite\SDK;
|
||||
|
||||
use Appwrite\Utopia\Response;
|
||||
use Swoole\Http\Response as HttpResponse;
|
||||
|
||||
enum AuthType: string {
|
||||
case JWT = APP_AUTH_TYPE_JWT;
|
||||
case KEY = APP_AUTH_TYPE_KEY;
|
||||
case SESSION = APP_AUTH_TYPE_SESSION;
|
||||
case ADMIN = APP_AUTH_TYPE_ADMIN;
|
||||
}
|
||||
|
||||
enum MethodType: string {
|
||||
case WEBAUTH = 'webAuth';
|
||||
case LOCATION = 'location';
|
||||
case GRAPHQL = 'graphql';
|
||||
case UPLOAD = 'upload';
|
||||
}
|
||||
|
||||
enum ResponseType: string {
|
||||
case NONE = '';
|
||||
case JSON = 'application/json';
|
||||
case IMAGE = 'image/*';
|
||||
case IMAGE_PNG = 'image/png';
|
||||
case MULTIPART = 'multipart/form-data';
|
||||
case HTML = 'text/html';
|
||||
case TEXT = 'text/plain';
|
||||
case ANY = '*/*';
|
||||
}
|
||||
|
||||
class Method
|
||||
{
|
||||
static array $knownMethods = [];
|
||||
|
||||
/**
|
||||
* Initialise a new SDK method
|
||||
*
|
||||
* @param array<AuthType> $authTypes
|
||||
* @param string $namespace
|
||||
* @param MethodType $methodType
|
||||
* @param string $desc
|
||||
* @param int $responseCode
|
||||
* @param string $responseModel
|
||||
* @param string $offlineKey
|
||||
* @param string $offlineModel
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function __construct(
|
||||
protected string $namespace,
|
||||
protected string $name,
|
||||
protected string $description,
|
||||
protected array $auth,
|
||||
protected int $responseCode,
|
||||
protected string|array $responseModel,
|
||||
protected ResponseType $responseType = ResponseType::JSON,
|
||||
protected ?MethodType $methodType = null,
|
||||
protected ?string $offlineKey = null,
|
||||
protected ?string $offlineModel = null,
|
||||
protected ?string $offlineResponseKey = null,
|
||||
protected bool $deprecated = false,
|
||||
protected array|bool $hide = false,
|
||||
protected bool $packaging = false,
|
||||
protected string $requestType = 'application/json',
|
||||
protected array $parameters = [],
|
||||
)
|
||||
{
|
||||
$this->validateMethod($name, $namespace);
|
||||
$this->validateAuthTypes($auth);
|
||||
// Disabled for now, will be enabled later
|
||||
// $this->validateDesc($description);
|
||||
$this->validateResponseModel($responseModel);
|
||||
|
||||
// No content check
|
||||
if ($responseCode === 204) {
|
||||
if ($responseModel !== Response::MODEL_NONE) {
|
||||
throw new \Exception("Error with {$this->getDebugName()} method: Response code 204 must have response model 'none'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function getDebugName(): string
|
||||
{
|
||||
return $this->namespace . '.' . $this->name;
|
||||
}
|
||||
|
||||
private function validateMethod(string $name, string $namespace): void
|
||||
{
|
||||
if (\in_array($this->getDebugName(), self::$knownMethods)) {
|
||||
throw new \Exception('Method ' . $name . ' already exists in namespace ' . $namespace);
|
||||
}
|
||||
|
||||
self::$knownMethods[] = $this->getDebugName();
|
||||
}
|
||||
|
||||
private function validateAuthTypes(array $authTypes): void
|
||||
{
|
||||
foreach ($authTypes as $authType) {
|
||||
if (!($authType instanceof AuthType)) {
|
||||
throw new \Exception("Error with {$this->getDebugName()} method: Invalid auth type");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function validateDesc(string $desc): void
|
||||
{
|
||||
if (empty($desc)) {
|
||||
throw new \Exception("Error with {$this->getDebugName()} method: Description file not set");
|
||||
}
|
||||
|
||||
$descPath = \realpath(__DIR__ . '/../../../' . $desc);
|
||||
|
||||
if (!\file_exists($descPath)) {
|
||||
throw new \Exception("Error with {$this->getDebugName()} method: Description file not found at {$descPath}");
|
||||
}
|
||||
}
|
||||
|
||||
private function validateResponseModel(string|array $responseModel): void
|
||||
{
|
||||
$response = new Response(new HttpResponse());
|
||||
|
||||
if (\is_array($responseModel)) {
|
||||
foreach ($responseModel as $model) {
|
||||
try {
|
||||
$response->getModel($model);
|
||||
} catch (\Exception $e) {
|
||||
throw new \Exception("Error with {$this->getDebugName()} method: Invalid response model, make sure the model has been defined in Response.php");
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
$response->getModel($responseModel);
|
||||
} catch (\Exception $e) {
|
||||
throw new \Exception("Error with {$this->getDebugName()} method: Invalid response model, make sure the model has been defined in Response.php");
|
||||
}
|
||||
}
|
||||
|
||||
public function getNamespace(): string
|
||||
{
|
||||
return $this->namespace;
|
||||
}
|
||||
|
||||
public function getMethodName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
public function getAuth(): array
|
||||
{
|
||||
return $this->auth;
|
||||
}
|
||||
|
||||
public function getResponseCode(): int
|
||||
{
|
||||
return $this->responseCode;
|
||||
}
|
||||
|
||||
public function getResponseModel(): string|array
|
||||
{
|
||||
return $this->responseModel;
|
||||
}
|
||||
|
||||
public function getResponseType(): ResponseType
|
||||
{
|
||||
return $this->responseType;
|
||||
}
|
||||
|
||||
public function getMethodType(): ?MethodType
|
||||
{
|
||||
return $this->methodType;
|
||||
}
|
||||
|
||||
public function getOfflineKey(): ?string
|
||||
{
|
||||
return $this->offlineKey;
|
||||
}
|
||||
|
||||
public function getOfflineModel(): ?string
|
||||
{
|
||||
return $this->offlineModel;
|
||||
}
|
||||
|
||||
public function getOfflineResponseKey(): ?string
|
||||
{
|
||||
return $this->offlineResponseKey;
|
||||
}
|
||||
|
||||
public function isDeprecated(): bool
|
||||
{
|
||||
return $this->deprecated;
|
||||
}
|
||||
|
||||
public function isHidden(): bool|array
|
||||
{
|
||||
return $this->hide ?? false;
|
||||
}
|
||||
|
||||
public function isPackaging(): bool
|
||||
{
|
||||
return $this->packaging;
|
||||
}
|
||||
|
||||
public function getRequestType(): string
|
||||
{
|
||||
return $this->requestType;
|
||||
}
|
||||
|
||||
public function getParameters(): array
|
||||
{
|
||||
return $this->parameters;
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace Appwrite\Specification\Format;
|
||||
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\MethodType;
|
||||
use Appwrite\Specification\Format;
|
||||
use Appwrite\Template\Template;
|
||||
use Appwrite\Utopia\Response\Model;
|
||||
|
|
@ -120,32 +122,42 @@ class OpenAPI3 extends Format
|
|||
foreach ($this->routes as $route) {
|
||||
$url = \str_replace('/v1', '', $route->getPath());
|
||||
$scope = $route->getLabel('scope', '');
|
||||
$consumes = [$route->getLabel('sdk.request.type', 'application/json')];
|
||||
|
||||
$method = $route->getLabel('sdk.method', \uniqid());
|
||||
$sdk = $route->getLabel('sdk', false);
|
||||
|
||||
if (empty($sdk)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var \Appwrite\SDK\Method $sdk
|
||||
*/
|
||||
$consumes = [$sdk->getRequestType()];
|
||||
|
||||
$method = $sdk->getMethodName() ?? \uniqid();
|
||||
|
||||
if (!empty($method) && is_array($method)) {
|
||||
$method = array_keys($method)[0];
|
||||
}
|
||||
|
||||
$desc = (!empty($route->getLabel('sdk.description', ''))) ? \realpath(__DIR__ . '/../../../../' . $route->getLabel('sdk.description', '')) : null;
|
||||
$produces = $route->getLabel('sdk.response.type', null);
|
||||
$model = $route->getLabel('sdk.response.model', 'none');
|
||||
$routeSecurity = $route->getLabel('sdk.auth', []);
|
||||
$desc = (!empty($sdk->getDescription())) ? \realpath(__DIR__ . '/../../../../' . $sdk->getDescription()) : null;
|
||||
$produces = ($sdk->getResponseType())->value;
|
||||
$model = $sdk->getResponseModel() ?? 'none';
|
||||
$routeSecurity = $sdk->getAuth() ?? [];
|
||||
$sdkPlatforms = [];
|
||||
|
||||
foreach ($routeSecurity as $value) {
|
||||
switch ($value) {
|
||||
case APP_AUTH_TYPE_SESSION:
|
||||
case AuthType::SESSION:
|
||||
$sdkPlatforms[] = APP_PLATFORM_CLIENT;
|
||||
break;
|
||||
case APP_AUTH_TYPE_KEY:
|
||||
case AuthType::KEY:
|
||||
$sdkPlatforms[] = APP_PLATFORM_SERVER;
|
||||
break;
|
||||
case APP_AUTH_TYPE_JWT:
|
||||
case AuthType::JWT:
|
||||
$sdkPlatforms[] = APP_PLATFORM_SERVER;
|
||||
break;
|
||||
case APP_AUTH_TYPE_ADMIN:
|
||||
case AuthType::ADMIN:
|
||||
$sdkPlatforms[] = APP_PLATFORM_CONSOLE;
|
||||
break;
|
||||
}
|
||||
|
|
@ -156,34 +168,36 @@ class OpenAPI3 extends Format
|
|||
$sdkPlatforms[] = APP_PLATFORM_CLIENT;
|
||||
}
|
||||
|
||||
$namespace = $sdk->getNamespace() ?? 'default';
|
||||
|
||||
$temp = [
|
||||
'summary' => $route->getDesc(),
|
||||
'operationId' => $route->getLabel('sdk.namespace', 'default') . ucfirst($method),
|
||||
'tags' => [$route->getLabel('sdk.namespace', 'default')],
|
||||
'operationId' => $namespace . ucfirst($method),
|
||||
'tags' => [$namespace],
|
||||
'description' => ($desc) ? \file_get_contents($desc) : '',
|
||||
'responses' => [],
|
||||
'x-appwrite' => [ // Appwrite related metadata
|
||||
'method' => $method,
|
||||
'weight' => $route->getOrder(),
|
||||
'cookies' => $route->getLabel('sdk.cookies', false),
|
||||
'type' => $route->getLabel('sdk.methodType', ''),
|
||||
'deprecated' => $route->getLabel('sdk.deprecated', false),
|
||||
'demo' => Template::fromCamelCaseToDash($route->getLabel('sdk.namespace', 'default')) . '/' . Template::fromCamelCaseToDash($method) . '.md',
|
||||
'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $route->getLabel('sdk.description', ''),
|
||||
'type' => $sdk->getMethodType()->value ?? '',
|
||||
'deprecated' => $sdk->isDeprecated(),
|
||||
'demo' => Template::fromCamelCaseToDash($namespace) . '/' . Template::fromCamelCaseToDash($method) . '.md',
|
||||
'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $sdk->getDescription() ?? '',
|
||||
'rate-limit' => $route->getLabel('abuse-limit', 0),
|
||||
'rate-time' => $route->getLabel('abuse-time', 3600),
|
||||
'rate-key' => $route->getLabel('abuse-key', 'url:{url},ip:{ip}'),
|
||||
'scope' => $route->getLabel('scope', ''),
|
||||
'platforms' => $sdkPlatforms,
|
||||
'packaging' => $route->getLabel('sdk.packaging', false),
|
||||
'offline-model' => $route->getLabel('sdk.offline.model', ''),
|
||||
'offline-key' => $route->getLabel('sdk.offline.key', ''),
|
||||
'offline-response-key' => $route->getLabel('sdk.offline.response.key', '$id'),
|
||||
'packaging' => $sdk->isPackaging(),
|
||||
'offline-model' => $sdk->getOfflineModel() ?? '',
|
||||
'offline-key' => $sdk->getOfflineKey() ?? '',
|
||||
'offline-response-key' => $sdk->getOfflineResponseKey() ?? '$id',
|
||||
],
|
||||
];
|
||||
|
||||
if (is_array($route->getLabel('sdk.method', ''))) {
|
||||
$temp['x-appwrite']['multiplex'] = $route->getLabel('sdk.method', '');
|
||||
if (is_array($sdk->getMethodName() ?? '')) {
|
||||
$temp['x-appwrite']['multiplex'] = $sdk->getMethodName();
|
||||
}
|
||||
|
||||
foreach ($this->models as $value) {
|
||||
|
|
@ -198,7 +212,7 @@ class OpenAPI3 extends Format
|
|||
}
|
||||
|
||||
if (!(\is_array($model)) && $model->isNone()) {
|
||||
$temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [
|
||||
$temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [
|
||||
'description' => in_array($produces, [
|
||||
'image/*',
|
||||
'image/jpeg',
|
||||
|
|
@ -219,7 +233,7 @@ class OpenAPI3 extends Format
|
|||
$usedModels[] = $m->getType();
|
||||
}
|
||||
|
||||
$temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [
|
||||
$temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [
|
||||
'description' => $modelDescription,
|
||||
'content' => [
|
||||
$produces => [
|
||||
|
|
@ -232,7 +246,7 @@ class OpenAPI3 extends Format
|
|||
} else {
|
||||
// Response definition using one type
|
||||
$usedModels[] = $model->getType();
|
||||
$temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [
|
||||
$temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [
|
||||
'description' => $model->getName(),
|
||||
'content' => [
|
||||
$produces => [
|
||||
|
|
@ -245,17 +259,18 @@ class OpenAPI3 extends Format
|
|||
}
|
||||
}
|
||||
|
||||
if ($route->getLabel('sdk.response.code', 500) === 204) {
|
||||
$temp['responses'][(string)$route->getLabel('sdk.response.code', '500')]['description'] = 'No content';
|
||||
unset($temp['responses'][(string)$route->getLabel('sdk.response.code', '500')]['schema']);
|
||||
if (($sdk->getResponseCode() ?? 500) === 204) {
|
||||
$temp['responses'][(string)$sdk->getResponseCode() ?? '500']['description'] = 'No content';
|
||||
unset($temp['responses'][(string)$sdk->getResponseCode() ?? '500']['schema']);
|
||||
}
|
||||
|
||||
if ((!empty($scope))) { // && 'public' != $scope
|
||||
$securities = ['Project' => []];
|
||||
|
||||
foreach ($route->getLabel('sdk.auth', []) as $security) {
|
||||
if (array_key_exists($security, $this->keys)) {
|
||||
$securities[$security] = [];
|
||||
foreach ($sdk->getAuth() as $security) {
|
||||
/** @var \Appwrite\SDK\AuthType $security */
|
||||
if (array_key_exists($security->value, $this->keys)) {
|
||||
$securities[$security->value] = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -306,7 +321,7 @@ class OpenAPI3 extends Format
|
|||
$node['schema']['x-example'] = false;
|
||||
break;
|
||||
case 'Appwrite\Utopia\Database\Validator\CustomId':
|
||||
if ($route->getLabel('sdk.methodType', '') === 'upload') {
|
||||
if ($sdk->getMethodType() === MethodType::UPLOAD) {
|
||||
$node['schema']['x-upload-id'] = true;
|
||||
}
|
||||
$node['schema']['type'] = $validator->getType();
|
||||
|
|
@ -430,7 +445,7 @@ class OpenAPI3 extends Format
|
|||
$allowed = true;
|
||||
foreach ($this->enumBlacklist as $blacklist) {
|
||||
if (
|
||||
$blacklist['namespace'] == $route->getLabel('sdk.namespace', '')
|
||||
$blacklist['namespace'] == $sdk->getNamespace()
|
||||
&& $blacklist['method'] == $method
|
||||
&& $blacklist['parameter'] == $name
|
||||
) {
|
||||
|
|
@ -441,8 +456,8 @@ class OpenAPI3 extends Format
|
|||
|
||||
if ($allowed) {
|
||||
$node['schema']['enum'] = $validator->getList();
|
||||
$node['schema']['x-enum-name'] = $this->getEnumName($route->getLabel('sdk.namespace', ''), $method, $name);
|
||||
$node['schema']['x-enum-keys'] = $this->getEnumKeys($route->getLabel('sdk.namespace', ''), $method, $name);
|
||||
$node['schema']['x-enum-name'] = $this->getEnumName($sdk->getNamespace() ?? '', $method, $name);
|
||||
$node['schema']['x-enum-keys'] = $this->getEnumKeys($sdk->getNamespace() ?? '', $method, $name);
|
||||
}
|
||||
if ($validator->getType() === 'integer') {
|
||||
$node['format'] = 'int32';
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace Appwrite\Specification\Format;
|
||||
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\MethodType;
|
||||
use Appwrite\Specification\Format;
|
||||
use Appwrite\Template\Template;
|
||||
use Appwrite\Utopia\Response\Model;
|
||||
|
|
@ -118,32 +120,40 @@ class Swagger2 extends Format
|
|||
/** @var \Utopia\Route $route */
|
||||
$url = \str_replace('/v1', '', $route->getPath());
|
||||
$scope = $route->getLabel('scope', '');
|
||||
$consumes = [$route->getLabel('sdk.request.type', 'application/json')];
|
||||
|
||||
$method = $route->getLabel('sdk.method', \uniqid());
|
||||
/** @var \Appwrite\SDK\Method $sdk */
|
||||
$sdk = $route->getLabel('sdk', false);
|
||||
|
||||
if (empty($sdk)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$consumes = [$sdk->getRequestType()];
|
||||
|
||||
$method = $sdk->getMethodName() ?? \uniqid();
|
||||
|
||||
if (!empty($method) && is_array($method)) {
|
||||
$method = array_keys($method)[0];
|
||||
}
|
||||
|
||||
$desc = (!empty($route->getLabel('sdk.description', ''))) ? \realpath(__DIR__ . '/../../../../' . $route->getLabel('sdk.description', '')) : null;
|
||||
$produces = $route->getLabel('sdk.response.type', null);
|
||||
$model = $route->getLabel('sdk.response.model', 'none');
|
||||
$routeSecurity = $route->getLabel('sdk.auth', []);
|
||||
$desc = (!empty($sdk->getDescription())) ? \realpath(__DIR__ . '/../../../../' . $sdk->getDescription()) : null;
|
||||
$produces = ($sdk->getResponseType())->value;
|
||||
$model = $sdk->getResponseModel() ?? 'none';
|
||||
$routeSecurity = $sdk->getAuth() ?? [];
|
||||
$sdkPlatforms = [];
|
||||
|
||||
foreach ($routeSecurity as $value) {
|
||||
switch ($value) {
|
||||
case APP_AUTH_TYPE_SESSION:
|
||||
case AuthType::SESSION:
|
||||
$sdkPlatforms[] = APP_PLATFORM_CLIENT;
|
||||
break;
|
||||
case APP_AUTH_TYPE_KEY:
|
||||
case AuthType::KEY:
|
||||
$sdkPlatforms[] = APP_PLATFORM_SERVER;
|
||||
break;
|
||||
case APP_AUTH_TYPE_JWT:
|
||||
case AuthType::JWT:
|
||||
$sdkPlatforms[] = APP_PLATFORM_SERVER;
|
||||
break;
|
||||
case APP_AUTH_TYPE_ADMIN:
|
||||
case AuthType::ADMIN:
|
||||
$sdkPlatforms[] = APP_PLATFORM_CONSOLE;
|
||||
break;
|
||||
}
|
||||
|
|
@ -154,31 +164,33 @@ class Swagger2 extends Format
|
|||
$sdkPlatforms[] = APP_PLATFORM_CLIENT;
|
||||
}
|
||||
|
||||
$namespace = $sdk->getNamespace() ?? 'default';
|
||||
|
||||
$temp = [
|
||||
'summary' => $route->getDesc(),
|
||||
'operationId' => $route->getLabel('sdk.namespace', 'default') . ucfirst($method),
|
||||
'operationId' => $namespace . ucfirst($method),
|
||||
'consumes' => [],
|
||||
'produces' => [],
|
||||
'tags' => [$route->getLabel('sdk.namespace', 'default')],
|
||||
'tags' => [$namespace],
|
||||
'description' => ($desc) ? \file_get_contents($desc) : '',
|
||||
'responses' => [],
|
||||
'x-appwrite' => [ // Appwrite related metadata
|
||||
'method' => $method,
|
||||
'weight' => $route->getOrder(),
|
||||
'cookies' => $route->getLabel('sdk.cookies', false),
|
||||
'type' => $route->getLabel('sdk.methodType', ''),
|
||||
'deprecated' => $route->getLabel('sdk.deprecated', false),
|
||||
'demo' => Template::fromCamelCaseToDash($route->getLabel('sdk.namespace', 'default')) . '/' . Template::fromCamelCaseToDash($method) . '.md',
|
||||
'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $route->getLabel('sdk.description', ''),
|
||||
'type' => $sdk->getMethodType()->value ?? '',
|
||||
'deprecated' => $sdk->isDeprecated(),
|
||||
'demo' => Template::fromCamelCaseToDash($namespace) . '/' . Template::fromCamelCaseToDash($method) . '.md',
|
||||
'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $sdk->getDescription() ?? '',
|
||||
'rate-limit' => $route->getLabel('abuse-limit', 0),
|
||||
'rate-time' => $route->getLabel('abuse-time', 3600),
|
||||
'rate-key' => $route->getLabel('abuse-key', 'url:{url},ip:{ip}'),
|
||||
'scope' => $route->getLabel('scope', ''),
|
||||
'platforms' => $sdkPlatforms,
|
||||
'packaging' => $route->getLabel('sdk.packaging', false),
|
||||
'offline-model' => $route->getLabel('sdk.offline.model', ''),
|
||||
'offline-key' => $route->getLabel('sdk.offline.key', ''),
|
||||
'offline-response-key' => $route->getLabel('sdk.offline.response.key', '$id'),
|
||||
'packaging' => $sdk->isPackaging(),
|
||||
'offline-model' => $sdk->getOfflineModel() ?? '',
|
||||
'offline-key' => $sdk->getOfflineKey() ?? '',
|
||||
'offline-response-key' => $sdk->getOfflineResponseKey() ?? '$id',
|
||||
],
|
||||
];
|
||||
|
||||
|
|
@ -186,8 +198,8 @@ class Swagger2 extends Format
|
|||
$temp['produces'][] = $produces;
|
||||
}
|
||||
|
||||
if (is_array($route->getLabel('sdk.method', ''))) {
|
||||
$temp['x-appwrite']['multiplex'] = $route->getLabel('sdk.method', '');
|
||||
if (is_array($sdk->getMethodName() ?? '')) {
|
||||
$temp['x-appwrite']['multiplex'] = $sdk->getMethodName();
|
||||
}
|
||||
|
||||
foreach ($this->models as $value) {
|
||||
|
|
@ -202,7 +214,7 @@ class Swagger2 extends Format
|
|||
}
|
||||
|
||||
if (!(\is_array($model)) && $model->isNone()) {
|
||||
$temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [
|
||||
$temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [
|
||||
'description' => in_array($produces, [
|
||||
'image/*',
|
||||
'image/jpeg',
|
||||
|
|
@ -224,7 +236,7 @@ class Swagger2 extends Format
|
|||
foreach ($model as $m) {
|
||||
$usedModels[] = $m->getType();
|
||||
}
|
||||
$temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [
|
||||
$temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [
|
||||
'description' => $modelDescription,
|
||||
'schema' => [
|
||||
'x-oneOf' => \array_map(function ($m) {
|
||||
|
|
@ -235,7 +247,7 @@ class Swagger2 extends Format
|
|||
} else {
|
||||
// Response definition using one type
|
||||
$usedModels[] = $model->getType();
|
||||
$temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [
|
||||
$temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [
|
||||
'description' => $model->getName(),
|
||||
'schema' => [
|
||||
'$ref' => '#/definitions/' . $model->getType(),
|
||||
|
|
@ -244,17 +256,18 @@ class Swagger2 extends Format
|
|||
}
|
||||
}
|
||||
|
||||
if (in_array($route->getLabel('sdk.response.code', 500), [204, 301, 302, 308], true)) {
|
||||
$temp['responses'][(string)$route->getLabel('sdk.response.code', '500')]['description'] = 'No content';
|
||||
unset($temp['responses'][(string)$route->getLabel('sdk.response.code', '500')]['schema']);
|
||||
if (in_array($sdk->getResponseCode() ?? 500, [204, 301, 302, 308], true)) {
|
||||
$temp['responses'][(string)$sdk->getResponseCode() ?? '500']['description'] = 'No content';
|
||||
unset($temp['responses'][(string)$sdk->getResponseCode() ?? '500']['schema']);
|
||||
}
|
||||
|
||||
if ((!empty($scope))) { // && 'public' != $scope
|
||||
$securities = ['Project' => []];
|
||||
|
||||
foreach ($route->getLabel('sdk.auth', []) as $security) {
|
||||
if (array_key_exists($security, $this->keys)) {
|
||||
$securities[$security] = [];
|
||||
foreach ($sdk->getAuth() as $security) {
|
||||
/** @var \Appwrite\SDK\AuthType $security */
|
||||
if (array_key_exists($security->value, $this->keys)) {
|
||||
$securities[$security->value] = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -275,7 +288,7 @@ class Swagger2 extends Format
|
|||
|
||||
$parameters = \array_merge(
|
||||
$route->getParams(),
|
||||
$route->getLabel('sdk.parameters', []),
|
||||
$sdk->getParameters() ?? [],
|
||||
);
|
||||
|
||||
foreach ($parameters as $name => $param) { // Set params
|
||||
|
|
@ -325,7 +338,7 @@ class Swagger2 extends Format
|
|||
$node['x-example'] = false;
|
||||
break;
|
||||
case 'Appwrite\Utopia\Database\Validator\CustomId':
|
||||
if ($route->getLabel('sdk.methodType', '') === 'upload') {
|
||||
if ($sdk->getMethodType() === MethodType::UPLOAD) {
|
||||
$node['x-upload-id'] = true;
|
||||
}
|
||||
$node['type'] = $validator->getType();
|
||||
|
|
@ -432,7 +445,7 @@ class Swagger2 extends Format
|
|||
//Iterate the blackList. If it matches with the current one, then it is blackListed
|
||||
$allowed = true;
|
||||
foreach ($this->enumBlacklist as $blacklist) {
|
||||
if ($blacklist['namespace'] == $route->getLabel('sdk.namespace', '') && $blacklist['method'] == $method && $blacklist['parameter'] == $name) {
|
||||
if ($blacklist['namespace'] == $namespace && $blacklist['method'] == $method && $blacklist['parameter'] == $name) {
|
||||
$allowed = false;
|
||||
break;
|
||||
}
|
||||
|
|
@ -440,8 +453,8 @@ class Swagger2 extends Format
|
|||
|
||||
if ($allowed && $validator->getType() === 'string') {
|
||||
$node['enum'] = $validator->getList();
|
||||
$node['x-enum-name'] = $this->getEnumName($route->getLabel('sdk.namespace', ''), $method, $name);
|
||||
$node['x-enum-keys'] = $this->getEnumKeys($route->getLabel('sdk.namespace', ''), $method, $name);
|
||||
$node['x-enum-name'] = $this->getEnumName($namespace, $method, $name);
|
||||
$node['x-enum-keys'] = $this->getEnumKeys($namespace, $method, $name);
|
||||
}
|
||||
|
||||
if ($validator->getType() === 'integer') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue