1
0
Fork 0
mirror of synced 2024-06-29 11:40:45 +12:00

Merge branch 'master' into multi-stage-dockerfile

This commit is contained in:
(╯°□°)╯︵ uᴉǝssnH ɐɟɐʇsoW 2019-11-26 23:43:51 +02:00 committed by GitHub
commit 524810ce53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 162 additions and 92 deletions

View file

@ -14,20 +14,20 @@ notifications:
services: services:
- docker - docker
cache: # cache:
directories: # directories:
- docker_images # - docker_images
before_install: before_install:
- docker load -i docker_images/images.tar || true - docker load -i docker_images/images.tar || true
- sudo service mysql stop - sudo service mysql stop
before_cache: # before_cache:
- docker save -o docker_images/images.tar $(docker images -a -q) # - docker save -o docker_images/images.tar $(docker images -a -q)
install: install:
- docker-compose -f tests/resources/docker-compose.yml up -d - docker-compose -f tests/resources/docker-compose.yml up -d
- sleep 180 - sleep 90
script: script:
- docker ps - docker ps

View file

@ -16,6 +16,7 @@
## Security ## 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] * Remove executable permission from avatars files [Minor]
* Updated SDK Generator Twig dependency with security issue: https://www.exploit-db.com/exploits/44102 [Minor] * Updated SDK Generator Twig dependency with security issue: https://www.exploit-db.com/exploits/44102 [Minor]

View file

@ -34,7 +34,6 @@ RUN composer update --ignore-platform-reqs --optimize-autoloader \
`if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi` `if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`
FROM ubuntu:18.04 FROM ubuntu:18.04
LABEL maintainer="team@appwrite.io" LABEL maintainer="team@appwrite.io"
ENV TZ=Asia/Tel_Aviv \ ENV TZ=Asia/Tel_Aviv \

View file

