pict 1.0.241 → 1.0.242
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 +154 -153
- 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 +143 -142
- 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/dist/pict.compatible.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t
|
|
1
|
+
"use strict";function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t.return||t.return();}finally{if(u)throw o;}}};}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _defineProperty2(e,r,t){return(r=_toPropertyKey2(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _classCallCheck2(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey2(o.key),o);}}function _createClass2(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey2(t){var i=_toPrimitive2(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive2(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}(function(f){if((typeof exports==="undefined"?"undefined":_typeof(exports))==="object"&&typeof module!=="undefined"){module.exports=f();}else if(typeof define==="function"&&define.amd){define([],f);}else{var g;if(typeof window!=="undefined"){g=window;}else if(typeof global!=="undefined"){g=global;}else if(typeof self!=="undefined"){g=self;}else{g=this;}g.Pict=f();}})(function(){var define,module,exports;return function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a;}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r);},p,p.exports,r,e,n,t);}return n[i].exports;}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o;}return r;}()({1:[function(require,module,exports){'use strict';var eachOfLimit=require('async.util.eachoflimit');var withoutIndex=require('async.util.withoutindex');module.exports=function eachLimit(arr,limit,iterator,cb){return eachOfLimit(limit)(arr,withoutIndex(iterator),cb);};},{"async.util.eachoflimit":3,"async.util.withoutindex":14}],2:[function(require,module,exports){'use strict';module.exports=function(tasks){function makeCallback(index){function fn(){if(tasks.length){tasks[index].apply(null,arguments);}return fn.next();}fn.next=function(){return index<tasks.length-1?makeCallback(index+1):null;};return fn;}return makeCallback(0);};},{}],3:[function(require,module,exports){var once=require('async.util.once');var noop=require('async.util.noop');var onlyOnce=require('async.util.onlyonce');var keyIterator=require('async.util.keyiterator');module.exports=function eachOfLimit(limit){return function(obj,iterator,cb){cb=once(cb||noop);obj=obj||[];var nextKey=keyIterator(obj);if(limit<=0){return cb(null);}var done=false;var running=0;var errored=false;(function replenish(){if(done&&running<=0){return cb(null);}while(running<limit&&!errored){var key=nextKey();if(key===null){done=true;if(running<=0){cb(null);}return;}running+=1;iterator(obj[key],key,onlyOnce(function(err){running-=1;if(err){cb(err);errored=true;}else{replenish();}}));}})();};};},{"async.util.keyiterator":7,"async.util.noop":9,"async.util.once":10,"async.util.onlyonce":11}],4:[function(require,module,exports){'use strict';var setImmediate=require('async.util.setimmediate');var restParam=require('async.util.restparam');module.exports=function(fn){return restParam(function(args){var callback=args.pop();args.push(function(){var innerArgs=arguments;if(sync){setImmediate(function(){callback.apply(null,innerArgs);});}else{callback.apply(null,innerArgs);}});var sync=true;fn.apply(this,args);sync=false;});};},{"async.util.restparam":12,"async.util.setimmediate":13}],5:[function(require,module,exports){'use strict';module.exports=Array.isArray||function isArray(obj){return Object.prototype.toString.call(obj)==='[object Array]';};},{}],6:[function(require,module,exports){'use strict';var isArray=require('async.util.isarray');module.exports=function isArrayLike(arr){return isArray(arr)||// has a positive integer length property
|
|
2
2
|
typeof arr.length==='number'&&arr.length>=0&&arr.length%1===0;};},{"async.util.isarray":5}],7:[function(require,module,exports){'use strict';var _keys=require('async.util.keys');var isArrayLike=require('async.util.isarraylike');module.exports=function keyIterator(coll){var i=-1;var len;var keys;if(isArrayLike(coll)){len=coll.length;return function next(){i++;return i<len?i:null;};}else{keys=_keys(coll);len=keys.length;return function next(){i++;return i<len?keys[i]:null;};}};},{"async.util.isarraylike":6,"async.util.keys":8}],8:[function(require,module,exports){'use strict';module.exports=Object.keys||function keys(obj){var _keys=[];for(var k in obj){if(obj.hasOwnProperty(k)){_keys.push(k);}}return _keys;};},{}],9:[function(require,module,exports){'use strict';module.exports=function noop(){};},{}],10:[function(require,module,exports){'use strict';module.exports=function once(fn){return function(){if(fn===null)return;fn.apply(this,arguments);fn=null;};};},{}],11:[function(require,module,exports){'use strict';module.exports=function only_once(fn){return function(){if(fn===null)throw new Error('Callback was already called.');fn.apply(this,arguments);fn=null;};};},{}],12:[function(require,module,exports){'use strict';module.exports=function restParam(func,startIndex){startIndex=startIndex==null?func.length-1:+startIndex;return function(){var length=Math.max(arguments.length-startIndex,0);var rest=new Array(length);for(var index=0;index<length;index++){rest[index]=arguments[index+startIndex];}switch(startIndex){case 0:return func.call(this,rest);case 1:return func.call(this,arguments[0],rest);}};};},{}],13:[function(require,module,exports){(function(setImmediate){(function(){'use strict';var _setImmediate=typeof setImmediate==='function'&&setImmediate;var fallback=function fallback(fn){setTimeout(fn,0);};module.exports=function setImmediate(fn){// not a direct alias for IE10 compatibility
|
|
3
3
|
return(_setImmediate||fallback)(fn);};}).call(this);}).call(this,require("timers").setImmediate);},{"timers":184}],14:[function(require,module,exports){'use strict';module.exports=function withoutIndex(iterator){return function(value,index,callback){return iterator(value,callback);};};},{}],15:[function(require,module,exports){'use strict';var once=require('async.util.once');var noop=require('async.util.noop');var isArray=require('async.util.isarray');var restParam=require('async.util.restparam');var ensureAsync=require('async.util.ensureasync');var iterator=require('async.iterator');module.exports=function(tasks,cb){cb=once(cb||noop);if(!isArray(tasks))return cb(new Error('First argument to waterfall must be an array of functions'));if(!tasks.length)return cb();function wrapIterator(iterator){return restParam(function(err,args){if(err){cb.apply(null,[err].concat(args));}else{var next=iterator.next();if(next){args.push(wrapIterator(next));}else{args.push(cb);}ensureAsync(iterator).apply(null,args);}});}wrapIterator(iterator(tasks))();};},{"async.iterator":2,"async.util.ensureasync":4,"async.util.isarray":5,"async.util.noop":9,"async.util.once":10,"async.util.restparam":12}],16:[function(require,module,exports){'use strict';exports.byteLength=byteLength;exports.toByteArray=toByteArray;exports.fromByteArray=fromByteArray;var lookup=[];var revLookup=[];var Arr=typeof Uint8Array!=='undefined'?Uint8Array:Array;var code='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';for(var i=0,len=code.length;i<len;++i){lookup[i]=code[i];revLookup[code.charCodeAt(i)]=i;}// Support decoding URL-safe base64 strings, as Node.js does.
|
|
4
4
|
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
|
|
@@ -635,7 +635,7 @@ return true;}}]);}(libFableServiceProviderBase);module.exports=BaseLogger;},{"fa
|
|
|
635
635
|
*
|
|
636
636
|
* @author Steven Velozo <steven@velozo.com>
|
|
637
637
|
*/// Return the providers that are available without extensions loaded
|
|
638
|
-
var getDefaultProviders=function getDefaultProviders(){var tmpDefaultProviders={};tmpDefaultProviders.console=require('./Fable-Log-Logger-Console.js');tmpDefaultProviders
|
|
638
|
+
var getDefaultProviders=function getDefaultProviders(){var tmpDefaultProviders={};tmpDefaultProviders.console=require('./Fable-Log-Logger-Console.js');tmpDefaultProviders.default=tmpDefaultProviders.console;return tmpDefaultProviders;};module.exports=getDefaultProviders();},{"./Fable-Log-Logger-Console.js":55}],54:[function(require,module,exports){module.exports=[{"loggertype":"console","streamtype":"console","level":"trace"}];},{}],55:[function(require,module,exports){var libBaseLogger=require('./Fable-Log-BaseLogger.js');var ConsoleLogger=/*#__PURE__*/function(_libBaseLogger){function ConsoleLogger(pLogStreamSettings,pFableLog){var _this7;_classCallCheck2(this,ConsoleLogger);_this7=_callSuper(this,ConsoleLogger,[pLogStreamSettings]);_this7._ShowTimeStamps='showtimestamps'in _this7._Settings?_this7._Settings.showtimestamps==true:true;_this7._FormattedTimeStamps='formattedtimestamps'in _this7._Settings?_this7._Settings.formattedtimestamps==true:true;_this7._ContextMessage='Context'in _this7._Settings?"(".concat(_this7._Settings.Context,")"):'Product'in pFableLog._Settings?"(".concat(pFableLog._Settings.Product,")"):'Unnamed_Log_Context';// Allow the user to decide what gets output to the console
|
|
639
639
|
_this7._OutputLogLinesToConsole='outputloglinestoconsole'in _this7._Settings?_this7._Settings.outputloglinestoconsole:true;_this7._OutputObjectsToConsole='outputobjectstoconsole'in _this7._Settings?_this7._Settings.outputobjectstoconsole:true;// Precompute the prefix for each level
|
|
640
640
|
_this7.prefixCache={};for(var i=0;i<=_this7.levels.length;i++){_this7.prefixCache[_this7.levels[i]]="[".concat(_this7.levels[i],"] ").concat(_this7._ContextMessage,": ");if(_this7._ShowTimeStamps){// If there is a timestamp we need a to prepend space before the prefixcache string, since the timestamp comes first
|
|
641
641
|
_this7.prefixCache[_this7.levels[i]]=' '+_this7.prefixCache[_this7.levels[i]];}}return _this7;}_inherits(ConsoleLogger,_libBaseLogger);return _createClass2(ConsoleLogger,[{key:"write",value:function write(pLevel,pLogText,pObject){var tmpTimeStamp='';if(this._ShowTimeStamps&&this._FormattedTimeStamps){tmpTimeStamp=new Date().toISOString();}else if(this._ShowTimeStamps){tmpTimeStamp=+new Date();}var tmpLogLine="".concat(tmpTimeStamp).concat(this.prefixCache[pLevel]).concat(pLogText);if(this._OutputLogLinesToConsole){console.log(tmpLogLine);}// Write out the object on a separate line if it is passed in
|
|
@@ -693,7 +693,7 @@ this.templateProcessor.addPattern('${','}',function(pTemplateValue){var tmpTempl
|
|
|
693
693
|
* @module Fable Settings
|
|
694
694
|
*/var libFableServiceProviderBase=require('fable-serviceproviderbase').CoreServiceProviderBase;var libFableSettingsTemplateProcessor=require('./Fable-Settings-TemplateProcessor.js');var FableSettings=/*#__PURE__*/function(_libFableServiceProvi4){function FableSettings(pSettings,pServiceHash){var _this10;_classCallCheck2(this,FableSettings);_this10=_callSuper(this,FableSettings,[pSettings,pServiceHash]);_this10.serviceType='SettingsManager';_this10._Package=require('../package.json');// Initialize the settings value template processor
|
|
695
695
|
_this10.settingsTemplateProcessor=new libFableSettingsTemplateProcessor();// set straight away so anything that uses it respects the initial setting
|
|
696
|
-
_this10._configureEnvTemplating(pSettings);_this10
|
|
696
|
+
_this10._configureEnvTemplating(pSettings);_this10.default=_this10.buildDefaultSettings();// Construct a new settings object
|
|
697
697
|
var tmpSettings=_this10.merge(pSettings,_this10.buildDefaultSettings());// The base settings object (what they were on initialization, before other actors have altered them)
|
|
698
698
|
_this10.base=JSON.parse(JSON.stringify(tmpSettings));if(tmpSettings.DefaultConfigFile){try{// If there is a DEFAULT configuration file, try to load and merge it.
|
|
699
699
|
tmpSettings=_this10.merge(require(tmpSettings.DefaultConfigFile),tmpSettings);}catch(pException){// Why this? Often for an app we want settings to work out of the box, but
|
|
@@ -719,7 +719,7 @@ this._configureEnvTemplating(tmpSettingsTo);return tmpSettingsTo;}// Fill in set
|
|
|
719
719
|
},{key:"fill",value:function fill(pSettingsFrom){// If an invalid settings from object is passed in (e.g. object constructor without passing in anything) this should still work
|
|
720
720
|
var tmpSettingsFrom=_typeof(pSettingsFrom)==='object'?pSettingsFrom:{};// do not mutate the From object property values
|
|
721
721
|
var tmpSettingsFromCopy=JSON.parse(JSON.stringify(tmpSettingsFrom));this.settings=this._deepMergeObjects(tmpSettingsFromCopy,this.settings);return this.settings;}}]);}(libFableServiceProviderBase);;// This is for backwards compatibility
|
|
722
|
-
function autoConstruct(pSettings){return new FableSettings(pSettings);}module.exports=FableSettings;module.exports
|
|
722
|
+
function autoConstruct(pSettings){return new FableSettings(pSettings);}module.exports=FableSettings;module.exports.new=autoConstruct;},{"../package.json":60,"./Fable-Settings-Default":61,"./Fable-Settings-TemplateProcessor.js":62,"fable-serviceproviderbase":59}],64:[function(require,module,exports){module.exports={"name":"fable-uuid","version":"3.0.11","description":"A simple UUID Generator.","main":"source/Fable-UUID.js","scripts":{"start":"node source/Fable-UUID.js","coverage":"./node_modules/.bin/nyc --reporter=lcov --reporter=text-lcov ./node_modules/mocha/bin/_mocha -- -u tdd -R spec","test":"./node_modules/.bin/mocha -u tdd -R spec","build":"./node_modules/.bin/gulp build","docker-dev-build-image":"docker build ./ -f Dockerfile_LUXURYCode -t retold/fable-uuid:local","docker-dev-run":"docker run -it -d --name retold-fable-uuid-dev -p 30002:8080 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/fable-uuid\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" retold/fable-uuid:local"},"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":"https://github.com/stevenvelozo/fable-uuid.git"},"keywords":["logging"],"author":"Steven Velozo <steven@velozo.com> (http://velozo.com/)","license":"MIT","bugs":{"url":"https://github.com/stevenvelozo/fable-uuid/issues"},"browser":{"./source/Fable-UUID-Random.js":"./source/Fable-UUID-Random-Browser.js"},"homepage":"https://github.com/stevenvelozo/fable-uuid","devDependencies":{"quackage":"^1.0.33"},"dependencies":{"fable-serviceproviderbase":"^3.0.15"}};},{}],65:[function(require,module,exports){/**
|
|
723
723
|
* Random Byte Generator - Browser version
|
|
724
724
|
*
|
|
725
725
|
*
|
|
@@ -752,7 +752,7 @@ return[this._HexLookup[pBuffer[i++]],this._HexLookup[pBuffer[i++]],this._HexLook
|
|
|
752
752
|
tmpRandomBytes[6]=tmpRandomBytes[6]&0x0f|0x40;tmpRandomBytes[8]=tmpRandomBytes[8]&0x3f|0x80;return this.bytesToUUID(tmpRandomBytes);}// Simple random UUID generation
|
|
753
753
|
},{key:"generateRandom",value:function generateRandom(){var tmpUUID='';for(var i=0;i<this._UUIDLength;i++){tmpUUID+=this._UUIDRandomDictionary.charAt(Math.floor(Math.random()*(this._UUIDRandomDictionary.length-1)));}return tmpUUID;}// Adapted from node-uuid (https://github.com/kelektiv/node-uuid)
|
|
754
754
|
},{key:"getUUID",value:function getUUID(){if(this._UUIDModeRandom){return this.generateRandom();}else{return this.generateUUIDv4();}}}]);}(libFableServiceProviderBase);// This is for backwards compatibility
|
|
755
|
-
function autoConstruct(pSettings){return new FableUUID(pSettings);}module.exports=FableUUID;module.exports
|
|
755
|
+
function autoConstruct(pSettings){return new FableUUID(pSettings);}module.exports=FableUUID;module.exports.new=autoConstruct;},{"../package.json":64,"./Fable-UUID-Random.js":65,"fable-serviceproviderbase":59}],67:[function(require,module,exports){module.exports={"name":"fable","version":"3.1.3","description":"A service dependency injection, configuration and logging library.","main":"source/Fable.js","scripts":{"start":"node source/Fable.js","coverage":"./node_modules/.bin/nyc --reporter=lcov --reporter=text-lcov ./node_modules/mocha/bin/_mocha -- -u tdd -R spec","test":"./node_modules/.bin/mocha -u tdd -R spec","build":"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t fable-image:local","docker-dev-run":"docker run -it -d --name fable-dev -p 30001:8080 -p 38086:8086 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/fable\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" fable-image:local","docker-dev-shell":"docker exec -it fable-dev /bin/bash","tests":"./node_modules/mocha/bin/_mocha -u tdd --exit -R spec --grep"},"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"]},"browser":{"./source/service/Fable-Service-EnvironmentData.js":"./source/service/Fable-Service-EnvironmentData-Web.js","./source/service/Fable-Service-FilePersistence.js":"./source/service/Fable-Service-FilePersistence-Web.js"},"repository":{"type":"git","url":"https://github.com/stevenvelozo/fable.git"},"keywords":["entity","behavior"],"author":"Steven Velozo <steven@velozo.com> (http://velozo.com/)","license":"MIT","bugs":{"url":"https://github.com/stevenvelozo/fable/issues"},"homepage":"https://github.com/stevenvelozo/fable","devDependencies":{"quackage":"^1.0.38"},"dependencies":{"async.eachlimit":"^0.5.2","async.waterfall":"^0.5.2","big.js":"^6.2.2","cachetrax":"^1.0.4","cookie":"^0.6.0","data-arithmatic":"^1.0.7","dayjs":"^1.11.13","fable-log":"^3.0.16","fable-serviceproviderbase":"^3.0.15","fable-settings":"^3.0.12","fable-uuid":"^3.0.11","manyfest":"^1.0.38","simple-get":"^4.0.1"}};},{}],68:[function(require,module,exports){/**
|
|
756
756
|
* Fable Application Services Support Library
|
|
757
757
|
* @author <steven@velozo.com>
|
|
758
758
|
*/// Pre-init services
|
|
@@ -810,7 +810,7 @@ if(pServiceHash in this.servicesMap[pServiceType]){if(!(pServiceType in this)||t
|
|
|
810
810
|
* @param {Date} pDate - An optional javascript Date object to generate a datestamp for.
|
|
811
811
|
* @returns {string} - A string formatted as YYYY-MM-DD-HH-MM-SS
|
|
812
812
|
*/}],[{key:"generateFileNameDateStamp",value:function generateFileNameDateStamp(pDate){var tmpDate=pDate||new Date();var tmpYear=tmpDate.getFullYear();var tmpMonth=String(tmpDate.getMonth()+1).padStart(2,'0');var tmpDay=String(tmpDate.getDate()).padStart(2,'0');var tmpHour=String(tmpDate.getHours()).padStart(2,'0');var tmpMinute=String(tmpDate.getMinutes()).padStart(2,'0');var tmpSecond=String(tmpDate.getSeconds()).padStart(2,'0');return"".concat(tmpYear,"-").concat(tmpMonth,"-").concat(tmpDay,"-").concat(tmpHour,"-").concat(tmpMinute,"-").concat(tmpSecond);}}]);}(libFableServiceBase.CoreServiceProviderBase);// This is for backwards compatibility
|
|
813
|
-
function autoConstruct(pSettings){return new Fable(pSettings);}module.exports=Fable;module.exports
|
|
813
|
+
function autoConstruct(pSettings){return new Fable(pSettings);}module.exports=Fable;module.exports.new=autoConstruct;module.exports.LogProviderBase=libFableLog.LogProviderBase;module.exports.ServiceProviderBase=libFableServiceBase;module.exports.CoreServiceProviderBase=libFableServiceBase.CoreServiceProviderBase;module.exports.precedent=libFableSettings.precedent;},{"../package.json":67,"./services/Fable-Service-Anticipate.js":69,"./services/Fable-Service-CSVParser.js":70,"./services/Fable-Service-DataFormat.js":71,"./services/Fable-Service-DataGeneration.js":73,"./services/Fable-Service-DateManipulation.js":74,"./services/Fable-Service-EnvironmentData.js":75,"./services/Fable-Service-ExpressionParser.js":76,"./services/Fable-Service-FilePersistence.js":86,"./services/Fable-Service-Math.js":87,"./services/Fable-Service-MetaTemplate.js":88,"./services/Fable-Service-Operation.js":92,"./services/Fable-Service-ProgressTime.js":93,"./services/Fable-Service-ProgressTrackerSet.js":95,"./services/Fable-Service-RestClient.js":96,"./services/Fable-Service-Template.js":97,"./services/Fable-Service-Utility.js":98,"cachetrax":22,"fable-log":57,"fable-serviceproviderbase":59,"fable-settings":63,"fable-uuid":66,"manyfest":124}],69:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var FableServiceAnticipate=/*#__PURE__*/function(_libFableServiceBase){function FableServiceAnticipate(pFable,pOptions,pServiceHash){var _this14;_classCallCheck2(this,FableServiceAnticipate);_this14=_callSuper(this,FableServiceAnticipate,[pFable,pOptions,pServiceHash]);_this14.serviceType='AsyncAnticipate';// The queue of operations waiting to run.
|
|
814
814
|
_this14.operationQueue=[];_this14.erroredOperations=[];_this14.executingOperationCount=0;_this14.completedOperationCount=0;_this14.callDepth=0;_this14.maxOperations=1;_this14.lastError=undefined;_this14.waitingFunctions=[];return _this14;}_inherits(FableServiceAnticipate,_libFableServiceBase);return _createClass2(FableServiceAnticipate,[{key:"checkQueue",value:function checkQueue(){// This could be combined with the last else if stanza but the logic for errors and non-errors would be blended and more complex to follow so keeping it unrolled.
|
|
815
815
|
if(this.lastError){// If there are no operations left, and we have waiting functions, call them.
|
|
816
816
|
for(var i=0;i<this.waitingFunctions.length;i++){//this.log.trace('Calling waiting function.')
|
|
@@ -2978,8 +2978,8 @@ if(tmpFilterFunction(tmpDescriptor)){// If we are overwriting properties OR the
|
|
|
2978
2978
|
if(tmpOverwriteProperties||!_this51.checkAddressExists(tmpObject,pAddress)){_this51.setValueAtAddress(tmpObject,pAddress,_this51.getDefaultValue(tmpDescriptor));}}});return tmpObject;}}]);}(libFableServiceProviderBase);;module.exports=Manyfest;},{"./Manyfest-HashTranslation.js":114,"./Manyfest-LogToConsole.js":115,"./Manyfest-ObjectAddress-CheckAddressExists.js":116,"./Manyfest-ObjectAddress-DeleteValue.js":117,"./Manyfest-ObjectAddress-GetValue.js":118,"./Manyfest-ObjectAddress-SetValue.js":120,"./Manyfest-ObjectAddressGeneration.js":121,"./Manyfest-SchemaManipulation.js":123,"fable-serviceproviderbase":59}],125:[function(require,module,exports){'use strict';/** @type {import('./abs')} */module.exports=Math.abs;},{}],126:[function(require,module,exports){'use strict';/** @type {import('./floor')} */module.exports=Math.floor;},{}],127:[function(require,module,exports){'use strict';/** @type {import('./isNaN')} */module.exports=Number.isNaN||function isNaN(a){return a!==a;};},{}],128:[function(require,module,exports){'use strict';/** @type {import('./max')} */module.exports=Math.max;},{}],129:[function(require,module,exports){'use strict';/** @type {import('./min')} */module.exports=Math.min;},{}],130:[function(require,module,exports){'use strict';/** @type {import('./pow')} */module.exports=Math.pow;},{}],131:[function(require,module,exports){'use strict';/** @type {import('./round')} */module.exports=Math.round;},{}],132:[function(require,module,exports){'use strict';var $isNaN=require('./isNaN');/** @type {import('./sign')} */module.exports=function sign(number){if($isNaN(number)||number===0){return number;}return number<0?-1:+1;};},{"./isNaN":127}],133:[function(require,module,exports){(function(global){(function(){var hasMap=typeof Map==='function'&&Map.prototype;var mapSizeDescriptor=Object.getOwnPropertyDescriptor&&hasMap?Object.getOwnPropertyDescriptor(Map.prototype,'size'):null;var mapSize=hasMap&&mapSizeDescriptor&&typeof mapSizeDescriptor.get==='function'?mapSizeDescriptor.get:null;var mapForEach=hasMap&&Map.prototype.forEach;var hasSet=typeof Set==='function'&&Set.prototype;var setSizeDescriptor=Object.getOwnPropertyDescriptor&&hasSet?Object.getOwnPropertyDescriptor(Set.prototype,'size'):null;var setSize=hasSet&&setSizeDescriptor&&typeof setSizeDescriptor.get==='function'?setSizeDescriptor.get:null;var setForEach=hasSet&&Set.prototype.forEach;var hasWeakMap=typeof WeakMap==='function'&&WeakMap.prototype;var weakMapHas=hasWeakMap?WeakMap.prototype.has:null;var hasWeakSet=typeof WeakSet==='function'&&WeakSet.prototype;var weakSetHas=hasWeakSet?WeakSet.prototype.has:null;var hasWeakRef=typeof WeakRef==='function'&&WeakRef.prototype;var weakRefDeref=hasWeakRef?WeakRef.prototype.deref:null;var booleanValueOf=Boolean.prototype.valueOf;var objectToString=Object.prototype.toString;var functionToString=Function.prototype.toString;var $match=String.prototype.match;var $slice=String.prototype.slice;var $replace=String.prototype.replace;var $toUpperCase=String.prototype.toUpperCase;var $toLowerCase=String.prototype.toLowerCase;var $test=RegExp.prototype.test;var $concat=Array.prototype.concat;var $join=Array.prototype.join;var $arrSlice=Array.prototype.slice;var $floor=Math.floor;var bigIntValueOf=typeof BigInt==='function'?BigInt.prototype.valueOf:null;var gOPS=Object.getOwnPropertySymbols;var symToString=typeof Symbol==='function'&&_typeof(Symbol.iterator)==='symbol'?Symbol.prototype.toString:null;var hasShammedSymbols=typeof Symbol==='function'&&_typeof(Symbol.iterator)==='object';// ie, `has-tostringtag/shams
|
|
2979
2979
|
var toStringTag=typeof Symbol==='function'&&Symbol.toStringTag&&(_typeof(Symbol.toStringTag)===hasShammedSymbols?'object':'symbol')?Symbol.toStringTag:null;var isEnumerable=Object.prototype.propertyIsEnumerable;var gPO=(typeof Reflect==='function'?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype// eslint-disable-line no-proto
|
|
2980
2980
|
?function(O){return O.__proto__;// eslint-disable-line no-proto
|
|
2981
|
-
}:null);function addNumericSeparator(num,str){if(num===Infinity||num===-Infinity||num!==num||num&&num>-1000&&num<1000||$test.call(/e/,str)){return str;}var sepRegex=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof num==='number'){var
|
|
2982
|
-
if(
|
|
2981
|
+
}:null);function addNumericSeparator(num,str){if(num===Infinity||num===-Infinity||num!==num||num&&num>-1000&&num<1000||$test.call(/e/,str)){return str;}var sepRegex=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof num==='number'){var int=num<0?-$floor(-num):$floor(num);// trunc(num)
|
|
2982
|
+
if(int!==num){var intStr=String(int);var dec=$slice.call(str,intStr.length+1);return $replace.call(intStr,sepRegex,'$&_')+'.'+$replace.call($replace.call(dec,/([0-9]{3})/g,'$&_'),/_$/,'');}}return $replace.call(str,sepRegex,'$&_');}var utilInspect=require('./util.inspect');var inspectCustom=utilInspect.custom;var inspectSymbol=isSymbol(inspectCustom)?inspectCustom:null;var quotes={__proto__:null,'double':'"',single:"'"};var quoteREs={__proto__:null,'double':/(["\\])/g,single:/(['\\])/g};module.exports=function inspect_(obj,options,depth,seen){var opts=options||{};if(has(opts,'quoteStyle')&&!has(quotes,opts.quoteStyle)){throw new TypeError('option "quoteStyle" must be "single" or "double"');}if(has(opts,'maxStringLength')&&(typeof opts.maxStringLength==='number'?opts.maxStringLength<0&&opts.maxStringLength!==Infinity:opts.maxStringLength!==null)){throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');}var customInspect=has(opts,'customInspect')?opts.customInspect:true;if(typeof customInspect!=='boolean'&&customInspect!=='symbol'){throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');}if(has(opts,'indent')&&opts.indent!==null&&opts.indent!=='\t'&&!(parseInt(opts.indent,10)===opts.indent&&opts.indent>0)){throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');}if(has(opts,'numericSeparator')&&typeof opts.numericSeparator!=='boolean'){throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');}var numericSeparator=opts.numericSeparator;if(typeof obj==='undefined'){return'undefined';}if(obj===null){return'null';}if(typeof obj==='boolean'){return obj?'true':'false';}if(typeof obj==='string'){return inspectString(obj,opts);}if(typeof obj==='number'){if(obj===0){return Infinity/obj>0?'0':'-0';}var str=String(obj);return numericSeparator?addNumericSeparator(obj,str):str;}if(typeof obj==='bigint'){var bigIntStr=String(obj)+'n';return numericSeparator?addNumericSeparator(obj,bigIntStr):bigIntStr;}var maxDepth=typeof opts.depth==='undefined'?5:opts.depth;if(typeof depth==='undefined'){depth=0;}if(depth>=maxDepth&&maxDepth>0&&_typeof(obj)==='object'){return isArray(obj)?'[Array]':'[Object]';}var indent=getIndent(opts,depth);if(typeof seen==='undefined'){seen=[];}else if(indexOf(seen,obj)>=0){return'[Circular]';}function inspect(value,from,noIndent){if(from){seen=$arrSlice.call(seen);seen.push(from);}if(noIndent){var newOpts={depth:opts.depth};if(has(opts,'quoteStyle')){newOpts.quoteStyle=opts.quoteStyle;}return inspect_(value,newOpts,depth+1,seen);}return inspect_(value,opts,depth+1,seen);}if(typeof obj==='function'&&!isRegExp(obj)){// in older engines, regexes are callable
|
|
2983
2983
|
var name=nameOf(obj);var keys=arrObjKeys(obj,inspect);return'[Function'+(name?': '+name:' (anonymous)')+']'+(keys.length>0?' { '+$join.call(keys,', ')+' }':'');}if(isSymbol(obj)){var symString=hasShammedSymbols?$replace.call(String(obj),/^(Symbol\(.*\))_[^)]*$/,'$1'):symToString.call(obj);return _typeof(obj)==='object'&&!hasShammedSymbols?markBoxed(symString):symString;}if(isElement(obj)){var s='<'+$toLowerCase.call(String(obj.nodeName));var attrs=obj.attributes||[];for(var i=0;i<attrs.length;i++){s+=' '+attrs[i].name+'='+wrapQuotes(quote(attrs[i].value),'double',opts);}s+='>';if(obj.childNodes&&obj.childNodes.length){s+='...';}s+='</'+$toLowerCase.call(String(obj.nodeName))+'>';return s;}if(isArray(obj)){if(obj.length===0){return'[]';}var xs=arrObjKeys(obj,inspect);if(indent&&!singleLineValues(xs)){return'['+indentedJoin(xs,indent)+']';}return'[ '+$join.call(xs,', ')+' ]';}if(isError(obj)){var parts=arrObjKeys(obj,inspect);if(!('cause'in Error.prototype)&&'cause'in obj&&!isEnumerable.call(obj,'cause')){return'{ ['+String(obj)+'] '+$join.call($concat.call('[cause]: '+inspect(obj.cause),parts),', ')+' }';}if(parts.length===0){return'['+String(obj)+']';}return'{ ['+String(obj)+'] '+$join.call(parts,', ')+' }';}if(_typeof(obj)==='object'&&customInspect){if(inspectSymbol&&typeof obj[inspectSymbol]==='function'&&utilInspect){return utilInspect(obj,{depth:maxDepth-depth});}else if(customInspect!=='symbol'&&typeof obj.inspect==='function'){return obj.inspect();}}if(isMap(obj)){var mapParts=[];if(mapForEach){mapForEach.call(obj,function(value,key){mapParts.push(inspect(key,obj,true)+' => '+inspect(value,obj));});}return collectionOf('Map',mapSize.call(obj),mapParts,indent);}if(isSet(obj)){var setParts=[];if(setForEach){setForEach.call(obj,function(value){setParts.push(inspect(value,obj));});}return collectionOf('Set',setSize.call(obj),setParts,indent);}if(isWeakMap(obj)){return weakCollectionOf('WeakMap');}if(isWeakSet(obj)){return weakCollectionOf('WeakSet');}if(isWeakRef(obj)){return weakCollectionOf('WeakRef');}if(isNumber(obj)){return markBoxed(inspect(Number(obj)));}if(isBigInt(obj)){return markBoxed(inspect(bigIntValueOf.call(obj)));}if(isBoolean(obj)){return markBoxed(booleanValueOf.call(obj));}if(isString(obj)){return markBoxed(inspect(String(obj)));}// note: in IE 8, sometimes `global !== window` but both are the prototypes of each other
|
|
2984
2984
|
/* eslint-env browser */if(typeof window!=='undefined'&&obj===window){return'{ [object Window] }';}if(typeof globalThis!=='undefined'&&obj===globalThis||typeof global!=='undefined'&&obj===global){return'{ [object globalThis] }';}if(!isDate(obj)&&!isRegExp(obj)){var ys=arrObjKeys(obj,inspect);var isPlainObject=gPO?gPO(obj)===Object.prototype:obj instanceof Object||obj.constructor===Object;var protoTag=obj instanceof Object?'':'null prototype';var stringTag=!isPlainObject&&toStringTag&&Object(obj)===obj&&toStringTag in obj?$slice.call(toStr(obj),8,-1):protoTag?'Object':'';var constructorTag=isPlainObject||typeof obj.constructor!=='function'?'':obj.constructor.name?obj.constructor.name+' ':'';var tag=constructorTag+(stringTag||protoTag?'['+$join.call($concat.call([],stringTag||[],protoTag||[]),': ')+'] ':'');if(ys.length===0){return tag+'{}';}if(indent){return tag+'{'+indentedJoin(ys,indent)+'}';}return tag+'{ '+$join.call(ys,', ')+' }';}return String(obj);};function wrapQuotes(s,defaultStyle,opts){var style=opts.quoteStyle||defaultStyle;var quoteChar=quotes[style];return quoteChar+s+quoteChar;}function quote(s){return $replace.call(String(s),/"/g,'"');}function isArray(obj){return toStr(obj)==='[object Array]'&&(!toStringTag||!(_typeof(obj)==='object'&&toStringTag in obj));}function isDate(obj){return toStr(obj)==='[object Date]'&&(!toStringTag||!(_typeof(obj)==='object'&&toStringTag in obj));}function isRegExp(obj){return toStr(obj)==='[object RegExp]'&&(!toStringTag||!(_typeof(obj)==='object'&&toStringTag in obj));}function isError(obj){return toStr(obj)==='[object Error]'&&(!toStringTag||!(_typeof(obj)==='object'&&toStringTag in obj));}function isString(obj){return toStr(obj)==='[object String]'&&(!toStringTag||!(_typeof(obj)==='object'&&toStringTag in obj));}function isNumber(obj){return toStr(obj)==='[object Number]'&&(!toStringTag||!(_typeof(obj)==='object'&&toStringTag in obj));}function isBoolean(obj){return toStr(obj)==='[object Boolean]'&&(!toStringTag||!(_typeof(obj)==='object'&&toStringTag in obj));}// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
|
|
2985
2985
|
function isSymbol(obj){if(hasShammedSymbols){return obj&&_typeof(obj)==='object'&&obj instanceof Symbol;}if(_typeof(obj)==='symbol'){return true;}if(!obj||_typeof(obj)!=='object'||!symToString){return false;}try{symToString.call(obj);return true;}catch(e){}return false;}function isBigInt(obj){if(!obj||_typeof(obj)!=='object'||!bigIntValueOf){return false;}try{bigIntValueOf.call(obj);return true;}catch(e){}return false;}var hasOwn=Object.prototype.hasOwnProperty||function(key){return key in this;};function has(obj,key){return hasOwn.call(obj,key);}function toStr(obj){return objectToString.call(obj);}function nameOf(f){if(f.name){return f.name;}var m=$match.call(functionToString.call(f),/^function\s*([\w$]+)/);if(m){return m[1];}return null;}function indexOf(xs,x){if(xs.indexOf){return xs.indexOf(x);}for(var i=0,l=xs.length;i<l;i++){if(xs[i]===x){return i;}}return-1;}function isMap(x){if(!mapSize||!x||_typeof(x)!=='object'){return false;}try{mapSize.call(x);try{setSize.call(x);}catch(s){return true;}return x instanceof Map;// core-js workaround, pre-v2.5.0
|
|
@@ -3786,7 +3786,7 @@ for/* no condition */(q=delta,k=base;;k+=base){t=k<=bias?tMin:k>=bias+tMax?tMax:
|
|
|
3786
3786
|
if(typeof define=='function'&&_typeof(define.amd)=='object'&&define.amd){define('punycode',function(){return punycode;});}else if(freeExports&&freeModule){if(module.exports==freeExports){// in Node.js, io.js, or RingoJS v0.8.0+
|
|
3787
3787
|
freeModule.exports=punycode;}else{// in Narwhal or RingoJS v0.7.0-
|
|
3788
3788
|
for(key in punycode){punycode.hasOwnProperty(key)&&(freeExports[key]=punycode[key]);}}}else{// in Rhino or a web browser
|
|
3789
|
-
root.punycode=punycode;}})(this);}).call(this);}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{}],149:[function(require,module,exports){'use strict';var replace=String.prototype.replace;var percentTwenties=/%20/g;var Format={RFC1738:'RFC1738',RFC3986:'RFC3986'};module.exports={'default':Format.RFC3986,formatters:{RFC1738:function RFC1738(value){return replace.call(value,percentTwenties,'+');},RFC3986:function RFC3986(value){return String(value);}},RFC1738:Format.RFC1738,RFC3986:Format.RFC3986};},{}],150:[function(require,module,exports){'use strict';var stringify=require('./stringify');var parse=require('./parse');var formats=require('./formats');module.exports={formats:formats,parse:parse,stringify:stringify};},{"./formats":149,"./parse":151,"./stringify":152}],151:[function(require,module,exports){'use strict';var utils=require('./utils');var has=Object.prototype.hasOwnProperty;var isArray=Array.isArray;var defaults={allowDots:false,allowEmptyArrays:false,allowPrototypes:false,allowSparse:false,arrayLimit:20,charset:'utf-8',charsetSentinel:false,comma:false,decodeDotInKeys:false,decoder:utils.decode,delimiter:'&',depth:5,duplicates:'combine',ignoreQueryPrefix:false,interpretNumericEntities:false,parameterLimit:1000,parseArrays:true,plainObjects:false,strictDepth:false,strictNullHandling:false};var interpretNumericEntities=function interpretNumericEntities(str){return str.replace(/&#(\d+);/g,function($0,numberStr){return String.fromCharCode(parseInt(numberStr,10));});};var parseArrayValue=function parseArrayValue(val,options){if(val&&typeof val==='string'&&options.comma&&val.indexOf(',')>-1){return val.split(',');}return val;};// This is what browsers will submit when the ✓ character occurs in an
|
|
3789
|
+
root.punycode=punycode;}})(this);}).call(this);}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{}],149:[function(require,module,exports){'use strict';var replace=String.prototype.replace;var percentTwenties=/%20/g;var Format={RFC1738:'RFC1738',RFC3986:'RFC3986'};module.exports={'default':Format.RFC3986,formatters:{RFC1738:function RFC1738(value){return replace.call(value,percentTwenties,'+');},RFC3986:function RFC3986(value){return String(value);}},RFC1738:Format.RFC1738,RFC3986:Format.RFC3986};},{}],150:[function(require,module,exports){'use strict';var stringify=require('./stringify');var parse=require('./parse');var formats=require('./formats');module.exports={formats:formats,parse:parse,stringify:stringify};},{"./formats":149,"./parse":151,"./stringify":152}],151:[function(require,module,exports){'use strict';var utils=require('./utils');var has=Object.prototype.hasOwnProperty;var isArray=Array.isArray;var defaults={allowDots:false,allowEmptyArrays:false,allowPrototypes:false,allowSparse:false,arrayLimit:20,charset:'utf-8',charsetSentinel:false,comma:false,decodeDotInKeys:false,decoder:utils.decode,delimiter:'&',depth:5,duplicates:'combine',ignoreQueryPrefix:false,interpretNumericEntities:false,parameterLimit:1000,parseArrays:true,plainObjects:false,strictDepth:false,strictNullHandling:false,throwOnLimitExceeded:false};var interpretNumericEntities=function interpretNumericEntities(str){return str.replace(/&#(\d+);/g,function($0,numberStr){return String.fromCharCode(parseInt(numberStr,10));});};var parseArrayValue=function parseArrayValue(val,options,currentArrayLength){if(val&&typeof val==='string'&&options.comma&&val.indexOf(',')>-1){return val.split(',');}if(options.throwOnLimitExceeded&¤tArrayLength>=options.arrayLimit){throw new RangeError('Array limit exceeded. Only '+options.arrayLimit+' element'+(options.arrayLimit===1?'':'s')+' allowed in an array.');}return val;};// This is what browsers will submit when the ✓ character occurs in an
|
|
3790
3790
|
// application/x-www-form-urlencoded body and the encoding of the page containing
|
|
3791
3791
|
// the form is iso-8859-1, or when the submitted form has an accept-charset
|
|
3792
3792
|
// attribute of iso-8859-1. Presumably also with other charsets that do not contain
|
|
@@ -3794,17 +3794,17 @@ root.punycode=punycode;}})(this);}).call(this);}).call(this,typeof global!=="und
|
|
|
3794
3794
|
var isoSentinel='utf8=%26%2310003%3B';// encodeURIComponent('✓')
|
|
3795
3795
|
// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
|
|
3796
3796
|
var charsetSentinel='utf8=%E2%9C%93';// encodeURIComponent('✓')
|
|
3797
|
-
var parseValues=function parseQueryStringValues(str,options){var obj={__proto__:null};var cleanStr=options.ignoreQueryPrefix?str.replace(/^\?/,''):str;cleanStr=cleanStr.replace(/%5B/gi,'[').replace(/%5D/gi,']');var limit=options.parameterLimit===Infinity?undefined:options.parameterLimit;var parts=cleanStr.split(options.delimiter,limit);var skipIndex=-1;// Keep track of where the utf8 sentinel was found
|
|
3797
|
+
var parseValues=function parseQueryStringValues(str,options){var obj={__proto__:null};var cleanStr=options.ignoreQueryPrefix?str.replace(/^\?/,''):str;cleanStr=cleanStr.replace(/%5B/gi,'[').replace(/%5D/gi,']');var limit=options.parameterLimit===Infinity?undefined:options.parameterLimit;var parts=cleanStr.split(options.delimiter,options.throwOnLimitExceeded?limit+1:limit);if(options.throwOnLimitExceeded&&parts.length>limit){throw new RangeError('Parameter limit exceeded. Only '+limit+' parameter'+(limit===1?'':'s')+' allowed.');}var skipIndex=-1;// Keep track of where the utf8 sentinel was found
|
|
3798
3798
|
var i;var charset=options.charset;if(options.charsetSentinel){for(i=0;i<parts.length;++i){if(parts[i].indexOf('utf8=')===0){if(parts[i]===charsetSentinel){charset='utf-8';}else if(parts[i]===isoSentinel){charset='iso-8859-1';}skipIndex=i;i=parts.length;// The eslint settings do not allow break;
|
|
3799
|
-
}}}for(i=0;i<parts.length;++i){if(i===skipIndex){continue;}var part=parts[i];var bracketEqualsPos=part.indexOf(']=');var pos=bracketEqualsPos===-1?part.indexOf('='):bracketEqualsPos+1;var key;var val;if(pos===-1){key=options.decoder(part,defaults.decoder,charset,'key');val=options.strictNullHandling?null:'';}else{key=options.decoder(part.slice(0,pos),defaults.decoder,charset,'key');val=utils.maybeMap(parseArrayValue(part.slice(pos+1),options),function(encodedVal){return options.decoder(encodedVal,defaults.decoder,charset,'value');});}if(val&&options.interpretNumericEntities&&charset==='iso-8859-1'){val=interpretNumericEntities(String(val));}if(part.indexOf('[]=')>-1){val=isArray(val)?[val]:val;}var existing=has.call(obj,key);if(existing&&options.duplicates==='combine'){obj[key]=utils.combine(obj[key],val);}else if(!existing||options.duplicates==='last'){obj[key]=val;}}return obj;};var parseObject=function parseObject(chain,val,options,valuesParsed){var leaf=valuesParsed?val:parseArrayValue(val,options);for(var i=chain.length-1;i>=0;--i){var obj;var root=chain[i];if(root==='[]'&&options.parseArrays){obj=options.allowEmptyArrays&&(leaf===''||options.strictNullHandling&&leaf===null)?[]:[]
|
|
3799
|
+
}}}for(i=0;i<parts.length;++i){if(i===skipIndex){continue;}var part=parts[i];var bracketEqualsPos=part.indexOf(']=');var pos=bracketEqualsPos===-1?part.indexOf('='):bracketEqualsPos+1;var key;var val;if(pos===-1){key=options.decoder(part,defaults.decoder,charset,'key');val=options.strictNullHandling?null:'';}else{key=options.decoder(part.slice(0,pos),defaults.decoder,charset,'key');val=utils.maybeMap(parseArrayValue(part.slice(pos+1),options,isArray(obj[key])?obj[key].length:0),function(encodedVal){return options.decoder(encodedVal,defaults.decoder,charset,'value');});}if(val&&options.interpretNumericEntities&&charset==='iso-8859-1'){val=interpretNumericEntities(String(val));}if(part.indexOf('[]=')>-1){val=isArray(val)?[val]:val;}var existing=has.call(obj,key);if(existing&&options.duplicates==='combine'){obj[key]=utils.combine(obj[key],val);}else if(!existing||options.duplicates==='last'){obj[key]=val;}}return obj;};var parseObject=function parseObject(chain,val,options,valuesParsed){var currentArrayLength=0;if(chain.length>0&&chain[chain.length-1]==='[]'){var parentKey=chain.slice(0,-1).join('');currentArrayLength=Array.isArray(val)&&val[parentKey]?val[parentKey].length:0;}var leaf=valuesParsed?val:parseArrayValue(val,options,currentArrayLength);for(var i=chain.length-1;i>=0;--i){var obj;var root=chain[i];if(root==='[]'&&options.parseArrays){obj=options.allowEmptyArrays&&(leaf===''||options.strictNullHandling&&leaf===null)?[]:utils.combine([],leaf);}else{obj=options.plainObjects?{__proto__:null}:{};var cleanRoot=root.charAt(0)==='['&&root.charAt(root.length-1)===']'?root.slice(1,-1):root;var decodedRoot=options.decodeDotInKeys?cleanRoot.replace(/%2E/g,'.'):cleanRoot;var index=parseInt(decodedRoot,10);if(!options.parseArrays&&decodedRoot===''){obj={0:leaf};}else if(!isNaN(index)&&root!==decodedRoot&&String(index)===decodedRoot&&index>=0&&options.parseArrays&&index<=options.arrayLimit){obj=[];obj[index]=leaf;}else if(decodedRoot!=='__proto__'){obj[decodedRoot]=leaf;}}leaf=obj;}return leaf;};var parseKeys=function parseQueryStringKeys(givenKey,val,options,valuesParsed){if(!givenKey){return;}// Transform dot notation to bracket notation
|
|
3800
3800
|
var key=options.allowDots?givenKey.replace(/\.([^.[]+)/g,'[$1]'):givenKey;// The regex chunks
|
|
3801
3801
|
var brackets=/(\[[^[\]]*])/;var child=/(\[[^[\]]*])/g;// Get the parent
|
|
3802
3802
|
var segment=options.depth>0&&brackets.exec(key);var parent=segment?key.slice(0,segment.index):key;// Stash the parent if it exists
|
|
3803
3803
|
var keys=[];if(parent){// If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
|
|
3804
3804
|
if(!options.plainObjects&&has.call(Object.prototype,parent)){if(!options.allowPrototypes){return;}}keys.push(parent);}// Loop through children appending to the array until we hit depth
|
|
3805
3805
|
var i=0;while(options.depth>0&&(segment=child.exec(key))!==null&&i<options.depth){i+=1;if(!options.plainObjects&&has.call(Object.prototype,segment[1].slice(1,-1))){if(!options.allowPrototypes){return;}}keys.push(segment[1]);}// If there's a remainder, check strictDepth option for throw, else just add whatever is left
|
|
3806
|
-
if(segment){if(options.strictDepth===true){throw new RangeError('Input depth exceeded depth option of '+options.depth+' and strictDepth is true');}keys.push('['+key.slice(segment.index)+']');}return parseObject(keys,val,options,valuesParsed);};var normalizeParseOptions=function normalizeParseOptions(opts){if(!opts){return defaults;}if(typeof opts.allowEmptyArrays!=='undefined'&&typeof opts.allowEmptyArrays!=='boolean'){throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');}if(typeof opts.decodeDotInKeys!=='undefined'&&typeof opts.decodeDotInKeys!=='boolean'){throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');}if(opts.decoder!==null&&typeof opts.decoder!=='undefined'&&typeof opts.decoder!=='function'){throw new TypeError('Decoder has to be a function.');}if(typeof opts.charset!=='undefined'&&opts.charset!=='utf-8'&&opts.charset!=='iso-8859-1'){throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');}var charset=typeof opts.charset==='undefined'?defaults.charset:opts.charset;var duplicates=typeof opts.duplicates==='undefined'?defaults.duplicates:opts.duplicates;if(duplicates!=='combine'&&duplicates!=='first'&&duplicates!=='last'){throw new TypeError('The duplicates option must be either combine, first, or last');}var allowDots=typeof opts.allowDots==='undefined'?opts.decodeDotInKeys===true?true:defaults.allowDots:!!opts.allowDots;return{allowDots:allowDots,allowEmptyArrays:typeof opts.allowEmptyArrays==='boolean'?!!opts.allowEmptyArrays:defaults.allowEmptyArrays,allowPrototypes:typeof opts.allowPrototypes==='boolean'?opts.allowPrototypes:defaults.allowPrototypes,allowSparse:typeof opts.allowSparse==='boolean'?opts.allowSparse:defaults.allowSparse,arrayLimit:typeof opts.arrayLimit==='number'?opts.arrayLimit:defaults.arrayLimit,charset:charset,charsetSentinel:typeof opts.charsetSentinel==='boolean'?opts.charsetSentinel:defaults.charsetSentinel,comma:typeof opts.comma==='boolean'?opts.comma:defaults.comma,decodeDotInKeys:typeof opts.decodeDotInKeys==='boolean'?opts.decodeDotInKeys:defaults.decodeDotInKeys,decoder:typeof opts.decoder==='function'?opts.decoder:defaults.decoder,delimiter:typeof opts.delimiter==='string'||utils.isRegExp(opts.delimiter)?opts.delimiter:defaults.delimiter,// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
|
3807
|
-
depth:typeof opts.depth==='number'||opts.depth===false?+opts.depth:defaults.depth,duplicates:duplicates,ignoreQueryPrefix:opts.ignoreQueryPrefix===true,interpretNumericEntities:typeof opts.interpretNumericEntities==='boolean'?opts.interpretNumericEntities:defaults.interpretNumericEntities,parameterLimit:typeof opts.parameterLimit==='number'?opts.parameterLimit:defaults.parameterLimit,parseArrays:opts.parseArrays!==false,plainObjects:typeof opts.plainObjects==='boolean'?opts.plainObjects:defaults.plainObjects,strictDepth:typeof opts.strictDepth==='boolean'?!!opts.strictDepth:defaults.strictDepth,strictNullHandling:typeof opts.strictNullHandling==='boolean'?opts.strictNullHandling:defaults.strictNullHandling};};module.exports=function(str,opts){var options=normalizeParseOptions(opts);if(str===''||str===null||typeof str==='undefined'){return options.plainObjects?{__proto__:null}:{};}var tempObj=typeof str==='string'?parseValues(str,options):str;var obj=options.plainObjects?{__proto__:null}:{};// Iterate over the keys and setup the new object
|
|
3806
|
+
if(segment){if(options.strictDepth===true){throw new RangeError('Input depth exceeded depth option of '+options.depth+' and strictDepth is true');}keys.push('['+key.slice(segment.index)+']');}return parseObject(keys,val,options,valuesParsed);};var normalizeParseOptions=function normalizeParseOptions(opts){if(!opts){return defaults;}if(typeof opts.allowEmptyArrays!=='undefined'&&typeof opts.allowEmptyArrays!=='boolean'){throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');}if(typeof opts.decodeDotInKeys!=='undefined'&&typeof opts.decodeDotInKeys!=='boolean'){throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');}if(opts.decoder!==null&&typeof opts.decoder!=='undefined'&&typeof opts.decoder!=='function'){throw new TypeError('Decoder has to be a function.');}if(typeof opts.charset!=='undefined'&&opts.charset!=='utf-8'&&opts.charset!=='iso-8859-1'){throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');}if(typeof opts.throwOnLimitExceeded!=='undefined'&&typeof opts.throwOnLimitExceeded!=='boolean'){throw new TypeError('`throwOnLimitExceeded` option must be a boolean');}var charset=typeof opts.charset==='undefined'?defaults.charset:opts.charset;var duplicates=typeof opts.duplicates==='undefined'?defaults.duplicates:opts.duplicates;if(duplicates!=='combine'&&duplicates!=='first'&&duplicates!=='last'){throw new TypeError('The duplicates option must be either combine, first, or last');}var allowDots=typeof opts.allowDots==='undefined'?opts.decodeDotInKeys===true?true:defaults.allowDots:!!opts.allowDots;return{allowDots:allowDots,allowEmptyArrays:typeof opts.allowEmptyArrays==='boolean'?!!opts.allowEmptyArrays:defaults.allowEmptyArrays,allowPrototypes:typeof opts.allowPrototypes==='boolean'?opts.allowPrototypes:defaults.allowPrototypes,allowSparse:typeof opts.allowSparse==='boolean'?opts.allowSparse:defaults.allowSparse,arrayLimit:typeof opts.arrayLimit==='number'?opts.arrayLimit:defaults.arrayLimit,charset:charset,charsetSentinel:typeof opts.charsetSentinel==='boolean'?opts.charsetSentinel:defaults.charsetSentinel,comma:typeof opts.comma==='boolean'?opts.comma:defaults.comma,decodeDotInKeys:typeof opts.decodeDotInKeys==='boolean'?opts.decodeDotInKeys:defaults.decodeDotInKeys,decoder:typeof opts.decoder==='function'?opts.decoder:defaults.decoder,delimiter:typeof opts.delimiter==='string'||utils.isRegExp(opts.delimiter)?opts.delimiter:defaults.delimiter,// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
|
3807
|
+
depth:typeof opts.depth==='number'||opts.depth===false?+opts.depth:defaults.depth,duplicates:duplicates,ignoreQueryPrefix:opts.ignoreQueryPrefix===true,interpretNumericEntities:typeof opts.interpretNumericEntities==='boolean'?opts.interpretNumericEntities:defaults.interpretNumericEntities,parameterLimit:typeof opts.parameterLimit==='number'?opts.parameterLimit:defaults.parameterLimit,parseArrays:opts.parseArrays!==false,plainObjects:typeof opts.plainObjects==='boolean'?opts.plainObjects:defaults.plainObjects,strictDepth:typeof opts.strictDepth==='boolean'?!!opts.strictDepth:defaults.strictDepth,strictNullHandling:typeof opts.strictNullHandling==='boolean'?opts.strictNullHandling:defaults.strictNullHandling,throwOnLimitExceeded:typeof opts.throwOnLimitExceeded==='boolean'?opts.throwOnLimitExceeded:false};};module.exports=function(str,opts){var options=normalizeParseOptions(opts);if(str===''||str===null||typeof str==='undefined'){return options.plainObjects?{__proto__:null}:{};}var tempObj=typeof str==='string'?parseValues(str,options):str;var obj=options.plainObjects?{__proto__:null}:{};// Iterate over the keys and setup the new object
|
|
3808
3808
|
var keys=Object.keys(tempObj);for(var i=0;i<keys.length;++i){var key=keys[i];var newObj=parseKeys(key,tempObj[key],options,typeof str==='string');obj=utils.merge(obj,newObj,options);}if(options.allowSparse===true){return obj;}return utils.compact(obj);};},{"./utils":153}],152:[function(require,module,exports){'use strict';var getSideChannel=require('side-channel');var utils=require('./utils');var formats=require('./formats');var has=Object.prototype.hasOwnProperty;var arrayPrefixGenerators={brackets:function brackets(prefix){return prefix+'[]';},comma:'comma',indices:function indices(prefix,key){return prefix+'['+key+']';},repeat:function repeat(prefix){return prefix;}};var isArray=Array.isArray;var push=Array.prototype.push;var pushToArray=function pushToArray(arr,valueOrArray){push.apply(arr,isArray(valueOrArray)?valueOrArray:[valueOrArray]);};var toISO=Date.prototype.toISOString;var defaultFormat=formats['default'];var defaults={addQueryPrefix:false,allowDots:false,allowEmptyArrays:false,arrayFormat:'indices',charset:'utf-8',charsetSentinel:false,commaRoundTrip:false,delimiter:'&',encode:true,encodeDotInKeys:false,encoder:utils.encode,encodeValuesOnly:false,filter:void undefined,format:defaultFormat,formatter:formats.formatters[defaultFormat],// deprecated
|
|
3809
3809
|
indices:false,serializeDate:function serializeDate(date){return toISO.call(date);},skipNulls:false,strictNullHandling:false};var isNonNullishPrimitive=function isNonNullishPrimitive(v){return typeof v==='string'||typeof v==='number'||typeof v==='boolean'||_typeof(v)==='symbol'||typeof v==='bigint';};var sentinel={};var stringify=function stringify(object,prefix,generateArrayPrefix,commaRoundTrip,allowEmptyArrays,strictNullHandling,skipNulls,encodeDotInKeys,encoder,filter,sort,allowDots,serializeDate,format,formatter,encodeValuesOnly,charset,sideChannel){var obj=object;var tmpSc=sideChannel;var step=0;var findFlag=false;while((tmpSc=tmpSc.get(sentinel))!==void undefined&&!findFlag){// Where object last appeared in the ref tree
|
|
3810
3810
|
var pos=tmpSc.get(object);step+=1;if(typeof pos!=='undefined'){if(pos===step){throw new RangeError('Cyclic object value');}else{findFlag=true;// Break while
|
|
@@ -3943,7 +3943,7 @@ if(self._mode==='moz-chunked-arraybuffer'){xhr.onprogress=function(){self._onXHR
|
|
|
3943
3943
|
*/function statusValid(xhr){try{var status=xhr.status;return status!==null&&status!==0;}catch(e){return false;}}ClientRequest.prototype._onXHRProgress=function(){var self=this;self._resetTimers(false);if(!statusValid(self._xhr)||self._destroyed)return;if(!self._response)self._connect();self._response._onXHRProgress(self._resetTimers.bind(self));};ClientRequest.prototype._connect=function(){var self=this;if(self._destroyed)return;self._response=new IncomingMessage(self._xhr,self._fetchResponse,self._mode,self._resetTimers.bind(self));self._response.on('error',function(err){self.emit('error',err);});self.emit('response',self._response);};ClientRequest.prototype._write=function(chunk,encoding,cb){var self=this;self._body.push(chunk);cb();};ClientRequest.prototype._resetTimers=function(done){var self=this;global.clearTimeout(self._socketTimer);self._socketTimer=null;if(done){global.clearTimeout(self._fetchTimer);self._fetchTimer=null;}else if(self._socketTimeout){self._socketTimer=global.setTimeout(function(){self.emit('timeout');},self._socketTimeout);}};ClientRequest.prototype.abort=ClientRequest.prototype.destroy=function(err){var self=this;self._destroyed=true;self._resetTimers(true);if(self._response)self._response._destroyed=true;if(self._xhr)self._xhr.abort();else if(self._fetchAbortController)self._fetchAbortController.abort();if(err)self.emit('error',err);};ClientRequest.prototype.end=function(data,encoding,cb){var self=this;if(typeof data==='function'){cb=data;data=undefined;}stream.Writable.prototype.end.call(self,data,encoding,cb);};ClientRequest.prototype.setTimeout=function(timeout,cb){var self=this;if(cb)self.once('timeout',cb);self._socketTimeout=timeout;self._resetTimers(false);};ClientRequest.prototype.flushHeaders=function(){};ClientRequest.prototype.setNoDelay=function(){};ClientRequest.prototype.setSocketKeepAlive=function(){};// Taken from http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader%28%29-method
|
|
3944
3944
|
var unsafeHeaders=['accept-charset','accept-encoding','access-control-request-headers','access-control-request-method','connection','content-length','cookie','cookie2','date','dnt','expect','host','keep-alive','origin','referer','te','trailer','transfer-encoding','upgrade','via'];}).call(this);}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer);},{"./capability":165,"./response":167,"_process":147,"buffer":20,"inherits":112,"readable-stream":182}],167:[function(require,module,exports){(function(process,global,Buffer){(function(){var capability=require('./capability');var inherits=require('inherits');var stream=require('readable-stream');var rStates=exports.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4};var IncomingMessage=exports.IncomingMessage=function(xhr,response,mode,resetTimers){var self=this;stream.Readable.call(self);self._mode=mode;self.headers={};self.rawHeaders=[];self.trailers={};self.rawTrailers=[];// Fake the 'close' event, but only once 'end' fires
|
|
3945
3945
|
self.on('end',function(){// The nextTick is necessary to prevent the 'request' module from causing an infinite loop
|
|
3946
|
-
process.nextTick(function(){self.emit('close');});});if(mode==='fetch'){var _read=function read(){reader.read().then(function(result){if(self._destroyed)return;resetTimers(result.done);if(result.done){self.push(null);return;}self.push(Buffer.from(result.value));_read();})
|
|
3946
|
+
process.nextTick(function(){self.emit('close');});});if(mode==='fetch'){var _read=function read(){reader.read().then(function(result){if(self._destroyed)return;resetTimers(result.done);if(result.done){self.push(null);return;}self.push(Buffer.from(result.value));_read();}).catch(function(err){resetTimers(true);if(!self._destroyed)self.emit('error',err);});};self._fetchResponse=response;self.url=response.url;self.statusCode=response.status;self.statusMessage=response.statusText;response.headers.forEach(function(header,key){self.headers[key.toLowerCase()]=header;self.rawHeaders.push(key,header);});if(capability.writableStream){var writable=new WritableStream({write:function write(chunk){resetTimers(false);return new Promise(function(resolve,reject){if(self._destroyed){reject();}else if(self.push(Buffer.from(chunk))){resolve();}else{self._resumeFetch=resolve;}});},close:function close(){resetTimers(true);if(!self._destroyed)self.push(null);},abort:function abort(err){resetTimers(true);if(!self._destroyed)self.emit('error',err);}});try{response.body.pipeTo(writable).catch(function(err){resetTimers(true);if(!self._destroyed)self.emit('error',err);});return;}catch(e){}// pipeTo method isn't defined. Can't find a better way to feature test this
|
|
3947
3947
|
}// fallback for when writableStream or pipeTo aren't available
|
|
3948
3948
|
var reader=response.body.getReader();_read();}else{self._xhr=xhr;self._pos=0;self.url=xhr.responseURL;self.statusCode=xhr.status;self.statusMessage=xhr.statusText;var headers=xhr.getAllResponseHeaders().split(/\r?\n/);headers.forEach(function(header){var matches=header.match(/^([^:]+):\s*(.*)/);if(matches){var key=matches[1].toLowerCase();if(key==='set-cookie'){if(self.headers[key]===undefined){self.headers[key]=[];}self.headers[key].push(matches[2]);}else if(self.headers[key]!==undefined){self.headers[key]+=', '+matches[2];}else{self.headers[key]=matches[2];}self.rawHeaders.push(matches[1],matches[2]);}});self._charset='x-user-defined';if(!capability.overrideMimeType){var mimeType=self.rawHeaders['mime-type'];if(mimeType){var charsetMatch=mimeType.match(/;\s*charset=([^;])(;|$)/);if(charsetMatch){self._charset=charsetMatch[1].toLowerCase();}}if(!self._charset)self._charset='utf-8';// best guess
|
|
3949
3949
|
}}};inherits(IncomingMessage,stream.Readable);IncomingMessage.prototype._read=function(){var self=this;var resolve=self._resumeFetch;if(resolve){self._resumeFetch=null;resolve();}};IncomingMessage.prototype._onXHRProgress=function(resetTimers){var self=this;var xhr=self._xhr;var response=null;switch(self._mode){case'text':response=xhr.responseText;if(response.length>self._pos){var newData=response.substr(self._pos);if(self._charset==='x-user-defined'){var buffer=Buffer.alloc(newData.length);for(var i=0;i<newData.length;i++)buffer[i]=newData.charCodeAt(i)&0xff;self.push(buffer);}else{self.push(newData,self._charset);}self._pos=response.length;}break;case'arraybuffer':if(xhr.readyState!==rStates.DONE||!xhr.response)break;response=xhr.response;self.push(Buffer.from(new Uint8Array(response)));break;case'moz-chunked-arraybuffer':// take whole
|
|
@@ -4444,7 +4444,7 @@ var realHasInstance;if(typeof Symbol==='function'&&Symbol.hasInstance&&typeof Fu
|
|
|
4444
4444
|
// Checking for a Stream.Duplex instance is faster here instead of inside
|
|
4445
4445
|
// the WritableState constructor, at least with V8 6.5
|
|
4446
4446
|
var isDuplex=this instanceof Duplex;if(!isDuplex&&!realHasInstance.call(Writable,this))return new Writable(options);this._writableState=new WritableState(options,this,isDuplex);// legacy.
|
|
4447
|
-
this.writable=true;if(options){if(typeof options.write==='function')this._write=options.write;if(typeof options.writev==='function')this._writev=options.writev;if(typeof options.destroy==='function')this._destroy=options.destroy;if(typeof options
|
|
4447
|
+
this.writable=true;if(options){if(typeof options.write==='function')this._write=options.write;if(typeof options.writev==='function')this._writev=options.writev;if(typeof options.destroy==='function')this._destroy=options.destroy;if(typeof options.final==='function')this._final=options.final;}Stream.call(this);}// Otherwise people can pipe Writable streams, which is just wrong.
|
|
4448
4448
|
Writable.prototype.pipe=function(){errorOrDestroy(this,new ERR_STREAM_CANNOT_PIPE());};function writeAfterEnd(stream,cb){var er=new ERR_STREAM_WRITE_AFTER_END();// TODO: defer error events consistently everywhere, not just the cb
|
|
4449
4449
|
errorOrDestroy(stream,er);process.nextTick(cb,er);}// Checks that a user-supplied chunk is valid, especially for the particular
|
|
4450
4450
|
// mode the stream is in. Currently this means that `null` is never accepted
|
|
@@ -4574,7 +4574,7 @@ exports.StringDecoder=StringDecoder;function StringDecoder(encoding){this.encodi
|
|
|
4574
4574
|
StringDecoder.prototype.text=utf8Text;// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
|
|
4575
4575
|
StringDecoder.prototype.fillLast=function(buf){if(this.lastNeed<=buf.length){buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal);}buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,buf.length);this.lastNeed-=buf.length;};// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
|
|
4576
4576
|
// continuation byte. If an invalid byte is detected, -2 is returned.
|
|
4577
|
-
function utf8CheckByte(
|
|
4577
|
+
function utf8CheckByte(byte){if(byte<=0x7F)return 0;else if(byte>>5===0x06)return 2;else if(byte>>4===0x0E)return 3;else if(byte>>3===0x1E)return 4;return byte>>6===0x02?-1:-2;}// Checks at most 3 bytes at the end of a Buffer in order to detect an
|
|
4578
4578
|
// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
|
|
4579
4579
|
// needed to complete the UTF-8 character (if applicable) are returned.
|
|
4580
4580
|
function utf8CheckIncomplete(self,buf,i){var j=buf.length-1;if(j<i)return 0;var nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-1;return nb;}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-2;return nb;}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0){if(nb===2)nb=0;else self.lastNeed=nb-3;}return nb;}return 0;}// Validates as many continuation bytes for a multi-byte UTF-8 character as
|
|
@@ -4812,7 +4812,7 @@ try{if(!global.localStorage)return false;}catch(_){return false;}var val=global.
|
|
|
4812
4812
|
// presumably different callback function.
|
|
4813
4813
|
// This makes sure that own properties are retained, so that
|
|
4814
4814
|
// decorations and such are not lost along the way.
|
|
4815
|
-
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;}}},{}],188:[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;}},{}],189:[function(require,module,exports){module.exports={"name":"pict","version":"1.0.
|
|
4815
|
+
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;}}},{}],188:[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;}},{}],189:[function(require,module,exports){module.exports={"name":"pict","version":"1.0.241","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.25.1","@types/jquery":"^3.5.32","eslint":"^9.25.1","globals":"^16.0.0","quackage":"^1.0.41"},"dependencies":{"cachetrax":"^1.0.4","fable":"^3.1.3","pict-application":"^1.0.25","pict-provider":"^1.0.3","pict-template":"^1.0.10","pict-view":"^1.0.60","typescript":"^5.8.3"}};},{}],190:[function(require,module,exports){// This assumes Pict has been required in the browser. Delcare these as globals so linter can do its job.
|
|
4816
4816
|
/* global Pict, _Pict: writeable *//**
|
|
4817
4817
|
* Simple function to load a pict Application
|
|
4818
4818
|
*
|
|
@@ -4976,8 +4976,8 @@ var tmpTargetElement=typeof pAddress==='string'?window.jQuery(pAddress):window.j
|
|
|
4976
4976
|
var tmpTargetElement=typeof pAddress==='string'?window.jQuery(pAddress):window.jQuery(pAddress);return tmpTargetElement.hasClass(pClass);}else if(this.inBrowser&&this.hasDocument){var tmpTargetElementSet=typeof pAddress==='string'?window.document.querySelectorAll(pAddress):[pAddress];for(var i=0;i<tmpTargetElementSet.length;i++){if(tmpTargetElementSet[i].classList.contains(pClass)){return true;}}return false;}else{this.log.trace("PICT Content HASCLASS for [".concat(pAddress,"] CLASS [").concat(pClass,"]:"));return false;}}}]);}(libFableServiceBase);module.exports=PictContentAssignment;},{"fable":68}],194:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictDataProvider=/*#__PURE__*/function(_libFableServiceBase20){function PictDataProvider(pFable,pOptions,pServiceHash){var _this73;_classCallCheck2(this,PictDataProvider);_this73=_callSuper(this,PictDataProvider,[pFable,pOptions,pServiceHash]);/** @type {import('fable') & import('pict')} */_this73.fable;_this73.serviceType='PictDataProvider';return _this73;}/**
|
|
4977
4977
|
* @param {string} pAddress - The address of the data to retrieve
|
|
4978
4978
|
* @param {object} [pData] - (optional) The record to provide to the address resolver
|
|
4979
|
-
*/_inherits(PictDataProvider,_libFableServiceBase20);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}],195:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictMeadowEntityProvider=/*#__PURE__*/function(_libFableServiceBase21){function PictMeadowEntityProvider(pFable,pOptions,pServiceHash){var _this74;_classCallCheck2(this,PictMeadowEntityProvider);_this74=_callSuper(this,PictMeadowEntityProvider,[pFable,pOptions,pServiceHash]);/** @type {any} */_this74.options;/** @type {import('pict') & { settings: any }} */_this74.fable;_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
|
|
4980
|
-
_this74.restClient=_this74.fable.instantiateServiceProviderWithoutRegistration('RestClient');_this74.cache={};_this74.prepareRequestOptions=function(pOptions){return pOptions;};return _this74;}_inherits(PictMeadowEntityProvider,_libFableServiceBase21);return _createClass2(PictMeadowEntityProvider,[{key:"initializeCache",value:function initializeCache(pEntity){// This should not be happening as often as it's happening.
|
|
4979
|
+
*/_inherits(PictDataProvider,_libFableServiceBase20);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}],195:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictMeadowEntityProvider=/*#__PURE__*/function(_libFableServiceBase21){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 }} */_this74.fable;_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
|
|
4980
|
+
_this74.restClient=(_this74$fable$RestCli=_this74.fable.RestClient)!==null&&_this74$fable$RestCli!==void 0?_this74$fable$RestCli:_this74.fable.instantiateServiceProviderWithoutRegistration('RestClient');_this74.cache={};_this74.prepareRequestOptions=function(pOptions){return pOptions;};return _this74;}_inherits(PictMeadowEntityProvider,_libFableServiceBase21);return _createClass2(PictMeadowEntityProvider,[{key:"initializeCache",value:function initializeCache(pEntity){// This should not be happening as often as it's happening.
|
|
4981
4981
|
if(!(pEntity in this.cache)){//@ts-ignore - FIXME - remove once we have fable types
|
|
4982
4982
|
this.cache[pEntity]=this.fable.instantiateServiceProviderWithoutRegistration('ObjectCache');// TODO: Make this a configuration?
|
|
4983
4983
|
// For now cache for 30 seconds.
|
|
@@ -5052,112 +5052,113 @@ if(!(pTemplateHash in this.templates)){this.checkDefaultTemplateHash(pTemplateHa
|
|
|
5052
5052
|
* getUUID: () => string,
|
|
5053
5053
|
* Utility:
|
|
5054
5054
|
* {
|
|
5055
|
-
*
|
|
5056
|
-
*
|
|
5055
|
+
* extend: (pObject: any, ...pExtension: any[]) => any,
|
|
5056
|
+
* eachLimit: (pArray: any[], pLimit: number, pIterator: (pRecord: any, fRecordCallback: () => void) => void, fCallback: (pError: any) => void) => void,
|
|
5057
5057
|
* },
|
|
5058
5058
|
* MetaTemplate: any,
|
|
5059
5059
|
* }} Fable
|
|
5060
5060
|
*//** @type {{ new(...args: any[]): Fable }} */var libFable=require("fable");var libPackage=require("../package.json");var PictTemplateProvider=require("./Pict-Template-Provider.js");var PictContentAssignment=require("./Pict-Content-Assignment.js");var PictDataProvider=require("./Pict-DataProvider.js");var PictCSS=require("./Pict-CSS.js");var PictMeadowEntityProvider=require("./Pict-Meadow-EntityProvider.js");/**
|
|
5061
5061
|
* Pict management object.
|
|
5062
5062
|
*/var Pict=/*#__PURE__*/function(_libFable){/**
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
/** @type {any} */_this78.log
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5063
|
+
* @param {Object<String, any>} pSettings - The settings for the Pict instance.
|
|
5064
|
+
*/function Pict(pSettings){var _this78;_classCallCheck2(this,Pict);_this78=_callSuper(this,Pict,[pSettings]);/** @type {any} */_this78.settings;_this78.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}");/** @type {Object} */_this78._PackageFable=_this78._Package;_this78._Package=libPackage;_this78.browserAddress="window._Pict";if("BrowserAddress"in _this78.settings){_this78.browserAddress=_this78.settings.BrowserAddress;}_this78.children=[];/** @type {import('pict-application')} */_this78.PictApplication=null;// shim types from fable until we export types properly
|
|
5065
|
+
/** @type {any} */_this78.log;//NOTE: This needs to come before any other providers which may instantiate a rest client so we don't proliferate them
|
|
5066
|
+
_this78.instantiateServiceProvider("RestClient");/**
|
|
5067
|
+
* The templateProvider provides a basic key->template mapping with default fallback capabilities
|
|
5068
|
+
*
|
|
5069
|
+
* @type {PictTemplateProvider}
|
|
5070
|
+
*/_this78.TemplateProvider=null;_this78.addAndInstantiateServiceType("TemplateProvider",PictTemplateProvider);/**
|
|
5071
|
+
* The meadow entity provider.
|
|
5072
|
+
*
|
|
5073
|
+
* @type {PictMeadowEntityProvider}
|
|
5074
|
+
*/_this78.EntityProvider=null;_this78.addAndInstantiateServiceType("EntityProvider",PictMeadowEntityProvider);/**
|
|
5075
|
+
* The data provider.
|
|
5076
|
+
*
|
|
5077
|
+
* @type {PictDataProvider}
|
|
5078
|
+
*/_this78.DataProvider=null;_this78.addAndInstantiateServiceType("DataProvider",PictDataProvider);/**
|
|
5079
|
+
* The content assignment module.
|
|
5080
|
+
*
|
|
5081
|
+
* @type {PictContentAssignment}
|
|
5082
|
+
*/_this78.ContentAssignment=null;_this78.addAndInstantiateServiceType("ContentAssignment",PictContentAssignment);/**
|
|
5083
|
+
* The CSS module.
|
|
5084
|
+
*
|
|
5085
|
+
* @type {PictCSS}
|
|
5086
|
+
* @public
|
|
5087
|
+
*/_this78.CSSMap=null;_this78.addAndInstantiateServiceType("CSSMap",PictCSS);_this78.addServiceType("PictTemplate",require("pict-template"));_this78.instantiateServiceProvider("MetaTemplate");_this78.instantiateServiceProvider("DataGeneration");_this78.manifest=_this78.instantiateServiceProvider("Manifest");_this78.AppData={};if("DefaultAppData"in _this78.fable.settings){_this78.AppData=_this78.fable.settings.DefaultAppData;}_this78.Bundle={};// Log noisness goes from 0 - 5, where 5 is show me everything.
|
|
5087
5088
|
_this78.LogNoisiness=0;// Although we have log noisiness, sometimes we need control flow without all the other noise for hard to diagnose interpreters.
|
|
5088
5089
|
_this78.LogControlFlow=false;// And an easy way to be introspective about data at various locations
|
|
5089
5090
|
_this78.LogControlFlowWatchAddressList=[];// Load manifest sets
|
|
5090
5091
|
if(_this78.settings.Manifests){_this78.loadManifestSet(_this78.settings.Manifests);}_this78._DefaultPictTemplatesInitialized=false;_this78.initializePictTemplateEngine();_this78.addServiceType("PictView",require("pict-view"));_this78.addServiceType("PictProvider",require("pict-provider"));_this78.addServiceType("PictApplication",require("pict-application"));// Expose the named views directly, through a convenience accessor
|
|
5091
5092
|
_this78.providers=_this78.servicesMap.PictProvider;_this78.views=_this78.servicesMap.PictView;return _this78;}/**
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5093
|
+
* Load manifests in as Hashed services
|
|
5094
|
+
*
|
|
5095
|
+
* @param {Object<String, String>} pManifestSet - The manifest set to load.
|
|
5096
|
+
*/_inherits(Pict,_libFable);return _createClass2(Pict,[{key:"loadManifestSet",value:function loadManifestSet(pManifestSet){if(_typeof(pManifestSet)!="object"){this.log.warn("PICT [".concat(this.UUID,"] could not load Manifest Set; pManifestSet was not an object."));return;}var tmpManifestKeys=Object.keys(pManifestSet);if(tmpManifestKeys.length>0){for(var i=0;i<tmpManifestKeys.length;i++){// Load each manifest
|
|
5096
5097
|
var tmpManifestKey=tmpManifestKeys[i];this.instantiateServiceProvider("Manifest",pManifestSet[tmpManifestKey],tmpManifestKey);}}}/**
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5098
|
+
* Add a template expression to the template engine from the PictTemplate service.
|
|
5099
|
+
*
|
|
5100
|
+
* @template {new (...args: any[]) => any} T
|
|
5101
|
+
* @param {T} pTemplatePrototype - The prototype class for the template expression
|
|
5102
|
+
*
|
|
5103
|
+
* @return {InstanceType<T>} the service instance, or null if the prototype was invalid
|
|
5104
|
+
*/},{key:"addTemplate",value:function addTemplate(pTemplatePrototype){if(typeof pTemplatePrototype!="function"){this.log.warn("PICT [".concat(this.UUID,"] could not add Template; pTemplatePrototype was not a class it was ").concat(_typeof(pTemplatePrototype),"."));return null;}var tmpTemplateHash=pTemplatePrototype["template_hash"];if(this.LogNoisiness>1){this.log.info("PICT-ControlFlow addTemplate [".concat(tmpTemplateHash,"]"));}return this.instantiateServiceProviderFromPrototype("PictTemplate",{},tmpTemplateHash,pTemplatePrototype);}/**
|
|
5105
|
+
* Just passing an options will construct one for us.
|
|
5106
|
+
* Passing a hash will set the hash.
|
|
5107
|
+
* Passing a prototype will use that!
|
|
5108
|
+
*
|
|
5109
|
+
* @template {new (...args: any[]) => any} [T=typeof import('pict-view')]
|
|
5110
|
+
* @param {String} pViewHash - The hash of the view.
|
|
5111
|
+
* @param {Object<String, any>} [pOptions] - The options for the view.
|
|
5112
|
+
* @param {T} [pViewPrototype] - The prototype for the view.
|
|
5113
|
+
*
|
|
5114
|
+
* @return {InstanceType<T>} The view instance.
|
|
5115
|
+
*/},{key:"addView",value:function addView(pViewHash,pOptions,pViewPrototype){var tmpOptions=_typeof(pOptions)=="object"?pOptions:{};var tmpViewHash=typeof pViewHash=="string"?pViewHash:this.fable.getUUID();// This is here to change how the value is managed by webpack
|
|
5115
5116
|
var tmpViewPrototype=pViewPrototype;if(this.LogControlFlow){if(this.LogNoisiness>1){this.log.info("PICT-ControlFlow addView [".concat(tmpViewHash,"]:"),{Options:tmpOptions});}else{this.log.info("PICT-ControlFlow addView [".concat(tmpViewHash,"]"));}}if(tmpViewPrototype){// If the prototype has a default_configuration, it will be merged with options.
|
|
5116
5117
|
var tmpDefaultViewConfiguration=tmpViewPrototype["default_configuration"];if(tmpDefaultViewConfiguration){tmpOptions=this.fable.Utility.extend({},JSON.parse(JSON.stringify(tmpDefaultViewConfiguration)),tmpOptions);}return this.instantiateServiceProviderFromPrototype("PictView",tmpOptions,tmpViewHash,tmpViewPrototype);}else{return this.instantiateServiceProvider("PictView",tmpOptions,tmpViewHash);}}/**
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5118
|
+
* Add a provider unless one already exists, then return that one.
|
|
5119
|
+
*
|
|
5120
|
+
* Just passing an options will construct one for us.
|
|
5121
|
+
* Passing a hash will set the hash.
|
|
5122
|
+
* Passing a prototype will use that!
|
|
5123
|
+
*
|
|
5124
|
+
* @param {String} pProviderHash - The hash of the provider.
|
|
5125
|
+
* @param {Object<String, any>} [pOptions] - The options for the provider.
|
|
5126
|
+
* @param {any} [pProviderPrototype] - The prototype for the provider.
|
|
5127
|
+
*
|
|
5128
|
+
* FIXME: refer to PictProvider here once it has a type definition
|
|
5129
|
+
*
|
|
5130
|
+
* @return {any} The provider instance.
|
|
5131
|
+
*/},{key:"addProviderSingleton",value:function addProviderSingleton(pProviderHash,pOptions,pProviderPrototype){if(pProviderHash in this.providers){return this.providers[pProviderHash];}return this.addProvider(pProviderHash,pOptions,pProviderPrototype);}/**
|
|
5132
|
+
* Just passing an options will construct one for us.
|
|
5133
|
+
* Passing a hash will set the hash.
|
|
5134
|
+
* Passing a prototype will use that!
|
|
5135
|
+
*
|
|
5136
|
+
* @param {String} pProviderHash - The hash of the provider.
|
|
5137
|
+
* @param {Object<String, any>} [pOptions] - The options for the provider.
|
|
5138
|
+
* @param {any} [pProviderPrototype] - The prototype for the provider.
|
|
5139
|
+
*
|
|
5140
|
+
* FIXME: refer to PictProvider here once it has a type definition
|
|
5141
|
+
*
|
|
5142
|
+
* @return {any} The provider instance.
|
|
5143
|
+
*/},{key:"addProvider",value:function addProvider(pProviderHash,pOptions,pProviderPrototype){var tmpOptions=_typeof(pOptions)=="object"?pOptions:{};var tmpProviderHash=typeof pProviderHash=="string"?pProviderHash:this.fable.getUUID();if(this.LogControlFlow){if(this.LogNoisiness>1){this.log.info("PICT-ControlFlow addProvider [".concat(tmpProviderHash,"]:"),{Options:tmpOptions});}else{this.log.info("PICT-ControlFlow addProvider [".concat(tmpProviderHash,"]"));}}if(typeof pProviderPrototype!="undefined"){// If the prototype has a default_configuration, it will be merged with options.
|
|
5143
5144
|
if("default_configuration"in pProviderPrototype){tmpOptions=this.fable.Utility.extend({},pProviderPrototype.default_configuration,tmpOptions);}return this.instantiateServiceProviderFromPrototype("PictProvider",tmpOptions,tmpProviderHash,pProviderPrototype);}else{return this.instantiateServiceProvider("PictProvider",tmpOptions,tmpProviderHash);}}/**
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5145
|
+
* Just passing an options will construct one for us.
|
|
5146
|
+
* Passing a hash will set the hash.
|
|
5147
|
+
* Passing a prototype will use that!
|
|
5148
|
+
*
|
|
5149
|
+
* @param {String} pApplicationHash - The hash of the application.
|
|
5150
|
+
* @param {Object} [pOptions] - The options for the application.
|
|
5151
|
+
* @param {any} [pApplicationPrototype] - The prototype for the application.
|
|
5152
|
+
*
|
|
5153
|
+
* FIXME: refer to PictApplication here once it has a type definition
|
|
5154
|
+
*
|
|
5155
|
+
* @return {any} The application instance.
|
|
5156
|
+
*/},{key:"addApplication",value:function addApplication(pApplicationHash,pOptions,pApplicationPrototype){var tmpOptions=_typeof(pOptions)=="object"?pOptions:{};var tmpApplicationHash=typeof pApplicationHash=="string"?pApplicationHash:this.fable.getUUID();if(this.LogControlFlow){if(this.LogNoisiness>1){this.log.info("PICT-ControlFlow addApplication [".concat(tmpApplicationHash,"]:"),{Options:tmpOptions});}else{this.log.info("PICT-ControlFlow addApplication [".concat(tmpApplicationHash,"]"));}}if(typeof pApplicationPrototype!="undefined"){// If the prototype has a default_configuration, it will be merged with options.
|
|
5156
5157
|
if("default_configuration"in pApplicationPrototype){tmpOptions=this.fable.Utility.extend({},pApplicationPrototype.default_configuration,tmpOptions);}return this.instantiateServiceProviderFromPrototype("PictApplication",tmpOptions,tmpApplicationHash,pApplicationPrototype);}else{return this.instantiateServiceProvider("PictApplication",tmpOptions,tmpApplicationHash);}}/**
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5158
|
+
* Attach the default template engine renderers.
|
|
5159
|
+
*
|
|
5160
|
+
* @private
|
|
5161
|
+
*/},{key:"initializePictTemplateEngine",value:function initializePictTemplateEngine(){if(!this._DefaultPictTemplatesInitialized){// Just looking up data in the application state template expression
|
|
5161
5162
|
//{~Data:AppData.Some.Value.to.Render~}
|
|
5162
5163
|
//{~D:AppData.Some.Value.to.Render~}
|
|
5163
5164
|
this.addTemplate(require("./templates/Pict-Template-Data.js"));this.addTemplate(require("./templates/Pict-Template-View.js"));// HTML Comment Start and End based on truthiness ... if the value is false, the comment shows up.
|
|
@@ -5184,52 +5185,52 @@ this.addTemplate(require("./templates/logic/Pict-Template-NotEmpty.js"));// Data
|
|
|
5184
5185
|
this.addTemplate(require("./templates/data/Pict-Template-DataJson.js"));this.addTemplate(require("./templates/data/Pict-Template-PascalCaseIdentifier.js"));this.addTemplate(require("./templates/data/Pict-Template-DateOnlyFormat.js"));this.addTemplate(require("./templates/data/Pict-Template-DateOnlyYMD.js"));this.addTemplate(require("./templates/data/Pict-Template-DateTimeFormat.js"));this.addTemplate(require("./templates/data/Pict-Template-DateTimeYMD.js"));this.addTemplate(require("./templates/data/Pict-Template-Digits.js"));this.addTemplate(require("./templates/data/Pict-Template-Dollars.js"));this.addTemplate(require("./templates/data/Pict-Template-Join.js"));this.addTemplate(require("./templates/data/Pict-Template-JoinUnique.js"));this.addTemplate(require("./templates/data/Pict-Template-PluckJoinUnique.js"));// Data Generation Templates
|
|
5185
5186
|
this.addTemplate(require("./templates/data-generation/Pict-Template-RandomNumber.js"));this.addTemplate(require("./templates/data-generation/Pict-Template-RandomNumberString.js"));// Debugging Templates
|
|
5186
5187
|
this.addTemplate(require("./templates/debugging/Pict-Template-Breakpoint.js"));this.addTemplate(require("./templates/debugging/Pict-Template-LogStatement.js"));this.addTemplate(require("./templates/debugging/Pict-Template-LogValue.js"));this.addTemplate(require("./templates/debugging/Pict-Template-LogValueTree.js"));this.addTemplate(require("./templates/debugging/Pict-Template-DataValueTree.js"));this._DefaultPictTemplatesInitialized=true;}}/**
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5188
|
+
* Read a value from a nested object using a dot notation string.
|
|
5189
|
+
*
|
|
5190
|
+
* @param {string} pAddress - The address to resolve
|
|
5191
|
+
* @param {any} pRecord - The record to resolve
|
|
5192
|
+
* @param {Array<any>} [pContextArray] - The context array to resolve
|
|
5193
|
+
*
|
|
5194
|
+
* @return {any} The value at the given address, or undefined
|
|
5195
|
+
*/},{key:"resolveStateFromAddress",value:function resolveStateFromAddress(pAddress,pRecord,pContextArray){var tmpContextArray=Array.isArray(pContextArray)?pContextArray:[this];return this.manifest.getValueByHash({Pict:this,AppData:this.AppData,Bundle:this.Bundle,Context:tmpContextArray,Record:pRecord},pAddress);}/**
|
|
5196
|
+
* Parse a template.
|
|
5197
|
+
*
|
|
5198
|
+
* @param {String} pTemplateString - The template string to parse
|
|
5199
|
+
* @param {Object} pData - The data to use in the template
|
|
5200
|
+
* @param {Function} [fCallback] - The callback to call when the template is parsed
|
|
5201
|
+
* @param {Array<any>} [pContextArray] - The context array to use in the template
|
|
5202
|
+
*
|
|
5203
|
+
* @return {String?} The parsed template string, or undefined if a callback was provided
|
|
5204
|
+
*/},{key:"parseTemplate",value:function parseTemplate(pTemplateString,pData,fCallback,pContextArray){var _this79=this;var tmpData=_typeof(pData)==="object"?pData:{};var tmpContextArray=Array.isArray(pContextArray)?pContextArray:[this];var tmpParseUUID;if(this.LogControlFlow){tmpParseUUID=this.fable.getUUID();this.log.info("PICT-ControlFlow parseTemplate ".concat(tmpParseUUID," [").concat(pTemplateString.substring(0,50).replace("\n","\\n"),"...").concat(pTemplateString.length,"] (fCallback: ").concat(_typeof(fCallback),") with data size [").concat(JSON.stringify(tmpData).length,"]"));if(this.LogNoisiness>1){this.log.info("PICT-ControlFlow parseTemplate ".concat(tmpParseUUID," template:\n").concat(pTemplateString));}if(this.LogControlFlowWatchAddressList.length>0){for(var i=0;i<this.LogControlFlowWatchAddressList.length;i++){this.log.info("PICT-ControlFlow parseTemplate ".concat(tmpParseUUID," Watch Value: [").concat(this.LogControlFlowWatchAddressList[i],"]=>[").concat(this.resolveStateFromAddress(this.LogControlFlowWatchAddressList[i],tmpData),"]"));}}}if(typeof fCallback==="function"){this.MetaTemplate.parseString(pTemplateString,tmpData,function(pError,pParsedTemplate){if(_this79.LogControlFlow&&_this79.LogNoisiness>1){_this79.log.info("PICT-ControlFlow parseTemplate ".concat(tmpParseUUID," Template Async Return Value:\n").concat(pParsedTemplate));}return fCallback(pError,pParsedTemplate);},tmpContextArray);}else{var tmpResult=this.MetaTemplate.parseString(pTemplateString,tmpData,null,tmpContextArray);if(this.LogControlFlow&&this.LogNoisiness>1){this.log.info("PICT-ControlFlow parseTemplate ".concat(tmpParseUUID," Template Return Value:\n").concat(tmpResult));}return tmpResult;}}/**
|
|
5205
|
+
* Parse a template by hash.
|
|
5206
|
+
*
|
|
5207
|
+
* @param {String} pTemplateHash - The hash of the template to parse
|
|
5208
|
+
* @param {Object} pData - The data to use in the template
|
|
5209
|
+
* @param {Function} [fCallback] - The callback to call when the template is parsed
|
|
5210
|
+
* @param {Array<any>} [pContextArray] - The context array to use in the template
|
|
5211
|
+
*
|
|
5212
|
+
* @return {String?} The parsed template string, or undefined if a callback was provided
|
|
5213
|
+
*/},{key:"parseTemplateByHash",value:function parseTemplateByHash(pTemplateHash,pData,fCallback,pContextArray){var tmpTemplateString=this.TemplateProvider.getTemplate(pTemplateHash);// TODO: Unsure if returning empty is always the right behavior -- if it isn't we will use config to set the behavior
|
|
5213
5214
|
if(!tmpTemplateString){tmpTemplateString="";}return this.parseTemplate(tmpTemplateString,pData,fCallback,pContextArray);}/**
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5215
|
+
* Parse a template set.
|
|
5216
|
+
*
|
|
5217
|
+
* @param {String} pTemplateString - The template string to parse
|
|
5218
|
+
* @param {Array<any>|Object} pDataSet - The data set to use in the template
|
|
5219
|
+
* @param {Function} [fCallback] - The callback to call when the template set is parsed
|
|
5220
|
+
* @param {Array<any>} [pContextArray] - The context array to use in the template
|
|
5221
|
+
*
|
|
5222
|
+
* @return {String?} The parsed template string, or undefined if a callback was provided
|
|
5223
|
+
*/},{key:"parseTemplateSet",value:function parseTemplateSet(pTemplateString,pDataSet,fCallback,pContextArray){var _this80=this;// TODO: This will need streaming -- for now janky old string append does the trick
|
|
5223
5224
|
var tmpValue="";if(typeof fCallback=="function"){if(Array.isArray(pDataSet)||_typeof(pDataSet)=="object"){this.Utility.eachLimit(pDataSet,1,function(pRecord,fRecordTemplateCallback){return _this80.parseTemplate(pTemplateString,pRecord,function(pError,pTemplateResult){tmpValue+=pTemplateResult;return fRecordTemplateCallback();});},function(pError){return fCallback(pError,tmpValue);});}else{return fCallback(Error("Pict: Template Set: pDataSet is not an array or object."),"");}}else{if(Array.isArray(pDataSet)||_typeof(pDataSet)=="object"){if(Array.isArray(pDataSet)){for(var i=0;i<pDataSet.length;i++){tmpValue+=this.parseTemplate(pTemplateString,pDataSet[i],null,pContextArray);}}else{var tmpKeys=Object.keys(pDataSet);for(var _i58=0;_i58<tmpKeys.length;_i58++){tmpValue+=this.parseTemplate(pTemplateString,pDataSet[tmpKeys[_i58]],null,pContextArray);}}return tmpValue;}else{return"";}}}/**
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5225
|
+
* Parse a template set by hash.
|
|
5226
|
+
*
|
|
5227
|
+
* @param {String} pTemplateHash - The hash of the template to parse
|
|
5228
|
+
* @param {Array<any>|Object} pDataSet - The data set to use in the template
|
|
5229
|
+
* @param {Function} [fCallback] - The callback to call when the template is parsed
|
|
5230
|
+
* @param {Array<any>} [pContextArray] - The context array to use in the template
|
|
5231
|
+
*
|
|
5232
|
+
* @return {String?} The parsed template string, or undefined if a callback was provided
|
|
5233
|
+
*/},{key:"parseTemplateSetByHash",value:function parseTemplateSetByHash(pTemplateHash,pDataSet,fCallback,pContextArray){var tmpTemplateString=this.TemplateProvider.getTemplate(pTemplateHash);// TODO: Unsure if returning empty is always the right behavior -- if it isn't we will use config to set the behavior
|
|
5233
5234
|
if(!tmpTemplateString){tmpTemplateString="";}return this.parseTemplateSet(tmpTemplateString,pDataSet,fCallback,pContextArray);}}]);}(libFable);module.exports=Pict;module.exports.PictApplicationClass=require("pict-application");module.exports.PictViewClass=require("pict-view");module.exports.PictProviderClass=require("pict-provider");module.exports.PictTemplateClass=require("pict-template");module.exports.EnvironmentLog=require("./environments/Pict-Environment-Log.js");module.exports.EnvironmentObject=require("./environments/Pict-Environment-Object.js");// This is to help understand the type of enivironement we're executing in
|
|
5234
5235
|
module.exports.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}");module.exports.safeOnDocumentReady=require("./Pict-Browser-SafeOnDocumentReady.js");module.exports.safeLoadPictApplication=require("./Pict-Browser-SafeLoad.js");},{"../package.json":189,"./Pict-Browser-SafeLoad.js":190,"./Pict-Browser-SafeOnDocumentReady.js":191,"./Pict-CSS.js":192,"./Pict-Content-Assignment.js":193,"./Pict-DataProvider.js":194,"./Pict-Meadow-EntityProvider.js":195,"./Pict-Template-Provider.js":196,"./environments/Pict-Environment-Log.js":198,"./environments/Pict-Environment-Object.js":199,"./templates/Pict-Template-Data.js":200,"./templates/Pict-Template-Entity.js":201,"./templates/Pict-Template-Self.js":202,"./templates/Pict-Template-Template.js":203,"./templates/Pict-Template-TemplateFromMap.js":204,"./templates/Pict-Template-TemplateSet.js":205,"./templates/Pict-Template-TemplateSetFromMap.js":206,"./templates/Pict-Template-TemplateValueSet.js":207,"./templates/Pict-Template-View.js":208,"./templates/data-generation/Pict-Template-RandomNumber.js":209,"./templates/data-generation/Pict-Template-RandomNumberString.js":210,"./templates/data/Pict-Template-DataJson.js":211,"./templates/data/Pict-Template-DateOnlyFormat.js":212,"./templates/data/Pict-Template-DateOnlyYMD.js":213,"./templates/data/Pict-Template-DateTimeFormat.js":214,"./templates/data/Pict-Template-DateTimeYMD.js":215,"./templates/data/Pict-Template-Digits.js":216,"./templates/data/Pict-Template-Dollars.js":217,"./templates/data/Pict-Template-HtmlCommentEnd.js":218,"./templates/data/Pict-Template-HtmlCommentStart.js":219,"./templates/data/Pict-Template-Join.js":220,"./templates/data/Pict-Template-JoinUnique.js":221,"./templates/data/Pict-Template-PascalCaseIdentifier.js":222,"./templates/data/Pict-Template-PluckJoinUnique.js":223,"./templates/debugging/Pict-Template-Breakpoint.js":224,"./templates/debugging/Pict-Template-DataValueTree.js":225,"./templates/debugging/Pict-Template-LogStatement.js":226,"./templates/debugging/Pict-Template-LogValue.js":227,"./templates/debugging/Pict-Template-LogValueTree.js":228,"./templates/logic/Pict-Template-NotEmpty.js":229,"./templates/logic/Pict-Template-TemplateIf.js":231,"./templates/logic/Pict-Template-TemplateIfAbsolute.js":232,"fable":68,"pict-application":137,"pict-provider":139,"pict-template":141,"pict-view":143}],198:[function(require,module,exports){/**
|
|
5235
5236
|
* Pict browser shim loader
|