From 5fc20bcfcff0eb3e89cdff6c9e9f06a8c5c0852d Mon Sep 17 00:00:00 2001 From: Raosan Date: Thu, 16 Jan 2025 14:43:11 +0700 Subject: [PATCH] fix mongo --- .mocharc.json | 2 -- src/components/probe/prober/mongo/index.ts | 26 +++++++++++++++++++- src/components/probe/prober/mongo/request.ts | 2 +- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.mocharc.json b/.mocharc.json index 641d97db8..deaa978b2 100644 --- a/.mocharc.json +++ b/.mocharc.json @@ -16,8 +16,6 @@ "src/components/probe/prober/http/index.test.ts", "src/components/probe/prober/icmp/index.test.ts", "src/components/probe/prober/index.test.ts", - "src/components/probe/prober/mongo/index.test.ts", - "src/components/tls-checker/index.test.ts", "test/components/notification.test.ts" ] } \ No newline at end of file diff --git a/src/components/probe/prober/mongo/index.ts b/src/components/probe/prober/mongo/index.ts index f6f58b462..4df656179 100644 --- a/src/components/probe/prober/mongo/index.ts +++ b/src/components/probe/prober/mongo/index.ts @@ -1,4 +1,28 @@ -import * as mongodbURI from 'mongodb-uri' +/********************************************************************************** + * MIT License * + * * + * Copyright (c) 2021 Hyperjump Technology * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy * + * of this software and associated documentation files (the "Software"), to deal * + * in the Software without restriction, including without limitation the rights * + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included in all * + * copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * + * SOFTWARE. * + **********************************************************************************/ + +import mongodbURI from 'mongodb-uri' import { BaseProber, type ProbeParams, type ProbeResult } from '../index.js' import { probeRequestResult } from '../../../../interfaces/request.js' import type { Mongo } from '../../../../interfaces/probe.js' diff --git a/src/components/probe/prober/mongo/request.ts b/src/components/probe/prober/mongo/request.ts index ef625f7b9..f50dbac23 100644 --- a/src/components/probe/prober/mongo/request.ts +++ b/src/components/probe/prober/mongo/request.ts @@ -23,7 +23,7 @@ **********************************************************************************/ import { MongoClient } from 'mongodb' -import * as mongodbURI from 'mongodb-uri' +import mongodbURI from 'mongodb-uri' import { probeRequestResult } from '../../../../interfaces/request.js' import type { ProbeRequestResponse } from '../../../../interfaces/request.js' import { differenceInMilliseconds } from 'date-fns'