Skip to content

Commit

Permalink
Update 2.0.0-beta.3-pro-personal
Browse files Browse the repository at this point in the history
Merge with 2.0.0-beta.2-pro-personal
  • Loading branch information
faisalman committed Jul 24, 2024
2 parents 6f02da0 + 768b622 commit 99d59f7
Show file tree
Hide file tree
Showing 34 changed files with 1,048 additions and 262 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@
- Provided Extensions submodule `'ua-parser-js/extensions'`
- Provided Helpers submodule `'ua-parser-js/helpers'`

## Version 2.0.0-beta.3

- Breaking:
- AR/VR devices moved to new device type: `xr`
- New property in `browser`: `type`
- In `ua-parser-js/extensions` submodule, `bots` divided into `crawler` / `fetcher`
- New features:
- Parse directly from command line using `npx ua-parser-js`
- Extensions can be passed as a list to `UAParser()`
- Add new browser: Pico Browser, Twitter, Wolvic
- Improve browser detection: DuckDuckGo, ICEBrowser, Klar, QQ, Sleipnir
- Improve device detection: Oculus Quest & Oppo Pad
- Update latest client hints spec: `formFactor` -> `formFactors`

## Version 2.0.0-beta.2

- Increase UA_MAX_LENGTH to 500
Expand Down
30 changes: 15 additions & 15 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# UAPARSER.JS PRO PERSONAL LICENSE

Version 1, October 2023
Version 2, July 2024

Copyright (C) 2023 Faisal Salman <[email protected]>
Copyright (C) 2023-2024 Faisal Salman <[email protected]>

---

Expand All @@ -20,53 +20,53 @@ Copyright (C) 2023 Faisal Salman <[email protected]>

## License

We retains all title, intellectual property, and ownership rights to The Code.
We retain all title, intellectual property, and ownership rights to The Code.

The Code is licensed, not sold, to You for use solely subject to the terms and conditions detailed here.

We grant you (and only you) a personal, limited, non-exclusive, non-transferable, non-sublicensable, royalty-free right to use, copy, and modify The Code.
We grant You (and only You) a personal, limited, non-exclusive, non-transferable, non-sublicensable, royalty-free right to use, copy, and modify The Code.

This license is only valid for You as 1 (one) individual and can not be transferred to other individual or organization.
This license is only valid for You as one (1) individual and cannot be transferred to another individual or organization.

---

## Rights

You may use and modify The Code to create as many personal, hobby, educational, and other non-profit use as you want for yourself.
You may use and modify The Code to create as many personal, hobby, educational, and other non-profit projects as you want for yourself.

You may create any number of copies of The Code for yourself.

You have the right to get lifetime updates and a 1 (one) year support, starting from the time you make the purchase.
You have the right to get lifetime updates and one (1) year of support, starting from the time you make the purchase.

---

## Restriction
## Restrictions

You may not use and modify The Code in such a way that may be used directly for commercial purpose.
You may not use or modify The Code in such a way that it may be used directly for commercial purposes.

You may not redistribute The Code, as-is or modified, except as a part of a Project that you made for yourself.

You may not deliver a Project that contains The Code as an open-source Project that might be used for commercial purpose to the general public, except with our written consent.
You may not deliver a Project that contains The Code as an open-source Project that might be used for commercial purposes by the general public, except with our written consent.

You may not use The Code for unlawful, inappropriate, illegal, or offensive purposes.

---

## Limitations

The Code is provided 'as is' without warranty of any kind, expressed, or implied.
The Code is provided 'as is' without warranty of any kind, expressed or implied.

We shall not be liable for any damages, including but not limited to, direct, indirect, special, incidental, or consequential damages or losses that occur by the use of The Code.

We reserve the rights to discontinue the lifetime updates for The Code at any time, with or without notice.
We reserve the right to discontinue the lifetime updates for The Code at any time, with or without notice.

We offer support only for question within the scope of The Code functionality or related at our sole discretion.
We offer support only for questions within the scope of The Code's functionality or related issues at our sole discretion.

---

## Terminations
## Termination

This license works indefinitely but can be revoked at any time if there is a violation to any of the terms.
This license is effective indefinitely but can be revoked at any time if there is a violation of any of the terms.

