@kwikpik/kwikpik.js
Version:
Javascript/Typescript convenience library that interfaces with the Kwik Pik business API
101 lines • 2.47 kB
TypeScript
import { RequestMessage } from "./requests";
interface Account {
/**
* Name of your business
*/
name: string;
/**
* Account id
*/
id: string;
/**
* Account email
*/
email: string;
/**
* Account phone number
*/
phoneNumber: string;
/**
* When the account was created
*/
createdAt: string;
/**
* When the account was updated
*/
updatedAt: string;
/**
* Authentication token
*/
token?: string;
/**
* If this account has been verified
*/
isVerified: boolean;
}
interface AccountWallet {
/**
* Wallet id
*/
id: string;
/**
* ID of account associated with this wallet
*/
userId: string;
/**
* Wallet's balance
*/
balance: number;
/**
* Wallet's pending payment
*/
bookBalance: number;
/**
* When the wallet was created
*/
createdAt: string;
/**
* When the wallet was updated
*/
updatedAt: string;
}
interface AccountRequestResponse extends RequestMessage {
id: string;
status: "CANCELLED" | "DELIVERED" | "INIT_RIDE_REQUEST" | "CONFIRMED_RIDE_REQUEST";
riderId: string | null;
inTransit: boolean;
createdAt: string;
}
export declare class Accounts {
private agent;
protected constructor(apiKey: string, environment?: "dev" | "prod");
/**
*
* @param apiKey Your Kwik-Pik API key
* @param environment dev or prod (development or production)
* @returns
* @description Initializes an account object
*/
static initialize(apiKey: string, environment?: "dev" | "prod"): Accounts;
/**
*
* @returns
* @description Returns the business account
*/
authenticate(): import("../https").KwikPikCallableHTTPsService<Account>;
/**
*
* @returns
* @description Returns a user's wallet
*/
wallet(): import("../https").KwikPikCallableHTTPsService<AccountWallet>;
/**
*
* @param page Page to navigate to in the request. If this isn't specified, the first page is active. It returns just 20 items.
* @description Returns a list of requests made with this account. An authentication is first executed.
* @returns
*/
getAccountRequests(page?: number): Promise<import("../https").KwikPikCallableHTTPsService<AccountRequestResponse[]>>;
}
export {};
//# sourceMappingURL=accounts.d.ts.map