Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c681970815 | |||
| b6f5758329 | |||
| 97980db02e | |||
| d5441a32a4 | |||
| 76923dd2df | |||
| 6c0af0b13b | |||
| 2e87e306be | |||
| e46ba8788a | |||
| 5eb1fc26c7 | |||
| 573a6f8a1c |
+18
-30
@@ -1,47 +1,35 @@
|
||||
# [2.16.0](https://github.com/ghoshRitesh12/aniwatch-api/compare/v2.15.0...v2.16.0) (2025-06-17)
|
||||
# [2.19.0](https://github.com/ghoshRitesh12/aniwatch-api/compare/v2.18.2...v2.19.0) (2026-03-14)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* update aniwatch pkg ([89644e2](https://github.com/ghoshRitesh12/aniwatch-api/commit/89644e2d2e4bc652c7062636113ffdcb2bb1df32))
|
||||
* update aniwatch pkg ([b6f5758](https://github.com/ghoshRitesh12/aniwatch-api/commit/b6f5758329b8fa12de3b7886f59d71707596cd0c))
|
||||
|
||||
|
||||
|
||||
# [2.15.0](https://github.com/ghoshRitesh12/aniwatch-api/compare/v2.14.5...v2.15.0) (2025-05-25)
|
||||
## [2.18.2](https://github.com/ghoshRitesh12/aniwatch-api/compare/v2.18.1...v2.18.2) (2025-09-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* build error in logger, cache, and logging middleware ([76923dd](https://github.com/ghoshRitesh12/aniwatch-api/commit/76923dd2dfefd1eeebd81e4ed87a01101f7a953c))
|
||||
|
||||
|
||||
|
||||
## [2.18.1](https://github.com/ghoshRitesh12/aniwatch-api/compare/v2.18.0...v2.18.1) (2025-08-26)
|
||||
|
||||
|
||||
|
||||
# [2.18.0](https://github.com/ghoshRitesh12/aniwatch-api/compare/v2.17.0...v2.18.0) (2025-07-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add `execGracefulShutdown` method & `Prettify<T>` type ([a3cd5a3](https://github.com/ghoshRitesh12/aniwatch-api/commit/a3cd5a34aada2331e3f9bd56798f1ddb979dbb01))
|
||||
* add cache response header if caching is enabled ([013196b](https://github.com/ghoshRitesh12/aniwatch-api/commit/013196bd3d5e44aa76b1825f24f9f5186fe7e7c1))
|
||||
* add deployment env based rate limiters ([f5d7462](https://github.com/ghoshRitesh12/aniwatch-api/commit/f5d74627e8b7f844f58a9dc82e3a79ecd911cc8f))
|
||||
* add flexible `ANIWATCH_API_DEPLOYMENT_ENV` env and deployment envs ([bd597a6](https://github.com/ghoshRitesh12/aniwatch-api/commit/bd597a6fd71347c9cef687a891a408f40e6cbd93))
|
||||
* add graceful shutdown and better deployment environment logic ([536b97e](https://github.com/ghoshRitesh12/aniwatch-api/commit/536b97e549675e1f0b035a5139320d6d60780608))
|
||||
* add graceful shutdown and better deployment environment logic ([b19078e](https://github.com/ghoshRitesh12/aniwatch-api/commit/b19078e29cbd86d46d4ef1c5e5c6e914d1c8cc2f))
|
||||
* update imp scripts, description & packages ([cdd05c7](https://github.com/ghoshRitesh12/aniwatch-api/commit/cdd05c719ba361cc28acf6c4a7d535c64a70e604))
|
||||
* update response to include status instead of success for consistency ([74c9ffc](https://github.com/ghoshRitesh12/aniwatch-api/commit/74c9ffcb8f62dcdae6983da490436c39b6b8e558))
|
||||
* update aniwatch package ([5eb1fc2](https://github.com/ghoshRitesh12/aniwatch-api/commit/5eb1fc26c7632a3e7b53e71fd7df89288943b83d))
|
||||
|
||||
|
||||
|
||||
## [2.14.5](https://github.com/ghoshRitesh12/aniwatch-api/compare/v2.14.4...v2.14.5) (2025-05-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update `ANIWATCH_API_HOSTNAME`§ env example ([d2812d1](https://github.com/ghoshRitesh12/aniwatch-api/commit/d2812d13bf5d285ce294d39a48d01020437f30ab))
|
||||
|
||||
|
||||
|
||||
## [2.14.4](https://github.com/ghoshRitesh12/aniwatch-api/compare/v2.14.3...v2.14.4) (2025-05-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update `ANIWATCH_API_HOSTNAME` env ([1081c7b](https://github.com/ghoshRitesh12/aniwatch-api/commit/1081c7b7bb7305ab5440301ecba8728fe88af90b))
|
||||
|
||||
|
||||
|
||||
## [2.14.3](https://github.com/ghoshRitesh12/aniwatch-api/compare/v2.14.2...v2.14.3) (2025-05-11)
|
||||
# [2.17.0](https://github.com/ghoshRitesh12/aniwatch-api/compare/v2.16.0...v2.17.0) (2025-06-17)
|
||||
|
||||
|
||||
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "aniwatch-api",
|
||||
"version": "2.16.0",
|
||||
"version": "2.19.0",
|
||||
"description": "NodeJS API for obtaining anime data from hianimez.to",
|
||||
"main": "dist/src/server.js",
|
||||
"type": "module",
|
||||
@@ -38,18 +38,18 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@hono/node-server": "^1.14.2",
|
||||
"aniwatch": "^2.23.3",
|
||||
"aniwatch": "^2.27.9",
|
||||
"dotenv": "^16.5.0",
|
||||
"envalid": "^8.0.0",
|
||||
"hono": "^4.7.10",
|
||||
"hono-rate-limiter": "^0.4.2",
|
||||
"ioredis": "^5.6.1",
|
||||
"pino": "^9.7.0"
|
||||
"pino": "^9.7.0",
|
||||
"pino-pretty": "^13.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.15.21",
|
||||
"husky": "^9.1.7",
|
||||
"pino-pretty": "^13.0.0",
|
||||
"prettier": "^3.5.3",
|
||||
"tsx": "^4.19.4",
|
||||
"typescript": "^5.8.3",
|
||||
|
||||
@@ -20,7 +20,6 @@ const loggerOptions: LoggerOptions = {
|
||||
};
|
||||
},
|
||||
},
|
||||
timestamp: pino.stdTimeFunctions.isoTime,
|
||||
};
|
||||
|
||||
export const log = pino(loggerOptions);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { env } from "../config/env.js";
|
||||
import { AniwatchAPICache, cache } from "../config/cache.js";
|
||||
import type { BlankInput } from "hono/types";
|
||||
import type { Context, MiddlewareHandler } from "hono";
|
||||
import type { Context, MiddlewareHandler, Handler } from "hono";
|
||||
import type { ServerContext } from "../config/context.js";
|
||||
|
||||
// Define middleware to add Cache-Control header
|
||||
@@ -41,9 +41,10 @@ export function cacheConfigSetter(keySliceIndex: number): MiddlewareHandler {
|
||||
};
|
||||
}
|
||||
|
||||
// FIXED: add explicit return type
|
||||
export function withCache<T, P extends string = string>(
|
||||
getData: (c: Context<ServerContext, P, BlankInput>) => Promise<T>
|
||||
) {
|
||||
): Handler<ServerContext, P, BlankInput> {
|
||||
return async (c: Context<ServerContext, P, BlankInput>) => {
|
||||
const cacheConfig = c.get("CACHE_CONFIG");
|
||||
|
||||
@@ -56,10 +57,3 @@ export function withCache<T, P extends string = string>(
|
||||
return c.json({ status: 200, data }, { status: 200 });
|
||||
};
|
||||
}
|
||||
|
||||
// export function _withCache<T>(
|
||||
// context: Context<ServerContext>,
|
||||
// promise: Promise<T>
|
||||
// ): MiddlewareHandler {
|
||||
// return async (c) => {};
|
||||
// }
|
||||
|
||||
@@ -3,7 +3,7 @@ import { logger as honoLogger } from "hono/logger";
|
||||
import { log } from "../config/logger.js";
|
||||
|
||||
export const logging: MiddlewareHandler = honoLogger(
|
||||
(msg: string, ...rest: string[]) => {
|
||||
(msg: string, ...rest: any[]) => {
|
||||
log.info(msg, ...rest);
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user