@intlayer/api 9.0.0-canary.10 → 9.0.0-canary.12

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 (347) hide show
  1. package/dist/cjs/cms/createAuthManager.cjs +116 -0
  2. package/dist/cjs/cms/createAuthManager.cjs.map +1 -0
  3. package/dist/cjs/cms/createIntlayerCMS.cjs +64 -0
  4. package/dist/cjs/cms/createIntlayerCMS.cjs.map +1 -0
  5. package/dist/cjs/cms/index.cjs +7 -0
  6. package/dist/cjs/distantDictionary/fetchDistantDictionaries.cjs +3 -2
  7. package/dist/cjs/distantDictionary/fetchDistantDictionaries.cjs.map +1 -1
  8. package/dist/cjs/distantDictionary/fetchDistantDictionary.cjs +3 -2
  9. package/dist/cjs/distantDictionary/fetchDistantDictionary.cjs.map +1 -1
  10. package/dist/cjs/getIntlayerAPI/ai.cjs +9 -0
  11. package/dist/cjs/getIntlayerAPI/ai.cjs.map +1 -1
  12. package/dist/cjs/getIntlayerAPI/asset.cjs +9 -0
  13. package/dist/cjs/getIntlayerAPI/asset.cjs.map +1 -1
  14. package/dist/cjs/getIntlayerAPI/audit.cjs +9 -0
  15. package/dist/cjs/getIntlayerAPI/audit.cjs.map +1 -1
  16. package/dist/cjs/getIntlayerAPI/bitbucket.cjs +9 -0
  17. package/dist/cjs/getIntlayerAPI/bitbucket.cjs.map +1 -1
  18. package/dist/cjs/getIntlayerAPI/dictionary.cjs +9 -0
  19. package/dist/cjs/getIntlayerAPI/dictionary.cjs.map +1 -1
  20. package/dist/cjs/getIntlayerAPI/editor.cjs +9 -0
  21. package/dist/cjs/getIntlayerAPI/editor.cjs.map +1 -1
  22. package/dist/cjs/getIntlayerAPI/environment.cjs +9 -0
  23. package/dist/cjs/getIntlayerAPI/environment.cjs.map +1 -1
  24. package/dist/cjs/getIntlayerAPI/github.cjs +9 -0
  25. package/dist/cjs/getIntlayerAPI/github.cjs.map +1 -1
  26. package/dist/cjs/getIntlayerAPI/gitlab.cjs +9 -0
  27. package/dist/cjs/getIntlayerAPI/gitlab.cjs.map +1 -1
  28. package/dist/cjs/getIntlayerAPI/index.cjs +4 -2
  29. package/dist/cjs/getIntlayerAPI/index.cjs.map +1 -1
  30. package/dist/cjs/getIntlayerAPI/newsletter.cjs +9 -0
  31. package/dist/cjs/getIntlayerAPI/newsletter.cjs.map +1 -1
  32. package/dist/cjs/getIntlayerAPI/organization.cjs +19 -0
  33. package/dist/cjs/getIntlayerAPI/organization.cjs.map +1 -1
  34. package/dist/cjs/getIntlayerAPI/project.cjs +9 -0
  35. package/dist/cjs/getIntlayerAPI/project.cjs.map +1 -1
  36. package/dist/cjs/getIntlayerAPI/reviewer.cjs +9 -0
  37. package/dist/cjs/getIntlayerAPI/reviewer.cjs.map +1 -1
  38. package/dist/cjs/getIntlayerAPI/search.cjs +9 -0
  39. package/dist/cjs/getIntlayerAPI/search.cjs.map +1 -1
  40. package/dist/cjs/getIntlayerAPI/showcaseProject.cjs +9 -0
  41. package/dist/cjs/getIntlayerAPI/showcaseProject.cjs.map +1 -1
  42. package/dist/cjs/getIntlayerAPI/status.cjs +48 -0
  43. package/dist/cjs/getIntlayerAPI/status.cjs.map +1 -0
  44. package/dist/cjs/getIntlayerAPI/stripe.cjs +9 -0
  45. package/dist/cjs/getIntlayerAPI/stripe.cjs.map +1 -1
  46. package/dist/cjs/getIntlayerAPI/tag.cjs +9 -0
  47. package/dist/cjs/getIntlayerAPI/tag.cjs.map +1 -1
  48. package/dist/cjs/getIntlayerAPI/translate.cjs +9 -0
  49. package/dist/cjs/getIntlayerAPI/translate.cjs.map +1 -1
  50. package/dist/cjs/getIntlayerAPI/user.cjs +9 -0
  51. package/dist/cjs/getIntlayerAPI/user.cjs.map +1 -1
  52. package/dist/cjs/index.cjs +30 -3
  53. package/dist/cjs/proxy.cjs +78 -96
  54. package/dist/cjs/proxy.cjs.map +1 -1
  55. package/dist/esm/cms/createAuthManager.mjs +115 -0
  56. package/dist/esm/cms/createAuthManager.mjs.map +1 -0
  57. package/dist/esm/cms/createIntlayerCMS.mjs +62 -0
  58. package/dist/esm/cms/createIntlayerCMS.mjs.map +1 -0
  59. package/dist/esm/cms/index.mjs +4 -0
  60. package/dist/esm/distantDictionary/fetchDistantDictionaries.mjs +3 -2
  61. package/dist/esm/distantDictionary/fetchDistantDictionaries.mjs.map +1 -1
  62. package/dist/esm/distantDictionary/fetchDistantDictionary.mjs +3 -2
  63. package/dist/esm/distantDictionary/fetchDistantDictionary.mjs.map +1 -1
  64. package/dist/esm/getIntlayerAPI/ai.mjs +9 -1
  65. package/dist/esm/getIntlayerAPI/ai.mjs.map +1 -1
  66. package/dist/esm/getIntlayerAPI/asset.mjs +9 -1
  67. package/dist/esm/getIntlayerAPI/asset.mjs.map +1 -1
  68. package/dist/esm/getIntlayerAPI/audit.mjs +9 -1
  69. package/dist/esm/getIntlayerAPI/audit.mjs.map +1 -1
  70. package/dist/esm/getIntlayerAPI/bitbucket.mjs +9 -1
  71. package/dist/esm/getIntlayerAPI/bitbucket.mjs.map +1 -1
  72. package/dist/esm/getIntlayerAPI/dictionary.mjs +9 -1
  73. package/dist/esm/getIntlayerAPI/dictionary.mjs.map +1 -1
  74. package/dist/esm/getIntlayerAPI/editor.mjs +9 -1
  75. package/dist/esm/getIntlayerAPI/editor.mjs.map +1 -1
  76. package/dist/esm/getIntlayerAPI/environment.mjs +9 -1
  77. package/dist/esm/getIntlayerAPI/environment.mjs.map +1 -1
  78. package/dist/esm/getIntlayerAPI/github.mjs +9 -1
  79. package/dist/esm/getIntlayerAPI/github.mjs.map +1 -1
  80. package/dist/esm/getIntlayerAPI/gitlab.mjs +9 -1
  81. package/dist/esm/getIntlayerAPI/gitlab.mjs.map +1 -1
  82. package/dist/esm/getIntlayerAPI/index.mjs +4 -2
  83. package/dist/esm/getIntlayerAPI/index.mjs.map +1 -1
  84. package/dist/esm/getIntlayerAPI/newsletter.mjs +9 -1
  85. package/dist/esm/getIntlayerAPI/newsletter.mjs.map +1 -1
  86. package/dist/esm/getIntlayerAPI/organization.mjs +19 -1
  87. package/dist/esm/getIntlayerAPI/organization.mjs.map +1 -1
  88. package/dist/esm/getIntlayerAPI/project.mjs +9 -1
  89. package/dist/esm/getIntlayerAPI/project.mjs.map +1 -1
  90. package/dist/esm/getIntlayerAPI/reviewer.mjs +9 -1
  91. package/dist/esm/getIntlayerAPI/reviewer.mjs.map +1 -1
  92. package/dist/esm/getIntlayerAPI/search.mjs +9 -1
  93. package/dist/esm/getIntlayerAPI/search.mjs.map +1 -1
  94. package/dist/esm/getIntlayerAPI/showcaseProject.mjs +9 -1
  95. package/dist/esm/getIntlayerAPI/showcaseProject.mjs.map +1 -1
  96. package/dist/esm/getIntlayerAPI/status.mjs +46 -0
  97. package/dist/esm/getIntlayerAPI/status.mjs.map +1 -0
  98. package/dist/esm/getIntlayerAPI/stripe.mjs +9 -1
  99. package/dist/esm/getIntlayerAPI/stripe.mjs.map +1 -1
  100. package/dist/esm/getIntlayerAPI/tag.mjs +9 -1
  101. package/dist/esm/getIntlayerAPI/tag.mjs.map +1 -1
  102. package/dist/esm/getIntlayerAPI/translate.mjs +9 -1
  103. package/dist/esm/getIntlayerAPI/translate.mjs.map +1 -1
  104. package/dist/esm/getIntlayerAPI/user.mjs +9 -1
  105. package/dist/esm/getIntlayerAPI/user.mjs.map +1 -1
  106. package/dist/esm/index.mjs +24 -21
  107. package/dist/esm/proxy.mjs +78 -96
  108. package/dist/esm/proxy.mjs.map +1 -1
  109. package/dist/types/apps/backend/dist/types/controllers/ai.controller.d.ts +94 -0
  110. package/dist/types/apps/backend/dist/types/controllers/ai.controller.d.ts.map +1 -0
  111. package/dist/types/apps/backend/dist/types/controllers/asset.controller.d.ts +15 -0
  112. package/dist/types/apps/backend/dist/types/controllers/asset.controller.d.ts.map +1 -0
  113. package/dist/types/apps/backend/dist/types/controllers/audit.controller.d.ts +1 -0
  114. package/dist/types/apps/backend/dist/types/controllers/bitbucket.controller.d.ts +1 -0
  115. package/dist/types/apps/backend/dist/types/controllers/cliSessionToken.controller.d.ts +18 -0
  116. package/dist/types/apps/backend/dist/types/controllers/cliSessionToken.controller.d.ts.map +1 -0
  117. package/dist/types/apps/backend/dist/types/controllers/dictionary.controller.d.ts +85 -0
  118. package/dist/types/apps/backend/dist/types/controllers/dictionary.controller.d.ts.map +1 -0
  119. package/dist/types/apps/backend/dist/types/controllers/environment.controller.d.ts +30 -0
  120. package/dist/types/apps/backend/dist/types/controllers/environment.controller.d.ts.map +1 -0
  121. package/dist/types/apps/backend/dist/types/controllers/eventListener.controller.d.ts +1 -0
  122. package/dist/types/apps/backend/dist/types/controllers/github.controller.d.ts +1 -0
  123. package/dist/types/apps/backend/dist/types/controllers/gitlab.controller.d.ts +1 -0
  124. package/dist/types/apps/backend/dist/types/controllers/newsletter.controller.d.ts +25 -0
  125. package/dist/types/apps/backend/dist/types/controllers/newsletter.controller.d.ts.map +1 -0
  126. package/dist/types/apps/backend/dist/types/controllers/oAuth2.controller.d.ts +7 -0
  127. package/dist/types/apps/backend/dist/types/controllers/oAuth2.controller.d.ts.map +1 -0
  128. package/dist/types/apps/backend/dist/types/controllers/organization.controller.d.ts +71 -0
  129. package/dist/types/apps/backend/dist/types/controllers/organization.controller.d.ts.map +1 -0
  130. package/dist/types/apps/backend/dist/types/controllers/project.controller.d.ts +81 -0
  131. package/dist/types/apps/backend/dist/types/controllers/project.controller.d.ts.map +1 -0
  132. package/dist/types/apps/backend/dist/types/controllers/projectAccessKey.controller.d.ts +26 -0
  133. package/dist/types/apps/backend/dist/types/controllers/projectAccessKey.controller.d.ts.map +1 -0
  134. package/dist/types/apps/backend/dist/types/controllers/projectMemberAccess.controller.d.ts +15 -0
  135. package/dist/types/apps/backend/dist/types/controllers/projectMemberAccess.controller.d.ts.map +1 -0
  136. package/dist/types/apps/backend/dist/types/controllers/recursiveAudit.controller.d.ts +31 -0
  137. package/dist/types/apps/backend/dist/types/controllers/recursiveAudit.controller.d.ts.map +1 -0
  138. package/dist/types/apps/backend/dist/types/controllers/reviewer.controller.d.ts +69 -0
  139. package/dist/types/apps/backend/dist/types/controllers/reviewer.controller.d.ts.map +1 -0
  140. package/dist/types/apps/backend/dist/types/controllers/searchDoc.controller.d.ts +19 -0
  141. package/dist/types/apps/backend/dist/types/controllers/searchDoc.controller.d.ts.map +1 -0
  142. package/dist/types/apps/backend/dist/types/controllers/showcaseProject.controller.d.ts +76 -0
  143. package/dist/types/apps/backend/dist/types/controllers/showcaseProject.controller.d.ts.map +1 -0
  144. package/dist/types/apps/backend/dist/types/controllers/stripe.controller.d.ts +148 -0
  145. package/dist/types/apps/backend/dist/types/controllers/stripe.controller.d.ts.map +1 -0
  146. package/dist/types/apps/backend/dist/types/controllers/tag.controller.d.ts +34 -0
  147. package/dist/types/apps/backend/dist/types/controllers/tag.controller.d.ts.map +1 -0
  148. package/dist/types/apps/backend/dist/types/controllers/translation.controller.d.ts +15 -0
  149. package/dist/types/apps/backend/dist/types/controllers/translation.controller.d.ts.map +1 -0
  150. package/dist/types/apps/backend/dist/types/controllers/user.controller.d.ts +51 -0
  151. package/dist/types/apps/backend/dist/types/controllers/user.controller.d.ts.map +1 -0
  152. package/dist/types/apps/backend/dist/types/export.d.ts +37 -0
  153. package/dist/types/apps/backend/dist/types/routes/ai.routes.d.ts +1 -0
  154. package/dist/types/apps/backend/dist/types/routes/asset.routes.d.ts +1 -0
  155. package/dist/types/apps/backend/dist/types/routes/audit.routes.d.ts +1 -0
  156. package/dist/types/apps/backend/dist/types/routes/bitbucket.routes.d.ts +1 -0
  157. package/dist/types/apps/backend/dist/types/routes/dictionary.routes.d.ts +1 -0
  158. package/dist/types/apps/backend/dist/types/routes/environment.routes.d.ts +1 -0
  159. package/dist/types/apps/backend/dist/types/routes/github.routes.d.ts +1 -0
  160. package/dist/types/apps/backend/dist/types/routes/gitlab.routes.d.ts +1 -0
  161. package/dist/types/apps/backend/dist/types/routes/newsletter.routes.d.ts +1 -0
  162. package/dist/types/apps/backend/dist/types/routes/organization.routes.d.ts +1 -0
  163. package/dist/types/apps/backend/dist/types/routes/project.routes.d.ts +1 -0
  164. package/dist/types/apps/backend/dist/types/routes/reviewer.routes.d.ts +1 -0
  165. package/dist/types/apps/backend/dist/types/routes/showcaseProject.routes.d.ts +1 -0
  166. package/dist/types/apps/backend/dist/types/routes/stripe.routes.d.ts +1 -0
  167. package/dist/types/apps/backend/dist/types/routes/translate.routes.d.ts +1 -0
  168. package/dist/types/apps/backend/dist/types/routes/user.routes.d.ts +1 -0
  169. package/dist/types/apps/backend/dist/types/services/audit/types.d.ts +34 -0
  170. package/dist/types/apps/backend/dist/types/services/audit/types.d.ts.map +1 -0
  171. package/dist/types/apps/backend/dist/types/services/ci.service.d.ts +1 -0
  172. package/dist/types/apps/backend/dist/types/services/github.service.d.ts +1 -0
  173. package/dist/types/apps/backend/dist/types/services/subscription.service.d.ts +13 -0
  174. package/dist/types/apps/backend/dist/types/services/subscription.service.d.ts.map +1 -0
  175. package/dist/types/apps/backend/dist/types/types/affiliate.types.d.ts +39 -0
  176. package/dist/types/apps/backend/dist/types/types/affiliate.types.d.ts.map +1 -0
  177. package/dist/types/apps/backend/dist/types/types/affiliateInvitation.types.d.ts +26 -0
  178. package/dist/types/apps/backend/dist/types/types/affiliateInvitation.types.d.ts.map +1 -0
  179. package/dist/types/apps/backend/dist/types/types/aiStats.types.d.ts +23 -0
  180. package/dist/types/apps/backend/dist/types/types/aiStats.types.d.ts.map +1 -0
  181. package/dist/types/apps/backend/dist/types/types/asset.types.d.ts +31 -0
  182. package/dist/types/apps/backend/dist/types/types/asset.types.d.ts.map +1 -0
  183. package/dist/types/apps/backend/dist/types/types/dictionary.types.d.ts +65 -0
  184. package/dist/types/apps/backend/dist/types/types/dictionary.types.d.ts.map +1 -0
  185. package/dist/types/apps/backend/dist/types/types/discussion.types.d.ts +42 -0
  186. package/dist/types/apps/backend/dist/types/types/discussion.types.d.ts.map +1 -0
  187. package/dist/types/apps/backend/dist/types/types/oAuth2.types.d.ts +16 -0
  188. package/dist/types/apps/backend/dist/types/types/oAuth2.types.d.ts.map +1 -0
  189. package/dist/types/apps/backend/dist/types/types/organization.types.d.ts +98 -0
  190. package/dist/types/apps/backend/dist/types/types/organization.types.d.ts.map +1 -0
  191. package/dist/types/apps/backend/dist/types/types/plan.types.d.ts +23 -0
  192. package/dist/types/apps/backend/dist/types/types/plan.types.d.ts.map +1 -0
  193. package/dist/types/apps/backend/dist/types/types/project.types.d.ts +122 -0
  194. package/dist/types/apps/backend/dist/types/types/project.types.d.ts.map +1 -0
  195. package/dist/types/apps/backend/dist/types/types/projectInsights.types.d.ts +52 -0
  196. package/dist/types/apps/backend/dist/types/types/projectInsights.types.d.ts.map +1 -0
  197. package/dist/types/apps/backend/dist/types/types/promoCode.types.d.ts +26 -0
  198. package/dist/types/apps/backend/dist/types/types/promoCode.types.d.ts.map +1 -0
  199. package/dist/types/apps/backend/dist/types/types/reviewer.types.d.ts +49 -0
  200. package/dist/types/apps/backend/dist/types/types/reviewer.types.d.ts.map +1 -0
  201. package/dist/types/apps/backend/dist/types/types/session.types.d.ts +2 -0
  202. package/dist/types/apps/backend/dist/types/types/showcaseProject.types.d.ts +59 -0
  203. package/dist/types/apps/backend/dist/types/types/showcaseProject.types.d.ts.map +1 -0
  204. package/dist/types/apps/backend/dist/types/types/tag.types.d.ts +31 -0
  205. package/dist/types/apps/backend/dist/types/types/tag.types.d.ts.map +1 -0
  206. package/dist/types/apps/backend/dist/types/types/user.types.d.ts +32 -0
  207. package/dist/types/apps/backend/dist/types/types/user.types.d.ts.map +1 -0
  208. package/dist/types/apps/backend/dist/types/utils/AI/askDocQuestion/askDocQuestion.d.ts +10 -0
  209. package/dist/types/apps/backend/dist/types/utils/AI/askDocQuestion/askDocQuestion.d.ts.map +1 -0
  210. package/dist/types/apps/backend/dist/types/utils/AI/auditDictionary/index.d.ts +15 -0
  211. package/dist/types/apps/backend/dist/types/utils/AI/auditDictionary/index.d.ts.map +1 -0
  212. package/dist/types/apps/backend/dist/types/utils/AI/auditDictionaryField/index.d.ts +12 -0
  213. package/dist/types/apps/backend/dist/types/utils/AI/auditDictionaryField/index.d.ts.map +1 -0
  214. package/dist/types/apps/backend/dist/types/utils/AI/auditDictionaryMetadata/index.d.ts +2 -0
  215. package/dist/types/apps/backend/dist/types/utils/AI/auditTag/index.d.ts +10 -0
  216. package/dist/types/apps/backend/dist/types/utils/AI/auditTag/index.d.ts.map +1 -0
  217. package/dist/types/apps/backend/dist/types/utils/AI/chat/index.d.ts +16 -0
  218. package/dist/types/apps/backend/dist/types/utils/AI/chat/index.d.ts.map +1 -0
  219. package/dist/types/apps/backend/dist/types/utils/AI/customQuery/index.d.ts +11 -0
  220. package/dist/types/apps/backend/dist/types/utils/AI/customQuery/index.d.ts.map +1 -0
  221. package/dist/types/apps/backend/dist/types/utils/AI/translateJSON/index.d.ts +20 -0
  222. package/dist/types/apps/backend/dist/types/utils/AI/translateJSON/index.d.ts.map +1 -0
  223. package/dist/types/apps/backend/dist/types/utils/auth/getAuth.d.ts +1 -0
  224. package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getDictionaryFiltersAndPagination.d.ts +41 -0
  225. package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getDictionaryFiltersAndPagination.d.ts.map +1 -0
  226. package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getDiscussionFiltersAndPagination.d.ts +19 -0
  227. package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getDiscussionFiltersAndPagination.d.ts.map +1 -0
  228. package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getFiltersAndPaginationFromBody.d.ts +11 -0
  229. package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getFiltersAndPaginationFromBody.d.ts.map +1 -0
  230. package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getOrganizationFiltersAndPagination.d.ts +25 -0
  231. package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getOrganizationFiltersAndPagination.d.ts.map +1 -0
  232. package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getProjectFiltersAndPagination.d.ts +18 -0
  233. package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getProjectFiltersAndPagination.d.ts.map +1 -0
  234. package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getTagFiltersAndPagination.d.ts +16 -0
  235. package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getTagFiltersAndPagination.d.ts.map +1 -0
  236. package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getUserFiltersAndPagination.d.ts +20 -0
  237. package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getUserFiltersAndPagination.d.ts.map +1 -0
  238. package/dist/types/apps/backend/dist/types/utils/httpStatusCodes.d.ts +408 -0
  239. package/dist/types/apps/backend/dist/types/utils/httpStatusCodes.d.ts.map +1 -0
  240. package/dist/types/apps/backend/dist/types/utils/mongoDB/types.d.ts +10 -0
  241. package/dist/types/apps/backend/dist/types/utils/mongoDB/types.d.ts.map +1 -0
  242. package/dist/types/apps/backend/dist/types/utils/permissions.d.ts +1 -0
  243. package/dist/types/apps/backend/dist/types/utils/responseData.d.ts +27 -0
  244. package/dist/types/apps/backend/dist/types/utils/responseData.d.ts.map +1 -0
  245. package/dist/types/cms/createAuthManager.d.ts +103 -0
  246. package/dist/types/cms/createAuthManager.d.ts.map +1 -0
  247. package/dist/types/cms/createIntlayerCMS.d.ts +80 -0
  248. package/dist/types/cms/createIntlayerCMS.d.ts.map +1 -0
  249. package/dist/types/cms/index.d.ts +3 -0
  250. package/dist/types/distantDictionary/fetchDistantDictionaries.d.ts +1 -1
  251. package/dist/types/distantDictionary/fetchDistantDictionaries.d.ts.map +1 -1
  252. package/dist/types/distantDictionary/fetchDistantDictionary.d.ts +1 -1
  253. package/dist/types/distantDictionary/fetchDistantDictionary.d.ts.map +1 -1
  254. package/dist/types/getIntlayerAPI/ai.d.ts +22 -2
  255. package/dist/types/getIntlayerAPI/ai.d.ts.map +1 -1
  256. package/dist/types/getIntlayerAPI/asset.d.ts +20 -1
  257. package/dist/types/getIntlayerAPI/asset.d.ts.map +1 -1
  258. package/dist/types/getIntlayerAPI/audit.d.ts +25 -2
  259. package/dist/types/getIntlayerAPI/audit.d.ts.map +1 -1
  260. package/dist/types/getIntlayerAPI/bitbucket.d.ts +15 -1
  261. package/dist/types/getIntlayerAPI/bitbucket.d.ts.map +1 -1
  262. package/dist/types/getIntlayerAPI/dictionary.d.ts +19 -2
  263. package/dist/types/getIntlayerAPI/dictionary.d.ts.map +1 -1
  264. package/dist/types/getIntlayerAPI/editor.d.ts +13 -1
  265. package/dist/types/getIntlayerAPI/editor.d.ts.map +1 -1
  266. package/dist/types/getIntlayerAPI/environment.d.ts +17 -2
  267. package/dist/types/getIntlayerAPI/environment.d.ts.map +1 -1
  268. package/dist/types/getIntlayerAPI/github.d.ts +16 -1
  269. package/dist/types/getIntlayerAPI/github.d.ts.map +1 -1
  270. package/dist/types/getIntlayerAPI/gitlab.d.ts +15 -1
  271. package/dist/types/getIntlayerAPI/gitlab.d.ts.map +1 -1
  272. package/dist/types/getIntlayerAPI/index.d.ts +3 -1
  273. package/dist/types/getIntlayerAPI/index.d.ts.map +1 -1
  274. package/dist/types/getIntlayerAPI/newsletter.d.ts +14 -2
  275. package/dist/types/getIntlayerAPI/newsletter.d.ts.map +1 -1
  276. package/dist/types/getIntlayerAPI/oAuth.d.ts +2 -0
  277. package/dist/types/getIntlayerAPI/oAuth.d.ts.map +1 -1
  278. package/dist/types/getIntlayerAPI/organization.d.ts +24 -2
  279. package/dist/types/getIntlayerAPI/organization.d.ts.map +1 -1
  280. package/dist/types/getIntlayerAPI/project.d.ts +32 -2
  281. package/dist/types/getIntlayerAPI/project.d.ts.map +1 -1
  282. package/dist/types/getIntlayerAPI/reviewer.d.ts +651 -17
  283. package/dist/types/getIntlayerAPI/reviewer.d.ts.map +1 -1
  284. package/dist/types/getIntlayerAPI/search.d.ts +12 -2
  285. package/dist/types/getIntlayerAPI/search.d.ts.map +1 -1
  286. package/dist/types/getIntlayerAPI/showcaseProject.d.ts +23 -2
  287. package/dist/types/getIntlayerAPI/showcaseProject.d.ts.map +1 -1
  288. package/dist/types/getIntlayerAPI/status.d.ts +36 -0
  289. package/dist/types/getIntlayerAPI/status.d.ts.map +1 -0
  290. package/dist/types/getIntlayerAPI/stripe.d.ts +68 -2
  291. package/dist/types/getIntlayerAPI/stripe.d.ts.map +1 -1
  292. package/dist/types/getIntlayerAPI/tag.d.ts +15 -2
  293. package/dist/types/getIntlayerAPI/tag.d.ts.map +1 -1
  294. package/dist/types/getIntlayerAPI/translate.d.ts +37 -2
  295. package/dist/types/getIntlayerAPI/translate.d.ts.map +1 -1
  296. package/dist/types/getIntlayerAPI/user.d.ts +24 -3
  297. package/dist/types/getIntlayerAPI/user.d.ts.map +1 -1
  298. package/dist/types/index.d.ts +28 -22
  299. package/dist/types/packages/@intlayer/ai/dist/types/aiSdk.d.ts +115 -0
  300. package/dist/types/packages/@intlayer/ai/dist/types/aiSdk.d.ts.map +1 -0
  301. package/dist/types/packages/@intlayer/ai/dist/types/auditDictionaryMetadata/index.d.ts +12 -0
  302. package/dist/types/packages/@intlayer/ai/dist/types/auditDictionaryMetadata/index.d.ts.map +1 -0
  303. package/dist/types/packages/@intlayer/ai/dist/types/customQuery.d.ts +8 -0
  304. package/dist/types/packages/@intlayer/ai/dist/types/customQuery.d.ts.map +1 -0
  305. package/dist/types/packages/@intlayer/ai/dist/types/index.d.ts +27 -0
  306. package/dist/types/packages/@intlayer/ai/dist/types/index.d.ts.map +1 -0
  307. package/dist/types/packages/@intlayer/ai/dist/types/translateJSON/index.d.ts +10 -0
  308. package/dist/types/packages/@intlayer/ai/dist/types/translateJSON/index.d.ts.map +1 -0
  309. package/dist/types/packages/@intlayer/core/dist/types/messageFormat/ICU.d.ts +1 -0
  310. package/dist/types/packages/@intlayer/core/dist/types/messageFormat/i18next.d.ts +1 -0
  311. package/dist/types/packages/@intlayer/core/dist/types/messageFormat/index.d.ts +1 -0
  312. package/dist/types/packages/@intlayer/core/dist/types/messageFormat/po.d.ts +1 -0
  313. package/dist/types/packages/@intlayer/core/dist/types/messageFormat/resolveMessage.d.ts +1 -0
  314. package/dist/types/packages/@intlayer/core/dist/types/messageFormat/vue-i18n.d.ts +1 -0
  315. package/dist/types/packages/@intlayer/engine/dist/types/build.d.ts +1 -0
  316. package/dist/types/packages/@intlayer/engine/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts +2 -0
  317. package/dist/types/packages/@intlayer/engine/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts +2 -0
  318. package/dist/types/packages/@intlayer/engine/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts +3 -0
  319. package/dist/types/packages/@intlayer/engine/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts +2 -0
  320. package/dist/types/packages/@intlayer/engine/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts +2 -0
  321. package/dist/types/packages/@intlayer/engine/dist/types/cleanOutputDir.d.ts +1 -0
  322. package/dist/types/packages/@intlayer/engine/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts +1 -0
  323. package/dist/types/packages/@intlayer/engine/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts +1 -0
  324. package/dist/types/packages/@intlayer/engine/dist/types/createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts +1 -0
  325. package/dist/types/packages/@intlayer/engine/dist/types/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts +1 -0
  326. package/dist/types/packages/@intlayer/engine/dist/types/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts +1 -0
  327. package/dist/types/packages/@intlayer/engine/dist/types/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts +1 -0
  328. package/dist/types/packages/@intlayer/engine/dist/types/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts +1 -0
  329. package/dist/types/packages/@intlayer/engine/dist/types/createType/createModuleAugmentation.d.ts +1 -0
  330. package/dist/types/packages/@intlayer/engine/dist/types/createType/createType.d.ts +2 -0
  331. package/dist/types/packages/@intlayer/engine/dist/types/formatDictionary.d.ts +1 -0
  332. package/dist/types/packages/@intlayer/engine/dist/types/loadDictionaries/loadContentDeclaration.d.ts +2 -0
  333. package/dist/types/packages/@intlayer/engine/dist/types/loadDictionaries/loadDictionaries.d.ts +2 -0
  334. package/dist/types/packages/@intlayer/engine/dist/types/loadDictionaries/loadLocalDictionaries.d.ts +2 -0
  335. package/dist/types/packages/@intlayer/engine/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts +1 -0
  336. package/dist/types/packages/@intlayer/engine/dist/types/prepareIntlayer.d.ts +1 -0
  337. package/dist/types/packages/@intlayer/engine/dist/types/writeConfiguration/index.d.ts +1 -0
  338. package/dist/types/packages/@intlayer/engine/dist/types/writeContentDeclaration/dictionaryStatus.d.ts +6 -0
  339. package/dist/types/packages/@intlayer/engine/dist/types/writeContentDeclaration/dictionaryStatus.d.ts.map +1 -0
  340. package/dist/types/packages/@intlayer/engine/dist/types/writeContentDeclaration/transformJSFile.d.ts +2 -0
  341. package/dist/types/packages/@intlayer/engine/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts +3 -0
  342. package/dist/types/packages/@intlayer/engine/dist/types/writeContentDeclaration/writeJSFile.d.ts +2 -0
  343. package/dist/types/packages/intlayer-editor/server/dist/controllers/dictionary.controller.d.ts +1 -1
  344. package/dist/types/proxy.d.ts +11 -9
  345. package/dist/types/proxy.d.ts.map +1 -1
  346. package/dist/types/types.d.ts +1 -1
  347. package/package.json +19 -3
