-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
569 additions
and
360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,4 +131,5 @@ node_modules/ | |
coverage/ | ||
lib | ||
test/mytest | ||
dist/ | ||
dist/ | ||
dump.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
# swarmapp-api | ||
|
||
## 2.9.0 | ||
|
||
### Minor Changes | ||
|
||
- aBsTr@ct!0n | ||
|
||
## 2.8.1 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Notes | ||
|
||
some functions willl not work if the `oauth_token` was generated through an application created after 2021. | ||
you may use a `man in the middle` proxy to detect your mobile app oauth token |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
|
||
import 'dotenv/config' | ||
import SwarmappApi from '../src'; | ||
|
||
const token:string = process.env.token || ""; | ||
const username:string = process.env.username || ""; | ||
const password:string = process.env.password || ""; | ||
const client_id:string = process.env.client_id || ""; | ||
const client_secret:string = process.env.client_secret || ""; | ||
|
||
|
||
console.log(token); | ||
const swarm = new SwarmappApi(token); | ||
|
||
const run = async() =>{ | ||
let result: any; | ||
|
||
result = await swarm.initialize(); | ||
console.log(result); | ||
|
||
// attempt authentication multifactor | ||
result = await swarm.initiatemultifactorlogin(username, password, client_id, client_secret); | ||
console.log(result); | ||
process.exit(0); | ||
|
||
|
||
// test friends | ||
result = await swarm.getFriends(); | ||
console.log("friends", result); | ||
|
||
// test recent checkins | ||
result = await swarm.getRecent({limit:1}); | ||
console.log("checkins", result); | ||
|
||
// test like | ||
const lastCheckin = await swarm.getRecent({limit:1}); | ||
result = await swarm.likeCheckin(lastCheckin[0].id); | ||
console.log("like", result); | ||
|
||
// test checkin | ||
result = await swarm.checkIn("4b5a8e1cf964a520a0b628e3"); | ||
console.log("checkin", result); | ||
|
||
// test like unliked | ||
result = await swarm.likeUnliked(); | ||
console.log("like unliked", result); | ||
|
||
|
||
|
||
|
||
} | ||
|
||
run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.