1
0
Fork 0
mirror of synced 2024-06-23 08:40:58 +12:00

Merge branch 'master' of github.com:appwrite/appwrite into functions

This commit is contained in:
Eldad Fux 2020-05-22 22:01:47 +03:00
commit 6d8a3e4496
66 changed files with 424 additions and 388 deletions

View file

@ -1,171 +1,182 @@
# Version 0.6.1 (PRE-RELEASE)
## Bug Fixes
- Fix for Google OAuth provider not working properly
- Fix for login error when using a remote host with non-default ports
- Removed empty activity tab on the document editor
- Changed upgrade script name to migrate to better reflect what it actually does
- Fixed bug where after clicking the cancel option in the confirmation dialog the button got disabled
- Fixed a small grammar error in the documents list screen
# Version 0.6.0 (PRE-RELEASE)
## Features
* New collections UI with ability to create and update a collection
* New documents UI with ability to create and update a document
* Added support for Flutter iOS & Android apps
* Added support for default DB document values
* Exposed health API to all the server SDKs
* New locale for Khmer
* Added TypeScript type hinting to the JS SDK (@zevektor)
* Added LTR/RTL support for markdown editor
* Added cachebuster to version number on footer
* New OAuth logos
* Minor fixes to the dark mode theme
* Added JSON view for a project user
* Removed setKey and setMode methods from all client SDKs
- New collections UI with ability to create and update a collection
- New documents UI with ability to create and update a document
- Added support for Flutter iOS & Android apps
- Added support for default DB document values
- Exposed health API to all the server SDKs
- New locale for Khmer
- Added TypeScript type hinting to the JS SDK (@zevektor)
- Added LTR/RTL support for markdown editor
- Added cachebuster to version number on footer
- New OAuth logos
- Minor fixes to the dark mode theme
- Added JSON view for a project user
- Removed setKey and setMode methods from all client SDKs
## Breaking Changes
* Updated all the REST API query params to be in camelCase
* Normalized locale phone codes response body
- Updated all the REST API query params to be in camelCase
- Normalized locale phone codes response body
## Bug Fixes
* Fixed project users logout button
* Fixed wrong target in database back link
- Fixed project users logout button
- Fixed wrong target in database back link
# Version 0.5.3 (PRE-RELEASE)
## Bug Fixes
* Fixed bug where multiple unique attribute were allowed
* Blocked forms from being submitted unlimited times
- Fixed bug where multiple unique attribute were allowed
- Blocked forms from being submitted unlimited times
# Version 0.5.2 (PRE-RELEASE)
## Bug Fixes
* Fixed missing attributes in user account
- Fixed missing attributes in user account
# Version 0.5.1 (PRE-RELEASE)
## Bug Fixes
* Delayed SSL init when server startup for traefik to be ready for HTTP challenge
* Enabled easy access to the upgrade tool from the terminal
- Delayed SSL init when server startup for traefik to be ready for HTTP challenge
- Enabled easy access to the upgrade tool from the terminal
# Version 0.5.0 (PRE-RELEASE)
## Features
* Upgraded core API PHP version to 7.4
* New database rule validation options
* Allow non-web platform to skip origin header
* Limited console dashboard to show max 5 alerts at the same time
* Added more webhooks events
* Normailized all webhooks event names
* Added support for SameSite cookie option with fallback cookie for old clients
* Added a new Discord OAuth adapter
* Added a new Twitch OAuth adapter
* Added a new Spotify OAuth adapter
* Added a new Yahoo OAuth adapter
* Added a new Salesforce OAuth adapter
* Added a new Yandex OAuth adapter
* Added a new Paypal OAuth adapter
* Added a new Bitly OAuth adapter
* Upgraded MariaDB image to version 1.0.2
* Upgraded SMTP image to version 1.0.1
* File upload route (POST /v1/storage/files) now accept a single file per request
* Added ENV vars to change system email sender name and address
* Usage for requests made by project admin in the console are not counted as API usage
* Added ENV var to change default file upload size limit. New default value is 100MB
* Added option to delete file directly from the dashboard
* Added option to view file preview from the dashboard
* Added option to add custom domains with auto SSL certificate generator
- Upgraded core API PHP version to 7.4
- New database rule validation options
- Allow non-web platform to skip origin header
- Limited console dashboard to show max 5 alerts at the same time
- Added more webhooks events
- Normailized all webhooks event names
- Added support for SameSite cookie option with fallback cookie for old clients
- Added a new Discord OAuth adapter
- Added a new Twitch OAuth adapter
- Added a new Spotify OAuth adapter
- Added a new Yahoo OAuth adapter
- Added a new Salesforce OAuth adapter
- Added a new Yandex OAuth adapter
- Added a new Paypal OAuth adapter
- Added a new Bitly OAuth adapter
- Upgraded MariaDB image to version 1.0.2
- Upgraded SMTP image to version 1.0.1
- File upload route (POST /v1/storage/files) now accept a single file per request
- Added ENV vars to change system email sender name and address
- Usage for requests made by project admin in the console are not counted as API usage
- Added ENV var to change default file upload size limit. New default value is 100MB
- Added option to delete file directly from the dashboard
- Added option to view file preview from the dashboard
- Added option to add custom domains with auto SSL certificate generator
## Bug Fixes
* Fixed bug where user status was saved as a string instead of an integer
* Fixed gravatar icons not showing up correctly on the console
* Fixed code location of project not found error
* Fixed bug where tags element would ignore tab key for parsing new tags
* Fixed OAuth login error saying project UID is missing when its not
* Fixed wrong input validation for user preferences
- Fixed bug where user status was saved as a string instead of an integer
- Fixed gravatar icons not showing up correctly on the console
- Fixed code location of project not found error
- Fixed bug where tags element would ignore tab key for parsing new tags
- Fixed OAuth login error saying project UID is missing when its not
- Fixed wrong input validation for user preferences
## Breaking Changes
* Merged Auth and Account service route to make the API REST compatible
- Merged Auth and Account service route to make the API REST compatible
# Version 0.4.0 (PRE-RELEASE)
## Features
* Added 5 new locales for locale service and email templates (is, ml, th, fo, ph, pn)
* 2 stage Docker build
* Limit HTTP origin check only to browser integrations
* Updated new Brexit date to 31-01-2020
* Added a version number to sign in and signup pages for easier debugging of issues
* Preparation for adding SameSite cookie option support
* Using native Docker volumes for setup for better cross-platform support and easier management of read/write permissions
* Added support for custom SSL certificates without needing to set a proxy
* Added project UID validation check when making an API call. This should help developers to understand our authentication errors better.
* Updated ClamAV docker image to version 1.0.7
* Updated MariaDB docker image to version 1.0.1
* Core Docker image size reduced to 127MB
- Added 5 new locales for locale service and email templates (is, ml, th, fo, ph, pn)
- 2 stage Docker build
- Limit HTTP origin check only to browser integrations
- Updated new Brexit date to 31-01-2020
- Added a version number to sign in and signup pages for easier debugging of issues
- Preparation for adding SameSite cookie option support
- Using native Docker volumes for setup for better cross-platform support and easier management of read/write permissions
- Added support for custom SSL certificates without needing to set a proxy
- Added project UID validation check when making an API call. This should help developers to understand our authentication errors better.
- Updated ClamAV docker image to version 1.0.7
- Updated MariaDB docker image to version 1.0.1
- Core Docker image size reduced to 127MB
## 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]
- [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]
## Bug Fixes
* New loading message when creating a new project
* Fixed broken redirect URL when creating a new project
* Fixed broken modal when a user password is too short
* Fixed issue denying the creation of session cookies on localhosts with port other than 80 or 443
* Fixed bug that prevented actual file size calculation
* Fixed MariaDB SQL abuse table time field-type
* Fixed error message not showing up in console failed signup
* Fixed cookie session not being appropriately set when accessing the console from IP hostname
- New loading message when creating a new project
- Fixed broken redirect URL when creating a new project
- Fixed broken modal when a user password is too short
- Fixed issue denying the creation of session cookies on localhosts with port other than 80 or 443
- Fixed bug that prevented actual file size calculation
- Fixed MariaDB SQL abuse table time field-type
- Fixed error message not showing up in console failed signup
- Fixed cookie session not being appropriately set when accessing the console from IP hostname
## Breaking Changes
* OAuth path is now /auth/login/oauth instead of /auth/oauth and /auth/oauth/callback is now /auth/login/oauth/callback, this is for better consistency with new login methods we will introduce in the future
* Changed file attribute sizeCompressed to sizeActual to better reflect server logic
- OAuth path is now /auth/login/oauth instead of /auth/oauth and /auth/oauth/callback is now /auth/login/oauth/callback, this is for better consistency with new login methods we will introduce in the future
- Changed file attribute sizeCompressed to sizeActual to better reflect server logic
# Version 0.3.0 (PRE-RELEASE)
## Features
* Added 19 new locales for locale service and email templates (af, ar, bn, cz, hu, hy, jv, ko, lt, ml, no, ru, si, sq, sv, ta, vi, zh-cn, zh-tw)
* New users service routes to allow updates pref and name update
* New OAuth adapters (Amazon, Dropbox, Microsoft, Slack, VK)
* Added support for ES6 require statements in JS SDK
* New Locale API route for fetching a list of continents
- Added 19 new locales for locale service and email templates (af, ar, bn, cz, hu, hy, jv, ko, lt, ml, no, ru, si, sq, sv, ta, vi, zh-cn, zh-tw)
- New users service routes to allow updates pref and name update
- New OAuth adapters (Amazon, Dropbox, Microsoft, Slack, VK)
- Added support for ES6 require statements in JS SDK
- New Locale API route for fetching a list of continents
## Bug Fixes
* Fix for typos in PT-BR translations
* Fix for UI crash when project user was missing a name
* Fix for it locale including the en templates by mistake
* Fix for UI not showing user's prefs properly
* Fixed 401 unexpected error when no permission passed in creation of a new resource
- Fix for typos in PT-BR translations
- Fix for UI crash when project user was missing a name
- Fix for it locale including the en templates by mistake
- Fix for UI not showing user's prefs properly
- Fixed 401 unexpected error when no permission passed in creation of a new resource
## Breaking Changes
* users/deleteUsersSession method name changed to users/deleteUserSession in all SDKs for better consistency
- users/deleteUsersSession method name changed to users/deleteUserSession in all SDKs for better consistency
# Version 0.2.0 (PRE-RELEASE)
## Features
* Added option to limit access to the Appwrite console
* Added option to disable abuse check and rate limits
* Added input field with the server API endpoint for easy access
* Added new OAuth providers for Google, Bitbucket, and GitLab
* Added 15 new locales for locale service and email templates (cat, de, es, fi, fr, gr, hi, id, it, nl, pt-br, pt-pt, ro, tr, ua)
* Improved test coverage for the project and synced DEV & CI environments settings
- Added option to limit access to the Appwrite console
- Added option to disable abuse check and rate limits
- Added input field with the server API endpoint for easy access
- Added new OAuth providers for Google, Bitbucket, and GitLab
- Added 15 new locales for locale service and email templates (cat, de, es, fi, fr, gr, hi, id, it, nl, pt-br, pt-pt, ro, tr, ua)
- Improved test coverage for the project and synced DEV & CI environments settings
## Bug Fixes
* Fixed bug not allowing to update OAuth providers settings
* Fixed some broken API examples in docs
* Fixed bug that caused the Appwrite container to change DB directory file permissions.
- Fixed bug not allowing to update OAuth providers settings
- Fixed some broken API examples in docs
- Fixed bug that caused the Appwrite container to change DB directory file permissions.
## Breaking Changes
* Changed auth service 'redirect' param to 'confirm' for better clarity
* Updated all SDKs to sync with API changes
- Changed auth service 'redirect' param to 'confirm' for better clarity
- Updated all SDKs to sync with API changes

