move sdk packages to its own folder and rename api & dashboard

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-03-11 13:15:44 +01:00
parent 1ca95442b9
commit 6d4f9010d4
318 changed files with 350 additions and 351 deletions

View File

@@ -0,0 +1,6 @@
# Device Detector - The Universal Device Detection library for parsing User Agents
> @link https://matomo.org
> @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or lat
[bots.ts](./bots.ts) is based on matomo bots.yml file. You can see the original version here [here](https://raw.githubusercontent.com/matomo-org/device-detector/master/regexes/bots.yml).

4901
apps/api/src/bots/bots.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,19 @@
import bots from './bots';
export function isBot(ua: string) {
const res = bots.find((bot) => {
if (new RegExp(bot.regex).test(ua)) {
return true;
}
return false;
});
if (!res) {
return null;
}
return {
name: res.name,
type: res.category || 'Unknown',
};
}