pict 1.0.255 → 1.0.257
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 +3 -3
- package/dist/pict.compatible.js.map +1 -1
- package/dist/pict.compatible.min.js +1 -1
- package/dist/pict.compatible.min.js.map +1 -1
- package/dist/pict.js +3 -3
- package/dist/pict.js.map +1 -1
- package/dist/pict.min.js +1 -1
- package/dist/pict.min.js.map +1 -1
- package/package.json +1 -1
- package/source/Pict-Meadow-EntityProvider.js +3 -1
- package/types/source/Pict-Meadow-EntityProvider.d.ts +4 -1
- package/types/source/Pict-Meadow-EntityProvider.d.ts.map +1 -1
package/dist/pict.compatible.js
CHANGED
|
@@ -4941,7 +4941,7 @@ try{if(!global.localStorage)return false;}catch(_){return false;}var val=global.
|
|
|
4941
4941
|
// presumably different callback function.
|
|
4942
4942
|
// This makes sure that own properties are retained, so that
|
|
4943
4943
|
// decorations and such are not lost along the way.
|
|
4944
|
-
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.
|
|
4944
|
+
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.257","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","eslint":"^9.27.0","globals":"^16.1.0","quackage":"^1.0.41"},"dependencies":{"cachetrax":"^1.0.4","fable":"^3.1.10","pict-application":"^1.0.25","pict-provider":"^1.0.3","pict-template":"^1.0.10","pict-view":"^1.0.60","typescript":"^5.8.3"}};},{}],192:[function(require,module,exports){// This assumes Pict has been required in the browser. Delcare these as globals so linter can do its job.
|
|
4945
4945
|
/* global Pict, _Pict: writeable *//**
|
|
4946
4946
|
* Simple function to load a pict Application
|
|
4947
4947
|
*
|
|
@@ -5106,7 +5106,7 @@ var tmpTargetElement=typeof pAddress==='string'?window.jQuery(pAddress):window.j
|
|
|
5106
5106
|
* @param {string} pAddress - The address of the data to retrieve
|
|
5107
5107
|
* @param {object} [pData] - (optional) The record to provide to the address resolver
|
|
5108
5108
|
*/_inherits(PictDataProvider,_libFableServiceBase21);return _createClass2(PictDataProvider,[{key:"getDataByAddress",value:function getDataByAddress(pAddress,pData){var tmpData=typeof pData==='undefined'?{}:pData;return this.fable.manifest.getValueByHash({AppData:this.fable.AppData,Bundle:this.fable.Bundle,Record:tmpData},pAddress);}}]);}(libFableServiceBase);module.exports=PictDataProvider;},{"fable":68}],197:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictMeadowEntityProvider=/*#__PURE__*/function(_libFableServiceBase22){function PictMeadowEntityProvider(pFable,pOptions,pServiceHash){var _this74$fable$RestCli;var _this74;_classCallCheck2(this,PictMeadowEntityProvider);_this74=_callSuper(this,PictMeadowEntityProvider,[pFable,pOptions,pServiceHash]);/** @type {any} */_this74.options;/** @type {import('pict') & { settings: any } & { newAnticipate: any }} */_this74.fable;/** @type {any} */_this74.log;_this74.serviceType='PictMeadowProvider';if(_this74.fable.settings.PictDefaultURLPrefix){_this74.options.urlPrefix=_this74.fable.settings.PictDefaultURLPrefix;}else if(!_this74.options.urlPrefix){_this74.options.urlPrefix='/1.0/';}if(_this74.fable.settings.PictDefaultDownloadBatchSize){_this74.options.downloadBatchSize=_this74.fable.settings.PictDefaultDownloadBatchSize;}else if(!_this74.options.downloadBatchSize){_this74.options.downloadBatchSize=100;}//@ts-ignore - FIXME - remove once we have fable types
|
|
5109
|
-
_this74.restClient=(_this74$fable$RestCli=_this74.fable.RestClient)!==null&&_this74$fable$RestCli!==void 0?_this74$fable$RestCli:_this74.fable.instantiateServiceProviderWithoutRegistration('RestClient')
|
|
5109
|
+
_this74.restClient=(_this74$fable$RestCli=_this74.fable.RestClient)!==null&&_this74$fable$RestCli!==void 0?_this74$fable$RestCli:_this74.fable.instantiateServiceProviderWithoutRegistration('RestClient');/** @type {Record<string, import('cachetrax')>} */_this74.recordCache={};/** @type {Record<string, import('cachetrax')>} */_this74.recordSetCache={};_this74.prepareRequestOptions=function(pOptions){return pOptions;};return _this74;}_inherits(PictMeadowEntityProvider,_libFableServiceBase22);return _createClass2(PictMeadowEntityProvider,[{key:"initializeCache",value:function initializeCache(pEntity){// This should not be happening as often as it's happening.
|
|
5110
5110
|
if(!(pEntity in this.recordCache)){//@ts-ignore - FIXME - remove once we have fable types
|
|
5111
5111
|
this.recordCache[pEntity]=this.fable.instantiateServiceProviderWithoutRegistration('ObjectCache');// TODO: Make this a configuration?
|
|
5112
5112
|
// For now cache for 30 seconds.
|
|
@@ -5138,7 +5138,7 @@ this.recordCache[pEntity].prune(function(){var _this78=this;var tmpPossibleRecor
|
|
|
5138
5138
|
// FBL~ID${pDestinationEntity}~INN~${tmpIDRecordsCommaSeparated}
|
|
5139
5139
|
// If the list is mega-long we can parse it and break it into chunks.
|
|
5140
5140
|
this.initializeCache(pEntity);// Discard anything from the cache that has expired or is over size.
|
|
5141
|
-
this.recordSetCache[pEntity].prune(function(){var _this79=this;var tmpPossibleRecords=this.
|
|
5141
|
+
this.recordSetCache[pEntity].prune(function(){var _this79=this;var tmpPossibleRecords=this.recordSetCache[pEntity].read(pMeadowFilterExpression);if(tmpPossibleRecords){return fCallback(null,tmpPossibleRecords);}return this.getEntitySetRecordCount(pEntity,pMeadowFilterExpression,function(pRecordCountError,pRecordCount){if(pRecordCountError){return fCallback(pRecordCountError);}var tmpRecordCount=pRecordCount;if(isNaN(pRecordCount)){_this79.log.error("Entity count did not return a number for [".concat(pEntity,"] filtered to [").concat(pMeadowFilterExpression,"]... something is fatally wrong from the server accessed in getEntitySet call."));return fCallback(new Error('Entity count did not return a number in getEntitySet.'));}var tmpDownloadURIFragments=[];var tmpDownloadBatchSize=_this79.options.downloadBatchSize;for(var i=0;i<tmpRecordCount/tmpDownloadBatchSize;i++){// Generate each of the URI fragments to download
|
|
5142
5142
|
tmpDownloadURIFragments.push("".concat(_this79.options.urlPrefix).concat(pEntity,"s/FilteredTo/").concat(pMeadowFilterExpression,"/").concat(i*tmpDownloadBatchSize,"/").concat(tmpDownloadBatchSize));}var tmpEntitySet=[];// Now run these in series (it's possible to parallelize the requests but they would not be in server order)
|
|
5143
5143
|
_this79.fable.Utility.eachLimit(tmpDownloadURIFragments,1,function(pURIFragment,fDownloadCallback){_this79.restClient.getJSON(pURIFragment,function(pDownloadError,pDownloadResponse,pDownloadBody){tmpEntitySet=tmpEntitySet.concat(pDownloadBody);// Should we be caching each record?
|
|
5144
5144
|
return fDownloadCallback(pDownloadError);});},function(pFullDownloadError){if(tmpEntitySet){_this79.recordSetCache[pEntity].put(tmpEntitySet,pMeadowFilterExpression);}return fCallback(pFullDownloadError,tmpEntitySet);});});}.bind(this));}}]);}(libFableServiceBase);module.exports=PictMeadowEntityProvider;},{"fable":68}],198:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictTemplateProvider=/*#__PURE__*/function(_libFableServiceBase23){/**
|