@intlayer/api 9.0.0-canary.2 → 9.0.0-canary.21

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 (190) 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/fetcher.cjs +2 -1
  11. package/dist/cjs/fetcher.cjs.map +1 -1
  12. package/dist/cjs/getIntlayerAPI/ai.cjs +9 -0
  13. package/dist/cjs/getIntlayerAPI/ai.cjs.map +1 -1
  14. package/dist/cjs/getIntlayerAPI/analytics.cjs +64 -0
  15. package/dist/cjs/getIntlayerAPI/analytics.cjs.map +1 -0
  16. package/dist/cjs/getIntlayerAPI/asset.cjs +9 -0
  17. package/dist/cjs/getIntlayerAPI/asset.cjs.map +1 -1
  18. package/dist/cjs/getIntlayerAPI/audit.cjs +11 -1
  19. package/dist/cjs/getIntlayerAPI/audit.cjs.map +1 -1
  20. package/dist/cjs/getIntlayerAPI/bitbucket.cjs +9 -0
  21. package/dist/cjs/getIntlayerAPI/bitbucket.cjs.map +1 -1
  22. package/dist/cjs/getIntlayerAPI/dictionary.cjs +9 -0
  23. package/dist/cjs/getIntlayerAPI/dictionary.cjs.map +1 -1
  24. package/dist/cjs/getIntlayerAPI/editor.cjs +9 -0
  25. package/dist/cjs/getIntlayerAPI/editor.cjs.map +1 -1
  26. package/dist/cjs/getIntlayerAPI/environment.cjs +9 -0
  27. package/dist/cjs/getIntlayerAPI/environment.cjs.map +1 -1
  28. package/dist/cjs/getIntlayerAPI/github.cjs +9 -0
  29. package/dist/cjs/getIntlayerAPI/github.cjs.map +1 -1
  30. package/dist/cjs/getIntlayerAPI/gitlab.cjs +9 -0
  31. package/dist/cjs/getIntlayerAPI/gitlab.cjs.map +1 -1
  32. package/dist/cjs/getIntlayerAPI/index.cjs +6 -2
  33. package/dist/cjs/getIntlayerAPI/index.cjs.map +1 -1
  34. package/dist/cjs/getIntlayerAPI/newsletter.cjs +9 -0
  35. package/dist/cjs/getIntlayerAPI/newsletter.cjs.map +1 -1
  36. package/dist/cjs/getIntlayerAPI/oAuth.cjs.map +1 -1
  37. package/dist/cjs/getIntlayerAPI/organization.cjs +19 -0
  38. package/dist/cjs/getIntlayerAPI/organization.cjs.map +1 -1
  39. package/dist/cjs/getIntlayerAPI/project.cjs +9 -0
  40. package/dist/cjs/getIntlayerAPI/project.cjs.map +1 -1
  41. package/dist/cjs/getIntlayerAPI/reviewer.cjs +9 -0
  42. package/dist/cjs/getIntlayerAPI/reviewer.cjs.map +1 -1
  43. package/dist/cjs/getIntlayerAPI/search.cjs +9 -0
  44. package/dist/cjs/getIntlayerAPI/search.cjs.map +1 -1
  45. package/dist/cjs/getIntlayerAPI/showcaseProject.cjs +9 -0
  46. package/dist/cjs/getIntlayerAPI/showcaseProject.cjs.map +1 -1
  47. package/dist/cjs/getIntlayerAPI/status.cjs +48 -0
  48. package/dist/cjs/getIntlayerAPI/status.cjs.map +1 -0
  49. package/dist/cjs/getIntlayerAPI/stripe.cjs +13 -2
  50. package/dist/cjs/getIntlayerAPI/stripe.cjs.map +1 -1
  51. package/dist/cjs/getIntlayerAPI/tag.cjs +9 -0
  52. package/dist/cjs/getIntlayerAPI/tag.cjs.map +1 -1
  53. package/dist/cjs/getIntlayerAPI/translate.cjs +9 -0
  54. package/dist/cjs/getIntlayerAPI/translate.cjs.map +1 -1
  55. package/dist/cjs/getIntlayerAPI/user.cjs +9 -0
  56. package/dist/cjs/getIntlayerAPI/user.cjs.map +1 -1
  57. package/dist/cjs/index.cjs +33 -3
  58. package/dist/cjs/proxy.cjs +82 -97
  59. package/dist/cjs/proxy.cjs.map +1 -1
  60. package/dist/esm/cms/createAuthManager.mjs +115 -0
  61. package/dist/esm/cms/createAuthManager.mjs.map +1 -0
  62. package/dist/esm/cms/createIntlayerCMS.mjs +62 -0
  63. package/dist/esm/cms/createIntlayerCMS.mjs.map +1 -0
  64. package/dist/esm/cms/index.mjs +4 -0
  65. package/dist/esm/distantDictionary/fetchDistantDictionaries.mjs +3 -2
  66. package/dist/esm/distantDictionary/fetchDistantDictionaries.mjs.map +1 -1
  67. package/dist/esm/distantDictionary/fetchDistantDictionary.mjs +3 -2
  68. package/dist/esm/distantDictionary/fetchDistantDictionary.mjs.map +1 -1
  69. package/dist/esm/fetcher.mjs +2 -1
  70. package/dist/esm/fetcher.mjs.map +1 -1
  71. package/dist/esm/getIntlayerAPI/ai.mjs +9 -1
  72. package/dist/esm/getIntlayerAPI/ai.mjs.map +1 -1
  73. package/dist/esm/getIntlayerAPI/analytics.mjs +62 -0
  74. package/dist/esm/getIntlayerAPI/analytics.mjs.map +1 -0
  75. package/dist/esm/getIntlayerAPI/asset.mjs +9 -1
  76. package/dist/esm/getIntlayerAPI/asset.mjs.map +1 -1
  77. package/dist/esm/getIntlayerAPI/audit.mjs +11 -2
  78. package/dist/esm/getIntlayerAPI/audit.mjs.map +1 -1
  79. package/dist/esm/getIntlayerAPI/bitbucket.mjs +9 -1
  80. package/dist/esm/getIntlayerAPI/bitbucket.mjs.map +1 -1
  81. package/dist/esm/getIntlayerAPI/dictionary.mjs +9 -1
  82. package/dist/esm/getIntlayerAPI/dictionary.mjs.map +1 -1
  83. package/dist/esm/getIntlayerAPI/editor.mjs +9 -1
  84. package/dist/esm/getIntlayerAPI/editor.mjs.map +1 -1
  85. package/dist/esm/getIntlayerAPI/environment.mjs +9 -1
  86. package/dist/esm/getIntlayerAPI/environment.mjs.map +1 -1
  87. package/dist/esm/getIntlayerAPI/github.mjs +9 -1
  88. package/dist/esm/getIntlayerAPI/github.mjs.map +1 -1
  89. package/dist/esm/getIntlayerAPI/gitlab.mjs +9 -1
  90. package/dist/esm/getIntlayerAPI/gitlab.mjs.map +1 -1
  91. package/dist/esm/getIntlayerAPI/index.mjs +6 -2
  92. package/dist/esm/getIntlayerAPI/index.mjs.map +1 -1
  93. package/dist/esm/getIntlayerAPI/newsletter.mjs +9 -1
  94. package/dist/esm/getIntlayerAPI/newsletter.mjs.map +1 -1
  95. package/dist/esm/getIntlayerAPI/oAuth.mjs.map +1 -1
  96. package/dist/esm/getIntlayerAPI/organization.mjs +19 -1
  97. package/dist/esm/getIntlayerAPI/organization.mjs.map +1 -1
  98. package/dist/esm/getIntlayerAPI/project.mjs +9 -1
  99. package/dist/esm/getIntlayerAPI/project.mjs.map +1 -1
  100. package/dist/esm/getIntlayerAPI/reviewer.mjs +9 -1
  101. package/dist/esm/getIntlayerAPI/reviewer.mjs.map +1 -1
  102. package/dist/esm/getIntlayerAPI/search.mjs +9 -1
  103. package/dist/esm/getIntlayerAPI/search.mjs.map +1 -1
  104. package/dist/esm/getIntlayerAPI/showcaseProject.mjs +9 -1
  105. package/dist/esm/getIntlayerAPI/showcaseProject.mjs.map +1 -1
  106. package/dist/esm/getIntlayerAPI/status.mjs +46 -0
  107. package/dist/esm/getIntlayerAPI/status.mjs.map +1 -0
  108. package/dist/esm/getIntlayerAPI/stripe.mjs +13 -3
  109. package/dist/esm/getIntlayerAPI/stripe.mjs.map +1 -1
  110. package/dist/esm/getIntlayerAPI/tag.mjs +9 -1
  111. package/dist/esm/getIntlayerAPI/tag.mjs.map +1 -1
  112. package/dist/esm/getIntlayerAPI/translate.mjs +9 -1
  113. package/dist/esm/getIntlayerAPI/translate.mjs.map +1 -1
  114. package/dist/esm/getIntlayerAPI/user.mjs +9 -1
  115. package/dist/esm/getIntlayerAPI/user.mjs.map +1 -1
  116. package/dist/esm/index.mjs +25 -21
  117. package/dist/esm/proxy.mjs +82 -97
  118. package/dist/esm/proxy.mjs.map +1 -1
  119. package/dist/types/@intlayer/unmerged-dictionaries-entry/dist/types/index.d.ts +9 -0
  120. package/dist/types/@intlayer/unmerged-dictionaries-entry/dist/types/index.d.ts.map +1 -0
  121. package/dist/types/cms/createAuthManager.d.ts +102 -0
  122. package/dist/types/cms/createAuthManager.d.ts.map +1 -0
  123. package/dist/types/cms/createIntlayerCMS.d.ts +79 -0
  124. package/dist/types/cms/createIntlayerCMS.d.ts.map +1 -0
  125. package/dist/types/cms/index.d.ts +3 -0
  126. package/dist/types/distantDictionary/fetchDistantDictionaries.d.ts +1 -2
  127. package/dist/types/distantDictionary/fetchDistantDictionaries.d.ts.map +1 -1
  128. package/dist/types/distantDictionary/fetchDistantDictionary.d.ts +1 -2
  129. package/dist/types/distantDictionary/fetchDistantDictionary.d.ts.map +1 -1
  130. package/dist/types/fetcher.d.ts.map +1 -1
  131. package/dist/types/getIntlayerAPI/ai.d.ts +23 -3
  132. package/dist/types/getIntlayerAPI/ai.d.ts.map +1 -1
  133. package/dist/types/getIntlayerAPI/analytics.d.ts +29 -0
  134. package/dist/types/getIntlayerAPI/analytics.d.ts.map +1 -0
  135. package/dist/types/getIntlayerAPI/asset.d.ts +20 -2
  136. package/dist/types/getIntlayerAPI/asset.d.ts.map +1 -1
  137. package/dist/types/getIntlayerAPI/audit.d.ts +25 -3
  138. package/dist/types/getIntlayerAPI/audit.d.ts.map +1 -1
  139. package/dist/types/getIntlayerAPI/bitbucket.d.ts +16 -2
  140. package/dist/types/getIntlayerAPI/bitbucket.d.ts.map +1 -1
  141. package/dist/types/getIntlayerAPI/dictionary.d.ts +23 -6
  142. package/dist/types/getIntlayerAPI/dictionary.d.ts.map +1 -1
  143. package/dist/types/getIntlayerAPI/editor.d.ts +17 -3
  144. package/dist/types/getIntlayerAPI/editor.d.ts.map +1 -1
  145. package/dist/types/getIntlayerAPI/environment.d.ts +18 -3
  146. package/dist/types/getIntlayerAPI/environment.d.ts.map +1 -1
  147. package/dist/types/getIntlayerAPI/github.d.ts +17 -2
  148. package/dist/types/getIntlayerAPI/github.d.ts.map +1 -1
  149. package/dist/types/getIntlayerAPI/gitlab.d.ts +16 -2
  150. package/dist/types/getIntlayerAPI/gitlab.d.ts.map +1 -1
  151. package/dist/types/getIntlayerAPI/index.d.ts +6 -3
  152. package/dist/types/getIntlayerAPI/index.d.ts.map +1 -1
  153. package/dist/types/getIntlayerAPI/newsletter.d.ts +15 -3
  154. package/dist/types/getIntlayerAPI/newsletter.d.ts.map +1 -1
  155. package/dist/types/getIntlayerAPI/oAuth.d.ts +1 -2
  156. package/dist/types/getIntlayerAPI/oAuth.d.ts.map +1 -1
  157. package/dist/types/getIntlayerAPI/organization.d.ts +27 -5
  158. package/dist/types/getIntlayerAPI/organization.d.ts.map +1 -1
  159. package/dist/types/getIntlayerAPI/project.d.ts +34 -7
  160. package/dist/types/getIntlayerAPI/project.d.ts.map +1 -1
  161. package/dist/types/getIntlayerAPI/reviewer.d.ts +49 -5
  162. package/dist/types/getIntlayerAPI/reviewer.d.ts.map +1 -1
  163. package/dist/types/getIntlayerAPI/search.d.ts +13 -3
  164. package/dist/types/getIntlayerAPI/search.d.ts.map +1 -1
  165. package/dist/types/getIntlayerAPI/showcaseProject.d.ts +27 -6
  166. package/dist/types/getIntlayerAPI/showcaseProject.d.ts.map +1 -1
  167. package/dist/types/getIntlayerAPI/status.d.ts +35 -0
  168. package/dist/types/getIntlayerAPI/status.d.ts.map +1 -0
  169. package/dist/types/getIntlayerAPI/stripe.d.ts +61 -25
  170. package/dist/types/getIntlayerAPI/stripe.d.ts.map +1 -1
  171. package/dist/types/getIntlayerAPI/tag.d.ts +18 -5
  172. package/dist/types/getIntlayerAPI/tag.d.ts.map +1 -1
  173. package/dist/types/getIntlayerAPI/translate.d.ts +38 -3
  174. package/dist/types/getIntlayerAPI/translate.d.ts.map +1 -1
  175. package/dist/types/getIntlayerAPI/user.d.ts +25 -7
  176. package/dist/types/getIntlayerAPI/user.d.ts.map +1 -1
  177. package/dist/types/index.d.ts +27 -21
  178. package/dist/types/intlayer-editor/server/dist/controllers/configuration.controller.d.ts +9 -0
  179. package/dist/types/intlayer-editor/server/dist/controllers/configuration.controller.d.ts.map +1 -0
  180. package/dist/types/intlayer-editor/server/dist/controllers/dictionary.controller.d.ts +19 -0
  181. package/dist/types/intlayer-editor/server/dist/controllers/dictionary.controller.d.ts.map +1 -0
  182. package/dist/types/intlayer-editor/server/dist/export.d.ts +3 -0
  183. package/dist/types/intlayer-editor/server/dist/utils/httpStatusCodes.d.ts +408 -0
  184. package/dist/types/intlayer-editor/server/dist/utils/httpStatusCodes.d.ts.map +1 -0
  185. package/dist/types/intlayer-editor/server/dist/utils/responseData.d.ts +19 -0
  186. package/dist/types/intlayer-editor/server/dist/utils/responseData.d.ts.map +1 -0
  187. package/dist/types/proxy.d.ts +12 -11
  188. package/dist/types/proxy.d.ts.map +1 -1
  189. package/dist/types/types.d.ts +1 -1
  190. package/package.json +31 -7
