@oracle/oraclejet-audit 13.0.0 → 13.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/jafapi.js CHANGED
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- var Jaf=function(){this._audit=require("./src/JafCore");this._api=require("./lib/api");this._nd={fs:require("fs"),path:require("path"),glob:require("glob"),process:process,os:require("os"),decomment:require("strip-json-comments"),decache:require("decache"),Config:require("./lib/Config"),metaLoader:require("./lib/metaLoader"),ruleLoader:require("./lib/ruleLoader"),msgidLoader:require("./lib/msgidLoader"),jsonLoader:require("./lib/JsonLoader"),Components:require("./lib/Components"),ComponentSvcs:require("./lib/ComponentSvcs"),schema:require("./lib/schema"),builtinpacks:null,extends:require("./lib/extends"),tsparse:require("@typescript-eslint/typescript-estree"),fsUtils:require("./lib/FsUtils"),zipUtils:require("./lib/ZipUtils"),jetver:require("./lib/jetver"),exportRules:require("./lib/exportRules"),spinner:require("./lib/spinnernoop")};this._audit=new this._audit(this._nd,"api");this._api=new this._api(this._nd,this._audit);this._error=1};Jaf.prototype.initSync=function(config,cbIssue,cbMsg,cbSummary){this._error=this._api.startSync({config:config,cbIssue:cbIssue,cbMsg:cbMsg,cbSummary:cbSummary});return this._error};Jaf.prototype.init=function(config){var _self=this;return new Promise((resolve,reject)=>{_self._api.start(()=>{config:config}).then(result=>{_self._error=result;resolve(result)}).catch(error=>{reject(error)})})};Jaf.prototype.auditSync=function(filespec){var i,rc=this._error;if(!this._error){if(this._audit._regListenerTypesSet){return rc}if(Array.isArray(filespec)&&filespec.length){for(i=0;i<filespec.length;i++){rc=this._api.auditSync(filespec[i])}}else{rc=this._api.auditSync(filespec)}}return rc};Jaf.prototype.audit=function(filespec){var _self;_self=this;return new Promise(function(resolve,reject){if(_self._error){reject(_self._error)}else{_self._api.audit(filespec).then(resultObj=>{resolve(resultObj)}).catch(err=>{throw err})}})};Jaf.prototype.on=function(evName,fn,extra){this._api.on(evName,fn,extra);return this};Jaf.prototype.removeAllListeners=function(evName){this._api.removeAllListeners(evName);return this};Jaf.prototype.removeListener=function(evName,fn){this._api.removeListener(evName,fn);return this};Jaf.prototype.getDescription=function(issue,short){return this._api.getDescription(issue,short)};Jaf.prototype.getActiveRulesetInfo=function(fmt){fmt=fmt!=="json"&&fmt!=="prose"&&fmt!=="sonar"?"json":fmt;return this._api.getRulesetInfo(fmt,true)};Jaf.prototype.setCallbacks=function(fnIssue,fnMsg,fnSummary){this._audit.setApiCallbacks(fnIssue,fnMsg,fnSummary)};Jaf.prototype.enableMsgId=function(msgid,state){return this._api.enableMsgId(msgid,state)};Jaf.prototype.getConfig=function(){return this._api.getConfig()};Jaf.prototype.getSevLib=function(){return this._api.getSevLib()};Jaf.prototype.enableRule=function(ruleName,state){return this._api.enableRule(ruleName,state)};Jaf.prototype.getInfo=function(){return this._api.getInfo()};Jaf.prototype.getMarker=function(){return this._api.getMarker()};Jaf.prototype.setMarker=function(mark){return this._api.setMarker(mark)};Jaf.prototype.setVsCodeExtHint=function(isVsCodeExt){isVsCodeExt=isVsCodeExt!==undefined?!!isVsCodeExt:true;return this._api.setVsCodeExtHint(isVsCodeExt)};module.exports=Jaf;
6
+ var Jaf=function(){this._audit=require("./src/JafCore");this._api=require("./lib/api");this._nd={fs:require("fs"),path:require("path"),glob:require("glob"),process:process,os:require("os"),decomment:require("strip-json-comments"),decache:require("decache"),Config:require("./lib/Config"),metaLoader:require("./lib/metaLoader"),ruleLoader:require("./lib/ruleLoader"),msgidLoader:require("./lib/msgidLoader"),jsonLoader:require("./lib/JsonLoader"),Components:require("./lib/Components"),ComponentSvcs:require("./lib/ComponentSvcs"),schema:require("./lib/schema"),builtinpacks:null,extends:require("./lib/extends"),tsparse:require("@typescript-eslint/typescript-estree"),fsUtils:require("./lib/FsUtils"),zipUtils:require("./lib/ZipUtils"),jetver:require("./lib/jetver"),exportRules:require("./lib/exportRules"),spinner:require("./lib/spinnernoop")};this._audit=new this._audit(this._nd,"api");this._api=new this._api(this._nd,this._audit);this._error=1};Jaf.prototype.initSync=function(config,cbIssue,cbMsg,cbSummary){this._error=this._api.startSync({config:config,cbIssue:cbIssue,cbMsg:cbMsg,cbSummary:cbSummary});return this._error};Jaf.prototype.init=function(config){this._error=0;return this._api.start({config:config})};Jaf.prototype.auditSync=function(filespec){var i,rc=this._error;if(!this._error){if(this._audit._regListenerTypesSet){return rc}if(Array.isArray(filespec)&&filespec.length){for(i=0;i<filespec.length;i++){rc=this._api.auditSync(filespec[i])}}else{rc=this._api.auditSync(filespec)}}return rc};Jaf.prototype.audit=function(filespec){var _self=this;return new Promise((resolve,reject)=>{if(!_self._error){_self._api.audit(filespec).then(rc=>{console.log(`jafapi audit.then(${_self.getMarker()}) rc = ${rc}`);rc?resolve(rc):reject(1)}).catch(e=>{console.log("jafapi catch(${_self.getMarker()}) "+e);reject(e)})}else{reject(_self._error)}})};Jaf.prototype.on=function(evName,fn,extra){this._api.on(evName,fn,extra);return this};Jaf.prototype.removeAllListeners=function(evName){this._api.removeAllListeners(evName);return this};Jaf.prototype.removeListener=function(evName,fn){this._api.removeListener(evName,fn);return this};Jaf.prototype.getDescription=function(issue,short){return this._api.getDescription(issue,short)};Jaf.prototype.getActiveRulesetInfo=function(fmt){fmt=fmt!=="json"&&fmt!=="prose"&&fmt!=="sonar"?"json":fmt;return this._api.getRulesetInfo(fmt,true)};Jaf.prototype.setCallbacks=function(fnIssue,fnMsg,fnSummary){this._audit.setApiCallbacks(fnIssue,fnMsg,fnSummary)};Jaf.prototype.enableMsgId=function(msgid,state){return this._api.enableMsgId(msgid,state)};Jaf.prototype.getConfig=function(){return this._api.getConfig()};Jaf.prototype.getSevLib=function(){return this._api.getSevLib()};Jaf.prototype.enableRule=function(ruleName,state){return this._api.enableRule(ruleName,state)};Jaf.prototype.getInfo=function(){return this._api.getInfo()};Jaf.prototype.getMarker=function(){return this._api.getMarker()};Jaf.prototype.setMarker=function(mark){return this._api.setMarker(mark)};Jaf.prototype.setVsCodeExtHint=function(isVsCodeExt){isVsCodeExt=isVsCodeExt!==undefined?!!isVsCodeExt:true;return this._api.setVsCodeExtHint(isVsCodeExt)};module.exports=Jaf;
package/lib/OjCPack.js CHANGED
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const PACK_PATH="node_modules/@oracle/oracle-jet-core-pack/oj-c/metadata";const ALLCOMP_JSON="allComponents.json";const LOAD_MSG="Loading Jet Core Pack (oj-c)...";const BOOLEAN="boolean";function Ojc(isOJet,isAMD,cwd,msgCtx,nd,fsUtils){this._isOJet=!!isOJet;this._isAMD=isAMD;this._nd=nd;this._cwd=cwd.replace(/\\/g,"/");this._fsUtils=fsUtils;this._msgCtx=msgCtx;this._fp=undefined;this._components=null}Ojc.prototype.getComponents=function(){return this._components};Ojc.prototype.setPath=function(fp){if(!this._isAMD){if(fp&&this._fsUtils.getFileType(fp)==="d"){fp=this._nd.path.join(fp,ALLCOMP_JSON)}else if(typeof fp===BOOLEAN){fp=null}}this._fp=fp};Ojc.prototype.load=function(){var o,comps,comp,isPath,info=this._msgCtx.info;if(!this._isAMD){if(this._fp===null){return this._components};if(this._fp===undefined){this._fp=this._nd.path.join(this._cwd,PACK_PATH,ALLCOMP_JSON)}else{isPath=true}if(!this._fsUtils.fileExists(this._fp)){let m=`Jet Core Pack metadata not found at '${this._fp}' [JAF-9015]\n`;let fn=isPath?this._msgCtx.error:this._msgCtx.warn;fn(m);return}info(LOAD_MSG);if(!(o=this._fsUtils.readJsonSync(this._fp,false,false))){this.msgCtx.error("Failed to read oj-c- pack allComponents.json");return false}else if(typeof o==="string"){this.msgCtx.error(o);return}comps=o.components}else{comps=this._fp;info(LOAD_MSG)}if(comps){let n=0;for(comp in comps){n++;if(!this._components){this._components={}}this._components[comp]=comps[comp]}info(` ... ${n} components loaded`)}return this._components};module.exports=Ojc;
6
+ const PACK_PATH="node_modules/@oracle/oracle-jet-core-pack/oj-c/metadata";const ALLCOMP_JSON="allComponents.json";const LOAD_MSG="Loading JET Core Pack (oj-c)...";const BOOLEAN="boolean";function Ojc(isOJet,isAMD,cwd,msgCtx,nd,fsUtils){this._isOJet=!!isOJet;this._isAMD=isAMD;this._nd=nd;this._cwd=cwd.replace(/\\/g,"/");this._fsUtils=fsUtils;this._msgCtx=msgCtx;this._fp=undefined;this._components=null}Ojc.prototype.getComponents=function(){return this._components};Ojc.prototype.setPath=function(fp){if(!this._isAMD){if(fp&&this._fsUtils.getFileType(fp)==="d"){fp=this._nd.path.join(fp,ALLCOMP_JSON)}else if(typeof fp===BOOLEAN){fp=null}}this._fp=fp};Ojc.prototype.load=function(){var o,comps,comp,isPath,info=this._msgCtx.info;if(this._components){return this._components}if(!this._isAMD){if(this._fp===null){return this._components};if(this._fp===undefined){this._fp=this._nd.path.join(this._cwd,PACK_PATH,ALLCOMP_JSON)}else{isPath=true}if(!this._fsUtils.fileExists(this._fp)){let m=`Jet Core Pack metadata not found at '${this._fp}' [JAF-9015]\n`;let fn=isPath?this._msgCtx.error:this._msgCtx.warn;fn(m);return}info(LOAD_MSG);if(!(o=this._fsUtils.readJsonSync(this._fp,false,false))){this.msgCtx.error("Failed to read oj-c- pack allComponents.json");return false}else if(typeof o==="string"){this.msgCtx.error(o);return}comps=o.components}else{comps=this._fp;info(LOAD_MSG)}if(comps){let n=0;for(comp in comps){n++;if(!this._components){this._components={}}this._components[comp]=comps[comp]}info(` ... ${n} JET core components loaded`)}return this._components};module.exports=Ojc;
package/lib/api.js CHANGED
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const OUTFMT=require("./outFormat");const UNDEF="undefined";function Api(nodeDeps,JafCore){this._core=JafCore;this._stats=JafCore.getStats();this._nd=nodeDeps};Api.prototype.startSync=function(apiContext){var core=this._core;core._ctxCB=apiContext;if(apiContext.config){let t=typeof apiContext.config;if(t==="string"){core._configPath=this._nd.path.join(core._curDir,apiContext.config)}else if(t==="object"){core._configPath=apiContext.config}else{core._error("Invalid config argument in init() : type is "+t);return 1}}if(apiContext.format&&apiContext.format!==OUTFMT.PROSE){apiContext.format=OUTFMT.PROSE}return core.start()};Api.prototype.start=function(apiContext,AmdMeta,AmdRulePacks){var t,_self,rc;this._core._isAsync=true;this._core._ctxCB=apiContext;_self=this;return new Promise(function(resolve,reject){let core=_self._core;setTimeout(()=>{try{if(apiContext.config){t=typeof apiContext.config;if(t==="string"){core._configPath=_self._nd.path.join(core._curDir,apiContext.config)}else if(t==="object"){core._configPath=apiContext.config}else{core._error("Invalid config argument in init() : type is "+t);reject(1)}}if(!core._isAMD){core._isAsync=false;core._isAsyncTemp=true;rc=_self.startSync(apiContext);core._isAsync=true;rc===0?resolve(rc):reject(core._messageStack)}else{if(apiContext.format&&apiContext.format!==OUTFMT.PROSE){apiContext.format=OUTFMT.PROSE}core._isAsync=false;core._isAsyncTemp=true;core._AmdMeta=AmdMeta;core._AmdRulePacks=AmdRulePacks;if(AmdRulePacks&&!Array.isArray(AmdRulePacks)){core._error("init() : AMD rule packs must be specified as an array!");reject(1);return}rc=_self.startSync(apiContext);core._isAsync=true;rc===0?resolve(rc):reject(core._messageStack)}}catch(e){reject(core._messageStack)}},0)})};Api.prototype.auditSync=function(filespec){var core=this._core;core._isAsync=false;this._stats.clearAll();if(core._regListenerTypesSet||core._rules&&core._rules.getActiveRuleCount()===0){if(core._rules){core._emitApiRunSummary()}return}if(filespec){if(!Array.isArray(filespec)){filespec=[filespec]}core._fileSet.setFiles(filespec,core._config.getExclude(),core._getMsgCtx())}core._startLifeCycle();core._emitApiRunSummary()};Api.prototype.audit=function(filespec){var rc,_self,core=this._core;core._isAsync=true;this._stats.clearAll();if(filespec){if(!Array.isArray(filespec)){filespec=[filespec]}core._fileSet.setFiles(filespec,core._config.getExclude(),core._getMsgCtx())}_self=this;return new Promise((resolve,reject)=>{setTimeout(()=>{try{_self._core._isAsync=false;rc=_self._core._startLifeCycle();_self._core._isAsync=true;_self._core._emitApiRunSummary();rc?resolve(0):reject(1)}catch(e){let m=`[JAF-9010] Internal Error:\n${_shortStackMsg(e)}`;core._error(m);reject(m)}},0)})};Api.prototype.on=function(evName,fn,obj){if(this._core._listenerSetup()){this._core._events.setListener(evName,fn,obj)}};Api.prototype.removeListener=function(evName,fn){if(this._core._listenerSetup()){this._core._events.removeListener(evName,fn)}};Api.prototype.removeAllListeners=function(evName){if(this._core._listenerSetup()){this._core._events.removeAllListeners(evName)}};Api.prototype.getDescription=function(arg1,arg2,arg3){var issue,short,ruleName,sig=0,ret="";var core=this._core;var arg1Type=core._Utils.getType(arg1);var arg2Type=core._Utils.getType(arg2);if(arg1Type==="object"){issue=arg1;if(arg2==="boolean"||arg2Type===UNDEF){short=arg2;sig=1;ruleName=issue.rule;msgId=issue.msgId}}else if(arg1Type==="string"){if(arg2Type==="string"){msgId=arg1;ruleName=arg2;short=!!arg3;sig=2}}var loadedRule,rsi,msgId,fn;if(sig){rsi=core._ruleSets.getRsiFromMsgId(msgId);if(rsi<0){return""}loadedRule=core._ruleSets.getLoadedRule(rsi,ruleName);fn=short?loadedRule.getShortDescription.bind(loadedRule):loadedRule.getDescription.bind(loadedRule);ret=fn()}return ret};Api.prototype.getRulesetInfo=function(fmt,active){var ret,core=this._core;active=typeof active==="undefined"?true:active;if(fmt===OUTFMT.JSON)ret=core._rules.getRulesJson(active);else if(fmt===OUTFMT.PROSE||fmt===OUTFMT.LINE)ret=core._rules.getRulesProse(active);else ret=core._rules.getRulesSonar(active);return ret};Api.prototype.enableMsgId=function(msgid,state){var ret=false;var core=this._core;if(core._config.setMessages(msgid,state)){core._reporter.setMessageFilter(core._config._config.messages);ret=true}return ret};Api.prototype.getConfig=function(){return this._core._config.getConfig()};Api.prototype.getSevLib=function(){return this._core._severity.getSevLib()};Api.prototype.getInfo=function(){return this._core._getInfo()};Api.prototype.setMarker=function(mark){return this._core.setMarker(mark)};Api.prototype.getMarker=function(){return this._core.getMarker()};Api.prototype.setVsCodeExtHint=function(isVsCodeExt){this._core._VsCodeExtHint=isVsCodeExt};function _shortStackMsg(e){let x,x2=0,m=e.stack||e;if((x=m.indexOf("\n"))>0){if((x2=m.indexOf("\n",x+1))<0){x2=x}}if(x2){m=m.substring(0,x2)}return m};module.exports=Api;
6
+ const OUTFMT=require("./outFormat");const UNDEF="undefined";function Api(nodeDeps,JafCore){this._core=JafCore;this._stats=JafCore.getStats();this._nd=nodeDeps};Api.prototype.startSync=function(apiContext){var core=this._core;core._ctxCB=apiContext;if(apiContext.config){let t=typeof apiContext.config;if(t==="string"){core._configPath=this._nd.path.join(core._curDir,apiContext.config)}else if(t==="object"){core._configPath=apiContext.config}else{core._error("Invalid config argument in init() : type is "+t);return 1}}if(apiContext.format&&apiContext.format!==OUTFMT.PROSE){apiContext.format=OUTFMT.PROSE}return core.start()};Api.prototype.start=function(apiContext,AmdMeta,AmdRulePacks){var t,_self,rc;this._core._isAsync=true;this._core._ctxCB=apiContext;_self=this;return new Promise(function(resolve,reject){let core=_self._core;setTimeout(()=>{try{if(apiContext.config){t=typeof apiContext.config;if(t==="string"){core._configPath=_self._nd.path.join(core._curDir,apiContext.config)}else if(t==="object"){core._configPath=apiContext.config}else{core._error("Invalid config argument in init() : type is "+t);reject(1)}}if(!core._isAMD){core._isAsync=false;core._isAsyncTemp=true;rc=_self.startSync(apiContext);core._isAsync=true;rc===0?resolve(rc):reject(core._messageStack)}else{if(apiContext.format&&apiContext.format!==OUTFMT.PROSE){apiContext.format=OUTFMT.PROSE}core._isAsync=false;core._isAsyncTemp=true;core._AmdMeta=AmdMeta;core._AmdRulePacks=AmdRulePacks;if(AmdRulePacks&&!Array.isArray(AmdRulePacks)){core._error("init() : AMD rule packs must be specified as an array!");reject(1);return}rc=_self.startSync(apiContext);core._isAsync=true;rc===0?resolve(rc):reject(core._messageStack)}}catch(e){reject(core._messageStack)}},0)})};Api.prototype.auditSync=function(filespec){var core=this._core;core._isAsync=false;this._stats.clearAll();if(core._regListenerTypesSet||core._rules&&core._rules.getActiveRuleCount()===0){if(core._rules){core._emitApiRunSummary()}return}if(filespec){if(!Array.isArray(filespec)){filespec=[filespec]}core._fileSet.setFiles(filespec,core._config.getExclude(),core._getMsgCtx())}core._startLifeCycle();core._emitApiRunSummary()};Api.prototype.audit=function(filespec){var rc,_self,core=this._core;core._isAsync=true;this._stats.clearAll();if(filespec){if(!Array.isArray(filespec)){filespec=[filespec]}core._fileSet.setFiles(filespec,core._config.getExclude(),core._getMsgCtx())}_self=this;return new Promise((resolve,reject)=>{setTimeout(()=>{try{_self._core._isAsync=false;rc=_self._core._startLifeCycle();_self._core._isAsync=true;_self._core._emitApiRunSummary();rc?resolve(core._isAPI?rc:0):reject(1)}catch(e){let m=`[JAF-9010] Internal Error:\n${_shortStackMsg(e)}`;core._error(m);reject(m)}},0)})};Api.prototype.on=function(evName,fn,obj){if(this._core._listenerSetup()){this._core._events.setListener(evName,fn,obj)}};Api.prototype.removeListener=function(evName,fn){if(this._core._listenerSetup()){this._core._events.removeListener(evName,fn)}};Api.prototype.removeAllListeners=function(evName){if(this._core._listenerSetup()){this._core._events.removeAllListeners(evName)}};Api.prototype.getDescription=function(arg1,arg2,arg3){var issue,short,ruleName,sig=0,ret="";var core=this._core;var arg1Type=core._Utils.getType(arg1);var arg2Type=core._Utils.getType(arg2);if(arg1Type==="object"){issue=arg1;if(arg2==="boolean"||arg2Type===UNDEF){short=arg2;sig=1;ruleName=issue.rule;msgId=issue.msgId}}else if(arg1Type==="string"){if(arg2Type==="string"){msgId=arg1;ruleName=arg2;short=!!arg3;sig=2}}var loadedRule,rsi,msgId,fn;if(sig){rsi=core._ruleSets.getRsiFromMsgId(msgId);if(rsi<0){return""}loadedRule=core._ruleSets.getLoadedRule(rsi,ruleName);fn=short?loadedRule.getShortDescription.bind(loadedRule):loadedRule.getDescription.bind(loadedRule);ret=fn()}return ret};Api.prototype.getRulesetInfo=function(fmt,active){var ret,core=this._core;active=typeof active==="undefined"?true:active;if(fmt===OUTFMT.JSON)ret=core._rules.getRulesJson(active);else if(fmt===OUTFMT.PROSE||fmt===OUTFMT.LINE)ret=core._rules.getRulesProse(active);else ret=core._rules.getRulesSonar(active);return ret};Api.prototype.enableMsgId=function(msgid,state){var ret=false;var core=this._core;if(core._config.setMessages(msgid,state)){core._reporter.setMessageFilter(core._config._config.messages);ret=true}return ret};Api.prototype.getConfig=function(){return this._core._config.getConfig()};Api.prototype.getSevLib=function(){return this._core._severity.getSevLib()};Api.prototype.getInfo=function(){return this._core._getInfo()};Api.prototype.setMarker=function(mark){return this._core.setMarker(mark)};Api.prototype.getMarker=function(){return this._core.getMarker()};Api.prototype.setVsCodeExtHint=function(isVsCodeExt){this._core._VsCodeExtHint=isVsCodeExt};function _shortStackMsg(e){let x,x2=0,m=e.stack||e;if((x=m.indexOf("\n"))>0){if((x2=m.indexOf("\n",x+1))<0){x2=x}}if(x2){m=m.substring(0,x2)}return m};module.exports=Api;
package/lib/checkage.js CHANGED
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const BUILT="2022-07-12T01:49:42.958Z";function CheckAge(msgCtx){this._jetRels=-1;this._msgCtx=msgCtx}CheckAge.prototype.checkAge=function(){var ret=true;var monthsToRelease=0;var curDate=new Date;var buildDate=BUILT!=="@BUILT@"?new Date(BUILT):curDate;var buildMonth=buildDate.getMonth()+1;var months=_getElapsedMonths(buildDate,curDate);this._jetRels=_getReleases(buildMonth,months);if(months&&months<7){if(buildMonth<2){monthsToRelease=1}else{monthsToRelease=8-buildMonth}}if(months>monthsToRelease){this._emitMsg(months);ret=false}return ret};CheckAge.prototype.getJetReleaseCount=function(){return this._jetRels};CheckAge.prototype._emitMsg=function(old){var INDENT=" ".repeat(8);var s,h,p;if(this._jetRels){s=""+this._jetRels;if(this._jetRels===1){h="has";p=""}else{h="have";p="s"}}else{s="at least one";h="has";p=""}var s=`\nThis version of JAF is ${old} months old, and there ${h} been ${s} scheduled public\n`+`${INDENT}major JET release${p}, together with JAF updates and fixes. It is strongly\n`+INDENT+"recommended that you install the latest version of JAF. [JAF-9100]\n";this._msgCtx.warn(s,true)};function _getElapsedMonths(start,end){return end.getMonth()-start.getMonth()+12*(end.getFullYear()-start.getFullYear())};function _getReleases(buildMonth,months){var toNextRel,releases=0;if(buildMonth===1){toNextRel=0}else if(buildMonth>1&&buildMonth<7){toNextRel=7-buildMonth}else if(buildMonth===7){toNextRel=0}else{toNextRel=13-buildMonth}if((releases=months-toNextRel)>=0){releases=1+Math.floor(releases/6)}else{releases=0}return releases};module.exports=CheckAge;
6
+ const BUILT="2022-08-03T02:59:38.175Z";function CheckAge(msgCtx){this._jetRels=-1;this._msgCtx=msgCtx}CheckAge.prototype.checkAge=function(){var ret=true;var monthsToRelease=0;var curDate=new Date;var buildDate=BUILT!=="@BUILT@"?new Date(BUILT):curDate;var buildMonth=buildDate.getMonth()+1;var months=_getElapsedMonths(buildDate,curDate);this._jetRels=_getReleases(buildMonth,months);if(months&&months<7){if(buildMonth<2){monthsToRelease=1}else{monthsToRelease=8-buildMonth}}if(months>monthsToRelease){this._emitMsg(months);ret=false}return ret};CheckAge.prototype.getJetReleaseCount=function(){return this._jetRels};CheckAge.prototype._emitMsg=function(old){var INDENT=" ".repeat(8);var s,h,p;if(this._jetRels){s=""+this._jetRels;if(this._jetRels===1){h="has";p=""}else{h="have";p="s"}}else{s="at least one";h="has";p=""}var s=`\nThis version of JAF is ${old} months old, and there ${h} been ${s} scheduled public\n`+`${INDENT}major JET release${p}, together with JAF updates and fixes. It is strongly\n`+INDENT+"recommended that you install the latest version of JAF. [JAF-9100]\n";this._msgCtx.warn(s,true)};function _getElapsedMonths(start,end){return end.getMonth()-start.getMonth()+12*(end.getFullYear()-start.getFullYear())};function _getReleases(buildMonth,months){var toNextRel,releases=0;if(buildMonth===1){toNextRel=0}else if(buildMonth>1&&buildMonth<7){toNextRel=7-buildMonth}else if(buildMonth===7){toNextRel=0}else{toNextRel=13-buildMonth}if((releases=months-toNextRel)>=0){releases=1+Math.floor(releases/6)}else{releases=0}return releases};module.exports=CheckAge;
package/lib/defaults.js CHANGED
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const defaults={JETVER:'13.0.0'.replace(/(\d*\.\d*)(\.\d*)+$/g,'$1')+'.0',THEME:'Alta',ECMAVER:11};module.exports=defaults;
6
+ const defaults={JETVER:'13.0.1'.replace(/(\d*\.\d*)(\.\d*)+$/g,'$1')+'.0',THEME:'Alta',ECMAVER:11};module.exports=defaults;