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