Updated SDKs
This commit is contained in:
parent
2dd0ee9b1c
commit
374fb3adf0
|
@ -1,7 +1,7 @@
|
|||
# Appwrite SDK for Dart
|
||||
|
||||
![License](https://img.shields.io/github/license/appwrite/sdk-for-dart.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-latest-blue.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-0.2.0-blue.svg?v=1)
|
||||
|
||||
**WORK IN PROGRESS - NOT READY FOR USAGE - Want to help us improve this client SDK? Send a pull request to Appwrite [SDK generator repository](https://github.com/appwrite/sdk-generator).**
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ class Client {
|
|||
Dio http;
|
||||
|
||||
Client() {
|
||||
this.endPoint = 'https://https://appwrite.io/v1';
|
||||
this.endPoint = 'https://appwrite.io/v1';
|
||||
this.headers = {
|
||||
'content-type': 'application/json',
|
||||
'x-sdk-version': 'appwrite:dart:0.0.2',
|
||||
|
|
|
@ -6,7 +6,7 @@ class Account extends Service {
|
|||
|
||||
Account(Client client): super(client);
|
||||
|
||||
/// Get currently logged in user data as JSON object.
|
||||
/// /docs/references/account/get.md
|
||||
Future<Response> get() async {
|
||||
String path = '/account';
|
||||
|
||||
|
@ -15,7 +15,7 @@ class Account extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// Delete currently logged in user account.
|
||||
/// /docs/references/account/delete.md
|
||||
Future<Response> delete() async {
|
||||
String path = '/account';
|
||||
|
||||
|
@ -24,10 +24,7 @@ class Account extends Service {
|
|||
|
||||
return await this.client.call('delete', path: path, params: params);
|
||||
}
|
||||
/// Update currently logged in user account email address. After changing user
|
||||
/// address, user confirmation status is being reset and a new confirmation
|
||||
/// mail is sent. For security measures, user password is required to complete
|
||||
/// this request.
|
||||
/// /docs/references/account/update-email.md
|
||||
Future<Response> updateEmail({email, password}) async {
|
||||
String path = '/account/email';
|
||||
|
||||
|
@ -38,7 +35,7 @@ class Account extends Service {
|
|||
|
||||
return await this.client.call('patch', path: path, params: params);
|
||||
}
|
||||
/// Update currently logged in user account name.
|
||||
/// /docs/references/account/update-name.md
|
||||
Future<Response> updateName({name}) async {
|
||||
String path = '/account/name';
|
||||
|
||||
|
@ -48,8 +45,7 @@ class Account extends Service {
|
|||
|
||||
return await this.client.call('patch', path: path, params: params);
|
||||
}
|
||||
/// Update currently logged in user password. For validation, user is required
|
||||
/// to pass the password twice.
|
||||
/// /docs/references/account/update-password.md
|
||||
Future<Response> updatePassword({password, oldPassword}) async {
|
||||
String path = '/account/password';
|
||||
|
||||
|
@ -60,7 +56,7 @@ class Account extends Service {
|
|||
|
||||
return await this.client.call('patch', path: path, params: params);
|
||||
}
|
||||
/// Get currently logged in user preferences key-value object.
|
||||
/// /docs/references/account/get-prefs.md
|
||||
Future<Response> getPrefs() async {
|
||||
String path = '/account/prefs';
|
||||
|
||||
|
@ -69,8 +65,7 @@ class Account extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// Update currently logged in user account preferences. You can pass only the
|
||||
/// specific settings you wish to update.
|
||||
/// /docs/references/account/update-prefs.md
|
||||
Future<Response> updatePrefs({prefs}) async {
|
||||
String path = '/account/prefs';
|
||||
|
||||
|
@ -80,8 +75,7 @@ class Account extends Service {
|
|||
|
||||
return await this.client.call('patch', path: path, params: params);
|
||||
}
|
||||
/// Get currently logged in user list of latest security activity logs. Each
|
||||
/// log returns user IP address, location and date and time of log.
|
||||
/// /docs/references/account/get-security.md
|
||||
Future<Response> getSecurity() async {
|
||||
String path = '/account/security';
|
||||
|
||||
|
@ -90,8 +84,7 @@ class Account extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// Get currently logged in user list of active sessions across different
|
||||
/// devices.
|
||||
/// /docs/references/account/get-sessions.md
|
||||
Future<Response> getSessions() async {
|
||||
String path = '/account/sessions';
|
||||
|
||||
|
|
|
@ -6,20 +6,7 @@ class Auth extends Service {
|
|||
|
||||
Auth(Client client): super(client);
|
||||
|
||||
/// Allow the user to login into his account by providing a valid email and
|
||||
/// password combination. Use the success and failure arguments to provide a
|
||||
/// redirect URL\'s back to your app when login is completed.
|
||||
///
|
||||
/// Please notice that in order to avoid a [Redirect
|
||||
/// Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
/// the only valid redirect URL's are the once from domains you have set when
|
||||
/// added your platforms in the console interface.
|
||||
///
|
||||
/// When accessing this route using JavaScript from the browser, success and
|
||||
/// failure parameter URLs are required. Appwrite server will respond with a
|
||||
/// 301 redirect status code and will set the user session cookie. This
|
||||
/// behavior is enforced because modern browsers are limiting 3rd party cookies
|
||||
/// in XHR of fetch requests to protect user privacy.
|
||||
/// /docs/references/auth/login.md
|
||||
Future<Response> login({email, password, success, failure}) async {
|
||||
String path = '/auth/login';
|
||||
|
||||
|
@ -32,9 +19,7 @@ class Auth extends Service {
|
|||
|
||||
return await this.client.call('post', path: path, params: params);
|
||||
}
|
||||
/// Use this endpoint to log out the currently logged in user from his account.
|
||||
/// When succeed this endpoint will delete the user session and remove the
|
||||
/// session secret cookie from the user client.
|
||||
/// /docs/references/auth/logout.md
|
||||
Future<Response> logout() async {
|
||||
String path = '/auth/logout';
|
||||
|
||||
|
@ -43,9 +28,7 @@ class Auth extends Service {
|
|||
|
||||
return await this.client.call('delete', path: path, params: params);
|
||||
}
|
||||
/// Use this endpoint to log out the currently logged in user from all his
|
||||
/// account sessions across all his different devices. When using the option id
|
||||
/// argument, only the session unique ID provider will be deleted.
|
||||
/// /docs/references/auth/logout-by-session.md
|
||||
Future<Response> logoutBySession({id}) async {
|
||||
String path = '/auth/logout/{id}'.replaceAll(RegExp('{id}'), id);
|
||||
|
||||
|
@ -64,12 +47,7 @@ class Auth extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// Sends the user an email with a temporary secret token for password reset.
|
||||
/// When the user clicks the confirmation link he is redirected back to your
|
||||
/// app password reset redirect URL with a secret token and email address
|
||||
/// values attached to the URL query string. Use the query string params to
|
||||
/// submit a request to the /auth/password/reset endpoint to complete the
|
||||
/// process.
|
||||
/// /docs/references/auth/recovery.md
|
||||
Future<Response> recovery({email, reset}) async {
|
||||
String path = '/auth/recovery';
|
||||
|
||||
|
@ -80,15 +58,7 @@ class Auth extends Service {
|
|||
|
||||
return await this.client.call('post', path: path, params: params);
|
||||
}
|
||||
/// Use this endpoint to complete the user account password reset. Both the
|
||||
/// **userId** and **token** arguments will be passed as query parameters to
|
||||
/// the redirect URL you have provided when sending your request to the
|
||||
/// /auth/recovery endpoint.
|
||||
///
|
||||
/// Please notice that in order to avoid a [Redirect
|
||||
/// Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
/// the only valid redirect URL's are the once from domains you have set when
|
||||
/// added your platforms in the console interface.
|
||||
/// /docs/references/auth/recovery-reset.md
|
||||
Future<Response> recoveryReset({userId, token, passwordA, passwordB}) async {
|
||||
String path = '/auth/recovery/reset';
|
||||
|
||||
|
@ -101,26 +71,7 @@ class Auth extends Service {
|
|||
|
||||
return await this.client.call('put', path: path, params: params);
|
||||
}
|
||||
/// Use this endpoint to allow a new user to register an account in your
|
||||
/// project. Use the success and failure URL's to redirect users back to your
|
||||
/// application after signup completes.
|
||||
///
|
||||
/// If registration completes successfully user will be sent with a
|
||||
/// confirmation email in order to confirm he is the owner of the account email
|
||||
/// address. Use the confirmation parameter to redirect the user from the
|
||||
/// confirmation email back to your app. When the user is redirected, use the
|
||||
/// /auth/confirm endpoint to complete the account confirmation.
|
||||
///
|
||||
/// Please notice that in order to avoid a [Redirect
|
||||
/// Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
/// the only valid redirect URL's are the once from domains you have set when
|
||||
/// added your platforms in the console interface.
|
||||
///
|
||||
/// When accessing this route using JavaScript from the browser, success and
|
||||
/// failure parameter URLs are required. Appwrite server will respond with a
|
||||
/// 301 redirect status code and will set the user session cookie. This
|
||||
/// behavior is enforced because modern browsers are limiting 3rd party cookies
|
||||
/// in XHR of fetch requests to protect user privacy.
|
||||
/// /docs/references/auth/register.md
|
||||
Future<Response> register({email, password, confirm, success = null, failure = null, name = null}) async {
|
||||
String path = '/auth/register';
|
||||
|
||||
|
@ -135,10 +86,7 @@ class Auth extends Service {
|
|||
|
||||
return await this.client.call('post', path: path, params: params);
|
||||
}
|
||||
/// Use this endpoint to complete the confirmation of the user account email
|
||||
/// address. Both the **userId** and **token** arguments will be passed as
|
||||
/// query parameters to the redirect URL you have provided when sending your
|
||||
/// request to the /auth/register endpoint.
|
||||
/// /docs/references/auth/confirm.md
|
||||
Future<Response> confirm({userId, token}) async {
|
||||
String path = '/auth/register/confirm';
|
||||
|
||||
|
@ -149,14 +97,7 @@ class Auth extends Service {
|
|||
|
||||
return await this.client.call('post', path: path, params: params);
|
||||
}
|
||||
/// This endpoint allows the user to request your app to resend him his email
|
||||
/// confirmation message. The redirect arguments acts the same way as in
|
||||
/// /auth/register endpoint.
|
||||
///
|
||||
/// Please notice that in order to avoid a [Redirect
|
||||
/// Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
/// the only valid redirect URL's are the once from domains you have set when
|
||||
/// added your platforms in the console interface.
|
||||
/// /docs/references/auth/confirm-resend.md
|
||||
Future<Response> confirmResend({confirm}) async {
|
||||
String path = '/auth/register/confirm/resend';
|
||||
|
||||
|
|
|
@ -6,10 +6,7 @@ class Avatars extends Service {
|
|||
|
||||
Avatars(Client client): super(client);
|
||||
|
||||
/// You can use this endpoint to show different browser icons to your users,
|
||||
/// The code argument receives the browser code as appear in your user
|
||||
/// /account/sessions endpoint. Use width, height and quality arguments to
|
||||
/// change the output settings.
|
||||
/// /docs/references/avatars/get-browser.md
|
||||
Future<Response> getBrowser({code, width = 100, height = 100, quality = 100}) async {
|
||||
String path = '/avatars/browsers/{code}'.replaceAll(RegExp('{code}'), code);
|
||||
|
||||
|
@ -21,10 +18,7 @@ class Avatars extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// Need to display your users with your billing method or there payment
|
||||
/// methods? The credit card endpoint will return you the icon of the credit
|
||||
/// card provider you need. Use width, height and quality arguments to change
|
||||
/// the output settings.
|
||||
/// /docs/references/avatars/get-credit-cards.md
|
||||
Future<Response> getCreditCard({code, width = 100, height = 100, quality = 100}) async {
|
||||
String path = '/avatars/credit-cards/{code}'.replaceAll(RegExp('{code}'), code);
|
||||
|
||||
|
@ -36,8 +30,7 @@ class Avatars extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote
|
||||
/// website URL.
|
||||
/// /docs/references/avatars/get-favicon.md
|
||||
Future<Response> getFavicon({url}) async {
|
||||
String path = '/avatars/favicon';
|
||||
|
||||
|
@ -47,9 +40,7 @@ class Avatars extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// You can use this endpoint to show different country flags icons to your
|
||||
/// users, The code argument receives the a 2 letter country code. Use width,
|
||||
/// height and quality arguments to change the output settings.
|
||||
/// /docs/references/avatars/get-flag.md
|
||||
Future<Response> getFlag({code, width = 100, height = 100, quality = 100}) async {
|
||||
String path = '/avatars/flags/{code}'.replaceAll(RegExp('{code}'), code);
|
||||
|
||||
|
@ -61,10 +52,7 @@ class Avatars extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// Use this endpoint to fetch a remote image URL and crop it to any image size
|
||||
/// you want. This endpoint is very useful if you need to crop and display
|
||||
/// remote images in your app or in cases, you want to make sure a 3rd party
|
||||
/// image is properly served using a TLS protocol.
|
||||
/// /docs/references/avatars/get-image.md
|
||||
Future<Response> getImage({url, width = 400, height = 400}) async {
|
||||
String path = '/avatars/image';
|
||||
|
||||
|
@ -76,8 +64,7 @@ class Avatars extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// 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.
|
||||
/// /docs/references/avatars/get-qr.md
|
||||
Future<Response> getQR({text, size = 400, margin = 1, download = null}) async {
|
||||
String path = '/avatars/qr';
|
||||
|
||||
|
|
|
@ -6,10 +6,7 @@ class Database extends Service {
|
|||
|
||||
Database(Client client): super(client);
|
||||
|
||||
/// 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).
|
||||
/// /docs/references/database/list-collections.md
|
||||
Future<Response> listCollections({search = null, limit = 25, offset = null, orderType = 'ASC'}) async {
|
||||
String path = '/database';
|
||||
|
||||
|
@ -22,7 +19,7 @@ class Database extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// Create a new Collection.
|
||||
/// /docs/references/database/create-collection.md
|
||||
Future<Response> createCollection({name, read = const [], write = const [], rules = const []}) async {
|
||||
String path = '/database';
|
||||
|
||||
|
@ -35,8 +32,7 @@ class Database extends Service {
|
|||
|
||||
return await this.client.call('post', path: path, params: params);
|
||||
}
|
||||
/// Get collection by its unique ID. This endpoint response returns a JSON
|
||||
/// object with the collection metadata.
|
||||
/// /docs/references/database/get-collection.md
|
||||
Future<Response> getCollection({collectionId}) async {
|
||||
String path = '/database/{collectionId}'.replaceAll(RegExp('{collectionId}'), collectionId);
|
||||
|
||||
|
@ -45,7 +41,7 @@ class Database extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// Update collection by its unique ID.
|
||||
/// /docs/references/database/update-collection.md
|
||||
Future<Response> updateCollection({collectionId, name, read = const [], write = const [], rules = const []}) async {
|
||||
String path = '/database/{collectionId}'.replaceAll(RegExp('{collectionId}'), collectionId);
|
||||
|
||||
|
@ -58,8 +54,7 @@ class Database extends Service {
|
|||
|
||||
return await this.client.call('put', path: path, params: params);
|
||||
}
|
||||
/// Delete a collection by its unique ID. Only users with write permissions
|
||||
/// have access to delete this resource.
|
||||
/// /docs/references/database/delete-collection.md
|
||||
Future<Response> deleteCollection({collectionId}) async {
|
||||
String path = '/database/{collectionId}'.replaceAll(RegExp('{collectionId}'), collectionId);
|
||||
|
||||
|
@ -68,10 +63,7 @@ class Database extends Service {
|
|||
|
||||
return await this.client.call('delete', path: path, params: params);
|
||||
}
|
||||
/// 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).
|
||||
/// /docs/references/database/list-documents.md
|
||||
Future<Response> listDocuments({collectionId, filters = const [], offset = null, limit = 50, orderField = '\$uid', orderType = 'ASC', orderCast = 'string', search = null, first = null, last = null}) async {
|
||||
String path = '/database/{collectionId}/documents'.replaceAll(RegExp('{collectionId}'), collectionId);
|
||||
|
||||
|
@ -89,7 +81,7 @@ class Database extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// Create a new Document.
|
||||
/// /docs/references/database/create-document.md
|
||||
Future<Response> createDocument({collectionId, data, read = const [], write = const [], parentDocument = null, parentProperty = null, parentPropertyType = 'assign'}) async {
|
||||
String path = '/database/{collectionId}/documents'.replaceAll(RegExp('{collectionId}'), collectionId);
|
||||
|
||||
|
@ -104,8 +96,7 @@ class Database extends Service {
|
|||
|
||||
return await this.client.call('post', path: path, params: params);
|
||||
}
|
||||
/// Get document by its unique ID. This endpoint response returns a JSON object
|
||||
/// with the document data.
|
||||
/// /docs/references/database/get-document.md
|
||||
Future<Response> getDocument({collectionId, documentId}) async {
|
||||
String path = '/database/{collectionId}/documents/{documentId}'.replaceAll(RegExp('{collectionId}'), collectionId).replaceAll(RegExp('{documentId}'), documentId);
|
||||
|
||||
|
@ -114,6 +105,7 @@ class Database extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// /docs/references/database/update-document.md
|
||||
Future<Response> updateDocument({collectionId, documentId, data, read = const [], write = const []}) async {
|
||||
String path = '/database/{collectionId}/documents/{documentId}'.replaceAll(RegExp('{collectionId}'), collectionId).replaceAll(RegExp('{documentId}'), documentId);
|
||||
|
||||
|
@ -125,9 +117,7 @@ class Database extends Service {
|
|||
|
||||
return await this.client.call('patch', path: path, params: params);
|
||||
}
|
||||
/// Delete document by its unique ID. This endpoint deletes only the parent
|
||||
/// documents, his attributes and relations to other documents. Child documents
|
||||
/// **will not** be deleted.
|
||||
/// /docs/references/database/delete-document.md
|
||||
Future<Response> deleteDocument({collectionId, documentId}) async {
|
||||
String path = '/database/{collectionId}/documents/{documentId}'.replaceAll(RegExp('{collectionId}'), collectionId).replaceAll(RegExp('{documentId}'), documentId);
|
||||
|
||||
|
|
|
@ -6,10 +6,7 @@ class Locale extends Service {
|
|||
|
||||
Locale(Client client): super(client);
|
||||
|
||||
/// Get the current user location based on IP. Returns an object with user
|
||||
/// country code, country name, continent name, continent code, ip address and
|
||||
/// suggested currency. You can use the locale header to get the data in
|
||||
/// supported language.
|
||||
/// /docs/references/locale/get-locale.md
|
||||
Future<Response> getLocale() async {
|
||||
String path = '/locale';
|
||||
|
||||
|
@ -18,8 +15,7 @@ class Locale extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// List of all countries. You can use the locale header to get the data in
|
||||
/// supported language.
|
||||
/// /docs/references/locale/get-countires.md
|
||||
Future<Response> getCountries() async {
|
||||
String path = '/locale/countries';
|
||||
|
||||
|
@ -28,9 +24,7 @@ class Locale extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// List of all countries that are currently members of the EU. You can use the
|
||||
/// locale header to get the data in supported language. UK brexit date is
|
||||
/// currently set to 2019-10-31 and will be updated if and when needed.
|
||||
/// /docs/references/locale/get-countries-eu.md
|
||||
Future<Response> getCountriesEU() async {
|
||||
String path = '/locale/countries/eu';
|
||||
|
||||
|
@ -39,8 +33,7 @@ class Locale extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// List of all countries phone codes. You can use the locale header to get the
|
||||
/// data in supported language.
|
||||
/// /docs/references/locale/get-countries-phones.md
|
||||
Future<Response> getCountriesPhones() async {
|
||||
String path = '/locale/countries/phones';
|
||||
|
||||
|
@ -49,9 +42,7 @@ class Locale extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// List of all currencies, including currency symbol, name, plural, and
|
||||
/// decimal digits for all major and minor currencies. You can use the locale
|
||||
/// header to get the data in supported language.
|
||||
/// /docs/references/locale/get-currencies.md
|
||||
Future<Response> getCurrencies() async {
|
||||
String path = '/locale/currencies';
|
||||
|
||||
|
|
|
@ -6,9 +6,7 @@ class Storage extends Service {
|
|||
|
||||
Storage(Client client): super(client);
|
||||
|
||||
/// 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).
|
||||
/// /docs/references/storage/list-files.md
|
||||
Future<Response> listFiles({search = null, limit = 25, offset = null, orderType = 'ASC'}) async {
|
||||
String path = '/storage/files';
|
||||
|
||||
|
@ -21,9 +19,7 @@ class Storage extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// Create a new file. The user who creates the file will automatically be
|
||||
/// assigned to read and write access unless he has passed custom values for
|
||||
/// read and write arguments.
|
||||
/// /docs/references/storage/create-file.md
|
||||
Future<Response> createFile({files, read = const [], write = const [], folderId = null}) async {
|
||||
String path = '/storage/files';
|
||||
|
||||
|
@ -36,8 +32,7 @@ class Storage extends Service {
|
|||
|
||||
return await this.client.call('post', path: path, params: params);
|
||||
}
|
||||
/// Get file by its unique ID. This endpoint response returns a JSON object
|
||||
/// with the file metadata.
|
||||
/// /docs/references/storage/get-file.md
|
||||
Future<Response> getFile({fileId}) async {
|
||||
String path = '/storage/files/{fileId}'.replaceAll(RegExp('{fileId}'), fileId);
|
||||
|
||||
|
@ -46,8 +41,7 @@ class Storage extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// Update file by its unique ID. Only users with write permissions have access
|
||||
/// to update this resource.
|
||||
/// /docs/references/storage/update-file.md
|
||||
Future<Response> updateFile({fileId, read = const [], write = const [], folderId = null}) async {
|
||||
String path = '/storage/files/{fileId}'.replaceAll(RegExp('{fileId}'), fileId);
|
||||
|
||||
|
@ -59,8 +53,7 @@ class Storage extends Service {
|
|||
|
||||
return await this.client.call('put', path: path, params: params);
|
||||
}
|
||||
/// Delete a file by its unique ID. Only users with write permissions have
|
||||
/// access to delete this resource.
|
||||
/// /docs/references/storage/delete-file.md
|
||||
Future<Response> deleteFile({fileId}) async {
|
||||
String path = '/storage/files/{fileId}'.replaceAll(RegExp('{fileId}'), fileId);
|
||||
|
||||
|
@ -69,9 +62,7 @@ class Storage extends Service {
|
|||
|
||||
return await this.client.call('delete', path: path, params: params);
|
||||
}
|
||||
/// Get file content by its unique ID. The endpoint response return with a
|
||||
/// 'Content-Disposition: attachment' header that tells the browser to start
|
||||
/// downloading the file to user downloads directory.
|
||||
/// /docs/references/storage/get-file-download.md
|
||||
Future<Response> getFileDownload({fileId}) async {
|
||||
String path = '/storage/files/{fileId}/download'.replaceAll(RegExp('{fileId}'), fileId);
|
||||
|
||||
|
@ -80,10 +71,7 @@ class Storage extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// Get file preview image. Currently, this method supports preview for image
|
||||
/// files (jpg, png, and gif), other supported formats, like pdf, docs, slides,
|
||||
/// and spreadsheets will return file icon image. You can also pass query
|
||||
/// string arguments for cutting and resizing your preview image.
|
||||
/// /docs/references/storage/get-file-preview.md
|
||||
Future<Response> getFilePreview({fileId, width = null, height = null, quality = 100, background = null, output = null}) async {
|
||||
String path = '/storage/files/{fileId}/preview'.replaceAll(RegExp('{fileId}'), fileId);
|
||||
|
||||
|
@ -97,8 +85,7 @@ class Storage extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// Get file content by its unique ID. This endpoint is similar to the download
|
||||
/// method but returns with no 'Content-Disposition: attachment' header.
|
||||
/// /docs/references/storage/get-file-view.md
|
||||
Future<Response> getFileView({fileId, as = null}) async {
|
||||
String path = '/storage/files/{fileId}/view'.replaceAll(RegExp('{fileId}'), fileId);
|
||||
|
||||
|
|
|
@ -6,9 +6,7 @@ class Teams extends Service {
|
|||
|
||||
Teams(Client client): super(client);
|
||||
|
||||
/// 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).
|
||||
/// /docs/references/teams/list-teams.md
|
||||
Future<Response> listTeams({search = null, limit = 25, offset = null, orderType = 'ASC'}) async {
|
||||
String path = '/teams';
|
||||
|
||||
|
@ -21,10 +19,7 @@ class Teams extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// Create a new team. The user who creates the team will automatically be
|
||||
/// assigned as the owner of the team. The team owner can invite new members,
|
||||
/// who will be able add new owners and update or delete the team from your
|
||||
/// project.
|
||||
/// /docs/references/teams/create-team.md
|
||||
Future<Response> createTeam({name, roles = const ["owner"]}) async {
|
||||
String path = '/teams';
|
||||
|
||||
|
@ -35,8 +30,7 @@ class Teams extends Service {
|
|||
|
||||
return await this.client.call('post', path: path, params: params);
|
||||
}
|
||||
/// Get team by its unique ID. All team members have read access for this
|
||||
/// resource.
|
||||
/// /docs/references/teams/get-team.md
|
||||
Future<Response> getTeam({teamId}) async {
|
||||
String path = '/teams/{teamId}'.replaceAll(RegExp('{teamId}'), teamId);
|
||||
|
||||
|
@ -45,8 +39,7 @@ class Teams extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// Update team by its unique ID. Only team owners have write access for this
|
||||
/// resource.
|
||||
/// /docs/references/teams/update-team.md
|
||||
Future<Response> updateTeam({teamId, name}) async {
|
||||
String path = '/teams/{teamId}'.replaceAll(RegExp('{teamId}'), teamId);
|
||||
|
||||
|
@ -56,8 +49,7 @@ class Teams extends Service {
|
|||
|
||||
return await this.client.call('put', path: path, params: params);
|
||||
}
|
||||
/// Delete team by its unique ID. Only team owners have write access for this
|
||||
/// resource.
|
||||
/// /docs/references/teams/delete-team.md
|
||||
Future<Response> deleteTeam({teamId}) async {
|
||||
String path = '/teams/{teamId}'.replaceAll(RegExp('{teamId}'), teamId);
|
||||
|
||||
|
@ -66,8 +58,7 @@ class Teams extends Service {
|
|||
|
||||
return await this.client.call('delete', path: path, params: params);
|
||||
}
|
||||
/// Get team members by the team unique ID. All team members have read access
|
||||
/// for this list of resources.
|
||||
/// /docs/references/teams/get-team-members.md
|
||||
Future<Response> getTeamMembers({teamId}) async {
|
||||
String path = '/teams/{teamId}/members'.replaceAll(RegExp('{teamId}'), teamId);
|
||||
|
||||
|
@ -76,19 +67,7 @@ class Teams extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// Use this endpoint to invite a new member to your team. An email with a link
|
||||
/// to join the team will be sent to the new member email address. If member
|
||||
/// doesn't exists in the project it will be automatically created.
|
||||
///
|
||||
/// Use the redirect parameter to redirect the user from the invitation email
|
||||
/// back to your app. When the user is redirected, use the
|
||||
/// /teams/{teamId}/memberships/{inviteId}/status endpoint to finally join the
|
||||
/// user to the team.
|
||||
///
|
||||
/// Please notice that in order to avoid a [Redirect
|
||||
/// Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
/// the only valid redirect URL's are the once from domains you have set when
|
||||
/// added your platforms in the console interface.
|
||||
/// /docs/references/teams/create-team-membership.md
|
||||
Future<Response> createTeamMembership({teamId, email, roles, redirect, name = null}) async {
|
||||
String path = '/teams/{teamId}/memberships'.replaceAll(RegExp('{teamId}'), teamId);
|
||||
|
||||
|
@ -101,8 +80,7 @@ class Teams extends Service {
|
|||
|
||||
return await this.client.call('post', path: path, params: params);
|
||||
}
|
||||
/// This endpoint allows a user to leave a team or for a team owner to delete
|
||||
/// the membership of any other team member.
|
||||
/// /docs/references/teams/delete-team-membership.md
|
||||
Future<Response> deleteTeamMembership({teamId, inviteId}) async {
|
||||
String path = '/teams/{teamId}/memberships/{inviteId}'.replaceAll(RegExp('{teamId}'), teamId).replaceAll(RegExp('{inviteId}'), inviteId);
|
||||
|
||||
|
@ -111,8 +89,7 @@ class Teams extends Service {
|
|||
|
||||
return await this.client.call('delete', path: path, params: params);
|
||||
}
|
||||
/// Use this endpoint to resend your invitation email for a user to join a
|
||||
/// team.
|
||||
/// /docs/references/teams/create-team-membership-resend.md
|
||||
Future<Response> createTeamMembershipResend({teamId, inviteId, redirect}) async {
|
||||
String path = '/teams/{teamId}/memberships/{inviteId}/resend'.replaceAll(RegExp('{teamId}'), teamId).replaceAll(RegExp('{inviteId}'), inviteId);
|
||||
|
||||
|
@ -122,21 +99,7 @@ class Teams extends Service {
|
|||
|
||||
return await this.client.call('post', path: path, params: params);
|
||||
}
|
||||
/// Use this endpoint to let user accept an invitation to join a team after he
|
||||
/// is being redirect back to your app from the invitation email. Use the
|
||||
/// success and failure URL's to redirect users back to your application after
|
||||
/// the request completes.
|
||||
///
|
||||
/// Please notice that in order to avoid a [Redirect
|
||||
/// Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
/// the only valid redirect URL's are the once from domains you have set when
|
||||
/// added your platforms in the console interface.
|
||||
///
|
||||
/// When not using the success or failure redirect arguments this endpoint will
|
||||
/// result with a 200 status code on success and with 401 status error on
|
||||
/// failure. This behavior was applied to help the web clients deal with
|
||||
/// browsers who don't allow to set 3rd party HTTP cookies needed for saving
|
||||
/// the account session token.
|
||||
/// /docs/references/teams/update-team-membership-status.md
|
||||
Future<Response> updateTeamMembershipStatus({teamId, inviteId, userId, secret, success = null, failure = null}) async {
|
||||
String path = '/teams/{teamId}/memberships/{inviteId}/status'.replaceAll(RegExp('{teamId}'), teamId).replaceAll(RegExp('{inviteId}'), inviteId);
|
||||
|
||||
|
|
|
@ -6,8 +6,7 @@ class Users extends Service {
|
|||
|
||||
Users(Client client): super(client);
|
||||
|
||||
/// Get a list of all the project users. You can use the query params to filter
|
||||
/// your results.
|
||||
/// /docs/references/users/list-users.md
|
||||
Future<Response> listUsers({search = null, limit = 25, offset = null, orderType = 'ASC'}) async {
|
||||
String path = '/users';
|
||||
|
||||
|
@ -20,7 +19,7 @@ class Users extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// Create a new user.
|
||||
/// /docs/references/users/create-user.md
|
||||
Future<Response> createUser({email, password, name = null}) async {
|
||||
String path = '/users';
|
||||
|
||||
|
@ -32,7 +31,7 @@ class Users extends Service {
|
|||
|
||||
return await this.client.call('post', path: path, params: params);
|
||||
}
|
||||
/// Get user by its unique ID.
|
||||
/// /docs/references/users/get-user.md
|
||||
Future<Response> getUser({userId}) async {
|
||||
String path = '/users/{userId}'.replaceAll(RegExp('{userId}'), userId);
|
||||
|
||||
|
@ -41,7 +40,7 @@ class Users extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// Get user activity logs list by its unique ID.
|
||||
/// /docs/references/users/get-user-logs.md
|
||||
Future<Response> getUserLogs({userId}) async {
|
||||
String path = '/users/{userId}/logs'.replaceAll(RegExp('{userId}'), userId);
|
||||
|
||||
|
@ -50,7 +49,7 @@ class Users extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// Get user preferences by its unique ID.
|
||||
/// /docs/references/users/get-user-prefs.md
|
||||
Future<Response> getUserPrefs({userId}) async {
|
||||
String path = '/users/{userId}/prefs'.replaceAll(RegExp('{userId}'), userId);
|
||||
|
||||
|
@ -59,7 +58,17 @@ class Users extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// Get user sessions list by its unique ID.
|
||||
/// /docs/references/users/update-user-prefs.md
|
||||
Future<Response> updateUserPrefs({userId, prefs}) async {
|
||||
String path = '/users/{userId}/prefs'.replaceAll(RegExp('{userId}'), userId);
|
||||
|
||||
Map<String, dynamic> params = {
|
||||
'prefs': prefs,
|
||||
};
|
||||
|
||||
return await this.client.call('patch', path: path, params: params);
|
||||
}
|
||||
/// /docs/references/users/get-user-sessions.md
|
||||
Future<Response> getUserSessions({userId}) async {
|
||||
String path = '/users/{userId}/sessions'.replaceAll(RegExp('{userId}'), userId);
|
||||
|
||||
|
@ -77,8 +86,8 @@ class Users extends Service {
|
|||
|
||||
return await this.client.call('delete', path: path, params: params);
|
||||
}
|
||||
/// Delete user sessions by its unique ID.
|
||||
Future<Response> deleteUsersSession({userId, sessionId}) async {
|
||||
/// /docs/references/users/delete-user-session.md
|
||||
Future<Response> deleteUserSession({userId, sessionId}) async {
|
||||
String path = '/users/{userId}/sessions/:session'.replaceAll(RegExp('{userId}'), userId);
|
||||
|
||||
Map<String, dynamic> params = {
|
||||
|
@ -87,7 +96,7 @@ class Users extends Service {
|
|||
|
||||
return await this.client.call('delete', path: path, params: params);
|
||||
}
|
||||
/// Update user status by its unique ID.
|
||||
/// /docs/references/users/update-user-status.md
|
||||
Future<Response> updateUserStatus({userId, status}) async {
|
||||
String path = '/users/{userId}/status'.replaceAll(RegExp('{userId}'), userId);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Appwrite SDK for Javascript
|
||||
|
||||
![License](https://img.shields.io/github/license/appwrite/sdk-for-js.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-latest-blue.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-0.2.0-blue.svg?v=1)
|
||||
|
||||
**This SDK is compatible with Appwrite server version 0.2.0. For older versions, please check previous releases.**
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ sdk
|
|||
.setProject('')
|
||||
;
|
||||
|
||||
let promise = sdk.projects.createTask('[PROJECT_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com');
|
||||
let promise = sdk.projects.createTask('[PROJECT_ID]', '[NAME]', 'play', '', 1, 'GET', 'https://example.com');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response);
|
||||
|
|
|
@ -4,7 +4,7 @@ sdk
|
|||
.setProject('')
|
||||
;
|
||||
|
||||
let promise = sdk.projects.createWebhook('[PROJECT_ID]', '[NAME]', [], '[URL]', 0);
|
||||
let promise = sdk.projects.createWebhook('[PROJECT_ID]', '[NAME]', [], '[URL]', 1);
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response);
|
||||
|
|
|
@ -4,7 +4,7 @@ sdk
|
|||
.setProject('')
|
||||
;
|
||||
|
||||
let promise = sdk.projects.updateTask('[PROJECT_ID]', '[TASK_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com');
|
||||
let promise = sdk.projects.updateTask('[PROJECT_ID]', '[TASK_ID]', '[NAME]', 'play', '', 1, 'GET', 'https://example.com');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response);
|
||||
|
|
|
@ -4,7 +4,7 @@ sdk
|
|||
.setProject('')
|
||||
;
|
||||
|
||||
let promise = sdk.projects.updateWebhook('[PROJECT_ID]', '[WEBHOOK_ID]', '[NAME]', [], '[URL]', 1);
|
||||
let promise = sdk.projects.updateWebhook('[PROJECT_ID]', '[WEBHOOK_ID]', '[NAME]', [], '[URL]', 0);
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response);
|
||||
|
|
13
app/sdks/js/docs/examples/users/delete-user-session.md
Normal file
13
app/sdks/js/docs/examples/users/delete-user-session.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setProject('')
|
||||
;
|
||||
|
||||
let promise = sdk.users.deleteUserSession('[USER_ID]', '[SESSION_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response);
|
||||
}, function (error) {
|
||||
console.log(error);
|
||||
});
|
13
app/sdks/js/docs/examples/users/update-user-prefs.md
Normal file
13
app/sdks/js/docs/examples/users/update-user-prefs.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setProject('')
|
||||
;
|
||||
|
||||
let promise = sdk.users.updateUserPrefs('[USER_ID]', '{}');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response);
|
||||
}, function (error) {
|
||||
console.log(error);
|
||||
});
|
File diff suppressed because it is too large
Load diff
344
app/sdks/js/src/sdk.min.js
vendored
344
app/sdks/js/src/sdk.min.js
vendored
|
@ -1,4 +1,4 @@
|
|||
(function(window){window.Appwrite=function(){let config={endpoint:'https://https://appwrite.io/v1',project:'',key:'',locale:'',mode:'',};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 setKey=function(value){http.addGlobalHeader('X-Appwrite-Key',value);config.key=value;return this};let setLocale=function(value){http.addGlobalHeader('X-Appwrite-Locale',value);config.locale=value;return this};let setMode=function(value){http.addGlobalHeader('X-Appwrite-Mode',value);config.mode=value;return this};let http=function(document){let globalParams=[],globalHeaders=[];let addParam=function(url,param,value){let a=document.createElement('a'),regex=/(?:\?|&|&)+([^=]+)(?:=([^&]*))*/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]))}}
|
||||
(function(window){'use strict';window.Appwrite=function(){let config={endpoint:'https://appwrite.io/v1',project:'',key:'',locale:'',mode:'',};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 setKey=function(value){http.addGlobalHeader('X-Appwrite-Key',value);config.key=value;return this};let setLocale=function(value){http.addGlobalHeader('X-Appwrite-Locale',value);config.locale=value;return this};let setMode=function(value){http.addGlobalHeader('X-Appwrite-Mode',value);config.mode=value;return this};let http=function(document){let globalParams=[],globalHeaders=[];let addParam=function(url,param,value){let a=document.createElement('a'),regex=/(?:\?|&|&)+([^=]+)(?:=([^&]*))*/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.22');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')}
|
||||
|
@ -11,93 +11,213 @@ request.setRequestHeader(key,headers[key])}}
|
|||
request.onload=function(){if(4===request.readyState&&399>=request.status){let data=request.response;let contentType=this.getResponseHeader('content-type')||'';contentType=contentType.substring(0,contentType.indexOf(';'));switch(contentType){case 'application/json':data=JSON.parse(data);break}
|
||||
resolve(data)}else{reject(new Error(request.statusText))}};if(progress){request.addEventListener('progress',progress);request.upload.addEventListener('progress',progress,!1)}
|
||||
request.onerror=function(){reject(new Error("Network Error"))};request.send(params)})};return{'get':function(path,headers={},params={}){return call('GET',path+((Object.keys(params).length>0)?'?'+buildQuery(params):''),headers,{})},'post':function(path,headers={},params={},progress=null){return call('POST',path,headers,params,progress)},'put':function(path,headers={},params={},progress=null){return call('PUT',path,headers,params,progress)},'patch':function(path,headers={},params={},progress=null){return call('PATCH',path,headers,params,progress)},'delete':function(path,headers={},params={},progress=null){return call('DELETE',path,headers,params,progress)},'addGlobalParam':addGlobalParam,'addGlobalHeader':addGlobalHeader}}(window.document);let iframe=function(method,url,params){let form=document.createElement('form');form.setAttribute('method',method);form.setAttribute('action',config.endpoint+url);for(let key in params){if(params.hasOwnProperty(key)){let hiddenField=document.createElement("input");hiddenField.setAttribute("type","hidden");hiddenField.setAttribute("name",key);hiddenField.setAttribute("value",params[key]);form.appendChild(hiddenField)}}
|
||||
document.body.appendChild(form);return form.submit()};let account={get:function(){let path='/account';return http.get(path,{'content-type':'application/json'},{})},delete:function(){let path='/account';return http.delete(path,{'content-type':'application/json'},{})},updateEmail:function(email,password){if(email===undefined){throw new Error('Missing required parameter: "email"')}
|
||||
document.body.appendChild(form);return form.submit()};let account={get:function(){let path='/account';let payload={};return http.get(path,{'content-type':'application/json'},payload)},delete:function(){let path='/account';let payload={};return http.delete(path,{'content-type':'application/json'},payload)},updateEmail:function(email,password){if(email===undefined){throw new Error('Missing required parameter: "email"')}
|
||||
if(password===undefined){throw new Error('Missing required parameter: "password"')}
|
||||
let path='/account/email';return http.patch(path,{'content-type':'application/json'},{'email':email,'password':password})},updateName:function(name){if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
let path='/account/name';return http.patch(path,{'content-type':'application/json'},{'name':name})},updatePassword:function(password,oldPassword){if(password===undefined){throw new Error('Missing required parameter: "password"')}
|
||||
let path='/account/email';let payload={};if(email){payload.email=email}
|
||||
if(password){payload.password=password}
|
||||
return http.patch(path,{'content-type':'application/json'},payload)},updateName:function(name){if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
let path='/account/name';let payload={};if(name){payload.name=name}
|
||||
return http.patch(path,{'content-type':'application/json'},payload)},updatePassword:function(password,oldPassword){if(password===undefined){throw new Error('Missing required parameter: "password"')}
|
||||
if(oldPassword===undefined){throw new Error('Missing required parameter: "oldPassword"')}
|
||||
let path='/account/password';return http.patch(path,{'content-type':'application/json'},{'password':password,'old-password':oldPassword})},getPrefs:function(){let path='/account/prefs';return http.get(path,{'content-type':'application/json'},{})},updatePrefs:function(prefs){if(prefs===undefined){throw new Error('Missing required parameter: "prefs"')}
|
||||
let path='/account/prefs';return http.patch(path,{'content-type':'application/json'},{'prefs':prefs})},getSecurity:function(){let path='/account/security';return http.get(path,{'content-type':'application/json'},{})},getSessions:function(){let path='/account/sessions';return http.get(path,{'content-type':'application/json'},{})}};let auth={login:function(email,password,success,failure){if(email===undefined){throw new Error('Missing required parameter: "email"')}
|
||||
let path='/account/password';let payload={};if(password){payload.password=password}
|
||||
if(oldPassword){payload['old-password']=oldPassword}
|
||||
return http.patch(path,{'content-type':'application/json'},payload)},getPrefs:function(){let path='/account/prefs';let payload={};return http.get(path,{'content-type':'application/json'},payload)},updatePrefs:function(prefs){if(prefs===undefined){throw new Error('Missing required parameter: "prefs"')}
|
||||
let path='/account/prefs';let payload={};if(prefs){payload.prefs=prefs}
|
||||
return http.patch(path,{'content-type':'application/json'},payload)},getSecurity:function(){let path='/account/security';let payload={};return http.get(path,{'content-type':'application/json'},payload)},getSessions:function(){let path='/account/sessions';let payload={};return http.get(path,{'content-type':'application/json'},payload)}};let auth={login:function(email,password,success,failure){if(email===undefined){throw new Error('Missing required parameter: "email"')}
|
||||
if(password===undefined){throw new Error('Missing required parameter: "password"')}
|
||||
if(success===undefined){throw new Error('Missing required parameter: "success"')}
|
||||
if(failure===undefined){throw new Error('Missing required parameter: "failure"')}
|
||||
let path='/auth/login';return iframe('post',path,{project:config.project,'email':email,'password':password,'success':success,'failure':failure})},logout:function(){let path='/auth/logout';return http.delete(path,{'content-type':'application/json'},{})},logoutBySession:function(id){if(id===undefined){throw new Error('Missing required parameter: "id"')}
|
||||
let path='/auth/logout/{id}'.replace(new RegExp('{id}','g'),id);return http.delete(path,{'content-type':'application/json'},{})},oauth:function(provider,success='',failure=''){if(provider===undefined){throw new Error('Missing required parameter: "provider"')}
|
||||
let path='/auth/oauth/{provider}'.replace(new RegExp('{provider}','g'),provider);return http.get(path,{'content-type':'application/json'},{'success':success,'failure':failure})},recovery:function(email,reset){if(email===undefined){throw new Error('Missing required parameter: "email"')}
|
||||
let path='/auth/login';let payload={};if(email){payload.email=email}
|
||||
if(password){payload.password=password}
|
||||
if(success){payload.success=success}
|
||||
if(failure){payload.failure=failure}
|
||||
payload.project=config.project;return iframe('post',path,payload)},logout:function(){let path='/auth/logout';let payload={};return http.delete(path,{'content-type':'application/json'},payload)},logoutBySession:function(id){if(id===undefined){throw new Error('Missing required parameter: "id"')}
|
||||
let path='/auth/logout/{id}'.replace(new RegExp('{id}','g'),id);let payload={};return http.delete(path,{'content-type':'application/json'},payload)},oauth:function(provider,success='',failure=''){if(provider===undefined){throw new Error('Missing required parameter: "provider"')}
|
||||
let path='/auth/oauth/{provider}'.replace(new RegExp('{provider}','g'),provider);let payload={};if(success){payload.success=success}
|
||||
if(failure){payload.failure=failure}
|
||||
return http.get(path,{'content-type':'application/json'},payload)},recovery:function(email,reset){if(email===undefined){throw new Error('Missing required parameter: "email"')}
|
||||
if(reset===undefined){throw new Error('Missing required parameter: "reset"')}
|
||||
let path='/auth/recovery';return http.post(path,{'content-type':'application/json'},{'email':email,'reset':reset})},recoveryReset:function(userId,token,passwordA,passwordB){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
let path='/auth/recovery';let payload={};if(email){payload.email=email}
|
||||
if(reset){payload.reset=reset}
|
||||
return http.post(path,{'content-type':'application/json'},payload)},recoveryReset:function(userId,token,passwordA,passwordB){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
if(token===undefined){throw new Error('Missing required parameter: "token"')}
|
||||
if(passwordA===undefined){throw new Error('Missing required parameter: "passwordA"')}
|
||||
if(passwordB===undefined){throw new Error('Missing required parameter: "passwordB"')}
|
||||
let path='/auth/recovery/reset';return http.put(path,{'content-type':'application/json'},{'userId':userId,'token':token,'password-a':passwordA,'password-b':passwordB})},register:function(email,password,confirm,success='',failure='',name=''){if(email===undefined){throw new Error('Missing required parameter: "email"')}
|
||||
let path='/auth/recovery/reset';let payload={};if(userId){payload.userId=userId}
|
||||
if(token){payload.token=token}
|
||||
if(passwordA){payload['password-a']=passwordA}
|
||||
if(passwordB){payload['password-b']=passwordB}
|
||||
return http.put(path,{'content-type':'application/json'},payload)},register:function(email,password,confirm,success='',failure='',name=''){if(email===undefined){throw new Error('Missing required parameter: "email"')}
|
||||
if(password===undefined){throw new Error('Missing required parameter: "password"')}
|
||||
if(confirm===undefined){throw new Error('Missing required parameter: "confirm"')}
|
||||
let path='/auth/register';return iframe('post',path,{project:config.project,'email':email,'password':password,'confirm':confirm,'success':success,'failure':failure,'name':name})},confirm:function(userId,token){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
let path='/auth/register';let payload={};if(email){payload.email=email}
|
||||
if(password){payload.password=password}
|
||||
if(confirm){payload.confirm=confirm}
|
||||
if(success){payload.success=success}
|
||||
if(failure){payload.failure=failure}
|
||||
if(name){payload.name=name}
|
||||
payload.project=config.project;return iframe('post',path,payload)},confirm:function(userId,token){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
if(token===undefined){throw new Error('Missing required parameter: "token"')}
|
||||
let path='/auth/register/confirm';return http.post(path,{'content-type':'application/json'},{'userId':userId,'token':token})},confirmResend:function(confirm){if(confirm===undefined){throw new Error('Missing required parameter: "confirm"')}
|
||||
let path='/auth/register/confirm/resend';return http.post(path,{'content-type':'application/json'},{'confirm':confirm})}};let avatars={getBrowser:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')}
|
||||
let path='/avatars/browsers/{code}'.replace(new RegExp('{code}','g'),code);return http.get(path,{'content-type':'application/json'},{'width':width,'height':height,'quality':quality})},getCreditCard:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')}
|
||||
let path='/avatars/credit-cards/{code}'.replace(new RegExp('{code}','g'),code);return http.get(path,{'content-type':'application/json'},{'width':width,'height':height,'quality':quality})},getFavicon:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"')}
|
||||
let path='/avatars/favicon';return http.get(path,{'content-type':'application/json'},{'url':url})},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);return http.get(path,{'content-type':'application/json'},{'width':width,'height':height,'quality':quality})},getImage:function(url,width=400,height=400){if(url===undefined){throw new Error('Missing required parameter: "url"')}
|
||||
let path='/avatars/image';return http.get(path,{'content-type':'application/json'},{'url':url,'width':width,'height':height})},getQR:function(text,size=400,margin=1,download=0){if(text===undefined){throw new Error('Missing required parameter: "text"')}
|
||||
let path='/avatars/qr';return http.get(path,{'content-type':'application/json'},{'text':text,'size':size,'margin':margin,'download':download})}};let database={listCollections:function(search='',limit=25,offset=0,orderType='ASC'){let path='/database';return http.get(path,{'content-type':'application/json'},{'search':search,'limit':limit,'offset':offset,'orderType':orderType})},createCollection:function(name,read=[],write=[],rules=[]){if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
let path='/database';return http.post(path,{'content-type':'application/json'},{'name':name,'read':read,'write':write,'rules':rules})},getCollection:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
|
||||
let path='/database/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);return http.get(path,{'content-type':'application/json'},{})},updateCollection:function(collectionId,name,read=[],write=[],rules=[]){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
|
||||
let path='/auth/register/confirm';let payload={};if(userId){payload.userId=userId}
|
||||
if(token){payload.token=token}
|
||||
return http.post(path,{'content-type':'application/json'},payload)},confirmResend:function(confirm){if(confirm===undefined){throw new Error('Missing required parameter: "confirm"')}
|
||||
let path='/auth/register/confirm/resend';let payload={};if(confirm){payload.confirm=confirm}
|
||||
return http.post(path,{'content-type':'application/json'},payload)}};let avatars={getBrowser:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')}
|
||||
let path='/avatars/browsers/{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)},getCreditCard:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')}
|
||||
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"')}
|
||||
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"')}
|
||||
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"')}
|
||||
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"')}
|
||||
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';let payload={};if(search){payload.search=search}
|
||||
if(limit){payload.limit=limit}
|
||||
if(offset){payload.offset=offset}
|
||||
if(orderType){payload.orderType=orderType}
|
||||
return http.get(path,{'content-type':'application/json'},payload)},createCollection:function(name,read=[],write=[],rules=[]){if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
let path='/database';let payload={};if(name){payload.name=name}
|
||||
if(read){payload.read=read}
|
||||
if(write){payload.write=write}
|
||||
if(rules){payload.rules=rules}
|
||||
return http.post(path,{'content-type':'application/json'},payload)},getCollection:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
|
||||
let path='/database/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};return http.get(path,{'content-type':'application/json'},payload)},updateCollection:function(collectionId,name,read=[],write=[],rules=[]){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
let path='/database/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);return http.put(path,{'content-type':'application/json'},{'name':name,'read':read,'write':write,'rules':rules})},deleteCollection:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
|
||||
let path='/database/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);return http.delete(path,{'content-type':'application/json'},{})},listDocuments:function(collectionId,filters=[],offset=0,limit=50,orderField='$uid',orderType='ASC',orderCast='string',search='',first=0,last=0){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
|
||||
let path='/database/{collectionId}/documents'.replace(new RegExp('{collectionId}','g'),collectionId);return http.get(path,{'content-type':'application/json'},{'filters':filters,'offset':offset,'limit':limit,'order-field':orderField,'order-type':orderType,'order-cast':orderCast,'search':search,'first':first,'last':last})},createDocument:function(collectionId,data,read=[],write=[],parentDocument='',parentProperty='',parentPropertyType='assign'){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
|
||||
let path='/database/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};if(name){payload.name=name}
|
||||
if(read){payload.read=read}
|
||||
if(write){payload.write=write}
|
||||
if(rules){payload.rules=rules}
|
||||
return http.put(path,{'content-type':'application/json'},payload)},deleteCollection:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
|
||||
let path='/database/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};return http.delete(path,{'content-type':'application/json'},payload)},listDocuments:function(collectionId,filters=[],offset=0,limit=50,orderField='$uid',orderType='ASC',orderCast='string',search='',first=0,last=0){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
|
||||
let path='/database/{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}
|
||||
if(orderField){payload['order-field']=orderField}
|
||||
if(orderType){payload['order-type']=orderType}
|
||||
if(orderCast){payload['order-cast']=orderCast}
|
||||
if(search){payload.search=search}
|
||||
if(first){payload.first=first}
|
||||
if(last){payload.last=last}
|
||||
return http.get(path,{'content-type':'application/json'},payload)},createDocument:function(collectionId,data,read=[],write=[],parentDocument='',parentProperty='',parentPropertyType='assign'){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
|
||||
if(data===undefined){throw new Error('Missing required parameter: "data"')}
|
||||
let path='/database/{collectionId}/documents'.replace(new RegExp('{collectionId}','g'),collectionId);return http.post(path,{'content-type':'application/json'},{'data':data,'read':read,'write':write,'parentDocument':parentDocument,'parentProperty':parentProperty,'parentPropertyType':parentPropertyType})},getDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
|
||||
let path='/database/{collectionId}/documents'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};if(data){payload.data=data}
|
||||
if(read){payload.read=read}
|
||||
if(write){payload.write=write}
|
||||
if(parentDocument){payload.parentDocument=parentDocument}
|
||||
if(parentProperty){payload.parentProperty=parentProperty}
|
||||
if(parentPropertyType){payload.parentPropertyType=parentPropertyType}
|
||||
return http.post(path,{'content-type':'application/json'},payload)},getDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
|
||||
if(documentId===undefined){throw new Error('Missing required parameter: "documentId"')}
|
||||
let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);return http.get(path,{'content-type':'application/json'},{})},updateDocument:function(collectionId,documentId,data,read=[],write=[]){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
|
||||
let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};return http.get(path,{'content-type':'application/json'},payload)},updateDocument:function(collectionId,documentId,data,read=[],write=[]){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
|
||||
if(documentId===undefined){throw new Error('Missing required parameter: "documentId"')}
|
||||
if(data===undefined){throw new Error('Missing required parameter: "data"')}
|
||||
let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);return http.patch(path,{'content-type':'application/json'},{'data':data,'read':read,'write':write})},deleteDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
|
||||
let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};if(data){payload.data=data}
|
||||
if(read){payload.read=read}
|
||||
if(write){payload.write=write}
|
||||
return http.patch(path,{'content-type':'application/json'},payload)},deleteDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
|
||||
if(documentId===undefined){throw new Error('Missing required parameter: "documentId"')}
|
||||
let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);return http.delete(path,{'content-type':'application/json'},{})}};let locale={getLocale:function(){let path='/locale';return http.get(path,{'content-type':'application/json'},{})},getCountries:function(){let path='/locale/countries';return http.get(path,{'content-type':'application/json'},{})},getCountriesEU:function(){let path='/locale/countries/eu';return http.get(path,{'content-type':'application/json'},{})},getCountriesPhones:function(){let path='/locale/countries/phones';return http.get(path,{'content-type':'application/json'},{})},getCurrencies:function(){let path='/locale/currencies';return http.get(path,{'content-type':'application/json'},{})}};let projects={listProjects:function(){let path='/projects';return http.get(path,{'content-type':'application/json'},{})},createProject:function(name,teamId,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};return http.delete(path,{'content-type':'application/json'},payload)}};let locale={getLocale:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json'},payload)},getCountries:function(){let path='/locale/countries';let payload={};return http.get(path,{'content-type':'application/json'},payload)},getCountriesEU:function(){let path='/locale/countries/eu';let payload={};return http.get(path,{'content-type':'application/json'},payload)},getCountriesPhones:function(){let path='/locale/countries/phones';let payload={};return http.get(path,{'content-type':'application/json'},payload)},getCurrencies:function(){let path='/locale/currencies';let payload={};return http.get(path,{'content-type':'application/json'},payload)}};let projects={listProjects:function(){let path='/projects';let payload={};return http.get(path,{'content-type':'application/json'},payload)},createProject:function(name,teamId,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/projects';return http.post(path,{'content-type':'application/json'},{'name':name,'teamId':teamId,'description':description,'logo':logo,'url':url,'legalName':legalName,'legalCountry':legalCountry,'legalState':legalState,'legalCity':legalCity,'legalAddress':legalAddress,'legalTaxId':legalTaxId})},getProject:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{})},updateProject:function(projectId,name,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects';let payload={};if(name){payload.name=name}
|
||||
if(teamId){payload.teamId=teamId}
|
||||
if(description){payload.description=description}
|
||||
if(logo){payload.logo=logo}
|
||||
if(url){payload.url=url}
|
||||
if(legalName){payload.legalName=legalName}
|
||||
if(legalCountry){payload.legalCountry=legalCountry}
|
||||
if(legalState){payload.legalState=legalState}
|
||||
if(legalCity){payload.legalCity=legalCity}
|
||||
if(legalAddress){payload.legalAddress=legalAddress}
|
||||
if(legalTaxId){payload.legalTaxId=legalTaxId}
|
||||
return http.post(path,{'content-type':'application/json'},payload)},getProject:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json'},payload)},updateProject:function(projectId,name,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);return http.patch(path,{'content-type':'application/json'},{'name':name,'description':description,'logo':logo,'url':url,'legalName':legalName,'legalCountry':legalCountry,'legalState':legalState,'legalCity':legalCity,'legalAddress':legalAddress,'legalTaxId':legalTaxId})},deleteProject:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);return http.delete(path,{'content-type':'application/json'},{})},listKeys:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/keys'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{})},createKey:function(projectId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload.name=name}
|
||||
if(description){payload.description=description}
|
||||
if(logo){payload.logo=logo}
|
||||
if(url){payload.url=url}
|
||||
if(legalName){payload.legalName=legalName}
|
||||
if(legalCountry){payload.legalCountry=legalCountry}
|
||||
if(legalState){payload.legalState=legalState}
|
||||
if(legalCity){payload.legalCity=legalCity}
|
||||
if(legalAddress){payload.legalAddress=legalAddress}
|
||||
if(legalTaxId){payload.legalTaxId=legalTaxId}
|
||||
return http.patch(path,{'content-type':'application/json'},payload)},deleteProject:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.delete(path,{'content-type':'application/json'},payload)},listKeys:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/keys'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json'},payload)},createKey:function(projectId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
if(scopes===undefined){throw new Error('Missing required parameter: "scopes"')}
|
||||
let path='/projects/{projectId}/keys'.replace(new RegExp('{projectId}','g'),projectId);return http.post(path,{'content-type':'application/json'},{'name':name,'scopes':scopes})},getKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/keys'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload.name=name}
|
||||
if(scopes){payload.scopes=scopes}
|
||||
return http.post(path,{'content-type':'application/json'},payload)},getKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
if(keyId===undefined){throw new Error('Missing required parameter: "keyId"')}
|
||||
let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);return http.get(path,{'content-type':'application/json'},{})},updateKey:function(projectId,keyId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};return http.get(path,{'content-type':'application/json'},payload)},updateKey:function(projectId,keyId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
if(keyId===undefined){throw new Error('Missing required parameter: "keyId"')}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
if(scopes===undefined){throw new Error('Missing required parameter: "scopes"')}
|
||||
let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);return http.put(path,{'content-type':'application/json'},{'name':name,'scopes':scopes})},deleteKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};if(name){payload.name=name}
|
||||
if(scopes){payload.scopes=scopes}
|
||||
return http.put(path,{'content-type':'application/json'},payload)},deleteKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
if(keyId===undefined){throw new Error('Missing required parameter: "keyId"')}
|
||||
let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);return http.delete(path,{'content-type':'application/json'},{})},updateProjectOAuth:function(projectId,provider,appId='',secret=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};return http.delete(path,{'content-type':'application/json'},payload)},updateProjectOAuth:function(projectId,provider,appId='',secret=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
if(provider===undefined){throw new Error('Missing required parameter: "provider"')}
|
||||
let path='/projects/{projectId}/oauth'.replace(new RegExp('{projectId}','g'),projectId);return http.patch(path,{'content-type':'application/json'},{'provider':provider,'appId':appId,'secret':secret})},listPlatforms:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/platforms'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{})},createPlatform:function(projectId,type,name,key='',store='',url=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/oauth'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(provider){payload.provider=provider}
|
||||
if(appId){payload.appId=appId}
|
||||
if(secret){payload.secret=secret}
|
||||
return http.patch(path,{'content-type':'application/json'},payload)},listPlatforms:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/platforms'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json'},payload)},createPlatform:function(projectId,type,name,key='',store='',url=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
if(type===undefined){throw new Error('Missing required parameter: "type"')}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
let path='/projects/{projectId}/platforms'.replace(new RegExp('{projectId}','g'),projectId);return http.post(path,{'content-type':'application/json'},{'type':type,'name':name,'key':key,'store':store,'url':url})},getPlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/platforms'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(type){payload.type=type}
|
||||
if(name){payload.name=name}
|
||||
if(key){payload.key=key}
|
||||
if(store){payload.store=store}
|
||||
if(url){payload.url=url}
|
||||
return http.post(path,{'content-type':'application/json'},payload)},getPlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
if(platformId===undefined){throw new Error('Missing required parameter: "platformId"')}
|
||||
let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);return http.get(path,{'content-type':'application/json'},{})},updatePlatform:function(projectId,platformId,name,key='',store='',url=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};return http.get(path,{'content-type':'application/json'},payload)},updatePlatform:function(projectId,platformId,name,key='',store='',url=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
if(platformId===undefined){throw new Error('Missing required parameter: "platformId"')}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);return http.put(path,{'content-type':'application/json'},{'name':name,'key':key,'store':store,'url':url})},deletePlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};if(name){payload.name=name}
|
||||
if(key){payload.key=key}
|
||||
if(store){payload.store=store}
|
||||
if(url){payload.url=url}
|
||||
return http.put(path,{'content-type':'application/json'},payload)},deletePlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
if(platformId===undefined){throw new Error('Missing required parameter: "platformId"')}
|
||||
let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);return http.delete(path,{'content-type':'application/json'},{})},listTasks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/tasks'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{})},createTask:function(projectId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};return http.delete(path,{'content-type':'application/json'},payload)},listTasks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/tasks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json'},payload)},createTask:function(projectId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
if(status===undefined){throw new Error('Missing required parameter: "status"')}
|
||||
if(schedule===undefined){throw new Error('Missing required parameter: "schedule"')}
|
||||
if(security===undefined){throw new Error('Missing required parameter: "security"')}
|
||||
if(httpMethod===undefined){throw new Error('Missing required parameter: "httpMethod"')}
|
||||
if(httpUrl===undefined){throw new Error('Missing required parameter: "httpUrl"')}
|
||||
let path='/projects/{projectId}/tasks'.replace(new RegExp('{projectId}','g'),projectId);return http.post(path,{'content-type':'application/json'},{'name':name,'status':status,'schedule':schedule,'security':security,'httpMethod':httpMethod,'httpUrl':httpUrl,'httpHeaders':httpHeaders,'httpUser':httpUser,'httpPass':httpPass})},getTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/tasks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload.name=name}
|
||||
if(status){payload.status=status}
|
||||
if(schedule){payload.schedule=schedule}
|
||||
if(security){payload.security=security}
|
||||
if(httpMethod){payload.httpMethod=httpMethod}
|
||||
if(httpUrl){payload.httpUrl=httpUrl}
|
||||
if(httpHeaders){payload.httpHeaders=httpHeaders}
|
||||
if(httpUser){payload.httpUser=httpUser}
|
||||
if(httpPass){payload.httpPass=httpPass}
|
||||
return http.post(path,{'content-type':'application/json'},payload)},getTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
if(taskId===undefined){throw new Error('Missing required parameter: "taskId"')}
|
||||
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);return http.get(path,{'content-type':'application/json'},{})},updateTask:function(projectId,taskId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};return http.get(path,{'content-type':'application/json'},payload)},updateTask:function(projectId,taskId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
if(taskId===undefined){throw new Error('Missing required parameter: "taskId"')}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
if(status===undefined){throw new Error('Missing required parameter: "status"')}
|
||||
|
@ -105,60 +225,126 @@ if(schedule===undefined){throw new Error('Missing required parameter: "schedule"
|
|||
if(security===undefined){throw new Error('Missing required parameter: "security"')}
|
||||
if(httpMethod===undefined){throw new Error('Missing required parameter: "httpMethod"')}
|
||||
if(httpUrl===undefined){throw new Error('Missing required parameter: "httpUrl"')}
|
||||
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);return http.put(path,{'content-type':'application/json'},{'name':name,'status':status,'schedule':schedule,'security':security,'httpMethod':httpMethod,'httpUrl':httpUrl,'httpHeaders':httpHeaders,'httpUser':httpUser,'httpPass':httpPass})},deleteTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};if(name){payload.name=name}
|
||||
if(status){payload.status=status}
|
||||
if(schedule){payload.schedule=schedule}
|
||||
if(security){payload.security=security}
|
||||
if(httpMethod){payload.httpMethod=httpMethod}
|
||||
if(httpUrl){payload.httpUrl=httpUrl}
|
||||
if(httpHeaders){payload.httpHeaders=httpHeaders}
|
||||
if(httpUser){payload.httpUser=httpUser}
|
||||
if(httpPass){payload.httpPass=httpPass}
|
||||
return http.put(path,{'content-type':'application/json'},payload)},deleteTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
if(taskId===undefined){throw new Error('Missing required parameter: "taskId"')}
|
||||
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);return http.delete(path,{'content-type':'application/json'},{})},getProjectUsage:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/usage'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{})},listWebhooks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{})},createWebhook:function(projectId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};return http.delete(path,{'content-type':'application/json'},payload)},getProjectUsage:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/usage'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json'},payload)},listWebhooks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json'},payload)},createWebhook:function(projectId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
if(events===undefined){throw new Error('Missing required parameter: "events"')}
|
||||
if(url===undefined){throw new Error('Missing required parameter: "url"')}
|
||||
if(security===undefined){throw new Error('Missing required parameter: "security"')}
|
||||
let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);return http.post(path,{'content-type':'application/json'},{'name':name,'events':events,'url':url,'security':security,'httpUser':httpUser,'httpPass':httpPass})},getWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload.name=name}
|
||||
if(events){payload.events=events}
|
||||
if(url){payload.url=url}
|
||||
if(security){payload.security=security}
|
||||
if(httpUser){payload.httpUser=httpUser}
|
||||
if(httpPass){payload.httpPass=httpPass}
|
||||
return http.post(path,{'content-type':'application/json'},payload)},getWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"')}
|
||||
let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);return http.get(path,{'content-type':'application/json'},{})},updateWebhook:function(projectId,webhookId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};return http.get(path,{'content-type':'application/json'},payload)},updateWebhook:function(projectId,webhookId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"')}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
if(events===undefined){throw new Error('Missing required parameter: "events"')}
|
||||
if(url===undefined){throw new Error('Missing required parameter: "url"')}
|
||||
if(security===undefined){throw new Error('Missing required parameter: "security"')}
|
||||
let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);return http.put(path,{'content-type':'application/json'},{'name':name,'events':events,'url':url,'security':security,'httpUser':httpUser,'httpPass':httpPass})},deleteWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};if(name){payload.name=name}
|
||||
if(events){payload.events=events}
|
||||
if(url){payload.url=url}
|
||||
if(security){payload.security=security}
|
||||
if(httpUser){payload.httpUser=httpUser}
|
||||
if(httpPass){payload.httpPass=httpPass}
|
||||
return http.put(path,{'content-type':'application/json'},payload)},deleteWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
||||
if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"')}
|
||||
let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);return http.delete(path,{'content-type':'application/json'},{})}};let storage={listFiles:function(search='',limit=25,offset=0,orderType='ASC'){let path='/storage/files';return http.get(path,{'content-type':'application/json'},{'search':search,'limit':limit,'offset':offset,'orderType':orderType})},createFile:function(files,read=[],write=[],folderId=''){if(files===undefined){throw new Error('Missing required parameter: "files"')}
|
||||
let path='/storage/files';return http.post(path,{'content-type':'multipart/form-data'},{'files':files,'read':read,'write':write,'folderId':folderId})},getFile:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')}
|
||||
let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);return http.get(path,{'content-type':'application/json'},{})},updateFile:function(fileId,read=[],write=[],folderId=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')}
|
||||
let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);return http.put(path,{'content-type':'application/json'},{'read':read,'write':write,'folderId':folderId})},deleteFile:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')}
|
||||
let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);return http.delete(path,{'content-type':'application/json'},{})},getFileDownload:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')}
|
||||
let path='/storage/files/{fileId}/download'.replace(new RegExp('{fileId}','g'),fileId);return http.get(path,{'content-type':'application/json'},{})},getFilePreview:function(fileId,width=0,height=0,quality=100,background='',output=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')}
|
||||
let path='/storage/files/{fileId}/preview'.replace(new RegExp('{fileId}','g'),fileId);return http.get(path,{'content-type':'application/json'},{'width':width,'height':height,'quality':quality,'background':background,'output':output})},getFileView:function(fileId,as=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')}
|
||||
let path='/storage/files/{fileId}/view'.replace(new RegExp('{fileId}','g'),fileId);return http.get(path,{'content-type':'application/json'},{'as':as})}};let teams={listTeams:function(search='',limit=25,offset=0,orderType='ASC'){let path='/teams';return http.get(path,{'content-type':'application/json'},{'search':search,'limit':limit,'offset':offset,'orderType':orderType})},createTeam:function(name,roles=["owner"]){if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
let path='/teams';return http.post(path,{'content-type':'application/json'},{'name':name,'roles':roles})},getTeam:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);return http.get(path,{'content-type':'application/json'},{})},updateTeam:function(teamId,name){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};return http.delete(path,{'content-type':'application/json'},payload)}};let storage={listFiles:function(search='',limit=25,offset=0,orderType='ASC'){let path='/storage/files';let payload={};if(search){payload.search=search}
|
||||
if(limit){payload.limit=limit}
|
||||
if(offset){payload.offset=offset}
|
||||
if(orderType){payload.orderType=orderType}
|
||||
return http.get(path,{'content-type':'application/json'},payload)},createFile:function(files,read=[],write=[],folderId=''){if(files===undefined){throw new Error('Missing required parameter: "files"')}
|
||||
let path='/storage/files';let payload={};if(files){payload.files=files}
|
||||
if(read){payload.read=read}
|
||||
if(write){payload.write=write}
|
||||
if(folderId){payload.folderId=folderId}
|
||||
return http.post(path,{'content-type':'multipart/form-data'},payload)},getFile:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')}
|
||||
let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);let payload={};return http.get(path,{'content-type':'application/json'},payload)},updateFile:function(fileId,read=[],write=[],folderId=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')}
|
||||
let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);let payload={};if(read){payload.read=read}
|
||||
if(write){payload.write=write}
|
||||
if(folderId){payload.folderId=folderId}
|
||||
return http.put(path,{'content-type':'application/json'},payload)},deleteFile:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')}
|
||||
let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);let payload={};return http.delete(path,{'content-type':'application/json'},payload)},getFileDownload:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')}
|
||||
let path='/storage/files/{fileId}/download'.replace(new RegExp('{fileId}','g'),fileId);let payload={};return http.get(path,{'content-type':'application/json'},payload)},getFilePreview:function(fileId,width=0,height=0,quality=100,background='',output=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')}
|
||||
let path='/storage/files/{fileId}/preview'.replace(new RegExp('{fileId}','g'),fileId);let payload={};if(width){payload.width=width}
|
||||
if(height){payload.height=height}
|
||||
if(quality){payload.quality=quality}
|
||||
if(background){payload.background=background}
|
||||
if(output){payload.output=output}
|
||||
return http.get(path,{'content-type':'application/json'},payload)},getFileView:function(fileId,as=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')}
|
||||
let path='/storage/files/{fileId}/view'.replace(new RegExp('{fileId}','g'),fileId);let payload={};if(as){payload.as=as}
|
||||
return http.get(path,{'content-type':'application/json'},payload)}};let teams={listTeams:function(search='',limit=25,offset=0,orderType='ASC'){let path='/teams';let payload={};if(search){payload.search=search}
|
||||
if(limit){payload.limit=limit}
|
||||
if(offset){payload.offset=offset}
|
||||
if(orderType){payload.orderType=orderType}
|
||||
return http.get(path,{'content-type':'application/json'},payload)},createTeam:function(name,roles=["owner"]){if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
let path='/teams';let payload={};if(name){payload.name=name}
|
||||
if(roles){payload.roles=roles}
|
||||
return http.post(path,{'content-type':'application/json'},payload)},getTeam:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json'},payload)},updateTeam:function(teamId,name){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);return http.put(path,{'content-type':'application/json'},{'name':name})},deleteTeam:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);return http.delete(path,{'content-type':'application/json'},{})},getTeamMembers:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/teams/{teamId}/members'.replace(new RegExp('{teamId}','g'),teamId);return http.get(path,{'content-type':'application/json'},{})},createTeamMembership:function(teamId,email,roles,redirect,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(name){payload.name=name}
|
||||
return http.put(path,{'content-type':'application/json'},payload)},deleteTeam:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.delete(path,{'content-type':'application/json'},payload)},getTeamMembers:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/teams/{teamId}/members'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json'},payload)},createTeamMembership:function(teamId,email,roles,redirect,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
if(email===undefined){throw new Error('Missing required parameter: "email"')}
|
||||
if(roles===undefined){throw new Error('Missing required parameter: "roles"')}
|
||||
if(redirect===undefined){throw new Error('Missing required parameter: "redirect"')}
|
||||
let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);return http.post(path,{'content-type':'application/json'},{'email':email,'name':name,'roles':roles,'redirect':redirect})},deleteTeamMembership:function(teamId,inviteId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(email){payload.email=email}
|
||||
if(name){payload.name=name}
|
||||
if(roles){payload.roles=roles}
|
||||
if(redirect){payload.redirect=redirect}
|
||||
return http.post(path,{'content-type':'application/json'},payload)},deleteTeamMembership:function(teamId,inviteId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
if(inviteId===undefined){throw new Error('Missing required parameter: "inviteId"')}
|
||||
let path='/teams/{teamId}/memberships/{inviteId}'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);return http.delete(path,{'content-type':'application/json'},{})},createTeamMembershipResend:function(teamId,inviteId,redirect){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/teams/{teamId}/memberships/{inviteId}'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);let payload={};return http.delete(path,{'content-type':'application/json'},payload)},createTeamMembershipResend:function(teamId,inviteId,redirect){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
if(inviteId===undefined){throw new Error('Missing required parameter: "inviteId"')}
|
||||
if(redirect===undefined){throw new Error('Missing required parameter: "redirect"')}
|
||||
let path='/teams/{teamId}/memberships/{inviteId}/resend'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);return http.post(path,{'content-type':'application/json'},{'redirect':redirect})},updateTeamMembershipStatus:function(teamId,inviteId,userId,secret,success='',failure=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/teams/{teamId}/memberships/{inviteId}/resend'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);let payload={};if(redirect){payload.redirect=redirect}
|
||||
return http.post(path,{'content-type':'application/json'},payload)},updateTeamMembershipStatus:function(teamId,inviteId,userId,secret,success='',failure=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
if(inviteId===undefined){throw new Error('Missing required parameter: "inviteId"')}
|
||||
if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
if(secret===undefined){throw new Error('Missing required parameter: "secret"')}
|
||||
let path='/teams/{teamId}/memberships/{inviteId}/status'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);return iframe('patch',path,{project:config.project,'userId':userId,'secret':secret,'success':success,'failure':failure})}};let users={listUsers:function(search='',limit=25,offset=0,orderType='ASC'){let path='/users';return http.get(path,{'content-type':'application/json'},{'search':search,'limit':limit,'offset':offset,'orderType':orderType})},createUser:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"')}
|
||||
let path='/teams/{teamId}/memberships/{inviteId}/status'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);let payload={};if(userId){payload.userId=userId}
|
||||
if(secret){payload.secret=secret}
|
||||
if(success){payload.success=success}
|
||||
if(failure){payload.failure=failure}
|
||||
payload.project=config.project;return iframe('patch',path,payload)}};let users={listUsers:function(search='',limit=25,offset=0,orderType='ASC'){let path='/users';let payload={};if(search){payload.search=search}
|
||||
if(limit){payload.limit=limit}
|
||||
if(offset){payload.offset=offset}
|
||||
if(orderType){payload.orderType=orderType}
|
||||
return http.get(path,{'content-type':'application/json'},payload)},createUser:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"')}
|
||||
if(password===undefined){throw new Error('Missing required parameter: "password"')}
|
||||
let path='/users';return http.post(path,{'content-type':'application/json'},{'email':email,'password':password,'name':name})},getUser:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
let path='/users/{userId}'.replace(new RegExp('{userId}','g'),userId);return http.get(path,{'content-type':'application/json'},{})},getUserLogs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
let path='/users/{userId}/logs'.replace(new RegExp('{userId}','g'),userId);return http.get(path,{'content-type':'application/json'},{})},getUserPrefs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
let path='/users/{userId}/prefs'.replace(new RegExp('{userId}','g'),userId);return http.get(path,{'content-type':'application/json'},{})},getUserSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);return http.get(path,{'content-type':'application/json'},{})},deleteUserSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);return http.delete(path,{'content-type':'application/json'},{})},deleteUsersSession:function(userId,sessionId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
let path='/users';let payload={};if(email){payload.email=email}
|
||||
if(password){payload.password=password}
|
||||
if(name){payload.name=name}
|
||||
return http.post(path,{'content-type':'application/json'},payload)},getUser:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
let path='/users/{userId}'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json'},payload)},getUserLogs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
let path='/users/{userId}/logs'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json'},payload)},getUserPrefs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
let path='/users/{userId}/prefs'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json'},payload)},updateUserPrefs:function(userId,prefs){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
if(prefs===undefined){throw new Error('Missing required parameter: "prefs"')}
|
||||
let path='/users/{userId}/prefs'.replace(new RegExp('{userId}','g'),userId);let payload={};if(prefs){payload.prefs=prefs}
|
||||
return http.patch(path,{'content-type':'application/json'},payload)},getUserSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json'},payload)},deleteUserSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.delete(path,{'content-type':'application/json'},payload)},deleteUserSession:function(userId,sessionId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
if(sessionId===undefined){throw new Error('Missing required parameter: "sessionId"')}
|
||||
let path='/users/{userId}/sessions/:session'.replace(new RegExp('{userId}','g'),userId);return http.delete(path,{'content-type':'application/json'},{'sessionId':sessionId})},updateUserStatus:function(userId,status){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
let path='/users/{userId}/sessions/:session'.replace(new RegExp('{userId}','g'),userId);let payload={};if(sessionId){payload.sessionId=sessionId}
|
||||
return http.delete(path,{'content-type':'application/json'},payload)},updateUserStatus:function(userId,status){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
if(status===undefined){throw new Error('Missing required parameter: "status"')}
|
||||
let path='/users/{userId}/status'.replace(new RegExp('{userId}','g'),userId);return http.patch(path,{'content-type':'application/json'},{'status':status})}};return{setEndpoint:setEndpoint,setProject:setProject,setKey:setKey,setLocale:setLocale,setMode:setMode,account:account,auth:auth,avatars:avatars,database:database,locale:locale,projects:projects,storage:storage,teams:teams,users:users}}})(window)
|
||||
let path='/users/{userId}/status'.replace(new RegExp('{userId}','g'),userId);let payload={};if(status){payload.status=status}
|
||||
return http.patch(path,{'content-type':'application/json'},payload)}};return{setEndpoint:setEndpoint,setProject:setProject,setKey:setKey,setLocale:setLocale,setMode:setMode,account:account,auth:auth,avatars:avatars,database:database,locale:locale,projects:projects,storage:storage,teams:teams,users:users}};if(typeof module!=="undefined"){module.exports=window.Appwrite}})((typeof window!=="undefined")?window:{})
|
|
@ -1,7 +1,7 @@
|
|||
# Appwrite SDK for NodeJS
|
||||
|
||||
![License](https://img.shields.io/github/license/appwrite/sdk-for-node.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-latest-blue.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-0.2.0-blue.svg?v=1)
|
||||
|
||||
**This SDK is compatible with Appwrite server version 0.2.0. For older versions, please check previous releases.**
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ client
|
|||
.setKey('')
|
||||
;
|
||||
|
||||
let promise = projects.createTask('[PROJECT_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com');
|
||||
let promise = projects.createTask('[PROJECT_ID]', '[NAME]', 'play', '', 1, 'GET', 'https://example.com');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response);
|
||||
|
|
|
@ -10,7 +10,7 @@ client
|
|||
.setKey('')
|
||||
;
|
||||
|
||||
let promise = projects.updateTask('[PROJECT_ID]', '[TASK_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com');
|
||||
let promise = projects.updateTask('[PROJECT_ID]', '[TASK_ID]', '[NAME]', 'play', '', 1, 'GET', 'https://example.com');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response);
|
||||
|
|
|
@ -10,7 +10,7 @@ client
|
|||
.setKey('')
|
||||
;
|
||||
|
||||
let promise = projects.updateWebhook('[PROJECT_ID]', '[WEBHOOK_ID]', '[NAME]', [], '[URL]', 0);
|
||||
let promise = projects.updateWebhook('[PROJECT_ID]', '[WEBHOOK_ID]', '[NAME]', [], '[URL]', 1);
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response);
|
||||
|
|
19
app/sdks/node/docs/examples/users/delete-user-session.md
Normal file
19
app/sdks/node/docs/examples/users/delete-user-session.md
Normal file
|
@ -0,0 +1,19 @@
|
|||
const sdk = require('node-appwrite');
|
||||
|
||||
// Init SDK
|
||||
let client = new sdk.Client();
|
||||
|
||||
let users = new sdk.Users(client);
|
||||
|
||||
client
|
||||
.setProject('')
|
||||
.setKey('')
|
||||
;
|
||||
|
||||
let promise = users.deleteUserSession('[USER_ID]', '[SESSION_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response);
|
||||
}, function (error) {
|
||||
console.log(error);
|
||||
});
|
19
app/sdks/node/docs/examples/users/update-user-prefs.md
Normal file
19
app/sdks/node/docs/examples/users/update-user-prefs.md
Normal file
|
@ -0,0 +1,19 @@
|
|||
const sdk = require('node-appwrite');
|
||||
|
||||
// Init SDK
|
||||
let client = new sdk.Client();
|
||||
|
||||
let users = new sdk.Users(client);
|
||||
|
||||
client
|
||||
.setProject('')
|
||||
.setKey('')
|
||||
;
|
||||
|
||||
let promise = users.updateUserPrefs('[USER_ID]', '{}');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response);
|
||||
}, function (error) {
|
||||
console.log(error);
|
||||
});
|
|
@ -4,7 +4,7 @@ const request = require('request-promise-native');
|
|||
class Client {
|
||||
|
||||
constructor() {
|
||||
this.endpoint = 'https://https://appwrite.io/v1';
|
||||
this.endpoint = 'https://appwrite.io/v1';
|
||||
this.headers = {
|
||||
'content-type': '',
|
||||
'x-sdk-version': 'appwrite:nodejs:1.0.26',
|
||||
|
|
|
@ -5,7 +5,7 @@ class Account extends Service {
|
|||
/**
|
||||
* Get Account
|
||||
*
|
||||
* Get currently logged in user data as JSON object.
|
||||
* /docs/references/account/get.md
|
||||
*
|
||||
* @throws Exception
|
||||
* @return {}
|
||||
|
@ -21,7 +21,7 @@ class Account extends Service {
|
|||
/**
|
||||
* Delete Account
|
||||
*
|
||||
* Delete currently logged in user account.
|
||||
* /docs/references/account/delete.md
|
||||
*
|
||||
* @throws Exception
|
||||
* @return {}
|
||||
|
@ -37,10 +37,7 @@ class Account extends Service {
|
|||
/**
|
||||
* Update Account Email
|
||||
*
|
||||
* Update currently logged in user account email address. After changing user
|
||||
* address, user confirmation status is being reset and a new confirmation
|
||||
* mail is sent. For security measures, user password is required to complete
|
||||
* this request.
|
||||
* /docs/references/account/update-email.md
|
||||
*
|
||||
* @param string email
|
||||
* @param string password
|
||||
|
@ -60,7 +57,7 @@ class Account extends Service {
|
|||
/**
|
||||
* Update Account Name
|
||||
*
|
||||
* Update currently logged in user account name.
|
||||
* /docs/references/account/update-name.md
|
||||
*
|
||||
* @param string name
|
||||
* @throws Exception
|
||||
|
@ -78,8 +75,7 @@ class Account extends Service {
|
|||
/**
|
||||
* Update Account Password
|
||||
*
|
||||
* Update currently logged in user password. For validation, user is required
|
||||
* to pass the password twice.
|
||||
* /docs/references/account/update-password.md
|
||||
*
|
||||
* @param string password
|
||||
* @param string oldPassword
|
||||
|
@ -99,7 +95,7 @@ class Account extends Service {
|
|||
/**
|
||||
* Get Account Preferences
|
||||
*
|
||||
* Get currently logged in user preferences key-value object.
|
||||
* /docs/references/account/get-prefs.md
|
||||
*
|
||||
* @throws Exception
|
||||
* @return {}
|
||||
|
@ -115,8 +111,7 @@ class Account extends Service {
|
|||
/**
|
||||
* Update Account Prefs
|
||||
*
|
||||
* Update currently logged in user account preferences. You can pass only the
|
||||
* specific settings you wish to update.
|
||||
* /docs/references/account/update-prefs.md
|
||||
*
|
||||
* @param string prefs
|
||||
* @throws Exception
|
||||
|
@ -134,8 +129,7 @@ class Account extends Service {
|
|||
/**
|
||||
* Get Account Security Log
|
||||
*
|
||||
* Get currently logged in user list of latest security activity logs. Each
|
||||
* log returns user IP address, location and date and time of log.
|
||||
* /docs/references/account/get-security.md
|
||||
*
|
||||
* @throws Exception
|
||||
* @return {}
|
||||
|
@ -151,8 +145,7 @@ class Account extends Service {
|
|||
/**
|
||||
* Get Account Active Sessions
|
||||
*
|
||||
* Get currently logged in user list of active sessions across different
|
||||
* devices.
|
||||
* /docs/references/account/get-sessions.md
|
||||
*
|
||||
* @throws Exception
|
||||
* @return {}
|
||||
|
|
|
@ -5,20 +5,7 @@ class Auth extends Service {
|
|||
/**
|
||||
* Login User
|
||||
*
|
||||
* Allow the user to login into his account by providing a valid email and
|
||||
* password combination. Use the success and failure arguments to provide a
|
||||
* redirect URL\'s back to your app when login is completed.
|
||||
*
|
||||
* Please notice that in order to avoid a [Redirect
|
||||
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
* the only valid redirect URL's are the once from domains you have set when
|
||||
* added your platforms in the console interface.
|
||||
*
|
||||
* When accessing this route using JavaScript from the browser, success and
|
||||
* failure parameter URLs are required. Appwrite server will respond with a
|
||||
* 301 redirect status code and will set the user session cookie. This
|
||||
* behavior is enforced because modern browsers are limiting 3rd party cookies
|
||||
* in XHR of fetch requests to protect user privacy.
|
||||
* /docs/references/auth/login.md
|
||||
*
|
||||
* @param string email
|
||||
* @param string password
|
||||
|
@ -42,9 +29,7 @@ class Auth extends Service {
|
|||
/**
|
||||
* Logout Current Session
|
||||
*
|
||||
* Use this endpoint to log out the currently logged in user from his account.
|
||||
* When succeed this endpoint will delete the user session and remove the
|
||||
* session secret cookie from the user client.
|
||||
* /docs/references/auth/logout.md
|
||||
*
|
||||
* @throws Exception
|
||||
* @return {}
|
||||
|
@ -60,9 +45,7 @@ class Auth extends Service {
|
|||
/**
|
||||
* Logout Specific Session
|
||||
*
|
||||
* Use this endpoint to log out the currently logged in user from all his
|
||||
* account sessions across all his different devices. When using the option id
|
||||
* argument, only the session unique ID provider will be deleted.
|
||||
* /docs/references/auth/logout-by-session.md
|
||||
*
|
||||
* @param string id
|
||||
* @throws Exception
|
||||
|
@ -98,12 +81,7 @@ class Auth extends Service {
|
|||
/**
|
||||
* Password Recovery
|
||||
*
|
||||
* Sends the user an email with a temporary secret token for password reset.
|
||||
* When the user clicks the confirmation link he is redirected back to your
|
||||
* app password reset redirect URL with a secret token and email address
|
||||
* values attached to the URL query string. Use the query string params to
|
||||
* submit a request to the /auth/password/reset endpoint to complete the
|
||||
* process.
|
||||
* /docs/references/auth/recovery.md
|
||||
*
|
||||
* @param string email
|
||||
* @param string reset
|
||||
|
@ -123,15 +101,7 @@ class Auth extends Service {
|
|||
/**
|
||||
* Password Reset
|
||||
*
|
||||
* Use this endpoint to complete the user account password reset. Both the
|
||||
* **userId** and **token** arguments will be passed as query parameters to
|
||||
* the redirect URL you have provided when sending your request to the
|
||||
* /auth/recovery endpoint.
|
||||
*
|
||||
* Please notice that in order to avoid a [Redirect
|
||||
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
* the only valid redirect URL's are the once from domains you have set when
|
||||
* added your platforms in the console interface.
|
||||
* /docs/references/auth/recovery-reset.md
|
||||
*
|
||||
* @param string userId
|
||||
* @param string token
|
||||
|
@ -155,26 +125,7 @@ class Auth extends Service {
|
|||
/**
|
||||
* Register User
|
||||
*
|
||||
* Use this endpoint to allow a new user to register an account in your
|
||||
* project. Use the success and failure URL's to redirect users back to your
|
||||
* application after signup completes.
|
||||
*
|
||||
* If registration completes successfully user will be sent with a
|
||||
* confirmation email in order to confirm he is the owner of the account email
|
||||
* address. Use the confirmation parameter to redirect the user from the
|
||||
* confirmation email back to your app. When the user is redirected, use the
|
||||
* /auth/confirm endpoint to complete the account confirmation.
|
||||
*
|
||||
* Please notice that in order to avoid a [Redirect
|
||||
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
* the only valid redirect URL's are the once from domains you have set when
|
||||
* added your platforms in the console interface.
|
||||
*
|
||||
* When accessing this route using JavaScript from the browser, success and
|
||||
* failure parameter URLs are required. Appwrite server will respond with a
|
||||
* 301 redirect status code and will set the user session cookie. This
|
||||
* behavior is enforced because modern browsers are limiting 3rd party cookies
|
||||
* in XHR of fetch requests to protect user privacy.
|
||||
* /docs/references/auth/register.md
|
||||
*
|
||||
* @param string email
|
||||
* @param string password
|
||||
|
@ -202,10 +153,7 @@ class Auth extends Service {
|
|||
/**
|
||||
* Confirm User
|
||||
*
|
||||
* Use this endpoint to complete the confirmation of the user account email
|
||||
* address. Both the **userId** and **token** arguments will be passed as
|
||||
* query parameters to the redirect URL you have provided when sending your
|
||||
* request to the /auth/register endpoint.
|
||||
* /docs/references/auth/confirm.md
|
||||
*
|
||||
* @param string userId
|
||||
* @param string token
|
||||
|
@ -225,14 +173,7 @@ class Auth extends Service {
|
|||
/**
|
||||
* Resend Confirmation
|
||||
*
|
||||
* This endpoint allows the user to request your app to resend him his email
|
||||
* confirmation message. The redirect arguments acts the same way as in
|
||||
* /auth/register endpoint.
|
||||
*
|
||||
* Please notice that in order to avoid a [Redirect
|
||||
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
* the only valid redirect URL's are the once from domains you have set when
|
||||
* added your platforms in the console interface.
|
||||
* /docs/references/auth/confirm-resend.md
|
||||
*
|
||||
* @param string confirm
|
||||
* @throws Exception
|
||||
|
|
|
@ -5,10 +5,7 @@ class Avatars extends Service {
|
|||
/**
|
||||
* Get Browser Icon
|
||||
*
|
||||
* You can use this endpoint to show different browser icons to your users,
|
||||
* The code argument receives the browser code as appear in your user
|
||||
* /account/sessions endpoint. Use width, height and quality arguments to
|
||||
* change the output settings.
|
||||
* /docs/references/avatars/get-browser.md
|
||||
*
|
||||
* @param string code
|
||||
* @param number width
|
||||
|
@ -31,10 +28,7 @@ class Avatars extends Service {
|
|||
/**
|
||||
* Get Credit Card Icon
|
||||
*
|
||||
* Need to display your users with your billing method or there payment
|
||||
* methods? The credit card endpoint will return you the icon of the credit
|
||||
* card provider you need. Use width, height and quality arguments to change
|
||||
* the output settings.
|
||||
* /docs/references/avatars/get-credit-cards.md
|
||||
*
|
||||
* @param string code
|
||||
* @param number width
|
||||
|
@ -57,8 +51,7 @@ class Avatars extends Service {
|
|||
/**
|
||||
* Get Favicon
|
||||
*
|
||||
* Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote
|
||||
* website URL.
|
||||
* /docs/references/avatars/get-favicon.md
|
||||
*
|
||||
* @param string url
|
||||
* @throws Exception
|
||||
|
@ -76,9 +69,7 @@ class Avatars extends Service {
|
|||
/**
|
||||
* Get Country Flag
|
||||
*
|
||||
* You can use this endpoint to show different country flags icons to your
|
||||
* users, The code argument receives the a 2 letter country code. Use width,
|
||||
* height and quality arguments to change the output settings.
|
||||
* /docs/references/avatars/get-flag.md
|
||||
*
|
||||
* @param string code
|
||||
* @param number width
|
||||
|
@ -101,10 +92,7 @@ class Avatars extends Service {
|
|||
/**
|
||||
* Get Image from URL
|
||||
*
|
||||
* Use this endpoint to fetch a remote image URL and crop it to any image size
|
||||
* you want. This endpoint is very useful if you need to crop and display
|
||||
* remote images in your app or in cases, you want to make sure a 3rd party
|
||||
* image is properly served using a TLS protocol.
|
||||
* /docs/references/avatars/get-image.md
|
||||
*
|
||||
* @param string url
|
||||
* @param number width
|
||||
|
@ -126,8 +114,7 @@ class Avatars extends Service {
|
|||
/**
|
||||
* Text to QR Generator
|
||||
*
|
||||
* 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.
|
||||
* /docs/references/avatars/get-qr.md
|
||||
*
|
||||
* @param string text
|
||||
* @param number size
|
||||
|
|
|
@ -5,10 +5,7 @@ class Database extends Service {
|
|||
/**
|
||||
* List Collections
|
||||
*
|
||||
* 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).
|
||||
* /docs/references/database/list-collections.md
|
||||
*
|
||||
* @param string search
|
||||
* @param number limit
|
||||
|
@ -32,7 +29,7 @@ class Database extends Service {
|
|||
/**
|
||||
* Create Collection
|
||||
*
|
||||
* Create a new Collection.
|
||||
* /docs/references/database/create-collection.md
|
||||
*
|
||||
* @param string name
|
||||
* @param array read
|
||||
|
@ -56,8 +53,7 @@ class Database extends Service {
|
|||
/**
|
||||
* Get Collection
|
||||
*
|
||||
* Get collection by its unique ID. This endpoint response returns a JSON
|
||||
* object with the collection metadata.
|
||||
* /docs/references/database/get-collection.md
|
||||
*
|
||||
* @param string collectionId
|
||||
* @throws Exception
|
||||
|
@ -74,7 +70,7 @@ class Database extends Service {
|
|||
/**
|
||||
* Update Collection
|
||||
*
|
||||
* Update collection by its unique ID.
|
||||
* /docs/references/database/update-collection.md
|
||||
*
|
||||
* @param string collectionId
|
||||
* @param string name
|
||||
|
@ -99,8 +95,7 @@ class Database extends Service {
|
|||
/**
|
||||
* Delete Collection
|
||||
*
|
||||
* Delete a collection by its unique ID. Only users with write permissions
|
||||
* have access to delete this resource.
|
||||
* /docs/references/database/delete-collection.md
|
||||
*
|
||||
* @param string collectionId
|
||||
* @throws Exception
|
||||
|
@ -117,10 +112,7 @@ class Database extends Service {
|
|||
/**
|
||||
* List Documents
|
||||
*
|
||||
* 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).
|
||||
* /docs/references/database/list-documents.md
|
||||
*
|
||||
* @param string collectionId
|
||||
* @param array filters
|
||||
|
@ -155,7 +147,7 @@ class Database extends Service {
|
|||
/**
|
||||
* Create Document
|
||||
*
|
||||
* Create a new Document.
|
||||
* /docs/references/database/create-document.md
|
||||
*
|
||||
* @param string collectionId
|
||||
* @param string data
|
||||
|
@ -184,8 +176,7 @@ class Database extends Service {
|
|||
/**
|
||||
* Get Document
|
||||
*
|
||||
* Get document by its unique ID. This endpoint response returns a JSON object
|
||||
* with the document data.
|
||||
* /docs/references/database/get-document.md
|
||||
*
|
||||
* @param string collectionId
|
||||
* @param string documentId
|
||||
|
@ -203,6 +194,8 @@ class Database extends Service {
|
|||
/**
|
||||
* Update Document
|
||||
*
|
||||
* /docs/references/database/update-document.md
|
||||
*
|
||||
* @param string collectionId
|
||||
* @param string documentId
|
||||
* @param string data
|
||||
|
@ -225,9 +218,7 @@ class Database extends Service {
|
|||
/**
|
||||
* Delete Document
|
||||
*
|
||||
* Delete document by its unique ID. This endpoint deletes only the parent
|
||||
* documents, his attributes and relations to other documents. Child documents
|
||||
* **will not** be deleted.
|
||||
* /docs/references/database/delete-document.md
|
||||
*
|
||||
* @param string collectionId
|
||||
* @param string documentId
|
||||
|
|
|
@ -5,10 +5,7 @@ class Locale extends Service {
|
|||
/**
|
||||
* Get User Locale
|
||||
*
|
||||
* Get the current user location based on IP. Returns an object with user
|
||||
* country code, country name, continent name, continent code, ip address and
|
||||
* suggested currency. You can use the locale header to get the data in
|
||||
* supported language.
|
||||
* /docs/references/locale/get-locale.md
|
||||
*
|
||||
* @throws Exception
|
||||
* @return {}
|
||||
|
@ -24,8 +21,7 @@ class Locale extends Service {
|
|||
/**
|
||||
* List Countries
|
||||
*
|
||||
* List of all countries. You can use the locale header to get the data in
|
||||
* supported language.
|
||||
* /docs/references/locale/get-countires.md
|
||||
*
|
||||
* @throws Exception
|
||||
* @return {}
|
||||
|
@ -41,9 +37,7 @@ class Locale extends Service {
|
|||
/**
|
||||
* List EU Countries
|
||||
*
|
||||
* List of all countries that are currently members of the EU. You can use the
|
||||
* locale header to get the data in supported language. UK brexit date is
|
||||
* currently set to 2019-10-31 and will be updated if and when needed.
|
||||
* /docs/references/locale/get-countries-eu.md
|
||||
*
|
||||
* @throws Exception
|
||||
* @return {}
|
||||
|
@ -59,8 +53,7 @@ class Locale extends Service {
|
|||
/**
|
||||
* List Countries Phone Codes
|
||||
*
|
||||
* List of all countries phone codes. You can use the locale header to get the
|
||||
* data in supported language.
|
||||
* /docs/references/locale/get-countries-phones.md
|
||||
*
|
||||
* @throws Exception
|
||||
* @return {}
|
||||
|
@ -76,9 +69,7 @@ class Locale extends Service {
|
|||
/**
|
||||
* List of currencies
|
||||
*
|
||||
* List of all currencies, including currency symbol, name, plural, and
|
||||
* decimal digits for all major and minor currencies. You can use the locale
|
||||
* header to get the data in supported language.
|
||||
* /docs/references/locale/get-currencies.md
|
||||
*
|
||||
* @throws Exception
|
||||
* @return {}
|
||||
|
|
|
@ -5,9 +5,7 @@ class Storage extends Service {
|
|||
/**
|
||||
* List Files
|
||||
*
|
||||
* 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).
|
||||
* /docs/references/storage/list-files.md
|
||||
*
|
||||
* @param string search
|
||||
* @param number limit
|
||||
|
@ -31,9 +29,7 @@ class Storage extends Service {
|
|||
/**
|
||||
* Create File
|
||||
*
|
||||
* Create a new file. The user who creates the file will automatically be
|
||||
* assigned to read and write access unless he has passed custom values for
|
||||
* read and write arguments.
|
||||
* /docs/references/storage/create-file.md
|
||||
*
|
||||
* @param File files
|
||||
* @param array read
|
||||
|
@ -57,8 +53,7 @@ class Storage extends Service {
|
|||
/**
|
||||
* Get File
|
||||
*
|
||||
* Get file by its unique ID. This endpoint response returns a JSON object
|
||||
* with the file metadata.
|
||||
* /docs/references/storage/get-file.md
|
||||
*
|
||||
* @param string fileId
|
||||
* @throws Exception
|
||||
|
@ -75,8 +70,7 @@ class Storage extends Service {
|
|||
/**
|
||||
* Update File
|
||||
*
|
||||
* Update file by its unique ID. Only users with write permissions have access
|
||||
* to update this resource.
|
||||
* /docs/references/storage/update-file.md
|
||||
*
|
||||
* @param string fileId
|
||||
* @param array read
|
||||
|
@ -99,8 +93,7 @@ class Storage extends Service {
|
|||
/**
|
||||
* Delete File
|
||||
*
|
||||
* Delete a file by its unique ID. Only users with write permissions have
|
||||
* access to delete this resource.
|
||||
* /docs/references/storage/delete-file.md
|
||||
*
|
||||
* @param string fileId
|
||||
* @throws Exception
|
||||
|
@ -117,9 +110,7 @@ class Storage extends Service {
|
|||
/**
|
||||
* Get File for Download
|
||||
*
|
||||
* Get file content by its unique ID. The endpoint response return with a
|
||||
* 'Content-Disposition: attachment' header that tells the browser to start
|
||||
* downloading the file to user downloads directory.
|
||||
* /docs/references/storage/get-file-download.md
|
||||
*
|
||||
* @param string fileId
|
||||
* @throws Exception
|
||||
|
@ -136,10 +127,7 @@ class Storage extends Service {
|
|||
/**
|
||||
* Get File Preview
|
||||
*
|
||||
* Get file preview image. Currently, this method supports preview for image
|
||||
* files (jpg, png, and gif), other supported formats, like pdf, docs, slides,
|
||||
* and spreadsheets will return file icon image. You can also pass query
|
||||
* string arguments for cutting and resizing your preview image.
|
||||
* /docs/references/storage/get-file-preview.md
|
||||
*
|
||||
* @param string fileId
|
||||
* @param number width
|
||||
|
@ -166,8 +154,7 @@ class Storage extends Service {
|
|||
/**
|
||||
* Get File for View
|
||||
*
|
||||
* Get file content by its unique ID. This endpoint is similar to the download
|
||||
* method but returns with no 'Content-Disposition: attachment' header.
|
||||
* /docs/references/storage/get-file-view.md
|
||||
*
|
||||
* @param string fileId
|
||||
* @param string as
|
||||
|
|
|
@ -5,9 +5,7 @@ class Teams extends Service {
|
|||
/**
|
||||
* List Teams
|
||||
*
|
||||
* 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).
|
||||
* /docs/references/teams/list-teams.md
|
||||
*
|
||||
* @param string search
|
||||
* @param number limit
|
||||
|
@ -31,10 +29,7 @@ class Teams extends Service {
|
|||
/**
|
||||
* Create Team
|
||||
*
|
||||
* Create a new team. The user who creates the team will automatically be
|
||||
* assigned as the owner of the team. The team owner can invite new members,
|
||||
* who will be able add new owners and update or delete the team from your
|
||||
* project.
|
||||
* /docs/references/teams/create-team.md
|
||||
*
|
||||
* @param string name
|
||||
* @param array roles
|
||||
|
@ -54,8 +49,7 @@ class Teams extends Service {
|
|||
/**
|
||||
* Get Team
|
||||
*
|
||||
* Get team by its unique ID. All team members have read access for this
|
||||
* resource.
|
||||
* /docs/references/teams/get-team.md
|
||||
*
|
||||
* @param string teamId
|
||||
* @throws Exception
|
||||
|
@ -72,8 +66,7 @@ class Teams extends Service {
|
|||
/**
|
||||
* Update Team
|
||||
*
|
||||
* Update team by its unique ID. Only team owners have write access for this
|
||||
* resource.
|
||||
* /docs/references/teams/update-team.md
|
||||
*
|
||||
* @param string teamId
|
||||
* @param string name
|
||||
|
@ -92,8 +85,7 @@ class Teams extends Service {
|
|||
/**
|
||||
* Delete Team
|
||||
*
|
||||
* Delete team by its unique ID. Only team owners have write access for this
|
||||
* resource.
|
||||
* /docs/references/teams/delete-team.md
|
||||
*
|
||||
* @param string teamId
|
||||
* @throws Exception
|
||||
|
@ -110,8 +102,7 @@ class Teams extends Service {
|
|||
/**
|
||||
* Get Team Members
|
||||
*
|
||||
* Get team members by the team unique ID. All team members have read access
|
||||
* for this list of resources.
|
||||
* /docs/references/teams/get-team-members.md
|
||||
*
|
||||
* @param string teamId
|
||||
* @throws Exception
|
||||
|
@ -128,19 +119,7 @@ class Teams extends Service {
|
|||
/**
|
||||
* Create Team Membership
|
||||
*
|
||||
* Use this endpoint to invite a new member to your team. An email with a link
|
||||
* to join the team will be sent to the new member email address. If member
|
||||
* doesn't exists in the project it will be automatically created.
|
||||
*
|
||||
* Use the redirect parameter to redirect the user from the invitation email
|
||||
* back to your app. When the user is redirected, use the
|
||||
* /teams/{teamId}/memberships/{inviteId}/status endpoint to finally join the
|
||||
* user to the team.
|
||||
*
|
||||
* Please notice that in order to avoid a [Redirect
|
||||
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
* the only valid redirect URL's are the once from domains you have set when
|
||||
* added your platforms in the console interface.
|
||||
* /docs/references/teams/create-team-membership.md
|
||||
*
|
||||
* @param string teamId
|
||||
* @param string email
|
||||
|
@ -165,8 +144,7 @@ class Teams extends Service {
|
|||
/**
|
||||
* Delete Team Membership
|
||||
*
|
||||
* This endpoint allows a user to leave a team or for a team owner to delete
|
||||
* the membership of any other team member.
|
||||
* /docs/references/teams/delete-team-membership.md
|
||||
*
|
||||
* @param string teamId
|
||||
* @param string inviteId
|
||||
|
@ -184,8 +162,7 @@ class Teams extends Service {
|
|||
/**
|
||||
* Create Team Membership (Resend)
|
||||
*
|
||||
* Use this endpoint to resend your invitation email for a user to join a
|
||||
* team.
|
||||
* /docs/references/teams/create-team-membership-resend.md
|
||||
*
|
||||
* @param string teamId
|
||||
* @param string inviteId
|
||||
|
@ -205,21 +182,7 @@ class Teams extends Service {
|
|||
/**
|
||||
* Update Team Membership Status
|
||||
*
|
||||
* Use this endpoint to let user accept an invitation to join a team after he
|
||||
* is being redirect back to your app from the invitation email. Use the
|
||||
* success and failure URL's to redirect users back to your application after
|
||||
* the request completes.
|
||||
*
|
||||
* Please notice that in order to avoid a [Redirect
|
||||
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
* the only valid redirect URL's are the once from domains you have set when
|
||||
* added your platforms in the console interface.
|
||||
*
|
||||
* When not using the success or failure redirect arguments this endpoint will
|
||||
* result with a 200 status code on success and with 401 status error on
|
||||
* failure. This behavior was applied to help the web clients deal with
|
||||
* browsers who don't allow to set 3rd party HTTP cookies needed for saving
|
||||
* the account session token.
|
||||
* /docs/references/teams/update-team-membership-status.md
|
||||
*
|
||||
* @param string teamId
|
||||
* @param string inviteId
|
||||
|
|
|
@ -5,8 +5,7 @@ class Users extends Service {
|
|||
/**
|
||||
* List Users
|
||||
*
|
||||
* Get a list of all the project users. You can use the query params to filter
|
||||
* your results.
|
||||
* /docs/references/users/list-users.md
|
||||
*
|
||||
* @param string search
|
||||
* @param number limit
|
||||
|
@ -30,7 +29,7 @@ class Users extends Service {
|
|||
/**
|
||||
* Create User
|
||||
*
|
||||
* Create a new user.
|
||||
* /docs/references/users/create-user.md
|
||||
*
|
||||
* @param string email
|
||||
* @param string password
|
||||
|
@ -52,7 +51,7 @@ class Users extends Service {
|
|||
/**
|
||||
* Get User
|
||||
*
|
||||
* Get user by its unique ID.
|
||||
* /docs/references/users/get-user.md
|
||||
*
|
||||
* @param string userId
|
||||
* @throws Exception
|
||||
|
@ -69,7 +68,7 @@ class Users extends Service {
|
|||
/**
|
||||
* Get User Logs
|
||||
*
|
||||
* Get user activity logs list by its unique ID.
|
||||
* /docs/references/users/get-user-logs.md
|
||||
*
|
||||
* @param string userId
|
||||
* @throws Exception
|
||||
|
@ -86,7 +85,7 @@ class Users extends Service {
|
|||
/**
|
||||
* Get User Prefs
|
||||
*
|
||||
* Get user preferences by its unique ID.
|
||||
* /docs/references/users/get-user-prefs.md
|
||||
*
|
||||
* @param string userId
|
||||
* @throws Exception
|
||||
|
@ -100,10 +99,29 @@ class Users extends Service {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Account Prefs
|
||||
*
|
||||
* /docs/references/users/update-user-prefs.md
|
||||
*
|
||||
* @param string userId
|
||||
* @param string prefs
|
||||
* @throws Exception
|
||||
* @return {}
|
||||
*/
|
||||
async updateUserPrefs(userId, prefs) {
|
||||
let path = '/users/{userId}/prefs'.replace(new RegExp('{userId}', 'g'), userId);
|
||||
|
||||
return await this.client.call('patch', path, {'content-type': 'application/json'},
|
||||
{
|
||||
'prefs': prefs
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get User Sessions
|
||||
*
|
||||
* Get user sessions list by its unique ID.
|
||||
* /docs/references/users/get-user-sessions.md
|
||||
*
|
||||
* @param string userId
|
||||
* @throws Exception
|
||||
|
@ -137,14 +155,14 @@ class Users extends Service {
|
|||
/**
|
||||
* Delete User Session
|
||||
*
|
||||
* Delete user sessions by its unique ID.
|
||||
* /docs/references/users/delete-user-session.md
|
||||
*
|
||||
* @param string userId
|
||||
* @param string sessionId
|
||||
* @throws Exception
|
||||
* @return {}
|
||||
*/
|
||||
async deleteUsersSession(userId, sessionId) {
|
||||
async deleteUserSession(userId, sessionId) {
|
||||
let path = '/users/{userId}/sessions/:session'.replace(new RegExp('{userId}', 'g'), userId);
|
||||
|
||||
return await this.client.call('delete', path, {'content-type': 'application/json'},
|
||||
|
@ -156,7 +174,7 @@ class Users extends Service {
|
|||
/**
|
||||
* Update user status
|
||||
*
|
||||
* Update user status by its unique ID.
|
||||
* /docs/references/users/update-user-status.md
|
||||
*
|
||||
* @param string userId
|
||||
* @param string status
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Appwrite SDK for PHP
|
||||
|
||||
![License](https://img.shields.io/github/license/appwrite/sdk-for-php.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-latest-blue.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-0.2.0-blue.svg?v=1)
|
||||
|
||||
**This SDK is compatible with Appwrite server version 0.2.0. For older versions, please check previous releases.**
|
||||
|
||||
|
@ -13,7 +13,7 @@ Appwrite backend as a service cuts up to 70% of the time and costs required for
|
|||
|
||||
## Installation
|
||||
|
||||
To install via [Composer](https://getcomposer.org/):
|
||||
To install via [Composer](http://getcomposer.org/):
|
||||
|
||||
```bash
|
||||
composer require appwrite/appwrite
|
||||
|
@ -21,4 +21,4 @@ composer require appwrite/appwrite
|
|||
|
||||
## License
|
||||
|
||||
Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.
|
||||
Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.
|
|
@ -3,26 +3,26 @@
|
|||
## Get Account
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/account
|
||||
GET https://appwrite.io/v1/account
|
||||
```
|
||||
|
||||
** Get currently logged in user data as JSON object. **
|
||||
** /docs/references/account/get.md **
|
||||
|
||||
## Delete Account
|
||||
|
||||
```http request
|
||||
DELETE https://https://appwrite.io/v1/account
|
||||
DELETE https://appwrite.io/v1/account
|
||||
```
|
||||
|
||||
** Delete currently logged in user account. **
|
||||
** /docs/references/account/delete.md **
|
||||
|
||||
## Update Account Email
|
||||
|
||||
```http request
|
||||
PATCH https://https://appwrite.io/v1/account/email
|
||||
PATCH https://appwrite.io/v1/account/email
|
||||
```
|
||||
|
||||
** Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request. **
|
||||
** /docs/references/account/update-email.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -34,10 +34,10 @@ PATCH https://https://appwrite.io/v1/account/email
|
|||
## Update Account Name
|
||||
|
||||
```http request
|
||||
PATCH https://https://appwrite.io/v1/account/name
|
||||
PATCH https://appwrite.io/v1/account/name
|
||||
```
|
||||
|
||||
** Update currently logged in user account name. **
|
||||
** /docs/references/account/update-name.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -48,10 +48,10 @@ PATCH https://https://appwrite.io/v1/account/name
|
|||
## Update Account Password
|
||||
|
||||
```http request
|
||||
PATCH https://https://appwrite.io/v1/account/password
|
||||
PATCH https://appwrite.io/v1/account/password
|
||||
```
|
||||
|
||||
** Update currently logged in user password. For validation, user is required to pass the password twice. **
|
||||
** /docs/references/account/update-password.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -63,18 +63,18 @@ PATCH https://https://appwrite.io/v1/account/password
|
|||
## Get Account Preferences
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/account/prefs
|
||||
GET https://appwrite.io/v1/account/prefs
|
||||
```
|
||||
|
||||
** Get currently logged in user preferences key-value object. **
|
||||
** /docs/references/account/get-prefs.md **
|
||||
|
||||
## Update Account Prefs
|
||||
|
||||
```http request
|
||||
PATCH https://https://appwrite.io/v1/account/prefs
|
||||
PATCH https://appwrite.io/v1/account/prefs
|
||||
```
|
||||
|
||||
** Update currently logged in user account preferences. You can pass only the specific settings you wish to update. **
|
||||
** /docs/references/account/update-prefs.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -85,16 +85,16 @@ PATCH https://https://appwrite.io/v1/account/prefs
|
|||
## Get Account Security Log
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/account/security
|
||||
GET https://appwrite.io/v1/account/security
|
||||
```
|
||||
|
||||
** Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log. **
|
||||
** /docs/references/account/get-security.md **
|
||||
|
||||
## Get Account Active Sessions
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/account/sessions
|
||||
GET https://appwrite.io/v1/account/sessions
|
||||
```
|
||||
|
||||
** Get currently logged in user list of active sessions across different devices. **
|
||||
** /docs/references/account/get-sessions.md **
|
||||
|
||||
|
|
|
@ -3,14 +3,10 @@
|
|||
## Login User
|
||||
|
||||
```http request
|
||||
POST https://https://appwrite.io/v1/auth/login
|
||||
POST https://appwrite.io/v1/auth/login
|
||||
```
|
||||
|
||||
** Allow the user to login into his account by providing a valid email and password combination. Use the success and failure arguments to provide a redirect URL\'s back to your app when login is completed.
|
||||
|
||||
Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.
|
||||
|
||||
When accessing this route using JavaScript from the browser, success and failure parameter URLs are required. Appwrite server will respond with a 301 redirect status code and will set the user session cookie. This behavior is enforced because modern browsers are limiting 3rd party cookies in XHR of fetch requests to protect user privacy. **
|
||||
** /docs/references/auth/login.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -24,18 +20,18 @@ When accessing this route using JavaScript from the browser, success and failure
|
|||
## Logout Current Session
|
||||
|
||||
```http request
|
||||
DELETE https://https://appwrite.io/v1/auth/logout
|
||||
DELETE https://appwrite.io/v1/auth/logout
|
||||
```
|
||||
|
||||
** Use this endpoint to log out the currently logged in user from his account. When succeed this endpoint will delete the user session and remove the session secret cookie from the user client. **
|
||||
** /docs/references/auth/logout.md **
|
||||
|
||||
## Logout Specific Session
|
||||
|
||||
```http request
|
||||
DELETE https://https://appwrite.io/v1/auth/logout/{id}
|
||||
DELETE https://appwrite.io/v1/auth/logout/{id}
|
||||
```
|
||||
|
||||
** Use this endpoint to log out the currently logged in user from all his account sessions across all his different devices. When using the option id argument, only the session unique ID provider will be deleted. **
|
||||
** /docs/references/auth/logout-by-session.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -46,7 +42,7 @@ DELETE https://https://appwrite.io/v1/auth/logout/{id}
|
|||
## OAuth Login
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/auth/oauth/{provider}
|
||||
GET https://appwrite.io/v1/auth/oauth/{provider}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -60,10 +56,10 @@ GET https://https://appwrite.io/v1/auth/oauth/{provider}
|
|||
## Password Recovery
|
||||
|
||||
```http request
|
||||
POST https://https://appwrite.io/v1/auth/recovery
|
||||
POST https://appwrite.io/v1/auth/recovery
|
||||
```
|
||||
|
||||
** Sends the user an email with a temporary secret token for password reset. When the user clicks the confirmation link he is redirected back to your app password reset redirect URL with a secret token and email address values attached to the URL query string. Use the query string params to submit a request to the /auth/password/reset endpoint to complete the process. **
|
||||
** /docs/references/auth/recovery.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -75,12 +71,10 @@ POST https://https://appwrite.io/v1/auth/recovery
|
|||
## Password Reset
|
||||
|
||||
```http request
|
||||
PUT https://https://appwrite.io/v1/auth/recovery/reset
|
||||
PUT https://appwrite.io/v1/auth/recovery/reset
|
||||
```
|
||||
|
||||
** Use this endpoint to complete the user account password reset. Both the **userId** and **token** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the /auth/recovery endpoint.
|
||||
|
||||
Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface. **
|
||||
** /docs/references/auth/recovery-reset.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -94,16 +88,10 @@ Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWA
|
|||
## Register User
|
||||
|
||||
```http request
|
||||
POST https://https://appwrite.io/v1/auth/register
|
||||
POST https://appwrite.io/v1/auth/register
|
||||
```
|
||||
|
||||
** Use this endpoint to allow a new user to register an account in your project. Use the success and failure URL's to redirect users back to your application after signup completes.
|
||||
|
||||
If registration completes successfully user will be sent with a confirmation email in order to confirm he is the owner of the account email address. Use the confirmation parameter to redirect the user from the confirmation email back to your app. When the user is redirected, use the /auth/confirm endpoint to complete the account confirmation.
|
||||
|
||||
Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.
|
||||
|
||||
When accessing this route using JavaScript from the browser, success and failure parameter URLs are required. Appwrite server will respond with a 301 redirect status code and will set the user session cookie. This behavior is enforced because modern browsers are limiting 3rd party cookies in XHR of fetch requests to protect user privacy. **
|
||||
** /docs/references/auth/register.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -119,10 +107,10 @@ When accessing this route using JavaScript from the browser, success and failure
|
|||
## Confirm User
|
||||
|
||||
```http request
|
||||
POST https://https://appwrite.io/v1/auth/register/confirm
|
||||
POST https://appwrite.io/v1/auth/register/confirm
|
||||
```
|
||||
|
||||
** Use this endpoint to complete the confirmation of the user account email address. Both the **userId** and **token** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the /auth/register endpoint. **
|
||||
** /docs/references/auth/confirm.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -134,12 +122,10 @@ POST https://https://appwrite.io/v1/auth/register/confirm
|
|||
## Resend Confirmation
|
||||
|
||||
```http request
|
||||
POST https://https://appwrite.io/v1/auth/register/confirm/resend
|
||||
POST https://appwrite.io/v1/auth/register/confirm/resend
|
||||
```
|
||||
|
||||
** This endpoint allows the user to request your app to resend him his email confirmation message. The redirect arguments acts the same way as in /auth/register endpoint.
|
||||
|
||||
Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface. **
|
||||
** /docs/references/auth/confirm-resend.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
## Get Browser Icon
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/avatars/browsers/{code}
|
||||
GET https://appwrite.io/v1/avatars/browsers/{code}
|
||||
```
|
||||
|
||||
** You can use this endpoint to show different browser icons to your users, The code argument receives the browser code as appear in your user /account/sessions endpoint. Use width, height and quality arguments to change the output settings. **
|
||||
** /docs/references/avatars/get-browser.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -20,10 +20,10 @@ GET https://https://appwrite.io/v1/avatars/browsers/{code}
|
|||
## Get Credit Card Icon
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/avatars/credit-cards/{code}
|
||||
GET https://appwrite.io/v1/avatars/credit-cards/{code}
|
||||
```
|
||||
|
||||
** Need to display your users with your billing method or there payment methods? The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings. **
|
||||
** /docs/references/avatars/get-credit-cards.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -37,10 +37,10 @@ GET https://https://appwrite.io/v1/avatars/credit-cards/{code}
|
|||
## Get Favicon
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/avatars/favicon
|
||||
GET https://appwrite.io/v1/avatars/favicon
|
||||
```
|
||||
|
||||
** Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL. **
|
||||
** /docs/references/avatars/get-favicon.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -51,10 +51,10 @@ GET https://https://appwrite.io/v1/avatars/favicon
|
|||
## Get Country Flag
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/avatars/flags/{code}
|
||||
GET https://appwrite.io/v1/avatars/flags/{code}
|
||||
```
|
||||
|
||||
** You can use this endpoint to show different country flags icons to your users, The code argument receives the a 2 letter country code. Use width, height and quality arguments to change the output settings. **
|
||||
** /docs/references/avatars/get-flag.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -68,10 +68,10 @@ GET https://https://appwrite.io/v1/avatars/flags/{code}
|
|||
## Get Image from URL
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/avatars/image
|
||||
GET https://appwrite.io/v1/avatars/image
|
||||
```
|
||||
|
||||
** Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in cases, you want to make sure a 3rd party image is properly served using a TLS protocol. **
|
||||
** /docs/references/avatars/get-image.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -84,10 +84,10 @@ GET https://https://appwrite.io/v1/avatars/image
|
|||
## Text to QR Generator
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/avatars/qr
|
||||
GET https://appwrite.io/v1/avatars/qr
|
||||
```
|
||||
|
||||
** 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. **
|
||||
** /docs/references/avatars/get-qr.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
## List Collections
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/database
|
||||
GET https://appwrite.io/v1/database
|
||||
```
|
||||
|
||||
** 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). **
|
||||
** /docs/references/database/list-collections.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -20,10 +20,10 @@ GET https://https://appwrite.io/v1/database
|
|||
## Create Collection
|
||||
|
||||
```http request
|
||||
POST https://https://appwrite.io/v1/database
|
||||
POST https://appwrite.io/v1/database
|
||||
```
|
||||
|
||||
** Create a new Collection. **
|
||||
** /docs/references/database/create-collection.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -37,10 +37,10 @@ POST https://https://appwrite.io/v1/database
|
|||
## Get Collection
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/database/{collectionId}
|
||||
GET https://appwrite.io/v1/database/{collectionId}
|
||||
```
|
||||
|
||||
** Get collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. **
|
||||
** /docs/references/database/get-collection.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -51,10 +51,10 @@ GET https://https://appwrite.io/v1/database/{collectionId}
|
|||
## Update Collection
|
||||
|
||||
```http request
|
||||
PUT https://https://appwrite.io/v1/database/{collectionId}
|
||||
PUT https://appwrite.io/v1/database/{collectionId}
|
||||
```
|
||||
|
||||
** Update collection by its unique ID. **
|
||||
** /docs/references/database/update-collection.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -69,10 +69,10 @@ PUT https://https://appwrite.io/v1/database/{collectionId}
|
|||
## Delete Collection
|
||||
|
||||
```http request
|
||||
DELETE https://https://appwrite.io/v1/database/{collectionId}
|
||||
DELETE https://appwrite.io/v1/database/{collectionId}
|
||||
```
|
||||
|
||||
** Delete a collection by its unique ID. Only users with write permissions have access to delete this resource. **
|
||||
** /docs/references/database/delete-collection.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -83,10 +83,10 @@ DELETE https://https://appwrite.io/v1/database/{collectionId}
|
|||
## List Documents
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/database/{collectionId}/documents
|
||||
GET https://appwrite.io/v1/database/{collectionId}/documents
|
||||
```
|
||||
|
||||
** 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). **
|
||||
** /docs/references/database/list-documents.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -106,10 +106,10 @@ GET https://https://appwrite.io/v1/database/{collectionId}/documents
|
|||
## Create Document
|
||||
|
||||
```http request
|
||||
POST https://https://appwrite.io/v1/database/{collectionId}/documents
|
||||
POST https://appwrite.io/v1/database/{collectionId}/documents
|
||||
```
|
||||
|
||||
** Create a new Document. **
|
||||
** /docs/references/database/create-document.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -126,10 +126,10 @@ POST https://https://appwrite.io/v1/database/{collectionId}/documents
|
|||
## Get Document
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/database/{collectionId}/documents/{documentId}
|
||||
GET https://appwrite.io/v1/database/{collectionId}/documents/{documentId}
|
||||
```
|
||||
|
||||
** Get document by its unique ID. This endpoint response returns a JSON object with the document data. **
|
||||
** /docs/references/database/get-document.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -141,9 +141,11 @@ GET https://https://appwrite.io/v1/database/{collectionId}/documents/{documentId
|
|||
## Update Document
|
||||
|
||||
```http request
|
||||
PATCH https://https://appwrite.io/v1/database/{collectionId}/documents/{documentId}
|
||||
PATCH https://appwrite.io/v1/database/{collectionId}/documents/{documentId}
|
||||
```
|
||||
|
||||
** /docs/references/database/update-document.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
| Field Name | Type | Description | Default |
|
||||
|
@ -157,10 +159,10 @@ PATCH https://https://appwrite.io/v1/database/{collectionId}/documents/{document
|
|||
## Delete Document
|
||||
|
||||
```http request
|
||||
DELETE https://https://appwrite.io/v1/database/{collectionId}/documents/{documentId}
|
||||
DELETE https://appwrite.io/v1/database/{collectionId}/documents/{documentId}
|
||||
```
|
||||
|
||||
** Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted. **
|
||||
** /docs/references/database/delete-document.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
|
15
app/sdks/php/docs/examples/users/delete-user-session.md
Normal file
15
app/sdks/php/docs/examples/users/delete-user-session.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
use Appwrite\Client;
|
||||
use Appwrite\Services\Users;
|
||||
|
||||
$client = new Client();
|
||||
|
||||
$client
|
||||
->setProject('')
|
||||
->setKey('')
|
||||
;
|
||||
|
||||
$users = new Users($client);
|
||||
|
||||
$result = $users->deleteUserSession('[USER_ID]', '[SESSION_ID]');
|
15
app/sdks/php/docs/examples/users/update-user-prefs.md
Normal file
15
app/sdks/php/docs/examples/users/update-user-prefs.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
use Appwrite\Client;
|
||||
use Appwrite\Services\Users;
|
||||
|
||||
$client = new Client();
|
||||
|
||||
$client
|
||||
->setProject('')
|
||||
->setKey('')
|
||||
;
|
||||
|
||||
$users = new Users($client);
|
||||
|
||||
$result = $users->updateUserPrefs('[USER_ID]', '{}');
|
|
@ -3,40 +3,40 @@
|
|||
## Get User Locale
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/locale
|
||||
GET https://appwrite.io/v1/locale
|
||||
```
|
||||
|
||||
** Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in supported language. **
|
||||
** /docs/references/locale/get-locale.md **
|
||||
|
||||
## List Countries
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/locale/countries
|
||||
GET https://appwrite.io/v1/locale/countries
|
||||
```
|
||||
|
||||
** List of all countries. You can use the locale header to get the data in supported language. **
|
||||
** /docs/references/locale/get-countires.md **
|
||||
|
||||
## List EU Countries
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/locale/countries/eu
|
||||
GET https://appwrite.io/v1/locale/countries/eu
|
||||
```
|
||||
|
||||
** List of all countries that are currently members of the EU. You can use the locale header to get the data in supported language. UK brexit date is currently set to 2019-10-31 and will be updated if and when needed. **
|
||||
** /docs/references/locale/get-countries-eu.md **
|
||||
|
||||
## List Countries Phone Codes
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/locale/countries/phones
|
||||
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 supported language. **
|
||||
** /docs/references/locale/get-countries-phones.md **
|
||||
|
||||
## List of currencies
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/locale/currencies
|
||||
GET https://appwrite.io/v1/locale/currencies
|
||||
```
|
||||
|
||||
** List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in supported language. **
|
||||
** /docs/references/locale/get-currencies.md **
|
||||
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
## List Projects
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/projects
|
||||
GET https://appwrite.io/v1/projects
|
||||
```
|
||||
|
||||
## Create Project
|
||||
|
||||
```http request
|
||||
POST https://https://appwrite.io/v1/projects
|
||||
POST https://appwrite.io/v1/projects
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -31,7 +31,7 @@ POST https://https://appwrite.io/v1/projects
|
|||
## Get Project
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/projects/{projectId}
|
||||
GET https://appwrite.io/v1/projects/{projectId}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -43,7 +43,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}
|
|||
## Update Project
|
||||
|
||||
```http request
|
||||
PATCH https://https://appwrite.io/v1/projects/{projectId}
|
||||
PATCH https://appwrite.io/v1/projects/{projectId}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -65,7 +65,7 @@ PATCH https://https://appwrite.io/v1/projects/{projectId}
|
|||
## Delete Project
|
||||
|
||||
```http request
|
||||
DELETE https://https://appwrite.io/v1/projects/{projectId}
|
||||
DELETE https://appwrite.io/v1/projects/{projectId}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -77,7 +77,7 @@ DELETE https://https://appwrite.io/v1/projects/{projectId}
|
|||
## List Keys
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/projects/{projectId}/keys
|
||||
GET https://appwrite.io/v1/projects/{projectId}/keys
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -89,7 +89,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/keys
|
|||
## Create Key
|
||||
|
||||
```http request
|
||||
POST https://https://appwrite.io/v1/projects/{projectId}/keys
|
||||
POST https://appwrite.io/v1/projects/{projectId}/keys
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -103,7 +103,7 @@ POST https://https://appwrite.io/v1/projects/{projectId}/keys
|
|||
## Get Key
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
|
||||
GET https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -116,7 +116,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
|
|||
## Update Key
|
||||
|
||||
```http request
|
||||
PUT https://https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
|
||||
PUT https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -131,7 +131,7 @@ PUT https://https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
|
|||
## Delete Key
|
||||
|
||||
```http request
|
||||
DELETE https://https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
|
||||
DELETE https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -144,7 +144,7 @@ DELETE https://https://appwrite.io/v1/projects/{projectId}/keys/{keyId}
|
|||
## Update Project OAuth
|
||||
|
||||
```http request
|
||||
PATCH https://https://appwrite.io/v1/projects/{projectId}/oauth
|
||||
PATCH https://appwrite.io/v1/projects/{projectId}/oauth
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -159,7 +159,7 @@ PATCH https://https://appwrite.io/v1/projects/{projectId}/oauth
|
|||
## List Platforms
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/projects/{projectId}/platforms
|
||||
GET https://appwrite.io/v1/projects/{projectId}/platforms
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -171,7 +171,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/platforms
|
|||
## Create Platform
|
||||
|
||||
```http request
|
||||
POST https://https://appwrite.io/v1/projects/{projectId}/platforms
|
||||
POST https://appwrite.io/v1/projects/{projectId}/platforms
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -188,7 +188,7 @@ POST https://https://appwrite.io/v1/projects/{projectId}/platforms
|
|||
## Get Platform
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/projects/{projectId}/platforms/{platformId}
|
||||
GET https://appwrite.io/v1/projects/{projectId}/platforms/{platformId}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -201,7 +201,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/platforms/{platformId}
|
|||
## Update Platform
|
||||
|
||||
```http request
|
||||
PUT https://https://appwrite.io/v1/projects/{projectId}/platforms/{platformId}
|
||||
PUT https://appwrite.io/v1/projects/{projectId}/platforms/{platformId}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -218,7 +218,7 @@ PUT https://https://appwrite.io/v1/projects/{projectId}/platforms/{platformId}
|
|||
## Delete Platform
|
||||
|
||||
```http request
|
||||
DELETE https://https://appwrite.io/v1/projects/{projectId}/platforms/{platformId}
|
||||
DELETE https://appwrite.io/v1/projects/{projectId}/platforms/{platformId}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -231,7 +231,7 @@ DELETE https://https://appwrite.io/v1/projects/{projectId}/platforms/{platformId
|
|||
## List Tasks
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/projects/{projectId}/tasks
|
||||
GET https://appwrite.io/v1/projects/{projectId}/tasks
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -243,7 +243,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/tasks
|
|||
## Create Task
|
||||
|
||||
```http request
|
||||
POST https://https://appwrite.io/v1/projects/{projectId}/tasks
|
||||
POST https://appwrite.io/v1/projects/{projectId}/tasks
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -264,7 +264,7 @@ POST https://https://appwrite.io/v1/projects/{projectId}/tasks
|
|||
## Get Task
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
|
||||
GET https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -277,7 +277,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
|
|||
## Update Task
|
||||
|
||||
```http request
|
||||
PUT https://https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
|
||||
PUT https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -299,7 +299,7 @@ PUT https://https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
|
|||
## Delete Task
|
||||
|
||||
```http request
|
||||
DELETE https://https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
|
||||
DELETE https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -312,7 +312,7 @@ DELETE https://https://appwrite.io/v1/projects/{projectId}/tasks/{taskId}
|
|||
## Get Project
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/projects/{projectId}/usage
|
||||
GET https://appwrite.io/v1/projects/{projectId}/usage
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -324,7 +324,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/usage
|
|||
## List Webhooks
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/projects/{projectId}/webhooks
|
||||
GET https://appwrite.io/v1/projects/{projectId}/webhooks
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -336,7 +336,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/webhooks
|
|||
## Create Webhook
|
||||
|
||||
```http request
|
||||
POST https://https://appwrite.io/v1/projects/{projectId}/webhooks
|
||||
POST https://appwrite.io/v1/projects/{projectId}/webhooks
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -354,7 +354,7 @@ POST https://https://appwrite.io/v1/projects/{projectId}/webhooks
|
|||
## Get Webhook
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId}
|
||||
GET https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -367,7 +367,7 @@ GET https://https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId}
|
|||
## Update Webhook
|
||||
|
||||
```http request
|
||||
PUT https://https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId}
|
||||
PUT https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
@ -386,7 +386,7 @@ PUT https://https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId}
|
|||
## Delete Webhook
|
||||
|
||||
```http request
|
||||
DELETE https://https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId}
|
||||
DELETE https://appwrite.io/v1/projects/{projectId}/webhooks/{webhookId}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
## List Files
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/storage/files
|
||||
GET https://appwrite.io/v1/storage/files
|
||||
```
|
||||
|
||||
** 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). **
|
||||
** /docs/references/storage/list-files.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -20,10 +20,10 @@ GET https://https://appwrite.io/v1/storage/files
|
|||
## Create File
|
||||
|
||||
```http request
|
||||
POST https://https://appwrite.io/v1/storage/files
|
||||
POST https://appwrite.io/v1/storage/files
|
||||
```
|
||||
|
||||
** Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments. **
|
||||
** /docs/references/storage/create-file.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -37,10 +37,10 @@ POST https://https://appwrite.io/v1/storage/files
|
|||
## Get File
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/storage/files/{fileId}
|
||||
GET https://appwrite.io/v1/storage/files/{fileId}
|
||||
```
|
||||
|
||||
** Get file by its unique ID. This endpoint response returns a JSON object with the file metadata. **
|
||||
** /docs/references/storage/get-file.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -51,10 +51,10 @@ GET https://https://appwrite.io/v1/storage/files/{fileId}
|
|||
## Update File
|
||||
|
||||
```http request
|
||||
PUT https://https://appwrite.io/v1/storage/files/{fileId}
|
||||
PUT https://appwrite.io/v1/storage/files/{fileId}
|
||||
```
|
||||
|
||||
** Update file by its unique ID. Only users with write permissions have access to update this resource. **
|
||||
** /docs/references/storage/update-file.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -68,10 +68,10 @@ PUT https://https://appwrite.io/v1/storage/files/{fileId}
|
|||
## Delete File
|
||||
|
||||
```http request
|
||||
DELETE https://https://appwrite.io/v1/storage/files/{fileId}
|
||||
DELETE https://appwrite.io/v1/storage/files/{fileId}
|
||||
```
|
||||
|
||||
** Delete a file by its unique ID. Only users with write permissions have access to delete this resource. **
|
||||
** /docs/references/storage/delete-file.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -82,10 +82,10 @@ DELETE https://https://appwrite.io/v1/storage/files/{fileId}
|
|||
## Get File for Download
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/storage/files/{fileId}/download
|
||||
GET https://appwrite.io/v1/storage/files/{fileId}/download
|
||||
```
|
||||
|
||||
** Get file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. **
|
||||
** /docs/references/storage/get-file-download.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -96,10 +96,10 @@ GET https://https://appwrite.io/v1/storage/files/{fileId}/download
|
|||
## Get File Preview
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/storage/files/{fileId}/preview
|
||||
GET https://appwrite.io/v1/storage/files/{fileId}/preview
|
||||
```
|
||||
|
||||
** Get file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets will return file icon image. You can also pass query string arguments for cutting and resizing your preview image. **
|
||||
** /docs/references/storage/get-file-preview.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -115,10 +115,10 @@ GET https://https://appwrite.io/v1/storage/files/{fileId}/preview
|
|||
## Get File for View
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/storage/files/{fileId}/view
|
||||
GET https://appwrite.io/v1/storage/files/{fileId}/view
|
||||
```
|
||||
|
||||
** Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. **
|
||||
** /docs/references/storage/get-file-view.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
## List Teams
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/teams
|
||||
GET https://appwrite.io/v1/teams
|
||||
```
|
||||
|
||||
** 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). **
|
||||
** /docs/references/teams/list-teams.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -20,10 +20,10 @@ GET https://https://appwrite.io/v1/teams
|
|||
## Create Team
|
||||
|
||||
```http request
|
||||
POST https://https://appwrite.io/v1/teams
|
||||
POST https://appwrite.io/v1/teams
|
||||
```
|
||||
|
||||
** Create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project. **
|
||||
** /docs/references/teams/create-team.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -35,10 +35,10 @@ POST https://https://appwrite.io/v1/teams
|
|||
## Get Team
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/teams/{teamId}
|
||||
GET https://appwrite.io/v1/teams/{teamId}
|
||||
```
|
||||
|
||||
** Get team by its unique ID. All team members have read access for this resource. **
|
||||
** /docs/references/teams/get-team.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -49,10 +49,10 @@ GET https://https://appwrite.io/v1/teams/{teamId}
|
|||
## Update Team
|
||||
|
||||
```http request
|
||||
PUT https://https://appwrite.io/v1/teams/{teamId}
|
||||
PUT https://appwrite.io/v1/teams/{teamId}
|
||||
```
|
||||
|
||||
** Update team by its unique ID. Only team owners have write access for this resource. **
|
||||
** /docs/references/teams/update-team.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -64,10 +64,10 @@ PUT https://https://appwrite.io/v1/teams/{teamId}
|
|||
## Delete Team
|
||||
|
||||
```http request
|
||||
DELETE https://https://appwrite.io/v1/teams/{teamId}
|
||||
DELETE https://appwrite.io/v1/teams/{teamId}
|
||||
```
|
||||
|
||||
** Delete team by its unique ID. Only team owners have write access for this resource. **
|
||||
** /docs/references/teams/delete-team.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -78,10 +78,10 @@ DELETE https://https://appwrite.io/v1/teams/{teamId}
|
|||
## Get Team Members
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/teams/{teamId}/members
|
||||
GET https://appwrite.io/v1/teams/{teamId}/members
|
||||
```
|
||||
|
||||
** Get team members by the team unique ID. All team members have read access for this list of resources. **
|
||||
** /docs/references/teams/get-team-members.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -92,14 +92,10 @@ GET https://https://appwrite.io/v1/teams/{teamId}/members
|
|||
## Create Team Membership
|
||||
|
||||
```http request
|
||||
POST https://https://appwrite.io/v1/teams/{teamId}/memberships
|
||||
POST https://appwrite.io/v1/teams/{teamId}/memberships
|
||||
```
|
||||
|
||||
** Use this endpoint to invite a new member to your team. An email with a link to join the team will be sent to the new member email address. If member doesn't exists in the project it will be automatically created.
|
||||
|
||||
Use the redirect parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the /teams/{teamId}/memberships/{inviteId}/status endpoint to finally join the user to the team.
|
||||
|
||||
Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface. **
|
||||
** /docs/references/teams/create-team-membership.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -114,10 +110,10 @@ Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWA
|
|||
## Delete Team Membership
|
||||
|
||||
```http request
|
||||
DELETE https://https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}
|
||||
DELETE https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}
|
||||
```
|
||||
|
||||
** This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. **
|
||||
** /docs/references/teams/delete-team-membership.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -129,10 +125,10 @@ DELETE https://https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}
|
|||
## Create Team Membership (Resend)
|
||||
|
||||
```http request
|
||||
POST https://https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}/resend
|
||||
POST https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}/resend
|
||||
```
|
||||
|
||||
** Use this endpoint to resend your invitation email for a user to join a team. **
|
||||
** /docs/references/teams/create-team-membership-resend.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -145,14 +141,10 @@ POST https://https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}/resend
|
|||
## Update Team Membership Status
|
||||
|
||||
```http request
|
||||
PATCH https://https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}/status
|
||||
PATCH https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}/status
|
||||
```
|
||||
|
||||
** Use this endpoint to let user accept an invitation to join a team after he is being redirect back to your app from the invitation email. Use the success and failure URL's to redirect users back to your application after the request completes.
|
||||
|
||||
Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.
|
||||
|
||||
When not using the success or failure redirect arguments this endpoint will result with a 200 status code on success and with 401 status error on failure. This behavior was applied to help the web clients deal with browsers who don't allow to set 3rd party HTTP cookies needed for saving the account session token. **
|
||||
** /docs/references/teams/update-team-membership-status.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
## List Users
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/users
|
||||
GET https://appwrite.io/v1/users
|
||||
```
|
||||
|
||||
** Get a list of all the project users. You can use the query params to filter your results. **
|
||||
** /docs/references/users/list-users.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -20,10 +20,10 @@ GET https://https://appwrite.io/v1/users
|
|||
## Create User
|
||||
|
||||
```http request
|
||||
POST https://https://appwrite.io/v1/users
|
||||
POST https://appwrite.io/v1/users
|
||||
```
|
||||
|
||||
** Create a new user. **
|
||||
** /docs/references/users/create-user.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -36,10 +36,10 @@ POST https://https://appwrite.io/v1/users
|
|||
## Get User
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/users/{userId}
|
||||
GET https://appwrite.io/v1/users/{userId}
|
||||
```
|
||||
|
||||
** Get user by its unique ID. **
|
||||
** /docs/references/users/get-user.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -50,10 +50,10 @@ GET https://https://appwrite.io/v1/users/{userId}
|
|||
## Get User Logs
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/users/{userId}/logs
|
||||
GET https://appwrite.io/v1/users/{userId}/logs
|
||||
```
|
||||
|
||||
** Get user activity logs list by its unique ID. **
|
||||
** /docs/references/users/get-user-logs.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -64,10 +64,10 @@ GET https://https://appwrite.io/v1/users/{userId}/logs
|
|||
## Get User Prefs
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/users/{userId}/prefs
|
||||
GET https://appwrite.io/v1/users/{userId}/prefs
|
||||
```
|
||||
|
||||
** Get user preferences by its unique ID. **
|
||||
** /docs/references/users/get-user-prefs.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -75,13 +75,28 @@ GET https://https://appwrite.io/v1/users/{userId}/prefs
|
|||
| --- | --- | --- | --- |
|
||||
| userId | string | **Required** User unique ID. | |
|
||||
|
||||
## Update Account Prefs
|
||||
|
||||
```http request
|
||||
PATCH https://appwrite.io/v1/users/{userId}/prefs
|
||||
```
|
||||
|
||||
** /docs/references/users/update-user-prefs.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
| Field Name | Type | Description | Default |
|
||||
| --- | --- | --- | --- |
|
||||
| userId | string | **Required** User unique ID. | |
|
||||
| prefs | string | Prefs key-value JSON object string. | |
|
||||
|
||||
## Get User Sessions
|
||||
|
||||
```http request
|
||||
GET https://https://appwrite.io/v1/users/{userId}/sessions
|
||||
GET https://appwrite.io/v1/users/{userId}/sessions
|
||||
```
|
||||
|
||||
** Get user sessions list by its unique ID. **
|
||||
** /docs/references/users/get-user-sessions.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -92,7 +107,7 @@ GET https://https://appwrite.io/v1/users/{userId}/sessions
|
|||
## Delete User Sessions
|
||||
|
||||
```http request
|
||||
DELETE https://https://appwrite.io/v1/users/{userId}/sessions
|
||||
DELETE https://appwrite.io/v1/users/{userId}/sessions
|
||||
```
|
||||
|
||||
** Delete all user sessions by its unique ID. **
|
||||
|
@ -106,10 +121,10 @@ DELETE https://https://appwrite.io/v1/users/{userId}/sessions
|
|||
## Delete User Session
|
||||
|
||||
```http request
|
||||
DELETE https://https://appwrite.io/v1/users/{userId}/sessions/:session
|
||||
DELETE https://appwrite.io/v1/users/{userId}/sessions/:session
|
||||
```
|
||||
|
||||
** Delete user sessions by its unique ID. **
|
||||
** /docs/references/users/delete-user-session.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -121,10 +136,10 @@ DELETE https://https://appwrite.io/v1/users/{userId}/sessions/:session
|
|||
## Update user status
|
||||
|
||||
```http request
|
||||
PATCH https://https://appwrite.io/v1/users/{userId}/status
|
||||
PATCH https://appwrite.io/v1/users/{userId}/status
|
||||
```
|
||||
|
||||
** Update user status by its unique ID. **
|
||||
** /docs/references/users/update-user-status.md **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ class Client
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $endpoint = 'https://https://appwrite.io/v1';
|
||||
protected $endpoint = 'https://appwrite.io/v1';
|
||||
|
||||
/**
|
||||
* Global Headers
|
||||
|
|
|
@ -11,7 +11,7 @@ class Account extends Service
|
|||
/**
|
||||
* Get Account
|
||||
*
|
||||
* Get currently logged in user data as JSON object.
|
||||
* /docs/references/account/get.md
|
||||
*
|
||||
* @throws Exception
|
||||
* @return array
|
||||
|
@ -29,7 +29,7 @@ class Account extends Service
|
|||
/**
|
||||
* Delete Account
|
||||
*
|
||||
* Delete currently logged in user account.
|
||||
* /docs/references/account/delete.md
|
||||
*
|
||||
* @throws Exception
|
||||
* @return array
|
||||
|
@ -47,10 +47,7 @@ class Account extends Service
|
|||
/**
|
||||
* Update Account Email
|
||||
*
|
||||
* Update currently logged in user account email address. After changing user
|
||||
* address, user confirmation status is being reset and a new confirmation
|
||||
* mail is sent. For security measures, user password is required to complete
|
||||
* this request.
|
||||
* /docs/references/account/update-email.md
|
||||
*
|
||||
* @param string $email
|
||||
* @param string $password
|
||||
|
@ -72,7 +69,7 @@ class Account extends Service
|
|||
/**
|
||||
* Update Account Name
|
||||
*
|
||||
* Update currently logged in user account name.
|
||||
* /docs/references/account/update-name.md
|
||||
*
|
||||
* @param string $name
|
||||
* @throws Exception
|
||||
|
@ -92,8 +89,7 @@ class Account extends Service
|
|||
/**
|
||||
* Update Account Password
|
||||
*
|
||||
* Update currently logged in user password. For validation, user is required
|
||||
* to pass the password twice.
|
||||
* /docs/references/account/update-password.md
|
||||
*
|
||||
* @param string $password
|
||||
* @param string $oldPassword
|
||||
|
@ -115,7 +111,7 @@ class Account extends Service
|
|||
/**
|
||||
* Get Account Preferences
|
||||
*
|
||||
* Get currently logged in user preferences key-value object.
|
||||
* /docs/references/account/get-prefs.md
|
||||
*
|
||||
* @throws Exception
|
||||
* @return array
|
||||
|
@ -133,8 +129,7 @@ class Account extends Service
|
|||
/**
|
||||
* Update Account Prefs
|
||||
*
|
||||
* Update currently logged in user account preferences. You can pass only the
|
||||
* specific settings you wish to update.
|
||||
* /docs/references/account/update-prefs.md
|
||||
*
|
||||
* @param string $prefs
|
||||
* @throws Exception
|
||||
|
@ -154,8 +149,7 @@ class Account extends Service
|
|||
/**
|
||||
* Get Account Security Log
|
||||
*
|
||||
* Get currently logged in user list of latest security activity logs. Each
|
||||
* log returns user IP address, location and date and time of log.
|
||||
* /docs/references/account/get-security.md
|
||||
*
|
||||
* @throws Exception
|
||||
* @return array
|
||||
|
@ -173,8 +167,7 @@ class Account extends Service
|
|||
/**
|
||||
* Get Account Active Sessions
|
||||
*
|
||||
* Get currently logged in user list of active sessions across different
|
||||
* devices.
|
||||
* /docs/references/account/get-sessions.md
|
||||
*
|
||||
* @throws Exception
|
||||
* @return array
|
||||
|
|
|
@ -11,20 +11,7 @@ class Auth extends Service
|
|||
/**
|
||||
* Login User
|
||||
*
|
||||
* Allow the user to login into his account by providing a valid email and
|
||||
* password combination. Use the success and failure arguments to provide a
|
||||
* redirect URL\'s back to your app when login is completed.
|
||||
*
|
||||
* Please notice that in order to avoid a [Redirect
|
||||
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
* the only valid redirect URL's are the once from domains you have set when
|
||||
* added your platforms in the console interface.
|
||||
*
|
||||
* When accessing this route using JavaScript from the browser, success and
|
||||
* failure parameter URLs are required. Appwrite server will respond with a
|
||||
* 301 redirect status code and will set the user session cookie. This
|
||||
* behavior is enforced because modern browsers are limiting 3rd party cookies
|
||||
* in XHR of fetch requests to protect user privacy.
|
||||
* /docs/references/auth/login.md
|
||||
*
|
||||
* @param string $email
|
||||
* @param string $password
|
||||
|
@ -50,9 +37,7 @@ class Auth extends Service
|
|||
/**
|
||||
* Logout Current Session
|
||||
*
|
||||
* Use this endpoint to log out the currently logged in user from his account.
|
||||
* When succeed this endpoint will delete the user session and remove the
|
||||
* session secret cookie from the user client.
|
||||
* /docs/references/auth/logout.md
|
||||
*
|
||||
* @throws Exception
|
||||
* @return array
|
||||
|
@ -70,9 +55,7 @@ class Auth extends Service
|
|||
/**
|
||||
* Logout Specific Session
|
||||
*
|
||||
* Use this endpoint to log out the currently logged in user from all his
|
||||
* account sessions across all his different devices. When using the option id
|
||||
* argument, only the session unique ID provider will be deleted.
|
||||
* /docs/references/auth/logout-by-session.md
|
||||
*
|
||||
* @param string $id
|
||||
* @throws Exception
|
||||
|
@ -112,12 +95,7 @@ class Auth extends Service
|
|||
/**
|
||||
* Password Recovery
|
||||
*
|
||||
* Sends the user an email with a temporary secret token for password reset.
|
||||
* When the user clicks the confirmation link he is redirected back to your
|
||||
* app password reset redirect URL with a secret token and email address
|
||||
* values attached to the URL query string. Use the query string params to
|
||||
* submit a request to the /auth/password/reset endpoint to complete the
|
||||
* process.
|
||||
* /docs/references/auth/recovery.md
|
||||
*
|
||||
* @param string $email
|
||||
* @param string $reset
|
||||
|
@ -139,15 +117,7 @@ class Auth extends Service
|
|||
/**
|
||||
* Password Reset
|
||||
*
|
||||
* Use this endpoint to complete the user account password reset. Both the
|
||||
* **userId** and **token** arguments will be passed as query parameters to
|
||||
* the redirect URL you have provided when sending your request to the
|
||||
* /auth/recovery endpoint.
|
||||
*
|
||||
* Please notice that in order to avoid a [Redirect
|
||||
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
* the only valid redirect URL's are the once from domains you have set when
|
||||
* added your platforms in the console interface.
|
||||
* /docs/references/auth/recovery-reset.md
|
||||
*
|
||||
* @param string $userId
|
||||
* @param string $token
|
||||
|
@ -173,26 +143,7 @@ class Auth extends Service
|
|||
/**
|
||||
* Register User
|
||||
*
|
||||
* Use this endpoint to allow a new user to register an account in your
|
||||
* project. Use the success and failure URL's to redirect users back to your
|
||||
* application after signup completes.
|
||||
*
|
||||
* If registration completes successfully user will be sent with a
|
||||
* confirmation email in order to confirm he is the owner of the account email
|
||||
* address. Use the confirmation parameter to redirect the user from the
|
||||
* confirmation email back to your app. When the user is redirected, use the
|
||||
* /auth/confirm endpoint to complete the account confirmation.
|
||||
*
|
||||
* Please notice that in order to avoid a [Redirect
|
||||
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
* the only valid redirect URL's are the once from domains you have set when
|
||||
* added your platforms in the console interface.
|
||||
*
|
||||
* When accessing this route using JavaScript from the browser, success and
|
||||
* failure parameter URLs are required. Appwrite server will respond with a
|
||||
* 301 redirect status code and will set the user session cookie. This
|
||||
* behavior is enforced because modern browsers are limiting 3rd party cookies
|
||||
* in XHR of fetch requests to protect user privacy.
|
||||
* /docs/references/auth/register.md
|
||||
*
|
||||
* @param string $email
|
||||
* @param string $password
|
||||
|
@ -222,10 +173,7 @@ class Auth extends Service
|
|||
/**
|
||||
* Confirm User
|
||||
*
|
||||
* Use this endpoint to complete the confirmation of the user account email
|
||||
* address. Both the **userId** and **token** arguments will be passed as
|
||||
* query parameters to the redirect URL you have provided when sending your
|
||||
* request to the /auth/register endpoint.
|
||||
* /docs/references/auth/confirm.md
|
||||
*
|
||||
* @param string $userId
|
||||
* @param string $token
|
||||
|
@ -247,14 +195,7 @@ class Auth extends Service
|
|||
/**
|
||||
* Resend Confirmation
|
||||
*
|
||||
* This endpoint allows the user to request your app to resend him his email
|
||||
* confirmation message. The redirect arguments acts the same way as in
|
||||
* /auth/register endpoint.
|
||||
*
|
||||
* Please notice that in order to avoid a [Redirect
|
||||
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
* the only valid redirect URL's are the once from domains you have set when
|
||||
* added your platforms in the console interface.
|
||||
* /docs/references/auth/confirm-resend.md
|
||||
*
|
||||
* @param string $confirm
|
||||
* @throws Exception
|
||||
|
|
|
@ -11,10 +11,7 @@ class Avatars extends Service
|
|||
/**
|
||||
* Get Browser Icon
|
||||
*
|
||||
* You can use this endpoint to show different browser icons to your users,
|
||||
* The code argument receives the browser code as appear in your user
|
||||
* /account/sessions endpoint. Use width, height and quality arguments to
|
||||
* change the output settings.
|
||||
* /docs/references/avatars/get-browser.md
|
||||
*
|
||||
* @param string $code
|
||||
* @param integer $width
|
||||
|
@ -39,10 +36,7 @@ class Avatars extends Service
|
|||
/**
|
||||
* Get Credit Card Icon
|
||||
*
|
||||
* Need to display your users with your billing method or there payment
|
||||
* methods? The credit card endpoint will return you the icon of the credit
|
||||
* card provider you need. Use width, height and quality arguments to change
|
||||
* the output settings.
|
||||
* /docs/references/avatars/get-credit-cards.md
|
||||
*
|
||||
* @param string $code
|
||||
* @param integer $width
|
||||
|
@ -67,8 +61,7 @@ class Avatars extends Service
|
|||
/**
|
||||
* Get Favicon
|
||||
*
|
||||
* Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote
|
||||
* website URL.
|
||||
* /docs/references/avatars/get-favicon.md
|
||||
*
|
||||
* @param string $url
|
||||
* @throws Exception
|
||||
|
@ -88,9 +81,7 @@ class Avatars extends Service
|
|||
/**
|
||||
* Get Country Flag
|
||||
*
|
||||
* You can use this endpoint to show different country flags icons to your
|
||||
* users, The code argument receives the a 2 letter country code. Use width,
|
||||
* height and quality arguments to change the output settings.
|
||||
* /docs/references/avatars/get-flag.md
|
||||
*
|
||||
* @param string $code
|
||||
* @param integer $width
|
||||
|
@ -115,10 +106,7 @@ class Avatars extends Service
|
|||
/**
|
||||
* Get Image from URL
|
||||
*
|
||||
* Use this endpoint to fetch a remote image URL and crop it to any image size
|
||||
* you want. This endpoint is very useful if you need to crop and display
|
||||
* remote images in your app or in cases, you want to make sure a 3rd party
|
||||
* image is properly served using a TLS protocol.
|
||||
* /docs/references/avatars/get-image.md
|
||||
*
|
||||
* @param string $url
|
||||
* @param integer $width
|
||||
|
@ -142,8 +130,7 @@ class Avatars extends Service
|
|||
/**
|
||||
* Text to QR Generator
|
||||
*
|
||||
* 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.
|
||||
* /docs/references/avatars/get-qr.md
|
||||
*
|
||||
* @param string $text
|
||||
* @param integer $size
|
||||
|
|
|
@ -11,10 +11,7 @@ class Database extends Service
|
|||
/**
|
||||
* List Collections
|
||||
*
|
||||
* 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).
|
||||
* /docs/references/database/list-collections.md
|
||||
*
|
||||
* @param string $search
|
||||
* @param integer $limit
|
||||
|
@ -40,7 +37,7 @@ class Database extends Service
|
|||
/**
|
||||
* Create Collection
|
||||
*
|
||||
* Create a new Collection.
|
||||
* /docs/references/database/create-collection.md
|
||||
*
|
||||
* @param string $name
|
||||
* @param array $read
|
||||
|
@ -66,8 +63,7 @@ class Database extends Service
|
|||
/**
|
||||
* Get Collection
|
||||
*
|
||||
* Get collection by its unique ID. This endpoint response returns a JSON
|
||||
* object with the collection metadata.
|
||||
* /docs/references/database/get-collection.md
|
||||
*
|
||||
* @param string $collectionId
|
||||
* @throws Exception
|
||||
|
@ -86,7 +82,7 @@ class Database extends Service
|
|||
/**
|
||||
* Update Collection
|
||||
*
|
||||
* Update collection by its unique ID.
|
||||
* /docs/references/database/update-collection.md
|
||||
*
|
||||
* @param string $collectionId
|
||||
* @param string $name
|
||||
|
@ -113,8 +109,7 @@ class Database extends Service
|
|||
/**
|
||||
* Delete Collection
|
||||
*
|
||||
* Delete a collection by its unique ID. Only users with write permissions
|
||||
* have access to delete this resource.
|
||||
* /docs/references/database/delete-collection.md
|
||||
*
|
||||
* @param string $collectionId
|
||||
* @throws Exception
|
||||
|
@ -133,10 +128,7 @@ class Database extends Service
|
|||
/**
|
||||
* List Documents
|
||||
*
|
||||
* 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).
|
||||
* /docs/references/database/list-documents.md
|
||||
*
|
||||
* @param string $collectionId
|
||||
* @param array $filters
|
||||
|
@ -173,7 +165,7 @@ class Database extends Service
|
|||
/**
|
||||
* Create Document
|
||||
*
|
||||
* Create a new Document.
|
||||
* /docs/references/database/create-document.md
|
||||
*
|
||||
* @param string $collectionId
|
||||
* @param string $data
|
||||
|
@ -204,8 +196,7 @@ class Database extends Service
|
|||
/**
|
||||
* Get Document
|
||||
*
|
||||
* Get document by its unique ID. This endpoint response returns a JSON object
|
||||
* with the document data.
|
||||
* /docs/references/database/get-document.md
|
||||
*
|
||||
* @param string $collectionId
|
||||
* @param string $documentId
|
||||
|
@ -225,6 +216,8 @@ class Database extends Service
|
|||
/**
|
||||
* Update Document
|
||||
*
|
||||
* /docs/references/database/update-document.md
|
||||
*
|
||||
* @param string $collectionId
|
||||
* @param string $documentId
|
||||
* @param string $data
|
||||
|
@ -249,9 +242,7 @@ class Database extends Service
|
|||
/**
|
||||
* Delete Document
|
||||
*
|
||||
* Delete document by its unique ID. This endpoint deletes only the parent
|
||||
* documents, his attributes and relations to other documents. Child documents
|
||||
* **will not** be deleted.
|
||||
* /docs/references/database/delete-document.md
|
||||
*
|
||||
* @param string $collectionId
|
||||
* @param string $documentId
|
||||
|
|
|
@ -11,10 +11,7 @@ class Locale extends Service
|
|||
/**
|
||||
* Get User Locale
|
||||
*
|
||||
* Get the current user location based on IP. Returns an object with user
|
||||
* country code, country name, continent name, continent code, ip address and
|
||||
* suggested currency. You can use the locale header to get the data in
|
||||
* supported language.
|
||||
* /docs/references/locale/get-locale.md
|
||||
*
|
||||
* @throws Exception
|
||||
* @return array
|
||||
|
@ -32,8 +29,7 @@ class Locale extends Service
|
|||
/**
|
||||
* List Countries
|
||||
*
|
||||
* List of all countries. You can use the locale header to get the data in
|
||||
* supported language.
|
||||
* /docs/references/locale/get-countires.md
|
||||
*
|
||||
* @throws Exception
|
||||
* @return array
|
||||
|
@ -51,9 +47,7 @@ class Locale extends Service
|
|||
/**
|
||||
* List EU Countries
|
||||
*
|
||||
* List of all countries that are currently members of the EU. You can use the
|
||||
* locale header to get the data in supported language. UK brexit date is
|
||||
* currently set to 2019-10-31 and will be updated if and when needed.
|
||||
* /docs/references/locale/get-countries-eu.md
|
||||
*
|
||||
* @throws Exception
|
||||
* @return array
|
||||
|
@ -71,8 +65,7 @@ class Locale extends Service
|
|||
/**
|
||||
* List Countries Phone Codes
|
||||
*
|
||||
* List of all countries phone codes. You can use the locale header to get the
|
||||
* data in supported language.
|
||||
* /docs/references/locale/get-countries-phones.md
|
||||
*
|
||||
* @throws Exception
|
||||
* @return array
|
||||
|
@ -90,9 +83,7 @@ class Locale extends Service
|
|||
/**
|
||||
* List of currencies
|
||||
*
|
||||
* List of all currencies, including currency symbol, name, plural, and
|
||||
* decimal digits for all major and minor currencies. You can use the locale
|
||||
* header to get the data in supported language.
|
||||
* /docs/references/locale/get-currencies.md
|
||||
*
|
||||
* @throws Exception
|
||||
* @return array
|
||||
|
|
|
@ -11,9 +11,7 @@ class Storage extends Service
|
|||
/**
|
||||
* List Files
|
||||
*
|
||||
* 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).
|
||||
* /docs/references/storage/list-files.md
|
||||
*
|
||||
* @param string $search
|
||||
* @param integer $limit
|
||||
|
@ -39,9 +37,7 @@ class Storage extends Service
|
|||
/**
|
||||
* Create File
|
||||
*
|
||||
* Create a new file. The user who creates the file will automatically be
|
||||
* assigned to read and write access unless he has passed custom values for
|
||||
* read and write arguments.
|
||||
* /docs/references/storage/create-file.md
|
||||
*
|
||||
* @param \CurlFile $files
|
||||
* @param array $read
|
||||
|
@ -68,8 +64,7 @@ class Storage extends Service
|
|||
/**
|
||||
* Get File
|
||||
*
|
||||
* Get file by its unique ID. This endpoint response returns a JSON object
|
||||
* with the file metadata.
|
||||
* /docs/references/storage/get-file.md
|
||||
*
|
||||
* @param string $fileId
|
||||
* @throws Exception
|
||||
|
@ -88,8 +83,7 @@ class Storage extends Service
|
|||
/**
|
||||
* Update File
|
||||
*
|
||||
* Update file by its unique ID. Only users with write permissions have access
|
||||
* to update this resource.
|
||||
* /docs/references/storage/update-file.md
|
||||
*
|
||||
* @param string $fileId
|
||||
* @param array $read
|
||||
|
@ -114,8 +108,7 @@ class Storage extends Service
|
|||
/**
|
||||
* Delete File
|
||||
*
|
||||
* Delete a file by its unique ID. Only users with write permissions have
|
||||
* access to delete this resource.
|
||||
* /docs/references/storage/delete-file.md
|
||||
*
|
||||
* @param string $fileId
|
||||
* @throws Exception
|
||||
|
@ -134,9 +127,7 @@ class Storage extends Service
|
|||
/**
|
||||
* Get File for Download
|
||||
*
|
||||
* Get file content by its unique ID. The endpoint response return with a
|
||||
* 'Content-Disposition: attachment' header that tells the browser to start
|
||||
* downloading the file to user downloads directory.
|
||||
* /docs/references/storage/get-file-download.md
|
||||
*
|
||||
* @param string $fileId
|
||||
* @throws Exception
|
||||
|
@ -155,10 +146,7 @@ class Storage extends Service
|
|||
/**
|
||||
* Get File Preview
|
||||
*
|
||||
* Get file preview image. Currently, this method supports preview for image
|
||||
* files (jpg, png, and gif), other supported formats, like pdf, docs, slides,
|
||||
* and spreadsheets will return file icon image. You can also pass query
|
||||
* string arguments for cutting and resizing your preview image.
|
||||
* /docs/references/storage/get-file-preview.md
|
||||
*
|
||||
* @param string $fileId
|
||||
* @param integer $width
|
||||
|
@ -187,8 +175,7 @@ class Storage extends Service
|
|||
/**
|
||||
* Get File for View
|
||||
*
|
||||
* Get file content by its unique ID. This endpoint is similar to the download
|
||||
* method but returns with no 'Content-Disposition: attachment' header.
|
||||
* /docs/references/storage/get-file-view.md
|
||||
*
|
||||
* @param string $fileId
|
||||
* @param string $as
|
||||
|
|
|
@ -11,9 +11,7 @@ class Teams extends Service
|
|||
/**
|
||||
* List Teams
|
||||
*
|
||||
* 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).
|
||||
* /docs/references/teams/list-teams.md
|
||||
*
|
||||
* @param string $search
|
||||
* @param integer $limit
|
||||
|
@ -39,10 +37,7 @@ class Teams extends Service
|
|||
/**
|
||||
* Create Team
|
||||
*
|
||||
* Create a new team. The user who creates the team will automatically be
|
||||
* assigned as the owner of the team. The team owner can invite new members,
|
||||
* who will be able add new owners and update or delete the team from your
|
||||
* project.
|
||||
* /docs/references/teams/create-team.md
|
||||
*
|
||||
* @param string $name
|
||||
* @param array $roles
|
||||
|
@ -64,8 +59,7 @@ class Teams extends Service
|
|||
/**
|
||||
* Get Team
|
||||
*
|
||||
* Get team by its unique ID. All team members have read access for this
|
||||
* resource.
|
||||
* /docs/references/teams/get-team.md
|
||||
*
|
||||
* @param string $teamId
|
||||
* @throws Exception
|
||||
|
@ -84,8 +78,7 @@ class Teams extends Service
|
|||
/**
|
||||
* Update Team
|
||||
*
|
||||
* Update team by its unique ID. Only team owners have write access for this
|
||||
* resource.
|
||||
* /docs/references/teams/update-team.md
|
||||
*
|
||||
* @param string $teamId
|
||||
* @param string $name
|
||||
|
@ -106,8 +99,7 @@ class Teams extends Service
|
|||
/**
|
||||
* Delete Team
|
||||
*
|
||||
* Delete team by its unique ID. Only team owners have write access for this
|
||||
* resource.
|
||||
* /docs/references/teams/delete-team.md
|
||||
*
|
||||
* @param string $teamId
|
||||
* @throws Exception
|
||||
|
@ -126,8 +118,7 @@ class Teams extends Service
|
|||
/**
|
||||
* Get Team Members
|
||||
*
|
||||
* Get team members by the team unique ID. All team members have read access
|
||||
* for this list of resources.
|
||||
* /docs/references/teams/get-team-members.md
|
||||
*
|
||||
* @param string $teamId
|
||||
* @throws Exception
|
||||
|
@ -146,19 +137,7 @@ class Teams extends Service
|
|||
/**
|
||||
* Create Team Membership
|
||||
*
|
||||
* Use this endpoint to invite a new member to your team. An email with a link
|
||||
* to join the team will be sent to the new member email address. If member
|
||||
* doesn't exists in the project it will be automatically created.
|
||||
*
|
||||
* Use the redirect parameter to redirect the user from the invitation email
|
||||
* back to your app. When the user is redirected, use the
|
||||
* /teams/{teamId}/memberships/{inviteId}/status endpoint to finally join the
|
||||
* user to the team.
|
||||
*
|
||||
* Please notice that in order to avoid a [Redirect
|
||||
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
* the only valid redirect URL's are the once from domains you have set when
|
||||
* added your platforms in the console interface.
|
||||
* /docs/references/teams/create-team-membership.md
|
||||
*
|
||||
* @param string $teamId
|
||||
* @param string $email
|
||||
|
@ -185,8 +164,7 @@ class Teams extends Service
|
|||
/**
|
||||
* Delete Team Membership
|
||||
*
|
||||
* This endpoint allows a user to leave a team or for a team owner to delete
|
||||
* the membership of any other team member.
|
||||
* /docs/references/teams/delete-team-membership.md
|
||||
*
|
||||
* @param string $teamId
|
||||
* @param string $inviteId
|
||||
|
@ -206,8 +184,7 @@ class Teams extends Service
|
|||
/**
|
||||
* Create Team Membership (Resend)
|
||||
*
|
||||
* Use this endpoint to resend your invitation email for a user to join a
|
||||
* team.
|
||||
* /docs/references/teams/create-team-membership-resend.md
|
||||
*
|
||||
* @param string $teamId
|
||||
* @param string $inviteId
|
||||
|
@ -229,21 +206,7 @@ class Teams extends Service
|
|||
/**
|
||||
* Update Team Membership Status
|
||||
*
|
||||
* Use this endpoint to let user accept an invitation to join a team after he
|
||||
* is being redirect back to your app from the invitation email. Use the
|
||||
* success and failure URL's to redirect users back to your application after
|
||||
* the request completes.
|
||||
*
|
||||
* Please notice that in order to avoid a [Redirect
|
||||
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
* the only valid redirect URL's are the once from domains you have set when
|
||||
* added your platforms in the console interface.
|
||||
*
|
||||
* When not using the success or failure redirect arguments this endpoint will
|
||||
* result with a 200 status code on success and with 401 status error on
|
||||
* failure. This behavior was applied to help the web clients deal with
|
||||
* browsers who don't allow to set 3rd party HTTP cookies needed for saving
|
||||
* the account session token.
|
||||
* /docs/references/teams/update-team-membership-status.md
|
||||
*
|
||||
* @param string $teamId
|
||||
* @param string $inviteId
|
||||
|
|
|
@ -11,8 +11,7 @@ class Users extends Service
|
|||
/**
|
||||
* List Users
|
||||
*
|
||||
* Get a list of all the project users. You can use the query params to filter
|
||||
* your results.
|
||||
* /docs/references/users/list-users.md
|
||||
*
|
||||
* @param string $search
|
||||
* @param integer $limit
|
||||
|
@ -38,7 +37,7 @@ class Users extends Service
|
|||
/**
|
||||
* Create User
|
||||
*
|
||||
* Create a new user.
|
||||
* /docs/references/users/create-user.md
|
||||
*
|
||||
* @param string $email
|
||||
* @param string $password
|
||||
|
@ -62,7 +61,7 @@ class Users extends Service
|
|||
/**
|
||||
* Get User
|
||||
*
|
||||
* Get user by its unique ID.
|
||||
* /docs/references/users/get-user.md
|
||||
*
|
||||
* @param string $userId
|
||||
* @throws Exception
|
||||
|
@ -81,7 +80,7 @@ class Users extends Service
|
|||
/**
|
||||
* Get User Logs
|
||||
*
|
||||
* Get user activity logs list by its unique ID.
|
||||
* /docs/references/users/get-user-logs.md
|
||||
*
|
||||
* @param string $userId
|
||||
* @throws Exception
|
||||
|
@ -100,7 +99,7 @@ class Users extends Service
|
|||
/**
|
||||
* Get User Prefs
|
||||
*
|
||||
* Get user preferences by its unique ID.
|
||||
* /docs/references/users/get-user-prefs.md
|
||||
*
|
||||
* @param string $userId
|
||||
* @throws Exception
|
||||
|
@ -116,10 +115,31 @@ class Users extends Service
|
|||
], $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Account Prefs
|
||||
*
|
||||
* /docs/references/users/update-user-prefs.md
|
||||
*
|
||||
* @param string $userId
|
||||
* @param string $prefs
|
||||
* @throws Exception
|
||||
* @return array
|
||||
*/
|
||||
public function updateUserPrefs($userId, $prefs)
|
||||
{
|
||||
$path = str_replace(['{userId}'], [$userId], '/users/{userId}/prefs');
|
||||
$params = [];
|
||||
|
||||
$params['prefs'] = $prefs;
|
||||
|
||||
return $this->client->call(Client::METHOD_PATCH, $path, [
|
||||
], $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get User Sessions
|
||||
*
|
||||
* Get user sessions list by its unique ID.
|
||||
* /docs/references/users/get-user-sessions.md
|
||||
*
|
||||
* @param string $userId
|
||||
* @throws Exception
|
||||
|
@ -157,14 +177,14 @@ class Users extends Service
|
|||
/**
|
||||
* Delete User Session
|
||||
*
|
||||
* Delete user sessions by its unique ID.
|
||||
* /docs/references/users/delete-user-session.md
|
||||
*
|
||||
* @param string $userId
|
||||
* @param string $sessionId
|
||||
* @throws Exception
|
||||
* @return array
|
||||
*/
|
||||
public function deleteUsersSession($userId, $sessionId)
|
||||
public function deleteUserSession($userId, $sessionId)
|
||||
{
|
||||
$path = str_replace(['{userId}'], [$userId], '/users/{userId}/sessions/:session');
|
||||
$params = [];
|
||||
|
@ -178,7 +198,7 @@ class Users extends Service
|
|||
/**
|
||||
* Update user status
|
||||
*
|
||||
* Update user status by its unique ID.
|
||||
* /docs/references/users/update-user-status.md
|
||||
*
|
||||
* @param string $userId
|
||||
* @param string $status
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Appwrite SDK for Python
|
||||
|
||||
![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-latest-blue.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-0.2.0-blue.svg?v=1)
|
||||
|
||||
**WORK IN PROGRESS - NOT READY FOR USAGE - Want to help us improve this client SDK? Send a pull request to Appwrite [SDK generator repository](https://github.com/appwrite/sdk-generator).**
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import requests
|
|||
class Client:
|
||||
def __init__(self):
|
||||
self._self_signed = False
|
||||
self._endpoint = 'https://https://appwrite.io/v1'
|
||||
self._endpoint = 'https://appwrite.io/v1'
|
||||
self._global_headers = {
|
||||
'content-type': '',
|
||||
'x-sdk-version': 'appwrite:python:1.0.0',
|
||||
|
|
|
@ -58,6 +58,17 @@ class Users(Service):
|
|||
return self.client.call('get', path, {
|
||||
}, params)
|
||||
|
||||
def update_user_prefs(self, user_id, prefs):
|
||||
"""Update Account Prefs"""
|
||||
|
||||
params = {}
|
||||
path = '/users/{userId}/prefs'
|
||||
path.replace('{userId}', user_id)
|
||||
params['prefs'] = prefs
|
||||
|
||||
return self.client.call('patch', path, {
|
||||
}, params)
|
||||
|
||||
def get_user_sessions(self, user_id):
|
||||
"""Get User Sessions"""
|
||||
|
||||
|
@ -78,7 +89,7 @@ class Users(Service):
|
|||
return self.client.call('delete', path, {
|
||||
}, params)
|
||||
|
||||
def delete_users_session(self, user_id, session_id):
|
||||
def delete_user_session(self, user_id, session_id):
|
||||
"""Delete User Session"""
|
||||
|
||||
params = {}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Appwrite SDK for Ruby
|
||||
|
||||
![License](https://img.shields.io/github/license/appwrite/sdk-for-ruby.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-latest-blue.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-0.2.0-blue.svg?v=1)
|
||||
|
||||
**WORK IN PROGRESS - NOT READY FOR USAGE - Want to help us improve this client SDK? Send a pull request to Appwrite [SDK generator repository](https://github.com/appwrite/sdk-generator).**
|
||||
|
||||
|
|
|
@ -61,6 +61,18 @@ module Appwrite
|
|||
}, params);
|
||||
end
|
||||
|
||||
def update_user_prefs(user_id:, prefs:)
|
||||
path = '/users/{userId}/prefs'
|
||||
.gsub('{user_id}', user_id)
|
||||
|
||||
params = {
|
||||
'prefs': prefs
|
||||
}
|
||||
|
||||
return @client.call('patch', path, {
|
||||
}, params);
|
||||
end
|
||||
|
||||
def get_user_sessions(user_id:)
|
||||
path = '/users/{userId}/sessions'
|
||||
.gsub('{user_id}', user_id)
|
||||
|
@ -83,7 +95,7 @@ module Appwrite
|
|||
}, params);
|
||||
end
|
||||
|
||||
def delete_users_session(user_id:, session_id:)
|
||||
def delete_user_session(user_id:, session_id:)
|
||||
path = '/users/{userId}/sessions/:session'
|
||||
.gsub('{user_id}', user_id)
|
||||
|
||||
|
|
28
composer.lock
generated
28
composer.lock
generated
|
@ -12,12 +12,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/appwrite/sdk-for-php.git",
|
||||
"reference": "ab0fe8f5669e6a8fc7a8d5e8c711f939412fb33e"
|
||||
"reference": "546b96a443162464f7496beb5e77c837a4380a29"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/ab0fe8f5669e6a8fc7a8d5e8c711f939412fb33e",
|
||||
"reference": "ab0fe8f5669e6a8fc7a8d5e8c711f939412fb33e",
|
||||
"url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/546b96a443162464f7496beb5e77c837a4380a29",
|
||||
"reference": "546b96a443162464f7496beb5e77c837a4380a29",
|
||||
"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-10-03T22:07:26+00:00"
|
||||
"time": "2019-10-04T05:52:03+00:00"
|
||||
},
|
||||
{
|
||||
"name": "appwrite/php-clamav",
|
||||
|
@ -92,7 +92,7 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/appwrite/sdk-generator",
|
||||
"reference": "0ece44cf81c04ebb8784a60830b088238189ec78"
|
||||
"reference": "7a1fa9d9612663d3f57d11c7c08fd61eb748dbc1"
|
||||
},
|
||||
"require": {
|
||||
"ext-curl": "*",
|
||||
|
@ -122,7 +122,7 @@
|
|||
}
|
||||
],
|
||||
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
|
||||
"time": "2019-10-04 05:50:53"
|
||||
"time": "2019-10-09 03:51:24"
|
||||
},
|
||||
{
|
||||
"name": "bacon/bacon-qr-code",
|
||||
|
@ -1440,12 +1440,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/twigphp/Twig.git",
|
||||
"reference": "4625774716e3737580e407a02e53ff4defd3cdfa"
|
||||
"reference": "23419a940881f50525515726eec7507792ace5e0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/4625774716e3737580e407a02e53ff4defd3cdfa",
|
||||
"reference": "4625774716e3737580e407a02e53ff4defd3cdfa",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/23419a940881f50525515726eec7507792ace5e0",
|
||||
"reference": "23419a940881f50525515726eec7507792ace5e0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -1499,7 +1499,7 @@
|
|||
"keywords": [
|
||||
"templating"
|
||||
],
|
||||
"time": "2019-10-01T10:31:38+00:00"
|
||||
"time": "2019-10-05T16:44:39+00:00"
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/abuse",
|
||||
|
@ -2409,12 +2409,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
|
||||
"reference": "995192df77f63a59e47f025390d2d1fdf8f425ff"
|
||||
"reference": "36bdcb91de0484f77e256fd3d6119dcf7171c164"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff",
|
||||
"reference": "995192df77f63a59e47f025390d2d1fdf8f425ff",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/36bdcb91de0484f77e256fd3d6119dcf7171c164",
|
||||
"reference": "36bdcb91de0484f77e256fd3d6119dcf7171c164",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -2450,7 +2450,7 @@
|
|||
"keywords": [
|
||||
"tokenizer"
|
||||
],
|
||||
"time": "2019-09-17T06:23:10+00:00"
|
||||
"time": "2019-10-05T05:20:56+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit",
|
||||
|
|
353
public/dist/scripts/app-all.js
vendored
353
public/dist/scripts/app-all.js
vendored
|
@ -1,11 +1,11 @@
|
|||
|
||||
(function(window){window.Appwrite=function(){let config={endpoint:'https://appwrite.test/v1',project:'',key:'',locale:'',mode:'',};let setEndpoint=function(endpoint){config.endpoint=endpoint;return this;};let setProject=function(value)
|
||||
(function(window){'use strict';window.Appwrite=function(){let config={endpoint:'https://appwrite.io/v1',project:'',key:'',locale:'',mode:'',};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 setKey=function(value)
|
||||
{http.addGlobalHeader('X-Appwrite-Key',value);config.key=value;return this;};let setLocale=function(value)
|
||||
{http.addGlobalHeader('X-Appwrite-Locale',value);config.locale=value;return this;};let setMode=function(value)
|
||||
{http.addGlobalHeader('X-Appwrite-Mode',value);config.mode=value;return this;};let http=function(document){let globalParams=[],globalHeaders=[];let addParam=function(url,param,value){let a=document.createElement('a'),regex=/(?:\?|&|&)+([^=]+)(?:=([^&]*))*/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.21');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:0.0.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);}
|
||||
|
@ -17,98 +17,213 @@ request.setRequestHeader(key,headers[key]);}}
|
|||
request.onload=function(){if(4===request.readyState&&399>=request.status){let data=request.response;let contentType=this.getResponseHeader('content-type')||'';contentType=contentType.substring(0,contentType.indexOf(';'));switch(contentType){case'application/json':data=JSON.parse(data);break;}
|
||||
resolve(data);}else{reject(new Error(request.statusText));}};if(progress){request.addEventListener('progress',progress);request.upload.addEventListener('progress',progress,false);}
|
||||
request.onerror=function(){reject(new Error("Network Error"));};request.send(params);})};return{'get':function(path,headers={},params={}){return call('GET',path+((Object.keys(params).length>0)?'?'+buildQuery(params):''),headers,{});},'post':function(path,headers={},params={},progress=null){return call('POST',path,headers,params,progress);},'put':function(path,headers={},params={},progress=null){return call('PUT',path,headers,params,progress);},'patch':function(path,headers={},params={},progress=null){return call('PATCH',path,headers,params,progress);},'delete':function(path,headers={},params={},progress=null){return call('DELETE',path,headers,params,progress);},'addGlobalParam':addGlobalParam,'addGlobalHeader':addGlobalHeader}}(window.document);let iframe=function(method,url,params){let form=document.createElement('form');form.setAttribute('method',method);form.setAttribute('action',config.endpoint+url);for(let key in params){if(params.hasOwnProperty(key)){let hiddenField=document.createElement("input");hiddenField.setAttribute("type","hidden");hiddenField.setAttribute("name",key);hiddenField.setAttribute("value",params[key]);form.appendChild(hiddenField);}}
|
||||
document.body.appendChild(form);return form.submit();};let account={get:function(){let path='/account';return http.get(path,{'content-type':'application/json'},{});},delete:function(){let path='/account';return http.delete(path,{'content-type':'application/json'},{});},updateEmail:function(email,password){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
document.body.appendChild(form);return form.submit();};let account={get:function(){let path='/account';let payload={};return http.get(path,{'content-type':'application/json'},payload);},delete:function(){let path='/account';let payload={};return http.delete(path,{'content-type':'application/json'},payload);},updateEmail:function(email,password){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
if(password===undefined){throw new Error('Missing required parameter: "password"');}
|
||||
let path='/account/email';return http.patch(path,{'content-type':'application/json'},{'email':email,'password':password});},updateName:function(name){if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/account/name';return http.patch(path,{'content-type':'application/json'},{'name':name});},updatePassword:function(password,oldPassword){if(password===undefined){throw new Error('Missing required parameter: "password"');}
|
||||
let path='/account/email';let payload={};if(email){payload['email']=email;}
|
||||
if(password){payload['password']=password;}
|
||||
return http.patch(path,{'content-type':'application/json'},payload);},updateName:function(name){if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/account/name';let payload={};if(name){payload['name']=name;}
|
||||
return http.patch(path,{'content-type':'application/json'},payload);},updatePassword:function(password,oldPassword){if(password===undefined){throw new Error('Missing required parameter: "password"');}
|
||||
if(oldPassword===undefined){throw new Error('Missing required parameter: "oldPassword"');}
|
||||
let path='/account/password';return http.patch(path,{'content-type':'application/json'},{'password':password,'old-password':oldPassword});},getPrefs:function(){let path='/account/prefs';return http.get(path,{'content-type':'application/json'},{});},updatePrefs:function(prefs){if(prefs===undefined){throw new Error('Missing required parameter: "prefs"');}
|
||||
let path='/account/prefs';return http.patch(path,{'content-type':'application/json'},{'prefs':prefs});},getSecurity:function(){let path='/account/security';return http.get(path,{'content-type':'application/json'},{});},getSessions:function(){let path='/account/sessions';return http.get(path,{'content-type':'application/json'},{});}};let auth={login:function(email,password,success,failure){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
let path='/account/password';let payload={};if(password){payload['password']=password;}
|
||||
if(oldPassword){payload['old-password']=oldPassword;}
|
||||
return http.patch(path,{'content-type':'application/json'},payload);},getPrefs:function(){let path='/account/prefs';let payload={};return http.get(path,{'content-type':'application/json'},payload);},updatePrefs:function(prefs){if(prefs===undefined){throw new Error('Missing required parameter: "prefs"');}
|
||||
let path='/account/prefs';let payload={};if(prefs){payload['prefs']=prefs;}
|
||||
return http.patch(path,{'content-type':'application/json'},payload);},getSecurity:function(){let path='/account/security';let payload={};return http.get(path,{'content-type':'application/json'},payload);},getSessions:function(){let path='/account/sessions';let payload={};return http.get(path,{'content-type':'application/json'},payload);}};let auth={login:function(email,password,success,failure){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
if(password===undefined){throw new Error('Missing required parameter: "password"');}
|
||||
if(success===undefined){throw new Error('Missing required parameter: "success"');}
|
||||
if(failure===undefined){throw new Error('Missing required parameter: "failure"');}
|
||||
let path='/auth/login';return iframe('post',path,{project:config.project,'email':email,'password':password,'success':success,'failure':failure});},logout:function(){let path='/auth/logout';return http.delete(path,{'content-type':'application/json'},{});},logoutBySession:function(id){if(id===undefined){throw new Error('Missing required parameter: "id"');}
|
||||
let path='/auth/logout/{id}'.replace(new RegExp('{id}','g'),id);return http.delete(path,{'content-type':'application/json'},{});},oauthCallback:function(projectId,provider,code,state=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(provider===undefined){throw new Error('Missing required parameter: "provider"');}
|
||||
if(code===undefined){throw new Error('Missing required parameter: "code"');}
|
||||
let path='/auth/oauth/callback/{provider}/{projectId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{provider}','g'),provider);return http.get(path,{'content-type':'application/json'},{'code':code,'state':state});},oauth:function(provider,success='',failure=''){if(provider===undefined){throw new Error('Missing required parameter: "provider"');}
|
||||
let path='/auth/oauth/{provider}'.replace(new RegExp('{provider}','g'),provider);return http.get(path,{'content-type':'application/json'},{'success':success,'failure':failure});},recovery:function(email,redirect){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
if(redirect===undefined){throw new Error('Missing required parameter: "redirect"');}
|
||||
let path='/auth/recovery';return http.post(path,{'content-type':'application/json'},{'email':email,'redirect':redirect});},recoveryReset:function(userId,token,passwordA,passwordB){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/auth/login';let payload={};if(email){payload['email']=email;}
|
||||
if(password){payload['password']=password;}
|
||||
if(success){payload['success']=success;}
|
||||
if(failure){payload['failure']=failure;}
|
||||
payload['project']=config.project;return iframe('post',path,payload);},logout:function(){let path='/auth/logout';let payload={};return http.delete(path,{'content-type':'application/json'},payload);},logoutBySession:function(id){if(id===undefined){throw new Error('Missing required parameter: "id"');}
|
||||
let path='/auth/logout/{id}'.replace(new RegExp('{id}','g'),id);let payload={};return http.delete(path,{'content-type':'application/json'},payload);},oauth:function(provider,success='',failure=''){if(provider===undefined){throw new Error('Missing required parameter: "provider"');}
|
||||
let path='/auth/oauth/{provider}'.replace(new RegExp('{provider}','g'),provider);let payload={};if(success){payload['success']=success;}
|
||||
if(failure){payload['failure']=failure;}
|
||||
return http.get(path,{'content-type':'application/json'},payload);},recovery:function(email,reset){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
if(reset===undefined){throw new Error('Missing required parameter: "reset"');}
|
||||
let path='/auth/recovery';let payload={};if(email){payload['email']=email;}
|
||||
if(reset){payload['reset']=reset;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},recoveryReset:function(userId,token,passwordA,passwordB){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
if(token===undefined){throw new Error('Missing required parameter: "token"');}
|
||||
if(passwordA===undefined){throw new Error('Missing required parameter: "passwordA"');}
|
||||
if(passwordB===undefined){throw new Error('Missing required parameter: "passwordB"');}
|
||||
let path='/auth/recovery/reset';return http.put(path,{'content-type':'application/json'},{'userId':userId,'token':token,'password-a':passwordA,'password-b':passwordB});},register:function(email,password,confirm,success,failure,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
let path='/auth/recovery/reset';let payload={};if(userId){payload['userId']=userId;}
|
||||
if(token){payload['token']=token;}
|
||||
if(passwordA){payload['password-a']=passwordA;}
|
||||
if(passwordB){payload['password-b']=passwordB;}
|
||||
return http.put(path,{'content-type':'application/json'},payload);},register:function(email,password,confirm,success='',failure='',name=''){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
if(password===undefined){throw new Error('Missing required parameter: "password"');}
|
||||
if(confirm===undefined){throw new Error('Missing required parameter: "confirm"');}
|
||||
if(success===undefined){throw new Error('Missing required parameter: "success"');}
|
||||
if(failure===undefined){throw new Error('Missing required parameter: "failure"');}
|
||||
let path='/auth/register';return iframe('post',path,{project:config.project,'email':email,'password':password,'confirm':confirm,'success':success,'failure':failure,'name':name});},confirm:function(userId,token){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/auth/register';let payload={};if(email){payload['email']=email;}
|
||||
if(password){payload['password']=password;}
|
||||
if(confirm){payload['confirm']=confirm;}
|
||||
if(success){payload['success']=success;}
|
||||
if(failure){payload['failure']=failure;}
|
||||
if(name){payload['name']=name;}
|
||||
payload['project']=config.project;return iframe('post',path,payload);},confirm:function(userId,token){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
if(token===undefined){throw new Error('Missing required parameter: "token"');}
|
||||
let path='/auth/register/confirm';return http.post(path,{'content-type':'application/json'},{'userId':userId,'token':token});},confirmResend:function(confirm){if(confirm===undefined){throw new Error('Missing required parameter: "confirm"');}
|
||||
let path='/auth/register/confirm/resend';return http.post(path,{'content-type':'application/json'},{'confirm':confirm});}};let avatars={getBrowser:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"');}
|
||||
let path='/avatars/browsers/{code}'.replace(new RegExp('{code}','g'),code);return http.get(path,{'content-type':'application/json'},{'width':width,'height':height,'quality':quality});},getCreditCard:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"');}
|
||||
let path='/avatars/credit-cards/{code}'.replace(new RegExp('{code}','g'),code);return http.get(path,{'content-type':'application/json'},{'width':width,'height':height,'quality':quality});},getFavicon:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
let path='/avatars/favicon';return http.get(path,{'content-type':'application/json'},{'url':url});},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);return http.get(path,{'content-type':'application/json'},{'width':width,'height':height,'quality':quality});},getImage:function(url,width=400,height=400){if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
let path='/avatars/image';return http.get(path,{'content-type':'application/json'},{'url':url,'width':width,'height':height});},getQR:function(text,size=400,margin=1,download=0){if(text===undefined){throw new Error('Missing required parameter: "text"');}
|
||||
let path='/avatars/qr';return http.get(path,{'content-type':'application/json'},{'text':text,'size':size,'margin':margin,'download':download});}};let database={listCollections:function(search='',limit=25,offset=0,orderType='ASC'){let path='/database';return http.get(path,{'content-type':'application/json'},{'search':search,'limit':limit,'offset':offset,'orderType':orderType});},createCollection:function(name,read=[],write=[],rules=[]){if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/database';return http.post(path,{'content-type':'application/json'},{'name':name,'read':read,'write':write,'rules':rules});},getCollection:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);return http.get(path,{'content-type':'application/json'},{});},updateCollection:function(collectionId,name,read=[],write=[],rules=[]){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/auth/register/confirm';let payload={};if(userId){payload['userId']=userId;}
|
||||
if(token){payload['token']=token;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},confirmResend:function(confirm){if(confirm===undefined){throw new Error('Missing required parameter: "confirm"');}
|
||||
let path='/auth/register/confirm/resend';let payload={};if(confirm){payload['confirm']=confirm;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);}};let avatars={getBrowser:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"');}
|
||||
let path='/avatars/browsers/{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);},getCreditCard:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"');}
|
||||
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"');}
|
||||
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"');}
|
||||
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"');}
|
||||
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"');}
|
||||
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';let payload={};if(search){payload['search']=search;}
|
||||
if(limit){payload['limit']=limit;}
|
||||
if(offset){payload['offset']=offset;}
|
||||
if(orderType){payload['orderType']=orderType;}
|
||||
return http.get(path,{'content-type':'application/json'},payload);},createCollection:function(name,read=[],write=[],rules=[]){if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/database';let payload={};if(name){payload['name']=name;}
|
||||
if(read){payload['read']=read;}
|
||||
if(write){payload['write']=write;}
|
||||
if(rules){payload['rules']=rules;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},getCollection:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},updateCollection:function(collectionId,name,read=[],write=[],rules=[]){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/database/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);return http.put(path,{'content-type':'application/json'},{'name':name,'read':read,'write':write,'rules':rules});},deleteCollection:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);return http.delete(path,{'content-type':'application/json'},{});},listDocuments:function(collectionId,filters=[],offset=0,limit=50,orderField='$uid',orderType='ASC',orderCast='string',search='',first=0,last=0){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/{collectionId}/documents'.replace(new RegExp('{collectionId}','g'),collectionId);return http.get(path,{'content-type':'application/json'},{'filters':filters,'offset':offset,'limit':limit,'order-field':orderField,'order-type':orderType,'order-cast':orderCast,'search':search,'first':first,'last':last});},createDocument:function(collectionId,data,read=[],write=[],parentDocument='',parentProperty='',parentPropertyType='assign'){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};if(name){payload['name']=name;}
|
||||
if(read){payload['read']=read;}
|
||||
if(write){payload['write']=write;}
|
||||
if(rules){payload['rules']=rules;}
|
||||
return http.put(path,{'content-type':'application/json'},payload);},deleteCollection:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};return http.delete(path,{'content-type':'application/json'},payload);},listDocuments:function(collectionId,filters=[],offset=0,limit=50,orderField='$uid',orderType='ASC',orderCast='string',search='',first=0,last=0){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/{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;}
|
||||
if(orderField){payload['order-field']=orderField;}
|
||||
if(orderType){payload['order-type']=orderType;}
|
||||
if(orderCast){payload['order-cast']=orderCast;}
|
||||
if(search){payload['search']=search;}
|
||||
if(first){payload['first']=first;}
|
||||
if(last){payload['last']=last;}
|
||||
return http.get(path,{'content-type':'application/json'},payload);},createDocument:function(collectionId,data,read=[],write=[],parentDocument='',parentProperty='',parentPropertyType='assign'){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
if(data===undefined){throw new Error('Missing required parameter: "data"');}
|
||||
let path='/database/{collectionId}/documents'.replace(new RegExp('{collectionId}','g'),collectionId);return http.post(path,{'content-type':'application/json'},{'data':data,'read':read,'write':write,'parentDocument':parentDocument,'parentProperty':parentProperty,'parentPropertyType':parentPropertyType});},getDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/{collectionId}/documents'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};if(data){payload['data']=data;}
|
||||
if(read){payload['read']=read;}
|
||||
if(write){payload['write']=write;}
|
||||
if(parentDocument){payload['parentDocument']=parentDocument;}
|
||||
if(parentProperty){payload['parentProperty']=parentProperty;}
|
||||
if(parentPropertyType){payload['parentPropertyType']=parentPropertyType;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},getDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
if(documentId===undefined){throw new Error('Missing required parameter: "documentId"');}
|
||||
let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);return http.get(path,{'content-type':'application/json'},{});},updateDocument:function(collectionId,documentId,data,read=[],write=[]){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},updateDocument:function(collectionId,documentId,data,read=[],write=[]){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
if(documentId===undefined){throw new Error('Missing required parameter: "documentId"');}
|
||||
if(data===undefined){throw new Error('Missing required parameter: "data"');}
|
||||
let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);return http.patch(path,{'content-type':'application/json'},{'data':data,'read':read,'write':write});},deleteDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};if(data){payload['data']=data;}
|
||||
if(read){payload['read']=read;}
|
||||
if(write){payload['write']=write;}
|
||||
return http.patch(path,{'content-type':'application/json'},payload);},deleteDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
if(documentId===undefined){throw new Error('Missing required parameter: "documentId"');}
|
||||
let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);return http.delete(path,{'content-type':'application/json'},{});}};let locale={getLocale:function(){let path='/locale';return http.get(path,{'content-type':'application/json'},{});},getCountries:function(){let path='/locale/countries';return http.get(path,{'content-type':'application/json'},{});},getCountriesEU:function(){let path='/locale/countries/eu';return http.get(path,{'content-type':'application/json'},{});},getCountriesPhones:function(){let path='/locale/countries/phones';return http.get(path,{'content-type':'application/json'},{});},getCurrencies:function(){let path='/locale/currencies';return http.get(path,{'content-type':'application/json'},{});}};let projects={listProjects:function(){let path='/projects';return http.get(path,{'content-type':'application/json'},{});},createProject:function(name,teamId,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};return http.delete(path,{'content-type':'application/json'},payload);}};let locale={getLocale:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json'},payload);},getCountries:function(){let path='/locale/countries';let payload={};return http.get(path,{'content-type':'application/json'},payload);},getCountriesEU:function(){let path='/locale/countries/eu';let payload={};return http.get(path,{'content-type':'application/json'},payload);},getCountriesPhones:function(){let path='/locale/countries/phones';let payload={};return http.get(path,{'content-type':'application/json'},payload);},getCurrencies:function(){let path='/locale/currencies';let payload={};return http.get(path,{'content-type':'application/json'},payload);}};let projects={listProjects:function(){let path='/projects';let payload={};return http.get(path,{'content-type':'application/json'},payload);},createProject:function(name,teamId,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/projects';return http.post(path,{'content-type':'application/json'},{'name':name,'teamId':teamId,'description':description,'logo':logo,'url':url,'legalName':legalName,'legalCountry':legalCountry,'legalState':legalState,'legalCity':legalCity,'legalAddress':legalAddress,'legalTaxId':legalTaxId});},getProject:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{});},updateProject:function(projectId,name,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects';let payload={};if(name){payload['name']=name;}
|
||||
if(teamId){payload['teamId']=teamId;}
|
||||
if(description){payload['description']=description;}
|
||||
if(logo){payload['logo']=logo;}
|
||||
if(url){payload['url']=url;}
|
||||
if(legalName){payload['legalName']=legalName;}
|
||||
if(legalCountry){payload['legalCountry']=legalCountry;}
|
||||
if(legalState){payload['legalState']=legalState;}
|
||||
if(legalCity){payload['legalCity']=legalCity;}
|
||||
if(legalAddress){payload['legalAddress']=legalAddress;}
|
||||
if(legalTaxId){payload['legalTaxId']=legalTaxId;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},getProject:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},updateProject:function(projectId,name,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);return http.patch(path,{'content-type':'application/json'},{'name':name,'description':description,'logo':logo,'url':url,'legalName':legalName,'legalCountry':legalCountry,'legalState':legalState,'legalCity':legalCity,'legalAddress':legalAddress,'legalTaxId':legalTaxId});},deleteProject:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);return http.delete(path,{'content-type':'application/json'},{});},listKeys:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/keys'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{});},createKey:function(projectId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload['name']=name;}
|
||||
if(description){payload['description']=description;}
|
||||
if(logo){payload['logo']=logo;}
|
||||
if(url){payload['url']=url;}
|
||||
if(legalName){payload['legalName']=legalName;}
|
||||
if(legalCountry){payload['legalCountry']=legalCountry;}
|
||||
if(legalState){payload['legalState']=legalState;}
|
||||
if(legalCity){payload['legalCity']=legalCity;}
|
||||
if(legalAddress){payload['legalAddress']=legalAddress;}
|
||||
if(legalTaxId){payload['legalTaxId']=legalTaxId;}
|
||||
return http.patch(path,{'content-type':'application/json'},payload);},deleteProject:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.delete(path,{'content-type':'application/json'},payload);},listKeys:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/keys'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},createKey:function(projectId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
if(scopes===undefined){throw new Error('Missing required parameter: "scopes"');}
|
||||
let path='/projects/{projectId}/keys'.replace(new RegExp('{projectId}','g'),projectId);return http.post(path,{'content-type':'application/json'},{'name':name,'scopes':scopes});},getKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/keys'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload['name']=name;}
|
||||
if(scopes){payload['scopes']=scopes;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},getKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(keyId===undefined){throw new Error('Missing required parameter: "keyId"');}
|
||||
let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);return http.get(path,{'content-type':'application/json'},{});},updateKey:function(projectId,keyId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},updateKey:function(projectId,keyId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(keyId===undefined){throw new Error('Missing required parameter: "keyId"');}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
if(scopes===undefined){throw new Error('Missing required parameter: "scopes"');}
|
||||
let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);return http.put(path,{'content-type':'application/json'},{'name':name,'scopes':scopes});},deleteKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};if(name){payload['name']=name;}
|
||||
if(scopes){payload['scopes']=scopes;}
|
||||
return http.put(path,{'content-type':'application/json'},payload);},deleteKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(keyId===undefined){throw new Error('Missing required parameter: "keyId"');}
|
||||
let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);return http.delete(path,{'content-type':'application/json'},{});},updateProjectOAuth:function(projectId,provider,appId='',secret=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};return http.delete(path,{'content-type':'application/json'},payload);},updateProjectOAuth:function(projectId,provider,appId='',secret=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(provider===undefined){throw new Error('Missing required parameter: "provider"');}
|
||||
let path='/projects/{projectId}/oauth'.replace(new RegExp('{projectId}','g'),projectId);return http.patch(path,{'content-type':'application/json'},{'provider':provider,'appId':appId,'secret':secret});},listPlatforms:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/platforms'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{});},createPlatform:function(projectId,type,name,key='',store='',url=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/oauth'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(provider){payload['provider']=provider;}
|
||||
if(appId){payload['appId']=appId;}
|
||||
if(secret){payload['secret']=secret;}
|
||||
return http.patch(path,{'content-type':'application/json'},payload);},listPlatforms:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/platforms'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},createPlatform:function(projectId,type,name,key='',store='',url=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(type===undefined){throw new Error('Missing required parameter: "type"');}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/projects/{projectId}/platforms'.replace(new RegExp('{projectId}','g'),projectId);return http.post(path,{'content-type':'application/json'},{'type':type,'name':name,'key':key,'store':store,'url':url});},getPlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/platforms'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(type){payload['type']=type;}
|
||||
if(name){payload['name']=name;}
|
||||
if(key){payload['key']=key;}
|
||||
if(store){payload['store']=store;}
|
||||
if(url){payload['url']=url;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},getPlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(platformId===undefined){throw new Error('Missing required parameter: "platformId"');}
|
||||
let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);return http.get(path,{'content-type':'application/json'},{});},updatePlatform:function(projectId,platformId,name,key='',store='',url=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},updatePlatform:function(projectId,platformId,name,key='',store='',url=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(platformId===undefined){throw new Error('Missing required parameter: "platformId"');}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);return http.put(path,{'content-type':'application/json'},{'name':name,'key':key,'store':store,'url':url});},deletePlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};if(name){payload['name']=name;}
|
||||
if(key){payload['key']=key;}
|
||||
if(store){payload['store']=store;}
|
||||
if(url){payload['url']=url;}
|
||||
return http.put(path,{'content-type':'application/json'},payload);},deletePlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(platformId===undefined){throw new Error('Missing required parameter: "platformId"');}
|
||||
let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);return http.delete(path,{'content-type':'application/json'},{});},listTasks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/tasks'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{});},createTask:function(projectId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};return http.delete(path,{'content-type':'application/json'},payload);},listTasks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/tasks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},createTask:function(projectId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
if(status===undefined){throw new Error('Missing required parameter: "status"');}
|
||||
if(schedule===undefined){throw new Error('Missing required parameter: "schedule"');}
|
||||
if(security===undefined){throw new Error('Missing required parameter: "security"');}
|
||||
if(httpMethod===undefined){throw new Error('Missing required parameter: "httpMethod"');}
|
||||
if(httpUrl===undefined){throw new Error('Missing required parameter: "httpUrl"');}
|
||||
let path='/projects/{projectId}/tasks'.replace(new RegExp('{projectId}','g'),projectId);return http.post(path,{'content-type':'application/json'},{'name':name,'status':status,'schedule':schedule,'security':security,'httpMethod':httpMethod,'httpUrl':httpUrl,'httpHeaders':httpHeaders,'httpUser':httpUser,'httpPass':httpPass});},getTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/tasks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload['name']=name;}
|
||||
if(status){payload['status']=status;}
|
||||
if(schedule){payload['schedule']=schedule;}
|
||||
if(security){payload['security']=security;}
|
||||
if(httpMethod){payload['httpMethod']=httpMethod;}
|
||||
if(httpUrl){payload['httpUrl']=httpUrl;}
|
||||
if(httpHeaders){payload['httpHeaders']=httpHeaders;}
|
||||
if(httpUser){payload['httpUser']=httpUser;}
|
||||
if(httpPass){payload['httpPass']=httpPass;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},getTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(taskId===undefined){throw new Error('Missing required parameter: "taskId"');}
|
||||
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);return http.get(path,{'content-type':'application/json'},{});},updateTask:function(projectId,taskId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},updateTask:function(projectId,taskId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(taskId===undefined){throw new Error('Missing required parameter: "taskId"');}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
if(status===undefined){throw new Error('Missing required parameter: "status"');}
|
||||
|
@ -116,63 +231,129 @@ if(schedule===undefined){throw new Error('Missing required parameter: "schedule"
|
|||
if(security===undefined){throw new Error('Missing required parameter: "security"');}
|
||||
if(httpMethod===undefined){throw new Error('Missing required parameter: "httpMethod"');}
|
||||
if(httpUrl===undefined){throw new Error('Missing required parameter: "httpUrl"');}
|
||||
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);return http.put(path,{'content-type':'application/json'},{'name':name,'status':status,'schedule':schedule,'security':security,'httpMethod':httpMethod,'httpUrl':httpUrl,'httpHeaders':httpHeaders,'httpUser':httpUser,'httpPass':httpPass});},deleteTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};if(name){payload['name']=name;}
|
||||
if(status){payload['status']=status;}
|
||||
if(schedule){payload['schedule']=schedule;}
|
||||
if(security){payload['security']=security;}
|
||||
if(httpMethod){payload['httpMethod']=httpMethod;}
|
||||
if(httpUrl){payload['httpUrl']=httpUrl;}
|
||||
if(httpHeaders){payload['httpHeaders']=httpHeaders;}
|
||||
if(httpUser){payload['httpUser']=httpUser;}
|
||||
if(httpPass){payload['httpPass']=httpPass;}
|
||||
return http.put(path,{'content-type':'application/json'},payload);},deleteTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(taskId===undefined){throw new Error('Missing required parameter: "taskId"');}
|
||||
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);return http.delete(path,{'content-type':'application/json'},{});},getProjectUsage:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/usage'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{});},listWebhooks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{});},createWebhook:function(projectId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};return http.delete(path,{'content-type':'application/json'},payload);},getProjectUsage:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/usage'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},listWebhooks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},createWebhook:function(projectId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
if(events===undefined){throw new Error('Missing required parameter: "events"');}
|
||||
if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
if(security===undefined){throw new Error('Missing required parameter: "security"');}
|
||||
let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);return http.post(path,{'content-type':'application/json'},{'name':name,'events':events,'url':url,'security':security,'httpUser':httpUser,'httpPass':httpPass});},getWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload['name']=name;}
|
||||
if(events){payload['events']=events;}
|
||||
if(url){payload['url']=url;}
|
||||
if(security){payload['security']=security;}
|
||||
if(httpUser){payload['httpUser']=httpUser;}
|
||||
if(httpPass){payload['httpPass']=httpPass;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},getWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"');}
|
||||
let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);return http.get(path,{'content-type':'application/json'},{});},updateWebhook:function(projectId,webhookId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},updateWebhook:function(projectId,webhookId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"');}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
if(events===undefined){throw new Error('Missing required parameter: "events"');}
|
||||
if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
if(security===undefined){throw new Error('Missing required parameter: "security"');}
|
||||
let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);return http.put(path,{'content-type':'application/json'},{'name':name,'events':events,'url':url,'security':security,'httpUser':httpUser,'httpPass':httpPass});},deleteWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};if(name){payload['name']=name;}
|
||||
if(events){payload['events']=events;}
|
||||
if(url){payload['url']=url;}
|
||||
if(security){payload['security']=security;}
|
||||
if(httpUser){payload['httpUser']=httpUser;}
|
||||
if(httpPass){payload['httpPass']=httpPass;}
|
||||
return http.put(path,{'content-type':'application/json'},payload);},deleteWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"');}
|
||||
let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);return http.delete(path,{'content-type':'application/json'},{});}};let storage={listFiles:function(search='',limit=25,offset=0,orderType='ASC'){let path='/storage/files';return http.get(path,{'content-type':'application/json'},{'search':search,'limit':limit,'offset':offset,'orderType':orderType});},createFile:function(files,read=[],write=[],folderId=''){if(files===undefined){throw new Error('Missing required parameter: "files"');}
|
||||
let path='/storage/files';return http.post(path,{'content-type':'multipart/form-data'},{'files':files,'read':read,'write':write,'folderId':folderId});},getFile:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);return http.get(path,{'content-type':'application/json'},{});},updateFile:function(fileId,read=[],write=[],folderId=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);return http.put(path,{'content-type':'application/json'},{'read':read,'write':write,'folderId':folderId});},deleteFile:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);return http.delete(path,{'content-type':'application/json'},{});},getFileDownload:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}/download'.replace(new RegExp('{fileId}','g'),fileId);return http.get(path,{'content-type':'application/json'},{});},getFilePreview:function(fileId,width=0,height=0,quality=100,background='',output=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}/preview'.replace(new RegExp('{fileId}','g'),fileId);return http.get(path,{'content-type':'application/json'},{'width':width,'height':height,'quality':quality,'background':background,'output':output});},getFileView:function(fileId,as=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}/view'.replace(new RegExp('{fileId}','g'),fileId);return http.get(path,{'content-type':'application/json'},{'as':as});}};let teams={listTeams:function(search='',limit=25,offset=0,orderType='ASC'){let path='/teams';return http.get(path,{'content-type':'application/json'},{'search':search,'limit':limit,'offset':offset,'orderType':orderType});},createTeam:function(name,roles=["owner"]){if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/teams';return http.post(path,{'content-type':'application/json'},{'name':name,'roles':roles});},getTeam:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);return http.get(path,{'content-type':'application/json'},{});},updateTeam:function(teamId,name){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};return http.delete(path,{'content-type':'application/json'},payload);}};let storage={listFiles:function(search='',limit=25,offset=0,orderType='ASC'){let path='/storage/files';let payload={};if(search){payload['search']=search;}
|
||||
if(limit){payload['limit']=limit;}
|
||||
if(offset){payload['offset']=offset;}
|
||||
if(orderType){payload['orderType']=orderType;}
|
||||
return http.get(path,{'content-type':'application/json'},payload);},createFile:function(files,read=[],write=[],folderId=''){if(files===undefined){throw new Error('Missing required parameter: "files"');}
|
||||
let path='/storage/files';let payload={};if(files){payload['files']=files;}
|
||||
if(read){payload['read']=read;}
|
||||
if(write){payload['write']=write;}
|
||||
if(folderId){payload['folderId']=folderId;}
|
||||
return http.post(path,{'content-type':'multipart/form-data'},payload);},getFile:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},updateFile:function(fileId,read=[],write=[],folderId=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);let payload={};if(read){payload['read']=read;}
|
||||
if(write){payload['write']=write;}
|
||||
if(folderId){payload['folderId']=folderId;}
|
||||
return http.put(path,{'content-type':'application/json'},payload);},deleteFile:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);let payload={};return http.delete(path,{'content-type':'application/json'},payload);},getFileDownload:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}/download'.replace(new RegExp('{fileId}','g'),fileId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},getFilePreview:function(fileId,width=0,height=0,quality=100,background='',output=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}/preview'.replace(new RegExp('{fileId}','g'),fileId);let payload={};if(width){payload['width']=width;}
|
||||
if(height){payload['height']=height;}
|
||||
if(quality){payload['quality']=quality;}
|
||||
if(background){payload['background']=background;}
|
||||
if(output){payload['output']=output;}
|
||||
return http.get(path,{'content-type':'application/json'},payload);},getFileView:function(fileId,as=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}/view'.replace(new RegExp('{fileId}','g'),fileId);let payload={};if(as){payload['as']=as;}
|
||||
return http.get(path,{'content-type':'application/json'},payload);}};let teams={listTeams:function(search='',limit=25,offset=0,orderType='ASC'){let path='/teams';let payload={};if(search){payload['search']=search;}
|
||||
if(limit){payload['limit']=limit;}
|
||||
if(offset){payload['offset']=offset;}
|
||||
if(orderType){payload['orderType']=orderType;}
|
||||
return http.get(path,{'content-type':'application/json'},payload);},createTeam:function(name,roles=["owner"]){if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/teams';let payload={};if(name){payload['name']=name;}
|
||||
if(roles){payload['roles']=roles;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},getTeam:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},updateTeam:function(teamId,name){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);return http.put(path,{'content-type':'application/json'},{'name':name});},deleteTeam:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);return http.delete(path,{'content-type':'application/json'},{});},getTeamMembers:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}/members'.replace(new RegExp('{teamId}','g'),teamId);return http.get(path,{'content-type':'application/json'},{});},createTeamMembership:function(teamId,email,roles,redirect,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(name){payload['name']=name;}
|
||||
return http.put(path,{'content-type':'application/json'},payload);},deleteTeam:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.delete(path,{'content-type':'application/json'},payload);},getTeamMembers:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}/members'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},createTeamMembership:function(teamId,email,roles,redirect,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
if(roles===undefined){throw new Error('Missing required parameter: "roles"');}
|
||||
if(redirect===undefined){throw new Error('Missing required parameter: "redirect"');}
|
||||
let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);return http.post(path,{'content-type':'application/json'},{'email':email,'name':name,'roles':roles,'redirect':redirect});},deleteTeamMembership:function(teamId,inviteId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(email){payload['email']=email;}
|
||||
if(name){payload['name']=name;}
|
||||
if(roles){payload['roles']=roles;}
|
||||
if(redirect){payload['redirect']=redirect;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},deleteTeamMembership:function(teamId,inviteId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
if(inviteId===undefined){throw new Error('Missing required parameter: "inviteId"');}
|
||||
let path='/teams/{teamId}/memberships/{inviteId}'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);return http.delete(path,{'content-type':'application/json'},{});},createTeamMembershipResend:function(teamId,inviteId,redirect){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}/memberships/{inviteId}'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);let payload={};return http.delete(path,{'content-type':'application/json'},payload);},createTeamMembershipResend:function(teamId,inviteId,redirect){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
if(inviteId===undefined){throw new Error('Missing required parameter: "inviteId"');}
|
||||
if(redirect===undefined){throw new Error('Missing required parameter: "redirect"');}
|
||||
let path='/teams/{teamId}/memberships/{inviteId}/resend'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);return http.post(path,{'content-type':'application/json'},{'redirect':redirect});},updateTeamMembershipStatus:function(teamId,inviteId,userId,secret,success='',failure=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}/memberships/{inviteId}/resend'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);let payload={};if(redirect){payload['redirect']=redirect;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},updateTeamMembershipStatus:function(teamId,inviteId,userId,secret,success='',failure=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
if(inviteId===undefined){throw new Error('Missing required parameter: "inviteId"');}
|
||||
if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
if(secret===undefined){throw new Error('Missing required parameter: "secret"');}
|
||||
let path='/teams/{teamId}/memberships/{inviteId}/status'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);return iframe('patch',path,{project:config.project,'userId':userId,'secret':secret,'success':success,'failure':failure});}};let users={listUsers:function(search='',limit=25,offset=0,orderType='ASC'){let path='/users';return http.get(path,{'content-type':'application/json'},{'search':search,'limit':limit,'offset':offset,'orderType':orderType});},createUser:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
let path='/teams/{teamId}/memberships/{inviteId}/status'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);let payload={};if(userId){payload['userId']=userId;}
|
||||
if(secret){payload['secret']=secret;}
|
||||
if(success){payload['success']=success;}
|
||||
if(failure){payload['failure']=failure;}
|
||||
payload['project']=config.project;return iframe('patch',path,payload);}};let users={listUsers:function(search='',limit=25,offset=0,orderType='ASC'){let path='/users';let payload={};if(search){payload['search']=search;}
|
||||
if(limit){payload['limit']=limit;}
|
||||
if(offset){payload['offset']=offset;}
|
||||
if(orderType){payload['orderType']=orderType;}
|
||||
return http.get(path,{'content-type':'application/json'},payload);},createUser:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
if(password===undefined){throw new Error('Missing required parameter: "password"');}
|
||||
let path='/users';return http.post(path,{'content-type':'application/json'},{'email':email,'password':password,'name':name});},getUser:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users/{userId}'.replace(new RegExp('{userId}','g'),userId);return http.get(path,{'content-type':'application/json'},{});},getUserLogs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users/{userId}/logs'.replace(new RegExp('{userId}','g'),userId);return http.get(path,{'content-type':'application/json'},{});},getUserPrefs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users/{userId}/prefs'.replace(new RegExp('{userId}','g'),userId);return http.get(path,{'content-type':'application/json'},{});},getUserSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);return http.get(path,{'content-type':'application/json'},{});},deleteUserSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);return http.delete(path,{'content-type':'application/json'},{});},deleteUsersSession:function(userId,sessionId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users';let payload={};if(email){payload['email']=email;}
|
||||
if(password){payload['password']=password;}
|
||||
if(name){payload['name']=name;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},getUser:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users/{userId}'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},getUserLogs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users/{userId}/logs'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},getUserPrefs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users/{userId}/prefs'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},updateUserPrefs:function(userId,prefs){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
if(prefs===undefined){throw new Error('Missing required parameter: "prefs"');}
|
||||
let path='/users/{userId}/prefs'.replace(new RegExp('{userId}','g'),userId);let payload={};if(prefs){payload['prefs']=prefs;}
|
||||
return http.patch(path,{'content-type':'application/json'},payload);},getUserSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},deleteUserSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.delete(path,{'content-type':'application/json'},payload);},deleteUserSession:function(userId,sessionId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
if(sessionId===undefined){throw new Error('Missing required parameter: "sessionId"');}
|
||||
let path='/users/{userId}/sessions/:session'.replace(new RegExp('{userId}','g'),userId);return http.delete(path,{'content-type':'application/json'},{'sessionId':sessionId});},updateUserStatus:function(userId,status){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users/{userId}/sessions/:session'.replace(new RegExp('{userId}','g'),userId);let payload={};if(sessionId){payload['sessionId']=sessionId;}
|
||||
return http.delete(path,{'content-type':'application/json'},payload);},updateUserStatus:function(userId,status){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
if(status===undefined){throw new Error('Missing required parameter: "status"');}
|
||||
let path='/users/{userId}/status'.replace(new RegExp('{userId}','g'),userId);return http.patch(path,{'content-type':'application/json'},{'status':status});}};return{setEndpoint:setEndpoint,setProject:setProject,setKey:setKey,setLocale:setLocale,setMode:setMode,account:account,auth:auth,avatars:avatars,database:database,locale:locale,projects:projects,storage:storage,teams:teams,users:users};};})(window);(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Chart=f()}})(function(){var define,module,exports;return(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){var colorNames=require(5);module.exports={getRgba:getRgba,getHsla:getHsla,getRgb:getRgb,getHsl:getHsl,getHwb:getHwb,getAlpha:getAlpha,hexString:hexString,rgbString:rgbString,rgbaString:rgbaString,percentString:percentString,percentaString:percentaString,hslString:hslString,hslaString:hslaString,hwbString:hwbString,keyword:keyword}
|
||||
let path='/users/{userId}/status'.replace(new RegExp('{userId}','g'),userId);let payload={};if(status){payload['status']=status;}
|
||||
return http.patch(path,{'content-type':'application/json'},payload);}};return{setEndpoint:setEndpoint,setProject:setProject,setKey:setKey,setLocale:setLocale,setMode:setMode,account:account,auth:auth,avatars:avatars,database:database,locale:locale,projects:projects,storage:storage,teams:teams,users:users};};if(typeof module!=="undefined"){module.exports=window.Appwrite;}})((typeof window!=="undefined")?window:{});(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Chart=f()}})(function(){var define,module,exports;return(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){var colorNames=require(5);module.exports={getRgba:getRgba,getHsla:getHsla,getRgb:getRgb,getHsl:getHsl,getHwb:getHwb,getAlpha:getAlpha,hexString:hexString,rgbString:rgbString,rgbaString:rgbaString,percentString:percentString,percentaString:percentaString,hslString:hslString,hslaString:hslaString,hwbString:hwbString,keyword:keyword}
|
||||
function getRgba(string){if(!string){return;}
|
||||
var abbr=/^#([a-fA-F0-9]{3})$/i,hex=/^#([a-fA-F0-9]{6})$/i,rgba=/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i,per=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i,keyword=/(\w+)/;var rgb=[0,0,0],a=1,match=string.match(abbr);if(match){match=match[1];for(var i=0;i<rgb.length;i++){rgb[i]=parseInt(match[i]+match[i],16);}}
|
||||
else if(match=string.match(hex)){match=match[1];for(var i=0;i<rgb.length;i++){rgb[i]=parseInt(match.slice(i*2,i*2+2),16);}}
|
||||
|
|
353
public/dist/scripts/app-dep.js
vendored
353
public/dist/scripts/app-dep.js
vendored
|
@ -1,11 +1,11 @@
|
|||
|
||||
(function(window){window.Appwrite=function(){let config={endpoint:'https://appwrite.test/v1',project:'',key:'',locale:'',mode:'',};let setEndpoint=function(endpoint){config.endpoint=endpoint;return this;};let setProject=function(value)
|
||||
(function(window){'use strict';window.Appwrite=function(){let config={endpoint:'https://appwrite.io/v1',project:'',key:'',locale:'',mode:'',};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 setKey=function(value)
|
||||
{http.addGlobalHeader('X-Appwrite-Key',value);config.key=value;return this;};let setLocale=function(value)
|
||||
{http.addGlobalHeader('X-Appwrite-Locale',value);config.locale=value;return this;};let setMode=function(value)
|
||||
{http.addGlobalHeader('X-Appwrite-Mode',value);config.mode=value;return this;};let http=function(document){let globalParams=[],globalHeaders=[];let addParam=function(url,param,value){let a=document.createElement('a'),regex=/(?:\?|&|&)+([^=]+)(?:=([^&]*))*/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.21');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:0.0.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);}
|
||||
|
@ -17,98 +17,213 @@ request.setRequestHeader(key,headers[key]);}}
|
|||
request.onload=function(){if(4===request.readyState&&399>=request.status){let data=request.response;let contentType=this.getResponseHeader('content-type')||'';contentType=contentType.substring(0,contentType.indexOf(';'));switch(contentType){case'application/json':data=JSON.parse(data);break;}
|
||||
resolve(data);}else{reject(new Error(request.statusText));}};if(progress){request.addEventListener('progress',progress);request.upload.addEventListener('progress',progress,false);}
|
||||
request.onerror=function(){reject(new Error("Network Error"));};request.send(params);})};return{'get':function(path,headers={},params={}){return call('GET',path+((Object.keys(params).length>0)?'?'+buildQuery(params):''),headers,{});},'post':function(path,headers={},params={},progress=null){return call('POST',path,headers,params,progress);},'put':function(path,headers={},params={},progress=null){return call('PUT',path,headers,params,progress);},'patch':function(path,headers={},params={},progress=null){return call('PATCH',path,headers,params,progress);},'delete':function(path,headers={},params={},progress=null){return call('DELETE',path,headers,params,progress);},'addGlobalParam':addGlobalParam,'addGlobalHeader':addGlobalHeader}}(window.document);let iframe=function(method,url,params){let form=document.createElement('form');form.setAttribute('method',method);form.setAttribute('action',config.endpoint+url);for(let key in params){if(params.hasOwnProperty(key)){let hiddenField=document.createElement("input");hiddenField.setAttribute("type","hidden");hiddenField.setAttribute("name",key);hiddenField.setAttribute("value",params[key]);form.appendChild(hiddenField);}}
|
||||
document.body.appendChild(form);return form.submit();};let account={get:function(){let path='/account';return http.get(path,{'content-type':'application/json'},{});},delete:function(){let path='/account';return http.delete(path,{'content-type':'application/json'},{});},updateEmail:function(email,password){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
document.body.appendChild(form);return form.submit();};let account={get:function(){let path='/account';let payload={};return http.get(path,{'content-type':'application/json'},payload);},delete:function(){let path='/account';let payload={};return http.delete(path,{'content-type':'application/json'},payload);},updateEmail:function(email,password){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
if(password===undefined){throw new Error('Missing required parameter: "password"');}
|
||||
let path='/account/email';return http.patch(path,{'content-type':'application/json'},{'email':email,'password':password});},updateName:function(name){if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/account/name';return http.patch(path,{'content-type':'application/json'},{'name':name});},updatePassword:function(password,oldPassword){if(password===undefined){throw new Error('Missing required parameter: "password"');}
|
||||
let path='/account/email';let payload={};if(email){payload['email']=email;}
|
||||
if(password){payload['password']=password;}
|
||||
return http.patch(path,{'content-type':'application/json'},payload);},updateName:function(name){if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/account/name';let payload={};if(name){payload['name']=name;}
|
||||
return http.patch(path,{'content-type':'application/json'},payload);},updatePassword:function(password,oldPassword){if(password===undefined){throw new Error('Missing required parameter: "password"');}
|
||||
if(oldPassword===undefined){throw new Error('Missing required parameter: "oldPassword"');}
|
||||
let path='/account/password';return http.patch(path,{'content-type':'application/json'},{'password':password,'old-password':oldPassword});},getPrefs:function(){let path='/account/prefs';return http.get(path,{'content-type':'application/json'},{});},updatePrefs:function(prefs){if(prefs===undefined){throw new Error('Missing required parameter: "prefs"');}
|
||||
let path='/account/prefs';return http.patch(path,{'content-type':'application/json'},{'prefs':prefs});},getSecurity:function(){let path='/account/security';return http.get(path,{'content-type':'application/json'},{});},getSessions:function(){let path='/account/sessions';return http.get(path,{'content-type':'application/json'},{});}};let auth={login:function(email,password,success,failure){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
let path='/account/password';let payload={};if(password){payload['password']=password;}
|
||||
if(oldPassword){payload['old-password']=oldPassword;}
|
||||
return http.patch(path,{'content-type':'application/json'},payload);},getPrefs:function(){let path='/account/prefs';let payload={};return http.get(path,{'content-type':'application/json'},payload);},updatePrefs:function(prefs){if(prefs===undefined){throw new Error('Missing required parameter: "prefs"');}
|
||||
let path='/account/prefs';let payload={};if(prefs){payload['prefs']=prefs;}
|
||||
return http.patch(path,{'content-type':'application/json'},payload);},getSecurity:function(){let path='/account/security';let payload={};return http.get(path,{'content-type':'application/json'},payload);},getSessions:function(){let path='/account/sessions';let payload={};return http.get(path,{'content-type':'application/json'},payload);}};let auth={login:function(email,password,success,failure){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
if(password===undefined){throw new Error('Missing required parameter: "password"');}
|
||||
if(success===undefined){throw new Error('Missing required parameter: "success"');}
|
||||
if(failure===undefined){throw new Error('Missing required parameter: "failure"');}
|
||||
let path='/auth/login';return iframe('post',path,{project:config.project,'email':email,'password':password,'success':success,'failure':failure});},logout:function(){let path='/auth/logout';return http.delete(path,{'content-type':'application/json'},{});},logoutBySession:function(id){if(id===undefined){throw new Error('Missing required parameter: "id"');}
|
||||
let path='/auth/logout/{id}'.replace(new RegExp('{id}','g'),id);return http.delete(path,{'content-type':'application/json'},{});},oauthCallback:function(projectId,provider,code,state=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(provider===undefined){throw new Error('Missing required parameter: "provider"');}
|
||||
if(code===undefined){throw new Error('Missing required parameter: "code"');}
|
||||
let path='/auth/oauth/callback/{provider}/{projectId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{provider}','g'),provider);return http.get(path,{'content-type':'application/json'},{'code':code,'state':state});},oauth:function(provider,success='',failure=''){if(provider===undefined){throw new Error('Missing required parameter: "provider"');}
|
||||
let path='/auth/oauth/{provider}'.replace(new RegExp('{provider}','g'),provider);return http.get(path,{'content-type':'application/json'},{'success':success,'failure':failure});},recovery:function(email,redirect){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
if(redirect===undefined){throw new Error('Missing required parameter: "redirect"');}
|
||||
let path='/auth/recovery';return http.post(path,{'content-type':'application/json'},{'email':email,'redirect':redirect});},recoveryReset:function(userId,token,passwordA,passwordB){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/auth/login';let payload={};if(email){payload['email']=email;}
|
||||
if(password){payload['password']=password;}
|
||||
if(success){payload['success']=success;}
|
||||
if(failure){payload['failure']=failure;}
|
||||
payload['project']=config.project;return iframe('post',path,payload);},logout:function(){let path='/auth/logout';let payload={};return http.delete(path,{'content-type':'application/json'},payload);},logoutBySession:function(id){if(id===undefined){throw new Error('Missing required parameter: "id"');}
|
||||
let path='/auth/logout/{id}'.replace(new RegExp('{id}','g'),id);let payload={};return http.delete(path,{'content-type':'application/json'},payload);},oauth:function(provider,success='',failure=''){if(provider===undefined){throw new Error('Missing required parameter: "provider"');}
|
||||
let path='/auth/oauth/{provider}'.replace(new RegExp('{provider}','g'),provider);let payload={};if(success){payload['success']=success;}
|
||||
if(failure){payload['failure']=failure;}
|
||||
return http.get(path,{'content-type':'application/json'},payload);},recovery:function(email,reset){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
if(reset===undefined){throw new Error('Missing required parameter: "reset"');}
|
||||
let path='/auth/recovery';let payload={};if(email){payload['email']=email;}
|
||||
if(reset){payload['reset']=reset;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},recoveryReset:function(userId,token,passwordA,passwordB){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
if(token===undefined){throw new Error('Missing required parameter: "token"');}
|
||||
if(passwordA===undefined){throw new Error('Missing required parameter: "passwordA"');}
|
||||
if(passwordB===undefined){throw new Error('Missing required parameter: "passwordB"');}
|
||||
let path='/auth/recovery/reset';return http.put(path,{'content-type':'application/json'},{'userId':userId,'token':token,'password-a':passwordA,'password-b':passwordB});},register:function(email,password,confirm,success,failure,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
let path='/auth/recovery/reset';let payload={};if(userId){payload['userId']=userId;}
|
||||
if(token){payload['token']=token;}
|
||||
if(passwordA){payload['password-a']=passwordA;}
|
||||
if(passwordB){payload['password-b']=passwordB;}
|
||||
return http.put(path,{'content-type':'application/json'},payload);},register:function(email,password,confirm,success='',failure='',name=''){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
if(password===undefined){throw new Error('Missing required parameter: "password"');}
|
||||
if(confirm===undefined){throw new Error('Missing required parameter: "confirm"');}
|
||||
if(success===undefined){throw new Error('Missing required parameter: "success"');}
|
||||
if(failure===undefined){throw new Error('Missing required parameter: "failure"');}
|
||||
let path='/auth/register';return iframe('post',path,{project:config.project,'email':email,'password':password,'confirm':confirm,'success':success,'failure':failure,'name':name});},confirm:function(userId,token){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/auth/register';let payload={};if(email){payload['email']=email;}
|
||||
if(password){payload['password']=password;}
|
||||
if(confirm){payload['confirm']=confirm;}
|
||||
if(success){payload['success']=success;}
|
||||
if(failure){payload['failure']=failure;}
|
||||
if(name){payload['name']=name;}
|
||||
payload['project']=config.project;return iframe('post',path,payload);},confirm:function(userId,token){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
if(token===undefined){throw new Error('Missing required parameter: "token"');}
|
||||
let path='/auth/register/confirm';return http.post(path,{'content-type':'application/json'},{'userId':userId,'token':token});},confirmResend:function(confirm){if(confirm===undefined){throw new Error('Missing required parameter: "confirm"');}
|
||||
let path='/auth/register/confirm/resend';return http.post(path,{'content-type':'application/json'},{'confirm':confirm});}};let avatars={getBrowser:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"');}
|
||||
let path='/avatars/browsers/{code}'.replace(new RegExp('{code}','g'),code);return http.get(path,{'content-type':'application/json'},{'width':width,'height':height,'quality':quality});},getCreditCard:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"');}
|
||||
let path='/avatars/credit-cards/{code}'.replace(new RegExp('{code}','g'),code);return http.get(path,{'content-type':'application/json'},{'width':width,'height':height,'quality':quality});},getFavicon:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
let path='/avatars/favicon';return http.get(path,{'content-type':'application/json'},{'url':url});},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);return http.get(path,{'content-type':'application/json'},{'width':width,'height':height,'quality':quality});},getImage:function(url,width=400,height=400){if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
let path='/avatars/image';return http.get(path,{'content-type':'application/json'},{'url':url,'width':width,'height':height});},getQR:function(text,size=400,margin=1,download=0){if(text===undefined){throw new Error('Missing required parameter: "text"');}
|
||||
let path='/avatars/qr';return http.get(path,{'content-type':'application/json'},{'text':text,'size':size,'margin':margin,'download':download});}};let database={listCollections:function(search='',limit=25,offset=0,orderType='ASC'){let path='/database';return http.get(path,{'content-type':'application/json'},{'search':search,'limit':limit,'offset':offset,'orderType':orderType});},createCollection:function(name,read=[],write=[],rules=[]){if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/database';return http.post(path,{'content-type':'application/json'},{'name':name,'read':read,'write':write,'rules':rules});},getCollection:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);return http.get(path,{'content-type':'application/json'},{});},updateCollection:function(collectionId,name,read=[],write=[],rules=[]){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/auth/register/confirm';let payload={};if(userId){payload['userId']=userId;}
|
||||
if(token){payload['token']=token;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},confirmResend:function(confirm){if(confirm===undefined){throw new Error('Missing required parameter: "confirm"');}
|
||||
let path='/auth/register/confirm/resend';let payload={};if(confirm){payload['confirm']=confirm;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);}};let avatars={getBrowser:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"');}
|
||||
let path='/avatars/browsers/{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);},getCreditCard:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"');}
|
||||
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"');}
|
||||
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"');}
|
||||
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"');}
|
||||
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"');}
|
||||
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';let payload={};if(search){payload['search']=search;}
|
||||
if(limit){payload['limit']=limit;}
|
||||
if(offset){payload['offset']=offset;}
|
||||
if(orderType){payload['orderType']=orderType;}
|
||||
return http.get(path,{'content-type':'application/json'},payload);},createCollection:function(name,read=[],write=[],rules=[]){if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/database';let payload={};if(name){payload['name']=name;}
|
||||
if(read){payload['read']=read;}
|
||||
if(write){payload['write']=write;}
|
||||
if(rules){payload['rules']=rules;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},getCollection:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},updateCollection:function(collectionId,name,read=[],write=[],rules=[]){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/database/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);return http.put(path,{'content-type':'application/json'},{'name':name,'read':read,'write':write,'rules':rules});},deleteCollection:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);return http.delete(path,{'content-type':'application/json'},{});},listDocuments:function(collectionId,filters=[],offset=0,limit=50,orderField='$uid',orderType='ASC',orderCast='string',search='',first=0,last=0){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/{collectionId}/documents'.replace(new RegExp('{collectionId}','g'),collectionId);return http.get(path,{'content-type':'application/json'},{'filters':filters,'offset':offset,'limit':limit,'order-field':orderField,'order-type':orderType,'order-cast':orderCast,'search':search,'first':first,'last':last});},createDocument:function(collectionId,data,read=[],write=[],parentDocument='',parentProperty='',parentPropertyType='assign'){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};if(name){payload['name']=name;}
|
||||
if(read){payload['read']=read;}
|
||||
if(write){payload['write']=write;}
|
||||
if(rules){payload['rules']=rules;}
|
||||
return http.put(path,{'content-type':'application/json'},payload);},deleteCollection:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};return http.delete(path,{'content-type':'application/json'},payload);},listDocuments:function(collectionId,filters=[],offset=0,limit=50,orderField='$uid',orderType='ASC',orderCast='string',search='',first=0,last=0){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/{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;}
|
||||
if(orderField){payload['order-field']=orderField;}
|
||||
if(orderType){payload['order-type']=orderType;}
|
||||
if(orderCast){payload['order-cast']=orderCast;}
|
||||
if(search){payload['search']=search;}
|
||||
if(first){payload['first']=first;}
|
||||
if(last){payload['last']=last;}
|
||||
return http.get(path,{'content-type':'application/json'},payload);},createDocument:function(collectionId,data,read=[],write=[],parentDocument='',parentProperty='',parentPropertyType='assign'){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
if(data===undefined){throw new Error('Missing required parameter: "data"');}
|
||||
let path='/database/{collectionId}/documents'.replace(new RegExp('{collectionId}','g'),collectionId);return http.post(path,{'content-type':'application/json'},{'data':data,'read':read,'write':write,'parentDocument':parentDocument,'parentProperty':parentProperty,'parentPropertyType':parentPropertyType});},getDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/{collectionId}/documents'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};if(data){payload['data']=data;}
|
||||
if(read){payload['read']=read;}
|
||||
if(write){payload['write']=write;}
|
||||
if(parentDocument){payload['parentDocument']=parentDocument;}
|
||||
if(parentProperty){payload['parentProperty']=parentProperty;}
|
||||
if(parentPropertyType){payload['parentPropertyType']=parentPropertyType;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},getDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
if(documentId===undefined){throw new Error('Missing required parameter: "documentId"');}
|
||||
let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);return http.get(path,{'content-type':'application/json'},{});},updateDocument:function(collectionId,documentId,data,read=[],write=[]){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},updateDocument:function(collectionId,documentId,data,read=[],write=[]){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
if(documentId===undefined){throw new Error('Missing required parameter: "documentId"');}
|
||||
if(data===undefined){throw new Error('Missing required parameter: "data"');}
|
||||
let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);return http.patch(path,{'content-type':'application/json'},{'data':data,'read':read,'write':write});},deleteDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};if(data){payload['data']=data;}
|
||||
if(read){payload['read']=read;}
|
||||
if(write){payload['write']=write;}
|
||||
return http.patch(path,{'content-type':'application/json'},payload);},deleteDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
if(documentId===undefined){throw new Error('Missing required parameter: "documentId"');}
|
||||
let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);return http.delete(path,{'content-type':'application/json'},{});}};let locale={getLocale:function(){let path='/locale';return http.get(path,{'content-type':'application/json'},{});},getCountries:function(){let path='/locale/countries';return http.get(path,{'content-type':'application/json'},{});},getCountriesEU:function(){let path='/locale/countries/eu';return http.get(path,{'content-type':'application/json'},{});},getCountriesPhones:function(){let path='/locale/countries/phones';return http.get(path,{'content-type':'application/json'},{});},getCurrencies:function(){let path='/locale/currencies';return http.get(path,{'content-type':'application/json'},{});}};let projects={listProjects:function(){let path='/projects';return http.get(path,{'content-type':'application/json'},{});},createProject:function(name,teamId,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/database/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};return http.delete(path,{'content-type':'application/json'},payload);}};let locale={getLocale:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json'},payload);},getCountries:function(){let path='/locale/countries';let payload={};return http.get(path,{'content-type':'application/json'},payload);},getCountriesEU:function(){let path='/locale/countries/eu';let payload={};return http.get(path,{'content-type':'application/json'},payload);},getCountriesPhones:function(){let path='/locale/countries/phones';let payload={};return http.get(path,{'content-type':'application/json'},payload);},getCurrencies:function(){let path='/locale/currencies';let payload={};return http.get(path,{'content-type':'application/json'},payload);}};let projects={listProjects:function(){let path='/projects';let payload={};return http.get(path,{'content-type':'application/json'},payload);},createProject:function(name,teamId,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/projects';return http.post(path,{'content-type':'application/json'},{'name':name,'teamId':teamId,'description':description,'logo':logo,'url':url,'legalName':legalName,'legalCountry':legalCountry,'legalState':legalState,'legalCity':legalCity,'legalAddress':legalAddress,'legalTaxId':legalTaxId});},getProject:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{});},updateProject:function(projectId,name,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects';let payload={};if(name){payload['name']=name;}
|
||||
if(teamId){payload['teamId']=teamId;}
|
||||
if(description){payload['description']=description;}
|
||||
if(logo){payload['logo']=logo;}
|
||||
if(url){payload['url']=url;}
|
||||
if(legalName){payload['legalName']=legalName;}
|
||||
if(legalCountry){payload['legalCountry']=legalCountry;}
|
||||
if(legalState){payload['legalState']=legalState;}
|
||||
if(legalCity){payload['legalCity']=legalCity;}
|
||||
if(legalAddress){payload['legalAddress']=legalAddress;}
|
||||
if(legalTaxId){payload['legalTaxId']=legalTaxId;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},getProject:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},updateProject:function(projectId,name,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);return http.patch(path,{'content-type':'application/json'},{'name':name,'description':description,'logo':logo,'url':url,'legalName':legalName,'legalCountry':legalCountry,'legalState':legalState,'legalCity':legalCity,'legalAddress':legalAddress,'legalTaxId':legalTaxId});},deleteProject:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);return http.delete(path,{'content-type':'application/json'},{});},listKeys:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/keys'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{});},createKey:function(projectId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload['name']=name;}
|
||||
if(description){payload['description']=description;}
|
||||
if(logo){payload['logo']=logo;}
|
||||
if(url){payload['url']=url;}
|
||||
if(legalName){payload['legalName']=legalName;}
|
||||
if(legalCountry){payload['legalCountry']=legalCountry;}
|
||||
if(legalState){payload['legalState']=legalState;}
|
||||
if(legalCity){payload['legalCity']=legalCity;}
|
||||
if(legalAddress){payload['legalAddress']=legalAddress;}
|
||||
if(legalTaxId){payload['legalTaxId']=legalTaxId;}
|
||||
return http.patch(path,{'content-type':'application/json'},payload);},deleteProject:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.delete(path,{'content-type':'application/json'},payload);},listKeys:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/keys'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},createKey:function(projectId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
if(scopes===undefined){throw new Error('Missing required parameter: "scopes"');}
|
||||
let path='/projects/{projectId}/keys'.replace(new RegExp('{projectId}','g'),projectId);return http.post(path,{'content-type':'application/json'},{'name':name,'scopes':scopes});},getKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/keys'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload['name']=name;}
|
||||
if(scopes){payload['scopes']=scopes;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},getKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(keyId===undefined){throw new Error('Missing required parameter: "keyId"');}
|
||||
let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);return http.get(path,{'content-type':'application/json'},{});},updateKey:function(projectId,keyId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},updateKey:function(projectId,keyId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(keyId===undefined){throw new Error('Missing required parameter: "keyId"');}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
if(scopes===undefined){throw new Error('Missing required parameter: "scopes"');}
|
||||
let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);return http.put(path,{'content-type':'application/json'},{'name':name,'scopes':scopes});},deleteKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};if(name){payload['name']=name;}
|
||||
if(scopes){payload['scopes']=scopes;}
|
||||
return http.put(path,{'content-type':'application/json'},payload);},deleteKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(keyId===undefined){throw new Error('Missing required parameter: "keyId"');}
|
||||
let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);return http.delete(path,{'content-type':'application/json'},{});},updateProjectOAuth:function(projectId,provider,appId='',secret=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};return http.delete(path,{'content-type':'application/json'},payload);},updateProjectOAuth:function(projectId,provider,appId='',secret=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(provider===undefined){throw new Error('Missing required parameter: "provider"');}
|
||||
let path='/projects/{projectId}/oauth'.replace(new RegExp('{projectId}','g'),projectId);return http.patch(path,{'content-type':'application/json'},{'provider':provider,'appId':appId,'secret':secret});},listPlatforms:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/platforms'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{});},createPlatform:function(projectId,type,name,key='',store='',url=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/oauth'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(provider){payload['provider']=provider;}
|
||||
if(appId){payload['appId']=appId;}
|
||||
if(secret){payload['secret']=secret;}
|
||||
return http.patch(path,{'content-type':'application/json'},payload);},listPlatforms:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/platforms'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},createPlatform:function(projectId,type,name,key='',store='',url=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(type===undefined){throw new Error('Missing required parameter: "type"');}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/projects/{projectId}/platforms'.replace(new RegExp('{projectId}','g'),projectId);return http.post(path,{'content-type':'application/json'},{'type':type,'name':name,'key':key,'store':store,'url':url});},getPlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/platforms'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(type){payload['type']=type;}
|
||||
if(name){payload['name']=name;}
|
||||
if(key){payload['key']=key;}
|
||||
if(store){payload['store']=store;}
|
||||
if(url){payload['url']=url;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},getPlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(platformId===undefined){throw new Error('Missing required parameter: "platformId"');}
|
||||
let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);return http.get(path,{'content-type':'application/json'},{});},updatePlatform:function(projectId,platformId,name,key='',store='',url=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},updatePlatform:function(projectId,platformId,name,key='',store='',url=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(platformId===undefined){throw new Error('Missing required parameter: "platformId"');}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);return http.put(path,{'content-type':'application/json'},{'name':name,'key':key,'store':store,'url':url});},deletePlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};if(name){payload['name']=name;}
|
||||
if(key){payload['key']=key;}
|
||||
if(store){payload['store']=store;}
|
||||
if(url){payload['url']=url;}
|
||||
return http.put(path,{'content-type':'application/json'},payload);},deletePlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(platformId===undefined){throw new Error('Missing required parameter: "platformId"');}
|
||||
let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);return http.delete(path,{'content-type':'application/json'},{});},listTasks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/tasks'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{});},createTask:function(projectId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};return http.delete(path,{'content-type':'application/json'},payload);},listTasks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/tasks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},createTask:function(projectId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
if(status===undefined){throw new Error('Missing required parameter: "status"');}
|
||||
if(schedule===undefined){throw new Error('Missing required parameter: "schedule"');}
|
||||
if(security===undefined){throw new Error('Missing required parameter: "security"');}
|
||||
if(httpMethod===undefined){throw new Error('Missing required parameter: "httpMethod"');}
|
||||
if(httpUrl===undefined){throw new Error('Missing required parameter: "httpUrl"');}
|
||||
let path='/projects/{projectId}/tasks'.replace(new RegExp('{projectId}','g'),projectId);return http.post(path,{'content-type':'application/json'},{'name':name,'status':status,'schedule':schedule,'security':security,'httpMethod':httpMethod,'httpUrl':httpUrl,'httpHeaders':httpHeaders,'httpUser':httpUser,'httpPass':httpPass});},getTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/tasks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload['name']=name;}
|
||||
if(status){payload['status']=status;}
|
||||
if(schedule){payload['schedule']=schedule;}
|
||||
if(security){payload['security']=security;}
|
||||
if(httpMethod){payload['httpMethod']=httpMethod;}
|
||||
if(httpUrl){payload['httpUrl']=httpUrl;}
|
||||
if(httpHeaders){payload['httpHeaders']=httpHeaders;}
|
||||
if(httpUser){payload['httpUser']=httpUser;}
|
||||
if(httpPass){payload['httpPass']=httpPass;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},getTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(taskId===undefined){throw new Error('Missing required parameter: "taskId"');}
|
||||
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);return http.get(path,{'content-type':'application/json'},{});},updateTask:function(projectId,taskId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},updateTask:function(projectId,taskId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(taskId===undefined){throw new Error('Missing required parameter: "taskId"');}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
if(status===undefined){throw new Error('Missing required parameter: "status"');}
|
||||
|
@ -116,63 +231,129 @@ if(schedule===undefined){throw new Error('Missing required parameter: "schedule"
|
|||
if(security===undefined){throw new Error('Missing required parameter: "security"');}
|
||||
if(httpMethod===undefined){throw new Error('Missing required parameter: "httpMethod"');}
|
||||
if(httpUrl===undefined){throw new Error('Missing required parameter: "httpUrl"');}
|
||||
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);return http.put(path,{'content-type':'application/json'},{'name':name,'status':status,'schedule':schedule,'security':security,'httpMethod':httpMethod,'httpUrl':httpUrl,'httpHeaders':httpHeaders,'httpUser':httpUser,'httpPass':httpPass});},deleteTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};if(name){payload['name']=name;}
|
||||
if(status){payload['status']=status;}
|
||||
if(schedule){payload['schedule']=schedule;}
|
||||
if(security){payload['security']=security;}
|
||||
if(httpMethod){payload['httpMethod']=httpMethod;}
|
||||
if(httpUrl){payload['httpUrl']=httpUrl;}
|
||||
if(httpHeaders){payload['httpHeaders']=httpHeaders;}
|
||||
if(httpUser){payload['httpUser']=httpUser;}
|
||||
if(httpPass){payload['httpPass']=httpPass;}
|
||||
return http.put(path,{'content-type':'application/json'},payload);},deleteTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(taskId===undefined){throw new Error('Missing required parameter: "taskId"');}
|
||||
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);return http.delete(path,{'content-type':'application/json'},{});},getProjectUsage:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/usage'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{});},listWebhooks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);return http.get(path,{'content-type':'application/json'},{});},createWebhook:function(projectId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};return http.delete(path,{'content-type':'application/json'},payload);},getProjectUsage:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/usage'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},listWebhooks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},createWebhook:function(projectId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
if(events===undefined){throw new Error('Missing required parameter: "events"');}
|
||||
if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
if(security===undefined){throw new Error('Missing required parameter: "security"');}
|
||||
let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);return http.post(path,{'content-type':'application/json'},{'name':name,'events':events,'url':url,'security':security,'httpUser':httpUser,'httpPass':httpPass});},getWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload['name']=name;}
|
||||
if(events){payload['events']=events;}
|
||||
if(url){payload['url']=url;}
|
||||
if(security){payload['security']=security;}
|
||||
if(httpUser){payload['httpUser']=httpUser;}
|
||||
if(httpPass){payload['httpPass']=httpPass;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},getWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"');}
|
||||
let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);return http.get(path,{'content-type':'application/json'},{});},updateWebhook:function(projectId,webhookId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},updateWebhook:function(projectId,webhookId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"');}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
if(events===undefined){throw new Error('Missing required parameter: "events"');}
|
||||
if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
if(security===undefined){throw new Error('Missing required parameter: "security"');}
|
||||
let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);return http.put(path,{'content-type':'application/json'},{'name':name,'events':events,'url':url,'security':security,'httpUser':httpUser,'httpPass':httpPass});},deleteWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};if(name){payload['name']=name;}
|
||||
if(events){payload['events']=events;}
|
||||
if(url){payload['url']=url;}
|
||||
if(security){payload['security']=security;}
|
||||
if(httpUser){payload['httpUser']=httpUser;}
|
||||
if(httpPass){payload['httpPass']=httpPass;}
|
||||
return http.put(path,{'content-type':'application/json'},payload);},deleteWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"');}
|
||||
let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);return http.delete(path,{'content-type':'application/json'},{});}};let storage={listFiles:function(search='',limit=25,offset=0,orderType='ASC'){let path='/storage/files';return http.get(path,{'content-type':'application/json'},{'search':search,'limit':limit,'offset':offset,'orderType':orderType});},createFile:function(files,read=[],write=[],folderId=''){if(files===undefined){throw new Error('Missing required parameter: "files"');}
|
||||
let path='/storage/files';return http.post(path,{'content-type':'multipart/form-data'},{'files':files,'read':read,'write':write,'folderId':folderId});},getFile:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);return http.get(path,{'content-type':'application/json'},{});},updateFile:function(fileId,read=[],write=[],folderId=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);return http.put(path,{'content-type':'application/json'},{'read':read,'write':write,'folderId':folderId});},deleteFile:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);return http.delete(path,{'content-type':'application/json'},{});},getFileDownload:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}/download'.replace(new RegExp('{fileId}','g'),fileId);return http.get(path,{'content-type':'application/json'},{});},getFilePreview:function(fileId,width=0,height=0,quality=100,background='',output=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}/preview'.replace(new RegExp('{fileId}','g'),fileId);return http.get(path,{'content-type':'application/json'},{'width':width,'height':height,'quality':quality,'background':background,'output':output});},getFileView:function(fileId,as=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}/view'.replace(new RegExp('{fileId}','g'),fileId);return http.get(path,{'content-type':'application/json'},{'as':as});}};let teams={listTeams:function(search='',limit=25,offset=0,orderType='ASC'){let path='/teams';return http.get(path,{'content-type':'application/json'},{'search':search,'limit':limit,'offset':offset,'orderType':orderType});},createTeam:function(name,roles=["owner"]){if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/teams';return http.post(path,{'content-type':'application/json'},{'name':name,'roles':roles});},getTeam:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);return http.get(path,{'content-type':'application/json'},{});},updateTeam:function(teamId,name){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};return http.delete(path,{'content-type':'application/json'},payload);}};let storage={listFiles:function(search='',limit=25,offset=0,orderType='ASC'){let path='/storage/files';let payload={};if(search){payload['search']=search;}
|
||||
if(limit){payload['limit']=limit;}
|
||||
if(offset){payload['offset']=offset;}
|
||||
if(orderType){payload['orderType']=orderType;}
|
||||
return http.get(path,{'content-type':'application/json'},payload);},createFile:function(files,read=[],write=[],folderId=''){if(files===undefined){throw new Error('Missing required parameter: "files"');}
|
||||
let path='/storage/files';let payload={};if(files){payload['files']=files;}
|
||||
if(read){payload['read']=read;}
|
||||
if(write){payload['write']=write;}
|
||||
if(folderId){payload['folderId']=folderId;}
|
||||
return http.post(path,{'content-type':'multipart/form-data'},payload);},getFile:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},updateFile:function(fileId,read=[],write=[],folderId=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);let payload={};if(read){payload['read']=read;}
|
||||
if(write){payload['write']=write;}
|
||||
if(folderId){payload['folderId']=folderId;}
|
||||
return http.put(path,{'content-type':'application/json'},payload);},deleteFile:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);let payload={};return http.delete(path,{'content-type':'application/json'},payload);},getFileDownload:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}/download'.replace(new RegExp('{fileId}','g'),fileId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},getFilePreview:function(fileId,width=0,height=0,quality=100,background='',output=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}/preview'.replace(new RegExp('{fileId}','g'),fileId);let payload={};if(width){payload['width']=width;}
|
||||
if(height){payload['height']=height;}
|
||||
if(quality){payload['quality']=quality;}
|
||||
if(background){payload['background']=background;}
|
||||
if(output){payload['output']=output;}
|
||||
return http.get(path,{'content-type':'application/json'},payload);},getFileView:function(fileId,as=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');}
|
||||
let path='/storage/files/{fileId}/view'.replace(new RegExp('{fileId}','g'),fileId);let payload={};if(as){payload['as']=as;}
|
||||
return http.get(path,{'content-type':'application/json'},payload);}};let teams={listTeams:function(search='',limit=25,offset=0,orderType='ASC'){let path='/teams';let payload={};if(search){payload['search']=search;}
|
||||
if(limit){payload['limit']=limit;}
|
||||
if(offset){payload['offset']=offset;}
|
||||
if(orderType){payload['orderType']=orderType;}
|
||||
return http.get(path,{'content-type':'application/json'},payload);},createTeam:function(name,roles=["owner"]){if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/teams';let payload={};if(name){payload['name']=name;}
|
||||
if(roles){payload['roles']=roles;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},getTeam:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},updateTeam:function(teamId,name){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);return http.put(path,{'content-type':'application/json'},{'name':name});},deleteTeam:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);return http.delete(path,{'content-type':'application/json'},{});},getTeamMembers:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}/members'.replace(new RegExp('{teamId}','g'),teamId);return http.get(path,{'content-type':'application/json'},{});},createTeamMembership:function(teamId,email,roles,redirect,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(name){payload['name']=name;}
|
||||
return http.put(path,{'content-type':'application/json'},payload);},deleteTeam:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.delete(path,{'content-type':'application/json'},payload);},getTeamMembers:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}/members'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},createTeamMembership:function(teamId,email,roles,redirect,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
if(roles===undefined){throw new Error('Missing required parameter: "roles"');}
|
||||
if(redirect===undefined){throw new Error('Missing required parameter: "redirect"');}
|
||||
let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);return http.post(path,{'content-type':'application/json'},{'email':email,'name':name,'roles':roles,'redirect':redirect});},deleteTeamMembership:function(teamId,inviteId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(email){payload['email']=email;}
|
||||
if(name){payload['name']=name;}
|
||||
if(roles){payload['roles']=roles;}
|
||||
if(redirect){payload['redirect']=redirect;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},deleteTeamMembership:function(teamId,inviteId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
if(inviteId===undefined){throw new Error('Missing required parameter: "inviteId"');}
|
||||
let path='/teams/{teamId}/memberships/{inviteId}'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);return http.delete(path,{'content-type':'application/json'},{});},createTeamMembershipResend:function(teamId,inviteId,redirect){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}/memberships/{inviteId}'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);let payload={};return http.delete(path,{'content-type':'application/json'},payload);},createTeamMembershipResend:function(teamId,inviteId,redirect){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
if(inviteId===undefined){throw new Error('Missing required parameter: "inviteId"');}
|
||||
if(redirect===undefined){throw new Error('Missing required parameter: "redirect"');}
|
||||
let path='/teams/{teamId}/memberships/{inviteId}/resend'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);return http.post(path,{'content-type':'application/json'},{'redirect':redirect});},updateTeamMembershipStatus:function(teamId,inviteId,userId,secret,success='',failure=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}/memberships/{inviteId}/resend'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);let payload={};if(redirect){payload['redirect']=redirect;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},updateTeamMembershipStatus:function(teamId,inviteId,userId,secret,success='',failure=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
if(inviteId===undefined){throw new Error('Missing required parameter: "inviteId"');}
|
||||
if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
if(secret===undefined){throw new Error('Missing required parameter: "secret"');}
|
||||
let path='/teams/{teamId}/memberships/{inviteId}/status'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);return iframe('patch',path,{project:config.project,'userId':userId,'secret':secret,'success':success,'failure':failure});}};let users={listUsers:function(search='',limit=25,offset=0,orderType='ASC'){let path='/users';return http.get(path,{'content-type':'application/json'},{'search':search,'limit':limit,'offset':offset,'orderType':orderType});},createUser:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
let path='/teams/{teamId}/memberships/{inviteId}/status'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);let payload={};if(userId){payload['userId']=userId;}
|
||||
if(secret){payload['secret']=secret;}
|
||||
if(success){payload['success']=success;}
|
||||
if(failure){payload['failure']=failure;}
|
||||
payload['project']=config.project;return iframe('patch',path,payload);}};let users={listUsers:function(search='',limit=25,offset=0,orderType='ASC'){let path='/users';let payload={};if(search){payload['search']=search;}
|
||||
if(limit){payload['limit']=limit;}
|
||||
if(offset){payload['offset']=offset;}
|
||||
if(orderType){payload['orderType']=orderType;}
|
||||
return http.get(path,{'content-type':'application/json'},payload);},createUser:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
if(password===undefined){throw new Error('Missing required parameter: "password"');}
|
||||
let path='/users';return http.post(path,{'content-type':'application/json'},{'email':email,'password':password,'name':name});},getUser:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users/{userId}'.replace(new RegExp('{userId}','g'),userId);return http.get(path,{'content-type':'application/json'},{});},getUserLogs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users/{userId}/logs'.replace(new RegExp('{userId}','g'),userId);return http.get(path,{'content-type':'application/json'},{});},getUserPrefs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users/{userId}/prefs'.replace(new RegExp('{userId}','g'),userId);return http.get(path,{'content-type':'application/json'},{});},getUserSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);return http.get(path,{'content-type':'application/json'},{});},deleteUserSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);return http.delete(path,{'content-type':'application/json'},{});},deleteUsersSession:function(userId,sessionId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users';let payload={};if(email){payload['email']=email;}
|
||||
if(password){payload['password']=password;}
|
||||
if(name){payload['name']=name;}
|
||||
return http.post(path,{'content-type':'application/json'},payload);},getUser:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users/{userId}'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},getUserLogs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users/{userId}/logs'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},getUserPrefs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users/{userId}/prefs'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},updateUserPrefs:function(userId,prefs){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
if(prefs===undefined){throw new Error('Missing required parameter: "prefs"');}
|
||||
let path='/users/{userId}/prefs'.replace(new RegExp('{userId}','g'),userId);let payload={};if(prefs){payload['prefs']=prefs;}
|
||||
return http.patch(path,{'content-type':'application/json'},payload);},getUserSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json'},payload);},deleteUserSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.delete(path,{'content-type':'application/json'},payload);},deleteUserSession:function(userId,sessionId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
if(sessionId===undefined){throw new Error('Missing required parameter: "sessionId"');}
|
||||
let path='/users/{userId}/sessions/:session'.replace(new RegExp('{userId}','g'),userId);return http.delete(path,{'content-type':'application/json'},{'sessionId':sessionId});},updateUserStatus:function(userId,status){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
let path='/users/{userId}/sessions/:session'.replace(new RegExp('{userId}','g'),userId);let payload={};if(sessionId){payload['sessionId']=sessionId;}
|
||||
return http.delete(path,{'content-type':'application/json'},payload);},updateUserStatus:function(userId,status){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
if(status===undefined){throw new Error('Missing required parameter: "status"');}
|
||||
let path='/users/{userId}/status'.replace(new RegExp('{userId}','g'),userId);return http.patch(path,{'content-type':'application/json'},{'status':status});}};return{setEndpoint:setEndpoint,setProject:setProject,setKey:setKey,setLocale:setLocale,setMode:setMode,account:account,auth:auth,avatars:avatars,database:database,locale:locale,projects:projects,storage:storage,teams:teams,users:users};};})(window);(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Chart=f()}})(function(){var define,module,exports;return(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){var colorNames=require(5);module.exports={getRgba:getRgba,getHsla:getHsla,getRgb:getRgb,getHsl:getHsl,getHwb:getHwb,getAlpha:getAlpha,hexString:hexString,rgbString:rgbString,rgbaString:rgbaString,percentString:percentString,percentaString:percentaString,hslString:hslString,hslaString:hslaString,hwbString:hwbString,keyword:keyword}
|
||||
let path='/users/{userId}/status'.replace(new RegExp('{userId}','g'),userId);let payload={};if(status){payload['status']=status;}
|
||||
return http.patch(path,{'content-type':'application/json'},payload);}};return{setEndpoint:setEndpoint,setProject:setProject,setKey:setKey,setLocale:setLocale,setMode:setMode,account:account,auth:auth,avatars:avatars,database:database,locale:locale,projects:projects,storage:storage,teams:teams,users:users};};if(typeof module!=="undefined"){module.exports=window.Appwrite;}})((typeof window!=="undefined")?window:{});(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Chart=f()}})(function(){var define,module,exports;return(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){var colorNames=require(5);module.exports={getRgba:getRgba,getHsla:getHsla,getRgb:getRgb,getHsl:getHsl,getHwb:getHwb,getAlpha:getAlpha,hexString:hexString,rgbString:rgbString,rgbaString:rgbaString,percentString:percentString,percentaString:percentaString,hslString:hslString,hslaString:hslaString,hwbString:hwbString,keyword:keyword}
|
||||
function getRgba(string){if(!string){return;}
|
||||
var abbr=/^#([a-fA-F0-9]{3})$/i,hex=/^#([a-fA-F0-9]{6})$/i,rgba=/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i,per=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i,keyword=/(\w+)/;var rgb=[0,0,0],a=1,match=string.match(abbr);if(match){match=match[1];for(var i=0;i<rgb.length;i++){rgb[i]=parseInt(match[i]+match[i],16);}}
|
||||
else if(match=string.match(hex)){match=match[1];for(var i=0;i<rgb.length;i++){rgb[i]=parseInt(match.slice(i*2,i*2+2),16);}}
|
||||
|
|
Loading…
Reference in a new issue