simply-xp 1.3.5-beta-7 → 2.0.0-dev.1

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 (65) hide show
  1. package/FUNDING.yml +2 -2
  2. package/README.md +69 -57
  3. package/lib/src/add.d.ts +28 -0
  4. package/lib/src/add.js +23 -0
  5. package/lib/src/cards.d.ts +91 -0
  6. package/lib/src/cards.js +23 -0
  7. package/lib/src/charts.d.ts +17 -0
  8. package/lib/src/charts.js +10 -0
  9. package/lib/src/connect.d.ts +26 -0
  10. package/lib/src/connect.js +47 -0
  11. package/lib/src/create.d.ts +12 -0
  12. package/lib/src/create.js +11 -0
  13. package/lib/src/deprecated/rank.d.ts +18 -0
  14. package/lib/src/deprecated/rank.js +12 -0
  15. package/lib/src/fetch.d.ts +12 -0
  16. package/lib/src/fetch.js +11 -0
  17. package/lib/src/functions/database.d.ts +111 -0
  18. package/lib/src/functions/database.js +56 -0
  19. package/lib/src/functions/utilities.d.ts +41 -0
  20. package/lib/src/functions/utilities.js +17 -0
  21. package/lib/src/functions/xplogs.d.ts +59 -0
  22. package/lib/src/functions/xplogs.js +1 -0
  23. package/lib/src/leaderboard.d.ts +27 -0
  24. package/lib/src/leaderboard.js +10 -0
  25. package/lib/src/migrate.d.ts +25 -0
  26. package/lib/src/migrate.js +19 -0
  27. package/lib/src/reset.d.ts +12 -0
  28. package/lib/src/reset.js +12 -0
  29. package/lib/src/roleSetup.d.ts +47 -0
  30. package/lib/src/roleSetup.js +29 -0
  31. package/lib/src/set.d.ts +25 -0
  32. package/lib/src/set.js +23 -0
  33. package/lib/xp.d.ts +25 -0
  34. package/lib/xp.js +45 -0
  35. package/package.json +70 -53
  36. package/.eslintrc.json +0 -29
  37. package/.github/CODE_OF_CONDUCT.md +0 -128
  38. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -31
  39. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  40. package/.github/SECURITY.md +0 -25
  41. package/.github/pull_request_template.md +0 -8
  42. package/.github/workflows/codeql-analysis.yml +0 -71
  43. package/.idea/discord.xml +0 -7
  44. package/.idea/misc.xml +0 -6
  45. package/.idea/modules.xml +0 -8
  46. package/.idea/simply-xp.iml +0 -9
  47. package/.idea/vcs.xml +0 -6
  48. package/index.d.ts +0 -107
  49. package/simplyxp.js +0 -31
  50. package/src/addLevel.js +0 -66
  51. package/src/addXP.js +0 -104
  52. package/src/charts.js +0 -92
  53. package/src/connect.js +0 -22
  54. package/src/create.js +0 -28
  55. package/src/fetch.js +0 -74
  56. package/src/leaderboard.js +0 -52
  57. package/src/lvlRole.js +0 -53
  58. package/src/models/level.js +0 -10
  59. package/src/models/lvlrole.js +0 -8
  60. package/src/rank.js +0 -295
  61. package/src/reset.js +0 -22
  62. package/src/roleSetup.js +0 -121
  63. package/src/setLevel.js +0 -70
  64. package/src/setXP.js +0 -51
  65. /package/{src → lib/src}/Fonts/Baloo-Regular.ttf +0 -0
