@aw-labs/appwrite-console
Advanced tools
Comparing version 5.0.5 to 6.0.0
@@ -12,3 +12,3 @@ import { Client, Databases } from "appwrite"; | ||
const promise = databases.createCollection('[DATABASE_ID]', '[COLLECTION_ID]', '[NAME]', 'document', ["role:all"], ["role:all"]); | ||
const promise = databases.createCollection('[DATABASE_ID]', '[COLLECTION_ID]', '[NAME]'); | ||
@@ -15,0 +15,0 @@ promise.then(function (response) { |
@@ -12,3 +12,3 @@ import { Client, Databases } from "appwrite"; | ||
const promise = databases.updateCollection('[DATABASE_ID]', '[COLLECTION_ID]', '[NAME]', 'document'); | ||
const promise = databases.updateCollection('[DATABASE_ID]', '[COLLECTION_ID]', '[NAME]'); | ||
@@ -15,0 +15,0 @@ promise.then(function (response) { |
@@ -12,3 +12,3 @@ import { Client, Functions } from "appwrite"; | ||
const promise = functions.create('[FUNCTION_ID]', '[NAME]', [], 'node-14.5'); | ||
const promise = functions.create('[FUNCTION_ID]', '[NAME]', ["any"], 'node-14.5'); | ||
@@ -15,0 +15,0 @@ promise.then(function (response) { |
@@ -12,3 +12,3 @@ import { Client, Functions } from "appwrite"; | ||
const promise = functions.getUsage('[FUNCTION_ID]'); | ||
const promise = functions.getUsage(); | ||
@@ -15,0 +15,0 @@ promise.then(function (response) { |
@@ -12,3 +12,3 @@ import { Client, Functions } from "appwrite"; | ||
const promise = functions.update('[FUNCTION_ID]', '[NAME]', []); | ||
const promise = functions.update('[FUNCTION_ID]', '[NAME]', ["any"]); | ||
@@ -15,0 +15,0 @@ promise.then(function (response) { |
@@ -12,3 +12,3 @@ import { Client, Storage } from "appwrite"; | ||
const promise = storage.createBucket('[BUCKET_ID]', '[NAME]', 'file'); | ||
const promise = storage.createBucket('[BUCKET_ID]', '[NAME]'); | ||
@@ -15,0 +15,0 @@ promise.then(function (response) { |
@@ -12,3 +12,3 @@ import { Client, Storage } from "appwrite"; | ||
const promise = storage.updateBucket('[BUCKET_ID]', '[NAME]', 'file'); | ||
const promise = storage.updateBucket('[BUCKET_ID]', '[NAME]'); | ||
@@ -15,0 +15,0 @@ promise.then(function (response) { |
@@ -12,3 +12,3 @@ import { Client, Users } from "appwrite"; | ||
const promise = users.create('[USER_ID]', 'email@example.com', 'password'); | ||
const promise = users.create('[USER_ID]'); | ||
@@ -15,0 +15,0 @@ promise.then(function (response) { |
@@ -5,3 +5,3 @@ { | ||
"description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API", | ||
"version": "5.0.5", | ||
"version": "6.0.0", | ||
"license": "BSD-3-Clause", | ||
@@ -8,0 +8,0 @@ "main": "dist/cjs/sdk.js", |
# Appwrite Console SDK | ||
![License](https://img.shields.io/github/license/appwrite/sdk-for-console.svg?style=flat-square) | ||
![Version](https://img.shields.io/badge/api%20version-0.15.2-blue.svg?style=flat-square) | ||
![Version](https://img.shields.io/badge/api%20version-1.0.0-blue.svg?style=flat-square) | ||
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) | ||
@@ -9,3 +9,3 @@ [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) | ||
**This SDK is compatible with Appwrite server version 0.15.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-console/releases).** | ||
**This SDK is compatible with Appwrite server version 1.0.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-console/releases).** | ||
@@ -37,3 +37,3 @@ 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. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/appwrite@6.0.0"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/appwrite@7.1.0"></script> | ||
``` | ||
@@ -69,3 +69,3 @@ | ||
// Register User | ||
account.create('[USER_ID]', 'me@example.com', 'password', 'Jane Doe') | ||
account.create(ID.unique(), 'me@example.com', 'password', 'Jane Doe') | ||
.then(function (response) { | ||
@@ -92,3 +92,3 @@ console.log(response); | ||
// Register User | ||
account.create('[USER_ID]', 'me@example.com', 'password', 'Jane Doe') | ||
account.create(ID.unique(), 'me@example.com', 'password', 'Jane Doe') | ||
.then(function (response) { | ||
@@ -95,0 +95,0 @@ console.log(response); |
@@ -104,4 +104,7 @@ import 'isomorphic-form-data'; | ||
headers: Headers = { | ||
'x-sdk-version': '6.0.0', | ||
'X-Appwrite-Response-Format': '0.15.0', | ||
'x-sdk-name': 'Console', | ||
'x-sdk-platform': 'console', | ||
'x-sdk-language': 'web', | ||
'x-sdk-version': '7.1.0', | ||
'X-Appwrite-Response-Format': '1.0.0', | ||
}; | ||
@@ -108,0 +111,0 @@ |
@@ -6,8 +6,14 @@ export class Role { | ||
public static user(id: string): string { | ||
return `user:${id}` | ||
public static user(id: string, status: string = ''): string { | ||
if(status === '') { | ||
return `user:${id}` | ||
} | ||
return `user:${id}/${status}` | ||
} | ||
public static users(): string { | ||
return 'users' | ||
public static users(status: string = ''): string { | ||
if(status === '') { | ||
return 'users' | ||
} | ||
return `users/${status}` | ||
} | ||
@@ -25,6 +31,6 @@ | ||
} | ||
public static status(status: string): string { | ||
return `status:${status}` | ||
public static member(id: string): string { | ||
return `member:${id}` | ||
} | ||
} |
@@ -21,3 +21,3 @@ import { Service } from '../service'; | ||
*/ | ||
async get<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>> { | ||
async get<Preferences extends Models.Preferences>(): Promise<Models.Account<Preferences>> { | ||
let path = '/account'; | ||
@@ -49,3 +49,3 @@ let payload: Payload = {}; | ||
*/ | ||
async create<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> { | ||
async create<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.Account<Preferences>> { | ||
if (typeof userId === 'undefined') { | ||
@@ -105,3 +105,3 @@ throw new AppwriteException('Missing required parameter: "userId"'); | ||
*/ | ||
async updateEmail<Preferences extends Models.Preferences>(email: string, password: string): Promise<Models.User<Preferences>> { | ||
async updateEmail<Preferences extends Models.Preferences>(email: string, password: string): Promise<Models.Account<Preferences>> { | ||
if (typeof email === 'undefined') { | ||
@@ -155,3 +155,3 @@ throw new AppwriteException('Missing required parameter: "email"'); | ||
/** | ||
* Get Account Logs | ||
* List Account Logs | ||
* | ||
@@ -161,19 +161,14 @@ * Get currently logged in user list of latest security activity logs. Each | ||
* | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string[]} queries | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async getLogs(limit?: number, offset?: number): Promise<Models.LogList> { | ||
async listLogs(queries?: string[]): Promise<Models.LogList> { | ||
let path = '/account/logs'; | ||
let payload: Payload = {}; | ||
if (typeof limit !== 'undefined') { | ||
payload['limit'] = limit; | ||
if (typeof queries !== 'undefined') { | ||
payload['queries'] = queries; | ||
} | ||
if (typeof offset !== 'undefined') { | ||
payload['offset'] = offset; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -194,3 +189,3 @@ return await this.client.call('get', uri, { | ||
*/ | ||
async updateName<Preferences extends Models.Preferences>(name: string): Promise<Models.User<Preferences>> { | ||
async updateName<Preferences extends Models.Preferences>(name: string): Promise<Models.Account<Preferences>> { | ||
if (typeof name === 'undefined') { | ||
@@ -225,3 +220,3 @@ throw new AppwriteException('Missing required parameter: "name"'); | ||
*/ | ||
async updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>> { | ||
async updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.Account<Preferences>> { | ||
if (typeof password === 'undefined') { | ||
@@ -257,3 +252,3 @@ throw new AppwriteException('Missing required parameter: "password"'); | ||
* | ||
* @param {string} number | ||
* @param {string} phone | ||
* @param {string} password | ||
@@ -263,5 +258,5 @@ * @throws {AppwriteException} | ||
*/ | ||
async updatePhone<Preferences extends Models.Preferences>(number: string, password: string): Promise<Models.User<Preferences>> { | ||
if (typeof number === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "number"'); | ||
async updatePhone<Preferences extends Models.Preferences>(phone: string, password: string): Promise<Models.Account<Preferences>> { | ||
if (typeof phone === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "phone"'); | ||
} | ||
@@ -276,4 +271,4 @@ | ||
if (typeof number !== 'undefined') { | ||
payload['number'] = number; | ||
if (typeof phone !== 'undefined') { | ||
payload['phone'] = phone; | ||
} | ||
@@ -316,7 +311,7 @@ | ||
* | ||
* @param {Partial<Preferences>} prefs | ||
* @param {object} prefs | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async updatePrefs<Preferences extends Models.Preferences>(prefs: Partial<Preferences>): Promise<Models.User<Preferences>> { | ||
async updatePrefs<Preferences extends Models.Preferences>(prefs: object): Promise<Models.Account<Preferences>> { | ||
if (typeof prefs === 'undefined') { | ||
@@ -445,3 +440,3 @@ throw new AppwriteException('Missing required parameter: "prefs"'); | ||
/** | ||
* Get Account Sessions | ||
* List Account Sessions | ||
* | ||
@@ -454,3 +449,3 @@ * Get currently logged in user list of active sessions across different | ||
*/ | ||
async getSessions(): Promise<Models.SessionList> { | ||
async listSessions(): Promise<Models.SessionList> { | ||
let path = '/account/sessions'; | ||
@@ -547,5 +542,6 @@ let payload: Payload = {}; | ||
* | ||
* Sends the user an email with a secret key for creating a session. When the | ||
* user clicks the link in the email, the user is redirected back to the URL | ||
* you provided with the secret key and userId values attached to the URL | ||
* Sends the user an email with a secret key for creating a session. If the | ||
* provided user ID has not be registered, a new user will be created. When | ||
* the user clicks the link in the email, the user is redirected back to the | ||
* URL you provided with the secret key and userId values attached to the URL | ||
* query string. Use the query string parameters to submit a request to the | ||
@@ -709,7 +705,7 @@ * [PUT | ||
* @param {string} userId | ||
* @param {string} number | ||
* @param {string} phone | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async createPhoneSession(userId: string, number: string): Promise<Models.Token> { | ||
async createPhoneSession(userId: string, phone: string): Promise<Models.Token> { | ||
if (typeof userId === 'undefined') { | ||
@@ -719,4 +715,4 @@ throw new AppwriteException('Missing required parameter: "userId"'); | ||
if (typeof number === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "number"'); | ||
if (typeof phone === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "phone"'); | ||
} | ||
@@ -731,4 +727,4 @@ | ||
if (typeof number !== 'undefined') { | ||
payload['number'] = number; | ||
if (typeof phone !== 'undefined') { | ||
payload['phone'] = phone; | ||
} | ||
@@ -743,3 +739,3 @@ | ||
/** | ||
* Create Phone session (confirmation) | ||
* Create Phone Session (confirmation) | ||
* | ||
@@ -868,3 +864,3 @@ * Use this endpoint to complete creating a session with SMS. Use the | ||
*/ | ||
async updateStatus<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>> { | ||
async updateStatus<Preferences extends Models.Preferences>(): Promise<Models.Account<Preferences>> { | ||
let path = '/account/status'; | ||
@@ -871,0 +867,0 @@ let payload: Payload = {}; |
@@ -151,3 +151,4 @@ import { Service } from '../service'; | ||
* users. The code argument receives the 2 letter country code. Use width, | ||
* height and quality arguments to change the output settings. | ||
* height and quality arguments to change the output settings. Country codes | ||
* follow the [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) standard. | ||
* | ||
@@ -270,3 +271,2 @@ * When one dimension is specified and the other is 0, the image is scaled | ||
* @param {number} height | ||
* @param {string} color | ||
* @param {string} background | ||
@@ -276,3 +276,3 @@ * @throws {AppwriteException} | ||
*/ | ||
getInitials(name?: string, width?: number, height?: number, color?: string, background?: string): URL { | ||
getInitials(name?: string, width?: number, height?: number, background?: string): URL { | ||
let path = '/avatars/initials'; | ||
@@ -293,6 +293,2 @@ let payload: Payload = {}; | ||
if (typeof color !== 'undefined') { | ||
payload['color'] = color; | ||
} | ||
if (typeof background !== 'undefined') { | ||
@@ -299,0 +295,0 @@ payload['background'] = background; |
@@ -16,16 +16,18 @@ import { Service } from '../service'; | ||
* | ||
* Get a list of all databases from the current Appwrite project. You can use | ||
* the search parameter to filter your results. | ||
* | ||
* @param {string[]} queries | ||
* @param {string} search | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @param {string} orderType | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async list(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.DatabaseList> { | ||
async list(queries?: string[], search?: string): Promise<Models.DatabaseList> { | ||
let path = '/databases'; | ||
let payload: Payload = {}; | ||
if (typeof queries !== 'undefined') { | ||
payload['queries'] = queries; | ||
} | ||
if (typeof search !== 'undefined') { | ||
@@ -35,22 +37,2 @@ payload['search'] = search; | ||
if (typeof limit !== 'undefined') { | ||
payload['limit'] = limit; | ||
} | ||
if (typeof offset !== 'undefined') { | ||
payload['offset'] = offset; | ||
} | ||
if (typeof cursor !== 'undefined') { | ||
payload['cursor'] = cursor; | ||
} | ||
if (typeof cursorDirection !== 'undefined') { | ||
payload['cursorDirection'] = cursorDirection; | ||
} | ||
if (typeof orderType !== 'undefined') { | ||
payload['orderType'] = orderType; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -65,2 +47,4 @@ return await this.client.call('get', uri, { | ||
* | ||
* Create a new Database. | ||
* | ||
* | ||
@@ -123,2 +107,4 @@ * @param {string} databaseId | ||
* | ||
* Get a database by its unique ID. This endpoint response returns a JSON | ||
* object with the database metadata. | ||
* | ||
@@ -129,3 +115,3 @@ * @param {string} databaseId | ||
*/ | ||
async get(databaseId: string): Promise<Models.Collection> { | ||
async get(databaseId: string): Promise<Models.Database> { | ||
if (typeof databaseId === 'undefined') { | ||
@@ -147,2 +133,3 @@ throw new AppwriteException('Missing required parameter: "databaseId"'); | ||
* | ||
* Update a database by its unique ID. | ||
* | ||
@@ -154,3 +141,3 @@ * @param {string} databaseId | ||
*/ | ||
async update(databaseId: string, name: string): Promise<Models.Collection> { | ||
async update(databaseId: string, name: string): Promise<Models.Database> { | ||
if (typeof databaseId === 'undefined') { | ||
@@ -180,2 +167,4 @@ throw new AppwriteException('Missing required parameter: "databaseId"'); | ||
* | ||
* Delete a database by its unique ID. Only API keys with with databases.write | ||
* scope can delete a database. | ||
* | ||
@@ -203,14 +192,12 @@ * @param {string} databaseId | ||
* | ||
* Get a list of all collections that belong to the provided databaseId. You | ||
* can use the search parameter to filter your results. | ||
* | ||
* @param {string} databaseId | ||
* @param {string[]} queries | ||
* @param {string} search | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @param {string} orderType | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async listCollections(databaseId: string, search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.CollectionList> { | ||
async listCollections(databaseId: string, queries?: string[], search?: string): Promise<Models.CollectionList> { | ||
if (typeof databaseId === 'undefined') { | ||
@@ -223,2 +210,6 @@ throw new AppwriteException('Missing required parameter: "databaseId"'); | ||
if (typeof queries !== 'undefined') { | ||
payload['queries'] = queries; | ||
} | ||
if (typeof search !== 'undefined') { | ||
@@ -228,22 +219,2 @@ payload['search'] = search; | ||
if (typeof limit !== 'undefined') { | ||
payload['limit'] = limit; | ||
} | ||
if (typeof offset !== 'undefined') { | ||
payload['offset'] = offset; | ||
} | ||
if (typeof cursor !== 'undefined') { | ||
payload['cursor'] = cursor; | ||
} | ||
if (typeof cursorDirection !== 'undefined') { | ||
payload['cursorDirection'] = cursorDirection; | ||
} | ||
if (typeof orderType !== 'undefined') { | ||
payload['orderType'] = orderType; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -258,2 +229,6 @@ return await this.client.call('get', uri, { | ||
* | ||
* Create a new Collection. Before using this route, you should create a new | ||
* database resource using either a [server | ||
* integration](/docs/server/databases#databasesCreateCollection) API or | ||
* directly from your database console. | ||
* | ||
@@ -263,9 +238,8 @@ * @param {string} databaseId | ||
* @param {string} name | ||
* @param {string} permission | ||
* @param {string[]} read | ||
* @param {string[]} write | ||
* @param {string[]} permissions | ||
* @param {boolean} documentSecurity | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async createCollection(databaseId: string, collectionId: string, name: string, permission: string, read: string[], write: string[]): Promise<Models.Collection> { | ||
async createCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean): Promise<Models.Collection> { | ||
if (typeof databaseId === 'undefined') { | ||
@@ -283,14 +257,2 @@ throw new AppwriteException('Missing required parameter: "databaseId"'); | ||
if (typeof permission === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "permission"'); | ||
} | ||
if (typeof read === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "read"'); | ||
} | ||
if (typeof write === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "write"'); | ||
} | ||
let path = '/databases/{databaseId}/collections'.replace('{databaseId}', databaseId); | ||
@@ -307,14 +269,10 @@ let payload: Payload = {}; | ||
if (typeof permission !== 'undefined') { | ||
payload['permission'] = permission; | ||
if (typeof permissions !== 'undefined') { | ||
payload['permissions'] = permissions; | ||
} | ||
if (typeof read !== 'undefined') { | ||
payload['read'] = read; | ||
if (typeof documentSecurity !== 'undefined') { | ||
payload['documentSecurity'] = documentSecurity; | ||
} | ||
if (typeof write !== 'undefined') { | ||
payload['write'] = write; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -329,2 +287,4 @@ return await this.client.call('post', uri, { | ||
* | ||
* Get a collection by its unique ID. This endpoint response returns a JSON | ||
* object with the collection metadata. | ||
* | ||
@@ -357,2 +317,3 @@ * @param {string} databaseId | ||
* | ||
* Update a collection by its unique ID. | ||
* | ||
@@ -362,5 +323,4 @@ * @param {string} databaseId | ||
* @param {string} name | ||
* @param {string} permission | ||
* @param {string[]} read | ||
* @param {string[]} write | ||
* @param {string[]} permissions | ||
* @param {boolean} documentSecurity | ||
* @param {boolean} enabled | ||
@@ -370,3 +330,3 @@ * @throws {AppwriteException} | ||
*/ | ||
async updateCollection(databaseId: string, collectionId: string, name: string, permission: string, read?: string[], write?: string[], enabled?: boolean): Promise<Models.Collection> { | ||
async updateCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise<Models.Collection> { | ||
if (typeof databaseId === 'undefined') { | ||
@@ -384,6 +344,2 @@ throw new AppwriteException('Missing required parameter: "databaseId"'); | ||
if (typeof permission === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "permission"'); | ||
} | ||
let path = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); | ||
@@ -396,14 +352,10 @@ let payload: Payload = {}; | ||
if (typeof permission !== 'undefined') { | ||
payload['permission'] = permission; | ||
if (typeof permissions !== 'undefined') { | ||
payload['permissions'] = permissions; | ||
} | ||
if (typeof read !== 'undefined') { | ||
payload['read'] = read; | ||
if (typeof documentSecurity !== 'undefined') { | ||
payload['documentSecurity'] = documentSecurity; | ||
} | ||
if (typeof write !== 'undefined') { | ||
payload['write'] = write; | ||
} | ||
if (typeof enabled !== 'undefined') { | ||
@@ -422,2 +374,4 @@ payload['enabled'] = enabled; | ||
* | ||
* Delete a collection by its unique ID. Only users with write permissions | ||
* have access to delete this resource. | ||
* | ||
@@ -477,2 +431,4 @@ * @param {string} databaseId | ||
* | ||
* Create a boolean attribute. | ||
* | ||
* | ||
@@ -531,4 +487,61 @@ * @param {string} databaseId | ||
/** | ||
* Create DateTime Attribute | ||
* | ||
* | ||
* @param {string} databaseId | ||
* @param {string} collectionId | ||
* @param {string} key | ||
* @param {boolean} required | ||
* @param {string} xdefault | ||
* @param {boolean} array | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async createDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeDatetime> { | ||
if (typeof databaseId === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "databaseId"'); | ||
} | ||
if (typeof collectionId === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "collectionId"'); | ||
} | ||
if (typeof key === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "key"'); | ||
} | ||
if (typeof required === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "required"'); | ||
} | ||
let path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); | ||
let payload: Payload = {}; | ||
if (typeof key !== 'undefined') { | ||
payload['key'] = key; | ||
} | ||
if (typeof required !== 'undefined') { | ||
payload['required'] = required; | ||
} | ||
if (typeof xdefault !== 'undefined') { | ||
payload['default'] = xdefault; | ||
} | ||
if (typeof array !== 'undefined') { | ||
payload['array'] = array; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
return await this.client.call('post', uri, { | ||
'content-type': 'application/json', | ||
}, payload); | ||
} | ||
/** | ||
* Create Email Attribute | ||
* | ||
* Create an email attribute. | ||
* | ||
* | ||
@@ -653,2 +666,5 @@ * @param {string} databaseId | ||
* | ||
* Create a float attribute. Optionally, minimum and maximum values can be | ||
* provided. | ||
* | ||
* | ||
@@ -719,2 +735,5 @@ * @param {string} databaseId | ||
* | ||
* Create an integer attribute. Optionally, minimum and maximum values can be | ||
* provided. | ||
* | ||
* | ||
@@ -785,2 +804,4 @@ * @param {string} databaseId | ||
* | ||
* Create IP address attribute. | ||
* | ||
* | ||
@@ -841,2 +862,4 @@ * @param {string} databaseId | ||
* | ||
* Create a string attribute. | ||
* | ||
* | ||
@@ -906,2 +929,4 @@ * @param {string} databaseId | ||
* | ||
* Create a URL attribute. | ||
* | ||
* | ||
@@ -1026,2 +1051,6 @@ * @param {string} databaseId | ||
* | ||
* Get a list of all the user's documents in a given collection. You can use | ||
* the query params to filter your results. On admin mode, this endpoint will | ||
* return a list of all of documents belonging to the provided collectionId. | ||
* [Learn more about different API modes](/docs/admin). | ||
* | ||
@@ -1031,12 +1060,6 @@ * @param {string} databaseId | ||
* @param {string[]} queries | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @param {string[]} orderAttributes | ||
* @param {string[]} orderTypes | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async listDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[], limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderAttributes?: string[], orderTypes?: string[]): Promise<Models.DocumentList<Document>> { | ||
async listDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>> { | ||
if (typeof databaseId === 'undefined') { | ||
@@ -1057,26 +1080,2 @@ throw new AppwriteException('Missing required parameter: "databaseId"'); | ||
if (typeof limit !== 'undefined') { | ||
payload['limit'] = limit; | ||
} | ||
if (typeof offset !== 'undefined') { | ||
payload['offset'] = offset; | ||
} | ||
if (typeof cursor !== 'undefined') { | ||
payload['cursor'] = cursor; | ||
} | ||
if (typeof cursorDirection !== 'undefined') { | ||
payload['cursorDirection'] = cursorDirection; | ||
} | ||
if (typeof orderAttributes !== 'undefined') { | ||
payload['orderAttributes'] = orderAttributes; | ||
} | ||
if (typeof orderTypes !== 'undefined') { | ||
payload['orderTypes'] = orderTypes; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -1091,2 +1090,6 @@ return await this.client.call('get', uri, { | ||
* | ||
* Create a new Document. Before using this route, you should create a new | ||
* collection resource using either a [server | ||
* integration](/docs/server/databases#databasesCreateCollection) API or | ||
* directly from your database console. | ||
* | ||
@@ -1097,8 +1100,7 @@ * @param {string} databaseId | ||
* @param {Omit<Document, keyof Models.Document>} data | ||
* @param {string[]} read | ||
* @param {string[]} write | ||
* @param {string[]} permissions | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async createDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: Omit<Document, keyof Models.Document>, read?: string[], write?: string[]): Promise<Document> { | ||
async createDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: Omit<Document, keyof Models.Document>, permissions?: string[]): Promise<Document> { | ||
if (typeof databaseId === 'undefined') { | ||
@@ -1131,10 +1133,6 @@ throw new AppwriteException('Missing required parameter: "databaseId"'); | ||
if (typeof read !== 'undefined') { | ||
payload['read'] = read; | ||
if (typeof permissions !== 'undefined') { | ||
payload['permissions'] = permissions; | ||
} | ||
if (typeof write !== 'undefined') { | ||
payload['write'] = write; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -1149,2 +1147,4 @@ return await this.client.call('post', uri, { | ||
* | ||
* Get a document by its unique ID. This endpoint response returns a JSON | ||
* object with the document data. | ||
* | ||
@@ -1182,2 +1182,4 @@ * @param {string} databaseId | ||
* | ||
* Update a document by its unique ID. Using the patch method you can pass | ||
* only specific fields that will get updated. | ||
* | ||
@@ -1188,8 +1190,7 @@ * @param {string} databaseId | ||
* @param {Partial<Omit<Document, keyof Models.Document>>} data | ||
* @param {string[]} read | ||
* @param {string[]} write | ||
* @param {string[]} permissions | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async updateDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data?: Partial<Omit<Document, keyof Models.Document>>, read?: string[], write?: string[]): Promise<Document> { | ||
async updateDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data?: Partial<Omit<Document, keyof Models.Document>>, permissions?: string[]): Promise<Document> { | ||
if (typeof databaseId === 'undefined') { | ||
@@ -1214,10 +1215,6 @@ throw new AppwriteException('Missing required parameter: "databaseId"'); | ||
if (typeof read !== 'undefined') { | ||
payload['read'] = read; | ||
if (typeof permissions !== 'undefined') { | ||
payload['permissions'] = permissions; | ||
} | ||
if (typeof write !== 'undefined') { | ||
payload['write'] = write; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -1232,2 +1229,3 @@ return await this.client.call('patch', uri, { | ||
* | ||
* Delete a document by its unique ID. | ||
* | ||
@@ -1265,2 +1263,3 @@ * @param {string} databaseId | ||
* | ||
* Get the document activity logs list by its unique ID. | ||
* | ||
@@ -1270,8 +1269,7 @@ * @param {string} databaseId | ||
* @param {string} documentId | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string[]} queries | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async listDocumentLogs(databaseId: string, collectionId: string, documentId: string, limit?: number, offset?: number): Promise<Models.LogList> { | ||
async listDocumentLogs(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Models.LogList> { | ||
if (typeof databaseId === 'undefined') { | ||
@@ -1292,10 +1290,6 @@ throw new AppwriteException('Missing required parameter: "databaseId"'); | ||
if (typeof limit !== 'undefined') { | ||
payload['limit'] = limit; | ||
if (typeof queries !== 'undefined') { | ||
payload['queries'] = queries; | ||
} | ||
if (typeof offset !== 'undefined') { | ||
payload['offset'] = offset; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -1460,11 +1454,11 @@ return await this.client.call('get', uri, { | ||
* | ||
* Get the collection activity logs list by its unique ID. | ||
* | ||
* @param {string} databaseId | ||
* @param {string} collectionId | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string[]} queries | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async listCollectionLogs(databaseId: string, collectionId: string, limit?: number, offset?: number): Promise<Models.LogList> { | ||
async listCollectionLogs(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.LogList> { | ||
if (typeof databaseId === 'undefined') { | ||
@@ -1481,10 +1475,6 @@ throw new AppwriteException('Missing required parameter: "databaseId"'); | ||
if (typeof limit !== 'undefined') { | ||
payload['limit'] = limit; | ||
if (typeof queries !== 'undefined') { | ||
payload['queries'] = queries; | ||
} | ||
if (typeof offset !== 'undefined') { | ||
payload['offset'] = offset; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -1529,12 +1519,12 @@ return await this.client.call('get', uri, { | ||
/** | ||
* List Collection Logs | ||
* List Database Logs | ||
* | ||
* Get the database activity logs list by its unique ID. | ||
* | ||
* @param {string} databaseId | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string[]} queries | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async listLogs(databaseId: string, limit?: number, offset?: number): Promise<Models.LogList> { | ||
async listLogs(databaseId: string, queries?: string[]): Promise<Models.LogList> { | ||
if (typeof databaseId === 'undefined') { | ||
@@ -1547,10 +1537,6 @@ throw new AppwriteException('Missing required parameter: "databaseId"'); | ||
if (typeof limit !== 'undefined') { | ||
payload['limit'] = limit; | ||
if (typeof queries !== 'undefined') { | ||
payload['queries'] = queries; | ||
} | ||
if (typeof offset !== 'undefined') { | ||
payload['offset'] = offset; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -1557,0 +1543,0 @@ return await this.client.call('get', uri, { |
@@ -19,15 +19,15 @@ import { Service } from '../service'; | ||
* | ||
* @param {string[]} queries | ||
* @param {string} search | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @param {string} orderType | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async list(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.FunctionList> { | ||
async list(queries?: string[], search?: string): Promise<Models.FunctionList> { | ||
let path = '/functions'; | ||
let payload: Payload = {}; | ||
if (typeof queries !== 'undefined') { | ||
payload['queries'] = queries; | ||
} | ||
if (typeof search !== 'undefined') { | ||
@@ -37,22 +37,2 @@ payload['search'] = search; | ||
if (typeof limit !== 'undefined') { | ||
payload['limit'] = limit; | ||
} | ||
if (typeof offset !== 'undefined') { | ||
payload['offset'] = offset; | ||
} | ||
if (typeof cursor !== 'undefined') { | ||
payload['cursor'] = cursor; | ||
} | ||
if (typeof cursorDirection !== 'undefined') { | ||
payload['cursorDirection'] = cursorDirection; | ||
} | ||
if (typeof orderType !== 'undefined') { | ||
payload['orderType'] = orderType; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -75,10 +55,10 @@ return await this.client.call('get', uri, { | ||
* @param {string} runtime | ||
* @param {object} vars | ||
* @param {string[]} events | ||
* @param {string} schedule | ||
* @param {number} timeout | ||
* @param {boolean} enabled | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async create(functionId: string, name: string, execute: string[], runtime: string, vars?: object, events?: string[], schedule?: string, timeout?: number): Promise<Models.Function> { | ||
async create(functionId: string, name: string, execute: string[], runtime: string, events?: string[], schedule?: string, timeout?: number, enabled?: boolean): Promise<Models.Function> { | ||
if (typeof functionId === 'undefined') { | ||
@@ -119,6 +99,2 @@ throw new AppwriteException('Missing required parameter: "functionId"'); | ||
if (typeof vars !== 'undefined') { | ||
payload['vars'] = vars; | ||
} | ||
if (typeof events !== 'undefined') { | ||
@@ -136,2 +112,6 @@ payload['events'] = events; | ||
if (typeof enabled !== 'undefined') { | ||
payload['enabled'] = enabled; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -162,2 +142,24 @@ return await this.client.call('post', uri, { | ||
/** | ||
* Get Functions Usage | ||
* | ||
* | ||
* @param {string} range | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async getUsage(range?: string): Promise<Models.UsageFunctions> { | ||
let path = '/functions/usage'; | ||
let payload: Payload = {}; | ||
if (typeof range !== 'undefined') { | ||
payload['range'] = range; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
return await this.client.call('get', uri, { | ||
'content-type': 'application/json', | ||
}, payload); | ||
} | ||
/** | ||
* Get Function | ||
@@ -193,10 +195,10 @@ * | ||
* @param {string[]} execute | ||
* @param {object} vars | ||
* @param {string[]} events | ||
* @param {string} schedule | ||
* @param {number} timeout | ||
* @param {boolean} enabled | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async update(functionId: string, name: string, execute: string[], vars?: object, events?: string[], schedule?: string, timeout?: number): Promise<Models.Function> { | ||
async update(functionId: string, name: string, execute: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean): Promise<Models.Function> { | ||
if (typeof functionId === 'undefined') { | ||
@@ -225,6 +227,2 @@ throw new AppwriteException('Missing required parameter: "functionId"'); | ||
if (typeof vars !== 'undefined') { | ||
payload['vars'] = vars; | ||
} | ||
if (typeof events !== 'undefined') { | ||
@@ -242,2 +240,6 @@ payload['events'] = events; | ||
if (typeof enabled !== 'undefined') { | ||
payload['enabled'] = enabled; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -279,12 +281,8 @@ return await this.client.call('put', uri, { | ||
* @param {string} functionId | ||
* @param {string[]} queries | ||
* @param {string} search | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @param {string} orderType | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async listDeployments(functionId: string, search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.DeploymentList> { | ||
async listDeployments(functionId: string, queries?: string[], search?: string): Promise<Models.DeploymentList> { | ||
if (typeof functionId === 'undefined') { | ||
@@ -297,2 +295,6 @@ throw new AppwriteException('Missing required parameter: "functionId"'); | ||
if (typeof queries !== 'undefined') { | ||
payload['queries'] = queries; | ||
} | ||
if (typeof search !== 'undefined') { | ||
@@ -302,22 +304,2 @@ payload['search'] = search; | ||
if (typeof limit !== 'undefined') { | ||
payload['limit'] = limit; | ||
} | ||
if (typeof offset !== 'undefined') { | ||
payload['offset'] = offset; | ||
} | ||
if (typeof cursor !== 'undefined') { | ||
payload['cursor'] = cursor; | ||
} | ||
if (typeof cursorDirection !== 'undefined') { | ||
payload['cursorDirection'] = cursorDirection; | ||
} | ||
if (typeof orderType !== 'undefined') { | ||
payload['orderType'] = orderType; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -449,3 +431,3 @@ return await this.client.call('get', uri, { | ||
*/ | ||
async getDeployment(functionId: string, deploymentId: string): Promise<Models.DeploymentList> { | ||
async getDeployment(functionId: string, deploymentId: string): Promise<Models.Deployment> { | ||
if (typeof functionId === 'undefined') { | ||
@@ -567,11 +549,8 @@ throw new AppwriteException('Missing required parameter: "functionId"'); | ||
* @param {string} functionId | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string[]} queries | ||
* @param {string} search | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async listExecutions(functionId: string, limit?: number, offset?: number, search?: string, cursor?: string, cursorDirection?: string): Promise<Models.ExecutionList> { | ||
async listExecutions(functionId: string, queries?: string[], search?: string): Promise<Models.ExecutionList> { | ||
if (typeof functionId === 'undefined') { | ||
@@ -584,10 +563,6 @@ throw new AppwriteException('Missing required parameter: "functionId"'); | ||
if (typeof limit !== 'undefined') { | ||
payload['limit'] = limit; | ||
if (typeof queries !== 'undefined') { | ||
payload['queries'] = queries; | ||
} | ||
if (typeof offset !== 'undefined') { | ||
payload['offset'] = offset; | ||
} | ||
if (typeof search !== 'undefined') { | ||
@@ -597,10 +572,2 @@ payload['search'] = search; | ||
if (typeof cursor !== 'undefined') { | ||
payload['cursor'] = cursor; | ||
} | ||
if (typeof cursorDirection !== 'undefined') { | ||
payload['cursorDirection'] = cursorDirection; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -685,3 +652,3 @@ return await this.client.call('get', uri, { | ||
*/ | ||
async getUsage(functionId: string, range?: string): Promise<Models.UsageFunctions> { | ||
async getFunctionUsage(functionId: string, range?: string): Promise<Models.UsageFunctions> { | ||
if (typeof functionId === 'undefined') { | ||
@@ -703,2 +670,165 @@ throw new AppwriteException('Missing required parameter: "functionId"'); | ||
} | ||
/** | ||
* List Variables | ||
* | ||
* Get a list of all variables of a specific function. | ||
* | ||
* @param {string} functionId | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async listVariables(functionId: string): Promise<Models.VariableList> { | ||
if (typeof functionId === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "functionId"'); | ||
} | ||
let path = '/functions/{functionId}/variables'.replace('{functionId}', functionId); | ||
let payload: Payload = {}; | ||
const uri = new URL(this.client.config.endpoint + path); | ||
return await this.client.call('get', uri, { | ||
'content-type': 'application/json', | ||
}, payload); | ||
} | ||
/** | ||
* Create Variable | ||
* | ||
* Create a new function variable. These variables can be accessed within | ||
* function in the `env` object under the request variable. | ||
* | ||
* @param {string} functionId | ||
* @param {string} key | ||
* @param {string} value | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async createVariable(functionId: string, key: string, value: string): Promise<Models.Variable> { | ||
if (typeof functionId === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "functionId"'); | ||
} | ||
if (typeof key === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "key"'); | ||
} | ||
if (typeof value === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "value"'); | ||
} | ||
let path = '/functions/{functionId}/variables'.replace('{functionId}', functionId); | ||
let payload: Payload = {}; | ||
if (typeof key !== 'undefined') { | ||
payload['key'] = key; | ||
} | ||
if (typeof value !== 'undefined') { | ||
payload['value'] = value; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
return await this.client.call('post', uri, { | ||
'content-type': 'application/json', | ||
}, payload); | ||
} | ||
/** | ||
* Get Variable | ||
* | ||
* Get a variable by its unique ID. | ||
* | ||
* @param {string} functionId | ||
* @param {string} variableId | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async getVariable(functionId: string, variableId: string): Promise<Models.Variable> { | ||
if (typeof functionId === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "functionId"'); | ||
} | ||
if (typeof variableId === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "variableId"'); | ||
} | ||
let path = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId); | ||
let payload: Payload = {}; | ||
const uri = new URL(this.client.config.endpoint + path); | ||
return await this.client.call('get', uri, { | ||
'content-type': 'application/json', | ||
}, payload); | ||
} | ||
/** | ||
* Update Variable | ||
* | ||
* Update variable by its unique ID. | ||
* | ||
* @param {string} functionId | ||
* @param {string} variableId | ||
* @param {string} key | ||
* @param {string} value | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async updateVariable(functionId: string, variableId: string, key: string, value?: string): Promise<Models.Variable> { | ||
if (typeof functionId === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "functionId"'); | ||
} | ||
if (typeof variableId === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "variableId"'); | ||
} | ||
if (typeof key === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "key"'); | ||
} | ||
let path = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId); | ||
let payload: Payload = {}; | ||
if (typeof key !== 'undefined') { | ||
payload['key'] = key; | ||
} | ||
if (typeof value !== 'undefined') { | ||
payload['value'] = value; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
return await this.client.call('put', uri, { | ||
'content-type': 'application/json', | ||
}, payload); | ||
} | ||
/** | ||
* Delete Variable | ||
* | ||
* Delete a variable by its unique ID. | ||
* | ||
* @param {string} functionId | ||
* @param {string} variableId | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async deleteVariable(functionId: string, variableId: string): Promise<{}> { | ||
if (typeof functionId === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "functionId"'); | ||
} | ||
if (typeof variableId === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "variableId"'); | ||
} | ||
let path = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId); | ||
let payload: Payload = {}; | ||
const uri = new URL(this.client.config.endpoint + path); | ||
return await this.client.call('delete', uri, { | ||
'content-type': 'application/json', | ||
}, payload); | ||
} | ||
}; |
@@ -45,3 +45,3 @@ import { Service } from '../service'; | ||
*/ | ||
async getContinents(): Promise<Models.ContinentList> { | ||
async listContinents(): Promise<Models.ContinentList> { | ||
let path = '/locale/continents'; | ||
@@ -65,3 +65,3 @@ let payload: Payload = {}; | ||
*/ | ||
async getCountries(): Promise<Models.CountryList> { | ||
async listCountries(): Promise<Models.CountryList> { | ||
let path = '/locale/countries'; | ||
@@ -85,3 +85,3 @@ let payload: Payload = {}; | ||
*/ | ||
async getCountriesEU(): Promise<Models.CountryList> { | ||
async listCountriesEU(): Promise<Models.CountryList> { | ||
let path = '/locale/countries/eu'; | ||
@@ -105,3 +105,3 @@ let payload: Payload = {}; | ||
*/ | ||
async getCountriesPhones(): Promise<Models.PhoneList> { | ||
async listCountriesPhones(): Promise<Models.PhoneList> { | ||
let path = '/locale/countries/phones'; | ||
@@ -126,3 +126,3 @@ let payload: Payload = {}; | ||
*/ | ||
async getCurrencies(): Promise<Models.CurrencyList> { | ||
async listCurrencies(): Promise<Models.CurrencyList> { | ||
let path = '/locale/currencies'; | ||
@@ -146,3 +146,3 @@ let payload: Payload = {}; | ||
*/ | ||
async getLanguages(): Promise<Models.LanguageList> { | ||
async listLanguages(): Promise<Models.LanguageList> { | ||
let path = '/locale/languages'; | ||
@@ -149,0 +149,0 @@ let payload: Payload = {}; |
@@ -17,15 +17,15 @@ import { Service } from '../service'; | ||
* | ||
* @param {string[]} queries | ||
* @param {string} search | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @param {string} orderType | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async list(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.ProjectList> { | ||
async list(queries?: string[], search?: string): Promise<Models.ProjectList> { | ||
let path = '/projects'; | ||
let payload: Payload = {}; | ||
if (typeof queries !== 'undefined') { | ||
payload['queries'] = queries; | ||
} | ||
if (typeof search !== 'undefined') { | ||
@@ -35,22 +35,2 @@ payload['search'] = search; | ||
if (typeof limit !== 'undefined') { | ||
payload['limit'] = limit; | ||
} | ||
if (typeof offset !== 'undefined') { | ||
payload['offset'] = offset; | ||
} | ||
if (typeof cursor !== 'undefined') { | ||
payload['cursor'] = cursor; | ||
} | ||
if (typeof cursorDirection !== 'undefined') { | ||
payload['cursorDirection'] = cursorDirection; | ||
} | ||
if (typeof orderType !== 'undefined') { | ||
payload['orderType'] = orderType; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -510,7 +490,7 @@ return await this.client.call('get', uri, { | ||
* @param {string[]} scopes | ||
* @param {number} expire | ||
* @param {string} expire | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async createKey(projectId: string, name: string, scopes: string[], expire?: number): Promise<Models.Key> { | ||
async createKey(projectId: string, name: string, scopes: string[], expire?: string): Promise<Models.Key> { | ||
if (typeof projectId === 'undefined') { | ||
@@ -584,7 +564,7 @@ throw new AppwriteException('Missing required parameter: "projectId"'); | ||
* @param {string[]} scopes | ||
* @param {number} expire | ||
* @param {string} expire | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async updateKey(projectId: string, keyId: string, name: string, scopes: string[], expire?: number): Promise<Models.Key> { | ||
async updateKey(projectId: string, keyId: string, name: string, scopes: string[], expire?: string): Promise<Models.Key> { | ||
if (typeof projectId === 'undefined') { | ||
@@ -591,0 +571,0 @@ throw new AppwriteException('Missing required parameter: "projectId"'); |
@@ -19,15 +19,15 @@ import { Service } from '../service'; | ||
* | ||
* @param {string[]} queries | ||
* @param {string} search | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @param {string} orderType | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async listBuckets(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.BucketList> { | ||
async listBuckets(queries?: string[], search?: string): Promise<Models.BucketList> { | ||
let path = '/storage/buckets'; | ||
let payload: Payload = {}; | ||
if (typeof queries !== 'undefined') { | ||
payload['queries'] = queries; | ||
} | ||
if (typeof search !== 'undefined') { | ||
@@ -37,22 +37,2 @@ payload['search'] = search; | ||
if (typeof limit !== 'undefined') { | ||
payload['limit'] = limit; | ||
} | ||
if (typeof offset !== 'undefined') { | ||
payload['offset'] = offset; | ||
} | ||
if (typeof cursor !== 'undefined') { | ||
payload['cursor'] = cursor; | ||
} | ||
if (typeof cursorDirection !== 'undefined') { | ||
payload['cursorDirection'] = cursorDirection; | ||
} | ||
if (typeof orderType !== 'undefined') { | ||
payload['orderType'] = orderType; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -71,8 +51,8 @@ return await this.client.call('get', uri, { | ||
* @param {string} name | ||
* @param {string} permission | ||
* @param {string[]} read | ||
* @param {string[]} write | ||
* @param {string[]} permissions | ||
* @param {boolean} fileSecurity | ||
* @param {boolean} enabled | ||
* @param {number} maximumFileSize | ||
* @param {string[]} allowedFileExtensions | ||
* @param {string} compression | ||
* @param {boolean} encryption | ||
@@ -83,3 +63,3 @@ * @param {boolean} antivirus | ||
*/ | ||
async createBucket(bucketId: string, name: string, permission: string, read?: string[], write?: string[], enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], encryption?: boolean, antivirus?: boolean): Promise<Models.Bucket> { | ||
async createBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: string, encryption?: boolean, antivirus?: boolean): Promise<Models.Bucket> { | ||
if (typeof bucketId === 'undefined') { | ||
@@ -93,6 +73,2 @@ throw new AppwriteException('Missing required parameter: "bucketId"'); | ||
if (typeof permission === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "permission"'); | ||
} | ||
let path = '/storage/buckets'; | ||
@@ -109,14 +85,10 @@ let payload: Payload = {}; | ||
if (typeof permission !== 'undefined') { | ||
payload['permission'] = permission; | ||
if (typeof permissions !== 'undefined') { | ||
payload['permissions'] = permissions; | ||
} | ||
if (typeof read !== 'undefined') { | ||
payload['read'] = read; | ||
if (typeof fileSecurity !== 'undefined') { | ||
payload['fileSecurity'] = fileSecurity; | ||
} | ||
if (typeof write !== 'undefined') { | ||
payload['write'] = write; | ||
} | ||
if (typeof enabled !== 'undefined') { | ||
@@ -134,2 +106,6 @@ payload['enabled'] = enabled; | ||
if (typeof compression !== 'undefined') { | ||
payload['compression'] = compression; | ||
} | ||
if (typeof encryption !== 'undefined') { | ||
@@ -180,8 +156,8 @@ payload['encryption'] = encryption; | ||
* @param {string} name | ||
* @param {string} permission | ||
* @param {string[]} read | ||
* @param {string[]} write | ||
* @param {string[]} permissions | ||
* @param {boolean} fileSecurity | ||
* @param {boolean} enabled | ||
* @param {number} maximumFileSize | ||
* @param {string[]} allowedFileExtensions | ||
* @param {string} compression | ||
* @param {boolean} encryption | ||
@@ -192,3 +168,3 @@ * @param {boolean} antivirus | ||
*/ | ||
async updateBucket(bucketId: string, name: string, permission: string, read?: string[], write?: string[], enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], encryption?: boolean, antivirus?: boolean): Promise<Models.Bucket> { | ||
async updateBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: string, encryption?: boolean, antivirus?: boolean): Promise<Models.Bucket> { | ||
if (typeof bucketId === 'undefined') { | ||
@@ -202,6 +178,2 @@ throw new AppwriteException('Missing required parameter: "bucketId"'); | ||
if (typeof permission === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "permission"'); | ||
} | ||
let path = '/storage/buckets/{bucketId}'.replace('{bucketId}', bucketId); | ||
@@ -214,14 +186,10 @@ let payload: Payload = {}; | ||
if (typeof permission !== 'undefined') { | ||
payload['permission'] = permission; | ||
if (typeof permissions !== 'undefined') { | ||
payload['permissions'] = permissions; | ||
} | ||
if (typeof read !== 'undefined') { | ||
payload['read'] = read; | ||
if (typeof fileSecurity !== 'undefined') { | ||
payload['fileSecurity'] = fileSecurity; | ||
} | ||
if (typeof write !== 'undefined') { | ||
payload['write'] = write; | ||
} | ||
if (typeof enabled !== 'undefined') { | ||
@@ -239,2 +207,6 @@ payload['enabled'] = enabled; | ||
if (typeof compression !== 'undefined') { | ||
payload['compression'] = compression; | ||
} | ||
if (typeof encryption !== 'undefined') { | ||
@@ -285,12 +257,8 @@ payload['encryption'] = encryption; | ||
* @param {string} bucketId | ||
* @param {string[]} queries | ||
* @param {string} search | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @param {string} orderType | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async listFiles(bucketId: string, search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.FileList> { | ||
async listFiles(bucketId: string, queries?: string[], search?: string): Promise<Models.FileList> { | ||
if (typeof bucketId === 'undefined') { | ||
@@ -303,2 +271,6 @@ throw new AppwriteException('Missing required parameter: "bucketId"'); | ||
if (typeof queries !== 'undefined') { | ||
payload['queries'] = queries; | ||
} | ||
if (typeof search !== 'undefined') { | ||
@@ -308,22 +280,2 @@ payload['search'] = search; | ||
if (typeof limit !== 'undefined') { | ||
payload['limit'] = limit; | ||
} | ||
if (typeof offset !== 'undefined') { | ||
payload['offset'] = offset; | ||
} | ||
if (typeof cursor !== 'undefined') { | ||
payload['cursor'] = cursor; | ||
} | ||
if (typeof cursorDirection !== 'undefined') { | ||
payload['cursorDirection'] = cursorDirection; | ||
} | ||
if (typeof orderType !== 'undefined') { | ||
payload['orderType'] = orderType; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -340,4 +292,4 @@ return await this.client.call('get', uri, { | ||
* resource using either a [server | ||
* integration](/docs/server/database#storageCreateBucket) API or directly | ||
* from your Appwrite console. | ||
* integration](/docs/server/storage#storageCreateBucket) API or directly from | ||
* your Appwrite console. | ||
* | ||
@@ -361,8 +313,7 @@ * Larger files should be uploaded using multiple requests with the | ||
* @param {File} file | ||
* @param {string[]} read | ||
* @param {string[]} write | ||
* @param {string[]} permissions | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async createFile(bucketId: string, fileId: string, file: File, read?: string[], write?: string[], onProgress = (progress: UploadProgress) => {}): Promise<Models.File> { | ||
async createFile(bucketId: string, fileId: string, file: File, permissions?: string[], onProgress = (progress: UploadProgress) => {}): Promise<Models.File> { | ||
if (typeof bucketId === 'undefined') { | ||
@@ -391,10 +342,6 @@ throw new AppwriteException('Missing required parameter: "bucketId"'); | ||
if (typeof read !== 'undefined') { | ||
payload['read'] = read; | ||
if (typeof permissions !== 'undefined') { | ||
payload['permissions'] = permissions; | ||
} | ||
if (typeof write !== 'undefined') { | ||
payload['write'] = write; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -501,8 +448,7 @@ | ||
* @param {string} fileId | ||
* @param {string[]} read | ||
* @param {string[]} write | ||
* @param {string[]} permissions | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async updateFile(bucketId: string, fileId: string, read?: string[], write?: string[]): Promise<Models.File> { | ||
async updateFile(bucketId: string, fileId: string, permissions?: string[]): Promise<Models.File> { | ||
if (typeof bucketId === 'undefined') { | ||
@@ -519,10 +465,6 @@ throw new AppwriteException('Missing required parameter: "bucketId"'); | ||
if (typeof read !== 'undefined') { | ||
payload['read'] = read; | ||
if (typeof permissions !== 'undefined') { | ||
payload['permissions'] = permissions; | ||
} | ||
if (typeof write !== 'undefined') { | ||
payload['write'] = write; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -529,0 +471,0 @@ return await this.client.call('put', uri, { |
@@ -22,15 +22,15 @@ import { Service } from '../service'; | ||
* | ||
* @param {string[]} queries | ||
* @param {string} search | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @param {string} orderType | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async list(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.TeamList> { | ||
async list(queries?: string[], search?: string): Promise<Models.TeamList> { | ||
let path = '/teams'; | ||
let payload: Payload = {}; | ||
if (typeof queries !== 'undefined') { | ||
payload['queries'] = queries; | ||
} | ||
if (typeof search !== 'undefined') { | ||
@@ -40,22 +40,2 @@ payload['search'] = search; | ||
if (typeof limit !== 'undefined') { | ||
payload['limit'] = limit; | ||
} | ||
if (typeof offset !== 'undefined') { | ||
payload['offset'] = offset; | ||
} | ||
if (typeof cursor !== 'undefined') { | ||
payload['cursor'] = cursor; | ||
} | ||
if (typeof cursorDirection !== 'undefined') { | ||
payload['cursorDirection'] = cursorDirection; | ||
} | ||
if (typeof orderType !== 'undefined') { | ||
payload['orderType'] = orderType; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -196,8 +176,7 @@ return await this.client.call('get', uri, { | ||
* @param {string} teamId | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string[]} queries | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async listLogs(teamId: string, limit?: number, offset?: number): Promise<Models.LogList> { | ||
async listLogs(teamId: string, queries?: string[]): Promise<Models.LogList> { | ||
if (typeof teamId === 'undefined') { | ||
@@ -210,10 +189,6 @@ throw new AppwriteException('Missing required parameter: "teamId"'); | ||
if (typeof limit !== 'undefined') { | ||
payload['limit'] = limit; | ||
if (typeof queries !== 'undefined') { | ||
payload['queries'] = queries; | ||
} | ||
if (typeof offset !== 'undefined') { | ||
payload['offset'] = offset; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -226,3 +201,3 @@ return await this.client.call('get', uri, { | ||
/** | ||
* Get Team Memberships | ||
* List Team Memberships | ||
* | ||
@@ -233,12 +208,8 @@ * Use this endpoint to list a team's members using the team's ID. All team | ||
* @param {string} teamId | ||
* @param {string[]} queries | ||
* @param {string} search | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @param {string} orderType | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async getMemberships(teamId: string, search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.MembershipList> { | ||
async listMemberships(teamId: string, queries?: string[], search?: string): Promise<Models.MembershipList> { | ||
if (typeof teamId === 'undefined') { | ||
@@ -251,2 +222,6 @@ throw new AppwriteException('Missing required parameter: "teamId"'); | ||
if (typeof queries !== 'undefined') { | ||
payload['queries'] = queries; | ||
} | ||
if (typeof search !== 'undefined') { | ||
@@ -256,22 +231,2 @@ payload['search'] = search; | ||
if (typeof limit !== 'undefined') { | ||
payload['limit'] = limit; | ||
} | ||
if (typeof offset !== 'undefined') { | ||
payload['offset'] = offset; | ||
} | ||
if (typeof cursor !== 'undefined') { | ||
payload['cursor'] = cursor; | ||
} | ||
if (typeof cursorDirection !== 'undefined') { | ||
payload['cursorDirection'] = cursorDirection; | ||
} | ||
if (typeof orderType !== 'undefined') { | ||
payload['orderType'] = orderType; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -278,0 +233,0 @@ return await this.client.call('get', uri, { |
@@ -19,15 +19,15 @@ import { Service } from '../service'; | ||
* | ||
* @param {string[]} queries | ||
* @param {string} search | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @param {string} orderType | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async list<Preferences extends Models.Preferences>(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.UserList<Preferences>> { | ||
async list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.UserList<Preferences>> { | ||
let path = '/users'; | ||
let payload: Payload = {}; | ||
if (typeof queries !== 'undefined') { | ||
payload['queries'] = queries; | ||
} | ||
if (typeof search !== 'undefined') { | ||
@@ -37,24 +37,51 @@ payload['search'] = search; | ||
if (typeof limit !== 'undefined') { | ||
payload['limit'] = limit; | ||
const uri = new URL(this.client.config.endpoint + path); | ||
return await this.client.call('get', uri, { | ||
'content-type': 'application/json', | ||
}, payload); | ||
} | ||
/** | ||
* Create User | ||
* | ||
* Create a new user. | ||
* | ||
* @param {string} userId | ||
* @param {string} email | ||
* @param {string} phone | ||
* @param {string} password | ||
* @param {string} name | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async create<Preferences extends Models.Preferences>(userId: string, email?: string, phone?: string, password?: string, name?: string): Promise<Models.User<Preferences>> { | ||
if (typeof userId === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "userId"'); | ||
} | ||
if (typeof offset !== 'undefined') { | ||
payload['offset'] = offset; | ||
let path = '/users'; | ||
let payload: Payload = {}; | ||
if (typeof userId !== 'undefined') { | ||
payload['userId'] = userId; | ||
} | ||
if (typeof cursor !== 'undefined') { | ||
payload['cursor'] = cursor; | ||
if (typeof email !== 'undefined') { | ||
payload['email'] = email; | ||
} | ||
if (typeof cursorDirection !== 'undefined') { | ||
payload['cursorDirection'] = cursorDirection; | ||
if (typeof phone !== 'undefined') { | ||
payload['phone'] = phone; | ||
} | ||
if (typeof orderType !== 'undefined') { | ||
payload['orderType'] = orderType; | ||
if (typeof password !== 'undefined') { | ||
payload['password'] = password; | ||
} | ||
if (typeof name !== 'undefined') { | ||
payload['name'] = name; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
return await this.client.call('get', uri, { | ||
return await this.client.call('post', uri, { | ||
'content-type': 'application/json', | ||
@@ -65,5 +92,8 @@ }, payload); | ||
/** | ||
* Create User | ||
* Create User with Argon2 Password | ||
* | ||
* Create a new user. | ||
* Create a new user. Password provided must be hashed with the | ||
* [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST | ||
* /users](/docs/server/users#usersCreate) endpoint to create users with a | ||
* plain text password. | ||
* | ||
@@ -77,3 +107,3 @@ * @param {string} userId | ||
*/ | ||
async create<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> { | ||
async createArgon2User<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> { | ||
if (typeof userId === 'undefined') { | ||
@@ -91,3 +121,3 @@ throw new AppwriteException('Missing required parameter: "userId"'); | ||
let path = '/users'; | ||
let path = '/users/argon2'; | ||
let payload: Payload = {}; | ||
@@ -118,2 +148,397 @@ | ||
/** | ||
* Create User with Bcrypt Password | ||
* | ||
* Create a new user. Password provided must be hashed with the | ||
* [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST | ||
* /users](/docs/server/users#usersCreate) endpoint to create users with a | ||
* plain text password. | ||
* | ||
* @param {string} userId | ||
* @param {string} email | ||
* @param {string} password | ||
* @param {string} name | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async createBcryptUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> { | ||
if (typeof userId === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "userId"'); | ||
} | ||
if (typeof email === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "email"'); | ||
} | ||
if (typeof password === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "password"'); | ||
} | ||
let path = '/users/bcrypt'; | ||
let payload: Payload = {}; | ||
if (typeof userId !== 'undefined') { | ||
payload['userId'] = userId; | ||
} | ||
if (typeof email !== 'undefined') { | ||
payload['email'] = email; | ||
} | ||
if (typeof password !== 'undefined') { | ||
payload['password'] = password; | ||
} | ||
if (typeof name !== 'undefined') { | ||
payload['name'] = name; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
return await this.client.call('post', uri, { | ||
'content-type': 'application/json', | ||
}, payload); | ||
} | ||
/** | ||
* Create User with MD5 Password | ||
* | ||
* Create a new user. Password provided must be hashed with the | ||
* [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST | ||
* /users](/docs/server/users#usersCreate) endpoint to create users with a | ||
* plain text password. | ||
* | ||
* @param {string} userId | ||
* @param {string} email | ||
* @param {string} password | ||
* @param {string} name | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async createMD5User<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> { | ||
if (typeof userId === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "userId"'); | ||
} | ||
if (typeof email === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "email"'); | ||
} | ||
if (typeof password === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "password"'); | ||
} | ||
let path = '/users/md5'; | ||
let payload: Payload = {}; | ||
if (typeof userId !== 'undefined') { | ||
payload['userId'] = userId; | ||
} | ||
if (typeof email !== 'undefined') { | ||
payload['email'] = email; | ||
} | ||
if (typeof password !== 'undefined') { | ||
payload['password'] = password; | ||
} | ||
if (typeof name !== 'undefined') { | ||
payload['name'] = name; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
return await this.client.call('post', uri, { | ||
'content-type': 'application/json', | ||
}, payload); | ||
} | ||
/** | ||
* Create User with PHPass Password | ||
* | ||
* Create a new user. Password provided must be hashed with the | ||
* [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST | ||
* /users](/docs/server/users#usersCreate) endpoint to create users with a | ||
* plain text password. | ||
* | ||
* @param {string} userId | ||
* @param {string} email | ||
* @param {string} password | ||
* @param {string} name | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async createPHPassUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> { | ||
if (typeof userId === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "userId"'); | ||
} | ||
if (typeof email === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "email"'); | ||
} | ||
if (typeof password === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "password"'); | ||
} | ||
let path = '/users/phpass'; | ||
let payload: Payload = {}; | ||
if (typeof userId !== 'undefined') { | ||
payload['userId'] = userId; | ||
} | ||
if (typeof email !== 'undefined') { | ||
payload['email'] = email; | ||
} | ||
if (typeof password !== 'undefined') { | ||
payload['password'] = password; | ||
} | ||
if (typeof name !== 'undefined') { | ||
payload['name'] = name; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
return await this.client.call('post', uri, { | ||
'content-type': 'application/json', | ||
}, payload); | ||
} | ||
/** | ||
* Create User with Scrypt Password | ||
* | ||
* Create a new user. Password provided must be hashed with the | ||
* [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST | ||
* /users](/docs/server/users#usersCreate) endpoint to create users with a | ||
* plain text password. | ||
* | ||
* @param {string} userId | ||
* @param {string} email | ||
* @param {string} password | ||
* @param {string} passwordSalt | ||
* @param {number} passwordCpu | ||
* @param {number} passwordMemory | ||
* @param {number} passwordParallel | ||
* @param {number} passwordLength | ||
* @param {string} name | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async createScryptUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string): Promise<Models.User<Preferences>> { | ||
if (typeof userId === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "userId"'); | ||
} | ||
if (typeof email === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "email"'); | ||
} | ||
if (typeof password === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "password"'); | ||
} | ||
if (typeof passwordSalt === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "passwordSalt"'); | ||
} | ||
if (typeof passwordCpu === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "passwordCpu"'); | ||
} | ||
if (typeof passwordMemory === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "passwordMemory"'); | ||
} | ||
if (typeof passwordParallel === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "passwordParallel"'); | ||
} | ||
if (typeof passwordLength === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "passwordLength"'); | ||
} | ||
let path = '/users/scrypt'; | ||
let payload: Payload = {}; | ||
if (typeof userId !== 'undefined') { | ||
payload['userId'] = userId; | ||
} | ||
if (typeof email !== 'undefined') { | ||
payload['email'] = email; | ||
} | ||
if (typeof password !== 'undefined') { | ||
payload['password'] = password; | ||
} | ||
if (typeof passwordSalt !== 'undefined') { | ||
payload['passwordSalt'] = passwordSalt; | ||
} | ||
if (typeof passwordCpu !== 'undefined') { | ||
payload['passwordCpu'] = passwordCpu; | ||
} | ||
if (typeof passwordMemory !== 'undefined') { | ||
payload['passwordMemory'] = passwordMemory; | ||
} | ||
if (typeof passwordParallel !== 'undefined') { | ||
payload['passwordParallel'] = passwordParallel; | ||
} | ||
if (typeof passwordLength !== 'undefined') { | ||
payload['passwordLength'] = passwordLength; | ||
} | ||
if (typeof name !== 'undefined') { | ||
payload['name'] = name; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
return await this.client.call('post', uri, { | ||
'content-type': 'application/json', | ||
}, payload); | ||
} | ||
/** | ||
* Create User with Scrypt Modified Password | ||
* | ||
* Create a new user. Password provided must be hashed with the [Scrypt | ||
* Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) | ||
* algorithm. Use the [POST /users](/docs/server/users#usersCreate) endpoint | ||
* to create users with a plain text password. | ||
* | ||
* @param {string} userId | ||
* @param {string} email | ||
* @param {string} password | ||
* @param {string} passwordSalt | ||
* @param {string} passwordSaltSeparator | ||
* @param {string} passwordSignerKey | ||
* @param {string} name | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async createScryptModifiedUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, passwordSalt: string, passwordSaltSeparator: string, passwordSignerKey: string, name?: string): Promise<Models.User<Preferences>> { | ||
if (typeof userId === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "userId"'); | ||
} | ||
if (typeof email === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "email"'); | ||
} | ||
if (typeof password === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "password"'); | ||
} | ||
if (typeof passwordSalt === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "passwordSalt"'); | ||
} | ||
if (typeof passwordSaltSeparator === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "passwordSaltSeparator"'); | ||
} | ||
if (typeof passwordSignerKey === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "passwordSignerKey"'); | ||
} | ||
let path = '/users/scrypt-modified'; | ||
let payload: Payload = {}; | ||
if (typeof userId !== 'undefined') { | ||
payload['userId'] = userId; | ||
} | ||
if (typeof email !== 'undefined') { | ||
payload['email'] = email; | ||
} | ||
if (typeof password !== 'undefined') { | ||
payload['password'] = password; | ||
} | ||
if (typeof passwordSalt !== 'undefined') { | ||
payload['passwordSalt'] = passwordSalt; | ||
} | ||
if (typeof passwordSaltSeparator !== 'undefined') { | ||
payload['passwordSaltSeparator'] = passwordSaltSeparator; | ||
} | ||
if (typeof passwordSignerKey !== 'undefined') { | ||
payload['passwordSignerKey'] = passwordSignerKey; | ||
} | ||
if (typeof name !== 'undefined') { | ||
payload['name'] = name; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
return await this.client.call('post', uri, { | ||
'content-type': 'application/json', | ||
}, payload); | ||
} | ||
/** | ||
* Create User with SHA Password | ||
* | ||
* Create a new user. Password provided must be hashed with the | ||
* [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use | ||
* the [POST /users](/docs/server/users#usersCreate) endpoint to create users | ||
* with a plain text password. | ||
* | ||
* @param {string} userId | ||
* @param {string} email | ||
* @param {string} password | ||
* @param {string} passwordVersion | ||
* @param {string} name | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async createSHAUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, passwordVersion?: string, name?: string): Promise<Models.User<Preferences>> { | ||
if (typeof userId === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "userId"'); | ||
} | ||
if (typeof email === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "email"'); | ||
} | ||
if (typeof password === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "password"'); | ||
} | ||
let path = '/users/sha'; | ||
let payload: Payload = {}; | ||
if (typeof userId !== 'undefined') { | ||
payload['userId'] = userId; | ||
} | ||
if (typeof email !== 'undefined') { | ||
payload['email'] = email; | ||
} | ||
if (typeof password !== 'undefined') { | ||
payload['password'] = password; | ||
} | ||
if (typeof passwordVersion !== 'undefined') { | ||
payload['passwordVersion'] = passwordVersion; | ||
} | ||
if (typeof name !== 'undefined') { | ||
payload['name'] = name; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
return await this.client.call('post', uri, { | ||
'content-type': 'application/json', | ||
}, payload); | ||
} | ||
/** | ||
* Get usage stats for the users API | ||
@@ -228,3 +653,3 @@ * | ||
/** | ||
* Get User Logs | ||
* List User Logs | ||
* | ||
@@ -234,8 +659,7 @@ * Get the user activity logs list by its unique ID. | ||
* @param {string} userId | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string[]} queries | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async getLogs(userId: string, limit?: number, offset?: number): Promise<Models.LogList> { | ||
async listLogs(userId: string, queries?: string[]): Promise<Models.LogList> { | ||
if (typeof userId === 'undefined') { | ||
@@ -248,10 +672,6 @@ throw new AppwriteException('Missing required parameter: "userId"'); | ||
if (typeof limit !== 'undefined') { | ||
payload['limit'] = limit; | ||
if (typeof queries !== 'undefined') { | ||
payload['queries'] = queries; | ||
} | ||
if (typeof offset !== 'undefined') { | ||
payload['offset'] = offset; | ||
} | ||
const uri = new URL(this.client.config.endpoint + path); | ||
@@ -264,3 +684,3 @@ return await this.client.call('get', uri, { | ||
/** | ||
* Get User Memberships | ||
* List User Memberships | ||
* | ||
@@ -273,3 +693,3 @@ * Get the user membership list by its unique ID. | ||
*/ | ||
async getMemberships(userId: string): Promise<Models.MembershipList> { | ||
async listMemberships(userId: string): Promise<Models.MembershipList> { | ||
if (typeof userId === 'undefined') { | ||
@@ -442,3 +862,3 @@ throw new AppwriteException('Missing required parameter: "userId"'); | ||
/** | ||
* Get User Sessions | ||
* List User Sessions | ||
* | ||
@@ -451,3 +871,3 @@ * Get the user sessions list by its unique ID. | ||
*/ | ||
async getSessions(userId: string): Promise<Models.SessionList> { | ||
async listSessions(userId: string): Promise<Models.SessionList> { | ||
if (typeof userId === 'undefined') { | ||
@@ -454,0 +874,0 @@ throw new AppwriteException('Missing required parameter: "userId"'); |
export declare class Role { | ||
static any(): string; | ||
static user(id: string): string; | ||
static users(): string; | ||
static user(id: string, status?: string): string; | ||
static users(status?: string): string; | ||
static guests(): string; | ||
static team(id: string, role?: string): string; | ||
static status(status: string): string; | ||
static member(id: string): string; | ||
} |
@@ -14,3 +14,3 @@ import { Service } from '../service'; | ||
*/ | ||
get<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>>; | ||
get<Preferences extends Models.Preferences>(): Promise<Models.Account<Preferences>>; | ||
/** | ||
@@ -33,3 +33,3 @@ * Create Account | ||
*/ | ||
create<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>; | ||
create<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.Account<Preferences>>; | ||
/** | ||
@@ -52,3 +52,3 @@ * Update Account Email | ||
*/ | ||
updateEmail<Preferences extends Models.Preferences>(email: string, password: string): Promise<Models.User<Preferences>>; | ||
updateEmail<Preferences extends Models.Preferences>(email: string, password: string): Promise<Models.Account<Preferences>>; | ||
/** | ||
@@ -68,3 +68,3 @@ * Create Account JWT | ||
/** | ||
* Get Account Logs | ||
* List Account Logs | ||
* | ||
@@ -74,8 +74,7 @@ * Get currently logged in user list of latest security activity logs. Each | ||
* | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string[]} queries | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
getLogs(limit?: number, offset?: number): Promise<Models.LogList>; | ||
listLogs(queries?: string[]): Promise<Models.LogList>; | ||
/** | ||
@@ -90,3 +89,3 @@ * Update Account Name | ||
*/ | ||
updateName<Preferences extends Models.Preferences>(name: string): Promise<Models.User<Preferences>>; | ||
updateName<Preferences extends Models.Preferences>(name: string): Promise<Models.Account<Preferences>>; | ||
/** | ||
@@ -104,3 +103,3 @@ * Update Account Password | ||
*/ | ||
updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>>; | ||
updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.Account<Preferences>>; | ||
/** | ||
@@ -115,3 +114,3 @@ * Update Account Phone | ||
* | ||
* @param {string} number | ||
* @param {string} phone | ||
* @param {string} password | ||
@@ -121,3 +120,3 @@ * @throws {AppwriteException} | ||
*/ | ||
updatePhone<Preferences extends Models.Preferences>(number: string, password: string): Promise<Models.User<Preferences>>; | ||
updatePhone<Preferences extends Models.Preferences>(phone: string, password: string): Promise<Models.Account<Preferences>>; | ||
/** | ||
@@ -139,7 +138,7 @@ * Get Account Preferences | ||
* | ||
* @param {Partial<Preferences>} prefs | ||
* @param {object} prefs | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
updatePrefs<Preferences extends Models.Preferences>(prefs: Partial<Preferences>): Promise<Models.User<Preferences>>; | ||
updatePrefs<Preferences extends Models.Preferences>(prefs: object): Promise<Models.Account<Preferences>>; | ||
/** | ||
@@ -185,3 +184,3 @@ * Create Password Recovery | ||
/** | ||
* Get Account Sessions | ||
* List Account Sessions | ||
* | ||
@@ -194,3 +193,3 @@ * Get currently logged in user list of active sessions across different | ||
*/ | ||
getSessions(): Promise<Models.SessionList>; | ||
listSessions(): Promise<Models.SessionList>; | ||
/** | ||
@@ -235,5 +234,6 @@ * Delete All Account Sessions | ||
* | ||
* Sends the user an email with a secret key for creating a session. When the | ||
* user clicks the link in the email, the user is redirected back to the URL | ||
* you provided with the secret key and userId values attached to the URL | ||
* Sends the user an email with a secret key for creating a session. If the | ||
* provided user ID has not be registered, a new user will be created. When | ||
* the user clicks the link in the email, the user is redirected back to the | ||
* URL you provided with the secret key and userId values attached to the URL | ||
* query string. Use the query string parameters to submit a request to the | ||
@@ -310,9 +310,9 @@ * [PUT | ||
* @param {string} userId | ||
* @param {string} number | ||
* @param {string} phone | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
createPhoneSession(userId: string, number: string): Promise<Models.Token>; | ||
createPhoneSession(userId: string, phone: string): Promise<Models.Token>; | ||
/** | ||
* Create Phone session (confirmation) | ||
* Create Phone Session (confirmation) | ||
* | ||
@@ -377,3 +377,3 @@ * Use this endpoint to complete creating a session with SMS. Use the | ||
*/ | ||
updateStatus<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>>; | ||
updateStatus<Preferences extends Models.Preferences>(): Promise<Models.Account<Preferences>>; | ||
/** | ||
@@ -380,0 +380,0 @@ * Create Email Verification |
@@ -64,3 +64,4 @@ import { Service } from '../service'; | ||
* users. The code argument receives the 2 letter country code. Use width, | ||
* height and quality arguments to change the output settings. | ||
* height and quality arguments to change the output settings. Country codes | ||
* follow the [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) standard. | ||
* | ||
@@ -125,3 +126,2 @@ * When one dimension is specified and the other is 0, the image is scaled | ||
* @param {number} height | ||
* @param {string} color | ||
* @param {string} background | ||
@@ -131,3 +131,3 @@ * @throws {AppwriteException} | ||
*/ | ||
getInitials(name?: string, width?: number, height?: number, color?: string, background?: string): URL; | ||
getInitials(name?: string, width?: number, height?: number, background?: string): URL; | ||
/** | ||
@@ -134,0 +134,0 @@ * Get QR Code |
@@ -9,17 +9,17 @@ import { Service } from '../service'; | ||
* | ||
* Get a list of all databases from the current Appwrite project. You can use | ||
* the search parameter to filter your results. | ||
* | ||
* @param {string[]} queries | ||
* @param {string} search | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @param {string} orderType | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
list(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.DatabaseList>; | ||
list(queries?: string[], search?: string): Promise<Models.DatabaseList>; | ||
/** | ||
* Create Database | ||
* | ||
* Create a new Database. | ||
* | ||
* | ||
* @param {string} databaseId | ||
@@ -43,2 +43,4 @@ * @param {string} name | ||
* | ||
* Get a database by its unique ID. This endpoint response returns a JSON | ||
* object with the database metadata. | ||
* | ||
@@ -49,6 +51,7 @@ * @param {string} databaseId | ||
*/ | ||
get(databaseId: string): Promise<Models.Collection>; | ||
get(databaseId: string): Promise<Models.Database>; | ||
/** | ||
* Update Database | ||
* | ||
* Update a database by its unique ID. | ||
* | ||
@@ -60,6 +63,8 @@ * @param {string} databaseId | ||
*/ | ||
update(databaseId: string, name: string): Promise<Models.Collection>; | ||
update(databaseId: string, name: string): Promise<Models.Database>; | ||
/** | ||
* Delete Database | ||
* | ||
* Delete a database by its unique ID. Only API keys with with databases.write | ||
* scope can delete a database. | ||
* | ||
@@ -74,17 +79,19 @@ * @param {string} databaseId | ||
* | ||
* Get a list of all collections that belong to the provided databaseId. You | ||
* can use the search parameter to filter your results. | ||
* | ||
* @param {string} databaseId | ||
* @param {string[]} queries | ||
* @param {string} search | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @param {string} orderType | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
listCollections(databaseId: string, search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.CollectionList>; | ||
listCollections(databaseId: string, queries?: string[], search?: string): Promise<Models.CollectionList>; | ||
/** | ||
* Create Collection | ||
* | ||
* Create a new Collection. Before using this route, you should create a new | ||
* database resource using either a [server | ||
* integration](/docs/server/databases#databasesCreateCollection) API or | ||
* directly from your database console. | ||
* | ||
@@ -94,12 +101,13 @@ * @param {string} databaseId | ||
* @param {string} name | ||
* @param {string} permission | ||
* @param {string[]} read | ||
* @param {string[]} write | ||
* @param {string[]} permissions | ||
* @param {boolean} documentSecurity | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
createCollection(databaseId: string, collectionId: string, name: string, permission: string, read: string[], write: string[]): Promise<Models.Collection>; | ||
createCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean): Promise<Models.Collection>; | ||
/** | ||
* Get Collection | ||
* | ||
* Get a collection by its unique ID. This endpoint response returns a JSON | ||
* object with the collection metadata. | ||
* | ||
@@ -115,2 +123,3 @@ * @param {string} databaseId | ||
* | ||
* Update a collection by its unique ID. | ||
* | ||
@@ -120,5 +129,4 @@ * @param {string} databaseId | ||
* @param {string} name | ||
* @param {string} permission | ||
* @param {string[]} read | ||
* @param {string[]} write | ||
* @param {string[]} permissions | ||
* @param {boolean} documentSecurity | ||
* @param {boolean} enabled | ||
@@ -128,6 +136,8 @@ * @throws {AppwriteException} | ||
*/ | ||
updateCollection(databaseId: string, collectionId: string, name: string, permission: string, read?: string[], write?: string[], enabled?: boolean): Promise<Models.Collection>; | ||
updateCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise<Models.Collection>; | ||
/** | ||
* Delete Collection | ||
* | ||
* Delete a collection by its unique ID. Only users with write permissions | ||
* have access to delete this resource. | ||
* | ||
@@ -153,3 +163,5 @@ * @param {string} databaseId | ||
* | ||
* Create a boolean attribute. | ||
* | ||
* | ||
* @param {string} databaseId | ||
@@ -166,5 +178,21 @@ * @param {string} collectionId | ||
/** | ||
* Create DateTime Attribute | ||
* | ||
* | ||
* @param {string} databaseId | ||
* @param {string} collectionId | ||
* @param {string} key | ||
* @param {boolean} required | ||
* @param {string} xdefault | ||
* @param {boolean} array | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
createDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeDatetime>; | ||
/** | ||
* Create Email Attribute | ||
* | ||
* Create an email attribute. | ||
* | ||
* | ||
* @param {string} databaseId | ||
@@ -198,3 +226,6 @@ * @param {string} collectionId | ||
* | ||
* Create a float attribute. Optionally, minimum and maximum values can be | ||
* provided. | ||
* | ||
* | ||
* @param {string} databaseId | ||
@@ -215,3 +246,6 @@ * @param {string} collectionId | ||
* | ||
* Create an integer attribute. Optionally, minimum and maximum values can be | ||
* provided. | ||
* | ||
* | ||
* @param {string} databaseId | ||
@@ -232,3 +266,5 @@ * @param {string} collectionId | ||
* | ||
* Create IP address attribute. | ||
* | ||
* | ||
* @param {string} databaseId | ||
@@ -247,3 +283,5 @@ * @param {string} collectionId | ||
* | ||
* Create a string attribute. | ||
* | ||
* | ||
* @param {string} databaseId | ||
@@ -263,3 +301,5 @@ * @param {string} collectionId | ||
* | ||
* Create a URL attribute. | ||
* | ||
* | ||
* @param {string} databaseId | ||
@@ -300,2 +340,6 @@ * @param {string} collectionId | ||
* | ||
* Get a list of all the user's documents in a given collection. You can use | ||
* the query params to filter your results. On admin mode, this endpoint will | ||
* return a list of all of documents belonging to the provided collectionId. | ||
* [Learn more about different API modes](/docs/admin). | ||
* | ||
@@ -305,15 +349,13 @@ * @param {string} databaseId | ||
* @param {string[]} queries | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @param {string[]} orderAttributes | ||
* @param {string[]} orderTypes | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
listDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[], limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderAttributes?: string[], orderTypes?: string[]): Promise<Models.DocumentList<Document>>; | ||
listDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>>; | ||
/** | ||
* Create Document | ||
* | ||
* Create a new Document. Before using this route, you should create a new | ||
* collection resource using either a [server | ||
* integration](/docs/server/databases#databasesCreateCollection) API or | ||
* directly from your database console. | ||
* | ||
@@ -324,11 +366,12 @@ * @param {string} databaseId | ||
* @param {Omit<Document, keyof Models.Document>} data | ||
* @param {string[]} read | ||
* @param {string[]} write | ||
* @param {string[]} permissions | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
createDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: Omit<Document, keyof Models.Document>, read?: string[], write?: string[]): Promise<Document>; | ||
createDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: Omit<Document, keyof Models.Document>, permissions?: string[]): Promise<Document>; | ||
/** | ||
* Get Document | ||
* | ||
* Get a document by its unique ID. This endpoint response returns a JSON | ||
* object with the document data. | ||
* | ||
@@ -345,2 +388,4 @@ * @param {string} databaseId | ||
* | ||
* Update a document by its unique ID. Using the patch method you can pass | ||
* only specific fields that will get updated. | ||
* | ||
@@ -351,11 +396,11 @@ * @param {string} databaseId | ||
* @param {Partial<Omit<Document, keyof Models.Document>>} data | ||
* @param {string[]} read | ||
* @param {string[]} write | ||
* @param {string[]} permissions | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
updateDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data?: Partial<Omit<Document, keyof Models.Document>>, read?: string[], write?: string[]): Promise<Document>; | ||
updateDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data?: Partial<Omit<Document, keyof Models.Document>>, permissions?: string[]): Promise<Document>; | ||
/** | ||
* Delete Document | ||
* | ||
* Delete a document by its unique ID. | ||
* | ||
@@ -372,2 +417,3 @@ * @param {string} databaseId | ||
* | ||
* Get the document activity logs list by its unique ID. | ||
* | ||
@@ -377,8 +423,7 @@ * @param {string} databaseId | ||
* @param {string} documentId | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string[]} queries | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
listDocumentLogs(databaseId: string, collectionId: string, documentId: string, limit?: number, offset?: number): Promise<Models.LogList>; | ||
listDocumentLogs(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Models.LogList>; | ||
/** | ||
@@ -433,11 +478,11 @@ * List Indexes | ||
* | ||
* Get the collection activity logs list by its unique ID. | ||
* | ||
* @param {string} databaseId | ||
* @param {string} collectionId | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string[]} queries | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
listCollectionLogs(databaseId: string, collectionId: string, limit?: number, offset?: number): Promise<Models.LogList>; | ||
listCollectionLogs(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.LogList>; | ||
/** | ||
@@ -455,12 +500,12 @@ * Get usage stats for a collection | ||
/** | ||
* List Collection Logs | ||
* List Database Logs | ||
* | ||
* Get the database activity logs list by its unique ID. | ||
* | ||
* @param {string} databaseId | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string[]} queries | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
listLogs(databaseId: string, limit?: number, offset?: number): Promise<Models.LogList>; | ||
listLogs(databaseId: string, queries?: string[]): Promise<Models.LogList>; | ||
/** | ||
@@ -467,0 +512,0 @@ * Get usage stats for the database |
@@ -13,12 +13,8 @@ import { Service } from '../service'; | ||
* | ||
* @param {string[]} queries | ||
* @param {string} search | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @param {string} orderType | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
list(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.FunctionList>; | ||
list(queries?: string[], search?: string): Promise<Models.FunctionList>; | ||
/** | ||
@@ -35,10 +31,10 @@ * Create Function | ||
* @param {string} runtime | ||
* @param {object} vars | ||
* @param {string[]} events | ||
* @param {string} schedule | ||
* @param {number} timeout | ||
* @param {boolean} enabled | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
create(functionId: string, name: string, execute: string[], runtime: string, vars?: object, events?: string[], schedule?: string, timeout?: number): Promise<Models.Function>; | ||
create(functionId: string, name: string, execute: string[], runtime: string, events?: string[], schedule?: string, timeout?: number, enabled?: boolean): Promise<Models.Function>; | ||
/** | ||
@@ -54,2 +50,11 @@ * List runtimes | ||
/** | ||
* Get Functions Usage | ||
* | ||
* | ||
* @param {string} range | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
getUsage(range?: string): Promise<Models.UsageFunctions>; | ||
/** | ||
* Get Function | ||
@@ -72,10 +77,10 @@ * | ||
* @param {string[]} execute | ||
* @param {object} vars | ||
* @param {string[]} events | ||
* @param {string} schedule | ||
* @param {number} timeout | ||
* @param {boolean} enabled | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
update(functionId: string, name: string, execute: string[], vars?: object, events?: string[], schedule?: string, timeout?: number): Promise<Models.Function>; | ||
update(functionId: string, name: string, execute: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean): Promise<Models.Function>; | ||
/** | ||
@@ -98,12 +103,8 @@ * Delete Function | ||
* @param {string} functionId | ||
* @param {string[]} queries | ||
* @param {string} search | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @param {string} orderType | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
listDeployments(functionId: string, search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.DeploymentList>; | ||
listDeployments(functionId: string, queries?: string[], search?: string): Promise<Models.DeploymentList>; | ||
/** | ||
@@ -141,3 +142,3 @@ * Create Deployment | ||
*/ | ||
getDeployment(functionId: string, deploymentId: string): Promise<Models.DeploymentList>; | ||
getDeployment(functionId: string, deploymentId: string): Promise<Models.Deployment>; | ||
/** | ||
@@ -187,11 +188,8 @@ * Update Function Deployment | ||
* @param {string} functionId | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string[]} queries | ||
* @param {string} search | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
listExecutions(functionId: string, limit?: number, offset?: number, search?: string, cursor?: string, cursorDirection?: string): Promise<Models.ExecutionList>; | ||
listExecutions(functionId: string, queries?: string[], search?: string): Promise<Models.ExecutionList>; | ||
/** | ||
@@ -232,3 +230,61 @@ * Create Execution | ||
*/ | ||
getUsage(functionId: string, range?: string): Promise<Models.UsageFunctions>; | ||
getFunctionUsage(functionId: string, range?: string): Promise<Models.UsageFunctions>; | ||
/** | ||
* List Variables | ||
* | ||
* Get a list of all variables of a specific function. | ||
* | ||
* @param {string} functionId | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
listVariables(functionId: string): Promise<Models.VariableList>; | ||
/** | ||
* Create Variable | ||
* | ||
* Create a new function variable. These variables can be accessed within | ||
* function in the `env` object under the request variable. | ||
* | ||
* @param {string} functionId | ||
* @param {string} key | ||
* @param {string} value | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
createVariable(functionId: string, key: string, value: string): Promise<Models.Variable>; | ||
/** | ||
* Get Variable | ||
* | ||
* Get a variable by its unique ID. | ||
* | ||
* @param {string} functionId | ||
* @param {string} variableId | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
getVariable(functionId: string, variableId: string): Promise<Models.Variable>; | ||
/** | ||
* Update Variable | ||
* | ||
* Update variable by its unique ID. | ||
* | ||
* @param {string} functionId | ||
* @param {string} variableId | ||
* @param {string} key | ||
* @param {string} value | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
updateVariable(functionId: string, variableId: string, key: string, value?: string): Promise<Models.Variable>; | ||
/** | ||
* Delete Variable | ||
* | ||
* Delete a variable by its unique ID. | ||
* | ||
* @param {string} functionId | ||
* @param {string} variableId | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
deleteVariable(functionId: string, variableId: string): Promise<{}>; | ||
} |
@@ -29,3 +29,3 @@ import { Service } from '../service'; | ||
*/ | ||
getContinents(): Promise<Models.ContinentList>; | ||
listContinents(): Promise<Models.ContinentList>; | ||
/** | ||
@@ -40,3 +40,3 @@ * List Countries | ||
*/ | ||
getCountries(): Promise<Models.CountryList>; | ||
listCountries(): Promise<Models.CountryList>; | ||
/** | ||
@@ -51,3 +51,3 @@ * List EU Countries | ||
*/ | ||
getCountriesEU(): Promise<Models.CountryList>; | ||
listCountriesEU(): Promise<Models.CountryList>; | ||
/** | ||
@@ -62,3 +62,3 @@ * List Countries Phone Codes | ||
*/ | ||
getCountriesPhones(): Promise<Models.PhoneList>; | ||
listCountriesPhones(): Promise<Models.PhoneList>; | ||
/** | ||
@@ -74,3 +74,3 @@ * List Currencies | ||
*/ | ||
getCurrencies(): Promise<Models.CurrencyList>; | ||
listCurrencies(): Promise<Models.CurrencyList>; | ||
/** | ||
@@ -85,3 +85,3 @@ * List Languages | ||
*/ | ||
getLanguages(): Promise<Models.LanguageList>; | ||
listLanguages(): Promise<Models.LanguageList>; | ||
} |
@@ -10,12 +10,8 @@ import { Service } from '../service'; | ||
* | ||
* @param {string[]} queries | ||
* @param {string} search | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @param {string} orderType | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
list(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.ProjectList>; | ||
list(queries?: string[], search?: string): Promise<Models.ProjectList>; | ||
/** | ||
@@ -165,7 +161,7 @@ * Create Project | ||
* @param {string[]} scopes | ||
* @param {number} expire | ||
* @param {string} expire | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
createKey(projectId: string, name: string, scopes: string[], expire?: number): Promise<Models.Key>; | ||
createKey(projectId: string, name: string, scopes: string[], expire?: string): Promise<Models.Key>; | ||
/** | ||
@@ -189,7 +185,7 @@ * Get Key | ||
* @param {string[]} scopes | ||
* @param {number} expire | ||
* @param {string} expire | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
updateKey(projectId: string, keyId: string, name: string, scopes: string[], expire?: number): Promise<Models.Key>; | ||
updateKey(projectId: string, keyId: string, name: string, scopes: string[], expire?: string): Promise<Models.Key>; | ||
/** | ||
@@ -196,0 +192,0 @@ * Delete Key |
@@ -13,12 +13,8 @@ import { Service } from '../service'; | ||
* | ||
* @param {string[]} queries | ||
* @param {string} search | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @param {string} orderType | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
listBuckets(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.BucketList>; | ||
listBuckets(queries?: string[], search?: string): Promise<Models.BucketList>; | ||
/** | ||
@@ -31,8 +27,8 @@ * Create bucket | ||
* @param {string} name | ||
* @param {string} permission | ||
* @param {string[]} read | ||
* @param {string[]} write | ||
* @param {string[]} permissions | ||
* @param {boolean} fileSecurity | ||
* @param {boolean} enabled | ||
* @param {number} maximumFileSize | ||
* @param {string[]} allowedFileExtensions | ||
* @param {string} compression | ||
* @param {boolean} encryption | ||
@@ -43,3 +39,3 @@ * @param {boolean} antivirus | ||
*/ | ||
createBucket(bucketId: string, name: string, permission: string, read?: string[], write?: string[], enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], encryption?: boolean, antivirus?: boolean): Promise<Models.Bucket>; | ||
createBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: string, encryption?: boolean, antivirus?: boolean): Promise<Models.Bucket>; | ||
/** | ||
@@ -63,8 +59,8 @@ * Get Bucket | ||
* @param {string} name | ||
* @param {string} permission | ||
* @param {string[]} read | ||
* @param {string[]} write | ||
* @param {string[]} permissions | ||
* @param {boolean} fileSecurity | ||
* @param {boolean} enabled | ||
* @param {number} maximumFileSize | ||
* @param {string[]} allowedFileExtensions | ||
* @param {string} compression | ||
* @param {boolean} encryption | ||
@@ -75,3 +71,3 @@ * @param {boolean} antivirus | ||
*/ | ||
updateBucket(bucketId: string, name: string, permission: string, read?: string[], write?: string[], enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], encryption?: boolean, antivirus?: boolean): Promise<Models.Bucket>; | ||
updateBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: string, encryption?: boolean, antivirus?: boolean): Promise<Models.Bucket>; | ||
/** | ||
@@ -95,12 +91,8 @@ * Delete Bucket | ||
* @param {string} bucketId | ||
* @param {string[]} queries | ||
* @param {string} search | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @param {string} orderType | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
listFiles(bucketId: string, search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.FileList>; | ||
listFiles(bucketId: string, queries?: string[], search?: string): Promise<Models.FileList>; | ||
/** | ||
@@ -111,4 +103,4 @@ * Create File | ||
* resource using either a [server | ||
* integration](/docs/server/database#storageCreateBucket) API or directly | ||
* from your Appwrite console. | ||
* integration](/docs/server/storage#storageCreateBucket) API or directly from | ||
* your Appwrite console. | ||
* | ||
@@ -132,8 +124,7 @@ * Larger files should be uploaded using multiple requests with the | ||
* @param {File} file | ||
* @param {string[]} read | ||
* @param {string[]} write | ||
* @param {string[]} permissions | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
createFile(bucketId: string, fileId: string, file: File, read?: string[], write?: string[], onProgress?: (progress: UploadProgress) => void): Promise<Models.File>; | ||
createFile(bucketId: string, fileId: string, file: File, permissions?: string[], onProgress?: (progress: UploadProgress) => void): Promise<Models.File>; | ||
/** | ||
@@ -159,8 +150,7 @@ * Get File | ||
* @param {string} fileId | ||
* @param {string[]} read | ||
* @param {string[]} write | ||
* @param {string[]} permissions | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
updateFile(bucketId: string, fileId: string, read?: string[], write?: string[]): Promise<Models.File>; | ||
updateFile(bucketId: string, fileId: string, permissions?: string[]): Promise<Models.File>; | ||
/** | ||
@@ -167,0 +157,0 @@ * Delete File |
@@ -15,12 +15,8 @@ import { Service } from '../service'; | ||
* | ||
* @param {string[]} queries | ||
* @param {string} search | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @param {string} orderType | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
list(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.TeamList>; | ||
list(queries?: string[], search?: string): Promise<Models.TeamList>; | ||
/** | ||
@@ -79,10 +75,9 @@ * Create Team | ||
* @param {string} teamId | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string[]} queries | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
listLogs(teamId: string, limit?: number, offset?: number): Promise<Models.LogList>; | ||
listLogs(teamId: string, queries?: string[]): Promise<Models.LogList>; | ||
/** | ||
* Get Team Memberships | ||
* List Team Memberships | ||
* | ||
@@ -93,12 +88,8 @@ * Use this endpoint to list a team's members using the team's ID. All team | ||
* @param {string} teamId | ||
* @param {string[]} queries | ||
* @param {string} search | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @param {string} orderType | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
getMemberships(teamId: string, search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.MembershipList>; | ||
listMemberships(teamId: string, queries?: string[], search?: string): Promise<Models.MembershipList>; | ||
/** | ||
@@ -105,0 +96,0 @@ * Create Team Membership |
@@ -12,12 +12,8 @@ import { Service } from '../service'; | ||
* | ||
* @param {string[]} queries | ||
* @param {string} search | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string} cursor | ||
* @param {string} cursorDirection | ||
* @param {string} orderType | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
list<Preferences extends Models.Preferences>(search?: string, limit?: number, offset?: number, cursor?: string, cursorDirection?: string, orderType?: string): Promise<Models.UserList<Preferences>>; | ||
list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.UserList<Preferences>>; | ||
/** | ||
@@ -30,2 +26,3 @@ * Create User | ||
* @param {string} email | ||
* @param {string} phone | ||
* @param {string} password | ||
@@ -36,4 +33,125 @@ * @param {string} name | ||
*/ | ||
create<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>; | ||
create<Preferences extends Models.Preferences>(userId: string, email?: string, phone?: string, password?: string, name?: string): Promise<Models.User<Preferences>>; | ||
/** | ||
* Create User with Argon2 Password | ||
* | ||
* Create a new user. Password provided must be hashed with the | ||
* [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST | ||
* /users](/docs/server/users#usersCreate) endpoint to create users with a | ||
* plain text password. | ||
* | ||
* @param {string} userId | ||
* @param {string} email | ||
* @param {string} password | ||
* @param {string} name | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
createArgon2User<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>; | ||
/** | ||
* Create User with Bcrypt Password | ||
* | ||
* Create a new user. Password provided must be hashed with the | ||
* [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST | ||
* /users](/docs/server/users#usersCreate) endpoint to create users with a | ||
* plain text password. | ||
* | ||
* @param {string} userId | ||
* @param {string} email | ||
* @param {string} password | ||
* @param {string} name | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
createBcryptUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>; | ||
/** | ||
* Create User with MD5 Password | ||
* | ||
* Create a new user. Password provided must be hashed with the | ||
* [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST | ||
* /users](/docs/server/users#usersCreate) endpoint to create users with a | ||
* plain text password. | ||
* | ||
* @param {string} userId | ||
* @param {string} email | ||
* @param {string} password | ||
* @param {string} name | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
createMD5User<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>; | ||
/** | ||
* Create User with PHPass Password | ||
* | ||
* Create a new user. Password provided must be hashed with the | ||
* [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST | ||
* /users](/docs/server/users#usersCreate) endpoint to create users with a | ||
* plain text password. | ||
* | ||
* @param {string} userId | ||
* @param {string} email | ||
* @param {string} password | ||
* @param {string} name | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
createPHPassUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>; | ||
/** | ||
* Create User with Scrypt Password | ||
* | ||
* Create a new user. Password provided must be hashed with the | ||
* [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST | ||
* /users](/docs/server/users#usersCreate) endpoint to create users with a | ||
* plain text password. | ||
* | ||
* @param {string} userId | ||
* @param {string} email | ||
* @param {string} password | ||
* @param {string} passwordSalt | ||
* @param {number} passwordCpu | ||
* @param {number} passwordMemory | ||
* @param {number} passwordParallel | ||
* @param {number} passwordLength | ||
* @param {string} name | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
createScryptUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string): Promise<Models.User<Preferences>>; | ||
/** | ||
* Create User with Scrypt Modified Password | ||
* | ||
* Create a new user. Password provided must be hashed with the [Scrypt | ||
* Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) | ||
* algorithm. Use the [POST /users](/docs/server/users#usersCreate) endpoint | ||
* to create users with a plain text password. | ||
* | ||
* @param {string} userId | ||
* @param {string} email | ||
* @param {string} password | ||
* @param {string} passwordSalt | ||
* @param {string} passwordSaltSeparator | ||
* @param {string} passwordSignerKey | ||
* @param {string} name | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
createScryptModifiedUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, passwordSalt: string, passwordSaltSeparator: string, passwordSignerKey: string, name?: string): Promise<Models.User<Preferences>>; | ||
/** | ||
* Create User with SHA Password | ||
* | ||
* Create a new user. Password provided must be hashed with the | ||
* [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use | ||
* the [POST /users](/docs/server/users#usersCreate) endpoint to create users | ||
* with a plain text password. | ||
* | ||
* @param {string} userId | ||
* @param {string} email | ||
* @param {string} password | ||
* @param {string} passwordVersion | ||
* @param {string} name | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
createSHAUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, passwordVersion?: string, name?: string): Promise<Models.User<Preferences>>; | ||
/** | ||
* Get usage stats for the users API | ||
@@ -84,3 +202,3 @@ * | ||
/** | ||
* Get User Logs | ||
* List User Logs | ||
* | ||
@@ -90,10 +208,9 @@ * Get the user activity logs list by its unique ID. | ||
* @param {string} userId | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @param {string[]} queries | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
getLogs(userId: string, limit?: number, offset?: number): Promise<Models.LogList>; | ||
listLogs(userId: string, queries?: string[]): Promise<Models.LogList>; | ||
/** | ||
* Get User Memberships | ||
* List User Memberships | ||
* | ||
@@ -106,3 +223,3 @@ * Get the user membership list by its unique ID. | ||
*/ | ||
getMemberships(userId: string): Promise<Models.MembershipList>; | ||
listMemberships(userId: string): Promise<Models.MembershipList>; | ||
/** | ||
@@ -165,3 +282,3 @@ * Update Name | ||
/** | ||
* Get User Sessions | ||
* List User Sessions | ||
* | ||
@@ -174,3 +291,3 @@ * Get the user sessions list by its unique ID. | ||
*/ | ||
getSessions(userId: string): Promise<Models.SessionList>; | ||
listSessions(userId: string): Promise<Models.SessionList>; | ||
/** | ||
@@ -177,0 +294,0 @@ * Delete User Sessions |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
2409160
246
36307