cloudflare-client
Version:
Universal HTTP client for Cloudflare API
40 lines (39 loc) • 1.07 kB
TypeScript
import { type Credentials } from "./fetch.js";
export declare type User = {
id: string;
email: string;
first_name: string | null;
last_name: string | null;
username: string | null;
telephone: string | null;
country: string | null;
zipcode: string | null;
created_on: string;
modified_on: string;
two_factor_authentication_enabled: boolean;
two_factor_authentication_locked: boolean;
has_pro_zones: boolean;
has_business_zones: boolean;
has_enterprise_zones: boolean;
organizations: Organization[];
betas: string[];
suspended: boolean;
};
export declare type Organization = {
id: string;
name: string;
permissions: string[];
roles: string[];
status: string;
};
/**
* The currently logged in / authenticated User
* @see https://api.cloudflare.com/#user-properties
*/
export declare function user(credentials: Credentials): {
/**
* The currently logged in/authenticated user
* @see https://api.cloudflare.com/#user-properties
*/
get: () => Promise<User>;
};