package/package.json CHANGED
@@ -1,53 +1,70 @@
1
- {
2
- "name": "simply-xp",
3
- "version": "1.3.5-beta-7",
4
- "description": "A Simple, Easy and Beginner Friendly XP System",
5
- "main": "simplyxp.js",
6
- "typings": "index.d.ts",
7
- "scripts": {
8
- "test": "echo \"Error: no test specified\" && exit 1",
9
- "beta": "eslint . --fix && npm update && npm publish --tag beta"
10
- },
11
- "author": "Rahuletto",
12
- "keywords": [
13
- "xp",
14
- "simply",
15
- "easy",
16
- "xp-system",
17
- "system",
18
- "mongoose",
19
- "discord",
20
- "discord xp",
21
- "discord-xp",
22
- "simply-djs",
23
- "discord.js",
24
- "simplydjs",
25
- "weky",
26
- "nuggies",
27
- "experience",
28
- "level role",
29
- "amari",
30
- "package",
31
- "leaderboard",
32
- "mee6",
33
- "charts",
34
- "ChartJS",
35
- "level up"
36
- ],
37
- "license": "Apache-2.0",
38
- "repository": {
39
- "type": "git",
40
- "url": "https://github.com/Rahuletto/simply-xp"
41
- },
42
- "dependencies": {
43
- "@napi-rs/canvas": "^0.1.41",
44
- "chart.js": "^3.9.1",
45
- "mongoose": "^6.11.2"
46
- },
47
- "peerDependencies": {
48
- "discord.js": ">=13.12.0"
49
- },
50
- "devDependencies": {
51
- "eslint": "^8.43.0"
52
- }
53
- }
1
+ {
2
+ "name": "simply-xp",
3
+ "version": "2.0.0-dev.1",
4
+ "description": "The easiest way to implement xp system",
5
+ "main": "lib/xp.js",
6
+ "scripts": {
7
+ "beta": "node Tests/clean.mjs && pnpm update && npm publish --tag beta",
8
+ "clean": "node Tests/clean.mjs",
9
+ "dev": "node Tests/clean.mjs && pnpm update && npm publish --tag dev",
10
+ "docs": "node Tests/jsdocs.cjs",
11
+ "latest": "node Tests/clean.mjs && pnpm update && npm publish",
12
+ "test": "node Tests/clean.mjs && node Tests/test.cjs"
13
+ },
14
+ "author": "Abadima",
15
+ "keywords": [
16
+ "amaribot",
17
+ "charts",
18
+ "discord",
19
+ "discord.js",
20
+ "discord-xp",
21
+ "easy",
22
+ "fun",
23
+ "guilded",
24
+ "leaderboard",
25
+ "level role",
26
+ "level up",
27
+ "mee6",
28
+ "mongodb",
29
+ "package",
30
+ "simply",
31
+ "simply-djs",
32
+ "simplydjs",
33
+ "sqlite",
34
+ "system",
35
+ "xp"
36
+ ],
37
+ "license": "Apache-2.0",
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "git+https://github.com/Rahuletto/simply-xp.git"
41
+ },
42
+ "dependencies": {
43
+ "@napi-rs/canvas": "^0.1.41"
44
+ },
45
+ "devDependencies": {
46
+ "@types/better-sqlite3": "^7.6.4",
47
+ "@types/node": "^20.4.8",
48
+ "@typescript-eslint/eslint-plugin": "^6.2.1",
49
+ "@typescript-eslint/parser": "^6.2.1",
50
+ "better-sqlite3": "8.5.0",
51
+ "discord.js": "^14.12.1",
52
+ "eslint": "^8.46.0",
53
+ "guilded.ts": "^0.20.2",
54
+ "jsdoc-to-markdown": "^8.0.0",
55
+ "mongodb": "5.7.0",
56
+ "typescript": "^5.1.6",
57
+ "uglify-js": "^3.17.4"
58
+ },
59
+ "engines": {
60
+ "node": ">=15.5.0"
61
+ },
62
+ "bugs": {
63
+ "url": "https://github.com/Rahuletto/simply-xp/issues"
64
+ },
65
+ "homepage": "https://simplyxp.js.org",
66
+ "directories": {
67
+ "doc": "Mini_Docs",
68
+ "lib": "lib"
69
+ }
70
+ }
package/.eslintrc.json DELETED
@@ -1,29 +0,0 @@
1
- {
2
- "env": {
3
- "commonjs": true,
4
- "es2021": true,
5
- "node": true
6
- },
7
- "extends": "eslint:recommended",
8
- "parserOptions": {
9
- "ecmaVersion": "latest"
10
- },
11
- "rules": {
12
- "indent": [
13
- "error",
14
- "tab"
15
- ],
16
- "linebreak-style": [
17
- "error",
18
- "unix"
19
- ],
20
- "quotes": [
21
- "error",
22
- "single"
23
- ],
24
- "semi": [
25
- "error",
26
- "always"
27
- ]
28
- }
29
- }
@@ -1,128 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our
6
- community a harassment-free experience for everyone, regardless of age, body
7
- size, visible or invisible disability, ethnicity, sex characteristics, gender
8
- identity and expression, level of experience, education, socio-economic status,
9
- nationality, personal appearance, race, religion, or sexual identity
10
- and orientation.
11
-
12
- We pledge to act and interact in ways that contribute to an open, welcoming,
13
- diverse, inclusive, and healthy community.
14
-
15
- ## Our Standards
16
-
17
- Examples of behavior that contributes to a positive environment for our
18
- community include:
19
-
20
- * Demonstrating empathy and kindness toward other people
21
- * Being respectful of differing opinions, viewpoints, and experiences
22
- * Giving and gracefully accepting constructive feedback
23
- * Accepting responsibility and apologizing to those affected by our mistakes,
24
- and learning from the experience
25
- * Focusing on what is best not just for us as individuals, but for the
26
- overall community
27
-
28
- Examples of unacceptable behavior include:
29
-
30
- * The use of sexualized language or imagery, and sexual attention or
31
- advances of any kind
32
- * Trolling, insulting or derogatory comments, and personal or political attacks
33
- * Public or private harassment
34
- * Publishing others' private information, such as a physical or email
35
- address, without their explicit permission
36
- * Other conduct which could reasonably be considered inappropriate in a
37
- professional setting
38
-
39
- ## Enforcement Responsibilities
40
-
41
- Community leaders are responsible for clarifying and enforcing our standards of
42
- acceptable behavior and will take appropriate and fair corrective action in
43
- response to any behavior that they deem inappropriate, threatening, offensive,
44
- or harmful.
45
-
46
- Community leaders have the right and responsibility to remove, edit, or reject
47
- comments, commits, code, wiki edits, issues, and other contributions that are
48
- not aligned to this Code of Conduct, and will communicate reasons for moderation
49
- decisions when appropriate.
50
-
51
- ## Scope
52
-
53
- This Code of Conduct applies within all community spaces, and also applies when
54
- an individual is officially representing the community in public spaces.
55
- Examples of representing our community include using an official e-mail address,
56
- posting via an official social media account, or acting as an appointed
57
- representative at an online or offline event.
58
-
59
- ## Enforcement
60
-
61
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
- reported to the community leaders responsible for enforcement at
63
- Email.
64
- All complaints will be reviewed and investigated promptly and fairly.
65
-
66
- All community leaders are obligated to respect the privacy and security of the
67
- reporter of any incident.
68
-
69
- ## Enforcement Guidelines
70
-
71
- Community leaders will follow these Community Impact Guidelines in determining
72
- the consequences for any action they deem in violation of this Code of Conduct:
73
-
74
- ### 1. Correction
75
-
76
- **Community Impact**: Use of inappropriate language or other behavior deemed
77
- unprofessional or unwelcome in the community.
78
-
79
- **Consequence**: A private, written warning from community leaders, providing
80
- clarity around the nature of the violation and an explanation of why the
81
- behavior was inappropriate. A public apology may be requested.
82
-
83
- ### 2. Warning
84
-
85
- **Community Impact**: A violation through a single incident or series
86
- of actions.
87
-
88
- **Consequence**: A warning with consequences for continued behavior. No
89
- interaction with the people involved, including unsolicited interaction with
90
- those enforcing the Code of Conduct, for a specified period of time. This
91
- includes avoiding interactions in community spaces as well as external channels
92
- like social media. Violating these terms may lead to a temporary or
93
- permanent ban.
94
-
95
- ### 3. Temporary Ban
96
-
97
- **Community Impact**: A serious violation of community standards, including
98
- sustained inappropriate behavior.
99
-
100
- **Consequence**: A temporary ban from any sort of interaction or public
101
- communication with the community for a specified period of time. No public or
102
- private interaction with the people involved, including unsolicited interaction
103
- with those enforcing the Code of Conduct, is allowed during this period.
104
- Violating these terms may lead to a permanent ban.
105
-
106
- ### 4. Permanent Ban
107
-
108
- **Community Impact**: Demonstrating a pattern of violation of community
109
- standards, including sustained inappropriate behavior, harassment of an
110
- individual, or aggression toward or disparagement of classes of individuals.
111
-
112
- **Consequence**: A permanent ban from any sort of public interaction within
113
- the community.
114
-
115
- ## Attribution
116
-
117
- This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
- version 2.0, available at
119
- https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120
-
121
- Community Impact Guidelines were inspired by [Mozilla's code of conduct
122
- enforcement ladder](https://github.com/mozilla/diversity).
123
-
124
- [homepage]: https://www.contributor-covenant.org
125
-
126
- For answers to common questions about this code of conduct, see the FAQ at
127
- https://www.contributor-covenant.org/faq. Translations are available at
128
- https://www.contributor-covenant.org/translations.
@@ -1,31 +0,0 @@
1
- ---
2
- name: Bug report
3
- about: Create a report to help us improve
4
- title: ''
5
- labels: 'bug'
6
- assignees: ''
7
- ---
8
-
9
- **Describe the bug**
10
- A clear and concise description of what the bug is.
11
-
12
- **To Reproduce**
13
- Steps to reproduce the behavior:
14
-
15
- 1. Run the bot
16
- 2. Try the function
17
- 3. See error
18
-
19
- **Expected behavior**
20
- A clear and concise description of what you expected to happen.
21
-
22
- **Screenshots**
23
- If applicable, add screenshots to help explain your problem.
24
-
25
- **Versions (please complete the following information):**
26
-
27
- - Discord.js Version [e.g. v13]
28
- - simply-xp Version [e.g. v2.0.0]
29
-
30
- **Additional context**
31
- Add any other context about the problem here.
@@ -1,20 +0,0 @@
1
- ---
2
- name: Feature request
3
- about: Suggest an idea for this project
4
- title: ''
5
- labels: 'feature'
6
- assignees: ''
7
-
8
- ---
9
-
10
- **Is your feature request related to a problem? Please describe.**
11
- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
-
13
- **Describe the solution you'd like**
14
- A clear and concise description of what you want to happen.
15
-
16
- **Describe alternatives you've considered**
17
- A clear and concise description of any alternative solutions or features you've considered.
18
-
19
- **Additional context**
20
- Add any other context or screenshots about the feature request here.
@@ -1,25 +0,0 @@
1
- # Security Policy
2
-
3
- ## Supported Versions
4
-
5
- Use this section to tell people about which versions of your project are
6
- currently being supported with security updates.
7
-
8
- | Version | Supported |
9
- | ------- | ------------------ |
10
- | 2.x.x (djs v13) | :white_check_mark: |
11
- | 1.0.88 (djs v12) | :x: |
12
-
13
- ### Discord.js
14
- | Version | Supported |
15
- | ------- | ------------------ |
16
- | 13.x.x | :white_check_mark: |
17
- | 12.5.x | :x:
18
-
19
- ## Reporting a Vulnerability
20
-
21
- Use this section to tell people how to report a vulnerability.
22
-
23
- Tell them where to go, how often they can expect to get an update on a
24
- reported vulnerability, what to expect if the vulnerability is accepted or
25
- declined, etc.
@@ -1,8 +0,0 @@
1
- # Information
2
- _Overview of the things you changed_
3
-
4
- # Issue Related
5
- [Issue Name](provide-link-to-related-issue-if-any)
6
-
7
- # Checks
8
- - [ ] Does the package work as intended?
@@ -1,71 +0,0 @@
1
- # For most projects, this workflow file will not need changing; you simply need
2
- # to commit it to your repository.
3
- #
4
- # You may wish to alter this file to override the set of languages analyzed,
5
- # or to provide custom queries or build logic.
6
- #
7
- # ******** NOTE ********
8
- # We have attempted to detect the languages in your repository. Please check
9
- # the `language` matrix defined below to confirm you have the correct set of
10
- # supported CodeQL languages.
11
- #
12
- name: "CodeQL"
13
-
14
- on:
15
- push:
16
- branches: [ main ]
17
- pull_request:
18
- # The branches below must be a subset of the branches above
19
- branches: [ main ]
20
- schedule:
21
- - cron: '29 14 * * 3'
22
-
23
- jobs:
24
- analyze:
25
- name: Analyze
26
- runs-on: ubuntu-latest
27
- permissions:
28
- actions: read
29
- contents: read
30
- security-events: write
31
-
32
- strategy:
33
- fail-fast: false
34
- matrix:
35
- language: [ 'javascript' ]
36
- # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
37
- # Learn more:
38
- # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
39
-
40
- steps:
41
- - name: Checkout repository
42
- uses: actions/checkout@v2
43
-
44
- # Initializes the CodeQL tools for scanning.
45
- - name: Initialize CodeQL
46
- uses: github/codeql-action/init@v1
47
- with:
48
- languages: ${{ matrix.language }}
49
- # If you wish to specify custom queries, you can do so here or in a config file.
50
- # By default, queries listed here will override any specified in a config file.
51
- # Prefix the list here with "+" to use these queries and those in the config file.
52
- # queries: ./path/to/local/query, your-org/your-repo/queries@main
53
-
54
- # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55
- # If this step fails, then you should remove it and run the build manually (see below)
56
- - name: Autobuild
57
- uses: github/codeql-action/autobuild@v1
58
-
59
- # ℹ️ Command-line programs to run using the OS shell.
60
- # 📚 https://git.io/JvXDl
61
-
62
- # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
63
- # and modify them (or add more) to build your code if your project
64
- # uses a compiled language
65
-
66
- #- run: |
67
- # make bootstrap
68
- # make release
69
-
70
- - name: Perform CodeQL Analysis
71
- uses: github/codeql-action/analyze@v1
package/.idea/discord.xml DELETED
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="DiscordProjectSettings">
4
- <option name="show" value="ASK" />
5
- <option name="description" value="" />
6
- </component>
7
- </project>
package/.idea/misc.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectRootManager">
4
- <output url="file://$PROJECT_DIR$/out" />
5
- </component>
6
- </project>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/simply-xp.iml" filepath="$PROJECT_DIR$/.idea/simply-xp.iml" />
6
- </modules>
7
- </component>
8
- </project>
@@ -1,9 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="JAVA_MODULE" version="4">
3
- <component name="NewModuleRootManager" inherit-compiler-output="true">
4
- <exclude-output />
5
- <content url="file://$MODULE_DIR$" />
6
- <orderEntry type="inheritedJdk" />
7
- <orderEntry type="sourceFolder" forTests="false" />
8
- </component>
9
- </module>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>
package/index.d.ts DELETED
@@ -1,107 +0,0 @@
1
- import { Message, Client } from 'discord.js'
2
-
3
- type HexColorString = `#${string}` | string
4
-
5
- export type connectOptions = {
6
- notify?: boolean
7
- }
8
-
9
- export declare function connect(
10
- db: string,
11
- options?: connectOptions
12
- ): Promise<any>
13
-
14
- export declare function addLevel(
15
- message: Message,
16
- userID: string,
17
- guildID: string,
18
- level: number
19
- ): Promise<any>
20
-
21
- export declare function addXP(
22
- message: Message,
23
- userID: string,
24
- guildID: string,
25
- xp: number
26
- ): Promise<any>
27
-
28
- export type chartsOptions = {
29
- position?: string
30
- background?: HexColorString
31
- type?: 'bar' | 'line' | 'radar' | 'doughnut' | 'polarArea'
32
- }
33
-
34
- export declare function charts(
35
- message: Message,
36
- options?: chartsOptions
37
- ): Promise<any>
38
-
39
- export declare function create(userID: string, guildID: string): Promise<any>
40
-
41
- export declare function fetch(userID: string, guildID: string): Promise<any>
42
-
43
- export declare function leaderboard(
44
- userID: string,
45
- guildID: string,
46
- limit?: number
47
- ): Promise<any>
48
-
49
- export declare function lvlRole(
50
- message: Message,
51
- userID: string,
52
- guildID: string
53
- ): Promise<any>
54
-
55
- export type rankOptions = {
56
- slash?: boolean
57
- background?: string
58
- color?: HexColorString
59
- }
60
- export declare function rank(
61
- message: Message,
62
- userID: string,
63
- guildID: string,
64
- options?: rankOptions
65
- ): Promise<any>
66
-
67
- export declare function reset(userID: string, guildID: string): Promise<any>
68
-
69
- export type lvladdOptions = {
70
- level: string
71
- role: string
72
- }
73
- export type lvlremoveOptions = {
74
- level: string
75
- }
76
-
77
- export declare function setLevel(
78
- message: Message,
79
- userID: string,
80
- guildID: string,
81
- level: number
82
- ): Promise<any>
83
-
84
- export declare function setXP(
85
- userID: string,
86
- guildID: string,
87
- xp: number
88
- ): Promise<any>
89
-
90
- /** For levelUp event */
91
- export type Data = {
92
- xp: string
93
- level: number
94
- userID: string
95
- guildID: string
96
- }
97
-
98
- export type Role = {
99
- lvl: string
100
- role: string
101
- }
102
-
103
- declare module 'discord.js' {
104
- export interface ClientEvents {
105
- levelUp: [Message, Data, Role]
106
- }
107
- }
package/simplyxp.js DELETED
@@ -1,31 +0,0 @@
1
- try {
2
- require('discord.js');
3
- } catch (e) {
4
- console.warn('[XP] Discord.js is recommended for this package.');
5
- }
6
-
7
- module.exports.roleSetup = require('./src/roleSetup');
8
-
9
- module.exports.addLevel = require('./src/addLevel');
10
-
11
- module.exports.addXP = require('./src/addXP');
12
-
13
- module.exports.charts = require('./src/charts');
14
-
15
- module.exports.connect = require('./src/connect');
16
-
17
- module.exports.create = require('./src/create');
18
-
19
- module.exports.fetch = require('./src/fetch');
20
-
21
- module.exports.leaderboard = require('./src/leaderboard');
22
-
23
- module.exports.lvlRole = require('./src/lvlRole');
24
-
25
- module.exports.rank = require('./src/rank');
26
-
27
- module.exports.setLevel = require('./src/setLevel');
28
-
29
- module.exports.setXP = require('./src/setXP');
30
-
31
- module.exports.reset = require('./src/reset');