@ikenxuan/amagi 4.4.3 → 4.4.4

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.
@@ -1,8 +1,6 @@
1
1
  import chalk from 'chalk';
2
+ import express, { Request, Response, NextFunction, Router } from 'express';
2
3
  import { AxiosRequestConfig, AxiosResponse } from 'axios';
3
- import * as fastify from 'fastify';
4
- import { FastifyInstance } from 'fastify';
5
- import * as http from 'http';
6
4
 
7
5
  interface BilibiliMethodOptionsMap {
8
6
  VideoInfoParams: {
@@ -13666,6 +13664,8 @@ declare class CustomLogger {
13666
13664
  }
13667
13665
  declare const logger: CustomLogger;
13668
13666
 
13667
+ declare const logMiddleware: (req: Request, res: Response, next: NextFunction) => void;
13668
+
13669
13669
  interface HeadersObject {
13670
13670
  [key: string]: string;
13671
13671
  }
@@ -13762,10 +13762,9 @@ declare function qtparam(BASEURL: string, cookie: string): Promise<{
13762
13762
 
13763
13763
  /**
13764
13764
  * 注册B站相关的API接口路由
13765
- * @param fastify - fastify 实例
13766
13765
  * @param cookie - 有效的cookie
13767
13766
  */
13768
- declare const registerBilibiliRoutes: (fastify: FastifyInstance, cookie: string) => void;
13767
+ declare const registerBilibiliRoutes: (cookie: string) => Router;
13769
13768
 
13770
13769
  declare function wbi_sign(BASEURL: string | URL, cookie: string): Promise<string>;
13771
13770
 
@@ -13797,10 +13796,9 @@ declare const DouyinData: <T extends keyof DouyinDataOptionsMap>(data: DouyinDat
13797
13796
 
13798
13797
  /**
13799
13798
  * 注册抖音相关的API接口路由
13800
- * @param fastify - fastify 实例
13801
13799
  * @param cookie - 有效的cookie
13802
13800
  */
13803
- declare const registerDouyinRoutes: (fastify: FastifyInstance, cookie: string) => void;
13801
+ declare const registerDouyinRoutes: (cookie: string) => Router;
13804
13802
 
13805
13803
  declare class douyinSign {
13806
13804
  /** 生成一个指定长度的随机字符串 */
@@ -13858,12 +13856,14 @@ declare const KuaishouAPI: API;
13858
13856
 
13859
13857
  declare const KuaishouData: <T extends keyof KuaishouDataOptionsMap>(data: KuaishouDataOptionsMap[T]["opt"], cookie?: string) => Promise<any>;
13860
13858
 
13859
+ interface KusiahouRequest<T extends keyof KuaishouDataOptionsMap> extends Request {
13860
+ query: Omit<KuaishouDataOptionsMap[T]['opt'], 'methodType'>;
13861
+ }
13861
13862
  /**
13862
13863
  * 注册快手相关的API接口路由
13863
- * @param fastify - fastify 实例
13864
13864
  * @param cookie - 有效的cookie
13865
13865
  */
13866
- declare const registerKuaishouRoutes: (fastify: FastifyInstance, cookie: string) => void;
13866
+ declare const registerKuaishouRoutes: (cookie: string) => Router;
13867
13867
 
13868
13868
  type ckParams = {
13869
13869
  /**
@@ -13892,12 +13892,12 @@ declare class amagi {
13892
13892
  */
13893
13893
  constructor(data: ckParams);
13894
13894
  /**
13895
- * 启动本地http服务
13895
+ * 启动本地 HTTP 服务
13896
13896
  * @param port - 监听端口
13897
13897
  * @defaultValue `port` 4567
13898
- * @returns
13898
+ * @returns Express 应用实例
13899
13899
  */
13900
- startClient(port?: number): fastify.FastifyInstance<http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault> & PromiseLike<fastify.FastifyInstance<http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault>>;
13900
+ startClient(port?: number): express.Application;
13901
13901
  /**
13902
13902
  * 获取抖音数据
13903
13903
  * @param type - 请求数据类型
@@ -13961,14 +13961,6 @@ declare class amagi {
13961
13961
  }) => Promise<R extends "strict" ? KuaishouDataOptionsMap[T]["data"] : any>;
13962
13962
  }
13963
13963
 
13964
- /**
13965
- * 启动本地 http 服务
13966
- * @param client - Fastify 实例
13967
- * @param port - 监听端口
13968
- * @returns
13969
- */
13970
- declare const startClient: (client: FastifyInstance, port: 4567) => void;
13971
-
13972
13964
  declare function Amagi(options: ckParams): amagi;
13973
13965
 
13974
- export { Amagi, type BiliAv2Bv, type BiliBangumiVideoInfo, type BiliBangumiVideoPlayurlIsLogin, type BiliBangumiVideoPlayurlNoLogin, type BiliBiliVideoPlayurlNoLogin, type BiliBv2AV, type BiliCheckQrcode, type BiliDynamicCard, type BiliDynamicInfo, type BiliEmojiList, type BiliLiveRoomDef, type BiliLiveRoomDetail, type BiliNewLoginQrcode, type BiliOneWork, type BiliUserDynamic, type BiliUserFullView, type BiliUserProfile, type BiliVideoPlayurlIsLogin, type BiliWorkComments, BilibiliData, type BilibiliDataOptions, type BilibiliDataOptionsMap, type BilibiliMethodOptionsMap, BilibiliValidateData, DouyinData, type DouyinDataOptions, type DouyinDataOptionsMap, type DouyinMethodOptionsMap, DouyinValidateData, type DyEmojiList, type DyEmojiProList, type DyImageAlbumWork, type DyMusicWork, type DySearchInfo, type DySlidesWork, type DySuggestWords, type DyUserInfo, type DyUserLiveVideos, type DyUserPostVideos, type DyVideoWork, type DyWorkComments, type KsEmojiList, type KsOneWork, type KsWorkComments, KuaishouAPI, KuaishouData, type KuaishouDataOptions, type KuaishouDataOptionsMap, KusiahouValidateData, Networks, type NetworksConfigType, type OmitMethodType, type TypeControl, amagi, av2bv, bilibiliAPI, bv2av, type ckParams, amagi as default, douyinAPI, douyinSign, fetchBilibiliData, fetchDouyinData, fetchKuaishouData, getBilibiliData, getDouyinData, getKuaishouData, logger, qtparam, registerBilibiliRoutes, registerDouyinRoutes, registerKuaishouRoutes, startClient, wbi_sign };
13966
+ export { Amagi, type BiliAv2Bv, type BiliBangumiVideoInfo, type BiliBangumiVideoPlayurlIsLogin, type BiliBangumiVideoPlayurlNoLogin, type BiliBiliVideoPlayurlNoLogin, type BiliBv2AV, type BiliCheckQrcode, type BiliDynamicCard, type BiliDynamicInfo, type BiliEmojiList, type BiliLiveRoomDef, type BiliLiveRoomDetail, type BiliNewLoginQrcode, type BiliOneWork, type BiliUserDynamic, type BiliUserFullView, type BiliUserProfile, type BiliVideoPlayurlIsLogin, type BiliWorkComments, BilibiliData, type BilibiliDataOptions, type BilibiliDataOptionsMap, type BilibiliMethodOptionsMap, BilibiliValidateData, DouyinData, type DouyinDataOptions, type DouyinDataOptionsMap, type DouyinMethodOptionsMap, DouyinValidateData, type DyEmojiList, type DyEmojiProList, type DyImageAlbumWork, type DyMusicWork, type DySearchInfo, type DySlidesWork, type DySuggestWords, type DyUserInfo, type DyUserLiveVideos, type DyUserPostVideos, type DyVideoWork, type DyWorkComments, type KsEmojiList, type KsOneWork, type KsWorkComments, KuaishouAPI, KuaishouData, type KuaishouDataOptions, type KuaishouDataOptionsMap, type KuaishouMethodOptionsMap, type KusiahouRequest, KusiahouValidateData, Networks, type NetworksConfigType, type OmitMethodType, type TypeControl, amagi, av2bv, bilibiliAPI, bv2av, type ckParams, amagi as default, douyinAPI, douyinSign, fetchBilibiliData, fetchDouyinData, fetchKuaishouData, getBilibiliData, getDouyinData, getKuaishouData, logMiddleware, logger, qtparam, registerBilibiliRoutes, registerDouyinRoutes, registerKuaishouRoutes, wbi_sign };
@@ -0,0 +1,36 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var express = require('express');
6
+
7
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
+
9
+ var express__default = /*#__PURE__*/_interopDefault(express);
10
+
11
+
12
+
13
+ Object.defineProperty(exports, "Router", {
14
+ enumerable: true,
15
+ get: function () { return express.Router; }
16
+ });
17
+ Object.defineProperty(exports, "default", {
18
+ enumerable: true,
19
+ get: function () { return express__default.default; }
20
+ });
21
+ Object.defineProperty(exports, "json", {
22
+ enumerable: true,
23
+ get: function () { return express.json; }
24
+ });
25
+ Object.defineProperty(exports, "query", {
26
+ enumerable: true,
27
+ get: function () { return express.query; }
28
+ });
29
+ Object.defineProperty(exports, "raw", {
30
+ enumerable: true,
31
+ get: function () { return express.raw; }
32
+ });
33
+ Object.defineProperty(exports, "text", {
34
+ enumerable: true,
35
+ get: function () { return express.text; }
36
+ });
@@ -0,0 +1 @@
1
+ export { Application, CookieOptions, Errback, ErrorRequestHandler, Express, Handler, IRoute, IRouter, IRouterHandler, IRouterMatcher, Locals, MediaType, NextFunction, Request, RequestHandler, RequestParamHandler, Response, Router, RouterOptions, Send, default, json, query, raw, text } from 'express';
@@ -0,0 +1 @@
1
+ export { Router, default, json, query, raw, text } from 'express';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikenxuan/amagi",
3
- "version": "4.4.3",
3
+ "version": "4.4.4",
4
4
  "description": "抖音、B站的 web 端相关数据接口基于 Node.js 的实现",
5
5
  "keywords": [
6
6
  "douyin",
@@ -57,7 +57,7 @@
57
57
  "dependencies": {
58
58
  "axios": "^1.7.9",
59
59
  "chalk": "4.1.2",
60
- "fastify": "^4.29.0",
60
+ "express": "^4.21.2",
61
61
  "lodash": "^4.17.21",
62
62
  "log4js": "6.9.0",
63
63
  "pino-pretty": "^13.0.0"
@@ -65,6 +65,7 @@
65
65
  "devDependencies": {
66
66
  "@eslint/js": "^9.17.0",
67
67
  "@swc/core": "^1.10.12",
68
+ "@types/express": "^5.0.0",
68
69
  "@types/lodash": "^4.17.13",
69
70
  "@types/node": "^22.10.2",
70
71
  "@typescript-eslint/eslint-plugin": "^8.18.1",
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- var fastify = require('fastify');
4
-
5
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
6
-
7
- var fastify__default = /*#__PURE__*/_interopDefault(fastify);
8
-
9
-
10
-
11
- module.exports = fastify__default.default;
@@ -1 +0,0 @@
1
- export { default } from 'fastify';
@@ -1 +0,0 @@
1
- export { default } from 'fastify';