koishi-plugin-bilibili-notify 3.2.5-alpha.1 → 3.2.5-alpha.10

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 (59) hide show
  1. package/lib/index.js +94897 -28
  2. package/lib/index.mjs +94893 -21
  3. package/package.json +6 -6
  4. package/readme.md +9 -0
  5. package/lib/assets/HYZhengYuan-75W-CAgMN3FH.ttf +0 -0
  6. package/lib/biliAPI-BB6Ih4EM.mjs +0 -659
  7. package/lib/biliAPI-GF2e2-2V.js +0 -664
  8. package/lib/biliAPI.d.mts +0 -82
  9. package/lib/biliAPI.d.ts +0 -82
  10. package/lib/biliAPI.js +0 -5
  11. package/lib/biliAPI.mjs +0 -4
  12. package/lib/blive-BBVUYbxX.js +0 -43
  13. package/lib/blive-CyC_0-9A.mjs +0 -37
  14. package/lib/blive.d.mts +0 -19
  15. package/lib/blive.d.ts +0 -19
  16. package/lib/blive.js +0 -4
  17. package/lib/blive.mjs +0 -3
  18. package/lib/chunk-CrFLpmCJ.js +0 -67
  19. package/lib/chunk-DBmNgn_A.mjs +0 -40
  20. package/lib/comRegister-CcqOpkwB.mjs +0 -1421
  21. package/lib/comRegister-t7UnYFig.js +0 -1426
  22. package/lib/comRegister.d.mts +0 -109
  23. package/lib/comRegister.d.ts +0 -109
  24. package/lib/comRegister.js +0 -6
  25. package/lib/comRegister.mjs +0 -5
  26. package/lib/database-4f9U--Ji.mjs +0 -20
  27. package/lib/database-Ct2yIdxk.js +0 -37
  28. package/lib/database-Do3O9MDA.d.mts +0 -18
  29. package/lib/database-KWDs372o.d.ts +0 -18
  30. package/lib/database.d.mts +0 -2
  31. package/lib/database.d.ts +0 -2
  32. package/lib/database.js +0 -5
  33. package/lib/database.mjs +0 -3
  34. package/lib/font/HYZhengYuan-75W.js +0 -5
  35. package/lib/font/HYZhengYuan-75W.mjs +0 -5
  36. package/lib/generateImg-E9JeFpQX.js +0 -92628
  37. package/lib/generateImg-zwzMYjw6.mjs +0 -92623
  38. package/lib/generateImg.d.mts +0 -65
  39. package/lib/generateImg.d.ts +0 -65
  40. package/lib/generateImg.js +0 -5
  41. package/lib/generateImg.mjs +0 -4
  42. package/lib/img/arrow.js +0 -5
  43. package/lib/img/arrow.mjs +0 -5
  44. package/lib/index-DeGUe4jM.d.mts +0 -265
  45. package/lib/index-MJKYbMf7.d.ts +0 -265
  46. package/lib/page/0.mjs +0 -0
  47. package/lib/type/index.d.mts +0 -2
  48. package/lib/type/index.d.ts +0 -2
  49. package/lib/type/index.js +0 -5
  50. package/lib/type/index.mjs +0 -3
  51. package/lib/type-C5ZxPrgY.mjs +0 -19
  52. package/lib/type-WjCy4YMc.js +0 -31
  53. package/lib/utils/index.d.mts +0 -15
  54. package/lib/utils/index.d.ts +0 -15
  55. package/lib/utils/index.js +0 -6
  56. package/lib/utils/index.mjs +0 -3
  57. package/lib/utils-BoaYrSvG.js +0 -79
  58. package/lib/utils-C95cnBJG.mjs +0 -61
  59. /package/lib/page/{0.js → 0.html} +0 -0
