UNPKG

node-appwrite

Version:

Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API

56 lines (53 loc) 1.81 kB
import { Client } from '../client.mjs'; import { Models } from '../models.mjs'; import '../query.mjs'; declare class Tokens { client: Client; constructor(client: Client); /** * List all the tokens created for a specific file or bucket. You can use the query params to filter your results. * * @param {string} bucketId * @param {string} fileId * @param {string[]} queries * @throws {AppwriteException} * @returns {Promise<Models.ResourceTokenList>} */ list(bucketId: string, fileId: string, queries?: string[]): Promise<Models.ResourceTokenList>; /** * Create a new token. A token is linked to a file. Token can be passed as a header or request get parameter. * * @param {string} bucketId * @param {string} fileId * @param {string} expire * @throws {AppwriteException} * @returns {Promise<Models.ResourceToken>} */ createFileToken(bucketId: string, fileId: string, expire?: string): Promise<Models.ResourceToken>; /** * Get a token by its unique ID. * * @param {string} tokenId * @throws {AppwriteException} * @returns {Promise<Models.ResourceToken>} */ get(tokenId: string): Promise<Models.ResourceToken>; /** * Update a token by its unique ID. Use this endpoint to update a token&#039;s expiry date. * * @param {string} tokenId * @param {string} expire * @throws {AppwriteException} * @returns {Promise<Models.ResourceToken>} */ update(tokenId: string, expire?: string): Promise<Models.ResourceToken>; /** * Delete a token by its unique ID. * * @param {string} tokenId * @throws {AppwriteException} * @returns {Promise<{}>} */ delete(tokenId: string): Promise<{}>; } export { Tokens };