@@ -1,4 +1,5 @@
1
1
  import { fetcher } from "../fetcher.mjs";
2
+ import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
2
3
  import { editor } from "@intlayer/config/built";
3
4
 
4
5
  //#region src/getIntlayerAPI/organization.ts
@@ -34,6 +35,15 @@ const getOrganizationAPI = (authAPIOptions = {}, intlayerConfig) => {
34
35
  body: organization
35
36
  });
36
37
  /**
38
+ * Updates the per-organization transactional mailer configuration.
39
+ * @param body - Mailer configuration. Secrets are optional; omit to keep the
40
+ * value already stored.
41
+ */
42
+ const updateOrganizationMailerConfig = async (body, otherOptions = {}) => fetcher(`${ORGANIZATION_API_ROUTE}/mailer-config`, authAPIOptions, otherOptions, {
43
+ method: "PUT",
44
+ body
45
+ });
46
+ /**
37
47
  * Update members to the organization in the database.
38
48
  * @param body - Updated organization members data.
39
49
  */
@@ -84,6 +94,7 @@ const getOrganizationAPI = (authAPIOptions = {}, intlayerConfig) => {
84
94
  addOrganization,
85
95
  addOrganizationMember,
86
96
  updateOrganization,
97
+ updateOrganizationMailerConfig,
87
98
  updateOrganizationMembers,
88
99
  updateOrganizationMembersById,
89
100
  deleteOrganization,
@@ -92,7 +103,14 @@ const getOrganizationAPI = (authAPIOptions = {}, intlayerConfig) => {
92
103
  unselectOrganization
93
104
  };
94
105
  };
106
+ /**
107
+ * Authenticated `organization` endpoint bound to an Intlayer CMS authenticator.
108
+ *
109
+ * Pass an authenticator created with `createIntlayerCMS`, or omit it to use
110
+ * the build-time configuration (`@intlayer/config/built`).
111
+ */
112
+ const organizationEndpoint = createEndpoint(getOrganizationAPI);
95
113
 
96
114
  //#endregion
97
- export { getOrganizationAPI };
115
+ export { getOrganizationAPI, organizationEndpoint };
98
116
  //# sourceMappingURL=organization.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"organization.mjs","names":[],"sources":["../../../src/getIntlayerAPI/organization.ts"],"sourcesContent":["import type {\n AddOrganizationBody,\n AddOrganizationMemberBody,\n AddOrganizationMemberResult,\n AddOrganizationResult,\n DeleteOrganizationResult,\n GetOrganizationParam,\n GetOrganizationResult,\n GetOrganizationsParams,\n GetOrganizationsResult,\n SelectOrganizationParam,\n SelectOrganizationResult,\n UnselectOrganizationResult,\n UpdateOrganizationBody,\n UpdateOrganizationMembersBody,\n UpdateOrganizationMembersResult,\n UpdateOrganizationResult,\n} from '@intlayer/backend';\nimport { editor } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getOrganizationAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL ?? editor.backendURL;\n\n const ORGANIZATION_API_ROUTE = `${backendURL}/api/organization`;\n\n /**\n * Retrieves a list of organizations based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getOrganizations = async (\n filters?: GetOrganizationsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetOrganizationsResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n // @ts-ignore Number of parameter will be stringified by the fetcher\n params: filters,\n }\n );\n\n /**\n * Retrieves an organization by its ID.\n * @param organizationId - Organization ID.\n */\n const getOrganization = async (\n organizationId: GetOrganizationParam['organizationId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,\n authAPIOptions,\n otherOptions\n );\n\n /**\n * Adds a new organization to the database.\n * @param organization - Organization data.\n */\n const addOrganization = async (\n organization: AddOrganizationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: organization,\n }\n );\n\n /**\n * Updates an existing organization in the database.\n * @param organization - Updated organization data.\n */\n const updateOrganization = async (\n organization: UpdateOrganizationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: organization,\n }\n );\n\n /**\n * Update members to the organization in the database.\n * @param body - Updated organization members data.\n */\n const updateOrganizationMembers = async (\n body: UpdateOrganizationMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationMembersResult>(\n `${ORGANIZATION_API_ROUTE}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /**\n * Admin-only: Update members of any organization by ID\n * @param organizationId - Organization ID\n * @param body - Updated organization members data.\n */\n const updateOrganizationMembersById = async (\n organizationId: string,\n body: UpdateOrganizationMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationMembersResult>(\n `${ORGANIZATION_API_ROUTE}/${organizationId}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /**\n * Add member to the organization in the database.\n * @param body - Updated organization members data.\n */\n const addOrganizationMember = async (\n body: AddOrganizationMemberBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<AddOrganizationMemberResult>(\n `${ORGANIZATION_API_ROUTE}/member`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Deletes an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const deleteOrganization = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<DeleteOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n /**\n * Admin-only: Deletes any organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const deleteOrganizationByIdAdmin = async (\n organizationId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<DeleteOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/${organizationId}/admin`,\n authAPIOptions,\n otherOptions,\n { method: 'DELETE' }\n );\n\n /**\n * Select an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const selectOrganization = async (\n organizationId: SelectOrganizationParam['organizationId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SelectOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n }\n );\n\n /**\n * Unselect an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const unselectOrganization = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<UnselectOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/logout`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n return {\n getOrganizations,\n getOrganization,\n addOrganization,\n addOrganizationMember,\n updateOrganization,\n updateOrganizationMembers,\n updateOrganizationMembersById,\n deleteOrganization,\n deleteOrganizationByIdAdmin,\n selectOrganization,\n unselectOrganization,\n };\n};\n"],"mappings":";;;;AAsBA,MAAa,sBACX,iBAAiC,EAAE,EACnC,mBACG;CAGH,MAAM,yBAAyB,GAFZ,gBAAgB,QAAQ,cAAc,OAAO,WAEnB;;;;;CAM7C,MAAM,mBAAmB,OACvB,SACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,wBACA,gBACA,cACA;EACE,OAAO;EAEP,QAAQ;EACT,CACF;;;;;CAMH,MAAM,kBAAkB,OACtB,gBACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,uBAAuB,GAAG,OAAO,eAAe,IACnD,gBACA,aACD;;;;;CAMH,MAAM,kBAAkB,OACtB,cACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,wBACA,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,qBAAqB,OACzB,cACA,eAA+B,EAAE,KAEjC,QACE,wBACA,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,4BAA4B,OAChC,MACA,eAA+B,EAAE,KAEjC,QACE,GAAG,uBAAuB,WAC1B,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;;CAOH,MAAM,gCAAgC,OACpC,gBACA,MACA,eAA+B,EAAE,KAEjC,QACE,GAAG,uBAAuB,GAAG,eAAe,WAC5C,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,wBAAwB,OAC5B,MACA,eAA+B,EAAE,KAEjC,QACE,GAAG,uBAAuB,UAC1B,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,qBAAqB,OAAO,eAA+B,EAAE,KACjE,MAAM,QACJ,wBACA,gBACA,cACA,EACE,QAAQ,UACT,CACF;;;;;CAMH,MAAM,8BAA8B,OAClC,gBACA,eAA+B,EAAE,KAEjC,QACE,GAAG,uBAAuB,GAAG,eAAe,SAC5C,gBACA,cACA,EAAE,QAAQ,UAAU,CACrB;;;;;CAMH,MAAM,qBAAqB,OACzB,gBACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,uBAAuB,GAAG,OAAO,eAAe,IACnD,gBACA,cACA,EACE,QAAQ,OACT,CACF;;;;;CAMH,MAAM,uBAAuB,OAAO,eAA+B,EAAE,KACnE,MAAM,QACJ,GAAG,uBAAuB,UAC1B,gBACA,cACA,EACE,QAAQ,QACT,CACF;AAEH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
