@takeshape/logger 7.90.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/README.md +5 -0
- package/es/index.js +1 -0
- package/es/logger.js +97 -0
- package/es/types.js +0 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +35 -0
- package/lib/logger.d.ts +17 -0
- package/lib/logger.d.ts.map +1 -0
- package/lib/logger.js +111 -0
- package/lib/types.d.ts +624 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +1 -0
- package/package.json +43 -0
package/README.md
ADDED
package/es/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, loggerWithContext, Logger, TimberMetadata } from './logger';
|
package/es/logger.js
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import merge from 'lodash/merge';
|
|
2
|
+
import { captureException, setUser, setTag } from '@sentry/node';
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
5
|
+
const noop = () => {};
|
|
6
|
+
|
|
7
|
+
export function getLogFn(level) {
|
|
8
|
+
if (process.env.NODE_ENV === 'test') {
|
|
9
|
+
return noop;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (process.env.IS_OFFLINE) {
|
|
13
|
+
const prettyjson = require('prettyjson'); // eslint-disable-line @typescript-eslint/no-var-requires
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
return (message, metadata) => {
|
|
17
|
+
console[level](message);
|
|
18
|
+
|
|
19
|
+
if (metadata) {
|
|
20
|
+
console[level](prettyjson.render(metadata), '\n');
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return (message, metadata) => {
|
|
26
|
+
const args = [message];
|
|
27
|
+
|
|
28
|
+
if (metadata) {
|
|
29
|
+
const {
|
|
30
|
+
error,
|
|
31
|
+
...rest
|
|
32
|
+
} = metadata;
|
|
33
|
+
|
|
34
|
+
if (error) {
|
|
35
|
+
captureException(error);
|
|
36
|
+
args.push(error);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (Object.keys(rest).length) {
|
|
40
|
+
args.push(JSON.stringify(rest, null, 2));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
console[level].apply(null, args);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function createLogger() {
|
|
49
|
+
return {
|
|
50
|
+
info: getLogFn('info'),
|
|
51
|
+
warn: getLogFn('warn'),
|
|
52
|
+
error: getLogFn('error')
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export default createLogger();
|
|
57
|
+
|
|
58
|
+
function setSentryTags(context) {
|
|
59
|
+
var _context$custom, _context$custom$proje, _context$user;
|
|
60
|
+
|
|
61
|
+
if ((_context$custom = context.custom) !== null && _context$custom !== void 0 && (_context$custom$proje = _context$custom.project) !== null && _context$custom$proje !== void 0 && _context$custom$proje.id) {
|
|
62
|
+
var _context$custom2, _context$custom2$proj;
|
|
63
|
+
|
|
64
|
+
setTag('projectId', (_context$custom2 = context.custom) === null || _context$custom2 === void 0 ? void 0 : (_context$custom2$proj = _context$custom2.project) === null || _context$custom2$proj === void 0 ? void 0 : _context$custom2$proj.id);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if ((_context$user = context.user) !== null && _context$user !== void 0 && _context$user.id) {
|
|
68
|
+
setUser({
|
|
69
|
+
id: context.user.id
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function loggerWithContext(fnContext) {
|
|
75
|
+
let context = fnContext;
|
|
76
|
+
setSentryTags(context);
|
|
77
|
+
|
|
78
|
+
const decorate = logFn => (message, metadata) => {
|
|
79
|
+
logFn(message, {
|
|
80
|
+
context,
|
|
81
|
+
...metadata
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
return {
|
|
86
|
+
info: decorate(getLogFn('info')),
|
|
87
|
+
warn: decorate(getLogFn('warn')),
|
|
88
|
+
error: decorate(getLogFn('error')),
|
|
89
|
+
|
|
90
|
+
updateContext(update) {
|
|
91
|
+
setSentryTags(update);
|
|
92
|
+
context = merge(context, update);
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
context
|
|
96
|
+
};
|
|
97
|
+
}
|
package/es/types.js
ADDED
|
File without changes
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,cAAc,EAAC,MAAM,UAAU,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _logger.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "loggerWithContext", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _logger.loggerWithContext;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "Logger", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _logger.Logger;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "TimberMetadata", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _logger.TimberMetadata;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
var _logger = _interopRequireWildcard(require("./logger"));
|
|
32
|
+
|
|
33
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
34
|
+
|
|
35
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
package/lib/logger.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TimberContext, TimberLogEntry } from './types';
|
|
2
|
+
export interface TimberMetadata extends Partial<TimberLogEntry> {
|
|
3
|
+
error?: Error;
|
|
4
|
+
}
|
|
5
|
+
export declare type LogFn = (message: string, metadata?: TimberMetadata) => void;
|
|
6
|
+
export interface Logger {
|
|
7
|
+
info: LogFn;
|
|
8
|
+
error: LogFn;
|
|
9
|
+
warn: LogFn;
|
|
10
|
+
updateContext: (context: TimberContext) => void;
|
|
11
|
+
context: TimberContext;
|
|
12
|
+
}
|
|
13
|
+
export declare function getLogFn(level: 'info' | 'warn' | 'error'): LogFn;
|
|
14
|
+
declare const _default: Record<string, LogFn>;
|
|
15
|
+
export default _default;
|
|
16
|
+
export declare function loggerWithContext(fnContext: TimberContext): Logger;
|
|
17
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,aAAa,EAAE,cAAc,EAAC,MAAM,SAAS,CAAC;AAGtD,MAAM,WAAW,cAAe,SAAQ,OAAO,CAAC,cAAc,CAAC;IAC7D,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AACD,oBAAY,KAAK,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;AAEzE,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,KAAK,CAAC;IACZ,aAAa,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IAChD,OAAO,EAAE,aAAa,CAAC;CACxB;AAKD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CA+BhE;;AAUD,wBAA8B;AAW9B,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,aAAa,GAAG,MAAM,CAkBlE"}
|
package/lib/logger.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getLogFn = getLogFn;
|
|
7
|
+
exports.loggerWithContext = loggerWithContext;
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _merge = _interopRequireDefault(require("lodash/merge"));
|
|
11
|
+
|
|
12
|
+
var _node = require("@sentry/node");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
17
|
+
const noop = () => {};
|
|
18
|
+
|
|
19
|
+
function getLogFn(level) {
|
|
20
|
+
if (process.env.NODE_ENV === 'test') {
|
|
21
|
+
return noop;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (process.env.IS_OFFLINE) {
|
|
25
|
+
const prettyjson = require('prettyjson'); // eslint-disable-line @typescript-eslint/no-var-requires
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
return (message, metadata) => {
|
|
29
|
+
console[level](message);
|
|
30
|
+
|
|
31
|
+
if (metadata) {
|
|
32
|
+
console[level](prettyjson.render(metadata), '\n');
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return (message, metadata) => {
|
|
38
|
+
const args = [message];
|
|
39
|
+
|
|
40
|
+
if (metadata) {
|
|
41
|
+
const {
|
|
42
|
+
error,
|
|
43
|
+
...rest
|
|
44
|
+
} = metadata;
|
|
45
|
+
|
|
46
|
+
if (error) {
|
|
47
|
+
(0, _node.captureException)(error);
|
|
48
|
+
args.push(error);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (Object.keys(rest).length) {
|
|
52
|
+
args.push(JSON.stringify(rest, null, 2));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
console[level].apply(null, args);
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function createLogger() {
|
|
61
|
+
return {
|
|
62
|
+
info: getLogFn('info'),
|
|
63
|
+
warn: getLogFn('warn'),
|
|
64
|
+
error: getLogFn('error')
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
var _default = createLogger();
|
|
69
|
+
|
|
70
|
+
exports.default = _default;
|
|
71
|
+
|
|
72
|
+
function setSentryTags(context) {
|
|
73
|
+
var _context$custom, _context$custom$proje, _context$user;
|
|
74
|
+
|
|
75
|
+
if ((_context$custom = context.custom) !== null && _context$custom !== void 0 && (_context$custom$proje = _context$custom.project) !== null && _context$custom$proje !== void 0 && _context$custom$proje.id) {
|
|
76
|
+
var _context$custom2, _context$custom2$proj;
|
|
77
|
+
|
|
78
|
+
(0, _node.setTag)('projectId', (_context$custom2 = context.custom) === null || _context$custom2 === void 0 ? void 0 : (_context$custom2$proj = _context$custom2.project) === null || _context$custom2$proj === void 0 ? void 0 : _context$custom2$proj.id);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if ((_context$user = context.user) !== null && _context$user !== void 0 && _context$user.id) {
|
|
82
|
+
(0, _node.setUser)({
|
|
83
|
+
id: context.user.id
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function loggerWithContext(fnContext) {
|
|
89
|
+
let context = fnContext;
|
|
90
|
+
setSentryTags(context);
|
|
91
|
+
|
|
92
|
+
const decorate = logFn => (message, metadata) => {
|
|
93
|
+
logFn(message, {
|
|
94
|
+
context,
|
|
95
|
+
...metadata
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
return {
|
|
100
|
+
info: decorate(getLogFn('info')),
|
|
101
|
+
warn: decorate(getLogFn('warn')),
|
|
102
|
+
error: decorate(getLogFn('error')),
|
|
103
|
+
|
|
104
|
+
updateContext(update) {
|
|
105
|
+
setSentryTags(update);
|
|
106
|
+
context = (0, _merge.default)(context, update);
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
context
|
|
110
|
+
};
|
|
111
|
+
}
|
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,624 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
3
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
4
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* The duration, in fractional milliseconds, that it took to complete this event.
|
|
8
|
+
*/
|
|
9
|
+
export declare type TimeMs = number;
|
|
10
|
+
/**
|
|
11
|
+
* The target host of the HTTP request. This may not be the same as the real hostname of the server.
|
|
12
|
+
*/
|
|
13
|
+
export declare type HttpHost = string;
|
|
14
|
+
/**
|
|
15
|
+
* The HTTP method for the request.
|
|
16
|
+
*/
|
|
17
|
+
export declare type HttpMethod = 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE';
|
|
18
|
+
/**
|
|
19
|
+
* The path of the HTTP request.
|
|
20
|
+
*/
|
|
21
|
+
export declare type HttpPath = string;
|
|
22
|
+
/**
|
|
23
|
+
* The IP address of the computer that issued the request.
|
|
24
|
+
*/
|
|
25
|
+
export declare type HttpRemoteAddr = string;
|
|
26
|
+
/**
|
|
27
|
+
* An ID that uniquely identifies the request and can be used to trace requests.
|
|
28
|
+
*/
|
|
29
|
+
export declare type HttpRequestId = string;
|
|
30
|
+
/**
|
|
31
|
+
* The body of the HTTP request / response.
|
|
32
|
+
*/
|
|
33
|
+
export declare type HttpBody = string;
|
|
34
|
+
/**
|
|
35
|
+
* The value of the Content-Length header representing the size of the request in decimal number of octets.
|
|
36
|
+
*/
|
|
37
|
+
export declare type HttpContentLength = number;
|
|
38
|
+
/**
|
|
39
|
+
* The direction of the HTTP request and response (incoming or outgoing).
|
|
40
|
+
*/
|
|
41
|
+
export declare type HttpDirection = 'incoming' | 'outgoing';
|
|
42
|
+
/**
|
|
43
|
+
* An encoded JSON string representing *all* HTTP headers. This is used for request inspection without the overhead of creating and indexing fields for every header.
|
|
44
|
+
*/
|
|
45
|
+
export declare type HttpHeadersJson = string;
|
|
46
|
+
/**
|
|
47
|
+
* The target port of the HTTP request. This may be different than the port the server is listening on.
|
|
48
|
+
*/
|
|
49
|
+
export declare type HttpPort = number;
|
|
50
|
+
/**
|
|
51
|
+
* The query parameters present on the URL.
|
|
52
|
+
*/
|
|
53
|
+
export declare type HttpQueryString = string;
|
|
54
|
+
/**
|
|
55
|
+
* The HTTP request scheme.
|
|
56
|
+
*/
|
|
57
|
+
export declare type HttpScheme = 'http' | 'https';
|
|
58
|
+
/**
|
|
59
|
+
* A short label / name for the service you are sending the request to, ex: elasticsearch
|
|
60
|
+
*/
|
|
61
|
+
export declare type HttpServiceName = string;
|
|
62
|
+
/**
|
|
63
|
+
* The status as defined by the HTTP status codes.
|
|
64
|
+
*/
|
|
65
|
+
export declare type HttpStatus = number;
|
|
66
|
+
export interface TimberErrorBacktrace {
|
|
67
|
+
/**
|
|
68
|
+
* Application name, if applicable. For example, erlang / elixir have multiple apps within the same umbrella project.
|
|
69
|
+
*/
|
|
70
|
+
app_name?: string;
|
|
71
|
+
/**
|
|
72
|
+
* The line file path.
|
|
73
|
+
*/
|
|
74
|
+
file: string;
|
|
75
|
+
/**
|
|
76
|
+
* The calling function name.
|
|
77
|
+
*/
|
|
78
|
+
function: string;
|
|
79
|
+
/**
|
|
80
|
+
* The calling line number.
|
|
81
|
+
*/
|
|
82
|
+
line: number;
|
|
83
|
+
}
|
|
84
|
+
export interface TimberError {
|
|
85
|
+
/**
|
|
86
|
+
* An optional array of lines, representing the call stack, leading up to the error.
|
|
87
|
+
*/
|
|
88
|
+
backtrace?: TimberErrorBacktrace[];
|
|
89
|
+
/**
|
|
90
|
+
* Optional message describing the error.
|
|
91
|
+
*/
|
|
92
|
+
message?: string;
|
|
93
|
+
/**
|
|
94
|
+
* A JSON encoded string representing additional metadata. This provides insight without the overhead of creating and indexing fields.
|
|
95
|
+
*/
|
|
96
|
+
metadata_json?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Required name of the error.
|
|
99
|
+
*/
|
|
100
|
+
name: string;
|
|
101
|
+
}
|
|
102
|
+
export interface TimberContext {
|
|
103
|
+
/**
|
|
104
|
+
* An open ended object where custom context is supplied.
|
|
105
|
+
*/
|
|
106
|
+
custom?: Record<string, Record<string, any>>;
|
|
107
|
+
/**
|
|
108
|
+
* Context about the HTTP request currently being processed (if any)
|
|
109
|
+
*/
|
|
110
|
+
http?: {
|
|
111
|
+
host?: HttpHost;
|
|
112
|
+
method: HttpMethod;
|
|
113
|
+
path?: HttpPath;
|
|
114
|
+
remote_addr?: HttpRemoteAddr;
|
|
115
|
+
request_id?: HttpRequestId;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Represents a task or job execution, typically for background tasks or jobs.
|
|
119
|
+
*/
|
|
120
|
+
job?: {
|
|
121
|
+
/**
|
|
122
|
+
* The attempt number, if applicable.
|
|
123
|
+
*/
|
|
124
|
+
attempt?: number;
|
|
125
|
+
/**
|
|
126
|
+
* A unique identifier for the job or task.
|
|
127
|
+
*/
|
|
128
|
+
id?: string;
|
|
129
|
+
/**
|
|
130
|
+
* The name of the queue being processes, if applicable.
|
|
131
|
+
*/
|
|
132
|
+
queue_name?: string;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Represents an organization in the platform being logged. The interpretation of "organization" is left to the consumer.
|
|
136
|
+
*/
|
|
137
|
+
organization?: {
|
|
138
|
+
/**
|
|
139
|
+
* A unique identifier for the organization
|
|
140
|
+
*/
|
|
141
|
+
id?: string;
|
|
142
|
+
/**
|
|
143
|
+
* A display name for the organization
|
|
144
|
+
*/
|
|
145
|
+
name?: string;
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Contextual information about the hosting platform (AWS, Google Cloud, Heroku, etc) the application is hosted.
|
|
149
|
+
*/
|
|
150
|
+
platform?: {
|
|
151
|
+
/**
|
|
152
|
+
* Contextual information for the Heroku platform.
|
|
153
|
+
*/
|
|
154
|
+
heroku?: {
|
|
155
|
+
/**
|
|
156
|
+
* The dyno type for the process (web, worker, router, etc)
|
|
157
|
+
*/
|
|
158
|
+
dyno_type: string;
|
|
159
|
+
/**
|
|
160
|
+
* The dyno ID for the process.
|
|
161
|
+
*/
|
|
162
|
+
dyno_id?: number;
|
|
163
|
+
/**
|
|
164
|
+
* The source of the log message. For example, Heroku can send log messages for the web.1 dyno from both within the app and Heroku itself.
|
|
165
|
+
*/
|
|
166
|
+
source: 'app' | 'heroku';
|
|
167
|
+
[k: string]: any;
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* Information about the Amazon EC2 instance
|
|
171
|
+
*/
|
|
172
|
+
aws_ec2?: {
|
|
173
|
+
/**
|
|
174
|
+
* Amazon Machine Image (AMI) identifier that the instance was launched from
|
|
175
|
+
*/
|
|
176
|
+
ami_id: string;
|
|
177
|
+
/**
|
|
178
|
+
* Hostname of the instance assigned by AWS. The operating system may report a different hostname based on configuration.
|
|
179
|
+
*/
|
|
180
|
+
hostname?: string;
|
|
181
|
+
/**
|
|
182
|
+
* The unique identifier for the EC2 instance
|
|
183
|
+
*/
|
|
184
|
+
instance_id: string;
|
|
185
|
+
/**
|
|
186
|
+
* The instance type of the EC2 image (for example, `t2.small`)
|
|
187
|
+
*/
|
|
188
|
+
instance_type: string;
|
|
189
|
+
/**
|
|
190
|
+
* Public hostname assigned by AWS to the EC2 instance. The operating system may report a different hostname based on configuration.
|
|
191
|
+
*/
|
|
192
|
+
public_hostname?: string;
|
|
193
|
+
[k: string]: any;
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* Contextual information about the Pod running on the Kubernetes platform
|
|
197
|
+
*/
|
|
198
|
+
kubernetes?: {
|
|
199
|
+
/**
|
|
200
|
+
* The unique identifier for the Docker container running inside the Kubernetes Pod
|
|
201
|
+
*/
|
|
202
|
+
container_name: string;
|
|
203
|
+
/**
|
|
204
|
+
* The collection of key value pairs found in the Kubernetes Pod metadata field Labels
|
|
205
|
+
*/
|
|
206
|
+
labels?: Record<string, any>;
|
|
207
|
+
/**
|
|
208
|
+
* The Kubernetes namespace in which the Pod is running
|
|
209
|
+
*/
|
|
210
|
+
namespace: string;
|
|
211
|
+
/**
|
|
212
|
+
* The name of the Kubernetes Pod in which the Docker container is running
|
|
213
|
+
*/
|
|
214
|
+
pod_name: string;
|
|
215
|
+
/**
|
|
216
|
+
* The Kubernetes Resource that is top level owner of the Pod as found through the ownerReferences metadata. This is primarily but not always a Contoller
|
|
217
|
+
*/
|
|
218
|
+
root_owner?: {
|
|
219
|
+
/**
|
|
220
|
+
* The kind or type of Kubernetes resource
|
|
221
|
+
*/
|
|
222
|
+
kind?: string;
|
|
223
|
+
/**
|
|
224
|
+
* The unique name of the Kubernetes resource
|
|
225
|
+
*/
|
|
226
|
+
name?: string;
|
|
227
|
+
[k: string]: any;
|
|
228
|
+
};
|
|
229
|
+
[k: string]: any;
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
/**
|
|
233
|
+
* Contextual information on the current release
|
|
234
|
+
*/
|
|
235
|
+
release?: {
|
|
236
|
+
/**
|
|
237
|
+
* The git commit sha for the deploy
|
|
238
|
+
*/
|
|
239
|
+
commit_hash?: string;
|
|
240
|
+
/**
|
|
241
|
+
* When the release was created, ISO8601 date time.
|
|
242
|
+
*/
|
|
243
|
+
created_at?: string;
|
|
244
|
+
/**
|
|
245
|
+
* Deploy version, can be an unique string. Ex: 1.1.2 or a43fdw
|
|
246
|
+
*/
|
|
247
|
+
version?: string;
|
|
248
|
+
};
|
|
249
|
+
/**
|
|
250
|
+
* Represents the language runtime details.
|
|
251
|
+
*/
|
|
252
|
+
runtime?: {
|
|
253
|
+
/**
|
|
254
|
+
* The current application name
|
|
255
|
+
*/
|
|
256
|
+
application?: string;
|
|
257
|
+
/**
|
|
258
|
+
* The current class name, if applicable.
|
|
259
|
+
*/
|
|
260
|
+
class_name?: string;
|
|
261
|
+
/**
|
|
262
|
+
* The current file path from the root of the project.
|
|
263
|
+
*/
|
|
264
|
+
file?: string;
|
|
265
|
+
/**
|
|
266
|
+
* The current function name, if applicable.
|
|
267
|
+
*/
|
|
268
|
+
function?: string;
|
|
269
|
+
/**
|
|
270
|
+
* The current line number with in the file.
|
|
271
|
+
*/
|
|
272
|
+
line?: number;
|
|
273
|
+
/**
|
|
274
|
+
* The current module name, if applicable.
|
|
275
|
+
*/
|
|
276
|
+
module_name?: string;
|
|
277
|
+
/**
|
|
278
|
+
* The logical process ID as defined by the current language, if applicable.
|
|
279
|
+
*/
|
|
280
|
+
vm_pid?: string;
|
|
281
|
+
};
|
|
282
|
+
/**
|
|
283
|
+
* The user's current session. A session is a way to track a user without the need for authentication. For example, a browser session is generally maintained through a cookie and assigned a unique ID.
|
|
284
|
+
*/
|
|
285
|
+
session?: {
|
|
286
|
+
/**
|
|
287
|
+
* The unique ID of this session.
|
|
288
|
+
*/
|
|
289
|
+
id?: string;
|
|
290
|
+
};
|
|
291
|
+
/**
|
|
292
|
+
* Context about the source of the log
|
|
293
|
+
*/
|
|
294
|
+
source?: {
|
|
295
|
+
/**
|
|
296
|
+
* The name of the file the log was read from (e.g., "nodejs.log")
|
|
297
|
+
*/
|
|
298
|
+
file_name?: string;
|
|
299
|
+
};
|
|
300
|
+
/**
|
|
301
|
+
* Host and system level details tha the log was generated on.
|
|
302
|
+
*/
|
|
303
|
+
system?: {
|
|
304
|
+
/**
|
|
305
|
+
* The system's hostname.
|
|
306
|
+
*/
|
|
307
|
+
hostname?: string;
|
|
308
|
+
/**
|
|
309
|
+
* The system's IP address (v4 or v6).
|
|
310
|
+
*/
|
|
311
|
+
ip?: string;
|
|
312
|
+
/**
|
|
313
|
+
* The originating process ID as defined by the `pid` command in Unix.
|
|
314
|
+
*/
|
|
315
|
+
pid?: number;
|
|
316
|
+
/**
|
|
317
|
+
* The originating process name.
|
|
318
|
+
*/
|
|
319
|
+
process_name?: string;
|
|
320
|
+
};
|
|
321
|
+
/**
|
|
322
|
+
* Represents a user in the platform being logged. The interpretation of "user" is left to the consumer.
|
|
323
|
+
*/
|
|
324
|
+
user?: {
|
|
325
|
+
/**
|
|
326
|
+
* An email address for the user. This need not be unique to the user. Note that no validation is performed on this field.
|
|
327
|
+
*/
|
|
328
|
+
email?: string;
|
|
329
|
+
/**
|
|
330
|
+
* A unique identifier for the user.
|
|
331
|
+
*/
|
|
332
|
+
id?: string;
|
|
333
|
+
/**
|
|
334
|
+
* Additional custom metadata you'd like to add to the user.
|
|
335
|
+
*/
|
|
336
|
+
meta?: Record<string, any>;
|
|
337
|
+
/**
|
|
338
|
+
* A display name for the user.
|
|
339
|
+
*/
|
|
340
|
+
name?: string;
|
|
341
|
+
/**
|
|
342
|
+
* The type of user. Used in systems where there are multiple user types. This helps to denote users in the case of polymorphism.
|
|
343
|
+
*/
|
|
344
|
+
type?: string;
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
export interface TimberEvent {
|
|
348
|
+
/**
|
|
349
|
+
* Represents the joining of a multi-plexed websocket channel.
|
|
350
|
+
*/
|
|
351
|
+
channel_join?: {
|
|
352
|
+
/**
|
|
353
|
+
* The name of the channel being joined.
|
|
354
|
+
*/
|
|
355
|
+
channel: string;
|
|
356
|
+
/**
|
|
357
|
+
* The name of the channel topic being joined.
|
|
358
|
+
*/
|
|
359
|
+
topic: string;
|
|
360
|
+
/**
|
|
361
|
+
* A JSON encoded string representing additional metadata. This provides insight without the overhead of creating and indexing fields.
|
|
362
|
+
*/
|
|
363
|
+
metadata_json?: string;
|
|
364
|
+
};
|
|
365
|
+
/**
|
|
366
|
+
* Represents the receiption of an event on a multi-plexed websocket channel.
|
|
367
|
+
*/
|
|
368
|
+
channel_receive?: {
|
|
369
|
+
/**
|
|
370
|
+
* The name of the channel being joined.
|
|
371
|
+
*/
|
|
372
|
+
channel: string;
|
|
373
|
+
/**
|
|
374
|
+
* The name of the channel topic being joined.
|
|
375
|
+
*/
|
|
376
|
+
topic: string;
|
|
377
|
+
/**
|
|
378
|
+
* The name of the event being received.
|
|
379
|
+
*/
|
|
380
|
+
event: string;
|
|
381
|
+
/**
|
|
382
|
+
* A JSON encoded string representing additional metadata. This provides insight without the overhead of creating and indexing fields.
|
|
383
|
+
*/
|
|
384
|
+
metadata_json?: string;
|
|
385
|
+
};
|
|
386
|
+
/**
|
|
387
|
+
* Represents the calling of a controller, typically logged immediately after the request is routed.
|
|
388
|
+
*/
|
|
389
|
+
controller_call?: {
|
|
390
|
+
/**
|
|
391
|
+
* The name of the controller being called.
|
|
392
|
+
*/
|
|
393
|
+
controller: string;
|
|
394
|
+
/**
|
|
395
|
+
* The name of the controller action being called.
|
|
396
|
+
*/
|
|
397
|
+
action: string;
|
|
398
|
+
/**
|
|
399
|
+
* An encoded JSON string representing the parsed parameters being sent to the controller. This provides additional insight without the overhead of creating and indexing fields for every paramter.
|
|
400
|
+
*/
|
|
401
|
+
params_json?: string;
|
|
402
|
+
};
|
|
403
|
+
/**
|
|
404
|
+
* An open ended object used for custom event data. Only a single root key is allowed, this represents the event type and avoids type collisions in the context of the entire schema.
|
|
405
|
+
*/
|
|
406
|
+
custom?: Record<string, Record<string, any>>;
|
|
407
|
+
/**
|
|
408
|
+
* Represents an error or exception.
|
|
409
|
+
*/
|
|
410
|
+
error?: TimberError;
|
|
411
|
+
/**
|
|
412
|
+
* Represents a HTTP request, both incoming and outgoing. Note the direction field.
|
|
413
|
+
*/
|
|
414
|
+
http_request?: {
|
|
415
|
+
body?: HttpBody;
|
|
416
|
+
content_length?: HttpContentLength;
|
|
417
|
+
direction?: HttpDirection;
|
|
418
|
+
headers?: HttpHeaders;
|
|
419
|
+
headers_json?: HttpHeadersJson;
|
|
420
|
+
host?: HttpHost;
|
|
421
|
+
method: HttpMethod;
|
|
422
|
+
path?: HttpPath;
|
|
423
|
+
port?: HttpPort;
|
|
424
|
+
query_string?: HttpQueryString;
|
|
425
|
+
request_id?: HttpRequestId;
|
|
426
|
+
scheme?: HttpScheme;
|
|
427
|
+
service_name?: HttpServiceName;
|
|
428
|
+
};
|
|
429
|
+
/**
|
|
430
|
+
* Represents a HTTP response event, both outgoing and incoming. Note the direction field.
|
|
431
|
+
*/
|
|
432
|
+
http_response?: {
|
|
433
|
+
body?: HttpBody;
|
|
434
|
+
content_length?: HttpContentLength;
|
|
435
|
+
direction?: HttpDirection;
|
|
436
|
+
headers?: HttpHeaders;
|
|
437
|
+
headers_json?: HttpHeadersJson;
|
|
438
|
+
request_id?: HttpRequestId;
|
|
439
|
+
service_name?: HttpServiceName;
|
|
440
|
+
status: HttpStatus;
|
|
441
|
+
time_ms?: TimeMs;
|
|
442
|
+
/**
|
|
443
|
+
* The request being responded to. This couples the request data with the response event avoiding the need for joins or external data dependencies. In many cases the data must be coupled with this event because it is represented as a single event (nginx, apache web server, and other reverse proxy servers).
|
|
444
|
+
*/
|
|
445
|
+
request?: {
|
|
446
|
+
host?: HttpHost;
|
|
447
|
+
method?: HttpMethod;
|
|
448
|
+
path?: HttpPath;
|
|
449
|
+
scheme?: HttpScheme;
|
|
450
|
+
[k: string]: any;
|
|
451
|
+
};
|
|
452
|
+
};
|
|
453
|
+
/**
|
|
454
|
+
* Represents a resource usage sample for a target server, application, or both.
|
|
455
|
+
*/
|
|
456
|
+
resource_sample?: {
|
|
457
|
+
/**
|
|
458
|
+
* A sample of the current server processor usage.
|
|
459
|
+
*/
|
|
460
|
+
cpu?: {
|
|
461
|
+
/**
|
|
462
|
+
* The load average for the processor in the last 1 minute. This reflects the number of CPU tasks that are in the ready queue (i.e. waiting to be processed).
|
|
463
|
+
*/
|
|
464
|
+
load_avg_1m: number;
|
|
465
|
+
/**
|
|
466
|
+
* The load average for the processor in the last 5 minutes. This reflects the number of CPU tasks that are in the ready queue (i.e. waiting to be processed).
|
|
467
|
+
*/
|
|
468
|
+
load_avg_5m?: number;
|
|
469
|
+
/**
|
|
470
|
+
* The load average for the processor in the last 10 minutes. This reflects the number of CPU tasks that are in the ready queue (i.e. waiting to be processed).
|
|
471
|
+
*/
|
|
472
|
+
load_avg_15m?: number;
|
|
473
|
+
};
|
|
474
|
+
/**
|
|
475
|
+
* A sample of cache statistics and state.
|
|
476
|
+
*/
|
|
477
|
+
cache?: {
|
|
478
|
+
/**
|
|
479
|
+
* The number of active connections established with the database.
|
|
480
|
+
*/
|
|
481
|
+
active_connections?: number;
|
|
482
|
+
/**
|
|
483
|
+
* The ratio of successful reads out of all read operations.
|
|
484
|
+
*/
|
|
485
|
+
index_cache_hit_rate?: number;
|
|
486
|
+
/**
|
|
487
|
+
* The number of evicted keys.
|
|
488
|
+
*/
|
|
489
|
+
evicted_keys?: number;
|
|
490
|
+
};
|
|
491
|
+
/**
|
|
492
|
+
* A sample of database statistics and state.
|
|
493
|
+
*/
|
|
494
|
+
database?: {
|
|
495
|
+
/**
|
|
496
|
+
* The number of bytes contained in the database. This includes all table and index data on disk, including database bloat.
|
|
497
|
+
*/
|
|
498
|
+
db_size?: number;
|
|
499
|
+
/**
|
|
500
|
+
* The number of tables in the database
|
|
501
|
+
*/
|
|
502
|
+
tables?: number;
|
|
503
|
+
/**
|
|
504
|
+
* The number of active connections established with the database.
|
|
505
|
+
*/
|
|
506
|
+
active_connections?: number;
|
|
507
|
+
/**
|
|
508
|
+
* The current transaction ID, which can be used to track writes over time.
|
|
509
|
+
*/
|
|
510
|
+
current_transaction?: string;
|
|
511
|
+
/**
|
|
512
|
+
* Ratio of queries that used an index (instead of only sequential scans), rounded to five decimal points.
|
|
513
|
+
*/
|
|
514
|
+
index_cache_hit_rate?: number;
|
|
515
|
+
/**
|
|
516
|
+
* Ratio of table lookups served from shared buffer cache, rounded to five decimal points.
|
|
517
|
+
*/
|
|
518
|
+
table_cache_hit_rate?: number;
|
|
519
|
+
/**
|
|
520
|
+
* Number of connections waiting on a lock to be acquired.
|
|
521
|
+
*/
|
|
522
|
+
waiting_connections?: number;
|
|
523
|
+
};
|
|
524
|
+
/**
|
|
525
|
+
* A sample of a server's disk usage.
|
|
526
|
+
*/
|
|
527
|
+
disk?: {
|
|
528
|
+
/**
|
|
529
|
+
* Number of read operations in I/O sizes of 16KB blocks.
|
|
530
|
+
*/
|
|
531
|
+
read_iops: number;
|
|
532
|
+
/**
|
|
533
|
+
* Number of write operations in I/O sizes of 16KB blocks.
|
|
534
|
+
*/
|
|
535
|
+
write_iops: number;
|
|
536
|
+
};
|
|
537
|
+
/**
|
|
538
|
+
* A sample of a server's memory usage.
|
|
539
|
+
*/
|
|
540
|
+
memory?: {
|
|
541
|
+
/**
|
|
542
|
+
* The portion of the memory used for disk cache.
|
|
543
|
+
*/
|
|
544
|
+
cache_mb?: number;
|
|
545
|
+
/**
|
|
546
|
+
* The amount of free memory availabe in megabytes.
|
|
547
|
+
*/
|
|
548
|
+
free_mb?: number;
|
|
549
|
+
/**
|
|
550
|
+
* The cumulative total of the pages read from disk. Sudden high variations on this number can indicate short duration spikes in swap usage. The other memory related metrics are point in time snapshots and can miss short spikes.
|
|
551
|
+
*/
|
|
552
|
+
pgpgin?: number;
|
|
553
|
+
/**
|
|
554
|
+
* The cumulative total of the pages written to disk. Sudden high variations on this number can indicate short duration spikes in swap usage. The other memory related metrics are point in time snapshots and can miss short spikes.
|
|
555
|
+
*/
|
|
556
|
+
pgpgout?: number;
|
|
557
|
+
/**
|
|
558
|
+
* The portion of the memory being used by the target application oin megabytes.
|
|
559
|
+
*/
|
|
560
|
+
rss_mb?: number;
|
|
561
|
+
/**
|
|
562
|
+
* The portion of the memory stored on disk. Swap usually indicates a shortage of memory in megabytes.
|
|
563
|
+
*/
|
|
564
|
+
swap_mb?: number;
|
|
565
|
+
/**
|
|
566
|
+
* The sum of the rss, cache, and swap that equals the total memory being used in megabytes.
|
|
567
|
+
*/
|
|
568
|
+
total_mb: number;
|
|
569
|
+
};
|
|
570
|
+
[k: string]: any;
|
|
571
|
+
};
|
|
572
|
+
/**
|
|
573
|
+
* An outgoing SQL query sent from the application.
|
|
574
|
+
*/
|
|
575
|
+
sql_query?: {
|
|
576
|
+
/**
|
|
577
|
+
* The actual SQL statement sent.
|
|
578
|
+
*/
|
|
579
|
+
sql: string;
|
|
580
|
+
time_ms: TimeMs;
|
|
581
|
+
};
|
|
582
|
+
/**
|
|
583
|
+
* Rendering a template to be sent to the client via the HTTP response.
|
|
584
|
+
*/
|
|
585
|
+
template_render?: {
|
|
586
|
+
/**
|
|
587
|
+
* The unique name of the template. This generally includes the path.
|
|
588
|
+
*/
|
|
589
|
+
name: string;
|
|
590
|
+
time_ms: TimeMs;
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
export interface TimberLogEntry {
|
|
594
|
+
/**
|
|
595
|
+
* The IOS8601 formatted datetime when the log was generated.
|
|
596
|
+
*/
|
|
597
|
+
dt: string;
|
|
598
|
+
/**
|
|
599
|
+
* The descriptive level of the log in string format. The available options adhere to the Syslog 5424 specification.
|
|
600
|
+
*/
|
|
601
|
+
level?: 'debug' | 'info' | 'notice' | 'warn' | 'error' | 'critical' | 'alert' | 'emergency';
|
|
602
|
+
/**
|
|
603
|
+
* The numerical severity of the message represented by an integer between 0 and 7. The available options adhere to the Syslog 5424 specification.
|
|
604
|
+
*/
|
|
605
|
+
severity?: number;
|
|
606
|
+
/**
|
|
607
|
+
* The raw log event message, formatting stripped.
|
|
608
|
+
*/
|
|
609
|
+
message: string;
|
|
610
|
+
time_ms?: TimeMs;
|
|
611
|
+
/**
|
|
612
|
+
* Contextual metadata about the environment the event takes place in
|
|
613
|
+
*/
|
|
614
|
+
context?: TimberContext;
|
|
615
|
+
/**
|
|
616
|
+
* A controlled representation of the event this log line represents.
|
|
617
|
+
*/
|
|
618
|
+
event?: TimberEvent;
|
|
619
|
+
}
|
|
620
|
+
/**
|
|
621
|
+
* An object representing *select* HTTP headers that need to be searched or graphed.
|
|
622
|
+
*/
|
|
623
|
+
export declare type HttpHeaders = Record<string, any>;
|
|
624
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AACA;;;;GAIG;AAEH;;GAEG;AACH,oBAAY,MAAM,GAAG,MAAM,CAAC;AAC5B;;GAEG;AACH,oBAAY,QAAQ,GAAG,MAAM,CAAC;AAC9B;;GAEG;AACH,oBAAY,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,CAAC;AAChH;;GAEG;AACH,oBAAY,QAAQ,GAAG,MAAM,CAAC;AAC9B;;GAEG;AACH,oBAAY,cAAc,GAAG,MAAM,CAAC;AACpC;;GAEG;AACH,oBAAY,aAAa,GAAG,MAAM,CAAC;AACnC;;GAEG;AACH,oBAAY,QAAQ,GAAG,MAAM,CAAC;AAC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;QAChB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,GAAG,WAAW,CAAC;IAC5F;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB;AACD;;GAEG;AACH,oBAAY,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC"}
|
package/lib/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@takeshape/logger",
|
|
3
|
+
"version": "7.90.0",
|
|
4
|
+
"description": "Logging utility.",
|
|
5
|
+
"homepage": "https://www.takeshape.io",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "github.com:takeshape/takeshape.git"
|
|
9
|
+
},
|
|
10
|
+
"author": "asprouse",
|
|
11
|
+
"license": "UNLICENSED",
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=12"
|
|
14
|
+
},
|
|
15
|
+
"main": "lib/index.js",
|
|
16
|
+
"module": "es/index.js",
|
|
17
|
+
"types": "lib/index.d.ts",
|
|
18
|
+
"files": [
|
|
19
|
+
"lib",
|
|
20
|
+
"es"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"lint": "eslint . --ext .js,.ts",
|
|
24
|
+
"lint:code:ci": "eslint . --ext .js,.ts --format junit -o \"${HOME}/test-results/${npm_package_name#*\\/}/eslint-results.xml\"",
|
|
25
|
+
"test": "jest",
|
|
26
|
+
"test-changed": "pnpm run test -- --changedSince=master",
|
|
27
|
+
"test:ci": "JEST_JUNIT_OUTPUT_DIR=\"${HOME}/test-results/${npm_package_name#*\\/}\" JEST_JUNIT_OUTPUT_NAME=jest-results.xml jest --ci --reporters=default --reporters=jest-junit",
|
|
28
|
+
"typecheck": "tsc --noEmit",
|
|
29
|
+
"clean": "rimraf lib es build *.tsbuildinfo",
|
|
30
|
+
"prepublishOnly": "pnpm lint && pnpm test && pnpm clean && pnpm build",
|
|
31
|
+
"build": "pnpm clean && pnpm build:types && pnpm build:js && pnpm build:es && pnpm build:copy",
|
|
32
|
+
"build:types": "tsc --emitDeclarationOnly --project tsconfig.build.json",
|
|
33
|
+
"build:js": "cross-env BABEL_MODULES=commonjs babel src --out-dir lib --extensions \".js,.ts\" --ignore '**/__tests__'",
|
|
34
|
+
"build:es": "cross-env BABEL_MODULES=es babel src --out-dir es --extensions \".js,.ts\" --ignore '**/__tests__'",
|
|
35
|
+
"build:copy": "cp -rf build/src/* lib/",
|
|
36
|
+
"will-it-blend": "pnpm typecheck && pnpm lint -- --quiet && pnpm test -- --silent --coverage false"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@sentry/node": "^5.27.2",
|
|
40
|
+
"lodash": "^4.17.20",
|
|
41
|
+
"prettyjson": "^1.2.1"
|
|
42
|
+
}
|
|
43
|
+
}
|