appwrite-utils-cli
Version:
Appwrite Utility Functions to help with database management, data conversion, data import, migrations, and much more. Meant to be used as a CLI tool, I do not recommend installing this in frontend environments.
109 lines (108 loc) • 3.24 kB
TypeScript
import { z } from "zod";
/**
* Schema for comprehensive backup manifest
*
* This manifest tracks all databases and buckets included in a comprehensive backup,
* allowing for complete system restoration.
*/
export interface DatabaseBackupReference {
databaseId: string;
databaseName: string;
backupFileId: string;
manifestFileId: string;
collectionCount: number;
documentCount: number;
sizeBytes: number;
status: 'completed' | 'partial' | 'failed';
error?: string;
}
export interface BucketBackupReference {
bucketId: string;
bucketName: string;
backupFileId: string;
manifestFileId: string;
fileCount: number;
sizeBytes: number;
status: 'completed' | 'partial' | 'failed';
error?: string;
}
export interface ComprehensiveManifest {
version: string;
backupId: string;
createdAt: string;
databases: DatabaseBackupReference[];
buckets: BucketBackupReference[];
totalSizeBytes: number;
status: 'completed' | 'partial' | 'failed';
errors?: string[];
}
export declare const DatabaseBackupReferenceSchema: z.ZodObject<{
databaseId: z.ZodString;
databaseName: z.ZodString;
backupFileId: z.ZodString;
manifestFileId: z.ZodString;
collectionCount: z.ZodNumber;
documentCount: z.ZodNumber;
sizeBytes: z.ZodNumber;
status: z.ZodEnum<{
completed: "completed";
failed: "failed";
partial: "partial";
}>;
error: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export declare const BucketBackupReferenceSchema: z.ZodObject<{
bucketId: z.ZodString;
bucketName: z.ZodString;
backupFileId: z.ZodString;
manifestFileId: z.ZodString;
fileCount: z.ZodNumber;
sizeBytes: z.ZodNumber;
status: z.ZodEnum<{
completed: "completed";
failed: "failed";
partial: "partial";
}>;
error: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export declare const ComprehensiveManifestSchema: z.ZodObject<{
version: z.ZodDefault<z.ZodString>;
backupId: z.ZodString;
createdAt: z.ZodString;
databases: z.ZodArray<z.ZodObject<{
databaseId: z.ZodString;
databaseName: z.ZodString;
backupFileId: z.ZodString;
manifestFileId: z.ZodString;
collectionCount: z.ZodNumber;
documentCount: z.ZodNumber;
sizeBytes: z.ZodNumber;
status: z.ZodEnum<{
completed: "completed";
failed: "failed";
partial: "partial";
}>;
error: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
buckets: z.ZodArray<z.ZodObject<{
bucketId: z.ZodString;
bucketName: z.ZodString;
backupFileId: z.ZodString;
manifestFileId: z.ZodString;
fileCount: z.ZodNumber;
sizeBytes: z.ZodNumber;
status: z.ZodEnum<{
completed: "completed";
failed: "failed";
partial: "partial";
}>;
error: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
totalSizeBytes: z.ZodNumber;
status: z.ZodEnum<{
completed: "completed";
failed: "failed";
partial: "partial";
}>;
errors: z.ZodOptional<z.ZodArray<z.ZodString>>;
}, z.core.$strip>;