@halo-dev/admin-api
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.0-alpha.47 • Public • Published

    Admin API Client

    npm version npm node-current NPM

    JavaScript SDK for Halo's Admin API,implemented with TypeScript,encapsulating parameter types and return value types to make the use of API more brief.

    Installation

    npm install @halo-dev/admin-api --save

    Usage

    Here is a simple code for obtaining a list of posts.

    import { AdminApiClient, HaloRestAPIClient } from '@halo-dev/admin-api'
    
    // http request tool for halo rest api.
    const haloRestApiClient = new HaloRestAPIClient({
      baseUrl: process.env.HALO_BASE_URL,
    })
    
    // create adminApiClient by haloRestApiCLient.
    const haloAdminClient = new AdminApiClient(haloRestApiClient)
    
    // obtaining a list of articles.
    haloAdminClient.post.list().then((res) => {
      console.log(res)
    })

    You can also view the complete implementation of the halo-admin project: @halo-dev/halo-admin.

    License

    MIT license

    Install

    npm i @halo-dev/admin-api

    DownloadsWeekly Downloads

    138

    Version

    1.0.0-alpha.47

    License

    MIT

    Unpacked Size

    218 kB

    Total Files

    127

    Last publish

    Collaborators

    • ruibaby
    • guching