@@ -1 +1 @@
1
- {"version":3,"file":"proxy.mjs","names":[],"sources":["../../src/proxy.ts"],"sourcesContent":["import type { IntlayerConfig } from '@intlayer/types/config';\nimport type { FetcherOptions } from './fetcher';\nimport { getIntlayerAPI } from './getIntlayerAPI';\nimport type { IntlayerAPI } from './getIntlayerAPI/index';\nimport { getOAuthAPI } from './getIntlayerAPI/oAuth';\n\ntype OAuthTokenLike = {\n accessToken?: string;\n accessTokenExpiresAt?: string | Date;\n expires_in?: number;\n expiresIn?: number;\n expiresAt?: string | Date;\n};\n\nconst ONE_MINUTE_MS = 60_000;\n\n/**\n * Returns the expiration timestamp in ms from an OAuth token-like object.\n */\nconst getExpiryTimestamp = (\n token: OAuthTokenLike | undefined\n): number | undefined => {\n if (!token) return undefined;\n const dateLike = (token.accessTokenExpiresAt ?? token.expiresAt) as\n | string\n | Date\n | undefined;\n if (dateLike) {\n const ts =\n typeof dateLike === 'string'\n ? Date.parse(dateLike)\n : dateLike.getTime?.();\n if (typeof ts === 'number' && Number.isFinite(ts)) return ts;\n }\n const seconds = token.expires_in ?? token.expiresIn;\n if (typeof seconds === 'number' && Number.isFinite(seconds)) {\n return Date.now() + seconds * 1000;\n }\n return undefined;\n};\n\nlet currentAccessToken: string | undefined;\nlet currentExpiryTs: number | undefined;\nlet pendingRefresh: Promise<void> | undefined;\n\n/**\n * Build an auto-auth proxy around getIntlayerAPI that:\n * - Fetches an OAuth2 token when needed\n * - Injects Authorization header for each request\n * - Refreshes token proactively when near expiry\n *\n * When `sessionToken` is provided (a CLI session token starting with\n * \"clisession_\"), it is used directly as the Bearer token without any OAuth2\n * exchange — the backend validates it against the CliSessionToken collection.\n *\n * The returned API matches the shape of getIntlayerAPI.\n */\nexport const getIntlayerAPIProxy = (\n baseAuthOptions: FetcherOptions = {},\n intlayerConfig?: Pick<IntlayerConfig, 'editor'>,\n sessionToken?: string\n): IntlayerAPI => {\n // Use a shared mutable auth options object captured by the API closures.\n // credentials: 'omit' prevents the browser from attaching session cookies to\n // these requests; authentication is handled exclusively via the Bearer token\n // injected below. This is required because the backend only sets\n // Access-Control-Allow-Credentials: true for whitelisted first-party origins.\n const authOptionsRef: FetcherOptions = {\n ...baseAuthOptions,\n credentials: 'omit',\n };\n const hasCMSAuth =\n Boolean(sessionToken) ||\n Boolean(\n intlayerConfig?.editor?.clientId && intlayerConfig?.editor?.clientSecret\n );\n\n // When a CLI session token is provided, inject it immediately and skip the\n // OAuth2 client_credentials exchange entirely.\n if (sessionToken) {\n authOptionsRef.headers = {\n ...(authOptionsRef.headers ?? {}),\n Authorization: `Bearer ${sessionToken}`,\n } as HeadersInit;\n }\n\n const baseApi = getIntlayerAPI(authOptionsRef, intlayerConfig);\n\n const needsRefresh = (): boolean => {\n if (!currentAccessToken) return true;\n if (!currentExpiryTs) return false; // If unknown, assume usable until failure\n\n return Date.now() + ONE_MINUTE_MS >= currentExpiryTs; // refresh 1 min before expiry\n };\n\n const refreshToken = async (): Promise<void> => {\n const doRefresh = async () => {\n const authApi = getOAuthAPI({}, intlayerConfig);\n const res = await authApi.getOAuth2AccessToken();\n const tokenData = res?.data as OAuthTokenLike | undefined;\n\n currentAccessToken = tokenData?.accessToken;\n currentExpiryTs = getExpiryTimestamp(tokenData);\n };\n\n if (!pendingRefresh) {\n pendingRefresh = doRefresh().finally(() => {\n pendingRefresh = undefined;\n });\n }\n await pendingRefresh;\n };\n\n const ensureValidToken = async () => {\n if (needsRefresh()) {\n await refreshToken();\n }\n };\n\n const applyAuthHeaderToRef = () => {\n if (!currentAccessToken) return;\n authOptionsRef.headers = {\n ...(authOptionsRef.headers ?? {}),\n Authorization: `Bearer ${currentAccessToken}`,\n } as HeadersInit;\n };\n\n const wrapSection = <T extends Record<string, unknown>>(\n section: T,\n skipAuth = !hasCMSAuth\n ): T => {\n return new Proxy(section, {\n get(target, prop, receiver) {\n const value = Reflect.get(target, prop, receiver);\n\n if (typeof value === 'function') {\n // Wrap section method to inject token and headers\n return async (...args: unknown[]) => {\n if (!skipAuth) {\n if (sessionToken) {\n // Session token is pre-injected in authOptionsRef; no OAuth2 exchange needed\n } else {\n await ensureValidToken();\n applyAuthHeaderToRef();\n }\n }\n\n try {\n return await value.apply(target, args);\n } catch (err) {\n // Best-effort retry: if token might be stale, refresh once and retry\n if (!skipAuth && !sessionToken) {\n await refreshToken();\n applyAuthHeaderToRef();\n return await value.apply(target, args);\n }\n throw err;\n }\n };\n }\n\n return value;\n },\n });\n };\n\n return {\n organization: wrapSection(baseApi.organization),\n project: wrapSection(baseApi.project),\n user: wrapSection(baseApi.user),\n oAuth: wrapSection(baseApi.oAuth, true), // do NOT inject auth for token endpoint\n dictionary: wrapSection(baseApi.dictionary),\n stripe: wrapSection(baseApi.stripe),\n ai: wrapSection(baseApi.ai),\n tag: wrapSection(baseApi.tag),\n search: wrapSection(baseApi.search),\n editor: wrapSection(baseApi.editor),\n newsletter: wrapSection(baseApi.newsletter),\n github: wrapSection(baseApi.github),\n } as Int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AM,mBAAmB,YAAY;AACnC,MAAI,cAAc,CAChB,OAAM,cAAc;;CAIxB,MAAM,6BAA6B;AACjC,MAAI,CAAC,mBAAoB;AACzB,iBAAe,UAAU;GACvB,GAAI,eAAe,WAAW,EAAE;GAChC,eAAe,UAAU;GAC1B;;CAGH,MAAM,eACJ,SACA,WAAW,CAAC,eACN;AACN,SAAO,IAAI,MAAM,SAAS,EACxB,IAAI,QAAQ,MAAM,UAAU;GAC1B,MAAM,QAAQ,QAAQ,IAAI,QAAQ,MAAM,SAAS;AAEjD,OAAI,OAAO,UAAU,WAEnB,QAAO,OAAO,GAAG,SAAoB;AACnC,QAAI,CAAC,SACH,KAAI,cAAc,QAEX;AACL,WAAM,kBAAkB;AACxB,2BAAsB;;AAI1B,QAAI;AACF,YAAO,MAAM,MAAM,MAAM,QAAQ,KAAK;aAC/B,KAAK;AAEZ,SAAI,CAAC,YAAY,CAAC,cAAc;AAC9B,YAAM,cAAc;AACpB,4BAAsB;AACtB,aAAO,MAAM,MAAM,MAAM,QAAQ,KAAK;;AAExC,WAAM;;;AAKZ,UAAO;KAEV,CAAC;;AAGJ,QAAO;EACL,cAAc,YAAY,QAAQ,aAAa;EAC/C,SAAS,YAAY,QAAQ,QAAQ;EACrC,MAAM,YAAY,QAAQ,KAAK;EAC/B,OAAO,YAAY,QAAQ,OAAO,KAAK;EACvC,YAAY,YAAY,QAAQ,WAAW;EAC3C,QAAQ,YAAY,QAAQ,OAAO;EACnC,IAAI,YAAY,QAAQ,GAAG;EAC3B,KAAK,YAAY,QAAQ,IAAI;EAC7B,QAAQ,YAAY,QAAQ,OAAO;EACnC,QAAQ,YAAY,QAAQ,OAAO;EACnC,YAAY,YAAY,QAAQ,WAAW;EAC3C,QAAQ,YAAY,QAAQ,OAAO;EACpC"}
1
+ {"version":3,"file":"proxy.mjs","names":[],"sources":["../../src/proxy.ts"],"sourcesContent":["import { editor } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { createIntlayerCMS, type IntlayerCMS } from './cms/createIntlayerCMS';\nimport type { FetcherOptions } from './fetcher';\nimport { getAiAPI } from './getIntlayerAPI/ai';\nimport { getAnalyticsAPI } from './getIntlayerAPI/analytics';\nimport { getAssetAPI } from './getIntlayerAPI/asset';\nimport { getAuditAPI } from './getIntlayerAPI/audit';\nimport { getBitbucketAPI } from './getIntlayerAPI/bitbucket';\nimport { getDictionaryAPI } from './getIntlayerAPI/dictionary';\nimport { getEditorAPI } from './getIntlayerAPI/editor';\nimport { getEnvironmentAPI } from './getIntlayerAPI/environment';\nimport { getGithubAPI } from './getIntlayerAPI/github';\nimport { getGitlabAPI } from './getIntlayerAPI/gitlab';\nimport type { IntlayerAPI } from './getIntlayerAPI/index';\nimport { getNewsletterAPI } from './getIntlayerAPI/newsletter';\nimport { getOAuthAPI } from './getIntlayerAPI/oAuth';\nimport { getOrganizationAPI } from './getIntlayerAPI/organization';\nimport { getProjectAPI } from './getIntlayerAPI/project';\nimport { getReviewerAPI } from './getIntlayerAPI/reviewer';\nimport { getSearchAPI } from './getIntlayerAPI/search';\nimport { getShowcaseProjectAPI } from './getIntlayerAPI/showcaseProject';\nimport { getStatusAPI } from './getIntlayerAPI/status';\nimport { getStripeAPI } from './getIntlayerAPI/stripe';\nimport { getTagAPI } from './getIntlayerAPI/tag';\nimport { getTranslateAPI } from './getIntlayerAPI/translate';\nimport { getUserAPI } from './getIntlayerAPI/user';\n\ntype SectionKey = keyof IntlayerAPI;\n\n/**\n * Homogeneous factory map: every domain factory normalized to the same\n * `(fetcherOptions, config) => section` signature, keyed by section name.\n * Declaring it as a single mapped type lets a generic lookup stay callable\n * (a union of factory signatures would not be).\n */\ntype SectionFactories = {\n [Key in SectionKey]: (\n fetcherOptions: FetcherOptions,\n intlayerConfig: IntlayerConfig\n ) => IntlayerAPI[Key];\n};\n\nconst sectionFactories: SectionFactories = {\n asset: getAssetAPI,\n organization: getOrganizationAPI,\n project: getProjectAPI,\n environment: getEnvironmentAPI,\n user: getUserAPI,\n oAuth: getOAuthAPI,\n dictionary: getDictionaryAPI,\n stripe: getStripeAPI,\n ai: getAiAPI,\n analytics: getAnalyticsAPI,\n audit: getAuditAPI,\n tag: getTagAPI,\n search: getSearchAPI,\n editor: getEditorAPI,\n newsletter: getNewsletterAPI,\n github: getGithubAPI,\n gitlab: getGitlabAPI,\n bitbucket: getBitbucketAPI,\n showcaseProject: getShowcaseProjectAPI,\n translate: getTranslateAPI,\n reviewer: getReviewerAPI,\n status: getStatusAPI,\n};\n\n// The OAuth2 token endpoint must never receive an injected Bearer token —\n// it is the call that issues one.\nconst AUTH_FREE_SECTIONS: ReadonlySet<SectionKey> = new Set<SectionKey>([\n 'oAuth',\n]);\n\n/**\n * Builds the **complete** auto-authenticated Intlayer API as a single lazy\n * object. Every domain is reachable through it, so it pulls every domain client\n * into the bundle.\n *\n * Prefer {@link createIntlayerCMS} together with the per-domain endpoint binders\n * (e.g. `dictionaryEndpoint`) in bundle-sensitive code — they include only the\n * domains you use. This helper is a convenience for Node tools (such as the CLI)\n * where bundle size is not a concern.\n */\nexport const getIntlayerAPIProxy = (\n baseAuthOptions: FetcherOptions = {},\n intlayerConfig: Pick<IntlayerConfig, 'editor'> = { editor },\n sessionToken?: string\n): IntlayerAPI => {\n const cms: IntlayerCMS = createIntlayerCMS(intlayerConfig, {\n baseFetcherOptions: baseAuthOptions,\n sessionToken,\n });\n\n const sectionCache = new Map<SectionKey, unknown>();\n\n // Generic over `Key` so `sectionFactories[key]` resolves to a single\n // `(opts, config) => IntlayerAPI[Key]` signature rather than the union of all\n // factory signatures (which would not be callable).\n const buildSection = <Key extends SectionKey>(key: Key): IntlayerAPI[Key] => {\n const factory = sectionFactories[key] as (\n fetcherOptions: FetcherOptions,\n intlayerConfig: IntlayerConfig\n ) => Record<string, unknown>;\n\n return cms.bindSection(factory, {\n skipAuth: AUTH_FREE_SECTIONS.has(key) ? true : undefined,\n }) as IntlayerAPI[Key];\n };\n\n return new Proxy({} as IntlayerAPI, {\n get(_target, property) {\n const key = property as SectionKey;\n if (!(key in sectionFactories)) return undefined;\n\n if (!sectionCache.has(key)) {\n sectionCache.set(key, buildSection(key));\n }\n\n return sectionCache.get(key);\n },\n has(_target, property) {\n return (property as SectionKey) in sectionFactories;\n },\n ownKeys() {\n return Reflect.ownKeys(sectionFactories);\n },\n getOwnPropertyDescriptor() {\n return { enumerable: true, configurable: true };\n },\n });\n};\n\n/**\n * The complete auto-authenticated Intlayer API returned by\n * {@link getIntlayerAPIProxy}. Equivalent in shape to `IntlayerAPI`.\n */\nexport type IntlayerAPIProxy = ReturnType<typeof getIntlayerAPIProxy>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAM,mBAAqC;CACzC,OAAO;CACP,cAAc;CACd,SAAS;CACT,aAAa;CACb,MAAM;CACN,OAAO;CACP,YAAY;CACZ,QAAQ;CACR,IAAI;CACJ,WAAW;CACX,OAAO;CACP,KAAK;CACL,QAAQ;CACR,QAAQ;CACR,YAAY;CACZ,QAAQ;CACR,QAAQ;CACR,WAAW;CACX,iBAAiB;CACjB,WAAW;CACX,UAAU;CACV,QAAQ;AACV;AAIA,MAAM,qCAA8C,IAAI,IAAgB,CACtE,OACF,CAAC;;;;;;;;;;;AAYD,MAAa,uBACX,kBAAkC,CAAC,GACnC,iBAAiD,EAAE,OAAO,GAC1D,iBACgB;CAChB,MAAM,MAAmB,kBAAkB,gBAAgB;EACzD,oBAAoB;EACpB;CACF,CAAC;CAED,MAAM,+BAAe,IAAI,IAAyB;CAKlD,MAAM,gBAAwC,QAA+B;EAC3E,MAAM,UAAU,iBAAiB;EAKjC,OAAO,IAAI,YAAY,SAAS,EAC9B,UAAU,mBAAmB,IAAI,GAAG,IAAI,OAAO,OACjD,CAAC;CACH;CAEA,OAAO,IAAI,MAAM,CAAC,GAAkB;EAClC,IAAI,SAAS,UAAU;GACrB,MAAM,MAAM;GACZ,IAAI,EAAE,OAAO,mBAAmB,OAAO;GAEvC,IAAI,CAAC,aAAa,IAAI,GAAG,GACvB,aAAa,IAAI,KAAK,aAAa,GAAG,CAAC;GAGzC,OAAO,aAAa,IAAI,GAAG;EAC7B;EACA,IAAI,SAAS,UAAU;GACrB,OAAQ,YAA2B;EACrC;EACA,UAAU;GACR,OAAO,QAAQ,QAAQ,gBAAgB;EACzC;EACA,2BAA2B;GACzB,OAAO;IAAE,YAAY;IAAM,cAAc;GAAK;EAChD;CACF,CAAC;AACH"}
@@ -0,0 +1,9 @@
1
+ import { IntlayerConfig } from "@intlayer/types/config";
2
+ import { Dictionary } from "@intlayer/types/dictionary";
3
+ import { DictionaryKeys } from "@intlayer/types/module_augmentation";
4
+ //#region ../unmerged-dictionaries-entry/dist/types/index.d.ts
5
+ //#region src/index.d.ts
6
+ type UnmergedDictionaries = Record<DictionaryKeys, Dictionary[]>;
7
+ //#endregion
8
+ export { UnmergedDictionaries };
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../../../../../unmerged-dictionaries-entry/dist/types/index.d.ts"],"mappings":";;;;;KAIK,uBAAuB,OAAO,gBAAgB"}
@@ -0,0 +1,102 @@
1
+ import { FetcherOptions } from "../fetcher.js";
2
+ import { IntlayerConfig } from "@intlayer/types/config";
3
+ //#region src/cms/createAuthManager.d.ts
4
+ /**
5
+ * Any asynchronous API method exposed by a domain section
6
+ * (e.g. `getDictionaries`, `pushDictionaries`).
7
+ */
8
+ type AsyncMethod<Arguments extends unknown[], Result> = (...args: Arguments) => Promise<Result>;
9
+ /**
10
+ * A domain section factory: builds a plain object of async methods from shared
11
+ * fetcher options and the Intlayer configuration.
12
+ */
13
+ type SectionFactory<Section extends Record<string, unknown>> = (fetcherOptions: FetcherOptions, intlayerConfig: IntlayerConfig) => Section;
14
+ /**
15
+ * Options accepted when creating an {@link AuthManager}.
16
+ */
17
+ type AuthManagerOptions = {
18
+ /**
19
+ * Base fetcher options merged into every request (e.g. custom headers).
20
+ */
21
+ baseFetcherOptions?: FetcherOptions;
22
+ /**
23
+ * A pre-issued CLI session token (prefixed with `clisession_`). When provided,
24
+ * it is used directly as the Bearer token and the OAuth2 `client_credentials`
25
+ * exchange is skipped entirely.
26
+ */
27
+ sessionToken?: string;
28
+ };
29
+ /**
30
+ * Options accepted when binding a domain section to an {@link AuthManager}.
31
+ */
32
+ type BindSectionOptions = {
33
+ /**
34
+ * Forces auth injection on (`false`) or off (`true`). Defaults to enabled
35
+ * whenever credentials are available.
36
+ */
37
+ skipAuth?: boolean;
38
+ };
39
+ /**
40
+ * Manages CMS authentication for a set of API calls.
41
+ *
42
+ * The manager owns a single mutable {@link FetcherOptions} object
43
+ * (`fetcherOptions`). Domain factories bound through it share the same
44
+ * reference, so refreshing the token in place transparently authenticates every
45
+ * call — without rebuilding the API clients.
46
+ */
47
+ type AuthManager = {
48
+ /**
49
+ * Mutable fetcher options carrying the `Authorization` header. Bound sections
50
+ * share this reference so the injected token is reused everywhere.
51
+ */
52
+ fetcherOptions: FetcherOptions;
53
+ /**
54
+ * The resolved Intlayer configuration (merged with the build-time defaults).
55
+ */
56
+ intlayerConfig: IntlayerConfig;
57
+ /**
58
+ * `true` when credentials are available — either a session token or a
59
+ * `clientId`/`clientSecret` pair in the configuration.
60
+ */
61
+ hasCredentials: boolean;
62
+ /**
63
+ * Ensures a valid access token is available and applies it to
64
+ * `fetcherOptions`. Called automatically by {@link withAuth}.
65
+ */
66
+ ensureAuth: () => Promise<void>;
67
+ /**
68
+ * Forces a token refresh on the next call by clearing the cached token.
69
+ */
70
+ reset: () => void;
71
+ /**
72
+ * Wraps a single API method so it injects (and, on failure, refreshes) the
73
+ * access token on every invocation while preserving the method's signature.
74
+ */
75
+ withAuth: <Arguments extends unknown[], Result>(method: AsyncMethod<Arguments, Result>, skipAuth?: boolean) => AsyncMethod<Arguments, Result>;
76
+ /**
77
+ * Instantiates a domain factory with the managed fetcher options and config,
78
+ * returning a section whose every method authenticates automatically.
79
+ *
80
+ * @example
81
+ * ```ts
82
+ * const dictionary = authManager.bindSection(getDictionaryAPI);
83
+ * await dictionary.pushDictionaries(dictionaries);
84
+ * ```
85
+ */
86
+ bindSection: <Section extends Record<string, unknown>>(factory: SectionFactory<Section>, options?: BindSectionOptions) => Section;
87
+ };
88
+ /**
89
+ * Creates an instance-scoped {@link AuthManager} handling the OAuth2
90
+ * `client_credentials` flow (or a pre-issued CLI session token).
91
+ *
92
+ * Unlike a global token cache, each manager keeps its own token state, so
93
+ * independent SDK instances never interfere with one another.
94
+ *
95
+ * @param intlayerConfig - Intlayer configuration carrying the `editor`
96
+ * credentials. Defaults to the build-time configuration.
97
+ * @param options - Optional session token and base fetcher options.
98
+ */
99
+ declare const createAuthManager: (intlayerConfig?: Pick<IntlayerConfig, 'editor'>, options?: AuthManagerOptions) => AuthManager;
100
+ //#endregion
101
+ export { AuthManager, AuthManagerOptions, BindSectionOptions, createAuthManager };
102
+ //# sourceMappingURL=createAuthManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createAuthManager.d.ts","names":[],"sources":["../../../src/cms/createAuthManager.ts"],"mappings":";;;;;;;KAsBK,YAAY,6BAA6B,cACzC,MAAM,cACN,QAAQ;;;;;KAMR,eAAe,gBAAgB,4BAClC,gBAAgB,gBAChB,gBAAgB,mBACb;;;;KAuCO;;;;EAIV,qBAAqB;;;;;;EAMrB;;;;;KAMU;;;;;EAKV;;;;;;;;;;KAWU;;;;;EAKV,gBAAgB;;;;EAIhB,gBAAgB;;;;;EAKhB;;;;;EAKA,kBAAkB;;;;EAIlB;;;;;EAKA,WAAW,6BAA6B,QACtC,QAAQ,YAAY,WAAW,SAC/B,uBACG,YAAY,WAAW;;;;;;;;;;;EAW5B,cAAc,gBAAgB,yBAC5B,SAAS,eAAe,UACxB,UAAU,uBACP;;;;;;;;;;;;;cAcM,oBAAiB,iBACZ,KAAK,2BAAyB,UACrC,uBACR"}
@@ -0,0 +1,79 @@
1
+ import { FetcherOptions } from "../fetcher.js";
2
+ import { AuthManager, AuthManagerOptions, BindSectionOptions } from "./createAuthManager.js";
3
+ import { IntlayerConfig } from "@intlayer/types/config";
4
+ //#region src/cms/createIntlayerCMS.d.ts
5
+ /**
6
+ * Options accepted when creating the Intlayer CMS authenticator.
7
+ */
8
+ type IntlayerCMSOptions = AuthManagerOptions;
9
+ /**
10
+ * The Intlayer CMS authenticator returned by {@link createIntlayerCMS}.
11
+ *
12
+ * It is a lightweight object that holds the credentials and the managed token,
13
+ * but knows nothing about individual domains. Pair it with a domain endpoint
14
+ * (e.g. `dictionaryEndpoint`) to issue authenticated requests.
15
+ */
16
+ type IntlayerCMS = AuthManager;
17
+ /**
18
+ * Creates an Intlayer CMS authenticator handling authentication automatically
19
+ * (OAuth2 `client_credentials`, or a CLI session token).
20
+ *
21
+ * This factory is intentionally lightweight: it does **not** bundle any domain
22
+ * client. Combine it with the per-domain endpoint binders — imported separately
23
+ * so only the domains you use are included in your bundle.
24
+ *
25
+ * The configuration is optional: when omitted, the credentials are read from the
26
+ * build-time configuration (`@intlayer/config/built`), which resolves the
27
+ * `INTLAYER_CLIENT_ID` / `INTLAYER_CLIENT_SECRET` environment variables.
28
+ *
29
+ * > Security: the CMS credentials grant write access to your content. Only ever
30
+ * > create the authenticator on the server side — never ship `clientId` /
31
+ * > `clientSecret` to the browser.
32
+ *
33
+ * @param intlayerConfig - Intlayer configuration carrying the `editor`
34
+ * credentials. Defaults to the build-time configuration.
35
+ * @param options - Optional CLI session token and base fetcher options.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * import { createIntlayerCMS } from '@intlayer/api';
40
+ * import { dictionaryEndpoint } from '@intlayer/api/dictionary';
41
+ *
42
+ * // Optional: reads INTLAYER_CLIENT_ID / INTLAYER_CLIENT_SECRET when omitted
43
+ * const cms = createIntlayerCMS();
44
+ *
45
+ * // Read
46
+ * const { data: dictionaries } = await dictionaryEndpoint(cms).getDictionaries();
47
+ *
48
+ * // Write
49
+ * await dictionaryEndpoint(cms).pushDictionaries([myDictionary]);
50
+ * ```
51
+ */
52
+ declare const createIntlayerCMS: (intlayerConfig?: Pick<IntlayerConfig, 'editor'>, options?: IntlayerCMSOptions) => IntlayerCMS;
53
+ /**
54
+ * A domain endpoint binder: given an authenticator (or none, in which case a
55
+ * default one is created from the build-time configuration), returns the
56
+ * authenticated domain section.
57
+ */
58
+ type CMSEndpoint<Section extends Record<string, unknown>> = (cms?: IntlayerCMS) => Section;
59
+ /**
60
+ * Turns a domain factory into a tree-shakeable endpoint binder.
61
+ *
62
+ * Each endpoint pulls in only its own domain client plus the auth machinery, so
63
+ * importing `dictionaryEndpoint` never bundles the project, AI, or any other
64
+ * domain.
65
+ *
66
+ * @param factory - The domain factory (e.g. `getDictionaryAPI`).
67
+ * @param options - Binding options, e.g. `{ skipAuth: true }` for the token
68
+ * endpoint itself.
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * // inside @intlayer/api/dictionary
73
+ * export const dictionaryEndpoint = createEndpoint(getDictionaryAPI);
74
+ * ```
75
+ */
76
+ declare const createEndpoint: <Section extends Record<string, unknown>>(factory: (fetcherOptions: FetcherOptions, intlayerConfig: IntlayerConfig) => Section, options?: BindSectionOptions) => CMSEndpoint<Section>;
77
+ //#endregion
78
+ export { CMSEndpoint, IntlayerCMS, IntlayerCMSOptions, createEndpoint, createIntlayerCMS };
79
+ //# sourceMappingURL=createIntlayerCMS.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createIntlayerCMS.d.ts","names":[],"sources":["../../../src/cms/createIntlayerCMS.ts"],"mappings":";;;;;;;KAaY,qBAAqB;;;;;;;;KASrB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAqCb,oBAAiB,iBACZ,KAAK,2BAAyB,UACrC,uBACR;;;;;;KAOS,YAAY,gBAAgB,4BACtC,MAAM,gBACH;;;;;;;;;;;;;;;;;;cAmBQ,iBACV,gBAAgB,yBAAuB,UAEpC,gBAAgB,gBAChB,gBAAgB,mBACb,SAAO,UACF,uBACT,YAAY"}
@@ -0,0 +1,3 @@
1
+ import { AuthManager, AuthManagerOptions, BindSectionOptions, createAuthManager } from "./createAuthManager.js";
2
+ import { CMSEndpoint, IntlayerCMS, IntlayerCMSOptions, createEndpoint, createIntlayerCMS } from "./createIntlayerCMS.js";
3
+ export { AuthManager, AuthManagerOptions, BindSectionOptions, CMSEndpoint, IntlayerCMS, IntlayerCMSOptions, createAuthManager, createEndpoint, createIntlayerCMS };
@@ -1,6 +1,5 @@
1
- import { DictionaryAPI } from "@intlayer/backend";
2
1
  import { IntlayerConfig } from "@intlayer/types/config";
3
-
2
+ import { DictionaryAPI } from "@intlayer/backend";
4
3
  //#region src/distantDictionary/fetchDistantDictionaries.d.ts
5
4
  /**
6
5
  * Fetch distant dictionary
@@ -1 +1 @@
1
- {"version":3,"file":"fetchDistantDictionaries.d.ts","names":[],"sources":["../../../src/distantDictionary/fetchDistantDictionaries.ts"],"mappings":";;;;;;AAOA;cAAa,wBAAA,GACX,cAAA,EAAgB,cAAA,KACf,OAAA,CAAQ,aAAA"}
1
+ {"version":3,"file":"fetchDistantDictionaries.d.ts","names":[],"sources":["../../../src/distantDictionary/fetchDistantDictionaries.ts"],"mappings":";;;;;;cAQa,2BAAwB,gBACnB,mBACf,QAAQ"}
@@ -1,6 +1,5 @@
1
- import { DictionaryAPI } from "@intlayer/backend";
2
1
  import { IntlayerConfig } from "@intlayer/types/config";
3
-
2
+ import { DictionaryAPI } from "@intlayer/backend";
4
3
  //#region src/distantDictionary/fetchDistantDictionary.d.ts
5
4
  /**
6
5
  * Fetch distant dictionary
@@ -1 +1 @@
1
- {"version":3,"file":"fetchDistantDictionary.d.ts","names":[],"sources":["../../../src/distantDictionary/fetchDistantDictionary.ts"],"mappings":";;;;;;AAOA;cAAa,sBAAA,GACX,aAAA,UACA,cAAA,EAAgB,cAAA,KACf,OAAA,CAAQ,aAAA"}
1
+ {"version":3,"file":"fetchDistantDictionary.d.ts","names":[],"sources":["../../../src/distantDictionary/fetchDistantDictionary.ts"],"mappings":";;;;;;cAQa,yBAAsB,uBACZ,gBACL,mBACf,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"fetcher.d.ts","names":[],"sources":["../../src/fetcher.ts"],"mappings":";;AAKA;;;;KAAY,cAAA,GAAiB,IAAA,CAAK,WAAA;EAIzB;;;EAAP,IAAA,GAAO,MAAA;EAOY;;;EAHnB,MAAA,GACI,MAAA,qDAEA,eAAA;AAAA;;;;;;cAQO,cAAA,EAAgB,cAAA;;;;;AA6F7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAa,OAAA,MACX,GAAA,aACG,OAAA,EAAS,cAAA,OACX,OAAA,CAAQ,CAAA"}
1
+ {"version":3,"file":"fetcher.d.ts","names":[],"sources":["../../src/fetcher.ts"],"mappings":";;;;;;KAKY,iBAAiB,KAAK;;;;EAIhC,OAAO;;;;EAIP,SACI,2DAEA;;;;;;;cAQO,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA6FhB,UAAiB,GAAC,gBAClB,SACC,qBACX,QAAQ"}
@@ -1,7 +1,8 @@
1
1
  import { FetcherOptions } from "../fetcher.js";
2
- import { AIOptions, AskDocQuestionResult, AuditContentDeclarationBody, AuditContentDeclarationFieldBody, AuditContentDeclarationMetadataBody, AuditTagBody, ChatCompletionRequestMessage, ChatResult, CustomQueryBody, GetDiscussionsParams, TranslateJSONBody } from "@intlayer/backend";
2
+ import { CMSEndpoint } from "../cms/createIntlayerCMS.js";
3
+ import "../index.js";
3
4
  import { IntlayerConfig } from "@intlayer/types/config";
4
-
5
+ import { AIOptions, AskDocQuestionResult, AuditContentDeclarationBody, AuditContentDeclarationFieldBody, AuditContentDeclarationMetadataBody, AuditTagBody, ChatCompletionRequestMessage, ChatResult, CustomQueryBody, GetDiscussionsParams, TranslateJSONBody } from "@intlayer/backend";
5
6
  //#region src/getIntlayerAPI/ai.d.ts
6
7
  type AutocompleteBody = {
7
8
  text: string;
@@ -42,6 +43,25 @@ declare const getAiAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: Intla
42
43
  getDiscussions: (params?: GetDiscussionsParams, otherOptions?: FetcherOptions) => Promise<GetDiscussionsResult>;
43
44
  getAIStats: (otherOptions?: FetcherOptions) => Promise<GetAIStatsResult>;
44
45
  };
46
+ /**
47
+ * Authenticated `ai` endpoint bound to an Intlayer CMS authenticator.
48
+ *
49
+ * Pass an authenticator created with `createIntlayerCMS`, or omit it to use
50
+ * the build-time configuration (`@intlayer/config/built`).
51
+ */
52
+ declare const aiEndpoint: CMSEndpoint<{
53
+ customQuery: (body?: CustomQueryBody, otherOptions?: FetcherOptions) => Promise<CustomQueryResult>;
54
+ translateJSON: (body?: TranslateJSONBody, otherOptions?: FetcherOptions) => Promise<TranslateJSONResult>;
55
+ auditContentDeclaration: (body?: AuditContentDeclarationBody, otherOptions?: FetcherOptions) => Promise<AuditContentDeclarationResult>;
56
+ auditContentDeclarationField: (body?: AuditContentDeclarationFieldBody, otherOptions?: FetcherOptions) => Promise<AuditContentDeclarationFieldResult>;
57
+ auditContentDeclarationMetadata: (body?: AuditContentDeclarationMetadataBody, otherOptions?: FetcherOptions) => Promise<AuditContentDeclarationMetadataResult>;
58
+ auditTag: (body?: AuditTagBody, otherOptions?: FetcherOptions) => Promise<AuditTagResult>;
59
+ askDocQuestion: (body?: AskDocQuestionBody, otherOptions?: FetcherOptions) => Promise<void>;
60
+ chat: (body?: ChatBody, otherOptions?: FetcherOptions) => Promise<void>;
61
+ autocomplete: (body?: AutocompleteBody, otherOptions?: FetcherOptions) => Promise<AutocompleteResponse>;
62
+ getDiscussions: (params?: GetDiscussionsParams, otherOptions?: FetcherOptions) => Promise<GetDiscussionsResult>;
63
+ getAIStats: (otherOptions?: FetcherOptions) => Promise<GetAIStatsResult>;
64
+ }>;
45
65
  //#endregion
46
- export { AskDocQuestionBody, type AskDocQuestionResult, AutocompleteBody, ChatBody, type ChatResult, ClientAction, getAiAPI };
66
+ export { AskDocQuestionBody, type AskDocQuestionResult, AutocompleteBody, ChatBody, type ChatResult, ClientAction, aiEndpoint, getAiAPI };
47
67
  //# sourceMappingURL=ai.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ai.d.ts","names":[],"sources":["../../../src/getIntlayerAPI/ai.ts"],"mappings":";;;;;KA0BY,gBAAA;EACV,IAAA;EACA,SAAA,GAAY,SAAA;EACZ,aAAA;EACA,WAAA;EACA,YAAA;AAAA;AAAA,KAGU,kBAAA;EACV,QAAA,EAAU,4BAAA;EACV,YAAA;EACA,SAAA,IAAa,KAAA;EACb,MAAA,IAAU,QAAA,EAAU,oBAAA;AAAA;AAAA,KAGV,YAAA;EACN,IAAA;EAAkB,IAAA;AAAA;EAClB,IAAA;AAAA;AAAA,KAEM,QAAA;EACV,QAAA,EAAU,4BAAA;EACV,YAAA;EACA,SAAA,IAAa,KAAA;EACb,MAAA,IAAU,QAAA,EAAU,UAAA;EACpB,QAAA,IAAY,MAAA,EAAQ,YAAA;AAAA;AAAA,cAKT,QAAA,GACX,cAAA,GAAgB,cAAA,EAChB,cAAA,GAAiB,cAAA;uBAYR,eAAA,EAAe,YAAA,GACR,cAAA,KAAc,OAAA,CAAA,iBAAA;yBAkBrB,iBAAA,EAAiB,YAAA,GACV,cAAA,KAAc,OAAA,CAAA,mBAAA;mCAkBrB,2BAAA,EAA2B,YAAA,GACpB,cAAA,KAAc,OAAA,CAAA,6BAAA;wCAkBrB,gCAAA,EAAgC,YAAA,GACzB,cAAA,KAAc,OAAA,CAAA,kCAAA;2CAkBrB,mCAAA,EAAmC,YAAA,GAC5B,cAAA,KAAc,OAAA,CAAA,qCAAA;oBAkBrB,YAAA,EAAY,YAAA,GACL,cAAA,KAAc,OAAA,CAAA,cAAA;0BAgCrB,kBAAA,EAAkB,YAAA,GACX,cAAA,KAAc,OAAA;gBAuFH,QAAA,EAAQ,YAAA,GAAgB,cAAA,KAAc,OAAA;wBAsFxD,gBAAA,EAAgB,YAAA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cAAY,eACL,mBAAc,QAAA;EAgCrB,iBAAA,OAAA,oBAAkB,eACX,mBAAc;EAuFH,OAAA,OAAA,UAAQ,eAAgB,mBAAc;EAsFxD,eAAA,OAAA,kBAAgB,eACT,mBAAc,QAAA;EAgBnB,iBAAA,SAAA,sBAAoB,eACf,mBAAc,QAAA;EAiBU,aAAA,eAAA,mBAAc,QAAA"}
@@ -0,0 +1,29 @@
1
+ import { FetcherOptions } from "../fetcher.js";
2
+ import { CMSEndpoint } from "../cms/createIntlayerCMS.js";
3
+ import "../index.js";
4
+ import { IntlayerConfig } from "@intlayer/types/config";
5
+ import { IngestAnalyticsBody } from "@intlayer/backend";
6
+ //#region src/getIntlayerAPI/analytics.d.ts
7
+ declare const getAnalyticsAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => {
8
+ sendEvents: (body: IngestAnalyticsBody, otherOptions?: FetcherOptions) => Promise<IngestAnalyticsResult>;
9
+ getOverview: (otherOptions?: FetcherOptions) => Promise<GetAnalyticsOverviewResult>;
10
+ getAudience: (days?: number, otherOptions?: FetcherOptions) => Promise<GetAudienceResult>;
11
+ getContentStats: (otherOptions?: FetcherOptions) => Promise<GetContentStatsResult>;
12
+ getExperimentResults: (experimentKey: string, otherOptions?: FetcherOptions) => Promise<GetExperimentResultsResult>;
13
+ };
14
+ /**
15
+ * Authenticated `analytics` endpoint bound to an Intlayer CMS authenticator.
16
+ *
17
+ * Pass an authenticator created with `createIntlayerCMS`, or omit it to use
18
+ * the build-time configuration (`@intlayer/config/built`).
19
+ */
20
+ declare const analyticsEndpoint: CMSEndpoint<{
21
+ sendEvents: (body: IngestAnalyticsBody, otherOptions?: FetcherOptions) => Promise<IngestAnalyticsResult>;
22
+ getOverview: (otherOptions?: FetcherOptions) => Promise<GetAnalyticsOverviewResult>;
23
+ getAudience: (days?: number, otherOptions?: FetcherOptions) => Promise<GetAudienceResult>;
24
+ getContentStats: (otherOptions?: FetcherOptions) => Promise<GetContentStatsResult>;
25
+ getExperimentResults: (experimentKey: string, otherOptions?: FetcherOptions) => Promise<GetExperimentResultsResult>;
26
+ }>;
27
+ //#endregion
28
+ export { analyticsEndpoint, getAnalyticsAPI };
29
+ //# sourceMappingURL=analytics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.d.ts","names":[],"sources":["../../../src/getIntlayerAPI/analytics.ts"],"mappings":";;;;;;cAaa,kBAAe,iBACV,gBAAc,iBACb;EAaT,aAAA,MAAA,qBAAmB,eACX,mBAAc,QAAA;EAgBW,cAAA,eAAA,mBAAc,QAAA;EAcH,cAAA,eAAA,eAAA,mBAAc,QAAA;EAerB,kBAAA,eAAA,mBAAc,QAAA;EAc1C,uBAAA,uBAAM,eACP,mBAAc,QAAA;;;;;;;;cAwBnB,mBAxBmB;EA7DtB,aAAA,MAAA,qBAAmB,eACX,mBAAc,QAAA;EAgBW,cAAA,eAAA,mBAAc,QAAA;EAcH,cAAA,eAAA,eAAA,mBAAc,QAAA;EAerB,kBAAA,eAAA,mBAAc,QAAA;EAc1C,uBAAA,uBAAM,eACP,mBAAc,QAAA"}
@@ -1,6 +1,7 @@
1
1
  import { FetcherOptions } from "../fetcher.js";
2
+ import { CMSEndpoint } from "../cms/createIntlayerCMS.js";
3
+ import "../index.js";
2
4
  import { IntlayerConfig } from "@intlayer/types/config";
3
-
4
5
  //#region src/getIntlayerAPI/asset.d.ts
5
6
  declare const getAssetAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => {
6
7
  getAssets: (page?: number, pageSize?: number, otherOptions?: FetcherOptions) => Promise<GetAssetsResult>;
@@ -13,6 +14,23 @@ declare const getAssetAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: In
13
14
  }, otherOptions?: FetcherOptions) => Promise<UpdateAssetResult>;
14
15
  deleteAsset: (assetId: string, otherOptions?: FetcherOptions) => Promise<DeleteAssetResult>;
15
16
  };
