1
0
Fork 0
mirror of synced 2024-06-30 04:00:34 +12:00

Merge branch '1.5.x' of https://github.com/appwrite/appwrite into feat-mailgun-provider

This commit is contained in:
Prateek Banga 2023-10-06 03:53:16 +05:30
commit d842191cc6
63 changed files with 524 additions and 407 deletions

View file

@ -1,9 +1,9 @@
name: "Build and Publish"
name: "Build and Publish Appwrite Images for Cloud"
on:
push:
tags:
- appwrite-*
- cl-*
jobs:
build-publish:
@ -16,7 +16,7 @@ jobs:
with:
fetch-depth: 2
submodules: recursive
ref: feat-db-pools-master
ref: master
- name: Login to Docker Hub
uses: docker/login-action@v2

2
.gitmodules vendored
View file

@ -1,4 +1,4 @@
[submodule "app/console"]
path = app/console
url = https://github.com/appwrite/console
branch = 3.0.4
branch = 3.1.1

View file

@ -1,3 +1,31 @@
# Version 1.4.3
## Features
- Support for the all new bun runtime [#6230](https://github.com/appwrite/appwrite/pull/6230)
- Stripe function templates [Console #540](https://github.com/appwrite/console/pull/540)
## Fixes
- Fix missing _APP_OPENSSL_KEY_V1 in the compose file [#6199](https://github.com/appwrite/appwrite/pull/6199)
- Fix V2 functions env vars [#6215](https://github.com/appwrite/appwrite/pull/6215)
- Fix Don't update User Accessed At for Users and Teams APIs [#6222](https://github.com/appwrite/appwrite/pull/6222)
- Fix Git deploys with S3 [#6227](https://github.com/appwrite/appwrite/pull/6227)
- Fix manual internal id insertion [#6232](https://github.com/appwrite/appwrite/pull/6232)
- Fix function timeout [#6235](https://github.com/appwrite/appwrite/pull/6235)
- Fix collections with datetime attributes migration [#17](https://github.com/utopia-php/migration/pull/17)
- Fix not all user data being migrated [#17](https://github.com/utopia-php/migration/pull/17)
- Fix team memberships migration [#16](https://github.com/utopia-php/migration/pull/16)
- Fix events validation on create/update webhooks [#6219](https://github.com/appwrite/appwrite/pull/6219)
- Fix schedules task [#6246](https://github.com/appwrite/appwrite/pull/6246)
- Fix missing keys when updating document via relationship [Database #320](https://github.com/utopia-php/database/pull/320)
- Fix Discord template [Console #538](https://github.com/appwrite/console/pull/538)
- Fix form var is url not text [Console #539](https://github.com/appwrite/console/pull/539)
- Fix incorrect link to migration docs for self-hosted to cloud [Console #543](https://github.com/appwrite/console/pull/543)
- Fix can't disable smtp [Console #548](https://github.com/appwrite/console/pull/548)
- Fix create function cover for case where VCS is not enabled [Console #544](https://github.com/appwrite/console/pull/544)
- Fix users list not re-rendering [Console #537](https://github.com/appwrite/console/pull/537)
- Fix create attribute modal null when selecting same time twice [Console #549](https://github.com/appwrite/console/pull/549)
- Fix runtime versions in templates [Console #546](https://github.com/appwrite/console/pull/546)
# Version 1.4.2
## Fixes

View file

@ -2,6 +2,11 @@
We would ❤️ you to contribute to Appwrite and help make it better! We want contributing to Appwrite to be fun, enjoyable, and educational for anyone and everyone. All contributions are welcome, including issues, and new docs, as well as updates and tweaks, blog posts, workshops, and more.
## Here for Hacktoberfest?
If you're here to contribute during Hacktoberfest, we're so happy to see you here. Appwrite has been a long-time participant of Hacktoberfest and we welcome you, whatever your experience level. This year, we're **only taking contributions for issues tagged** `hacktoberfest`, so we can focus our resources to support your contributions.
You can [find issues using this query](https://github.com/search?q=org%3Aappwrite+is%3Aopen+type%3Aissue+label%3Ahacktoberfest&type=issues).
## How to Start?
If you are worried or dont know where to start, check out the next section that explains what kind of help we could use and where you can get involved. You can send your questions to [@appwrite](https://twitter.com/appwrite) on Twitter or to anyone from the [Appwrite team on Discord](https://appwrite.io/discord). You can also submit an issue, and a maintainer can guide you!

View file

@ -37,99 +37,8 @@ ARG VERSION=dev
ARG DEBUG=false
ENV DEBUG=$DEBUG
ENV DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
ENV DOCKER_COMPOSE_VERSION=v2.5.0
ENV _APP_SERVER=swoole \
_APP_ENV=production \
_APP_LOCALE=en \
_APP_WORKER_PER_CORE= \
_APP_DOMAIN=localhost \
_APP_DOMAIN_FUNCTIONS=functions.localhost \
_APP_DOMAIN_TARGET=localhost \
_APP_HOME=https://appwrite.io \
_APP_EDITION=community \
_APP_CONSOLE_WHITELIST_ROOT=enabled \
_APP_CONSOLE_WHITELIST_EMAILS= \
_APP_CONSOLE_WHITELIST_IPS= \
_APP_SYSTEM_EMAIL_NAME= \
_APP_SYSTEM_EMAIL_ADDRESS= \
_APP_SYSTEM_RESPONSE_FORMAT= \
_APP_SYSTEM_SECURITY_EMAIL_ADDRESS= \
_APP_OPTIONS_ABUSE=enabled \
_APP_OPTIONS_FORCE_HTTPS=disabled \
_APP_OPENSSL_KEY_V1=your-secret-key \
_APP_STORAGE_LIMIT=10000000 \
_APP_STORAGE_ANTIVIRUS=enabled \
_APP_STORAGE_ANTIVIRUS_HOST=clamav \
_APP_STORAGE_ANTIVIRUS_PORT=3310 \
_APP_STORAGE_DEVICE=Local \
_APP_STORAGE_S3_ACCESS_KEY= \
_APP_STORAGE_S3_SECRET= \
_APP_STORAGE_S3_REGION= \
_APP_STORAGE_S3_BUCKET= \
_APP_STORAGE_DO_SPACES_ACCESS_KEY= \
_APP_STORAGE_DO_SPACES_SECRET= \
_APP_STORAGE_DO_SPACES_REGION= \
_APP_STORAGE_DO_SPACES_BUCKET= \
_APP_STORAGE_BACKBLAZE_ACCESS_KEY= \
_APP_STORAGE_BACKBLAZE_SECRET= \
_APP_STORAGE_BACKBLAZE_REGION= \
_APP_STORAGE_BACKBLAZE_BUCKET= \
_APP_STORAGE_LINODE_ACCESS_KEY= \
_APP_STORAGE_LINODE_SECRET= \
_APP_STORAGE_LINODE_REGION= \
_APP_STORAGE_LINODE_BUCKET= \
_APP_STORAGE_WASABI_ACCESS_KEY= \
_APP_STORAGE_WASABI_SECRET= \
_APP_STORAGE_WASABI_REGION= \
_APP_STORAGE_WASABI_BUCKET= \
_APP_REDIS_HOST=redis \
_APP_REDIS_PORT=6379 \
_APP_DB_HOST=mariadb \
_APP_DB_PORT=3306 \
_APP_DB_USER=root \
_APP_DB_PASS=password \
_APP_DB_SCHEMA=appwrite \
_APP_INFLUXDB_HOST=influxdb \
_APP_INFLUXDB_PORT=8086 \
_APP_STATSD_HOST=telegraf \
_APP_STATSD_PORT=8125 \
_APP_SMTP_HOST= \
_APP_SMTP_PORT= \
_APP_SMTP_SECURE= \
_APP_SMTP_USERNAME= \
_APP_SMTP_PASSWORD= \
_APP_SMS_PROVIDER= \
_APP_SMS_FROM= \
_APP_FUNCTIONS_SIZE_LIMIT=30000000 \
_APP_FUNCTIONS_TIMEOUT=900 \
_APP_FUNCTIONS_CONTAINERS=10 \
_APP_FUNCTIONS_CPUS=1 \
_APP_FUNCTIONS_MEMORY=128 \
_APP_FUNCTIONS_MEMORY_SWAP=128 \
_APP_EXECUTOR_SECRET=a-random-secret \
_APP_EXECUTOR_HOST=http://appwrite-executor/v1 \
_APP_EXECUTOR_RUNTIME_NETWORK=appwrite_runtimes \
_APP_SETUP=self-hosted \
_APP_VERSION=$VERSION \
_APP_USAGE_STATS=enabled \
_APP_USAGE_AGGREGATION_INTERVAL=30 \
# 14 Days = 1209600 s
_APP_MAINTENANCE_RETENTION_EXECUTION=1209600 \
_APP_MAINTENANCE_RETENTION_AUDIT=1209600 \
# 1 Day = 86400 s
_APP_MAINTENANCE_RETENTION_ABUSE=86400 \
_APP_MAINTENANCE_RETENTION_USAGE_HOURLY=8640000 \
_APP_MAINTENANCE_INTERVAL=86400 \
_APP_LOGGING_PROVIDER= \
_APP_LOGGING_CONFIG= \
_APP_VCS_GITHUB_APP_NAME= \
_APP_VCS_GITHUB_PRIVATE_KEY= \
_APP_VCS_GITHUB_APP_ID= \
_APP_VCS_GITHUB_CLIENT_ID= \
_APP_VCS_GITHUB_CLIENT_SECRET= \
_APP_VCS_GITHUB_WEBHOOK_SECRET=
ENV _APP_VERSION=$VERSION \
_APP_HOME=https://appwrite.io
RUN \
if [ "$DEBUG" == "true" ]; then \

View file

@ -66,7 +66,7 @@ docker run -it --rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
--entrypoint="install" \
appwrite/appwrite:1.4.2
appwrite/appwrite:1.4.3
```
### Windows
@ -78,7 +78,7 @@ docker run -it --rm ^
--volume //var/run/docker.sock:/var/run/docker.sock ^
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
--entrypoint="install" ^
appwrite/appwrite:1.4.2
appwrite/appwrite:1.4.3
```
#### PowerShell
@ -88,7 +88,7 @@ docker run -it --rm `
--volume /var/run/docker.sock:/var/run/docker.sock `
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw `
--entrypoint="install" `
appwrite/appwrite:1.4.2
appwrite/appwrite:1.4.3
```
运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。
@ -113,14 +113,14 @@ docker run -it --rm `
### 软件服务
* [**帐户**](https://appwrite.io/docs/client/account) -管理当前用户的帐户和登录方式。跟踪和管理用户 Session登录设备登录方法和查看相关记录。
* [**帐户**](https://appwrite.io/docs/references/cloud/client-web/account) -管理当前用户的帐户和登录方式。跟踪和管理用户 Session登录设备登录方法和查看相关记录。
* [**用户**](https://appwrite.io/docs/server/users) - 在以管理员模式登录时管理和列出所有用户。
* [**团队**](https://appwrite.io/docs/client/teams) - 管理用户分组。邀请成员,管理团队中的用户权限和用户角色。
* [**数据库**](https://appwrite.io/docs/client/databases) - 管理数据库文档和文档集。用检索界面来对文档和文档集进行读取,创建,更新,和删除。
* [**贮存**](https://appwrite.io/docs/client/storage) - 管理文件的阅读、创建、删除和预览。设置文件的预览来满足程序的个性化需求。所有文件都由 ClamAV 扫描并安全存储和加密。
* [**团队**](https://appwrite.io/docs/references/cloud/client-web/teams) - 管理用户分组。邀请成员,管理团队中的用户权限和用户角色。
* [**数据库**](https://appwrite.io/docs/references/cloud/client-web/databases) - 管理数据库文档和文档集。用检索界面来对文档和文档集进行读取,创建,更新,和删除。
* [**贮存**](https://appwrite.io/docs/references/cloud/client-web/storage) - 管理文件的阅读、创建、删除和预览。设置文件的预览来满足程序的个性化需求。所有文件都由 ClamAV 扫描并安全存储和加密。
* [**云函数**](https://appwrite.io/docs/server/functions) - 在安全隔离的环境中运行自定义代码。这些代码可以被事件CRON或者手动操作触发。
* [**语言适配**](https://appwrite.io/docs/client/locale) - 根据用户所在的的国家和地区做出合适的语言适配。
* [**头像**](https://appwrite.io/docs/client/avatars) -管理用户头像、国家旗帜、浏览器图标、信用卡符号,和生成二维码。
* [**语言适配**](https://appwrite.io/docs/references/cloud/client-web/locale) - 根据用户所在的的国家和地区做出合适的语言适配。
* [**头像**](https://appwrite.io/docs/references/cloud/client-web/avatars) -管理用户头像、国家旗帜、浏览器图标、信用卡符号,和生成二维码。
如需完整的 API 界面文档,请访问 [https://appwrite.io/docs](https://appwrite.io/docs)。如需更多教程、新闻和公告,请订阅我们的 [博客](https://medium.com/appwrite-io) 和 加入我们的[Discord 社区](https://discord.gg/GSeTUeA)。
### 开发套件

View file

@ -2,7 +2,8 @@
<br />
<p align="center">
<a href="https://appwrite.io" target="_blank"><img width="260" height="39" src="https://appwrite.io/images/appwrite.svg" alt="Appwrite Logo"></a>
<a href="https://appwrite.io" target="_blank"><img src="./public/images/banner.png" alt="Appwrite Logo"></a>
<br />
<br />
<b>Appwrite is a backend platform for developing Web, Mobile, and Flutter applications. Built with the open source community and optimized for developer experience in the coding languages you love.</b>
<br />
@ -75,7 +76,7 @@ docker run -it --rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
--entrypoint="install" \
appwrite/appwrite:1.4.2
appwrite/appwrite:1.4.3
```
### Windows
@ -87,7 +88,7 @@ docker run -it --rm ^
--volume //var/run/docker.sock:/var/run/docker.sock ^
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
--entrypoint="install" ^
appwrite/appwrite:1.4.2
appwrite/appwrite:1.4.3
```
#### PowerShell
@ -97,7 +98,7 @@ docker run -it --rm `
--volume /var/run/docker.sock:/var/run/docker.sock `
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw `
--entrypoint="install" `
appwrite/appwrite:1.4.2
appwrite/appwrite:1.4.3
```
Once the Docker installation is complete, go to http://localhost to access the Appwrite console from your browser. Please note that on non-Linux native hosts, the server might take a few minutes to start after completing the installation.
@ -150,15 +151,15 @@ Getting started with Appwrite is as easy as creating a new project, choosing you
### Services
- [**Account**](https://appwrite.io/docs/client/account) - Manage current user authentication and account. Track and manage the user sessions, devices, sign-in methods, and security logs.
- [**Account**](https://appwrite.io/docs/references/cloud/client-web/account) - Manage current user authentication and account. Track and manage the user sessions, devices, sign-in methods, and security logs.
- [**Users**](https://appwrite.io/docs/server/users) - Manage and list all project users when building backend integrations with Server SDKs.
- [**Teams**](https://appwrite.io/docs/client/teams) - Manage and group users in teams. Manage memberships, invites, and user roles within a team.
- [**Databases**](https://appwrite.io/docs/client/databases) - Manage databases, collections, and documents. Read, create, update, and delete documents and filter lists of document collections using advanced filters.
- [**Storage**](https://appwrite.io/docs/client/storage) - Manage storage files. Read, create, delete, and preview files. Manipulate the preview of your files to perfectly fit your app. All files are scanned by ClamAV and stored in a secure and encrypted way.
- [**Teams**](https://appwrite.io/docs/references/cloud/client-web/teams) - Manage and group users in teams. Manage memberships, invites, and user roles within a team.
- [**Databases**](https://appwrite.io/docs/references/cloud/client-web/databases) - Manage databases, collections, and documents. Read, create, update, and delete documents and filter lists of document collections using advanced filters.
- [**Storage**](https://appwrite.io/docs/references/cloud/client-web/storage) - Manage storage files. Read, create, delete, and preview files. Manipulate the preview of your files to perfectly fit your app. All files are scanned by ClamAV and stored in a secure and encrypted way.
- [**Functions**](https://appwrite.io/docs/server/functions) - Customize your Appwrite server by executing your custom code in a secure, isolated environment. You can trigger your code on any Appwrite system event either manually or using a CRON schedule.
- [**Realtime**](https://appwrite.io/docs/realtime) - Listen to real-time events for any of your Appwrite services including users, storage, functions, databases, and more.
- [**Locale**](https://appwrite.io/docs/client/locale) - Track your user's location and manage your app locale-based data.
- [**Avatars**](https://appwrite.io/docs/client/avatars) - Manage your users' avatars, countries' flags, browser icons, and credit card symbols. Generate QR codes from links or plaintext strings.
- [**Locale**](https://appwrite.io/docs/references/cloud/client-web/locale) - Track your user's location and manage your app locale-based data.
- [**Avatars**](https://appwrite.io/docs/references/cloud/client-web/avatars) - Manage your users' avatars, countries' flags, browser icons, and credit card symbols. Generate QR codes from links or plaintext strings.
For the complete API documentation, visit [https://appwrite.io/docs](https://appwrite.io/docs). For more tutorials, news and announcements check out our [blog](https://medium.com/appwrite-io) and [Discord Server](https://discord.gg/GSeTUeA).

View file

@ -81,7 +81,7 @@ return [
[
'key' => 'apple',
'name' => 'Apple',
'version' => '4.0.0',
'version' => '4.0.1',
'url' => 'https://github.com/appwrite/sdk-for-apple',
'package' => 'https://github.com/appwrite/sdk-for-apple',
'enabled' => true,
@ -203,7 +203,7 @@ return [
[
'key' => 'cli',
'name' => 'Command Line',
'version' => '4.0.0',
'version' => '4.1.0',
'url' => 'https://github.com/appwrite/sdk-for-cli',
'package' => 'https://www.npmjs.com/package/appwrite-cli',
'enabled' => true,
@ -415,7 +415,7 @@ return [
[
'key' => 'swift',
'name' => 'Swift',
'version' => '4.0.0',
'version' => '4.0.1',
'url' => 'https://github.com/appwrite/sdk-for-swift',
'package' => 'https://github.com/appwrite/sdk-for-swift',
'enabled' => true,

View file

@ -65,7 +65,7 @@ return [
'name' => '_APP_DOMAIN_FUNCTIONS',
'description' => 'A domain to use for function preview URLs. Setting to empty turns off function preview URLs.',
'introduction' => '',
'default' => '',
'default' => 'functions.localhost',
'required' => false,
'question' => '',
'filter' => ''
@ -846,10 +846,11 @@ return [
],
[
'name' => '_APP_FUNCTIONS_MAINTENANCE_INTERVAL',
'description' => 'Interval how often executor checks for inactive runimes. The default value is 60 seconds.',
'introduction' => '1.2.0',
'default' => '60',
'description' => 'Interval value containing the number of seconds that the executor should wait before checking for inactive runtimes. The default value is 3600 seconds (1 hour).',
'introduction' => '1.4.0',
'default' => '3600',
'required' => false,
'overwrite' => true,
'question' => '',
'filter' => ''
],

@ -1 +1 @@
Subproject commit e07f0379f4124a202772bcd4bd38a3c8e2662eea
Subproject commit 9b4bcb8140484669421685b4ba89fa1c4d331360

View file

@ -50,7 +50,7 @@ $oauthDefaultSuccess = '/auth/oauth2/success';
$oauthDefaultFailure = '/auth/oauth2/failure';
App::post('/v1/account')
->desc('Create Account')
->desc('Create account')
->groups(['api', 'account', 'auth'])
->label('event', 'users.[userId].create')
->label('scope', 'public')
@ -165,7 +165,7 @@ App::post('/v1/account')
App::post('/v1/account/sessions/email')
->alias('/v1/account/sessions')
->desc('Create Email Session')
->desc('Create email session')
->groups(['api', 'account', 'auth', 'session'])
->label('event', 'users.[userId].sessions.[sessionId].create')
->label('scope', 'public')
@ -285,7 +285,7 @@ App::post('/v1/account/sessions/email')
});
App::get('/v1/account/sessions/oauth2/:provider')
->desc('Create OAuth2 Session')
->desc('Create OAuth2 session')
->groups(['api', 'account'])
->label('error', __DIR__ . '/../../views/general/error.phtml')
->label('scope', 'public')
@ -351,7 +351,7 @@ App::get('/v1/account/sessions/oauth2/:provider')
});
App::get('/v1/account/sessions/oauth2/callback/:provider/:projectId')
->desc('OAuth2 Callback')
->desc('OAuth2 callback')
->groups(['account'])
->label('error', __DIR__ . '/../../views/general/error.phtml')
->label('scope', 'public')
@ -383,7 +383,7 @@ App::get('/v1/account/sessions/oauth2/callback/:provider/:projectId')
});
App::post('/v1/account/sessions/oauth2/callback/:provider/:projectId')
->desc('OAuth2 Callback')
->desc('OAuth2 callback')
->groups(['account'])
->label('error', __DIR__ . '/../../views/general/error.phtml')
->label('scope', 'public')
@ -416,7 +416,7 @@ App::post('/v1/account/sessions/oauth2/callback/:provider/:projectId')
});
App::get('/v1/account/sessions/oauth2/:provider/redirect')
->desc('OAuth2 Redirect')
->desc('OAuth2 redirect')
->groups(['api', 'account', 'session'])
->label('error', __DIR__ . '/../../views/general/error.phtml')
->label('event', 'users.[userId].sessions.[sessionId].create')
@ -872,7 +872,7 @@ App::delete('/v1/account/identities/:identityId')
});
App::post('/v1/account/sessions/magic-url')
->desc('Create Magic URL session')
->desc('Create magic URL session')
->groups(['api', 'account'])
->label('scope', 'public')
->label('auth.type', 'magic-url')
@ -1090,7 +1090,7 @@ App::post('/v1/account/sessions/magic-url')
});
App::put('/v1/account/sessions/magic-url')
->desc('Create Magic URL session (confirmation)')
->desc('Create magic URL session (confirmation)')
->groups(['api', 'account', 'session'])
->label('scope', 'public')
->label('event', 'users.[userId].sessions.[sessionId].create')
@ -1212,7 +1212,7 @@ App::put('/v1/account/sessions/magic-url')
});
App::post('/v1/account/sessions/phone')
->desc('Create Phone session')
->desc('Create phone session')
->groups(['api', 'account'])
->label('scope', 'public')
->label('auth.type', 'phone')
@ -1376,7 +1376,7 @@ App::post('/v1/account/sessions/phone')
});
App::put('/v1/account/sessions/phone')
->desc('Create Phone Session (confirmation)')
->desc('Create phone session (confirmation)')
->groups(['api', 'account', 'session'])
->label('scope', 'public')
->label('event', 'users.[userId].sessions.[sessionId].create')
@ -1492,7 +1492,7 @@ App::put('/v1/account/sessions/phone')
});
App::post('/v1/account/sessions/anonymous')
->desc('Create Anonymous Session')
->desc('Create anonymous session')
->groups(['api', 'account', 'auth', 'session'])
->label('event', 'users.[userId].sessions.[sessionId].create')
->label('scope', 'public')
@ -1676,7 +1676,7 @@ App::post('/v1/account/jwt')
});
App::get('/v1/account')
->desc('Get Account')
->desc('Get account')
->groups(['api', 'account'])
->label('scope', 'account')
->label('usage.metric', 'users.{scope}.requests.read')
@ -1697,7 +1697,7 @@ App::get('/v1/account')
});
App::get('/v1/account/prefs')
->desc('Get Account Preferences')
->desc('Get account preferences')
->groups(['api', 'account'])
->label('scope', 'account')
->label('usage.metric', 'users.{scope}.requests.read')
@ -1720,7 +1720,7 @@ App::get('/v1/account/prefs')
});
App::get('/v1/account/sessions')
->desc('List Sessions')
->desc('List sessions')
->groups(['api', 'account'])
->label('scope', 'account')
->label('usage.metric', 'users.{scope}.requests.read')
@ -1759,7 +1759,7 @@ App::get('/v1/account/sessions')
});
App::get('/v1/account/logs')
->desc('List Logs')
->desc('List logs')
->groups(['api', 'account'])
->label('scope', 'account')
->label('usage.metric', 'users.{scope}.requests.read')
@ -1820,7 +1820,7 @@ App::get('/v1/account/logs')
});
App::get('/v1/account/sessions/:sessionId')
->desc('Get Session')
->desc('Get session')
->groups(['api', 'account'])
->label('scope', 'account')
->label('usage.metric', 'users.{scope}.requests.read')
@ -1865,7 +1865,7 @@ App::get('/v1/account/sessions/:sessionId')
});
App::patch('/v1/account/name')
->desc('Update Name')
->desc('Update name')
->groups(['api', 'account'])
->label('event', 'users.[userId].update.name')
->label('scope', 'account')
@ -1899,7 +1899,7 @@ App::patch('/v1/account/name')
});
App::patch('/v1/account/password')
->desc('Update Password')
->desc('Update password')
->groups(['api', 'account'])
->label('event', 'users.[userId].update.password')
->label('scope', 'account')
@ -1966,7 +1966,7 @@ App::patch('/v1/account/password')
});
App::patch('/v1/account/email')
->desc('Update Email')
->desc('Update email')
->groups(['api', 'account'])
->label('event', 'users.[userId].update.email')
->label('scope', 'account')
@ -2036,7 +2036,7 @@ App::patch('/v1/account/email')
});
App::patch('/v1/account/phone')
->desc('Update Phone')
->desc('Update phone')
->groups(['api', 'account'])
->label('event', 'users.[userId].update.phone')
->label('scope', 'account')
@ -2095,7 +2095,7 @@ App::patch('/v1/account/phone')
});
App::patch('/v1/account/prefs')
->desc('Update Preferences')
->desc('Update preferences')
->groups(['api', 'account'])
->label('event', 'users.[userId].update.prefs')
->label('scope', 'account')
@ -2129,7 +2129,7 @@ App::patch('/v1/account/prefs')
});
App::patch('/v1/account/status')
->desc('Update Status')
->desc('Update status')
->groups(['api', 'account'])
->label('event', 'users.[userId].update.status')
->label('scope', 'account')
@ -2173,7 +2173,7 @@ App::patch('/v1/account/status')
});
App::delete('/v1/account/sessions/:sessionId')
->desc('Delete Session')
->desc('Delete session')
->groups(['api', 'account'])
->label('scope', 'account')
->label('event', 'users.[userId].sessions.[sessionId].delete')
@ -2249,7 +2249,7 @@ App::delete('/v1/account/sessions/:sessionId')
});
App::patch('/v1/account/sessions/:sessionId')
->desc('Update OAuth Session (Refresh Tokens)')
->desc('Update OAuth session (refresh tokens)')
->groups(['api', 'account'])
->label('scope', 'account')
->label('event', 'users.[userId].sessions.[sessionId].update')
@ -2335,7 +2335,7 @@ App::patch('/v1/account/sessions/:sessionId')
});
App::delete('/v1/account/sessions')
->desc('Delete Sessions')
->desc('Delete sessions')
->groups(['api', 'account'])
->label('scope', 'account')
->label('event', 'users.[userId].sessions.[sessionId].delete')
@ -2396,7 +2396,7 @@ App::delete('/v1/account/sessions')
});
App::post('/v1/account/recovery')
->desc('Create Password Recovery')
->desc('Create password recovery')
->groups(['api', 'account'])
->label('scope', 'public')
->label('event', 'users.[userId].recovery.[tokenId].create')
@ -2579,7 +2579,7 @@ App::post('/v1/account/recovery')
});
App::put('/v1/account/recovery')
->desc('Create Password Recovery (confirmation)')
->desc('Create password recovery (confirmation)')
->groups(['api', 'account'])
->label('scope', 'public')
->label('event', 'users.[userId].recovery.[tokenId].update')
@ -2667,7 +2667,7 @@ App::put('/v1/account/recovery')
});
App::post('/v1/account/verification')
->desc('Create Email Verification')
->desc('Create email verification')
->groups(['api', 'account'])
->label('scope', 'account')
->label('event', 'users.[userId].verification.[tokenId].create')
@ -2828,7 +2828,7 @@ App::post('/v1/account/verification')
});
App::put('/v1/account/verification')
->desc('Create Email Verification (confirmation)')
->desc('Create email verification (confirmation)')
->groups(['api', 'account'])
->label('scope', 'public')
->label('event', 'users.[userId].verification.[tokenId].update')
@ -2889,7 +2889,7 @@ App::put('/v1/account/verification')
});
App::post('/v1/account/verification/phone')
->desc('Create Phone Verification')
->desc('Create phone verification')
->groups(['api', 'account'])
->label('scope', 'account')
->label('event', 'users.[userId].verification.[tokenId].create')
@ -3012,7 +3012,7 @@ App::post('/v1/account/verification/phone')
});
App::put('/v1/account/verification/phone')
->desc('Create Phone Verification (confirmation)')
->desc('Create phone verification (confirmation)')
->groups(['api', 'account'])
->label('scope', 'public')
->label('event', 'users.[userId].verification.[tokenId].update')

View file

@ -191,7 +191,7 @@ $getUserGitHub = function (string $userId, Document $project, Database $dbForPro
};
App::get('/v1/avatars/credit-cards/:code')
->desc('Get Credit Card Icon')
->desc('Get credit card icon')
->groups(['api', 'avatars'])
->label('scope', 'avatars.read')
->label('cache', true)
@ -211,7 +211,7 @@ App::get('/v1/avatars/credit-cards/:code')
->action(fn (string $code, int $width, int $height, int $quality, Response $response) => $avatarCallback('credit-cards', $code, $width, $height, $quality, $response));
App::get('/v1/avatars/browsers/:code')
->desc('Get Browser Icon')
->desc('Get browser icon')
->groups(['api', 'avatars'])
->label('scope', 'avatars.read')
->label('cache', true)
@ -231,7 +231,7 @@ App::get('/v1/avatars/browsers/:code')
->action(fn (string $code, int $width, int $height, int $quality, Response $response) => $avatarCallback('browsers', $code, $width, $height, $quality, $response));
App::get('/v1/avatars/flags/:code')
->desc('Get Country Flag')
->desc('Get country flag')
->groups(['api', 'avatars'])
->label('scope', 'avatars.read')
->label('cache', true)
@ -251,7 +251,7 @@ App::get('/v1/avatars/flags/:code')
->action(fn (string $code, int $width, int $height, int $quality, Response $response) => $avatarCallback('flags', $code, $width, $height, $quality, $response));
App::get('/v1/avatars/image')
->desc('Get Image from URL')
->desc('Get image from URL')
->groups(['api', 'avatars'])
->label('scope', 'avatars.read')
->label('cache', true)
@ -307,7 +307,7 @@ App::get('/v1/avatars/image')
});
App::get('/v1/avatars/favicon')
->desc('Get Favicon')
->desc('Get favicon')
->groups(['api', 'avatars'])
->label('scope', 'avatars.read')
->label('cache', true)
@ -449,7 +449,7 @@ App::get('/v1/avatars/favicon')
});
App::get('/v1/avatars/qr')
->desc('Get QR Code')
->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])
@ -489,7 +489,7 @@ App::get('/v1/avatars/qr')
});
App::get('/v1/avatars/initials')
->desc('Get User Initials')
->desc('Get user initials')
->groups(['api', 'avatars'])
->label('scope', 'avatars.read')
->label('cache.resource', 'avatar/initials')

View file

@ -17,7 +17,7 @@ App::init()
App::get('/v1/console/variables')
->desc('Get Variables')
->desc('Get variables')
->groups(['api', 'projects'])
->label('scope', 'projects.read')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])

View file

@ -371,7 +371,7 @@ function updateAttribute(
}
App::post('/v1/databases')
->desc('Create Database')
->desc('Create database')
->groups(['api', 'database'])
->label('event', 'databases.[databaseId].create')
->label('scope', 'databases.write')
@ -448,7 +448,7 @@ App::post('/v1/databases')
});
App::get('/v1/databases')
->desc('List Databases')
->desc('List databases')
->groups(['api', 'database'])
->label('scope', 'databases.read')
->label('usage.metric', 'databases.{scope}.requests.read')
@ -496,7 +496,7 @@ App::get('/v1/databases')
});
App::get('/v1/databases/:databaseId')
->desc('Get Database')
->desc('Get database')
->groups(['api', 'database'])
->label('scope', 'databases.read')
->label('usage.metric', 'databases.{scope}.requests.read')
@ -522,7 +522,7 @@ App::get('/v1/databases/:databaseId')
});
App::get('/v1/databases/:databaseId/logs')
->desc('List Database Logs')
->desc('List database logs')
->groups(['api', 'database'])
->label('scope', 'databases.read')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -608,7 +608,7 @@ App::get('/v1/databases/:databaseId/logs')
App::put('/v1/databases/:databaseId')
->desc('Update Database')
->desc('Update database')
->groups(['api', 'database', 'schema'])
->label('scope', 'databases.write')
->label('event', 'databases.[databaseId].update')
@ -653,7 +653,7 @@ App::put('/v1/databases/:databaseId')
});
App::delete('/v1/databases/:databaseId')
->desc('Delete Database')
->desc('Delete database')
->groups(['api', 'database', 'schema'])
->label('scope', 'databases.write')
->label('event', 'databases.[databaseId].delete')
@ -698,7 +698,7 @@ App::delete('/v1/databases/:databaseId')
});
App::post('/v1/databases/:databaseId/collections')
->desc('Create Collection')
->desc('Create collection')
->groups(['api', 'database'])
->label('event', 'databases.[databaseId].collections.[collectionId].create')
->label('scope', 'collections.write')
@ -768,7 +768,7 @@ App::post('/v1/databases/:databaseId/collections')
App::get('/v1/databases/:databaseId/collections')
->alias('/v1/database/collections', ['databaseId' => 'default'])
->desc('List Collections')
->desc('List collections')
->groups(['api', 'database'])
->label('scope', 'collections.read')
->label('usage.metric', 'collections.{scope}.requests.read')
@ -827,7 +827,7 @@ App::get('/v1/databases/:databaseId/collections')
App::get('/v1/databases/:databaseId/collections/:collectionId')
->alias('/v1/database/collections/:collectionId', ['databaseId' => 'default'])
->desc('Get Collection')
->desc('Get collection')
->groups(['api', 'database'])
->label('scope', 'collections.read')
->label('usage.metric', 'collections.{scope}.requests.read')
@ -863,7 +863,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId')
App::get('/v1/databases/:databaseId/collections/:collectionId/logs')
->alias('/v1/database/collections/:collectionId/logs', ['databaseId' => 'default'])
->desc('List Collection Logs')
->desc('List collection logs')
->groups(['api', 'database'])
->label('scope', 'collections.read')
->label('usage.metric', 'collections.{scope}.requests.read')
@ -959,7 +959,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/logs')
App::put('/v1/databases/:databaseId/collections/:collectionId')
->alias('/v1/database/collections/:collectionId', ['databaseId' => 'default'])
->desc('Update Collection')
->desc('Update collection')
->groups(['api', 'database', 'schema'])
->label('scope', 'collections.write')
->label('event', 'databases.[databaseId].collections.[collectionId].update')
@ -1029,7 +1029,7 @@ App::put('/v1/databases/:databaseId/collections/:collectionId')
App::delete('/v1/databases/:databaseId/collections/:collectionId')
->alias('/v1/database/collections/:collectionId', ['databaseId' => 'default'])
->desc('Delete Collection')
->desc('Delete collection')
->groups(['api', 'database', 'schema'])
->label('scope', 'collections.write')
->label('event', 'databases.[databaseId].collections.[collectionId].delete')
@ -1085,7 +1085,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId')
App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/string')
->alias('/v1/database/collections/:collectionId/attributes/string', ['databaseId' => 'default'])
->desc('Create String Attribute')
->desc('Create string attribute')
->groups(['api', 'database', 'schema'])
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create')
->label('scope', 'collections.write')
@ -1143,7 +1143,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/string
App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/email')
->alias('/v1/database/collections/:collectionId/attributes/email', ['databaseId' => 'default'])
->desc('Create Email Attribute')
->desc('Create email attribute')
->groups(['api', 'database', 'schema'])
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create')
->label('scope', 'collections.write')
@ -1187,7 +1187,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/email'
App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/enum')
->alias('/v1/database/collections/:collectionId/attributes/enum', ['databaseId' => 'default'])
->desc('Create Enum Attribute')
->desc('Create enum attribute')
->groups(['api', 'database', 'schema'])
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create')
->label('scope', 'collections.write')
@ -1247,7 +1247,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/enum')
App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/ip')
->alias('/v1/database/collections/:collectionId/attributes/ip', ['databaseId' => 'default'])
->desc('Create IP Address Attribute')
->desc('Create IP address attribute')
->groups(['api', 'database', 'schema'])
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create')
->label('scope', 'collections.write')
@ -1291,7 +1291,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/ip')
App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/url')
->alias('/v1/database/collections/:collectionId/attributes/url', ['databaseId' => 'default'])
->desc('Create URL Attribute')
->desc('Create URL attribute')
->groups(['api', 'database', 'schema'])
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create')
->label('scope', 'collections.write')
@ -1335,7 +1335,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/url')
App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/integer')
->alias('/v1/database/collections/:collectionId/attributes/integer', ['databaseId' => 'default'])
->desc('Create Integer Attribute')
->desc('Create integer attribute')
->groups(['api', 'database', 'schema'])
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create')
->label('scope', 'collections.write')
@ -1408,7 +1408,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/intege
App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/float')
->alias('/v1/database/collections/:collectionId/attributes/float', ['databaseId' => 'default'])
->desc('Create Float Attribute')
->desc('Create float attribute')
->groups(['api', 'database', 'schema'])
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create')
->label('scope', 'collections.write')
@ -1484,7 +1484,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/float'
App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/boolean')
->alias('/v1/database/collections/:collectionId/attributes/boolean', ['databaseId' => 'default'])
->desc('Create Boolean Attribute')
->desc('Create boolean attribute')
->groups(['api', 'database', 'schema'])
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create')
->label('scope', 'collections.write')
@ -1527,7 +1527,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/boolea
App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/datetime')
->alias('/v1/database/collections/:collectionId/attributes/datetime', ['databaseId' => 'default'])
->desc('Create DateTime Attribute')
->desc('Create datetime attribute')
->groups(['api', 'database'])
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create')
->label('scope', 'collections.write')
@ -1573,7 +1573,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/dateti
App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/relationship')
->alias('/v1/database/collections/:collectionId/attributes/relationship', ['databaseId' => 'default'])
->desc('Create Relationship Attribute')
->desc('Create relationship attribute')
->groups(['api', 'database'])
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create')
->label('scope', 'collections.write')
@ -1655,7 +1655,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/relati
App::get('/v1/databases/:databaseId/collections/:collectionId/attributes')
->alias('/v1/database/collections/:collectionId/attributes', ['databaseId' => 'default'])
->desc('List Attributes')
->desc('List attributes')
->groups(['api', 'database'])
->label('scope', 'collections.read')
->label('usage.metric', 'collections.{scope}.requests.read')
@ -1730,7 +1730,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes')
App::get('/v1/databases/:databaseId/collections/:collectionId/attributes/:key')
->alias('/v1/database/collections/:collectionId/attributes/:key', ['databaseId' => 'default'])
->desc('Get Attribute')
->desc('Get attribute')
->groups(['api', 'database'])
->label('scope', 'collections.read')
->label('usage.metric', 'collections.{scope}.requests.read')
@ -1806,7 +1806,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes/:key')
});
App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/string/:key')
->desc('Update String Attribute')
->desc('Update string attribute')
->groups(['api', 'database', 'schema'])
->label('scope', 'collections.write')
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update')
@ -1847,7 +1847,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/strin
});
App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/email/:key')
->desc('Update Email Attribute')
->desc('Update email attribute')
->groups(['api', 'database', 'schema'])
->label('scope', 'collections.write')
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update')
@ -1888,7 +1888,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/email
});
App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/enum/:key')
->desc('Update Enum Attribute')
->desc('Update enum attribute')
->groups(['api', 'database', 'schema'])
->label('scope', 'collections.write')
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update')
@ -1931,7 +1931,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/enum/
});
App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/ip/:key')
->desc('Update IP Address Attribute')
->desc('Update IP address attribute')
->groups(['api', 'database', 'schema'])
->label('scope', 'collections.write')
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update')
@ -1972,7 +1972,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/ip/:k
});
App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/url/:key')
->desc('Update URL Attribute')
->desc('Update URL attribute')
->groups(['api', 'database', 'schema'])
->label('scope', 'collections.write')
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update')
@ -2013,7 +2013,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/url/:
});
App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/integer/:key')
->desc('Update Integer Attribute')
->desc('Update integer attribute')
->groups(['api', 'database', 'schema'])
->label('scope', 'collections.write')
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update')
@ -2064,7 +2064,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/integ
});
App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/float/:key')
->desc('Update Float Attribute')
->desc('Update float attribute')
->groups(['api', 'database', 'schema'])
->label('scope', 'collections.write')
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update')
@ -2115,7 +2115,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/float
});
App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/boolean/:key')
->desc('Update Boolean Attribute')
->desc('Update boolean attribute')
->groups(['api', 'database', 'schema'])
->label('scope', 'collections.write')
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update')
@ -2155,7 +2155,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/boole
});
App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/datetime/:key')
->desc('Update DateTime Attribute')
->desc('Update dateTime attribute')
->groups(['api', 'database', 'schema'])
->label('scope', 'collections.write')
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update')
@ -2195,7 +2195,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/datet
});
App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/:key/relationship')
->desc('Update Relationship Attribute')
->desc('Update relationship attribute')
->groups(['api', 'database', 'schema'])
->label('scope', 'collections.write')
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update')
@ -2251,7 +2251,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/:key/
App::delete('/v1/databases/:databaseId/collections/:collectionId/attributes/:key')
->alias('/v1/database/collections/:collectionId/attributes/:key', ['databaseId' => 'default'])
->desc('Delete Attribute')
->desc('Delete attribute')
->groups(['api', 'database', 'schema'])
->label('scope', 'collections.write')
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].delete')
@ -2362,7 +2362,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/attributes/:key
App::post('/v1/databases/:databaseId/collections/:collectionId/indexes')
->alias('/v1/database/collections/:collectionId/indexes', ['databaseId' => 'default'])
->desc('Create Index')
->desc('Create index')
->groups(['api', 'database'])
->label('event', 'databases.[databaseId].collections.[collectionId].indexes.[indexId].create')
->label('scope', 'collections.write')
@ -2522,7 +2522,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes')
App::get('/v1/databases/:databaseId/collections/:collectionId/indexes')
->alias('/v1/database/collections/:collectionId/indexes', ['databaseId' => 'default'])
->desc('List Indexes')
->desc('List indexes')
->groups(['api', 'database'])
->label('scope', 'collections.read')
->label('usage.metric', 'collections.{scope}.requests.read')
@ -2587,7 +2587,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes')
App::get('/v1/databases/:databaseId/collections/:collectionId/indexes/:key')
->alias('/v1/database/collections/:collectionId/indexes/:key', ['databaseId' => 'default'])
->desc('Get Index')
->desc('Get index')
->groups(['api', 'database'])
->label('scope', 'collections.read')
->label('usage.metric', 'collections.{scope}.requests.read')
@ -2628,7 +2628,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes/:key')
App::delete('/v1/databases/:databaseId/collections/:collectionId/indexes/:key')
->alias('/v1/database/collections/:collectionId/indexes/:key', ['databaseId' => 'default'])
->desc('Delete Index')
->desc('Delete index')
->groups(['api', 'database'])
->label('scope', 'collections.write')
->label('event', 'databases.[databaseId].collections.[collectionId].indexes.[indexId].delete')
@ -2694,7 +2694,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/indexes/:key')
App::post('/v1/databases/:databaseId/collections/:collectionId/documents')
->alias('/v1/database/collections/:collectionId/documents', ['databaseId' => 'default'])
->desc('Create Document')
->desc('Create document')
->groups(['api', 'database'])
->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].create')
->label('scope', 'documents.write')
@ -2934,7 +2934,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents')
App::get('/v1/databases/:databaseId/collections/:collectionId/documents')
->alias('/v1/database/collections/:collectionId/documents', ['databaseId' => 'default'])
->desc('List Documents')
->desc('List documents')
->groups(['api', 'database'])
->label('scope', 'documents.read')
->label('usage.metric', 'documents.{scope}.requests.read')
@ -3061,7 +3061,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents')
App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId')
->alias('/v1/database/collections/:collectionId/documents/:documentId', ['databaseId' => 'default'])
->desc('Get Document')
->desc('Get document')
->groups(['api', 'database'])
->label('scope', 'documents.read')
->label('usage.metric', 'documents.{scope}.requests.read')
@ -3156,7 +3156,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen
App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId/logs')
->alias('/v1/database/collections/:collectionId/documents/:documentId/logs', ['databaseId' => 'default'])
->desc('List Document Logs')
->desc('List document logs')
->groups(['api', 'database'])
->label('scope', 'documents.read')
->label('usage.metric', 'documents.{scope}.requests.read')
@ -3257,7 +3257,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen
App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId')
->alias('/v1/database/collections/:collectionId/documents/:documentId', ['databaseId' => 'default'])
->desc('Update Document')
->desc('Update document')
->groups(['api', 'database'])
->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].update')
->label('scope', 'documents.write')
@ -3486,7 +3486,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum
App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId')
->alias('/v1/database/collections/:collectionId/documents/:documentId', ['databaseId' => 'default'])
->desc('Delete Document')
->desc('Delete document')
->groups(['api', 'database'])
->label('scope', 'documents.write')
->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].delete')

View file

@ -7,7 +7,7 @@ use Appwrite\Event\Delete;
use Appwrite\Event\Event;
use Appwrite\Event\Func;
use Appwrite\Event\Usage;
use Appwrite\Event\Validator\Event as ValidatorEvent;
use Appwrite\Event\Validator\FunctionEvent;
use Appwrite\Utopia\Response\Model\Rule;
use Appwrite\Extend\Exception;
use Appwrite\Utopia\Database\Validator\CustomId;
@ -120,7 +120,7 @@ $redeployVcs = function (Request $request, Document $function, Document $project
App::post('/v1/functions')
->groups(['api', 'functions'])
->desc('Create Function')
->desc('Create function')
->label('scope', 'functions.write')
->label('event', 'functions.[functionId].create')
->label('audits.event', 'function.create')
@ -136,7 +136,7 @@ App::post('/v1/functions')
->param('name', '', new Text(128), 'Function name. Max length: 128 chars.')
->param('runtime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Execution runtime.')
->param('execute', [], new Roles(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 64 characters long.', true)
->param('events', [], new ArrayList(new ValidatorEvent(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Events list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.', true)
->param('events', [], new ArrayList(new FunctionEvent(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Events list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.', true)
->param('schedule', '', new Cron(), 'Schedule CRON syntax.', true)
->param('timeout', 15, new Range(1, (int) App::getEnv('_APP_FUNCTIONS_TIMEOUT', 900)), 'Function maximum execution time in seconds.', true)
->param('enabled', true, new Boolean(), 'Is function enabled? When set to \'disabled\', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.', true)
@ -334,7 +334,7 @@ App::post('/v1/functions')
App::get('/v1/functions')
->groups(['api', 'functions'])
->desc('List Functions')
->desc('List functions')
->label('scope', 'functions.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
->label('sdk.namespace', 'functions')
@ -409,7 +409,7 @@ App::get('/v1/functions/runtimes')
App::get('/v1/functions/:functionId')
->groups(['api', 'functions'])
->desc('Get Function')
->desc('Get function')
->label('scope', 'functions.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
->label('sdk.namespace', 'functions')
@ -432,7 +432,7 @@ App::get('/v1/functions/:functionId')
});
App::get('/v1/functions/:functionId/usage')
->desc('Get Function Usage')
->desc('Get function usage')
->groups(['api', 'functions', 'usage'])
->label('scope', 'functions.read')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -542,7 +542,7 @@ App::get('/v1/functions/:functionId/usage')
});
App::get('/v1/functions/usage')
->desc('Get Functions Usage')
->desc('Get functions usage')
->groups(['api', 'functions', 'usage'])
->label('scope', 'functions.read')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -646,7 +646,7 @@ App::get('/v1/functions/usage')
App::put('/v1/functions/:functionId')
->groups(['api', 'functions'])
->desc('Update Function')
->desc('Update function')
->label('scope', 'functions.write')
->label('event', 'functions.[functionId].update')
->label('audits.event', 'function.update')
@ -662,7 +662,7 @@ App::put('/v1/functions/:functionId')
->param('name', '', new Text(128), 'Function name. Max length: 128 chars.')
->param('runtime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Execution runtime.', true)
->param('execute', [], new Roles(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 64 characters long.', true)
->param('events', [], new ArrayList(new ValidatorEvent(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Events list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.', true)
->param('events', [], new ArrayList(new FunctionEvent(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Events list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.', true)
->param('schedule', '', new Cron(), 'Schedule CRON syntax.', true)
->param('timeout', 15, new Range(1, (int) App::getEnv('_APP_FUNCTIONS_TIMEOUT', 900)), 'Maximum execution time in seconds.', true)
->param('enabled', true, new Boolean(), 'Is function enabled? When set to \'disabled\', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.', true)
@ -911,7 +911,7 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId/download')
App::patch('/v1/functions/:functionId/deployments/:deploymentId')
->groups(['api', 'functions'])
->desc('Update Function Deployment')
->desc('Update function deployment')
->label('scope', 'functions.write')
->label('event', 'functions.[functionId].deployments.[deploymentId].update')
->label('audits.event', 'deployment.update')
@ -973,7 +973,7 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId')
App::delete('/v1/functions/:functionId')
->groups(['api', 'functions'])
->desc('Delete Function')
->desc('Delete function')
->label('scope', 'functions.write')
->label('event', 'functions.[functionId].delete')
->label('audits.event', 'function.delete')
@ -1020,7 +1020,7 @@ App::delete('/v1/functions/:functionId')
App::post('/v1/functions/:functionId/deployments')
->groups(['api', 'functions'])
->desc('Create Deployment')
->desc('Create deployment')
->label('scope', 'functions.write')
->label('event', 'functions.[functionId].deployments.[deploymentId].create')
->label('audits.event', 'deployment.create')
@ -1239,7 +1239,7 @@ App::post('/v1/functions/:functionId/deployments')
App::get('/v1/functions/:functionId/deployments')
->groups(['api', 'functions'])
->desc('List Deployments')
->desc('List deployments')
->label('scope', 'functions.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
->label('sdk.namespace', 'functions')
@ -1309,7 +1309,7 @@ App::get('/v1/functions/:functionId/deployments')
App::get('/v1/functions/:functionId/deployments/:deploymentId')
->groups(['api', 'functions'])
->desc('Get Deployment')
->desc('Get deployment')
->label('scope', 'functions.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
->label('sdk.namespace', 'functions')
@ -1351,7 +1351,7 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId')
App::delete('/v1/functions/:functionId/deployments/:deploymentId')
->groups(['api', 'functions'])
->desc('Delete Deployment')
->desc('Delete deployment')
->label('scope', 'functions.write')
->label('event', 'functions.[functionId].deployments.[deploymentId].delete')
->label('audits.event', 'deployment.delete')
@ -1415,7 +1415,7 @@ App::delete('/v1/functions/:functionId/deployments/:deploymentId')
App::post('/v1/functions/:functionId/deployments/:deploymentId/builds/:buildId')
->groups(['api', 'functions'])
->desc('Create Build')
->desc('Create build')
->label('scope', 'functions.write')
->label('event', 'functions.[functionId].deployments.[deploymentId].update')
->label('audits.event', 'deployment.update')
@ -1484,7 +1484,7 @@ App::post('/v1/functions/:functionId/deployments/:deploymentId/builds/:buildId')
App::post('/v1/functions/:functionId/executions')
->groups(['api', 'functions'])
->desc('Create Execution')
->desc('Create execution')
->label('scope', 'execution.write')
->label('event', 'functions.[functionId].executions.[executionId].create')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
@ -1773,7 +1773,7 @@ App::post('/v1/functions/:functionId/executions')
App::get('/v1/functions/:functionId/executions')
->groups(['api', 'functions'])
->desc('List Executions')
->desc('List executions')
->label('scope', 'execution.read')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'functions')
@ -1848,7 +1848,7 @@ App::get('/v1/functions/:functionId/executions')
App::get('/v1/functions/:functionId/executions/:executionId')
->groups(['api', 'functions'])
->desc('Get Execution')
->desc('Get execution')
->label('scope', 'execution.read')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'functions')
@ -1896,7 +1896,7 @@ App::get('/v1/functions/:functionId/executions/:executionId')
// Variables
App::post('/v1/functions/:functionId/variables')
->desc('Create Variable')
->desc('Create variable')
->groups(['api', 'functions'])
->label('scope', 'functions.write')
->label('audits.event', 'variable.create')
@ -1960,7 +1960,7 @@ App::post('/v1/functions/:functionId/variables')
});
App::get('/v1/functions/:functionId/variables')
->desc('List Variables')
->desc('List variables')
->groups(['api', 'functions'])
->label('scope', 'functions.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
@ -1987,7 +1987,7 @@ App::get('/v1/functions/:functionId/variables')
});
App::get('/v1/functions/:functionId/variables/:variableId')
->desc('Get Variable')
->desc('Get variable')
->groups(['api', 'functions'])
->label('scope', 'functions.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
@ -2026,7 +2026,7 @@ App::get('/v1/functions/:functionId/variables/:variableId')
});
App::put('/v1/functions/:functionId/variables/:variableId')
->desc('Update Variable')
->desc('Update variable')
->groups(['api', 'functions'])
->label('scope', 'functions.write')
->label('audits.event', 'variable.update')
@ -2087,7 +2087,7 @@ App::put('/v1/functions/:functionId/variables/:variableId')
});
App::delete('/v1/functions/:functionId/variables/:variableId')
->desc('Delete Variable')
->desc('Delete variable')
->groups(['api', 'functions'])
->label('scope', 'functions.write')
->label('audits.event', 'variable.delete')

View file

@ -18,7 +18,7 @@ use Utopia\Validator\JSON;
use Utopia\Validator\Text;
App::get('/v1/graphql')
->desc('GraphQL Endpoint')
->desc('GraphQL endpoint')
->groups(['graphql'])
->label('scope', 'graphql')
->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
@ -58,7 +58,7 @@ App::get('/v1/graphql')
});
App::post('/v1/graphql/mutation')
->desc('GraphQL Endpoint')
->desc('GraphQL endpoint')
->groups(['graphql'])
->label('scope', 'graphql')
->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
@ -103,7 +103,7 @@ App::post('/v1/graphql/mutation')
});
App::post('/v1/graphql')
->desc('GraphQL Endpoint')
->desc('GraphQL endpoint')
->groups(['graphql'])
->label('scope', 'graphql')
->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])

View file

@ -39,7 +39,7 @@ App::get('/v1/health')
});
App::get('/v1/health/version')
->desc('Get Version')
->desc('Get version')
->groups(['api', 'health'])
->label('scope', 'public')
->label('sdk.response.code', Response::STATUS_CODE_OK)
@ -109,7 +109,7 @@ App::get('/v1/health/db')
});
App::get('/v1/health/cache')
->desc('Get Cache')
->desc('Get cache')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
@ -280,7 +280,7 @@ App::get('/v1/health/pubsub')
});
App::get('/v1/health/time')
->desc('Get Time')
->desc('Get time')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
@ -337,7 +337,7 @@ App::get('/v1/health/time')
});
App::get('/v1/health/queue/webhooks')
->desc('Get Webhooks Queue')
->desc('Get webhooks queue')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
@ -354,7 +354,7 @@ App::get('/v1/health/queue/webhooks')
}, ['response']);
App::get('/v1/health/queue/logs')
->desc('Get Logs Queue')
->desc('Get logs queue')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
@ -371,7 +371,7 @@ App::get('/v1/health/queue/logs')
}, ['response']);
App::get('/v1/health/queue/certificates')
->desc('Get Certificates Queue')
->desc('Get certificates queue')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
@ -388,7 +388,7 @@ App::get('/v1/health/queue/certificates')
}, ['response']);
App::get('/v1/health/queue/functions')
->desc('Get Functions Queue')
->desc('Get functions queue')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
@ -406,7 +406,7 @@ App::get('/v1/health/queue/functions')
}, ['response']);
App::get('/v1/health/storage/local')
->desc('Get Local Storage')
->desc('Get local storage')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
@ -449,7 +449,7 @@ App::get('/v1/health/storage/local')
});
App::get('/v1/health/anti-virus')
->desc('Get Antivirus')
->desc('Get antivirus')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
@ -488,7 +488,7 @@ App::get('/v1/health/anti-virus')
});
App::get('/v1/health/stats') // Currently only used internally
->desc('Get System Stats')
->desc('Get system stats')
->groups(['api', 'health'])
->label('scope', 'root')
// ->label('sdk.auth', [APP_AUTH_TYPE_KEY])

View file

@ -9,7 +9,7 @@ use Utopia\Database\Document;
use Utopia\Locale\Locale;
App::get('/v1/locale')
->desc('Get User 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])
@ -91,7 +91,7 @@ App::get('/v1/locale/codes')
});
App::get('/v1/locale/countries')
->desc('List 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])
@ -124,7 +124,7 @@ App::get('/v1/locale/countries')
});
App::get('/v1/locale/countries/eu')
->desc('List EU Countries')
->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])
@ -159,7 +159,7 @@ App::get('/v1/locale/countries/eu')
});
App::get('/v1/locale/countries/phones')
->desc('List Countries Phone Codes')
->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])
@ -193,7 +193,7 @@ App::get('/v1/locale/countries/phones')
});
App::get('/v1/locale/continents')
->desc('List 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])
@ -225,7 +225,7 @@ App::get('/v1/locale/continents')
});
App::get('/v1/locale/currencies')
->desc('List 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])
@ -248,7 +248,7 @@ App::get('/v1/locale/currencies')
App::get('/v1/locale/languages')
->desc('List 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])

View file

@ -49,7 +49,7 @@ App::init()
});
App::post('/v1/projects')
->desc('Create Project')
->desc('Create project')
->groups(['api', 'projects'])
->label('scope', 'projects.write')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -220,7 +220,7 @@ App::post('/v1/projects')
});
App::get('/v1/projects')
->desc('List Projects')
->desc('List projects')
->groups(['api', 'projects'])
->label('scope', 'projects.read')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -267,7 +267,7 @@ App::get('/v1/projects')
});
App::get('/v1/projects/:projectId')
->desc('Get Project')
->desc('Get project')
->groups(['api', 'projects'])
->label('scope', 'projects.read')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -405,7 +405,7 @@ App::get('/v1/projects/:projectId/usage')
});
App::patch('/v1/projects/:projectId')
->desc('Update Project')
->desc('Update project')
->groups(['api', 'projects'])
->label('scope', 'projects.write')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -557,7 +557,7 @@ App::patch('/v1/projects/:projectId/service/all')
});
App::patch('/v1/projects/:projectId/oauth2')
->desc('Update Project OAuth2')
->desc('Update project OAuth2')
->groups(['api', 'projects'])
->label('scope', 'projects.write')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -601,7 +601,7 @@ App::patch('/v1/projects/:projectId/oauth2')
});
App::patch('/v1/projects/:projectId/auth/limit')
->desc('Update Project users limit')
->desc('Update project users limit')
->groups(['api', 'projects'])
->label('scope', 'projects.write')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -632,7 +632,7 @@ App::patch('/v1/projects/:projectId/auth/limit')
});
App::patch('/v1/projects/:projectId/auth/duration')
->desc('Update Project Authentication Duration')
->desc('Update project authentication duration')
->groups(['api', 'projects'])
->label('scope', 'projects.write')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -663,7 +663,7 @@ App::patch('/v1/projects/:projectId/auth/duration')
});
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.')
->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])
@ -790,7 +790,7 @@ App::patch('/v1/projects/:projectId/auth/personal-data')
});
App::patch('/v1/projects/:projectId/auth/max-sessions')
->desc('Update Project user sessions limit')
->desc('Update project user sessions limit')
->groups(['api', 'projects'])
->label('scope', 'projects.write')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -821,7 +821,7 @@ App::patch('/v1/projects/:projectId/auth/max-sessions')
});
App::delete('/v1/projects/:projectId')
->desc('Delete Project')
->desc('Delete project')
->groups(['api', 'projects'])
->label('scope', 'projects.write')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -855,7 +855,7 @@ App::delete('/v1/projects/:projectId')
// Webhooks
App::post('/v1/projects/:projectId/webhooks')
->desc('Create Webhook')
->desc('Create webhook')
->groups(['api', 'projects'])
->label('scope', 'projects.write')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -911,7 +911,7 @@ App::post('/v1/projects/:projectId/webhooks')
});
App::get('/v1/projects/:projectId/webhooks')
->desc('List Webhooks')
->desc('List webhooks')
->groups(['api', 'projects'])
->label('scope', 'projects.read')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -943,7 +943,7 @@ App::get('/v1/projects/:projectId/webhooks')
});
App::get('/v1/projects/:projectId/webhooks/:webhookId')
->desc('Get Webhook')
->desc('Get webhook')
->groups(['api', 'projects'])
->label('scope', 'projects.read')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -977,7 +977,7 @@ App::get('/v1/projects/:projectId/webhooks/:webhookId')
});
App::put('/v1/projects/:projectId/webhooks/:webhookId')
->desc('Update Webhook')
->desc('Update webhook')
->groups(['api', 'projects'])
->label('scope', 'projects.write')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -1030,7 +1030,7 @@ App::put('/v1/projects/:projectId/webhooks/:webhookId')
});
App::patch('/v1/projects/:projectId/webhooks/:webhookId/signature')
->desc('Update Webhook Signature Key')
->desc('Update webhook signature key')
->groups(['api', 'projects'])
->label('scope', 'projects.write')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -1069,7 +1069,7 @@ App::patch('/v1/projects/:projectId/webhooks/:webhookId/signature')
});
App::delete('/v1/projects/:projectId/webhooks/:webhookId')
->desc('Delete Webhook')
->desc('Delete webhook')
->groups(['api', 'projects'])
->label('scope', 'projects.write')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -1108,7 +1108,7 @@ App::delete('/v1/projects/:projectId/webhooks/:webhookId')
// Keys
App::post('/v1/projects/:projectId/keys')
->desc('Create Key')
->desc('Create key')
->groups(['api', 'projects'])
->label('scope', 'projects.write')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -1158,7 +1158,7 @@ App::post('/v1/projects/:projectId/keys')
});
App::get('/v1/projects/:projectId/keys')
->desc('List Keys')
->desc('List keys')
->groups(['api', 'projects'])
->label('scope', 'projects.read')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -1190,7 +1190,7 @@ App::get('/v1/projects/:projectId/keys')
});
App::get('/v1/projects/:projectId/keys/:keyId')
->desc('Get Key')
->desc('Get key')
->groups(['api', 'projects'])
->label('scope', 'projects.read')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -1224,7 +1224,7 @@ App::get('/v1/projects/:projectId/keys/:keyId')
});
App::put('/v1/projects/:projectId/keys/:keyId')
->desc('Update Key')
->desc('Update key')
->groups(['api', 'projects'])
->label('scope', 'projects.write')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -1270,7 +1270,7 @@ App::put('/v1/projects/:projectId/keys/:keyId')
});
App::delete('/v1/projects/:projectId/keys/:keyId')
->desc('Delete Key')
->desc('Delete key')
->groups(['api', 'projects'])
->label('scope', 'projects.write')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -1309,7 +1309,7 @@ App::delete('/v1/projects/:projectId/keys/:keyId')
// Platforms
App::post('/v1/projects/:projectId/platforms')
->desc('Create Platform')
->desc('Create platform')
->groups(['api', 'projects'])
->label('scope', 'projects.write')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -1359,7 +1359,7 @@ App::post('/v1/projects/:projectId/platforms')
});
App::get('/v1/projects/:projectId/platforms')
->desc('List Platforms')
->desc('List platforms')
->groups(['api', 'projects'])
->label('scope', 'projects.read')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -1391,7 +1391,7 @@ App::get('/v1/projects/:projectId/platforms')
});
App::get('/v1/projects/:projectId/platforms/:platformId')
->desc('Get Platform')
->desc('Get platform')
->groups(['api', 'projects'])
->label('scope', 'projects.read')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -1425,7 +1425,7 @@ App::get('/v1/projects/:projectId/platforms/:platformId')
});
App::put('/v1/projects/:projectId/platforms/:platformId')
->desc('Update Platform')
->desc('Update platform')
->groups(['api', 'projects'])
->label('scope', 'projects.write')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -1472,7 +1472,7 @@ App::put('/v1/projects/:projectId/platforms/:platformId')
});
App::delete('/v1/projects/:projectId/platforms/:platformId')
->desc('Delete Platform')
->desc('Delete platform')
->groups(['api', 'projects'])
->label('scope', 'projects.write')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@ -1508,6 +1508,7 @@ App::delete('/v1/projects/:projectId/platforms/:platformId')
$response->noContent();
});
// CUSTOM SMTP and Templates
App::patch('/v1/projects/:projectId/smtp')
->desc('Update SMTP configuration')
@ -1639,6 +1640,7 @@ App::get('/v1/projects/:projectId/templates/sms/:type/:locale')
$response->dynamic(new Document($template), Response::MODEL_SMS_TEMPLATE);
});
App::get('/v1/projects/:projectId/templates/email/:type/:locale')
->desc('Get custom email template')
->groups(['api', 'projects'])

View file

@ -194,7 +194,7 @@ App::get('/v1/storage/buckets')
});
App::get('/v1/storage/buckets/:bucketId')
->desc('Get Bucket')
->desc('Get bucket')
->groups(['api', 'storage'])
->label('scope', 'buckets.read')
->label('usage.metric', 'buckets.{scope}.requests.read')
@ -220,7 +220,7 @@ App::get('/v1/storage/buckets/:bucketId')
});
App::put('/v1/storage/buckets/:bucketId')
->desc('Update Bucket')
->desc('Update bucket')
->groups(['api', 'storage'])
->label('scope', 'buckets.write')
->label('event', 'buckets.[bucketId].update')
@ -288,7 +288,7 @@ App::put('/v1/storage/buckets/:bucketId')
});
App::delete('/v1/storage/buckets/:bucketId')
->desc('Delete Bucket')
->desc('Delete bucket')
->groups(['api', 'storage'])
->label('scope', 'buckets.write')
->label('audits.event', 'bucket.delete')
@ -331,7 +331,7 @@ App::delete('/v1/storage/buckets/:bucketId')
App::post('/v1/storage/buckets/:bucketId/files')
->alias('/v1/storage/files', ['bucketId' => 'default'])
->desc('Create File')
->desc('Create file')
->groups(['api', 'storage'])
->label('scope', 'files.write')
->label('audits.event', 'file.create')
@ -684,7 +684,7 @@ App::post('/v1/storage/buckets/:bucketId/files')
App::get('/v1/storage/buckets/:bucketId/files')
->alias('/v1/storage/files', ['bucketId' => 'default'])
->desc('List Files')
->desc('List files')
->groups(['api', 'storage'])
->label('scope', 'files.read')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
@ -765,7 +765,7 @@ App::get('/v1/storage/buckets/:bucketId/files')
App::get('/v1/storage/buckets/:bucketId/files/:fileId')
->alias('/v1/storage/files/:fileId', ['bucketId' => 'default'])
->desc('Get File')
->desc('Get file')
->groups(['api', 'storage'])
->label('scope', 'files.read')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
@ -814,7 +814,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId')
App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
->alias('/v1/storage/files/:fileId/preview', ['bucketId' => 'default'])
->desc('Get File Preview')
->desc('Get file preview')
->groups(['api', 'storage'])
->label('scope', 'files.read')
->label('cache', true)
@ -983,7 +983,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
App::get('/v1/storage/buckets/:bucketId/files/:fileId/download')
->alias('/v1/storage/files/:fileId/download', ['bucketId' => 'default'])
->desc('Get File for Download')
->desc('Get file for download')
->groups(['api', 'storage'])
->label('scope', 'files.read')
->label('usage.metric', 'files.{scope}.requests.read')
@ -1126,7 +1126,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download')
App::get('/v1/storage/buckets/:bucketId/files/:fileId/view')
->alias('/v1/storage/files/:fileId/view', ['bucketId' => 'default'])
->desc('Get File for View')
->desc('Get file for view')
->groups(['api', 'storage'])
->label('scope', 'files.read')
->label('usage.metric', 'files.{scope}.requests.read')
@ -1279,7 +1279,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view')
App::put('/v1/storage/buckets/:bucketId/files/:fileId')
->alias('/v1/storage/files/:fileId', ['bucketId' => 'default'])
->desc('Update File')
->desc('Update file')
->groups(['api', 'storage'])
->label('scope', 'files.write')
->label('event', 'buckets.[bucketId].files.[fileId].update')

View file

@ -41,7 +41,7 @@ use Utopia\Validator\Assoc;
use Utopia\Validator\Text;
App::post('/v1/teams')
->desc('Create Team')
->desc('Create team')
->groups(['api', 'teams'])
->label('event', 'teams.[teamId].create')
->label('scope', 'teams.write')
@ -129,7 +129,7 @@ App::post('/v1/teams')
});
App::get('/v1/teams')
->desc('List 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])
@ -181,7 +181,7 @@ App::get('/v1/teams')
});
App::get('/v1/teams/:teamId')
->desc('Get Team')
->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])
@ -208,7 +208,7 @@ App::get('/v1/teams/:teamId')
});
App::get('/v1/teams/:teamId/prefs')
->desc('Get Team Preferences')
->desc('Get team preferences')
->groups(['api', 'teams'])
->label('scope', 'teams.read')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
@ -236,7 +236,7 @@ App::get('/v1/teams/:teamId/prefs')
});
App::put('/v1/teams/:teamId')
->desc('Update Name')
->desc('Update name')
->groups(['api', 'teams'])
->label('event', 'teams.[teamId].update')
->label('scope', 'teams.write')
@ -279,7 +279,7 @@ App::put('/v1/teams/:teamId')
});
App::put('/v1/teams/:teamId/prefs')
->desc('Update Preferences')
->desc('Update preferences')
->groups(['api', 'teams'])
->label('event', 'teams.[teamId].update.prefs')
->label('scope', 'teams.write')
@ -315,7 +315,7 @@ App::put('/v1/teams/:teamId/prefs')
});
App::delete('/v1/teams/:teamId')
->desc('Delete Team')
->desc('Delete team')
->groups(['api', 'teams'])
->label('event', 'teams.[teamId].delete')
->label('scope', 'teams.write')
@ -357,7 +357,7 @@ App::delete('/v1/teams/:teamId')
});
App::post('/v1/teams/:teamId/memberships')
->desc('Create Team Membership')
->desc('Create team membership')
->groups(['api', 'teams', 'auth'])
->label('event', 'teams.[teamId].memberships.[membershipId].create')
->label('scope', 'teams.write')
@ -696,7 +696,7 @@ App::post('/v1/teams/:teamId/memberships')
});
App::get('/v1/teams/:teamId/memberships')
->desc('List Team 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])
@ -780,7 +780,7 @@ App::get('/v1/teams/:teamId/memberships')
});
App::get('/v1/teams/:teamId/memberships/:membershipId')
->desc('Get Team Membership')
->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])
@ -822,7 +822,7 @@ App::get('/v1/teams/:teamId/memberships/:membershipId')
});
App::patch('/v1/teams/:teamId/memberships/:membershipId')
->desc('Update Membership')
->desc('Update membership')
->groups(['api', 'teams'])
->label('event', 'teams.[teamId].memberships.[membershipId].update')
->label('scope', 'teams.write')
@ -893,7 +893,7 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId')
});
App::patch('/v1/teams/:teamId/memberships/:membershipId/status')
->desc('Update Team Membership Status')
->desc('Update team membership status')
->groups(['api', 'teams'])
->label('event', 'teams.[teamId].memberships.[membershipId].update.status')
->label('scope', 'public')
@ -1028,7 +1028,7 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status')
});
App::delete('/v1/teams/:teamId/memberships/:membershipId')
->desc('Delete Team Membership')
->desc('Delete team membership')
->groups(['api', 'teams'])
->label('event', 'teams.[teamId].memberships.[membershipId].delete')
->label('scope', 'teams.write')
@ -1094,7 +1094,7 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId')
});
App::get('/v1/teams/:teamId/logs')
->desc('List Team Logs')
->desc('List team logs')
->groups(['api', 'teams'])
->label('scope', 'teams.read')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])

View file

@ -108,7 +108,7 @@ function createUser(string $hash, mixed $hashOptions, string $userId, ?string $e
}
App::post('/v1/users')
->desc('Create User')
->desc('Create user')
->groups(['api', 'users'])
->label('event', 'users.[userId].create')
->label('scope', 'users.write')
@ -141,7 +141,7 @@ App::post('/v1/users')
});
App::post('/v1/users/bcrypt')
->desc('Create User with Bcrypt Password')
->desc('Create user with bcrypt password')
->groups(['api', 'users'])
->label('event', 'users.[userId].create')
->label('scope', 'users.write')
@ -172,7 +172,7 @@ App::post('/v1/users/bcrypt')
});
App::post('/v1/users/md5')
->desc('Create User with MD5 Password')
->desc('Create user with MD5 password')
->groups(['api', 'users'])
->label('event', 'users.[userId].create')
->label('scope', 'users.write')
@ -203,7 +203,7 @@ App::post('/v1/users/md5')
});
App::post('/v1/users/argon2')
->desc('Create User with Argon2 Password')
->desc('Create user with Argon2 password')
->groups(['api', 'users'])
->label('event', 'users.[userId].create')
->label('scope', 'users.write')
@ -234,7 +234,7 @@ App::post('/v1/users/argon2')
});
App::post('/v1/users/sha')
->desc('Create User with SHA Password')
->desc('Create user with SHA password')
->groups(['api', 'users'])
->label('event', 'users.[userId].create')
->label('scope', 'users.write')
@ -272,7 +272,7 @@ App::post('/v1/users/sha')
});
App::post('/v1/users/phpass')
->desc('Create User with PHPass Password')
->desc('Create user with PHPass password')
->groups(['api', 'users'])
->label('event', 'users.[userId].create')
->label('scope', 'users.write')
@ -303,7 +303,7 @@ App::post('/v1/users/phpass')
});
App::post('/v1/users/scrypt')
->desc('Create User with Scrypt Password')
->desc('Create user with Scrypt password')
->groups(['api', 'users'])
->label('event', 'users.[userId].create')
->label('scope', 'users.write')
@ -347,7 +347,7 @@ App::post('/v1/users/scrypt')
});
App::post('/v1/users/scrypt-modified')
->desc('Create User with Scrypt Modified Password')
->desc('Create user with Scrypt modified password')
->groups(['api', 'users'])
->label('event', 'users.[userId].create')
->label('scope', 'users.write')
@ -435,7 +435,7 @@ App::post('/v1/users/:userId/targets')
});
App::get('/v1/users')
->desc('List Users')
->desc('List users')
->groups(['api', 'users'])
->label('scope', 'users.read')
->label('usage.metric', 'users.{scope}.requests.read')
@ -484,7 +484,7 @@ App::get('/v1/users')
});
App::get('/v1/users/:userId')
->desc('Get User')
->desc('Get user')
->groups(['api', 'users'])
->label('scope', 'users.read')
->label('usage.metric', 'users.{scope}.requests.read')
@ -510,7 +510,7 @@ App::get('/v1/users/:userId')
});
App::get('/v1/users/:userId/prefs')
->desc('Get User Preferences')
->desc('Get user preferences')
->groups(['api', 'users'])
->label('scope', 'users.read')
->label('usage.metric', 'users.{scope}.requests.read')
@ -570,7 +570,7 @@ App::get('/v1/users/:userId/targets/:targetId')
});
App::get('/v1/users/:userId/sessions')
->desc('List User Sessions')
->desc('List user sessions')
->groups(['api', 'users'])
->label('scope', 'users.read')
->label('usage.metric', 'users.{scope}.requests.read')
@ -612,7 +612,7 @@ App::get('/v1/users/:userId/sessions')
});
App::get('/v1/users/:userId/memberships')
->desc('List User Memberships')
->desc('List user memberships')
->groups(['api', 'users'])
->label('scope', 'users.read')
->label('usage.metric', 'users.{scope}.requests.read')
@ -652,7 +652,7 @@ App::get('/v1/users/:userId/memberships')
});
App::get('/v1/users/:userId/logs')
->desc('List User Logs')
->desc('List user logs')
->groups(['api', 'users'])
->label('scope', 'users.read')
->label('usage.metric', 'users.{scope}.requests.read')
@ -812,7 +812,7 @@ App::get('/v1/users/identities')
});
App::patch('/v1/users/:userId/status')
->desc('Update User Status')
->desc('Update user status')
->groups(['api', 'users'])
->label('event', 'users.[userId].update.status')
->label('scope', 'users.write')
@ -849,7 +849,7 @@ App::patch('/v1/users/:userId/status')
});
App::put('/v1/users/:userId/labels')
->desc('Update User Labels')
->desc('Update user labels')
->groups(['api', 'users'])
->label('event', 'users.[userId].update.labels')
->label('scope', 'users.write')
@ -887,7 +887,7 @@ App::put('/v1/users/:userId/labels')
});
App::patch('/v1/users/:userId/verification/phone')
->desc('Update Phone Verification')
->desc('Update phone verification')
->groups(['api', 'users'])
->label('event', 'users.[userId].update.verification')
->label('scope', 'users.write')
@ -923,7 +923,7 @@ App::patch('/v1/users/:userId/verification/phone')
});
App::patch('/v1/users/:userId/name')
->desc('Update Name')
->desc('Update name')
->groups(['api', 'users'])
->label('event', 'users.[userId].update.name')
->label('scope', 'users.write')
@ -961,7 +961,7 @@ App::patch('/v1/users/:userId/name')
});
App::patch('/v1/users/:userId/password')
->desc('Update Password')
->desc('Update password')
->groups(['api', 'users'])
->label('event', 'users.[userId].update.password')
->label('scope', 'users.write')
@ -1026,7 +1026,7 @@ App::patch('/v1/users/:userId/password')
});
App::patch('/v1/users/:userId/email')
->desc('Update Email')
->desc('Update email')
->groups(['api', 'users'])
->label('event', 'users.[userId].update.email')
->label('scope', 'users.write')
@ -1083,7 +1083,7 @@ App::patch('/v1/users/:userId/email')
});
App::patch('/v1/users/:userId/phone')
->desc('Update Phone')
->desc('Update phone')
->groups(['api', 'users'])
->label('event', 'users.[userId].update.phone')
->label('scope', 'users.write')
@ -1127,7 +1127,7 @@ App::patch('/v1/users/:userId/phone')
});
App::patch('/v1/users/:userId/verification')
->desc('Update Email Verification')
->desc('Update email verification')
->groups(['api', 'users'])
->label('event', 'users.[userId].update.verification')
->label('scope', 'users.write')
@ -1163,7 +1163,7 @@ App::patch('/v1/users/:userId/verification')
});
App::patch('/v1/users/:userId/prefs')
->desc('Update User Preferences')
->desc('Update user preferences')
->groups(['api', 'users'])
->label('event', 'users.[userId].update.prefs')
->label('scope', 'users.write')
@ -1243,7 +1243,7 @@ App::patch('/v1/users/:userId/targets/:targetId/identifier')
});
App::delete('/v1/users/:userId/sessions/:sessionId')
->desc('Delete User Session')
->desc('Delete user session')
->groups(['api', 'users'])
->label('event', 'users.[userId].sessions.[sessionId].delete')
->label('scope', 'users.write')
@ -1287,7 +1287,7 @@ App::delete('/v1/users/:userId/sessions/:sessionId')
});
App::delete('/v1/users/:userId/sessions')
->desc('Delete User Sessions')
->desc('Delete user sessions')
->groups(['api', 'users'])
->label('event', 'users.[userId].sessions.[sessionId].delete')
->label('scope', 'users.write')
@ -1330,7 +1330,7 @@ App::delete('/v1/users/:userId/sessions')
});
App::delete('/v1/users/:userId')
->desc('Delete User')
->desc('Delete user')
->groups(['api', 'users'])
->label('event', 'users.[userId].delete')
->label('scope', 'users.write')

View file

@ -23,6 +23,7 @@ use Utopia\Database\Helpers\Role;
use Utopia\Database\Query;
use Utopia\Database\Validator\Authorization;
use Utopia\Database\Validator\UID;
use Utopia\Detector\Adapter\Bun;
use Utopia\Detector\Adapter\CPP;
use Utopia\Detector\Adapter\Dart;
use Utopia\Detector\Adapter\Deno;
@ -469,6 +470,7 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories/:pr
$detectorFactory
->addDetector(new JavaScript())
->addDetector(new Bun())
->addDetector(new PHP())
->addDetector(new Python())
->addDetector(new Dart())
@ -549,6 +551,7 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories')
$detectorFactory
->addDetector(new JavaScript())
->addDetector(new Bun())
->addDetector(new PHP())
->addDetector(new Python())
->addDetector(new Dart())

View file

@ -444,6 +444,19 @@ App::post('/v1/mock/tests/general/nullable')
->action(function (string $required, string $nullable, ?string $optional) {
});
App::post('/v1/mock/tests/general/enum')
->desc('Enum Test')
->groups(['mock'])
->label('scope', 'public')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'general')
->label('sdk.method', 'enum')
->label('sdk.description', 'Mock an enum parameter.')
->label('sdk.mock', true)
->param('mockType', '', new WhiteList(['first', 'second', 'third']), 'Sample enum param')
->action(function (string $mockType) {
});
App::get('/v1/mock/tests/general/400-error')
->desc('400 Error')
->groups(['mock'])

View file

@ -203,7 +203,7 @@ App::init()
$useCache = $route->getLabel('cache', false);
if ($useCache) {
$key = md5($request->getURI() . implode('*', $request->getParams())) . '*' . APP_CACHE_BUSTER;
$key = md5($request->getURI() . implode('*', $request->getParams()) . '*' . APP_CACHE_BUSTER);
$cache = new Cache(
new Filesystem(APP_STORAGE_CACHE . DIRECTORY_SEPARATOR . 'app-' . $project->getId())
);
@ -489,7 +489,7 @@ App::shutdown()
$resourceType = $parseLabel($pattern, $responsePayload, $requestParams, $user);
}
$key = md5($request->getURI() . implode('*', $request->getParams())) . '*' . APP_CACHE_BUSTER;
$key = md5($request->getURI() . implode('*', $request->getParams()) . '*' . APP_CACHE_BUSTER);
$data = json_encode([
'resourceType' => $resourceType,
'resource' => $resource,

View file

@ -108,8 +108,8 @@ const APP_LIMIT_LIST_DEFAULT = 25; // Default maximum number of items to return
const APP_KEY_ACCCESS = 24 * 60 * 60; // 24 hours
const APP_USER_ACCCESS = 24 * 60 * 60; // 24 hours
const APP_CACHE_UPDATE = 24 * 60 * 60; // 24 hours
const APP_CACHE_BUSTER = 509;
const APP_VERSION_STABLE = '1.4.2';
const APP_CACHE_BUSTER = 510;
const APP_VERSION_STABLE = '1.4.3';
const APP_DATABASE_ATTRIBUTE_EMAIL = 'email';
const APP_DATABASE_ATTRIBUTE_ENUM = 'enum';
const APP_DATABASE_ATTRIBUTE_IP = 'ip';

View file

@ -383,6 +383,27 @@ services:
- _APP_FUNCTIONS_MEMORY
- _APP_OPTIONS_FORCE_HTTPS
- _APP_DOMAIN
- _APP_STORAGE_DEVICE
- _APP_STORAGE_S3_ACCESS_KEY
- _APP_STORAGE_S3_SECRET
- _APP_STORAGE_S3_REGION
- _APP_STORAGE_S3_BUCKET
- _APP_STORAGE_DO_SPACES_ACCESS_KEY
- _APP_STORAGE_DO_SPACES_SECRET
- _APP_STORAGE_DO_SPACES_REGION
- _APP_STORAGE_DO_SPACES_BUCKET
- _APP_STORAGE_BACKBLAZE_ACCESS_KEY
- _APP_STORAGE_BACKBLAZE_SECRET
- _APP_STORAGE_BACKBLAZE_REGION
- _APP_STORAGE_BACKBLAZE_BUCKET
- _APP_STORAGE_LINODE_ACCESS_KEY
- _APP_STORAGE_LINODE_SECRET
- _APP_STORAGE_LINODE_REGION
- _APP_STORAGE_LINODE_BUCKET
- _APP_STORAGE_WASABI_ACCESS_KEY
- _APP_STORAGE_WASABI_SECRET
- _APP_STORAGE_WASABI_REGION
- _APP_STORAGE_WASABI_BUCKET
appwrite-worker-certificates:
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
@ -641,7 +662,7 @@ services:
hostname: appwrite-executor
<<: *x-logging
stop_signal: SIGINT
image: openruntimes/executor:0.4.0
image: openruntimes/executor:0.4.1
networks:
- appwrite
- runtimes

View file

@ -20,6 +20,7 @@ use Utopia\Database\Database;
use Utopia\Database\Query;
use Utopia\Storage\Storage;
use Utopia\Database\Validator\Authorization;
use Utopia\Storage\Device\Local;
use Utopia\VCS\Adapter\Git\GitHub;
require_once __DIR__ . '/../init.php';
@ -248,22 +249,25 @@ class BuildsV1 extends Worker
);
}
Console::execute('tar --exclude code.tar.gz -czf /tmp/builds/' . \escapeshellcmd($buildId) . '/code.tar.gz -C /tmp/builds/' . \escapeshellcmd($buildId) . '/code' . (empty($rootDirectory) ? '' : '/' . $rootDirectory) . ' .', '', $stdout, $stderr);
$tmpPath = '/tmp/builds/' . \escapeshellcmd($buildId);
$tmpPathFile = $tmpPath . '/code.tar.gz';
Console::execute('tar --exclude code.tar.gz -czf ' . $tmpPathFile . ' -C /tmp/builds/' . \escapeshellcmd($buildId) . '/code' . (empty($rootDirectory) ? '' : '/' . $rootDirectory) . ' .', '', $stdout, $stderr);
$deviceFunctions = $this->getFunctionsDevice($project->getId());
$fileName = 'code.tar.gz';
$fileTmpName = '/tmp/builds/' . $buildId . '/code.tar.gz';
$localDevice = new Local();
$buffer = $localDevice->read($tmpPathFile);
$mimeType = $localDevice->getFileMimeType($tmpPathFile);
$path = $deviceFunctions->getPath($deployment->getId() . '.' . \pathinfo($fileName, PATHINFO_EXTENSION));
$result = $deviceFunctions->move($fileTmpName, $path);
$path = $deviceFunctions->getPath($deployment->getId() . '.' . \pathinfo('code.tar.gz', PATHINFO_EXTENSION));
$result = $deviceFunctions->write($path, $buffer, $mimeType);
if (!$result) {
throw new \Exception("Unable to move file");
}
Console::execute('rm -rf /tmp/builds/' . \escapeshellcmd($buildId), '', $stdout, $stderr);
Console::execute('rm -rf ' . $tmpPath, '', $stdout, $stderr);
$source = $path;

View file

@ -41,7 +41,7 @@
"ext-openssl": "*",
"ext-zlib": "*",
"ext-sockets": "*",
"appwrite/php-runtimes": "0.12.0",
"appwrite/php-runtimes": "0.13.*",
"appwrite/php-clamav": "2.0.*",
"utopia-php/abuse": "0.31.*",
"utopia-php/analytics": "0.10.*",
@ -66,7 +66,7 @@
"utopia-php/registry": "0.5.*",
"utopia-php/storage": "0.14.*",
"utopia-php/swoole": "0.5.*",
"utopia-php/vcs": "0.4.*",
"utopia-php/vcs": "0.5.*",
"utopia-php/websocket": "0.1.*",
"resque/php-resque": "1.3.6",
"matomo/device-detector": "6.1.*",
@ -86,8 +86,8 @@
}
],
"require-dev": {
"appwrite/sdk-generator": "0.35.0",
"ext-fileinfo": "*",
"appwrite/sdk-generator": "0.35.*",
"phpunit/phpunit": "9.5.20",
"squizlabs/php_codesniffer": "^3.7",
"swoole/ide-helper": "5.0.2",

32
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "237609b7e9fb20d807aa6e773bf72de6",
"content-hash": "ad15ede4c9d042768e4344a2de6bf7f2",
"packages": [
{
"name": "adhocore/jwt",
@ -156,11 +156,11 @@
},
{
"name": "appwrite/php-runtimes",
"version": "0.12.0",
"version": "0.13.0",
"source": {
"type": "git",
"url": "https://github.com/appwrite/runtimes.git",
"reference": "5aa672ae744be0d7a3d4bf4c93455c65e9a23b4f"
"reference": "5ab496b3908992b39275994a23783701c4b3de84"
},
"require": {
"php": ">=8.0",
@ -195,7 +195,7 @@
"php",
"runtimes"
],
"time": "2023-08-07T09:56:11+00:00"
"time": "2023-09-12T19:38:43+00:00"
},
{
"name": "chillerlan/php-qrcode",
@ -3149,16 +3149,16 @@
},
{
"name": "utopia-php/vcs",
"version": "0.4.0",
"version": "0.5.0",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/vcs.git",
"reference": "08078af30865827adb8aafb32929c968ce541a28"
"reference": "47144f272030b7ed1b05471f2cb3aabeb8cb831c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/vcs/zipball/08078af30865827adb8aafb32929c968ce541a28",
"reference": "08078af30865827adb8aafb32929c968ce541a28",
"url": "https://api.github.com/repos/utopia-php/vcs/zipball/47144f272030b7ed1b05471f2cb3aabeb8cb831c",
"reference": "47144f272030b7ed1b05471f2cb3aabeb8cb831c",
"shasum": ""
},
"require": {
@ -3192,9 +3192,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/vcs/issues",
"source": "https://github.com/utopia-php/vcs/tree/0.4.0"
"source": "https://github.com/utopia-php/vcs/tree/0.5.0"
},
"time": "2023-08-30T16:17:03+00:00"
"time": "2023-09-13T19:05:52+00:00"
},
{
"name": "utopia-php/websocket",
@ -3381,16 +3381,16 @@
"packages-dev": [
{
"name": "appwrite/sdk-generator",
"version": "0.35.0",
"version": "0.35.2",
"source": {
"type": "git",
"url": "https://github.com/appwrite/sdk-generator.git",
"reference": "edd5da6763d7f8f28155b77200682c69d08c9954"
"reference": "2dfe0430a64ffd2a07078d83b20144b871acac3b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/edd5da6763d7f8f28155b77200682c69d08c9954",
"reference": "edd5da6763d7f8f28155b77200682c69d08c9954",
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/2dfe0430a64ffd2a07078d83b20144b871acac3b",
"reference": "2dfe0430a64ffd2a07078d83b20144b871acac3b",
"shasum": ""
},
"require": {
@ -3426,9 +3426,9 @@
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
"support": {
"issues": "https://github.com/appwrite/sdk-generator/issues",
"source": "https://github.com/appwrite/sdk-generator/tree/0.35.0"
"source": "https://github.com/appwrite/sdk-generator/tree/0.35.2"
},
"time": "2023-09-07T17:13:18+00:00"
"time": "2023-09-14T14:59:50+00:00"
},
{
"name": "doctrine/deprecations",

View file

@ -427,6 +427,27 @@ services:
- _APP_FUNCTIONS_MEMORY
- _APP_OPTIONS_FORCE_HTTPS
- _APP_DOMAIN
- _APP_STORAGE_DEVICE
- _APP_STORAGE_S3_ACCESS_KEY
- _APP_STORAGE_S3_SECRET
- _APP_STORAGE_S3_REGION
- _APP_STORAGE_S3_BUCKET
- _APP_STORAGE_DO_SPACES_ACCESS_KEY
- _APP_STORAGE_DO_SPACES_SECRET
- _APP_STORAGE_DO_SPACES_REGION
- _APP_STORAGE_DO_SPACES_BUCKET
- _APP_STORAGE_BACKBLAZE_ACCESS_KEY
- _APP_STORAGE_BACKBLAZE_SECRET
- _APP_STORAGE_BACKBLAZE_REGION
- _APP_STORAGE_BACKBLAZE_BUCKET
- _APP_STORAGE_LINODE_ACCESS_KEY
- _APP_STORAGE_LINODE_SECRET
- _APP_STORAGE_LINODE_REGION
- _APP_STORAGE_LINODE_BUCKET
- _APP_STORAGE_WASABI_ACCESS_KEY
- _APP_STORAGE_WASABI_SECRET
- _APP_STORAGE_WASABI_REGION
- _APP_STORAGE_WASABI_BUCKET
appwrite-worker-certificates:
entrypoint: worker-certificates
@ -707,7 +728,7 @@ services:
hostname: appwrite-executor
<<: *x-logging
stop_signal: SIGINT
image: openruntimes/executor:0.4.0
image: openruntimes/executor:0.4.1
networks:
- appwrite
- runtimes

View file

@ -1,3 +1,3 @@
Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](/docs/client/account#accountUpdateEmailVerification). The verification link sent to the user's email address is valid for 7 days.
Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.
Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.

View file

@ -1,3 +1,3 @@
Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT /account/sessions/magic-url](/docs/client/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.
Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT /account/sessions/magic-url](updateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](/docs/authentication-security#limits).

View file

@ -1,3 +1,3 @@
Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [PUT /account/sessions/phone](/docs/client/account#accountUpdatePhoneSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.
Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [PUT /account/sessions/phone](/docs/references/cloud/client-web/account#updatePhoneSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](/docs/authentication-security#limits).

View file

@ -1 +1 @@
Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](/docs/client/account#accountUpdatePhone) endpoint. Learn more about how to [complete the verification process](/docs/client/account#accountUpdatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.
Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.

View file

@ -1 +1 @@
Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](/docs/client/account#accountUpdateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.
Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.

View file

@ -1 +1 @@
Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](/docs/client/account#accountUpdateEmail) or create an [OAuth2 session](/docs/client/account#accountCreateOAuth2Session).
Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](UpdateEmail) or create an [OAuth2 session](/docs/references/cloud/client-web/account#CreateOAuth2Session).

View file

@ -1 +1 @@
Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](/docs/client/account#accountCreateVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](/docs/client/account#accountCreateSession).
Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](/docs/references/cloud/client-web/account#createSession).

View file

@ -1 +1 @@
Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](/docs/client/account#accountDeleteSessions) instead.
Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](/docs/references/cloud/client-web/account#deleteSessions) instead.

View file

@ -1,3 +1,3 @@
Use this endpoint to complete creating the session with the Magic URL. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/sessions/magic-url](/docs/client/account#accountCreateMagicURLSession) endpoint.
Use this endpoint to complete creating the session with the Magic URL. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/sessions/magic-url](/docs/references/cloud/client-web/account#createMagicURLSession) endpoint.
Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.

View file

@ -1 +1 @@
Use this endpoint to complete creating a session with SMS. Use the **userId** from the [createPhoneSession](/docs/client/account#accountCreatePhoneSession) endpoint and the **secret** received via SMS to successfully update and confirm the phone session.
Use this endpoint to complete creating a session with SMS. Use the **userId** from the [createPhoneSession](/docs/references/cloud/client-web/account#createPhoneSession) endpoint and the **secret** received via SMS to successfully update and confirm the phone session.

View file

@ -1 +1 @@
Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](/docs/client/account#accountCreatePhoneVerification) endpoint to send a confirmation SMS.
Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS.

View file

@ -1,3 +1,3 @@
Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](/docs/client/account#accountCreateRecovery) endpoint.
Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](/docs/references/cloud/client-web/account#createRecovery) endpoint.
Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.

View file

@ -1,3 +1,3 @@
You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](/docs/client/account#accountGetSessions) endpoint. Use width, height and quality arguments to change the output settings.
You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.
When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.

View file

@ -2,6 +2,6 @@ Invite a new member to join your team. Provide an ID for existing users, or invi
You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.
Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](/docs/client/teams#teamsUpdateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.

View file

@ -1 +1 @@
Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](/docs/client/account#accountGetPrefs).
Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](/docs/references/cloud/client-web/account#getPrefs).

View file

@ -183,7 +183,7 @@
- BREAKING Renamed users.deleteUser to users.delete
- BREAKING Renamed parameter inviteId to membershipId on teams.updateMembershipStatus, teams.deleteMembership
- JWT Support client.setJWT('JWT_GENERATED_IN_CLIENT')
- [Update membership roles](https://appwrite.io/docs/client/teams?sdk=dart#teamsUpdateMembershipRoles)
- [Update membership roles](https://appwrite.io/docs/references/cloud/server-dart/teams?sdk=dart#updateMembershipRoles)
- New awesome image preview features, supports borderRadius, borderColor, borderWidth
## 0.5.0-dev.1

View file

@ -209,11 +209,11 @@ https://github.com/appwrite/appwrite/blob/master/CHANGES.md
- Upgraded to Null-safety, minimum Dart SDK required 2.12.0
- Upgraded all underlying dependencies to null safe version
- BREAKING Renamed parameter inviteId to membershipId on teams.updateMembershipStatus, teams.deleteMembership
- [Anonymous login](https://appwrite.io/docs/client/account?sdk=flutter#accountCreateAnonymousSession)
- [JWT Support](https://appwrite.io/docs/client/account?sdk=flutter#accountCreateJWT)
- [Anonymous login](https://appwrite.io/docs/references/cloud/client-flutter/account?sdk=flutter#createAnonymousSession)
- [JWT Support](https://appwrite.io/docs/references/cloud/client-flutter/account?sdk=flutter#createJWT)
- Fallback Cookies for Flutter Web if 3rd party cookies are blocked
- Custom User Agent Support
- [Update membership roles](https://appwrite.io/docs/client/teams?sdk=flutter#teamsUpdateMembershipRoles)
- [Update membership roles](https://appwrite.io/docs/references/cloud/client-flutter/teams?sdk=flutter#updateMembershipRoles)
- New awesome image preview features, supports borderRadius, borderColor, borderWidth
## 0.5.0-dev.1

View file

@ -1,8 +1,8 @@
The Account service allows you to authenticate and manage a user account. You can use the account service to update user information, retrieve the user sessions across different devices, and fetch the user security logs with his or her recent activity.
Register new user accounts with the [Create Account](/docs/client/account#accountCreate), [Create Magic URL session](/docs/client/account#accountCreateMagicURLSession), or [Create Phone session](/docs/client/account#accountCreatePhoneSession) endpoint. You can authenticate the user account by using multiple sign-in methods available. Once the user is authenticated, a new session object will be created to allow the user to access his or her private data and settings.
Register new user accounts with the [Create Account](/docs/references/cloud/client-web/account#create), [Create Magic URL session](/docs/references/cloud/client-web/account#createMagicURLSession), or [Create Phone session](/docs/references/cloud/client-web/account#createPhoneSession) endpoint. You can authenticate the user account by using multiple sign-in methods available. Once the user is authenticated, a new session object will be created to allow the user to access his or her private data and settings.
This service also exposes an endpoint to save and read the [user preferences](/docs/client/account#accountUpdatePrefs) as a key-value object. This feature is handy if you want to allow extra customization in your app. Common usage for this feature may include saving the user's preferred locale, timezone, or custom app theme.
This service also exposes an endpoint to save and read the [user preferences](/docs/references/cloud/client-web/account#updatePrefs) as a key-value object. This feature is handy if you want to allow extra customization in your app. Common usage for this feature may include saving the user's preferred locale, timezone, or custom app theme.
> ## Account API vs Users API
> While the Account API operates in the scope of the current logged-in user and usually using a client-side integration, the Users API is integrated from the server-side and operates in an admin scope with access to all your project users.

View file

@ -181,7 +181,7 @@ After you finished adding your new provider to Appwrite, you should be able to s
Add credentials and check both a successful and a failed login (where the user denies integration on the provider page).
You can test your OAuth2 provider by trying to login using the [OAuth2 method](https://appwrite.io/docs/client/account#accountCreateOAuth2Session) when integrating the Appwrite Web SDK in a demo app.
You can test your OAuth2 provider by trying to login using the [OAuth2 method](https://appwrite.io/docs/references/cloud/client-web/account#createOAuth2Session) when integrating the Appwrite Web SDK in a demo app.
Pass your new adapter name as the provider parameter. If login is successful, you will be redirected to your success URL parameter. Otherwise, you will be redirected to your failure URL.

8
package.json Normal file
View file

@ -0,0 +1,8 @@
{
"private": true,
"name": "@appwrite.io/repo",
"repository": {
"type": "git",
"url": "git+https://github.com/appwrite/appwrite.git"
}
}

BIN
public/images/banner.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 724 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 523 KiB

After

Width:  |  Height:  |  Size: 548 KiB

View file

@ -20,8 +20,9 @@ class Linkedin extends OAuth2
* @var array
*/
protected array $scopes = [
'r_liteprofile',
'r_emailaddress',
'openid',
'profile',
'email'
];
/**
@ -117,8 +118,7 @@ class Linkedin extends OAuth2
public function getUserID(string $accessToken): string
{
$user = $this->getUser($accessToken);
return $user['id'] ?? '';
return $user['sub'] ?? '';
}
/**
@ -128,9 +128,8 @@ class Linkedin extends OAuth2
*/
public function getUserEmail(string $accessToken): string
{
$email = \json_decode($this->request('GET', 'https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~))', ['Authorization: Bearer ' . \urlencode($accessToken)]), true);
return $email['elements'][0]['handle~']['emailAddress'] ?? '';
$user = $this->getUser($accessToken);
return $user['email'] ?? '';
}
/**
@ -144,9 +143,8 @@ class Linkedin extends OAuth2
*/
public function isEmailVerified(string $accessToken): bool
{
$email = $this->getUserEmail($accessToken);
return !empty($email);
$user = $this->getUser($accessToken);
return $user['email_verified'] ?? false;
}
/**
@ -159,12 +157,16 @@ class Linkedin extends OAuth2
$user = $this->getUser($accessToken);
$name = '';
if (isset($user['localizedFirstName'])) {
$name = $user['localizedFirstName'];
if (isset($user['name'])) {
return $user['name'];
}
if (isset($user['localizedLastName'])) {
$name = (empty($name)) ? $user['localizedLastName'] : $name . ' ' . $user['localizedLastName'];
if (isset($user['given_name'])) {
$name = $user['given_name'];
}
if (isset($user['family_name'])) {
$name = (empty($name)) ? $user['family_name'] : $name . ' ' . $user['family_name'];
}
return $name;
@ -178,7 +180,7 @@ class Linkedin extends OAuth2
protected function getUser(string $accessToken)
{
if (empty($this->user)) {
$this->user = \json_decode($this->request('GET', 'https://api.linkedin.com/v2/me', ['Authorization: Bearer ' . \urlencode($accessToken)]), true);
$this->user = \json_decode($this->request('GET', 'https://api.linkedin.com/v2/userinfo', ['Authorization: Bearer ' . \urlencode($accessToken)]), true);
}
return $this->user;

View file

@ -45,12 +45,6 @@ class Event extends Validator
* Identify all sections of the pattern.
*/
$type = $parts[0] ?? false;
if ($type == 'functions') {
$this->message = 'Triggering a function on a function event is not allowed.';
return false;
}
$resource = $parts[1] ?? false;
$hasSubResource = $count > 3 && ($events[$type]['$resource'] ?? false) && ($events[$type][$parts[2]]['$resource'] ?? false);
$hasSubSubResource = $count > 5 && $hasSubResource && ($events[$type][$parts[2]][$parts[4]]['$resource'] ?? false);

View file

@ -0,0 +1,25 @@
<?php
namespace Appwrite\Event\Validator;
use Utopia\Config\Config;
class FunctionEvent extends Event
{
/**
* Is valid.
*
* @param mixed $value
*
* @return bool
*/
public function isValid($value): bool
{
if (str_starts_with($value, 'functions.')) {
$this->message = 'Triggering a function on a function event is not allowed.';
return false;
}
return parent::isValid($value);
}
}

View file

@ -235,6 +235,7 @@ class Mapper
case 'Utopia\Validator\Domain':
case 'Appwrite\Network\Validator\Email':
case 'Appwrite\Event\Validator\Event':
case 'Appwrite\Event\Validator\FunctionEvent':
case 'Utopia\Validator\HexColor':
case 'Utopia\Validator\Host':
case 'Utopia\Validator\IP':

View file

@ -67,6 +67,7 @@ abstract class Migration
'1.4.0' => 'V19',
'1.4.1' => 'V19',
'1.4.2' => 'V19',
'1.4.3' => 'V19',
];
/**

View file

@ -245,7 +245,7 @@ class Doctor extends Action
try {
if (App::isProduction()) {
Console::log('');
$version = \json_decode(@\file_get_contents(App::getEnv('_APP_HOME', 'http://localhost') . '/v1/health/version'), true);
$version = \json_decode(@\file_get_contents(App::getEnv('_APP_HOME', 'http://localhost') . '/version'), true);
if ($version && isset($version['version'])) {
if (\version_compare($version['version'], App::getEnv('_APP_VERSION', 'UNKNOWN')) === 0) {

View file

@ -89,7 +89,12 @@ class Schedule extends Action
$sum = count($results);
$total = $total + $sum;
foreach ($results as $document) {
$schedules[$document['resourceId']] = $getSchedule($document);
try {
$schedules[$document['resourceId']] = $getSchedule($document);
} catch (\Throwable $th) {
Console::error("Failed to load schedule for project {$document['projectId']} and function {$document['resourceId']}");
Console::error($th->getMessage());
}
}
$latestDocument = !empty(array_key_last($results)) ? $results[array_key_last($results)] : null;

View file

@ -253,7 +253,7 @@ class Specs extends Action
->setParam('docs.url', $endpoint . '/docs');
if ($mocks) {
$path = __DIR__ . '/../config/specs/' . $format . '-mocks-' . $platform . '.json';
$path = __DIR__ . '/../../../../app/config/specs/' . $format . '-mocks-' . $platform . '.json';
if (!file_put_contents($path, json_encode($specs->parse()))) {
throw new Exception('Failed to save mocks spec file: ' . $path);

View file

@ -50,7 +50,7 @@ class EventValidatorTest extends TestCase
$this->assertTrue($this->object->isValid('databases.books'));
$this->assertTrue($this->object->isValid('databases.books.collections.chapters'));
$this->assertTrue($this->object->isValid('databases.books.collections.*'));
// $this->assertTrue($this->object->isValid('functions.*')); TODO @christyjacob4 : enable test once we allow functions.* events
$this->assertTrue($this->object->isValid('functions.*'));
$this->assertTrue($this->object->isValid('buckets.*'));
$this->assertTrue($this->object->isValid('teams.*'));
$this->assertTrue($this->object->isValid('users.*'));

View file

@ -0,0 +1,73 @@
<?php
namespace Tests\Unit\Event\Validator;
use Appwrite\Event\Validator\FunctionEvent;
use PHPUnit\Framework\TestCase;
class FunctionEventValidatorTest extends TestCase
{
protected ?FunctionEvent $object = null;
public function setUp(): void
{
$this->object = new FunctionEvent();
}
public function tearDown(): void
{
}
public function testValues(): void
{
/**
* Test for SUCCESS
*/
$this->assertTrue($this->object->isValid('users.*.create'));
$this->assertTrue($this->object->isValid('users.torsten.update'));
$this->assertTrue($this->object->isValid('users.torsten'));
$this->assertTrue($this->object->isValid('users.*.update.email'));
$this->assertTrue($this->object->isValid('users.*.update'));
$this->assertTrue($this->object->isValid('users.*'));
$this->assertTrue($this->object->isValid('databases.books.collections.chapters.documents.prolog.create'));
$this->assertTrue($this->object->isValid('databases.books.collections.chapters.documents.prolog'));
$this->assertTrue($this->object->isValid('databases.books.collections.chapters.documents.*.create'));
$this->assertTrue($this->object->isValid('databases.books.collections.chapters.documents.*'));
$this->assertTrue($this->object->isValid('databases.books.collections.*.documents.prolog.create'));
$this->assertTrue($this->object->isValid('databases.books.collections.*.documents.prolog'));
$this->assertTrue($this->object->isValid('databases.books.collections.*.documents.*.create'));
$this->assertTrue($this->object->isValid('databases.books.collections.*.documents.*'));
$this->assertTrue($this->object->isValid('databases.*.collections.chapters.documents.prolog.create'));
$this->assertTrue($this->object->isValid('databases.*.collections.chapters.documents.prolog'));
$this->assertTrue($this->object->isValid('databases.*.collections.chapters.documents.*.create'));
$this->assertTrue($this->object->isValid('databases.*.collections.chapters.documents.*'));
$this->assertTrue($this->object->isValid('databases.*.collections.*.documents.prolog.create'));
$this->assertTrue($this->object->isValid('databases.*.collections.*.documents.prolog'));
$this->assertTrue($this->object->isValid('databases.*.collections.*.documents.*.create'));
$this->assertTrue($this->object->isValid('databases.*.collections.*.documents.*'));
$this->assertTrue($this->object->isValid('databases.*.collections.*'));
$this->assertTrue($this->object->isValid('databases.*'));
$this->assertTrue($this->object->isValid('databases.books'));
$this->assertTrue($this->object->isValid('databases.books.collections.chapters'));
$this->assertTrue($this->object->isValid('databases.books.collections.*'));
$this->assertTrue($this->object->isValid('buckets.*'));
$this->assertTrue($this->object->isValid('teams.*'));
$this->assertTrue($this->object->isValid('users.*'));
$this->assertTrue($this->object->isValid('teams.*.memberships.*.update.status'));
/**
* Test for FAILURE
*/
$this->assertFalse($this->object->isValid(false));
$this->assertFalse($this->object->isValid(null));
$this->assertFalse($this->object->isValid(''));
$this->assertFalse($this->object->isValid('unknown.*'));
$this->assertFalse($this->object->isValid('collections'));
$this->assertFalse($this->object->isValid('collections.*.unknown'));
$this->assertFalse($this->object->isValid('collections.*.documents.*.unknown'));
$this->assertFalse($this->object->isValid('users.torsten.unknown'));
$this->assertFalse($this->object->isValid('users.torsten.delete.email'));
$this->assertFalse($this->object->isValid('teams.*.memberships.*.update.unknown'));
$this->assertFalse($this->object->isValid('functions.*'));
}
}