pict 1.0.284 → 1.0.285

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.
@@ -5101,7 +5101,7 @@ try{if(!global.localStorage)return false;}catch(_){return false;}var val=global.
5101
5101
  // presumably different callback function.
5102
5102
  // This makes sure that own properties are retained, so that
5103
5103
  // decorations and such are not lost along the way.
5104
- module.exports=wrappy;function wrappy(fn,cb){if(fn&&cb)return wrappy(fn)(cb);if(typeof fn!=='function')throw new TypeError('need wrapper function');Object.keys(fn).forEach(function(k){wrapper[k]=fn[k];});return wrapper;function wrapper(){var args=new Array(arguments.length);for(var i=0;i<args.length;i++){args[i]=arguments[i];}var ret=fn.apply(this,args);var cb=args[args.length-1];if(typeof ret==='function'&&ret!==cb){Object.keys(cb).forEach(function(k){ret[k]=cb[k];});}return ret;}}},{}],190:[function(require,module,exports){module.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;function extend(){var target={};for(var i=0;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;}},{}],191:[function(require,module,exports){module.exports={"name":"pict","version":"1.0.284","description":"Pict browser library.","main":"source/Pict.js","scripts":{"start":"node source/Pict.js","test":"npx mocha -u tdd -R spec","tests":"npx mocha -u tdd --exit -R spec --grep","coverage":"npx nyc --reporter=lcov --reporter=text-lcov npx mocha -- -u tdd -R spec","build":"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-image:local","docker-dev-run":"docker run -it -d --name pict-dev -p 37447:8080 -p 19506:8086 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/pict\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" pict-image:local","docker-dev-shell":"docker exec -it pict-dev /bin/bash","lint":"eslint source/**/*.js test/**/*.js","types":"tsc -p ."},"types":"types/source/Pict.d.ts","mocha":{"diff":true,"extension":["js"],"package":"./package.json","reporter":"spec","slow":"75","timeout":"5000","ui":"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},"repository":{"type":"git","url":"git+https://stevenvelozo@github.com/stevenvelozo/pict.git"},"author":"steven velozo <steven@velozo.com>","license":"MIT","bugs":{"url":"https://github.com/stevenvelozo/pict/issues"},"homepage":"https://github.com/stevenvelozo/pict#readme","devDependencies":{"@eslint/js":"^9.27.0","@types/jquery":"^3.5.32","@types/sinon":"^17.0.4","eslint":"^9.27.0","globals":"^16.2.0","quackage":"^1.0.42","sinon":"^20.0.0","typescript":"^5.8.3"},"dependencies":{"cachetrax":"^1.0.4","fable":"^3.1.16","pict-application":"^1.0.27","pict-provider":"^1.0.6","pict-template":"^1.0.12","pict-view":"^1.0.62"}};},{}],192:[function(require,module,exports){// This assumes Pict has been required in the browser. Delcare these as globals so linter can do its job.
5104
+ module.exports=wrappy;function wrappy(fn,cb){if(fn&&cb)return wrappy(fn)(cb);if(typeof fn!=='function')throw new TypeError('need wrapper function');Object.keys(fn).forEach(function(k){wrapper[k]=fn[k];});return wrapper;function wrapper(){var args=new Array(arguments.length);for(var i=0;i<args.length;i++){args[i]=arguments[i];}var ret=fn.apply(this,args);var cb=args[args.length-1];if(typeof ret==='function'&&ret!==cb){Object.keys(cb).forEach(function(k){ret[k]=cb[k];});}return ret;}}},{}],190:[function(require,module,exports){module.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;function extend(){var target={};for(var i=0;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;}},{}],191:[function(require,module,exports){module.exports={"name":"pict","version":"1.0.285","description":"Pict browser library.","main":"source/Pict.js","scripts":{"start":"node source/Pict.js","test":"npx mocha -u tdd -R spec","tests":"npx mocha -u tdd --exit -R spec --grep","coverage":"npx nyc --reporter=lcov --reporter=text-lcov npx mocha -- -u tdd -R spec","build":"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-image:local","docker-dev-run":"docker run -it -d --name pict-dev -p 37447:8080 -p 19506:8086 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/pict\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" pict-image:local","docker-dev-shell":"docker exec -it pict-dev /bin/bash","lint":"eslint source/**/*.js test/**/*.js","types":"tsc -p ."},"types":"types/source/Pict.d.ts","mocha":{"diff":true,"extension":["js"],"package":"./package.json","reporter":"spec","slow":"75","timeout":"5000","ui":"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},"repository":{"type":"git","url":"git+https://stevenvelozo@github.com/stevenvelozo/pict.git"},"author":"steven velozo <steven@velozo.com>","license":"MIT","bugs":{"url":"https://github.com/stevenvelozo/pict/issues"},"homepage":"https://github.com/stevenvelozo/pict#readme","devDependencies":{"@eslint/js":"^9.27.0","@types/jquery":"^3.5.32","@types/sinon":"^17.0.4","eslint":"^9.27.0","globals":"^16.2.0","quackage":"^1.0.42","sinon":"^20.0.0","typescript":"^5.8.3"},"dependencies":{"cachetrax":"^1.0.4","fable":"^3.1.16","pict-application":"^1.0.27","pict-provider":"^1.0.6","pict-template":"^1.0.12","pict-view":"^1.0.62"}};},{}],192:[function(require,module,exports){// This assumes Pict has been required in the browser. Delcare these as globals so linter can do its job.
5105
5105
  /* global Pict, _Pict: writeable *//**
5106
5106
  * Simple function to load a pict Application
5107
5107
  *
@@ -5279,8 +5279,8 @@ if(!('Entity'in pEntityInformation)||typeof pEntityInformation.Entity!='string')
5279
5279
  if(!('PageSize'in pEntityInformation)||typeof pEntityInformation.PageSize!='number'){//TODO: this is a safety measure to try and not break things when we release this pict version; should be a lower value
5280
5280
  pEntityInformation.PageSize=10000;}if(!('AllRecords'in pEntityInformation)||typeof pEntityInformation.AllRecords!='boolean'){pEntityInformation.AllRecords=false;}var tmpRecordStartCursor=null;var tmpPageSize=null;if(pEntityInformation.PageSize){tmpRecordStartCursor=pEntityInformation.RecordStartCursor;tmpPageSize=pEntityInformation.PageSize;}// Parse the filter template
5281
5281
  var tmpFilterString=this.fable.parseTemplate(pEntityInformation.Filter,pContext);// Create a callback function to handle receiving the record set
5282
- var fRecordFetchComplete=function fRecordFetchComplete(pError,pRecordSet){if(pError){_this76.log.error("EntityBundleRequest request Error getting entity set for [".concat(pEntityInformation.Entity,"] with filter [").concat(tmpFilterString,"]: ").concat(pError),pError);return fCallback(pError,'');}_this76.log.trace("EntityBundleRequest found ".concat(pRecordSet.length," records for ").concat(pEntityInformation.Entity," filtered to [").concat(tmpFilterString,"]").concat(!pEntityInformation.CountOnly&&!pEntityInformation.AllRecords?" [".concat(tmpRecordStartCursor,"/").concat(tmpPageSize,"]"):''));if(pEntityInformation.CountOnly){_this76.fable.manifest.setValueByHash(pContext,pEntityInformation.Destination,pRecordSet);}// Now assign it back to the destination; because this is not view specific it doesn't use the manifests from them (to deal with scope overlap with subgrids).
5283
- else if(pEntityInformation.SingleRecord){if(pRecordSet.length>1){_this76.log.warn("EntityBundleRequest found more than one record for ".concat(pEntityInformation.Entity," filtered to [").concat(tmpFilterString,"] but SingleRecord is true; setting the first record."));}if(pRecordSet.length<1){_this76.fable.manifest.setValueByHash(pContext,pEntityInformation.Destination,false);}_this76.fable.manifest.setValueByHash(pContext,pEntityInformation.Destination,pRecordSet[0]);}else{_this76.fable.manifest.setValueByHash(pContext,pEntityInformation.Destination,pRecordSet);}return fCallback();};if(pEntityInformation.CountOnly){this.getEntitySetRecordCount(pEntityInformation.Entity,tmpFilterString,fRecordFetchComplete);}else if(tmpPageSize&&!pEntityInformation.AllRecords){this.getEntitySetPage(pEntityInformation.Entity,tmpFilterString,tmpRecordStartCursor,tmpPageSize,fRecordFetchComplete);}else{this.getEntitySet(pEntityInformation.Entity,tmpFilterString,fRecordFetchComplete);}}},{key:"mapJoinSingleDestination",value:function mapJoinSingleDestination(pDestinationEntity,pCustomRequestInformation,pContext){var tmpSourceEntities=this.fable.manifest.getValueByHash(pContext,pCustomRequestInformation.JoinRecordSetAddress);if(!Array.isArray(tmpSourceEntities)){throw new Error("EntityBundleRequest failed to map join because the source [".concat(pCustomRequestInformation.JoinRecordSetAddress,"] did not return an array."));}var tmpSourceLookup={};var _iterator3=_createForOfIteratorHelper(tmpSourceEntities),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var tmpSourceEntity=_step3.value;var tmpSourceJoinValue=tmpSourceEntity[pCustomRequestInformation.JoinValue];tmpSourceLookup[tmpSourceJoinValue]=tmpSourceEntity;}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}var _iterator4=_createForOfIteratorHelper(tmpSourceEntities),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _tmpSourceEntity=_step4.value;if(!_tmpSourceEntity){this.log.error("EntityBundleRequest failed to map join because the source entity was not found in the source lookup.");continue;}if(pCustomRequestInformation.BucketBy||pCustomRequestInformation.BucketByTemplate){var tmpBucketValues=[];if(pCustomRequestInformation.BucketBy){var tmpBucketByKeys=Array.isArray(pCustomRequestInformation.BucketBy)?pCustomRequestInformation.BucketBy:[pCustomRequestInformation.BucketBy];var _iterator5=_createForOfIteratorHelper(tmpBucketByKeys),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var tmpBucketByKey=_step5.value;var tmpBucketValue=this.fable.manifest.getValueByHash(_tmpSourceEntity,tmpBucketByKey);tmpBucketValues.push(tmpBucketValue);}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}}else{var tmpBucketByTemplates=Array.isArray(pCustomRequestInformation.BucketByTemplate)?pCustomRequestInformation.BucketByTemplate:[pCustomRequestInformation.BucketByTemplate];var _iterator6=_createForOfIteratorHelper(tmpBucketByTemplates),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var tmpBucketByTemplate=_step6.value;var _tmpBucketValue=this.fable.parseTemplate(tmpBucketByTemplate,_tmpSourceEntity);if(_tmpBucketValue){tmpBucketValues.push(_tmpBucketValue);}}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}}if(tmpBucketValues.length<1){if(this.fable.LogNoisiness>0){this.log.warn("EntityBundleRequest failed to map join because no bucket values were found.",{pCustomRequestInformation:pCustomRequestInformation,tmpSourceEntity:_tmpSourceEntity});}}else{var tmpBucketAddress="".concat(pCustomRequestInformation.RecordDestinationAddress,".").concat(tmpBucketValues.join('.'));if(pCustomRequestInformation.SingleRecord){//TODO: warn if there is a collision?
5282
+ var fRecordFetchComplete=function fRecordFetchComplete(pError,pRecordSet){if(pError){_this76.log.error("EntityBundleRequest request Error getting entity set for [".concat(pEntityInformation.Entity,"] with filter [").concat(tmpFilterString,"]: ").concat(pError),pError);return fCallback(pError,'');}if(pEntityInformation.CountOnly){_this76.log.trace("EntityBundleRequest counted ".concat(pRecordSet," records for ").concat(pEntityInformation.Entity," filtered to [").concat(tmpFilterString,"]").concat(!pEntityInformation.CountOnly&&!pEntityInformation.AllRecords?" [".concat(tmpRecordStartCursor,"/").concat(tmpPageSize,"]"):''));_this76.fable.manifest.setValueByHash(pContext,pEntityInformation.Destination,pRecordSet);}// Now assign it back to the destination; because this is not view specific it doesn't use the manifests from them (to deal with scope overlap with subgrids).
5283
+ else if(pEntityInformation.SingleRecord){_this76.log.trace("EntityBundleRequest found ".concat(pRecordSet.length," records for ").concat(pEntityInformation.Entity," filtered to [").concat(tmpFilterString,"]").concat(!pEntityInformation.CountOnly&&!pEntityInformation.AllRecords?" [".concat(tmpRecordStartCursor,"/").concat(tmpPageSize,"]"):''));if(pRecordSet.length>1){_this76.log.warn("EntityBundleRequest found more than one record for ".concat(pEntityInformation.Entity," filtered to [").concat(tmpFilterString,"] but SingleRecord is true; setting the first record."));}if(pRecordSet.length<1){_this76.fable.manifest.setValueByHash(pContext,pEntityInformation.Destination,false);}_this76.fable.manifest.setValueByHash(pContext,pEntityInformation.Destination,pRecordSet[0]);}else{_this76.log.trace("EntityBundleRequest found ".concat(pRecordSet.length," records for ").concat(pEntityInformation.Entity," filtered to [").concat(tmpFilterString,"]").concat(!pEntityInformation.CountOnly&&!pEntityInformation.AllRecords?" [".concat(tmpRecordStartCursor,"/").concat(tmpPageSize,"]"):''));_this76.fable.manifest.setValueByHash(pContext,pEntityInformation.Destination,pRecordSet);}return fCallback();};if(pEntityInformation.CountOnly){this.getEntitySetRecordCount(pEntityInformation.Entity,tmpFilterString,fRecordFetchComplete);}else if(tmpPageSize&&!pEntityInformation.AllRecords){this.getEntitySetPage(pEntityInformation.Entity,tmpFilterString,tmpRecordStartCursor,tmpPageSize,fRecordFetchComplete);}else{this.getEntitySet(pEntityInformation.Entity,tmpFilterString,fRecordFetchComplete);}}},{key:"mapJoinSingleDestination",value:function mapJoinSingleDestination(pDestinationEntity,pCustomRequestInformation,pContext){var tmpSourceEntities=this.fable.manifest.getValueByHash(pContext,pCustomRequestInformation.JoinRecordSetAddress);if(!Array.isArray(tmpSourceEntities)){throw new Error("EntityBundleRequest failed to map join because the source [".concat(pCustomRequestInformation.JoinRecordSetAddress,"] did not return an array."));}var tmpSourceLookup={};var _iterator3=_createForOfIteratorHelper(tmpSourceEntities),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var tmpSourceEntity=_step3.value;var tmpSourceJoinValue=tmpSourceEntity[pCustomRequestInformation.JoinValue];tmpSourceLookup[tmpSourceJoinValue]=tmpSourceEntity;}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}var _iterator4=_createForOfIteratorHelper(tmpSourceEntities),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _tmpSourceEntity=_step4.value;if(!_tmpSourceEntity){this.log.error("EntityBundleRequest failed to map join because the source entity was not found in the source lookup.");continue;}if(pCustomRequestInformation.BucketBy||pCustomRequestInformation.BucketByTemplate){var tmpBucketValues=[];if(pCustomRequestInformation.BucketBy){var tmpBucketByKeys=Array.isArray(pCustomRequestInformation.BucketBy)?pCustomRequestInformation.BucketBy:[pCustomRequestInformation.BucketBy];var _iterator5=_createForOfIteratorHelper(tmpBucketByKeys),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var tmpBucketByKey=_step5.value;var tmpBucketValue=this.fable.manifest.getValueByHash(_tmpSourceEntity,tmpBucketByKey);tmpBucketValues.push(tmpBucketValue);}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}}else{var tmpBucketByTemplates=Array.isArray(pCustomRequestInformation.BucketByTemplate)?pCustomRequestInformation.BucketByTemplate:[pCustomRequestInformation.BucketByTemplate];var _iterator6=_createForOfIteratorHelper(tmpBucketByTemplates),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var tmpBucketByTemplate=_step6.value;var _tmpBucketValue=this.fable.parseTemplate(tmpBucketByTemplate,_tmpSourceEntity);if(_tmpBucketValue){tmpBucketValues.push(_tmpBucketValue);}}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}}if(tmpBucketValues.length<1){if(this.fable.LogNoisiness>0){this.log.warn("EntityBundleRequest failed to map join because no bucket values were found.",{pCustomRequestInformation:pCustomRequestInformation,tmpSourceEntity:_tmpSourceEntity});}}else{var tmpBucketAddress="".concat(pCustomRequestInformation.RecordDestinationAddress,".").concat(tmpBucketValues.join('.'));if(pCustomRequestInformation.SingleRecord){//TODO: warn if there is a collision?
5284
5284
  this.fable.manifest.setValueByHash(pDestinationEntity,tmpBucketAddress,_tmpSourceEntity);}else{var tmpBucketArray=this.fable.manifest.getValueByHash(pDestinationEntity,tmpBucketAddress,_tmpSourceEntity);if(!tmpBucketArray){tmpBucketArray=[];this.fable.manifest.setValueByHash(pDestinationEntity,tmpBucketAddress,tmpBucketArray);}tmpBucketArray.push(_tmpSourceEntity);}}}else if(pCustomRequestInformation.SingleRecord){if(pDestinationEntity[pCustomRequestInformation.RecordDestinationAddress]&&this.fable.LogNoisiness>1){this.fable.log.warn("EntityBundleRequest found more than one record for [".concat(pCustomRequestInformation.RecordDestinationAddress,"] in mapJoin mapped as SingleRecord."));}pDestinationEntity[pCustomRequestInformation.RecordDestinationAddress]=_tmpSourceEntity;}else{pDestinationEntity[pCustomRequestInformation.RecordDestinationAddress]=pDestinationEntity[pCustomRequestInformation.RecordDestinationAddress]||[];pDestinationEntity[pCustomRequestInformation.RecordDestinationAddress].push(_tmpSourceEntity);}}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}return[pDestinationEntity];}},{key:"mapJoin",value:function mapJoin(pCustomRequestInformation,pContext){var tmpSingleDestinationEntity=pCustomRequestInformation.DestinationRecordAddress?this.fable.manifest.getValueByHash(pContext,pCustomRequestInformation.DestinationRecordAddress):null;var tmpDestinationEntities=pCustomRequestInformation.DestinationRecordSetAddress?this.fable.manifest.getValueByHash(pContext,pCustomRequestInformation.DestinationRecordSetAddress):null;if(!Array.isArray(tmpDestinationEntities)&&!tmpSingleDestinationEntity){throw new Error("EntityBundleRequest failed to map join because the destination [".concat(pCustomRequestInformation.DestinationRecordSetAddress,"] did not return an array."));}if(tmpSingleDestinationEntity){return this.mapJoinSingleDestination(tmpSingleDestinationEntity,pCustomRequestInformation,pContext);}var tmpJoinEntities=this.fable.manifest.getValueByHash(pContext,pCustomRequestInformation.Joins);if(!Array.isArray(tmpJoinEntities)){throw new Error("EntityBundleRequest failed to map join because the join [".concat(pCustomRequestInformation.Joins,"] did not return an array."));}var tmpSourceEntities=this.fable.manifest.getValueByHash(pContext,pCustomRequestInformation.JoinRecordSetAddress);if(!Array.isArray(tmpSourceEntities)){throw new Error("EntityBundleRequest failed to map join because the source [".concat(pCustomRequestInformation.JoinRecordSetAddress,"] did not return an array."));}var tmpLHSJoinKey=pCustomRequestInformation.JoinJoinValueLHS||pCustomRequestInformation.DestinationJoinValue;var tmpRHSJoinKey=pCustomRequestInformation.JoinJoinValueRHS||pCustomRequestInformation.JoinValue;var tmpDestinationLookup={};var tmpSourceLookup={};var tmpJoinMap={};var _iterator7=_createForOfIteratorHelper(tmpDestinationEntities||[]),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _tmpDestinationEntity=_step7.value;var tmpDestinationJoinValue=_tmpDestinationEntity[pCustomRequestInformation.DestinationJoinValue];tmpDestinationLookup[tmpDestinationJoinValue]=_tmpDestinationEntity;}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}var _iterator8=_createForOfIteratorHelper(tmpSourceEntities),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var _tmpSourceEntity2=_step8.value;var tmpSourceJoinValue=_tmpSourceEntity2[pCustomRequestInformation.JoinValue];tmpSourceLookup[tmpSourceJoinValue]=_tmpSourceEntity2;}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}var _iterator9=_createForOfIteratorHelper(tmpJoinEntities),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var tmpJoinEntity=_step9.value;var _tmpLHSJoinValue=tmpJoinEntity[tmpLHSJoinKey];var _tmpRHSJoinValue=tmpJoinEntity[tmpRHSJoinKey];tmpJoinMap[_tmpLHSJoinValue]=tmpJoinMap[_tmpLHSJoinValue]||new Set();tmpJoinMap[_tmpLHSJoinValue].add(_tmpRHSJoinValue);}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}for(var _i62=0,_Object$keys=Object.keys(tmpJoinMap);_i62<_Object$keys.length;_i62++){var tmpLHSJoinValue=_Object$keys[_i62];var tmpRHSJoinValues=Array.from(tmpJoinMap[tmpLHSJoinValue]);var tmpDestinationEntity=tmpDestinationLookup[tmpLHSJoinValue];if(!tmpDestinationEntity){this.log.error("EntityBundleRequest failed to map join because the LHS join value [".concat(tmpLHSJoinValue,"] was not found in the destination lookup."));continue;}for(var _i63=0,_tmpRHSJoinValues=tmpRHSJoinValues;_i63<_tmpRHSJoinValues.length;_i63++){var tmpRHSJoinValue=_tmpRHSJoinValues[_i63];var tmpSourceEntity=tmpSourceLookup[tmpRHSJoinValue];if(!tmpSourceEntity){this.log.error("EntityBundleRequest failed to map join because the RHS join value [".concat(tmpRHSJoinValue,"] was not found in the source lookup."));continue;}if(pCustomRequestInformation.BucketBy||pCustomRequestInformation.BucketByTemplate){var tmpBucketValues=[];if(pCustomRequestInformation.BucketBy){var tmpBucketByKeys=Array.isArray(pCustomRequestInformation.BucketBy)?pCustomRequestInformation.BucketBy:[pCustomRequestInformation.BucketBy];var _iterator0=_createForOfIteratorHelper(tmpBucketByKeys),_step0;try{for(_iterator0.s();!(_step0=_iterator0.n()).done;){var tmpBucketByKey=_step0.value;var tmpBucketValue=this.fable.manifest.getValueByHash(tmpSourceEntity,tmpBucketByKey);tmpBucketValues.push(tmpBucketValue);}}catch(err){_iterator0.e(err);}finally{_iterator0.f();}}else{var tmpBucketByTemplates=Array.isArray(pCustomRequestInformation.BucketByTemplate)?pCustomRequestInformation.BucketByTemplate:[pCustomRequestInformation.BucketByTemplate];var _iterator1=_createForOfIteratorHelper(tmpBucketByTemplates),_step1;try{for(_iterator1.s();!(_step1=_iterator1.n()).done;){var tmpBucketByTemplate=_step1.value;var _tmpBucketValue2=this.fable.parseTemplate(tmpBucketByTemplate,tmpSourceEntity);tmpBucketValues.push(_tmpBucketValue2);}}catch(err){_iterator1.e(err);}finally{_iterator1.f();}}if(!tmpDestinationEntity[pCustomRequestInformation.RecordDestinationAddress]){tmpDestinationEntity[pCustomRequestInformation.RecordDestinationAddress]={};}var tmpBucketAddress="".concat(pCustomRequestInformation.RecordDestinationAddress,".").concat(tmpBucketValues.join('.'));if(pCustomRequestInformation.SingleRecord){//TODO: warn if there is a collision?
5285
5285
  this.fable.manifest.setValueByHash(tmpDestinationEntity,tmpBucketAddress,tmpSourceEntity);}else{var tmpBucketArray=this.fable.manifest.getValueByHash(tmpDestinationEntity,tmpBucketAddress,tmpSourceEntity);if(!tmpBucketArray){tmpBucketArray=[];this.fable.manifest.setValueByHash(tmpDestinationEntity,tmpBucketAddress,tmpBucketArray);}tmpBucketArray.push(tmpSourceEntity);}}else if(pCustomRequestInformation.SingleRecord){if(tmpDestinationEntity[pCustomRequestInformation.RecordDestinationAddress]&&this.fable.LogNoisiness>1){this.fable.log.warn("EntityBundleRequest found more than one record for [".concat(pCustomRequestInformation.RecordDestinationAddress,"] in mapJoin mapped as SingleRecord."));}tmpDestinationEntity[pCustomRequestInformation.RecordDestinationAddress]=tmpSourceEntity;}else{tmpDestinationEntity[pCustomRequestInformation.RecordDestinationAddress]=tmpDestinationEntity[pCustomRequestInformation.RecordDestinationAddress]||[];tmpDestinationEntity[pCustomRequestInformation.RecordDestinationAddress].push(tmpSourceEntity);}}}return tmpDestinationEntities;}/**
5286
5286
  * ExampleConfig:
@@ -5840,7 +5840,12 @@ if(tmpFilterConfig.Type=='InternalJoinDateRange'){if((!tmpFilterConfig.Values.St
5840
5840
  */},{key:"compileMeadowFilterStanzas",value:function compileMeadowFilterStanzas(pFilterState){var _this86=this;var tmpBundleConfig=[];//TODO: mathematically solve the number line
5841
5841
  // planned synthesized syntax for running on the server
5842
5842
  // FBV-3_Author~Name~LK~%25Ann%25~FBL-2_BookAuthorJoin~IDAuthor~INN~{~PJU:,^State[Step-3]^IDAuthor~}~FBV-1~User~NameFirst~LK~%25Bob%25~FBVOR-1~User~NameLast~LK~%25Bob%25~FBV~CreateDate~GT~2023-01-01T00:00:00Z~FBV~CreateDate~LT~2024-01-01T00:00:00Z~FBL~IDBook~INN~{~PJU:,^State[Step-2]^IDBook~}
5843
- if(!pFilterState.Filter){pFilterState.Filter="".concat(pFilterState.Entity||'Unknown',"-").concat(this.pict.getUUID());}tmpBundleConfig.push({Type:'SetStateAddress',StateAddress:"Bundle[".concat(pFilterState.Filter,"]")});var tmpGroupedFilters={};var tmpGroupedFilterKeys=[];var tmpGroupedCoreFilters=[];var tmpGroupedCoreFilterKeys=[];var tmpCoreEntity;var tmpCoreFilterStrings=[];var _iterator30=_createForOfIteratorHelper(pFilterState.PreparedFilters),_step30;try{for(_iterator30.s();!(_step30=_iterator30.n()).done;){var tmpFilterGroup=_step30.value;var _iterator32=_createForOfIteratorHelper(tmpFilterGroup.Filters),_step32;try{var _loop5=function _loop5(){var tmpFilter=_step32.value;if(tmpFilter.CoreEntity){tmpCoreEntity=tmpFilter.Entity;var tmpFilterGUID="".concat(tmpFilterGroup.GUID,"-").concat(tmpFilter.ComputedIndex);if(!tmpGroupedCoreFilterKeys.find(function(v){return v==tmpFilterGUID;})){tmpGroupedCoreFilterKeys.push(tmpFilterGUID);}if(!tmpGroupedCoreFilters[tmpFilterGUID]){tmpGroupedCoreFilters[tmpFilterGUID]={Stanzas:[],ComputedIndex:tmpFilter.ComputedIndex,Entity:tmpFilter.Entity};}tmpGroupedCoreFilters[tmpFilterGUID].Stanzas.push(_this86._compileSimpleFilterToString(tmpFilter));}else{var tmpFilterGroupGUID="".concat(tmpFilterGroup.GUID,"-").concat(tmpFilter.ComputedIndex);if(!tmpGroupedFilterKeys.find(function(v){return v==tmpFilterGroupGUID;})){tmpGroupedFilterKeys.push(tmpFilterGroupGUID);}if(!tmpGroupedFilters[tmpFilterGroupGUID]){tmpGroupedFilters[tmpFilterGroupGUID]={Stanzas:[],ComputedIndex:tmpFilter.ComputedIndex,Entity:tmpFilter.Entity};}tmpGroupedFilters[tmpFilterGroupGUID].Stanzas.push(_this86._compileSimpleFilterToString(tmpFilter));}};for(_iterator32.s();!(_step32=_iterator32.n()).done;){_loop5();}}catch(err){_iterator32.e(err);}finally{_iterator32.f();}var _iterator33=_createForOfIteratorHelper(tmpGroupedFilterKeys),_step33;try{for(_iterator33.s();!(_step33=_iterator33.n()).done;){var tmpFilterGroupKey=_step33.value;tmpGroupedFilters[tmpFilterGroupKey].Stanzas=tmpGroupedFilters[tmpFilterGroupKey].Stanzas.filter(function(f){return f.length>0;});if(tmpGroupedFilters[tmpFilterGroupKey].Stanzas.length>0){tmpBundleConfig.push({Type:'MeadowEntity',AllRecords:true,Entity:tmpGroupedFilters[tmpFilterGroupKey].Entity,Filter:tmpGroupedFilters[tmpFilterGroupKey].Stanzas.join('~'),Destination:"State[Step".concat(tmpGroupedFilters[tmpFilterGroupKey].ComputedIndex,"]")});}}}catch(err){_iterator33.e(err);}finally{_iterator33.f();}}}catch(err){_iterator30.e(err);}finally{_iterator30.f();}for(var _i68=0,_tmpGroupedCoreFilter=tmpGroupedCoreFilterKeys;_i68<_tmpGroupedCoreFilter.length;_i68++){var tmpCoreFilterKey=_tmpGroupedCoreFilter[_i68];tmpGroupedCoreFilters[tmpCoreFilterKey].Stanzas=tmpGroupedCoreFilters[tmpCoreFilterKey].Stanzas.filter(function(f){return f.length>0;});if(tmpGroupedCoreFilters[tmpCoreFilterKey].Stanzas.length>0){tmpCoreFilterStrings.push(['FOP~0~(~0'].concat(_toConsumableArray(tmpGroupedCoreFilters[tmpCoreFilterKey].Stanzas),['FCP~0~)~0']).join('~'));}}if(!tmpCoreEntity){tmpCoreEntity=pFilterState.Entity;}var tmpCoreLoadStep={Type:pFilterState.Mode==='Count'?'MeadowEntityCount':'MeadowEntity',Entity:tmpCoreEntity,Filter:tmpCoreFilterStrings.join('~'),AllRecords:typeof pFilterState.PageSize==='undefined',RecordStartCursor:pFilterState.RecordOffset,PageSize:pFilterState.PageSize,Destination:pFilterState.ResultDestinationAddress};if(pFilterState.UserFilters.length>0){var tmpFilter='';var _iterator31=_createForOfIteratorHelper(pFilterState.UserFilters),_step31;try{for(_iterator31.s();!(_step31=_iterator31.n()).done;){var tmpUserFilter=_step31.value;if(tmpFilter.length>0){tmpFilter+='~';}tmpFilter+='FOP~0~(~0~';tmpFilter+=tmpUserFilter;tmpFilter+='~FCP~0~)~0';}}catch(err){_iterator31.e(err);}finally{_iterator31.f();}if(tmpCoreLoadStep.Filter){if(tmpFilter.length>0){tmpFilter+='~';}tmpFilter+='FOP~0~(~0~';tmpFilter+=tmpCoreLoadStep.Filter;tmpFilter+='~FCP~0~)~0';}tmpCoreLoadStep.Filter=tmpFilter;}tmpBundleConfig.push(tmpCoreLoadStep);pFilterState.BundleConfig=tmpBundleConfig;}},{key:"_compileSimpleFilterToString",value:function _compileSimpleFilterToString(pFilter){var tmpFilterString="".concat(pFilter.Instruction);tmpFilterString+="~".concat(pFilter.Field);tmpFilterString+="~".concat(pFilter.Operator);if(pFilter.ValueTemplate){tmpFilterString+="~".concat(pFilter.ValueTemplate);}else{tmpFilterString+="~".concat(pFilter.Value||'');}return tmpFilterString;}}]);}();module.exports=FilterMeadowStanzaTokenGenerator;},{}],203:[function(require,module,exports){/**
5843
+ if(!pFilterState.Filter){pFilterState.Filter="".concat(pFilterState.Entity||'Unknown',"-").concat(this.pict.getUUID());}tmpBundleConfig.push({Type:'SetStateAddress',StateAddress:"Bundle[".concat(pFilterState.Filter,"]")});var tmpGroupedFilters={};var tmpGroupedFilterKeys=[];var tmpGroupedCoreFilters=[];var tmpGroupedCoreFilterKeys=[];var tmpCoreEntity;var tmpCoreFilterStrings=[];var _iterator30=_createForOfIteratorHelper(pFilterState.PreparedFilters),_step30;try{for(_iterator30.s();!(_step30=_iterator30.n()).done;){var tmpFilterGroup=_step30.value;var _iterator32=_createForOfIteratorHelper(tmpFilterGroup.Filters),_step32;try{var _loop5=function _loop5(){var tmpFilter=_step32.value;if(tmpFilter.CoreEntity){tmpCoreEntity=tmpFilter.Entity;var tmpFilterGUID="".concat(tmpFilterGroup.GUID,"-").concat(tmpFilter.ComputedIndex);if(!tmpGroupedCoreFilterKeys.find(function(v){return v==tmpFilterGUID;})){tmpGroupedCoreFilterKeys.push(tmpFilterGUID);}if(!tmpGroupedCoreFilters[tmpFilterGUID]){tmpGroupedCoreFilters[tmpFilterGUID]={Stanzas:[],ComputedIndex:tmpFilter.ComputedIndex,Entity:tmpFilter.Entity};}tmpGroupedCoreFilters[tmpFilterGUID].Stanzas.push(_this86._compileSimpleFilterToString(tmpFilter));}else{var tmpFilterGroupGUID="".concat(tmpFilterGroup.GUID,"-").concat(tmpFilter.ComputedIndex);if(!tmpGroupedFilterKeys.find(function(v){return v==tmpFilterGroupGUID;})){tmpGroupedFilterKeys.push(tmpFilterGroupGUID);}if(!tmpGroupedFilters[tmpFilterGroupGUID]){tmpGroupedFilters[tmpFilterGroupGUID]={Stanzas:[],ComputedIndex:tmpFilter.ComputedIndex,Entity:tmpFilter.Entity};}tmpGroupedFilters[tmpFilterGroupGUID].Stanzas.push(_this86._compileSimpleFilterToString(tmpFilter));}};for(_iterator32.s();!(_step32=_iterator32.n()).done;){_loop5();}}catch(err){_iterator32.e(err);}finally{_iterator32.f();}var _iterator33=_createForOfIteratorHelper(tmpGroupedFilterKeys),_step33;try{for(_iterator33.s();!(_step33=_iterator33.n()).done;){var tmpFilterGroupKey=_step33.value;tmpGroupedFilters[tmpFilterGroupKey].Stanzas=tmpGroupedFilters[tmpFilterGroupKey].Stanzas.filter(function(f){return f.length>0;});if(tmpGroupedFilters[tmpFilterGroupKey].Stanzas.length>0){tmpBundleConfig.push({Type:'MeadowEntity',AllRecords:true,Entity:tmpGroupedFilters[tmpFilterGroupKey].Entity,Filter:tmpGroupedFilters[tmpFilterGroupKey].Stanzas.join('~'),Destination:"State[Step".concat(tmpGroupedFilters[tmpFilterGroupKey].ComputedIndex,"]")});}}}catch(err){_iterator33.e(err);}finally{_iterator33.f();}}}catch(err){_iterator30.e(err);}finally{_iterator30.f();}for(var _i68=0,_tmpGroupedCoreFilter=tmpGroupedCoreFilterKeys;_i68<_tmpGroupedCoreFilter.length;_i68++){var tmpCoreFilterKey=_tmpGroupedCoreFilter[_i68];tmpGroupedCoreFilters[tmpCoreFilterKey].Stanzas=tmpGroupedCoreFilters[tmpCoreFilterKey].Stanzas.filter(function(f){return f.length>0;});if(tmpGroupedCoreFilters[tmpCoreFilterKey].Stanzas.length>0){tmpCoreFilterStrings.push(['FOP~0~(~0'].concat(_toConsumableArray(tmpGroupedCoreFilters[tmpCoreFilterKey].Stanzas),['FCP~0~)~0']).join('~'));}}if(!tmpCoreEntity){tmpCoreEntity=pFilterState.Entity;}var tmpCoreLoadStep={Type:pFilterState.Mode==='Count'?'MeadowEntityCount':'MeadowEntity',Entity:tmpCoreEntity,Filter:tmpCoreFilterStrings.join('~'),AllRecords:typeof pFilterState.PageSize==='undefined',RecordStartCursor:pFilterState.RecordOffset,PageSize:pFilterState.PageSize,Destination:pFilterState.ResultDestinationAddress};if(pFilterState.UserFilters.length>0){var tmpFilter='';var _iterator31=_createForOfIteratorHelper(pFilterState.UserFilters),_step31;try{for(_iterator31.s();!(_step31=_iterator31.n()).done;){var tmpUserFilter=_step31.value;var tmpSanitizedUserFilter=tmpUserFilter;if(pFilterState.Mode==='Count'){tmpSanitizedUserFilter=this._sanitizeFilterForCount(tmpUserFilter);}if(!tmpSanitizedUserFilter){continue;}if(tmpFilter.length>0){tmpFilter+='~';}tmpFilter+='FOP~0~(~0~';tmpFilter+=tmpSanitizedUserFilter;tmpFilter+='~FCP~0~)~0';}}catch(err){_iterator31.e(err);}finally{_iterator31.f();}if(tmpCoreLoadStep.Filter){if(tmpFilter.length>0){tmpFilter+='~';}tmpFilter+='FOP~0~(~0~';tmpFilter+=tmpCoreLoadStep.Filter;tmpFilter+='~FCP~0~)~0';}tmpCoreLoadStep.Filter=tmpFilter;}tmpBundleConfig.push(tmpCoreLoadStep);pFilterState.BundleConfig=tmpBundleConfig;}/**
5844
+ * @param {string} pFilter
5845
+ *
5846
+ * @return {string}
5847
+ */},{key:"_sanitizeFilterForCount",value:function _sanitizeFilterForCount(pFilter){if(!pFilter||typeof pFilter!=='string'){return pFilter;}var tmpMicroStanzas=pFilter.split('~');for(var i=0;i<tmpMicroStanzas.length;i+=4){if(tmpMicroStanzas[i]==='FSF'){tmpMicroStanzas=tmpMicroStanzas.slice(0,i).concat(tmpMicroStanzas.slice(i+4));i-=4;// adjust for removed elements
5848
+ }}return tmpMicroStanzas.join('~');}},{key:"_compileSimpleFilterToString",value:function _compileSimpleFilterToString(pFilter){var tmpFilterString="".concat(pFilter.Instruction);tmpFilterString+="~".concat(pFilter.Field);tmpFilterString+="~".concat(pFilter.Operator);if(pFilter.ValueTemplate){tmpFilterString+="~".concat(pFilter.ValueTemplate);}else{tmpFilterString+="~".concat(pFilter.Value||'');}return tmpFilterString;}}]);}();module.exports=FilterMeadowStanzaTokenGenerator;},{}],203:[function(require,module,exports){/**
5844
5849
  * @typedef {{
5845
5850
  * Type: 'None'
5846
5851
  * } | {