realm-object-server
Version:
112 lines (111 loc) • 2.87 kB
TypeScript
import { RealmDefinition } from "../RealmFactory";
import { Realm, BaseRealmClass } from "../shared/realmUtil";
export declare enum UserStatus {
active = "active",
suspended = "suspended"
}
export declare class UserMetadataRow extends BaseRealmClass {
static schema: Realm.ObjectSchema;
users: Realm.Results<User>;
key: string;
value: string;
toJSON(): {
key: string;
value: string;
};
}
export declare class User extends BaseRealmClass {
static schema: {
name: string;
primaryKey: string;
properties: {
userId: {
type: string;
optional: boolean;
};
isAdmin: {
type: string;
optional: boolean;
};
accounts: {
type: string;
objectType: string;
};
metadata: {
type: string;
objectType: string;
default: any[];
optional: boolean;
};
status: {
type: string;
optional: boolean;
};
};
};
userId: string;
isAdmin: boolean;
accounts?: Account[];
metadata?: UserMetadataRow[];
status?: UserStatus;
isEmailConfirmed(): boolean;
created?: boolean;
toJSON(): {
user_id: string;
is_admin: boolean;
accounts: {
provider: string;
provider_id: string;
}[];
metadata: {
key: string;
value: string;
}[];
status: UserStatus;
};
static fromJSON(json: any): any;
}
export declare class Account extends BaseRealmClass {
static schema: Realm.ObjectSchema;
provider: string;
providerId: string;
users: Realm.Results<User>;
toJSON(): {
provider: string;
provider_id: string;
};
static fromJSON(json: any): any;
}
export declare class Permission extends BaseRealmClass {
static schema: Realm.ObjectSchema;
user: User;
realmFile: RealmFile;
mayRead: boolean;
mayWrite: boolean;
mayManage: boolean;
updatedAt: Date;
updatedBy: User;
}
export declare class PermissionOffer_Admin extends BaseRealmClass {
static schema: Realm.ObjectSchema;
id: string;
user: User;
realmFile: RealmFile;
createdAt: Date;
mayRead: boolean;
mayWrite: boolean;
mayManage: boolean;
expiresAt?: Date;
acceptedUsers: Realm.List<User>;
}
export declare class RealmFile extends BaseRealmClass {
static schema: Realm.ObjectSchema;
path: string;
realmType: string;
owner?: User | null;
syncLabel: string;
createdAt: Date;
permissions?: Realm.Results<Permission>;
lastVacuumed?: Date;
}
export declare const AdminRealm: RealmDefinition;