17
+ /**
18
+ * Authenticated `asset` endpoint bound to an Intlayer CMS authenticator.
19
+ *
20
+ * Pass an authenticator created with `createIntlayerCMS`, or omit it to use
21
+ * the build-time configuration (`@intlayer/config/built`).
22
+ */
23
+ declare const assetEndpoint: CMSEndpoint<{
24
+ getAssets: (page?: number, pageSize?: number, otherOptions?: FetcherOptions) => Promise<GetAssetsResult>;
25
+ getAssetById: (assetId: string, otherOptions?: FetcherOptions) => Promise<GetAssetByIdResult>;
26
+ uploadAsset: (file: File, alt?: string, caption?: string, otherOptions?: FetcherOptions) => Promise<UploadAssetResult>;
27
+ updateAsset: (assetId: string, data: {
28
+ originalName?: string;
29
+ alt?: string;
30
+ caption?: string;
31
+ }, otherOptions?: FetcherOptions) => Promise<UpdateAssetResult>;
32
+ deleteAsset: (assetId: string, otherOptions?: FetcherOptions) => Promise<DeleteAssetResult>;
33
+ }>;
16
34
  //#endregion
17
- export { getAssetAPI };
35
+ export { assetEndpoint, getAssetAPI };
18
36
  //# sourceMappingURL=asset.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"asset.d.ts","names":[],"sources":["../../../src/getIntlayerAPI/asset.ts"],"mappings":";;;;cAWa,WAAA,GACX,cAAA,GAAgB,cAAA,EAChB,cAAA,GAAiB,cAAA;6BAaF,QAAA,WACI,YAAA,GACH,cAAA,KAAc,OAAA,CAAA,eAAA;kCAqBb,YAAA,GACD,cAAA,KAAc,OAAA,CAAA,kBAAA;sBAiBtB,IAAA,EAAI,GAAA,WACE,OAAA,WACI,YAAA,GACF,cAAA,KAAc,OAAA,CAAA,iBAAA;iCAsCb,IAAA;IACP,YAAA;IAAuB,GAAA;IAAc,OAAA;EAAA,GAAkB,YAAA,GACjD,cAAA,KAAc,OAAA,CAAA,iBAAA;iCAeb,YAAA,GACD,cAAA,KAAc,OAAA,CAAA,iBAAA;AAAA"}
