1.0.0-alpha.1 • Published 2 years ago

@exobase/client-builder v1.0.0-alpha.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

@exobase/api

A library for creating clients that communicate with Exobase APIs

Usage

import apiMaker from '@exobase/api'
import * as t from './types'

export { ApiError, ApiResponse, Auth } from '@exobase/api'
export * from './types'


const createApi = (url: string) => {
  const endpoint = apiMaker(url)
  return {
    health: {
      ping: endpoint<{}, {
        message: 'pong'
      }>({
        module: 'health',
        function: 'ping'
      })
    },
    auth: {
      login: endpoint<{}, {
        user: t.User
        platforms: t.PlatformPreview[]
        platformId: string
        idToken: string
        exp: number
      }>({
        module: 'auth',
        function: 'login'
      })
    }
  }
}

const api = createApi('http://localhost:800')

await api.health.ping({})
const { error, data } = await api.auth.login({}, {
  token: 'abc=='
})
1.0.0-alpha.1

2 years ago

1.0.0-alpha.0

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.2-alpha.2

2 years ago

0.0.2-alpha.1

2 years ago

0.0.2-alpha.0

2 years ago

0.0.1

2 years ago