ingeniuscliq-core 0.4.18 → 0.4.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/dist/components/common/carousel/CustomCarousel.d.ts +1 -1
  2. package/dist/components/common/carousel/CustomCarousel.d.ts.map +1 -1
  3. package/dist/components/common/carousel/CustomCarouselSection.d.ts +1 -1
  4. package/dist/components/common/carousel/CustomCarouselSection.d.ts.map +1 -1
  5. package/dist/components/common/form/FormCheckbox.d.ts +1 -1
  6. package/dist/components/common/form/FormCheckbox.d.ts.map +1 -1
  7. package/dist/components/common/form/FormInput.d.ts +1 -1
  8. package/dist/components/common/form/FormInput.d.ts.map +1 -1
  9. package/dist/components/common/form/FormSelect.d.ts +1 -1
  10. package/dist/components/common/form/FormSelect.d.ts.map +1 -1
  11. package/dist/components/common/form/FormTextArea.d.ts +1 -1
  12. package/dist/components/common/form/FormTextArea.d.ts.map +1 -1
  13. package/dist/components/common/form/FormWrapper.d.ts +1 -1
  14. package/dist/components/common/form/FormWrapper.d.ts.map +1 -1
  15. package/dist/components/common/logo/Logo.d.ts +1 -1
  16. package/dist/components/common/logo/Logo.d.ts.map +1 -1
  17. package/dist/components/common/pagination/CustomPagination.d.ts +1 -1
  18. package/dist/components/common/pagination/CustomPagination.d.ts.map +1 -1
  19. package/dist/components/common/select/CustomSelect.d.ts +1 -1
  20. package/dist/components/common/select/CustomSelect.d.ts.map +1 -1
  21. package/dist/components/common/spinner/Spinner.d.ts +1 -1
  22. package/dist/components/common/spinner/Spinner.d.ts.map +1 -1
  23. package/dist/components/common/stepper/Stepper.d.ts +1 -1
  24. package/dist/components/common/stepper/Stepper.d.ts.map +1 -1
  25. package/dist/components/common/stepper/Stepper.tsx +1 -1
  26. package/dist/components/layouts/CoreBaseLayout.d.ts +1 -1
  27. package/dist/components/layouts/CoreBaseLayout.d.ts.map +1 -1
  28. package/dist/components/templates/CoreHomeLayout.d.ts +1 -1
  29. package/dist/components/templates/CoreHomeLayout.d.ts.map +1 -1
  30. package/dist/components/templates/CorePreviewLayout.d.ts +1 -1
  31. package/dist/components/templates/CorePreviewLayout.d.ts.map +1 -1
  32. package/dist/components/ui/accordion.tsx +9 -9
  33. package/dist/components/ui/alert-dialog.d.ts +2 -2
  34. package/dist/components/ui/alert-dialog.tsx +16 -16
  35. package/dist/components/ui/alert.d.ts +3 -3
  36. package/dist/components/ui/alert.d.ts.map +1 -1
  37. package/dist/components/ui/alert.tsx +1 -1
  38. package/dist/components/ui/avatar.tsx +7 -7
  39. package/dist/components/ui/badge.d.ts +4 -4
  40. package/dist/components/ui/badge.d.ts.map +1 -1
  41. package/dist/components/ui/badge.tsx +1 -1
  42. package/dist/components/ui/breadcrumb.d.ts +2 -2
  43. package/dist/components/ui/breadcrumb.tsx +3 -4
  44. package/dist/components/ui/button.d.ts +4 -4
  45. package/dist/components/ui/button.d.ts.map +1 -1
  46. package/dist/components/ui/button.tsx +2 -2
  47. package/dist/components/ui/carousel.tsx +2 -3
  48. package/dist/components/ui/checkbox.tsx +5 -5
  49. package/dist/components/ui/dialog.d.ts +2 -2
  50. package/dist/components/ui/dialog.tsx +15 -15
  51. package/dist/components/ui/dropdown-menu.d.ts +1 -1
  52. package/dist/components/ui/dropdown-menu.tsx +27 -29
  53. package/dist/components/ui/form.d.ts +1 -1
  54. package/dist/components/ui/form.d.ts.map +1 -1
  55. package/dist/components/ui/form.tsx +2 -2
  56. package/dist/components/ui/label.d.ts +1 -1
  57. package/dist/components/ui/label.d.ts.map +1 -1
  58. package/dist/components/ui/label.tsx +4 -4
  59. package/dist/components/ui/pagination.d.ts +5 -5
  60. package/dist/components/ui/pagination.tsx +2 -4
  61. package/dist/components/ui/popover.tsx +7 -7
  62. package/dist/components/ui/radio-group.tsx +7 -7
  63. package/dist/components/ui/select.tsx +25 -27
  64. package/dist/components/ui/separator.tsx +3 -3
  65. package/dist/components/ui/sheet.d.ts +5 -5
  66. package/dist/components/ui/sheet.d.ts.map +1 -1
  67. package/dist/components/ui/sheet.tsx +16 -16
  68. package/dist/components/ui/skeleton.d.ts +1 -1
  69. package/dist/components/ui/skeleton.d.ts.map +1 -1
  70. package/dist/components/ui/slider.tsx +6 -6
  71. package/dist/components/ui/stepper.tsx +4 -4
  72. package/dist/components/ui/switch.tsx +4 -4
  73. package/dist/components/ui/tabs.tsx +9 -9
  74. package/dist/components/ui/tooltip.tsx +6 -6
  75. package/dist/helpers/axiosGlobal.js +1 -2
  76. package/dist/hooks/useLanguage.js +2 -5
  77. package/dist/hooks/useNotification.js +1 -1
  78. package/dist/i18n/config.js +1 -5
  79. package/dist/lib/utils.js +1 -1
  80. package/dist/modules/CoreAuth/classes/CoreAuthBuilder.d.ts +2 -2
  81. package/dist/modules/CoreAuth/classes/CoreAuthBuilder.js +1 -1
  82. package/dist/modules/CoreAuth/context/AuthContext.d.ts +2 -2
  83. package/dist/modules/CoreAuth/context/AuthContext.d.ts.map +1 -1
  84. package/dist/modules/CoreAuth/hooks/useAuth.d.ts +3 -3
  85. package/dist/modules/CoreAuth/index.js +1 -0
  86. package/dist/modules/CoreAuth/stores/authStore.d.ts +2 -2
  87. package/dist/modules/CoreCustomization/classes/CoreCustomizationBuilder.d.ts +8 -8
  88. package/dist/modules/CoreCustomization/classes/CoreCustomizationBuilder.js +1 -1
  89. package/dist/modules/CoreCustomization/index.js +1 -0
  90. package/dist/modules/CoreOrder/classes/CoreOrderBuilder.js +1 -1
  91. package/dist/modules/CoreOrder/index.js +1 -0
  92. package/dist/modules/CorePayForm/classes/CorePayFormBuilder.d.ts +2 -2
  93. package/dist/modules/CorePayForm/classes/CorePayFormBuilder.js +1 -1
  94. package/dist/modules/CorePayForm/index.js +1 -0
  95. package/dist/modules/CoreProduct/classes/CoreProductBuilder.d.ts +8 -8
  96. package/dist/modules/CoreProduct/classes/CoreProductBuilder.js +1 -1
  97. package/dist/modules/CoreProduct/index.js +1 -0
  98. package/dist/modules/CoreShipment/classes/CoreShipmentBuilder.d.ts +6 -6
  99. package/dist/modules/CoreShipment/classes/CoreShipmentBuilder.js +1 -1
  100. package/dist/modules/CoreShipment/index.js +1 -0
  101. package/dist/modules/CoreShopCart/classes/CoreShopCartBuilder.d.ts +4 -4
  102. package/dist/modules/CoreShopCart/classes/CoreShopCartBuilder.js +1 -1
  103. package/package.json +21 -13
  104. package/src/commands/common/constants.js +10 -0
  105. package/src/commands/helpers/index.js +15 -0
  106. package/src/commands/helpers/strings.js +4 -0
  107. package/src/commands/templates/locale.js +14 -0
  108. package/src/commands/templates/service.js +12 -0
  109. package/src/commands/templates/type.js +10 -0
  110. package/README.md +0 -417
  111. package/dist/_virtual/index.js +0 -5
  112. package/dist/_virtual/index2.js +0 -3
  113. package/dist/_virtual/use-sync-external-store-shim.development.js +0 -3
  114. package/dist/_virtual/use-sync-external-store-shim.production.js +0 -3
  115. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -814
  116. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -751
  117. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -350
  118. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -161
  119. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -137
  120. package/dist/node_modules/@radix-ui/number/dist/index.js +0 -6
  121. package/dist/node_modules/@radix-ui/primitive/dist/index.js +0 -11
  122. package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +0 -305
  123. package/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.js +0 -147
  124. package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +0 -25
  125. package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +0 -118
  126. package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +0 -270
  127. package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +0 -145
  128. package/dist/node_modules/@radix-ui/react-collection/dist/index.js +0 -70
  129. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -39
  130. package/dist/node_modules/@radix-ui/react-context/dist/index.js +0 -79
  131. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +0 -321
  132. package/dist/node_modules/@radix-ui/react-direction/dist/index.js +0 -11
  133. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -211
  134. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +0 -267
  135. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +0 -29
  136. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -207
  137. package/dist/node_modules/@radix-ui/react-id/dist/index.js +0 -15
  138. package/dist/node_modules/@radix-ui/react-label/dist/index.js +0 -24
  139. package/dist/node_modules/@radix-ui/react-menu/dist/index.js +0 -834
  140. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +0 -299
  141. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +0 -283
  142. package/dist/node_modules/@radix-ui/react-portal/dist/index.js +0 -17
  143. package/dist/node_modules/@radix-ui/react-presence/dist/index.js +0 -130
  144. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +0 -43
  145. package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +0 -282
  146. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +0 -223
  147. package/dist/node_modules/@radix-ui/react-select/dist/index.js +0 -1156
  148. package/dist/node_modules/@radix-ui/react-separator/dist/index.js +0 -30
  149. package/dist/node_modules/@radix-ui/react-slider/dist/index.js +0 -554
  150. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +0 -99
  151. package/dist/node_modules/@radix-ui/react-switch/dist/index.js +0 -152
  152. package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +0 -187
  153. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +0 -482
  154. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +0 -12
  155. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -70
  156. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +0 -18
  157. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +0 -16
  158. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +0 -7
  159. package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +0 -15
  160. package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +0 -40
  161. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +0 -35
  162. package/dist/node_modules/@stepperize/core/dist/index.js +0 -3
  163. package/dist/node_modules/@stepperize/react/dist/index.js +0 -6
  164. package/dist/node_modules/aria-hidden/dist/es2015/index.js +0 -137
  165. package/dist/node_modules/axios/index.js +0 -25
  166. package/dist/node_modules/axios/lib/adapters/adapters.js +0 -81
  167. package/dist/node_modules/axios/lib/adapters/fetch.js +0 -229
  168. package/dist/node_modules/axios/lib/adapters/xhr.js +0 -199
  169. package/dist/node_modules/axios/lib/axios.js +0 -86
  170. package/dist/node_modules/axios/lib/cancel/CancelToken.js +0 -133
  171. package/dist/node_modules/axios/lib/cancel/CanceledError.js +0 -23
  172. package/dist/node_modules/axios/lib/cancel/isCancel.js +0 -5
  173. package/dist/node_modules/axios/lib/core/Axios.js +0 -238
  174. package/dist/node_modules/axios/lib/core/AxiosError.js +0 -101
  175. package/dist/node_modules/axios/lib/core/AxiosHeaders.js +0 -312
  176. package/dist/node_modules/axios/lib/core/InterceptorManager.js +0 -69
  177. package/dist/node_modules/axios/lib/core/buildFullPath.js +0 -22
  178. package/dist/node_modules/axios/lib/core/dispatchRequest.js +0 -81
  179. package/dist/node_modules/axios/lib/core/mergeConfig.js +0 -106
  180. package/dist/node_modules/axios/lib/core/settle.js +0 -27
  181. package/dist/node_modules/axios/lib/core/transformData.js +0 -28
  182. package/dist/node_modules/axios/lib/defaults/index.js +0 -159
  183. package/dist/node_modules/axios/lib/defaults/transitional.js +0 -7
  184. package/dist/node_modules/axios/lib/env/data.js +0 -3
  185. package/dist/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +0 -56
  186. package/dist/node_modules/axios/lib/helpers/HttpStatusCode.js +0 -71
  187. package/dist/node_modules/axios/lib/helpers/bind.js +0 -7
  188. package/dist/node_modules/axios/lib/helpers/buildURL.js +0 -69
  189. package/dist/node_modules/axios/lib/helpers/combineURLs.js +0 -15
  190. package/dist/node_modules/axios/lib/helpers/composeSignals.js +0 -48
  191. package/dist/node_modules/axios/lib/helpers/cookies.js +0 -43
  192. package/dist/node_modules/axios/lib/helpers/formDataToJSON.js +0 -93
  193. package/dist/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -15
  194. package/dist/node_modules/axios/lib/helpers/isAxiosError.js +0 -14
  195. package/dist/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -16
  196. package/dist/node_modules/axios/lib/helpers/null.js +0 -4
  197. package/dist/node_modules/axios/lib/helpers/parseHeaders.js +0 -55
  198. package/dist/node_modules/axios/lib/helpers/parseProtocol.js +0 -6
  199. package/dist/node_modules/axios/lib/helpers/progressEventReducer.js +0 -46
  200. package/dist/node_modules/axios/lib/helpers/resolveConfig.js +0 -58
  201. package/dist/node_modules/axios/lib/helpers/speedometer.js +0 -53
  202. package/dist/node_modules/axios/lib/helpers/spread.js +0 -28
  203. package/dist/node_modules/axios/lib/helpers/throttle.js +0 -44
  204. package/dist/node_modules/axios/lib/helpers/toFormData.js +0 -219
  205. package/dist/node_modules/axios/lib/helpers/toURLEncodedForm.js +0 -19
  206. package/dist/node_modules/axios/lib/helpers/trackStream.js +0 -88
  207. package/dist/node_modules/axios/lib/helpers/validator.js +0 -99
  208. package/dist/node_modules/axios/lib/platform/browser/classes/Blob.js +0 -3
  209. package/dist/node_modules/axios/lib/platform/browser/classes/FormData.js +0 -3
  210. package/dist/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +0 -5
  211. package/dist/node_modules/axios/lib/platform/browser/index.js +0 -15
  212. package/dist/node_modules/axios/lib/platform/common/utils.js +0 -45
  213. package/dist/node_modules/axios/lib/platform/index.js +0 -9
  214. package/dist/node_modules/axios/lib/utils.js +0 -780
  215. package/dist/node_modules/class-variance-authority/dist/index.js +0 -44
  216. package/dist/node_modules/clsx/dist/clsx.js +0 -3
  217. package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +0 -1669
  218. package/dist/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +0 -37
  219. package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +0 -38
  220. package/dist/node_modules/get-nonce/dist/es2015/index.js +0 -8
  221. package/dist/node_modules/lucide-react/dist/esm/Icon.js +0 -43
  222. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +0 -30
  223. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +0 -20
  224. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left.js +0 -17
  225. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-right.js +0 -17
  226. package/dist/node_modules/lucide-react/dist/esm/icons/check.js +0 -14
  227. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +0 -14
  228. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.js +0 -14
  229. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js +0 -14
  230. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +0 -14
  231. package/dist/node_modules/lucide-react/dist/esm/icons/circle.js +0 -14
  232. package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis.js +0 -18
  233. package/dist/node_modules/lucide-react/dist/esm/icons/x.js +0 -17
  234. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +0 -28
  235. package/dist/node_modules/react-hook-form/dist/index.esm.js +0 -560
  236. package/dist/node_modules/react-i18next/dist/es/IcuTransUtils/htmlEntityDecoder.js +0 -210
  237. package/dist/node_modules/react-i18next/dist/es/context.js +0 -18
  238. package/dist/node_modules/react-i18next/dist/es/defaults.js +0 -22
  239. package/dist/node_modules/react-i18next/dist/es/i18nInstance.js +0 -7
  240. package/dist/node_modules/react-i18next/dist/es/initReactI18next.js +0 -12
  241. package/dist/node_modules/react-i18next/dist/es/unescape.js +0 -27
  242. package/dist/node_modules/react-i18next/dist/es/useTranslation.js +0 -157
  243. package/dist/node_modules/react-i18next/dist/es/utils.js +0 -63
  244. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +0 -9
  245. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +0 -167
  246. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +0 -38
  247. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +0 -21
  248. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +0 -110
  249. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +0 -5
  250. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +0 -7
  251. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +0 -56
  252. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +0 -10
  253. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +0 -31
  254. package/dist/node_modules/react-style-singleton/dist/es2015/component.js +0 -19
  255. package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +0 -25
  256. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +0 -51
  257. package/dist/node_modules/sonner/dist/index.js +0 -299
  258. package/dist/node_modules/tslib/tslib.es6.js +0 -56
  259. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +0 -24
  260. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +0 -48
  261. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +0 -42
  262. package/dist/node_modules/use-sidecar/dist/es2015/exports.js +0 -21
  263. package/dist/node_modules/use-sidecar/dist/es2015/medium.js +0 -77
  264. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -106
  265. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -77
  266. package/dist/node_modules/use-sync-external-store/shim/index.js +0 -19
  267. package/dist/node_modules/zustand/esm/react.js +0 -22
  268. package/dist/node_modules/zustand/esm/vanilla.js +0 -24
  269. /package/src/{core/commands → commands}/create-core-module.js +0 -0
  270. /package/src/{core/commands → commands}/create-module.js +0 -0
  271. /package/src/{core/commands → commands}/create-template.js +0 -0
  272. /package/src/{core/commands → commands}/rollback-core-module.js +0 -0
  273. /package/src/{core/commands → commands}/rollback-module.js +0 -0
@@ -1,101 +0,0 @@
1
- import utils from '../utils.js';
2
-
3
- /**
4
- * Create an Error with the specified message, config, error code, request and response.
5
- *
6
- * @param {string} message The error message.
7
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
8
- * @param {Object} [config] The config.
9
- * @param {Object} [request] The request.
10
- * @param {Object} [response] The response.
11
- *
12
- * @returns {Error} The created error.
13
- */
14
- function AxiosError(message, code, config, request, response) {
15
- Error.call(this);
16
-
17
- if (Error.captureStackTrace) {
18
- Error.captureStackTrace(this, this.constructor);
19
- } else {
20
- this.stack = (new Error()).stack;
21
- }
22
-
23
- this.message = message;
24
- this.name = 'AxiosError';
25
- code && (this.code = code);
26
- config && (this.config = config);
27
- request && (this.request = request);
28
- if (response) {
29
- this.response = response;
30
- this.status = response.status ? response.status : null;
31
- }
32
- }
33
-
34
- utils.inherits(AxiosError, Error, {
35
- toJSON: function toJSON() {
36
- return {
37
- // Standard
38
- message: this.message,
39
- name: this.name,
40
- // Microsoft
41
- description: this.description,
42
- number: this.number,
43
- // Mozilla
44
- fileName: this.fileName,
45
- lineNumber: this.lineNumber,
46
- columnNumber: this.columnNumber,
47
- stack: this.stack,
48
- // Axios
49
- config: utils.toJSONObject(this.config),
50
- code: this.code,
51
- status: this.status
52
- };
53
- }
54
- });
55
-
56
- const prototype = AxiosError.prototype;
57
- const descriptors = {};
58
-
59
- [
60
- 'ERR_BAD_OPTION_VALUE',
61
- 'ERR_BAD_OPTION',
62
- 'ECONNABORTED',
63
- 'ETIMEDOUT',
64
- 'ERR_NETWORK',
65
- 'ERR_FR_TOO_MANY_REDIRECTS',
66
- 'ERR_DEPRECATED',
67
- 'ERR_BAD_RESPONSE',
68
- 'ERR_BAD_REQUEST',
69
- 'ERR_CANCELED',
70
- 'ERR_NOT_SUPPORT',
71
- 'ERR_INVALID_URL'
72
- // eslint-disable-next-line func-names
73
- ].forEach(code => {
74
- descriptors[code] = {value: code};
75
- });
76
-
77
- Object.defineProperties(AxiosError, descriptors);
78
- Object.defineProperty(prototype, 'isAxiosError', {value: true});
79
-
80
- // eslint-disable-next-line func-names
81
- AxiosError.from = (error, code, config, request, response, customProps) => {
82
- const axiosError = Object.create(prototype);
83
-
84
- utils.toFlatObject(error, axiosError, function filter(obj) {
85
- return obj !== Error.prototype;
86
- }, prop => {
87
- return prop !== 'isAxiosError';
88
- });
89
-
90
- AxiosError.call(axiosError, error.message, code, config, request, response);
91
-
92
- axiosError.cause = error;
93
-
94
- axiosError.name = error.name;
95
-
96
- customProps && Object.assign(axiosError, customProps);
97
-
98
- return axiosError;
99
- };
100
-
101
- export { AxiosError as default };
@@ -1,312 +0,0 @@
1
- import utils from '../utils.js';
2
- import parseHeaders from '../helpers/parseHeaders.js';
3
-
4
- const $internals = Symbol('internals');
5
-
6
- function normalizeHeader(header) {
7
- return header && String(header).trim().toLowerCase();
8
- }
9
-
10
- function normalizeValue(value) {
11
- if (value === false || value == null) {
12
- return value;
13
- }
14
-
15
- return utils.isArray(value) ? value.map(normalizeValue) : String(value);
16
- }
17
-
18
- function parseTokens(str) {
19
- const tokens = Object.create(null);
20
- const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
21
- let match;
22
-
23
- while ((match = tokensRE.exec(str))) {
24
- tokens[match[1]] = match[2];
25
- }
26
-
27
- return tokens;
28
- }
29
-
30
- const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
31
-
32
- function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
33
- if (utils.isFunction(filter)) {
34
- return filter.call(this, value, header);
35
- }
36
-
37
- if (isHeaderNameFilter) {
38
- value = header;
39
- }
40
-
41
- if (!utils.isString(value)) return;
42
-
43
- if (utils.isString(filter)) {
44
- return value.indexOf(filter) !== -1;
45
- }
46
-
47
- if (utils.isRegExp(filter)) {
48
- return filter.test(value);
49
- }
50
- }
51
-
52
- function formatHeader(header) {
53
- return header.trim()
54
- .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
55
- return char.toUpperCase() + str;
56
- });
57
- }
58
-
59
- function buildAccessors(obj, header) {
60
- const accessorName = utils.toCamelCase(' ' + header);
61
-
62
- ['get', 'set', 'has'].forEach(methodName => {
63
- Object.defineProperty(obj, methodName + accessorName, {
64
- value: function(arg1, arg2, arg3) {
65
- return this[methodName].call(this, header, arg1, arg2, arg3);
66
- },
67
- configurable: true
68
- });
69
- });
70
- }
71
-
72
- class AxiosHeaders {
73
- constructor(headers) {
74
- headers && this.set(headers);
75
- }
76
-
77
- set(header, valueOrRewrite, rewrite) {
78
- const self = this;
79
-
80
- function setHeader(_value, _header, _rewrite) {
81
- const lHeader = normalizeHeader(_header);
82
-
83
- if (!lHeader) {
84
- throw new Error('header name must be a non-empty string');
85
- }
86
-
87
- const key = utils.findKey(self, lHeader);
88
-
89
- if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
90
- self[key || _header] = normalizeValue(_value);
91
- }
92
- }
93
-
94
- const setHeaders = (headers, _rewrite) =>
95
- utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
96
-
97
- if (utils.isPlainObject(header) || header instanceof this.constructor) {
98
- setHeaders(header, valueOrRewrite);
99
- } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
100
- setHeaders(parseHeaders(header), valueOrRewrite);
101
- } else if (utils.isObject(header) && utils.isIterable(header)) {
102
- let obj = {}, dest, key;
103
- for (const entry of header) {
104
- if (!utils.isArray(entry)) {
105
- throw TypeError('Object iterator must return a key-value pair');
106
- }
107
-
108
- obj[key = entry[0]] = (dest = obj[key]) ?
109
- (utils.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
110
- }
111
-
112
- setHeaders(obj, valueOrRewrite);
113
- } else {
114
- header != null && setHeader(valueOrRewrite, header, rewrite);
115
- }
116
-
117
- return this;
118
- }
119
-
120
- get(header, parser) {
121
- header = normalizeHeader(header);
122
-
123
- if (header) {
124
- const key = utils.findKey(this, header);
125
-
126
- if (key) {
127
- const value = this[key];
128
-
129
- if (!parser) {
130
- return value;
131
- }
132
-
133
- if (parser === true) {
134
- return parseTokens(value);
135
- }
136
-
137
- if (utils.isFunction(parser)) {
138
- return parser.call(this, value, key);
139
- }
140
-
141
- if (utils.isRegExp(parser)) {
142
- return parser.exec(value);
143
- }
144
-
145
- throw new TypeError('parser must be boolean|regexp|function');
146
- }
147
- }
148
- }
149
-
150
- has(header, matcher) {
151
- header = normalizeHeader(header);
152
-
153
- if (header) {
154
- const key = utils.findKey(this, header);
155
-
156
- return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
157
- }
158
-
159
- return false;
160
- }
161
-
162
- delete(header, matcher) {
163
- const self = this;
164
- let deleted = false;
165
-
166
- function deleteHeader(_header) {
167
- _header = normalizeHeader(_header);
168
-
169
- if (_header) {
170
- const key = utils.findKey(self, _header);
171
-
172
- if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
173
- delete self[key];
174
-
175
- deleted = true;
176
- }
177
- }
178
- }
179
-
180
- if (utils.isArray(header)) {
181
- header.forEach(deleteHeader);
182
- } else {
183
- deleteHeader(header);
184
- }
185
-
186
- return deleted;
187
- }
188
-
189
- clear(matcher) {
190
- const keys = Object.keys(this);
191
- let i = keys.length;
192
- let deleted = false;
193
-
194
- while (i--) {
195
- const key = keys[i];
196
- if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
197
- delete this[key];
198
- deleted = true;
199
- }
200
- }
201
-
202
- return deleted;
203
- }
204
-
205
- normalize(format) {
206
- const self = this;
207
- const headers = {};
208
-
209
- utils.forEach(this, (value, header) => {
210
- const key = utils.findKey(headers, header);
211
-
212
- if (key) {
213
- self[key] = normalizeValue(value);
214
- delete self[header];
215
- return;
216
- }
217
-
218
- const normalized = format ? formatHeader(header) : String(header).trim();
219
-
220
- if (normalized !== header) {
221
- delete self[header];
222
- }
223
-
224
- self[normalized] = normalizeValue(value);
225
-
226
- headers[normalized] = true;
227
- });
228
-
229
- return this;
230
- }
231
-
232
- concat(...targets) {
233
- return this.constructor.concat(this, ...targets);
234
- }
235
-
236
- toJSON(asStrings) {
237
- const obj = Object.create(null);
238
-
239
- utils.forEach(this, (value, header) => {
240
- value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
241
- });
242
-
243
- return obj;
244
- }
245
-
246
- [Symbol.iterator]() {
247
- return Object.entries(this.toJSON())[Symbol.iterator]();
248
- }
249
-
250
- toString() {
251
- return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
252
- }
253
-
254
- getSetCookie() {
255
- return this.get("set-cookie") || [];
256
- }
257
-
258
- get [Symbol.toStringTag]() {
259
- return 'AxiosHeaders';
260
- }
261
-
262
- static from(thing) {
263
- return thing instanceof this ? thing : new this(thing);
264
- }
265
-
266
- static concat(first, ...targets) {
267
- const computed = new this(first);
268
-
269
- targets.forEach((target) => computed.set(target));
270
-
271
- return computed;
272
- }
273
-
274
- static accessor(header) {
275
- const internals = this[$internals] = (this[$internals] = {
276
- accessors: {}
277
- });
278
-
279
- const accessors = internals.accessors;
280
- const prototype = this.prototype;
281
-
282
- function defineAccessor(_header) {
283
- const lHeader = normalizeHeader(_header);
284
-
285
- if (!accessors[lHeader]) {
286
- buildAccessors(prototype, _header);
287
- accessors[lHeader] = true;
288
- }
289
- }
290
-
291
- utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
292
-
293
- return this;
294
- }
295
- }
296
-
297
- AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
298
-
299
- // reserved names hotfix
300
- utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
301
- let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
302
- return {
303
- get: () => value,
304
- set(headerValue) {
305
- this[mapped] = headerValue;
306
- }
307
- }
308
- });
309
-
310
- utils.freezeMethods(AxiosHeaders);
311
-
312
- export { AxiosHeaders as default };
@@ -1,69 +0,0 @@
1
- import utils from '../utils.js';
2
-
3
- class InterceptorManager {
4
- constructor() {
5
- this.handlers = [];
6
- }
7
-
8
- /**
9
- * Add a new interceptor to the stack
10
- *
11
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
12
- * @param {Function} rejected The function to handle `reject` for a `Promise`
13
- *
14
- * @return {Number} An ID used to remove interceptor later
15
- */
16
- use(fulfilled, rejected, options) {
17
- this.handlers.push({
18
- fulfilled,
19
- rejected,
20
- synchronous: options ? options.synchronous : false,
21
- runWhen: options ? options.runWhen : null
22
- });
23
- return this.handlers.length - 1;
24
- }
25
-
26
- /**
27
- * Remove an interceptor from the stack
28
- *
29
- * @param {Number} id The ID that was returned by `use`
30
- *
31
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
32
- */
33
- eject(id) {
34
- if (this.handlers[id]) {
35
- this.handlers[id] = null;
36
- }
37
- }
38
-
39
- /**
40
- * Clear all interceptors from the stack
41
- *
42
- * @returns {void}
43
- */
44
- clear() {
45
- if (this.handlers) {
46
- this.handlers = [];
47
- }
48
- }
49
-
50
- /**
51
- * Iterate over all the registered interceptors
52
- *
53
- * This method is particularly useful for skipping over any
54
- * interceptors that may have become `null` calling `eject`.
55
- *
56
- * @param {Function} fn The function to call for each interceptor
57
- *
58
- * @returns {void}
59
- */
60
- forEach(fn) {
61
- utils.forEach(this.handlers, function forEachHandler(h) {
62
- if (h !== null) {
63
- fn(h);
64
- }
65
- });
66
- }
67
- }
68
-
69
- export { InterceptorManager as default };
@@ -1,22 +0,0 @@
1
- import isAbsoluteURL from '../helpers/isAbsoluteURL.js';
2
- import combineURLs from '../helpers/combineURLs.js';
3
-
4
- /**
5
- * Creates a new URL by combining the baseURL with the requestedURL,
6
- * only when the requestedURL is not already an absolute URL.
7
- * If the requestURL is absolute, this function returns the requestedURL untouched.
8
- *
9
- * @param {string} baseURL The base URL
10
- * @param {string} requestedURL Absolute or relative URL to combine
11
- *
12
- * @returns {string} The combined full path
13
- */
14
- function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
15
- let isRelativeUrl = !isAbsoluteURL(requestedURL);
16
- if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
17
- return combineURLs(baseURL, requestedURL);
18
- }
19
- return requestedURL;
20
- }
21
-
22
- export { buildFullPath as default };
@@ -1,81 +0,0 @@
1
- import transformData from './transformData.js';
2
- import isCancel from '../cancel/isCancel.js';
3
- import defaults from '../defaults/index.js';
4
- import CanceledError from '../cancel/CanceledError.js';
5
- import AxiosHeaders from './AxiosHeaders.js';
6
- import adapters from '../adapters/adapters.js';
7
-
8
- /**
9
- * Throws a `CanceledError` if cancellation has been requested.
10
- *
11
- * @param {Object} config The config that is to be used for the request
12
- *
13
- * @returns {void}
14
- */
15
- function throwIfCancellationRequested(config) {
16
- if (config.cancelToken) {
17
- config.cancelToken.throwIfRequested();
18
- }
19
-
20
- if (config.signal && config.signal.aborted) {
21
- throw new CanceledError(null, config);
22
- }
23
- }
24
-
25
- /**
26
- * Dispatch a request to the server using the configured adapter.
27
- *
28
- * @param {object} config The config that is to be used for the request
29
- *
30
- * @returns {Promise} The Promise to be fulfilled
31
- */
32
- function dispatchRequest(config) {
33
- throwIfCancellationRequested(config);
34
-
35
- config.headers = AxiosHeaders.from(config.headers);
36
-
37
- // Transform request data
38
- config.data = transformData.call(
39
- config,
40
- config.transformRequest
41
- );
42
-
43
- if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
44
- config.headers.setContentType('application/x-www-form-urlencoded', false);
45
- }
46
-
47
- const adapter = adapters.getAdapter(config.adapter || defaults.adapter);
48
-
49
- return adapter(config).then(function onAdapterResolution(response) {
50
- throwIfCancellationRequested(config);
51
-
52
- // Transform response data
53
- response.data = transformData.call(
54
- config,
55
- config.transformResponse,
56
- response
57
- );
58
-
59
- response.headers = AxiosHeaders.from(response.headers);
60
-
61
- return response;
62
- }, function onAdapterRejection(reason) {
63
- if (!isCancel(reason)) {
64
- throwIfCancellationRequested(config);
65
-
66
- // Transform response data
67
- if (reason && reason.response) {
68
- reason.response.data = transformData.call(
69
- config,
70
- config.transformResponse,
71
- reason.response
72
- );
73
- reason.response.headers = AxiosHeaders.from(reason.response.headers);
74
- }
75
- }
76
-
77
- return Promise.reject(reason);
78
- });
79
- }
80
-
81
- export { dispatchRequest as default };
@@ -1,106 +0,0 @@
1
- import utils from '../utils.js';
2
- import AxiosHeaders from './AxiosHeaders.js';
3
-
4
- const headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing;
5
-
6
- /**
7
- * Config-specific merge-function which creates a new config-object
8
- * by merging two configuration objects together.
9
- *
10
- * @param {Object} config1
11
- * @param {Object} config2
12
- *
13
- * @returns {Object} New object resulting from merging config2 to config1
14
- */
15
- function mergeConfig(config1, config2) {
16
- // eslint-disable-next-line no-param-reassign
17
- config2 = config2 || {};
18
- const config = {};
19
-
20
- function getMergedValue(target, source, prop, caseless) {
21
- if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
22
- return utils.merge.call({caseless}, target, source);
23
- } else if (utils.isPlainObject(source)) {
24
- return utils.merge({}, source);
25
- } else if (utils.isArray(source)) {
26
- return source.slice();
27
- }
28
- return source;
29
- }
30
-
31
- // eslint-disable-next-line consistent-return
32
- function mergeDeepProperties(a, b, prop , caseless) {
33
- if (!utils.isUndefined(b)) {
34
- return getMergedValue(a, b, prop , caseless);
35
- } else if (!utils.isUndefined(a)) {
36
- return getMergedValue(undefined, a, prop , caseless);
37
- }
38
- }
39
-
40
- // eslint-disable-next-line consistent-return
41
- function valueFromConfig2(a, b) {
42
- if (!utils.isUndefined(b)) {
43
- return getMergedValue(undefined, b);
44
- }
45
- }
46
-
47
- // eslint-disable-next-line consistent-return
48
- function defaultToConfig2(a, b) {
49
- if (!utils.isUndefined(b)) {
50
- return getMergedValue(undefined, b);
51
- } else if (!utils.isUndefined(a)) {
52
- return getMergedValue(undefined, a);
53
- }
54
- }
55
-
56
- // eslint-disable-next-line consistent-return
57
- function mergeDirectKeys(a, b, prop) {
58
- if (prop in config2) {
59
- return getMergedValue(a, b);
60
- } else if (prop in config1) {
61
- return getMergedValue(undefined, a);
62
- }
63
- }
64
-
65
- const mergeMap = {
66
- url: valueFromConfig2,
67
- method: valueFromConfig2,
68
- data: valueFromConfig2,
69
- baseURL: defaultToConfig2,
70
- transformRequest: defaultToConfig2,
71
- transformResponse: defaultToConfig2,
72
- paramsSerializer: defaultToConfig2,
73
- timeout: defaultToConfig2,
74
- timeoutMessage: defaultToConfig2,
75
- withCredentials: defaultToConfig2,
76
- withXSRFToken: defaultToConfig2,
77
- adapter: defaultToConfig2,
78
- responseType: defaultToConfig2,
79
- xsrfCookieName: defaultToConfig2,
80
- xsrfHeaderName: defaultToConfig2,
81
- onUploadProgress: defaultToConfig2,
82
- onDownloadProgress: defaultToConfig2,
83
- decompress: defaultToConfig2,
84
- maxContentLength: defaultToConfig2,
85
- maxBodyLength: defaultToConfig2,
86
- beforeRedirect: defaultToConfig2,
87
- transport: defaultToConfig2,
88
- httpAgent: defaultToConfig2,
89
- httpsAgent: defaultToConfig2,
90
- cancelToken: defaultToConfig2,
91
- socketPath: defaultToConfig2,
92
- responseEncoding: defaultToConfig2,
93
- validateStatus: mergeDirectKeys,
94
- headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
95
- };
96
-
97
- utils.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
98
- const merge = mergeMap[prop] || mergeDeepProperties;
99
- const configValue = merge(config1[prop], config2[prop], prop);
100
- (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
101
- });
102
-
103
- return config;
104
- }
105
-
106
- export { mergeConfig as default };