1
0
Fork 0
mirror of synced 2024-06-28 03:01:15 +12:00

Updated SDKs

This commit is contained in:
Eldad Fux 2020-04-19 07:03:52 +03:00
parent e20e262482
commit 1e14db943e
18 changed files with 2386 additions and 74 deletions

View file

@ -7,10 +7,13 @@
"version": "1.0.0",
"license": "BSD-3-Clause",
"main": "src/sdk.js",
"types": "types/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/appwrite/sdk-for-console"
},
"devDependencies": {},
"devDependencies": {
"typescript": "^3.6.4"
},
"dependencies": {}
}

View file

@ -1173,9 +1173,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}
*/
@ -1254,9 +1254,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}
*/
@ -1337,7 +1337,7 @@
* modes](/docs/admin).
*
* @param {string} collectionId
* @param {array} filters
* @param {string[]} filters
* @param {number} offset
* @param {number} limit
* @param {string} orderField
@ -1407,8 +1407,8 @@
*
* @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
@ -1503,8 +1503,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,7 +1610,7 @@
},
/**
* List Countries
* List Continents
*
* List of all continents. You can use the locale header to get the data in a
* supported language.
@ -2112,7 +2112,7 @@
*
* @param {string} projectId
* @param {string} name
* @param {array} scopes
* @param {string[]} scopes
* @throws {Error}
* @return {Promise}
*/
@ -2182,7 +2182,7 @@
* @param {string} projectId
* @param {string} keyId
* @param {string} name
* @param {array} scopes
* @param {string[]} scopes
* @throws {Error}
* @return {Promise}
*/
@ -2512,7 +2512,7 @@
* @param {number} security
* @param {string} httpMethod
* @param {string} httpUrl
* @param {array} httpHeaders
* @param {string[]} httpHeaders
* @param {string} httpUser
* @param {string} httpPass
* @throws {Error}
@ -2633,7 +2633,7 @@
* @param {number} security
* @param {string} httpMethod
* @param {string} httpUrl
* @param {array} httpHeaders
* @param {string[]} httpHeaders
* @param {string} httpUser
* @param {string} httpPass
* @throws {Error}
@ -2798,7 +2798,7 @@
*
* @param {string} projectId
* @param {string} name
* @param {array} events
* @param {string[]} events
* @param {string} url
* @param {number} security
* @param {string} httpUser
@ -2896,7 +2896,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
@ -3043,8 +3043,8 @@
* read and write arguments.
*
* @param {File} file
* @param {array} read
* @param {array} write
* @param {string[]} read
* @param {string[]} write
* @throws {Error}
* @return {Promise}
*/
@ -3115,8 +3115,8 @@
* to update this resource.
*
* @param {string} fileId
* @param {array} read
* @param {array} write
* @param {string[]} read
* @param {string[]} write
* @throws {Error}
* @return {Promise}
*/
@ -3346,7 +3346,7 @@
* project.
*
* @param {string} name
* @param {array} roles
* @param {string[]} roles
* @throws {Error}
* @return {Promise}
*/
@ -3501,7 +3501,7 @@
*
* @param {string} teamId
* @param {string} email
* @param {array} roles
* @param {string[]} roles
* @param {string} url
* @param {string} name
* @throws {Error}

View file

@ -0,0 +1,8 @@
{
"compilerOptions": {
"target": "ES6",
"lib": ["ES2015", "ES6", "dom"],
"module": "commonjs",
"sourceMap": true
}
}

File diff suppressed because it is too large Load diff

View file

@ -32,7 +32,7 @@ class Locale extends Service {
return client.call(HttpMethod.get, path: path, params: params, headers: headers);
}
/// List Countries
/// List Continents
///
/// List of all continents. You can use the locale header to get the data in a
/// supported language.

View file

