@intlayer/design-system 4.1.6 → 4.1.8

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 (301) hide show
  1. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs +6 -2
  2. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs.map +1 -1
  3. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.d.ts.map +1 -1
  4. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs +6 -2
  5. package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs.map +1 -1
  6. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +10 -4
  7. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
  8. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
  9. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +10 -4
  10. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
  11. package/dist/hooks/intlayerAPIHooks.cjs +2 -2
  12. package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
  13. package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
  14. package/dist/hooks/intlayerAPIHooks.mjs +2 -2
  15. package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
  16. package/package.json +22 -19
  17. package/dist/CodeBlockShiki-BlmZyrr7.cjs +0 -29
  18. package/dist/CodeBlockShiki-BlmZyrr7.cjs.map +0 -1
  19. package/dist/CodeBlockShiki-CcpV9SVi.js +0 -29
  20. package/dist/CodeBlockShiki-CcpV9SVi.js.map +0 -1
  21. package/dist/CopyButton-Cxu3goRg.cjs +0 -59
  22. package/dist/CopyButton-Cxu3goRg.cjs.map +0 -1
  23. package/dist/CopyButton-DlcDlf6U.js +0 -60
  24. package/dist/CopyButton-DlcDlf6U.js.map +0 -1
  25. package/dist/Form-0D7KBafQ.cjs +0 -311
  26. package/dist/Form-0D7KBafQ.cjs.map +0 -1
  27. package/dist/Form-7BqwvjVI.cjs +0 -320
  28. package/dist/Form-7BqwvjVI.cjs.map +0 -1
  29. package/dist/Form-B2UufQRJ.cjs +0 -319
  30. package/dist/Form-B2UufQRJ.cjs.map +0 -1
  31. package/dist/Form-BB0kpER9.cjs +0 -301
  32. package/dist/Form-BB0kpER9.cjs.map +0 -1
  33. package/dist/Form-BDcoNTLV.cjs +0 -300
  34. package/dist/Form-BDcoNTLV.cjs.map +0 -1
  35. package/dist/Form-BTogr-fp.js +0 -312
  36. package/dist/Form-BTogr-fp.js.map +0 -1
  37. package/dist/Form-BVkkvSKP.js +0 -312
  38. package/dist/Form-BVkkvSKP.js.map +0 -1
  39. package/dist/Form-Be6Uhb5-.js +0 -312
  40. package/dist/Form-Be6Uhb5-.js.map +0 -1
  41. package/dist/Form-BmQQnl-6.js +0 -312
  42. package/dist/Form-BmQQnl-6.js.map +0 -1
  43. package/dist/Form-BoWOdiwq.js +0 -321
  44. package/dist/Form-BoWOdiwq.js.map +0 -1
  45. package/dist/Form-Bp_ubH9I.cjs +0 -311
  46. package/dist/Form-Bp_ubH9I.cjs.map +0 -1
  47. package/dist/Form-BtqRbgLu.cjs +0 -311
  48. package/dist/Form-BtqRbgLu.cjs.map +0 -1
  49. package/dist/Form-COVZyto7.cjs +0 -311
  50. package/dist/Form-COVZyto7.cjs.map +0 -1
  51. package/dist/Form-CVD_3nCD.js +0 -312
  52. package/dist/Form-CVD_3nCD.js.map +0 -1
  53. package/dist/Form-Cfklj1_H.js +0 -320
  54. package/dist/Form-Cfklj1_H.js.map +0 -1
  55. package/dist/Form-ClAAiVNm.cjs +0 -311
  56. package/dist/Form-ClAAiVNm.cjs.map +0 -1
  57. package/dist/Form-DGLgTAdY.js +0 -302
  58. package/dist/Form-DGLgTAdY.js.map +0 -1
  59. package/dist/Form-DhsgC7kB.js +0 -301
  60. package/dist/Form-DhsgC7kB.js.map +0 -1
  61. package/dist/Form-Dv0uHqbL.cjs +0 -320
  62. package/dist/Form-Dv0uHqbL.cjs.map +0 -1
  63. package/dist/Form-OK9zfg6E.js +0 -321
  64. package/dist/Form-OK9zfg6E.js.map +0 -1
  65. package/dist/components/ContentEditor/ContentEditorCode.cjs +0 -78
  66. package/dist/components/ContentEditor/ContentEditorCode.cjs.map +0 -1
  67. package/dist/components/ContentEditor/ContentEditorCode.d.ts +0 -11
  68. package/dist/components/ContentEditor/ContentEditorCode.d.ts.map +0 -1
  69. package/dist/components/ContentEditor/ContentEditorCode.mjs +0 -78
  70. package/dist/components/ContentEditor/ContentEditorCode.mjs.map +0 -1
  71. package/dist/components/DictionaryEditor/useEditedContentStore.cjs +0 -490
  72. package/dist/components/DictionaryEditor/useEditedContentStore.cjs.map +0 -1
  73. package/dist/components/DictionaryEditor/useEditedContentStore.d.ts +0 -28
  74. package/dist/components/DictionaryEditor/useEditedContentStore.d.ts.map +0 -1
  75. package/dist/components/DictionaryEditor/useEditedContentStore.mjs +0 -490
  76. package/dist/components/DictionaryEditor/useEditedContentStore.mjs.map +0 -1
  77. package/dist/components/DictionaryEditor/useEditionPanelStore.cjs +0 -15
  78. package/dist/components/DictionaryEditor/useEditionPanelStore.cjs.map +0 -1
  79. package/dist/components/DictionaryEditor/useEditionPanelStore.d.ts +0 -15
  80. package/dist/components/DictionaryEditor/useEditionPanelStore.d.ts.map +0 -1
  81. package/dist/components/DictionaryEditor/useEditionPanelStore.mjs +0 -15
  82. package/dist/components/DictionaryEditor/useEditionPanelStore.mjs.map +0 -1
  83. package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelector.d.ts +0 -8
  84. package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelector.d.ts.map +0 -1
  85. package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelectorContext.d.ts +0 -13
  86. package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelectorContext.d.ts.map +0 -1
  87. package/dist/components/DictionaryFieldEditor/LocaleSelector/localeSelector.content.d.ts +0 -9
  88. package/dist/components/DictionaryFieldEditor/LocaleSelector/localeSelector.content.d.ts.map +0 -1
  89. package/dist/components/DropDown/types.cjs +0 -2
  90. package/dist/components/DropDown/types.cjs.map +0 -1
  91. package/dist/components/DropDown/types.d.ts +0 -19
  92. package/dist/components/DropDown/types.d.ts.map +0 -1
  93. package/dist/components/DropDown/types.mjs +0 -2
  94. package/dist/components/DropDown/types.mjs.map +0 -1
  95. package/dist/components/IDE/CodeBlock.cjs +0 -54
  96. package/dist/components/IDE/CodeBlock.cjs.map +0 -1
  97. package/dist/components/IDE/CodeBlock.d.ts +0 -12
  98. package/dist/components/IDE/CodeBlock.d.ts.map +0 -1
  99. package/dist/components/IDE/CodeBlock.mjs +0 -54
  100. package/dist/components/IDE/CodeBlock.mjs.map +0 -1
  101. package/dist/components/IDE/CodeBlockLoader.cjs +0 -28
  102. package/dist/components/IDE/CodeBlockLoader.cjs.map +0 -1
  103. package/dist/components/IDE/CodeBlockLoader.d.ts +0 -4
  104. package/dist/components/IDE/CodeBlockLoader.d.ts.map +0 -1
  105. package/dist/components/IDE/CodeBlockLoader.mjs +0 -28
  106. package/dist/components/IDE/CodeBlockLoader.mjs.map +0 -1
  107. package/dist/components/IDE/CodeBlockShiki.d.ts +0 -3
  108. package/dist/components/IDE/CodeBlockShiki.d.ts.map +0 -1
  109. package/dist/components/IDE/CodeRender copy.cjs +0 -141
  110. package/dist/components/IDE/CodeRender copy.cjs.map +0 -1
  111. package/dist/components/IDE/CodeRender copy.d.ts +0 -14
  112. package/dist/components/IDE/CodeRender copy.d.ts.map +0 -1
  113. package/dist/components/IDE/CodeRender copy.mjs +0 -141
  114. package/dist/components/IDE/CodeRender copy.mjs.map +0 -1
  115. package/dist/components/IDE/CodeRender.cjs +0 -49
  116. package/dist/components/IDE/CodeRender.cjs.map +0 -1
  117. package/dist/components/IDE/CodeRender.d.ts +0 -9
  118. package/dist/components/IDE/CodeRender.d.ts.map +0 -1
  119. package/dist/components/IDE/CodeRender.mjs +0 -49
  120. package/dist/components/IDE/CodeRender.mjs.map +0 -1
  121. package/dist/components/IDE/CodeRenderer.cjs +0 -27
  122. package/dist/components/IDE/CodeRenderer.cjs.map +0 -1
  123. package/dist/components/IDE/CodeRenderer.d.ts +0 -5
  124. package/dist/components/IDE/CodeRenderer.d.ts.map +0 -1
  125. package/dist/components/IDE/CodeRenderer.mjs +0 -27
  126. package/dist/components/IDE/CodeRenderer.mjs.map +0 -1
  127. package/dist/components/IDE/EditableCodeBlock.d.ts +0 -9
  128. package/dist/components/IDE/EditableCodeBlock.d.ts.map +0 -1
  129. package/dist/components/LocaleSwitcherContentDropDown/LocaleSelectorContext.d.ts +0 -13
  130. package/dist/components/LocaleSwitcherContentDropDown/LocaleSelectorContext.d.ts.map +0 -1
  131. package/dist/design-system.css +0 -235
  132. package/dist/index-Ai6eeqZH.js +0 -702
  133. package/dist/index-Ai6eeqZH.js.map +0 -1
  134. package/dist/index-B-VAyQ9R.js +0 -673
  135. package/dist/index-B-VAyQ9R.js.map +0 -1
  136. package/dist/index-B1nU1-65.cjs +0 -690
  137. package/dist/index-B1nU1-65.cjs.map +0 -1
  138. package/dist/index-B2UElBcQ.cjs +0 -200
  139. package/dist/index-B2UElBcQ.cjs.map +0 -1
  140. package/dist/index-BIV0x_z2.js +0 -206
  141. package/dist/index-BIV0x_z2.js.map +0 -1
  142. package/dist/index-BIyA5LAs.js +0 -691
  143. package/dist/index-BIyA5LAs.js.map +0 -1
  144. package/dist/index-BMzh1_UJ.js +0 -201
  145. package/dist/index-BMzh1_UJ.js.map +0 -1
  146. package/dist/index-BNH9wXVj.cjs +0 -205
  147. package/dist/index-BNH9wXVj.cjs.map +0 -1
  148. package/dist/index-BbqOa6BU.cjs +0 -701
  149. package/dist/index-BbqOa6BU.cjs.map +0 -1
  150. package/dist/index-BdTa-9zc.js +0 -201
  151. package/dist/index-BdTa-9zc.js.map +0 -1
  152. package/dist/index-BqZwP4Lr.js +0 -691
  153. package/dist/index-BqZwP4Lr.js.map +0 -1
  154. package/dist/index-BtZWYJhL.cjs +0 -200
  155. package/dist/index-BtZWYJhL.cjs.map +0 -1
  156. package/dist/index-Buecpjbh.cjs +0 -690
  157. package/dist/index-Buecpjbh.cjs.map +0 -1
  158. package/dist/index-CDEJjmId.js +0 -694
  159. package/dist/index-CDEJjmId.js.map +0 -1
  160. package/dist/index-CTAyk6RY.cjs +0 -693
  161. package/dist/index-CTAyk6RY.cjs.map +0 -1
  162. package/dist/index-CVC2sfEj.js +0 -693
  163. package/dist/index-CVC2sfEj.js.map +0 -1
  164. package/dist/index-CVz0RdK6.js +0 -691
  165. package/dist/index-CVz0RdK6.js.map +0 -1
  166. package/dist/index-CjF2ksU7.cjs +0 -693
  167. package/dist/index-CjF2ksU7.cjs.map +0 -1
  168. package/dist/index-CuQs5759.cjs +0 -692
  169. package/dist/index-CuQs5759.cjs.map +0 -1
  170. package/dist/index-D69JRZcQ.js +0 -206
  171. package/dist/index-D69JRZcQ.js.map +0 -1
  172. package/dist/index-D9oaKvKC.js +0 -201
  173. package/dist/index-D9oaKvKC.js.map +0 -1
  174. package/dist/index-DFc7og1d.cjs +0 -671
  175. package/dist/index-DFc7og1d.cjs.map +0 -1
  176. package/dist/index-DTCehvKe.cjs +0 -200
  177. package/dist/index-DTCehvKe.cjs.map +0 -1
  178. package/dist/index-D_MDocy7.cjs +0 -690
  179. package/dist/index-D_MDocy7.cjs.map +0 -1
  180. package/dist/index-DcWYZrJW.js +0 -672
  181. package/dist/index-DcWYZrJW.js.map +0 -1
  182. package/dist/index-Djo2Jnua.cjs +0 -693
  183. package/dist/index-Djo2Jnua.cjs.map +0 -1
  184. package/dist/index-LFTthFne.js +0 -694
  185. package/dist/index-LFTthFne.js.map +0 -1
  186. package/dist/index-SOIahRpS.cjs +0 -205
  187. package/dist/index-SOIahRpS.cjs.map +0 -1
  188. package/dist/index-T-TjVQoD.js +0 -671
  189. package/dist/index-T-TjVQoD.js.map +0 -1
  190. package/dist/index-f8_VC6c8.cjs +0 -672
  191. package/dist/index-f8_VC6c8.cjs.map +0 -1
  192. package/dist/index-llGIfxqV.cjs +0 -670
  193. package/dist/index-llGIfxqV.cjs.map +0 -1
  194. package/dist/index-xZoGTokf.js +0 -694
  195. package/dist/index-xZoGTokf.js.map +0 -1
  196. package/dist/jsx-runtime-CL03FswV.cjs +0 -506
  197. package/dist/jsx-runtime-CL03FswV.cjs.map +0 -1
  198. package/dist/jsx-runtime-DaNGiM0W.js +0 -945
  199. package/dist/jsx-runtime-DaNGiM0W.js.map +0 -1
  200. package/dist/jsx-runtime-XHKiWCTo.cjs +0 -944
  201. package/dist/jsx-runtime-XHKiWCTo.cjs.map +0 -1
  202. package/dist/jsx-runtime-kmx34TxC.js +0 -507
  203. package/dist/jsx-runtime-kmx34TxC.js.map +0 -1
  204. package/dist/libs/index.cjs +0 -6
  205. package/dist/libs/index.cjs.map +0 -1
  206. package/dist/libs/index.d.ts +0 -2
  207. package/dist/libs/index.d.ts.map +0 -1
  208. package/dist/libs/index.mjs +0 -6
  209. package/dist/libs/index.mjs.map +0 -1
  210. package/dist/libs/intlayer-api/ai.cjs +0 -64
  211. package/dist/libs/intlayer-api/ai.cjs.map +0 -1
  212. package/dist/libs/intlayer-api/ai.d.ts +0 -18
  213. package/dist/libs/intlayer-api/ai.d.ts.map +0 -1
  214. package/dist/libs/intlayer-api/ai.mjs +0 -64
  215. package/dist/libs/intlayer-api/ai.mjs.map +0 -1
  216. package/dist/libs/intlayer-api/auth.cjs +0 -141
  217. package/dist/libs/intlayer-api/auth.cjs.map +0 -1
  218. package/dist/libs/intlayer-api/auth.d.ts +0 -38
  219. package/dist/libs/intlayer-api/auth.d.ts.map +0 -1
  220. package/dist/libs/intlayer-api/auth.mjs +0 -141
  221. package/dist/libs/intlayer-api/auth.mjs.map +0 -1
  222. package/dist/libs/intlayer-api/dictionary.cjs +0 -78
  223. package/dist/libs/intlayer-api/dictionary.cjs.map +0 -1
  224. package/dist/libs/intlayer-api/dictionary.d.ts +0 -22
  225. package/dist/libs/intlayer-api/dictionary.d.ts.map +0 -1
  226. package/dist/libs/intlayer-api/dictionary.mjs +0 -78
  227. package/dist/libs/intlayer-api/dictionary.mjs.map +0 -1
  228. package/dist/libs/intlayer-api/fetcher.cjs +0 -73
  229. package/dist/libs/intlayer-api/fetcher.cjs.map +0 -1
  230. package/dist/libs/intlayer-api/fetcher.d.ts +0 -70
  231. package/dist/libs/intlayer-api/fetcher.d.ts.map +0 -1
  232. package/dist/libs/intlayer-api/fetcher.mjs +0 -73
  233. package/dist/libs/intlayer-api/fetcher.mjs.map +0 -1
  234. package/dist/libs/intlayer-api/index.cjs +0 -24
  235. package/dist/libs/intlayer-api/index.cjs.map +0 -1
  236. package/dist/libs/intlayer-api/index.d.ts +0 -157
  237. package/dist/libs/intlayer-api/index.d.ts.map +0 -1
  238. package/dist/libs/intlayer-api/index.mjs +0 -24
  239. package/dist/libs/intlayer-api/index.mjs.map +0 -1
  240. package/dist/libs/intlayer-api/organization.cjs +0 -96
  241. package/dist/libs/intlayer-api/organization.cjs.map +0 -1
  242. package/dist/libs/intlayer-api/organization.d.ts +0 -26
  243. package/dist/libs/intlayer-api/organization.d.ts.map +0 -1
  244. package/dist/libs/intlayer-api/organization.mjs +0 -96
  245. package/dist/libs/intlayer-api/organization.mjs.map +0 -1
  246. package/dist/libs/intlayer-api/project.cjs +0 -110
  247. package/dist/libs/intlayer-api/project.cjs.map +0 -1
  248. package/dist/libs/intlayer-api/project.d.ts +0 -28
  249. package/dist/libs/intlayer-api/project.d.ts.map +0 -1
  250. package/dist/libs/intlayer-api/project.mjs +0 -110
  251. package/dist/libs/intlayer-api/project.mjs.map +0 -1
  252. package/dist/libs/intlayer-api/stripe.cjs +0 -31
  253. package/dist/libs/intlayer-api/stripe.cjs.map +0 -1
  254. package/dist/libs/intlayer-api/stripe.d.ts +0 -8
  255. package/dist/libs/intlayer-api/stripe.d.ts.map +0 -1
  256. package/dist/libs/intlayer-api/stripe.mjs +0 -31
  257. package/dist/libs/intlayer-api/stripe.mjs.map +0 -1
  258. package/dist/libs/intlayer-api/tag.cjs +0 -52
  259. package/dist/libs/intlayer-api/tag.cjs.map +0 -1
  260. package/dist/libs/intlayer-api/tag.d.ts +0 -16
  261. package/dist/libs/intlayer-api/tag.d.ts.map +0 -1
  262. package/dist/libs/intlayer-api/tag.mjs +0 -52
  263. package/dist/libs/intlayer-api/tag.mjs.map +0 -1
  264. package/dist/libs/intlayer-api/user.cjs +0 -70
  265. package/dist/libs/intlayer-api/user.cjs.map +0 -1
  266. package/dist/libs/intlayer-api/user.d.ts +0 -22
  267. package/dist/libs/intlayer-api/user.d.ts.map +0 -1
  268. package/dist/libs/intlayer-api/user.mjs +0 -70
  269. package/dist/libs/intlayer-api/user.mjs.map +0 -1
  270. package/dist/navigation-CE0LMHcY.cjs +0 -8538
  271. package/dist/navigation-CE0LMHcY.cjs.map +0 -1
  272. package/dist/navigation-DFabQmdZ.js +0 -914
  273. package/dist/navigation-DFabQmdZ.js.map +0 -1
  274. package/dist/navigation-DRtAVQJF.js +0 -8521
  275. package/dist/navigation-DRtAVQJF.js.map +0 -1
  276. package/dist/navigation-a7EfWhxz.cjs +0 -913
  277. package/dist/navigation-a7EfWhxz.cjs.map +0 -1
  278. package/dist/shallow-lhDIFtEp.cjs +0 -48
  279. package/dist/shallow-lhDIFtEp.cjs.map +0 -1
  280. package/dist/shallow-m9BpCkKh.js +0 -49
  281. package/dist/shallow-m9BpCkKh.js.map +0 -1
  282. package/dist/useGetAllDictionaries-B1sqs2IB.cjs +0 -34
  283. package/dist/useGetAllDictionaries-B1sqs2IB.cjs.map +0 -1
  284. package/dist/useGetAllDictionaries-BbH8vTkY.js +0 -35
  285. package/dist/useGetAllDictionaries-BbH8vTkY.js.map +0 -1
  286. package/dist/useGetAllDictionaries-Bgkytpa2.cjs +0 -34
  287. package/dist/useGetAllDictionaries-Bgkytpa2.cjs.map +0 -1
  288. package/dist/useGetAllDictionaries-D8ma3h41.cjs +0 -33
  289. package/dist/useGetAllDictionaries-D8ma3h41.cjs.map +0 -1
  290. package/dist/useGetAllDictionaries-DHgHEbD5.js +0 -34
  291. package/dist/useGetAllDictionaries-DHgHEbD5.js.map +0 -1
  292. package/dist/useGetAllDictionaries-DUzm0rIa.js +0 -35
  293. package/dist/useGetAllDictionaries-DUzm0rIa.js.map +0 -1
  294. package/dist/utils/dictionary.cjs +0 -158
  295. package/dist/utils/dictionary.cjs.map +0 -1
  296. package/dist/utils/dictionary.d.ts +0 -7
  297. package/dist/utils/dictionary.d.ts.map +0 -1
  298. package/dist/utils/dictionary.mjs +0 -158
  299. package/dist/utils/dictionary.mjs.map +0 -1
  300. /package/dist/components/IDE/{CodeBlockclient.d.ts → CodeBlockClient.d.ts} +0 -0
  301. /package/dist/components/IDE/{CodeBlockclient.d.ts.map → CodeBlockClient.d.ts.map} +0 -0
