diff --git a/.travis.yml b/.travis.yml index 88aed9b168..ceafe8be54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,20 +14,20 @@ notifications: services: - docker -cache: - directories: - - docker_images +# cache: +# directories: +# - docker_images before_install: - docker load -i docker_images/images.tar || true - sudo service mysql stop -before_cache: -- docker save -o docker_images/images.tar $(docker images -a -q) +# before_cache: +# - docker save -o docker_images/images.tar $(docker images -a -q) install: - docker-compose -f tests/resources/docker-compose.yml up -d -- sleep 180 +- sleep 90 script: - docker ps diff --git a/CHANGES.md b/CHANGES.md index b137720d9e..7a47df7096 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,6 +16,7 @@ ## Security +* [PHP-FPM security patch fix](https://bugs.php.net/patch-display.php?bug_id=78599&patch=0001-Fix-bug-78599-env_path_info-underflow-can-lead-to-RC.patch&revision=latest) - Upgraded PHP version to 7.3.12 [Major] * Remove executable permission from avatars files [Minor] * Updated SDK Generator Twig dependency with security issue: https://www.exploit-db.com/exploits/44102 [Minor] diff --git a/Dockerfile b/Dockerfile index 9472bb9c51..3b0c23c2fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,7 +34,6 @@ RUN composer update --ignore-platform-reqs --optimize-autoloader \ `if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi` FROM ubuntu:18.04 - LABEL maintainer="team@appwrite.io" ENV TZ=Asia/Tel_Aviv \ diff --git a/README.md b/README.md index bdd9f71da7..297030a15f 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Table of Contents: Appwrite backend server is designed to run in a container environment. Running your server is as easy as running one command from your terminal. You can either run Appwrite on your localhost using docker-compose or on any other container orchestration tool like Kubernetes, Docker Swarm or Rancher. -The easiest way to start running your Appwrite server is by running our docker-compose file: +The easiest way to start running your Appwrite server is by running our docker-compose file. Before running the installation command make sure you have [Docker](https://www.docker.com/products/docker-desktop) installed on your machine: ```bash mkdir appwrite-ce && \ @@ -103,7 +103,7 @@ For security issues, kindly email us [security@appwrite.io](mailto:security@appw ## Follow Us -Join our growing community around the world! Follow us on [Twitter](https://twitter.com/appwrite_io), [Facebook Page](https://www.facebook.com/appwrite.io), [Facebook Group](https://www.facebook.com/groups/appwrite.developers/) or join our live [Gitter community](https://gitter.im/appwrite/community) for more help, ideas, and discussions. +Join our growing community around the world! Follow us on [Twitter](https://twitter.com/appwrite_io), [Facebook Page](https://www.facebook.com/appwrite.io), [Facebook Group](https://www.facebook.com/groups/appwrite.developers/) or join our live [Discord server](https://discord.gg/GSeTUeA) for more help, ideas, and discussions. ## Contributing diff --git a/app/config/sdks.php b/app/config/sdks.php index 21c864c5c6..04d46ea8a8 100644 --- a/app/config/sdks.php +++ b/app/config/sdks.php @@ -7,18 +7,18 @@ return [ 'logo' => 'js.svg', 'link' => 'https://github.com/appwrite/sdk-for-js', ], - [ - 'label' => 'PHP', - 'versions' => ['v1.0.0'], - 'logo' => 'php.svg', - 'link' => 'https://github.com/appwrite/sdk-for-php', - ], [ 'label' => 'Node.js', 'versions' => ['v1.0.0'], 'logo' => 'nodejs.svg', 'link' => 'https://github.com/appwrite/sdk-for-node', ], + [ + 'label' => 'PHP', + 'versions' => ['v1.0.0'], + 'logo' => 'php.svg', + 'link' => 'https://github.com/appwrite/sdk-for-php', + ], [ 'label' => 'Ruby', 'versions' => ['v1.0.0'], diff --git a/app/init.php b/app/init.php index 8aa758632e..5a6a4b91c0 100644 --- a/app/init.php +++ b/app/init.php @@ -43,15 +43,18 @@ $collections = include __DIR__.'/../app/config/collections.php'; // OAuth provid $redisHost = $request->getServer('_APP_REDIS_HOST', ''); $redisPort = $request->getServer('_APP_REDIS_PORT', ''); $utopia = new App('Asia/Tel_Aviv', $env); -$port = (string) (isset($_SERVER['HTTP_HOST'])) ? parse_url($_SERVER['HTTP_HOST'], PHP_URL_PORT) : ''; +$scheme = $request->getServer('REQUEST_SCHEME', ''); +$port = (string) parse_url($scheme.'://'.$request->getServer('HTTP_HOST', ''), PHP_URL_PORT); Resque::setBackend($redisHost.':'.$redisPort); -define('COOKIE_DOMAIN', ( - $request->getServer('HTTP_HOST', null) === 'localhost' || - $request->getServer('HTTP_HOST', null) === 'localhost:'.$port) +define('COOKIE_DOMAIN', + ( + $request->getServer('HTTP_HOST', null) === 'localhost' || + $request->getServer('HTTP_HOST', null) === 'localhost:'.$port + ) ? null - : '.'.parse_url($request->getServer('HTTP_HOST', false), PHP_URL_HOST)); + : '.'.parse_url($scheme.'://'.$request->getServer('HTTP_HOST', ''), PHP_URL_HOST)); define('COOKIE_SAMESITE', null); // Response::COOKIE_SAMESITE_NONE /* diff --git a/app/sdks/dart/.packages b/app/sdks/dart/.packages index d1ecc93e1e..6132450b51 100644 --- a/app/sdks/dart/.packages +++ b/app/sdks/dart/.packages @@ -1,4 +1,4 @@ -# Generated by pub on 2019-10-23 20:50:57.387283. +# Generated by pub on 2019-11-21 20:19:20.138749. charcode:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/charcode-1.1.2/lib/ collection:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/collection-1.14.12/lib/ cookie_jar:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/cookie_jar-1.0.1/lib/ diff --git a/app/sdks/dart/lib/services/auth.dart b/app/sdks/dart/lib/services/auth.dart index f74121f933..1fdb5aa134 100644 --- a/app/sdks/dart/lib/services/auth.dart +++ b/app/sdks/dart/lib/services/auth.dart @@ -32,6 +32,10 @@ class Auth extends Service { return await this.client.call('post', path: path, params: params); } + /// Allow the user to login to his account using the OAuth provider of his + /// choice. Each OAuth provider should be enabled from the Appwrite console + /// first. Use the success and failure arguments to provide a redirect URL's + /// back to your app when login is completed. Future oauth({provider, success, failure}) async { String path = '/auth/login/oauth/{provider}'.replaceAll(RegExp('{provider}'), provider); diff --git a/app/sdks/go/auth.go b/app/sdks/go/auth.go index 6605aa9cd7..b869140bb8 100644 --- a/app/sdks/go/auth.go +++ b/app/sdks/go/auth.go @@ -36,7 +36,10 @@ func (srv *Auth) Login(Email string, Password string, Success string, Failure st return srv.client.Call("POST", path, nil, params) } -// Oauth +// Oauth allow the user to login to his account using the OAuth provider of +// his choice. Each OAuth provider should be enabled from the Appwrite console +// first. Use the success and failure arguments to provide a redirect URL's +// back to your app when login is completed. func (srv *Auth) Oauth(Provider string, Success string, Failure string) (map[string]interface{}, error) { r := strings.NewReplacer("{provider}", Provider) path := r.Replace("/auth/login/oauth/{provider}") diff --git a/app/sdks/js/src/sdk.js b/app/sdks/js/src/sdk.js index 1391649cb0..f4628ff2a1 100644 --- a/app/sdks/js/src/sdk.js +++ b/app/sdks/js/src/sdk.js @@ -596,6 +596,10 @@ /** * Login with OAuth * + * Allow the user to login to his account using the OAuth provider of his + * choice. Each OAuth provider should be enabled from the Appwrite console + * first. Use the success and failure arguments to provide a redirect URL's + * back to your app when login is completed. * * @param {string} provider * @param {string} success @@ -1748,7 +1752,7 @@ }, /** - * List of currencies + * List Currencies * * List of all currencies, including currency symol, name, plural, and decimal * digits for all major and minor currencies. You can use the locale header to diff --git a/app/sdks/node/lib/services/auth.js b/app/sdks/node/lib/services/auth.js index 23652a326a..c88bb9bdf5 100644 --- a/app/sdks/node/lib/services/auth.js +++ b/app/sdks/node/lib/services/auth.js @@ -44,6 +44,11 @@ class Auth extends Service { /** * Login with OAuth * + * Allow the user to login to his account using the OAuth provider of his + * choice. Each OAuth provider should be enabled from the Appwrite console + * first. Use the success and failure arguments to provide a redirect URL's + * back to your app when login is completed. + * * @param string provider * @param string success * @param string failure diff --git a/app/sdks/node/lib/services/locale.js b/app/sdks/node/lib/services/locale.js index 8a37c24882..8233259394 100644 --- a/app/sdks/node/lib/services/locale.js +++ b/app/sdks/node/lib/services/locale.js @@ -101,7 +101,7 @@ class Locale extends Service { } /** - * List of currencies + * List Currencies * * List of all currencies, including currency symol, name, plural, and decimal * digits for all major and minor currencies. You can use the locale header to diff --git a/app/sdks/php/docs/auth.md b/app/sdks/php/docs/auth.md index a3dd0e1cad..2af37f5239 100644 --- a/app/sdks/php/docs/auth.md +++ b/app/sdks/php/docs/auth.md @@ -27,11 +27,13 @@ When accessing this route using Javascript from the browser, success and failure GET https://appwrite.io/v1/auth/login/oauth/{provider} ``` +** Allow the user to login to his account using the OAuth provider of his choice. Each OAuth provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. ** + ### Parameters | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| provider | string | **Required** OAuth Provider | | +| provider | string | **Required** OAuth Provider. Currently, supported providers are: bitbucket, facebook, github, gitlab, google, microsoft, linkedin, slack, dropbox, amazon, vk | | | success | string | **Required** URL to redirect back to your app after a successful login attempt. | | | failure | string | **Required** URL to redirect back to your app after a failed login attempt. | | diff --git a/app/sdks/php/docs/database.md b/app/sdks/php/docs/database.md index 27466663ff..6a92c27ce8 100644 --- a/app/sdks/php/docs/database.md +++ b/app/sdks/php/docs/database.md @@ -30,8 +30,8 @@ POST https://appwrite.io/v1/database | Field Name | Type | Description | Default | | --- | --- | --- | --- | | name | string | Collection name. | | -| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions and roles](/docs/permissions) and get a full list of available permissions. | | -| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions and roles](/docs/permissions) and get a full list of available permissions. | | +| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | +| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | | rules | array | Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation | | ## Get Collection @@ -62,8 +62,8 @@ PUT https://appwrite.io/v1/database/{collectionId} | --- | --- | --- | --- | | collectionId | string | **Required** Collection unique ID. | | | name | string | Collection name. | | -| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions and roles](/docs/permissions) and get a full list of available permissions. | | -| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions and roles](/docs/permissions) and get a full list of available permissions. | | +| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(/docs/permissions) and get a full list of available permissions. | | +| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | | rules | array | Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation | [] | ## Delete Collection @@ -117,8 +117,8 @@ POST https://appwrite.io/v1/database/{collectionId}/documents | --- | --- | --- | --- | | collectionId | string | **Required** Collection unique ID. | | | data | string | Document data as JSON string. | | -| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions and roles](/docs/permissions) and get a full list of available permissions. | | -| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions and roles](/docs/permissions) and get a full list of available permissions. | | +| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | +| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | | parentDocument | string | Parent document unique ID. Use when you want your new document to be a child of a parent document. | | | parentProperty | string | Parent document property name. Use when you want your new document to be a child of a parent document. | | | parentPropertyType | string | Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document. | assign | @@ -151,8 +151,8 @@ PATCH https://appwrite.io/v1/database/{collectionId}/documents/{documentId} | collectionId | string | **Required** Collection unique ID | | | documentId | string | **Required** Document unique ID | | | data | string | Document data as JSON string | | -| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions and roles](/docs/permissions) and get a full list of available permissions. | | -| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions and roles](/docs/permissions) and get a full list of available permissions. | | +| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | +| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | ## Delete Document diff --git a/app/sdks/php/docs/locale.md b/app/sdks/php/docs/locale.md index 16cce2f9c6..81190fa96c 100644 --- a/app/sdks/php/docs/locale.md +++ b/app/sdks/php/docs/locale.md @@ -40,7 +40,7 @@ GET https://appwrite.io/v1/locale/countries/phones ** List of all countries phone codes. You can use the locale header to get the data in a supported language. ** -## List of currencies +## List Currencies ```http request GET https://appwrite.io/v1/locale/currencies diff --git a/app/sdks/php/docs/storage.md b/app/sdks/php/docs/storage.md index f7833daf46..b86730d177 100644 --- a/app/sdks/php/docs/storage.md +++ b/app/sdks/php/docs/storage.md @@ -30,8 +30,8 @@ POST https://appwrite.io/v1/storage/files | Field Name | Type | Description | Default | | --- | --- | --- | --- | | files | file | Binary Files. | | -| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions and roles](/docs/permissions) and get a full list of available permissions. | | -| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions and roles](/docs/permissions) and get a full list of available permissions. | | +| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | +| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | | folderId | string | Folder to associate files with. | | ## Get File @@ -61,8 +61,8 @@ PUT https://appwrite.io/v1/storage/files/{fileId} | Field Name | Type | Description | Default | | --- | --- | --- | --- | | fileId | string | **Required** File unique ID. | | -| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions and roles](/docs/permissions) and get a full list of available permissions. | | -| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions and roles](/docs/permissions) and get a full list of available permissions. | | +| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | +| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | | folderId | string | Folder to associate files with. | | ## Delete File diff --git a/app/sdks/php/src/Appwrite/Services/Auth.php b/app/sdks/php/src/Appwrite/Services/Auth.php index 980dbcd9b4..31a48ebebd 100644 --- a/app/sdks/php/src/Appwrite/Services/Auth.php +++ b/app/sdks/php/src/Appwrite/Services/Auth.php @@ -51,6 +51,11 @@ class Auth extends Service /** * Login with OAuth * + * Allow the user to login to his account using the OAuth provider of his + * choice. Each OAuth provider should be enabled from the Appwrite console + * first. Use the success and failure arguments to provide a redirect URL's + * back to your app when login is completed. + * * @param string $provider * @param string $success * @param string $failure diff --git a/app/sdks/php/src/Appwrite/Services/Locale.php b/app/sdks/php/src/Appwrite/Services/Locale.php index c2e5e0ec14..fafeabc7fd 100644 --- a/app/sdks/php/src/Appwrite/Services/Locale.php +++ b/app/sdks/php/src/Appwrite/Services/Locale.php @@ -112,7 +112,7 @@ class Locale extends Service } /** - * List of currencies + * List Currencies * * List of all currencies, including currency symol, name, plural, and decimal * digits for all major and minor currencies. You can use the locale header to diff --git a/app/sdks/python/appwrite/client.py b/app/sdks/python/appwrite/client.py index d2a9f1a042..66ee922b56 100644 --- a/app/sdks/python/appwrite/client.py +++ b/app/sdks/python/appwrite/client.py @@ -7,7 +7,7 @@ class Client: self._endpoint = 'https://appwrite.io/v1' self._global_headers = { 'content-type': '', - 'x-sdk-version': 'appwrite:python:1.0.3', + 'x-sdk-version': 'appwrite:python:0.0.1', } def set_self_signed(self, status=True): diff --git a/app/sdks/python/appwrite/services/account.py b/app/sdks/python/appwrite/services/account.py index 53394a3e15..4b38e4a824 100644 --- a/app/sdks/python/appwrite/services/account.py +++ b/app/sdks/python/appwrite/services/account.py @@ -3,6 +3,9 @@ from ..service import Service class Account(Service): + def __init__(self, client): + super(Account, self).__init__(client) + def get(self): """Get Account""" diff --git a/app/sdks/python/appwrite/services/auth.py b/app/sdks/python/appwrite/services/auth.py index 9f92b9cab7..1a970252d8 100644 --- a/app/sdks/python/appwrite/services/auth.py +++ b/app/sdks/python/appwrite/services/auth.py @@ -3,6 +3,9 @@ from ..service import Service class Auth(Service): + def __init__(self, client): + super(Auth, self).__init__(client) + def login(self, email, password, success='', failure=''): """Login""" diff --git a/app/sdks/python/appwrite/services/avatars.py b/app/sdks/python/appwrite/services/avatars.py index 2f68663b65..cd998c6639 100644 --- a/app/sdks/python/appwrite/services/avatars.py +++ b/app/sdks/python/appwrite/services/avatars.py @@ -3,6 +3,9 @@ from ..service import Service class Avatars(Service): + def __init__(self, client): + super(Avatars, self).__init__(client) + def get_browser(self, code, width=100, height=100, quality=100): """Get Browser Icon""" diff --git a/app/sdks/python/appwrite/services/database.py b/app/sdks/python/appwrite/services/database.py index 84149225c6..7a85d07d55 100644 --- a/app/sdks/python/appwrite/services/database.py +++ b/app/sdks/python/appwrite/services/database.py @@ -3,6 +3,9 @@ from ..service import Service class Database(Service): + def __init__(self, client): + super(Database, self).__init__(client) + def list_collections(self, search='', limit=25, offset=0, order_type='ASC'): """List Collections""" diff --git a/app/sdks/python/appwrite/services/locale.py b/app/sdks/python/appwrite/services/locale.py index 514d38e1a2..4982618c9b 100644 --- a/app/sdks/python/appwrite/services/locale.py +++ b/app/sdks/python/appwrite/services/locale.py @@ -3,6 +3,9 @@ from ..service import Service class Locale(Service): + def __init__(self, client): + super(Locale, self).__init__(client) + def get_locale(self): """Get User Locale""" @@ -54,7 +57,7 @@ class Locale(Service): }, params) def get_currencies(self): - """List of currencies""" + """List Currencies""" params = {} path = '/locale/currencies' diff --git a/app/sdks/python/appwrite/services/projects.py b/app/sdks/python/appwrite/services/projects.py index 303ca7e43c..838b14e37b 100644 --- a/app/sdks/python/appwrite/services/projects.py +++ b/app/sdks/python/appwrite/services/projects.py @@ -3,6 +3,9 @@ from ..service import Service class Projects(Service): + def __init__(self, client): + super(Projects, self).__init__(client) + def list_projects(self): """List Projects""" diff --git a/app/sdks/python/appwrite/services/storage.py b/app/sdks/python/appwrite/services/storage.py index b15084bf20..1ac3601374 100644 --- a/app/sdks/python/appwrite/services/storage.py +++ b/app/sdks/python/appwrite/services/storage.py @@ -3,6 +3,9 @@ from ..service import Service class Storage(Service): + def __init__(self, client): + super(Storage, self).__init__(client) + def list_files(self, search='', limit=25, offset=0, order_type='ASC'): """List Files""" diff --git a/app/sdks/python/appwrite/services/teams.py b/app/sdks/python/appwrite/services/teams.py index 9a72a4d8c2..d30a6e71da 100644 --- a/app/sdks/python/appwrite/services/teams.py +++ b/app/sdks/python/appwrite/services/teams.py @@ -3,6 +3,9 @@ from ..service import Service class Teams(Service): + def __init__(self, client): + super(Teams, self).__init__(client) + def list_teams(self, search='', limit=25, offset=0, order_type='ASC'): """List Teams""" diff --git a/app/sdks/python/appwrite/services/users.py b/app/sdks/python/appwrite/services/users.py index 0f15828bd4..79e08e567f 100644 --- a/app/sdks/python/appwrite/services/users.py +++ b/app/sdks/python/appwrite/services/users.py @@ -3,6 +3,9 @@ from ..service import Service class Users(Service): + def __init__(self, client): + super(Users, self).__init__(client) + def list_users(self, search='', limit=25, offset=0, order_type='ASC'): """List Users""" diff --git a/app/sdks/python/setup.cfg b/app/sdks/python/setup.cfg new file mode 100644 index 0000000000..224a77957f --- /dev/null +++ b/app/sdks/python/setup.cfg @@ -0,0 +1,2 @@ +[metadata] +description-file = README.md \ No newline at end of file diff --git a/app/sdks/python/setup.py b/app/sdks/python/setup.py index 119a1591ba..fb60994565 100644 --- a/app/sdks/python/setup.py +++ b/app/sdks/python/setup.py @@ -1,9 +1,9 @@ -from distutils.core import setup +import setuptools -setup( +setuptools.setup( name = 'appwrite', - packages = ['appwrite'], - version = '1.0.3', + packages = ['appwrite', 'appwrite/services'], + version = '0.0.1', license='BSD-3-Clause', 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)', author = 'Appwrite Team', @@ -11,21 +11,21 @@ setup( maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/1.0.3.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/0.0.1.tar.gz', # keywords = ['SOME', 'MEANINGFULL', 'KEYWORDS'], install_requires=[ 'requests', ], classifiers=[ - 'Development Status :: 5 - PRODUCTION/STABLE', + 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Environment :: Web Environment', 'Topic :: Software Development', - 'License :: OSI Approved :: BSD-3-Clause', + 'License :: OSI Approved :: BSD License', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ], -) \ No newline at end of file +) diff --git a/app/tasks/sdks.php b/app/tasks/sdks.php index 08c308882e..80f2a40a5e 100644 --- a/app/tasks/sdks.php +++ b/app/tasks/sdks.php @@ -72,7 +72,7 @@ $cli 'platform' => 'server', ], 'python' => [ - 'version' => '1.0.3', + 'version' => '0.0.1', 'result' => __DIR__.'/../sdks/python/', 'gitURL' => 'https://github.com/appwrite/sdk-for-python.git', 'gitRepo' => 'git@github.com:appwrite/sdk-for-python.git', @@ -117,10 +117,15 @@ $cli ], ]; + foreach ($clients as $name => $client) { + Console::info('Fetching API Spec for '.$name.' ('.$client['platform'].')'); + $spec = getSSLPage('https://appwrite.io/v1/open-api-2.json?extensions=1&platform='.$client['platform']); $spec = getSSLPage('https://appwrite.test/v1/open-api-2.json?extensions=1&platform='.$client['platform']); + + $license = 'BSD-3-Clause'; switch ($name) { case 'php': @@ -149,7 +154,8 @@ $cli $language ->setPipPackage('appwrite') ; - break; + $license = 'BSD License'; // license edited due to classifiers in pypi + break; case 'ruby': $language = new Ruby(); $language @@ -171,10 +177,14 @@ $cli break; } + $target = __DIR__.'/../sdks/git/'.$name; + + Console::success("Generating {$name} SDK"); + $sdk = new SDK($language, new Swagger2($spec)); $sdk - ->setLicense('BSD-3-Clause') + ->setLicense($license) ->setLicenseContent('Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors. All rights reserved. @@ -199,19 +209,14 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ->setShareTags('JS,javascript,reactjs,angular,ios,android') ->setShareVia('appwrite_io') ->setWarning($client['warning']) - ->setReadme(($client['readme'] && file_exists($client['readme'])) ? file_get_contents($client['readme']) : '') - ; - - $target = __DIR__.'/../sdks/git/'.$name; - - Console::success("Generating {$name} SDK"); + ->setReadme(($client['readme'] && file_exists($client['readme'])) ? file_get_contents($client['readme']) : ''); try { $sdk->generate($client['result']); } catch (Exception $exception) { - echo $exception->getMessage()."\n"; + Console::error($exception->getMessage()); } catch (Throwable $exception) { - echo $exception->getMessage()."\n"; + Console::error($exception->getMessage()); } exec('rm -rf '.$target.' && \ diff --git a/app/views/layouts/default.phtml b/app/views/layouts/default.phtml index b46f53d469..9fe80484c1 100644 --- a/app/views/layouts/default.phtml +++ b/app/views/layouts/default.phtml @@ -39,6 +39,9 @@ $canonical = $this->getParam('canonical', ''); + + +