Skip to content

Commit

Permalink
Release: Version 1.20.1 (#1284)
Browse files Browse the repository at this point in the history
* release: version 1.20.1

* fix: adjust the new lint rules
  • Loading branch information
haricnugraha authored May 6, 2024
1 parent 69b9004 commit 48b30df
Show file tree
Hide file tree
Showing 9 changed files with 2,361 additions and 1,208 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.20.1] - 2024-05-06

### Fixed

- Fix: Make TLS Probe Independent

### Changed

- Refactor: Separate Create Config Handler
- CI: Upgrade actions that still use Node.js version 16
- Refactor: Separate flag handlers
- Test: Add tests for Monika configuration codes
- Feat: adding sendWithCustomContent in monika-notif
- Docs: Remove probes property from TLS checker config example

## [1.20.0] - 2024-04-18

### Added
Expand Down
3,503 changes: 2,328 additions & 1,175 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hyperjumptech/monika",
"description": "Synthetic monitoring made easy",
"version": "1.20.0",
"version": "1.20.1",
"license": "MIT",
"author": "@hyperjumptech",
"main": "lib/index.js",
Expand Down Expand Up @@ -58,7 +58,7 @@
},
"dependencies": {
"@faker-js/faker": "^7.4.0",
"@hyperjumptech/monika-notification": "^1.17.0",
"@hyperjumptech/monika-notification": "^1.18.0",
"@oclif/core": "3.16.0",
"@oclif/plugin-help": "^6.0.9",
"@oclif/plugin-version": "^2.0.11",
Expand Down
6 changes: 3 additions & 3 deletions packages/notification/utils/authorization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
* SOFTWARE. *
**********************************************************************************/

import { AxiosBasicCredentials } from 'axios'
import type { AxiosBasicCredentials } from 'axios'

type BasicCredentials = AxiosBasicCredentials & {
type BasicCredentials = {
type: 'basic'
}
} & AxiosBasicCredentials

type Bearer = { type: 'bearer'; token: string }

Expand Down
4 changes: 2 additions & 2 deletions src/components/incident/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export function addIncident(
export function removeIncident({
probeID,
probeRequestURL,
}: Pick<Incident, 'probeID'> &
Partial<Pick<Incident, 'probeRequestURL'>>): void {
}: Partial<Pick<Incident, 'probeRequestURL'>> &
Pick<Incident, 'probeID'>): void {
const newIncidents = getIncidents().filter((incident) => {
if (!probeRequestURL) {
return probeID !== incident.probeID
Expand Down
12 changes: 0 additions & 12 deletions src/components/probe/prober/http/request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,6 @@ describe('probingHTTP', () => {
headers.get('content-type') !== 'text/plain' ||
body !== 'multiline string\nexample'
) {
console.error(headers.get('content-type'))
console.error(body)

return new HttpResponse(null, {
status: 400,
})
Expand Down Expand Up @@ -248,9 +245,6 @@ describe('probingHTTP', () => {
headers.get('content-type') !== 'text/yaml' ||
body !== 'username: [email protected]\npassword: secret\n'
) {
console.error(headers.get('content-type'))
console.error(body)

return new HttpResponse(null, {
status: 400,
})
Expand Down Expand Up @@ -291,9 +285,6 @@ describe('probingHTTP', () => {
headers.get('content-type') !== 'application/xml' ||
!body.includes('[email protected]')
) {
console.error(headers.get('content-type'))
console.error(JSON.stringify(body))

return new HttpResponse(null, {
status: 400,
})
Expand Down Expand Up @@ -426,9 +417,6 @@ describe('probingHTTP', () => {
headers.get('content-type') !== 'text/plain' ||
body !== 'multiline string\nexample'
) {
console.error(headers.get('content-type'))
console.error(body)

return new HttpResponse(null, {
status: 400,
})
Expand Down
12 changes: 4 additions & 8 deletions src/plugins/metrics/prometheus/collector.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,7 @@ describe('Prometheus collector', () => {
describe('Collect triggered allert metrics', () => {
it('should not throw', () => {
// arrange
const probeResult: Omit<ProbeResult, 'response'> & {
alertQuery: string
} = {
const probeResult = {
probe: {
id: '',
name: '',
Expand Down Expand Up @@ -189,9 +187,7 @@ describe('Prometheus collector', () => {

it('should not throw with empty request', () => {
// arrange
const probeResult: Omit<ProbeResult, 'response'> & {
alertQuery: string
} = {
const probeResult = {
probe: {
id: '',
name: '',
Expand Down Expand Up @@ -227,9 +223,9 @@ describe('Prometheus collector', () => {
},
requestIndex: 0,
alertQuery: '',
} as Omit<ProbeResult, 'response'> & {
} as {
alertQuery: string
}
} & Omit<ProbeResult, 'response'>

// act
const prometheusCollector = new PrometheusCollector()
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/metrics/prometheus/collector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export class PrometheusCollector {
}

collectTriggeredAlert(
probeResult: Omit<ProbeResult, 'response'> & { alertQuery: string }
probeResult: { alertQuery: string } & Omit<ProbeResult, 'response'>
): void {
if (!prometheusCustomCollector) {
throw new Error('Prometheus collector is not registered')
Expand Down
11 changes: 6 additions & 5 deletions src/utils/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,20 @@
* SOFTWARE. *
**********************************************************************************/

import axios, { AxiosRequestHeaders, AxiosResponse } from 'axios'
import http from 'http'
import https from 'https'
import type { AxiosRequestHeaders, AxiosResponse } from 'axios'
import axios from 'axios'
import http from 'node:http'
import https from 'node:https'
import { Agent, type HeadersInit } from 'undici'

type HttpRequestParams = Omit<RequestInit, 'headers'> & {
type HttpRequestParams = {
url: string
maxRedirects?: number
headers?: HeadersInit
timeout?: number
allowUnauthorizedSsl?: boolean
responseType?: 'stream'
}
} & Omit<RequestInit, 'headers'>

// Keep the agents alive to reduce the overhead of DNS queries and creating TCP connection.
// More information here: https://rakshanshetty.in/nodejs-http-keep-alive/
Expand Down

0 comments on commit 48b30df

Please sign in to comment.