typenexus

TypeNexus is a great tool for API encapsulation and management. It offers a clean and lightweight way to bundle TypeORM + Expressjs functionality, helping you to build applications faster while reducing template code redundancy and type conversion work.

MIT License

Downloads
353
Stars
5
Committers
3

Bot releases are visible (Hide)

typenexus - v0.5.4 Latest Release

Published by github-actions[bot] 8 months ago

Buy me a coffee

Documentation v0.5.4: https://raw.githack.com/jaywcjlove/typenexus/ed7a9a9/index.html

npm i [email protected]

https://github.com/jaywcjlove/typenexus/compare/v0.5.3...v0.5.4

  • 💄 chore: update FUNDING.yml ea522dc @jaywcjlove
  • 💢 ci: update workflows config. 499c316 @jaywcjlove
  • 🐞 fix(deps): update dependency pg to ~8.11.0 (#6) 70509f7 @renovate-bot
typenexus - v0.5.3

Published by github-actions[bot] 11 months ago

Buy me a coffee

Documentation v0.5.3: https://raw.githack.com/jaywcjlove/typenexus/513ed5a/index.html

npm i [email protected]

https://github.com/jaywcjlove/typenexus/compare/v0.5.2...v0.5.3

  • 🐞 fix(deps): update dependency cookie to ^0.6.0 (#16) f58ca1c @renovate-bot
  • 💄 chore(deps): update dependency lerna to v8 (#17) f1e62b8 @renovate-bot
  • 🐞 fix(deps): update dependency @types/node to v20 (#15) 72e2ba4 @renovate-bot
  • 💄 chore(deps): update dependency lint-staged to v15 (#14) e4848bb @renovate-bot
  • 💄 chore: add sponsor badge. c74ed99 @jaywcjlove
  • 💢 ci: update workflows config. 4187d5b @jaywcjlove
typenexus - v0.5.2

Published by github-actions[bot] about 1 year ago

Documentation v0.5.2: https://raw.githack.com/jaywcjlove/typenexus/2cabd6a/index.html

npm i [email protected]

https://github.com/jaywcjlove/typenexus/compare/v0.5.1...v0.5.2

  • 📖 doc: Update core/README.md 4d3548a @jaywcjlove
  • 💄 chore(base): update example. 44150e2 @jaywcjlove
  • ⛑ test(base): update test case. 9cfff47 @jaywcjlove
  • 📖 doc: update core/README.md 83e1e98 @jaywcjlove
  • 📖 doc: update core/README.md 4bee965 @jaywcjlove
  • 📖 doc: update example. 9e2bde8 @jaywcjlove
  • 🐞 fix(deps): update dependency typeorm-extension to v3 (#10) ef865f7 @renovate-bot
  • 💄 chore(deps): update dependency supertest-session to v5 (#11) 4f2745e @renovate-bot
  • 💄 chore(deps): update dependency lint-staged to v14 (#12) 9dfb146 @renovate-bot
  • 💄 chore(deps): update dependency nodemon to v3 (#9) 1c5a80d @renovate-bot
  • 💢 ci: update workflows config. 7d996f8 @jaywcjlove
  • 💢 ci: update workflows config. 40e31db @jaywcjlove
typenexus - v0.5.1

Published by github-actions[bot] over 1 year ago

Documentation v0.5.1: https://raw.githack.com/jaywcjlove/typenexus/7471f66/index.html

npm i [email protected]

https://github.com/jaywcjlove/typenexus/compare/v0.5.0...v0.5.1

  • 📖 doc: Update README.md 1b4e9c2 @jaywcjlove
  • 📖 doc: add README-zh.md. 2bd8afa @jaywcjlove
  • 🐞 fix: fix .env support. ea640ec @jaywcjlove
typenexus - v0.5.0

Published by github-actions[bot] over 1 year ago

Documentation v0.5.0: https://raw.githack.com/jaywcjlove/typenexus/4cb2e14/index.html

npm i [email protected]

https://github.com/jaywcjlove/typenexus/compare/v0.4.1...v0.5.0

  • 💄 chore: add husky config. edb9d58 @jaywcjlove
  • 💄 chore: format code. 20a0d11 @jaywcjlove
  • 📄 examples(authorized): update test case. 0b2d9a5 @jaywcjlove
  • 💄 chore: update workflows config. 98e4e0b @jaywcjlove
  • 💄 chore: update workflows config. da95ccf @jaywcjlove
  • 💄 chore(deps): update dependency lerna to v7 #7 51ff26e @jaywcjlove
  • 🌟 feat: add UploadedFile/UploadedFiles decorator. e1bbc9b @jaywcjlove
  • 💄 chore(deps): update dependency prettier to v3 (#8) 87c072a @renovate-bot

Inject uploaded file

To inject uploaded file, use @UploadedFile decorator:

@Post("/file")
saveFile(@UploadedFile("fileName") file: Express.Multer.File) {}

To inject uploaded multiple files, use the @UploadedFiles decorator:

@Post("/files")
saveFiles(@UploadedFiles("fileName") file: Express.Multer.File[]) {}

You can also specify uploading options to multer this way:

import type { Options } from 'multer';
// to keep code clean better to extract this function into separate file
const fileUploadOptions: () => Options = () => ({
  storage: multerFn.diskStorage({
    destination: (req, file, cb) => {
      //...
    },
    filename: (req, file, cb) => {
      //...
    }
  }),
  fileFilter: (req, file, cb) => {
    //...
  },
  limits: {
    fieldNameSize: 255,
    fileSize: 1024 * 1024 * 2
  }
});

// use options this way:
@Post("/file")
saveFiles(@UploadedFile("fileName", fileUploadOptions) file: Express.Multer.File) {}

To inject all uploaded files use @UploadedFiles decorator instead. typenexus uses multer to handle file uploads.

typenexus - v0.4.1

Published by github-actions[bot] over 1 year ago

Documentation v0.4.1: https://raw.githack.com/jaywcjlove/typenexus/16dfdb3/index.html

npm i [email protected]

https://github.com/jaywcjlove/typenexus/compare/v0.4.0...v0.4.1

  • 🐞 fix: fix the issue of not being able to set headers after sending. 23835ce @jaywcjlove
  • ⛑ test(status-code): fix test case error. f5b32f2 @jaywcjlove
  • ⛑ test(redirect): fix test case error. 0d272f7 @jaywcjlove
typenexus - v0.4.0

Published by github-actions[bot] over 1 year ago

Documentation v0.4.0: https://raw.githack.com/jaywcjlove/typenexus/8983f54/index.html

npm i [email protected]

https://github.com/jaywcjlove/typenexus/compare/v0.3.1...v0.4.0

  • 💄 chore(deps): update dependency tsbb to v4 #4 ce03e43 @jaywcjlove
  • 🌟 feat: support constructor @DSource() decorator. ec9c480 @jaywcjlove
  • 💢 ci: update workflows config. 3a1c095 @jaywcjlove
  • 💄 chore(deps): update dependency node-ts to v6 (#5) f373a61 @renovate-bot

@DSource() decorator injects you a DataSource object.

Support constructor @DSource() decorator

import { Controller, Get, DSource, DataSource } from 'typenexus';
import { Response, Request }from 'express';
import { User } from '../entity/User.js';

@Controller('/users')
export class UserController {
  constructor(@DSource() private dataSource: DataSource) {}
  @ContentType('application/json')
  @Get() // => GET /users
  public async getUsers(): Promise<User[]> {
    return this.dataSource.manager.find(User);
  }
}
typenexus - v0.3.1

Published by github-actions[bot] over 1 year ago

Documentation v0.3.1: https://raw.githack.com/jaywcjlove/typenexus/81adcda/index.html

npm i [email protected]

https://github.com/jaywcjlove/typenexus/compare/v0.3.0...v0.3.1

  • 💄 chore: add engines field in package.json 6c8c53e @jaywcjlove
  • 🐞 fix: add exports feild in package.json deb96a2 @jaywcjlove
  • 🐞 fix: fix handle error issue. a2dd0f6 @jaywcjlove
typenexus - v0.3.0

Published by github-actions[bot] over 1 year ago

Documentation v0.3.0: https://raw.githack.com/jaywcjlove/typenexus/d362f7a/index.html

npm i [email protected]

https://github.com/jaywcjlove/typenexus/compare/v0.2.0...v0.3.0

  • 💄 chore: add http-errors example. aa70e88 @jaywcjlove
  • 💄 chore: update workflows config. 96ea681 @jaywcjlove
  • 🌟 feat: authorizationChecker/currentUserChecker supports config in TypeNexusOptions. 3970d8b @jaywcjlove
  • 💄 chore: update workflows config. e3a51f1 @jaywcjlove
  • 🌟 feat: add enable cors. 664373d @jaywcjlove
  • 🐞 fix: fix app.authorizationChecker/ currentUserChecker error. a5b4ad5 @jaywcjlove
  • 💄 chore: update workflows config. 15292b9 @jaywcjlove
  • 💄 chore: update workflows config. 41d9717 @jaywcjlove
typenexus - v0.2.0

Published by github-actions[bot] over 1 year ago

Documentation v0.2.0: https://raw.githack.com/jaywcjlove/typenexus/5571337/index.html

npm i [email protected]

https://github.com/jaywcjlove/typenexus/compare/v0.1.0...v0.2.0

  • 📖 doc: Update READMe.md 606656f @jaywcjlove
  • 🐞 fix: fix ContentType decorator. 80954c5 @jaywcjlove
  • 🌟 feat: add Render decrator. d15802b @jaywcjlove
  • 🌟 feat: export InternalServerError/MethodNotAllowedError/NotAcceptableError method errors. b39afa2 @jaywcjlove
typenexus - v0.1.0

Published by github-actions[bot] over 1 year ago

Documentation v0.1.0: https://raw.githack.com/jaywcjlove/typenexus/19e36e5/index.html

npm i [email protected]

https://github.com/jaywcjlove/typenexus/compare/v0.0.11...v0.1.0

  • 💄 chore: update workflows config. 2c5b65e @jaywcjlove
  • 💄 chore: update workflows config. ab52431 @jaywcjlove
  • 🌟 feat: add OnNull/OnUndefined decorator. 144402e @jaywcjlove
  • 💄 chore: update status-code example. 0a57685 @jaywcjlove
  • 🌟 feat: add Redirect decorator. f586b10 @jaywcjlove
  • 🌟 feat: add Location decorator. 373d65e @jaywcjlove
  • 🌟 feat: add HttpCode decorator. 188f70a @jaywcjlove
  • 🌟 feat: add Header decorator. ef26eaf @jaywcjlove
typenexus - v0.0.11

Published by github-actions[bot] over 1 year ago

Documentation v0.0.11: https://raw.githack.com/jaywcjlove/typenexus/de736b2/index.html

npm i [email protected]

https://github.com/jaywcjlove/typenexus/compare/v0.0.10...v0.0.11

  • 🌟 feat: add UseAfter/UseBefore decorator. 2e01c26 @jaywcjlove
  • 📖 doc: Update README.md 0f46747 @jaywcjlove
  • 📖 doc: Update README.md 839caf1 @jaywcjlove
  • 💄 chore: update workflows config. b4a50f7 @jaywcjlove
typenexus - v0.0.10

Published by github-actions[bot] over 1 year ago

Documentation v0.0.10: https://raw.githack.com/jaywcjlove/typenexus/5de2a4d/index.html

npm i [email protected]

https://github.com/jaywcjlove/typenexus/compare/v0.0.9...v0.0.10

  • 💄 chore: update workflows config. 2b53a55 @jaywcjlove
  • 📖 doc: Update README.md 6eec710 @jaywcjlove
  • ⛑ test: fix base example test case. 3afd4ab @jaywcjlove
  • 💄 chore: update LICENSE. a0cd42c @jaywcjlove
  • 🌟 feat: add Authorized/CurrentUser/Middleware decorator. 857474c @jaywcjlove
  • 🆎 type: fix developmentMode type error. 7da2777 @jaywcjlove
  • 🐞 fix: fix Middleware decorator issue. 0cd0b23 @jaywcjlove
typenexus - v0.0.9

Published by github-actions[bot] over 1 year ago

npm i [email protected]

https://github.com/jaywcjlove/typenexus/compare/v0.0.8...v0.0.9

  • 📖 doc: Update READMe.md f4d19e0 @jaywcjlove
  • 📖 doc: Update README.md 8363dfe @jaywcjlove
  • 🐞 fix: Fix cookie dose not exist error. c813389 @jaywcjlove
  • 📄 example: add CURD example. 6be144e @jaywcjlove
  • 💄 chore: update workflows config. 9c0d685 @jaywcjlove
  • 💄 chore: update workflows config. cb0225b @jaywcjlove
  • 💄 chore: update workflows config. 18b9c16 @jaywcjlove
typenexus - v0.0.8

Published by github-actions[bot] over 1 year ago

npm i [email protected]

https://github.com/jaywcjlove/typenexus/compare/v0.0.7...v0.0.8

  • 💄 chore: change the document generation method. 9717b1d @jaywcjlove
  • 📖 doc: modify document generation config. bd55e0b @jaywcjlove
  • 💄 chore: update package.json. 54bbb6f @jaywcjlove
  • 🌟 feat: add bodyParser/compression options. 80a2100 @jaywcjlove
  • 📖 doc: Update README.md ff713d4 @jaywcjlove
  • 💄 chore: update workflows config. 8ce9431 @jaywcjlove
typenexus - v0.0.7

Published by github-actions[bot] over 1 year ago

npm i [email protected]

https://github.com/jaywcjlove/typenexus/compare/v0.0.6...v0.0.7

  • ⛑ test: fix test case. fa3bb9d @jaywcjlove
  • 💄 chore: update workflows config. ea49e97 @jaywcjlove
  • ⛑ test: update test case. 6da37d8 @jaywcjlove
  • ⛑ test: update test case. f6aa214 @jaywcjlove
  • 💄 chore: update workflows config. c526efd @jaywcjlove
  • ⛑ test: update test case. 4e0b6db @jaywcjlove
  • 💄 chore: update workflows config. f1ba9b0 @jaywcjlove
  • 💄 chore: update workflows config. 14226cd @jaywcjlove
  • 📖 doc: Update README.md c50af16 @jaywcjlove
  • 📖 doc: Update README.md 9095c58 @jaywcjlove
  • 📖 doc: Update README.md 74fb57b @jaywcjlove
  • 📖 doc: Update README.md 926dea4 @jaywcjlove
typenexus - v0.0.6

Published by github-actions[bot] over 1 year ago

npm i [email protected]

https://github.com/jaywcjlove/typenexus/compare/v0.0.5...v0.0.6

  • 🌟 feat: add Head decorator. 36bc68d @jaywcjlove
  • 📖 doc: add generated documentation. 83cf803 @jaywcjlove
  • 📖 doc: Update core/README.md 6b6c2cd @jaywcjlove
  • 🐝 refactor: optimize code. fb1bda8 @jaywcjlove
  • 🌟 feat: add Session/SessionParam decorator. f64e59e @jaywcjlove
  • 📖 doc: Update README.md 0de7863 @jaywcjlove
  • 🐞 fix: fix port issue. eeea19e @jaywcjlove
typenexus - v0.0.5

Published by github-actions[bot] over 1 year ago

npm i [email protected]

https://github.com/jaywcjlove/typenexus/compare/v0.0.4...v0.0.5

  • 🌟 feat: add CookieParam/CookieParams decorator. 5cf49fb @jaywcjlove
  • 🌟 feat: add HeaderParam/HeaderParams decorator. 501267a @jaywcjlove
  • 🌟 feat: add BodyParam decorator. 82fe2b9 @jaywcjlove
  • 📖 doc: update core/README.md 8125c0b @jaywcjlove
typenexus - v0.0.4

Published by github-actions[bot] over 1 year ago

npm i [email protected]

https://github.com/jaywcjlove/typenexus/compare/v0.0.3...v0.0.4

  • 🌟 feat: add QueryParams decorator. 439d036 @jaywcjlove
  • 📖 doc: Update README.md 48e8f3f @jaywcjlove
  • 🌟 feat: add Delete decorator. 30b9441 @jaywcjlove
  • 🌟 feat: add Patch decorator. 2ed3595 @jaywcjlove
  • 🐞 fix: add files field in package.json 73b21c8 @jaywcjlove
typenexus - v0.0.3

Published by github-actions[bot] over 1 year ago

npm i [email protected]

https://github.com/jaywcjlove/typenexus/compare/v0.0.2...v0.0.3

  • 💄 chore: update workflows config. af95eaf @jaywcjlove
  • 🌟 feat: add Params decorator. e4be0f5 @jaywcjlove
  • 🌟 feat: add QueryParam decorator. 4b5c38b @jaywcjlove