1
0
Fork 0
mirror of synced 2024-06-27 02:31:04 +12:00

Merge remote-tracking branch 'origin/master' into feat-graphql-support

# Conflicts:
#	composer.lock
This commit is contained in:
Jake Barnby 2022-04-26 19:50:49 +12:00
commit 5127602c9e
No known key found for this signature in database
GPG key ID: A4674EBC0E404657
232 changed files with 1327 additions and 2229 deletions

4
.env
View file

@ -45,6 +45,7 @@ _APP_SMTP_SECURE=
_APP_SMTP_USERNAME=
_APP_SMTP_PASSWORD=
_APP_STORAGE_LIMIT=30000000
_APP_STORAGE_PREVIEW_LIMIT=20000000
_APP_FUNCTIONS_SIZE_LIMIT=30000000
_APP_FUNCTIONS_TIMEOUT=900
_APP_FUNCTIONS_BUILD_TIMEOUT=900
@ -53,8 +54,9 @@ _APP_FUNCTIONS_CPUS=0
_APP_FUNCTIONS_MEMORY=0
_APP_FUNCTIONS_MEMORY_SWAP=0
_APP_FUNCTIONS_INACTIVE_THRESHOLD=60
_APP_EXECUTOR_RUNTIME_NETWORK=appwrite_runtimes
OPEN_RUNTIMES_NETWORK=appwrite_runtimes
_APP_EXECUTOR_SECRET=your-secret-key
_APP_EXECUTOR_HOST=http://appwrite-executor/v1
_APP_MAINTENANCE_INTERVAL=86400
_APP_MAINTENANCE_RETENTION_EXECUTION=1209600
_APP_MAINTENANCE_RETENTION_ABUSE=86400

View file

@ -1,3 +1,6 @@
# Unreleased Version
- Renamed `providers` to `authProviders` in project collection **Breaking Change**
# Version 0.13.4
## Features

View file

@ -24,7 +24,7 @@ COPY public /usr/local/src/public
RUN npm ci
RUN npm run build
FROM php:8.0.14-cli-alpine3.15 as compile
FROM php:8.0.18-cli-alpine3.15 as compile
ARG DEBUG=false
ENV DEBUG=$DEBUG
@ -123,7 +123,7 @@ RUN \
./configure && \
make && make install
FROM php:8.0.14-cli-alpine3.15 as final
FROM php:8.0.18-cli-alpine3.15 as final
LABEL maintainer="team@appwrite.io"
@ -185,6 +185,7 @@ ENV _APP_SERVER=swoole \
_APP_FUNCTIONS_MEMORY=128 \
_APP_FUNCTIONS_MEMORY_SWAP=128 \
_APP_EXECUTOR_SECRET=a-random-secret \
_APP_EXECUTOR_HOST=http://appwrite-executor/v1 \
_APP_EXECUTOR_RUNTIME_NETWORK=appwrite_runtimes \
_APP_SETUP=self-hosted \
_APP_VERSION=$VERSION \

View file

