From e43284748572cd670a41056063873f0db353ad37 Mon Sep 17 00:00:00 2001 From: matiasdodersidedrawer Date: Sun, 24 Oct 2021 19:21:50 -0300 Subject: [PATCH] version 16 --- package.json | 2 +- src/index.ts | 5 +++++ src/services/network-service.ts | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index f6a1fb4..0349861 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "sidedrawer-javascript-sdk", "author": "Juan Matias Doder", "description": "This is a sdk of SideDrawer to help to build development quickly.", - "version": "0.1.15", + "version": "0.1.16", "license": "MIT", "main": "dist/index.js", "typings": "dist/index.d.ts", diff --git a/src/index.ts b/src/index.ts index 6c8cdb4..41d13f2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,12 @@ import * as authservice from './services/auth-service'; +import * as networkservice from './services/network-service'; export const createAuthSidedrawerClient = async (client_id: string) => { return await authservice.createAuthClient(client_id); }; +export const getSidedrawersOwned = async (token: string) => { + return networkservice.getOwned(token); +}; + diff --git a/src/services/network-service.ts b/src/services/network-service.ts index a370ed2..b3bcb0b 100644 --- a/src/services/network-service.ts +++ b/src/services/network-service.ts @@ -1,6 +1,6 @@ import config from '../config.json'; import axios from 'axios'; -import { Auth0Client } from '@auth0/auth0-spa-js'; +//import { Auth0Client } from '@auth0/auth0-spa-js'; const instance = axios.create({ @@ -16,7 +16,7 @@ export const getShared = async () => { return instance.get(`sidedrawer/shared`); }; -export const getOwned = async (token: any) => { +export const getOwned = async (token: string) => { return instance.get(`sidedrawer/owned`, { headers: { authorization: `Bearer ${token}` } }); };