mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 17:08:45 +00:00
Merge branch '1.4.x' into fix-skip-non-ascii-chars-image
This commit is contained in:
commit
9d47237da9
70 changed files with 988 additions and 437 deletions
2
.env
2
.env
|
|
@ -9,7 +9,9 @@ _APP_SYSTEM_EMAIL_ADDRESS=team@appwrite.io
|
|||
_APP_SYSTEM_SECURITY_EMAIL_ADDRESS=security@appwrite.io
|
||||
_APP_SYSTEM_RESPONSE_FORMAT=
|
||||
_APP_OPTIONS_ABUSE=disabled
|
||||
_APP_OPTIONS_ROUTER_PROTECTION=disbled
|
||||
_APP_OPTIONS_FORCE_HTTPS=disabled
|
||||
_APP_OPTIONS_FUNCTIONS_FORCE_HTTPS=disabled
|
||||
_APP_OPENSSL_KEY_V1=your-secret-key
|
||||
_APP_DOMAIN=localhost
|
||||
_APP_DOMAIN_FUNCTIONS=functions.localhost
|
||||
|
|
|
|||
6
.github/workflows/publish.yml
vendored
6
.github/workflows/publish.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
25
CHANGES.md
25
CHANGES.md
|
|
@ -1,3 +1,28 @@
|
|||
# Version 1.4.4
|
||||
|
||||
## Features
|
||||
- Feat: Function domains force https in [#6269](https://github.com/appwrite/appwrite/pull/6269)
|
||||
- Feat: router protection in [#6272](https://github.com/appwrite/appwrite/pull/6272)
|
||||
- Feat: Parse event body in [#6317](https://github.com/appwrite/appwrite/pull/6317)
|
||||
|
||||
## Fixes
|
||||
- Fix: wrong device type in [#6271](https://github.com/appwrite/appwrite/pull/6271)
|
||||
- Fix: build race condition in [#6270](https://github.com/appwrite/appwrite/pull/6270)
|
||||
- Fix: Large builds in [#6273](https://github.com/appwrite/appwrite/pull/6273)
|
||||
- Fix: migrations in [#6302](https://github.com/appwrite/appwrite/pull/6302)
|
||||
- Add Description for Download Deployment in [#6268](https://github.com/appwrite/appwrite/pull/6268)
|
||||
- Fix deployment delete in [#6290](https://github.com/appwrite/appwrite/pull/6290)
|
||||
- Fix project deletion in [#6260](https://github.com/appwrite/appwrite/pull/6260)
|
||||
- fix-6212-Issue-With-Linkedin-OAuth in [#6229](https://github.com/appwrite/appwrite/pull/6229)
|
||||
- Fix: Execution body limit in [#6326](https://github.com/appwrite/appwrite/pull/6326)
|
||||
- Patch: Disable console protection in [#6329](https://github.com/appwrite/appwrite/pull/6329)
|
||||
- converted desc to sentence case in [#5926](https://github.com/appwrite/appwrite/pull/5926)
|
||||
- Update avatar font and default colors in [#6277](https://github.com/appwrite/appwrite/pull/6277)
|
||||
- Bump composer to fix migration bug in [#6344](https://github.com/appwrite/appwrite/pull/6344)
|
||||
- Fix execution call timeout in [#6332](https://github.com/appwrite/appwrite/pull/6332)
|
||||
- Bump appwrite-assistant to prevent it from crashing w/o open ai key in [#6342](https://github.com/appwrite/appwrite/pull/6342)
|
||||
- Remove Special Chars from Initials [#6164](https://github.com/appwrite/appwrite/pull/6164)
|
||||
|
||||
# Version 1.4.3
|
||||
|
||||
## Features
|
||||
|
|
|
|||
|
|
@ -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.3
|
||||
appwrite/appwrite:1.4.4
|
||||
```
|
||||
|
||||
### 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.3
|
||||
appwrite/appwrite:1.4.4
|
||||
```
|
||||
|
||||
#### 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.3
|
||||
appwrite/appwrite:1.4.4
|
||||
```
|
||||
|
||||
运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。
|
||||
|
|
|
|||
|
|
@ -75,7 +75,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.3
|
||||
appwrite/appwrite:1.4.4
|
||||
```
|
||||
|
||||
### Windows
|
||||
|
|
@ -87,7 +87,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.3
|
||||
appwrite/appwrite:1.4.4
|
||||
```
|
||||
|
||||
#### PowerShell
|
||||
|
|
@ -97,7 +97,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.3
|
||||
appwrite/appwrite:1.4.4
|
||||
```
|
||||
|
||||
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.
|
||||
|
|
|
|||
BIN
app/assets/fonts/inter-v8-latin-regular.woff2
Normal file
BIN
app/assets/fonts/inter-v8-latin-regular.woff2
Normal file
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -36,13 +36,31 @@ return [
|
|||
],
|
||||
[
|
||||
'name' => '_APP_OPTIONS_FORCE_HTTPS',
|
||||
'description' => 'Allows you to force HTTPS connection to your API. This feature redirects any HTTP call to HTTPS and adds the \'Strict-Transport-Security\' header to all HTTP responses. By default, set to \'enabled\'. To disable, set to \'disabled\'. This feature will work only when your ports are set to default 80 and 443.',
|
||||
'description' => 'Allows you to force HTTPS connection to your API. This feature redirects any HTTP call to HTTPS and adds the \'Strict-Transport-Security\' header to all HTTP responses. By default, set to \'enabled\'. To disable, set to \'disabled\'. This feature will work only when your ports are set to default 80 and 443, and you have set up wildcard certificates with DNS challenge.',
|
||||
'introduction' => '',
|
||||
'default' => 'disabled',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_OPTIONS_FUNCTIONS_FORCE_HTTPS',
|
||||
'description' => 'Allows you to force HTTPS connection to function domains. This feature redirects any HTTP call to HTTPS and adds the \'Strict-Transport-Security\' header to all HTTP responses. By default, set to \'enabled\'. To disable, set to \'disabled\'. This feature will work only when your ports are set to default 80 and 443.',
|
||||
'introduction' => '',
|
||||
'default' => 'disabled',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_OPTIONS_ROUTER_PROTECTION',
|
||||
'description' => 'Protects server from serving requests from unknown hostnames, and from serving Console for custom project domains. By default, set to \'disabled\'. To start router protection, set to \'enabled\'. It is recommended to enable this variable on production environment.',
|
||||
'introduction' => '1.4.4',
|
||||
'default' => 'disabled',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_OPENSSL_KEY_V1',
|
||||
'description' => 'This is your server private secret key that is used to encrypt all sensitive data on your server. Appwrite server encrypts all secret data on your server like webhooks, HTTP passwords, user sessions, and storage files. The var is not set by default, if you wish to take advantage of Appwrite encryption capabilities you should change it and make sure to **keep it a secret and have a backup for it**.',
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
@ -1348,7 +1348,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')
|
||||
|
|
@ -1464,7 +1464,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')
|
||||
|
|
@ -1648,7 +1648,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')
|
||||
|
|
@ -1669,7 +1669,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')
|
||||
|
|
@ -1692,7 +1692,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')
|
||||
|
|
@ -1731,7 +1731,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')
|
||||
|
|
@ -1792,7 +1792,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')
|
||||
|
|
@ -1837,7 +1837,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')
|
||||
|
|
@ -1871,7 +1871,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')
|
||||
|
|
@ -1938,7 +1938,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')
|
||||
|
|
@ -2008,7 +2008,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')
|
||||
|
|
@ -2067,7 +2067,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')
|
||||
|
|
@ -2101,7 +2101,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')
|
||||
|
|
@ -2145,7 +2145,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')
|
||||
|
|
@ -2221,7 +2221,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')
|
||||
|
|
@ -2307,7 +2307,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')
|
||||
|
|
@ -2368,7 +2368,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')
|
||||
|
|
@ -2551,7 +2551,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')
|
||||
|
|
@ -2639,7 +2639,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')
|
||||
|
|
@ -2800,7 +2800,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')
|
||||
|
|
@ -2861,7 +2861,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')
|
||||
|
|
@ -2957,7 +2957,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')
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
@ -509,12 +509,11 @@ App::get('/v1/avatars/initials')
|
|||
->action(function (string $name, int $width, int $height, string $background, Response $response, Document $user) {
|
||||
|
||||
$themes = [
|
||||
['background' => '#FFA1CE'], // Default (Pink)
|
||||
['background' => '#FDC584'], // Orange
|
||||
['background' => '#94DBD1'], // Green
|
||||
['background' => '#A1C4FF'], // Blue
|
||||
['background' => '#FFA1CE'], // Pink
|
||||
['background' => '#CBB1FC'] // Purple
|
||||
['background' => '#FD366E'], // Default (Pink)
|
||||
['background' => '#FE9567'], // Orange
|
||||
['background' => '#7C67FE'], // Purple
|
||||
['background' => '#68A3FE'], // Blue
|
||||
['background' => '#85DBD8'], // Mint
|
||||
];
|
||||
|
||||
$name = (!empty($name)) ? $name : $user->getAttribute('name', $user->getAttribute('email', ''));
|
||||
|
|
@ -550,8 +549,8 @@ App::get('/v1/avatars/initials')
|
|||
|
||||
$punch->newImage($width, $height, 'transparent');
|
||||
|
||||
$draw->setFont(__DIR__ . "/../../assets/fonts/poppins-v9-latin-500.ttf");
|
||||
$image->setFont(__DIR__ . "/../../assets/fonts/poppins-v9-latin-500.ttf");
|
||||
$draw->setFont(__DIR__ . "/../../assets/fonts/inter-v8-latin-regular.woff2");
|
||||
$image->setFont(__DIR__ . "/../../assets/fonts/inter-v8-latin-regular.woff2");
|
||||
|
||||
$draw->setFillColor(new ImagickPixel('black'));
|
||||
$draw->setFontSize($fontSize);
|
||||
|
|
@ -726,7 +725,7 @@ App::get('/v1/cards/cloud')
|
|||
|
||||
$text = new \ImagickDraw();
|
||||
$text->setTextAlignment(Imagick::ALIGN_CENTER);
|
||||
$text->setFont(__DIR__ . '/../../../public/fonts/Poppins-Bold.ttf');
|
||||
$text->setFont(__DIR__ . '/../../../public/fonts/Inter-Bold.ttf');
|
||||
$text->setFillColor(new \ImagickPixel('#FFFFFF'));
|
||||
|
||||
if (\strlen($name) > 32) {
|
||||
|
|
@ -1110,7 +1109,7 @@ App::get('/v1/cards/cloud-og')
|
|||
|
||||
$textName = new \ImagickDraw();
|
||||
$textName->setTextAlignment(Imagick::ALIGN_CENTER);
|
||||
$textName->setFont(__DIR__ . '/../../../public/fonts/Poppins-Bold.ttf');
|
||||
$textName->setFont(__DIR__ . '/../../../public/fonts/Inter-Bold.ttf');
|
||||
$textName->setFillColor(new \ImagickPixel('#FFFFFF'));
|
||||
|
||||
if (\strlen($name) > 32) {
|
||||
|
|
|
|||
|
|
@ -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])
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -84,6 +84,7 @@ $redeployVcs = function (Request $request, Document $function, Document $project
|
|||
Permission::delete(Role::any()),
|
||||
],
|
||||
'resourceId' => $function->getId(),
|
||||
'resourceInternalId' => $function->getInternalId(),
|
||||
'resourceType' => 'functions',
|
||||
'entrypoint' => $entrypoint,
|
||||
'commands' => $function->getAttribute('commands', ''),
|
||||
|
|
@ -120,7 +121,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 +137,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 +335,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 +410,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 +433,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 +543,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 +647,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 +663,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 +912,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 +974,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 +1021,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')
|
||||
|
|
@ -1079,7 +1080,7 @@ App::post('/v1/functions/:functionId/deployments')
|
|||
}
|
||||
|
||||
$fileExt = new FileExt([FileExt::TYPE_GZIP]);
|
||||
$fileSizeValidator = new FileSize(App::getEnv('_APP_FUNCTIONS_SIZE_LIMIT', 0));
|
||||
$fileSizeValidator = new FileSize(App::getEnv('_APP_FUNCTIONS_SIZE_LIMIT', '30000000'));
|
||||
$upload = new Upload();
|
||||
|
||||
// Make sure we handle a single file and multiple files the same way
|
||||
|
|
@ -1239,7 +1240,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 +1310,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 +1352,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 +1416,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 +1485,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])
|
||||
|
|
@ -1495,7 +1496,7 @@ App::post('/v1/functions/:functionId/executions')
|
|||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_EXECUTION)
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
->param('body', '', new Text(8192, 0), 'HTTP body of execution. Default value is empty string.', true)
|
||||
->param('body', '', new Text(0, 0), 'HTTP body of execution. Default value is empty string.', true)
|
||||
->param('async', false, new Boolean(), 'Execute code in the background. Default value is false.', true)
|
||||
->param('path', '/', new Text(2048), 'HTTP path of execution. Path can include query params. Default value is /', true)
|
||||
->param('method', 'POST', new Whitelist(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'], true), 'HTTP method of execution. Default value is GET.', true)
|
||||
|
|
@ -1773,7 +1774,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 +1849,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 +1897,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 +1961,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 +1988,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 +2027,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 +2088,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')
|
||||
|
|
|
|||
|
|
@ -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])
|
||||
|
|
|
|||
|
|
@ -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])
|
||||
|
|
@ -166,7 +166,7 @@ App::get('/v1/health/cache')
|
|||
});
|
||||
|
||||
App::get('/v1/health/queue')
|
||||
->desc('Get Queue')
|
||||
->desc('Get queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
|
|
@ -223,7 +223,7 @@ App::get('/v1/health/queue')
|
|||
});
|
||||
|
||||
App::get('/v1/health/pubsub')
|
||||
->desc('Get PubSub')
|
||||
->desc('Get pubsub')
|
||||
->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])
|
||||
|
|
@ -387,8 +387,110 @@ App::get('/v1/health/queue/certificates')
|
|||
$response->dynamic(new Document([ 'size' => Resque::size(Event::CERTIFICATES_QUEUE_NAME) ]), Response::MODEL_HEALTH_QUEUE);
|
||||
}, ['response']);
|
||||
|
||||
App::get('/v1/health/queue/builds')
|
||||
->desc('Get builds queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getQueueBuilds')
|
||||
->label('sdk.description', '/docs/references/health/get-queue-builds.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
|
||||
->inject('response')
|
||||
->action(function (Response $response) {
|
||||
|
||||
$response->dynamic(new Document([ 'size' => Resque::size(Event::BUILDS_QUEUE_NAME) ]), Response::MODEL_HEALTH_QUEUE);
|
||||
}, ['response']);
|
||||
|
||||
App::get('/v1/health/queue/databases')
|
||||
->desc('Get databases queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getQueueDatabases')
|
||||
->label('sdk.description', '/docs/references/health/get-queue-databases.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
|
||||
->inject('response')
|
||||
->action(function (Response $response) {
|
||||
|
||||
$response->dynamic(new Document([ 'size' => Resque::size(Event::DATABASE_QUEUE_NAME) ]), Response::MODEL_HEALTH_QUEUE);
|
||||
}, ['response']);
|
||||
|
||||
App::get('/v1/health/queue/deletes')
|
||||
->desc('Get deletes queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getQueueDeletes')
|
||||
->label('sdk.description', '/docs/references/health/get-queue-deletes.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
|
||||
->inject('response')
|
||||
->action(function (Response $response) {
|
||||
|
||||
$response->dynamic(new Document([ 'size' => Resque::size(Event::DELETE_QUEUE_NAME) ]), Response::MODEL_HEALTH_QUEUE);
|
||||
}, ['response']);
|
||||
|
||||
App::get('/v1/health/queue/mails')
|
||||
->desc('Get mails queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getQueueMails')
|
||||
->label('sdk.description', '/docs/references/health/get-queue-mails.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
|
||||
->inject('response')
|
||||
->action(function (Response $response) {
|
||||
|
||||
$response->dynamic(new Document([ 'size' => Resque::size(Event::MAILS_QUEUE_NAME) ]), Response::MODEL_HEALTH_QUEUE);
|
||||
}, ['response']);
|
||||
|
||||
App::get('/v1/health/queue/messaging')
|
||||
->desc('Get messaging queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getQueueMessaging')
|
||||
->label('sdk.description', '/docs/references/health/get-queue-messaging.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
|
||||
->inject('response')
|
||||
->action(function (Response $response) {
|
||||
|
||||
$response->dynamic(new Document([ 'size' => Resque::size(Event::MESSAGING_QUEUE_NAME) ]), Response::MODEL_HEALTH_QUEUE);
|
||||
}, ['response']);
|
||||
|
||||
App::get('/v1/health/queue/migrations')
|
||||
->desc('Get migrations queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'health')
|
||||
->label('sdk.method', 'getQueueMigrations')
|
||||
->label('sdk.description', '/docs/references/health/get-queue-migrations.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
|
||||
->inject('response')
|
||||
->action(function (Response $response) {
|
||||
|
||||
$response->dynamic(new Document([ 'size' => Resque::size(Event::MIGRATIONS_QUEUE_NAME) ]), Response::MODEL_HEALTH_QUEUE);
|
||||
}, ['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 +508,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 +551,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 +590,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])
|
||||
|
|
|
|||
|
|
@ -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])
|
||||
|
|
|
|||
|
|
@ -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'])
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
@ -666,7 +666,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])
|
||||
|
|
@ -750,7 +750,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])
|
||||
|
|
@ -792,7 +792,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')
|
||||
|
|
@ -863,7 +863,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')
|
||||
|
|
@ -998,7 +998,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')
|
||||
|
|
@ -1064,7 +1064,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])
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
@ -381,7 +381,7 @@ App::post('/v1/users/scrypt-modified')
|
|||
});
|
||||
|
||||
App::get('/v1/users')
|
||||
->desc('List Users')
|
||||
->desc('List users')
|
||||
->groups(['api', 'users'])
|
||||
->label('scope', 'users.read')
|
||||
->label('usage.metric', 'users.{scope}.requests.read')
|
||||
|
|
@ -430,7 +430,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')
|
||||
|
|
@ -456,7 +456,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')
|
||||
|
|
@ -484,7 +484,7 @@ App::get('/v1/users/:userId/prefs')
|
|||
});
|
||||
|
||||
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')
|
||||
|
|
@ -526,7 +526,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')
|
||||
|
|
@ -566,7 +566,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')
|
||||
|
|
@ -697,7 +697,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')
|
||||
|
|
@ -734,7 +734,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')
|
||||
|
|
@ -772,7 +772,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')
|
||||
|
|
@ -808,7 +808,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')
|
||||
|
|
@ -846,7 +846,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')
|
||||
|
|
@ -911,7 +911,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')
|
||||
|
|
@ -968,7 +968,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')
|
||||
|
|
@ -1012,7 +1012,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')
|
||||
|
|
@ -1048,7 +1048,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')
|
||||
|
|
@ -1082,7 +1082,7 @@ App::patch('/v1/users/:userId/prefs')
|
|||
});
|
||||
|
||||
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')
|
||||
|
|
@ -1126,7 +1126,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')
|
||||
|
|
@ -1169,7 +1169,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')
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId
|
|||
|
||||
$functionId = $resource->getAttribute('resourceId');
|
||||
$function = Authorization::skip(fn () => $dbForProject->getDocument('functions', $functionId));
|
||||
$functionInternalId = $function->getInternalId();
|
||||
|
||||
$deploymentId = ID::unique();
|
||||
$repositoryId = $resource->getId();
|
||||
|
|
@ -173,6 +174,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId
|
|||
Permission::delete(Role::any()),
|
||||
],
|
||||
'resourceId' => $functionId,
|
||||
'resourceInternalId' => $functionInternalId,
|
||||
'resourceType' => 'functions',
|
||||
'entrypoint' => $function->getAttribute('entrypoint'),
|
||||
'commands' => $function->getAttribute('commands'),
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ Config::setParam('cookieSamesite', Response::COOKIE_SAMESITE_NONE);
|
|||
|
||||
function router(App $utopia, Database $dbForConsole, SwooleRequest $swooleRequest, Request $request, Response $response)
|
||||
{
|
||||
$utopia->getRoute()?->label('error', __DIR__ . '/../views/general/error.phtml');
|
||||
|
||||
$host = $request->getHostname() ?? '';
|
||||
|
||||
$route = Authorization::skip(
|
||||
|
|
@ -57,12 +59,25 @@ function router(App $utopia, Database $dbForConsole, SwooleRequest $swooleReques
|
|||
)[0] ?? null;
|
||||
|
||||
if ($route === null) {
|
||||
if ($host === App::getEnv('_APP_DOMAIN_FUNCTIONS', '')) {
|
||||
throw new AppwriteException(AppwriteException::GENERAL_ACCESS_FORBIDDEN, 'This domain cannot be used for security reasons. Please use any subdomain instead.');
|
||||
}
|
||||
|
||||
if (\str_ends_with($host, App::getEnv('_APP_DOMAIN_FUNCTIONS', ''))) {
|
||||
throw new AppwriteException(AppwriteException::GENERAL_ACCESS_FORBIDDEN, 'This domain is not connected to any Appwrite resource yet. Please configure custom domain or function domain to allow this request.');
|
||||
}
|
||||
|
||||
if (App::getEnv('_APP_OPTIONS_ROUTER_PROTECTION', 'disabled') === 'enabled') {
|
||||
if ($host !== 'localhost' && $host !== APP_HOSTNAME_INTERNAL) { // localhost allowed for proxy, APP_HOSTNAME_INTERNAL allowed for migrations
|
||||
throw new AppwriteException(AppwriteException::GENERAL_ACCESS_FORBIDDEN, 'Router protection does not allow accessing Appwrite over this domain. Please add it as custom domain to your project or disable _APP_OPTIONS_ROUTER_PROTECTION environment variable.');
|
||||
}
|
||||
}
|
||||
|
||||
// Act as API - no Proxy logic
|
||||
$utopia->getRoute()?->label('error', '');
|
||||
return false;
|
||||
}
|
||||
|
||||
$utopia->getRoute()?->label('error', __DIR__ . '/../views/general/error.phtml');
|
||||
|
||||
$projectId = $route->getAttribute('projectId');
|
||||
$project = Authorization::skip(
|
||||
fn () => $dbForConsole->getDocument('projects', $projectId)
|
||||
|
|
@ -83,6 +98,16 @@ function router(App $utopia, Database $dbForConsole, SwooleRequest $swooleReques
|
|||
$type = $route->getAttribute('resourceType');
|
||||
|
||||
if ($type === 'function') {
|
||||
if (App::getEnv('_APP_OPTIONS_FUNCTIONS_FORCE_HTTPS', 'disabled') === 'enabled') { // Force HTTPS
|
||||
if ($request->getProtocol() !== 'https') {
|
||||
if ($request->getMethod() !== Request::METHOD_GET) {
|
||||
throw new AppwriteException(AppwriteException::GENERAL_PROTOCOL_UNSUPPORTED, 'Method unsupported over HTTP. Please use HTTPS instead.');
|
||||
}
|
||||
|
||||
return $response->redirect('https://' . $request->getHostname() . $request->getURI());
|
||||
}
|
||||
}
|
||||
|
||||
$functionId = $route->getAttribute('resourceId');
|
||||
$projectId = $route->getAttribute('projectId');
|
||||
|
||||
|
|
@ -164,6 +189,7 @@ function router(App $utopia, Database $dbForConsole, SwooleRequest $swooleReques
|
|||
throw new AppwriteException(AppwriteException::GENERAL_SERVER_ERROR, 'Unknown resource type ' . $type);
|
||||
}
|
||||
|
||||
$utopia->getRoute()?->label('error', '');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -380,7 +406,7 @@ App::init()
|
|||
if (App::getEnv('_APP_OPTIONS_FORCE_HTTPS', 'disabled') === 'enabled') { // Force HTTPS
|
||||
if ($request->getProtocol() !== 'https' && ($swooleRequest->header['host'] ?? '') !== 'localhost' && ($swooleRequest->header['host'] ?? '') !== APP_HOSTNAME_INTERNAL) { // localhost allowed for proxy, APP_HOSTNAME_INTERNAL allowed for migrations
|
||||
if ($request->getMethod() !== Request::METHOD_GET) {
|
||||
throw new AppwriteException(AppwriteException::GENERAL_PROTOCOL_UNSUPPORTED, 'Method unsupported over HTTP.');
|
||||
throw new AppwriteException(AppwriteException::GENERAL_PROTOCOL_UNSUPPORTED, 'Method unsupported over HTTP. Please use HTTPS instead.');
|
||||
}
|
||||
|
||||
return $response->redirect('https://' . $request->getHostname() . $request->getURI());
|
||||
|
|
|
|||
|
|
@ -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'])
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<?php
|
||||
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\Utopia\Request;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\App;
|
||||
|
|
|
|||
|
|
@ -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 = 510;
|
||||
const APP_VERSION_STABLE = '1.4.3';
|
||||
const APP_CACHE_BUSTER = 511;
|
||||
const APP_VERSION_STABLE = '1.4.4';
|
||||
const APP_DATABASE_ATTRIBUTE_EMAIL = 'email';
|
||||
const APP_DATABASE_ATTRIBUTE_ENUM = 'enum';
|
||||
const APP_DATABASE_ATTRIBUTE_IP = 'ip';
|
||||
|
|
|
|||
|
|
@ -84,7 +84,9 @@ services:
|
|||
- _APP_SYSTEM_SECURITY_EMAIL_ADDRESS
|
||||
- _APP_SYSTEM_RESPONSE_FORMAT
|
||||
- _APP_OPTIONS_ABUSE
|
||||
- _APP_OPTIONS_ROUTER_PROTECTION
|
||||
- _APP_OPTIONS_FORCE_HTTPS
|
||||
- _APP_OPTIONS_FUNCTIONS_FORCE_HTTPS
|
||||
- _APP_OPENSSL_KEY_V1
|
||||
- _APP_DOMAIN
|
||||
- _APP_DOMAIN_TARGET
|
||||
|
|
@ -196,6 +198,7 @@ services:
|
|||
- _APP_ENV
|
||||
- _APP_WORKER_PER_CORE
|
||||
- _APP_OPTIONS_ABUSE
|
||||
- _APP_OPTIONS_ROUTER_PROTECTION
|
||||
- _APP_OPENSSL_KEY_V1
|
||||
- _APP_REDIS_HOST
|
||||
- _APP_REDIS_PORT
|
||||
|
|
@ -381,7 +384,9 @@ services:
|
|||
- _APP_FUNCTIONS_BUILD_TIMEOUT
|
||||
- _APP_FUNCTIONS_CPUS
|
||||
- _APP_FUNCTIONS_MEMORY
|
||||
- _APP_FUNCTIONS_SIZE_LIMIT
|
||||
- _APP_OPTIONS_FORCE_HTTPS
|
||||
- _APP_OPTIONS_FUNCTIONS_FORCE_HTTPS
|
||||
- _APP_DOMAIN
|
||||
- _APP_STORAGE_DEVICE
|
||||
- _APP_STORAGE_S3_ACCESS_KEY
|
||||
|
|
@ -648,7 +653,7 @@ services:
|
|||
- _APP_DB_PASS
|
||||
|
||||
appwrite-assistant:
|
||||
image: appwrite/assistant:0.2.1
|
||||
image: appwrite/assistant:0.2.2
|
||||
container_name: appwrite-assistant
|
||||
<<: *x-logging
|
||||
restart: unless-stopped
|
||||
|
|
@ -662,7 +667,7 @@ services:
|
|||
hostname: appwrite-executor
|
||||
<<: *x-logging
|
||||
stop_signal: SIGINT
|
||||
image: openruntimes/executor:0.4.1
|
||||
image: openruntimes/executor:0.4.2
|
||||
networks:
|
||||
- appwrite
|
||||
- runtimes
|
||||
|
|
|
|||
|
|
@ -112,6 +112,8 @@ class BuildsV1 extends Worker
|
|||
|
||||
$isNewBuild = empty($buildId);
|
||||
|
||||
$deviceFunctions = $this->getFunctionsDevice($project->getId());
|
||||
|
||||
if ($isNewBuild) {
|
||||
$buildId = ID::unique();
|
||||
$build = $dbForProject->createDocument('builds', new Document([
|
||||
|
|
@ -124,7 +126,7 @@ class BuildsV1 extends Worker
|
|||
'path' => '',
|
||||
'runtime' => $function->getAttribute('runtime'),
|
||||
'source' => $deployment->getAttribute('path', ''),
|
||||
'sourceType' => strtolower(App::getEnv('_APP_STORAGE_DEVICE', Storage::DEVICE_LOCAL)),
|
||||
'sourceType' => strtolower($deviceFunctions->getType()),
|
||||
'logs' => '',
|
||||
'endTime' => null,
|
||||
'duration' => 0,
|
||||
|
|
@ -251,17 +253,24 @@ class BuildsV1 extends Worker
|
|||
|
||||
$tmpPath = '/tmp/builds/' . \escapeshellcmd($buildId);
|
||||
$tmpPathFile = $tmpPath . '/code.tar.gz';
|
||||
$localDevice = new Local();
|
||||
|
||||
if (substr($tmpDirectory, -1) !== '/') {
|
||||
$tmpDirectory .= '/';
|
||||
}
|
||||
|
||||
$directorySize = $localDevice->getDirectorySize($tmpDirectory);
|
||||
$functionsSizeLimit = (int) App::getEnv('_APP_FUNCTIONS_SIZE_LIMIT', '30000000');
|
||||
if ($directorySize > $functionsSizeLimit) {
|
||||
throw new Exception('Repository directory size should be less than ' . number_format($functionsSizeLimit / 1048576, 2) . ' MBs.');
|
||||
}
|
||||
|
||||
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());
|
||||
|
||||
$localDevice = new Local();
|
||||
$buffer = $localDevice->read($tmpPathFile);
|
||||
$mimeType = $localDevice->getFileMimeType($tmpPathFile);
|
||||
|
||||
$path = $deviceFunctions->getPath($deployment->getId() . '.' . \pathinfo('code.tar.gz', PATHINFO_EXTENSION));
|
||||
$result = $deviceFunctions->write($path, $buffer, $mimeType);
|
||||
$result = $localDevice->transfer($tmpPathFile, $path, $deviceFunctions);
|
||||
|
||||
if (!$result) {
|
||||
throw new \Exception("Unable to move file");
|
||||
|
|
@ -480,7 +489,7 @@ class BuildsV1 extends Worker
|
|||
* Send realtime Event
|
||||
*/
|
||||
$target = Realtime::fromPayload(
|
||||
// Pass first, most verbose event pattern
|
||||
// Pass first, most verbose event pattern
|
||||
event: $allEvents[0],
|
||||
payload: $build,
|
||||
project: $project
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ use Utopia\Abuse\Adapters\TimeLimit;
|
|||
use Utopia\CLI\Console;
|
||||
use Utopia\Audit\Audit;
|
||||
use Utopia\Database\DateTime;
|
||||
use Utopia\Storage\Device;
|
||||
|
||||
require_once __DIR__ . '/../init.php';
|
||||
|
||||
|
|
@ -71,7 +72,7 @@ class DeletesV1 extends Worker
|
|||
$this->deleteInstallation($document, $project);
|
||||
break;
|
||||
case DELETE_TYPE_RULES:
|
||||
$this->deleteRule($document, $project);
|
||||
$this->deleteRule($document);
|
||||
break;
|
||||
default:
|
||||
if (\str_starts_with($document->getCollection(), 'database_')) {
|
||||
|
|
@ -366,17 +367,8 @@ class DeletesV1 extends Worker
|
|||
$projectId = $document->getId();
|
||||
$projectInternalId = $document->getInternalId();
|
||||
|
||||
// Delete project certificates
|
||||
$dbForConsole = $this->getConsoleDB();
|
||||
|
||||
$domains = $dbForConsole->find('domains', [
|
||||
Query::equal('projectInternalId', [$projectInternalId])
|
||||
]);
|
||||
|
||||
foreach ($domains as $domain) {
|
||||
$this->deleteCertificates($domain);
|
||||
}
|
||||
|
||||
// Delete project tables
|
||||
$dbForProject = $this->getProjectDB($document);
|
||||
|
||||
|
|
@ -397,10 +389,12 @@ class DeletesV1 extends Worker
|
|||
Query::equal('projectInternalId', [$projectInternalId])
|
||||
], $dbForConsole);
|
||||
|
||||
// Delete Domains
|
||||
$this->deleteByGroup('domains', [
|
||||
// Delete project and function rules
|
||||
$this->deleteByGroup('rules', [
|
||||
Query::equal('projectInternalId', [$projectInternalId])
|
||||
], $dbForConsole);
|
||||
], $dbForConsole, function (Document $document) {
|
||||
$this->deleteRule($document);
|
||||
});
|
||||
|
||||
// Delete Keys
|
||||
$this->deleteByGroup('keys', [
|
||||
|
|
@ -620,33 +614,25 @@ class DeletesV1 extends Worker
|
|||
* Delete Deployments
|
||||
*/
|
||||
Console::info("Deleting deployments for function " . $functionId);
|
||||
$storageFunctions = $this->getFunctionsDevice($projectId);
|
||||
$deviceFunctions = $this->getFunctionsDevice($projectId);
|
||||
$deploymentInternalIds = [];
|
||||
$this->deleteByGroup('deployments', [
|
||||
Query::equal('resourceInternalId', [$functionInternalId])
|
||||
], $dbForProject, function (Document $document) use ($storageFunctions, &$deploymentInternalIds) {
|
||||
], $dbForProject, function (Document $document) use ($deviceFunctions, &$deploymentInternalIds) {
|
||||
$deploymentInternalIds[] = $document->getInternalId();
|
||||
if ($storageFunctions->delete($document->getAttribute('path', ''), true)) {
|
||||
Console::success('Deleted deployment files: ' . $document->getAttribute('path', ''));
|
||||
} else {
|
||||
Console::error('Failed to delete deployment files: ' . $document->getAttribute('path', ''));
|
||||
}
|
||||
$this->deleteDeploymentFiles($deviceFunctions, $document);
|
||||
});
|
||||
|
||||
/**
|
||||
* Delete builds
|
||||
*/
|
||||
Console::info("Deleting builds for function " . $functionId);
|
||||
$storageBuilds = $this->getBuildsDevice($projectId);
|
||||
$deviceBuilds = $this->getBuildsDevice($projectId);
|
||||
foreach ($deploymentInternalIds as $deploymentInternalId) {
|
||||
$this->deleteByGroup('builds', [
|
||||
Query::equal('deploymentInternalId', [$deploymentInternalId])
|
||||
], $dbForProject, function (Document $document) use ($storageBuilds) {
|
||||
if ($storageBuilds->delete($document->getAttribute('path', ''), true)) {
|
||||
Console::success('Deleted build files: ' . $document->getAttribute('path', ''));
|
||||
} else {
|
||||
Console::error('Failed to delete build files: ' . $document->getAttribute('path', ''));
|
||||
}
|
||||
], $dbForProject, function (Document $document) use ($deviceBuilds) {
|
||||
$this->deleteBuildFiles($deviceBuilds, $document);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -665,6 +651,58 @@ class DeletesV1 extends Worker
|
|||
$this->deleteRuntimes($document, $project);
|
||||
}
|
||||
|
||||
protected function deleteDeploymentFiles(Device $device, Document $deployment)
|
||||
{
|
||||
$deploymentId = $deployment->getId();
|
||||
$deploymentPath = $deployment->getAttribute('path', '');
|
||||
|
||||
if (empty($deploymentPath)) {
|
||||
Console::info("No deployment files for deployment " . $deploymentId);
|
||||
return;
|
||||
}
|
||||
|
||||
Console::info("Deleting deployment files for deployment " . $deploymentId);
|
||||
|
||||
try {
|
||||
if ($device->delete($deploymentPath, true)) {
|
||||
Console::success('Deleted deployment files: ' . $deploymentPath);
|
||||
} else {
|
||||
Console::error('Failed to delete deployment files: ' . $deploymentPath);
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
Console::error('Failed to delete deployment files: ' . $deploymentPath);
|
||||
Console::error('[Error] Type: ' . get_class($th));
|
||||
Console::error('[Error] Message: ' . $th->getMessage());
|
||||
Console::error('[Error] File: ' . $th->getFile());
|
||||
Console::error('[Error] Line: ' . $th->getLine());
|
||||
}
|
||||
}
|
||||
|
||||
protected function deleteBuildFiles(Device $device, Document $build)
|
||||
{
|
||||
$buildId = $build->getId();
|
||||
$buildPath = $build->getAttribute('path', '');
|
||||
|
||||
if (empty($buildPath)) {
|
||||
Console::info("No build files for build " . $buildId);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if ($device->delete($buildPath, true)) {
|
||||
Console::success('Deleted build files: ' . $buildPath);
|
||||
} else {
|
||||
Console::error('Failed to delete build files: ' . $buildPath);
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
Console::error('Failed to delete deployment files: ' . $buildPath);
|
||||
Console::error('[Error] Type: ' . get_class($th));
|
||||
Console::error('[Error] Message: ' . $th->getMessage());
|
||||
Console::error('[Error] File: ' . $th->getFile());
|
||||
Console::error('[Error] Line: ' . $th->getLine());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Document $document deployment document
|
||||
* @param Document $project
|
||||
|
|
@ -679,27 +717,18 @@ class DeletesV1 extends Worker
|
|||
/**
|
||||
* Delete deployment files
|
||||
*/
|
||||
Console::info("Deleting deployment files for deployment " . $deploymentId);
|
||||
$storageFunctions = $this->getFunctionsDevice($projectId);
|
||||
if ($storageFunctions->delete($document->getAttribute('path', ''), true)) {
|
||||
Console::success('Deleted deployment files: ' . $document->getAttribute('path', ''));
|
||||
} else {
|
||||
Console::error('Failed to delete deployment files: ' . $document->getAttribute('path', ''));
|
||||
}
|
||||
$deviceFunctions = $this->getFunctionsDevice($projectId);
|
||||
$this->deleteDeploymentFiles($deviceFunctions, $document);
|
||||
|
||||
/**
|
||||
* Delete builds
|
||||
*/
|
||||
Console::info("Deleting builds for deployment " . $deploymentId);
|
||||
$storageBuilds = $this->getBuildsDevice($projectId);
|
||||
$deviceBuilds = $this->getBuildsDevice($projectId);
|
||||
$this->deleteByGroup('builds', [
|
||||
Query::equal('deploymentInternalId', [$deploymentInternalId])
|
||||
], $dbForProject, function (Document $document) use ($storageBuilds) {
|
||||
if ($storageBuilds->delete($document->getAttribute('path', ''), true)) {
|
||||
Console::success('Deleted build files: ' . $document->getAttribute('path', ''));
|
||||
} else {
|
||||
Console::error('Failed to delete build files: ' . $document->getAttribute('path', ''));
|
||||
}
|
||||
], $dbForProject, function (Document $document) use ($deviceBuilds) {
|
||||
$this->deleteBuildFiles($deviceBuilds, $document);
|
||||
});
|
||||
|
||||
|
||||
|
|
@ -861,7 +890,7 @@ class DeletesV1 extends Worker
|
|||
* @param Document $document rule document
|
||||
* @param Document $project project document
|
||||
*/
|
||||
protected function deleteRule(Document $document, Document $project): void
|
||||
protected function deleteRule(Document $document): void
|
||||
{
|
||||
$consoleDB = $this->getConsoleDB();
|
||||
|
||||
|
|
|
|||
|
|
@ -363,7 +363,8 @@ $server->job()
|
|||
path: '/',
|
||||
method: 'POST',
|
||||
headers: [
|
||||
'user-agent' => 'Appwrite/' . APP_VERSION_STABLE
|
||||
'user-agent' => 'Appwrite/' . APP_VERSION_STABLE,
|
||||
'content-type' => 'application/json'
|
||||
],
|
||||
);
|
||||
Console::success('Triggered function: ' . $events[0]);
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@
|
|||
"utopia-php/preloader": "0.2.*",
|
||||
"utopia-php/queue": "0.5.*",
|
||||
"utopia-php/registry": "0.5.*",
|
||||
"utopia-php/storage": "0.14.*",
|
||||
"utopia-php/storage": "0.17.*",
|
||||
"utopia-php/swoole": "0.5.*",
|
||||
"utopia-php/vcs": "0.5.*",
|
||||
"utopia-php/websocket": "0.1.*",
|
||||
|
|
|
|||
102
composer.lock
generated
102
composer.lock
generated
|
|
@ -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": "54d54b76790d03a0bcfb9bbd23ed1009",
|
||||
"content-hash": "13a3bdc7c1dec5756bf58ec73a49753d",
|
||||
"packages": [
|
||||
{
|
||||
"name": "adhocore/jwt",
|
||||
|
|
@ -1318,16 +1318,16 @@
|
|||
},
|
||||
{
|
||||
"name": "psr/http-client",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/http-client.git",
|
||||
"reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31"
|
||||
"reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31",
|
||||
"reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31",
|
||||
"url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90",
|
||||
"reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -1364,9 +1364,9 @@
|
|||
"psr-18"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/php-fig/http-client/tree/1.0.2"
|
||||
"source": "https://github.com/php-fig/http-client"
|
||||
},
|
||||
"time": "2023-04-10T20:12:12+00:00"
|
||||
"time": "2023-09-23T14:17:50+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/http-factory",
|
||||
|
|
@ -2152,16 +2152,16 @@
|
|||
},
|
||||
{
|
||||
"name": "utopia-php/database",
|
||||
"version": "0.43.2",
|
||||
"version": "0.43.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/utopia-php/database.git",
|
||||
"reference": "f2626acd42665a9987c94af1c93bf20c28d55c9d"
|
||||
"reference": "58d33c8d1216212edfba5d080e2f698487612aca"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/utopia-php/database/zipball/f2626acd42665a9987c94af1c93bf20c28d55c9d",
|
||||
"reference": "f2626acd42665a9987c94af1c93bf20c28d55c9d",
|
||||
"url": "https://api.github.com/repos/utopia-php/database/zipball/58d33c8d1216212edfba5d080e2f698487612aca",
|
||||
"reference": "58d33c8d1216212edfba5d080e2f698487612aca",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -2202,9 +2202,9 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/utopia-php/database/issues",
|
||||
"source": "https://github.com/utopia-php/database/tree/0.43.2"
|
||||
"source": "https://github.com/utopia-php/database/tree/0.43.3"
|
||||
},
|
||||
"time": "2023-09-07T19:04:33+00:00"
|
||||
"time": "2023-09-28T01:51:22+00:00"
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/domains",
|
||||
|
|
@ -2564,16 +2564,16 @@
|
|||
},
|
||||
{
|
||||
"name": "utopia-php/migration",
|
||||
"version": "0.3.4",
|
||||
"version": "0.3.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/utopia-php/migration.git",
|
||||
"reference": "ade836d61b3e1547bc9f0dc300ee75b24ab49f7a"
|
||||
"reference": "b2fd3a8310296f4e44ff0e85b0eb0230ad9a2f83"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/utopia-php/migration/zipball/ade836d61b3e1547bc9f0dc300ee75b24ab49f7a",
|
||||
"reference": "ade836d61b3e1547bc9f0dc300ee75b24ab49f7a",
|
||||
"url": "https://api.github.com/repos/utopia-php/migration/zipball/b2fd3a8310296f4e44ff0e85b0eb0230ad9a2f83",
|
||||
"reference": "b2fd3a8310296f4e44ff0e85b0eb0230ad9a2f83",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -2596,16 +2596,6 @@
|
|||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Eldad Fux",
|
||||
"email": "eldad@appwrite.io"
|
||||
},
|
||||
{
|
||||
"name": "Bradley Schofield",
|
||||
"email": "bradley@appwrite.io"
|
||||
}
|
||||
],
|
||||
"description": "A simple library to migrate resources between services.",
|
||||
"keywords": [
|
||||
"framework",
|
||||
|
|
@ -2616,9 +2606,9 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/utopia-php/migration/issues",
|
||||
"source": "https://github.com/utopia-php/migration/tree/0.3.4"
|
||||
"source": "https://github.com/utopia-php/migration/tree/0.3.5"
|
||||
},
|
||||
"time": "2023-09-14T17:17:55+00:00"
|
||||
"time": "2023-09-25T16:51:47+00:00"
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/mongo",
|
||||
|
|
@ -2998,16 +2988,16 @@
|
|||
},
|
||||
{
|
||||
"name": "utopia-php/storage",
|
||||
"version": "0.14.0",
|
||||
"version": "0.17.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/utopia-php/storage.git",
|
||||
"reference": "eda6651ac16884dc2a79ecb984ea591ba1ed498c"
|
||||
"reference": "efec5376c02d3d8330f1beb1469e6d6e313e21ee"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/utopia-php/storage/zipball/eda6651ac16884dc2a79ecb984ea591ba1ed498c",
|
||||
"reference": "eda6651ac16884dc2a79ecb984ea591ba1ed498c",
|
||||
"url": "https://api.github.com/repos/utopia-php/storage/zipball/efec5376c02d3d8330f1beb1469e6d6e313e21ee",
|
||||
"reference": "efec5376c02d3d8330f1beb1469e6d6e313e21ee",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -3015,10 +3005,12 @@
|
|||
"ext-fileinfo": "*",
|
||||
"ext-lz4": "*",
|
||||
"ext-snappy": "*",
|
||||
"ext-xz": "*",
|
||||
"ext-zlib": "*",
|
||||
"ext-zstd": "*",
|
||||
"php": ">=8.0",
|
||||
"utopia-php/framework": "0.*.*"
|
||||
"utopia-php/framework": "0.*.*",
|
||||
"utopia-php/system": "0.*.*"
|
||||
},
|
||||
"require-dev": {
|
||||
"laravel/pint": "1.2.*",
|
||||
|
|
@ -3045,9 +3037,9 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/utopia-php/storage/issues",
|
||||
"source": "https://github.com/utopia-php/storage/tree/0.14.0"
|
||||
"source": "https://github.com/utopia-php/storage/tree/0.17.0"
|
||||
},
|
||||
"time": "2023-03-15T00:16:34+00:00"
|
||||
"time": "2023-08-21T11:28:36+00:00"
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/swoole",
|
||||
|
|
@ -3442,16 +3434,16 @@
|
|||
},
|
||||
{
|
||||
"name": "doctrine/deprecations",
|
||||
"version": "v1.1.1",
|
||||
"version": "1.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/deprecations.git",
|
||||
"reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3"
|
||||
"reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/612a3ee5ab0d5dd97b7cf3874a6efe24325efac3",
|
||||
"reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3",
|
||||
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/4f2d4f2836e7ec4e7a8625e75c6aa916004db931",
|
||||
"reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -3483,9 +3475,9 @@
|
|||
"homepage": "https://www.doctrine-project.org/",
|
||||
"support": {
|
||||
"issues": "https://github.com/doctrine/deprecations/issues",
|
||||
"source": "https://github.com/doctrine/deprecations/tree/v1.1.1"
|
||||
"source": "https://github.com/doctrine/deprecations/tree/1.1.2"
|
||||
},
|
||||
"time": "2023-06-03T09:27:29+00:00"
|
||||
"time": "2023-09-27T20:04:15+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/instantiator",
|
||||
|
|
@ -4145,16 +4137,16 @@
|
|||
},
|
||||
{
|
||||
"name": "phpstan/phpdoc-parser",
|
||||
"version": "1.24.0",
|
||||
"version": "1.24.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpstan/phpdoc-parser.git",
|
||||
"reference": "3510b0a6274cc42f7219367cb3abfc123ffa09d6"
|
||||
"reference": "bcad8d995980440892759db0c32acae7c8e79442"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/3510b0a6274cc42f7219367cb3abfc123ffa09d6",
|
||||
"reference": "3510b0a6274cc42f7219367cb3abfc123ffa09d6",
|
||||
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/bcad8d995980440892759db0c32acae7c8e79442",
|
||||
"reference": "bcad8d995980440892759db0c32acae7c8e79442",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -4186,22 +4178,22 @@
|
|||
"description": "PHPDoc parser with support for nullable, intersection and generic types",
|
||||
"support": {
|
||||
"issues": "https://github.com/phpstan/phpdoc-parser/issues",
|
||||
"source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.0"
|
||||
"source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.2"
|
||||
},
|
||||
"time": "2023-09-07T20:46:32+00:00"
|
||||
"time": "2023-09-26T12:28:12+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
"version": "9.2.28",
|
||||
"version": "9.2.29",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
||||
"reference": "7134a5ccaaf0f1c92a4f5501a6c9f98ac4dcc0ef"
|
||||
"reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7134a5ccaaf0f1c92a4f5501a6c9f98ac4dcc0ef",
|
||||
"reference": "7134a5ccaaf0f1c92a4f5501a6c9f98ac4dcc0ef",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6a3a87ac2bbe33b25042753df8195ba4aa534c76",
|
||||
"reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -4258,7 +4250,7 @@
|
|||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
|
||||
"security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
|
||||
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.28"
|
||||
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.29"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
|
@ -4266,7 +4258,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2023-09-12T14:36:20+00:00"
|
||||
"time": "2023-09-19T04:57:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-file-iterator",
|
||||
|
|
@ -6027,5 +6019,5 @@
|
|||
"platform-overrides": {
|
||||
"php": "8.0"
|
||||
},
|
||||
"plugin-api-version": "2.6.0"
|
||||
"plugin-api-version": "2.3.0"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,7 +105,9 @@ services:
|
|||
- _APP_SYSTEM_SECURITY_EMAIL_ADDRESS
|
||||
- _APP_SYSTEM_RESPONSE_FORMAT
|
||||
- _APP_OPTIONS_ABUSE
|
||||
- _APP_OPTIONS_ROUTER_PROTECTION
|
||||
- _APP_OPTIONS_FORCE_HTTPS
|
||||
- _APP_OPTIONS_FUNCTIONS_FORCE_HTTPS
|
||||
- _APP_OPENSSL_KEY_V1
|
||||
- _APP_DOMAIN
|
||||
- _APP_DOMAIN_TARGET
|
||||
|
|
@ -222,6 +224,7 @@ services:
|
|||
- _APP_ENV
|
||||
- _APP_WORKER_PER_CORE
|
||||
- _APP_OPTIONS_ABUSE
|
||||
- _APP_OPTIONS_ROUTER_PROTECTION
|
||||
- _APP_OPENSSL_KEY_V1
|
||||
- _APP_REDIS_HOST
|
||||
- _APP_REDIS_PORT
|
||||
|
|
@ -416,7 +419,9 @@ services:
|
|||
- _APP_FUNCTIONS_BUILD_TIMEOUT
|
||||
- _APP_FUNCTIONS_CPUS
|
||||
- _APP_FUNCTIONS_MEMORY
|
||||
- _APP_FUNCTIONS_SIZE_LIMIT
|
||||
- _APP_OPTIONS_FORCE_HTTPS
|
||||
- _APP_OPTIONS_FUNCTIONS_FORCE_HTTPS
|
||||
- _APP_DOMAIN
|
||||
- _APP_STORAGE_DEVICE
|
||||
- _APP_STORAGE_S3_ACCESS_KEY
|
||||
|
|
@ -705,7 +710,7 @@ services:
|
|||
|
||||
appwrite-assistant:
|
||||
container_name: appwrite-assistant
|
||||
image: appwrite/assistant:0.2.1
|
||||
image: appwrite/assistant:0.2.2
|
||||
networks:
|
||||
- appwrite
|
||||
environment:
|
||||
|
|
@ -716,7 +721,7 @@ services:
|
|||
hostname: appwrite-executor
|
||||
<<: *x-logging
|
||||
stop_signal: SIGINT
|
||||
image: openruntimes/executor:0.4.1
|
||||
image: openruntimes/executor:0.4.2
|
||||
networks:
|
||||
- appwrite
|
||||
- runtimes
|
||||
|
|
|
|||
1
docs/references/functions/download-deployment.md
Normal file
1
docs/references/functions/download-deployment.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
Get a Deployment's contents by its unique ID. This endpoint supports range requests for partial or streaming file download.
|
||||
1
docs/references/health/get-queue-builds.md
Normal file
1
docs/references/health/get-queue-builds.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
Get the number of builds that are waiting to be processed in the Appwrite internal queue server.
|
||||
1
docs/references/health/get-queue-databases.md
Normal file
1
docs/references/health/get-queue-databases.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
Get the number of database changes that are waiting to be processed in the Appwrite internal queue server.
|
||||
1
docs/references/health/get-queue-deletes.md
Normal file
1
docs/references/health/get-queue-deletes.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server.
|
||||
1
docs/references/health/get-queue-mails.md
Normal file
1
docs/references/health/get-queue-mails.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
Get the number of mails that are waiting to be processed in the Appwrite internal queue server.
|
||||
1
docs/references/health/get-queue-messaging.md
Normal file
1
docs/references/health/get-queue-messaging.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
Get the number of messages that are waiting to be processed in the Appwrite internal queue server.
|
||||
1
docs/references/health/get-queue-migrations.md
Normal file
1
docs/references/health/get-queue-migrations.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
Get the number of migrations that are waiting to be processed in the Appwrite internal queue server.
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
25
src/Appwrite/Event/Validator/FunctionEvent.php
Normal file
25
src/Appwrite/Event/Validator/FunctionEvent.php
Normal 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);
|
||||
}
|
||||
}
|
||||
|
|
@ -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':
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ abstract class Migration
|
|||
'1.4.1' => 'V19',
|
||||
'1.4.2' => 'V19',
|
||||
'1.4.3' => 'V19',
|
||||
'1.4.4' => 'V19',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -93,6 +93,12 @@ class Doctor extends Action
|
|||
Console::log('🟢 HTTPS force option is enabled');
|
||||
}
|
||||
|
||||
if ('enabled' !== App::getEnv('_APP_OPTIONS_FUNCTIONS_FORCE_HTTPS', 'disabled')) {
|
||||
Console::log('🔴 HTTPS force option is disabled for function domains');
|
||||
} else {
|
||||
Console::log('🟢 HTTPS force option is enabled for function domains');
|
||||
}
|
||||
|
||||
$providerName = App::getEnv('_APP_LOGGING_PROVIDER', '');
|
||||
$providerConfig = App::getEnv('_APP_LOGGING_CONFIG', '');
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class Executor
|
|||
array $variables = [],
|
||||
string $command = null,
|
||||
) {
|
||||
$runtimeId = "$projectId-$deploymentId";
|
||||
$runtimeId = "$projectId-$deploymentId-build";
|
||||
$route = "/runtimes";
|
||||
$params = [
|
||||
'runtimeId' => $runtimeId,
|
||||
|
|
@ -202,7 +202,9 @@ class Executor
|
|||
'runtimeEntrypoint' => $runtimeEntrypoint,
|
||||
];
|
||||
|
||||
$timeout = (int) App::getEnv('_APP_FUNCTIONS_BUILD_TIMEOUT', 900);
|
||||
// Safety timeout. Executor has timeout, and open runtime has soft timeout.
|
||||
// This one shouldn't really happen, but prevents from unexpected networking behaviours.
|
||||
$timeout = $timeout + 15;
|
||||
|
||||
$response = $this->call(self::METHOD_POST, $route, [ 'x-opr-runtime-id' => $runtimeId ], $params, true, $timeout);
|
||||
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ trait AvatarsBase
|
|||
$response = $this->client->call(Client::METHOD_GET, '/avatars/image', [
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], [
|
||||
'url' => 'https://appwrite.io/images/apple.png',
|
||||
'url' => 'https://appwrite.io/images/open-graph/website.png',
|
||||
]);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
|
|
@ -212,7 +212,7 @@ trait AvatarsBase
|
|||
$response = $this->client->call(Client::METHOD_GET, '/avatars/image', [
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], [
|
||||
'url' => 'https://appwrite.io/images/apple.png',
|
||||
'url' => 'https://appwrite.io/images/open-graph/website.png',
|
||||
'width' => 200,
|
||||
'height' => 200,
|
||||
]);
|
||||
|
|
@ -224,7 +224,7 @@ trait AvatarsBase
|
|||
$response = $this->client->call(Client::METHOD_GET, '/avatars/image', [
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], [
|
||||
'url' => 'https://appwrite.io/images/apple.png',
|
||||
'url' => 'https://appwrite.io/images/open-graph/website.png',
|
||||
'width' => 300,
|
||||
'height' => 300,
|
||||
'quality' => 30,
|
||||
|
|
@ -251,7 +251,7 @@ trait AvatarsBase
|
|||
$response = $this->client->call(Client::METHOD_GET, '/avatars/image', [
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], [
|
||||
'url' => 'https://appwrite.io/images/apple.png',
|
||||
'url' => 'https://appwrite.io/images/open-graph/website.png',
|
||||
'width' => 2001,
|
||||
'height' => 300,
|
||||
'quality' => 30,
|
||||
|
|
@ -280,11 +280,11 @@ trait AvatarsBase
|
|||
$response = $this->client->call(Client::METHOD_GET, '/avatars/favicon', [
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], [
|
||||
'url' => 'https://appwrite.io/',
|
||||
'url' => 'https://github.com/',
|
||||
]);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertEquals('image/png', $response['headers']['content-type']);
|
||||
$this->assertEquals('image/x-icon', $response['headers']['content-type']);
|
||||
$this->assertNotEmpty($response['body']);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ class FunctionsCustomServerTest extends Scope
|
|||
'runtime' => 'php-8.0',
|
||||
'entrypoint' => 'index.php',
|
||||
'events' => [
|
||||
'users.*.create',
|
||||
'users.*.delete',
|
||||
'buckets.*.create',
|
||||
'buckets.*.delete',
|
||||
],
|
||||
'schedule' => '0 0 1 1 *',
|
||||
'timeout' => 10,
|
||||
|
|
@ -50,8 +50,8 @@ class FunctionsCustomServerTest extends Scope
|
|||
$this->assertEquals(true, $dateValidator->isValid($response1['body']['$updatedAt']));
|
||||
$this->assertEquals('', $response1['body']['deployment']);
|
||||
$this->assertEquals([
|
||||
'users.*.create',
|
||||
'users.*.delete',
|
||||
'buckets.*.create',
|
||||
'buckets.*.delete',
|
||||
], $response1['body']['events']);
|
||||
$this->assertEquals('0 0 1 1 *', $response1['body']['schedule']);
|
||||
$this->assertEquals(10, $response1['body']['timeout']);
|
||||
|
|
@ -191,8 +191,8 @@ class FunctionsCustomServerTest extends Scope
|
|||
'runtime' => 'php-8.0',
|
||||
'entrypoint' => 'index.php',
|
||||
'events' => [
|
||||
'users.*.create',
|
||||
'users.*.delete',
|
||||
'buckets.*.create',
|
||||
'buckets.*.delete',
|
||||
],
|
||||
'schedule' => '0 0 1 1 *',
|
||||
'timeout' => 10,
|
||||
|
|
@ -1231,4 +1231,117 @@ class FunctionsCustomServerTest extends Scope
|
|||
$this->assertArrayHasKey('base', $runtime);
|
||||
$this->assertArrayHasKey('supports', $runtime);
|
||||
}
|
||||
|
||||
|
||||
public function testEventTrigger()
|
||||
{
|
||||
$timeout = 5;
|
||||
$code = realpath(__DIR__ . '/../../../resources/functions') . "/php-event/code.tar.gz";
|
||||
$this->packageCode('php-event');
|
||||
|
||||
$function = $this->client->call(Client::METHOD_POST, '/functions', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), [
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test PHP Event executions',
|
||||
'runtime' => 'php-8.0',
|
||||
'entrypoint' => 'index.php',
|
||||
'events' => [
|
||||
'users.*.create',
|
||||
],
|
||||
'timeout' => $timeout,
|
||||
]);
|
||||
|
||||
$functionId = $function['body']['$id'] ?? '';
|
||||
|
||||
$this->assertEquals(201, $function['headers']['status-code']);
|
||||
|
||||
$deployment = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/deployments', array_merge([
|
||||
'content-type' => 'multipart/form-data',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), [
|
||||
'entrypoint' => 'index.php',
|
||||
'code' => new CURLFile($code, 'application/x-gzip', basename($code)),
|
||||
'activate' => true
|
||||
]);
|
||||
|
||||
$deploymentId = $deployment['body']['$id'] ?? '';
|
||||
$this->assertEquals(202, $deployment['headers']['status-code']);
|
||||
|
||||
// Poll until deployment is built
|
||||
while (true) {
|
||||
$deployment = $this->client->call(Client::METHOD_GET, '/functions/' . $function['body']['$id'] . '/deployments/' . $deploymentId, [
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey'],
|
||||
]);
|
||||
|
||||
if (
|
||||
$deployment['headers']['status-code'] >= 400
|
||||
|| \in_array($deployment['body']['status'], ['ready', 'failed'])
|
||||
) {
|
||||
break;
|
||||
}
|
||||
|
||||
\sleep(1);
|
||||
}
|
||||
|
||||
$deployment = $this->client->call(Client::METHOD_PATCH, '/functions/' . $functionId . '/deployments/' . $deploymentId, array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), []);
|
||||
|
||||
$this->assertEquals(200, $deployment['headers']['status-code']);
|
||||
|
||||
// Wait a little for activation to finish
|
||||
sleep(5);
|
||||
|
||||
// Create user to trigger event
|
||||
$user = $this->client->call(Client::METHOD_POST, '/users', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), [
|
||||
'userId' => 'unique()',
|
||||
'name' => 'Event User'
|
||||
]);
|
||||
|
||||
$userId = $user['body']['$id'];
|
||||
|
||||
$this->assertEquals(201, $user['headers']['status-code']);
|
||||
|
||||
// Wait for execution to occur
|
||||
sleep(15);
|
||||
|
||||
$executions = $this->client->call(Client::METHOD_GET, '/functions/' . $functionId . '/executions', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()));
|
||||
|
||||
$execution = $executions['body']['executions'][0];
|
||||
|
||||
$this->assertEquals(200, $executions['headers']['status-code']);
|
||||
$this->assertEquals('completed', $execution['status']);
|
||||
$this->assertEquals(204, $execution['responseStatusCode']);
|
||||
$this->assertStringContainsString($userId, $execution['logs']);
|
||||
$this->assertStringContainsString('Event User', $execution['logs']);
|
||||
|
||||
// Cleanup : Delete function
|
||||
$response = $this->client->call(Client::METHOD_DELETE, '/functions/' . $functionId, [
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey'],
|
||||
], []);
|
||||
|
||||
$this->assertEquals(204, $response['headers']['status-code']);
|
||||
|
||||
// Cleanup : Delete user
|
||||
$response = $this->client->call(Client::METHOD_DELETE, '/users/' . $userId, [
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey'],
|
||||
], []);
|
||||
|
||||
$this->assertEquals(204, $response['headers']['status-code']);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ class AvatarsTest extends Scope
|
|||
'x-appwrite-project' => $projectId,
|
||||
], $this->getHeaders()), $graphQLPayload);
|
||||
|
||||
$this->assertEquals(4959, \strlen($initials['body']));
|
||||
$this->assertEquals(5041, \strlen($initials['body']));
|
||||
|
||||
return $initials['body'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,10 +29,6 @@ class HealthCustomServerTest extends Scope
|
|||
$this->assertIsInt($response['body']['ping']);
|
||||
$this->assertLessThan(100, $response['body']['ping']);
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
*/
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
@ -51,10 +47,6 @@ class HealthCustomServerTest extends Scope
|
|||
$this->assertIsInt($response['body']['statuses'][0]['ping']);
|
||||
$this->assertLessThan(100, $response['body']['statuses'][0]['ping']);
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
*/
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
@ -73,10 +65,6 @@ class HealthCustomServerTest extends Scope
|
|||
$this->assertIsInt($response['body']['statuses'][0]['ping']);
|
||||
$this->assertLessThan(100, $response['body']['statuses'][0]['ping']);
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
*/
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
@ -95,10 +83,6 @@ class HealthCustomServerTest extends Scope
|
|||
$this->assertIsInt($response['body']['statuses'][0]['ping']);
|
||||
$this->assertLessThan(100, $response['body']['statuses'][0]['ping']);
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
*/
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
@ -117,10 +101,6 @@ class HealthCustomServerTest extends Scope
|
|||
$this->assertIsInt($response['body']['statuses'][0]['ping']);
|
||||
$this->assertLessThan(100, $response['body']['statuses'][0]['ping']);
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
*/
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
@ -141,10 +121,6 @@ class HealthCustomServerTest extends Scope
|
|||
$this->assertNotEmpty($response['body']['localTime']);
|
||||
$this->assertLessThan(10, $response['body']['diff']);
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
*/
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
@ -162,10 +138,6 @@ class HealthCustomServerTest extends Scope
|
|||
$this->assertIsInt($response['body']['size']);
|
||||
$this->assertLessThan(100, $response['body']['size']);
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
*/
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
@ -183,10 +155,6 @@ class HealthCustomServerTest extends Scope
|
|||
$this->assertIsInt($response['body']['size']);
|
||||
$this->assertLessThan(100, $response['body']['size']);
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
*/
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
@ -204,9 +172,124 @@ class HealthCustomServerTest extends Scope
|
|||
$this->assertIsInt($response['body']['size']);
|
||||
$this->assertLessThan(100, $response['body']['size']);
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public function testFunctionsSuccess(): array
|
||||
{
|
||||
/**
|
||||
* Test for FAILURE
|
||||
* Test for SUCCESS
|
||||
*/
|
||||
$response = $this->client->call(Client::METHOD_GET, '/health/queue/functions', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), []);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertIsInt($response['body']['size']);
|
||||
$this->assertLessThan(100, $response['body']['size']);
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public function testBuildsSuccess(): array
|
||||
{
|
||||
/**
|
||||
* Test for SUCCESS
|
||||
*/
|
||||
$response = $this->client->call(Client::METHOD_GET, '/health/queue/builds', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), []);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertIsInt($response['body']['size']);
|
||||
$this->assertLessThan(100, $response['body']['size']);
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public function testDatabasesSuccess(): array
|
||||
{
|
||||
/**
|
||||
* Test for SUCCESS
|
||||
*/
|
||||
$response = $this->client->call(Client::METHOD_GET, '/health/queue/databases', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), []);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertIsInt($response['body']['size']);
|
||||
$this->assertLessThan(100, $response['body']['size']);
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public function testDeletesSuccess(): array
|
||||
{
|
||||
/**
|
||||
* Test for SUCCESS
|
||||
*/
|
||||
$response = $this->client->call(Client::METHOD_GET, '/health/queue/deletes', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), []);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertIsInt($response['body']['size']);
|
||||
$this->assertLessThan(100, $response['body']['size']);
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public function testMailsSuccess(): array
|
||||
{
|
||||
/**
|
||||
* Test for SUCCESS
|
||||
*/
|
||||
$response = $this->client->call(Client::METHOD_GET, '/health/queue/mails', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), []);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertIsInt($response['body']['size']);
|
||||
$this->assertLessThan(100, $response['body']['size']);
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public function testMessagingSuccess(): array
|
||||
{
|
||||
/**
|
||||
* Test for SUCCESS
|
||||
*/
|
||||
$response = $this->client->call(Client::METHOD_GET, '/health/queue/messaging', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), []);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertIsInt($response['body']['size']);
|
||||
$this->assertLessThan(100, $response['body']['size']);
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public function testMigrationsSuccess(): array
|
||||
{
|
||||
/**
|
||||
* Test for SUCCESS
|
||||
*/
|
||||
$response = $this->client->call(Client::METHOD_GET, '/health/queue/migrations', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), []);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertIsInt($response['body']['size']);
|
||||
$this->assertLessThan(100, $response['body']['size']);
|
||||
|
||||
return [];
|
||||
}
|
||||
|
|
@ -226,10 +309,6 @@ class HealthCustomServerTest extends Scope
|
|||
$this->assertIsInt($response['body']['ping']);
|
||||
$this->assertLessThan(100, $response['body']['ping']);
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
*/
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
@ -248,10 +327,6 @@ class HealthCustomServerTest extends Scope
|
|||
$this->assertIsString($response['body']['status']);
|
||||
$this->assertIsString($response['body']['version']);
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
*/
|
||||
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -595,6 +595,18 @@ trait UsersBase
|
|||
$this->assertCount(1, $response['body']['users']);
|
||||
$this->assertEquals($response['body']['users'][0]['$id'], $data['userId']);
|
||||
|
||||
$response = $this->client->call(Client::METHOD_GET, '/users', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), [
|
||||
'search' => '>',
|
||||
]);
|
||||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertNotEmpty($response['body']);
|
||||
$this->assertEmpty($response['body']['users']);
|
||||
$this->assertCount(0, $response['body']['users']);
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -66,7 +66,9 @@ services:
|
|||
environment:
|
||||
- _APP_ENV
|
||||
- _APP_OPTIONS_ABUSE
|
||||
- _APP_OPTIONS_ROUTER_PROTECTION
|
||||
- _APP_OPTIONS_FORCE_HTTPS
|
||||
- _APP_OPTIONS_FUNCTIONS_FORCE_HTTPS
|
||||
- _APP_OPENSSL_KEY_V1
|
||||
- _APP_DOMAIN
|
||||
- _APP_DOMAIN_FUNCTIONS
|
||||
|
|
|
|||
8
tests/resources/functions/php-event/index.php
Normal file
8
tests/resources/functions/php-event/index.php
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
|
||||
return function ($context) {
|
||||
$context->log($context->req->body['$id']);
|
||||
$context->log($context->req->body['name']);
|
||||
|
||||
return $context->res->empty();
|
||||
};
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 3 KiB |
|
|
@ -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.*'));
|
||||
|
|
|
|||
73
tests/unit/Event/Validator/FunctionEventValidatorTest.php
Normal file
73
tests/unit/Event/Validator/FunctionEventValidatorTest.php
Normal 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.*'));
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue