ingeniuscliq-core 0.4.25 → 0.4.27

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 (231) hide show
  1. package/dist/components/common/carousel/CustomCarousel.js +26 -0
  2. package/dist/components/common/carousel/CustomCarouselSection.js +41 -0
  3. package/dist/components/common/form/CustomFormField.js +29 -0
  4. package/dist/components/common/form/{FormCheckbox.tsx → FormCheckbox.js} +7 -7
  5. package/dist/components/common/form/{FormInput.tsx → FormInput.js} +5 -5
  6. package/dist/components/common/form/{FormSelect.tsx → FormSelect.js} +7 -7
  7. package/dist/components/common/form/{FormTextArea.tsx → FormTextArea.js} +5 -5
  8. package/dist/components/common/form/{FormWrapper.tsx → FormWrapper.js} +2 -2
  9. package/dist/components/common/logo/{Logo.tsx → Logo.js} +3 -3
  10. package/dist/components/common/pagination/{CustomPagination.tsx → CustomPagination.js} +6 -6
  11. package/dist/components/common/select/CustomSelect.js +27 -0
  12. package/dist/components/common/spinner/Spinner.js +32 -0
  13. package/dist/components/common/stepper/{Stepper.tsx → Stepper.js} +9 -9
  14. package/dist/components/layouts/CoreBaseLayout.js +19 -0
  15. package/dist/components/templates/CoreHomeLayout.js +8 -0
  16. package/dist/components/templates/{CorePreviewLayout.tsx → CorePreviewLayout.js} +3 -3
  17. package/dist/components/ui/accordion.js +44 -0
  18. package/dist/components/ui/{alert-dialog.tsx → alert-dialog.js} +28 -28
  19. package/dist/components/ui/{alert.tsx → alert.js} +5 -5
  20. package/dist/components/ui/{avatar.tsx → avatar.js} +11 -11
  21. package/dist/components/ui/{badge.tsx → badge.js} +3 -3
  22. package/dist/components/ui/{breadcrumb.tsx → breadcrumb.js} +13 -14
  23. package/dist/components/ui/{button.tsx → button.js} +4 -4
  24. package/dist/components/ui/{card.tsx → card.js} +8 -8
  25. package/dist/components/ui/{carousel.tsx → carousel.js} +14 -15
  26. package/dist/components/ui/{checkbox.tsx → checkbox.js} +9 -9
  27. package/dist/components/ui/{dialog.tsx → dialog.js} +26 -26
  28. package/dist/components/ui/{dropdown-menu.tsx → dropdown-menu.js} +37 -39
  29. package/dist/components/ui/{form.tsx → form.js} +10 -10
  30. package/dist/components/ui/{input.tsx → input.js} +2 -2
  31. package/dist/components/ui/{label.tsx → label.js} +6 -6
  32. package/dist/components/ui/{pagination.tsx → pagination.js} +16 -18
  33. package/dist/components/ui/{popover.tsx → popover.js} +8 -8
  34. package/dist/components/ui/radio-group.js +34 -0
  35. package/dist/components/ui/{select.tsx → select.js} +38 -40
  36. package/dist/components/ui/{separator.tsx → separator.js} +5 -5
  37. package/dist/components/ui/{sheet.tsx → sheet.js} +27 -27
  38. package/dist/components/ui/{skeleton.tsx → skeleton.js} +2 -2
  39. package/dist/components/ui/{slider.tsx → slider.js} +9 -9
  40. package/dist/components/ui/{stepper.tsx → stepper.js} +35 -35
  41. package/dist/components/ui/{switch.tsx → switch.js} +7 -7
  42. package/dist/components/ui/{table.tsx → table.js} +9 -9
  43. package/dist/components/ui/{tabs.tsx → tabs.js} +13 -13
  44. package/dist/components/ui/{textarea.tsx → textarea.js} +2 -2
  45. package/dist/components/ui/{tooltip.tsx → tooltip.js} +8 -8
  46. package/dist/helpers/axiosGlobal.js +1 -2
  47. package/dist/hooks/useNotification.js +1 -1
  48. package/dist/index.js +45 -45
  49. package/dist/lib/utils.js +2 -2
  50. package/dist/modules/CoreAuth/classes/CoreAuthBuilder.js +1 -1
  51. package/dist/modules/CoreAuth/context/{AuthContext.tsx → AuthContext.js} +1 -1
  52. package/dist/modules/CoreAuth/index.js +2 -1
  53. package/dist/modules/CoreCustomization/classes/CoreCustomizationBuilder.js +1 -1
  54. package/dist/modules/CoreCustomization/index.js +1 -0
  55. package/dist/modules/CoreOrder/classes/CoreOrderBuilder.js +1 -1
  56. package/dist/modules/CoreOrder/index.js +1 -0
  57. package/dist/modules/CorePayForm/classes/CorePayFormBuilder.js +1 -1
  58. package/dist/modules/CorePayForm/index.js +1 -0
  59. package/dist/modules/CoreProduct/classes/CoreProductBuilder.js +1 -1
  60. package/dist/modules/CoreProduct/index.js +1 -0
  61. package/dist/modules/CoreShipment/classes/CoreShipmentBuilder.js +1 -1
  62. package/dist/modules/CoreShipment/index.js +1 -0
  63. package/dist/modules/CoreShopCart/classes/CoreShopCartBuilder.js +1 -1
  64. package/package.json +2 -7
  65. package/dist/_virtual/index.js +0 -5
  66. package/dist/_virtual/index2.js +0 -3
  67. package/dist/_virtual/jsx-runtime.js +0 -5
  68. package/dist/_virtual/jsx-runtime2.js +0 -3
  69. package/dist/_virtual/react-jsx-runtime.development.js +0 -3
  70. package/dist/_virtual/react-jsx-runtime.production.js +0 -3
  71. package/dist/_virtual/use-sync-external-store-shim.development.js +0 -3
  72. package/dist/_virtual/use-sync-external-store-shim.production.js +0 -3
  73. package/dist/components/common/carousel/CustomCarousel.tsx +0 -26
  74. package/dist/components/common/carousel/CustomCarouselSection.tsx +0 -41
  75. package/dist/components/common/form/CustomFormField.tsx +0 -29
  76. package/dist/components/common/select/CustomSelect.tsx +0 -27
  77. package/dist/components/common/spinner/Spinner.tsx +0 -32
  78. package/dist/components/layouts/CoreBaseLayout.tsx +0 -19
  79. package/dist/components/templates/CoreHomeLayout.tsx +0 -8
  80. package/dist/components/ui/accordion.tsx +0 -44
  81. package/dist/components/ui/radio-group.tsx +0 -34
  82. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -814
  83. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -751
  84. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -350
  85. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -161
  86. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -137
  87. package/dist/node_modules/@radix-ui/number/dist/index.js +0 -6
  88. package/dist/node_modules/@radix-ui/primitive/dist/index.js +0 -11
  89. package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +0 -305
  90. package/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.js +0 -147
  91. package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +0 -25
  92. package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +0 -118
  93. package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +0 -270
  94. package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +0 -145
  95. package/dist/node_modules/@radix-ui/react-collection/dist/index.js +0 -70
  96. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -39
  97. package/dist/node_modules/@radix-ui/react-context/dist/index.js +0 -79
  98. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +0 -321
  99. package/dist/node_modules/@radix-ui/react-direction/dist/index.js +0 -11
  100. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -211
  101. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +0 -267
  102. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +0 -29
  103. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -207
  104. package/dist/node_modules/@radix-ui/react-id/dist/index.js +0 -15
  105. package/dist/node_modules/@radix-ui/react-label/dist/index.js +0 -24
  106. package/dist/node_modules/@radix-ui/react-menu/dist/index.js +0 -834
  107. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +0 -299
  108. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +0 -283
  109. package/dist/node_modules/@radix-ui/react-portal/dist/index.js +0 -17
  110. package/dist/node_modules/@radix-ui/react-presence/dist/index.js +0 -130
  111. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +0 -43
  112. package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +0 -282
  113. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +0 -223
  114. package/dist/node_modules/@radix-ui/react-select/dist/index.js +0 -1156
  115. package/dist/node_modules/@radix-ui/react-separator/dist/index.js +0 -30
  116. package/dist/node_modules/@radix-ui/react-slider/dist/index.js +0 -554
  117. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +0 -99
  118. package/dist/node_modules/@radix-ui/react-switch/dist/index.js +0 -152
  119. package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +0 -187
  120. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +0 -482
  121. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +0 -12
  122. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -70
  123. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +0 -18
  124. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +0 -16
  125. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +0 -7
  126. package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +0 -15
  127. package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +0 -40
  128. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +0 -35
  129. package/dist/node_modules/@stepperize/core/dist/index.js +0 -3
  130. package/dist/node_modules/@stepperize/react/dist/index.js +0 -6
  131. package/dist/node_modules/aria-hidden/dist/es2015/index.js +0 -137
  132. package/dist/node_modules/axios/index.js +0 -25
  133. package/dist/node_modules/axios/lib/adapters/adapters.js +0 -81
  134. package/dist/node_modules/axios/lib/adapters/fetch.js +0 -229
  135. package/dist/node_modules/axios/lib/adapters/xhr.js +0 -199
  136. package/dist/node_modules/axios/lib/axios.js +0 -86
  137. package/dist/node_modules/axios/lib/cancel/CancelToken.js +0 -133
  138. package/dist/node_modules/axios/lib/cancel/CanceledError.js +0 -23
  139. package/dist/node_modules/axios/lib/cancel/isCancel.js +0 -5
  140. package/dist/node_modules/axios/lib/core/Axios.js +0 -238
  141. package/dist/node_modules/axios/lib/core/AxiosError.js +0 -101
  142. package/dist/node_modules/axios/lib/core/AxiosHeaders.js +0 -312
  143. package/dist/node_modules/axios/lib/core/InterceptorManager.js +0 -69
  144. package/dist/node_modules/axios/lib/core/buildFullPath.js +0 -22
  145. package/dist/node_modules/axios/lib/core/dispatchRequest.js +0 -81
  146. package/dist/node_modules/axios/lib/core/mergeConfig.js +0 -106
  147. package/dist/node_modules/axios/lib/core/settle.js +0 -27
  148. package/dist/node_modules/axios/lib/core/transformData.js +0 -28
  149. package/dist/node_modules/axios/lib/defaults/index.js +0 -159
  150. package/dist/node_modules/axios/lib/defaults/transitional.js +0 -7
  151. package/dist/node_modules/axios/lib/env/data.js +0 -3
  152. package/dist/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +0 -56
  153. package/dist/node_modules/axios/lib/helpers/HttpStatusCode.js +0 -71
  154. package/dist/node_modules/axios/lib/helpers/bind.js +0 -7
  155. package/dist/node_modules/axios/lib/helpers/buildURL.js +0 -69
  156. package/dist/node_modules/axios/lib/helpers/combineURLs.js +0 -15
  157. package/dist/node_modules/axios/lib/helpers/composeSignals.js +0 -48
  158. package/dist/node_modules/axios/lib/helpers/cookies.js +0 -43
  159. package/dist/node_modules/axios/lib/helpers/formDataToJSON.js +0 -93
  160. package/dist/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -15
  161. package/dist/node_modules/axios/lib/helpers/isAxiosError.js +0 -14
  162. package/dist/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -16
  163. package/dist/node_modules/axios/lib/helpers/null.js +0 -4
  164. package/dist/node_modules/axios/lib/helpers/parseHeaders.js +0 -55
  165. package/dist/node_modules/axios/lib/helpers/parseProtocol.js +0 -6
  166. package/dist/node_modules/axios/lib/helpers/progressEventReducer.js +0 -46
  167. package/dist/node_modules/axios/lib/helpers/resolveConfig.js +0 -58
  168. package/dist/node_modules/axios/lib/helpers/speedometer.js +0 -53
  169. package/dist/node_modules/axios/lib/helpers/spread.js +0 -28
  170. package/dist/node_modules/axios/lib/helpers/throttle.js +0 -44
  171. package/dist/node_modules/axios/lib/helpers/toFormData.js +0 -219
  172. package/dist/node_modules/axios/lib/helpers/toURLEncodedForm.js +0 -19
  173. package/dist/node_modules/axios/lib/helpers/trackStream.js +0 -88
  174. package/dist/node_modules/axios/lib/helpers/validator.js +0 -99
  175. package/dist/node_modules/axios/lib/platform/browser/classes/Blob.js +0 -3
  176. package/dist/node_modules/axios/lib/platform/browser/classes/FormData.js +0 -3
  177. package/dist/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +0 -5
  178. package/dist/node_modules/axios/lib/platform/browser/index.js +0 -15
  179. package/dist/node_modules/axios/lib/platform/common/utils.js +0 -45
  180. package/dist/node_modules/axios/lib/platform/index.js +0 -9
  181. package/dist/node_modules/axios/lib/utils.js +0 -780
  182. package/dist/node_modules/class-variance-authority/dist/index.js +0 -44
  183. package/dist/node_modules/clsx/dist/clsx.js +0 -3
  184. package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +0 -1669
  185. package/dist/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +0 -37
  186. package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +0 -38
  187. package/dist/node_modules/get-nonce/dist/es2015/index.js +0 -8
  188. package/dist/node_modules/lucide-react/dist/esm/Icon.js +0 -43
  189. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +0 -30
  190. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +0 -20
  191. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left.js +0 -17
  192. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-right.js +0 -17
  193. package/dist/node_modules/lucide-react/dist/esm/icons/check.js +0 -14
  194. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +0 -14
  195. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.js +0 -14
  196. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js +0 -14
  197. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +0 -14
  198. package/dist/node_modules/lucide-react/dist/esm/icons/circle.js +0 -14
  199. package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis.js +0 -18
  200. package/dist/node_modules/lucide-react/dist/esm/icons/x.js +0 -17
  201. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +0 -28
  202. package/dist/node_modules/react/cjs/react-jsx-runtime.development.js +0 -363
  203. package/dist/node_modules/react/cjs/react-jsx-runtime.production.js +0 -44
  204. package/dist/node_modules/react/jsx-runtime.js +0 -19
  205. package/dist/node_modules/react-hook-form/dist/index.esm.js +0 -560
  206. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +0 -9
  207. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +0 -167
  208. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +0 -38
  209. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +0 -21
  210. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +0 -110
  211. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +0 -5
  212. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +0 -7
  213. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +0 -56
  214. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +0 -10
  215. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +0 -31
  216. package/dist/node_modules/react-style-singleton/dist/es2015/component.js +0 -19
  217. package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +0 -25
  218. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +0 -51
  219. package/dist/node_modules/sonner/dist/index.js +0 -299
  220. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +0 -3035
  221. package/dist/node_modules/tslib/tslib.es6.js +0 -56
  222. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +0 -24
  223. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +0 -48
  224. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +0 -42
  225. package/dist/node_modules/use-sidecar/dist/es2015/exports.js +0 -21
  226. package/dist/node_modules/use-sidecar/dist/es2015/medium.js +0 -77
  227. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -106
  228. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -77
  229. package/dist/node_modules/use-sync-external-store/shim/index.js +0 -19
  230. package/dist/node_modules/zustand/esm/react.js +0 -22
  231. package/dist/node_modules/zustand/esm/vanilla.js +0 -24
@@ -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 };