@ -20,7 +20,7 @@
Appwrite是一个基于Docker的端到端开发者平台其容器化的微服务库可应用于网页端移动端以及后端。Appwrite 通过视觉化界面极简了从零编写 API 的繁琐过程,在保证软件安全的前提下为开发者创造了一个高效的开发环境。
Appwrite 可以提供给开发者用户验证,外部授权,用户数据读写检索,文件储存, 图像处理,云函数计算,[等多种服务](https://appwrite.io/docs).
Appwrite 可以提供给开发者用户验证,外部授权,用户数据读写检索,文件储存图像处理,云函数计算,[等多种服务](https://appwrite.io/docs).
![Appwrite](public/images/github.png)
@ -168,4 +168,4 @@ Appwrite API 界面层利用后台缓存和任务委派来提供极速的响应
## 版权说明
版权详情,访问 [BSD 3-Clause License](./LICENSE)。
版权详情,访问 [BSD 3-Clause License](./LICENSE)。

View file

@ -512,7 +512,7 @@ $collections = [
'filters' => ['json'],
],
[
'$id' => 'providers',
'$id' => 'authProviders',
'type' => Database::VAR_STRING,
'format' => '',
'size' => 16384,

View file

@ -63,7 +63,7 @@ return [
[
'key' => 'flutter',
'name' => 'Flutter',
'version' => '4.0.1',
'version' => '4.0.2',
'url' => 'https://github.com/appwrite/sdk-for-flutter',
'package' => 'https://pub.dev/packages/appwrite',
'enabled' => true,
@ -81,7 +81,7 @@ return [
[
'key' => 'apple',
'name' => 'Apple',
'version' => '0.3.0',
'version' => '0.4.0',
'url' => 'https://github.com/appwrite/sdk-for-apple',
'package' => 'https://github.com/appwrite/sdk-for-apple',
'enabled' => true,
@ -116,7 +116,7 @@ return [
[
'key' => 'android',
'name' => 'Android',
'version' => '0.4.0',
'version' => '0.5.0',
'url' => 'https://github.com/appwrite/sdk-for-android',
'package' => 'https://search.maven.org/artifact/io.appwrite/sdk-for-android',
'enabled' => true,
@ -180,7 +180,7 @@ return [
[
'key' => 'cli',
'name' => 'Command Line',
'version' => '0.15.0',
'version' => '0.16.0',
'url' => 'https://github.com/appwrite/sdk-for-cli',
'package' => 'https://www.npmjs.com/package/appwrite-cli',
'enabled' => true,
@ -208,7 +208,7 @@ return [
[
'key' => 'nodejs',
'name' => 'Node.js',
'version' => '5.0.0',
'version' => '5.1.0',
'url' => 'https://github.com/appwrite/sdk-for-node',
'package' => 'https://www.npmjs.com/package/node-appwrite',
'enabled' => true,
@ -226,7 +226,7 @@ return [
[
'key' => 'deno',
'name' => 'Deno',
'version' => '3.0.0',
'version' => '3.1.0',
'url' => 'https://github.com/appwrite/sdk-for-deno',
'package' => 'https://deno.land/x/appwrite',
'enabled' => true,
@ -244,7 +244,7 @@ return [
[
'key' => 'php',
'name' => 'PHP',
'version' => '4.0.0',
'version' => '4.1.0',
'url' => 'https://github.com/appwrite/sdk-for-php',
'package' => 'https://packagist.org/packages/appwrite/appwrite',
'enabled' => true,
@ -262,7 +262,7 @@ return [
[
'key' => 'python',
'name' => 'Python',
'version' => '0.7.0',
'version' => '0.8.0',
'url' => 'https://github.com/appwrite/sdk-for-python',
'package' => 'https://pypi.org/project/appwrite/',
'enabled' => true,
@ -280,7 +280,7 @@ return [
[
'key' => 'ruby',
'name' => 'Ruby',
'version' => '4.0.0',
'version' => '4.1.0',
'url' => 'https://github.com/appwrite/sdk-for-ruby',
'package' => 'https://rubygems.org/gems/appwrite',
'enabled' => true,
@ -352,7 +352,7 @@ return [
[
'key' => 'dart',
'name' => 'Dart',
'version' => '4.0.1',
'version' => '4.0.2',
'url' => 'https://github.com/appwrite/sdk-for-dart',
'package' => 'https://pub.dev/packages/dart_appwrite',
'enabled' => true,
@ -370,7 +370,7 @@ return [
[
'key' => 'kotlin',
'name' => 'Kotlin',
'version' => '0.3.0',
'version' => '0.4.0',
'url' => 'https://github.com/appwrite/sdk-for-kotlin',
'package' => 'https://search.maven.org/artifact/io.appwrite/sdk-for-kotlin',
'enabled' => true,
@ -392,7 +392,7 @@ return [
[
'key' => 'swift',
'name' => 'Swift',
'version' => '0.3.0',
'version' => '0.4.0',
'url' => 'https://github.com/appwrite/sdk-for-swift',
'package' => 'https://github.com/appwrite/sdk-for-swift',
'enabled' => true,

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

View file

@ -1,7 +1,7 @@
{
"swagger": "2.0",
"info": {
"version": "0.13.0",
"version": "0.13.4",
"title": "Appwrite",
"description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)",
"termsOfService": "https://appwrite.io/policy/terms",
@ -904,7 +904,7 @@
"parameters": [
{
"name": "provider",
"description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, notion, paypal, paypalSandbox, salesforce, slack, spotify, tradeshift, tradeshiftBox, twitch, vk, yahoo, yammer, yandex, wordpress, stripe.",
"description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, notion, paypal, paypalSandbox, salesforce, slack, spotify, tradeshift, tradeshiftBox, twitch, vk, zoom, yahoo, yammer, yandex, wordpress, stripe.",
"required": true,
"type": "string",
"x-example": "amazon",
@ -1656,7 +1656,7 @@
},
{
"name": "queries",
"description": "Array of query strings.",
"description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/database#querying-documents).",
"required": false,
"type": "array",
"collectionFormat": "multi",
@ -1904,7 +1904,7 @@
"properties": {
"data": {
"type": "object",
"description": "Document data as JSON object.",
"description": "Document data as JSON object. Include only attribute and value pairs to be updated.",
"default": {},
"x-example": "{}"
},
@ -1934,7 +1934,7 @@
"consumes": ["application/json"],
"produces": [],
"tags": ["database"],
"description": "Delete a document by its unique ID. This endpoint deletes only the parent documents, its attributes and relations to other documents. Child documents **will not** be deleted.",
"description": "Delete a document by its unique ID.",
"responses": { "204": { "description": "No content" } },
"x-appwrite": {
"method": "deleteDocument",

View file

@ -1,7 +1,7 @@
{
"swagger": "2.0",
"info": {
"version": "0.13.0",
"version": "0.13.4",
"title": "Appwrite",
"description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)",
"termsOfService": "https://appwrite.io/policy/terms",
@ -918,7 +918,7 @@
"parameters": [
{
"name": "provider",
"description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, notion, paypal, paypalSandbox, salesforce, slack, spotify, tradeshift, tradeshiftBox, twitch, vk, yahoo, yammer, yandex, wordpress, stripe.",
"description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, notion, paypal, paypalSandbox, salesforce, slack, spotify, tradeshift, tradeshiftBox, twitch, vk, zoom, yahoo, yammer, yandex, wordpress, stripe.",
"required": true,
"type": "string",
"x-example": "amazon",
@ -2788,7 +2788,7 @@
},
{
"name": "queries",
"description": "Array of query strings.",
"description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/database#querying-documents).",
"required": false,
"type": "array",
"collectionFormat": "multi",
@ -3036,7 +3036,7 @@
"properties": {
"data": {
"type": "object",
"description": "Document data as JSON object.",
"description": "Document data as JSON object. Include only attribute and value pairs to be updated.",
"default": {},
"x-example": "{}"
},
@ -3066,7 +3066,7 @@
"consumes": ["application/json"],
"produces": [],
"tags": ["database"],
"description": "Delete a document by its unique ID. This endpoint deletes only the parent documents, its attributes and relations to other documents. Child documents **will not** be deleted.",
"description": "Delete a document by its unique ID.",
"responses": { "204": { "description": "No content" } },
"x-appwrite": {
"method": "deleteDocument",
@ -3723,7 +3723,7 @@
},
"/functions/runtimes": {
"get": {
"summary": "List the currently active function runtimes.",
"summary": "List runtimes",
"operationId": "functionsListRuntimes",
"consumes": ["application/json"],
"produces": ["application/json"],
@ -10212,12 +10212,12 @@
"key": {
"type": "string",
"description": "Attribute Key.",
"x-example": "fullName"
"x-example": "count"
},
"type": {
"type": "string",
"description": "Attribute type.",
"x-example": "string"
"x-example": "integer"
},
"status": {
"type": "string",
@ -10266,12 +10266,12 @@
"key": {
"type": "string",
"description": "Attribute Key.",
"x-example": "fullName"
"x-example": "percentageCompleted"
},
"type": {
"type": "string",
"description": "Attribute type.",
"x-example": "string"
"x-example": "double"
},
"status": {
"type": "string",
@ -10320,12 +10320,12 @@
"key": {
"type": "string",
"description": "Attribute Key.",
"x-example": "fullName"
"x-example": "isEnabled"
},
"type": {
"type": "string",
"description": "Attribute type.",
"x-example": "string"
"x-example": "boolean"
},
"status": {
"type": "string",
@ -10359,7 +10359,7 @@
"key": {
"type": "string",
"description": "Attribute Key.",
"x-example": "fullName"
"x-example": "userEmail"
},
"type": {
"type": "string",
@ -10403,7 +10403,7 @@
"key": {
"type": "string",
"description": "Attribute Key.",
"x-example": "fullName"
"x-example": "status"
},
"type": {
"type": "string",
@ -10453,7 +10453,7 @@
"key": {
"type": "string",
"description": "Attribute Key.",
"x-example": "fullName"
"x-example": "ipAddress"
},
"type": {
"type": "string",
@ -10497,7 +10497,7 @@
"key": {
"type": "string",
"description": "Attribute Key.",
"x-example": "fullName"
"x-example": "githubUrl"
},
"type": {
"type": "string",
@ -11924,6 +11924,16 @@
"description": "VK OAuth secret ID.",
"x-example": "djsgudsdsewe43434343dd34..."
},
"providerZoomAppid": {
"type": "string",
"description": "Zoom OAuth app ID.",
"x-example": "123247283472834787438"
},
"providerZoomSecret": {
"type": "string",
"description": "Zoom OAuth secret ID.",
"x-example": "djsgudsdsewe43434343dd34..."
},
"providerYahooAppid": {
"type": "string",
"description": "Yahoo OAuth app ID.",
@ -12124,6 +12134,8 @@
"providerTwitchSecret",
"providerVkAppid",
"providerVkSecret",
"providerZoomAppid",
"providerZoomSecret",
"providerYahooAppid",
"providerYahooSecret",
"providerYammerAppid",

View file

@ -1,7 +1,7 @@
{
"swagger": "2.0",
"info": {
"version": "0.13.0",
"version": "0.13.4",
"title": "Appwrite",
"description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)",
"termsOfService": "https://appwrite.io/policy/terms",
@ -2414,7 +2414,7 @@
},
{
"name": "queries",
"description": "Array of query strings.",
"description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/database#querying-documents).",
"required": false,
"type": "array",
"collectionFormat": "multi",
@ -2662,7 +2662,7 @@
"properties": {
"data": {
"type": "object",
"description": "Document data as JSON object.",
"description": "Document data as JSON object. Include only attribute and value pairs to be updated.",
"default": {},
"x-example": "{}"
},
@ -2692,7 +2692,7 @@
"consumes": ["application/json"],
"produces": [],
"tags": ["database"],
"description": "Delete a document by its unique ID. This endpoint deletes only the parent documents, its attributes and relations to other documents. Child documents **will not** be deleted.",
"description": "Delete a document by its unique ID.",
"responses": { "204": { "description": "No content" } },
"x-appwrite": {
"method": "deleteDocument",
@ -3123,7 +3123,7 @@
},
"/functions/runtimes": {
"get": {
"summary": "List the currently active function runtimes.",
"summary": "List runtimes",
"operationId": "functionsListRuntimes",
"consumes": ["application/json"],
"produces": ["application/json"],
@ -7461,12 +7461,12 @@
"key": {
"type": "string",
"description": "Attribute Key.",
"x-example": "fullName"
"x-example": "count"
},
"type": {
"type": "string",
"description": "Attribute type.",
"x-example": "string"
"x-example": "integer"
},
"status": {
"type": "string",
@ -7515,12 +7515,12 @@
"key": {
"type": "string",
"description": "Attribute Key.",
"x-example": "fullName"
"x-example": "percentageCompleted"
},
"type": {
"type": "string",
"description": "Attribute type.",
"x-example": "string"
"x-example": "double"
},
"status": {
"type": "string",
@ -7569,12 +7569,12 @@
"key": {
"type": "string",
"description": "Attribute Key.",
"x-example": "fullName"
"x-example": "isEnabled"
},
"type": {
"type": "string",
"description": "Attribute type.",
"x-example": "string"
"x-example": "boolean"
},
"status": {
"type": "string",
@ -7608,7 +7608,7 @@
"key": {
"type": "string",
"description": "Attribute Key.",
"x-example": "fullName"
"x-example": "userEmail"
},
"type": {
"type": "string",
@ -7652,7 +7652,7 @@
"key": {
"type": "string",
"description": "Attribute Key.",
"x-example": "fullName"
"x-example": "status"
},
"type": {
"type": "string",
@ -7702,7 +7702,7 @@
"key": {
"type": "string",
"description": "Attribute Key.",
"x-example": "fullName"
"x-example": "ipAddress"
},
"type": {
"type": "string",
@ -7746,7 +7746,7 @@
"key": {
"type": "string",
"description": "Attribute Key.",
"x-example": "fullName"
"x-example": "githubUrl"
},
"type": {
"type": "string",

View file

@ -597,9 +597,18 @@ return [
'question' => '',
'filter' => ''
],
[
'name' => '_APP_EXECUTOR_HOST',
'description' => 'The host used by Appwrite to communicate with the function executor!',
'introduction' => '0.13.0',
'default' => 'http://appwrite-executor/v1',
'required' => false,
'question' => '',
'filter' => ''
],
[
'name' => '_APP_EXECUTOR_RUNTIME_NETWORK',
'description' => 'The docker network used for communication between the executor and runtimes. Change this if you have altered the default network names.',
'description' => 'Deprecated with 0.14.0, use \'OPEN_RUNTIMES_NETWORK\' instead!',
'introduction' => '0.13.0',
'default' => 'appwrite_runtimes',
'required' => false,
@ -651,49 +660,58 @@ return [
'question' => '',
'filter' => ''
],
],
[
'category' => 'Maintenance',
'description' => '',
'variables' => [
[
'name' => '_APP_MAINTENANCE_INTERVAL',
'description' => 'Interval value containing the number of seconds that the Appwrite maintenance process should wait before executing system cleanups and optimizations. The default value is 86400 seconds (1 day).',
'introduction' => '0.7.0',
'default' => '86400',
'required' => false,
'question' => '',
'filter' => ''
],
[
'name' => '_APP_MAINTENANCE_RETENTION_EXECUTION',
'description' => 'The maximum duration (in seconds) upto which to retain execution logs. The default value is 1209600 seconds (14 days).',
'introduction' => '0.7.0',
'default' => '1209600',
'required' => false,
'question' => '',
'filter' => ''
],
[
'name' => '_APP_MAINTENANCE_RETENTION_AUDIT',
'description' => 'IThe maximum duration (in seconds) upto which to retain audit logs. The default value is 1209600 seconds (14 days).',
'introduction' => '0.7.0',
'default' => '1209600',
'required' => false,
'question' => '',
'filter' => ''
],
[
'name' => '_APP_MAINTENANCE_RETENTION_ABUSE',
'description' => 'The maximum duration (in seconds) upto which to retain abuse logs. The default value is 86400 seconds (1 day).',
'introduction' => '0.7.0',
'default' => '86400',
'required' => false,
'question' => '',
'filter' => ''
]
[
'name' => 'OPEN_RUNTIMES_NETWORK',
'description' => 'The docker network used for communication between the executor and runtimes. Change this if you have altered the default network names.',
'introduction' => '0.13.0',
'default' => 'appwrite_runtimes',
'required' => false,
'question' => '',
'filter' => ''
],
],
],
[
'category' => 'Maintenance',
'description' => '',
'variables' => [
[
'name' => '_APP_MAINTENANCE_INTERVAL',
'description' => 'Interval value containing the number of seconds that the Appwrite maintenance process should wait before executing system cleanups and optimizations. The default value is 86400 seconds (1 day).',
'introduction' => '0.7.0',
'default' => '86400',
'required' => false,
'question' => '',
'filter' => ''
],
[
'name' => '_APP_MAINTENANCE_RETENTION_EXECUTION',
'description' => 'The maximum duration (in seconds) upto which to retain execution logs. The default value is 1209600 seconds (14 days).',
'introduction' => '0.7.0',
'default' => '1209600',
'required' => false,
'question' => '',
'filter' => ''
],
[
'name' => '_APP_MAINTENANCE_RETENTION_AUDIT',
'description' => 'IThe maximum duration (in seconds) upto which to retain audit logs. The default value is 1209600 seconds (14 days).',
'introduction' => '0.7.0',
'default' => '1209600',
'required' => false,
'question' => '',
'filter' => ''
],
[
'name' => '_APP_MAINTENANCE_RETENTION_ABUSE',
'description' => 'The maximum duration (in seconds) upto which to retain abuse logs. The default value is 86400 seconds (1 day).',
'introduction' => '0.7.0',
'default' => '86400',
'required' => false,
'question' => '',
'filter' => ''
]
],
[
'category' => 'GraphQL',
'description' => '',

View file

@ -274,8 +274,8 @@ App::get('/v1/account/sessions/oauth2/:provider')
$protocol = $request->getProtocol();
$callback = $protocol.'://'.$request->getHostname().'/v1/account/sessions/oauth2/callback/'.$provider.'/'.$project->getId();
$appId = $project->getAttribute('providers', [])[$provider.'Appid'] ?? '';
$appSecret = $project->getAttribute('providers', [])[$provider.'Secret'] ?? '{}';
$appId = $project->getAttribute('authProviders', [])[$provider.'Appid'] ?? '';
$appSecret = $project->getAttribute('authProviders', [])[$provider.'Secret'] ?? '{}';
if (!empty($appSecret) && isset($appSecret['version'])) {
$key = App::getEnv('_APP_OPENSSL_KEY_V' . $appSecret['version']);
@ -396,8 +396,8 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect')
$callback = $protocol . '://' . $request->getHostname() . '/v1/account/sessions/oauth2/callback/' . $provider . '/' . $project->getId();
$defaultState = ['success' => $project->getAttribute('url', ''), 'failure' => ''];
$validateURL = new URL();
$appId = $project->getAttribute('providers', [])[$provider.'Appid'] ?? '';
$appSecret = $project->getAttribute('providers', [])[$provider.'Secret'] ?? '{}';
$appId = $project->getAttribute('authProviders', [])[$provider.'Appid'] ?? '';
$appSecret = $project->getAttribute('authProviders', [])[$provider.'Secret'] ?? '{}';
if (!empty($appSecret) && isset($appSecret['version'])) {
$key = App::getEnv('_APP_OPENSSL_KEY_V' . $appSecret['version']);
@ -675,7 +675,7 @@ App::post('/v1/account/sessions/magic-url')
'emailVerification' => false,
'status' => true,
'password' => null,
'passwordUpdate' => \time(),
'passwordUpdate' => 0,
'registration' => \time(),
'reset' => false,
'prefs' => new \stdClass(),
@ -946,7 +946,7 @@ App::post('/v1/account/sessions/anonymous')
'emailVerification' => false,
'status' => true,
'password' => null,
'passwordUpdate' => \time(),
'passwordUpdate' => 0,
'registration' => \time(),
'reset' => false,
'name' => null,
@ -1710,8 +1710,8 @@ App::patch('/v1/account/sessions/:sessionId')
$provider = $session->getAttribute('provider');
$refreshToken = $session->getAttribute('providerRefreshToken');
$appId = $project->getAttribute('providers', [])[$provider.'Appid'] ?? '';
$appSecret = $project->getAttribute('providers', [])[$provider.'Secret'] ?? '{}';
$appId = $project->getAttribute('authProviders', [])[$provider.'Appid'] ?? '';
$appSecret = $project->getAttribute('authProviders', [])[$provider.'Secret'] ?? '{}';
$className = 'Appwrite\\Auth\\OAuth2\\'.\ucfirst($provider);

View file

@ -938,7 +938,7 @@ App::post('/v1/functions/:functionId/executions')
]);
/** Execute function */
$executor = new Executor();
$executor = new Executor(App::getEnv('_APP_EXECUTOR_HOST'));
$executionResponse = [];
try {
$executionResponse = $executor->createExecution(

View file

@ -95,7 +95,7 @@ App::post('/v1/projects')
'legalTaxId' => $legalTaxId,
'services' => new stdClass(),
'platforms' => null,
'providers' => [],
'authProviders' => [],
'webhooks' => null,
'keys' => null,
'domains' => null,
@ -130,6 +130,8 @@ App::post('/v1/projects')
'signed' => $attribute['signed'],
'array' => $attribute['array'],
'filters' => $attribute['filters'],
'default' => $attribute['default'] ?? null,
'format' => $attribute['format'] ?? ''
]);
}
@ -445,11 +447,11 @@ App::patch('/v1/projects/:projectId/oauth2')
throw new Exception('Project not found', 404, Exception::PROJECT_NOT_FOUND);
}
$providers = $project->getAttribute('providers', []);
$providers = $project->getAttribute('authProviders', []);
$providers[$provider . 'Appid'] = $appId;
$providers[$provider . 'Secret'] = $secret;
$project = $dbForConsole->updateDocument('projects', $project->getId(), $project->setAttribute('providers', $providers));
$project = $dbForConsole->updateDocument('projects', $project->getId(), $project->setAttribute('authProviders', $providers));
$response->dynamic($project, Response::MODEL_PROJECT);
});

View file

@ -86,6 +86,8 @@ App::post('/v1/storage/buckets')
'signed' => $attribute['signed'],
'array' => $attribute['array'],
'filters' => $attribute['filters'],
'default' => $attribute['default'] ?? null,
'format' => $attribute['format'] ?? ''
]);
}

View file

@ -141,7 +141,6 @@ App::post('/v1/runtimes')
->param('vars', [], new Assoc(), 'Environment Variables required for the build')
->param('commands', [], new ArrayList(new Text(0)), 'Commands required to build the container')
->param('runtime', '', new Text(128), 'Runtime for the cloud function')
->param('network', '', new Text(128), 'Network to attach the container to')
->param('baseImage', '', new Text(128), 'Base image name of the runtime')
->param('entrypoint', '', new Text(256), 'Entrypoint of the code file', true)
->param('remove', false, new Boolean(), 'Remove a runtime after execution')
@ -149,8 +148,7 @@ App::post('/v1/runtimes')
->inject('orchestrationPool')
->inject('activeRuntimes')
->inject('response')
->action(function (string $runtimeId, string $source, string $destination, array $vars, array $commands, string $runtime, string $network, string $baseImage, string $entrypoint, bool $remove, string $workdir, $orchestrationPool, $activeRuntimes, Response $response) {
->action(function (string $runtimeId, string $source, string $destination, array $vars, array $commands, string $runtime, string $baseImage, string $entrypoint, bool $remove, string $workdir, $orchestrationPool, $activeRuntimes, Response $response) {
if ($activeRuntimes->exists($runtimeId)) {
throw new Exception('Runtime already exists.', 409);
}
@ -235,9 +233,7 @@ App::post('/v1/runtimes')
throw new Exception('Failed to create build container', 500);
}
if (!empty($network)) {
$orchestration->networkConnect($runtimeId, $network);
}
$orchestration->networkConnect($runtimeId, App::getEnv('OPEN_RUNTIMES_NETWORK', 'appwrite_runtimes'));
/**
* Execute any commands if they were provided

View file

@ -132,6 +132,8 @@ $http->on('start', function (Server $http) use ($payloadSize, $register) {
'signed' => $attribute['signed'],
'array' => $attribute['array'],
'filters' => $attribute['filters'],
'default' => $attribute['default'] ?? null,
'format' => $attribute['format'] ?? ''
]);
}
@ -187,6 +189,8 @@ $http->on('start', function (Server $http) use ($payloadSize, $register) {
'signed' => $attribute['signed'],
'array' => $attribute['array'],
'filters' => $attribute['filters'],
'default' => $attribute['default'] ?? null,
'format' => $attribute['format'] ?? ''
]);
}

View file

@ -565,13 +565,13 @@ $cli
foreach ($parents as $parent) {
foreach ($subCollections as $subCollection => $subOptions) { // Sub collection counts, like database.collections.collectionId.documents.count
$dbForProject->setNamespace("_{$projectId}");
$count = $dbForProject->count(($subOptions['collectionPrefix'] ?? '') . $parent->getId());
$count = $dbForProject->count(($subOptions['collectionPrefix'] ?? '') . $parent->getInternalId());
$subCollectionCounts[$subCollection] = ($subCollectionCounts[$subCollection] ?? 0) + $count; // Project level counts for sub collections like database.documents.count
$dbForProject->setNamespace("_{$projectId}");
$metric = empty($metricPrefix) ? "{$collection}.{$parent->getId()}.{$subCollection}.count" : "{$metricPrefix}.{$collection}.{$parent->getId()}.{$subCollection}.count";
$metric = empty($metricPrefix) ? "{$collection}.{$parent->getId()}.{$subCollection}.count" : "{$metricPrefix}.{$collection}.{$parent->getInternalId()}.{$subCollection}.count";
$time = (int) (floor(time() / 1800) * 1800); // Time rounded to nearest 30 minutes
$id = \md5($time . '_30m_' . $metric); //Construct unique id for each metric using time, period and metric
$document = $dbForProject->getDocument('stats', $id);
@ -619,13 +619,13 @@ $cli
}
$dbForProject->setNamespace("_{$projectId}");
$total = (int) $dbForProject->sum(($subOptions['collectionPrefix'] ?? '') . $parent->getId(), $total['field']);
$total = (int) $dbForProject->sum(($subOptions['collectionPrefix'] ?? '') . $parent->getInternalId(), $total['field']);
$subCollectionTotals[$subCollection] = ($ssubCollectionTotals[$subCollection] ?? 0) + $total; // Project level sum for sub collections like storage.total
$dbForProject->setNamespace("_{$projectId}");
$metric = empty($metricPrefix) ? "{$collection}.{$parent->getId()}.{$subCollection}.total" : "{$metricPrefix}.{$collection}.{$parent->getId()}.{$subCollection}.total";
$metric = empty($metricPrefix) ? "{$collection}.{$parent->getId()}.{$subCollection}.total" : "{$metricPrefix}.{$collection}.{$parent->getInternalId()}.{$subCollection}.total";
$time = (int) (floor(time() / 1800) * 1800); // Time rounded to nearest 30 minutes
$id = \md5($time . '_30m_' . $metric); //Construct unique id for each metric using time, period and metric
$document = $dbForProject->getDocument('stats', $id);

View file

@ -1040,7 +1040,7 @@ $logs = $this->getParam('logs', null);
<div data-forms-clone="" data-label="Add Element" data-target="elements-section" data-first="1">
<div class="row responsive thin margin-bottom-tiny">
<div class="col span-11 margin-bottom-small">
<input type="text" class="full-width" name="elements" required autocomplete="off" maxlength="128" />
<input data-cast-to="array" type="text" class="full-width" name="elements" required autocomplete="off" maxlength="128" />
</div>
<div class="col span-1 margin-bottom-small">
<button type="button" data-remove class="dark danger small round pull-end" style="margin-top: 10px;"><i class="icon-cancel"></i></button>

View file

@ -267,9 +267,9 @@ $logs = $this->getParam('logs', null);
:required="attr.required"
:name="attr.key"
data-cast-to="string">
<template x-for="element in attr.elements">
<option :disabled="attr.required" selected label=" "></option>
<option :disabled="attr.required" selected label=" "></option>
<template x-for="element in attr.elements">
<option
:value="element"
x-text="element"

View file

@ -1,3 +1,10 @@
x-logging: &x-logging
logging:
driver: 'json-file'
options:
max-file: 5
max-size: 10m
<?php
$httpPort = $this->getParam('httpPort', '');
@ -36,6 +43,7 @@ services:
appwrite:
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
container_name: appwrite
<<: *x-logging
restart: unless-stopped
networks:
- appwrite
@ -98,6 +106,7 @@ services:
- _APP_INFLUXDB_HOST
- _APP_INFLUXDB_PORT
- _APP_STORAGE_LIMIT
- _APP_STORAGE_PREVIEW_LIMIT
- _APP_STORAGE_ANTIVIRUS
- _APP_STORAGE_ANTIVIRUS_HOST
- _APP_STORAGE_ANTIVIRUS_PORT
@ -119,6 +128,7 @@ services:
- _APP_FUNCTIONS_MEMORY_SWAP
- _APP_FUNCTIONS_RUNTIMES
- _APP_EXECUTOR_SECRET
- _APP_EXECUTOR_HOST
- _APP_LOGGING_PROVIDER
- _APP_LOGGING_CONFIG
- _APP_STATSD_HOST
@ -132,6 +142,7 @@ services:
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
entrypoint: realtime
container_name: appwrite-realtime
<<: *x-logging
restart: unless-stopped
labels:
- "traefik.enable=true"
@ -172,6 +183,7 @@ services:
appwrite-worker-audits:
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
entrypoint: worker-audits
<<: *x-logging
container_name: appwrite-worker-audits
restart: unless-stopped
networks:
@ -197,6 +209,7 @@ services:
appwrite-worker-webhooks:
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
entrypoint: worker-webhooks
<<: *x-logging
container_name: appwrite-worker-webhooks
restart: unless-stopped
networks:
@ -218,6 +231,7 @@ services:
appwrite-worker-deletes:
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
entrypoint: worker-deletes
<<: *x-logging
container_name: appwrite-worker-deletes
restart: unless-stopped
networks:
@ -255,10 +269,12 @@ services:
- _APP_LOGGING_PROVIDER
- _APP_LOGGING_CONFIG
- _APP_EXECUTOR_SECRET
- _APP_EXECUTOR_HOST
appwrite-worker-database:
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
entrypoint: worker-database
<<: *x-logging
container_name: appwrite-worker-database
restart: unless-stopped
networks:
@ -284,6 +300,7 @@ services:
appwrite-worker-builds:
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
entrypoint: worker-builds
<<: *x-logging
container_name: appwrite-worker-builds
restart: unless-stopped
networks:
@ -295,6 +312,7 @@ services:
- _APP_ENV
- _APP_OPENSSL_KEY_V1
- _APP_EXECUTOR_SECRET
- _APP_EXECUTOR_HOST
- _APP_REDIS_HOST
- _APP_REDIS_PORT
- _APP_REDIS_USER
@ -310,6 +328,7 @@ services:
appwrite-worker-certificates:
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
entrypoint: worker-certificates
<<: *x-logging
container_name: appwrite-worker-certificates
restart: unless-stopped
networks:
@ -340,6 +359,7 @@ services:
appwrite-worker-functions:
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
entrypoint: worker-functions
<<: *x-logging
container_name: appwrite-worker-functions
restart: unless-stopped
networks:
@ -362,6 +382,7 @@ services:
- _APP_DB_PASS
- _APP_FUNCTIONS_TIMEOUT
- _APP_EXECUTOR_SECRET
- _APP_EXECUTOR_HOST
- _APP_USAGE_STATS
- DOCKERHUB_PULL_USERNAME
- DOCKERHUB_PULL_PASSWORD
@ -369,6 +390,7 @@ services:
appwrite-executor:
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
entrypoint: executor
<<: *x-logging
container_name: appwrite-executor
restart: unless-stopped
stop_signal: SIGINT
@ -396,7 +418,7 @@ services:
- _APP_FUNCTIONS_MEMORY_SWAP
- _APP_FUNCTIONS_INACTIVE_THRESHOLD
- _APP_EXECUTOR_SECRET
- _APP_EXECUTOR_RUNTIME_NETWORK
- OPEN_RUNTIMES_NETWORK
- _APP_LOGGING_PROVIDER
- _APP_LOGGING_CONFIG
- _APP_STORAGE_DEVICE
@ -414,6 +436,7 @@ services:
appwrite-worker-mails:
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
entrypoint: worker-mails
<<: *x-logging
container_name: appwrite-worker-mails
restart: unless-stopped
networks:
@ -440,6 +463,7 @@ services:
appwrite-maintenance:
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
entrypoint: maintenance
<<: *x-logging
container_name: appwrite-maintenance
restart: unless-stopped
networks:
@ -462,6 +486,7 @@ services:
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
entrypoint: usage
container_name: appwrite-usage
<<: *x-logging
restart: unless-stopped
networks:
- appwrite
@ -488,6 +513,7 @@ services:
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
entrypoint: schedule
container_name: appwrite-schedule
<<: *x-logging
restart: unless-stopped
networks:
- appwrite
@ -503,6 +529,7 @@ services:
mariadb:
image: mariadb:10.7 # fix issues when upgrading using: mysql_upgrade -u root -p
container_name: appwrite-mariadb
<<: *x-logging
restart: unless-stopped
networks:
- appwrite
@ -518,6 +545,7 @@ services:
redis:
image: redis:6.2-alpine
container_name: appwrite-redis
<<: *x-logging
restart: unless-stopped
networks:
- appwrite
@ -536,6 +564,7 @@ services:
influxdb:
image: appwrite/influxdb:1.5.0
container_name: appwrite-influxdb
<<: *x-logging
restart: unless-stopped
networks:
- appwrite
@ -545,6 +574,7 @@ services:
telegraf:
image: appwrite/telegraf:1.4.0
container_name: appwrite-telegraf
<<: *x-logging
restart: unless-stopped
networks:
- appwrite

View file

@ -33,7 +33,7 @@ class BuildsV1 extends Worker
}
public function init(): void {
$this->executor = new Executor();
$this->executor = new Executor(App::getEnv('_APP_EXECUTOR_HOST'));
}
public function run(): void

View file

@ -368,7 +368,7 @@ class DeletesV1 extends Worker
* Request executor to delete all deployment containers
*/
Console::info("Requesting executor to delete all deployment containers for function " . $functionId);
$executor = new Executor();
$executor = new Executor(App::getEnv('_APP_EXECUTOR_HOST'));
foreach ($deploymentIds as $deploymentId) {
try {
$executor->deleteRuntime($projectId, $deploymentId);
@ -420,7 +420,7 @@ class DeletesV1 extends Worker
*/
Console::info("Requesting executor to delete deployment container for deployment " . $deploymentId);
try {
$executor = new Executor();
$executor = new Executor(App::getEnv('_APP_EXECUTOR_HOST'));
$executor->deleteRuntime($projectId, $deploymentId);
} catch (Throwable $th) {
Console::error($th->getMessage());

View file

@ -37,7 +37,7 @@ class FunctionsV1 extends Worker
public function init(): void
{
$this->executor = new Executor();
$this->executor = new Executor(App::getEnv('_APP_EXECUTOR_HOST'));
}
public function run(): void

View file

@ -42,7 +42,7 @@
"utopia-php/abuse": "0.7.*",
"utopia-php/analytics": "0.2.*",
"utopia-php/audit": "0.8.*",
"utopia-php/cache": "0.4.*",
"utopia-php/cache": "0.6.*",
"utopia-php/cli": "0.12.*",
"utopia-php/config": "0.2.*",
"utopia-php/database": "0.15.*",
@ -72,7 +72,7 @@
}
],
"require-dev": {
"appwrite/sdk-generator": "0.18.1",
"appwrite/sdk-generator": "0.18.3",
"phpunit/phpunit": "9.5.10",
"swoole/ide-helper": "4.8.5",
"textalk/websocket": "1.5.5",

89
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "39297e719edd93815a08c042decd55be",
"content-hash": "e0de8d0bba618a46646cf3da1e06a652",
"packages": [
{
"name": "adhocore/jwt",
@ -300,16 +300,16 @@
},
{
"name": "colinmollenhour/credis",
"version": "v1.12.2",
"version": "v1.13.0",
"source": {
"type": "git",
"url": "https://github.com/colinmollenhour/credis.git",
"reference": "77e6ede2e01c4cfaade114fe1e07d2f9756949f1"
"reference": "afec8e58ec93d2291c127fa19709a048f28641e5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/colinmollenhour/credis/zipball/77e6ede2e01c4cfaade114fe1e07d2f9756949f1",
"reference": "77e6ede2e01c4cfaade114fe1e07d2f9756949f1",
"url": "https://api.github.com/repos/colinmollenhour/credis/zipball/afec8e58ec93d2291c127fa19709a048f28641e5",
"reference": "afec8e58ec93d2291c127fa19709a048f28641e5",
"shasum": ""
},
"require": {
@ -341,9 +341,9 @@
"homepage": "https://github.com/colinmollenhour/credis",
"support": {
"issues": "https://github.com/colinmollenhour/credis/issues",
"source": "https://github.com/colinmollenhour/credis/tree/v1.12.2"
"source": "https://github.com/colinmollenhour/credis/tree/v1.13.0"
},
"time": "2022-03-08T18:12:43+00:00"
"time": "2022-04-07T14:57:22+00:00"
},
{
"name": "composer/package-versions-deprecated",
@ -1976,22 +1976,22 @@
},
{
"name": "utopia-php/cache",
"version": "0.4.2",
"version": "0.6.0",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/cache.git",
"reference": "7334c5b182c6ccf66b21ca61808d7c6c899e2bcb"
"reference": "8ea1353a4bbab617e23c865a7c97b60d8074aee3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/cache/zipball/7334c5b182c6ccf66b21ca61808d7c6c899e2bcb",
"reference": "7334c5b182c6ccf66b21ca61808d7c6c899e2bcb",
"url": "https://api.github.com/repos/utopia-php/cache/zipball/8ea1353a4bbab617e23c865a7c97b60d8074aee3",
"reference": "8ea1353a4bbab617e23c865a7c97b60d8074aee3",
"shasum": ""
},
"require": {
"ext-json": "*",
"ext-redis": "*",
"php": ">=7.4"
"php": ">=8.0"
},
"require-dev": {
"phpunit/phpunit": "^9.3",
@ -2023,9 +2023,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/cache/issues",
"source": "https://github.com/utopia-php/cache/tree/0.4.2"
"source": "https://github.com/utopia-php/cache/tree/0.6.0"
},
"time": "2021-11-25T16:41:35+00:00"
"time": "2022-04-04T12:30:05+00:00"
},
{
"name": "utopia-php/cli",
@ -2133,16 +2133,16 @@
},
{
"name": "utopia-php/database",
"version": "0.15.4",
"version": "0.15.5",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/database.git",
"reference": "166365d9c39c4d70b1267af4562f4327e8930f79"
"reference": "6507b58ef3e22703b9df68d3dbd5e822d5bb023f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/database/zipball/166365d9c39c4d70b1267af4562f4327e8930f79",
"reference": "166365d9c39c4d70b1267af4562f4327e8930f79",
"url": "https://api.github.com/repos/utopia-php/database/zipball/6507b58ef3e22703b9df68d3dbd5e822d5bb023f",
"reference": "6507b58ef3e22703b9df68d3dbd5e822d5bb023f",
"shasum": ""
},
"require": {
@ -2151,7 +2151,7 @@
"ext-redis": "*",
"mongodb/mongodb": "1.8.0",
"php": ">=8.0",
"utopia-php/cache": "0.4.*",
"utopia-php/cache": "0.6.*",
"utopia-php/framework": "0.*.*"
},
"require-dev": {
@ -2190,9 +2190,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/database/issues",
"source": "https://github.com/utopia-php/database/tree/0.15.4"
"source": "https://github.com/utopia-php/database/tree/0.15.5"
},
"time": "2022-03-15T17:20:14+00:00"
"time": "2022-04-04T13:42:00+00:00"
},
{
"name": "utopia-php/domains",
@ -2250,16 +2250,16 @@
},
{
"name": "utopia-php/framework",
"version": "0.19.7",
"version": "0.19.20",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/framework.git",
"reference": "f17afe77a21873b9be18ebc05283813468b4283a"
"reference": "65ced168db8f6e188ceeb0d101f57552c3d8b2af"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/framework/zipball/f17afe77a21873b9be18ebc05283813468b4283a",
"reference": "f17afe77a21873b9be18ebc05283813468b4283a",
"url": "https://api.github.com/repos/utopia-php/framework/zipball/65ced168db8f6e188ceeb0d101f57552c3d8b2af",
"reference": "65ced168db8f6e188ceeb0d101f57552c3d8b2af",
"shasum": ""
},
"require": {
@ -2293,9 +2293,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/framework/issues",
"source": "https://github.com/utopia-php/framework/tree/0.19.7"
"source": "https://github.com/utopia-php/framework/tree/0.19.20"
},
"time": "2022-02-18T00:04:49+00:00"
"time": "2022-04-14T15:42:37+00:00"
},
{
"name": "utopia-php/image",
@ -3141,16 +3141,16 @@
},
{
"name": "appwrite/sdk-generator",
"version": "0.18.1",
"version": "0.18.3",
"source": {
"type": "git",
"url": "https://github.com/appwrite/sdk-generator.git",
"reference": "1d5293dd65e014f2067f2bfc9c0c45e5b0de56aa"
"reference": "96e2c9b0f350d4fa43ddff6334ef44908716c944"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/1d5293dd65e014f2067f2bfc9c0c45e5b0de56aa",
"reference": "1d5293dd65e014f2067f2bfc9c0c45e5b0de56aa",
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/96e2c9b0f350d4fa43ddff6334ef44908716c944",
"reference": "96e2c9b0f350d4fa43ddff6334ef44908716c944",
"shasum": ""
},
"require": {
@ -3162,6 +3162,7 @@
"twig/twig": "^3.3"
},
"require-dev": {
"brianium/paratest": "^6.4",
"phpunit/phpunit": "^9.5.13"
},
"type": "library",
@ -3184,9 +3185,9 @@
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
"support": {
"issues": "https://github.com/appwrite/sdk-generator/issues",
"source": "https://github.com/appwrite/sdk-generator/tree/0.18.1"
"source": "https://github.com/appwrite/sdk-generator/tree/0.18.3"
},
"time": "2022-03-03T09:45:38+00:00"
"time": "2022-04-13T04:00:59+00:00"
},
{
"name": "composer/pcre",
@ -3616,16 +3617,16 @@
},
{
"name": "matthiasmullie/minify",
"version": "1.3.66",
"version": "1.3.67",
"source": {
"type": "git",
"url": "https://github.com/matthiasmullie/minify.git",
"reference": "45fd3b0f1dfa2c965857c6d4a470bea52adc31a6"
"reference": "acaee1b7ca3cd67a39d7f98673cacd7e4739a8d9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/matthiasmullie/minify/zipball/45fd3b0f1dfa2c965857c6d4a470bea52adc31a6",
"reference": "45fd3b0f1dfa2c965857c6d4a470bea52adc31a6",
"url": "https://api.github.com/repos/matthiasmullie/minify/zipball/acaee1b7ca3cd67a39d7f98673cacd7e4739a8d9",
"reference": "acaee1b7ca3cd67a39d7f98673cacd7e4739a8d9",
"shasum": ""
},
"require": {
@ -3674,23 +3675,15 @@
],
"support": {
"issues": "https://github.com/matthiasmullie/minify/issues",
"source": "https://github.com/matthiasmullie/minify/tree/1.3.66"
"source": "https://github.com/matthiasmullie/minify/tree/1.3.67"
},
"funding": [
{
"url": "https://github.com/[user1",
"type": "github"
},
{
"url": "https://github.com/matthiasmullie] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g.",
"type": "github"
},
{
"url": "https://github.com/user2",
"url": "https://github.com/matthiasmullie",
"type": "github"
}
],
"time": "2021-01-06T15:18:10+00:00"
"time": "2022-03-24T08:54:59+00:00"
},
{
"name": "matthiasmullie/path-converter",

View file

@ -3,11 +3,19 @@
# Avoid using this file in your production environment.
# We're exposing here sensitive ports and mounting code volumes for rapid development and debugging of the server stack.
x-logging: &x-logging
logging:
driver: 'json-file'
options:
max-file: '5'
max-size: '10m'
version: '3'
services:
traefik:
image: traefik:2.5
<<: *x-logging
container_name: appwrite-traefik
command:
- --log.level=DEBUG
@ -37,6 +45,7 @@ services:
appwrite:
container_name: appwrite
<<: *x-logging
build:
context: .
args:
@ -141,6 +150,7 @@ services:
- _APP_FUNCTIONS_MEMORY_SWAP
- _APP_FUNCTIONS_RUNTIMES
- _APP_EXECUTOR_SECRET
- _APP_EXECUTOR_HOST
- _APP_LOGGING_PROVIDER
- _APP_LOGGING_CONFIG
- _APP_STATSD_HOST
@ -156,6 +166,7 @@ services:
appwrite-realtime:
entrypoint: realtime
<<: *x-logging
container_name: appwrite-realtime
build:
context: .
@ -204,6 +215,7 @@ services:
appwrite-worker-audits:
entrypoint: worker-audits
<<: *x-logging
container_name: appwrite-worker-audits
build:
context: .
@ -232,6 +244,7 @@ services:
appwrite-worker-webhooks:
entrypoint: worker-webhooks
<<: *x-logging
container_name: appwrite-worker-webhooks
build:
context: .
@ -257,6 +270,7 @@ services:
appwrite-worker-deletes:
entrypoint: worker-deletes
<<: *x-logging
container_name: appwrite-worker-deletes
build:
context: .
@ -297,9 +311,11 @@ services:
- _APP_LOGGING_PROVIDER
- _APP_LOGGING_CONFIG
- _APP_EXECUTOR_SECRET
- _APP_EXECUTOR_HOST
appwrite-worker-database:
entrypoint: worker-database
<<: *x-logging
container_name: appwrite-worker-database
build:
context: .
@ -329,6 +345,7 @@ services:
appwrite-worker-builds:
entrypoint: worker-builds
<<: *x-logging
container_name: appwrite-worker-builds
build:
context: .
@ -344,6 +361,7 @@ services:
- _APP_ENV
- _APP_OPENSSL_KEY_V1
- _APP_EXECUTOR_SECRET
- _APP_EXECUTOR_HOST
- _APP_REDIS_HOST
- _APP_REDIS_PORT
- _APP_REDIS_USER
@ -358,6 +376,7 @@ services:
appwrite-worker-certificates:
entrypoint: worker-certificates
<<: *x-logging
container_name: appwrite-worker-certificates
build:
context: .
@ -390,6 +409,7 @@ services:
appwrite-worker-functions:
entrypoint: worker-functions
<<: *x-logging
container_name: appwrite-worker-functions
build:
context: .
@ -416,12 +436,14 @@ services:
- _APP_DB_PASS
- _APP_FUNCTIONS_TIMEOUT
- _APP_EXECUTOR_SECRET
- _APP_EXECUTOR_HOST
- _APP_USAGE_STATS
- DOCKERHUB_PULL_USERNAME
- DOCKERHUB_PULL_PASSWORD
appwrite-executor:
container_name: appwrite-executor
<<: *x-logging
entrypoint: executor
stop_signal: SIGINT
build:
@ -458,7 +480,7 @@ services:
- _APP_FUNCTIONS_MEMORY_SWAP
- _APP_FUNCTIONS_INACTIVE_THRESHOLD
- _APP_EXECUTOR_SECRET
- _APP_EXECUTOR_RUNTIME_NETWORK
- OPEN_RUNTIMES_NETWORK
- _APP_LOGGING_PROVIDER
- _APP_LOGGING_CONFIG
- _APP_STORAGE_DEVICE
@ -475,6 +497,7 @@ services:
appwrite-worker-mails:
entrypoint: worker-mails
<<: *x-logging
container_name: appwrite-worker-mails
build:
context: .
@ -506,6 +529,7 @@ services:
appwrite-maintenance:
entrypoint: maintenance
<<: *x-logging
container_name: appwrite-maintenance
build:
context: .
@ -530,6 +554,7 @@ services:
appwrite-usage:
entrypoint: usage
<<: *x-logging
container_name: appwrite-usage
build:
context: .
@ -562,6 +587,7 @@ services:
appwrite-schedule:
entrypoint: schedule
<<: *x-logging
container_name: appwrite-schedule
build:
context: .
@ -582,6 +608,7 @@ services:
mariadb:
image: mariadb:10.7 # fix issues when upgrading using: mysql_upgrade -u root -p
container_name: appwrite-mariadb
<<: *x-logging
networks:
- appwrite
volumes:
@ -610,6 +637,7 @@ services:
redis:
image: redis:6.2-alpine
<<: *x-logging
container_name: appwrite-redis
ports:
- "6379:6379"
@ -629,6 +657,7 @@ services:
influxdb:
image: appwrite/influxdb:1.5.0
container_name: appwrite-influxdb
<<: *x-logging
networks:
- appwrite
volumes:
@ -637,6 +666,7 @@ services:
telegraf:
image: appwrite/telegraf:1.4.0
container_name: appwrite-telegraf
<<: *x-logging
networks:
- appwrite
environment:
@ -659,6 +689,7 @@ services:
maildev: # used mainly for dev tests
image: appwrite/mailcatcher:1.0.0
container_name: appwrite-mailcatcher
<<: *x-logging
ports:
- '9503:1080'
networks:
@ -667,6 +698,7 @@ services:
request-catcher: # used mainly for dev tests
image: appwrite/requestcatcher:1.0.0
container_name: appwrite-requestcatcher
<<: *x-logging
ports:
- '9504:5000'
networks:
@ -675,6 +707,7 @@ services:
adminer:
image: adminer
container_name: appwrite-adminer
<<: *x-logging
restart: always
ports:
- 9506:8080

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.createAnonymousSession() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let session):
print(String(describing: session)
}
}
let session = try await account.createAnonymousSession()
print(String(describing: session)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.createJWT() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let jwt):
print(String(describing: jwt)
}
}
let jwt = try await account.createJWT()
print(String(describing: jwt)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.createMagicURLSession(
let token = try await account.createMagicURLSession(
userId: "[USER_ID]",
email: "email@example.com"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let token):
print(String(describing: token)
}
}
)
print(String(describing: token)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.createOAuth2Session(
let success = try await account.createOAuth2Session(
provider: "amazon"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let success):
print(String(describing: success)
}
}
)
print(String(describing: success)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.createRecovery(
let token = try await account.createRecovery(
email: "email@example.com",
url: "https://example.com"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let token):
print(String(describing: token)
}
}
)
print(String(describing: token)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.createSession(
let session = try await account.createSession(
email: "email@example.com",
password: "password"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let session):
print(String(describing: session)
}
}
)
print(String(describing: session)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.createVerification(
let token = try await account.createVerification(
url: "https://example.com"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let token):
print(String(describing: token)
}
}
)
print(String(describing: token)
}

View file

@ -1,21 +1,15 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.create(
let user = try await account.create(
userId: "[USER_ID]",
email: "email@example.com",
password: "password"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let user):
print(String(describing: user)
}
}
)
print(String(describing: user)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.deleteSession(
let result = try await account.deleteSession(
sessionId: "[SESSION_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let ):
print(String(describing: )
}
}
)
print(String(describing: result)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.deleteSessions() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let ):
print(String(describing: )
}
}
let result = try await account.deleteSessions()
print(String(describing: result)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.delete() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let ):
print(String(describing: )
}
}
let result = try await account.delete()
print(String(describing: result)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.getLogs() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let logList):
print(String(describing: logList)
}
}
let logList = try await account.getLogs()
print(String(describing: logList)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.getPrefs() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let preferences):
print(String(describing: preferences)
}
}
let preferences = try await account.getPrefs()
print(String(describing: preferences)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.getSession(
let session = try await account.getSession(
sessionId: "[SESSION_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let session):
print(String(describing: session)
}
}
)
print(String(describing: session)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.getSessions() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let sessionList):
print(String(describing: sessionList)
}
}
let sessionList = try await account.getSessions()
print(String(describing: sessionList)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.get() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let user):
print(String(describing: user)
}
}
let user = try await account.get()
print(String(describing: user)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.updateEmail(
let user = try await account.updateEmail(
email: "email@example.com",
password: "password"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let user):
print(String(describing: user)
}
}
)
print(String(describing: user)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.updateMagicURLSession(
let session = try await account.updateMagicURLSession(
userId: "[USER_ID]",
secret: "[SECRET]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let session):
print(String(describing: session)
}
}
)
print(String(describing: session)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.updateName(
let user = try await account.updateName(
name: "[NAME]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let user):
print(String(describing: user)
}
}
)
print(String(describing: user)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.updatePassword(
let user = try await account.updatePassword(
password: "password"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let user):
print(String(describing: user)
}
}
)
print(String(describing: user)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.updatePrefs(
let user = try await account.updatePrefs(
prefs:
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let user):
print(String(describing: user)
}
}
)
print(String(describing: user)
}

View file

@ -1,22 +1,16 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.updateRecovery(
let token = try await account.updateRecovery(
userId: "[USER_ID]",
secret: "[SECRET]",
password: "password",
passwordAgain: "password"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let token):
print(String(describing: token)
}
}
)
print(String(describing: token)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.updateSession(
let session = try await account.updateSession(
sessionId: "[SESSION_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let session):
print(String(describing: session)
}
}
)
print(String(describing: session)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let account = Account(client)
account.updateVerification(
let token = try await account.updateVerification(
userId: "[USER_ID]",
secret: "[SECRET]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let token):
print(String(describing: token)
}
}
)
print(String(describing: token)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let avatars = Avatars(client)
avatars.getBrowser(
let byteBuffer = try await avatars.getBrowser(
code: "aa"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let avatars = Avatars(client)
avatars.getCreditCard(
let byteBuffer = try await avatars.getCreditCard(
code: "amex"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let avatars = Avatars(client)
avatars.getFavicon(
let byteBuffer = try await avatars.getFavicon(
url: "https://example.com"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let avatars = Avatars(client)
avatars.getFlag(
let byteBuffer = try await avatars.getFlag(
code: "af"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let avatars = Avatars(client)
avatars.getImage(
let byteBuffer = try await avatars.getImage(
url: "https://example.com"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let avatars = Avatars(client)
avatars.getInitials() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
let byteBuffer = try await avatars.getInitials()
print(String(describing: byteBuffer)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let avatars = Avatars(client)
avatars.getQR(
let byteBuffer = try await avatars.getQR(
text: "[TEXT]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,21 +1,15 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let database = Database(client)
database.createDocument(
let document = try await database.createDocument(
collectionId: "[COLLECTION_ID]",
documentId: "[DOCUMENT_ID]",
data:
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let document):
print(String(describing: document)
}
}
)
print(String(describing: document)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let database = Database(client)
database.deleteDocument(
let result = try await database.deleteDocument(
collectionId: "[COLLECTION_ID]",
documentId: "[DOCUMENT_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let ):
print(String(describing: )
}
}
)
print(String(describing: result)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let database = Database(client)
database.getDocument(
let document = try await database.getDocument(
collectionId: "[COLLECTION_ID]",
documentId: "[DOCUMENT_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let document):
print(String(describing: document)
}
}
)
print(String(describing: document)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let database = Database(client)
database.listDocuments(
let documentList = try await database.listDocuments(
collectionId: "[COLLECTION_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let documentList):
print(String(describing: documentList)
}
}
)
print(String(describing: documentList)
}

View file

@ -1,21 +1,15 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let database = Database(client)
database.updateDocument(
let document = try await database.updateDocument(
collectionId: "[COLLECTION_ID]",
documentId: "[DOCUMENT_ID]",
data:
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let document):
print(String(describing: document)
}
}
)
print(String(describing: document)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let functions = Functions(client)
functions.createExecution(
let execution = try await functions.createExecution(
functionId: "[FUNCTION_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let execution):
print(String(describing: execution)
}
}
)
print(String(describing: execution)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let functions = Functions(client)
functions.getExecution(
let execution = try await functions.getExecution(
functionId: "[FUNCTION_ID]",
executionId: "[EXECUTION_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let execution):
print(String(describing: execution)
}
}
)
print(String(describing: execution)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let functions = Functions(client)
functions.listExecutions(
let executionList = try await functions.listExecutions(
functionId: "[FUNCTION_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let executionList):
print(String(describing: executionList)
}
}
)
print(String(describing: executionList)
}

View file

@ -1,21 +1,15 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let functions = Functions(client)
functions.retryBuild(
let result = try await functions.retryBuild(
functionId: "[FUNCTION_ID]",
deploymentId: "[DEPLOYMENT_ID]",
buildId: "[BUILD_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let ):
print(String(describing: )
}
}
)
print(String(describing: result)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let locale = Locale(client)
locale.getContinents() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let continentList):
print(String(describing: continentList)
}
}
let continentList = try await locale.getContinents()
print(String(describing: continentList)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let locale = Locale(client)
locale.getCountriesEU() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let countryList):
print(String(describing: countryList)
}
}
let countryList = try await locale.getCountriesEU()
print(String(describing: countryList)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let locale = Locale(client)
locale.getCountriesPhones() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let phoneList):
print(String(describing: phoneList)
}
}
let phoneList = try await locale.getCountriesPhones()
print(String(describing: phoneList)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let locale = Locale(client)
locale.getCountries() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let countryList):
print(String(describing: countryList)
}
}
let countryList = try await locale.getCountries()
print(String(describing: countryList)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let locale = Locale(client)
locale.getCurrencies() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let currencyList):
print(String(describing: currencyList)
}
}
let currencyList = try await locale.getCurrencies()
print(String(describing: currencyList)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let locale = Locale(client)
locale.getLanguages() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let languageList):
print(String(describing: languageList)
}
}
let languageList = try await locale.getLanguages()
print(String(describing: languageList)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let locale = Locale(client)
locale.get() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let locale):
print(String(describing: locale)
}
}
let locale = try await locale.get()
print(String(describing: locale)
}

View file

@ -1,21 +1,15 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let storage = Storage(client)
storage.createFile(
let file = try await storage.createFile(
bucketId: "[BUCKET_ID]",
fileId: "[FILE_ID]",
file: File(name: "image.jpg", buffer: yourByteBuffer)
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let file):
print(String(describing: file)
}
}
)
print(String(describing: file)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let storage = Storage(client)
storage.deleteFile(
let result = try await storage.deleteFile(
bucketId: "[BUCKET_ID]",
fileId: "[FILE_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let ):
print(String(describing: )
}
}
)
print(String(describing: result)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let storage = Storage(client)
storage.getFileDownload(
let byteBuffer = try await storage.getFileDownload(
bucketId: "[BUCKET_ID]",
fileId: "[FILE_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let storage = Storage(client)
storage.getFilePreview(
let byteBuffer = try await storage.getFilePreview(
bucketId: "[BUCKET_ID]",
fileId: "[FILE_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let storage = Storage(client)
storage.getFileView(
let byteBuffer = try await storage.getFileView(
bucketId: "[BUCKET_ID]",
fileId: "[FILE_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let storage = Storage(client)
storage.getFile(
let file = try await storage.getFile(
bucketId: "[BUCKET_ID]",
fileId: "[FILE_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let file):
print(String(describing: file)
}
}
)
print(String(describing: file)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let storage = Storage(client)
storage.listFiles(
let fileList = try await storage.listFiles(
bucketId: "[BUCKET_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let fileList):
print(String(describing: fileList)
}
}
)
print(String(describing: fileList)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let storage = Storage(client)
storage.updateFile(
let file = try await storage.updateFile(
bucketId: "[BUCKET_ID]",
fileId: "[FILE_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let file):
print(String(describing: file)
}
}
)
print(String(describing: file)
}

View file

@ -1,22 +1,16 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let teams = Teams(client)
teams.createMembership(
let membership = try await teams.createMembership(
teamId: "[TEAM_ID]",
email: "email@example.com",
roles: [],
url: "https://example.com"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let membership):
print(String(describing: membership)
}
}
)
print(String(describing: membership)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let teams = Teams(client)
teams.create(
let team = try await teams.create(
teamId: "[TEAM_ID]",
name: "[NAME]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let team):
print(String(describing: team)
}
}
)
print(String(describing: team)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let teams = Teams(client)
teams.deleteMembership(
let result = try await teams.deleteMembership(
teamId: "[TEAM_ID]",
membershipId: "[MEMBERSHIP_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let ):
print(String(describing: )
}
}
)
print(String(describing: result)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let teams = Teams(client)
teams.delete(
let result = try await teams.delete(
teamId: "[TEAM_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let ):
print(String(describing: )
}
}
)
print(String(describing: result)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let teams = Teams(client)
teams.getMembership(
let membershipList = try await teams.getMembership(
teamId: "[TEAM_ID]",
membershipId: "[MEMBERSHIP_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let membershipList):
print(String(describing: membershipList)
}
}
)
print(String(describing: membershipList)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let teams = Teams(client)
teams.getMemberships(
let membershipList = try await teams.getMemberships(
teamId: "[TEAM_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let membershipList):
print(String(describing: membershipList)
}
}
)
print(String(describing: membershipList)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let teams = Teams(client)
teams.get(
let team = try await teams.get(
teamId: "[TEAM_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let team):
print(String(describing: team)
}
}
)
print(String(describing: team)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let teams = Teams(client)
teams.list() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let teamList):
print(String(describing: teamList)
}
}
let teamList = try await teams.list()
print(String(describing: teamList)
}

View file

@ -1,21 +1,15 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let teams = Teams(client)
teams.updateMembershipRoles(
let membership = try await teams.updateMembershipRoles(
teamId: "[TEAM_ID]",
membershipId: "[MEMBERSHIP_ID]",
roles: []
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let membership):
print(String(describing: membership)
}
}
)
print(String(describing: membership)
}

View file

@ -1,22 +1,16 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let teams = Teams(client)
teams.updateMembershipStatus(
let membership = try await teams.updateMembershipStatus(
teamId: "[TEAM_ID]",
membershipId: "[MEMBERSHIP_ID]",
userId: "[USER_ID]",
secret: "[SECRET]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let membership):
print(String(describing: membership)
}
}
)
print(String(describing: membership)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let teams = Teams(client)
teams.update(
let team = try await teams.update(
teamId: "[TEAM_ID]",
name: "[NAME]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let team):
print(String(describing: team)
}
}
)
print(String(describing: team)
}

View file

@ -1,21 +1,15 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
let account = Account(client)
account.createRecovery(
let token = try await account.createRecovery(
email: "email@example.com",
url: "https://example.com"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let token):
print(String(describing: token)
}
}
)
print(String(describing: token)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
let account = Account(client)
account.createVerification(
let token = try await account.createVerification(
url: "https://example.com"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let token):
print(String(describing: token)
}
}
)
print(String(describing: token)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
let account = Account(client)
account.deleteSession(
let result = try await account.deleteSession(
sessionId: "[SESSION_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let ):
print(String(describing: )
}
}
)
print(String(describing: result)
}

View file

@ -1,18 +1,12 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
let account = Account(client)
account.deleteSessions() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let ):
print(String(describing: )
}
}
let result = try await account.deleteSessions()
print(String(describing: result)
}

View file

@ -1,18 +1,12 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
let account = Account(client)
account.delete() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let ):
print(String(describing: )
}
}
let result = try await account.delete()
print(String(describing: result)
}

Some files were not shown because too many files have changed in this diff Show more