@open-wa/wa-automate-types-only 4.27.7 → 4.28.1

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.
@@ -37,7 +37,6 @@ export declare class Client {
37
37
  private _page;
38
38
  private _currentlyBeingKilled;
39
39
  private _refreshing;
40
- private _l;
41
40
  private _prio;
42
41
  private _pageListeners;
43
42
  private _registeredPageListeners;
@@ -1,5 +1,6 @@
1
1
  import { AxiosRequestConfig } from 'axios';
2
2
  import { PREPROCESSORS } from '../../structures/preProcessors';
3
+ import { ConfigLogTransport } from '../../logging/logging';
3
4
  import { Base64 } from "./aliases";
4
5
  import { SimpleListener } from './events';
5
6
  /**
@@ -741,6 +742,12 @@ export interface ConfigObject {
741
742
  * Expose a URL where you can easily scan the qr code
742
743
  */
743
744
  ezqr?: boolean;
745
+ /**
746
+ * An array of [winston](https://github.com/winstonjs/winston/blob/master/docs/transports.md#additional-transports) logging transport configurations.
747
+ *
748
+ * [Check this discussion to see how to set up logging](https://github.com/open-wa/wa-automate-nodejs/discussions/2373)
749
+ */
750
+ logging?: ConfigLogTransport[];
744
751
  /**@internal */
745
752
  [x: string]: any;
746
753
  }
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export { create } from './controllers/initializer';
4
4
  export * from '@open-wa/wa-decrypt';
5
5
  export { ev, Spin } from './controllers/events';
6
6
  export * from './utils/tools';
7
+ export * from './logging/logging';
7
8
  export * from './structures/preProcessors';
8
9
  export * from './connect';
9
10
  export * from './build/build-postman';
@@ -0,0 +1,9 @@
1
+ import TransportStream from 'winston-transport';
2
+ export declare class LogToEvTransport extends TransportStream {
3
+ constructor(opts?: any);
4
+ log(info: any, callback: any): any;
5
+ }
6
+ export declare class NoOpTransport extends TransportStream {
7
+ constructor(opts?: any);
8
+ log(info: any, callback: any): any;
9
+ }
@@ -0,0 +1,50 @@
1
+ import * as winston from 'winston';
2
+ /**
3
+ * You can access the log in your code and add your own custom transports
4
+ * https://github.com/winstonjs/winston#transports
5
+ * see [Logger](https://github.com/winstonjs/winston#transports) for more details.
6
+ *
7
+ * Here is an example of adding the GCP stackdriver transport:
8
+ *
9
+ * ```
10
+ * import { log } from '@open-wa/wa-automate'
11
+ * import { LoggingWinston } from '@google-cloud/logging-winston';
12
+ *
13
+ * const gcpTransport = new LoggingWinston({
14
+ * projectId: 'your-project-id',
15
+ * keyFilename: '/path/to/keyfile.json'
16
+ * });
17
+ *
18
+ * ...
19
+ * log.add(
20
+ * gcpTransport
21
+ * )
22
+ *
23
+ * //Congrats! Now all of your session logs will also go to GCP Stackdriver
24
+ * ```
25
+ */
26
+ export declare const log: winston.Logger;
27
+ export declare const addRotateFileLogTransport: (options?: any) => void;
28
+ /**
29
+ * @private
30
+ */
31
+ export declare const addSysLogTransport: (options?: any) => void;
32
+ export declare type ConfigLogTransport = {
33
+ /**
34
+ * The type of winston transport. At the moment only `file`, `console`, `ev` and `syslog` are supported.
35
+ */
36
+ type: 'syslog' | 'console' | 'file' | 'ev';
37
+ /**
38
+ * The options for the transport. Generally only required for syslog but you can use this to override default options for other types of transports.
39
+ */
40
+ options?: any;
41
+ /**
42
+ * If the transport has already been added to the logger. The logging set up command handles this for you.
43
+ * @readonly
44
+ */
45
+ done?: boolean;
46
+ };
47
+ /**
48
+ * @private
49
+ */
50
+ export declare const setupLogging: (logging: ConfigLogTransport[], sessionId?: string) => ConfigLogTransport[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-wa/wa-automate-types-only",
3
- "version": "4.27.7",
3
+ "version": "4.28.1",
4
4
  "description": "Types generated from the @open-wa/wa-automate package",
5
5
  "scripts": {
6
6
  "build": "tsc",