---

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<a href="https://uaparser.js.org"><img src="https://raw.githubusercontent.com/faisalman/ua-parser-js/gh-pages/images/uap-header.png"></a>
<a href="https://uaparser.dev"><img src="https://raw.githubusercontent.com/faisalman/ua-parser-js/gh-pages/images/uap-header.png"></a>
</p>

# UAParser.js
Expand All @@ -14,10 +14,10 @@ npm install @ua-parser-js/pro-personal

# Documentation

https://docs.uaparser.js.org/v2
https://docs.uaparser.dev

# License

UAParser.js PRO Personal

Copyright (c) 2012-2023 Faisal Salman <<[email protected]>>
Copyright (c) 2012-2024 Faisal Salman <<[email protected]>>
6 changes: 3 additions & 3 deletions dist/ua-parser.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/ua-parser.pack.js

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package.describe({
name: 'faisalman:ua-parser-js',
version: '2.0.0-beta.2',
version: '2.0.0-beta.3',
summary: 'Lightweight JavaScript-based user-agent string parser',
git: 'https://github.com/faisalman/ua-parser-js.git',
documentation: 'readme.md'
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "UAParser.js PRO Personal",
"name": "@ua-parser-js/pro-personal",
"version": "2.0.0-beta.2",
"version": "2.0.0-beta.3",
"author": "Faisal Salman <[email protected]> (http://faisalman.com)",
"description": "Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent & Client Hints data. Supports browser & node.js environment",
"keywords": [
Expand All @@ -18,7 +18,8 @@
"ua-parser-js",
"browser-detection",
"device-detection",
"os-detection"
"os-detection",
"bot-detection"
],
"homepage": "https://github.com/faisalman/ua-parser-js",
"contributors": [
Expand Down Expand Up @@ -196,6 +197,7 @@
"dist",
"src"
],
"bin": "./script/cli.js",
"scripts": {
"build": "./script/build-dist.sh && ./script/build-module.js",
"build+test": "npm run build && npm run test",
Expand All @@ -205,7 +207,7 @@
"test:eslint": "eslint src && eslint script",
"test:jshint": "jshint src/main",
"test:lockfile-lint": "npx lockfile-lint -p package-lock.json",
"test:mocha": "mocha -R list test/mocha*js",
"test:mocha": "mocha test/mocha*js",
"test:playwright": "playwright test"
},
"devDependencies": {
Expand Down
4 changes: 4 additions & 0 deletions script/cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env node

const UAParser = require('ua-parser-js');
console.log(JSON.stringify(process.argv.slice(2).map(ua => UAParser(ua)), null, 4));
23 changes: 18 additions & 5 deletions src/enums/ua-parser-enums.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
///////////////////////////////////////////////
/* Enums for UAParser.js v2.0.0-beta.2
/* Enums for UAParser.js v2.0.0-beta.3
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <[email protected]>
UAParser.js PRO Personal License */
Expand Down Expand Up @@ -50,7 +50,7 @@ const Browser = Object.freeze({
FENNEC: 'Fennec',
FLOCK: 'Flock',
FLOW: 'Flow',
GO: 'Go Browser',
GO: 'GoBrowser',
GOOGLE_SEARCH: 'GSA',
HEYTAP: 'HeyTap',
HUAWEI: 'Huawei Browser',
Expand Down Expand Up @@ -104,6 +104,7 @@ const Browser = Object.freeze({
PALEMOON: 'PaleMoon',
PHANTOMJS: 'PhantomJS',
PHOENIX: 'Phoenix',
PICOBROWSER: 'Pico Browser',
POLARIS: 'Polaris',
PUFFIN: 'Puffin',
QQ: 'QQBrowser',
Expand All @@ -128,9 +129,9 @@ const Browser = Object.freeze({
TESLA: 'Tesla',
TIKTOK: 'TikTok',
TIZEN: 'Tizen Browser',
TWITTER: 'Twitter',
UC: 'UCBrowser',
UP: 'UP.Browser',
VIERA: 'Viera',
VIVALDI: 'Vivaldi',
VIVO: 'Vivo Browser',
W3M: 'w3m',
Expand All @@ -139,11 +140,21 @@ const Browser = Object.freeze({
WECHAT: 'WeChat',
WEIBO: 'Weibo',
WHALE: 'Whale',
WOLVIC: 'Wolvic',
YANDEX: 'Yandex'

// TODO : test!
});

const BrowserType = Object.freeze({
CRAWLER: 'crawler',
CLI: 'cli',
EMAIL: 'email',
FETCHER: 'fetcher',
INAPP: 'inapp',
MODULE: 'module'
});

const CPU = Object.freeze({
ARM : 'arm',
ARM_64: 'arm64',
Expand Down Expand Up @@ -171,7 +182,8 @@ const Device = Object.freeze({
MOBILE: 'mobile',
SMARTTV: 'smarttv',
TABLET: 'tablet',
WEARABLE: 'wearable'
WEARABLE: 'wearable',
XR: 'xr'
});

const Vendor = Object.freeze({
Expand Down Expand Up @@ -341,7 +353,8 @@ const OS = Object.freeze({
});

module.exports = {
Browser,
Browser,
BrowserType,
CPU,
Device,
Vendor,
Expand Down
23 changes: 18 additions & 5 deletions src/enums/ua-parser-enums.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Source: /src/enums/ua-parser-enums.js

///////////////////////////////////////////////
/* Enums for UAParser.js v2.0.0-beta.2
/* Enums for UAParser.js v2.0.0-beta.3
https://github.com/faisalman/ua-parser-js
Author: Faisal Salman <[email protected]>
UAParser.js PRO Personal License */
Expand Down Expand Up @@ -54,7 +54,7 @@ const Browser = Object.freeze({
FENNEC: 'Fennec',
FLOCK: 'Flock',
FLOW: 'Flow',
GO: 'Go Browser',
GO: 'GoBrowser',
GOOGLE_SEARCH: 'GSA',
HEYTAP: 'HeyTap',
HUAWEI: 'Huawei Browser',
Expand Down Expand Up @@ -108,6 +108,7 @@ const Browser = Object.freeze({
PALEMOON: 'PaleMoon',
PHANTOMJS: 'PhantomJS',
PHOENIX: 'Phoenix',
PICOBROWSER: 'Pico Browser',
POLARIS: 'Polaris',
PUFFIN: 'Puffin',
QQ: 'QQBrowser',
Expand All @@ -132,9 +133,9 @@ const Browser = Object.freeze({
TESLA: 'Tesla',
TIKTOK: 'TikTok',
TIZEN: 'Tizen Browser',
TWITTER: 'Twitter',
UC: 'UCBrowser',
UP: 'UP.Browser',
VIERA: 'Viera',
VIVALDI: 'Vivaldi',
VIVO: 'Vivo Browser',
W3M: 'w3m',
Expand All @@ -143,11 +144,21 @@ const Browser = Object.freeze({
WECHAT: 'WeChat',
WEIBO: 'Weibo',
WHALE: 'Whale',
WOLVIC: 'Wolvic',
YANDEX: 'Yandex'

// TODO : test!
});

const BrowserType = Object.freeze({
CRAWLER: 'crawler',
CLI: 'cli',
EMAIL: 'email',
FETCHER: 'fetcher',
INAPP: 'inapp',
MODULE: 'module'
});

const CPU = Object.freeze({
ARM : 'arm',
ARM_64: 'arm64',
Expand Down Expand Up @@ -175,7 +186,8 @@ const Device = Object.freeze({
MOBILE: 'mobile',
SMARTTV: 'smarttv',
TABLET: 'tablet',
WEARABLE: 'wearable'
WEARABLE: 'wearable',
XR: 'xr'
});

const Vendor = Object.freeze({
Expand Down Expand Up @@ -345,7 +357,8 @@ const OS = Object.freeze({
});

export {
Browser,
Browser,
BrowserType,
CPU,
Device,
Vendor,
Expand Down
7 changes: 4 additions & 3 deletions src/extensions/ua-parser-extensions.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// Type definitions for Helpers submodule of UAParser.js v2.0.0-beta.2
// Type definitions for Helpers submodule of UAParser.js v2.0.0-beta.3
// Project: https://github.com/faisalman/ua-parser-js
// Definitions by: Faisal Salman <https://github.com/faisalman>

import type { UAParserExt } from "../main/ua-parser";

export const Apps: UAParserExt;
export const Bots: UAParserExt;
export const CLIs: UAParserExt;
export const Crawlers: UAParserExt;
export const ExtraDevices: UAParserExt;
export const Emails: UAParserExt;
export const Fetchers: UAParserExt;
export const InApps: UAParserExt;
export const MediaPlayers: UAParserExt;
export const Modules: UAParserExt;
Loading

0 comments on commit 99d59f7

Please sign in to comment.