Skip to content

Commit 01f58a8

Browse files
committed
v2.9
1 parent ecfb1d2 commit 01f58a8

File tree

18 files changed

+569
-360
lines changed

18 files changed

+569
-360
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,5 @@ node_modules/
131131
coverage/
132132
lib
133133
test/mytest
134-
dist/
134+
dist/
135+
dump.json

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# swarmapp-api
22

3+
## 2.9.0
4+
5+
### Minor Changes
6+
7+
- aBsTr@ct!0n
8+
39
## 2.8.1
410

511
### Patch Changes

NOTES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Notes
2+
3+
some functions willl not work if the `oauth_token` was generated through an application created after 2021.
4+
you may use a `man in the middle` proxy to detect your mobile app oauth token

examples/authenticate.ts

Whitespace-only changes.

examples/example.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
import 'dotenv/config'
3+
import SwarmappApi from '../src';
4+
5+
const token:string = process.env.token || "";
6+
const username:string = process.env.username || "";
7+
const password:string = process.env.password || "";
8+
const client_id:string = process.env.client_id || "";
9+
const client_secret:string = process.env.client_secret || "";
10+
11+
12+
console.log(token);
13+
const swarm = new SwarmappApi(token);
14+
15+
const run = async() =>{
16+
let result: any;
17+
18+
result = await swarm.initialize();
19+
console.log(result);
20+
21+
// attempt authentication multifactor
22+
result = await swarm.initiatemultifactorlogin(username, password, client_id, client_secret);
23+
console.log(result);
24+
process.exit(0);
25+
26+
27+
// test friends
28+
result = await swarm.getFriends();
29+
console.log("friends", result);
30+
31+
// test recent checkins
32+
result = await swarm.getRecent({limit:1});
33+
console.log("checkins", result);
34+
35+
// test like
36+
const lastCheckin = await swarm.getRecent({limit:1});
37+
result = await swarm.likeCheckin(lastCheckin[0].id);
38+
console.log("like", result);
39+
40+
// test checkin
41+
result = await swarm.checkIn("4b5a8e1cf964a520a0b628e3");
42+
console.log("checkin", result);
43+
44+
// test like unliked
45+
result = await swarm.likeUnliked();
46+
console.log("like unliked", result);
47+
48+
49+
50+
51+
}
52+
53+
run();

package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"name": "swarmapp-api",
3-
"version": "2.8.1",
3+
"version": "2.9.0",
44
"description": "A javascript wrapper for swarmapp (foursquare) API",
55
"main": "dist/index.js",
6-
"module": "dist/index.mjs",
7-
"types": "dist/index.d.ts",
6+
"types": "./dist/index.d.ts",
87
"scripts": {
98
"test": "jest --coverage",
109
"release": "pnpm run build && changeset publish",
1110
"clean": "shx rm -rf lib && shx rm -rf dist",
1211
"lint": "tsc",
13-
"build": "pnpm run clean && tsup src/index.ts --format cjs,esm --dts"
12+
"build": "pnpm run clean && tsup src/index.ts --format cjs,esm --dts",
13+
"run-sample": "ts-node examples/example.ts"
1414
},
1515
"repository": {
1616
"type": "git",
@@ -19,6 +19,8 @@
1919
"keywords": [
2020
"api",
2121
"javascript",
22+
"typescript",
23+
"ts",
2224
"js",
2325
"swarm",
2426
"swarmapp",
@@ -34,6 +36,7 @@
3436
"homepage": "https://github.com/6degrees/swarmapp-api#readme",
3537
"dependencies": {
3638
"axios": "^0.26.1",
39+
"dotenv": "^16.3.1",
3740
"form-data": "^4.0.0",
3841
"lodash": "^4.17.21"
3942
},
@@ -43,6 +46,7 @@
4346
"@types/node": "^18.15.11",
4447
"jest": "^29.5.0",
4548
"shx": "^0.3.4",
49+
"ts-node": "^10.9.1",
4650
"tsup": "^6.7.0",
4751
"typescript": "^5.0.3"
4852
}

0 commit comments

Comments
 (0)