jsapi-torchiodev.com
TypeScript icon, indicating that this package has built-in type declarations

3.0.8 • Public • Published

jsapi-torchiodev.com

Typescript/Javascript API to access personal data of my own.

Dara from api.torchiodev.com. Used in torchiodev.com.

Typescript files in src folder.

index.ts exports every module.

Mirrorred Javascript generated in dist folder

package.main points to dist/index, exporting all files

Procedure:

  1. Import Api
  2. Create fetcher instance
  3. Set authorization
  4. Create api instance
  5. Call methods

let fetcher = new DirectusFetcher('http://api.address.com')
 .setAuthorizationHeader('Bearer fdafdsa453')
let api = new Api(fetcher )
 .getAppInfo()
 .then(appinfo => console.dir(appinfo));

Methods - fetch(ModelName)

  1. getAppInfo(): Promise;
  2. getAbout(): Promise;
  3. getWorks(): Promise<Work[]>;
  4. getServices(): Promise<Service[]>;
  5. getExperiences(): Promise<Experience[]>;
  6. getSkills(): Promise<Skill[]>;
  7. getEducations(): Promise<Education[]>;
  8. getLanguages(): Promise<Language[]>;
  9. getSocials(): Promise<Social[]>;

Fetcher methods (get fetcher back in api.getFetcher())

  1. getApiUrl():string;
  2. getBaseUrl(): string;
  3. setApiUrl(apiUrl: string);
  4. setBaseUrl(baseUrl: string);
  5. setAuthorizationHeader(token:string): IFetcher;

Models

AppInfo

  title: string;
  contact_email: string;
  main_image: Image;
  logo: Image;

About

  avatar_image: Image;
  cover_letter: string;

Work

  title: string;
  url: string;
  date: string;
  info: string;
  thumbnail: Image;
  color: string;

Vue plugin

  1. import property 'vuePlugin' as torchioapi
  2. options baseUrl is required
  Vue.use(torchioapi, {
    baseUrl: 'https://api.torchiodev.com',
    authentication: 'bearer hu5i432higfd...',
    propertyName: 'whateverYouWant' // makes accessible in this.$whateverYouWant
  });

Readme

Keywords

Package Sidebar

Install

npm i jsapi-torchiodev.com

Weekly Downloads

0

Version

3.0.8

License

ISC

Unpacked Size

51.8 kB

Total Files

76

Last publish

Collaborators

  • pedrotorchio