1
+ {"version":3,"file":"asset.d.ts","names":[],"sources":["../../../src/getIntlayerAPI/asset.ts"],"mappings":";;;;;cAYa,cAAW,iBACN,gBAAc,iBACb;EAaR,YAAA,eAAM,mBACI,eACH,mBAAc,QAAA;EAqBnB,eAAA,iBAAM,eACD,mBAAc,QAAA;EAiBtB,cAAA,MAAA,MAAI,cACE,kBACI,eACF,mBAAc,QAAA;EAsCnB,cAAA,iBAAM;IACP;IAAuB;IAAc;KAAkB,eACjD,mBAAc,QAAA;EAenB,cAAA,iBAAM,eACD,mBAAc,QAAA;;;;;;;;cAwBnB,eAxBmB;EApGrB,YAAA,eAAM,mBACI,eACH,mBAAc,QAAA;EAqBnB,eAAA,iBAAM,eACD,mBAAc,QAAA;EAiBtB,cAAA,MAAA,MAAI,cACE,kBACI,eACF,mBAAc,QAAA;EAsCnB,cAAA,iBAAM;IACP;IAAuB;IAAc;KAAkB,eACjD,mBAAc,QAAA;EAenB,cAAA,iBAAM,eACD,mBAAc,QAAA"}
@@ -1,7 +1,8 @@
1
1
  import { FetcherOptions } from "../fetcher.js";
