Updated Console SDK
This commit is contained in:
parent
0e6f36d78d
commit
51da5061f0
|
@ -1,7 +1,7 @@
|
|||
# Appwrite Web SDK
|
||||
|
||||
![License](https://img.shields.io/github/license/appwrite/sdk-for-js.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-0.6.1-blue.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-0.6.2-blue.svg?v=1)
|
||||
|
||||
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way.
|
||||
Use the Web SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools.
|
||||
|
|
|
@ -5,7 +5,7 @@ sdk
|
|||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
let promise = sdk.account.createOAuth2Session('bitbucket');
|
||||
let promise = sdk.account.createOAuth2Session('amazon');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
|
|
|
@ -276,10 +276,10 @@
|
|||
*
|
||||
* Use this endpoint to allow a new user to register a new account in your
|
||||
* project. After the user registration completes successfully, you can use
|
||||
* the [/account/verfication](/docs/account#createVerification) route to start
|
||||
* verifying the user email address. To allow your new user to login to his
|
||||
* new account, you need to create a new [account
|
||||
* session](/docs/account#createSession).
|
||||
* the [/account/verfication](/docs/client/account#createVerification) route
|
||||
* to start verifying the user email address. To allow your new user to login
|
||||
* to his new account, you need to create a new [account
|
||||
* session](/docs/client/account#createSession).
|
||||
*
|
||||
* @param {string} email
|
||||
* @param {string} password
|
||||
|
@ -522,7 +522,7 @@
|
|||
* When the user clicks the confirmation link he is redirected back to your
|
||||
* app password reset URL with the secret key and email address values
|
||||
* attached to the URL query string. Use the query string params to submit a
|
||||
* request to the [PUT /account/recovery](/docs/account#updateRecovery)
|
||||
* request to the [PUT /account/recovery](/docs/client/account#updateRecovery)
|
||||
* endpoint to complete the process.
|
||||
*
|
||||
* @param {string} email
|
||||
|
@ -563,7 +563,7 @@
|
|||
* Use this endpoint to complete the user account password reset. Both the
|
||||
* **userId** and **secret** arguments will be passed as query parameters to
|
||||
* the redirect URL you have provided when sending your request to the [POST
|
||||
* /account/recovery](/docs/account#createRecovery) endpoint.
|
||||
* /account/recovery](/docs/client/account#createRecovery) endpoint.
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
@ -772,7 +772,7 @@
|
|||
* should redirect the user back for your app and allow you to complete the
|
||||
* verification process by verifying both the **userId** and **secret**
|
||||
* parameters. Learn more about how to [complete the verification
|
||||
* process](/docs/account#updateAccountVerification).
|
||||
* process](/docs/client/account#updateAccountVerification).
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
@ -1168,7 +1168,10 @@
|
|||
/**
|
||||
* Create Document
|
||||
*
|
||||
* Create a new Document.
|
||||
* Create a new Document. Before using this route, you should create a new
|
||||
* collection resource using either a [server
|
||||
* integration](/docs/server/database?sdk=nodejs#createCollection) API or
|
||||
* directly from your database console.
|
||||
*
|
||||
* @param {string} collectionId
|
||||
* @param {object} data
|
||||
|
@ -1942,10 +1945,14 @@
|
|||
* for this list of resources.
|
||||
*
|
||||
* @param {string} teamId
|
||||
* @param {string} search
|
||||
* @param {number} limit
|
||||
* @param {number} offset
|
||||
* @param {string} orderType
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getMemberships: function(teamId) {
|
||||
getMemberships: function(teamId, search = '', limit = 25, offset = 0, orderType = 'ASC') {
|
||||
if(teamId === undefined) {
|
||||
throw new Error('Missing required parameter: "teamId"');
|
||||
}
|
||||
|
@ -1954,6 +1961,22 @@
|
|||
|
||||
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',
|
||||
|
@ -1969,8 +1992,8 @@
|
|||
*
|
||||
* Use the 'URL' parameter to redirect the user from the invitation email back
|
||||
* to your app. When the user is redirected, use the [Update Team Membership
|
||||
* Status](/docs/teams#updateMembershipStatus) endpoint to allow the user to
|
||||
* accept the invitation to the team.
|
||||
* Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the
|
||||
* user to accept the invitation to the team.
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
|
8
app/sdks/client-web/src/sdk.min.js
vendored
8
app/sdks/client-web/src/sdk.min.js
vendored
|
@ -148,8 +148,12 @@ let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payloa
|
|||
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
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)},delete: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)},getMemberships:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},createMembership:function(teamId,email,roles,url,name=''){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)},getMemberships:function(teamId,search='',limit=25,offset=0,orderType='ASC'){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);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)},createMembership:function(teamId,email,roles,url,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(url===undefined){throw new Error('Missing required parameter: "url"')}
|
||||
|
|
29
app/sdks/client-web/types/index.d.ts
vendored
29
app/sdks/client-web/types/index.d.ts
vendored
|
@ -64,10 +64,10 @@ declare namespace Appwrite {
|
|||
*
|
||||
* Use this endpoint to allow a new user to register a new account in your
|
||||
* project. After the user registration completes successfully, you can use
|
||||
* the [/account/verfication](/docs/account#createVerification) route to start
|
||||
* verifying the user email address. To allow your new user to login to his
|
||||
* new account, you need to create a new [account
|
||||
* session](/docs/account#createSession).
|
||||
* the [/account/verfication](/docs/client/account#createVerification) route
|
||||
* to start verifying the user email address. To allow your new user to login
|
||||
* to his new account, you need to create a new [account
|
||||
* session](/docs/client/account#createSession).
|
||||
*
|
||||
* @param {string} email
|
||||
* @param {string} password
|
||||
|
@ -170,7 +170,7 @@ declare namespace Appwrite {
|
|||
* When the user clicks the confirmation link he is redirected back to your
|
||||
* app password reset URL with the secret key and email address values
|
||||
* attached to the URL query string. Use the query string params to submit a
|
||||
* request to the [PUT /account/recovery](/docs/account#updateRecovery)
|
||||
* request to the [PUT /account/recovery](/docs/client/account#updateRecovery)
|
||||
* endpoint to complete the process.
|
||||
*
|
||||
* @param {string} email
|
||||
|
@ -186,7 +186,7 @@ declare namespace Appwrite {
|
|||
* Use this endpoint to complete the user account password reset. Both the
|
||||
* **userId** and **secret** arguments will be passed as query parameters to
|
||||
* the redirect URL you have provided when sending your request to the [POST
|
||||
* /account/recovery](/docs/account#createRecovery) endpoint.
|
||||
* /account/recovery](/docs/client/account#createRecovery) endpoint.
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
@ -276,7 +276,7 @@ declare namespace Appwrite {
|
|||
* should redirect the user back for your app and allow you to complete the
|
||||
* verification process by verifying both the **userId** and **secret**
|
||||
* parameters. Learn more about how to [complete the verification
|
||||
* process](/docs/account#updateAccountVerification).
|
||||
* process](/docs/client/account#updateAccountVerification).
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
@ -431,7 +431,10 @@ declare namespace Appwrite {
|
|||
/**
|
||||
* Create Document
|
||||
*
|
||||
* Create a new Document.
|
||||
* Create a new Document. Before using this route, you should create a new
|
||||
* collection resource using either a [server
|
||||
* integration](/docs/server/database?sdk=nodejs#createCollection) API or
|
||||
* directly from your database console.
|
||||
*
|
||||
* @param {string} collectionId
|
||||
* @param {object} data
|
||||
|
@ -758,10 +761,14 @@ declare namespace Appwrite {
|
|||
* for this list of resources.
|
||||
*
|
||||
* @param {string} teamId
|
||||
* @param {string} search
|
||||
* @param {number} limit
|
||||
* @param {number} offset
|
||||
* @param {string} orderType
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getMemberships(teamId: string): Promise<object>;
|
||||
getMemberships(teamId: string, search: string, limit: number, offset: number, orderType: string): Promise<object>;
|
||||
|
||||
/**
|
||||
* Create Team Membership
|
||||
|
@ -772,8 +779,8 @@ declare namespace Appwrite {
|
|||
*
|
||||
* Use the 'URL' parameter to redirect the user from the invitation email back
|
||||
* to your app. When the user is redirected, use the [Update Team Membership
|
||||
* Status](/docs/teams#updateMembershipStatus) endpoint to allow the user to
|
||||
* accept the invitation to the team.
|
||||
* Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the
|
||||
* user to accept the invitation to the team.
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Appwrite Console SDK
|
||||
|
||||
![License](https://img.shields.io/github/license/appwrite/sdk-for-console.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-0.6.1-blue.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-0.6.2-blue.svg?v=1)
|
||||
|
||||
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way.
|
||||
Use the Console SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools.
|
||||
|
|
|
@ -6,7 +6,7 @@ sdk
|
|||
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
||||
;
|
||||
|
||||
let promise = sdk.account.createOAuth2Session('bitbucket');
|
||||
let promise = sdk.account.createOAuth2Session('amazon');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
|
|
|
@ -6,7 +6,7 @@ sdk
|
|||
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
||||
;
|
||||
|
||||
let promise = sdk.projects.updateOAuth2('[PROJECT_ID]', 'bitbucket');
|
||||
let promise = sdk.projects.updateOAuth2('[PROJECT_ID]', 'amazon');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
|
|
|
@ -312,10 +312,10 @@
|
|||
*
|
||||
* Use this endpoint to allow a new user to register a new account in your
|
||||
* project. After the user registration completes successfully, you can use
|
||||
* the [/account/verfication](/docs/account#createVerification) route to start
|
||||
* verifying the user email address. To allow your new user to login to his
|
||||
* new account, you need to create a new [account
|
||||
* session](/docs/account#createSession).
|
||||
* the [/account/verfication](/docs/client/account#createVerification) route
|
||||
* to start verifying the user email address. To allow your new user to login
|
||||
* to his new account, you need to create a new [account
|
||||
* session](/docs/client/account#createSession).
|
||||
*
|
||||
* @param {string} email
|
||||
* @param {string} password
|
||||
|
@ -558,7 +558,7 @@
|
|||
* When the user clicks the confirmation link he is redirected back to your
|
||||
* app password reset URL with the secret key and email address values
|
||||
* attached to the URL query string. Use the query string params to submit a
|
||||
* request to the [PUT /account/recovery](/docs/account#updateRecovery)
|
||||
* request to the [PUT /account/recovery](/docs/client/account#updateRecovery)
|
||||
* endpoint to complete the process.
|
||||
*
|
||||
* @param {string} email
|
||||
|
@ -599,7 +599,7 @@
|
|||
* Use this endpoint to complete the user account password reset. Both the
|
||||
* **userId** and **secret** arguments will be passed as query parameters to
|
||||
* the redirect URL you have provided when sending your request to the [POST
|
||||
* /account/recovery](/docs/account#createRecovery) endpoint.
|
||||
* /account/recovery](/docs/client/account#createRecovery) endpoint.
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
@ -810,7 +810,7 @@
|
|||
* should redirect the user back for your app and allow you to complete the
|
||||
* verification process by verifying both the **userId** and **secret**
|
||||
* parameters. Learn more about how to [complete the verification
|
||||
* process](/docs/account#updateAccountVerification).
|
||||
* process](/docs/client/account#updateAccountVerification).
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
@ -1421,7 +1421,10 @@
|
|||
/**
|
||||
* Create Document
|
||||
*
|
||||
* Create a new Document.
|
||||
* Create a new Document. Before using this route, you should create a new
|
||||
* collection resource using either a [server
|
||||
* integration](/docs/server/database?sdk=nodejs#createCollection) API or
|
||||
* directly from your database console.
|
||||
*
|
||||
* @param {string} collectionId
|
||||
* @param {object} data
|
||||
|
@ -3753,10 +3756,14 @@
|
|||
* for this list of resources.
|
||||
*
|
||||
* @param {string} teamId
|
||||
* @param {string} search
|
||||
* @param {number} limit
|
||||
* @param {number} offset
|
||||
* @param {string} orderType
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getMemberships: function(teamId) {
|
||||
getMemberships: function(teamId, search = '', limit = 25, offset = 0, orderType = 'ASC') {
|
||||
if(teamId === undefined) {
|
||||
throw new Error('Missing required parameter: "teamId"');
|
||||
}
|
||||
|
@ -3765,6 +3772,22 @@
|
|||
|
||||
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',
|
||||
|
@ -3780,8 +3803,8 @@
|
|||
*
|
||||
* Use the 'URL' parameter to redirect the user from the invitation email back
|
||||
* to your app. When the user is redirected, use the [Update Team Membership
|
||||
* Status](/docs/teams#updateMembershipStatus) endpoint to allow the user to
|
||||
* accept the invitation to the team.
|
||||
* Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the
|
||||
* user to accept the invitation to the team.
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
|
8
app/sdks/console-web/src/sdk.min.js
vendored
8
app/sdks/console-web/src/sdk.min.js
vendored
|
@ -319,8 +319,12 @@ let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payloa
|
|||
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
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)},delete: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)},getMemberships:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},createMembership:function(teamId,email,roles,url,name=''){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)},getMemberships:function(teamId,search='',limit=25,offset=0,orderType='ASC'){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);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)},createMembership:function(teamId,email,roles,url,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(url===undefined){throw new Error('Missing required parameter: "url"')}
|
||||
|
|
29
app/sdks/console-web/types/index.d.ts
vendored
29
app/sdks/console-web/types/index.d.ts
vendored
|
@ -85,10 +85,10 @@ declare namespace Appwrite {
|
|||
*
|
||||
* Use this endpoint to allow a new user to register a new account in your
|
||||
* project. After the user registration completes successfully, you can use
|
||||
* the [/account/verfication](/docs/account#createVerification) route to start
|
||||
* verifying the user email address. To allow your new user to login to his
|
||||
* new account, you need to create a new [account
|
||||
* session](/docs/account#createSession).
|
||||
* the [/account/verfication](/docs/client/account#createVerification) route
|
||||
* to start verifying the user email address. To allow your new user to login
|
||||
* to his new account, you need to create a new [account
|
||||
* session](/docs/client/account#createSession).
|
||||
*
|
||||
* @param {string} email
|
||||
* @param {string} password
|
||||
|
@ -191,7 +191,7 @@ declare namespace Appwrite {
|
|||
* When the user clicks the confirmation link he is redirected back to your
|
||||
* app password reset URL with the secret key and email address values
|
||||
* attached to the URL query string. Use the query string params to submit a
|
||||
* request to the [PUT /account/recovery](/docs/account#updateRecovery)
|
||||
* request to the [PUT /account/recovery](/docs/client/account#updateRecovery)
|
||||
* endpoint to complete the process.
|
||||
*
|
||||
* @param {string} email
|
||||
|
@ -207,7 +207,7 @@ declare namespace Appwrite {
|
|||
* Use this endpoint to complete the user account password reset. Both the
|
||||
* **userId** and **secret** arguments will be passed as query parameters to
|
||||
* the redirect URL you have provided when sending your request to the [POST
|
||||
* /account/recovery](/docs/account#createRecovery) endpoint.
|
||||
* /account/recovery](/docs/client/account#createRecovery) endpoint.
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
@ -297,7 +297,7 @@ declare namespace Appwrite {
|
|||
* should redirect the user back for your app and allow you to complete the
|
||||
* verification process by verifying both the **userId** and **secret**
|
||||
* parameters. Learn more about how to [complete the verification
|
||||
* process](/docs/account#updateAccountVerification).
|
||||
* process](/docs/client/account#updateAccountVerification).
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
@ -522,7 +522,10 @@ declare namespace Appwrite {
|
|||
/**
|
||||
* Create Document
|
||||
*
|
||||
* Create a new Document.
|
||||
* Create a new Document. Before using this route, you should create a new
|
||||
* collection resource using either a [server
|
||||
* integration](/docs/server/database?sdk=nodejs#createCollection) API or
|
||||
* directly from your database console.
|
||||
*
|
||||
* @param {string} collectionId
|
||||
* @param {object} data
|
||||
|
@ -1402,10 +1405,14 @@ declare namespace Appwrite {
|
|||
* for this list of resources.
|
||||
*
|
||||
* @param {string} teamId
|
||||
* @param {string} search
|
||||
* @param {number} limit
|
||||
* @param {number} offset
|
||||
* @param {string} orderType
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getMemberships(teamId: string): Promise<object>;
|
||||
getMemberships(teamId: string, search: string, limit: number, offset: number, orderType: string): Promise<object>;
|
||||
|
||||
/**
|
||||
* Create Team Membership
|
||||
|
@ -1416,8 +1423,8 @@ declare namespace Appwrite {
|
|||
*
|
||||
* Use the 'URL' parameter to redirect the user from the invitation email back
|
||||
* to your app. When the user is redirected, use the [Update Team Membership
|
||||
* Status](/docs/teams#updateMembershipStatus) endpoint to allow the user to
|
||||
* accept the invitation to the team.
|
||||
* Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the
|
||||
* user to accept the invitation to the team.
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
|
39
public/dist/scripts/app-all.js
vendored
39
public/dist/scripts/app-all.js
vendored
|
@ -18,8 +18,7 @@ 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;}
|
||||
let cookieFallback=this.getResponseHeader('X-Fallback-Cookies')||'';if(window.localStorage&&cookieFallback){window.console.warn('Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.');window.localStorage.setItem('cookieFallback',cookieFallback);}
|
||||
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';let payload={};return http.get(path,{'content-type':'application/json',},payload);},create:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
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 account={get:function(){let path='/account';let payload={};return http.get(path,{'content-type':'application/json',},payload);},create: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='/account';let payload={};if(email){payload['email']=email;}
|
||||
if(password){payload['password']=password;}
|
||||
|
@ -52,12 +51,10 @@ return http.put(path,{'content-type':'application/json',},payload);},getSessions
|
|||
if(password===undefined){throw new Error('Missing required parameter: "password"');}
|
||||
let path='/account/sessions';let payload={};if(email){payload['email']=email;}
|
||||
if(password){payload['password']=password;}
|
||||
return http.post(path,{'content-type':'application/json',},payload);},deleteSessions:function(){let path='/account/sessions';let payload={};return http.delete(path,{'content-type':'application/json',},payload);},createOAuth2Session:function(provider,success,failure){if(provider===undefined){throw new Error('Missing required parameter: "provider"');}
|
||||
if(success===undefined){throw new Error('Missing required parameter: "success"');}
|
||||
if(failure===undefined){throw new Error('Missing required parameter: "failure"');}
|
||||
return http.post(path,{'content-type':'application/json',},payload);},deleteSessions:function(){let path='/account/sessions';let payload={};return http.delete(path,{'content-type':'application/json',},payload);},createOAuth2Session:function(provider,success='https://appwrite.io/auth/oauth2/success',failure='https://appwrite.io/auth/oauth2/failure'){if(provider===undefined){throw new Error('Missing required parameter: "provider"');}
|
||||
let path='/account/sessions/oauth2/{provider}'.replace(new RegExp('{provider}','g'),provider);let payload={};if(success){payload['success']=success;}
|
||||
if(failure){payload['failure']=failure;}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},deleteSession:function(sessionId){if(sessionId===undefined){throw new Error('Missing required parameter: "sessionId"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');window.location=config.endpoint+path+((query)?'?'+query:'');},deleteSession:function(sessionId){if(sessionId===undefined){throw new Error('Missing required parameter: "sessionId"');}
|
||||
let path='/account/sessions/{sessionId}'.replace(new RegExp('{sessionId}','g'),sessionId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},createVerification:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
let path='/account/verification';let payload={};if(url){payload['url']=url;}
|
||||
return http.post(path,{'content-type':'application/json',},payload);},updateVerification:function(userId,secret){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
|
@ -68,26 +65,26 @@ return http.put(path,{'content-type':'application/json',},payload);}};let avatar
|
|||
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"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},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"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},getFavicon:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
let path='/avatars/favicon';let payload={};if(url){payload['url']=url;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);},getFlag:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},getFlag:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"');}
|
||||
let path='/avatars/flags/{code}'.replace(new RegExp('{code}','g'),code);let payload={};if(width){payload['width']=width;}
|
||||
if(height){payload['height']=height;}
|
||||
if(quality){payload['quality']=quality;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);},getImage:function(url,width=400,height=400){if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},getImage:function(url,width=400,height=400){if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
let path='/avatars/image';let payload={};if(url){payload['url']=url;}
|
||||
if(width){payload['width']=width;}
|
||||
if(height){payload['height']=height;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);},getQR:function(text,size=400,margin=1,download=0){if(text===undefined){throw new Error('Missing required parameter: "text"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},getQR:function(text,size=400,margin=1,download=0){if(text===undefined){throw new Error('Missing required parameter: "text"');}
|
||||
let path='/avatars/qr';let payload={};if(text){payload['text']=text;}
|
||||
if(size){payload['size']=size;}
|
||||
if(margin){payload['margin']=margin;}
|
||||
if(download){payload['download']=download;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);}};let database={listCollections:function(search='',limit=25,offset=0,orderType='ASC'){let path='/database/collections';let payload={};if(search){payload['search']=search;}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');}};let database={listCollections:function(search='',limit=25,offset=0,orderType='ASC'){let path='/database/collections';let payload={};if(search){payload['search']=search;}
|
||||
if(limit){payload['limit']=limit;}
|
||||
if(offset){payload['offset']=offset;}
|
||||
if(orderType){payload['orderType']=orderType;}
|
||||
|
@ -141,7 +138,8 @@ 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/collections/{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={get:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getContinents:function(){let path='/locale/continents';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={list:function(){let path='/projects';let payload={};return http.get(path,{'content-type':'application/json',},payload);},create: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/collections/{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);},getCollectionLogs:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/collections/{collectionId}/logs'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let health={get:function(){let path='/health';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getAntiVirus:function(){let path='/health/anti-virus';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCache:function(){let path='/health/cache';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getDB:function(){let path='/health/db';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueCertificates:function(){let path='/health/queue/certificates';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueFunctions:function(){let path='/health/queue/functions';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueLogs:function(){let path='/health/queue/logs';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueTasks:function(){let path='/health/queue/tasks';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueUsage:function(){let path='/health/queue/usage';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueWebhooks:function(){let path='/health/queue/webhooks';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getStorageLocal:function(){let path='/health/storage/local';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getTime:function(){let path='/health/time';let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let locale={get:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getContinents:function(){let path='/locale/continents';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={list:function(){let path='/projects';let payload={};return http.get(path,{'content-type':'application/json',},payload);},create: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';let payload={};if(name){payload['name']=name;}
|
||||
if(teamId){payload['teamId']=teamId;}
|
||||
|
@ -259,7 +257,7 @@ 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);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getUsage:function(projectId,range='monthly'){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);},getUsage:function(projectId,range='last30'){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/usage'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(range){payload['range']=range;}
|
||||
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"');}
|
||||
|
@ -327,8 +325,12 @@ let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payloa
|
|||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
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);},delete: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);},getMemberships:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},createMembership:function(teamId,email,roles,url,name=''){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);},getMemberships:function(teamId,search='',limit=25,offset=0,orderType='ASC'){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);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);},createMembership:function(teamId,email,roles,url,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(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
|
@ -366,7 +368,7 @@ if(sessionId===undefined){throw new Error('Missing required parameter: "sessionI
|
|||
let path='/users/{userId}/sessions/{sessionId}'.replace(new RegExp('{userId}','g'),userId).replace(new RegExp('{sessionId}','g'),sessionId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},updateStatus: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);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,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}
|
||||
return http.patch(path,{'content-type':'application/json',},payload);}};return{setEndpoint:setEndpoint,setProject:setProject,setKey:setKey,setLocale:setLocale,setMode:setMode,account:account,avatars:avatars,database:database,health:health,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);}}
|
||||
|
@ -2572,7 +2574,8 @@ $value=abbreviate($value,0,false,false);return $value==="0"?"N/A":$value;}).add(
|
|||
return result.length;}).add("documentAction",function(container){let collection=container.get('project-collection');let document=container.get('project-document');if(collection&&document&&!document.$id){return'database.createDocument';}
|
||||
return'database.updateDocument';}).add("documentSuccess",function(container){let document=container.get('project-document');if(document&&!document.$id){return',redirect';}
|
||||
return'';}).add("firstElement",function($value){if($value&&$value[0]){return $value[0];}
|
||||
return $value;}).add("platformsLimit",function($value){return $value;}).add("limit",function($value){let postfix=($value.length>=50)?'...':'';return $value.substring(0,50)+postfix;;});function abbreviate(number,maxPlaces,forcePlaces,forceLetter){number=Number(number);forceLetter=forceLetter||false;if(forceLetter!==false){return annotate(number,maxPlaces,forcePlaces,forceLetter);}
|
||||
return $value;}).add("platformsLimit",function($value){return $value;}).add("limit",function($value){let postfix=($value.length>=50)?'...':'';return $value.substring(0,50)+postfix;;}).add("arraySentence",function($value){if(!Array.isArray($value)){return'';}
|
||||
return $value.join(", ").replace(/,\s([^,]+)$/,' and $1');});function abbreviate(number,maxPlaces,forcePlaces,forceLetter){number=Number(number);forceLetter=forceLetter||false;if(forceLetter!==false){return annotate(number,maxPlaces,forcePlaces,forceLetter);}
|
||||
let abbr;if(number>=1e12){abbr="T";}else if(number>=1e9){abbr="B";}else if(number>=1e6){abbr="M";}else if(number>=1e3){abbr="K";}else{abbr="";}
|
||||
return annotate(number,maxPlaces,forcePlaces,abbr);}
|
||||
function annotate(number,maxPlaces,forcePlaces,abbr){let rounded=0;switch(abbr){case"T":rounded=number/1e12;break;case"B":rounded=number/1e9;break;case"M":rounded=number/1e6;break;case"K":rounded=number/1e3;break;case"":rounded=number;break;}
|
||||
|
|
36
public/dist/scripts/app-dep.js
vendored
36
public/dist/scripts/app-dep.js
vendored
|
@ -18,8 +18,7 @@ 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;}
|
||||
let cookieFallback=this.getResponseHeader('X-Fallback-Cookies')||'';if(window.localStorage&&cookieFallback){window.console.warn('Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.');window.localStorage.setItem('cookieFallback',cookieFallback);}
|
||||
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';let payload={};return http.get(path,{'content-type':'application/json',},payload);},create:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
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 account={get:function(){let path='/account';let payload={};return http.get(path,{'content-type':'application/json',},payload);},create: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='/account';let payload={};if(email){payload['email']=email;}
|
||||
if(password){payload['password']=password;}
|
||||
|
@ -52,12 +51,10 @@ return http.put(path,{'content-type':'application/json',},payload);},getSessions
|
|||
if(password===undefined){throw new Error('Missing required parameter: "password"');}
|
||||
let path='/account/sessions';let payload={};if(email){payload['email']=email;}
|
||||
if(password){payload['password']=password;}
|
||||
return http.post(path,{'content-type':'application/json',},payload);},deleteSessions:function(){let path='/account/sessions';let payload={};return http.delete(path,{'content-type':'application/json',},payload);},createOAuth2Session:function(provider,success,failure){if(provider===undefined){throw new Error('Missing required parameter: "provider"');}
|
||||
if(success===undefined){throw new Error('Missing required parameter: "success"');}
|
||||
if(failure===undefined){throw new Error('Missing required parameter: "failure"');}
|
||||
return http.post(path,{'content-type':'application/json',},payload);},deleteSessions:function(){let path='/account/sessions';let payload={};return http.delete(path,{'content-type':'application/json',},payload);},createOAuth2Session:function(provider,success='https://appwrite.io/auth/oauth2/success',failure='https://appwrite.io/auth/oauth2/failure'){if(provider===undefined){throw new Error('Missing required parameter: "provider"');}
|
||||
let path='/account/sessions/oauth2/{provider}'.replace(new RegExp('{provider}','g'),provider);let payload={};if(success){payload['success']=success;}
|
||||
if(failure){payload['failure']=failure;}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},deleteSession:function(sessionId){if(sessionId===undefined){throw new Error('Missing required parameter: "sessionId"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');window.location=config.endpoint+path+((query)?'?'+query:'');},deleteSession:function(sessionId){if(sessionId===undefined){throw new Error('Missing required parameter: "sessionId"');}
|
||||
let path='/account/sessions/{sessionId}'.replace(new RegExp('{sessionId}','g'),sessionId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},createVerification:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
let path='/account/verification';let payload={};if(url){payload['url']=url;}
|
||||
return http.post(path,{'content-type':'application/json',},payload);},updateVerification:function(userId,secret){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
|
@ -68,26 +65,26 @@ return http.put(path,{'content-type':'application/json',},payload);}};let avatar
|
|||
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"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},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"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},getFavicon:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
let path='/avatars/favicon';let payload={};if(url){payload['url']=url;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);},getFlag:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},getFlag:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"');}
|
||||
let path='/avatars/flags/{code}'.replace(new RegExp('{code}','g'),code);let payload={};if(width){payload['width']=width;}
|
||||
if(height){payload['height']=height;}
|
||||
if(quality){payload['quality']=quality;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);},getImage:function(url,width=400,height=400){if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},getImage:function(url,width=400,height=400){if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
let path='/avatars/image';let payload={};if(url){payload['url']=url;}
|
||||
if(width){payload['width']=width;}
|
||||
if(height){payload['height']=height;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);},getQR:function(text,size=400,margin=1,download=0){if(text===undefined){throw new Error('Missing required parameter: "text"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},getQR:function(text,size=400,margin=1,download=0){if(text===undefined){throw new Error('Missing required parameter: "text"');}
|
||||
let path='/avatars/qr';let payload={};if(text){payload['text']=text;}
|
||||
if(size){payload['size']=size;}
|
||||
if(margin){payload['margin']=margin;}
|
||||
if(download){payload['download']=download;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);}};let database={listCollections:function(search='',limit=25,offset=0,orderType='ASC'){let path='/database/collections';let payload={};if(search){payload['search']=search;}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');}};let database={listCollections:function(search='',limit=25,offset=0,orderType='ASC'){let path='/database/collections';let payload={};if(search){payload['search']=search;}
|
||||
if(limit){payload['limit']=limit;}
|
||||
if(offset){payload['offset']=offset;}
|
||||
if(orderType){payload['orderType']=orderType;}
|
||||
|
@ -141,7 +138,8 @@ 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/collections/{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={get:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getContinents:function(){let path='/locale/continents';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={list:function(){let path='/projects';let payload={};return http.get(path,{'content-type':'application/json',},payload);},create: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/collections/{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);},getCollectionLogs:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/collections/{collectionId}/logs'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let health={get:function(){let path='/health';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getAntiVirus:function(){let path='/health/anti-virus';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCache:function(){let path='/health/cache';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getDB:function(){let path='/health/db';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueCertificates:function(){let path='/health/queue/certificates';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueFunctions:function(){let path='/health/queue/functions';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueLogs:function(){let path='/health/queue/logs';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueTasks:function(){let path='/health/queue/tasks';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueUsage:function(){let path='/health/queue/usage';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueWebhooks:function(){let path='/health/queue/webhooks';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getStorageLocal:function(){let path='/health/storage/local';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getTime:function(){let path='/health/time';let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let locale={get:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getContinents:function(){let path='/locale/continents';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={list:function(){let path='/projects';let payload={};return http.get(path,{'content-type':'application/json',},payload);},create: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';let payload={};if(name){payload['name']=name;}
|
||||
if(teamId){payload['teamId']=teamId;}
|
||||
|
@ -259,7 +257,7 @@ 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);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getUsage:function(projectId,range='monthly'){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);},getUsage:function(projectId,range='last30'){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/usage'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(range){payload['range']=range;}
|
||||
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"');}
|
||||
|
@ -327,8 +325,12 @@ let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payloa
|
|||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
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);},delete: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);},getMemberships:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},createMembership:function(teamId,email,roles,url,name=''){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);},getMemberships:function(teamId,search='',limit=25,offset=0,orderType='ASC'){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);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);},createMembership:function(teamId,email,roles,url,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(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
|
@ -366,7 +368,7 @@ if(sessionId===undefined){throw new Error('Missing required parameter: "sessionI
|
|||
let path='/users/{userId}/sessions/{sessionId}'.replace(new RegExp('{userId}','g'),userId).replace(new RegExp('{sessionId}','g'),sessionId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},updateStatus: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);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,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}
|
||||
return http.patch(path,{'content-type':'application/json',},payload);}};return{setEndpoint:setEndpoint,setProject:setProject,setKey:setKey,setLocale:setLocale,setMode:setMode,account:account,avatars:avatars,database:database,health:health,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);}}
|
||||
|
|
3
public/dist/scripts/app.js
vendored
3
public/dist/scripts/app.js
vendored
|
@ -288,7 +288,8 @@ $value=abbreviate($value,0,false,false);return $value==="0"?"N/A":$value;}).add(
|
|||
return result.length;}).add("documentAction",function(container){let collection=container.get('project-collection');let document=container.get('project-document');if(collection&&document&&!document.$id){return'database.createDocument';}
|
||||
return'database.updateDocument';}).add("documentSuccess",function(container){let document=container.get('project-document');if(document&&!document.$id){return',redirect';}
|
||||
return'';}).add("firstElement",function($value){if($value&&$value[0]){return $value[0];}
|
||||
return $value;}).add("platformsLimit",function($value){return $value;}).add("limit",function($value){let postfix=($value.length>=50)?'...':'';return $value.substring(0,50)+postfix;;});function abbreviate(number,maxPlaces,forcePlaces,forceLetter){number=Number(number);forceLetter=forceLetter||false;if(forceLetter!==false){return annotate(number,maxPlaces,forcePlaces,forceLetter);}
|
||||
return $value;}).add("platformsLimit",function($value){return $value;}).add("limit",function($value){let postfix=($value.length>=50)?'...':'';return $value.substring(0,50)+postfix;;}).add("arraySentence",function($value){if(!Array.isArray($value)){return'';}
|
||||
return $value.join(", ").replace(/,\s([^,]+)$/,' and $1');});function abbreviate(number,maxPlaces,forcePlaces,forceLetter){number=Number(number);forceLetter=forceLetter||false;if(forceLetter!==false){return annotate(number,maxPlaces,forcePlaces,forceLetter);}
|
||||
let abbr;if(number>=1e12){abbr="T";}else if(number>=1e9){abbr="B";}else if(number>=1e6){abbr="M";}else if(number>=1e3){abbr="K";}else{abbr="";}
|
||||
return annotate(number,maxPlaces,forcePlaces,abbr);}
|
||||
function annotate(number,maxPlaces,forcePlaces,abbr){let rounded=0;switch(abbr){case"T":rounded=number/1e12;break;case"B":rounded=number/1e9;break;case"M":rounded=number/1e6;break;case"K":rounded=number/1e3;break;case"":rounded=number;break;}
|
||||
|
|
|
@ -286,28 +286,6 @@
|
|||
}
|
||||
}(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 = {
|
||||
|
||||
/**
|
||||
|
@ -334,10 +312,10 @@
|
|||
*
|
||||
* Use this endpoint to allow a new user to register a new account in your
|
||||
* project. After the user registration completes successfully, you can use
|
||||
* the [/account/verfication](/docs/account#createVerification) route to start
|
||||
* verifying the user email address. To allow your new user to login to his
|
||||
* new account, you need to create a new [account
|
||||
* session](/docs/account#createSession).
|
||||
* the [/account/verfication](/docs/client/account#createVerification) route
|
||||
* to start verifying the user email address. To allow your new user to login
|
||||
* to his new account, you need to create a new [account
|
||||
* session](/docs/client/account#createSession).
|
||||
*
|
||||
* @param {string} email
|
||||
* @param {string} password
|
||||
|
@ -580,7 +558,7 @@
|
|||
* When the user clicks the confirmation link he is redirected back to your
|
||||
* app password reset URL with the secret key and email address values
|
||||
* attached to the URL query string. Use the query string params to submit a
|
||||
* request to the [PUT /account/recovery](/docs/account#updateRecovery)
|
||||
* request to the [PUT /account/recovery](/docs/client/account#updateRecovery)
|
||||
* endpoint to complete the process.
|
||||
*
|
||||
* @param {string} email
|
||||
|
@ -621,7 +599,7 @@
|
|||
* Use this endpoint to complete the user account password reset. Both the
|
||||
* **userId** and **secret** arguments will be passed as query parameters to
|
||||
* the redirect URL you have provided when sending your request to the [POST
|
||||
* /account/recovery](/docs/account#createRecovery) endpoint.
|
||||
* /account/recovery](/docs/client/account#createRecovery) endpoint.
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
@ -768,21 +746,13 @@
|
|||
* @param {string} success
|
||||
* @param {string} failure
|
||||
* @throws {Error}
|
||||
* @return {string}
|
||||
* @return {Promise}
|
||||
*/
|
||||
createOAuth2Session: function(provider, success, failure) {
|
||||
createOAuth2Session: function(provider, success = 'https://appwrite.io/auth/oauth2/success', failure = 'https://appwrite.io/auth/oauth2/failure') {
|
||||
if(provider === undefined) {
|
||||
throw new Error('Missing required parameter: "provider"');
|
||||
}
|
||||
|
||||
if(success === undefined) {
|
||||
throw new Error('Missing required parameter: "success"');
|
||||
}
|
||||
|
||||
if(failure === undefined) {
|
||||
throw new Error('Missing required parameter: "failure"');
|
||||
}
|
||||
|
||||
let path = '/account/sessions/oauth2/{provider}'.replace(new RegExp('{provider}', 'g'), provider);
|
||||
|
||||
let payload = {};
|
||||
|
@ -800,8 +770,8 @@
|
|||
payload['key'] = config.key;
|
||||
|
||||
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
|
||||
|
||||
return config.endpoint + path + ((query) ? '?' + query : '');
|
||||
|
||||
window.location = config.endpoint + path + ((query) ? '?' + query : '');
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -840,7 +810,7 @@
|
|||
* should redirect the user back for your app and allow you to complete the
|
||||
* verification process by verifying both the **userId** and **secret**
|
||||
* parameters. Learn more about how to [complete the verification
|
||||
* process](/docs/account#updateAccountVerification).
|
||||
* process](/docs/client/account#updateAccountVerification).
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
@ -926,7 +896,7 @@
|
|||
* @param {number} height
|
||||
* @param {number} quality
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
* @return {string}
|
||||
*/
|
||||
getBrowser: function(code, width = 100, height = 100, quality = 100) {
|
||||
if(code === undefined) {
|
||||
|
@ -949,10 +919,13 @@
|
|||
payload['quality'] = quality;
|
||||
}
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
payload['project'] = config.project;
|
||||
|
||||
payload['key'] = config.key;
|
||||
|
||||
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
|
||||
|
||||
return config.endpoint + path + ((query) ? '?' + query : '');
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -968,7 +941,7 @@
|
|||
* @param {number} height
|
||||
* @param {number} quality
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
* @return {string}
|
||||
*/
|
||||
getCreditCard: function(code, width = 100, height = 100, quality = 100) {
|
||||
if(code === undefined) {
|
||||
|
@ -991,10 +964,13 @@
|
|||
payload['quality'] = quality;
|
||||
}
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
payload['project'] = config.project;
|
||||
|
||||
payload['key'] = config.key;
|
||||
|
||||
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
|
||||
|
||||
return config.endpoint + path + ((query) ? '?' + query : '');
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -1005,7 +981,7 @@
|
|||
*
|
||||
* @param {string} url
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
* @return {string}
|
||||
*/
|
||||
getFavicon: function(url) {
|
||||
if(url === undefined) {
|
||||
|
@ -1020,10 +996,13 @@
|
|||
payload['url'] = url;
|
||||
}
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
payload['project'] = config.project;
|
||||
|
||||
payload['key'] = config.key;
|
||||
|
||||
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
|
||||
|
||||
return config.endpoint + path + ((query) ? '?' + query : '');
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -1038,7 +1017,7 @@
|
|||
* @param {number} height
|
||||
* @param {number} quality
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
* @return {string}
|
||||
*/
|
||||
getFlag: function(code, width = 100, height = 100, quality = 100) {
|
||||
if(code === undefined) {
|
||||
|
@ -1061,10 +1040,13 @@
|
|||
payload['quality'] = quality;
|
||||
}
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
payload['project'] = config.project;
|
||||
|
||||
payload['key'] = config.key;
|
||||
|
||||
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
|
||||
|
||||
return config.endpoint + path + ((query) ? '?' + query : '');
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -1079,7 +1061,7 @@
|
|||
* @param {number} width
|
||||
* @param {number} height
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
* @return {string}
|
||||
*/
|
||||
getImage: function(url, width = 400, height = 400) {
|
||||
if(url === undefined) {
|
||||
|
@ -1102,10 +1084,13 @@
|
|||
payload['height'] = height;
|
||||
}
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
payload['project'] = config.project;
|
||||
|
||||
payload['key'] = config.key;
|
||||
|
||||
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
|
||||
|
||||
return config.endpoint + path + ((query) ? '?' + query : '');
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -1119,7 +1104,7 @@
|
|||
* @param {number} margin
|
||||
* @param {number} download
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
* @return {string}
|
||||
*/
|
||||
getQR: function(text, size = 400, margin = 1, download = 0) {
|
||||
if(text === undefined) {
|
||||
|
@ -1146,10 +1131,13 @@
|
|||
payload['download'] = download;
|
||||
}
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
payload['project'] = config.project;
|
||||
|
||||
payload['key'] = config.key;
|
||||
|
||||
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
|
||||
|
||||
return config.endpoint + path + ((query) ? '?' + query : '');
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1203,9 +1191,9 @@
|
|||
* Create a new Collection.
|
||||
*
|
||||
* @param {string} name
|
||||
* @param {array} read
|
||||
* @param {array} write
|
||||
* @param {array} rules
|
||||
* @param {string[]} read
|
||||
* @param {string[]} write
|
||||
* @param {string[]} rules
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
@ -1284,9 +1272,9 @@
|
|||
*
|
||||
* @param {string} collectionId
|
||||
* @param {string} name
|
||||
* @param {array} read
|
||||
* @param {array} write
|
||||
* @param {array} rules
|
||||
* @param {string[]} read
|
||||
* @param {string[]} write
|
||||
* @param {string[]} rules
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
@ -1367,7 +1355,7 @@
|
|||
* modes](/docs/admin).
|
||||
*
|
||||
* @param {string} collectionId
|
||||
* @param {array} filters
|
||||
* @param {string[]} filters
|
||||
* @param {number} offset
|
||||
* @param {number} limit
|
||||
* @param {string} orderField
|
||||
|
@ -1433,12 +1421,15 @@
|
|||
/**
|
||||
* Create Document
|
||||
*
|
||||
* Create a new Document.
|
||||
* Create a new Document. Before using this route, you should create a new
|
||||
* collection resource using either a [server
|
||||
* integration](/docs/server/database?sdk=nodejs#createCollection) API or
|
||||
* directly from your database console.
|
||||
*
|
||||
* @param {string} collectionId
|
||||
* @param {object} data
|
||||
* @param {array} read
|
||||
* @param {array} write
|
||||
* @param {string[]} read
|
||||
* @param {string[]} write
|
||||
* @param {string} parentDocument
|
||||
* @param {string} parentProperty
|
||||
* @param {string} parentPropertyType
|
||||
|
@ -1533,8 +1524,8 @@
|
|||
* @param {string} collectionId
|
||||
* @param {string} documentId
|
||||
* @param {object} data
|
||||
* @param {array} read
|
||||
* @param {array} write
|
||||
* @param {string[]} read
|
||||
* @param {string[]} write
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
@ -1610,6 +1601,272 @@
|
|||
.delete(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get Collection Logs
|
||||
*
|
||||
*
|
||||
* @param {string} collectionId
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getCollectionLogs: function(collectionId) {
|
||||
if(collectionId === undefined) {
|
||||
throw new Error('Missing required parameter: "collectionId"');
|
||||
}
|
||||
|
||||
let path = '/database/collections/{collectionId}/logs'.replace(new RegExp('{collectionId}', 'g'), collectionId);
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
}
|
||||
};
|
||||
|
||||
let health = {
|
||||
|
||||
/**
|
||||
* Get HTTP
|
||||
*
|
||||
* Check the Appwrite HTTP server is up and responsive.
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
get: function() {
|
||||
let path = '/health';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get Anti virus
|
||||
*
|
||||
* Check the Appwrite Anti Virus server is up and connection is successful.
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getAntiVirus: function() {
|
||||
let path = '/health/anti-virus';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get Cache
|
||||
*
|
||||
* Check the Appwrite in-memory cache server is up and connection is
|
||||
* successful.
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getCache: function() {
|
||||
let path = '/health/cache';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get DB
|
||||
*
|
||||
* Check the Appwrite database server is up and connection is successful.
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getDB: function() {
|
||||
let path = '/health/db';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get Certificate Queue
|
||||
*
|
||||
* Get the number of certificates that are waiting to be issued against
|
||||
* [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue
|
||||
* server.
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getQueueCertificates: function() {
|
||||
let path = '/health/queue/certificates';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get Functions Queue
|
||||
*
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getQueueFunctions: function() {
|
||||
let path = '/health/queue/functions';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get Logs Queue
|
||||
*
|
||||
* Get the number of logs that are waiting to be processed in the Appwrite
|
||||
* internal queue server.
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getQueueLogs: function() {
|
||||
let path = '/health/queue/logs';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get Tasks Queue
|
||||
*
|
||||
* Get the number of tasks that are waiting to be processed in the Appwrite
|
||||
* internal queue server.
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getQueueTasks: function() {
|
||||
let path = '/health/queue/tasks';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get Usage Queue
|
||||
*
|
||||
* Get the number of usage stats that are waiting to be processed in the
|
||||
* Appwrite internal queue server.
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getQueueUsage: function() {
|
||||
let path = '/health/queue/usage';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get Webhooks Queue
|
||||
*
|
||||
* Get the number of webhooks that are waiting to be processed in the Appwrite
|
||||
* internal queue server.
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getQueueWebhooks: function() {
|
||||
let path = '/health/queue/webhooks';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get Local Storage
|
||||
*
|
||||
* Check the Appwrite local storage device is up and connection is successful.
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getStorageLocal: function() {
|
||||
let path = '/health/storage/local';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get Time
|
||||
*
|
||||
* Check the Appwrite server time is synced with Google remote NTP server. We
|
||||
* use this technology to smoothly handle leap seconds with no disruptive
|
||||
* events. The [Network Time
|
||||
* Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is
|
||||
* used by hundreds of millions of computers and devices to synchronize their
|
||||
* clocks over the Internet. If your computer sets its own clock, it likely
|
||||
* uses NTP.
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getTime: function() {
|
||||
let path = '/health/time';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1640,7 +1897,7 @@
|
|||
},
|
||||
|
||||
/**
|
||||
* List Countries
|
||||
* List Continents
|
||||
*
|
||||
* List of all continents. You can use the locale header to get the data in a
|
||||
* supported language.
|
||||
|
@ -2142,7 +2399,7 @@
|
|||
*
|
||||
* @param {string} projectId
|
||||
* @param {string} name
|
||||
* @param {array} scopes
|
||||
* @param {string[]} scopes
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
@ -2212,7 +2469,7 @@
|
|||
* @param {string} projectId
|
||||
* @param {string} keyId
|
||||
* @param {string} name
|
||||
* @param {array} scopes
|
||||
* @param {string[]} scopes
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
@ -2542,7 +2799,7 @@
|
|||
* @param {number} security
|
||||
* @param {string} httpMethod
|
||||
* @param {string} httpUrl
|
||||
* @param {array} httpHeaders
|
||||
* @param {string[]} httpHeaders
|
||||
* @param {string} httpUser
|
||||
* @param {string} httpPass
|
||||
* @throws {Error}
|
||||
|
@ -2663,7 +2920,7 @@
|
|||
* @param {number} security
|
||||
* @param {string} httpMethod
|
||||
* @param {string} httpUrl
|
||||
* @param {array} httpHeaders
|
||||
* @param {string[]} httpHeaders
|
||||
* @param {string} httpUser
|
||||
* @param {string} httpPass
|
||||
* @throws {Error}
|
||||
|
@ -2781,10 +3038,11 @@
|
|||
*
|
||||
*
|
||||
* @param {string} projectId
|
||||
* @param {string} range
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getUsage: function(projectId, range = 'monthly') {
|
||||
getUsage: function(projectId, range = 'last30') {
|
||||
if(projectId === undefined) {
|
||||
throw new Error('Missing required parameter: "projectId"');
|
||||
}
|
||||
|
@ -2832,7 +3090,7 @@
|
|||
*
|
||||
* @param {string} projectId
|
||||
* @param {string} name
|
||||
* @param {array} events
|
||||
* @param {string[]} events
|
||||
* @param {string} url
|
||||
* @param {number} security
|
||||
* @param {string} httpUser
|
||||
|
@ -2930,7 +3188,7 @@
|
|||
* @param {string} projectId
|
||||
* @param {string} webhookId
|
||||
* @param {string} name
|
||||
* @param {array} events
|
||||
* @param {string[]} events
|
||||
* @param {string} url
|
||||
* @param {number} security
|
||||
* @param {string} httpUser
|
||||
|
@ -3077,8 +3335,8 @@
|
|||
* read and write arguments.
|
||||
*
|
||||
* @param {File} file
|
||||
* @param {array} read
|
||||
* @param {array} write
|
||||
* @param {string[]} read
|
||||
* @param {string[]} write
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
@ -3149,8 +3407,8 @@
|
|||
* to update this resource.
|
||||
*
|
||||
* @param {string} fileId
|
||||
* @param {array} read
|
||||
* @param {array} write
|
||||
* @param {string[]} read
|
||||
* @param {string[]} write
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
@ -3235,7 +3493,7 @@
|
|||
payload['key'] = config.key;
|
||||
|
||||
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
|
||||
|
||||
|
||||
return config.endpoint + path + ((query) ? '?' + query : '');
|
||||
},
|
||||
|
||||
|
@ -3290,7 +3548,7 @@
|
|||
payload['key'] = config.key;
|
||||
|
||||
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
|
||||
|
||||
|
||||
return config.endpoint + path + ((query) ? '?' + query : '');
|
||||
},
|
||||
|
||||
|
@ -3323,7 +3581,7 @@
|
|||
payload['key'] = config.key;
|
||||
|
||||
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
|
||||
|
||||
|
||||
return config.endpoint + path + ((query) ? '?' + query : '');
|
||||
}
|
||||
};
|
||||
|
@ -3380,7 +3638,7 @@
|
|||
* project.
|
||||
*
|
||||
* @param {string} name
|
||||
* @param {array} roles
|
||||
* @param {string[]} roles
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
@ -3498,10 +3756,14 @@
|
|||
* for this list of resources.
|
||||
*
|
||||
* @param {string} teamId
|
||||
* @param {string} search
|
||||
* @param {number} limit
|
||||
* @param {number} offset
|
||||
* @param {string} orderType
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getMemberships: function(teamId) {
|
||||
getMemberships: function(teamId, search = '', limit = 25, offset = 0, orderType = 'ASC') {
|
||||
if(teamId === undefined) {
|
||||
throw new Error('Missing required parameter: "teamId"');
|
||||
}
|
||||
|
@ -3510,6 +3772,22 @@
|
|||
|
||||
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',
|
||||
|
@ -3525,8 +3803,8 @@
|
|||
*
|
||||
* Use the 'URL' parameter to redirect the user from the invitation email back
|
||||
* to your app. When the user is redirected, use the [Update Team Membership
|
||||
* Status](/docs/teams#updateMembershipStatus) endpoint to allow the user to
|
||||
* accept the invitation to the team.
|
||||
* Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the
|
||||
* user to accept the invitation to the team.
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
@ -3535,7 +3813,7 @@
|
|||
*
|
||||
* @param {string} teamId
|
||||
* @param {string} email
|
||||
* @param {array} roles
|
||||
* @param {string[]} roles
|
||||
* @param {string} url
|
||||
* @param {string} name
|
||||
* @throws {Error}
|
||||
|
@ -3922,10 +4200,7 @@
|
|||
throw new Error('Missing required parameter: "sessionId"');
|
||||
}
|
||||
|
||||
let path = '/users/{userId}/sessions/{sessionId}'
|
||||
.replace(new RegExp('{userId}', 'g'), userId)
|
||||
.replace(new RegExp('{sessionId}', 'g'), sessionId)
|
||||
;
|
||||
let path = '/users/{userId}/sessions/{sessionId}'.replace(new RegExp('{userId}', 'g'), userId).replace(new RegExp('{sessionId}', 'g'), sessionId);
|
||||
|
||||
let payload = {};
|
||||
|
||||
|
@ -3978,6 +4253,7 @@
|
|||
account: account,
|
||||
avatars: avatars,
|
||||
database: database,
|
||||
health: health,
|
||||
locale: locale,
|
||||
projects: projects,
|
||||
storage: storage,
|
||||
|
|
Loading…
Reference in a new issue