diff --git a/LICENSE.md b/LICENSE.md index b263976..4533025 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -# UAPARSER.JS PRO PERSONAL LICENSE +# UAPARSER.JS PRO BUSINESS LICENSE Version 1, October 2023 @@ -10,7 +10,7 @@ Copyright (C) 2023 Faisal Salman "We" are the team behind UAParser.js. -"You" are the individual who is responsible for purchasing this license. +"You" are the individual/organization/company who is responsible for purchasing this license. "The Code" is UAParser.js. @@ -24,17 +24,17 @@ We retains 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 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 1 (one) individual/organization/company and can not be transferred to other individual/organization/company. --- ## 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 only in 1 (one) Project, if you use it in more than 1 (one) Project you have to purchase for another license. -You may create any number of copies of The Code for yourself. +If You transfer a Project to a client, the use of The Code must be limited to the original functionality that You created for them. The Code must not be extracted, reproduced, or used in any other way. You must inform your client of this condition. You have the right to get lifetime updates and a 1 (one) year support, starting from the time you make the purchase. @@ -42,9 +42,7 @@ You have the right to get lifetime updates and a 1 (one) year support, starting ## Restriction -You may not use and modify The Code in such a way that may be used directly for commercial purpose. - -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 redistribute The Code, as-is or modified, except as a part of a Project that you made. 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. diff --git a/README.md b/README.md index be97e89..71eb780 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,12 @@ # UAParser.js -Thank you for purchasing UAParser.js PRO Personal License, if you haven't please oreder here: https://store.faisalman.com +Thank you for purchasing UAParser.js PRO Business License, if you haven't please order here: https://store.faisalman.com # Download ```sh -npm install @ua-parser-js/pro-personal +npm install @ua-parser-js/pro-business ``` # Documentation @@ -18,6 +18,6 @@ https://docs.uaparser.js.org/v2 # License -UAParser.js PRO Personal +UAParser.js PRO Business Copyright (c) 2012-2023 Faisal Salman <> \ No newline at end of file diff --git a/dist/ua-parser.min.js b/dist/ua-parser.min.js index a736857..4c5688f 100644 --- a/dist/ua-parser.min.js +++ b/dist/ua-parser.min.js @@ -1,4 +1,4 @@ /* UAParser.js v2.0.0-beta.1 Copyright © 2012-2023 Faisal Salman - UAParser.js PRO Personal License */ + UAParser.js PRO Business License */ (function(window,undefined){"use strict";var LIBVERSION="2.0.0-beta.1",EMPTY="",UNKNOWN="?",FUNC_TYPE="function",UNDEF_TYPE="undefined",OBJ_TYPE="object",STR_TYPE="string",MAJOR="major",MODEL="model",NAME="name",TYPE="type",VENDOR="vendor",VERSION="version",ARCHITECTURE="architecture",CONSOLE="console",MOBILE="mobile",TABLET="tablet",SMARTTV="smarttv",WEARABLE="wearable",EMBEDDED="embedded",USER_AGENT="user-agent",UA_MAX_LENGTH=350,BRANDS="brands",FORMFACTOR="formFactor",FULLVERLIST="fullVersionList",PLATFORM="platform",PLATFORMVER="platformVersion",BITNESS="bitness",CH_HEADER="sec-ch-ua",CH_HEADER_FULL_VER_LIST=CH_HEADER+"-full-version-list",CH_HEADER_ARCH=CH_HEADER+"-arch",CH_HEADER_BITNESS=CH_HEADER+"-"+BITNESS,CH_HEADER_FORM_FACTOR=CH_HEADER+"-form-factor",CH_HEADER_MOBILE=CH_HEADER+"-"+MOBILE,CH_HEADER_MODEL=CH_HEADER+"-"+MODEL,CH_HEADER_PLATFORM=CH_HEADER+"-"+PLATFORM,CH_HEADER_PLATFORM_VER=CH_HEADER_PLATFORM+"-version",CH_ALL_VALUES=[BRANDS,FULLVERLIST,MOBILE,MODEL,PLATFORM,PLATFORMVER,ARCHITECTURE,FORMFACTOR,BITNESS],UA_BROWSER="browser",UA_CPU="cpu",UA_DEVICE="device",UA_ENGINE="engine",UA_OS="os",UA_RESULT="result",AMAZON="Amazon",APPLE="Apple",ASUS="ASUS",BLACKBERRY="BlackBerry",GOOGLE="Google",HUAWEI="Huawei",LG="LG",MICROSOFT="Microsoft",MOTOROLA="Motorola",SAMSUNG="Samsung",SHARP="Sharp",SONY="Sony",XIAOMI="Xiaomi",ZEBRA="Zebra",PREFIX_MOBILE="Mobile ",SUFFIX_BROWSER=" Browser",CHROME="Chrome",EDGE="Edge",FIREFOX="Firefox",OPERA="Opera",FACEBOOK="Facebook",WINDOWS="Windows";var NAVIGATOR=typeof window!==UNDEF_TYPE&&window.navigator?window.navigator:undefined,NAVIGATOR_UADATA=NAVIGATOR&&NAVIGATOR.userAgentData?NAVIGATOR.userAgentData:undefined;var extend=function(regexes,extensions){var mergedRegexes={};for(var i in regexes){mergedRegexes[i]=extensions[i]&&extensions[i].length%2===0?extensions[i].concat(regexes[i]):regexes[i]}return mergedRegexes},enumerize=function(arr){var enums={};for(var i=0;i0){for(var i in str1){if(lowerize(str1[i])==lowerize(str2))return true}return false}return typeof str1===STR_TYPE?lowerize(str2).indexOf(lowerize(str1))!==-1:false},isExtensions=function(obj){for(var prop in obj){return/^(browser|cpu|device|engine|os)$/.test(prop)}},itemListToArray=function(header){if(!header)return undefined;var arr=[];var tokens=strip(/\\?\"/g,header).split(",");for(var i=0;i-1){var token=trim(tokens[i]).split(";v=");arr[i]={brand:token[0],version:token[1]}}else{arr[i]=tokens[i]}}return arr},lowerize=function(str){return typeof str===STR_TYPE?str.toLowerCase():str},majorize=function(version){return typeof version===STR_TYPE?strip(/[^\d\.]/g,version).split(".")[0]:undefined},setProps=function(arr){for(var i in arr){var propName=arr[i];if(typeof propName==OBJ_TYPE&&propName.length==2){this[propName[0]]=propName[1]}else{this[propName]=undefined}}return this},strip=function(pattern,str){return str.replace(pattern,EMPTY)},stripQuotes=function(val){return typeof val===STR_TYPE?strip(/\\?\"/g,val):val},trim=function(str,len){if(typeof str===STR_TYPE){str=strip(/^\s\s*/,str);return typeof len===UNDEF_TYPE?str:str.substring(0,UA_MAX_LENGTH)}};var rgxMapper=function(ua,arrays){if(!ua||!arrays)return;var i=0,j,k,p,q,matches,match;while(i0){if(q.length===2){if(typeof q[1]==FUNC_TYPE){this[q[0]]=q[1].call(this,match)}else{this[q[0]]=q[1]}}else if(q.length===3){if(typeof q[1]===FUNC_TYPE&&!(q[1].exec&&q[1].test)){this[q[0]]=match?q[1].call(this,match,q[2]):undefined}else{this[q[0]]=match?match.replace(q[1],q[2]):undefined}}else if(q.length===4){this[q[0]]=match?q[3].call(this,match.replace(q[1],q[2])):undefined}}else{this[q]=match?match:undefined}}}}i+=2}},strMapper=function(str,map){for(var i in map){if(typeof map[i]===OBJ_TYPE&&map[i].length>0){for(var j=0;j2){this.set(MODEL,"iPad").set(TYPE,TABLET)}break;case UA_OS:if(!this.get(NAME)&&NAVIGATOR_UADATA&&NAVIGATOR_UADATA[PLATFORM]){this.set(NAME,NAVIGATOR_UADATA[PLATFORM])}break;case UA_RESULT:var data=this.data;var detect=function(itemType){return data[itemType].getItem().detectFeature().get()};this.set(UA_BROWSER,detect(UA_BROWSER)).set(UA_CPU,detect(UA_CPU)).set(UA_DEVICE,detect(UA_DEVICE)).set(UA_ENGINE,detect(UA_ENGINE)).set(UA_OS,detect(UA_OS))}}return this};this.parseUA=function(){if(this.itemType!=UA_RESULT){rgxMapper.call(this.data,this.ua,this.rgxMap)}if(this.itemType==UA_BROWSER){this.set(MAJOR,majorize(this.get(VERSION)))}return this};this.parseCH=function(){var uaCH=this.uaCH,rgxMap=this.rgxMap;switch(this.itemType){case UA_BROWSER:var brands=uaCH[FULLVERLIST]||uaCH[BRANDS];if(brands){for(var i in brands){var brandName=brands[i].brand,brandVersion=brands[i].version;if(!/not.a.brand/i.test(brandName)&&(i<1||/chromi/i.test(this.get(NAME)))){this.set(NAME,strip(GOOGLE+" ",brandName)).set(VERSION,brandVersion).set(MAJOR,majorize(brandVersion))}}}break;case UA_CPU:var archName=uaCH[ARCHITECTURE];if(archName){if(archName&&uaCH[BITNESS]=="64")archName+="64";rgxMapper.call(this.data,archName+";",rgxMap)}break;case UA_DEVICE:if(uaCH[MOBILE]){this.set(TYPE,MOBILE)}if(uaCH[MODEL]){this.set(MODEL,uaCH[MODEL])}if(uaCH[FORMFACTOR]){var ff;if(typeof uaCH[FORMFACTOR]!=="string"){var idx=0;while(!ff&&idx=13?"11":"10";this.set(NAME,osName).set(VERSION,osVersion)}break;case UA_RESULT:var data=this.data;var parse=function(itemType){return data[itemType].getItem().setCH(uaCH).parseCH().get()};this.set(UA_BROWSER,parse(UA_BROWSER)).set(UA_CPU,parse(UA_CPU)).set(UA_DEVICE,parse(UA_DEVICE)).set(UA_ENGINE,parse(UA_ENGINE)).set(UA_OS,parse(UA_OS))}return this};setProps.call(this,[["itemType",itemType],["ua",ua],["uaCH",uaCH],["rgxMap",rgxMap],["data",createIData(this,itemType)]]);return this}function UAParser(ua,extensions,headers){if(typeof ua===OBJ_TYPE){if(isExtensions(ua)){if(typeof extensions===OBJ_TYPE){headers=extensions}extensions=ua}else{headers=ua;extensions=undefined}ua=undefined}else if(typeof ua===STR_TYPE&&!isExtensions(extensions)){headers=extensions;extensions=undefined}if(!(this instanceof UAParser)){return new UAParser(ua,extensions,headers).getResult()}var userAgent=typeof ua===STR_TYPE?ua:NAVIGATOR&&NAVIGATOR.userAgent?NAVIGATOR.userAgent:headers&&headers[USER_AGENT]?headers[USER_AGENT]:EMPTY,httpUACH=new UACHData(headers,true),regexMap=extensions?extend(defaultRegexes,extensions):defaultRegexes,createItemFunc=function(itemType){if(itemType==UA_RESULT){return function(){return new UAItem(itemType,userAgent,regexMap,httpUACH).set("ua",userAgent).set(UA_BROWSER,this.getBrowser()).set(UA_CPU,this.getCPU()).set(UA_DEVICE,this.getDevice()).set(UA_ENGINE,this.getEngine()).set(UA_OS,this.getOS()).get()}}else{return function(){return new UAItem(itemType,userAgent,regexMap[itemType],httpUACH).parseUA().get()}}};setProps.call(this,[["getBrowser",createItemFunc(UA_BROWSER)],["getCPU",createItemFunc(UA_CPU)],["getDevice",createItemFunc(UA_DEVICE)],["getEngine",createItemFunc(UA_ENGINE)],["getOS",createItemFunc(UA_OS)],["getResult",createItemFunc(UA_RESULT)],["getUA",function(){return userAgent}],["setUA",function(ua){if(typeof ua===STR_TYPE)userAgent=ua.length>UA_MAX_LENGTH?trim(ua,UA_MAX_LENGTH):ua;return this}]]).setUA(userAgent);return this}UAParser.VERSION=LIBVERSION;UAParser.BROWSER=enumerize([NAME,VERSION,MAJOR]);UAParser.CPU=enumerize([ARCHITECTURE]);UAParser.DEVICE=enumerize([MODEL,VENDOR,TYPE,CONSOLE,MOBILE,SMARTTV,TABLET,WEARABLE,EMBEDDED]);UAParser.ENGINE=UAParser.OS=enumerize([NAME,VERSION]);if(typeof exports!==UNDEF_TYPE){if(typeof module!==UNDEF_TYPE&&module.exports){exports=module.exports=UAParser}exports.UAParser=UAParser}else{if(typeof define===FUNC_TYPE&&define.amd){define(function(){return UAParser})}else if(typeof window!==UNDEF_TYPE){window.UAParser=UAParser}}var $=typeof window!==UNDEF_TYPE&&(window.jQuery||window.Zepto);if($&&!$.ua){var parser=new UAParser;$.ua=parser.getResult();$.ua.get=function(){return parser.getUA()};$.ua.set=function(ua){parser.setUA(ua);var result=parser.getResult();for(var prop in result){$.ua[prop]=result[prop]}}}})(typeof window==="object"?window:this); \ No newline at end of file diff --git a/dist/ua-parser.pack.js b/dist/ua-parser.pack.js index c7a5616..f06de8a 100644 --- a/dist/ua-parser.pack.js +++ b/dist/ua-parser.pack.js @@ -1,4 +1,4 @@ /* UAParser.js v2.0.0-beta.1 Copyright © 2012-2023 Faisal Salman - UAParser.js PRO Personal License */ + UAParser.js PRO Business License */ !function(i,c){"use strict";function e(i){for(var e={},t=0;t_?yi(i,_):i),this}]]).setUA(o),this}Pi.VERSION="2.0.0-beta.1",Pi.BROWSER=e([f,g,p]),Pi.CPU=e([v]),Pi.DEVICE=e([h,t,m,o,x,a,r,l,k]),Pi.ENGINE=Pi.OS=e([f,g]),typeof exports!==b?(typeof module!==b&&module.exports&&(exports=module.exports=Pi),exports.UAParser=Pi):typeof define===u&&define.amd?define(function(){return Pi}):typeof i!==b&&(i.UAParser=Pi);var Ui,Hi=typeof i!==b&&(i.jQuery||i.Zepto);Hi&&!Hi.ua&&(Ui=new Pi,Hi.ua=Ui.getResult(),Hi.ua.get=function(){return Ui.getUA()},Hi.ua.set=function(i){Ui.setUA(i);var e,t=Ui.getResult();for(e in t)Hi.ua[e]=t[e]})}("object"==typeof window?window:this); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 35ffa97..e5ac5eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "ua-parser-js", + "name": "@ua-parser-js/pro-business", "version": "2.0.0-beta.1", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "ua-parser-js", + "name": "@ua-parser-js/pro-business", "version": "2.0.0-beta.1", "funding": [ { @@ -21,7 +21,7 @@ "url": "https://github.com/sponsors/faisalman" } ], - "license": "UAParser.js-PRO-Personal", + "license": "UAParser.js-PRO-Business", "devDependencies": { "@babel/parser": "7.15.8", "@babel/traverse": "7.15.4", diff --git a/package.json b/package.json index 3c17ec7..cb6ea57 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "title": "UAParser.js PRO Personal", - "name": "@ua-parser-js/pro-personal", + "title": "UAParser.js PRO Business", + "name": "@ua-parser-js/pro-business", "version": "2.0.0-beta.1", "author": "Faisal Salman (http://faisalman.com)", "description": "Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent & Client Hints data. Supports browser & node.js environment", @@ -217,7 +217,7 @@ "type": "git", "url": "https://github.com/faisalman/ua-parser-js.git" }, - "license": "UAParser.js-PRO-Personal", + "license": "UAParser.js-PRO-Business", "engines": { "node": "*" }, diff --git a/src/enums/ua-parser-enums.js b/src/enums/ua-parser-enums.js index 3a5b9d1..ea939b3 100644 --- a/src/enums/ua-parser-enums.js +++ b/src/enums/ua-parser-enums.js @@ -2,7 +2,7 @@ /* Enums for UAParser.js v2.0.0-beta.1 https://github.com/faisalman/ua-parser-js Author: Faisal Salman - UAParser.js PRO Personal License */ + UAParser.js PRO Business License */ ////////////////////////////////////////////// /*jshint esversion: 6 */ diff --git a/src/enums/ua-parser-enums.mjs b/src/enums/ua-parser-enums.mjs index 1912fc8..d4cf6e0 100644 --- a/src/enums/ua-parser-enums.mjs +++ b/src/enums/ua-parser-enums.mjs @@ -6,7 +6,7 @@ /* Enums for UAParser.js v2.0.0-beta.1 https://github.com/faisalman/ua-parser-js Author: Faisal Salman - UAParser.js PRO Personal License */ + UAParser.js PRO Business License */ ////////////////////////////////////////////// /*jshint esversion: 6 */ diff --git a/src/extensions/ua-parser-extensions.js b/src/extensions/ua-parser-extensions.js index d123e2c..2152636 100644 --- a/src/extensions/ua-parser-extensions.js +++ b/src/extensions/ua-parser-extensions.js @@ -2,7 +2,7 @@ /* Extensions for UAParser.js v2.0.0-beta.1 https://github.com/faisalman/ua-parser-js Author: Faisal Salman - UAParser.js PRO Personal License */ + UAParser.js PRO Business License */ ////////////////////////////////////////////// /*jshint esversion: 6 */ diff --git a/src/extensions/ua-parser-extensions.mjs b/src/extensions/ua-parser-extensions.mjs index 4927dcc..a7251b4 100644 --- a/src/extensions/ua-parser-extensions.mjs +++ b/src/extensions/ua-parser-extensions.mjs @@ -6,7 +6,7 @@ /* Extensions for UAParser.js v2.0.0-beta.1 https://github.com/faisalman/ua-parser-js Author: Faisal Salman - UAParser.js PRO Personal License */ + UAParser.js PRO Business License */ ////////////////////////////////////////////// /*jshint esversion: 6 */ diff --git a/src/main/ua-parser.js b/src/main/ua-parser.js index e1d3688..03fea59 100755 --- a/src/main/ua-parser.js +++ b/src/main/ua-parser.js @@ -1,7 +1,7 @@ ///////////////////////////////////////////////////////////////////////////////// /* UAParser.js v2.0.0-beta.1 Copyright © 2012-2023 Faisal Salman - UAParser.js PRO Personal License *//* + UAParser.js PRO Business License *//* Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Supports browser & node.js environment. Demo : https://faisalman.github.io/ua-parser-js diff --git a/src/main/ua-parser.mjs b/src/main/ua-parser.mjs index d0e282c..d809677 100644 --- a/src/main/ua-parser.mjs +++ b/src/main/ua-parser.mjs @@ -5,7 +5,7 @@ ///////////////////////////////////////////////////////////////////////////////// /* UAParser.js v2.0.0-beta.1 Copyright © 2012-2023 Faisal Salman - UAParser.js PRO Personal License *//* + UAParser.js PRO Business License *//* Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Supports browser & node.js environment. Demo : https://faisalman.github.io/ua-parser-js