View file

@ -152,7 +152,7 @@ COPY ./docker/supervisord.conf /etc/supervisord.conf
# Executables
RUN chmod +x /usr/local/bin/start
RUN chmod +x /usr/local/bin/upgrade
RUN chmod +x /usr/local/bin/migrate
RUN chmod +x /usr/local/bin/test
# Letsencrypt Permissions

View file

@ -2,7 +2,7 @@
<a href="https://appwrite.io" target="_blank"><img width="260" height="39" src="https://appwrite.io/images/github-logo.png" alt="Appwrite Logo"></a>
<br />
<br />
<b>Simple Backend Server for your [Vue / Angular / React / iOS / Android / Flutter / *ANY OTHER*] Frontend App</b>
<b>Simple Backend Server for your [Flutter / Vue / Angular / React / iOS / Android / *ANY OTHER*] Frontend App</b>
<br />
<br />
</p>
@ -21,7 +21,7 @@ Appwrite API services aim to make developer's life a lot easier by hiding the co
Using Appwrite, you can easily manage user authentication with multiple sign-in methods, a database for storing and querying user and team data, storage and file management, image manipulation and cropping, schedule cron tasks and many other features to help you get more results in faster times and with a lot less code.
Appwrite can also integrate really well with your backend. Appwrite can word behind your own proxy facing your internal network, or alongside your own custom backend. You can use Appwrite server SDK to integrate your backend with Appwrite's APIs and webhooks.
Appwrite can also integrate really well with your backend. Appwrite can work behind your own proxy facing your internal network, or alongside your own custom backend. You can use Appwrite server SDK to integrate your backend with Appwrite's APIs and webhooks.
[https://appwrite.io](https://appwrite.io)
@ -49,7 +49,7 @@ The easiest way to start running your Appwrite server is by running our docker-c
docker run -it --rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume "$(pwd)"/appwrite:/install/appwrite:rw \
-e version=0.6.0 \
-e version=0.6.1 \
appwrite/install
```

View file

@ -41,7 +41,7 @@ $collections = [
'$collection' => Database::SYSTEM_COLLECTION_PLATFORMS,
'name' => 'Current Host',
'type' => 'web',
'hostname' => $request->getServer('HTTP_HOST'),
'hostname' => parse_url('https://'.$request->getServer('HTTP_HOST'), PHP_URL_HOST),
],
],
'legalName' => '',

View file

@ -15,7 +15,7 @@ return [
[
'key' => 'web',
'name' => 'Web',
'version' => '1.0.29',
'version' => '1.1.0',
'url' => 'https://github.com/appwrite/sdk-for-js',
'enabled' => true,
'beta' => false,
@ -29,7 +29,7 @@ return [
[
'key' => 'flutter',
'name' => 'Flutter',
'version' => '0.2.0',
'version' => '0.2.1',
'url' => 'https://github.com/appwrite/sdk-for-flutter',
'enabled' => true,
'beta' => true,
@ -53,19 +53,19 @@ return [
'gitRepoName' => 'sdk-for-swift',
'gitUserName' => 'appwrite',
],
// [
// 'key' => 'objective-c',
// 'name' => 'Objective C',
// 'url' => '',
// 'enabled' => false,
// 'beta' => false,
// 'family' => APP_PLATFORM_CLIENT,
// 'prism' => '',
// 'source' => false,
// 'gitUrl' => 'git@github.com:appwrite/sdk-for-objective-c.git',
// 'gitRepoName' => 'sdk-for-objective-c',
// 'gitUserName' => 'appwrite',
// ],
[
'key' => 'objective-c',
'name' => 'Objective C',
'url' => '',
'enabled' => false,
'beta' => false,
'family' => APP_PLATFORM_CLIENT,
'prism' => '',
'source' => false,
'gitUrl' => 'git@github.com:appwrite/sdk-for-objective-c.git',
'gitRepoName' => 'sdk-for-objective-c',
'gitUserName' => 'appwrite',
],
[
'key' => 'kotlin',
'name' => 'Kotlin',
@ -128,7 +128,7 @@ return [
[
'key' => 'nodejs',
'name' => 'Node.js',
'version' => '1.0.32',
'version' => '1.1.0',
'url' => 'https://github.com/appwrite/sdk-for-node',
'enabled' => true,
'beta' => false,
@ -142,7 +142,7 @@ return [
[
'key' => 'php',
'name' => 'PHP',
'version' => '1.0.17',
'version' => '1.1.0',
'url' => 'https://github.com/appwrite/sdk-for-php',
'enabled' => true,
'beta' => false,
@ -156,7 +156,7 @@ return [
[
'key' => 'python',
'name' => 'Python',
'version' => '0.0.4',
'version' => '0.0.5',
'url' => 'https://github.com/appwrite/sdk-for-python',
'enabled' => true,
'beta' => true,
@ -170,7 +170,7 @@ return [
[
'key' => 'ruby',
'name' => 'Ruby',
'version' => '1.0.9',
'version' => '1.0.10',
'url' => 'https://github.com/appwrite/sdk-for-ruby',
'enabled' => true,
'beta' => true,
@ -184,7 +184,7 @@ return [
[
'key' => 'go',
'name' => 'Go',
'version' => '0.0.6',
'version' => '0.0.7',
'url' => 'https://github.com/appwrite/sdk-for-go',
'enabled' => false,
'beta' => true,
@ -198,7 +198,7 @@ return [
[
'key' => 'java',
'name' => 'Java',
'version' => '0.0.1',
'version' => '0.0.2',
'url' => 'https://github.com/appwrite/sdk-for-java',
'enabled' => false,
'beta' => true,
@ -209,6 +209,20 @@ return [
'gitRepoName' => 'sdk-for-java',
'gitUserName' => 'appwrite',
],
[
'key' => 'dart',
'name' => 'Dart',
'version' => '0.0.1',
'url' => 'https://github.com/appwrite/sdk-for-dart',
'enabled' => false,
'beta' => true,
'family' => APP_PLATFORM_SERVER,
'prism' => 'java',
'source' => realpath(__DIR__ . '/../sdks/server-dart'),
'gitUrl' => 'git@github.com:appwrite/sdk-for-dart.git',
'gitRepoName' => 'sdk-for-dart',
'gitUserName' => 'appwrite',
],
],
],
];

View file

@ -99,6 +99,7 @@ $utopia->get('/v1/avatars/credit-cards/:code')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'avatars')
->label('sdk.method', 'getCreditCard')
->label('sdk.methodType', 'location')
->label('sdk.description', '/docs/references/avatars/get-credit-card.md')
->action(function ($code, $width, $height, $quality) use ($avatarCallback) { return $avatarCallback('credit-cards', $code, $width, $height, $quality);
});
@ -127,6 +128,7 @@ $utopia->get('/v1/avatars/flags/:code')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'avatars')
->label('sdk.method', 'getFlag')
->label('sdk.methodType', 'location')
->label('sdk.description', '/docs/references/avatars/get-flag.md')
->action(function ($code, $width, $height, $quality) use ($avatarCallback) { return $avatarCallback('flags', $code, $width, $height, $quality);
});
@ -140,6 +142,7 @@ $utopia->get('/v1/avatars/image')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'avatars')
->label('sdk.method', 'getImage')
->label('sdk.methodType', 'location')
->label('sdk.description', '/docs/references/avatars/get-image.md')
->action(
function ($url, $width, $height) use ($response) {
@ -206,6 +209,7 @@ $utopia->get('/v1/avatars/favicon')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'avatars')
->label('sdk.method', 'getFavicon')
->label('sdk.methodType', 'location')
->label('sdk.description', '/docs/references/avatars/get-favicon.md')
->action(
function ($url) use ($response, $request) {
@ -362,6 +366,7 @@ $utopia->get('/v1/avatars/qr')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'avatars')
->label('sdk.method', 'getQR')
->label('sdk.methodType', 'location')
->label('sdk.description', '/docs/references/avatars/get-qr.md')
->action(
function ($text, $size, $margin, $download) use ($response) {

View file

@ -33,8 +33,8 @@ const APP_EMAIL_SECURITY = 'security@localhost.test'; // Default security email
const APP_USERAGENT = APP_NAME.'-Server v%s. Please report abuse at %s';
const APP_MODE_ADMIN = 'admin';
const APP_PAGING_LIMIT = 15;
const APP_CACHE_BUSTER = 131;
const APP_VERSION_STABLE = '0.6.0';
const APP_CACHE_BUSTER = 125;
const APP_VERSION_STABLE = '0.6.1';
const APP_STORAGE_UPLOADS = '/storage/uploads';
const APP_STORAGE_CACHE = '/storage/cache';
const APP_STORAGE_CERTIFICATES = '/storage/certificates';

View file

@ -1,3 +1,7 @@
## 0.2.1
- Fixed callback scheme
## 0.2.0
- Updated flutter_web_auth plugin to version 0.2.4

View file

@ -20,7 +20,7 @@ Add this to your package's `pubspec.yaml` file:
```yml
dependencies:
appwrite: ^0.2.0
appwrite: ^0.2.1
```
You can install packages from the command line:

View file

@ -8,13 +8,8 @@ client
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = avatars.getCreditCard(
String result = avatars.getCreditCard(
code: 'amex',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error);
});
print(result); // Resource URL string

View file

@ -8,13 +8,8 @@ client
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = avatars.getFavicon(
String result = avatars.getFavicon(
url: 'https://example.com',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error);
});
print(result); // Resource URL string

View file

@ -8,13 +8,8 @@ client
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = avatars.getFlag(
String result = avatars.getFlag(
code: 'af',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error);
});
print(result); // Resource URL string

View file

@ -8,13 +8,8 @@ client
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = avatars.getImage(
String result = avatars.getImage(
url: 'https://example.com',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error);
});
print(result); // Resource URL string

View file

@ -8,13 +8,8 @@ client
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = avatars.getQR(
String result = avatars.getQR(
text: '[TEXT]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error);
});
print(result); // Resource URL string

View file

@ -30,7 +30,7 @@ class Client {
this.headers = {
'content-type': 'application/json',
'x-sdk-version': 'appwrite:dart:0.2.0',
'x-sdk-version': 'appwrite:dart:0.2.1',
};
this.config = {};

View file

@ -324,7 +324,7 @@ class Account extends Service {
return FlutterWebAuth.authenticate(
url: url.toString(),
callbackUrlScheme: "appwrite-callback" + client.config['project']
callbackUrlScheme: "appwrite-callback-" + client.config['project']
).then((value) {
Uri url = Uri.parse(value);
List<Cookie> cookies = [new Cookie(url.queryParameters['key'], url.queryParameters['secret'])];

View file

@ -40,20 +40,25 @@ class Avatars extends Service {
/// card provider you need. Use width, height and quality arguments to change
/// the output settings.
///
Future<Response> getCreditCard({@required String code, int width = 100, int height = 100, int quality = 100}) {
String getCreditCard({@required String code, int width = 100, int height = 100, int quality = 100}) {
final String path = '/avatars/credit-cards/{code}'.replaceAll(RegExp('{code}'), code);
final Map<String, dynamic> params = {
'width': width,
'height': height,
'quality': quality,
'project': client.config['project'],
};
final Map<String, String> headers = {
'content-type': 'application/json',
};
Uri endpoint = Uri.parse(client.endPoint);
Uri url = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
port: endpoint.port,
path: endpoint.path + path,
queryParameters:params,
);
return client.call(HttpMethod.get, path: path, params: params, headers: headers);
return url.toString();
}
/// Get Favicon
@ -61,18 +66,23 @@ class Avatars extends Service {
/// Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote
/// website URL.
///
Future<Response> getFavicon({@required String url}) {
String getFavicon({@required String url}) {
final String path = '/avatars/favicon';
final Map<String, dynamic> params = {
'url': url,
'project': client.config['project'],
};
final Map<String, String> headers = {
'content-type': 'application/json',
};
Uri endpoint = Uri.parse(client.endPoint);
Uri url = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
port: endpoint.port,
path: endpoint.path + path,
queryParameters:params,
);
return client.call(HttpMethod.get, path: path, params: params, headers: headers);
return url.toString();
}
/// Get Country Flag
@ -81,20 +91,25 @@ class Avatars extends Service {
/// users. The code argument receives the 2 letter country code. Use width,
/// height and quality arguments to change the output settings.
///
Future<Response> getFlag({@required String code, int width = 100, int height = 100, int quality = 100}) {
String getFlag({@required String code, int width = 100, int height = 100, int quality = 100}) {
final String path = '/avatars/flags/{code}'.replaceAll(RegExp('{code}'), code);
final Map<String, dynamic> params = {
'width': width,
'height': height,
'quality': quality,
'project': client.config['project'],
};
final Map<String, String> headers = {
'content-type': 'application/json',
};
Uri endpoint = Uri.parse(client.endPoint);
Uri url = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
port: endpoint.port,
path: endpoint.path + path,
queryParameters:params,
);
return client.call(HttpMethod.get, path: path, params: params, headers: headers);
return url.toString();
}
/// Get Image from URL
@ -104,20 +119,25 @@ class Avatars extends Service {
/// remote images in your app or in case you want to make sure a 3rd party
/// image is properly served using a TLS protocol.
///
Future<Response> getImage({@required String url, int width = 400, int height = 400}) {
String getImage({@required String url, int width = 400, int height = 400}) {
final String path = '/avatars/image';
final Map<String, dynamic> params = {
'url': url,
'width': width,
'height': height,
'project': client.config['project'],
};
final Map<String, String> headers = {
'content-type': 'application/json',
};
Uri endpoint = Uri.parse(client.endPoint);
Uri url = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
port: endpoint.port,
path: endpoint.path + path,
queryParameters:params,
);
return client.call(HttpMethod.get, path: path, params: params, headers: headers);
return url.toString();
}
/// Get QR Code
@ -125,7 +145,7 @@ class Avatars extends Service {
/// Converts a given plain text to a QR code image. You can use the query
/// parameters to change the size and style of the resulting image.
///
Future<Response> getQR({@required String text, int size = 400, int margin = 1, int download = 0}) {
String getQR({@required String text, int size = 400, int margin = 1, int download = 0}) {
final String path = '/avatars/qr';
final Map<String, dynamic> params = {
@ -133,12 +153,17 @@ class Avatars extends Service {
'size': size,
'margin': margin,
'download': download,
'project': client.config['project'],
};
final Map<String, String> headers = {
'content-type': 'application/json',
};
Uri endpoint = Uri.parse(client.endPoint);
Uri url = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
port: endpoint.port,
path: endpoint.path + path,
queryParameters:params,
);
return client.call(HttpMethod.get, path: path, params: params, headers: headers);
return url.toString();
}
}

View file

@ -1,5 +1,5 @@
name: appwrite
version: 0.2.0
version: 0.2.1
description: Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API
homepage: https://appwrite.io
repository: https://github.com/appwrite/sdk-for-flutter

View file

@ -1,4 +1,4 @@
# Appwrite SDK
# Appwrite Web SDK
![License](https://img.shields.io/github/license/appwrite/sdk-for-js.svg?v=1)
![Version](https://img.shields.io/badge/api%20version-0.6.0-blue.svg?v=1)
@ -30,7 +30,7 @@ import * as Appwrite from "appwrite";
To install with a CDN (content delivery network) add the following scripts to the bottom of your <body> tag, but before you use any Appwrite services:
```html
<script src="https://cdn.jsdelivr.net/npm/appwrite@1.0.29"></script>
<script src="https://cdn.jsdelivr.net/npm/appwrite@1.1.0"></script>
```

View file

@ -4,10 +4,6 @@ sdk
.setProject('5df5acd0d48c2') // Your project ID
;
let promise = sdk.avatars.getCreditCard('amex');
let result = sdk.avatars.getCreditCard('amex');
promise.then(function (response) {
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
});
console.log(result); // Resource URL

View file

@ -4,10 +4,6 @@ sdk
.setProject('5df5acd0d48c2') // Your project ID
;
let promise = sdk.avatars.getFavicon('https://example.com');
let result = sdk.avatars.getFavicon('https://example.com');
promise.then(function (response) {
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
});
console.log(result); // Resource URL

View file

@ -4,10 +4,6 @@ sdk
.setProject('5df5acd0d48c2') // Your project ID
;
let promise = sdk.avatars.getFlag('af');
let result = sdk.avatars.getFlag('af');
promise.then(function (response) {
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
});
console.log(result); // Resource URL

View file

@ -4,10 +4,6 @@ sdk
.setProject('5df5acd0d48c2') // Your project ID
;
let promise = sdk.avatars.getImage('https://example.com');
let result = sdk.avatars.getImage('https://example.com');
promise.then(function (response) {
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
});
console.log(result); // Resource URL

View file

@ -4,10 +4,6 @@ sdk
.setProject('5df5acd0d48c2') // Your project ID
;
let promise = sdk.avatars.getQR('[TEXT]');
let result = sdk.avatars.getQR('[TEXT]');
promise.then(function (response) {
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
});
console.log(result); // Resource URL

View file

@ -2,7 +2,7 @@
"name": "appwrite",
"homepage": "https://appwrite.io/support",
"description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
"version": "1.0.29",
"version": "1.1.0",
"license": "BSD-3-Clause",
"main": "src/sdk.js",
"types": "types/index.d.ts",

View file

@ -103,7 +103,7 @@
globalParams.push({key: key, value: value});
};
addGlobalHeader('x-sdk-version', 'appwrite:javascript:1.0.29');
addGlobalHeader('x-sdk-version', 'appwrite:javascript:1.1.0');
addGlobalHeader('content-type', '');
/**
@ -900,7 +900,7 @@
* @param {number} height
* @param {number} quality
* @throws {Error}
* @return {Promise}
* @return {string}
*/
getCreditCard: function(code, width = 100, height = 100, quality = 100) {
if(code === undefined) {
@ -923,10 +923,11 @@
payload['quality'] = quality;
}
return http
.get(path, {
'content-type': 'application/json',
}, payload);
payload['project'] = config.project;
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
return config.endpoint + path + ((query) ? '?' + query : '');
},
/**
@ -937,7 +938,7 @@
*
* @param {string} url
* @throws {Error}
* @return {Promise}
* @return {string}
*/
getFavicon: function(url) {
if(url === undefined) {
@ -952,10 +953,11 @@
payload['url'] = url;
}
return http
.get(path, {
'content-type': 'application/json',
}, payload);
payload['project'] = config.project;
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
return config.endpoint + path + ((query) ? '?' + query : '');
},
/**
@ -970,7 +972,7 @@
* @param {number} height
* @param {number} quality
* @throws {Error}
* @return {Promise}
* @return {string}
*/
getFlag: function(code, width = 100, height = 100, quality = 100) {
if(code === undefined) {
@ -993,10 +995,11 @@
payload['quality'] = quality;
}
return http
.get(path, {
'content-type': 'application/json',
}, payload);
payload['project'] = config.project;
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
return config.endpoint + path + ((query) ? '?' + query : '');
},
/**
@ -1011,7 +1014,7 @@
* @param {number} width
* @param {number} height
* @throws {Error}
* @return {Promise}
* @return {string}
*/
getImage: function(url, width = 400, height = 400) {
if(url === undefined) {
@ -1034,10 +1037,11 @@
payload['height'] = height;
}
return http
.get(path, {
'content-type': 'application/json',
}, payload);
payload['project'] = config.project;
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
return config.endpoint + path + ((query) ? '?' + query : '');
},
/**
@ -1051,7 +1055,7 @@
* @param {number} margin
* @param {number} download
* @throws {Error}
* @return {Promise}
* @return {string}
*/
getQR: function(text, size = 400, margin = 1, download = 0) {
if(text === undefined) {
@ -1078,10 +1082,11 @@
payload['download'] = download;
}
return http
.get(path, {
'content-type': 'application/json',
}, payload);
payload['project'] = config.project;
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
return config.endpoint + path + ((query) ? '?' + query : '');
}
};

View file

@ -1,5 +1,5 @@
(function(window){'use strict';window.Appwrite=function(){let config={endpoint:'https://appwrite.io/v1',project:'',locale:'',};let setEndpoint=function(endpoint){config.endpoint=endpoint;return this};let setProject=function(value){http.addGlobalHeader('X-Appwrite-Project',value);config.project=value;return this};let setLocale=function(value){http.addGlobalHeader('X-Appwrite-Locale',value);config.locale=value;return this};let http=function(document){let globalParams=[],globalHeaders=[];let addParam=function(url,param,value){let a=document.createElement('a'),regex=/(?:\?|&amp;|&)+([^=]+)(?:=([^&]*))*/g;let match,str=[];a.href=url;param=encodeURIComponent(param);while(match=regex.exec(a.search))if(param!==match[1])str.push(match[1]+(match[2]?"="+match[2]:""));str.push(param+(value?"="+encodeURIComponent(value):""));a.search=str.join("&");return a.href};let buildQuery=function(params){let str=[];for(let p in params){if(Array.isArray(params[p])){for(let index=0;index<params[p].length;index++){let param=params[p][index];str.push(encodeURIComponent(p+'[]')+"="+encodeURIComponent(param))}}else{str.push(encodeURIComponent(p)+"="+encodeURIComponent(params[p]))}}
return str.join("&")};let addGlobalHeader=function(key,value){globalHeaders[key]={key:key.toLowerCase(),value:value.toLowerCase()}};let addGlobalParam=function(key,value){globalParams.push({key:key,value:value})};addGlobalHeader('x-sdk-version','appwrite:javascript:1.0.29');addGlobalHeader('content-type','');let call=function(method,path,headers={},params={},progress=null){let i;path=config.endpoint+path;if(-1===['GET','POST','PUT','DELETE','TRACE','HEAD','OPTIONS','CONNECT','PATCH'].indexOf(method)){throw new Error('var method must contain a valid HTTP method name')}
return str.join("&")};let addGlobalHeader=function(key,value){globalHeaders[key]={key:key.toLowerCase(),value:value.toLowerCase()}};let addGlobalParam=function(key,value){globalParams.push({key:key,value:value})};addGlobalHeader('x-sdk-version','appwrite:javascript:1.1.0');addGlobalHeader('content-type','');let call=function(method,path,headers={},params={},progress=null){let i;path=config.endpoint+path;if(-1===['GET','POST','PUT','DELETE','TRACE','HEAD','OPTIONS','CONNECT','PATCH'].indexOf(method)){throw new Error('var method must contain a valid HTTP method name')}
if(typeof path!=='string'){throw new Error('var path must be of type string')}
if(typeof headers!=='object'){throw new Error('var headers must be of type object')}
for(i=0;i<globalParams.length;i++){path=addParam(path,globalParams[i].key,globalParams[i].value)}
@ -63,22 +63,22 @@ return http.get(path,{'content-type':'application/json',},payload)},getCreditCar
let path='/avatars/credit-cards/{code}'.replace(new RegExp('{code}','g'),code);let payload={};if(width){payload.width=width}
if(height){payload.height=height}
if(quality){payload.quality=quality}
return http.get(path,{'content-type':'application/json',},payload)},getFavicon:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"')}
payload.project=config.project;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')},getFavicon:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"')}
let path='/avatars/favicon';let payload={};if(url){payload.url=url}
return http.get(path,{'content-type':'application/json',},payload)},getFlag:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')}
payload.project=config.project;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')},getFlag:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')}
let path='/avatars/flags/{code}'.replace(new RegExp('{code}','g'),code);let payload={};if(width){payload.width=width}
if(height){payload.height=height}
if(quality){payload.quality=quality}
return http.get(path,{'content-type':'application/json',},payload)},getImage:function(url,width=400,height=400){if(url===undefined){throw new Error('Missing required parameter: "url"')}
payload.project=config.project;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')},getImage:function(url,width=400,height=400){if(url===undefined){throw new Error('Missing required parameter: "url"')}
let path='/avatars/image';let payload={};if(url){payload.url=url}
if(width){payload.width=width}
if(height){payload.height=height}
return http.get(path,{'content-type':'application/json',},payload)},getQR:function(text,size=400,margin=1,download=0){if(text===undefined){throw new Error('Missing required parameter: "text"')}
payload.project=config.project;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')},getQR:function(text,size=400,margin=1,download=0){if(text===undefined){throw new Error('Missing required parameter: "text"')}
let path='/avatars/qr';let payload={};if(text){payload.text=text}
if(size){payload.size=size}
if(margin){payload.margin=margin}
if(download){payload.download=download}
return http.get(path,{'content-type':'application/json',},payload)}};let database={listDocuments:function(collectionId,filters=[],offset=0,limit=50,orderField='$id',orderType='ASC',orderCast='string',search='',first=0,last=0){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
payload.project=config.project;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')}};let database={listDocuments:function(collectionId,filters=[],offset=0,limit=50,orderField='$id',orderType='ASC',orderCast='string',search='',first=0,last=0){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
let path='/database/collections/{collectionId}/documents'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};if(filters){payload.filters=filters}
if(offset){payload.offset=offset}
if(limit){payload.limit=limit}

View file

@ -1,4 +1,4 @@
// Type definitions for appwrite 1.0.29
// Type definitions for appwrite 1.1.0
// Project: Appwrite
@ -338,9 +338,9 @@ declare namespace Appwrite {
* @param {number} height
* @param {number} quality
* @throws {Error}
* @return {Promise}
* @return {string}
*/
getCreditCard(code: string, width: number, height: number, quality: number): Promise<object>;
getCreditCard(code: string, width: number, height: number, quality: number): string;
/**
* Get Favicon
@ -350,9 +350,9 @@ declare namespace Appwrite {
*
* @param {string} url
* @throws {Error}
* @return {Promise}
* @return {string}
*/
getFavicon(url: string): Promise<object>;
getFavicon(url: string): string;
/**
* Get Country Flag
@ -366,9 +366,9 @@ declare namespace Appwrite {
* @param {number} height
* @param {number} quality
* @throws {Error}
* @return {Promise}
* @return {string}
*/
getFlag(code: string, width: number, height: number, quality: number): Promise<object>;
getFlag(code: string, width: number, height: number, quality: number): string;
/**
* Get Image from URL
@ -382,9 +382,9 @@ declare namespace Appwrite {
* @param {number} width
* @param {number} height
* @throws {Error}
* @return {Promise}
* @return {string}
*/
getImage(url: string, width: number, height: number): Promise<object>;
getImage(url: string, width: number, height: number): string;
/**
* Get QR Code
@ -397,9 +397,9 @@ declare namespace Appwrite {
* @param {number} margin
* @param {number} download
* @throws {Error}
* @return {Promise}
* @return {string}
*/
getQR(text: string, size: number, margin: number, download: number): Promise<object>;
getQR(text: string, size: number, margin: number, download: number): string;
}

View file

@ -1,4 +1,4 @@
# Appwrite SDK
# Appwrite Console SDK
![License](https://img.shields.io/github/license/appwrite/sdk-for-console.svg?v=1)
![Version](https://img.shields.io/badge/api%20version-0.6.0-blue.svg?v=1)

View file

@ -5,10 +5,6 @@ sdk
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;
let promise = sdk.avatars.getCreditCard('amex');
let result = sdk.avatars.getCreditCard('amex');
promise.then(function (response) {
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
});
console.log(result); // Resource URL

View file

@ -5,10 +5,6 @@ sdk
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;
let promise = sdk.avatars.getFavicon('https://example.com');
let result = sdk.avatars.getFavicon('https://example.com');
promise.then(function (response) {
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
});
console.log(result); // Resource URL

View file

@ -5,10 +5,6 @@ sdk
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;
let promise = sdk.avatars.getFlag('af');
let result = sdk.avatars.getFlag('af');
promise.then(function (response) {
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
});
console.log(result); // Resource URL

View file

@ -5,10 +5,6 @@ sdk
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;
let promise = sdk.avatars.getImage('https://example.com');
let result = sdk.avatars.getImage('https://example.com');
promise.then(function (response) {
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
});
console.log(result); // Resource URL

View file

@ -5,10 +5,6 @@ sdk
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;
let promise = sdk.avatars.getQR('[TEXT]');
let result = sdk.avatars.getQR('[TEXT]');
promise.then(function (response) {
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
});
console.log(result); // Resource URL

View file

@ -938,7 +938,7 @@
* @param {number} height
* @param {number} quality
* @throws {Error}
* @return {Promise}
* @return {string}
*/
getCreditCard: function(code, width = 100, height = 100, quality = 100) {
if(code === undefined) {
@ -961,10 +961,13 @@
payload['quality'] = quality;
}
return http
.get(path, {
'content-type': 'application/json',
}, payload);
payload['project'] = config.project;
payload['key'] = config.key;
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
return config.endpoint + path + ((query) ? '?' + query : '');
},
/**
@ -975,7 +978,7 @@
*
* @param {string} url
* @throws {Error}
* @return {Promise}
* @return {string}
*/
getFavicon: function(url) {
if(url === undefined) {
@ -990,10 +993,13 @@
payload['url'] = url;
}
return http
.get(path, {
'content-type': 'application/json',
}, payload);
payload['project'] = config.project;
payload['key'] = config.key;
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
return config.endpoint + path + ((query) ? '?' + query : '');
},
/**
@ -1008,7 +1014,7 @@
* @param {number} height
* @param {number} quality
* @throws {Error}
* @return {Promise}
* @return {string}
*/
getFlag: function(code, width = 100, height = 100, quality = 100) {
if(code === undefined) {
@ -1031,10 +1037,13 @@
payload['quality'] = quality;
}
return http
.get(path, {
'content-type': 'application/json',
}, payload);
payload['project'] = config.project;
payload['key'] = config.key;
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
return config.endpoint + path + ((query) ? '?' + query : '');
},
/**
@ -1049,7 +1058,7 @@
* @param {number} width
* @param {number} height
* @throws {Error}
* @return {Promise}
* @return {string}
*/
getImage: function(url, width = 400, height = 400) {
if(url === undefined) {
@ -1072,10 +1081,13 @@
payload['height'] = height;
}
return http
.get(path, {
'content-type': 'application/json',
}, payload);
payload['project'] = config.project;
payload['key'] = config.key;
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
return config.endpoint + path + ((query) ? '?' + query : '');
},
/**
@ -1089,7 +1101,7 @@
* @param {number} margin
* @param {number} download
* @throws {Error}
* @return {Promise}
* @return {string}
*/
getQR: function(text, size = 400, margin = 1, download = 0) {
if(text === undefined) {
@ -1116,10 +1128,13 @@
payload['download'] = download;
}
return http
.get(path, {
'content-type': 'application/json',
}, payload);
payload['project'] = config.project;
payload['key'] = config.key;
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
return config.endpoint + path + ((query) ? '?' + query : '');
}
};

View file

@ -63,22 +63,22 @@ return http.get(path,{'content-type':'application/json',},payload)},getCreditCar
let path='/avatars/credit-cards/{code}'.replace(new RegExp('{code}','g'),code);let payload={};if(width){payload.width=width}
if(height){payload.height=height}
if(quality){payload.quality=quality}
return http.get(path,{'content-type':'application/json',},payload)},getFavicon:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"')}
payload.project=config.project;payload.key=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')},getFavicon:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"')}
let path='/avatars/favicon';let payload={};if(url){payload.url=url}
return http.get(path,{'content-type':'application/json',},payload)},getFlag:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')}
payload.project=config.project;payload.key=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')},getFlag:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')}
let path='/avatars/flags/{code}'.replace(new RegExp('{code}','g'),code);let payload={};if(width){payload.width=width}
if(height){payload.height=height}
if(quality){payload.quality=quality}
return http.get(path,{'content-type':'application/json',},payload)},getImage:function(url,width=400,height=400){if(url===undefined){throw new Error('Missing required parameter: "url"')}
payload.project=config.project;payload.key=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')},getImage:function(url,width=400,height=400){if(url===undefined){throw new Error('Missing required parameter: "url"')}
let path='/avatars/image';let payload={};if(url){payload.url=url}
if(width){payload.width=width}
if(height){payload.height=height}
return http.get(path,{'content-type':'application/json',},payload)},getQR:function(text,size=400,margin=1,download=0){if(text===undefined){throw new Error('Missing required parameter: "text"')}
payload.project=config.project;payload.key=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')},getQR:function(text,size=400,margin=1,download=0){if(text===undefined){throw new Error('Missing required parameter: "text"')}
let path='/avatars/qr';let payload={};if(text){payload.text=text}
if(size){payload.size=size}
if(margin){payload.margin=margin}
if(download){payload.download=download}
return http.get(path,{'content-type':'application/json',},payload)}};let database={listCollections:function(search='',limit=25,offset=0,orderType='ASC'){let path='/database/collections';let payload={};if(search){payload.search=search}
payload.project=config.project;payload.key=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')}};let database={listCollections:function(search='',limit=25,offset=0,orderType='ASC'){let path='/database/collections';let payload={};if(search){payload.search=search}
if(limit){payload.limit=limit}
if(offset){payload.offset=offset}
if(orderType){payload.orderType=orderType}

View file

@ -360,9 +360,9 @@ declare namespace Appwrite {
* @param {number} height
* @param {number} quality
* @throws {Error}
* @return {Promise}
* @return {string}
*/
getCreditCard(code: string, width: number, height: number, quality: number): Promise<object>;
getCreditCard(code: string, width: number, height: number, quality: number): string;
/**
* Get Favicon
@ -372,9 +372,9 @@ declare namespace Appwrite {
*
* @param {string} url
* @throws {Error}
* @return {Promise}
* @return {string}
*/
getFavicon(url: string): Promise<object>;
getFavicon(url: string): string;
/**
* Get Country Flag
@ -388,9 +388,9 @@ declare namespace Appwrite {
* @param {number} height
* @param {number} quality
* @throws {Error}
* @return {Promise}
* @return {string}
*/
getFlag(code: string, width: number, height: number, quality: number): Promise<object>;
getFlag(code: string, width: number, height: number, quality: number): string;
/**
* Get Image from URL
@ -404,9 +404,9 @@ declare namespace Appwrite {
* @param {number} width
* @param {number} height
* @throws {Error}
* @return {Promise}
* @return {string}
*/
getImage(url: string, width: number, height: number): Promise<object>;
getImage(url: string, width: number, height: number): string;
/**
* Get QR Code
@ -419,9 +419,9 @@ declare namespace Appwrite {
* @param {number} margin
* @param {number} download
* @throws {Error}
* @return {Promise}
* @return {string}
*/
getQR(text: string, size: number, margin: number, download: number): Promise<object>;
getQR(text: string, size: number, margin: number, download: number): string;
}

View file

@ -1,4 +1,4 @@
# Appwrite SDK
# Appwrite Node.js SDK
![License](https://img.shields.io/github/license/appwrite/sdk-for-node.svg?v=1)
![Version](https://img.shields.io/badge/api%20version-0.6.0-blue.svg?v=1)

View file

@ -7,7 +7,7 @@ class Client {
this.endpoint = 'https://appwrite.io/v1';
this.headers = {
'content-type': '',
'x-sdk-version': 'appwrite:nodejs:1.0.32',
'x-sdk-version': 'appwrite:nodejs:1.1.0',
};
this.selfSigned = false;
}

View file

@ -2,7 +2,7 @@
"name": "node-appwrite",
"homepage": "https://appwrite.io/support",
"description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
"version": "1.0.32",
"version": "1.1.0",
"license": "BSD-3-Clause",
"main": "index.js",
"repository": {

View file

@ -1,4 +1,4 @@
# Appwrite SDK
# Appwrite PHP SDK
![License](https://img.shields.io/github/license/appwrite/sdk-for-php.svg?v=1)
![Version](https://img.shields.io/badge/api%20version-0.6.0-blue.svg?v=1)

View file

@ -37,7 +37,7 @@ class Client
*/
protected $headers = [
'content-type' => '',
'x-sdk-version' => 'appwrite:php:1.0.17',
'x-sdk-version' => 'appwrite:php:1.1.0',
];
/**

View file

@ -1,4 +1,4 @@
# Appwrite SDK
# Appwrite Python SDK
![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?v=1)
![Version](https://img.shields.io/badge/api%20version-0.6.0-blue.svg?v=1)

View file

@ -7,7 +7,7 @@ class Client:
self._endpoint = 'https://appwrite.io/v1'
self._global_headers = {
'content-type': '',
'x-sdk-version': 'appwrite:python:0.0.4',
'x-sdk-version': 'appwrite:python:0.0.5',
}
def set_self_signed(self, status=True):

View file

@ -3,7 +3,7 @@ import setuptools
setuptools.setup(
name = 'appwrite',
packages = ['appwrite', 'appwrite/services'],
version = '0.0.4',
version = '0.0.5',
license='BSD-3-Clause',
description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API',
author = 'Appwrite Team',
@ -11,7 +11,7 @@ setuptools.setup(
maintainer = 'Appwrite Team',
maintainer_email = 'team@localhost.test',
url = 'https://appwrite.io/support',
download_url='https://github.com/appwrite/sdk-for-python/archive/0.0.4.tar.gz',
download_url='https://github.com/appwrite/sdk-for-python/archive/0.0.5.tar.gz',
# keywords = ['SOME', 'MEANINGFULL', 'KEYWORDS'],
install_requires=[
'requests',

View file

@ -1,4 +1,4 @@
# Appwrite SDK
# Appwrite Ruby SDK
![License](https://img.shields.io/github/license/appwrite/sdk-for-ruby.svg?v=1)
![Version](https://img.shields.io/badge/api%20version-0.6.0-blue.svg?v=1)

View file

@ -1,7 +1,7 @@
Gem::Specification.new do |s|
s.name = 'appwrite'
s.version = '1.0.9'
s.version = '1.0.10'
s.summary = "Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way.
Use the Ruby SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools.
For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)"

View file

@ -20,7 +20,7 @@ module Appwrite
@headers = {
'content-type' => '',
'user-agent' => RUBY_PLATFORM + ':ruby-' + RUBY_VERSION,
'x-sdk-version' => 'appwrite:ruby:1.0.9'
'x-sdk-version' => 'appwrite:ruby:1.0.10'
}
@endpoint = 'https://appwrite.io/v1';
end

View file

@ -21,7 +21,7 @@ $callbacks = [
},
'0.5.0' => function($project) use ($db, $projectDB, $requset) {
Console::info('Upgrading project: '.$project->getId());
Console::log('Migrating project: '.$project->getId());
// Update all documents $uid -> $id
@ -40,7 +40,7 @@ $callbacks = [
$sum = count($all);
Console::success('Fetched '.$sum.' (offset: '.$offset.' / limit: '.$limit.') documents from a total of '.$projectDB->getSum());
Console::log('Migrating: '.$offset.' / '.$projectDB->getSum());
foreach($all as $document) {
$document = fixDocument($document);
@ -51,7 +51,6 @@ $callbacks = [
try {
$new = $projectDB->overwriteDocument($document->getArrayCopy());
Console::success('Updated document succefully');
} catch (\Throwable $th) {
Console::error('Failed to update document: '.$th->getMessage());
continue;
@ -153,7 +152,7 @@ function fixDocument(Document $document) {
->removeAttribute('$uid')
;
Console::log('Switched from $uid to $id: '.$document->getCollection().'/'.$document->getId());
//Console::log('Switched from $uid to $id: '.$document->getCollection().'/'.$document->getId());
foreach($document as &$attr) {
if($attr instanceof Document) {
@ -175,7 +174,7 @@ function fixDocument(Document $document) {
$cli
->task('run')
->action(function () use ($console, $projectDB, $consoleDB, $callbacks) {
Console::success('Starting Upgrade');
Console::success('Starting Data Migration');
Authorization::disable();
@ -211,8 +210,10 @@ $cli
$sum = count($projects);
$offset = $offset + $limit;
Console::success('Fetched '.$sum.' projects...');
Console::log('Fetched '.$sum.' projects...');
}
Console::success('Data Migration Completed');
});
$cli->run();

View file

@ -75,7 +75,7 @@ $rules = $collection->getAttribute('rules', []);
data-name="project-documents">
<div data-ls-if="0 == {{project-documents.sum}}" class="box margin-bottom">
<h3 class="margin-bottom-small text-bold">No Documnets Found</h3>
<h3 class="margin-bottom-small text-bold">No Documents Found</h3>
<p class="margin-bottom-no">Create your first document to get started</p>
</div>
@ -264,10 +264,10 @@ $rules = $collection->getAttribute('rules', []);
<option value="boolean">Boolean</option>
<option value="wildcard">Wildcard (*)</option>
</optgroup>
<optgroup label="Links">
<!-- <optgroup label="Links">
<option value="fileId">File ID</option>
<option value="documentId">Document ID</option>
</optgroup>
</optgroup> -->
<optgroup label="Advanced">
<option value="email">Email</option>
<option value="url">URL</option>
@ -415,10 +415,10 @@ $rules = $collection->getAttribute('rules', []);
<option value="boolean">Boolean</option>
<option value="wildcard">Wildcard (*)</option>
</optgroup>
<optgroup label="Links">
<!-- <optgroup label="Links">
<option value="fileId">File ID</option>
<option value="documentId">Document ID</option>
</optgroup>
</optgroup> -->
<optgroup label="Advanced">
<option value="email">Email</option>
<option value="url">URL</option>

View file

@ -308,9 +308,9 @@ $collections = [];
</div>
</div>
</li>
<li data-ls-if="{{project-document.$id}}" data-state="/console/database/document/activity?id={{router.params.id}}&collection={{router.params.collection}}&project={{router.params.project}}">
<!-- <li data-ls-if="{{project-document.$id}}" data-state="/console/database/document/activity?id={{router.params.id}}&collection={{router.params.collection}}&project={{router.params.project}}">
<h2>Activity</h2>
</li>
</li> -->
</ul>
</div>
</div>

View file

@ -203,7 +203,7 @@ $graph = $this->getParam('graph', false);
<label for="name">Name <span class="tooltip large" data-tooltip="Choose any name that will help you distinguish between your different apps."><i class="icon-question"></i></span></label>
<input type="text" class="full-width" id="name" name="name" required autocomplete="off" placeholder="My Web App" />
<label for="hostname">Hostname <span class="tooltip large" data-tooltip="The hostname that your website will use to interact with the <?php echo APP_NAME; ?> APIs in production or development environments."><i class="icon-question"></i></span></label>
<label for="hostname">Hostname <span class="tooltip large" data-tooltip="The hostname that your website will use to interact with the <?php echo APP_NAME; ?> APIs in production or development environments. No port number required."><i class="icon-question"></i></span></label>
<input name="hostname" type="text" class="margin-bottom" autocomplete="off" placeholder="localhost" required>
<div class="info margin-top margin-bottom">
@ -241,7 +241,7 @@ $graph = $this->getParam('graph', false);
<label data-ls-attrs="for=name-{{platform.$id}}">Name <span class="tooltip large" data-tooltip="Choose any name that will help you distinguish between your different apps."><i class="icon-question"></i></span></label>
<input type="text" class="full-width" data-ls-attrs="id=name-{{platform.$id}}" name="name" required autocomplete="off" data-ls-bind="{{platform.name}}" placeholder="My Web App" />
<label for="hostname">Hostname <span class="tooltip large" data-tooltip="The hostname that your website will use to interact with the <?php echo APP_NAME; ?> APIs in production or development environments."><i class="icon-question"></i></span></label>
<label for="hostname">Hostname <span class="tooltip large" data-tooltip="The hostname that your website will use to interact with the <?php echo APP_NAME; ?> APIs in production or development environments. No port number required."><i class="icon-question"></i></span></label>
<input name="hostname" type="text" class="margin-bottom" autocomplete="off" placeholder="localhost" data-ls-bind="{{platform.hostname}}" required />
<hr />

View file

@ -178,7 +178,7 @@ $customDomainsTarget = $this->getParam('customDomainsTarget', false);
data-success-param-trigger-events="projects.listDomains">
<div data-ls-if="0 == {{console-domains.length}} || undefined == {{console-domains.length}}" class="box margin-top margin-bottom">
<h3 class="margin-bottom-small text-bold">No Custom Domains Found</h3>
<h3 class="margin-bottom-small text-bold">No Custom Domains Added</h3>
<p class="margin-bottom-no">You haven't created any custom domains for your project yet.</p>
</div>

6
bin/migrate Executable file
View file

@ -0,0 +1,6 @@
#!/bin/bash
export PHP_VERSION=$PHP_VERSION
# Init server settings
php /usr/share/nginx/html/app/tasks/migrate.php run

View file

@ -3,4 +3,4 @@
export PHP_VERSION=$PHP_VERSION
# Init server settings
php /usr/share/nginx/html/app/tasks/upgrade.php run
php /usr/share/nginx/html/app/tasks/migrate.php run

12
composer.lock generated
View file

@ -485,12 +485,12 @@
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "aab4ebd862aa7d04f01a4b51849d657db56d882e"
"reference": "351a213ba2ea52b7b7d26339fad552f0edba5742"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/aab4ebd862aa7d04f01a4b51849d657db56d882e",
"reference": "aab4ebd862aa7d04f01a4b51849d657db56d882e",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/351a213ba2ea52b7b7d26339fad552f0edba5742",
"reference": "351a213ba2ea52b7b7d26339fad552f0edba5742",
"shasum": ""
},
"require": {
@ -544,7 +544,7 @@
"rest",
"web service"
],
"time": "2020-04-18T10:38:46+00:00"
"time": "2020-05-17T09:36:12+00:00"
},
{
"name": "guzzlehttp/promises",
@ -1745,7 +1745,7 @@
"source": {
"type": "git",
"url": "https://github.com/appwrite/sdk-generator",
"reference": "840cb263b37184d01f6d060e0a4171c553aeb986"
"reference": "27a137a63009f25ad68ef2f3ce4b8c5d936f9d71"
},
"require": {
"ext-curl": "*",
@ -1775,7 +1775,7 @@
}
],
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
"time": "2020-05-17T08:23:11+00:00"
"time": "2020-05-17T18:39:41+00:00"
},
{
"name": "doctrine/instantiator",

View file

@ -1,3 +1,7 @@
## 0.2.1
- Fixed callback scheme
## 0.2.0
- Updated flutter_web_auth plugin to version 0.2.4

View file

@ -2654,7 +2654,7 @@ return result;};let resolve=function(target,prefix="param",data={}){if(!target){
let args=getParams(target);return target.apply(target,args.map(function(value){let result=getValue(value,prefix,data);return result;}));};let exec=function(event){let parsedSuccess=expression.parse(success);let parsedFailure=expression.parse(failure);let parsedAction=expression.parse(action);parsedSuccess=parsedSuccess&&parsedSuccess!=""?parsedSuccess.split(",").map(element=>element.trim()):[];parsedFailure=parsedFailure&&parsedFailure!=""?parsedFailure.split(",").map(element=>element.trim()):[];element.$lsSkip=true;element.classList.add("load-service-start");if(!document.body.contains(element)){element=undefined;return false;}
if(event){event.preventDefault();}
if(running){return false;}
running=true;element.style.backgroud='red';if(confirm){if(window.confirm(confirm)!==true){element.classList.add("load-service-end");return false;}}
running=true;element.style.backgroud='red';if(confirm){if(window.confirm(confirm)!==true){element.classList.add("load-service-end");element.$lsSkip=false;running=false;return false;}}
if(loading){loaderId=alerts.add({text:loading,class:""},0);}
let method=container.path(scope+"."+parsedAction);if(!method){throw new Error('Method "'+scope+"."+parsedAction+'" not found');}
let formData="FORM"===element.tagName?form.toJson(element):{};let result=resolve(method,"param",formData);if(!result){return;}

View file

@ -313,7 +313,7 @@ return result;};let resolve=function(target,prefix="param",data={}){if(!target){
let args=getParams(target);return target.apply(target,args.map(function(value){let result=getValue(value,prefix,data);return result;}));};let exec=function(event){let parsedSuccess=expression.parse(success);let parsedFailure=expression.parse(failure);let parsedAction=expression.parse(action);parsedSuccess=parsedSuccess&&parsedSuccess!=""?parsedSuccess.split(",").map(element=>element.trim()):[];parsedFailure=parsedFailure&&parsedFailure!=""?parsedFailure.split(",").map(element=>element.trim()):[];element.$lsSkip=true;element.classList.add("load-service-start");if(!document.body.contains(element)){element=undefined;return false;}
if(event){event.preventDefault();}
if(running){return false;}
running=true;element.style.backgroud='red';if(confirm){if(window.confirm(confirm)!==true){element.classList.add("load-service-end");return false;}}
running=true;element.style.backgroud='red';if(confirm){if(window.confirm(confirm)!==true){element.classList.add("load-service-end");element.$lsSkip=false;running=false;return false;}}
if(loading){loaderId=alerts.add({text:loading,class:""},0);}
let method=container.path(scope+"."+parsedAction);if(!method){throw new Error('Method "'+scope+"."+parsedAction+'" not found');}
let formData="FORM"===element.tagName?form.toJson(element):{};let result=resolve(method,"param",formData);if(!result){return;}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -298,6 +298,8 @@
if (confirm) {
if (window.confirm(confirm) !== true) {
element.classList.add("load-service-end");
element.$lsSkip = false;
running = false;
return false;
}
}

View file

@ -771,9 +771,9 @@ label.switch {
}
.switch, input[type=checkbox].switch, input[type=checkbox].button.switch {
width: 67px;
height: 42px;
line-height: 42px;
width: 52px;
height: 32px;
line-height: 32px;
border-radius: 21px;
background: var(--config-color-fade);
display: inline-block;
@ -784,7 +784,7 @@ label.switch {
&.on, &:checked {
background-color: var(--config-color-success);
.func-padding-start(30px);
.func-padding-start(25px);
.func-padding-end(5px);
&:focus,
@ -805,8 +805,8 @@ label.switch {
&:after {
content: "";
display: block;
width: 32px;
height: 32px;
width: 22px;
height: 22px;
background: #fff;
border-radius: 50%;
border: none;

View file

@ -284,7 +284,7 @@
.clear;
position: relative;
> li {
> * {
.margin-end-large;
.pull-start;
width: ~"calc(33.3333% - 33.3333px)";

View file

@ -21,7 +21,8 @@ class Google extends OAuth2
*/
protected $scopes = [
'https://www.googleapis.com/auth/userinfo.email',
'https://www.googleapis.com/auth/userinfo.profile'
'https://www.googleapis.com/auth/userinfo.profile',
'openid'
];
/**
@ -60,7 +61,7 @@ class Google extends OAuth2
{
$accessToken = $this->request(
'POST',
'https://www.googleapis.com/oauth2/'.$this->version.'/token?'.http_build_query([
'https://oauth2.googleapis.com/token?'.http_build_query([
'code' => $code,
'client_id' => $this->appID,
'client_secret' => $this->appSecret,

View file

@ -227,7 +227,7 @@ class HealthCustomClientTest extends Scope
/**
* Test for SUCCESS
*/
$response = $this->client->call(Client::METHOD_GET, '/health/storage/anti-virus', array_merge([
$response = $this->client->call(Client::METHOD_GET, '/health/anti-virus', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), []);