koishi-plugin-noah 2.2.2 → 2.3.0

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 (32) hide show
  1. package/lib/drawer/sdvx/index.d.ts +1 -1
  2. package/lib/games/sdvx/adapters/asphyxia.d.ts +18 -0
  3. package/lib/games/sdvx/adapters/index.d.ts +6 -0
  4. package/lib/games/sdvx/adapters/mao.d.ts +19 -0
  5. package/lib/games/sdvx/adapters/official.d.ts +14 -0
  6. package/lib/games/sdvx/command.d.ts +1 -1
  7. package/lib/games/sdvx/commands/calculate.d.ts +1 -1
  8. package/lib/games/sdvx/commands/chart.d.ts +1 -1
  9. package/lib/games/sdvx/commands/info.d.ts +1 -1
  10. package/lib/games/sdvx/commands/radar.d.ts +1 -1
  11. package/lib/games/sdvx/commands/recent.d.ts +1 -1
  12. package/lib/games/sdvx/commands/sync.d.ts +1 -1
  13. package/lib/games/sdvx/commands/vf.d.ts +1 -1
  14. package/lib/games/sdvx/config.d.ts +1 -2
  15. package/lib/games/sdvx/services/music-service.d.ts +1 -1
  16. package/lib/games/sdvx/types/config.d.ts +10 -0
  17. package/lib/games/sdvx/types/index.d.ts +16 -0
  18. package/lib/index.cjs +1294 -1360
  19. package/lib/servers/Asphyxia/index.d.ts +0 -4
  20. package/lib/servers/Asphyxia/utils/xml.d.ts +2 -0
  21. package/lib/servers/Mao/index.d.ts +0 -4
  22. package/lib/servers/Official/index.d.ts +0 -4
  23. package/lib/servers/index.d.ts +4 -17
  24. package/lib/types/config.d.ts +2 -12
  25. package/lib/types/index.d.ts +0 -67
  26. package/package.json +1 -1
  27. package/lib/servers/Asphyxia/services/sdvx-service.d.ts +0 -26
  28. package/lib/servers/Mao/services/sdvx-service.d.ts +0 -39
  29. package/lib/servers/Official/services/sdvx-service.d.ts +0 -25
  30. package/lib/servers/utils/grade.d.ts +0 -8
  31. package/lib/servers/utils/xml.d.ts +0 -13
  32. /package/lib/{servers → games/sdvx}/utils/difficulty.d.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  import { Context } from 'koishi';
2
2
  import { SDVXScore } from '../../games/sdvx/types';
3
- import { SDVXConfig } from '../../types/config';
3
+ import { SDVXConfig } from '../../games/sdvx/types/config';
4
4
  import { BaseDrawer } from '../BaseDrawer';
