@skrillex1224/playwright-toolkit 2.1.38 → 2.1.39

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
@@ -50,6 +50,72 @@ export interface ErrorsModule {
50
50
  CrawlerError: typeof CrawlerError;
51
51
  }
52
52
 
53
+ // =============================================================================
54
+ // Logger
55
+ // =============================================================================
56
+ export interface LoggerTemplate {
57
+ step(step: string, status?: string, details?: string[], level?: 'info' | 'warn' | 'warning' | 'error'): void;
58
+ taskStart(url?: string): void;
59
+ taskSuccess(): void;
60
+ taskFail(url?: string, err?: unknown): void;
61
+ runtimeHeadless(): void;
62
+ loginInjectSuccess(detail?: string): void;
63
+ loginInjectSkip(reason?: string): void;
64
+ loginInjectFail(err?: unknown): void;
65
+ loginVerifySuccess(detail?: string): void;
66
+ loginVerifySkip(reason?: string): void;
67
+ loginVerifyFail(err?: unknown): void;
68
+ envCheckSuccess(detail?: string): void;
69
+ envCheckFail(err?: unknown): void;
70
+ inputQuery(query?: string): void;
71
+ sendAction(): void;
72
+ responseListenStart(label?: string, timeoutSec?: number): void;
73
+ responseListenReady(label?: string): void;
74
+ responseListenDetected(label?: string): void;
75
+ responseListenTimeout(label?: string, err?: unknown): void;
76
+ responseListenEnd(label?: string): void;
77
+ streamChunk(length?: number, snippet?: string): void;
78
+ streamEventsParsed(count?: number): void;
79
+ streamCompleteEvent(): void;
80
+ streamEnd(): void;
81
+ responseWaitStart(label?: string): void;
82
+ responseWaitSuccess(label?: string): void;
83
+ responseWaitFail(label?: string, err?: unknown): void;
84
+ responseWaitRetry(label?: string, attempt?: number): void;
85
+ referenceExpandStart(label?: string): void;
86
+ referenceExpandFail(err?: unknown): void;
87
+ screenshotStart(): void;
88
+ screenshotSuccess(): void;
89
+ screenshotFail(err?: unknown): void;
90
+ shareStart(): void;
91
+ shareProgress(label?: string): void;
92
+ shareSuccess(link?: string): void;
93
+ shareFail(err?: unknown): void;
94
+ shareSkip(reason?: string): void;
95
+ dataPushSuccess(label?: string): void;
96
+ dataPushFail(err?: unknown): void;
97
+ popupDetected(detail?: string): void;
98
+ popupCloseAttempt(detail?: string): void;
99
+ popupCloseSuccess(): void;
100
+ popupCloseFail(err?: unknown): void;
101
+ info(message: string): void;
102
+ success(message: string): void;
103
+ warning(message: string): void;
104
+ error(message: string): void;
105
+ debug(message: string): void;
106
+ start(message: string): void;
107
+ }
108
+
109
+ export interface LoggerModule {
110
+ info(message: string): void;
111
+ success(message: string): void;
112
+ warning(message: string): void;
113
+ error(message: string): void;
114
+ debug(message: string): void;
115
+ start(message: string): void;
116
+ useTemplate(): LoggerTemplate;
117
+ }
118
+
53
119
  // =============================================================================
54
120
  // ApifyKit
55
121
  // =============================================================================
@@ -336,6 +402,7 @@ export interface PlaywrightToolKit {
336
402
  Errors: ErrorsModule;
337
403
  Interception: InterceptionModule;
338
404
  Mutation: MutationModule;
405
+ Logger: LoggerModule;
339
406
  }
340
407
 
341
408
  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.38",
3
+ "version": "2.1.39",
4
4
  "description": "一个在 Apify/Crawlee Actor 中启用实时截图视图的实用工具库。",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",