@janiscommerce/log
Advanced tools
Comparing version 3.4.0 to 3.4.1
@@ -10,2 +10,7 @@ # Changelog | ||
## [3.4.1] - 2021-05-10 | ||
### Fixed | ||
- Fixed TS `readonly` methods | ||
- `userCreated` now supports **null** value | ||
## [3.4.0] - 2021-04-27 | ||
@@ -12,0 +17,0 @@ ### Added |
@@ -24,3 +24,3 @@ 'use strict'; | ||
const { arrayChunk } = require('./helpers/utils'); | ||
const Validator = require('./helpers/validator'); | ||
const validateLog = require('./helpers/validate-log'); | ||
const LogError = require('./log-error'); | ||
@@ -37,6 +37,5 @@ const serverlessConfiguration = require('./serverless-configuration'); | ||
class Log { | ||
module.exports = class Log { | ||
/** | ||
* @readonly | ||
* @static | ||
@@ -50,3 +49,2 @@ * @returns {string} The service name as defined in the env var JANIS_SERVICE_NAME | ||
/** | ||
* @readonly | ||
* @static | ||
@@ -60,3 +58,2 @@ * @returns {string} The environment name as defined in the env var JANIS_ENV | ||
/** | ||
* @readonly | ||
* @static | ||
@@ -76,3 +73,2 @@ * @returns{object<string, string>} A key-value object of environments and their friendly name | ||
/** | ||
* @readonly | ||
* @static | ||
@@ -90,3 +86,2 @@ * @returns {string} The AWS CloudWatch Logs stream name based on current env | ||
/** | ||
* @readonly | ||
* @static | ||
@@ -149,3 +144,3 @@ * @returns {string} The friendly name of the current env | ||
validLogs = logs.map(log => this.validateLog(log, client)); | ||
validLogs = logs.map(log => validateLog(log, client, this.serviceName)); | ||
@@ -163,13 +158,2 @@ } catch(err) { | ||
* @static | ||
* @param {LogData} log | ||
* @param {string} client | ||
* @returns | ||
*/ | ||
static validateLog(log, client) { | ||
return Validator.validate(log, client, this.serviceName); | ||
} | ||
/** | ||
* @private | ||
* @static | ||
* @param {Array<LogData>} logs | ||
@@ -222,3 +206,2 @@ * @returns {Array<Array<LogData>>} | ||
* | ||
* @readonly | ||
* @static | ||
@@ -240,4 +223,2 @@ * @returns {Array} | ||
} | ||
} | ||
module.exports = Log; | ||
}; |
{ | ||
"name": "@janiscommerce/log", | ||
"version": "3.4.0", | ||
"version": "3.4.1", | ||
"description": "A package for creating logs in Firehose", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
# log | ||
[![Build Status](https://travis-ci.org/janis-commerce/log.svg?branch=master)](https://travis-ci.org/janis-commerce/log) | ||
![Build Status](https://github.com/janis-commerce/log/workflows/Build%20Status/badge.svg) | ||
[![Coverage Status](https://coveralls.io/repos/github/janis-commerce/log/badge.svg?branch=master)](https://coveralls.io/github/janis-commerce/log?branch=master) | ||
[![npm version](https://badge.fury.io/js/%40janiscommerce%2Flog.svg)](https://www.npmjs.com/package/@janiscommerce/log) | ||
@@ -6,0 +7,0 @@ A package for creating logs in Firehose |
export = Log; | ||
declare class Log { | ||
/** | ||
* @readonly | ||
* @static | ||
* @returns {string} The service name as defined in the env var JANIS_SERVICE_NAME | ||
*/ | ||
static readonly get serviceName(): string; | ||
static get serviceName(): string; | ||
/** | ||
* @readonly | ||
* @static | ||
* @returns {string} The environment name as defined in the env var JANIS_ENV | ||
*/ | ||
static readonly get env(): string; | ||
static get env(): string; | ||
/** | ||
* @readonly | ||
* @static | ||
* @returns{object<string, string>} A key-value object of environments and their friendly name | ||
*/ | ||
static readonly get envs(): any; | ||
static get envs(): any; | ||
/** | ||
* @readonly | ||
* @static | ||
* @returns {string} The AWS CloudWatch Logs stream name based on current env | ||
*/ | ||
static readonly get deliveryStreamName(): string; | ||
static get deliveryStreamName(): string; | ||
/** | ||
* @readonly | ||
* @static | ||
@@ -33,3 +28,3 @@ * @returns {string} The friendly name of the current env | ||
*/ | ||
static readonly get formattedEnv(): string; | ||
static get formattedEnv(): string; | ||
/** | ||
@@ -68,10 +63,2 @@ * Sets a callback for the specified event name | ||
* @static | ||
* @param {LogData} log | ||
* @param {string} client | ||
* @returns | ||
*/ | ||
private static validateLog; | ||
/** | ||
* @private | ||
* @static | ||
* @param {Array<LogData>} logs | ||
@@ -92,7 +79,6 @@ * @returns {Array<Array<LogData>>} | ||
* | ||
* @readonly | ||
* @static | ||
* @returns {Array} | ||
*/ | ||
static readonly get serverlessConfiguration(): any[]; | ||
static get serverlessConfiguration(): any[]; | ||
/** | ||
@@ -99,0 +85,0 @@ * @static |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
217
25923
572