2
- import { AuditEvent, GetRecursiveAuditStatusResult, StartRecursiveAuditResult } from "@intlayer/backend";
2
+ import { CMSEndpoint } from "../cms/createIntlayerCMS.js";
3
+ import "../index.js";
3
4
  import { IntlayerConfig } from "@intlayer/types/config";
4
-
5
+ import { AuditEvent, GetRecursiveAuditStatusResult, StartRecursiveAuditResult } from "@intlayer/backend";
5
6
  //#region src/getIntlayerAPI/audit.d.ts
6
7
  type ScanUrlBody = {
7
8
  url: string;
@@ -39,6 +40,27 @@ declare const getAuditAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: In
39
40
  success: boolean;
40
41
  }>;
41
42
  };
43
+ /**
44
+ * Authenticated `audit` endpoint bound to an Intlayer CMS authenticator.
45
+ *
46
+ * Pass an authenticator created with `createIntlayerCMS`, or omit it to use
47
+ * the build-time configuration (`@intlayer/config/built`).
48
+ */
49
+ declare const auditEndpoint: CMSEndpoint<{
50
+ discoverUrls: (params?: DiscoverUrlsParams, otherOptions?: FetcherOptions) => Promise<DiscoverUrlsResult>;
51
+ scanUrl: (body?: ScanUrlBody, otherOptions?: FetcherOptions) => Promise<void>;
52
+ startRecursiveAudit: (body?: StartRecursiveAuditBody, otherOptions?: FetcherOptions) => Promise<StartRecursiveAuditResult>;
53
+ getRecursiveAuditStatus: (params?: GetRecursiveAuditStatusParams, otherOptions?: FetcherOptions) => Promise<GetRecursiveAuditStatusResult>;
54
+ cancelRecursiveAudit: (params?: RecursiveAuditJobParams, otherOptions?: FetcherOptions) => Promise<{
55
+ success: boolean;
56
+ }>;
57
+ pauseRecursiveAudit: (params?: RecursiveAuditJobParams, otherOptions?: FetcherOptions) => Promise<{
58
+ success: boolean;
59
+ }>;
60
+ resumeRecursiveAudit: (params?: RecursiveAuditJobParams, otherOptions?: FetcherOptions) => Promise<{
61
+ success: boolean;
62
+ }>;
63
+ }>;
42
64
  //#endregion
