Merge branch 'master' into multi-stage-dockerfile
This commit is contained in:
commit
524810ce53
12
.travis.yml
12
.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
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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'],
|
||||
|
|
13
app/init.php
13
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
|
||||
|
||||
/*
|
||||
|
|
|
@ -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/
|
||||
|
|
|
@ -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<Response> oauth({provider, success, failure}) async {
|
||||
String path = '/auth/login/oauth/{provider}'.replaceAll(RegExp('{provider}'), provider);
|
||||
|
||||
|
|
|
@ -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}")
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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. | |
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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"""
|
||||
|
||||
|
|
|
@ -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"""
|
||||
|
||||
|
|
|
@ -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"""
|
||||
|
||||
|
|
|
@ -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"""
|
||||
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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"""
|
||||
|
||||
|
|
|
@ -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"""
|
||||
|
||||
|
|
|
@ -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"""
|
||||
|
||||
|
|
|
@ -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"""
|
||||
|
||||
|
|
2
app/sdks/python/setup.cfg
Normal file
2
app/sdks/python/setup.cfg
Normal file
|
@ -0,0 +1,2 @@
|
|||
[metadata]
|
||||
description-file = README.md
|
|
@ -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,17 +11,17 @@ 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',
|
||||
|
|
|
@ -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,11 +117,16 @@ $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':
|
||||
$language = new 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.' && \
|
||||
|
|
|
@ -39,6 +39,9 @@ $canonical = $this->getParam('canonical', '');
|
|||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content="<?php echo $this->getParam('title', ''); ?>" />
|
||||
<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" />
|
||||
<script>
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ class TasksV1
|
|||
|
||||
public function perform()
|
||||
{
|
||||
global $consoleDB, $register, $version;
|
||||
global $consoleDB, $version;
|
||||
|
||||
/*
|
||||
* 1. Get Original Task
|
||||
|
@ -44,6 +44,9 @@ class TasksV1
|
|||
$delay = time() - $next;
|
||||
$errors = [];
|
||||
$timeout = 60 * 5; // 5 minutes
|
||||
$errorLimit = 5;
|
||||
$logLimit = 5;
|
||||
$alert = '';
|
||||
|
||||
if (empty($taskId)) {
|
||||
throw new Exception('Missing task $id');
|
||||
|
@ -78,7 +81,7 @@ class TasksV1
|
|||
->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);
|
||||
|
||||
|
@ -147,15 +150,15 @@ class TasksV1
|
|||
} else {
|
||||
$task
|
||||
->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);
|
||||
|
||||
if (count($log) >= 5) {
|
||||
if (count($log) >= $logLimit) {
|
||||
array_pop($log);
|
||||
}
|
||||
|
||||
|
@ -182,6 +185,10 @@ class TasksV1
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
46
composer.lock
generated
46
composer.lock
generated
|
@ -12,12 +12,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/appwrite/sdk-for-php.git",
|
||||
"reference": "01e6c677412f0e5645201efae1f6c72f375382f4"
|
||||
"reference": "456248eec6af3541760468fea3e1708bf21a80ed"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/01e6c677412f0e5645201efae1f6c72f375382f4",
|
||||
"reference": "01e6c677412f0e5645201efae1f6c72f375382f4",
|
||||
"url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/456248eec6af3541760468fea3e1708bf21a80ed",
|
||||
"reference": "456248eec6af3541760468fea3e1708bf21a80ed",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -39,7 +39,7 @@
|
|||
"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)",
|
||||
"time": "2019-11-02T14:57:16+00:00"
|
||||
"time": "2019-11-20T18:50:32+00:00"
|
||||
},
|
||||
{
|
||||
"name": "appwrite/php-clamav",
|
||||
|
@ -92,7 +92,7 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/appwrite/sdk-generator",
|
||||
"reference": "2abc3444c1a70fad6a5e9f1689e0c12a75d56d9d"
|
||||
"reference": "7b5a8c8bc5865689f783f747f32c292dde44f658"
|
||||
},
|
||||
"require": {
|
||||
"ext-curl": "*",
|
||||
|
@ -122,7 +122,7 @@
|
|||
}
|
||||
],
|
||||
"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",
|
||||
|
@ -1440,12 +1440,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/twigphp/Twig.git",
|
||||
"reference": "34a2a74596cfa6fb8f32415bc97f505d9f29bb8f"
|
||||
"reference": "aecce3d92ec0f860935f940f640223fa0e90cce8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/34a2a74596cfa6fb8f32415bc97f505d9f29bb8f",
|
||||
"reference": "34a2a74596cfa6fb8f32415bc97f505d9f29bb8f",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/aecce3d92ec0f860935f940f640223fa0e90cce8",
|
||||
"reference": "aecce3d92ec0f860935f940f640223fa0e90cce8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -1499,7 +1499,7 @@
|
|||
"keywords": [
|
||||
"templating"
|
||||
],
|
||||
"time": "2019-11-15T20:27:23+00:00"
|
||||
"time": "2019-11-18T17:29:44+00:00"
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/abuse",
|
||||
|
@ -2458,12 +2458,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||
"reference": "909e50ab13df443fa7ba2d1e4c990edf38ed02f8"
|
||||
"reference": "d2666181bc3c8ea5ad096f3eb7e4f1ad742c199f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/909e50ab13df443fa7ba2d1e4c990edf38ed02f8",
|
||||
"reference": "909e50ab13df443fa7ba2d1e4c990edf38ed02f8",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d2666181bc3c8ea5ad096f3eb7e4f1ad742c199f",
|
||||
"reference": "d2666181bc3c8ea5ad096f3eb7e4f1ad742c199f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -2534,7 +2534,7 @@
|
|||
"testing",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2019-11-15T08:22:24+00:00"
|
||||
"time": "2019-11-17T15:10:13+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/code-unit-reverse-lookup",
|
||||
|
@ -2651,12 +2651,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/diff.git",
|
||||
"reference": "2ce6675fe77612cce2a49d0cecb4e7afead64323"
|
||||
"reference": "16e54fbc971c14d98779b9c3b22572178ff9411f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/2ce6675fe77612cce2a49d0cecb4e7afead64323",
|
||||
"reference": "2ce6675fe77612cce2a49d0cecb4e7afead64323",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/16e54fbc971c14d98779b9c3b22572178ff9411f",
|
||||
"reference": "16e54fbc971c14d98779b9c3b22572178ff9411f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -2664,7 +2664,7 @@
|
|||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^7.5 || ^8.0",
|
||||
"symfony/process": "^2 || ^3.3 || ^4"
|
||||
"symfony/process": "^2 || ^3.3 || ^4 || ^5"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
|
@ -2699,7 +2699,7 @@
|
|||
"unidiff",
|
||||
"unified diff"
|
||||
],
|
||||
"time": "2019-10-23T09:06:00+00:00"
|
||||
"time": "2019-11-18T19:26:59+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/environment",
|
||||
|
@ -2707,12 +2707,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/environment.git",
|
||||
"reference": "0f73ef4aa2d8a5e00393c06729012a50845e9e4c"
|
||||
"reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/0f73ef4aa2d8a5e00393c06729012a50845e9e4c",
|
||||
"reference": "0f73ef4aa2d8a5e00393c06729012a50845e9e4c",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368",
|
||||
"reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -2752,7 +2752,7 @@
|
|||
"environment",
|
||||
"hhvm"
|
||||
],
|
||||
"time": "2019-10-23T09:05:42+00:00"
|
||||
"time": "2019-11-20T08:46:58+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/exporter",
|
||||
|
|
|
@ -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).
|
|
@ -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).
|
|
@ -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).
|
|
@ -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).
|
Loading…
Reference in a new issue