clientnode 4.0.1510 → 4.0.1512
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/bundle/index.js
CHANGED
|
@@ -3511,7 +3511,7 @@ __webpack_require__.d(object_namespaceObject, {
|
|
|
3511
3511
|
* @param givenOptions.statusCodes - Status codes to check for.
|
|
3512
3512
|
* @param givenOptions.timeoutInSeconds - Delay after assuming given resource
|
|
3513
3513
|
* isn't available if no response is coming.
|
|
3514
|
-
* @param givenOptions.
|
|
3514
|
+
* @param givenOptions.pollIntervalInSeconds - Seconds between two tries to
|
|
3515
3515
|
* reach given url.
|
|
3516
3516
|
* @param givenOptions.options - Fetch options to use.
|
|
3517
3517
|
* @param givenOptions.expectedIntermediateStatusCodes - A list of expected but
|
|
@@ -3520,7 +3520,7 @@ __webpack_require__.d(object_namespaceObject, {
|
|
|
3520
3520
|
* @returns A promise which will be resolved if a request to given url has
|
|
3521
3521
|
* finished and resulting status code matches given expected status code.
|
|
3522
3522
|
* Otherwise, returned promise will be rejected.
|
|
3523
|
-
*/var checkReachability=/*#__PURE__*/function(){var _checkReachability=data_transfer_asyncToGenerator(/*#__PURE__*/data_transfer_regenerator().m(function _callee2(url,givenOptions){var _ref;var abortController,options,statusCodes,expectedIntermediateStatusCodes,isStatusCodeExpected,checkAndThrow,_t3;return data_transfer_regenerator().w(function(_context2){while(1)switch(_context2.n){case 0:if(givenOptions===void 0){givenOptions={}}if(context/* globalContext */.Lz.fetch){_context2.n=1;break}throw new Error("Missing fetch implementation available.");case 1:abortController=(_ref=givenOptions.abortController)!==null&&_ref!==void 0?_ref:new AbortController;options=(0,src_object/* extend */.X$)(true,{expectedIntermediateStatusCodes:[],options:{signal:abortController.signal},
|
|
3523
|
+
*/var checkReachability=/*#__PURE__*/function(){var _checkReachability=data_transfer_asyncToGenerator(/*#__PURE__*/data_transfer_regenerator().m(function _callee2(url,givenOptions){var _ref;var abortController,options,statusCodes,expectedIntermediateStatusCodes,isStatusCodeExpected,checkAndThrow,_t3;return data_transfer_regenerator().w(function(_context2){while(1)switch(_context2.n){case 0:if(givenOptions===void 0){givenOptions={}}if(context/* globalContext */.Lz.fetch){_context2.n=1;break}throw new Error("Missing fetch implementation available.");case 1:abortController=(_ref=givenOptions.abortController)!==null&&_ref!==void 0?_ref:new AbortController;options=(0,src_object/* extend */.X$)(true,{expectedIntermediateStatusCodes:[],options:{signal:abortController.signal},pollIntervalInSeconds:0.1,statusCodes:200,timeoutInSeconds:10,wait:false},givenOptions);statusCodes=[].concat(options.statusCodes);expectedIntermediateStatusCodes=[].concat(options.expectedIntermediateStatusCodes);isStatusCodeExpected=function isStatusCodeExpected(response,statusCodes){return"status"in response&&statusCodes.includes(response.status)};checkAndThrow=function checkAndThrow(response){if(!isStatusCodeExpected(response,statusCodes))throw new Error("Given status code ".concat(String(response.status)," ")+"differs from ".concat(statusCodes.join(", "),"."));return response};if(!options.wait){_context2.n=2;break}return _context2.a(2,new Promise(function(resolve,reject){var timedOut=false;var timer=timeout(options.timeoutInSeconds*1000);var retryErrorHandler=function retryErrorHandler(error){if(!timedOut){currentlyRunningTimer=timeout(options.pollIntervalInSeconds*1000,wrapper);/*
|
|
3524
3524
|
NOTE: A timer rejection is expected. Avoid throwing
|
|
3525
3525
|
errors about unhandled promise rejections.
|
|
3526
3526
|
*/currentlyRunningTimer.catch(function(){// Do nothing regardless of an error.
|
|
@@ -3533,7 +3533,7 @@ __webpack_require__.d(object_namespaceObject, {
|
|
|
3533
3533
|
* status code will be given.
|
|
3534
3534
|
* @param givenOptions.timeoutInSeconds - Delay after assuming given resource
|
|
3535
3535
|
* will stay available.
|
|
3536
|
-
* @param givenOptions.
|
|
3536
|
+
* @param givenOptions.pollIntervalInSeconds - Seconds between two tries to
|
|
3537
3537
|
* reach given url.
|
|
3538
3538
|
* @param givenOptions.statusCodes - Status codes to check for.
|
|
3539
3539
|
* @param givenOptions.options - Fetch options to use.
|
|
@@ -3541,7 +3541,7 @@ __webpack_require__.d(object_namespaceObject, {
|
|
|
3541
3541
|
* be finished. Otherwise, returned promise will be rejected. If "wait" is set
|
|
3542
3542
|
* to "true" we will resolve to another promise still resolving when final
|
|
3543
3543
|
* timeout is reached or the endpoint is unreachable (after some tries).
|
|
3544
|
-
*/var checkUnreachability=/*#__PURE__*/function(){var _checkUnreachability=data_transfer_asyncToGenerator(/*#__PURE__*/data_transfer_regenerator().m(function _callee4(url,givenOptions){var _ref2;var abortController,options,check,result,_t5,_t6;return data_transfer_regenerator().w(function(_context4){while(1)switch(_context4.p=_context4.n){case 0:if(givenOptions===void 0){givenOptions={}}if(context/* globalContext */.Lz.fetch){_context4.n=1;break}throw new Error("Missing fetch implementation available.");case 1:abortController=(_ref2=givenOptions.abortController)!==null&&_ref2!==void 0?_ref2:new AbortController;options=(0,src_object/* extend */.X$)(true,{options:{signal:abortController.signal},
|
|
3544
|
+
*/var checkUnreachability=/*#__PURE__*/function(){var _checkUnreachability=data_transfer_asyncToGenerator(/*#__PURE__*/data_transfer_regenerator().m(function _callee4(url,givenOptions){var _ref2;var abortController,options,check,result,_t5,_t6;return data_transfer_regenerator().w(function(_context4){while(1)switch(_context4.p=_context4.n){case 0:if(givenOptions===void 0){givenOptions={}}if(context/* globalContext */.Lz.fetch){_context4.n=1;break}throw new Error("Missing fetch implementation available.");case 1:abortController=(_ref2=givenOptions.abortController)!==null&&_ref2!==void 0?_ref2:new AbortController;options=(0,src_object/* extend */.X$)(true,{options:{signal:abortController.signal},pollIntervalInSeconds:0.1,statusCodes:[],timeoutInSeconds:10,wait:false},givenOptions);check=function check(response){var statusCodes=[].concat(options.statusCodes);if(statusCodes.length){if((0,indicators/* isObject */.Gv)(response)&&"status"in response&&statusCodes.includes(response.status))throw new Error("Given url \"".concat(url,"\" is reachable and responses with ")+"status code \"".concat(String(response.status),"\"."));return new Error("Given status code is not \"".concat(statusCodes.join(", "),"\"."))}return null};if(!options.wait){_context4.n=2;break}return _context4.a(2,new Promise(function(resolve,reject){var timedOut=false;var _wrapper2=/*#__PURE__*/function(){var _wrapper3=data_transfer_asyncToGenerator(/*#__PURE__*/data_transfer_regenerator().m(function _callee3(){var response,result,_t4;return data_transfer_regenerator().w(function(_context3){while(1)switch(_context3.p=_context3.n){case 0:_context3.p=0;_context3.n=1;return context/* globalContext */.Lz.fetch(url,options.options);case 1:response=_context3.v;if(!timedOut){_context3.n=2;break}return _context3.a(2,response);case 2:result=check(response);if(!result){_context3.n=3;break}timer.clear();resolve(result);return _context3.a(2,result);case 3:currentlyRunningTimer=timeout(options.pollIntervalInSeconds*1000,_wrapper2);/*
|
|
3545
3545
|
NOTE: A timer rejection is expected. Avoid throwing
|
|
3546
3546
|
errors about unhandled promise rejections.
|
|
3547
3547
|
*/currentlyRunningTimer.catch(function(){// Do nothing regardless of an error.
|
|
@@ -611,7 +611,7 @@ timeoutID=null;recentParameters=[]},thresholdInMilliseconds)}};/**
|
|
|
611
611
|
* @param givenOptions.statusCodes - Status codes to check for.
|
|
612
612
|
* @param givenOptions.timeoutInSeconds - Delay after assuming given resource
|
|
613
613
|
* isn't available if no response is coming.
|
|
614
|
-
* @param givenOptions.
|
|
614
|
+
* @param givenOptions.pollIntervalInSeconds - Seconds between two tries to
|
|
615
615
|
* reach given url.
|
|
616
616
|
* @param givenOptions.options - Fetch options to use.
|
|
617
617
|
* @param givenOptions.expectedIntermediateStatusCodes - A list of expected but
|
|
@@ -620,7 +620,7 @@ timeoutID=null;recentParameters=[]},thresholdInMilliseconds)}};/**
|
|
|
620
620
|
* @returns A promise which will be resolved if a request to given url has
|
|
621
621
|
* finished and resulting status code matches given expected status code.
|
|
622
622
|
* Otherwise, returned promise will be rejected.
|
|
623
|
-
*/var checkReachability=/*#__PURE__*/function(){var _checkReachability=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(url,givenOptions){var _ref;var abortController,options,statusCodes,expectedIntermediateStatusCodes,isStatusCodeExpected,checkAndThrow,_t3;return _regenerator().w(function(_context2){while(1)switch(_context2.n){case 0:if(givenOptions===void 0){givenOptions={}}if(_context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.fetch){_context2.n=1;break}throw new Error("Missing fetch implementation available.");case 1:abortController=(_ref=givenOptions.abortController)!==null&&_ref!==void 0?_ref:new AbortController;options=(0,_object_js__WEBPACK_IMPORTED_MODULE_3__/* .extend */ .X$)(true,{expectedIntermediateStatusCodes:[],options:{signal:abortController.signal},
|
|
623
|
+
*/var checkReachability=/*#__PURE__*/function(){var _checkReachability=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(url,givenOptions){var _ref;var abortController,options,statusCodes,expectedIntermediateStatusCodes,isStatusCodeExpected,checkAndThrow,_t3;return _regenerator().w(function(_context2){while(1)switch(_context2.n){case 0:if(givenOptions===void 0){givenOptions={}}if(_context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.fetch){_context2.n=1;break}throw new Error("Missing fetch implementation available.");case 1:abortController=(_ref=givenOptions.abortController)!==null&&_ref!==void 0?_ref:new AbortController;options=(0,_object_js__WEBPACK_IMPORTED_MODULE_3__/* .extend */ .X$)(true,{expectedIntermediateStatusCodes:[],options:{signal:abortController.signal},pollIntervalInSeconds:0.1,statusCodes:200,timeoutInSeconds:10,wait:false},givenOptions);statusCodes=[].concat(options.statusCodes);expectedIntermediateStatusCodes=[].concat(options.expectedIntermediateStatusCodes);isStatusCodeExpected=function isStatusCodeExpected(response,statusCodes){return"status"in response&&statusCodes.includes(response.status)};checkAndThrow=function checkAndThrow(response){if(!isStatusCodeExpected(response,statusCodes))throw new Error("Given status code ".concat(String(response.status)," ")+"differs from ".concat(statusCodes.join(", "),"."));return response};if(!options.wait){_context2.n=2;break}return _context2.a(2,new Promise(function(resolve,reject){var timedOut=false;var timer=(0,_utility_js__WEBPACK_IMPORTED_MODULE_4__/* .timeout */ .wR)(options.timeoutInSeconds*1000);var retryErrorHandler=function retryErrorHandler(error){if(!timedOut){currentlyRunningTimer=(0,_utility_js__WEBPACK_IMPORTED_MODULE_4__/* .timeout */ .wR)(options.pollIntervalInSeconds*1000,wrapper);/*
|
|
624
624
|
NOTE: A timer rejection is expected. Avoid throwing
|
|
625
625
|
errors about unhandled promise rejections.
|
|
626
626
|
*/currentlyRunningTimer.catch(function(){// Do nothing regardless of an error.
|
|
@@ -633,7 +633,7 @@ timeoutID=null;recentParameters=[]},thresholdInMilliseconds)}};/**
|
|
|
633
633
|
* status code will be given.
|
|
634
634
|
* @param givenOptions.timeoutInSeconds - Delay after assuming given resource
|
|
635
635
|
* will stay available.
|
|
636
|
-
* @param givenOptions.
|
|
636
|
+
* @param givenOptions.pollIntervalInSeconds - Seconds between two tries to
|
|
637
637
|
* reach given url.
|
|
638
638
|
* @param givenOptions.statusCodes - Status codes to check for.
|
|
639
639
|
* @param givenOptions.options - Fetch options to use.
|
|
@@ -641,7 +641,7 @@ timeoutID=null;recentParameters=[]},thresholdInMilliseconds)}};/**
|
|
|
641
641
|
* be finished. Otherwise, returned promise will be rejected. If "wait" is set
|
|
642
642
|
* to "true" we will resolve to another promise still resolving when final
|
|
643
643
|
* timeout is reached or the endpoint is unreachable (after some tries).
|
|
644
|
-
*/var checkUnreachability=/*#__PURE__*/function(){var _checkUnreachability=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(url,givenOptions){var _ref2;var abortController,options,check,result,_t5,_t6;return _regenerator().w(function(_context4){while(1)switch(_context4.p=_context4.n){case 0:if(givenOptions===void 0){givenOptions={}}if(_context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.fetch){_context4.n=1;break}throw new Error("Missing fetch implementation available.");case 1:abortController=(_ref2=givenOptions.abortController)!==null&&_ref2!==void 0?_ref2:new AbortController;options=(0,_object_js__WEBPACK_IMPORTED_MODULE_3__/* .extend */ .X$)(true,{options:{signal:abortController.signal},
|
|
644
|
+
*/var checkUnreachability=/*#__PURE__*/function(){var _checkUnreachability=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(url,givenOptions){var _ref2;var abortController,options,check,result,_t5,_t6;return _regenerator().w(function(_context4){while(1)switch(_context4.p=_context4.n){case 0:if(givenOptions===void 0){givenOptions={}}if(_context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.fetch){_context4.n=1;break}throw new Error("Missing fetch implementation available.");case 1:abortController=(_ref2=givenOptions.abortController)!==null&&_ref2!==void 0?_ref2:new AbortController;options=(0,_object_js__WEBPACK_IMPORTED_MODULE_3__/* .extend */ .X$)(true,{options:{signal:abortController.signal},pollIntervalInSeconds:0.1,statusCodes:[],timeoutInSeconds:10,wait:false},givenOptions);check=function check(response){var statusCodes=[].concat(options.statusCodes);if(statusCodes.length){if((0,_indicators_js__WEBPACK_IMPORTED_MODULE_1__/* .isObject */ .Gv)(response)&&"status"in response&&statusCodes.includes(response.status))throw new Error("Given url \"".concat(url,"\" is reachable and responses with ")+"status code \"".concat(String(response.status),"\"."));return new Error("Given status code is not \"".concat(statusCodes.join(", "),"\"."))}return null};if(!options.wait){_context4.n=2;break}return _context4.a(2,new Promise(function(resolve,reject){var timedOut=false;var _wrapper2=/*#__PURE__*/function(){var _wrapper3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(){var response,result,_t4;return _regenerator().w(function(_context3){while(1)switch(_context3.p=_context3.n){case 0:_context3.p=0;_context3.n=1;return _context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.fetch(url,options.options);case 1:response=_context3.v;if(!timedOut){_context3.n=2;break}return _context3.a(2,response);case 2:result=check(response);if(!result){_context3.n=3;break}timer.clear();resolve(result);return _context3.a(2,result);case 3:currentlyRunningTimer=(0,_utility_js__WEBPACK_IMPORTED_MODULE_4__/* .timeout */ .wR)(options.pollIntervalInSeconds*1000,_wrapper2);/*
|
|
645
645
|
NOTE: A timer rejection is expected. Avoid throwing
|
|
646
646
|
errors about unhandled promise rejections.
|
|
647
647
|
*/currentlyRunningTimer.catch(function(){// Do nothing regardless of an error.
|
package/dist/compatible/index.js
CHANGED
|
@@ -2083,7 +2083,7 @@ return viewArrayAsScope(value,childrenPropertyNames,propertyReferenceKeys)}if(va
|
|
|
2083
2083
|
* @param givenOptions.statusCodes - Status codes to check for.
|
|
2084
2084
|
* @param givenOptions.timeoutInSeconds - Delay after assuming given resource
|
|
2085
2085
|
* isn't available if no response is coming.
|
|
2086
|
-
* @param givenOptions.
|
|
2086
|
+
* @param givenOptions.pollIntervalInSeconds - Seconds between two tries to
|
|
2087
2087
|
* reach given url.
|
|
2088
2088
|
* @param givenOptions.options - Fetch options to use.
|
|
2089
2089
|
* @param givenOptions.expectedIntermediateStatusCodes - A list of expected but
|
|
@@ -2092,7 +2092,7 @@ return viewArrayAsScope(value,childrenPropertyNames,propertyReferenceKeys)}if(va
|
|
|
2092
2092
|
* @returns A promise which will be resolved if a request to given url has
|
|
2093
2093
|
* finished and resulting status code matches given expected status code.
|
|
2094
2094
|
* Otherwise, returned promise will be rejected.
|
|
2095
|
-
*/var checkReachability=/*#__PURE__*/function(){var _checkReachability=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(url,givenOptions){var _ref;var abortController,options,statusCodes,expectedIntermediateStatusCodes,isStatusCodeExpected,checkAndThrow,_t3;return _regenerator().w(function(_context2){while(1)switch(_context2.n){case 0:if(givenOptions===void 0){givenOptions={}}if(_context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.fetch){_context2.n=1;break}throw new Error("Missing fetch implementation available.");case 1:abortController=(_ref=givenOptions.abortController)!==null&&_ref!==void 0?_ref:new AbortController;options=(0,_object_js__WEBPACK_IMPORTED_MODULE_3__/* .extend */ .X$)(true,{expectedIntermediateStatusCodes:[],options:{signal:abortController.signal},
|
|
2095
|
+
*/var checkReachability=/*#__PURE__*/function(){var _checkReachability=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(url,givenOptions){var _ref;var abortController,options,statusCodes,expectedIntermediateStatusCodes,isStatusCodeExpected,checkAndThrow,_t3;return _regenerator().w(function(_context2){while(1)switch(_context2.n){case 0:if(givenOptions===void 0){givenOptions={}}if(_context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.fetch){_context2.n=1;break}throw new Error("Missing fetch implementation available.");case 1:abortController=(_ref=givenOptions.abortController)!==null&&_ref!==void 0?_ref:new AbortController;options=(0,_object_js__WEBPACK_IMPORTED_MODULE_3__/* .extend */ .X$)(true,{expectedIntermediateStatusCodes:[],options:{signal:abortController.signal},pollIntervalInSeconds:0.1,statusCodes:200,timeoutInSeconds:10,wait:false},givenOptions);statusCodes=[].concat(options.statusCodes);expectedIntermediateStatusCodes=[].concat(options.expectedIntermediateStatusCodes);isStatusCodeExpected=function isStatusCodeExpected(response,statusCodes){return"status"in response&&statusCodes.includes(response.status)};checkAndThrow=function checkAndThrow(response){if(!isStatusCodeExpected(response,statusCodes))throw new Error("Given status code ".concat(String(response.status)," ")+"differs from ".concat(statusCodes.join(", "),"."));return response};if(!options.wait){_context2.n=2;break}return _context2.a(2,new Promise(function(resolve,reject){var timedOut=false;var timer=(0,_utility_js__WEBPACK_IMPORTED_MODULE_4__/* .timeout */ .wR)(options.timeoutInSeconds*1000);var retryErrorHandler=function retryErrorHandler(error){if(!timedOut){currentlyRunningTimer=(0,_utility_js__WEBPACK_IMPORTED_MODULE_4__/* .timeout */ .wR)(options.pollIntervalInSeconds*1000,wrapper);/*
|
|
2096
2096
|
NOTE: A timer rejection is expected. Avoid throwing
|
|
2097
2097
|
errors about unhandled promise rejections.
|
|
2098
2098
|
*/currentlyRunningTimer.catch(function(){// Do nothing regardless of an error.
|
|
@@ -2105,7 +2105,7 @@ return viewArrayAsScope(value,childrenPropertyNames,propertyReferenceKeys)}if(va
|
|
|
2105
2105
|
* status code will be given.
|
|
2106
2106
|
* @param givenOptions.timeoutInSeconds - Delay after assuming given resource
|
|
2107
2107
|
* will stay available.
|
|
2108
|
-
* @param givenOptions.
|
|
2108
|
+
* @param givenOptions.pollIntervalInSeconds - Seconds between two tries to
|
|
2109
2109
|
* reach given url.
|
|
2110
2110
|
* @param givenOptions.statusCodes - Status codes to check for.
|
|
2111
2111
|
* @param givenOptions.options - Fetch options to use.
|
|
@@ -2113,7 +2113,7 @@ return viewArrayAsScope(value,childrenPropertyNames,propertyReferenceKeys)}if(va
|
|
|
2113
2113
|
* be finished. Otherwise, returned promise will be rejected. If "wait" is set
|
|
2114
2114
|
* to "true" we will resolve to another promise still resolving when final
|
|
2115
2115
|
* timeout is reached or the endpoint is unreachable (after some tries).
|
|
2116
|
-
*/var checkUnreachability=/*#__PURE__*/function(){var _checkUnreachability=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(url,givenOptions){var _ref2;var abortController,options,check,result,_t5,_t6;return _regenerator().w(function(_context4){while(1)switch(_context4.p=_context4.n){case 0:if(givenOptions===void 0){givenOptions={}}if(_context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.fetch){_context4.n=1;break}throw new Error("Missing fetch implementation available.");case 1:abortController=(_ref2=givenOptions.abortController)!==null&&_ref2!==void 0?_ref2:new AbortController;options=(0,_object_js__WEBPACK_IMPORTED_MODULE_3__/* .extend */ .X$)(true,{options:{signal:abortController.signal},
|
|
2116
|
+
*/var checkUnreachability=/*#__PURE__*/function(){var _checkUnreachability=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(url,givenOptions){var _ref2;var abortController,options,check,result,_t5,_t6;return _regenerator().w(function(_context4){while(1)switch(_context4.p=_context4.n){case 0:if(givenOptions===void 0){givenOptions={}}if(_context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.fetch){_context4.n=1;break}throw new Error("Missing fetch implementation available.");case 1:abortController=(_ref2=givenOptions.abortController)!==null&&_ref2!==void 0?_ref2:new AbortController;options=(0,_object_js__WEBPACK_IMPORTED_MODULE_3__/* .extend */ .X$)(true,{options:{signal:abortController.signal},pollIntervalInSeconds:0.1,statusCodes:[],timeoutInSeconds:10,wait:false},givenOptions);check=function check(response){var statusCodes=[].concat(options.statusCodes);if(statusCodes.length){if((0,_indicators_js__WEBPACK_IMPORTED_MODULE_1__/* .isObject */ .Gv)(response)&&"status"in response&&statusCodes.includes(response.status))throw new Error("Given url \"".concat(url,"\" is reachable and responses with ")+"status code \"".concat(String(response.status),"\"."));return new Error("Given status code is not \"".concat(statusCodes.join(", "),"\"."))}return null};if(!options.wait){_context4.n=2;break}return _context4.a(2,new Promise(function(resolve,reject){var timedOut=false;var _wrapper2=/*#__PURE__*/function(){var _wrapper3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(){var response,result,_t4;return _regenerator().w(function(_context3){while(1)switch(_context3.p=_context3.n){case 0:_context3.p=0;_context3.n=1;return _context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.fetch(url,options.options);case 1:response=_context3.v;if(!timedOut){_context3.n=2;break}return _context3.a(2,response);case 2:result=check(response);if(!result){_context3.n=3;break}timer.clear();resolve(result);return _context3.a(2,result);case 3:currentlyRunningTimer=(0,_utility_js__WEBPACK_IMPORTED_MODULE_4__/* .timeout */ .wR)(options.pollIntervalInSeconds*1000,_wrapper2);/*
|
|
2117
2117
|
NOTE: A timer rejection is expected. Avoid throwing
|
|
2118
2118
|
errors about unhandled promise rejections.
|
|
2119
2119
|
*/currentlyRunningTimer.catch(function(){// Do nothing regardless of an error.
|
package/dist/data-transfer.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { CheckReachabilityOptions, RecursivePartial } from './type';
|
|
|
8
8
|
* @param givenOptions.statusCodes - Status codes to check for.
|
|
9
9
|
* @param givenOptions.timeoutInSeconds - Delay after assuming given resource
|
|
10
10
|
* isn't available if no response is coming.
|
|
11
|
-
* @param givenOptions.
|
|
11
|
+
* @param givenOptions.pollIntervalInSeconds - Seconds between two tries to
|
|
12
12
|
* reach given url.
|
|
13
13
|
* @param givenOptions.options - Fetch options to use.
|
|
14
14
|
* @param givenOptions.expectedIntermediateStatusCodes - A list of expected but
|
|
@@ -27,7 +27,7 @@ export declare const checkReachability: (url: string, givenOptions?: RecursivePa
|
|
|
27
27
|
* status code will be given.
|
|
28
28
|
* @param givenOptions.timeoutInSeconds - Delay after assuming given resource
|
|
29
29
|
* will stay available.
|
|
30
|
-
* @param givenOptions.
|
|
30
|
+
* @param givenOptions.pollIntervalInSeconds - Seconds between two tries to
|
|
31
31
|
* reach given url.
|
|
32
32
|
* @param givenOptions.statusCodes - Status codes to check for.
|
|
33
33
|
* @param givenOptions.options - Fetch options to use.
|
package/dist/data-transfer.js
CHANGED
|
@@ -611,7 +611,7 @@ timeoutID=null;recentParameters=[]},thresholdInMilliseconds)}};/**
|
|
|
611
611
|
* @param givenOptions.statusCodes - Status codes to check for.
|
|
612
612
|
* @param givenOptions.timeoutInSeconds - Delay after assuming given resource
|
|
613
613
|
* isn't available if no response is coming.
|
|
614
|
-
* @param givenOptions.
|
|
614
|
+
* @param givenOptions.pollIntervalInSeconds - Seconds between two tries to
|
|
615
615
|
* reach given url.
|
|
616
616
|
* @param givenOptions.options - Fetch options to use.
|
|
617
617
|
* @param givenOptions.expectedIntermediateStatusCodes - A list of expected but
|
|
@@ -620,7 +620,7 @@ timeoutID=null;recentParameters=[]},thresholdInMilliseconds)}};/**
|
|
|
620
620
|
* @returns A promise which will be resolved if a request to given url has
|
|
621
621
|
* finished and resulting status code matches given expected status code.
|
|
622
622
|
* Otherwise, returned promise will be rejected.
|
|
623
|
-
*/var checkReachability=/*#__PURE__*/function(){var _checkReachability=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(url,givenOptions){var _ref;var abortController,options,statusCodes,expectedIntermediateStatusCodes,isStatusCodeExpected,checkAndThrow,_t3;return _regenerator().w(function(_context2){while(1)switch(_context2.n){case 0:if(givenOptions===void 0){givenOptions={}}if(_context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.fetch){_context2.n=1;break}throw new Error("Missing fetch implementation available.");case 1:abortController=(_ref=givenOptions.abortController)!==null&&_ref!==void 0?_ref:new AbortController;options=(0,_object_js__WEBPACK_IMPORTED_MODULE_3__/* .extend */ .X$)(true,{expectedIntermediateStatusCodes:[],options:{signal:abortController.signal},
|
|
623
|
+
*/var checkReachability=/*#__PURE__*/function(){var _checkReachability=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(url,givenOptions){var _ref;var abortController,options,statusCodes,expectedIntermediateStatusCodes,isStatusCodeExpected,checkAndThrow,_t3;return _regenerator().w(function(_context2){while(1)switch(_context2.n){case 0:if(givenOptions===void 0){givenOptions={}}if(_context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.fetch){_context2.n=1;break}throw new Error("Missing fetch implementation available.");case 1:abortController=(_ref=givenOptions.abortController)!==null&&_ref!==void 0?_ref:new AbortController;options=(0,_object_js__WEBPACK_IMPORTED_MODULE_3__/* .extend */ .X$)(true,{expectedIntermediateStatusCodes:[],options:{signal:abortController.signal},pollIntervalInSeconds:0.1,statusCodes:200,timeoutInSeconds:10,wait:false},givenOptions);statusCodes=[].concat(options.statusCodes);expectedIntermediateStatusCodes=[].concat(options.expectedIntermediateStatusCodes);isStatusCodeExpected=function isStatusCodeExpected(response,statusCodes){return"status"in response&&statusCodes.includes(response.status)};checkAndThrow=function checkAndThrow(response){if(!isStatusCodeExpected(response,statusCodes))throw new Error("Given status code ".concat(String(response.status)," ")+"differs from ".concat(statusCodes.join(", "),"."));return response};if(!options.wait){_context2.n=2;break}return _context2.a(2,new Promise(function(resolve,reject){var timedOut=false;var timer=(0,_utility_js__WEBPACK_IMPORTED_MODULE_4__/* .timeout */ .wR)(options.timeoutInSeconds*1000);var retryErrorHandler=function retryErrorHandler(error){if(!timedOut){currentlyRunningTimer=(0,_utility_js__WEBPACK_IMPORTED_MODULE_4__/* .timeout */ .wR)(options.pollIntervalInSeconds*1000,wrapper);/*
|
|
624
624
|
NOTE: A timer rejection is expected. Avoid throwing
|
|
625
625
|
errors about unhandled promise rejections.
|
|
626
626
|
*/currentlyRunningTimer.catch(function(){// Do nothing regardless of an error.
|
|
@@ -633,7 +633,7 @@ timeoutID=null;recentParameters=[]},thresholdInMilliseconds)}};/**
|
|
|
633
633
|
* status code will be given.
|
|
634
634
|
* @param givenOptions.timeoutInSeconds - Delay after assuming given resource
|
|
635
635
|
* will stay available.
|
|
636
|
-
* @param givenOptions.
|
|
636
|
+
* @param givenOptions.pollIntervalInSeconds - Seconds between two tries to
|
|
637
637
|
* reach given url.
|
|
638
638
|
* @param givenOptions.statusCodes - Status codes to check for.
|
|
639
639
|
* @param givenOptions.options - Fetch options to use.
|
|
@@ -641,7 +641,7 @@ timeoutID=null;recentParameters=[]},thresholdInMilliseconds)}};/**
|
|
|
641
641
|
* be finished. Otherwise, returned promise will be rejected. If "wait" is set
|
|
642
642
|
* to "true" we will resolve to another promise still resolving when final
|
|
643
643
|
* timeout is reached or the endpoint is unreachable (after some tries).
|
|
644
|
-
*/var checkUnreachability=/*#__PURE__*/function(){var _checkUnreachability=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(url,givenOptions){var _ref2;var abortController,options,check,result,_t5,_t6;return _regenerator().w(function(_context4){while(1)switch(_context4.p=_context4.n){case 0:if(givenOptions===void 0){givenOptions={}}if(_context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.fetch){_context4.n=1;break}throw new Error("Missing fetch implementation available.");case 1:abortController=(_ref2=givenOptions.abortController)!==null&&_ref2!==void 0?_ref2:new AbortController;options=(0,_object_js__WEBPACK_IMPORTED_MODULE_3__/* .extend */ .X$)(true,{options:{signal:abortController.signal},
|
|
644
|
+
*/var checkUnreachability=/*#__PURE__*/function(){var _checkUnreachability=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(url,givenOptions){var _ref2;var abortController,options,check,result,_t5,_t6;return _regenerator().w(function(_context4){while(1)switch(_context4.p=_context4.n){case 0:if(givenOptions===void 0){givenOptions={}}if(_context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.fetch){_context4.n=1;break}throw new Error("Missing fetch implementation available.");case 1:abortController=(_ref2=givenOptions.abortController)!==null&&_ref2!==void 0?_ref2:new AbortController;options=(0,_object_js__WEBPACK_IMPORTED_MODULE_3__/* .extend */ .X$)(true,{options:{signal:abortController.signal},pollIntervalInSeconds:0.1,statusCodes:[],timeoutInSeconds:10,wait:false},givenOptions);check=function check(response){var statusCodes=[].concat(options.statusCodes);if(statusCodes.length){if((0,_indicators_js__WEBPACK_IMPORTED_MODULE_1__/* .isObject */ .Gv)(response)&&"status"in response&&statusCodes.includes(response.status))throw new Error("Given url \"".concat(url,"\" is reachable and responses with ")+"status code \"".concat(String(response.status),"\"."));return new Error("Given status code is not \"".concat(statusCodes.join(", "),"\"."))}return null};if(!options.wait){_context4.n=2;break}return _context4.a(2,new Promise(function(resolve,reject){var timedOut=false;var _wrapper2=/*#__PURE__*/function(){var _wrapper3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(){var response,result,_t4;return _regenerator().w(function(_context3){while(1)switch(_context3.p=_context3.n){case 0:_context3.p=0;_context3.n=1;return _context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.fetch(url,options.options);case 1:response=_context3.v;if(!timedOut){_context3.n=2;break}return _context3.a(2,response);case 2:result=check(response);if(!result){_context3.n=3;break}timer.clear();resolve(result);return _context3.a(2,result);case 3:currentlyRunningTimer=(0,_utility_js__WEBPACK_IMPORTED_MODULE_4__/* .timeout */ .wR)(options.pollIntervalInSeconds*1000,_wrapper2);/*
|
|
645
645
|
NOTE: A timer rejection is expected. Avoid throwing
|
|
646
646
|
errors about unhandled promise rejections.
|
|
647
647
|
*/currentlyRunningTimer.catch(function(){// Do nothing regardless of an error.
|
package/dist/index.js
CHANGED
|
@@ -2083,7 +2083,7 @@ return viewArrayAsScope(value,childrenPropertyNames,propertyReferenceKeys)}if(va
|
|
|
2083
2083
|
* @param givenOptions.statusCodes - Status codes to check for.
|
|
2084
2084
|
* @param givenOptions.timeoutInSeconds - Delay after assuming given resource
|
|
2085
2085
|
* isn't available if no response is coming.
|
|
2086
|
-
* @param givenOptions.
|
|
2086
|
+
* @param givenOptions.pollIntervalInSeconds - Seconds between two tries to
|
|
2087
2087
|
* reach given url.
|
|
2088
2088
|
* @param givenOptions.options - Fetch options to use.
|
|
2089
2089
|
* @param givenOptions.expectedIntermediateStatusCodes - A list of expected but
|
|
@@ -2092,7 +2092,7 @@ return viewArrayAsScope(value,childrenPropertyNames,propertyReferenceKeys)}if(va
|
|
|
2092
2092
|
* @returns A promise which will be resolved if a request to given url has
|
|
2093
2093
|
* finished and resulting status code matches given expected status code.
|
|
2094
2094
|
* Otherwise, returned promise will be rejected.
|
|
2095
|
-
*/var checkReachability=/*#__PURE__*/function(){var _checkReachability=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(url,givenOptions){var _ref;var abortController,options,statusCodes,expectedIntermediateStatusCodes,isStatusCodeExpected,checkAndThrow,_t3;return _regenerator().w(function(_context2){while(1)switch(_context2.n){case 0:if(givenOptions===void 0){givenOptions={}}if(_context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.fetch){_context2.n=1;break}throw new Error("Missing fetch implementation available.");case 1:abortController=(_ref=givenOptions.abortController)!==null&&_ref!==void 0?_ref:new AbortController;options=(0,_object_js__WEBPACK_IMPORTED_MODULE_3__/* .extend */ .X$)(true,{expectedIntermediateStatusCodes:[],options:{signal:abortController.signal},
|
|
2095
|
+
*/var checkReachability=/*#__PURE__*/function(){var _checkReachability=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(url,givenOptions){var _ref;var abortController,options,statusCodes,expectedIntermediateStatusCodes,isStatusCodeExpected,checkAndThrow,_t3;return _regenerator().w(function(_context2){while(1)switch(_context2.n){case 0:if(givenOptions===void 0){givenOptions={}}if(_context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.fetch){_context2.n=1;break}throw new Error("Missing fetch implementation available.");case 1:abortController=(_ref=givenOptions.abortController)!==null&&_ref!==void 0?_ref:new AbortController;options=(0,_object_js__WEBPACK_IMPORTED_MODULE_3__/* .extend */ .X$)(true,{expectedIntermediateStatusCodes:[],options:{signal:abortController.signal},pollIntervalInSeconds:0.1,statusCodes:200,timeoutInSeconds:10,wait:false},givenOptions);statusCodes=[].concat(options.statusCodes);expectedIntermediateStatusCodes=[].concat(options.expectedIntermediateStatusCodes);isStatusCodeExpected=function isStatusCodeExpected(response,statusCodes){return"status"in response&&statusCodes.includes(response.status)};checkAndThrow=function checkAndThrow(response){if(!isStatusCodeExpected(response,statusCodes))throw new Error("Given status code ".concat(String(response.status)," ")+"differs from ".concat(statusCodes.join(", "),"."));return response};if(!options.wait){_context2.n=2;break}return _context2.a(2,new Promise(function(resolve,reject){var timedOut=false;var timer=(0,_utility_js__WEBPACK_IMPORTED_MODULE_4__/* .timeout */ .wR)(options.timeoutInSeconds*1000);var retryErrorHandler=function retryErrorHandler(error){if(!timedOut){currentlyRunningTimer=(0,_utility_js__WEBPACK_IMPORTED_MODULE_4__/* .timeout */ .wR)(options.pollIntervalInSeconds*1000,wrapper);/*
|
|
2096
2096
|
NOTE: A timer rejection is expected. Avoid throwing
|
|
2097
2097
|
errors about unhandled promise rejections.
|
|
2098
2098
|
*/currentlyRunningTimer.catch(function(){// Do nothing regardless of an error.
|
|
@@ -2105,7 +2105,7 @@ return viewArrayAsScope(value,childrenPropertyNames,propertyReferenceKeys)}if(va
|
|
|
2105
2105
|
* status code will be given.
|
|
2106
2106
|
* @param givenOptions.timeoutInSeconds - Delay after assuming given resource
|
|
2107
2107
|
* will stay available.
|
|
2108
|
-
* @param givenOptions.
|
|
2108
|
+
* @param givenOptions.pollIntervalInSeconds - Seconds between two tries to
|
|
2109
2109
|
* reach given url.
|
|
2110
2110
|
* @param givenOptions.statusCodes - Status codes to check for.
|
|
2111
2111
|
* @param givenOptions.options - Fetch options to use.
|
|
@@ -2113,7 +2113,7 @@ return viewArrayAsScope(value,childrenPropertyNames,propertyReferenceKeys)}if(va
|
|
|
2113
2113
|
* be finished. Otherwise, returned promise will be rejected. If "wait" is set
|
|
2114
2114
|
* to "true" we will resolve to another promise still resolving when final
|
|
2115
2115
|
* timeout is reached or the endpoint is unreachable (after some tries).
|
|
2116
|
-
*/var checkUnreachability=/*#__PURE__*/function(){var _checkUnreachability=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(url,givenOptions){var _ref2;var abortController,options,check,result,_t5,_t6;return _regenerator().w(function(_context4){while(1)switch(_context4.p=_context4.n){case 0:if(givenOptions===void 0){givenOptions={}}if(_context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.fetch){_context4.n=1;break}throw new Error("Missing fetch implementation available.");case 1:abortController=(_ref2=givenOptions.abortController)!==null&&_ref2!==void 0?_ref2:new AbortController;options=(0,_object_js__WEBPACK_IMPORTED_MODULE_3__/* .extend */ .X$)(true,{options:{signal:abortController.signal},
|
|
2116
|
+
*/var checkUnreachability=/*#__PURE__*/function(){var _checkUnreachability=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(url,givenOptions){var _ref2;var abortController,options,check,result,_t5,_t6;return _regenerator().w(function(_context4){while(1)switch(_context4.p=_context4.n){case 0:if(givenOptions===void 0){givenOptions={}}if(_context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.fetch){_context4.n=1;break}throw new Error("Missing fetch implementation available.");case 1:abortController=(_ref2=givenOptions.abortController)!==null&&_ref2!==void 0?_ref2:new AbortController;options=(0,_object_js__WEBPACK_IMPORTED_MODULE_3__/* .extend */ .X$)(true,{options:{signal:abortController.signal},pollIntervalInSeconds:0.1,statusCodes:[],timeoutInSeconds:10,wait:false},givenOptions);check=function check(response){var statusCodes=[].concat(options.statusCodes);if(statusCodes.length){if((0,_indicators_js__WEBPACK_IMPORTED_MODULE_1__/* .isObject */ .Gv)(response)&&"status"in response&&statusCodes.includes(response.status))throw new Error("Given url \"".concat(url,"\" is reachable and responses with ")+"status code \"".concat(String(response.status),"\"."));return new Error("Given status code is not \"".concat(statusCodes.join(", "),"\"."))}return null};if(!options.wait){_context4.n=2;break}return _context4.a(2,new Promise(function(resolve,reject){var timedOut=false;var _wrapper2=/*#__PURE__*/function(){var _wrapper3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(){var response,result,_t4;return _regenerator().w(function(_context3){while(1)switch(_context3.p=_context3.n){case 0:_context3.p=0;_context3.n=1;return _context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.fetch(url,options.options);case 1:response=_context3.v;if(!timedOut){_context3.n=2;break}return _context3.a(2,response);case 2:result=check(response);if(!result){_context3.n=3;break}timer.clear();resolve(result);return _context3.a(2,result);case 3:currentlyRunningTimer=(0,_utility_js__WEBPACK_IMPORTED_MODULE_4__/* .timeout */ .wR)(options.pollIntervalInSeconds*1000,_wrapper2);/*
|
|
2117
2117
|
NOTE: A timer rejection is expected. Avoid throwing
|
|
2118
2118
|
errors about unhandled promise rejections.
|
|
2119
2119
|
*/currentlyRunningTimer.catch(function(){// Do nothing regardless of an error.
|
package/dist/type.d.ts
CHANGED
|
@@ -80,7 +80,7 @@ export interface CheckReachabilityOptions {
|
|
|
80
80
|
abortController: AbortController;
|
|
81
81
|
expectedIntermediateStatusCodes: Array<number> | number;
|
|
82
82
|
options: RequestInit;
|
|
83
|
-
|
|
83
|
+
pollIntervalInSeconds: number;
|
|
84
84
|
statusCodes: Array<number> | number;
|
|
85
85
|
timeoutInSeconds: number;
|
|
86
86
|
wait: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clientnode",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1512",
|
|
4
4
|
"description": "Handy utilities for any JavaScript environments.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"client",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"globals@npm:^11.1.0": "patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch",
|
|
128
128
|
"globals@npm:^14.0.0": "patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch",
|
|
129
129
|
"globals@npm:^9.18.0": "patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch",
|
|
130
|
-
"weboptimizer/clientnode": "4.0.
|
|
130
|
+
"weboptimizer/clientnode": "4.0.1510",
|
|
131
131
|
"webpack": "5.109.2"
|
|
132
132
|
},
|
|
133
133
|
"engines": {
|