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