fastapi-rtk 2.9.0 → 2.9.1

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 (221) hide show
  1. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineObjectInput.cjs +2 -2
  2. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/complex/MantineTableControl/MantineTableControl.cjs +6 -11
  3. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Array/ExpandPanelRenderer.cjs +2 -2
  4. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Array/MantineArrayLayout.cjs +3 -5
  5. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/utils/layout.cjs +2 -2
  6. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineObjectInput.mjs +2 -2
  7. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/complex/MantineTableControl/MantineTableControl.mjs +7 -12
  8. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Array/ExpandPanelRenderer.mjs +2 -2
  9. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Array/MantineArrayLayout.mjs +3 -5
  10. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/utils/layout.mjs +2 -2
  11. package/dist/.external/cjs/html-parse-stringify@3.0.1/html-parse-stringify/dist/html-parse-stringify.module.cjs +59 -0
  12. package/dist/.external/cjs/lodash@4.17.23/lodash/_cloneBuffer.cjs +1 -1
  13. package/dist/.external/cjs/lodash@4.17.23/lodash/_freeGlobal.cjs +1 -1
  14. package/dist/.external/cjs/lodash@4.17.23/lodash/_nodeUtil.cjs +1 -1
  15. package/dist/.external/cjs/lodash@4.17.23/lodash/isBuffer.cjs +1 -1
  16. package/dist/.external/cjs/lodash@4.17.23/lodash/lodash.cjs +2 -2
  17. package/dist/.external/cjs/mantine-react-table@2.0.0-beta.9_patch_hash_b9fcaf5fc0698f1949127d6bfb1f154a5bd28d0d1fe_7b4bd73d03bc0c4b3e9706b344be0f5a/mantine-react-table/locales/de/index.cjs +1 -1
  18. package/dist/.external/cjs/mantine-react-table@2.0.0-beta.9_patch_hash_b9fcaf5fc0698f1949127d6bfb1f154a5bd28d0d1fe_7b4bd73d03bc0c4b3e9706b344be0f5a/mantine-react-table/locales/en/index.cjs +1 -1
  19. package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/I18nextProvider.cjs +3 -3
  20. package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/Trans.cjs +48 -0
  21. package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/TransWithoutContext.cjs +331 -0
  22. package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/Translation.cjs +15 -0
  23. package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/context.cjs +32 -2
  24. package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/index.cjs +42 -0
  25. package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/useSSR.cjs +32 -0
  26. package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/useTranslation.cjs +9 -9
  27. package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/utils.cjs +2 -0
  28. package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/withSSR.cjs +23 -0
  29. package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/withTranslation.cjs +35 -0
  30. package/dist/.external/cjs/toposort@2.0.2/toposort/index.cjs +1 -1
  31. package/dist/.external/cjs/void-elements@3.1.0/void-elements/index.cjs +26 -0
  32. package/dist/.external/cjs/yup@1.7.1/yup/index.esm.cjs +2 -789
  33. package/dist/.external/cjs/zustand@5.0.10_@types_react@19.2.9_react@19.2.3/zustand/esm/index.cjs +7 -0
  34. package/dist/.external/esm/html-parse-stringify@3.0.1/html-parse-stringify/dist/html-parse-stringify.module.mjs +60 -0
  35. package/dist/.external/esm/lodash@4.17.23/lodash/_cloneBuffer.mjs +1 -1
  36. package/dist/.external/esm/lodash@4.17.23/lodash/_freeGlobal.mjs +1 -1
  37. package/dist/.external/esm/lodash@4.17.23/lodash/_nodeUtil.mjs +1 -1
  38. package/dist/.external/esm/lodash@4.17.23/lodash/isBuffer.mjs +1 -1
  39. package/dist/.external/esm/lodash@4.17.23/lodash/lodash.mjs +2 -2
  40. package/dist/.external/esm/mantine-react-table@2.0.0-beta.9_patch_hash_b9fcaf5fc0698f1949127d6bfb1f154a5bd28d0d1fe_7b4bd73d03bc0c4b3e9706b344be0f5a/mantine-react-table/locales/de/index.mjs +1 -1
  41. package/dist/.external/esm/mantine-react-table@2.0.0-beta.9_patch_hash_b9fcaf5fc0698f1949127d6bfb1f154a5bd28d0d1fe_7b4bd73d03bc0c4b3e9706b344be0f5a/mantine-react-table/locales/en/index.mjs +1 -1
  42. package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/Trans.mjs +49 -0
  43. package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/TransWithoutContext.mjs +331 -0
  44. package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/Translation.mjs +15 -0
  45. package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/context.mjs +32 -1
  46. package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/index.mjs +42 -0
  47. package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/useSSR.mjs +32 -0
  48. package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/utils.mjs +2 -0
  49. package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/withSSR.mjs +23 -0
  50. package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/withTranslation.mjs +35 -0
  51. package/dist/.external/esm/toposort@2.0.2/toposort/index.mjs +1 -1
  52. package/dist/.external/esm/void-elements@3.1.0/void-elements/index.mjs +26 -0
  53. package/dist/.external/esm/yup@1.7.1/yup/index.esm.mjs +3 -790
  54. package/dist/.external/esm/zustand@5.0.10_@types_react@19.2.9_react@19.2.3/zustand/esm/index.mjs +7 -0
  55. package/dist/.external/esm/zustand@5.0.10_@types_react@19.2.9_react@19.2.3/zustand/esm/react.mjs +5 -5
  56. package/dist/api/cjs/ApiProvider/hooks/useProvideApi.cjs +9 -7
  57. package/dist/api/cjs/ApiProvider/hooks/useProvideForm.cjs +2 -2
  58. package/dist/api/cjs/ApiProvider/hooks/utils/useStreamingData.cjs +2 -2
  59. package/dist/api/cjs/ApiProvider/utils/getValidationSchema.cjs +3 -3
  60. package/dist/api/cjs/Provider/Contexts/LangContext.cjs +2 -4
  61. package/dist/api/cjs/Provider/Provider.cjs +4 -3
  62. package/dist/api/cjs/Provider/hooks/useProvideAuth.cjs +4 -3
  63. package/dist/api/cjs/Provider/hooks/useProvideInfo.cjs +2 -2
  64. package/dist/api/cjs/Provider/hooks/useProvideLang.cjs +9 -7
  65. package/dist/api/cjs/index.cjs +2 -0
  66. package/dist/api/esm/ApiProvider/hooks/useProvideApi.mjs +3 -1
  67. package/dist/api/esm/ApiProvider/hooks/useProvideForm.mjs +2 -2
  68. package/dist/api/esm/ApiProvider/hooks/utils/useStreamingData.mjs +1 -1
  69. package/dist/api/esm/ApiProvider/utils/getValidationSchema.mjs +3 -4
  70. package/dist/api/esm/Provider/Contexts/LangContext.mjs +3 -5
  71. package/dist/api/esm/Provider/Provider.mjs +2 -1
  72. package/dist/api/esm/Provider/hooks/useProvideAuth.mjs +2 -1
  73. package/dist/api/esm/Provider/hooks/useProvideInfo.mjs +1 -1
  74. package/dist/api/esm/Provider/hooks/useProvideLang.mjs +10 -8
  75. package/dist/api/esm/index.mjs +2 -0
  76. package/dist/api/lib/ApiProvider/hooks/types.d.ts +1 -1
  77. package/dist/api/lib/ApiProvider/hooks/useProvideForm.d.ts +2 -1
  78. package/dist/api/lib/ApiProvider/hooks/utils/useStreamingData.d.ts +26 -26
  79. package/dist/api/lib/ApiProvider/types.d.ts +1 -1
  80. package/dist/api/lib/ApiProvider/utils/getValidationSchema.d.ts +1 -1
  81. package/dist/api/lib/Provider/hooks/useProvideAuth.d.ts +3 -3
  82. package/dist/api/lib/Provider/hooks/useProvideInfo.d.ts +1 -1
  83. package/dist/api/lib/Provider/types.d.ts +1 -1
  84. package/dist/api/lib/adapters/types.d.ts +10 -0
  85. package/dist/api/lib/hooks/auth/types.d.ts +1 -1
  86. package/dist/api/lib/index.d.ts +1 -0
  87. package/dist/constants/cjs/index.cjs +0 -5
  88. package/dist/constants/esm/index.mjs +0 -5
  89. package/dist/constants/lib/index.d.ts +1 -6
  90. package/dist/contexts/cjs/_virtual/index5.cjs +6 -0
  91. package/dist/contexts/cjs/index.cjs +4 -0
  92. package/dist/contexts/esm/_virtual/index5.mjs +7 -0
  93. package/dist/contexts/esm/index.mjs +5 -1
  94. package/dist/contexts/lib/index.d.ts +2 -0
  95. package/dist/core/cjs/Dialogs/EditDialog.cjs +1 -2
  96. package/dist/core/cjs/Tables/DataGrid/Toolbar/Filter/FilterMenu.cjs +8 -9
  97. package/dist/core/cjs/Tables/NextGenDataGrid/components/OptimizedMRT_RowSelectColumn/zustand.cjs +2 -2
  98. package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useOptimizations.cjs +1 -2
  99. package/dist/core/cjs/_virtual/index.cjs +25 -3
  100. package/dist/core/cjs/_virtual/index2.cjs +25 -3
  101. package/dist/core/cjs/_virtual/index3.cjs +3 -5
  102. package/dist/core/cjs/_virtual/index4.cjs +2 -2
  103. package/dist/core/cjs/_virtual/index5.cjs +5 -0
  104. package/dist/core/cjs/_virtual/index6.cjs +3 -0
  105. package/dist/{constants/cjs/_virtual/index4.cjs → core/cjs/_virtual/index7.cjs} +2 -2
  106. package/dist/core/cjs/adapters/web/index.cjs +4 -1
  107. package/dist/core/cjs/adapters/web/webLocalizationAdapter.cjs +13 -0
  108. package/dist/core/cjs/index.cjs +10 -5
  109. package/dist/core/esm/Dialogs/EditDialog.mjs +2 -3
  110. package/dist/core/esm/Tables/DataGrid/Toolbar/Filter/FilterMenu.mjs +8 -9
  111. package/dist/core/esm/Tables/NextGenDataGrid/components/OptimizedMRT_RowSelectColumn/zustand.mjs +2 -2
  112. package/dist/core/esm/Tables/NextGenDataGrid/hooks/useOptimizations.mjs +2 -3
  113. package/dist/core/esm/_virtual/index.mjs +25 -3
  114. package/dist/core/esm/_virtual/index2.mjs +25 -3
  115. package/dist/core/esm/_virtual/index3.mjs +2 -5
  116. package/dist/core/esm/_virtual/index4.mjs +2 -2
  117. package/dist/core/esm/_virtual/index5.mjs +5 -0
  118. package/dist/core/esm/_virtual/index6.mjs +2 -0
  119. package/dist/core/esm/_virtual/index7.mjs +4 -0
  120. package/dist/core/esm/adapters/web/index.mjs +4 -1
  121. package/dist/core/esm/adapters/web/webLocalizationAdapter.mjs +13 -0
  122. package/dist/core/esm/index.mjs +3 -4
  123. package/dist/core/lib/Tables/NextGenDataGrid/components/OptimizedMRT_RowSelectColumn/zustand.d.ts +3 -3
  124. package/dist/core/lib/Tables/NextGenDataGrid/types.d.ts +2 -2
  125. package/dist/core/lib/adapters/web/index.d.ts +2 -1
  126. package/dist/core/lib/adapters/web/webLocalizationAdapter.d.ts +2 -0
  127. package/dist/core/lib/index.d.ts +2 -2
  128. package/dist/jsonforms/cjs/MantineInputs/MantineObjectInput.cjs +2 -2
  129. package/dist/jsonforms/cjs/complex/MantineTableControl/MantineTableControl.cjs +6 -11
  130. package/dist/jsonforms/cjs/layouts/Array/ExpandPanelRenderer.cjs +2 -2
  131. package/dist/jsonforms/cjs/layouts/Array/MantineArrayLayout.cjs +3 -5
  132. package/dist/jsonforms/cjs/utils/layout.cjs +2 -2
  133. package/dist/jsonforms/esm/MantineInputs/MantineObjectInput.mjs +2 -2
  134. package/dist/jsonforms/esm/complex/MantineTableControl/MantineTableControl.mjs +7 -12
  135. package/dist/jsonforms/esm/layouts/Array/ExpandPanelRenderer.mjs +2 -2
  136. package/dist/jsonforms/esm/layouts/Array/MantineArrayLayout.mjs +3 -5
  137. package/dist/jsonforms/esm/utils/layout.mjs +2 -2
  138. package/dist/utils/cjs/_virtual/_commonjsHelpers.cjs +4 -0
  139. package/dist/utils/cjs/_virtual/lodash.cjs +6 -3
  140. package/dist/utils/cjs/index.cjs +2 -0
  141. package/dist/utils/esm/_virtual/_commonjsHelpers.mjs +5 -1
  142. package/dist/utils/esm/_virtual/lodash.mjs +3 -0
  143. package/dist/utils/esm/index.mjs +2 -0
  144. package/dist/utils/lib/index.d.ts +2 -0
  145. package/dist/zustand/cjs/index.cjs +2 -0
  146. package/dist/zustand/esm/index.mjs +3 -1
  147. package/dist/zustand/lib/index.d.ts +1 -0
  148. package/package.json +3 -2
  149. package/dist/.bundled/jsonforms/cjs/_virtual/lodash.cjs +0 -5
  150. package/dist/.bundled/jsonforms/cjs/_virtual/lodash2.cjs +0 -4
  151. package/dist/.bundled/jsonforms/cjs/_virtual/map.cjs +0 -6
  152. package/dist/.bundled/jsonforms/cjs/_virtual/union.cjs +0 -6
  153. package/dist/.bundled/jsonforms/esm/_virtual/lodash.mjs +0 -5
  154. package/dist/.bundled/jsonforms/esm/_virtual/lodash2.mjs +0 -4
  155. package/dist/.bundled/jsonforms/esm/_virtual/map.mjs +0 -7
  156. package/dist/.bundled/jsonforms/esm/_virtual/union.mjs +0 -7
  157. package/dist/.external/cjs/lodash@4.17.23/lodash/_arrayIncludesWith.cjs +0 -20
  158. package/dist/.external/cjs/lodash@4.17.23/lodash/_baseMap.cjs +0 -21
  159. package/dist/.external/cjs/lodash@4.17.23/lodash/_baseUniq.cjs +0 -59
  160. package/dist/.external/cjs/lodash@4.17.23/lodash/_createSet.cjs +0 -19
  161. package/dist/.external/cjs/lodash@4.17.23/lodash/map.cjs +0 -20
  162. package/dist/.external/cjs/lodash@4.17.23/lodash/union.cjs +0 -19
  163. package/dist/.external/esm/lodash@4.17.23/lodash/_arrayIncludesWith.mjs +0 -20
  164. package/dist/.external/esm/lodash@4.17.23/lodash/_baseMap.mjs +0 -21
  165. package/dist/.external/esm/lodash@4.17.23/lodash/_baseUniq.mjs +0 -59
  166. package/dist/.external/esm/lodash@4.17.23/lodash/_createSet.mjs +0 -19
  167. package/dist/.external/esm/lodash@4.17.23/lodash/map.mjs +0 -20
  168. package/dist/.external/esm/lodash@4.17.23/lodash/union.mjs +0 -19
  169. package/dist/constants/cjs/_virtual/index.cjs +0 -27
  170. package/dist/constants/cjs/_virtual/index2.cjs +0 -27
  171. package/dist/constants/cjs/_virtual/index3.cjs +0 -4
  172. package/dist/constants/esm/_virtual/index.mjs +0 -27
  173. package/dist/constants/esm/_virtual/index2.mjs +0 -27
  174. package/dist/constants/esm/_virtual/index3.mjs +0 -4
  175. package/dist/constants/esm/_virtual/index4.mjs +0 -4
  176. package/dist/core/cjs/_virtual/_commonjsHelpers.cjs +0 -8
  177. package/dist/core/cjs/_virtual/_nodeUtil.cjs +0 -4
  178. package/dist/core/cjs/_virtual/isBuffer.cjs +0 -4
  179. package/dist/core/cjs/_virtual/isEqual.cjs +0 -6
  180. package/dist/core/cjs/_virtual/lodash.cjs +0 -5
  181. package/dist/core/cjs/_virtual/lodash2.cjs +0 -4
  182. package/dist/core/esm/_virtual/_commonjsHelpers.mjs +0 -8
  183. package/dist/core/esm/_virtual/_nodeUtil.mjs +0 -4
  184. package/dist/core/esm/_virtual/isBuffer.mjs +0 -4
  185. package/dist/core/esm/_virtual/isEqual.mjs +0 -7
  186. package/dist/core/esm/_virtual/lodash.mjs +0 -5
  187. package/dist/core/esm/_virtual/lodash2.mjs +0 -4
  188. package/dist/jsonforms/cjs/_virtual/_cloneBuffer.cjs +0 -4
  189. package/dist/jsonforms/cjs/_virtual/_commonjsHelpers.cjs +0 -8
  190. package/dist/jsonforms/cjs/_virtual/_nodeUtil.cjs +0 -4
  191. package/dist/jsonforms/cjs/_virtual/isBuffer.cjs +0 -4
  192. package/dist/jsonforms/cjs/_virtual/isEmpty.cjs +0 -6
  193. package/dist/jsonforms/cjs/_virtual/lodash.cjs +0 -5
  194. package/dist/jsonforms/cjs/_virtual/lodash2.cjs +0 -4
  195. package/dist/jsonforms/cjs/_virtual/map.cjs +0 -6
  196. package/dist/jsonforms/cjs/_virtual/merge.cjs +0 -6
  197. package/dist/jsonforms/cjs/_virtual/range.cjs +0 -6
  198. package/dist/jsonforms/cjs/_virtual/startCase.cjs +0 -6
  199. package/dist/jsonforms/cjs/_virtual/union.cjs +0 -6
  200. package/dist/jsonforms/esm/_virtual/_cloneBuffer.mjs +0 -4
  201. package/dist/jsonforms/esm/_virtual/_commonjsHelpers.mjs +0 -8
  202. package/dist/jsonforms/esm/_virtual/_nodeUtil.mjs +0 -4
  203. package/dist/jsonforms/esm/_virtual/isBuffer.mjs +0 -4
  204. package/dist/jsonforms/esm/_virtual/isEmpty.mjs +0 -7
  205. package/dist/jsonforms/esm/_virtual/lodash.mjs +0 -5
  206. package/dist/jsonforms/esm/_virtual/lodash2.mjs +0 -4
  207. package/dist/jsonforms/esm/_virtual/map.mjs +0 -7
  208. package/dist/jsonforms/esm/_virtual/merge.mjs +0 -7
  209. package/dist/jsonforms/esm/_virtual/range.mjs +0 -7
  210. package/dist/jsonforms/esm/_virtual/startCase.mjs +0 -7
  211. package/dist/jsonforms/esm/_virtual/union.mjs +0 -7
  212. /package/dist/{api → contexts}/cjs/_virtual/_commonjsHelpers.cjs +0 -0
  213. /package/dist/{api → contexts}/cjs/_virtual/index.cjs +0 -0
  214. /package/dist/{api → contexts}/cjs/_virtual/index2.cjs +0 -0
  215. /package/dist/{api → contexts}/cjs/_virtual/index3.cjs +0 -0
  216. /package/dist/{api → contexts}/cjs/_virtual/index4.cjs +0 -0
  217. /package/dist/{api → contexts}/esm/_virtual/_commonjsHelpers.mjs +0 -0
  218. /package/dist/{api → contexts}/esm/_virtual/index.mjs +0 -0
  219. /package/dist/{api → contexts}/esm/_virtual/index2.mjs +0 -0
  220. /package/dist/{api → contexts}/esm/_virtual/index3.mjs +0 -0
  221. /package/dist/{api → contexts}/esm/_virtual/index4.mjs +0 -0
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../../../../core/cjs/_virtual/index.cjs");
4
- const index$1 = require("../../../../core/cjs/_virtual/index2.cjs");
5
- const index$2 = require("../../../../core/cjs/_virtual/index3.cjs");
3
+ const index = require("../../../../core/cjs/_virtual/index5.cjs");
4
+ require("../../../../core/cjs/_virtual/index6.cjs");
6
5
  const toString = Object.prototype.toString;
