@intlayer/api 9.0.0-canary.9 → 9.0.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/cms/createAuthManager.cjs +116 -0
- package/dist/cjs/cms/createAuthManager.cjs.map +1 -0
- package/dist/cjs/cms/createIntlayerCMS.cjs +64 -0
- package/dist/cjs/cms/createIntlayerCMS.cjs.map +1 -0
- package/dist/cjs/cms/index.cjs +7 -0
- package/dist/cjs/distantDictionary/fetchDistantDictionaries.cjs +3 -2
- package/dist/cjs/distantDictionary/fetchDistantDictionaries.cjs.map +1 -1
- package/dist/cjs/distantDictionary/fetchDistantDictionary.cjs +3 -2
- package/dist/cjs/distantDictionary/fetchDistantDictionary.cjs.map +1 -1
- package/dist/cjs/fetcher.cjs +2 -1
- package/dist/cjs/fetcher.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/ai.cjs +9 -0
- package/dist/cjs/getIntlayerAPI/ai.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/analytics.cjs +64 -0
- package/dist/cjs/getIntlayerAPI/analytics.cjs.map +1 -0
- package/dist/cjs/getIntlayerAPI/asset.cjs +9 -0
- package/dist/cjs/getIntlayerAPI/asset.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/audit.cjs +11 -1
- package/dist/cjs/getIntlayerAPI/audit.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/bitbucket.cjs +9 -0
- package/dist/cjs/getIntlayerAPI/bitbucket.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/dictionary.cjs +9 -0
- package/dist/cjs/getIntlayerAPI/dictionary.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/editor.cjs +9 -0
- package/dist/cjs/getIntlayerAPI/editor.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/environment.cjs +9 -0
- package/dist/cjs/getIntlayerAPI/environment.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/github.cjs +9 -0
- package/dist/cjs/getIntlayerAPI/github.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/gitlab.cjs +9 -0
- package/dist/cjs/getIntlayerAPI/gitlab.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/index.cjs +6 -2
- package/dist/cjs/getIntlayerAPI/index.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/newsletter.cjs +9 -0
- package/dist/cjs/getIntlayerAPI/newsletter.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/oAuth.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/organization.cjs +19 -0
- package/dist/cjs/getIntlayerAPI/organization.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/project.cjs +9 -0
- package/dist/cjs/getIntlayerAPI/project.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/reviewer.cjs +9 -0
- package/dist/cjs/getIntlayerAPI/reviewer.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/search.cjs +9 -0
- package/dist/cjs/getIntlayerAPI/search.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/showcaseProject.cjs +9 -0
- package/dist/cjs/getIntlayerAPI/showcaseProject.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/status.cjs +48 -0
- package/dist/cjs/getIntlayerAPI/status.cjs.map +1 -0
- package/dist/cjs/getIntlayerAPI/stripe.cjs +13 -2
- package/dist/cjs/getIntlayerAPI/stripe.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/tag.cjs +9 -0
- package/dist/cjs/getIntlayerAPI/tag.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/translate.cjs +9 -0
- package/dist/cjs/getIntlayerAPI/translate.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/user.cjs +9 -0
- package/dist/cjs/getIntlayerAPI/user.cjs.map +1 -1
- package/dist/cjs/index.cjs +33 -3
- package/dist/cjs/proxy.cjs +82 -97
- package/dist/cjs/proxy.cjs.map +1 -1
- package/dist/esm/cms/createAuthManager.mjs +115 -0
- package/dist/esm/cms/createAuthManager.mjs.map +1 -0
- package/dist/esm/cms/createIntlayerCMS.mjs +62 -0
- package/dist/esm/cms/createIntlayerCMS.mjs.map +1 -0
- package/dist/esm/cms/index.mjs +4 -0
- package/dist/esm/distantDictionary/fetchDistantDictionaries.mjs +3 -2
- package/dist/esm/distantDictionary/fetchDistantDictionaries.mjs.map +1 -1
- package/dist/esm/distantDictionary/fetchDistantDictionary.mjs +3 -2
- package/dist/esm/distantDictionary/fetchDistantDictionary.mjs.map +1 -1
- package/dist/esm/fetcher.mjs +2 -1
- package/dist/esm/fetcher.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/ai.mjs +9 -1
- package/dist/esm/getIntlayerAPI/ai.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/analytics.mjs +62 -0
- package/dist/esm/getIntlayerAPI/analytics.mjs.map +1 -0
- package/dist/esm/getIntlayerAPI/asset.mjs +9 -1
- package/dist/esm/getIntlayerAPI/asset.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/audit.mjs +11 -2
- package/dist/esm/getIntlayerAPI/audit.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/bitbucket.mjs +9 -1
- package/dist/esm/getIntlayerAPI/bitbucket.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/dictionary.mjs +9 -1
- package/dist/esm/getIntlayerAPI/dictionary.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/editor.mjs +9 -1
- package/dist/esm/getIntlayerAPI/editor.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/environment.mjs +9 -1
- package/dist/esm/getIntlayerAPI/environment.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/github.mjs +9 -1
- package/dist/esm/getIntlayerAPI/github.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/gitlab.mjs +9 -1
- package/dist/esm/getIntlayerAPI/gitlab.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/index.mjs +6 -2
- package/dist/esm/getIntlayerAPI/index.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/newsletter.mjs +9 -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 +19 -1
- package/dist/esm/getIntlayerAPI/organization.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/project.mjs +9 -1
- package/dist/esm/getIntlayerAPI/project.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/reviewer.mjs +9 -1
- package/dist/esm/getIntlayerAPI/reviewer.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/search.mjs +9 -1
- package/dist/esm/getIntlayerAPI/search.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/showcaseProject.mjs +9 -1
- package/dist/esm/getIntlayerAPI/showcaseProject.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/status.mjs +46 -0
- package/dist/esm/getIntlayerAPI/status.mjs.map +1 -0
- package/dist/esm/getIntlayerAPI/stripe.mjs +13 -3
- package/dist/esm/getIntlayerAPI/stripe.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/tag.mjs +9 -1
- package/dist/esm/getIntlayerAPI/tag.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/translate.mjs +9 -1
- package/dist/esm/getIntlayerAPI/translate.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/user.mjs +9 -1
- package/dist/esm/getIntlayerAPI/user.mjs.map +1 -1
- package/dist/esm/index.mjs +25 -21
- package/dist/esm/proxy.mjs +82 -97
- package/dist/esm/proxy.mjs.map +1 -1
- package/dist/types/@intlayer/unmerged-dictionaries-entry/dist/types/index.d.ts +9 -0
- package/dist/types/@intlayer/unmerged-dictionaries-entry/dist/types/index.d.ts.map +1 -0
- package/dist/types/cms/createAuthManager.d.ts +102 -0
- package/dist/types/cms/createAuthManager.d.ts.map +1 -0
- package/dist/types/cms/createIntlayerCMS.d.ts +79 -0
- package/dist/types/cms/createIntlayerCMS.d.ts.map +1 -0
- package/dist/types/cms/index.d.ts +3 -0
- package/dist/types/distantDictionary/fetchDistantDictionaries.d.ts +1 -2
- package/dist/types/distantDictionary/fetchDistantDictionaries.d.ts.map +1 -1
- package/dist/types/distantDictionary/fetchDistantDictionary.d.ts +1 -2
- package/dist/types/distantDictionary/fetchDistantDictionary.d.ts.map +1 -1
- package/dist/types/fetcher.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/ai.d.ts +23 -3
- package/dist/types/getIntlayerAPI/ai.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/analytics.d.ts +29 -0
- package/dist/types/getIntlayerAPI/analytics.d.ts.map +1 -0
- package/dist/types/getIntlayerAPI/asset.d.ts +20 -2
- package/dist/types/getIntlayerAPI/asset.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/audit.d.ts +25 -3
- package/dist/types/getIntlayerAPI/audit.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/bitbucket.d.ts +16 -2
- package/dist/types/getIntlayerAPI/bitbucket.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/dictionary.d.ts +23 -6
- package/dist/types/getIntlayerAPI/dictionary.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/editor.d.ts +17 -3
- package/dist/types/getIntlayerAPI/editor.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/environment.d.ts +18 -3
- package/dist/types/getIntlayerAPI/environment.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/github.d.ts +17 -2
- package/dist/types/getIntlayerAPI/github.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/gitlab.d.ts +16 -2
- package/dist/types/getIntlayerAPI/gitlab.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/index.d.ts +6 -3
- package/dist/types/getIntlayerAPI/index.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/newsletter.d.ts +15 -3
- package/dist/types/getIntlayerAPI/newsletter.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/oAuth.d.ts +1 -2
- package/dist/types/getIntlayerAPI/oAuth.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/organization.d.ts +27 -5
- package/dist/types/getIntlayerAPI/organization.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/project.d.ts +34 -7
- package/dist/types/getIntlayerAPI/project.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/reviewer.d.ts +49 -5
- package/dist/types/getIntlayerAPI/reviewer.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/search.d.ts +13 -3
- package/dist/types/getIntlayerAPI/search.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/showcaseProject.d.ts +27 -6
- package/dist/types/getIntlayerAPI/showcaseProject.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/status.d.ts +35 -0
- package/dist/types/getIntlayerAPI/status.d.ts.map +1 -0
- package/dist/types/getIntlayerAPI/stripe.d.ts +61 -25
- package/dist/types/getIntlayerAPI/stripe.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/tag.d.ts +18 -5
- package/dist/types/getIntlayerAPI/tag.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/translate.d.ts +38 -3
- package/dist/types/getIntlayerAPI/translate.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/user.d.ts +25 -7
- package/dist/types/getIntlayerAPI/user.d.ts.map +1 -1
- package/dist/types/index.d.ts +27 -21
- package/dist/types/intlayer-editor/server/dist/controllers/configuration.controller.d.ts +9 -0
- package/dist/types/intlayer-editor/server/dist/controllers/configuration.controller.d.ts.map +1 -0
- package/dist/types/intlayer-editor/server/dist/controllers/dictionary.controller.d.ts +19 -0
- package/dist/types/intlayer-editor/server/dist/controllers/dictionary.controller.d.ts.map +1 -0
- package/dist/types/intlayer-editor/server/dist/export.d.ts +3 -0
- package/dist/types/intlayer-editor/server/dist/utils/httpStatusCodes.d.ts +408 -0
- package/dist/types/intlayer-editor/server/dist/utils/httpStatusCodes.d.ts.map +1 -0
- package/dist/types/intlayer-editor/server/dist/utils/responseData.d.ts +19 -0
- package/dist/types/intlayer-editor/server/dist/utils/responseData.d.ts.map +1 -0
- package/dist/types/proxy.d.ts +12 -11
- package/dist/types/proxy.d.ts.map +1 -1
- package/dist/types/types.d.ts +1 -1
- package/package.json +31 -7
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/config';\nimport type { FetcherOptions } from './fetcher';\nimport {
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchDistantDictionaries.d.ts","names":[],"sources":["../../../src/distantDictionary/fetchDistantDictionaries.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"fetchDistantDictionaries.d.ts","names":[],"sources":["../../../src/distantDictionary/fetchDistantDictionaries.ts"],"mappings":";;;;;;cAQa,2BAAwB,gBACnB,mBACf,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchDistantDictionary.d.ts","names":[],"sources":["../../../src/distantDictionary/fetchDistantDictionary.ts"],"mappings":";;;;;;
|
|
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":"
|
|
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 {
|
|
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":"
|
|
1
|
+
{"version":3,"file":"ai.d.ts","names":[],"sources":["../../../src/getIntlayerAPI/ai.ts"],"mappings":";;;;;;KA2BY;EACV;EACA,YAAY;EACZ;EACA;EACA;;KAGU;EACV,UAAU;EACV;EACA,aAAa;EACb,UAAU,UAAU;;KAGV;EACN;EAAkB;;EAClB;;KAEM;EACV,UAAU;EACV;EACA,aAAa;EACb,UAAU,UAAU;EACpB,YAAY,QAAQ;;cAKT,WAAQ,iBACH,gBAAc,iBACb;EAYR,cAAA,OAAA,iBAAe,eACR,mBAAc,QAAA;EAkBrB,gBAAA,OAAA,mBAAiB,eACV,mBAAc,QAAA;EAkBrB,0BAAA,OAAA,6BAA2B,eACpB,mBAAc,QAAA;EAkBrB,+BAAA,OAAA,kCAAgC,eACzB,mBAAc,QAAA;EAkBrB,kCAAA,OAAA,qCAAmC,eAC5B,mBAAc,QAAA;EAkBrB,WAAA,OAAA,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;;;;;;;;cA+B3C,YA/B2C;EAjV7C,cAAA,OAAA,iBAAe,eACR,mBAAc,QAAA;EAkBrB,gBAAA,OAAA,mBAAiB,eACV,mBAAc,QAAA;EAkBrB,0BAAA,OAAA,6BAA2B,eACpB,mBAAc,QAAA;EAkBrB,+BAAA,OAAA,kCAAgC,eACzB,mBAAc,QAAA;EAkBrB,kCAAA,OAAA,qCAAmC,eAC5B,mBAAc,QAAA;EAkBrB,WAAA,OAAA,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":"
|
|
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 {
|
|
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":"
|
|
1
|
+
{"version":3,"file":"audit.d.ts","names":[],"sources":["../../../src/getIntlayerAPI/audit.ts"],"mappings":";;;;;;KAgBY;EACV;EACA,aAAa,OAAO;EACpB;;KAGU;EACV;;KAGU;EACV;;KAGU;EACV;EACA;;KAGU;EACV;;KAGU;EACV;;cAGW,cAAW,iBACN,gBAAc,iBACb;EAmBN,eAAA,SAAA,oBAAkB,eACb,mBAAc,QAAA;EAarB,UAAA,OAAA,aAAW,eACJ,mBAAc;EAsErB,sBAAA,OAAA,yBAAuB,eAChB,mBAAc,QAAA;EAiBnB,0BAAA,SAAA,+BAA6B,eACxB,mBAAc,QAAA;EAYnB,uBAAA,SAAA,yBAAuB,eAClB,mBAAc;IAEH;;EAQhB,sBAAA,SAAA,yBAAuB,eAClB,mBAAc;IAEH;;EAQhB,uBAAA,SAAA,yBAAuB,eAClB,mBAAc;IAEH;;;;;;;;;cAwBhB,eA1BmB;EA3InB,eAAA,SAAA,oBAAkB,eACb,mBAAc,QAAA;EAarB,UAAA,OAAA,aAAW,eACJ,mBAAc;EAsErB,sBAAA,OAAA,yBAAuB,eAChB,mBAAc,QAAA;EAiBnB,0BAAA,SAAA,+BAA6B,eACxB,mBAAc,QAAA;EAYnB,uBAAA,SAAA,yBAAuB,eAClB,mBAAc;IAEH;;EAQhB,sBAAA,SAAA,yBAAuB,eAClB,mBAAc;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":"
|
|
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 {
|
|
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[
|
|
11
|
-
pushDictionaries: (dictionaries: PushDictionariesBody[
|
|
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[
|
|
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":"
|
|
1
|
+
{"version":3,"file":"dictionary.d.ts","names":[],"sources":["../../../src/getIntlayerAPI/dictionary.ts"],"mappings":";;;;;;cAsBa,mBAAgB,iBACX,gBAAc,iBACb;EAWL,kBAAA,UAAA,uBAAqB,eACjB,mBAAc,QAAA;EAgBmB,sBAAA,eAAA,mBAAc,QAAA;EAc/C,iCAAA,eAAA,mBAAc,QAAA;EAiBb,gBAAA,eAAA,sCAAoC,UACzC,+BAA6B,eACzB,mBAAc,QAAA;EA8Bd,mBAAA,cAAA,sCAAoC,eACpC,mBAAc,QAAA;EAftB,gBAAA,MAAA,mBAAiB,eACT,mBAAc,QAAA;EA+BhB,mBAAA,YAAA,sBAAoB,eAClB,mBAAc,QAAA;EAiBxB,mBAAA,IAAA,uCAAqC,eAC3B,mBAAc,QAAA;;;;;;;;cA6BnB,oBA7BmB;EArHlB,kBAAA,UAAA,uBAAqB,eACjB,mBAAc,QAAA;EAgBmB,sBAAA,eAAA,mBAAc,QAAA;EAc/C,iCAAA,eAAA,mBAAc,QAAA;EAiBb,gBAAA,eAAA,sCAAoC,UACzC,+BAA6B,eACzB,mBAAc,QAAA;EA8Bd,mBAAA,cAAA,sCAAoC,eACpC,mBAAc,QAAA;EAftB,gBAAA,MAAA,mBAAiB,eACT,mBAAc,QAAA;EA+BhB,mBAAA,YAAA,sBAAoB,eAClB,mBAAc,QAAA;EAiBxB,mBAAA,IAAA,uCAAqC,eAC3B,mBAAc,QAAA"}
|