package/lib/biliAPI.d.mts DELETED
@@ -1,82 +0,0 @@
1
- import { Awaitable, Context, Schema, Service } from "koishi";
2
- import { AxiosInstance } from "axios";
3
- import { CookieJar } from "tough-cookie";
4
- import { Notifier } from "@koishijs/plugin-notifier";
5
-
6
- //#region src/biliAPI.d.ts
7
- declare module "koishi" {
8
- interface Context {
9
- ba: BiliAPI;
10
- }
11
- }
12
- declare class BiliAPI extends Service {
13
- static inject: string[];
14
- jar: CookieJar;
15
- client: AxiosInstance;
16
- apiConfig: BiliAPI.Config;
17
- cacheable: any;
18
- loginData: any;
19
- loginNotifier: Notifier;
20
- refreshCookieTimer: () => void;
21
- loginInfoIsLoaded: boolean;
22
- constructor(ctx: Context, config: BiliAPI.Config);
23
- protected start(): Promise<void>;
24
- protected stop(): Awaitable<void>;
25
- getMixinKey: (orig: string) => string;
26
- encWbi(params: {
27
- [key: string]: string | number | object;
28
- }, img_key: string, sub_key: string): string;
29
- getWbi(params: {
30
- [key: string]: string | number | object;
31
- }): Promise<string>;
32
- encrypt(text: string): string;
33
- decrypt(text: string): string;
34
- getTheUserWhoIsLiveStreaming(): Promise<any>;
35
- getLiveRoomInfoStreamKey(roomId: string): Promise<any>;
36
- getLiveRoomInfoByUids(uids: string[]): Promise<any>;
37
- getServerUTCTime(): Promise<number>;
38
- getTimeNow(): Promise<any>;
39
- getAllGroup(): Promise<any>;
40
- removeUserFromGroup(mid: string): Promise<any>;
41
- copyUserToGroup(mid: string, groupId: string): Promise<any>;
42
- getUserSpaceDynamic(mid: string): Promise<any>;
43
- createGroup(tag: string): Promise<any>;
44
- getAllDynamic(): Promise<any>;
45
- hasNewDynamic(updateBaseline: string): Promise<any>;
46
- follow(fid: string): Promise<any>;
47
- getRelationGroupDetail(tagid: string): Promise<any>;
48
- getCookieInfo(refreshToken: string): Promise<any>;
49
- getUserInfo(mid: string): Promise<any>;
50
- getWbiKeys(): Promise<{
51
- img_key: any;
52
- sub_key: any;
53
- }>;
54
- getMyselfInfo(): Promise<any>;
55
- getLoginQRCode(): Promise<any>;
56
- getLoginStatus(qrcodeKey: string): Promise<any>;
57
- getLiveRoomInfo(roomId: string): Promise<any>;
58
- getMasterInfo(mid: string): Promise<any>;
59
- disposeNotifier(): void;
60
- getRandomUserAgent(): string;
61
- createNewClient(): void;
62
- getCookies(): string;
63
- getCookiesForHeader(): Promise<string>;
64
- getLoginInfoIsLoaded(): boolean;
65
- getLoginInfoFromDB(): Promise<{
66
- cookies: any;
67
- refresh_token: string;
68
- }>;
69
- getCSRF(): any;
70
- loadCookiesFromDatabase(): Promise<void>;
71
- enableRefreshCookiesDetect(): void;
72
- checkIfTokenNeedRefresh(refreshToken: string, csrf: string, times?: number): Promise<void>;
73
- }
74
- declare namespace BiliAPI {
75
- interface Config {
76
- userAgent: string;
77
- key: string;
78
- }
79
- const Config: Schema<Config>;
80
- }
81
- //#endregion
82
- export { BiliAPI as default };
package/lib/biliAPI.d.ts DELETED
@@ -1,82 +0,0 @@
1
- import { Awaitable, Context, Schema, Service } from "koishi";
2
- import { AxiosInstance } from "axios";
3
- import { CookieJar } from "tough-cookie";
4
- import { Notifier } from "@koishijs/plugin-notifier";
5
-
6
- //#region src/biliAPI.d.ts
7
- declare module "koishi" {
8
- interface Context {
9
- ba: BiliAPI;
10
- }
11
- }
12
- declare class BiliAPI extends Service {
13
- static inject: string[];
14
- jar: CookieJar;
15
- client: AxiosInstance;
16
- apiConfig: BiliAPI.Config;
17
- cacheable: any;
18
- loginData: any;
19
- loginNotifier: Notifier;
20
- refreshCookieTimer: () => void;
21
- loginInfoIsLoaded: boolean;
22
- constructor(ctx: Context, config: BiliAPI.Config);
23
- protected start(): Promise<void>;
24
- protected stop(): Awaitable<void>;
25
- getMixinKey: (orig: string) => string;
26
- encWbi(params: {
27
- [key: string]: string | number | object;
28
- }, img_key: string, sub_key: string): string;
29
- getWbi(params: {
30
- [key: string]: string | number | object;
31
- }): Promise<string>;
32
- encrypt(text: string): string;
33
- decrypt(text: string): string;
34
- getTheUserWhoIsLiveStreaming(): Promise<any>;
35
- getLiveRoomInfoStreamKey(roomId: string): Promise<any>;
36
- getLiveRoomInfoByUids(uids: string[]): Promise<any>;
37
- getServerUTCTime(): Promise<number>;
38
- getTimeNow(): Promise<any>;
39
- getAllGroup(): Promise<any>;
40
- removeUserFromGroup(mid: string): Promise<any>;
41
- copyUserToGroup(mid: string, groupId: string): Promise<any>;
42
- getUserSpaceDynamic(mid: string): Promise<any>;
43
- createGroup(tag: string): Promise<any>;
44
- getAllDynamic(): Promise<any>;
45
- hasNewDynamic(updateBaseline: string): Promise<any>;
46
- follow(fid: string): Promise<any>;
47
- getRelationGroupDetail(tagid: string): Promise<any>;
48
- getCookieInfo(refreshToken: string): Promise<any>;
49
- getUserInfo(mid: string): Promise<any>;
50
- getWbiKeys(): Promise<{
51
- img_key: any;
52
- sub_key: any;
53
- }>;
54
- getMyselfInfo(): Promise<any>;
55
- getLoginQRCode(): Promise<any>;
56
- getLoginStatus(qrcodeKey: string): Promise<any>;
57
- getLiveRoomInfo(roomId: string): Promise<any>;
58
- getMasterInfo(mid: string): Promise<any>;
59
- disposeNotifier(): void;
60
- getRandomUserAgent(): string;
61
- createNewClient(): void;
62
- getCookies(): string;
63
- getCookiesForHeader(): Promise<string>;
64
- getLoginInfoIsLoaded(): boolean;
65
- getLoginInfoFromDB(): Promise<{
66
- cookies: any;
67
- refresh_token: string;
68
- }>;
69
- getCSRF(): any;
70
- loadCookiesFromDatabase(): Promise<void>;
71
- enableRefreshCookiesDetect(): void;
72
- checkIfTokenNeedRefresh(refreshToken: string, csrf: string, times?: number): Promise<void>;
73
- }
74
- declare namespace BiliAPI {
75
- interface Config {
76
- userAgent: string;
77
- key: string;
78
- }
79
- const Config: Schema<Config>;
80
- }
81
- //#endregion
82
- export { BiliAPI as default };
package/lib/biliAPI.js DELETED
@@ -1,5 +0,0 @@
1
- const require_chunk = require('./chunk-CrFLpmCJ.js');
2
- require('./utils-BoaYrSvG.js');
3
- const require_biliAPI = require('./biliAPI-GF2e2-2V.js');
4
-
5
- module.exports = require_biliAPI.biliAPI_default;
package/lib/biliAPI.mjs DELETED
@@ -1,4 +0,0 @@
1
- import "./utils-C95cnBJG.mjs";
2
- import { biliAPI_default } from "./biliAPI-BB6Ih4EM.mjs";
3
-
4
- export { biliAPI_default as default };
@@ -1,43 +0,0 @@
1
- const require_chunk = require('./chunk-CrFLpmCJ.js');
2
- const koishi = require_chunk.__toESM(require("koishi"));
3
- const __akokko_blive_message_listener = require_chunk.__toESM(require("@akokko/blive-message-listener"));
4
-
5
- //#region src/blive.ts
6
- var BLive = class extends koishi.Service {
7
- static inject = ["ba"];
8
- listenerRecord = {};
9
- constructor(ctx) {
10
- super(ctx, "bl");
11
- }
12
- stop() {
13
- for (const key of Object.keys(this.listenerRecord)) this.closeListener(key);
14
- }
15
- async startLiveRoomListener(roomId, handler) {
16
- const cookiesStr = await this.ctx.ba.getCookiesForHeader();
17
- const mySelfInfo = await this.ctx.ba.getMyselfInfo();
18
- this.listenerRecord[roomId] = (0, __akokko_blive_message_listener.startListen)(Number.parseInt(roomId), handler, { ws: {
19
- headers: { Cookie: cookiesStr },
20
- uid: mySelfInfo.data.mid
21
- } });
22
- this.logger.info(`[${roomId}]直播间连接已建立!`);
23
- }
24
- closeListener(roomId) {
25
- if (!this.listenerRecord || !this.listenerRecord[roomId]?.closed) this.logger.info(`${roomId}直播间连接无需关闭`);
26
- this.listenerRecord[roomId].close();
27
- if (this.listenerRecord[roomId].closed) {
28
- delete this.listenerRecord[roomId];
29
- this.logger.info(`${roomId}直播间连接已关闭`);
30
- return;
31
- }
32
- this.logger.warn(`${roomId}直播间连接未成功关闭`);
33
- }
34
- };
35
- var blive_default = BLive;
36
-
37
- //#endregion
38
- Object.defineProperty(exports, 'blive_default', {
39
- enumerable: true,
40
- get: function () {
41
- return blive_default;
42
- }
43
- });
@@ -1,37 +0,0 @@
1
- import { Service } from "koishi";
2
- import { startListen } from "@akokko/blive-message-listener";
3
-
4
- //#region src/blive.ts
5
- var BLive = class extends Service {
6
- static inject = ["ba"];
7
- listenerRecord = {};
8
- constructor(ctx) {
9
- super(ctx, "bl");
10
- }
11
- stop() {
12
- for (const key of Object.keys(this.listenerRecord)) this.closeListener(key);
13
- }
14
- async startLiveRoomListener(roomId, handler) {
15
- const cookiesStr = await this.ctx.ba.getCookiesForHeader();
16
- const mySelfInfo = await this.ctx.ba.getMyselfInfo();
17
- this.listenerRecord[roomId] = startListen(Number.parseInt(roomId), handler, { ws: {
18
- headers: { Cookie: cookiesStr },
19
- uid: mySelfInfo.data.mid
20
- } });
21
- this.logger.info(`[${roomId}]直播间连接已建立!`);
22
- }
23
- closeListener(roomId) {
24
- if (!this.listenerRecord || !this.listenerRecord[roomId]?.closed) this.logger.info(`${roomId}直播间连接无需关闭`);
25
- this.listenerRecord[roomId].close();
26
- if (this.listenerRecord[roomId].closed) {
27
- delete this.listenerRecord[roomId];
28
- this.logger.info(`${roomId}直播间连接已关闭`);
29
- return;
30
- }
31
- this.logger.warn(`${roomId}直播间连接未成功关闭`);
32
- }
33
- };
34
- var blive_default = BLive;
35
-
36
- //#endregion
37
- export { blive_default };
package/lib/blive.d.mts DELETED
@@ -1,19 +0,0 @@
1
- import { Awaitable, Context, Service } from "koishi";
2
- import { MsgHandler } from "@akokko/blive-message-listener";
3
-
4
- //#region src/blive.d.ts
5
- declare module "koishi" {
6
- interface Context {
7
- bl: BLive;
8
- }
9
- }
10
- declare class BLive extends Service {
11
- static inject: string[];
12
- private listenerRecord;
13
- constructor(ctx: Context);
14
- protected stop(): Awaitable<void>;
15
- startLiveRoomListener(roomId: string, handler: MsgHandler): Promise<void>;
16
- closeListener(roomId: string): void;
17
- }
18
- //#endregion
19
- export { BLive as default };
package/lib/blive.d.ts DELETED
@@ -1,19 +0,0 @@
1
- import { Awaitable, Context, Service } from "koishi";
2
- import { MsgHandler } from "@akokko/blive-message-listener";
3
-
4
- //#region src/blive.d.ts
5
- declare module "koishi" {
6
- interface Context {
7
- bl: BLive;
8
- }
9
- }
10
- declare class BLive extends Service {
11
- static inject: string[];
12
- private listenerRecord;
13
- constructor(ctx: Context);
14
- protected stop(): Awaitable<void>;
15
- startLiveRoomListener(roomId: string, handler: MsgHandler): Promise<void>;
16
- closeListener(roomId: string): void;
17
- }
18
- //#endregion
19
- export { BLive as default };
package/lib/blive.js DELETED
@@ -1,4 +0,0 @@
1
- const require_chunk = require('./chunk-CrFLpmCJ.js');
2
- const require_blive = require('./blive-BBVUYbxX.js');
3
-
4
- module.exports = require_blive.blive_default;
package/lib/blive.mjs DELETED
@@ -1,3 +0,0 @@
1
- import { blive_default } from "./blive-CyC_0-9A.mjs";
2
-
3
- export { blive_default as default };
@@ -1,67 +0,0 @@
1
- //#region rolldown:runtime
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __esm = (fn, res) => function() {
9
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
- };
11
- var __commonJS = (cb, mod) => function() {
12
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13
- };
14
- var __export = (target, all) => {
15
- for (var name in all) __defProp(target, name, {
16
- get: all[name],
17
- enumerable: true
18
- });
19
- };
20
- var __copyProps = (to, from, except, desc) => {
21
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
22
- key = keys[i];
23
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
24
- get: ((k) => from[k]).bind(null, key),
25
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
26
- });
27
- }
28
- return to;
29
- };
30
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
31
- value: mod,
32
- enumerable: true
33
- }) : target, mod));
34
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
-
36
- //#endregion
37
-
38
- Object.defineProperty(exports, '__commonJS', {
39
- enumerable: true,
40
- get: function () {
41
- return __commonJS;
42
- }
43
- });
44
- Object.defineProperty(exports, '__esm', {
45
- enumerable: true,
46
- get: function () {
47
- return __esm;
48
- }
49
- });
50
- Object.defineProperty(exports, '__export', {
51
- enumerable: true,
52
- get: function () {
53
- return __export;
54
- }
55
- });
56
- Object.defineProperty(exports, '__toCommonJS', {
57
- enumerable: true,
58
- get: function () {
59
- return __toCommonJS;
60
- }
61
- });
62
- Object.defineProperty(exports, '__toESM', {
63
- enumerable: true,
64
- get: function () {
65
- return __toESM;
66
- }
67
- });
@@ -1,40 +0,0 @@
1
- import { createRequire } from "node:module";
2
-
3
- //#region rolldown:runtime
4
- var __create = Object.create;
5
- var __defProp = Object.defineProperty;
6
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
- var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getProtoOf = Object.getPrototypeOf;
9
- var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __esm = (fn, res) => function() {
11
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
- };
13
- var __commonJS = (cb, mod) => function() {
14
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
- };
16
- var __export = (target, all) => {
17
- for (var name in all) __defProp(target, name, {
18
- get: all[name],
19
- enumerable: true
20
- });
21
- };
22
- var __copyProps = (to, from, except, desc) => {
23
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
24
- key = keys[i];
25
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
26
- get: ((k) => from[k]).bind(null, key),
27
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
28
- });
29
- }
30
- return to;
31
- };
32
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
33
- value: mod,
34
- enumerable: true
35
- }) : target, mod));
36
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
38
-
39
- //#endregion
40
- export { __commonJS, __esm, __export, __require, __toCommonJS, __toESM };