pict 1.0.296 → 1.0.297
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/dist/pict.compatible.js +41 -13
- package/dist/pict.compatible.js.map +1 -1
- package/dist/pict.compatible.min.js +2 -2
- package/dist/pict.compatible.min.js.map +1 -1
- package/dist/pict.js +41 -13
- package/dist/pict.js.map +1 -1
- package/dist/pict.min.js +2 -2
- package/dist/pict.min.js.map +1 -1
- package/package.json +1 -1
package/dist/pict.compatible.js
CHANGED
|
@@ -5153,7 +5153,7 @@ try{if(!global.localStorage)return false;}catch(_){return false;}var val=global.
|
|
|
5153
5153
|
// presumably different callback function.
|
|
5154
5154
|
// This makes sure that own properties are retained, so that
|
|
5155
5155
|
// decorations and such are not lost along the way.
|
|
5156
|
-
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.
|
|
5156
|
+
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.297","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.18","pict-application":"^1.0.27","pict-provider":"^1.0.6","pict-template":"^1.0.13","pict-view":"^1.0.63"}};},{}],192:[function(require,module,exports){// This assumes Pict has been required in the browser. Delcare these as globals so linter can do its job.
|
|
5157
5157
|
/* global Pict, _Pict: writeable *//**
|
|
5158
5158
|
* Simple function to load a pict Application
|
|
5159
5159
|
*
|
|
@@ -5849,14 +5849,15 @@ return this.contentMap[pAddress];}this.pict.log.warn("Mock read from Address ".c
|
|
|
5849
5849
|
* 'Match' | 'StringMatch' | 'DateMatch' | 'NumericMatch' |
|
|
5850
5850
|
* 'Range' | 'StringRange' | 'DateRange' | 'NumericRange' |
|
|
5851
5851
|
* 'InternalJoinMatch' | 'InternalJoinStringMatch' | 'InternalJoinNumericMatch' | 'InternalJoinDateMatch' |
|
|
5852
|
-
* 'InternalJoinRange' | 'InternalJoinStringRange' | 'InternalJoinNumericRange' | 'InternalJoinDateRange' |
|
|
5852
|
+
* 'InternalJoinRange' | 'InternalJoinStringRange' | 'InternalJoinNumericRange' | 'InternalJoinDateRange' | 'InternalJoinSelectedValue' | 'InternalJoinSelectedValueList' |
|
|
5853
5853
|
* 'ExternalJoinMatch' | 'ExternalJoinStringMatch' | 'ExternalJoinNumericMatch' | 'ExternalJoinDateMatch' |
|
|
5854
|
-
* 'ExternalJoinRange' | 'ExternalJoinStringRange' | 'ExternalJoinNumericRange' | 'ExternalJoinDateRange' } FilterType
|
|
5854
|
+
* 'ExternalJoinRange' | 'ExternalJoinStringRange' | 'ExternalJoinNumericRange' | 'ExternalJoinDateRange' | 'ExternalJoinSelectedValue' | 'ExternalJoinSelectedValueList' } FilterType
|
|
5855
5855
|
*/var FilterMeadowStanzaTokenGenerator=/*#__PURE__*/function(){/**
|
|
5856
5856
|
* @param {import('../Pict.js')} pFable
|
|
5857
5857
|
*/function FilterMeadowStanzaTokenGenerator(pFable){_classCallCheck2(this,FilterMeadowStanzaTokenGenerator);this.fable=pFable;this.pict=pFable;this.log=pFable.log;}/**
|
|
5858
5858
|
* @param {FilterState} pFilterState
|
|
5859
|
-
*/return _createClass2(FilterMeadowStanzaTokenGenerator,[{key:"generateMeadowFilterStanzas",value:function generateMeadowFilterStanzas(pFilterState){var tmpResult=[];pFilterState.UserFilters=[];var _iterator15=_createForOfIteratorHelper(pFilterState.FilterConfiguration||[]),_step15;try{for(_iterator15.s();!(_step15=_iterator15.n()).done;){var tmpFilterConfig=_step15.value;if(tmpFilterConfig.Enabled===false){if(this.pict.LogNoisiness>1){this.log.info("Skipping disabled filter configuration: ".concat(tmpFilterConfig.Type),{FilterConfig:tmpFilterConfig});}continue;}/** @type {PreparedFilter} */var tmpFilterResult={GUID:this.pict.getUUID(),Filters:[]};var tmpValuesArray=Array.isArray(tmpFilterConfig.Values)?tmpFilterConfig.Values:tmpFilterConfig.Value!=null&&tmpFilterConfig.Value!=''&&(tmpFilterConfig.Type!='ExternalJoinDateMatch'||tmpFilterConfig.Value!=0)?[tmpFilterConfig.Value]:[];switch(tmpFilterConfig.Type){case'
|
|
5859
|
+
*/return _createClass2(FilterMeadowStanzaTokenGenerator,[{key:"generateMeadowFilterStanzas",value:function generateMeadowFilterStanzas(pFilterState){var tmpResult=[];pFilterState.UserFilters=[];var _iterator15=_createForOfIteratorHelper(pFilterState.FilterConfiguration||[]),_step15;try{for(_iterator15.s();!(_step15=_iterator15.n()).done;){var tmpFilterConfig=_step15.value;if(tmpFilterConfig.Enabled===false){if(this.pict.LogNoisiness>1){this.log.info("Skipping disabled filter configuration: ".concat(tmpFilterConfig.Type),{FilterConfig:tmpFilterConfig});}continue;}/** @type {PreparedFilter} */var tmpFilterResult={GUID:this.pict.getUUID(),Filters:[]};var tmpValuesArray=Array.isArray(tmpFilterConfig.Values)?tmpFilterConfig.Values:tmpFilterConfig.Value!=null&&tmpFilterConfig.Value!=''&&(tmpFilterConfig.Type!='ExternalJoinDateMatch'||tmpFilterConfig.Value!=0)?[tmpFilterConfig.Value]:[];var tmpFilterByColumns=void 0;switch(tmpFilterConfig.Type){case'ExternalJoinSelectedValue':case'ExternalJoinSelectedValueList':tmpFilterByColumns=[tmpFilterConfig.ExternalFilterTableLookupColumn||"ID".concat(tmpFilterConfig.ExternalFilterByTable)];// fall through
|
|
5860
|
+
case'ExternalJoinMatch':case'ExternalJoinStringMatch':case'ExternalJoinDateMatch':case'ExternalJoinNumericMatch':/*
|
|
5860
5861
|
"Values": [ "John", "Jane" ],
|
|
5861
5862
|
"ExternalFilterByColumns": [ "Name" ],
|
|
5862
5863
|
"ExactMatch": false,
|
|
@@ -5869,9 +5870,10 @@ return this.contentMap[pAddress];}this.pict.log.warn("Mock read from Address ".c
|
|
|
5869
5870
|
|
|
5870
5871
|
"ExternalFilterByTable": "Author",
|
|
5871
5872
|
"ExternalFilterByTableConnectionColumn": "IDAuthor",
|
|
5872
|
-
*/
|
|
5873
|
+
*/if(!tmpFilterByColumns){tmpFilterByColumns=tmpFilterConfig.ExternalFilterByColumns||(tmpFilterConfig.ExternalFilterByColumn?[tmpFilterConfig.ExternalFilterByColumn]:['Name']);}var _iterator16=_createForOfIteratorHelper(tmpFilterByColumns),_step16;try{for(_iterator16.s();!(_step16=_iterator16.n()).done;){var tmpField=_step16.value;var _iterator17=_createForOfIteratorHelper(tmpValuesArray),_step17;try{for(_iterator17.s();!(_step17=_iterator17.n()).done;){var tmpValue=_step17.value;var tmpFilter={Index:-1,Entity:tmpFilterConfig.ExternalFilterByTable,Instruction:'FBVOR',Field:tmpField};if(tmpFilterConfig.ExactMatch||typeof tmpFilterConfig.ExactMatch==='undefined'&&(tmpFilterConfig.Type=='ExternalJoinNumericMatch'||tmpFilterConfig.Type=='ExternalJoinDateMatch'||tmpFilterConfig.Type=='ExternalJoinSelectedValue'||tmpFilterConfig.Type=='ExternalJoinSelectedValueList')){//TODO: optimize this to use in-list, but requires restructuring of this code
|
|
5874
|
+
tmpFilter.Operator='EQ';tmpFilter.Value=tmpValue;}else{tmpFilter.Operator='LK';tmpFilter.Value="%25".concat(tmpValue,"%25");//FIXME: point of URI encoding needs to be addressed
|
|
5873
5875
|
}tmpFilterResult.Filters.push(tmpFilter);}}catch(err){_iterator17.e(err);}finally{_iterator17.f();}}}catch(err){_iterator16.e(err);}finally{_iterator16.f();}if(!tmpFilterConfig.JoinTable){this.log.error("".concat(tmpFilterConfig.Type," filter missing JoinTable, cannot filter join table."),{FilterConfig:tmpFilterConfig});break;}if(!tmpFilterConfig.JoinTableExternalConnectionColumn){this.log.error("".concat(tmpFilterConfig.Type," filter missing JoinTableExternalConnectionColumn, cannot filter join table [").concat(tmpFilterConfig.JoinTable,"]."));break;}if(tmpFilterResult.Filters.length>0){tmpFilterResult.Filters.push({Index:0,Fulcrum:true,Entity:tmpFilterConfig.JoinTable,Instruction:'FBL',Field:tmpFilterConfig.JoinTableExternalConnectionColumn,Operator:'INN',ValueTemplate:"{~PJU:,^".concat(tmpFilterConfig.JoinTableExternalConnectionColumn,"^Record.State[Step-1]~}")});if(!tmpFilterConfig.CoreConnectionColumn){this.log.error("".concat(tmpFilterConfig.Type," filter missing CoreConnectionColumn, cannot filter core table [").concat(pFilterState.Entity,"]."));break;}tmpFilterResult.JoinConfig={CoreEntity:pFilterState.Entity,Instruction:'FBLOR',Fields:[tmpFilterConfig.CoreConnectionColumn],Operator:'INN',ValueTemplate:"{~PJU:,^".concat(tmpFilterConfig.JoinTableCoreConnectionColumn,"^Record.State[Step0]~}")};}break;case'ExternalJoinStringRange':case'ExternalJoinNumericRange':case'ExternalJoinDateRange':case'ExternalJoinRange':if(!tmpFilterConfig.Values||tmpFilterConfig.Values.Start==null&&tmpFilterConfig.Values.End==null){break;}// do not honor '0' for dates
|
|
5874
|
-
if(tmpFilterConfig.Type=='ExternalJoinDateRange'){if((!tmpFilterConfig.Values.Start||tmpFilterConfig.Values.Start=='0')&&(!tmpFilterConfig.Values.End||tmpFilterConfig.Values.End=='0')){break;}}var _iterator18=_createForOfIteratorHelper(tmpFilterConfig.ExternalFilterByColumns||(tmpFilterConfig.ExternalFilterByColumn?[tmpFilterConfig.ExternalFilterByColumn]:['Name'])),_step18;try{for(_iterator18.s();!(_step18=_iterator18.n()).done;){var _tmpField=_step18.value;if(tmpFilterConfig.Values&&tmpFilterConfig.Values.Start&&(tmpFilterConfig.Type!='ExternalJoinDateRange'||tmpFilterConfig.Values.Start!='0')){tmpFilterResult.Filters.push({Index:-1,CoreEntity:true,Entity:pFilterState.Entity,Instruction:'
|
|
5876
|
+
if(tmpFilterConfig.Type=='ExternalJoinDateRange'){if((!tmpFilterConfig.Values.Start||tmpFilterConfig.Values.Start=='0')&&(!tmpFilterConfig.Values.End||tmpFilterConfig.Values.End=='0')){break;}}var _iterator18=_createForOfIteratorHelper(tmpFilterConfig.ExternalFilterByColumns||(tmpFilterConfig.ExternalFilterByColumn?[tmpFilterConfig.ExternalFilterByColumn]:['Name'])),_step18;try{for(_iterator18.s();!(_step18=_iterator18.n()).done;){var _tmpField=_step18.value;if(tmpFilterConfig.Values&&tmpFilterConfig.Values.Start&&(tmpFilterConfig.Type!='ExternalJoinDateRange'||tmpFilterConfig.Values.Start!='0')){tmpFilterResult.Filters.push({Index:-1,CoreEntity:true,Entity:pFilterState.Entity,Instruction:'FBVOR',Field:_tmpField,Operator:tmpFilterConfig.StartExclusive?'GT':'GE',Value:tmpFilterConfig.Values.Start});}if(tmpFilterConfig.Values&&tmpFilterConfig.Values.End&&(tmpFilterConfig.Type!='ExternalJoinDateRange'||tmpFilterConfig.Values.End!='0')){tmpFilterResult.Filters.push({Index:-1,CoreEntity:true,Entity:pFilterState.Entity,Instruction:'FBVOR',Field:_tmpField,Operator:tmpFilterConfig.EndExclusive?'LT':'LE',Value:tmpFilterConfig.Values.End});}}}catch(err){_iterator18.e(err);}finally{_iterator18.f();}if(!tmpFilterConfig.JoinTable){this.log.error("".concat(tmpFilterConfig.Type," filter missing JoinTable, cannot filter join table."),{FilterConfig:tmpFilterConfig});break;}if(!tmpFilterConfig.JoinTableExternalConnectionColumn){this.log.error("".concat(tmpFilterConfig.Type," filter missing JoinTableExternalConnectionColumn, cannot filter join table [").concat(tmpFilterConfig.JoinTable,"]."));break;}if(tmpFilterResult.Filters.length>0){tmpFilterResult.Filters.push({Index:0,Fulcrum:true,Entity:tmpFilterConfig.JoinTable,Instruction:'FBL',Field:tmpFilterConfig.JoinTableExternalConnectionColumn,Operator:'INN',ValueTemplate:"{~PJU:,^".concat(tmpFilterConfig.JoinTableExternalConnectionColumn,"^Record.State[Step-1]~}")});if(!tmpFilterConfig.CoreConnectionColumn){this.log.error("".concat(tmpFilterConfig.Type," filter missing CoreConnectionColumn, cannot filter core table [").concat(pFilterState.Entity,"]."));break;}if(!tmpFilterConfig.JoinTableCoreConnectionColumn){this.log.error("".concat(tmpFilterConfig.Type," filter missing JoinTableCoreConnectionColumn, cannot filter core table [").concat(pFilterState.Entity,"]."));break;}tmpFilterResult.JoinConfig={CoreEntity:pFilterState.Entity,Instruction:'FBLOR',Fields:[tmpFilterConfig.CoreConnectionColumn],Operator:'INN',ValueTemplate:"{~PJU:,^".concat(tmpFilterConfig.JoinTableCoreConnectionColumn,"^Record.State[Step0]~}")};}break;case'StringRange':case'DateRange':case'NumericRange':case'Range':if(!tmpFilterConfig.Values||tmpFilterConfig.Values.Start==null&&tmpFilterConfig.Values.End==null){break;}// do not honor '0' for dates
|
|
5875
5877
|
if(tmpFilterConfig.Type=='DateRange'){if((!tmpFilterConfig.Values.Start||tmpFilterConfig.Values.Start=='0')&&(!tmpFilterConfig.Values.End||tmpFilterConfig.Values.End=='0')){break;}}/*
|
|
5876
5878
|
"Values":
|
|
5877
5879
|
{
|
|
@@ -5879,20 +5881,22 @@ if(tmpFilterConfig.Type=='DateRange'){if((!tmpFilterConfig.Values.Start||tmpFilt
|
|
|
5879
5881
|
"End": "2024-01-01T00:00:00Z"
|
|
5880
5882
|
},
|
|
5881
5883
|
"FilterByColumn": "CreateDate",
|
|
5882
|
-
*/var _iterator19=_createForOfIteratorHelper(tmpFilterConfig.FilterByColumns||(tmpFilterConfig.FilterByColumn?[tmpFilterConfig.FilterByColumn]:['Name'])),_step19;try{for(_iterator19.s();!(_step19=_iterator19.n()).done;){var _tmpField2=_step19.value;if(tmpFilterConfig.Values&&tmpFilterConfig.Values.Start&&(tmpFilterConfig.Type!='DateRange'||tmpFilterConfig.Values.Start!='0')){tmpFilterResult.Filters.push({Index:0,CoreEntity:true,Entity:pFilterState.Entity,Instruction:'
|
|
5884
|
+
*/var _iterator19=_createForOfIteratorHelper(tmpFilterConfig.FilterByColumns||(tmpFilterConfig.FilterByColumn?[tmpFilterConfig.FilterByColumn]:['Name'])),_step19;try{for(_iterator19.s();!(_step19=_iterator19.n()).done;){var _tmpField2=_step19.value;if(tmpFilterConfig.Values&&tmpFilterConfig.Values.Start&&(tmpFilterConfig.Type!='DateRange'||tmpFilterConfig.Values.Start!='0')){tmpFilterResult.Filters.push({Index:0,CoreEntity:true,Entity:pFilterState.Entity,Instruction:'FBVOR',Field:_tmpField2,Operator:tmpFilterConfig.StartExclusive?'GT':'GE',Value:tmpFilterConfig.Values.Start});}if(tmpFilterConfig.Values&&tmpFilterConfig.Values.End&&(tmpFilterConfig.Type!='DateRange'||tmpFilterConfig.Values.End!='0')){tmpFilterResult.Filters.push({Index:0,CoreEntity:true,Entity:pFilterState.Entity,Instruction:'FBVOR',Field:_tmpField2,Operator:tmpFilterConfig.EndExclusive?'LT':'LE',Value:tmpFilterConfig.Values.End});}}}catch(err){_iterator19.e(err);}finally{_iterator19.f();}break;case'StringMatch':case'DateMatch':case'NumericMatch':case'Match':/*
|
|
5883
5885
|
"Values": [ "John", "Jane" ],
|
|
5884
5886
|
"FilterByColumn": "Name",
|
|
5885
5887
|
"ExactMatch": false,
|
|
5886
5888
|
*/var _iterator20=_createForOfIteratorHelper(tmpFilterConfig.FilterByColumns||(tmpFilterConfig.FilterByColumn?[tmpFilterConfig.FilterByColumn]:['Name'])),_step20;try{for(_iterator20.s();!(_step20=_iterator20.n()).done;){var _tmpField3=_step20.value;var _iterator21=_createForOfIteratorHelper(tmpValuesArray),_step21;try{for(_iterator21.s();!(_step21=_iterator21.n()).done;){var _tmpValue5=_step21.value;var _tmpFilter={Index:0,CoreEntity:true,Entity:pFilterState.Entity,Instruction:'FBVOR',Field:_tmpField3};// don't use like for numbers
|
|
5887
5889
|
if(tmpFilterConfig.ExactMatch||typeof tmpFilterConfig.ExactMatch==='undefined'&&(tmpFilterConfig.Type=='NumericMatch'||tmpFilterConfig.Type=='DateMatch')){_tmpFilter.Operator='EQ';_tmpFilter.Value=_tmpValue5;}else{_tmpFilter.Operator='LK';_tmpFilter.Value="%25".concat(_tmpValue5,"%25");//FIXME: figure out a cleaner way to do URL encoding for these - probably, should be downstream, but isn't currently
|
|
5888
5890
|
}tmpFilterResult.Filters.push(_tmpFilter);}}catch(err){_iterator21.e(err);}finally{_iterator21.f();}}}catch(err){_iterator20.e(err);}finally{_iterator20.f();}break;case'InternalJoinStringRange':case'InternalJoinNumericRange':case'InternalJoinDateRange':case'InternalJoinRange':if(!tmpFilterConfig.Values||tmpFilterConfig.Values.Start==null&&tmpFilterConfig.Values.End==null){break;}// do not honor '0' for dates
|
|
5889
|
-
if(tmpFilterConfig.Type=='InternalJoinDateRange'){if((!tmpFilterConfig.Values.Start||tmpFilterConfig.Values.Start=='0')&&(!tmpFilterConfig.Values.End||tmpFilterConfig.Values.End=='0')){break;}}var _iterator22=_createForOfIteratorHelper(tmpFilterConfig.ExternalFilterByColumns||(tmpFilterConfig.ExternalFilterByColumn?[tmpFilterConfig.ExternalFilterByColumn]:['Name'])),_step22;try{for(_iterator22.s();!(_step22=_iterator22.n()).done;){var _tmpField4=_step22.value;if(tmpFilterConfig.Values&&tmpFilterConfig.Values.Start&&(tmpFilterConfig.Type!='InternalJoinDateRange'||tmpFilterConfig.Values.Start!='0')){tmpFilterResult.Filters.push({Index:0,Entity:tmpFilterConfig.RemoteTable,Instruction:'
|
|
5891
|
+
if(tmpFilterConfig.Type=='InternalJoinDateRange'){if((!tmpFilterConfig.Values.Start||tmpFilterConfig.Values.Start=='0')&&(!tmpFilterConfig.Values.End||tmpFilterConfig.Values.End=='0')){break;}}var _iterator22=_createForOfIteratorHelper(tmpFilterConfig.ExternalFilterByColumns||(tmpFilterConfig.ExternalFilterByColumn?[tmpFilterConfig.ExternalFilterByColumn]:['Name'])),_step22;try{for(_iterator22.s();!(_step22=_iterator22.n()).done;){var _tmpField4=_step22.value;if(tmpFilterConfig.Values&&tmpFilterConfig.Values.Start&&(tmpFilterConfig.Type!='InternalJoinDateRange'||tmpFilterConfig.Values.Start!='0')){tmpFilterResult.Filters.push({Index:0,Entity:tmpFilterConfig.RemoteTable,Instruction:'FBVOR',Field:_tmpField4,Operator:tmpFilterConfig.StartExclusive?'GT':'GE',Value:tmpFilterConfig.Values.Start});}if(tmpFilterConfig.Values&&tmpFilterConfig.Values.End&&(tmpFilterConfig.Type!='InternalJoinDateRange'||tmpFilterConfig.Values.End!='0')){tmpFilterResult.Filters.push({Index:0,Entity:tmpFilterConfig.RemoteTable,Instruction:'FBVOR',Field:_tmpField4,Operator:tmpFilterConfig.EndExclusive?'LT':'LE',Value:tmpFilterConfig.Values.End});}}}catch(err){_iterator22.e(err);}finally{_iterator22.f();}if(tmpFilterResult.Filters.length>0){if(!tmpFilterConfig.JoinInternalConnectionColumn){this.log.error("".concat(tmpFilterConfig.Type," filter missing JoinInternalConnectionColumn, cannot filter core table [").concat(pFilterState.Entity,"]."));break;}tmpFilterResult.JoinConfig={Instruction:'FBLOR',CoreEntity:pFilterState.Entity,Fields:[tmpFilterConfig.JoinInternalConnectionColumn],Operator:'INN',ValueTemplate:"{~PJU:,^".concat(tmpFilterConfig.JoinExternalConnectionColumn,"^Record.State[Step0]~}")};}break;case'InternalJoinSelectedValue':case'InternalJoinSelectedValueList':tmpFilterByColumns=[tmpFilterConfig.ExternalFilterTableLookupColumn||"ID".concat(tmpFilterConfig.RemoteTable)];// fall through
|
|
5892
|
+
case'InternalJoinMatch':case'InternalJoinStringMatch':case'InternalJoinDateMatch':case'InternalJoinNumericMatch':/*
|
|
5890
5893
|
"Values": [ "Bob" ],
|
|
5891
5894
|
"RemoteTable": "User",
|
|
5892
5895
|
"ExternalFilterByColumns": [ "NameFirst", "NameLast" ],
|
|
5893
5896
|
"JoinExternalConnectionColumn": "IDUser",
|
|
5894
5897
|
"JoinInternalConnectionColumn": "CreatingIDUser",
|
|
5895
|
-
*/
|
|
5898
|
+
*/if(!tmpFilterByColumns){tmpFilterByColumns=tmpFilterConfig.ExternalFilterByColumns||(tmpFilterConfig.ExternalFilterByColumn?[tmpFilterConfig.ExternalFilterByColumn]:['Name']);}var _iterator23=_createForOfIteratorHelper(tmpFilterByColumns),_step23;try{for(_iterator23.s();!(_step23=_iterator23.n()).done;){var _tmpField5=_step23.value;var _iterator24=_createForOfIteratorHelper(tmpValuesArray),_step24;try{for(_iterator24.s();!(_step24=_iterator24.n()).done;){var _tmpValue6=_step24.value;var _tmpFilter2={Index:0,Entity:tmpFilterConfig.RemoteTable,Instruction:'FBVOR',Field:_tmpField5};if(tmpFilterConfig.ExactMatch||typeof tmpFilterConfig.ExactMatch==='undefined'&&(tmpFilterConfig.Type=='InternalJoinNumericMatch'||tmpFilterConfig.Type=='InternalJoinDateMatch'||tmpFilterConfig.Type=='InternalJoinSelectedValue'||tmpFilterConfig.Type=='InternalJoinSelectedValueList')){//TODO: optimize this to use in-list, but requires restructuring of this code
|
|
5899
|
+
_tmpFilter2.Operator='EQ';_tmpFilter2.Value=_tmpValue6;}else{_tmpFilter2.Operator='LK';_tmpFilter2.Value="%25".concat(_tmpValue6,"%25");}tmpFilterResult.Filters.push(_tmpFilter2);}}catch(err){_iterator24.e(err);}finally{_iterator24.f();}}}catch(err){_iterator23.e(err);}finally{_iterator23.f();}if(tmpFilterResult.Filters.length>0){if(!tmpFilterConfig.JoinInternalConnectionColumn){this.log.error("".concat(tmpFilterConfig.Type," filter missing JoinInternalConnectionColumn, cannot filter core table [").concat(pFilterState.Entity,"]."));break;}tmpFilterResult.JoinConfig={Instruction:'FBLOR',CoreEntity:pFilterState.Entity,Fields:[tmpFilterConfig.JoinInternalConnectionColumn],Operator:'INN',ValueTemplate:"{~PJU:,^".concat(tmpFilterConfig.JoinExternalConnectionColumn,"^Record.State[Step0]~}")};}break;case'RawFilter':if(!tmpFilterConfig.Value){this.log.warn("RawFilter configuration missing Value, not adding filter.",{FilterConfig:tmpFilterConfig});break;}pFilterState.UserFilters.push(tmpFilterConfig.Value);break;default:this.log.warn("Unknown filter type ".concat(tmpFilterConfig.Type," in filter configuration."),{FilterConfig:tmpFilterConfig});}if(tmpFilterResult.Filters.length>0){tmpResult.push(tmpFilterResult);}}}catch(err){_iterator15.e(err);}finally{_iterator15.f();}pFilterState.PreparedFilters=tmpResult;}/**
|
|
5896
5900
|
* @param {FilterState} pFilterState
|
|
5897
5901
|
*/},{key:"linkPreparedFilters",value:function linkPreparedFilters(pFilterState){var tmpGroupedStanzas=[];var _iterator25=_createForOfIteratorHelper(pFilterState.PreparedFilters||[]),_step25;try{for(_iterator25.s();!(_step25=_iterator25.n()).done;){var tmpPreparedFilter=_step25.value;if(tmpPreparedFilter.JoinConfig){var tmpSubGroup=tmpPreparedFilter.Filters;var tmpJoinConfig=tmpPreparedFilter.JoinConfig;var _iterator26=_createForOfIteratorHelper(tmpJoinConfig.Fields||[]),_step26;try{for(_iterator26.s();!(_step26=_iterator26.n()).done;){var tmpField=_step26.value;var tmpStanza={Index:1,CoreEntity:true,Entity:tmpPreparedFilter.JoinConfig.CoreEntity,Instruction:tmpPreparedFilter.JoinConfig.Instruction||'FBVOR',Field:tmpField,Operator:tmpJoinConfig.Operator,Value:tmpJoinConfig.Value,ValueTemplate:tmpJoinConfig.ValueTemplate};tmpSubGroup.push(tmpStanza);}}catch(err){_iterator26.e(err);}finally{_iterator26.f();}tmpGroupedStanzas.push(tmpSubGroup);}else{tmpGroupedStanzas.push(tmpPreparedFilter.Filters);}}}catch(err){_iterator25.e(err);}finally{_iterator25.f();}return tmpGroupedStanzas;}/**
|
|
5898
5902
|
* Generate a computed index for each filter in the meadow filter stanzas such that the overall address space is non-overlapping and stable.
|
|
@@ -5937,6 +5941,16 @@ if(!pFilterState.Filter){pFilterState.Filter="".concat(pFilterState.Entity||'Unk
|
|
|
5937
5941
|
* JoinExternalConnectionColumn: string,
|
|
5938
5942
|
* JoinInternalConnectionColumn: string,
|
|
5939
5943
|
* } | {
|
|
5944
|
+
* Type: 'InternalJoinSelectedValue' | 'InternalJoinSelectedValueList',
|
|
5945
|
+
* Values: string[] | number[],
|
|
5946
|
+
* ExactMatch?: boolean,
|
|
5947
|
+
* RemoteTable: string,
|
|
5948
|
+
* ExternalFilterByColumn?: string,
|
|
5949
|
+
* ExternalFilterByColumns?: string[],
|
|
5950
|
+
* ExternalFilterTableLookupColumn?: string,
|
|
5951
|
+
* JoinExternalConnectionColumn: string,
|
|
5952
|
+
* JoinInternalConnectionColumn: string,
|
|
5953
|
+
* } | {
|
|
5940
5954
|
* Type: 'InternalJoinRange' | 'InternalJoinStringRange' | 'InternalJoinNumericRange' | 'InternalJoinDateRange',
|
|
5941
5955
|
* Values: { Start?: string | number, End?: string | number },
|
|
5942
5956
|
* StartExclusive?: boolean,
|
|
@@ -5971,6 +5985,20 @@ if(!pFilterState.Filter){pFilterState.Filter="".concat(pFilterState.Entity||'Unk
|
|
|
5971
5985
|
* JoinTableCoreConnectionColumn: string,
|
|
5972
5986
|
* ExternalFilterByTable: string,
|
|
5973
5987
|
* ExternalFilterByTableConnectionColumn: string,
|
|
5988
|
+
* } | {
|
|
5989
|
+
* Type: 'ExternalJoinSelectedValue' | 'ExternalJoinSelectedValueList',
|
|
5990
|
+
* Values: { Start?: string | number, End?: string | number },
|
|
5991
|
+
* StartExclusive?: boolean,
|
|
5992
|
+
* EndExclusive?: boolean,
|
|
5993
|
+
* ExternalFilterByColumn?: string,
|
|
5994
|
+
* ExternalFilterByColumns?: string[],
|
|
5995
|
+
* CoreConnectionColumn: string,
|
|
5996
|
+
* JoinTable: string,
|
|
5997
|
+
* JoinTableExternalConnectionColumn: string,
|
|
5998
|
+
* JoinTableCoreConnectionColumn: string,
|
|
5999
|
+
* ExternalFilterByTable: string,
|
|
6000
|
+
* ExternalFilterTableLookupColumn?: string,
|
|
6001
|
+
* ExternalFilterByTableConnectionColumn: string,
|
|
5974
6002
|
* }} FilterClauseConfig
|
|
5975
6003
|
*/var FilterClauseBase=/*#__PURE__*/function(){/**
|
|
5976
6004
|
* @param {import('../Pict.js')} pFable
|
|
@@ -5984,15 +6012,15 @@ if(!pFilterState.Filter){pFilterState.Filter="".concat(pFilterState.Entity||'Unk
|
|
|
5984
6012
|
* Manage filter state for a filter that works on a one level of indirect direct join.
|
|
5985
6013
|
*/var FilterClauseExternalJoin=/*#__PURE__*/function(_libFilterClauseBase){/**
|
|
5986
6014
|
* @param {import('../Pict.js')} pFable
|
|
5987
|
-
*/function FilterClauseExternalJoin(pFable){var _this88;_classCallCheck2(this,FilterClauseExternalJoin);_this88=_callSuper(this,FilterClauseExternalJoin,[pFable]);/** @type {import('./Filter.js').FilterType} */_this88.type='ExternalJoinMatch';/** @type {string[] | number[] | { Start?: string | number, End?: string | number }} */_this88.values=[];/** @type {boolean?} */_this88.exactMatch;/** @type {boolean?} */_this88.startExclusive;/** @type {boolean?} */_this88.endExclusive;/** @type {string?} */_this88.externalFilterByColumn;/** @type {string[]?} */_this88.externalFilterByColumns;/** @type {string} */_this88.coreConnectionColumn='';/** @type {string} */_this88.joinTable='';/** @type {string} */_this88.joinTableExternalConnectionColumn='';/** @type {string} */_this88.joinTableCoreConnectionColumn='';/** @type {string} */_this88.externalFilterByTable='';/** @type {string} */_this88.externalFilterByTableConnectionColumn='';return _this88;}/**
|
|
6015
|
+
*/function FilterClauseExternalJoin(pFable){var _this88;_classCallCheck2(this,FilterClauseExternalJoin);_this88=_callSuper(this,FilterClauseExternalJoin,[pFable]);/** @type {import('./Filter.js').FilterType} */_this88.type='ExternalJoinMatch';/** @type {string[] | number[] | { Start?: string | number, End?: string | number }} */_this88.values=[];/** @type {boolean?} */_this88.exactMatch;/** @type {boolean?} */_this88.startExclusive;/** @type {boolean?} */_this88.endExclusive;/** @type {string?} */_this88.externalFilterByColumn;/** @type {string[]?} */_this88.externalFilterByColumns;/** @type {string} */_this88.coreConnectionColumn='';/** @type {string} */_this88.joinTable='';/** @type {string} */_this88.joinTableExternalConnectionColumn='';/** @type {string} */_this88.joinTableCoreConnectionColumn='';/** @type {string} */_this88.externalFilterByTable='';/** @type {string} */_this88.externalFilterTableLookupColumn='';/** @type {string} */_this88.externalFilterByTableConnectionColumn='';return _this88;}/**
|
|
5988
6016
|
* @return {import('./FilterClauseBase.js').FilterClauseConfig}
|
|
5989
|
-
*/_inherits(FilterClauseExternalJoin,_libFilterClauseBase);return _createClass2(FilterClauseExternalJoin,[{key:"generateFilterClauseConfig",value:function generateFilterClauseConfig(){switch(this.type){case'ExternalJoinMatch':case'ExternalJoinStringMatch':case'ExternalJoinDateMatch':case'ExternalJoinNumericMatch':return{Type:this.type,Values:Array.isArray(this.values)?this.values:[],ExactMatch:this.exactMatch,ExternalFilterByColumn:this.externalFilterByColumn,ExternalFilterByColumns:this.externalFilterByColumns,CoreConnectionColumn:this.coreConnectionColumn,JoinTable:this.joinTable,JoinTableExternalConnectionColumn:this.joinTableExternalConnectionColumn,JoinTableCoreConnectionColumn:this.joinTableCoreConnectionColumn,ExternalFilterByTable:this.externalFilterByTable,ExternalFilterByTableConnectionColumn:this.externalFilterByTableConnectionColumn};case'ExternalJoinRange':case'ExternalJoinStringRange':case'ExternalJoinDateRange':case'ExternalJoinNumericRange':return{Type:this.type,Values:Array.isArray(this.values)?{Start:undefined,End:undefined}:Object.assign({},this.values),StartExclusive:this.startExclusive,EndExclusive:this.endExclusive,ExternalFilterByColumn:this.externalFilterByColumn,ExternalFilterByColumns:this.externalFilterByColumns,CoreConnectionColumn:this.coreConnectionColumn,JoinTable:this.joinTable,JoinTableExternalConnectionColumn:this.joinTableExternalConnectionColumn,JoinTableCoreConnectionColumn:this.joinTableCoreConnectionColumn,ExternalFilterByTable:this.externalFilterByTable,ExternalFilterByTableConnectionColumn:this.externalFilterByTableConnectionColumn};default:throw new Error("Unsupported filter type: ".concat(this.type));}}}]);}(libFilterClauseBase);module.exports=FilterClauseExternalJoin;},{"./FilterClauseBase.js":203}],205:[function(require,module,exports){var libFilterClauseBase=require('./FilterClauseBase.js');/**
|
|
6017
|
+
*/_inherits(FilterClauseExternalJoin,_libFilterClauseBase);return _createClass2(FilterClauseExternalJoin,[{key:"generateFilterClauseConfig",value:function generateFilterClauseConfig(){switch(this.type){case'ExternalJoinMatch':case'ExternalJoinStringMatch':case'ExternalJoinDateMatch':case'ExternalJoinNumericMatch':return{Type:this.type,Values:Array.isArray(this.values)?this.values:[],ExactMatch:this.exactMatch,ExternalFilterByColumn:this.externalFilterByColumn,ExternalFilterByColumns:this.externalFilterByColumns,CoreConnectionColumn:this.coreConnectionColumn,JoinTable:this.joinTable,JoinTableExternalConnectionColumn:this.joinTableExternalConnectionColumn,JoinTableCoreConnectionColumn:this.joinTableCoreConnectionColumn,ExternalFilterByTable:this.externalFilterByTable,ExternalFilterByTableConnectionColumn:this.externalFilterByTableConnectionColumn};case'ExternalJoinRange':case'ExternalJoinStringRange':case'ExternalJoinDateRange':case'ExternalJoinNumericRange':return{Type:this.type,Values:Array.isArray(this.values)?{Start:undefined,End:undefined}:Object.assign({},this.values),StartExclusive:this.startExclusive,EndExclusive:this.endExclusive,ExternalFilterByColumn:this.externalFilterByColumn,ExternalFilterByColumns:this.externalFilterByColumns,CoreConnectionColumn:this.coreConnectionColumn,JoinTable:this.joinTable,JoinTableExternalConnectionColumn:this.joinTableExternalConnectionColumn,JoinTableCoreConnectionColumn:this.joinTableCoreConnectionColumn,ExternalFilterByTable:this.externalFilterByTable,ExternalFilterByTableConnectionColumn:this.externalFilterByTableConnectionColumn};case'ExternalJoinSelectedValue':case'ExternalJoinSelectedValueList':return{Type:this.type,Values:Array.isArray(this.values)?{Start:undefined,End:undefined}:Object.assign({},this.values),StartExclusive:this.startExclusive,EndExclusive:this.endExclusive,ExternalFilterByColumn:this.externalFilterByColumn,ExternalFilterByColumns:this.externalFilterByColumns,CoreConnectionColumn:this.coreConnectionColumn,JoinTable:this.joinTable,JoinTableExternalConnectionColumn:this.joinTableExternalConnectionColumn,JoinTableCoreConnectionColumn:this.joinTableCoreConnectionColumn,ExternalFilterByTable:this.externalFilterByTable,ExternalFilterTableLookupColumn:this.externalFilterTableLookupColumn,ExternalFilterByTableConnectionColumn:this.externalFilterByTableConnectionColumn};default:throw new Error("Unsupported filter type: ".concat(this.type));}}}]);}(libFilterClauseBase);module.exports=FilterClauseExternalJoin;},{"./FilterClauseBase.js":203}],205:[function(require,module,exports){var libFilterClauseBase=require('./FilterClauseBase.js');/**
|
|
5990
6018
|
* Manage filter state for a filter that works on a one level of indirect direct join.
|
|
5991
6019
|
*/var FilterClauseInternalJoin=/*#__PURE__*/function(_libFilterClauseBase2){/**
|
|
5992
6020
|
* @param {import('../Pict.js')} pFable
|
|
5993
|
-
*/function FilterClauseInternalJoin(pFable){var _this89;_classCallCheck2(this,FilterClauseInternalJoin);_this89=_callSuper(this,FilterClauseInternalJoin,[pFable]);/** @type {import('./Filter.js').FilterType} */_this89.type='None';/** @type {string[] | number[] | { Start?: string | number, End?: string | number }} */_this89.values=[];/** @type {boolean?} */_this89.exactMatch;/** @type {boolean?} */_this89.startExclusive;/** @type {boolean?} */_this89.endExclusive;/** @type {string} */_this89.remoteTable='';/** @type {string?} */_this89.externalFilterByColumn;/** @type {string[]?} */_this89.externalFilterByColumns;/** @type {string} */_this89.joinExternalConnectionColumn='';/** @type {string} */_this89.joinInternalConnectionColumn='';return _this89;}/**
|
|
6021
|
+
*/function FilterClauseInternalJoin(pFable){var _this89;_classCallCheck2(this,FilterClauseInternalJoin);_this89=_callSuper(this,FilterClauseInternalJoin,[pFable]);/** @type {import('./Filter.js').FilterType} */_this89.type='None';/** @type {string[] | number[] | { Start?: string | number, End?: string | number }} */_this89.values=[];/** @type {boolean?} */_this89.exactMatch;/** @type {boolean?} */_this89.startExclusive;/** @type {boolean?} */_this89.endExclusive;/** @type {string} */_this89.remoteTable='';/** @type {string?} */_this89.externalFilterByColumn;/** @type {string[]?} */_this89.externalFilterByColumns;/** @type {string?} */_this89.externalFilterTableLookupColumn;/** @type {string} */_this89.joinExternalConnectionColumn='';/** @type {string} */_this89.joinInternalConnectionColumn='';return _this89;}/**
|
|
5994
6022
|
* @return {import('./FilterClauseBase.js').FilterClauseConfig}
|
|
5995
|
-
*/_inherits(FilterClauseInternalJoin,_libFilterClauseBase2);return _createClass2(FilterClauseInternalJoin,[{key:"generateFilterClauseConfig",value:function generateFilterClauseConfig(){switch(this._type){case'InternalJoinMatch':case'InternalJoinStringMatch':case'InternalJoinDateMatch':case'InternalJoinNumericMatch':return{Type:this._type,Values:Array.isArray(this.values)?this.values:[],ExactMatch:this.exactMatch,RemoteTable:this.remoteTable,ExternalFilterByColumn:this.externalFilterByColumn,ExternalFilterByColumns:this.externalFilterByColumns,JoinExternalConnectionColumn:this.joinExternalConnectionColumn,JoinInternalConnectionColumn:this.joinInternalConnectionColumn};case'InternalJoinRange':case'InternalJoinStringRange':case'InternalJoinDateRange':case'InternalJoinNumericRange':return{Type:this._type,Values:Array.isArray(this.values)?{Start:undefined,End:undefined}:Object.assign({},this.values),StartExclusive:this.startExclusive,EndExclusive:this.endExclusive,RemoteTable:this.remoteTable,ExternalFilterByColumn:this.externalFilterByColumn,ExternalFilterByColumns:this.externalFilterByColumns,JoinExternalConnectionColumn:this.joinExternalConnectionColumn,JoinInternalConnectionColumn:this.joinInternalConnectionColumn};default:throw new Error("Unsupported filter type: ".concat(this.type));}}}]);}(libFilterClauseBase);module.exports=FilterClauseInternalJoin;},{"./FilterClauseBase.js":203}],206:[function(require,module,exports){var libFilterClauseBase=require('./FilterClauseBase.js');/**
|
|
6023
|
+
*/_inherits(FilterClauseInternalJoin,_libFilterClauseBase2);return _createClass2(FilterClauseInternalJoin,[{key:"generateFilterClauseConfig",value:function generateFilterClauseConfig(){switch(this._type){case'InternalJoinMatch':case'InternalJoinStringMatch':case'InternalJoinDateMatch':case'InternalJoinNumericMatch':return{Type:this._type,Values:Array.isArray(this.values)?this.values:[],ExactMatch:this.exactMatch,RemoteTable:this.remoteTable,ExternalFilterByColumn:this.externalFilterByColumn,ExternalFilterByColumns:this.externalFilterByColumns,JoinExternalConnectionColumn:this.joinExternalConnectionColumn,JoinInternalConnectionColumn:this.joinInternalConnectionColumn};case'InternalJoinSelectedValue':case'InternalJoinSelectedValueList':return{Type:this._type,Values:Array.isArray(this.values)?this.values:[],ExactMatch:this.exactMatch,RemoteTable:this.remoteTable,ExternalFilterByColumn:this.externalFilterByColumn,ExternalFilterByColumns:this.externalFilterByColumns,ExternalFilterTableLookupColumn:this.externalFilterTableLookupColumn,JoinExternalConnectionColumn:this.joinExternalConnectionColumn,JoinInternalConnectionColumn:this.joinInternalConnectionColumn};case'InternalJoinRange':case'InternalJoinStringRange':case'InternalJoinDateRange':case'InternalJoinNumericRange':return{Type:this._type,Values:Array.isArray(this.values)?{Start:undefined,End:undefined}:Object.assign({},this.values),StartExclusive:this.startExclusive,EndExclusive:this.endExclusive,RemoteTable:this.remoteTable,ExternalFilterByColumn:this.externalFilterByColumn,ExternalFilterByColumns:this.externalFilterByColumns,JoinExternalConnectionColumn:this.joinExternalConnectionColumn,JoinInternalConnectionColumn:this.joinInternalConnectionColumn};default:throw new Error("Unsupported filter type: ".concat(this.type));}}}]);}(libFilterClauseBase);module.exports=FilterClauseInternalJoin;},{"./FilterClauseBase.js":203}],206:[function(require,module,exports){var libFilterClauseBase=require('./FilterClauseBase.js');/**
|
|
5996
6024
|
* Manage filter state for a filter that only works on fields local to the table.
|
|
5997
6025
|
*/var FilterClauseLocal=/*#__PURE__*/function(_libFilterClauseBase3){/**
|
|
5998
6026
|
* @param {import('../Pict.js')} pFable
|