You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.ts 837B

12345678910111213141516171819202122232425262728293031323334
  1. import PortalClient, { Client, Config } from './client'
  2. import methodGenerator, { MethodFactory } from './method'
  3. import resrouceGenerator, { ResourceFactory } from './resource'
  4. import got from 'got'
  5. export interface Portal {
  6. route: MethodFactory,
  7. resource: ResourceFactory,
  8. _client: Client,
  9. }
  10. export function createPortalClient (config: Config): Portal {
  11. const client = new PortalClient(got, config)
  12. const portal: Portal = {
  13. route: methodGenerator(client),
  14. resource: resrouceGenerator(client),
  15. _client: client,
  16. }
  17. return portal
  18. }
  19. export { MethodSpec } from './method'
  20. export { Client, rawResponseSymbol } from './client'
  21. // Can't a the moment run export { * as Joi } from 'joi'
  22. // so this clumsy way is the solution re-export
  23. import * as Joi from 'joi'
  24. export { Joi }
  25. export default createPortalClient