1
+ {"version":3,"file":"organization.mjs","names":[],"sources":["../../../src/getIntlayerAPI/organization.ts"],"sourcesContent":["import type {\n AddOrganizationBody,\n AddOrganizationMemberBody,\n AddOrganizationMemberResult,\n AddOrganizationResult,\n DeleteOrganizationResult,\n GetOrganizationParam,\n GetOrganizationResult,\n GetOrganizationsParams,\n GetOrganizationsResult,\n SelectOrganizationParam,\n SelectOrganizationResult,\n UnselectOrganizationResult,\n UpdateOrganizationBody,\n UpdateOrganizationMailerConfigBody,\n UpdateOrganizationMailerConfigResult,\n UpdateOrganizationMembersBody,\n UpdateOrganizationMembersResult,\n UpdateOrganizationResult,\n} from '@intlayer/backend';\nimport { editor } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { createEndpoint } from '../cms/createIntlayerCMS';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getOrganizationAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL ?? editor.backendURL;\n\n const ORGANIZATION_API_ROUTE = `${backendURL}/api/organization`;\n\n /**\n * Retrieves a list of organizations based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getOrganizations = async (\n filters?: GetOrganizationsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetOrganizationsResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n // @ts-ignore Number of parameter will be stringified by the fetcher\n params: filters,\n }\n );\n\n /**\n * Retrieves an organization by its ID.\n * @param organizationId - Organization ID.\n */\n const getOrganization = async (\n organizationId: GetOrganizationParam['organizationId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,\n authAPIOptions,\n otherOptions\n );\n\n /**\n * Adds a new organization to the database.\n * @param organization - Organization data.\n */\n const addOrganization = async (\n organization: AddOrganizationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: organization,\n }\n );\n\n /**\n * Updates an existing organization in the database.\n * @param organization - Updated organization data.\n */\n const updateOrganization = async (\n organization: UpdateOrganizationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: organization,\n }\n );\n\n /**\n * Updates the per-organization transactional mailer configuration.\n * @param body - Mailer configuration. Secrets are optional; omit to keep the\n * value already stored.\n */\n const updateOrganizationMailerConfig = async (\n body: UpdateOrganizationMailerConfigBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationMailerConfigResult>(\n `${ORGANIZATION_API_ROUTE}/mailer-config`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /**\n * Update members to the organization in the database.\n * @param body - Updated organization members data.\n */\n const updateOrganizationMembers = async (\n body: UpdateOrganizationMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationMembersResult>(\n `${ORGANIZATION_API_ROUTE}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /**\n * Admin-only: Update members of any organization by ID\n * @param organizationId - Organization ID\n * @param body - Updated organization members data.\n */\n const updateOrganizationMembersById = async (\n organizationId: string,\n body: UpdateOrganizationMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationMembersResult>(\n `${ORGANIZATION_API_ROUTE}/${organizationId}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /**\n * Add member to the organization in the database.\n * @param body - Updated organization members data.\n */\n const addOrganizationMember = async (\n body: AddOrganizationMemberBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<AddOrganizationMemberResult>(\n `${ORGANIZATION_API_ROUTE}/member`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Deletes an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const deleteOrganization = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<DeleteOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n /**\n * Admin-only: Deletes any organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const deleteOrganizationByIdAdmin = async (\n organizationId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<DeleteOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/${organizationId}/admin`,\n authAPIOptions,\n otherOptions,\n { method: 'DELETE' }\n );\n\n /**\n * Select an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const selectOrganization = async (\n organizationId: SelectOrganizationParam['organizationId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SelectOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n }\n );\n\n /**\n * Unselect an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const unselectOrganization = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<UnselectOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/logout`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n return {\n getOrganizations,\n getOrganization,\n addOrganization,\n addOrganizationMember,\n updateOrganization,\n updateOrganizationMailerConfig,\n updateOrganizationMembers,\n updateOrganizationMembersById,\n deleteOrganization,\n deleteOrganizationByIdAdmin,\n selectOrganization,\n unselectOrganization,\n };\n};\n\n/**\n * Authenticated `organization` endpoint bound to an Intlayer CMS authenticator.\n *\n * Pass an authenticator created with `createIntlayerCMS`, or omit it to use\n * the build-time configuration (`@intlayer/config/built`).\n */\nexport const organizationEndpoint = createEndpoint(getOrganizationAPI);\n"],"mappings":";;;;;AAyBA,MAAa,sBACX,iBAAiC,EAAE,EACnC,mBACG;CAGH,MAAM,yBAAyB,GAFZ,gBAAgB,QAAQ,cAAc,OAAO,WAEnB;;;;;CAM7C,MAAM,mBAAmB,OACvB,SACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,wBACA,gBACA,cACA;EACE,OAAO;EAEP,QAAQ;EACT,CACF;;;;;CAMH,MAAM,kBAAkB,OACtB,gBACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,uBAAuB,GAAG,OAAO,eAAe,IACnD,gBACA,aACD;;;;;CAMH,MAAM,kBAAkB,OACtB,cACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,wBACA,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,qBAAqB,OACzB,cACA,eAA+B,EAAE,KAEjC,QACE,wBACA,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;;CAOH,MAAM,iCAAiC,OACrC,MACA,eAA+B,EAAE,KAEjC,QACE,GAAG,uBAAuB,iBAC1B,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,4BAA4B,OAChC,MACA,eAA+B,EAAE,KAEjC,QACE,GAAG,uBAAuB,WAC1B,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;;CAOH,MAAM,gCAAgC,OACpC,gBACA,MACA,eAA+B,EAAE,KAEjC,QACE,GAAG,uBAAuB,GAAG,eAAe,WAC5C,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,wBAAwB,OAC5B,MACA,eAA+B,EAAE,KAEjC,QACE,GAAG,uBAAuB,UAC1B,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,qBAAqB,OAAO,eAA+B,EAAE,KACjE,MAAM,QACJ,wBACA,gBACA,cACA,EACE,QAAQ,UACT,CACF;;;;;CAMH,MAAM,8BAA8B,OAClC,gBACA,eAA+B,EAAE,KAEjC,QACE,GAAG,uBAAuB,GAAG,eAAe,SAC5C,gBACA,cACA,EAAE,QAAQ,UAAU,CACrB;;;;;CAMH,MAAM,qBAAqB,OACzB,gBACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,uBAAuB,GAAG,OAAO,eAAe,IACnD,gBACA,cACA,EACE,QAAQ,OACT,CACF;;;;;CAMH,MAAM,uBAAuB,OAAO,eAA+B,EAAE,KACnE,MAAM,QACJ,GAAG,uBAAuB,UAC1B,gBACA,cACA,EACE,QAAQ,QACT,CACF;AAEH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;;;;;;;;AASH,MAAa,uBAAuB,eAAe,mBAAmB"}
@@ -1,4 +1,5 @@
1
1
  import { fetcher } from "../fetcher.mjs";
2
+ import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
2
3
  import { editor } from "@intlayer/config/built";
3
4
 
4
5
  //#region src/getIntlayerAPI/project.ts
@@ -160,7 +161,14 @@ const getProjectAPI = (authAPIOptions = {}, intlayerConfig) => {
160
161
  updateMemberAccess
161
162
  };
162
163
  };
164
+ /**
165
+ * Authenticated `project` endpoint bound to an Intlayer CMS authenticator.
166
+ *
167
+ * Pass an authenticator created with `createIntlayerCMS`, or omit it to use
168
+ * the build-time configuration (`@intlayer/config/built`).
169
+ */
170
+ const projectEndpoint = createEndpoint(getProjectAPI);
163
171
 
164
172
  //#endregion
165
- export { getProjectAPI };
173
+ export { getProjectAPI, projectEndpoint };
166
174
  //# sourceMappingURL=project.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"project.mjs","names":[],"sources":["../../../src/getIntlayerAPI/project.ts"],"sourcesContent":["import type {\n AddNewAccessKeyBody,\n AddNewAccessKeyResponse,\n AddProjectBody,\n AddProjectResult,\n DeleteAccessKeyBody,\n DeleteAccessKeyResponse,\n DeleteProjectResult,\n GetProjectInsightsResult,\n GetProjectsParams,\n GetProjectsResult,\n PushProjectConfigurationBody,\n PushProjectConfigurationResult,\n RefreshAccessKeyBody,\n RefreshAccessKeyResponse,\n ResponseData,\n SelectProjectParam,\n SelectProjectResult,\n TriggerBuildResult,\n TriggerWebhookBody,\n TriggerWebhookResult,\n UnselectProjectResult,\n UpdateMemberAccessBody,\n UpdateMemberAccessResult,\n UpdateProjectBody,\n UpdateProjectMembersBody,\n UpdateProjectMembersResult,\n UpdateProjectResult,\n} from '@intlayer/backend';\nimport { editor } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getProjectAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL ?? editor.backendURL;\n\n const PROJECT_API_ROUTE = `${backendURL}/api/project`;\n\n /**\n * Retrieves a list of projects based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getProjects = async (\n filters?: GetProjectsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetProjectsResult>(\n PROJECT_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n // @ts-ignore Number of parameter will be stringified by the fetcher\n params: filters,\n }\n );\n\n /**\n * Retrieves aggregated localization insights for the currently selected\n * project (locale/key counts, per-locale completion, missing translations,\n * recent activity, team/config status).\n */\n const getProjectInsights = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetProjectInsightsResult>(\n `${PROJECT_API_ROUTE}/insights`,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n method: 'GET',\n }\n );\n\n /**\n * Adds a new project to the database.\n * @param project - Project data.\n */\n const addProject = async (\n project: AddProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: project,\n }\n );\n\n /**\n * Updates an existing project in the database.\n * @param project - Updated project data.\n */\n const updateProject = async (\n project: UpdateProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: project,\n }\n );\n\n /**\n * Updates project members in the database.\n * @param project - Updated project data.\n */\n const updateProjectMembers = async (\n body: UpdateProjectMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateProjectMembersResult>(\n `${PROJECT_API_ROUTE}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /** Pushes a project configuration to the database.\n * @param projectConfiguration - Project configuration data.\n */\n const pushProjectConfiguration = async (\n projectConfiguration: PushProjectConfigurationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<PushProjectConfigurationResult>(\n `${PROJECT_API_ROUTE}/configuration`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: projectConfiguration,\n }\n );\n\n /**\n * Deletes a project from the database by its ID.\n * @param id - Project ID.\n */\n const deleteProject = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<DeleteProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n /**\n * Admin-only: Deletes any project from the database by its ID.\n * @param projectId - Project ID.\n */\n const deleteProjectByIdAdmin = async (\n projectId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<DeleteProjectResult>(\n `${PROJECT_API_ROUTE}/${projectId}/admin`,\n authAPIOptions,\n otherOptions,\n { method: 'DELETE' }\n );\n\n /**\n * Select a project from the database by its ID.\n * @param projectId - Organization ID.\n */\n const selectProject = async (\n projectId: SelectProjectParam['projectId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SelectProjectResult>(\n `${PROJECT_API_ROUTE}/${String(projectId)}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n }\n );\n\n /**\n * Unselect a project from the database by its ID.\n * @param projectId - Project ID.\n */\n const unselectProject = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<UnselectProjectResult>(\n `${PROJECT_API_ROUTE}/logout`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n /**\n * Add a new access key to a project.\n * @param accessKey - Access key data.\n * @param otherOptions - Fetcher options.\n * @returns The new access key.\n */\n const addNewAccessKey = async (\n accessKey: AddNewAccessKeyBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddNewAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: accessKey,\n }\n );\n\n /**\n * Delete a project access key.\n * @param clientId - Access key client ID.\n * @param otherOptions - Fetcher options.\n * @returns The deleted project.\n */\n const deleteAccessKey = async (\n clientId: DeleteAccessKeyBody['clientId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<DeleteAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n body: { clientId },\n }\n );\n\n /**\n * Refreshes an access key from a project.\n * @param clientId - The ID of the client to refresh.\n * @param projectId - The ID of the project to refresh the access key from.\n * @returns The new access key.\n */\n const refreshAccessKey = async (\n clientId: RefreshAccessKeyBody['clientId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<RefreshAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PATCH',\n body: { clientId },\n }\n );\n\n /**\n * Triggers CI builds for a project (Git provider pipelines and webhooks).\n * @param otherOptions - Fetcher options.\n * @returns The trigger results.\n */\n const triggerBuild = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<TriggerBuildResult>(\n `${PROJECT_API_ROUTE}/build`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n /**\n * Triggers a single webhook by index.\n * @param webhookIndex - The index of the webhook to trigger.\n * @param otherOptions - Fetcher options.\n * @returns The trigger result.\n */\n const triggerWebhook = async (\n webhookIndex: TriggerWebhookBody['webhookIndex'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<TriggerWebhookResult>(\n `${PROJECT_API_ROUTE}/webhook`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: { webhookIndex },\n }\n );\n\n /**\n * Get CI configuration status for the current project.\n * @param otherOptions - Fetcher options.\n * @returns The CI configuration status.\n */\n const getCIConfig = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<ResponseData<any>>(\n `${PROJECT_API_ROUTE}/ci`,\n authAPIOptions,\n otherOptions,\n {\n method: 'GET',\n }\n );\n\n /**\n * Push CI configuration file to the repository.\n * @param otherOptions - Fetcher options.\n * @returns Success status.\n */\n const pushCIConfig = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<ResponseData<any>>(\n `${PROJECT_API_ROUTE}/ci`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n /**\n * Updates granular access constraints for a project member.\n * @param userId - The user ID to update access for.\n * @param body - The new access constraints.\n */\n const updateMemberAccess = async (\n userId: string,\n body: UpdateMemberAccessBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateMemberAccessResult>(\n `${PROJECT_API_ROUTE}/member/${userId}/access`,\n authAPIOptions,\n otherOptions,\n { method: 'PUT', body }\n );\n\n return {\n getProjects,\n getProjectInsights,\n addProject,\n updateProject,\n updateProjectMembers,\n pushProjectConfiguration,\n deleteProject,\n deleteProjectByIdAdmin,\n selectProject,\n unselectProject,\n addNewAccessKey,\n deleteAccessKey,\n refreshAccessKey,\n triggerBuild,\n triggerWebhook,\n getCIConfig,\n pushCIConfig,\n updateMemberAccess,\n };\n};\n"],"mappings":";;;;AAiCA,MAAa,iBACX,iBAAiC,EAAE,EACnC,mBACG;CAGH,MAAM,oBAAoB,GAFP,gBAAgB,QAAQ,cAAc,OAAO,WAExB;;;;;CAMxC,MAAM,cAAc,OAClB,SACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,mBACA,gBACA,cACA;EACE,OAAO;EAEP,QAAQ;EACT,CACF;;;;;;CAOH,MAAM,qBAAqB,OAAO,eAA+B,EAAE,KACjE,MAAM,QACJ,GAAG,kBAAkB,YACrB,gBACA,cACA;EACE,OAAO;EACP,QAAQ;EACT,CACF;;;;;CAMH,MAAM,aAAa,OACjB,SACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,qBACH,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,gBAAgB,OACpB,SACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,qBACH,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,uBAAuB,OAC3B,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,kBAAkB,WACrB,gBACA,cACA;EACE,QAAQ;EACR;EACD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E,KAEjC,MAAM,QACJ,GAAG,kBAAkB,WACrB,gBACA,cACA;EACE,QAAQ;EACR,MAAM,EAAE,cAAc;EACvB,CACF;;;;;;CAOH,MAAM,cAAc,OAAO,eAA+B,EAAE,KAC1D,MAAM,QACJ,GAAG,kBAAkB,MACrB,gBACA,cACA,EACE,QAAQ,OACT,CACF;;;;;;CAOH,MAAM,eAAe,OAAO,eAA+B,EAAE,KAC3D,MAAM,QACJ,GAAG,kBAAkB,MACrB,gBACA,cACA,EACE,QAAQ,QACT,CACF;;;;;;CAOH,MAAM,qBAAqB,OACzB,QACA,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,kBAAkB,UAAU,OAAO,UACtC,gBACA,cACA;EAAE,QAAQ;EAAO;EAAM,CACxB;AAEH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