@ -37,9 +37,9 @@ class Database extends Service {
* 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 Exception
* @return {}
*/
@ -84,9 +84,9 @@ class Database extends Service {
*
* @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 Exception
* @return {}
*/
@ -133,7 +133,7 @@ class Database extends Service {
* modes](/docs/admin).
*
* @param string collectionId
* @param array filters
* @param string[] filters
* @param number offset
* @param number limit
* @param string orderField
@ -171,8 +171,8 @@ class Database extends Service {
*
* @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
@ -222,8 +222,8 @@ class Database extends Service {
* @param string collectionId
* @param string documentId
* @param object data
* @param array read
* @param array write
* @param string[] read
* @param string[] write
* @throws Exception
* @return {}
*/

View file

@ -26,7 +26,7 @@ class Locale extends Service {
}
/**
* List Countries
* List Continents
*
* List of all continents. You can use the locale header to get the data in a
* supported language.

View file

@ -38,8 +38,8 @@ class Storage extends Service {
* read and write arguments.
*
* @param File file
* @param array read
* @param array write
* @param string[] read
* @param string[] write
* @throws Exception
* @return {}
*/
@ -83,8 +83,8 @@ class Storage extends Service {
* to update this resource.
*
* @param string fileId
* @param array read
* @param array write
* @param string[] read
* @param string[] write
* @throws Exception
* @return {}
*/

View file

@ -39,7 +39,7 @@ class Teams extends Service {
* project.
*
* @param string name
* @param array roles
* @param string[] roles
* @throws Exception
* @return {}
*/
@ -156,7 +156,7 @@ class Teams extends Service {
*
* @param string teamId
* @param string email
* @param array roles
* @param string[] roles
* @param string url
* @param string name
* @throws Exception

View file

@ -100,8 +100,8 @@ GET https://appwrite.io/v1/database/collections/{collectionId}/documents
| order-type | string | Order direction. Possible values are DESC for descending order, or ASC for ascending order. | ASC |
| order-cast | string | Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string. | string |
| search | string | Search query. Enter any free text search. The database will try to find a match against all document attributes and children. | |
| first | integer | Return only first document. Pass 1 for true or 0 for false. The default value is 0. | 0 |
| last | integer | Return only last document. Pass 1 for true or 0 for false. The default value is 0. | 0 |
| first | integer | Return only the first document. Pass 1 for true or 0 for false. The default value is 0. | 0 |
| last | integer | Return only the last document. Pass 1 for true or 0 for false. The default value is 0. | 0 |
## Create Document

View file

@ -10,7 +10,7 @@ GET https://appwrite.io/v1/locale
([IP Geolocation by DB-IP](https://db-ip.com)) **
## List Countries
## List Continents
```http request
GET https://appwrite.io/v1/locale/continents

View file

@ -33,7 +33,7 @@ class Locale extends Service
}
/**
* List Countries
* List Continents
*
* List of all continents. You can use the locale header to get the data in a
* supported language.

View file

@ -17,7 +17,7 @@ class Locale(Service):
}, params)
def get_continents(self):
"""List Countries"""
"""List Continents"""
params = {}
path = '/locale/continents'

View file

@ -7,10 +7,13 @@
"version": "1.0.29",
"license": "BSD-3-Clause",
"main": "src/sdk.js",
"types": "types/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/appwrite/sdk-for-js"
},
"devDependencies": {},
"devDependencies": {
"typescript": "^3.6.4"
},
"dependencies": {}
}

View file

@ -1132,7 +1132,7 @@
* modes](/docs/admin).
*
* @param {string} collectionId
* @param {array} filters
* @param {string[]} filters
* @param {number} offset
* @param {number} limit
* @param {string} orderField
@ -1202,8 +1202,8 @@
*
* @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
@ -1298,8 +1298,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}
*/
@ -1405,7 +1405,7 @@
},
/**
* List Countries
* List Continents
*
* List of all continents. You can use the locale header to get the data in a
* supported language.
@ -1557,8 +1557,8 @@
* read and write arguments.
*
* @param {File} file
* @param {array} read
* @param {array} write
* @param {string[]} read
* @param {string[]} write
* @throws {Error}
* @return {Promise}
*/
@ -1629,8 +1629,8 @@
* to update this resource.
*
* @param {string} fileId
* @param {array} read
* @param {array} write
* @param {string[]} read
* @param {string[]} write
* @throws {Error}
* @return {Promise}
*/
@ -1854,7 +1854,7 @@
* project.
*
* @param {string} name
* @param {array} roles
* @param {string[]} roles
* @throws {Error}
* @return {Promise}
*/
@ -2009,7 +2009,7 @@
*
* @param {string} teamId
* @param {string} email
* @param {array} roles
* @param {string[]} roles
* @param {string} url
* @param {string} name
* @throws {Error}

View file

@ -0,0 +1,8 @@
{
"compilerOptions": {
"target": "ES6",
"lib": ["ES2015", "ES6", "dom"],
"module": "commonjs",
"sourceMap": true
}
}

844
app/sdks/web-javascript/types/index.d.ts vendored Normal file
View file

@ -0,0 +1,844 @@
// Type definitions for appwrite 1.0.29
// Project: Appwrite
/*~ This declaration specifies that the class constructor function
*~ is the exported object from the file
*/
export = Appwrite;
/*~ Write your module's methods and properties in this class */
declare class Appwrite {
constructor();
/**
* @param {string} endpoint
* @returns {this}
*/
setEndpoint(endpoint: string): this;
/**
* Set Project
*
* Your project ID
*
* @param value string
*
* @return this
*/
setProject(project: string): this;
/**
* Set Key
*
* Your secret API key
*
* @param value string
*
* @return this
*/
setKey(key: string): this;
/**
* Set Locale
*
* @param value string
*
* @return this
*/
setLocale(locale: string): this;
/**
* Set Mode
*
* @param value string
*
* @return this
*/
setMode(mode: string): this;
account:Appwrite.Account;
avatars:Appwrite.Avatars;
database:Appwrite.Database;
locale:Appwrite.Locale;
storage:Appwrite.Storage;
teams:Appwrite.Teams;
}
declare namespace Appwrite {
export interface Account {
/**
* Get Account
*
* Get currently logged in user data as JSON object.
*
* @throws {Error}
* @return {Promise}
*/
get(): Promise<object>;
/**
* Create Account
*
* 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).
*
* @param {string} email
* @param {string} password
* @param {string} name
* @throws {Error}
* @return {Promise}
*/
create(email: string, password: string, name: string): Promise<object>;
/**
* Delete Account
*
* Delete a currently logged in user account. Behind the scene, the user
* record is not deleted but permanently blocked from any access. This is done
* to avoid deleted accounts being overtaken by new users with the same email
* address. Any user-related resources like documents or storage files should
* be deleted separately.
*
* @throws {Error}
* @return {Promise}
*/
delete(): Promise<object>;
/**
* Update Account Email
*
* Update currently logged in user account email address. After changing user
* address, user confirmation status is being reset and a new confirmation
* mail is sent. For security measures, user password is required to complete
* this request.
*
* @param {string} email
* @param {string} password
* @throws {Error}
* @return {Promise}
*/
updateEmail(email: string, password: string): Promise<object>;
/**
* Get Account Logs
*
* Get currently logged in user list of latest security activity logs. Each
* log returns user IP address, location and date and time of log.
*
* @throws {Error}
* @return {Promise}
*/
getLogs(): Promise<object>;
/**
* Update Account Name
*
* Update currently logged in user account name.
*
* @param {string} name
* @throws {Error}
* @return {Promise}
*/
updateName(name: string): Promise<object>;
/**
* Update Account Password
*
* Update currently logged in user password. For validation, user is required
* to pass the password twice.
*
* @param {string} password
* @param {string} oldPassword
* @throws {Error}
* @return {Promise}
*/
updatePassword(password: string, oldPassword: string): Promise<object>;
/**
* Get Account Preferences
*
* Get currently logged in user preferences as a key-value object.
*
* @throws {Error}
* @return {Promise}
*/
getPrefs(): Promise<object>;
/**
* Update Account Preferences
*
* Update currently logged in user account preferences. You can pass only the
* specific settings you wish to update.
*
* @param {object} prefs
* @throws {Error}
* @return {Promise}
*/
updatePrefs(prefs: object): Promise<object>;
/**
* Create Password Recovery
*
* Sends the user an email with a temporary secret key for password reset.
* 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)
* endpoint to complete the process.
*
* @param {string} email
* @param {string} url
* @throws {Error}
* @return {Promise}
*/
createRecovery(email: string, url: string): Promise<object>;
/**
* Complete Password Recovery
*
* 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.
*
* 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)
* the only valid redirect URLs are the ones from domains you have set when
* adding your platforms in the console interface.
*
* @param {string} userId
* @param {string} secret
* @param {string} passwordA
* @param {string} passwordB
* @throws {Error}
* @return {Promise}
*/
updateRecovery(userId: string, secret: string, passwordA: string, passwordB: string): Promise<object>;
/**
* Get Account Sessions
*
* Get currently logged in user list of active sessions across different
* devices.
*
* @throws {Error}
* @return {Promise}
*/
getSessions(): Promise<object>;
/**
* Create Account Session
*
* Allow the user to login into his account by providing a valid email and
* password combination. This route will create a new session for the user.
*
* @param {string} email
* @param {string} password
* @throws {Error}
* @return {Promise}
*/
createSession(email: string, password: string): Promise<object>;
/**
* Delete All Account Sessions
*
* Delete all sessions from the user account and remove any sessions cookies
* from the end client.
*
* @throws {Error}
* @return {Promise}
*/
deleteSessions(): Promise<object>;
/**
* Create Account Session with OAuth2
*
* Allow the user to login to his account using the OAuth2 provider of his
* choice. Each OAuth2 provider should be enabled from the Appwrite console
* first. Use the success and failure arguments to provide a redirect URL's
* back to your app when login is completed.
*
* @param {string} provider
* @param {string} success
* @param {string} failure
* @throws {Error}
* @return {Promise}
*/
createOAuth2Session(provider: string, success: string, failure: string): Promise<object>;
/**
* Delete Account Session
*
* Use this endpoint to log out the currently logged in user from all his
* account sessions across all his different devices. When using the option id
* argument, only the session unique ID provider will be deleted.
*
* @param {string} sessionId
* @throws {Error}
* @return {Promise}
*/
deleteSession(sessionId: string): Promise<object>;
/**
* Create Email Verification
*
* Use this endpoint to send a verification message to your user email address
* to confirm they are the valid owners of that address. Both the **userId**
* and **secret** arguments will be passed as query parameters to the URL you
* have provider to be attached to the verification email. The provided URL
* 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).
*
* 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)
* the only valid redirect URLs are the ones from domains you have set when
* adding your platforms in the console interface.
*
* @param {string} url
* @throws {Error}
* @return {Promise}
*/
createVerification(url: string): Promise<object>;
/**
* Complete Email Verification
*
* Use this endpoint to complete the user email verification process. Use both
* the **userId** and **secret** parameters that were attached to your app URL
* to verify the user email ownership. If confirmed this route will return a
* 200 status code.
*
* @param {string} userId
* @param {string} secret
* @throws {Error}
* @return {Promise}
*/
updateVerification(userId: string, secret: string): Promise<object>;
}
export interface Avatars {
/**
* Get Browser Icon
*
* You can use this endpoint to show different browser icons to your users.
* The code argument receives the browser code as it appears in your user
* /account/sessions endpoint. Use width, height and quality arguments to
* change the output settings.
*
* @param {string} code
* @param {number} width
* @param {number} height
* @param {number} quality
* @throws {Error}
* @return {Promise}
*/
getBrowser(code: string, width: number, height: number, quality: number): Promise<object>;
/**
* Get Credit Card Icon
*
* Need to display your users with your billing method or their payment
* methods? The credit card endpoint will return you the icon of the credit
* card provider you need. Use width, height and quality arguments to change
* the output settings.
*
* @param {string} code
* @param {number} width
* @param {number} height
* @param {number} quality
* @throws {Error}
* @return {Promise}
*/
getCreditCard(code: string, width: number, height: number, quality: number): Promise<object>;
/**
* Get Favicon
*
* Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote
* website URL.
*
* @param {string} url
* @throws {Error}
* @return {Promise}
*/
getFavicon(url: string): Promise<object>;
/**
* Get Country Flag
*
* You can use this endpoint to show different country flags icons to your
* users. The code argument receives the 2 letter country code. Use width,
* height and quality arguments to change the output settings.
*
* @param {string} code
* @param {number} width
* @param {number} height
* @param {number} quality
* @throws {Error}
* @return {Promise}
*/
getFlag(code: string, width: number, height: number, quality: number): Promise<object>;
/**
* Get Image from URL
*
* Use this endpoint to fetch a remote image URL and crop it to any image size
* you want. This endpoint is very useful if you need to crop and display
* remote images in your app or in case you want to make sure a 3rd party
* image is properly served using a TLS protocol.
*
* @param {string} url
* @param {number} width
* @param {number} height
* @throws {Error}
* @return {Promise}
*/
getImage(url: string, width: number, height: number): Promise<object>;
/**
* Get QR Code
*
* Converts a given plain text to a QR code image. You can use the query
* parameters to change the size and style of the resulting image.
*
* @param {string} text
* @param {number} size
* @param {number} margin
* @param {number} download
* @throws {Error}
* @return {Promise}
*/
getQR(text: string, size: number, margin: number, download: number): Promise<object>;
}
export interface Database {
/**
* List Documents
*
* Get a list of all the user documents. You can use the query params to
* filter your results. On admin mode, this endpoint will return a list of all
* of the project documents. [Learn more about different API
* modes](/docs/admin).
*
* @param {string} collectionId
* @param {string[]} filters
* @param {number} offset
* @param {number} limit
* @param {string} orderField
* @param {string} orderType
* @param {string} orderCast
* @param {string} search
* @param {number} first
* @param {number} last
* @throws {Error}
* @return {Promise}
*/
listDocuments(collectionId: string, filters: string[], offset: number, limit: number, orderField: string, orderType: string, orderCast: string, search: string, first: number, last: number): Promise<object>;
/**
* Create Document
*
* Create a new Document.
*
* @param {string} collectionId
* @param {object} data
* @param {string[]} read
* @param {string[]} write
* @param {string} parentDocument
* @param {string} parentProperty
* @param {string} parentPropertyType
* @throws {Error}
* @return {Promise}
*/
createDocument(collectionId: string, data: object, read: string[], write: string[], parentDocument: string, parentProperty: string, parentPropertyType: string): Promise<object>;
/**
* Get Document
*
* Get document by its unique ID. This endpoint response returns a JSON object
* with the document data.
*
* @param {string} collectionId
* @param {string} documentId
* @throws {Error}
* @return {Promise}
*/
getDocument(collectionId: string, documentId: string): Promise<object>;
/**
* Update Document
*
*
* @param {string} collectionId
* @param {string} documentId
* @param {object} data
* @param {string[]} read
* @param {string[]} write
* @throws {Error}
* @return {Promise}
*/
updateDocument(collectionId: string, documentId: string, data: object, read: string[], write: string[]): Promise<object>;
/**
* Delete Document
*
* Delete document by its unique ID. This endpoint deletes only the parent
* documents, his attributes and relations to other documents. Child documents
* **will not** be deleted.
*
* @param {string} collectionId
* @param {string} documentId
* @throws {Error}
* @return {Promise}
*/
deleteDocument(collectionId: string, documentId: string): Promise<object>;
}
export interface Locale {
/**
* Get User Locale
*
* Get the current user location based on IP. Returns an object with user
* country code, country name, continent name, continent code, ip address and
* suggested currency. You can use the locale header to get the data in a
* supported language.
*
* ([IP Geolocation by DB-IP](https://db-ip.com))
*
* @throws {Error}
* @return {Promise}
*/
get(): Promise<object>;
/**
* List Continents
*
* List of all continents. You can use the locale header to get the data in a
* supported language.
*
* @throws {Error}
* @return {Promise}
*/
getContinents(): Promise<object>;
/**
* List Countries
*
* List of all countries. You can use the locale header to get the data in a
* supported language.
*
* @throws {Error}
* @return {Promise}
*/
getCountries(): Promise<object>;
/**
* List EU Countries
*
* List of all countries that are currently members of the EU. You can use the
* locale header to get the data in a supported language.
*
* @throws {Error}
* @return {Promise}
*/
getCountriesEU(): Promise<object>;
/**
* List Countries Phone Codes
*
* List of all countries phone codes. You can use the locale header to get the
* data in a supported language.
*
* @throws {Error}
* @return {Promise}
*/
getCountriesPhones(): Promise<object>;
/**
* List Currencies
*
* List of all currencies, including currency symol, name, plural, and decimal
* digits for all major and minor currencies. You can use the locale header to
* get the data in a supported language.
*
* @throws {Error}
* @return {Promise}
*/
getCurrencies(): Promise<object>;
}
export interface Storage {
/**
* List Files
*
* Get a list of all the user files. You can use the query params to filter
* your results. On admin mode, this endpoint will return a list of all of the
* project files. [Learn more about different API modes](/docs/admin).
*
* @param {string} search
* @param {number} limit
* @param {number} offset
* @param {string} orderType
* @throws {Error}
* @return {Promise}
*/
listFiles(search: string, limit: number, offset: number, orderType: string): Promise<object>;
/**
* Create File
*
* Create a new file. The user who creates the file will automatically be
* assigned to read and write access unless he has passed custom values for
* read and write arguments.
*
* @param {File} file
* @param {string[]} read
* @param {string[]} write
* @throws {Error}
* @return {Promise}
*/
createFile(file: File, read: string[], write: string[]): Promise<object>;
/**
* Get File
*
* Get file by its unique ID. This endpoint response returns a JSON object
* with the file metadata.
*
* @param {string} fileId
* @throws {Error}
* @return {Promise}
*/
getFile(fileId: string): Promise<object>;
/**
* Update File
*
* Update file by its unique ID. Only users with write permissions have access
* to update this resource.
*
* @param {string} fileId
* @param {string[]} read
* @param {string[]} write
* @throws {Error}
* @return {Promise}
*/
updateFile(fileId: string, read: string[], write: string[]): Promise<object>;
/**
* Delete File
*
* Delete a file by its unique ID. Only users with write permissions have
* access to delete this resource.
*
* @param {string} fileId
* @throws {Error}
* @return {Promise}
*/
deleteFile(fileId: string): Promise<object>;
/**
* Get File for Download
*
* Get file content by its unique ID. The endpoint response return with a
* 'Content-Disposition: attachment' header that tells the browser to start
* downloading the file to user downloads directory.
*
* @param {string} fileId
* @throws {Error}
* @return {string}
*/
getFileDownload(fileId: string): string;
/**
* Get File Preview
*
* Get a file preview image. Currently, this method supports preview for image
* files (jpg, png, and gif), other supported formats, like pdf, docs, slides,
* and spreadsheets, will return the file icon image. You can also pass query
* string arguments for cutting and resizing your preview image.
*
* @param {string} fileId
* @param {number} width
* @param {number} height
* @param {number} quality
* @param {string} background
* @param {string} output
* @throws {Error}
* @return {string}
*/
getFilePreview(fileId: string, width: number, height: number, quality: number, background: string, output: string): string;
/**
* Get File for View
*
* Get file content by its unique ID. This endpoint is similar to the download
* method but returns with no 'Content-Disposition: attachment' header.
*
* @param {string} fileId
* @param {string} as
* @throws {Error}
* @return {string}
*/
getFileView(fileId: string, as: string): string;
}
export interface Teams {
/**
* List Teams
*
* Get a list of all the current user teams. You can use the query params to
* filter your results. On admin mode, this endpoint will return a list of all
* of the project teams. [Learn more about different API modes](/docs/admin).
*
* @param {string} search
* @param {number} limit
* @param {number} offset
* @param {string} orderType
* @throws {Error}
* @return {Promise}
*/
list(search: string, limit: number, offset: number, orderType: string): Promise<object>;
/**
* Create Team
*
* Create a new team. The user who creates the team will automatically be
* assigned as the owner of the team. The team owner can invite new members,
* who will be able add new owners and update or delete the team from your
* project.
*
* @param {string} name
* @param {string[]} roles
* @throws {Error}
* @return {Promise}
*/
create(name: string, roles: string[]): Promise<object>;
/**
* Get Team
*
* Get team by its unique ID. All team members have read access for this
* resource.
*
* @param {string} teamId
* @throws {Error}
* @return {Promise}
*/
get(teamId: string): Promise<object>;
/**
* Update Team
*
* Update team by its unique ID. Only team owners have write access for this
* resource.
*
* @param {string} teamId
* @param {string} name
* @throws {Error}
* @return {Promise}
*/
update(teamId: string, name: string): Promise<object>;
/**
* Delete Team
*
* Delete team by its unique ID. Only team owners have write access for this
* resource.
*
* @param {string} teamId
* @throws {Error}
* @return {Promise}
*/
delete(teamId: string): Promise<object>;
/**
* Get Team Memberships
*
* Get team members by the team unique ID. All team members have read access
* for this list of resources.
*
* @param {string} teamId
* @throws {Error}
* @return {Promise}
*/
getMemberships(teamId: string): Promise<object>;
/**
* Create Team Membership
*
* Use this endpoint to invite a new member to join your team. An email with a
* link to join the team will be sent to the new member email address if the
* member doesn't exist in the project it will be created automatically.
*
* 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.
*
* 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)
* the only valid redirect URL's are the once from domains you have set when
* added your platforms in the console interface.
*
* @param {string} teamId
* @param {string} email
* @param {string[]} roles
* @param {string} url
* @param {string} name
* @throws {Error}
* @return {Promise}
*/
createMembership(teamId: string, email: string, roles: string[], url: string, name: string): Promise<object>;
/**
* Delete Team Membership
*
* This endpoint allows a user to leave a team or for a team owner to delete
* the membership of any other team member. You can also use this endpoint to
* delete a user membership even if he didn't accept it.
*
* @param {string} teamId
* @param {string} inviteId
* @throws {Error}
* @return {Promise}
*/
deleteMembership(teamId: string, inviteId: string): Promise<object>;
/**
* Update Team Membership Status
*
* Use this endpoint to allow a user to accept an invitation to join a team
* after he is being redirected back to your app from the invitation email he
* was sent.
*
* @param {string} teamId
* @param {string} inviteId
* @param {string} userId
* @param {string} secret
* @throws {Error}
* @return {Promise}
*/
updateMembershipStatus(teamId: string, inviteId: string, userId: string, secret: string): Promise<object>;
}
}

24
composer.lock generated
View file

@ -485,12 +485,12 @@
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "3325c9d98ad876127d6244d6e09e3cd7076d6492"
"reference": "aab4ebd862aa7d04f01a4b51849d657db56d882e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/3325c9d98ad876127d6244d6e09e3cd7076d6492",
"reference": "3325c9d98ad876127d6244d6e09e3cd7076d6492",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/aab4ebd862aa7d04f01a4b51849d657db56d882e",
"reference": "aab4ebd862aa7d04f01a4b51849d657db56d882e",
"shasum": ""
},
"require": {
@ -544,7 +544,7 @@
"rest",
"web service"
],
"time": "2020-04-15T18:04:46+00:00"
"time": "2020-04-18T10:38:46+00:00"
},
{
"name": "guzzlehttp/promises",
@ -1745,7 +1745,7 @@
"source": {
"type": "git",
"url": "https://github.com/appwrite/sdk-generator",
"reference": "ccab743c1a82aa116456114a66dfefe1976e125a"
"reference": "1c5a473c38d5a187d242399419e413e475836d46"
},
"require": {
"ext-curl": "*",
@ -1775,7 +1775,7 @@
}
],
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
"time": "2020-04-14T14:07:24+00:00"
"time": "2020-04-19T03:49:17+00:00"
},
{
"name": "doctrine/instantiator",
@ -3377,16 +3377,16 @@
},
{
"name": "webmozart/assert",
"version": "1.7.0",
"version": "1.8.0",
"source": {
"type": "git",
"url": "https://github.com/webmozart/assert.git",
"reference": "aed98a490f9a8f78468232db345ab9cf606cf598"
"reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozart/assert/zipball/aed98a490f9a8f78468232db345ab9cf606cf598",
"reference": "aed98a490f9a8f78468232db345ab9cf606cf598",
"url": "https://api.github.com/repos/webmozart/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6",
"reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6",
"shasum": ""
},
"require": {
@ -3394,7 +3394,7 @@
"symfony/polyfill-ctype": "^1.8"
},
"conflict": {
"vimeo/psalm": "<3.6.0"
"vimeo/psalm": "<3.9.1"
},
"require-dev": {
"phpunit/phpunit": "^4.8.36 || ^7.5.13"
@ -3421,7 +3421,7 @@
"check",
"validate"
],
"time": "2020-02-14T12:15:55+00:00"
"time": "2020-04-18T12:12:48+00:00"
}
],
"aliases": [],