@open-wa/wa-automate-types-only 4.27.6 → 4.28.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.
package/dist/api/Client.d.ts
CHANGED
@@ -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
|
/**
|
@@ -737,6 +738,16 @@ export interface ConfigObject {
|
|
737
738
|
* Automatically kill the process after a set amount of qr codes
|
738
739
|
*/
|
739
740
|
qrMax?: number;
|
741
|
+
/**
|
742
|
+
* Expose a URL where you can easily scan the qr code
|
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[];
|
740
751
|
/**@internal */
|
741
752
|
[x: string]: any;
|
742
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[];
|