-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from lucasvtiradentes/feature/update_project
Feature/update project
- Loading branch information
Showing
49 changed files
with
1,091 additions
and
1,389 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 |
---|---|---|
@@ -1,3 +1,10 @@ | ||
# https://prettier.io/docs/en/options.html | ||
# FODLER ======================================================================= | ||
|
||
utils/ | ||
.github | ||
.husky | ||
.vscode | ||
dist | ||
ignore | ||
node_modules | ||
|
||
# FILES ======================================================================== |
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
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
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,4 +1,7 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
echo "🐶 husky script: [commit-msg]" | ||
npx --no -- commitlint --edit ${1} | ||
echo "✅ husky script: [commit-msg]" | ||
echo "" |
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,7 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
echo "🐶 husky script: [pre-commit]" | ||
npx --no-install lint-staged | ||
echo "✅ husky script: [pre-commit]" | ||
echo "" |
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,7 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
echo "🐶 husky script: [pre-push]" | ||
npm run build | ||
echo "✅ husky script: [pre-push]" | ||
echo "" |
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 @@ | ||
{ | ||
"*.{js, jsx, ts, tsx}": ["prettier --write", "eslint --fix"], | ||
"*.{json, yaml}": ["prettier --write"] | ||
} |
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,3 +1,12 @@ | ||
# https://prettier.io/docs/en/options.html | ||
# FODLER ======================================================================= | ||
|
||
examples/ | ||
.github | ||
.husky | ||
.vscode | ||
dist | ||
ignore | ||
node_modules | ||
|
||
# FILES ======================================================================== | ||
|
||
README.md |
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,7 @@ | ||
{ | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode", | ||
"editorconfig.editorconfig" | ||
] | ||
} |
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,17 @@ | ||
{ | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit" | ||
}, | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"explorer.fileNesting.enabled": true, | ||
"explorer.fileNesting.patterns": { | ||
"package.json": ".czrc, .editorconfig, .commitlintrc, .eslintignore, .eslintrc, .lintstagedrc.json, .prettierignore, .prettierrc, tsconfig.json, package-lock.json, yarn.lock, pnpm-lock.yaml", | ||
".env": ".env.example", | ||
".releaserc": ".npmignore", | ||
"README.md": "LICENSE, CHANGELOG.md", | ||
}, | ||
"files.associations": { | ||
".czrc": "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 |
---|---|---|
|
@@ -5,11 +5,8 @@ | |
</h3> | ||
|
||
<div align="center"> | ||
<a href="https://nextjs.org/"><img src="https://img.shields.io/badge/made%20with-node-1f425f?logo=node.js&.svg" /></a> | ||
<a href="https://www.github.com/lucasvtiradentes/ticktick-api-lvt/commits/master"><img src="https://img.shields.io/github/last-commit/lucasvtiradentes/ticktick-api-lvt?color=green&label=updated"></a> | ||
<br> | ||
<a href="#"><img src="https://img.shields.io/badge/maintained%3F-yes-green.svg" alt="maintance" /></a> | ||
<a href="https://www.github.com/lucasvtiradentes"><img src="https://img.shields.io/badge/maintainer-%40lucasvtiradentes-yellow"></a> | ||
<a href="https://www.npmjs.com/package/ticktick-api-lvt"><img src="https://img.shields.io/npm/v/ticktick-api-lvt.svg?style=flat" alt="npm version"></a> | ||
<a href="https://nodejs.org/en/"><img src="https://img.shields.io/badge/made%20with-node-1f425f?logo=node.js&.svg" /></a> | ||
<a href="https://github.com/lucasvtiradentes/ticktick-api-lvt#contributing"><img src="https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat" alt="contributions" /></a> | ||
</div> | ||
|
||
|
@@ -29,7 +26,6 @@ | |
<ul> | ||
<li><a href="#development-setup">Development setup</a></li> | ||
<li><a href="#used-technologies">Used technologies</a></li> | ||
<li><a href="#commit-messages-style">Commit messages style</a></li> | ||
</ul> | ||
</li> | ||
<li> | ||
|
@@ -38,13 +34,6 @@ | |
<li><a href="#license">License</a></li> | ||
</ul> | ||
</li> | ||
<li> | ||
<a href="#family-community">Community</a> | ||
<ul> | ||
<li><a href="#contributing">Contributing</a></li> | ||
<li><a href="#feedback">Feedback</a></li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</p> | ||
</details> | ||
|
@@ -53,20 +42,14 @@ | |
|
||
## :trumpet: Overview | ||
|
||
This is a notifications microservice that implements hyped technologies, such as kafka and nestjs. | ||
|
||
The main goal of this project was to understand key concepts of kafka and nestjs. | ||
This is a [ticktick](ticktick.com) api wrapper developed to be used on [Node.js](https://nodejs.org/en) based projects. | ||
|
||
## :dart: Features<a href="#TOC"><img align="right" src="./.github/images/up_arrow.png" width="22"></a> | ||
|
||
✔️ Login into ticktick;<br> | ||
✔️ Add tasks;<br> | ||
✔️ Get user tasks;<br> | ||
✔️ Get user projects;<br> | ||
✔️ Get user project groups<br> | ||
✔️ Get user tags<br> | ||
✔️ Get user filters<br> | ||
✔️ Get user habits<br> | ||
✔️ type safe api methods by using [zod](https://github.com/colinhacks/zod) validation;<br> | ||
✔️ methods for common actions, find more [here](./src/routes/);<br> | ||
✔️ support to china [api version](https://api.dida365.com) [thanks to [@quanru](https://github.com/quanru)];<br> | ||
✔️ custom headers required in order to make api calls [thanks to [@thesamim](https://github.com/thesamim)].<br> | ||
|
||
## :warning: Requirements<a href="#TOC"><img align="right" src="./.github/images/up_arrow.png" width="22"></a> | ||
|
||
|
@@ -75,11 +58,6 @@ In order to use this project in your computer, you need to have the following it | |
- [npm](https://www.npmjs.com/): To install the package. Npm is installed alongside nodejs; | ||
- [nodejs](https://nodejs.org/en/): To actually run the package. | ||
|
||
If you want to make changes to the source code, it is recommended to also install the following items: | ||
|
||
- [git](https://git-scm.com/): To work with version controlling; | ||
- [vscode](https://code.visualstudio.com/): Useful for editing the code. You can choose a similar editor as you wish. | ||
|
||
## :bulb: Usage<a href="#TOC"><img align="right" src="./.github/images/up_arrow.png" width="22"></a> | ||
|
||
To use it from the registry, first install the npm package: | ||
|
@@ -95,46 +73,29 @@ And you can normally use it in your code as it follows: | |
import { Tick } from 'ticktick-api-lvt'; | ||
|
||
async function main() { | ||
const USERNAME = 'username'; | ||
const PASSWORD = 'password'; | ||
const username = 'your_username'; | ||
const password = 'your_password'; | ||
|
||
const tickSession = new Tick({ username: USERNAME, password: PASSWORD }); | ||
const hasLoggedIn = await tickSession.login(); | ||
if (!hasLoggedIn) { | ||
throw new Error('Coudnt login with this username/password.'); | ||
} | ||
const tickInstance = new Ticktick({ username, password }); | ||
|
||
// const userPreferences = await tickSession.getUserSettings() | ||
// console.log(Object.keys(userPreferences)) | ||
// LOGIN ===================================================================== | ||
|
||
// const allAllTasks = await tickSession.getAllTasks(); | ||
// console.log(allAllTasks.map((item) => item.title)); | ||
await tickInstance.auth.login(); | ||
|
||
// const tasks = await tickSession.getTasks(); | ||
// console.log(tasks.map((item) => item.title)); | ||
// METHODS =================================================================== | ||
|
||
// const filters = await tickSession.getFilters(); | ||
// console.log(filters.map((item) => item.name)); | ||
console.log(await tickInstance.user.getUserInformation()); | ||
console.log(await tickInstance.user.getUserDailyReminder()); | ||
console.log(await tickInstance.user.getUserSettings()); | ||
console.log(await tickInstance.tags.getTags()); | ||
console.log(await tickInstance.tasks.getCompletedTasks()); | ||
|
||
// const projectGroups = await tickSession.getProjectGroups(); | ||
// console.log(projectGroups.map((item) => item.name)); | ||
|
||
// const projects = await tickSession.getProjects(); | ||
// console.log(projects.map((item) => item.name)); | ||
|
||
// const habits = await tickSession.getHabits(); | ||
// console.log(habits.map((item) => item.name)); | ||
|
||
// const tags = await tickSession.getTags(); | ||
// console.log(tags); | ||
|
||
// uncomment the methods you want to see ;) | ||
} | ||
|
||
main(); | ||
``` | ||
|
||
To see further examples, check out the examples folder. | ||
To see further usage, check out the provided [example](./examples/dev-example.ts). | ||
|
||
## :wrench: Development<a href="#TOC"><img align="right" src="./.github/images/up_arrow.png" width="22"></a> | ||
|
||
|
@@ -153,7 +114,7 @@ $ cd ticktick-api-lvt | |
After download it, go to the project folder and run these commands: | ||
|
||
```bash | ||
# Install dependencies | ||
# Install dependencies using npm | ||
$ npm install | ||
|
||
# Run the typescript code in development mode | ||
|
@@ -219,45 +180,13 @@ This project uses the following thechnologies: | |
</table> | ||
</div> | ||
|
||
### Commit messages style | ||
|
||
This project uses the best of two main conventions to commit messages validation: | ||
|
||
- [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/): it's powerfull messages structure; | ||
- [gitmoji](https://gitmoji.dev/): it's beutiful and visual way to display commits. | ||
|
||
So a typically valid commit message has this pattern: | ||
|
||
> 🔧 config: add lint-staged to the project (#2) | ||
Also, in order to have this integration working correctly, I buld a [script](../scripts/update-commits-configs.ts) that we can specify only allowed types and it take care to update both commitizen and commitlint settings. | ||
|
||
<a href="#"><img src="./.github/images/divider.png" /></a> | ||
|
||
## :books: About<a href="#TOC"><img align="right" src="./.github/images/up_arrow.png" width="22"></a> | ||
|
||
## License | ||
|
||
**Boilermanager** is distributed under the terms of the MIT License Version 2.0. A complete version of the license is available in the [LICENSE](LICENSE) file in this repository. Any contribution made to this project will be licensed under the MIT License Version 2.0. | ||
|
||
<a href="#"><img src="./.github/images/divider.png" /></a> | ||
|
||
## :family: Community<a href="#TOC"><img align="right" src="./.github/images/up_arrow.png" width="22"></a> | ||
|
||
## Contributing | ||
if you want to positivily impact this project, consider: | ||
|
||
- **:star: Star this repository**: my goal is to impact the maximum number of developers around the world; | ||
- ✍️ **Fix english mistakes** I might have made in this project, may it be in the DOCS or even in the code (I'm a portuguese natural speaker); | ||
- [:heart: Say thanks](https://saythanks.io/to/lucasvtiradentes): kind words have a huge impact in anyone's life; | ||
- [💰 Donate](https://github.com/lucasvtiradentes): if you want to support my work even more, consider make a small donation. I would be really happy! | ||
|
||
## Feedback | ||
|
||
Any questions or suggestions? You are welcome to discuss it on: | ||
|
||
- [Github issues](https://github.com/lucasvtiradentes/ticktick-api-lvt/discussions) | ||
- [Email](mailto:[email protected]) | ||
This project is distributed under the terms of the MIT License Version 2.0. A complete version of the license is available in the [LICENSE](LICENSE) file in this repository. Any contribution made to this project will be licensed under the MIT License Version 2.0. | ||
|
||
<a href="#"><img src="./.github/images/divider.png" /></a> | ||
|
||
|
@@ -268,7 +197,7 @@ Any questions or suggestions? You are welcome to discuss it on: | |
<a target="_blank" href="https://discord.com/users/262326726892191744"><img src="https://img.shields.io/badge/discord-5865F2?logo=discord&logoColor=white" alt="Discord"></a> | ||
<a target="_blank" href="https://github.com/lucasvtiradentes/"><img src="https://img.shields.io/badge/github-gray?logo=github&logoColor=white" alt="Github"></a> | ||
</p> | ||
<p>Made with ❤️ by Lucas Vieira.</p> | ||
<p>Made with ❤️ by <strong>Lucas Vieira</strong></p> | ||
<p>👉 See also all <a href="https://github.com/lucasvtiradentes/lucasvtiradentes/blob/master/portfolio/PROJECTS.md#TOC">my projects</a></p> | ||
<p>👉 See also all <a href="https://github.com/lucasvtiradentes/my-tutorials#readme">my articles</a></p> | ||
</div> |
Oops, something went wrong.