Complete Email Sortierer implementation with Appwrite and Stripe integration
This commit is contained in:
1011
server/node_modules/node-appwrite/dist/services/account.d.mts
generated
vendored
Normal file
1011
server/node_modules/node-appwrite/dist/services/account.d.mts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1011
server/node_modules/node-appwrite/dist/services/account.d.ts
generated
vendored
Normal file
1011
server/node_modules/node-appwrite/dist/services/account.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1596
server/node_modules/node-appwrite/dist/services/account.js
generated
vendored
Normal file
1596
server/node_modules/node-appwrite/dist/services/account.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
server/node_modules/node-appwrite/dist/services/account.js.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/account.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1595
server/node_modules/node-appwrite/dist/services/account.mjs
generated
vendored
Normal file
1595
server/node_modules/node-appwrite/dist/services/account.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
server/node_modules/node-appwrite/dist/services/account.mjs.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/account.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
334
server/node_modules/node-appwrite/dist/services/avatars.d.mts
generated
vendored
Normal file
334
server/node_modules/node-appwrite/dist/services/avatars.d.mts
generated
vendored
Normal file
@@ -0,0 +1,334 @@
|
||||
import { Client } from '../client.mjs';
|
||||
import { Browser } from '../enums/browser.mjs';
|
||||
import { CreditCard } from '../enums/credit-card.mjs';
|
||||
import { Flag } from '../enums/flag.mjs';
|
||||
import { Theme } from '../enums/theme.mjs';
|
||||
import { Timezone } from '../enums/timezone.mjs';
|
||||
import { Output } from '../enums/output.mjs';
|
||||
import '../models.mjs';
|
||||
import '../enums/database-type.mjs';
|
||||
import '../enums/attribute-status.mjs';
|
||||
import '../enums/column-status.mjs';
|
||||
import '../enums/index-status.mjs';
|
||||
import '../enums/deployment-status.mjs';
|
||||
import '../enums/execution-trigger.mjs';
|
||||
import '../enums/execution-status.mjs';
|
||||
import '../enums/health-antivirus-status.mjs';
|
||||
import '../enums/health-check-status.mjs';
|
||||
import '../enums/message-status.mjs';
|
||||
import '../query.mjs';
|
||||
|
||||
declare class Avatars {
|
||||
client: Client;
|
||||
constructor(client: Client);
|
||||
/**
|
||||
* You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.
|
||||
*
|
||||
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
||||
*
|
||||
* @param {Browser} params.code - Browser Code.
|
||||
* @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getBrowser(params: {
|
||||
code: Browser;
|
||||
width?: number;
|
||||
height?: number;
|
||||
quality?: number;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.
|
||||
*
|
||||
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
||||
*
|
||||
* @param {Browser} code - Browser Code.
|
||||
* @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getBrowser(code: Browser, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.
|
||||
*
|
||||
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
||||
*
|
||||
*
|
||||
* @param {CreditCard} params.code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.
|
||||
* @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getCreditCard(params: {
|
||||
code: CreditCard;
|
||||
width?: number;
|
||||
height?: number;
|
||||
quality?: number;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.
|
||||
*
|
||||
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
||||
*
|
||||
*
|
||||
* @param {CreditCard} code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.
|
||||
* @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getCreditCard(code: CreditCard, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.
|
||||
*
|
||||
* This endpoint does not follow HTTP redirects.
|
||||
*
|
||||
* @param {string} params.url - Website URL which you want to fetch the favicon from.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getFavicon(params: {
|
||||
url: string;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.
|
||||
*
|
||||
* This endpoint does not follow HTTP redirects.
|
||||
*
|
||||
* @param {string} url - Website URL which you want to fetch the favicon from.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getFavicon(url: string): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
|
||||
*
|
||||
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
||||
*
|
||||
*
|
||||
* @param {Flag} params.code - Country Code. ISO Alpha-2 country code format.
|
||||
* @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getFlag(params: {
|
||||
code: Flag;
|
||||
width?: number;
|
||||
height?: number;
|
||||
quality?: number;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
|
||||
*
|
||||
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
||||
*
|
||||
*
|
||||
* @param {Flag} code - Country Code. ISO Alpha-2 country code format.
|
||||
* @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getFlag(code: Flag, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.
|
||||
*
|
||||
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.
|
||||
*
|
||||
* This endpoint does not follow HTTP redirects.
|
||||
*
|
||||
* @param {string} params.url - Image URL which you want to crop.
|
||||
* @param {number} params.width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.
|
||||
* @param {number} params.height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getImage(params: {
|
||||
url: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.
|
||||
*
|
||||
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.
|
||||
*
|
||||
* This endpoint does not follow HTTP redirects.
|
||||
*
|
||||
* @param {string} url - Image URL which you want to crop.
|
||||
* @param {number} width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.
|
||||
* @param {number} height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getImage(url: string, width?: number, height?: number): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.
|
||||
*
|
||||
* You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.
|
||||
*
|
||||
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
||||
*
|
||||
*
|
||||
* @param {string} params.name - Full Name. When empty, current user name or email will be used. Max length: 128 chars.
|
||||
* @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {string} params.background - Changes background color. By default a random color will be picked and stay will persistent to the given name.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getInitials(params?: {
|
||||
name?: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
background?: string;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.
|
||||
*
|
||||
* You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.
|
||||
*
|
||||
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
||||
*
|
||||
*
|
||||
* @param {string} name - Full Name. When empty, current user name or email will be used. Max length: 128 chars.
|
||||
* @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {string} background - Changes background color. By default a random color will be picked and stay will persistent to the given name.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getInitials(name?: string, width?: number, height?: number, background?: string): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.
|
||||
*
|
||||
*
|
||||
* @param {string} params.text - Plain text to be converted to QR code image.
|
||||
* @param {number} params.size - QR code size. Pass an integer between 1 to 1000. Defaults to 400.
|
||||
* @param {number} params.margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1.
|
||||
* @param {boolean} params.download - Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getQR(params: {
|
||||
text: string;
|
||||
size?: number;
|
||||
margin?: number;
|
||||
download?: boolean;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.
|
||||
*
|
||||
*
|
||||
* @param {string} text - Plain text to be converted to QR code image.
|
||||
* @param {number} size - QR code size. Pass an integer between 1 to 1000. Defaults to 400.
|
||||
* @param {number} margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1.
|
||||
* @param {boolean} download - Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQR(text: string, size?: number, margin?: number, download?: boolean): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Use this endpoint to capture a screenshot of any website URL. This endpoint uses a headless browser to render the webpage and capture it as an image.
|
||||
*
|
||||
* You can configure the browser viewport size, theme, user agent, geolocation, permissions, and more. Capture either just the viewport or the full page scroll.
|
||||
*
|
||||
* When width and height are specified, the image is resized accordingly. If both dimensions are 0, the API provides an image at original size. If dimensions are not specified, the default viewport size is 1280x720px.
|
||||
*
|
||||
* @param {string} params.url - Website URL which you want to capture.
|
||||
* @param {object} params.headers - HTTP headers to send with the browser request. Defaults to empty.
|
||||
* @param {number} params.viewportWidth - Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280.
|
||||
* @param {number} params.viewportHeight - Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720.
|
||||
* @param {number} params.scale - Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1.
|
||||
* @param {Theme} params.theme - Browser theme. Pass "light" or "dark". Defaults to "light".
|
||||
* @param {string} params.userAgent - Custom user agent string. Defaults to browser default.
|
||||
* @param {boolean} params.fullpage - Capture full page scroll. Pass 0 for viewport only, or 1 for full page. Defaults to 0.
|
||||
* @param {string} params.locale - Browser locale (e.g., "en-US", "fr-FR"). Defaults to browser default.
|
||||
* @param {Timezone} params.timezone - IANA timezone identifier (e.g., "America/New_York", "Europe/London"). Defaults to browser default.
|
||||
* @param {number} params.latitude - Geolocation latitude. Pass a number between -90 to 90. Defaults to 0.
|
||||
* @param {number} params.longitude - Geolocation longitude. Pass a number between -180 to 180. Defaults to 0.
|
||||
* @param {number} params.accuracy - Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0.
|
||||
* @param {boolean} params.touch - Enable touch support. Pass 0 for no touch, or 1 for touch enabled. Defaults to 0.
|
||||
* @param {string[]} params.permissions - Browser permissions to grant. Pass an array of permission names like ["geolocation", "camera", "microphone"]. Defaults to empty.
|
||||
* @param {number} params.sleep - Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0.
|
||||
* @param {number} params.width - Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width).
|
||||
* @param {number} params.height - Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height).
|
||||
* @param {number} params.quality - Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
||||
* @param {Output} params.output - Output format type (jpeg, jpg, png, gif and webp).
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getScreenshot(params: {
|
||||
url: string;
|
||||
headers?: object;
|
||||
viewportWidth?: number;
|
||||
viewportHeight?: number;
|
||||
scale?: number;
|
||||
theme?: Theme;
|
||||
userAgent?: string;
|
||||
fullpage?: boolean;
|
||||
locale?: string;
|
||||
timezone?: Timezone;
|
||||
latitude?: number;
|
||||
longitude?: number;
|
||||
accuracy?: number;
|
||||
touch?: boolean;
|
||||
permissions?: string[];
|
||||
sleep?: number;
|
||||
width?: number;
|
||||
height?: number;
|
||||
quality?: number;
|
||||
output?: Output;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Use this endpoint to capture a screenshot of any website URL. This endpoint uses a headless browser to render the webpage and capture it as an image.
|
||||
*
|
||||
* You can configure the browser viewport size, theme, user agent, geolocation, permissions, and more. Capture either just the viewport or the full page scroll.
|
||||
*
|
||||
* When width and height are specified, the image is resized accordingly. If both dimensions are 0, the API provides an image at original size. If dimensions are not specified, the default viewport size is 1280x720px.
|
||||
*
|
||||
* @param {string} url - Website URL which you want to capture.
|
||||
* @param {object} headers - HTTP headers to send with the browser request. Defaults to empty.
|
||||
* @param {number} viewportWidth - Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280.
|
||||
* @param {number} viewportHeight - Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720.
|
||||
* @param {number} scale - Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1.
|
||||
* @param {Theme} theme - Browser theme. Pass "light" or "dark". Defaults to "light".
|
||||
* @param {string} userAgent - Custom user agent string. Defaults to browser default.
|
||||
* @param {boolean} fullpage - Capture full page scroll. Pass 0 for viewport only, or 1 for full page. Defaults to 0.
|
||||
* @param {string} locale - Browser locale (e.g., "en-US", "fr-FR"). Defaults to browser default.
|
||||
* @param {Timezone} timezone - IANA timezone identifier (e.g., "America/New_York", "Europe/London"). Defaults to browser default.
|
||||
* @param {number} latitude - Geolocation latitude. Pass a number between -90 to 90. Defaults to 0.
|
||||
* @param {number} longitude - Geolocation longitude. Pass a number between -180 to 180. Defaults to 0.
|
||||
* @param {number} accuracy - Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0.
|
||||
* @param {boolean} touch - Enable touch support. Pass 0 for no touch, or 1 for touch enabled. Defaults to 0.
|
||||
* @param {string[]} permissions - Browser permissions to grant. Pass an array of permission names like ["geolocation", "camera", "microphone"]. Defaults to empty.
|
||||
* @param {number} sleep - Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0.
|
||||
* @param {number} width - Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width).
|
||||
* @param {number} height - Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height).
|
||||
* @param {number} quality - Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
||||
* @param {Output} output - Output format type (jpeg, jpg, png, gif and webp).
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getScreenshot(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: string[], sleep?: number, width?: number, height?: number, quality?: number, output?: Output): Promise<ArrayBuffer>;
|
||||
}
|
||||
|
||||
export { Avatars };
|
||||
334
server/node_modules/node-appwrite/dist/services/avatars.d.ts
generated
vendored
Normal file
334
server/node_modules/node-appwrite/dist/services/avatars.d.ts
generated
vendored
Normal file
@@ -0,0 +1,334 @@
|
||||
import { Client } from '../client.js';
|
||||
import { Browser } from '../enums/browser.js';
|
||||
import { CreditCard } from '../enums/credit-card.js';
|
||||
import { Flag } from '../enums/flag.js';
|
||||
import { Theme } from '../enums/theme.js';
|
||||
import { Timezone } from '../enums/timezone.js';
|
||||
import { Output } from '../enums/output.js';
|
||||
import '../models.js';
|
||||
import '../enums/database-type.js';
|
||||
import '../enums/attribute-status.js';
|
||||
import '../enums/column-status.js';
|
||||
import '../enums/index-status.js';
|
||||
import '../enums/deployment-status.js';
|
||||
import '../enums/execution-trigger.js';
|
||||
import '../enums/execution-status.js';
|
||||
import '../enums/health-antivirus-status.js';
|
||||
import '../enums/health-check-status.js';
|
||||
import '../enums/message-status.js';
|
||||
import '../query.js';
|
||||
|
||||
declare class Avatars {
|
||||
client: Client;
|
||||
constructor(client: Client);
|
||||
/**
|
||||
* You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.
|
||||
*
|
||||
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
||||
*
|
||||
* @param {Browser} params.code - Browser Code.
|
||||
* @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getBrowser(params: {
|
||||
code: Browser;
|
||||
width?: number;
|
||||
height?: number;
|
||||
quality?: number;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.
|
||||
*
|
||||
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
||||
*
|
||||
* @param {Browser} code - Browser Code.
|
||||
* @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getBrowser(code: Browser, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.
|
||||
*
|
||||
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
||||
*
|
||||
*
|
||||
* @param {CreditCard} params.code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.
|
||||
* @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getCreditCard(params: {
|
||||
code: CreditCard;
|
||||
width?: number;
|
||||
height?: number;
|
||||
quality?: number;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.
|
||||
*
|
||||
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
||||
*
|
||||
*
|
||||
* @param {CreditCard} code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.
|
||||
* @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getCreditCard(code: CreditCard, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.
|
||||
*
|
||||
* This endpoint does not follow HTTP redirects.
|
||||
*
|
||||
* @param {string} params.url - Website URL which you want to fetch the favicon from.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getFavicon(params: {
|
||||
url: string;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.
|
||||
*
|
||||
* This endpoint does not follow HTTP redirects.
|
||||
*
|
||||
* @param {string} url - Website URL which you want to fetch the favicon from.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getFavicon(url: string): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
|
||||
*
|
||||
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
||||
*
|
||||
*
|
||||
* @param {Flag} params.code - Country Code. ISO Alpha-2 country code format.
|
||||
* @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getFlag(params: {
|
||||
code: Flag;
|
||||
width?: number;
|
||||
height?: number;
|
||||
quality?: number;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
|
||||
*
|
||||
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
||||
*
|
||||
*
|
||||
* @param {Flag} code - Country Code. ISO Alpha-2 country code format.
|
||||
* @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getFlag(code: Flag, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.
|
||||
*
|
||||
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.
|
||||
*
|
||||
* This endpoint does not follow HTTP redirects.
|
||||
*
|
||||
* @param {string} params.url - Image URL which you want to crop.
|
||||
* @param {number} params.width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.
|
||||
* @param {number} params.height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getImage(params: {
|
||||
url: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.
|
||||
*
|
||||
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.
|
||||
*
|
||||
* This endpoint does not follow HTTP redirects.
|
||||
*
|
||||
* @param {string} url - Image URL which you want to crop.
|
||||
* @param {number} width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.
|
||||
* @param {number} height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getImage(url: string, width?: number, height?: number): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.
|
||||
*
|
||||
* You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.
|
||||
*
|
||||
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
||||
*
|
||||
*
|
||||
* @param {string} params.name - Full Name. When empty, current user name or email will be used. Max length: 128 chars.
|
||||
* @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {string} params.background - Changes background color. By default a random color will be picked and stay will persistent to the given name.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getInitials(params?: {
|
||||
name?: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
background?: string;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.
|
||||
*
|
||||
* You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.
|
||||
*
|
||||
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
||||
*
|
||||
*
|
||||
* @param {string} name - Full Name. When empty, current user name or email will be used. Max length: 128 chars.
|
||||
* @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
||||
* @param {string} background - Changes background color. By default a random color will be picked and stay will persistent to the given name.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getInitials(name?: string, width?: number, height?: number, background?: string): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.
|
||||
*
|
||||
*
|
||||
* @param {string} params.text - Plain text to be converted to QR code image.
|
||||
* @param {number} params.size - QR code size. Pass an integer between 1 to 1000. Defaults to 400.
|
||||
* @param {number} params.margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1.
|
||||
* @param {boolean} params.download - Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getQR(params: {
|
||||
text: string;
|
||||
size?: number;
|
||||
margin?: number;
|
||||
download?: boolean;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.
|
||||
*
|
||||
*
|
||||
* @param {string} text - Plain text to be converted to QR code image.
|
||||
* @param {number} size - QR code size. Pass an integer between 1 to 1000. Defaults to 400.
|
||||
* @param {number} margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1.
|
||||
* @param {boolean} download - Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQR(text: string, size?: number, margin?: number, download?: boolean): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Use this endpoint to capture a screenshot of any website URL. This endpoint uses a headless browser to render the webpage and capture it as an image.
|
||||
*
|
||||
* You can configure the browser viewport size, theme, user agent, geolocation, permissions, and more. Capture either just the viewport or the full page scroll.
|
||||
*
|
||||
* When width and height are specified, the image is resized accordingly. If both dimensions are 0, the API provides an image at original size. If dimensions are not specified, the default viewport size is 1280x720px.
|
||||
*
|
||||
* @param {string} params.url - Website URL which you want to capture.
|
||||
* @param {object} params.headers - HTTP headers to send with the browser request. Defaults to empty.
|
||||
* @param {number} params.viewportWidth - Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280.
|
||||
* @param {number} params.viewportHeight - Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720.
|
||||
* @param {number} params.scale - Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1.
|
||||
* @param {Theme} params.theme - Browser theme. Pass "light" or "dark". Defaults to "light".
|
||||
* @param {string} params.userAgent - Custom user agent string. Defaults to browser default.
|
||||
* @param {boolean} params.fullpage - Capture full page scroll. Pass 0 for viewport only, or 1 for full page. Defaults to 0.
|
||||
* @param {string} params.locale - Browser locale (e.g., "en-US", "fr-FR"). Defaults to browser default.
|
||||
* @param {Timezone} params.timezone - IANA timezone identifier (e.g., "America/New_York", "Europe/London"). Defaults to browser default.
|
||||
* @param {number} params.latitude - Geolocation latitude. Pass a number between -90 to 90. Defaults to 0.
|
||||
* @param {number} params.longitude - Geolocation longitude. Pass a number between -180 to 180. Defaults to 0.
|
||||
* @param {number} params.accuracy - Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0.
|
||||
* @param {boolean} params.touch - Enable touch support. Pass 0 for no touch, or 1 for touch enabled. Defaults to 0.
|
||||
* @param {string[]} params.permissions - Browser permissions to grant. Pass an array of permission names like ["geolocation", "camera", "microphone"]. Defaults to empty.
|
||||
* @param {number} params.sleep - Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0.
|
||||
* @param {number} params.width - Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width).
|
||||
* @param {number} params.height - Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height).
|
||||
* @param {number} params.quality - Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
||||
* @param {Output} params.output - Output format type (jpeg, jpg, png, gif and webp).
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getScreenshot(params: {
|
||||
url: string;
|
||||
headers?: object;
|
||||
viewportWidth?: number;
|
||||
viewportHeight?: number;
|
||||
scale?: number;
|
||||
theme?: Theme;
|
||||
userAgent?: string;
|
||||
fullpage?: boolean;
|
||||
locale?: string;
|
||||
timezone?: Timezone;
|
||||
latitude?: number;
|
||||
longitude?: number;
|
||||
accuracy?: number;
|
||||
touch?: boolean;
|
||||
permissions?: string[];
|
||||
sleep?: number;
|
||||
width?: number;
|
||||
height?: number;
|
||||
quality?: number;
|
||||
output?: Output;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Use this endpoint to capture a screenshot of any website URL. This endpoint uses a headless browser to render the webpage and capture it as an image.
|
||||
*
|
||||
* You can configure the browser viewport size, theme, user agent, geolocation, permissions, and more. Capture either just the viewport or the full page scroll.
|
||||
*
|
||||
* When width and height are specified, the image is resized accordingly. If both dimensions are 0, the API provides an image at original size. If dimensions are not specified, the default viewport size is 1280x720px.
|
||||
*
|
||||
* @param {string} url - Website URL which you want to capture.
|
||||
* @param {object} headers - HTTP headers to send with the browser request. Defaults to empty.
|
||||
* @param {number} viewportWidth - Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280.
|
||||
* @param {number} viewportHeight - Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720.
|
||||
* @param {number} scale - Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1.
|
||||
* @param {Theme} theme - Browser theme. Pass "light" or "dark". Defaults to "light".
|
||||
* @param {string} userAgent - Custom user agent string. Defaults to browser default.
|
||||
* @param {boolean} fullpage - Capture full page scroll. Pass 0 for viewport only, or 1 for full page. Defaults to 0.
|
||||
* @param {string} locale - Browser locale (e.g., "en-US", "fr-FR"). Defaults to browser default.
|
||||
* @param {Timezone} timezone - IANA timezone identifier (e.g., "America/New_York", "Europe/London"). Defaults to browser default.
|
||||
* @param {number} latitude - Geolocation latitude. Pass a number between -90 to 90. Defaults to 0.
|
||||
* @param {number} longitude - Geolocation longitude. Pass a number between -180 to 180. Defaults to 0.
|
||||
* @param {number} accuracy - Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0.
|
||||
* @param {boolean} touch - Enable touch support. Pass 0 for no touch, or 1 for touch enabled. Defaults to 0.
|
||||
* @param {string[]} permissions - Browser permissions to grant. Pass an array of permission names like ["geolocation", "camera", "microphone"]. Defaults to empty.
|
||||
* @param {number} sleep - Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0.
|
||||
* @param {number} width - Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width).
|
||||
* @param {number} height - Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height).
|
||||
* @param {number} quality - Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
||||
* @param {Output} output - Output format type (jpeg, jpg, png, gif and webp).
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getScreenshot(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: string[], sleep?: number, width?: number, height?: number, quality?: number, output?: Output): Promise<ArrayBuffer>;
|
||||
}
|
||||
|
||||
export { Avatars };
|
||||
405
server/node_modules/node-appwrite/dist/services/avatars.js
generated
vendored
Normal file
405
server/node_modules/node-appwrite/dist/services/avatars.js
generated
vendored
Normal file
@@ -0,0 +1,405 @@
|
||||
'use strict';
|
||||
|
||||
var client = require('../client');
|
||||
|
||||
class Avatars {
|
||||
constructor(client) {
|
||||
this.client = client;
|
||||
}
|
||||
getBrowser(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "code" in paramsOrFirst) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
code: paramsOrFirst,
|
||||
width: rest[0],
|
||||
height: rest[1],
|
||||
quality: rest[2]
|
||||
};
|
||||
}
|
||||
const code = params.code;
|
||||
const width = params.width;
|
||||
const height = params.height;
|
||||
const quality = params.quality;
|
||||
if (typeof code === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "code"');
|
||||
}
|
||||
const apiPath = "/avatars/browsers/{code}".replace("{code}", code);
|
||||
const payload = {};
|
||||
if (typeof width !== "undefined") {
|
||||
payload["width"] = width;
|
||||
}
|
||||
if (typeof height !== "undefined") {
|
||||
payload["height"] = height;
|
||||
}
|
||||
if (typeof quality !== "undefined") {
|
||||
payload["quality"] = quality;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
"arrayBuffer"
|
||||
);
|
||||
}
|
||||
getCreditCard(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "code" in paramsOrFirst) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
code: paramsOrFirst,
|
||||
width: rest[0],
|
||||
height: rest[1],
|
||||
quality: rest[2]
|
||||
};
|
||||
}
|
||||
const code = params.code;
|
||||
const width = params.width;
|
||||
const height = params.height;
|
||||
const quality = params.quality;
|
||||
if (typeof code === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "code"');
|
||||
}
|
||||
const apiPath = "/avatars/credit-cards/{code}".replace("{code}", code);
|
||||
const payload = {};
|
||||
if (typeof width !== "undefined") {
|
||||
payload["width"] = width;
|
||||
}
|
||||
if (typeof height !== "undefined") {
|
||||
payload["height"] = height;
|
||||
}
|
||||
if (typeof quality !== "undefined") {
|
||||
payload["quality"] = quality;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
"arrayBuffer"
|
||||
);
|
||||
}
|
||||
getFavicon(paramsOrFirst) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
url: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const url = params.url;
|
||||
if (typeof url === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "url"');
|
||||
}
|
||||
const apiPath = "/avatars/favicon";
|
||||
const payload = {};
|
||||
if (typeof url !== "undefined") {
|
||||
payload["url"] = url;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
"arrayBuffer"
|
||||
);
|
||||
}
|
||||
getFlag(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "code" in paramsOrFirst) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
code: paramsOrFirst,
|
||||
width: rest[0],
|
||||
height: rest[1],
|
||||
quality: rest[2]
|
||||
};
|
||||
}
|
||||
const code = params.code;
|
||||
const width = params.width;
|
||||
const height = params.height;
|
||||
const quality = params.quality;
|
||||
if (typeof code === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "code"');
|
||||
}
|
||||
const apiPath = "/avatars/flags/{code}".replace("{code}", code);
|
||||
const payload = {};
|
||||
if (typeof width !== "undefined") {
|
||||
payload["width"] = width;
|
||||
}
|
||||
if (typeof height !== "undefined") {
|
||||
payload["height"] = height;
|
||||
}
|
||||
if (typeof quality !== "undefined") {
|
||||
payload["quality"] = quality;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
"arrayBuffer"
|
||||
);
|
||||
}
|
||||
getImage(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
url: paramsOrFirst,
|
||||
width: rest[0],
|
||||
height: rest[1]
|
||||
};
|
||||
}
|
||||
const url = params.url;
|
||||
const width = params.width;
|
||||
const height = params.height;
|
||||
if (typeof url === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "url"');
|
||||
}
|
||||
const apiPath = "/avatars/image";
|
||||
const payload = {};
|
||||
if (typeof url !== "undefined") {
|
||||
payload["url"] = url;
|
||||
}
|
||||
if (typeof width !== "undefined") {
|
||||
payload["width"] = width;
|
||||
}
|
||||
if (typeof height !== "undefined") {
|
||||
payload["height"] = height;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
"arrayBuffer"
|
||||
);
|
||||
}
|
||||
getInitials(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
name: paramsOrFirst,
|
||||
width: rest[0],
|
||||
height: rest[1],
|
||||
background: rest[2]
|
||||
};
|
||||
}
|
||||
const name = params.name;
|
||||
const width = params.width;
|
||||
const height = params.height;
|
||||
const background = params.background;
|
||||
const apiPath = "/avatars/initials";
|
||||
const payload = {};
|
||||
if (typeof name !== "undefined") {
|
||||
payload["name"] = name;
|
||||
}
|
||||
if (typeof width !== "undefined") {
|
||||
payload["width"] = width;
|
||||
}
|
||||
if (typeof height !== "undefined") {
|
||||
payload["height"] = height;
|
||||
}
|
||||
if (typeof background !== "undefined") {
|
||||
payload["background"] = background;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
"arrayBuffer"
|
||||
);
|
||||
}
|
||||
getQR(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
text: paramsOrFirst,
|
||||
size: rest[0],
|
||||
margin: rest[1],
|
||||
download: rest[2]
|
||||
};
|
||||
}
|
||||
const text = params.text;
|
||||
const size = params.size;
|
||||
const margin = params.margin;
|
||||
const download = params.download;
|
||||
if (typeof text === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "text"');
|
||||
}
|
||||
const apiPath = "/avatars/qr";
|
||||
const payload = {};
|
||||
if (typeof text !== "undefined") {
|
||||
payload["text"] = text;
|
||||
}
|
||||
if (typeof size !== "undefined") {
|
||||
payload["size"] = size;
|
||||
}
|
||||
if (typeof margin !== "undefined") {
|
||||
payload["margin"] = margin;
|
||||
}
|
||||
if (typeof download !== "undefined") {
|
||||
payload["download"] = download;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
"arrayBuffer"
|
||||
);
|
||||
}
|
||||
getScreenshot(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
url: paramsOrFirst,
|
||||
headers: rest[0],
|
||||
viewportWidth: rest[1],
|
||||
viewportHeight: rest[2],
|
||||
scale: rest[3],
|
||||
theme: rest[4],
|
||||
userAgent: rest[5],
|
||||
fullpage: rest[6],
|
||||
locale: rest[7],
|
||||
timezone: rest[8],
|
||||
latitude: rest[9],
|
||||
longitude: rest[10],
|
||||
accuracy: rest[11],
|
||||
touch: rest[12],
|
||||
permissions: rest[13],
|
||||
sleep: rest[14],
|
||||
width: rest[15],
|
||||
height: rest[16],
|
||||
quality: rest[17],
|
||||
output: rest[18]
|
||||
};
|
||||
}
|
||||
const url = params.url;
|
||||
const headers = params.headers;
|
||||
const viewportWidth = params.viewportWidth;
|
||||
const viewportHeight = params.viewportHeight;
|
||||
const scale = params.scale;
|
||||
const theme = params.theme;
|
||||
const userAgent = params.userAgent;
|
||||
const fullpage = params.fullpage;
|
||||
const locale = params.locale;
|
||||
const timezone = params.timezone;
|
||||
const latitude = params.latitude;
|
||||
const longitude = params.longitude;
|
||||
const accuracy = params.accuracy;
|
||||
const touch = params.touch;
|
||||
const permissions = params.permissions;
|
||||
const sleep = params.sleep;
|
||||
const width = params.width;
|
||||
const height = params.height;
|
||||
const quality = params.quality;
|
||||
const output = params.output;
|
||||
if (typeof url === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "url"');
|
||||
}
|
||||
const apiPath = "/avatars/screenshots";
|
||||
const payload = {};
|
||||
if (typeof url !== "undefined") {
|
||||
payload["url"] = url;
|
||||
}
|
||||
if (typeof headers !== "undefined") {
|
||||
payload["headers"] = headers;
|
||||
}
|
||||
if (typeof viewportWidth !== "undefined") {
|
||||
payload["viewportWidth"] = viewportWidth;
|
||||
}
|
||||
if (typeof viewportHeight !== "undefined") {
|
||||
payload["viewportHeight"] = viewportHeight;
|
||||
}
|
||||
if (typeof scale !== "undefined") {
|
||||
payload["scale"] = scale;
|
||||
}
|
||||
if (typeof theme !== "undefined") {
|
||||
payload["theme"] = theme;
|
||||
}
|
||||
if (typeof userAgent !== "undefined") {
|
||||
payload["userAgent"] = userAgent;
|
||||
}
|
||||
if (typeof fullpage !== "undefined") {
|
||||
payload["fullpage"] = fullpage;
|
||||
}
|
||||
if (typeof locale !== "undefined") {
|
||||
payload["locale"] = locale;
|
||||
}
|
||||
if (typeof timezone !== "undefined") {
|
||||
payload["timezone"] = timezone;
|
||||
}
|
||||
if (typeof latitude !== "undefined") {
|
||||
payload["latitude"] = latitude;
|
||||
}
|
||||
if (typeof longitude !== "undefined") {
|
||||
payload["longitude"] = longitude;
|
||||
}
|
||||
if (typeof accuracy !== "undefined") {
|
||||
payload["accuracy"] = accuracy;
|
||||
}
|
||||
if (typeof touch !== "undefined") {
|
||||
payload["touch"] = touch;
|
||||
}
|
||||
if (typeof permissions !== "undefined") {
|
||||
payload["permissions"] = permissions;
|
||||
}
|
||||
if (typeof sleep !== "undefined") {
|
||||
payload["sleep"] = sleep;
|
||||
}
|
||||
if (typeof width !== "undefined") {
|
||||
payload["width"] = width;
|
||||
}
|
||||
if (typeof height !== "undefined") {
|
||||
payload["height"] = height;
|
||||
}
|
||||
if (typeof quality !== "undefined") {
|
||||
payload["quality"] = quality;
|
||||
}
|
||||
if (typeof output !== "undefined") {
|
||||
payload["output"] = output;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
"arrayBuffer"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
exports.Avatars = Avatars;
|
||||
//# sourceMappingURL=out.js.map
|
||||
//# sourceMappingURL=avatars.js.map
|
||||
1
server/node_modules/node-appwrite/dist/services/avatars.js.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/avatars.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
404
server/node_modules/node-appwrite/dist/services/avatars.mjs
generated
vendored
Normal file
404
server/node_modules/node-appwrite/dist/services/avatars.mjs
generated
vendored
Normal file
@@ -0,0 +1,404 @@
|
||||
import { AppwriteException } from '../client.mjs';
|
||||
|
||||
// src/services/avatars.ts
|
||||
var Avatars = class {
|
||||
constructor(client) {
|
||||
this.client = client;
|
||||
}
|
||||
getBrowser(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "code" in paramsOrFirst) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
code: paramsOrFirst,
|
||||
width: rest[0],
|
||||
height: rest[1],
|
||||
quality: rest[2]
|
||||
};
|
||||
}
|
||||
const code = params.code;
|
||||
const width = params.width;
|
||||
const height = params.height;
|
||||
const quality = params.quality;
|
||||
if (typeof code === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "code"');
|
||||
}
|
||||
const apiPath = "/avatars/browsers/{code}".replace("{code}", code);
|
||||
const payload = {};
|
||||
if (typeof width !== "undefined") {
|
||||
payload["width"] = width;
|
||||
}
|
||||
if (typeof height !== "undefined") {
|
||||
payload["height"] = height;
|
||||
}
|
||||
if (typeof quality !== "undefined") {
|
||||
payload["quality"] = quality;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
"arrayBuffer"
|
||||
);
|
||||
}
|
||||
getCreditCard(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "code" in paramsOrFirst) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
code: paramsOrFirst,
|
||||
width: rest[0],
|
||||
height: rest[1],
|
||||
quality: rest[2]
|
||||
};
|
||||
}
|
||||
const code = params.code;
|
||||
const width = params.width;
|
||||
const height = params.height;
|
||||
const quality = params.quality;
|
||||
if (typeof code === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "code"');
|
||||
}
|
||||
const apiPath = "/avatars/credit-cards/{code}".replace("{code}", code);
|
||||
const payload = {};
|
||||
if (typeof width !== "undefined") {
|
||||
payload["width"] = width;
|
||||
}
|
||||
if (typeof height !== "undefined") {
|
||||
payload["height"] = height;
|
||||
}
|
||||
if (typeof quality !== "undefined") {
|
||||
payload["quality"] = quality;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
"arrayBuffer"
|
||||
);
|
||||
}
|
||||
getFavicon(paramsOrFirst) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
url: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const url = params.url;
|
||||
if (typeof url === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "url"');
|
||||
}
|
||||
const apiPath = "/avatars/favicon";
|
||||
const payload = {};
|
||||
if (typeof url !== "undefined") {
|
||||
payload["url"] = url;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
"arrayBuffer"
|
||||
);
|
||||
}
|
||||
getFlag(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "code" in paramsOrFirst) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
code: paramsOrFirst,
|
||||
width: rest[0],
|
||||
height: rest[1],
|
||||
quality: rest[2]
|
||||
};
|
||||
}
|
||||
const code = params.code;
|
||||
const width = params.width;
|
||||
const height = params.height;
|
||||
const quality = params.quality;
|
||||
if (typeof code === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "code"');
|
||||
}
|
||||
const apiPath = "/avatars/flags/{code}".replace("{code}", code);
|
||||
const payload = {};
|
||||
if (typeof width !== "undefined") {
|
||||
payload["width"] = width;
|
||||
}
|
||||
if (typeof height !== "undefined") {
|
||||
payload["height"] = height;
|
||||
}
|
||||
if (typeof quality !== "undefined") {
|
||||
payload["quality"] = quality;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
"arrayBuffer"
|
||||
);
|
||||
}
|
||||
getImage(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
url: paramsOrFirst,
|
||||
width: rest[0],
|
||||
height: rest[1]
|
||||
};
|
||||
}
|
||||
const url = params.url;
|
||||
const width = params.width;
|
||||
const height = params.height;
|
||||
if (typeof url === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "url"');
|
||||
}
|
||||
const apiPath = "/avatars/image";
|
||||
const payload = {};
|
||||
if (typeof url !== "undefined") {
|
||||
payload["url"] = url;
|
||||
}
|
||||
if (typeof width !== "undefined") {
|
||||
payload["width"] = width;
|
||||
}
|
||||
if (typeof height !== "undefined") {
|
||||
payload["height"] = height;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
"arrayBuffer"
|
||||
);
|
||||
}
|
||||
getInitials(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
name: paramsOrFirst,
|
||||
width: rest[0],
|
||||
height: rest[1],
|
||||
background: rest[2]
|
||||
};
|
||||
}
|
||||
const name = params.name;
|
||||
const width = params.width;
|
||||
const height = params.height;
|
||||
const background = params.background;
|
||||
const apiPath = "/avatars/initials";
|
||||
const payload = {};
|
||||
if (typeof name !== "undefined") {
|
||||
payload["name"] = name;
|
||||
}
|
||||
if (typeof width !== "undefined") {
|
||||
payload["width"] = width;
|
||||
}
|
||||
if (typeof height !== "undefined") {
|
||||
payload["height"] = height;
|
||||
}
|
||||
if (typeof background !== "undefined") {
|
||||
payload["background"] = background;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
"arrayBuffer"
|
||||
);
|
||||
}
|
||||
getQR(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
text: paramsOrFirst,
|
||||
size: rest[0],
|
||||
margin: rest[1],
|
||||
download: rest[2]
|
||||
};
|
||||
}
|
||||
const text = params.text;
|
||||
const size = params.size;
|
||||
const margin = params.margin;
|
||||
const download = params.download;
|
||||
if (typeof text === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "text"');
|
||||
}
|
||||
const apiPath = "/avatars/qr";
|
||||
const payload = {};
|
||||
if (typeof text !== "undefined") {
|
||||
payload["text"] = text;
|
||||
}
|
||||
if (typeof size !== "undefined") {
|
||||
payload["size"] = size;
|
||||
}
|
||||
if (typeof margin !== "undefined") {
|
||||
payload["margin"] = margin;
|
||||
}
|
||||
if (typeof download !== "undefined") {
|
||||
payload["download"] = download;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
"arrayBuffer"
|
||||
);
|
||||
}
|
||||
getScreenshot(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
url: paramsOrFirst,
|
||||
headers: rest[0],
|
||||
viewportWidth: rest[1],
|
||||
viewportHeight: rest[2],
|
||||
scale: rest[3],
|
||||
theme: rest[4],
|
||||
userAgent: rest[5],
|
||||
fullpage: rest[6],
|
||||
locale: rest[7],
|
||||
timezone: rest[8],
|
||||
latitude: rest[9],
|
||||
longitude: rest[10],
|
||||
accuracy: rest[11],
|
||||
touch: rest[12],
|
||||
permissions: rest[13],
|
||||
sleep: rest[14],
|
||||
width: rest[15],
|
||||
height: rest[16],
|
||||
quality: rest[17],
|
||||
output: rest[18]
|
||||
};
|
||||
}
|
||||
const url = params.url;
|
||||
const headers = params.headers;
|
||||
const viewportWidth = params.viewportWidth;
|
||||
const viewportHeight = params.viewportHeight;
|
||||
const scale = params.scale;
|
||||
const theme = params.theme;
|
||||
const userAgent = params.userAgent;
|
||||
const fullpage = params.fullpage;
|
||||
const locale = params.locale;
|
||||
const timezone = params.timezone;
|
||||
const latitude = params.latitude;
|
||||
const longitude = params.longitude;
|
||||
const accuracy = params.accuracy;
|
||||
const touch = params.touch;
|
||||
const permissions = params.permissions;
|
||||
const sleep = params.sleep;
|
||||
const width = params.width;
|
||||
const height = params.height;
|
||||
const quality = params.quality;
|
||||
const output = params.output;
|
||||
if (typeof url === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "url"');
|
||||
}
|
||||
const apiPath = "/avatars/screenshots";
|
||||
const payload = {};
|
||||
if (typeof url !== "undefined") {
|
||||
payload["url"] = url;
|
||||
}
|
||||
if (typeof headers !== "undefined") {
|
||||
payload["headers"] = headers;
|
||||
}
|
||||
if (typeof viewportWidth !== "undefined") {
|
||||
payload["viewportWidth"] = viewportWidth;
|
||||
}
|
||||
if (typeof viewportHeight !== "undefined") {
|
||||
payload["viewportHeight"] = viewportHeight;
|
||||
}
|
||||
if (typeof scale !== "undefined") {
|
||||
payload["scale"] = scale;
|
||||
}
|
||||
if (typeof theme !== "undefined") {
|
||||
payload["theme"] = theme;
|
||||
}
|
||||
if (typeof userAgent !== "undefined") {
|
||||
payload["userAgent"] = userAgent;
|
||||
}
|
||||
if (typeof fullpage !== "undefined") {
|
||||
payload["fullpage"] = fullpage;
|
||||
}
|
||||
if (typeof locale !== "undefined") {
|
||||
payload["locale"] = locale;
|
||||
}
|
||||
if (typeof timezone !== "undefined") {
|
||||
payload["timezone"] = timezone;
|
||||
}
|
||||
if (typeof latitude !== "undefined") {
|
||||
payload["latitude"] = latitude;
|
||||
}
|
||||
if (typeof longitude !== "undefined") {
|
||||
payload["longitude"] = longitude;
|
||||
}
|
||||
if (typeof accuracy !== "undefined") {
|
||||
payload["accuracy"] = accuracy;
|
||||
}
|
||||
if (typeof touch !== "undefined") {
|
||||
payload["touch"] = touch;
|
||||
}
|
||||
if (typeof permissions !== "undefined") {
|
||||
payload["permissions"] = permissions;
|
||||
}
|
||||
if (typeof sleep !== "undefined") {
|
||||
payload["sleep"] = sleep;
|
||||
}
|
||||
if (typeof width !== "undefined") {
|
||||
payload["width"] = width;
|
||||
}
|
||||
if (typeof height !== "undefined") {
|
||||
payload["height"] = height;
|
||||
}
|
||||
if (typeof quality !== "undefined") {
|
||||
payload["quality"] = quality;
|
||||
}
|
||||
if (typeof output !== "undefined") {
|
||||
payload["output"] = output;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
"arrayBuffer"
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export { Avatars };
|
||||
//# sourceMappingURL=out.js.map
|
||||
//# sourceMappingURL=avatars.mjs.map
|
||||
1
server/node_modules/node-appwrite/dist/services/avatars.mjs.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/avatars.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1991
server/node_modules/node-appwrite/dist/services/databases.d.mts
generated
vendored
Normal file
1991
server/node_modules/node-appwrite/dist/services/databases.d.mts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1991
server/node_modules/node-appwrite/dist/services/databases.d.ts
generated
vendored
Normal file
1991
server/node_modules/node-appwrite/dist/services/databases.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2957
server/node_modules/node-appwrite/dist/services/databases.js
generated
vendored
Normal file
2957
server/node_modules/node-appwrite/dist/services/databases.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
server/node_modules/node-appwrite/dist/services/databases.js.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/databases.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2956
server/node_modules/node-appwrite/dist/services/databases.mjs
generated
vendored
Normal file
2956
server/node_modules/node-appwrite/dist/services/databases.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
server/node_modules/node-appwrite/dist/services/databases.mjs.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/databases.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
749
server/node_modules/node-appwrite/dist/services/functions.d.mts
generated
vendored
Normal file
749
server/node_modules/node-appwrite/dist/services/functions.d.mts
generated
vendored
Normal file
@@ -0,0 +1,749 @@
|
||||
import { Client, UploadProgress } from '../client.mjs';
|
||||
import { Models } from '../models.mjs';
|
||||
import { Runtime } from '../enums/runtime.mjs';
|
||||
import { TemplateReferenceType } from '../enums/template-reference-type.mjs';
|
||||
import { VCSReferenceType } from '../enums/vcs-reference-type.mjs';
|
||||
import { DeploymentDownloadType } from '../enums/deployment-download-type.mjs';
|
||||
import { ExecutionMethod } from '../enums/execution-method.mjs';
|
||||
import '../query.mjs';
|
||||
import '../enums/database-type.mjs';
|
||||
import '../enums/attribute-status.mjs';
|
||||
import '../enums/column-status.mjs';
|
||||
import '../enums/index-status.mjs';
|
||||
import '../enums/deployment-status.mjs';
|
||||
import '../enums/execution-trigger.mjs';
|
||||
import '../enums/execution-status.mjs';
|
||||
import '../enums/health-antivirus-status.mjs';
|
||||
import '../enums/health-check-status.mjs';
|
||||
import '../enums/message-status.mjs';
|
||||
|
||||
declare class Functions {
|
||||
client: Client;
|
||||
constructor(client: Client);
|
||||
/**
|
||||
* Get a list of all the project's functions. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId
|
||||
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.FunctionList>}
|
||||
*/
|
||||
list(params?: {
|
||||
queries?: string[];
|
||||
search?: string;
|
||||
total?: boolean;
|
||||
}): Promise<Models.FunctionList>;
|
||||
/**
|
||||
* Get a list of all the project's functions. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId
|
||||
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.FunctionList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
list(queries?: string[], search?: string, total?: boolean): Promise<Models.FunctionList>;
|
||||
/**
|
||||
* Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
||||
* @param {string} params.name - Function name. Max length: 128 chars.
|
||||
* @param {Runtime} params.runtime - Execution runtime.
|
||||
* @param {string[]} params.execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
|
||||
* @param {string[]} params.events - Events list. Maximum of 100 events are allowed.
|
||||
* @param {string} params.schedule - Schedule CRON syntax.
|
||||
* @param {number} params.timeout - Function maximum execution time in seconds.
|
||||
* @param {boolean} params.enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
|
||||
* @param {boolean} params.logging - When disabled, executions will exclude logs and errors, and will be slightly faster.
|
||||
* @param {string} params.entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory".
|
||||
* @param {string} params.commands - Build Commands.
|
||||
* @param {string[]} params.scopes - List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.
|
||||
* @param {string} params.installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
|
||||
* @param {string} params.providerRepositoryId - Repository ID of the repo linked to the function.
|
||||
* @param {string} params.providerBranch - Production branch for the repo linked to the function.
|
||||
* @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
|
||||
* @param {string} params.providerRootDirectory - Path to function code in the linked repo.
|
||||
* @param {string} params.specification - Runtime specification for the function and builds.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Function>}
|
||||
*/
|
||||
create(params: {
|
||||
functionId: string;
|
||||
name: string;
|
||||
runtime: Runtime;
|
||||
execute?: string[];
|
||||
events?: string[];
|
||||
schedule?: string;
|
||||
timeout?: number;
|
||||
enabled?: boolean;
|
||||
logging?: boolean;
|
||||
entrypoint?: string;
|
||||
commands?: string;
|
||||
scopes?: string[];
|
||||
installationId?: string;
|
||||
providerRepositoryId?: string;
|
||||
providerBranch?: string;
|
||||
providerSilentMode?: boolean;
|
||||
providerRootDirectory?: string;
|
||||
specification?: string;
|
||||
}): Promise<Models.Function>;
|
||||
/**
|
||||
* Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API.
|
||||
*
|
||||
* @param {string} functionId - Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
||||
* @param {string} name - Function name. Max length: 128 chars.
|
||||
* @param {Runtime} runtime - Execution runtime.
|
||||
* @param {string[]} execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
|
||||
* @param {string[]} events - Events list. Maximum of 100 events are allowed.
|
||||
* @param {string} schedule - Schedule CRON syntax.
|
||||
* @param {number} timeout - Function maximum execution time in seconds.
|
||||
* @param {boolean} enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
|
||||
* @param {boolean} logging - When disabled, executions will exclude logs and errors, and will be slightly faster.
|
||||
* @param {string} entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory".
|
||||
* @param {string} commands - Build Commands.
|
||||
* @param {string[]} scopes - List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.
|
||||
* @param {string} installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
|
||||
* @param {string} providerRepositoryId - Repository ID of the repo linked to the function.
|
||||
* @param {string} providerBranch - Production branch for the repo linked to the function.
|
||||
* @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
|
||||
* @param {string} providerRootDirectory - Path to function code in the linked repo.
|
||||
* @param {string} specification - Runtime specification for the function and builds.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Function>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Function>;
|
||||
/**
|
||||
* Get a list of all runtimes that are currently active on your instance.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.RuntimeList>}
|
||||
*/
|
||||
listRuntimes(): Promise<Models.RuntimeList>;
|
||||
/**
|
||||
* List allowed function specifications for this instance.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.SpecificationList>}
|
||||
*/
|
||||
listSpecifications(): Promise<Models.SpecificationList>;
|
||||
/**
|
||||
* Get a function by its unique ID.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Function>}
|
||||
*/
|
||||
get(params: {
|
||||
functionId: string;
|
||||
}): Promise<Models.Function>;
|
||||
/**
|
||||
* Get a function by its unique ID.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Function>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
get(functionId: string): Promise<Models.Function>;
|
||||
/**
|
||||
* Update function by its unique ID.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string} params.name - Function name. Max length: 128 chars.
|
||||
* @param {Runtime} params.runtime - Execution runtime.
|
||||
* @param {string[]} params.execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
|
||||
* @param {string[]} params.events - Events list. Maximum of 100 events are allowed.
|
||||
* @param {string} params.schedule - Schedule CRON syntax.
|
||||
* @param {number} params.timeout - Maximum execution time in seconds.
|
||||
* @param {boolean} params.enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
|
||||
* @param {boolean} params.logging - When disabled, executions will exclude logs and errors, and will be slightly faster.
|
||||
* @param {string} params.entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory".
|
||||
* @param {string} params.commands - Build Commands.
|
||||
* @param {string[]} params.scopes - List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.
|
||||
* @param {string} params.installationId - Appwrite Installation ID for VCS (Version Controle System) deployment.
|
||||
* @param {string} params.providerRepositoryId - Repository ID of the repo linked to the function
|
||||
* @param {string} params.providerBranch - Production branch for the repo linked to the function
|
||||
* @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
|
||||
* @param {string} params.providerRootDirectory - Path to function code in the linked repo.
|
||||
* @param {string} params.specification - Runtime specification for the function and builds.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Function>}
|
||||
*/
|
||||
update(params: {
|
||||
functionId: string;
|
||||
name: string;
|
||||
runtime?: Runtime;
|
||||
execute?: string[];
|
||||
events?: string[];
|
||||
schedule?: string;
|
||||
timeout?: number;
|
||||
enabled?: boolean;
|
||||
logging?: boolean;
|
||||
entrypoint?: string;
|
||||
commands?: string;
|
||||
scopes?: string[];
|
||||
installationId?: string;
|
||||
providerRepositoryId?: string;
|
||||
providerBranch?: string;
|
||||
providerSilentMode?: boolean;
|
||||
providerRootDirectory?: string;
|
||||
specification?: string;
|
||||
}): Promise<Models.Function>;
|
||||
/**
|
||||
* Update function by its unique ID.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string} name - Function name. Max length: 128 chars.
|
||||
* @param {Runtime} runtime - Execution runtime.
|
||||
* @param {string[]} execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
|
||||
* @param {string[]} events - Events list. Maximum of 100 events are allowed.
|
||||
* @param {string} schedule - Schedule CRON syntax.
|
||||
* @param {number} timeout - Maximum execution time in seconds.
|
||||
* @param {boolean} enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
|
||||
* @param {boolean} logging - When disabled, executions will exclude logs and errors, and will be slightly faster.
|
||||
* @param {string} entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory".
|
||||
* @param {string} commands - Build Commands.
|
||||
* @param {string[]} scopes - List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.
|
||||
* @param {string} installationId - Appwrite Installation ID for VCS (Version Controle System) deployment.
|
||||
* @param {string} providerRepositoryId - Repository ID of the repo linked to the function
|
||||
* @param {string} providerBranch - Production branch for the repo linked to the function
|
||||
* @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
|
||||
* @param {string} providerRootDirectory - Path to function code in the linked repo.
|
||||
* @param {string} specification - Runtime specification for the function and builds.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Function>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Function>;
|
||||
/**
|
||||
* Delete a function by its unique ID.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
delete(params: {
|
||||
functionId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a function by its unique ID.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
delete(functionId: string): Promise<{}>;
|
||||
/**
|
||||
* Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Function>}
|
||||
*/
|
||||
updateFunctionDeployment(params: {
|
||||
functionId: string;
|
||||
deploymentId: string;
|
||||
}): Promise<Models.Function>;
|
||||
/**
|
||||
* Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Function>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updateFunctionDeployment(functionId: string, deploymentId: string): Promise<Models.Function>;
|
||||
/**
|
||||
* Get a list of all the function's code deployments. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
|
||||
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.DeploymentList>}
|
||||
*/
|
||||
listDeployments(params: {
|
||||
functionId: string;
|
||||
queries?: string[];
|
||||
search?: string;
|
||||
total?: boolean;
|
||||
}): Promise<Models.DeploymentList>;
|
||||
/**
|
||||
* Get a list of all the function's code deployments. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
|
||||
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.DeploymentList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
listDeployments(functionId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.DeploymentList>;
|
||||
/**
|
||||
* Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.
|
||||
*
|
||||
* This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https://appwrite.io/docs/functions).
|
||||
*
|
||||
* Use the "command" param to set the entrypoint used to execute your code.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {File} params.code - Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.
|
||||
* @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
|
||||
* @param {string} params.entrypoint - Entrypoint File.
|
||||
* @param {string} params.commands - Build Commands.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
createDeployment(params: {
|
||||
functionId: string;
|
||||
code: File;
|
||||
activate: boolean;
|
||||
entrypoint?: string;
|
||||
commands?: string;
|
||||
onProgress?: (progress: UploadProgress) => void;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.
|
||||
*
|
||||
* This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https://appwrite.io/docs/functions).
|
||||
*
|
||||
* Use the "command" param to set the entrypoint used to execute your code.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {File} code - Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.
|
||||
* @param {boolean} activate - Automatically activate the deployment when it is finished building.
|
||||
* @param {string} entrypoint - Entrypoint File.
|
||||
* @param {string} commands - Build Commands.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createDeployment(functionId: string, code: File, activate: boolean, entrypoint?: string, commands?: string, onProgress?: (progress: UploadProgress) => void): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @param {string} params.buildId - Build unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
createDuplicateDeployment(params: {
|
||||
functionId: string;
|
||||
deploymentId: string;
|
||||
buildId?: string;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @param {string} buildId - Build unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createDuplicateDeployment(functionId: string, deploymentId: string, buildId?: string): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a deployment based on a template.
|
||||
*
|
||||
* Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/products/functions/templates) to find the template details.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string} params.repository - Repository name of the template.
|
||||
* @param {string} params.owner - The name of the owner of the template.
|
||||
* @param {string} params.rootDirectory - Path to function code in the template repo.
|
||||
* @param {TemplateReferenceType} params.type - Type for the reference provided. Can be commit, branch, or tag
|
||||
* @param {string} params.reference - Reference value, can be a commit hash, branch name, or release tag
|
||||
* @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
createTemplateDeployment(params: {
|
||||
functionId: string;
|
||||
repository: string;
|
||||
owner: string;
|
||||
rootDirectory: string;
|
||||
type: TemplateReferenceType;
|
||||
reference: string;
|
||||
activate?: boolean;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a deployment based on a template.
|
||||
*
|
||||
* Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/products/functions/templates) to find the template details.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string} repository - Repository name of the template.
|
||||
* @param {string} owner - The name of the owner of the template.
|
||||
* @param {string} rootDirectory - Path to function code in the template repo.
|
||||
* @param {TemplateReferenceType} type - Type for the reference provided. Can be commit, branch, or tag
|
||||
* @param {string} reference - Reference value, can be a commit hash, branch name, or release tag
|
||||
* @param {boolean} activate - Automatically activate the deployment when it is finished building.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createTemplateDeployment(functionId: string, repository: string, owner: string, rootDirectory: string, type: TemplateReferenceType, reference: string, activate?: boolean): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a deployment when a function is connected to VCS.
|
||||
*
|
||||
* This endpoint lets you create deployment from a branch, commit, or a tag.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {VCSReferenceType} params.type - Type of reference passed. Allowed values are: branch, commit
|
||||
* @param {string} params.reference - VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
|
||||
* @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
createVcsDeployment(params: {
|
||||
functionId: string;
|
||||
type: VCSReferenceType;
|
||||
reference: string;
|
||||
activate?: boolean;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a deployment when a function is connected to VCS.
|
||||
*
|
||||
* This endpoint lets you create deployment from a branch, commit, or a tag.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {VCSReferenceType} type - Type of reference passed. Allowed values are: branch, commit
|
||||
* @param {string} reference - VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
|
||||
* @param {boolean} activate - Automatically activate the deployment when it is finished building.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createVcsDeployment(functionId: string, type: VCSReferenceType, reference: string, activate?: boolean): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Get a function deployment by its unique ID.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
getDeployment(params: {
|
||||
functionId: string;
|
||||
deploymentId: string;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Get a function deployment by its unique ID.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getDeployment(functionId: string, deploymentId: string): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Delete a code deployment by its unique ID.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
deleteDeployment(params: {
|
||||
functionId: string;
|
||||
deploymentId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a code deployment by its unique ID.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
deleteDeployment(functionId: string, deploymentId: string): Promise<{}>;
|
||||
/**
|
||||
* Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @param {DeploymentDownloadType} params.type - Deployment file to download. Can be: "source", "output".
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getDeploymentDownload(params: {
|
||||
functionId: string;
|
||||
deploymentId: string;
|
||||
type?: DeploymentDownloadType;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @param {DeploymentDownloadType} type - Deployment file to download. Can be: "source", "output".
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getDeploymentDownload(functionId: string, deploymentId: string, type?: DeploymentDownloadType): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
updateDeploymentStatus(params: {
|
||||
functionId: string;
|
||||
deploymentId: string;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updateDeploymentStatus(functionId: string, deploymentId: string): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Get a list of all the current user function execution logs. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
|
||||
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ExecutionList>}
|
||||
*/
|
||||
listExecutions(params: {
|
||||
functionId: string;
|
||||
queries?: string[];
|
||||
total?: boolean;
|
||||
}): Promise<Models.ExecutionList>;
|
||||
/**
|
||||
* Get a list of all the current user function execution logs. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
|
||||
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ExecutionList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
listExecutions(functionId: string, queries?: string[], total?: boolean): Promise<Models.ExecutionList>;
|
||||
/**
|
||||
* Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string} params.body - HTTP body of execution. Default value is empty string.
|
||||
* @param {boolean} params.async - Execute code in the background. Default value is false.
|
||||
* @param {string} params.xpath - HTTP path of execution. Path can include query params. Default value is /
|
||||
* @param {ExecutionMethod} params.method - HTTP method of execution. Default value is POST.
|
||||
* @param {object} params.headers - HTTP headers of execution. Defaults to empty.
|
||||
* @param {string} params.scheduledAt - Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Execution>}
|
||||
*/
|
||||
createExecution(params: {
|
||||
functionId: string;
|
||||
body?: string;
|
||||
async?: boolean;
|
||||
xpath?: string;
|
||||
method?: ExecutionMethod;
|
||||
headers?: object;
|
||||
scheduledAt?: string;
|
||||
}): Promise<Models.Execution>;
|
||||
/**
|
||||
* Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string} body - HTTP body of execution. Default value is empty string.
|
||||
* @param {boolean} async - Execute code in the background. Default value is false.
|
||||
* @param {string} xpath - HTTP path of execution. Path can include query params. Default value is /
|
||||
* @param {ExecutionMethod} method - HTTP method of execution. Default value is POST.
|
||||
* @param {object} headers - HTTP headers of execution. Defaults to empty.
|
||||
* @param {string} scheduledAt - Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Execution>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string): Promise<Models.Execution>;
|
||||
/**
|
||||
* Get a function execution log by its unique ID.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string} params.executionId - Execution ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Execution>}
|
||||
*/
|
||||
getExecution(params: {
|
||||
functionId: string;
|
||||
executionId: string;
|
||||
}): Promise<Models.Execution>;
|
||||
/**
|
||||
* Get a function execution log by its unique ID.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string} executionId - Execution ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Execution>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getExecution(functionId: string, executionId: string): Promise<Models.Execution>;
|
||||
/**
|
||||
* Delete a function execution by its unique ID.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string} params.executionId - Execution ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
deleteExecution(params: {
|
||||
functionId: string;
|
||||
executionId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a function execution by its unique ID.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string} executionId - Execution ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
deleteExecution(functionId: string, executionId: string): Promise<{}>;
|
||||
/**
|
||||
* Get a list of all variables of a specific function.
|
||||
*
|
||||
* @param {string} params.functionId - Function unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.VariableList>}
|
||||
*/
|
||||
listVariables(params: {
|
||||
functionId: string;
|
||||
}): Promise<Models.VariableList>;
|
||||
/**
|
||||
* Get a list of all variables of a specific function.
|
||||
*
|
||||
* @param {string} functionId - Function unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.VariableList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
listVariables(functionId: string): Promise<Models.VariableList>;
|
||||
/**
|
||||
* Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.
|
||||
*
|
||||
* @param {string} params.functionId - Function unique ID.
|
||||
* @param {string} params.key - Variable key. Max length: 255 chars.
|
||||
* @param {string} params.value - Variable value. Max length: 8192 chars.
|
||||
* @param {boolean} params.secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
*/
|
||||
createVariable(params: {
|
||||
functionId: string;
|
||||
key: string;
|
||||
value: string;
|
||||
secret?: boolean;
|
||||
}): Promise<Models.Variable>;
|
||||
/**
|
||||
* Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.
|
||||
*
|
||||
* @param {string} functionId - Function unique ID.
|
||||
* @param {string} key - Variable key. Max length: 255 chars.
|
||||
* @param {string} value - Variable value. Max length: 8192 chars.
|
||||
* @param {boolean} secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createVariable(functionId: string, key: string, value: string, secret?: boolean): Promise<Models.Variable>;
|
||||
/**
|
||||
* Get a variable by its unique ID.
|
||||
*
|
||||
* @param {string} params.functionId - Function unique ID.
|
||||
* @param {string} params.variableId - Variable unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
*/
|
||||
getVariable(params: {
|
||||
functionId: string;
|
||||
variableId: string;
|
||||
}): Promise<Models.Variable>;
|
||||
/**
|
||||
* Get a variable by its unique ID.
|
||||
*
|
||||
* @param {string} functionId - Function unique ID.
|
||||
* @param {string} variableId - Variable unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getVariable(functionId: string, variableId: string): Promise<Models.Variable>;
|
||||
/**
|
||||
* Update variable by its unique ID.
|
||||
*
|
||||
* @param {string} params.functionId - Function unique ID.
|
||||
* @param {string} params.variableId - Variable unique ID.
|
||||
* @param {string} params.key - Variable key. Max length: 255 chars.
|
||||
* @param {string} params.value - Variable value. Max length: 8192 chars.
|
||||
* @param {boolean} params.secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
*/
|
||||
updateVariable(params: {
|
||||
functionId: string;
|
||||
variableId: string;
|
||||
key: string;
|
||||
value?: string;
|
||||
secret?: boolean;
|
||||
}): Promise<Models.Variable>;
|
||||
/**
|
||||
* Update variable by its unique ID.
|
||||
*
|
||||
* @param {string} functionId - Function unique ID.
|
||||
* @param {string} variableId - Variable unique ID.
|
||||
* @param {string} key - Variable key. Max length: 255 chars.
|
||||
* @param {string} value - Variable value. Max length: 8192 chars.
|
||||
* @param {boolean} secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updateVariable(functionId: string, variableId: string, key: string, value?: string, secret?: boolean): Promise<Models.Variable>;
|
||||
/**
|
||||
* Delete a variable by its unique ID.
|
||||
*
|
||||
* @param {string} params.functionId - Function unique ID.
|
||||
* @param {string} params.variableId - Variable unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
deleteVariable(params: {
|
||||
functionId: string;
|
||||
variableId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a variable by its unique ID.
|
||||
*
|
||||
* @param {string} functionId - Function unique ID.
|
||||
* @param {string} variableId - Variable unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
deleteVariable(functionId: string, variableId: string): Promise<{}>;
|
||||
}
|
||||
|
||||
export { Functions };
|
||||
749
server/node_modules/node-appwrite/dist/services/functions.d.ts
generated
vendored
Normal file
749
server/node_modules/node-appwrite/dist/services/functions.d.ts
generated
vendored
Normal file
@@ -0,0 +1,749 @@
|
||||
import { Client, UploadProgress } from '../client.js';
|
||||
import { Models } from '../models.js';
|
||||
import { Runtime } from '../enums/runtime.js';
|
||||
import { TemplateReferenceType } from '../enums/template-reference-type.js';
|
||||
import { VCSReferenceType } from '../enums/vcs-reference-type.js';
|
||||
import { DeploymentDownloadType } from '../enums/deployment-download-type.js';
|
||||
import { ExecutionMethod } from '../enums/execution-method.js';
|
||||
import '../query.js';
|
||||
import '../enums/database-type.js';
|
||||
import '../enums/attribute-status.js';
|
||||
import '../enums/column-status.js';
|
||||
import '../enums/index-status.js';
|
||||
import '../enums/deployment-status.js';
|
||||
import '../enums/execution-trigger.js';
|
||||
import '../enums/execution-status.js';
|
||||
import '../enums/health-antivirus-status.js';
|
||||
import '../enums/health-check-status.js';
|
||||
import '../enums/message-status.js';
|
||||
|
||||
declare class Functions {
|
||||
client: Client;
|
||||
constructor(client: Client);
|
||||
/**
|
||||
* Get a list of all the project's functions. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId
|
||||
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.FunctionList>}
|
||||
*/
|
||||
list(params?: {
|
||||
queries?: string[];
|
||||
search?: string;
|
||||
total?: boolean;
|
||||
}): Promise<Models.FunctionList>;
|
||||
/**
|
||||
* Get a list of all the project's functions. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId
|
||||
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.FunctionList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
list(queries?: string[], search?: string, total?: boolean): Promise<Models.FunctionList>;
|
||||
/**
|
||||
* Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
||||
* @param {string} params.name - Function name. Max length: 128 chars.
|
||||
* @param {Runtime} params.runtime - Execution runtime.
|
||||
* @param {string[]} params.execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
|
||||
* @param {string[]} params.events - Events list. Maximum of 100 events are allowed.
|
||||
* @param {string} params.schedule - Schedule CRON syntax.
|
||||
* @param {number} params.timeout - Function maximum execution time in seconds.
|
||||
* @param {boolean} params.enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
|
||||
* @param {boolean} params.logging - When disabled, executions will exclude logs and errors, and will be slightly faster.
|
||||
* @param {string} params.entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory".
|
||||
* @param {string} params.commands - Build Commands.
|
||||
* @param {string[]} params.scopes - List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.
|
||||
* @param {string} params.installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
|
||||
* @param {string} params.providerRepositoryId - Repository ID of the repo linked to the function.
|
||||
* @param {string} params.providerBranch - Production branch for the repo linked to the function.
|
||||
* @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
|
||||
* @param {string} params.providerRootDirectory - Path to function code in the linked repo.
|
||||
* @param {string} params.specification - Runtime specification for the function and builds.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Function>}
|
||||
*/
|
||||
create(params: {
|
||||
functionId: string;
|
||||
name: string;
|
||||
runtime: Runtime;
|
||||
execute?: string[];
|
||||
events?: string[];
|
||||
schedule?: string;
|
||||
timeout?: number;
|
||||
enabled?: boolean;
|
||||
logging?: boolean;
|
||||
entrypoint?: string;
|
||||
commands?: string;
|
||||
scopes?: string[];
|
||||
installationId?: string;
|
||||
providerRepositoryId?: string;
|
||||
providerBranch?: string;
|
||||
providerSilentMode?: boolean;
|
||||
providerRootDirectory?: string;
|
||||
specification?: string;
|
||||
}): Promise<Models.Function>;
|
||||
/**
|
||||
* Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API.
|
||||
*
|
||||
* @param {string} functionId - Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
||||
* @param {string} name - Function name. Max length: 128 chars.
|
||||
* @param {Runtime} runtime - Execution runtime.
|
||||
* @param {string[]} execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
|
||||
* @param {string[]} events - Events list. Maximum of 100 events are allowed.
|
||||
* @param {string} schedule - Schedule CRON syntax.
|
||||
* @param {number} timeout - Function maximum execution time in seconds.
|
||||
* @param {boolean} enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
|
||||
* @param {boolean} logging - When disabled, executions will exclude logs and errors, and will be slightly faster.
|
||||
* @param {string} entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory".
|
||||
* @param {string} commands - Build Commands.
|
||||
* @param {string[]} scopes - List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.
|
||||
* @param {string} installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
|
||||
* @param {string} providerRepositoryId - Repository ID of the repo linked to the function.
|
||||
* @param {string} providerBranch - Production branch for the repo linked to the function.
|
||||
* @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
|
||||
* @param {string} providerRootDirectory - Path to function code in the linked repo.
|
||||
* @param {string} specification - Runtime specification for the function and builds.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Function>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Function>;
|
||||
/**
|
||||
* Get a list of all runtimes that are currently active on your instance.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.RuntimeList>}
|
||||
*/
|
||||
listRuntimes(): Promise<Models.RuntimeList>;
|
||||
/**
|
||||
* List allowed function specifications for this instance.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.SpecificationList>}
|
||||
*/
|
||||
listSpecifications(): Promise<Models.SpecificationList>;
|
||||
/**
|
||||
* Get a function by its unique ID.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Function>}
|
||||
*/
|
||||
get(params: {
|
||||
functionId: string;
|
||||
}): Promise<Models.Function>;
|
||||
/**
|
||||
* Get a function by its unique ID.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Function>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
get(functionId: string): Promise<Models.Function>;
|
||||
/**
|
||||
* Update function by its unique ID.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string} params.name - Function name. Max length: 128 chars.
|
||||
* @param {Runtime} params.runtime - Execution runtime.
|
||||
* @param {string[]} params.execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
|
||||
* @param {string[]} params.events - Events list. Maximum of 100 events are allowed.
|
||||
* @param {string} params.schedule - Schedule CRON syntax.
|
||||
* @param {number} params.timeout - Maximum execution time in seconds.
|
||||
* @param {boolean} params.enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
|
||||
* @param {boolean} params.logging - When disabled, executions will exclude logs and errors, and will be slightly faster.
|
||||
* @param {string} params.entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory".
|
||||
* @param {string} params.commands - Build Commands.
|
||||
* @param {string[]} params.scopes - List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.
|
||||
* @param {string} params.installationId - Appwrite Installation ID for VCS (Version Controle System) deployment.
|
||||
* @param {string} params.providerRepositoryId - Repository ID of the repo linked to the function
|
||||
* @param {string} params.providerBranch - Production branch for the repo linked to the function
|
||||
* @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
|
||||
* @param {string} params.providerRootDirectory - Path to function code in the linked repo.
|
||||
* @param {string} params.specification - Runtime specification for the function and builds.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Function>}
|
||||
*/
|
||||
update(params: {
|
||||
functionId: string;
|
||||
name: string;
|
||||
runtime?: Runtime;
|
||||
execute?: string[];
|
||||
events?: string[];
|
||||
schedule?: string;
|
||||
timeout?: number;
|
||||
enabled?: boolean;
|
||||
logging?: boolean;
|
||||
entrypoint?: string;
|
||||
commands?: string;
|
||||
scopes?: string[];
|
||||
installationId?: string;
|
||||
providerRepositoryId?: string;
|
||||
providerBranch?: string;
|
||||
providerSilentMode?: boolean;
|
||||
providerRootDirectory?: string;
|
||||
specification?: string;
|
||||
}): Promise<Models.Function>;
|
||||
/**
|
||||
* Update function by its unique ID.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string} name - Function name. Max length: 128 chars.
|
||||
* @param {Runtime} runtime - Execution runtime.
|
||||
* @param {string[]} execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
|
||||
* @param {string[]} events - Events list. Maximum of 100 events are allowed.
|
||||
* @param {string} schedule - Schedule CRON syntax.
|
||||
* @param {number} timeout - Maximum execution time in seconds.
|
||||
* @param {boolean} enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
|
||||
* @param {boolean} logging - When disabled, executions will exclude logs and errors, and will be slightly faster.
|
||||
* @param {string} entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory".
|
||||
* @param {string} commands - Build Commands.
|
||||
* @param {string[]} scopes - List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.
|
||||
* @param {string} installationId - Appwrite Installation ID for VCS (Version Controle System) deployment.
|
||||
* @param {string} providerRepositoryId - Repository ID of the repo linked to the function
|
||||
* @param {string} providerBranch - Production branch for the repo linked to the function
|
||||
* @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
|
||||
* @param {string} providerRootDirectory - Path to function code in the linked repo.
|
||||
* @param {string} specification - Runtime specification for the function and builds.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Function>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Function>;
|
||||
/**
|
||||
* Delete a function by its unique ID.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
delete(params: {
|
||||
functionId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a function by its unique ID.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
delete(functionId: string): Promise<{}>;
|
||||
/**
|
||||
* Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Function>}
|
||||
*/
|
||||
updateFunctionDeployment(params: {
|
||||
functionId: string;
|
||||
deploymentId: string;
|
||||
}): Promise<Models.Function>;
|
||||
/**
|
||||
* Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Function>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updateFunctionDeployment(functionId: string, deploymentId: string): Promise<Models.Function>;
|
||||
/**
|
||||
* Get a list of all the function's code deployments. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
|
||||
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.DeploymentList>}
|
||||
*/
|
||||
listDeployments(params: {
|
||||
functionId: string;
|
||||
queries?: string[];
|
||||
search?: string;
|
||||
total?: boolean;
|
||||
}): Promise<Models.DeploymentList>;
|
||||
/**
|
||||
* Get a list of all the function's code deployments. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
|
||||
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.DeploymentList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
listDeployments(functionId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.DeploymentList>;
|
||||
/**
|
||||
* Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.
|
||||
*
|
||||
* This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https://appwrite.io/docs/functions).
|
||||
*
|
||||
* Use the "command" param to set the entrypoint used to execute your code.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {File} params.code - Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.
|
||||
* @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
|
||||
* @param {string} params.entrypoint - Entrypoint File.
|
||||
* @param {string} params.commands - Build Commands.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
createDeployment(params: {
|
||||
functionId: string;
|
||||
code: File;
|
||||
activate: boolean;
|
||||
entrypoint?: string;
|
||||
commands?: string;
|
||||
onProgress?: (progress: UploadProgress) => void;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.
|
||||
*
|
||||
* This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https://appwrite.io/docs/functions).
|
||||
*
|
||||
* Use the "command" param to set the entrypoint used to execute your code.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {File} code - Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.
|
||||
* @param {boolean} activate - Automatically activate the deployment when it is finished building.
|
||||
* @param {string} entrypoint - Entrypoint File.
|
||||
* @param {string} commands - Build Commands.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createDeployment(functionId: string, code: File, activate: boolean, entrypoint?: string, commands?: string, onProgress?: (progress: UploadProgress) => void): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @param {string} params.buildId - Build unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
createDuplicateDeployment(params: {
|
||||
functionId: string;
|
||||
deploymentId: string;
|
||||
buildId?: string;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @param {string} buildId - Build unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createDuplicateDeployment(functionId: string, deploymentId: string, buildId?: string): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a deployment based on a template.
|
||||
*
|
||||
* Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/products/functions/templates) to find the template details.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string} params.repository - Repository name of the template.
|
||||
* @param {string} params.owner - The name of the owner of the template.
|
||||
* @param {string} params.rootDirectory - Path to function code in the template repo.
|
||||
* @param {TemplateReferenceType} params.type - Type for the reference provided. Can be commit, branch, or tag
|
||||
* @param {string} params.reference - Reference value, can be a commit hash, branch name, or release tag
|
||||
* @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
createTemplateDeployment(params: {
|
||||
functionId: string;
|
||||
repository: string;
|
||||
owner: string;
|
||||
rootDirectory: string;
|
||||
type: TemplateReferenceType;
|
||||
reference: string;
|
||||
activate?: boolean;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a deployment based on a template.
|
||||
*
|
||||
* Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/products/functions/templates) to find the template details.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string} repository - Repository name of the template.
|
||||
* @param {string} owner - The name of the owner of the template.
|
||||
* @param {string} rootDirectory - Path to function code in the template repo.
|
||||
* @param {TemplateReferenceType} type - Type for the reference provided. Can be commit, branch, or tag
|
||||
* @param {string} reference - Reference value, can be a commit hash, branch name, or release tag
|
||||
* @param {boolean} activate - Automatically activate the deployment when it is finished building.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createTemplateDeployment(functionId: string, repository: string, owner: string, rootDirectory: string, type: TemplateReferenceType, reference: string, activate?: boolean): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a deployment when a function is connected to VCS.
|
||||
*
|
||||
* This endpoint lets you create deployment from a branch, commit, or a tag.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {VCSReferenceType} params.type - Type of reference passed. Allowed values are: branch, commit
|
||||
* @param {string} params.reference - VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
|
||||
* @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
createVcsDeployment(params: {
|
||||
functionId: string;
|
||||
type: VCSReferenceType;
|
||||
reference: string;
|
||||
activate?: boolean;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a deployment when a function is connected to VCS.
|
||||
*
|
||||
* This endpoint lets you create deployment from a branch, commit, or a tag.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {VCSReferenceType} type - Type of reference passed. Allowed values are: branch, commit
|
||||
* @param {string} reference - VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
|
||||
* @param {boolean} activate - Automatically activate the deployment when it is finished building.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createVcsDeployment(functionId: string, type: VCSReferenceType, reference: string, activate?: boolean): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Get a function deployment by its unique ID.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
getDeployment(params: {
|
||||
functionId: string;
|
||||
deploymentId: string;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Get a function deployment by its unique ID.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getDeployment(functionId: string, deploymentId: string): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Delete a code deployment by its unique ID.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
deleteDeployment(params: {
|
||||
functionId: string;
|
||||
deploymentId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a code deployment by its unique ID.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
deleteDeployment(functionId: string, deploymentId: string): Promise<{}>;
|
||||
/**
|
||||
* Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @param {DeploymentDownloadType} params.type - Deployment file to download. Can be: "source", "output".
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getDeploymentDownload(params: {
|
||||
functionId: string;
|
||||
deploymentId: string;
|
||||
type?: DeploymentDownloadType;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @param {DeploymentDownloadType} type - Deployment file to download. Can be: "source", "output".
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getDeploymentDownload(functionId: string, deploymentId: string, type?: DeploymentDownloadType): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
updateDeploymentStatus(params: {
|
||||
functionId: string;
|
||||
deploymentId: string;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updateDeploymentStatus(functionId: string, deploymentId: string): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Get a list of all the current user function execution logs. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
|
||||
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ExecutionList>}
|
||||
*/
|
||||
listExecutions(params: {
|
||||
functionId: string;
|
||||
queries?: string[];
|
||||
total?: boolean;
|
||||
}): Promise<Models.ExecutionList>;
|
||||
/**
|
||||
* Get a list of all the current user function execution logs. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
|
||||
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ExecutionList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
listExecutions(functionId: string, queries?: string[], total?: boolean): Promise<Models.ExecutionList>;
|
||||
/**
|
||||
* Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string} params.body - HTTP body of execution. Default value is empty string.
|
||||
* @param {boolean} params.async - Execute code in the background. Default value is false.
|
||||
* @param {string} params.xpath - HTTP path of execution. Path can include query params. Default value is /
|
||||
* @param {ExecutionMethod} params.method - HTTP method of execution. Default value is POST.
|
||||
* @param {object} params.headers - HTTP headers of execution. Defaults to empty.
|
||||
* @param {string} params.scheduledAt - Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Execution>}
|
||||
*/
|
||||
createExecution(params: {
|
||||
functionId: string;
|
||||
body?: string;
|
||||
async?: boolean;
|
||||
xpath?: string;
|
||||
method?: ExecutionMethod;
|
||||
headers?: object;
|
||||
scheduledAt?: string;
|
||||
}): Promise<Models.Execution>;
|
||||
/**
|
||||
* Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string} body - HTTP body of execution. Default value is empty string.
|
||||
* @param {boolean} async - Execute code in the background. Default value is false.
|
||||
* @param {string} xpath - HTTP path of execution. Path can include query params. Default value is /
|
||||
* @param {ExecutionMethod} method - HTTP method of execution. Default value is POST.
|
||||
* @param {object} headers - HTTP headers of execution. Defaults to empty.
|
||||
* @param {string} scheduledAt - Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Execution>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string): Promise<Models.Execution>;
|
||||
/**
|
||||
* Get a function execution log by its unique ID.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string} params.executionId - Execution ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Execution>}
|
||||
*/
|
||||
getExecution(params: {
|
||||
functionId: string;
|
||||
executionId: string;
|
||||
}): Promise<Models.Execution>;
|
||||
/**
|
||||
* Get a function execution log by its unique ID.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string} executionId - Execution ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Execution>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getExecution(functionId: string, executionId: string): Promise<Models.Execution>;
|
||||
/**
|
||||
* Delete a function execution by its unique ID.
|
||||
*
|
||||
* @param {string} params.functionId - Function ID.
|
||||
* @param {string} params.executionId - Execution ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
deleteExecution(params: {
|
||||
functionId: string;
|
||||
executionId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a function execution by its unique ID.
|
||||
*
|
||||
* @param {string} functionId - Function ID.
|
||||
* @param {string} executionId - Execution ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
deleteExecution(functionId: string, executionId: string): Promise<{}>;
|
||||
/**
|
||||
* Get a list of all variables of a specific function.
|
||||
*
|
||||
* @param {string} params.functionId - Function unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.VariableList>}
|
||||
*/
|
||||
listVariables(params: {
|
||||
functionId: string;
|
||||
}): Promise<Models.VariableList>;
|
||||
/**
|
||||
* Get a list of all variables of a specific function.
|
||||
*
|
||||
* @param {string} functionId - Function unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.VariableList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
listVariables(functionId: string): Promise<Models.VariableList>;
|
||||
/**
|
||||
* Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.
|
||||
*
|
||||
* @param {string} params.functionId - Function unique ID.
|
||||
* @param {string} params.key - Variable key. Max length: 255 chars.
|
||||
* @param {string} params.value - Variable value. Max length: 8192 chars.
|
||||
* @param {boolean} params.secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
*/
|
||||
createVariable(params: {
|
||||
functionId: string;
|
||||
key: string;
|
||||
value: string;
|
||||
secret?: boolean;
|
||||
}): Promise<Models.Variable>;
|
||||
/**
|
||||
* Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.
|
||||
*
|
||||
* @param {string} functionId - Function unique ID.
|
||||
* @param {string} key - Variable key. Max length: 255 chars.
|
||||
* @param {string} value - Variable value. Max length: 8192 chars.
|
||||
* @param {boolean} secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createVariable(functionId: string, key: string, value: string, secret?: boolean): Promise<Models.Variable>;
|
||||
/**
|
||||
* Get a variable by its unique ID.
|
||||
*
|
||||
* @param {string} params.functionId - Function unique ID.
|
||||
* @param {string} params.variableId - Variable unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
*/
|
||||
getVariable(params: {
|
||||
functionId: string;
|
||||
variableId: string;
|
||||
}): Promise<Models.Variable>;
|
||||
/**
|
||||
* Get a variable by its unique ID.
|
||||
*
|
||||
* @param {string} functionId - Function unique ID.
|
||||
* @param {string} variableId - Variable unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getVariable(functionId: string, variableId: string): Promise<Models.Variable>;
|
||||
/**
|
||||
* Update variable by its unique ID.
|
||||
*
|
||||
* @param {string} params.functionId - Function unique ID.
|
||||
* @param {string} params.variableId - Variable unique ID.
|
||||
* @param {string} params.key - Variable key. Max length: 255 chars.
|
||||
* @param {string} params.value - Variable value. Max length: 8192 chars.
|
||||
* @param {boolean} params.secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
*/
|
||||
updateVariable(params: {
|
||||
functionId: string;
|
||||
variableId: string;
|
||||
key: string;
|
||||
value?: string;
|
||||
secret?: boolean;
|
||||
}): Promise<Models.Variable>;
|
||||
/**
|
||||
* Update variable by its unique ID.
|
||||
*
|
||||
* @param {string} functionId - Function unique ID.
|
||||
* @param {string} variableId - Variable unique ID.
|
||||
* @param {string} key - Variable key. Max length: 255 chars.
|
||||
* @param {string} value - Variable value. Max length: 8192 chars.
|
||||
* @param {boolean} secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updateVariable(functionId: string, variableId: string, key: string, value?: string, secret?: boolean): Promise<Models.Variable>;
|
||||
/**
|
||||
* Delete a variable by its unique ID.
|
||||
*
|
||||
* @param {string} params.functionId - Function unique ID.
|
||||
* @param {string} params.variableId - Variable unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
deleteVariable(params: {
|
||||
functionId: string;
|
||||
variableId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a variable by its unique ID.
|
||||
*
|
||||
* @param {string} functionId - Function unique ID.
|
||||
* @param {string} variableId - Variable unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
deleteVariable(functionId: string, variableId: string): Promise<{}>;
|
||||
}
|
||||
|
||||
export { Functions };
|
||||
1109
server/node_modules/node-appwrite/dist/services/functions.js
generated
vendored
Normal file
1109
server/node_modules/node-appwrite/dist/services/functions.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
server/node_modules/node-appwrite/dist/services/functions.js.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/functions.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1108
server/node_modules/node-appwrite/dist/services/functions.mjs
generated
vendored
Normal file
1108
server/node_modules/node-appwrite/dist/services/functions.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
server/node_modules/node-appwrite/dist/services/functions.mjs.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/functions.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
58
server/node_modules/node-appwrite/dist/services/graphql.d.mts
generated
vendored
Normal file
58
server/node_modules/node-appwrite/dist/services/graphql.d.mts
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
import { Client } from '../client.mjs';
|
||||
import '../models.mjs';
|
||||
import '../enums/database-type.mjs';
|
||||
import '../enums/attribute-status.mjs';
|
||||
import '../enums/column-status.mjs';
|
||||
import '../enums/index-status.mjs';
|
||||
import '../enums/deployment-status.mjs';
|
||||
import '../enums/execution-trigger.mjs';
|
||||
import '../enums/execution-status.mjs';
|
||||
import '../enums/health-antivirus-status.mjs';
|
||||
import '../enums/health-check-status.mjs';
|
||||
import '../enums/message-status.mjs';
|
||||
import '../query.mjs';
|
||||
|
||||
declare class Graphql {
|
||||
client: Client;
|
||||
constructor(client: Client);
|
||||
/**
|
||||
* Execute a GraphQL mutation.
|
||||
*
|
||||
* @param {object} params.query - The query or queries to execute.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
query(params: {
|
||||
query: object;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Execute a GraphQL mutation.
|
||||
*
|
||||
* @param {object} query - The query or queries to execute.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
query(query: object): Promise<{}>;
|
||||
/**
|
||||
* Execute a GraphQL mutation.
|
||||
*
|
||||
* @param {object} params.query - The query or queries to execute.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
mutation(params: {
|
||||
query: object;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Execute a GraphQL mutation.
|
||||
*
|
||||
* @param {object} query - The query or queries to execute.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
mutation(query: object): Promise<{}>;
|
||||
}
|
||||
|
||||
export { Graphql };
|
||||
58
server/node_modules/node-appwrite/dist/services/graphql.d.ts
generated
vendored
Normal file
58
server/node_modules/node-appwrite/dist/services/graphql.d.ts
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
import { Client } from '../client.js';
|
||||
import '../models.js';
|
||||
import '../enums/database-type.js';
|
||||
import '../enums/attribute-status.js';
|
||||
import '../enums/column-status.js';
|
||||
import '../enums/index-status.js';
|
||||
import '../enums/deployment-status.js';
|
||||
import '../enums/execution-trigger.js';
|
||||
import '../enums/execution-status.js';
|
||||
import '../enums/health-antivirus-status.js';
|
||||
import '../enums/health-check-status.js';
|
||||
import '../enums/message-status.js';
|
||||
import '../query.js';
|
||||
|
||||
declare class Graphql {
|
||||
client: Client;
|
||||
constructor(client: Client);
|
||||
/**
|
||||
* Execute a GraphQL mutation.
|
||||
*
|
||||
* @param {object} params.query - The query or queries to execute.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
query(params: {
|
||||
query: object;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Execute a GraphQL mutation.
|
||||
*
|
||||
* @param {object} query - The query or queries to execute.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
query(query: object): Promise<{}>;
|
||||
/**
|
||||
* Execute a GraphQL mutation.
|
||||
*
|
||||
* @param {object} params.query - The query or queries to execute.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
mutation(params: {
|
||||
query: object;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Execute a GraphQL mutation.
|
||||
*
|
||||
* @param {object} query - The query or queries to execute.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
mutation(query: object): Promise<{}>;
|
||||
}
|
||||
|
||||
export { Graphql };
|
||||
73
server/node_modules/node-appwrite/dist/services/graphql.js
generated
vendored
Normal file
73
server/node_modules/node-appwrite/dist/services/graphql.js
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
'use strict';
|
||||
|
||||
var client = require('../client');
|
||||
|
||||
class Graphql {
|
||||
constructor(client) {
|
||||
this.client = client;
|
||||
}
|
||||
query(paramsOrFirst) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "query" in paramsOrFirst) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
query: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const query = params.query;
|
||||
if (typeof query === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "query"');
|
||||
}
|
||||
const apiPath = "/graphql";
|
||||
const payload = {};
|
||||
if (typeof query !== "undefined") {
|
||||
payload["query"] = query;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"x-sdk-graphql": "true",
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"post",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
mutation(paramsOrFirst) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "query" in paramsOrFirst) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
query: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const query = params.query;
|
||||
if (typeof query === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "query"');
|
||||
}
|
||||
const apiPath = "/graphql/mutation";
|
||||
const payload = {};
|
||||
if (typeof query !== "undefined") {
|
||||
payload["query"] = query;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"x-sdk-graphql": "true",
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"post",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
exports.Graphql = Graphql;
|
||||
//# sourceMappingURL=out.js.map
|
||||
//# sourceMappingURL=graphql.js.map
|
||||
1
server/node_modules/node-appwrite/dist/services/graphql.js.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/graphql.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
72
server/node_modules/node-appwrite/dist/services/graphql.mjs
generated
vendored
Normal file
72
server/node_modules/node-appwrite/dist/services/graphql.mjs
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
import { AppwriteException } from '../client.mjs';
|
||||
|
||||
// src/services/graphql.ts
|
||||
var Graphql = class {
|
||||
constructor(client) {
|
||||
this.client = client;
|
||||
}
|
||||
query(paramsOrFirst) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "query" in paramsOrFirst) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
query: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const query = params.query;
|
||||
if (typeof query === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "query"');
|
||||
}
|
||||
const apiPath = "/graphql";
|
||||
const payload = {};
|
||||
if (typeof query !== "undefined") {
|
||||
payload["query"] = query;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"x-sdk-graphql": "true",
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"post",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
mutation(paramsOrFirst) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "query" in paramsOrFirst) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
query: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const query = params.query;
|
||||
if (typeof query === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "query"');
|
||||
}
|
||||
const apiPath = "/graphql/mutation";
|
||||
const payload = {};
|
||||
if (typeof query !== "undefined") {
|
||||
payload["query"] = query;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"x-sdk-graphql": "true",
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"post",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export { Graphql };
|
||||
//# sourceMappingURL=out.js.map
|
||||
//# sourceMappingURL=graphql.mjs.map
|
||||
1
server/node_modules/node-appwrite/dist/services/graphql.mjs.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/graphql.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
351
server/node_modules/node-appwrite/dist/services/health.d.mts
generated
vendored
Normal file
351
server/node_modules/node-appwrite/dist/services/health.d.mts
generated
vendored
Normal file
@@ -0,0 +1,351 @@
|
||||
import { Client } from '../client.mjs';
|
||||
import { Models } from '../models.mjs';
|
||||
import { Name } from '../enums/name.mjs';
|
||||
import '../query.mjs';
|
||||
import '../enums/database-type.mjs';
|
||||
import '../enums/attribute-status.mjs';
|
||||
import '../enums/column-status.mjs';
|
||||
import '../enums/index-status.mjs';
|
||||
import '../enums/deployment-status.mjs';
|
||||
import '../enums/execution-trigger.mjs';
|
||||
import '../enums/execution-status.mjs';
|
||||
import '../enums/health-antivirus-status.mjs';
|
||||
import '../enums/health-check-status.mjs';
|
||||
import '../enums/message-status.mjs';
|
||||
|
||||
declare class Health {
|
||||
client: Client;
|
||||
constructor(client: Client);
|
||||
/**
|
||||
* Check the Appwrite HTTP server is up and responsive.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
get(): Promise<Models.HealthStatus>;
|
||||
/**
|
||||
* Check the Appwrite Antivirus server is up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthAntivirus>}
|
||||
*/
|
||||
getAntivirus(): Promise<Models.HealthAntivirus>;
|
||||
/**
|
||||
* Check the Appwrite in-memory cache servers are up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
getCache(): Promise<Models.HealthStatus>;
|
||||
/**
|
||||
* Get the SSL certificate for a domain
|
||||
*
|
||||
* @param {string} params.domain - string
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthCertificate>}
|
||||
*/
|
||||
getCertificate(params?: {
|
||||
domain?: string;
|
||||
}): Promise<Models.HealthCertificate>;
|
||||
/**
|
||||
* Get the SSL certificate for a domain
|
||||
*
|
||||
* @param {string} domain - string
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthCertificate>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getCertificate(domain?: string): Promise<Models.HealthCertificate>;
|
||||
/**
|
||||
* Check the Appwrite database servers are up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
getDB(): Promise<Models.HealthStatus>;
|
||||
/**
|
||||
* Check the Appwrite pub-sub servers are up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
getPubSub(): Promise<Models.HealthStatus>;
|
||||
/**
|
||||
* Get the number of builds that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueBuilds(params?: {
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of builds that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueBuilds(threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueCertificates(params?: {
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueCertificates(threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of database changes that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {string} params.name - Queue name for which to check the queue size
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueDatabases(params?: {
|
||||
name?: string;
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of database changes that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {string} name - Queue name for which to check the queue size
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueDatabases(name?: string, threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueDeletes(params?: {
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueDeletes(threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Returns the amount of failed jobs in a given queue.
|
||||
*
|
||||
*
|
||||
* @param {Name} params.name - The name of the queue
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getFailedJobs(params: {
|
||||
name: Name;
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Returns the amount of failed jobs in a given queue.
|
||||
*
|
||||
*
|
||||
* @param {Name} name - The name of the queue
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getFailedJobs(name: Name, threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of function executions that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueFunctions(params?: {
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of function executions that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueFunctions(threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of logs that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueLogs(params?: {
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of logs that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueLogs(threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of mails that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueMails(params?: {
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of mails that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueMails(threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of messages that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueMessaging(params?: {
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of messages that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueMessaging(threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of migrations that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueMigrations(params?: {
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of migrations that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueMigrations(threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.
|
||||
*
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueStatsResources(params?: {
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.
|
||||
*
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueStatsResources(threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueUsage(params?: {
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueUsage(threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueWebhooks(params?: {
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueWebhooks(threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Check the Appwrite storage device is up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
getStorage(): Promise<Models.HealthStatus>;
|
||||
/**
|
||||
* Check the Appwrite local storage device is up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
getStorageLocal(): Promise<Models.HealthStatus>;
|
||||
/**
|
||||
* Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthTime>}
|
||||
*/
|
||||
getTime(): Promise<Models.HealthTime>;
|
||||
}
|
||||
|
||||
export { Health };
|
||||
351
server/node_modules/node-appwrite/dist/services/health.d.ts
generated
vendored
Normal file
351
server/node_modules/node-appwrite/dist/services/health.d.ts
generated
vendored
Normal file
@@ -0,0 +1,351 @@
|
||||
import { Client } from '../client.js';
|
||||
import { Models } from '../models.js';
|
||||
import { Name } from '../enums/name.js';
|
||||
import '../query.js';
|
||||
import '../enums/database-type.js';
|
||||
import '../enums/attribute-status.js';
|
||||
import '../enums/column-status.js';
|
||||
import '../enums/index-status.js';
|
||||
import '../enums/deployment-status.js';
|
||||
import '../enums/execution-trigger.js';
|
||||
import '../enums/execution-status.js';
|
||||
import '../enums/health-antivirus-status.js';
|
||||
import '../enums/health-check-status.js';
|
||||
import '../enums/message-status.js';
|
||||
|
||||
declare class Health {
|
||||
client: Client;
|
||||
constructor(client: Client);
|
||||
/**
|
||||
* Check the Appwrite HTTP server is up and responsive.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
get(): Promise<Models.HealthStatus>;
|
||||
/**
|
||||
* Check the Appwrite Antivirus server is up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthAntivirus>}
|
||||
*/
|
||||
getAntivirus(): Promise<Models.HealthAntivirus>;
|
||||
/**
|
||||
* Check the Appwrite in-memory cache servers are up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
getCache(): Promise<Models.HealthStatus>;
|
||||
/**
|
||||
* Get the SSL certificate for a domain
|
||||
*
|
||||
* @param {string} params.domain - string
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthCertificate>}
|
||||
*/
|
||||
getCertificate(params?: {
|
||||
domain?: string;
|
||||
}): Promise<Models.HealthCertificate>;
|
||||
/**
|
||||
* Get the SSL certificate for a domain
|
||||
*
|
||||
* @param {string} domain - string
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthCertificate>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getCertificate(domain?: string): Promise<Models.HealthCertificate>;
|
||||
/**
|
||||
* Check the Appwrite database servers are up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
getDB(): Promise<Models.HealthStatus>;
|
||||
/**
|
||||
* Check the Appwrite pub-sub servers are up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
getPubSub(): Promise<Models.HealthStatus>;
|
||||
/**
|
||||
* Get the number of builds that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueBuilds(params?: {
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of builds that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueBuilds(threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueCertificates(params?: {
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueCertificates(threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of database changes that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {string} params.name - Queue name for which to check the queue size
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueDatabases(params?: {
|
||||
name?: string;
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of database changes that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {string} name - Queue name for which to check the queue size
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueDatabases(name?: string, threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueDeletes(params?: {
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueDeletes(threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Returns the amount of failed jobs in a given queue.
|
||||
*
|
||||
*
|
||||
* @param {Name} params.name - The name of the queue
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getFailedJobs(params: {
|
||||
name: Name;
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Returns the amount of failed jobs in a given queue.
|
||||
*
|
||||
*
|
||||
* @param {Name} name - The name of the queue
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getFailedJobs(name: Name, threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of function executions that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueFunctions(params?: {
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of function executions that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueFunctions(threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of logs that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueLogs(params?: {
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of logs that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueLogs(threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of mails that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueMails(params?: {
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of mails that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueMails(threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of messages that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueMessaging(params?: {
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of messages that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueMessaging(threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of migrations that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueMigrations(params?: {
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of migrations that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueMigrations(threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.
|
||||
*
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueStatsResources(params?: {
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.
|
||||
*
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueStatsResources(threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueUsage(params?: {
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueUsage(threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
*/
|
||||
getQueueWebhooks(params?: {
|
||||
threshold?: number;
|
||||
}): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.
|
||||
*
|
||||
* @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthQueue>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getQueueWebhooks(threshold?: number): Promise<Models.HealthQueue>;
|
||||
/**
|
||||
* Check the Appwrite storage device is up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
getStorage(): Promise<Models.HealthStatus>;
|
||||
/**
|
||||
* Check the Appwrite local storage device is up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
getStorageLocal(): Promise<Models.HealthStatus>;
|
||||
/**
|
||||
* Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthTime>}
|
||||
*/
|
||||
getTime(): Promise<Models.HealthTime>;
|
||||
}
|
||||
|
||||
export { Health };
|
||||
503
server/node_modules/node-appwrite/dist/services/health.js
generated
vendored
Normal file
503
server/node_modules/node-appwrite/dist/services/health.js
generated
vendored
Normal file
@@ -0,0 +1,503 @@
|
||||
'use strict';
|
||||
|
||||
var client = require('../client');
|
||||
|
||||
class Health {
|
||||
constructor(client) {
|
||||
this.client = client;
|
||||
}
|
||||
/**
|
||||
* Check the Appwrite HTTP server is up and responsive.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
get() {
|
||||
const apiPath = "/health";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Check the Appwrite Antivirus server is up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthAntivirus>}
|
||||
*/
|
||||
getAntivirus() {
|
||||
const apiPath = "/health/anti-virus";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Check the Appwrite in-memory cache servers are up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
getCache() {
|
||||
const apiPath = "/health/cache";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getCertificate(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
domain: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const domain = params.domain;
|
||||
const apiPath = "/health/certificate";
|
||||
const payload = {};
|
||||
if (typeof domain !== "undefined") {
|
||||
payload["domain"] = domain;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Check the Appwrite database servers are up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
getDB() {
|
||||
const apiPath = "/health/db";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Check the Appwrite pub-sub servers are up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
getPubSub() {
|
||||
const apiPath = "/health/pubsub";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueBuilds(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
threshold: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/builds";
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueCertificates(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
threshold: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/certificates";
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueDatabases(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
name: paramsOrFirst,
|
||||
threshold: rest[0]
|
||||
};
|
||||
}
|
||||
const name = params.name;
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/databases";
|
||||
const payload = {};
|
||||
if (typeof name !== "undefined") {
|
||||
payload["name"] = name;
|
||||
}
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueDeletes(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
threshold: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/deletes";
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getFailedJobs(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "name" in paramsOrFirst) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
name: paramsOrFirst,
|
||||
threshold: rest[0]
|
||||
};
|
||||
}
|
||||
const name = params.name;
|
||||
const threshold = params.threshold;
|
||||
if (typeof name === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "name"');
|
||||
}
|
||||
const apiPath = "/health/queue/failed/{name}".replace("{name}", name);
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueFunctions(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
threshold: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/functions";
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueLogs(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
threshold: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/logs";
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueMails(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
threshold: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/mails";
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueMessaging(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
threshold: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/messaging";
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueMigrations(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
threshold: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/migrations";
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueStatsResources(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
threshold: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/stats-resources";
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueUsage(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
threshold: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/stats-usage";
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueWebhooks(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
threshold: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/webhooks";
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Check the Appwrite storage device is up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
getStorage() {
|
||||
const apiPath = "/health/storage";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Check the Appwrite local storage device is up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
getStorageLocal() {
|
||||
const apiPath = "/health/storage/local";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthTime>}
|
||||
*/
|
||||
getTime() {
|
||||
const apiPath = "/health/time";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
exports.Health = Health;
|
||||
//# sourceMappingURL=out.js.map
|
||||
//# sourceMappingURL=health.js.map
|
||||
1
server/node_modules/node-appwrite/dist/services/health.js.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/health.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
502
server/node_modules/node-appwrite/dist/services/health.mjs
generated
vendored
Normal file
502
server/node_modules/node-appwrite/dist/services/health.mjs
generated
vendored
Normal file
@@ -0,0 +1,502 @@
|
||||
import { AppwriteException } from '../client.mjs';
|
||||
|
||||
// src/services/health.ts
|
||||
var Health = class {
|
||||
constructor(client) {
|
||||
this.client = client;
|
||||
}
|
||||
/**
|
||||
* Check the Appwrite HTTP server is up and responsive.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
get() {
|
||||
const apiPath = "/health";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Check the Appwrite Antivirus server is up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthAntivirus>}
|
||||
*/
|
||||
getAntivirus() {
|
||||
const apiPath = "/health/anti-virus";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Check the Appwrite in-memory cache servers are up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
getCache() {
|
||||
const apiPath = "/health/cache";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getCertificate(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
domain: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const domain = params.domain;
|
||||
const apiPath = "/health/certificate";
|
||||
const payload = {};
|
||||
if (typeof domain !== "undefined") {
|
||||
payload["domain"] = domain;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Check the Appwrite database servers are up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
getDB() {
|
||||
const apiPath = "/health/db";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Check the Appwrite pub-sub servers are up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
getPubSub() {
|
||||
const apiPath = "/health/pubsub";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueBuilds(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
threshold: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/builds";
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueCertificates(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
threshold: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/certificates";
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueDatabases(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
name: paramsOrFirst,
|
||||
threshold: rest[0]
|
||||
};
|
||||
}
|
||||
const name = params.name;
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/databases";
|
||||
const payload = {};
|
||||
if (typeof name !== "undefined") {
|
||||
payload["name"] = name;
|
||||
}
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueDeletes(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
threshold: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/deletes";
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getFailedJobs(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "name" in paramsOrFirst) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
name: paramsOrFirst,
|
||||
threshold: rest[0]
|
||||
};
|
||||
}
|
||||
const name = params.name;
|
||||
const threshold = params.threshold;
|
||||
if (typeof name === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "name"');
|
||||
}
|
||||
const apiPath = "/health/queue/failed/{name}".replace("{name}", name);
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueFunctions(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
threshold: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/functions";
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueLogs(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
threshold: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/logs";
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueMails(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
threshold: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/mails";
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueMessaging(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
threshold: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/messaging";
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueMigrations(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
threshold: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/migrations";
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueStatsResources(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
threshold: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/stats-resources";
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueUsage(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
threshold: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/stats-usage";
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getQueueWebhooks(paramsOrFirst) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
threshold: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const threshold = params.threshold;
|
||||
const apiPath = "/health/queue/webhooks";
|
||||
const payload = {};
|
||||
if (typeof threshold !== "undefined") {
|
||||
payload["threshold"] = threshold;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Check the Appwrite storage device is up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
getStorage() {
|
||||
const apiPath = "/health/storage";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Check the Appwrite local storage device is up and connection is successful.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthStatus>}
|
||||
*/
|
||||
getStorageLocal() {
|
||||
const apiPath = "/health/storage/local";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.HealthTime>}
|
||||
*/
|
||||
getTime() {
|
||||
const apiPath = "/health/time";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export { Health };
|
||||
//# sourceMappingURL=out.js.map
|
||||
//# sourceMappingURL=health.mjs.map
|
||||
1
server/node_modules/node-appwrite/dist/services/health.mjs.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/health.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
78
server/node_modules/node-appwrite/dist/services/locale.d.mts
generated
vendored
Normal file
78
server/node_modules/node-appwrite/dist/services/locale.d.mts
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
import { Client } from '../client.mjs';
|
||||
import { Models } from '../models.mjs';
|
||||
import '../query.mjs';
|
||||
import '../enums/database-type.mjs';
|
||||
import '../enums/attribute-status.mjs';
|
||||
import '../enums/column-status.mjs';
|
||||
import '../enums/index-status.mjs';
|
||||
import '../enums/deployment-status.mjs';
|
||||
import '../enums/execution-trigger.mjs';
|
||||
import '../enums/execution-status.mjs';
|
||||
import '../enums/health-antivirus-status.mjs';
|
||||
import '../enums/health-check-status.mjs';
|
||||
import '../enums/message-status.mjs';
|
||||
|
||||
declare class Locale {
|
||||
client: Client;
|
||||
constructor(client: Client);
|
||||
/**
|
||||
* Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* ([IP Geolocation by DB-IP](https://db-ip.com))
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Locale>}
|
||||
*/
|
||||
get(): Promise<Models.Locale>;
|
||||
/**
|
||||
* List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.LocaleCodeList>}
|
||||
*/
|
||||
listCodes(): Promise<Models.LocaleCodeList>;
|
||||
/**
|
||||
* List of all continents. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ContinentList>}
|
||||
*/
|
||||
listContinents(): Promise<Models.ContinentList>;
|
||||
/**
|
||||
* List of all countries. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.CountryList>}
|
||||
*/
|
||||
listCountries(): Promise<Models.CountryList>;
|
||||
/**
|
||||
* List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.CountryList>}
|
||||
*/
|
||||
listCountriesEU(): Promise<Models.CountryList>;
|
||||
/**
|
||||
* List of all countries phone codes. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.PhoneList>}
|
||||
*/
|
||||
listCountriesPhones(): Promise<Models.PhoneList>;
|
||||
/**
|
||||
* List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.CurrencyList>}
|
||||
*/
|
||||
listCurrencies(): Promise<Models.CurrencyList>;
|
||||
/**
|
||||
* List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.LanguageList>}
|
||||
*/
|
||||
listLanguages(): Promise<Models.LanguageList>;
|
||||
}
|
||||
|
||||
export { Locale };
|
||||
78
server/node_modules/node-appwrite/dist/services/locale.d.ts
generated
vendored
Normal file
78
server/node_modules/node-appwrite/dist/services/locale.d.ts
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
import { Client } from '../client.js';
|
||||
import { Models } from '../models.js';
|
||||
import '../query.js';
|
||||
import '../enums/database-type.js';
|
||||
import '../enums/attribute-status.js';
|
||||
import '../enums/column-status.js';
|
||||
import '../enums/index-status.js';
|
||||
import '../enums/deployment-status.js';
|
||||
import '../enums/execution-trigger.js';
|
||||
import '../enums/execution-status.js';
|
||||
import '../enums/health-antivirus-status.js';
|
||||
import '../enums/health-check-status.js';
|
||||
import '../enums/message-status.js';
|
||||
|
||||
declare class Locale {
|
||||
client: Client;
|
||||
constructor(client: Client);
|
||||
/**
|
||||
* Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* ([IP Geolocation by DB-IP](https://db-ip.com))
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Locale>}
|
||||
*/
|
||||
get(): Promise<Models.Locale>;
|
||||
/**
|
||||
* List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.LocaleCodeList>}
|
||||
*/
|
||||
listCodes(): Promise<Models.LocaleCodeList>;
|
||||
/**
|
||||
* List of all continents. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ContinentList>}
|
||||
*/
|
||||
listContinents(): Promise<Models.ContinentList>;
|
||||
/**
|
||||
* List of all countries. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.CountryList>}
|
||||
*/
|
||||
listCountries(): Promise<Models.CountryList>;
|
||||
/**
|
||||
* List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.CountryList>}
|
||||
*/
|
||||
listCountriesEU(): Promise<Models.CountryList>;
|
||||
/**
|
||||
* List of all countries phone codes. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.PhoneList>}
|
||||
*/
|
||||
listCountriesPhones(): Promise<Models.PhoneList>;
|
||||
/**
|
||||
* List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.CurrencyList>}
|
||||
*/
|
||||
listCurrencies(): Promise<Models.CurrencyList>;
|
||||
/**
|
||||
* List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.LanguageList>}
|
||||
*/
|
||||
listLanguages(): Promise<Models.LanguageList>;
|
||||
}
|
||||
|
||||
export { Locale };
|
||||
157
server/node_modules/node-appwrite/dist/services/locale.js
generated
vendored
Normal file
157
server/node_modules/node-appwrite/dist/services/locale.js
generated
vendored
Normal file
@@ -0,0 +1,157 @@
|
||||
'use strict';
|
||||
|
||||
class Locale {
|
||||
constructor(client) {
|
||||
this.client = client;
|
||||
}
|
||||
/**
|
||||
* Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* ([IP Geolocation by DB-IP](https://db-ip.com))
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Locale>}
|
||||
*/
|
||||
get() {
|
||||
const apiPath = "/locale";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.LocaleCodeList>}
|
||||
*/
|
||||
listCodes() {
|
||||
const apiPath = "/locale/codes";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* List of all continents. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ContinentList>}
|
||||
*/
|
||||
listContinents() {
|
||||
const apiPath = "/locale/continents";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* List of all countries. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.CountryList>}
|
||||
*/
|
||||
listCountries() {
|
||||
const apiPath = "/locale/countries";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.CountryList>}
|
||||
*/
|
||||
listCountriesEU() {
|
||||
const apiPath = "/locale/countries/eu";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* List of all countries phone codes. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.PhoneList>}
|
||||
*/
|
||||
listCountriesPhones() {
|
||||
const apiPath = "/locale/countries/phones";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.CurrencyList>}
|
||||
*/
|
||||
listCurrencies() {
|
||||
const apiPath = "/locale/currencies";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.LanguageList>}
|
||||
*/
|
||||
listLanguages() {
|
||||
const apiPath = "/locale/languages";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
exports.Locale = Locale;
|
||||
//# sourceMappingURL=out.js.map
|
||||
//# sourceMappingURL=locale.js.map
|
||||
1
server/node_modules/node-appwrite/dist/services/locale.js.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/locale.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
156
server/node_modules/node-appwrite/dist/services/locale.mjs
generated
vendored
Normal file
156
server/node_modules/node-appwrite/dist/services/locale.mjs
generated
vendored
Normal file
@@ -0,0 +1,156 @@
|
||||
// src/services/locale.ts
|
||||
var Locale = class {
|
||||
constructor(client) {
|
||||
this.client = client;
|
||||
}
|
||||
/**
|
||||
* Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* ([IP Geolocation by DB-IP](https://db-ip.com))
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Locale>}
|
||||
*/
|
||||
get() {
|
||||
const apiPath = "/locale";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.LocaleCodeList>}
|
||||
*/
|
||||
listCodes() {
|
||||
const apiPath = "/locale/codes";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* List of all continents. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ContinentList>}
|
||||
*/
|
||||
listContinents() {
|
||||
const apiPath = "/locale/continents";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* List of all countries. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.CountryList>}
|
||||
*/
|
||||
listCountries() {
|
||||
const apiPath = "/locale/countries";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.CountryList>}
|
||||
*/
|
||||
listCountriesEU() {
|
||||
const apiPath = "/locale/countries/eu";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* List of all countries phone codes. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.PhoneList>}
|
||||
*/
|
||||
listCountriesPhones() {
|
||||
const apiPath = "/locale/countries/phones";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.CurrencyList>}
|
||||
*/
|
||||
listCurrencies() {
|
||||
const apiPath = "/locale/currencies";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
/**
|
||||
* List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.LanguageList>}
|
||||
*/
|
||||
listLanguages() {
|
||||
const apiPath = "/locale/languages";
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export { Locale };
|
||||
//# sourceMappingURL=out.js.map
|
||||
//# sourceMappingURL=locale.mjs.map
|
||||
1
server/node_modules/node-appwrite/dist/services/locale.mjs.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/locale.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2003
server/node_modules/node-appwrite/dist/services/messaging.d.mts
generated
vendored
Normal file
2003
server/node_modules/node-appwrite/dist/services/messaging.d.mts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2003
server/node_modules/node-appwrite/dist/services/messaging.d.ts
generated
vendored
Normal file
2003
server/node_modules/node-appwrite/dist/services/messaging.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3054
server/node_modules/node-appwrite/dist/services/messaging.js
generated
vendored
Normal file
3054
server/node_modules/node-appwrite/dist/services/messaging.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
server/node_modules/node-appwrite/dist/services/messaging.js.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/messaging.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3053
server/node_modules/node-appwrite/dist/services/messaging.mjs
generated
vendored
Normal file
3053
server/node_modules/node-appwrite/dist/services/messaging.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
server/node_modules/node-appwrite/dist/services/messaging.mjs.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/messaging.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
705
server/node_modules/node-appwrite/dist/services/sites.d.mts
generated
vendored
Normal file
705
server/node_modules/node-appwrite/dist/services/sites.d.mts
generated
vendored
Normal file
@@ -0,0 +1,705 @@
|
||||
import { Client, UploadProgress } from '../client.mjs';
|
||||
import { Models } from '../models.mjs';
|
||||
import { Framework } from '../enums/framework.mjs';
|
||||
import { BuildRuntime } from '../enums/build-runtime.mjs';
|
||||
import { Adapter } from '../enums/adapter.mjs';
|
||||
import { TemplateReferenceType } from '../enums/template-reference-type.mjs';
|
||||
import { VCSReferenceType } from '../enums/vcs-reference-type.mjs';
|
||||
import { DeploymentDownloadType } from '../enums/deployment-download-type.mjs';
|
||||
import '../query.mjs';
|
||||
import '../enums/database-type.mjs';
|
||||
import '../enums/attribute-status.mjs';
|
||||
import '../enums/column-status.mjs';
|
||||
import '../enums/index-status.mjs';
|
||||
import '../enums/deployment-status.mjs';
|
||||
import '../enums/execution-trigger.mjs';
|
||||
import '../enums/execution-status.mjs';
|
||||
import '../enums/health-antivirus-status.mjs';
|
||||
import '../enums/health-check-status.mjs';
|
||||
import '../enums/message-status.mjs';
|
||||
|
||||
declare class Sites {
|
||||
client: Client;
|
||||
constructor(client: Client);
|
||||
/**
|
||||
* Get a list of all the project's sites. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId
|
||||
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.SiteList>}
|
||||
*/
|
||||
list(params?: {
|
||||
queries?: string[];
|
||||
search?: string;
|
||||
total?: boolean;
|
||||
}): Promise<Models.SiteList>;
|
||||
/**
|
||||
* Get a list of all the project's sites. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId
|
||||
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.SiteList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
list(queries?: string[], search?: string, total?: boolean): Promise<Models.SiteList>;
|
||||
/**
|
||||
* Create a new site.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
||||
* @param {string} params.name - Site name. Max length: 128 chars.
|
||||
* @param {Framework} params.framework - Sites framework.
|
||||
* @param {BuildRuntime} params.buildRuntime - Runtime to use during build step.
|
||||
* @param {boolean} params.enabled - Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.
|
||||
* @param {boolean} params.logging - When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
|
||||
* @param {number} params.timeout - Maximum request time in seconds.
|
||||
* @param {string} params.installCommand - Install Command.
|
||||
* @param {string} params.buildCommand - Build Command.
|
||||
* @param {string} params.outputDirectory - Output Directory for site.
|
||||
* @param {Adapter} params.adapter - Framework adapter defining rendering strategy. Allowed values are: static, ssr
|
||||
* @param {string} params.installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
|
||||
* @param {string} params.fallbackFile - Fallback file for single page application sites.
|
||||
* @param {string} params.providerRepositoryId - Repository ID of the repo linked to the site.
|
||||
* @param {string} params.providerBranch - Production branch for the repo linked to the site.
|
||||
* @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
|
||||
* @param {string} params.providerRootDirectory - Path to site code in the linked repo.
|
||||
* @param {string} params.specification - Framework specification for the site and builds.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Site>}
|
||||
*/
|
||||
create(params: {
|
||||
siteId: string;
|
||||
name: string;
|
||||
framework: Framework;
|
||||
buildRuntime: BuildRuntime;
|
||||
enabled?: boolean;
|
||||
logging?: boolean;
|
||||
timeout?: number;
|
||||
installCommand?: string;
|
||||
buildCommand?: string;
|
||||
outputDirectory?: string;
|
||||
adapter?: Adapter;
|
||||
installationId?: string;
|
||||
fallbackFile?: string;
|
||||
providerRepositoryId?: string;
|
||||
providerBranch?: string;
|
||||
providerSilentMode?: boolean;
|
||||
providerRootDirectory?: string;
|
||||
specification?: string;
|
||||
}): Promise<Models.Site>;
|
||||
/**
|
||||
* Create a new site.
|
||||
*
|
||||
* @param {string} siteId - Site ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
||||
* @param {string} name - Site name. Max length: 128 chars.
|
||||
* @param {Framework} framework - Sites framework.
|
||||
* @param {BuildRuntime} buildRuntime - Runtime to use during build step.
|
||||
* @param {boolean} enabled - Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.
|
||||
* @param {boolean} logging - When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
|
||||
* @param {number} timeout - Maximum request time in seconds.
|
||||
* @param {string} installCommand - Install Command.
|
||||
* @param {string} buildCommand - Build Command.
|
||||
* @param {string} outputDirectory - Output Directory for site.
|
||||
* @param {Adapter} adapter - Framework adapter defining rendering strategy. Allowed values are: static, ssr
|
||||
* @param {string} installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
|
||||
* @param {string} fallbackFile - Fallback file for single page application sites.
|
||||
* @param {string} providerRepositoryId - Repository ID of the repo linked to the site.
|
||||
* @param {string} providerBranch - Production branch for the repo linked to the site.
|
||||
* @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
|
||||
* @param {string} providerRootDirectory - Path to site code in the linked repo.
|
||||
* @param {string} specification - Framework specification for the site and builds.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Site>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
create(siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Site>;
|
||||
/**
|
||||
* Get a list of all frameworks that are currently available on the server instance.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.FrameworkList>}
|
||||
*/
|
||||
listFrameworks(): Promise<Models.FrameworkList>;
|
||||
/**
|
||||
* List allowed site specifications for this instance.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.SpecificationList>}
|
||||
*/
|
||||
listSpecifications(): Promise<Models.SpecificationList>;
|
||||
/**
|
||||
* Get a site by its unique ID.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Site>}
|
||||
*/
|
||||
get(params: {
|
||||
siteId: string;
|
||||
}): Promise<Models.Site>;
|
||||
/**
|
||||
* Get a site by its unique ID.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Site>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
get(siteId: string): Promise<Models.Site>;
|
||||
/**
|
||||
* Update site by its unique ID.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string} params.name - Site name. Max length: 128 chars.
|
||||
* @param {Framework} params.framework - Sites framework.
|
||||
* @param {boolean} params.enabled - Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.
|
||||
* @param {boolean} params.logging - When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
|
||||
* @param {number} params.timeout - Maximum request time in seconds.
|
||||
* @param {string} params.installCommand - Install Command.
|
||||
* @param {string} params.buildCommand - Build Command.
|
||||
* @param {string} params.outputDirectory - Output Directory for site.
|
||||
* @param {BuildRuntime} params.buildRuntime - Runtime to use during build step.
|
||||
* @param {Adapter} params.adapter - Framework adapter defining rendering strategy. Allowed values are: static, ssr
|
||||
* @param {string} params.fallbackFile - Fallback file for single page application sites.
|
||||
* @param {string} params.installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
|
||||
* @param {string} params.providerRepositoryId - Repository ID of the repo linked to the site.
|
||||
* @param {string} params.providerBranch - Production branch for the repo linked to the site.
|
||||
* @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
|
||||
* @param {string} params.providerRootDirectory - Path to site code in the linked repo.
|
||||
* @param {string} params.specification - Framework specification for the site and builds.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Site>}
|
||||
*/
|
||||
update(params: {
|
||||
siteId: string;
|
||||
name: string;
|
||||
framework: Framework;
|
||||
enabled?: boolean;
|
||||
logging?: boolean;
|
||||
timeout?: number;
|
||||
installCommand?: string;
|
||||
buildCommand?: string;
|
||||
outputDirectory?: string;
|
||||
buildRuntime?: BuildRuntime;
|
||||
adapter?: Adapter;
|
||||
fallbackFile?: string;
|
||||
installationId?: string;
|
||||
providerRepositoryId?: string;
|
||||
providerBranch?: string;
|
||||
providerSilentMode?: boolean;
|
||||
providerRootDirectory?: string;
|
||||
specification?: string;
|
||||
}): Promise<Models.Site>;
|
||||
/**
|
||||
* Update site by its unique ID.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string} name - Site name. Max length: 128 chars.
|
||||
* @param {Framework} framework - Sites framework.
|
||||
* @param {boolean} enabled - Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.
|
||||
* @param {boolean} logging - When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
|
||||
* @param {number} timeout - Maximum request time in seconds.
|
||||
* @param {string} installCommand - Install Command.
|
||||
* @param {string} buildCommand - Build Command.
|
||||
* @param {string} outputDirectory - Output Directory for site.
|
||||
* @param {BuildRuntime} buildRuntime - Runtime to use during build step.
|
||||
* @param {Adapter} adapter - Framework adapter defining rendering strategy. Allowed values are: static, ssr
|
||||
* @param {string} fallbackFile - Fallback file for single page application sites.
|
||||
* @param {string} installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
|
||||
* @param {string} providerRepositoryId - Repository ID of the repo linked to the site.
|
||||
* @param {string} providerBranch - Production branch for the repo linked to the site.
|
||||
* @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
|
||||
* @param {string} providerRootDirectory - Path to site code in the linked repo.
|
||||
* @param {string} specification - Framework specification for the site and builds.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Site>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
update(siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Site>;
|
||||
/**
|
||||
* Delete a site by its unique ID.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
delete(params: {
|
||||
siteId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a site by its unique ID.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
delete(siteId: string): Promise<{}>;
|
||||
/**
|
||||
* Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Site>}
|
||||
*/
|
||||
updateSiteDeployment(params: {
|
||||
siteId: string;
|
||||
deploymentId: string;
|
||||
}): Promise<Models.Site>;
|
||||
/**
|
||||
* Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Site>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updateSiteDeployment(siteId: string, deploymentId: string): Promise<Models.Site>;
|
||||
/**
|
||||
* Get a list of all the site's code deployments. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
|
||||
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.DeploymentList>}
|
||||
*/
|
||||
listDeployments(params: {
|
||||
siteId: string;
|
||||
queries?: string[];
|
||||
search?: string;
|
||||
total?: boolean;
|
||||
}): Promise<Models.DeploymentList>;
|
||||
/**
|
||||
* Get a list of all the site's code deployments. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
|
||||
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.DeploymentList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
listDeployments(siteId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.DeploymentList>;
|
||||
/**
|
||||
* Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {File} params.code - Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.
|
||||
* @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
|
||||
* @param {string} params.installCommand - Install Commands.
|
||||
* @param {string} params.buildCommand - Build Commands.
|
||||
* @param {string} params.outputDirectory - Output Directory.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
createDeployment(params: {
|
||||
siteId: string;
|
||||
code: File;
|
||||
activate: boolean;
|
||||
installCommand?: string;
|
||||
buildCommand?: string;
|
||||
outputDirectory?: string;
|
||||
onProgress?: (progress: UploadProgress) => void;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {File} code - Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.
|
||||
* @param {boolean} activate - Automatically activate the deployment when it is finished building.
|
||||
* @param {string} installCommand - Install Commands.
|
||||
* @param {string} buildCommand - Build Commands.
|
||||
* @param {string} outputDirectory - Output Directory.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createDeployment(siteId: string, code: File, activate: boolean, installCommand?: string, buildCommand?: string, outputDirectory?: string, onProgress?: (progress: UploadProgress) => void): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
createDuplicateDeployment(params: {
|
||||
siteId: string;
|
||||
deploymentId: string;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createDuplicateDeployment(siteId: string, deploymentId: string): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a deployment based on a template.
|
||||
*
|
||||
* Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/products/sites/templates) to find the template details.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string} params.repository - Repository name of the template.
|
||||
* @param {string} params.owner - The name of the owner of the template.
|
||||
* @param {string} params.rootDirectory - Path to site code in the template repo.
|
||||
* @param {TemplateReferenceType} params.type - Type for the reference provided. Can be commit, branch, or tag
|
||||
* @param {string} params.reference - Reference value, can be a commit hash, branch name, or release tag
|
||||
* @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
createTemplateDeployment(params: {
|
||||
siteId: string;
|
||||
repository: string;
|
||||
owner: string;
|
||||
rootDirectory: string;
|
||||
type: TemplateReferenceType;
|
||||
reference: string;
|
||||
activate?: boolean;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a deployment based on a template.
|
||||
*
|
||||
* Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/products/sites/templates) to find the template details.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string} repository - Repository name of the template.
|
||||
* @param {string} owner - The name of the owner of the template.
|
||||
* @param {string} rootDirectory - Path to site code in the template repo.
|
||||
* @param {TemplateReferenceType} type - Type for the reference provided. Can be commit, branch, or tag
|
||||
* @param {string} reference - Reference value, can be a commit hash, branch name, or release tag
|
||||
* @param {boolean} activate - Automatically activate the deployment when it is finished building.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createTemplateDeployment(siteId: string, repository: string, owner: string, rootDirectory: string, type: TemplateReferenceType, reference: string, activate?: boolean): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a deployment when a site is connected to VCS.
|
||||
*
|
||||
* This endpoint lets you create deployment from a branch, commit, or a tag.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {VCSReferenceType} params.type - Type of reference passed. Allowed values are: branch, commit
|
||||
* @param {string} params.reference - VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
|
||||
* @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
createVcsDeployment(params: {
|
||||
siteId: string;
|
||||
type: VCSReferenceType;
|
||||
reference: string;
|
||||
activate?: boolean;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a deployment when a site is connected to VCS.
|
||||
*
|
||||
* This endpoint lets you create deployment from a branch, commit, or a tag.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {VCSReferenceType} type - Type of reference passed. Allowed values are: branch, commit
|
||||
* @param {string} reference - VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
|
||||
* @param {boolean} activate - Automatically activate the deployment when it is finished building.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createVcsDeployment(siteId: string, type: VCSReferenceType, reference: string, activate?: boolean): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Get a site deployment by its unique ID.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
getDeployment(params: {
|
||||
siteId: string;
|
||||
deploymentId: string;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Get a site deployment by its unique ID.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getDeployment(siteId: string, deploymentId: string): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Delete a site deployment by its unique ID.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
deleteDeployment(params: {
|
||||
siteId: string;
|
||||
deploymentId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a site deployment by its unique ID.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
deleteDeployment(siteId: string, deploymentId: string): Promise<{}>;
|
||||
/**
|
||||
* Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @param {DeploymentDownloadType} params.type - Deployment file to download. Can be: "source", "output".
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getDeploymentDownload(params: {
|
||||
siteId: string;
|
||||
deploymentId: string;
|
||||
type?: DeploymentDownloadType;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @param {DeploymentDownloadType} type - Deployment file to download. Can be: "source", "output".
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getDeploymentDownload(siteId: string, deploymentId: string, type?: DeploymentDownloadType): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
updateDeploymentStatus(params: {
|
||||
siteId: string;
|
||||
deploymentId: string;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updateDeploymentStatus(siteId: string, deploymentId: string): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Get a list of all site logs. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
|
||||
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ExecutionList>}
|
||||
*/
|
||||
listLogs(params: {
|
||||
siteId: string;
|
||||
queries?: string[];
|
||||
total?: boolean;
|
||||
}): Promise<Models.ExecutionList>;
|
||||
/**
|
||||
* Get a list of all site logs. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
|
||||
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ExecutionList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
listLogs(siteId: string, queries?: string[], total?: boolean): Promise<Models.ExecutionList>;
|
||||
/**
|
||||
* Get a site request log by its unique ID.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string} params.logId - Log ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Execution>}
|
||||
*/
|
||||
getLog(params: {
|
||||
siteId: string;
|
||||
logId: string;
|
||||
}): Promise<Models.Execution>;
|
||||
/**
|
||||
* Get a site request log by its unique ID.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string} logId - Log ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Execution>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getLog(siteId: string, logId: string): Promise<Models.Execution>;
|
||||
/**
|
||||
* Delete a site log by its unique ID.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string} params.logId - Log ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
deleteLog(params: {
|
||||
siteId: string;
|
||||
logId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a site log by its unique ID.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string} logId - Log ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
deleteLog(siteId: string, logId: string): Promise<{}>;
|
||||
/**
|
||||
* Get a list of all variables of a specific site.
|
||||
*
|
||||
* @param {string} params.siteId - Site unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.VariableList>}
|
||||
*/
|
||||
listVariables(params: {
|
||||
siteId: string;
|
||||
}): Promise<Models.VariableList>;
|
||||
/**
|
||||
* Get a list of all variables of a specific site.
|
||||
*
|
||||
* @param {string} siteId - Site unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.VariableList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
listVariables(siteId: string): Promise<Models.VariableList>;
|
||||
/**
|
||||
* Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.
|
||||
*
|
||||
* @param {string} params.siteId - Site unique ID.
|
||||
* @param {string} params.key - Variable key. Max length: 255 chars.
|
||||
* @param {string} params.value - Variable value. Max length: 8192 chars.
|
||||
* @param {boolean} params.secret - Secret variables can be updated or deleted, but only sites can read them during build and runtime.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
*/
|
||||
createVariable(params: {
|
||||
siteId: string;
|
||||
key: string;
|
||||
value: string;
|
||||
secret?: boolean;
|
||||
}): Promise<Models.Variable>;
|
||||
/**
|
||||
* Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.
|
||||
*
|
||||
* @param {string} siteId - Site unique ID.
|
||||
* @param {string} key - Variable key. Max length: 255 chars.
|
||||
* @param {string} value - Variable value. Max length: 8192 chars.
|
||||
* @param {boolean} secret - Secret variables can be updated or deleted, but only sites can read them during build and runtime.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createVariable(siteId: string, key: string, value: string, secret?: boolean): Promise<Models.Variable>;
|
||||
/**
|
||||
* Get a variable by its unique ID.
|
||||
*
|
||||
* @param {string} params.siteId - Site unique ID.
|
||||
* @param {string} params.variableId - Variable unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
*/
|
||||
getVariable(params: {
|
||||
siteId: string;
|
||||
variableId: string;
|
||||
}): Promise<Models.Variable>;
|
||||
/**
|
||||
* Get a variable by its unique ID.
|
||||
*
|
||||
* @param {string} siteId - Site unique ID.
|
||||
* @param {string} variableId - Variable unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getVariable(siteId: string, variableId: string): Promise<Models.Variable>;
|
||||
/**
|
||||
* Update variable by its unique ID.
|
||||
*
|
||||
* @param {string} params.siteId - Site unique ID.
|
||||
* @param {string} params.variableId - Variable unique ID.
|
||||
* @param {string} params.key - Variable key. Max length: 255 chars.
|
||||
* @param {string} params.value - Variable value. Max length: 8192 chars.
|
||||
* @param {boolean} params.secret - Secret variables can be updated or deleted, but only sites can read them during build and runtime.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
*/
|
||||
updateVariable(params: {
|
||||
siteId: string;
|
||||
variableId: string;
|
||||
key: string;
|
||||
value?: string;
|
||||
secret?: boolean;
|
||||
}): Promise<Models.Variable>;
|
||||
/**
|
||||
* Update variable by its unique ID.
|
||||
*
|
||||
* @param {string} siteId - Site unique ID.
|
||||
* @param {string} variableId - Variable unique ID.
|
||||
* @param {string} key - Variable key. Max length: 255 chars.
|
||||
* @param {string} value - Variable value. Max length: 8192 chars.
|
||||
* @param {boolean} secret - Secret variables can be updated or deleted, but only sites can read them during build and runtime.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updateVariable(siteId: string, variableId: string, key: string, value?: string, secret?: boolean): Promise<Models.Variable>;
|
||||
/**
|
||||
* Delete a variable by its unique ID.
|
||||
*
|
||||
* @param {string} params.siteId - Site unique ID.
|
||||
* @param {string} params.variableId - Variable unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
deleteVariable(params: {
|
||||
siteId: string;
|
||||
variableId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a variable by its unique ID.
|
||||
*
|
||||
* @param {string} siteId - Site unique ID.
|
||||
* @param {string} variableId - Variable unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
deleteVariable(siteId: string, variableId: string): Promise<{}>;
|
||||
}
|
||||
|
||||
export { Sites };
|
||||
705
server/node_modules/node-appwrite/dist/services/sites.d.ts
generated
vendored
Normal file
705
server/node_modules/node-appwrite/dist/services/sites.d.ts
generated
vendored
Normal file
@@ -0,0 +1,705 @@
|
||||
import { Client, UploadProgress } from '../client.js';
|
||||
import { Models } from '../models.js';
|
||||
import { Framework } from '../enums/framework.js';
|
||||
import { BuildRuntime } from '../enums/build-runtime.js';
|
||||
import { Adapter } from '../enums/adapter.js';
|
||||
import { TemplateReferenceType } from '../enums/template-reference-type.js';
|
||||
import { VCSReferenceType } from '../enums/vcs-reference-type.js';
|
||||
import { DeploymentDownloadType } from '../enums/deployment-download-type.js';
|
||||
import '../query.js';
|
||||
import '../enums/database-type.js';
|
||||
import '../enums/attribute-status.js';
|
||||
import '../enums/column-status.js';
|
||||
import '../enums/index-status.js';
|
||||
import '../enums/deployment-status.js';
|
||||
import '../enums/execution-trigger.js';
|
||||
import '../enums/execution-status.js';
|
||||
import '../enums/health-antivirus-status.js';
|
||||
import '../enums/health-check-status.js';
|
||||
import '../enums/message-status.js';
|
||||
|
||||
declare class Sites {
|
||||
client: Client;
|
||||
constructor(client: Client);
|
||||
/**
|
||||
* Get a list of all the project's sites. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId
|
||||
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.SiteList>}
|
||||
*/
|
||||
list(params?: {
|
||||
queries?: string[];
|
||||
search?: string;
|
||||
total?: boolean;
|
||||
}): Promise<Models.SiteList>;
|
||||
/**
|
||||
* Get a list of all the project's sites. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId
|
||||
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.SiteList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
list(queries?: string[], search?: string, total?: boolean): Promise<Models.SiteList>;
|
||||
/**
|
||||
* Create a new site.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
||||
* @param {string} params.name - Site name. Max length: 128 chars.
|
||||
* @param {Framework} params.framework - Sites framework.
|
||||
* @param {BuildRuntime} params.buildRuntime - Runtime to use during build step.
|
||||
* @param {boolean} params.enabled - Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.
|
||||
* @param {boolean} params.logging - When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
|
||||
* @param {number} params.timeout - Maximum request time in seconds.
|
||||
* @param {string} params.installCommand - Install Command.
|
||||
* @param {string} params.buildCommand - Build Command.
|
||||
* @param {string} params.outputDirectory - Output Directory for site.
|
||||
* @param {Adapter} params.adapter - Framework adapter defining rendering strategy. Allowed values are: static, ssr
|
||||
* @param {string} params.installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
|
||||
* @param {string} params.fallbackFile - Fallback file for single page application sites.
|
||||
* @param {string} params.providerRepositoryId - Repository ID of the repo linked to the site.
|
||||
* @param {string} params.providerBranch - Production branch for the repo linked to the site.
|
||||
* @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
|
||||
* @param {string} params.providerRootDirectory - Path to site code in the linked repo.
|
||||
* @param {string} params.specification - Framework specification for the site and builds.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Site>}
|
||||
*/
|
||||
create(params: {
|
||||
siteId: string;
|
||||
name: string;
|
||||
framework: Framework;
|
||||
buildRuntime: BuildRuntime;
|
||||
enabled?: boolean;
|
||||
logging?: boolean;
|
||||
timeout?: number;
|
||||
installCommand?: string;
|
||||
buildCommand?: string;
|
||||
outputDirectory?: string;
|
||||
adapter?: Adapter;
|
||||
installationId?: string;
|
||||
fallbackFile?: string;
|
||||
providerRepositoryId?: string;
|
||||
providerBranch?: string;
|
||||
providerSilentMode?: boolean;
|
||||
providerRootDirectory?: string;
|
||||
specification?: string;
|
||||
}): Promise<Models.Site>;
|
||||
/**
|
||||
* Create a new site.
|
||||
*
|
||||
* @param {string} siteId - Site ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
||||
* @param {string} name - Site name. Max length: 128 chars.
|
||||
* @param {Framework} framework - Sites framework.
|
||||
* @param {BuildRuntime} buildRuntime - Runtime to use during build step.
|
||||
* @param {boolean} enabled - Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.
|
||||
* @param {boolean} logging - When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
|
||||
* @param {number} timeout - Maximum request time in seconds.
|
||||
* @param {string} installCommand - Install Command.
|
||||
* @param {string} buildCommand - Build Command.
|
||||
* @param {string} outputDirectory - Output Directory for site.
|
||||
* @param {Adapter} adapter - Framework adapter defining rendering strategy. Allowed values are: static, ssr
|
||||
* @param {string} installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
|
||||
* @param {string} fallbackFile - Fallback file for single page application sites.
|
||||
* @param {string} providerRepositoryId - Repository ID of the repo linked to the site.
|
||||
* @param {string} providerBranch - Production branch for the repo linked to the site.
|
||||
* @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
|
||||
* @param {string} providerRootDirectory - Path to site code in the linked repo.
|
||||
* @param {string} specification - Framework specification for the site and builds.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Site>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
create(siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Site>;
|
||||
/**
|
||||
* Get a list of all frameworks that are currently available on the server instance.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.FrameworkList>}
|
||||
*/
|
||||
listFrameworks(): Promise<Models.FrameworkList>;
|
||||
/**
|
||||
* List allowed site specifications for this instance.
|
||||
*
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.SpecificationList>}
|
||||
*/
|
||||
listSpecifications(): Promise<Models.SpecificationList>;
|
||||
/**
|
||||
* Get a site by its unique ID.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Site>}
|
||||
*/
|
||||
get(params: {
|
||||
siteId: string;
|
||||
}): Promise<Models.Site>;
|
||||
/**
|
||||
* Get a site by its unique ID.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Site>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
get(siteId: string): Promise<Models.Site>;
|
||||
/**
|
||||
* Update site by its unique ID.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string} params.name - Site name. Max length: 128 chars.
|
||||
* @param {Framework} params.framework - Sites framework.
|
||||
* @param {boolean} params.enabled - Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.
|
||||
* @param {boolean} params.logging - When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
|
||||
* @param {number} params.timeout - Maximum request time in seconds.
|
||||
* @param {string} params.installCommand - Install Command.
|
||||
* @param {string} params.buildCommand - Build Command.
|
||||
* @param {string} params.outputDirectory - Output Directory for site.
|
||||
* @param {BuildRuntime} params.buildRuntime - Runtime to use during build step.
|
||||
* @param {Adapter} params.adapter - Framework adapter defining rendering strategy. Allowed values are: static, ssr
|
||||
* @param {string} params.fallbackFile - Fallback file for single page application sites.
|
||||
* @param {string} params.installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
|
||||
* @param {string} params.providerRepositoryId - Repository ID of the repo linked to the site.
|
||||
* @param {string} params.providerBranch - Production branch for the repo linked to the site.
|
||||
* @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
|
||||
* @param {string} params.providerRootDirectory - Path to site code in the linked repo.
|
||||
* @param {string} params.specification - Framework specification for the site and builds.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Site>}
|
||||
*/
|
||||
update(params: {
|
||||
siteId: string;
|
||||
name: string;
|
||||
framework: Framework;
|
||||
enabled?: boolean;
|
||||
logging?: boolean;
|
||||
timeout?: number;
|
||||
installCommand?: string;
|
||||
buildCommand?: string;
|
||||
outputDirectory?: string;
|
||||
buildRuntime?: BuildRuntime;
|
||||
adapter?: Adapter;
|
||||
fallbackFile?: string;
|
||||
installationId?: string;
|
||||
providerRepositoryId?: string;
|
||||
providerBranch?: string;
|
||||
providerSilentMode?: boolean;
|
||||
providerRootDirectory?: string;
|
||||
specification?: string;
|
||||
}): Promise<Models.Site>;
|
||||
/**
|
||||
* Update site by its unique ID.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string} name - Site name. Max length: 128 chars.
|
||||
* @param {Framework} framework - Sites framework.
|
||||
* @param {boolean} enabled - Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.
|
||||
* @param {boolean} logging - When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
|
||||
* @param {number} timeout - Maximum request time in seconds.
|
||||
* @param {string} installCommand - Install Command.
|
||||
* @param {string} buildCommand - Build Command.
|
||||
* @param {string} outputDirectory - Output Directory for site.
|
||||
* @param {BuildRuntime} buildRuntime - Runtime to use during build step.
|
||||
* @param {Adapter} adapter - Framework adapter defining rendering strategy. Allowed values are: static, ssr
|
||||
* @param {string} fallbackFile - Fallback file for single page application sites.
|
||||
* @param {string} installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
|
||||
* @param {string} providerRepositoryId - Repository ID of the repo linked to the site.
|
||||
* @param {string} providerBranch - Production branch for the repo linked to the site.
|
||||
* @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
|
||||
* @param {string} providerRootDirectory - Path to site code in the linked repo.
|
||||
* @param {string} specification - Framework specification for the site and builds.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Site>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
update(siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Site>;
|
||||
/**
|
||||
* Delete a site by its unique ID.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
delete(params: {
|
||||
siteId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a site by its unique ID.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
delete(siteId: string): Promise<{}>;
|
||||
/**
|
||||
* Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Site>}
|
||||
*/
|
||||
updateSiteDeployment(params: {
|
||||
siteId: string;
|
||||
deploymentId: string;
|
||||
}): Promise<Models.Site>;
|
||||
/**
|
||||
* Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Site>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updateSiteDeployment(siteId: string, deploymentId: string): Promise<Models.Site>;
|
||||
/**
|
||||
* Get a list of all the site's code deployments. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
|
||||
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.DeploymentList>}
|
||||
*/
|
||||
listDeployments(params: {
|
||||
siteId: string;
|
||||
queries?: string[];
|
||||
search?: string;
|
||||
total?: boolean;
|
||||
}): Promise<Models.DeploymentList>;
|
||||
/**
|
||||
* Get a list of all the site's code deployments. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
|
||||
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.DeploymentList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
listDeployments(siteId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.DeploymentList>;
|
||||
/**
|
||||
* Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {File} params.code - Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.
|
||||
* @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
|
||||
* @param {string} params.installCommand - Install Commands.
|
||||
* @param {string} params.buildCommand - Build Commands.
|
||||
* @param {string} params.outputDirectory - Output Directory.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
createDeployment(params: {
|
||||
siteId: string;
|
||||
code: File;
|
||||
activate: boolean;
|
||||
installCommand?: string;
|
||||
buildCommand?: string;
|
||||
outputDirectory?: string;
|
||||
onProgress?: (progress: UploadProgress) => void;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {File} code - Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.
|
||||
* @param {boolean} activate - Automatically activate the deployment when it is finished building.
|
||||
* @param {string} installCommand - Install Commands.
|
||||
* @param {string} buildCommand - Build Commands.
|
||||
* @param {string} outputDirectory - Output Directory.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createDeployment(siteId: string, code: File, activate: boolean, installCommand?: string, buildCommand?: string, outputDirectory?: string, onProgress?: (progress: UploadProgress) => void): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
createDuplicateDeployment(params: {
|
||||
siteId: string;
|
||||
deploymentId: string;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createDuplicateDeployment(siteId: string, deploymentId: string): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a deployment based on a template.
|
||||
*
|
||||
* Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/products/sites/templates) to find the template details.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string} params.repository - Repository name of the template.
|
||||
* @param {string} params.owner - The name of the owner of the template.
|
||||
* @param {string} params.rootDirectory - Path to site code in the template repo.
|
||||
* @param {TemplateReferenceType} params.type - Type for the reference provided. Can be commit, branch, or tag
|
||||
* @param {string} params.reference - Reference value, can be a commit hash, branch name, or release tag
|
||||
* @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
createTemplateDeployment(params: {
|
||||
siteId: string;
|
||||
repository: string;
|
||||
owner: string;
|
||||
rootDirectory: string;
|
||||
type: TemplateReferenceType;
|
||||
reference: string;
|
||||
activate?: boolean;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a deployment based on a template.
|
||||
*
|
||||
* Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/products/sites/templates) to find the template details.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string} repository - Repository name of the template.
|
||||
* @param {string} owner - The name of the owner of the template.
|
||||
* @param {string} rootDirectory - Path to site code in the template repo.
|
||||
* @param {TemplateReferenceType} type - Type for the reference provided. Can be commit, branch, or tag
|
||||
* @param {string} reference - Reference value, can be a commit hash, branch name, or release tag
|
||||
* @param {boolean} activate - Automatically activate the deployment when it is finished building.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createTemplateDeployment(siteId: string, repository: string, owner: string, rootDirectory: string, type: TemplateReferenceType, reference: string, activate?: boolean): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a deployment when a site is connected to VCS.
|
||||
*
|
||||
* This endpoint lets you create deployment from a branch, commit, or a tag.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {VCSReferenceType} params.type - Type of reference passed. Allowed values are: branch, commit
|
||||
* @param {string} params.reference - VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
|
||||
* @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
createVcsDeployment(params: {
|
||||
siteId: string;
|
||||
type: VCSReferenceType;
|
||||
reference: string;
|
||||
activate?: boolean;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Create a deployment when a site is connected to VCS.
|
||||
*
|
||||
* This endpoint lets you create deployment from a branch, commit, or a tag.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {VCSReferenceType} type - Type of reference passed. Allowed values are: branch, commit
|
||||
* @param {string} reference - VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
|
||||
* @param {boolean} activate - Automatically activate the deployment when it is finished building.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createVcsDeployment(siteId: string, type: VCSReferenceType, reference: string, activate?: boolean): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Get a site deployment by its unique ID.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
getDeployment(params: {
|
||||
siteId: string;
|
||||
deploymentId: string;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Get a site deployment by its unique ID.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getDeployment(siteId: string, deploymentId: string): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Delete a site deployment by its unique ID.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
deleteDeployment(params: {
|
||||
siteId: string;
|
||||
deploymentId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a site deployment by its unique ID.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
deleteDeployment(siteId: string, deploymentId: string): Promise<{}>;
|
||||
/**
|
||||
* Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @param {DeploymentDownloadType} params.type - Deployment file to download. Can be: "source", "output".
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getDeploymentDownload(params: {
|
||||
siteId: string;
|
||||
deploymentId: string;
|
||||
type?: DeploymentDownloadType;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @param {DeploymentDownloadType} type - Deployment file to download. Can be: "source", "output".
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getDeploymentDownload(siteId: string, deploymentId: string, type?: DeploymentDownloadType): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string} params.deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
*/
|
||||
updateDeploymentStatus(params: {
|
||||
siteId: string;
|
||||
deploymentId: string;
|
||||
}): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string} deploymentId - Deployment ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Deployment>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updateDeploymentStatus(siteId: string, deploymentId: string): Promise<Models.Deployment>;
|
||||
/**
|
||||
* Get a list of all site logs. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
|
||||
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ExecutionList>}
|
||||
*/
|
||||
listLogs(params: {
|
||||
siteId: string;
|
||||
queries?: string[];
|
||||
total?: boolean;
|
||||
}): Promise<Models.ExecutionList>;
|
||||
/**
|
||||
* Get a list of all site logs. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
|
||||
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ExecutionList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
listLogs(siteId: string, queries?: string[], total?: boolean): Promise<Models.ExecutionList>;
|
||||
/**
|
||||
* Get a site request log by its unique ID.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string} params.logId - Log ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Execution>}
|
||||
*/
|
||||
getLog(params: {
|
||||
siteId: string;
|
||||
logId: string;
|
||||
}): Promise<Models.Execution>;
|
||||
/**
|
||||
* Get a site request log by its unique ID.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string} logId - Log ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Execution>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getLog(siteId: string, logId: string): Promise<Models.Execution>;
|
||||
/**
|
||||
* Delete a site log by its unique ID.
|
||||
*
|
||||
* @param {string} params.siteId - Site ID.
|
||||
* @param {string} params.logId - Log ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
deleteLog(params: {
|
||||
siteId: string;
|
||||
logId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a site log by its unique ID.
|
||||
*
|
||||
* @param {string} siteId - Site ID.
|
||||
* @param {string} logId - Log ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
deleteLog(siteId: string, logId: string): Promise<{}>;
|
||||
/**
|
||||
* Get a list of all variables of a specific site.
|
||||
*
|
||||
* @param {string} params.siteId - Site unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.VariableList>}
|
||||
*/
|
||||
listVariables(params: {
|
||||
siteId: string;
|
||||
}): Promise<Models.VariableList>;
|
||||
/**
|
||||
* Get a list of all variables of a specific site.
|
||||
*
|
||||
* @param {string} siteId - Site unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.VariableList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
listVariables(siteId: string): Promise<Models.VariableList>;
|
||||
/**
|
||||
* Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.
|
||||
*
|
||||
* @param {string} params.siteId - Site unique ID.
|
||||
* @param {string} params.key - Variable key. Max length: 255 chars.
|
||||
* @param {string} params.value - Variable value. Max length: 8192 chars.
|
||||
* @param {boolean} params.secret - Secret variables can be updated or deleted, but only sites can read them during build and runtime.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
*/
|
||||
createVariable(params: {
|
||||
siteId: string;
|
||||
key: string;
|
||||
value: string;
|
||||
secret?: boolean;
|
||||
}): Promise<Models.Variable>;
|
||||
/**
|
||||
* Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.
|
||||
*
|
||||
* @param {string} siteId - Site unique ID.
|
||||
* @param {string} key - Variable key. Max length: 255 chars.
|
||||
* @param {string} value - Variable value. Max length: 8192 chars.
|
||||
* @param {boolean} secret - Secret variables can be updated or deleted, but only sites can read them during build and runtime.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createVariable(siteId: string, key: string, value: string, secret?: boolean): Promise<Models.Variable>;
|
||||
/**
|
||||
* Get a variable by its unique ID.
|
||||
*
|
||||
* @param {string} params.siteId - Site unique ID.
|
||||
* @param {string} params.variableId - Variable unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
*/
|
||||
getVariable(params: {
|
||||
siteId: string;
|
||||
variableId: string;
|
||||
}): Promise<Models.Variable>;
|
||||
/**
|
||||
* Get a variable by its unique ID.
|
||||
*
|
||||
* @param {string} siteId - Site unique ID.
|
||||
* @param {string} variableId - Variable unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getVariable(siteId: string, variableId: string): Promise<Models.Variable>;
|
||||
/**
|
||||
* Update variable by its unique ID.
|
||||
*
|
||||
* @param {string} params.siteId - Site unique ID.
|
||||
* @param {string} params.variableId - Variable unique ID.
|
||||
* @param {string} params.key - Variable key. Max length: 255 chars.
|
||||
* @param {string} params.value - Variable value. Max length: 8192 chars.
|
||||
* @param {boolean} params.secret - Secret variables can be updated or deleted, but only sites can read them during build and runtime.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
*/
|
||||
updateVariable(params: {
|
||||
siteId: string;
|
||||
variableId: string;
|
||||
key: string;
|
||||
value?: string;
|
||||
secret?: boolean;
|
||||
}): Promise<Models.Variable>;
|
||||
/**
|
||||
* Update variable by its unique ID.
|
||||
*
|
||||
* @param {string} siteId - Site unique ID.
|
||||
* @param {string} variableId - Variable unique ID.
|
||||
* @param {string} key - Variable key. Max length: 255 chars.
|
||||
* @param {string} value - Variable value. Max length: 8192 chars.
|
||||
* @param {boolean} secret - Secret variables can be updated or deleted, but only sites can read them during build and runtime.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Variable>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updateVariable(siteId: string, variableId: string, key: string, value?: string, secret?: boolean): Promise<Models.Variable>;
|
||||
/**
|
||||
* Delete a variable by its unique ID.
|
||||
*
|
||||
* @param {string} params.siteId - Site unique ID.
|
||||
* @param {string} params.variableId - Variable unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
deleteVariable(params: {
|
||||
siteId: string;
|
||||
variableId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a variable by its unique ID.
|
||||
*
|
||||
* @param {string} siteId - Site unique ID.
|
||||
* @param {string} variableId - Variable unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
deleteVariable(siteId: string, variableId: string): Promise<{}>;
|
||||
}
|
||||
|
||||
export { Sites };
|
||||
1059
server/node_modules/node-appwrite/dist/services/sites.js
generated
vendored
Normal file
1059
server/node_modules/node-appwrite/dist/services/sites.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
server/node_modules/node-appwrite/dist/services/sites.js.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/sites.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1058
server/node_modules/node-appwrite/dist/services/sites.mjs
generated
vendored
Normal file
1058
server/node_modules/node-appwrite/dist/services/sites.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
server/node_modules/node-appwrite/dist/services/sites.mjs.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/sites.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
435
server/node_modules/node-appwrite/dist/services/storage.d.mts
generated
vendored
Normal file
435
server/node_modules/node-appwrite/dist/services/storage.d.mts
generated
vendored
Normal file
@@ -0,0 +1,435 @@
|
||||
import { Client, UploadProgress } from '../client.mjs';
|
||||
import { Models } from '../models.mjs';
|
||||
import { Compression } from '../enums/compression.mjs';
|
||||
import { ImageGravity } from '../enums/image-gravity.mjs';
|
||||
import { ImageFormat } from '../enums/image-format.mjs';
|
||||
import '../query.mjs';
|
||||
import '../enums/database-type.mjs';
|
||||
import '../enums/attribute-status.mjs';
|
||||
import '../enums/column-status.mjs';
|
||||
import '../enums/index-status.mjs';
|
||||
import '../enums/deployment-status.mjs';
|
||||
import '../enums/execution-trigger.mjs';
|
||||
import '../enums/execution-status.mjs';
|
||||
import '../enums/health-antivirus-status.mjs';
|
||||
import '../enums/health-check-status.mjs';
|
||||
import '../enums/message-status.mjs';
|
||||
|
||||
declare class Storage {
|
||||
client: Client;
|
||||
constructor(client: Client);
|
||||
/**
|
||||
* Get a list of all the storage buckets. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus, transformations
|
||||
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.BucketList>}
|
||||
*/
|
||||
listBuckets(params?: {
|
||||
queries?: string[];
|
||||
search?: string;
|
||||
total?: boolean;
|
||||
}): Promise<Models.BucketList>;
|
||||
/**
|
||||
* Get a list of all the storage buckets. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus, transformations
|
||||
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.BucketList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
listBuckets(queries?: string[], search?: string, total?: boolean): Promise<Models.BucketList>;
|
||||
/**
|
||||
* Create a new storage bucket.
|
||||
*
|
||||
* @param {string} params.bucketId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
||||
* @param {string} params.name - Bucket name
|
||||
* @param {string[]} params.permissions - An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @param {boolean} params.fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @param {boolean} params.enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.
|
||||
* @param {number} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB.
|
||||
* @param {string[]} params.allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
|
||||
* @param {Compression} params.compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
|
||||
* @param {boolean} params.encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
|
||||
* @param {boolean} params.antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
|
||||
* @param {boolean} params.transformations - Are image transformations enabled?
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Bucket>}
|
||||
*/
|
||||
createBucket(params: {
|
||||
bucketId: string;
|
||||
name: string;
|
||||
permissions?: string[];
|
||||
fileSecurity?: boolean;
|
||||
enabled?: boolean;
|
||||
maximumFileSize?: number;
|
||||
allowedFileExtensions?: string[];
|
||||
compression?: Compression;
|
||||
encryption?: boolean;
|
||||
antivirus?: boolean;
|
||||
transformations?: boolean;
|
||||
}): Promise<Models.Bucket>;
|
||||
/**
|
||||
* Create a new storage bucket.
|
||||
*
|
||||
* @param {string} bucketId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
||||
* @param {string} name - Bucket name
|
||||
* @param {string[]} permissions - An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @param {boolean} fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @param {boolean} enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.
|
||||
* @param {number} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB.
|
||||
* @param {string[]} allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
|
||||
* @param {Compression} compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
|
||||
* @param {boolean} encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
|
||||
* @param {boolean} antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
|
||||
* @param {boolean} transformations - Are image transformations enabled?
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Bucket>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean): Promise<Models.Bucket>;
|
||||
/**
|
||||
* Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.
|
||||
*
|
||||
* @param {string} params.bucketId - Bucket unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Bucket>}
|
||||
*/
|
||||
getBucket(params: {
|
||||
bucketId: string;
|
||||
}): Promise<Models.Bucket>;
|
||||
/**
|
||||
* Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.
|
||||
*
|
||||
* @param {string} bucketId - Bucket unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Bucket>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getBucket(bucketId: string): Promise<Models.Bucket>;
|
||||
/**
|
||||
* Update a storage bucket by its unique ID.
|
||||
*
|
||||
* @param {string} params.bucketId - Bucket unique ID.
|
||||
* @param {string} params.name - Bucket name
|
||||
* @param {string[]} params.permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @param {boolean} params.fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @param {boolean} params.enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.
|
||||
* @param {number} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB.
|
||||
* @param {string[]} params.allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
|
||||
* @param {Compression} params.compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
|
||||
* @param {boolean} params.encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
|
||||
* @param {boolean} params.antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
|
||||
* @param {boolean} params.transformations - Are image transformations enabled?
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Bucket>}
|
||||
*/
|
||||
updateBucket(params: {
|
||||
bucketId: string;
|
||||
name: string;
|
||||
permissions?: string[];
|
||||
fileSecurity?: boolean;
|
||||
enabled?: boolean;
|
||||
maximumFileSize?: number;
|
||||
allowedFileExtensions?: string[];
|
||||
compression?: Compression;
|
||||
encryption?: boolean;
|
||||
antivirus?: boolean;
|
||||
transformations?: boolean;
|
||||
}): Promise<Models.Bucket>;
|
||||
/**
|
||||
* Update a storage bucket by its unique ID.
|
||||
*
|
||||
* @param {string} bucketId - Bucket unique ID.
|
||||
* @param {string} name - Bucket name
|
||||
* @param {string[]} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @param {boolean} fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @param {boolean} enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.
|
||||
* @param {number} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB.
|
||||
* @param {string[]} allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
|
||||
* @param {Compression} compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
|
||||
* @param {boolean} encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
|
||||
* @param {boolean} antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
|
||||
* @param {boolean} transformations - Are image transformations enabled?
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Bucket>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updateBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean): Promise<Models.Bucket>;
|
||||
/**
|
||||
* Delete a storage bucket by its unique ID.
|
||||
*
|
||||
* @param {string} params.bucketId - Bucket unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
deleteBucket(params: {
|
||||
bucketId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a storage bucket by its unique ID.
|
||||
*
|
||||
* @param {string} bucketId - Bucket unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
deleteBucket(bucketId: string): Promise<{}>;
|
||||
/**
|
||||
* Get a list of all the user files. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded
|
||||
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.FileList>}
|
||||
*/
|
||||
listFiles(params: {
|
||||
bucketId: string;
|
||||
queries?: string[];
|
||||
search?: string;
|
||||
total?: boolean;
|
||||
}): Promise<Models.FileList>;
|
||||
/**
|
||||
* Get a list of all the user files. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded
|
||||
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.FileList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
listFiles(bucketId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.FileList>;
|
||||
/**
|
||||
* Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appwrite.io/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console.
|
||||
*
|
||||
* Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.
|
||||
*
|
||||
* When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.
|
||||
*
|
||||
* If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.
|
||||
*
|
||||
*
|
||||
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} params.fileId - File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
||||
* @param {File} params.file - Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file).
|
||||
* @param {string[]} params.permissions - An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.File>}
|
||||
*/
|
||||
createFile(params: {
|
||||
bucketId: string;
|
||||
fileId: string;
|
||||
file: File;
|
||||
permissions?: string[];
|
||||
onProgress?: (progress: UploadProgress) => void;
|
||||
}): Promise<Models.File>;
|
||||
/**
|
||||
* Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appwrite.io/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console.
|
||||
*
|
||||
* Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.
|
||||
*
|
||||
* When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.
|
||||
*
|
||||
* If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.
|
||||
*
|
||||
*
|
||||
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} fileId - File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
||||
* @param {File} file - Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file).
|
||||
* @param {string[]} permissions - An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.File>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createFile(bucketId: string, fileId: string, file: File, permissions?: string[], onProgress?: (progress: UploadProgress) => void): Promise<Models.File>;
|
||||
/**
|
||||
* Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.
|
||||
*
|
||||
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} params.fileId - File ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.File>}
|
||||
*/
|
||||
getFile(params: {
|
||||
bucketId: string;
|
||||
fileId: string;
|
||||
}): Promise<Models.File>;
|
||||
/**
|
||||
* Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.
|
||||
*
|
||||
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} fileId - File ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.File>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getFile(bucketId: string, fileId: string): Promise<Models.File>;
|
||||
/**
|
||||
* Update a file by its unique ID. Only users with write permissions have access to update this resource.
|
||||
*
|
||||
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} params.fileId - File unique ID.
|
||||
* @param {string} params.name - Name of the file
|
||||
* @param {string[]} params.permissions - An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.File>}
|
||||
*/
|
||||
updateFile(params: {
|
||||
bucketId: string;
|
||||
fileId: string;
|
||||
name?: string;
|
||||
permissions?: string[];
|
||||
}): Promise<Models.File>;
|
||||
/**
|
||||
* Update a file by its unique ID. Only users with write permissions have access to update this resource.
|
||||
*
|
||||
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} fileId - File unique ID.
|
||||
* @param {string} name - Name of the file
|
||||
* @param {string[]} permissions - An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.File>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updateFile(bucketId: string, fileId: string, name?: string, permissions?: string[]): Promise<Models.File>;
|
||||
/**
|
||||
* Delete a file by its unique ID. Only users with write permissions have access to delete this resource.
|
||||
*
|
||||
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} params.fileId - File ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
deleteFile(params: {
|
||||
bucketId: string;
|
||||
fileId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a file by its unique ID. Only users with write permissions have access to delete this resource.
|
||||
*
|
||||
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} fileId - File ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
deleteFile(bucketId: string, fileId: string): Promise<{}>;
|
||||
/**
|
||||
* Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
|
||||
*
|
||||
* @param {string} params.bucketId - Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} params.fileId - File ID.
|
||||
* @param {string} params.token - File token for accessing this file.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getFileDownload(params: {
|
||||
bucketId: string;
|
||||
fileId: string;
|
||||
token?: string;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
|
||||
*
|
||||
* @param {string} bucketId - Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} fileId - File ID.
|
||||
* @param {string} token - File token for accessing this file.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getFileDownload(bucketId: string, fileId: string, token?: string): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.
|
||||
*
|
||||
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} params.fileId - File ID
|
||||
* @param {number} params.width - Resize preview image width, Pass an integer between 0 to 4000.
|
||||
* @param {number} params.height - Resize preview image height, Pass an integer between 0 to 4000.
|
||||
* @param {ImageGravity} params.gravity - Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right
|
||||
* @param {number} params.quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
||||
* @param {number} params.borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.
|
||||
* @param {string} params.borderColor - Preview image border color. Use a valid HEX color, no # is needed for prefix.
|
||||
* @param {number} params.borderRadius - Preview image border radius in pixels. Pass an integer between 0 to 4000.
|
||||
* @param {number} params.opacity - Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.
|
||||
* @param {number} params.rotation - Preview image rotation in degrees. Pass an integer between -360 and 360.
|
||||
* @param {string} params.background - Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.
|
||||
* @param {ImageFormat} params.output - Output format type (jpeg, jpg, png, gif and webp).
|
||||
* @param {string} params.token - File token for accessing this file.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getFilePreview(params: {
|
||||
bucketId: string;
|
||||
fileId: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
gravity?: ImageGravity;
|
||||
quality?: number;
|
||||
borderWidth?: number;
|
||||
borderColor?: string;
|
||||
borderRadius?: number;
|
||||
opacity?: number;
|
||||
rotation?: number;
|
||||
background?: string;
|
||||
output?: ImageFormat;
|
||||
token?: string;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.
|
||||
*
|
||||
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} fileId - File ID
|
||||
* @param {number} width - Resize preview image width, Pass an integer between 0 to 4000.
|
||||
* @param {number} height - Resize preview image height, Pass an integer between 0 to 4000.
|
||||
* @param {ImageGravity} gravity - Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right
|
||||
* @param {number} quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
||||
* @param {number} borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.
|
||||
* @param {string} borderColor - Preview image border color. Use a valid HEX color, no # is needed for prefix.
|
||||
* @param {number} borderRadius - Preview image border radius in pixels. Pass an integer between 0 to 4000.
|
||||
* @param {number} opacity - Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.
|
||||
* @param {number} rotation - Preview image rotation in degrees. Pass an integer between -360 and 360.
|
||||
* @param {string} background - Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.
|
||||
* @param {ImageFormat} output - Output format type (jpeg, jpg, png, gif and webp).
|
||||
* @param {string} token - File token for accessing this file.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getFilePreview(bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.
|
||||
*
|
||||
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} params.fileId - File ID.
|
||||
* @param {string} params.token - File token for accessing this file.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getFileView(params: {
|
||||
bucketId: string;
|
||||
fileId: string;
|
||||
token?: string;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.
|
||||
*
|
||||
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} fileId - File ID.
|
||||
* @param {string} token - File token for accessing this file.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getFileView(bucketId: string, fileId: string, token?: string): Promise<ArrayBuffer>;
|
||||
}
|
||||
|
||||
export { Storage };
|
||||
435
server/node_modules/node-appwrite/dist/services/storage.d.ts
generated
vendored
Normal file
435
server/node_modules/node-appwrite/dist/services/storage.d.ts
generated
vendored
Normal file
@@ -0,0 +1,435 @@
|
||||
import { Client, UploadProgress } from '../client.js';
|
||||
import { Models } from '../models.js';
|
||||
import { Compression } from '../enums/compression.js';
|
||||
import { ImageGravity } from '../enums/image-gravity.js';
|
||||
import { ImageFormat } from '../enums/image-format.js';
|
||||
import '../query.js';
|
||||
import '../enums/database-type.js';
|
||||
import '../enums/attribute-status.js';
|
||||
import '../enums/column-status.js';
|
||||
import '../enums/index-status.js';
|
||||
import '../enums/deployment-status.js';
|
||||
import '../enums/execution-trigger.js';
|
||||
import '../enums/execution-status.js';
|
||||
import '../enums/health-antivirus-status.js';
|
||||
import '../enums/health-check-status.js';
|
||||
import '../enums/message-status.js';
|
||||
|
||||
declare class Storage {
|
||||
client: Client;
|
||||
constructor(client: Client);
|
||||
/**
|
||||
* Get a list of all the storage buckets. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus, transformations
|
||||
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.BucketList>}
|
||||
*/
|
||||
listBuckets(params?: {
|
||||
queries?: string[];
|
||||
search?: string;
|
||||
total?: boolean;
|
||||
}): Promise<Models.BucketList>;
|
||||
/**
|
||||
* Get a list of all the storage buckets. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus, transformations
|
||||
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.BucketList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
listBuckets(queries?: string[], search?: string, total?: boolean): Promise<Models.BucketList>;
|
||||
/**
|
||||
* Create a new storage bucket.
|
||||
*
|
||||
* @param {string} params.bucketId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
||||
* @param {string} params.name - Bucket name
|
||||
* @param {string[]} params.permissions - An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @param {boolean} params.fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @param {boolean} params.enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.
|
||||
* @param {number} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB.
|
||||
* @param {string[]} params.allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
|
||||
* @param {Compression} params.compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
|
||||
* @param {boolean} params.encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
|
||||
* @param {boolean} params.antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
|
||||
* @param {boolean} params.transformations - Are image transformations enabled?
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Bucket>}
|
||||
*/
|
||||
createBucket(params: {
|
||||
bucketId: string;
|
||||
name: string;
|
||||
permissions?: string[];
|
||||
fileSecurity?: boolean;
|
||||
enabled?: boolean;
|
||||
maximumFileSize?: number;
|
||||
allowedFileExtensions?: string[];
|
||||
compression?: Compression;
|
||||
encryption?: boolean;
|
||||
antivirus?: boolean;
|
||||
transformations?: boolean;
|
||||
}): Promise<Models.Bucket>;
|
||||
/**
|
||||
* Create a new storage bucket.
|
||||
*
|
||||
* @param {string} bucketId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
||||
* @param {string} name - Bucket name
|
||||
* @param {string[]} permissions - An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @param {boolean} fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @param {boolean} enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.
|
||||
* @param {number} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB.
|
||||
* @param {string[]} allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
|
||||
* @param {Compression} compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
|
||||
* @param {boolean} encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
|
||||
* @param {boolean} antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
|
||||
* @param {boolean} transformations - Are image transformations enabled?
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Bucket>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean): Promise<Models.Bucket>;
|
||||
/**
|
||||
* Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.
|
||||
*
|
||||
* @param {string} params.bucketId - Bucket unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Bucket>}
|
||||
*/
|
||||
getBucket(params: {
|
||||
bucketId: string;
|
||||
}): Promise<Models.Bucket>;
|
||||
/**
|
||||
* Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.
|
||||
*
|
||||
* @param {string} bucketId - Bucket unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Bucket>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getBucket(bucketId: string): Promise<Models.Bucket>;
|
||||
/**
|
||||
* Update a storage bucket by its unique ID.
|
||||
*
|
||||
* @param {string} params.bucketId - Bucket unique ID.
|
||||
* @param {string} params.name - Bucket name
|
||||
* @param {string[]} params.permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @param {boolean} params.fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @param {boolean} params.enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.
|
||||
* @param {number} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB.
|
||||
* @param {string[]} params.allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
|
||||
* @param {Compression} params.compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
|
||||
* @param {boolean} params.encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
|
||||
* @param {boolean} params.antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
|
||||
* @param {boolean} params.transformations - Are image transformations enabled?
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Bucket>}
|
||||
*/
|
||||
updateBucket(params: {
|
||||
bucketId: string;
|
||||
name: string;
|
||||
permissions?: string[];
|
||||
fileSecurity?: boolean;
|
||||
enabled?: boolean;
|
||||
maximumFileSize?: number;
|
||||
allowedFileExtensions?: string[];
|
||||
compression?: Compression;
|
||||
encryption?: boolean;
|
||||
antivirus?: boolean;
|
||||
transformations?: boolean;
|
||||
}): Promise<Models.Bucket>;
|
||||
/**
|
||||
* Update a storage bucket by its unique ID.
|
||||
*
|
||||
* @param {string} bucketId - Bucket unique ID.
|
||||
* @param {string} name - Bucket name
|
||||
* @param {string[]} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @param {boolean} fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @param {boolean} enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.
|
||||
* @param {number} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB.
|
||||
* @param {string[]} allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
|
||||
* @param {Compression} compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
|
||||
* @param {boolean} encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
|
||||
* @param {boolean} antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
|
||||
* @param {boolean} transformations - Are image transformations enabled?
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Bucket>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updateBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean): Promise<Models.Bucket>;
|
||||
/**
|
||||
* Delete a storage bucket by its unique ID.
|
||||
*
|
||||
* @param {string} params.bucketId - Bucket unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
deleteBucket(params: {
|
||||
bucketId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a storage bucket by its unique ID.
|
||||
*
|
||||
* @param {string} bucketId - Bucket unique ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
deleteBucket(bucketId: string): Promise<{}>;
|
||||
/**
|
||||
* Get a list of all the user files. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded
|
||||
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.FileList>}
|
||||
*/
|
||||
listFiles(params: {
|
||||
bucketId: string;
|
||||
queries?: string[];
|
||||
search?: string;
|
||||
total?: boolean;
|
||||
}): Promise<Models.FileList>;
|
||||
/**
|
||||
* Get a list of all the user files. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded
|
||||
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.FileList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
listFiles(bucketId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.FileList>;
|
||||
/**
|
||||
* Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appwrite.io/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console.
|
||||
*
|
||||
* Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.
|
||||
*
|
||||
* When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.
|
||||
*
|
||||
* If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.
|
||||
*
|
||||
*
|
||||
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} params.fileId - File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
||||
* @param {File} params.file - Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file).
|
||||
* @param {string[]} params.permissions - An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.File>}
|
||||
*/
|
||||
createFile(params: {
|
||||
bucketId: string;
|
||||
fileId: string;
|
||||
file: File;
|
||||
permissions?: string[];
|
||||
onProgress?: (progress: UploadProgress) => void;
|
||||
}): Promise<Models.File>;
|
||||
/**
|
||||
* Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appwrite.io/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console.
|
||||
*
|
||||
* Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.
|
||||
*
|
||||
* When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.
|
||||
*
|
||||
* If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.
|
||||
*
|
||||
*
|
||||
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} fileId - File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
||||
* @param {File} file - Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file).
|
||||
* @param {string[]} permissions - An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.File>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createFile(bucketId: string, fileId: string, file: File, permissions?: string[], onProgress?: (progress: UploadProgress) => void): Promise<Models.File>;
|
||||
/**
|
||||
* Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.
|
||||
*
|
||||
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} params.fileId - File ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.File>}
|
||||
*/
|
||||
getFile(params: {
|
||||
bucketId: string;
|
||||
fileId: string;
|
||||
}): Promise<Models.File>;
|
||||
/**
|
||||
* Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.
|
||||
*
|
||||
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} fileId - File ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.File>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getFile(bucketId: string, fileId: string): Promise<Models.File>;
|
||||
/**
|
||||
* Update a file by its unique ID. Only users with write permissions have access to update this resource.
|
||||
*
|
||||
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} params.fileId - File unique ID.
|
||||
* @param {string} params.name - Name of the file
|
||||
* @param {string[]} params.permissions - An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.File>}
|
||||
*/
|
||||
updateFile(params: {
|
||||
bucketId: string;
|
||||
fileId: string;
|
||||
name?: string;
|
||||
permissions?: string[];
|
||||
}): Promise<Models.File>;
|
||||
/**
|
||||
* Update a file by its unique ID. Only users with write permissions have access to update this resource.
|
||||
*
|
||||
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} fileId - File unique ID.
|
||||
* @param {string} name - Name of the file
|
||||
* @param {string[]} permissions - An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.File>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updateFile(bucketId: string, fileId: string, name?: string, permissions?: string[]): Promise<Models.File>;
|
||||
/**
|
||||
* Delete a file by its unique ID. Only users with write permissions have access to delete this resource.
|
||||
*
|
||||
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} params.fileId - File ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
deleteFile(params: {
|
||||
bucketId: string;
|
||||
fileId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a file by its unique ID. Only users with write permissions have access to delete this resource.
|
||||
*
|
||||
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} fileId - File ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
deleteFile(bucketId: string, fileId: string): Promise<{}>;
|
||||
/**
|
||||
* Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
|
||||
*
|
||||
* @param {string} params.bucketId - Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} params.fileId - File ID.
|
||||
* @param {string} params.token - File token for accessing this file.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getFileDownload(params: {
|
||||
bucketId: string;
|
||||
fileId: string;
|
||||
token?: string;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
|
||||
*
|
||||
* @param {string} bucketId - Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} fileId - File ID.
|
||||
* @param {string} token - File token for accessing this file.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getFileDownload(bucketId: string, fileId: string, token?: string): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.
|
||||
*
|
||||
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} params.fileId - File ID
|
||||
* @param {number} params.width - Resize preview image width, Pass an integer between 0 to 4000.
|
||||
* @param {number} params.height - Resize preview image height, Pass an integer between 0 to 4000.
|
||||
* @param {ImageGravity} params.gravity - Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right
|
||||
* @param {number} params.quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
||||
* @param {number} params.borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.
|
||||
* @param {string} params.borderColor - Preview image border color. Use a valid HEX color, no # is needed for prefix.
|
||||
* @param {number} params.borderRadius - Preview image border radius in pixels. Pass an integer between 0 to 4000.
|
||||
* @param {number} params.opacity - Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.
|
||||
* @param {number} params.rotation - Preview image rotation in degrees. Pass an integer between -360 and 360.
|
||||
* @param {string} params.background - Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.
|
||||
* @param {ImageFormat} params.output - Output format type (jpeg, jpg, png, gif and webp).
|
||||
* @param {string} params.token - File token for accessing this file.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getFilePreview(params: {
|
||||
bucketId: string;
|
||||
fileId: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
gravity?: ImageGravity;
|
||||
quality?: number;
|
||||
borderWidth?: number;
|
||||
borderColor?: string;
|
||||
borderRadius?: number;
|
||||
opacity?: number;
|
||||
rotation?: number;
|
||||
background?: string;
|
||||
output?: ImageFormat;
|
||||
token?: string;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.
|
||||
*
|
||||
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} fileId - File ID
|
||||
* @param {number} width - Resize preview image width, Pass an integer between 0 to 4000.
|
||||
* @param {number} height - Resize preview image height, Pass an integer between 0 to 4000.
|
||||
* @param {ImageGravity} gravity - Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right
|
||||
* @param {number} quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
||||
* @param {number} borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.
|
||||
* @param {string} borderColor - Preview image border color. Use a valid HEX color, no # is needed for prefix.
|
||||
* @param {number} borderRadius - Preview image border radius in pixels. Pass an integer between 0 to 4000.
|
||||
* @param {number} opacity - Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.
|
||||
* @param {number} rotation - Preview image rotation in degrees. Pass an integer between -360 and 360.
|
||||
* @param {string} background - Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.
|
||||
* @param {ImageFormat} output - Output format type (jpeg, jpg, png, gif and webp).
|
||||
* @param {string} token - File token for accessing this file.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getFilePreview(bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.
|
||||
*
|
||||
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} params.fileId - File ID.
|
||||
* @param {string} params.token - File token for accessing this file.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
getFileView(params: {
|
||||
bucketId: string;
|
||||
fileId: string;
|
||||
token?: string;
|
||||
}): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.
|
||||
*
|
||||
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} fileId - File ID.
|
||||
* @param {string} token - File token for accessing this file.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getFileView(bucketId: string, fileId: string, token?: string): Promise<ArrayBuffer>;
|
||||
}
|
||||
|
||||
export { Storage };
|
||||
609
server/node_modules/node-appwrite/dist/services/storage.js
generated
vendored
Normal file
609
server/node_modules/node-appwrite/dist/services/storage.js
generated
vendored
Normal file
@@ -0,0 +1,609 @@
|
||||
'use strict';
|
||||
|
||||
var client = require('../client');
|
||||
|
||||
class Storage {
|
||||
constructor(client) {
|
||||
this.client = client;
|
||||
}
|
||||
listBuckets(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
queries: paramsOrFirst,
|
||||
search: rest[0],
|
||||
total: rest[1]
|
||||
};
|
||||
}
|
||||
const queries = params.queries;
|
||||
const search = params.search;
|
||||
const total = params.total;
|
||||
const apiPath = "/storage/buckets";
|
||||
const payload = {};
|
||||
if (typeof queries !== "undefined") {
|
||||
payload["queries"] = queries;
|
||||
}
|
||||
if (typeof search !== "undefined") {
|
||||
payload["search"] = search;
|
||||
}
|
||||
if (typeof total !== "undefined") {
|
||||
payload["total"] = total;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
createBucket(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
name: rest[0],
|
||||
permissions: rest[1],
|
||||
fileSecurity: rest[2],
|
||||
enabled: rest[3],
|
||||
maximumFileSize: rest[4],
|
||||
allowedFileExtensions: rest[5],
|
||||
compression: rest[6],
|
||||
encryption: rest[7],
|
||||
antivirus: rest[8],
|
||||
transformations: rest[9]
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const name = params.name;
|
||||
const permissions = params.permissions;
|
||||
const fileSecurity = params.fileSecurity;
|
||||
const enabled = params.enabled;
|
||||
const maximumFileSize = params.maximumFileSize;
|
||||
const allowedFileExtensions = params.allowedFileExtensions;
|
||||
const compression = params.compression;
|
||||
const encryption = params.encryption;
|
||||
const antivirus = params.antivirus;
|
||||
const transformations = params.transformations;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
if (typeof name === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "name"');
|
||||
}
|
||||
const apiPath = "/storage/buckets";
|
||||
const payload = {};
|
||||
if (typeof bucketId !== "undefined") {
|
||||
payload["bucketId"] = bucketId;
|
||||
}
|
||||
if (typeof name !== "undefined") {
|
||||
payload["name"] = name;
|
||||
}
|
||||
if (typeof permissions !== "undefined") {
|
||||
payload["permissions"] = permissions;
|
||||
}
|
||||
if (typeof fileSecurity !== "undefined") {
|
||||
payload["fileSecurity"] = fileSecurity;
|
||||
}
|
||||
if (typeof enabled !== "undefined") {
|
||||
payload["enabled"] = enabled;
|
||||
}
|
||||
if (typeof maximumFileSize !== "undefined") {
|
||||
payload["maximumFileSize"] = maximumFileSize;
|
||||
}
|
||||
if (typeof allowedFileExtensions !== "undefined") {
|
||||
payload["allowedFileExtensions"] = allowedFileExtensions;
|
||||
}
|
||||
if (typeof compression !== "undefined") {
|
||||
payload["compression"] = compression;
|
||||
}
|
||||
if (typeof encryption !== "undefined") {
|
||||
payload["encryption"] = encryption;
|
||||
}
|
||||
if (typeof antivirus !== "undefined") {
|
||||
payload["antivirus"] = antivirus;
|
||||
}
|
||||
if (typeof transformations !== "undefined") {
|
||||
payload["transformations"] = transformations;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"post",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getBucket(paramsOrFirst) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
const apiPath = "/storage/buckets/{bucketId}".replace("{bucketId}", bucketId);
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
updateBucket(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
name: rest[0],
|
||||
permissions: rest[1],
|
||||
fileSecurity: rest[2],
|
||||
enabled: rest[3],
|
||||
maximumFileSize: rest[4],
|
||||
allowedFileExtensions: rest[5],
|
||||
compression: rest[6],
|
||||
encryption: rest[7],
|
||||
antivirus: rest[8],
|
||||
transformations: rest[9]
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const name = params.name;
|
||||
const permissions = params.permissions;
|
||||
const fileSecurity = params.fileSecurity;
|
||||
const enabled = params.enabled;
|
||||
const maximumFileSize = params.maximumFileSize;
|
||||
const allowedFileExtensions = params.allowedFileExtensions;
|
||||
const compression = params.compression;
|
||||
const encryption = params.encryption;
|
||||
const antivirus = params.antivirus;
|
||||
const transformations = params.transformations;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
if (typeof name === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "name"');
|
||||
}
|
||||
const apiPath = "/storage/buckets/{bucketId}".replace("{bucketId}", bucketId);
|
||||
const payload = {};
|
||||
if (typeof name !== "undefined") {
|
||||
payload["name"] = name;
|
||||
}
|
||||
if (typeof permissions !== "undefined") {
|
||||
payload["permissions"] = permissions;
|
||||
}
|
||||
if (typeof fileSecurity !== "undefined") {
|
||||
payload["fileSecurity"] = fileSecurity;
|
||||
}
|
||||
if (typeof enabled !== "undefined") {
|
||||
payload["enabled"] = enabled;
|
||||
}
|
||||
if (typeof maximumFileSize !== "undefined") {
|
||||
payload["maximumFileSize"] = maximumFileSize;
|
||||
}
|
||||
if (typeof allowedFileExtensions !== "undefined") {
|
||||
payload["allowedFileExtensions"] = allowedFileExtensions;
|
||||
}
|
||||
if (typeof compression !== "undefined") {
|
||||
payload["compression"] = compression;
|
||||
}
|
||||
if (typeof encryption !== "undefined") {
|
||||
payload["encryption"] = encryption;
|
||||
}
|
||||
if (typeof antivirus !== "undefined") {
|
||||
payload["antivirus"] = antivirus;
|
||||
}
|
||||
if (typeof transformations !== "undefined") {
|
||||
payload["transformations"] = transformations;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"put",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
deleteBucket(paramsOrFirst) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
const apiPath = "/storage/buckets/{bucketId}".replace("{bucketId}", bucketId);
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"delete",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
listFiles(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
queries: rest[0],
|
||||
search: rest[1],
|
||||
total: rest[2]
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const queries = params.queries;
|
||||
const search = params.search;
|
||||
const total = params.total;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
const apiPath = "/storage/buckets/{bucketId}/files".replace("{bucketId}", bucketId);
|
||||
const payload = {};
|
||||
if (typeof queries !== "undefined") {
|
||||
payload["queries"] = queries;
|
||||
}
|
||||
if (typeof search !== "undefined") {
|
||||
payload["search"] = search;
|
||||
}
|
||||
if (typeof total !== "undefined") {
|
||||
payload["total"] = total;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
createFile(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
let onProgress;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
onProgress = paramsOrFirst == null ? void 0 : paramsOrFirst.onProgress;
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
fileId: rest[0],
|
||||
file: rest[1],
|
||||
permissions: rest[2]
|
||||
};
|
||||
onProgress = rest[3];
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const fileId = params.fileId;
|
||||
const file = params.file;
|
||||
const permissions = params.permissions;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
if (typeof fileId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "fileId"');
|
||||
}
|
||||
if (typeof file === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "file"');
|
||||
}
|
||||
const apiPath = "/storage/buckets/{bucketId}/files".replace("{bucketId}", bucketId);
|
||||
const payload = {};
|
||||
if (typeof fileId !== "undefined") {
|
||||
payload["fileId"] = fileId;
|
||||
}
|
||||
if (typeof file !== "undefined") {
|
||||
payload["file"] = file;
|
||||
}
|
||||
if (typeof permissions !== "undefined") {
|
||||
payload["permissions"] = permissions;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "multipart/form-data"
|
||||
};
|
||||
return this.client.chunkedUpload(
|
||||
"post",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
onProgress
|
||||
);
|
||||
}
|
||||
getFile(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
fileId: rest[0]
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const fileId = params.fileId;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
if (typeof fileId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "fileId"');
|
||||
}
|
||||
const apiPath = "/storage/buckets/{bucketId}/files/{fileId}".replace("{bucketId}", bucketId).replace("{fileId}", fileId);
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
updateFile(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
fileId: rest[0],
|
||||
name: rest[1],
|
||||
permissions: rest[2]
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const fileId = params.fileId;
|
||||
const name = params.name;
|
||||
const permissions = params.permissions;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
if (typeof fileId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "fileId"');
|
||||
}
|
||||
const apiPath = "/storage/buckets/{bucketId}/files/{fileId}".replace("{bucketId}", bucketId).replace("{fileId}", fileId);
|
||||
const payload = {};
|
||||
if (typeof name !== "undefined") {
|
||||
payload["name"] = name;
|
||||
}
|
||||
if (typeof permissions !== "undefined") {
|
||||
payload["permissions"] = permissions;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"put",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
deleteFile(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
fileId: rest[0]
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const fileId = params.fileId;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
if (typeof fileId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "fileId"');
|
||||
}
|
||||
const apiPath = "/storage/buckets/{bucketId}/files/{fileId}".replace("{bucketId}", bucketId).replace("{fileId}", fileId);
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"delete",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getFileDownload(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
fileId: rest[0],
|
||||
token: rest[1]
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const fileId = params.fileId;
|
||||
const token = params.token;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
if (typeof fileId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "fileId"');
|
||||
}
|
||||
const apiPath = "/storage/buckets/{bucketId}/files/{fileId}/download".replace("{bucketId}", bucketId).replace("{fileId}", fileId);
|
||||
const payload = {};
|
||||
if (typeof token !== "undefined") {
|
||||
payload["token"] = token;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
"arrayBuffer"
|
||||
);
|
||||
}
|
||||
getFilePreview(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
fileId: rest[0],
|
||||
width: rest[1],
|
||||
height: rest[2],
|
||||
gravity: rest[3],
|
||||
quality: rest[4],
|
||||
borderWidth: rest[5],
|
||||
borderColor: rest[6],
|
||||
borderRadius: rest[7],
|
||||
opacity: rest[8],
|
||||
rotation: rest[9],
|
||||
background: rest[10],
|
||||
output: rest[11],
|
||||
token: rest[12]
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const fileId = params.fileId;
|
||||
const width = params.width;
|
||||
const height = params.height;
|
||||
const gravity = params.gravity;
|
||||
const quality = params.quality;
|
||||
const borderWidth = params.borderWidth;
|
||||
const borderColor = params.borderColor;
|
||||
const borderRadius = params.borderRadius;
|
||||
const opacity = params.opacity;
|
||||
const rotation = params.rotation;
|
||||
const background = params.background;
|
||||
const output = params.output;
|
||||
const token = params.token;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
if (typeof fileId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "fileId"');
|
||||
}
|
||||
const apiPath = "/storage/buckets/{bucketId}/files/{fileId}/preview".replace("{bucketId}", bucketId).replace("{fileId}", fileId);
|
||||
const payload = {};
|
||||
if (typeof width !== "undefined") {
|
||||
payload["width"] = width;
|
||||
}
|
||||
if (typeof height !== "undefined") {
|
||||
payload["height"] = height;
|
||||
}
|
||||
if (typeof gravity !== "undefined") {
|
||||
payload["gravity"] = gravity;
|
||||
}
|
||||
if (typeof quality !== "undefined") {
|
||||
payload["quality"] = quality;
|
||||
}
|
||||
if (typeof borderWidth !== "undefined") {
|
||||
payload["borderWidth"] = borderWidth;
|
||||
}
|
||||
if (typeof borderColor !== "undefined") {
|
||||
payload["borderColor"] = borderColor;
|
||||
}
|
||||
if (typeof borderRadius !== "undefined") {
|
||||
payload["borderRadius"] = borderRadius;
|
||||
}
|
||||
if (typeof opacity !== "undefined") {
|
||||
payload["opacity"] = opacity;
|
||||
}
|
||||
if (typeof rotation !== "undefined") {
|
||||
payload["rotation"] = rotation;
|
||||
}
|
||||
if (typeof background !== "undefined") {
|
||||
payload["background"] = background;
|
||||
}
|
||||
if (typeof output !== "undefined") {
|
||||
payload["output"] = output;
|
||||
}
|
||||
if (typeof token !== "undefined") {
|
||||
payload["token"] = token;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
"arrayBuffer"
|
||||
);
|
||||
}
|
||||
getFileView(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
fileId: rest[0],
|
||||
token: rest[1]
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const fileId = params.fileId;
|
||||
const token = params.token;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
if (typeof fileId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "fileId"');
|
||||
}
|
||||
const apiPath = "/storage/buckets/{bucketId}/files/{fileId}/view".replace("{bucketId}", bucketId).replace("{fileId}", fileId);
|
||||
const payload = {};
|
||||
if (typeof token !== "undefined") {
|
||||
payload["token"] = token;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
"arrayBuffer"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
exports.Storage = Storage;
|
||||
//# sourceMappingURL=out.js.map
|
||||
//# sourceMappingURL=storage.js.map
|
||||
1
server/node_modules/node-appwrite/dist/services/storage.js.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/storage.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
608
server/node_modules/node-appwrite/dist/services/storage.mjs
generated
vendored
Normal file
608
server/node_modules/node-appwrite/dist/services/storage.mjs
generated
vendored
Normal file
@@ -0,0 +1,608 @@
|
||||
import { AppwriteException } from '../client.mjs';
|
||||
|
||||
// src/services/storage.ts
|
||||
var Storage = class {
|
||||
constructor(client) {
|
||||
this.client = client;
|
||||
}
|
||||
listBuckets(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
queries: paramsOrFirst,
|
||||
search: rest[0],
|
||||
total: rest[1]
|
||||
};
|
||||
}
|
||||
const queries = params.queries;
|
||||
const search = params.search;
|
||||
const total = params.total;
|
||||
const apiPath = "/storage/buckets";
|
||||
const payload = {};
|
||||
if (typeof queries !== "undefined") {
|
||||
payload["queries"] = queries;
|
||||
}
|
||||
if (typeof search !== "undefined") {
|
||||
payload["search"] = search;
|
||||
}
|
||||
if (typeof total !== "undefined") {
|
||||
payload["total"] = total;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
createBucket(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
name: rest[0],
|
||||
permissions: rest[1],
|
||||
fileSecurity: rest[2],
|
||||
enabled: rest[3],
|
||||
maximumFileSize: rest[4],
|
||||
allowedFileExtensions: rest[5],
|
||||
compression: rest[6],
|
||||
encryption: rest[7],
|
||||
antivirus: rest[8],
|
||||
transformations: rest[9]
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const name = params.name;
|
||||
const permissions = params.permissions;
|
||||
const fileSecurity = params.fileSecurity;
|
||||
const enabled = params.enabled;
|
||||
const maximumFileSize = params.maximumFileSize;
|
||||
const allowedFileExtensions = params.allowedFileExtensions;
|
||||
const compression = params.compression;
|
||||
const encryption = params.encryption;
|
||||
const antivirus = params.antivirus;
|
||||
const transformations = params.transformations;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
if (typeof name === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "name"');
|
||||
}
|
||||
const apiPath = "/storage/buckets";
|
||||
const payload = {};
|
||||
if (typeof bucketId !== "undefined") {
|
||||
payload["bucketId"] = bucketId;
|
||||
}
|
||||
if (typeof name !== "undefined") {
|
||||
payload["name"] = name;
|
||||
}
|
||||
if (typeof permissions !== "undefined") {
|
||||
payload["permissions"] = permissions;
|
||||
}
|
||||
if (typeof fileSecurity !== "undefined") {
|
||||
payload["fileSecurity"] = fileSecurity;
|
||||
}
|
||||
if (typeof enabled !== "undefined") {
|
||||
payload["enabled"] = enabled;
|
||||
}
|
||||
if (typeof maximumFileSize !== "undefined") {
|
||||
payload["maximumFileSize"] = maximumFileSize;
|
||||
}
|
||||
if (typeof allowedFileExtensions !== "undefined") {
|
||||
payload["allowedFileExtensions"] = allowedFileExtensions;
|
||||
}
|
||||
if (typeof compression !== "undefined") {
|
||||
payload["compression"] = compression;
|
||||
}
|
||||
if (typeof encryption !== "undefined") {
|
||||
payload["encryption"] = encryption;
|
||||
}
|
||||
if (typeof antivirus !== "undefined") {
|
||||
payload["antivirus"] = antivirus;
|
||||
}
|
||||
if (typeof transformations !== "undefined") {
|
||||
payload["transformations"] = transformations;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"post",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getBucket(paramsOrFirst) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
const apiPath = "/storage/buckets/{bucketId}".replace("{bucketId}", bucketId);
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
updateBucket(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
name: rest[0],
|
||||
permissions: rest[1],
|
||||
fileSecurity: rest[2],
|
||||
enabled: rest[3],
|
||||
maximumFileSize: rest[4],
|
||||
allowedFileExtensions: rest[5],
|
||||
compression: rest[6],
|
||||
encryption: rest[7],
|
||||
antivirus: rest[8],
|
||||
transformations: rest[9]
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const name = params.name;
|
||||
const permissions = params.permissions;
|
||||
const fileSecurity = params.fileSecurity;
|
||||
const enabled = params.enabled;
|
||||
const maximumFileSize = params.maximumFileSize;
|
||||
const allowedFileExtensions = params.allowedFileExtensions;
|
||||
const compression = params.compression;
|
||||
const encryption = params.encryption;
|
||||
const antivirus = params.antivirus;
|
||||
const transformations = params.transformations;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
if (typeof name === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "name"');
|
||||
}
|
||||
const apiPath = "/storage/buckets/{bucketId}".replace("{bucketId}", bucketId);
|
||||
const payload = {};
|
||||
if (typeof name !== "undefined") {
|
||||
payload["name"] = name;
|
||||
}
|
||||
if (typeof permissions !== "undefined") {
|
||||
payload["permissions"] = permissions;
|
||||
}
|
||||
if (typeof fileSecurity !== "undefined") {
|
||||
payload["fileSecurity"] = fileSecurity;
|
||||
}
|
||||
if (typeof enabled !== "undefined") {
|
||||
payload["enabled"] = enabled;
|
||||
}
|
||||
if (typeof maximumFileSize !== "undefined") {
|
||||
payload["maximumFileSize"] = maximumFileSize;
|
||||
}
|
||||
if (typeof allowedFileExtensions !== "undefined") {
|
||||
payload["allowedFileExtensions"] = allowedFileExtensions;
|
||||
}
|
||||
if (typeof compression !== "undefined") {
|
||||
payload["compression"] = compression;
|
||||
}
|
||||
if (typeof encryption !== "undefined") {
|
||||
payload["encryption"] = encryption;
|
||||
}
|
||||
if (typeof antivirus !== "undefined") {
|
||||
payload["antivirus"] = antivirus;
|
||||
}
|
||||
if (typeof transformations !== "undefined") {
|
||||
payload["transformations"] = transformations;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"put",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
deleteBucket(paramsOrFirst) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
const apiPath = "/storage/buckets/{bucketId}".replace("{bucketId}", bucketId);
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"delete",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
listFiles(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
queries: rest[0],
|
||||
search: rest[1],
|
||||
total: rest[2]
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const queries = params.queries;
|
||||
const search = params.search;
|
||||
const total = params.total;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
const apiPath = "/storage/buckets/{bucketId}/files".replace("{bucketId}", bucketId);
|
||||
const payload = {};
|
||||
if (typeof queries !== "undefined") {
|
||||
payload["queries"] = queries;
|
||||
}
|
||||
if (typeof search !== "undefined") {
|
||||
payload["search"] = search;
|
||||
}
|
||||
if (typeof total !== "undefined") {
|
||||
payload["total"] = total;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
createFile(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
let onProgress;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
onProgress = paramsOrFirst == null ? void 0 : paramsOrFirst.onProgress;
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
fileId: rest[0],
|
||||
file: rest[1],
|
||||
permissions: rest[2]
|
||||
};
|
||||
onProgress = rest[3];
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const fileId = params.fileId;
|
||||
const file = params.file;
|
||||
const permissions = params.permissions;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
if (typeof fileId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "fileId"');
|
||||
}
|
||||
if (typeof file === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "file"');
|
||||
}
|
||||
const apiPath = "/storage/buckets/{bucketId}/files".replace("{bucketId}", bucketId);
|
||||
const payload = {};
|
||||
if (typeof fileId !== "undefined") {
|
||||
payload["fileId"] = fileId;
|
||||
}
|
||||
if (typeof file !== "undefined") {
|
||||
payload["file"] = file;
|
||||
}
|
||||
if (typeof permissions !== "undefined") {
|
||||
payload["permissions"] = permissions;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "multipart/form-data"
|
||||
};
|
||||
return this.client.chunkedUpload(
|
||||
"post",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
onProgress
|
||||
);
|
||||
}
|
||||
getFile(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
fileId: rest[0]
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const fileId = params.fileId;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
if (typeof fileId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "fileId"');
|
||||
}
|
||||
const apiPath = "/storage/buckets/{bucketId}/files/{fileId}".replace("{bucketId}", bucketId).replace("{fileId}", fileId);
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
updateFile(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
fileId: rest[0],
|
||||
name: rest[1],
|
||||
permissions: rest[2]
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const fileId = params.fileId;
|
||||
const name = params.name;
|
||||
const permissions = params.permissions;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
if (typeof fileId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "fileId"');
|
||||
}
|
||||
const apiPath = "/storage/buckets/{bucketId}/files/{fileId}".replace("{bucketId}", bucketId).replace("{fileId}", fileId);
|
||||
const payload = {};
|
||||
if (typeof name !== "undefined") {
|
||||
payload["name"] = name;
|
||||
}
|
||||
if (typeof permissions !== "undefined") {
|
||||
payload["permissions"] = permissions;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"put",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
deleteFile(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
fileId: rest[0]
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const fileId = params.fileId;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
if (typeof fileId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "fileId"');
|
||||
}
|
||||
const apiPath = "/storage/buckets/{bucketId}/files/{fileId}".replace("{bucketId}", bucketId).replace("{fileId}", fileId);
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"delete",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getFileDownload(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
fileId: rest[0],
|
||||
token: rest[1]
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const fileId = params.fileId;
|
||||
const token = params.token;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
if (typeof fileId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "fileId"');
|
||||
}
|
||||
const apiPath = "/storage/buckets/{bucketId}/files/{fileId}/download".replace("{bucketId}", bucketId).replace("{fileId}", fileId);
|
||||
const payload = {};
|
||||
if (typeof token !== "undefined") {
|
||||
payload["token"] = token;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
"arrayBuffer"
|
||||
);
|
||||
}
|
||||
getFilePreview(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
fileId: rest[0],
|
||||
width: rest[1],
|
||||
height: rest[2],
|
||||
gravity: rest[3],
|
||||
quality: rest[4],
|
||||
borderWidth: rest[5],
|
||||
borderColor: rest[6],
|
||||
borderRadius: rest[7],
|
||||
opacity: rest[8],
|
||||
rotation: rest[9],
|
||||
background: rest[10],
|
||||
output: rest[11],
|
||||
token: rest[12]
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const fileId = params.fileId;
|
||||
const width = params.width;
|
||||
const height = params.height;
|
||||
const gravity = params.gravity;
|
||||
const quality = params.quality;
|
||||
const borderWidth = params.borderWidth;
|
||||
const borderColor = params.borderColor;
|
||||
const borderRadius = params.borderRadius;
|
||||
const opacity = params.opacity;
|
||||
const rotation = params.rotation;
|
||||
const background = params.background;
|
||||
const output = params.output;
|
||||
const token = params.token;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
if (typeof fileId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "fileId"');
|
||||
}
|
||||
const apiPath = "/storage/buckets/{bucketId}/files/{fileId}/preview".replace("{bucketId}", bucketId).replace("{fileId}", fileId);
|
||||
const payload = {};
|
||||
if (typeof width !== "undefined") {
|
||||
payload["width"] = width;
|
||||
}
|
||||
if (typeof height !== "undefined") {
|
||||
payload["height"] = height;
|
||||
}
|
||||
if (typeof gravity !== "undefined") {
|
||||
payload["gravity"] = gravity;
|
||||
}
|
||||
if (typeof quality !== "undefined") {
|
||||
payload["quality"] = quality;
|
||||
}
|
||||
if (typeof borderWidth !== "undefined") {
|
||||
payload["borderWidth"] = borderWidth;
|
||||
}
|
||||
if (typeof borderColor !== "undefined") {
|
||||
payload["borderColor"] = borderColor;
|
||||
}
|
||||
if (typeof borderRadius !== "undefined") {
|
||||
payload["borderRadius"] = borderRadius;
|
||||
}
|
||||
if (typeof opacity !== "undefined") {
|
||||
payload["opacity"] = opacity;
|
||||
}
|
||||
if (typeof rotation !== "undefined") {
|
||||
payload["rotation"] = rotation;
|
||||
}
|
||||
if (typeof background !== "undefined") {
|
||||
payload["background"] = background;
|
||||
}
|
||||
if (typeof output !== "undefined") {
|
||||
payload["output"] = output;
|
||||
}
|
||||
if (typeof token !== "undefined") {
|
||||
payload["token"] = token;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
"arrayBuffer"
|
||||
);
|
||||
}
|
||||
getFileView(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
fileId: rest[0],
|
||||
token: rest[1]
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const fileId = params.fileId;
|
||||
const token = params.token;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
if (typeof fileId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "fileId"');
|
||||
}
|
||||
const apiPath = "/storage/buckets/{bucketId}/files/{fileId}/view".replace("{bucketId}", bucketId).replace("{fileId}", fileId);
|
||||
const payload = {};
|
||||
if (typeof token !== "undefined") {
|
||||
payload["token"] = token;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload,
|
||||
"arrayBuffer"
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export { Storage };
|
||||
//# sourceMappingURL=out.js.map
|
||||
//# sourceMappingURL=storage.mjs.map
|
||||
1
server/node_modules/node-appwrite/dist/services/storage.mjs.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/storage.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1934
server/node_modules/node-appwrite/dist/services/tables-db.d.mts
generated
vendored
Normal file
1934
server/node_modules/node-appwrite/dist/services/tables-db.d.mts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1934
server/node_modules/node-appwrite/dist/services/tables-db.d.ts
generated
vendored
Normal file
1934
server/node_modules/node-appwrite/dist/services/tables-db.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2954
server/node_modules/node-appwrite/dist/services/tables-db.js
generated
vendored
Normal file
2954
server/node_modules/node-appwrite/dist/services/tables-db.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
server/node_modules/node-appwrite/dist/services/tables-db.js.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/tables-db.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2953
server/node_modules/node-appwrite/dist/services/tables-db.mjs
generated
vendored
Normal file
2953
server/node_modules/node-appwrite/dist/services/tables-db.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
server/node_modules/node-appwrite/dist/services/tables-db.mjs.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/tables-db.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
355
server/node_modules/node-appwrite/dist/services/teams.d.mts
generated
vendored
Normal file
355
server/node_modules/node-appwrite/dist/services/teams.d.mts
generated
vendored
Normal file
@@ -0,0 +1,355 @@
|
||||
import { Client } from '../client.mjs';
|
||||
import { Models } from '../models.mjs';
|
||||
import '../query.mjs';
|
||||
import '../enums/database-type.mjs';
|
||||
import '../enums/attribute-status.mjs';
|
||||
import '../enums/column-status.mjs';
|
||||
import '../enums/index-status.mjs';
|
||||
import '../enums/deployment-status.mjs';
|
||||
import '../enums/execution-trigger.mjs';
|
||||
import '../enums/execution-status.mjs';
|
||||
import '../enums/health-antivirus-status.mjs';
|
||||
import '../enums/health-check-status.mjs';
|
||||
import '../enums/message-status.mjs';
|
||||
|
||||
declare class Teams {
|
||||
client: Client;
|
||||
constructor(client: Client);
|
||||
/**
|
||||
* Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.
|
||||
*
|
||||
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan
|
||||
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.TeamList<Preferences>>}
|
||||
*/
|
||||
list<Preferences extends Models.Preferences = Models.DefaultPreferences>(params?: {
|
||||
queries?: string[];
|
||||
search?: string;
|
||||
total?: boolean;
|
||||
}): Promise<Models.TeamList<Preferences>>;
|
||||
/**
|
||||
* Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.
|
||||
*
|
||||
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan
|
||||
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.TeamList<Preferences>>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
list<Preferences extends Models.Preferences = Models.DefaultPreferences>(queries?: string[], search?: string, total?: boolean): Promise<Models.TeamList<Preferences>>;
|
||||
/**
|
||||
* Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.
|
||||
*
|
||||
* @param {string} params.teamId - Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
||||
* @param {string} params.name - Team name. Max length: 128 chars.
|
||||
* @param {string[]} params.roles - Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Team<Preferences>>}
|
||||
*/
|
||||
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
||||
teamId: string;
|
||||
name: string;
|
||||
roles?: string[];
|
||||
}): Promise<Models.Team<Preferences>>;
|
||||
/**
|
||||
* Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.
|
||||
*
|
||||
* @param {string} teamId - Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
||||
* @param {string} name - Team name. Max length: 128 chars.
|
||||
* @param {string[]} roles - Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Team<Preferences>>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, name: string, roles?: string[]): Promise<Models.Team<Preferences>>;
|
||||
/**
|
||||
* Get a team by its ID. All team members have read access for this resource.
|
||||
*
|
||||
* @param {string} params.teamId - Team ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Team<Preferences>>}
|
||||
*/
|
||||
get<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
||||
teamId: string;
|
||||
}): Promise<Models.Team<Preferences>>;
|
||||
/**
|
||||
* Get a team by its ID. All team members have read access for this resource.
|
||||
*
|
||||
* @param {string} teamId - Team ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Team<Preferences>>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
get<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string): Promise<Models.Team<Preferences>>;
|
||||
/**
|
||||
* Update the team's name by its unique ID.
|
||||
*
|
||||
* @param {string} params.teamId - Team ID.
|
||||
* @param {string} params.name - New team name. Max length: 128 chars.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Team<Preferences>>}
|
||||
*/
|
||||
updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
||||
teamId: string;
|
||||
name: string;
|
||||
}): Promise<Models.Team<Preferences>>;
|
||||
/**
|
||||
* Update the team's name by its unique ID.
|
||||
*
|
||||
* @param {string} teamId - Team ID.
|
||||
* @param {string} name - New team name. Max length: 128 chars.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Team<Preferences>>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, name: string): Promise<Models.Team<Preferences>>;
|
||||
/**
|
||||
* Delete a team using its ID. Only team members with the owner role can delete the team.
|
||||
*
|
||||
* @param {string} params.teamId - Team ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
delete(params: {
|
||||
teamId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a team using its ID. Only team members with the owner role can delete the team.
|
||||
*
|
||||
* @param {string} teamId - Team ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
delete(teamId: string): Promise<{}>;
|
||||
/**
|
||||
* Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.
|
||||
*
|
||||
* @param {string} params.teamId - Team ID.
|
||||
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles
|
||||
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.MembershipList>}
|
||||
*/
|
||||
listMemberships(params: {
|
||||
teamId: string;
|
||||
queries?: string[];
|
||||
search?: string;
|
||||
total?: boolean;
|
||||
}): Promise<Models.MembershipList>;
|
||||
/**
|
||||
* Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.
|
||||
*
|
||||
* @param {string} teamId - Team ID.
|
||||
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles
|
||||
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.MembershipList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
listMemberships(teamId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.MembershipList>;
|
||||
/**
|
||||
* Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.
|
||||
*
|
||||
* You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.
|
||||
*
|
||||
* Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
|
||||
*
|
||||
* Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.
|
||||
*
|
||||
*
|
||||
* @param {string} params.teamId - Team ID.
|
||||
* @param {string[]} params.roles - Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
|
||||
* @param {string} params.email - Email of the new team member.
|
||||
* @param {string} params.userId - ID of the user to be added to a team.
|
||||
* @param {string} params.phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
||||
* @param {string} params.url - URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
||||
* @param {string} params.name - Name of the new team member. Max length: 128 chars.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Membership>}
|
||||
*/
|
||||
createMembership(params: {
|
||||
teamId: string;
|
||||
roles: string[];
|
||||
email?: string;
|
||||
userId?: string;
|
||||
phone?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}): Promise<Models.Membership>;
|
||||
/**
|
||||
* Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.
|
||||
*
|
||||
* You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.
|
||||
*
|
||||
* Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
|
||||
*
|
||||
* Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.
|
||||
*
|
||||
*
|
||||
* @param {string} teamId - Team ID.
|
||||
* @param {string[]} roles - Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
|
||||
* @param {string} email - Email of the new team member.
|
||||
* @param {string} userId - ID of the user to be added to a team.
|
||||
* @param {string} phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
||||
* @param {string} url - URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
||||
* @param {string} name - Name of the new team member. Max length: 128 chars.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Membership>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createMembership(teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise<Models.Membership>;
|
||||
/**
|
||||
* Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.
|
||||
*
|
||||
* @param {string} params.teamId - Team ID.
|
||||
* @param {string} params.membershipId - Membership ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Membership>}
|
||||
*/
|
||||
getMembership(params: {
|
||||
teamId: string;
|
||||
membershipId: string;
|
||||
}): Promise<Models.Membership>;
|
||||
/**
|
||||
* Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.
|
||||
*
|
||||
* @param {string} teamId - Team ID.
|
||||
* @param {string} membershipId - Membership ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Membership>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getMembership(teamId: string, membershipId: string): Promise<Models.Membership>;
|
||||
/**
|
||||
* Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https://appwrite.io/docs/permissions).
|
||||
*
|
||||
*
|
||||
* @param {string} params.teamId - Team ID.
|
||||
* @param {string} params.membershipId - Membership ID.
|
||||
* @param {string[]} params.roles - An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Membership>}
|
||||
*/
|
||||
updateMembership(params: {
|
||||
teamId: string;
|
||||
membershipId: string;
|
||||
roles: string[];
|
||||
}): Promise<Models.Membership>;
|
||||
/**
|
||||
* Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https://appwrite.io/docs/permissions).
|
||||
*
|
||||
*
|
||||
* @param {string} teamId - Team ID.
|
||||
* @param {string} membershipId - Membership ID.
|
||||
* @param {string[]} roles - An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Membership>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updateMembership(teamId: string, membershipId: string, roles: string[]): Promise<Models.Membership>;
|
||||
/**
|
||||
* This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.
|
||||
*
|
||||
* @param {string} params.teamId - Team ID.
|
||||
* @param {string} params.membershipId - Membership ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
deleteMembership(params: {
|
||||
teamId: string;
|
||||
membershipId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.
|
||||
*
|
||||
* @param {string} teamId - Team ID.
|
||||
* @param {string} membershipId - Membership ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
deleteMembership(teamId: string, membershipId: string): Promise<{}>;
|
||||
/**
|
||||
* Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.
|
||||
*
|
||||
* If the request is successful, a session for the user is automatically created.
|
||||
*
|
||||
*
|
||||
* @param {string} params.teamId - Team ID.
|
||||
* @param {string} params.membershipId - Membership ID.
|
||||
* @param {string} params.userId - User ID.
|
||||
* @param {string} params.secret - Secret key.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Membership>}
|
||||
*/
|
||||
updateMembershipStatus(params: {
|
||||
teamId: string;
|
||||
membershipId: string;
|
||||
userId: string;
|
||||
secret: string;
|
||||
}): Promise<Models.Membership>;
|
||||
/**
|
||||
* Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.
|
||||
*
|
||||
* If the request is successful, a session for the user is automatically created.
|
||||
*
|
||||
*
|
||||
* @param {string} teamId - Team ID.
|
||||
* @param {string} membershipId - Membership ID.
|
||||
* @param {string} userId - User ID.
|
||||
* @param {string} secret - Secret key.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Membership>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updateMembershipStatus(teamId: string, membershipId: string, userId: string, secret: string): Promise<Models.Membership>;
|
||||
/**
|
||||
* Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs).
|
||||
*
|
||||
* @param {string} params.teamId - Team ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Preferences>}
|
||||
*/
|
||||
getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
||||
teamId: string;
|
||||
}): Promise<Preferences>;
|
||||
/**
|
||||
* Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs).
|
||||
*
|
||||
* @param {string} teamId - Team ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Preferences>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string): Promise<Preferences>;
|
||||
/**
|
||||
* Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.
|
||||
*
|
||||
* @param {string} params.teamId - Team ID.
|
||||
* @param {object} params.prefs - Prefs key-value JSON object.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Preferences>}
|
||||
*/
|
||||
updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
||||
teamId: string;
|
||||
prefs: object;
|
||||
}): Promise<Preferences>;
|
||||
/**
|
||||
* Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.
|
||||
*
|
||||
* @param {string} teamId - Team ID.
|
||||
* @param {object} prefs - Prefs key-value JSON object.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Preferences>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, prefs: object): Promise<Preferences>;
|
||||
}
|
||||
|
||||
export { Teams };
|
||||
355
server/node_modules/node-appwrite/dist/services/teams.d.ts
generated
vendored
Normal file
355
server/node_modules/node-appwrite/dist/services/teams.d.ts
generated
vendored
Normal file
@@ -0,0 +1,355 @@
|
||||
import { Client } from '../client.js';
|
||||
import { Models } from '../models.js';
|
||||
import '../query.js';
|
||||
import '../enums/database-type.js';
|
||||
import '../enums/attribute-status.js';
|
||||
import '../enums/column-status.js';
|
||||
import '../enums/index-status.js';
|
||||
import '../enums/deployment-status.js';
|
||||
import '../enums/execution-trigger.js';
|
||||
import '../enums/execution-status.js';
|
||||
import '../enums/health-antivirus-status.js';
|
||||
import '../enums/health-check-status.js';
|
||||
import '../enums/message-status.js';
|
||||
|
||||
declare class Teams {
|
||||
client: Client;
|
||||
constructor(client: Client);
|
||||
/**
|
||||
* Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.
|
||||
*
|
||||
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan
|
||||
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.TeamList<Preferences>>}
|
||||
*/
|
||||
list<Preferences extends Models.Preferences = Models.DefaultPreferences>(params?: {
|
||||
queries?: string[];
|
||||
search?: string;
|
||||
total?: boolean;
|
||||
}): Promise<Models.TeamList<Preferences>>;
|
||||
/**
|
||||
* Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.
|
||||
*
|
||||
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan
|
||||
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.TeamList<Preferences>>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
list<Preferences extends Models.Preferences = Models.DefaultPreferences>(queries?: string[], search?: string, total?: boolean): Promise<Models.TeamList<Preferences>>;
|
||||
/**
|
||||
* Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.
|
||||
*
|
||||
* @param {string} params.teamId - Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
||||
* @param {string} params.name - Team name. Max length: 128 chars.
|
||||
* @param {string[]} params.roles - Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Team<Preferences>>}
|
||||
*/
|
||||
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
||||
teamId: string;
|
||||
name: string;
|
||||
roles?: string[];
|
||||
}): Promise<Models.Team<Preferences>>;
|
||||
/**
|
||||
* Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.
|
||||
*
|
||||
* @param {string} teamId - Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
||||
* @param {string} name - Team name. Max length: 128 chars.
|
||||
* @param {string[]} roles - Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Team<Preferences>>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, name: string, roles?: string[]): Promise<Models.Team<Preferences>>;
|
||||
/**
|
||||
* Get a team by its ID. All team members have read access for this resource.
|
||||
*
|
||||
* @param {string} params.teamId - Team ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Team<Preferences>>}
|
||||
*/
|
||||
get<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
||||
teamId: string;
|
||||
}): Promise<Models.Team<Preferences>>;
|
||||
/**
|
||||
* Get a team by its ID. All team members have read access for this resource.
|
||||
*
|
||||
* @param {string} teamId - Team ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Team<Preferences>>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
get<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string): Promise<Models.Team<Preferences>>;
|
||||
/**
|
||||
* Update the team's name by its unique ID.
|
||||
*
|
||||
* @param {string} params.teamId - Team ID.
|
||||
* @param {string} params.name - New team name. Max length: 128 chars.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Team<Preferences>>}
|
||||
*/
|
||||
updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
||||
teamId: string;
|
||||
name: string;
|
||||
}): Promise<Models.Team<Preferences>>;
|
||||
/**
|
||||
* Update the team's name by its unique ID.
|
||||
*
|
||||
* @param {string} teamId - Team ID.
|
||||
* @param {string} name - New team name. Max length: 128 chars.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Team<Preferences>>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, name: string): Promise<Models.Team<Preferences>>;
|
||||
/**
|
||||
* Delete a team using its ID. Only team members with the owner role can delete the team.
|
||||
*
|
||||
* @param {string} params.teamId - Team ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
delete(params: {
|
||||
teamId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a team using its ID. Only team members with the owner role can delete the team.
|
||||
*
|
||||
* @param {string} teamId - Team ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
delete(teamId: string): Promise<{}>;
|
||||
/**
|
||||
* Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.
|
||||
*
|
||||
* @param {string} params.teamId - Team ID.
|
||||
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles
|
||||
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.MembershipList>}
|
||||
*/
|
||||
listMemberships(params: {
|
||||
teamId: string;
|
||||
queries?: string[];
|
||||
search?: string;
|
||||
total?: boolean;
|
||||
}): Promise<Models.MembershipList>;
|
||||
/**
|
||||
* Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.
|
||||
*
|
||||
* @param {string} teamId - Team ID.
|
||||
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles
|
||||
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
||||
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.MembershipList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
listMemberships(teamId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.MembershipList>;
|
||||
/**
|
||||
* Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.
|
||||
*
|
||||
* You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.
|
||||
*
|
||||
* Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
|
||||
*
|
||||
* Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.
|
||||
*
|
||||
*
|
||||
* @param {string} params.teamId - Team ID.
|
||||
* @param {string[]} params.roles - Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
|
||||
* @param {string} params.email - Email of the new team member.
|
||||
* @param {string} params.userId - ID of the user to be added to a team.
|
||||
* @param {string} params.phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
||||
* @param {string} params.url - URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
||||
* @param {string} params.name - Name of the new team member. Max length: 128 chars.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Membership>}
|
||||
*/
|
||||
createMembership(params: {
|
||||
teamId: string;
|
||||
roles: string[];
|
||||
email?: string;
|
||||
userId?: string;
|
||||
phone?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}): Promise<Models.Membership>;
|
||||
/**
|
||||
* Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.
|
||||
*
|
||||
* You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.
|
||||
*
|
||||
* Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
|
||||
*
|
||||
* Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.
|
||||
*
|
||||
*
|
||||
* @param {string} teamId - Team ID.
|
||||
* @param {string[]} roles - Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
|
||||
* @param {string} email - Email of the new team member.
|
||||
* @param {string} userId - ID of the user to be added to a team.
|
||||
* @param {string} phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
||||
* @param {string} url - URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
||||
* @param {string} name - Name of the new team member. Max length: 128 chars.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Membership>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createMembership(teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise<Models.Membership>;
|
||||
/**
|
||||
* Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.
|
||||
*
|
||||
* @param {string} params.teamId - Team ID.
|
||||
* @param {string} params.membershipId - Membership ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Membership>}
|
||||
*/
|
||||
getMembership(params: {
|
||||
teamId: string;
|
||||
membershipId: string;
|
||||
}): Promise<Models.Membership>;
|
||||
/**
|
||||
* Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.
|
||||
*
|
||||
* @param {string} teamId - Team ID.
|
||||
* @param {string} membershipId - Membership ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Membership>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getMembership(teamId: string, membershipId: string): Promise<Models.Membership>;
|
||||
/**
|
||||
* Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https://appwrite.io/docs/permissions).
|
||||
*
|
||||
*
|
||||
* @param {string} params.teamId - Team ID.
|
||||
* @param {string} params.membershipId - Membership ID.
|
||||
* @param {string[]} params.roles - An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Membership>}
|
||||
*/
|
||||
updateMembership(params: {
|
||||
teamId: string;
|
||||
membershipId: string;
|
||||
roles: string[];
|
||||
}): Promise<Models.Membership>;
|
||||
/**
|
||||
* Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https://appwrite.io/docs/permissions).
|
||||
*
|
||||
*
|
||||
* @param {string} teamId - Team ID.
|
||||
* @param {string} membershipId - Membership ID.
|
||||
* @param {string[]} roles - An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Membership>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updateMembership(teamId: string, membershipId: string, roles: string[]): Promise<Models.Membership>;
|
||||
/**
|
||||
* This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.
|
||||
*
|
||||
* @param {string} params.teamId - Team ID.
|
||||
* @param {string} params.membershipId - Membership ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
deleteMembership(params: {
|
||||
teamId: string;
|
||||
membershipId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.
|
||||
*
|
||||
* @param {string} teamId - Team ID.
|
||||
* @param {string} membershipId - Membership ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
deleteMembership(teamId: string, membershipId: string): Promise<{}>;
|
||||
/**
|
||||
* Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.
|
||||
*
|
||||
* If the request is successful, a session for the user is automatically created.
|
||||
*
|
||||
*
|
||||
* @param {string} params.teamId - Team ID.
|
||||
* @param {string} params.membershipId - Membership ID.
|
||||
* @param {string} params.userId - User ID.
|
||||
* @param {string} params.secret - Secret key.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Membership>}
|
||||
*/
|
||||
updateMembershipStatus(params: {
|
||||
teamId: string;
|
||||
membershipId: string;
|
||||
userId: string;
|
||||
secret: string;
|
||||
}): Promise<Models.Membership>;
|
||||
/**
|
||||
* Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.
|
||||
*
|
||||
* If the request is successful, a session for the user is automatically created.
|
||||
*
|
||||
*
|
||||
* @param {string} teamId - Team ID.
|
||||
* @param {string} membershipId - Membership ID.
|
||||
* @param {string} userId - User ID.
|
||||
* @param {string} secret - Secret key.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.Membership>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updateMembershipStatus(teamId: string, membershipId: string, userId: string, secret: string): Promise<Models.Membership>;
|
||||
/**
|
||||
* Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs).
|
||||
*
|
||||
* @param {string} params.teamId - Team ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Preferences>}
|
||||
*/
|
||||
getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
||||
teamId: string;
|
||||
}): Promise<Preferences>;
|
||||
/**
|
||||
* Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs).
|
||||
*
|
||||
* @param {string} teamId - Team ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Preferences>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string): Promise<Preferences>;
|
||||
/**
|
||||
* Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.
|
||||
*
|
||||
* @param {string} params.teamId - Team ID.
|
||||
* @param {object} params.prefs - Prefs key-value JSON object.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Preferences>}
|
||||
*/
|
||||
updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
||||
teamId: string;
|
||||
prefs: object;
|
||||
}): Promise<Preferences>;
|
||||
/**
|
||||
* Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.
|
||||
*
|
||||
* @param {string} teamId - Team ID.
|
||||
* @param {object} prefs - Prefs key-value JSON object.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Preferences>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, prefs: object): Promise<Preferences>;
|
||||
}
|
||||
|
||||
export { Teams };
|
||||
475
server/node_modules/node-appwrite/dist/services/teams.js
generated
vendored
Normal file
475
server/node_modules/node-appwrite/dist/services/teams.js
generated
vendored
Normal file
@@ -0,0 +1,475 @@
|
||||
'use strict';
|
||||
|
||||
var client = require('../client');
|
||||
|
||||
class Teams {
|
||||
constructor(client) {
|
||||
this.client = client;
|
||||
}
|
||||
list(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
queries: paramsOrFirst,
|
||||
search: rest[0],
|
||||
total: rest[1]
|
||||
};
|
||||
}
|
||||
const queries = params.queries;
|
||||
const search = params.search;
|
||||
const total = params.total;
|
||||
const apiPath = "/teams";
|
||||
const payload = {};
|
||||
if (typeof queries !== "undefined") {
|
||||
payload["queries"] = queries;
|
||||
}
|
||||
if (typeof search !== "undefined") {
|
||||
payload["search"] = search;
|
||||
}
|
||||
if (typeof total !== "undefined") {
|
||||
payload["total"] = total;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
create(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst,
|
||||
name: rest[0],
|
||||
roles: rest[1]
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
const name = params.name;
|
||||
const roles = params.roles;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
if (typeof name === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "name"');
|
||||
}
|
||||
const apiPath = "/teams";
|
||||
const payload = {};
|
||||
if (typeof teamId !== "undefined") {
|
||||
payload["teamId"] = teamId;
|
||||
}
|
||||
if (typeof name !== "undefined") {
|
||||
payload["name"] = name;
|
||||
}
|
||||
if (typeof roles !== "undefined") {
|
||||
payload["roles"] = roles;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"post",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
get(paramsOrFirst) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
const apiPath = "/teams/{teamId}".replace("{teamId}", teamId);
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
updateName(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst,
|
||||
name: rest[0]
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
const name = params.name;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
if (typeof name === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "name"');
|
||||
}
|
||||
const apiPath = "/teams/{teamId}".replace("{teamId}", teamId);
|
||||
const payload = {};
|
||||
if (typeof name !== "undefined") {
|
||||
payload["name"] = name;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"put",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
delete(paramsOrFirst) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
const apiPath = "/teams/{teamId}".replace("{teamId}", teamId);
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"delete",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
listMemberships(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst,
|
||||
queries: rest[0],
|
||||
search: rest[1],
|
||||
total: rest[2]
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
const queries = params.queries;
|
||||
const search = params.search;
|
||||
const total = params.total;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
const apiPath = "/teams/{teamId}/memberships".replace("{teamId}", teamId);
|
||||
const payload = {};
|
||||
if (typeof queries !== "undefined") {
|
||||
payload["queries"] = queries;
|
||||
}
|
||||
if (typeof search !== "undefined") {
|
||||
payload["search"] = search;
|
||||
}
|
||||
if (typeof total !== "undefined") {
|
||||
payload["total"] = total;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
createMembership(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst,
|
||||
roles: rest[0],
|
||||
email: rest[1],
|
||||
userId: rest[2],
|
||||
phone: rest[3],
|
||||
url: rest[4],
|
||||
name: rest[5]
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
const roles = params.roles;
|
||||
const email = params.email;
|
||||
const userId = params.userId;
|
||||
const phone = params.phone;
|
||||
const url = params.url;
|
||||
const name = params.name;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
if (typeof roles === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "roles"');
|
||||
}
|
||||
const apiPath = "/teams/{teamId}/memberships".replace("{teamId}", teamId);
|
||||
const payload = {};
|
||||
if (typeof email !== "undefined") {
|
||||
payload["email"] = email;
|
||||
}
|
||||
if (typeof userId !== "undefined") {
|
||||
payload["userId"] = userId;
|
||||
}
|
||||
if (typeof phone !== "undefined") {
|
||||
payload["phone"] = phone;
|
||||
}
|
||||
if (typeof roles !== "undefined") {
|
||||
payload["roles"] = roles;
|
||||
}
|
||||
if (typeof url !== "undefined") {
|
||||
payload["url"] = url;
|
||||
}
|
||||
if (typeof name !== "undefined") {
|
||||
payload["name"] = name;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"post",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getMembership(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst,
|
||||
membershipId: rest[0]
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
const membershipId = params.membershipId;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
if (typeof membershipId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "membershipId"');
|
||||
}
|
||||
const apiPath = "/teams/{teamId}/memberships/{membershipId}".replace("{teamId}", teamId).replace("{membershipId}", membershipId);
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
updateMembership(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst,
|
||||
membershipId: rest[0],
|
||||
roles: rest[1]
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
const membershipId = params.membershipId;
|
||||
const roles = params.roles;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
if (typeof membershipId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "membershipId"');
|
||||
}
|
||||
if (typeof roles === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "roles"');
|
||||
}
|
||||
const apiPath = "/teams/{teamId}/memberships/{membershipId}".replace("{teamId}", teamId).replace("{membershipId}", membershipId);
|
||||
const payload = {};
|
||||
if (typeof roles !== "undefined") {
|
||||
payload["roles"] = roles;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"patch",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
deleteMembership(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst,
|
||||
membershipId: rest[0]
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
const membershipId = params.membershipId;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
if (typeof membershipId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "membershipId"');
|
||||
}
|
||||
const apiPath = "/teams/{teamId}/memberships/{membershipId}".replace("{teamId}", teamId).replace("{membershipId}", membershipId);
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"delete",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
updateMembershipStatus(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst,
|
||||
membershipId: rest[0],
|
||||
userId: rest[1],
|
||||
secret: rest[2]
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
const membershipId = params.membershipId;
|
||||
const userId = params.userId;
|
||||
const secret = params.secret;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
if (typeof membershipId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "membershipId"');
|
||||
}
|
||||
if (typeof userId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "userId"');
|
||||
}
|
||||
if (typeof secret === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "secret"');
|
||||
}
|
||||
const apiPath = "/teams/{teamId}/memberships/{membershipId}/status".replace("{teamId}", teamId).replace("{membershipId}", membershipId);
|
||||
const payload = {};
|
||||
if (typeof userId !== "undefined") {
|
||||
payload["userId"] = userId;
|
||||
}
|
||||
if (typeof secret !== "undefined") {
|
||||
payload["secret"] = secret;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"patch",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getPrefs(paramsOrFirst) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
const apiPath = "/teams/{teamId}/prefs".replace("{teamId}", teamId);
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
updatePrefs(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst,
|
||||
prefs: rest[0]
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
const prefs = params.prefs;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
if (typeof prefs === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "prefs"');
|
||||
}
|
||||
const apiPath = "/teams/{teamId}/prefs".replace("{teamId}", teamId);
|
||||
const payload = {};
|
||||
if (typeof prefs !== "undefined") {
|
||||
payload["prefs"] = prefs;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"put",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
exports.Teams = Teams;
|
||||
//# sourceMappingURL=out.js.map
|
||||
//# sourceMappingURL=teams.js.map
|
||||
1
server/node_modules/node-appwrite/dist/services/teams.js.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/teams.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
474
server/node_modules/node-appwrite/dist/services/teams.mjs
generated
vendored
Normal file
474
server/node_modules/node-appwrite/dist/services/teams.mjs
generated
vendored
Normal file
@@ -0,0 +1,474 @@
|
||||
import { AppwriteException } from '../client.mjs';
|
||||
|
||||
// src/services/teams.ts
|
||||
var Teams = class {
|
||||
constructor(client) {
|
||||
this.client = client;
|
||||
}
|
||||
list(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
queries: paramsOrFirst,
|
||||
search: rest[0],
|
||||
total: rest[1]
|
||||
};
|
||||
}
|
||||
const queries = params.queries;
|
||||
const search = params.search;
|
||||
const total = params.total;
|
||||
const apiPath = "/teams";
|
||||
const payload = {};
|
||||
if (typeof queries !== "undefined") {
|
||||
payload["queries"] = queries;
|
||||
}
|
||||
if (typeof search !== "undefined") {
|
||||
payload["search"] = search;
|
||||
}
|
||||
if (typeof total !== "undefined") {
|
||||
payload["total"] = total;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
create(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst,
|
||||
name: rest[0],
|
||||
roles: rest[1]
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
const name = params.name;
|
||||
const roles = params.roles;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
if (typeof name === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "name"');
|
||||
}
|
||||
const apiPath = "/teams";
|
||||
const payload = {};
|
||||
if (typeof teamId !== "undefined") {
|
||||
payload["teamId"] = teamId;
|
||||
}
|
||||
if (typeof name !== "undefined") {
|
||||
payload["name"] = name;
|
||||
}
|
||||
if (typeof roles !== "undefined") {
|
||||
payload["roles"] = roles;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"post",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
get(paramsOrFirst) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
const apiPath = "/teams/{teamId}".replace("{teamId}", teamId);
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
updateName(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst,
|
||||
name: rest[0]
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
const name = params.name;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
if (typeof name === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "name"');
|
||||
}
|
||||
const apiPath = "/teams/{teamId}".replace("{teamId}", teamId);
|
||||
const payload = {};
|
||||
if (typeof name !== "undefined") {
|
||||
payload["name"] = name;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"put",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
delete(paramsOrFirst) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
const apiPath = "/teams/{teamId}".replace("{teamId}", teamId);
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"delete",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
listMemberships(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst,
|
||||
queries: rest[0],
|
||||
search: rest[1],
|
||||
total: rest[2]
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
const queries = params.queries;
|
||||
const search = params.search;
|
||||
const total = params.total;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
const apiPath = "/teams/{teamId}/memberships".replace("{teamId}", teamId);
|
||||
const payload = {};
|
||||
if (typeof queries !== "undefined") {
|
||||
payload["queries"] = queries;
|
||||
}
|
||||
if (typeof search !== "undefined") {
|
||||
payload["search"] = search;
|
||||
}
|
||||
if (typeof total !== "undefined") {
|
||||
payload["total"] = total;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
createMembership(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst,
|
||||
roles: rest[0],
|
||||
email: rest[1],
|
||||
userId: rest[2],
|
||||
phone: rest[3],
|
||||
url: rest[4],
|
||||
name: rest[5]
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
const roles = params.roles;
|
||||
const email = params.email;
|
||||
const userId = params.userId;
|
||||
const phone = params.phone;
|
||||
const url = params.url;
|
||||
const name = params.name;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
if (typeof roles === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "roles"');
|
||||
}
|
||||
const apiPath = "/teams/{teamId}/memberships".replace("{teamId}", teamId);
|
||||
const payload = {};
|
||||
if (typeof email !== "undefined") {
|
||||
payload["email"] = email;
|
||||
}
|
||||
if (typeof userId !== "undefined") {
|
||||
payload["userId"] = userId;
|
||||
}
|
||||
if (typeof phone !== "undefined") {
|
||||
payload["phone"] = phone;
|
||||
}
|
||||
if (typeof roles !== "undefined") {
|
||||
payload["roles"] = roles;
|
||||
}
|
||||
if (typeof url !== "undefined") {
|
||||
payload["url"] = url;
|
||||
}
|
||||
if (typeof name !== "undefined") {
|
||||
payload["name"] = name;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"post",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getMembership(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst,
|
||||
membershipId: rest[0]
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
const membershipId = params.membershipId;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
if (typeof membershipId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "membershipId"');
|
||||
}
|
||||
const apiPath = "/teams/{teamId}/memberships/{membershipId}".replace("{teamId}", teamId).replace("{membershipId}", membershipId);
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
updateMembership(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst,
|
||||
membershipId: rest[0],
|
||||
roles: rest[1]
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
const membershipId = params.membershipId;
|
||||
const roles = params.roles;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
if (typeof membershipId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "membershipId"');
|
||||
}
|
||||
if (typeof roles === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "roles"');
|
||||
}
|
||||
const apiPath = "/teams/{teamId}/memberships/{membershipId}".replace("{teamId}", teamId).replace("{membershipId}", membershipId);
|
||||
const payload = {};
|
||||
if (typeof roles !== "undefined") {
|
||||
payload["roles"] = roles;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"patch",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
deleteMembership(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst,
|
||||
membershipId: rest[0]
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
const membershipId = params.membershipId;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
if (typeof membershipId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "membershipId"');
|
||||
}
|
||||
const apiPath = "/teams/{teamId}/memberships/{membershipId}".replace("{teamId}", teamId).replace("{membershipId}", membershipId);
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"delete",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
updateMembershipStatus(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst,
|
||||
membershipId: rest[0],
|
||||
userId: rest[1],
|
||||
secret: rest[2]
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
const membershipId = params.membershipId;
|
||||
const userId = params.userId;
|
||||
const secret = params.secret;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
if (typeof membershipId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "membershipId"');
|
||||
}
|
||||
if (typeof userId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "userId"');
|
||||
}
|
||||
if (typeof secret === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "secret"');
|
||||
}
|
||||
const apiPath = "/teams/{teamId}/memberships/{membershipId}/status".replace("{teamId}", teamId).replace("{membershipId}", membershipId);
|
||||
const payload = {};
|
||||
if (typeof userId !== "undefined") {
|
||||
payload["userId"] = userId;
|
||||
}
|
||||
if (typeof secret !== "undefined") {
|
||||
payload["secret"] = secret;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"patch",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
getPrefs(paramsOrFirst) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
const apiPath = "/teams/{teamId}/prefs".replace("{teamId}", teamId);
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
updatePrefs(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
teamId: paramsOrFirst,
|
||||
prefs: rest[0]
|
||||
};
|
||||
}
|
||||
const teamId = params.teamId;
|
||||
const prefs = params.prefs;
|
||||
if (typeof teamId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "teamId"');
|
||||
}
|
||||
if (typeof prefs === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "prefs"');
|
||||
}
|
||||
const apiPath = "/teams/{teamId}/prefs".replace("{teamId}", teamId);
|
||||
const payload = {};
|
||||
if (typeof prefs !== "undefined") {
|
||||
payload["prefs"] = prefs;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"put",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export { Teams };
|
||||
//# sourceMappingURL=out.js.map
|
||||
//# sourceMappingURL=teams.mjs.map
|
||||
1
server/node_modules/node-appwrite/dist/services/teams.mjs.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/teams.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
133
server/node_modules/node-appwrite/dist/services/tokens.d.mts
generated
vendored
Normal file
133
server/node_modules/node-appwrite/dist/services/tokens.d.mts
generated
vendored
Normal file
@@ -0,0 +1,133 @@
|
||||
import { Client } from '../client.mjs';
|
||||
import { Models } from '../models.mjs';
|
||||
import '../query.mjs';
|
||||
import '../enums/database-type.mjs';
|
||||
import '../enums/attribute-status.mjs';
|
||||
import '../enums/column-status.mjs';
|
||||
import '../enums/index-status.mjs';
|
||||
import '../enums/deployment-status.mjs';
|
||||
import '../enums/execution-trigger.mjs';
|
||||
import '../enums/execution-status.mjs';
|
||||
import '../enums/health-antivirus-status.mjs';
|
||||
import '../enums/health-check-status.mjs';
|
||||
import '../enums/message-status.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} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} params.fileId - File unique ID.
|
||||
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire
|
||||
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ResourceTokenList>}
|
||||
*/
|
||||
list(params: {
|
||||
bucketId: string;
|
||||
fileId: string;
|
||||
queries?: string[];
|
||||
total?: boolean;
|
||||
}): Promise<Models.ResourceTokenList>;
|
||||
/**
|
||||
* List all the tokens created for a specific file or bucket. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} fileId - File unique ID.
|
||||
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire
|
||||
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ResourceTokenList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
list(bucketId: string, fileId: string, queries?: string[], total?: boolean): Promise<Models.ResourceTokenList>;
|
||||
/**
|
||||
* Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter.
|
||||
*
|
||||
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} params.fileId - File unique ID.
|
||||
* @param {string} params.expire - Token expiry date
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ResourceToken>}
|
||||
*/
|
||||
createFileToken(params: {
|
||||
bucketId: string;
|
||||
fileId: string;
|
||||
expire?: string;
|
||||
}): Promise<Models.ResourceToken>;
|
||||
/**
|
||||
* Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter.
|
||||
*
|
||||
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} fileId - File unique ID.
|
||||
* @param {string} expire - Token expiry date
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ResourceToken>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createFileToken(bucketId: string, fileId: string, expire?: string): Promise<Models.ResourceToken>;
|
||||
/**
|
||||
* Get a token by its unique ID.
|
||||
*
|
||||
* @param {string} params.tokenId - Token ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ResourceToken>}
|
||||
*/
|
||||
get(params: {
|
||||
tokenId: string;
|
||||
}): Promise<Models.ResourceToken>;
|
||||
/**
|
||||
* Get a token by its unique ID.
|
||||
*
|
||||
* @param {string} tokenId - Token ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ResourceToken>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
get(tokenId: string): Promise<Models.ResourceToken>;
|
||||
/**
|
||||
* Update a token by its unique ID. Use this endpoint to update a token's expiry date.
|
||||
*
|
||||
* @param {string} params.tokenId - Token unique ID.
|
||||
* @param {string} params.expire - File token expiry date
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ResourceToken>}
|
||||
*/
|
||||
update(params: {
|
||||
tokenId: string;
|
||||
expire?: string;
|
||||
}): Promise<Models.ResourceToken>;
|
||||
/**
|
||||
* Update a token by its unique ID. Use this endpoint to update a token's expiry date.
|
||||
*
|
||||
* @param {string} tokenId - Token unique ID.
|
||||
* @param {string} expire - File token expiry date
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ResourceToken>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
update(tokenId: string, expire?: string): Promise<Models.ResourceToken>;
|
||||
/**
|
||||
* Delete a token by its unique ID.
|
||||
*
|
||||
* @param {string} params.tokenId - Token ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
delete(params: {
|
||||
tokenId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a token by its unique ID.
|
||||
*
|
||||
* @param {string} tokenId - Token ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
delete(tokenId: string): Promise<{}>;
|
||||
}
|
||||
|
||||
export { Tokens };
|
||||
133
server/node_modules/node-appwrite/dist/services/tokens.d.ts
generated
vendored
Normal file
133
server/node_modules/node-appwrite/dist/services/tokens.d.ts
generated
vendored
Normal file
@@ -0,0 +1,133 @@
|
||||
import { Client } from '../client.js';
|
||||
import { Models } from '../models.js';
|
||||
import '../query.js';
|
||||
import '../enums/database-type.js';
|
||||
import '../enums/attribute-status.js';
|
||||
import '../enums/column-status.js';
|
||||
import '../enums/index-status.js';
|
||||
import '../enums/deployment-status.js';
|
||||
import '../enums/execution-trigger.js';
|
||||
import '../enums/execution-status.js';
|
||||
import '../enums/health-antivirus-status.js';
|
||||
import '../enums/health-check-status.js';
|
||||
import '../enums/message-status.js';
|
||||
|
||||
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} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} params.fileId - File unique ID.
|
||||
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire
|
||||
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ResourceTokenList>}
|
||||
*/
|
||||
list(params: {
|
||||
bucketId: string;
|
||||
fileId: string;
|
||||
queries?: string[];
|
||||
total?: boolean;
|
||||
}): Promise<Models.ResourceTokenList>;
|
||||
/**
|
||||
* List all the tokens created for a specific file or bucket. You can use the query params to filter your results.
|
||||
*
|
||||
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} fileId - File unique ID.
|
||||
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire
|
||||
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ResourceTokenList>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
list(bucketId: string, fileId: string, queries?: string[], total?: boolean): Promise<Models.ResourceTokenList>;
|
||||
/**
|
||||
* Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter.
|
||||
*
|
||||
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} params.fileId - File unique ID.
|
||||
* @param {string} params.expire - Token expiry date
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ResourceToken>}
|
||||
*/
|
||||
createFileToken(params: {
|
||||
bucketId: string;
|
||||
fileId: string;
|
||||
expire?: string;
|
||||
}): Promise<Models.ResourceToken>;
|
||||
/**
|
||||
* Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter.
|
||||
*
|
||||
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
||||
* @param {string} fileId - File unique ID.
|
||||
* @param {string} expire - Token expiry date
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ResourceToken>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
createFileToken(bucketId: string, fileId: string, expire?: string): Promise<Models.ResourceToken>;
|
||||
/**
|
||||
* Get a token by its unique ID.
|
||||
*
|
||||
* @param {string} params.tokenId - Token ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ResourceToken>}
|
||||
*/
|
||||
get(params: {
|
||||
tokenId: string;
|
||||
}): Promise<Models.ResourceToken>;
|
||||
/**
|
||||
* Get a token by its unique ID.
|
||||
*
|
||||
* @param {string} tokenId - Token ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ResourceToken>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
get(tokenId: string): Promise<Models.ResourceToken>;
|
||||
/**
|
||||
* Update a token by its unique ID. Use this endpoint to update a token's expiry date.
|
||||
*
|
||||
* @param {string} params.tokenId - Token unique ID.
|
||||
* @param {string} params.expire - File token expiry date
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ResourceToken>}
|
||||
*/
|
||||
update(params: {
|
||||
tokenId: string;
|
||||
expire?: string;
|
||||
}): Promise<Models.ResourceToken>;
|
||||
/**
|
||||
* Update a token by its unique ID. Use this endpoint to update a token's expiry date.
|
||||
*
|
||||
* @param {string} tokenId - Token unique ID.
|
||||
* @param {string} expire - File token expiry date
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<Models.ResourceToken>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
update(tokenId: string, expire?: string): Promise<Models.ResourceToken>;
|
||||
/**
|
||||
* Delete a token by its unique ID.
|
||||
*
|
||||
* @param {string} params.tokenId - Token ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
*/
|
||||
delete(params: {
|
||||
tokenId: string;
|
||||
}): Promise<{}>;
|
||||
/**
|
||||
* Delete a token by its unique ID.
|
||||
*
|
||||
* @param {string} tokenId - Token ID.
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise<{}>}
|
||||
* @deprecated Use the object parameter style method for a better developer experience.
|
||||
*/
|
||||
delete(tokenId: string): Promise<{}>;
|
||||
}
|
||||
|
||||
export { Tokens };
|
||||
169
server/node_modules/node-appwrite/dist/services/tokens.js
generated
vendored
Normal file
169
server/node_modules/node-appwrite/dist/services/tokens.js
generated
vendored
Normal file
@@ -0,0 +1,169 @@
|
||||
'use strict';
|
||||
|
||||
var client = require('../client');
|
||||
|
||||
class Tokens {
|
||||
constructor(client) {
|
||||
this.client = client;
|
||||
}
|
||||
list(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
fileId: rest[0],
|
||||
queries: rest[1],
|
||||
total: rest[2]
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const fileId = params.fileId;
|
||||
const queries = params.queries;
|
||||
const total = params.total;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
if (typeof fileId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "fileId"');
|
||||
}
|
||||
const apiPath = "/tokens/buckets/{bucketId}/files/{fileId}".replace("{bucketId}", bucketId).replace("{fileId}", fileId);
|
||||
const payload = {};
|
||||
if (typeof queries !== "undefined") {
|
||||
payload["queries"] = queries;
|
||||
}
|
||||
if (typeof total !== "undefined") {
|
||||
payload["total"] = total;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
createFileToken(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
fileId: rest[0],
|
||||
expire: rest[1]
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const fileId = params.fileId;
|
||||
const expire = params.expire;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
if (typeof fileId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "fileId"');
|
||||
}
|
||||
const apiPath = "/tokens/buckets/{bucketId}/files/{fileId}".replace("{bucketId}", bucketId).replace("{fileId}", fileId);
|
||||
const payload = {};
|
||||
if (typeof expire !== "undefined") {
|
||||
payload["expire"] = expire;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"post",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
get(paramsOrFirst) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
tokenId: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const tokenId = params.tokenId;
|
||||
if (typeof tokenId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "tokenId"');
|
||||
}
|
||||
const apiPath = "/tokens/{tokenId}".replace("{tokenId}", tokenId);
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
update(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
tokenId: paramsOrFirst,
|
||||
expire: rest[0]
|
||||
};
|
||||
}
|
||||
const tokenId = params.tokenId;
|
||||
const expire = params.expire;
|
||||
if (typeof tokenId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "tokenId"');
|
||||
}
|
||||
const apiPath = "/tokens/{tokenId}".replace("{tokenId}", tokenId);
|
||||
const payload = {};
|
||||
if (typeof expire !== "undefined") {
|
||||
payload["expire"] = expire;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"patch",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
delete(paramsOrFirst) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
tokenId: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const tokenId = params.tokenId;
|
||||
if (typeof tokenId === "undefined") {
|
||||
throw new client.AppwriteException('Missing required parameter: "tokenId"');
|
||||
}
|
||||
const apiPath = "/tokens/{tokenId}".replace("{tokenId}", tokenId);
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"delete",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
exports.Tokens = Tokens;
|
||||
//# sourceMappingURL=out.js.map
|
||||
//# sourceMappingURL=tokens.js.map
|
||||
1
server/node_modules/node-appwrite/dist/services/tokens.js.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/tokens.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
168
server/node_modules/node-appwrite/dist/services/tokens.mjs
generated
vendored
Normal file
168
server/node_modules/node-appwrite/dist/services/tokens.mjs
generated
vendored
Normal file
@@ -0,0 +1,168 @@
|
||||
import { AppwriteException } from '../client.mjs';
|
||||
|
||||
// src/services/tokens.ts
|
||||
var Tokens = class {
|
||||
constructor(client) {
|
||||
this.client = client;
|
||||
}
|
||||
list(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
fileId: rest[0],
|
||||
queries: rest[1],
|
||||
total: rest[2]
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const fileId = params.fileId;
|
||||
const queries = params.queries;
|
||||
const total = params.total;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
if (typeof fileId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "fileId"');
|
||||
}
|
||||
const apiPath = "/tokens/buckets/{bucketId}/files/{fileId}".replace("{bucketId}", bucketId).replace("{fileId}", fileId);
|
||||
const payload = {};
|
||||
if (typeof queries !== "undefined") {
|
||||
payload["queries"] = queries;
|
||||
}
|
||||
if (typeof total !== "undefined") {
|
||||
payload["total"] = total;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
createFileToken(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
bucketId: paramsOrFirst,
|
||||
fileId: rest[0],
|
||||
expire: rest[1]
|
||||
};
|
||||
}
|
||||
const bucketId = params.bucketId;
|
||||
const fileId = params.fileId;
|
||||
const expire = params.expire;
|
||||
if (typeof bucketId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
if (typeof fileId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "fileId"');
|
||||
}
|
||||
const apiPath = "/tokens/buckets/{bucketId}/files/{fileId}".replace("{bucketId}", bucketId).replace("{fileId}", fileId);
|
||||
const payload = {};
|
||||
if (typeof expire !== "undefined") {
|
||||
payload["expire"] = expire;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"post",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
get(paramsOrFirst) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
tokenId: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const tokenId = params.tokenId;
|
||||
if (typeof tokenId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "tokenId"');
|
||||
}
|
||||
const apiPath = "/tokens/{tokenId}".replace("{tokenId}", tokenId);
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {};
|
||||
return this.client.call(
|
||||
"get",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
update(paramsOrFirst, ...rest) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
tokenId: paramsOrFirst,
|
||||
expire: rest[0]
|
||||
};
|
||||
}
|
||||
const tokenId = params.tokenId;
|
||||
const expire = params.expire;
|
||||
if (typeof tokenId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "tokenId"');
|
||||
}
|
||||
const apiPath = "/tokens/{tokenId}".replace("{tokenId}", tokenId);
|
||||
const payload = {};
|
||||
if (typeof expire !== "undefined") {
|
||||
payload["expire"] = expire;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"patch",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
delete(paramsOrFirst) {
|
||||
let params;
|
||||
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
||||
params = paramsOrFirst || {};
|
||||
} else {
|
||||
params = {
|
||||
tokenId: paramsOrFirst
|
||||
};
|
||||
}
|
||||
const tokenId = params.tokenId;
|
||||
if (typeof tokenId === "undefined") {
|
||||
throw new AppwriteException('Missing required parameter: "tokenId"');
|
||||
}
|
||||
const apiPath = "/tokens/{tokenId}".replace("{tokenId}", tokenId);
|
||||
const payload = {};
|
||||
const uri = new URL(this.client.config.endpoint + apiPath);
|
||||
const apiHeaders = {
|
||||
"content-type": "application/json"
|
||||
};
|
||||
return this.client.call(
|
||||
"delete",
|
||||
uri,
|
||||
apiHeaders,
|
||||
payload
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export { Tokens };
|
||||
//# sourceMappingURL=out.js.map
|
||||
//# sourceMappingURL=tokens.mjs.map
|
||||
1
server/node_modules/node-appwrite/dist/services/tokens.mjs.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/tokens.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1176
server/node_modules/node-appwrite/dist/services/users.d.mts
generated
vendored
Normal file
1176
server/node_modules/node-appwrite/dist/services/users.d.mts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1176
server/node_modules/node-appwrite/dist/services/users.d.ts
generated
vendored
Normal file
1176
server/node_modules/node-appwrite/dist/services/users.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1742
server/node_modules/node-appwrite/dist/services/users.js
generated
vendored
Normal file
1742
server/node_modules/node-appwrite/dist/services/users.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
server/node_modules/node-appwrite/dist/services/users.js.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/users.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1741
server/node_modules/node-appwrite/dist/services/users.mjs
generated
vendored
Normal file
1741
server/node_modules/node-appwrite/dist/services/users.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
server/node_modules/node-appwrite/dist/services/users.mjs.map
generated
vendored
Normal file
1
server/node_modules/node-appwrite/dist/services/users.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user