1
+ {"version":3,"file":"project.mjs","names":[],"sources":["../../../src/getIntlayerAPI/project.ts"],"sourcesContent":["import type {\n AddNewAccessKeyBody,\n AddNewAccessKeyResponse,\n AddProjectBody,\n AddProjectResult,\n DeleteAccessKeyBody,\n DeleteAccessKeyResponse,\n DeleteProjectResult,\n GetProjectInsightsResult,\n GetProjectsParams,\n GetProjectsResult,\n PushProjectConfigurationBody,\n PushProjectConfigurationResult,\n RefreshAccessKeyBody,\n RefreshAccessKeyResponse,\n ResponseData,\n SelectProjectParam,\n SelectProjectResult,\n TriggerBuildResult,\n TriggerWebhookBody,\n TriggerWebhookResult,\n UnselectProjectResult,\n UpdateMemberAccessBody,\n UpdateMemberAccessResult,\n UpdateProjectBody,\n UpdateProjectMembersBody,\n UpdateProjectMembersResult,\n UpdateProjectResult,\n} from '@intlayer/backend';\nimport { editor } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { createEndpoint } from '../cms/createIntlayerCMS';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getProjectAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL ?? editor.backendURL;\n\n const PROJECT_API_ROUTE = `${backendURL}/api/project`;\n\n /**\n * Retrieves a list of projects based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getProjects = async (\n filters?: GetProjectsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetProjectsResult>(\n PROJECT_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n // @ts-ignore Number of parameter will be stringified by the fetcher\n params: filters,\n }\n );\n\n /**\n * Retrieves aggregated localization insights for the currently selected\n * project (locale/key counts, per-locale completion, missing translations,\n * recent activity, team/config status).\n */\n const getProjectInsights = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetProjectInsightsResult>(\n `${PROJECT_API_ROUTE}/insights`,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n method: 'GET',\n }\n );\n\n /**\n * Adds a new project to the database.\n * @param project - Project data.\n */\n const addProject = async (\n project: AddProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: project,\n }\n );\n\n /**\n * Updates an existing project in the database.\n * @param project - Updated project data.\n */\n const updateProject = async (\n project: UpdateProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: project,\n }\n );\n\n /**\n * Updates project members in the database.\n * @param project - Updated project data.\n */\n const updateProjectMembers = async (\n body: UpdateProjectMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateProjectMembersResult>(\n `${PROJECT_API_ROUTE}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /** Pushes a project configuration to the database.\n * @param projectConfiguration - Project configuration data.\n */\n const pushProjectConfiguration = async (\n projectConfiguration: PushProjectConfigurationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<PushProjectConfigurationResult>(\n `${PROJECT_API_ROUTE}/configuration`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: projectConfiguration,\n }\n );\n\n /**\n * Deletes a project from the database by its ID.\n * @param id - Project ID.\n */\n const deleteProject = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<DeleteProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n /**\n * Admin-only: Deletes any project from the database by its ID.\n * @param projectId - Project ID.\n */\n const deleteProjectByIdAdmin = async (\n projectId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<DeleteProjectResult>(\n `${PROJECT_API_ROUTE}/${projectId}/admin`,\n authAPIOptions,\n otherOptions,\n { method: 'DELETE' }\n );\n\n /**\n * Select a project from the database by its ID.\n * @param projectId - Organization ID.\n */\n const selectProject = async (\n projectId: SelectProjectParam['projectId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SelectProjectResult>(\n `${PROJECT_API_ROUTE}/${String(projectId)}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n }\n );\n\n /**\n * Unselect a project from the database by its ID.\n * @param projectId - Project ID.\n */\n const unselectProject = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<UnselectProjectResult>(\n `${PROJECT_API_ROUTE}/logout`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n /**\n * Add a new access key to a project.\n * @param accessKey - Access key data.\n * @param otherOptions - Fetcher options.\n * @returns The new access key.\n */\n const addNewAccessKey = async (\n accessKey: AddNewAccessKeyBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddNewAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: accessKey,\n }\n );\n\n /**\n * Delete a project access key.\n * @param clientId - Access key client ID.\n * @param otherOptions - Fetcher options.\n * @returns The deleted project.\n */\n const deleteAccessKey = async (\n clientId: DeleteAccessKeyBody['clientId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<DeleteAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n body: { clientId },\n }\n );\n\n /**\n * Refreshes an access key from a project.\n * @param clientId - The ID of the client to refresh.\n * @param projectId - The ID of the project to refresh the access key from.\n * @returns The new access key.\n */\n const refreshAccessKey = async (\n clientId: RefreshAccessKeyBody['clientId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<RefreshAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PATCH',\n body: { clientId },\n }\n );\n\n /**\n * Triggers CI builds for a project (Git provider pipelines and webhooks).\n * @param otherOptions - Fetcher options.\n * @returns The trigger results.\n */\n const triggerBuild = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<TriggerBuildResult>(\n `${PROJECT_API_ROUTE}/build`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n /**\n * Triggers a single webhook by index.\n * @param webhookIndex - The index of the webhook to trigger.\n * @param otherOptions - Fetcher options.\n * @returns The trigger result.\n */\n const triggerWebhook = async (\n webhookIndex: TriggerWebhookBody['webhookIndex'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<TriggerWebhookResult>(\n `${PROJECT_API_ROUTE}/webhook`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: { webhookIndex },\n }\n );\n\n /**\n * Get CI configuration status for the current project.\n * @param otherOptions - Fetcher options.\n * @returns The CI configuration status.\n */\n const getCIConfig = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<ResponseData<any>>(\n `${PROJECT_API_ROUTE}/ci`,\n authAPIOptions,\n otherOptions,\n {\n method: 'GET',\n }\n );\n\n /**\n * Push CI configuration file to the repository.\n * @param otherOptions - Fetcher options.\n * @returns Success status.\n */\n const pushCIConfig = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<ResponseData<any>>(\n `${PROJECT_API_ROUTE}/ci`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n /**\n * Updates granular access constraints for a project member.\n * @param userId - The user ID to update access for.\n * @param body - The new access constraints.\n */\n const updateMemberAccess = async (\n userId: string,\n body: UpdateMemberAccessBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateMemberAccessResult>(\n `${PROJECT_API_ROUTE}/member/${userId}/access`,\n authAPIOptions,\n otherOptions,\n { method: 'PUT', body }\n );\n\n return {\n getProjects,\n getProjectInsights,\n addProject,\n updateProject,\n updateProjectMembers,\n pushProjectConfiguration,\n deleteProject,\n deleteProjectByIdAdmin,\n selectProject,\n unselectProject,\n addNewAccessKey,\n deleteAccessKey,\n refreshAccessKey,\n triggerBuild,\n triggerWebhook,\n getCIConfig,\n pushCIConfig,\n updateMemberAccess,\n };\n};\n\n/**\n * Authenticated `project` endpoint bound to an Intlayer CMS authenticator.\n *\n * Pass an authenticator created with `createIntlayerCMS`, or omit it to use\n * the build-time configuration (`@intlayer/config/built`).\n */\nexport const projectEndpoint = createEndpoint(getProjectAPI);\n"],"mappings":";;;;;AAkCA,MAAa,iBACX,iBAAiC,EAAE,EACnC,mBACG;CAGH,MAAM,oBAAoB,GAFP,gBAAgB,QAAQ,cAAc,OAAO,WAExB;;;;;CAMxC,MAAM,cAAc,OAClB,SACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,mBACA,gBACA,cACA;EACE,OAAO;EAEP,QAAQ;EACT,CACF;;;;;;CAOH,MAAM,qBAAqB,OAAO,eAA+B,EAAE,KACjE,MAAM,QACJ,GAAG,kBAAkB,YACrB,gBACA,cACA;EACE,OAAO;EACP,QAAQ;EACT,CACF;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ACA,cACA;EACE,QAAQ;EACR,MAAM,EAAE,UAAU;EACnB,CACF;;;;;;;CAQH,MAAM,mBAAmB,OACvB,UACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,kBAAkB,cACrB,gBACA,cACA;EACE,QAAQ;EACR,MAAM,EAAE,UAAU;EACnB,CACF;;;;;;CAOH,MAAM,eAAe,OAAO,eAA+B,EAAE,KAC3D,MAAM,QACJ,GAAG,kBAAkB,SACrB,gBACA,cACA,EACE,QAAQ,QACT,CACF;;;;;;;CAQH,MAAM,iBAAiB,OACrB,cACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,kBAAkB,WACrB,gBACA,cACA;EACE,QAAQ;EACR,MAAM,EAAE,cAAc;EACvB,CACF;;;;;;CAOH,MAAM,cAAc,OAAO,eAA+B,EAAE,KAC1D,MAAM,QACJ,GAAG,kBAAkB,MACrB,gBACA,cACA,EACE,QAAQ,OACT,CACF;;;;;;CAOH,MAAM,eAAe,OAAO,eAA+B,EAAE,KAC3D,MAAM,QACJ,GAAG,kBAAkB,MACrB,gBACA,cACA,EACE,QAAQ,QACT,CACF;;;;;;CAOH,MAAM,qBAAqB,OACzB,QACA,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,kBAAkB,UAAU,OAAO,UACtC,gBACA,cACA;EAAE,QAAQ;EAAO;EAAM,CACxB;AAEH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;;;;;;;;AASH,MAAa,kBAAkB,eAAe,cAAc"}
@@ -1,4 +1,5 @@
1
1
  import { fetcher } from "../fetcher.mjs";
2
+ import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
2
3
  import { editor } from "@intlayer/config/built";
3
4
 
4
5
  //#region src/getIntlayerAPI/reviewer.ts
@@ -126,7 +127,14 @@ const getReviewerAPI = (authAPIOptions = {}, intlayerConfig) => {
126
127
  getAdminReviewers
127
128
  };
128
129
  };
130
+ /**
131
+ * Authenticated `reviewer` endpoint bound to an Intlayer CMS authenticator.
132
+ *
133
+ * Pass an authenticator created with `createIntlayerCMS`, or omit it to use
134
+ * the build-time configuration (`@intlayer/config/built`).
135
+ */
136
+ const reviewerEndpoint = createEndpoint(getReviewerAPI);
129
137
 
130
138
  //#endregion
131
- export { getReviewerAPI };
139
+ export { getReviewerAPI, reviewerEndpoint };
132
140
  //# sourceMappingURL=reviewer.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"reviewer.mjs","names":[],"sources":["../../../src/getIntlayerAPI/reviewer.ts"],"sourcesContent":["import type {\n CreateMissionBody,\n EstimateMissionBody,\n GetMarketplaceQuery,\n MissionEstimate,\n PaginatedResponse,\n PriceDistributionData,\n RegisterReviewerBody,\n ResponseData,\n ReviewerMessageAPI,\n ReviewerProfileAPI,\n ReviewerReviewAPI,\n SendMessageBody,\n SubmitReviewBody,\n TranslationMissionAPI,\n UpdateMissionStatusBody,\n UpdateReviewerBody,\n UploadReviewerPictureResult,\n} from '@intlayer/backend';\nimport { editor } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getReviewerAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL ?? editor.backendURL;\n const BASE = `${backendURL}/api/reviewer`;\n\n // ── Marketplace ────────────────────────────────────────────────────────────\n\n const getMarketplace = (\n params: GetMarketplaceQuery = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const searchParams = new URLSearchParams();\n for (const [key, value] of Object.entries(params)) {\n if (value === undefined) continue;\n if (Array.isArray(value)) {\n value.forEach((item) => {\n searchParams.append(key, String(item));\n });\n } else {\n searchParams.append(key, String(value));\n }\n }\n const query = searchParams.toString();\n\n return fetcher<PaginatedResponse<ReviewerProfileAPI>>(\n `${BASE}/marketplace${query ? `?${query}` : ''}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n const getPriceDistribution = (\n params: Pick<\n GetMarketplaceQuery,\n 'fromLocale' | 'toLocale' | 'minRating' | 'categories'\n > = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const searchParams = new URLSearchParams();\n for (const [key, value] of Object.entries(params)) {\n if (value === undefined) continue;\n if (Array.isArray(value)) {\n value.forEach((item) => {\n searchParams.append(key, String(item));\n });\n } else {\n searchParams.append(key, String(value));\n }\n }\n const query = searchParams.toString();\n return fetcher<ResponseData<PriceDistributionData>>(\n `${BASE}/marketplace/price-distribution${query ? `?${query}` : ''}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n const getReviewerById = (\n reviewerId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerProfileAPI>>(\n `${BASE}/${reviewerId}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const getReviewerReviews = (\n reviewerId: string,\n params: { page?: number; pageSize?: number } = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const query = new URLSearchParams(\n Object.fromEntries(\n Object.entries(params)\n .filter(([, v]) => v !== undefined)\n .map(([k, v]) => [k, String(v)])\n )\n ).toString();\n return fetcher<PaginatedResponse<ReviewerReviewAPI>>(\n `${BASE}/${reviewerId}/reviews${query ? `?${query}` : ''}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n // ── My profile ─────────────────────────────────────────────────────────────\n\n const getMyReviewerProfile = (otherOptions: FetcherOptions = {}) =>\n fetcher<ResponseData<ReviewerProfileAPI | null>>(\n `${BASE}/me`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const registerAsReviewer = (\n body: RegisterReviewerBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerProfileAPI>>(\n `${BASE}/register`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const updateReviewerProfile = (\n body: UpdateReviewerBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerProfileAPI>>(\n `${BASE}/`,\n authAPIOptions,\n otherOptions,\n { method: 'PUT', body }\n );\n\n const deleteReviewerProfile = (otherOptions: FetcherOptions = {}) =>\n fetcher<ResponseData<null>>(BASE, authAPIOptions, otherOptions, {\n method: 'DELETE',\n });\n\n // ── Contact ────────────────────────────────────────────────────────────────\n\n const contactReviewer = (\n reviewerId: string,\n body: { message: string },\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<null>>(\n `${BASE}/${reviewerId}/contact`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n // ── Missions ───────────────────────────────────────────────────────────────\n\n const estimateMission = (\n body: EstimateMissionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<MissionEstimate>>(\n `${BASE}/mission/estimate`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const createMission = (\n body: CreateMissionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<TranslationMissionAPI>>(\n `${BASE}/mission`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const getMyMissions = (\n params: {\n role?: 'client' | 'reviewer';\n page?: number;\n pageSize?: number;\n } = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const query = new URLSearchParams(\n Object.fromEntries(\n Object.entries(params)\n .filter(([, v]) => v !== undefined)\n .map(([k, v]) => [k, String(v)])\n )\n ).toString();\n return fetcher<PaginatedResponse<TranslationMissionAPI>>(\n `${BASE}/mission${query ? `?${query}` : ''}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n const getMissionById = (\n missionId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<TranslationMissionAPI>>(\n `${BASE}/mission/${missionId}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const updateMissionStatus = (\n missionId: string,\n body: UpdateMissionStatusBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<TranslationMissionAPI>>(\n `${BASE}/mission/${missionId}/status`,\n authAPIOptions,\n otherOptions,\n { method: 'PUT', body }\n );\n\n // ── Reviews ────────────────────────────────────────────────────────────────\n\n const submitReview = (\n missionId: string,\n body: SubmitReviewBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerReviewAPI>>(\n `${BASE}/mission/${missionId}/review`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n // ── Chat ───────────────────────────────────────────────────────────────────\n\n const getChatHistory = (\n missionId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerMessageAPI[]>>(\n `${BASE}/mission/${missionId}/chat/history`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const sendMessage = (\n missionId: string,\n body: SendMessageBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerMessageAPI>>(\n `${BASE}/mission/${missionId}/chat`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const getChatStreamUrl = (missionId: string) =>\n `${BASE}/mission/${missionId}/chat/stream`;\n\n // ── Picture uploads ────────────────────────────────────────────────────────\n\n const uploadPicture = async (\n kind: 'main' | 'cover',\n file: File,\n otherOptions: FetcherOptions = {}\n ): Promise<UploadReviewerPictureResult> => {\n const buffer = await file.arrayBuffer();\n\n const baseHeaders: Record<string, string> = {\n 'Content-Type': file.type || 'image/jpeg',\n };\n\n const authHeaders =\n (authAPIOptions.headers as Record<string, string> | undefined) ?? {};\n\n const response = await fetch(`${BASE}/me/picture/${kind}`, {\n method: 'POST',\n credentials: 'include',\n headers: { ...authHeaders, ...baseHeaders },\n body: buffer,\n signal: otherOptions.signal as AbortSignal | undefined,\n });\n\n if (!response.ok) {\n const result = await response.json();\n throw new Error(JSON.stringify(result.error) ?? 'Picture upload failed');\n }\n\n return (await response.json()) as UploadReviewerPictureResult;\n };\n\n const uploadMainPicture = (file: File, otherOptions: FetcherOptions = {}) =>\n uploadPicture('main', file, otherOptions);\n\n const uploadCoverPicture = (file: File, otherOptions: FetcherOptions = {}) =>\n uploadPicture('cover', file, otherOptions);\n\n // ── Admin ──────────────────────────────────────────────────────────────────\n\n const validateReviewerProfile = (\n reviewerId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerProfileAPI>>(\n `${BASE}/${reviewerId}/validate`,\n authAPIOptions,\n otherOptions,\n { method: 'PUT' }\n );\n\n const getAdminReviewers = (\n params: { page?: number; pageSize?: number; status?: string } = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const query = new URLSearchParams(\n Object.fromEntries(\n Object.entries(params)\n .filter(([, v]) => v !== undefined)\n .map(([k, v]) => [k, String(v)])\n )\n ).toString();\n return fetcher<PaginatedResponse<ReviewerProfileAPI>>(\n `${BASE}/admin/reviewers${query ? `?${query}` : ''}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n return {\n getMarketplace,\n getPriceDistribution,\n getReviewerById,\n getReviewerReviews,\n getMyReviewerProfile,\n registerAsReviewer,\n updateReviewerProfile,\n deleteReviewerProfile,\n estimateMission,\n createMission,\n getMyMissions,\n getMissionById,\n updateMissionStatus,\n submitReview,\n contactReviewer,\n getChatHistory,\n sendMessage,\n getChatStreamUrl,\n uploadMainPicture,\n uploadCoverPicture,\n validateReviewerProfile,\n getAdminReviewers,\n };\n};\n"],"mappings":";;;;AAuBA,MAAa,kBACX,iBAAiC,EAAE,EACnC,mBACG;CAEH,MAAM,OAAO,GADM,gBAAgB,QAAQ,cAAc,OAAO,WACrC;CAI3B,MAAM,kBACJ,SAA8B,EAAE,EAChC,eAA+B,EAAE,KAC9B;EACH,MAAM,eAAe,IAAI,iBAAiB;AAC1C,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,OAAO,EAAE;AACjD,OAAI,UAAU,OAAW;AACzB,OAAI,MAAM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EAAE,QAAQ,OAAO,CAClB;CAEH,MAAM,qBACJ,SAAgE,EAAE,EAClE,eAA+B,EAAE,KAC9B;EACH,MAAM,QAAQ,IAAI,gBAChB,OAAO,YACL,OAAO,QAAQ,OAAO,CACnB,QAAQ,GAAG,OAAO,MAAM,OAAU,CAClC,KAAK,CAAC,GAAG,OAAO,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC,CACnC,CACF,CAAC,UAAU;AACZ,SAAO,QACL,GAAG,KAAK,kBAAkB,QAAQ,IAAI,UAAU,MAChD,gBACA,cACA,EAAE,QAAQ,OAAO,CAClB;;AAGH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