7
6
  const errorToString = Error.prototype.toString;
8
7
  const regExpToString = RegExp.prototype.toString;
@@ -1139,22 +1138,6 @@ for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At
1139
1138
  };
1140
1139
  for (const alias of ["equals", "is"]) Schema.prototype[alias] = Schema.prototype.oneOf;
1141
1140
  for (const alias of ["not", "nope"]) Schema.prototype[alias] = Schema.prototype.notOneOf;
1142
- const returnsTrue = () => true;
1143
- function create$8(spec) {
1144
- return new MixedSchema(spec);
1145
- }
1146
- class MixedSchema extends Schema {
1147
- constructor(spec) {
1148
- super(typeof spec === "function" ? {
1149
- type: "mixed",
1150
- check: spec
1151
- } : Object.assign({
1152
- type: "mixed",
1153
- check: returnsTrue
1154
- }, spec));
1155
- }
1156
- }
1157
- create$8.prototype = MixedSchema.prototype;
1158
1141
  const isoReg = /^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;
1159
1142
  function parseIsoDate(date2) {
1160
1143
  const struct = parseDateStruct(date2);
@@ -1194,223 +1177,6 @@ function parseDateStruct(date2) {
1194
1177
  function toNumber(str, defaultValue = 0) {
1195
1178
  return Number(str) || defaultValue;
1196
1179
  }
1197
- let rEmail = (
1198
- // eslint-disable-next-line
1199
- /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/
1200
- );
1201
- let rUrl = (
1202
- // eslint-disable-next-line
1203
- /^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i
1204
- );
1205
- let rUUID = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
1206
- let yearMonthDay = "^\\d{4}-\\d{2}-\\d{2}";
1207
- let hourMinuteSecond = "\\d{2}:\\d{2}:\\d{2}";
1208
- let zOrOffset = "(([+-]\\d{2}(:?\\d{2})?)|Z)";
1209
- let rIsoDateTime = new RegExp(`${yearMonthDay}T${hourMinuteSecond}(\\.\\d+)?${zOrOffset}$`);
1210
- let isTrimmed = (value) => isAbsent(value) || value === value.trim();
1211
- let objStringTag = {}.toString();
1212
- function create$6() {
1213
- return new StringSchema();
1214
- }
1215
- class StringSchema extends Schema {
1216
- constructor() {
1217
- super({
1218
- type: "string",
1219
- check(value) {
1220
- if (value instanceof String) value = value.valueOf();
1221
- return typeof value === "string";
1222
- }
1223
- });
1224
- this.withMutation(() => {
1225
- this.transform((value, _raw) => {
1226
- if (!this.spec.coerce || this.isType(value)) return value;
1227
- if (Array.isArray(value)) return value;
1228
- const strValue = value != null && value.toString ? value.toString() : value;
1229
- if (strValue === objStringTag) return value;
1230
- return strValue;
1231
- });
1232
- });
1233
- }
1234
- required(message) {
1235
- return super.required(message).withMutation((schema) => schema.test({
1236
- message: message || mixed.required,
1237
- name: "required",
1238
- skipAbsent: true,
1239
- test: (value) => !!value.length
1240
- }));
1241
- }
1242
- notRequired() {
1243
- return super.notRequired().withMutation((schema) => {
1244
- schema.tests = schema.tests.filter((t) => t.OPTIONS.name !== "required");
1245
- return schema;
1246
- });
1247
- }
1248
- length(length, message = string.length) {
1249
- return this.test({
1250
- message,
1251
- name: "length",
1252
- exclusive: true,
1253
- params: {
1254
- length
1255
- },
1256
- skipAbsent: true,
1257
- test(value) {
1258
- return value.length === this.resolve(length);
1259
- }
1260
- });
1261
- }
1262
- min(min, message = string.min) {
1263
- return this.test({
1264
- message,
1265
- name: "min",
1266
- exclusive: true,
1267
- params: {
1268
- min
1269
- },
1270
- skipAbsent: true,
1271
- test(value) {
1272
- return value.length >= this.resolve(min);
1273
- }
1274
- });
1275
- }
1276
- max(max, message = string.max) {
1277
- return this.test({
1278
- name: "max",
1279
- exclusive: true,
1280
- message,
1281
- params: {
1282
- max
1283
- },
1284
- skipAbsent: true,
1285
- test(value) {
1286
- return value.length <= this.resolve(max);
1287
- }
1288
- });
1289
- }
1290
- matches(regex, options) {
1291
- let excludeEmptyString = false;
1292
- let message;
1293
- let name;
1294
- if (options) {
1295
- if (typeof options === "object") {
1296
- ({
1297
- excludeEmptyString = false,
1298
- message,
1299
- name
1300
- } = options);
1301
- } else {
1302
- message = options;
1303
- }
1304
- }
1305
- return this.test({
1306
- name: name || "matches",
1307
- message: message || string.matches,
1308
- params: {
1309
- regex
1310
- },
1311
- skipAbsent: true,
1312
- test: (value) => value === "" && excludeEmptyString || value.search(regex) !== -1
1313
- });
1314
- }
1315
- email(message = string.email) {
1316
- return this.matches(rEmail, {
1317
- name: "email",
1318
- message,
1319
- excludeEmptyString: true
1320
- });
1321
- }
1322
- url(message = string.url) {
1323
- return this.matches(rUrl, {
1324
- name: "url",
1325
- message,
1326
- excludeEmptyString: true
1327
- });
1328
- }
1329
- uuid(message = string.uuid) {
1330
- return this.matches(rUUID, {
1331
- name: "uuid",
1332
- message,
1333
- excludeEmptyString: false
1334
- });
1335
- }
1336
- datetime(options) {
1337
- let message = "";
1338
- let allowOffset;
1339
- let precision;
1340
- if (options) {
1341
- if (typeof options === "object") {
1342
- ({
1343
- message = "",
1344
- allowOffset = false,
1345
- precision = void 0
1346
- } = options);
1347
- } else {
1348
- message = options;
1349
- }
1350
- }
1351
- return this.matches(rIsoDateTime, {
1352
- name: "datetime",
1353
- message: message || string.datetime,
1354
- excludeEmptyString: true
1355
- }).test({
1356
- name: "datetime_offset",
1357
- message: message || string.datetime_offset,
1358
- params: {
1359
- allowOffset
1360
- },
1361
- skipAbsent: true,
1362
- test: (value) => {
1363
- if (!value || allowOffset) return true;
1364
- const struct = parseDateStruct(value);
1365
- if (!struct) return false;
1366
- return !!struct.z;
1367
- }
1368
- }).test({
1369
- name: "datetime_precision",
1370
- message: message || string.datetime_precision,
1371
- params: {
1372
- precision
1373
- },
1374
- skipAbsent: true,
1375
- test: (value) => {
1376
- if (!value || precision == void 0) return true;
1377
- const struct = parseDateStruct(value);
1378
- if (!struct) return false;
1379
- return struct.precision === precision;
1380
- }
1381
- });
1382
- }
1383
- //-- transforms --
1384
- ensure() {
1385
- return this.default("").transform((val) => val === null ? "" : val);
1386
- }
1387
- trim(message = string.trim) {
1388
- return this.transform((val) => val != null ? val.trim() : val).test({
1389
- message,
1390
- name: "trim",
1391
- test: isTrimmed
1392
- });
1393
- }
1394
- lowercase(message = string.lowercase) {
1395
- return this.transform((value) => !isAbsent(value) ? value.toLowerCase() : value).test({
1396
- message,
1397
- name: "string_case",
1398
- exclusive: true,
1399
- skipAbsent: true,
1400
- test: (value) => isAbsent(value) || value === value.toLowerCase()
1401
- });
1402
- }
1403
- uppercase(message = string.uppercase) {
1404
- return this.transform((value) => !isAbsent(value) ? value.toUpperCase() : value).test({
1405
- message,
1406
- name: "string_case",
1407
- exclusive: true,
1408
- skipAbsent: true,
1409
- test: (value) => isAbsent(value) || value === value.toUpperCase()
1410
- });
1411
- }
1412
- }
1413
- create$6.prototype = StringSchema.prototype;
1414
1180
  let invalidDate = /* @__PURE__ */ new Date("");
1415
1181
  let isDate = (obj) => Object.prototype.toString.call(obj) === "[object Date]";
1416
1182
  class DateSchema extends Schema {
@@ -1472,562 +1238,9 @@ class DateSchema extends Schema {
1472
1238
  }
1473
1239
  }
1474
1240
  DateSchema.INVALID_DATE = invalidDate;
1475
- function sortFields(fields, excludedEdges = []) {
1476
- let edges = [];
1477
- let nodes = /* @__PURE__ */ new Set();
1478
- let excludes = new Set(excludedEdges.map(([a, b]) => `${a}-${b}`));
1479
- function addNode(depPath, key) {
1480
- let node = index.propertyExprExports.split(depPath)[0];
1481
- nodes.add(node);
1482
- if (!excludes.has(`${key}-${node}`)) edges.push([key, node]);
1483
- }
1484
- for (const key of Object.keys(fields)) {
1485
- let value = fields[key];
1486
- nodes.add(key);
1487
- if (Reference.isRef(value) && value.isSibling) addNode(value.path, key);
1488
- else if (isSchema(value) && "deps" in value) value.deps.forEach((path) => addNode(path, key));
1489
- }
1490
- return index$2.array(Array.from(nodes), edges).reverse();
1491
- }
1492
- function findIndex(arr, err) {
1493
- let idx = Infinity;
1494
- arr.some((key, ii) => {
1495
- var _err$path;
1496
- if ((_err$path = err.path) != null && _err$path.includes(key)) {
1497
- idx = ii;
1498
- return true;
1499
- }
1500
- });
1501
- return idx;
1502
- }
1503
- function sortByKeyOrder(keys) {
1504
- return (a, b) => {
1505
- return findIndex(keys, a) - findIndex(keys, b);
1506
- };
1507
- }
1508
- const parseJson = (value, _, schema) => {
1509
- if (typeof value !== "string") {
1510
- return value;
1511
- }
1512
- let parsed = value;
1513
- try {
1514
- parsed = JSON.parse(value);
1515
- } catch (err) {
1516
- }
1517
- return schema.isType(parsed) ? parsed : value;
1518
- };
1519
- function deepPartial(schema) {
1520
- if ("fields" in schema) {
1521
- const partial = {};
1522
- for (const [key, fieldSchema] of Object.entries(schema.fields)) {
1523
- partial[key] = deepPartial(fieldSchema);
1524
- }
1525
- return schema.setFields(partial);
1526
- }
1527
- if (schema.type === "array") {
1528
- const nextArray = schema.optional();
1529
- if (nextArray.innerType) nextArray.innerType = deepPartial(nextArray.innerType);
1530
- return nextArray;
1531
- }
1532
- if (schema.type === "tuple") {
1533
- return schema.optional().clone({
1534
- types: schema.spec.types.map(deepPartial)
1535
- });
1536
- }
1537
- if ("optional" in schema) {
1538
- return schema.optional();
1539
- }
1540
- return schema;
1541
- }
1542
- const deepHas = (obj, p) => {
1543
- const path = [...index.propertyExprExports.normalizePath(p)];
1544
- if (path.length === 1) return path[0] in obj;
1545
- let last = path.pop();
1546
- let parent = index.propertyExprExports.getter(index.propertyExprExports.join(path), true)(obj);
1547
- return !!(parent && last in parent);
1548
- };
1549
- let isObject = (obj) => Object.prototype.toString.call(obj) === "[object Object]";
1550
- function unknown(ctx, value) {
1551
- let known = Object.keys(ctx.fields);
1552
- return Object.keys(value).filter((key) => known.indexOf(key) === -1);
1553
- }
1554
- const defaultSort = sortByKeyOrder([]);
1555
- function create$3(spec) {
1556
- return new ObjectSchema(spec);
1557
- }
1558
- class ObjectSchema extends Schema {
1559
- constructor(spec) {
1560
- super({
1561
- type: "object",
1562
- check(value) {
1563
- return isObject(value) || typeof value === "function";
1564
- }
1565
- });
1566
- this.fields = /* @__PURE__ */ Object.create(null);
1567
- this._sortErrors = defaultSort;
1568
- this._nodes = [];
1569
- this._excludedEdges = [];
1570
- this.withMutation(() => {
1571
- if (spec) {
1572
- this.shape(spec);
1573
- }
1574
- });
1575
- }
1576
- _cast(_value, options = {}) {
1577
- var _options$stripUnknown;
1578
- let value = super._cast(_value, options);
1579
- if (value === void 0) return this.getDefault(options);
1580
- if (!this._typeCheck(value)) return value;
1581
- let fields = this.fields;
1582
- let strip = (_options$stripUnknown = options.stripUnknown) != null ? _options$stripUnknown : this.spec.noUnknown;
1583
- let props = [].concat(this._nodes, Object.keys(value).filter((v) => !this._nodes.includes(v)));
1584
- let intermediateValue = {};
1585
- let innerOptions = Object.assign({}, options, {
1586
- parent: intermediateValue,
1587
- __validating: options.__validating || false
1588
- });
1589
- let isChanged = false;
1590
- for (const prop of props) {
1591
- let field = fields[prop];
1592
- let exists = prop in value;
1593
- let inputValue = value[prop];
1594
- if (field) {
1595
- let fieldValue;
1596
- innerOptions.path = (options.path ? `${options.path}.` : "") + prop;
1597
- field = field.resolve({
1598
- value: inputValue,
1599
- context: options.context,
1600
- parent: intermediateValue
1601
- });
1602
- let fieldSpec = field instanceof Schema ? field.spec : void 0;
1603
- let strict = fieldSpec == null ? void 0 : fieldSpec.strict;
1604
- if (fieldSpec != null && fieldSpec.strip) {
1605
- isChanged = isChanged || prop in value;
1606
- continue;
1607
- }
1608
- fieldValue = !options.__validating || !strict ? field.cast(inputValue, innerOptions) : inputValue;
1609
- if (fieldValue !== void 0) {
1610
- intermediateValue[prop] = fieldValue;
1611
- }
1612
- } else if (exists && !strip) {
1613
- intermediateValue[prop] = inputValue;
1614
- }
1615
- if (exists !== prop in intermediateValue || intermediateValue[prop] !== inputValue) {
1616
- isChanged = true;
1617
- }
1618
- }
1619
- return isChanged ? intermediateValue : value;
1620
- }
1621
- _validate(_value, options = {}, panic, next) {
1622
- let {
1623
- from = [],
1624
- originalValue = _value,
1625
- recursive = this.spec.recursive
1626
- } = options;
1627
- options.from = [{
1628
- schema: this,
1629
- value: originalValue
1630
- }, ...from];
1631
- options.__validating = true;
1632
- options.originalValue = originalValue;
1633
- super._validate(_value, options, panic, (objectErrors, value) => {
1634
- if (!recursive || !isObject(value)) {
1635
- next(objectErrors, value);
1636
- return;
1637
- }
1638
- originalValue = originalValue || value;
1639
- let tests = [];
1640
- for (let key of this._nodes) {
1641
- let field = this.fields[key];
1642
- if (!field || Reference.isRef(field)) {
1643
- continue;
1644
- }
1645
- tests.push(field.asNestedTest({
1646
- options,
1647
- key,
1648
- parent: value,
1649
- parentPath: options.path,
1650
- originalParent: originalValue
1651
- }));
1652
- }
1653
- this.runTests({
1654
- tests,
1655
- value,
1656
- originalValue,
1657
- options
1658
- }, panic, (fieldErrors) => {
1659
- next(fieldErrors.sort(this._sortErrors).concat(objectErrors), value);
1660
- });
1661
- });
1662
- }
1663
- clone(spec) {
1664
- const next = super.clone(spec);
1665
- next.fields = Object.assign({}, this.fields);
1666
- next._nodes = this._nodes;
1667
- next._excludedEdges = this._excludedEdges;
1668
- next._sortErrors = this._sortErrors;
1669
- return next;
1670
- }
1671
- concat(schema) {
1672
- let next = super.concat(schema);
1673
- let nextFields = next.fields;
1674
- for (let [field, schemaOrRef] of Object.entries(this.fields)) {
1675
- const target = nextFields[field];
1676
- nextFields[field] = target === void 0 ? schemaOrRef : target;
1677
- }
1678
- return next.withMutation((s) => (
1679
- // XXX: excludes here is wrong
1680
- s.setFields(nextFields, [...this._excludedEdges, ...schema._excludedEdges])
1681
- ));
1682
- }
1683
- _getDefault(options) {
1684
- if ("default" in this.spec) {
1685
- return super._getDefault(options);
1686
- }
1687
- if (!this._nodes.length) {
1688
- return void 0;
1689
- }
1690
- let dft = {};
1691
- this._nodes.forEach((key) => {
1692
- var _innerOptions;
1693
- const field = this.fields[key];
1694
- let innerOptions = options;
1695
- if ((_innerOptions = innerOptions) != null && _innerOptions.value) {
1696
- innerOptions = Object.assign({}, innerOptions, {
1697
- parent: innerOptions.value,
1698
- value: innerOptions.value[key]
1699
- });
1700
- }
1701
- dft[key] = field && "getDefault" in field ? field.getDefault(innerOptions) : void 0;
1702
- });
1703
- return dft;
1704
- }
1705
- setFields(shape, excludedEdges) {
1706
- let next = this.clone();
1707
- next.fields = shape;
1708
- next._nodes = sortFields(shape, excludedEdges);
1709
- next._sortErrors = sortByKeyOrder(Object.keys(shape));
1710
- if (excludedEdges) next._excludedEdges = excludedEdges;
1711
- return next;
1712
- }
1713
- shape(additions, excludes = []) {
1714
- return this.clone().withMutation((next) => {
1715
- let edges = next._excludedEdges;
1716
- if (excludes.length) {
1717
- if (!Array.isArray(excludes[0])) excludes = [excludes];
1718
- edges = [...next._excludedEdges, ...excludes];
1719
- }
1720
- return next.setFields(Object.assign(next.fields, additions), edges);
1721
- });
1722
- }
1723
- partial() {
1724
- const partial = {};
1725
- for (const [key, schema] of Object.entries(this.fields)) {
1726
- partial[key] = "optional" in schema && schema.optional instanceof Function ? schema.optional() : schema;
1727
- }
1728
- return this.setFields(partial);
1729
- }
1730
- deepPartial() {
1731
- const next = deepPartial(this);
1732
- return next;
1733
- }
1734
- pick(keys) {
1735
- const picked = {};
1736
- for (const key of keys) {
1737
- if (this.fields[key]) picked[key] = this.fields[key];
1738
- }
1739
- return this.setFields(picked, this._excludedEdges.filter(([a, b]) => keys.includes(a) && keys.includes(b)));
1740
- }
1741
- omit(keys) {
1742
- const remaining = [];
1743
- for (const key of Object.keys(this.fields)) {
1744
- if (keys.includes(key)) continue;
1745
- remaining.push(key);
1746
- }
1747
- return this.pick(remaining);
1748
- }
1749
- from(from, to, alias) {
1750
- let fromGetter = index.propertyExprExports.getter(from, true);
1751
- return this.transform((obj) => {
1752
- if (!obj) return obj;
1753
- let newObj = obj;
1754
- if (deepHas(obj, from)) {
1755
- newObj = Object.assign({}, obj);
1756
- if (!alias) delete newObj[from];
1757
- newObj[to] = fromGetter(obj);
1758
- }
1759
- return newObj;
1760
- });
1761
- }
1762
- /** Parse an input JSON string to an object */
1763
- json() {
1764
- return this.transform(parseJson);
1765
- }
1766
- /**
1767
- * Similar to `noUnknown` but only validates that an object is the right shape without stripping the unknown keys
1768
- */
1769
- exact(message) {
1770
- return this.test({
1771
- name: "exact",
1772
- exclusive: true,
1773
- message: message || object.exact,
1774
- test(value) {
1775
- if (value == null) return true;
1776
- const unknownKeys = unknown(this.schema, value);
1777
- return unknownKeys.length === 0 || this.createError({
1778
- params: {
1779
- properties: unknownKeys.join(", ")
1780
- }
1781
- });
1782
- }
1783
- });
1784
- }
1785
- stripUnknown() {
1786
- return this.clone({
1787
- noUnknown: true
1788
- });
1789
- }
1790
- noUnknown(noAllow = true, message = object.noUnknown) {
1791
- if (typeof noAllow !== "boolean") {
1792
- message = noAllow;
1793
- noAllow = true;
1794
- }
1795
- let next = this.test({
1796
- name: "noUnknown",
1797
- exclusive: true,
1798
- message,
1799
- test(value) {
1800
- if (value == null) return true;
1801
- const unknownKeys = unknown(this.schema, value);
1802
- return !noAllow || unknownKeys.length === 0 || this.createError({
1803
- params: {
1804
- unknown: unknownKeys.join(", ")
1805
- }
1806
- });
1807
- }
1808
- });
1809
- next.spec.noUnknown = noAllow;
1810
- return next;
1811
- }
1812
- unknown(allow = true, message = object.noUnknown) {
1813
- return this.noUnknown(!allow, message);
1814
- }
1815
- transformKeys(fn) {
1816
- return this.transform((obj) => {
1817
- if (!obj) return obj;
1818
- const result = {};
1819
- for (const key of Object.keys(obj)) result[fn(key)] = obj[key];
1820
- return result;
1821
- });
1822
- }
1823
- camelCase() {
1824
- return this.transformKeys(index$1.tinyCaseExports.camelCase);
1825
- }
1826
- snakeCase() {
1827
- return this.transformKeys(index$1.tinyCaseExports.snakeCase);
1828
- }
1829
- constantCase() {
1830
- return this.transformKeys((key) => index$1.tinyCaseExports.snakeCase(key).toUpperCase());
1831
- }
1832
- describe(options) {
1833
- const next = (options ? this.resolve(options) : this).clone();
1834
- const base = super.describe(options);
1835
- base.fields = {};
1836
- for (const [key, value] of Object.entries(next.fields)) {
1837
- var _innerOptions2;
1838
- let innerOptions = options;
1839
- if ((_innerOptions2 = innerOptions) != null && _innerOptions2.value) {
1840
- innerOptions = Object.assign({}, innerOptions, {
1841
- parent: innerOptions.value,
1842
- value: innerOptions.value[key]
1843
- });
1844
- }
1845
- base.fields[key] = value.describe(innerOptions);
1846
- }
1847
- return base;
1848
- }
1849
- }
1850
- create$3.prototype = ObjectSchema.prototype;
1851
- function create$2(type) {
1852
- return new ArraySchema(type);
1853
- }
1854
- class ArraySchema extends Schema {
1855
- constructor(type) {
1856
- super({
1857
- type: "array",
1858
- spec: {
1859
- types: type
1860
- },
1861
- check(v) {
1862
- return Array.isArray(v);
1863
- }
1864
- });
1865
- this.innerType = void 0;
1866
- this.innerType = type;
1867
- }
1868
- _cast(_value, _opts) {
1869
- const value = super._cast(_value, _opts);
1870
- if (!this._typeCheck(value) || !this.innerType) {
1871
- return value;
1872
- }
1873
- let isChanged = false;
1874
- const castArray = value.map((v, idx) => {
1875
- const castElement = this.innerType.cast(v, Object.assign({}, _opts, {
1876
- path: `${_opts.path || ""}[${idx}]`,
1877
- parent: value,
1878
- originalValue: v,
1879
- value: v,
1880
- index: idx
1881
- }));
1882
- if (castElement !== v) {
1883
- isChanged = true;
1884
- }
1885
- return castElement;
1886
- });
1887
- return isChanged ? castArray : value;
1888
- }
1889
- _validate(_value, options = {}, panic, next) {
1890
- var _options$recursive;
1891
- let innerType = this.innerType;
1892
- let recursive = (_options$recursive = options.recursive) != null ? _options$recursive : this.spec.recursive;
1893
- options.originalValue != null ? options.originalValue : _value;
1894
- super._validate(_value, options, panic, (arrayErrors, value) => {
1895
- var _options$originalValu2;
1896
- if (!recursive || !innerType || !this._typeCheck(value)) {
1897
- next(arrayErrors, value);
1898
- return;
1899
- }
1900
- let tests = new Array(value.length);
1901
- for (let index2 = 0; index2 < value.length; index2++) {
1902
- var _options$originalValu;
1903
- tests[index2] = innerType.asNestedTest({
1904
- options,
1905
- index: index2,
1906
- parent: value,
1907
- parentPath: options.path,
1908
- originalParent: (_options$originalValu = options.originalValue) != null ? _options$originalValu : _value
1909
- });
1910
- }
1911
- this.runTests({
1912
- value,
1913
- tests,
1914
- originalValue: (_options$originalValu2 = options.originalValue) != null ? _options$originalValu2 : _value,
1915
- options
1916
- }, panic, (innerTypeErrors) => next(innerTypeErrors.concat(arrayErrors), value));
1917
- });
1918
- }
1919
- clone(spec) {
1920
- const next = super.clone(spec);
1921
- next.innerType = this.innerType;
1922
- return next;
1923
- }
1924
- /** Parse an input JSON string to an object */
1925
- json() {
1926
- return this.transform(parseJson);
1927
- }
1928
- concat(schema) {
1929
- let next = super.concat(schema);
1930
- next.innerType = this.innerType;
1931
- if (schema.innerType)
1932
- next.innerType = next.innerType ? (
1933
- // @ts-expect-error Lazy doesn't have concat and will break
1934
- next.innerType.concat(schema.innerType)
1935
- ) : schema.innerType;
1936
- return next;
1937
- }
1938
- of(schema) {
1939
- let next = this.clone();
1940
- if (!isSchema(schema)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema));
1941
- next.innerType = schema;
1942
- next.spec = Object.assign({}, next.spec, {
1943
- types: schema
1944
- });
1945
- return next;
1946
- }
1947
- length(length, message = array.length) {
1948
- return this.test({
1949
- message,
1950
- name: "length",
1951
- exclusive: true,
1952
- params: {
1953
- length
1954
- },
1955
- skipAbsent: true,
1956
- test(value) {
1957
- return value.length === this.resolve(length);
1958
- }
1959
- });
1960
- }
1961
- min(min, message) {
1962
- message = message || array.min;
1963
- return this.test({
1964
- message,
1965
- name: "min",
1966
- exclusive: true,
1967
- params: {
1968
- min
1969
- },
1970
- skipAbsent: true,
1971
- // FIXME(ts): Array<typeof T>
1972
- test(value) {
1973
- return value.length >= this.resolve(min);
1974
- }
1975
- });
1976
- }
1977
- max(max, message) {
1978
- message = message || array.max;
1979
- return this.test({
1980
- message,
1981
- name: "max",
1982
- exclusive: true,
1983
- params: {
1984
- max
1985
- },
1986
- skipAbsent: true,
1987
- test(value) {
1988
- return value.length <= this.resolve(max);
1989
- }
1990
- });
1991
- }
1992
- ensure() {
1993
- return this.default(() => []).transform((val, original) => {
1994
- if (this._typeCheck(val)) return val;
1995
- return original == null ? [] : [].concat(original);
1996
- });
1997
- }
1998
- compact(rejector) {
1999
- let reject = !rejector ? (v) => !!v : (v, i, a) => !rejector(v, i, a);
2000
- return this.transform((values) => values != null ? values.filter(reject) : values);
2001
- }
2002
- describe(options) {
2003
- const next = (options ? this.resolve(options) : this).clone();
2004
- const base = super.describe(options);
2005
- if (next.innerType) {
2006
- var _innerOptions;
2007
- let innerOptions = options;
2008
- if ((_innerOptions = innerOptions) != null && _innerOptions.value) {
2009
- innerOptions = Object.assign({}, innerOptions, {
2010
- parent: innerOptions.value,
2011
- value: innerOptions.value[0]
2012
- });
2013
- }
2014
- base.innerType = next.innerType.describe(innerOptions);
2015
- }
2016
- return base;
2017
- }
2018
- }
2019
- create$2.prototype = ArraySchema.prototype;
2020
- exports.ArraySchema = ArraySchema;
2021
1241
  exports.DateSchema = DateSchema;
2022
- exports.MixedSchema = MixedSchema;
2023
- exports.ObjectSchema = ObjectSchema;
2024
1242
  exports.Schema = Schema;
2025
- exports.StringSchema = StringSchema;
2026
1243
  exports.ValidationError = ValidationError;
2027
- exports.array = create$2;
2028
1244
  exports.getIn = getIn;
2029
1245
  exports.isSchema = isSchema;
2030
- exports.mixed = create$8;
2031
- exports.object = create$3;
2032
1246
  exports.printValue = printValue;
2033
- exports.string = create$6;