canny-api-js
Version:
Unofficial node API wrapper for Canny's API (https://canny.io/).
44 lines (43 loc) • 1.57 kB
TypeScript
import { AxiosInstance } from 'axios';
interface ICannyUserListArgs {
/** The number of entries you'd like to fetch. Defaults to 10 if not specified. Maximum value allowed: 100. */
limit?: number;
/** The number of entries you'd like to skip before starting to fetch. Defaults to 0 if not specified. */
skip?: number;
}
interface ICannyUserListResponse {
hasMore: boolean;
users: ICannyUser[];
}
interface ICannyUserFindOrCreateArgs {
/** The URL pointing to the user's avatar image. */
avatarURL?: string;
/** A list of companies the user is associated with. */
companies?: ICannyUserCompanyCreateArg[];
/** The date the user was created in your system. */
created?: string;
/** Any custom fields associated with the user. */
customFields?: ICannyCustomFields;
/** The user's email. */
email?: string;
/** The user's name. */
name: string;
/** The user's unique identifier in your application. */
userID: string;
}
interface ICannyUserFindOrCreateResponse {
id: string;
}
export default class Users {
static USERS_LIST_ROUTE: string;
static USERS_RETRIEVE_ROUTE: string;
static USERS_FIND_OR_CREATE_ROUTE: string;
static USERS_DELETE_ROUTE: string;
private axios;
constructor(axios: AxiosInstance);
list(args?: ICannyUserListArgs): Promise<ICannyUserListResponse>;
retrieve(id: string): Promise<ICannyUser>;
findOrCreate(args: ICannyUserFindOrCreateArgs): Promise<ICannyUserFindOrCreateResponse>;
delete(id: string): Promise<any>;
}
export {};