import * as superagent from 'superagent'; declare type RepresentationType = 'view' | 'export_view' | 'styled_view' | 'storage' | 'editor2' | 'anonymous_export_view'; declare type AuthType = 'cookie' | 'basic' | 'no'; interface ContentBodyCreate { value: string; representation: RepresentationType; } interface ContentBody { view?: ContentBodyCreate; export_view?: ContentBodyCreate; styled_view?: ContentBodyCreate; storage?: ContentBodyCreate; editor2?: ContentBodyCreate; anonymous_export_view?: ContentBodyCreate; } export interface OperationCheckResult { operation: string; targetType: string; } export interface ContentChildType { _expandable: any; attachment?: any; comment?: any; page?: any; } export interface GenericLinks { [key: string]: string; } export interface ContentArray { results: Content[]; start: number; limit: number; size: number; _links: GenericLinks; } export interface ContentChildren { attachment?: ContentArray; comment?: ContentArray; page?: ContentArray; _expandable: any; _links: GenericLinks; } export interface Container { [key: string]: string; } export interface Icon { path: string; width: number; height: number; isDefault: boolean; } export interface SpacePermission { subject: any; operation: OperationCheckResult; anonymousAccess: boolean; unlicensedAccess: boolean; } export interface SpaceSettings { routeOverrideEnabled: boolean; _links: GenericLinks; } export interface ThemeNoLinks { themeKey: string; name: string; description: string; icon: Icon; [key: string]: any; } export interface MenusLookAndFeel { hoverOrFocus: any; color: string; } export interface ButtonLookAndFeel { backgroundColor: string; color: string; } export interface NavigationLookAndFeel { color: string; hoverOrFocus: any; } export interface SearchFieldLookAndFeel { backgroundColor: string; color: string; } export interface HeaderLookAndFeel { backgroundColor: string; button: ButtonLookAndFeel; primaryNavigation: NavigationLookAndFeel; secondaryNavigation: NavigationLookAndFeel; search: SearchFieldLookAndFeel; } export interface ScreenLookAndFeel { background: string; backgroundColor: string; backgroundImage: string; backgroundSize: string; gutterTop: string; gutterRight: string; gutterBottom: string; gutterLeft: string; } export interface ContainerLookAndFeel { background: string; backgroundColor: string; backgroundImage: string; backgroundSize: string; padding: string; borderRadius: string; } export interface ContentLookAndFeel { screen: ScreenLookAndFeel; container: ContainerLookAndFeel; header: ContainerLookAndFeel; body: ContainerLookAndFeel; } export interface LookAndFeel { headings: any; links: any; menus: MenusLookAndFeel; header: HeaderLookAndFeel; content: ContentLookAndFeel; bordersAndDividers: any; } export interface Space { id: number; key: string; name: string; type: string; status: string; _expandable: any; _links: GenericLinks; icon?: Icon; description?: any; homepage?: Content; metadata?: any; operations?: OperationCheckResult[]; permissions?: SpacePermission; setting?: SpaceSettings; theme?: ThemeNoLinks; lookAndFeel?: LookAndFeel; history?: any; } export interface UserDetails { business?: any; personal?: any; } export interface User { type: 'known' | 'unknown' | 'anonymous' | 'user'; accountId: string; accountType: 'atlassian' | 'app' | ''; email: string; publicName: string; profilePicture: Icon; displayName: string; _expandable: any; _links: GenericLinks; username?: string; userKey?: string; operations?: OperationCheckResult[]; details?: UserDetails; personalSpace?: Space; } export interface UsersUserKeys { users: User[]; userKeys: string[]; _links?: GenericLinks; } export interface Version { by: User; when: string; friendlyWhen: string; message: string; number: number; minorEdit: boolean; _expandable: any; _links: GenericLinks; content?: Content; collaborators?: UsersUserKeys; } export interface ContentHistory { latest: boolean; createdBy: User; createdDate: string; lastUpdated?: Version; previousVersion?: Version; contributors?: any; nextVersion?: Version; _expandable?: any; _links?: GenericLinks; } export interface Content { id: string; type: string; status: string; title: string; _expandable: any; _links: GenericLinks; space?: Space; history?: ContentHistory; version?: Version; body?: ContentBody; ancestors?: Content[]; operations?: OperationCheckResult[]; children?: ContentChildren; childrenTypes?: ContentChildType; descendants?: ContentChildren; container?: Container; restrictions?: any; [key: string]: any; } export default class Confluency { private host; private context; private username?; private password?; private authType?; private client; private cookieAuth; constructor(opts: { host: string; context?: string; username?: string; password?: string; authType?: AuthType; }); compositeUri({ prefix, uri }: { prefix: any; uri: any; }): string; newRequest(method: string, uri: string, noRestApi?: boolean): superagent.Request; GET(uri: string): Promise; POST(uri: string, body: any): Promise; PUT(uri: string, body: any): Promise; DEL(uri: string): Promise; createQueryString(parameters: any): string; getPage(pageId: string, expand?: string[]): Promise; getChildren(pageId: string, { all, expand }?: { all?: boolean | undefined; expand?: never[] | undefined; }): Promise; _getPagesAll(query: string, pages?: string[]): any; getPages(spaceKey: string, opts?: { all: boolean; limit: number; expand?: string[]; }): Promise; _getSpacesAll(query: string, spaces?: string[]): any; getSpaces(opts?: { all: boolean; limit: number; }): Promise; getSpace(spaceKey: string): Promise; create(opts: { space: string; title: string; content: string; parent?: string; representation?: RepresentationType; }): Promise; update(opts: { id: string; title: string; content: string; version: number; parent?: string; representation?: RepresentationType; }): Promise; del(pageId: string): Promise; tagLabel(pageId: string, label: string): Promise; tagLabels(pageId: string, labels: string[]): Promise; getLabels(pageId: string): Promise; untagLabel(pageId: string, label: string): Promise; search(cql: string, opts?: { limit?: number; expand?: string[]; }): Promise; changeParent(pageId: string, parentId: string): Promise; convertWikiMarkup(content: any): Promise; private auth; private makeCookieAuthPromise; } export {};