diff --git a/src/core.ts b/src/core.ts index 12e29cb..e760e8e 100644 --- a/src/core.ts +++ b/src/core.ts @@ -9,3 +9,4 @@ export * from "./provider/spotify" export * from "./provider/strava" export * from "./provider/untappd" export * from "./provider/vk" +export * from "./provider/thingiverse" diff --git a/src/provider/thingiverse.ts b/src/provider/thingiverse.ts new file mode 100644 index 0000000..5618022 --- /dev/null +++ b/src/provider/thingiverse.ts @@ -0,0 +1,21 @@ +import { OAuthProvider, IOAuthOptions } from "../provider"; + +/* + * Configuration options for using Thingiverse oauth + * @deprecated + */ +export interface IThingiverseOptions extends IOAuthOptions { +} + +export class Thingiverse extends OAuthProvider { + + options: IThingiverseOptions; + protected authUrl: string = 'https://www.thingiverse.com/login/oauth/authorize'; + protected defaults: Object = { + responseType: 'token' + }; + + constructor(options: IThingiverseOptions = {}) { + super(options); + } +} diff --git a/test/index.html b/test/index.html index 09aa48d..e604958 100644 --- a/test/index.html +++ b/test/index.html @@ -17,6 +17,7 @@ +
@@ -85,6 +87,11 @@ redurectUri: redirectUri, responseType: 'code' }) + networks.thingiverse = new providers.Thingiverse({ + clientId: document.forms.config.thingiverseId.value, + redirectUri: redirectUri, + responseType: 'code' + }) document.getElementById('login').addEventListener('click', function() { var providerName = Array.prototype.slice.call(document.forms.social.network) .filter(function(radio) { diff --git a/tsconfig.json b/tsconfig.json index 7b8be71..059fd7e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,6 +21,7 @@ "src/provider/meetup.ts", "src/provider/spotify.ts", "src/provider/linkedin.ts", + "src/provider/thingiverse.ts", "src/platform/browser.ts", "src/platform/cordova.ts", "node_modules/typescript/lib/lib.es6.d.ts"