cliodot 1.2.2 → 1.2.4

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.
Files changed (147) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +81 -0
  3. package/dist/AuthAppClient.d.ts +1 -0
  4. package/dist/AuthAppClient.d.ts.map +1 -1
  5. package/dist/AuthAppClient.js +199 -1
  6. package/dist/CommercialAppClient.d.ts +178 -0
  7. package/dist/CommercialAppClient.d.ts.map +1 -0
  8. package/dist/CommercialAppClient.js +576 -0
  9. package/dist/ConnectorBuilder.js +104 -1
  10. package/dist/Events.d.ts +2 -0
  11. package/dist/Events.d.ts.map +1 -1
  12. package/dist/Events.js +325 -1
  13. package/dist/Flosync.js +296 -1
  14. package/dist/FlosyncClient.js +429 -1
  15. package/dist/FunctionBuilder.js +65 -1
  16. package/dist/IdentityAppClient.d.ts +23 -0
  17. package/dist/IdentityAppClient.d.ts.map +1 -0
  18. package/dist/IdentityAppClient.js +197 -0
  19. package/dist/MemoryAppClient.d.ts +28 -0
  20. package/dist/MemoryAppClient.d.ts.map +1 -0
  21. package/dist/MemoryAppClient.js +149 -0
  22. package/dist/MemoryClient.d.ts +8 -0
  23. package/dist/MemoryClient.d.ts.map +1 -0
  24. package/dist/MemoryClient.js +20 -0
  25. package/dist/OAuthAppClient.d.ts +1 -0
  26. package/dist/OAuthAppClient.d.ts.map +1 -1
  27. package/dist/OAuthAppClient.js +269 -1
  28. package/dist/ProviderServicesClient.d.ts +24 -0
  29. package/dist/ProviderServicesClient.d.ts.map +1 -0
  30. package/dist/ProviderServicesClient.js +158 -0
  31. package/dist/Surface.d.ts +2 -0
  32. package/dist/Surface.d.ts.map +1 -1
  33. package/dist/Surface.js +255 -1
  34. package/dist/ValidatorBuilder.js +24 -1
  35. package/dist/Webhooks.d.ts +20 -0
  36. package/dist/Webhooks.d.ts.map +1 -0
  37. package/dist/Webhooks.js +61 -0
  38. package/dist/WorkflowBuilder.js +279 -1
  39. package/dist/__tests__/CommercialAppClient.test.d.ts +2 -0
  40. package/dist/__tests__/CommercialAppClient.test.d.ts.map +1 -0
  41. package/dist/__tests__/CommercialAppClient.test.js +217 -0
  42. package/dist/__tests__/Events.test.js +191 -1
  43. package/dist/__tests__/IdentityAppClient.test.d.ts +2 -0
  44. package/dist/__tests__/IdentityAppClient.test.d.ts.map +1 -0
  45. package/dist/__tests__/IdentityAppClient.test.js +232 -0
  46. package/dist/__tests__/OAuthAppClient.test.js +300 -1
  47. package/dist/__tests__/ProviderServicesClient.test.d.ts +2 -0
  48. package/dist/__tests__/ProviderServicesClient.test.d.ts.map +1 -0
  49. package/dist/__tests__/ProviderServicesClient.test.js +131 -0
  50. package/dist/__tests__/Surface.test.js +150 -1
  51. package/dist/__tests__/errors.test.js +54 -1
  52. package/dist/__tests__/function.test.js +58 -1
  53. package/dist/__tests__/helpers.d.ts +5 -0
  54. package/dist/__tests__/helpers.d.ts.map +1 -0
  55. package/dist/__tests__/helpers.js +10 -0
  56. package/dist/__tests__/localhost-lookup.test.d.ts +2 -0
  57. package/dist/__tests__/localhost-lookup.test.d.ts.map +1 -0
  58. package/dist/__tests__/localhost-lookup.test.js +26 -0
  59. package/dist/__tests__/parse-api-error.test.js +26 -1
  60. package/dist/__tests__/runner.test.js +156 -1
  61. package/dist/connectors/builtin.js +354 -1
  62. package/dist/connectors/registry.js +300 -1
  63. package/dist/decorators/build.js +105 -1
  64. package/dist/decorators/connector.js +56 -1
  65. package/dist/decorators/index.js +34 -1
  66. package/dist/decorators/metadata.js +338 -1
  67. package/dist/decorators/steps.js +220 -1
  68. package/dist/decorators/workflow.js +52 -1
  69. package/dist/errors.js +76 -1
  70. package/dist/http/__tests__/cliodot-request.environment.test.d.ts +2 -0
  71. package/dist/http/__tests__/cliodot-request.environment.test.d.ts.map +1 -0
  72. package/dist/http/__tests__/cliodot-request.environment.test.js +37 -0
  73. package/dist/http/__tests__/cliodot-result.test.d.ts +2 -0
  74. package/dist/http/__tests__/cliodot-result.test.d.ts.map +1 -0
  75. package/dist/http/__tests__/cliodot-result.test.js +57 -0
  76. package/dist/http/__tests__/events-instance-id.test.d.ts +2 -0
  77. package/dist/http/__tests__/events-instance-id.test.d.ts.map +1 -0
  78. package/dist/http/__tests__/events-instance-id.test.js +45 -0
  79. package/dist/http/cliodot-request.d.ts +35 -0
  80. package/dist/http/cliodot-request.d.ts.map +1 -0
  81. package/dist/http/cliodot-request.js +105 -0
  82. package/dist/http/cliodot-result.d.ts +40 -0
  83. package/dist/http/cliodot-result.d.ts.map +1 -0
  84. package/dist/http/cliodot-result.js +139 -0
  85. package/dist/http/create-client.d.ts +3 -0
  86. package/dist/http/create-client.d.ts.map +1 -0
  87. package/dist/http/create-client.js +14 -0
  88. package/dist/http/events-instance-id.d.ts +11 -0
  89. package/dist/http/events-instance-id.d.ts.map +1 -0
  90. package/dist/http/events-instance-id.js +86 -0
  91. package/dist/http/localhost-lookup.d.ts +12 -0
  92. package/dist/http/localhost-lookup.d.ts.map +1 -0
  93. package/dist/http/localhost-lookup.js +67 -0
  94. package/dist/http/parse-api-error.js +56 -1
  95. package/dist/http/sanitize-execution-headers.js +79 -1
  96. package/dist/identity-offline-verify.d.ts +6 -0
  97. package/dist/identity-offline-verify.d.ts.map +1 -0
  98. package/dist/identity-offline-verify.js +174 -0
  99. package/dist/identity-token-cache.d.ts +6 -0
  100. package/dist/identity-token-cache.d.ts.map +1 -0
  101. package/dist/identity-token-cache.js +51 -0
  102. package/dist/index.d.ts +10 -0
  103. package/dist/index.d.ts.map +1 -1
  104. package/dist/index.js +108 -1
  105. package/dist/runner/ProcessorEngine.js +1311 -1
  106. package/dist/runner/connector.executor.js +1786 -1
  107. package/dist/runner/utilities/math.executor.js +153 -1
  108. package/dist/runner/utilities/random.executor.js +151 -1
  109. package/dist/runner/utilities/string.executor.js +825 -1
  110. package/dist/template.js +127 -1
  111. package/dist/transformers/StepsToNodesTransformer.js +214 -1
  112. package/dist/transformers/WorkflowTransformer.js +189 -1
  113. package/dist/types/auth-app.api.d.ts +2 -0
  114. package/dist/types/auth-app.api.d.ts.map +1 -1
  115. package/dist/types/auth-app.api.js +2 -1
  116. package/dist/types/builtin.js +2 -1
  117. package/dist/types/client.api.js +2 -1
  118. package/dist/types/commercial-app.api.d.ts +963 -0
  119. package/dist/types/commercial-app.api.d.ts.map +1 -0
  120. package/dist/types/commercial-app.api.js +2 -0
  121. package/dist/types/connector.js +2 -1
  122. package/dist/types/context.js +2 -1
  123. package/dist/types/event-app.api.d.ts +8 -0
  124. package/dist/types/event-app.api.d.ts.map +1 -1
  125. package/dist/types/event-app.api.js +2 -1
  126. package/dist/types/function.js +2 -1
  127. package/dist/types/identity-app.api.d.ts +99 -0
  128. package/dist/types/identity-app.api.d.ts.map +1 -0
  129. package/dist/types/identity-app.api.js +2 -0
  130. package/dist/types/index.js +23 -1
  131. package/dist/types/memory-app.api.d.ts +140 -0
  132. package/dist/types/memory-app.api.d.ts.map +1 -0
  133. package/dist/types/memory-app.api.js +2 -0
  134. package/dist/types/oauth-app.api.d.ts +2 -0
  135. package/dist/types/oauth-app.api.d.ts.map +1 -1
  136. package/dist/types/oauth-app.api.js +105 -1
  137. package/dist/types/provider-services.api.d.ts +98 -0
  138. package/dist/types/provider-services.api.d.ts.map +1 -0
  139. package/dist/types/provider-services.api.js +2 -0
  140. package/dist/types/validator.js +2 -1
  141. package/dist/types/webhook-app.api.d.ts +2 -0
  142. package/dist/types/webhook-app.api.d.ts.map +1 -0
  143. package/dist/types/webhook-app.api.js +2 -0
  144. package/dist/types/workflow.js +33 -1
  145. package/dist/validators/validators.js +478 -1
  146. package/dist/variable.js +37 -1
  147. package/package.json +3 -2
