orion-design 0.1.29 → 0.1.31
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Throne/index.js +30 -14
- package/dist/Throne/index.js.map +1 -1
- package/dist/_commonjsHelpers-DWwsNxpa.js +9 -0
- package/dist/_commonjsHelpers-DWwsNxpa.js.map +1 -0
- package/dist/components/Button/index.js +40 -33
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Flex/index.js +122 -89
- package/dist/components/Flex/index.js.map +1 -1
- package/dist/components/Form/Form.js +2 -2
- package/dist/components/Form/Form.js.map +1 -1
- package/dist/components/Form/LovInput/LovInput.js +2 -2
- package/dist/components/Form/LovInput/LovInput.js.map +1 -1
- package/dist/components/Form/LovInput/hooks/useLov.js +5 -5
- package/dist/components/Form/LovInput/hooks/useLov.js.map +1 -1
- package/dist/components/Form/LovInput/index.js +4 -4
- package/dist/components/Form/hooks/FormItemValidateTrigger.js +2 -2
- package/dist/components/Form/hooks/FormItemValidateTrigger.js.map +1 -1
- package/dist/components/Form/hooks/index.js +128 -66
- package/dist/components/Form/hooks/index.js.map +1 -1
- package/dist/components/Form/index.js +836 -656
- package/dist/components/Form/index.js.map +1 -1
- package/dist/components/Form/utils/index.js +30 -18
- package/dist/components/Form/utils/index.js.map +1 -1
- package/dist/components/LovTable/LovPagetable.vue.d.ts +28 -0
- package/dist/components/LovTable/index.d.ts +14 -0
- package/dist/components/LovTable/index.js +179 -105
- package/dist/components/LovTable/index.js.map +1 -1
- package/dist/components/Modal/Modal.d.ts +2 -0
- package/dist/components/Modal/ModalLocator.vue.d.ts +20 -0
- package/dist/components/Modal/index.d.ts +4 -1
- package/dist/components/Modal/index.js +127 -0
- package/dist/components/Modal/index.js.map +1 -0
- package/dist/components/Modal/types.d.ts +18 -0
- package/dist/components/Modal/types.js +7 -0
- package/dist/components/Modal/types.js.map +1 -0
- package/dist/components/Modal/useModal.d.ts +1 -3
- package/dist/components/Modal/useModal.js +5 -4
- package/dist/components/Modal/useModal.js.map +1 -1
- package/dist/components/Pagetable/Pagetable.d.ts +13 -0
- package/dist/components/Pagetable/columns/PagetableColumnButtongroup.d.ts +13 -0
- package/dist/components/Pagetable/columns/PagetableColumnDate.d.ts +13 -0
- package/dist/components/Pagetable/columns/PagetableColumnDiy.d.ts +13 -0
- package/dist/components/Pagetable/columns/PagetableColumnLink.d.ts +13 -0
- package/dist/components/Pagetable/columns/PagetableColumnMultiselect.d.ts +13 -0
- package/dist/components/Pagetable/columns/PagetableColumnNumber.d.ts +13 -0
- package/dist/components/Pagetable/columns/PagetableColumnSingleselect.d.ts +13 -0
- package/dist/components/Pagetable/columns/PagetableColumnString.d.ts +13 -0
- package/dist/components/Pagetable/hooks/useColumns.js +88 -74
- package/dist/components/Pagetable/hooks/useColumns.js.map +1 -1
- package/dist/components/Pagetable/index.d.ts +9 -0
- package/dist/components/Pagetable/index.js +697 -491
- package/dist/components/Pagetable/index.js.map +1 -1
- package/dist/components/Pagetable/utils/index.js +92 -54
- package/dist/components/Pagetable/utils/index.js.map +1 -1
- package/dist/components/Querytable/hooks/useColumns.js +82 -74
- package/dist/components/Querytable/hooks/useColumns.js.map +1 -1
- package/dist/components/Querytable/index.js +579 -469
- package/dist/components/Querytable/index.js.map +1 -1
- package/dist/components/Querytable/utils/index.js +92 -54
- package/dist/components/Querytable/utils/index.js.map +1 -1
- package/dist/components/RichTextEditor/index.js +100 -74
- package/dist/components/RichTextEditor/index.js.map +1 -1
- package/dist/components/Tabs/constants.js +2 -2
- package/dist/components/Tabs/constants.js.map +1 -1
- package/dist/components/Tabs/index.js +603 -358
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Tabs/tab-bar.js +6 -6
- package/dist/components/Tabs/tab-bar.js.map +1 -1
- package/dist/components/Tabs/tab-pane.js +3 -3
- package/dist/components/Tabs/tab-pane.js.map +1 -1
- package/dist/components/_constants/aria.js +2 -2
- package/dist/components/_constants/aria.js.map +1 -1
- package/dist/components/_constants/event.js +6 -4
- package/dist/components/_constants/event.js.map +1 -1
- package/dist/components/_constants/index.js +6 -6
- package/dist/components/_hooks/index.js +7 -7
- package/dist/components/_hooks/use-namespace/index.js +74 -39
- package/dist/components/_hooks/use-namespace/index.js.map +1 -1
- package/dist/components/_hooks/use-ordered-children/index.js +29 -19
- package/dist/components/_hooks/use-ordered-children/index.js.map +1 -1
- package/dist/components/_util/arrays.js +9 -5
- package/dist/components/_util/arrays.js.map +1 -1
- package/dist/components/_util/browser.js +6 -6
- package/dist/components/_util/browser.js.map +1 -1
- package/dist/components/_util/classNames.js +22 -17
- package/dist/components/_util/classNames.js.map +1 -1
- package/dist/components/_util/dom/aria.js +74 -39
- package/dist/components/_util/dom/aria.js.map +1 -1
- package/dist/components/_util/dom/element.js +9 -8
- package/dist/components/_util/dom/element.js.map +1 -1
- package/dist/components/_util/dom/event.js +14 -7
- package/dist/components/_util/dom/event.js.map +1 -1
- package/dist/components/_util/dom/index.js +36 -36
- package/dist/components/_util/dom/position.js +49 -25
- package/dist/components/_util/dom/position.js.map +1 -1
- package/dist/components/_util/dom/scroll.js +103 -61
- package/dist/components/_util/dom/scroll.js.map +1 -1
- package/dist/components/_util/dom/style.js +65 -50
- package/dist/components/_util/dom/style.js.map +1 -1
- package/dist/components/_util/easings.js +8 -4
- package/dist/components/_util/easings.js.map +1 -1
- package/dist/components/_util/error.js +12 -11
- package/dist/components/_util/error.js.map +1 -1
- package/dist/components/_util/functions.js +3 -3
- package/dist/components/_util/i18n.js +2 -2
- package/dist/components/_util/i18n.js.map +1 -1
- package/dist/components/_util/index.js +137 -137
- package/dist/components/_util/isValid.js +4 -2
- package/dist/components/_util/isValid.js.map +1 -1
- package/dist/components/_util/objects.js +18 -14
- package/dist/components/_util/objects.js.map +1 -1
- package/dist/components/_util/props-util/index.js +46 -20
- package/dist/components/_util/props-util/index.js.map +1 -1
- package/dist/components/_util/props-util/initDefaultProps.js +18 -10
- package/dist/components/_util/props-util/initDefaultProps.js.map +1 -1
- package/dist/components/_util/raf.js +5 -4
- package/dist/components/_util/raf.js.map +1 -1
- package/dist/components/_util/rand.js +4 -3
- package/dist/components/_util/rand.js.map +1 -1
- package/dist/components/_util/strings.js +9 -8
- package/dist/components/_util/strings.js.map +1 -1
- package/dist/components/_util/throttleByRaf.js +16 -10
- package/dist/components/_util/throttleByRaf.js.map +1 -1
- package/dist/components/_util/type.js +41 -38
- package/dist/components/_util/type.js.map +1 -1
- package/dist/components/_util/types.js +41 -22
- package/dist/components/_util/types.js.map +1 -1
- package/dist/components/_util/typescript.js +2 -2
- package/dist/components/_util/typescript.js.map +1 -1
- package/dist/components/_util/util.js +85 -43
- package/dist/components/_util/util.js.map +1 -1
- package/dist/components/_util/vue/global-node.js +27 -15
- package/dist/components/_util/vue/global-node.js.map +1 -1
- package/dist/components/_util/vue/icon.js +29 -25
- package/dist/components/_util/vue/icon.js.map +1 -1
- package/dist/components/_util/vue/index.js +41 -41
- package/dist/components/_util/vue/install.js +35 -18
- package/dist/components/_util/vue/install.js.map +1 -1
- package/dist/components/_util/vue/props/index.js +6 -6
- package/dist/components/_util/vue/props/runtime.js +46 -30
- package/dist/components/_util/vue/props/runtime.js.map +1 -1
- package/dist/components/_util/vue/refs.js +12 -6
- package/dist/components/_util/vue/refs.js.map +1 -1
- package/dist/components/_util/vue/size.js +5 -3
- package/dist/components/_util/vue/size.js.map +1 -1
- package/dist/components/_util/vue/validator.js +5 -4
- package/dist/components/_util/vue/validator.js.map +1 -1
- package/dist/components/_util/vue/vnode.js +100 -54
- package/dist/components/_util/vue/vnode.js.map +1 -1
- package/dist/components/_util/vue-types/index.js +231 -220
- package/dist/components/_util/vue-types/index.js.map +1 -1
- package/dist/components/components.js +20 -20
- package/dist/components/index.js +38 -35
- package/dist/components/index.js.map +1 -1
- package/dist/components-8oZ2kpUC.js +27 -0
- package/dist/components-8oZ2kpUC.js.map +1 -0
- package/dist/components-B3d9m_tn.js +27 -0
- package/dist/components-B3d9m_tn.js.map +1 -0
- package/dist/error/OrionError.js +8 -4
- package/dist/error/OrionError.js.map +1 -1
- package/dist/functions-BeMkokbY.js +63 -0
- package/dist/functions-BeMkokbY.js.map +1 -0
- package/dist/index-BOKLZnqH.js +54 -0
- package/dist/index-BOKLZnqH.js.map +1 -0
- package/dist/index-D1m0KTpK.js +69 -0
- package/dist/index-D1m0KTpK.js.map +1 -0
- package/dist/index-DR5ZP7mD.js +160 -0
- package/dist/index-DR5ZP7mD.js.map +1 -0
- package/dist/index-DkwIULcN.js +200 -0
- package/dist/index-DkwIULcN.js.map +1 -0
- package/dist/index.css +797 -1
- package/dist/index.js +36 -36
- package/dist/print/LodopFuncs.js +101 -43
- package/dist/print/LodopFuncs.js.map +1 -1
- package/dist/print/index.js +200 -108
- package/dist/print/index.js.map +1 -1
- package/dist/request/ErrorHandlerChain.js +17 -14
- package/dist/request/ErrorHandlerChain.js.map +1 -1
- package/dist/request/RequestFilterChain.js +16 -13
- package/dist/request/RequestFilterChain.js.map +1 -1
- package/dist/request/ResponseParserChain.js +17 -14
- package/dist/request/ResponseParserChain.js.map +1 -1
- package/dist/request/disivion/DateSerializer.js +47 -22
- package/dist/request/disivion/DateSerializer.js.map +1 -1
- package/dist/request/disivion/DivisionErrorHandler.js +40 -25
- package/dist/request/disivion/DivisionErrorHandler.js.map +1 -1
- package/dist/request/disivion/DivisionResponseParser.js +16 -10
- package/dist/request/disivion/DivisionResponseParser.js.map +1 -1
- package/dist/request/disivion/index.js +305 -201
- package/dist/request/disivion/index.js.map +1 -1
- package/dist/request/error/BizExceptionResponseError.js +11 -5
- package/dist/request/error/BizExceptionResponseError.js.map +1 -1
- package/dist/request/error/ExceptionResponseError.js +11 -5
- package/dist/request/error/ExceptionResponseError.js.map +1 -1
- package/dist/request/error/ResponseError.js +9 -4
- package/dist/request/error/ResponseError.js.map +1 -1
- package/dist/request/error/SessionExceptionResponseError.js +11 -5
- package/dist/request/error/SessionExceptionResponseError.js.map +1 -1
- package/dist/request/index.js +11 -11
- package/dist/utils/DateUtil.js +48 -33
- package/dist/utils/DateUtil.js.map +1 -1
- package/dist/utils/NumberUtil.js +6 -6
- package/dist/utils/NumberUtil.js.map +1 -1
- package/dist/utils/cloneDeep.js +2 -2
- package/dist/utils/delay.js +3 -3
- package/dist/utils/delay.js.map +1 -1
- package/dist/utils/functions.js +3 -3
- package/dist/utils/index.js +12 -12
- package/dist/utils/md5.js +191 -93
- package/dist/utils/md5.js.map +1 -1
- package/dist/utils/uuid.js +35 -25
- package/dist/utils/uuid.js.map +1 -1
- package/dist/version/index.js +2 -2
- package/dist/version/version.d.ts +1 -1
- package/dist/version/version.js +2 -2
- package/dist/version/version.js.map +1 -1
- package/package.json +1 -1
- package/dist/components-J6-qau6Y.js +0 -73
- package/dist/components-J6-qau6Y.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../node_modules/js-base64/base64.mjs","../../../src/request/disivion/index.ts"],"sourcesContent":["/**\n * base64.ts\n *\n * Licensed under the BSD 3-Clause License.\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * References:\n * http://en.wikipedia.org/wiki/Base64\n *\n * @author Dan Kogai (https://github.com/dankogai)\n */\nconst version = '3.7.7';\n/**\n * @deprecated use lowercase `version`.\n */\nconst VERSION = version;\nconst _hasBuffer = typeof Buffer === 'function';\nconst _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;\nconst _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;\nconst b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\nconst b64chs = Array.prototype.slice.call(b64ch);\nconst b64tab = ((a) => {\n let tab = {};\n a.forEach((c, i) => tab[c] = i);\n return tab;\n})(b64chs);\nconst b64re = /^(?:[A-Za-z\\d+\\/]{4})*?(?:[A-Za-z\\d+\\/]{2}(?:==)?|[A-Za-z\\d+\\/]{3}=?)?$/;\nconst _fromCC = String.fromCharCode.bind(String);\nconst _U8Afrom = typeof Uint8Array.from === 'function'\n ? Uint8Array.from.bind(Uint8Array)\n : (it) => new Uint8Array(Array.prototype.slice.call(it, 0));\nconst _mkUriSafe = (src) => src\n .replace(/=/g, '').replace(/[+\\/]/g, (m0) => m0 == '+' ? '-' : '_');\nconst _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\\+\\/]/g, '');\n/**\n * polyfill version of `btoa`\n */\nconst btoaPolyfill = (bin) => {\n // console.log('polyfilled');\n let u32, c0, c1, c2, asc = '';\n const pad = bin.length % 3;\n for (let i = 0; i < bin.length;) {\n if ((c0 = bin.charCodeAt(i++)) > 255 ||\n (c1 = bin.charCodeAt(i++)) > 255 ||\n (c2 = bin.charCodeAt(i++)) > 255)\n throw new TypeError('invalid character found');\n u32 = (c0 << 16) | (c1 << 8) | c2;\n asc += b64chs[u32 >> 18 & 63]\n + b64chs[u32 >> 12 & 63]\n + b64chs[u32 >> 6 & 63]\n + b64chs[u32 & 63];\n }\n return pad ? asc.slice(0, pad - 3) + \"===\".substring(pad) : asc;\n};\n/**\n * does what `window.btoa` of web browsers do.\n * @param {String} bin binary string\n * @returns {string} Base64-encoded string\n */\nconst _btoa = typeof btoa === 'function' ? (bin) => btoa(bin)\n : _hasBuffer ? (bin) => Buffer.from(bin, 'binary').toString('base64')\n : btoaPolyfill;\nconst _fromUint8Array = _hasBuffer\n ? (u8a) => Buffer.from(u8a).toString('base64')\n : (u8a) => {\n // cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326\n const maxargs = 0x1000;\n let strs = [];\n for (let i = 0, l = u8a.length; i < l; i += maxargs) {\n strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));\n }\n return _btoa(strs.join(''));\n };\n/**\n * converts a Uint8Array to a Base64 string.\n * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5\n * @returns {string} Base64 string\n */\nconst fromUint8Array = (u8a, urlsafe = false) => urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const utob = (src: string) => unescape(encodeURIComponent(src));\n// reverting good old fationed regexp\nconst cb_utob = (c) => {\n if (c.length < 2) {\n var cc = c.charCodeAt(0);\n return cc < 0x80 ? c\n : cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))\n + _fromCC(0x80 | (cc & 0x3f)))\n : (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n else {\n var cc = 0x10000\n + (c.charCodeAt(0) - 0xD800) * 0x400\n + (c.charCodeAt(1) - 0xDC00);\n return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))\n + _fromCC(0x80 | ((cc >>> 12) & 0x3f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n};\nconst re_utob = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFFF]|[^\\x00-\\x7F]/g;\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-8 string\n * @returns {string} UTF-16 string\n */\nconst utob = (u) => u.replace(re_utob, cb_utob);\n//\nconst _encode = _hasBuffer\n ? (s) => Buffer.from(s, 'utf8').toString('base64')\n : _TE\n ? (s) => _fromUint8Array(_TE.encode(s))\n : (s) => _btoa(utob(s));\n/**\n * converts a UTF-8-encoded string to a Base64 string.\n * @param {boolean} [urlsafe] if `true` make the result URL-safe\n * @returns {string} Base64 string\n */\nconst encode = (src, urlsafe = false) => urlsafe\n ? _mkUriSafe(_encode(src))\n : _encode(src);\n/**\n * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.\n * @returns {string} Base64 string\n */\nconst encodeURI = (src) => encode(src, true);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const btou = (src: string) => decodeURIComponent(escape(src));\n// reverting good old fationed regexp\nconst re_btou = /[\\xC0-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF]{2}|[\\xF0-\\xF7][\\x80-\\xBF]{3}/g;\nconst cb_btou = (cccc) => {\n switch (cccc.length) {\n case 4:\n var cp = ((0x07 & cccc.charCodeAt(0)) << 18)\n | ((0x3f & cccc.charCodeAt(1)) << 12)\n | ((0x3f & cccc.charCodeAt(2)) << 6)\n | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;\n return (_fromCC((offset >>> 10) + 0xD800)\n + _fromCC((offset & 0x3FF) + 0xDC00));\n case 3:\n return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)\n | ((0x3f & cccc.charCodeAt(1)) << 6)\n | (0x3f & cccc.charCodeAt(2)));\n default:\n return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)\n | (0x3f & cccc.charCodeAt(1)));\n }\n};\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-16 string\n * @returns {string} UTF-8 string\n */\nconst btou = (b) => b.replace(re_btou, cb_btou);\n/**\n * polyfill version of `atob`\n */\nconst atobPolyfill = (asc) => {\n // console.log('polyfilled');\n asc = asc.replace(/\\s+/g, '');\n if (!b64re.test(asc))\n throw new TypeError('malformed base64.');\n asc += '=='.slice(2 - (asc.length & 3));\n let u24, bin = '', r1, r2;\n for (let i = 0; i < asc.length;) {\n u24 = b64tab[asc.charAt(i++)] << 18\n | b64tab[asc.charAt(i++)] << 12\n | (r1 = b64tab[asc.charAt(i++)]) << 6\n | (r2 = b64tab[asc.charAt(i++)]);\n bin += r1 === 64 ? _fromCC(u24 >> 16 & 255)\n : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255)\n : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);\n }\n return bin;\n};\n/**\n * does what `window.atob` of web browsers do.\n * @param {String} asc Base64-encoded string\n * @returns {string} binary string\n */\nconst _atob = typeof atob === 'function' ? (asc) => atob(_tidyB64(asc))\n : _hasBuffer ? (asc) => Buffer.from(asc, 'base64').toString('binary')\n : atobPolyfill;\n//\nconst _toUint8Array = _hasBuffer\n ? (a) => _U8Afrom(Buffer.from(a, 'base64'))\n : (a) => _U8Afrom(_atob(a).split('').map(c => c.charCodeAt(0)));\n/**\n * converts a Base64 string to a Uint8Array.\n */\nconst toUint8Array = (a) => _toUint8Array(_unURI(a));\n//\nconst _decode = _hasBuffer\n ? (a) => Buffer.from(a, 'base64').toString('utf8')\n : _TD\n ? (a) => _TD.decode(_toUint8Array(a))\n : (a) => btou(_atob(a));\nconst _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == '-' ? '+' : '/'));\n/**\n * converts a Base64 string to a UTF-8 string.\n * @param {String} src Base64 string. Both normal and URL-safe are supported\n * @returns {string} UTF-8 string\n */\nconst decode = (src) => _decode(_unURI(src));\n/**\n * check if a value is a valid Base64 string\n * @param {String} src a value to check\n */\nconst isValid = (src) => {\n if (typeof src !== 'string')\n return false;\n const s = src.replace(/\\s+/g, '').replace(/={0,2}$/, '');\n return !/[^\\s0-9a-zA-Z\\+/]/.test(s) || !/[^\\s0-9a-zA-Z\\-_]/.test(s);\n};\n//\nconst _noEnum = (v) => {\n return {\n value: v, enumerable: false, writable: true, configurable: true\n };\n};\n/**\n * extend String.prototype with relevant methods\n */\nconst extendString = function () {\n const _add = (name, body) => Object.defineProperty(String.prototype, name, _noEnum(body));\n _add('fromBase64', function () { return decode(this); });\n _add('toBase64', function (urlsafe) { return encode(this, urlsafe); });\n _add('toBase64URI', function () { return encode(this, true); });\n _add('toBase64URL', function () { return encode(this, true); });\n _add('toUint8Array', function () { return toUint8Array(this); });\n};\n/**\n * extend Uint8Array.prototype with relevant methods\n */\nconst extendUint8Array = function () {\n const _add = (name, body) => Object.defineProperty(Uint8Array.prototype, name, _noEnum(body));\n _add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });\n _add('toBase64URI', function () { return fromUint8Array(this, true); });\n _add('toBase64URL', function () { return fromUint8Array(this, true); });\n};\n/**\n * extend Builtin prototypes with relevant methods\n */\nconst extendBuiltins = () => {\n extendString();\n extendUint8Array();\n};\nconst gBase64 = {\n version: version,\n VERSION: VERSION,\n atob: _atob,\n atobPolyfill: atobPolyfill,\n btoa: _btoa,\n btoaPolyfill: btoaPolyfill,\n fromBase64: decode,\n toBase64: encode,\n encode: encode,\n encodeURI: encodeURI,\n encodeURL: encodeURI,\n utob: utob,\n btou: btou,\n decode: decode,\n isValid: isValid,\n fromUint8Array: fromUint8Array,\n toUint8Array: toUint8Array,\n extendString: extendString,\n extendUint8Array: extendUint8Array,\n extendBuiltins: extendBuiltins\n};\n// makecjs:CUT //\nexport { version };\nexport { VERSION };\nexport { _atob as atob };\nexport { atobPolyfill };\nexport { _btoa as btoa };\nexport { btoaPolyfill };\nexport { decode as fromBase64 };\nexport { encode as toBase64 };\nexport { utob };\nexport { encode };\nexport { encodeURI };\nexport { encodeURI as encodeURL };\nexport { btou };\nexport { decode };\nexport { isValid };\nexport { fromUint8Array };\nexport { toUint8Array };\nexport { extendString };\nexport { extendUint8Array };\nexport { extendBuiltins };\n// and finally,\nexport { gBase64 as Base64 };\n","import axios from 'axios'\r\nimport { Base64 } from 'js-base64'\r\nimport { cloneDeep } from '../../utils'\r\nimport ResponseParserChain, { type ResponseParser } from '../ResponseParserChain'\r\nimport ErrorHandlerChain, { type ErrorHandler } from '../ErrorHandlerChain'\r\nimport RequestFilterChain, { type RequestFilter } from '../RequestFilterChain'\r\nimport DateSerializer from './DateSerializer'\r\nimport DivisionResponseParser from './DivisionResponseParser'\r\nimport DivisionErrorHandler from './DivisionErrorHandler'\r\nimport { ElLoading } from 'element-plus'\r\n\r\nimport ResponseError from '../error/ResponseError'\r\n\r\nexport type RequestParams = Record<string, unknown>\r\n\r\nexport interface RequestOptionsI {\r\n loading?: boolean\r\n mask?: boolean\r\n timeout?: number\r\n}\r\n\r\n//////////////////////////////////// Chain\r\nlet gRequestHeaders: () => Record<string, string | null> = () => ({})\r\nlet gResponseParsers: ResponseParser[] = [new DivisionResponseParser()]\r\nlet gErrorHandlers: ErrorHandler[] = [new DivisionErrorHandler()]\r\nlet gRequestFilters: RequestFilter[] = [\r\n {\r\n doFilter: (request, chain) => {\r\n const headers = gRequestHeaders()\r\n Object.keys(headers).forEach(function (key) {\r\n request.headers![key] = headers[key]\r\n })\r\n chain.doFilter(request, chain)\r\n },\r\n },\r\n {\r\n doFilter: (request) => {\r\n new DateSerializer('YYYYMMDDHHmmss').serialize(request.data)\r\n },\r\n },\r\n]\r\n\r\n//////////////////////////////////// GLOBAL VARS\r\n\r\nlet BASE_URL = '/'\r\nlet REQUEST_TIMEOUT = 1000 * 30\r\nconst LOADING_DELAY = 1500\r\n\r\n//////////////////////////////////// AXIOS\r\n\r\nconst g_AxiosInstance = axios.create()\r\ng_AxiosInstance.interceptors.request.use(function (config) {\r\n const chain = new RequestFilterChain(gRequestFilters)\r\n chain.doFilter(config, chain)\r\n return config\r\n})\r\ng_AxiosInstance.interceptors.response.use(function (response) {\r\n try {\r\n const chain = new ResponseParserChain(gResponseParsers)\r\n return chain.doParse(response, chain)\r\n } catch (e) {\r\n throw new ResponseError((e as Error).message, { cause: e }, response)\r\n }\r\n})\r\n\r\nexport function request<T>(\r\n url: string,\r\n data: RequestParams | FormData = {},\r\n options: RequestOptionsI = { loading: true, mask: false, timeout: REQUEST_TIMEOUT }\r\n): Promise<T> {\r\n let newData = data\r\n if (!(data instanceof FormData)) {\r\n newData = cloneDeep(data)\r\n }\r\n\r\n // loading\r\n let loading: any\r\n\r\n if (options.loading === true) {\r\n loading = ElLoading.service({ fullscreen: true, background: 'transparent' })\r\n }\r\n\r\n return g_AxiosInstance\r\n .request({\r\n baseURL: BASE_URL,\r\n method: 'POST',\r\n timeout: REQUEST_TIMEOUT,\r\n withCredentials: true,\r\n url,\r\n data: newData,\r\n responseType: 'json',\r\n ...options,\r\n })\r\n .then((data) => {\r\n if (loading) {\r\n loading.close()\r\n }\r\n\r\n return data\r\n })\r\n .catch(function (error) {\r\n if (loading) {\r\n loading.close()\r\n }\r\n\r\n const chain = new ErrorHandlerChain(gErrorHandlers)\r\n return chain.handle(error, chain)\r\n }) as Promise<T>\r\n}\r\n\r\nexport function download(url: string, data: RequestParams = {}, options: RequestOptionsI = { loading: true, mask: false, timeout: REQUEST_TIMEOUT }) {\r\n let loading: any\r\n\r\n if (options.loading === true) {\r\n loading = ElLoading.service({ fullscreen: true, background: 'transparent' })\r\n }\r\n\r\n return g_AxiosInstance\r\n .request({\r\n baseURL: BASE_URL,\r\n method: 'POST',\r\n timeout: REQUEST_TIMEOUT,\r\n withCredentials: true,\r\n url,\r\n data,\r\n responseType: 'blob',\r\n ...options,\r\n })\r\n .then((data) => {\r\n if (loading) {\r\n loading.close()\r\n }\r\n\r\n return data\r\n })\r\n .then((response) => {\r\n const contentDisposition = response.headers['content-disposition']\r\n const blob = response.data\r\n\r\n const base64FileName = contentDisposition.match(/attachment; filename=\\\"(.*?)\\\"/)[1]\r\n const decodedFileName = Base64.decode(base64FileName)\r\n // for IE\r\n //@ts-ignore\r\n if (window.navigator && window.navigator.msSaveOrOpenBlob) {\r\n //@ts-ignore\r\n window.navigator.msSaveOrOpenBlob(blob, decodedFileName)\r\n } else {\r\n const a = document.createElement('a')\r\n const url = URL.createObjectURL(blob)\r\n a.href = url\r\n a.download = decodedFileName\r\n document.body.appendChild(a)\r\n a.click()\r\n document.body.removeChild(a)\r\n URL.revokeObjectURL(url)\r\n }\r\n })\r\n .catch(function (error) {\r\n if (loading) {\r\n loading.close()\r\n }\r\n\r\n const chain = new ErrorHandlerChain(gErrorHandlers)\r\n return chain.handle(error, chain)\r\n })\r\n}\r\n\r\nexport function upload(url: string, params: RequestParams, options: RequestOptionsI) {\r\n const formdata = new FormData()\r\n if (params) {\r\n const keys = Object.keys(params)\r\n const normalParams: Record<string, unknown> = {}\r\n\r\n for (let i = 0; i < keys.length; i++) {\r\n const key = keys[i]\r\n const itemValue = params[key]\r\n if (itemValue instanceof File) {\r\n formdata.append(key, itemValue)\r\n } else if (itemValue instanceof Array) {\r\n let isFile = false\r\n for (let j = 0; j < itemValue.length; j++) {\r\n if (itemValue[j] instanceof File) {\r\n isFile = true\r\n break\r\n }\r\n }\r\n if (isFile) {\r\n for (let j = 0; j < itemValue.length; j++) {\r\n formdata.append(key, itemValue[j])\r\n }\r\n } else {\r\n // formdata.append(key, JSON.stringify(itemValue));\r\n normalParams[key] = itemValue\r\n }\r\n } else {\r\n // formdata.append(key, itemValue);\r\n normalParams[key] = itemValue\r\n }\r\n }\r\n formdata.append('ibayJson', JSON.stringify(normalParams))\r\n }\r\n\r\n return request(url, formdata, options)\r\n}\r\n\r\n// config\r\nexport const config = {\r\n setBaseUrl: (pBaseUrl: string) => {\r\n if (!pBaseUrl) {\r\n throw new Error(`pBaseUrl is null!`)\r\n }\r\n BASE_URL = pBaseUrl\r\n },\r\n setRequestTimeout: (pTimeout: number) => {\r\n REQUEST_TIMEOUT = pTimeout\r\n },\r\n setRequestHeaders: (pRequestHeaders: () => Record<string, string | null>) => {\r\n if (!pRequestHeaders) {\r\n throw new Error(`pRequestHeaders is null!`)\r\n }\r\n\r\n if (!(pRequestHeaders instanceof Function)) {\r\n throw new Error(`pRequestHeaders is not a function!`)\r\n }\r\n\r\n gRequestHeaders = pRequestHeaders\r\n },\r\n setRequestFilters: (...filters: RequestFilter[]) => {\r\n if (filters == null) {\r\n throw new Error(`filters is null!`)\r\n }\r\n gRequestFilters = filters\r\n },\r\n setResponseParsers: (...parsers: ResponseParser[]) => {\r\n if (parsers == null) {\r\n throw new Error(`parsers is null!`)\r\n }\r\n gResponseParsers = parsers\r\n },\r\n setErrorHandlers: (...handlers: ErrorHandler[]) => {\r\n if (handlers == null) {\r\n throw new Error(`handlers should not null!`)\r\n }\r\n gErrorHandlers = handlers\r\n },\r\n}\r\n"],"names":["version","VERSION","_hasBuffer","_TD","_TE","b64ch","b64chs","b64tab","a","tab","c","i","b64re","_fromCC","_U8Afrom","it","_mkUriSafe","src","m0","_tidyB64","s","btoaPolyfill","bin","u32","c0","c1","c2","asc","pad","_btoa","_fromUint8Array","u8a","strs","l","fromUint8Array","urlsafe","cb_utob","cc","re_utob","utob","u","_encode","encode","encodeURI","re_btou","cb_btou","cccc","cp","offset","btou","b","atobPolyfill","u24","r1","r2","_atob","_toUint8Array","toUint8Array","_unURI","_decode","decode","isValid","_noEnum","v","extendString","_add","name","body","extendUint8Array","extendBuiltins","gBase64","gRequestHeaders","gResponseParsers","DivisionResponseParser","gErrorHandlers","DivisionErrorHandler","gRequestFilters","request","chain","headers","key","DateSerializer","BASE_URL","REQUEST_TIMEOUT","g_AxiosInstance","axios","config","RequestFilterChain","response","ResponseParserChain","e","ResponseError","url","data","options","newData","cloneDeep","loading","ElLoading","error","ErrorHandlerChain","download","contentDisposition","blob","base64FileName","decodedFileName","Base64","upload","params","formdata","keys","normalParams","itemValue","isFile","j","pBaseUrl","pTimeout","pRequestHeaders","filters","parsers","handlers"],"mappings":";;;;;;;;;;;;;AAWA,MAAMA,IAAU,SAIVC,KAAUD,GACVE,IAAa,OAAO,UAAW,YAC/BC,IAAM,OAAO,eAAgB,aAAa,IAAI,YAAW,IAAK,QAC9DC,IAAM,OAAO,eAAgB,aAAa,IAAI,YAAW,IAAK,QAC9DC,KAAQ,qEACRC,IAAS,MAAM,UAAU,MAAM,KAAKD,EAAK,GACzCE,KAAU,CAACC,MAAM;AACnB,MAAIC,IAAM,CAAA;AACV,SAAAD,EAAE,QAAQ,CAACE,GAAGC,MAAMF,EAAIC,CAAC,IAAIC,CAAC,GACvBF;AACX,GAAGH,CAAM,GACHM,KAAQ,2EACRC,IAAU,OAAO,aAAa,KAAK,MAAM,GACzCC,IAAW,OAAO,WAAW,QAAS,aACtC,WAAW,KAAK,KAAK,UAAU,IAC/B,CAACC,MAAO,IAAI,WAAW,MAAM,UAAU,MAAM,KAAKA,GAAI,CAAC,CAAC,GACxDC,IAAa,CAACC,MAAQA,EACvB,QAAQ,MAAM,EAAE,EAAE,QAAQ,UAAU,CAACC,MAAOA,KAAM,MAAM,MAAM,GAAG,GAChEC,IAAW,CAACC,MAAMA,EAA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AACG,YAAA,IAAI,MAAM,0BAA0B;AAGxC,QAAA,EAAEA,aAA2B;AACzB,YAAA,IAAI,MAAM,oCAAoC;AAGpC,IAAA9C,IAAA8C;AAAA,EACpB;AAAA,EACA,mBAAmB,IAAIC,MAA6B;AAClD,QAAIA,KAAW;AACP,YAAA,IAAI,MAAM,kBAAkB;AAElB,IAAA1C,IAAA0C;AAAA,EACpB;AAAA,EACA,oBAAoB,IAAIC,MAA8B;AACpD,QAAIA,KAAW;AACP,YAAA,IAAI,MAAM,kBAAkB;AAEjB,IAAA/C,IAAA+C;AAAA,EACrB;AAAA,EACA,kBAAkB,IAAIC,MAA6B;AACjD,QAAIA,KAAY;AACR,YAAA,IAAI,MAAM,2BAA2B;AAE5B,IAAA9C,IAAA8C;AAAA,EACnB;AACF;","x_google_ignoreList":[0]}
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../node_modules/js-base64/base64.mjs","../../../src/request/disivion/index.ts"],"sourcesContent":["/**\n * base64.ts\n *\n * Licensed under the BSD 3-Clause License.\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * References:\n * http://en.wikipedia.org/wiki/Base64\n *\n * @author Dan Kogai (https://github.com/dankogai)\n */\nconst version = '3.7.7';\n/**\n * @deprecated use lowercase `version`.\n */\nconst VERSION = version;\nconst _hasBuffer = typeof Buffer === 'function';\nconst _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;\nconst _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;\nconst b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\nconst b64chs = Array.prototype.slice.call(b64ch);\nconst b64tab = ((a) => {\n let tab = {};\n a.forEach((c, i) => tab[c] = i);\n return tab;\n})(b64chs);\nconst b64re = /^(?:[A-Za-z\\d+\\/]{4})*?(?:[A-Za-z\\d+\\/]{2}(?:==)?|[A-Za-z\\d+\\/]{3}=?)?$/;\nconst _fromCC = String.fromCharCode.bind(String);\nconst _U8Afrom = typeof Uint8Array.from === 'function'\n ? Uint8Array.from.bind(Uint8Array)\n : (it) => new Uint8Array(Array.prototype.slice.call(it, 0));\nconst _mkUriSafe = (src) => src\n .replace(/=/g, '').replace(/[+\\/]/g, (m0) => m0 == '+' ? '-' : '_');\nconst _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\\+\\/]/g, '');\n/**\n * polyfill version of `btoa`\n */\nconst btoaPolyfill = (bin) => {\n // console.log('polyfilled');\n let u32, c0, c1, c2, asc = '';\n const pad = bin.length % 3;\n for (let i = 0; i < bin.length;) {\n if ((c0 = bin.charCodeAt(i++)) > 255 ||\n (c1 = bin.charCodeAt(i++)) > 255 ||\n (c2 = bin.charCodeAt(i++)) > 255)\n throw new TypeError('invalid character found');\n u32 = (c0 << 16) | (c1 << 8) | c2;\n asc += b64chs[u32 >> 18 & 63]\n + b64chs[u32 >> 12 & 63]\n + b64chs[u32 >> 6 & 63]\n + b64chs[u32 & 63];\n }\n return pad ? asc.slice(0, pad - 3) + \"===\".substring(pad) : asc;\n};\n/**\n * does what `window.btoa` of web browsers do.\n * @param {String} bin binary string\n * @returns {string} Base64-encoded string\n */\nconst _btoa = typeof btoa === 'function' ? (bin) => btoa(bin)\n : _hasBuffer ? (bin) => Buffer.from(bin, 'binary').toString('base64')\n : btoaPolyfill;\nconst _fromUint8Array = _hasBuffer\n ? (u8a) => Buffer.from(u8a).toString('base64')\n : (u8a) => {\n // cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326\n const maxargs = 0x1000;\n let strs = [];\n for (let i = 0, l = u8a.length; i < l; i += maxargs) {\n strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));\n }\n return _btoa(strs.join(''));\n };\n/**\n * converts a Uint8Array to a Base64 string.\n * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5\n * @returns {string} Base64 string\n */\nconst fromUint8Array = (u8a, urlsafe = false) => urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const utob = (src: string) => unescape(encodeURIComponent(src));\n// reverting good old fationed regexp\nconst cb_utob = (c) => {\n if (c.length < 2) {\n var cc = c.charCodeAt(0);\n return cc < 0x80 ? c\n : cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))\n + _fromCC(0x80 | (cc & 0x3f)))\n : (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n else {\n var cc = 0x10000\n + (c.charCodeAt(0) - 0xD800) * 0x400\n + (c.charCodeAt(1) - 0xDC00);\n return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))\n + _fromCC(0x80 | ((cc >>> 12) & 0x3f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n};\nconst re_utob = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFFF]|[^\\x00-\\x7F]/g;\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-8 string\n * @returns {string} UTF-16 string\n */\nconst utob = (u) => u.replace(re_utob, cb_utob);\n//\nconst _encode = _hasBuffer\n ? (s) => Buffer.from(s, 'utf8').toString('base64')\n : _TE\n ? (s) => _fromUint8Array(_TE.encode(s))\n : (s) => _btoa(utob(s));\n/**\n * converts a UTF-8-encoded string to a Base64 string.\n * @param {boolean} [urlsafe] if `true` make the result URL-safe\n * @returns {string} Base64 string\n */\nconst encode = (src, urlsafe = false) => urlsafe\n ? _mkUriSafe(_encode(src))\n : _encode(src);\n/**\n * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.\n * @returns {string} Base64 string\n */\nconst encodeURI = (src) => encode(src, true);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const btou = (src: string) => decodeURIComponent(escape(src));\n// reverting good old fationed regexp\nconst re_btou = /[\\xC0-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF]{2}|[\\xF0-\\xF7][\\x80-\\xBF]{3}/g;\nconst cb_btou = (cccc) => {\n switch (cccc.length) {\n case 4:\n var cp = ((0x07 & cccc.charCodeAt(0)) << 18)\n | ((0x3f & cccc.charCodeAt(1)) << 12)\n | ((0x3f & cccc.charCodeAt(2)) << 6)\n | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;\n return (_fromCC((offset >>> 10) + 0xD800)\n + _fromCC((offset & 0x3FF) + 0xDC00));\n case 3:\n return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)\n | ((0x3f & cccc.charCodeAt(1)) << 6)\n | (0x3f & cccc.charCodeAt(2)));\n default:\n return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)\n | (0x3f & cccc.charCodeAt(1)));\n }\n};\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-16 string\n * @returns {string} UTF-8 string\n */\nconst btou = (b) => b.replace(re_btou, cb_btou);\n/**\n * polyfill version of `atob`\n */\nconst atobPolyfill = (asc) => {\n // console.log('polyfilled');\n asc = asc.replace(/\\s+/g, '');\n if (!b64re.test(asc))\n throw new TypeError('malformed base64.');\n asc += '=='.slice(2 - (asc.length & 3));\n let u24, bin = '', r1, r2;\n for (let i = 0; i < asc.length;) {\n u24 = b64tab[asc.charAt(i++)] << 18\n | b64tab[asc.charAt(i++)] << 12\n | (r1 = b64tab[asc.charAt(i++)]) << 6\n | (r2 = b64tab[asc.charAt(i++)]);\n bin += r1 === 64 ? _fromCC(u24 >> 16 & 255)\n : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255)\n : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);\n }\n return bin;\n};\n/**\n * does what `window.atob` of web browsers do.\n * @param {String} asc Base64-encoded string\n * @returns {string} binary string\n */\nconst _atob = typeof atob === 'function' ? (asc) => atob(_tidyB64(asc))\n : _hasBuffer ? (asc) => Buffer.from(asc, 'base64').toString('binary')\n : atobPolyfill;\n//\nconst _toUint8Array = _hasBuffer\n ? (a) => _U8Afrom(Buffer.from(a, 'base64'))\n : (a) => _U8Afrom(_atob(a).split('').map(c => c.charCodeAt(0)));\n/**\n * converts a Base64 string to a Uint8Array.\n */\nconst toUint8Array = (a) => _toUint8Array(_unURI(a));\n//\nconst _decode = _hasBuffer\n ? (a) => Buffer.from(a, 'base64').toString('utf8')\n : _TD\n ? (a) => _TD.decode(_toUint8Array(a))\n : (a) => btou(_atob(a));\nconst _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == '-' ? '+' : '/'));\n/**\n * converts a Base64 string to a UTF-8 string.\n * @param {String} src Base64 string. Both normal and URL-safe are supported\n * @returns {string} UTF-8 string\n */\nconst decode = (src) => _decode(_unURI(src));\n/**\n * check if a value is a valid Base64 string\n * @param {String} src a value to check\n */\nconst isValid = (src) => {\n if (typeof src !== 'string')\n return false;\n const s = src.replace(/\\s+/g, '').replace(/={0,2}$/, '');\n return !/[^\\s0-9a-zA-Z\\+/]/.test(s) || !/[^\\s0-9a-zA-Z\\-_]/.test(s);\n};\n//\nconst _noEnum = (v) => {\n return {\n value: v, enumerable: false, writable: true, configurable: true\n };\n};\n/**\n * extend String.prototype with relevant methods\n */\nconst extendString = function () {\n const _add = (name, body) => Object.defineProperty(String.prototype, name, _noEnum(body));\n _add('fromBase64', function () { return decode(this); });\n _add('toBase64', function (urlsafe) { return encode(this, urlsafe); });\n _add('toBase64URI', function () { return encode(this, true); });\n _add('toBase64URL', function () { return encode(this, true); });\n _add('toUint8Array', function () { return toUint8Array(this); });\n};\n/**\n * extend Uint8Array.prototype with relevant methods\n */\nconst extendUint8Array = function () {\n const _add = (name, body) => Object.defineProperty(Uint8Array.prototype, name, _noEnum(body));\n _add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });\n _add('toBase64URI', function () { return fromUint8Array(this, true); });\n _add('toBase64URL', function () { return fromUint8Array(this, true); });\n};\n/**\n * extend Builtin prototypes with relevant methods\n */\nconst extendBuiltins = () => {\n extendString();\n extendUint8Array();\n};\nconst gBase64 = {\n version: version,\n VERSION: VERSION,\n atob: _atob,\n atobPolyfill: atobPolyfill,\n btoa: _btoa,\n btoaPolyfill: btoaPolyfill,\n fromBase64: decode,\n toBase64: encode,\n encode: encode,\n encodeURI: encodeURI,\n encodeURL: encodeURI,\n utob: utob,\n btou: btou,\n decode: decode,\n isValid: isValid,\n fromUint8Array: fromUint8Array,\n toUint8Array: toUint8Array,\n extendString: extendString,\n extendUint8Array: extendUint8Array,\n extendBuiltins: extendBuiltins\n};\n// makecjs:CUT //\nexport { version };\nexport { VERSION };\nexport { _atob as atob };\nexport { atobPolyfill };\nexport { _btoa as btoa };\nexport { btoaPolyfill };\nexport { decode as fromBase64 };\nexport { encode as toBase64 };\nexport { utob };\nexport { encode };\nexport { encodeURI };\nexport { encodeURI as encodeURL };\nexport { btou };\nexport { decode };\nexport { isValid };\nexport { fromUint8Array };\nexport { toUint8Array };\nexport { extendString };\nexport { extendUint8Array };\nexport { extendBuiltins };\n// and finally,\nexport { gBase64 as Base64 };\n","import axios from 'axios'\r\nimport { Base64 } from 'js-base64'\r\nimport { cloneDeep } from '../../utils'\r\nimport ResponseParserChain, { type ResponseParser } from '../ResponseParserChain'\r\nimport ErrorHandlerChain, { type ErrorHandler } from '../ErrorHandlerChain'\r\nimport RequestFilterChain, { type RequestFilter } from '../RequestFilterChain'\r\nimport DateSerializer from './DateSerializer'\r\nimport DivisionResponseParser from './DivisionResponseParser'\r\nimport DivisionErrorHandler from './DivisionErrorHandler'\r\nimport { ElLoading } from 'element-plus'\r\n\r\nimport ResponseError from '../error/ResponseError'\r\n\r\nexport type RequestParams = Record<string, unknown>\r\n\r\nexport interface RequestOptionsI {\r\n loading?: boolean\r\n mask?: boolean\r\n timeout?: number\r\n}\r\n\r\n//////////////////////////////////// Chain\r\nlet gRequestHeaders: () => Record<string, string | null> = () => ({})\r\nlet gResponseParsers: ResponseParser[] = [new DivisionResponseParser()]\r\nlet gErrorHandlers: ErrorHandler[] = [new DivisionErrorHandler()]\r\nlet gRequestFilters: RequestFilter[] = [\r\n {\r\n doFilter: (request, chain) => {\r\n const headers = gRequestHeaders()\r\n Object.keys(headers).forEach(function (key) {\r\n request.headers![key] = headers[key]\r\n })\r\n chain.doFilter(request, chain)\r\n },\r\n },\r\n {\r\n doFilter: (request) => {\r\n new DateSerializer('YYYYMMDDHHmmss').serialize(request.data)\r\n },\r\n },\r\n]\r\n\r\n//////////////////////////////////// GLOBAL VARS\r\n\r\nlet BASE_URL = '/'\r\nlet REQUEST_TIMEOUT = 1000 * 30\r\nconst LOADING_DELAY = 1500\r\n\r\n//////////////////////////////////// AXIOS\r\n\r\nconst g_AxiosInstance = axios.create()\r\ng_AxiosInstance.interceptors.request.use(function (config) {\r\n const chain = new RequestFilterChain(gRequestFilters)\r\n chain.doFilter(config, chain)\r\n return config\r\n})\r\ng_AxiosInstance.interceptors.response.use(function (response) {\r\n try {\r\n const chain = new ResponseParserChain(gResponseParsers)\r\n return chain.doParse(response, chain)\r\n } catch (e) {\r\n throw new ResponseError((e as Error).message, { cause: e }, response)\r\n }\r\n})\r\n\r\nexport function request<T>(\r\n url: string,\r\n data: RequestParams | FormData = {},\r\n options: RequestOptionsI = { loading: true, mask: false, timeout: REQUEST_TIMEOUT }\r\n): Promise<T> {\r\n let newData = data\r\n if (!(data instanceof FormData)) {\r\n newData = cloneDeep(data)\r\n }\r\n\r\n // loading\r\n let loading: any\r\n\r\n if (options.loading === true) {\r\n loading = ElLoading.service({ fullscreen: true, background: 'transparent' })\r\n }\r\n\r\n return g_AxiosInstance\r\n .request({\r\n baseURL: BASE_URL,\r\n method: 'POST',\r\n timeout: REQUEST_TIMEOUT,\r\n withCredentials: true,\r\n url,\r\n data: newData,\r\n responseType: 'json',\r\n ...options,\r\n })\r\n .then((data) => {\r\n if (loading) {\r\n loading.close()\r\n }\r\n\r\n return data\r\n })\r\n .catch(function (error) {\r\n if (loading) {\r\n loading.close()\r\n }\r\n\r\n const chain = new ErrorHandlerChain(gErrorHandlers)\r\n return chain.handle(error, chain)\r\n }) as Promise<T>\r\n}\r\n\r\nexport function download(url: string, data: RequestParams = {}, options: RequestOptionsI = { loading: true, mask: false, timeout: REQUEST_TIMEOUT }) {\r\n let loading: any\r\n\r\n if (options.loading === true) {\r\n loading = ElLoading.service({ fullscreen: true, background: 'transparent' })\r\n }\r\n\r\n return g_AxiosInstance\r\n .request({\r\n baseURL: BASE_URL,\r\n method: 'POST',\r\n timeout: REQUEST_TIMEOUT,\r\n withCredentials: true,\r\n url,\r\n data,\r\n responseType: 'blob',\r\n ...options,\r\n })\r\n .then((data) => {\r\n if (loading) {\r\n loading.close()\r\n }\r\n\r\n return data\r\n })\r\n .then((response) => {\r\n const contentDisposition = response.headers['content-disposition']\r\n const blob = response.data\r\n\r\n const base64FileName = contentDisposition.match(/attachment; filename=\\\"(.*?)\\\"/)[1]\r\n const decodedFileName = Base64.decode(base64FileName)\r\n // for IE\r\n //@ts-ignore\r\n if (window.navigator && window.navigator.msSaveOrOpenBlob) {\r\n //@ts-ignore\r\n window.navigator.msSaveOrOpenBlob(blob, decodedFileName)\r\n } else {\r\n const a = document.createElement('a')\r\n const url = URL.createObjectURL(blob)\r\n a.href = url\r\n a.download = decodedFileName\r\n document.body.appendChild(a)\r\n a.click()\r\n document.body.removeChild(a)\r\n URL.revokeObjectURL(url)\r\n }\r\n })\r\n .catch(function (error) {\r\n if (loading) {\r\n loading.close()\r\n }\r\n\r\n const chain = new ErrorHandlerChain(gErrorHandlers)\r\n return chain.handle(error, chain)\r\n })\r\n}\r\n\r\nexport function upload(url: string, params: RequestParams, options: RequestOptionsI) {\r\n const formdata = new FormData()\r\n if (params) {\r\n const keys = Object.keys(params)\r\n const normalParams: Record<string, unknown> = {}\r\n\r\n for (let i = 0; i < keys.length; i++) {\r\n const key = keys[i]\r\n const itemValue = params[key]\r\n if (itemValue instanceof File) {\r\n formdata.append(key, itemValue)\r\n } else if (itemValue instanceof Array) {\r\n let isFile = false\r\n for (let j = 0; j < itemValue.length; j++) {\r\n if (itemValue[j] instanceof File) {\r\n isFile = true\r\n break\r\n }\r\n }\r\n if (isFile) {\r\n for (let j = 0; j < itemValue.length; j++) {\r\n formdata.append(key, itemValue[j])\r\n }\r\n } else {\r\n // formdata.append(key, JSON.stringify(itemValue));\r\n normalParams[key] = itemValue\r\n }\r\n } else {\r\n // formdata.append(key, itemValue);\r\n normalParams[key] = itemValue\r\n }\r\n }\r\n formdata.append('ibayJson', JSON.stringify(normalParams))\r\n }\r\n\r\n return request(url, formdata, options)\r\n}\r\n\r\n// config\r\nexport const config = {\r\n setBaseUrl: (pBaseUrl: string) => {\r\n if (!pBaseUrl) {\r\n throw new Error(`pBaseUrl is null!`)\r\n }\r\n BASE_URL = pBaseUrl\r\n },\r\n setRequestTimeout: (pTimeout: number) => {\r\n REQUEST_TIMEOUT = pTimeout\r\n },\r\n setRequestHeaders: (pRequestHeaders: () => Record<string, string | null>) => {\r\n if (!pRequestHeaders) {\r\n throw new Error(`pRequestHeaders is null!`)\r\n }\r\n\r\n if (!(pRequestHeaders instanceof Function)) {\r\n throw new Error(`pRequestHeaders is not a function!`)\r\n }\r\n\r\n gRequestHeaders = pRequestHeaders\r\n },\r\n setRequestFilters: (...filters: RequestFilter[]) => {\r\n if (filters == null) {\r\n throw new Error(`filters is null!`)\r\n }\r\n gRequestFilters = filters\r\n },\r\n setResponseParsers: (...parsers: ResponseParser[]) => {\r\n if (parsers == null) {\r\n throw new Error(`parsers is null!`)\r\n }\r\n gResponseParsers = parsers\r\n },\r\n setErrorHandlers: (...handlers: ErrorHandler[]) => {\r\n if (handlers == null) {\r\n throw new Error(`handlers should not null!`)\r\n }\r\n gErrorHandlers = handlers\r\n },\r\n}\r\n"],"names":["request","config","data","Base64","url"],"mappings":";;;;;;;;;;;;;AAWA,MAAM,UAAU;AAIhB,MAAM,UAAU;AAChB,MAAM,aAAa,OAAO,WAAW;A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AAAA,MAAA,OACK;AAEL,qBAAa,GAAG,IAAI;AAAA,MACtB;AAAA,IACF;AACA,aAAS,OAAO,YAAY,KAAK,UAAU,YAAY,CAAC;AAAA,EAC1D;AAEO,SAAA,QAAQ,KAAK,UAAU,OAAO;AACvC;AAGO,MAAM,SAAS;AAAA,EACpB,YAAY,CAAC,aAAqB;AAChC,QAAI,CAAC,UAAU;AACP,YAAA,IAAI,MAAM,mBAAmB;AAAA,IACrC;AACW,eAAA;AAAA,EACb;AAAA,EACA,mBAAmB,CAAC,aAAqB;AACrB,sBAAA;AAAA,EACpB;AAAA,EACA,mBAAmB,CAAC,oBAAyD;AAC3E,QAAI,CAAC,iBAAiB;AACd,YAAA,IAAI,MAAM,0BAA0B;AAAA,IAC5C;AAEI,QAAA,EAAE,2BAA2B,WAAW;AACpC,YAAA,IAAI,MAAM,oCAAoC;AAAA,IACtD;AAEkB,sBAAA;AAAA,EACpB;AAAA,EACA,mBAAmB,IAAI,YAA6B;AAClD,QAAI,WAAW,MAAM;AACb,YAAA,IAAI,MAAM,kBAAkB;AAAA,IACpC;AACkB,sBAAA;AAAA,EACpB;AAAA,EACA,oBAAoB,IAAI,YAA8B;AACpD,QAAI,WAAW,MAAM;AACb,YAAA,IAAI,MAAM,kBAAkB;AAAA,IACpC;AACmB,uBAAA;AAAA,EACrB;AAAA,EACA,kBAAkB,IAAI,aAA6B;AACjD,QAAI,YAAY,MAAM;AACd,YAAA,IAAI,MAAM,2BAA2B;AAAA,IAC7C;AACiB,qBAAA;AAAA,EACnB;AACF;","x_google_ignoreList":[0]}
|
@@ -1,10 +1,16 @@
|
|
1
|
-
import
|
2
|
-
class
|
3
|
-
constructor(
|
4
|
-
super(
|
1
|
+
import ResponseError from "./ResponseError.js";
|
2
|
+
class BizExceptionResponseError extends ResponseError {
|
3
|
+
constructor(message, cause, response, reponseData) {
|
4
|
+
super(message, cause, response);
|
5
|
+
if (Error.captureStackTrace) {
|
6
|
+
Error.captureStackTrace(this, BizExceptionResponseError);
|
7
|
+
}
|
8
|
+
this.name = "BizExceptionResponseError";
|
9
|
+
this.response = response;
|
10
|
+
this.reponseData = reponseData;
|
5
11
|
}
|
6
12
|
}
|
7
13
|
export {
|
8
|
-
|
14
|
+
BizExceptionResponseError as default
|
9
15
|
};
|
10
16
|
//# sourceMappingURL=BizExceptionResponseError.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"BizExceptionResponseError.js","sources":["../../../src/request/error/BizExceptionResponseError.ts"],"sourcesContent":["import type { AxiosResponse } from 'axios'\r\nimport ResponseError from './ResponseError'\r\nexport default class BizExceptionResponseError extends ResponseError {\r\n declare response: AxiosResponse\r\n declare reponseData: unknown\r\n\r\n constructor(message: string, cause: Error, response: AxiosResponse, reponseData: unknown) {\r\n super(message, cause, response)\r\n\r\n // Maintains proper stack trace for where our error was thrown (only available on V8)\r\n // @ts-ignore\r\n if (Error.captureStackTrace) {\r\n // @ts-ignore\r\n Error.captureStackTrace(this, BizExceptionResponseError)\r\n }\r\n\r\n this.name = 'BizExceptionResponseError'\r\n\r\n // CustomData\r\n this.response = response\r\n this.reponseData = reponseData\r\n }\r\n}\r\n"],"names":[
|
1
|
+
{"version":3,"file":"BizExceptionResponseError.js","sources":["../../../src/request/error/BizExceptionResponseError.ts"],"sourcesContent":["import type { AxiosResponse } from 'axios'\r\nimport ResponseError from './ResponseError'\r\nexport default class BizExceptionResponseError extends ResponseError {\r\n declare response: AxiosResponse\r\n declare reponseData: unknown\r\n\r\n constructor(message: string, cause: Error, response: AxiosResponse, reponseData: unknown) {\r\n super(message, cause, response)\r\n\r\n // Maintains proper stack trace for where our error was thrown (only available on V8)\r\n // @ts-ignore\r\n if (Error.captureStackTrace) {\r\n // @ts-ignore\r\n Error.captureStackTrace(this, BizExceptionResponseError)\r\n }\r\n\r\n this.name = 'BizExceptionResponseError'\r\n\r\n // CustomData\r\n this.response = response\r\n this.reponseData = reponseData\r\n }\r\n}\r\n"],"names":[],"mappings":";AAEA,MAAqB,kCAAkC,cAAc;AAAA,EAInE,YAAY,SAAiB,OAAc,UAAyB,aAAsB;AAClF,UAAA,SAAS,OAAO,QAAQ;AAI9B,QAAI,MAAM,mBAAmB;AAErB,YAAA,kBAAkB,MAAM,yBAAyB;AAAA,IACzD;AAEA,SAAK,OAAO;AAGZ,SAAK,WAAW;AAChB,SAAK,cAAc;AAAA,EACrB;AACF;"}
|
@@ -1,10 +1,16 @@
|
|
1
|
-
import
|
2
|
-
class
|
3
|
-
constructor(
|
4
|
-
super(
|
1
|
+
import ResponseError from "./ResponseError.js";
|
2
|
+
class ExceptionResponseError extends ResponseError {
|
3
|
+
constructor(message, cause, response, reponseData) {
|
4
|
+
super(message, cause, response);
|
5
|
+
if (Error.captureStackTrace) {
|
6
|
+
Error.captureStackTrace(this, ExceptionResponseError);
|
7
|
+
}
|
8
|
+
this.name = "ExceptionResponseError";
|
9
|
+
this.response = response;
|
10
|
+
this.reponseData = reponseData;
|
5
11
|
}
|
6
12
|
}
|
7
13
|
export {
|
8
|
-
|
14
|
+
ExceptionResponseError as default
|
9
15
|
};
|
10
16
|
//# sourceMappingURL=ExceptionResponseError.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ExceptionResponseError.js","sources":["../../../src/request/error/ExceptionResponseError.ts"],"sourcesContent":["import type { AxiosResponse } from 'axios'\r\nimport ResponseError from './ResponseError'\r\nexport default class ExceptionResponseError extends ResponseError {\r\n declare response: AxiosResponse\r\n declare reponseData: unknown\r\n\r\n constructor(message: string, cause: Error, response: AxiosResponse, reponseData: unknown) {\r\n super(message, cause, response)\r\n\r\n // Maintains proper stack trace for where our error was thrown (only available on V8)\r\n // @ts-ignore\r\n if (Error.captureStackTrace) {\r\n // @ts-ignore\r\n Error.captureStackTrace(this, ExceptionResponseError)\r\n }\r\n\r\n this.name = 'ExceptionResponseError'\r\n\r\n // CustomData\r\n this.response = response\r\n this.reponseData = reponseData\r\n }\r\n}\r\n"],"names":[
|
1
|
+
{"version":3,"file":"ExceptionResponseError.js","sources":["../../../src/request/error/ExceptionResponseError.ts"],"sourcesContent":["import type { AxiosResponse } from 'axios'\r\nimport ResponseError from './ResponseError'\r\nexport default class ExceptionResponseError extends ResponseError {\r\n declare response: AxiosResponse\r\n declare reponseData: unknown\r\n\r\n constructor(message: string, cause: Error, response: AxiosResponse, reponseData: unknown) {\r\n super(message, cause, response)\r\n\r\n // Maintains proper stack trace for where our error was thrown (only available on V8)\r\n // @ts-ignore\r\n if (Error.captureStackTrace) {\r\n // @ts-ignore\r\n Error.captureStackTrace(this, ExceptionResponseError)\r\n }\r\n\r\n this.name = 'ExceptionResponseError'\r\n\r\n // CustomData\r\n this.response = response\r\n this.reponseData = reponseData\r\n }\r\n}\r\n"],"names":[],"mappings":";AAEA,MAAqB,+BAA+B,cAAc;AAAA,EAIhE,YAAY,SAAiB,OAAc,UAAyB,aAAsB;AAClF,UAAA,SAAS,OAAO,QAAQ;AAI9B,QAAI,MAAM,mBAAmB;AAErB,YAAA,kBAAkB,MAAM,sBAAsB;AAAA,IACtD;AAEA,SAAK,OAAO;AAGZ,SAAK,WAAW;AAChB,SAAK,cAAc;AAAA,EACrB;AACF;"}
|
@@ -1,9 +1,14 @@
|
|
1
|
-
class
|
2
|
-
constructor(
|
3
|
-
super(
|
1
|
+
class ResponseError extends Error {
|
2
|
+
constructor(message, options, reponse) {
|
3
|
+
super(message, { cause: options.cause });
|
4
|
+
if (Error.captureStackTrace) {
|
5
|
+
Error.captureStackTrace(this, ResponseError);
|
6
|
+
}
|
7
|
+
this.name = "ResponseError";
|
8
|
+
this.response = reponse;
|
4
9
|
}
|
5
10
|
}
|
6
11
|
export {
|
7
|
-
|
12
|
+
ResponseError as default
|
8
13
|
};
|
9
14
|
//# sourceMappingURL=ResponseError.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ResponseError.js","sources":["../../../src/request/error/ResponseError.ts"],"sourcesContent":["import type { AxiosResponse } from 'axios'\r\nexport default class ResponseError extends Error {\r\n declare response: AxiosResponse\r\n\r\n constructor(message: string, options: ErrorOptions, reponse: AxiosResponse) {\r\n super(message, { cause: options.cause })\r\n\r\n // Maintains proper stack trace for where our error was thrown (only available on V8)\r\n // @ts-ignore\r\n if (Error.captureStackTrace) {\r\n // @ts-ignore\r\n Error.captureStackTrace(this, ResponseError)\r\n }\r\n\r\n this.name = 'ResponseError'\r\n\r\n // CustomData\r\n this.response = reponse\r\n }\r\n}\r\n"],"names":[
|
1
|
+
{"version":3,"file":"ResponseError.js","sources":["../../../src/request/error/ResponseError.ts"],"sourcesContent":["import type { AxiosResponse } from 'axios'\r\nexport default class ResponseError extends Error {\r\n declare response: AxiosResponse\r\n\r\n constructor(message: string, options: ErrorOptions, reponse: AxiosResponse) {\r\n super(message, { cause: options.cause })\r\n\r\n // Maintains proper stack trace for where our error was thrown (only available on V8)\r\n // @ts-ignore\r\n if (Error.captureStackTrace) {\r\n // @ts-ignore\r\n Error.captureStackTrace(this, ResponseError)\r\n }\r\n\r\n this.name = 'ResponseError'\r\n\r\n // CustomData\r\n this.response = reponse\r\n }\r\n}\r\n"],"names":[],"mappings":"AACA,MAAqB,sBAAsB,MAAM;AAAA,EAG/C,YAAY,SAAiB,SAAuB,SAAwB;AAC1E,UAAM,SAAS,EAAE,OAAO,QAAQ,MAAO,CAAA;AAIvC,QAAI,MAAM,mBAAmB;AAErB,YAAA,kBAAkB,MAAM,aAAa;AAAA,IAC7C;AAEA,SAAK,OAAO;AAGZ,SAAK,WAAW;AAAA,EAClB;AACF;"}
|
@@ -1,10 +1,16 @@
|
|
1
|
-
import
|
2
|
-
class
|
3
|
-
constructor(
|
4
|
-
super(
|
1
|
+
import ResponseError from "./ResponseError.js";
|
2
|
+
class SessionExceptionResponseError extends ResponseError {
|
3
|
+
constructor(message, cause, response, reponseData) {
|
4
|
+
super(message, cause, response);
|
5
|
+
if (Error.captureStackTrace) {
|
6
|
+
Error.captureStackTrace(this, SessionExceptionResponseError);
|
7
|
+
}
|
8
|
+
this.name = "SessionExceptionResponseError";
|
9
|
+
this.response = response;
|
10
|
+
this.reponseData = reponseData;
|
5
11
|
}
|
6
12
|
}
|
7
13
|
export {
|
8
|
-
|
14
|
+
SessionExceptionResponseError as default
|
9
15
|
};
|
10
16
|
//# sourceMappingURL=SessionExceptionResponseError.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SessionExceptionResponseError.js","sources":["../../../src/request/error/SessionExceptionResponseError.ts"],"sourcesContent":["import type { AxiosResponse } from 'axios'\r\nimport ResponseError from './ResponseError'\r\nexport default class SessionExceptionResponseError extends ResponseError {\r\n declare response: AxiosResponse\r\n declare reponseData: unknown\r\n\r\n constructor(message: string, cause: Error, response: AxiosResponse, reponseData: unknown) {\r\n super(message, cause, response)\r\n\r\n // Maintains proper stack trace for where our error was thrown (only available on V8)\r\n // @ts-ignore\r\n if (Error.captureStackTrace) {\r\n // @ts-ignore\r\n Error.captureStackTrace(this, SessionExceptionResponseError)\r\n }\r\n\r\n this.name = 'SessionExceptionResponseError'\r\n\r\n // CustomData\r\n this.response = response\r\n this.reponseData = reponseData\r\n }\r\n}\r\n"],"names":[
|
1
|
+
{"version":3,"file":"SessionExceptionResponseError.js","sources":["../../../src/request/error/SessionExceptionResponseError.ts"],"sourcesContent":["import type { AxiosResponse } from 'axios'\r\nimport ResponseError from './ResponseError'\r\nexport default class SessionExceptionResponseError extends ResponseError {\r\n declare response: AxiosResponse\r\n declare reponseData: unknown\r\n\r\n constructor(message: string, cause: Error, response: AxiosResponse, reponseData: unknown) {\r\n super(message, cause, response)\r\n\r\n // Maintains proper stack trace for where our error was thrown (only available on V8)\r\n // @ts-ignore\r\n if (Error.captureStackTrace) {\r\n // @ts-ignore\r\n Error.captureStackTrace(this, SessionExceptionResponseError)\r\n }\r\n\r\n this.name = 'SessionExceptionResponseError'\r\n\r\n // CustomData\r\n this.response = response\r\n this.reponseData = reponseData\r\n }\r\n}\r\n"],"names":[],"mappings":";AAEA,MAAqB,sCAAsC,cAAc;AAAA,EAIvE,YAAY,SAAiB,OAAc,UAAyB,aAAsB;AAClF,UAAA,SAAS,OAAO,QAAQ;AAI9B,QAAI,MAAM,mBAAmB;AAErB,YAAA,kBAAkB,MAAM,6BAA6B;AAAA,IAC7D;AAEA,SAAK,OAAO;AAGZ,SAAK,WAAW;AAChB,SAAK,cAAc;AAAA,EACrB;AACF;"}
|
package/dist/request/index.js
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
import { config
|
2
|
-
import { default as
|
3
|
-
import { default as
|
4
|
-
import { default as
|
1
|
+
import { config, download, request, upload } from "./disivion/index.js";
|
2
|
+
import { default as default2 } from "./error/BizExceptionResponseError.js";
|
3
|
+
import { default as default3 } from "./error/SessionExceptionResponseError.js";
|
4
|
+
import { default as default4 } from "./error/ExceptionResponseError.js";
|
5
5
|
export {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
default2 as BizExceptionResponseError,
|
7
|
+
default4 as ExceptionResponseError,
|
8
|
+
default3 as SessionExceptionResponseError,
|
9
|
+
config as divisionConfig,
|
10
|
+
download as divisionDownload,
|
11
|
+
request as divisionRequest,
|
12
|
+
upload as divisionUpload
|
13
13
|
};
|
14
14
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/DateUtil.js
CHANGED
@@ -1,39 +1,54 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
const
|
4
|
-
format(
|
5
|
-
if (
|
6
|
-
const
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
1
|
+
import dayjs from "dayjs";
|
2
|
+
import OrionError from "../error/OrionError.js";
|
3
|
+
const DateUtil = {
|
4
|
+
format(p1, p2, p3) {
|
5
|
+
if (p1 instanceof Date && typeof p2 === "string") {
|
6
|
+
const value = p1;
|
7
|
+
const format = p2;
|
8
|
+
if (!value) {
|
9
|
+
throw new OrionError("value is null.");
|
10
|
+
}
|
11
|
+
if (!format) {
|
12
|
+
throw new OrionError("format is null.");
|
13
|
+
}
|
14
|
+
return dayjs(value).format(format);
|
15
|
+
} else if (typeof p1 === "string" && typeof p2 === "string" && typeof p3 === "string") {
|
16
|
+
const value = p1;
|
17
|
+
const sourceFormat = p2;
|
18
|
+
const targetFormat = p3;
|
19
|
+
if (!value || !sourceFormat || !targetFormat) {
|
20
|
+
throw new OrionError(`Invalid arguments: ${value}, ${sourceFormat}, ${targetFormat}`);
|
21
|
+
}
|
22
|
+
if (dayjs(value, sourceFormat, true).isValid()) {
|
23
|
+
return dayjs(value, sourceFormat).format(targetFormat);
|
24
|
+
} else {
|
25
|
+
throw new OrionError(`日期[${value}]与格式[${sourceFormat}]不匹配。`);
|
26
|
+
}
|
27
|
+
} else {
|
28
|
+
throw new OrionError(`入参数量[${arguments.length}]不正确。`);
|
29
|
+
}
|
21
30
|
},
|
22
|
-
stringToDate(
|
23
|
-
if (!
|
24
|
-
throw new
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
if (typeof
|
30
|
-
throw new
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
stringToDate(value, format) {
|
32
|
+
if (!value) {
|
33
|
+
throw new OrionError("value is null.");
|
34
|
+
}
|
35
|
+
if (!format) {
|
36
|
+
throw new OrionError("format is null.");
|
37
|
+
}
|
38
|
+
if (typeof value !== "string") {
|
39
|
+
throw new OrionError("value is not a string.");
|
40
|
+
}
|
41
|
+
if (typeof format !== "string") {
|
42
|
+
throw new OrionError("format is not a string.");
|
43
|
+
}
|
44
|
+
if (dayjs(value, format, true).isValid()) {
|
45
|
+
return dayjs(value, format).toDate();
|
46
|
+
} else {
|
47
|
+
throw new OrionError(`日期[${value}]与格式[${format}]不匹配。`);
|
48
|
+
}
|
34
49
|
}
|
35
50
|
};
|
36
51
|
export {
|
37
|
-
|
52
|
+
DateUtil as default
|
38
53
|
};
|
39
54
|
//# sourceMappingURL=DateUtil.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DateUtil.js","sources":["../../src/utils/DateUtil.ts"],"sourcesContent":["import dayjs from 'dayjs'\r\n\r\nimport OrionError from '../error/OrionError'\r\n\r\ninterface DateUtilFormat {\r\n format(value: Date, targetFormat: string): string\r\n format(value: string, sourceFormat: string, targetFormat: string): string\r\n}\r\n\r\nexport interface DateUtilI {\r\n format: DateUtilFormat['format']\r\n stringToDate(value: string, format: string): Date\r\n}\r\n\r\nconst DateUtil: DateUtilI = {\r\n format(p1: Date | string, p2: string, p3?: string) {\r\n if (p1 instanceof Date && typeof p2 === 'string') {\r\n const value = p1\r\n const format = p2\r\n\r\n if (!value) {\r\n throw new OrionError('value is null.')\r\n }\r\n\r\n if (!format) {\r\n throw new OrionError('format is null.')\r\n }\r\n\r\n return dayjs(value).format(format)\r\n } else if (typeof p1 === 'string' && typeof p2 === 'string' && typeof p3 === 'string') {\r\n const value = p1\r\n const sourceFormat = p2\r\n const targetFormat = p3\r\n\r\n if (!value || !sourceFormat || !targetFormat) {\r\n throw new OrionError(`Invalid arguments: ${value}, ${sourceFormat}, ${targetFormat}`)\r\n }\r\n\r\n if (dayjs(value, sourceFormat, true).isValid()) {\r\n return dayjs(value, sourceFormat).format(targetFormat)\r\n } else {\r\n throw new OrionError(`日期[${value}]与格式[${sourceFormat}]不匹配。`)\r\n }\r\n } else {\r\n throw new OrionError(`入参数量[${arguments.length}]不正确。`)\r\n }\r\n },\r\n\r\n stringToDate(value: string, format: string): Date {\r\n if (!value) {\r\n throw new OrionError('value is null.')\r\n }\r\n\r\n if (!format) {\r\n throw new OrionError('format is null.')\r\n }\r\n\r\n if (typeof value !== 'string') {\r\n throw new OrionError('value is not a string.')\r\n }\r\n\r\n if (typeof format !== 'string') {\r\n throw new OrionError('format is not a string.')\r\n }\r\n\r\n if (dayjs(value, format, true).isValid()) {\r\n return dayjs(value, format).toDate()\r\n } else {\r\n throw new OrionError(`日期[${value}]与格式[${format}]不匹配。`)\r\n }\r\n },\r\n}\r\n\r\nexport default DateUtil\r\n"],"names":[
|
1
|
+
{"version":3,"file":"DateUtil.js","sources":["../../src/utils/DateUtil.ts"],"sourcesContent":["import dayjs from 'dayjs'\r\n\r\nimport OrionError from '../error/OrionError'\r\n\r\ninterface DateUtilFormat {\r\n format(value: Date, targetFormat: string): string\r\n format(value: string, sourceFormat: string, targetFormat: string): string\r\n}\r\n\r\nexport interface DateUtilI {\r\n format: DateUtilFormat['format']\r\n stringToDate(value: string, format: string): Date\r\n}\r\n\r\nconst DateUtil: DateUtilI = {\r\n format(p1: Date | string, p2: string, p3?: string) {\r\n if (p1 instanceof Date && typeof p2 === 'string') {\r\n const value = p1\r\n const format = p2\r\n\r\n if (!value) {\r\n throw new OrionError('value is null.')\r\n }\r\n\r\n if (!format) {\r\n throw new OrionError('format is null.')\r\n }\r\n\r\n return dayjs(value).format(format)\r\n } else if (typeof p1 === 'string' && typeof p2 === 'string' && typeof p3 === 'string') {\r\n const value = p1\r\n const sourceFormat = p2\r\n const targetFormat = p3\r\n\r\n if (!value || !sourceFormat || !targetFormat) {\r\n throw new OrionError(`Invalid arguments: ${value}, ${sourceFormat}, ${targetFormat}`)\r\n }\r\n\r\n if (dayjs(value, sourceFormat, true).isValid()) {\r\n return dayjs(value, sourceFormat).format(targetFormat)\r\n } else {\r\n throw new OrionError(`日期[${value}]与格式[${sourceFormat}]不匹配。`)\r\n }\r\n } else {\r\n throw new OrionError(`入参数量[${arguments.length}]不正确。`)\r\n }\r\n },\r\n\r\n stringToDate(value: string, format: string): Date {\r\n if (!value) {\r\n throw new OrionError('value is null.')\r\n }\r\n\r\n if (!format) {\r\n throw new OrionError('format is null.')\r\n }\r\n\r\n if (typeof value !== 'string') {\r\n throw new OrionError('value is not a string.')\r\n }\r\n\r\n if (typeof format !== 'string') {\r\n throw new OrionError('format is not a string.')\r\n }\r\n\r\n if (dayjs(value, format, true).isValid()) {\r\n return dayjs(value, format).toDate()\r\n } else {\r\n throw new OrionError(`日期[${value}]与格式[${format}]不匹配。`)\r\n }\r\n },\r\n}\r\n\r\nexport default DateUtil\r\n"],"names":[],"mappings":";;AAcA,MAAM,WAAsB;AAAA,EAC1B,OAAO,IAAmB,IAAY,IAAa;AACjD,QAAI,cAAc,QAAQ,OAAO,OAAO,UAAU;AAChD,YAAM,QAAQ;AACd,YAAM,SAAS;AAEf,UAAI,CAAC,OAAO;AACJ,cAAA,IAAI,WAAW,gBAAgB;AAAA,MACvC;AAEA,UAAI,CAAC,QAAQ;AACL,cAAA,IAAI,WAAW,iBAAiB;AAAA,MACxC;AAEA,aAAO,MAAM,KAAK,EAAE,OAAO,MAAM;AAAA,IAAA,WACxB,OAAO,OAAO,YAAY,OAAO,OAAO,YAAY,OAAO,OAAO,UAAU;AACrF,YAAM,QAAQ;AACd,YAAM,eAAe;AACrB,YAAM,eAAe;AAErB,UAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,cAAc;AACtC,cAAA,IAAI,WAAW,sBAAsB,KAAK,KAAK,YAAY,KAAK,YAAY,EAAE;AAAA,MACtF;AAEA,UAAI,MAAM,OAAO,cAAc,IAAI,EAAE,WAAW;AAC9C,eAAO,MAAM,OAAO,YAAY,EAAE,OAAO,YAAY;AAAA,MAAA,OAChD;AACL,cAAM,IAAI,WAAW,MAAM,KAAK,QAAQ,YAAY,OAAO;AAAA,MAC7D;AAAA,IAAA,OACK;AACL,YAAM,IAAI,WAAW,QAAQ,UAAU,MAAM,OAAO;AAAA,IACtD;AAAA,EACF;AAAA,EAEA,aAAa,OAAe,QAAsB;AAChD,QAAI,CAAC,OAAO;AACJ,YAAA,IAAI,WAAW,gBAAgB;AAAA,IACvC;AAEA,QAAI,CAAC,QAAQ;AACL,YAAA,IAAI,WAAW,iBAAiB;AAAA,IACxC;AAEI,QAAA,OAAO,UAAU,UAAU;AACvB,YAAA,IAAI,WAAW,wBAAwB;AAAA,IAC/C;AAEI,QAAA,OAAO,WAAW,UAAU;AACxB,YAAA,IAAI,WAAW,yBAAyB;AAAA,IAChD;AAEA,QAAI,MAAM,OAAO,QAAQ,IAAI,EAAE,WAAW;AACxC,aAAO,MAAM,OAAO,MAAM,EAAE,OAAO;AAAA,IAAA,OAC9B;AACL,YAAM,IAAI,WAAW,MAAM,KAAK,QAAQ,MAAM,OAAO;AAAA,IACvD;AAAA,EACF;AACF;"}
|
package/dist/utils/NumberUtil.js
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
import
|
2
|
-
const
|
3
|
-
round: (
|
4
|
-
const
|
5
|
-
return Number(
|
1
|
+
import Decimal from "decimal.js";
|
2
|
+
const NumberUtil = {
|
3
|
+
round: (value, how) => {
|
4
|
+
const dec = new Decimal(value);
|
5
|
+
return Number(dec.toFixed(how, 4));
|
6
6
|
}
|
7
7
|
};
|
8
8
|
export {
|
9
|
-
|
9
|
+
NumberUtil as default
|
10
10
|
};
|
11
11
|
//# sourceMappingURL=NumberUtil.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"NumberUtil.js","sources":["../../src/utils/NumberUtil.ts"],"sourcesContent":["import Decimal from 'decimal.js'\r\n\r\nconst NumberUtil = {\r\n round: (value: number, how: number) => {\r\n const dec = new Decimal(value)\r\n return Number(dec.toFixed(how, 4))\r\n },\r\n}\r\n\r\nexport default NumberUtil\r\n"],"names":[
|
1
|
+
{"version":3,"file":"NumberUtil.js","sources":["../../src/utils/NumberUtil.ts"],"sourcesContent":["import Decimal from 'decimal.js'\r\n\r\nconst NumberUtil = {\r\n round: (value: number, how: number) => {\r\n const dec = new Decimal(value)\r\n return Number(dec.toFixed(how, 4))\r\n },\r\n}\r\n\r\nexport default NumberUtil\r\n"],"names":[],"mappings":";AAEA,MAAM,aAAa;AAAA,EACjB,OAAO,CAAC,OAAe,QAAgB;AAC/B,UAAA,MAAM,IAAI,QAAQ,KAAK;AAC7B,WAAO,OAAO,IAAI,QAAQ,KAAK,CAAC,CAAC;AAAA,EACnC;AACF;"}
|
package/dist/utils/cloneDeep.js
CHANGED
package/dist/utils/delay.js
CHANGED
package/dist/utils/delay.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"delay.js","sources":["../../src/utils/delay.ts"],"sourcesContent":["export default function delay(ms: number): Promise<void> {\r\n return new Promise((resolve) => setTimeout(resolve, ms))\r\n}\r\n"],"names":[
|
1
|
+
{"version":3,"file":"delay.js","sources":["../../src/utils/delay.ts"],"sourcesContent":["export default function delay(ms: number): Promise<void> {\r\n return new Promise((resolve) => setTimeout(resolve, ms))\r\n}\r\n"],"names":[],"mappings":"AAAA,SAAwB,MAAM,IAA2B;AACvD,SAAO,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,EAAE,CAAC;AACzD;"}
|
package/dist/utils/functions.js
CHANGED
package/dist/utils/index.js
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
import { cloneDeep
|
2
|
-
import { default as
|
3
|
-
import { default as
|
4
|
-
import { default as
|
5
|
-
import { default as
|
6
|
-
import { default as
|
1
|
+
import { cloneDeep } from "lodash-es";
|
2
|
+
import { default as default2 } from "./DateUtil.js";
|
3
|
+
import { default as default3 } from "./delay.js";
|
4
|
+
import { default as default4 } from "./md5.js";
|
5
|
+
import { default as default5 } from "./NumberUtil.js";
|
6
|
+
import { default as default6 } from "./uuid.js";
|
7
7
|
export {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
default2 as DateUtil,
|
9
|
+
default5 as NumberUtil,
|
10
|
+
cloneDeep,
|
11
|
+
default3 as delay,
|
12
|
+
default4 as md5,
|
13
|
+
default6 as uuid
|
14
14
|
};
|
15
15
|
//# sourceMappingURL=index.js.map
|