43
- export { type AuditEvent, DiscoverUrlsParams, DiscoverUrlsResult, GetRecursiveAuditStatusParams, type GetRecursiveAuditStatusResult, RecursiveAuditJobParams, ScanUrlBody, StartRecursiveAuditBody, type StartRecursiveAuditResult, getAuditAPI };
65
+ export { type AuditEvent, DiscoverUrlsParams, DiscoverUrlsResult, GetRecursiveAuditStatusParams, type GetRecursiveAuditStatusResult, RecursiveAuditJobParams, ScanUrlBody, StartRecursiveAuditBody, type StartRecursiveAuditResult, auditEndpoint, getAuditAPI };
44
66
  //# sourceMappingURL=audit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"audit.d.ts","names":[],"sources":["../../../src/getIntlayerAPI/audit.ts"],"mappings":";;;;;KAeY,WAAA;EACV,GAAA;EACA,SAAA,IAAa,KAAA,EAAO,UAAA;EACpB,MAAA;AAAA;AAAA,KAGU,kBAAA;EACV,GAAA;AAAA;AAAA,KAGU,kBAAA;EACV,IAAA;AAAA;AAAA,KAGU,uBAAA;EACV,GAAA;EACA,IAAA;AAAA;AAAA,KAGU,6BAAA;EACV,KAAA;AAAA;AAAA,KAGU,uBAAA;EACV,KAAA;AAAA;AAAA,cAGW,WAAA,GACX,cAAA,GAAgB,cAAA,EAChB,cAAA,GAAiB,cAAA;0BAmBN,kBA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AAc;IAEH;;EAQhB,uBAAA,SAAA,yBAAuB,eAClB,mBAAc;IAEH"}