1
+ {"version":3,"file":"reviewer.mjs","names":[],"sources":["../../../src/getIntlayerAPI/reviewer.ts"],"sourcesContent":["import type {\n CreateMissionBody,\n EstimateMissionBody,\n GetMarketplaceQuery,\n MissionEstimate,\n PaginatedResponse,\n PriceDistributionData,\n RegisterReviewerBody,\n ResponseData,\n ReviewerMessageAPI,\n ReviewerProfileAPI,\n ReviewerReviewAPI,\n SendMessageBody,\n SubmitReviewBody,\n TranslationMissionAPI,\n UpdateMissionStatusBody,\n UpdateReviewerBody,\n UploadReviewerPictureResult,\n} from '@intlayer/backend';\nimport { editor } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { createEndpoint } from '../cms/createIntlayerCMS';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getReviewerAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL ?? editor.backendURL;\n const BASE = `${backendURL}/api/reviewer`;\n\n // ── Marketplace ────────────────────────────────────────────────────────────\n\n const getMarketplace = (\n params: GetMarketplaceQuery = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const searchParams = new URLSearchParams();\n for (const [key, value] of Object.entries(params)) {\n if (value === undefined) continue;\n if (Array.isArray(value)) {\n value.forEach((item) => {\n searchParams.append(key, String(item));\n });\n } else {\n searchParams.append(key, String(value));\n }\n }\n const query = searchParams.toString();\n\n return fetcher<PaginatedResponse<ReviewerProfileAPI>>(\n `${BASE}/marketplace${query ? `?${query}` : ''}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n const getPriceDistribution = (\n params: Pick<\n GetMarketplaceQuery,\n 'fromLocale' | 'toLocale' | 'minRating' | 'categories'\n > = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const searchParams = new URLSearchParams();\n for (const [key, value] of Object.entries(params)) {\n if (value === undefined) continue;\n if (Array.isArray(value)) {\n value.forEach((item) => {\n searchParams.append(key, String(item));\n });\n } else {\n searchParams.append(key, String(value));\n }\n }\n const query = searchParams.toString();\n return fetcher<ResponseData<PriceDistributionData>>(\n `${BASE}/marketplace/price-distribution${query ? `?${query}` : ''}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n const getReviewerById = (\n reviewerId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerProfileAPI>>(\n `${BASE}/${reviewerId}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const getReviewerReviews = (\n reviewerId: string,\n params: { page?: number; pageSize?: number } = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const query = new URLSearchParams(\n Object.fromEntries(\n Object.entries(params)\n .filter(([, v]) => v !== undefined)\n .map(([k, v]) => [k, String(v)])\n )\n ).toString();\n return fetcher<PaginatedResponse<ReviewerReviewAPI>>(\n `${BASE}/${reviewerId}/reviews${query ? `?${query}` : ''}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n // ── My profile ─────────────────────────────────────────────────────────────\n\n const getMyReviewerProfile = (otherOptions: FetcherOptions = {}) =>\n fetcher<ResponseData<ReviewerProfileAPI | null>>(\n `${BASE}/me`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const registerAsReviewer = (\n body: RegisterReviewerBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerProfileAPI>>(\n `${BASE}/register`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const updateReviewerProfile = (\n body: UpdateReviewerBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerProfileAPI>>(\n `${BASE}/`,\n authAPIOptions,\n otherOptions,\n { method: 'PUT', body }\n );\n\n const deleteReviewerProfile = (otherOptions: FetcherOptions = {}) =>\n fetcher<ResponseData<null>>(BASE, authAPIOptions, otherOptions, {\n method: 'DELETE',\n });\n\n // ── Contact ────────────────────────────────────────────────────────────────\n\n const contactReviewer = (\n reviewerId: string,\n body: { message: string },\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<null>>(\n `${BASE}/${reviewerId}/contact`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n // ── Missions ───────────────────────────────────────────────────────────────\n\n const estimateMission = (\n body: EstimateMissionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<MissionEstimate>>(\n `${BASE}/mission/estimate`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const createMission = (\n body: CreateMissionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<TranslationMissionAPI>>(\n `${BASE}/mission`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const getMyMissions = (\n params: {\n role?: 'client' | 'reviewer';\n page?: number;\n pageSize?: number;\n } = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const query = new URLSearchParams(\n Object.fromEntries(\n Object.entries(params)\n .filter(([, v]) => v !== undefined)\n .map(([k, v]) => [k, String(v)])\n )\n ).toString();\n return fetcher<PaginatedResponse<TranslationMissionAPI>>(\n `${BASE}/mission${query ? `?${query}` : ''}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n const getMissionById = (\n missionId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<TranslationMissionAPI>>(\n `${BASE}/mission/${missionId}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const updateMissionStatus = (\n missionId: string,\n body: UpdateMissionStatusBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<TranslationMissionAPI>>(\n `${BASE}/mission/${missionId}/status`,\n authAPIOptions,\n otherOptions,\n { method: 'PUT', body }\n );\n\n // ── Reviews ────────────────────────────────────────────────────────────────\n\n const submitReview = (\n missionId: string,\n body: SubmitReviewBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerReviewAPI>>(\n `${BASE}/mission/${missionId}/review`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n // ── Chat ───────────────────────────────────────────────────────────────────\n\n const getChatHistory = (\n missionId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerMessageAPI[]>>(\n `${BASE}/mission/${missionId}/chat/history`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const sendMessage = (\n missionId: string,\n body: SendMessageBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerMessageAPI>>(\n `${BASE}/mission/${missionId}/chat`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const getChatStreamUrl = (missionId: string) =>\n `${BASE}/mission/${missionId}/chat/stream`;\n\n // ── Picture uploads ────────────────────────────────────────────────────────\n\n const uploadPicture = async (\n kind: 'main' | 'cover',\n file: File,\n otherOptions: FetcherOptions = {}\n ): Promise<UploadReviewerPictureResult> => {\n const buffer = await file.arrayBuffer();\n\n const baseHeaders: Record<string, string> = {\n 'Content-Type': file.type || 'image/jpeg',\n };\n\n const authHeaders =\n (authAPIOptions.headers as Record<string, string> | undefined) ?? {};\n\n const response = await fetch(`${BASE}/me/picture/${kind}`, {\n method: 'POST',\n credentials: 'include',\n headers: { ...authHeaders, ...baseHeaders },\n body: buffer,\n signal: otherOptions.signal as AbortSignal | undefined,\n });\n\n if (!response.ok) {\n const result = await response.json();\n throw new Error(JSON.stringify(result.error) ?? 'Picture upload failed');\n }\n\n return (await response.json()) as UploadReviewerPictureResult;\n };\n\n const uploadMainPicture = (file: File, otherOptions: FetcherOptions = {}) =>\n uploadPicture('main', file, otherOptions);\n\n const uploadCoverPicture = (file: File, otherOptions: FetcherOptions = {}) =>\n uploadPicture('cover', file, otherOptions);\n\n // ── Admin ──────────────────────────────────────────────────────────────────\n\n const validateReviewerProfile = (\n reviewerId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerProfileAPI>>(\n `${BASE}/${reviewerId}/validate`,\n authAPIOptions,\n otherOptions,\n { method: 'PUT' }\n );\n\n const getAdminReviewers = (\n params: { page?: number; pageSize?: number; status?: string } = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const query = new URLSearchParams(\n Object.fromEntries(\n Object.entries(params)\n .filter(([, v]) => v !== undefined)\n .map(([k, v]) => [k, String(v)])\n )\n ).toString();\n return fetcher<PaginatedResponse<ReviewerProfileAPI>>(\n `${BASE}/admin/reviewers${query ? `?${query}` : ''}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n return {\n getMarketplace,\n getPriceDistribution,\n getReviewerById,\n getReviewerReviews,\n getMyReviewerProfile,\n registerAsReviewer,\n updateReviewerProfile,\n deleteReviewerProfile,\n estimateMission,\n createMission,\n getMyMissions,\n getMissionById,\n updateMissionStatus,\n submitReview,\n contactReviewer,\n getChatHistory,\n sendMessage,\n getChatStreamUrl,\n uploadMainPicture,\n uploadCoverPicture,\n validateReviewerProfile,\n getAdminReviewers,\n };\n};\n\n/**\n * Authenticated `reviewer` endpoint bound to an Intlayer CMS authenticator.\n *\n * Pass an authenticator created with `createIntlayerCMS`, or omit it to use\n * the build-time configuration (`@intlayer/config/built`).\n */\nexport const reviewerEndpoint = createEndpoint(getReviewerAPI);\n"],"mappings":";;;;;AAwBA,MAAa,kBACX,iBAAiC,EAAE,EACnC,mBACG;CAEH,MAAM,OAAO,GADM,gBAAgB,QAAQ,cAAc,OAAO,WACrC;CAI3B,MAAM,kBACJ,SAA8B,EAAE,EAChC,eAA+B,EAAE,KAC9B;EACH,MAAM,eAAe,IAAI,iBAAiB;AAC1C,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,OAAO,EAAE;AACjD,OAAI,UAAU,OAAW;AACzB,OAAI,MAAM,QAAQ,MAAM,CACtB,OAAM,SAAS,SAAS;AACtB,iBAAa,OAAO,KAAK,OAAO,KAAK,CAAC;KACtC;OAEF,cAAa,OAAO,KAAK,OAAO,MAAM,CAAC;;EAG3C,MAAM,QAAQ,aAAa,UAAU;AAErC,SAAO,QACL,GAAG,KAAK,cAAc,QAAQ,IAAI,UAAU,MAC5C,gBACA,cACA,EAAE,QAAQ,OAAO,CAClB;;CAGH,MAAM,wBACJ,SAGI,EAAE,EACN,eAA+B,EAAE,KAC9B;EACH,MAAM,eAAe,IAAI,iBAAiB;AAC1C,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,OAAO,EAAE;AACjD,OAAI,UAAU,OAAW;AACzB,OAAI,MAAM,QAAQ,MAAM,CACtB,OAAM,SAAS,SAAS;AACtB,iBAAa,OAAO,KAAK,OAAO,KAAK,CAAC;KACtC;OAEF,cAAa,OAAO,KAAK,OAAO,MAAM,CAAC;;EAG3C,MAAM,QAAQ,aAAa,UAAU;AACrC,SAAO,QACL,GAAG,KAAK,iCAAiC,QAAQ,IAAI,UAAU,MAC/D,gBACA,cACA,EAAE,QAAQ,OAAO,CAClB;;CAGH,MAAM,mBACJ,YACA,eAA+B,EAAE,KAEjC,QACE,GAAG,KAAK,GAAG,cACX,gBACA,cACA,EAAE,QAAQ,OAAO,CAClB;CAEH,MAAM,sBACJ,Y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AAC,SAAS,IAAI;GAChB,MAAM,SAAS,MAAM,SAAS,MAAM;AACpC,SAAM,IAAI,MAAM,KAAK,UAAU,OAAO,MAAM,IAAI,wBAAwB;;AAG1E,SAAQ,MAAM,SAAS,MAAM;;CAG/B,MAAM,qBAAqB,MAAY,eAA+B,EAAE,KACtE,cAAc,QAAQ,MAAM,aAAa;CAE3C,MAAM,sBAAsB,MAAY,eAA+B,EAAE,KACvE,cAAc,SAAS,MAAM,aAAa;CAI5C,MAAM,2BACJ,YACA,eAA+B,EAAE,KAEjC,QACE,GAAG,KAAK,GAAG,WAAW,YACtB,gBACA,cACA,EAAE,QAAQ,OAAO,CAClB;CAEH,MAAM,qBACJ,SAAgE,EAAE,EAClE,eAA+B,EAAE,KAC9B;EACH,MAAM,QAAQ,IAAI,gBAChB,OAAO,YACL,OAAO,QAAQ,OAAO,CACnB,QAAQ,GAAG,OAAO,MAAM,OAAU,CAClC,KAAK,CAAC,GAAG,OAAO,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC,CACnC,CACF,CAAC,UAAU;AACZ,SAAO,QACL,GAAG,KAAK,kBAAkB,QAAQ,IAAI,UAAU,MAChD,gBACA,cACA,EAAE,QAAQ,OAAO,CAClB;;AAGH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;;;;;;;;AASH,MAAa,mBAAmB,eAAe,eAAe"}
@@ -1,4 +1,5 @@
1
1
  import { fetcher } from "../fetcher.mjs";
2
+ import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
2
3
  import { editor } from "@intlayer/config/built";
3
4
 
4
5
  //#region src/getIntlayerAPI/search.ts
@@ -15,7 +16,14 @@ const getSearchAPI = (authAPIOptions = {}, intlayerConfig) => {
15
16
  });
16
17
  return { searchDoc };
17
18
  };
19
+ /**
20
+ * Authenticated `search` endpoint bound to an Intlayer CMS authenticator.
21
+ *
22
+ * Pass an authenticator created with `createIntlayerCMS`, or omit it to use
23
+ * the build-time configuration (`@intlayer/config/built`).
24
+ */
25
+ const searchEndpoint = createEndpoint(getSearchAPI);
18
26
 
19
27
  //#endregion
20
- export { getSearchAPI };
28
+ export { getSearchAPI, searchEndpoint };
21
29
  //# sourceMappingURL=search.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"search.mjs","names":[],"sources":["../../../src/getIntlayerAPI/search.ts"],"sourcesContent":["import type {\n SearchDocUtilParams,\n SearchDocUtilResult,\n} from '@intlayer/backend';\nimport { editor } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getSearchAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL ?? editor.backendURL;\n\n const AI_API_ROUTE = `${backendURL}/api/search`;\n\n /**\n * Search documentation\n * @param params - Search parameters containing the input query.\n * @returns Search results with GitHub URLs.\n */\n const searchDoc = async (\n params?: SearchDocUtilParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SearchDocUtilResult>(\n `${AI_API_ROUTE}/doc`,\n authAPIOptions,\n otherOptions,\n {\n method: 'GET',\n params: params,\n }\n );\n\n return {\n searchDoc,\n };\n};\n"],"mappings":";;;;AAQA,MAAa,gBACX,iBAAiC,EAAE,EACnC,mBACG;CAGH,MAAM,eAAe,GAFF,gBAAgB,QAAQ,cAAc,OAAO,WAE7B;;;;;;CAOnC,MAAM,YAAY,OAChB,QACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,aAAa,OAChB,gBACA,cACA;EACE,QAAQ;EACA;EACT,CACF;AAEH,QAAO,EACL,WACD"}
1
+ {"version":3,"file":"search.mjs","names":[],"sources":["../../../src/getIntlayerAPI/search.ts"],"sourcesContent":["import type {\n SearchDocUtilParams,\n SearchDocUtilResult,\n} from '@intlayer/backend';\nimport { editor } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { createEndpoint } from '../cms/createIntlayerCMS';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getSearchAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL ?? editor.backendURL;\n\n const AI_API_ROUTE = `${backendURL}/api/search`;\n\n /**\n * Search documentation\n * @param params - Search parameters containing the input query.\n * @returns Search results with GitHub URLs.\n */\n const searchDoc = async (\n params?: SearchDocUtilParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SearchDocUtilResult>(\n `${AI_API_ROUTE}/doc`,\n authAPIOptions,\n otherOptions,\n {\n method: 'GET',\n params: params,\n }\n );\n\n return {\n searchDoc,\n };\n};\n\n/**\n * Authenticated `search` endpoint bound to an Intlayer CMS authenticator.\n *\n * Pass an authenticator created with `createIntlayerCMS`, or omit it to use\n * the build-time configuration (`@intlayer/config/built`).\n */\nexport const searchEndpoint = createEndpoint(getSearchAPI);\n"],"mappings":";;;;;AASA,MAAa,gBACX,iBAAiC,EAAE,EACnC,mBACG;CAGH,MAAM,eAAe,GAFF,gBAAgB,QAAQ,cAAc,OAAO,WAE7B;;;;;;CAOnC,MAAM,YAAY,OAChB,QACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,aAAa,OAChB,gBACA,cACA;EACE,QAAQ;EACA;EACT,CACF;AAEH,QAAO,EACL,WACD;;;;;;;;AASH,MAAa,iBAAiB,eAAe,aAAa"}
@@ -1,4 +1,5 @@
1
1
  import { fetcher } from "../fetcher.mjs";
2
+ import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
2
3
  import { editor } from "@intlayer/config/built";
3
4
 
4
5
  //#region src/getIntlayerAPI/showcaseProject.ts
@@ -53,7 +54,14 @@ const getShowcaseProjectAPI = (authAPIOptions = {}, intlayerConfig) => {
53
54
  updateShowcaseProject
54
55
  };
55
56
  };
57
+ /**
58
+ * Authenticated `showcaseProject` endpoint bound to an Intlayer CMS authenticator.
59
+ *
60
+ * Pass an authenticator created with `createIntlayerCMS`, or omit it to use
61
+ * the build-time configuration (`@intlayer/config/built`).
62
+ */
63
+ const showcaseProjectEndpoint = createEndpoint(getShowcaseProjectAPI);
56
64
 
57
65
  //#endregion