@@ -1 +1,478 @@
1
- 'use strict';const _0x4bc214=_0x4c11;function _0x4c11(_0x20f508,_0x55e43c){_0x20f508=_0x20f508-0x70;const _0x4badb3=_0x4bad();let _0x4c1138=_0x4badb3[_0x20f508];if(_0x4c11['NWCJZu']===undefined){var _0x34b353=function(_0x251a72){const _0x3aafb9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1a1896='',_0x19c13b='';for(let _0x51fe41=0x0,_0x4ab92e,_0x229b7c,_0x28f268=0x0;_0x229b7c=_0x251a72['charAt'](_0x28f268++);~_0x229b7c&&(_0x4ab92e=_0x51fe41%0x4?_0x4ab92e*0x40+_0x229b7c:_0x229b7c,_0x51fe41++%0x4)?_0x1a1896+=String['fromCharCode'](0xff&_0x4ab92e>>(-0x2*_0x51fe41&0x6)):0x0){_0x229b7c=_0x3aafb9['indexOf'](_0x229b7c);}for(let _0x255cc5=0x0,_0x463419=_0x1a1896['length'];_0x255cc5<_0x463419;_0x255cc5++){_0x19c13b+='%'+('00'+_0x1a1896['charCodeAt'](_0x255cc5)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x19c13b);};_0x4c11['OLQbgV']=_0x34b353,_0x4c11['cVUAtT']={},_0x4c11['NWCJZu']=!![];}const _0x502b0b=_0x4badb3[0x0],_0x516630=_0x20f508+_0x502b0b,_0x2e6561=_0x4c11['cVUAtT'][_0x516630];return!_0x2e6561?(_0x4c1138=_0x4c11['OLQbgV'](_0x4c1138),_0x4c11['cVUAtT'][_0x516630]=_0x4c1138):_0x4c1138=_0x2e6561,_0x4c1138;}(function(_0x5a498d,_0xa705bd){const _0x200168=_0x4c11,_0x33883d=_0x5a498d();while(!![]){try{const _0x543dbd=parseInt(_0x200168(0x7d))/0x1*(parseInt(_0x200168(0x76))/0x2)+-parseInt(_0x200168(0xa5))/0x3*(-parseInt(_0x200168(0x86))/0x4)+parseInt(_0x200168(0x7b))/0x5*(-parseInt(_0x200168(0xa4))/0x6)+-parseInt(_0x200168(0xb8))/0x7*(-parseInt(_0x200168(0x12b))/0x8)+parseInt(_0x200168(0x11e))/0x9*(-parseInt(_0x200168(0xc3))/0xa)+parseInt(_0x200168(0xaf))/0xb*(parseInt(_0x200168(0xc6))/0xc)+-parseInt(_0x200168(0x87))/0xd*(parseInt(_0x200168(0x90))/0xe);if(_0x543dbd===_0xa705bd)break;else _0x33883d['push'](_0x33883d['shift']());}catch(_0x20e384){_0x33883d['push'](_0x33883d['shift']());}}}(_0x4bad,0x48b7c));Object['defineProperty'](exports,_0x4bc214(0x8e),{'value':!![]}),exports['ValidatorFns']=void 0x0,exports[_0x4bc214(0xb9)]=applyValidationsCollectAll,exports[_0x4bc214(0xd3)]=applyValidations;function validationLocatorPrefix(_0x1a1896,_0x19c13b){const _0x4a5998=_0x4bc214,_0x51fe41=[];if(_0x1a1896?.[_0x4a5998(0x127)])_0x51fe41[_0x4a5998(0x114)]('step\x20\x22'+_0x1a1896[_0x4a5998(0x127)]+'\x22');if(_0x1a1896?.['fieldName'])_0x51fe41[_0x4a5998(0x114)](_0x4a5998(0x104)+_0x1a1896['fieldName']+'\x22');return _0x51fe41['push'](_0x4a5998(0xa0)+_0x19c13b+'\x22'),'['+_0x51fe41[_0x4a5998(0x96)](_0x4a5998(0x124))+']\x20';}function enrichValidationText(_0x4ab92e,_0x229b7c,_0x28f268,_0x255cc5){const _0x463419=_0x28f268&&String(_0x28f268)['trim']()||_0x255cc5;return validationLocatorPrefix(_0x4ab92e,_0x229b7c)+_0x463419;}exports[_0x4bc214(0xa6)]={'required':(_0x429d01,_0x48cb53={})=>{const _0x44d73b=_0x4bc214,{message:_0xdbcb6b}=_0x48cb53;if(_0x429d01===null||_0x429d01===undefined)return{'valid':![],'error':_0xdbcb6b||_0x44d73b(0xeb),'message':_0xdbcb6b||_0x44d73b(0xeb)};if(typeof _0x429d01==='string'&&_0x429d01[_0x44d73b(0x7f)]()==='')return{'valid':![],'error':_0xdbcb6b||_0x44d73b(0xc9),'message':_0xdbcb6b||_0x44d73b(0xc9)};return{'valid':!![]};},'not_empty':(_0x140c3d,_0x493436={})=>{const _0x1c0687=_0x4bc214,{message:_0x50be28}=_0x493436;if(_0x140c3d===null||_0x140c3d===undefined)return{'valid':![],'error':_0x50be28||_0x1c0687(0xeb),'message':_0x50be28||_0x1c0687(0xc9)};if(typeof _0x140c3d===_0x1c0687(0x71)&&_0x140c3d[_0x1c0687(0x7f)]()==='')return{'valid':![],'error':_0x50be28||_0x1c0687(0xfa),'message':_0x50be28||_0x1c0687(0xa7)};if(Array[_0x1c0687(0x10c)](_0x140c3d)&&_0x140c3d[_0x1c0687(0xde)]===0x0)return{'valid':![],'error':_0x50be28||_0x1c0687(0xcb),'message':_0x50be28||'Array\x20must\x20contain\x20at\x20least\x20one\x20item'};if(typeof _0x140c3d===_0x1c0687(0x113)&&!Array[_0x1c0687(0x10c)](_0x140c3d)&&Object['keys'](_0x140c3d)[_0x1c0687(0xde)]===0x0)return{'valid':![],'error':_0x50be28||_0x1c0687(0x117),'message':_0x50be28||'Object\x20must\x20contain\x20at\x20least\x20one\x20property'};if(typeof _0x140c3d===_0x1c0687(0xc4)&&isNaN(_0x140c3d))return{'valid':![],'error':_0x50be28||_0x1c0687(0xe4),'message':_0x50be28||'Value\x20must\x20be\x20a\x20valid\x20number'};return{'valid':!![]};},'is_empty':(_0x2ad6fa,_0x3a3522={})=>{const _0x3bb229=_0x4bc214,{message:_0xe87b37}=_0x3a3522;if(_0x2ad6fa===null||_0x2ad6fa===undefined)return{'valid':!![]};if(typeof _0x2ad6fa===_0x3bb229(0x71)&&_0x2ad6fa[_0x3bb229(0x7f)]()==='')return{'valid':!![]};if(Array[_0x3bb229(0x10c)](_0x2ad6fa)&&_0x2ad6fa[_0x3bb229(0xde)]===0x0)return{'valid':!![]};if(typeof _0x2ad6fa===_0x3bb229(0x113)&&Object[_0x3bb229(0x8f)](_0x2ad6fa)[_0x3bb229(0xde)]===0x0)return{'valid':!![]};return{'valid':![],'error':_0xe87b37||_0x3bb229(0xf1),'message':_0xe87b37||_0x3bb229(0x9e)};},'contains':(_0x1cc126,_0x1fa10f={})=>{const _0x5a5e89=_0x4bc214,{search:_0xb0102b,caseSensitive:caseSensitive=![],message:_0x9bdb2e}=_0x1fa10f;if(_0xb0102b===undefined||_0xb0102b===null)return{'valid':![],'error':_0x5a5e89(0xc5),'message':_0x5a5e89(0xf4)};if(typeof _0x1cc126!==_0x5a5e89(0x71))return{'valid':![],'error':_0x9bdb2e||'Value\x20must\x20be\x20a\x20string','message':_0x9bdb2e||_0x5a5e89(0x10d)};const value=caseSensitive?_0x1cc126:_0x1cc126[_0x5a5e89(0x106)](),_0x249ac8=caseSensitive?String(_0xb0102b):String(_0xb0102b)[_0x5a5e89(0x106)]();return value[_0x5a5e89(0x107)](_0x249ac8)?{'valid':!![]}:{'valid':![],'error':_0x9bdb2e||_0x5a5e89(0x93)+_0xb0102b+'\x22','message':_0x9bdb2e||_0x5a5e89(0x8c)+_0xb0102b+'\x22'};},'not_contains':(_0x48f00e,_0x86a3c9={})=>{const _0x13c283=_0x4bc214,{search:_0x51d06a,caseSensitive:caseSensitive=![],message:_0x2dbc28}=_0x86a3c9;if(_0x51d06a===undefined||_0x51d06a===null)return{'valid':![],'error':_0x13c283(0xc5),'message':'Search\x20parameter\x20is\x20required\x20for\x20not_contains\x20validation'};if(typeof _0x48f00e!==_0x13c283(0x71))return{'valid':![],'error':_0x2dbc28||_0x13c283(0xaa),'message':_0x2dbc28||_0x13c283(0x108)};const value=caseSensitive?_0x48f00e:_0x48f00e[_0x13c283(0x106)](),_0xca3e27=caseSensitive?String(_0x51d06a):String(_0x51d06a)[_0x13c283(0x106)]();return!value[_0x13c283(0x107)](_0xca3e27)?{'valid':!![]}:{'valid':![],'error':_0x2dbc28||_0x13c283(0x70)+_0x51d06a+'\x22','message':_0x2dbc28||'Value\x20must\x20not\x20contain\x20\x22'+_0x51d06a+'\x22'};},'begins_with':(_0x4bbd4d,_0x36aa9c={})=>{const _0x4e79ac=_0x4bc214,{prefix:_0x452058,caseSensitive:caseSensitive=![],message:_0x237763}=_0x36aa9c;if(_0x452058===undefined||_0x452058===null)return{'valid':![],'error':_0x4e79ac(0x123),'message':_0x4e79ac(0x9b)};if(typeof _0x4bbd4d!==_0x4e79ac(0x71))return{'valid':![],'error':_0x237763||_0x4e79ac(0xaa),'message':_0x237763||_0x4e79ac(0x91)};const value=caseSensitive?_0x4bbd4d:_0x4bbd4d[_0x4e79ac(0x106)](),_0x1780d4=caseSensitive?String(_0x452058):String(_0x452058)['toLowerCase']();return value[_0x4e79ac(0x122)](_0x1780d4)?{'valid':!![]}:{'valid':![],'error':_0x237763||_0x4e79ac(0xd1)+_0x452058+'\x22','message':_0x237763||'Value\x20must\x20begin\x20with\x20\x22'+_0x452058+'\x22'};},'ends_with':(_0x25c359,_0x30cf18={})=>{const _0x229fe2=_0x4bc214,{suffix:_0x58664b,caseSensitive:caseSensitive=![],message:_0x6d4aa9}=_0x30cf18;if(_0x58664b===undefined||_0x58664b===null)return{'valid':![],'error':_0x229fe2(0x8d),'message':'Suffix\x20parameter\x20is\x20required\x20for\x20ends_with\x20validation'};if(typeof _0x25c359!==_0x229fe2(0x71))return{'valid':![],'error':_0x6d4aa9||'Value\x20must\x20be\x20a\x20string','message':_0x6d4aa9||_0x229fe2(0xe7)};const value=caseSensitive?_0x25c359:_0x25c359[_0x229fe2(0x106)](),_0x4ba7c8=caseSensitive?String(_0x58664b):String(_0x58664b)[_0x229fe2(0x106)]();return value[_0x229fe2(0x111)](_0x4ba7c8)?{'valid':!![]}:{'valid':![],'error':_0x6d4aa9||_0x229fe2(0x9c)+_0x58664b+'\x22','message':_0x6d4aa9||_0x229fe2(0xbf)+_0x58664b+'\x22'};},'is_in':(_0x398af6,_0x247840={})=>{const _0xc018f0=_0x4bc214,{values:values,caseSensitive:caseSensitive=![],message:_0x3cfae3}=_0x247840;if(!Array[_0xc018f0(0x10c)](values)||values[_0xc018f0(0xde)]===0x0)return{'valid':![],'error':_0xc018f0(0x83),'message':_0xc018f0(0x129)};let _0x20ad06=_0x398af6,_0x4d2a6d=values;return!caseSensitive&&typeof _0x398af6===_0xc018f0(0x71)&&(_0x20ad06=_0x398af6[_0xc018f0(0x106)](),_0x4d2a6d=values[_0xc018f0(0xac)](_0xebb844=>typeof _0xebb844==='string'?_0xebb844[_0xc018f0(0x106)]():_0xebb844)),_0x4d2a6d[_0xc018f0(0x107)](_0x20ad06)?{'valid':!![]}:{'valid':![],'error':_0x3cfae3||_0xc018f0(0xf5),'message':_0x3cfae3||_0xc018f0(0xd7)+values[_0xc018f0(0x96)](',\x20')};},'not_in':(_0x31d3d6,_0x23ea6c={})=>{const _0x4089d2=_0x4bc214,{values:values,caseSensitive:caseSensitive=![],message:_0x5d8d54}=_0x23ea6c;if(!Array[_0x4089d2(0x10c)](values))return{'valid':![],'error':_0x4089d2(0x83),'message':'Values\x20parameter\x20must\x20be\x20an\x20array\x20for\x20not_in\x20validation'};let _0x5a204f=_0x31d3d6,_0x2a2140=values;return!caseSensitive&&typeof _0x31d3d6===_0x4089d2(0x71)&&(_0x5a204f=_0x31d3d6[_0x4089d2(0x106)](),_0x2a2140=values[_0x4089d2(0xac)](_0x1e5d4a=>typeof _0x1e5d4a===_0x4089d2(0x71)?_0x1e5d4a[_0x4089d2(0x106)]():_0x1e5d4a)),!_0x2a2140[_0x4089d2(0x107)](_0x5a204f)?{'valid':!![]}:{'valid':![],'error':_0x5d8d54||_0x4089d2(0xe3),'message':_0x5d8d54||_0x4089d2(0x78)+values[_0x4089d2(0x96)](',\x20')};},'is_email':(_0x52c19c,_0x2ce6b3={})=>{const _0x231d1d=_0x4bc214,{message:_0x4ad0c6}=_0x2ce6b3;if(_0x52c19c===null||_0x52c19c===undefined||_0x52c19c==='')return{'valid':![],'error':_0x4ad0c6||_0x231d1d(0x79),'message':_0x4ad0c6||_0x231d1d(0x10a)};if(typeof _0x52c19c!==_0x231d1d(0x71))return{'valid':![],'error':_0x4ad0c6||_0x231d1d(0x10f),'message':_0x4ad0c6||_0x231d1d(0x9a)};return/^[^\s@]+@[^\s@]+\.[^\s@]+$/[_0x231d1d(0x109)](_0x52c19c)?{'valid':!![]}:{'valid':![],'error':_0x4ad0c6||_0x231d1d(0x115),'message':_0x4ad0c6||_0x231d1d(0xb6)};},'is_phone':(_0x2a710f,_0x230e41={})=>{const _0x15b5a7=_0x4bc214,{pattern:pattern=_0x15b5a7(0xe1),message:_0x8ea69a}=_0x230e41;if(_0x2a710f===null||_0x2a710f===undefined||_0x2a710f==='')return{'valid':![],'error':_0x8ea69a||_0x15b5a7(0xa2),'message':_0x8ea69a||'Phone\x20number\x20cannot\x20be\x20empty'};if(typeof _0x2a710f!==_0x15b5a7(0x71))return{'valid':![],'error':_0x8ea69a||_0x15b5a7(0xea),'message':_0x8ea69a||'Phone\x20number\x20must\x20be\x20a\x20valid\x20string'};try{return new RegExp(pattern)[_0x15b5a7(0x109)](_0x2a710f)?{'valid':!![]}:{'valid':![],'error':_0x8ea69a||_0x15b5a7(0x81),'message':_0x8ea69a||_0x15b5a7(0x73)};}catch{return{'valid':![],'error':_0x15b5a7(0x99),'message':_0x15b5a7(0xca)};}},'length':(_0x3c4287,_0x11ec19={})=>{const _0xc4002b=_0x4bc214,{min:_0xfbc506,max:_0x3f0488,exact:_0x2e2804,message:_0x5c2c2f}=_0x11ec19;if(typeof _0x3c4287!==_0xc4002b(0x71)&&!Array[_0xc4002b(0x10c)](_0x3c4287))return{'valid':![],'error':_0x5c2c2f||'Value\x20must\x20be\x20a\x20string\x20or\x20array','message':_0x5c2c2f||'Length\x20validation\x20requires\x20a\x20string\x20or\x20array'};const _0x5c00f8=_0x3c4287[_0xc4002b(0xde)];if(_0x2e2804!==undefined)return _0x5c00f8===_0x2e2804?{'valid':!![]}:{'valid':![],'error':_0x5c2c2f||_0xc4002b(0x125)+_0x2e2804,'message':_0x5c2c2f||_0xc4002b(0x95)+_0x2e2804+_0xc4002b(0xf6)};if(_0xfbc506!==undefined&&_0x5c00f8<_0xfbc506)return{'valid':![],'error':_0x5c2c2f||_0xc4002b(0xe6)+_0xfbc506,'message':_0x5c2c2f||_0xc4002b(0xbd)+_0xfbc506+_0xc4002b(0xf6)};if(_0x3f0488!==undefined&&_0x5c00f8>_0x3f0488)return{'valid':![],'error':_0x5c2c2f||_0xc4002b(0x10b)+_0x3f0488,'message':_0x5c2c2f||_0xc4002b(0x84)+_0x3f0488+_0xc4002b(0xf6)};return{'valid':!![]};},'range':(_0xd271,_0x1b59f7={})=>{const _0x4da050=_0x4bc214,{min:_0x8c8aaf,max:_0x3b3a07,message:_0xdec7e1}=_0x1b59f7;if(typeof _0xd271!==_0x4da050(0xc4)||isNaN(_0xd271))return{'valid':![],'error':_0xdec7e1||_0x4da050(0xd6),'message':_0xdec7e1||_0x4da050(0x119)};if(_0x8c8aaf!==undefined&&_0xd271<_0x8c8aaf)return{'valid':![],'error':_0xdec7e1||_0x4da050(0x10e)+_0x8c8aaf,'message':_0xdec7e1||_0x4da050(0xd8)+_0x8c8aaf};if(_0x3b3a07!==undefined&&_0xd271>_0x3b3a07)return{'valid':![],'error':_0xdec7e1||'Value\x20must\x20be\x20at\x20most\x20'+_0x3b3a07,'message':_0xdec7e1||_0x4da050(0xc0)+_0x3b3a07};return{'valid':!![]};},'matches':(_0x5b9e1b,_0x85390e={})=>{const _0xb3c6db=_0x4bc214,{pattern:_0x391285,flags:flags='',message:_0xaaee65}=_0x85390e;if(_0x391285===undefined||_0x391285===null)return{'valid':![],'error':_0xb3c6db(0xc1),'message':_0xb3c6db(0xae)};if(typeof _0x5b9e1b!==_0xb3c6db(0x71))return{'valid':![],'error':_0xaaee65||_0xb3c6db(0xaa),'message':_0xaaee65||_0xb3c6db(0xd9)};try{return new RegExp(_0x391285,flags)[_0xb3c6db(0x109)](_0x5b9e1b)?{'valid':!![]}:{'valid':![],'error':_0xaaee65||_0xb3c6db(0xfb),'message':_0xaaee65||_0xb3c6db(0xed)+_0x391285};}catch{return{'valid':![],'error':_0xb3c6db(0x99),'message':_0xb3c6db(0xe5)};}},'is_number':(_0x1facb2,_0x539e5b={})=>{const _0x5f0b94=_0x4bc214,{message:_0x4a0688}=_0x539e5b;return typeof _0x1facb2===_0x5f0b94(0xc4)&&!isNaN(_0x1facb2)?{'valid':!![]}:{'valid':![],'error':_0x4a0688||_0x5f0b94(0xd6),'message':_0x4a0688||_0x5f0b94(0xbb)};},'is_string':(_0xf5d93a,_0x18831d={})=>{const _0x57b204=_0x4bc214,{message:_0x6926f}=_0x18831d;return typeof _0xf5d93a===_0x57b204(0x71)?{'valid':!![]}:{'valid':![],'error':_0x6926f||_0x57b204(0xaa),'message':_0x6926f||'Value\x20must\x20be\x20a\x20valid\x20string'};},'is_boolean':(_0x507bf0,_0x3ebd51={})=>{const _0x271c59=_0x4bc214,{message:_0xce6974}=_0x3ebd51;return typeof _0x507bf0===_0x271c59(0xb3)?{'valid':!![]}:{'valid':![],'error':_0xce6974||_0x271c59(0xc8),'message':_0xce6974||_0x271c59(0xc2)};},'is_array':(_0x457cc9,_0x50ec56={})=>{const _0x5337e0=_0x4bc214,{message:_0x80f0d9}=_0x50ec56;return Array[_0x5337e0(0x10c)](_0x457cc9)?{'valid':!![]}:{'valid':![],'error':_0x80f0d9||_0x5337e0(0xa1),'message':_0x80f0d9||_0x5337e0(0x94)};},'is_object':(_0x5809e6,_0x4c788b={})=>{const _0x56ea5d=_0x4bc214,{message:_0x5eb19f}=_0x4c788b;return typeof _0x5809e6==='object'&&_0x5809e6!==null&&!Array[_0x56ea5d(0x10c)](_0x5809e6)?{'valid':!![]}:{'valid':![],'error':_0x5eb19f||_0x56ea5d(0x112),'message':_0x5eb19f||_0x56ea5d(0xd0)};},'equals':(_0x5947b2,_0x5d7684={})=>{const _0x34ec37=_0x4bc214,{value:value,message:_0x14325f}=_0x5d7684;if(value===undefined)return{'valid':![],'error':_0x34ec37(0x11f),'message':_0x34ec37(0x82)};return _0x5947b2===value?{'valid':!![]}:{'valid':![],'error':_0x14325f||_0x34ec37(0xf0)+value,'message':_0x14325f||_0x34ec37(0x11a)+value};},'not_equals':(_0x22b9e0,_0x162f5d={})=>{const _0x30a84f=_0x4bc214,{value:value,message:_0xf4b887}=_0x162f5d;if(value===undefined)return{'valid':![],'error':'Comparison\x20value\x20is\x20required','message':_0x30a84f(0xcd)};return _0x22b9e0!==value?{'valid':!![]}:{'valid':![],'error':_0xf4b887||_0x30a84f(0x88)+value,'message':_0xf4b887||_0x30a84f(0xa3)+value};},'greater_than':(_0x41bdcc,_0x58c8a9={})=>{const _0x42862d=_0x4bc214,{value:value,message:_0x1959cb}=_0x58c8a9;if(value===undefined)return{'valid':![],'error':_0x42862d(0x11f),'message':'Value\x20parameter\x20is\x20required\x20for\x20greater_than\x20validation'};if(typeof _0x41bdcc!==_0x42862d(0xc4)||isNaN(_0x41bdcc))return{'valid':![],'error':_0x1959cb||_0x42862d(0xd6),'message':_0x1959cb||_0x42862d(0xf9)};return _0x41bdcc>value?{'valid':!![]}:{'valid':![],'error':_0x1959cb||_0x42862d(0xb4)+value,'message':_0x1959cb||_0x42862d(0xb4)+value};},'greater_than_or_equal':(_0x4ba78b,_0x52d1de={})=>{const _0x20f28b=_0x4bc214,{value:value,message:_0x13928a}=_0x52d1de;if(value===undefined)return{'valid':![],'error':_0x20f28b(0x11f),'message':_0x20f28b(0xa8)};if(typeof _0x4ba78b!==_0x20f28b(0xc4)||isNaN(_0x4ba78b))return{'valid':![],'error':_0x13928a||'Value\x20must\x20be\x20a\x20number','message':_0x13928a||_0x20f28b(0x100)};return _0x4ba78b>=value?{'valid':!![]}:{'valid':![],'error':_0x13928a||_0x20f28b(0xd8)+value,'message':_0x13928a||_0x20f28b(0xd8)+value};},'less_than':(_0xc04c34,_0x22bf0d={})=>{const _0x4282fb=_0x4bc214,{value:value,message:_0x51b3a8}=_0x22bf0d;if(value===undefined)return{'valid':![],'error':'Comparison\x20value\x20is\x20required','message':_0x4282fb(0x9d)};if(typeof _0xc04c34!==_0x4282fb(0xc4)||isNaN(_0xc04c34))return{'valid':![],'error':_0x51b3a8||'Value\x20must\x20be\x20a\x20number','message':_0x51b3a8||_0x4282fb(0xb2)};return _0xc04c34<value?{'valid':!![]}:{'valid':![],'error':_0x51b3a8||_0x4282fb(0xda)+value,'message':_0x51b3a8||'Value\x20must\x20be\x20less\x20than\x20'+value};},'less_than_or_equal':(_0x4138e7,_0x117771={})=>{const _0x463500=_0x4bc214,{value:value,message:_0x67c2c}=_0x117771;if(value===undefined)return{'valid':![],'error':'Comparison\x20value\x20is\x20required','message':_0x463500(0x105)};if(typeof _0x4138e7!==_0x463500(0xc4)||isNaN(_0x4138e7))return{'valid':![],'error':_0x67c2c||_0x463500(0xd6),'message':_0x67c2c||_0x463500(0x103)};return _0x4138e7<=value?{'valid':!![]}:{'valid':![],'error':_0x67c2c||'Value\x20must\x20be\x20less\x20than\x20or\x20equal\x20to\x20'+value,'message':_0x67c2c||_0x463500(0xc0)+value};},'is_url':(_0xcf22dd,_0x1d67f3={})=>{const _0x5e0a09=_0x4bc214,{message:_0x49f505}=_0x1d67f3;if(_0xcf22dd===null||_0xcf22dd===undefined||_0xcf22dd==='')return{'valid':![],'error':_0x49f505||_0x5e0a09(0xce),'message':_0x49f505||_0x5e0a09(0x118)};if(typeof _0xcf22dd!=='string')return{'valid':![],'error':_0x49f505||_0x5e0a09(0x116),'message':_0x49f505||_0x5e0a09(0x110)};try{return new URL(_0xcf22dd),{'valid':!![]};}catch{return{'valid':![],'error':_0x49f505||_0x5e0a09(0xe2),'message':_0x49f505||'Value\x20must\x20be\x20a\x20valid\x20URL'};}},'is_date':(_0x4368b9,_0x844026={})=>{const _0xc6f92e=_0x4bc214,{message:_0x3c156a}=_0x844026;if(_0x4368b9===null||_0x4368b9===undefined||_0x4368b9==='')return{'valid':![],'error':_0x3c156a||_0xc6f92e(0xfe),'message':_0x3c156a||_0xc6f92e(0x11d)};const _0x3819c7=new Date(_0x4368b9);return isNaN(_0x3819c7[_0xc6f92e(0xdd)]())?{'valid':![],'error':_0x3c156a||_0xc6f92e(0xf7),'message':_0x3c156a||_0xc6f92e(0xba)}:{'valid':!![]};},'is_address':(_0x1f9633,_0x19eacd={})=>{const _0x16675c=_0x4bc214,{minLength:minLength=0x5,maxLength:_0x42d522,message:_0x330fac}=_0x19eacd;if(_0x1f9633===null||_0x1f9633===undefined||_0x1f9633==='')return{'valid':![],'error':_0x330fac||_0x16675c(0xdc),'message':_0x330fac||_0x16675c(0x85)};if(typeof _0x1f9633!==_0x16675c(0x71))return{'valid':![],'error':_0x330fac||_0x16675c(0x126),'message':_0x330fac||_0x16675c(0xf2)};const _0x4969d1=_0x1f9633[_0x16675c(0x7f)]();if(_0x4969d1[_0x16675c(0xde)]<minLength)return{'valid':![],'error':_0x330fac||_0x16675c(0x128)+minLength+'\x20characters','message':_0x330fac||_0x16675c(0x128)+minLength+_0x16675c(0xbe)};if(_0x42d522!==undefined&&_0x4969d1[_0x16675c(0xde)]>_0x42d522)return{'valid':![],'error':_0x330fac||_0x16675c(0x120)+_0x42d522+'\x20characters','message':_0x330fac||_0x16675c(0x120)+_0x42d522+_0x16675c(0xbe)};return{'valid':!![]};},'is_uuid':(_0x46867a,_0x3e2f7e={})=>{const _0x194e30=_0x4bc214,{message:_0x1dc648}=_0x3e2f7e,_0x19aa1a=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;return typeof _0x46867a==='string'&&_0x19aa1a[_0x194e30(0x109)](_0x46867a)?{'valid':!![]}:{'valid':![],'error':_0x1dc648||'Invalid\x20UUID\x20format','message':_0x1dc648||_0x194e30(0xec)};},'is_cuid':(_0x1a3ab8,_0x1b55da={})=>{const _0x19a7c0=_0x4bc214,{message:_0x42ae47}=_0x1b55da,_0x35fba9=/^c[^\s-]{8,}$/i;return typeof _0x1a3ab8===_0x19a7c0(0x71)&&_0x35fba9[_0x19a7c0(0x109)](_0x1a3ab8)?{'valid':!![]}:{'valid':![],'error':_0x42ae47||_0x19a7c0(0xb1),'message':_0x42ae47||'Value\x20must\x20be\x20a\x20valid\x20CUID'};},'is_jwt':(_0x268e96,_0x2c742f={})=>{const _0x208477=_0x4bc214,{message:_0x541aa5}=_0x2c742f,_0x24ba99=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;return typeof _0x268e96===_0x208477(0x71)&&_0x24ba99[_0x208477(0x109)](_0x268e96)?{'valid':!![]}:{'valid':![],'error':_0x541aa5||_0x208477(0x11c),'message':_0x541aa5||_0x208477(0xee)};},'is_json':(_0x2c5f38,_0x1ba938={})=>{const _0x3d6dee=_0x4bc214,{message:_0x1935ab}=_0x1ba938;if(typeof _0x2c5f38!=='string')return{'valid':![],'error':_0x1935ab||'Value\x20must\x20be\x20a\x20string','message':_0x1935ab||_0x3d6dee(0x8b)};try{return JSON['parse'](_0x2c5f38),{'valid':!![]};}catch{return{'valid':![],'error':_0x1935ab||_0x3d6dee(0x98),'message':_0x1935ab||_0x3d6dee(0xb0)};}},'is_alphanumeric':(_0x3e1485,_0x574941={})=>{const _0x3571d1=_0x4bc214,{message:_0x724f0e}=_0x574941;return typeof _0x3e1485===_0x3571d1(0x71)&&/^[a-zA-Z0-9]+$/[_0x3571d1(0x109)](_0x3e1485)?{'valid':!![]}:{'valid':![],'error':_0x724f0e||_0x3571d1(0x8a),'message':_0x724f0e||'Value\x20must\x20contain\x20only\x20letters\x20and\x20numbers'};},'is_alpha':(_0x54c469,_0xc457be={})=>{const _0x4ab7b0=_0x4bc214,{message:_0x1269e5}=_0xc457be;return typeof _0x54c469===_0x4ab7b0(0x71)&&/^[a-zA-Z]+$/['test'](_0x54c469)?{'valid':!![]}:{'valid':![],'error':_0x1269e5||_0x4ab7b0(0xc7),'message':_0x1269e5||'Value\x20must\x20contain\x20only\x20letters'};},'is_numeric_string':(_0x10ade3,_0x4807a5={})=>{const _0x671e53=_0x4bc214,{message:_0x48f871}=_0x4807a5;return typeof _0x10ade3==='string'&&/^[0-9]+$/[_0x671e53(0x109)](_0x10ade3)?{'valid':!![]}:{'valid':![],'error':_0x48f871||_0x671e53(0xe8),'message':_0x48f871||_0x671e53(0x92)};},'is_hex_color':(_0x4645e3,_0x35a1df={})=>{const _0x1cf1c2=_0x4bc214,{message:_0xc9cbce}=_0x35a1df;return typeof _0x4645e3===_0x1cf1c2(0x71)&&/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/['test'](_0x4645e3)?{'valid':!![]}:{'valid':![],'error':_0xc9cbce||_0x1cf1c2(0x72),'message':_0xc9cbce||'Value\x20must\x20be\x20a\x20valid\x20hex\x20color'};},'is_base64':(_0x3af087,_0x572f90={})=>{const _0xbaa427=_0x4bc214,{message:_0x474053}=_0x572f90,_0x45ca73=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;return typeof _0x3af087==='string'&&_0x45ca73[_0xbaa427(0x109)](_0x3af087)?{'valid':!![]}:{'valid':![],'error':_0x474053||_0xbaa427(0x12c),'message':_0x474053||_0xbaa427(0xff)};},'is_credit_card':(_0x274771,_0x39c213={})=>{const _0x5c0447=_0x4bc214,{message:_0x2c300a}=_0x39c213;if(typeof _0x274771!==_0x5c0447(0x71))return{'valid':![],'error':_0x2c300a||_0x5c0447(0x121),'message':_0x2c300a||_0x5c0447(0xaa)};const _0x3ef59d=_0x274771['replace'](/[- ]/g,'');if(!/^\d{13,19}$/[_0x5c0447(0x109)](_0x3ef59d))return{'valid':![],'error':_0x2c300a||_0x5c0447(0xa9),'message':_0x2c300a||'Invalid\x20credit\x20card\x20format'};let _0x33c10e=0x0,_0x2ffdc4=![];for(let _0x2e350e=_0x3ef59d[_0x5c0447(0xde)]-0x1;_0x2e350e>=0x0;_0x2e350e--){let _0x47de74=parseInt(_0x3ef59d[_0x5c0447(0xdb)](_0x2e350e),0xa);if(_0x2ffdc4){_0x47de74*=0x2;if(_0x47de74>0x9)_0x47de74=_0x47de74%0xa+0x1;}_0x33c10e+=_0x47de74,_0x2ffdc4=!_0x2ffdc4;}return _0x33c10e%0xa===0x0?{'valid':!![]}:{'valid':![],'error':_0x2c300a||_0x5c0447(0x89),'message':_0x2c300a||_0x5c0447(0x80)};},'is_lowercase':(_0x20aafc,_0x24ff5f={})=>{const _0x5af306=_0x4bc214,{message:_0x73c169}=_0x24ff5f;return typeof _0x20aafc===_0x5af306(0x71)&&_0x20aafc===_0x20aafc[_0x5af306(0x106)]()?{'valid':!![]}:{'valid':![],'error':_0x73c169||'Must\x20be\x20lowercase','message':_0x73c169||'Value\x20must\x20be\x20lowercase'};},'is_uppercase':(_0x53d744,_0x28cf23={})=>{const _0x2d9948=_0x4bc214,{message:_0x515bdc}=_0x28cf23;return typeof _0x53d744==='string'&&_0x53d744===_0x53d744['toUpperCase']()?{'valid':!![]}:{'valid':![],'error':_0x515bdc||_0x2d9948(0xb5),'message':_0x515bdc||_0x2d9948(0x9f)};},'is_slug':(_0x4163b5,_0x552759={})=>{const _0x55cab3=_0x4bc214,{message:_0x2c0d1b}=_0x552759;return typeof _0x4163b5===_0x55cab3(0x71)&&/^[a-z0-9]+(?:-[a-z0-9]+)*$/[_0x55cab3(0x109)](_0x4163b5)?{'valid':!![]}:{'valid':![],'error':_0x2c0d1b||'Invalid\x20slug\x20format','message':_0x2c0d1b||_0x55cab3(0xb7)};},'is_mac_address':(_0x2606e0,_0x135524={})=>{const _0x4b14be=_0x4bc214,{message:_0x594ae8}=_0x135524,_0x56d16e=/^([0-9a-fA-F]{2}[:-]){5}([0-9a-fA-F]{2})$/;return typeof _0x2606e0===_0x4b14be(0x71)&&_0x56d16e['test'](_0x2606e0)?{'valid':!![]}:{'valid':![],'error':_0x594ae8||_0x4b14be(0xab),'message':_0x594ae8||_0x4b14be(0x11b)};},'is_port':(_0xd53f9d,_0xf6d335={})=>{const _0x5a1445=_0x4bc214,{message:_0x4cd0a1}=_0xf6d335,_0x210f74=typeof _0xd53f9d==='string'?parseInt(_0xd53f9d,0xa):_0xd53f9d;return typeof _0x210f74==='number'&&_0x210f74>=0x0&&_0x210f74<=0xffff?{'valid':!![]}:{'valid':![],'error':_0x4cd0a1||_0x5a1445(0xe9),'message':_0x4cd0a1||_0x5a1445(0x101)};},'is_currency':(_0x548106,_0x1cde70={})=>{const _0x15d5bf=_0x4bc214,{message:_0x4eeb4e}=_0x1cde70,_0x5e8533=/^(?!0\.00)\d{1,3}(,\d{3})*(\.\d\d)?$/;let _0x415670=typeof _0x548106===_0x15d5bf(0xc4)?_0x548106[_0x15d5bf(0xfc)]():_0x548106;if(typeof _0x415670===_0x15d5bf(0x71)&&_0x415670[_0x15d5bf(0x122)]('$'))_0x415670=_0x415670[_0x15d5bf(0xf3)](0x1);return typeof _0x415670===_0x15d5bf(0x71)&&_0x5e8533[_0x15d5bf(0x109)](_0x415670)?{'valid':!![]}:{'valid':![],'error':_0x4eeb4e||_0x15d5bf(0x102),'message':_0x4eeb4e||'Value\x20must\x20be\x20a\x20valid\x20currency\x20amount'};},'is_latitude':(_0x4bddf2,_0x206462={})=>{const _0x4b8afc=_0x4bc214,{message:_0x8b74ac}=_0x206462,_0x83844=typeof _0x4bddf2===_0x4b8afc(0x71)?parseFloat(_0x4bddf2):_0x4bddf2;return typeof _0x83844===_0x4b8afc(0xc4)&&_0x83844>=-0x5a&&_0x83844<=0x5a?{'valid':!![]}:{'valid':![],'error':_0x8b74ac||_0x4b8afc(0xd4),'message':_0x8b74ac||_0x4b8afc(0x7c)};},'is_longitude':(_0x4a1040,_0x14f0f6={})=>{const _0x3ed9c1=_0x4bc214,{message:_0x44f172}=_0x14f0f6,_0x325b2c=typeof _0x4a1040===_0x3ed9c1(0x71)?parseFloat(_0x4a1040):_0x4a1040;return typeof _0x325b2c===_0x3ed9c1(0xc4)&&_0x325b2c>=-0xb4&&_0x325b2c<=0xb4?{'valid':!![]}:{'valid':![],'error':_0x44f172||'Invalid\x20longitude','message':_0x44f172||_0x3ed9c1(0xd5)};},'is_ip':(_0x346b53,_0x4a313e={})=>{const _0x15cd38=_0x4bc214,{version:_0x2319a2,message:_0x40b26f}=_0x4a313e;if(typeof _0x346b53!=='string')return{'valid':![],'error':_0x40b26f||_0x15cd38(0xef),'message':_0x40b26f||_0x15cd38(0xaa)};const _0x1e370d=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,_0x39d7b7=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;if(_0x2319a2===0x4)return _0x1e370d['test'](_0x346b53)?{'valid':!![]}:{'valid':![],'error':_0x40b26f||'Invalid\x20IPv4\x20address','message':_0x40b26f||_0x15cd38(0xd2)};if(_0x2319a2===0x6)return _0x39d7b7[_0x15cd38(0x109)](_0x346b53)?{'valid':!![]}:{'valid':![],'error':_0x40b26f||'Invalid\x20IPv6\x20address','message':_0x40b26f||_0x15cd38(0x77)};return _0x1e370d[_0x15cd38(0x109)](_0x346b53)||_0x39d7b7[_0x15cd38(0x109)](_0x346b53)?{'valid':!![]}:{'valid':![],'error':_0x40b26f||'Invalid\x20IP\x20address','message':_0x40b26f||'Value\x20must\x20be\x20a\x20valid\x20IP\x20address'};},'is_strong_password':(_0x52c1fb,_0x17ab07={})=>{const _0x37434b=_0x4bc214,{minLength:minLength=0x8,minLowercase:minLowercase=0x1,minUppercase:minUppercase=0x1,minNumbers:minNumbers=0x1,minSymbols:minSymbols=0x1,message:_0x2f1a66}=_0x17ab07;if(typeof _0x52c1fb!==_0x37434b(0x71))return{'valid':![],'error':_0x2f1a66||_0x37434b(0x97),'message':_0x2f1a66||_0x37434b(0xaa)};if(_0x52c1fb[_0x37434b(0xde)]<minLength)return{'valid':![],'error':_0x2f1a66||_0x37434b(0xdf)+minLength+_0x37434b(0xf6),'message':_0x2f1a66||'Password\x20must\x20be\x20at\x20least\x20'+minLength+_0x37434b(0xbe)};const _0x2808b6=(_0x52c1fb[_0x37434b(0xfd)](/[a-z]/g)||[])[_0x37434b(0xde)];if(_0x2808b6<minLowercase)return{'valid':![],'error':_0x2f1a66||_0x37434b(0xad)+minLowercase+_0x37434b(0x12a),'message':_0x2f1a66||_0x37434b(0xcc)+minLowercase+_0x37434b(0x12a)};const _0x5b0746=(_0x52c1fb['match'](/[A-Z]/g)||[])['length'];if(_0x5b0746<minUppercase)return{'valid':![],'error':_0x2f1a66||'Password\x20needs\x20'+minUppercase+_0x37434b(0x75),'message':_0x2f1a66||'Password\x20needs\x20at\x20least\x20'+minUppercase+'\x20uppercase\x20letter(s)'};const _0x32f955=(_0x52c1fb[_0x37434b(0xfd)](/[0-9]/g)||[])[_0x37434b(0xde)];if(_0x32f955<minNumbers)return{'valid':![],'error':_0x2f1a66||_0x37434b(0xad)+minNumbers+_0x37434b(0xbc),'message':_0x2f1a66||_0x37434b(0xcc)+minNumbers+_0x37434b(0xbc)};const _0x24e954=(_0x52c1fb['match'](/[^a-zA-Z0-9]/g)||[])[_0x37434b(0xde)];if(_0x24e954<minSymbols)return{'valid':![],'error':_0x2f1a66||_0x37434b(0xad)+minSymbols+'\x20symbol(s)','message':_0x2f1a66||_0x37434b(0xcc)+minSymbols+_0x37434b(0xe0)};return{'valid':!![]};}};function applyValidationsCollectAll(_0x9de083,value,_0x47ca1f){const _0x3a9db4=_0x4bc214,_0xbb944c=[];for(const _0x53cc0b of _0x9de083){const {validator:_0x33c8c2,options:options={}}=_0x53cc0b,_0x537ade=exports['ValidatorFns'][_0x33c8c2];if(!_0x537ade){const _0x1a9001=validationLocatorPrefix(_0x47ca1f,_0x33c8c2);throw new Error(_0x1a9001+'Unknown\x20validator\x20\x22'+_0x33c8c2+'\x22');}const _0x4eb3d3=_0x537ade(value,options);if(!_0x4eb3d3[_0x3a9db4(0x7e)]){const _0x37cc6f=_0x4eb3d3['message']&&String(_0x4eb3d3[_0x3a9db4(0xcf)])['trim']()||_0x4eb3d3[_0x3a9db4(0xf8)]&&String(_0x4eb3d3['error'])[_0x3a9db4(0x7f)]()||'Validation\x20failed';_0xbb944c[_0x3a9db4(0x114)]({'validator':_0x33c8c2,'message':_0x37cc6f});}}return{'valid':_0xbb944c['length']===0x0,'failures':_0xbb944c};}function _0x4bad(){const _0x19cb5c=['u2vHCMnOihzHBhvLigLZihjLCxvPCMvK','mti2mtu2wLDYBNvL','txvZDcbJB250ywLUig9UBhKGBgv0DgvYCW','vMfSDwuGBxvZDcbIzsbHigjVB2XLyw4','vMfSDwuGy2fUBM90igjLigvTChr5','ugHVBMuGDMfSAwrHDgLVBIbWyxr0zxjUigLZigLUDMfSAwq','qxjYyxKGy2fUBM90igjLigvTChr5','ugfZC3DVCMqGBMvLzhmGyxqGBgvHC3qG','vMfSDwuGCgfYyw1LDgvYigLZihjLCxvPCMvKigzVCIbUB3rFzxf1ywXZihzHBgLKyxrPB24','vvjmigLZihjLCxvPCMvK','BwvZC2fNzq','vMfSDwuGBxvZDcbIzsbHihzHBgLKig9IAMvJDa','u3rYAw5NigrVzxmGBM90igjLz2LUihDPDgGGiG','vMfSDwuGBxvZDcbIzsbHihzHBgLKieLqDJqGywrKCMvZCW','yxbWBhLwywXPzgf0Aw9UCW','sw52ywXPzcbSyxrPDhvKzq','tg9Uz2L0DwrLig11C3qGyMuGyMv0D2vLBIaTmtGWigfUzcaXoda','vMfSDwuGBxvZDcbIzsbHig51BwjLCG','vMfSDwuGBxvZDcbIzsbVBMuGB2y6ia','vMfSDwuGBxvZDcbIzsbNCMvHDgvYihrOyw4GB3iGzxf1ywWGDg8G','twf0y2HLCYb2ywXPzgf0Aw9UihjLCxvPCMvZigeGC3rYAw5NihzHBhvL','vMfSDwuGBxvZDcbIzsbSzxnZihrOyw4G','y2HHCKf0','qwrKCMvZCYbPCYbYzxf1AxjLza','z2v0vgLTzq','BgvUz3rO','ugfZC3DVCMqGBxvZDcbIzsbHDcbSzwfZDca','ihn5BwjVBcHZkq','xLWRp1SXltLDxgr7nYWXnh0K','sw52ywXPzcbvuKWGzM9YBwf0','vMfSDwuGAxmGAw4GzgLZywXSB3DLzcbSAxn0','tNvTyMvYignHBM5VDcbIzsboyu4','ugf0DgvYBIbPCYbUB3qGysb2ywXPzcbYzwD1BgfYigv4ChjLC3nPB24','tgvUz3rOig11C3qGyMuGyxqGBgvHC3qG','rw5KCYb3AxrOihzHBgLKyxrPB24GCMvXDwLYzxmGysbZDhjPBMCGDMfSDwu','txvZDcbJB250ywLUig9UBhKGBNvTyMvYCW','sw52ywXPzcbWB3j0ig51BwjLCG','ugHVBMuGBNvTyMvYig11C3qGyMuGysbZDhjPBMC','vMfSDwuGAxmGCMvXDwLYzwq','vMfSDwuGBxvZDcbIzsbHihzHBgLKifvvsuq','vMfSDwuGBxvZDcbTyxrJAcbWyxr0zxjUoIa','vMfSDwuGBxvZDcbIzsbHihzHBgLKiePxva','svaGBxvZDcbIzsbHihn0CMLUzW','vMfSDwuGzg9LCYbUB3qGzxf1ywWG','vMfSDwuGBxvZDcbIzsbLBxb0Eq','qwrKCMvZCYbTDxn0igjLigeGDMfSAwqGC3rYAw5N','C3vIC3rYAw5N','u2vHCMnOihbHCMfTzxrLCIbPCYbYzxf1AxjLzcbMB3iGy29UDgfPBNmGDMfSAwrHDgLVBG','vMfSDwuGAxmGBM90igLUigfSBg93zwqGBgLZDa','ignOyxjHy3rLCNm','sw52ywXPzcbKyxrLigzVCM1HDa','zxjYB3i','r3jLyxrLCIb0AgfUihzHBgLKyxrPB24GCMvXDwLYzxmGysbUDw1LCMLJihzHBhvL','u3rYAw5NignHBM5VDcbIzsbLBxb0Eq','vMfSDwuGzg9LCYbUB3qGBwf0y2GGCgf0DgvYBG','Dg9tDhjPBMC','Bwf0y2G','rgf0zsbPCYbYzxf1AxjLza','vMfSDwuGBxvZDcbIzsbIyxnLnJqGzw5JB2rLza','r3jLyxrLCIb0AgfUig9YigvXDwfSihzHBgLKyxrPB24GCMvXDwLYzxmGysbUDw1LCMLJihzHBhvL','ug9YDcbTDxn0igjLigjLDhDLzw4GmcbHBMqGnJu1mZu','sw52ywXPzcbJDxjYzw5JEsbMB3jTyxq','tgvZCYb0AgfUig9YigvXDwfSihzHBgLKyxrPB24GCMvXDwLYzxmGysbUDw1LCMLJihzHBhvL','zMLLBgqGiG','vMfSDwuGCgfYyw1LDgvYigLZihjLCxvPCMvKigzVCIbSzxnZx3rOyw5FB3jFzxf1ywWGDMfSAwrHDgLVBG','Dg9mB3DLCKnHC2u','Aw5JBhvKzxm','tM90ignVBNrHAw5ZihzHBgLKyxrPB24GCMvXDwLYzxmGysbZDhjPBMCGDMfSDwu','DgvZDa','rw1HAwWGy2fUBM90igjLigvTChr5','tgvUz3rOig11C3qGyMuGyxqGBw9ZDca','AxnbCNjHEq','q29UDgfPBNmGDMfSAwrHDgLVBIbYzxf1AxjLCYbHihn0CMLUzYb2ywX1zq','vMfSDwuGBxvZDcbIzsbHDcbSzwfZDca','rw1HAwWGBxvZDcbIzsbHihn0CMLUzW','vvjmig11C3qGyMuGysb2ywXPzcbZDhjPBMC','zw5KC1DPDgG','vMfSDwuGBxvZDcbIzsbHBIbVyMPLy3q','B2jQzwn0','ChvZAa','sw52ywXPzcbLBwfPBcbMB3jTyxq','vvjmig11C3qGyMuGysbZDhjPBMC','t2jQzwn0ignHBM5VDcbIzsbLBxb0Eq','vvjmignHBM5VDcbIzsbLBxb0Eq','uMfUz2uGDMfSAwrHDgLVBIbYzxf1AxjLCYbHig51BwvYAwmGDMfSDwu','vMfSDwuGBxvZDcbLCxvHBca','vMfSDwuGBxvZDcbIzsbHihzHBgLKie1bqYbHzgrYzxnZ','sw52ywXPzcbkv1qGzM9YBwf0','rgf0zsbJyw5UB3qGyMuGzw1WDhK','mtyWmJa5B0zfvMvH','q29TCgfYAxnVBIb2ywX1zsbPCYbYzxf1AxjLza','qwrKCMvZCYbTDxn0igjLigf0ig1VC3qG','q3jLzgL0ignHCMqGBxvZDcbIzsbHihn0CMLUzW','C3rHCNrZv2L0Aa','uhjLzML4igLZihjLCxvPCMvK','imk3ia','tgvUz3rOig11C3qGyMuGzxHHy3rSEsa','qwrKCMvZCYbTDxn0igjLigeGC3rYAw5N','C3rLCeLK','qwrKCMvZCYbTDxn0igjLigf0igXLyxn0ia','vMfSDwvZihbHCMfTzxrLCIbTDxn0igjLigfUigfYCMf5igzVCIbPC19PBIb2ywXPzgf0Aw9U','igXVD2vYy2fZzsbSzxr0zxiOCYK','oda4mty4yLHusurH','sw52ywXPzcbIyxnLnJqGC3rYAw5N','u3rYAw5NignVBNrHAw5Zici','C3rYAw5N','sw52ywXPzcbOzxGGy29SB3i','vMfSDwuGBxvZDcbIzsbHihzHBgLKihbOB25Lig51BwjLCG','vw5RBM93BIb2ywXPzgf0B3iGiG','ihvWCgvYy2fZzsbSzxr0zxiOCYK','nZaXodjTAMrswwK','vMfSDwuGBxvZDcbIzsbHihzHBgLKieLqDJyGywrKCMvZCW','vMfSDwuGBxvZDcbUB3qGyMuGB25Lig9MoIa','rw1HAwWGAxmGCMvXDwLYzwq','vMfSAwrHDgLVBIbMywLSzwq','mtm5nJm1vhDUAhzg','tgf0Axr1zguGBxvZDcbIzsbIzxr3zwvUic05mcbHBMqGota','mtzRvw5dDM8','DMfSAwq','DhjPBq','vMfSDwuGBxvZDcbIzsbHihzHBgLKignYzwrPDcbJyxjK','sw52ywXPzcbWAg9UzsbUDw1IzxiGzM9YBwf0','vMfSDwuGCgfYyw1LDgvYigLZihjLCxvPCMvKigzVCIbLCxvHBhmGDMfSAwrHDgLVBG','vMfSDwvZig11C3qGyMuGyw4GyxjYyxK','vMfSDwuGBxvZDcbOyxzLigf0ig1VC3qG','qwrKCMvZCYbJyw5UB3qGyMuGzw1WDhK','nhfwvwDKAG','mtnTAuLxBeW','vMfSDwuGBxvZDcbUB3qGzxf1ywWG','sw52ywXPzcbJCMvKAxqGy2fYzcbUDw1Izxi','txvZDcbIzsbHBhbOyw51BwvYAwm','sLnptIb2ywXPzgf0Aw9UihjLCxvPCMvZigeGC3rYAw5N','vMfSDwuGBxvZDcbJB250ywLUici','u3vMzML4igLZihjLCxvPCMvK','x19LC01VzhvSzq','A2v5CW','nZu1mtu4nNf3tNbZBa','qMvNAw5ZihDPDgGGDMfSAwrHDgLVBIbYzxf1AxjLCYbHihn0CMLUzYb2ywX1zq','vMfSDwuGBxvZDcbJB250ywLUig9UBhKGBNvTyMvYCW','u3rYAw5NigrVzxmGBM90ignVBNrHAw4GiG','vMfSDwuGBxvZDcbIzsbHihzHBgLKigfYCMf5','vMfSDwuGBxvZDcbOyxzLigv4ywn0BhKG','AM9PBG','ugfZC3DVCMqGBxvZDcbIzsbHihn0CMLUzW','sw52ywXPzcbku09oigzVCM1HDa','sw52ywXPzcbYzwDLEcbWyxr0zxjU','rw1HAwWGBxvZDcbIzsbHihzHBgLKihn0CMLUzW','uhjLzML4ihbHCMfTzxrLCIbPCYbYzxf1AxjLzcbMB3iGyMvNAw5Zx3DPDgGGDMfSAwrHDgLVBG','u3rYAw5NigrVzxmGBM90igvUzcb3AxrOici','vMfSDwuGCgfYyw1LDgvYigLZihjLCxvPCMvKigzVCIbSzxnZx3rOyw4GDMfSAwrHDgLVBG','vMfSDwuGAxmGBM90igvTChr5','vMfSDwuGBxvZDcbIzsb1ChbLCMnHC2u','DMfSAwrHDg9Yici','vMfSDwuGBxvZDcbIzsbHBIbHCNjHEq','ugHVBMuGBNvTyMvYigLZihjLCxvPCMvK','vMfSDwuGBxvZDcbUB3qGyMuGzxf1ywWGDg8G','mtaYrxvpD1f1','mJy3mZu3r2fZB1Hn','vMfSAwrHDg9YrM5Z','u3rYAw5Nig11C3qGBM90igjLigvTChr5','vMfSDwuGCgfYyw1LDgvYigLZihjLCxvPCMvKigzVCIbNCMvHDgvYx3rOyw5FB3jFzxf1ywWGDMfSAwrHDgLVBG','sw52ywXPzcbJCMvKAxqGy2fYzcbMB3jTyxq','vMfSDwuGBxvZDcbIzsbHihn0CMLUzW','sw52ywXPzcbnqumGywrKCMvZCW','BwfW','ugfZC3DVCMqGBMvLzhmG','ugf0DgvYBIbWyxjHBwv0zxiGAxmGCMvXDwLYzwqGzM9Yig1HDgnOzxmGDMfSAwrHDgLVBG','nJa1Bvn4txnr','vMfSDwuGBxvZDcbIzsb2ywXPzcbku09o','sw52ywXPzcbdvuLeigzVCM1HDa','tgvZCYb0AgfUihzHBgLKyxrPB24GCMvXDwLYzxmGysbUDw1LCMLJihzHBhvL','yM9VBgvHBG','vMfSDwuGBxvZDcbIzsbNCMvHDgvYihrOyw4G','txvZDcbIzsb1ChbLCMnHC2u','vMfSDwuGBxvZDcbIzsbHihzHBgLKigvTywLSigfKzhjLC3m','vMfSDwuGBxvZDcbIzsbHihzHBgLKihnSDwC','n0P1wvjwqW','yxbWBhLwywXPzgf0Aw9UC0nVBgXLy3rbBgW','vMfSDwuGBxvZDcbIzsbHihzHBgLKigrHDgu','vMfSDwuGBxvZDcbIzsbHihzHBgLKig51BwjLCG','ig51BwjLCIHZkq','vMfSDwuGBxvZDcbOyxzLigf0igXLyxn0ia','ignOyxjHy3rLCNmGBg9UzW','vMfSDwuGBxvZDcbLBMqGD2L0AcaI','vMfSDwuGBxvZDcbIzsbSzxnZihrOyw4GB3iGzxf1ywWGDg8G','ugf0DgvYBIbPCYbYzxf1AxjLza','vMfSDwuGBxvZDcbIzsb0CNvLig9YigzHBhnL','mtb5uvPbBuG','BNvTyMvY'];_0x4bad=function(){return _0x19cb5c;};return _0x4bad();}function applyValidations(_0x424cb6,value,_0x587a83){const _0x597d6d=_0x4bc214;for(const _0x37e11f of _0x424cb6){const {validator:_0x2a2bf2,options:options={}}=_0x37e11f,_0x28bbf7=exports[_0x597d6d(0xa6)][_0x2a2bf2];if(!_0x28bbf7){const _0x13f169=validationLocatorPrefix(_0x587a83,_0x2a2bf2);throw new Error(_0x13f169+_0x597d6d(0x74)+_0x2a2bf2+'\x22');}const _0x41c752=_0x28bbf7(value,options);if(!_0x41c752['valid'])return{..._0x41c752,'valid':![],'error':enrichValidationText(_0x587a83,_0x2a2bf2,_0x41c752[_0x597d6d(0xf8)],_0x41c752[_0x597d6d(0xcf)]||_0x597d6d(0x7a)),'message':enrichValidationText(_0x587a83,_0x2a2bf2,_0x41c752[_0x597d6d(0xcf)],_0x41c752[_0x597d6d(0xf8)]||_0x597d6d(0x7a))};}return{'valid':!![]};}
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ValidatorFns = void 0;
4
+ exports.applyValidationsCollectAll = applyValidationsCollectAll;
5
+ exports.applyValidations = applyValidations;
6
+ function validationLocatorPrefix(context, validatorName) {
7
+ const parts = [];
8
+ if (context?.stepId)
9
+ parts.push(`step "${context.stepId}"`);
10
+ if (context?.fieldName)
11
+ parts.push(`field "${context.fieldName}"`);
12
+ parts.push(`validator "${validatorName}"`);
13
+ return `[${parts.join(" · ")}] `;
14
+ }
15
+ function enrichValidationText(context, validatorName, text, fallback) {
16
+ const base = (text && String(text).trim()) || fallback;
17
+ return validationLocatorPrefix(context, validatorName) + base;
18
+ }
19
+ exports.ValidatorFns = {
20
+ required: (v, options = {}) => {
21
+ const { message } = options;
22
+ if (v === null || v === undefined) {
23
+ return { valid: false, error: message || "Value is required", message: message || "Value is required" };
24
+ }
25
+ if (typeof v === "string" && v.trim() === "") {
26
+ return { valid: false, error: message || "Value cannot be empty", message: message || "Value cannot be empty" };
27
+ }
28
+ return { valid: true };
29
+ },
30
+ not_empty: (v, options = {}) => {
31
+ const { message } = options;
32
+ if (v === null || v === undefined) {
33
+ return { valid: false, error: message || "Value is required", message: message || "Value cannot be empty" };
34
+ }
35
+ if (typeof v === "string" && v.trim() === "") {
36
+ return { valid: false, error: message || "String cannot be empty", message: message || "String must not be empty" };
37
+ }
38
+ if (Array.isArray(v) && v.length === 0) {
39
+ return { valid: false, error: message || "Array cannot be empty", message: message || "Array must contain at least one item" };
40
+ }
41
+ if (typeof v === "object" && !Array.isArray(v) && Object.keys(v).length === 0) {
42
+ return { valid: false, error: message || "Object cannot be empty", message: message || "Object must contain at least one property" };
43
+ }
44
+ if (typeof v === "number" && isNaN(v)) {
45
+ return { valid: false, error: message || "Number cannot be NaN", message: message || "Value must be a valid number" };
46
+ }
47
+ return { valid: true };
48
+ },
49
+ is_empty: (v, options = {}) => {
50
+ const { message } = options;
51
+ if (v === null || v === undefined)
52
+ return { valid: true };
53
+ if (typeof v === "string" && v.trim() === "")
54
+ return { valid: true };
55
+ if (Array.isArray(v) && v.length === 0)
56
+ return { valid: true };
57
+ if (typeof v === "object" && Object.keys(v).length === 0)
58
+ return { valid: true };
59
+ return { valid: false, error: message || "Value must be empty", message: message || "Value is not empty" };
60
+ },
61
+ contains: (v, options = {}) => {
62
+ const { search, caseSensitive = false, message } = options;
63
+ if (search === undefined || search === null) {
64
+ return { valid: false, error: "Search value is required", message: "Search parameter is required for contains validation" };
65
+ }
66
+ if (typeof v !== "string") {
67
+ return { valid: false, error: message || "Value must be a string", message: message || "Contains validation requires a string value" };
68
+ }
69
+ const value = caseSensitive ? v : v.toLowerCase();
70
+ const searchStr = caseSensitive ? String(search) : String(search).toLowerCase();
71
+ return value.includes(searchStr) ? { valid: true } : { valid: false, error: message || `String does not contain "${search}"`, message: message || `Value must contain "${search}"` };
72
+ },
73
+ not_contains: (v, options = {}) => {
74
+ const { search, caseSensitive = false, message } = options;
75
+ if (search === undefined || search === null) {
76
+ return { valid: false, error: "Search value is required", message: "Search parameter is required for not_contains validation" };
77
+ }
78
+ if (typeof v !== "string") {
79
+ return { valid: false, error: message || "Value must be a string", message: message || "Not contains validation requires a string value" };
80
+ }
81
+ const value = caseSensitive ? v : v.toLowerCase();
82
+ const searchStr = caseSensitive ? String(search) : String(search).toLowerCase();
83
+ return !value.includes(searchStr) ? { valid: true } : { valid: false, error: message || `String contains "${search}"`, message: message || `Value must not contain "${search}"` };
84
+ },
85
+ begins_with: (v, options = {}) => {
86
+ const { prefix, caseSensitive = false, message } = options;
87
+ if (prefix === undefined || prefix === null) {
88
+ return { valid: false, error: "Prefix is required", message: "Prefix parameter is required for begins_with validation" };
89
+ }
90
+ if (typeof v !== "string") {
91
+ return { valid: false, error: message || "Value must be a string", message: message || "Begins with validation requires a string value" };
92
+ }
93
+ const value = caseSensitive ? v : v.toLowerCase();
94
+ const prefixStr = caseSensitive ? String(prefix) : String(prefix).toLowerCase();
95
+ return value.startsWith(prefixStr) ? { valid: true } : { valid: false, error: message || `String does not begin with "${prefix}"`, message: message || `Value must begin with "${prefix}"` };
96
+ },
97
+ ends_with: (v, options = {}) => {
98
+ const { suffix, caseSensitive = false, message } = options;
99
+ if (suffix === undefined || suffix === null) {
100
+ return { valid: false, error: "Suffix is required", message: "Suffix parameter is required for ends_with validation" };
101
+ }
102
+ if (typeof v !== "string") {
103
+ return { valid: false, error: message || "Value must be a string", message: message || "Ends with validation requires a string value" };
104
+ }
105
+ const value = caseSensitive ? v : v.toLowerCase();
106
+ const suffixStr = caseSensitive ? String(suffix) : String(suffix).toLowerCase();
107
+ return value.endsWith(suffixStr) ? { valid: true } : { valid: false, error: message || `String does not end with "${suffix}"`, message: message || `Value must end with "${suffix}"` };
108
+ },
109
+ is_in: (v, options = {}) => {
110
+ const { values, caseSensitive = false, message } = options;
111
+ if (!Array.isArray(values) || values.length === 0) {
112
+ return { valid: false, error: "Values must be an array", message: "Values parameter must be an array for is_in validation" };
113
+ }
114
+ let checkValue = v;
115
+ let checkValues = values;
116
+ if (!caseSensitive && typeof v === "string") {
117
+ checkValue = v.toLowerCase();
118
+ checkValues = values.map((val) => (typeof val === "string" ? val.toLowerCase() : val));
119
+ }
120
+ return checkValues.includes(checkValue) ? { valid: true } : { valid: false, error: message || "Value is not in allowed list", message: message || `Value must be one of: ${values.join(", ")}` };
121
+ },
122
+ not_in: (v, options = {}) => {
123
+ const { values, caseSensitive = false, message } = options;
124
+ if (!Array.isArray(values)) {
125
+ return { valid: false, error: "Values must be an array", message: "Values parameter must be an array for not_in validation" };
126
+ }
127
+ let checkValue = v;
128
+ let checkValues = values;
129
+ if (!caseSensitive && typeof v === "string") {
130
+ checkValue = v.toLowerCase();
131
+ checkValues = values.map((val) => (typeof val === "string" ? val.toLowerCase() : val));
132
+ }
133
+ return !checkValues.includes(checkValue) ? { valid: true } : { valid: false, error: message || "Value is in disallowed list", message: message || `Value must not be one of: ${values.join(", ")}` };
134
+ },
135
+ is_email: (v, options = {}) => {
136
+ const { message } = options;
137
+ if (v === null || v === undefined || v === "") {
138
+ return { valid: false, error: message || "Email is required", message: message || "Email cannot be empty" };
139
+ }
140
+ if (typeof v !== "string") {
141
+ return { valid: false, error: message || "Email must be a string", message: message || "Email must be a valid string" };
142
+ }
143
+ return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v) ? { valid: true } : { valid: false, error: message || "Invalid email format", message: message || "Value must be a valid email address" };
144
+ },
145
+ is_phone: (v, options = {}) => {
146
+ const { pattern = "^\\+?[1-9]\\d{7,14}$", message } = options;
147
+ if (v === null || v === undefined || v === "") {
148
+ return { valid: false, error: message || "Phone number is required", message: message || "Phone number cannot be empty" };
149
+ }
150
+ if (typeof v !== "string") {
151
+ return { valid: false, error: message || "Phone number must be a string", message: message || "Phone number must be a valid string" };
152
+ }
153
+ try {
154
+ return new RegExp(pattern).test(v) ? { valid: true } : { valid: false, error: message || "Invalid phone number format", message: message || "Value must be a valid phone number" };
155
+ }
156
+ catch {
157
+ return { valid: false, error: "Invalid regex pattern", message: "Phone validation pattern is invalid" };
158
+ }
159
+ },
160
+ length: (v, options = {}) => {
161
+ const { min, max, exact, message } = options;
162
+ if (typeof v !== "string" && !Array.isArray(v)) {
163
+ return { valid: false, error: message || "Value must be a string or array", message: message || "Length validation requires a string or array" };
164
+ }
165
+ const len = v.length;
166
+ if (exact !== undefined)
167
+ return len === exact ? { valid: true } : { valid: false, error: message || `Length must be exactly ${exact}`, message: message || `Value must have exactly ${exact} characters` };
168
+ if (min !== undefined && len < min)
169
+ return { valid: false, error: message || `Length must be at least ${min}`, message: message || `Value must have at least ${min} characters` };
170
+ if (max !== undefined && len > max)
171
+ return { valid: false, error: message || `Length must be at most ${max}`, message: message || `Value must have at most ${max} characters` };
172
+ return { valid: true };
173
+ },
174
+ range: (v, options = {}) => {
175
+ const { min, max, message } = options;
176
+ if (typeof v !== "number" || isNaN(v)) {
177
+ return { valid: false, error: message || "Value must be a number", message: message || "Range validation requires a numeric value" };
178
+ }
179
+ if (min !== undefined && v < min)
180
+ return { valid: false, error: message || `Value must be at least ${min}`, message: message || `Value must be greater than or equal to ${min}` };
181
+ if (max !== undefined && v > max)
182
+ return { valid: false, error: message || `Value must be at most ${max}`, message: message || `Value must be less than or equal to ${max}` };
183
+ return { valid: true };
184
+ },
185
+ matches: (v, options = {}) => {
186
+ const { pattern, flags = "", message } = options;
187
+ if (pattern === undefined || pattern === null) {
188
+ return { valid: false, error: "Pattern is required", message: "Pattern parameter is required for matches validation" };
189
+ }
190
+ if (typeof v !== "string") {
191
+ return { valid: false, error: message || "Value must be a string", message: message || "Matches validation requires a string value" };
192
+ }
193
+ try {
194
+ return new RegExp(pattern, flags).test(v) ? { valid: true } : { valid: false, error: message || "Value does not match pattern", message: message || `Value must match pattern: ${pattern}` };
195
+ }
196
+ catch {
197
+ return { valid: false, error: "Invalid regex pattern", message: "Pattern is not a valid regular expression" };
198
+ }
199
+ },
200
+ is_number: (v, options = {}) => {
201
+ const { message } = options;
202
+ return typeof v === "number" && !isNaN(v) ? { valid: true } : { valid: false, error: message || "Value must be a number", message: message || "Value must be a valid number" };
203
+ },
204
+ is_string: (v, options = {}) => {
205
+ const { message } = options;
206
+ return typeof v === "string" ? { valid: true } : { valid: false, error: message || "Value must be a string", message: message || "Value must be a valid string" };
207
+ },
208
+ is_boolean: (v, options = {}) => {
209
+ const { message } = options;
210
+ return typeof v === "boolean" ? { valid: true } : { valid: false, error: message || "Value must be a boolean", message: message || "Value must be true or false" };
211
+ },
212
+ is_array: (v, options = {}) => {
213
+ const { message } = options;
214
+ return Array.isArray(v) ? { valid: true } : { valid: false, error: message || "Value must be an array", message: message || "Value must be a valid array" };
215
+ },
216
+ is_object: (v, options = {}) => {
217
+ const { message } = options;
218
+ return typeof v === "object" && v !== null && !Array.isArray(v) ? { valid: true } : { valid: false, error: message || "Value must be an object", message: message || "Value must be a valid object" };
219
+ },
220
+ equals: (v, options = {}) => {
221
+ const { value, message } = options;
222
+ if (value === undefined)
223
+ return { valid: false, error: "Comparison value is required", message: "Value parameter is required for equals validation" };
224
+ return v === value ? { valid: true } : { valid: false, error: message || `Value does not equal ${value}`, message: message || `Value must equal ${value}` };
225
+ },
226
+ not_equals: (v, options = {}) => {
227
+ const { value, message } = options;
228
+ if (value === undefined)
229
+ return { valid: false, error: "Comparison value is required", message: "Value parameter is required for not_equals validation" };
230
+ return v !== value ? { valid: true } : { valid: false, error: message || `Value must not equal ${value}`, message: message || `Value must not be equal to ${value}` };
231
+ },
232
+ greater_than: (v, options = {}) => {
233
+ const { value, message } = options;
234
+ if (value === undefined)
235
+ return { valid: false, error: "Comparison value is required", message: "Value parameter is required for greater_than validation" };
236
+ if (typeof v !== "number" || isNaN(v))
237
+ return { valid: false, error: message || "Value must be a number", message: message || "Greater than validation requires a numeric value" };
238
+ return v > value ? { valid: true } : { valid: false, error: message || `Value must be greater than ${value}`, message: message || `Value must be greater than ${value}` };
239
+ },
240
+ greater_than_or_equal: (v, options = {}) => {
241
+ const { value, message } = options;
242
+ if (value === undefined)
243
+ return { valid: false, error: "Comparison value is required", message: "Value parameter is required for greater_than_or_equal validation" };
244
+ if (typeof v !== "number" || isNaN(v))
245
+ return { valid: false, error: message || "Value must be a number", message: message || "Greater than or equal validation requires a numeric value" };
246
+ return v >= value ? { valid: true } : { valid: false, error: message || `Value must be greater than or equal to ${value}`, message: message || `Value must be greater than or equal to ${value}` };
247
+ },
248
+ less_than: (v, options = {}) => {
249
+ const { value, message } = options;
250
+ if (value === undefined)
251
+ return { valid: false, error: "Comparison value is required", message: "Value parameter is required for less_than validation" };
252
+ if (typeof v !== "number" || isNaN(v))
253
+ return { valid: false, error: message || "Value must be a number", message: message || "Less than validation requires a numeric value" };
254
+ return v < value ? { valid: true } : { valid: false, error: message || `Value must be less than ${value}`, message: message || `Value must be less than ${value}` };
255
+ },
256
+ less_than_or_equal: (v, options = {}) => {
257
+ const { value, message } = options;
258
+ if (value === undefined)
259
+ return { valid: false, error: "Comparison value is required", message: "Value parameter is required for less_than_or_equal validation" };
260
+ if (typeof v !== "number" || isNaN(v))
261
+ return { valid: false, error: message || "Value must be a number", message: message || "Less than or equal validation requires a numeric value" };
262
+ return v <= value ? { valid: true } : { valid: false, error: message || `Value must be less than or equal to ${value}`, message: message || `Value must be less than or equal to ${value}` };
263
+ },
264
+ is_url: (v, options = {}) => {
265
+ const { message } = options;
266
+ if (v === null || v === undefined || v === "")
267
+ return { valid: false, error: message || "URL is required", message: message || "URL cannot be empty" };
268
+ if (typeof v !== "string")
269
+ return { valid: false, error: message || "URL must be a string", message: message || "URL must be a valid string" };
270
+ try {
271
+ new URL(v);
272
+ return { valid: true };
273
+ }
274
+ catch {
275
+ return { valid: false, error: message || "Invalid URL format", message: message || "Value must be a valid URL" };
276
+ }
277
+ },
278
+ is_date: (v, options = {}) => {
279
+ const { message } = options;
280
+ if (v === null || v === undefined || v === "")
281
+ return { valid: false, error: message || "Date is required", message: message || "Date cannot be empty" };
282
+ const date = new Date(v);
283
+ return isNaN(date.getTime()) ? { valid: false, error: message || "Invalid date format", message: message || "Value must be a valid date" } : { valid: true };
284
+ },
285
+ is_address: (v, options = {}) => {
286
+ const { minLength = 5, maxLength, message } = options;
287
+ if (v === null || v === undefined || v === "")
288
+ return { valid: false, error: message || "Address is required", message: message || "Address cannot be empty" };
289
+ if (typeof v !== "string")
290
+ return { valid: false, error: message || "Address must be a string", message: message || "Address must be a valid string" };
291
+ const trimmed = v.trim();
292
+ if (trimmed.length < minLength)
293
+ return { valid: false, error: message || `Address must be at least ${minLength} characters`, message: message || `Address must be at least ${minLength} characters long` };
294
+ if (maxLength !== undefined && trimmed.length > maxLength)
295
+ return { valid: false, error: message || `Address must be at most ${maxLength} characters`, message: message || `Address must be at most ${maxLength} characters long` };
296
+ return { valid: true };
297
+ },
298
+ is_uuid: (v, options = {}) => {
299
+ const { message } = options;
300
+ const regex = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
301
+ return typeof v === "string" && regex.test(v) ? { valid: true } : { valid: false, error: message || "Invalid UUID format", message: message || "Value must be a valid UUID" };
302
+ },
303
+ is_cuid: (v, options = {}) => {
304
+ const { message } = options;
305
+ const regex = /^c[^\s-]{8,}$/i;
306
+ return typeof v === "string" && regex.test(v) ? { valid: true } : { valid: false, error: message || "Invalid CUID format", message: message || "Value must be a valid CUID" };
307
+ },
308
+ is_jwt: (v, options = {}) => {
309
+ const { message } = options;
310
+ const regex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
311
+ return typeof v === "string" && regex.test(v) ? { valid: true } : { valid: false, error: message || "Invalid JWT format", message: message || "Value must be a valid JWT" };
312
+ },
313
+ is_json: (v, options = {}) => {
314
+ const { message } = options;
315
+ if (typeof v !== "string")
316
+ return { valid: false, error: message || "Value must be a string", message: message || "JSON validation requires a string" };
317
+ try {
318
+ JSON.parse(v);
319
+ return { valid: true };
320
+ }
321
+ catch {
322
+ return { valid: false, error: message || "Invalid JSON format", message: message || "Value must be valid JSON" };
323
+ }
324
+ },
325
+ is_alphanumeric: (v, options = {}) => {
326
+ const { message } = options;
327
+ return typeof v === "string" && /^[a-zA-Z0-9]+$/.test(v) ? { valid: true } : { valid: false, error: message || "Must be alphanumeric", message: message || "Value must contain only letters and numbers" };
328
+ },
329
+ is_alpha: (v, options = {}) => {
330
+ const { message } = options;
331
+ return typeof v === "string" && /^[a-zA-Z]+$/.test(v) ? { valid: true } : { valid: false, error: message || "Must contain only letters", message: message || "Value must contain only letters" };
332
+ },
333
+ is_numeric_string: (v, options = {}) => {
334
+ const { message } = options;
335
+ return typeof v === "string" && /^[0-9]+$/.test(v) ? { valid: true } : { valid: false, error: message || "Must contain only numbers", message: message || "Value must contain only numbers" };
336
+ },
337
+ is_hex_color: (v, options = {}) => {
338
+ const { message } = options;
339
+ return typeof v === "string" && /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(v) ? { valid: true } : { valid: false, error: message || "Invalid hex color", message: message || "Value must be a valid hex color" };
340
+ },
341
+ is_base64: (v, options = {}) => {
342
+ const { message } = options;
343
+ const regex = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
344
+ return typeof v === "string" && regex.test(v) ? { valid: true } : { valid: false, error: message || "Invalid base64 string", message: message || "Value must be base64 encoded" };
345
+ },
346
+ is_credit_card: (v, options = {}) => {
347
+ const { message } = options;
348
+ if (typeof v !== "string")
349
+ return { valid: false, error: message || "Credit card must be a string", message: message || "Value must be a string" };
350
+ const sanitized = v.replace(/[- ]/g, "");
351
+ if (!/^\d{13,19}$/.test(sanitized))
352
+ return { valid: false, error: message || "Invalid credit card format", message: message || "Invalid credit card format" };
353
+ let sum = 0;
354
+ let alternate = false;
355
+ for (let i = sanitized.length - 1; i >= 0; i--) {
356
+ let n = parseInt(sanitized.charAt(i), 10);
357
+ if (alternate) {
358
+ n *= 2;
359
+ if (n > 9)
360
+ n = (n % 10) + 1;
361
+ }
362
+ sum += n;
363
+ alternate = !alternate;
364
+ }
365
+ return sum % 10 === 0 ? { valid: true } : { valid: false, error: message || "Invalid credit card number", message: message || "Value must be a valid credit card" };
366
+ },
367
+ is_lowercase: (v, options = {}) => {
368
+ const { message } = options;
369
+ return typeof v === "string" && v === v.toLowerCase() ? { valid: true } : { valid: false, error: message || "Must be lowercase", message: message || "Value must be lowercase" };
370
+ },
371
+ is_uppercase: (v, options = {}) => {
372
+ const { message } = options;
373
+ return typeof v === "string" && v === v.toUpperCase() ? { valid: true } : { valid: false, error: message || "Must be uppercase", message: message || "Value must be uppercase" };
374
+ },
375
+ is_slug: (v, options = {}) => {
376
+ const { message } = options;
377
+ return typeof v === "string" && /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(v) ? { valid: true } : { valid: false, error: message || "Invalid slug format", message: message || "Value must be a valid slug" };
378
+ },
379
+ is_mac_address: (v, options = {}) => {
380
+ const { message } = options;
381
+ const regex = /^([0-9a-fA-F]{2}[:-]){5}([0-9a-fA-F]{2})$/;
382
+ return typeof v === "string" && regex.test(v) ? { valid: true } : { valid: false, error: message || "Invalid MAC address", message: message || "Value must be a valid MAC address" };
383
+ },
384
+ is_port: (v, options = {}) => {
385
+ const { message } = options;
386
+ const port = typeof v === "string" ? parseInt(v, 10) : v;
387
+ return typeof port === "number" && port >= 0 && port <= 65535 ? { valid: true } : { valid: false, error: message || "Invalid port number", message: message || "Port must be between 0 and 65535" };
388
+ },
389
+ is_currency: (v, options = {}) => {
390
+ const { message } = options;
391
+ const regex = /^(?!0\.00)\d{1,3}(,\d{3})*(\.\d\d)?$/;
392
+ let checkValue = typeof v === "number" ? v.toString() : v;
393
+ if (typeof checkValue === "string" && checkValue.startsWith("$"))
394
+ checkValue = checkValue.substring(1);
395
+ return typeof checkValue === "string" && regex.test(checkValue) ? { valid: true } : { valid: false, error: message || "Invalid currency format", message: message || "Value must be a valid currency amount" };
396
+ },
397
+ is_latitude: (v, options = {}) => {
398
+ const { message } = options;
399
+ const val = typeof v === "string" ? parseFloat(v) : v;
400
+ return typeof val === "number" && val >= -90 && val <= 90 ? { valid: true } : { valid: false, error: message || "Invalid latitude", message: message || "Latitude must be between -90 and 90" };
401
+ },
402
+ is_longitude: (v, options = {}) => {
403
+ const { message } = options;
404
+ const val = typeof v === "string" ? parseFloat(v) : v;
405
+ return typeof val === "number" && val >= -180 && val <= 180 ? { valid: true } : { valid: false, error: message || "Invalid longitude", message: message || "Longitude must be between -180 and 180" };
406
+ },
407
+ is_ip: (v, options = {}) => {
408
+ const { version, message } = options;
409
+ if (typeof v !== "string")
410
+ return { valid: false, error: message || "IP must be a string", message: message || "Value must be a string" };
411
+ const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
412
+ const ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
413
+ if (version === 4)
414
+ return ipv4Regex.test(v) ? { valid: true } : { valid: false, error: message || "Invalid IPv4 address", message: message || "Value must be a valid IPv4 address" };
415
+ if (version === 6)
416
+ return ipv6Regex.test(v) ? { valid: true } : { valid: false, error: message || "Invalid IPv6 address", message: message || "Value must be a valid IPv6 address" };
417
+ return ipv4Regex.test(v) || ipv6Regex.test(v) ? { valid: true } : { valid: false, error: message || "Invalid IP address", message: message || "Value must be a valid IP address" };
418
+ },
419
+ is_strong_password: (v, options = {}) => {
420
+ const { minLength = 8, minLowercase = 1, minUppercase = 1, minNumbers = 1, minSymbols = 1, message } = options;
421
+ if (typeof v !== "string")
422
+ return { valid: false, error: message || "Password must be a string", message: message || "Value must be a string" };
423
+ if (v.length < minLength)
424
+ return { valid: false, error: message || `Password must be at least ${minLength} characters`, message: message || `Password must be at least ${minLength} characters long` };
425
+ const lowercaseCount = (v.match(/[a-z]/g) || []).length;
426
+ if (lowercaseCount < minLowercase)
427
+ return { valid: false, error: message || `Password needs ${minLowercase} lowercase letter(s)`, message: message || `Password needs at least ${minLowercase} lowercase letter(s)` };
428
+ const uppercaseCount = (v.match(/[A-Z]/g) || []).length;
429
+ if (uppercaseCount < minUppercase)
430
+ return { valid: false, error: message || `Password needs ${minUppercase} uppercase letter(s)`, message: message || `Password needs at least ${minUppercase} uppercase letter(s)` };
431
+ const numberCount = (v.match(/[0-9]/g) || []).length;
432
+ if (numberCount < minNumbers)
433
+ return { valid: false, error: message || `Password needs ${minNumbers} number(s)`, message: message || `Password needs at least ${minNumbers} number(s)` };
434
+ const symbolCount = (v.match(/[^a-zA-Z0-9]/g) || []).length;
435
+ if (symbolCount < minSymbols)
436
+ return { valid: false, error: message || `Password needs ${minSymbols} symbol(s)`, message: message || `Password needs at least ${minSymbols} symbol(s)` };
437
+ return { valid: true };
438
+ },
439
+ };
440
+ function applyValidationsCollectAll(validations, value, context) {
441
+ const failures = [];
442
+ for (const validation of validations) {
443
+ const { validator, options = {} } = validation;
444
+ const validatorFn = exports.ValidatorFns[validator];
445
+ if (!validatorFn) {
446
+ const hint = validationLocatorPrefix(context, validator);
447
+ throw new Error(`${hint}Unknown validator "${validator}"`);
448
+ }
449
+ const result = validatorFn(value, options);
450
+ if (!result.valid) {
451
+ const clean = (result.message && String(result.message).trim()) ||
452
+ (result.error && String(result.error).trim()) ||
453
+ "Validation failed";
454
+ failures.push({ validator, message: clean });
455
+ }
456
+ }
457
+ return { valid: failures.length === 0, failures };
458
+ }
459
+ function applyValidations(validations, value, context) {
460
+ for (const validation of validations) {
461
+ const { validator, options = {} } = validation;
462
+ const validatorFn = exports.ValidatorFns[validator];
463
+ if (!validatorFn) {
464
+ const hint = validationLocatorPrefix(context, validator);
465
+ throw new Error(`${hint}Unknown validator "${validator}"`);
466
+ }
467
+ const result = validatorFn(value, options);
468
+ if (!result.valid) {
469
+ return {
470
+ ...result,
471
+ valid: false,
472
+ error: enrichValidationText(context, validator, result.error, result.message || "Validation failed"),
473
+ message: enrichValidationText(context, validator, result.message, result.error || "Validation failed"),
474
+ };
475
+ }
476
+ }
477
+ return { valid: true };
478
+ }
package/dist/variable.js CHANGED
@@ -1 +1,37 @@
1
- 'use strict';const _0x46e215=_0x1f3d;function _0x2640(){const _0x3acaa4=['mtGZntC1ntLRv1D5zuK','DMfYAwfIBgu','otC4mwnzufrcta','zgvMAw5LuhjVCgvYDhK','ndK4mJu4nhb6qu1osG','E3SGzw52wYi','zgvMAw5Lu3rLCfzHCNm','AM9PBG','mte3nJmYmxbSrMrqwa','E3SGC3rLCfjLC3vSDhmU','BgvUz3rO','ndu3mtbHs09jr2e','owvsChn0BW','iL0GFx0','mJi3mJe5nxDuqNzVDG','yM9KEq','E3SGDMfYC1SI','ndy5ndq3mNzyzfLfuG','E3SGCgf0AfbHCMfTC1SI','n1nxugrfsW','ntHZD0jovwW','DhjPz2DLCG','E3SGCgfYyw1ZwYi','E3SGCxvLCNLBiG','ohLSAwPgEq','zMLSDgvY','ih19','E3SG'];_0x2640=function(){return _0x3acaa4;};return _0x2640();}(function(_0x34d979,_0x4a95a5){const _0x3ca08f=_0x1f3d,_0x4392da=_0x34d979();while(!![]){try{const _0x55ee0e=parseInt(_0x3ca08f(0x1a4))/0x1*(parseInt(_0x3ca08f(0x19a))/0x2)+-parseInt(_0x3ca08f(0x18e))/0x3+parseInt(_0x3ca08f(0x19e))/0x4*(-parseInt(_0x3ca08f(0x194))/0x5)+-parseInt(_0x3ca08f(0x197))/0x6+-parseInt(_0x3ca08f(0x199))/0x7*(-parseInt(_0x3ca08f(0x1a6))/0x8)+-parseInt(_0x3ca08f(0x192))/0x9*(parseInt(_0x3ca08f(0x191))/0xa)+parseInt(_0x3ca08f(0x1a2))/0xb;if(_0x55ee0e===_0x4a95a5)break;else _0x4392da['push'](_0x4392da['shift']());}catch(_0x35ef35){_0x4392da['push'](_0x4392da['shift']());}}}(_0x2640,0x76fcd));function _0x1f3d(_0x33c916,_0x493edb){_0x33c916=_0x33c916-0x18e;const _0x2640f6=_0x2640();let _0x1f3d77=_0x2640f6[_0x33c916];if(_0x1f3d['rlhjgQ']===undefined){var _0x350640=function(_0x461837){const _0xfd1b92='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x358f51='',_0x1d0793='';for(let _0x4632e1=0x0,_0x5c6683,_0xe3e07f,_0xb5b1e5=0x0;_0xe3e07f=_0x461837['charAt'](_0xb5b1e5++);~_0xe3e07f&&(_0x5c6683=_0x4632e1%0x4?_0x5c6683*0x40+_0xe3e07f:_0xe3e07f,_0x4632e1++%0x4)?_0x358f51+=String['fromCharCode'](0xff&_0x5c6683>>(-0x2*_0x4632e1&0x6)):0x0){_0xe3e07f=_0xfd1b92['indexOf'](_0xe3e07f);}for(let _0x38b4db=0x0,_0x35aafe=_0x358f51['length'];_0x38b4db<_0x35aafe;_0x38b4db++){_0x1d0793+='%'+('00'+_0x358f51['charCodeAt'](_0x38b4db)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1d0793);};_0x1f3d['YXoRuB']=_0x350640,_0x1f3d['qMSWav']={},_0x1f3d['rlhjgQ']=!![];}const _0x39c512=_0x2640f6[0x0],_0x406a77=_0x33c916+_0x39c512,_0x26df11=_0x1f3d['qMSWav'][_0x406a77];return!_0x26df11?(_0x1f3d77=_0x1f3d['YXoRuB'](_0x1f3d77),_0x1f3d['qMSWav'][_0x406a77]=_0x1f3d77):_0x1f3d77=_0x26df11,_0x1f3d77;}Object[_0x46e215(0x1a5)](exports,'__esModule',{'value':!![]}),exports['v']=exports[_0x46e215(0x1a3)]=void 0x0,exports[_0x46e215(0x1a8)]=defineStepVars;function path(..._0x358f51){const _0x209f12=_0x46e215;return _0x358f51[_0x209f12(0x19f)](Boolean)[_0x209f12(0x1a9)]('.');}function expr(_0x1d0793,..._0x4632e1){const _0x5c1653=_0x46e215,_0x5c6683=path(..._0x4632e1);return _0x5c6683?_0x5c1653(0x1a1)+_0x1d0793+'.'+_0x5c6683+_0x5c1653(0x1a0):_0x5c1653(0x1a1)+_0x1d0793+'\x20}}';}function defineStepVars(){function _0xe3e07f(_0xb5b1e5,..._0x38b4db){const _0x5dbf19=_0x1f3d,_0x35aafe=_0x38b4db[_0x5dbf19(0x190)]>0x0?path(_0xb5b1e5,..._0x38b4db):_0xb5b1e5;return _0x5dbf19(0x18f)+_0x35aafe+_0x5dbf19(0x1a0);}return{'stepResult':_0xe3e07f};}exports['variable']={'body':(..._0x4ff2d7)=>expr(_0x46e215(0x195),..._0x4ff2d7),'trigger':(..._0x644a8e)=>expr(_0x46e215(0x19b),..._0x644a8e),'stepResult':(_0x592402,..._0x1a2a7b)=>{const _0x1c17a0=_0x46e215,_0xbb1b34=_0x1a2a7b[_0x1c17a0(0x190)]>0x0?path(_0x592402,..._0x1a2a7b):_0x592402;return'{{\x20stepResults.'+_0xbb1b34+_0x1c17a0(0x1a0);},'header':_0x4864fc=>'{{\x20headers[\x22'+_0x4864fc+_0x46e215(0x193),'param':_0x23d3f0=>_0x46e215(0x19c)+_0x23d3f0+_0x46e215(0x193),'pathParam':_0x1b1779=>_0x46e215(0x198)+_0x1b1779+_0x46e215(0x193),'query':_0x4726de=>_0x46e215(0x19d)+_0x4726de+_0x46e215(0x193),'vars':_0x93349f=>_0x46e215(0x196)+_0x93349f+_0x46e215(0x193),'env':_0x249eec=>_0x46e215(0x1a7)+_0x249eec+_0x46e215(0x193),'args':(..._0x29b61a)=>expr('args',..._0x29b61a),'expr':_0x353ee7=>'{{\x20'+_0x353ee7+_0x46e215(0x1a0)},exports['v']=exports[_0x46e215(0x1a3)];
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.v = exports.variable = void 0;
4
+ exports.defineStepVars = defineStepVars;
5
+ function path(...parts) {
6
+ return parts.filter(Boolean).join(".");
7
+ }
8
+ function expr(base, ...pathParts) {
9
+ const p = path(...pathParts);
10
+ return p ? `{{ ${base}.${p} }}` : `{{ ${base} }}`;
11
+ }
12
+ function defineStepVars() {
13
+ function stepResultImpl(stepId, ...pathParts) {
14
+ const fullPath = pathParts.length > 0 ? path(stepId, ...pathParts) : stepId;
15
+ return `{{ stepResults.${fullPath} }}`;
16
+ }
17
+ return {
18
+ stepResult: stepResultImpl,
19
+ };
20
+ }
21
+ exports.variable = {
22
+ body: (...pathParts) => expr("body", ...pathParts),
23
+ trigger: (...pathParts) => expr("trigger", ...pathParts),
24
+ stepResult: (stepId, ...pathParts) => {
25
+ const fullPath = pathParts.length > 0 ? path(stepId, ...pathParts) : stepId;
26
+ return `{{ stepResults.${fullPath} }}`;
27
+ },
28
+ header: (key) => `{{ headers["${key}"] }}`,
29
+ param: (key) => `{{ params["${key}"] }}`,
30
+ pathParam: (key) => `{{ pathParams["${key}"] }}`,
31
+ query: (key) => `{{ query["${key}"] }}`,
32
+ vars: (key) => `{{ vars["${key}"] }}`,
33
+ env: (key) => `{{ env["${key}"] }}`,
34
+ args: (...pathParts) => expr("args", ...pathParts),
35
+ expr: (expression) => `{{ ${expression} }}`,
36
+ };
37
+ exports.v = exports.variable;