Hierarchy

  • Api<void>
    • Api

Constructors

Properties

auth: {
    applyDataMerge: ((data: HandlerRequestAuthDataMergeApply, params?: RequestParams) => Promise<HttpResponse<HandlerResponseAuthDataMergeApply, HandlerMap & {
        msg?: string;
    }>>);
    checkDataMerge: ((params?: RequestParams) => Promise<HttpResponse<HandlerResponseAuthDataMergeCheck, HandlerMap & {
        msg?: string;
    }>>);
    loginByEmail: ((data: HandlerRequestAuthEmailLogin, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserLogin, HandlerMap & {
        msg?: string;
    }>>);
    registerByEmail: ((data: HandlerRequestAuthEmailRegister, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserLogin, HandlerMap & {
        msg?: string;
    }>>);
    sendVerifyEmail: ((data: HandlerRequestAuthEmailSend, params?: RequestParams) => Promise<HttpResponse<HandlerMap & {
        msg?: string;
    }, HandlerMap & {
        msg?: string;
    }>>);
} = ...

Type declaration

  • applyDataMerge: ((data: HandlerRequestAuthDataMergeApply, params?: RequestParams) => Promise<HttpResponse<HandlerResponseAuthDataMergeApply, HandlerMap & {
        msg?: string;
    }>>)

    This function is to solve the problem of multiple users with the same email address, should be called after user login and then check, and perform data merge.

    Auth

    ApplyDataMerge

    Apply data merge

    POST:/auth/merge

    200 HandlerResponseAuthDataMergeApply OK

    400 `(HandlerMap & { msg?: string,

    })` Bad Request

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (data, params?): Promise<HttpResponse<HandlerResponseAuthDataMergeApply, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • data: HandlerRequestAuthDataMergeApply
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseAuthDataMergeApply, HandlerMap & {
            msg?: string;
        }>>

  • checkDataMerge: ((params?: RequestParams) => Promise<HttpResponse<HandlerResponseAuthDataMergeCheck, HandlerMap & {
        msg?: string;
    }>>)

    Get all users with same email, if there are more than one user with same email, need merge

    Auth

    CheckDataMerge

    Check data merge

    GET:/auth/merge

    200 HandlerResponseAuthDataMergeCheck OK

    400 `(HandlerMap & { msg?: string,

    })` Bad Request

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (params?): Promise<HttpResponse<HandlerResponseAuthDataMergeCheck, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseAuthDataMergeCheck, HandlerMap & {
            msg?: string;
        }>>

  • loginByEmail: ((data: HandlerRequestAuthEmailLogin, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserLogin, HandlerMap & {
        msg?: string;
    }>>)

    Login by email with verify code (Need send email verify code first) or password

    Auth

    LoginByEmail

    Login by email

    POST:/auth/email/login

    200 HandlerResponseUserLogin OK

    400 `(HandlerMap & { msg?: string,

    })` Bad Request

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (data, params?): Promise<HttpResponse<HandlerResponseUserLogin, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • data: HandlerRequestAuthEmailLogin
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseUserLogin, HandlerMap & {
            msg?: string;
        }>>

  • registerByEmail: ((data: HandlerRequestAuthEmailRegister, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserLogin, HandlerMap & {
        msg?: string;
    }>>)

    Register by email and verify code (if user exists, will update user, like forget or change password. Need send email verify code first)

    Auth

    RegisterByEmail

    Register by email

    POST:/auth/email/register

    200 HandlerResponseUserLogin OK

    400 `(HandlerMap & { msg?: string,

    })` Bad Request

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (data, params?): Promise<HttpResponse<HandlerResponseUserLogin, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • data: HandlerRequestAuthEmailRegister
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseUserLogin, HandlerMap & {
            msg?: string;
        }>>

  • sendVerifyEmail: ((data: HandlerRequestAuthEmailSend, params?: RequestParams) => Promise<HttpResponse<HandlerMap & {
        msg?: string;
    }, HandlerMap & {
        msg?: string;
    }>>)

    Send email including verify code to user

    Auth

    SendVerifyEmail

    Send verify email

    POST:/auth/email/send

    200 `(HandlerMap & { msg?: string,

    })` OK

    400 `(HandlerMap & { msg?: string,

    })` Bad Request

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (data, params?): Promise<HttpResponse<HandlerMap & {
            msg?: string;
        }, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • data: HandlerRequestAuthEmailSend
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerMap & {
            msg?: string;
        }, HandlerMap & {
            msg?: string;
        }>>

baseUrl: string = '/api/v2'
cache: {
    flushCache: ((params?: RequestParams) => Promise<HttpResponse<HandlerMap & {
        msg?: string;
    }, HandlerMap & {
        msg?: string;
    }>>);
    warmUpCache: ((params?: RequestParams) => Promise<HttpResponse<HandlerMap & {
        msg?: string;
    }, HandlerMap & {
        msg?: string;
    }>>);
} = ...

Type declaration

  • flushCache: ((params?: RequestParams) => Promise<HttpResponse<HandlerMap & {
        msg?: string;
    }, HandlerMap & {
        msg?: string;
    }>>)

    Flush all cache on the server

    Cache

    FlushCache

    Flush Cache

    POST:/cache/flush

    200 `(HandlerMap & { msg?: string,

    })` OK

    400 `(HandlerMap & { msg?: string,

    })` Bad Request

    403 `(HandlerMap & { msg?: string,

    })` Forbidden

      • (params?): Promise<HttpResponse<HandlerMap & {
            msg?: string;
        }, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerMap & {
            msg?: string;
        }, HandlerMap & {
            msg?: string;
        }>>

  • warmUpCache: ((params?: RequestParams) => Promise<HttpResponse<HandlerMap & {
        msg?: string;
    }, HandlerMap & {
        msg?: string;
    }>>)

    Cache warming helps you to pre-load the cache to improve the performance of the first request

    Cache

    WarmUpCache

    Warm-Up Cache

    POST:/cache/warm_up

    200 `(HandlerMap & { msg?: string,

    })` OK

    400 `(HandlerMap & { msg?: string,

    })` Bad Request

    403 `(HandlerMap & { msg?: string,

    })` Forbidden

      • (params?): Promise<HttpResponse<HandlerMap & {
            msg?: string;
        }, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerMap & {
            msg?: string;
        }, HandlerMap & {
            msg?: string;
        }>>

captcha: {
    getCaptcha: ((params?: RequestParams) => Promise<HttpResponse<HandlerResponseCaptchaGet, HandlerMap & {
        msg?: string;
    }>>);
    getCaptchaStatus: ((params?: RequestParams) => Promise<HttpResponse<HandlerResponseCaptchaStatus, any>>);
    verifyCaptcha: ((data: HandlerParamsCaptchaVerify, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
        img_data?: string;
    }>>);
} = ...

Type declaration

  • getCaptcha: ((params?: RequestParams) => Promise<HttpResponse<HandlerResponseCaptchaGet, HandlerMap & {
        msg?: string;
    }>>)

    Get a base64 encoded captcha image or a HTML page to verify for user

    Captcha

    GetCaptcha

    Get Captcha

    GET:/captcha

    200 HandlerResponseCaptchaGet OK

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (params?): Promise<HttpResponse<HandlerResponseCaptchaGet, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseCaptchaGet, HandlerMap & {
            msg?: string;
        }>>

  • getCaptchaStatus: ((params?: RequestParams) => Promise<HttpResponse<HandlerResponseCaptchaStatus, any>>)

    Get the status of the user's captcha verification

    Captcha

    GetCaptchaStatus

    Get Captcha Status

    GET:/captcha/status

    200 HandlerResponseCaptchaStatus OK

      • (params?): Promise<HttpResponse<HandlerResponseCaptchaStatus, any>>
      • Parameters

        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseCaptchaStatus, any>>

  • verifyCaptcha: ((data: HandlerParamsCaptchaVerify, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
        img_data?: string;
    }>>)

    Verify user enters correct captcha code

    Captcha

    VerifyCaptcha

    Verify Captcha

    POST:/captcha/verify

    200 HandlerMap OK

    403 `(HandlerMap & { img_data?: string,

    })` Forbidden

      • (data, params?): Promise<HttpResponse<HandlerMap, HandlerMap & {
            img_data?: string;
        }>>
      • Parameters

        • data: HandlerParamsCaptchaVerify
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerMap, HandlerMap & {
            img_data?: string;
        }>>

comments: {
    createComment: ((comment: HandlerParamsCommentCreate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseCommentCreate, HandlerMap & {
        msg?: string;
    }>>);
    deleteComment: ((id: number, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
        msg?: string;
    }>>);
    getComment: ((id: number, params?: RequestParams) => Promise<HttpResponse<HandlerResponseCommentGet, HandlerMap & {
        msg?: string;
    }>>);
    getComments: ((query: {
        email?: string;
        flat_mode?: boolean;
        limit?: number;
        name?: string;
        offset?: number;
        page_key: string;
        scope?: "page" | "user" | "site";
        search?: string;
        site_name?: string;
        sort_by?: "date_asc" | "date_desc" | "vote";
        type?:
            | "all"
            | "pending"
            | "mentions"
            | "mine";
        view_only_admin?: boolean;
    }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseCommentList, HandlerMap & {
        msg?: string;
    }>>);
    updateComment: ((id: number, comment: HandlerParamsCommentUpdate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseCommentUpdate, HandlerMap & {
        msg?: string;
    }>>);
} = ...

Type declaration

  • createComment: ((comment: HandlerParamsCommentCreate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseCommentCreate, HandlerMap & {
        msg?: string;
    }>>)

    Create a new comment

    Comment

    CreateComment

    Create Comment

    POST:/comments

    200 HandlerResponseCommentCreate OK

    400 `(HandlerMap & { msg?: string,

    })` Bad Request

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (comment, params?): Promise<HttpResponse<HandlerResponseCommentCreate, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • comment: HandlerParamsCommentCreate
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseCommentCreate, HandlerMap & {
            msg?: string;
        }>>

  • deleteComment: ((id: number, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
        msg?: string;
    }>>)

    Delete a specific comment

    Comment

    DeleteComment

    Delete Comment

    DELETE:/comments/{id}

    200 HandlerMap OK

    403 `(HandlerMap & { msg?: string,

    })` Forbidden

    404 `(HandlerMap & { msg?: string,

    })` Not Found

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (id, params?): Promise<HttpResponse<HandlerMap, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • id: number
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerMap, HandlerMap & {
            msg?: string;
        }>>

  • getComment: ((id: number, params?: RequestParams) => Promise<HttpResponse<HandlerResponseCommentGet, HandlerMap & {
        msg?: string;
    }>>)

    Get the detail of a comment by comment id

    Comment

    GetComment

    Get a comment

    GET:/comments/{id}

    200 HandlerResponseCommentGet OK

    404 `(HandlerMap & { msg?: string,

    })` Not Found

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (id, params?): Promise<HttpResponse<HandlerResponseCommentGet, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • id: number
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseCommentGet, HandlerMap & {
            msg?: string;
        }>>

  • getComments: ((query: {
        email?: string;
        flat_mode?: boolean;
        limit?: number;
        name?: string;
        offset?: number;
        page_key: string;
        scope?: "page" | "user" | "site";
        search?: string;
        site_name?: string;
        sort_by?: "date_asc" | "date_desc" | "vote";
        type?:
            | "all"
            | "pending"
            | "mentions"
            | "mine";
        view_only_admin?: boolean;
    }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseCommentList, HandlerMap & {
        msg?: string;
    }>>)

    Get a list of comments by some conditions

    Comment

    GetComments

    Get Comment List

    GET:/comments

    200 HandlerResponseCommentList OK

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (query, params?): Promise<HttpResponse<HandlerResponseCommentList, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • query: {
              email?: string;
              flat_mode?: boolean;
              limit?: number;
              name?: string;
              offset?: number;
              page_key: string;
              scope?: "page" | "user" | "site";
              search?: string;
              site_name?: string;
              sort_by?: "date_asc" | "date_desc" | "vote";
              type?:
                  | "all"
                  | "pending"
                  | "mentions"
                  | "mine";
              view_only_admin?: boolean;
          }
          • Optionalemail?: string

            The user email

          • Optionalflat_mode?: boolean

            Enable flat_mode

          • Optionallimit?: number

            The limit for pagination

          • Optionalname?: string

            The username

          • Optionaloffset?: number

            The offset for pagination

          • page_key: string

            The comment page_key

          • Optionalscope?: "page" | "user" | "site"

            The scope of comments

          • Optionalsearch?: string

            Search keywords

          • Optionalsite_name?: string

            The site name of your content scope

          • Optionalsort_by?: "date_asc" | "date_desc" | "vote"

            Sort by condition

          • Optionaltype?:
                | "all"
                | "pending"
                | "mentions"
                | "mine"

            Message center show type

          • Optionalview_only_admin?: boolean

            Only show comments by admin

        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseCommentList, HandlerMap & {
            msg?: string;
        }>>

  • updateComment: ((id: number, comment: HandlerParamsCommentUpdate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseCommentUpdate, HandlerMap & {
        msg?: string;
    }>>)

    Update a specific comment

    Comment

    UpdateComment

    Update Comment

    PUT:/comments/{id}

    200 HandlerResponseCommentUpdate OK

    400 `(HandlerMap & { msg?: string,

    })` Bad Request

    403 `(HandlerMap & { msg?: string,

    })` Forbidden

    404 `(HandlerMap & { msg?: string,

    })` Not Found

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (id, comment, params?): Promise<HttpResponse<HandlerResponseCommentUpdate, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • id: number
        • comment: HandlerParamsCommentUpdate
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseCommentUpdate, HandlerMap & {
            msg?: string;
        }>>

conf: {
    conf: ((params?: RequestParams) => Promise<HttpResponse<CommonConfData, any>>);
    getDomain: ((query?: {
        url?: string;
    }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseConfDomain, any>>);
    getSocialLoginProviders: ((params?: RequestParams) => Promise<HttpResponse<HandlerResponseConfAuthProviders, HandlerMap & {
        msg?: string;
    }>>);
} = ...

Type declaration

  • conf: ((params?: RequestParams) => Promise<HttpResponse<CommonConfData, any>>)

    Get System Configs for UI

    System

    Conf

    Get System Configs

    GET:/conf

    200 CommonConfData OK

      • (params?): Promise<HttpResponse<CommonConfData, any>>
      • Parameters

        • params: RequestParams = {}

        Returns Promise<HttpResponse<CommonConfData, any>>

  • getDomain: ((query?: {
        url?: string;
    }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseConfDomain, any>>)

    Get Domain Info

    System

    GetDomain

    Get Domain Info

    GET:/conf/domain

    200 HandlerResponseConfDomain OK

      • (query?, params?): Promise<HttpResponse<HandlerResponseConfDomain, any>>
      • Parameters

        • Optionalquery: {
              url?: string;
          }
          • Optionalurl?: string

            Domain URL

        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseConfDomain, any>>

  • getSocialLoginProviders: ((params?: RequestParams) => Promise<HttpResponse<HandlerResponseConfAuthProviders, HandlerMap & {
        msg?: string;
    }>>)

    Get social login providers

    System

    GetSocialLoginProviders

    Get Social Login Providers

    GET:/conf/auth/providers

    200 HandlerResponseConfAuthProviders OK

    404 `(HandlerMap & { msg?: string,

    })` Not Found

      • (params?): Promise<HttpResponse<HandlerResponseConfAuthProviders, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseConfAuthProviders, HandlerMap & {
            msg?: string;
        }>>

notifies: {
    getNotifies: ((query: {
        email: string;
        name: string;
    }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseNotifyList, HandlerMap & {
        msg?: string;
    }>>);
    markAllNotifyRead: ((options: HandlerParamsNotifyReadAll, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
        msg?: string;
    }>>);
    markNotifyRead: ((commentId: number, notifyKey: string, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
        msg?: string;
    }>>);
} = ...

Type declaration

  • getNotifies: ((query: {
        email: string;
        name: string;
    }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseNotifyList, HandlerMap & {
        msg?: string;
    }>>)

    Get a list of notifies for user

    Notify

    GetNotifies

    Get Notifies

    GET:/notifies

    200 HandlerResponseNotifyList OK

    400 `(HandlerMap & { msg?: string,

    })` Bad Request

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (query, params?): Promise<HttpResponse<HandlerResponseNotifyList, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • query: {
              email: string;
              name: string;
          }
          • email: string

            The user email

          • name: string

            The user name

        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseNotifyList, HandlerMap & {
            msg?: string;
        }>>

  • markAllNotifyRead: ((options: HandlerParamsNotifyReadAll, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
        msg?: string;
    }>>)

    Mark all notifies as read for user

    Notify

    MarkAllNotifyRead

    Mark All Notifies as Read

    POST:/notifies/read

    200 HandlerMap OK

    400 `(HandlerMap & { msg?: string,

    })` Bad Request

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (options, params?): Promise<HttpResponse<HandlerMap, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • options: HandlerParamsNotifyReadAll
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerMap, HandlerMap & {
            msg?: string;
        }>>

  • markNotifyRead: ((commentId: number, notifyKey: string, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
        msg?: string;
    }>>)

    Mark specific notification as read for user

    Notify

    MarkNotifyRead

    Mark Notify as Read

    POST:/notifies/{comment_id}/{notify_key}

    200 HandlerMap OK

    400 `(HandlerMap & { msg?: string,

    })` Bad Request

    404 `(HandlerMap & { msg?: string,

    })` Not Found

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (commentId, notifyKey, params?): Promise<HttpResponse<HandlerMap, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • commentId: number
        • notifyKey: string
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerMap, HandlerMap & {
            msg?: string;
        }>>

pages: {
    deletePage: ((id: number, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
        msg?: string;
    }>>);
    fetchAllPages: ((options: HandlerParamsPageFetchAll, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
        msg?: string;
    }>>);
    fetchPage: ((id: number, params?: RequestParams) => Promise<HttpResponse<HandlerResponsePageFetch, HandlerMap & {
        msg?: string;
    }>>);
    getPageFetchStatus: ((params?: RequestParams) => Promise<HttpResponse<HandlerResponsePageFetchStatus, any>>);
    getPages: ((query?: {
        limit?: number;
        offset?: number;
        search?: string;
        site_name?: string;
    }, params?: RequestParams) => Promise<HttpResponse<HandlerResponsePageList, HandlerMap & {
        msg?: string;
    }>>);
    logPv: ((page: HandlerParamsPagePV, params?: RequestParams) => Promise<HttpResponse<HandlerResponsePagePV, any>>);
    updatePage: ((id: number, page: HandlerParamsPageUpdate, params?: RequestParams) => Promise<HttpResponse<HandlerResponsePageUpdate, HandlerMap & {
        msg?: string;
    }>>);
} = ...

Type declaration

  • deletePage: ((id: number, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
        msg?: string;
    }>>)

    Delete a specific page

    Page

    DeletePage

    Delete Page

    DELETE:/pages/{id}

    200 HandlerMap OK

    403 `(HandlerMap & { msg?: string,

    })` Forbidden

    404 `(HandlerMap & { msg?: string,

    })` Not Found

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (id, params?): Promise<HttpResponse<HandlerMap, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • id: number
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerMap, HandlerMap & {
            msg?: string;
        }>>

  • fetchAllPages: ((options: HandlerParamsPageFetchAll, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
        msg?: string;
    }>>)

    Fetch the data of all pages

    Page

    FetchAllPages

    Fetch All Pages Data

    POST:/pages/fetch

    200 HandlerMap OK

    400 `(HandlerMap & { msg?: string,

    })` Bad Request

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (options, params?): Promise<HttpResponse<HandlerMap, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • options: HandlerParamsPageFetchAll
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerMap, HandlerMap & {
            msg?: string;
        }>>

  • fetchPage: ((id: number, params?: RequestParams) => Promise<HttpResponse<HandlerResponsePageFetch, HandlerMap & {
        msg?: string;
    }>>)

    Fetch the data of a specific page

    Page

    FetchPage

    Fetch Page Data

    POST:/pages/{id}/fetch

    200 HandlerResponsePageFetch OK

    404 `(HandlerMap & { msg?: string,

    })` Not Found

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (id, params?): Promise<HttpResponse<HandlerResponsePageFetch, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • id: number
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponsePageFetch, HandlerMap & {
            msg?: string;
        }>>

  • getPageFetchStatus: ((params?: RequestParams) => Promise<HttpResponse<HandlerResponsePageFetchStatus, any>>)

    Get the status of the task of fetching all pages

    Page

    GetPageFetchStatus

    Get Pages Fetch Status

    GET:/pages/fetch/status

    200 HandlerResponsePageFetchStatus OK

      • (params?): Promise<HttpResponse<HandlerResponsePageFetchStatus, any>>
      • Parameters

        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponsePageFetchStatus, any>>

  • getPages: ((query?: {
        limit?: number;
        offset?: number;
        search?: string;
        site_name?: string;
    }, params?: RequestParams) => Promise<HttpResponse<HandlerResponsePageList, HandlerMap & {
        msg?: string;
    }>>)

    Get a list of pages by some conditions

    Page

    GetPages

    Get Page List

    GET:/pages

    200 HandlerResponsePageList OK

    403 `(HandlerMap & { msg?: string,

    })` Forbidden

      • (query?, params?): Promise<HttpResponse<HandlerResponsePageList, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • Optionalquery: {
              limit?: number;
              offset?: number;
              search?: string;
              site_name?: string;
          }
          • Optionallimit?: number

            The limit for pagination

          • Optionaloffset?: number

            The offset for pagination

          • Optionalsearch?: string

            Search keywords

          • Optionalsite_name?: string

            The site name of your content scope

        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponsePageList, HandlerMap & {
            msg?: string;
        }>>

  • logPv: ((page: HandlerParamsPagePV, params?: RequestParams) => Promise<HttpResponse<HandlerResponsePagePV, any>>)

    Increase and get the number of page views

    Page

    LogPv

    Increase Page Views (PV)

    POST:/pages/pv

    200 HandlerResponsePagePV OK

      • (page, params?): Promise<HttpResponse<HandlerResponsePagePV, any>>
      • Parameters

        • page: HandlerParamsPagePV
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponsePagePV, any>>

  • updatePage: ((id: number, page: HandlerParamsPageUpdate, params?: RequestParams) => Promise<HttpResponse<HandlerResponsePageUpdate, HandlerMap & {
        msg?: string;
    }>>)

    Update a specific page

    Page

    UpdatePage

    Update Page

    PUT:/pages/{id}

    200 HandlerResponsePageUpdate OK

    400 `(HandlerMap & { msg?: string,

    })` Bad Request

    403 `(HandlerMap & { msg?: string,

    })` Forbidden

    404 `(HandlerMap & { msg?: string,

    })` Not Found

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (id, page, params?): Promise<HttpResponse<HandlerResponsePageUpdate, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • id: number
        • page: HandlerParamsPageUpdate
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponsePageUpdate, HandlerMap & {
            msg?: string;
        }>>

sendEmail: {
    sendEmail: ((email: HandlerParamsEmailSend, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap | HandlerMap & {
        msg?: string;
    }>>);
} = ...

Type declaration

  • sendEmail: ((email: HandlerParamsEmailSend, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap | HandlerMap & {
        msg?: string;
    }>>)

    Send an email to test the email sender

    System

    SendEmail

    Send Email

    POST:/send_email

    200 HandlerMap OK

    403 `(HandlerMap & { msg?: string,

    })` Forbidden

    500 HandlerMap Internal Server Error

      • (email, params?): Promise<HttpResponse<HandlerMap, HandlerMap | HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • email: HandlerParamsEmailSend
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerMap, HandlerMap | HandlerMap & {
            msg?: string;
        }>>

settings: {
    applySettings: ((settings: HandlerParamsSettingApply, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
        msg?: string;
    }>>);
    getSettings: ((params?: RequestParams) => Promise<HttpResponse<HandlerResponseSettingGet, HandlerMap & {
        msg?: string;
    }>>);
    getSettingsTemplate: ((locale: string, params?: RequestParams) => Promise<HttpResponse<HandlerResponseSettingTemplate, any>>);
} = ...

Type declaration

  • applySettings: ((settings: HandlerParamsSettingApply, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
        msg?: string;
    }>>)

    Apply settings and restart the server

    System

    ApplySettings

    Save and apply Settings

    PUT:/settings

    200 HandlerMap OK

    403 `(HandlerMap & { msg?: string,

    })` Forbidden

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (settings, params?): Promise<HttpResponse<HandlerMap, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • settings: HandlerParamsSettingApply
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerMap, HandlerMap & {
            msg?: string;
        }>>

  • getSettings: ((params?: RequestParams) => Promise<HttpResponse<HandlerResponseSettingGet, HandlerMap & {
        msg?: string;
    }>>)

    Get settings from app config file

    System

    GetSettings

    Get Settings

    GET:/settings

    200 HandlerResponseSettingGet OK

    403 `(HandlerMap & { msg?: string,

    })` Forbidden

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (params?): Promise<HttpResponse<HandlerResponseSettingGet, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseSettingGet, HandlerMap & {
            msg?: string;
        }>>

  • getSettingsTemplate: ((locale: string, params?: RequestParams) => Promise<HttpResponse<HandlerResponseSettingTemplate, any>>)

    Get config templates in different languages for rendering the settings page in the frontend

    System

    GetSettingsTemplate

    Get Settings Template

    GET:/settings/template/{locale}

    200 HandlerResponseSettingTemplate OK

      • (locale, params?): Promise<HttpResponse<HandlerResponseSettingTemplate, any>>
      • Parameters

        • locale: string
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseSettingTemplate, any>>

sites: {
    createSite: ((site: HandlerParamsSiteCreate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseSiteCreate, HandlerMap & {
        msg?: string;
    }>>);
    deleteSite: ((id: number, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
        msg?: string;
    }>>);
    getSites: ((params?: RequestParams) => Promise<HttpResponse<HandlerResponseSiteList, any>>);
    updateSite: ((id: number, site: HandlerParamsSiteUpdate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseSiteUpdate, any>>);
} = ...

Type declaration

  • createSite: ((site: HandlerParamsSiteCreate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseSiteCreate, HandlerMap & {
        msg?: string;
    }>>)

    Create a new site

    Site

    CreateSite

    Create Site

    POST:/sites

    200 HandlerResponseSiteCreate OK

    400 `(HandlerMap & { msg?: string,

    })` Bad Request

    403 `(HandlerMap & { msg?: string,

    })` Forbidden

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (site, params?): Promise<HttpResponse<HandlerResponseSiteCreate, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • site: HandlerParamsSiteCreate
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseSiteCreate, HandlerMap & {
            msg?: string;
        }>>

  • deleteSite: ((id: number, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
        msg?: string;
    }>>)

    Delete a specific site

    Site

    DeleteSite

    Site Delete

    DELETE:/sites/{id}

    200 HandlerMap OK

    403 `(HandlerMap & { msg?: string,

    })` Forbidden

    404 `(HandlerMap & { msg?: string,

    })` Not Found

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (id, params?): Promise<HttpResponse<HandlerMap, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • id: number
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerMap, HandlerMap & {
            msg?: string;
        }>>

  • getSites: ((params?: RequestParams) => Promise<HttpResponse<HandlerResponseSiteList, any>>)

    Get a list of sites by some conditions

    Site

    GetSites

    Get Site List

    GET:/sites

    200 HandlerResponseSiteList OK

      • (params?): Promise<HttpResponse<HandlerResponseSiteList, any>>
      • Parameters

        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseSiteList, any>>

  • updateSite: ((id: number, site: HandlerParamsSiteUpdate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseSiteUpdate, any>>)

    Update a specific site

    Site

    UpdateSite

    Update Site

    PUT:/sites/{id}

    200 HandlerResponseSiteUpdate OK

      • (id, site, params?): Promise<HttpResponse<HandlerResponseSiteUpdate, any>>
      • Parameters

        • id: number
        • site: HandlerParamsSiteUpdate
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseSiteUpdate, any>>

stats: {
    getStats: ((type:
        | "latest_comments"
        | "latest_pages"
        | "pv_most_pages"
        | "comment_most_pages"
        | "page_pv"
        | "site_pv"
        | "page_comment"
        | "site_comment"
        | "rand_comments"
        | "rand_pages", query?: {
        limit?: number;
        page_keys?: string;
        site_name?: string;
    }, params?: RequestParams) => Promise<HttpResponse<CommonJSONResult, HandlerMap & {
        msg?: string;
    }>>);
} = ...

Type declaration

  • getStats: ((type:
        | "latest_comments"
        | "latest_pages"
        | "pv_most_pages"
        | "comment_most_pages"
        | "page_pv"
        | "site_pv"
        | "page_comment"
        | "site_comment"
        | "rand_comments"
        | "rand_pages", query?: {
        limit?: number;
        page_keys?: string;
        site_name?: string;
    }, params?: RequestParams) => Promise<HttpResponse<CommonJSONResult, HandlerMap & {
        msg?: string;
    }>>)

    Get the statistics of various data analysis

    Statistic

    GetStats

    Statistic

    GET:/stats/{type}

    200 CommonJSONResult OK

    400 `(HandlerMap & { msg?: string,

    })` Bad Request

    403 `(HandlerMap & { msg?: string,

    })` Forbidden

    404 `(HandlerMap & { msg?: string,

    })` Not Found

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (type, query?, params?): Promise<HttpResponse<CommonJSONResult, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • type:
              | "latest_comments"
              | "latest_pages"
              | "pv_most_pages"
              | "comment_most_pages"
              | "page_pv"
              | "site_pv"
              | "page_comment"
              | "site_comment"
              | "rand_comments"
              | "rand_pages"
        • Optionalquery: {
              limit?: number;
              page_keys?: string;
              site_name?: string;
          }
          • Optionallimit?: number

            The limit for pagination

          • Optionalpage_keys?: string

            multiple page keys separated by commas

          • Optionalsite_name?: string

            The site name of your content scope

        • params: RequestParams = {}

        Returns Promise<HttpResponse<CommonJSONResult, HandlerMap & {
            msg?: string;
        }>>

transfer: {
    exportArtrans: ((params?: RequestParams) => Promise<HttpResponse<HandlerResponseTransferExport, HandlerMap & {
        msg?: string;
    }>>);
    importArtrans: ((data: HandlerParamsTransferImport, params?: RequestParams) => Promise<HttpResponse<string, any>>);
    uploadArtrans: ((data: {
        file: File;
    }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseTransferUpload & {
        filename?: string;
    }, HandlerMap & {
        msg?: string;
    }>>);
} = ...

Type declaration

  • exportArtrans: ((params?: RequestParams) => Promise<HttpResponse<HandlerResponseTransferExport, HandlerMap & {
        msg?: string;
    }>>)

    Export data from Artalk

    Transfer

    ExportArtrans

    Export Artrans

    GET:/transfer/export

    200 HandlerResponseTransferExport OK

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (params?): Promise<HttpResponse<HandlerResponseTransferExport, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseTransferExport, HandlerMap & {
            msg?: string;
        }>>

  • importArtrans: ((data: HandlerParamsTransferImport, params?: RequestParams) => Promise<HttpResponse<string, any>>)

    Import data to Artalk

    Transfer

    ImportArtrans

    Import Artrans

    POST:/transfer/import

    200 string OK

      • (data, params?): Promise<HttpResponse<string, any>>
      • Parameters

        • data: HandlerParamsTransferImport
        • params: RequestParams = {}

        Returns Promise<HttpResponse<string, any>>

  • uploadArtrans: ((data: {
        file: File;
    }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseTransferUpload & {
        filename?: string;
    }, HandlerMap & {
        msg?: string;
    }>>)

    Upload a file to prepare to import

    Transfer

    UploadArtrans

    Upload Artrans

    POST:/transfer/upload

    200 `(HandlerResponseTransferUpload & { filename?: string,

    })` OK

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (data, params?): Promise<HttpResponse<HandlerResponseTransferUpload & {
            filename?: string;
        }, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • data: {
              file: File;
          }
          • file: File

            Upload file in preparation for import task

            binary

        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseTransferUpload & {
            filename?: string;
        }, HandlerMap & {
            msg?: string;
        }>>

upload: {
    upload: ((data: {
        file: File;
    }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUpload, HandlerMap & {
        msg?: string;
    }>>);
} = ...

Type declaration

  • upload: ((data: {
        file: File;
    }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUpload, HandlerMap & {
        msg?: string;
    }>>)

    Upload file from this endpoint

    Upload

    Upload

    Upload

    POST:/upload

    200 HandlerResponseUpload OK

    400 `(HandlerMap & { msg?: string,

    })` Bad Request

    403 `(HandlerMap & { msg?: string,

    })` Forbidden

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (data, params?): Promise<HttpResponse<HandlerResponseUpload, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • data: {
              file: File;
          }
          • file: File

            Upload file

            binary

        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseUpload, HandlerMap & {
            msg?: string;
        }>>

user: {
    getUser: ((query?: {
        email?: string;
        name?: string;
    }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserInfo, HandlerMap & {
        msg?: string;
    }>>);
    getUserStatus: ((query?: {
        email?: string;
        name?: string;
    }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserStatus, any>>);
    login: ((user: HandlerParamsUserLogin, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserLogin, HandlerMap & {
        data?: {
            need_name_select?: (...)[];
        };
        msg?: string;
    } | HandlerMap & {
        msg?: string;
    }>>);
    updateProfile: ((data: HandlerRequestUserInfoUpdate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserInfoUpdate, HandlerMap & {
        msg?: string;
    }>>);
} = ...

Type declaration

  • getUser: ((query?: {
        email?: string;
        name?: string;
    }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserInfo, HandlerMap & {
        msg?: string;
    }>>)

    Get user info to prepare for login or check current user status

    Auth

    GetUser

    Get User Info

    GET:/user

    200 HandlerResponseUserInfo OK

    400 `(HandlerMap & { msg?: string,

    })` Bad Request

      • (query?, params?): Promise<HttpResponse<HandlerResponseUserInfo, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • Optionalquery: {
              email?: string;
              name?: string;
          }
          • Optionalemail?: string

            The user email

          • Optionalname?: string

            The username

        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseUserInfo, HandlerMap & {
            msg?: string;
        }>>

  • getUserStatus: ((query?: {
        email?: string;
        name?: string;
    }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserStatus, any>>)

    Get user login status by header Authorization

    Auth

    GetUserStatus

    Get Login Status

    GET:/user/status

    200 HandlerResponseUserStatus OK

      • (query?, params?): Promise<HttpResponse<HandlerResponseUserStatus, any>>
      • Parameters

        • Optionalquery: {
              email?: string;
              name?: string;
          }
          • Optionalemail?: string

            The user email

          • Optionalname?: string

            The username

        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseUserStatus, any>>

  • login: ((user: HandlerParamsUserLogin, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserLogin, HandlerMap & {
        data?: {
            need_name_select?: (...)[];
        };
        msg?: string;
    } | HandlerMap & {
        msg?: string;
    }>>)

    Login user by name or email

    Auth

    Login

    Get Access Token

    POST:/user/access_token

    200 HandlerResponseUserLogin OK

    400 `(HandlerMap & { data?: { need_name_select?: (string)[],

    }, msg?: string,

    })` Multiple users with the same email address are matched

    401 `(HandlerMap & { msg?: string,

    })` Unauthorized

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (user, params?): Promise<HttpResponse<HandlerResponseUserLogin, HandlerMap & {
            data?: {
                need_name_select?: (...)[];
            };
            msg?: string;
        } | HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • user: HandlerParamsUserLogin
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseUserLogin, HandlerMap & {
            data?: {
                need_name_select?: (...)[];
            };
            msg?: string;
        } | HandlerMap & {
            msg?: string;
        }>>

  • updateProfile: ((data: HandlerRequestUserInfoUpdate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserInfoUpdate, HandlerMap & {
        msg?: string;
    }>>)

    Update user profile when user is logged in

    Auth

    UpdateProfile

    Update user profile

    POST:/user

    200 HandlerResponseUserInfoUpdate OK

    400 `(HandlerMap & { msg?: string,

    })` Bad Request

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (data, params?): Promise<HttpResponse<HandlerResponseUserInfoUpdate, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • data: HandlerRequestUserInfoUpdate
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseUserInfoUpdate, HandlerMap & {
            msg?: string;
        }>>

users: {
    createUser: ((user: HandlerParamsUserCreate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserCreate, HandlerMap & {
        msg?: string;
    }>>);
    deleteUser: ((id: number, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
        msg?: string;
    }>>);
    getUsers: ((type?: "all" | "admin" | "in_conf", query?: {
        limit?: number;
        offset?: number;
        search?: string;
    }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseAdminUserList, HandlerMap & {
        msg?: string;
    }>>);
    updateUser: ((id: number, user: HandlerParamsUserUpdate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserUpdate, HandlerMap & {
        msg?: string;
    }>>);
} = ...

Type declaration

  • createUser: ((user: HandlerParamsUserCreate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserCreate, HandlerMap & {
        msg?: string;
    }>>)

    Create a new user

    User

    CreateUser

    Create User

    POST:/users

    200 HandlerResponseUserCreate OK

    400 `(HandlerMap & { msg?: string,

    })` Bad Request

    403 `(HandlerMap & { msg?: string,

    })` Forbidden

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (user, params?): Promise<HttpResponse<HandlerResponseUserCreate, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • user: HandlerParamsUserCreate
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseUserCreate, HandlerMap & {
            msg?: string;
        }>>

  • deleteUser: ((id: number, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
        msg?: string;
    }>>)

    Delete a specific user

    User

    DeleteUser

    Delete User

    DELETE:/users/{id}

    200 HandlerMap OK

    403 `(HandlerMap & { msg?: string,

    })` Forbidden

    404 `(HandlerMap & { msg?: string,

    })` Not Found

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (id, params?): Promise<HttpResponse<HandlerMap, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • id: number
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerMap, HandlerMap & {
            msg?: string;
        }>>

  • getUsers: ((type?: "all" | "admin" | "in_conf", query?: {
        limit?: number;
        offset?: number;
        search?: string;
    }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseAdminUserList, HandlerMap & {
        msg?: string;
    }>>)

    Get a list of users by some conditions

    User

    GetUsers

    Get User List

    GET:/users/{type}

    200 HandlerResponseAdminUserList OK

    403 `(HandlerMap & { msg?: string,

    })` Forbidden

      • (type?, query?, params?): Promise<HttpResponse<HandlerResponseAdminUserList, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • Optionaltype: "all" | "admin" | "in_conf"
        • Optionalquery: {
              limit?: number;
              offset?: number;
              search?: string;
          }
          • Optionallimit?: number

            The limit for pagination

          • Optionaloffset?: number

            The offset for pagination

          • Optionalsearch?: string

            Search keywords

        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseAdminUserList, HandlerMap & {
            msg?: string;
        }>>

  • updateUser: ((id: number, user: HandlerParamsUserUpdate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserUpdate, HandlerMap & {
        msg?: string;
    }>>)

    Update a specific user

    User

    UpdateUser

    Update User

    PUT:/users/{id}

    200 HandlerResponseUserUpdate OK

    400 `(HandlerMap & { msg?: string,

    })` Bad Request

    403 `(HandlerMap & { msg?: string,

    })` Forbidden

    404 `(HandlerMap & { msg?: string,

    })` Not Found

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (id, user, params?): Promise<HttpResponse<HandlerResponseUserUpdate, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • id: number
        • user: HandlerParamsUserUpdate
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseUserUpdate, HandlerMap & {
            msg?: string;
        }>>

version: {
    getVersion: ((params?: RequestParams) => Promise<HttpResponse<CommonApiVersionData, any>>);
} = ...

Type declaration

  • getVersion: ((params?: RequestParams) => Promise<HttpResponse<CommonApiVersionData, any>>)

    Get the version of Artalk

    System

    GetVersion

    Get Version Info

    GET:/version

    200 CommonApiVersionData OK

      • (params?): Promise<HttpResponse<CommonApiVersionData, any>>
      • Parameters

        • params: RequestParams = {}

        Returns Promise<HttpResponse<CommonApiVersionData, any>>

votes: {
    createVote: ((targetName: "page" | "comment", targetId: number, choice: "up" | "down", vote: HandlerParamsVoteCreate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseVote, HandlerMap & {
        msg?: string;
    }>>);
    getVote: ((targetName: "page" | "comment", targetId: number, params?: RequestParams) => Promise<HttpResponse<HandlerResponseVote, HandlerMap & {
        msg?: string;
    }>>);
    syncVotes: ((params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
        msg?: string;
    }>>);
} = ...

Type declaration

  • createVote: ((targetName: "page" | "comment", targetId: number, choice: "up" | "down", vote: HandlerParamsVoteCreate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseVote, HandlerMap & {
        msg?: string;
    }>>)

    Create a new vote for a specific comment or page

    Vote

    CreateVote

    Create Vote

    POST:/votes/{target_name}/{target_id}/{choice}

    200 HandlerResponseVote OK

    403 `(HandlerMap & { msg?: string,

    })` Forbidden

    404 `(HandlerMap & { msg?: string,

    })` Not Found

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (targetName, targetId, choice, vote, params?): Promise<HttpResponse<HandlerResponseVote, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • targetName: "page" | "comment"
        • targetId: number
        • choice: "up" | "down"
        • vote: HandlerParamsVoteCreate
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseVote, HandlerMap & {
            msg?: string;
        }>>

  • getVote: ((targetName: "page" | "comment", targetId: number, params?: RequestParams) => Promise<HttpResponse<HandlerResponseVote, HandlerMap & {
        msg?: string;
    }>>)

    Get vote status for a specific comment or page

    Vote

    GetVote

    Get Vote Status

    GET:/votes/{target_name}/{target_id}

    200 HandlerResponseVote OK

    403 `(HandlerMap & { msg?: string,

    })` Forbidden

    404 `(HandlerMap & { msg?: string,

    })` Not Found

    500 `(HandlerMap & { msg?: string,

    })` Internal Server Error

      • (targetName, targetId, params?): Promise<HttpResponse<HandlerResponseVote, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • targetName: "page" | "comment"
        • targetId: number
        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerResponseVote, HandlerMap & {
            msg?: string;
        }>>

  • syncVotes: ((params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
        msg?: string;
    }>>)

    Sync the number of votes in the comments or pages data tables to keep them the same as the votes table

    Vote

    SyncVotes

    Sync Vote Data

    POST:/votes/sync

    200 HandlerMap OK

    403 `(HandlerMap & { msg?: string,

    })` Forbidden

      • (params?): Promise<HttpResponse<HandlerMap, HandlerMap & {
            msg?: string;
        }>>
      • Parameters

        • params: RequestParams = {}

        Returns Promise<HttpResponse<HandlerMap, HandlerMap & {
            msg?: string;
        }>>

Methods

  • Parameters

    • cancelToken: CancelToken

    Returns void

  • Parameters

    • query: QueryParamsType
    • key: string

    Returns any

  • Parameters

    • query: QueryParamsType
    • key: string

    Returns string

  • Parameters

    • OptionalrawQuery: QueryParamsType

    Returns string

  • Parameters

    • cancelToken: CancelToken

    Returns undefined | AbortSignal

  • Parameters

    • key: string
    • value: any

    Returns string

  • Get user info as params for request

    Returns undefined | {
        email: string;
        name: string;
    }

    Request params with user info

  • Parameters

    • params1: RequestParams
    • Optionalparams2: RequestParams

    Returns RequestParams

  • Type Parameters

    • T = any
    • E = any

    Parameters

    • __namedParameters: FullRequestParams

    Returns Promise<HttpResponse<T, E>>

  • Parameters

    • data: null | void

    Returns void

  • Parameters

    • OptionalrawQuery: QueryParamsType

    Returns string