58
- export { getShowcaseProjectAPI };
66
+ export { getShowcaseProjectAPI, showcaseProjectEndpoint };
59
67
  //# sourceMappingURL=showcaseProject.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"showcaseProject.mjs","names":[],"sources":["../../../src/getIntlayerAPI/showcaseProject.ts"],"sourcesContent":["import type {\n GetOtherShowcaseProjectsResult,\n GetShowcaseProjectByIdParams,\n GetShowcaseProjectByIdResult,\n GetShowcaseProjectsResult,\n SubmitShowcaseProjectBody,\n SubmitShowcaseProjectResult,\n ToggleShowcaseDownvoteBody,\n ToggleShowcaseDownvoteResult,\n ToggleShowcaseUpvoteBody,\n ToggleShowcaseUpvoteResult,\n UpdateShowcaseProjectBody,\n UpdateShowcaseProjectResult,\n} from '@intlayer/backend';\nimport { editor } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\n// Client-side query types use proper JS types (numbers/booleans) rather than\n// the backend querystring types which are always strings.\nexport type ShowcaseProjectsQuery = {\n page?: number;\n pageSize?: number;\n search?: string;\n selectedUseCases?: string[];\n isOpenSource?: boolean;\n};\n\nexport type OtherShowcaseProjectsQuery = {\n excludeId: string;\n limit?: number;\n};\n\nexport const getShowcaseProjectAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL ?? editor.backendURL;\n\n const SHOWCASE_API_ROUTE = `${backendURL}/api/showcase-project`;\n\n const getShowcaseProjects = async (\n query?: ShowcaseProjectsQuery,\n otherOptions: FetcherOptions = {}\n ) => {\n const params: Record<string, string | string[]> = {};\n if (query?.page !== undefined) params.page = String(query.page);\n if (query?.pageSize !== undefined) params.pageSize = String(query.pageSize);\n if (query?.search !== undefined) params.search = query.search;\n if (query?.isOpenSource !== undefined)\n params.isOpenSource = String(query.isOpenSource);\n if (query?.selectedUseCases?.length)\n params.selectedUseCases = query.selectedUseCases;\n\n return await fetcher<GetShowcaseProjectsResult>(\n SHOWCASE_API_ROUTE,\n authAPIOptions,\n otherOptions,\n { method: 'GET', params: params as any }\n );\n };\n\n const getShowcaseProjectById = async (\n projectId: GetShowcaseProjectByIdParams['projectId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetShowcaseProjectByIdResult>(\n `${SHOWCASE_API_ROUTE}/${projectId}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const getOtherShowcaseProjects = async (\n query: OtherShowcaseProjectsQuery,\n otherOptions: FetcherOptions = {}\n ) => {\n const params: Record<string, string> = { excludeId: query.excludeId };\n if (query.limit !== undefined) params.limit = String(query.limit);\n return await fetcher<GetOtherShowcaseProjectsResult>(\n `${SHOWCASE_API_ROUTE}/others`,\n authAPIOptions,\n otherOptions,\n { method: 'GET', params: params as any }\n );\n };\n\n const submitShowcaseProject = async (\n body: SubmitShowcaseProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SubmitShowcaseProjectResult>(\n `${SHOWCASE_API_ROUTE}/submit`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const toggleShowcaseUpvote = async (\n body: ToggleShowcaseUpvoteBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<ToggleShowcaseUpvoteResult>(\n `${SHOWCASE_API_ROUTE}/upvote`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const toggleShowcaseDownvote = async (\n body: ToggleShowcaseDownvoteBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<ToggleShowcaseDownvoteResult>(\n `${SHOWCASE_API_ROUTE}/downvote`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const deleteShowcaseProject = async (\n projectId: GetShowcaseProjectByIdParams['projectId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<{ data: { success: boolean } }>(\n `${SHOWCASE_API_ROUTE}/${projectId}`,\n authAPIOptions,\n otherOptions,\n { method: 'DELETE' }\n );\n\n const updateShowcaseProject = async (\n projectId: GetShowcaseProjectByIdParams['projectId'],\n body: UpdateShowcaseProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateShowcaseProjectResult>(\n `${SHOWCASE_API_ROUTE}/${projectId}`,\n authAPIOptions,\n otherOptions,\n { method: 'PATCH', body }\n );\n\n return {\n getShowcaseProjects,\n getShowcaseProjectById,\n getOtherShowcaseProjects,\n submitShowcaseProject,\n toggleShowcaseUpvote,\n toggleShowcaseDownvote,\n deleteShowcaseProject,\n updateShowcaseProject,\n };\n};\n"],"mappings":";;;;AAiCA,MAAa,yBACX,iBAAiC,EAAE,EACnC,mBACG;CAGH,MAAM,qBAAqB,GAFR,gBAAgB,QAAQ,cAAc,OAAO,WAEvB;CAEzC,MAAM,sBAAsB,OAC1B,OACA,eAA+B,EAAE,KAC9B;EACH,MAAM,SAA4C,EAAE;AACpD,MAAI,OAAO,SAAS,OAAW,QAAO,OAAO,OAAO,MAAM,KAAK;AAC/D,MAAI,OAAO,aAAa,OAAW,QAAO,WAAW,OAAO,MAAM,SAAS;AAC3E,MAAI,OAAO,WAAW,OAAW,QAAO,SAAS,MAAM;AACvD,MAAI,OAAO,iBAAiB,OAC1B,QAAO,eAAe,OAAO,MAAM,aAAa;AAClD,MAAI,OAAO,kBAAkB,OAC3B,QAAO,mBAAmB,MAAM;AAElC,SAAO,MAAM,QACX,oBACA,gBACA,cACA;GAAE,QAAQ;GAAe;GAAe,CACzC;;CAGH,MAAM,yBAAyB,OAC7B,WACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,mBAAmB,GAAG,aACzB,gBACA,cACA,EAAE,QAAQ,OAAO,CAClB;CAEH,MAAM,2BAA2B,OAC/B,OACA,eAA+B,EAAE,KAC9B;EACH,MAAM,SAAiC,EAAE,WAAW,MAAM,WAAW;AACrE,MAAI,MAAM,UAAU,OAAW,QAAO,QAAQ,OAAO,MAAM,MAAM;AACjE,SAAO,MAAM,QACX,GAAG,mBAAmB,UACtB,gBACA,cACA;GAAE,QAAQ;GAAe;GAAe,CACzC;;CAGH,MAAM,wBAAwB,OAC5B,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,mBAAmB,UACtB,gBACA,cACA;EAAE,QAAQ;EAAQ;EAAM,CACzB;CAEH,MAAM,uBAAuB,OAC3B,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,mBAAmB,UACtB,gBACA,cACA;EAAE,QAAQ;EAAQ;EAAM,CACzB;CAEH,MAAM,yBAAyB,OAC7B,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,mBAAmB,YACtB,gBACA,cACA;EAAE,QAAQ;EAAQ;EAAM,CACzB;CAEH,MAAM,wBAAwB,OAC5B,WACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,mBAAmB,GAAG,aACzB,gBACA,cACA,EAAE,QAAQ,UAAU,CACrB;CAEH,MAAM,wBAAwB,OAC5B,WACA,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,mBAAmB,GAAG,aACzB,gBACA,cACA;EAAE,QAAQ;EAAS;EAAM,CAC1B;AAEH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
1
+ {"version":3,"file":"showcaseProject.mjs","names":[],"sources":["../../../src/getIntlayerAPI/showcaseProject.ts"],"sourcesContent":["import type {\n GetOtherShowcaseProjectsResult,\n GetShowcaseProjectByIdParams,\n GetShowcaseProjectByIdResult,\n GetShowcaseProjectsResult,\n SubmitShowcaseProjectBody,\n SubmitShowcaseProjectResult,\n ToggleShowcaseDownvoteBody,\n ToggleShowcaseDownvoteResult,\n ToggleShowcaseUpvoteBody,\n ToggleShowcaseUpvoteResult,\n UpdateShowcaseProjectBody,\n UpdateShowcaseProjectResult,\n} from '@intlayer/backend';\nimport { editor } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { createEndpoint } from '../cms/createIntlayerCMS';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\n// Client-side query types use proper JS types (numbers/booleans) rather than\n// the backend querystring types which are always strings.\nexport type ShowcaseProjectsQuery = {\n page?: number;\n pageSize?: number;\n search?: string;\n selectedUseCases?: string[];\n isOpenSource?: boolean;\n};\n\nexport type OtherShowcaseProjectsQuery = {\n excludeId: string;\n limit?: number;\n};\n\nexport const getShowcaseProjectAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL ?? editor.backendURL;\n\n const SHOWCASE_API_ROUTE = `${backendURL}/api/showcase-project`;\n\n const getShowcaseProjects = async (\n query?: ShowcaseProjectsQuery,\n otherOptions: FetcherOptions = {}\n ) => {\n const params: Record<string, string | string[]> = {};\n if (query?.page !== undefined) params.page = String(query.page);\n if (query?.pageSize !== undefined) params.pageSize = String(query.pageSize);\n if (query?.search !== undefined) params.search = query.search;\n if (query?.isOpenSource !== undefined)\n params.isOpenSource = String(query.isOpenSource);\n if (query?.selectedUseCases?.length)\n params.selectedUseCases = query.selectedUseCases;\n\n return await fetcher<GetShowcaseProjectsResult>(\n SHOWCASE_API_ROUTE,\n authAPIOptions,\n otherOptions,\n { method: 'GET', params: params as any }\n );\n };\n\n const getShowcaseProjectById = async (\n projectId: GetShowcaseProjectByIdParams['projectId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetShowcaseProjectByIdResult>(\n `${SHOWCASE_API_ROUTE}/${projectId}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const getOtherShowcaseProjects = async (\n query: OtherShowcaseProjectsQuery,\n otherOptions: FetcherOptions = {}\n ) => {\n const params: Record<string, string> = { excludeId: query.excludeId };\n if (query.limit !== undefined) params.limit = String(query.limit);\n return await fetcher<GetOtherShowcaseProjectsResult>(\n `${SHOWCASE_API_ROUTE}/others`,\n authAPIOptions,\n otherOptions,\n { method: 'GET', params: params as any }\n );\n };\n\n const submitShowcaseProject = async (\n body: SubmitShowcaseProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SubmitShowcaseProjectResult>(\n `${SHOWCASE_API_ROUTE}/submit`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const toggleShowcaseUpvote = async (\n body: ToggleShowcaseUpvoteBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<ToggleShowcaseUpvoteResult>(\n `${SHOWCASE_API_ROUTE}/upvote`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const toggleShowcaseDownvote = async (\n body: ToggleShowcaseDownvoteBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<ToggleShowcaseDownvoteResult>(\n `${SHOWCASE_API_ROUTE}/downvote`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const deleteShowcaseProject = async (\n projectId: GetShowcaseProjectByIdParams['projectId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<{ data: { success: boolean } }>(\n `${SHOWCASE_API_ROUTE}/${projectId}`,\n authAPIOptions,\n otherOptions,\n { method: 'DELETE' }\n );\n\n const updateShowcaseProject = async (\n projectId: GetShowcaseProjectByIdParams['projectId'],\n body: UpdateShowcaseProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateShowcaseProjectResult>(\n `${SHOWCASE_API_ROUTE}/${projectId}`,\n authAPIOptions,\n otherOptions,\n { method: 'PATCH', body }\n );\n\n return {\n getShowcaseProjects,\n getShowcaseProjectById,\n getOtherShowcaseProjects,\n submitShowcaseProject,\n toggleShowcaseUpvote,\n toggleShowcaseDownvote,\n deleteShowcaseProject,\n updateShowcaseProject,\n };\n};\n\n/**\n * Authenticated `showcaseProject` endpoint bound to an Intlayer CMS authenticator.\n *\n * Pass an authenticator created with `createIntlayerCMS`, or omit it to use\n * the build-time configuration (`@intlayer/config/built`).\n */\nexport const showcaseProjectEndpoint = createEndpoint(getShowcaseProjectAPI);\n"],"mappings":";;;;;AAkCA,MAAa,yBACX,iBAAiC,EAAE,EACnC,mBACG;CAGH,MAAM,qBAAqB,GAFR,gBAAgB,QAAQ,cAAc,OAAO,WAEvB;CAEzC,MAAM,sBAAsB,OAC1B,OACA,eAA+B,EAAE,KAC9B;EACH,MAAM,SAA4C,EAAE;AACpD,MAAI,OAAO,SAAS,OAAW,QAAO,OAAO,OAAO,MAAM,KAAK;AAC/D,MAAI,OAAO,aAAa,OAAW,QAAO,WAAW,OAAO,MAAM,SAAS;AAC3E,MAAI,OAAO,WAAW,OAAW,QAAO,SAAS,MAAM;AACvD,MAAI,OAAO,iBAAiB,OAC1B,QAAO,eAAe,OAAO,MAAM,aAAa;AAClD,MAAI,OAAO,kBAAkB,OAC3B,QAAO,mBAAmB,MAAM;AAElC,SAAO,MAAM,QACX,oBACA,gBACA,cACA;GAAE,QAAQ;GAAe;GAAe,CACzC;;CAGH,MAAM,yBAAyB,OAC7B,WACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,mBAAmB,GAAG,aACzB,gBACA,cACA,EAAE,QAAQ,OAAO,CAClB;CAEH,MAAM,2BAA2B,OAC/B,OACA,eAA+B,EAAE,KAC9B;EACH,MAAM,SAAiC,EAAE,WAAW,MAAM,WAAW;AACrE,MAAI,MAAM,UAAU,OAAW,QAAO,QAAQ,OAAO,MAAM,MAAM;AACjE,SAAO,MAAM,QACX,GAAG,mBAAmB,UACtB,gBACA,cACA;GAAE,QAAQ;GAAe;GAAe,CACzC;;CAGH,MAAM,wBAAwB,OAC5B,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,mBAAmB,UACtB,gBACA,cACA;EAAE,QAAQ;EAAQ;EAAM,CACzB;CAEH,MAAM,uBAAuB,OAC3B,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,mBAAmB,UACtB,gBACA,cACA;EAAE,QAAQ;EAAQ;EAAM,CACzB;CAEH,MAAM,yBAAyB,OAC7B,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,mBAAmB,YACtB,gBACA,cACA;EAAE,QAAQ;EAAQ;EAAM,CACzB;CAEH,MAAM,wBAAwB,OAC5B,WACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,mBAAmB,GAAG,aACzB,gBACA,cACA,EAAE,QAAQ,UAAU,CACrB;CAEH,MAAM,wBAAwB,OAC5B,WACA,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,mBAAmB,GAAG,aACzB,gBACA,cACA;EAAE,QAAQ;EAAS;EAAM,CAC1B;AAEH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;;;;;;;;AASH,MAAa,0BAA0B,eAAe,sBAAsB"}
@@ -0,0 +1,46 @@
1
+ import { fetcher } from "../fetcher.mjs";
2
+ import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
3
+ import { editor } from "@intlayer/config/built";
4
+
5
+ //#region src/getIntlayerAPI/status.ts
6
+ /**
7
+ * Instance/entry status endpoints. These back the decisions made when an
8
+ * unauthenticated visitor reaches the app root:
9
+ * - `getSetupStatus` — on a self-hosted instance, whether the first
10
+ * super-admin still needs to be created.
11
+ * - `getDemoSession` — on the hosted cloud, signs the visitor into the shared
12
+ * read-only demo account (the backend sets the session cookie on the
13
+ * response).
14
+ */
15
+ const getStatusAPI = (authAPIOptions = {}, intlayerConfig) => {
16
+ const backendURL = intlayerConfig?.editor?.backendURL ?? editor.backendURL;
17
+ /**
18
+ * Reports whether the instance still needs its initial setup (creation of
19
+ * the first super-admin). Only ever `true` on a self-hosted deployment with
20
+ * an empty users collection. Public endpoint — no authentication required.
21
+ * @returns `{ isSetupRequired: boolean }`.
22
+ */
23
+ const getSetupStatus = async (otherOptions = {}) => await fetcher(`${backendURL}/api/user/setup`, authAPIOptions, otherOptions, { cache: "no-store" });
24
+ /**
25
+ * Signs the current browser into the shared demo account. The backend
26
+ * responds with a `Set-Cookie` header establishing the demo session, so this
27
+ * must run with credentials included (the default in the fetcher).
28
+ * @returns `{ ok: boolean }`.
29
+ */
30
+ const getDemoSession = async (otherOptions = {}) => await fetcher(`${backendURL}/api/demo/session`, authAPIOptions, otherOptions, { cache: "no-store" });
31
+ return {
32
+ getSetupStatus,
33
+ getDemoSession
34
+ };
35
+ };
36
+ /**
37
+ * Instance status endpoints bound to an Intlayer CMS authenticator.
38
+ *
39
+ * Pass an authenticator created with `createIntlayerCMS`, or omit it to use
40
+ * the build-time configuration (`@intlayer/config/built`).
41
+ */
42
+ const statusEndpoint = createEndpoint(getStatusAPI);
43
+
44
+ //#endregion
45
+ export { getStatusAPI, statusEndpoint };
46
+ //# sourceMappingURL=status.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.mjs","names":[],"sources":["../../../src/getIntlayerAPI/status.ts"],"sourcesContent":["import type { GetSetupStatusResult } from '@intlayer/backend';\nimport { editor } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { createEndpoint } from '../cms/createIntlayerCMS';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\n/** Result of the demo-session bootstrap endpoint. */\nexport type GetDemoSessionResult = { ok: boolean };\n\n/**\n * Instance/entry status endpoints. These back the decisions made when an\n * unauthenticated visitor reaches the app root:\n * - `getSetupStatus` — on a self-hosted instance, whether the first\n * super-admin still needs to be created.\n * - `getDemoSession` — on the hosted cloud, signs the visitor into the shared\n * read-only demo account (the backend sets the session cookie on the\n * response).\n */\nexport const getStatusAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL ?? editor.backendURL;\n\n /**\n * Reports whether the instance still needs its initial setup (creation of\n * the first super-admin). Only ever `true` on a self-hosted deployment with\n * an empty users collection. Public endpoint — no authentication required.\n * @returns `{ isSetupRequired: boolean }`.\n */\n const getSetupStatus = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetSetupStatusResult>(\n `${backendURL}/api/user/setup`,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n }\n );\n\n /**\n * Signs the current browser into the shared demo account. The backend\n * responds with a `Set-Cookie` header establishing the demo session, so this\n * must run with credentials included (the default in the fetcher).\n * @returns `{ ok: boolean }`.\n */\n const getDemoSession = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetDemoSessionResult>(\n `${backendURL}/api/demo/session`,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n }\n );\n\n return {\n getSetupStatus,\n getDemoSession,\n };\n};\n\n/**\n * Instance status endpoints bound to an Intlayer CMS authenticator.\n *\n * Pass an authenticator created with `createIntlayerCMS`, or omit it to use\n * the build-time configuration (`@intlayer/config/built`).\n */\nexport const statusEndpoint = createEndpoint(getStatusAPI);\n"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAa,gBACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aAAa,gBAAgB,QAAQ,cAAc,OAAO;;;;;;;CAQhE,MAAM,iBAAiB,OAAO,eAA+B,EAAE,KAC7D,MAAM,QACJ,GAAG,WAAW,kBACd,gBACA,cACA,EACE,OAAO,YACR,CACF;;;;;;;CAQH,MAAM,iBAAiB,OAAO,eAA+B,EAAE,KAC7D,MAAM,QACJ,GAAG,WAAW,oBACd,gBACA,cACA,EACE,OAAO,YACR,CACF;AAEH,QAAO;EACL;EACA;EACD;;;;;;;;AASH,MAAa,iBAAiB,eAAe,aAAa"}
@@ -1,4 +1,5 @@
1
1
  import { fetcher } from "../fetcher.mjs";
2
+ import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
2
3
  import { editor } from "@intlayer/config/built";
3
4
 
4
5
  //#region src/getIntlayerAPI/stripe.ts
@@ -169,7 +170,14 @@ const getStripeAPI = (authAPIOptions = {}, intlayerConfig) => {
169
170
  getAffiliatePromoCode
170
171
  };
171
172
  };
173
+ /**
174
+ * Authenticated `stripe` endpoint bound to an Intlayer CMS authenticator.
175
+ *
176
+ * Pass an authenticator created with `createIntlayerCMS`, or omit it to use
177
+ * the build-time configuration (`@intlayer/config/built`).
178
+ */
179
+ const stripeEndpoint = createEndpoint(getStripeAPI);
172
180
 
173
181
  //#endregion
