@creator.co/wapi 1.6.0 → 2.0.0-alpha.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.
- package/.github/workflows/npmpublish.yml +1 -1
- package/.github/workflows/prs.yml +1 -1
- package/dist/index.js +45 -31
- package/dist/index.js.map +1 -1
- package/dist/jest.config.js +2 -4
- package/dist/jest.config.js.map +1 -1
- package/dist/package.json +12 -12
- package/dist/src/API/Request.js +53 -59
- package/dist/src/API/Request.js.map +1 -1
- package/dist/src/API/Response.js +81 -156
- package/dist/src/API/Response.js.map +1 -1
- package/dist/src/BaseEvent/EventProcessor.js +54 -132
- package/dist/src/BaseEvent/EventProcessor.js.map +1 -1
- package/dist/src/BaseEvent/Process.js +40 -98
- package/dist/src/BaseEvent/Process.js.map +1 -1
- package/dist/src/BaseEvent/Transaction.js +122 -310
- package/dist/src/BaseEvent/Transaction.js.map +1 -1
- package/dist/src/Cache/Redis.js +55 -119
- package/dist/src/Cache/Redis.js.map +1 -1
- package/dist/src/Cache/types.js +1 -2
- package/dist/src/Config/Configuration.js +46 -86
- package/dist/src/Config/Configuration.js.map +1 -1
- package/dist/src/Config/EnvironmentVar.js +57 -119
- package/dist/src/Config/EnvironmentVar.js.map +1 -1
- package/dist/src/Crypto/Crypto.js +35 -82
- package/dist/src/Crypto/Crypto.js.map +1 -1
- package/dist/src/Crypto/JWT.js +12 -27
- package/dist/src/Crypto/JWT.js.map +1 -1
- package/dist/src/Database/Database.js +3 -8
- package/dist/src/Database/Database.js.map +1 -1
- package/dist/src/Database/DatabaseManager.js +23 -28
- package/dist/src/Database/DatabaseManager.js.map +1 -1
- package/dist/src/Database/DatabaseTransaction.js +50 -166
- package/dist/src/Database/DatabaseTransaction.js.map +1 -1
- package/dist/src/Database/index.js +11 -15
- package/dist/src/Database/index.js.map +1 -1
- package/dist/src/Database/integrations/knex/KnexDatabase.js +22 -76
- package/dist/src/Database/integrations/knex/KnexDatabase.js.map +1 -1
- package/dist/src/Database/integrations/knex/KnexTransaction.js +19 -85
- package/dist/src/Database/integrations/knex/KnexTransaction.js.map +1 -1
- package/dist/src/Database/integrations/kysely/KyselyDatabase.js +37 -88
- package/dist/src/Database/integrations/kysely/KyselyDatabase.js.map +1 -1
- package/dist/src/Database/integrations/kysely/KyselyTransaction.js +46 -114
- package/dist/src/Database/integrations/kysely/KyselyTransaction.js.map +1 -1
- package/dist/src/Database/integrations/pgsql/PostgresDatabase.js +20 -71
- package/dist/src/Database/integrations/pgsql/PostgresDatabase.js.map +1 -1
- package/dist/src/Database/integrations/pgsql/PostgresTransaction.js +19 -85
- package/dist/src/Database/integrations/pgsql/PostgresTransaction.js.map +1 -1
- package/dist/src/Database/types.js +1 -2
- package/dist/src/Globals.js +93 -98
- package/dist/src/Globals.js.map +1 -1
- package/dist/src/Logger/Logger.js +88 -222
- package/dist/src/Logger/Logger.js.map +1 -1
- package/dist/src/Mailer/Mailer.js +83 -204
- package/dist/src/Mailer/Mailer.js.map +1 -1
- package/dist/src/Publisher/Publisher.js +43 -107
- package/dist/src/Publisher/Publisher.js.map +1 -1
- package/dist/src/Server/RouteResolver.js +22 -49
- package/dist/src/Server/RouteResolver.js.map +1 -1
- package/dist/src/Server/Router.js +12 -16
- package/dist/src/Server/Router.js.map +1 -1
- package/dist/src/Server/lib/ContainerServer.js +21 -83
- package/dist/src/Server/lib/ContainerServer.js.map +1 -1
- package/dist/src/Server/lib/Server.js +50 -99
- package/dist/src/Server/lib/Server.js.map +1 -1
- package/dist/src/Server/lib/container/GenericHandler.js +32 -107
- package/dist/src/Server/lib/container/GenericHandler.js.map +1 -1
- package/dist/src/Server/lib/container/GenericHandlerEvent.js +37 -81
- package/dist/src/Server/lib/container/GenericHandlerEvent.js.map +1 -1
- package/dist/src/Server/lib/container/HealthHandler.js +3 -35
- package/dist/src/Server/lib/container/HealthHandler.js.map +1 -1
- package/dist/src/Server/lib/container/Proxy.js +64 -127
- package/dist/src/Server/lib/container/Proxy.js.map +1 -1
- package/dist/src/Server/lib/container/Utils.js +12 -55
- package/dist/src/Server/lib/container/Utils.js.map +1 -1
- package/dist/src/Util/AsyncSingleton.js +40 -164
- package/dist/src/Util/AsyncSingleton.js.map +1 -1
- package/dist/src/Util/Utils.js +18 -24
- package/dist/src/Util/Utils.js.map +1 -1
- package/dist/src/Validation/Validator.js +10 -16
- package/dist/src/Validation/Validator.js.map +1 -1
- package/package.json +12 -12
- package/src/Logger/Logger.ts +2 -2
- package/tests/Logger/Logger.test.ts +6 -4
- package/tsconfig.json +3 -1
package/dist/src/Util/Utils.js
CHANGED
|
@@ -1,43 +1,39 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
/**
|
|
4
2
|
* Utility class containing various static methods for common operations.
|
|
5
3
|
*/
|
|
6
|
-
|
|
7
|
-
function Utils() {
|
|
8
|
-
}
|
|
4
|
+
export default class Utils {
|
|
9
5
|
/**
|
|
10
6
|
* Checks if the application is running in a hybridless container.
|
|
11
7
|
* @returns {boolean} - True if the application is running in a hybridless container, false otherwise.
|
|
12
8
|
*/
|
|
13
|
-
|
|
9
|
+
static isHybridlessContainer() {
|
|
14
10
|
return process.env.HYBRIDLESS_RUNTIME == 'true';
|
|
15
|
-
}
|
|
11
|
+
}
|
|
16
12
|
/**
|
|
17
13
|
* Checks if a given string is valid.
|
|
18
14
|
* @param {string} string - The string to check.
|
|
19
15
|
* @returns {boolean} - True if the string is valid, false otherwise.
|
|
20
16
|
*/
|
|
21
|
-
|
|
17
|
+
static isValidString(string) {
|
|
22
18
|
return (string === null || string === void 0 ? void 0 : string.length) > 0 && !Array.isArray(string);
|
|
23
|
-
}
|
|
19
|
+
}
|
|
24
20
|
/**
|
|
25
21
|
* Parses a string into an integer and returns null if the string is not a valid number.
|
|
26
22
|
* @param {string} str - The string to parse into an integer.
|
|
27
23
|
* @returns {number | null} - The parsed integer or null if the string is not a valid number.
|
|
28
24
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
static parseIntNullIfNaN(str) {
|
|
26
|
+
const n = parseInt(str || '');
|
|
31
27
|
return isNaN(n) ? null : n;
|
|
32
|
-
}
|
|
28
|
+
}
|
|
33
29
|
/**
|
|
34
30
|
* Parses a JSON string and returns the resulting object. If the string is empty or
|
|
35
31
|
* cannot be parsed, null is returned.
|
|
36
32
|
* @param {string} string - The JSON string to parse.
|
|
37
33
|
* @returns {any | null} - The parsed object or null if the string is empty or invalid.
|
|
38
34
|
*/
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
static parseObjectNullIfEmpty(string) {
|
|
36
|
+
let o = null;
|
|
41
37
|
try {
|
|
42
38
|
o = string ? JSON.parse(string) : null;
|
|
43
39
|
if (o && Object.keys(o).length <= 0)
|
|
@@ -47,14 +43,14 @@ var Utils = /** @class */ (function () {
|
|
|
47
43
|
/* empty */
|
|
48
44
|
}
|
|
49
45
|
return o;
|
|
50
|
-
}
|
|
46
|
+
}
|
|
51
47
|
/**
|
|
52
48
|
* Checks if a given value is a valid number.
|
|
53
49
|
* @param {string} number - The value to be checked.
|
|
54
50
|
* @returns {boolean} - True if the value is a valid number, false otherwise.
|
|
55
51
|
*/
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
static isValidNumber(number) {
|
|
53
|
+
let validNumb = NaN;
|
|
58
54
|
try {
|
|
59
55
|
validNumb = parseInt(number + '');
|
|
60
56
|
}
|
|
@@ -62,22 +58,20 @@ var Utils = /** @class */ (function () {
|
|
|
62
58
|
console.error('Error while validating number', e);
|
|
63
59
|
}
|
|
64
60
|
return !isNaN(validNumb) && !Array.isArray(number);
|
|
65
|
-
}
|
|
61
|
+
}
|
|
66
62
|
/**
|
|
67
63
|
* Retrieves the value from an object using a case-insensitive key lookup.
|
|
68
64
|
* @param {any} obj - The object to search for the key.
|
|
69
65
|
* @param {string} key - The key to search for in the object.
|
|
70
66
|
* @returns {any | null} The value associated with the key, or null if the key is not found.
|
|
71
67
|
*/
|
|
72
|
-
|
|
68
|
+
static caseInsensitiveObjectForKey(obj, key) {
|
|
73
69
|
if (!obj)
|
|
74
70
|
return null;
|
|
75
|
-
|
|
71
|
+
const insensitiveKey = Object.keys(obj).find(k => k.toLowerCase() === key.toLowerCase());
|
|
76
72
|
if (insensitiveKey && insensitiveKey != '')
|
|
77
73
|
return obj[insensitiveKey];
|
|
78
74
|
return null;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
}());
|
|
82
|
-
exports.default = Utils;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
83
77
|
//# sourceMappingURL=Utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../src/Util/Utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../src/Util/Utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,KAAK;IACxB;;;OAGG;IACI,MAAM,CAAC,qBAAqB;QACjC,OAAO,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,MAAM,CAAA;IACjD,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,aAAa,CAAC,MAAc;QACxC,OAAO,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,IAAG,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IACrD,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,iBAAiB,CAAC,GAAY;QAC1C,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,IAAI,EAAE,CAAC,CAAA;QAC7B,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;IAC5B,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,sBAAsB,CAAC,MAA0B;QAC7D,IAAI,CAAC,GAAG,IAAI,CAAA;QACZ,IAAI,CAAC;YACH,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;YACtC,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC;gBAAE,CAAC,GAAG,IAAI,CAAA;QAC/C,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,WAAW;QACb,CAAC;QACD,OAAO,CAAC,CAAA;IACV,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,aAAa,CAAC,MAAc;QACxC,IAAI,SAAS,GAAG,GAAG,CAAA;QACnB,IAAI,CAAC;YACH,SAAS,GAAG,QAAQ,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;QACnC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,+BAA+B,EAAE,CAAC,CAAC,CAAA;QACnD,CAAC;QACD,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IACpD,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,2BAA2B,CAAC,GAAQ,EAAE,GAAW;QAC7D,IAAI,CAAC,GAAG;YAAE,OAAO,IAAI,CAAA;QACrB,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,WAAW,EAAE,CAAC,CAAA;QACxF,IAAI,cAAc,IAAI,cAAc,IAAI,EAAE;YAAE,OAAO,GAAG,CAAC,cAAc,CAAC,CAAA;QACtE,OAAO,IAAI,CAAA;IACb,CAAC;CACF"}
|
|
@@ -1,44 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var Response_1 = require("../API/Response");
|
|
5
|
-
var Globals_1 = require("../Globals");
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import Response from '../API/Response';
|
|
3
|
+
import Globals from '../Globals';
|
|
6
4
|
/**
|
|
7
5
|
* Validates the given data against the provided schema.
|
|
8
6
|
* @param {any} data - The data to be validated.
|
|
9
7
|
* @param {z.ZodObject<any>} schema - The schema to validate against.
|
|
10
8
|
* @returns {boolean | Response<ResponseErrorType>} - Returns true if the data is valid, otherwise returns a response object with an error message.
|
|
11
9
|
*/
|
|
12
|
-
|
|
13
|
-
function Validator() {
|
|
14
|
-
}
|
|
10
|
+
export default class Validator {
|
|
15
11
|
/**
|
|
16
12
|
* Validates the given data against the provided schema.
|
|
17
13
|
* @param {any} data - The data to be validated.
|
|
18
14
|
* @param {z.ZodObject<any> | z.ZodUnion<any>} schema - The schema to validate against.
|
|
19
15
|
* @returns {boolean | Response<ResponseErrorType>} - Returns either true if the data is valid or a Response object with an error message if validation fails.
|
|
20
16
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
static validateSchema(data, schema) {
|
|
18
|
+
let error, validatedInput;
|
|
23
19
|
// Validate body against known zod schema
|
|
24
20
|
try {
|
|
25
21
|
validatedInput = schema.parse(data);
|
|
26
22
|
}
|
|
27
23
|
catch (err) {
|
|
28
|
-
if (err instanceof
|
|
24
|
+
if (err instanceof z.ZodError)
|
|
29
25
|
error = JSON.parse(err.message);
|
|
30
26
|
else
|
|
31
27
|
error = 'Unknown validation error!'; //unhandled case, hard to test
|
|
32
28
|
}
|
|
33
29
|
// Error validation
|
|
34
30
|
if (!validatedInput || error) {
|
|
35
|
-
return
|
|
31
|
+
return Response.BadRequestResponse(Globals.ErrorResponseValidationFail, Globals.ErrorCode_InvalidInput, { validationFailure: error });
|
|
36
32
|
}
|
|
37
33
|
else {
|
|
38
34
|
return true;
|
|
39
35
|
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
}());
|
|
43
|
-
exports.default = Validator;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
44
38
|
//# sourceMappingURL=Validator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Validator.js","sourceRoot":"","sources":["../../../src/Validation/Validator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Validator.js","sourceRoot":"","sources":["../../../src/Validation/Validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,QAA+B,MAAM,iBAAiB,CAAA;AAC7D,OAAO,OAAO,MAAM,YAAY,CAAA;AAEhC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B;;;;;OAKG;IACI,MAAM,CAAC,cAAc,CAC1B,IAAS,EACT,MAAwE;QAExE,IAAI,KAAK,EAAE,cAAc,CAAA;QAEzB,yCAAyC;QACzC,IAAI,CAAC;YACH,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAkB,CAAA;QACtD,CAAC;QAAC,OAAO,GAAqB,EAAE,CAAC;YAC/B,IAAI,GAAG,YAAY,CAAC,CAAC,QAAQ;gBAAE,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;;gBACzD,KAAK,GAAG,2BAA2B,CAAA,CAAC,8BAA8B;QACzE,CAAC;QAED,mBAAmB;QACnB,IAAI,CAAC,cAAc,IAAI,KAAK,EAAE,CAAC;YAC7B,OAAO,QAAQ,CAAC,kBAAkB,CAChC,OAAO,CAAC,2BAA2B,EACnC,OAAO,CAAC,sBAAsB,EAC9B,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAC7B,CAAA;QACH,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@creator.co/wapi",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
-
"type": "
|
|
7
|
+
"type": "module",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"build": "tsc --build",
|
|
10
10
|
"clean": "tsc --build --clean",
|
|
11
11
|
"lint-fix": "eslint . --ext .ts --fix",
|
|
12
12
|
"lint": "eslint . --ext .ts",
|
|
13
|
-
"test": "jest --coverage --silent --runInBand && cat coverage/coverage.txt",
|
|
13
|
+
"test": "jest --coverage --silent --runInBand --logHeapUsage && cat coverage/coverage.txt",
|
|
14
14
|
"test-dev": "jest --coverage --runInBand && cat coverage/coverage.txt"
|
|
15
15
|
},
|
|
16
16
|
"author": "",
|
|
17
17
|
"license": "ISC",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@aws-sdk/client-kms": "^3.
|
|
20
|
-
"@aws-sdk/client-secrets-manager": "
|
|
21
|
-
"@aws-sdk/client-ses": "
|
|
22
|
-
"@aws-sdk/client-sns": "
|
|
23
|
-
"@aws-sdk/client-ssm": "
|
|
24
|
-
"@aws-sdk/credential-provider-node": "
|
|
19
|
+
"@aws-sdk/client-kms": "^3.556.0",
|
|
20
|
+
"@aws-sdk/client-secrets-manager": "3.556",
|
|
21
|
+
"@aws-sdk/client-ses": "3.556",
|
|
22
|
+
"@aws-sdk/client-sns": "3.556",
|
|
23
|
+
"@aws-sdk/client-ssm": "3.556",
|
|
24
|
+
"@aws-sdk/credential-provider-node": "3.556",
|
|
25
25
|
"@types/email-templates": "^10.0.1",
|
|
26
26
|
"@types/nodemailer": "^6.4.10",
|
|
27
27
|
"@types/object-hash": "^3.0.4",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"node-cache": "^5.1.2",
|
|
40
40
|
"object-hash": "^3.0.0",
|
|
41
41
|
"parse-duration": "^1.1.0",
|
|
42
|
-
"path-to-regexp": "^6.2.
|
|
42
|
+
"path-to-regexp": "^6.2.2",
|
|
43
43
|
"pg": "^8.11.3",
|
|
44
44
|
"redis": "^4.6.13",
|
|
45
45
|
"sha1": "^1.1.1",
|
|
46
46
|
"stack-trace": "0.0.10",
|
|
47
|
-
"zod": "^3.
|
|
47
|
+
"zod": "^3.23.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@jest/globals": "^29.7.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@typescript-eslint/parser": "^6.21.0",
|
|
63
63
|
"aws-lambda": "^1.0.7",
|
|
64
64
|
"aws-sdk-client-mock": "^3.0.0",
|
|
65
|
-
"chai": "^4.
|
|
65
|
+
"chai": "^4.4.1",
|
|
66
66
|
"eslint": "^8.48.0",
|
|
67
67
|
"eslint-config-prettier": "^9.0.0",
|
|
68
68
|
"eslint-plugin-import": "^2.28.1",
|
package/src/Logger/Logger.ts
CHANGED
|
@@ -331,7 +331,7 @@ export default class Logger {
|
|
|
331
331
|
push({ value: modifiedValue, parent, key })
|
|
332
332
|
} catch {
|
|
333
333
|
const lower = value.toLowerCase()
|
|
334
|
-
if (this.filterBlacklist.some(f => lower
|
|
334
|
+
if (this.filterBlacklist.some(f => lower == f))
|
|
335
335
|
modifiedValue = `**SUPPRESSED_SENSITIVE_DATA** (${String(modifiedValue)?.length || 0} len)`
|
|
336
336
|
}
|
|
337
337
|
parent[key] = modifiedValue
|
|
@@ -340,7 +340,7 @@ export default class Logger {
|
|
|
340
340
|
private suppressSensitiveObject(value: object, push: (e: SupressableItem) => void) {
|
|
341
341
|
Object.entries(value).forEach(([k, v]) => {
|
|
342
342
|
const lower = k.toLowerCase()
|
|
343
|
-
const match = v && this.filterBlacklist.some(f => lower
|
|
343
|
+
const match = v && this.filterBlacklist.some(f => lower == f)
|
|
344
344
|
if (match) {
|
|
345
345
|
value[k] = `**SUPPRESSED_SENSITIVE_DATA** (${String(v)?.length || 0} len)`
|
|
346
346
|
} else {
|
|
@@ -47,7 +47,7 @@ function testLogs(isContainer: boolean, provider?: Logger) {
|
|
|
47
47
|
)
|
|
48
48
|
expect(consoleProxy.log).toHaveBeenNthCalledWith(
|
|
49
49
|
1,
|
|
50
|
-
expect.stringContaining(']
|
|
50
|
+
expect.stringContaining('] my password is 123')
|
|
51
51
|
)
|
|
52
52
|
})
|
|
53
53
|
|
|
@@ -166,9 +166,11 @@ function testLogs(isContainer: boolean, provider?: Logger) {
|
|
|
166
166
|
)
|
|
167
167
|
expect(consoleProxy.log).toHaveBeenNthCalledWith(
|
|
168
168
|
1,
|
|
169
|
-
expect.stringContaining(
|
|
170
|
-
|
|
171
|
-
|
|
169
|
+
expect.stringContaining('[INFO] [Logger.test.ts:')
|
|
170
|
+
)
|
|
171
|
+
expect(consoleProxy.log).toHaveBeenNthCalledWith(
|
|
172
|
+
1,
|
|
173
|
+
expect.stringContaining('] {\n' + ' "self": "[Circular ~]"\n' + '}')
|
|
172
174
|
)
|
|
173
175
|
})
|
|
174
176
|
|
package/tsconfig.json
CHANGED
|
@@ -6,13 +6,15 @@
|
|
|
6
6
|
"es6",
|
|
7
7
|
"dom"
|
|
8
8
|
],
|
|
9
|
+
"module": "esnext",
|
|
10
|
+
"target": "es6",
|
|
11
|
+
"moduleResolution": "node",
|
|
9
12
|
"noImplicitAny": false,
|
|
10
13
|
"noEmitOnError": true,
|
|
11
14
|
"removeComments": false,
|
|
12
15
|
"downlevelIteration": true,
|
|
13
16
|
"resolveJsonModule": true,
|
|
14
17
|
"sourceMap": true,
|
|
15
|
-
"target": "es5",
|
|
16
18
|
"outDir": "dist",
|
|
17
19
|
"declaration": true,
|
|
18
20
|
"skipLibCheck": true,
|