@@ -1,6 +1,7 @@
1
1
  import { FetcherOptions } from "../fetcher.js";
2
+ import { CMSEndpoint } from "../cms/createIntlayerCMS.js";
3
+ import "../index.js";
2
4
  import { IntlayerConfig } from "@intlayer/types/config";
3
-
4
5
  //#region src/getIntlayerAPI/bitbucket.d.ts
5
6
  type BitbucketRepository = {
6
7
  uuid: string;
@@ -76,6 +77,19 @@ declare const getBitbucketAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?
76
77
  checkIntlayerConfig: (token: string | null | undefined, workspace: string, repoSlug: string, branch?: string, otherOptions?: FetcherOptions) => Promise<BitbucketCheckConfigResult>;
77
78
  getConfigFile: (token: string | null | undefined, workspace: string, repoSlug: string, branch?: string, path?: string, otherOptions?: FetcherOptions) => Promise<BitbucketGetConfigFileResult>;
78
79
  };
80
+ /**
81
+ * Authenticated `bitbucket` endpoint bound to an Intlayer CMS authenticator.
82
+ *
83
+ * Pass an authenticator created with `createIntlayerCMS`, or omit it to use
84
+ * the build-time configuration (`@intlayer/config/built`).
85
+ */
86
+ declare const bitbucketEndpoint: CMSEndpoint<{
87
+ getAuthUrl: (redirectUri: string, otherOptions?: FetcherOptions) => Promise<BitbucketGetAuthUrlResult>;
88
+ authenticate: (code: string, otherOptions?: FetcherOptions) => Promise<BitbucketAuthCallbackResult>;
89
+ getRepositories: (token?: string | null, otherOptions?: FetcherOptions) => Promise<BitbucketListReposResult>;
90
+ checkIntlayerConfig: (token: string | null | undefined, workspace: string, repoSlug: string, branch?: string, otherOptions?: FetcherOptions) => Promise<BitbucketCheckConfigResult>;
91
+ getConfigFile: (token: string | null | undefined, workspace: string, repoSlug: string, branch?: string, path?: string, otherOptions?: FetcherOptions) => Promise<BitbucketGetConfigFileResult>;
92
+ }>;
79
93
  //#endregion