@@ -1,672 +0,0 @@
1
- import { getConfiguration } from "@intlayer/config/client";
2
- const fetcherOptions = {
3
- method: "GET",
4
- // Default HTTP method
5
- headers: {
6
- "Content-Type": "application/json"
7
- // Default content type
8
- },
9
- credentials: "include"
10
- // Include cookies in the request
11
- };
12
- const removeUndefined = (obj) => {
13
- Object.keys(obj).forEach((key) => {
14
- if (obj[key] === void 0) {
15
- delete obj[key];
16
- }
17
- });
18
- return obj;
19
- };
20
- const deepMerge = (objects) => objects.reduce((acc, obj) => {
21
- const acc1 = acc ?? {};
22
- const obj1 = removeUndefined(obj ?? {});
23
- if (typeof acc1 === "object" && typeof obj1 === "object") {
24
- return { ...acc1, ...obj1 };
25
- }
26
- return obj1 ?? acc1;
27
- }, {});
28
- const fetcher = async (url, ...options) => {
29
- let paramsString = "";
30
- let bodyString = void 0;
31
- const otherOptions = options.map(
32
- ({ body, params: params2, headers, ...otherOptions2 }) => otherOptions2
33
- );
34
- const mergedOptions = deepMerge([fetcherOptions, ...otherOptions]);
35
- const mergedHeaders = deepMerge([
36
- fetcherOptions.headers,
37
- ...options.map((option) => option.headers)
38
- ]);
39
- const params = deepMerge(options.map((option) => option.params));
40
- const method = mergedOptions.method;
41
- if (method !== "GET" && method !== "HEAD") {
42
- const body = deepMerge(options.map((option) => option.body));
43
- if (mergedHeaders?.["Content-Type"] === "application/x-www-form-urlencoded") {
44
- bodyString = new URLSearchParams(
45
- body
46
- ).toString();
47
- } else {
48
- bodyString = JSON.stringify(body);
49
- }
50
- }
51
- if (Object.entries(params).length > 0) {
52
- paramsString = `?${new URLSearchParams(
53
- params
54
- ).toString()}`;
55
- }
56
- const formattedOptions = {
57
- ...mergedOptions,
58
- headers: mergedHeaders,
59
- body: bodyString
60
- };
61
- const urlResult = `${url}${paramsString}`;
62
- const response = await fetch(urlResult, formattedOptions);
63
- if (!response.ok) {
64
- const result = await response.json();
65
- console.error(result);
66
- throw new Error(JSON.stringify(result.error) ?? "An error occurred");
67
- }
68
- return await response.json();
69
- };
70
- const getAiAPI = (authAPIOptions = {}, intlayerConfig) => {
71
- const { backendURL } = getConfiguration().editor;
72
- const AI_API_ROUTE = `${backendURL}/api/ai`;
73
- const auditContentDeclaration = async (body, otherOptions = {}) => await fetcher(
74
- `${AI_API_ROUTE}/audit/content-declaration`,
75
- authAPIOptions,
76
- otherOptions,
77
- {
78
- method: "POST",
79
- body
80
- }
81
- );
82
- const auditContentDeclarationField = async (body, otherOptions = {}) => await fetcher(
83
- `${AI_API_ROUTE}/audit/content-declaration/field`,
84
- authAPIOptions,
85
- otherOptions,
86
- {
87
- method: "POST",
88
- body
89
- }
90
- );
91
- const auditContentDeclarationMetadata = async (body, otherOptions = {}) => await fetcher(
92
- `${AI_API_ROUTE}/audit/content-declaration/metadata`,
93
- authAPIOptions,
94
- otherOptions,
95
- {
96
- method: "POST",
97
- body
98
- }
99
- );
100
- const auditTag = async (body, otherOptions = {}) => await fetcher(
101
- `${AI_API_ROUTE}/audit/tag`,
102
- authAPIOptions,
103
- otherOptions,
104
- {
105
- method: "POST",
106
- body
107
- }
108
- );
109
- const askDocQuestion = async (body, otherOptions = {}) => await fetcher(
110
- `${AI_API_ROUTE}/ask`,
111
- authAPIOptions,
112
- otherOptions,
113
- {
114
- method: "POST",
115
- body
116
- }
117
- );
118
- return {
119
- auditContentDeclaration,
120
- auditContentDeclarationField,
121
- auditContentDeclarationMetadata,
122
- auditTag,
123
- askDocQuestion
124
- };
125
- };
126
- getAiAPI();
127
- const getAuthAPI = (authAPIOptions = {}, intlayerConfig) => {
128
- const { backendURL, clientId, clientSecret } = getConfiguration().editor;
129
- const AUTH_API_ROUTE = `${backendURL}/api/auth`;
130
- const login = async (user, otherOptions = {}) => await fetcher(
131
- `${AUTH_API_ROUTE}/login`,
132
- authAPIOptions,
133
- otherOptions,
134
- {
135
- method: "POST",
136
- body: user
137
- }
138
- );
139
- const getLoginWithGitHubURL = (params) => {
140
- const searchParams = new URLSearchParams(params);
141
- return `${AUTH_API_ROUTE}/login/github?${searchParams.toString()}`;
142
- };
143
- const getLoginWithGoogleURL = (params) => {
144
- const searchParams = new URLSearchParams(params);
145
- return `${AUTH_API_ROUTE}/login/google?${searchParams.toString()}`;
146
- };
147
- const register = async (user, query = {}, otherOptions = {}) => await fetcher(
148
- `${AUTH_API_ROUTE}/register`,
149
- authAPIOptions,
150
- otherOptions,
151
- {
152
- method: "POST",
153
- body: user,
154
- params: query
155
- }
156
- );
157
- const logout = async (otherOptions = {}) => await fetcher(
158
- `${AUTH_API_ROUTE}/logout`,
159
- authAPIOptions,
160
- otherOptions,
161
- {
162
- method: "POST"
163
- }
164
- );
165
- const askResetPassword = async (email, otherOptions = {}) => await fetcher(
166
- `${AUTH_API_ROUTE}/password/reset`,
167
- authAPIOptions,
168
- otherOptions,
169
- {
170
- method: "POST",
171
- body: { email }
172
- }
173
- );
174
- const resetPassword = async (params, otherOptions = {}) => await fetcher(
175
- `${AUTH_API_ROUTE}/password/reset`,
176
- authAPIOptions,
177
- otherOptions,
178
- { params, method: "POST" }
179
- );
180
- const changePassword = async (data, otherOptions = {}) => await fetcher(
181
- `${AUTH_API_ROUTE}/password`,
182
- authAPIOptions,
183
- otherOptions,
184
- {
185
- method: "PUT",
186
- body: data
187
- }
188
- );
189
- const checkIfUserHasPassword = async (otherOptions = {}) => await fetcher(
190
- `${AUTH_API_ROUTE}/password/has`,
191
- authAPIOptions,
192
- otherOptions,
193
- {
194
- method: "GET"
195
- }
196
- );
197
- const verifyEmail = async ({ userId, secret }, otherOptions = {}) => await fetcher(
198
- `${AUTH_API_ROUTE}/active/${userId}/${secret}`,
199
- authAPIOptions,
200
- otherOptions,
201
- {
202
- method: "PUT"
203
- }
204
- );
205
- const getVerifyEmailStatusURL = (userId) => `${AUTH_API_ROUTE}/verify-email-status/${String(userId)}`;
206
- const createSession = async (data, otherOptions = {}) => await fetcher(
207
- `${AUTH_API_ROUTE}/session`,
208
- authAPIOptions,
209
- otherOptions,
210
- {
211
- method: "POST",
212
- body: data
213
- }
214
- );
215
- const getSession = async (sessionToken, otherOptions = {}) => await fetcher(
216
- `${backendURL}/session`,
217
- authAPIOptions,
218
- otherOptions,
219
- { params: { session_token: sessionToken } }
220
- );
221
- const getCSRFToken = async (otherOptions = {}) => await fetcher(
222
- `${backendURL}/csrf-token`,
223
- authAPIOptions,
224
- otherOptions
225
- );
226
- const getOAuth2AccessToken = async (otherOptions = {}) => await fetcher(
227
- `${backendURL}/oauth2/token`,
228
- authAPIOptions,
229
- otherOptions,
230
- {
231
- method: "POST",
232
- headers: {
233
- "Content-Type": "application/x-www-form-urlencoded"
234
- },
235
- body: {
236
- grant_type: "client_credentials",
237
- client_id: clientId,
238
- client_secret: clientSecret
239
- }
240
- }
241
- );
242
- return {
243
- login,
244
- getLoginWithGitHubURL,
245
- getLoginWithGoogleURL,
246
- register,
247
- logout,
248
- resetPassword,
249
- askResetPassword,
250
- checkIfUserHasPassword,
251
- verifyEmail,
252
- getVerifyEmailStatusURL,
253
- changePassword,
254
- createSession,
255
- getSession,
256
- getCSRFToken,
257
- getOAuth2AccessToken
258
- };
259
- };
260
- getAuthAPI();
261
- const getDictionaryAPI = (authAPIOptions = {}, intlayerConfig) => {
262
- const { backendURL } = getConfiguration().editor;
263
- const PROJECT_API_ROUTE = `${backendURL}/api/dictionary`;
264
- const getDictionaries = async (filters, otherOptions = {}) => await fetcher(
265
- PROJECT_API_ROUTE,
266
- authAPIOptions,
267
- otherOptions,
268
- {
269
- params: filters
270
- }
271
- );
272
- const getDictionariesKeys = async (otherOptions = {}) => await fetcher(
273
- `${PROJECT_API_ROUTE}/keys`,
274
- authAPIOptions,
275
- otherOptions
276
- );
277
- const getDictionary = async (dictionaryKey, version, otherOptions = {}) => await fetcher(
278
- `${PROJECT_API_ROUTE}/${dictionaryKey}`,
279
- authAPIOptions,
280
- otherOptions,
281
- {
282
- params: version ? { version: version.toString() } : void 0
283
- }
284
- );
285
- const addDictionary = async (dictionary, otherOptions = {}) => await fetcher(
286
- `${PROJECT_API_ROUTE}`,
287
- authAPIOptions,
288
- otherOptions,
289
- {
290
- method: "POST",
291
- body: dictionary
292
- }
293
- );
294
- const pushDictionaries = async (dictionaries, otherOptions = {}) => await fetcher(
295
- `${PROJECT_API_ROUTE}`,
296
- authAPIOptions,
297
- otherOptions,
298
- {
299
- method: "PATCH",
300
- body: { dictionaries }
301
- }
302
- );
303
- const updateDictionary = async (dictionaryId, dictionary, otherOptions = {}) => await fetcher(
304
- `${PROJECT_API_ROUTE}/${dictionaryId}`,
305
- authAPIOptions,
306
- otherOptions,
307
- {
308
- method: "PUT",
309
- body: dictionary
310
- }
311
- );
312
- const deleteDictionary = async (id, otherOptions = {}) => await fetcher(
313
- `${PROJECT_API_ROUTE}`,
314
- authAPIOptions,
315
- otherOptions,
316
- {
317
- method: "DELETE",
318
- body: { id }
319
- }
320
- );
321
- return {
322
- getDictionaries,
323
- getDictionariesKeys,
324
- getDictionary,
325
- pushDictionaries,
326
- addDictionary,
327
- updateDictionary,
328
- deleteDictionary
329
- };
330
- };
331
- getDictionaryAPI();
332
- const getOrganizationAPI = (authAPIOptions = {}, intlayerConfig) => {
333
- const { backendURL } = getConfiguration().editor;
334
- const ORGANIZATION_API_ROUTE = `${backendURL}/api/organization`;
335
- const getOrganizations = async (filters, otherOptions = {}) => await fetcher(
336
- ORGANIZATION_API_ROUTE,
337
- authAPIOptions,
338
- otherOptions,
339
- {
340
- params: filters
341
- }
342
- );
343
- const getOrganization = async (organizationId, otherOptions = {}) => await fetcher(
344
- `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,
345
- authAPIOptions,
346
- otherOptions
347
- );
348
- const addOrganization = async (organization, otherOptions = {}) => await fetcher(
349
- ORGANIZATION_API_ROUTE,
350
- authAPIOptions,
351
- otherOptions,
352
- {
353
- method: "POST",
354
- body: organization
355
- }
356
- );
357
- const updateOrganization = async (organization, otherOptions = {}) => fetcher(
358
- ORGANIZATION_API_ROUTE,
359
- authAPIOptions,
360
- otherOptions,
361
- {
362
- method: "PUT",
363
- body: organization
364
- }
365
- );
366
- const updateOrganizationMembers = async (body, otherOptions = {}) => fetcher(
367
- `${ORGANIZATION_API_ROUTE}/members`,
368
- authAPIOptions,
369
- otherOptions,
370
- {
371
- method: "PUT",
372
- body
373
- }
374
- );
375
- const addOrganizationMember = async (body, otherOptions = {}) => fetcher(
376
- `${ORGANIZATION_API_ROUTE}/member`,
377
- authAPIOptions,
378
- otherOptions,
379
- {
380
- method: "POST",
381
- body
382
- }
383
- );
384
- const deleteOrganization = async (otherOptions = {}) => await fetcher(
385
- ORGANIZATION_API_ROUTE,
386
- authAPIOptions,
387
- otherOptions,
388
- {
389
- method: "DELETE"
390
- }
391
- );
392
- const selectOrganization = async (organizationId, otherOptions = {}) => await fetcher(
393
- `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,
394
- authAPIOptions,
395
- otherOptions,
396
- {
397
- method: "PUT"
398
- }
399
- );
400
- const unselectOrganization = async (otherOptions = {}) => await fetcher(
401
- `${ORGANIZATION_API_ROUTE}/logout`,
402
- authAPIOptions,
403
- otherOptions,
404
- {
405
- method: "POST"
406
- }
407
- );
408
- return {
409
- getOrganizations,
410
- getOrganization,
411
- addOrganization,
412
- addOrganizationMember,
413
- updateOrganization,
414
- updateOrganizationMembers,
415
- deleteOrganization,
416
- selectOrganization,
417
- unselectOrganization
418
- };
419
- };
420
- getOrganizationAPI();
421
- const getProjectAPI = (authAPIOptions = {}, intlayerConfig) => {
422
- const { backendURL } = getConfiguration().editor;
423
- const PROJECT_API_ROUTE = `${backendURL}/api/project`;
424
- const getProjects = async (filters, otherOptions = {}) => await fetcher(
425
- PROJECT_API_ROUTE,
426
- authAPIOptions,
427
- otherOptions,
428
- {
429
- params: filters
430
- }
431
- );
432
- const addProject = async (project, otherOptions = {}) => await fetcher(
433
- `${PROJECT_API_ROUTE}`,
434
- authAPIOptions,
435
- otherOptions,
436
- {
437
- method: "POST",
438
- body: project
439
- }
440
- );
441
- const updateProject = async (project, otherOptions = {}) => await fetcher(
442
- `${PROJECT_API_ROUTE}`,
443
- authAPIOptions,
444
- otherOptions,
445
- {
446
- method: "PUT",
447
- body: project
448
- }
449
- );
450
- const updateProjectMembers = async (body, otherOptions = {}) => await fetcher(
451
- `${PROJECT_API_ROUTE}/members`,
452
- authAPIOptions,
453
- otherOptions,
454
- {
455
- method: "PUT",
456
- body
457
- }
458
- );
459
- const deleteProject = async (otherOptions = {}) => await fetcher(
460
- `${PROJECT_API_ROUTE}`,
461
- authAPIOptions,
462
- otherOptions,
463
- {
464
- method: "DELETE"
465
- }
466
- );
467
- const selectProject = async (projectId, otherOptions = {}) => await fetcher(
468
- `${PROJECT_API_ROUTE}/${String(projectId)}`,
469
- authAPIOptions,
470
- otherOptions,
471
- {
472
- method: "PUT"
473
- }
474
- );
475
- const unselectProject = async (otherOptions = {}) => await fetcher(
476
- `${PROJECT_API_ROUTE}/logout`,
477
- authAPIOptions,
478
- otherOptions,
479
- {
480
- method: "POST"
481
- }
482
- );
483
- const addNewAccessKey = async (accessKey, otherOptions = {}) => await fetcher(
484
- `${PROJECT_API_ROUTE}/access_key`,
485
- authAPIOptions,
486
- otherOptions,
487
- {
488
- method: "POST",
489
- body: accessKey
490
- }
491
- );
492
- const deleteAccessKey = async (clientId, otherOptions = {}) => await fetcher(
493
- `${PROJECT_API_ROUTE}/access_key`,
494
- authAPIOptions,
495
- otherOptions,
496
- {
497
- method: "DELETE",
498
- body: { clientId }
499
- }
500
- );
501
- const refreshAccessKey = async (clientId, otherOptions = {}) => await fetcher(
502
- `${PROJECT_API_ROUTE}/access_key`,
503
- authAPIOptions,
504
- otherOptions,
505
- {
506
- method: "PATCH",
507
- body: { clientId }
508
- }
509
- );
510
- return {
511
- getProjects,
512
- addProject,
513
- updateProject,
514
- updateProjectMembers,
515
- deleteProject,
516
- selectProject,
517
- unselectProject,
518
- addNewAccessKey,
519
- deleteAccessKey,
520
- refreshAccessKey
521
- };
522
- };
523
- getProjectAPI();
524
- const getStripeAPI = (authAPIOptions = {}, intlayerConfig) => {
525
- const backendURL = getConfiguration().editor.backendURL;
526
- const STRIPE_API_ROUTE = `${backendURL}/api/stripe`;
527
- const getSubscription = async (body, otherOptions = {}) => await fetcher(
528
- `${STRIPE_API_ROUTE}/create-subscription`,
529
- authAPIOptions,
530
- otherOptions,
531
- {
532
- method: "POST",
533
- body
534
- }
535
- );
536
- const cancelSubscription = async (otherOptions = {}) => await fetcher(
537
- `${STRIPE_API_ROUTE}/cancel-subscription`,
538
- authAPIOptions,
539
- otherOptions,
540
- {
541
- method: "POST"
542
- }
543
- );
544
- return {
545
- getSubscription,
546
- cancelSubscription
547
- };
548
- };
549
- const getTagAPI = (authAPIOptions = {}, intlayerConfig) => {
550
- const { backendURL } = getConfiguration().editor;
551
- const PROJECT_API_ROUTE = `${backendURL}/api/tag`;
552
- const getTags = async (filters, otherOptions = {}) => await fetcher(
553
- PROJECT_API_ROUTE,
554
- authAPIOptions,
555
- otherOptions,
556
- {
557
- params: filters
558
- }
559
- );
560
- const addTag = async (tag, otherOptions = {}) => await fetcher(
561
- `${PROJECT_API_ROUTE}`,
562
- authAPIOptions,
563
- otherOptions,
564
- {
565
- method: "POST",
566
- body: tag
567
- }
568
- );
569
- const updateTag = async (tagId, tag, otherOptions = {}) => await fetcher(
570
- `${PROJECT_API_ROUTE}/${tagId}`,
571
- authAPIOptions,
572
- otherOptions,
573
- {
574
- method: "PUT",
575
- body: tag
576
- }
577
- );
578
- const deleteTag = async (tagId, otherOptions = {}) => await fetcher(
579
- `${PROJECT_API_ROUTE}/${tagId}`,
580
- authAPIOptions,
581
- otherOptions,
582
- {
583
- method: "DELETE"
584
- }
585
- );
586
- return {
587
- getTags,
588
- addTag,
589
- updateTag,
590
- deleteTag
591
- };
592
- };
593
- getTagAPI();
594
- const getUserAPI = (authAPIOptions = {}, intlayerConfig) => {
595
- const { backendURL } = getConfiguration().editor;
596
- const USER_API_ROUTE = `${backendURL}/api/user`;
597
- const getUsers = async (filters, otherOptions = {}) => await fetcher(
598
- USER_API_ROUTE,
599
- authAPIOptions,
600
- otherOptions,
601
- {
602
- params: filters
603
- }
604
- );
605
- const getUserById = async (userId, otherOptions = {}) => await fetcher(
606
- `${USER_API_ROUTE}/${userId}`,
607
- authAPIOptions,
608
- otherOptions
609
- );
610
- const getUserByEmail = async (email, otherOptions = {}) => await fetcher(
611
- `${USER_API_ROUTE}/email/${email}`,
612
- authAPIOptions,
613
- otherOptions
614
- );
615
- const getUserByAccount = async (providerAccountId, provider, otherOptions = {}) => await fetcher(
616
- `${USER_API_ROUTE}/account/${provider}/${providerAccountId}`,
617
- authAPIOptions,
618
- otherOptions
619
- );
620
- const createUser = async (user, otherOptions = {}) => await fetcher(
621
- `${USER_API_ROUTE}/`,
622
- authAPIOptions,
623
- otherOptions,
624
- {
625
- method: "POST",
626
- body: user
627
- }
628
- );
629
- const updateUser = async (user, otherOptions = {}) => await fetcher(
630
- `${USER_API_ROUTE}`,
631
- authAPIOptions,
632
- otherOptions,
633
- {
634
- method: "PUT",
635
- body: user
636
- }
637
- );
638
- const deleteUser = async (userId, otherOptions = {}) => await fetcher(
639
- `${USER_API_ROUTE}/${userId}`,
640
- authAPIOptions,
641
- otherOptions,
642
- {
643
- method: "DELETE"
644
- }
645
- );
646
- return {
647
- createUser,
648
- getUsers,
649
- getUserById,
650
- getUserByAccount,
651
- getUserByEmail,
652
- updateUser,
653
- deleteUser
654
- };
655
- };
656
- getUserAPI();
657
- const getIntlayerAPI = (authAPIOptions = {}, intlayerConfig) => ({
658
- organization: getOrganizationAPI(authAPIOptions),
659
- project: getProjectAPI(authAPIOptions),
660
- user: getUserAPI(authAPIOptions),
661
- auth: getAuthAPI(authAPIOptions),
662
- dictionary: getDictionaryAPI(authAPIOptions),
663
- stripe: getStripeAPI(authAPIOptions),
664
- ai: getAiAPI(authAPIOptions),
665
- tag: getTagAPI(authAPIOptions)
666
- });
667
- const intlayerAPI = getIntlayerAPI();
668
- export {
669
- getIntlayerAPI as g,
670
- intlayerAPI as i
671
- };
672
- //# sourceMappingURL=index-DcWYZrJW.js.map