From b7a1666226862859c68a4f21b391e25dc9def4bd Mon Sep 17 00:00:00 2001 From: Stefan Mansson Date: Mon, 10 Feb 2020 19:23:11 +0100 Subject: [PATCH] fix: Dribbble api no longer static --- build.sh | 1 - package.json | 3 ++- src/Dribbble.ts | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index b656c67..4ef1f98 100644 --- a/build.sh +++ b/build.sh @@ -5,7 +5,6 @@ function BUNDLE { echo "Bundling..." rm -rf dist yarn bundle - mv dist/index.d.ts index.d.ts echo "Bundling done." } diff --git a/package.json b/package.json index 4832fa2..fbcc768 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "author": "Stefan Mansson ", "license": "MIT", "main": "dist/index.js", + "types": "dist/index.d.ts", "umd": "dist/index.umd.js", "module": "dist/index.m.js", "scripts": { @@ -52,4 +53,4 @@ "dependencies": { "whatwg-fetch": "^3.0.0" } -} \ No newline at end of file +} diff --git a/src/Dribbble.ts b/src/Dribbble.ts index 8b9f58d..82c6bac 100644 --- a/src/Dribbble.ts +++ b/src/Dribbble.ts @@ -9,7 +9,7 @@ export default class Dribbble { Request.authToken = options.authToken; } - public static get projects() { + public get projects() { return { list: () => { return Request.fetch({ url: '/user/projects', method: 'GET' }); @@ -26,7 +26,7 @@ export default class Dribbble { }; } - public static get attachments() { + public get attachments() { return { create: (shot: string, body: { file: File }) => { return Request.fetch({ url: `/shots/${shot}/attachments`, method: 'POST', body }); @@ -37,7 +37,7 @@ export default class Dribbble { }; } - public static get shots() { + public get shots() { return { list: () => { return Request.fetch({ url: '/user/shots', method: 'GET' }); @@ -76,7 +76,7 @@ export default class Dribbble { }; } - public static get user() { + public get user() { return { get: () => { return Request.fetch({ url: '/user', method: 'GET' });