174
- export { getStripeAPI };
182
+ export { getStripeAPI, stripeEndpoint };
175
183
  //# sourceMappingURL=stripe.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"stripe.mjs","names":[],"sources":["../../../src/getIntlayerAPI/stripe.ts"],"sourcesContent":["import type {\n AcceptAffiliateInvitationResult,\n CreatePortalSessionResult,\n CreatePromoCodeBody,\n CreatePromoCodeResult,\n DeletePromoCodeResult,\n GetAffiliateAccountSessionResult,\n GetAffiliateByIdResult,\n GetAffiliateInvitationResult,\n GetAffiliateInvitationsResult,\n GetAffiliateOnboardingLinkResult,\n GetAffiliateResult,\n GetAffiliateStatsResult,\n GetAffiliatesParams,\n GetAffiliatesResult,\n GetCheckoutSessionBody,\n GetCheckoutSessionResult,\n GetInvoicesResult,\n GetPaymentMethodResult,\n GetPricingBody,\n GetPricingResult,\n GetPromoCodeByIdResult,\n GetPromoCodesResult,\n GrantAffiliateAccessBody,\n GrantAffiliateAccessResult,\n SendAffiliateInvitationBody,\n SendAffiliateInvitationResult,\n UpdateAffiliateStatusBody,\n UpdateAffiliateStatusResult,\n UpdatePromoCodeBody,\n UpdatePromoCodeResult,\n} from '@intlayer/backend';\nimport { editor } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getStripeAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL ?? editor.backendURL;\n\n const STRIPE_API_ROUTE = `${backendURL}/api/stripe`;\n\n /**\n * Get a pricing plan calculated for a given promotion code.\n * @param body - Pricing plan body.\n */\n const getPricing = async (\n body?: GetPricingBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetPricingResult>(\n `${STRIPE_API_ROUTE}/pricing`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Retrieves a checkout session.\n * @param body - Checkout session body.\n */\n const getSubscription = async (\n body?: GetCheckoutSessionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/create-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Cancels a subscription.\n * @param body - Checkout session body.\n */\n const cancelSubscription = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/cancel-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n /**\n * Lists invoices for the authenticated organization's Stripe customer.\n */\n const getInvoices = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetInvoicesResult>(\n `${STRIPE_API_ROUTE}/invoices`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Returns the first card payment method for the authenticated organization's\n * Stripe customer (or null if none).\n */\n const getPaymentMethod = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetPaymentMethodResult>(\n `${STRIPE_API_ROUTE}/payment-method`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Creates a Stripe Billing Portal session for the authenticated organization.\n */\n const createPortalSession = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<CreatePortalSessionResult>(\n `${STRIPE_API_ROUTE}/portal-session`,\n authAPIOptions,\n otherOptions,\n { method: 'POST' }\n );\n\n /**\n * Admin-only: grants affiliate access to a user by creating their Stripe Connect account.\n */\n const grantAffiliateAccess = async (\n body: GrantAffiliateAccessBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GrantAffiliateAccessResult>(\n `${STRIPE_API_ROUTE}/affiliate/grant`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n /**\n * Admin-only: returns a paginated list of all affiliates.\n */\n const getAffiliates = async (\n params?: GetAffiliatesParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliatesResult>(\n `${STRIPE_API_ROUTE}/affiliates`,\n authAPIOptions,\n otherOptions,\n { method: 'GET', params: params as Record<string, string> }\n );\n\n /**\n * Admin-only: returns a single affiliate by ID.\n */\n const getAffiliateById = async (\n { id }: { id: string },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliateByIdResult>(\n `${STRIPE_API_ROUTE}/affiliates/${id}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Returns the affiliate record for the authenticated user (null if not an affiliate).\n */\n const getAffiliate = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetAffiliateResult>(\n `${STRIPE_API_ROUTE}/affiliate`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Creates a Stripe Connect account session for the authenticated affiliate (embedded onboarding).\n */\n const getAffiliateAccountSession = async (\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliateAccountSessionResult>(\n `${STRIPE_API_ROUTE}/affiliate/account-session`,\n authAPIOptions,\n otherOptions,\n { method: 'POST' }\n );\n\n /**\n * Returns a Stripe-hosted onboarding URL for the authenticated affiliate.\n */\n const getAffiliateOnboardingLink = async (\n params?: { returnUrl?: string },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliateOnboardingLinkResult>(\n `${STRIPE_API_ROUTE}/affiliate/onboarding-link`,\n authAPIOptions,\n otherOptions,\n { method: 'GET', params }\n );\n\n /**\n * Returns referral stats for the authenticated affiliate.\n */\n const getAffiliateStats = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetAffiliateStatsResult>(\n `${STRIPE_API_ROUTE}/affiliate/stats`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Admin-only: returns a paginated list of all affiliate invitations.\n */\n const getAffiliateInvitations = async (\n params: GetAffiliatesParams = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const qs = new URLSearchParams();\n if (params.page) qs.set('page', String(params.page));\n if (params.pageSize) qs.set('pageSize', String(params.pageSize));\n if (params.search) qs.set('search', params.search);\n const query = qs.toString() ? `?${qs.toString()}` : '';\n return await fetcher<GetAffiliateInvitationsResult>(\n `${STRIPE_API_ROUTE}/affiliate/invitations${query}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n /**\n * Sends an affiliate invitation email to the given address (admin only).\n */\n const sendAffiliateInvitation = async (\n body: SendAffiliateInvitationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SendAffiliateInvitationResult>(\n `${STRIPE_API_ROUTE}/affiliate/invite`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n /**\n * Retrieves an affiliate invitation by token (public — no auth required).\n */\n const getAffiliateInvitation = async (\n { token }: { token: string },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliateInvitationResult>(\n `${STRIPE_API_ROUTE}/affiliate/invitation/${token}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Admin-only: updates an affiliate's status and/or category.\n */\n const updateAffiliateStatus = async (\n { id }: { id: string },\n body: UpdateAffiliateStatusBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateAffiliateStatusResult>(\n `${STRIPE_API_ROUTE}/affiliates/${id}/status`,\n authAPIOptions,\n otherOptions,\n { method: 'PATCH', body }\n );\n\n /**\n * Accepts an affiliate invitation and creates the affiliate account.\n */\n const acceptAffiliateInvitation = async (\n {\n token,\n country,\n stripeAccountType,\n }: {\n token: string;\n country?: string;\n stripeAccountType?: 'express' | 'standard';\n },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AcceptAffiliateInvitationResult>(\n `${STRIPE_API_ROUTE}/affiliate/invitation/${token}/accept`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body: { country, stripeAccountType } }\n );\n\n /**\n * Admin-only: returns a paginated list of all promo codes.\n */\n const getPromoCodeById = async (\n id: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetPromoCodeByIdResult>(\n `${STRIPE_API_ROUTE}/promo-codes/${id}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const getPromoCodes = async (\n params: { affiliateId?: string } = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const qs = params.affiliateId\n ? `?affiliateId=${encodeURIComponent(params.affiliateId)}`\n : '';\n return await fetcher<GetPromoCodesResult>(\n `${STRIPE_API_ROUTE}/promo-codes${qs}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n /**\n * Admin-only: creates a new promo code (Stripe coupon + promotion code).\n */\n const createPromoCode = async (\n body: CreatePromoCodeBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<CreatePromoCodeResult>(\n `${STRIPE_API_ROUTE}/promo-codes`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n /**\n * Admin-only: updates a promo code.\n */\n const updatePromoCode = async (\n { id, ...body }: { id: string } & UpdatePromoCodeBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdatePromoCodeResult>(\n `${STRIPE_API_ROUTE}/promo-codes/${id}`,\n authAPIOptions,\n otherOptions,\n { method: 'PATCH', body }\n );\n\n /**\n * Admin-only: deactivates a promo code (sets active=false, disables Stripe promotion code).\n */\n const deletePromoCode = async (\n { id }: { id: string },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<DeletePromoCodeResult>(\n `${STRIPE_API_ROUTE}/promo-codes/${id}`,\n authAPIOptions,\n otherOptions,\n { method: 'DELETE' }\n );\n\n /**\n * Retrieves the active promo code associated with a given affiliate referral code.\n */\n const getAffiliatePromoCode = async (\n referralCode: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<any>(\n `${STRIPE_API_ROUTE}/affiliate-promo-code/${referralCode}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n return {\n getPricing,\n getSubscription,\n cancelSubscription,\n getInvoices,\n getPaymentMethod,\n createPortalSession,\n grantAffiliateAccess,\n getAffiliates,\n getAffiliateById,\n getAffiliate,\n getAffiliateAccountSession,\n getAffiliateOnboardingLink,\n getAffiliateStats,\n getAffiliateInvitations,\n sendAffiliateInvitation,\n getAffiliateInvitation,\n acceptAffiliateInvitation,\n updateAffiliateStatus,\n getPromoCodeById,\n getPromoCodes,\n createPromoCode,\n updatePromoCode,\n deletePromoCode,\n getAffiliatePromoCode,\n };\n};\n"],"mappings":";;;;AAoCA,MAAa,gBACX,iBAAiC,EAAE,EACnC,mBACG;CAGH,MAAM,mBAAmB,GAFN,gBAAgB,QAAQ,cAAc,OAAO,WAEzB;;;;;CAMvC,MAAM,aAAa,OACjB,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,iBAAiB,WACpB,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,kBAAkB,OACtB,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,iBAAiB,uBACpB,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,qBAAqB,OAAO,eAA+B,EAAE,KACjE,MAAM,QACJ,GAAG,iBAAiB,uBACpB,gBACA,cACA,EACE,QAAQ,QACT,CACF;;;;CAKH,MAAM,cAAc,OAAO,eAA+B,EAAE,KAC1D,MAAM,QACJ,GAAG,iBAAiB,YACpB,gBACA,cACA,EAAE,QAAQ,OAAO,CAClB;;;;;CAMH,MAAM,mBAAmB,OAAO,eAA+B,EAAE,KAC/D,MAAM,QACJ,GAAG,iBAAiB,kBACpB,gBACA,c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,MAAM,QACJ,GAAG,iBAAiB,eACpB,gBACA,cACA;EAAE,QAAQ;EAAQ;EAAM,CACzB;;;;CAKH,MAAM,kBAAkB,OACtB,EAAE,IAAI,GAAG,QACT,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,iBAAiB,eAAe,MACnC,gBACA,cACA;EAAE,QAAQ;EAAS;EAAM,CAC1B;;;;CAKH,MAAM,kBAAkB,OACtB,EAAE,MACF,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,iBAAiB,eAAe,MACnC,gBACA,cACA,EAAE,QAAQ,UAAU,CACrB;;;;CAKH,MAAM,wBAAwB,OAC5B,cACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,iBAAiB,wBAAwB,gBAC5C,gBACA,cACA,EAAE,QAAQ,OAAO,CAClB;AAEH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
1
+ {"version":3,"file":"stripe.mjs","names":[],"sources":["../../../src/getIntlayerAPI/stripe.ts"],"sourcesContent":["import type {\n AcceptAffiliateInvitationResult,\n CreatePortalSessionResult,\n CreatePromoCodeBody,\n CreatePromoCodeResult,\n DeletePromoCodeResult,\n GetAffiliateAccountSessionResult,\n GetAffiliateByIdResult,\n GetAffiliateInvitationResult,\n GetAffiliateInvitationsResult,\n GetAffiliateOnboardingLinkResult,\n GetAffiliateResult,\n GetAffiliateStatsResult,\n GetAffiliatesParams,\n GetAffiliatesResult,\n GetCheckoutSessionBody,\n GetCheckoutSessionResult,\n GetInvoicesResult,\n GetPaymentMethodResult,\n GetPricingBody,\n GetPricingResult,\n GetPromoCodeByIdResult,\n GetPromoCodesResult,\n GrantAffiliateAccessBody,\n GrantAffiliateAccessResult,\n SendAffiliateInvitationBody,\n SendAffiliateInvitationResult,\n UpdateAffiliateStatusBody,\n UpdateAffiliateStatusResult,\n UpdatePromoCodeBody,\n UpdatePromoCodeResult,\n} from '@intlayer/backend';\nimport { editor } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { createEndpoint } from '../cms/createIntlayerCMS';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getStripeAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL ?? editor.backendURL;\n\n const STRIPE_API_ROUTE = `${backendURL}/api/stripe`;\n\n /**\n * Get a pricing plan calculated for a given promotion code.\n * @param body - Pricing plan body.\n */\n const getPricing = async (\n body?: GetPricingBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetPricingResult>(\n `${STRIPE_API_ROUTE}/pricing`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Retrieves a checkout session.\n * @param body - Checkout session body.\n */\n const getSubscription = async (\n body?: GetCheckoutSessionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/create-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Cancels a subscription.\n * @param body - Checkout session body.\n */\n const cancelSubscription = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/cancel-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n /**\n * Lists invoices for the authenticated organization's Stripe customer.\n */\n const getInvoices = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetInvoicesResult>(\n `${STRIPE_API_ROUTE}/invoices`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Returns the first card payment method for the authenticated organization's\n * Stripe customer (or null if none).\n */\n const getPaymentMethod = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetPaymentMethodResult>(\n `${STRIPE_API_ROUTE}/payment-method`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Creates a Stripe Billing Portal session for the authenticated organization.\n */\n const createPortalSession = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<CreatePortalSessionResult>(\n `${STRIPE_API_ROUTE}/portal-session`,\n authAPIOptions,\n otherOptions,\n { method: 'POST' }\n );\n\n /**\n * Admin-only: grants affiliate access to a user by creating their Stripe Connect account.\n */\n const grantAffiliateAccess = async (\n body: GrantAffiliateAccessBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GrantAffiliateAccessResult>(\n `${STRIPE_API_ROUTE}/affiliate/grant`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n /**\n * Admin-only: returns a paginated list of all affiliates.\n */\n const getAffiliates = async (\n params?: GetAffiliatesParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliatesResult>(\n `${STRIPE_API_ROUTE}/affiliates`,\n authAPIOptions,\n otherOptions,\n { method: 'GET', params: params as Record<string, string> }\n );\n\n /**\n * Admin-only: returns a single affiliate by ID.\n */\n const getAffiliateById = async (\n { id }: { id: string },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliateByIdResult>(\n `${STRIPE_API_ROUTE}/affiliates/${id}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Returns the affiliate record for the authenticated user (null if not an affiliate).\n */\n const getAffiliate = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetAffiliateResult>(\n `${STRIPE_API_ROUTE}/affiliate`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Creates a Stripe Connect account session for the authenticated affiliate (embedded onboarding).\n */\n const getAffiliateAccountSession = async (\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliateAccountSessionResult>(\n `${STRIPE_API_ROUTE}/affiliate/account-session`,\n authAPIOptions,\n otherOptions,\n { method: 'POST' }\n );\n\n /**\n * Returns a Stripe-hosted onboarding URL for the authenticated affiliate.\n */\n const getAffiliateOnboardingLink = async (\n params?: { returnUrl?: string },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliateOnboardingLinkResult>(\n `${STRIPE_API_ROUTE}/affiliate/onboarding-link`,\n authAPIOptions,\n otherOptions,\n { method: 'GET', params }\n );\n\n /**\n * Returns referral stats for the authenticated affiliate.\n */\n const getAffiliateStats = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetAffiliateStatsResult>(\n `${STRIPE_API_ROUTE}/affiliate/stats`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Admin-only: returns a paginated list of all affiliate invitations.\n */\n const getAffiliateInvitations = async (\n params: GetAffiliatesParams = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const qs = new URLSearchParams();\n if (params.page) qs.set('page', String(params.page));\n if (params.pageSize) qs.set('pageSize', String(params.pageSize));\n if (params.search) qs.set('search', params.search);\n const query = qs.toString() ? `?${qs.toString()}` : '';\n return await fetcher<GetAffiliateInvitationsResult>(\n `${STRIPE_API_ROUTE}/affiliate/invitations${query}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n /**\n * Sends an affiliate invitation email to the given address (admin only).\n */\n const sendAffiliateInvitation = async (\n body: SendAffiliateInvitationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SendAffiliateInvitationResult>(\n `${STRIPE_API_ROUTE}/affiliate/invite`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n /**\n * Retrieves an affiliate invitation by token (public — no auth required).\n */\n const getAffiliateInvitation = async (\n { token }: { token: string },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliateInvitationResult>(\n `${STRIPE_API_ROUTE}/affiliate/invitation/${token}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Admin-only: updates an affiliate's status and/or category.\n */\n const updateAffiliateStatus = async (\n { id }: { id: string },\n body: UpdateAffiliateStatusBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateAffiliateStatusResult>(\n `${STRIPE_API_ROUTE}/affiliates/${id}/status`,\n authAPIOptions,\n otherOptions,\n { method: 'PATCH', body }\n );\n\n /**\n * Accepts an affiliate invitation and creates the affiliate account.\n */\n const acceptAffiliateInvitation = async (\n {\n token,\n country,\n stripeAccountType,\n }: {\n token: string;\n country?: string;\n stripeAccountType?: 'express' | 'standard';\n },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AcceptAffiliateInvitationResult>(\n `${STRIPE_API_ROUTE}/affiliate/invitation/${token}/accept`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body: { country, stripeAccountType } }\n );\n\n /**\n * Admin-only: returns a paginated list of all promo codes.\n */\n const getPromoCodeById = async (\n id: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetPromoCodeByIdResult>(\n `${STRIPE_API_ROUTE}/promo-codes/${id}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const getPromoCodes = async (\n params: { affiliateId?: string } = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const qs = params.affiliateId\n ? `?affiliateId=${encodeURIComponent(params.affiliateId)}`\n : '';\n return await fetcher<GetPromoCodesResult>(\n `${STRIPE_API_ROUTE}/promo-codes${qs}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n /**\n * Admin-only: creates a new promo code (Stripe coupon + promotion code).\n */\n const createPromoCode = async (\n body: CreatePromoCodeBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<CreatePromoCodeResult>(\n `${STRIPE_API_ROUTE}/promo-codes`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n /**\n * Admin-only: updates a promo code.\n */\n const updatePromoCode = async (\n { id, ...body }: { id: string } & UpdatePromoCodeBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdatePromoCodeResult>(\n `${STRIPE_API_ROUTE}/promo-codes/${id}`,\n authAPIOptions,\n otherOptions,\n { method: 'PATCH', body }\n );\n\n /**\n * Admin-only: deactivates a promo code (sets active=false, disables Stripe promotion code).\n */\n const deletePromoCode = async (\n { id }: { id: string },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<DeletePromoCodeResult>(\n `${STRIPE_API_ROUTE}/promo-codes/${id}`,\n authAPIOptions,\n otherOptions,\n { method: 'DELETE' }\n );\n\n /**\n * Retrieves the active promo code associated with a given affiliate referral code.\n */\n const getAffiliatePromoCode = async (\n referralCode: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<any>(\n `${STRIPE_API_ROUTE}/affiliate-promo-code/${referralCode}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n return {\n getPricing,\n getSubscription,\n cancelSubscription,\n getInvoices,\n getPaymentMethod,\n createPortalSession,\n grantAffiliateAccess,\n getAffiliates,\n getAffiliateById,\n getAffiliate,\n getAffiliateAccountSession,\n getAffiliateOnboardingLink,\n getAffiliateStats,\n getAffiliateInvitations,\n sendAffiliateInvitation,\n getAffiliateInvitation,\n acceptAffiliateInvitation,\n updateAffiliateStatus,\n getPromoCodeById,\n getPromoCodes,\n createPromoCode,\n updatePromoCode,\n deletePromoCode,\n getAffiliatePromoCode,\n };\n};\n\n/**\n * Authenticated `stripe` endpoint bound to an Intlayer CMS authenticator.\n *\n * Pass an authenticator created with `createIntlayerCMS`, or omit it to use\n * the build-time configuration (`@intlayer/config/built`).\n */\nexport const stripeEndpoint = createEndpoint(getStripeAPI);\n"],"mappings":";;;;;AAqCA,MAAa,gBACX,iBAAiC,EAAE,EACnC,mBACG;CAGH,MAAM,mBAAmB,GAFN,gBAAgB,QAAQ,cAAc,OAAO,WAEzB;;;;;CAMvC,MAAM,aAAa,OACjB,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,iBAAiB,WACpB,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;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D,gBACA,cACA;EAAE,QAAQ;EAAQ,MAAM;GAAE;GAAS;GAAmB;EAAE,CACzD;;;;CAKH,MAAM,mBAAmB,OACvB,IACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,iBAAiB,eAAe,MACnC,gBACA,cACA,EAAE,QAAQ,OAAO,CAClB;CAEH,MAAM,gBAAgB,OACpB,SAAmC,EAAE,EACrC,eAA+B,EAAE,KAC9B;AAIH,SAAO,MAAM,QACX,GAAG,iBAAiB,cAJX,OAAO,cACd,gBAAgB,mBAAmB,OAAO,YAAY,KACtD,MAGF,gBACA,cACA,EAAE,QAAQ,OAAO,CAClB;;;;;CAMH,MAAM,kBAAkB,OACtB,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,iBAAiB,eACpB,gBACA,cACA;EAAE,QAAQ;EAAQ;EAAM,CACzB;;;;CAKH,MAAM,kBAAkB,OACtB,EAAE,IAAI,GAAG,QACT,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,iBAAiB,eAAe,MACnC,gBACA,cACA;EAAE,QAAQ;EAAS;EAAM,CAC1B;;;;CAKH,MAAM,kBAAkB,OACtB,EAAE,MACF,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,iBAAiB,eAAe,MACnC,gBACA,cACA,EAAE,QAAQ,UAAU,CACrB;;;;CAKH,MAAM,wBAAwB,OAC5B,cACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,iBAAiB,wBAAwB,gBAC5C,gBACA,cACA,EAAE,QAAQ,OAAO,CAClB;AAEH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;;;;;;;;AASH,MAAa,iBAAiB,eAAe,aAAa"}
@@ -1,4 +1,5 @@
1
1
  import { fetcher } from "../fetcher.mjs";
