@open-wa/wa-automate-types-only 4.27.9 → 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.
@@ -1,6 +1,6 @@
|
|
1
1
|
import { AxiosRequestConfig } from 'axios';
|
2
2
|
import { PREPROCESSORS } from '../../structures/preProcessors';
|
3
|
-
import { ConfigLogTransport } from '../../
|
3
|
+
import { ConfigLogTransport } from '../../logging/logging';
|
4
4
|
import { Base64 } from "./aliases";
|
5
5
|
import { SimpleListener } from './events';
|
6
6
|
/**
|
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';
|
File without changes
|
@@ -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
package/dist/utils/logging.d.ts
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
import * as winston from 'winston';
|
2
|
-
/**
|
3
|
-
* You can access the log in your code and add your own custom transports
|
4
|
-
*/
|
5
|
-
export declare const log: winston.Logger;
|
6
|
-
export declare const addRotateFileLogTransport: (options?: any) => void;
|
7
|
-
export declare type ConfigLogTransport = {
|
8
|
-
/**
|
9
|
-
* The type of winston transport. At the moment only file, console, ev and syslog are supported.
|
10
|
-
*/
|
11
|
-
type: 'syslog' | 'console' | 'file' | 'ev';
|
12
|
-
/**
|
13
|
-
* The options for the transport. Generally only required for syslog but you can use this to override default options for other types of transports.
|
14
|
-
*/
|
15
|
-
options?: any;
|
16
|
-
done?: boolean;
|
17
|
-
};
|
18
|
-
export declare const setupLogging: (logging: ConfigLogTransport[], sessionId?: string) => ConfigLogTransport[];
|