@ -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. 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 ```bash
mkdir appwrite-ce && \ mkdir appwrite-ce && \
@ -103,7 +103,7 @@ For security issues, kindly email us [security@appwrite.io](mailto:security@appw
## Follow Us ## 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 ## Contributing

View file

@ -7,18 +7,18 @@ return [
'logo' => 'js.svg', 'logo' => 'js.svg',
'link' => 'https://github.com/appwrite/sdk-for-js', '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', 'label' => 'Node.js',
'versions' => ['v1.0.0'], 'versions' => ['v1.0.0'],
'logo' => 'nodejs.svg', 'logo' => 'nodejs.svg',
'link' => 'https://github.com/appwrite/sdk-for-node', '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', 'label' => 'Ruby',
'versions' => ['v1.0.0'], 'versions' => ['v1.0.0'],

View file

@ -43,15 +43,18 @@ $collections = include __DIR__.'/../app/config/collections.php'; // OAuth provid
$redisHost = $request->getServer('_APP_REDIS_HOST', ''); $redisHost = $request->getServer('_APP_REDIS_HOST', '');
$redisPort = $request->getServer('_APP_REDIS_PORT', ''); $redisPort = $request->getServer('_APP_REDIS_PORT', '');
$utopia = new App('Asia/Tel_Aviv', $env); $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); Resque::setBackend($redisHost.':'.$redisPort);
define('COOKIE_DOMAIN', ( define('COOKIE_DOMAIN',
$request->getServer('HTTP_HOST', null) === 'localhost' || (
$request->getServer('HTTP_HOST', null) === 'localhost:'.$port) $request->getServer('HTTP_HOST', null) === 'localhost' ||
$request->getServer('HTTP_HOST', null) === 'localhost:'.$port
)
? null ? 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 define('COOKIE_SAMESITE', null); // Response::COOKIE_SAMESITE_NONE
/* /*

View file

@ -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/ 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/ 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/ cookie_jar:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/cookie_jar-1.0.1/lib/

View file

@ -32,6 +32,10 @@ class Auth extends Service {
return await this.client.call('post', path: path, params: params); 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<Response> oauth({provider, success, failure}) async { Future<Response> oauth({provider, success, failure}) async {
String path = '/auth/login/oauth/{provider}'.replaceAll(RegExp('{provider}'), provider); String path = '/auth/login/oauth/{provider}'.replaceAll(RegExp('{provider}'), provider);

View file

@ -36,7 +36,10 @@ func (srv *Auth) Login(Email string, Password string, Success string, Failure st
return srv.client.Call("POST", path, nil, params) 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) { func (srv *Auth) Oauth(Provider string, Success string, Failure string) (map[string]interface{}, error) {
r := strings.NewReplacer("{provider}", Provider) r := strings.NewReplacer("{provider}", Provider)
path := r.Replace("/auth/login/oauth/{provider}") path := r.Replace("/auth/login/oauth/{provider}")

View file

@ -596,6 +596,10 @@
/** /**
* Login with OAuth * 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} provider
* @param {string} success * @param {string} success
@ -1748,7 +1752,7 @@
}, },
/** /**
* List of currencies * List Currencies
* *
* List of all currencies, including currency symol, name, plural, and decimal * 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 * digits for all major and minor currencies. You can use the locale header to

View file

@ -44,6 +44,11 @@ class Auth extends Service {
/** /**
* Login with OAuth * 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 provider
* @param string success * @param string success
* @param string failure * @param string failure

View file

@ -101,7 +101,7 @@ class Locale extends Service {
} }
/** /**
* List of currencies * List Currencies
* *
* List of all currencies, including currency symol, name, plural, and decimal * 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 * digits for all major and minor currencies. You can use the locale header to

View file

@ -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} 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&#039;s back to your app when login is completed. **
### Parameters ### Parameters
| Field Name | Type | Description | Default | | 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. | | | 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. | | | failure | string | **Required** URL to redirect back to your app after a failed login attempt. | |

View file

@ -30,8 +30,8 @@ POST https://appwrite.io/v1/database
| Field Name | Type | Description | Default | | Field Name | Type | Description | Default |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| name | string | Collection name. | | | 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. | | | 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 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](/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 | | | rules | array | Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation | |
## Get Collection ## Get Collection
@ -62,8 +62,8 @@ PUT https://appwrite.io/v1/database/{collectionId}
| --- | --- | --- | --- | | --- | --- | --- | --- |
| collectionId | string | **Required** Collection unique ID. | | | collectionId | string | **Required** Collection unique ID. | |
| name | string | Collection name. | | | 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. | | | 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 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](/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 | [] | | rules | array | Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation | [] |
## Delete Collection ## Delete Collection
@ -117,8 +117,8 @@ POST https://appwrite.io/v1/database/{collectionId}/documents
| --- | --- | --- | --- | | --- | --- | --- | --- |
| collectionId | string | **Required** Collection unique ID. | | | collectionId | string | **Required** Collection unique ID. | |
| data | string | Document data as JSON string. | | | 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. | | | 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 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](/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. | | | 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. | | | 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 | | 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 | | | collectionId | string | **Required** Collection unique ID | |
| documentId | string | **Required** Document unique ID | | | documentId | string | **Required** Document unique ID | |
| data | string | Document data as JSON string | | | 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. | | | 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 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](/docs/permissions) and get a full list of available permissions. | |
## Delete Document ## Delete Document

View file

@ -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 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 ```http request
GET https://appwrite.io/v1/locale/currencies GET https://appwrite.io/v1/locale/currencies

View file

@ -30,8 +30,8 @@ POST https://appwrite.io/v1/storage/files
| Field Name | Type | Description | Default | | Field Name | Type | Description | Default |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| files | file | Binary Files. | | | 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. | | | 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 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](/docs/permissions) and get a full list of available permissions. | |
| folderId | string | Folder to associate files with. | | | folderId | string | Folder to associate files with. | |
## Get File ## Get File
@ -61,8 +61,8 @@ PUT https://appwrite.io/v1/storage/files/{fileId}
| Field Name | Type | Description | Default | | Field Name | Type | Description | Default |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| fileId | string | **Required** File unique ID. | | | 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. | | | 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 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](/docs/permissions) and get a full list of available permissions. | |
| folderId | string | Folder to associate files with. | | | folderId | string | Folder to associate files with. | |
## Delete File ## Delete File