2
+ import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
2
3
  import { editor } from "@intlayer/config/built";
3
4
 
4
5
  //#region src/getIntlayerAPI/tag.ts
@@ -40,7 +41,14 @@ const getTagAPI = (authAPIOptions = {}, intlayerConfig) => {
40
41
  deleteTag
41
42
  };
42
43
  };
44
+ /**
45
+ * Authenticated `tag` endpoint bound to an Intlayer CMS authenticator.
46
+ *
47
+ * Pass an authenticator created with `createIntlayerCMS`, or omit it to use
48
+ * the build-time configuration (`@intlayer/config/built`).
49
+ */
50
+ const tagEndpoint = createEndpoint(getTagAPI);
43
51
 
44
52
  //#endregion
45
- export { getTagAPI };
53
+ export { getTagAPI, tagEndpoint };
46
54
  //# sourceMappingURL=tag.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"tag.mjs","names":[],"sources":["../../../src/getIntlayerAPI/tag.ts"],"sourcesContent":["import type {\n AddTagBody,\n AddTagResult,\n DeleteTagParams,\n DeleteTagResult,\n GetTagsParams,\n GetTagsResult,\n UpdateTagBody,\n UpdateTagParams,\n UpdateTagResult,\n} from '@intlayer/backend';\nimport { editor } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getTagAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL ?? editor.backendURL;\n\n const PROJECT_API_ROUTE = `${backendURL}/api/tag`;\n\n /**\n * Retrieves a list of tags based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getTags = async (\n filters?: GetTagsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetTagsResult>(\n PROJECT_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n // @ts-ignore Number of parameter will be stringified by the fetcher\n params: filters,\n }\n );\n\n /**\n * Adds a new tag to the database.\n * @param tag - Tag data.\n */\n const addTag = async (tag: AddTagBody, otherOptions: FetcherOptions = {}) =>\n await fetcher<AddTagResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: tag,\n }\n );\n\n /**\n * Updates an existing tag in the database.\n * @param tag - Updated tag data.\n */\n const updateTag = async (\n tagId: UpdateTagParams['tagId'],\n tag: UpdateTagBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateTagResult>(\n `${PROJECT_API_ROUTE}/${tagId}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: tag,\n }\n );\n\n /**\n * Deletes a tag from the database by its ID.\n * @param tagId - Tag ID.\n */\n const deleteTag = async (\n tagId: DeleteTagParams['tagId'],\n\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<DeleteTagResult>(\n `${PROJECT_API_ROUTE}/${tagId}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n return {\n getTags,\n addTag,\n updateTag,\n deleteTag,\n };\n};\n"],"mappings":";;;;AAeA,MAAa,aACX,iBAAiC,EAAE,EACnC,mBACG;CAGH,MAAM,oBAAoB,GAFP,gBAAgB,QAAQ,cAAc,OAAO,WAExB;;;;;CAMxC,MAAM,UAAU,OACd,SACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,mBACA,gBACA,cACA;EACE,OAAO;EAEP,QAAQ;EACT,CACF;;;;;CAMH,MAAM,SAAS,OAAO,KAAiB,eAA+B,EAAE,KACtE,MAAM,QACJ,GAAG,qBACH,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,YAAY,OAChB,OACA,KACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,kBAAkB,GAAG,SACxB,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,YAAY,OAChB,OAEA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,kBAAkB,GAAG,SACxB,gBACA,cACA,EACE,QAAQ,UACT,CACF;AAEH,QAAO;EACL;EACA;EACA;EACA;EACD"}
1
+ {"version":3,"file":"tag.mjs","names":[],"sources":["../../../src/getIntlayerAPI/tag.ts"],"sourcesContent":["import type {\n AddTagBody,\n AddTagResult,\n DeleteTagParams,\n DeleteTagResult,\n GetTagsParams,\n GetTagsResult,\n UpdateTagBody,\n UpdateTagParams,\n UpdateTagResult,\n} from '@intlayer/backend';\nimport { editor } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { createEndpoint } from '../cms/createIntlayerCMS';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getTagAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL ?? editor.backendURL;\n\n const PROJECT_API_ROUTE = `${backendURL}/api/tag`;\n\n /**\n * Retrieves a list of tags based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getTags = async (\n filters?: GetTagsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetTagsResult>(\n PROJECT_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n // @ts-ignore Number of parameter will be stringified by the fetcher\n params: filters,\n }\n );\n\n /**\n * Adds a new tag to the database.\n * @param tag - Tag data.\n */\n const addTag = async (tag: AddTagBody, otherOptions: FetcherOptions = {}) =>\n await fetcher<AddTagResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: tag,\n }\n );\n\n /**\n * Updates an existing tag in the database.\n * @param tag - Updated tag data.\n */\n const updateTag = async (\n tagId: UpdateTagParams['tagId'],\n tag: UpdateTagBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateTagResult>(\n `${PROJECT_API_ROUTE}/${tagId}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: tag,\n }\n );\n\n /**\n * Deletes a tag from the database by its ID.\n * @param tagId - Tag ID.\n */\n const deleteTag = async (\n tagId: DeleteTagParams['tagId'],\n\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<DeleteTagResult>(\n `${PROJECT_API_ROUTE}/${tagId}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n return {\n getTags,\n addTag,\n updateTag,\n deleteTag,\n };\n};\n\n/**\n * Authenticated `tag` endpoint bound to an Intlayer CMS authenticator.\n *\n * Pass an authenticator created with `createIntlayerCMS`, or omit it to use\n * the build-time configuration (`@intlayer/config/built`).\n */\nexport const tagEndpoint = createEndpoint(getTagAPI);\n"],"mappings":";;;;;AAgBA,MAAa,aACX,iBAAiC,EAAE,EACnC,mBACG;CAGH,MAAM,oBAAoB,GAFP,gBAAgB,QAAQ,cAAc,OAAO,WAExB;;;;;CAMxC,MAAM,UAAU,OACd,SACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,mBACA,gBACA,cACA;EACE,OAAO;EAEP,QAAQ;EACT,CACF;;;;;CAMH,MAAM,SAAS,OAAO,KAAiB,eAA+B,EAAE,KACtE,MAAM,QACJ,GAAG,qBACH,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,YAAY,OAChB,OACA,KACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,kBAAkB,GAAG,SACxB,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,YAAY,OAChB,OAEA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,kBAAkB,GAAG,SACxB,gBACA,cACA,EACE,QAAQ,UACT,CACF;AAEH,QAAO;EACL;EACA;EACA;EACA;EACD;;;;;;;;AASH,MAAa,cAAc,eAAe,UAAU"}
@@ -1,4 +1,5 @@
1
1
  import { fetcher } from "../fetcher.mjs";
2
+ import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
2
3
  import { editor } from "@intlayer/config/built";
3
4
 
4
5
  //#region src/getIntlayerAPI/translate.ts
@@ -22,7 +23,14 @@ const getTranslateAPI = (authAPIOptions = {}, intlayerConfig) => {
22
23
  restartTranslationJob
23
24
  };
24
25
  };
26
+ /**
27
+ * Authenticated `translate` endpoint bound to an Intlayer CMS authenticator.
28
+ *
29
+ * Pass an authenticator created with `createIntlayerCMS`, or omit it to use
30
+ * the build-time configuration (`@intlayer/config/built`).
31
+ */
32
+ const translateEndpoint = createEndpoint(getTranslateAPI);
25
33
 
26
34
  //#endregion
27
- export { getTranslateAPI };
35
+ export { getTranslateAPI, translateEndpoint };
28
36
  //# sourceMappingURL=translate.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"translate.mjs","names":[],"sources":["../../../src/getIntlayerAPI/translate.ts"],"sourcesContent":["import type {\n TranslateDictionariesBody,\n TranslateDictionariesResult,\n} from '@intlayer/backend';\nimport { editor } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport type { TranslateDictionariesBody, TranslateDictionariesResult };\n\nexport const getTranslateAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL ?? editor.backendURL;\n\n const TRANSLATE_API_ROUTE = `${backendURL}/api/translate`;\n\n const translateDictionaries = async (\n body: TranslateDictionariesBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<TranslateDictionariesResult>(\n `${TRANSLATE_API_ROUTE}/dictionaries`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const pauseTranslationJob = async (\n jobId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<{ data: { jobId: string } }>(\n `${TRANSLATE_API_ROUTE}/${jobId}/pause`,\n authAPIOptions,\n otherOptions,\n { method: 'POST' }\n );\n\n const resumeTranslationJob = async (\n jobId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<{ data: { jobId: string } }>(\n `${TRANSLATE_API_ROUTE}/${jobId}/resume`,\n authAPIOptions,\n otherOptions,\n { method: 'POST' }\n );\n\n const stopTranslationJob = async (\n jobId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<{ data: { jobId: string } }>(\n `${TRANSLATE_API_ROUTE}/${jobId}/stop`,\n authAPIOptions,\n otherOptions,\n { method: 'POST' }\n );\n\n const retryTranslationJob = async (\n jobId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<{ data: { jobId: string } }>(\n `${TRANSLATE_API_ROUTE}/${jobId}/retry`,\n authAPIOptions,\n otherOptions,\n { method: 'POST' }\n );\n\n const restartTranslationJob = async (\n jobId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<{ data: { jobId: string } }>(\n `${TRANSLATE_API_ROUTE}/${jobId}/restart`,\n authAPIOptions,\n otherOptions,\n { method: 'POST' }\n );\n\n return {\n translateDictionaries,\n pauseTranslationJob,\n resumeTranslationJob,\n stopTranslationJob,\n retryTranslationJob,\n restartTranslationJob,\n };\n};\n"],"mappings":";;;;AAUA,MAAa,mBACX,iBAAiC,EAAE,EACnC,mBACG;CAGH,MAAM,sBAAsB,GAFT,gBAAgB,QAAQ,cAAc,OAAO,WAEtB;CAE1C,MAAM,wBAAwB,OAC5B,MACA,eAA+B,EAAE,KAEjC,QACE,GAAG,oBAAoB,gBACvB,gBACA,cACA;EAAE,QAAQ;EAAQ;EAAM,CACzB;CAEH,MAAM,sBAAsB,OAC1B,OACA,eAA+B,EAAE,KAEjC,QACE,GAAG,oBAAoB,GAAG,MAAM,SAChC,gBACA,cACA,EAAE,QAAQ,QAAQ,CACnB;CAEH,MAAM,uBAAuB,OAC3B,OACA,eAA+B,EAAE,KAEjC,QACE,GAAG,oBAAoB,GAAG,MAAM,UAChC,gBACA,cACA,EAAE,QAAQ,QAAQ,CACnB;CAEH,MAAM,qBAAqB,OACzB,OACA,eAA+B,EAAE,KAEjC,QACE,GAAG,oBAAoB,GAAG,MAAM,QAChC,gBACA,cACA,EAAE,QAAQ,QAAQ,CACnB;CAEH,MAAM,sBAAsB,OAC1B,OACA,eAA+B,EAAE,KAEjC,QACE,GAAG,oBAAoB,GAAG,MAAM,SAChC,gBACA,cACA,EAAE,QAAQ,QAAQ,CACnB;CAEH,MAAM,wBAAwB,OAC5B,OACA,eAA+B,EAAE,KAEjC,QACE,GAAG,oBAAoB,GAAG,MAAM,WAChC,gBACA,cACA,EAAE,QAAQ,QAAQ,CACnB;AAEH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACD"}
1
+ {"version":3,"file":"translate.mjs","names":[],"sources":["../../../src/getIntlayerAPI/translate.ts"],"sourcesContent":["import type {\n TranslateDictionariesBody,\n TranslateDictionariesResult,\n} from '@intlayer/backend';\nimport { editor } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { createEndpoint } from '../cms/createIntlayerCMS';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport type { TranslateDictionariesBody, TranslateDictionariesResult };\n\nexport const getTranslateAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL ?? editor.backendURL;\n\n const TRANSLATE_API_ROUTE = `${backendURL}/api/translate`;\n\n const translateDictionaries = async (\n body: TranslateDictionariesBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<TranslateDictionariesResult>(\n `${TRANSLATE_API_ROUTE}/dictionaries`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const pauseTranslationJob = async (\n jobId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<{ data: { jobId: string } }>(\n `${TRANSLATE_API_ROUTE}/${jobId}/pause`,\n authAPIOptions,\n otherOptions,\n { method: 'POST' }\n );\n\n const resumeTranslationJob = async (\n jobId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<{ data: { jobId: string } }>(\n `${TRANSLATE_API_ROUTE}/${jobId}/resume`,\n authAPIOptions,\n otherOptions,\n { method: 'POST' }\n );\n\n const stopTranslationJob = async (\n jobId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<{ data: { jobId: string } }>(\n `${TRANSLATE_API_ROUTE}/${jobId}/stop`,\n authAPIOptions,\n otherOptions,\n { method: 'POST' }\n );\n\n const retryTranslationJob = async (\n jobId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<{ data: { jobId: string } }>(\n `${TRANSLATE_API_ROUTE}/${jobId}/retry`,\n authAPIOptions,\n otherOptions,\n { method: 'POST' }\n );\n\n const restartTranslationJob = async (\n jobId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<{ data: { jobId: string } }>(\n `${TRANSLATE_API_ROUTE}/${jobId}/restart`,\n authAPIOptions,\n otherOptions,\n { method: 'POST' }\n );\n\n return {\n translateDictionaries,\n pauseTranslationJob,\n resumeTranslationJob,\n stopTranslationJob,\n retryTranslationJob,\n restartTranslationJob,\n };\n};\n\n/**\n * Authenticated `translate` endpoint bound to an Intlayer CMS authenticator.\n *\n * Pass an authenticator created with `createIntlayerCMS`, or omit it to use\n * the build-time configuration (`@intlayer/config/built`).\n */\nexport const translateEndpoint = createEndpoint(getTranslateAPI);\n"],"mappings":";;;;;AAWA,MAAa,mBACX,iBAAiC,EAAE,EACnC,mBACG;CAGH,MAAM,sBAAsB,GAFT,gBAAgB,QAAQ,cAAc,OAAO,WAEtB;CAE1C,MAAM,wBAAwB,OAC5B,MACA,eAA+B,EAAE,KAEjC,QACE,GAAG,oBAAoB,gBACvB,gBACA,cACA;EAAE,QAAQ;EAAQ;EAAM,CACzB;CAEH,MAAM,sBAAsB,OAC1B,OACA,eAA+B,EAAE,KAEjC,QACE,GAAG,oBAAoB,GAAG,MAAM,SAChC,gBACA,cACA,EAAE,QAAQ,QAAQ,CACnB;CAEH,MAAM,uBAAuB,OAC3B,OACA,eAA+B,EAAE,KAEjC,QACE,GAAG,oBAAoB,GAAG,MAAM,UAChC,gBACA,cACA,EAAE,QAAQ,QAAQ,CACnB;CAEH,MAAM,qBAAqB,OACzB,OACA,eAA+B,EAAE,KAEjC,QACE,GAAG,oBAAoB,GAAG,MAAM,QAChC,gBACA,cACA,EAAE,QAAQ,QAAQ,CACnB;CAEH,MAAM,sBAAsB,OAC1B,OACA,eAA+B,EAAE,KAEjC,QACE,GAAG,oBAAoB,GAAG,MAAM,SAChC,gBACA,cACA,EAAE,QAAQ,QAAQ,CACnB;CAEH,MAAM,wBAAwB,OAC5B,OACA,eAA+B,EAAE,KAEjC,QACE,GAAG,oBAAoB,GAAG,MAAM,WAChC,gBACA,cACA,EAAE,QAAQ,QAAQ,CACnB;AAEH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACD;;;;;;;;AASH,MAAa,oBAAoB,eAAe,gBAAgB"}