80
- export { BitbucketAuthCallbackBody, BitbucketAuthCallbackResult, BitbucketCheckConfigBody, BitbucketCheckConfigResult, BitbucketGetAuthUrlResult, BitbucketGetConfigFileBody, BitbucketGetConfigFileResult, BitbucketListReposResult, BitbucketRepository, getBitbucketAPI };
94
+ export { BitbucketAuthCallbackBody, BitbucketAuthCallbackResult, BitbucketCheckConfigBody, BitbucketCheckConfigResult, BitbucketGetAuthUrlResult, BitbucketGetConfigFileBody, BitbucketGetConfigFileResult, BitbucketListReposResult, BitbucketRepository, bitbucketEndpoint, getBitbucketAPI };
81
95
  //# sourceMappingURL=bitbucket.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bitbucket.d.ts","names":[],"sources":["../../../src/getIntlayerAPI/bitbucket.ts"],"mappings":";;;;KAIY,mBAAA;EACV,IAAA;EACA,IAAA;EACA,SAAA;EACA,IAAA;EACA,UAAA;IACE,IAAA;IACA,IAAA;EAAA;EAEF,KAAA;IACE,IAAA;MACE,IAAA;IAAA;EAAA;EAGJ,SAAA;IACE,IAAA;IACA,IAAA;IACA,IAAA;EAAA;EAEF,KAAA;IACE,YAAA;IACA,QAAA;IACA,IAAA;EAAA;EAEF,UAAA;EACA,UAAA;AAAA;AAAA,KAGU,yBAAA;EACV,IAAA;AAAA;AAAA,KAGU,2BAAA;EACV,IAAA;IACE,KAAA;EAAA;AAAA;AAAA,KAIQ,wBAAA;EACV,IAAA,EAAM,mBAAA;AAAA;AAAA,KAGI,wBAAA;EACV,KAAA;EACA,SAAA;EACA,QAAA;EACA,MAAA;AAAA;AAAA,KAGU,0BAAA;EACV,IAAA;IACE,SAAA;IACA,WAAA;EAAA;AAAA;AAAA,KAIQ,0BAAA;EACV,KAAA;EACA,SAAA;EACA,QAAA;EACA,MAAA;EACA,IAAA;AAAA;AAAA,KAGU,4BAAA;EACV,IAAA;IACE,OAAA;EAAA;AAAA;AAAA,KAIQ,yBAAA;EACV,IAAA;IACE,OAAA;EAAA;AAAA;AAAA,cAIS,eAAA,GACX,cAAA,GAAgB,cAAA,EAChB,cAAA,GAAiB,cAAA;oCAWI,YAAA,GACL,cAAA,KAAc,OAAA,CAAA,yBAAA;+BAgBhB,YAAA,GACE,cAAA,KAAc,OAAA,CAAA,2BAAA;2CAiBP,YAAA,GACP,cAAA,KAAc,OAAA,CAAA,wBAAA;0DAmBI,SAAA,UACf,QAAA,UACD,MAAA,WACF,YAAA,GACA,cAAA,KAAc,OAAA,CAAA,0BAAA;oDAqBI,SAAA,UACf,QAAA,UACD,MAAA,WACF,IAAA,WACF,YAAA,GACE,cAAA,KAAc,OAAA,CAAA,4BAAA;AAAA"}
1
+ {"version":3,"file":"bitbucket.d.ts","names":[],"sources":["../../../src/getIntlayerAPI/bitbucket.ts"],"mappings":";;;;;KAKY;EACV;EACA;EACA;EACA;EACA;IACE;IACA;;EAEF;IACE;MACE;;;EAGJ;IACE;IACA;IACA;;EAEF;IACE;IACA;IACA;;EAEF;EACA;;KAGU;EACV;;KAGU;EACV;IACE;;;KAIQ;EACV,MAAM;;KAGI;EACV;EACA;EACA;EACA;;KAGU;EACV;IACE;IACA;;;KAIQ;EACV;EACA;EACA;EACA;EACA;;KAGU;EACV;IACE;;;KAIQ;EACV;IACE;;;cAIS,kBAAe,iBACV,gBAAc,iBACb;EAWF,aAAA,qBAAM,eACL,mBAAc,QAAA;EAgBtB,eAAA,cAAM,eACE,mBAAc,QAAA;EAiBpB,kBAAA,uBAAa,eACP,mBAAc,QAAA;EAmBrB,sBAAA,kCAAyB,mBACf,kBACD,iBACF,eACA,mBAAc,QAAA;EAqBrB,gBAAA,kCAAyB,mBACf,kBACD,iBACF,eACF,eACE,mBAAc,QAAA;;;;;;;;cAiCnB,mBAjCmB;EArFf,aAAA,qBAAM,eACL,mBAAc,QAAA;EAgBtB,eAAA,cAAM,eACE,mBAAc,QAAA;EAiBpB,kBAAA,uBAAa,eACP,mBAAc,QAAA;EAmBrB,sBAAA,kCAAyB,mBACf,kBACD,iBACF,eACA,mBAAc,QAAA;EAqBrB,gBAAA,kCAAyB,mBACf,kBACD,iBACF,eACF,eACE,mBAAc,QAAA"}
@@ -1,18 +1,35 @@
1
1
  import { FetcherOptions } from "../fetcher.js";
2
- import { AddDictionaryBody, DeleteDictionaryParam, GetDictionariesParams, GetDictionaryParams, GetDictionaryQuery, PushDictionariesBody, UpdateDictionaryBody } from "@intlayer/backend";
2
+ import { CMSEndpoint } from "../cms/createIntlayerCMS.js";
3
+ import "../index.js";
3
4
  import { IntlayerConfig } from "@intlayer/types/config";
4
-
5
+ import { AddDictionaryBody, DeleteDictionaryParam, GetDictionariesParams, GetDictionaryParams, GetDictionaryQuery, PushDictionariesBody, UpdateDictionaryBody } from "@intlayer/backend";
5
6
  //#region src/getIntlayerAPI/dictionary.d.ts
6
7
  declare const getDictionaryAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => {
7
8
  getDictionaries: (filters?: GetDictionariesParams, otherOptions?: FetcherOptions) => Promise<GetDictionariesResult>;
8
9
  getDictionariesKeys: (otherOptions?: FetcherOptions) => Promise<GetDictionariesKeysResult>;
9
10
  getDictionariesUpdateTimestamp: (otherOptions?: FetcherOptions) => Promise<GetDictionariesUpdateTimestampResult>;
10
- getDictionary: (dictionaryKey: GetDictionaryParams["dictionaryKey"], version?: GetDictionaryQuery["version"], otherOptions?: FetcherOptions) => Promise<GetDictionaryResult>;
11
- pushDictionaries: (dictionaries: PushDictionariesBody["dictionaries"], otherOptions?: FetcherOptions) => Promise<PushDictionariesResult>;
11
+ getDictionary: (dictionaryKey: GetDictionaryParams['dictionaryKey'], version?: GetDictionaryQuery['version'], otherOptions?: FetcherOptions) => Promise<GetDictionaryResult>;
12
+ pushDictionaries: (dictionaries: PushDictionariesBody['dictionaries'], otherOptions?: FetcherOptions) => Promise<PushDictionariesResult>;
12
13
  addDictionary: (body: AddDictionaryBody, otherOptions?: FetcherOptions) => Promise<AddDictionaryResult>;
13
14
  updateDictionary: (dictionary: UpdateDictionaryBody, otherOptions?: FetcherOptions) => Promise<UpdateDictionaryResult>;
14
- deleteDictionary: (id: DeleteDictionaryParam["dictionaryId"], otherOptions?: FetcherOptions) => Promise<DeleteDictionaryResult>;
15
+ deleteDictionary: (id: DeleteDictionaryParam['dictionaryId'], otherOptions?: FetcherOptions) => Promise<DeleteDictionaryResult>;
15
16
  };
17
+ /**
18
+ * Authenticated `dictionary` endpoint bound to an Intlayer CMS authenticator.
19
+ *
20
+ * Pass an authenticator created with `createIntlayerCMS`, or omit it to use
21
+ * the build-time configuration (`@intlayer/config/built`).
22
+ */
23
+ declare const dictionaryEndpoint: CMSEndpoint<{
24
+ getDictionaries: (filters?: GetDictionariesParams, otherOptions?: FetcherOptions) => Promise<GetDictionariesResult>;
25
+ getDictionariesKeys: (otherOptions?: FetcherOptions) => Promise<GetDictionariesKeysResult>;
26
+ getDictionariesUpdateTimestamp: (otherOptions?: FetcherOptions) => Promise<GetDictionariesUpdateTimestampResult>;
27
+ getDictionary: (dictionaryKey: GetDictionaryParams['dictionaryKey'], version?: GetDictionaryQuery['version'], otherOptions?: FetcherOptions) => Promise<GetDictionaryResult>;
28
+ pushDictionaries: (dictionaries: PushDictionariesBody['dictionaries'], otherOptions?: FetcherOptions) => Promise<PushDictionariesResult>;
29
+ addDictionary: (body: AddDictionaryBody, otherOptions?: FetcherOptions) => Promise<AddDictionaryResult>;
30
+ updateDictionary: (dictionary: UpdateDictionaryBody, otherOptions?: FetcherOptions) => Promise<UpdateDictionaryResult>;
31
+ deleteDictionary: (id: DeleteDictionaryParam['dictionaryId'], otherOptions?: FetcherOptions) => Promise<DeleteDictionaryResult>;
32
+ }>;
16
33
  //#endregion
17
- export { getDictionaryAPI };
34
+ export { dictionaryEndpoint, getDictionaryAPI };
18
35
  //# sourceMappingURL=dictionary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dictionary.d.ts","names":[],"sources":["../../../src/getIntlayerAPI/dictionary.ts"],"mappings":";;;;;cAqBa,gBAAA,GACX,cAAA,GAAgB,cAAA,EAChB,cAAA,GAAiB,cAAA;8BAWL,qBAAA,EAAqB,YAAA,GACjB,cAAA,KAAc,OAAA,CA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