@intlayer/api 8.2.3 → 8.3.0-canary.0
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.
- package/dist/cjs/distantDictionary/fetchDistantDictionaries.cjs.map +1 -1
- package/dist/cjs/distantDictionary/fetchDistantDictionary.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/ai.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/audit.cjs +2 -2
- package/dist/cjs/getIntlayerAPI/audit.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/bitbucket.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/dictionary.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/editor.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/github.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/gitlab.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/index.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/newsletter.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/oAuth.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/organization.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/project.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/search.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/showcaseProject.cjs +1 -1
- package/dist/cjs/getIntlayerAPI/showcaseProject.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/stripe.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/tag.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/user.cjs.map +1 -1
- package/dist/cjs/proxy.cjs.map +1 -1
- package/dist/esm/distantDictionary/fetchDistantDictionaries.mjs.map +1 -1
- package/dist/esm/distantDictionary/fetchDistantDictionary.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/ai.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/audit.mjs +2 -2
- package/dist/esm/getIntlayerAPI/audit.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/bitbucket.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/dictionary.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/editor.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/github.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/gitlab.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/index.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/newsletter.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/oAuth.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/organization.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/project.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/search.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/showcaseProject.mjs +1 -1
- package/dist/esm/getIntlayerAPI/showcaseProject.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/stripe.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/tag.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/user.mjs.map +1 -1
- package/dist/esm/proxy.mjs.map +1 -1
- package/dist/types/@intlayer/unmerged-dictionaries-entry/dist/types/index.d.ts +3 -1
- package/dist/types/@intlayer/unmerged-dictionaries-entry/dist/types/index.d.ts.map +1 -1
- package/dist/types/distantDictionary/fetchDistantDictionaries.d.ts +1 -1
- package/dist/types/distantDictionary/fetchDistantDictionary.d.ts +1 -1
- package/dist/types/getIntlayerAPI/ai.d.ts +1 -1
- package/dist/types/getIntlayerAPI/audit.d.ts +22 -2
- package/dist/types/getIntlayerAPI/audit.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/bitbucket.d.ts +1 -1
- package/dist/types/getIntlayerAPI/dictionary.d.ts +1 -1
- package/dist/types/getIntlayerAPI/editor.d.ts +1 -1
- package/dist/types/getIntlayerAPI/github.d.ts +1 -1
- package/dist/types/getIntlayerAPI/gitlab.d.ts +1 -1
- package/dist/types/getIntlayerAPI/index.d.ts +1 -1
- package/dist/types/getIntlayerAPI/newsletter.d.ts +1 -1
- package/dist/types/getIntlayerAPI/oAuth.d.ts +1 -1
- package/dist/types/getIntlayerAPI/organization.d.ts +1 -1
- package/dist/types/getIntlayerAPI/project.d.ts +1 -1
- package/dist/types/getIntlayerAPI/search.d.ts +1 -1
- package/dist/types/getIntlayerAPI/showcaseProject.d.ts +15 -10
- package/dist/types/getIntlayerAPI/showcaseProject.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/stripe.d.ts +1 -1
- package/dist/types/getIntlayerAPI/tag.d.ts +1 -1
- package/dist/types/getIntlayerAPI/user.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/intlayer-editor/server/dist/controllers/configuration.controller.d.ts +1 -1
- package/dist/types/intlayer-editor/server/dist/controllers/dictionary.controller.d.ts +1 -1
- package/dist/types/intlayer-editor/server/dist/controllers/dictionary.controller.d.ts.map +1 -1
- package/dist/types/proxy.d.ts +1 -1
- package/package.json +14 -14
- package/dist/types/apps/backend/dist/types/controllers/ai.controller.d.ts +0 -87
- package/dist/types/apps/backend/dist/types/controllers/ai.controller.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/controllers/dictionary.controller.d.ts +0 -81
- package/dist/types/apps/backend/dist/types/controllers/dictionary.controller.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/controllers/eventListener.controller.d.ts +0 -1
- package/dist/types/apps/backend/dist/types/controllers/github.controller.d.ts +0 -1
- package/dist/types/apps/backend/dist/types/controllers/newsletter.controller.d.ts +0 -26
- package/dist/types/apps/backend/dist/types/controllers/newsletter.controller.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/controllers/oAuth2.controller.d.ts +0 -8
- package/dist/types/apps/backend/dist/types/controllers/oAuth2.controller.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/controllers/organization.controller.d.ts +0 -64
- package/dist/types/apps/backend/dist/types/controllers/organization.controller.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/controllers/project.controller.d.ts +0 -75
- package/dist/types/apps/backend/dist/types/controllers/project.controller.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/controllers/projectAccessKey.controller.d.ts +0 -27
- package/dist/types/apps/backend/dist/types/controllers/projectAccessKey.controller.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/controllers/recursiveAudit.controller.d.ts +0 -30
- package/dist/types/apps/backend/dist/types/controllers/recursiveAudit.controller.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/controllers/search.controller.d.ts +0 -20
- package/dist/types/apps/backend/dist/types/controllers/search.controller.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/controllers/stripe.controller.d.ts +0 -31
- package/dist/types/apps/backend/dist/types/controllers/stripe.controller.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/controllers/tag.controller.d.ts +0 -35
- package/dist/types/apps/backend/dist/types/controllers/tag.controller.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/controllers/translation.controller.d.ts +0 -1
- package/dist/types/apps/backend/dist/types/controllers/user.controller.d.ts +0 -36
- package/dist/types/apps/backend/dist/types/controllers/user.controller.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/export.d.ts +0 -25
- package/dist/types/apps/backend/dist/types/middlewares/sessionAuth.middleware.d.ts +0 -12
- package/dist/types/apps/backend/dist/types/middlewares/sessionAuth.middleware.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/services/audit/types.d.ts +0 -34
- package/dist/types/apps/backend/dist/types/services/audit/types.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/services/ci.service.d.ts +0 -1
- package/dist/types/apps/backend/dist/types/services/github.service.d.ts +0 -1
- package/dist/types/apps/backend/dist/types/services/subscription.service.d.ts +0 -11
- package/dist/types/apps/backend/dist/types/services/subscription.service.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/types/dictionary.types.d.ts +0 -47
- package/dist/types/apps/backend/dist/types/types/dictionary.types.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/types/discussion.types.d.ts +0 -28
- package/dist/types/apps/backend/dist/types/types/discussion.types.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/types/oAuth2.types.d.ts +0 -16
- package/dist/types/apps/backend/dist/types/types/oAuth2.types.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/types/organization.types.d.ts +0 -33
- package/dist/types/apps/backend/dist/types/types/organization.types.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/types/plan.types.d.ts +0 -23
- package/dist/types/apps/backend/dist/types/types/plan.types.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/types/project.types.d.ts +0 -91
- package/dist/types/apps/backend/dist/types/types/project.types.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/types/session.types.d.ts +0 -28
- package/dist/types/apps/backend/dist/types/types/session.types.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/types/tag.types.d.ts +0 -31
- package/dist/types/apps/backend/dist/types/types/tag.types.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/types/user.types.d.ts +0 -28
- package/dist/types/apps/backend/dist/types/types/user.types.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/utils/AI/askDocQuestion/askDocQuestion.d.ts +0 -8
- package/dist/types/apps/backend/dist/types/utils/AI/askDocQuestion/askDocQuestion.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/utils/AI/auditDictionary/index.d.ts +0 -14
- package/dist/types/apps/backend/dist/types/utils/AI/auditDictionary/index.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/utils/AI/auditDictionaryField/index.d.ts +0 -10
- package/dist/types/apps/backend/dist/types/utils/AI/auditDictionaryField/index.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/utils/AI/auditDictionaryMetadata/index.d.ts +0 -1
- package/dist/types/apps/backend/dist/types/utils/AI/auditTag/index.d.ts +0 -8
- package/dist/types/apps/backend/dist/types/utils/AI/auditTag/index.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/utils/AI/customQuery/index.d.ts +0 -11
- package/dist/types/apps/backend/dist/types/utils/AI/customQuery/index.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/utils/AI/translateJSON/index.d.ts +0 -21
- package/dist/types/apps/backend/dist/types/utils/AI/translateJSON/index.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/utils/auth/getAuth.d.ts +0 -1
- package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getDictionaryFiltersAndPagination.d.ts +0 -31
- package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getDictionaryFiltersAndPagination.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getDiscussionFiltersAndPagination.d.ts +0 -19
- package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getDiscussionFiltersAndPagination.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getFiltersAndPaginationFromBody.d.ts +0 -12
- package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getFiltersAndPaginationFromBody.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getOrganizationFiltersAndPagination.d.ts +0 -25
- package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getOrganizationFiltersAndPagination.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getProjectFiltersAndPagination.d.ts +0 -18
- package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getProjectFiltersAndPagination.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getTagFiltersAndPagination.d.ts +0 -16
- package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getTagFiltersAndPagination.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getUserFiltersAndPagination.d.ts +0 -20
- package/dist/types/apps/backend/dist/types/utils/filtersAndPagination/getUserFiltersAndPagination.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/utils/httpStatusCodes.d.ts +0 -408
- package/dist/types/apps/backend/dist/types/utils/httpStatusCodes.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/utils/permissions.d.ts +0 -37
- package/dist/types/apps/backend/dist/types/utils/permissions.d.ts.map +0 -1
- package/dist/types/apps/backend/dist/types/utils/responseData.d.ts +0 -27
- package/dist/types/apps/backend/dist/types/utils/responseData.d.ts.map +0 -1
- package/dist/types/packages/@intlayer/ai/dist/types/aiSdk.d.ts +0 -110
- package/dist/types/packages/@intlayer/ai/dist/types/aiSdk.d.ts.map +0 -1
- package/dist/types/packages/@intlayer/ai/dist/types/auditDictionaryMetadata/index.d.ts +0 -12
- package/dist/types/packages/@intlayer/ai/dist/types/auditDictionaryMetadata/index.d.ts.map +0 -1
- package/dist/types/packages/@intlayer/ai/dist/types/customQuery.d.ts +0 -8
- package/dist/types/packages/@intlayer/ai/dist/types/customQuery.d.ts.map +0 -1
- package/dist/types/packages/@intlayer/ai/dist/types/index.d.ts +0 -27
- package/dist/types/packages/@intlayer/ai/dist/types/index.d.ts.map +0 -1
- package/dist/types/packages/@intlayer/ai/dist/types/translateJSON/index.d.ts +0 -10
- package/dist/types/packages/@intlayer/ai/dist/types/translateJSON/index.d.ts.map +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/build.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/cleanOutputDir.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/createType/createModuleAugmentation.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/createType/createType.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/formatDictionary.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/loadDictionaries/loadContentDeclaration.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/loadDictionaries/loadDictionaries.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/loadDictionaries/loadLocalDictionaries.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/prepareIntlayer.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/writeConfiguration/index.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/writeContentDeclaration/dictionaryStatus.d.ts +0 -6
- package/dist/types/packages/@intlayer/chokidar/dist/types/writeContentDeclaration/dictionaryStatus.d.ts.map +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/writeContentDeclaration/transformJSFile.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts +0 -1
- package/dist/types/packages/@intlayer/chokidar/dist/types/writeContentDeclaration/writeJSFile.d.ts +0 -1
- package/dist/types/packages/@intlayer/core/dist/types/messageFormat/ICU.d.ts +0 -1
- package/dist/types/packages/@intlayer/core/dist/types/messageFormat/i18next.d.ts +0 -1
- package/dist/types/packages/@intlayer/core/dist/types/messageFormat/index.d.ts +0 -1
- package/dist/types/packages/@intlayer/core/dist/types/messageFormat/vue-i18n.d.ts +0 -1
- package/dist/types/packages/@intlayer/unmerged-dictionaries-entry/dist/types/index.d.ts +0 -8
- package/dist/types/packages/@intlayer/unmerged-dictionaries-entry/dist/types/index.d.ts.map +0 -1
- package/dist/types/packages/intlayer-editor/server/dist/controllers/configuration.controller.d.ts +0 -12
- package/dist/types/packages/intlayer-editor/server/dist/controllers/configuration.controller.d.ts.map +0 -1
- package/dist/types/packages/intlayer-editor/server/dist/controllers/dictionary.controller.d.ts +0 -25
- package/dist/types/packages/intlayer-editor/server/dist/controllers/dictionary.controller.d.ts.map +0 -1
- package/dist/types/packages/intlayer-editor/server/dist/export.d.ts +0 -2
- package/dist/types/packages/intlayer-editor/server/dist/utils/httpStatusCodes.d.ts +0 -408
- package/dist/types/packages/intlayer-editor/server/dist/utils/httpStatusCodes.d.ts.map +0 -1
- package/dist/types/packages/intlayer-editor/server/dist/utils/responseData.d.ts +0 -20
- package/dist/types/packages/intlayer-editor/server/dist/utils/responseData.d.ts.map +0 -1
package/dist/esm/proxy.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy.mjs","names":[],"sources":["../../src/proxy.ts"],"sourcesContent":["import type { IntlayerConfig } from '@intlayer/types';\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 * The returned API matches the shape of getIntlayerAPI.\n */\nexport const getIntlayerAPIProxy = (\n baseAuthOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n): IntlayerAPI => {\n // Use a shared mutable auth options object captured by the API closures\n const authOptionsRef: FetcherOptions = { ...baseAuthOptions };\n const hasCMSAuth =\n intlayerConfig?.editor?.clientId && intlayerConfig?.editor?.clientSecret;\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 await ensureValidToken();\n applyAuthHeaderToRef();\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) {\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 IntlayerAPI;\n};\n\nexport type IntlayerAPIProxy = ReturnType<typeof getIntlayerAPIProxy>;\n"],"mappings":"qHAcA,MAKM,EACJ,GACuB,CACvB,GAAI,CAAC,EAAO,OACZ,IAAM,EAAY,EAAM,sBAAwB,EAAM,UAItD,GAAI,EAAU,CACZ,IAAM,EACJ,OAAO,GAAa,SAChB,KAAK,MAAM,EAAS,CACpB,EAAS,WAAW,CAC1B,GAAI,OAAO,GAAO,UAAY,OAAO,SAAS,EAAG,CAAE,OAAO,EAE5D,IAAM,EAAU,EAAM,YAAc,EAAM,UAC1C,GAAI,OAAO,GAAY,UAAY,OAAO,SAAS,EAAQ,CACzD,OAAO,KAAK,KAAK,CAAG,EAAU,KAKlC,IAAI,EACA,EACA,EAUJ,MAAa,GACX,EAAkC,EAAE,CACpC,IACgB,CAEhB,IAAM,EAAiC,CAAE,GAAG,EAAiB,CACvD,EACJ,GAAgB,QAAQ,UAAY,GAAgB,QAAQ,aACxD,EAAU,EAAe,EAAgB,EAAe,CAExD,MACC,EACA,EAEE,KAAK,KAAK,CAAG,KAAiB,EAFR,GADG,GAM5B,EAAe,SAA2B,CAU9C,AACE,KAVgB,SAAY,CAG5B,IAAM,GADM,MADI,EAAY,EAAe,CACjB,sBAAsB,GACzB,KAEvB,EAAqB,GAAW,YAChC,EAAkB,EAAmB,EAAU,IAInB,CAAC,YAAc,CACzC,EAAiB,IAAA,IACjB,CAEJ,MAAM,GAGF,EAAmB,SAAY,CAC/B,GAAc,EAChB,MAAM,GAAc,EAIlB,MAA6B,CAC5B,IACL,EAAe,QAAU,CACvB,GAAI,EAAe,SAAW,EAAE,CAChC,cAAe,UAAU,IAC1B,GAGG,GACJ,EACA,EAAW,CAAC,IAEL,IAAI,MAAM,EAAS,CACxB,IAAI,EAAQ,EAAM,EAAU,CAC1B,IAAM,EAAQ,QAAQ,IAAI,EAAQ,EAAM,EAAS,CAwBjD,OAtBI,OAAO,GAAU,WAEZ,MAAO,GAAG,IAAoB,CAC9B,IACH,MAAM,GAAkB,CACxB,GAAsB,EAGxB,GAAI,CACF,OAAO,MAAM,EAAM,MAAM,EAAQ,EAAK,OAC/B,EAAK,CAEZ,GAAI,CAAC,EAGH,OAFA,MAAM,GAAc,CACpB,GAAsB,CACf,MAAM,EAAM,MAAM,EAAQ,EAAK,CAExC,MAAM,IAKL,GAEV,CAAC,CAGJ,MAAO,CACL,aAAc,EAAY,EAAQ,aAAa,CAC/C,QAAS,EAAY,EAAQ,QAAQ,CACrC,KAAM,EAAY,EAAQ,KAAK,CAC/B,MAAO,EAAY,EAAQ,MAAO,GAAK,CACvC,WAAY,EAAY,EAAQ,WAAW,CAC3C,OAAQ,EAAY,EAAQ,OAAO,CACnC,GAAI,EAAY,EAAQ,GAAG,CAC3B,IAAK,EAAY,EAAQ,IAAI,CAC7B,OAAQ,EAAY,EAAQ,OAAO,CACnC,OAAQ,EAAY,EAAQ,OAAO,CACnC,WAAY,EAAY,EAAQ,WAAW,CAC3C,OAAQ,EAAY,EAAQ,OAAO,CACpC"}
|
|
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 * The returned API matches the shape of getIntlayerAPI.\n */\nexport const getIntlayerAPIProxy = (\n baseAuthOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n): IntlayerAPI => {\n // Use a shared mutable auth options object captured by the API closures\n const authOptionsRef: FetcherOptions = { ...baseAuthOptions };\n const hasCMSAuth =\n intlayerConfig?.editor?.clientId && intlayerConfig?.editor?.clientSecret;\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 await ensureValidToken();\n applyAuthHeaderToRef();\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) {\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 IntlayerAPI;\n};\n\nexport type IntlayerAPIProxy = ReturnType<typeof getIntlayerAPIProxy>;\n"],"mappings":"qHAcA,MAKM,EACJ,GACuB,CACvB,GAAI,CAAC,EAAO,OACZ,IAAM,EAAY,EAAM,sBAAwB,EAAM,UAItD,GAAI,EAAU,CACZ,IAAM,EACJ,OAAO,GAAa,SAChB,KAAK,MAAM,EAAS,CACpB,EAAS,WAAW,CAC1B,GAAI,OAAO,GAAO,UAAY,OAAO,SAAS,EAAG,CAAE,OAAO,EAE5D,IAAM,EAAU,EAAM,YAAc,EAAM,UAC1C,GAAI,OAAO,GAAY,UAAY,OAAO,SAAS,EAAQ,CACzD,OAAO,KAAK,KAAK,CAAG,EAAU,KAKlC,IAAI,EACA,EACA,EAUJ,MAAa,GACX,EAAkC,EAAE,CACpC,IACgB,CAEhB,IAAM,EAAiC,CAAE,GAAG,EAAiB,CACvD,EACJ,GAAgB,QAAQ,UAAY,GAAgB,QAAQ,aACxD,EAAU,EAAe,EAAgB,EAAe,CAExD,MACC,EACA,EAEE,KAAK,KAAK,CAAG,KAAiB,EAFR,GADG,GAM5B,EAAe,SAA2B,CAU9C,AACE,KAVgB,SAAY,CAG5B,IAAM,GADM,MADI,EAAY,EAAe,CACjB,sBAAsB,GACzB,KAEvB,EAAqB,GAAW,YAChC,EAAkB,EAAmB,EAAU,IAInB,CAAC,YAAc,CACzC,EAAiB,IAAA,IACjB,CAEJ,MAAM,GAGF,EAAmB,SAAY,CAC/B,GAAc,EAChB,MAAM,GAAc,EAIlB,MAA6B,CAC5B,IACL,EAAe,QAAU,CACvB,GAAI,EAAe,SAAW,EAAE,CAChC,cAAe,UAAU,IAC1B,GAGG,GACJ,EACA,EAAW,CAAC,IAEL,IAAI,MAAM,EAAS,CACxB,IAAI,EAAQ,EAAM,EAAU,CAC1B,IAAM,EAAQ,QAAQ,IAAI,EAAQ,EAAM,EAAS,CAwBjD,OAtBI,OAAO,GAAU,WAEZ,MAAO,GAAG,IAAoB,CAC9B,IACH,MAAM,GAAkB,CACxB,GAAsB,EAGxB,GAAI,CACF,OAAO,MAAM,EAAM,MAAM,EAAQ,EAAK,OAC/B,EAAK,CAEZ,GAAI,CAAC,EAGH,OAFA,MAAM,GAAc,CACpB,GAAsB,CACf,MAAM,EAAM,MAAM,EAAQ,EAAK,CAExC,MAAM,IAKL,GAEV,CAAC,CAGJ,MAAO,CACL,aAAc,EAAY,EAAQ,aAAa,CAC/C,QAAS,EAAY,EAAQ,QAAQ,CACrC,KAAM,EAAY,EAAQ,KAAK,CAC/B,MAAO,EAAY,EAAQ,MAAO,GAAK,CACvC,WAAY,EAAY,EAAQ,WAAW,CAC3C,OAAQ,EAAY,EAAQ,OAAO,CACnC,GAAI,EAAY,EAAQ,GAAG,CAC3B,IAAK,EAAY,EAAQ,IAAI,CAC7B,OAAQ,EAAY,EAAQ,OAAO,CACnC,OAAQ,EAAY,EAAQ,OAAO,CACnC,WAAY,EAAY,EAAQ,WAAW,CAC3C,OAAQ,EAAY,EAAQ,OAAO,CACpC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IntlayerConfig } from "@intlayer/types/config";
|
|
2
|
+
import { Dictionary } from "@intlayer/types/dictionary";
|
|
3
|
+
import { DictionaryKeys } from "@intlayer/types/module_augmentation";
|
|
2
4
|
|
|
3
5
|
//#region ../unmerged-dictionaries-entry/dist/types/index.d.ts
|
|
4
6
|
//#region src/index.d.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["Dictionary","DictionaryKeys","IntlayerConfig","UnmergedDictionaries","Record","GetUnmergedDictionaries","configuration","getUnmergedDictionaries"],"sources":["../../../../../../../unmerged-dictionaries-entry/dist/types/index.d.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["Dictionary","DictionaryKeys","IntlayerConfig","UnmergedDictionaries","Record","GetUnmergedDictionaries","configuration","getUnmergedDictionaries"],"sources":["../../../../../../../unmerged-dictionaries-entry/dist/types/index.d.ts"],"mappings":";;;;;;KAKKG,oBAAAA,GAAuBC,MAAAA,CAAOH,cAAAA,EAAgBD,UAAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FetcherOptions } from "../fetcher.js";
|
|
2
2
|
import { AIOptions, AskDocQuestionResult, AuditContentDeclarationBody, AuditContentDeclarationFieldBody, AuditContentDeclarationMetadataBody, AuditTagBody, ChatCompletionRequestMessage, CustomQueryBody, GetDiscussionsParams, TranslateJSONBody } from "@intlayer/backend";
|
|
3
|
-
import { IntlayerConfig } from "@intlayer/types";
|
|
3
|
+
import { IntlayerConfig } from "@intlayer/types/config";
|
|
4
4
|
|
|
5
5
|
//#region src/getIntlayerAPI/ai.d.ts
|
|
6
6
|
type AutocompleteBody = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FetcherOptions } from "../fetcher.js";
|
|
2
2
|
import { AuditEvent, GetRecursiveAuditStatusResult, StartRecursiveAuditResult } from "@intlayer/backend";
|
|
3
|
-
import { IntlayerConfig } from "@intlayer/types";
|
|
3
|
+
import { IntlayerConfig } from "@intlayer/types/config";
|
|
4
4
|
|
|
5
5
|
//#region src/getIntlayerAPI/audit.d.ts
|
|
6
6
|
type ScanUrlBody = {
|
|
@@ -8,17 +8,37 @@ type ScanUrlBody = {
|
|
|
8
8
|
onMessage?: (event: AuditEvent) => void;
|
|
9
9
|
onDone?: () => void;
|
|
10
10
|
};
|
|
11
|
+
type DiscoverUrlsParams = {
|
|
12
|
+
url: string;
|
|
13
|
+
};
|
|
14
|
+
type DiscoverUrlsResult = {
|
|
15
|
+
urls: string[];
|
|
16
|
+
};
|
|
11
17
|
type StartRecursiveAuditBody = {
|
|
12
18
|
url: string;
|
|
19
|
+
urls?: string[];
|
|
13
20
|
};
|
|
14
21
|
type GetRecursiveAuditStatusParams = {
|
|
15
22
|
jobId: string;
|
|
16
23
|
};
|
|
24
|
+
type RecursiveAuditJobParams = {
|
|
25
|
+
jobId: string;
|
|
26
|
+
};
|
|
17
27
|
declare const getAuditAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => {
|
|
28
|
+
discoverUrls: (params?: DiscoverUrlsParams, otherOptions?: FetcherOptions) => Promise<DiscoverUrlsResult>;
|
|
18
29
|
scanUrl: (body?: ScanUrlBody, otherOptions?: FetcherOptions) => Promise<void>;
|
|
19
30
|
startRecursiveAudit: (body?: StartRecursiveAuditBody, otherOptions?: FetcherOptions) => Promise<StartRecursiveAuditResult>;
|
|
20
31
|
getRecursiveAuditStatus: (params?: GetRecursiveAuditStatusParams, otherOptions?: FetcherOptions) => Promise<GetRecursiveAuditStatusResult>;
|
|
32
|
+
cancelRecursiveAudit: (params?: RecursiveAuditJobParams, otherOptions?: FetcherOptions) => Promise<{
|
|
33
|
+
success: boolean;
|
|
34
|
+
}>;
|
|
35
|
+
pauseRecursiveAudit: (params?: RecursiveAuditJobParams, otherOptions?: FetcherOptions) => Promise<{
|
|
36
|
+
success: boolean;
|
|
37
|
+
}>;
|
|
38
|
+
resumeRecursiveAudit: (params?: RecursiveAuditJobParams, otherOptions?: FetcherOptions) => Promise<{
|
|
39
|
+
success: boolean;
|
|
40
|
+
}>;
|
|
21
41
|
};
|
|
22
42
|
//#endregion
|
|
23
|
-
export { type AuditEvent, GetRecursiveAuditStatusParams, type GetRecursiveAuditStatusResult, ScanUrlBody, StartRecursiveAuditBody, type StartRecursiveAuditResult, getAuditAPI };
|
|
43
|
+
export { type AuditEvent, DiscoverUrlsParams, DiscoverUrlsResult, GetRecursiveAuditStatusParams, type GetRecursiveAuditStatusResult, RecursiveAuditJobParams, ScanUrlBody, StartRecursiveAuditBody, type StartRecursiveAuditResult, getAuditAPI };
|
|
24
44
|
//# 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,uBAAA;EACV,GAAA;AAAA;AAAA,KAGU,6BAAA;EACV,KAAA;AAAA;AAAA,cAGW,WAAA,GACX,cAAA,GAAgB,cAAA,EAChB,cAAA,GAAiB,cAAA;
|
|
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;0BA0BN,kBAAA,EAAkB,YAAA,GACb,cAAA,KAAc,OAAA,CAAA,kBAAA;mBAarB,WAAA,EAAW,YAAA,GACJ,cAAA,KAAc,OAAA;+BAsErB,uBAAA,EAAuB,YAAA,GAChB,cAAA,KAAc,OAAA,CAAA,yBAAA;qCAiBnB,6BAAA,EAA6B,YAAA,GACxB,cAAA,KAAc,OAAA,CAAA,6BAAA;kCAYnB,uBAAA,EAAuB,YAAA,GAClB,cAAA,KAAc,OAAA;;;iCAUnB,uBAAA,EAAuB,YAAA,GAClB,cAAA,KAAc,OAAA;;;kCAUnB,uBAAA,EAAuB,YAAA,GAClB,cAAA,KAAc,OAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FetcherOptions } from "../fetcher.js";
|
|
2
2
|
import { AddDictionaryBody, DeleteDictionaryParam, GetDictionariesParams, GetDictionaryParams, GetDictionaryQuery, PushDictionariesBody, UpdateDictionaryBody } from "@intlayer/backend";
|
|
3
|
-
import { IntlayerConfig } from "@intlayer/types";
|
|
3
|
+
import { IntlayerConfig } from "@intlayer/types/config";
|
|
4
4
|
|
|
5
5
|
//#region src/getIntlayerAPI/dictionary.d.ts
|
|
6
6
|
declare const getDictionaryAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FetcherOptions } from "../fetcher.js";
|
|
2
2
|
import { GetConfigurationResult } from "../intlayer-editor/server/dist/controllers/configuration.controller.js";
|
|
3
3
|
import { GetEditorDictionariesResult, WriteContentDeclarationBody, WriteContentDeclarationResult } from "../intlayer-editor/server/dist/controllers/dictionary.controller.js";
|
|
4
|
-
import { IntlayerConfig } from "@intlayer/types";
|
|
4
|
+
import { IntlayerConfig } from "@intlayer/types/config";
|
|
5
5
|
|
|
6
6
|
//#region src/getIntlayerAPI/editor.d.ts
|
|
7
7
|
declare const getEditorAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => {
|
|
@@ -15,7 +15,7 @@ import { getShowcaseProjectAPI } from "./showcaseProject.js";
|
|
|
15
15
|
import { getStripeAPI } from "./stripe.js";
|
|
16
16
|
import { getTagAPI } from "./tag.js";
|
|
17
17
|
import { getUserAPI } from "./user.js";
|
|
18
|
-
import { IntlayerConfig } from "@intlayer/types";
|
|
18
|
+
import { IntlayerConfig } from "@intlayer/types/config";
|
|
19
19
|
|
|
20
20
|
//#region src/getIntlayerAPI/index.d.ts
|
|
21
21
|
interface IntlayerAPIReturn {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FetcherOptions } from "../fetcher.js";
|
|
2
2
|
import { NewsletterSubscriptionBody, NewsletterUnsubscriptionBody } from "@intlayer/backend";
|
|
3
|
-
import { IntlayerConfig } from "@intlayer/types";
|
|
3
|
+
import { IntlayerConfig } from "@intlayer/types/config";
|
|
4
4
|
|
|
5
5
|
//#region src/getIntlayerAPI/newsletter.d.ts
|
|
6
6
|
declare const getNewsletterAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FetcherOptions } from "../fetcher.js";
|
|
2
|
-
import { IntlayerConfig } from "@intlayer/types";
|
|
2
|
+
import { IntlayerConfig } from "@intlayer/types/config";
|
|
3
3
|
|
|
4
4
|
//#region src/getIntlayerAPI/oAuth.d.ts
|
|
5
5
|
declare const getOAuthAPI: (intlayerConfig?: IntlayerConfig) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FetcherOptions } from "../fetcher.js";
|
|
2
2
|
import { AddOrganizationBody, AddOrganizationMemberBody, GetOrganizationParam, GetOrganizationsParams, SelectOrganizationParam, UpdateOrganizationBody, UpdateOrganizationMembersBody } from "@intlayer/backend";
|
|
3
|
-
import { IntlayerConfig } from "@intlayer/types";
|
|
3
|
+
import { IntlayerConfig } from "@intlayer/types/config";
|
|
4
4
|
|
|
5
5
|
//#region src/getIntlayerAPI/organization.d.ts
|
|
6
6
|
declare const getOrganizationAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FetcherOptions } from "../fetcher.js";
|
|
2
2
|
import { AddNewAccessKeyBody, AddProjectBody, DeleteAccessKeyBody, GetProjectsParams, PushProjectConfigurationBody, RefreshAccessKeyBody, SelectProjectParam, TriggerWebhookBody, UpdateProjectBody, UpdateProjectMembersBody } from "@intlayer/backend";
|
|
3
|
-
import { IntlayerConfig } from "@intlayer/types";
|
|
3
|
+
import { IntlayerConfig } from "@intlayer/types/config";
|
|
4
4
|
|
|
5
5
|
//#region src/getIntlayerAPI/project.d.ts
|
|
6
6
|
declare const getProjectAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FetcherOptions } from "../fetcher.js";
|
|
2
2
|
import { SearchDocUtilParams } from "@intlayer/backend";
|
|
3
|
-
import { IntlayerConfig } from "@intlayer/types";
|
|
3
|
+
import { IntlayerConfig } from "@intlayer/types/config";
|
|
4
4
|
|
|
5
5
|
//#region src/getIntlayerAPI/search.d.ts
|
|
6
6
|
declare const getSearchAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FetcherOptions } from "../fetcher.js";
|
|
2
|
-
import {
|
|
2
|
+
import { GetShowcaseProjectByIdParams, SubmitShowcaseProjectBody, ToggleShowcaseDownvoteBody, ToggleShowcaseUpvoteBody, UpdateShowcaseProjectBody } from "@intlayer/backend";
|
|
3
|
+
import { IntlayerConfig } from "@intlayer/types/config";
|
|
3
4
|
|
|
4
5
|
//#region src/getIntlayerAPI/showcaseProject.d.ts
|
|
5
6
|
type ShowcaseProjectsQuery = {
|
|
@@ -9,20 +10,24 @@ type ShowcaseProjectsQuery = {
|
|
|
9
10
|
selectedUseCases?: string[];
|
|
10
11
|
isOpenSource?: boolean;
|
|
11
12
|
};
|
|
12
|
-
type
|
|
13
|
-
|
|
13
|
+
type OtherShowcaseProjectsQuery = {
|
|
14
|
+
excludeId: string;
|
|
15
|
+
limit?: number;
|
|
14
16
|
};
|
|
15
17
|
declare const getShowcaseProjectAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => {
|
|
16
|
-
getShowcaseProjects: (query?: ShowcaseProjectsQuery, otherOptions?: FetcherOptions) => Promise<
|
|
17
|
-
getShowcaseProjectById: (projectId:
|
|
18
|
-
getOtherShowcaseProjects: (
|
|
19
|
-
|
|
18
|
+
getShowcaseProjects: (query?: ShowcaseProjectsQuery, otherOptions?: FetcherOptions) => Promise<GetShowcaseProjectsResult>;
|
|
19
|
+
getShowcaseProjectById: (projectId: GetShowcaseProjectByIdParams["projectId"], otherOptions?: FetcherOptions) => Promise<GetShowcaseProjectByIdResult>;
|
|
20
|
+
getOtherShowcaseProjects: (query: OtherShowcaseProjectsQuery, otherOptions?: FetcherOptions) => Promise<GetOtherShowcaseProjectsResult>;
|
|
21
|
+
submitShowcaseProject: (body: SubmitShowcaseProjectBody, otherOptions?: FetcherOptions) => Promise<SubmitShowcaseProjectResult>;
|
|
22
|
+
toggleShowcaseUpvote: (body: ToggleShowcaseUpvoteBody, otherOptions?: FetcherOptions) => Promise<ToggleShowcaseUpvoteResult>;
|
|
23
|
+
toggleShowcaseDownvote: (body: ToggleShowcaseDownvoteBody, otherOptions?: FetcherOptions) => Promise<ToggleShowcaseDownvoteResult>;
|
|
24
|
+
deleteShowcaseProject: (projectId: GetShowcaseProjectByIdParams["projectId"], otherOptions?: FetcherOptions) => Promise<{
|
|
20
25
|
data: {
|
|
21
|
-
|
|
22
|
-
isLiked: boolean;
|
|
26
|
+
success: boolean;
|
|
23
27
|
};
|
|
24
28
|
}>;
|
|
29
|
+
updateShowcaseProject: (projectId: GetShowcaseProjectByIdParams["projectId"], body: UpdateShowcaseProjectBody, otherOptions?: FetcherOptions) => Promise<UpdateShowcaseProjectResult>;
|
|
25
30
|
};
|
|
26
31
|
//#endregion
|
|
27
|
-
export {
|
|
32
|
+
export { OtherShowcaseProjectsQuery, ShowcaseProjectsQuery, getShowcaseProjectAPI };
|
|
28
33
|
//# sourceMappingURL=showcaseProject.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"showcaseProject.d.ts","names":[],"sources":["../../../src/getIntlayerAPI/showcaseProject.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"showcaseProject.d.ts","names":[],"sources":["../../../src/getIntlayerAPI/showcaseProject.ts"],"mappings":";;;;;KAoBY,qBAAA;EACV,IAAA;EACA,QAAA;EACA,MAAA;EACA,gBAAA;EACA,YAAA;AAAA;AAAA,KAGU,0BAAA;EACV,SAAA;EACA,KAAA;AAAA;AAAA,cAGW,qBAAA,GACX,cAAA,GAAgB,cAAA,EAChB,cAAA,GAAiB,cAAA;gCAcP,qBAAA,EAAqB,YAAA,GACf,cAAA,KAAc,OAAA,CAAA,yBAAA;sCAoBjB,4BAAA,eAAyC,YAAA,GACtC,cAAA,KAAc,OAAA,CAAA,4BAAA;oCAUrB,0BAAA,EAA0B,YAAA,GACnB,cAAA,KAAc,OAAA,CAAA,8BAAA;gCAatB,yBAAA,EAAyB,YAAA,GACjB,cAAA,KAAc,OAAA,CAAA,2BAAA;+BAUtB,wBAAA,EAAwB,YAAA,GAChB,cAAA,KAAc,OAAA,CAAA,0BAAA;iCAUtB,0BAAA,EAA0B,YAAA,GAClB,cAAA,KAAc,OAAA,CAAA,4BAAA;qCAUjB,4BAAA,eAAyC,YAAA,GACtC,cAAA,KAAc,OAAA;;MAEJ,OAAA;IAAA;EAAA;qCAQb,4BAAA,eAAyC,IAAA,EAC9C,yBAAA,EAAyB,YAAA,GACjB,cAAA,KAAc,OAAA,CAAA,2BAAA;AAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FetcherOptions } from "../fetcher.js";
|
|
2
2
|
import { GetCheckoutSessionBody, GetPricingBody } from "@intlayer/backend";
|
|
3
|
-
import { IntlayerConfig } from "@intlayer/types";
|
|
3
|
+
import { IntlayerConfig } from "@intlayer/types/config";
|
|
4
4
|
|
|
5
5
|
//#region src/getIntlayerAPI/stripe.d.ts
|
|
6
6
|
declare const getStripeAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FetcherOptions } from "../fetcher.js";
|
|
2
2
|
import { AddTagBody, DeleteTagParams, GetTagsParams, UpdateTagBody, UpdateTagParams } from "@intlayer/backend";
|
|
3
|
-
import { IntlayerConfig } from "@intlayer/types";
|
|
3
|
+
import { IntlayerConfig } from "@intlayer/types/config";
|
|
4
4
|
|
|
5
5
|
//#region src/getIntlayerAPI/tag.d.ts
|
|
6
6
|
declare const getTagAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FetcherOptions } from "../fetcher.js";
|
|
2
2
|
import { CreateUserBody, GetUserByEmailParams, GetUserByIdParams, GetUsersParams, UpdateUserBody, UserAPI } from "@intlayer/backend";
|
|
3
|
-
import { IntlayerConfig } from "@intlayer/types";
|
|
3
|
+
import { IntlayerConfig } from "@intlayer/types/config";
|
|
4
4
|
|
|
5
5
|
//#region src/getIntlayerAPI/user.d.ts
|
|
6
6
|
type GetUserByAccountParams = {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { fetchDistantDictionaries } from "./distantDictionary/fetchDistantDictio
|
|
|
2
2
|
import { fetchDistantDictionary } from "./distantDictionary/fetchDistantDictionary.js";
|
|
3
3
|
import { FetcherOptions, fetcher, fetcherOptions } from "./fetcher.js";
|
|
4
4
|
import { AskDocQuestionBody, AskDocQuestionResult, AutocompleteBody, getAiAPI } from "./getIntlayerAPI/ai.js";
|
|
5
|
-
import { AuditEvent, GetRecursiveAuditStatusParams, GetRecursiveAuditStatusResult, ScanUrlBody, StartRecursiveAuditBody, StartRecursiveAuditResult, getAuditAPI } from "./getIntlayerAPI/audit.js";
|
|
5
|
+
import { AuditEvent, DiscoverUrlsParams, DiscoverUrlsResult, GetRecursiveAuditStatusParams, GetRecursiveAuditStatusResult, RecursiveAuditJobParams, ScanUrlBody, StartRecursiveAuditBody, StartRecursiveAuditResult, getAuditAPI } from "./getIntlayerAPI/audit.js";
|
|
6
6
|
import { BitbucketAuthCallbackBody, BitbucketAuthCallbackResult, BitbucketCheckConfigBody, BitbucketCheckConfigResult, BitbucketGetAuthUrlResult, BitbucketGetConfigFileBody, BitbucketGetConfigFileResult, BitbucketListReposResult, BitbucketRepository, getBitbucketAPI } from "./getIntlayerAPI/bitbucket.js";
|
|
7
7
|
import { getDictionaryAPI } from "./getIntlayerAPI/dictionary.js";
|
|
8
8
|
import { getEditorAPI } from "./getIntlayerAPI/editor.js";
|
|
@@ -19,4 +19,4 @@ import { getUserAPI } from "./getIntlayerAPI/user.js";
|
|
|
19
19
|
import { IntlayerAPI, getIntlayerAPI } from "./getIntlayerAPI/index.js";
|
|
20
20
|
import { IntlayerAPIProxy, getIntlayerAPIProxy } from "./proxy.js";
|
|
21
21
|
import { AIOptions } from "./types.js";
|
|
22
|
-
export { AIOptions, AskDocQuestionBody, AskDocQuestionResult, AuditEvent, AutocompleteBody, BitbucketAuthCallbackBody, BitbucketAuthCallbackResult, BitbucketCheckConfigBody, BitbucketCheckConfigResult, BitbucketGetAuthUrlResult, BitbucketGetConfigFileBody, BitbucketGetConfigFileResult, BitbucketListReposResult, BitbucketRepository, FetcherOptions, GetRecursiveAuditStatusParams, GetRecursiveAuditStatusResult, GitHubAuthCallbackBody, GitHubAuthCallbackResult, GitHubCheckConfigBody, GitHubCheckConfigResult, GitHubGetAuthUrlResult, GitHubGetConfigFileBody, GitHubGetConfigFileResult, GitHubListReposResult, GitHubRepository, GitLabAuthCallbackBody, GitLabAuthCallbackResult, GitLabCheckConfigBody, GitLabCheckConfigResult, GitLabGetAuthUrlResult, GitLabGetConfigFileBody, GitLabGetConfigFileResult, GitLabListProjectsResult, GitLabProject, IntlayerAPI, IntlayerAPIProxy, ScanUrlBody, StartRecursiveAuditBody, StartRecursiveAuditResult, fetchDistantDictionaries, fetchDistantDictionary, fetcher, fetcherOptions, getAiAPI, getAuditAPI, getBitbucketAPI, getDictionaryAPI, getEditorAPI, getGithubAPI, getGitlabAPI, getIntlayerAPI, getIntlayerAPIProxy, getNewsletterAPI, getOAuthAPI, getOrganizationAPI, getProjectAPI, getSearchAPI, getStripeAPI, getTagAPI, getUserAPI };
|
|
22
|
+
export { AIOptions, AskDocQuestionBody, AskDocQuestionResult, AuditEvent, AutocompleteBody, BitbucketAuthCallbackBody, BitbucketAuthCallbackResult, BitbucketCheckConfigBody, BitbucketCheckConfigResult, BitbucketGetAuthUrlResult, BitbucketGetConfigFileBody, BitbucketGetConfigFileResult, BitbucketListReposResult, BitbucketRepository, DiscoverUrlsParams, DiscoverUrlsResult, FetcherOptions, GetRecursiveAuditStatusParams, GetRecursiveAuditStatusResult, GitHubAuthCallbackBody, GitHubAuthCallbackResult, GitHubCheckConfigBody, GitHubCheckConfigResult, GitHubGetAuthUrlResult, GitHubGetConfigFileBody, GitHubGetConfigFileResult, GitHubListReposResult, GitHubRepository, GitLabAuthCallbackBody, GitLabAuthCallbackResult, GitLabCheckConfigBody, GitLabCheckConfigResult, GitLabGetAuthUrlResult, GitLabGetConfigFileBody, GitLabGetConfigFileResult, GitLabListProjectsResult, GitLabProject, IntlayerAPI, IntlayerAPIProxy, RecursiveAuditJobParams, ScanUrlBody, StartRecursiveAuditBody, StartRecursiveAuditResult, fetchDistantDictionaries, fetchDistantDictionary, fetcher, fetcherOptions, getAiAPI, getAuditAPI, getBitbucketAPI, getDictionaryAPI, getEditorAPI, getGithubAPI, getGitlabAPI, getIntlayerAPI, getIntlayerAPIProxy, getNewsletterAPI, getOAuthAPI, getOrganizationAPI, getProjectAPI, getSearchAPI, getStripeAPI, getTagAPI, getUserAPI };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ResponseData } from "../utils/responseData.js";
|
|
2
|
-
import { IntlayerConfig } from "@intlayer/types";
|
|
2
|
+
import { IntlayerConfig } from "@intlayer/types/config";
|
|
3
3
|
|
|
4
4
|
//#region ../../intlayer-editor/server/dist/controllers/configuration.controller.d.ts
|
|
5
5
|
//#region src/controllers/configuration.controller.d.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ResponseData } from "../utils/responseData.js";
|
|
2
2
|
import { UnmergedDictionaries } from "../../../../@intlayer/unmerged-dictionaries-entry/dist/types/index.js";
|
|
3
|
-
import { Dictionary } from "@intlayer/types";
|
|
4
3
|
import { DictionaryStatus } from "@intlayer/chokidar/build";
|
|
4
|
+
import { Dictionary } from "@intlayer/types/dictionary";
|
|
5
5
|
|
|
6
6
|
//#region ../../intlayer-editor/server/dist/controllers/dictionary.controller.d.ts
|
|
7
7
|
//#region src/controllers/dictionary.controller.d.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.controller.d.ts","names":["ResponseData","
|
|
1
|
+
{"version":3,"file":"dictionary.controller.d.ts","names":["ResponseData","FastifyReply","FastifyRequest","DictionaryStatus","Dictionary","UnmergedDictionaries","GetEditorDictionariesResult","getDictionaries","Promise","_req","res","WriteContentDeclarationBody","dictionary","WriteContentDeclarationResultData","status","path","WriteContentDeclarationResult","writeContentDeclaration","Body","req"],"sources":["../../../../../../../../intlayer-editor/server/dist/controllers/dictionary.controller.d.ts"],"mappings":";;;;;;;KAOKM,2BAAAA,GAA8BN,YAAAA,CAAaK,oBAAAA;;;;KAK3CM,2BAAAA;EACHC,UAAAA,EAAYR,UAAAA;AAAAA;AAAAA,KAETS,iCAAAA;EACHC,MAAAA,EAAQX,gBAAAA;EACRY,IAAAA;AAAAA;AAAAA,KAEGC,6BAAAA,GAAgChB,YAAAA,CAAaa,iCAAAA"}
|
package/dist/types/proxy.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/api",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.3.0-canary.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "SDK for interacting with the Intlayer API, enabling content auditing, and managing organizations, projects, and users.",
|
|
6
6
|
"keywords": [
|
|
@@ -55,25 +55,25 @@
|
|
|
55
55
|
"./package.json"
|
|
56
56
|
],
|
|
57
57
|
"scripts": {
|
|
58
|
-
"build": "tsdown --config tsdown.config.ts",
|
|
59
|
-
"build:ci": "tsdown --config tsdown.config.ts",
|
|
60
|
-
"clean": "rimraf ./dist .turbo",
|
|
61
|
-
"dev": "tsdown --config tsdown.config.ts --watch",
|
|
62
|
-
"format": "biome format . --check",
|
|
63
|
-
"format:fix": "biome format --write .",
|
|
64
|
-
"lint": "biome lint .",
|
|
65
|
-
"lint:fix": "biome lint --write .",
|
|
58
|
+
"build": "bun --bun tsdown --config tsdown.config.ts",
|
|
59
|
+
"build:ci": "bun --bun tsdown --config tsdown.config.ts",
|
|
60
|
+
"clean": "bun --bun rimraf ./dist .turbo",
|
|
61
|
+
"dev": "bun --bun tsdown --config tsdown.config.ts --watch",
|
|
62
|
+
"format": "bun --bun biome format . --check",
|
|
63
|
+
"format:fix": "bun --bun biome format --write .",
|
|
64
|
+
"lint": "bun --bun biome lint .",
|
|
65
|
+
"lint:fix": "bun --bun biome lint --write .",
|
|
66
66
|
"prepublish": "cp -f ../../../README.md ./README.md",
|
|
67
67
|
"publish": "bun publish || true",
|
|
68
68
|
"publish:canary": "bun publish --access public --tag canary || true",
|
|
69
69
|
"publish:latest": "bun publish --access public --tag latest || true",
|
|
70
|
-
"test": "vitest run",
|
|
71
|
-
"test:watch": "vitest",
|
|
70
|
+
"test": "bun --bun vitest run",
|
|
71
|
+
"test:watch": "bun --bun vitest",
|
|
72
72
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@intlayer/config": "8.
|
|
76
|
-
"@intlayer/types": "8.
|
|
75
|
+
"@intlayer/config": "8.3.0-canary.0",
|
|
76
|
+
"@intlayer/types": "8.3.0-canary.0"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@types/node": "25.3.5",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@utils/ts-config-types": "1.0.4",
|
|
82
82
|
"@utils/tsdown-config": "1.0.4",
|
|
83
83
|
"rimraf": "6.1.3",
|
|
84
|
-
"tsdown": "0.21.
|
|
84
|
+
"tsdown": "0.21.1",
|
|
85
85
|
"typescript": "5.9.3",
|
|
86
86
|
"vitest": "4.0.18"
|
|
87
87
|
},
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { TagAPI } from "../types/tag.types.js";
|
|
2
|
-
import { DiscussionAPI } from "../types/discussion.types.js";
|
|
3
|
-
import { PaginatedResponse, ResponseData } from "../utils/responseData.js";
|
|
4
|
-
import { AIConfig, AIOptions, AiProviders, ChatCompletionRequestMessage } from "../../../../../packages/@intlayer/ai/dist/types/aiSdk.js";
|
|
5
|
-
import { AuditFileResultData } from "../../../../../packages/@intlayer/ai/dist/types/auditDictionaryMetadata/index.js";
|
|
6
|
-
import { CustomQueryResultData } from "../../../../../packages/@intlayer/ai/dist/types/customQuery.js";
|
|
7
|
-
import { TranslateJSONResultData } from "../../../../../packages/@intlayer/ai/dist/types/translateJSON/index.js";
|
|
8
|
-
import { AskDocQuestionResult as AskDocQuestionResult$1 } from "../utils/AI/askDocQuestion/askDocQuestion.js";
|
|
9
|
-
import { AuditFileResultData as AuditFileResultData$1 } from "../utils/AI/auditDictionary/index.js";
|
|
10
|
-
import { AuditDictionaryFieldResultData } from "../utils/AI/auditDictionaryField/index.js";
|
|
11
|
-
import { TranslateJSONResultData as TranslateJSONResultData$1 } from "../utils/AI/auditTag/index.js";
|
|
12
|
-
import { CustomQueryOptions } from "../utils/AI/customQuery/index.js";
|
|
13
|
-
import { TranslateJSONOptions } from "../utils/AI/translateJSON/index.js";
|
|
14
|
-
import { DiscussionFiltersParams } from "../utils/filtersAndPagination/getDiscussionFiltersAndPagination.js";
|
|
15
|
-
import { KeyPath, Locale } from "@intlayer/types";
|
|
16
|
-
|
|
17
|
-
//#region ../../../apps/backend/dist/types/controllers/ai.controller.d.ts
|
|
18
|
-
//#region src/controllers/ai.controller.d.ts
|
|
19
|
-
type ReplaceAIConfigByOptions<T> = Omit<T, 'aiConfig'> & {
|
|
20
|
-
aiOptions?: AIOptions;
|
|
21
|
-
};
|
|
22
|
-
type CustomQueryBody = ReplaceAIConfigByOptions<CustomQueryOptions> & {
|
|
23
|
-
tagsKeys?: string[];
|
|
24
|
-
applicationContext?: string;
|
|
25
|
-
};
|
|
26
|
-
type CustomQueryResult = ResponseData<CustomQueryResultData>;
|
|
27
|
-
type TranslateJSONBody = Omit<ReplaceAIConfigByOptions<TranslateJSONOptions<JSON>>, 'tags'> & {
|
|
28
|
-
tagsKeys?: string[];
|
|
29
|
-
};
|
|
30
|
-
type TranslateJSONResult = ResponseData<TranslateJSONResultData<JSON>>;
|
|
31
|
-
type AuditContentDeclarationBody = {
|
|
32
|
-
aiOptions?: AIOptions;
|
|
33
|
-
locales: Locale[];
|
|
34
|
-
defaultLocale: Locale;
|
|
35
|
-
fileContent: string;
|
|
36
|
-
filePath?: string;
|
|
37
|
-
tagsKeys?: string[];
|
|
38
|
-
};
|
|
39
|
-
type AuditContentDeclarationResult = ResponseData<AuditFileResultData$1>;
|
|
40
|
-
/**
|
|
41
|
-
* Retrieves a list of dictionaries based on filters and pagination.
|
|
42
|
-
*/
|
|
43
|
-
type AuditContentDeclarationFieldBody = {
|
|
44
|
-
aiOptions?: AIOptions;
|
|
45
|
-
locales: Locale[];
|
|
46
|
-
fileContent: string;
|
|
47
|
-
filePath?: string;
|
|
48
|
-
tagsKeys?: string[];
|
|
49
|
-
keyPath: KeyPath[];
|
|
50
|
-
};
|
|
51
|
-
type AuditContentDeclarationFieldResult = ResponseData<AuditDictionaryFieldResultData>;
|
|
52
|
-
/**
|
|
53
|
-
* Retrieves a list of dictionaries based on filters and pagination.
|
|
54
|
-
*/
|
|
55
|
-
type AuditContentDeclarationMetadataBody = {
|
|
56
|
-
aiOptions?: AIOptions;
|
|
57
|
-
fileContent: string;
|
|
58
|
-
};
|
|
59
|
-
type AuditContentDeclarationMetadataResult = ResponseData<AuditFileResultData>;
|
|
60
|
-
/**
|
|
61
|
-
* Retrieves a list of dictionaries based on filters and pagination.
|
|
62
|
-
*/
|
|
63
|
-
type AuditTagBody = {
|
|
64
|
-
aiOptions?: AIOptions;
|
|
65
|
-
tag: TagAPI;
|
|
66
|
-
};
|
|
67
|
-
type AuditTagResult = ResponseData<TranslateJSONResultData$1>;
|
|
68
|
-
/**
|
|
69
|
-
* Retrieves a list of dictionaries based on filters and pagination.
|
|
70
|
-
*/
|
|
71
|
-
type AskDocQuestionResult = ResponseData<AskDocQuestionResult$1>;
|
|
72
|
-
type AutocompleteResponse = ResponseData<{
|
|
73
|
-
autocompletion: string;
|
|
74
|
-
}>;
|
|
75
|
-
type GetDiscussionsParams = ({
|
|
76
|
-
page?: string | number;
|
|
77
|
-
pageSize?: string | number;
|
|
78
|
-
includeMessages?: 'true' | 'false';
|
|
79
|
-
} & DiscussionFiltersParams) | undefined;
|
|
80
|
-
type GetDiscussionsResult = PaginatedResponse<DiscussionAPI>;
|
|
81
|
-
/**
|
|
82
|
-
* Retrieves a list of discussions with filters and pagination.
|
|
83
|
-
* Only the owner or admins can access. By default, users only see their own.
|
|
84
|
-
*/
|
|
85
|
-
//#endregion
|
|
86
|
-
export { AskDocQuestionResult, AuditContentDeclarationBody, AuditContentDeclarationFieldBody, AuditContentDeclarationFieldResult, AuditContentDeclarationMetadataBody, AuditContentDeclarationMetadataResult, AuditContentDeclarationResult, AuditTagBody, AuditTagResult, AutocompleteResponse, CustomQueryBody, CustomQueryResult, GetDiscussionsParams, GetDiscussionsResult, TranslateJSONBody, TranslateJSONResult };
|
|
87
|
-
//# sourceMappingURL=ai.controller.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ai.controller.d.ts","names":["AskDocQuestionResult","AskDocQuestionResult$1","TagAPI","AuditFileResultData","AuditDictionaryFieldResultData","AuditFileResultData$1","TranslateJSONResultData","CustomQueryOptions","CustomQueryResultData","TranslateJSONOptions","TranslateJSONResultData$1","DiscussionAPI","DiscussionFiltersParams","PaginatedResponse","ResponseData","AIConfig","AIOptions","AIOptions$1","AIProvider","ChatCompletionRequestMessage","ChatCompletionRequestMessage$1","KeyPath","Locale","FastifyReply","FastifyRequest","ReplaceAIConfigByOptions","T","Omit","aiOptions","CustomQueryBody","tagsKeys","applicationContext","CustomQueryResult","customQuery","Promise","Body","request","reply","TranslateJSONBody","JSON","TranslateJSONResult","translateJSON","AuditContentDeclarationBody","locales","defaultLocale","fileContent","filePath","AuditContentDeclarationResult","auditContentDeclaration","AuditContentDeclarationFieldBody","keyPath","AuditContentDeclarationFieldResult","auditContentDeclarationField","AuditContentDeclarationMetadataBody","AuditContentDeclarationMetadataResult","auditContentDeclarationMetadata","AuditTagBody","tag","AuditTagResult","auditTag","AskDocQuestionBody","messages","discussionId","askDocQuestion","AutocompleteBody","text","contextBefore","currentLine","contextAfter","AutocompleteResponse","autocompletion","autocomplete","GetDiscussionsParams","page","pageSize","includeMessages","GetDiscussionsResult","getDiscussions","Querystring"],"sources":["../../../../../../../../../../apps/backend/dist/types/controllers/ai.controller.d.ts"],"mappings":";;;;;;;;;;;;;;;;;;KAgBKyB,wBAAAA,MAA8BE,IAAAA,CAAKD,CAAAA;EACtCE,SAAAA,GAAYX,SAAAA;AAAAA;AAAAA,KAETY,eAAAA,GAAkBJ,wBAAAA,CAAyBlB,kBAAAA;EAC9CuB,QAAAA;EACAC,kBAAAA;AAAAA;AAAAA,KAEGC,iBAAAA,GAAoBlB,YAAAA,CAAaN,qBAAAA;AAAAA,KAIjC8B,iBAAAA,GAAoBX,IAAAA,CAAKF,wBAAAA,CAAyBhB,oBAAAA,CAAqB8B,IAAAA;EAC1ET,QAAAA;AAAAA;AAAAA,KAEGU,mBAAAA,GAAsB1B,YAAAA,CAAaJ,uBAAAA,CAA0B6B,IAAAA;AAAAA,KAI7DG,2BAAAA;EACHd,SAAAA,GAAYX,SAAAA;EACZ0B,OAAAA,EAASrB,MAAAA;EACTsB,aAAAA,EAAetB,MAAAA;EACfuB,WAAAA;EACAC,QAAAA;EACAhB,QAAAA;AAAAA;AAAAA,KAEGiB,6BAAAA,GAAgCjC,YAAAA,CAAaX,qBAAAA;;AArB9B;;KA4Bf8C,gCAAAA;EACHrB,SAAAA,GAAYX,SAAAA;EACZ0B,OAAAA,EAASrB,MAAAA;EACTuB,WAAAA;EACAC,QAAAA;EACAhB,QAAAA;EACAoB,OAAAA,EAAS7B,OAAAA;AAAAA;AAAAA,KAEN8B,kCAAAA,GAAqCrC,YAAAA,CAAaV,8BAAAA;;;;KAOlDiD,mCAAAA;EACHzB,SAAAA,GAAYX,SAAAA;EACZ4B,WAAAA;AAAAA;AAAAA,KAEGS,qCAAAA,GAAwCxC,YAAAA,CAAaT,mBAAAA;;;;KAOrDmD,YAAAA;EACH5B,SAAAA,GAAYX,SAAAA;EACZwC,GAAAA,EAAKvD,MAAAA;AAAAA;AAAAA,KAEFwD,cAAAA,GAAiB5C,YAAAA,CAAaR,yBAAAA;;;;KAW9BN,oBAAAA,GAAuBc,YAAAA,CAAab,sBAAAA;AAAAA,KAWpCoE,oBAAAA,GAAuBvD,YAAAA;EAC1BwD,cAAAA;AAAAA;AAAAA,KAKGE,oBAAAA;EACHC,IAAAA;EACAC,QAAAA;EACAC,eAAAA;AAAAA,IACE/D,uBAAAA;AAAAA,KACCgE,oBAAAA,GAAuB/D,iBAAAA,CAAkBF,aAAAA"}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { Dictionary as Dictionary$1, DictionaryAPI, DictionaryCreationData } from "../types/dictionary.types.js";
|
|
2
|
-
import { PaginatedResponse, ResponseData } from "../utils/responseData.js";
|
|
3
|
-
import { FiltersAndPagination } from "../utils/filtersAndPagination/getFiltersAndPaginationFromBody.js";
|
|
4
|
-
import { DictionaryFiltersParams } from "../utils/filtersAndPagination/getDictionaryFiltersAndPagination.js";
|
|
5
|
-
import { Dictionary, DictionaryId, LocalDictionaryId } from "@intlayer/types";
|
|
6
|
-
|
|
7
|
-
//#region ../../../apps/backend/dist/types/controllers/dictionary.controller.d.ts
|
|
8
|
-
//#region src/controllers/dictionary.controller.d.ts
|
|
9
|
-
type GetDictionariesParams = FiltersAndPagination<DictionaryFiltersParams>;
|
|
10
|
-
type GetDictionariesResult = PaginatedResponse<DictionaryAPI>;
|
|
11
|
-
/**
|
|
12
|
-
* Retrieves a list of dictionaries based on filters and pagination.
|
|
13
|
-
*/
|
|
14
|
-
type GetDictionariesKeysResult = ResponseData<string[]>;
|
|
15
|
-
/**
|
|
16
|
-
* Retrieves a list of dictionaries keys based on filters and pagination.
|
|
17
|
-
*/
|
|
18
|
-
type GetDictionariesUpdateTimestampResult = ResponseData<Record<DictionaryId, {
|
|
19
|
-
key: string;
|
|
20
|
-
updatedAt: number;
|
|
21
|
-
}>>;
|
|
22
|
-
/**
|
|
23
|
-
* Retrieves a list of dictionaries keys based on filters and pagination.
|
|
24
|
-
*/
|
|
25
|
-
type GetDictionaryParams = {
|
|
26
|
-
dictionaryKey: string;
|
|
27
|
-
};
|
|
28
|
-
type GetDictionaryQuery = {
|
|
29
|
-
version?: string;
|
|
30
|
-
};
|
|
31
|
-
type GetDictionaryResult = ResponseData<DictionaryAPI>;
|
|
32
|
-
/**
|
|
33
|
-
* Retrieves a list of dictionaries based on filters and pagination.
|
|
34
|
-
*/
|
|
35
|
-
type AddDictionaryBody = {
|
|
36
|
-
dictionary: DictionaryCreationData;
|
|
37
|
-
};
|
|
38
|
-
type AddDictionaryResult = ResponseData<DictionaryAPI>;
|
|
39
|
-
/**
|
|
40
|
-
* Adds a new dictionary to the database.
|
|
41
|
-
*/
|
|
42
|
-
type PushDictionariesBody = {
|
|
43
|
-
dictionaries: Dictionary[];
|
|
44
|
-
};
|
|
45
|
-
type PushDictionariesResultData = {
|
|
46
|
-
newDictionaries: {
|
|
47
|
-
key: string;
|
|
48
|
-
localId: LocalDictionaryId;
|
|
49
|
-
id: string | undefined;
|
|
50
|
-
}[];
|
|
51
|
-
updatedDictionaries: {
|
|
52
|
-
key: string;
|
|
53
|
-
localId: LocalDictionaryId;
|
|
54
|
-
id: string | undefined;
|
|
55
|
-
}[];
|
|
56
|
-
error: {
|
|
57
|
-
id: string | undefined;
|
|
58
|
-
key: string;
|
|
59
|
-
localId: LocalDictionaryId | undefined;
|
|
60
|
-
message: string;
|
|
61
|
-
}[];
|
|
62
|
-
};
|
|
63
|
-
type PushDictionariesResult = ResponseData<PushDictionariesResultData>;
|
|
64
|
-
/**
|
|
65
|
-
* Check each dictionaries, add the new ones and update the existing ones.
|
|
66
|
-
*/
|
|
67
|
-
type UpdateDictionaryBody = Partial<Dictionary$1>;
|
|
68
|
-
type UpdateDictionaryResult = ResponseData<DictionaryAPI>;
|
|
69
|
-
/**
|
|
70
|
-
* Updates an existing dictionary in the database.
|
|
71
|
-
*/
|
|
72
|
-
type DeleteDictionaryParam = {
|
|
73
|
-
dictionaryId: string;
|
|
74
|
-
};
|
|
75
|
-
type DeleteDictionaryResult = ResponseData<DictionaryAPI>;
|
|
76
|
-
/**
|
|
77
|
-
* Deletes a dictionary from the database by its ID.
|
|
78
|
-
*/
|
|
79
|
-
//#endregion
|
|
80
|
-
export { AddDictionaryBody, AddDictionaryResult, DeleteDictionaryParam, DeleteDictionaryResult, GetDictionariesKeysResult, GetDictionariesParams, GetDictionariesResult, GetDictionariesUpdateTimestampResult, GetDictionaryParams, GetDictionaryQuery, GetDictionaryResult, PushDictionariesBody, PushDictionariesResult, UpdateDictionaryBody, UpdateDictionaryResult };
|
|
81
|
-
//# sourceMappingURL=dictionary.controller.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.controller.d.ts","names":["Dictionary","Dictionary$1","DictionaryAPI","DictionaryCreationData","FiltersAndPagination","PaginatedResponse","ResponseData","DictionaryFiltersParams","DictionaryId","LocalDictionaryId","FastifyReply","FastifyRequest","GetDictionariesParams","GetDictionariesResult","getDictionaries","Promise","Querystring","request","reply","GetDictionariesKeysResult","getDictionariesKeys","_request","GetDictionariesUpdateTimestampResult","Record","key","updatedAt","getDictionariesUpdateTimestamp","GetDictionaryParams","dictionaryKey","GetDictionaryQuery","version","GetDictionaryResult","getDictionaryByKey","Params","AddDictionaryBody","dictionary","AddDictionaryResult","addDictionary","Body","PushDictionariesBody","dictionaries","PushDictionariesResultData","newDictionaries","localId","id","updatedDictionaries","error","message","PushDictionariesResult","pushDictionaries","UpdateDictionaryParam","dictionaryId","UpdateDictionaryBody","Partial","UpdateDictionaryResult","updateDictionary","DeleteDictionaryParam","DeleteDictionaryResult","deleteDictionary"],"sources":["../../../../../../../../../../apps/backend/dist/types/controllers/dictionary.controller.d.ts"],"mappings":";;;;;;;;KAQKY,qBAAAA,GAAwBR,oBAAAA,CAAqBG,uBAAAA;AAAAA,KAC7CM,qBAAAA,GAAwBR,iBAAAA,CAAkBH,aAAAA;;;AAD0B;KAQpEiB,yBAAAA,GAA4Bb,YAAAA;AADE;;;AAAA,KAM9BgB,oCAAAA,GAAuChB,YAAAA,CAAaiB,MAAAA,CAAOf,YAAAA;EAC9DgB,GAAAA;EACAC,SAAAA;AAAAA;;;;KAMGE,mBAAAA;EACHC,aAAAA;AAAAA;AAAAA,KAEGC,kBAAAA;EACHC,OAAAA;AAAAA;AAAAA,KAEGC,mBAAAA,GAAsBzB,YAAAA,CAAaJ,aAAAA;;AAPgE;;KAenGgC,iBAAAA;EACHC,UAAAA,EAAYhC,sBAAAA;AAAAA;AAAAA,KAETiC,mBAAAA,GAAsB9B,YAAAA,CAAaJ,aAAAA;AAb/B;;;AAAA,KAoBJqC,oBAAAA;EACHC,YAAAA,EAAcxC,UAAAA;AAAAA;AAAAA,KAEXyC,0BAAAA;EACHC,eAAAA;IACElB,GAAAA;IACAmB,OAAAA,EAASlC,iBAAAA;IACTmC,EAAAA;EAAAA;EAEFC,mBAAAA;IACErB,GAAAA;IACAmB,OAAAA,EAASlC,iBAAAA;IACTmC,EAAAA;EAAAA;EAEFE,KAAAA;IACEF,EAAAA;IACApB,GAAAA;IACAmB,OAAAA,EAASlC,iBAAAA;IACTsC,OAAAA;EAAAA;AAAAA;AAAAA,KAGCC,sBAAAA,GAAyB1C,YAAAA,CAAamC,0BAAAA;;;;KAUtCW,oBAAAA,GAAuBC,OAAAA,CAAQpD,YAAAA;AAAAA,KAC/BqD,sBAAAA,GAAyBhD,YAAAA,CAAaJ,aAAAA;;;;KAQtCsD,qBAAAA;EACHL,YAAAA;AAAAA;AAAAA,KAEGM,sBAAAA,GAAyBnD,YAAAA,CAAaJ,aAAAA;;AAd7B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|