@skrillex1224/playwright-toolkit 2.1.77 → 2.1.80

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.
package/index.d.ts CHANGED
@@ -379,6 +379,24 @@ export interface UtilsModule {
379
379
  fullPageScreenshot(page: Page, options?: FullPageScreenshotOptions): Promise<string>;
380
380
  }
381
381
 
382
+ // =============================================================================
383
+ // Display
384
+ // =============================================================================
385
+ export interface DisplayModule {
386
+ parseTokenDisplayName(value?: string): { owner: string; accountType: string; note: string };
387
+ parseAccountDisplayName(value?: string): { account: string; owner: string; accountType: string; note: string };
388
+ buildTokenDisplayName(input: { owner: string; accountType: string; note?: string }): string;
389
+ shortId(value?: string, max?: number): string;
390
+ resolveTokenIdentity(
391
+ displayName?: string,
392
+ tokenId?: string
393
+ ): { primary: string; secondary: string; fullId: string; shortId: string };
394
+ resolveAccountIdentity(
395
+ displayName?: string,
396
+ accountId?: string
397
+ ): { primary: string; secondary: string; fullId: string; shortId: string; parts: { account: string; owner: string; accountType: string; note: string } };
398
+ }
399
+
382
400
  // =============================================================================
383
401
  // Mutation
384
402
  // =============================================================================
@@ -431,90 +449,6 @@ export interface MutationModule {
431
449
  useMonitor(page: Page, selectors: string | string[], options?: useMonitorOptions): Promise<MutationMonitor>;
432
450
  }
433
451
 
434
- // AccountForm
435
- // =============================================================================
436
- export interface AccountFormField {
437
- key?: string;
438
- label?: string;
439
- type: 'text' | 'textarea' | 'autocomplete' | 'select' | 'password' | 'divider';
440
- required?: boolean;
441
- placeholder?: string;
442
- options?: string[];
443
- col?: number;
444
- divider?: 'before' | 'after';
445
- }
446
-
447
- export interface PlatformSchema {
448
- /** 平台配置键名(由 getSchema 自动填充) */
449
- key: ActorKey;
450
- name: string;
451
- tokenNames: string[];
452
- domain: string;
453
- tokenSource: 'Cookie' | 'LocalStorage';
454
- guide?: string;
455
- fields: AccountFormField[];
456
- parse(token: string): Record<string, string>;
457
- format(values: Record<string, any>): string;
458
- }
459
-
460
- export interface StaticConfig {
461
- path: string;
462
- method: string;
463
- headers: Record<string, string>;
464
- }
465
-
466
- export interface BuildParamsResult {
467
- ok: boolean;
468
- error?: string;
469
- params?: {
470
- account_id: string;
471
- token: string;
472
- actor: ActorKey;
473
- display_name: string;
474
- status: string;
475
- ban_count: number;
476
- };
477
- }
478
-
479
- export interface AccountFormInstance {
480
- getSchema(key: ActorKey): PlatformSchema;
481
- parseToken(token: string, config: PlatformSchema): Record<string, string>;
482
- formatToken(values: Record<string, any>, config: PlatformSchema): string;
483
- validate(values: Record<string, any>, config: PlatformSchema): { ok: boolean; message?: string };
484
- /**
485
- * 获取 API 静态配置
486
- */
487
- getStaticConfig(): StaticConfig;
488
- /**
489
- * 构建账号提交参数
490
- * @param values - 表单值
491
- * @param config - 平台配置 (来自 getSchema)
492
- */
493
- buildParams(values: Record<string, any>, config: PlatformSchema): BuildParamsResult;
494
- }
495
-
496
- export interface AccountFormModule {
497
- useAccountForm(): Promise<AccountFormInstance>;
498
- }
499
-
500
-
501
- export type ActorKey = 'doubao' | 'deepseek' | 'erine' | 'yuanbao' | 'moonshot' | 'qwen';
502
-
503
- export interface ActorFeConfigItem {
504
- key: ActorKey;
505
- icon: string;
506
- name: string;
507
- }
508
-
509
- export interface ActorFeConfigInstance {
510
- getMapping: (key: ActorKey) => ActorFeConfigItem | undefined;
511
- list: () => ActorFeConfigItem[];
512
- }
513
-
514
- export interface ActorFeConfigModule {
515
- useActorFeConfig: () => Promise<ActorFeConfigInstance>;
516
- }
517
-
518
452
  // =============================================================================
519
453
  // Toolkit Entry Point
520
454
  // =============================================================================
@@ -528,6 +462,7 @@ export interface PlaywrightToolKit {
528
462
  LiveView: LiveViewModule;
529
463
  Constants: ConstantsModule;
530
464
  Utils: UtilsModule;
465
+ Display: DisplayModule;
531
466
  Captcha: CaptchaModule;
532
467
  Sse: SseModule;
533
468
  Errors: ErrorsModule;
@@ -543,12 +478,13 @@ export interface PlaywrightToolKit {
543
478
  /** Browser/Extension version of the toolkit */
544
479
  export interface BrowserPlaywrightToolKit {
545
480
  Logger: LoggerModule;
546
- AccountForm: AccountFormModule;
547
- ActorFeConfig: ActorFeConfigModule;
481
+ Display: DisplayModule;
548
482
  $Internals: {
549
483
  LOG_TEMPLATES: LogTemplate[];
550
484
  stripAnsi(input: string): string;
551
485
  };
552
486
  }
553
487
 
488
+ export declare const Display: DisplayModule;
489
+
554
490
  export declare function usePlaywrightToolKit(): PlaywrightToolKit;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skrillex1224/playwright-toolkit",
3
- "version": "2.1.77",
3
+ "version": "2.1.80",
4
4
  "description": "一个在 Apify/Crawlee Actor 中启用实时截图视图的实用工具库。",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",