dashattach 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +58 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,11 +1,67 @@
1
1
  # DashAttach
2
2
  Dashattach - library for interacting with the Dash API.
3
- Last version: 0.0.2
3
+
4
+ Last version: 0.0.3
5
+
4
6
  npm: https://www.npmjs.com/package/dashattach
5
7
 
8
+ ## Documentation
9
+
6
10
  Installing - `npm i dashattach`
7
11
 
8
- # Import
12
+ ### Install and import
13
+ ```bash
14
+ npm install dashattach
15
+ ```
9
16
  ```JavaScript (ESM)
10
17
  import DashAttach from "dashattach"
18
+ ```
19
+ ### Login
20
+ ```JavaScript
21
+ await DashAttach.auth.login(user, password)
22
+ // Example:
23
+ await DashAttach.auth.login("Dasher", "Password30532")
24
+ // Check is login:
25
+ await DashAttach.auth.myInfo.isLogin()
26
+ // Example:
27
+ if (await DashAttach.auth.myInfo.isLogin()) {
28
+ console.log("You is login in Dash")
29
+ } else {
30
+ console.log("You is not login in Dash")
31
+ }
32
+ ```
33
+ ### Get my information
34
+ ```JavaScript
35
+ await DashAttach.auth.myInfo.getMyId() // get my id in Dash. Return: number/null
36
+ await DashAttach.auth.myInfo.getMyUsername() // get my username in Dash. Return: string
37
+ await DashAttach.auth.myInfo.getMyMessages() // get my messages in Dash. Return: array
38
+ ```
39
+ ### Get user information
40
+ ```JavaScript
41
+ await DashAttach.info.users.getUsername(id) // get username of user by id. Support: olny number, return: string
42
+ await DashAttach.info.users.getId(username) // get id of user by id. Return: number
43
+ await DashAttach.info.users.getRole(user) // get role of user by id/username. Return: string
44
+ await DashAttach.info.description.getDescription(user) // get description of user by id/username. Return: string
45
+ await DashAttach.info.users.date.join(user) // get join date of user by id/username. Return: string
46
+ await DashAttach.info.users.date.lastActive(user) // get date of last active of user by id/username. Return: string
47
+ await DashAttach.info.users.getLinks(user) // get links of user by id/username. Return: array
48
+ await DashAttach.info.users.getAchievements(user) // get achievements of user by id/username. Return: array
49
+ await DashAttach.info.users.getRecommendedProject(user) // get recommended project of user by id/username. Return: object
50
+ await DashAttach.info.users.getProjects(user, offset, limit) // get projects of user by id/username. Return: array
51
+ await DashAttach.info.users.getFollowers(user, offset, limit) // get followers of user by id/username. Return: array
52
+ await DashAttach.info.users.getFollowing(user, offset, limit) // get following of user by id/username. Return: array
53
+ await DashAttach.info.users.getGradient(user) // get gradient (olny for Dash Supporters) of user by id/username. Return: unknown
54
+ DashAttach.info.users.getAvatar(user) // get avatar url of user by id/username. Return: string
55
+ ```
56
+ ### Get project information
57
+ ```JavaScript
58
+ await DashAttach.info.projects.getName(id) // get name of project. Return: string
59
+ await DashAttach.info.projects.getAuthorId(id) // get id of author of project. Return: number
60
+ await DashAttach.info.projects.getAuthorUsername(id) // get username of author of project. Return: string
61
+ await DashAttach.info.projects.getDescription(id) // get description of project. Return: string
62
+ DashAttach.info.projects.getTrumbnail(id) // get trumbnail user of project. Return: string
63
+ ```
64
+ ### Other
65
+ ```JavaScript
66
+ await DashAttach.featuredProjects(offset, limit) // get featured projects. Return: array
11
67
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dashattach",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Library for interacting with the Dash API.",
5
5
  "homepage": "https://github.com/shaman2016scratch/DashAttach",
6
6
  "bugs": {