@nativescript/appwrite
Version:
Appwrite SDK for NativeScript
196 lines (195 loc) • 6.79 kB
TypeScript
export declare class Client {
private _native;
constructor();
setEndpoint(endpoint: string): this;
setProject(project: string): this;
setKey(key: string): this;
setJWT(jwt: string): this;
setSelfSigned(status: boolean): this;
setSession(session: string): this;
addHeader(key: string, value: string): this;
setForwardedUserAgent(value: string): this;
setLocale(value: string): this;
get native(): NSCAppwriteClient;
}
export declare class ID {
static custom(id: string): string;
static unique(): string;
}
export declare class Target {
private _native;
constructor(target: NSCAppwriteTarget);
get native(): NSCAppwriteTarget;
get createdAt(): string;
get expired(): boolean;
get id(): string;
get identifier(): string;
get name(): string;
get providerId(): string;
get providerType(): string;
get updatedAt(): string;
get userId(): string;
}
export declare class User {
private _native;
constructor(user: NSCAppwriteUser);
get native(): NSCAppwriteUser;
get accessedAt(): string;
get createdAt(): string;
get email(): string;
get emailVerification(): boolean;
get id(): string;
get labels(): Array<string>;
get mfa(): boolean;
get name(): string;
get password(): string;
get passwordUpdate(): string;
get phone(): string;
get phoneVerification(): boolean;
get prefs(): Record<string, any>;
get registration(): string;
get status(): boolean;
get targets(): Array<Target>;
get updatedAt(): string;
get userHash(): string;
toJSON(): any;
}
export declare class Account {
private _native;
constructor(client: Client);
get native(): NSCAppwriteAccount;
create(userId: string, email: string, password: string, name?: string): Promise<any>;
createEmailPasswordSession(email: string, password: string): Promise<Session>;
createSession(userId: string, secret: string): Promise<Session>;
createAnonymousSession(): Promise<Session>;
deleteSession(sessionId: string): Promise<void>;
}
export declare class Document {
private _native;
constructor(document: NSCAppwriteDocument);
get native(): NSCAppwriteDocument;
get collectionId(): string;
get createdAt(): string;
get data(): Record<any, any>;
get databaseId(): string;
get id(): string;
get permissions(): Array<string>;
get updatedAt(): string;
toJSON(): {
collectionId: string;
createdAt: string;
data: Record<any, any>;
databaseId: string;
id: string;
permissions: string[];
updatedAt: string;
};
}
export declare class Databases {
private _native;
constructor(client: Client);
get native(): NSCAppwriteDatabases;
createDocument(databaseId: string, collectionId: string, documentId: string, data?: Record<string, any>, permissions?: Array<string>): Promise<Document>;
getDocument(databaseId: string, collectionId: string, documentId: string, queries?: Array<string>): Promise<Document>;
listDocuments(databaseId: string, collectionId: string, queries?: Array<string>): Promise<unknown>;
updateDocument(databaseId: string, collectionId: string, documentId: string, data: Record<string, any>, permissions?: Array<string>): Promise<unknown>;
deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise<void>;
}
export declare class Functions {
private _native;
constructor(client: Client);
get native(): NSCAppwriteFunctions;
}
export declare class Storage {
private _native;
constructor(client: Client);
get native(): NSCAppwriteStorage;
}
export declare class Session {
private _native;
constructor(session: NSCAppwriteSession);
get native(): NSCAppwriteSession;
get clientCode(): string;
get clientEngine(): string;
get clientEngineVersion(): string;
get clientName(): string;
get clientType(): string;
get clientVersion(): string;
get countryCode(): string;
get countryName(): string;
get createdAt(): string;
get current(): boolean;
get deviceBrand(): string;
get deviceModel(): string;
get deviceName(): string;
get expire(): string;
get factors(): Array<string>;
get id(): string;
get ip(): string;
get mfaUpdatedAt(): string;
get osCode(): string;
get osName(): string;
get osVersion(): string;
get provider(): string;
get providerAccessToken(): string;
get providerAccessTokenExpiry(): string;
get providerRefreshToken(): string;
get providerUid(): string;
get secret(): string;
get updatedAt(): string;
get userId(): string;
toJSON(): {
clientCode: string;
clientEngine: string;
clientEngineVersion: string;
clientName: string;
clientType: string;
clientVersion: string;
countryCode: string;
countryName: string;
createdAt: string;
current: boolean;
deviceBrand: string;
deviceModel: string;
deviceName: string;
expire: string;
factors: string[];
id: string;
ip: string;
mfaUpdatedAt: string;
osCode: string;
osName: string;
osVersion: string;
provider: string;
providerAccessToken: string;
providerAccessTokenExpiry: string;
providerRefreshToken: string;
providerUid: string;
secret: string;
updatedAt: string;
userId: string;
};
}
export declare class Query {
static between(attribute: string, start: number, end: number): string;
static between(attribute: string, start: string, end: string): string;
static contains(attribute: string, value: any): string;
static cursorAfter(id: string): string;
static cursorBefore(id: string): string;
static endsWith(attribute: string, value: string): string;
static equal(attribute: string, value: any): string;
static greaterThanEqual(attribute: string, value: any): string;
static greaterThan(attribute: string, value: any): string;
static isNotNull(attribute: string): string;
static isNull(attribute: string): string;
static lessThanEqualWithAttribute(attribute: string, value: any): string;
static lessThan(attribute: string, value: any): string;
static limit(limit: number): string;
static notEqual(attribute: string, value: any): string;
static offset(offset: number): string;
static orderAsc(attribute: string): string;
static orderDesc(attribute: string): string;
static search(attribute: string, value: string): string;
static select(attributes: string[]): string;
static startsWith(attribute: string, value: string): string;
}