5
5
  /**
6
6
  * SDVX绘图类,提供SDVX游戏相关图像生成功能
@@ -0,0 +1,18 @@
1
+ import { Context, Logger } from 'koishi';
2
+ import { GameService } from '../../../types';
3
+ import { SDVXScore } from '../types';
4
+ import { SDVXConfig } from '../types/config';
5
+ export declare class AsphyxiaSDVXService implements GameService {
6
+ private static instance;
7
+ logger: Logger;
8
+ private config;
9
+ private cachedModel;
10
+ private constructor();
11
+ static getInstance(logger: Logger, config: SDVXConfig): AsphyxiaSDVXService;
12
+ private getModel;
13
+ getRefid(ctx: Context, url: string, model: string, cardId: string): Promise<string>;
14
+ getUserName(ctx: Context, url: string, cardId: string): Promise<string>;
15
+ getAllScore(ctx: Context, url: string, cardId: string, config: SDVXConfig): Promise<SDVXScore[]>;
16
+ private getClearType;
17
+ private getDifficultyString;
18
+ }
@@ -0,0 +1,6 @@
1
+ import { Logger } from 'koishi';
2
+ import { SDVXConfig } from '../types/config';
3
+ export declare function registerSDVXAdapters(logger: Logger, config: SDVXConfig): void;
4
+ export { AsphyxiaSDVXService } from './asphyxia';
5
+ export { MaoSDVXService } from './mao';
6
+ export { OfficialSDVXService } from './official';
@@ -0,0 +1,19 @@
1
+ import { Context, Logger } from 'koishi';
2
+ import { SDVXService as ISDVXService, SDVXScore } from '../types';
3
+ import { SDVXConfig } from '../types/config';
4
+ export declare class MaoSDVXService implements ISDVXService {
5
+ private static instance;
6
+ logger: Logger;
7
+ private constructor();
8
+ static getInstance(logger: Logger): MaoSDVXService;
9
+ private getDifficultyString;
10
+ private getClearType;
11
+ getUserName(ctx: Context, url: string, cardId: string): Promise<string>;
12
+ verifyPin(ctx: Context, url: string, cardId: string, pin: string): Promise<boolean>;
13
+ private clearTypeToNum;
14
+ private diffNameToMusicType;
15
+ uploadScore(ctx: Context, url: string, cardId: string, scores: SDVXScore[]): Promise<boolean>;
16
+ getAllScore(ctx: Context, url: string, cardId: string, config: SDVXConfig): Promise<SDVXScore[]>;
17
+ getScore(ctx: Context, url: string, cardId: string, musicId: number, config: SDVXConfig): Promise<SDVXScore>;
18
+ getRecentScores(ctx: Context, url: string, cardId: string, config: SDVXConfig, count?: number): Promise<SDVXScore[]>;
19
+ }
@@ -0,0 +1,14 @@
1
+ import { Context, Logger } from 'koishi';
2
+ import { SDVXService as ISDVXService, SDVXScore } from '../types';
3
+ import { SDVXConfig } from '../types/config';
4
+ export declare class OfficialSDVXService implements ISDVXService {
5
+ private static instance;
6
+ logger: Logger;
7
+ private constructor();
8
+ static getInstance(logger: Logger): OfficialSDVXService;
9
+ private mapClearType;
10
+ getUserName(ctx: Context, url: string, player_id: string): Promise<string>;
11
+ getAllScore(ctx: Context, url: string, player_id: string, config: SDVXConfig): Promise<SDVXScore[]>;
12
+ getScore(ctx: Context, url: string, player_id: string, musicId: number, config: SDVXConfig): Promise<SDVXScore>;
13
+ getRecentScores(ctx: Context, url: string, player_id: string, config: SDVXConfig, count?: number): Promise<SDVXScore[]>;
14
+ }
@@ -1,4 +1,4 @@
1
1
  import { Context } from 'koishi';
2
- import { SDVXConfig } from '../../types/config';
2
+ import { SDVXConfig } from './types/config';
3
3
  export declare const name = "command";
4
4
  export declare function apply(ctx: Context, config: SDVXConfig): void;
@@ -1,3 +1,3 @@
1
1
  import { Context, Logger } from 'koishi';
2
- import { SDVXConfig } from '../../../types/config';
2
+ import { SDVXConfig } from '../types/config';
3
3
  export declare function calculate(ctx: Context, config: SDVXConfig, logger: Logger): void;
@@ -1,3 +1,3 @@
1
1
  import { Context, Logger } from 'koishi';
2
- import { SDVXConfig } from '../../../types/config';
2
+ import { SDVXConfig } from '../types/config';
3
3
  export declare function chart(ctx: Context, config: SDVXConfig, logger: Logger): void;
@@ -1,3 +1,3 @@
1
1
  import { Context, Logger } from 'koishi';
2
- import { SDVXConfig } from '../../../types/config';
2
+ import { SDVXConfig } from '../types/config';
3
3
  export declare function info(ctx: Context, config: SDVXConfig, logger: Logger): void;
@@ -1,3 +1,3 @@
1
1
  import { Context, Logger } from 'koishi';
2
- import { SDVXConfig } from '../../../types/config';
2
+ import { SDVXConfig } from '../types/config';
3
3
  export declare function radar(ctx: Context, config: SDVXConfig, logger: Logger): void;
@@ -1,3 +1,3 @@
1
1
  import { Context, Logger } from 'koishi';
2
- import { SDVXConfig } from '../../../types/config';
2
+ import { SDVXConfig } from '../types/config';
3
3
  export declare function recent(ctx: Context, config: SDVXConfig, logger: Logger): void;
@@ -1,3 +1,3 @@
1
1
  import { Context, Logger } from 'koishi';
2
- import { SDVXConfig } from '../../../types/config';
2
+ import { SDVXConfig } from '../types/config';
3
3
  export declare function sync(ctx: Context, config: SDVXConfig, logger: Logger): void;
@@ -1,3 +1,3 @@
1
1
  import { Context, Logger } from 'koishi';
2
- import { SDVXConfig } from '../../../types/config';
2
+ import { SDVXConfig } from '../types/config';
3
3
  export declare function vf(ctx: Context, config: SDVXConfig, logger: Logger): void;
@@ -1,7 +1,6 @@
1
- import { SDVXConfig } from '../../types/config';
1
+ import { SDVXConfig } from './types/config';
2
2
  /**
3
3
  * SDVX 配置模式定义
4
- * @property default_model - 默认模型版本
5
4
  * @property sdvx_data_url - SDVX 数据 URL
6
5
  */
7
6
  export declare const sdvxConfig: SDVXConfig;
@@ -1,6 +1,6 @@
1
1
  import { Context } from 'koishi';
2
- import { SDVXConfig } from '../../../types/config';
3
2
  import { SDVXMusic } from '../types';
3
+ import { SDVXConfig } from '../types/config';
4
4
  export declare class MusicService {
5
5
  private static instance;
6
6
  private sdvx_data_url;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * SDVX 游戏配置接口
3
+ * 包含 SDVX 游戏相关的配置项
4
+ */
5
+ export interface SDVXConfig {
6
+ /** SDVX 数据 URL */
7
+ sdvx_data_url: string;
8
+ /** SDVX 搜索 URL */
9
+ sdvx_search_url: string;
10
+ }
@@ -1,3 +1,19 @@
1
+ import { Context } from 'koishi';
2
+ import { GameService } from '../../../types';
3
+ import { SDVXConfig } from './config';
4
+ export { SDVXConfig };
5
+ /**
6
+ * Sound Voltex (SDVX) 游戏服务接口
7
+ * 扩展基础游戏服务接口,添加 SDVX 特定的功能
8
+ */
9
+ export interface SDVXService extends GameService {
10
+ getAllScore(ctx: Context, url: string, cardId: string, config: SDVXConfig): Promise<SDVXScore[]>;
11
+ getScore(ctx: Context, url: string, cardId: string, musicId: number, config: SDVXConfig): Promise<SDVXScore>;
12
+ getRecentScores(ctx: Context, url: string, cardId: string, config?: SDVXConfig, count?: number): Promise<SDVXScore[]>;
13
+ getUserName(ctx: Context, url: string, cardId: string): Promise<string>;
14
+ verifyPin?(ctx: Context, url: string, cardId: string, pin: string): Promise<boolean>;
15
+ uploadScore?(ctx: Context, url: string, cardId: string, scores: SDVXScore[]): Promise<boolean>;
16
+ }
1
17
  /**
2
18
  * SDVX 用户档案接口
3
19
  */