import { Client } from '../client.js'; import { Models } from '../models.js'; import { BackupServices } from '../enums/backup-services.js'; import 'undici'; 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-resource-type.js'; import '../enums/execution-trigger.js'; import '../enums/execution-status.js'; import '../enums/project-auth-method-id.js'; import '../enums/project-service-id.js'; import '../enums/project-protocol-id.js'; import '../enums/o-auth-2-google-prompt.js'; import '../enums/o-auth-2-oidc-prompt.js'; import '../enums/platform-type.js'; import '../enums/proxy-rule-deployment-resource-type.js'; import '../enums/proxy-rule-status.js'; import '../enums/message-status.js'; import '../enums/billing-plan-group.js'; declare class Backups { client: Client; constructor(client: Client); /** * List all archives for a project. * * @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. * @throws {AppwriteException} * @returns {Promise} */ listArchives(params?: { queries?: string[]; }): Promise; /** * List all archives for a project. * * @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. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ listArchives(queries?: string[]): Promise; /** * Create a new archive asynchronously for a project. * * @param {BackupServices[]} params.services - Array of services to backup * @param {string} params.resourceId - Resource ID. When set, only this single resource will be backed up. * @throws {AppwriteException} * @returns {Promise} */ createArchive(params: { services: BackupServices[]; resourceId?: string; }): Promise; /** * Create a new archive asynchronously for a project. * * @param {BackupServices[]} services - Array of services to backup * @param {string} resourceId - Resource ID. When set, only this single resource will be backed up. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ createArchive(services: BackupServices[], resourceId?: string): Promise; /** * Get a backup archive using it's ID. * * @param {string} params.archiveId - Archive ID. Choose a custom ID`. 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. * @throws {AppwriteException} * @returns {Promise} */ getArchive(params: { archiveId: string; }): Promise; /** * Get a backup archive using it's ID. * * @param {string} archiveId - Archive ID. Choose a custom ID`. 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. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getArchive(archiveId: string): Promise; /** * Delete an existing archive for a project. * * @param {string} params.archiveId - Policy 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. * @throws {AppwriteException} * @returns {Promise<{}>} */ deleteArchive(params: { archiveId: string; }): Promise<{}>; /** * Delete an existing archive for a project. * * @param {string} archiveId - Policy 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. * @throws {AppwriteException} * @returns {Promise<{}>} * @deprecated Use the object parameter style method for a better developer experience. */ deleteArchive(archiveId: string): Promise<{}>; /** * List all policies for a project. * * @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. * @throws {AppwriteException} * @returns {Promise} */ listPolicies(params?: { queries?: string[]; }): Promise; /** * List all policies for a project. * * @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. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ listPolicies(queries?: string[]): Promise; /** * Create a new backup policy. * * @param {string} params.policyId - Policy 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 {BackupServices[]} params.services - Array of services to backup * @param {number} params.retention - Days to keep backups before deletion * @param {string} params.schedule - Schedule CRON syntax. * @param {string} params.name - Policy name. Max length: 128 chars. * @param {string} params.resourceId - Resource ID. When set, only this single resource will be backed up. * @param {boolean} params.enabled - Is policy enabled? When set to 'disabled', no backups will be taken * @throws {AppwriteException} * @returns {Promise} */ createPolicy(params: { policyId: string; services: BackupServices[]; retention: number; schedule: string; name?: string; resourceId?: string; enabled?: boolean; }): Promise; /** * Create a new backup policy. * * @param {string} policyId - Policy 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 {BackupServices[]} services - Array of services to backup * @param {number} retention - Days to keep backups before deletion * @param {string} schedule - Schedule CRON syntax. * @param {string} name - Policy name. Max length: 128 chars. * @param {string} resourceId - Resource ID. When set, only this single resource will be backed up. * @param {boolean} enabled - Is policy enabled? When set to 'disabled', no backups will be taken * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ createPolicy(policyId: string, services: BackupServices[], retention: number, schedule: string, name?: string, resourceId?: string, enabled?: boolean): Promise; /** * Get a backup policy using it's ID. * * @param {string} params.policyId - Policy ID. Choose a custom ID`. 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. * @throws {AppwriteException} * @returns {Promise} */ getPolicy(params: { policyId: string; }): Promise; /** * Get a backup policy using it's ID. * * @param {string} policyId - Policy ID. Choose a custom ID`. 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. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getPolicy(policyId: string): Promise; /** * Update an existing policy using it's ID. * * @param {string} params.policyId - Policy ID. Choose a custom ID`. 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 - Policy name. Max length: 128 chars. * @param {number} params.retention - Days to keep backups before deletion * @param {string} params.schedule - Cron expression * @param {boolean} params.enabled - Is Backup enabled? When set to 'disabled', No backup will be taken * @throws {AppwriteException} * @returns {Promise} */ updatePolicy(params: { policyId: string; name?: string; retention?: number; schedule?: string; enabled?: boolean; }): Promise; /** * Update an existing policy using it's ID. * * @param {string} policyId - Policy ID. Choose a custom ID`. 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 - Policy name. Max length: 128 chars. * @param {number} retention - Days to keep backups before deletion * @param {string} schedule - Cron expression * @param {boolean} enabled - Is Backup enabled? When set to 'disabled', No backup will be taken * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ updatePolicy(policyId: string, name?: string, retention?: number, schedule?: string, enabled?: boolean): Promise; /** * Delete a policy using it's ID. * * @param {string} params.policyId - Policy 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. * @throws {AppwriteException} * @returns {Promise<{}>} */ deletePolicy(params: { policyId: string; }): Promise<{}>; /** * Delete a policy using it's ID. * * @param {string} policyId - Policy 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. * @throws {AppwriteException} * @returns {Promise<{}>} * @deprecated Use the object parameter style method for a better developer experience. */ deletePolicy(policyId: string): Promise<{}>; /** * Create and trigger a new restoration for a backup on a project. * * For a backup of one database, the restoration resolves its destination before it is queued. When `newResourceId` is omitted, the archived database is restored in place and its own ID is returned in `options`. Pass a different `newResourceId` to restore alongside it as a new database instead. * * The restoration migration records the archived database in `resourceId` and `resourceType`, and the resolved database in `destinationResourceId` and `destinationResourceType`. Database types are stored canonically as `database`, `documentsdb`, or `vectorsdb`. Project-wide restorations leave these fields empty because they do not have a single source or destination database. * * To list every migration related to one database, use its canonical type in a nested `OR(AND(...), AND(...), AND(...))` across the root, parent, and destination relation pairs: `(resourceType, resourceId)`, `(parentResourceType, parentResourceId)`, and `(destinationResourceType, destinationResourceId)`. Legacy and TablesDB databases use `database`; the operational `resourceType` of a table migration is not rewritten to `tablesdb`. * * When restoring a DocumentsDB or VectorsDB database from a dedicated source, the restore provisions a fresh dedicated backing database at the source database's own specification and lands the data there. An in-place restore swaps the database onto that backing only once the restore has succeeded, and retires the backing it displaced only once that swap is confirmed, so the source keeps serving its own data until the restored data is in place and any failure leaves it untouched. A serverless source has no dedicated backing to clone and restores onto the archived database instead. * * * @param {string} params.archiveId - Backup archive ID to restore * @param {BackupServices[]} params.services - Array of services to restore * @param {string} params.newResourceId - Destination resource ID. Omit to restore the archived resource in place, or pass a different ID to restore alongside it as a new resource. 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.newResourceName - Database name. Max length: 128 chars. * @throws {AppwriteException} * @returns {Promise} */ createRestoration(params: { archiveId: string; services: BackupServices[]; newResourceId?: string; newResourceName?: string; }): Promise; /** * Create and trigger a new restoration for a backup on a project. * * For a backup of one database, the restoration resolves its destination before it is queued. When `newResourceId` is omitted, the archived database is restored in place and its own ID is returned in `options`. Pass a different `newResourceId` to restore alongside it as a new database instead. * * The restoration migration records the archived database in `resourceId` and `resourceType`, and the resolved database in `destinationResourceId` and `destinationResourceType`. Database types are stored canonically as `database`, `documentsdb`, or `vectorsdb`. Project-wide restorations leave these fields empty because they do not have a single source or destination database. * * To list every migration related to one database, use its canonical type in a nested `OR(AND(...), AND(...), AND(...))` across the root, parent, and destination relation pairs: `(resourceType, resourceId)`, `(parentResourceType, parentResourceId)`, and `(destinationResourceType, destinationResourceId)`. Legacy and TablesDB databases use `database`; the operational `resourceType` of a table migration is not rewritten to `tablesdb`. * * When restoring a DocumentsDB or VectorsDB database from a dedicated source, the restore provisions a fresh dedicated backing database at the source database's own specification and lands the data there. An in-place restore swaps the database onto that backing only once the restore has succeeded, and retires the backing it displaced only once that swap is confirmed, so the source keeps serving its own data until the restored data is in place and any failure leaves it untouched. A serverless source has no dedicated backing to clone and restores onto the archived database instead. * * * @param {string} archiveId - Backup archive ID to restore * @param {BackupServices[]} services - Array of services to restore * @param {string} newResourceId - Destination resource ID. Omit to restore the archived resource in place, or pass a different ID to restore alongside it as a new resource. 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} newResourceName - Database name. Max length: 128 chars. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ createRestoration(archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string): Promise; /** * List all backup restorations for a project. * * @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. * @throws {AppwriteException} * @returns {Promise} */ listRestorations(params?: { queries?: string[]; }): Promise; /** * List all backup restorations for a project. * * @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. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ listRestorations(queries?: string[]): Promise; /** * Get the current status of a backup restoration. * * @param {string} params.restorationId - Restoration ID. Choose a custom ID`. 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. * @throws {AppwriteException} * @returns {Promise} */ getRestoration(params: { restorationId: string; }): Promise; /** * Get the current status of a backup restoration. * * @param {string} restorationId - Restoration ID. Choose a custom ID`. 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. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getRestoration(restorationId: string): Promise; } export { Backups };