View file

@ -51,6 +51,11 @@ class Auth extends Service
/** /**
* Login with OAuth * 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 $provider
* @param string $success * @param string $success
* @param string $failure * @param string $failure

View file

@ -112,7 +112,7 @@ class Locale extends Service
} }
/** /**
* List of currencies * List Currencies
* *
* List of all currencies, including currency symol, name, plural, and decimal * 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 * digits for all major and minor currencies. You can use the locale header to

View file

@ -7,7 +7,7 @@ class Client:
self._endpoint = 'https://appwrite.io/v1' self._endpoint = 'https://appwrite.io/v1'
self._global_headers = { self._global_headers = {
'content-type': '', '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): def set_self_signed(self, status=True):

View file

@ -3,6 +3,9 @@ from ..service import Service
class Account(Service): class Account(Service):
def __init__(self, client):
super(Account, self).__init__(client)
def get(self): def get(self):
"""Get Account""" """Get Account"""

View file

@ -3,6 +3,9 @@ from ..service import Service
class Auth(Service): class Auth(Service):
def __init__(self, client):
super(Auth, self).__init__(client)
def login(self, email, password, success='', failure=''): def login(self, email, password, success='', failure=''):
"""Login""" """Login"""

View file

@ -3,6 +3,9 @@ from ..service import Service
class Avatars(Service): class Avatars(Service):
def __init__(self, client):
super(Avatars, self).__init__(client)
def get_browser(self, code, width=100, height=100, quality=100): def get_browser(self, code, width=100, height=100, quality=100):
"""Get Browser Icon""" """Get Browser Icon"""

View file

@ -3,6 +3,9 @@ from ..service import Service
class Database(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'): def list_collections(self, search='', limit=25, offset=0, order_type='ASC'):
"""List Collections""" """List Collections"""

View file

@ -3,6 +3,9 @@ from ..service import Service
class Locale(Service): class Locale(Service):
def __init__(self, client):
super(Locale, self).__init__(client)
def get_locale(self): def get_locale(self):
"""Get User Locale""" """Get User Locale"""
@ -54,7 +57,7 @@ class Locale(Service):
}, params) }, params)
def get_currencies(self): def get_currencies(self):
"""List of currencies""" """List Currencies"""
params = {} params = {}
path = '/locale/currencies' path = '/locale/currencies'

View file

@ -3,6 +3,9 @@ from ..service import Service
class Projects(Service): class Projects(Service):
def __init__(self, client):
super(Projects, self).__init__(client)
def list_projects(self): def list_projects(self):
"""List Projects""" """List Projects"""

View file

@ -3,6 +3,9 @@ from ..service import Service
class Storage(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'): def list_files(self, search='', limit=25, offset=0, order_type='ASC'):
"""List Files""" """List Files"""

View file

@ -3,6 +3,9 @@ from ..service import Service
class Teams(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'): def list_teams(self, search='', limit=25, offset=0, order_type='ASC'):
"""List Teams""" """List Teams"""

View file

@ -3,6 +3,9 @@ from ..service import Service
class Users(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'): def list_users(self, search='', limit=25, offset=0, order_type='ASC'):
"""List Users""" """List Users"""

View file

@ -0,0 +1,2 @@
[metadata]
description-file = README.md

View file

@ -1,9 +1,9 @@
from distutils.core import setup import setuptools
setup( setuptools.setup(
name = 'appwrite', name = 'appwrite',
packages = ['appwrite'], packages = ['appwrite', 'appwrite/services'],
version = '1.0.3', version = '0.0.1',
license='BSD-3-Clause', 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)', 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', author = 'Appwrite Team',
@ -11,21 +11,21 @@ setup(
maintainer = 'Appwrite Team', maintainer = 'Appwrite Team',
maintainer_email = 'team@appwrite.io', maintainer_email = 'team@appwrite.io',
url = 'https://appwrite.io/support', 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'], # keywords = ['SOME', 'MEANINGFULL', 'KEYWORDS'],
install_requires=[ install_requires=[
'requests', 'requests',
], ],
classifiers=[ classifiers=[
'Development Status :: 5 - PRODUCTION/STABLE', 'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers', 'Intended Audience :: Developers',
'Environment :: Web Environment', 'Environment :: Web Environment',
'Topic :: Software Development', 'Topic :: Software Development',
'License :: OSI Approved :: BSD-3-Clause', 'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.7',
], ],
) )

View file

@ -72,7 +72,7 @@ $cli
'platform' => 'server', 'platform' => 'server',
], ],
'python' => [ 'python' => [
'version' => '1.0.3', 'version' => '0.0.1',
'result' => __DIR__.'/../sdks/python/', 'result' => __DIR__.'/../sdks/python/',
'gitURL' => 'https://github.com/appwrite/sdk-for-python.git', 'gitURL' => 'https://github.com/appwrite/sdk-for-python.git',
'gitRepo' => 'git@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) { foreach ($clients as $name => $client) {
Console::info('Fetching API Spec for '.$name.' ('.$client['platform'].')'); 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.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']); $spec = getSSLPage('https://appwrite.test/v1/open-api-2.json?extensions=1&platform='.$client['platform']);
$license = 'BSD-3-Clause';
switch ($name) { switch ($name) {
case 'php': case 'php':
@ -149,7 +154,8 @@ $cli
$language $language
->setPipPackage('appwrite') ->setPipPackage('appwrite')
; ;
break; $license = 'BSD License'; // license edited due to classifiers in pypi
break;
case 'ruby': case 'ruby':
$language = new Ruby(); $language = new Ruby();
$language $language
@ -171,10 +177,14 @@ $cli
break; break;
} }
$target = __DIR__.'/../sdks/git/'.$name;
Console::success("Generating {$name} SDK");
$sdk = new SDK($language, new Swagger2($spec)); $sdk = new SDK($language, new Swagger2($spec));
$sdk $sdk
->setLicense('BSD-3-Clause') ->setLicense($license)
->setLicenseContent('Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors. ->setLicenseContent('Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors.
All rights reserved. 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') ->setShareTags('JS,javascript,reactjs,angular,ios,android')
->setShareVia('appwrite_io') ->setShareVia('appwrite_io')
->setWarning($client['warning']) ->setWarning($client['warning'])
->setReadme(($client['readme'] && file_exists($client['readme'])) ? file_get_contents($client['readme']) : '') ->setReadme(($client['readme'] && file_exists($client['readme'])) ? file_get_contents($client['readme']) : '');
;
$target = __DIR__.'/../sdks/git/'.$name;
Console::success("Generating {$name} SDK");
try { try {
$sdk->generate($client['result']); $sdk->generate($client['result']);
} catch (Exception $exception) { } catch (Exception $exception) {
echo $exception->getMessage()."\n"; Console::error($exception->getMessage());
} catch (Throwable $exception) { } catch (Throwable $exception) {
echo $exception->getMessage()."\n"; Console::error($exception->getMessage());
} }
exec('rm -rf '.$target.' && \ exec('rm -rf '.$target.' && \

View file

@ -39,6 +39,9 @@ $canonical = $this->getParam('canonical', '');
<meta property="og:type" content="website" /> <meta property="og:type" content="website" />
<meta property="og:title" content="<?php echo $this->getParam('title', ''); ?>" /> <meta property="og:title" content="<?php echo $this->getParam('title', ''); ?>" />
<meta property="og:description" content="<?php echo $this->getParam('description', ''); ?>" /> <meta property="og:description" content="<?php echo $this->getParam('description', ''); ?>" />
<?php if (!empty($canonical)): ?>
<meta property="og:url" content="<?php echo $canonical; ?>" />
<?php endif; ?>
<meta property="og:image" content="<?php echo $protocol; ?>://<?php echo $domain; ?>/images/logo.png?v=1" /> <meta property="og:image" content="<?php echo $protocol; ?>://<?php echo $domain; ?>/images/logo.png?v=1" />
<script> <script>

View file

@ -23,7 +23,7 @@ class TasksV1
public function perform() public function perform()
{ {
global $consoleDB, $register, $version; global $consoleDB, $version;
/* /*
* 1. Get Original Task * 1. Get Original Task
@ -44,6 +44,9 @@ class TasksV1
$delay = time() - $next; $delay = time() - $next;
$errors = []; $errors = [];
$timeout = 60 * 5; // 5 minutes $timeout = 60 * 5; // 5 minutes
$errorLimit = 5;
$logLimit = 5;
$alert = '';
if (empty($taskId)) { if (empty($taskId)) {
throw new Exception('Missing task $id'); throw new Exception('Missing task $id');
@ -78,7 +81,7 @@ class TasksV1
->setAttribute('previous', time()) ->setAttribute('previous', time())
; ;
ResqueScheduler::enqueueAt($next, 'v1-tasks', 'TasksV1', $task->getArrayCopy()); ResqueScheduler::enqueueAt($next, 'v1-tasks', 'TasksV1', $task->getArrayCopy()); // Async task rescheduale
$startTime = microtime(true); $startTime = microtime(true);
@ -147,15 +150,15 @@ class TasksV1
} else { } else {
$task $task
->setAttribute('failures', $task->getAttribute('failures', 0) + 1) ->setAttribute('failures', $task->getAttribute('failures', 0) + 1)
->setAttribute('status', ($task->getAttribute('failures') >= 5) ? 'pause' : 'play') ->setAttribute('status', ($task->getAttribute('failures') >= $errorLimit) ? 'pause' : 'play')
; ;
$alert = 'Task "'.$task->getAttribute('name').'" failed to execute with the following errors: '.implode($errors, "\n"); $alert = 'Task "'.$task->getAttribute('name').'" failed to execute with the following errors: '.implode("\n", $errors);
} }
$log = json_decode($task->getAttribute('log', '{}'), true); $log = json_decode($task->getAttribute('log', '{}'), true);
if (count($log) >= 5) { if (count($log) >= $logLimit) {
array_pop($log); array_pop($log);
} }
@ -182,6 +185,10 @@ class TasksV1
Authorization::enable(); Authorization::enable();
// ResqueScheduler::enqueueAt($next, 'v1-tasks', 'TasksV1', $task->getArrayCopy()); // Sync task rescheduale
// Send alert if needed (use SMTP as default for now)
return true; return true;
} }

46
composer.lock generated
View file

@ -12,12 +12,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/appwrite/sdk-for-php.git", "url": "https://github.com/appwrite/sdk-for-php.git",
"reference": "01e6c677412f0e5645201efae1f6c72f375382f4" "reference": "456248eec6af3541760468fea3e1708bf21a80ed"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/01e6c677412f0e5645201efae1f6c72f375382f4", "url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/456248eec6af3541760468fea3e1708bf21a80ed",
"reference": "01e6c677412f0e5645201efae1f6c72f375382f4", "reference": "456248eec6af3541760468fea3e1708bf21a80ed",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -39,7 +39,7 @@
"BSD-3-Clause" "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)", "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)",
"time": "2019-11-02T14:57:16+00:00" "time": "2019-11-20T18:50:32+00:00"
}, },
{ {
"name": "appwrite/php-clamav", "name": "appwrite/php-clamav",
@ -92,7 +92,7 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/appwrite/sdk-generator", "url": "https://github.com/appwrite/sdk-generator",
"reference": "2abc3444c1a70fad6a5e9f1689e0c12a75d56d9d" "reference": "7b5a8c8bc5865689f783f747f32c292dde44f658"
}, },
"require": { "require": {
"ext-curl": "*", "ext-curl": "*",
@ -122,7 +122,7 @@
} }
], ],
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
"time": "2019-11-07T05:09:16+00:00" "time": "2019-11-20T19:16:19+00:00"
}, },
{ {
"name": "bacon/bacon-qr-code", "name": "bacon/bacon-qr-code",
@ -1440,12 +1440,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/twigphp/Twig.git", "url": "https://github.com/twigphp/Twig.git",
"reference": "34a2a74596cfa6fb8f32415bc97f505d9f29bb8f" "reference": "aecce3d92ec0f860935f940f640223fa0e90cce8"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/34a2a74596cfa6fb8f32415bc97f505d9f29bb8f", "url": "https://api.github.com/repos/twigphp/Twig/zipball/aecce3d92ec0f860935f940f640223fa0e90cce8",
"reference": "34a2a74596cfa6fb8f32415bc97f505d9f29bb8f", "reference": "aecce3d92ec0f860935f940f640223fa0e90cce8",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1499,7 +1499,7 @@
"keywords": [ "keywords": [
"templating" "templating"
], ],
"time": "2019-11-15T20:27:23+00:00" "time": "2019-11-18T17:29:44+00:00"
}, },
{ {
"name": "utopia-php/abuse", "name": "utopia-php/abuse",
@ -2458,12 +2458,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "909e50ab13df443fa7ba2d1e4c990edf38ed02f8" "reference": "d2666181bc3c8ea5ad096f3eb7e4f1ad742c199f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/909e50ab13df443fa7ba2d1e4c990edf38ed02f8", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d2666181bc3c8ea5ad096f3eb7e4f1ad742c199f",
"reference": "909e50ab13df443fa7ba2d1e4c990edf38ed02f8", "reference": "d2666181bc3c8ea5ad096f3eb7e4f1ad742c199f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2534,7 +2534,7 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2019-11-15T08:22:24+00:00" "time": "2019-11-17T15:10:13+00:00"
}, },
{ {
"name": "sebastian/code-unit-reverse-lookup", "name": "sebastian/code-unit-reverse-lookup",
@ -2651,12 +2651,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/diff.git", "url": "https://github.com/sebastianbergmann/diff.git",
"reference": "2ce6675fe77612cce2a49d0cecb4e7afead64323" "reference": "16e54fbc971c14d98779b9c3b22572178ff9411f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/2ce6675fe77612cce2a49d0cecb4e7afead64323", "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/16e54fbc971c14d98779b9c3b22572178ff9411f",
"reference": "2ce6675fe77612cce2a49d0cecb4e7afead64323", "reference": "16e54fbc971c14d98779b9c3b22572178ff9411f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2664,7 +2664,7 @@
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^7.5 || ^8.0", "phpunit/phpunit": "^7.5 || ^8.0",
"symfony/process": "^2 || ^3.3 || ^4" "symfony/process": "^2 || ^3.3 || ^4 || ^5"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@ -2699,7 +2699,7 @@
"unidiff", "unidiff",
"unified diff" "unified diff"
], ],
"time": "2019-10-23T09:06:00+00:00" "time": "2019-11-18T19:26:59+00:00"
}, },
{ {
"name": "sebastian/environment", "name": "sebastian/environment",
@ -2707,12 +2707,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/environment.git", "url": "https://github.com/sebastianbergmann/environment.git",
"reference": "0f73ef4aa2d8a5e00393c06729012a50845e9e4c" "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/0f73ef4aa2d8a5e00393c06729012a50845e9e4c", "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368",
"reference": "0f73ef4aa2d8a5e00393c06729012a50845e9e4c", "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2752,7 +2752,7 @@
"environment", "environment",
"hhvm" "hhvm"
], ],
"time": "2019-10-23T09:05:42+00:00" "time": "2019-11-20T08:46:58+00:00"
}, },
{ {
"name": "sebastian/exporter", "name": "sebastian/exporter",

View file

@ -1 +1 @@
Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](/docs/modes). Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](/docs/admin).

View file

@ -1 +1 @@
Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](/docs/modes). Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](/docs/admin).

View file

@ -1 +1 @@
Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](/docs/modes). Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](/docs/admin).

View file

@ -1 +1 @@
Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](/docs/modes). Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](/docs/admin).