Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@boelensman1/tinderclient

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@boelensman1/tinderclient - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

lib/__tests__/getMeta.test.d.ts

2

lib/classes/photo.js

@@ -30,5 +30,5 @@ "use strict";

get() {
return this.tinderClient.getPhotoStream(this.url).then((r) => (r.data));
return this.tinderClient.getPhotoStream(this.url);
}
}
exports.Photo = Photo;
import { Suggestion } from '../classes';
import { UserMetaData } from '../interfaces';
/**

@@ -24,2 +25,6 @@ * The main class containing all the functions

/**
* Get your own meta data (swipes left, people seen, etc..)
*/
getMeta(): Promise<UserMetaData>;
/**
* Get photo stream

@@ -26,0 +31,0 @@ */

@@ -53,2 +53,18 @@ "use strict";

/**
* Get your own meta data (swipes left, people seen, etc..)
*/
getMeta() {
if (!this.authToken) {
throw new Error('Authenticate first!');
}
return this.client.get('/meta').then((result) => {
if (result.data.status !== 200) {
console.log(result);
throw new Error('Error while getting results');
}
delete result.data.status;
return result.data;
});
}
/**
* Get photo stream

@@ -60,5 +76,8 @@ */

}
return this.client.get(url, { baseURL: null, responseType: 'stream' });
return this.client.get(url, {
baseURL: null,
responseType: 'stream',
}).then((result) => (result.data));
}
}
exports.TinderClient = TinderClient;

@@ -7,1 +7,4 @@ export { Instagram } from './instagram';

export { SpotifyThemeTrack } from './spotifyThemeTrack';
export { Interest } from './interest';
export { User } from './user';
export { UserMetaData } from './userMetaData';
{
"name": "@boelensman1/tinderclient",
"version": "0.0.2",
"version": "0.0.3",
"description": "Wrapper for the tinder api",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -65,3 +65,3 @@ import { IncomingMessage } from 'http';

public get(): Promise<IncomingMessage> {
return this.tinderClient.getPhotoStream(this.url).then((r) => (r.data));
return this.tinderClient.getPhotoStream(this.url);
}

@@ -68,0 +68,0 @@ }

import axios from 'axios';
import { IncomingMessage } from 'http';
import { Suggestion, Photo } from '../classes';
import { UserMetaData } from '../interfaces';

@@ -73,8 +75,27 @@ const clientConfig = {

/**
* Get your own meta data (swipes left, people seen, etc..)
*/
public getMeta(): Promise<UserMetaData> {
if (!this.authToken) { throw new Error('Authenticate first!'); }
return this.client.get('/meta').then((result) => {
if (result.data.status !== 200) {
console.log(result);
throw new Error('Error while getting results');
}
delete result.data.status;
return result.data;
});
}
/**
* Get photo stream
*/
private getPhotoStream(url: string): Promise<any> {
private getPhotoStream(url: string): Promise<IncomingMessage> {
if (!this.authToken) { throw new Error('Authenticate first!'); }
return this.client.get(url, { baseURL: null, responseType: 'stream' });
return this.client.get(url, {
baseURL: null,
responseType: 'stream',
}).then((result) => (result.data));
}

@@ -81,0 +102,0 @@ }

@@ -7,1 +7,4 @@ export { Instagram } from './instagram';

export { SpotifyThemeTrack } from './spotifyThemeTrack';
export { Interest } from './interest';
export { User } from './user';
export { UserMetaData } from './userMetaData';
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc