@onylab/common-api 2.1.22 → 2.1.23
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-api.node.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAA2B,kBAAID,IAE/BD,EAAwB,kBAAIC,GAC7B,CATD,CASGK,OAAQ,I,yzLCRPC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaR,QAGrB,IAAIC,EAASI,EAAyBE,GAAY,CAGjDP,QAAS,CAAC,GAOX,OAHAU,EAAoBH,GAAUN,EAAQA,EAAOD,QAASM,GAG/CL,EAAOD,OACf,CCrBAM,EAAoBK,EAAKV,IACxB,IAAIW,EAASX,GAAUA,EAAOY,WAC7B,IAAOZ,EAAiB,QACxB,IAAM,EAEP,OADAK,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRN,EAAoBQ,EAAI,CAACd,EAASgB,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAElB,EAASiB,IAC5EE,OAAOC,eAAepB,EAASiB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EX,EAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFlB,EAAoBsB,EAAK5B,IACH,oBAAX6B,QAA0BA,OAAOC,aAC1CX,OAAOC,eAAepB,EAAS6B,OAAOC,YAAa,CAAEC,MAAO,WAE7DZ,OAAOC,eAAepB,EAAS,aAAc,CAAE+B,OAAO,K,6pDCLvD,MAA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EAAMC,QAAQ,IAAY,iCAC5B,MAAMJ,QAAsB,SAAWkD,EAAW+B,SAAW,YAAa,CACtEW,IAAKA,EACL0C,OAAQA,GACT,CACC3D,QAAS,CAAC,iBAAkBxH,KAAKgG,YAAY+B,OAC7CN,QAAS1B,EAAW2B,UAGxB,QAAiBxJ,IAAb2E,QAA4C3E,IAAlB2E,EAAS/C,KACnC,MAAM,IAAIM,EAAqB,mCAEvC,GAAG,EAAGc,EAAO0B,MAAM+E,KAAKzG,GAC5B,E,EAxWuB,EAAA4G,SAAmB,6BACnB,EAAAtB,cAAwB,yCACvB,EAAAkB,QAAkB,KX1B9C,SAAYtC,GACR,kBACA,gCACA,oBACA,wBACA,0CACA,kCACH,CAPD,CAAYA,IAAAA,EAAmB,KCA/B,SAAYC,GACR,cACA,eACH,CAHD,CAAYA,IAAAA,EAAkB,KCA9B,SAAYC,GACR,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,SACH,CAtMD,CAAYA,IAAAA,EAAkB,KCA9B,SAAYC,GACR,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,WACH,CA1KD,CAAYA,IAAAA,EAAmB,KCA/B,SAAYC,GACR,UACA,UACA,UACA,UACA,UACA,SACH,CAPD,CAAYA,IAAAA,EAAmB,KCA/B,SAAYC,GAER,gBACA,gBACA,gBACA,gBACA,gBACA,gBAGA,gBACA,gBACA,gBACA,gBAGA,gBACA,gBACA,gBACA,gBACA,gBAGA,gBACA,gBACA,gBAGA,gBACA,gBAGA,gBACA,gBAGA,gBACA,gBAGA,gBACA,gBACA,gBACA,gBACA,gBAGA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBAGA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBAGA,gBACA,gBACA,gBACA,gBACA,gBACA,gBAGA,gBACA,gBACA,gBACA,gBACA,gBAGA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBAGA,gBACA,gBACA,eACH,CAhGD,CAAYA,IAAAA,EAAa,KCAzB,SAAYC,GAER,kCACA,kCACA,gCACA,8BACA,wCACA,8BACA,oCACA,4CACA,4BACA,oCACA,8BACA,gCACA,oCACA,kCACA,oCACA,oCACA,kCACA,8BACA,oCAGA,8BACA,wCACA,wCACA,kEACA,4DACA,wDACA,oDACA,0DACA,wDACA,kEACA,oDACA,0DACA,0DACA,wDACA,wDACA,sCACA,gCACA,kDACA,sCACA,gCACA,kCACA,wCACA,kCACA,gCACA,gDACA,8CACA,kCACA,oCACA,oCACA,oCACA,wCACA,gDACA,0CACA,wCACA,kCACA,8CACA,kCACA,8CACA,kCACA,oCACA,sCACA,sCACA,4CACA,4CACA,wCACA,wCACA,wCACA,0CACA,wCACA,wCACA,kCACA,oCACA,kCACA,0CACA,8DACA,8CACA,oDACA,0DACA,wDACA,gDACA,wDACA,oDACA,kCACA,oCACA,oCACA,kCACA,4DACA,4DACA,kCACA,8BACA,4CACA,kCACA,oCACA,kCACA,0CACA,wCACA,sCACA,wCACA,kCACA,0CACA,4CACA,sCACA,oCACA,wCACA,0CACA,sCACA,8BACA,oCACA,4DACA,4DACA,kEACA,8BACA,oCACA,kCACA,0CACA,oCACA,kDACA,4CACA,4CACA,8CACA,8CACA,kCACA,kCACA,sCACA,0CACA,sCACA,sCACA,gDACA,wCACA,8CACA,gCACA,sCACA,gDACA,4CACA,gCACA,oCACA,oCACA,wCACA,0CACA,sCACA,oCAGA,sCACA,sCACA,8CACA,wCACA,wCACA,0CACA,sCACA,wCAGA,4BACA,0BACA,4BACA,0BACA,4BACA,gCACA,4BACA,8BACA,wBACA,8BACA,8BACA,4BACA,8BACA,0BACA,8BACA,gCACA,0BACA,wBACA,0BACA,gCACA,kCACA,wBACA,4BACA,sCACA,kCACA,wBACA,8BACA,8BACA,gCACA,kCACA,0BACA,kCACA,8BACA,kCACA,gCACA,8BACA,sCACA,8BACA,0BACA,8BACA,gCACA,4BACA,8BACA,wCACA,sCACA,wBACA,wBACA,kCACA,kCACA,0BACA,gCACA,kCACA,4BACA,gCACA,kCACA,0BACA,gCACA,kCACA,0CACA,4BACA,gCACA,8BACA,4BACA,8BACA,0BACA,0BACA,sCACA,4BACA,gCACA,sCACA,8BACA,4BACA,0CACA,8BAGA,oCACA,sCACA,oCACA,4CACA,kCACA,sCACA,kDACA,sCAGA,0CACA,0CACA,gDACA,sCACA,oCACA,sCACA,0CACA,4CACA,4CACA,oCACA,sCAGA,oBACA,8BACA,gCACA,gCACA,gCACA,gCACA,gCACA,8BACA,8BACA,8BACA,8BACA,8BACA,8BACA,8BACA,8BACA,6BACA,+BACA,+BACA,+BACA,6BACA,6BACA,6BACA,6BACA,6BACA,6BACA,6BACA,6BACA,oBAGA,kCACA,sCACA,gCACA,oCACA,gCACA,oCACA,sCACA,oCACA,oCACA,gCACA,sCACA,oCACA,oCACA,0CACA,8BACA,4BACA,gCACA,gCACA,gCACA,8BACA,8BACA,gCACA,8BACA,gCACA,4BACA,4BACA,gCACA,kCACA,wCACA,8BACA,kCACA,gCACA,sCACA,gCACA,kCACA,sCACA,gCACA,gCAGA,gCACA,oCACA,sCAGA,8BACA,sCACA,8CACA,oCACA,kCACA,gCACA,oCACA,8BACA,wCACA,oCACA,4CACA,8BACA,sCACA,kCACA,0CACA,kCACA,wCACA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IAAII,EAAgB,EAKpB,OAJAJ,EAASngB,QAASqgB,IACdE,GAASL,EAAmBG,IAGzBld,EAASM,MAAM8c,EAAO,EACjC,CAEO,0BAAOC,CAAoB3e,EAAe4e,GAC7C,GAAI5e,QACA,OAAOA,EAGX,MAAMkD,EAA+Cib,GAAUU,WAAWD,GAE1E,IAAIE,EAAmB9e,EAAQ,IAAM4e,EACrC,QAAiBhuB,IAAbsS,EACA,OAAQA,EAAS6b,UACb,IAAK,SACDD,EAAW5b,EAAS8b,OAAShf,EAC7B,MACJ,IAAK,QACD8e,EAAW9e,EAAQkD,EAAS8b,OAKxC,OAAOF,CACX,CAEO,aAAOvP,CAAOvP,EAAeuX,EAAqBlV,EAAmB,GACxE,GAAIrC,QACA,OAAOA,EAGX,MACMif,EADsB/d,OAAOlB,EAAM8K,QAAQ,OAAQ,KACfoU,eAAe,QAAS,CAC9DC,MAAO,UACPC,aAAa,EACbC,sBAAuBhd,EACvBid,sBAAuBjd,IAG3B,OAAQkV,GACJ,IAAK,KACD,OAAO0H,EAAcnU,QAAQ,OAAQ,KAAKA,QAAQ,OAAQ,KAC9D,IAAK,KACD,OAAOmU,EAEnB,CAEO,YAAOrd,CAAM5B,EAAeuf,EAAoB,IACnD,MAAMC,EAAuC,IAAhBte,OAAOlB,GAC9Byf,EAAuC,IAAZF,EAC3BG,EAAeF,EAAeC,EAEpC,OAAOtmB,OAAOmI,EAASM,MAAO4d,EAAeE,GAASA,EAAOxd,KAAK+I,KAAKwU,EAAmB,GAAK,EAAIA,GAAmB,GAAK,IAC/H,E,OAzEwB,GAAAZ,WAAkE,CACtF,IAAO,CAACG,OAAQ,IAAKD,SAAU,UAC/B,IAAO,CAACC,OAAQ,IAAKD,SAAU,SAC/B,IAAO,CAACC,OAAQ,IAAKD,SAAU,W","sources":["webpack://SmilePlayerCommon/webpack/universalModuleDefinition","webpack://SmilePlayerCommon/webpack/bootstrap","webpack://SmilePlayerCommon/webpack/runtime/compat get default export","webpack://SmilePlayerCommon/webpack/runtime/define property getters","webpack://SmilePlayerCommon/webpack/runtime/hasOwnProperty shorthand","webpack://SmilePlayerCommon/webpack/runtime/make namespace object","webpack://SmilePlayerCommon/external commonjs \"axios\"","webpack://SmilePlayerCommon/./src/exception/MainException.ts","webpack://SmilePlayerCommon/./src/exception/ExternalApiException.ts","webpack://SmilePlayerCommon/external commonjs \"@sentry/node\"","webpack://SmilePlayerCommon/external commonjs \"@sentry/profiling-node\"","webpack://SmilePlayerCommon/./src/tool/Env.ts","webpack://SmilePlayerCommon/./src/tool/Environment.ts","webpack://SmilePlayerCommon/./src/exception/UnauthorizedException.ts","webpack://SmilePlayerCommon/./src/util/HelperUtil.ts","webpack://SmilePlayerCommon/./src/tool/Logger.ts","webpack://SmilePlayerCommon/external commonjs \"retry\"","webpack://SmilePlayerCommon/./src/tool/Retry.ts","webpack://SmilePlayerCommon/external node-commonjs \"querystring\"","webpack://SmilePlayerCommon/./src/util/ValidatorUtil.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/auth/HubriseAccessLevel.ts","webpack://SmilePlayerCommon/./src/exception/BadParameterException.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/auth/HubriseAuthResource.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/auth/HubriseRightAccess.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/address/HubriseCountryCode.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/common/HubriseCurrencyCode.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/common/HubriseLanguageCode.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/common/HubriseLocale.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/common/HubriseTimezoneId.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/callback/HubriseEventType.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/callback/HubriseResourceType.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/order/HubriseOrderStatus.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/order/HubriseServiceType.ts","webpack://SmilePlayerCommon/./src/api/hubrise/service/HubriseApi.ts","webpack://SmilePlayerCommon/external commonjs \"lodash\"","webpack://SmilePlayerCommon/./src/util/ObjectUtil.ts","webpack://SmilePlayerCommon/./src/api/hubrise/service/HubriseCatalogConverter.ts","webpack://SmilePlayerCommon/./src/api/hubrise/service/HubriseOrderConverter.ts","webpack://SmilePlayerCommon/./src/util/MathUtil.ts","webpack://SmilePlayerCommon/./src/api/hubrise/util/HubrisePriceUtil.ts","webpack://SmilePlayerCommon/./src/api/hubrise/service/TotalHubriseCalculator.ts","webpack://SmilePlayerCommon/./src/constant/Path.ts","webpack://SmilePlayerCommon/./src/exception/BadRequestException.ts","webpack://SmilePlayerCommon/./src/exception/ConflictException.ts","webpack://SmilePlayerCommon/./src/exception/DuplicateException.ts","webpack://SmilePlayerCommon/./src/exception/InternalException.ts","webpack://SmilePlayerCommon/./src/exception/NotImplementedException.ts","webpack://SmilePlayerCommon/./src/exception/ObjectNotFoundException.ts","webpack://SmilePlayerCommon/./src/exception/PageNotFoundException.ts","webpack://SmilePlayerCommon/./src/http/HandlerController.ts","webpack://SmilePlayerCommon/./src/http/AuthenticationMiddleware.ts","webpack://SmilePlayerCommon/./src/http/AuthorizationMiddleware.ts","webpack://SmilePlayerCommon/external node-commonjs \"crypto\"","webpack://SmilePlayerCommon/external commonjs \"express\"","webpack://SmilePlayerCommon/external commonjs \"cors\"","webpack://SmilePlayerCommon/external commonjs \"compression\"","webpack://SmilePlayerCommon/external commonjs \"helmet\"","webpack://SmilePlayerCommon/external commonjs \"connect-timeout\"","webpack://SmilePlayerCommon/./src/http/Server.ts","webpack://SmilePlayerCommon/external commonjs \"nock\"","webpack://SmilePlayerCommon/./src/mockup/ApiMockup.ts","webpack://SmilePlayerCommon/./src/mockup/HubriseApiMockup.ts","webpack://SmilePlayerCommon/external commonjs \"luxon\"","webpack://SmilePlayerCommon/external commonjs \"iconv-lite\"","webpack://SmilePlayerCommon/./src/util/UrlUtil.ts","webpack://SmilePlayerCommon/./src/service/sender/SmsSenderService.ts","webpack://SmilePlayerCommon/external node-commonjs \"path\"","webpack://SmilePlayerCommon/external commonjs \"mustache\"","webpack://SmilePlayerCommon/external node-commonjs \"fs\"","webpack://SmilePlayerCommon/./src/util/PromiseUtil.ts","webpack://SmilePlayerCommon/external commonjs \"color-name\"","webpack://SmilePlayerCommon/./src/util/GeneratorUtil.ts","webpack://SmilePlayerCommon/./src/tool/FileSystem.ts","webpack://SmilePlayerCommon/external commonjs \"clean-css\"","webpack://SmilePlayerCommon/external commonjs \"html-minifier-terser\"","webpack://SmilePlayerCommon/./src/templating/MinifierEngine.ts","webpack://SmilePlayerCommon/./src/templating/TemplateEngine.ts","webpack://SmilePlayerCommon/external commonjs \"node-mailjet\"","webpack://SmilePlayerCommon/./src/service/sender/EmailSenderService.ts","webpack://SmilePlayerCommon/./src/tool/Configuration.ts","webpack://SmilePlayerCommon/external commonjs \"typeorm\"","webpack://SmilePlayerCommon/./src/tool/Database.ts","webpack://SmilePlayerCommon/external commonjs \"prettyjson\"","webpack://SmilePlayerCommon/./src/tool/Displayer.ts","webpack://SmilePlayerCommon/./src/tool/Downloader.ts","webpack://SmilePlayerCommon/external commonjs \"fast-diff\"","webpack://SmilePlayerCommon/./src/util/StringUtil.ts","webpack://SmilePlayerCommon/external commonjs \"emoji-regex\"","webpack://SmilePlayerCommon/./src/util/FormatterUtil.ts","webpack://SmilePlayerCommon/./src/util/AddressUtil.ts","webpack://SmilePlayerCommon/./src/util/DateUtil.ts","webpack://SmilePlayerCommon/./src/util/ExtractorUtil.ts","webpack://SmilePlayerCommon/./src/util/PriceUtil.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"SmilePlayerCommon\"] = factory();\n\telse\n\t\troot[\"SmilePlayerCommon\"] = factory();\n})(global, () => {\nreturn ","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"axios\");","import {ExceptionContract} from 'common/exception/ExceptionContract';\n\nexport class MainException extends Error implements ExceptionContract {\n public code: number;\n public data: {[key: string]: any};\n\n public constructor(message: string, code?: number, data?: {[key: string]: any}) {\n super(message);\n this.code = code;\n this.data = data;\n this.name = 'MainException';\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, MainException);\n } else {\n this.stack = (new Error(message)).stack;\n }\n }\n}\n","import {MainException} from 'common/exception/MainException';\nimport {ExceptionContract} from 'common/exception/ExceptionContract';\n\nexport class ExternalApiException extends MainException implements ExceptionContract {\n public constructor(message: string, data?: {[key: string]: any}) {\n super(message, 502, data);\n this.name = 'ExternalApiException';\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@sentry/node\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@sentry/profiling-node\");","/* eslint-disable no-shadow */\nexport enum Env {\n PRODUCTION = 'prod',\n DEVELOPMENT = 'dev',\n TEST = 'test'\n}\n","import {Env} from 'common/tool/Env';\n\nexport class Environment {\n public static getMode(): Env {\n switch (process.env.NODE_ENV) {\n case 'dev':\n case 'development':\n return Env.DEVELOPMENT;\n case 'prod':\n case 'production':\n return Env.PRODUCTION;\n case 'test':\n return Env.TEST;\n }\n\n return process.env.APP_ID === undefined ? Env.DEVELOPMENT : Env.PRODUCTION;\n }\n}\n","import {MainException} from 'common/exception/MainException';\nimport {ExceptionContract} from 'common/exception/ExceptionContract';\n\nexport class UnauthorizedException extends MainException implements ExceptionContract {\n public static readonly ERROR_CODE: number = 401;\n\n public constructor(message: string, data?: {[key: string]: any}) {\n super(message, UnauthorizedException.ERROR_CODE, data);\n this.name = 'UnauthorizedException';\n }\n}\n","export const isNullOrUndefined: (obj: unknown) => boolean = (obj) => {\n return obj === undefined || obj === null;\n};\n","import * as Sentry from '@sentry/node';\nimport {nodeProfilingIntegration} from '@sentry/profiling-node';\nimport {Environment} from 'common/tool/Environment';\nimport {ExceptionContract} from 'common/exception/ExceptionContract';\nimport {UnauthorizedException} from 'common/exception/UnauthorizedException';\nimport {Env} from 'common/tool/Env';\nimport * as express from 'express';\nimport {isNullOrUndefined} from 'common/util/HelperUtil';\n\nexport class Logger {\n public static init(sentryToken: string, app: express.Express): void {\n if (Environment.getMode() === Env.PRODUCTION) {\n // const tracesSampleRate: number = 0.001;\n const tracesSampleRate: number = 0; // TODO enable tracing\n Sentry.init({\n dsn: sentryToken,\n integrations: [\n Sentry.captureConsoleIntegration({\n levels: ['error', 'warn', 'log']\n }),\n nodeProfilingIntegration()\n ],\n environment: Environment.getMode(),\n maxBreadcrumbs: 50,\n tracesSampleRate: tracesSampleRate,\n profilesSampleRate: tracesSampleRate\n });\n Sentry.setupExpressErrorHandler(app);\n }\n }\n\n public static trace(message: string, extra?: any): void {\n if ([Env.DEVELOPMENT, Env.TEST].includes(Environment.getMode())) {\n if (extra === undefined) {\n console.info(message); // eslint-disable-line no-console\n } else {\n console.info(message, JSON.stringify(extra, null, 2)); // eslint-disable-line no-console\n }\n } else {\n Sentry.addBreadcrumb({\n category: 'info',\n message: message,\n data: extra,\n level: 'info'\n });\n }\n }\n\n public static debug(message: string, extra?: any): void {\n if ([Env.DEVELOPMENT, Env.TEST].includes(Environment.getMode())) {\n if (extra === undefined) {\n console.log(message); // eslint-disable-line no-console\n } else {\n console.log(message, JSON.stringify(extra, null, 2)); // eslint-disable-line no-console\n }\n } else {\n Sentry.addBreadcrumb({\n category: 'debug',\n message: message,\n data: extra,\n level: 'debug'\n });\n }\n }\n\n public static info(message: string, extra?: any): void {\n if ([Env.DEVELOPMENT, Env.TEST].includes(Environment.getMode())) {\n if (extra === undefined) {\n console.info(message); // eslint-disable-line no-console\n } else {\n console.info(message, JSON.stringify(extra, null, 2)); // eslint-disable-line no-console\n }\n } else {\n Sentry.withScope(scope => {\n if (extra !== undefined) {\n scope.setExtra('extra', JSON.stringify(extra));\n }\n Sentry.captureMessage(message);\n });\n }\n }\n\n public static warning(error: ExceptionContract, extra?: any): void {\n if (!isNullOrUndefined((error as any).response)) {\n if (typeof extra !== 'object') {\n extra = {};\n }\n extra.requestErrorData = (error as any).response.data;\n }\n if ([Env.DEVELOPMENT, Env.TEST].includes(Environment.getMode())) {\n if (extra === undefined) {\n console.warn(error); // eslint-disable-line no-console\n } else {\n console.warn(error, JSON.stringify(extra, null, 2)); // eslint-disable-line no-console\n }\n } else {\n Sentry.withScope(scope => {\n if (extra !== undefined) {\n scope.setExtra('extra', JSON.stringify(extra));\n }\n if (error.data !== undefined) {\n scope.setExtra('data', JSON.stringify(error.data));\n }\n Sentry.captureException(error);\n });\n }\n }\n\n public static error(error: ExceptionContract, extra?: any): void {\n if ([UnauthorizedException.ERROR_CODE].includes(error.code)) {\n return;\n }\n if (!isNullOrUndefined((error as any).response)) {\n if (typeof extra !== 'object') {\n extra = {};\n }\n extra.requestErrorData = (error as any).response.data;\n }\n if ([Env.DEVELOPMENT, Env.TEST].includes(Environment.getMode())) {\n if (extra === undefined) {\n console.error(error); // eslint-disable-line no-console\n } else {\n console.error(error, JSON.stringify(extra, null, 2)); // eslint-disable-line no-console\n }\n } else {\n Sentry.withScope(scope => {\n if (extra !== undefined) {\n scope.setExtra('extra', JSON.stringify(extra));\n }\n if (error.data !== undefined) {\n scope.setExtra('data', JSON.stringify(error.data));\n }\n Sentry.captureException(error);\n });\n }\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"retry\");","import * as retry from 'retry';\n\nexport class Retry {\n public static async request(process: () => Promise<void>, retries: number = 2, logger: (error: Error) => void): Promise<any> {\n const operation = retry.operation({\n retries: retries,\n factor: 1,\n minTimeout: 0,\n maxTimeout: 0,\n randomize: false\n });\n\n return new Promise<any>((resolve, reject) => {\n operation.attempt(() => {\n process().then(resolve).catch((error) => {\n if (operation.retry(error)) {\n if (typeof logger === 'function') {\n logger(error);\n }\n } else {\n reject(error);\n }\n });\n });\n });\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"querystring\");","export class ValidatorUtil {\n public static isEmail(email: string): boolean {\n if (typeof email !== 'string') {\n return false;\n }\n\n return (new RegExp('^[a-zA-Z0-9\\\\.!#$%&*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\\\.[a-zA-Z0-9-]+)*$', 'i')).test(email);\n }\n\n public static isPhone(phone: string): boolean {\n if (typeof phone !== 'string') {\n return false;\n }\n\n return (new RegExp('^([\\+\\\\s0-9]{10,}(#[0-9]+)?)$')).test(phone);\n }\n\n public static isIntMobilePhone(phone: string): boolean {\n const caRegex: RegExp = new RegExp('^\\\\+1[0-9]{10}$', 'i');\n const frRegex: RegExp = new RegExp('^\\\\+33(6|7)[0-9]{8}$', 'i');\n const usRegex: RegExp = new RegExp('^\\\\+1[0-9]{10}$', 'i');\n\n return caRegex.test(phone) || frRegex.test(phone) || usRegex.test(phone);\n }\n\n public static isNumber(num: string | number): boolean {\n if (typeof num === 'number') {\n return true;\n }\n\n if (typeof num !== 'string') {\n return false;\n }\n\n return (new RegExp('^\\-?[0-9]+\\\\.?[0-9]*$')).test(num);\n }\n\n public static isISODate(str: string): boolean {\n const strictISORegex = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?([+-]\\d{2}:\\d{2}|Z)$/;\n\n if (!strictISORegex.test(str)) {\n return false;\n }\n \n return !isNaN((new Date(str)).getTime());\n }\n}\n","// eslint-disable-next-line no-shadow\nexport enum HubriseAccessLevel {\n ACCOUNT = 'account',\n LOCATION = 'location',\n PROFILE = 'profile'\n}\n","import {MainException} from 'common/exception/MainException';\nimport {ExceptionContract} from 'common/exception/ExceptionContract';\n\nexport class BadParameterException extends MainException implements ExceptionContract {\n public constructor(message: string, data?: {[key: string]: any}) {\n super(message, 400, data);\n this.name = 'BadParameterException';\n }\n}\n","// eslint-disable-next-line no-shadow\nexport enum HubriseAuthResource {\n ORDERS = 'orders',\n CUSTOMER_LIST = 'customer_list',\n CATALOG = 'catalog',\n INVENTORY = 'inventory',\n ALL_CUSTOMER_LISTS = 'all_customer_lists',\n ALL_CATALOG_LISTS = 'all_catalogs'\n}\n","// eslint-disable-next-line no-shadow\nexport enum HubriseRightAccess {\n READ = 'read',\n WRITE = 'write',\n}\n","// eslint-disable-next-line no-shadow\nexport enum HubriseCountryCode {\n AF = 'AF',\n AL = 'AL',\n DZ = 'DZ',\n AD = 'AD',\n AO = 'AO',\n AG = 'AG',\n AR = 'AR',\n AM = 'AM',\n AU = 'AU',\n AT = 'AT',\n AZ = 'AZ',\n BS = 'BS',\n BH = 'BH',\n BD = 'BD',\n BB = 'BB',\n BY = 'BY',\n BE = 'BE',\n BZ = 'BZ',\n BJ = 'BJ',\n BT = 'BT',\n BO = 'BO',\n BA = 'BA',\n BW = 'BW',\n BR = 'BR',\n BN = 'BN',\n BG = 'BG',\n BF = 'BF',\n BI = 'BI',\n CV = 'CV',\n KH = 'KH',\n CM = 'CM',\n CA = 'CA',\n CF = 'CF',\n TD = 'TD',\n CL = 'CL',\n CN = 'CN',\n CO = 'CO',\n KM = 'KM',\n CG = 'CG',\n CD = 'CD',\n CR = 'CR',\n CI = 'CI',\n HR = 'HR',\n CU = 'CU',\n CY = 'CY',\n CZ = 'CZ',\n DK = 'DK',\n DJ = 'DJ',\n DM = 'DM',\n DO = 'DO',\n TL = 'TL',\n EC = 'EC',\n EG = 'EG',\n SV = 'SV',\n GQ = 'GQ',\n ER = 'ER',\n EE = 'EE',\n SZ = 'SZ',\n ET = 'ET',\n FJ = 'FJ',\n FI = 'FI',\n FR = 'FR',\n GA = 'GA',\n GM = 'GM',\n GE = 'GE',\n DE = 'DE',\n GH = 'GH',\n GR = 'GR',\n GD = 'GD',\n GT = 'GT',\n GN = 'GN',\n GW = 'GW',\n GY = 'GY',\n HT = 'HT',\n VA = 'VA',\n HN = 'HN',\n HU = 'HU',\n IS = 'IS',\n IN = 'IN',\n ID = 'ID',\n IR = 'IR',\n IQ = 'IQ',\n IE = 'IE',\n IL = 'IL',\n IT = 'IT',\n JM = 'JM',\n JP = 'JP',\n JO = 'JO',\n KZ = 'KZ',\n KE = 'KE',\n KI = 'KI',\n XK = 'XK',\n KW = 'KW',\n KG = 'KG',\n LA = 'LA',\n LV = 'LV',\n LB = 'LB',\n LS = 'LS',\n LR = 'LR',\n LY = 'LY',\n LI = 'LI',\n LT = 'LT',\n LU = 'LU',\n MG = 'MG',\n MW = 'MW',\n MY = 'MY',\n MV = 'MV',\n ML = 'ML',\n MT = 'MT',\n MH = 'MH',\n MR = 'MR',\n MU = 'MU',\n MX = 'MX',\n FM = 'FM',\n MD = 'MD',\n MC = 'MC',\n MN = 'MN',\n ME = 'ME',\n MA = 'MA',\n MZ = 'MZ',\n MM = 'MM',\n NA = 'NA',\n NR = 'NR',\n NP = 'NP',\n NL = 'NL',\n NZ = 'NZ',\n NI = 'NI',\n NE = 'NE',\n NG = 'NG',\n KP = 'KP',\n MK = 'MK',\n NO = 'NO',\n OM = 'OM',\n PK = 'PK',\n PW = 'PW',\n PS = 'PS',\n PA = 'PA',\n PG = 'PG',\n PY = 'PY',\n PE = 'PE',\n PH = 'PH',\n PL = 'PL',\n PT = 'PT',\n QA = 'QA',\n RO = 'RO',\n RU = 'RU',\n RW = 'RW',\n KN = 'KN',\n LC = 'LC',\n VC = 'VC',\n WS = 'WS',\n SM = 'SM',\n ST = 'ST',\n SA = 'SA',\n SN = 'SN',\n RS = 'RS',\n SC = 'SC',\n SL = 'SL',\n SG = 'SG',\n SK = 'SK',\n SI = 'SI',\n SB = 'SB',\n SO = 'SO',\n ZA = 'ZA',\n KR = 'KR',\n SS = 'SS',\n ES = 'ES',\n LK = 'LK',\n SD = 'SD',\n SR = 'SR',\n SE = 'SE',\n CH = 'CH',\n SY = 'SY',\n TW = 'TW',\n TJ = 'TJ',\n TZ = 'TZ',\n TH = 'TH',\n TG = 'TG',\n TO = 'TO',\n TT = 'TT',\n TN = 'TN',\n TR = 'TR',\n TM = 'TM',\n TV = 'TV',\n UG = 'UG',\n UA = 'UA',\n AE = 'AE',\n GB = 'GB',\n US = 'US',\n UY = 'UY',\n UZ = 'UZ',\n VU = 'VU',\n VE = 'VE',\n VN = 'VN',\n YE = 'YE',\n ZM = 'ZM',\n ZW = 'ZW',\n}\n","// eslint-disable-next-line no-shadow\nexport enum HubriseCurrencyCode {\n AED = 'AED', // UAE Dirham\n AFN = 'AFN', // Afghani\n ALL = 'ALL', // Lek\n AMD = 'AMD', // Armenian Dram\n ANG = 'ANG', // Netherlands Antillean Guilder\n AOA = 'AOA', // Kwanza\n ARS = 'ARS', // Argentine Peso\n AUD = 'AUD', // Australian Dollar\n AWG = 'AWG', // Aruban Florin\n AZN = 'AZN', // Azerbaijanian Manat\n BAM = 'BAM', // Convertible Mark\n BBD = 'BBD', // Barbados Dollar\n BDT = 'BDT', // Taka\n BGN = 'BGN', // Bulgarian Lev\n BHD = 'BHD', // Bahraini Dinar\n BIF = 'BIF', // Burundi Franc\n BMD = 'BMD', // Bermudian Dollar\n BND = 'BND', // Brunei Dollar\n BOB = 'BOB', // Boliviano\n BOV = 'BOV', // Mvdol\n BRL = 'BRL', // Brazilian Real\n BSD = 'BSD', // Bahamian Dollar\n BTN = 'BTN', // Ngultrum\n BWP = 'BWP', // Pula\n BYN = 'BYN', // Belarussian Ruble\n BZD = 'BZD', // Belize Dollar\n CAD = 'CAD', // Canadian Dollar\n CDF = 'CDF', // Congolese Franc\n CHE = 'CHE', // WIR Euro\n CHF = 'CHF', // Swiss Franc\n CHW = 'CHW', // WIR Franc\n CLF = 'CLF', // Unidad de Fomento\n CLP = 'CLP', // Chilean Peso\n CNY = 'CNY', // Yuan Renminbi\n COP = 'COP', // Colombian Peso\n COU = 'COU', // Unidad de Valor Real\n CRC = 'CRC', // Costa Rican Colon\n CUC = 'CUC', // Peso Convertible\n CUP = 'CUP', // Cuban Peso\n CVE = 'CVE', // Cabo Verde Escudo\n CZK = 'CZK', // Czech Koruna\n DJF = 'DJF', // Djibouti Franc\n DKK = 'DKK', // Danish Krone\n DOP = 'DOP', // Dominican Peso\n DZD = 'DZD', // Algerian Dinar\n EGP = 'EGP', // Egyptian Pound\n ERN = 'ERN', // Nakfa\n ETB = 'ETB', // Ethiopian Birr\n EUR = 'EUR', // Euro\n FJD = 'FJD', // Fiji Dollar\n FKP = 'FKP', // Falkland Islands Pound\n GBP = 'GBP', // Pound Sterling\n GEL = 'GEL', // Lari\n GHS = 'GHS', // Ghana Cedi\n GIP = 'GIP', // Gibraltar Pound\n GMD = 'GMD', // Dalasi\n GNF = 'GNF', // Guinea Franc\n GTQ = 'GTQ', // Quetzal\n GYD = 'GYD', // Guyana Dollar\n HKD = 'HKD', // Hong Kong Dollar\n HNL = 'HNL', // Lempira\n HRK = 'HRK', // Croatian Kuna\n HTG = 'HTG', // Gourde\n HUF = 'HUF', // Forint\n IDR = 'IDR', // Rupiah\n ILS = 'ILS', // New Israeli Sheqel\n INR = 'INR', // Indian Rupee\n IQD = 'IQD', // Iraqi Dinar\n IRR = 'IRR', // Iranian Rial\n ISK = 'ISK', // Iceland Krona\n JMD = 'JMD', // Jamaican Dollar\n JOD = 'JOD', // Jordanian Dinar\n JPY = 'JPY', // Yen\n KES = 'KES', // Kenyan Shilling\n KGS = 'KGS', // Som\n KHR = 'KHR', // Riel\n KMF = 'KMF', // Comoro Franc\n KPW = 'KPW', // North Korean Won\n KRW = 'KRW', // Won\n KWD = 'KWD', // Kuwaiti Dinar\n KYD = 'KYD', // Cayman Islands Dollar\n KZT = 'KZT', // Tenge\n LAK = 'LAK', // Kip\n LBP = 'LBP', // Lebanese Pound\n LKR = 'LKR', // Sri Lanka Rupee\n LRD = 'LRD', // Liberian Dollar\n LSL = 'LSL', // Loti\n LYD = 'LYD', // Libyan Dinar\n MAD = 'MAD', // Moroccan Dirham\n MDL = 'MDL', // Moldovan Leu\n MGA = 'MGA', // Malagasy Ariary\n MKD = 'MKD', // Denar\n MMK = 'MMK', // Kyat\n MNT = 'MNT', // Tugrik\n MOP = 'MOP', // Pataca\n MRU = 'MRU', // Ouguiya\n MUR = 'MUR', // Mauritius Rupee\n MVR = 'MVR', // Rufiyaa\n MWK = 'MWK', // Kwacha\n MXN = 'MXN', // Mexican Peso\n MXV = 'MXV', // Mexican Unidad de Inversion (UDI)\n MYR = 'MYR', // Malaysian Ringgit\n MZN = 'MZN', // Mozambique Metical\n NAD = 'NAD', // Namibia Dollar\n NGN = 'NGN', // Naira\n NIO = 'NIO', // Cordoba Oro\n NOK = 'NOK', // Norwegian Krone\n NPR = 'NPR', // Nepalese Rupee\n NZD = 'NZD', // New Zealand Dollar\n OMR = 'OMR', // Rial Omani\n PAB = 'PAB', // Balboa\n PEN = 'PEN', // Nuevo Sol\n PGK = 'PGK', // Kina\n PHP = 'PHP', // Philippine Peso\n PKR = 'PKR', // Pakistan Rupee\n PLN = 'PLN', // Zloty\n PYG = 'PYG', // Guarani\n QAR = 'QAR', // Qatari Rial\n RON = 'RON', // Romanian Leu\n RSD = 'RSD', // Serbian Dinar\n RUB = 'RUB', // Russian Ruble\n RWF = 'RWF', // Rwanda Franc\n SAR = 'SAR', // Saudi Riyal\n SBD = 'SBD', // Solomon Islands Dollar\n SCR = 'SCR', // Seychelles Rupee\n SDG = 'SDG', // Sudanese Pound\n SEK = 'SEK', // Swedish Krona\n SGD = 'SGD', // Singapore Dollar\n SHP = 'SHP', // Saint Helena Pound\n SLE = 'SLE', // Leone\n SOS = 'SOS', // Somali Shilling\n SRD = 'SRD', // Surinam Dollar\n SSP = 'SSP', // South Sudanese Pound\n STN = 'STN', // Dobra\n SVC = 'SVC', // El Salvador Colon\n SYP = 'SYP', // Syrian Pound\n SZL = 'SZL', // Lilangeni\n THB = 'THB', // Baht\n TJS = 'TJS', // Somoni\n TMT = 'TMT', // Turkmenistan New Manat\n TND = 'TND', // Tunisian Dinar\n TOP = 'TOP', // Pa'anga\n TRY = 'TRY', // Turkish Lira\n TTD = 'TTD', // Trinidad and Tobago Dollar\n TWD = 'TWD', // New Taiwan Dollar\n TZS = 'TZS', // Tanzanian Shilling\n UAH = 'UAH', // Hryvnia\n UGX = 'UGX', // Uganda Shilling\n USD = 'USD', // US Dollar\n USN = 'USN', // US Dollar (Next day)\n UYI = 'UYI', // Uruguay Peso en Unidades Indexadas\n UYU = 'UYU', // Peso Uruguayo\n UZS = 'UZS', // Uzbekistan Sum\n VED = 'VED', // Bolivar\n VEF = 'VEF', // Bolivar\n VND = 'VND', // Dong\n VUV = 'VUV', // Vatu\n WST = 'WST', // Tala\n XAF = 'XAF', // CFA Franc BEAC\n XCD = 'XCD', // East Caribbean Dollar\n XDR = 'XDR', // SDR (Special Drawing Right)\n XOF = 'XOF', // CFA Franc BCEAO\n XPF = 'XPF', // CFP Franc\n XSU = 'XSU', // Sucre\n XUA = 'XUA', // ADB Unit of Account\n YER = 'YER', // Yemeni Rial\n ZAR = 'ZAR', // Rand\n ZMW = 'ZMW', // Zambian Kwacha\n ZWL = 'ZWL', // Zimbabwe Dollar\n}\n","// eslint-disable-next-line no-shadow\nexport enum HubriseLanguageCode {\n AR = 'ar',\n DE = 'de',\n EN = 'en',\n ES = 'es',\n FR = 'fr',\n PT = 'pt'\n}\n","// eslint-disable-next-line no-shadow\nexport enum HubriseLocale {\n // Anglais\n EN_US = 'en-US', // Anglais (États-Unis)\n EN_GB = 'en-GB', // Anglais (Royaume-Uni)\n EN_CA = 'en-CA', // Anglais (Canada)\n EN_AU = 'en-AU', // Anglais (Australie)\n EN_NZ = 'en-NZ', // Anglais (Nouvelle-Zélande)\n EN_ZA = 'en-ZA', // Anglais (Afrique du Sud)\n\n // Français\n FR_FR = 'fr-FR', // Français (France)\n FR_CA = 'fr-CA', // Français (Canada)\n FR_BE = 'fr-BE', // Français (Belgique)\n FR_CH = 'fr-CH', // Français (Suisse)\n\n // Espagnol\n ES_ES = 'es-ES', // Espagnol (Espagne)\n ES_MX = 'es-MX', // Espagnol (Mexique)\n ES_AR = 'es-AR', // Espagnol (Argentine)\n ES_CO = 'es-CO', // Espagnol (Colombie)\n ES_CL = 'es-CL', // Espagnol (Chili)\n\n // Allemand\n DE_DE = 'de-DE', // Allemand (Allemagne)\n DE_AT = 'de-AT', // Allemand (Autriche)\n DE_CH = 'de-CH', // Allemand (Suisse)\n\n // Italien\n IT_IT = 'it-IT', // Italien (Italie)\n IT_CH = 'it-CH', // Italien (Suisse)\n\n // Portugais\n PT_PT = 'pt-PT', // Portugais (Portugal)\n PT_BR = 'pt-BR', // Portugais (Brésil)\n\n // Néerlandais\n NL_NL = 'nl-NL', // Néerlandais (Pays-Bas)\n NL_BE = 'nl-BE', // Néerlandais (Belgique)\n\n // Langues nordiques\n SV_SE = 'sv-SE', // Suédois (Suède)\n NO_NO = 'no-NO', // Norvégien (Norvège)\n DA_DK = 'da-DK', // Danois (Danemark)\n FI_FI = 'fi-FI', // Finnois (Finlande)\n IS_IS = 'is-IS', // Islandais (Islande)\n\n // Langues slaves\n RU_RU = 'ru-RU', // Russe (Russie)\n PL_PL = 'pl-PL', // Polonais (Pologne)\n CS_CZ = 'cs-CZ', // Tchèque (République tchèque)\n SK_SK = 'sk-SK', // Slovaque (Slovaquie)\n HR_HR = 'hr-HR', // Croate (Croatie)\n SR_RS = 'sr-RS', // Serbe (Serbie)\n BG_BG = 'bg-BG', // Bulgare (Bulgarie)\n UK_UA = 'uk-UA', // Ukrainien (Ukraine)\n\n // Langues asiatiques\n JA_JP = 'ja-JP', // Japonais (Japon)\n KO_KR = 'ko-KR', // Coréen (Corée du Sud)\n ZH_CN = 'zh-CN', // Chinois simplifié (Chine)\n ZH_TW = 'zh-TW', // Chinois traditionnel (Taïwan)\n ZH_HK = 'zh-HK', // Chinois traditionnel (Hong Kong)\n TH_TH = 'th-TH', // Thaï (Thaïlande)\n VI_VN = 'vi-VN', // Vietnamien (Vietnam)\n ID_ID = 'id-ID', // Indonésien (Indonésie)\n MS_MY = 'ms-MY', // Malais (Malaisie)\n\n // Langues du Moyen-Orient\n AR_SA = 'ar-SA', // Arabe (Arabie saoudite)\n AR_EG = 'ar-EG', // Arabe (Égypte)\n AR_AE = 'ar-AE', // Arabe (Émirats arabes unis)\n HE_IL = 'he-IL', // Hébreu (Israël)\n FA_IR = 'fa-IR', // Persan (Iran)\n TR_TR = 'tr-TR', // Turc (Turquie)\n\n // Langues indiennes\n HI_IN = 'hi-IN', // Hindi (Inde)\n BN_BD = 'bn-BD', // Bengali (Bangladesh)\n TA_IN = 'ta-IN', // Tamoul (Inde)\n TE_IN = 'te-IN', // Telugu (Inde)\n UR_PK = 'ur-PK', // Ourdou (Pakistan)\n\n // Autres langues européennes\n EL_GR = 'el-GR', // Grec (Grèce)\n HU_HU = 'hu-HU', // Hongrois (Hongrie)\n RO_RO = 'ro-RO', // Roumain (Roumanie)\n LT_LT = 'lt-LT', // Lituanien (Lituanie)\n LV_LV = 'lv-LV', // Letton (Lettonie)\n ET_EE = 'et-EE', // Estonien (Estonie)\n SL_SI = 'sl-SI', // Slovène (Slovénie)\n MT_MT = 'mt-MT', // Maltais (Malte)\n\n // Langues africaines\n SW_KE = 'sw-KE', // Swahili (Kenya)\n AF_ZA = 'af-ZA', // Afrikaans (Afrique du Sud)\n AM_ET = 'am-ET', // Amharique (Éthiopie)\n}\n","// eslint-disable-next-line no-shadow\nexport enum HubriseTimezoneId {\n // Africa\n Africa_Abidjan = 'Africa/Abidjan',\n Africa_Algiers = 'Africa/Algiers',\n Africa_Bissau = 'Africa/Bissau',\n Africa_Cairo = 'Africa/Cairo',\n Africa_Casablanca = 'Africa/Casablanca',\n Africa_Ceuta = 'Africa/Ceuta',\n Africa_El_Aaiun = 'Africa/El_Aaiun',\n Africa_Johannesburg = 'Africa/Johannesburg',\n Africa_Juba = 'Africa/Juba',\n Africa_Khartoum = 'Africa/Khartoum',\n Africa_Lagos = 'Africa/Lagos',\n Africa_Maputo = 'Africa/Maputo',\n Africa_Monrovia = 'Africa/Monrovia',\n Africa_Nairobi = 'Africa/Nairobi',\n Africa_Ndjamena = 'Africa/Ndjamena',\n Africa_Sao_Tome = 'Africa/Sao_Tome',\n Africa_Tripoli = 'Africa/Tripoli',\n Africa_Tunis = 'Africa/Tunis',\n Africa_Windhoek = 'Africa/Windhoek',\n\n // America\n America_Adak = 'America/Adak',\n America_Anchorage = 'America/Anchorage',\n America_Araguaina = 'America/Araguaina',\n America_Argentina_Buenos_Aires = 'America/Argentina/Buenos_Aires',\n America_Argentina_Catamarca = 'America/Argentina/Catamarca',\n America_Argentina_Cordoba = 'America/Argentina/Cordoba',\n America_Argentina_Jujuy = 'America/Argentina/Jujuy',\n America_Argentina_La_Rioja = 'America/Argentina/La_Rioja',\n America_Argentina_Mendoza = 'America/Argentina/Mendoza',\n America_Argentina_Rio_Gallegos = 'America/Argentina/Rio_Gallegos',\n America_Argentina_Salta = 'America/Argentina/Salta',\n America_Argentina_San_Juan = 'America/Argentina/San_Juan',\n America_Argentina_San_Luis = 'America/Argentina/San_Luis',\n America_Argentina_Tucuman = 'America/Argentina/Tucuman',\n America_Argentina_Ushuaia = 'America/Argentina/Ushuaia',\n America_Asuncion = 'America/Asuncion',\n America_Bahia = 'America/Bahia',\n America_Bahia_Banderas = 'America/Bahia_Banderas',\n America_Barbados = 'America/Barbados',\n America_Belem = 'America/Belem',\n America_Belize = 'America/Belize',\n America_Boa_Vista = 'America/Boa_Vista',\n America_Bogota = 'America/Bogota',\n America_Boise = 'America/Boise',\n America_Cambridge_Bay = 'America/Cambridge_Bay',\n America_Campo_Grande = 'America/Campo_Grande',\n America_Cancun = 'America/Cancun',\n America_Caracas = 'America/Caracas',\n America_Cayenne = 'America/Cayenne',\n America_Chicago = 'America/Chicago',\n America_Chihuahua = 'America/Chihuahua',\n America_Ciudad_Juarez = 'America/Ciudad_Juarez',\n America_Costa_Rica = 'America/Costa_Rica',\n America_Coyhaique = 'America/Coyhaique',\n America_Cuiaba = 'America/Cuiaba',\n America_Danmarkshavn = 'America/Danmarkshavn',\n America_Dawson = 'America/Dawson',\n America_Dawson_Creek = 'America/Dawson_Creek',\n America_Denver = 'America/Denver',\n America_Detroit = 'America/Detroit',\n America_Edmonton = 'America/Edmonton',\n America_Eirunepe = 'America/Eirunepe',\n America_El_Salvador = 'America/El_Salvador',\n America_Fort_Nelson = 'America/Fort_Nelson',\n America_Fortaleza = 'America/Fortaleza',\n America_Glace_Bay = 'America/Glace_Bay',\n America_Goose_Bay = 'America/Goose_Bay',\n America_Grand_Turk = 'America/Grand_Turk',\n America_Guatemala = 'America/Guatemala',\n America_Guayaquil = 'America/Guayaquil',\n America_Guyana = 'America/Guyana',\n America_Halifax = 'America/Halifax',\n America_Havana = 'America/Havana',\n America_Hermosillo = 'America/Hermosillo',\n America_Indiana_Indianapolis = 'America/Indiana/Indianapolis',\n America_Indiana_Knox = 'America/Indiana/Knox',\n America_Indiana_Marengo = 'America/Indiana/Marengo',\n America_Indiana_Petersburg = 'America/Indiana/Petersburg',\n America_Indiana_Tell_City = 'America/Indiana/Tell_City',\n America_Indiana_Vevay = 'America/Indiana/Vevay',\n America_Indiana_Vincennes = 'America/Indiana/Vincennes',\n America_Indiana_Winamac = 'America/Indiana/Winamac',\n America_Inuvik = 'America/Inuvik',\n America_Iqaluit = 'America/Iqaluit',\n America_Jamaica = 'America/Jamaica',\n America_Juneau = 'America/Juneau',\n America_Kentucky_Louisville = 'America/Kentucky/Louisville',\n America_Kentucky_Monticello = 'America/Kentucky/Monticello',\n America_La_Paz = 'America/La_Paz',\n America_Lima = 'America/Lima',\n America_Los_Angeles = 'America/Los_Angeles',\n America_Maceio = 'America/Maceio',\n America_Managua = 'America/Managua',\n America_Manaus = 'America/Manaus',\n America_Martinique = 'America/Martinique',\n America_Matamoros = 'America/Matamoros',\n America_Mazatlan = 'America/Mazatlan',\n America_Menominee = 'America/Menominee',\n America_Merida = 'America/Merida',\n America_Metlakatla = 'America/Metlakatla',\n America_Mexico_City = 'America/Mexico_City',\n America_Miquelon = 'America/Miquelon',\n America_Moncton = 'America/Moncton',\n America_Monterrey = 'America/Monterrey',\n America_Montevideo = 'America/Montevideo',\n America_New_York = 'America/New_York',\n America_Nome = 'America/Nome',\n America_Noronha = 'America/Noronha',\n America_North_Dakota_Beulah = 'America/North_Dakota/Beulah',\n America_North_Dakota_Center = 'America/North_Dakota/Center',\n America_North_Dakota_New_Salem = 'America/North_Dakota/New_Salem',\n America_Nuuk = 'America/Nuuk',\n America_Ojinaga = 'America/Ojinaga',\n America_Panama = 'America/Panama',\n America_Paramaribo = 'America/Paramaribo',\n America_Phoenix = 'America/Phoenix',\n America_Port_au_Prince = 'America/Port-au-Prince',\n America_Porto_Velho = 'America/Porto_Velho',\n America_Puerto_Rico = 'America/Puerto_Rico',\n America_Punta_Arenas = 'America/Punta_Arenas',\n America_Rankin_Inlet = 'America/Rankin_Inlet',\n America_Recife = 'America/Recife',\n America_Regina = 'America/Regina',\n America_Resolute = 'America/Resolute',\n America_Rio_Branco = 'America/Rio_Branco',\n America_Santarem = 'America/Santarem',\n America_Santiago = 'America/Santiago',\n America_Santo_Domingo = 'America/Santo_Domingo',\n America_Sao_Paulo = 'America/Sao_Paulo',\n America_Scoresbysund = 'America/Scoresbysund',\n America_Sitka = 'America/Sitka',\n America_St_Johns = 'America/St_Johns',\n America_Swift_Current = 'America/Swift_Current',\n America_Tegucigalpa = 'America/Tegucigalpa',\n America_Thule = 'America/Thule',\n America_Tijuana = 'America/Tijuana',\n America_Toronto = 'America/Toronto',\n America_Vancouver = 'America/Vancouver',\n America_Whitehorse = 'America/Whitehorse',\n America_Winnipeg = 'America/Winnipeg',\n America_Yakutat = 'America/Yakutat',\n\n // Antarctica\n Antarctica_Casey = 'Antarctica/Casey',\n Antarctica_Davis = 'Antarctica/Davis',\n Antarctica_Macquarie = 'Antarctica/Macquarie',\n Antarctica_Mawson = 'Antarctica/Mawson',\n Antarctica_Palmer = 'Antarctica/Palmer',\n Antarctica_Rothera = 'Antarctica/Rothera',\n Antarctica_Troll = 'Antarctica/Troll',\n Antarctica_Vostok = 'Antarctica/Vostok',\n\n // Asia\n Asia_Almaty = 'Asia/Almaty',\n Asia_Amman = 'Asia/Amman',\n Asia_Anadyr = 'Asia/Anadyr',\n Asia_Aqtau = 'Asia/Aqtau',\n Asia_Aqtobe = 'Asia/Aqtobe',\n Asia_Ashgabat = 'Asia/Ashgabat',\n Asia_Atyrau = 'Asia/Atyrau',\n Asia_Baghdad = 'Asia/Baghdad',\n Asia_Baku = 'Asia/Baku',\n Asia_Bangkok = 'Asia/Bangkok',\n Asia_Barnaul = 'Asia/Barnaul',\n Asia_Beirut = 'Asia/Beirut',\n Asia_Bishkek = 'Asia/Bishkek',\n Asia_Chita = 'Asia/Chita',\n Asia_Colombo = 'Asia/Colombo',\n Asia_Damascus = 'Asia/Damascus',\n Asia_Dhaka = 'Asia/Dhaka',\n Asia_Dili = 'Asia/Dili',\n Asia_Dubai = 'Asia/Dubai',\n Asia_Dushanbe = 'Asia/Dushanbe',\n Asia_Famagusta = 'Asia/Famagusta',\n Asia_Gaza = 'Asia/Gaza',\n Asia_Hebron = 'Asia/Hebron',\n Asia_Ho_Chi_Minh = 'Asia/Ho_Chi_Minh',\n Asia_Hong_Kong = 'Asia/Hong_Kong',\n Asia_Hovd = 'Asia/Hovd',\n Asia_Irkutsk = 'Asia/Irkutsk',\n Asia_Jakarta = 'Asia/Jakarta',\n Asia_Jayapura = 'Asia/Jayapura',\n Asia_Jerusalem = 'Asia/Jerusalem',\n Asia_Kabul = 'Asia/Kabul',\n Asia_Kamchatka = 'Asia/Kamchatka',\n Asia_Karachi = 'Asia/Karachi',\n Asia_Kathmandu = 'Asia/Kathmandu',\n Asia_Khandyga = 'Asia/Khandyga',\n Asia_Kolkata = 'Asia/Kolkata',\n Asia_Krasnoyarsk = 'Asia/Krasnoyarsk',\n Asia_Kuching = 'Asia/Kuching',\n Asia_Macau = 'Asia/Macau',\n Asia_Magadan = 'Asia/Magadan',\n Asia_Makassar = 'Asia/Makassar',\n Asia_Manila = 'Asia/Manila',\n Asia_Nicosia = 'Asia/Nicosia',\n Asia_Novokuznetsk = 'Asia/Novokuznetsk',\n Asia_Novosibirsk = 'Asia/Novosibirsk',\n Asia_Omsk = 'Asia/Omsk',\n Asia_Oral = 'Asia/Oral',\n Asia_Pontianak = 'Asia/Pontianak',\n Asia_Pyongyang = 'Asia/Pyongyang',\n Asia_Qatar = 'Asia/Qatar',\n Asia_Qostanay = 'Asia/Qostanay',\n Asia_Qyzylorda = 'Asia/Qyzylorda',\n Asia_Riyadh = 'Asia/Riyadh',\n Asia_Sakhalin = 'Asia/Sakhalin',\n Asia_Samarkand = 'Asia/Samarkand',\n Asia_Seoul = 'Asia/Seoul',\n Asia_Shanghai = 'Asia/Shanghai',\n Asia_Singapore = 'Asia/Singapore',\n Asia_Srednekolymsk = 'Asia/Srednekolymsk',\n Asia_Taipei = 'Asia/Taipei',\n Asia_Tashkent = 'Asia/Tashkent',\n Asia_Tbilisi = 'Asia/Tbilisi',\n Asia_Tehran = 'Asia/Tehran',\n Asia_Thimphu = 'Asia/Thimphu',\n Asia_Tokyo = 'Asia/Tokyo',\n Asia_Tomsk = 'Asia/Tomsk',\n Asia_Ulaanbaatar = 'Asia/Ulaanbaatar',\n Asia_Urumqi = 'Asia/Urumqi',\n Asia_Ust_Nera = 'Asia/Ust-Nera',\n Asia_Vladivostok = 'Asia/Vladivostok',\n Asia_Yakutsk = 'Asia/Yakutsk',\n Asia_Yangon = 'Asia/Yangon',\n Asia_Yekaterinburg = 'Asia/Yekaterinburg',\n Asia_Yerevan = 'Asia/Yerevan',\n\n // Atlantic\n Atlantic_Azores = 'Atlantic/Azores',\n Atlantic_Bermuda = 'Atlantic/Bermuda',\n Atlantic_Canary = 'Atlantic/Canary',\n Atlantic_Cape_Verde = 'Atlantic/Cape_Verde',\n Atlantic_Faroe = 'Atlantic/Faroe',\n Atlantic_Madeira = 'Atlantic/Madeira',\n Atlantic_South_Georgia = 'Atlantic/South_Georgia',\n Atlantic_Stanley = 'Atlantic/Stanley',\n\n // Australia\n Australia_Adelaide = 'Australia/Adelaide',\n Australia_Brisbane = 'Australia/Brisbane',\n Australia_Broken_Hill = 'Australia/Broken_Hill',\n Australia_Darwin = 'Australia/Darwin',\n Australia_Eucla = 'Australia/Eucla',\n Australia_Hobart = 'Australia/Hobart',\n Australia_Lindeman = 'Australia/Lindeman',\n Australia_Lord_Howe = 'Australia/Lord_Howe',\n Australia_Melbourne = 'Australia/Melbourne',\n Australia_Perth = 'Australia/Perth',\n Australia_Sydney = 'Australia/Sydney',\n\n // Etc (Coordinated Universal Time offsets)\n Etc_GMT = 'Etc/GMT',\n Etc_GMT_Minus_1 = 'Etc/GMT-1',\n Etc_GMT_Minus_10 = 'Etc/GMT-10',\n Etc_GMT_Minus_11 = 'Etc/GMT-11',\n Etc_GMT_Minus_12 = 'Etc/GMT-12',\n Etc_GMT_Minus_13 = 'Etc/GMT-13',\n Etc_GMT_Minus_14 = 'Etc/GMT-14',\n Etc_GMT_Minus_2 = 'Etc/GMT-2',\n Etc_GMT_Minus_3 = 'Etc/GMT-3',\n Etc_GMT_Minus_4 = 'Etc/GMT-4',\n Etc_GMT_Minus_5 = 'Etc/GMT-5',\n Etc_GMT_Minus_6 = 'Etc/GMT-6',\n Etc_GMT_Minus_7 = 'Etc/GMT-7',\n Etc_GMT_Minus_8 = 'Etc/GMT-8',\n Etc_GMT_Minus_9 = 'Etc/GMT-9',\n Etc_GMT_Plus_1 = 'Etc/GMT+1',\n Etc_GMT_Plus_10 = 'Etc/GMT+10',\n Etc_GMT_Plus_11 = 'Etc/GMT+11',\n Etc_GMT_Plus_12 = 'Etc/GMT+12',\n Etc_GMT_Plus_2 = 'Etc/GMT+2',\n Etc_GMT_Plus_3 = 'Etc/GMT+3',\n Etc_GMT_Plus_4 = 'Etc/GMT+4',\n Etc_GMT_Plus_5 = 'Etc/GMT+5',\n Etc_GMT_Plus_6 = 'Etc/GMT+6',\n Etc_GMT_Plus_7 = 'Etc/GMT+7',\n Etc_GMT_Plus_8 = 'Etc/GMT+8',\n Etc_GMT_Plus_9 = 'Etc/GMT+9',\n Etc_UTC = 'Etc/UTC',\n\n // Europe\n Europe_Andorra = 'Europe/Andorra',\n Europe_Astrakhan = 'Europe/Astrakhan',\n Europe_Athens = 'Europe/Athens',\n Europe_Belgrade = 'Europe/Belgrade',\n Europe_Berlin = 'Europe/Berlin',\n Europe_Brussels = 'Europe/Brussels',\n Europe_Bucharest = 'Europe/Bucharest',\n Europe_Budapest = 'Europe/Budapest',\n Europe_Chisinau = 'Europe/Chisinau',\n Europe_Dublin = 'Europe/Dublin',\n Europe_Gibraltar = 'Europe/Gibraltar',\n Europe_Helsinki = 'Europe/Helsinki',\n Europe_Istanbul = 'Europe/Istanbul',\n Europe_Kaliningrad = 'Europe/Kaliningrad',\n Europe_Kirov = 'Europe/Kirov',\n Europe_Kyiv = 'Europe/Kyiv',\n Europe_Lisbon = 'Europe/Lisbon',\n Europe_London = 'Europe/London',\n Europe_Madrid = 'Europe/Madrid',\n Europe_Malta = 'Europe/Malta',\n Europe_Minsk = 'Europe/Minsk',\n Europe_Moscow = 'Europe/Moscow',\n Europe_Paris = 'Europe/Paris',\n Europe_Prague = 'Europe/Prague',\n Europe_Riga = 'Europe/Riga',\n Europe_Rome = 'Europe/Rome',\n Europe_Samara = 'Europe/Samara',\n Europe_Saratov = 'Europe/Saratov',\n Europe_Simferopol = 'Europe/Simferopol',\n Europe_Sofia = 'Europe/Sofia',\n Europe_Tallinn = 'Europe/Tallinn',\n Europe_Tirane = 'Europe/Tirane',\n Europe_Ulyanovsk = 'Europe/Ulyanovsk',\n Europe_Vienna = 'Europe/Vienna',\n Europe_Vilnius = 'Europe/Vilnius',\n Europe_Volgograd = 'Europe/Volgograd',\n Europe_Warsaw = 'Europe/Warsaw',\n Europe_Zurich = 'Europe/Zurich',\n\n // Indian\n Indian_Chagos = 'Indian/Chagos',\n Indian_Maldives = 'Indian/Maldives',\n Indian_Mauritius = 'Indian/Mauritius',\n\n // Pacific\n Pacific_Apia = 'Pacific/Apia',\n Pacific_Auckland = 'Pacific/Auckland',\n Pacific_Bougainville = 'Pacific/Bougainville',\n Pacific_Chatham = 'Pacific/Chatham',\n Pacific_Easter = 'Pacific/Easter',\n Pacific_Efate = 'Pacific/Efate',\n Pacific_Fakaofo = 'Pacific/Fakaofo',\n Pacific_Fiji = 'Pacific/Fiji',\n Pacific_Galapagos = 'Pacific/Galapagos',\n Pacific_Gambier = 'Pacific/Gambier',\n Pacific_Guadalcanal = 'Pacific/Guadalcanal',\n Pacific_Guam = 'Pacific/Guam',\n Pacific_Honolulu = 'Pacific/Honolulu',\n Pacific_Kanton = 'Pacific/Kanton',\n Pacific_Kiritimati = 'Pacific/Kiritimati',\n Pacific_Kosrae = 'Pacific/Kosrae',\n Pacific_Kwajalein = 'Pacific/Kwajalein',\n Pacific_Marquesas = 'Pacific/Marquesas',\n Pacific_Nauru = 'Pacific/Nauru',\n Pacific_Niue = 'Pacific/Niue',\n Pacific_Norfolk = 'Pacific/Norfolk',\n Pacific_Noumea = 'Pacific/Noumea',\n Pacific_Pago_Pago = 'Pacific/Pago_Pago',\n Pacific_Palau = 'Pacific/Palau',\n Pacific_Pitcairn = 'Pacific/Pitcairn',\n Pacific_Port_Moresby = 'Pacific/Port_Moresby',\n Pacific_Rarotonga = 'Pacific/Rarotonga',\n Pacific_Tahiti = 'Pacific/Tahiti',\n Pacific_Tarawa = 'Pacific/Tarawa',\n Pacific_Tongatapu = 'Pacific/Tongatapu',\n}\n","// eslint-disable-next-line no-shadow\nexport enum HubriseEventType {\n CREATE = 'create',\n DELETE = 'delete',\n PATCH = 'patch',\n UPDATE = 'update'\n}\n","// eslint-disable-next-line no-shadow\nexport enum HubriseResourceType {\n CATALOG = 'catalog',\n CUSTOMER = 'customer',\n DELIVERY = 'delivery',\n INVENTORY = 'inventory',\n LOCATION = 'location',\n ORDER = 'order'\n}\n","/* eslint-disable no-shadow */\n// Doc: https://www.hubrise.com/fr/developers/api/order-management/#order-status\nexport enum HubriseOrderStatus {\n new = 'new',\n received = 'received',\n accepted = 'accepted',\n in_preparation = 'in_preparation',\n awaiting_shipment = 'awaiting_shipment',\n awaiting_collection = 'awaiting_collection',\n in_delivery = 'in_delivery',\n completed = 'completed',\n\n rejected = 'rejected',\n cancelled = 'cancelled',\n delivery_failed = 'delivery_failed'\n}\n","/* eslint-disable no-shadow */\nexport enum HubriseServiceType {\n DELIVERY = 'delivery',\n COLLECTION = 'collection', // = pickup\n EAT_IN = 'eat_in'\n}\n","import axios from 'axios';\nimport {HubriseApiContract} from 'common/api/hubrise/service/HubriseApiContract';\nimport {HubriseOrderContract} from 'common/api/hubrise/model/order/HubriseOrderContract';\nimport {HubriseOrderStatus} from 'common/api/hubrise/model/order/HubriseOrderStatus';\nimport {HubriseMenuCatalogContract} from 'common/api/hubrise/model/menu/HubriseMenuCatalogContract';\nimport {ExternalApiException} from 'common/exception/ExternalApiException';\nimport {Logger} from 'common/tool/Logger';\nimport {Retry} from 'common/tool/Retry';\nimport {HubriseCustomerContract} from 'common/api/hubrise/model/customer/HubriseCustomerContract';\nimport {HubriseCustomerListContract} from 'common/api/hubrise/model/customer/HubriseCustomerListContract';\nimport {HubriseLocationContract} from 'common/api/hubrise/model/location/HubriseLocationContract';\nimport {HubriseUserContract} from 'common/api/hubrise/model/user/HubriseUserContract';\nimport * as querystring from 'querystring';\nimport {HubriseAuthContract} from 'common/api/hubrise/model/auth/HubriseAuthContract';\nimport {HubriseResourceType} from 'common/api/hubrise/model/callback/HubriseResourceType';\nimport {HubriseEventType} from 'common/api/hubrise/model/callback/HubriseEventType';\nimport {HubriseAuthResource} from 'common/api/hubrise/model/auth/HubriseAuthResource';\nimport {HubriseRightAccess} from 'common/api/hubrise/model/auth/HubriseRightAccess';\nimport {ValidatorUtil} from 'common/util/ValidatorUtil';\nimport {HubriseAccountContract} from 'common/api/hubrise/model/account/HubriseAccountContract';\nimport {HubriseAccessTokenContract} from 'common/api/hubrise/model/auth/HubriseAccessTokenContract';\nimport {HubriseAccessLevel} from 'common/api/hubrise/model/auth/HubriseAccessLevel';\nimport {BadParameterException} from 'common/exception/BadParameterException';\n\nexport class HubriseApi implements HubriseApiContract {\n public static readonly BASE_URL: string = 'http://api.hubrise.com/v1/';\n public static readonly BASE_AUTH_URL: string = 'https://manager.hubrise.com/oauth2/v1/';\n private static readonly TIMEOUT: number = 15000;\n private readonly accessToken: HubriseAccessTokenContract;\n\n public constructor(accessToken?: HubriseAccessTokenContract) {\n this.accessToken = accessToken;\n }\n\n public async authorize(name: string, clientId: string, redirect: string, accessLevel: HubriseAccessLevel, rights?: Record<HubriseAuthResource, HubriseRightAccess>,\n profile: boolean = false, appInstanceId?: string): Promise<string> {\n return HubriseApi.BASE_AUTH_URL + 'authorize?' +\n (name !== undefined ? 'name=' + String(name) + '&' : '') +\n 'redirect_uri=' + encodeURIComponent(redirect + '&accessLevel=' + String(accessLevel || HubriseAccessLevel.LOCATION)) + '&' +\n 'client_id=' + clientId + '&' +\n 'scope=' + ([HubriseAccessLevel.ACCOUNT, HubriseAccessLevel.LOCATION].includes(accessLevel) ? String(accessLevel)\n + '[' + String(Object.keys(rights).reduce((results, key) => results.concat(key + '.' + String((rights as any)[key])), []).join(',')) + ']' : '')\n + ([HubriseAccessLevel.ACCOUNT, HubriseAccessLevel.LOCATION].includes(accessLevel) && (accessLevel === HubriseAccessLevel.PROFILE || profile) ? ',' : '')\n + (accessLevel === HubriseAccessLevel.PROFILE || profile ? 'profile_with_email' : '') + '&'\n + (appInstanceId === undefined ? '' : 'app_instance_id=' + String(appInstanceId));\n }\n\n public async getToken(clientId: string, clientSecret: string, code: string): Promise<HubriseAuthContract> {\n let auth: HubriseAuthContract;\n await Retry.request(async () => {\n const response: any = await axios.post(HubriseApi.BASE_AUTH_URL + 'token', querystring.stringify({\n code: code,\n client_id: clientId,\n client_secret: clientSecret\n }), {\n headers: {'Content-Type': 'application/x-www-form-urlencoded'},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to get hubrise token');\n }\n\n auth = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return auth;\n }\n\n public async getUser(): Promise<HubriseUserContract> {\n let hubriseUser: HubriseUserContract;\n await Retry.request(async () => {\n const response: any = await axios.get(HubriseApi.BASE_URL + 'user', {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to retrieve hubrise user');\n }\n\n hubriseUser = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return hubriseUser;\n }\n\n public async getAccount(): Promise<HubriseAccountContract> {\n if (this.accessToken.access === HubriseAccessLevel.LOCATION) {\n const location: HubriseLocationContract = await this.getLocation();\n\n return location.account;\n }\n\n let hubriseAccount: HubriseAccountContract;\n await Retry.request(async () => {\n const response: any = await axios.get(HubriseApi.BASE_URL + 'account', {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to retrieve hubrise account');\n }\n\n hubriseAccount = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return hubriseAccount;\n }\n\n public async getLocations(): Promise<HubriseLocationContract[]> {\n if (this.accessToken.access === HubriseAccessLevel.LOCATION) {\n return [await this.getLocation()];\n }\n\n let hubriseLocations: HubriseLocationContract[];\n await Retry.request(async () => {\n const response: any = await axios.get(HubriseApi.BASE_URL + 'locations', {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to retrieve hubrise locations');\n }\n\n hubriseLocations = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return hubriseLocations;\n }\n\n public async getLocation(hubriseLocationId?: string): Promise<HubriseLocationContract> {\n let hubriseLocation: HubriseLocationContract;\n await Retry.request(async () => {\n const url: string = this.accessToken.access === HubriseAccessLevel.ACCOUNT ? 'locations/' + String(hubriseLocationId) : 'location';\n const response: any = await axios.get(HubriseApi.BASE_URL + url, {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to retrieve hubrise location');\n }\n\n hubriseLocation = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return hubriseLocation;\n }\n\n public async createCustomer(hubriseCustomerListId: string, hubriseCustomer: HubriseCustomerContract): Promise<HubriseCustomerContract> {\n let createdCustomer: HubriseCustomerContract;\n await Retry.request(async () => {\n const response: any = await axios.post(HubriseApi.BASE_URL + 'customer_lists/' + String(hubriseCustomerListId) + '/customers', hubriseCustomer, {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to create hubrise customer');\n }\n\n createdCustomer = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return createdCustomer;\n }\n\n public async updateCustomer(hubriseCustomerListId: string, hubriseCustomer: HubriseCustomerContract): Promise<HubriseCustomerContract> {\n if (typeof hubriseCustomer.id !== 'string') {\n throw new BadParameterException('missing customer id', {customer: hubriseCustomer});\n }\n\n let createdCustomer: HubriseCustomerContract;\n await Retry.request(async () => {\n const response: any = await axios.put(HubriseApi.BASE_URL + 'customer_lists/' + String(hubriseCustomerListId) + '/customers/' + String(hubriseCustomer.id), hubriseCustomer, {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to update hubrise customer');\n }\n\n createdCustomer = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return createdCustomer;\n }\n\n public async getCustomer(hubriseCustomerListId: string, hubriseCustomerId: string): Promise<HubriseCustomerContract> {\n let hubriseCustomer: HubriseCustomerContract;\n await Retry.request(async () => {\n const response: any = await axios.get(HubriseApi.BASE_URL + 'customer_lists/' + String(hubriseCustomerListId) + '/customers/' + String(hubriseCustomerId), {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to retrieve hubrise customer');\n }\n\n hubriseCustomer = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return hubriseCustomer;\n }\n\n public async getCustomers(hubriseCustomerListId: string, reference?: string, email?: string, phone?: string): Promise<HubriseCustomerContract[]> {\n const parameters: URLSearchParams = new URLSearchParams();\n if (typeof reference === 'string') {\n parameters.append('private_ref', reference);\n }\n if (typeof email === 'string') {\n parameters.append('email', email + '*');\n }\n if (typeof phone === 'string') {\n parameters.append('phone', phone + '*');\n }\n\n let hubriseCustomers: HubriseCustomerContract[];\n await Retry.request(async () => {\n const response: any = await axios.get(HubriseApi.BASE_URL + 'customer_lists/' + String(hubriseCustomerListId) + '/customers?' + parameters.toString(), {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to retrieve hubrise customers');\n }\n\n hubriseCustomers = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return hubriseCustomers;\n }\n\n public async getCustomerLists(hubriseLocationId: string): Promise<HubriseCustomerListContract[]> {\n let hubriseCustomerLists: HubriseCustomerListContract[];\n await Retry.request(async () => {\n const response: any = await axios.get(HubriseApi.BASE_URL + 'locations/' + String(hubriseLocationId) + '/customer_lists', {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to retrieve hubrise customer lists');\n }\n\n hubriseCustomerLists = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return hubriseCustomerLists;\n }\n\n public async createOrder(hubriseLocationId: string, hubriseOrder: HubriseOrderContract): Promise<HubriseOrderContract> {\n let createdOrder: HubriseOrderContract;\n await Retry.request(async () => {\n const response: any = await axios.post(HubriseApi.BASE_URL + 'locations/' + String(hubriseLocationId) + '/orders', hubriseOrder, {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to create hubrise order');\n }\n\n createdOrder = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return createdOrder;\n }\n\n public async getOrder(hubriseLocationId: string, hubriseOrderId: string): Promise<HubriseOrderContract> {\n let hubriseOrder: HubriseOrderContract;\n await Retry.request(async () => {\n const response: any = await axios.get(HubriseApi.BASE_URL + 'locations/' + String(hubriseLocationId) + '/orders/' + String(hubriseOrderId), {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to retrieve hubrise order');\n }\n\n hubriseOrder = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return hubriseOrder;\n }\n\n public async getOrders(hubriseLocationId: string, startDate?: string, endDate?: string, limit: number = 30): Promise<HubriseOrderContract[]> {\n let hubriseOrders: HubriseOrderContract[] = [];\n\n const queryParams = new URLSearchParams();\n queryParams.append('count', String(limit));\n if (ValidatorUtil.isISODate(startDate)) {\n queryParams.append('after', startDate);\n }\n if (ValidatorUtil.isISODate(endDate)) {\n queryParams.append('before', endDate);\n }\n await Retry.request(async () => {\n const response: any = await axios.get(HubriseApi.BASE_URL + 'locations/' + String(hubriseLocationId) + '/orders?' + queryParams.toString(), {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to retrieve hubrise orders');\n }\n\n hubriseOrders = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return hubriseOrders.sort((a, b) => a.created_at.localeCompare(b.created_at));\n }\n\n public async setOrderStatus(hubriseLocationId: string, hubriseOrderId: string, status: HubriseOrderStatus): Promise<void> {\n await Retry.request(async () => {\n const response: any = await axios.patch(HubriseApi.BASE_URL + 'locations/' + String(hubriseLocationId) + '/orders/' + String(hubriseOrderId), {\n status: status\n }, {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to update hubrise order status');\n }\n }, 1, Logger.error.bind(Logger));\n }\n\n public async getCatalog(hubriseCatalogId: string): Promise<HubriseMenuCatalogContract> {\n let catalog: HubriseMenuCatalogContract;\n await Retry.request(async () => {\n const response: any = await axios.get(HubriseApi.BASE_URL + 'catalogs/' + String(hubriseCatalogId), {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to retrieve hubrise catalogs');\n }\n\n catalog = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return catalog;\n }\n\n public async getCatalogs(hubriseLocationId: string): Promise<HubriseMenuCatalogContract[]> {\n let catalogs: HubriseMenuCatalogContract[] = [];\n await Retry.request(async () => {\n const response: any = await axios.get(HubriseApi.BASE_URL + 'locations/' + String(hubriseLocationId) + '/catalogs', {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to retrieve hubrise catalogs');\n }\n\n catalogs = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return catalogs;\n }\n\n public async createWebhook(url: string, events: Record<HubriseResourceType, HubriseEventType[]>): Promise<void> {\n await Retry.request(async () => {\n const response: any = await axios.post(HubriseApi.BASE_URL + '/callback', {\n url: url,\n events: events\n }, {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to create hubrise webhook');\n }\n }, 1, Logger.error.bind(Logger));\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"lodash\");","import {isArray, isObject} from 'lodash';\n\nexport class ObjectUtil {\n public static compact(obj: any, options: { removeEmptyString?: boolean } = {}): any {\n if (isArray(obj)) {\n const ouput: any[] = [];\n obj.forEach((value) => {\n value = ObjectUtil.compact(value, options);\n if ((isArray(value) && value.length > 0)\n || (isObject(value) && Object.keys(value).length > 0)\n || (value !== undefined && value !== null && !isArray(value) && !isObject(value))) {\n ouput.push(value);\n }\n });\n\n return ouput;\n } else if (isObject(obj)) {\n const ouput: any = {};\n Object.keys(obj).forEach((key) => {\n let value: any = (obj as any)[key];\n if (isArray(value) || isObject(value)) {\n value = ObjectUtil.compact(value, options);\n if ((isArray(value) && value.length > 0)\n || (isObject(value) && Object.keys(value).length > 0)\n || (value !== undefined && value !== null && !isArray(value) && !isObject(value))) {\n ouput[key] = value;\n }\n } else if (value !== undefined && value !== null\n && (typeof value !== 'string' || options.removeEmptyString === false || value.length > 0)) {\n ouput[key] = value;\n }\n });\n\n return ouput;\n }\n\n return (typeof obj !== 'string' || options.removeEmptyString === false || obj.length > 0) ? obj : undefined;\n }\n\n public static update(source: Record<string, unknown>, target: Record<string, unknown>): void {\n if (typeof source !== 'object' || source === null || typeof target !== 'object' || target === null) {\n return;\n }\n\n // eslint-disable-next-line no-restricted-syntax\n for (const key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n delete source[key]\n }\n }\n Object.assign(source, target)\n }\n}\n","import {HubriseCatalogConverterContract} from 'common/api/hubrise/service/HubriseCatalogConverterContract';\nimport {HubriseMenuCatalogContract} from 'common/api/hubrise/model/menu/HubriseMenuCatalogContract';\nimport {HubriseMenuProductContract} from 'common/api/hubrise/model/menu/HubriseMenuProductContract';\nimport {HubriseMenuCategoryContract} from 'common/api/hubrise/model/menu/HubriseMenuCategoryContract';\nimport {HubriseOrderEditableItemContract} from 'common/api/hubrise/model/order/HubriseOrderEditableItemContract';\nimport {HubriseOrderEditableOptionContract} from 'common/api/hubrise/model/order/HubriseOrderEditableOptionContract';\nimport {HubriseMenuProductOptionListContract} from 'common/api/hubrise/model/menu/HubriseMenuProductOptionListContract';\nimport {isNullOrUndefined} from 'common/util/HelperUtil';\nimport {HubriseMenuProductOptionContract} from 'common/api/hubrise/model/menu/HubriseMenuProductOptionContract';\nimport {ObjectUtil} from 'common/util/ObjectUtil';\n\nexport class HubriseCatalogConverter implements HubriseCatalogConverterContract {\n public editableItems(catalog: HubriseMenuCatalogContract): { withRef: HubriseOrderEditableItemContract[], withName: HubriseOrderEditableItemContract[] } {\n if (!Array.isArray(catalog?.data?.products)) {\n return {withRef: [], withName: []};\n }\n\n const categories: Record<string, string> = {};\n if (Array.isArray(catalog.data.categories)) {\n catalog.data.categories.forEach((category: HubriseMenuCategoryContract) => {\n categories[category.id] = category.name;\n })\n }\n const items: HubriseOrderEditableItemContract[] = [];\n catalog.data.products.forEach((p: HubriseMenuProductContract) => {\n p.skus.forEach(sku => {\n items.push(ObjectUtil.compact({\n id: sku.id,\n sku_ref: sku.ref ?? undefined,\n category_name: categories[p.category_id],\n product_name: [p.name, sku.name].filter(part => part !== null).join(' - '),\n quantity: '1',\n tax_rate: p.tax_rate ?? undefined,\n price: sku.price\n }));\n });\n\n // const reference: string | null | undefined = p.ref ??\n // (p.skus?.length === 1 && (!Array.isArray(p.skus[0].option_list_ids) || p.skus[0].option_list_ids.length === 0) ? p.skus[0].ref : null);\n // const price: string | null = p.skus?.length === 1 && (!Array.isArray(p.skus[0].option_list_ids) || p.skus[0].option_list_ids.length === 0)\n // ? p.skus[0].price : HubrisePriceUtil.multiply(p.skus[0].price, 0);\n //\n // return {id: p.id, sku_ref: reference, category_name: categories[p.category_id], product_name: p.name, quantity: '1', tax_rate: p.tax_rate, price};\n })\n items.sort((a: HubriseOrderEditableItemContract, b: HubriseOrderEditableItemContract) =>\n a.category_name?.localeCompare(b.category_name ?? '') || a.product_name?.localeCompare(b.product_name ?? ''))\n\n return {withRef: items.filter(i => !isNullOrUndefined(i.sku_ref)), withName: items};\n }\n\n public editableItemOptions(catalog: HubriseMenuCatalogContract): {\n withRef: Record<string, HubriseOrderEditableOptionContract[]>,\n withName: Record<string, HubriseOrderEditableOptionContract[]>\n } {\n if (!Array.isArray(catalog?.data?.products)) {\n return {withRef: {}, withName: {}};\n }\n\n const optionLists: Record<string, HubriseMenuProductOptionListContract> = {}\n if (Array.isArray(catalog.data.option_lists)) {\n catalog.data.option_lists.forEach((o: any) => {\n optionLists[o.id] = o;\n });\n }\n\n const editableItemOptionNames: Record<string, HubriseOrderEditableOptionContract[]> = {};\n catalog.data.products.forEach((p: HubriseMenuProductContract) => {\n p.skus.forEach(sku => {\n if (Array.isArray(sku.option_list_ids) && sku.option_list_ids.length > 0) {\n editableItemOptionNames[sku.id] = [];\n sku.option_list_ids.forEach((optionListId: string) => {\n const optionList: HubriseMenuProductOptionListContract = optionLists[optionListId]\n if (optionList === undefined)\n return // TODO log\n\n if (!Array.isArray(optionList.options) || optionList.options.length === 0)\n return // TODO log\n\n optionList.options.forEach((option: HubriseMenuProductOptionContract) => {\n editableItemOptionNames[sku.id].push(ObjectUtil.compact({\n id: String(option.id),\n ref: option.ref ?? optionList.ref ?? null,\n option_list_name: optionList.name,\n name: option.name,\n quantity: 1,\n price: option.price\n }));\n });\n });\n editableItemOptionNames[sku.id].sort((a: HubriseOrderEditableOptionContract, b: HubriseOrderEditableOptionContract) =>\n a.option_list_name?.localeCompare(b.option_list_name ?? '') || a.name?.localeCompare(b.name ?? ''));\n }\n });\n\n\n // editableItemOptionNames[p.id] = []\n // if (!Array.isArray(p.skus) || p.skus.length === 0 || !Array.isArray(p.skus[0].option_list_ids) || p.skus[0].option_list_ids.length === 0)\n // return\n //\n // p.skus.forEach((sku: any) => {\n // if (Array.isArray(sku.option_list_ids) && sku.option_list_ids.length > 0) {\n // sku.option_list_ids.forEach((optionListId: any) => {\n // const optionList: any = optionLists[optionListId]\n // if (optionList === undefined)\n // return // TODO log\n //\n // if (!Array.isArray(optionList.options) || optionList.options.length === 0)\n // return // TODO log\n //\n // optionList.options.forEach((option: any) => {\n // const price: string = HubrisePriceUtil.sum([sku.price ?? null, option.price ?? null])\n //\n // editableItemOptionNames[p.id].push({\n // id: String(sku.id) + '-' + String(optionList.id) + '-' + String(option.id),\n // ref: option.ref ?? null,\n // option_list_name: optionList.name,\n // name: option.name,\n // quantity: 1,\n // price\n // })\n // })\n // })\n // } else {\n // const price: string = sku.price ?? null\n //\n // editableItemOptionNames[p.id].push({id: sku.id, ref: sku.ref ?? null, option_list_name: '', name: sku.name, quantity: 1, price});\n // }\n // })\n // editableItemOptionNames[p.id].sort(\n // (a: HubriseOrderEditableOptionContract, b: HubriseOrderEditableOptionContract) => a.name?.localeCompare(b.name ?? ''))\n });\n\n const editableItemOptionRefs: Record<string, HubriseOrderEditableOptionContract[]> = {}\n Object.keys(editableItemOptionNames).forEach(itemId => {\n editableItemOptionRefs[itemId] = editableItemOptionNames[itemId]?.filter(o => !isNullOrUndefined(o.ref)) ?? [];\n });\n\n return {\n withRef: editableItemOptionRefs,\n withName: editableItemOptionNames\n };\n }\n}\n","import {HubriseOrderConverterContract} from 'common/api/hubrise/service/HubriseOrderConverterContract';\nimport {HubriseOrderItemContract} from 'common/api/hubrise/model/order/HubriseOrderItemContract';\nimport {HubriseOrderEditableItemContract} from 'common/api/hubrise/model/order/HubriseOrderEditableItemContract';\nimport {HubriseOrderOptionContract} from 'common/api/hubrise/model/order/HubriseOrderOptionContract';\nimport {HubriseServiceType} from 'common/api/hubrise/model/order/HubriseServiceType';\nimport {ObjectUtil} from 'common/util/ObjectUtil';\n\nexport class HubriseOrderConverter implements HubriseOrderConverterContract {\n public items(editableItems: HubriseOrderEditableItemContract[], serviceType: HubriseServiceType): HubriseOrderItemContract[] {\n if (!Array.isArray(editableItems)) {\n return [];\n }\n\n return editableItems.map((editableItem: HubriseOrderEditableItemContract) => {\n const options: HubriseOrderOptionContract[] = [];\n if (Array.isArray(editableItem.options)) {\n editableItem.options.forEach((editableOption: HubriseOrderOptionContract) => {\n options.push({\n ref: editableOption.ref,\n option_list_name: editableOption.option_list_name,\n name: editableOption.name,\n quantity: Number(editableOption.quantity ?? 1),\n price: editableOption.price\n });\n });\n }\n\n return ObjectUtil.compact({\n sku_ref: editableItem.sku_ref,\n sku_name: editableItem.sku_name,\n product_name: editableItem.product_name,\n quantity: String(editableItem.quantity ?? '1'),\n price: editableItem.price,\n subtotal: '', // TODO multiply quantity + sum options\n tax_rate: serviceType === undefined || editableItem.tax_rate === undefined || editableItem.tax_rate === null ? undefined : editableItem.tax_rate[serviceType],\n customer_notes: editableItem.customer_notes,\n options: options\n });\n });\n }\n}\n","export class MathUtil {\n public static sum(values: number[]): number {\n if (values.length === 0) {\n return 0;\n }\n\n return values.reduce((accumulator, value) => accumulator + value, 0);\n }\n\n\n public static avg(values: number[]): number {\n const total: number = MathUtil.sum(values);\n if (total === 0) {\n return 0;\n }\n\n return MathUtil.round(total / values.length, 2);\n }\n\n public static applyVariation(value: number, variation: number): number {\n let increase: number;\n if (value >= 0) {\n increase = 1 + (variation / 100);\n } else {\n increase = 1 - (variation / 100);\n }\n\n return value * increase;\n }\n\n public static median(values: number[]): number {\n if (values.length === 0) {\n return 0;\n }\n if (values.length === 1) {\n return values[0];\n }\n\n const valuesSorted: number[] = values.sort((a, b) => {\n return a - b;\n });\n\n if (valuesSorted.length % 2 === 0) {\n return MathUtil.avg([valuesSorted[(valuesSorted.length / 2) - 1], valuesSorted[(valuesSorted.length / 2)]]);\n }\n\n return valuesSorted[Math.floor(valuesSorted.length / 2)];\n }\n\n public static percentage(part: number, total: number): number {\n if (typeof part !== 'number' || typeof total !== 'number') {\n return undefined;\n }\n\n if (total === 0) {\n return 0;\n }\n\n return ((part / total) * 100);\n }\n\n public static round(value: number, decimals: number): number {\n if (typeof value !== 'number') {\n return value;\n }\n\n if (decimals === 0) {\n return Math.round(value);\n }\n\n return Math.round(value * (10 ** decimals)) / (10 ** decimals);\n }\n\n public static variation(originalValue: number, newValue: number): number {\n let percent = 0;\n if (newValue !== 0) {\n if (originalValue !== 0) {\n percent = (newValue - originalValue) / Math.abs(originalValue) * 100;\n } else {\n percent = ((newValue > 0) ? 1 : -1) * 100;\n }\n } else if (originalValue !== 0) {\n percent = ((originalValue > 0) ? 1 : -1) * -100;\n }\n\n return Math.floor(percent);\n }\n}\n","import {HubriseCurrencyCode} from 'common/api/hubrise/model/common/HubriseCurrencyCode';\nimport {isNullOrUndefined} from 'common/util/HelperUtil';\nimport {MathUtil} from 'common/util/MathUtil';\n\nexport class HubrisePriceUtil {\n public static sum(prices: string[], defaultCurrency: HubriseCurrencyCode = HubriseCurrencyCode.EUR): string {\n if (!Array.isArray(prices) || prices.length === 0) {\n return '0.00 ' + String(defaultCurrency);\n }\n if (prices.length === 1) {\n return prices[0];\n }\n const results: { amount: number, currency: HubriseCurrencyCode }[] = prices.map(price => HubrisePriceUtil.priceToAmount(price)).filter(result => result !== undefined);\n if (results.length === 0) {\n return '0.00 ' + String(defaultCurrency);\n }\n\n const total: number = MathUtil.sum(results.map(result => result.amount));\n\n return HubrisePriceUtil.amountToPrice(total, results[0].currency ?? defaultCurrency);\n }\n\n public static multiply(price: string, multiplier: number): string {\n if (isNullOrUndefined(price) || isNullOrUndefined(multiplier)) {\n return undefined;\n }\n if (multiplier === 1) {\n return price;\n }\n\n const result: { amount: number, currency: HubriseCurrencyCode } = HubrisePriceUtil.priceToAmount(price);\n if (result === undefined) {\n return undefined;\n }\n\n return HubrisePriceUtil.amountToPrice(result.amount * multiplier, result.currency);\n }\n\n public static priceToAmount(price: string): { amount: number, currency: HubriseCurrencyCode } {\n if (isNullOrUndefined(price)) {\n return undefined;\n }\n\n const parts: string[] = price.split(' ');\n if (parts.length !== 2) {\n return undefined;\n }\n\n return {amount: Number(parts.slice(0, parts.length - 1).join('')), currency: parts[parts.length - 1] as HubriseCurrencyCode};\n }\n\n public static amountToPrice(amount: number, currency: HubriseCurrencyCode): string {\n return String(MathUtil.round(amount, 2).toFixed(2)) + ' ' + String(currency);\n }\n\n // public calculateTotalTaxIncluded(items: Api.HubriseOrderItemContract[], defaultCurrency: Api.HubriseCurrencyCode): string {\n // if (!Array.isArray(items)) {\n // return undefined;\n // }\n //\n // const total: number = Util.MathUtil.sum(items.map(item => {\n // return this.parseHubriseAmount(item.price) + Util.MathUtil.sum((item.options || []).map(option => this.parseHubriseAmount(option.price)));\n // }));\n // const currency: Api.HubriseCurrencyCode = this.parseHubriseCurrency(items, defaultCurrency);\n //\n // return this.displayHubriseAmount(total, currency);\n // }\n //\n // private parseHubriseCurrency(items: Api.HubriseOrderItemContract[], defaultCurrency: Api.HubriseCurrencyCode): Api.HubriseCurrencyCode {\n // let currency: Api.HubriseCurrencyCode = defaultCurrency ?? Api.HubriseCurrencyCode.EUR;\n // if (items.length > 0) {\n // const amount: string = items[0].price;\n // const currencyParsed: string = amount.substring(amount.indexOf(' ') + 1).trim();\n // if (currencyParsed.length === 3) {\n // currency = currencyParsed as Api.HubriseCurrencyCode;\n // }\n // }\n //\n // return currency;\n // }\n}\n","import {TotalHubriseCalculatorContract} from 'common/api/hubrise/service/TotalHubriseCalculatorContract';\nimport {HubriseOrderItemContract} from 'common/api/hubrise/model/order/HubriseOrderItemContract';\nimport {HubriseCurrencyCode} from 'common/api/hubrise/model/common/HubriseCurrencyCode';\nimport {HubrisePriceUtil} from 'common/api/hubrise/util/HubrisePriceUtil';\nimport {HubriseOrderOptionContract} from 'common/api/hubrise/model/order/HubriseOrderOptionContract';\nimport {HubriseOrderContract} from 'common/api/hubrise/model/order/HubriseOrderContract';\n\nexport class TotalHubriseCalculator implements TotalHubriseCalculatorContract {\n public calculateTotals(order: HubriseOrderContract, defaultCurrency: HubriseCurrencyCode):\n { subtotal: string, minimumOrderFee: string, deliveryFee: string, totalDiscount: string, total: string } {\n if (!Array.isArray(order.items)) {\n return undefined;\n }\n\n const currency: HubriseCurrencyCode = this.findCurrency(order.items, defaultCurrency);\n const subtotal: string = HubrisePriceUtil.sum(order.items.map(item => {\n return HubrisePriceUtil.sum([HubrisePriceUtil.multiply(item.price, Number(item.quantity))].concat(\n HubrisePriceUtil.sum((item.options || []).map(option => {\n return HubrisePriceUtil.multiply(option.price, Number(option.quantity));\n }))\n ));\n }));\n const minimumOrderFee: string = '0.00 ' + String(currency);\n const deliveryFee: string = '0.00 ' + String(currency);\n const totalDiscount: string = '0.00 ' + String(currency);\n const total: string = HubrisePriceUtil.sum([subtotal, minimumOrderFee, deliveryFee, HubrisePriceUtil.multiply(totalDiscount, -1)]);\n\n return {subtotal, minimumOrderFee, deliveryFee, totalDiscount, total: total};\n }\n\n private findCurrency(itemOrOptions: HubriseOrderItemContract[] | HubriseOrderOptionContract[], defaultCurrency: HubriseCurrencyCode): HubriseCurrencyCode {\n return itemOrOptions.reduce((c, i) => {\n const result: { amount: number, currency: HubriseCurrencyCode } = HubrisePriceUtil.priceToAmount(i.price);\n if (typeof result?.currency === 'string' && result.currency !== c) {\n return result.currency;\n }\n if ('options' in i && Array.isArray(i.options)) {\n return this.findCurrency(i.options, c);\n }\n\n return c;\n }, defaultCurrency);\n }\n}\n","export class Path {\n private static BASE_PATH: string = './';\n\n public static registerBasePath(basePath: string): void {\n if (process.env.APP_HOME !== undefined) {\n Path.BASE_PATH = process.env.APP_HOME + '/';\n } else {\n Path.BASE_PATH = basePath + (basePath.endsWith('/') ? '' : '/');\n }\n }\n\n public static data(): string {\n return Path.BASE_PATH + 'data/';\n }\n\n public static db(): string {\n return Path.storage() + 'db/';\n }\n\n public static root(): string {\n return Path.BASE_PATH;\n }\n\n public static session(): string {\n return Path.storage() + 'session/';\n }\n\n public static storage(): string {\n return Path.BASE_PATH + 'storage/';\n }\n}\n","import {MainException} from 'common/exception/MainException';\nimport {ExceptionContract} from 'common/exception/ExceptionContract';\n\nexport class BadRequestException extends MainException implements ExceptionContract {\n public constructor(message: string, data?: {[key: string]: any}) {\n super(message, 400, data);\n this.name = 'BadRequestException';\n }\n}\n","import {MainException} from 'common/exception/MainException';\nimport {ExceptionContract} from 'common/exception/ExceptionContract';\n\nexport class ConflictException extends MainException implements ExceptionContract {\n public constructor(message: string, data?: {[key: string]: any}) {\n super(message, 409, data);\n this.name = 'ConflictException';\n }\n}\n","import {MainException} from 'common/exception/MainException';\nimport {ExceptionContract} from 'common/exception/ExceptionContract';\n\nexport class DuplicateException extends MainException implements ExceptionContract {\n public constructor(message: string, data?: {[key: string]: any}) {\n super(message, 409, data);\n this.name = 'DuplicateException';\n }\n}\n","import {MainException} from 'common/exception/MainException';\nimport {ExceptionContract} from 'common/exception/ExceptionContract';\n\nexport class InternalException extends MainException implements ExceptionContract {\n public constructor(message: string, data?: {[key: string]: any}) {\n super(message, 500, data);\n this.name = 'InternalException';\n }\n}\n","import {MainException} from 'common/exception/MainException';\nimport {ExceptionContract} from 'common/exception/ExceptionContract';\n\nexport class NotImplementedException extends MainException implements ExceptionContract {\n public constructor(message: string, data?: {[key: string]: any}) {\n super(message, 501, data);\n this.name = 'NotImplementedException';\n }\n}\n","import {MainException} from 'common/exception/MainException';\nimport {ExceptionContract} from 'common/exception/ExceptionContract';\n\nexport class ObjectNotFoundException extends MainException implements ExceptionContract {\n public constructor(message: string, data?: {[key: string]: any}) {\n super(message, 404, data);\n this.name = 'ObjectNotFoundException';\n }\n}\n","import {MainException} from 'common/exception/MainException';\nimport {ExceptionContract} from 'common/exception/ExceptionContract';\n\nexport class PageNotFoundException extends MainException implements ExceptionContract {\n public constructor(message: string, data?: {[key: string]: any}) {\n super(message, 404, data);\n this.name = 'PageNotFoundException';\n }\n}\n","import * as express from 'express';\nimport {Logger} from 'common/tool/Logger';\n\nexport class HandlerController {\n public static error(_request: express.Request, response: express.Response, error: any): any {\n Logger.error(error);\n const code: number = error.code !== undefined && error.code !== null ? Number(error.code) : 500;\n response.status(!isNaN(code) && Number(error.code) >= 400 && Number(error.code) <= 599 ? Number(error.code) : 500);\n response.json({code: error.code, message: error.message});\n }\n}\n","import * as express from 'express';\nimport {AuthenticationMiddlewareContract} from 'common/http/AuthenticationMiddlewareContract';\nimport {AuthentificationConfigurationContract} from 'common/http/AuthentificationConfigurationContract';\nimport {UnauthorizedException} from 'common/exception/UnauthorizedException';\nimport {HandlerController} from 'common/http/HandlerController';\n\nexport class AuthenticationMiddleware implements AuthenticationMiddlewareContract {\n private configuration: AuthentificationConfigurationContract;\n\n public constructor(configuration: AuthentificationConfigurationContract) {\n this.configuration = configuration;\n }\n\n public handler(): (request: express.Request, response: express.Response, next: () => void) => void {\n return (request: express.Request, response: express.Response, next: () => void) => {\n try {\n let authenticated: boolean = false;\n\n if (!authenticated && this.configuration.jwt !== undefined) {\n (request as any).session = {\n // TODO\n };\n\n authenticated = true;\n }\n\n if (!authenticated && this.configuration.key !== undefined) {\n authenticated = this.authApiKey(request);\n }\n\n if (!authenticated && this.configuration.session !== undefined) {\n const sessionKeys: string[] = Object.keys((request as any).session);\n if (!Array.isArray(this.configuration.session.required)) {\n throw new UnauthorizedException('session is not well formatted');\n }\n\n this.configuration.session.required.forEach((required) => {\n if (!sessionKeys.includes(required)) {\n throw new UnauthorizedException('session is incomplete');\n }\n });\n\n authenticated = true;\n }\n\n if (!authenticated && this.configuration.none !== undefined) {\n authenticated = this.authNone(request);\n }\n\n if (authenticated) {\n next();\n } else {\n throw new UnauthorizedException('request is not authenticate');\n }\n } catch (error) {\n HandlerController.error(request, response, error);\n }\n };\n }\n\n private authApiKey(request: express.Request): boolean {\n if (typeof request.headers.Authorization !== 'string' || !request.headers.Authorization.startsWith('apiKey')) {\n return false;\n }\n\n const parts: string[] = request.headers.Authorization.split(' ');\n if (parts.length !== 2) {\n throw new UnauthorizedException('api key is not well formatted');\n }\n\n if (parts[1] !== this.configuration.key.secret) {\n throw new UnauthorizedException('api key is not valid');\n }\n\n (request as any).session = {};\n\n return true;\n }\n\n private authNone(request: express.Request): boolean {\n if (Array.isArray(this.configuration.none.urlStartsWith)) {\n if (this.configuration.none.urlStartsWith.find((urlStartsWith) => request.originalUrl?.startsWith(urlStartsWith)) !== undefined) {\n (request as any).session = {};\n\n return true;\n }\n }\n\n return false;\n }\n}\n","import {AuthorizationMiddlewareContract} from 'common/http/AuthorizationMiddlewareContract';\n\nexport class AuthorizationMiddleware implements AuthorizationMiddlewareContract {\n public can(_action: string, _subject: string): void {\n // TODO\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"express\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"cors\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"compression\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"helmet\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"connect-timeout\");","import * as crypto from 'crypto';\nimport express, {Express, json, urlencoded} from 'express';\nimport cors from 'cors';\nimport compression from 'compression';\nimport helmet from 'helmet';\nimport timeout from 'connect-timeout';\nimport {ServerContract} from 'common/http/ServerContract';\nimport {Logger} from 'common/tool/Logger';\n\nexport class Server implements ServerContract {\n public static readonly DEFAULT_PORT: number = 8080;\n public static readonly SALT: string = '03561b4a0fe7f125025';\n private app: Express;\n\n public async create(origins: string[], port?: number): Promise<Express> {\n if (this.app === undefined) {\n const backendPort: number = port || Server.DEFAULT_PORT;\n const backendLocalUrl: string = 'http://localhost:' + String(backendPort);\n Logger.debug('start server on ' + backendLocalUrl);\n this.app = express();\n this.app.set('trust proxy', true);\n this.app.disable('x-powered-by');\n this.app.use(compression({level: -1}));\n this.app.use(timeout('300s'));\n this.app.use(json({\n inflate: true,\n limit: '10mb',\n reviver: null,\n strict: true,\n type: 'application/json',\n verify: undefined\n }));\n this.app.use(urlencoded({\n limit: '10mb'\n }));\n this.app.use(cors({\n origin: [backendLocalUrl].concat(origins),\n credentials: true\n }));\n this.app.use(helmet());\n this.app.use(json());\n this.app.listen(backendPort, () => {\n Logger.debug('server is running on ' + backendLocalUrl);\n });\n }\n\n return this.app;\n }\n\n public getSessionSecret(sessionCookieName: string): string {\n return crypto.createHash('sha1').update(sessionCookieName + Server.SALT).digest('hex');\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"nock\");","import {cleanAll, isActive, isDone, pendingMocks} from 'nock';\n\nexport class ApiMockup {\n public static isDone(): boolean {\n return isActive() && isDone();\n }\n\n public static pending(): string {\n return 'pending: ' + JSON.stringify(pendingMocks());\n }\n\n public static reset(): void {\n cleanAll();\n }\n}\n","/* eslint-disable @typescript-eslint/no-var-requires */\nimport nock from 'nock';\nimport {ApiMockup} from 'common/mockup/ApiMockup';\nimport {HubriseOrderContract} from 'common/api/hubrise/model/order/HubriseOrderContract';\nimport {cloneDeep} from 'lodash';\n\nexport class HubriseApiMockup extends ApiMockup {\n public static readonly BASE_URL: string = 'http://api.hubrise.com';\n\n public static getUser(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/user')) {\n return '/user';\n }\n\n return path;\n }).get('/user').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/user.json')));\n }\n\n public static getAccount(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/account')) {\n return '/account';\n }\n\n return path;\n }).get('/account').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/account.json')));\n }\n\n public static getLocations(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/locations')) {\n return '/locations';\n }\n\n return path;\n }).get('/locations').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/locations.json')));\n }\n\n public static getLocation(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.endsWith('/location') || path.includes('/locations/')) {\n return '/location';\n }\n\n return path;\n }).get('/location').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/location.json')));\n }\n\n public static createCustomer(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/customer')) {\n return '/customer';\n }\n\n return path;\n }).post('/customer').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/customer.json')));\n }\n\n public static updateCustomer(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/customer')) {\n return '/customer';\n }\n\n return path;\n }).put('/customer').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/customer.json')));\n }\n\n public static getCustomer(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/customer_lists') && path.includes('/customers')) {\n return '/customer';\n }\n\n return path;\n }).get('/customer').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/customer.json')));\n }\n\n public static getCustomers(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/customers')) {\n return '/customers';\n }\n\n return path;\n }).get('/customers').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/customers.json')));\n }\n\n public static getCustomerLists(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/customer_lists')) {\n return '/customerLists';\n }\n\n return path;\n }).get('/customerLists').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/customer_lists.json')));\n }\n\n public static createOrder(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/order')) {\n return '/order';\n }\n\n return path;\n }).post('/order').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/order.json')));\n }\n\n public static getOrder(times: number = 1, generateRandomId: boolean = false): void {\n const order: HubriseOrderContract = cloneDeep(require('../../data/mockup/api/hubrise/order.json'));\n if (generateRandomId) {\n order.id = String(Date.now());\n }\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/orders/')) {\n return '/order';\n }\n\n return path;\n }).get('/order').times(times).reply(200, order);\n }\n\n public static getOrders(times: number = 1, generateRandomId: boolean = false): void {\n const orders: HubriseOrderContract[] = cloneDeep(require('../../data/mockup/api/hubrise/orders.json'));\n if (generateRandomId) {\n orders.forEach(order => order.id = String(Date.now()));\n }\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/orders') && !path.includes('/orders/')) {\n return '/orders';\n }\n\n return path;\n }).get('/orders').times(times).reply(200, orders);\n }\n\n public static setOrderStatus(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/orders/')) {\n return '/status';\n }\n\n return path;\n }).patch('/status').times(times).reply(204);\n }\n\n public static getCatalog(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/catalog')) {\n return '/catalog';\n }\n\n return path;\n }).get('/catalog').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/catalog.json')));\n }\n\n public static getCatalogs(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/catalogs')) {\n return '/catalogs';\n }\n\n return path;\n }).get('/catalogs').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/catalogs.json')));\n }\n\n public static createWebhook(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/callback')) {\n return '/webhook';\n }\n\n return path;\n }).post('/webhook').times(times).reply(200);\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"luxon\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"iconv-lite\");","import {encode} from 'iconv-lite';\n\nexport class UrlUtil {\n public static isUTF8(charset: string): boolean {\n if (!charset) {\n return true;\n }\n charset = charset.toLowerCase();\n\n return charset === 'utf8' || charset === 'utf-8';\n }\n\n public static urlencode(str: string, charset: string): string {\n if (!charset || UrlUtil.isUTF8(charset)) {\n return encodeURIComponent(str);\n }\n const buf = encode(str, charset);\n let encodeStr = '';\n let ch = '';\n\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < buf.length; i++) {\n ch = buf[i].toString(16);\n if (ch.length === 1) {\n ch = '0' + ch;\n }\n encodeStr += '%' + ch;\n }\n encodeStr = encodeStr.toUpperCase();\n\n return encodeStr;\n }\n}\n","import axios from 'axios';\nimport {DateTime} from 'luxon';\nimport * as querystring from 'querystring';\nimport {SmsSenderServiceContract} from 'common/service/sender/SmsSenderServiceContract';\nimport {ExternalApiException} from 'common/exception/ExternalApiException';\nimport {Retry} from 'common/tool/Retry';\nimport {Logger} from 'common/tool/Logger';\nimport {Environment} from 'common/tool/Environment';\nimport {BadParameterException} from 'common/exception/BadParameterException';\nimport {Env} from 'common/tool/Env';\nimport {ValidatorUtil} from 'common/util/ValidatorUtil';\nimport {UrlUtil} from 'common/util/UrlUtil';\n\nexport class SmsSenderService implements SmsSenderServiceContract {\n public static readonly BASE_API_URL: string = 'https://api.smsmode.com/http/1.6/';\n public static readonly MESSAGE_MAX_LENGTH: number = 150;\n private readonly token: string;\n private readonly mode: Environment;\n\n public constructor(token: string, mode: Environment) {\n this.token = token;\n this.mode = mode;\n }\n\n public async send(senderName: string, message: string, rawPhones: string[], isCommercial: boolean = true, sendAt?: string): Promise<void> {\n let phones: string[] = this.checkPhoneFormat(rawPhones);\n if (phones.length === 0) {\n Logger.warning(new BadParameterException('no valid phone', {phones: rawPhones}));\n\n return Promise.resolve();\n }\n\n if (phones.length > 1) {\n if (message.length > SmsSenderService.MESSAGE_MAX_LENGTH * 2) {\n message = message.substring(0, SmsSenderService.MESSAGE_MAX_LENGTH * 2);\n } else if (message.length > SmsSenderService.MESSAGE_MAX_LENGTH && message.length <= SmsSenderService.MESSAGE_MAX_LENGTH * 1.33) {\n message = message.substring(0, SmsSenderService.MESSAGE_MAX_LENGTH);\n }\n }\n\n await Retry.request(async () => {\n const params: Record<string, any> = {\n accessToken: this.token,\n emetteur: senderName,\n message: UrlUtil.urlencode(message, 'ISO-8859-15'),\n numero: phones.map((phone) => phone.replace('+', '')).join(','),\n classe_msg: 2,\n nbr_msg: Math.ceil(message.length / SmsSenderService.MESSAGE_MAX_LENGTH)\n };\n\n if (isCommercial) {\n params.stop = 1;\n }\n\n if (sendAt !== undefined) {\n params.date_envoi = DateTime.fromISO(sendAt, { setZone: true }).toFormat('ddMMyyyy-HH:mm');\n }\n\n const target: DateTime = DateTime.fromISO(sendAt ?? (new Date()).toISOString(), { setZone: true }).setZone('Europe/Paris');\n if (isCommercial) { // do not send between 21h and 9h\n if (target.hour >= 21) {\n params.date_envoi = target.plus({day: 1}).set({hour: 9}).toFormat('ddMMyyyy-HH:mm');\n } else if (target.hour < 9) {\n params.date_envoi = target.set({hour: 9}).toFormat('ddMMyyyy-HH:mm');\n }\n } else { // do not send between 00h and 8h\n if (target.hour < 8) {\n params.date_envoi = target.set({hour: 8}).toFormat('ddMMyyyy-HH:mm');\n }\n }\n\n if (this.mode === Env.TEST) {\n Logger.info('Simulation Mode: SMS has been sent', {params: params});\n } else {\n if (this.mode === Env.DEVELOPMENT) {\n phones = ['+15145705214'];\n }\n\n const response: {data: string} = await axios.post(SmsSenderService.BASE_API_URL + 'sendSMS.do',\n querystring.stringify(params, '&', '=', {encodeURIComponent: (p) => p}), {\n timeout: 30000\n });\n\n if (response.data.length > 0 && response.data.trim().substring(0, 1) !== '0') {\n throw new ExternalApiException('Error: ' + response.data, params);\n }\n }\n }, 0, Logger.error.bind(Logger));\n }\n\n private checkPhoneFormat(phones: string[]): string[] {\n return phones.filter((phone) => ValidatorUtil.isIntMobilePhone(phone));\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"path\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"mustache\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"fs\");","export const asyncForEach: (array: any[], callback: (item: any) => Promise<void>) => Promise<void> = async (array, callback) => {\n for (let i: number = 0; i < array.length; i++) { // eslint-disable-line\n await callback(array[i]);\n }\n};\n\nexport const wait: (time: number) => Promise<void> = (time) => {\n return new Promise((resolve) => setTimeout(resolve, time));\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"color-name\");","import * as colors from 'color-name';\n\nexport class GeneratorUtil {\n private static readonly symbolUpperCases: string[] = [\n 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'K', 'M', 'N', 'P', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'\n ];\n private static readonly symbolLowerCases: string[] = [\n 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'k', 'm', 'n', 'p', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'\n ];\n\n public static code(size: number): string {\n if (size === null || size === undefined) {\n size = 6;\n }\n\n let code: string = '';\n while (code.length < size) {\n code += GeneratorUtil.symbolUpperCases[GeneratorUtil.int(0, GeneratorUtil.symbolUpperCases.length - 1)];\n }\n\n return code;\n }\n\n public static color(alpha: number = 1): string {\n const alphaHex: string = GeneratorUtil.rgbToHex(Math.round(255 * alpha));\n const defaultColor: string = '#000000' + alphaHex;\n const colorList: number[][] = Object.values(colors);\n if (colorList.length === 0) {\n return defaultColor;\n }\n const rgb: number[] = colorList[GeneratorUtil.int(0, colorList.length - 1)];\n if (rgb.length !== 3) {\n return defaultColor;\n }\n\n return '#' + GeneratorUtil.rgbToHex(rgb[0]) + GeneratorUtil.rgbToHex(rgb[1]) + GeneratorUtil.rgbToHex(rgb[2]) + alphaHex;\n }\n\n private static rgbToHex(rgb: number): string {\n const hex: string = rgb.toString(16);\n if (hex.length === 1) {\n return '0' + hex;\n }\n\n return hex;\n }\n\n public static int(min: number, max: number): number {\n if (min === null || min === undefined) {\n min = 0;\n }\n if (max === null || max === undefined) {\n max = Number.POSITIVE_INFINITY;\n }\n\n min = Math.ceil(min);\n max = Math.floor(max);\n\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }\n\n public static password(size: number): string {\n if (size === null || size === undefined) {\n size = 8;\n }\n\n let code: string = '';\n while (code.length < size) {\n switch (GeneratorUtil.int(1, 3)) {\n case 1:\n code += GeneratorUtil.symbolUpperCases[GeneratorUtil.int(0, GeneratorUtil.symbolUpperCases.length - 1)];\n break;\n case 2:\n code += GeneratorUtil.symbolLowerCases[GeneratorUtil.int(0, GeneratorUtil.symbolLowerCases.length - 1)];\n break;\n default:\n code += String(GeneratorUtil.int(0, 9));\n }\n }\n\n return code;\n }\n}\n","import * as fs from 'fs';\nimport * as path from 'path';\nimport {FileSystemContract} from 'common/tool/FileSystemContract';\nimport {BadParameterException} from 'common/exception/BadParameterException';\nimport {asyncForEach} from 'common/util/PromiseUtil';\nimport {GeneratorUtil} from 'common/util/GeneratorUtil';\n\nexport class FileSystem implements FileSystemContract {\n public dirPath(filePath: string): string {\n const i: number = path.resolve(filePath).lastIndexOf(path.sep);\n if (i < 0) {\n return filePath;\n }\n\n return (path.resolve(path.resolve(filePath).substring(0, i + 1)) + path.sep).replace(/\\\\/g, '/');\n }\n\n public async listFiles(dirPath: string): Promise<string[]> {\n if (!this.isDir(dirPath)) {\n throw new BadParameterException(String(dirPath) + ' does not exist or is not a directory');\n }\n\n const separator: string = dirPath.endsWith('/') ? '' : '/';\n const files: string[] = fs.readdirSync(dirPath);\n\n const output: string[] = [];\n await asyncForEach(files, async (fileName: string) => {\n if (this.isFile(dirPath + separator + fileName)) {\n output.push(dirPath + separator + fileName);\n }\n });\n\n return output;\n }\n\n public async randomFile(dirPath: string, suggestion?: number): Promise<string> {\n const filenames: string[] = await this.listFiles(dirPath);\n if (filenames.length === 0) {\n return undefined;\n }\n\n let index: number;\n if (suggestion !== undefined) {\n index = Math.max(suggestion, 0) % filenames.length;\n } else {\n index = GeneratorUtil.int(0, filenames.length - 1);\n }\n\n return filenames[index];\n }\n\n public async move(filePath: string, dirPath: string): Promise<void> {\n if (!this.isFile(filePath)) {\n throw new BadParameterException(String(filePath) + ' does not exist or is not a file');\n }\n\n fs.mkdirSync(dirPath, {recursive: true});\n if (!this.isDir(dirPath)) {\n throw new BadParameterException(String(dirPath) + ' does not exist or is not a directory');\n }\n\n return fs.renameSync(filePath, dirPath + path.basename(filePath));\n }\n\n public async read(filePath: string): Promise<string> {\n if (!this.isFile(filePath)) {\n throw new BadParameterException(String(filePath) + ' does not exist or is not a file');\n }\n\n return fs.readFileSync(filePath, 'utf8');\n }\n\n public async readJson(jsonPath: string): Promise<any> {\n const data: any = await this.read(jsonPath);\n if (!this.isJson(data)) {\n throw new BadParameterException(String(jsonPath) + ' does not contain JSON');\n }\n\n return JSON.parse(data);\n }\n\n public async readJsonFiles(dirPath: string): Promise<{name: string, data: any}[]> {\n if (!this.isDir(dirPath)) {\n throw new BadParameterException(String(dirPath) + ' does not exist or is not a directory');\n }\n\n const separator: string = dirPath.endsWith('/') ? '' : '/';\n const files: string[] = fs.readdirSync(dirPath);\n\n const output: {name: string, data: any}[] = [];\n await asyncForEach(files, async (fileName: string) => {\n if (this.isFile(dirPath + separator + fileName) && fileName.endsWith('.json')) {\n output.push({\n name: fileName,\n data: await this.readJson(dirPath + separator + fileName)\n });\n }\n });\n\n return output;\n }\n\n public async write(filePath: string, rawData: any): Promise<void> {\n let data: string = '';\n if (typeof rawData === 'string') {\n data = String(rawData);\n } else if (typeof rawData === 'number') {\n data = String(rawData);\n } else {\n data = JSON.stringify(rawData);\n }\n\n fs.mkdirSync(this.dirPath(filePath), {recursive: true});\n\n fs.writeFileSync(filePath, data, {encoding: 'utf8'});\n\n return Promise.resolve();\n }\n\n public async writeJson(jsonPath: string, data: any): Promise<void> {\n return this.write(jsonPath, JSON.stringify(data));\n }\n\n private isDir(dirPath: string): boolean {\n return fs.existsSync(dirPath) && fs.statSync(dirPath).isDirectory();\n }\n\n private isFile(filePath: string): boolean {\n return fs.existsSync(filePath) && fs.statSync(filePath).isFile();\n }\n\n private isJson(data: any): boolean {\n try {\n JSON.parse(data);\n\n return true;\n } catch (_error) {\n return false;\n }\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"clean-css\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"html-minifier-terser\");","import {MinifierEngineContract} from 'common/templating/MinifierEngineContract';\nimport CleanCSS from 'clean-css';\nimport {minify as minifyHtml} from 'html-minifier-terser';\n\nexport class MinifierEngine implements MinifierEngineContract {\n public async css(content: string): Promise<string> {\n const minifier: CleanCSS.MinifierOutput = new CleanCSS({\n compatibility: 'ie7',\n format: false,\n level: 1,\n sourceMap: false\n });\n const result: CleanCSS.Output = minifier.minify(content);\n\n return result.styles;\n }\n\n public async html(content: string): Promise<string> {\n return await minifyHtml(content, {\n collapseBooleanAttributes: true,\n collapseInlineTagWhitespace: true,\n collapseWhitespace: true,\n continueOnParseError: false,\n decodeEntities: false,\n html5: true,\n minifyCSS: true,\n minifyJS: true,\n noNewlinesBeforeTagClose: true,\n preserveLineBreaks: false,\n preventAttributesEscaping: false,\n processConditionalComments: false,\n quoteCharacter: '\"',\n removeAttributeQuotes: false,\n removeComments: true,\n removeEmptyAttributes: true,\n removeEmptyElements: true,\n removeOptionalTags: false,\n removeRedundantAttributes: true,\n removeScriptTypeAttributes: false,\n removeStyleLinkTypeAttributes: false,\n removeTagWhitespace: false\n });\n }\n}\n","import * as path from 'path';\nimport {parse, render} from 'mustache';\nimport {cloneDeep} from 'lodash';\nimport {TemplateEngineContract} from 'common/templating/TemplateEngineContract';\nimport {FileSystem} from 'common/tool/FileSystem';\nimport {asyncForEach} from 'common/util/PromiseUtil';\nimport {MinifierEngineContract} from 'common/templating/MinifierEngineContract';\nimport {MinifierEngine} from 'common/templating/MinifierEngine';\nimport {ConflictException} from 'common/exception/ConflictException';\n\nexport class TemplateEngine implements TemplateEngineContract {\n private minifier: MinifierEngineContract;\n\n public constructor() {\n this.minifier = new MinifierEngine();\n }\n\n public async render(templatePath: string, data: {[key: string]: any}, baseIncludePath?: string): Promise<string> {\n if (!templatePath.endsWith('.template')) {\n templatePath += '.template';\n }\n const view: {[key: string]: any} = cloneDeep(data);\n const basePath: string = path.isAbsolute(templatePath) ? '' : __dirname + path.sep;\n const fileSystem = new FileSystem();\n const content: string = await fileSystem.read(basePath + templatePath);\n\n const includes: string[] = [];\n const results: any[][] = parse(content);\n results.forEach((result) => {\n if (result.length >= 4 && result[0] === '&' && result[1].startsWith('include:')) {\n includes.push(result[1]);\n }\n });\n\n if (includes.length > 0) {\n if (baseIncludePath === undefined) {\n baseIncludePath = path.dirname(basePath + templatePath) + path.sep;\n } else if (!path.isAbsolute(baseIncludePath)) {\n baseIncludePath = basePath + baseIncludePath;\n }\n await asyncForEach(includes, async (include) => {\n const includeParts: string[] = include.split(':');\n if (includeParts.length === 3 && view[include] !== undefined) {\n const templateName: string = includeParts[2];\n if (baseIncludePath.includes('/html')) {\n Object.keys(view[include]).forEach((key) => {\n view[include][key] = Array.isArray(view[include][key]) ? view[include][key].map((part: string) => part.replace(/(?:\\r\\n|\\r|\\n)/g, '<br>'))\n : view[include][key].replace(/(?:\\r\\n|\\r|\\n)/g, '<br>');\n });\n }\n view[include] = await this.render(path.resolve(baseIncludePath, templateName), view[include]);\n }\n });\n }\n\n const output: string = render(content, view);\n if (output.includes('{{') || output.includes('}}')) {\n throw new ConflictException('template: missing data to render template', {templatePath, data});\n }\n\n return templatePath.includes('html') ? this.minifier.html(output) : output;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"node-mailjet\");","import {EmailSenderServiceContract} from 'common/service/sender/EmailSenderServiceContract';\nimport {TemplateEngine} from 'common/templating/TemplateEngine';\nimport {TemplateEngineContract} from 'common/templating/TemplateEngineContract';\nimport {ViewEmailTrackDeliveryContract} from 'common/templating/view/email/ViewEmailTrackDeliveryContract';\nimport {RecipientContract} from 'common/service/sender/RecipientContract';\nimport {SenderContract} from 'common/service/sender/SenderContract';\nimport {Client} from 'node-mailjet';\nimport {MainException} from 'common/exception/MainException';\nimport {Retry} from 'common/tool/Retry';\nimport {Environment} from 'common/tool/Environment';\nimport {Env} from 'common/tool/Env';\nimport {Logger} from 'common/tool/Logger';\nimport {ViewEmailUserNotificationContract} from 'common/templating/view/email/ViewEmailUserNotificationContract';\nimport {ViewEmailDiscountContract} from 'common/templating/view/email/ViewEmailDiscountContract';\nimport {asyncForEach} from 'common/util/PromiseUtil';\nimport {BadParameterException} from 'common/exception/BadParameterException';\n\nexport class EmailSenderService implements EmailSenderServiceContract {\n private readonly templateEngine: TemplateEngineContract;\n private readonly mailjet: any;\n private readonly mode: Environment;\n\n public constructor(apiPublicKey: string, apiSecretKey: string, mode: Environment) {\n this.templateEngine = new TemplateEngine();\n this.mailjet = new Client({apiKey: apiPublicKey, apiSecret: apiSecretKey});\n this.mode = mode;\n }\n\n public async sendDeliveryDelay(sender: SenderContract, recipient: RecipientContract, data: ViewEmailTrackDeliveryContract): Promise<void> {\n return await Retry.request(async () => {\n if (data.base.copyright === undefined) {\n data.base.copyright = {\n year: String((new Date()).getUTCFullYear())\n };\n }\n const text: string = await this.templateEngine.render('data/email/template/deliveryDelay', data, 'data/email/element/text');\n const html: string = await this.templateEngine.render('data/email/template/deliveryDelay', data, 'data/email/element/html');\n\n return await this.sendNotification(sender, [{recipient: recipient, subject: data.base.subject, text: text, html: html}], false);\n }, 0, Logger.error.bind(Logger));\n }\n\n public async sendTrackDelivery(sender: SenderContract, recipient: RecipientContract, data: ViewEmailTrackDeliveryContract): Promise<void> {\n return await Retry.request(async () => {\n const textContent: string = await this.templateEngine.render('data/email/template/trackDelivery', data, 'data/email/element/text');\n const text: string = await this.templateEngine.render('data/email/element/text/index', {content: textContent, base: data.base});\n const htmlContent: string = await this.templateEngine.render('data/email/template/trackDelivery', data, 'data/email/element/html');\n const html: string = await this.templateEngine.render('data/email/element/html/index', {content: htmlContent, base: data.base});\n\n return await this.sendNotification(sender, [{recipient: recipient, subject: data.base.subject, text: text, html: html}], false);\n }, 0, Logger.error.bind(Logger));\n }\n\n public async sendUserNotification(sender: SenderContract, recipient: RecipientContract, data: ViewEmailUserNotificationContract, isCommercial: boolean = true, customId?: string): Promise<void> {\n return await Retry.request(async () => {\n const textContent: string = await this.templateEngine.render('data/email/template/userNotification', data, 'data/email/element/text');\n const text: string = await this.templateEngine.render('data/email/element/text/index', {content: textContent, base: data.base, isCommercial: isCommercial});\n const htmlContent: string = await this.templateEngine.render('data/email/template/userNotification', data, 'data/email/element/html');\n const html: string = await this.templateEngine.render('data/email/element/html/index', {content: htmlContent, base: data.base, isCommercial: isCommercial});\n\n return await this.sendNotification(sender, [{recipient: recipient, subject: data.base.subject, text: text, html: html}], isCommercial, customId);\n }, 0, Logger.error.bind(Logger));\n }\n\n public async sendUsersNotifications(sender: SenderContract, messages: {recipient: RecipientContract, data: ViewEmailUserNotificationContract}[],\n isCommercial?: boolean, customId?: string): Promise<void> {\n return await Retry.request(async () => {\n const contents: {recipient: RecipientContract, subject: string, text: string, html: string}[] = [];\n await asyncForEach(messages, async (message) => {\n const textContent: string = await this.templateEngine.render('data/email/template/userNotification', message.data, 'data/email/element/text');\n const text: string = await this.templateEngine.render('data/email/element/text/index', {content: textContent, base: message.data.base, isCommercial: isCommercial});\n const htmlContent: string = await this.templateEngine.render('data/email/template/userNotification', message.data, 'data/email/element/html');\n const html: string = await this.templateEngine.render('data/email/element/html/index', {content: htmlContent, base: message.data.base, isCommercial: isCommercial});\n contents.push({recipient: message.recipient, subject: message.data.base.subject, text: text, html: html});\n });\n\n return await this.sendNotification(sender, contents, isCommercial, customId);\n }, 0, Logger.error.bind(Logger));\n }\n\n public async sendDiscount(sender: SenderContract, recipient: RecipientContract, data: ViewEmailDiscountContract, isCommercial: boolean = true, customId?: string): Promise<void> {\n return await Retry.request(async () => {\n const textContent: string = await this.templateEngine.render('data/email/template/discount', data, 'data/email/element/text');\n const text: string = await this.templateEngine.render('data/email/element/text/index', {content: textContent, base: data.base, isCommercial: isCommercial});\n const htmlContent: string = await this.templateEngine.render('data/email/template/discount', data, 'data/email/element/html');\n const html: string = await this.templateEngine.render('data/email/element/html/index', {content: htmlContent, base: data.base, isCommercial: isCommercial});\n\n return await this.sendNotification(sender, [{recipient: recipient, subject: data.base.subject, text: text, html: html}], isCommercial, customId);\n }, 0, Logger.error.bind(Logger));\n }\n\n public async sendDiscounts(sender: SenderContract, messages: {recipient: RecipientContract, data: ViewEmailDiscountContract}[], isCommercial: boolean = true, customId?: string): Promise<void> {\n return await Retry.request(async () => {\n const contents: {recipient: RecipientContract, subject: string, text: string, html: string}[] = [];\n await asyncForEach(messages, async (message) => {\n const textContent: string = await this.templateEngine.render('data/email/template/discount', message.data, 'data/email/element/text');\n const text: string = await this.templateEngine.render('data/email/element/text/index', {content: textContent, base: message.data.base, isCommercial: isCommercial});\n const htmlContent: string = await this.templateEngine.render('data/email/template/discount', message.data, 'data/email/element/html');\n const html: string = await this.templateEngine.render('data/email/element/html/index', {content: htmlContent, base: message.data.base, isCommercial: isCommercial});\n contents.push({recipient: message.recipient, subject: message.data.base.subject, text: text, html: html});\n });\n\n return await this.sendNotification(sender, contents, isCommercial, customId);\n }, 0, Logger.error.bind(Logger));\n }\n\n // private async sendCampaign(sender: SenderContract, recipients: RecipientContract[], subject: string, text: string, html: string): Promise<void> {\n // try {\n // await this.mailjet.post('send').request({\n // FromEmail: sender.contact,\n // FromName: sender.name,\n // Subject: subject,\n // 'Text-part': text,\n // 'Html-part': html,\n // Recipients: [\n // recipients.map((recipient) => {\n // return { Name: recipient.name, Email: recipient.contact };\n // }),\n // ],\n // });\n //\n // return Promise.resolve();\n // } catch (error) {\n // return Promise.reject(new MainException(error.message, Number(error.statusCode)));\n // }\n // }\n\n private async sendNotification(sender: SenderContract, contents: {recipient: RecipientContract, subject: string, text: string, html: string}[],\n isCommercial: boolean = false, customId?: string): Promise<void> {\n if (contents.length === 0) {\n throw new BadParameterException('email: missing messages');\n }\n\n try {\n if (this.mode === Env.TEST) {\n Logger.info('Simulation Mode: Email has been sent', {sender: sender, recipients: contents.map((content) => content.recipient)});\n } else {\n const messages: {From:{Name: string,Email: string},To:[{Name: string,Email: string}], Subject: string, TextPart: string, HTMLPart: string, Priority:0 | 1 | 2, customID: string}[] = [];\n await asyncForEach(contents, async (content) => {\n if (this.mode === Env.DEVELOPMENT) {\n content.recipient.contact = 'developer@onylab.com';\n }\n messages.push({\n 'From': {\n 'Name': sender.name,\n 'Email': sender.contact\n },\n 'To': [{\n 'Name': content.recipient.name,\n 'Email': content.recipient.contact\n }],\n 'Subject': content.subject,\n 'TextPart': content.text,\n 'HTMLPart': content.html,\n 'Priority': isCommercial ? 0 : 2,\n 'customID': customId === undefined ? undefined : String(customId)\n });\n });\n await this.mailjet.post('send', {'version': 'v3.1'}).request({ Messages: messages });\n }\n } catch (error) {\n throw new MainException(error.message, Number(error.statusCode));\n }\n }\n}\n","import {ConfigurationContract} from 'common/tool/ConfigurationContract';\nimport {FileSystemContract} from 'common/tool/FileSystemContract';\nimport {FileSystem} from 'common/tool/FileSystem';\nimport {Env} from 'common/tool/Env';\nimport {merge} from 'lodash';\nimport {Environment} from 'common/tool/Environment';\n\nexport class Configuration implements ConfigurationContract {\n private static config: any;\n private static root: string;\n private static environment: Env;\n private readonly filesystem: FileSystemContract;\n\n public constructor(root: string, environment?: Env) {\n this.filesystem = new FileSystem();\n if (Configuration.root === undefined || Configuration.root !== root) {\n Configuration.root = root;\n Configuration.config = undefined;\n }\n const currentEnvironment: string = (environment === undefined ? Environment.getMode() : environment);\n if (Configuration.environment === undefined || Configuration.environment !== currentEnvironment) {\n Configuration.environment = environment === undefined ? Environment.getMode() : environment;\n Configuration.config = undefined;\n }\n }\n\n public async full(): Promise<any> {\n await this.init();\n\n return Configuration.config;\n }\n\n private async init(): Promise<void> {\n if (Configuration.config === undefined) {\n if (Configuration.root === undefined) {\n Configuration.config = {};\n } else {\n Configuration.config = await this.filesystem.readJson(Configuration.root + 'data/config.json');\n if ([Env.DEVELOPMENT, Env.TEST].includes(Configuration.environment)) {\n try {\n Configuration.config = merge(Configuration.config, await this.filesystem.readJson(Configuration.root + 'data/config_' + String(Configuration.environment) + '.json'));\n } catch (_e) {\n // nothing\n }\n }\n\n }\n }\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"typeorm\");","import {Connection, createConnection} from 'typeorm';\nimport {DatabaseContract} from 'common/tool/DatabaseContract';\nimport {FileSystem} from 'common/tool/FileSystem';\nimport {FileSystemContract} from 'common/tool/FileSystemContract';\nimport {BadParameterException} from 'common/exception/BadParameterException';\nimport {Logger} from 'common/tool/Logger';\n\n// TypeORM documation, types: https://github.com/typeorm/typeorm/blob/master/src/driver/types/ColumnTypes.ts\nexport class Database implements DatabaseContract {\n private root: string;\n private db: any;\n private connection: Connection;\n\n public constructor(root: string) {\n this.root = root;\n }\n\n public async connect(name: string, entities: any[]): Promise<void> {\n if (this.db === undefined) {\n await this.init();\n }\n\n const con: any = this.db[name];\n if (con !== undefined) {\n con.entities = entities;\n con.logging = ['error'];\n con.logger = true;\n con.bigNumberStrings = false;\n if (con.timezone === undefined) {\n con.timezone = 'Z';\n }\n if (con.charset === undefined) {\n con.charset = 'UTF8_GENERAL_CI';\n }\n this.connection = await createConnection(con);\n } else {\n Logger.error(new BadParameterException('bad connection name'));\n }\n }\n\n public async synchronize(): Promise<void> {\n if (this.connection !== undefined) {\n await this.connection.synchronize();\n }\n }\n\n public async close(): Promise<void> {\n return this.connection.close();\n }\n\n private async init(): Promise<void> {\n if (this.root === undefined) {\n this.db = {};\n } else {\n const fileSystem: FileSystemContract = new FileSystem();\n this.db = await fileSystem.readJson(this.root + 'data/db.json');\n }\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"prettyjson\");","import * as prettyjson from 'prettyjson';\nimport {DisplayerContract} from 'common/tool/DisplayerContract';\nimport {Logger} from 'common/tool/Logger';\n\nexport class Displayer implements DisplayerContract {\n public error(error: Error): void {\n Logger.error(error);\n }\n\n public info(message: string): void {\n Logger.trace(message);\n }\n\n public json(json: any): void {\n Logger.trace(prettyjson.render(json, {}));\n }\n\n public success(message: string): void {\n Logger.trace(message);\n }\n}\n","import {DownloaderContract} from 'common/tool/DownloaderContract';\nimport * as path from 'path';\nimport * as fs from 'fs';\nimport * as crypto from 'crypto';\nimport axios from 'axios';\nimport {FileSystemContract} from 'common/tool/FileSystemContract';\nimport {FileSystem} from 'common/tool/FileSystem';\n\nexport class Downloader implements DownloaderContract {\n private readonly fileSystem: FileSystemContract;\n\n public constructor() {\n this.fileSystem = new FileSystem();\n }\n\n public async image(url: string, outputPath: string, outputName?: string): Promise<string> {\n if (outputName === undefined) {\n outputName = crypto.randomBytes(20).toString('hex') + path.extname(url);\n }\n await this.fileSystem.write(outputPath + path.sep + outputName, '');\n\n const output: string = path.resolve(outputPath + path.sep + outputName);\n const writer: any = fs.createWriteStream(output);\n\n const response: any = await axios({\n url,\n method: 'GET',\n responseType: 'stream'\n });\n\n response.data.pipe(writer);\n\n return new Promise((resolve, reject) => {\n writer.on('finish', () => resolve(output));\n writer.on('error', reject);\n });\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"fast-diff\");","/* eslint-disable no-bitwise */\nimport {deburr, toLower, trim} from 'lodash';\nimport {isNullOrUndefined} from 'common/util/HelperUtil';\n\nexport class StringUtil {\n // alternative https://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex\n public static escapeRegExp(str: string): string {\n if (typeof str !== 'string') {\n return str;\n }\n\n return str.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&'); // and .replace(/-/g, '\\\\x2d');\n }\n\n public static hash(str: string, seed: number = 0): string {\n let h1 = 0xdeadbeef ^ seed;\n let h2 = 0x41c6ce57 ^ seed;\n for(let i = 0, ch; i < str.length; i++) {\n ch = str.charCodeAt(i);\n h1 = Math.imul(h1 ^ ch, 2654435761);\n h2 = Math.imul(h2 ^ ch, 1597334677);\n }\n h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507);\n h1 ^= Math.imul(h2 ^ (h2 >>> 13), 3266489909);\n h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507);\n h2 ^= Math.imul(h1 ^ (h1 >>> 13), 3266489909);\n\n return (h2>>>0).toString(16).padStart(8, '0') + (h1>>>0).toString(16).padStart(8, '0');\n }\n\n public static nullable(str: string): string {\n if (isNullOrUndefined(str)) {\n return null;\n }\n\n if (typeof str === 'string' && str.length === 0) {\n return null;\n }\n\n return str;\n }\n\n public static removeMultiSpaces(data: string) {\n if (typeof data !== 'string') {\n return data;\n }\n\n return data.replace(/\\s{2,}/g, ' ');\n }\n\n public static removeText(data: string, text: string) {\n if (typeof data !== 'string' || typeof text !== 'string' || text.length === 0) {\n return data;\n }\n\n try {\n data = data.replace(new RegExp(StringUtil.escapeRegExp(text), 'ig'), '');\n data = data.replace(new RegExp(StringUtil.escapeRegExp(text).replace(new RegExp('\\\\s', 'g'), '-'), 'ig'), '');\n } catch (_e) {\n // ignore\n }\n\n return data;\n }\n\n public static replace(str: string, targets: string[], replacers: string[]): string {\n if (typeof str !== 'string') {\n return str;\n }\n\n if (targets.length !== replacers.length) {\n return str;\n }\n\n let output: string = str;\n targets.forEach((target, index) => {\n output = output.replace(new RegExp(StringUtil.escapeRegExp(target), 'ig'), replacers[index]);\n });\n\n return output;\n }\n\n public static slugify(raw: string, separator: string = ''): string {\n if (raw === undefined) {\n return '';\n }\n\n return toLower(trim(deburr(raw)).replace(/[^0-9a-z\\-\\_]/gi, separator));\n }\n\n public static truncate(str: string, limit: number): string {\n if (isNullOrUndefined(str) || str.length <= limit) {\n return str;\n }\n\n if (limit <= 3) {\n return '';\n }\n\n return str.slice(0, limit - 3) + '...';\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"emoji-regex\");","import {StringUtil} from 'common/util/StringUtil';\nimport emojiRegex from 'emoji-regex';\n\nexport class FormatterUtil {\n public static trim(raw: string): string {\n return typeof raw === 'string' ? raw.trim() : raw;\n }\n\n public static capitalize(raw: string): string {\n const lowraw: string = FormatterUtil.lower(raw);\n\n return typeof lowraw === 'string' ? lowraw.split(' ').map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(' ') : raw;\n }\n\n public static ucfirst(raw: string): string {\n const lowraw: string = FormatterUtil.lower(raw);\n\n return typeof lowraw === 'string' ? lowraw.charAt(0).toUpperCase() + lowraw.slice(1) : raw;\n }\n\n public static lower(raw: string): string {\n return typeof raw === 'string' ? raw.toLocaleLowerCase() : raw;\n }\n\n public static upper(raw: string): string {\n return typeof raw === 'string' ? raw.toLocaleUpperCase() : raw;\n }\n\n public static phone(raw: string, locale: string, output: 'nat' | 'int' = 'int'): string {\n if (typeof raw === 'string') {\n raw = FormatterUtil.preformatPhone(raw, locale);\n switch (output) {\n case 'nat': // national\n return FormatterUtil.phoneNat(raw, locale);\n case 'int': // international\n return FormatterUtil.phoneInt(raw, locale);\n }\n }\n\n return raw;\n }\n\n public static stripEmoji(raw: string): string {\n let output: string = raw;\n\n if (typeof output === 'string') {\n let match;\n while ((match = emojiRegex().exec(output)) !== null) {\n try {\n // output = output.replace(new RegExp('\\\\s' + StringUtil.escapeRegExp(match[0]), 'g'), '');\n // output = output.replace(new RegExp(StringUtil.escapeRegExp(match[0]) + '\\\\s', 'g'), '');\n output = output.replace(new RegExp(StringUtil.escapeRegExp(match[0]), 'g'), '');\n output = output.replace(new RegExp('\\\\s+', 'g'), ' ');\n output = output.trim();\n } catch (_e) {\n // ignore\n }\n }\n }\n\n return output;\n }\n\n public static stripExoticCharacters(raw: string): string {\n if (typeof raw === 'string') {\n return raw.replace('’', '\\'').replace(/[\\u0250-\\ue007]+/g, '*');\n }\n\n return raw;\n }\n\n private static preformatPhone(raw: string, locale: string): string {\n raw = raw.trim().replace(/\\s?\\.?\\-?\\(?\\)?/g, '');\n switch (locale) {\n case 'fr':\n if ((new RegExp('^[1-9]')).test(raw) && raw.length === 9) {\n return '0' + raw;\n }\n break;\n }\n\n return raw;\n }\n\n private static phoneNat(raw: string, locale: string): string {\n switch (locale) {\n case 'fr': // format: 06 11 22 33 44\n if (raw.startsWith('+330')) {\n raw = raw.substring(3);\n } else if (raw.startsWith('+33')) {\n raw = '0' + raw.substring(3);\n } else if (raw.startsWith('0033')) {\n raw = '0' + raw.substring(4);\n } else if (raw.startsWith('33') && raw.length === 11) {\n raw = '0' + raw.substring(2);\n }\n\n if (raw.length === 10) {\n let i: number = 0;\n raw = raw.split('').map((num) => {\n i++;\n\n return num + (i % 2 === 0 ? ' ' : '');\n }).join('').trim();\n }\n\n return raw;\n }\n\n return raw;\n }\n\n private static phoneInt(raw: string, locale: string): string {\n if (raw.startsWith('+')) {\n return raw;\n }\n\n switch (locale) {\n case 'fr': // format: +33611223344\n if (raw.startsWith('0')) {\n raw = raw.substring(1);\n }\n\n return '+33' + raw;\n }\n\n return raw;\n }\n}\n","/* eslint-disable max-lines */\nimport {trim} from 'lodash';\nimport {isNullOrUndefined} from 'common/util/HelperUtil';\nimport {ValidatorUtil} from 'common/util/ValidatorUtil';\nimport diff from 'fast-diff';\nimport {StringUtil} from 'common/util/StringUtil';\nimport {FormatterUtil} from 'common/util/FormatterUtil';\n\nexport class AddressUtil {\n private static readonly ZIPCODE_CITY: { [zipCode: string]: string[] } = {\n '78500': ['Sartrouville'], '78600': ['Maisons-Laffitte', 'Le Mesnil-le-Roi'], '78800': ['Houilles'], '95240': ['Cormeilles-en-Parisis'], '95530': ['La Frette-sur-Seine'],\n '78100': ['Saint-Germain-en-Laye'], '95100': ['Argenteuil'],\n '78630': ['Orgeval', 'Morainvilliers'], '78670': ['Villennes-sur-Seine', 'Medan'], '78240': ['Chambourcy', 'Aigremont'], '78300': ['Poissy'], '78510': ['Triel-sur-Seine'],\n '78570': ['Andrésy', 'Chanteloup-les-Vignes'], '78700': ['Conflans-Sainte-Honorine'], '78480': ['Verneuil-sur-Seine'], '78750': ['Mareil-Marly'], '78620': ['L\\'Étang-la-Ville'],\n '78160': ['Marly-le-Roi'], '78580': ['Les Alluets-le-Roi'],\n '78955': ['Carrières-sous-Poissy'], '78260': ['Achères'], '78540': ['Vernouillet'], '78920': ['Ecquevilly'],\n '95150': ['Taverny'], '95250': ['Beauchamp'], '95480': ['Pierrelaye'], '95320': ['Saint-Leu-la-Forêt'], '95550': ['Bessancourt'], '95370': ['Montigny-lès-Cormeilles'], '95220': ['Herblay'],\n '95740': ['Frépillon'], '95540': ['Méry-sur-Oise'],\n '95870': ['Bezons'], '78420': ['Carrières-sur-Seine'], '78400': ['Chatou'], '78110': ['Le Vésinet'], '78360': ['Montesson'], '78290': ['Croissy-sur-Seine', 'Croissy'], '78230': ['Le Pecq'],\n '95600': ['Eaubonne']\n };\n private static readonly REGIONS: string[] = ['île-de-france'];\n private static readonly COUNTRIES: string[] = ['France', 'FR'];\n private static readonly STREET_TYPE: { short: string, long: string }[] = [\n {short: 'av', long: 'avenue'},\n {short: 'rue', long: 'rue'},\n {short: 'bd', long: 'boulevard'},\n {short: 'chau', long: 'chaussée'},\n {short: 'trav', long: 'traverse'},\n {short: 'pl', long: 'place'},\n {short: 'pass', long: 'passage'},\n {short: 'sent', long: 'sentier'},\n {short: 'imp', long: 'impasse'},\n {short: 'all', long: 'allée'},\n {short: 'chem', long: 'chemin'},\n {short: 'ham', long: 'hameau'},\n {short: 'dom', long: 'domaine'}\n ];\n\n public static autoCorrectCity(city: string): string {\n if (isNullOrUndefined(city) || typeof city !== 'string' || city.length === 0) {\n return city;\n }\n\n if (city.toLowerCase().startsWith('st-') || city.toLowerCase().startsWith('st ')) {\n city = 'Saint ' + city.substring(3);\n }\n\n const CITIES: string[] = Object.values(AddressUtil.ZIPCODE_CITY).flat();\n\n const exactMatch: string = CITIES.find((c) => c.toLowerCase() === city.toLowerCase());\n if (exactMatch !== undefined) {\n return exactMatch;\n }\n\n const partialMatch: string = CITIES.find((c) => {\n const result: { add: number, remove: number } = AddressUtil.countDiff(city, c);\n\n return result.add <= 2 && result.remove <= 2;\n });\n if (partialMatch !== undefined) {\n return partialMatch;\n }\n\n const matchNoDash: string = CITIES.find((c) => c.replace(/-/g, ' ').toLowerCase() === city.toLowerCase());\n if (matchNoDash !== undefined) {\n return matchNoDash;\n }\n\n const partialMatchNoDash: string = CITIES.find((c) => {\n const result: { add: number, remove: number } = AddressUtil.countDiff(city, c.replace(/-/g, ' '));\n\n return result.add <= 2 && result.remove <= 2;\n });\n if (partialMatchNoDash !== undefined) {\n return partialMatchNoDash;\n }\n\n const startsWith: string = CITIES.find((c) => c.toLowerCase().startsWith(city.toLowerCase()));\n if (startsWith !== undefined) {\n return startsWith;\n }\n\n const isIncluded: string = CITIES.find((c) => city.toLowerCase().includes(c.toLowerCase()));\n if (isIncluded !== undefined) {\n return isIncluded;\n }\n\n return city;\n }\n\n public static autoCorrectStreet(street: string): string {\n if (isNullOrUndefined(street) || typeof street !== 'string' || street.length === 0) {\n return street;\n }\n\n AddressUtil.STREET_TYPE.forEach((type) => {\n if (type.short.length < type.long.length) {\n street = street.replace(new RegExp('(\\\\s' + String(type.short) + '\\\\.?\\\\s)', 'ig'), ' ' + String(type.long) + ' ');\n street = street.replace(new RegExp('(\\\\s' + String(type.short) + '\\\\.\\\\s)', 'ig'), ' ' + String(type.long) + ' ');\n }\n });\n // street = street.replace(/(\\sav\\s)/ig, ' avenue ');\n // street = street.replace(/(\\sav\\.\\s)/ig, ' avenue ');\n // street = street.replace(/(\\sbd\\s)/ig, ' boulevard ');\n // street = street.replace(/(\\sbd\\.\\s)/ig, ' boulevard ');\n // street = street.replace(/(\\schau\\.\\s)/ig, ' chaussée ');\n // street = street.replace(/(\\strav\\.\\s)/ig, ' traverse ');\n // street = street.replace(/(\\spl\\.\\s)/ig, ' place ');\n // street = street.replace(/(\\spass\\.\\s)/ig, ' passage ');\n // street = street.replace(/(\\ssent\\.\\s)/ig, ' sentier ');\n // street = street.replace(/(\\simp\\.\\s)/ig, ' impasse ');\n // street = street.replace(/(\\sall\\.\\s)/ig, ' allée ');\n // street = street.replace(/(\\schem\\.\\s)/ig, ' chemin ');\n // street = street.replace(/(\\sham\\.\\s)/ig, ' hameau ');\n // street = street.replace(/(\\sdom\\.\\s)/ig, ' domaine ');\n\n const leadingZeroRegExp: RegExp = new RegExp('^(0+)[0-9]+,?\\\\s[a-zA-Z]+');\n const leadingZeroMatches: string[] = leadingZeroRegExp.exec(street);\n if (leadingZeroMatches !== null && leadingZeroMatches.length === 2) {\n street = street.substring(leadingZeroMatches[1].length);\n }\n\n AddressUtil.STREET_TYPE.forEach((type) => {\n street = street.replace(new RegExp('([0-9]+)(' + String(type.long) + '\\\\s)', 'ig'), '$1 $2');\n street = street.replace(new RegExp('([0-9]+)(' + String(type.short) + '\\\\.?\\\\s)', 'ig'), '$1 ' + String(type.long) + ' ');\n });\n\n return street;\n }\n\n public static getZipCodeFromCity(city: string): string {\n if (isNullOrUndefined(city)) {\n return undefined;\n }\n\n return Object.keys(AddressUtil.ZIPCODE_CITY).reduce((selected, zipcode) => {\n if (AddressUtil.ZIPCODE_CITY[zipcode].find((name) => name.toLowerCase() === city.toLowerCase()) !== undefined) {\n return zipcode;\n }\n\n return selected;\n }, undefined);\n }\n\n public static getCityFromZipCode(zip: string, rawAddress: string): string {\n if (zip === undefined || rawAddress === undefined) {\n return undefined;\n }\n\n const candidates: string[] = AddressUtil.ZIPCODE_CITY[zip];\n if (candidates === undefined) {\n return undefined;\n }\n\n if (candidates.length === 1) {\n return candidates[0];\n }\n\n let city: string;\n rawAddress.split(',').forEach((part) => {\n city = candidates.find((candidate) => {\n return part.trim().toLowerCase() === candidate.trim().toLowerCase();\n });\n });\n if (city !== undefined) {\n return city;\n }\n\n return candidates[0];\n }\n\n public static isZipCode(zip: string): boolean {\n if (typeof zip !== 'string') {\n return false;\n }\n\n if (Object.keys(AddressUtil.ZIPCODE_CITY).includes(zip)) {\n return true;\n }\n\n return ValidatorUtil.isNumber(zip) && zip.length === 5 && !zip.includes('.') && !zip.includes('-');\n }\n\n public static parse(raw: string, isFormatted: boolean = true): { street?: string, zip?: string, city?: string, country?: string } {\n const address: { street?: string, zip?: string, city?: string, country?: string } = {};\n if (!isNullOrUndefined(raw)) {\n const rawAddressParts: string[] = raw.split(',');\n if (rawAddressParts.length >= 3 && isFormatted) {\n if (AddressUtil.COUNTRIES.find((c) => raw.toLowerCase().includes(' ' + c.toLowerCase())) === undefined) {\n rawAddressParts.push('France');\n }\n\n let i: number = rawAddressParts.length - 1;\n address.country = rawAddressParts[i].trim();\n rawAddressParts.splice(i--, 1);\n if (rawAddressParts[i] !== undefined && rawAddressParts[i].trim().includes(' ')) {\n const rawParts: string[] = rawAddressParts[i].trim().split(' ');\n address.zip = rawParts[0] === undefined ? undefined : rawParts[0].trim();\n rawParts.splice(0, 1);\n address.city = rawParts.join(' ').trim();\n rawAddressParts.splice(i--, 1);\n } else if (!isNaN(Number(rawAddressParts[i].trim()))) {\n address.zip = rawAddressParts[i].trim();\n rawAddressParts.splice(i--, 1);\n if (i >= 2) {\n address.city = rawAddressParts[i].trim();\n rawAddressParts.splice(i--, 1);\n }\n } else if (!isNaN(Number(rawAddressParts[i - 1].trim()))) {\n address.city = rawAddressParts[i].trim();\n rawAddressParts.splice(i--, 1);\n address.zip = rawAddressParts[i].trim();\n rawAddressParts.splice(i--, 1);\n } else {\n address.city = rawAddressParts[i].trim();\n rawAddressParts.splice(i--, 1);\n }\n address.street = rawAddressParts.map((part) => part.trim()).join(' ').trim();\n } else {\n let rawAddress: string = raw.toLowerCase();\n Object.keys(AddressUtil.ZIPCODE_CITY).forEach((zipcode) => {\n if (rawAddress.includes(zipcode)) {\n address.zip = zipcode;\n try {\n rawAddress = rawAddress.replace(new RegExp(StringUtil.escapeRegExp(zipcode), 'ig'), '');\n } catch (_e) {\n // ignore\n }\n }\n });\n Object.values(AddressUtil.ZIPCODE_CITY).flat().forEach((city) => {\n if (rawAddress.includes(city.toLowerCase()) && (address.zip === undefined || AddressUtil.ZIPCODE_CITY[address.zip]?.find((c) => c.toLowerCase() === city.toLowerCase()))) {\n address.city = city;\n try {\n rawAddress = rawAddress.replace(new RegExp(StringUtil.escapeRegExp(city), 'ig'), '');\n } catch (_e) {\n // ignore\n }\n }\n });\n AddressUtil.COUNTRIES.forEach((country) => {\n if (rawAddress.includes(' ' + country.toLowerCase()) && !rawAddress.includes('de ' + country.toLowerCase()) && !rawAddress.includes('de la ' + country.toLowerCase())) {\n address.country = country;\n try {\n rawAddress = rawAddress.replace(new RegExp(StringUtil.escapeRegExp(' ' + country), 'ig'), '');\n } catch (_e) {\n // ignore\n }\n }\n });\n\n if (address.street === undefined) {\n address.street = trim(rawAddress.split(',').map((part) => part.trim()).join(' '), '-').trim();\n }\n }\n\n if (address.country === undefined) {\n address.country = 'France';\n }\n }\n\n if (address.street !== undefined) {\n address.street = FormatterUtil.lower(FormatterUtil.trim(String(address.street)));\n }\n if (address.zip !== undefined) {\n address.zip = FormatterUtil.upper(FormatterUtil.trim(String(address.zip)));\n }\n if (address.city !== undefined) {\n address.city = AddressUtil.autoCorrectCity(FormatterUtil.capitalize(FormatterUtil.trim(String(address.city))));\n }\n if (address.country !== undefined) {\n address.country = FormatterUtil.capitalize(FormatterUtil.trim(String(address.country)));\n }\n\n return AddressUtil.complete(address);\n }\n\n public static complete(address: { street?: string, zip?: string, city?: string, country?: string }): { street?: string, zip?: string, city?: string, country?: string } {\n if (address.city === undefined || address.city.length === 0) {\n const city: string = AddressUtil.getCityFromZipCode(address.zip, address.street);\n if (city !== undefined) {\n address.city = city;\n }\n }\n if (typeof address.street === 'string') {\n AddressUtil.REGIONS.forEach((region) => {\n address.street = StringUtil.removeText(address.street, region).trim();\n });\n }\n if (FormatterUtil.lower(address.country) === 'fr') {\n address.country = 'France';\n }\n\n return address;\n }\n\n public static removeDuplicates(str: string): string {\n if (typeof str !== 'string') {\n return str;\n }\n\n const output: string[] = [];\n\n str.split(',').forEach((part) => {\n if (output.find((o) => o.trim().toLowerCase().includes(part.trim().toLowerCase())) === undefined) {\n output.push(part);\n }\n });\n\n return output.join(',');\n }\n\n private static countDiff(str: string, reference: string): { add: number, remove: number } {\n const result: { add: number, remove: number } = {add: 0, remove: 0};\n\n diff(str.toLowerCase(), reference.toLowerCase()).forEach((value) => {\n switch (value[0]) {\n case -1:\n result.remove += value[1].length;\n break;\n case 1:\n result.add += value[1].length;\n break;\n }\n });\n\n return result;\n }\n}\n","import {DateTime} from 'luxon';\nimport {cloneDeep} from 'lodash';\nimport {isNullOrUndefined} from 'common/util/HelperUtil';\n\nexport class DateUtil {\n private static readonly PERIOD_MAX_DATES: number = 90;\n private static readonly WEEK_DAYS: {[id: number]: string} = {1: 'lundi', 2: 'mardi', 3: 'mercredi', 4: 'jeudi', 5: 'vendredi', 6: 'samedi', 7: 'dimanche'};\n\n public static getCycleDateFromFullDate(date: string, cycle: 'daily' | 'weekly' | 'monthly'): string {\n if (cycle === 'weekly') {\n const result: string = DateTime.fromISO(date.replace(/-W([0-9])$/i, '-W0$1')).toISOWeekDate();\n if (result === null) {\n return date;\n }\n\n const parts: string[] = result.split('-');\n\n return parts.length > 2 ? parts[0] + '-' + parts[1] : parts.join('-');\n } else if (cycle === 'monthly') {\n return DateTime.fromISO(date).toFormat('yyyy-LL');\n }\n\n return DateTime.fromISO(date).toISODate();\n }\n\n public static displayWeekDay(weekDay: number): string {\n let displayWeekDay: string = '';\n if (DateUtil.WEEK_DAYS[weekDay] !== undefined) {\n displayWeekDay = DateUtil.WEEK_DAYS[weekDay];\n }\n\n return displayWeekDay;\n }\n\n public static generatePeriod(fromDate: string, toDate: string, initialValue: Record<string, any>, addDate: boolean = true, MAX_DAYS: number = DateUtil.PERIOD_MAX_DATES,\n cycle: 'daily' | 'weekly' | 'monthly' = 'daily'): {[date: string]: Record<string, any>} {\n const jump: {[str: string]: number} = {'daily': {day: 1}, 'weekly': {week: 1}, 'monthly': {month: 1}}[cycle];\n let cursor: string = DateTime.fromISO(fromDate, {setZone: true}).toISODate();\n const stop: string = DateTime.fromISO(toDate, {setZone: true}).toISODate();\n let i: number = 0;\n const data: {[date: string]: Record<string, any>} = {};\n while (cursor <= stop && i < MAX_DAYS) {\n const date: string = DateUtil.getCycleDateFromFullDate(cursor, cycle);\n data[date] = cloneDeep(initialValue);\n if (addDate) {\n data[date].date = date;\n }\n cursor = DateTime.fromISO(cursor, {setZone: true}).plus(jump).toISODate();\n i++;\n }\n\n return data;\n }\n\n public static getOpenPeriods(openings: {from: string, to: string}[], closings: {from: string, to: string}[]): {from: string, to: string}[] {\n const results: {from: string, to: string}[] = [];\n\n openings.forEach((opening) => {\n const tmpOpenings: {from: string, to: string}[] = [opening];\n while (tmpOpenings.length > 0) {\n const open: {from: string, to: string} = tmpOpenings[0];\n\n const isOpen: boolean = closings.find((closing) => closing.from <= open.from && open.to <= closing.to) === undefined;\n if (isOpen) {\n const startLater: {from: string, to: string} = closings.find((closing) => closing.from <= open.from && open.from < closing.to && closing.to < open.to);\n if (startLater !== undefined) {\n tmpOpenings.push({from: startLater.to, to: open.to});\n } else {\n const endEarlier: {from: string, to: string} = closings.find((closing) => open.from < closing.from && open.to > closing.from && open.to <= closing.to);\n if (endEarlier !== undefined) {\n tmpOpenings.push({from: open.from, to: endEarlier.from});\n } else {\n const cut: {from: string, to: string} = closings.find((closing) => open.from < closing.from && closing.to < open.to);\n if (cut !== undefined) {\n tmpOpenings.push({from: open.from, to: cut.from});\n tmpOpenings.push({from: cut.to, to: open.to});\n } else {\n results.push(open);\n }\n }\n }\n }\n\n tmpOpenings.shift();\n }\n });\n\n\n return results;\n }\n\n public static limitDate(targetDate: string, baseDate: string, limitInSeconds: number = 0): string {\n if (targetDate === undefined || baseDate === undefined) {\n return undefined;\n }\n\n const target: string = DateTime.fromISO(targetDate, {setZone: true}).toISO();\n const limit: string = DateTime.fromISO(baseDate, {setZone: true}).plus({seconds: limitInSeconds}).toISO();\n\n return target > limit ? limit : target;\n }\n\n public static localeToISO(localeDate: string): string {\n const frFormat1: RegExp = new RegExp('[0-9]{2}/[0-9]{2}/[0-9]{4}');\n const frFormat2: RegExp = new RegExp('[0-9]{2}-[0-9]{2}-[0-9]{4}');\n const isoFormat: RegExp = new RegExp('[0-9]{4}-[0-9]{2}-[0-9]{2}');\n\n let isoDate: string;\n if (frFormat1.test(localeDate)) {\n const parts: string[] = localeDate.split('/');\n isoDate = parts[2] + '-' + parts[1] + '-' + parts[0];\n } else if (frFormat2.test(localeDate)) {\n const parts: string[] = localeDate.split('-');\n isoDate = parts[2] + '-' + parts[1] + '-' + parts[0];\n } else if (isoFormat.test(localeDate)) {\n isoDate = localeDate;\n }\n\n return isoDate;\n }\n\n public static slotToTime(timeSlot: string): string {\n const timeFormat: RegExp = new RegExp('^(\\\\s)?[0-9]{2}:[0-9]{2}(\\\\s)?$');\n const slotFormat: RegExp = new RegExp('^(\\\\s)?[0-9]{2}:[0-9]{2}(\\\\s)?-(\\\\s)?[0-9]{2}:[0-9]{2}(\\\\s)?$');\n\n timeSlot = timeSlot.trim();\n\n let time: string;\n if (timeFormat.test(timeSlot)) {\n time = timeSlot.trim() + ':00';\n } else if (slotFormat.test(timeSlot)) {\n const parts: string[] = timeSlot.split('-');\n time = parts[0].trim() + ':00';\n }\n\n return time;\n }\n\n public static delay(fromDate: string, toDate: string, unit: 'minutes' | 'hours' | 'days' | 'months'): number {\n if (isNullOrUndefined(fromDate) || isNullOrUndefined(toDate)) {\n return 0;\n }\n\n return Math.round(Math.abs(DateTime.fromISO(fromDate, {setZone: true}).toUTC()\n .diff(DateTime.fromISO(toDate, {setZone: true}).toUTC(), [unit])[unit]))\n }\n\n public static round(date: string, roundingInMs: number = 0): string {\n if (typeof date !== 'string') {\n return date;\n }\n\n const dateTime: DateTime = DateTime.fromISO(date, {setZone: true});\n\n return DateTime.fromMillis(Math.round((+dateTime.toMillis()) / roundingInMs) * roundingInMs).setZone(dateTime.zone).toISO();\n }\n\n public static min(dates: string[]): string {\n return dates.reduce((min, date) => {\n if (typeof min !== 'string' || min > date) {\n return date;\n }\n\n return min;\n }, undefined);\n }\n\n public static max(dates: string[]): string {\n return dates.reduce((max, date) => {\n if (max === undefined || max < date) {\n return date;\n }\n\n return max;\n }, undefined);\n }\n}\n","export class ExtractorUtil {\n public static phone(raw: string, locale: 'fr'): string {\n if (typeof raw !== 'string') {\n return undefined;\n }\n\n raw = raw.trim().replace(/\\s?\\.?\\-?\\(?\\)?/g, '');\n switch (locale) {\n case 'fr': {\n const phoneFrRegex: RegExp = new RegExp('(0[6-7][0-9]{8})', 'i');\n const result: string[] = phoneFrRegex.exec(raw);\n if (result !== null && result.length > 0 && result[0] !== null) {\n return result[0];\n }\n }\n }\n\n return undefined;\n }\n}\n","import {MathUtil} from 'common/util/MathUtil';\n\nexport class PriceUtil {\n private static readonly currencies: {[iso: string]: {symbol: string, position: string}} = {\n 'CAD': {symbol: '$', position: 'before'},\n 'EUR': {symbol: '€', position: 'after'},\n 'USD': {symbol: '$', position: 'before'}\n };\n\n public static applyTaxes(priceTaxExcluded: string, taxRates: number[], decimals: number = 2): string {\n let priceTaxIncluded: number = Number(priceTaxExcluded);\n taxRates.forEach((rate) => {\n priceTaxIncluded += Number(priceTaxExcluded) * rate;\n });\n\n return String(MathUtil.round(priceTaxIncluded, decimals));\n }\n\n public static calculateTaxes(priceTaxExcluded: number, taxRates: number[]): number {\n let taxes: number = 0;\n taxRates.forEach((rate) => {\n taxes += priceTaxExcluded * rate;\n });\n\n return MathUtil.round(taxes, 2);\n }\n\n public static displayWithCurrency(price: string, isoCurrency: string): string {\n if (price === undefined || price === null) {\n return price;\n }\n\n const currency: {symbol: string, position: string} = PriceUtil.currencies[isoCurrency];\n\n let newPrice: string = price + ' ' + isoCurrency;\n if (currency !== undefined) {\n switch (currency.position) {\n case 'before':\n newPrice = currency.symbol + price;\n break;\n case 'after':\n newPrice = price + currency.symbol;\n break;\n }\n }\n\n return newPrice;\n }\n\n public static format(price: string, locale: 'fr' | 'us', decimals: number = 2): string {\n if (price === undefined || price === null) {\n return price;\n }\n\n const priceNumber: number = Number(price.replace(/\\,/gi, ''));\n const standardPrice: string = priceNumber.toLocaleString('en-US', {\n style: 'decimal',\n useGrouping: true,\n minimumFractionDigits: decimals,\n maximumFractionDigits: decimals\n });\n\n switch (locale) {\n case 'fr':\n return standardPrice.replace(/\\,/gi, ' ').replace(/\\./gi, ',');\n case 'us':\n return standardPrice;\n }\n }\n\n public static round(price: string, precision: number = 0.10): string {\n const priceInCents: number = Number(price) * 100;\n const precisionInCents: number = precision * 100;\n const rest: number = priceInCents % precisionInCents;\n\n return String(MathUtil.round((priceInCents - rest) + (rest < Math.ceil(precisionInCents / 2) ? 0 : precisionInCents), 2) / 100);\n }\n}\n"],"names":["root","factory","exports","module","define","amd","global","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","require","MainException","Error","message","code","data","super","this","name","captureStackTrace","stack","ExternalApiException","Env","Environment","getMode","process","env","NODE_ENV","DEVELOPMENT","PRODUCTION","TEST","APP_ID","UnauthorizedException","ERROR_CODE","isNullOrUndefined","Logger","init","sentryToken","app","tracesSampleRate","dsn","integrations","levels","nodeProfilingIntegration","environment","maxBreadcrumbs","profilesSampleRate","trace","extra","includes","console","info","JSON","stringify","category","level","debug","log","scope","setExtra","warning","error","response","requestErrorData","warn","Retry","request","retries","logger","operation","factor","minTimeout","maxTimeout","randomize","Promise","resolve","reject","attempt","then","catch","retry","ValidatorUtil","isEmail","email","RegExp","test","isPhone","phone","isIntMobilePhone","caRegex","frRegex","usRegex","isNumber","num","isISODate","str","isNaN","Date","getTime","HubriseAccessLevel","BadParameterException","HubriseAuthResource","HubriseRightAccess","HubriseCountryCode","HubriseCurrencyCode","HubriseLanguageCode","HubriseLocale","HubriseTimezoneId","HubriseEventType","HubriseResourceType","HubriseOrderStatus","HubriseServiceType","HubriseApi","accessToken","authorize","clientId","redirect","accessLevel","rights","profile","appInstanceId","BASE_AUTH_URL","String","encodeURIComponent","LOCATION","ACCOUNT","keys","reduce","results","concat","join","PROFILE","getToken","clientSecret","auth","client_id","client_secret","headers","timeout","TIMEOUT","bind","getUser","hubriseUser","BASE_URL","token","getAccount","access","getLocation","account","hubriseAccount","getLocations","hubriseLocations","hubriseLocationId","hubriseLocation","url","createCustomer","hubriseCustomerListId","hubriseCustomer","createdCustomer","updateCustomer","id","customer","getCustomer","hubriseCustomerId","getCustomers","reference","parameters","URLSearchParams","hubriseCustomers","append","toString","getCustomerLists","hubriseCustomerLists","createOrder","hubriseOrder","createdOrder","getOrder","hubriseOrderId","getOrders","startDate","endDate","limit","hubriseOrders","queryParams","sort","b","created_at","localeCompare","setOrderStatus","status","getCatalog","hubriseCatalogId","catalog","getCatalogs","catalogs","createWebhook","events","ObjectUtil","compact","options","isArray","ouput","forEach","length","isObject","push","removeEmptyString","update","source","target","assign","HubriseCatalogConverter","editableItems","Array","products","withRef","withName","categories","items","p","skus","sku","sku_ref","ref","category_name","category_id","product_name","filter","part","quantity","tax_rate","price","i","editableItemOptions","optionLists","option_lists","editableItemOptionNames","option_list_ids","optionListId","optionList","option","option_list_name","editableItemOptionRefs","itemId","HubriseOrderConverter","serviceType","map","editableItem","editableOption","Number","sku_name","subtotal","customer_notes","MathUtil","sum","values","accumulator","avg","total","round","applyVariation","variation","increase","median","valuesSorted","Math","floor","percentage","decimals","originalValue","newValue","percent","abs","HubrisePriceUtil","prices","defaultCurrency","EUR","priceToAmount","result","amount","amountToPrice","currency","multiply","multiplier","parts","split","slice","toFixed","TotalHubriseCalculator","calculateTotals","order","findCurrency","item","minimumOrderFee","deliveryFee","totalDiscount","itemOrOptions","c","Path","registerBasePath","basePath","APP_HOME","BASE_PATH","endsWith","db","storage","session","BadRequestException","ConflictException","DuplicateException","InternalException","NotImplementedException","ObjectNotFoundException","PageNotFoundException","HandlerController","_request","json","AuthenticationMiddleware","configuration","handler","next","authenticated","jwt","authApiKey","sessionKeys","required","none","authNone","Authorization","startsWith","secret","urlStartsWith","find","originalUrl","AuthorizationMiddleware","can","_action","_subject","Server","create","origins","port","backendPort","DEFAULT_PORT","backendLocalUrl","set","disable","use","inflate","reviver","strict","type","verify","urlencoded","origin","credentials","listen","getSessionSecret","sessionCookieName","SALT","digest","ApiMockup","isDone","isActive","pending","pendingMocks","reset","cleanAll","HubriseApiMockup","times","allowUnmocked","filteringPath","path","reply","cloneDeep","post","put","generateRandomId","now","orders","patch","UrlUtil","isUTF8","charset","toLowerCase","urlencode","buf","encode","encodeStr","ch","toUpperCase","SmsSenderService","mode","send","senderName","rawPhones","isCommercial","sendAt","phones","checkPhoneFormat","MESSAGE_MAX_LENGTH","substring","params","emetteur","numero","replace","classe_msg","nbr_msg","ceil","stop","date_envoi","DateTime","fromISO","setZone","toFormat","toISOString","hour","plus","day","BASE_API_URL","trim","asyncForEach","array","callback","wait","time","setTimeout","GeneratorUtil","size","symbolUpperCases","int","color","alpha","alphaHex","rgbToHex","defaultColor","colorList","rgb","hex","min","max","POSITIVE_INFINITY","random","password","symbolLowerCases","FileSystem","dirPath","filePath","lastIndexOf","listFiles","isDir","separator","files","output","fileName","isFile","randomFile","suggestion","filenames","index","move","recursive","read","readJson","jsonPath","isJson","parse","readJsonFiles","write","rawData","encoding","writeJson","isDirectory","_error","MinifierEngine","css","content","compatibility","format","sourceMap","minify","styles","html","collapseBooleanAttributes","collapseInlineTagWhitespace","collapseWhitespace","continueOnParseError","decodeEntities","html5","minifyCSS","minifyJS","noNewlinesBeforeTagClose","preserveLineBreaks","preventAttributesEscaping","processConditionalComments","quoteCharacter","removeAttributeQuotes","removeComments","removeEmptyAttributes","removeEmptyElements","removeOptionalTags","removeRedundantAttributes","removeScriptTypeAttributes","removeStyleLinkTypeAttributes","removeTagWhitespace","TemplateEngine","minifier","render","templatePath","baseIncludePath","view","__dirname","fileSystem","include","includeParts","templateName","EmailSenderService","apiPublicKey","apiSecretKey","templateEngine","mailjet","Client","apiKey","apiSecret","sendDeliveryDelay","sender","recipient","base","copyright","year","getUTCFullYear","text","sendNotification","subject","sendTrackDelivery","textContent","htmlContent","sendUserNotification","customId","sendUsersNotifications","messages","contents","sendDiscount","sendDiscounts","recipients","contact","Messages","statusCode","Configuration","filesystem","config","currentEnvironment","full","merge","_e","Database","connect","entities","con","logging","bigNumberStrings","timezone","connection","createConnection","synchronize","close","Displayer","success","Downloader","image","outputPath","outputName","writer","method","responseType","pipe","on","StringUtil","escapeRegExp","hash","seed","h1","h2","charCodeAt","imul","padStart","nullable","removeMultiSpaces","removeText","targets","replacers","slugify","raw","toLower","deburr","truncate","FormatterUtil","capitalize","lowraw","lower","word","charAt","ucfirst","toLocaleLowerCase","upper","toLocaleUpperCase","locale","preformatPhone","phoneNat","phoneInt","stripEmoji","match","exec","stripExoticCharacters","AddressUtil","autoCorrectCity","city","CITIES","ZIPCODE_CITY","flat","exactMatch","partialMatch","countDiff","add","remove","matchNoDash","partialMatchNoDash","isIncluded","autoCorrectStreet","street","STREET_TYPE","short","long","leadingZeroMatches","getZipCodeFromCity","selected","zipcode","getCityFromZipCode","zip","rawAddress","candidates","candidate","isZipCode","isFormatted","address","rawAddressParts","COUNTRIES","country","splice","rawParts","complete","REGIONS","region","removeDuplicates","DateUtil","getCycleDateFromFullDate","date","cycle","toISOWeekDate","toISODate","displayWeekDay","weekDay","WEEK_DAYS","generatePeriod","fromDate","toDate","initialValue","addDate","MAX_DAYS","PERIOD_MAX_DATES","jump","week","month","cursor","getOpenPeriods","openings","closings","opening","tmpOpenings","open","closing","from","to","startLater","endEarlier","cut","shift","limitDate","targetDate","baseDate","limitInSeconds","toISO","seconds","localeToISO","localeDate","frFormat1","frFormat2","isoFormat","isoDate","slotToTime","timeSlot","timeFormat","slotFormat","delay","unit","toUTC","diff","roundingInMs","dateTime","fromMillis","toMillis","zone","dates","ExtractorUtil","PriceUtil","applyTaxes","priceTaxExcluded","taxRates","priceTaxIncluded","rate","calculateTaxes","taxes","displayWithCurrency","isoCurrency","currencies","newPrice","position","symbol","standardPrice","toLocaleString","style","useGrouping","minimumFractionDigits","maximumFractionDigits","precision","priceInCents","precisionInCents","rest"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"common-api.node.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IAC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J,IAAb2E,QAA4C3E,IAAlB2E,EAAS/C,KACnC,MAAM,IAAIM,EAAqB,mCAEvC,GAAG,EAAGc,EAAO0B,MAAM+E,KAAKzG,GAC5B,E,EA1WuB,EAAA4G,SAAmB,6BACnB,EAAAtB,cAAwB,yCACvB,EAAAkB,QAAkB,KX1B9C,SAAYtC,GACR,kBACA,gCACA,oBACA,wBACA,0CACA,kCACH,CAPD,CAAYA,IAAAA,EAAmB,KCA/B,SAAYC,GACR,cACA,eACH,CAHD,CAAYA,IAAAA,EAAkB,KCA9B,SAAYC,GACR,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,SACH,CAtMD,CAAYA,IAAAA,EAAkB,KCA9B,SAAYC,GACR,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,WACH,CA1KD,CAAYA,IAAAA,EAAmB,KCA/B,SAAYC,GACR,UACA,UACA,UACA,UACA,UACA,SACH,CAPD,CAAYA,IAAAA,EAAmB,KCA/B,SAAYC,GAER,gBACA,gBACA,gBACA,gBACA,gBACA,gBAGA,gBACA,gBACA,gBACA,gBAGA,gBACA,gBACA,gBACA,gBACA,gBAGA,gBACA,gBACA,gBAGA,gBACA,gBAGA,gBACA,gBAGA,gBACA,gBAGA,gBACA,gBACA,gBACA,gBACA,gBAGA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBAGA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBAGA,gBACA,gBACA,gBACA,gBACA,gBACA,gBAGA,gBACA,gBACA,gBACA,gBACA,gBAGA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBAGA,gBACA,gBACA,eACH,CAhGD,CAAYA,IAAAA,EAAa,KCAzB,SAAYC,GAER,kCACA,kCACA,gCACA,8BACA,wCACA,8BACA,oCACA,4CACA,4BACA,oCACA,8BACA,gCACA,oCACA,kCACA,oCACA,oCACA,kCACA,8BACA,oCAGA,8BACA,wCACA,wCACA,kEACA,4DACA,wDACA,oDACA,0DACA,wDACA,kEACA,oDACA,0DACA,0DACA,wDACA,wDACA,sCACA,gCACA,kDACA,sCACA,gCACA,kCACA,wCACA,kCACA,gCACA,gDACA,8CACA,kCACA,oCACA,oCACA,oCACA,wCACA,gDACA,0CACA,wCACA,kCACA,8CACA,kCACA,8CACA,kCACA,oCACA,sCACA,sCACA,4CACA,4CACA,wCACA,wCACA,wCACA,0CACA,wCACA,wCACA,kCACA,oCACA,kCACA,0CACA,8DACA,8CACA,oDACA,0DACA,wDACA,gDACA,wDACA,oDACA,kCACA,oCACA,oCACA,kCACA,4DACA,4DACA,kCACA,8BACA,4CACA,kCACA,oCACA,kCACA,0CACA,wCACA,sCACA,wCACA,kCACA,0CACA,4CACA,sCACA,oCACA,wCACA,0CACA,sCACA,8BACA,oCACA,4DACA,4DACA,kEACA,8BACA,oCACA,kCACA,0CACA,oCACA,kDACA,4CACA,4CACA,8CACA,8CACA,kCACA,kCACA,sCACA,0CACA,sCACA,sCACA,gDACA,wCACA,8CACA,gCACA,sCACA,gDACA,4CACA,gCACA,oCACA,oCACA,wCACA,0CACA,sCACA,oCAGA,sCACA,sCACA,8CACA,wCACA,wCACA,0CACA,sCACA,wCAGA,4BACA,0BACA,4BACA,0BACA,4BACA,gCACA,4BACA,8BACA,wBACA,8BACA,8BACA,4BACA,8BACA,0BACA,8BACA,gCACA,0BACA,wBACA,0BACA,gCACA,kCACA,wBACA,4BACA,sCACA,kCACA,wBACA,8BACA,8BACA,gCACA,kCACA,0BACA,kCACA,8BACA,kCACA,gCACA,8BACA,sCACA,8BACA,0BACA,8BACA,gCACA,4BACA,8BACA,wCACA,sCACA,wBACA,wBACA,kCACA,kCACA,0BACA,gCACA,kCACA,4BACA,gCACA,kCACA,0BACA,gCACA,kCACA,0CACA,4BACA,gCACA,8BACA,4BACA,8BACA,0BACA,0BACA,sCACA,4BACA,gCACA,sCACA,8BACA,4BACA,0CACA,8BAGA,oCACA,sCACA,oCACA,4CACA,kCACA,sCACA,kDACA,sCAGA,0CACA,0CACA,gDACA,sCACA,oCACA,sCACA,0CACA,4CACA,4CACA,oCACA,sCAGA,oBACA,8BACA,gCACA,gCACA,gCACA,gCACA,gCACA,8BACA,8BACA,8BACA,8BACA,8BACA,8BACA,8BACA,8BACA,6BACA,+BACA,+BACA,+BACA,6BACA,6BACA,6BACA,6BACA,6BACA,6BACA,6BACA,6BACA,oBAGA,kCACA,sCACA,gCACA,oCACA,gCACA,oCACA,sCACA,oCACA,oCACA,gCACA,sCACA,oCACA,oCACA,0CACA,8BACA,4BACA,gCACA,gCACA,gCACA,8BACA,8BACA,gCACA,8BACA,gCACA,4BACA,4BACA,gCACA,kCACA,wCACA,8BACA,kCACA,gCACA,sCACA,gCACA,kCACA,sCACA,gCACA,gCAGA,gCACA,oCACA,sCAGA,8BACA,sCACA,8CACA,oCACA,kCACA,gCACA,oCACA,8BACA,wCACA,oCACA,4CACA,8BACA,sCACA,kCACA,0CACA,kCACA,wCACA,wCACA,gCACA,8BACA,oCACA,kCACA,wCACA,gCACA,sCACA,8CACA,wCACA,kCACA,kCACA,uCACH,CAxWD,CAAYA,IAAAA,EAAiB,KCA7B,SAAYC,GACR,kBACA,kBACA,gBACA,iBACH,CALD,CAAYA,IAAAA,EAAgB,KCA5B,SAAYC,G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AWD,GAE1E,IAAIE,EAAmB9e,EAAQ,IAAM4e,EACrC,QAAiBhuB,IAAbsS,EACA,OAAQA,EAAS6b,UACb,IAAK,SACDD,EAAW5b,EAAS8b,OAAShf,EAC7B,MACJ,IAAK,QACD8e,EAAW9e,EAAQkD,EAAS8b,OAKxC,OAAOF,CACX,CAEO,aAAOvP,CAAOvP,EAAeuX,EAAqBlV,EAAmB,GACxE,GAAIrC,QACA,OAAOA,EAGX,MACMif,EADsB/d,OAAOlB,EAAM8K,QAAQ,OAAQ,KACfoU,eAAe,QAAS,CAC9DC,MAAO,UACPC,aAAa,EACbC,sBAAuBhd,EACvBid,sBAAuBjd,IAG3B,OAAQkV,GACJ,IAAK,KACD,OAAO0H,EAAcnU,QAAQ,OAAQ,KAAKA,QAAQ,OAAQ,KAC9D,IAAK,KACD,OAAOmU,EAEnB,CAEO,YAAOrd,CAAM5B,EAAeuf,EAAoB,IACnD,MAAMC,EAAuC,IAAhBte,OAAOlB,GAC9Byf,EAAuC,IAAZF,EAC3BG,EAAeF,EAAeC,EAEpC,OAAOtmB,OAAOmI,EAASM,MAAO4d,EAAeE,GAASA,EAAOxd,KAAK+I,KAAKwU,EAAmB,GAAK,EAAIA,GAAmB,GAAK,IAC/H,E,OAzEwB,GAAAZ,WAAkE,CACtF,IAAO,CAACG,OAAQ,IAAKD,SAAU,UAC/B,IAAO,CAACC,OAAQ,IAAKD,SAAU,SAC/B,IAAO,CAACC,OAAQ,IAAKD,SAAU,W","sources":["webpack://SmilePlayerCommon/webpack/universalModuleDefinition","webpack://SmilePlayerCommon/webpack/bootstrap","webpack://SmilePlayerCommon/webpack/runtime/compat get default export","webpack://SmilePlayerCommon/webpack/runtime/define property getters","webpack://SmilePlayerCommon/webpack/runtime/hasOwnProperty shorthand","webpack://SmilePlayerCommon/webpack/runtime/make namespace object","webpack://SmilePlayerCommon/external commonjs \"axios\"","webpack://SmilePlayerCommon/./src/exception/MainException.ts","webpack://SmilePlayerCommon/./src/exception/ExternalApiException.ts","webpack://SmilePlayerCommon/external commonjs \"@sentry/node\"","webpack://SmilePlayerCommon/external commonjs \"@sentry/profiling-node\"","webpack://SmilePlayerCommon/./src/tool/Env.ts","webpack://SmilePlayerCommon/./src/tool/Environment.ts","webpack://SmilePlayerCommon/./src/exception/UnauthorizedException.ts","webpack://SmilePlayerCommon/./src/util/HelperUtil.ts","webpack://SmilePlayerCommon/./src/tool/Logger.ts","webpack://SmilePlayerCommon/external commonjs \"retry\"","webpack://SmilePlayerCommon/./src/tool/Retry.ts","webpack://SmilePlayerCommon/external node-commonjs \"querystring\"","webpack://SmilePlayerCommon/./src/util/ValidatorUtil.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/auth/HubriseAccessLevel.ts","webpack://SmilePlayerCommon/./src/exception/BadParameterException.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/auth/HubriseAuthResource.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/auth/HubriseRightAccess.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/address/HubriseCountryCode.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/common/HubriseCurrencyCode.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/common/HubriseLanguageCode.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/common/HubriseLocale.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/common/HubriseTimezoneId.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/callback/HubriseEventType.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/callback/HubriseResourceType.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/order/HubriseOrderStatus.ts","webpack://SmilePlayerCommon/./src/api/hubrise/model/order/HubriseServiceType.ts","webpack://SmilePlayerCommon/./src/api/hubrise/service/HubriseApi.ts","webpack://SmilePlayerCommon/external commonjs \"lodash\"","webpack://SmilePlayerCommon/./src/util/ObjectUtil.ts","webpack://SmilePlayerCommon/./src/api/hubrise/service/HubriseCatalogConverter.ts","webpack://SmilePlayerCommon/./src/api/hubrise/service/HubriseOrderConverter.ts","webpack://SmilePlayerCommon/./src/util/MathUtil.ts","webpack://SmilePlayerCommon/./src/api/hubrise/util/HubrisePriceUtil.ts","webpack://SmilePlayerCommon/./src/api/hubrise/service/TotalHubriseCalculator.ts","webpack://SmilePlayerCommon/./src/constant/Path.ts","webpack://SmilePlayerCommon/./src/exception/BadRequestException.ts","webpack://SmilePlayerCommon/./src/exception/ConflictException.ts","webpack://SmilePlayerCommon/./src/exception/DuplicateException.ts","webpack://SmilePlayerCommon/./src/exception/InternalException.ts","webpack://SmilePlayerCommon/./src/exception/NotImplementedException.ts","webpack://SmilePlayerCommon/./src/exception/ObjectNotFoundException.ts","webpack://SmilePlayerCommon/./src/exception/PageNotFoundException.ts","webpack://SmilePlayerCommon/./src/http/HandlerController.ts","webpack://SmilePlayerCommon/./src/http/AuthenticationMiddleware.ts","webpack://SmilePlayerCommon/./src/http/AuthorizationMiddleware.ts","webpack://SmilePlayerCommon/external node-commonjs \"crypto\"","webpack://SmilePlayerCommon/external commonjs \"express\"","webpack://SmilePlayerCommon/external commonjs \"cors\"","webpack://SmilePlayerCommon/external commonjs \"compression\"","webpack://SmilePlayerCommon/external commonjs \"helmet\"","webpack://SmilePlayerCommon/external commonjs \"connect-timeout\"","webpack://SmilePlayerCommon/./src/http/Server.ts","webpack://SmilePlayerCommon/external commonjs \"nock\"","webpack://SmilePlayerCommon/./src/mockup/ApiMockup.ts","webpack://SmilePlayerCommon/./src/mockup/HubriseApiMockup.ts","webpack://SmilePlayerCommon/external commonjs \"luxon\"","webpack://SmilePlayerCommon/external commonjs \"iconv-lite\"","webpack://SmilePlayerCommon/./src/util/UrlUtil.ts","webpack://SmilePlayerCommon/./src/service/sender/SmsSenderService.ts","webpack://SmilePlayerCommon/external node-commonjs \"path\"","webpack://SmilePlayerCommon/external commonjs \"mustache\"","webpack://SmilePlayerCommon/external node-commonjs \"fs\"","webpack://SmilePlayerCommon/./src/util/PromiseUtil.ts","webpack://SmilePlayerCommon/external commonjs \"color-name\"","webpack://SmilePlayerCommon/./src/util/GeneratorUtil.ts","webpack://SmilePlayerCommon/./src/tool/FileSystem.ts","webpack://SmilePlayerCommon/external commonjs \"clean-css\"","webpack://SmilePlayerCommon/external commonjs \"html-minifier-terser\"","webpack://SmilePlayerCommon/./src/templating/MinifierEngine.ts","webpack://SmilePlayerCommon/./src/templating/TemplateEngine.ts","webpack://SmilePlayerCommon/external commonjs \"node-mailjet\"","webpack://SmilePlayerCommon/./src/service/sender/EmailSenderService.ts","webpack://SmilePlayerCommon/./src/tool/Configuration.ts","webpack://SmilePlayerCommon/external commonjs \"typeorm\"","webpack://SmilePlayerCommon/./src/tool/Database.ts","webpack://SmilePlayerCommon/external commonjs \"prettyjson\"","webpack://SmilePlayerCommon/./src/tool/Displayer.ts","webpack://SmilePlayerCommon/./src/tool/Downloader.ts","webpack://SmilePlayerCommon/external commonjs \"fast-diff\"","webpack://SmilePlayerCommon/./src/util/StringUtil.ts","webpack://SmilePlayerCommon/external commonjs \"emoji-regex\"","webpack://SmilePlayerCommon/./src/util/FormatterUtil.ts","webpack://SmilePlayerCommon/./src/util/AddressUtil.ts","webpack://SmilePlayerCommon/./src/util/DateUtil.ts","webpack://SmilePlayerCommon/./src/util/ExtractorUtil.ts","webpack://SmilePlayerCommon/./src/util/PriceUtil.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"SmilePlayerCommon\"] = factory();\n\telse\n\t\troot[\"SmilePlayerCommon\"] = factory();\n})(global, () => {\nreturn ","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"axios\");","import {ExceptionContract} from 'common/exception/ExceptionContract';\n\nexport class MainException extends Error implements ExceptionContract {\n public code: number;\n public data: {[key: string]: any};\n\n public constructor(message: string, code?: number, data?: {[key: string]: any}) {\n super(message);\n this.code = code;\n this.data = data;\n this.name = 'MainException';\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, MainException);\n } else {\n this.stack = (new Error(message)).stack;\n }\n }\n}\n","import {MainException} from 'common/exception/MainException';\nimport {ExceptionContract} from 'common/exception/ExceptionContract';\n\nexport class ExternalApiException extends MainException implements ExceptionContract {\n public constructor(message: string, data?: {[key: string]: any}) {\n super(message, 502, data);\n this.name = 'ExternalApiException';\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@sentry/node\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@sentry/profiling-node\");","/* eslint-disable no-shadow */\nexport enum Env {\n PRODUCTION = 'prod',\n DEVELOPMENT = 'dev',\n TEST = 'test'\n}\n","import {Env} from 'common/tool/Env';\n\nexport class Environment {\n public static getMode(): Env {\n switch (process.env.NODE_ENV) {\n case 'dev':\n case 'development':\n return Env.DEVELOPMENT;\n case 'prod':\n case 'production':\n return Env.PRODUCTION;\n case 'test':\n return Env.TEST;\n }\n\n return process.env.APP_ID === undefined ? Env.DEVELOPMENT : Env.PRODUCTION;\n }\n}\n","import {MainException} from 'common/exception/MainException';\nimport {ExceptionContract} from 'common/exception/ExceptionContract';\n\nexport class UnauthorizedException extends MainException implements ExceptionContract {\n public static readonly ERROR_CODE: number = 401;\n\n public constructor(message: string, data?: {[key: string]: any}) {\n super(message, UnauthorizedException.ERROR_CODE, data);\n this.name = 'UnauthorizedException';\n }\n}\n","export const isNullOrUndefined: (obj: unknown) => boolean = (obj) => {\n return obj === undefined || obj === null;\n};\n","import * as Sentry from '@sentry/node';\nimport {nodeProfilingIntegration} from '@sentry/profiling-node';\nimport {Environment} from 'common/tool/Environment';\nimport {ExceptionContract} from 'common/exception/ExceptionContract';\nimport {UnauthorizedException} from 'common/exception/UnauthorizedException';\nimport {Env} from 'common/tool/Env';\nimport * as express from 'express';\nimport {isNullOrUndefined} from 'common/util/HelperUtil';\n\nexport class Logger {\n public static init(sentryToken: string, app: express.Express): void {\n if (Environment.getMode() === Env.PRODUCTION) {\n // const tracesSampleRate: number = 0.001;\n const tracesSampleRate: number = 0; // TODO enable tracing\n Sentry.init({\n dsn: sentryToken,\n integrations: [\n Sentry.captureConsoleIntegration({\n levels: ['error', 'warn', 'log']\n }),\n nodeProfilingIntegration()\n ],\n environment: Environment.getMode(),\n maxBreadcrumbs: 50,\n tracesSampleRate: tracesSampleRate,\n profilesSampleRate: tracesSampleRate\n });\n Sentry.setupExpressErrorHandler(app);\n }\n }\n\n public static trace(message: string, extra?: any): void {\n if ([Env.DEVELOPMENT, Env.TEST].includes(Environment.getMode())) {\n if (extra === undefined) {\n console.info(message); // eslint-disable-line no-console\n } else {\n console.info(message, JSON.stringify(extra, null, 2)); // eslint-disable-line no-console\n }\n } else {\n Sentry.addBreadcrumb({\n category: 'info',\n message: message,\n data: extra,\n level: 'info'\n });\n }\n }\n\n public static debug(message: string, extra?: any): void {\n if ([Env.DEVELOPMENT, Env.TEST].includes(Environment.getMode())) {\n if (extra === undefined) {\n console.log(message); // eslint-disable-line no-console\n } else {\n console.log(message, JSON.stringify(extra, null, 2)); // eslint-disable-line no-console\n }\n } else {\n Sentry.addBreadcrumb({\n category: 'debug',\n message: message,\n data: extra,\n level: 'debug'\n });\n }\n }\n\n public static info(message: string, extra?: any): void {\n if ([Env.DEVELOPMENT, Env.TEST].includes(Environment.getMode())) {\n if (extra === undefined) {\n console.info(message); // eslint-disable-line no-console\n } else {\n console.info(message, JSON.stringify(extra, null, 2)); // eslint-disable-line no-console\n }\n } else {\n Sentry.withScope(scope => {\n if (extra !== undefined) {\n scope.setExtra('extra', JSON.stringify(extra));\n }\n Sentry.captureMessage(message);\n });\n }\n }\n\n public static warning(error: ExceptionContract, extra?: any): void {\n if (!isNullOrUndefined((error as any).response)) {\n if (typeof extra !== 'object') {\n extra = {};\n }\n extra.requestErrorData = (error as any).response.data;\n }\n if ([Env.DEVELOPMENT, Env.TEST].includes(Environment.getMode())) {\n if (extra === undefined) {\n console.warn(error); // eslint-disable-line no-console\n } else {\n console.warn(error, JSON.stringify(extra, null, 2)); // eslint-disable-line no-console\n }\n } else {\n Sentry.withScope(scope => {\n if (extra !== undefined) {\n scope.setExtra('extra', JSON.stringify(extra));\n }\n if (error.data !== undefined) {\n scope.setExtra('data', JSON.stringify(error.data));\n }\n Sentry.captureException(error);\n });\n }\n }\n\n public static error(error: ExceptionContract, extra?: any): void {\n if ([UnauthorizedException.ERROR_CODE].includes(error.code)) {\n return;\n }\n if (!isNullOrUndefined((error as any).response)) {\n if (typeof extra !== 'object') {\n extra = {};\n }\n extra.requestErrorData = (error as any).response.data;\n }\n if ([Env.DEVELOPMENT, Env.TEST].includes(Environment.getMode())) {\n if (extra === undefined) {\n console.error(error); // eslint-disable-line no-console\n } else {\n console.error(error, JSON.stringify(extra, null, 2)); // eslint-disable-line no-console\n }\n } else {\n Sentry.withScope(scope => {\n if (extra !== undefined) {\n scope.setExtra('extra', JSON.stringify(extra));\n }\n if (error.data !== undefined) {\n scope.setExtra('data', JSON.stringify(error.data));\n }\n Sentry.captureException(error);\n });\n }\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"retry\");","import * as retry from 'retry';\n\nexport class Retry {\n public static async request(process: () => Promise<void>, retries: number = 2, logger: (error: Error) => void): Promise<any> {\n const operation = retry.operation({\n retries: retries,\n factor: 1,\n minTimeout: 0,\n maxTimeout: 0,\n randomize: false\n });\n\n return new Promise<any>((resolve, reject) => {\n operation.attempt(() => {\n process().then(resolve).catch((error) => {\n if (operation.retry(error)) {\n if (typeof logger === 'function') {\n logger(error);\n }\n } else {\n reject(error);\n }\n });\n });\n });\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"querystring\");","export class ValidatorUtil {\n public static isEmail(email: string): boolean {\n if (typeof email !== 'string') {\n return false;\n }\n\n return (new RegExp('^[a-zA-Z0-9\\\\.!#$%&*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\\\.[a-zA-Z0-9-]+)*$', 'i')).test(email);\n }\n\n public static isPhone(phone: string): boolean {\n if (typeof phone !== 'string') {\n return false;\n }\n\n return (new RegExp('^([\\+\\\\s0-9]{10,}(#[0-9]+)?)$')).test(phone);\n }\n\n public static isIntMobilePhone(phone: string): boolean {\n const caRegex: RegExp = new RegExp('^\\\\+1[0-9]{10}$', 'i');\n const frRegex: RegExp = new RegExp('^\\\\+33(6|7)[0-9]{8}$', 'i');\n const usRegex: RegExp = new RegExp('^\\\\+1[0-9]{10}$', 'i');\n\n return caRegex.test(phone) || frRegex.test(phone) || usRegex.test(phone);\n }\n\n public static isNumber(num: string | number): boolean {\n if (typeof num === 'number') {\n return true;\n }\n\n if (typeof num !== 'string') {\n return false;\n }\n\n return (new RegExp('^\\-?[0-9]+\\\\.?[0-9]*$')).test(num);\n }\n\n public static isISODate(str: string): boolean {\n const strictISORegex = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?([+-]\\d{2}:\\d{2}|Z)$/;\n\n if (!strictISORegex.test(str)) {\n return false;\n }\n \n return !isNaN((new Date(str)).getTime());\n }\n}\n","// eslint-disable-next-line no-shadow\nexport enum HubriseAccessLevel {\n ACCOUNT = 'account',\n LOCATION = 'location',\n PROFILE = 'profile'\n}\n","import {MainException} from 'common/exception/MainException';\nimport {ExceptionContract} from 'common/exception/ExceptionContract';\n\nexport class BadParameterException extends MainException implements ExceptionContract {\n public constructor(message: string, data?: {[key: string]: any}) {\n super(message, 400, data);\n this.name = 'BadParameterException';\n }\n}\n","// eslint-disable-next-line no-shadow\nexport enum HubriseAuthResource {\n ORDERS = 'orders',\n CUSTOMER_LIST = 'customer_list',\n CATALOG = 'catalog',\n INVENTORY = 'inventory',\n ALL_CUSTOMER_LISTS = 'all_customer_lists',\n ALL_CATALOG_LISTS = 'all_catalogs'\n}\n","// eslint-disable-next-line no-shadow\nexport enum HubriseRightAccess {\n READ = 'read',\n WRITE = 'write',\n}\n","// eslint-disable-next-line no-shadow\nexport enum HubriseCountryCode {\n AF = 'AF',\n AL = 'AL',\n DZ = 'DZ',\n AD = 'AD',\n AO = 'AO',\n AG = 'AG',\n AR = 'AR',\n AM = 'AM',\n AU = 'AU',\n AT = 'AT',\n AZ = 'AZ',\n BS = 'BS',\n BH = 'BH',\n BD = 'BD',\n BB = 'BB',\n BY = 'BY',\n BE = 'BE',\n BZ = 'BZ',\n BJ = 'BJ',\n BT = 'BT',\n BO = 'BO',\n BA = 'BA',\n BW = 'BW',\n BR = 'BR',\n BN = 'BN',\n BG = 'BG',\n BF = 'BF',\n BI = 'BI',\n CV = 'CV',\n KH = 'KH',\n CM = 'CM',\n CA = 'CA',\n CF = 'CF',\n TD = 'TD',\n CL = 'CL',\n CN = 'CN',\n CO = 'CO',\n KM = 'KM',\n CG = 'CG',\n CD = 'CD',\n CR = 'CR',\n CI = 'CI',\n HR = 'HR',\n CU = 'CU',\n CY = 'CY',\n CZ = 'CZ',\n DK = 'DK',\n DJ = 'DJ',\n DM = 'DM',\n DO = 'DO',\n TL = 'TL',\n EC = 'EC',\n EG = 'EG',\n SV = 'SV',\n GQ = 'GQ',\n ER = 'ER',\n EE = 'EE',\n SZ = 'SZ',\n ET = 'ET',\n FJ = 'FJ',\n FI = 'FI',\n FR = 'FR',\n GA = 'GA',\n GM = 'GM',\n GE = 'GE',\n DE = 'DE',\n GH = 'GH',\n GR = 'GR',\n GD = 'GD',\n GT = 'GT',\n GN = 'GN',\n GW = 'GW',\n GY = 'GY',\n HT = 'HT',\n VA = 'VA',\n HN = 'HN',\n HU = 'HU',\n IS = 'IS',\n IN = 'IN',\n ID = 'ID',\n IR = 'IR',\n IQ = 'IQ',\n IE = 'IE',\n IL = 'IL',\n IT = 'IT',\n JM = 'JM',\n JP = 'JP',\n JO = 'JO',\n KZ = 'KZ',\n KE = 'KE',\n KI = 'KI',\n XK = 'XK',\n KW = 'KW',\n KG = 'KG',\n LA = 'LA',\n LV = 'LV',\n LB = 'LB',\n LS = 'LS',\n LR = 'LR',\n LY = 'LY',\n LI = 'LI',\n LT = 'LT',\n LU = 'LU',\n MG = 'MG',\n MW = 'MW',\n MY = 'MY',\n MV = 'MV',\n ML = 'ML',\n MT = 'MT',\n MH = 'MH',\n MR = 'MR',\n MU = 'MU',\n MX = 'MX',\n FM = 'FM',\n MD = 'MD',\n MC = 'MC',\n MN = 'MN',\n ME = 'ME',\n MA = 'MA',\n MZ = 'MZ',\n MM = 'MM',\n NA = 'NA',\n NR = 'NR',\n NP = 'NP',\n NL = 'NL',\n NZ = 'NZ',\n NI = 'NI',\n NE = 'NE',\n NG = 'NG',\n KP = 'KP',\n MK = 'MK',\n NO = 'NO',\n OM = 'OM',\n PK = 'PK',\n PW = 'PW',\n PS = 'PS',\n PA = 'PA',\n PG = 'PG',\n PY = 'PY',\n PE = 'PE',\n PH = 'PH',\n PL = 'PL',\n PT = 'PT',\n QA = 'QA',\n RO = 'RO',\n RU = 'RU',\n RW = 'RW',\n KN = 'KN',\n LC = 'LC',\n VC = 'VC',\n WS = 'WS',\n SM = 'SM',\n ST = 'ST',\n SA = 'SA',\n SN = 'SN',\n RS = 'RS',\n SC = 'SC',\n SL = 'SL',\n SG = 'SG',\n SK = 'SK',\n SI = 'SI',\n SB = 'SB',\n SO = 'SO',\n ZA = 'ZA',\n KR = 'KR',\n SS = 'SS',\n ES = 'ES',\n LK = 'LK',\n SD = 'SD',\n SR = 'SR',\n SE = 'SE',\n CH = 'CH',\n SY = 'SY',\n TW = 'TW',\n TJ = 'TJ',\n TZ = 'TZ',\n TH = 'TH',\n TG = 'TG',\n TO = 'TO',\n TT = 'TT',\n TN = 'TN',\n TR = 'TR',\n TM = 'TM',\n TV = 'TV',\n UG = 'UG',\n UA = 'UA',\n AE = 'AE',\n GB = 'GB',\n US = 'US',\n UY = 'UY',\n UZ = 'UZ',\n VU = 'VU',\n VE = 'VE',\n VN = 'VN',\n YE = 'YE',\n ZM = 'ZM',\n ZW = 'ZW',\n}\n","// eslint-disable-next-line no-shadow\nexport enum HubriseCurrencyCode {\n AED = 'AED', // UAE Dirham\n AFN = 'AFN', // Afghani\n ALL = 'ALL', // Lek\n AMD = 'AMD', // Armenian Dram\n ANG = 'ANG', // Netherlands Antillean Guilder\n AOA = 'AOA', // Kwanza\n ARS = 'ARS', // Argentine Peso\n AUD = 'AUD', // Australian Dollar\n AWG = 'AWG', // Aruban Florin\n AZN = 'AZN', // Azerbaijanian Manat\n BAM = 'BAM', // Convertible Mark\n BBD = 'BBD', // Barbados Dollar\n BDT = 'BDT', // Taka\n BGN = 'BGN', // Bulgarian Lev\n BHD = 'BHD', // Bahraini Dinar\n BIF = 'BIF', // Burundi Franc\n BMD = 'BMD', // Bermudian Dollar\n BND = 'BND', // Brunei Dollar\n BOB = 'BOB', // Boliviano\n BOV = 'BOV', // Mvdol\n BRL = 'BRL', // Brazilian Real\n BSD = 'BSD', // Bahamian Dollar\n BTN = 'BTN', // Ngultrum\n BWP = 'BWP', // Pula\n BYN = 'BYN', // Belarussian Ruble\n BZD = 'BZD', // Belize Dollar\n CAD = 'CAD', // Canadian Dollar\n CDF = 'CDF', // Congolese Franc\n CHE = 'CHE', // WIR Euro\n CHF = 'CHF', // Swiss Franc\n CHW = 'CHW', // WIR Franc\n CLF = 'CLF', // Unidad de Fomento\n CLP = 'CLP', // Chilean Peso\n CNY = 'CNY', // Yuan Renminbi\n COP = 'COP', // Colombian Peso\n COU = 'COU', // Unidad de Valor Real\n CRC = 'CRC', // Costa Rican Colon\n CUC = 'CUC', // Peso Convertible\n CUP = 'CUP', // Cuban Peso\n CVE = 'CVE', // Cabo Verde Escudo\n CZK = 'CZK', // Czech Koruna\n DJF = 'DJF', // Djibouti Franc\n DKK = 'DKK', // Danish Krone\n DOP = 'DOP', // Dominican Peso\n DZD = 'DZD', // Algerian Dinar\n EGP = 'EGP', // Egyptian Pound\n ERN = 'ERN', // Nakfa\n ETB = 'ETB', // Ethiopian Birr\n EUR = 'EUR', // Euro\n FJD = 'FJD', // Fiji Dollar\n FKP = 'FKP', // Falkland Islands Pound\n GBP = 'GBP', // Pound Sterling\n GEL = 'GEL', // Lari\n GHS = 'GHS', // Ghana Cedi\n GIP = 'GIP', // Gibraltar Pound\n GMD = 'GMD', // Dalasi\n GNF = 'GNF', // Guinea Franc\n GTQ = 'GTQ', // Quetzal\n GYD = 'GYD', // Guyana Dollar\n HKD = 'HKD', // Hong Kong Dollar\n HNL = 'HNL', // Lempira\n HRK = 'HRK', // Croatian Kuna\n HTG = 'HTG', // Gourde\n HUF = 'HUF', // Forint\n IDR = 'IDR', // Rupiah\n ILS = 'ILS', // New Israeli Sheqel\n INR = 'INR', // Indian Rupee\n IQD = 'IQD', // Iraqi Dinar\n IRR = 'IRR', // Iranian Rial\n ISK = 'ISK', // Iceland Krona\n JMD = 'JMD', // Jamaican Dollar\n JOD = 'JOD', // Jordanian Dinar\n JPY = 'JPY', // Yen\n KES = 'KES', // Kenyan Shilling\n KGS = 'KGS', // Som\n KHR = 'KHR', // Riel\n KMF = 'KMF', // Comoro Franc\n KPW = 'KPW', // North Korean Won\n KRW = 'KRW', // Won\n KWD = 'KWD', // Kuwaiti Dinar\n KYD = 'KYD', // Cayman Islands Dollar\n KZT = 'KZT', // Tenge\n LAK = 'LAK', // Kip\n LBP = 'LBP', // Lebanese Pound\n LKR = 'LKR', // Sri Lanka Rupee\n LRD = 'LRD', // Liberian Dollar\n LSL = 'LSL', // Loti\n LYD = 'LYD', // Libyan Dinar\n MAD = 'MAD', // Moroccan Dirham\n MDL = 'MDL', // Moldovan Leu\n MGA = 'MGA', // Malagasy Ariary\n MKD = 'MKD', // Denar\n MMK = 'MMK', // Kyat\n MNT = 'MNT', // Tugrik\n MOP = 'MOP', // Pataca\n MRU = 'MRU', // Ouguiya\n MUR = 'MUR', // Mauritius Rupee\n MVR = 'MVR', // Rufiyaa\n MWK = 'MWK', // Kwacha\n MXN = 'MXN', // Mexican Peso\n MXV = 'MXV', // Mexican Unidad de Inversion (UDI)\n MYR = 'MYR', // Malaysian Ringgit\n MZN = 'MZN', // Mozambique Metical\n NAD = 'NAD', // Namibia Dollar\n NGN = 'NGN', // Naira\n NIO = 'NIO', // Cordoba Oro\n NOK = 'NOK', // Norwegian Krone\n NPR = 'NPR', // Nepalese Rupee\n NZD = 'NZD', // New Zealand Dollar\n OMR = 'OMR', // Rial Omani\n PAB = 'PAB', // Balboa\n PEN = 'PEN', // Nuevo Sol\n PGK = 'PGK', // Kina\n PHP = 'PHP', // Philippine Peso\n PKR = 'PKR', // Pakistan Rupee\n PLN = 'PLN', // Zloty\n PYG = 'PYG', // Guarani\n QAR = 'QAR', // Qatari Rial\n RON = 'RON', // Romanian Leu\n RSD = 'RSD', // Serbian Dinar\n RUB = 'RUB', // Russian Ruble\n RWF = 'RWF', // Rwanda Franc\n SAR = 'SAR', // Saudi Riyal\n SBD = 'SBD', // Solomon Islands Dollar\n SCR = 'SCR', // Seychelles Rupee\n SDG = 'SDG', // Sudanese Pound\n SEK = 'SEK', // Swedish Krona\n SGD = 'SGD', // Singapore Dollar\n SHP = 'SHP', // Saint Helena Pound\n SLE = 'SLE', // Leone\n SOS = 'SOS', // Somali Shilling\n SRD = 'SRD', // Surinam Dollar\n SSP = 'SSP', // South Sudanese Pound\n STN = 'STN', // Dobra\n SVC = 'SVC', // El Salvador Colon\n SYP = 'SYP', // Syrian Pound\n SZL = 'SZL', // Lilangeni\n THB = 'THB', // Baht\n TJS = 'TJS', // Somoni\n TMT = 'TMT', // Turkmenistan New Manat\n TND = 'TND', // Tunisian Dinar\n TOP = 'TOP', // Pa'anga\n TRY = 'TRY', // Turkish Lira\n TTD = 'TTD', // Trinidad and Tobago Dollar\n TWD = 'TWD', // New Taiwan Dollar\n TZS = 'TZS', // Tanzanian Shilling\n UAH = 'UAH', // Hryvnia\n UGX = 'UGX', // Uganda Shilling\n USD = 'USD', // US Dollar\n USN = 'USN', // US Dollar (Next day)\n UYI = 'UYI', // Uruguay Peso en Unidades Indexadas\n UYU = 'UYU', // Peso Uruguayo\n UZS = 'UZS', // Uzbekistan Sum\n VED = 'VED', // Bolivar\n VEF = 'VEF', // Bolivar\n VND = 'VND', // Dong\n VUV = 'VUV', // Vatu\n WST = 'WST', // Tala\n XAF = 'XAF', // CFA Franc BEAC\n XCD = 'XCD', // East Caribbean Dollar\n XDR = 'XDR', // SDR (Special Drawing Right)\n XOF = 'XOF', // CFA Franc BCEAO\n XPF = 'XPF', // CFP Franc\n XSU = 'XSU', // Sucre\n XUA = 'XUA', // ADB Unit of Account\n YER = 'YER', // Yemeni Rial\n ZAR = 'ZAR', // Rand\n ZMW = 'ZMW', // Zambian Kwacha\n ZWL = 'ZWL', // Zimbabwe Dollar\n}\n","// eslint-disable-next-line no-shadow\nexport enum HubriseLanguageCode {\n AR = 'ar',\n DE = 'de',\n EN = 'en',\n ES = 'es',\n FR = 'fr',\n PT = 'pt'\n}\n","// eslint-disable-next-line no-shadow\nexport enum HubriseLocale {\n // Anglais\n EN_US = 'en-US', // Anglais (États-Unis)\n EN_GB = 'en-GB', // Anglais (Royaume-Uni)\n EN_CA = 'en-CA', // Anglais (Canada)\n EN_AU = 'en-AU', // Anglais (Australie)\n EN_NZ = 'en-NZ', // Anglais (Nouvelle-Zélande)\n EN_ZA = 'en-ZA', // Anglais (Afrique du Sud)\n\n // Français\n FR_FR = 'fr-FR', // Français (France)\n FR_CA = 'fr-CA', // Français (Canada)\n FR_BE = 'fr-BE', // Français (Belgique)\n FR_CH = 'fr-CH', // Français (Suisse)\n\n // Espagnol\n ES_ES = 'es-ES', // Espagnol (Espagne)\n ES_MX = 'es-MX', // Espagnol (Mexique)\n ES_AR = 'es-AR', // Espagnol (Argentine)\n ES_CO = 'es-CO', // Espagnol (Colombie)\n ES_CL = 'es-CL', // Espagnol (Chili)\n\n // Allemand\n DE_DE = 'de-DE', // Allemand (Allemagne)\n DE_AT = 'de-AT', // Allemand (Autriche)\n DE_CH = 'de-CH', // Allemand (Suisse)\n\n // Italien\n IT_IT = 'it-IT', // Italien (Italie)\n IT_CH = 'it-CH', // Italien (Suisse)\n\n // Portugais\n PT_PT = 'pt-PT', // Portugais (Portugal)\n PT_BR = 'pt-BR', // Portugais (Brésil)\n\n // Néerlandais\n NL_NL = 'nl-NL', // Néerlandais (Pays-Bas)\n NL_BE = 'nl-BE', // Néerlandais (Belgique)\n\n // Langues nordiques\n SV_SE = 'sv-SE', // Suédois (Suède)\n NO_NO = 'no-NO', // Norvégien (Norvège)\n DA_DK = 'da-DK', // Danois (Danemark)\n FI_FI = 'fi-FI', // Finnois (Finlande)\n IS_IS = 'is-IS', // Islandais (Islande)\n\n // Langues slaves\n RU_RU = 'ru-RU', // Russe (Russie)\n PL_PL = 'pl-PL', // Polonais (Pologne)\n CS_CZ = 'cs-CZ', // Tchèque (République tchèque)\n SK_SK = 'sk-SK', // Slovaque (Slovaquie)\n HR_HR = 'hr-HR', // Croate (Croatie)\n SR_RS = 'sr-RS', // Serbe (Serbie)\n BG_BG = 'bg-BG', // Bulgare (Bulgarie)\n UK_UA = 'uk-UA', // Ukrainien (Ukraine)\n\n // Langues asiatiques\n JA_JP = 'ja-JP', // Japonais (Japon)\n KO_KR = 'ko-KR', // Coréen (Corée du Sud)\n ZH_CN = 'zh-CN', // Chinois simplifié (Chine)\n ZH_TW = 'zh-TW', // Chinois traditionnel (Taïwan)\n ZH_HK = 'zh-HK', // Chinois traditionnel (Hong Kong)\n TH_TH = 'th-TH', // Thaï (Thaïlande)\n VI_VN = 'vi-VN', // Vietnamien (Vietnam)\n ID_ID = 'id-ID', // Indonésien (Indonésie)\n MS_MY = 'ms-MY', // Malais (Malaisie)\n\n // Langues du Moyen-Orient\n AR_SA = 'ar-SA', // Arabe (Arabie saoudite)\n AR_EG = 'ar-EG', // Arabe (Égypte)\n AR_AE = 'ar-AE', // Arabe (Émirats arabes unis)\n HE_IL = 'he-IL', // Hébreu (Israël)\n FA_IR = 'fa-IR', // Persan (Iran)\n TR_TR = 'tr-TR', // Turc (Turquie)\n\n // Langues indiennes\n HI_IN = 'hi-IN', // Hindi (Inde)\n BN_BD = 'bn-BD', // Bengali (Bangladesh)\n TA_IN = 'ta-IN', // Tamoul (Inde)\n TE_IN = 'te-IN', // Telugu (Inde)\n UR_PK = 'ur-PK', // Ourdou (Pakistan)\n\n // Autres langues européennes\n EL_GR = 'el-GR', // Grec (Grèce)\n HU_HU = 'hu-HU', // Hongrois (Hongrie)\n RO_RO = 'ro-RO', // Roumain (Roumanie)\n LT_LT = 'lt-LT', // Lituanien (Lituanie)\n LV_LV = 'lv-LV', // Letton (Lettonie)\n ET_EE = 'et-EE', // Estonien (Estonie)\n SL_SI = 'sl-SI', // Slovène (Slovénie)\n MT_MT = 'mt-MT', // Maltais (Malte)\n\n // Langues africaines\n SW_KE = 'sw-KE', // Swahili (Kenya)\n AF_ZA = 'af-ZA', // Afrikaans (Afrique du Sud)\n AM_ET = 'am-ET', // Amharique (Éthiopie)\n}\n","// eslint-disable-next-line no-shadow\nexport enum HubriseTimezoneId {\n // Africa\n Africa_Abidjan = 'Africa/Abidjan',\n Africa_Algiers = 'Africa/Algiers',\n Africa_Bissau = 'Africa/Bissau',\n Africa_Cairo = 'Africa/Cairo',\n Africa_Casablanca = 'Africa/Casablanca',\n Africa_Ceuta = 'Africa/Ceuta',\n Africa_El_Aaiun = 'Africa/El_Aaiun',\n Africa_Johannesburg = 'Africa/Johannesburg',\n Africa_Juba = 'Africa/Juba',\n Africa_Khartoum = 'Africa/Khartoum',\n Africa_Lagos = 'Africa/Lagos',\n Africa_Maputo = 'Africa/Maputo',\n Africa_Monrovia = 'Africa/Monrovia',\n Africa_Nairobi = 'Africa/Nairobi',\n Africa_Ndjamena = 'Africa/Ndjamena',\n Africa_Sao_Tome = 'Africa/Sao_Tome',\n Africa_Tripoli = 'Africa/Tripoli',\n Africa_Tunis = 'Africa/Tunis',\n Africa_Windhoek = 'Africa/Windhoek',\n\n // America\n America_Adak = 'America/Adak',\n America_Anchorage = 'America/Anchorage',\n America_Araguaina = 'America/Araguaina',\n America_Argentina_Buenos_Aires = 'America/Argentina/Buenos_Aires',\n America_Argentina_Catamarca = 'America/Argentina/Catamarca',\n America_Argentina_Cordoba = 'America/Argentina/Cordoba',\n America_Argentina_Jujuy = 'America/Argentina/Jujuy',\n America_Argentina_La_Rioja = 'America/Argentina/La_Rioja',\n America_Argentina_Mendoza = 'America/Argentina/Mendoza',\n America_Argentina_Rio_Gallegos = 'America/Argentina/Rio_Gallegos',\n America_Argentina_Salta = 'America/Argentina/Salta',\n America_Argentina_San_Juan = 'America/Argentina/San_Juan',\n America_Argentina_San_Luis = 'America/Argentina/San_Luis',\n America_Argentina_Tucuman = 'America/Argentina/Tucuman',\n America_Argentina_Ushuaia = 'America/Argentina/Ushuaia',\n America_Asuncion = 'America/Asuncion',\n America_Bahia = 'America/Bahia',\n America_Bahia_Banderas = 'America/Bahia_Banderas',\n America_Barbados = 'America/Barbados',\n America_Belem = 'America/Belem',\n America_Belize = 'America/Belize',\n America_Boa_Vista = 'America/Boa_Vista',\n America_Bogota = 'America/Bogota',\n America_Boise = 'America/Boise',\n America_Cambridge_Bay = 'America/Cambridge_Bay',\n America_Campo_Grande = 'America/Campo_Grande',\n America_Cancun = 'America/Cancun',\n America_Caracas = 'America/Caracas',\n America_Cayenne = 'America/Cayenne',\n America_Chicago = 'America/Chicago',\n America_Chihuahua = 'America/Chihuahua',\n America_Ciudad_Juarez = 'America/Ciudad_Juarez',\n America_Costa_Rica = 'America/Costa_Rica',\n America_Coyhaique = 'America/Coyhaique',\n America_Cuiaba = 'America/Cuiaba',\n America_Danmarkshavn = 'America/Danmarkshavn',\n America_Dawson = 'America/Dawson',\n America_Dawson_Creek = 'America/Dawson_Creek',\n America_Denver = 'America/Denver',\n America_Detroit = 'America/Detroit',\n America_Edmonton = 'America/Edmonton',\n America_Eirunepe = 'America/Eirunepe',\n America_El_Salvador = 'America/El_Salvador',\n America_Fort_Nelson = 'America/Fort_Nelson',\n America_Fortaleza = 'America/Fortaleza',\n America_Glace_Bay = 'America/Glace_Bay',\n America_Goose_Bay = 'America/Goose_Bay',\n America_Grand_Turk = 'America/Grand_Turk',\n America_Guatemala = 'America/Guatemala',\n America_Guayaquil = 'America/Guayaquil',\n America_Guyana = 'America/Guyana',\n America_Halifax = 'America/Halifax',\n America_Havana = 'America/Havana',\n America_Hermosillo = 'America/Hermosillo',\n America_Indiana_Indianapolis = 'America/Indiana/Indianapolis',\n America_Indiana_Knox = 'America/Indiana/Knox',\n America_Indiana_Marengo = 'America/Indiana/Marengo',\n America_Indiana_Petersburg = 'America/Indiana/Petersburg',\n America_Indiana_Tell_City = 'America/Indiana/Tell_City',\n America_Indiana_Vevay = 'America/Indiana/Vevay',\n America_Indiana_Vincennes = 'America/Indiana/Vincennes',\n America_Indiana_Winamac = 'America/Indiana/Winamac',\n America_Inuvik = 'America/Inuvik',\n America_Iqaluit = 'America/Iqaluit',\n America_Jamaica = 'America/Jamaica',\n America_Juneau = 'America/Juneau',\n America_Kentucky_Louisville = 'America/Kentucky/Louisville',\n America_Kentucky_Monticello = 'America/Kentucky/Monticello',\n America_La_Paz = 'America/La_Paz',\n America_Lima = 'America/Lima',\n America_Los_Angeles = 'America/Los_Angeles',\n America_Maceio = 'America/Maceio',\n America_Managua = 'America/Managua',\n America_Manaus = 'America/Manaus',\n America_Martinique = 'America/Martinique',\n America_Matamoros = 'America/Matamoros',\n America_Mazatlan = 'America/Mazatlan',\n America_Menominee = 'America/Menominee',\n America_Merida = 'America/Merida',\n America_Metlakatla = 'America/Metlakatla',\n America_Mexico_City = 'America/Mexico_City',\n America_Miquelon = 'America/Miquelon',\n America_Moncton = 'America/Moncton',\n America_Monterrey = 'America/Monterrey',\n America_Montevideo = 'America/Montevideo',\n America_New_York = 'America/New_York',\n America_Nome = 'America/Nome',\n America_Noronha = 'America/Noronha',\n America_North_Dakota_Beulah = 'America/North_Dakota/Beulah',\n America_North_Dakota_Center = 'America/North_Dakota/Center',\n America_North_Dakota_New_Salem = 'America/North_Dakota/New_Salem',\n America_Nuuk = 'America/Nuuk',\n America_Ojinaga = 'America/Ojinaga',\n America_Panama = 'America/Panama',\n America_Paramaribo = 'America/Paramaribo',\n America_Phoenix = 'America/Phoenix',\n America_Port_au_Prince = 'America/Port-au-Prince',\n America_Porto_Velho = 'America/Porto_Velho',\n America_Puerto_Rico = 'America/Puerto_Rico',\n America_Punta_Arenas = 'America/Punta_Arenas',\n America_Rankin_Inlet = 'America/Rankin_Inlet',\n America_Recife = 'America/Recife',\n America_Regina = 'America/Regina',\n America_Resolute = 'America/Resolute',\n America_Rio_Branco = 'America/Rio_Branco',\n America_Santarem = 'America/Santarem',\n America_Santiago = 'America/Santiago',\n America_Santo_Domingo = 'America/Santo_Domingo',\n America_Sao_Paulo = 'America/Sao_Paulo',\n America_Scoresbysund = 'America/Scoresbysund',\n America_Sitka = 'America/Sitka',\n America_St_Johns = 'America/St_Johns',\n America_Swift_Current = 'America/Swift_Current',\n America_Tegucigalpa = 'America/Tegucigalpa',\n America_Thule = 'America/Thule',\n America_Tijuana = 'America/Tijuana',\n America_Toronto = 'America/Toronto',\n America_Vancouver = 'America/Vancouver',\n America_Whitehorse = 'America/Whitehorse',\n America_Winnipeg = 'America/Winnipeg',\n America_Yakutat = 'America/Yakutat',\n\n // Antarctica\n Antarctica_Casey = 'Antarctica/Casey',\n Antarctica_Davis = 'Antarctica/Davis',\n Antarctica_Macquarie = 'Antarctica/Macquarie',\n Antarctica_Mawson = 'Antarctica/Mawson',\n Antarctica_Palmer = 'Antarctica/Palmer',\n Antarctica_Rothera = 'Antarctica/Rothera',\n Antarctica_Troll = 'Antarctica/Troll',\n Antarctica_Vostok = 'Antarctica/Vostok',\n\n // Asia\n Asia_Almaty = 'Asia/Almaty',\n Asia_Amman = 'Asia/Amman',\n Asia_Anadyr = 'Asia/Anadyr',\n Asia_Aqtau = 'Asia/Aqtau',\n Asia_Aqtobe = 'Asia/Aqtobe',\n Asia_Ashgabat = 'Asia/Ashgabat',\n Asia_Atyrau = 'Asia/Atyrau',\n Asia_Baghdad = 'Asia/Baghdad',\n Asia_Baku = 'Asia/Baku',\n Asia_Bangkok = 'Asia/Bangkok',\n Asia_Barnaul = 'Asia/Barnaul',\n Asia_Beirut = 'Asia/Beirut',\n Asia_Bishkek = 'Asia/Bishkek',\n Asia_Chita = 'Asia/Chita',\n Asia_Colombo = 'Asia/Colombo',\n Asia_Damascus = 'Asia/Damascus',\n Asia_Dhaka = 'Asia/Dhaka',\n Asia_Dili = 'Asia/Dili',\n Asia_Dubai = 'Asia/Dubai',\n Asia_Dushanbe = 'Asia/Dushanbe',\n Asia_Famagusta = 'Asia/Famagusta',\n Asia_Gaza = 'Asia/Gaza',\n Asia_Hebron = 'Asia/Hebron',\n Asia_Ho_Chi_Minh = 'Asia/Ho_Chi_Minh',\n Asia_Hong_Kong = 'Asia/Hong_Kong',\n Asia_Hovd = 'Asia/Hovd',\n Asia_Irkutsk = 'Asia/Irkutsk',\n Asia_Jakarta = 'Asia/Jakarta',\n Asia_Jayapura = 'Asia/Jayapura',\n Asia_Jerusalem = 'Asia/Jerusalem',\n Asia_Kabul = 'Asia/Kabul',\n Asia_Kamchatka = 'Asia/Kamchatka',\n Asia_Karachi = 'Asia/Karachi',\n Asia_Kathmandu = 'Asia/Kathmandu',\n Asia_Khandyga = 'Asia/Khandyga',\n Asia_Kolkata = 'Asia/Kolkata',\n Asia_Krasnoyarsk = 'Asia/Krasnoyarsk',\n Asia_Kuching = 'Asia/Kuching',\n Asia_Macau = 'Asia/Macau',\n Asia_Magadan = 'Asia/Magadan',\n Asia_Makassar = 'Asia/Makassar',\n Asia_Manila = 'Asia/Manila',\n Asia_Nicosia = 'Asia/Nicosia',\n Asia_Novokuznetsk = 'Asia/Novokuznetsk',\n Asia_Novosibirsk = 'Asia/Novosibirsk',\n Asia_Omsk = 'Asia/Omsk',\n Asia_Oral = 'Asia/Oral',\n Asia_Pontianak = 'Asia/Pontianak',\n Asia_Pyongyang = 'Asia/Pyongyang',\n Asia_Qatar = 'Asia/Qatar',\n Asia_Qostanay = 'Asia/Qostanay',\n Asia_Qyzylorda = 'Asia/Qyzylorda',\n Asia_Riyadh = 'Asia/Riyadh',\n Asia_Sakhalin = 'Asia/Sakhalin',\n Asia_Samarkand = 'Asia/Samarkand',\n Asia_Seoul = 'Asia/Seoul',\n Asia_Shanghai = 'Asia/Shanghai',\n Asia_Singapore = 'Asia/Singapore',\n Asia_Srednekolymsk = 'Asia/Srednekolymsk',\n Asia_Taipei = 'Asia/Taipei',\n Asia_Tashkent = 'Asia/Tashkent',\n Asia_Tbilisi = 'Asia/Tbilisi',\n Asia_Tehran = 'Asia/Tehran',\n Asia_Thimphu = 'Asia/Thimphu',\n Asia_Tokyo = 'Asia/Tokyo',\n Asia_Tomsk = 'Asia/Tomsk',\n Asia_Ulaanbaatar = 'Asia/Ulaanbaatar',\n Asia_Urumqi = 'Asia/Urumqi',\n Asia_Ust_Nera = 'Asia/Ust-Nera',\n Asia_Vladivostok = 'Asia/Vladivostok',\n Asia_Yakutsk = 'Asia/Yakutsk',\n Asia_Yangon = 'Asia/Yangon',\n Asia_Yekaterinburg = 'Asia/Yekaterinburg',\n Asia_Yerevan = 'Asia/Yerevan',\n\n // Atlantic\n Atlantic_Azores = 'Atlantic/Azores',\n Atlantic_Bermuda = 'Atlantic/Bermuda',\n Atlantic_Canary = 'Atlantic/Canary',\n Atlantic_Cape_Verde = 'Atlantic/Cape_Verde',\n Atlantic_Faroe = 'Atlantic/Faroe',\n Atlantic_Madeira = 'Atlantic/Madeira',\n Atlantic_South_Georgia = 'Atlantic/South_Georgia',\n Atlantic_Stanley = 'Atlantic/Stanley',\n\n // Australia\n Australia_Adelaide = 'Australia/Adelaide',\n Australia_Brisbane = 'Australia/Brisbane',\n Australia_Broken_Hill = 'Australia/Broken_Hill',\n Australia_Darwin = 'Australia/Darwin',\n Australia_Eucla = 'Australia/Eucla',\n Australia_Hobart = 'Australia/Hobart',\n Australia_Lindeman = 'Australia/Lindeman',\n Australia_Lord_Howe = 'Australia/Lord_Howe',\n Australia_Melbourne = 'Australia/Melbourne',\n Australia_Perth = 'Australia/Perth',\n Australia_Sydney = 'Australia/Sydney',\n\n // Etc (Coordinated Universal Time offsets)\n Etc_GMT = 'Etc/GMT',\n Etc_GMT_Minus_1 = 'Etc/GMT-1',\n Etc_GMT_Minus_10 = 'Etc/GMT-10',\n Etc_GMT_Minus_11 = 'Etc/GMT-11',\n Etc_GMT_Minus_12 = 'Etc/GMT-12',\n Etc_GMT_Minus_13 = 'Etc/GMT-13',\n Etc_GMT_Minus_14 = 'Etc/GMT-14',\n Etc_GMT_Minus_2 = 'Etc/GMT-2',\n Etc_GMT_Minus_3 = 'Etc/GMT-3',\n Etc_GMT_Minus_4 = 'Etc/GMT-4',\n Etc_GMT_Minus_5 = 'Etc/GMT-5',\n Etc_GMT_Minus_6 = 'Etc/GMT-6',\n Etc_GMT_Minus_7 = 'Etc/GMT-7',\n Etc_GMT_Minus_8 = 'Etc/GMT-8',\n Etc_GMT_Minus_9 = 'Etc/GMT-9',\n Etc_GMT_Plus_1 = 'Etc/GMT+1',\n Etc_GMT_Plus_10 = 'Etc/GMT+10',\n Etc_GMT_Plus_11 = 'Etc/GMT+11',\n Etc_GMT_Plus_12 = 'Etc/GMT+12',\n Etc_GMT_Plus_2 = 'Etc/GMT+2',\n Etc_GMT_Plus_3 = 'Etc/GMT+3',\n Etc_GMT_Plus_4 = 'Etc/GMT+4',\n Etc_GMT_Plus_5 = 'Etc/GMT+5',\n Etc_GMT_Plus_6 = 'Etc/GMT+6',\n Etc_GMT_Plus_7 = 'Etc/GMT+7',\n Etc_GMT_Plus_8 = 'Etc/GMT+8',\n Etc_GMT_Plus_9 = 'Etc/GMT+9',\n Etc_UTC = 'Etc/UTC',\n\n // Europe\n Europe_Andorra = 'Europe/Andorra',\n Europe_Astrakhan = 'Europe/Astrakhan',\n Europe_Athens = 'Europe/Athens',\n Europe_Belgrade = 'Europe/Belgrade',\n Europe_Berlin = 'Europe/Berlin',\n Europe_Brussels = 'Europe/Brussels',\n Europe_Bucharest = 'Europe/Bucharest',\n Europe_Budapest = 'Europe/Budapest',\n Europe_Chisinau = 'Europe/Chisinau',\n Europe_Dublin = 'Europe/Dublin',\n Europe_Gibraltar = 'Europe/Gibraltar',\n Europe_Helsinki = 'Europe/Helsinki',\n Europe_Istanbul = 'Europe/Istanbul',\n Europe_Kaliningrad = 'Europe/Kaliningrad',\n Europe_Kirov = 'Europe/Kirov',\n Europe_Kyiv = 'Europe/Kyiv',\n Europe_Lisbon = 'Europe/Lisbon',\n Europe_London = 'Europe/London',\n Europe_Madrid = 'Europe/Madrid',\n Europe_Malta = 'Europe/Malta',\n Europe_Minsk = 'Europe/Minsk',\n Europe_Moscow = 'Europe/Moscow',\n Europe_Paris = 'Europe/Paris',\n Europe_Prague = 'Europe/Prague',\n Europe_Riga = 'Europe/Riga',\n Europe_Rome = 'Europe/Rome',\n Europe_Samara = 'Europe/Samara',\n Europe_Saratov = 'Europe/Saratov',\n Europe_Simferopol = 'Europe/Simferopol',\n Europe_Sofia = 'Europe/Sofia',\n Europe_Tallinn = 'Europe/Tallinn',\n Europe_Tirane = 'Europe/Tirane',\n Europe_Ulyanovsk = 'Europe/Ulyanovsk',\n Europe_Vienna = 'Europe/Vienna',\n Europe_Vilnius = 'Europe/Vilnius',\n Europe_Volgograd = 'Europe/Volgograd',\n Europe_Warsaw = 'Europe/Warsaw',\n Europe_Zurich = 'Europe/Zurich',\n\n // Indian\n Indian_Chagos = 'Indian/Chagos',\n Indian_Maldives = 'Indian/Maldives',\n Indian_Mauritius = 'Indian/Mauritius',\n\n // Pacific\n Pacific_Apia = 'Pacific/Apia',\n Pacific_Auckland = 'Pacific/Auckland',\n Pacific_Bougainville = 'Pacific/Bougainville',\n Pacific_Chatham = 'Pacific/Chatham',\n Pacific_Easter = 'Pacific/Easter',\n Pacific_Efate = 'Pacific/Efate',\n Pacific_Fakaofo = 'Pacific/Fakaofo',\n Pacific_Fiji = 'Pacific/Fiji',\n Pacific_Galapagos = 'Pacific/Galapagos',\n Pacific_Gambier = 'Pacific/Gambier',\n Pacific_Guadalcanal = 'Pacific/Guadalcanal',\n Pacific_Guam = 'Pacific/Guam',\n Pacific_Honolulu = 'Pacific/Honolulu',\n Pacific_Kanton = 'Pacific/Kanton',\n Pacific_Kiritimati = 'Pacific/Kiritimati',\n Pacific_Kosrae = 'Pacific/Kosrae',\n Pacific_Kwajalein = 'Pacific/Kwajalein',\n Pacific_Marquesas = 'Pacific/Marquesas',\n Pacific_Nauru = 'Pacific/Nauru',\n Pacific_Niue = 'Pacific/Niue',\n Pacific_Norfolk = 'Pacific/Norfolk',\n Pacific_Noumea = 'Pacific/Noumea',\n Pacific_Pago_Pago = 'Pacific/Pago_Pago',\n Pacific_Palau = 'Pacific/Palau',\n Pacific_Pitcairn = 'Pacific/Pitcairn',\n Pacific_Port_Moresby = 'Pacific/Port_Moresby',\n Pacific_Rarotonga = 'Pacific/Rarotonga',\n Pacific_Tahiti = 'Pacific/Tahiti',\n Pacific_Tarawa = 'Pacific/Tarawa',\n Pacific_Tongatapu = 'Pacific/Tongatapu',\n}\n","// eslint-disable-next-line no-shadow\nexport enum HubriseEventType {\n CREATE = 'create',\n DELETE = 'delete',\n PATCH = 'patch',\n UPDATE = 'update'\n}\n","// eslint-disable-next-line no-shadow\nexport enum HubriseResourceType {\n CATALOG = 'catalog',\n CUSTOMER = 'customer',\n DELIVERY = 'delivery',\n INVENTORY = 'inventory',\n LOCATION = 'location',\n ORDER = 'order'\n}\n","/* eslint-disable no-shadow */\n// Doc: https://www.hubrise.com/fr/developers/api/order-management/#order-status\nexport enum HubriseOrderStatus {\n new = 'new',\n received = 'received',\n accepted = 'accepted',\n in_preparation = 'in_preparation',\n awaiting_shipment = 'awaiting_shipment',\n awaiting_collection = 'awaiting_collection',\n in_delivery = 'in_delivery',\n completed = 'completed',\n\n rejected = 'rejected',\n cancelled = 'cancelled',\n delivery_failed = 'delivery_failed'\n}\n","/* eslint-disable no-shadow */\nexport enum HubriseServiceType {\n DELIVERY = 'delivery',\n COLLECTION = 'collection', // = pickup\n EAT_IN = 'eat_in'\n}\n","import axios from 'axios';\nimport {HubriseApiContract} from 'common/api/hubrise/service/HubriseApiContract';\nimport {HubriseOrderContract} from 'common/api/hubrise/model/order/HubriseOrderContract';\nimport {HubriseOrderStatus} from 'common/api/hubrise/model/order/HubriseOrderStatus';\nimport {HubriseMenuCatalogContract} from 'common/api/hubrise/model/menu/HubriseMenuCatalogContract';\nimport {ExternalApiException} from 'common/exception/ExternalApiException';\nimport {Logger} from 'common/tool/Logger';\nimport {Retry} from 'common/tool/Retry';\nimport {HubriseCustomerContract} from 'common/api/hubrise/model/customer/HubriseCustomerContract';\nimport {HubriseCustomerListContract} from 'common/api/hubrise/model/customer/HubriseCustomerListContract';\nimport {HubriseLocationContract} from 'common/api/hubrise/model/location/HubriseLocationContract';\nimport {HubriseUserContract} from 'common/api/hubrise/model/user/HubriseUserContract';\nimport * as querystring from 'querystring';\nimport {HubriseAuthContract} from 'common/api/hubrise/model/auth/HubriseAuthContract';\nimport {HubriseResourceType} from 'common/api/hubrise/model/callback/HubriseResourceType';\nimport {HubriseEventType} from 'common/api/hubrise/model/callback/HubriseEventType';\nimport {HubriseAuthResource} from 'common/api/hubrise/model/auth/HubriseAuthResource';\nimport {HubriseRightAccess} from 'common/api/hubrise/model/auth/HubriseRightAccess';\nimport {ValidatorUtil} from 'common/util/ValidatorUtil';\nimport {HubriseAccountContract} from 'common/api/hubrise/model/account/HubriseAccountContract';\nimport {HubriseAccessTokenContract} from 'common/api/hubrise/model/auth/HubriseAccessTokenContract';\nimport {HubriseAccessLevel} from 'common/api/hubrise/model/auth/HubriseAccessLevel';\nimport {BadParameterException} from 'common/exception/BadParameterException';\n\nexport class HubriseApi implements HubriseApiContract {\n public static readonly BASE_URL: string = 'http://api.hubrise.com/v1/';\n public static readonly BASE_AUTH_URL: string = 'https://manager.hubrise.com/oauth2/v1/';\n private static readonly TIMEOUT: number = 15000;\n private readonly accessToken: HubriseAccessTokenContract;\n\n public constructor(accessToken?: HubriseAccessTokenContract) {\n this.accessToken = accessToken;\n }\n\n public async authorize(name: string, clientId: string, redirect: string, accessLevel: HubriseAccessLevel, rights?: Record<HubriseAuthResource, HubriseRightAccess>,\n profile: boolean = false, appInstanceId?: string): Promise<string> {\n return HubriseApi.BASE_AUTH_URL + 'authorize?' +\n (name !== undefined ? 'name=' + String(name) + '&' : '') +\n 'redirect_uri=' + encodeURIComponent(redirect + '&accessLevel=' + String(accessLevel || HubriseAccessLevel.LOCATION)) + '&' +\n 'client_id=' + clientId + '&' +\n 'scope=' + ([HubriseAccessLevel.ACCOUNT, HubriseAccessLevel.LOCATION].includes(accessLevel) ? String(accessLevel)\n + '[' + String(Object.keys(rights).reduce((results, key) => results.concat(key + '.' + String((rights as any)[key])), []).join(',')) + ']' : '')\n + ([HubriseAccessLevel.ACCOUNT, HubriseAccessLevel.LOCATION].includes(accessLevel) && (accessLevel === HubriseAccessLevel.PROFILE || profile) ? ',' : '')\n + (accessLevel === HubriseAccessLevel.PROFILE || profile ? 'profile_with_email' : '') + '&'\n + (appInstanceId === undefined ? '' : 'app_instance_id=' + String(appInstanceId));\n }\n\n public async getToken(clientId: string, clientSecret: string, code: string): Promise<HubriseAuthContract> {\n let auth: HubriseAuthContract;\n await Retry.request(async () => {\n const response: any = await axios.post(HubriseApi.BASE_AUTH_URL + 'token', querystring.stringify({\n code: code,\n client_id: clientId,\n client_secret: clientSecret\n }), {\n headers: {'Content-Type': 'application/x-www-form-urlencoded'},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to get hubrise token');\n }\n\n auth = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return auth;\n }\n\n public async getUser(): Promise<HubriseUserContract> {\n let hubriseUser: HubriseUserContract;\n await Retry.request(async () => {\n const response: any = await axios.get(HubriseApi.BASE_URL + 'user', {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to retrieve hubrise user');\n }\n\n hubriseUser = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return hubriseUser;\n }\n\n public async getAccount(): Promise<HubriseAccountContract> {\n if (this.accessToken.access === HubriseAccessLevel.LOCATION) {\n const location: HubriseLocationContract = await this.getLocation();\n\n return location.account;\n }\n\n let hubriseAccount: HubriseAccountContract;\n await Retry.request(async () => {\n const response: any = await axios.get(HubriseApi.BASE_URL + 'account', {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to retrieve hubrise account');\n }\n\n hubriseAccount = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return hubriseAccount;\n }\n\n public async getLocations(): Promise<HubriseLocationContract[]> {\n if (this.accessToken.access === HubriseAccessLevel.LOCATION) {\n return [await this.getLocation()];\n }\n\n let hubriseLocations: HubriseLocationContract[];\n await Retry.request(async () => {\n const response: any = await axios.get(HubriseApi.BASE_URL + 'locations', {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to retrieve hubrise locations');\n }\n\n hubriseLocations = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return hubriseLocations;\n }\n\n public async getLocation(hubriseLocationId?: string): Promise<HubriseLocationContract> {\n let hubriseLocation: HubriseLocationContract;\n await Retry.request(async () => {\n const url: string = this.accessToken.access === HubriseAccessLevel.ACCOUNT ? 'locations/' + String(hubriseLocationId) : 'location';\n const response: any = await axios.get(HubriseApi.BASE_URL + url, {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to retrieve hubrise location');\n }\n\n hubriseLocation = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return hubriseLocation;\n }\n\n public async createCustomer(hubriseCustomerListId: string, hubriseCustomer: HubriseCustomerContract): Promise<HubriseCustomerContract> {\n let createdCustomer: HubriseCustomerContract;\n await Retry.request(async () => {\n const response: any = await axios.post(HubriseApi.BASE_URL + 'customer_lists/' + String(hubriseCustomerListId) + '/customers', hubriseCustomer, {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to create hubrise customer');\n }\n\n createdCustomer = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return createdCustomer;\n }\n\n public async updateCustomer(hubriseCustomerListId: string, hubriseCustomer: HubriseCustomerContract): Promise<HubriseCustomerContract> {\n if (typeof hubriseCustomer.id !== 'string') {\n throw new BadParameterException('missing customer id', {customer: hubriseCustomer});\n }\n\n let createdCustomer: HubriseCustomerContract;\n await Retry.request(async () => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { id, ...customer } = hubriseCustomer;\n const response: any = await axios.put(HubriseApi.BASE_URL + 'customer_lists/' + String(hubriseCustomerListId) + '/customers/' + String(hubriseCustomer.id), customer, {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to update hubrise customer');\n }\n\n createdCustomer = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return createdCustomer;\n }\n\n public async getCustomer(hubriseCustomerListId: string, hubriseCustomerId: string): Promise<HubriseCustomerContract> {\n let hubriseCustomer: HubriseCustomerContract;\n await Retry.request(async () => {\n const response: any = await axios.get(HubriseApi.BASE_URL + 'customer_lists/' + String(hubriseCustomerListId) + '/customers/' + String(hubriseCustomerId), {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to retrieve hubrise customer');\n }\n\n hubriseCustomer = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return hubriseCustomer;\n }\n\n public async getCustomers(hubriseCustomerListId: string, reference?: string, email?: string, phone?: string): Promise<HubriseCustomerContract[]> {\n const parameters: URLSearchParams = new URLSearchParams();\n if (typeof reference === 'string') {\n parameters.append('private_ref', reference);\n }\n if (typeof email === 'string') {\n parameters.append('email', email + '*');\n }\n if (typeof phone === 'string') {\n parameters.append('phone', phone + '*');\n }\n\n let hubriseCustomers: HubriseCustomerContract[];\n await Retry.request(async () => {\n const response: any = await axios.get(HubriseApi.BASE_URL + 'customer_lists/' + String(hubriseCustomerListId) + '/customers?' + parameters.toString(), {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to retrieve hubrise customers');\n }\n\n hubriseCustomers = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return hubriseCustomers;\n }\n\n public async getCustomerLists(hubriseLocationId: string): Promise<HubriseCustomerListContract[]> {\n let hubriseCustomerLists: HubriseCustomerListContract[];\n await Retry.request(async () => {\n const response: any = await axios.get(HubriseApi.BASE_URL + 'locations/' + String(hubriseLocationId) + '/customer_lists', {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to retrieve hubrise customer lists');\n }\n\n hubriseCustomerLists = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return hubriseCustomerLists;\n }\n\n public async createOrder(hubriseLocationId: string, hubriseOrder: HubriseOrderContract): Promise<HubriseOrderContract> {\n let createdOrder: HubriseOrderContract;\n await Retry.request(async () => {\n const response: any = await axios.post(HubriseApi.BASE_URL + 'locations/' + String(hubriseLocationId) + '/orders', hubriseOrder, {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to create hubrise order');\n }\n\n createdOrder = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return createdOrder;\n }\n\n public async getOrder(hubriseLocationId: string, hubriseOrderId: string): Promise<HubriseOrderContract> {\n let hubriseOrder: HubriseOrderContract;\n await Retry.request(async () => {\n const response: any = await axios.get(HubriseApi.BASE_URL + 'locations/' + String(hubriseLocationId) + '/orders/' + String(hubriseOrderId), {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to retrieve hubrise order');\n }\n\n hubriseOrder = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return hubriseOrder;\n }\n\n public async getOrders(hubriseLocationId: string, startDate?: string, endDate?: string, limit: number = 30): Promise<HubriseOrderContract[]> {\n let hubriseOrders: HubriseOrderContract[] = [];\n\n const queryParams = new URLSearchParams();\n queryParams.append('count', String(limit));\n if (ValidatorUtil.isISODate(startDate)) {\n queryParams.append('after', startDate);\n }\n if (ValidatorUtil.isISODate(endDate)) {\n queryParams.append('before', endDate);\n }\n await Retry.request(async () => {\n const response: any = await axios.get(HubriseApi.BASE_URL + 'locations/' + String(hubriseLocationId) + '/orders?' + queryParams.toString(), {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to retrieve hubrise orders');\n }\n\n hubriseOrders = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return hubriseOrders.sort((a, b) => a.created_at.localeCompare(b.created_at));\n }\n\n public async setOrderStatus(hubriseLocationId: string, hubriseOrderId: string, status: HubriseOrderStatus): Promise<void> {\n await Retry.request(async () => {\n const response: any = await axios.patch(HubriseApi.BASE_URL + 'locations/' + String(hubriseLocationId) + '/orders/' + String(hubriseOrderId), {\n status: status\n }, {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to update hubrise order status');\n }\n }, 1, Logger.error.bind(Logger));\n }\n\n public async getCatalog(hubriseCatalogId: string): Promise<HubriseMenuCatalogContract> {\n let catalog: HubriseMenuCatalogContract;\n await Retry.request(async () => {\n const response: any = await axios.get(HubriseApi.BASE_URL + 'catalogs/' + String(hubriseCatalogId), {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to retrieve hubrise catalogs');\n }\n\n catalog = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return catalog;\n }\n\n public async getCatalogs(hubriseLocationId: string): Promise<HubriseMenuCatalogContract[]> {\n let catalogs: HubriseMenuCatalogContract[] = [];\n await Retry.request(async () => {\n const response: any = await axios.get(HubriseApi.BASE_URL + 'locations/' + String(hubriseLocationId) + '/catalogs', {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to retrieve hubrise catalogs');\n }\n\n catalogs = response.data;\n }, 1, Logger.error.bind(Logger));\n\n return catalogs;\n }\n\n public async createWebhook(url: string, events: Record<HubriseResourceType, HubriseEventType[]>): Promise<void> {\n await Retry.request(async () => {\n const response: any = await axios.post(HubriseApi.BASE_URL + '/callback', {\n url: url,\n events: events\n }, {\n headers: {'X-Access-Token': this.accessToken.token},\n timeout: HubriseApi.TIMEOUT\n });\n\n if (response === undefined || response.data === undefined) {\n throw new ExternalApiException('failed to create hubrise webhook');\n }\n }, 1, Logger.error.bind(Logger));\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"lodash\");","import {isArray, isObject} from 'lodash';\n\nexport class ObjectUtil {\n public static compact(obj: any, options: { removeEmptyString?: boolean } = {}): any {\n if (isArray(obj)) {\n const ouput: any[] = [];\n obj.forEach((value) => {\n value = ObjectUtil.compact(value, options);\n if ((isArray(value) && value.length > 0)\n || (isObject(value) && Object.keys(value).length > 0)\n || (value !== undefined && value !== null && !isArray(value) && !isObject(value))) {\n ouput.push(value);\n }\n });\n\n return ouput;\n } else if (isObject(obj)) {\n const ouput: any = {};\n Object.keys(obj).forEach((key) => {\n let value: any = (obj as any)[key];\n if (isArray(value) || isObject(value)) {\n value = ObjectUtil.compact(value, options);\n if ((isArray(value) && value.length > 0)\n || (isObject(value) && Object.keys(value).length > 0)\n || (value !== undefined && value !== null && !isArray(value) && !isObject(value))) {\n ouput[key] = value;\n }\n } else if (value !== undefined && value !== null\n && (typeof value !== 'string' || options.removeEmptyString === false || value.length > 0)) {\n ouput[key] = value;\n }\n });\n\n return ouput;\n }\n\n return (typeof obj !== 'string' || options.removeEmptyString === false || obj.length > 0) ? obj : undefined;\n }\n\n public static update(source: Record<string, unknown>, target: Record<string, unknown>): void {\n if (typeof source !== 'object' || source === null || typeof target !== 'object' || target === null) {\n return;\n }\n\n // eslint-disable-next-line no-restricted-syntax\n for (const key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n delete source[key]\n }\n }\n Object.assign(source, target)\n }\n}\n","import {HubriseCatalogConverterContract} from 'common/api/hubrise/service/HubriseCatalogConverterContract';\nimport {HubriseMenuCatalogContract} from 'common/api/hubrise/model/menu/HubriseMenuCatalogContract';\nimport {HubriseMenuProductContract} from 'common/api/hubrise/model/menu/HubriseMenuProductContract';\nimport {HubriseMenuCategoryContract} from 'common/api/hubrise/model/menu/HubriseMenuCategoryContract';\nimport {HubriseOrderEditableItemContract} from 'common/api/hubrise/model/order/HubriseOrderEditableItemContract';\nimport {HubriseOrderEditableOptionContract} from 'common/api/hubrise/model/order/HubriseOrderEditableOptionContract';\nimport {HubriseMenuProductOptionListContract} from 'common/api/hubrise/model/menu/HubriseMenuProductOptionListContract';\nimport {isNullOrUndefined} from 'common/util/HelperUtil';\nimport {HubriseMenuProductOptionContract} from 'common/api/hubrise/model/menu/HubriseMenuProductOptionContract';\nimport {ObjectUtil} from 'common/util/ObjectUtil';\n\nexport class HubriseCatalogConverter implements HubriseCatalogConverterContract {\n public editableItems(catalog: HubriseMenuCatalogContract): { withRef: HubriseOrderEditableItemContract[], withName: HubriseOrderEditableItemContract[] } {\n if (!Array.isArray(catalog?.data?.products)) {\n return {withRef: [], withName: []};\n }\n\n const categories: Record<string, string> = {};\n if (Array.isArray(catalog.data.categories)) {\n catalog.data.categories.forEach((category: HubriseMenuCategoryContract) => {\n categories[category.id] = category.name;\n })\n }\n const items: HubriseOrderEditableItemContract[] = [];\n catalog.data.products.forEach((p: HubriseMenuProductContract) => {\n p.skus.forEach(sku => {\n items.push(ObjectUtil.compact({\n id: sku.id,\n sku_ref: sku.ref ?? undefined,\n category_name: categories[p.category_id],\n product_name: [p.name, sku.name].filter(part => part !== null).join(' - '),\n quantity: '1',\n tax_rate: p.tax_rate ?? undefined,\n price: sku.price\n }));\n });\n\n // const reference: string | null | undefined = p.ref ??\n // (p.skus?.length === 1 && (!Array.isArray(p.skus[0].option_list_ids) || p.skus[0].option_list_ids.length === 0) ? p.skus[0].ref : null);\n // const price: string | null = p.skus?.length === 1 && (!Array.isArray(p.skus[0].option_list_ids) || p.skus[0].option_list_ids.length === 0)\n // ? p.skus[0].price : HubrisePriceUtil.multiply(p.skus[0].price, 0);\n //\n // return {id: p.id, sku_ref: reference, category_name: categories[p.category_id], product_name: p.name, quantity: '1', tax_rate: p.tax_rate, price};\n })\n items.sort((a: HubriseOrderEditableItemContract, b: HubriseOrderEditableItemContract) =>\n a.category_name?.localeCompare(b.category_name ?? '') || a.product_name?.localeCompare(b.product_name ?? ''))\n\n return {withRef: items.filter(i => !isNullOrUndefined(i.sku_ref)), withName: items};\n }\n\n public editableItemOptions(catalog: HubriseMenuCatalogContract): {\n withRef: Record<string, HubriseOrderEditableOptionContract[]>,\n withName: Record<string, HubriseOrderEditableOptionContract[]>\n } {\n if (!Array.isArray(catalog?.data?.products)) {\n return {withRef: {}, withName: {}};\n }\n\n const optionLists: Record<string, HubriseMenuProductOptionListContract> = {}\n if (Array.isArray(catalog.data.option_lists)) {\n catalog.data.option_lists.forEach((o: any) => {\n optionLists[o.id] = o;\n });\n }\n\n const editableItemOptionNames: Record<string, HubriseOrderEditableOptionContract[]> = {};\n catalog.data.products.forEach((p: HubriseMenuProductContract) => {\n p.skus.forEach(sku => {\n if (Array.isArray(sku.option_list_ids) && sku.option_list_ids.length > 0) {\n editableItemOptionNames[sku.id] = [];\n sku.option_list_ids.forEach((optionListId: string) => {\n const optionList: HubriseMenuProductOptionListContract = optionLists[optionListId]\n if (optionList === undefined)\n return // TODO log\n\n if (!Array.isArray(optionList.options) || optionList.options.length === 0)\n return // TODO log\n\n optionList.options.forEach((option: HubriseMenuProductOptionContract) => {\n editableItemOptionNames[sku.id].push(ObjectUtil.compact({\n id: String(option.id),\n ref: option.ref ?? optionList.ref ?? null,\n option_list_name: optionList.name,\n name: option.name,\n quantity: 1,\n price: option.price\n }));\n });\n });\n editableItemOptionNames[sku.id].sort((a: HubriseOrderEditableOptionContract, b: HubriseOrderEditableOptionContract) =>\n a.option_list_name?.localeCompare(b.option_list_name ?? '') || a.name?.localeCompare(b.name ?? ''));\n }\n });\n\n\n // editableItemOptionNames[p.id] = []\n // if (!Array.isArray(p.skus) || p.skus.length === 0 || !Array.isArray(p.skus[0].option_list_ids) || p.skus[0].option_list_ids.length === 0)\n // return\n //\n // p.skus.forEach((sku: any) => {\n // if (Array.isArray(sku.option_list_ids) && sku.option_list_ids.length > 0) {\n // sku.option_list_ids.forEach((optionListId: any) => {\n // const optionList: any = optionLists[optionListId]\n // if (optionList === undefined)\n // return // TODO log\n //\n // if (!Array.isArray(optionList.options) || optionList.options.length === 0)\n // return // TODO log\n //\n // optionList.options.forEach((option: any) => {\n // const price: string = HubrisePriceUtil.sum([sku.price ?? null, option.price ?? null])\n //\n // editableItemOptionNames[p.id].push({\n // id: String(sku.id) + '-' + String(optionList.id) + '-' + String(option.id),\n // ref: option.ref ?? null,\n // option_list_name: optionList.name,\n // name: option.name,\n // quantity: 1,\n // price\n // })\n // })\n // })\n // } else {\n // const price: string = sku.price ?? null\n //\n // editableItemOptionNames[p.id].push({id: sku.id, ref: sku.ref ?? null, option_list_name: '', name: sku.name, quantity: 1, price});\n // }\n // })\n // editableItemOptionNames[p.id].sort(\n // (a: HubriseOrderEditableOptionContract, b: HubriseOrderEditableOptionContract) => a.name?.localeCompare(b.name ?? ''))\n });\n\n const editableItemOptionRefs: Record<string, HubriseOrderEditableOptionContract[]> = {}\n Object.keys(editableItemOptionNames).forEach(itemId => {\n editableItemOptionRefs[itemId] = editableItemOptionNames[itemId]?.filter(o => !isNullOrUndefined(o.ref)) ?? [];\n });\n\n return {\n withRef: editableItemOptionRefs,\n withName: editableItemOptionNames\n };\n }\n}\n","import {HubriseOrderConverterContract} from 'common/api/hubrise/service/HubriseOrderConverterContract';\nimport {HubriseOrderItemContract} from 'common/api/hubrise/model/order/HubriseOrderItemContract';\nimport {HubriseOrderEditableItemContract} from 'common/api/hubrise/model/order/HubriseOrderEditableItemContract';\nimport {HubriseOrderOptionContract} from 'common/api/hubrise/model/order/HubriseOrderOptionContract';\nimport {HubriseServiceType} from 'common/api/hubrise/model/order/HubriseServiceType';\nimport {ObjectUtil} from 'common/util/ObjectUtil';\n\nexport class HubriseOrderConverter implements HubriseOrderConverterContract {\n public items(editableItems: HubriseOrderEditableItemContract[], serviceType: HubriseServiceType): HubriseOrderItemContract[] {\n if (!Array.isArray(editableItems)) {\n return [];\n }\n\n return editableItems.map((editableItem: HubriseOrderEditableItemContract) => {\n const options: HubriseOrderOptionContract[] = [];\n if (Array.isArray(editableItem.options)) {\n editableItem.options.forEach((editableOption: HubriseOrderOptionContract) => {\n options.push({\n ref: editableOption.ref,\n option_list_name: editableOption.option_list_name,\n name: editableOption.name,\n quantity: Number(editableOption.quantity ?? 1),\n price: editableOption.price\n });\n });\n }\n\n return ObjectUtil.compact({\n sku_ref: editableItem.sku_ref,\n sku_name: editableItem.sku_name,\n product_name: editableItem.product_name,\n quantity: String(editableItem.quantity ?? '1'),\n price: editableItem.price,\n subtotal: '', // TODO multiply quantity + sum options\n tax_rate: serviceType === undefined || editableItem.tax_rate === undefined || editableItem.tax_rate === null ? undefined : editableItem.tax_rate[serviceType],\n customer_notes: editableItem.customer_notes,\n options: options\n });\n });\n }\n}\n","export class MathUtil {\n public static sum(values: number[]): number {\n if (values.length === 0) {\n return 0;\n }\n\n return values.reduce((accumulator, value) => accumulator + value, 0);\n }\n\n\n public static avg(values: number[]): number {\n const total: number = MathUtil.sum(values);\n if (total === 0) {\n return 0;\n }\n\n return MathUtil.round(total / values.length, 2);\n }\n\n public static applyVariation(value: number, variation: number): number {\n let increase: number;\n if (value >= 0) {\n increase = 1 + (variation / 100);\n } else {\n increase = 1 - (variation / 100);\n }\n\n return value * increase;\n }\n\n public static median(values: number[]): number {\n if (values.length === 0) {\n return 0;\n }\n if (values.length === 1) {\n return values[0];\n }\n\n const valuesSorted: number[] = values.sort((a, b) => {\n return a - b;\n });\n\n if (valuesSorted.length % 2 === 0) {\n return MathUtil.avg([valuesSorted[(valuesSorted.length / 2) - 1], valuesSorted[(valuesSorted.length / 2)]]);\n }\n\n return valuesSorted[Math.floor(valuesSorted.length / 2)];\n }\n\n public static percentage(part: number, total: number): number {\n if (typeof part !== 'number' || typeof total !== 'number') {\n return undefined;\n }\n\n if (total === 0) {\n return 0;\n }\n\n return ((part / total) * 100);\n }\n\n public static round(value: number, decimals: number): number {\n if (typeof value !== 'number') {\n return value;\n }\n\n if (decimals === 0) {\n return Math.round(value);\n }\n\n return Math.round(value * (10 ** decimals)) / (10 ** decimals);\n }\n\n public static variation(originalValue: number, newValue: number): number {\n let percent = 0;\n if (newValue !== 0) {\n if (originalValue !== 0) {\n percent = (newValue - originalValue) / Math.abs(originalValue) * 100;\n } else {\n percent = ((newValue > 0) ? 1 : -1) * 100;\n }\n } else if (originalValue !== 0) {\n percent = ((originalValue > 0) ? 1 : -1) * -100;\n }\n\n return Math.floor(percent);\n }\n}\n","import {HubriseCurrencyCode} from 'common/api/hubrise/model/common/HubriseCurrencyCode';\nimport {isNullOrUndefined} from 'common/util/HelperUtil';\nimport {MathUtil} from 'common/util/MathUtil';\n\nexport class HubrisePriceUtil {\n public static sum(prices: string[], defaultCurrency: HubriseCurrencyCode = HubriseCurrencyCode.EUR): string {\n if (!Array.isArray(prices) || prices.length === 0) {\n return '0.00 ' + String(defaultCurrency);\n }\n if (prices.length === 1) {\n return prices[0];\n }\n const results: { amount: number, currency: HubriseCurrencyCode }[] = prices.map(price => HubrisePriceUtil.priceToAmount(price)).filter(result => result !== undefined);\n if (results.length === 0) {\n return '0.00 ' + String(defaultCurrency);\n }\n\n const total: number = MathUtil.sum(results.map(result => result.amount));\n\n return HubrisePriceUtil.amountToPrice(total, results[0].currency ?? defaultCurrency);\n }\n\n public static multiply(price: string, multiplier: number): string {\n if (isNullOrUndefined(price) || isNullOrUndefined(multiplier)) {\n return undefined;\n }\n if (multiplier === 1) {\n return price;\n }\n\n const result: { amount: number, currency: HubriseCurrencyCode } = HubrisePriceUtil.priceToAmount(price);\n if (result === undefined) {\n return undefined;\n }\n\n return HubrisePriceUtil.amountToPrice(result.amount * multiplier, result.currency);\n }\n\n public static priceToAmount(price: string): { amount: number, currency: HubriseCurrencyCode } {\n if (isNullOrUndefined(price)) {\n return undefined;\n }\n\n const parts: string[] = price.split(' ');\n if (parts.length !== 2) {\n return undefined;\n }\n\n return {amount: Number(parts.slice(0, parts.length - 1).join('')), currency: parts[parts.length - 1] as HubriseCurrencyCode};\n }\n\n public static amountToPrice(amount: number, currency: HubriseCurrencyCode): string {\n return String(MathUtil.round(amount, 2).toFixed(2)) + ' ' + String(currency);\n }\n\n // public calculateTotalTaxIncluded(items: Api.HubriseOrderItemContract[], defaultCurrency: Api.HubriseCurrencyCode): string {\n // if (!Array.isArray(items)) {\n // return undefined;\n // }\n //\n // const total: number = Util.MathUtil.sum(items.map(item => {\n // return this.parseHubriseAmount(item.price) + Util.MathUtil.sum((item.options || []).map(option => this.parseHubriseAmount(option.price)));\n // }));\n // const currency: Api.HubriseCurrencyCode = this.parseHubriseCurrency(items, defaultCurrency);\n //\n // return this.displayHubriseAmount(total, currency);\n // }\n //\n // private parseHubriseCurrency(items: Api.HubriseOrderItemContract[], defaultCurrency: Api.HubriseCurrencyCode): Api.HubriseCurrencyCode {\n // let currency: Api.HubriseCurrencyCode = defaultCurrency ?? Api.HubriseCurrencyCode.EUR;\n // if (items.length > 0) {\n // const amount: string = items[0].price;\n // const currencyParsed: string = amount.substring(amount.indexOf(' ') + 1).trim();\n // if (currencyParsed.length === 3) {\n // currency = currencyParsed as Api.HubriseCurrencyCode;\n // }\n // }\n //\n // return currency;\n // }\n}\n","import {TotalHubriseCalculatorContract} from 'common/api/hubrise/service/TotalHubriseCalculatorContract';\nimport {HubriseOrderItemContract} from 'common/api/hubrise/model/order/HubriseOrderItemContract';\nimport {HubriseCurrencyCode} from 'common/api/hubrise/model/common/HubriseCurrencyCode';\nimport {HubrisePriceUtil} from 'common/api/hubrise/util/HubrisePriceUtil';\nimport {HubriseOrderOptionContract} from 'common/api/hubrise/model/order/HubriseOrderOptionContract';\nimport {HubriseOrderContract} from 'common/api/hubrise/model/order/HubriseOrderContract';\n\nexport class TotalHubriseCalculator implements TotalHubriseCalculatorContract {\n public calculateTotals(order: HubriseOrderContract, defaultCurrency: HubriseCurrencyCode):\n { subtotal: string, minimumOrderFee: string, deliveryFee: string, totalDiscount: string, total: string } {\n if (!Array.isArray(order.items)) {\n return undefined;\n }\n\n const currency: HubriseCurrencyCode = this.findCurrency(order.items, defaultCurrency);\n const subtotal: string = HubrisePriceUtil.sum(order.items.map(item => {\n return HubrisePriceUtil.sum([HubrisePriceUtil.multiply(item.price, Number(item.quantity))].concat(\n HubrisePriceUtil.sum((item.options || []).map(option => {\n return HubrisePriceUtil.multiply(option.price, Number(option.quantity));\n }))\n ));\n }));\n const minimumOrderFee: string = '0.00 ' + String(currency);\n const deliveryFee: string = '0.00 ' + String(currency);\n const totalDiscount: string = '0.00 ' + String(currency);\n const total: string = HubrisePriceUtil.sum([subtotal, minimumOrderFee, deliveryFee, HubrisePriceUtil.multiply(totalDiscount, -1)]);\n\n return {subtotal, minimumOrderFee, deliveryFee, totalDiscount, total: total};\n }\n\n private findCurrency(itemOrOptions: HubriseOrderItemContract[] | HubriseOrderOptionContract[], defaultCurrency: HubriseCurrencyCode): HubriseCurrencyCode {\n return itemOrOptions.reduce((c, i) => {\n const result: { amount: number, currency: HubriseCurrencyCode } = HubrisePriceUtil.priceToAmount(i.price);\n if (typeof result?.currency === 'string' && result.currency !== c) {\n return result.currency;\n }\n if ('options' in i && Array.isArray(i.options)) {\n return this.findCurrency(i.options, c);\n }\n\n return c;\n }, defaultCurrency);\n }\n}\n","export class Path {\n private static BASE_PATH: string = './';\n\n public static registerBasePath(basePath: string): void {\n if (process.env.APP_HOME !== undefined) {\n Path.BASE_PATH = process.env.APP_HOME + '/';\n } else {\n Path.BASE_PATH = basePath + (basePath.endsWith('/') ? '' : '/');\n }\n }\n\n public static data(): string {\n return Path.BASE_PATH + 'data/';\n }\n\n public static db(): string {\n return Path.storage() + 'db/';\n }\n\n public static root(): string {\n return Path.BASE_PATH;\n }\n\n public static session(): string {\n return Path.storage() + 'session/';\n }\n\n public static storage(): string {\n return Path.BASE_PATH + 'storage/';\n }\n}\n","import {MainException} from 'common/exception/MainException';\nimport {ExceptionContract} from 'common/exception/ExceptionContract';\n\nexport class BadRequestException extends MainException implements ExceptionContract {\n public constructor(message: string, data?: {[key: string]: any}) {\n super(message, 400, data);\n this.name = 'BadRequestException';\n }\n}\n","import {MainException} from 'common/exception/MainException';\nimport {ExceptionContract} from 'common/exception/ExceptionContract';\n\nexport class ConflictException extends MainException implements ExceptionContract {\n public constructor(message: string, data?: {[key: string]: any}) {\n super(message, 409, data);\n this.name = 'ConflictException';\n }\n}\n","import {MainException} from 'common/exception/MainException';\nimport {ExceptionContract} from 'common/exception/ExceptionContract';\n\nexport class DuplicateException extends MainException implements ExceptionContract {\n public constructor(message: string, data?: {[key: string]: any}) {\n super(message, 409, data);\n this.name = 'DuplicateException';\n }\n}\n","import {MainException} from 'common/exception/MainException';\nimport {ExceptionContract} from 'common/exception/ExceptionContract';\n\nexport class InternalException extends MainException implements ExceptionContract {\n public constructor(message: string, data?: {[key: string]: any}) {\n super(message, 500, data);\n this.name = 'InternalException';\n }\n}\n","import {MainException} from 'common/exception/MainException';\nimport {ExceptionContract} from 'common/exception/ExceptionContract';\n\nexport class NotImplementedException extends MainException implements ExceptionContract {\n public constructor(message: string, data?: {[key: string]: any}) {\n super(message, 501, data);\n this.name = 'NotImplementedException';\n }\n}\n","import {MainException} from 'common/exception/MainException';\nimport {ExceptionContract} from 'common/exception/ExceptionContract';\n\nexport class ObjectNotFoundException extends MainException implements ExceptionContract {\n public constructor(message: string, data?: {[key: string]: any}) {\n super(message, 404, data);\n this.name = 'ObjectNotFoundException';\n }\n}\n","import {MainException} from 'common/exception/MainException';\nimport {ExceptionContract} from 'common/exception/ExceptionContract';\n\nexport class PageNotFoundException extends MainException implements ExceptionContract {\n public constructor(message: string, data?: {[key: string]: any}) {\n super(message, 404, data);\n this.name = 'PageNotFoundException';\n }\n}\n","import * as express from 'express';\nimport {Logger} from 'common/tool/Logger';\n\nexport class HandlerController {\n public static error(_request: express.Request, response: express.Response, error: any): any {\n Logger.error(error);\n const code: number = error.code !== undefined && error.code !== null ? Number(error.code) : 500;\n response.status(!isNaN(code) && Number(error.code) >= 400 && Number(error.code) <= 599 ? Number(error.code) : 500);\n response.json({code: error.code, message: error.message});\n }\n}\n","import * as express from 'express';\nimport {AuthenticationMiddlewareContract} from 'common/http/AuthenticationMiddlewareContract';\nimport {AuthentificationConfigurationContract} from 'common/http/AuthentificationConfigurationContract';\nimport {UnauthorizedException} from 'common/exception/UnauthorizedException';\nimport {HandlerController} from 'common/http/HandlerController';\n\nexport class AuthenticationMiddleware implements AuthenticationMiddlewareContract {\n private configuration: AuthentificationConfigurationContract;\n\n public constructor(configuration: AuthentificationConfigurationContract) {\n this.configuration = configuration;\n }\n\n public handler(): (request: express.Request, response: express.Response, next: () => void) => void {\n return (request: express.Request, response: express.Response, next: () => void) => {\n try {\n let authenticated: boolean = false;\n\n if (!authenticated && this.configuration.jwt !== undefined) {\n (request as any).session = {\n // TODO\n };\n\n authenticated = true;\n }\n\n if (!authenticated && this.configuration.key !== undefined) {\n authenticated = this.authApiKey(request);\n }\n\n if (!authenticated && this.configuration.session !== undefined) {\n const sessionKeys: string[] = Object.keys((request as any).session);\n if (!Array.isArray(this.configuration.session.required)) {\n throw new UnauthorizedException('session is not well formatted');\n }\n\n this.configuration.session.required.forEach((required) => {\n if (!sessionKeys.includes(required)) {\n throw new UnauthorizedException('session is incomplete');\n }\n });\n\n authenticated = true;\n }\n\n if (!authenticated && this.configuration.none !== undefined) {\n authenticated = this.authNone(request);\n }\n\n if (authenticated) {\n next();\n } else {\n throw new UnauthorizedException('request is not authenticate');\n }\n } catch (error) {\n HandlerController.error(request, response, error);\n }\n };\n }\n\n private authApiKey(request: express.Request): boolean {\n if (typeof request.headers.Authorization !== 'string' || !request.headers.Authorization.startsWith('apiKey')) {\n return false;\n }\n\n const parts: string[] = request.headers.Authorization.split(' ');\n if (parts.length !== 2) {\n throw new UnauthorizedException('api key is not well formatted');\n }\n\n if (parts[1] !== this.configuration.key.secret) {\n throw new UnauthorizedException('api key is not valid');\n }\n\n (request as any).session = {};\n\n return true;\n }\n\n private authNone(request: express.Request): boolean {\n if (Array.isArray(this.configuration.none.urlStartsWith)) {\n if (this.configuration.none.urlStartsWith.find((urlStartsWith) => request.originalUrl?.startsWith(urlStartsWith)) !== undefined) {\n (request as any).session = {};\n\n return true;\n }\n }\n\n return false;\n }\n}\n","import {AuthorizationMiddlewareContract} from 'common/http/AuthorizationMiddlewareContract';\n\nexport class AuthorizationMiddleware implements AuthorizationMiddlewareContract {\n public can(_action: string, _subject: string): void {\n // TODO\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"express\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"cors\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"compression\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"helmet\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"connect-timeout\");","import * as crypto from 'crypto';\nimport express, {Express, json, urlencoded} from 'express';\nimport cors from 'cors';\nimport compression from 'compression';\nimport helmet from 'helmet';\nimport timeout from 'connect-timeout';\nimport {ServerContract} from 'common/http/ServerContract';\nimport {Logger} from 'common/tool/Logger';\n\nexport class Server implements ServerContract {\n public static readonly DEFAULT_PORT: number = 8080;\n public static readonly SALT: string = '03561b4a0fe7f125025';\n private app: Express;\n\n public async create(origins: string[], port?: number): Promise<Express> {\n if (this.app === undefined) {\n const backendPort: number = port || Server.DEFAULT_PORT;\n const backendLocalUrl: string = 'http://localhost:' + String(backendPort);\n Logger.debug('start server on ' + backendLocalUrl);\n this.app = express();\n this.app.set('trust proxy', true);\n this.app.disable('x-powered-by');\n this.app.use(compression({level: -1}));\n this.app.use(timeout('300s'));\n this.app.use(json({\n inflate: true,\n limit: '10mb',\n reviver: null,\n strict: true,\n type: 'application/json',\n verify: undefined\n }));\n this.app.use(urlencoded({\n limit: '10mb'\n }));\n this.app.use(cors({\n origin: [backendLocalUrl].concat(origins),\n credentials: true\n }));\n this.app.use(helmet());\n this.app.use(json());\n this.app.listen(backendPort, () => {\n Logger.debug('server is running on ' + backendLocalUrl);\n });\n }\n\n return this.app;\n }\n\n public getSessionSecret(sessionCookieName: string): string {\n return crypto.createHash('sha1').update(sessionCookieName + Server.SALT).digest('hex');\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"nock\");","import {cleanAll, isActive, isDone, pendingMocks} from 'nock';\n\nexport class ApiMockup {\n public static isDone(): boolean {\n return isActive() && isDone();\n }\n\n public static pending(): string {\n return 'pending: ' + JSON.stringify(pendingMocks());\n }\n\n public static reset(): void {\n cleanAll();\n }\n}\n","/* eslint-disable @typescript-eslint/no-var-requires */\nimport nock from 'nock';\nimport {ApiMockup} from 'common/mockup/ApiMockup';\nimport {HubriseOrderContract} from 'common/api/hubrise/model/order/HubriseOrderContract';\nimport {cloneDeep} from 'lodash';\n\nexport class HubriseApiMockup extends ApiMockup {\n public static readonly BASE_URL: string = 'http://api.hubrise.com';\n\n public static getUser(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/user')) {\n return '/user';\n }\n\n return path;\n }).get('/user').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/user.json')));\n }\n\n public static getAccount(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/account')) {\n return '/account';\n }\n\n return path;\n }).get('/account').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/account.json')));\n }\n\n public static getLocations(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/locations')) {\n return '/locations';\n }\n\n return path;\n }).get('/locations').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/locations.json')));\n }\n\n public static getLocation(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.endsWith('/location') || path.includes('/locations/')) {\n return '/location';\n }\n\n return path;\n }).get('/location').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/location.json')));\n }\n\n public static createCustomer(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/customer')) {\n return '/customer';\n }\n\n return path;\n }).post('/customer').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/customer.json')));\n }\n\n public static updateCustomer(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/customer')) {\n return '/customer';\n }\n\n return path;\n }).put('/customer').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/customer.json')));\n }\n\n public static getCustomer(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/customer_lists') && path.includes('/customers')) {\n return '/customer';\n }\n\n return path;\n }).get('/customer').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/customer.json')));\n }\n\n public static getCustomers(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/customers')) {\n return '/customers';\n }\n\n return path;\n }).get('/customers').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/customers.json')));\n }\n\n public static getCustomerLists(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/customer_lists')) {\n return '/customerLists';\n }\n\n return path;\n }).get('/customerLists').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/customer_lists.json')));\n }\n\n public static createOrder(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/order')) {\n return '/order';\n }\n\n return path;\n }).post('/order').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/order.json')));\n }\n\n public static getOrder(times: number = 1, generateRandomId: boolean = false): void {\n const order: HubriseOrderContract = cloneDeep(require('../../data/mockup/api/hubrise/order.json'));\n if (generateRandomId) {\n order.id = String(Date.now());\n }\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/orders/')) {\n return '/order';\n }\n\n return path;\n }).get('/order').times(times).reply(200, order);\n }\n\n public static getOrders(times: number = 1, generateRandomId: boolean = false): void {\n const orders: HubriseOrderContract[] = cloneDeep(require('../../data/mockup/api/hubrise/orders.json'));\n if (generateRandomId) {\n orders.forEach(order => order.id = String(Date.now()));\n }\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/orders') && !path.includes('/orders/')) {\n return '/orders';\n }\n\n return path;\n }).get('/orders').times(times).reply(200, orders);\n }\n\n public static setOrderStatus(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/orders/')) {\n return '/status';\n }\n\n return path;\n }).patch('/status').times(times).reply(204);\n }\n\n public static getCatalog(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/catalog')) {\n return '/catalog';\n }\n\n return path;\n }).get('/catalog').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/catalog.json')));\n }\n\n public static getCatalogs(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/catalogs')) {\n return '/catalogs';\n }\n\n return path;\n }).get('/catalogs').times(times).reply(200, cloneDeep(require('../../data/mockup/api/hubrise/catalogs.json')));\n }\n\n public static createWebhook(times: number = 1): void {\n const mock: nock.Scope = nock(HubriseApiMockup.BASE_URL, {allowUnmocked: false});\n mock.filteringPath((path: string) => {\n if (path.includes('/callback')) {\n return '/webhook';\n }\n\n return path;\n }).post('/webhook').times(times).reply(200);\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"luxon\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"iconv-lite\");","import {encode} from 'iconv-lite';\n\nexport class UrlUtil {\n public static isUTF8(charset: string): boolean {\n if (!charset) {\n return true;\n }\n charset = charset.toLowerCase();\n\n return charset === 'utf8' || charset === 'utf-8';\n }\n\n public static urlencode(str: string, charset: string): string {\n if (!charset || UrlUtil.isUTF8(charset)) {\n return encodeURIComponent(str);\n }\n const buf = encode(str, charset);\n let encodeStr = '';\n let ch = '';\n\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < buf.length; i++) {\n ch = buf[i].toString(16);\n if (ch.length === 1) {\n ch = '0' + ch;\n }\n encodeStr += '%' + ch;\n }\n encodeStr = encodeStr.toUpperCase();\n\n return encodeStr;\n }\n}\n","import axios from 'axios';\nimport {DateTime} from 'luxon';\nimport * as querystring from 'querystring';\nimport {SmsSenderServiceContract} from 'common/service/sender/SmsSenderServiceContract';\nimport {ExternalApiException} from 'common/exception/ExternalApiException';\nimport {Retry} from 'common/tool/Retry';\nimport {Logger} from 'common/tool/Logger';\nimport {Environment} from 'common/tool/Environment';\nimport {BadParameterException} from 'common/exception/BadParameterException';\nimport {Env} from 'common/tool/Env';\nimport {ValidatorUtil} from 'common/util/ValidatorUtil';\nimport {UrlUtil} from 'common/util/UrlUtil';\n\nexport class SmsSenderService implements SmsSenderServiceContract {\n public static readonly BASE_API_URL: string = 'https://api.smsmode.com/http/1.6/';\n public static readonly MESSAGE_MAX_LENGTH: number = 150;\n private readonly token: string;\n private readonly mode: Environment;\n\n public constructor(token: string, mode: Environment) {\n this.token = token;\n this.mode = mode;\n }\n\n public async send(senderName: string, message: string, rawPhones: string[], isCommercial: boolean = true, sendAt?: string): Promise<void> {\n let phones: string[] = this.checkPhoneFormat(rawPhones);\n if (phones.length === 0) {\n Logger.warning(new BadParameterException('no valid phone', {phones: rawPhones}));\n\n return Promise.resolve();\n }\n\n if (phones.length > 1) {\n if (message.length > SmsSenderService.MESSAGE_MAX_LENGTH * 2) {\n message = message.substring(0, SmsSenderService.MESSAGE_MAX_LENGTH * 2);\n } else if (message.length > SmsSenderService.MESSAGE_MAX_LENGTH && message.length <= SmsSenderService.MESSAGE_MAX_LENGTH * 1.33) {\n message = message.substring(0, SmsSenderService.MESSAGE_MAX_LENGTH);\n }\n }\n\n await Retry.request(async () => {\n const params: Record<string, any> = {\n accessToken: this.token,\n emetteur: senderName,\n message: UrlUtil.urlencode(message, 'ISO-8859-15'),\n numero: phones.map((phone) => phone.replace('+', '')).join(','),\n classe_msg: 2,\n nbr_msg: Math.ceil(message.length / SmsSenderService.MESSAGE_MAX_LENGTH)\n };\n\n if (isCommercial) {\n params.stop = 1;\n }\n\n if (sendAt !== undefined) {\n params.date_envoi = DateTime.fromISO(sendAt, { setZone: true }).toFormat('ddMMyyyy-HH:mm');\n }\n\n const target: DateTime = DateTime.fromISO(sendAt ?? (new Date()).toISOString(), { setZone: true }).setZone('Europe/Paris');\n if (isCommercial) { // do not send between 21h and 9h\n if (target.hour >= 21) {\n params.date_envoi = target.plus({day: 1}).set({hour: 9}).toFormat('ddMMyyyy-HH:mm');\n } else if (target.hour < 9) {\n params.date_envoi = target.set({hour: 9}).toFormat('ddMMyyyy-HH:mm');\n }\n } else { // do not send between 00h and 8h\n if (target.hour < 8) {\n params.date_envoi = target.set({hour: 8}).toFormat('ddMMyyyy-HH:mm');\n }\n }\n\n if (this.mode === Env.TEST) {\n Logger.info('Simulation Mode: SMS has been sent', {params: params});\n } else {\n if (this.mode === Env.DEVELOPMENT) {\n phones = ['+15145705214'];\n }\n\n const response: {data: string} = await axios.post(SmsSenderService.BASE_API_URL + 'sendSMS.do',\n querystring.stringify(params, '&', '=', {encodeURIComponent: (p) => p}), {\n timeout: 30000\n });\n\n if (response.data.length > 0 && response.data.trim().substring(0, 1) !== '0') {\n throw new ExternalApiException('Error: ' + response.data, params);\n }\n }\n }, 0, Logger.error.bind(Logger));\n }\n\n private checkPhoneFormat(phones: string[]): string[] {\n return phones.filter((phone) => ValidatorUtil.isIntMobilePhone(phone));\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"path\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"mustache\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"fs\");","export const asyncForEach: (array: any[], callback: (item: any) => Promise<void>) => Promise<void> = async (array, callback) => {\n for (let i: number = 0; i < array.length; i++) { // eslint-disable-line\n await callback(array[i]);\n }\n};\n\nexport const wait: (time: number) => Promise<void> = (time) => {\n return new Promise((resolve) => setTimeout(resolve, time));\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"color-name\");","import * as colors from 'color-name';\n\nexport class GeneratorUtil {\n private static readonly symbolUpperCases: string[] = [\n 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'K', 'M', 'N', 'P', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'\n ];\n private static readonly symbolLowerCases: string[] = [\n 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'k', 'm', 'n', 'p', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'\n ];\n\n public static code(size: number): string {\n if (size === null || size === undefined) {\n size = 6;\n }\n\n let code: string = '';\n while (code.length < size) {\n code += GeneratorUtil.symbolUpperCases[GeneratorUtil.int(0, GeneratorUtil.symbolUpperCases.length - 1)];\n }\n\n return code;\n }\n\n public static color(alpha: number = 1): string {\n const alphaHex: string = GeneratorUtil.rgbToHex(Math.round(255 * alpha));\n const defaultColor: string = '#000000' + alphaHex;\n const colorList: number[][] = Object.values(colors);\n if (colorList.length === 0) {\n return defaultColor;\n }\n const rgb: number[] = colorList[GeneratorUtil.int(0, colorList.length - 1)];\n if (rgb.length !== 3) {\n return defaultColor;\n }\n\n return '#' + GeneratorUtil.rgbToHex(rgb[0]) + GeneratorUtil.rgbToHex(rgb[1]) + GeneratorUtil.rgbToHex(rgb[2]) + alphaHex;\n }\n\n private static rgbToHex(rgb: number): string {\n const hex: string = rgb.toString(16);\n if (hex.length === 1) {\n return '0' + hex;\n }\n\n return hex;\n }\n\n public static int(min: number, max: number): number {\n if (min === null || min === undefined) {\n min = 0;\n }\n if (max === null || max === undefined) {\n max = Number.POSITIVE_INFINITY;\n }\n\n min = Math.ceil(min);\n max = Math.floor(max);\n\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }\n\n public static password(size: number): string {\n if (size === null || size === undefined) {\n size = 8;\n }\n\n let code: string = '';\n while (code.length < size) {\n switch (GeneratorUtil.int(1, 3)) {\n case 1:\n code += GeneratorUtil.symbolUpperCases[GeneratorUtil.int(0, GeneratorUtil.symbolUpperCases.length - 1)];\n break;\n case 2:\n code += GeneratorUtil.symbolLowerCases[GeneratorUtil.int(0, GeneratorUtil.symbolLowerCases.length - 1)];\n break;\n default:\n code += String(GeneratorUtil.int(0, 9));\n }\n }\n\n return code;\n }\n}\n","import * as fs from 'fs';\nimport * as path from 'path';\nimport {FileSystemContract} from 'common/tool/FileSystemContract';\nimport {BadParameterException} from 'common/exception/BadParameterException';\nimport {asyncForEach} from 'common/util/PromiseUtil';\nimport {GeneratorUtil} from 'common/util/GeneratorUtil';\n\nexport class FileSystem implements FileSystemContract {\n public dirPath(filePath: string): string {\n const i: number = path.resolve(filePath).lastIndexOf(path.sep);\n if (i < 0) {\n return filePath;\n }\n\n return (path.resolve(path.resolve(filePath).substring(0, i + 1)) + path.sep).replace(/\\\\/g, '/');\n }\n\n public async listFiles(dirPath: string): Promise<string[]> {\n if (!this.isDir(dirPath)) {\n throw new BadParameterException(String(dirPath) + ' does not exist or is not a directory');\n }\n\n const separator: string = dirPath.endsWith('/') ? '' : '/';\n const files: string[] = fs.readdirSync(dirPath);\n\n const output: string[] = [];\n await asyncForEach(files, async (fileName: string) => {\n if (this.isFile(dirPath + separator + fileName)) {\n output.push(dirPath + separator + fileName);\n }\n });\n\n return output;\n }\n\n public async randomFile(dirPath: string, suggestion?: number): Promise<string> {\n const filenames: string[] = await this.listFiles(dirPath);\n if (filenames.length === 0) {\n return undefined;\n }\n\n let index: number;\n if (suggestion !== undefined) {\n index = Math.max(suggestion, 0) % filenames.length;\n } else {\n index = GeneratorUtil.int(0, filenames.length - 1);\n }\n\n return filenames[index];\n }\n\n public async move(filePath: string, dirPath: string): Promise<void> {\n if (!this.isFile(filePath)) {\n throw new BadParameterException(String(filePath) + ' does not exist or is not a file');\n }\n\n fs.mkdirSync(dirPath, {recursive: true});\n if (!this.isDir(dirPath)) {\n throw new BadParameterException(String(dirPath) + ' does not exist or is not a directory');\n }\n\n return fs.renameSync(filePath, dirPath + path.basename(filePath));\n }\n\n public async read(filePath: string): Promise<string> {\n if (!this.isFile(filePath)) {\n throw new BadParameterException(String(filePath) + ' does not exist or is not a file');\n }\n\n return fs.readFileSync(filePath, 'utf8');\n }\n\n public async readJson(jsonPath: string): Promise<any> {\n const data: any = await this.read(jsonPath);\n if (!this.isJson(data)) {\n throw new BadParameterException(String(jsonPath) + ' does not contain JSON');\n }\n\n return JSON.parse(data);\n }\n\n public async readJsonFiles(dirPath: string): Promise<{name: string, data: any}[]> {\n if (!this.isDir(dirPath)) {\n throw new BadParameterException(String(dirPath) + ' does not exist or is not a directory');\n }\n\n const separator: string = dirPath.endsWith('/') ? '' : '/';\n const files: string[] = fs.readdirSync(dirPath);\n\n const output: {name: string, data: any}[] = [];\n await asyncForEach(files, async (fileName: string) => {\n if (this.isFile(dirPath + separator + fileName) && fileName.endsWith('.json')) {\n output.push({\n name: fileName,\n data: await this.readJson(dirPath + separator + fileName)\n });\n }\n });\n\n return output;\n }\n\n public async write(filePath: string, rawData: any): Promise<void> {\n let data: string = '';\n if (typeof rawData === 'string') {\n data = String(rawData);\n } else if (typeof rawData === 'number') {\n data = String(rawData);\n } else {\n data = JSON.stringify(rawData);\n }\n\n fs.mkdirSync(this.dirPath(filePath), {recursive: true});\n\n fs.writeFileSync(filePath, data, {encoding: 'utf8'});\n\n return Promise.resolve();\n }\n\n public async writeJson(jsonPath: string, data: any): Promise<void> {\n return this.write(jsonPath, JSON.stringify(data));\n }\n\n private isDir(dirPath: string): boolean {\n return fs.existsSync(dirPath) && fs.statSync(dirPath).isDirectory();\n }\n\n private isFile(filePath: string): boolean {\n return fs.existsSync(filePath) && fs.statSync(filePath).isFile();\n }\n\n private isJson(data: any): boolean {\n try {\n JSON.parse(data);\n\n return true;\n } catch (_error) {\n return false;\n }\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"clean-css\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"html-minifier-terser\");","import {MinifierEngineContract} from 'common/templating/MinifierEngineContract';\nimport CleanCSS from 'clean-css';\nimport {minify as minifyHtml} from 'html-minifier-terser';\n\nexport class MinifierEngine implements MinifierEngineContract {\n public async css(content: string): Promise<string> {\n const minifier: CleanCSS.MinifierOutput = new CleanCSS({\n compatibility: 'ie7',\n format: false,\n level: 1,\n sourceMap: false\n });\n const result: CleanCSS.Output = minifier.minify(content);\n\n return result.styles;\n }\n\n public async html(content: string): Promise<string> {\n return await minifyHtml(content, {\n collapseBooleanAttributes: true,\n collapseInlineTagWhitespace: true,\n collapseWhitespace: true,\n continueOnParseError: false,\n decodeEntities: false,\n html5: true,\n minifyCSS: true,\n minifyJS: true,\n noNewlinesBeforeTagClose: true,\n preserveLineBreaks: false,\n preventAttributesEscaping: false,\n processConditionalComments: false,\n quoteCharacter: '\"',\n removeAttributeQuotes: false,\n removeComments: true,\n removeEmptyAttributes: true,\n removeEmptyElements: true,\n removeOptionalTags: false,\n removeRedundantAttributes: true,\n removeScriptTypeAttributes: false,\n removeStyleLinkTypeAttributes: false,\n removeTagWhitespace: false\n });\n }\n}\n","import * as path from 'path';\nimport {parse, render} from 'mustache';\nimport {cloneDeep} from 'lodash';\nimport {TemplateEngineContract} from 'common/templating/TemplateEngineContract';\nimport {FileSystem} from 'common/tool/FileSystem';\nimport {asyncForEach} from 'common/util/PromiseUtil';\nimport {MinifierEngineContract} from 'common/templating/MinifierEngineContract';\nimport {MinifierEngine} from 'common/templating/MinifierEngine';\nimport {ConflictException} from 'common/exception/ConflictException';\n\nexport class TemplateEngine implements TemplateEngineContract {\n private minifier: MinifierEngineContract;\n\n public constructor() {\n this.minifier = new MinifierEngine();\n }\n\n public async render(templatePath: string, data: {[key: string]: any}, baseIncludePath?: string): Promise<string> {\n if (!templatePath.endsWith('.template')) {\n templatePath += '.template';\n }\n const view: {[key: string]: any} = cloneDeep(data);\n const basePath: string = path.isAbsolute(templatePath) ? '' : __dirname + path.sep;\n const fileSystem = new FileSystem();\n const content: string = await fileSystem.read(basePath + templatePath);\n\n const includes: string[] = [];\n const results: any[][] = parse(content);\n results.forEach((result) => {\n if (result.length >= 4 && result[0] === '&' && result[1].startsWith('include:')) {\n includes.push(result[1]);\n }\n });\n\n if (includes.length > 0) {\n if (baseIncludePath === undefined) {\n baseIncludePath = path.dirname(basePath + templatePath) + path.sep;\n } else if (!path.isAbsolute(baseIncludePath)) {\n baseIncludePath = basePath + baseIncludePath;\n }\n await asyncForEach(includes, async (include) => {\n const includeParts: string[] = include.split(':');\n if (includeParts.length === 3 && view[include] !== undefined) {\n const templateName: string = includeParts[2];\n if (baseIncludePath.includes('/html')) {\n Object.keys(view[include]).forEach((key) => {\n view[include][key] = Array.isArray(view[include][key]) ? view[include][key].map((part: string) => part.replace(/(?:\\r\\n|\\r|\\n)/g, '<br>'))\n : view[include][key].replace(/(?:\\r\\n|\\r|\\n)/g, '<br>');\n });\n }\n view[include] = await this.render(path.resolve(baseIncludePath, templateName), view[include]);\n }\n });\n }\n\n const output: string = render(content, view);\n if (output.includes('{{') || output.includes('}}')) {\n throw new ConflictException('template: missing data to render template', {templatePath, data});\n }\n\n return templatePath.includes('html') ? this.minifier.html(output) : output;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"node-mailjet\");","import {EmailSenderServiceContract} from 'common/service/sender/EmailSenderServiceContract';\nimport {TemplateEngine} from 'common/templating/TemplateEngine';\nimport {TemplateEngineContract} from 'common/templating/TemplateEngineContract';\nimport {ViewEmailTrackDeliveryContract} from 'common/templating/view/email/ViewEmailTrackDeliveryContract';\nimport {RecipientContract} from 'common/service/sender/RecipientContract';\nimport {SenderContract} from 'common/service/sender/SenderContract';\nimport {Client} from 'node-mailjet';\nimport {MainException} from 'common/exception/MainException';\nimport {Retry} from 'common/tool/Retry';\nimport {Environment} from 'common/tool/Environment';\nimport {Env} from 'common/tool/Env';\nimport {Logger} from 'common/tool/Logger';\nimport {ViewEmailUserNotificationContract} from 'common/templating/view/email/ViewEmailUserNotificationContract';\nimport {ViewEmailDiscountContract} from 'common/templating/view/email/ViewEmailDiscountContract';\nimport {asyncForEach} from 'common/util/PromiseUtil';\nimport {BadParameterException} from 'common/exception/BadParameterException';\n\nexport class EmailSenderService implements EmailSenderServiceContract {\n private readonly templateEngine: TemplateEngineContract;\n private readonly mailjet: any;\n private readonly mode: Environment;\n\n public constructor(apiPublicKey: string, apiSecretKey: string, mode: Environment) {\n this.templateEngine = new TemplateEngine();\n this.mailjet = new Client({apiKey: apiPublicKey, apiSecret: apiSecretKey});\n this.mode = mode;\n }\n\n public async sendDeliveryDelay(sender: SenderContract, recipient: RecipientContract, data: ViewEmailTrackDeliveryContract): Promise<void> {\n return await Retry.request(async () => {\n if (data.base.copyright === undefined) {\n data.base.copyright = {\n year: String((new Date()).getUTCFullYear())\n };\n }\n const text: string = await this.templateEngine.render('data/email/template/deliveryDelay', data, 'data/email/element/text');\n const html: string = await this.templateEngine.render('data/email/template/deliveryDelay', data, 'data/email/element/html');\n\n return await this.sendNotification(sender, [{recipient: recipient, subject: data.base.subject, text: text, html: html}], false);\n }, 0, Logger.error.bind(Logger));\n }\n\n public async sendTrackDelivery(sender: SenderContract, recipient: RecipientContract, data: ViewEmailTrackDeliveryContract): Promise<void> {\n return await Retry.request(async () => {\n const textContent: string = await this.templateEngine.render('data/email/template/trackDelivery', data, 'data/email/element/text');\n const text: string = await this.templateEngine.render('data/email/element/text/index', {content: textContent, base: data.base});\n const htmlContent: string = await this.templateEngine.render('data/email/template/trackDelivery', data, 'data/email/element/html');\n const html: string = await this.templateEngine.render('data/email/element/html/index', {content: htmlContent, base: data.base});\n\n return await this.sendNotification(sender, [{recipient: recipient, subject: data.base.subject, text: text, html: html}], false);\n }, 0, Logger.error.bind(Logger));\n }\n\n public async sendUserNotification(sender: SenderContract, recipient: RecipientContract, data: ViewEmailUserNotificationContract, isCommercial: boolean = true, customId?: string): Promise<void> {\n return await Retry.request(async () => {\n const textContent: string = await this.templateEngine.render('data/email/template/userNotification', data, 'data/email/element/text');\n const text: string = await this.templateEngine.render('data/email/element/text/index', {content: textContent, base: data.base, isCommercial: isCommercial});\n const htmlContent: string = await this.templateEngine.render('data/email/template/userNotification', data, 'data/email/element/html');\n const html: string = await this.templateEngine.render('data/email/element/html/index', {content: htmlContent, base: data.base, isCommercial: isCommercial});\n\n return await this.sendNotification(sender, [{recipient: recipient, subject: data.base.subject, text: text, html: html}], isCommercial, customId);\n }, 0, Logger.error.bind(Logger));\n }\n\n public async sendUsersNotifications(sender: SenderContract, messages: {recipient: RecipientContract, data: ViewEmailUserNotificationContract}[],\n isCommercial?: boolean, customId?: string): Promise<void> {\n return await Retry.request(async () => {\n const contents: {recipient: RecipientContract, subject: string, text: string, html: string}[] = [];\n await asyncForEach(messages, async (message) => {\n const textContent: string = await this.templateEngine.render('data/email/template/userNotification', message.data, 'data/email/element/text');\n const text: string = await this.templateEngine.render('data/email/element/text/index', {content: textContent, base: message.data.base, isCommercial: isCommercial});\n const htmlContent: string = await this.templateEngine.render('data/email/template/userNotification', message.data, 'data/email/element/html');\n const html: string = await this.templateEngine.render('data/email/element/html/index', {content: htmlContent, base: message.data.base, isCommercial: isCommercial});\n contents.push({recipient: message.recipient, subject: message.data.base.subject, text: text, html: html});\n });\n\n return await this.sendNotification(sender, contents, isCommercial, customId);\n }, 0, Logger.error.bind(Logger));\n }\n\n public async sendDiscount(sender: SenderContract, recipient: RecipientContract, data: ViewEmailDiscountContract, isCommercial: boolean = true, customId?: string): Promise<void> {\n return await Retry.request(async () => {\n const textContent: string = await this.templateEngine.render('data/email/template/discount', data, 'data/email/element/text');\n const text: string = await this.templateEngine.render('data/email/element/text/index', {content: textContent, base: data.base, isCommercial: isCommercial});\n const htmlContent: string = await this.templateEngine.render('data/email/template/discount', data, 'data/email/element/html');\n const html: string = await this.templateEngine.render('data/email/element/html/index', {content: htmlContent, base: data.base, isCommercial: isCommercial});\n\n return await this.sendNotification(sender, [{recipient: recipient, subject: data.base.subject, text: text, html: html}], isCommercial, customId);\n }, 0, Logger.error.bind(Logger));\n }\n\n public async sendDiscounts(sender: SenderContract, messages: {recipient: RecipientContract, data: ViewEmailDiscountContract}[], isCommercial: boolean = true, customId?: string): Promise<void> {\n return await Retry.request(async () => {\n const contents: {recipient: RecipientContract, subject: string, text: string, html: string}[] = [];\n await asyncForEach(messages, async (message) => {\n const textContent: string = await this.templateEngine.render('data/email/template/discount', message.data, 'data/email/element/text');\n const text: string = await this.templateEngine.render('data/email/element/text/index', {content: textContent, base: message.data.base, isCommercial: isCommercial});\n const htmlContent: string = await this.templateEngine.render('data/email/template/discount', message.data, 'data/email/element/html');\n const html: string = await this.templateEngine.render('data/email/element/html/index', {content: htmlContent, base: message.data.base, isCommercial: isCommercial});\n contents.push({recipient: message.recipient, subject: message.data.base.subject, text: text, html: html});\n });\n\n return await this.sendNotification(sender, contents, isCommercial, customId);\n }, 0, Logger.error.bind(Logger));\n }\n\n // private async sendCampaign(sender: SenderContract, recipients: RecipientContract[], subject: string, text: string, html: string): Promise<void> {\n // try {\n // await this.mailjet.post('send').request({\n // FromEmail: sender.contact,\n // FromName: sender.name,\n // Subject: subject,\n // 'Text-part': text,\n // 'Html-part': html,\n // Recipients: [\n // recipients.map((recipient) => {\n // return { Name: recipient.name, Email: recipient.contact };\n // }),\n // ],\n // });\n //\n // return Promise.resolve();\n // } catch (error) {\n // return Promise.reject(new MainException(error.message, Number(error.statusCode)));\n // }\n // }\n\n private async sendNotification(sender: SenderContract, contents: {recipient: RecipientContract, subject: string, text: string, html: string}[],\n isCommercial: boolean = false, customId?: string): Promise<void> {\n if (contents.length === 0) {\n throw new BadParameterException('email: missing messages');\n }\n\n try {\n if (this.mode === Env.TEST) {\n Logger.info('Simulation Mode: Email has been sent', {sender: sender, recipients: contents.map((content) => content.recipient)});\n } else {\n const messages: {From:{Name: string,Email: string},To:[{Name: string,Email: string}], Subject: string, TextPart: string, HTMLPart: string, Priority:0 | 1 | 2, customID: string}[] = [];\n await asyncForEach(contents, async (content) => {\n if (this.mode === Env.DEVELOPMENT) {\n content.recipient.contact = 'developer@onylab.com';\n }\n messages.push({\n 'From': {\n 'Name': sender.name,\n 'Email': sender.contact\n },\n 'To': [{\n 'Name': content.recipient.name,\n 'Email': content.recipient.contact\n }],\n 'Subject': content.subject,\n 'TextPart': content.text,\n 'HTMLPart': content.html,\n 'Priority': isCommercial ? 0 : 2,\n 'customID': customId === undefined ? undefined : String(customId)\n });\n });\n await this.mailjet.post('send', {'version': 'v3.1'}).request({ Messages: messages });\n }\n } catch (error) {\n throw new MainException(error.message, Number(error.statusCode));\n }\n }\n}\n","import {ConfigurationContract} from 'common/tool/ConfigurationContract';\nimport {FileSystemContract} from 'common/tool/FileSystemContract';\nimport {FileSystem} from 'common/tool/FileSystem';\nimport {Env} from 'common/tool/Env';\nimport {merge} from 'lodash';\nimport {Environment} from 'common/tool/Environment';\n\nexport class Configuration implements ConfigurationContract {\n private static config: any;\n private static root: string;\n private static environment: Env;\n private readonly filesystem: FileSystemContract;\n\n public constructor(root: string, environment?: Env) {\n this.filesystem = new FileSystem();\n if (Configuration.root === undefined || Configuration.root !== root) {\n Configuration.root = root;\n Configuration.config = undefined;\n }\n const currentEnvironment: string = (environment === undefined ? Environment.getMode() : environment);\n if (Configuration.environment === undefined || Configuration.environment !== currentEnvironment) {\n Configuration.environment = environment === undefined ? Environment.getMode() : environment;\n Configuration.config = undefined;\n }\n }\n\n public async full(): Promise<any> {\n await this.init();\n\n return Configuration.config;\n }\n\n private async init(): Promise<void> {\n if (Configuration.config === undefined) {\n if (Configuration.root === undefined) {\n Configuration.config = {};\n } else {\n Configuration.config = await this.filesystem.readJson(Configuration.root + 'data/config.json');\n if ([Env.DEVELOPMENT, Env.TEST].includes(Configuration.environment)) {\n try {\n Configuration.config = merge(Configuration.config, await this.filesystem.readJson(Configuration.root + 'data/config_' + String(Configuration.environment) + '.json'));\n } catch (_e) {\n // nothing\n }\n }\n\n }\n }\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"typeorm\");","import {Connection, createConnection} from 'typeorm';\nimport {DatabaseContract} from 'common/tool/DatabaseContract';\nimport {FileSystem} from 'common/tool/FileSystem';\nimport {FileSystemContract} from 'common/tool/FileSystemContract';\nimport {BadParameterException} from 'common/exception/BadParameterException';\nimport {Logger} from 'common/tool/Logger';\n\n// TypeORM documation, types: https://github.com/typeorm/typeorm/blob/master/src/driver/types/ColumnTypes.ts\nexport class Database implements DatabaseContract {\n private root: string;\n private db: any;\n private connection: Connection;\n\n public constructor(root: string) {\n this.root = root;\n }\n\n public async connect(name: string, entities: any[]): Promise<void> {\n if (this.db === undefined) {\n await this.init();\n }\n\n const con: any = this.db[name];\n if (con !== undefined) {\n con.entities = entities;\n con.logging = ['error'];\n con.logger = true;\n con.bigNumberStrings = false;\n if (con.timezone === undefined) {\n con.timezone = 'Z';\n }\n if (con.charset === undefined) {\n con.charset = 'UTF8_GENERAL_CI';\n }\n this.connection = await createConnection(con);\n } else {\n Logger.error(new BadParameterException('bad connection name'));\n }\n }\n\n public async synchronize(): Promise<void> {\n if (this.connection !== undefined) {\n await this.connection.synchronize();\n }\n }\n\n public async close(): Promise<void> {\n return this.connection.close();\n }\n\n private async init(): Promise<void> {\n if (this.root === undefined) {\n this.db = {};\n } else {\n const fileSystem: FileSystemContract = new FileSystem();\n this.db = await fileSystem.readJson(this.root + 'data/db.json');\n }\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"prettyjson\");","import * as prettyjson from 'prettyjson';\nimport {DisplayerContract} from 'common/tool/DisplayerContract';\nimport {Logger} from 'common/tool/Logger';\n\nexport class Displayer implements DisplayerContract {\n public error(error: Error): void {\n Logger.error(error);\n }\n\n public info(message: string): void {\n Logger.trace(message);\n }\n\n public json(json: any): void {\n Logger.trace(prettyjson.render(json, {}));\n }\n\n public success(message: string): void {\n Logger.trace(message);\n }\n}\n","import {DownloaderContract} from 'common/tool/DownloaderContract';\nimport * as path from 'path';\nimport * as fs from 'fs';\nimport * as crypto from 'crypto';\nimport axios from 'axios';\nimport {FileSystemContract} from 'common/tool/FileSystemContract';\nimport {FileSystem} from 'common/tool/FileSystem';\n\nexport class Downloader implements DownloaderContract {\n private readonly fileSystem: FileSystemContract;\n\n public constructor() {\n this.fileSystem = new FileSystem();\n }\n\n public async image(url: string, outputPath: string, outputName?: string): Promise<string> {\n if (outputName === undefined) {\n outputName = crypto.randomBytes(20).toString('hex') + path.extname(url);\n }\n await this.fileSystem.write(outputPath + path.sep + outputName, '');\n\n const output: string = path.resolve(outputPath + path.sep + outputName);\n const writer: any = fs.createWriteStream(output);\n\n const response: any = await axios({\n url,\n method: 'GET',\n responseType: 'stream'\n });\n\n response.data.pipe(writer);\n\n return new Promise((resolve, reject) => {\n writer.on('finish', () => resolve(output));\n writer.on('error', reject);\n });\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"fast-diff\");","/* eslint-disable no-bitwise */\nimport {deburr, toLower, trim} from 'lodash';\nimport {isNullOrUndefined} from 'common/util/HelperUtil';\n\nexport class StringUtil {\n // alternative https://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex\n public static escapeRegExp(str: string): string {\n if (typeof str !== 'string') {\n return str;\n }\n\n return str.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&'); // and .replace(/-/g, '\\\\x2d');\n }\n\n public static hash(str: string, seed: number = 0): string {\n let h1 = 0xdeadbeef ^ seed;\n let h2 = 0x41c6ce57 ^ seed;\n for(let i = 0, ch; i < str.length; i++) {\n ch = str.charCodeAt(i);\n h1 = Math.imul(h1 ^ ch, 2654435761);\n h2 = Math.imul(h2 ^ ch, 1597334677);\n }\n h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507);\n h1 ^= Math.imul(h2 ^ (h2 >>> 13), 3266489909);\n h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507);\n h2 ^= Math.imul(h1 ^ (h1 >>> 13), 3266489909);\n\n return (h2>>>0).toString(16).padStart(8, '0') + (h1>>>0).toString(16).padStart(8, '0');\n }\n\n public static nullable(str: string): string {\n if (isNullOrUndefined(str)) {\n return null;\n }\n\n if (typeof str === 'string' && str.length === 0) {\n return null;\n }\n\n return str;\n }\n\n public static removeMultiSpaces(data: string) {\n if (typeof data !== 'string') {\n return data;\n }\n\n return data.replace(/\\s{2,}/g, ' ');\n }\n\n public static removeText(data: string, text: string) {\n if (typeof data !== 'string' || typeof text !== 'string' || text.length === 0) {\n return data;\n }\n\n try {\n data = data.replace(new RegExp(StringUtil.escapeRegExp(text), 'ig'), '');\n data = data.replace(new RegExp(StringUtil.escapeRegExp(text).replace(new RegExp('\\\\s', 'g'), '-'), 'ig'), '');\n } catch (_e) {\n // ignore\n }\n\n return data;\n }\n\n public static replace(str: string, targets: string[], replacers: string[]): string {\n if (typeof str !== 'string') {\n return str;\n }\n\n if (targets.length !== replacers.length) {\n return str;\n }\n\n let output: string = str;\n targets.forEach((target, index) => {\n output = output.replace(new RegExp(StringUtil.escapeRegExp(target), 'ig'), replacers[index]);\n });\n\n return output;\n }\n\n public static slugify(raw: string, separator: string = ''): string {\n if (raw === undefined) {\n return '';\n }\n\n return toLower(trim(deburr(raw)).replace(/[^0-9a-z\\-\\_]/gi, separator));\n }\n\n public static truncate(str: string, limit: number): string {\n if (isNullOrUndefined(str) || str.length <= limit) {\n return str;\n }\n\n if (limit <= 3) {\n return '';\n }\n\n return str.slice(0, limit - 3) + '...';\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"emoji-regex\");","import {StringUtil} from 'common/util/StringUtil';\nimport emojiRegex from 'emoji-regex';\n\nexport class FormatterUtil {\n public static trim(raw: string): string {\n return typeof raw === 'string' ? raw.trim() : raw;\n }\n\n public static capitalize(raw: string): string {\n const lowraw: string = FormatterUtil.lower(raw);\n\n return typeof lowraw === 'string' ? lowraw.split(' ').map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(' ') : raw;\n }\n\n public static ucfirst(raw: string): string {\n const lowraw: string = FormatterUtil.lower(raw);\n\n return typeof lowraw === 'string' ? lowraw.charAt(0).toUpperCase() + lowraw.slice(1) : raw;\n }\n\n public static lower(raw: string): string {\n return typeof raw === 'string' ? raw.toLocaleLowerCase() : raw;\n }\n\n public static upper(raw: string): string {\n return typeof raw === 'string' ? raw.toLocaleUpperCase() : raw;\n }\n\n public static phone(raw: string, locale: string, output: 'nat' | 'int' = 'int'): string {\n if (typeof raw === 'string') {\n raw = FormatterUtil.preformatPhone(raw, locale);\n switch (output) {\n case 'nat': // national\n return FormatterUtil.phoneNat(raw, locale);\n case 'int': // international\n return FormatterUtil.phoneInt(raw, locale);\n }\n }\n\n return raw;\n }\n\n public static stripEmoji(raw: string): string {\n let output: string = raw;\n\n if (typeof output === 'string') {\n let match;\n while ((match = emojiRegex().exec(output)) !== null) {\n try {\n // output = output.replace(new RegExp('\\\\s' + StringUtil.escapeRegExp(match[0]), 'g'), '');\n // output = output.replace(new RegExp(StringUtil.escapeRegExp(match[0]) + '\\\\s', 'g'), '');\n output = output.replace(new RegExp(StringUtil.escapeRegExp(match[0]), 'g'), '');\n output = output.replace(new RegExp('\\\\s+', 'g'), ' ');\n output = output.trim();\n } catch (_e) {\n // ignore\n }\n }\n }\n\n return output;\n }\n\n public static stripExoticCharacters(raw: string): string {\n if (typeof raw === 'string') {\n return raw.replace('’', '\\'').replace(/[\\u0250-\\ue007]+/g, '*');\n }\n\n return raw;\n }\n\n private static preformatPhone(raw: string, locale: string): string {\n raw = raw.trim().replace(/\\s?\\.?\\-?\\(?\\)?/g, '');\n switch (locale) {\n case 'fr':\n if ((new RegExp('^[1-9]')).test(raw) && raw.length === 9) {\n return '0' + raw;\n }\n break;\n }\n\n return raw;\n }\n\n private static phoneNat(raw: string, locale: string): string {\n switch (locale) {\n case 'fr': // format: 06 11 22 33 44\n if (raw.startsWith('+330')) {\n raw = raw.substring(3);\n } else if (raw.startsWith('+33')) {\n raw = '0' + raw.substring(3);\n } else if (raw.startsWith('0033')) {\n raw = '0' + raw.substring(4);\n } else if (raw.startsWith('33') && raw.length === 11) {\n raw = '0' + raw.substring(2);\n }\n\n if (raw.length === 10) {\n let i: number = 0;\n raw = raw.split('').map((num) => {\n i++;\n\n return num + (i % 2 === 0 ? ' ' : '');\n }).join('').trim();\n }\n\n return raw;\n }\n\n return raw;\n }\n\n private static phoneInt(raw: string, locale: string): string {\n if (raw.startsWith('+')) {\n return raw;\n }\n\n switch (locale) {\n case 'fr': // format: +33611223344\n if (raw.startsWith('0')) {\n raw = raw.substring(1);\n }\n\n return '+33' + raw;\n }\n\n return raw;\n }\n}\n","/* eslint-disable max-lines */\nimport {trim} from 'lodash';\nimport {isNullOrUndefined} from 'common/util/HelperUtil';\nimport {ValidatorUtil} from 'common/util/ValidatorUtil';\nimport diff from 'fast-diff';\nimport {StringUtil} from 'common/util/StringUtil';\nimport {FormatterUtil} from 'common/util/FormatterUtil';\n\nexport class AddressUtil {\n private static readonly ZIPCODE_CITY: { [zipCode: string]: string[] } = {\n '78500': ['Sartrouville'], '78600': ['Maisons-Laffitte', 'Le Mesnil-le-Roi'], '78800': ['Houilles'], '95240': ['Cormeilles-en-Parisis'], '95530': ['La Frette-sur-Seine'],\n '78100': ['Saint-Germain-en-Laye'], '95100': ['Argenteuil'],\n '78630': ['Orgeval', 'Morainvilliers'], '78670': ['Villennes-sur-Seine', 'Medan'], '78240': ['Chambourcy', 'Aigremont'], '78300': ['Poissy'], '78510': ['Triel-sur-Seine'],\n '78570': ['Andrésy', 'Chanteloup-les-Vignes'], '78700': ['Conflans-Sainte-Honorine'], '78480': ['Verneuil-sur-Seine'], '78750': ['Mareil-Marly'], '78620': ['L\\'Étang-la-Ville'],\n '78160': ['Marly-le-Roi'], '78580': ['Les Alluets-le-Roi'],\n '78955': ['Carrières-sous-Poissy'], '78260': ['Achères'], '78540': ['Vernouillet'], '78920': ['Ecquevilly'],\n '95150': ['Taverny'], '95250': ['Beauchamp'], '95480': ['Pierrelaye'], '95320': ['Saint-Leu-la-Forêt'], '95550': ['Bessancourt'], '95370': ['Montigny-lès-Cormeilles'], '95220': ['Herblay'],\n '95740': ['Frépillon'], '95540': ['Méry-sur-Oise'],\n '95870': ['Bezons'], '78420': ['Carrières-sur-Seine'], '78400': ['Chatou'], '78110': ['Le Vésinet'], '78360': ['Montesson'], '78290': ['Croissy-sur-Seine', 'Croissy'], '78230': ['Le Pecq'],\n '95600': ['Eaubonne']\n };\n private static readonly REGIONS: string[] = ['île-de-france'];\n private static readonly COUNTRIES: string[] = ['France', 'FR'];\n private static readonly STREET_TYPE: { short: string, long: string }[] = [\n {short: 'av', long: 'avenue'},\n {short: 'rue', long: 'rue'},\n {short: 'bd', long: 'boulevard'},\n {short: 'chau', long: 'chaussée'},\n {short: 'trav', long: 'traverse'},\n {short: 'pl', long: 'place'},\n {short: 'pass', long: 'passage'},\n {short: 'sent', long: 'sentier'},\n {short: 'imp', long: 'impasse'},\n {short: 'all', long: 'allée'},\n {short: 'chem', long: 'chemin'},\n {short: 'ham', long: 'hameau'},\n {short: 'dom', long: 'domaine'}\n ];\n\n public static autoCorrectCity(city: string): string {\n if (isNullOrUndefined(city) || typeof city !== 'string' || city.length === 0) {\n return city;\n }\n\n if (city.toLowerCase().startsWith('st-') || city.toLowerCase().startsWith('st ')) {\n city = 'Saint ' + city.substring(3);\n }\n\n const CITIES: string[] = Object.values(AddressUtil.ZIPCODE_CITY).flat();\n\n const exactMatch: string = CITIES.find((c) => c.toLowerCase() === city.toLowerCase());\n if (exactMatch !== undefined) {\n return exactMatch;\n }\n\n const partialMatch: string = CITIES.find((c) => {\n const result: { add: number, remove: number } = AddressUtil.countDiff(city, c);\n\n return result.add <= 2 && result.remove <= 2;\n });\n if (partialMatch !== undefined) {\n return partialMatch;\n }\n\n const matchNoDash: string = CITIES.find((c) => c.replace(/-/g, ' ').toLowerCase() === city.toLowerCase());\n if (matchNoDash !== undefined) {\n return matchNoDash;\n }\n\n const partialMatchNoDash: string = CITIES.find((c) => {\n const result: { add: number, remove: number } = AddressUtil.countDiff(city, c.replace(/-/g, ' '));\n\n return result.add <= 2 && result.remove <= 2;\n });\n if (partialMatchNoDash !== undefined) {\n return partialMatchNoDash;\n }\n\n const startsWith: string = CITIES.find((c) => c.toLowerCase().startsWith(city.toLowerCase()));\n if (startsWith !== undefined) {\n return startsWith;\n }\n\n const isIncluded: string = CITIES.find((c) => city.toLowerCase().includes(c.toLowerCase()));\n if (isIncluded !== undefined) {\n return isIncluded;\n }\n\n return city;\n }\n\n public static autoCorrectStreet(street: string): string {\n if (isNullOrUndefined(street) || typeof street !== 'string' || street.length === 0) {\n return street;\n }\n\n AddressUtil.STREET_TYPE.forEach((type) => {\n if (type.short.length < type.long.length) {\n street = street.replace(new RegExp('(\\\\s' + String(type.short) + '\\\\.?\\\\s)', 'ig'), ' ' + String(type.long) + ' ');\n street = street.replace(new RegExp('(\\\\s' + String(type.short) + '\\\\.\\\\s)', 'ig'), ' ' + String(type.long) + ' ');\n }\n });\n // street = street.replace(/(\\sav\\s)/ig, ' avenue ');\n // street = street.replace(/(\\sav\\.\\s)/ig, ' avenue ');\n // street = street.replace(/(\\sbd\\s)/ig, ' boulevard ');\n // street = street.replace(/(\\sbd\\.\\s)/ig, ' boulevard ');\n // street = street.replace(/(\\schau\\.\\s)/ig, ' chaussée ');\n // street = street.replace(/(\\strav\\.\\s)/ig, ' traverse ');\n // street = street.replace(/(\\spl\\.\\s)/ig, ' place ');\n // street = street.replace(/(\\spass\\.\\s)/ig, ' passage ');\n // street = street.replace(/(\\ssent\\.\\s)/ig, ' sentier ');\n // street = street.replace(/(\\simp\\.\\s)/ig, ' impasse ');\n // street = street.replace(/(\\sall\\.\\s)/ig, ' allée ');\n // street = street.replace(/(\\schem\\.\\s)/ig, ' chemin ');\n // street = street.replace(/(\\sham\\.\\s)/ig, ' hameau ');\n // street = street.replace(/(\\sdom\\.\\s)/ig, ' domaine ');\n\n const leadingZeroRegExp: RegExp = new RegExp('^(0+)[0-9]+,?\\\\s[a-zA-Z]+');\n const leadingZeroMatches: string[] = leadingZeroRegExp.exec(street);\n if (leadingZeroMatches !== null && leadingZeroMatches.length === 2) {\n street = street.substring(leadingZeroMatches[1].length);\n }\n\n AddressUtil.STREET_TYPE.forEach((type) => {\n street = street.replace(new RegExp('([0-9]+)(' + String(type.long) + '\\\\s)', 'ig'), '$1 $2');\n street = street.replace(new RegExp('([0-9]+)(' + String(type.short) + '\\\\.?\\\\s)', 'ig'), '$1 ' + String(type.long) + ' ');\n });\n\n return street;\n }\n\n public static getZipCodeFromCity(city: string): string {\n if (isNullOrUndefined(city)) {\n return undefined;\n }\n\n return Object.keys(AddressUtil.ZIPCODE_CITY).reduce((selected, zipcode) => {\n if (AddressUtil.ZIPCODE_CITY[zipcode].find((name) => name.toLowerCase() === city.toLowerCase()) !== undefined) {\n return zipcode;\n }\n\n return selected;\n }, undefined);\n }\n\n public static getCityFromZipCode(zip: string, rawAddress: string): string {\n if (zip === undefined || rawAddress === undefined) {\n return undefined;\n }\n\n const candidates: string[] = AddressUtil.ZIPCODE_CITY[zip];\n if (candidates === undefined) {\n return undefined;\n }\n\n if (candidates.length === 1) {\n return candidates[0];\n }\n\n let city: string;\n rawAddress.split(',').forEach((part) => {\n city = candidates.find((candidate) => {\n return part.trim().toLowerCase() === candidate.trim().toLowerCase();\n });\n });\n if (city !== undefined) {\n return city;\n }\n\n return candidates[0];\n }\n\n public static isZipCode(zip: string): boolean {\n if (typeof zip !== 'string') {\n return false;\n }\n\n if (Object.keys(AddressUtil.ZIPCODE_CITY).includes(zip)) {\n return true;\n }\n\n return ValidatorUtil.isNumber(zip) && zip.length === 5 && !zip.includes('.') && !zip.includes('-');\n }\n\n public static parse(raw: string, isFormatted: boolean = true): { street?: string, zip?: string, city?: string, country?: string } {\n const address: { street?: string, zip?: string, city?: string, country?: string } = {};\n if (!isNullOrUndefined(raw)) {\n const rawAddressParts: string[] = raw.split(',');\n if (rawAddressParts.length >= 3 && isFormatted) {\n if (AddressUtil.COUNTRIES.find((c) => raw.toLowerCase().includes(' ' + c.toLowerCase())) === undefined) {\n rawAddressParts.push('France');\n }\n\n let i: number = rawAddressParts.length - 1;\n address.country = rawAddressParts[i].trim();\n rawAddressParts.splice(i--, 1);\n if (rawAddressParts[i] !== undefined && rawAddressParts[i].trim().includes(' ')) {\n const rawParts: string[] = rawAddressParts[i].trim().split(' ');\n address.zip = rawParts[0] === undefined ? undefined : rawParts[0].trim();\n rawParts.splice(0, 1);\n address.city = rawParts.join(' ').trim();\n rawAddressParts.splice(i--, 1);\n } else if (!isNaN(Number(rawAddressParts[i].trim()))) {\n address.zip = rawAddressParts[i].trim();\n rawAddressParts.splice(i--, 1);\n if (i >= 2) {\n address.city = rawAddressParts[i].trim();\n rawAddressParts.splice(i--, 1);\n }\n } else if (!isNaN(Number(rawAddressParts[i - 1].trim()))) {\n address.city = rawAddressParts[i].trim();\n rawAddressParts.splice(i--, 1);\n address.zip = rawAddressParts[i].trim();\n rawAddressParts.splice(i--, 1);\n } else {\n address.city = rawAddressParts[i].trim();\n rawAddressParts.splice(i--, 1);\n }\n address.street = rawAddressParts.map((part) => part.trim()).join(' ').trim();\n } else {\n let rawAddress: string = raw.toLowerCase();\n Object.keys(AddressUtil.ZIPCODE_CITY).forEach((zipcode) => {\n if (rawAddress.includes(zipcode)) {\n address.zip = zipcode;\n try {\n rawAddress = rawAddress.replace(new RegExp(StringUtil.escapeRegExp(zipcode), 'ig'), '');\n } catch (_e) {\n // ignore\n }\n }\n });\n Object.values(AddressUtil.ZIPCODE_CITY).flat().forEach((city) => {\n if (rawAddress.includes(city.toLowerCase()) && (address.zip === undefined || AddressUtil.ZIPCODE_CITY[address.zip]?.find((c) => c.toLowerCase() === city.toLowerCase()))) {\n address.city = city;\n try {\n rawAddress = rawAddress.replace(new RegExp(StringUtil.escapeRegExp(city), 'ig'), '');\n } catch (_e) {\n // ignore\n }\n }\n });\n AddressUtil.COUNTRIES.forEach((country) => {\n if (rawAddress.includes(' ' + country.toLowerCase()) && !rawAddress.includes('de ' + country.toLowerCase()) && !rawAddress.includes('de la ' + country.toLowerCase())) {\n address.country = country;\n try {\n rawAddress = rawAddress.replace(new RegExp(StringUtil.escapeRegExp(' ' + country), 'ig'), '');\n } catch (_e) {\n // ignore\n }\n }\n });\n\n if (address.street === undefined) {\n address.street = trim(rawAddress.split(',').map((part) => part.trim()).join(' '), '-').trim();\n }\n }\n\n if (address.country === undefined) {\n address.country = 'France';\n }\n }\n\n if (address.street !== undefined) {\n address.street = FormatterUtil.lower(FormatterUtil.trim(String(address.street)));\n }\n if (address.zip !== undefined) {\n address.zip = FormatterUtil.upper(FormatterUtil.trim(String(address.zip)));\n }\n if (address.city !== undefined) {\n address.city = AddressUtil.autoCorrectCity(FormatterUtil.capitalize(FormatterUtil.trim(String(address.city))));\n }\n if (address.country !== undefined) {\n address.country = FormatterUtil.capitalize(FormatterUtil.trim(String(address.country)));\n }\n\n return AddressUtil.complete(address);\n }\n\n public static complete(address: { street?: string, zip?: string, city?: string, country?: string }): { street?: string, zip?: string, city?: string, country?: string } {\n if (address.city === undefined || address.city.length === 0) {\n const city: string = AddressUtil.getCityFromZipCode(address.zip, address.street);\n if (city !== undefined) {\n address.city = city;\n }\n }\n if (typeof address.street === 'string') {\n AddressUtil.REGIONS.forEach((region) => {\n address.street = StringUtil.removeText(address.street, region).trim();\n });\n }\n if (FormatterUtil.lower(address.country) === 'fr') {\n address.country = 'France';\n }\n\n return address;\n }\n\n public static removeDuplicates(str: string): string {\n if (typeof str !== 'string') {\n return str;\n }\n\n const output: string[] = [];\n\n str.split(',').forEach((part) => {\n if (output.find((o) => o.trim().toLowerCase().includes(part.trim().toLowerCase())) === undefined) {\n output.push(part);\n }\n });\n\n return output.join(',');\n }\n\n private static countDiff(str: string, reference: string): { add: number, remove: number } {\n const result: { add: number, remove: number } = {add: 0, remove: 0};\n\n diff(str.toLowerCase(), reference.toLowerCase()).forEach((value) => {\n switch (value[0]) {\n case -1:\n result.remove += value[1].length;\n break;\n case 1:\n result.add += value[1].length;\n break;\n }\n });\n\n return result;\n }\n}\n","import {DateTime} from 'luxon';\nimport {cloneDeep} from 'lodash';\nimport {isNullOrUndefined} from 'common/util/HelperUtil';\n\nexport class DateUtil {\n private static readonly PERIOD_MAX_DATES: number = 90;\n private static readonly WEEK_DAYS: {[id: number]: string} = {1: 'lundi', 2: 'mardi', 3: 'mercredi', 4: 'jeudi', 5: 'vendredi', 6: 'samedi', 7: 'dimanche'};\n\n public static getCycleDateFromFullDate(date: string, cycle: 'daily' | 'weekly' | 'monthly'): string {\n if (cycle === 'weekly') {\n const result: string = DateTime.fromISO(date.replace(/-W([0-9])$/i, '-W0$1')).toISOWeekDate();\n if (result === null) {\n return date;\n }\n\n const parts: string[] = result.split('-');\n\n return parts.length > 2 ? parts[0] + '-' + parts[1] : parts.join('-');\n } else if (cycle === 'monthly') {\n return DateTime.fromISO(date).toFormat('yyyy-LL');\n }\n\n return DateTime.fromISO(date).toISODate();\n }\n\n public static displayWeekDay(weekDay: number): string {\n let displayWeekDay: string = '';\n if (DateUtil.WEEK_DAYS[weekDay] !== undefined) {\n displayWeekDay = DateUtil.WEEK_DAYS[weekDay];\n }\n\n return displayWeekDay;\n }\n\n public static generatePeriod(fromDate: string, toDate: string, initialValue: Record<string, any>, addDate: boolean = true, MAX_DAYS: number = DateUtil.PERIOD_MAX_DATES,\n cycle: 'daily' | 'weekly' | 'monthly' = 'daily'): {[date: string]: Record<string, any>} {\n const jump: {[str: string]: number} = {'daily': {day: 1}, 'weekly': {week: 1}, 'monthly': {month: 1}}[cycle];\n let cursor: string = DateTime.fromISO(fromDate, {setZone: true}).toISODate();\n const stop: string = DateTime.fromISO(toDate, {setZone: true}).toISODate();\n let i: number = 0;\n const data: {[date: string]: Record<string, any>} = {};\n while (cursor <= stop && i < MAX_DAYS) {\n const date: string = DateUtil.getCycleDateFromFullDate(cursor, cycle);\n data[date] = cloneDeep(initialValue);\n if (addDate) {\n data[date].date = date;\n }\n cursor = DateTime.fromISO(cursor, {setZone: true}).plus(jump).toISODate();\n i++;\n }\n\n return data;\n }\n\n public static getOpenPeriods(openings: {from: string, to: string}[], closings: {from: string, to: string}[]): {from: string, to: string}[] {\n const results: {from: string, to: string}[] = [];\n\n openings.forEach((opening) => {\n const tmpOpenings: {from: string, to: string}[] = [opening];\n while (tmpOpenings.length > 0) {\n const open: {from: string, to: string} = tmpOpenings[0];\n\n const isOpen: boolean = closings.find((closing) => closing.from <= open.from && open.to <= closing.to) === undefined;\n if (isOpen) {\n const startLater: {from: string, to: string} = closings.find((closing) => closing.from <= open.from && open.from < closing.to && closing.to < open.to);\n if (startLater !== undefined) {\n tmpOpenings.push({from: startLater.to, to: open.to});\n } else {\n const endEarlier: {from: string, to: string} = closings.find((closing) => open.from < closing.from && open.to > closing.from && open.to <= closing.to);\n if (endEarlier !== undefined) {\n tmpOpenings.push({from: open.from, to: endEarlier.from});\n } else {\n const cut: {from: string, to: string} = closings.find((closing) => open.from < closing.from && closing.to < open.to);\n if (cut !== undefined) {\n tmpOpenings.push({from: open.from, to: cut.from});\n tmpOpenings.push({from: cut.to, to: open.to});\n } else {\n results.push(open);\n }\n }\n }\n }\n\n tmpOpenings.shift();\n }\n });\n\n\n return results;\n }\n\n public static limitDate(targetDate: string, baseDate: string, limitInSeconds: number = 0): string {\n if (targetDate === undefined || baseDate === undefined) {\n return undefined;\n }\n\n const target: string = DateTime.fromISO(targetDate, {setZone: true}).toISO();\n const limit: string = DateTime.fromISO(baseDate, {setZone: true}).plus({seconds: limitInSeconds}).toISO();\n\n return target > limit ? limit : target;\n }\n\n public static localeToISO(localeDate: string): string {\n const frFormat1: RegExp = new RegExp('[0-9]{2}/[0-9]{2}/[0-9]{4}');\n const frFormat2: RegExp = new RegExp('[0-9]{2}-[0-9]{2}-[0-9]{4}');\n const isoFormat: RegExp = new RegExp('[0-9]{4}-[0-9]{2}-[0-9]{2}');\n\n let isoDate: string;\n if (frFormat1.test(localeDate)) {\n const parts: string[] = localeDate.split('/');\n isoDate = parts[2] + '-' + parts[1] + '-' + parts[0];\n } else if (frFormat2.test(localeDate)) {\n const parts: string[] = localeDate.split('-');\n isoDate = parts[2] + '-' + parts[1] + '-' + parts[0];\n } else if (isoFormat.test(localeDate)) {\n isoDate = localeDate;\n }\n\n return isoDate;\n }\n\n public static slotToTime(timeSlot: string): string {\n const timeFormat: RegExp = new RegExp('^(\\\\s)?[0-9]{2}:[0-9]{2}(\\\\s)?$');\n const slotFormat: RegExp = new RegExp('^(\\\\s)?[0-9]{2}:[0-9]{2}(\\\\s)?-(\\\\s)?[0-9]{2}:[0-9]{2}(\\\\s)?$');\n\n timeSlot = timeSlot.trim();\n\n let time: string;\n if (timeFormat.test(timeSlot)) {\n time = timeSlot.trim() + ':00';\n } else if (slotFormat.test(timeSlot)) {\n const parts: string[] = timeSlot.split('-');\n time = parts[0].trim() + ':00';\n }\n\n return time;\n }\n\n public static delay(fromDate: string, toDate: string, unit: 'minutes' | 'hours' | 'days' | 'months'): number {\n if (isNullOrUndefined(fromDate) || isNullOrUndefined(toDate)) {\n return 0;\n }\n\n return Math.round(Math.abs(DateTime.fromISO(fromDate, {setZone: true}).toUTC()\n .diff(DateTime.fromISO(toDate, {setZone: true}).toUTC(), [unit])[unit]))\n }\n\n public static round(date: string, roundingInMs: number = 0): string {\n if (typeof date !== 'string') {\n return date;\n }\n\n const dateTime: DateTime = DateTime.fromISO(date, {setZone: true});\n\n return DateTime.fromMillis(Math.round((+dateTime.toMillis()) / roundingInMs) * roundingInMs).setZone(dateTime.zone).toISO();\n }\n\n public static min(dates: string[]): string {\n return dates.reduce((min, date) => {\n if (typeof min !== 'string' || min > date) {\n return date;\n }\n\n return min;\n }, undefined);\n }\n\n public static max(dates: string[]): string {\n return dates.reduce((max, date) => {\n if (max === undefined || max < date) {\n return date;\n }\n\n return max;\n }, undefined);\n }\n}\n","export class ExtractorUtil {\n public static phone(raw: string, locale: 'fr'): string {\n if (typeof raw !== 'string') {\n return undefined;\n }\n\n raw = raw.trim().replace(/\\s?\\.?\\-?\\(?\\)?/g, '');\n switch (locale) {\n case 'fr': {\n const phoneFrRegex: RegExp = new RegExp('(0[6-7][0-9]{8})', 'i');\n const result: string[] = phoneFrRegex.exec(raw);\n if (result !== null && result.length > 0 && result[0] !== null) {\n return result[0];\n }\n }\n }\n\n return undefined;\n }\n}\n","import {MathUtil} from 'common/util/MathUtil';\n\nexport class PriceUtil {\n private static readonly currencies: {[iso: string]: {symbol: string, position: string}} = {\n 'CAD': {symbol: '$', position: 'before'},\n 'EUR': {symbol: '€', position: 'after'},\n 'USD': {symbol: '$', position: 'before'}\n };\n\n public static applyTaxes(priceTaxExcluded: string, taxRates: number[], decimals: number = 2): string {\n let priceTaxIncluded: number = Number(priceTaxExcluded);\n taxRates.forEach((rate) => {\n priceTaxIncluded += Number(priceTaxExcluded) * rate;\n });\n\n return String(MathUtil.round(priceTaxIncluded, decimals));\n }\n\n public static calculateTaxes(priceTaxExcluded: number, taxRates: number[]): number {\n let taxes: number = 0;\n taxRates.forEach((rate) => {\n taxes += priceTaxExcluded * rate;\n });\n\n return MathUtil.round(taxes, 2);\n }\n\n public static displayWithCurrency(price: string, isoCurrency: string): string {\n if (price === undefined || price === null) {\n return price;\n }\n\n const currency: {symbol: string, position: string} = PriceUtil.currencies[isoCurrency];\n\n let newPrice: string = price + ' ' + isoCurrency;\n if (currency !== undefined) {\n switch (currency.position) {\n case 'before':\n newPrice = currency.symbol + price;\n break;\n case 'after':\n newPrice = price + currency.symbol;\n break;\n }\n }\n\n return newPrice;\n }\n\n public static format(price: string, locale: 'fr' | 'us', decimals: number = 2): string {\n if (price === undefined || price === null) {\n return price;\n }\n\n const priceNumber: number = Number(price.replace(/\\,/gi, ''));\n const standardPrice: string = priceNumber.toLocaleString('en-US', {\n style: 'decimal',\n useGrouping: true,\n minimumFractionDigits: decimals,\n maximumFractionDigits: decimals\n });\n\n switch (locale) {\n case 'fr':\n return standardPrice.replace(/\\,/gi, ' ').replace(/\\./gi, ',');\n case 'us':\n return standardPrice;\n }\n }\n\n public static round(price: string, precision: number = 0.10): string {\n const priceInCents: number = Number(price) * 100;\n const precisionInCents: number = precision * 100;\n const rest: number = priceInCents % precisionInCents;\n\n return String(MathUtil.round((priceInCents - rest) + (rest < Math.ceil(precisionInCents / 2) ? 0 : precisionInCents), 2) / 100);\n }\n}\n"],"names":["root","factory","exports","module","define","amd","global","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","require","MainException","Error","message","code","data","super","this","name","captureStackTrace","stack","ExternalApiException","Env","Environment","getMode","process","env","NODE_ENV","DEVELOPMENT","PRODUCTION","TEST","APP_ID","UnauthorizedException","ERROR_CODE","isNullOrUndefined","Logger","init","sentryToken","app","tracesSampleRate","dsn","integrations","levels","nodeProfilingIntegration","environment","maxBreadcrumbs","profilesSampleRate","trace","extra","includes","console","info","JSON","stringify","category","level","debug","log","scope","setExtra","warning","error","response","requestErrorData","warn","Retry","request","retries","logger","operation","factor","minTimeout","maxTimeout","randomize","Promise","resolve","reject","attempt","then","catch","retry","ValidatorUtil","isEmail","email","RegExp","test","isPhone","phone","isIntMobilePhone","caRegex","frRegex","usRegex","isNumber","num","isISODate","str","isNaN","Date","getTime","HubriseAccessLevel","BadParameterException","HubriseAuthResource","HubriseRightAccess","HubriseCountryCode","HubriseCurrencyCode","HubriseLanguageCode","HubriseLocale","HubriseTimezoneId","HubriseEventType","HubriseResourceType","HubriseOrderStatus","HubriseServiceType","HubriseApi","accessToken","authorize","clientId","redirect","accessLevel","rights","profile","appInstanceId","BASE_AUTH_URL","String","encodeURIComponent","LOCATION","ACCOUNT","keys","reduce","results","concat","join","PROFILE","getToken","clientSecret","auth","client_id","client_secret","headers","timeout","TIMEOUT","bind","getUser","hubriseUser","BASE_URL","token","getAccount","access","getLocation","account","hubriseAccount","getLocations","hubriseLocations","hubriseLocationId","hubriseLocation","url","createCustomer","hubriseCustomerListId","hubriseCustomer","createdCustomer","updateCustomer","id","customer","getCustomer","hubriseCustomerId","getCustomers","reference","parameters","URLSearchParams","hubriseCustomers","append","toString","getCustomerLists","hubriseCustomerLists","createOrder","hubriseOrder","createdOrder","getOrder","hubriseOrderId","getOrders","startDate","endDate","limit","hubriseOrders","queryParams","sort","b","created_at","localeCompare","setOrderStatus","status","getCatalog","hubriseCatalogId","catalog","getCatalogs","catalogs","createWebhook","events","ObjectUtil","compact","options","isArray","ouput","forEach","length","isObject","push","removeEmptyString","update","source","target","assign","HubriseCatalogConverter","editableItems","Array","products","withRef","withName","categories","items","p","skus","sku","sku_ref","ref","category_name","category_id","product_name","filter","part","quantity","tax_rate","price","i","editableItemOptions","optionLists","option_lists","editableItemOptionNames","option_list_ids","optionListId","optionList","option","option_list_name","editableItemOptionRefs","itemId","HubriseOrderConverter","serviceType","map","editableItem","editableOption","Number","sku_name","subtotal","customer_notes","MathUtil","sum","values","accumulator","avg","total","round","applyVariation","variation","increase","median","valuesSorted","Math","floor","percentage","decimals","originalValue","newValue","percent","abs","HubrisePriceUtil","prices","defaultCurrency","EUR","priceToAmount","result","amount","amountToPrice","currency","multiply","multiplier","parts","split","slice","toFixed","TotalHubriseCalculator","calculateTotals","order","findCurrency","item","minimumOrderFee","deliveryFee","totalDiscount","itemOrOptions","c","Path","registerBasePath","basePath","APP_HOME","BASE_PATH","endsWith","db","storage","session","BadRequestException","ConflictException","DuplicateException","InternalException","NotImplementedException","ObjectNotFoundException","PageNotFoundException","HandlerController","_request","json","AuthenticationMiddleware","configuration","handler","next","authenticated","jwt","authApiKey","sessionKeys","required","none","authNone","Authorization","startsWith","secret","urlStartsWith","find","originalUrl","AuthorizationMiddleware","can","_action","_subject","Server","create","origins","port","backendPort","DEFAULT_PORT","backendLocalUrl","set","disable","use","inflate","reviver","strict","type","verify","urlencoded","origin","credentials","listen","getSessionSecret","sessionCookieName","SALT","digest","ApiMockup","isDone","isActive","pending","pendingMocks","reset","cleanAll","HubriseApiMockup","times","allowUnmocked","filteringPath","path","reply","cloneDeep","post","put","generateRandomId","now","orders","patch","UrlUtil","isUTF8","charset","toLowerCase","urlencode","buf","encode","encodeStr","ch","toUpperCase","SmsSenderService","mode","send","senderName","rawPhones","isCommercial","sendAt","phones","checkPhoneFormat","MESSAGE_MAX_LENGTH","substring","params","emetteur","numero","replace","classe_msg","nbr_msg","ceil","stop","date_envoi","DateTime","fromISO","setZone","toFormat","toISOString","hour","plus","day","BASE_API_URL","trim","asyncForEach","array","callback","wait","time","setTimeout","GeneratorUtil","size","symbolUpperCases","int","color","alpha","alphaHex","rgbToHex","defaultColor","colorList","rgb","hex","min","max","POSITIVE_INFINITY","random","password","symbolLowerCases","FileSystem","dirPath","filePath","lastIndexOf","listFiles","isDir","separator","files","output","fileName","isFile","randomFile","suggestion","filenames","index","move","recursive","read","readJson","jsonPath","isJson","parse","readJsonFiles","write","rawData","encoding","writeJson","isDirectory","_error","MinifierEngine","css","content","compatibility","format","sourceMap","minify","styles","html","collapseBooleanAttributes","collapseInlineTagWhitespace","collapseWhitespace","continueOnParseError","decodeEntities","html5","minifyCSS","minifyJS","noNewlinesBeforeTagClose","preserveLineBreaks","preventAttributesEscaping","processConditionalComments","quoteCharacter","removeAttributeQuotes","removeComments","removeEmptyAttributes","removeEmptyElements","removeOptionalTags","removeRedundantAttributes","removeScriptTypeAttributes","removeStyleLinkTypeAttributes","removeTagWhitespace","TemplateEngine","minifier","render","templatePath","baseIncludePath","view","__dirname","fileSystem","include","includeParts","templateName","EmailSenderService","apiPublicKey","apiSecretKey","templateEngine","mailjet","Client","apiKey","apiSecret","sendDeliveryDelay","sender","recipient","base","copyright","year","getUTCFullYear","text","sendNotification","subject","sendTrackDelivery","textContent","htmlContent","sendUserNotification","customId","sendUsersNotifications","messages","contents","sendDiscount","sendDiscounts","recipients","contact","Messages","statusCode","Configuration","filesystem","config","currentEnvironment","full","merge","_e","Database","connect","entities","con","logging","bigNumberStrings","timezone","connection","createConnection","synchronize","close","Displayer","success","Downloader","image","outputPath","outputName","writer","method","responseType","pipe","on","StringUtil","escapeRegExp","hash","seed","h1","h2","charCodeAt","imul","padStart","nullable","removeMultiSpaces","removeText","targets","replacers","slugify","raw","toLower","deburr","truncate","FormatterUtil","capitalize","lowraw","lower","word","charAt","ucfirst","toLocaleLowerCase","upper","toLocaleUpperCase","locale","preformatPhone","phoneNat","phoneInt","stripEmoji","match","exec","stripExoticCharacters","AddressUtil","autoCorrectCity","city","CITIES","ZIPCODE_CITY","flat","exactMatch","partialMatch","countDiff","add","remove","matchNoDash","partialMatchNoDash","isIncluded","autoCorrectStreet","street","STREET_TYPE","short","long","leadingZeroMatches","getZipCodeFromCity","selected","zipcode","getCityFromZipCode","zip","rawAddress","candidates","candidate","isZipCode","isFormatted","address","rawAddressParts","COUNTRIES","country","splice","rawParts","complete","REGIONS","region","removeDuplicates","DateUtil","getCycleDateFromFullDate","date","cycle","toISOWeekDate","toISODate","displayWeekDay","weekDay","WEEK_DAYS","generatePeriod","fromDate","toDate","initialValue","addDate","MAX_DAYS","PERIOD_MAX_DATES","jump","week","month","cursor","getOpenPeriods","openings","closings","opening","tmpOpenings","open","closing","from","to","startLater","endEarlier","cut","shift","limitDate","targetDate","baseDate","limitInSeconds","toISO","seconds","localeToISO","localeDate","frFormat1","frFormat2","isoFormat","isoDate","slotToTime","timeSlot","timeFormat","slotFormat","delay","unit","toUTC","diff","roundingInMs","dateTime","fromMillis","toMillis","zone","dates","ExtractorUtil","PriceUtil","applyTaxes","priceTaxExcluded","taxRates","priceTaxIncluded","rate","calculateTaxes","taxes","displayWithCurrency","isoCurrency","currencies","newPrice","position","symbol","standardPrice","toLocaleString","style","useGrouping","minimumFractionDigits","maximumFractionDigits","precision","priceInCents","precisionInCents","rest"],"sourceRoot":""}
|